From 966139fff85a0b6cff888ba46d26af662adafde6 Mon Sep 17 00:00:00 2001 From: michaelsboost Date: Sat, 14 Sep 2024 16:07:42 -0500 Subject: [PATCH] minor bug fix for exports --- go/dist/App.min.js | 54 +++++++++++++++++++++--------------------- go/dist/App.min.js.map | 4 ++-- go/src/App.js | 42 +++++++++++++++++--------------- 3 files changed, 52 insertions(+), 48 deletions(-) diff --git a/go/dist/App.min.js b/go/dist/App.min.js index c2b5ad7..7949364 100644 --- a/go/dist/App.min.js +++ b/go/dist/App.min.js @@ -1,4 +1,4 @@ -(()=>{var w5=(p=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(p,{get:(y,x)=>(typeof require<"u"?require:y)[x]}):p)(function(p){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+p+'" is not supported')});function T0(p,y,x=[]){function $(P,j){return typeof P!="object"||P===null?P:new Proxy(P,{set(D,T,ne){let ue=[...j,T],N=D[T],q=Reflect.set(D,T,$(ne,ue));return N!==ne&&y(ue,N,ne),q},get(D,T){let ne=D[T];return typeof ne=="object"&&ne!==null?$(ne,[...j,T]):ne}})}return $(p,x)}var Mo={name:"kodeWeave",author:{name:"Michael Schwartz",href:"https://michaelsboost.com/",src:"imgs/author.jpg"},version:"1.2.3",url:"https://github.com/michaelsboost/kodeWeave/",license:"https://github.com/michaelsboost/kodeWeave/blob/main/LICENSE"},x5={name:"App name",version:"0.0.1",title:"An attractive title",description:"The most attractive description ever!",author:"kodeWeave",url:"https://michaelsboost.com/",meta:"",libraries:[],html_pre_processor:"html",css_pre_processor:"css",javascript_pre_processor:"javascript",html:"",css:"",javascript:"",logo:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF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wMSwtMC4xMDI0NDYgLTEuMTg3NDgsLTAuMDkyMzggeiIKICAgICAgIGlkPSJwYXRoNDI2MCIgLz4KICA8L2c+Cjwvc3ZnPgo=",console:!1,dark:!0,previewDark:!0,module:!0,autorun:!0,pwa:!1,preview:!0,activePanel:"html",columns:!1,columnsRight:!0},v5={searchLibKey:null,librarySuggestions:null,iframeSize:null,selectedSize:"none",compiledJSX:null,menuDialog:null,settings:null,libraries:null,demos:null,chosenFramework:"",frameworks:{"alpine.js":{libraries:["https://cdn.jsdelivr.net/npm/alpinejs@3.14.1/dist/cdn.min.js"],meta:""},"algolia.js":{libraries:["https://cdn.jsdelivr.net/npm/algoliasearch@4.17.0/dist/algoliasearch.umd.js"],meta:""},angular:{libraries:["https://cdnjs.cloudflare.com/ajax/libs/rxjs/6.6.3/rxjs.umd.min.js","https://cdnjs.cloudflare.com/ajax/libs/core-js/2.5.7/core.js","https://unpkg.com/@angular/core@11.0.5/bundles/core.umd.js","https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.10.3/zone.min.js","https://unpkg.com/@angular/common@11.0.5/bundles/common.umd.js","https://unpkg.com/@angular/compiler@11.0.5/bundles/compiler.umd.js","https://unpkg.com/@angular/platform-browser@11.0.5/bundles/platform-browser.umd.js","https://unpkg.com/@angular/platform-browser-dynamic@11.0.5/bundles/platform-browser-dynamic.umd.js","https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css","https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js"],meta:""},"animate.css":{libraries:["https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"],meta:""},"anime js":{libraries:["https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js"],meta:""},aos:{libraries:["https://cdnjs.cloudflare.com/ajax/libs/aos/2.3.4/aos.css","https://cdnjs.cloudflare.com/ajax/libs/aos/2.3.4/aos.js"],meta:""},"apex charts js":{libraries:["https://cdn.jsdelivr.net/npm/apexcharts@3.40.0/dist/apexcharts.min.css","https://cdn.jsdelivr.net/npm/apexcharts@3.40.0/dist/apexcharts.min.js"],meta:""},aurelia:{libraries:[],meta:''\n },\n 'barba.js': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/barba.js/2.9.7/barba.min.js\"\n ],\n meta: ''\n },\n 'bootstrap 5': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/css/bootstrap.min.css\",\n \"https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/js/bootstrap.bundle.min.js\"\n ],\n meta: ''\n },\n 'bulm css': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.4/css/bulma.min.css\",\n \"https://cdn.jsdelivr.net/npm/bulma-extensions@6.2.7/css/bulma-extensions.min.css\",\n \"https://cdn.jsdelivr.net/npm/bulma-extensions@6.2.7/js/bulma-extensions.min.js\"\n ],\n meta: ''\n },\n 'chakra-ui': {\n libraries: [\n \"https://cdn.jsdelivr.net/npm/@chakra-ui/react@2.0.0/dist/chakra-ui.min.css\"\n ],\n meta: ''\n },\n 'chart js': {\n libraries: [\n \"https://cdn.jsdelivr.net/npm/chart.js\"\n ],\n meta: ''\n },\n 'chartist': {\n libraries: [\n \"https://cdn.jsdelivr.net/chartist.js/latest/chartist.min.css\",\n \"https://cdn.jsdelivr.net/chartist.js/latest/chartist.min.js\"\n ],\n meta: ''\n },\n 'd3': {\n libraries: [\n \"https://d3js.org/d3.v7.min.js\"\n ],\n meta: ''\n },\n 'dojo': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/dojo/1.17.3/dojo.js\"\n ],\n meta: ''\n },\n 'echarts': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/echarts/5.3.3/echarts.min.js\"\n ],\n meta: ''\n },\n 'file-saver': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js\"\n ],\n meta: ''\n },\n 'foundation': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/foundation/6.6.3/css/foundation.min.css\",\n \"https://cdnjs.cloudflare.com/ajax/libs/foundation/6.6.3/js/foundation.min.js\"\n ],\n meta: ''\n },\n 'fullpage.js': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/4.0.11/fullpage.min.css\",\n \"https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/4.0.11/fullpage.min.js\"\n ],\n meta: ''\n },\n 'granim': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/granim/2.0.0/granim.min.js\"\n ],\n meta: ''\n },\n 'google charts': {\n libraries: [\n \"https://cdn.jsdelivr.net/npm/google-charts@2.0.0/dist/googleCharts.min.js\"\n ],\n meta: ''\n },\n 'gsap': {\n libraries: [\n \"https://unpkg.com/gsap@3/dist/gsap.min.js\"\n ],\n meta: ''\n },\n 'half moon': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/Halfmoon/1.0.4/css/halfmoon.min.css\",\n \"https://cdnjs.cloudflare.com/ajax/libs/Halfmoon/1.0.4/js/halfmoon.min.js\"\n ],\n meta: ''\n },\n 'hint css': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/hint.css/3.0.0/hint.min.css\"\n ],\n meta: ''\n },\n 'hyperapp': {\n libraries: [],\n meta: ''\n },\n 'jquery': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\"\n ],\n meta: ''\n },\n 'jszip': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js\"\n ],\n meta: ''\n },\n 'knockout.js': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/knockout/3.5.1/knockout-latest.js\"\n ],\n meta: ''\n },\n 'leaflet': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.js\"\n ],\n meta: ''\n },\n 'locomotive-scroll': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/locomotive-scroll/4.1.4/locomotive-scroll.min.css\",\n \"https://cdnjs.cloudflare.com/ajax/libs/locomotive-scroll/4.1.4/locomotive-scroll.min.js\"\n ],\n meta: ''\n },\n 'lodash': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js\"\n ],\n meta: ''\n },\n 'masonry js': {\n libraries: [\n \"https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.min.js\"\n ],\n meta: ''\n },\n 'materialize': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css\",\n \"https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js\"\n ],\n meta: ''\n },\n 'milligram css': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/milligram/1.4.1/milligram.min.css\"\n ],\n meta: ''\n },\n 'mithril': {\n libraries: [\n \"https://cdn.jsdelivr.net/npm/mithril@2.0.4/mithril.min.js\"\n ],\n meta: ''\n },\n 'moment js': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment.min.js\"\n ],\n meta: ''\n },\n 'moon.js': {\n libraries: [],\n meta: ''\n },\n 'pattern css': {\n libraries: [\n \"https://unpkg.com/pattern.css@1.0.0/dist/pattern.min.css\"\n ],\n meta: ''\n },\n 'pico.css': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ],\n meta: ''\n },\n 'preact': {\n libraries: [\n \"https://unpkg.com/preact@latest/dist/preact.min.js\"\n ],\n meta: ''\n },\n 'primer css': {\n libraries: [\n \"https://unpkg.com/@primer/css@^20.2.4/dist/primer.css\"\n ],\n meta: ''\n },\n 'popper js': {\n libraries: [\n \"https://unpkg.com/@popperjs/core@2.11.7/dist/umd/popper.min.js\"\n ],\n meta: ''\n },\n 'pure.css': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/pure/2.0.6/pure-min.css\"\n ],\n meta: ''\n },\n 'raisin css': {\n libraries: [\n \"https://cdn.jsdelivr.net/gh/tretapey/raisincss@1.1.1/raisin.min.css\"\n ],\n meta: ''\n },\n 'raphael js': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/raphael/2.3.0/raphael.min.js\"\n ],\n meta: ''\n },\n 'react js': {\n libraries: [\n \"https://unpkg.com/react@latest/umd/react.development.js\",\n \"https://unpkg.com/react-dom@latest/umd/react-dom.development.js\"\n ],\n meta: ''\n },\n 'semantic ui': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.2/semantic.min.css\",\n \"https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.2/semantic.min.js\"\n ],\n meta: ''\n },\n 'skeleton css': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.min.css\"\n ],\n meta: ''\n },\n 'spectre.css': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/spectre.css/0.5.9/spectre.min.css\"\n ],\n meta: ''\n },\n 'stimulus': {\n libraries: [\n \"https://cdn.jsdelivr.net/npm/@hotwired/stimulus@3.1.0/dist/stimulus.umd.js\",\n \"https://cdn.jsdelivr.net/npm/@hotwired/stimulus-loading@1.0.0/dist/stimulus-loading.umd.js\"\n ],\n meta: ''\n },\n 'swiper': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/Swiper/9.1.2/swiper-bundle.min.css\",\n \"https://cdnjs.cloudflare.com/ajax/libs/Swiper/9.1.2/swiper-bundle.min.js\"\n ],\n meta: ''\n },\n 'tachyons': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/tachyons/4.12.0/tachyons.min.css\"\n ],\n meta: ''\n },\n 'tailwind css': {\n libraries: [\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ],\n meta: ''\n },\n 'three.js': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/three.js/r148/three.min.js\"\n ],\n meta: ''\n },\n 'tippy js': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/tippy.js/6.3.7/tippy-bundle.umd.min.js\"\n ],\n meta: ''\n },\n 'uikit': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/uikit/3.17.2/css/uikit.min.css\",\n \"https://cdnjs.cloudflare.com/ajax/libs/uikit/3.17.2/js/uikit.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/uikit/3.17.2/js/uikit-icons.min.js\"\n ],\n meta: ''\n },\n 'vivus': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/vivus/0.4.6/vivus.min.js\"\n ],\n meta: ''\n },\n 'vite': {\n libraries: [\n \"https://unpkg.com/vite@latest/dist/vite.min.js\"\n ],\n meta: ''\n },\n 'vue js': {\n libraries: [\n \"https://unpkg.com/vue@latest/dist/vue.global.prod.js\"\n ],\n meta: ''\n },\n 'water.css': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/water.css/2.1.1/water.min.css\"\n ],\n meta: ''\n }\n }\n};\nconst icons = (function() {\n const SidebarIconCSS = \"h-4 w-4\";\n const navIconCSS = \"h-3 w-3\";\n const modalIconCSS = \"h-4 w-4\";\n const panelIconCSS = \"h-3 w-3\";\n const previewIconCSS = \"h-3 -mt-1\";\n\n return {\n logo: `\n \n \n \n image/svg+xml\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n `,\n twitterfill: `\n \n `,\n twitter: `\n \n `,\n heart: `\n \n `,\n html: `\n \n `,\n css: `\n \n `,\n javascript: `\n \n `,\n columns: `\n \n `,\n leftChev: `\n \n `,\n rightChev: `\n \n `,\n console: `\n \n \n `,\n sun: `\n \n `,\n moon: `\n \n `,\n play: `\n \n `,\n camera: `\n \n \n `,\n cog: `\n \n \n `,\n tidy: `\n \n `,\n rotate: `\n \n `,\n times: `\n \n `,\n file: `\n \n `,\n import: `\n \n `,\n download: `\n \n `,\n codepen: `\n \n `,\n trash: `\n \n `,\n undo: `\n \n `,\n redo: `\n \n `,\n cut: `\n \n `,\n copy: `\n \n `,\n paste: `\n \n `,\n indent: `\n \n `,\n outdent: `\n \n `,\n search: `\n \n `,\n goto: `\n \n `,\n comment: `\n \n `,\n fold: `\n \n `,\n unfold: `\n \n `,\n cursor: `\n \n `\n };\n})();\n\n// Reactive objects\nwindow.project = onChange(p, async (property, oldValue, newValue) => {\n const iframe = document.getElementById('iframe');\n const doc = iframe ? iframe.contentWindow.document : null;\n if (oldValue !== newValue) {\n localStorage.setItem('kodeWeave', JSON.stringify(project));\n App.render('#app');\n \n if (property.toString() === 'activePanel') {\n getIFrameClientSize();\n if (!window.editorManager) return;\n if (project.activePanel === 'html') setActiveEditor(editorManager.htmlEditor)\n if (project.activePanel === 'css') setActiveEditor(editorManager.cssEditor)\n if (project.activePanel === 'javascript') setActiveEditor(editorManager.javascriptEditor)\n }\n \n if (!App.initialRender) {\n let string = property.toString();\n \n if (string === 'css' || string === 'console') {\n let consoleCSS = `\n [data-zwj=zwjkonsole] {\n display: ${project.console ? 'flex' : 'none'};\n }\n \n ${project.css}`\n\n if (!window.editorManager) return;\n if (string === 'css' && editorManager.cssEditor.state.doc.toString() !== project.css) {\n dispatchChanges(editorManager.cssEditor, project.css);\n }\n if (doc.getElementById('cuxjju3ew')) {\n doc.getElementById('cuxjju3ew').textContent = consoleCSS;\n }\n }\n \n if (string === 'html') {\n renderPreview(project.autorun);\n if (!window.editorManager) return;\n if (window.editorManager.htmlEditor.state.doc.toString() !== project.html) {\n dispatchChanges(editorManager.htmlEditor, project.html);\n }\n }\n\n if (string === 'javascript') {\n renderPreview(project.autorun);\n if (!window.editorManager) return;\n if (window.editorManager.jsEditor.state.doc.toString() !== project.javascript) {\n dispatchChanges(editorManager.jsEditor, project.javascript);\n }\n }\n\n if (string === 'module' || string === 'meta' || string === 'libraries' || string === 'html_pre_processor' || string === 'css_pre_processor' || string === 'javascript_pre_processor') {\n renderPreview(project.autorun);\n }\n\n if (string === \"previewDark\") {\n if (doc) {\n doc.documentElement.setAttribute('data-theme', project.previewDark ? 'dark' : 'light');\n }\n }\n\n if (string === \"dark\") {\n App.render('#app');\n document.documentElement.setAttribute('data-theme', project.dark ? 'dark' : 'light');\n document.querySelector('meta[name=apple-mobile-web-app-status-bar-style]').setAttribute('content', project.dark ? 'black-translucent' : 'default');\n document.querySelector('meta[name=theme-color]').setAttribute('content', project.dark ? '#13171f' : '#ffffff');\n document.querySelector('meta[name=msapplication-navbutton-color]').setAttribute('content', project.dark ? '#13171f' : '#ffffff');\n }\n }\n }\n});\nwindow.data = onChange(d, (property, oldValue, newValue) => {\n // Only render if the actual value has changed\n if (oldValue !== newValue) App.render('#app');\n});\n\n// Components\nfunction LeftMenubar() {\n const buttonSize = \"w-full\";\n\n return `
    \n
  • \n \n ${icons.logo}\n \n
  • \n
  • \n \n ${icons.twitter}\n \n
  • \n
  • \n \n ${icons.heart}\n \n
  • \n
  • \n \n
  • \n
\n
    \n
  • \n
    \n
  • \n
  • \n \n ${icons.html}\n \n
  • \n
  • \n \n ${icons.css}\n \n
  • \n
  • \n \n ${icons.javascript}\n \n
  • \n
  • \n
    \n
  • \n
\n
    \n
  • \n \n ${project.previewDark ? icons.sun : icons.moon}\n \n
  • \n
  • \n \n ${icons.play}\n \n
  • \n
  • \n \n ${icons.console}\n \n
  • \n
  • \n \n ${icons.camera}\n \n
  • \n
  • \n \n ${icons.cog}\n \n
  • \n
`;\n}\nfunction PreviewMenu() {\n const buttonClass = 'border-0 bg-transparent text-sm';\n const selectClass = 'mx-0 my-2 w-auto rounded-md capitalize text-[.6rem]';\n const selectStyle = 'padding: 0.5rem;';\n\n const sizeOptions = {\n Phones: {\n '320x480': 'iPhone 3GS',\n '375x667': 'iPhone 6/7/8',\n '414x736': 'iPhone 6/7/8 Plus',\n '375x812': 'iPhone X/XS/11 Pro',\n '414x896': 'iPhone XR/XS Max/11/11 Pro Max',\n '360x640': 'Samsung Galaxy S5',\n '360x740': 'Samsung Galaxy S8+',\n '1440x3200': 'Samsung Galaxy S21 Ultra',\n '1080x2340': 'Google Pixel 5',\n '1080x2400': 'OnePlus 8 Pro',\n '1440x3200': 'Xiaomi Mi 11 Ultra',\n '1644x3840': 'Sony Xperia 1 III'\n },\n Tablets: {\n '2048x2732': 'iPad Pro 12.9\" (3rd/4th Gen)',\n '2388x1668': 'iPad Pro 11\" (1st/2nd/3rd Gen)',\n '2736x1824': 'Microsoft Surface Pro 7',\n '2800x1752': 'Samsung Galaxy Tab S7+',\n '2560x1600': 'Huawei MatePad Pro',\n '2000x1200': 'Lenovo Tab P11 Pro',\n '1920x1200': 'Amazon Fire HD 10',\n '1536x2048': 'iPad Air (3rd Gen)',\n '1620x2160': 'iPad Air (4th Gen)',\n '1620x2160': 'iPad 10.2\" (8th Gen)',\n '1668x2224': 'iPad Pro 11\" (2021)'\n },\n Desktops: {\n '3840x2160': '4K UHD (3840x2160)',\n '2560x1440': 'WQHD (2560x1440)',\n '1920x1080': 'Full HD (1920x1080)',\n '1366x768': 'Laptop (1366x768)',\n '3440x1440': 'UltraWide QHD (3440x1440)',\n '5120x2880': '5K Retina (5120x2880)',\n '1280x800': 'MacBook (1280x800)',\n '2560x1600': 'MacBook Pro (2560x1600)',\n '2880x1800': 'MacBook Pro Retina (2880x1800)'\n }\n };\n\n const previewSize = ``;\n\n function canTidyShow() {\n if (!project.activePanel) return 'hidden'\n if (project.activePanel) {\n if (project.activePanel === 'html') {\n if (project.html_pre_processor !== 'html') {\n return 'hidden'\n }\n }\n if (project.activePanel === 'css') {\n if (project.css_pre_processor !== 'css') {\n return 'hidden'\n }\n }\n if (project.activePanel === 'javascript') {\n if (project.javascript_pre_processor !== 'javascript') {\n return 'hidden'\n }\n }\n }\n }\n\n return `
\n ${previewSize}\n\n
    \n
  • \n \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n \n
  • \n
  • \n \n ${icons.play}\n \n
  • \n
\n
`;\n}\nfunction Menu() {\n let menuDialog = `
    \n
  • \n
    \n
    \n \n \"logo\"\n\n \n
    \n About ${app.name}\n
    \n
    \n Version ${app.version}\n
    \n \n Open Source License\n \n
    \n
    \n
  • \n
  • \n
    \n
  • \n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n \n
  • \n
`;\n menuDialog = `\n
\n
\n

\n file menu\n

\n \n
\n
\n ${menuDialog}\n
\n
\n \n
\n
\n
`;\n return menuDialog;\n}\nfunction Demos() {\n const buttonClass = \"grid grid-rows-1 items-center bg-transparent border-0 focus-within:shadow-none\";\n const buttonContentClass = \"flex flex-col justify-between h-full\";\n const imageContentClass = \"grid h-full items-center\";\n const textContentClass = \"capitalize text-center mt-4\";\n\n const frameworks = [\n \"javascript\",\n \"typescript\",\n \"react\",\n \"vue\",\n \"preact\",\n \"angular\",\n \"alpine\",\n \"solid\",\n \"stimulus\",\n \"mithril\",\n \"hyperapp\",\n \"aurelia\",\n \"lit\",\n \"knockout\",\n \"moon\"\n ]\n\n let buttonHTML = \"\";\n for (const name of frameworks) {\n buttonHTML += `\n
\n
\n \"${name}\"\n
\n
\n ${name}\n
\n
\n `;\n }\n\n let demosDialog = `\n
\n
\n

\n Are you sure you want to start a new project?\n

\n \n
\n
\n
All current data will be lost.
\n
\n
\n ${buttonHTML}\n
\n
\n
\n
\n \n
\n
\n
`;\n return demosDialog;\n}\nfunction Settings() {\n let frameworks = data.frameworks;\n\n // Get the keys, sort them alphabetically, and reduce them back into an object\n let sortedFrameworks = Object.keys(frameworks)\n .sort()\n .reduce((acc, key) => {\n acc[key] = frameworks[key];\n return acc;\n }, {});\n\n let settingsHTML = `
    \n
  • \n
    \n \n \n
    \n
  • \n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n
    \n
  • \n
  • \n \n\n \n\n
    \n ${project.libraries.map((library, index) => `\n \n `).join('')}\n
    \n \n
  • \n
  • \n
    \n
  • \n \n
  • \n
    \n
  • \n
  • \n \n
  • \n
  • \n
    \n
  • \n
  • \n
    \n Project name:\n
    \n \n
  • \n
  • \n
    \n
  • \n
  • \n
    \n Project version:\n
    \n
    \n \n \n \n
    \n
  • \n
  • \n
    \n
  • \n
  • \n
    \n Project title:\n
    \n \n
  • \n
  • \n
    \n
  • \n
  • \n
    \n Project description:\n
    \n \n
  • \n
  • \n
    \n
  • \n
  • \n
    \n Project author:\n
    \n \n
  • \n
  • \n
    \n
  • \n
  • \n
    \n Project url:\n
    \n \n
  • \n
  • \n
    \n
  • \n
  • \n
    \n HTML before closing head tag:\n
    \n \n
  • \n
`;\n settingsHTML = `\n
\n
\n

\n settings\n

\n \n
\n
\n ${settingsHTML}\n
\n
\n \n
\n
\n
`;\n return settingsHTML;\n}\nfunction Libraries() {\n let librariesDialog = `\n
\n
\n

\n Search for resources (JQuery, Bootstrap, Foundation...)\n

\n \n
\n
\n
\n \n \n
\n ${data.librarySuggestions && data.searchLibKey ? data.librarySuggestions : ''}\n
\n
\n
\n
\n \n
\n
\n
`;\n\n return librariesDialog;\n}\nwindow.App = {\n initialRender: true,\n render(container) {\n // Calculate zoom transform based on viewport size and iframe size\n const size = data.selectedSize;\n let viewportWidth, viewportHeight;\n const previewElm = document.getElementById('previewElm');\n if (document.getElementById('previewElm')) {\n viewportWidth = previewElm.clientWidth;\n viewportHeight = previewElm.clientHeight;\n }\n let [width, height] = size.split('x').map(Number);\n \n const html = `\n
\n
\n ${LeftMenubar()}\n
\n \n \n
\n
\n \n
\n
\n\n ${Menu()}\n ${Settings()}\n ${Libraries()}\n ${Demos()}\n
`\n \n const element = document.querySelector(container);\n if (!element) return;\n\n // Create a new temporary element to compare\n const parser = new DOMParser();\n const doc = parser.parseFromString(html, 'text/html');\n if (doc.body.innerHTML.trim() === html.trim()) return;\n if (App.initialRender) {\n element.innerHTML = html;\n renderPreview(true);\n App.initialRender = false;\n return false;\n }\n\n // Compare and update only the changed parts\n const currentDoc = element.firstElementChild;\n const newDoc = doc.body.firstElementChild;\n diffNodes(currentDoc, newDoc);\n }\n}\nwindow.Modal = {\n render({\n large,\n title = \"Are you sure you want to proceed?\",\n content,\n CloseLabel,\n ConfirmLabel,\n onLoad,\n onClose,\n onConfirm\n }) {\n // if (!options) return false;\n const hClass = \"text-lg font-thin m-0\";\n const buttonClass = \"text-xs w-auto px-3 py-2 m-0 capitalize rounded-md\";\n const svgClass = \"w-3\";\n const times = `\n \n `;\n\n const html = `
\n
\n

${title}

\n \n
\n
\n ${content ? content : ''}\n
\n
\n \n ${onConfirm ? `` : ''}\n
\n
`;\n\n const modal = document.createElement('dialog');\n modal.open = true;\n modal.innerHTML = html;\n\n document.body.appendChild(modal);\n if (onLoad && typeof onLoad === 'function') {\n onLoad();\n }\n\n const timesBtn = modal.querySelector('header button');\n const closeBtn = modal.querySelector('footer button:first-child');\n const confirmBtn = modal.querySelector('footer button:last-child');\n\n // Confirm handler function\n timesBtn.onclick = function() {\n if (onClose && typeof onClose === 'function') {\n onClose();\n }\n document.body.removeChild(modal);\n }\n closeBtn.onclick = function() {\n if (onClose && typeof onClose === 'function') {\n onClose();\n }\n document.body.removeChild(modal);\n }\n confirmBtn.onclick = function() {\n if (onConfirm && typeof onConfirm === 'function') {\n onConfirm();\n }\n document.body.removeChild(modal);\n }\n }\n}\nfunction editorNav() {\n const buttonClass = \"border-0 bg-transparent py-1\";\n\n return `
\n \n ${icons.indent}\n \n \n ${icons.outdent}\n \n \n ${icons.undo}\n \n \n ${icons.redo}\n \n \n ${icons.search}\n \n \n ${icons.goto}\n \n
\n\n
\n \n ${icons.comment}\n \n \n ${icons.fold}\n \n \n ${icons.unfold}\n \n \n ${icons.cut}\n \n \n ${icons.copy}\n \n \n ${icons.paste}\n \n \n ${icons.cursor}\n \n
`;\n}\nwindow.emptyStorage = () => {\n Modal.render({\n title: \"Are you sure you want to empty storage?\",\n content: '
All current data will be lost.
',\n onConfirm() {\n // Clear local storage\n localStorage.removeItem('kodeWeave');\n \n // Clear session storage specific to kodeWeave (if you use a specific key)\n sessionStorage.removeItem('kodeWeave');\n \n // Clear cookies specific to kodeWeave\n document.cookie.split(\";\").forEach(function(c) {\n if (c.trim().startsWith('kodeWeave')) {\n document.cookie = c.trim().split(\"=\")[0] + \n '=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/';\n }\n });\n \n // Clear service worker caches specific to kodeWeave\n if ('caches' in window) {\n caches.keys().then(function(names) {\n names.forEach(function(name) {\n if (name === 'kodeWeave-cache') {\n caches.delete(name);\n }\n });\n });\n }\n \n // Unregister service workers specific to kodeWeave\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.getRegistrations().then(function(registrations) {\n registrations.forEach(function(registration) {\n if (registration.scope.includes('kodeWeave')) {\n registration.unregister();\n }\n });\n });\n }\n \n location.reload();\n }\n });\n}\nwindow.updateVersionPart = (part, value) => {\n const versionParts = project.version.split('.');\n if (part === 'major') {\n versionParts[0] = value;\n } else if (part === 'minor') {\n versionParts[1] = value;\n } else if (part === 'patch') {\n versionParts[2] = value;\n }\n project.version = versionParts.join('.');\n}\nwindow.searchMedia = () => {\n let modalContent = `\n \n\n
\n \n \n \n\n \n
\n \n \n
\n\n \n
\n\n \n
\n You can grab your own media from Pixabay.com, \n Pexels.com, or freesound.org.\n
\n
`;\n\n Modal.render({\n title: \"Search Media\",\n content: modalContent,\n onLoad: async function() {\n const apiConnection = await checkApiConnection();\n const searchInput = document.getElementById('search-input');\n const searchBtn = document.getElementById('search-btn');\n const mediaTypeSelect = document.getElementById('media-type-select');\n const resultsContainer = document.getElementById('search-results');\n const fileInput = document.getElementById('file-input');\n searchInput.focus();\n\n const handleSearch = async () => {\n const query = searchInput.value;\n const mediaType = mediaTypeSelect.value;\n\n if (query) {\n let results = [];\n if (mediaType === 'all' || mediaType === 'image') {\n const images = await searchOpenverseImage(query);\n results.push(...images.map(img => ({ type: 'image', ...img })));\n }\n if (mediaType === 'all' || mediaType === 'audio') {\n const audios = await searchOpenverseAudio(query);\n results.push(...audios.map(audio => ({ type: 'audio', ...audio })));\n }\n if (mediaType === 'all' || mediaType === 'svg') {\n const icons = await searchIcons(query);\n results.push(...icons.map(icon => ({ type: 'icon', url: `https://api.iconify.design/${icon}.svg` })));\n }\n displayResults(results);\n } else {\n resultsContainer.innerHTML = '';\n }\n };\n\n mediaTypeSelect.onchange = handleSearch;\n searchInput.oninput = handleSearch;\n searchBtn.onclick = handleSearch;\n\n fileInput.onchange = async (event) => {\n const file = event.target.files[0];\n if (file) {\n const base64 = await fileToBase64(file);\n let resultHTML;\n\n if (file.type.startsWith('image/')) {\n resultHTML = `\"${file.name}\"`;\ncopyToClipboard(resultHTML);\nalert('Image copied to clipboard');\n } else if (file.type.startsWith('audio/')) {\n resultHTML = ``;\n copyToClipboard(resultHTML);\n alert('Audio copied to clipboard');\n } else if (file.type === 'image/svg+xml') {\n const reader = new FileReader();\n reader.onload = () => {\n const svgContent = reader.result;\n copyToClipboard(svgContent);\n alert('SVG copied to clipboard');\n };\n reader.readAsText(file);\n return;\n } else if (file.type.startsWith('video/')) {\n const resultHTML = ``\n copyToClipboard(resultHTML);\n alert('Video copied to clipboard');\n return;\n }\n\n closeOpenDialog();\n }\n };\n\n function displayResults(results) {\n if (navigator.onLine) {\n resultsContainer.innerHTML = results.map(result => {\n if (result.type === 'image') {\n resultsContainer.className = \"mt-4 grid grid-cols-4 gap-4\";\n const imgHTML = `\n \"${result.title}\"`;\n // Remove 'class' attribute\n const parser = new DOMParser();\n const imgDoc = parser.parseFromString(imgHTML, 'text/html');\n const imgElement = imgDoc.querySelector('img');\n if (imgElement) imgElement.removeAttribute('class');\n const cleanedImgHTML = imgElement.outerHTML;\n\n // Properly escape HTML for the onclick attribute\n const escapedImgHTML = cleanedImgHTML\n .replace(/`/g, '\\\\`') // Escape backticks\n .replace(//g, '>') // Escape greater than signs\n .replace(/\"/g, '"'); // Escape double quotes\n\n return `\n
\n ${imgHTML}\n
`;\n } else if (result.type === 'audio') {\n resultsContainer.className = \"mt-4 grid grid-cols-1 gap-1\";\n return `\n
\n
${result.title}
\n
\n \n
\n Artist is \n ${result.creator}.\n
\n
\n
\n
`;\n } else if (result.type === 'icon') {\n resultsContainer.className = \"mt-4 grid grid-cols-4 gap-4\";\n if (apiConnection) {\n // Fetch and render SVG content\n getFile(result.url, (error, svgContent) => {\n if (error) {\n resultsContainer.innerHTML = \"Unable to fetch SVG.\";\n } else {\n // Remove width and height attributes from SVG content\n const parser = new DOMParser();\n const svgDoc = parser.parseFromString(svgContent, 'image/svg+xml');\n const svgElement = svgDoc.querySelector('svg');\n if (svgElement) {\n svgElement.removeAttribute('width');\n svgElement.removeAttribute('height');\n const serializer = new XMLSerializer();\n const cleanedSvgContent = serializer.serializeToString(svgElement);\n resultsContainer.innerHTML += `\n
${cleanedSvgContent}
`;\n }\n }\n });\n } else {\n resultsContainer.className = \"mt-4 grid grid-cols-1 gap-4\";\n resultsContainer.innerHTML = \"Unable to search: Connection not found!\";\n }\n }\n }).join('');\n } else {\n resultsContainer.innerHTML = \"Unable to search: Connection not found!\";\n }\n }\n }\n });\n}\nwindow.checkApiConnection = async () => {\n try {\n const response = await fetch('https://api.iconify.design/collections');\n if (response.ok) {\n return true;\n }\n } catch (error) {\n console.error(\"API connection failed:\", error);\n }\n return false;\n}\nwindow.searchOpenverseImage = async query => {\n const url = `https://api.openverse.org/v1/images?q=${encodeURIComponent(query)}`;\n const response = await fetch(url);\n if (response.ok) {\n const data = await response.json();\n return data.results;\n } else {\n console.error(\"API request failed:\", response.status);\n return [];\n }\n}\nwindow.searchOpenverseAudio = async query => {\n const url = `https://api.openverse.org/v1/audio?q=${encodeURIComponent(query)}`;\n const response = await fetch(url);\n if (response.ok) {\n const data = await response.json();\n return data.results;\n } else {\n console.error(\"API request failed:\", response.status);\n return [];\n }\n}\nwindow.searchIcons = async query => {\n const searchUrl = `https://api.iconify.design/search?query=${encodeURIComponent(query)}`;\n try {\n const response = await fetch(searchUrl);\n if (response.ok) {\n const data = await response.json();\n return data.icons || [];\n } else {\n console.error(\"Failed to fetch icon search results.\");\n }\n } catch (error) {\n console.error(\"Error during icon search:\", error);\n }\n return [];\n}\nwindow.copyToClipboard = text => {\n navigator.clipboard.writeText(text).then(function() {\n }).catch(function(error) {\n console.error('Failed to copy text: ', error);\n });\n}\n\n// editor functions\nwindow.addLibrary = url => {\n if (!url) {\n project.libraries.push('');\n document.getElementById('librariesBox').innerHTML = renderLibraries();\n return false;\n }\n\n if (!project.libraries.includes(url)) {\n project.libraries.push(url);\n } else {\n console.error(`Library already exists: ${url}`);\n }\n\n if (document.getElementById('librariesBox')) {\n document.getElementById('librariesBox').innerHTML = renderLibraries();\n }\n};\nfunction renderLibraries() {\n return project.libraries.map((library, index) => `\n \n `).join('')\n}\nwindow.fetchSuggestions = key => {\n fetch(\n `https://api.cdnjs.com/libraries?search=${key}&fields=filename,description,version`\n )\n .then(response => {\n if (!response.ok) {\n throw new Error(\"Network response was not ok\");\n }\n return response.json();\n })\n .then(item => {\n if (item && item.results && item.results.length > 0) {\n const suggestions = item.results.map(result => result);\n\n data.librarySuggestions = suggestions.map(result => {\n return `\n
\n
\n ${result.name}\n ${result.version}\n
\n
${result.description}

\n
`;\n }).join('');\n }\n })\n .catch(error => {\n console.error(\"Error fetching data:\", error);\n });\n}\nwindow.removeScript = src => {\n const script = document.querySelector(`script[src=\"${src}\"]`);\n if (script) script.remove();\n}\nwindow.removeScripts = scripts => {\n scripts.forEach(src => {\n const script = document.querySelector(`script[src=\"${src}\"]`);\n if (script) script.remove();\n });\n}\nwindow.loadScript = async scriptUrl => {\n return new Promise((resolve, reject) => {\n // Check if the script is already loaded\n const existingScript = document.querySelector(`script[src=\"${scriptUrl}\"]`);\n if (existingScript) {\n resolve(); // If the script is already present, resolve immediately\n return;\n }\n\n // Create a new script element if not present\n const scriptElement = document.createElement('script');\n scriptElement.src = scriptUrl;\n scriptElement.onload = resolve; // Resolve when the script is successfully loaded\n scriptElement.onerror = () => reject(new Error(`Failed to load script: ${scriptUrl}`)); // Reject on error\n document.body.appendChild(scriptElement); // Append the script to the body\n });\n}\nwindow.loadScripts = async srcArray => {\n return Promise.all(srcArray.map(loadScript));\n}\nwindow.setPreprocessor = async (editor, value) => {\n const scriptMap = {\n html: {\n markdown: \"libraries/preprocessors/marked.min.js\",\n jade: \"libraries/preprocessors/jade.js\",\n pug: \"libraries/preprocessors/pug.js\"\n },\n css: {\n sass: \"libraries/preprocessors/sass.sync.min.js\",\n less: \"libraries/preprocessors/less.min.js\",\n stylus: \"libraries/preprocessors/stylus.min.js\"\n },\n javascript: {\n typescript: \"libraries/preprocessors/typescript.min.js\",\n babel: \"libraries/preprocessors/babel.min.js\"\n }\n };\n\n const currentPreprocessors = {\n html: project.html_pre_processor,\n css: project.css_pre_processor,\n javascript: project.javascript_pre_processor\n };\n\n try {\n const scriptSrcCondition = (value !== 'html' || value !== 'css' || value !== 'javascript');\n const scriptSrc = scriptSrcCondition ? scriptMap[editor][value] : null;\n\n // Remove the current preprocessor scripts\n if (currentPreprocessors[editor] && scriptSrcCondition) {\n const currentScriptSrc = scriptMap[editor][currentPreprocessors[editor]];\n Array.isArray(currentScriptSrc) ? removeScripts(currentScriptSrc) : removeScript(currentScriptSrc)\n\n // Load the new preprocessor scripts\n if (Array.isArray(scriptSrc)) {\n await loadScripts(scriptSrc);\n } else if (scriptSrc) {\n await loadScript(scriptSrc);\n }\n }\n\n // Set the new preprocessor\n if (editor === 'html') {\n project.html_pre_processor = value;\n // if (!window.editorManager || !window.editorManager.htmlEditor) return;\n // window.editorManager.setMode(project.html_pre_processor === 'html' ? 'html' : value, editorManager.htmlEditor);\n } else if (editor === 'css') {\n project.css_pre_processor = value;\n // if (!window.editorManager || !window.editorManager.cssEditor) return;\n // window.editorManager.setMode(project.css_pre_processor === 'css' ? 'css' : value, editorManager.cssEditor);\n } else if (editor === 'javascript') {\n project.javascript_pre_processor = value;\n if (!window.editorManager || !window.editorManager.jsEditor) return;\n window.editorManager.setMode(project.javascript_pre_processor === 'javascript' ? 'javascript' : value, editorManager.jsEditor);\n }\n } catch (error) {\n console.error('Error setting preprocessor:', error);\n }\n}\nwindow.initializePreprocessors = async () => {\n await Promise.all([\n setPreprocessor('html', project.html_pre_processor),\n setPreprocessor('css', project.css_pre_processor),\n setPreprocessor('javascript', project.javascript_pre_processor)\n ]);\n \n if (!window.editorManager) return;\n dispatchChanges(editorManager.htmlEditor, project.html);\n dispatchChanges(editorManager.cssEditor, project.css);\n dispatchChanges(editorManager.jsEditor, project.javascript);\n renderPreview(true);\n}\nwindow.loadBeautifyLibraries = async () => {\n const beautifyLibraries = [\n \"libraries/js-beautify/beautify.min.js\",\n \"libraries/js-beautify/beautify-css.min.js\",\n \"libraries/js-beautify/beautify-html.min.js\"\n ];\n await loadScripts(beautifyLibraries);\n}\nwindow.removeBeautifyLibraries = async () => {\n const beautifyLibraries = [\n \"libraries/js-beautify/beautify.min.js\",\n \"libraries/js-beautify/beautify-css.min.js\",\n \"libraries/js-beautify/beautify-html.min.js\"\n ];\n removeScripts(beautifyLibraries);\n}\nwindow.tidy = async () => {\n await loadBeautifyLibraries();\n\n let formattedCode;\n switch (project.activePanel) {\n case 'html':\n formattedCode = html_beautify(project.html, {\n indent_size: 2,\n max_preserve_newlines: 1\n });\n dispatchChanges(editorManager.htmlEditor, formattedCode);\n break;\n case 'css':\n formattedCode = css_beautify(project.css, {\n indent_size: 2,\n max_preserve_newlines: 1\n });\n project.css = formattedCode;\n dispatchChanges(editorManager.cssEditor, formattedCode);\n break;\n case 'javascript':\n formattedCode = js_beautify(project.javascript, {\n indent_size: 2,\n max_preserve_newlines: 1\n });\n project.javascript = formattedCode;\n dispatchChanges(editorManager.jsEditor, formattedCode);\n break;\n default:\n formattedCode = 'Unknown editor panel.';\n }\n\n await removeBeautifyLibraries();\n}\nwindow.closeOpenDialog = () => {\n document.querySelector('dialog[open] footer button:last-child').click();\n}\n\n// iframe functions\nwindow.generateId = () => {\n let id = '';\n while (!/^[a-zA-Z]/.test(id)) {\n id = Math.random().toString(36).substr(2, 9);\n }\n return id;\n}\nwindow.resizeCanvas =size => {\n data.selectedSize = size;\n getIFrameClientSize();\n}\nwindow.rotateCanvas = () => {\n const iframe = document.getElementById('previewElm').firstElementChild;\n if (iframe.style.width === '100%') return false;\n\n // Extract current width and height\n let width = parseInt(iframe.style.width);\n let height = parseInt(iframe.style.height);\n\n // Swap width and height\n [width, height] = [height, width];\n\n // Calculate the new transform scale\n const viewportWidth = previewElm.clientWidth;\n const viewportHeight = previewElm.clientHeight;\n const scale = Math.min(viewportWidth / width, viewportHeight / height);\n\n // Apply the new styles\n iframe.style.width = `${width}px`;\n iframe.style.height = `${height}px`;\n iframe.style.transform = `scale(${scale})`;\n iframe.style.marginTop = `-${height / 2}px`;\n iframe.style.marginLeft = `-${width / 2}px`;\n data.selectedSize = width+'x'+height;\n getIFrameClientSize();\n}\nlet fadeTimeout;\nwindow.getIFrameClientSize = () => {\n const iframe = document.getElementById('iframe');\n data.iframeSize = `${iframe.offsetWidth}px x ${iframe.offsetHeight}px`;\n const element = document.getElementById('iframeClientSize');\n\n if (element.classList.contains('hidden')) {\n // Clear existing timeout to prevent multiple calls\n if (fadeTimeout) clearTimeout(fadeTimeout);\n\n // Remove hidden and add opacity-100 to show the element\n element.classList.remove('hidden', 'opacity-0');\n element.classList.add('opacity-100');\n\n // Set a timeout to handle fade-out\n fadeTimeout = setTimeout(() => {\n element.classList.remove('opacity-100');\n element.classList.add('opacity-0');\n\n // Add hidden class after fade-out\n setTimeout(() => {\n element.classList.add('hidden');\n }, 300); // Match the duration of the opacity transition\n }, 2000); // Show duration\n }\n}\nwindow.compileCode = async detect => {\n try {\n if (detect === 'html') {\n switch (project.html_pre_processor) {\n case 'html':\n return project.html;\n case 'markdown':\n return marked.parse(project.html);\n case 'jade':\n return jade.render(project.html, { pretty: true });\n case 'pug':\n const appScript = document.getElementById('appScript');\n if (appScript.hasAttribute('type') && appScript.getAttribute('type') === 'module') {\n // import pug from 'libraries/preprocessors/pug.js';\n console.error('Cannot import pug as script is a module!');\n return false;\n }\n\n const pug = require(\"pug\");\n return pug.compile(project.html)({name: this.name });\n default:\n return project.html;\n }\n }\n\n if (detect === 'css') {\n switch (project.css_pre_processor) {\n case 'css':\n return project.css;\n case 'stylus':\n return stylus.render(project.css);\n case 'less':\n return new Promise((resolve, reject) => {\n less.render(project.css, (err, output) => err ? reject(err) : resolve(output.css));\n });\n case 'sass':\n return new Promise((resolve, reject) => {\n Sass.compile(project.css, result => result.status === 0 ? resolve(result.text) : reject(new Error(result.message)));\n });\n default:\n return project.css;\n }\n }\n\n if (detect === 'javascript') {\n switch (project.javascript_pre_processor) {\n case 'javascript':\n return project.javascript;\n case 'babel':\n if (typeof Babel === 'undefined') {\n await loadScript(\"libraries/preprocessors/babel.min.js\");\n }\n return Babel.transform(project.javascript, { presets: ['env', 'react'] }).code;\n case 'typescript':\n return ts.transpileModule(project.javascript, { compilerOptions: { module: ts.ModuleKind.CommonJS } }).outputText;\n default:\n return project.javascript;\n }\n }\n } catch (error) {\n console.error('Error compiling code:', error);\n }\n}\n\n// save functions\nwindow.handleLogoChange = async event => {\n const file = event.target.files[0];\n if (!file) return; // If no file selected, return\n\n try {\n // Convert file to base64 string\n const base64String = await fileToBase64(file);\n // Update project.logo with base64String\n project.logo = base64String;\n } catch (error) {\n console.error('Error converting image to base64:', error);\n }\n}\nwindow.fileToBase64 = file => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = () => resolve(reader.result);\n reader.onerror = error => reject(error);\n });\n}\nwindow.newProject = name => {\n function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }\n const capitalizedTitle = capitalizeFirstLetter(name);\n setPreprocessor('html', 'html');\n setPreprocessor('css', 'css');\n if (name !== \"typescript\") setPreprocessor('javascript', 'javascript');\n if (name === \"typescript\" || name === \"angular\") setPreprocessor('javascript', 'typescript');\n project.name = `${capitalizedTitle} name`;\n project.version = '0.0.1';\n project.title = `A Cool ${capitalizedTitle} App`;\n project.description = `A modern ${capitalizedTitle} application!`;\n project.author = \"kodeWeave\";\n project.url = \"https://michaelsboost.com/\";\n project.module = true;\n project.preview = true;\n if (name === 'angular') project.module = false;\n project.pwa = false;\n\n if (name === 'javascript') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `
\n

\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E

\n

Counter: 0

\n \n
`;\n project.css = ``;\n project.javascript = `let counter = 0;\nconst counterElement = document.getElementById('counter');\nconst incrementButton = document.getElementById('incrementButton');\n\nincrementButton.addEventListener('click', function() {\n counter++;\n counterElement.textContent = counter;\n});`;\n }\n if (name === 'typescript') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `
\n

\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E

\n

Counter: 0

\n \n
`;\n project.css = ``;\n project.javascript = `let counter: number = 0;\nconst counterElement: HTMLElement | null = document.getElementById('counter');\nconst incrementButton: HTMLElement | null = document.getElementById('incrementButton');\n\nif (counterElement && incrementButton) {\n incrementButton.addEventListener('click', function() {\n counter++;\n counterElement.textContent = counter.toString();\n });\n}`;\n }\n if (name === 'react') {\n project.meta = \"\";\n project.libraries = [\n \"https://unpkg.com/react@latest/umd/react.development.js\",\n \"https://unpkg.com/react-dom@latest/umd/react-dom.development.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `
`;\n project.css = ``;\n project.javascript = `/** @jsxRuntime classic */\n/** @jsx React.createElement */\nconst { useState } = React;\n\nfunction App() {\n const [counter, setCounter] = useState(0);\n\n return (\n
\n

\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E

\n

Counter: {counter}

\n setCounter(counter + 1)}\n >\n +\n \n
\n );\n}\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render();`;\n }\n if (name === 'vue') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/vue/3.2.37/vue.global.prod.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `
`;\n project.css = ``;\n project.javascript = `const App = {\n data() {\n return {\n counter: 0,\n message: '\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E'\n };\n },\n methods: {\n incrementCounter() {\n this.counter++;\n }\n },\n template: \\`\n
\n

{{ message }}

\n

Counter: {{ counter }}

\n \n +\n \n
\n \\`\n};\n\nconst app = Vue.createApp(App);\napp.mount('#root');`;\n }\n if (name === 'preact') {\n project.meta = ``;\n project.libraries = [\n \"https://unpkg.com/preact@latest/dist/preact.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `
`;\n project.css = ``;\n project.javascript = `/** @jsx h */\nimport { html, render, useState, useEffect } from 'https://unpkg.com/htm@3.1.1/preact/standalone.module.js';\n\nfunction App() {\n const [counter, setCounter] = useState(0);\n\n return html\\`\n
\n

\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E

\n

Counter: \\${counter}

\n setCounter(counter + 1)}\n >\n +\n \n
\n \\`;\n}\n\nrender(html\\`<\\${App} />\\`, document.getElementById('root'));`;\n }\n if (name === 'angularold') {\n project.meta = ``;\n project.libraries = [\n \"https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `
\n

\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E

\n

Counter: {{counter}}

\n \n +\n \n
`;\n project.css = ``;\n project.javascript = `angular.module('myApp', [])\n .controller('MainController', function($scope) {\n $scope.counter = 0;\n $scope.incrementCounter = function() {\n $scope.counter++;\n };\n });`;\n }\n if (name === 'angular') {\n project.meta = ``;\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/rxjs/6.6.3/rxjs.umd.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/core-js/2.5.7/core.js\",\n \"https://unpkg.com/@angular/core@11.0.5/bundles/core.umd.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.10.3/zone.min.js\",\n \"https://unpkg.com/@angular/common@11.0.5/bundles/common.umd.js\",\n \"https://unpkg.com/@angular/compiler@11.0.5/bundles/compiler.umd.js\",\n \"https://unpkg.com/@angular/platform-browser@11.0.5/bundles/platform-browser.umd.js\",\n \"https://unpkg.com/@angular/platform-browser-dynamic@11.0.5/bundles/platform-browser-dynamic.umd.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `Loading...`;\n project.css = ``;\n project.javascript = `const { Component, NgModule, enableProdMode } = ng.core;\nconst { BrowserModule } = ng.platformBrowser;\nconst { platformBrowserDynamic } = ng.platformBrowserDynamic;\n\nenableProdMode();\n\n@Component({\n selector: 'app-root',\n template: \\`\n
\n

\uD83D\uDC4B Hello, Angular 11! \uD83C\uDF0E

\n

Counter: {{ counter }}

\n \n +\n \n
\n \\`,\n})\nclass AppComponent {\n counter = 0;\n \n incrementCounter() {\n this.counter++;\n }\n}\n\n@NgModule({\n declarations: [AppComponent],\n imports: [BrowserModule],\n bootstrap: [AppComponent]\n})\nclass AppModule {}\n\nplatformBrowserDynamic().bootstrapModule(AppModule);`;\n }\n if (name === 'alpine') {\n project.meta = ``;\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `
\n
\n

\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E

\n

Counter:

\n \n +\n \n
\n
`;\n project.css = ``;\n project.javascript = ``;\n }\n if (name === 'solid') {\n project.meta = ``;\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `
`;\n project.css = ``;\n project.javascript = `import { createSignal } from \"https://cdn.skypack.dev/solid-js@1.2.6\";\nimport { render } from \"https://cdn.skypack.dev/solid-js@1.2.6/web\";\nimport html from \"https://cdn.skypack.dev/solid-js@1.2.6/html\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n const increment = () => setCount(count() + 1);\n\n return html\\`\n
\n

\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E

\n

Counter: \\${count}

\n \n
\n \\`;\n}\n\nrender(Counter, document.getElementById(\"root\"));`;\n }\n if (name === 'stimulus') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdn.jsdelivr.net/npm/@hotwired/stimulus@3.1.0/dist/stimulus.umd.js\",\n \"https://cdn.jsdelivr.net/npm/@hotwired/stimulus-loading@1.0.0/dist/stimulus-loading.umd.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `
\n

\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E

\n

Counter: 0

\n counter#increment\"\n class=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\"\n >\n +\n \n
`;\n project.css = ``;\n project.javascript = `const application = Stimulus.Application.start();\n\napplication.register('counter', class extends Stimulus.Controller {\n static targets = ['output'];\n\n initialize() {\n this.counter = 0;\n }\n\n increment() {\n this.counter += 1;\n this.outputTarget.textContent = this.counter;\n }\n});`;\n }\n if (name === 'mithril') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdn.jsdelivr.net/npm/mithril@2.0.4/mithril.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `
`;\n project.css = ``;\n project.javascript = `import htm from 'https://unpkg.com/htm?module'\nconst html = htm.bind(m)\n\nconst app = () => {\n let count = 0\n \n return {\n view: () => html\\`\n
\n

\uD83D\uDC4B Hello, Mithril! \uD83C\uDF0E

\n

Counter: \\${count}

\n \n
\\`\n }\n}\n\nm.mount(document.getElementById('root'), app)`;\n }\n if (name === 'hyperapp') {\n project.meta = ``;\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `

`;\n project.css = ``;\n project.javascript = `import { app } from 'https://unpkg.com/hyperapp';\nimport html from 'https://unpkg.com/hyperlit';\n\napp({\n init: 0,\n view: count => html\\`\n
\n

\uD83D\uDC4B Hello, Hyperapp! \uD83C\uDF0E

\n

Counter: \\${count}

\n \n
\\`,\n node: document.getElementById('root')\n})`;\n }\n if (name === 'aurelia') {\n project.meta = '';\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = ``;\n project.css = ``;\n project.javascript = `class App {\n static $view() {\n return document.querySelector('#root');\n }\n constructor() {\n this.message = '${capitalizedTitle}';\n this.counter = 0;\n }\n incrementCounter() {\n this.counter++;\n document.getElementById('counter').textContent = this.counter;\n }\n}\n\nau.start({ root: App });`;\n }\n if (name === 'lit') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\"\n ];\n project.html = ``;\n project.css = ``;\n project.javascript = `import {LitElement, html} from 'https://cdn.jsdelivr.net/gh/lit/dist@2/core/lit-core.min.js';\n \nclass MyElement extends LitElement {\n static properties = {\n counter: { type: Number }\n };\n\n constructor() {\n super();\n this.counter = 0;\n }\n\n incrementCounter() {\n this.counter++;\n }\n\n render() {\n return html\\`\n
\n

\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E

\n

Counter: \\${this.counter}

\n \n
\n \\`;\n }\n}\ncustomElements.define('my-element', MyElement);`;\n }\n if (name === 'knockout') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/knockout/3.5.1/knockout-latest.js\"\n ];\n project.html = `
\n

\uD83D\uDC4B Hello, Knockout.js! \uD83C\uDF0E

\n

Counter: 0

\n \n
`;\n project.css = ``;\n project.javascript = `function AppViewModel() {\n this.counter = ko.observable(0);\n\n this.increment = () => {\n this.counter(this.counter() + 1);\n };\n}\n\nko.applyBindings(new AppViewModel());`;\n }\n if (name === 'moon') {\n project.meta = ``;\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\",\n ];\n project.html = `
\n

\uD83D\uDC4B Hello, Moon.js! \uD83C\uDF0E

\n

Counter: {{ count }}

\n \n
`;\n project.css = ``;\n project.javascript = `var app = new Moon({\n el: '#root',\n data: {\n count: 0\n },\n methods: {\n increment() {\n this.set('count', this.get('count') + 1);\n }\n }\n});`;\n }\n\n dispatchChanges(editorManager.htmlEditor, project.html);\n dispatchChanges(editorManager.cssEditor, project.css);\n dispatchChanges(editorManager.jsEditor, project.javascript);\n if (name === 'react') setPreprocessor('javascript', 'babel');\n data.demos = false;\n renderPreview(true);\n}\nwindow.importJSON = obj => {\n if (obj === null) return;\n const clone = { ...obj };\n project.autorun = false;\n project.name = obj.name;\n project.version = obj.version;\n project.title = obj.title;\n project.description = obj.description;\n project.author = obj.author;\n project.url = obj.url;\n project.logo = obj.logo;\n project.console = obj.console;\n project.dark = obj.dark;\n project.module = obj.module;\n project.pwa = obj.pwa;\n project.activePanel = obj.activePanel;\n project.preview = obj.preview;\n project.columns = obj.columns;\n project.columnsRight = obj.columnsRight;\n \n // Check and set previewDark state\n if (typeof project.previewDark === 'undefined') {\n project.previewDark = obj.previewDark !== undefined ? obj.previewDark : obj.dark;\n } else {\n project.previewDark = obj.previewDark;\n }\n \n project.meta = obj.meta;\n project.libraries = obj.libraries;\n project.html = obj.html;\n project.css = obj.css;\n project.javascript = obj.javascript;\n\n // Dispatch changes to editors\n if (window.editorManager) {\n dispatchChanges(editorManager.htmlEditor, project.html);\n dispatchChanges(editorManager.cssEditor, project.css);\n dispatchChanges(editorManager.jsEditor, project.javascript);\n }\n\n setPreprocessor('html', obj.html_pre_processor);\n setPreprocessor('css', obj.css_pre_processor);\n setPreprocessor('javascript', obj.javascript_pre_processor);\n project.autorun = clone.autorun;\n}\nwindow.importProject = () => {\n Modal.render({\n title: \"Are you sure you want to load a new project?\",\n content: `
All current data will be lost.
`,\n onClose: function () {\n data.menuDialog = true;\n },\n onConfirm: function() {\n const input = document.createElement('input');\n input.type = 'file';\n input.accept = '.json';\n\n input.addEventListener('change', (event) => {\n const file = event.target.files[0];\n \n if (!file) {\n console.error('No file selected.');\n return;\n }\n \n const reader = new FileReader();\n \n reader.onload = event => {\n try {\n importJSON(JSON.parse(event.target.result));\n renderPreview(true);\n } catch (error) {\n console.error('Error parsing JSON file:', error);\n }\n };\n \n reader.readAsText(file);\n input.remove();\n });\n \n input.click();\n }\n });\n}\nwindow.getFileNameAndType = url => {\n // Extract the file name with extension from the URL\n const fileName = url.substring(url.lastIndexOf('/') + 1);\n \n // Extract the file extension\n const fileExtension = fileName.split('.').pop().toLowerCase();\n \n // Map file extensions to MIME types\n const mimeTypes = {\n 'jpeg': 'image/jpeg',\n 'jpg': 'image/jpeg',\n 'png': 'image/png',\n 'gif': 'image/gif',\n 'bmp': 'image/bmp',\n 'webp': 'image/webp',\n 'svg': 'image/svg+xml',\n 'mp3': 'audio/mpeg',\n 'wav': 'audio/wav',\n 'ogg': 'audio/ogg',\n 'mp4': 'video/mp4',\n 'webm': 'video/webm',\n 'ogv': 'video/ogg'\n };\n \n // Get the MIME type based on the file extension\n const fileType = mimeTypes[fileExtension] || 'application/octet-stream';\n \n return {\n fileName,\n fileType\n };\n}\nwindow.fetchResources = obj => {\n try {\n const doc = new DOMParser().parseFromString(obj.html, 'text/html');\n const body = doc.body;\n\n const imageResources = [];\n const audioResources = [];\n const vectorResources = [];\n const videoResources = [];\n\n let fileCounter = 1;\n\n // Helper function to check if a string is Base64\n function isBase64(str) {\n return str.startsWith('data:') && str.includes('base64,');\n }\n\n // Helper function to extract file type from Base64 string\n function getBase64FileType(str) {\n const mimeMatch = str.match(/^data:(.*);base64,/);\n if (mimeMatch) {\n const mimeType = mimeMatch[1];\n return mimeTypeToExtension(mimeType);\n }\n return 'unknown';\n }\n\n // Helper function to map MIME types to file extensions\n function mimeTypeToExtension(mimeType) {\n const typeMap = {\n // Images\n 'image/jpeg': 'jpg',\n 'image/png': 'png',\n 'image/gif': 'gif',\n 'image/svg+xml': 'svg',\n 'image/webp': 'webp',\n 'image/tiff': 'tiff',\n 'image/bmp': 'bmp',\n 'image/x-icon': 'ico',\n\n // Audio\n 'audio/mpeg': 'mp3',\n 'audio/wav': 'wav',\n 'audio/ogg': 'ogg',\n 'audio/aac': 'aac',\n 'audio/webm': 'webm',\n 'audio/flac': 'flac',\n\n // Video\n 'video/mp4': 'mp4',\n 'video/webm': 'webm',\n 'video/ogg': 'ogv',\n 'video/avi': 'avi',\n 'video/mpeg': 'mpg',\n 'video/quicktime': 'mov',\n 'video/x-msvideo': 'avi',\n 'video/x-matroska': 'mkv',\n\n // Fallback for unknown types\n 'unknown': 'bin'\n };\n return typeMap[mimeType] || 'bin';\n }\n\n // Helper function to extract file name from URL\n function getFileName(url) {\n return url.substring(url.lastIndexOf('/') + 1);\n }\n\n // Generate a file name for Base64 resources\n function getBase64FileName() {\n return `file-${fileCounter++}`;\n }\n\n // Extract image URLs and filenames\n body.querySelectorAll('img').forEach(img => {\n if (img.hasAttribute('src')) {\n const src = img.getAttribute('src');\n\n if (isBase64(src)) {\n const fileType = getBase64FileType(src);\n const fileName = `${getBase64FileName()}.${fileType}`;\n imageResources.push({ url: src, fileName: fileName });\n img.src = `imgs/${fileName}`;\n } else {\n const fileName = getFileName(src);\n imageResources.push({ url: src, fileName: fileName });\n img.src = `imgs/${getFileNameAndType(src).fileName}`;\n }\n }\n\n if (img.hasAttribute('srcset')) {\n img.srcset.split(',').forEach(srcset => {\n const url = srcset.trim().split(' ')[0];\n if (isBase64(url)) {\n const fileType = getBase64FileType(src);\n const fileName = `${getBase64FileName()}.${fileType}`;\n imageResources.push({ url: url, fileName: fileName });\n img.src = `imgs/${fileName}`;\n } else {\n const fileName = getFileName(url);\n imageResources.push({ url: url, fileName: fileName });\n img.src = `imgs/${getFileNameAndType(img.getAttribute('src')).fileName}`;\n }\n });\n }\n });\n\n // Extract audio URLs and filenames\n body.querySelectorAll('audio').forEach(audio => {\n audio.querySelectorAll('source').forEach(source => {\n if (source.hasAttribute('src')) {\n const src = source.getAttribute('src');\n\n if (isBase64(src)) {\n const fileType = getBase64FileType(src);\n const fileName = `${getBase64FileName()}.${fileType}`;\n audioResources.push({ url: src, fileName: fileName });\n source.src = `audios/${fileName}`;\n } else {\n const fileName = getFileName(src);\n audioResources.push({ url: src, fileName: fileName });\n source.src = `audios/${getFileNameAndType(src).fileName}`;\n }\n }\n });\n });\n\n // Extract vectors\n body.querySelectorAll('svg').forEach(svg => {\n vectorResources.push({ content: svg.outerHTML, fileName: `vector-${vectorResources.length + 1}.svg` });\n });\n\n // Extract video URLs and filenames\n body.querySelectorAll('video').forEach(video => {\n video.querySelectorAll('source').forEach(source => {\n if (source.hasAttribute('src')) {\n const src = source.getAttribute('src');\n\n if (isBase64(src)) {\n const fileType = getBase64FileType(src);\n const fileName = `${getBase64FileName()}.${fileType}`;\n videoResources.push({ url: src, fileName: fileName });\n source.src = `vids/${fileName}`;\n } else {\n const fileName = getFileName(src);\n videoResources.push({ url: src, fileName: fileName });\n source.src = `vids/${getFileNameAndType(src).fileName}`;\n }\n }\n });\n });\n\n // Function to extract and process background images from CSS\n function extractBackgroundImageUrls(css) {\n const urls = [];\n const regex = /background-image\\s*:\\s*url\\(([^)]+)\\)/g;\n let match;\n while ((match = regex.exec(css)) !== null) {\n let url = match[1].replace(/['\"]/g, \"\"); // Remove quotes around URLs\n if (isBase64(url)) {\n const fileType = getBase64FileType(url);\n const fileName = `${getBase64FileName()}.${fileType}`;\n imageResources.push({ url: url, fileName: fileName });\n } else {\n const fileName = getFileName(url);\n imageResources.push({ url: url, fileName: fileName });\n }\n urls.push(url);\n }\n return urls;\n }\n\n // Extract background-image URLs from project CSS\n const projectCss = obj.css || '';\n extractBackgroundImageUrls(projectCss);\n\n return {\n html: doc.body.innerHTML,\n imageResources,\n audioResources,\n vectorResources,\n videoResources\n };\n } catch (error) {\n console.error('Error fetching resources:', error);\n return null; // Or handle the error in an appropriate way\n }\n}\nwindow.getBase64Media = async mediaUrl => {\n const response = await fetch(mediaUrl);\n const blob = await response.blob();\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => resolve(reader.result.split(',')[1]);\n reader.onerror = reject;\n reader.readAsDataURL(blob);\n });\n}\nwindow.downloadJSON = async () => {\n try {\n await loadScript(\"libraries/jszip/FileSaver.min.js\");\n let blob = new Blob([JSON.stringify(project, null, 2)], {type: \"application/json\"});\n saveAs(blob, `${project.name.split(' ').join('').toLowerCase()}-kodeWeave.json`);\n\n } catch (error) {\n console.error('Error:', error);\n } finally {\n // Clean up scripts after use\n removeScript(\"libraries/jszip/FileSaver.min.js\");\n }\n}\nwindow.getFile = async (url, callback = null) => {\n try {\n const response = await fetch(url);\n if (!response.ok) throw new Error(\"Network response was not ok\");\n const fileContent = await response.text();\n if (callback && typeof callback === 'function') {\n callback(null, fileContent); // Call the callback with the file content\n } else {\n return fileContent; // Return the file content\n }\n } catch (error) {\n console.warn(\"Request error:\", error);\n if (callback && typeof callback === 'function') {\n callback(error, null); // Call the callback with the error\n } else {\n throw error; // Re-throw to handle in caller\n }\n }\n}\nwindow.downloadProject = async () => {\n try {\n await loadScripts([\n \"libraries/jszip/jszip.min.js\",\n \"libraries/jszip/FileSaver.min.js\"\n ]);\n\n // Extract srcset URLs\n const iframe = document.getElementById('iframe');\n if (!iframe) return;\n const idoc = iframe.contentDocument || iframe.contentWindow.document;\n const { html, imageResources, audioResources, vectorResources, videoResources } = fetchResources(project);\n\n const zip = new JSZip();\n\n // Project file\n zip.file(`${project.name.split(' ').join('').toLowerCase()}-kodeWeave.json`, JSON.stringify(project, null, 2));\n\n function checkCSSDependencies() {\n if (!twFound && project.css.trim() !== '') {\n return `,\n \"postcss\": \"^8.4.6\",\n \"autoprefixer\": \"^10.4.2\",\n \"cssnano\": \"^5.0.12\"`;\n }\n return '';\n }\n \n function checkJSDependencies() {\n if (project.javascript_pre_processor === 'babel') {\n return `,\n \"@babel/core\": \"^7.15.5\",\n \"@babel/preset-env\": \"^7.15.6\",\n \"@babel/preset-react\": \"^7.14.5\",\n \"rollup-plugin-babel\": \"^4.4.0\"`;\n }\n if (project.javascript_pre_processor === 'typescript') {\n return `,\n \"rollup-plugin-typescript2\": \"^0.31.1\",\n \"typescript\": \"^4.4.3\"`;\n }\n return '';\n }\n\n let rollupInput = ``;\n \n // Rollup Configuration\n let rollupPlugins = `import { terser } from 'rollup-plugin-terser';\n`;\n \n if (project.javascript_pre_processor === 'javascript') {\n rollupInput = `src/script.js`;\n }\n\n if (project.javascript_pre_processor === 'babel') {\n rollupPlugins += `import babel from 'rollup-plugin-babel';\n`;\n rollupInput = `src/script.jsx`;\n }\n \n if (project.javascript_pre_processor === 'typescript') {\n rollupPlugins += `import typescript from 'rollup-plugin-typescript2';\n`;\n rollupInput = `src/script.ts`;\n }\n \n let rollupStr = `${rollupPlugins}\nexport default {\n input: '${rollupInput}', // entry point to your Javascript\n output: {\n file: 'dist/script.js',\n format: ${project.module ? \"'es'\" : \"'iife'\"}, // Immediately Invoked Function Expression, suitable for \n `;\n const swjs = `// Service worker code\nimportScripts('https://storage.googleapis.com/workbox-cdn/releases/6.4.1/workbox-sw.js');\n\nconst { registerRoute } = workbox.routing;\nconst { CacheFirst } = workbox.strategies;\n\nconst cacheName = '${project.name.split(' ').join('')}-cache';\n\nworkbox.routing.registerRoute(\n({ request }) => request.destination === 'script' ||\n request.destination === 'style' ||\n request.destination === 'document' ||\n request.destination === 'image' ||\n request.destination === 'font' ||\n request.destination === 'audio' ||\n request.destination === 'video',\nnew CacheFirst({\ncacheName: cacheName,\nplugins: [\n// Any additional plugins can be added here\n],\n})\n);`\n zip.file(\"sw.js\", swjs);\n }\n\n // Iterate over each library\n let scriptTags = '';\n let scriptTagsTWChecked = '';\n let cssTags = '';\n let gFonts = '';\n project.libraries.forEach(library => {\n if (library.endsWith('.js')) {\n scriptTags += `\\n `;\n if (twFound && (library.startsWith('https://michaelsboost.com/TailwindCSSMod/') || library.startsWith('http://michaelsboost.com/TailwindCSSMod/') || library.startsWith('//michaelsboost.com/TailwindCSSMod/'))) return;\n scriptTagsTWChecked += `\\n `;\n } else if (library.endsWith('.css')) {\n cssTags += `\\n `;\n } else {\n // Assuming it's a Google font\n gFonts += `\\n `;\n }\n });\n\n async function minifyJS(jsCode) {\n // detect if terser exists\n if (!document.querySelector(\"script[src='libraries/terser/bundle.min.js']\")) {\n await loadScript(\"libraries/terser/bundle.min.js\");\n }\n return Terser.minify(jsCode);\n }\n\n let minifiedJS = await minifyJS(await compileCode('javascript'));\n minifiedJS = minifiedJS.code;\n\n // Add script.js\n zip.file(`${rollupInput}`, project.javascript);\n if (project.javascript_pre_processor === 'javascript') zip.file('dist/script.js', project.javascript);\n if (project.javascript_pre_processor === 'babel') zip.file('dist/script.js', minifiedJS);\n if (project.javascript_pre_processor === 'typescript') zip.file('dist/script.js', minifiedJS);\n\n // script tag for test.html\n let placeScript = ``;\n if (project.javascript_pre_processor === 'babel') {\n const library = \"libraries/preprocessors/babel.min.js\";\n const data = await getFile(library);\n const parts = library.split(\"/\");\n const name = parts[parts.length - 1];\n\n zip.folder('libraries').file(name, data);\n\n placeScript = `\n `;\n }\n if (project.javascript_pre_processor === 'typescript') {\n let library = \"libraries/preprocessors/typescript.min.js\";\n let data = await getFile(library);\n let parts = library.split(\"/\");\n let name = parts[parts.length - 1];\n zip.folder('libraries').file(name, data);\n\n library = \"libraries/preprocessors/typescript.compile.min.js\";\n data = await getFile(library);\n parts = library.split(\"/\");\n name = parts[parts.length - 1];\n zip.folder('libraries').file(name, data);\n\n placeScript = `\n \n `;\n }\n \n // Add index.html\n const indexHtmlContent = `\n\n \n ${project.title}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ${gFonts}${cssTags ? cssTags : ''}${project.meta ? `${project.meta}\\n ` : ''}\n ${twFound ? \n cssContent ? `` : `` \n : ``}\n \n \n\n${html}\n\n ${scriptTags ? scriptTags : ''}\n ${project.javascript ? placeScript : ''}\n \n`;\n const indexHtmlContentCompiled = `\n\n \n ${project.title}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ${gFonts}${css4html}${project.meta ? `${project.meta}\\n ` : ''}${scriptTags ? twFound ? scriptTagsTWChecked : scriptTags : ''}\n \n \n \n${html}\n\n ${project.javascript ? `` : ''}${(project.pwa ? swinit : '')}\n \n`;\n zip.file('test.html', indexHtmlContent);\n zip.file('index.html', indexHtmlContentCompiled);\n if (project.html_pre_processor === 'html') zip.file('src/source.html', project.html);\n if (project.html_pre_processor === 'markdown') zip.file('src/source.md', project.html);\n if (project.html_pre_processor === 'pug') zip.file('src/source.pug', project.html);\n if (project.html_pre_processor === 'jade') zip.file('src/source.jade', project.html);\n\n // Save audio files to ZIP\n if (audioResources.length > 0) {\n const audioFolder = zip.folder('audios');\n try {\n for (const { url, fileName } of audioResources) {\n const base64Audio = await getBase64Media(url);\n audioFolder.file(fileName, base64Audio, { base64: true });\n }\n } catch (error) {\n console.error('Error adding audio to ZIP:', error);\n return;\n }\n }\n\n // Save image files to ZIP\n if (imageResources.length > 0) {\n try {\n for (const { url, fileName } of imageResources) {\n const base64Image = await getBase64Media(url);\n zip.folder('imgs').file(fileName, base64Image, { base64: true });\n }\n } catch (error) {\n console.error('Error adding images to ZIP:', error);\n return;\n }\n }\n\n // Save SVG files to ZIP\n if (vectorResources.length > 0) {\n const svgFolder = zip.folder('svgs');\n try {\n for (const { content, fileName } of vectorResources) {\n svgFolder.file(fileName, content);\n }\n } catch (error) {\n console.error('Error adding SVGs to ZIP:', error);\n return;\n }\n }\n\n // Save video files to ZIP\n if (videoResources.length > 0) {\n const videoFolder = zip.folder('vids');\n try {\n for (const { url, fileName } of videoResources) {\n const base64Video = await getBase64Media(url);\n videoFolder.file(fileName, base64Video, { base64: true });\n }\n } catch (error) {\n console.error('Error adding videos to ZIP:', error);\n return;\n }\n }\n\n // Generate the ZIP file\n const blob = await zip.generateAsync({ type: 'blob' });\n saveAs(blob, `${project.name.toLowerCase().split(' ').join('')}.zip`);\n \n // Clear all arrays after saving\n imageResources.length = audioResources.length = vectorResources.length = videoResources.length = 0;\n } catch (error) {\n console.error('Error:', error);\n } finally {\n // Clean up scripts after use\n const scriptsToRemove = [\n 'libraries/jszip/FileSaver.min.js',\n 'libraries/jszip/jszip.min.js'\n ];\n\n removeScripts(scriptsToRemove);\n }\n}\nwindow.share = async () => {\n try {\n if (navigator.onLine) {\n let jsPreprocessor = null;\n if (project.javascript_pre_processor === 'javascript') {\n jsPreprocessor = \"none\";\n } else {\n jsPreprocessor = project.javascript_pre_processor;\n }\n\n const shareProject = {\n title: project.title,\n description: project.description,\n head: project.meta,\n html: project.html,\n html_pre_processor: project.html_pre_processor === \"html\" ? \"none\" : \"\",\n css: project.css,\n css_pre_processor: project.css_pre_processor === \"css\" ? \"none\" : \"\",\n css_external: project.libraries.filter(lib => lib.endsWith('.css')).join(';'),\n css_starter: \"neither\",\n css_prefix: \"neither\",\n js_module: project.module,\n js: `document.documentElement.setAttribute('data-theme', '${project.previewDark ? 'dark' : 'light'}');\n \n${project.javascript}`,\n js_pre_processor: jsPreprocessor,\n js_external: project.libraries.filter(lib => lib.endsWith('.js')).join(';'),\n editors: '111',\n layout: 'left'\n };\n\n // Stringify the JSON object and escape quotes\n const JSONstring = JSON.stringify(shareProject)\n .replace(/\"/g, \""\")\n .replace(/'/g, \"'\");\n\n // Create form element\n const form = `\n
\n \n \n
`;\n\n // Append form to the document body and submit\n document.body.insertAdjacentHTML('beforeend', form);\n document.querySelector('form').submit();\n document.querySelector('form').remove();\n } else {\n Modal.render({\n title: \"Unable to share!\",\n content: `
No internet connection!
`\n });\n }\n } catch (error) {\n console.error('Error sharing project:', error);\n }\n}\n\nwindow.screenshot = async () => {\n const iframe = document.getElementById('iframe');\n const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;\n\n try {\n await loadScripts([\n \"libraries/html2canvas/html2canvas.min.js\",\n \"libraries/jszip/FileSaver.min.js\"\n ]);\n \n html2canvas(iframeDocument.documentElement).then(canvas => {\n const context = canvas.getContext('2d');\n const videoElements = iframeDocument.getElementsByTagName('video');\n\n // Draw video elements\n Array.from(videoElements).forEach(video => {\n const { currentTime, paused, volume } = video;\n\n // Set volume to 0 for the screenshot process\n video.volume = 0;\n\n // Draw the video frame\n if (!paused) video.pause();\n context.drawImage(video, video.offsetLeft, video.offsetTop, video.clientWidth, video.clientHeight);\n\n // Restore the original volume and playback state\n video.volume = volume;\n video.currentTime = currentTime;\n if (!paused) video.play();\n });\n\n // Convert canvas to Blob\n canvas.toBlob(blob => {\n // Save the Blob using FileSaver.js\n saveAs(blob, 'screenshot.png');\n }, 'image/png');\n }).catch(error => {\n console.error('Error taking screenshot:', error);\n });\n } catch (error) {\n console.error('Error:', error);\n } finally {\n // Clean up scripts after use\n removeScript(\"../libraries/html2canvas/html2canvas.min.js\");\n removeScript(\"../libraries/jszip/FileSaver.min.js\");\n }\n}\nwindow.createBlobURL = (content, type) => {\n const blob = new Blob([content], { type });\n return URL.createObjectURL(blob);\n}\nwindow.renderPreview = async (forceRun = false) => {\n const iframe = document.getElementById('iframe');\n if (!iframe) return;\n\n let scriptTags = '';\n let cssTags = '';\n project.libraries.forEach(library => {\n if (library.endsWith('.js')) {\n scriptTags += `\\n `;\n } else if (library.endsWith('.css')) {\n cssTags += `\\n `;\n } else {\n cssTags += `\\n `;\n }\n });\n\n const javascriptCode = await compileCode('javascript');\n const cssCode = await compileCode('css');\n const consoleCSS = `[data-zwj=zwjkonsole] {\n display: ${project.console ? 'flex' : 'none'};\n}\n\n`\n\n const domconsoleContent = await fetch('libraries/domconsole/dom-console-mod.min.js').then(response => response.text());\n let jsLink = createBlobURL(javascriptCode, 'application/javascript');\n const iframeSrc = `\n \n ${project.title}\n \n \n \n \n ${project.meta ? project.meta : ''}\n ${cssTags}\n \n \n \n \n ${await compileCode('html')}\n ${scriptTags ? scriptTags : ''}\n ${project.css_pre_processor === 'less' ? '' : ''}\n \n \n`;\n const newHtmlBlobURL = createBlobURL(iframeSrc, 'text/html');\n\n if (forceRun) {\n iframe.setAttribute('src', newHtmlBlobURL);\n }\n}\n\n// Diffing algorithm to update ui when changes occur\nwindow.diffNodes = (oldNode, newNode) => {\n if (!oldNode || !newNode) {\n return;\n }\n\n // Check for data-ignore attribute\n if (oldNode.hasAttribute && oldNode.hasAttribute('data-ignore') || \n newNode.hasAttribute && newNode.hasAttribute('data-ignore')) {\n return;\n }\n\n // Check if nodes are iframe elements\n if (oldNode.nodeName === 'IFRAME' && newNode.nodeName === 'IFRAME') {\n const acceptableIframeAttributes = ['id', 'title', 'class', 'style', 'sandbox'];\n // Compare acceptable attributes only\n acceptableIframeAttributes.forEach(attr => {\n if (oldNode.getAttribute(attr) !== newNode.getAttribute(attr)) {\n oldNode.setAttribute(attr, newNode.getAttribute(attr));\n }\n });\n\n const oldSrcdoc = oldNode.getAttribute('srcdoc');\n const newSrcdoc = newNode.getAttribute('srcdoc');\n // Ignore srcdoc attribute if it hasn't changed\n if (oldSrcdoc === newSrcdoc) return;\n return;\n }\n\n // If nodes are different types, replace the old node\n if (oldNode.nodeName !== newNode.nodeName) {\n oldNode.replaceWith(newNode.cloneNode(true));\n // console.log('Different node names:', oldNode, newNode);\n return;\n }\n\n // Diff the attributes of the nodes\n if (oldNode.nodeType === Node.ELEMENT_NODE && newNode.nodeType === Node.ELEMENT_NODE) {\n const oldAttributes = Array.from(oldNode.attributes);\n const newAttributes = Array.from(newNode.attributes);\n\n // Remove old attributes not present in the new node\n oldAttributes.forEach(attr => {\n if (!newNode.hasAttribute(attr.name)) {\n oldNode.removeAttribute(attr.name);\n }\n });\n\n // Add or update attributes from the new node\n newAttributes.forEach(attr => {\n if (oldNode.getAttribute(attr.name) !== attr.value) {\n oldNode.setAttribute(attr.name, attr.value);\n }\n });\n }\n\n const oldChildren = Array.from(oldNode.childNodes);\n const newChildren = Array.from(newNode.childNodes);\n\n // Update or remove existing child nodes\n oldChildren.forEach((oldChild, index) => {\n const newChild = newChildren[index];\n if (!newChild) {\n oldNode.removeChild(oldChild);\n return;\n }\n // Special handling for elements\n if (oldNode.tagName === 'TITLE' || oldNode.tagName === 'STYLE' && oldNode.textContent !== newNode.textContent) {\n oldNode.textContent = newNode.textContent;\n } else if (oldChild.nodeType === Node.TEXT_NODE && oldChild.nodeValue !== newChild.nodeValue) {\n oldChild.nodeValue = newChild.nodeValue;\n }\n diffNodes(oldChild, newChild);\n });\n\n // Add new child nodes\n newChildren.slice(oldChildren.length).forEach(newChild => {\n oldNode.appendChild(newChild.cloneNode(true));\n });\n}\n\n// Once dom has loaded init functions\ndocument.addEventListener('DOMContentLoaded', function() {\n window.onload = () => {\n App.render('#app');\n if (window.initEditors) initEditors();\n getIFrameClientSize();\n\n if (localStorage.getItem('kodeWeave')) {\n importJSON(JSON.parse(localStorage.getItem('kodeWeave')));\n renderPreview(true);\n }\n }\n window.onresize = () => getIFrameClientSize();\n});", "(function () {\n 'use strict';\n\n /**\n The data structure for documents. @nonabstract\n */\n class Text {\n /**\n Get the line description around the given position.\n */\n lineAt(pos) {\n if (pos < 0 || pos > this.length)\n throw new RangeError(`Invalid position ${pos} in document of length ${this.length}`);\n return this.lineInner(pos, false, 1, 0);\n }\n /**\n Get the description for the given (1-based) line number.\n */\n line(n) {\n if (n < 1 || n > this.lines)\n throw new RangeError(`Invalid line number ${n} in ${this.lines}-line document`);\n return this.lineInner(n, true, 1, 0);\n }\n /**\n Replace a range of the text with the given content.\n */\n replace(from, to, text) {\n [from, to] = clip(this, from, to);\n let parts = [];\n this.decompose(0, from, parts, 2 /* Open.To */);\n if (text.length)\n text.decompose(0, text.length, parts, 1 /* Open.From */ | 2 /* Open.To */);\n this.decompose(to, this.length, parts, 1 /* Open.From */);\n return TextNode.from(parts, this.length - (to - from) + text.length);\n }\n /**\n Append another document to this one.\n */\n append(other) {\n return this.replace(this.length, this.length, other);\n }\n /**\n Retrieve the text between the given points.\n */\n slice(from, to = this.length) {\n [from, to] = clip(this, from, to);\n let parts = [];\n this.decompose(from, to, parts, 0);\n return TextNode.from(parts, to - from);\n }\n /**\n Test whether this text is equal to another instance.\n */\n eq(other) {\n if (other == this)\n return true;\n if (other.length != this.length || other.lines != this.lines)\n return false;\n let start = this.scanIdentical(other, 1), end = this.length - this.scanIdentical(other, -1);\n let a = new RawTextCursor(this), b = new RawTextCursor(other);\n for (let skip = start, pos = start;;) {\n a.next(skip);\n b.next(skip);\n skip = 0;\n if (a.lineBreak != b.lineBreak || a.done != b.done || a.value != b.value)\n return false;\n pos += a.value.length;\n if (a.done || pos >= end)\n return true;\n }\n }\n /**\n Iterate over the text. When `dir` is `-1`, iteration happens\n from end to start. This will return lines and the breaks between\n them as separate strings.\n */\n iter(dir = 1) { return new RawTextCursor(this, dir); }\n /**\n Iterate over a range of the text. When `from` > `to`, the\n iterator will run in reverse.\n */\n iterRange(from, to = this.length) { return new PartialTextCursor(this, from, to); }\n /**\n Return a cursor that iterates over the given range of lines,\n _without_ returning the line breaks between, and yielding empty\n strings for empty lines.\n \n When `from` and `to` are given, they should be 1-based line numbers.\n */\n iterLines(from, to) {\n let inner;\n if (from == null) {\n inner = this.iter();\n }\n else {\n if (to == null)\n to = this.lines + 1;\n let start = this.line(from).from;\n inner = this.iterRange(start, Math.max(start, to == this.lines + 1 ? this.length : to <= 1 ? 0 : this.line(to - 1).to));\n }\n return new LineCursor(inner);\n }\n /**\n Return the document as a string, using newline characters to\n separate lines.\n */\n toString() { return this.sliceString(0); }\n /**\n Convert the document to an array of lines (which can be\n deserialized again via [`Text.of`](https://codemirror.net/6/docs/ref/#state.Text^of)).\n */\n toJSON() {\n let lines = [];\n this.flatten(lines);\n return lines;\n }\n /**\n @internal\n */\n constructor() { }\n /**\n Create a `Text` instance for the given array of lines.\n */\n static of(text) {\n if (text.length == 0)\n throw new RangeError(\"A document must have at least one line\");\n if (text.length == 1 && !text[0])\n return Text.empty;\n return text.length <= 32 /* Tree.Branch */ ? new TextLeaf(text) : TextNode.from(TextLeaf.split(text, []));\n }\n }\n // Leaves store an array of line strings. There are always line breaks\n // between these strings. Leaves are limited in size and have to be\n // contained in TextNode instances for bigger documents.\n class TextLeaf extends Text {\n constructor(text, length = textLength(text)) {\n super();\n this.text = text;\n this.length = length;\n }\n get lines() { return this.text.length; }\n get children() { return null; }\n lineInner(target, isLine, line, offset) {\n for (let i = 0;; i++) {\n let string = this.text[i], end = offset + string.length;\n if ((isLine ? line : end) >= target)\n return new Line$1(offset, end, line, string);\n offset = end + 1;\n line++;\n }\n }\n decompose(from, to, target, open) {\n let text = from <= 0 && to >= this.length ? this\n : new TextLeaf(sliceText(this.text, from, to), Math.min(to, this.length) - Math.max(0, from));\n if (open & 1 /* Open.From */) {\n let prev = target.pop();\n let joined = appendText(text.text, prev.text.slice(), 0, text.length);\n if (joined.length <= 32 /* Tree.Branch */) {\n target.push(new TextLeaf(joined, prev.length + text.length));\n }\n else {\n let mid = joined.length >> 1;\n target.push(new TextLeaf(joined.slice(0, mid)), new TextLeaf(joined.slice(mid)));\n }\n }\n else {\n target.push(text);\n }\n }\n replace(from, to, text) {\n if (!(text instanceof TextLeaf))\n return super.replace(from, to, text);\n [from, to] = clip(this, from, to);\n let lines = appendText(this.text, appendText(text.text, sliceText(this.text, 0, from)), to);\n let newLen = this.length + text.length - (to - from);\n if (lines.length <= 32 /* Tree.Branch */)\n return new TextLeaf(lines, newLen);\n return TextNode.from(TextLeaf.split(lines, []), newLen);\n }\n sliceString(from, to = this.length, lineSep = \"\\n\") {\n [from, to] = clip(this, from, to);\n let result = \"\";\n for (let pos = 0, i = 0; pos <= to && i < this.text.length; i++) {\n let line = this.text[i], end = pos + line.length;\n if (pos > from && i)\n result += lineSep;\n if (from < end && to > pos)\n result += line.slice(Math.max(0, from - pos), to - pos);\n pos = end + 1;\n }\n return result;\n }\n flatten(target) {\n for (let line of this.text)\n target.push(line);\n }\n scanIdentical() { return 0; }\n static split(text, target) {\n let part = [], len = -1;\n for (let line of text) {\n part.push(line);\n len += line.length + 1;\n if (part.length == 32 /* Tree.Branch */) {\n target.push(new TextLeaf(part, len));\n part = [];\n len = -1;\n }\n }\n if (len > -1)\n target.push(new TextLeaf(part, len));\n return target;\n }\n }\n // Nodes provide the tree structure of the `Text` type. They store a\n // number of other nodes or leaves, taking care to balance themselves\n // on changes. There are implied line breaks _between_ the children of\n // a node (but not before the first or after the last child).\n class TextNode extends Text {\n constructor(children, length) {\n super();\n this.children = children;\n this.length = length;\n this.lines = 0;\n for (let child of children)\n this.lines += child.lines;\n }\n lineInner(target, isLine, line, offset) {\n for (let i = 0;; i++) {\n let child = this.children[i], end = offset + child.length, endLine = line + child.lines - 1;\n if ((isLine ? endLine : end) >= target)\n return child.lineInner(target, isLine, line, offset);\n offset = end + 1;\n line = endLine + 1;\n }\n }\n decompose(from, to, target, open) {\n for (let i = 0, pos = 0; pos <= to && i < this.children.length; i++) {\n let child = this.children[i], end = pos + child.length;\n if (from <= end && to >= pos) {\n let childOpen = open & ((pos <= from ? 1 /* Open.From */ : 0) | (end >= to ? 2 /* Open.To */ : 0));\n if (pos >= from && end <= to && !childOpen)\n target.push(child);\n else\n child.decompose(from - pos, to - pos, target, childOpen);\n }\n pos = end + 1;\n }\n }\n replace(from, to, text) {\n [from, to] = clip(this, from, to);\n if (text.lines < this.lines)\n for (let i = 0, pos = 0; i < this.children.length; i++) {\n let child = this.children[i], end = pos + child.length;\n // Fast path: if the change only affects one child and the\n // child's size remains in the acceptable range, only update\n // that child\n if (from >= pos && to <= end) {\n let updated = child.replace(from - pos, to - pos, text);\n let totalLines = this.lines - child.lines + updated.lines;\n if (updated.lines < (totalLines >> (5 /* Tree.BranchShift */ - 1)) &&\n updated.lines > (totalLines >> (5 /* Tree.BranchShift */ + 1))) {\n let copy = this.children.slice();\n copy[i] = updated;\n return new TextNode(copy, this.length - (to - from) + text.length);\n }\n return super.replace(pos, end, updated);\n }\n pos = end + 1;\n }\n return super.replace(from, to, text);\n }\n sliceString(from, to = this.length, lineSep = \"\\n\") {\n [from, to] = clip(this, from, to);\n let result = \"\";\n for (let i = 0, pos = 0; i < this.children.length && pos <= to; i++) {\n let child = this.children[i], end = pos + child.length;\n if (pos > from && i)\n result += lineSep;\n if (from < end && to > pos)\n result += child.sliceString(from - pos, to - pos, lineSep);\n pos = end + 1;\n }\n return result;\n }\n flatten(target) {\n for (let child of this.children)\n child.flatten(target);\n }\n scanIdentical(other, dir) {\n if (!(other instanceof TextNode))\n return 0;\n let length = 0;\n let [iA, iB, eA, eB] = dir > 0 ? [0, 0, this.children.length, other.children.length]\n : [this.children.length - 1, other.children.length - 1, -1, -1];\n for (;; iA += dir, iB += dir) {\n if (iA == eA || iB == eB)\n return length;\n let chA = this.children[iA], chB = other.children[iB];\n if (chA != chB)\n return length + chA.scanIdentical(chB, dir);\n length += chA.length + 1;\n }\n }\n static from(children, length = children.reduce((l, ch) => l + ch.length + 1, -1)) {\n let lines = 0;\n for (let ch of children)\n lines += ch.lines;\n if (lines < 32 /* Tree.Branch */) {\n let flat = [];\n for (let ch of children)\n ch.flatten(flat);\n return new TextLeaf(flat, length);\n }\n let chunk = Math.max(32 /* Tree.Branch */, lines >> 5 /* Tree.BranchShift */), maxChunk = chunk << 1, minChunk = chunk >> 1;\n let chunked = [], currentLines = 0, currentLen = -1, currentChunk = [];\n function add(child) {\n let last;\n if (child.lines > maxChunk && child instanceof TextNode) {\n for (let node of child.children)\n add(node);\n }\n else if (child.lines > minChunk && (currentLines > minChunk || !currentLines)) {\n flush();\n chunked.push(child);\n }\n else if (child instanceof TextLeaf && currentLines &&\n (last = currentChunk[currentChunk.length - 1]) instanceof TextLeaf &&\n child.lines + last.lines <= 32 /* Tree.Branch */) {\n currentLines += child.lines;\n currentLen += child.length + 1;\n currentChunk[currentChunk.length - 1] = new TextLeaf(last.text.concat(child.text), last.length + 1 + child.length);\n }\n else {\n if (currentLines + child.lines > chunk)\n flush();\n currentLines += child.lines;\n currentLen += child.length + 1;\n currentChunk.push(child);\n }\n }\n function flush() {\n if (currentLines == 0)\n return;\n chunked.push(currentChunk.length == 1 ? currentChunk[0] : TextNode.from(currentChunk, currentLen));\n currentLen = -1;\n currentLines = currentChunk.length = 0;\n }\n for (let child of children)\n add(child);\n flush();\n return chunked.length == 1 ? chunked[0] : new TextNode(chunked, length);\n }\n }\n Text.empty = /*@__PURE__*/new TextLeaf([\"\"], 0);\n function textLength(text) {\n let length = -1;\n for (let line of text)\n length += line.length + 1;\n return length;\n }\n function appendText(text, target, from = 0, to = 1e9) {\n for (let pos = 0, i = 0, first = true; i < text.length && pos <= to; i++) {\n let line = text[i], end = pos + line.length;\n if (end >= from) {\n if (end > to)\n line = line.slice(0, to - pos);\n if (pos < from)\n line = line.slice(from - pos);\n if (first) {\n target[target.length - 1] += line;\n first = false;\n }\n else\n target.push(line);\n }\n pos = end + 1;\n }\n return target;\n }\n function sliceText(text, from, to) {\n return appendText(text, [\"\"], from, to);\n }\n class RawTextCursor {\n constructor(text, dir = 1) {\n this.dir = dir;\n this.done = false;\n this.lineBreak = false;\n this.value = \"\";\n this.nodes = [text];\n this.offsets = [dir > 0 ? 1 : (text instanceof TextLeaf ? text.text.length : text.children.length) << 1];\n }\n nextInner(skip, dir) {\n this.done = this.lineBreak = false;\n for (;;) {\n let last = this.nodes.length - 1;\n let top = this.nodes[last], offsetValue = this.offsets[last], offset = offsetValue >> 1;\n let size = top instanceof TextLeaf ? top.text.length : top.children.length;\n if (offset == (dir > 0 ? size : 0)) {\n if (last == 0) {\n this.done = true;\n this.value = \"\";\n return this;\n }\n if (dir > 0)\n this.offsets[last - 1]++;\n this.nodes.pop();\n this.offsets.pop();\n }\n else if ((offsetValue & 1) == (dir > 0 ? 0 : 1)) {\n this.offsets[last] += dir;\n if (skip == 0) {\n this.lineBreak = true;\n this.value = \"\\n\";\n return this;\n }\n skip--;\n }\n else if (top instanceof TextLeaf) {\n // Move to the next string\n let next = top.text[offset + (dir < 0 ? -1 : 0)];\n this.offsets[last] += dir;\n if (next.length > Math.max(0, skip)) {\n this.value = skip == 0 ? next : dir > 0 ? next.slice(skip) : next.slice(0, next.length - skip);\n return this;\n }\n skip -= next.length;\n }\n else {\n let next = top.children[offset + (dir < 0 ? -1 : 0)];\n if (skip > next.length) {\n skip -= next.length;\n this.offsets[last] += dir;\n }\n else {\n if (dir < 0)\n this.offsets[last]--;\n this.nodes.push(next);\n this.offsets.push(dir > 0 ? 1 : (next instanceof TextLeaf ? next.text.length : next.children.length) << 1);\n }\n }\n }\n }\n next(skip = 0) {\n if (skip < 0) {\n this.nextInner(-skip, (-this.dir));\n skip = this.value.length;\n }\n return this.nextInner(skip, this.dir);\n }\n }\n class PartialTextCursor {\n constructor(text, start, end) {\n this.value = \"\";\n this.done = false;\n this.cursor = new RawTextCursor(text, start > end ? -1 : 1);\n this.pos = start > end ? text.length : 0;\n this.from = Math.min(start, end);\n this.to = Math.max(start, end);\n }\n nextInner(skip, dir) {\n if (dir < 0 ? this.pos <= this.from : this.pos >= this.to) {\n this.value = \"\";\n this.done = true;\n return this;\n }\n skip += Math.max(0, dir < 0 ? this.pos - this.to : this.from - this.pos);\n let limit = dir < 0 ? this.pos - this.from : this.to - this.pos;\n if (skip > limit)\n skip = limit;\n limit -= skip;\n let { value } = this.cursor.next(skip);\n this.pos += (value.length + skip) * dir;\n this.value = value.length <= limit ? value : dir < 0 ? value.slice(value.length - limit) : value.slice(0, limit);\n this.done = !this.value;\n return this;\n }\n next(skip = 0) {\n if (skip < 0)\n skip = Math.max(skip, this.from - this.pos);\n else if (skip > 0)\n skip = Math.min(skip, this.to - this.pos);\n return this.nextInner(skip, this.cursor.dir);\n }\n get lineBreak() { return this.cursor.lineBreak && this.value != \"\"; }\n }\n class LineCursor {\n constructor(inner) {\n this.inner = inner;\n this.afterBreak = true;\n this.value = \"\";\n this.done = false;\n }\n next(skip = 0) {\n let { done, lineBreak, value } = this.inner.next(skip);\n if (done && this.afterBreak) {\n this.value = \"\";\n this.afterBreak = false;\n }\n else if (done) {\n this.done = true;\n this.value = \"\";\n }\n else if (lineBreak) {\n if (this.afterBreak) {\n this.value = \"\";\n }\n else {\n this.afterBreak = true;\n this.next();\n }\n }\n else {\n this.value = value;\n this.afterBreak = false;\n }\n return this;\n }\n get lineBreak() { return false; }\n }\n if (typeof Symbol != \"undefined\") {\n Text.prototype[Symbol.iterator] = function () { return this.iter(); };\n RawTextCursor.prototype[Symbol.iterator] = PartialTextCursor.prototype[Symbol.iterator] =\n LineCursor.prototype[Symbol.iterator] = function () { return this; };\n }\n /**\n This type describes a line in the document. It is created\n on-demand when lines are [queried](https://codemirror.net/6/docs/ref/#state.Text.lineAt).\n */\n class Line$1 {\n /**\n @internal\n */\n constructor(\n /**\n The position of the start of the line.\n */\n from, \n /**\n The position at the end of the line (_before_ the line break,\n or at the end of document for the last line).\n */\n to, \n /**\n This line's line number (1-based).\n */\n number, \n /**\n The line's content.\n */\n text) {\n this.from = from;\n this.to = to;\n this.number = number;\n this.text = text;\n }\n /**\n The length of the line (not including any line break after it).\n */\n get length() { return this.to - this.from; }\n }\n function clip(text, from, to) {\n from = Math.max(0, Math.min(text.length, from));\n return [from, Math.max(from, Math.min(text.length, to))];\n }\n\n // Compressed representation of the Grapheme_Cluster_Break=Extend\n // information from\n // http://www.unicode.org/Public/13.0.0/ucd/auxiliary/GraphemeBreakProperty.txt.\n // Each pair of elements represents a range, as an offet from the\n // previous range and a length. Numbers are in base-36, with the empty\n // string being a shorthand for 1.\n let extend = /*@__PURE__*/\"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,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o\".split(\",\").map(s => s ? parseInt(s, 36) : 1);\n // Convert offsets into absolute values\n for (let i = 1; i < extend.length; i++)\n extend[i] += extend[i - 1];\n function isExtendingChar(code) {\n for (let i = 1; i < extend.length; i += 2)\n if (extend[i] > code)\n return extend[i - 1] <= code;\n return false;\n }\n function isRegionalIndicator(code) {\n return code >= 0x1F1E6 && code <= 0x1F1FF;\n }\n const ZWJ = 0x200d;\n /**\n Returns a next grapheme cluster break _after_ (not equal to)\n `pos`, if `forward` is true, or before otherwise. Returns `pos`\n itself if no further cluster break is available in the string.\n Moves across surrogate pairs, extending characters (when\n `includeExtending` is true), characters joined with zero-width\n joiners, and flag emoji.\n */\n function findClusterBreak(str, pos, forward = true, includeExtending = true) {\n return (forward ? nextClusterBreak : prevClusterBreak)(str, pos, includeExtending);\n }\n function nextClusterBreak(str, pos, includeExtending) {\n if (pos == str.length)\n return pos;\n // If pos is in the middle of a surrogate pair, move to its start\n if (pos && surrogateLow(str.charCodeAt(pos)) && surrogateHigh(str.charCodeAt(pos - 1)))\n pos--;\n let prev = codePointAt(str, pos);\n pos += codePointSize(prev);\n while (pos < str.length) {\n let next = codePointAt(str, pos);\n if (prev == ZWJ || next == ZWJ || includeExtending && isExtendingChar(next)) {\n pos += codePointSize(next);\n prev = next;\n }\n else if (isRegionalIndicator(next)) {\n let countBefore = 0, i = pos - 2;\n while (i >= 0 && isRegionalIndicator(codePointAt(str, i))) {\n countBefore++;\n i -= 2;\n }\n if (countBefore % 2 == 0)\n break;\n else\n pos += 2;\n }\n else {\n break;\n }\n }\n return pos;\n }\n function prevClusterBreak(str, pos, includeExtending) {\n while (pos > 0) {\n let found = nextClusterBreak(str, pos - 2, includeExtending);\n if (found < pos)\n return found;\n pos--;\n }\n return 0;\n }\n function surrogateLow(ch) { return ch >= 0xDC00 && ch < 0xE000; }\n function surrogateHigh(ch) { return ch >= 0xD800 && ch < 0xDC00; }\n /**\n Find the code point at the given position in a string (like the\n [`codePointAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt)\n string method).\n */\n function codePointAt(str, pos) {\n let code0 = str.charCodeAt(pos);\n if (!surrogateHigh(code0) || pos + 1 == str.length)\n return code0;\n let code1 = str.charCodeAt(pos + 1);\n if (!surrogateLow(code1))\n return code0;\n return ((code0 - 0xd800) << 10) + (code1 - 0xdc00) + 0x10000;\n }\n /**\n Given a Unicode codepoint, return the JavaScript string that\n respresents it (like\n [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)).\n */\n function fromCodePoint(code) {\n if (code <= 0xffff)\n return String.fromCharCode(code);\n code -= 0x10000;\n return String.fromCharCode((code >> 10) + 0xd800, (code & 1023) + 0xdc00);\n }\n /**\n The amount of positions a character takes up a JavaScript string.\n */\n function codePointSize(code) { return code < 0x10000 ? 1 : 2; }\n\n const DefaultSplit = /\\r\\n?|\\n/;\n /**\n Distinguishes different ways in which positions can be mapped.\n */\n var MapMode = /*@__PURE__*/(function (MapMode) {\n /**\n Map a position to a valid new position, even when its context\n was deleted.\n */\n MapMode[MapMode[\"Simple\"] = 0] = \"Simple\";\n /**\n Return null if deletion happens across the position.\n */\n MapMode[MapMode[\"TrackDel\"] = 1] = \"TrackDel\";\n /**\n Return null if the character _before_ the position is deleted.\n */\n MapMode[MapMode[\"TrackBefore\"] = 2] = \"TrackBefore\";\n /**\n Return null if the character _after_ the position is deleted.\n */\n MapMode[MapMode[\"TrackAfter\"] = 3] = \"TrackAfter\";\n return MapMode})(MapMode || (MapMode = {}));\n /**\n A change description is a variant of [change set](https://codemirror.net/6/docs/ref/#state.ChangeSet)\n that doesn't store the inserted text. As such, it can't be\n applied, but is cheaper to store and manipulate.\n */\n class ChangeDesc {\n // Sections are encoded as pairs of integers. The first is the\n // length in the current document, and the second is -1 for\n // unaffected sections, and the length of the replacement content\n // otherwise. So an insertion would be (0, n>0), a deletion (n>0,\n // 0), and a replacement two positive numbers.\n /**\n @internal\n */\n constructor(\n /**\n @internal\n */\n sections) {\n this.sections = sections;\n }\n /**\n The length of the document before the change.\n */\n get length() {\n let result = 0;\n for (let i = 0; i < this.sections.length; i += 2)\n result += this.sections[i];\n return result;\n }\n /**\n The length of the document after the change.\n */\n get newLength() {\n let result = 0;\n for (let i = 0; i < this.sections.length; i += 2) {\n let ins = this.sections[i + 1];\n result += ins < 0 ? this.sections[i] : ins;\n }\n return result;\n }\n /**\n False when there are actual changes in this set.\n */\n get empty() { return this.sections.length == 0 || this.sections.length == 2 && this.sections[1] < 0; }\n /**\n Iterate over the unchanged parts left by these changes. `posA`\n provides the position of the range in the old document, `posB`\n the new position in the changed document.\n */\n iterGaps(f) {\n for (let i = 0, posA = 0, posB = 0; i < this.sections.length;) {\n let len = this.sections[i++], ins = this.sections[i++];\n if (ins < 0) {\n f(posA, posB, len);\n posB += len;\n }\n else {\n posB += ins;\n }\n posA += len;\n }\n }\n /**\n Iterate over the ranges changed by these changes. (See\n [`ChangeSet.iterChanges`](https://codemirror.net/6/docs/ref/#state.ChangeSet.iterChanges) for a\n variant that also provides you with the inserted text.)\n `fromA`/`toA` provides the extent of the change in the starting\n document, `fromB`/`toB` the extent of the replacement in the\n changed document.\n \n When `individual` is true, adjacent changes (which are kept\n separate for [position mapping](https://codemirror.net/6/docs/ref/#state.ChangeDesc.mapPos)) are\n reported separately.\n */\n iterChangedRanges(f, individual = false) {\n iterChanges(this, f, individual);\n }\n /**\n Get a description of the inverted form of these changes.\n */\n get invertedDesc() {\n let sections = [];\n for (let i = 0; i < this.sections.length;) {\n let len = this.sections[i++], ins = this.sections[i++];\n if (ins < 0)\n sections.push(len, ins);\n else\n sections.push(ins, len);\n }\n return new ChangeDesc(sections);\n }\n /**\n Compute the combined effect of applying another set of changes\n after this one. The length of the document after this set should\n match the length before `other`.\n */\n composeDesc(other) { return this.empty ? other : other.empty ? this : composeSets(this, other); }\n /**\n Map this description, which should start with the same document\n as `other`, over another set of changes, so that it can be\n applied after it. When `before` is true, map as if the changes\n in `other` happened before the ones in `this`.\n */\n mapDesc(other, before = false) { return other.empty ? this : mapSet(this, other, before); }\n mapPos(pos, assoc = -1, mode = MapMode.Simple) {\n let posA = 0, posB = 0;\n for (let i = 0; i < this.sections.length;) {\n let len = this.sections[i++], ins = this.sections[i++], endA = posA + len;\n if (ins < 0) {\n if (endA > pos)\n return posB + (pos - posA);\n posB += len;\n }\n else {\n if (mode != MapMode.Simple && endA >= pos &&\n (mode == MapMode.TrackDel && posA < pos && endA > pos ||\n mode == MapMode.TrackBefore && posA < pos ||\n mode == MapMode.TrackAfter && endA > pos))\n return null;\n if (endA > pos || endA == pos && assoc < 0 && !len)\n return pos == posA || assoc < 0 ? posB : posB + ins;\n posB += ins;\n }\n posA = endA;\n }\n if (pos > posA)\n throw new RangeError(`Position ${pos} is out of range for changeset of length ${posA}`);\n return posB;\n }\n /**\n Check whether these changes touch a given range. When one of the\n changes entirely covers the range, the string `\"cover\"` is\n returned.\n */\n touchesRange(from, to = from) {\n for (let i = 0, pos = 0; i < this.sections.length && pos <= to;) {\n let len = this.sections[i++], ins = this.sections[i++], end = pos + len;\n if (ins >= 0 && pos <= to && end >= from)\n return pos < from && end > to ? \"cover\" : true;\n pos = end;\n }\n return false;\n }\n /**\n @internal\n */\n toString() {\n let result = \"\";\n for (let i = 0; i < this.sections.length;) {\n let len = this.sections[i++], ins = this.sections[i++];\n result += (result ? \" \" : \"\") + len + (ins >= 0 ? \":\" + ins : \"\");\n }\n return result;\n }\n /**\n Serialize this change desc to a JSON-representable value.\n */\n toJSON() { return this.sections; }\n /**\n Create a change desc from its JSON representation (as produced\n by [`toJSON`](https://codemirror.net/6/docs/ref/#state.ChangeDesc.toJSON).\n */\n static fromJSON(json) {\n if (!Array.isArray(json) || json.length % 2 || json.some(a => typeof a != \"number\"))\n throw new RangeError(\"Invalid JSON representation of ChangeDesc\");\n return new ChangeDesc(json);\n }\n /**\n @internal\n */\n static create(sections) { return new ChangeDesc(sections); }\n }\n /**\n A change set represents a group of modifications to a document. It\n stores the document length, and can only be applied to documents\n with exactly that length.\n */\n class ChangeSet extends ChangeDesc {\n constructor(sections, \n /**\n @internal\n */\n inserted) {\n super(sections);\n this.inserted = inserted;\n }\n /**\n Apply the changes to a document, returning the modified\n document.\n */\n apply(doc) {\n if (this.length != doc.length)\n throw new RangeError(\"Applying change set to a document with the wrong length\");\n iterChanges(this, (fromA, toA, fromB, _toB, text) => doc = doc.replace(fromB, fromB + (toA - fromA), text), false);\n return doc;\n }\n mapDesc(other, before = false) { return mapSet(this, other, before, true); }\n /**\n Given the document as it existed _before_ the changes, return a\n change set that represents the inverse of this set, which could\n be used to go from the document created by the changes back to\n the document as it existed before the changes.\n */\n invert(doc) {\n let sections = this.sections.slice(), inserted = [];\n for (let i = 0, pos = 0; i < sections.length; i += 2) {\n let len = sections[i], ins = sections[i + 1];\n if (ins >= 0) {\n sections[i] = ins;\n sections[i + 1] = len;\n let index = i >> 1;\n while (inserted.length < index)\n inserted.push(Text.empty);\n inserted.push(len ? doc.slice(pos, pos + len) : Text.empty);\n }\n pos += len;\n }\n return new ChangeSet(sections, inserted);\n }\n /**\n Combine two subsequent change sets into a single set. `other`\n must start in the document produced by `this`. If `this` goes\n `docA` \u2192 `docB` and `other` represents `docB` \u2192 `docC`, the\n returned value will represent the change `docA` \u2192 `docC`.\n */\n compose(other) { return this.empty ? other : other.empty ? this : composeSets(this, other, true); }\n /**\n Given another change set starting in the same document, maps this\n change set over the other, producing a new change set that can be\n applied to the document produced by applying `other`. When\n `before` is `true`, order changes as if `this` comes before\n `other`, otherwise (the default) treat `other` as coming first.\n \n Given two changes `A` and `B`, `A.compose(B.map(A))` and\n `B.compose(A.map(B, true))` will produce the same document. This\n provides a basic form of [operational\n transformation](https://en.wikipedia.org/wiki/Operational_transformation),\n and can be used for collaborative editing.\n */\n map(other, before = false) { return other.empty ? this : mapSet(this, other, before, true); }\n /**\n Iterate over the changed ranges in the document, calling `f` for\n each, with the range in the original document (`fromA`-`toA`)\n and the range that replaces it in the new document\n (`fromB`-`toB`).\n \n When `individual` is true, adjacent changes are reported\n separately.\n */\n iterChanges(f, individual = false) {\n iterChanges(this, f, individual);\n }\n /**\n Get a [change description](https://codemirror.net/6/docs/ref/#state.ChangeDesc) for this change\n set.\n */\n get desc() { return ChangeDesc.create(this.sections); }\n /**\n @internal\n */\n filter(ranges) {\n let resultSections = [], resultInserted = [], filteredSections = [];\n let iter = new SectionIter(this);\n done: for (let i = 0, pos = 0;;) {\n let next = i == ranges.length ? 1e9 : ranges[i++];\n while (pos < next || pos == next && iter.len == 0) {\n if (iter.done)\n break done;\n let len = Math.min(iter.len, next - pos);\n addSection(filteredSections, len, -1);\n let ins = iter.ins == -1 ? -1 : iter.off == 0 ? iter.ins : 0;\n addSection(resultSections, len, ins);\n if (ins > 0)\n addInsert(resultInserted, resultSections, iter.text);\n iter.forward(len);\n pos += len;\n }\n let end = ranges[i++];\n while (pos < end) {\n if (iter.done)\n break done;\n let len = Math.min(iter.len, end - pos);\n addSection(resultSections, len, -1);\n addSection(filteredSections, len, iter.ins == -1 ? -1 : iter.off == 0 ? iter.ins : 0);\n iter.forward(len);\n pos += len;\n }\n }\n return { changes: new ChangeSet(resultSections, resultInserted),\n filtered: ChangeDesc.create(filteredSections) };\n }\n /**\n Serialize this change set to a JSON-representable value.\n */\n toJSON() {\n let parts = [];\n for (let i = 0; i < this.sections.length; i += 2) {\n let len = this.sections[i], ins = this.sections[i + 1];\n if (ins < 0)\n parts.push(len);\n else if (ins == 0)\n parts.push([len]);\n else\n parts.push([len].concat(this.inserted[i >> 1].toJSON()));\n }\n return parts;\n }\n /**\n Create a change set for the given changes, for a document of the\n given length, using `lineSep` as line separator.\n */\n static of(changes, length, lineSep) {\n let sections = [], inserted = [], pos = 0;\n let total = null;\n function flush(force = false) {\n if (!force && !sections.length)\n return;\n if (pos < length)\n addSection(sections, length - pos, -1);\n let set = new ChangeSet(sections, inserted);\n total = total ? total.compose(set.map(total)) : set;\n sections = [];\n inserted = [];\n pos = 0;\n }\n function process(spec) {\n if (Array.isArray(spec)) {\n for (let sub of spec)\n process(sub);\n }\n else if (spec instanceof ChangeSet) {\n if (spec.length != length)\n throw new RangeError(`Mismatched change set length (got ${spec.length}, expected ${length})`);\n flush();\n total = total ? total.compose(spec.map(total)) : spec;\n }\n else {\n let { from, to = from, insert } = spec;\n if (from > to || from < 0 || to > length)\n throw new RangeError(`Invalid change range ${from} to ${to} (in doc of length ${length})`);\n let insText = !insert ? Text.empty : typeof insert == \"string\" ? Text.of(insert.split(lineSep || DefaultSplit)) : insert;\n let insLen = insText.length;\n if (from == to && insLen == 0)\n return;\n if (from < pos)\n flush();\n if (from > pos)\n addSection(sections, from - pos, -1);\n addSection(sections, to - from, insLen);\n addInsert(inserted, sections, insText);\n pos = to;\n }\n }\n process(changes);\n flush(!total);\n return total;\n }\n /**\n Create an empty changeset of the given length.\n */\n static empty(length) {\n return new ChangeSet(length ? [length, -1] : [], []);\n }\n /**\n Create a changeset from its JSON representation (as produced by\n [`toJSON`](https://codemirror.net/6/docs/ref/#state.ChangeSet.toJSON).\n */\n static fromJSON(json) {\n if (!Array.isArray(json))\n throw new RangeError(\"Invalid JSON representation of ChangeSet\");\n let sections = [], inserted = [];\n for (let i = 0; i < json.length; i++) {\n let part = json[i];\n if (typeof part == \"number\") {\n sections.push(part, -1);\n }\n else if (!Array.isArray(part) || typeof part[0] != \"number\" || part.some((e, i) => i && typeof e != \"string\")) {\n throw new RangeError(\"Invalid JSON representation of ChangeSet\");\n }\n else if (part.length == 1) {\n sections.push(part[0], 0);\n }\n else {\n while (inserted.length < i)\n inserted.push(Text.empty);\n inserted[i] = Text.of(part.slice(1));\n sections.push(part[0], inserted[i].length);\n }\n }\n return new ChangeSet(sections, inserted);\n }\n /**\n @internal\n */\n static createSet(sections, inserted) {\n return new ChangeSet(sections, inserted);\n }\n }\n function addSection(sections, len, ins, forceJoin = false) {\n if (len == 0 && ins <= 0)\n return;\n let last = sections.length - 2;\n if (last >= 0 && ins <= 0 && ins == sections[last + 1])\n sections[last] += len;\n else if (len == 0 && sections[last] == 0)\n sections[last + 1] += ins;\n else if (forceJoin) {\n sections[last] += len;\n sections[last + 1] += ins;\n }\n else\n sections.push(len, ins);\n }\n function addInsert(values, sections, value) {\n if (value.length == 0)\n return;\n let index = (sections.length - 2) >> 1;\n if (index < values.length) {\n values[values.length - 1] = values[values.length - 1].append(value);\n }\n else {\n while (values.length < index)\n values.push(Text.empty);\n values.push(value);\n }\n }\n function iterChanges(desc, f, individual) {\n let inserted = desc.inserted;\n for (let posA = 0, posB = 0, i = 0; i < desc.sections.length;) {\n let len = desc.sections[i++], ins = desc.sections[i++];\n if (ins < 0) {\n posA += len;\n posB += len;\n }\n else {\n let endA = posA, endB = posB, text = Text.empty;\n for (;;) {\n endA += len;\n endB += ins;\n if (ins && inserted)\n text = text.append(inserted[(i - 2) >> 1]);\n if (individual || i == desc.sections.length || desc.sections[i + 1] < 0)\n break;\n len = desc.sections[i++];\n ins = desc.sections[i++];\n }\n f(posA, endA, posB, endB, text);\n posA = endA;\n posB = endB;\n }\n }\n }\n function mapSet(setA, setB, before, mkSet = false) {\n // Produce a copy of setA that applies to the document after setB\n // has been applied (assuming both start at the same document).\n let sections = [], insert = mkSet ? [] : null;\n let a = new SectionIter(setA), b = new SectionIter(setB);\n // Iterate over both sets in parallel. inserted tracks, for changes\n // in A that have to be processed piece-by-piece, whether their\n // content has been inserted already, and refers to the section\n // index.\n for (let inserted = -1;;) {\n if (a.ins == -1 && b.ins == -1) {\n // Move across ranges skipped by both sets.\n let len = Math.min(a.len, b.len);\n addSection(sections, len, -1);\n a.forward(len);\n b.forward(len);\n }\n else if (b.ins >= 0 && (a.ins < 0 || inserted == a.i || a.off == 0 && (b.len < a.len || b.len == a.len && !before))) {\n // If there's a change in B that comes before the next change in\n // A (ordered by start pos, then len, then before flag), skip\n // that (and process any changes in A it covers).\n let len = b.len;\n addSection(sections, b.ins, -1);\n while (len) {\n let piece = Math.min(a.len, len);\n if (a.ins >= 0 && inserted < a.i && a.len <= piece) {\n addSection(sections, 0, a.ins);\n if (insert)\n addInsert(insert, sections, a.text);\n inserted = a.i;\n }\n a.forward(piece);\n len -= piece;\n }\n b.next();\n }\n else if (a.ins >= 0) {\n // Process the part of a change in A up to the start of the next\n // non-deletion change in B (if overlapping).\n let len = 0, left = a.len;\n while (left) {\n if (b.ins == -1) {\n let piece = Math.min(left, b.len);\n len += piece;\n left -= piece;\n b.forward(piece);\n }\n else if (b.ins == 0 && b.len < left) {\n left -= b.len;\n b.next();\n }\n else {\n break;\n }\n }\n addSection(sections, len, inserted < a.i ? a.ins : 0);\n if (insert && inserted < a.i)\n addInsert(insert, sections, a.text);\n inserted = a.i;\n a.forward(a.len - left);\n }\n else if (a.done && b.done) {\n return insert ? ChangeSet.createSet(sections, insert) : ChangeDesc.create(sections);\n }\n else {\n throw new Error(\"Mismatched change set lengths\");\n }\n }\n }\n function composeSets(setA, setB, mkSet = false) {\n let sections = [];\n let insert = mkSet ? [] : null;\n let a = new SectionIter(setA), b = new SectionIter(setB);\n for (let open = false;;) {\n if (a.done && b.done) {\n return insert ? ChangeSet.createSet(sections, insert) : ChangeDesc.create(sections);\n }\n else if (a.ins == 0) { // Deletion in A\n addSection(sections, a.len, 0, open);\n a.next();\n }\n else if (b.len == 0 && !b.done) { // Insertion in B\n addSection(sections, 0, b.ins, open);\n if (insert)\n addInsert(insert, sections, b.text);\n b.next();\n }\n else if (a.done || b.done) {\n throw new Error(\"Mismatched change set lengths\");\n }\n else {\n let len = Math.min(a.len2, b.len), sectionLen = sections.length;\n if (a.ins == -1) {\n let insB = b.ins == -1 ? -1 : b.off ? 0 : b.ins;\n addSection(sections, len, insB, open);\n if (insert && insB)\n addInsert(insert, sections, b.text);\n }\n else if (b.ins == -1) {\n addSection(sections, a.off ? 0 : a.len, len, open);\n if (insert)\n addInsert(insert, sections, a.textBit(len));\n }\n else {\n addSection(sections, a.off ? 0 : a.len, b.off ? 0 : b.ins, open);\n if (insert && !b.off)\n addInsert(insert, sections, b.text);\n }\n open = (a.ins > len || b.ins >= 0 && b.len > len) && (open || sections.length > sectionLen);\n a.forward2(len);\n b.forward(len);\n }\n }\n }\n class SectionIter {\n constructor(set) {\n this.set = set;\n this.i = 0;\n this.next();\n }\n next() {\n let { sections } = this.set;\n if (this.i < sections.length) {\n this.len = sections[this.i++];\n this.ins = sections[this.i++];\n }\n else {\n this.len = 0;\n this.ins = -2;\n }\n this.off = 0;\n }\n get done() { return this.ins == -2; }\n get len2() { return this.ins < 0 ? this.len : this.ins; }\n get text() {\n let { inserted } = this.set, index = (this.i - 2) >> 1;\n return index >= inserted.length ? Text.empty : inserted[index];\n }\n textBit(len) {\n let { inserted } = this.set, index = (this.i - 2) >> 1;\n return index >= inserted.length && !len ? Text.empty\n : inserted[index].slice(this.off, len == null ? undefined : this.off + len);\n }\n forward(len) {\n if (len == this.len)\n this.next();\n else {\n this.len -= len;\n this.off += len;\n }\n }\n forward2(len) {\n if (this.ins == -1)\n this.forward(len);\n else if (len == this.ins)\n this.next();\n else {\n this.ins -= len;\n this.off += len;\n }\n }\n }\n\n /**\n A single selection range. When\n [`allowMultipleSelections`](https://codemirror.net/6/docs/ref/#state.EditorState^allowMultipleSelections)\n is enabled, a [selection](https://codemirror.net/6/docs/ref/#state.EditorSelection) may hold\n multiple ranges. By default, selections hold exactly one range.\n */\n class SelectionRange {\n constructor(\n /**\n The lower boundary of the range.\n */\n from, \n /**\n The upper boundary of the range.\n */\n to, flags) {\n this.from = from;\n this.to = to;\n this.flags = flags;\n }\n /**\n The anchor of the range\u2014the side that doesn't move when you\n extend it.\n */\n get anchor() { return this.flags & 32 /* RangeFlag.Inverted */ ? this.to : this.from; }\n /**\n The head of the range, which is moved when the range is\n [extended](https://codemirror.net/6/docs/ref/#state.SelectionRange.extend).\n */\n get head() { return this.flags & 32 /* RangeFlag.Inverted */ ? this.from : this.to; }\n /**\n True when `anchor` and `head` are at the same position.\n */\n get empty() { return this.from == this.to; }\n /**\n If this is a cursor that is explicitly associated with the\n character on one of its sides, this returns the side. -1 means\n the character before its position, 1 the character after, and 0\n means no association.\n */\n get assoc() { return this.flags & 8 /* RangeFlag.AssocBefore */ ? -1 : this.flags & 16 /* RangeFlag.AssocAfter */ ? 1 : 0; }\n /**\n The bidirectional text level associated with this cursor, if\n any.\n */\n get bidiLevel() {\n let level = this.flags & 7 /* RangeFlag.BidiLevelMask */;\n return level == 7 ? null : level;\n }\n /**\n The goal column (stored vertical offset) associated with a\n cursor. This is used to preserve the vertical position when\n [moving](https://codemirror.net/6/docs/ref/#view.EditorView.moveVertically) across\n lines of different length.\n */\n get goalColumn() {\n let value = this.flags >> 6 /* RangeFlag.GoalColumnOffset */;\n return value == 16777215 /* RangeFlag.NoGoalColumn */ ? undefined : value;\n }\n /**\n Map this range through a change, producing a valid range in the\n updated document.\n */\n map(change, assoc = -1) {\n let from, to;\n if (this.empty) {\n from = to = change.mapPos(this.from, assoc);\n }\n else {\n from = change.mapPos(this.from, 1);\n to = change.mapPos(this.to, -1);\n }\n return from == this.from && to == this.to ? this : new SelectionRange(from, to, this.flags);\n }\n /**\n Extend this range to cover at least `from` to `to`.\n */\n extend(from, to = from) {\n if (from <= this.anchor && to >= this.anchor)\n return EditorSelection.range(from, to);\n let head = Math.abs(from - this.anchor) > Math.abs(to - this.anchor) ? from : to;\n return EditorSelection.range(this.anchor, head);\n }\n /**\n Compare this range to another range.\n */\n eq(other, includeAssoc = false) {\n return this.anchor == other.anchor && this.head == other.head &&\n (!includeAssoc || !this.empty || this.assoc == other.assoc);\n }\n /**\n Return a JSON-serializable object representing the range.\n */\n toJSON() { return { anchor: this.anchor, head: this.head }; }\n /**\n Convert a JSON representation of a range to a `SelectionRange`\n instance.\n */\n static fromJSON(json) {\n if (!json || typeof json.anchor != \"number\" || typeof json.head != \"number\")\n throw new RangeError(\"Invalid JSON representation for SelectionRange\");\n return EditorSelection.range(json.anchor, json.head);\n }\n /**\n @internal\n */\n static create(from, to, flags) {\n return new SelectionRange(from, to, flags);\n }\n }\n /**\n An editor selection holds one or more selection ranges.\n */\n class EditorSelection {\n constructor(\n /**\n The ranges in the selection, sorted by position. Ranges cannot\n overlap (but they may touch, if they aren't empty).\n */\n ranges, \n /**\n The index of the _main_ range in the selection (which is\n usually the range that was added last).\n */\n mainIndex) {\n this.ranges = ranges;\n this.mainIndex = mainIndex;\n }\n /**\n Map a selection through a change. Used to adjust the selection\n position for changes.\n */\n map(change, assoc = -1) {\n if (change.empty)\n return this;\n return EditorSelection.create(this.ranges.map(r => r.map(change, assoc)), this.mainIndex);\n }\n /**\n Compare this selection to another selection. By default, ranges\n are compared only by position. When `includeAssoc` is true,\n cursor ranges must also have the same\n [`assoc`](https://codemirror.net/6/docs/ref/#state.SelectionRange.assoc) value.\n */\n eq(other, includeAssoc = false) {\n if (this.ranges.length != other.ranges.length ||\n this.mainIndex != other.mainIndex)\n return false;\n for (let i = 0; i < this.ranges.length; i++)\n if (!this.ranges[i].eq(other.ranges[i], includeAssoc))\n return false;\n return true;\n }\n /**\n Get the primary selection range. Usually, you should make sure\n your code applies to _all_ ranges, by using methods like\n [`changeByRange`](https://codemirror.net/6/docs/ref/#state.EditorState.changeByRange).\n */\n get main() { return this.ranges[this.mainIndex]; }\n /**\n Make sure the selection only has one range. Returns a selection\n holding only the main range from this selection.\n */\n asSingle() {\n return this.ranges.length == 1 ? this : new EditorSelection([this.main], 0);\n }\n /**\n Extend this selection with an extra range.\n */\n addRange(range, main = true) {\n return EditorSelection.create([range].concat(this.ranges), main ? 0 : this.mainIndex + 1);\n }\n /**\n Replace a given range with another range, and then normalize the\n selection to merge and sort ranges if necessary.\n */\n replaceRange(range, which = this.mainIndex) {\n let ranges = this.ranges.slice();\n ranges[which] = range;\n return EditorSelection.create(ranges, this.mainIndex);\n }\n /**\n Convert this selection to an object that can be serialized to\n JSON.\n */\n toJSON() {\n return { ranges: this.ranges.map(r => r.toJSON()), main: this.mainIndex };\n }\n /**\n Create a selection from a JSON representation.\n */\n static fromJSON(json) {\n if (!json || !Array.isArray(json.ranges) || typeof json.main != \"number\" || json.main >= json.ranges.length)\n throw new RangeError(\"Invalid JSON representation for EditorSelection\");\n return new EditorSelection(json.ranges.map((r) => SelectionRange.fromJSON(r)), json.main);\n }\n /**\n Create a selection holding a single range.\n */\n static single(anchor, head = anchor) {\n return new EditorSelection([EditorSelection.range(anchor, head)], 0);\n }\n /**\n Sort and merge the given set of ranges, creating a valid\n selection.\n */\n static create(ranges, mainIndex = 0) {\n if (ranges.length == 0)\n throw new RangeError(\"A selection needs at least one range\");\n for (let pos = 0, i = 0; i < ranges.length; i++) {\n let range = ranges[i];\n if (range.empty ? range.from <= pos : range.from < pos)\n return EditorSelection.normalized(ranges.slice(), mainIndex);\n pos = range.to;\n }\n return new EditorSelection(ranges, mainIndex);\n }\n /**\n Create a cursor selection range at the given position. You can\n safely ignore the optional arguments in most situations.\n */\n static cursor(pos, assoc = 0, bidiLevel, goalColumn) {\n return SelectionRange.create(pos, pos, (assoc == 0 ? 0 : assoc < 0 ? 8 /* RangeFlag.AssocBefore */ : 16 /* RangeFlag.AssocAfter */) |\n (bidiLevel == null ? 7 : Math.min(6, bidiLevel)) |\n ((goalColumn !== null && goalColumn !== void 0 ? goalColumn : 16777215 /* RangeFlag.NoGoalColumn */) << 6 /* RangeFlag.GoalColumnOffset */));\n }\n /**\n Create a selection range.\n */\n static range(anchor, head, goalColumn, bidiLevel) {\n let flags = ((goalColumn !== null && goalColumn !== void 0 ? goalColumn : 16777215 /* RangeFlag.NoGoalColumn */) << 6 /* RangeFlag.GoalColumnOffset */) |\n (bidiLevel == null ? 7 : Math.min(6, bidiLevel));\n return head < anchor ? SelectionRange.create(head, anchor, 32 /* RangeFlag.Inverted */ | 16 /* RangeFlag.AssocAfter */ | flags)\n : SelectionRange.create(anchor, head, (head > anchor ? 8 /* RangeFlag.AssocBefore */ : 0) | flags);\n }\n /**\n @internal\n */\n static normalized(ranges, mainIndex = 0) {\n let main = ranges[mainIndex];\n ranges.sort((a, b) => a.from - b.from);\n mainIndex = ranges.indexOf(main);\n for (let i = 1; i < ranges.length; i++) {\n let range = ranges[i], prev = ranges[i - 1];\n if (range.empty ? range.from <= prev.to : range.from < prev.to) {\n let from = prev.from, to = Math.max(range.to, prev.to);\n if (i <= mainIndex)\n mainIndex--;\n ranges.splice(--i, 2, range.anchor > range.head ? EditorSelection.range(to, from) : EditorSelection.range(from, to));\n }\n }\n return new EditorSelection(ranges, mainIndex);\n }\n }\n function checkSelection(selection, docLength) {\n for (let range of selection.ranges)\n if (range.to > docLength)\n throw new RangeError(\"Selection points outside of document\");\n }\n\n let nextID = 0;\n /**\n A facet is a labeled value that is associated with an editor\n state. It takes inputs from any number of extensions, and combines\n those into a single output value.\n\n Examples of uses of facets are the [tab\n size](https://codemirror.net/6/docs/ref/#state.EditorState^tabSize), [editor\n attributes](https://codemirror.net/6/docs/ref/#view.EditorView^editorAttributes), and [update\n listeners](https://codemirror.net/6/docs/ref/#view.EditorView^updateListener).\n\n Note that `Facet` instances can be used anywhere where\n [`FacetReader`](https://codemirror.net/6/docs/ref/#state.FacetReader) is expected.\n */\n class Facet {\n constructor(\n /**\n @internal\n */\n combine, \n /**\n @internal\n */\n compareInput, \n /**\n @internal\n */\n compare, isStatic, enables) {\n this.combine = combine;\n this.compareInput = compareInput;\n this.compare = compare;\n this.isStatic = isStatic;\n /**\n @internal\n */\n this.id = nextID++;\n this.default = combine([]);\n this.extensions = typeof enables == \"function\" ? enables(this) : enables;\n }\n /**\n Returns a facet reader for this facet, which can be used to\n [read](https://codemirror.net/6/docs/ref/#state.EditorState.facet) it but not to define values for it.\n */\n get reader() { return this; }\n /**\n Define a new facet.\n */\n static define(config = {}) {\n return new Facet(config.combine || ((a) => a), config.compareInput || ((a, b) => a === b), config.compare || (!config.combine ? sameArray$1 : (a, b) => a === b), !!config.static, config.enables);\n }\n /**\n Returns an extension that adds the given value to this facet.\n */\n of(value) {\n return new FacetProvider([], this, 0 /* Provider.Static */, value);\n }\n /**\n Create an extension that computes a value for the facet from a\n state. You must take care to declare the parts of the state that\n this value depends on, since your function is only called again\n for a new state when one of those parts changed.\n \n In cases where your value depends only on a single field, you'll\n want to use the [`from`](https://codemirror.net/6/docs/ref/#state.Facet.from) method instead.\n */\n compute(deps, get) {\n if (this.isStatic)\n throw new Error(\"Can't compute a static facet\");\n return new FacetProvider(deps, this, 1 /* Provider.Single */, get);\n }\n /**\n Create an extension that computes zero or more values for this\n facet from a state.\n */\n computeN(deps, get) {\n if (this.isStatic)\n throw new Error(\"Can't compute a static facet\");\n return new FacetProvider(deps, this, 2 /* Provider.Multi */, get);\n }\n from(field, get) {\n if (!get)\n get = x => x;\n return this.compute([field], state => get(state.field(field)));\n }\n }\n function sameArray$1(a, b) {\n return a == b || a.length == b.length && a.every((e, i) => e === b[i]);\n }\n class FacetProvider {\n constructor(dependencies, facet, type, value) {\n this.dependencies = dependencies;\n this.facet = facet;\n this.type = type;\n this.value = value;\n this.id = nextID++;\n }\n dynamicSlot(addresses) {\n var _a;\n let getter = this.value;\n let compare = this.facet.compareInput;\n let id = this.id, idx = addresses[id] >> 1, multi = this.type == 2 /* Provider.Multi */;\n let depDoc = false, depSel = false, depAddrs = [];\n for (let dep of this.dependencies) {\n if (dep == \"doc\")\n depDoc = true;\n else if (dep == \"selection\")\n depSel = true;\n else if ((((_a = addresses[dep.id]) !== null && _a !== void 0 ? _a : 1) & 1) == 0)\n depAddrs.push(addresses[dep.id]);\n }\n return {\n create(state) {\n state.values[idx] = getter(state);\n return 1 /* SlotStatus.Changed */;\n },\n update(state, tr) {\n if ((depDoc && tr.docChanged) || (depSel && (tr.docChanged || tr.selection)) || ensureAll(state, depAddrs)) {\n let newVal = getter(state);\n if (multi ? !compareArray(newVal, state.values[idx], compare) : !compare(newVal, state.values[idx])) {\n state.values[idx] = newVal;\n return 1 /* SlotStatus.Changed */;\n }\n }\n return 0;\n },\n reconfigure: (state, oldState) => {\n let newVal, oldAddr = oldState.config.address[id];\n if (oldAddr != null) {\n let oldVal = getAddr(oldState, oldAddr);\n if (this.dependencies.every(dep => {\n return dep instanceof Facet ? oldState.facet(dep) === state.facet(dep) :\n dep instanceof StateField ? oldState.field(dep, false) == state.field(dep, false) : true;\n }) || (multi ? compareArray(newVal = getter(state), oldVal, compare) : compare(newVal = getter(state), oldVal))) {\n state.values[idx] = oldVal;\n return 0;\n }\n }\n else {\n newVal = getter(state);\n }\n state.values[idx] = newVal;\n return 1 /* SlotStatus.Changed */;\n }\n };\n }\n }\n function compareArray(a, b, compare) {\n if (a.length != b.length)\n return false;\n for (let i = 0; i < a.length; i++)\n if (!compare(a[i], b[i]))\n return false;\n return true;\n }\n function ensureAll(state, addrs) {\n let changed = false;\n for (let addr of addrs)\n if (ensureAddr(state, addr) & 1 /* SlotStatus.Changed */)\n changed = true;\n return changed;\n }\n function dynamicFacetSlot(addresses, facet, providers) {\n let providerAddrs = providers.map(p => addresses[p.id]);\n let providerTypes = providers.map(p => p.type);\n let dynamic = providerAddrs.filter(p => !(p & 1));\n let idx = addresses[facet.id] >> 1;\n function get(state) {\n let values = [];\n for (let i = 0; i < providerAddrs.length; i++) {\n let value = getAddr(state, providerAddrs[i]);\n if (providerTypes[i] == 2 /* Provider.Multi */)\n for (let val of value)\n values.push(val);\n else\n values.push(value);\n }\n return facet.combine(values);\n }\n return {\n create(state) {\n for (let addr of providerAddrs)\n ensureAddr(state, addr);\n state.values[idx] = get(state);\n return 1 /* SlotStatus.Changed */;\n },\n update(state, tr) {\n if (!ensureAll(state, dynamic))\n return 0;\n let value = get(state);\n if (facet.compare(value, state.values[idx]))\n return 0;\n state.values[idx] = value;\n return 1 /* SlotStatus.Changed */;\n },\n reconfigure(state, oldState) {\n let depChanged = ensureAll(state, providerAddrs);\n let oldProviders = oldState.config.facets[facet.id], oldValue = oldState.facet(facet);\n if (oldProviders && !depChanged && sameArray$1(providers, oldProviders)) {\n state.values[idx] = oldValue;\n return 0;\n }\n let value = get(state);\n if (facet.compare(value, oldValue)) {\n state.values[idx] = oldValue;\n return 0;\n }\n state.values[idx] = value;\n return 1 /* SlotStatus.Changed */;\n }\n };\n }\n const initField = /*@__PURE__*/Facet.define({ static: true });\n /**\n Fields can store additional information in an editor state, and\n keep it in sync with the rest of the state.\n */\n class StateField {\n constructor(\n /**\n @internal\n */\n id, createF, updateF, compareF, \n /**\n @internal\n */\n spec) {\n this.id = id;\n this.createF = createF;\n this.updateF = updateF;\n this.compareF = compareF;\n this.spec = spec;\n /**\n @internal\n */\n this.provides = undefined;\n }\n /**\n Define a state field.\n */\n static define(config) {\n let field = new StateField(nextID++, config.create, config.update, config.compare || ((a, b) => a === b), config);\n if (config.provide)\n field.provides = config.provide(field);\n return field;\n }\n create(state) {\n let init = state.facet(initField).find(i => i.field == this);\n return ((init === null || init === void 0 ? void 0 : init.create) || this.createF)(state);\n }\n /**\n @internal\n */\n slot(addresses) {\n let idx = addresses[this.id] >> 1;\n return {\n create: (state) => {\n state.values[idx] = this.create(state);\n return 1 /* SlotStatus.Changed */;\n },\n update: (state, tr) => {\n let oldVal = state.values[idx];\n let value = this.updateF(oldVal, tr);\n if (this.compareF(oldVal, value))\n return 0;\n state.values[idx] = value;\n return 1 /* SlotStatus.Changed */;\n },\n reconfigure: (state, oldState) => {\n if (oldState.config.address[this.id] != null) {\n state.values[idx] = oldState.field(this);\n return 0;\n }\n state.values[idx] = this.create(state);\n return 1 /* SlotStatus.Changed */;\n }\n };\n }\n /**\n Returns an extension that enables this field and overrides the\n way it is initialized. Can be useful when you need to provide a\n non-default starting value for the field.\n */\n init(create) {\n return [this, initField.of({ field: this, create })];\n }\n /**\n State field instances can be used as\n [`Extension`](https://codemirror.net/6/docs/ref/#state.Extension) values to enable the field in a\n given state.\n */\n get extension() { return this; }\n }\n const Prec_ = { lowest: 4, low: 3, default: 2, high: 1, highest: 0 };\n function prec(value) {\n return (ext) => new PrecExtension(ext, value);\n }\n /**\n By default extensions are registered in the order they are found\n in the flattened form of nested array that was provided.\n Individual extension values can be assigned a precedence to\n override this. Extensions that do not have a precedence set get\n the precedence of the nearest parent with a precedence, or\n [`default`](https://codemirror.net/6/docs/ref/#state.Prec.default) if there is no such parent. The\n final ordering of extensions is determined by first sorting by\n precedence and then by order within each precedence.\n */\n const Prec = {\n /**\n The highest precedence level, for extensions that should end up\n near the start of the precedence ordering.\n */\n highest: /*@__PURE__*/prec(Prec_.highest),\n /**\n A higher-than-default precedence, for extensions that should\n come before those with default precedence.\n */\n high: /*@__PURE__*/prec(Prec_.high),\n /**\n The default precedence, which is also used for extensions\n without an explicit precedence.\n */\n default: /*@__PURE__*/prec(Prec_.default),\n /**\n A lower-than-default precedence.\n */\n low: /*@__PURE__*/prec(Prec_.low),\n /**\n The lowest precedence level. Meant for things that should end up\n near the end of the extension order.\n */\n lowest: /*@__PURE__*/prec(Prec_.lowest)\n };\n class PrecExtension {\n constructor(inner, prec) {\n this.inner = inner;\n this.prec = prec;\n }\n }\n /**\n Extension compartments can be used to make a configuration\n dynamic. By [wrapping](https://codemirror.net/6/docs/ref/#state.Compartment.of) part of your\n configuration in a compartment, you can later\n [replace](https://codemirror.net/6/docs/ref/#state.Compartment.reconfigure) that part through a\n transaction.\n */\n class Compartment {\n /**\n Create an instance of this compartment to add to your [state\n configuration](https://codemirror.net/6/docs/ref/#state.EditorStateConfig.extensions).\n */\n of(ext) { return new CompartmentInstance(this, ext); }\n /**\n Create an [effect](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) that\n reconfigures this compartment.\n */\n reconfigure(content) {\n return Compartment.reconfigure.of({ compartment: this, extension: content });\n }\n /**\n Get the current content of the compartment in the state, or\n `undefined` if it isn't present.\n */\n get(state) {\n return state.config.compartments.get(this);\n }\n }\n class CompartmentInstance {\n constructor(compartment, inner) {\n this.compartment = compartment;\n this.inner = inner;\n }\n }\n class Configuration {\n constructor(base, compartments, dynamicSlots, address, staticValues, facets) {\n this.base = base;\n this.compartments = compartments;\n this.dynamicSlots = dynamicSlots;\n this.address = address;\n this.staticValues = staticValues;\n this.facets = facets;\n this.statusTemplate = [];\n while (this.statusTemplate.length < dynamicSlots.length)\n this.statusTemplate.push(0 /* SlotStatus.Unresolved */);\n }\n staticFacet(facet) {\n let addr = this.address[facet.id];\n return addr == null ? facet.default : this.staticValues[addr >> 1];\n }\n static resolve(base, compartments, oldState) {\n let fields = [];\n let facets = Object.create(null);\n let newCompartments = new Map();\n for (let ext of flatten(base, compartments, newCompartments)) {\n if (ext instanceof StateField)\n fields.push(ext);\n else\n (facets[ext.facet.id] || (facets[ext.facet.id] = [])).push(ext);\n }\n let address = Object.create(null);\n let staticValues = [];\n let dynamicSlots = [];\n for (let field of fields) {\n address[field.id] = dynamicSlots.length << 1;\n dynamicSlots.push(a => field.slot(a));\n }\n let oldFacets = oldState === null || oldState === void 0 ? void 0 : oldState.config.facets;\n for (let id in facets) {\n let providers = facets[id], facet = providers[0].facet;\n let oldProviders = oldFacets && oldFacets[id] || [];\n if (providers.every(p => p.type == 0 /* Provider.Static */)) {\n address[facet.id] = (staticValues.length << 1) | 1;\n if (sameArray$1(oldProviders, providers)) {\n staticValues.push(oldState.facet(facet));\n }\n else {\n let value = facet.combine(providers.map(p => p.value));\n staticValues.push(oldState && facet.compare(value, oldState.facet(facet)) ? oldState.facet(facet) : value);\n }\n }\n else {\n for (let p of providers) {\n if (p.type == 0 /* Provider.Static */) {\n address[p.id] = (staticValues.length << 1) | 1;\n staticValues.push(p.value);\n }\n else {\n address[p.id] = dynamicSlots.length << 1;\n dynamicSlots.push(a => p.dynamicSlot(a));\n }\n }\n address[facet.id] = dynamicSlots.length << 1;\n dynamicSlots.push(a => dynamicFacetSlot(a, facet, providers));\n }\n }\n let dynamic = dynamicSlots.map(f => f(address));\n return new Configuration(base, newCompartments, dynamic, address, staticValues, facets);\n }\n }\n function flatten(extension, compartments, newCompartments) {\n let result = [[], [], [], [], []];\n let seen = new Map();\n function inner(ext, prec) {\n let known = seen.get(ext);\n if (known != null) {\n if (known <= prec)\n return;\n let found = result[known].indexOf(ext);\n if (found > -1)\n result[known].splice(found, 1);\n if (ext instanceof CompartmentInstance)\n newCompartments.delete(ext.compartment);\n }\n seen.set(ext, prec);\n if (Array.isArray(ext)) {\n for (let e of ext)\n inner(e, prec);\n }\n else if (ext instanceof CompartmentInstance) {\n if (newCompartments.has(ext.compartment))\n throw new RangeError(`Duplicate use of compartment in extensions`);\n let content = compartments.get(ext.compartment) || ext.inner;\n newCompartments.set(ext.compartment, content);\n inner(content, prec);\n }\n else if (ext instanceof PrecExtension) {\n inner(ext.inner, ext.prec);\n }\n else if (ext instanceof StateField) {\n result[prec].push(ext);\n if (ext.provides)\n inner(ext.provides, prec);\n }\n else if (ext instanceof FacetProvider) {\n result[prec].push(ext);\n if (ext.facet.extensions)\n inner(ext.facet.extensions, Prec_.default);\n }\n else {\n let content = ext.extension;\n if (!content)\n throw new Error(`Unrecognized extension value in extension set (${ext}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);\n inner(content, prec);\n }\n }\n inner(extension, Prec_.default);\n return result.reduce((a, b) => a.concat(b));\n }\n function ensureAddr(state, addr) {\n if (addr & 1)\n return 2 /* SlotStatus.Computed */;\n let idx = addr >> 1;\n let status = state.status[idx];\n if (status == 4 /* SlotStatus.Computing */)\n throw new Error(\"Cyclic dependency between fields and/or facets\");\n if (status & 2 /* SlotStatus.Computed */)\n return status;\n state.status[idx] = 4 /* SlotStatus.Computing */;\n let changed = state.computeSlot(state, state.config.dynamicSlots[idx]);\n return state.status[idx] = 2 /* SlotStatus.Computed */ | changed;\n }\n function getAddr(state, addr) {\n return addr & 1 ? state.config.staticValues[addr >> 1] : state.values[addr >> 1];\n }\n\n const languageData = /*@__PURE__*/Facet.define();\n const allowMultipleSelections = /*@__PURE__*/Facet.define({\n combine: values => values.some(v => v),\n static: true\n });\n const lineSeparator = /*@__PURE__*/Facet.define({\n combine: values => values.length ? values[0] : undefined,\n static: true\n });\n const changeFilter = /*@__PURE__*/Facet.define();\n const transactionFilter = /*@__PURE__*/Facet.define();\n const transactionExtender = /*@__PURE__*/Facet.define();\n const readOnly = /*@__PURE__*/Facet.define({\n combine: values => values.length ? values[0] : false\n });\n\n /**\n Annotations are tagged values that are used to add metadata to\n transactions in an extensible way. They should be used to model\n things that effect the entire transaction (such as its [time\n stamp](https://codemirror.net/6/docs/ref/#state.Transaction^time) or information about its\n [origin](https://codemirror.net/6/docs/ref/#state.Transaction^userEvent)). For effects that happen\n _alongside_ the other changes made by the transaction, [state\n effects](https://codemirror.net/6/docs/ref/#state.StateEffect) are more appropriate.\n */\n class Annotation {\n /**\n @internal\n */\n constructor(\n /**\n The annotation type.\n */\n type, \n /**\n The value of this annotation.\n */\n value) {\n this.type = type;\n this.value = value;\n }\n /**\n Define a new type of annotation.\n */\n static define() { return new AnnotationType(); }\n }\n /**\n Marker that identifies a type of [annotation](https://codemirror.net/6/docs/ref/#state.Annotation).\n */\n class AnnotationType {\n /**\n Create an instance of this annotation.\n */\n of(value) { return new Annotation(this, value); }\n }\n /**\n Representation of a type of state effect. Defined with\n [`StateEffect.define`](https://codemirror.net/6/docs/ref/#state.StateEffect^define).\n */\n class StateEffectType {\n /**\n @internal\n */\n constructor(\n // The `any` types in these function types are there to work\n // around TypeScript issue #37631, where the type guard on\n // `StateEffect.is` mysteriously stops working when these properly\n // have type `Value`.\n /**\n @internal\n */\n map) {\n this.map = map;\n }\n /**\n Create a [state effect](https://codemirror.net/6/docs/ref/#state.StateEffect) instance of this\n type.\n */\n of(value) { return new StateEffect(this, value); }\n }\n /**\n State effects can be used to represent additional effects\n associated with a [transaction](https://codemirror.net/6/docs/ref/#state.Transaction.effects). They\n are often useful to model changes to custom [state\n fields](https://codemirror.net/6/docs/ref/#state.StateField), when those changes aren't implicit in\n document or selection changes.\n */\n class StateEffect {\n /**\n @internal\n */\n constructor(\n /**\n @internal\n */\n type, \n /**\n The value of this effect.\n */\n value) {\n this.type = type;\n this.value = value;\n }\n /**\n Map this effect through a position mapping. Will return\n `undefined` when that ends up deleting the effect.\n */\n map(mapping) {\n let mapped = this.type.map(this.value, mapping);\n return mapped === undefined ? undefined : mapped == this.value ? this : new StateEffect(this.type, mapped);\n }\n /**\n Tells you whether this effect object is of a given\n [type](https://codemirror.net/6/docs/ref/#state.StateEffectType).\n */\n is(type) { return this.type == type; }\n /**\n Define a new effect type. The type parameter indicates the type\n of values that his effect holds. It should be a type that\n doesn't include `undefined`, since that is used in\n [mapping](https://codemirror.net/6/docs/ref/#state.StateEffect.map) to indicate that an effect is\n removed.\n */\n static define(spec = {}) {\n return new StateEffectType(spec.map || (v => v));\n }\n /**\n Map an array of effects through a change set.\n */\n static mapEffects(effects, mapping) {\n if (!effects.length)\n return effects;\n let result = [];\n for (let effect of effects) {\n let mapped = effect.map(mapping);\n if (mapped)\n result.push(mapped);\n }\n return result;\n }\n }\n /**\n This effect can be used to reconfigure the root extensions of\n the editor. Doing this will discard any extensions\n [appended](https://codemirror.net/6/docs/ref/#state.StateEffect^appendConfig), but does not reset\n the content of [reconfigured](https://codemirror.net/6/docs/ref/#state.Compartment.reconfigure)\n compartments.\n */\n StateEffect.reconfigure = /*@__PURE__*/StateEffect.define();\n /**\n Append extensions to the top-level configuration of the editor.\n */\n StateEffect.appendConfig = /*@__PURE__*/StateEffect.define();\n /**\n Changes to the editor state are grouped into transactions.\n Typically, a user action creates a single transaction, which may\n contain any number of document changes, may change the selection,\n or have other effects. Create a transaction by calling\n [`EditorState.update`](https://codemirror.net/6/docs/ref/#state.EditorState.update), or immediately\n dispatch one by calling\n [`EditorView.dispatch`](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch).\n */\n class Transaction {\n constructor(\n /**\n The state from which the transaction starts.\n */\n startState, \n /**\n The document changes made by this transaction.\n */\n changes, \n /**\n The selection set by this transaction, or undefined if it\n doesn't explicitly set a selection.\n */\n selection, \n /**\n The effects added to the transaction.\n */\n effects, \n /**\n @internal\n */\n annotations, \n /**\n Whether the selection should be scrolled into view after this\n transaction is dispatched.\n */\n scrollIntoView) {\n this.startState = startState;\n this.changes = changes;\n this.selection = selection;\n this.effects = effects;\n this.annotations = annotations;\n this.scrollIntoView = scrollIntoView;\n /**\n @internal\n */\n this._doc = null;\n /**\n @internal\n */\n this._state = null;\n if (selection)\n checkSelection(selection, changes.newLength);\n if (!annotations.some((a) => a.type == Transaction.time))\n this.annotations = annotations.concat(Transaction.time.of(Date.now()));\n }\n /**\n @internal\n */\n static create(startState, changes, selection, effects, annotations, scrollIntoView) {\n return new Transaction(startState, changes, selection, effects, annotations, scrollIntoView);\n }\n /**\n The new document produced by the transaction. Contrary to\n [`.state`](https://codemirror.net/6/docs/ref/#state.Transaction.state)`.doc`, accessing this won't\n force the entire new state to be computed right away, so it is\n recommended that [transaction\n filters](https://codemirror.net/6/docs/ref/#state.EditorState^transactionFilter) use this getter\n when they need to look at the new document.\n */\n get newDoc() {\n return this._doc || (this._doc = this.changes.apply(this.startState.doc));\n }\n /**\n The new selection produced by the transaction. If\n [`this.selection`](https://codemirror.net/6/docs/ref/#state.Transaction.selection) is undefined,\n this will [map](https://codemirror.net/6/docs/ref/#state.EditorSelection.map) the start state's\n current selection through the changes made by the transaction.\n */\n get newSelection() {\n return this.selection || this.startState.selection.map(this.changes);\n }\n /**\n The new state created by the transaction. Computed on demand\n (but retained for subsequent access), so it is recommended not to\n access it in [transaction\n filters](https://codemirror.net/6/docs/ref/#state.EditorState^transactionFilter) when possible.\n */\n get state() {\n if (!this._state)\n this.startState.applyTransaction(this);\n return this._state;\n }\n /**\n Get the value of the given annotation type, if any.\n */\n annotation(type) {\n for (let ann of this.annotations)\n if (ann.type == type)\n return ann.value;\n return undefined;\n }\n /**\n Indicates whether the transaction changed the document.\n */\n get docChanged() { return !this.changes.empty; }\n /**\n Indicates whether this transaction reconfigures the state\n (through a [configuration compartment](https://codemirror.net/6/docs/ref/#state.Compartment) or\n with a top-level configuration\n [effect](https://codemirror.net/6/docs/ref/#state.StateEffect^reconfigure).\n */\n get reconfigured() { return this.startState.config != this.state.config; }\n /**\n Returns true if the transaction has a [user\n event](https://codemirror.net/6/docs/ref/#state.Transaction^userEvent) annotation that is equal to\n or more specific than `event`. For example, if the transaction\n has `\"select.pointer\"` as user event, `\"select\"` and\n `\"select.pointer\"` will match it.\n */\n isUserEvent(event) {\n let e = this.annotation(Transaction.userEvent);\n return !!(e && (e == event || e.length > event.length && e.slice(0, event.length) == event && e[event.length] == \".\"));\n }\n }\n /**\n Annotation used to store transaction timestamps. Automatically\n added to every transaction, holding `Date.now()`.\n */\n Transaction.time = /*@__PURE__*/Annotation.define();\n /**\n Annotation used to associate a transaction with a user interface\n event. Holds a string identifying the event, using a\n dot-separated format to support attaching more specific\n information. The events used by the core libraries are:\n\n - `\"input\"` when content is entered\n - `\"input.type\"` for typed input\n - `\"input.type.compose\"` for composition\n - `\"input.paste\"` for pasted input\n - `\"input.drop\"` when adding content with drag-and-drop\n - `\"input.complete\"` when autocompleting\n - `\"delete\"` when the user deletes content\n - `\"delete.selection\"` when deleting the selection\n - `\"delete.forward\"` when deleting forward from the selection\n - `\"delete.backward\"` when deleting backward from the selection\n - `\"delete.cut\"` when cutting to the clipboard\n - `\"move\"` when content is moved\n - `\"move.drop\"` when content is moved within the editor through drag-and-drop\n - `\"select\"` when explicitly changing the selection\n - `\"select.pointer\"` when selecting with a mouse or other pointing device\n - `\"undo\"` and `\"redo\"` for history actions\n\n Use [`isUserEvent`](https://codemirror.net/6/docs/ref/#state.Transaction.isUserEvent) to check\n whether the annotation matches a given event.\n */\n Transaction.userEvent = /*@__PURE__*/Annotation.define();\n /**\n Annotation indicating whether a transaction should be added to\n the undo history or not.\n */\n Transaction.addToHistory = /*@__PURE__*/Annotation.define();\n /**\n Annotation indicating (when present and true) that a transaction\n represents a change made by some other actor, not the user. This\n is used, for example, to tag other people's changes in\n collaborative editing.\n */\n Transaction.remote = /*@__PURE__*/Annotation.define();\n function joinRanges(a, b) {\n let result = [];\n for (let iA = 0, iB = 0;;) {\n let from, to;\n if (iA < a.length && (iB == b.length || b[iB] >= a[iA])) {\n from = a[iA++];\n to = a[iA++];\n }\n else if (iB < b.length) {\n from = b[iB++];\n to = b[iB++];\n }\n else\n return result;\n if (!result.length || result[result.length - 1] < from)\n result.push(from, to);\n else if (result[result.length - 1] < to)\n result[result.length - 1] = to;\n }\n }\n function mergeTransaction(a, b, sequential) {\n var _a;\n let mapForA, mapForB, changes;\n if (sequential) {\n mapForA = b.changes;\n mapForB = ChangeSet.empty(b.changes.length);\n changes = a.changes.compose(b.changes);\n }\n else {\n mapForA = b.changes.map(a.changes);\n mapForB = a.changes.mapDesc(b.changes, true);\n changes = a.changes.compose(mapForA);\n }\n return {\n changes,\n selection: b.selection ? b.selection.map(mapForB) : (_a = a.selection) === null || _a === void 0 ? void 0 : _a.map(mapForA),\n effects: StateEffect.mapEffects(a.effects, mapForA).concat(StateEffect.mapEffects(b.effects, mapForB)),\n annotations: a.annotations.length ? a.annotations.concat(b.annotations) : b.annotations,\n scrollIntoView: a.scrollIntoView || b.scrollIntoView\n };\n }\n function resolveTransactionInner(state, spec, docSize) {\n let sel = spec.selection, annotations = asArray$1(spec.annotations);\n if (spec.userEvent)\n annotations = annotations.concat(Transaction.userEvent.of(spec.userEvent));\n return {\n changes: spec.changes instanceof ChangeSet ? spec.changes\n : ChangeSet.of(spec.changes || [], docSize, state.facet(lineSeparator)),\n selection: sel && (sel instanceof EditorSelection ? sel : EditorSelection.single(sel.anchor, sel.head)),\n effects: asArray$1(spec.effects),\n annotations,\n scrollIntoView: !!spec.scrollIntoView\n };\n }\n function resolveTransaction(state, specs, filter) {\n let s = resolveTransactionInner(state, specs.length ? specs[0] : {}, state.doc.length);\n if (specs.length && specs[0].filter === false)\n filter = false;\n for (let i = 1; i < specs.length; i++) {\n if (specs[i].filter === false)\n filter = false;\n let seq = !!specs[i].sequential;\n s = mergeTransaction(s, resolveTransactionInner(state, specs[i], seq ? s.changes.newLength : state.doc.length), seq);\n }\n let tr = Transaction.create(state, s.changes, s.selection, s.effects, s.annotations, s.scrollIntoView);\n return extendTransaction(filter ? filterTransaction(tr) : tr);\n }\n // Finish a transaction by applying filters if necessary.\n function filterTransaction(tr) {\n let state = tr.startState;\n // Change filters\n let result = true;\n for (let filter of state.facet(changeFilter)) {\n let value = filter(tr);\n if (value === false) {\n result = false;\n break;\n }\n if (Array.isArray(value))\n result = result === true ? value : joinRanges(result, value);\n }\n if (result !== true) {\n let changes, back;\n if (result === false) {\n back = tr.changes.invertedDesc;\n changes = ChangeSet.empty(state.doc.length);\n }\n else {\n let filtered = tr.changes.filter(result);\n changes = filtered.changes;\n back = filtered.filtered.mapDesc(filtered.changes).invertedDesc;\n }\n tr = Transaction.create(state, changes, tr.selection && tr.selection.map(back), StateEffect.mapEffects(tr.effects, back), tr.annotations, tr.scrollIntoView);\n }\n // Transaction filters\n let filters = state.facet(transactionFilter);\n for (let i = filters.length - 1; i >= 0; i--) {\n let filtered = filters[i](tr);\n if (filtered instanceof Transaction)\n tr = filtered;\n else if (Array.isArray(filtered) && filtered.length == 1 && filtered[0] instanceof Transaction)\n tr = filtered[0];\n else\n tr = resolveTransaction(state, asArray$1(filtered), false);\n }\n return tr;\n }\n function extendTransaction(tr) {\n let state = tr.startState, extenders = state.facet(transactionExtender), spec = tr;\n for (let i = extenders.length - 1; i >= 0; i--) {\n let extension = extenders[i](tr);\n if (extension && Object.keys(extension).length)\n spec = mergeTransaction(spec, resolveTransactionInner(state, extension, tr.changes.newLength), true);\n }\n return spec == tr ? tr : Transaction.create(state, tr.changes, tr.selection, spec.effects, spec.annotations, spec.scrollIntoView);\n }\n const none$3 = [];\n function asArray$1(value) {\n return value == null ? none$3 : Array.isArray(value) ? value : [value];\n }\n\n /**\n The categories produced by a [character\n categorizer](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer). These are used\n do things like selecting by word.\n */\n var CharCategory = /*@__PURE__*/(function (CharCategory) {\n /**\n Word characters.\n */\n CharCategory[CharCategory[\"Word\"] = 0] = \"Word\";\n /**\n Whitespace.\n */\n CharCategory[CharCategory[\"Space\"] = 1] = \"Space\";\n /**\n Anything else.\n */\n CharCategory[CharCategory[\"Other\"] = 2] = \"Other\";\n return CharCategory})(CharCategory || (CharCategory = {}));\n const nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n let wordChar;\n try {\n wordChar = /*@__PURE__*/new RegExp(\"[\\\\p{Alphabetic}\\\\p{Number}_]\", \"u\");\n }\n catch (_) { }\n function hasWordChar(str) {\n if (wordChar)\n return wordChar.test(str);\n for (let i = 0; i < str.length; i++) {\n let ch = str[i];\n if (/\\w/.test(ch) || ch > \"\\x80\" && (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)))\n return true;\n }\n return false;\n }\n function makeCategorizer(wordChars) {\n return (char) => {\n if (!/\\S/.test(char))\n return CharCategory.Space;\n if (hasWordChar(char))\n return CharCategory.Word;\n for (let i = 0; i < wordChars.length; i++)\n if (char.indexOf(wordChars[i]) > -1)\n return CharCategory.Word;\n return CharCategory.Other;\n };\n }\n\n /**\n The editor state class is a persistent (immutable) data structure.\n To update a state, you [create](https://codemirror.net/6/docs/ref/#state.EditorState.update) a\n [transaction](https://codemirror.net/6/docs/ref/#state.Transaction), which produces a _new_ state\n instance, without modifying the original object.\n\n As such, _never_ mutate properties of a state directly. That'll\n just break things.\n */\n class EditorState {\n constructor(\n /**\n @internal\n */\n config, \n /**\n The current document.\n */\n doc, \n /**\n The current selection.\n */\n selection, \n /**\n @internal\n */\n values, computeSlot, tr) {\n this.config = config;\n this.doc = doc;\n this.selection = selection;\n this.values = values;\n this.status = config.statusTemplate.slice();\n this.computeSlot = computeSlot;\n // Fill in the computed state immediately, so that further queries\n // for it made during the update return this state\n if (tr)\n tr._state = this;\n for (let i = 0; i < this.config.dynamicSlots.length; i++)\n ensureAddr(this, i << 1);\n this.computeSlot = null;\n }\n field(field, require = true) {\n let addr = this.config.address[field.id];\n if (addr == null) {\n if (require)\n throw new RangeError(\"Field is not present in this state\");\n return undefined;\n }\n ensureAddr(this, addr);\n return getAddr(this, addr);\n }\n /**\n Create a [transaction](https://codemirror.net/6/docs/ref/#state.Transaction) that updates this\n state. Any number of [transaction specs](https://codemirror.net/6/docs/ref/#state.TransactionSpec)\n can be passed. Unless\n [`sequential`](https://codemirror.net/6/docs/ref/#state.TransactionSpec.sequential) is set, the\n [changes](https://codemirror.net/6/docs/ref/#state.TransactionSpec.changes) (if any) of each spec\n are assumed to start in the _current_ document (not the document\n produced by previous specs), and its\n [selection](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection) and\n [effects](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) are assumed to refer\n to the document created by its _own_ changes. The resulting\n transaction contains the combined effect of all the different\n specs. For [selection](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection), later\n specs take precedence over earlier ones.\n */\n update(...specs) {\n return resolveTransaction(this, specs, true);\n }\n /**\n @internal\n */\n applyTransaction(tr) {\n let conf = this.config, { base, compartments } = conf;\n for (let effect of tr.effects) {\n if (effect.is(Compartment.reconfigure)) {\n if (conf) {\n compartments = new Map;\n conf.compartments.forEach((val, key) => compartments.set(key, val));\n conf = null;\n }\n compartments.set(effect.value.compartment, effect.value.extension);\n }\n else if (effect.is(StateEffect.reconfigure)) {\n conf = null;\n base = effect.value;\n }\n else if (effect.is(StateEffect.appendConfig)) {\n conf = null;\n base = asArray$1(base).concat(effect.value);\n }\n }\n let startValues;\n if (!conf) {\n conf = Configuration.resolve(base, compartments, this);\n let intermediateState = new EditorState(conf, this.doc, this.selection, conf.dynamicSlots.map(() => null), (state, slot) => slot.reconfigure(state, this), null);\n startValues = intermediateState.values;\n }\n else {\n startValues = tr.startState.values.slice();\n }\n let selection = tr.startState.facet(allowMultipleSelections) ? tr.newSelection : tr.newSelection.asSingle();\n new EditorState(conf, tr.newDoc, selection, startValues, (state, slot) => slot.update(state, tr), tr);\n }\n /**\n Create a [transaction spec](https://codemirror.net/6/docs/ref/#state.TransactionSpec) that\n replaces every selection range with the given content.\n */\n replaceSelection(text) {\n if (typeof text == \"string\")\n text = this.toText(text);\n return this.changeByRange(range => ({ changes: { from: range.from, to: range.to, insert: text },\n range: EditorSelection.cursor(range.from + text.length) }));\n }\n /**\n Create a set of changes and a new selection by running the given\n function for each range in the active selection. The function\n can return an optional set of changes (in the coordinate space\n of the start document), plus an updated range (in the coordinate\n space of the document produced by the call's own changes). This\n method will merge all the changes and ranges into a single\n changeset and selection, and return it as a [transaction\n spec](https://codemirror.net/6/docs/ref/#state.TransactionSpec), which can be passed to\n [`update`](https://codemirror.net/6/docs/ref/#state.EditorState.update).\n */\n changeByRange(f) {\n let sel = this.selection;\n let result1 = f(sel.ranges[0]);\n let changes = this.changes(result1.changes), ranges = [result1.range];\n let effects = asArray$1(result1.effects);\n for (let i = 1; i < sel.ranges.length; i++) {\n let result = f(sel.ranges[i]);\n let newChanges = this.changes(result.changes), newMapped = newChanges.map(changes);\n for (let j = 0; j < i; j++)\n ranges[j] = ranges[j].map(newMapped);\n let mapBy = changes.mapDesc(newChanges, true);\n ranges.push(result.range.map(mapBy));\n changes = changes.compose(newMapped);\n effects = StateEffect.mapEffects(effects, newMapped).concat(StateEffect.mapEffects(asArray$1(result.effects), mapBy));\n }\n return {\n changes,\n selection: EditorSelection.create(ranges, sel.mainIndex),\n effects\n };\n }\n /**\n Create a [change set](https://codemirror.net/6/docs/ref/#state.ChangeSet) from the given change\n description, taking the state's document length and line\n separator into account.\n */\n changes(spec = []) {\n if (spec instanceof ChangeSet)\n return spec;\n return ChangeSet.of(spec, this.doc.length, this.facet(EditorState.lineSeparator));\n }\n /**\n Using the state's [line\n separator](https://codemirror.net/6/docs/ref/#state.EditorState^lineSeparator), create a\n [`Text`](https://codemirror.net/6/docs/ref/#state.Text) instance from the given string.\n */\n toText(string) {\n return Text.of(string.split(this.facet(EditorState.lineSeparator) || DefaultSplit));\n }\n /**\n Return the given range of the document as a string.\n */\n sliceDoc(from = 0, to = this.doc.length) {\n return this.doc.sliceString(from, to, this.lineBreak);\n }\n /**\n Get the value of a state [facet](https://codemirror.net/6/docs/ref/#state.Facet).\n */\n facet(facet) {\n let addr = this.config.address[facet.id];\n if (addr == null)\n return facet.default;\n ensureAddr(this, addr);\n return getAddr(this, addr);\n }\n /**\n Convert this state to a JSON-serializable object. When custom\n fields should be serialized, you can pass them in as an object\n mapping property names (in the resulting object, which should\n not use `doc` or `selection`) to fields.\n */\n toJSON(fields) {\n let result = {\n doc: this.sliceDoc(),\n selection: this.selection.toJSON()\n };\n if (fields)\n for (let prop in fields) {\n let value = fields[prop];\n if (value instanceof StateField && this.config.address[value.id] != null)\n result[prop] = value.spec.toJSON(this.field(fields[prop]), this);\n }\n return result;\n }\n /**\n Deserialize a state from its JSON representation. When custom\n fields should be deserialized, pass the same object you passed\n to [`toJSON`](https://codemirror.net/6/docs/ref/#state.EditorState.toJSON) when serializing as\n third argument.\n */\n static fromJSON(json, config = {}, fields) {\n if (!json || typeof json.doc != \"string\")\n throw new RangeError(\"Invalid JSON representation for EditorState\");\n let fieldInit = [];\n if (fields)\n for (let prop in fields) {\n if (Object.prototype.hasOwnProperty.call(json, prop)) {\n let field = fields[prop], value = json[prop];\n fieldInit.push(field.init(state => field.spec.fromJSON(value, state)));\n }\n }\n return EditorState.create({\n doc: json.doc,\n selection: EditorSelection.fromJSON(json.selection),\n extensions: config.extensions ? fieldInit.concat([config.extensions]) : fieldInit\n });\n }\n /**\n Create a new state. You'll usually only need this when\n initializing an editor\u2014updated states are created by applying\n transactions.\n */\n static create(config = {}) {\n let configuration = Configuration.resolve(config.extensions || [], new Map);\n let doc = config.doc instanceof Text ? config.doc\n : Text.of((config.doc || \"\").split(configuration.staticFacet(EditorState.lineSeparator) || DefaultSplit));\n let selection = !config.selection ? EditorSelection.single(0)\n : config.selection instanceof EditorSelection ? config.selection\n : EditorSelection.single(config.selection.anchor, config.selection.head);\n checkSelection(selection, doc.length);\n if (!configuration.staticFacet(allowMultipleSelections))\n selection = selection.asSingle();\n return new EditorState(configuration, doc, selection, configuration.dynamicSlots.map(() => null), (state, slot) => slot.create(state), null);\n }\n /**\n The size (in columns) of a tab in the document, determined by\n the [`tabSize`](https://codemirror.net/6/docs/ref/#state.EditorState^tabSize) facet.\n */\n get tabSize() { return this.facet(EditorState.tabSize); }\n /**\n Get the proper [line-break](https://codemirror.net/6/docs/ref/#state.EditorState^lineSeparator)\n string for this state.\n */\n get lineBreak() { return this.facet(EditorState.lineSeparator) || \"\\n\"; }\n /**\n Returns true when the editor is\n [configured](https://codemirror.net/6/docs/ref/#state.EditorState^readOnly) to be read-only.\n */\n get readOnly() { return this.facet(readOnly); }\n /**\n Look up a translation for the given phrase (via the\n [`phrases`](https://codemirror.net/6/docs/ref/#state.EditorState^phrases) facet), or return the\n original string if no translation is found.\n \n If additional arguments are passed, they will be inserted in\n place of markers like `$1` (for the first value) and `$2`, etc.\n A single `$` is equivalent to `$1`, and `$$` will produce a\n literal dollar sign.\n */\n phrase(phrase, ...insert) {\n for (let map of this.facet(EditorState.phrases))\n if (Object.prototype.hasOwnProperty.call(map, phrase)) {\n phrase = map[phrase];\n break;\n }\n if (insert.length)\n phrase = phrase.replace(/\\$(\\$|\\d*)/g, (m, i) => {\n if (i == \"$\")\n return \"$\";\n let n = +(i || 1);\n return !n || n > insert.length ? m : insert[n - 1];\n });\n return phrase;\n }\n /**\n Find the values for a given language data field, provided by the\n the [`languageData`](https://codemirror.net/6/docs/ref/#state.EditorState^languageData) facet.\n \n Examples of language data fields are...\n \n - [`\"commentTokens\"`](https://codemirror.net/6/docs/ref/#commands.CommentTokens) for specifying\n comment syntax.\n - [`\"autocomplete\"`](https://codemirror.net/6/docs/ref/#autocomplete.autocompletion^config.override)\n for providing language-specific completion sources.\n - [`\"wordChars\"`](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer) for adding\n characters that should be considered part of words in this\n language.\n - [`\"closeBrackets\"`](https://codemirror.net/6/docs/ref/#autocomplete.CloseBracketConfig) controls\n bracket closing behavior.\n */\n languageDataAt(name, pos, side = -1) {\n let values = [];\n for (let provider of this.facet(languageData)) {\n for (let result of provider(this, pos, side)) {\n if (Object.prototype.hasOwnProperty.call(result, name))\n values.push(result[name]);\n }\n }\n return values;\n }\n /**\n Return a function that can categorize strings (expected to\n represent a single [grapheme cluster](https://codemirror.net/6/docs/ref/#state.findClusterBreak))\n into one of:\n \n - Word (contains an alphanumeric character or a character\n explicitly listed in the local language's `\"wordChars\"`\n language data, which should be a string)\n - Space (contains only whitespace)\n - Other (anything else)\n */\n charCategorizer(at) {\n return makeCategorizer(this.languageDataAt(\"wordChars\", at).join(\"\"));\n }\n /**\n Find the word at the given position, meaning the range\n containing all [word](https://codemirror.net/6/docs/ref/#state.CharCategory.Word) characters\n around it. If no word characters are adjacent to the position,\n this returns null.\n */\n wordAt(pos) {\n let { text, from, length } = this.doc.lineAt(pos);\n let cat = this.charCategorizer(pos);\n let start = pos - from, end = pos - from;\n while (start > 0) {\n let prev = findClusterBreak(text, start, false);\n if (cat(text.slice(prev, start)) != CharCategory.Word)\n break;\n start = prev;\n }\n while (end < length) {\n let next = findClusterBreak(text, end);\n if (cat(text.slice(end, next)) != CharCategory.Word)\n break;\n end = next;\n }\n return start == end ? null : EditorSelection.range(start + from, end + from);\n }\n }\n /**\n A facet that, when enabled, causes the editor to allow multiple\n ranges to be selected. Be careful though, because by default the\n editor relies on the native DOM selection, which cannot handle\n multiple selections. An extension like\n [`drawSelection`](https://codemirror.net/6/docs/ref/#view.drawSelection) can be used to make\n secondary selections visible to the user.\n */\n EditorState.allowMultipleSelections = allowMultipleSelections;\n /**\n Configures the tab size to use in this state. The first\n (highest-precedence) value of the facet is used. If no value is\n given, this defaults to 4.\n */\n EditorState.tabSize = /*@__PURE__*/Facet.define({\n combine: values => values.length ? values[0] : 4\n });\n /**\n The line separator to use. By default, any of `\"\\n\"`, `\"\\r\\n\"`\n and `\"\\r\"` is treated as a separator when splitting lines, and\n lines are joined with `\"\\n\"`.\n\n When you configure a value here, only that precise separator\n will be used, allowing you to round-trip documents through the\n editor without normalizing line separators.\n */\n EditorState.lineSeparator = lineSeparator;\n /**\n This facet controls the value of the\n [`readOnly`](https://codemirror.net/6/docs/ref/#state.EditorState.readOnly) getter, which is\n consulted by commands and extensions that implement editing\n functionality to determine whether they should apply. It\n defaults to false, but when its highest-precedence value is\n `true`, such functionality disables itself.\n\n Not to be confused with\n [`EditorView.editable`](https://codemirror.net/6/docs/ref/#view.EditorView^editable), which\n controls whether the editor's DOM is set to be editable (and\n thus focusable).\n */\n EditorState.readOnly = readOnly;\n /**\n Registers translation phrases. The\n [`phrase`](https://codemirror.net/6/docs/ref/#state.EditorState.phrase) method will look through\n all objects registered with this facet to find translations for\n its argument.\n */\n EditorState.phrases = /*@__PURE__*/Facet.define({\n compare(a, b) {\n let kA = Object.keys(a), kB = Object.keys(b);\n return kA.length == kB.length && kA.every(k => a[k] == b[k]);\n }\n });\n /**\n A facet used to register [language\n data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt) providers.\n */\n EditorState.languageData = languageData;\n /**\n Facet used to register change filters, which are called for each\n transaction (unless explicitly\n [disabled](https://codemirror.net/6/docs/ref/#state.TransactionSpec.filter)), and can suppress\n part of the transaction's changes.\n\n Such a function can return `true` to indicate that it doesn't\n want to do anything, `false` to completely stop the changes in\n the transaction, or a set of ranges in which changes should be\n suppressed. Such ranges are represented as an array of numbers,\n with each pair of two numbers indicating the start and end of a\n range. So for example `[10, 20, 100, 110]` suppresses changes\n between 10 and 20, and between 100 and 110.\n */\n EditorState.changeFilter = changeFilter;\n /**\n Facet used to register a hook that gets a chance to update or\n replace transaction specs before they are applied. This will\n only be applied for transactions that don't have\n [`filter`](https://codemirror.net/6/docs/ref/#state.TransactionSpec.filter) set to `false`. You\n can either return a single transaction spec (possibly the input\n transaction), or an array of specs (which will be combined in\n the same way as the arguments to\n [`EditorState.update`](https://codemirror.net/6/docs/ref/#state.EditorState.update)).\n\n When possible, it is recommended to avoid accessing\n [`Transaction.state`](https://codemirror.net/6/docs/ref/#state.Transaction.state) in a filter,\n since it will force creation of a state that will then be\n discarded again, if the transaction is actually filtered.\n\n (This functionality should be used with care. Indiscriminately\n modifying transaction is likely to break something or degrade\n the user experience.)\n */\n EditorState.transactionFilter = transactionFilter;\n /**\n This is a more limited form of\n [`transactionFilter`](https://codemirror.net/6/docs/ref/#state.EditorState^transactionFilter),\n which can only add\n [annotations](https://codemirror.net/6/docs/ref/#state.TransactionSpec.annotations) and\n [effects](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects). _But_, this type\n of filter runs even if the transaction has disabled regular\n [filtering](https://codemirror.net/6/docs/ref/#state.TransactionSpec.filter), making it suitable\n for effects that don't need to touch the changes or selection,\n but do want to process every transaction.\n\n Extenders run _after_ filters, when both are present.\n */\n EditorState.transactionExtender = transactionExtender;\n Compartment.reconfigure = /*@__PURE__*/StateEffect.define();\n\n /**\n Utility function for combining behaviors to fill in a config\n object from an array of provided configs. `defaults` should hold\n default values for all optional fields in `Config`.\n\n The function will, by default, error\n when a field gets two values that aren't `===`-equal, but you can\n provide combine functions per field to do something else.\n */\n function combineConfig(configs, defaults, // Should hold only the optional properties of Config, but I haven't managed to express that\n combine = {}) {\n let result = {};\n for (let config of configs)\n for (let key of Object.keys(config)) {\n let value = config[key], current = result[key];\n if (current === undefined)\n result[key] = value;\n else if (current === value || value === undefined) ; // No conflict\n else if (Object.hasOwnProperty.call(combine, key))\n result[key] = combine[key](current, value);\n else\n throw new Error(\"Config merge conflict for field \" + key);\n }\n for (let key in defaults)\n if (result[key] === undefined)\n result[key] = defaults[key];\n return result;\n }\n\n /**\n Each range is associated with a value, which must inherit from\n this class.\n */\n class RangeValue {\n /**\n Compare this value with another value. Used when comparing\n rangesets. The default implementation compares by identity.\n Unless you are only creating a fixed number of unique instances\n of your value type, it is a good idea to implement this\n properly.\n */\n eq(other) { return this == other; }\n /**\n Create a [range](https://codemirror.net/6/docs/ref/#state.Range) with this value.\n */\n range(from, to = from) { return Range$1.create(from, to, this); }\n }\n RangeValue.prototype.startSide = RangeValue.prototype.endSide = 0;\n RangeValue.prototype.point = false;\n RangeValue.prototype.mapMode = MapMode.TrackDel;\n /**\n A range associates a value with a range of positions.\n */\n class Range$1 {\n constructor(\n /**\n The range's start position.\n */\n from, \n /**\n Its end position.\n */\n to, \n /**\n The value associated with this range.\n */\n value) {\n this.from = from;\n this.to = to;\n this.value = value;\n }\n /**\n @internal\n */\n static create(from, to, value) {\n return new Range$1(from, to, value);\n }\n }\n function cmpRange(a, b) {\n return a.from - b.from || a.value.startSide - b.value.startSide;\n }\n class Chunk {\n constructor(from, to, value, \n // Chunks are marked with the largest point that occurs\n // in them (or -1 for no points), so that scans that are\n // only interested in points (such as the\n // heightmap-related logic) can skip range-only chunks.\n maxPoint) {\n this.from = from;\n this.to = to;\n this.value = value;\n this.maxPoint = maxPoint;\n }\n get length() { return this.to[this.to.length - 1]; }\n // Find the index of the given position and side. Use the ranges'\n // `from` pos when `end == false`, `to` when `end == true`.\n findIndex(pos, side, end, startAt = 0) {\n let arr = end ? this.to : this.from;\n for (let lo = startAt, hi = arr.length;;) {\n if (lo == hi)\n return lo;\n let mid = (lo + hi) >> 1;\n let diff = arr[mid] - pos || (end ? this.value[mid].endSide : this.value[mid].startSide) - side;\n if (mid == lo)\n return diff >= 0 ? lo : hi;\n if (diff >= 0)\n hi = mid;\n else\n lo = mid + 1;\n }\n }\n between(offset, from, to, f) {\n for (let i = this.findIndex(from, -1000000000 /* C.Far */, true), e = this.findIndex(to, 1000000000 /* C.Far */, false, i); i < e; i++)\n if (f(this.from[i] + offset, this.to[i] + offset, this.value[i]) === false)\n return false;\n }\n map(offset, changes) {\n let value = [], from = [], to = [], newPos = -1, maxPoint = -1;\n for (let i = 0; i < this.value.length; i++) {\n let val = this.value[i], curFrom = this.from[i] + offset, curTo = this.to[i] + offset, newFrom, newTo;\n if (curFrom == curTo) {\n let mapped = changes.mapPos(curFrom, val.startSide, val.mapMode);\n if (mapped == null)\n continue;\n newFrom = newTo = mapped;\n if (val.startSide != val.endSide) {\n newTo = changes.mapPos(curFrom, val.endSide);\n if (newTo < newFrom)\n continue;\n }\n }\n else {\n newFrom = changes.mapPos(curFrom, val.startSide);\n newTo = changes.mapPos(curTo, val.endSide);\n if (newFrom > newTo || newFrom == newTo && val.startSide > 0 && val.endSide <= 0)\n continue;\n }\n if ((newTo - newFrom || val.endSide - val.startSide) < 0)\n continue;\n if (newPos < 0)\n newPos = newFrom;\n if (val.point)\n maxPoint = Math.max(maxPoint, newTo - newFrom);\n value.push(val);\n from.push(newFrom - newPos);\n to.push(newTo - newPos);\n }\n return { mapped: value.length ? new Chunk(from, to, value, maxPoint) : null, pos: newPos };\n }\n }\n /**\n A range set stores a collection of [ranges](https://codemirror.net/6/docs/ref/#state.Range) in a\n way that makes them efficient to [map](https://codemirror.net/6/docs/ref/#state.RangeSet.map) and\n [update](https://codemirror.net/6/docs/ref/#state.RangeSet.update). This is an immutable data\n structure.\n */\n class RangeSet {\n constructor(\n /**\n @internal\n */\n chunkPos, \n /**\n @internal\n */\n chunk, \n /**\n @internal\n */\n nextLayer, \n /**\n @internal\n */\n maxPoint) {\n this.chunkPos = chunkPos;\n this.chunk = chunk;\n this.nextLayer = nextLayer;\n this.maxPoint = maxPoint;\n }\n /**\n @internal\n */\n static create(chunkPos, chunk, nextLayer, maxPoint) {\n return new RangeSet(chunkPos, chunk, nextLayer, maxPoint);\n }\n /**\n @internal\n */\n get length() {\n let last = this.chunk.length - 1;\n return last < 0 ? 0 : Math.max(this.chunkEnd(last), this.nextLayer.length);\n }\n /**\n The number of ranges in the set.\n */\n get size() {\n if (this.isEmpty)\n return 0;\n let size = this.nextLayer.size;\n for (let chunk of this.chunk)\n size += chunk.value.length;\n return size;\n }\n /**\n @internal\n */\n chunkEnd(index) {\n return this.chunkPos[index] + this.chunk[index].length;\n }\n /**\n Update the range set, optionally adding new ranges or filtering\n out existing ones.\n \n (Note: The type parameter is just there as a kludge to work\n around TypeScript variance issues that prevented `RangeSet<X>`\n from being a subtype of `RangeSet<Y>` when `X` is a subtype of\n `Y`.)\n */\n update(updateSpec) {\n let { add = [], sort = false, filterFrom = 0, filterTo = this.length } = updateSpec;\n let filter = updateSpec.filter;\n if (add.length == 0 && !filter)\n return this;\n if (sort)\n add = add.slice().sort(cmpRange);\n if (this.isEmpty)\n return add.length ? RangeSet.of(add) : this;\n let cur = new LayerCursor(this, null, -1).goto(0), i = 0, spill = [];\n let builder = new RangeSetBuilder();\n while (cur.value || i < add.length) {\n if (i < add.length && (cur.from - add[i].from || cur.startSide - add[i].value.startSide) >= 0) {\n let range = add[i++];\n if (!builder.addInner(range.from, range.to, range.value))\n spill.push(range);\n }\n else if (cur.rangeIndex == 1 && cur.chunkIndex < this.chunk.length &&\n (i == add.length || this.chunkEnd(cur.chunkIndex) < add[i].from) &&\n (!filter || filterFrom > this.chunkEnd(cur.chunkIndex) || filterTo < this.chunkPos[cur.chunkIndex]) &&\n builder.addChunk(this.chunkPos[cur.chunkIndex], this.chunk[cur.chunkIndex])) {\n cur.nextChunk();\n }\n else {\n if (!filter || filterFrom > cur.to || filterTo < cur.from || filter(cur.from, cur.to, cur.value)) {\n if (!builder.addInner(cur.from, cur.to, cur.value))\n spill.push(Range$1.create(cur.from, cur.to, cur.value));\n }\n cur.next();\n }\n }\n return builder.finishInner(this.nextLayer.isEmpty && !spill.length ? RangeSet.empty\n : this.nextLayer.update({ add: spill, filter, filterFrom, filterTo }));\n }\n /**\n Map this range set through a set of changes, return the new set.\n */\n map(changes) {\n if (changes.empty || this.isEmpty)\n return this;\n let chunks = [], chunkPos = [], maxPoint = -1;\n for (let i = 0; i < this.chunk.length; i++) {\n let start = this.chunkPos[i], chunk = this.chunk[i];\n let touch = changes.touchesRange(start, start + chunk.length);\n if (touch === false) {\n maxPoint = Math.max(maxPoint, chunk.maxPoint);\n chunks.push(chunk);\n chunkPos.push(changes.mapPos(start));\n }\n else if (touch === true) {\n let { mapped, pos } = chunk.map(start, changes);\n if (mapped) {\n maxPoint = Math.max(maxPoint, mapped.maxPoint);\n chunks.push(mapped);\n chunkPos.push(pos);\n }\n }\n }\n let next = this.nextLayer.map(changes);\n return chunks.length == 0 ? next : new RangeSet(chunkPos, chunks, next || RangeSet.empty, maxPoint);\n }\n /**\n Iterate over the ranges that touch the region `from` to `to`,\n calling `f` for each. There is no guarantee that the ranges will\n be reported in any specific order. When the callback returns\n `false`, iteration stops.\n */\n between(from, to, f) {\n if (this.isEmpty)\n return;\n for (let i = 0; i < this.chunk.length; i++) {\n let start = this.chunkPos[i], chunk = this.chunk[i];\n if (to >= start && from <= start + chunk.length &&\n chunk.between(start, from - start, to - start, f) === false)\n return;\n }\n this.nextLayer.between(from, to, f);\n }\n /**\n Iterate over the ranges in this set, in order, including all\n ranges that end at or after `from`.\n */\n iter(from = 0) {\n return HeapCursor.from([this]).goto(from);\n }\n /**\n @internal\n */\n get isEmpty() { return this.nextLayer == this; }\n /**\n Iterate over the ranges in a collection of sets, in order,\n starting from `from`.\n */\n static iter(sets, from = 0) {\n return HeapCursor.from(sets).goto(from);\n }\n /**\n Iterate over two groups of sets, calling methods on `comparator`\n to notify it of possible differences.\n */\n static compare(oldSets, newSets, \n /**\n This indicates how the underlying data changed between these\n ranges, and is needed to synchronize the iteration.\n */\n textDiff, comparator, \n /**\n Can be used to ignore all non-point ranges, and points below\n the given size. When -1, all ranges are compared.\n */\n minPointSize = -1) {\n let a = oldSets.filter(set => set.maxPoint > 0 || !set.isEmpty && set.maxPoint >= minPointSize);\n let b = newSets.filter(set => set.maxPoint > 0 || !set.isEmpty && set.maxPoint >= minPointSize);\n let sharedChunks = findSharedChunks(a, b, textDiff);\n let sideA = new SpanCursor(a, sharedChunks, minPointSize);\n let sideB = new SpanCursor(b, sharedChunks, minPointSize);\n textDiff.iterGaps((fromA, fromB, length) => compare(sideA, fromA, sideB, fromB, length, comparator));\n if (textDiff.empty && textDiff.length == 0)\n compare(sideA, 0, sideB, 0, 0, comparator);\n }\n /**\n Compare the contents of two groups of range sets, returning true\n if they are equivalent in the given range.\n */\n static eq(oldSets, newSets, from = 0, to) {\n if (to == null)\n to = 1000000000 /* C.Far */ - 1;\n let a = oldSets.filter(set => !set.isEmpty && newSets.indexOf(set) < 0);\n let b = newSets.filter(set => !set.isEmpty && oldSets.indexOf(set) < 0);\n if (a.length != b.length)\n return false;\n if (!a.length)\n return true;\n let sharedChunks = findSharedChunks(a, b);\n let sideA = new SpanCursor(a, sharedChunks, 0).goto(from), sideB = new SpanCursor(b, sharedChunks, 0).goto(from);\n for (;;) {\n if (sideA.to != sideB.to ||\n !sameValues(sideA.active, sideB.active) ||\n sideA.point && (!sideB.point || !sideA.point.eq(sideB.point)))\n return false;\n if (sideA.to > to)\n return true;\n sideA.next();\n sideB.next();\n }\n }\n /**\n Iterate over a group of range sets at the same time, notifying\n the iterator about the ranges covering every given piece of\n content. Returns the open count (see\n [`SpanIterator.span`](https://codemirror.net/6/docs/ref/#state.SpanIterator.span)) at the end\n of the iteration.\n */\n static spans(sets, from, to, iterator, \n /**\n When given and greater than -1, only points of at least this\n size are taken into account.\n */\n minPointSize = -1) {\n let cursor = new SpanCursor(sets, null, minPointSize).goto(from), pos = from;\n let openRanges = cursor.openStart;\n for (;;) {\n let curTo = Math.min(cursor.to, to);\n if (cursor.point) {\n let active = cursor.activeForPoint(cursor.to);\n let openCount = cursor.pointFrom < from ? active.length + 1\n : cursor.point.startSide < 0 ? active.length\n : Math.min(active.length, openRanges);\n iterator.point(pos, curTo, cursor.point, active, openCount, cursor.pointRank);\n openRanges = Math.min(cursor.openEnd(curTo), active.length);\n }\n else if (curTo > pos) {\n iterator.span(pos, curTo, cursor.active, openRanges);\n openRanges = cursor.openEnd(curTo);\n }\n if (cursor.to > to)\n return openRanges + (cursor.point && cursor.to > to ? 1 : 0);\n pos = cursor.to;\n cursor.next();\n }\n }\n /**\n Create a range set for the given range or array of ranges. By\n default, this expects the ranges to be _sorted_ (by start\n position and, if two start at the same position,\n `value.startSide`). You can pass `true` as second argument to\n cause the method to sort them.\n */\n static of(ranges, sort = false) {\n let build = new RangeSetBuilder();\n for (let range of ranges instanceof Range$1 ? [ranges] : sort ? lazySort(ranges) : ranges)\n build.add(range.from, range.to, range.value);\n return build.finish();\n }\n /**\n Join an array of range sets into a single set.\n */\n static join(sets) {\n if (!sets.length)\n return RangeSet.empty;\n let result = sets[sets.length - 1];\n for (let i = sets.length - 2; i >= 0; i--) {\n for (let layer = sets[i]; layer != RangeSet.empty; layer = layer.nextLayer)\n result = new RangeSet(layer.chunkPos, layer.chunk, result, Math.max(layer.maxPoint, result.maxPoint));\n }\n return result;\n }\n }\n /**\n The empty set of ranges.\n */\n RangeSet.empty = /*@__PURE__*/new RangeSet([], [], null, -1);\n function lazySort(ranges) {\n if (ranges.length > 1)\n for (let prev = ranges[0], i = 1; i < ranges.length; i++) {\n let cur = ranges[i];\n if (cmpRange(prev, cur) > 0)\n return ranges.slice().sort(cmpRange);\n prev = cur;\n }\n return ranges;\n }\n RangeSet.empty.nextLayer = RangeSet.empty;\n /**\n A range set builder is a data structure that helps build up a\n [range set](https://codemirror.net/6/docs/ref/#state.RangeSet) directly, without first allocating\n an array of [`Range`](https://codemirror.net/6/docs/ref/#state.Range) objects.\n */\n class RangeSetBuilder {\n finishChunk(newArrays) {\n this.chunks.push(new Chunk(this.from, this.to, this.value, this.maxPoint));\n this.chunkPos.push(this.chunkStart);\n this.chunkStart = -1;\n this.setMaxPoint = Math.max(this.setMaxPoint, this.maxPoint);\n this.maxPoint = -1;\n if (newArrays) {\n this.from = [];\n this.to = [];\n this.value = [];\n }\n }\n /**\n Create an empty builder.\n */\n constructor() {\n this.chunks = [];\n this.chunkPos = [];\n this.chunkStart = -1;\n this.last = null;\n this.lastFrom = -1000000000 /* C.Far */;\n this.lastTo = -1000000000 /* C.Far */;\n this.from = [];\n this.to = [];\n this.value = [];\n this.maxPoint = -1;\n this.setMaxPoint = -1;\n this.nextLayer = null;\n }\n /**\n Add a range. Ranges should be added in sorted (by `from` and\n `value.startSide`) order.\n */\n add(from, to, value) {\n if (!this.addInner(from, to, value))\n (this.nextLayer || (this.nextLayer = new RangeSetBuilder)).add(from, to, value);\n }\n /**\n @internal\n */\n addInner(from, to, value) {\n let diff = from - this.lastTo || value.startSide - this.last.endSide;\n if (diff <= 0 && (from - this.lastFrom || value.startSide - this.last.startSide) < 0)\n throw new Error(\"Ranges must be added sorted by `from` position and `startSide`\");\n if (diff < 0)\n return false;\n if (this.from.length == 250 /* C.ChunkSize */)\n this.finishChunk(true);\n if (this.chunkStart < 0)\n this.chunkStart = from;\n this.from.push(from - this.chunkStart);\n this.to.push(to - this.chunkStart);\n this.last = value;\n this.lastFrom = from;\n this.lastTo = to;\n this.value.push(value);\n if (value.point)\n this.maxPoint = Math.max(this.maxPoint, to - from);\n return true;\n }\n /**\n @internal\n */\n addChunk(from, chunk) {\n if ((from - this.lastTo || chunk.value[0].startSide - this.last.endSide) < 0)\n return false;\n if (this.from.length)\n this.finishChunk(true);\n this.setMaxPoint = Math.max(this.setMaxPoint, chunk.maxPoint);\n this.chunks.push(chunk);\n this.chunkPos.push(from);\n let last = chunk.value.length - 1;\n this.last = chunk.value[last];\n this.lastFrom = chunk.from[last] + from;\n this.lastTo = chunk.to[last] + from;\n return true;\n }\n /**\n Finish the range set. Returns the new set. The builder can't be\n used anymore after this has been called.\n */\n finish() { return this.finishInner(RangeSet.empty); }\n /**\n @internal\n */\n finishInner(next) {\n if (this.from.length)\n this.finishChunk(false);\n if (this.chunks.length == 0)\n return next;\n let result = RangeSet.create(this.chunkPos, this.chunks, this.nextLayer ? this.nextLayer.finishInner(next) : next, this.setMaxPoint);\n this.from = null; // Make sure further `add` calls produce errors\n return result;\n }\n }\n function findSharedChunks(a, b, textDiff) {\n let inA = new Map();\n for (let set of a)\n for (let i = 0; i < set.chunk.length; i++)\n if (set.chunk[i].maxPoint <= 0)\n inA.set(set.chunk[i], set.chunkPos[i]);\n let shared = new Set();\n for (let set of b)\n for (let i = 0; i < set.chunk.length; i++) {\n let known = inA.get(set.chunk[i]);\n if (known != null && (textDiff ? textDiff.mapPos(known) : known) == set.chunkPos[i] &&\n !(textDiff === null || textDiff === void 0 ? void 0 : textDiff.touchesRange(known, known + set.chunk[i].length)))\n shared.add(set.chunk[i]);\n }\n return shared;\n }\n class LayerCursor {\n constructor(layer, skip, minPoint, rank = 0) {\n this.layer = layer;\n this.skip = skip;\n this.minPoint = minPoint;\n this.rank = rank;\n }\n get startSide() { return this.value ? this.value.startSide : 0; }\n get endSide() { return this.value ? this.value.endSide : 0; }\n goto(pos, side = -1000000000 /* C.Far */) {\n this.chunkIndex = this.rangeIndex = 0;\n this.gotoInner(pos, side, false);\n return this;\n }\n gotoInner(pos, side, forward) {\n while (this.chunkIndex < this.layer.chunk.length) {\n let next = this.layer.chunk[this.chunkIndex];\n if (!(this.skip && this.skip.has(next) ||\n this.layer.chunkEnd(this.chunkIndex) < pos ||\n next.maxPoint < this.minPoint))\n break;\n this.chunkIndex++;\n forward = false;\n }\n if (this.chunkIndex < this.layer.chunk.length) {\n let rangeIndex = this.layer.chunk[this.chunkIndex].findIndex(pos - this.layer.chunkPos[this.chunkIndex], side, true);\n if (!forward || this.rangeIndex < rangeIndex)\n this.setRangeIndex(rangeIndex);\n }\n this.next();\n }\n forward(pos, side) {\n if ((this.to - pos || this.endSide - side) < 0)\n this.gotoInner(pos, side, true);\n }\n next() {\n for (;;) {\n if (this.chunkIndex == this.layer.chunk.length) {\n this.from = this.to = 1000000000 /* C.Far */;\n this.value = null;\n break;\n }\n else {\n let chunkPos = this.layer.chunkPos[this.chunkIndex], chunk = this.layer.chunk[this.chunkIndex];\n let from = chunkPos + chunk.from[this.rangeIndex];\n this.from = from;\n this.to = chunkPos + chunk.to[this.rangeIndex];\n this.value = chunk.value[this.rangeIndex];\n this.setRangeIndex(this.rangeIndex + 1);\n if (this.minPoint < 0 || this.value.point && this.to - this.from >= this.minPoint)\n break;\n }\n }\n }\n setRangeIndex(index) {\n if (index == this.layer.chunk[this.chunkIndex].value.length) {\n this.chunkIndex++;\n if (this.skip) {\n while (this.chunkIndex < this.layer.chunk.length && this.skip.has(this.layer.chunk[this.chunkIndex]))\n this.chunkIndex++;\n }\n this.rangeIndex = 0;\n }\n else {\n this.rangeIndex = index;\n }\n }\n nextChunk() {\n this.chunkIndex++;\n this.rangeIndex = 0;\n this.next();\n }\n compare(other) {\n return this.from - other.from || this.startSide - other.startSide || this.rank - other.rank ||\n this.to - other.to || this.endSide - other.endSide;\n }\n }\n class HeapCursor {\n constructor(heap) {\n this.heap = heap;\n }\n static from(sets, skip = null, minPoint = -1) {\n let heap = [];\n for (let i = 0; i < sets.length; i++) {\n for (let cur = sets[i]; !cur.isEmpty; cur = cur.nextLayer) {\n if (cur.maxPoint >= minPoint)\n heap.push(new LayerCursor(cur, skip, minPoint, i));\n }\n }\n return heap.length == 1 ? heap[0] : new HeapCursor(heap);\n }\n get startSide() { return this.value ? this.value.startSide : 0; }\n goto(pos, side = -1000000000 /* C.Far */) {\n for (let cur of this.heap)\n cur.goto(pos, side);\n for (let i = this.heap.length >> 1; i >= 0; i--)\n heapBubble(this.heap, i);\n this.next();\n return this;\n }\n forward(pos, side) {\n for (let cur of this.heap)\n cur.forward(pos, side);\n for (let i = this.heap.length >> 1; i >= 0; i--)\n heapBubble(this.heap, i);\n if ((this.to - pos || this.value.endSide - side) < 0)\n this.next();\n }\n next() {\n if (this.heap.length == 0) {\n this.from = this.to = 1000000000 /* C.Far */;\n this.value = null;\n this.rank = -1;\n }\n else {\n let top = this.heap[0];\n this.from = top.from;\n this.to = top.to;\n this.value = top.value;\n this.rank = top.rank;\n if (top.value)\n top.next();\n heapBubble(this.heap, 0);\n }\n }\n }\n function heapBubble(heap, index) {\n for (let cur = heap[index];;) {\n let childIndex = (index << 1) + 1;\n if (childIndex >= heap.length)\n break;\n let child = heap[childIndex];\n if (childIndex + 1 < heap.length && child.compare(heap[childIndex + 1]) >= 0) {\n child = heap[childIndex + 1];\n childIndex++;\n }\n if (cur.compare(child) < 0)\n break;\n heap[childIndex] = cur;\n heap[index] = child;\n index = childIndex;\n }\n }\n class SpanCursor {\n constructor(sets, skip, minPoint) {\n this.minPoint = minPoint;\n this.active = [];\n this.activeTo = [];\n this.activeRank = [];\n this.minActive = -1;\n // A currently active point range, if any\n this.point = null;\n this.pointFrom = 0;\n this.pointRank = 0;\n this.to = -1000000000 /* C.Far */;\n this.endSide = 0;\n // The amount of open active ranges at the start of the iterator.\n // Not including points.\n this.openStart = -1;\n this.cursor = HeapCursor.from(sets, skip, minPoint);\n }\n goto(pos, side = -1000000000 /* C.Far */) {\n this.cursor.goto(pos, side);\n this.active.length = this.activeTo.length = this.activeRank.length = 0;\n this.minActive = -1;\n this.to = pos;\n this.endSide = side;\n this.openStart = -1;\n this.next();\n return this;\n }\n forward(pos, side) {\n while (this.minActive > -1 && (this.activeTo[this.minActive] - pos || this.active[this.minActive].endSide - side) < 0)\n this.removeActive(this.minActive);\n this.cursor.forward(pos, side);\n }\n removeActive(index) {\n remove(this.active, index);\n remove(this.activeTo, index);\n remove(this.activeRank, index);\n this.minActive = findMinIndex(this.active, this.activeTo);\n }\n addActive(trackOpen) {\n let i = 0, { value, to, rank } = this.cursor;\n // Organize active marks by rank first, then by size\n while (i < this.activeRank.length && (rank - this.activeRank[i] || to - this.activeTo[i]) > 0)\n i++;\n insert(this.active, i, value);\n insert(this.activeTo, i, to);\n insert(this.activeRank, i, rank);\n if (trackOpen)\n insert(trackOpen, i, this.cursor.from);\n this.minActive = findMinIndex(this.active, this.activeTo);\n }\n // After calling this, if `this.point` != null, the next range is a\n // point. Otherwise, it's a regular range, covered by `this.active`.\n next() {\n let from = this.to, wasPoint = this.point;\n this.point = null;\n let trackOpen = this.openStart < 0 ? [] : null;\n for (;;) {\n let a = this.minActive;\n if (a > -1 && (this.activeTo[a] - this.cursor.from || this.active[a].endSide - this.cursor.startSide) < 0) {\n if (this.activeTo[a] > from) {\n this.to = this.activeTo[a];\n this.endSide = this.active[a].endSide;\n break;\n }\n this.removeActive(a);\n if (trackOpen)\n remove(trackOpen, a);\n }\n else if (!this.cursor.value) {\n this.to = this.endSide = 1000000000 /* C.Far */;\n break;\n }\n else if (this.cursor.from > from) {\n this.to = this.cursor.from;\n this.endSide = this.cursor.startSide;\n break;\n }\n else {\n let nextVal = this.cursor.value;\n if (!nextVal.point) { // Opening a range\n this.addActive(trackOpen);\n this.cursor.next();\n }\n else if (wasPoint && this.cursor.to == this.to && this.cursor.from < this.cursor.to) {\n // Ignore any non-empty points that end precisely at the end of the prev point\n this.cursor.next();\n }\n else { // New point\n this.point = nextVal;\n this.pointFrom = this.cursor.from;\n this.pointRank = this.cursor.rank;\n this.to = this.cursor.to;\n this.endSide = nextVal.endSide;\n this.cursor.next();\n this.forward(this.to, this.endSide);\n break;\n }\n }\n }\n if (trackOpen) {\n this.openStart = 0;\n for (let i = trackOpen.length - 1; i >= 0 && trackOpen[i] < from; i--)\n this.openStart++;\n }\n }\n activeForPoint(to) {\n if (!this.active.length)\n return this.active;\n let active = [];\n for (let i = this.active.length - 1; i >= 0; i--) {\n if (this.activeRank[i] < this.pointRank)\n break;\n if (this.activeTo[i] > to || this.activeTo[i] == to && this.active[i].endSide >= this.point.endSide)\n active.push(this.active[i]);\n }\n return active.reverse();\n }\n openEnd(to) {\n let open = 0;\n for (let i = this.activeTo.length - 1; i >= 0 && this.activeTo[i] > to; i--)\n open++;\n return open;\n }\n }\n function compare(a, startA, b, startB, length, comparator) {\n a.goto(startA);\n b.goto(startB);\n let endB = startB + length;\n let pos = startB, dPos = startB - startA;\n for (;;) {\n let diff = (a.to + dPos) - b.to || a.endSide - b.endSide;\n let end = diff < 0 ? a.to + dPos : b.to, clipEnd = Math.min(end, endB);\n if (a.point || b.point) {\n if (!(a.point && b.point && (a.point == b.point || a.point.eq(b.point)) &&\n sameValues(a.activeForPoint(a.to), b.activeForPoint(b.to))))\n comparator.comparePoint(pos, clipEnd, a.point, b.point);\n }\n else {\n if (clipEnd > pos && !sameValues(a.active, b.active))\n comparator.compareRange(pos, clipEnd, a.active, b.active);\n }\n if (end > endB)\n break;\n pos = end;\n if (diff <= 0)\n a.next();\n if (diff >= 0)\n b.next();\n }\n }\n function sameValues(a, b) {\n if (a.length != b.length)\n return false;\n for (let i = 0; i < a.length; i++)\n if (a[i] != b[i] && !a[i].eq(b[i]))\n return false;\n return true;\n }\n function remove(array, index) {\n for (let i = index, e = array.length - 1; i < e; i++)\n array[i] = array[i + 1];\n array.pop();\n }\n function insert(array, index, value) {\n for (let i = array.length - 1; i >= index; i--)\n array[i + 1] = array[i];\n array[index] = value;\n }\n function findMinIndex(value, array) {\n let found = -1, foundPos = 1000000000 /* C.Far */;\n for (let i = 0; i < array.length; i++)\n if ((array[i] - foundPos || value[i].endSide - value[found].endSide) < 0) {\n found = i;\n foundPos = array[i];\n }\n return found;\n }\n\n /**\n Count the column position at the given offset into the string,\n taking extending characters and tab size into account.\n */\n function countColumn(string, tabSize, to = string.length) {\n let n = 0;\n for (let i = 0; i < to;) {\n if (string.charCodeAt(i) == 9) {\n n += tabSize - (n % tabSize);\n i++;\n }\n else {\n n++;\n i = findClusterBreak(string, i);\n }\n }\n return n;\n }\n /**\n Find the offset that corresponds to the given column position in a\n string, taking extending characters and tab size into account. By\n default, the string length is returned when it is too short to\n reach the column. Pass `strict` true to make it return -1 in that\n situation.\n */\n function findColumn(string, col, tabSize, strict) {\n for (let i = 0, n = 0;;) {\n if (n >= col)\n return i;\n if (i == string.length)\n break;\n n += string.charCodeAt(i) == 9 ? tabSize - (n % tabSize) : 1;\n i = findClusterBreak(string, i);\n }\n return strict === true ? -1 : string.length;\n }\n\n const C = \"\\u037c\";\n const COUNT = typeof Symbol == \"undefined\" ? \"__\" + C : Symbol.for(C);\n const SET = typeof Symbol == \"undefined\" ? \"__styleSet\" + Math.floor(Math.random() * 1e8) : Symbol(\"styleSet\");\n const top = typeof globalThis != \"undefined\" ? globalThis : typeof window != \"undefined\" ? window : {};\n\n // :: - Style modules encapsulate a set of CSS rules defined from\n // JavaScript. Their definitions are only available in a given DOM\n // root after it has been _mounted_ there with `StyleModule.mount`.\n //\n // Style modules should be created once and stored somewhere, as\n // opposed to re-creating them every time you need them. The amount of\n // CSS rules generated for a given DOM root is bounded by the amount\n // of style modules that were used. So to avoid leaking rules, don't\n // create these dynamically, but treat them as one-time allocations.\n class StyleModule {\n // :: (Object<Style>, ?{finish: ?(string) \u2192 string})\n // Create a style module from the given spec.\n //\n // When `finish` is given, it is called on regular (non-`@`)\n // selectors (after `&` expansion) to compute the final selector.\n constructor(spec, options) {\n this.rules = [];\n let {finish} = options || {};\n\n function splitSelector(selector) {\n return /^@/.test(selector) ? [selector] : selector.split(/,\\s*/)\n }\n\n function render(selectors, spec, target, isKeyframes) {\n let local = [], isAt = /^@(\\w+)\\b/.exec(selectors[0]), keyframes = isAt && isAt[1] == \"keyframes\";\n if (isAt && spec == null) return target.push(selectors[0] + \";\")\n for (let prop in spec) {\n let value = spec[prop];\n if (/&/.test(prop)) {\n render(prop.split(/,\\s*/).map(part => selectors.map(sel => part.replace(/&/, sel))).reduce((a, b) => a.concat(b)),\n value, target);\n } else if (value && typeof value == \"object\") {\n if (!isAt) throw new RangeError(\"The value of a property (\" + prop + \") should be a primitive value.\")\n render(splitSelector(prop), value, local, keyframes);\n } else if (value != null) {\n local.push(prop.replace(/_.*/, \"\").replace(/[A-Z]/g, l => \"-\" + l.toLowerCase()) + \": \" + value + \";\");\n }\n }\n if (local.length || keyframes) {\n target.push((finish && !isAt && !isKeyframes ? selectors.map(finish) : selectors).join(\", \") +\n \" {\" + local.join(\" \") + \"}\");\n }\n }\n\n for (let prop in spec) render(splitSelector(prop), spec[prop], this.rules);\n }\n\n // :: () \u2192 string\n // Returns a string containing the module's CSS rules.\n getRules() { return this.rules.join(\"\\n\") }\n\n // :: () \u2192 string\n // Generate a new unique CSS class name.\n static newName() {\n let id = top[COUNT] || 1;\n top[COUNT] = id + 1;\n return C + id.toString(36)\n }\n\n // :: (union<Document, ShadowRoot>, union<[StyleModule], StyleModule>, ?{nonce: ?string})\n //\n // Mount the given set of modules in the given DOM root, which ensures\n // that the CSS rules defined by the module are available in that\n // context.\n //\n // Rules are only added to the document once per root.\n //\n // Rule order will follow the order of the modules, so that rules from\n // modules later in the array take precedence of those from earlier\n // modules. If you call this function multiple times for the same root\n // in a way that changes the order of already mounted modules, the old\n // order will be changed.\n //\n // If a Content Security Policy nonce is provided, it is added to\n // the `<style>` tag generated by the library.\n static mount(root, modules, options) {\n let set = root[SET], nonce = options && options.nonce;\n if (!set) set = new StyleSet(root, nonce);\n else if (nonce) set.setNonce(nonce);\n set.mount(Array.isArray(modules) ? modules : [modules], root);\n }\n }\n\n let adoptedSet = new Map; //<Document, StyleSet>\n\n class StyleSet {\n constructor(root, nonce) {\n let doc = root.ownerDocument || root, win = doc.defaultView;\n if (!root.head && root.adoptedStyleSheets && win.CSSStyleSheet) {\n let adopted = adoptedSet.get(doc);\n if (adopted) return root[SET] = adopted\n this.sheet = new win.CSSStyleSheet;\n adoptedSet.set(doc, this);\n } else {\n this.styleTag = doc.createElement(\"style\");\n if (nonce) this.styleTag.setAttribute(\"nonce\", nonce);\n }\n this.modules = [];\n root[SET] = this;\n }\n\n mount(modules, root) {\n let sheet = this.sheet;\n let pos = 0 /* Current rule offset */, j = 0; /* Index into this.modules */\n for (let i = 0; i < modules.length; i++) {\n let mod = modules[i], index = this.modules.indexOf(mod);\n if (index < j && index > -1) { // Ordering conflict\n this.modules.splice(index, 1);\n j--;\n index = -1;\n }\n if (index == -1) {\n this.modules.splice(j++, 0, mod);\n if (sheet) for (let k = 0; k < mod.rules.length; k++)\n sheet.insertRule(mod.rules[k], pos++);\n } else {\n while (j < index) pos += this.modules[j++].rules.length;\n pos += mod.rules.length;\n j++;\n }\n }\n\n if (sheet) {\n if (root.adoptedStyleSheets.indexOf(this.sheet) < 0)\n root.adoptedStyleSheets = [this.sheet, ...root.adoptedStyleSheets];\n } else {\n let text = \"\";\n for (let i = 0; i < this.modules.length; i++)\n text += this.modules[i].getRules() + \"\\n\";\n this.styleTag.textContent = text;\n let target = root.head || root;\n if (this.styleTag.parentNode != target)\n target.insertBefore(this.styleTag, target.firstChild);\n }\n }\n\n setNonce(nonce) {\n if (this.styleTag && this.styleTag.getAttribute(\"nonce\") != nonce)\n this.styleTag.setAttribute(\"nonce\", nonce);\n }\n }\n\n // Style::Object<union<Style,string>>\n //\n // A style is an object that, in the simple case, maps CSS property\n // names to strings holding their values, as in `{color: \"red\",\n // fontWeight: \"bold\"}`. The property names can be given in\n // camel-case\u2014the library will insert a dash before capital letters\n // when converting them to CSS.\n //\n // If you include an underscore in a property name, it and everything\n // after it will be removed from the output, which can be useful when\n // providing a property multiple times, for browser compatibility\n // reasons.\n //\n // A property in a style object can also be a sub-selector, which\n // extends the current context to add a pseudo-selector or a child\n // selector. Such a property should contain a `&` character, which\n // will be replaced by the current selector. For example `{\"&:before\":\n // {content: '\"hi\"'}}`. Sub-selectors and regular properties can\n // freely be mixed in a given object. Any property containing a `&` is\n // assumed to be a sub-selector.\n //\n // Finally, a property can specify an @-block to be wrapped around the\n // styles defined inside the object that's the property's value. For\n // example to create a media query you can do `{\"@media screen and\n // (min-width: 400px)\": {...}}`.\n\n var base = {\n 8: \"Backspace\",\n 9: \"Tab\",\n 10: \"Enter\",\n 12: \"NumLock\",\n 13: \"Enter\",\n 16: \"Shift\",\n 17: \"Control\",\n 18: \"Alt\",\n 20: \"CapsLock\",\n 27: \"Escape\",\n 32: \" \",\n 33: \"PageUp\",\n 34: \"PageDown\",\n 35: \"End\",\n 36: \"Home\",\n 37: \"ArrowLeft\",\n 38: \"ArrowUp\",\n 39: \"ArrowRight\",\n 40: \"ArrowDown\",\n 44: \"PrintScreen\",\n 45: \"Insert\",\n 46: \"Delete\",\n 59: \";\",\n 61: \"=\",\n 91: \"Meta\",\n 92: \"Meta\",\n 106: \"*\",\n 107: \"+\",\n 108: \",\",\n 109: \"-\",\n 110: \".\",\n 111: \"/\",\n 144: \"NumLock\",\n 145: \"ScrollLock\",\n 160: \"Shift\",\n 161: \"Shift\",\n 162: \"Control\",\n 163: \"Control\",\n 164: \"Alt\",\n 165: \"Alt\",\n 173: \"-\",\n 186: \";\",\n 187: \"=\",\n 188: \",\",\n 189: \"-\",\n 190: \".\",\n 191: \"/\",\n 192: \"`\",\n 219: \"[\",\n 220: \"\\\\\",\n 221: \"]\",\n 222: \"'\"\n };\n\n var shift = {\n 48: \")\",\n 49: \"!\",\n 50: \"@\",\n 51: \"#\",\n 52: \"$\",\n 53: \"%\",\n 54: \"^\",\n 55: \"&\",\n 56: \"*\",\n 57: \"(\",\n 59: \":\",\n 61: \"+\",\n 173: \"_\",\n 186: \":\",\n 187: \"+\",\n 188: \"<\",\n 189: \"_\",\n 190: \">\",\n 191: \"?\",\n 192: \"~\",\n 219: \"{\",\n 220: \"|\",\n 221: \"}\",\n 222: \"\\\"\"\n };\n\n var mac = typeof navigator != \"undefined\" && /Mac/.test(navigator.platform);\n var ie$1 = typeof navigator != \"undefined\" && /MSIE \\d|Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(navigator.userAgent);\n\n // Fill in the digit keys\n for (var i = 0; i < 10; i++) base[48 + i] = base[96 + i] = String(i);\n\n // The function keys\n for (var i = 1; i <= 24; i++) base[i + 111] = \"F\" + i;\n\n // And the alphabetic keys\n for (var i = 65; i <= 90; i++) {\n base[i] = String.fromCharCode(i + 32);\n shift[i] = String.fromCharCode(i);\n }\n\n // For each code that doesn't have a shift-equivalent, copy the base name\n for (var code$1 in base) if (!shift.hasOwnProperty(code$1)) shift[code$1] = base[code$1];\n\n function keyName(event) {\n // On macOS, keys held with Shift and Cmd don't reflect the effect of Shift in `.key`.\n // On IE, shift effect is never included in `.key`.\n var ignoreKey = mac && event.metaKey && event.shiftKey && !event.ctrlKey && !event.altKey ||\n ie$1 && event.shiftKey && event.key && event.key.length == 1 ||\n event.key == \"Unidentified\";\n var name = (!ignoreKey && event.key) ||\n (event.shiftKey ? shift : base)[event.keyCode] ||\n event.key || \"Unidentified\";\n // Edge sometimes produces wrong names (Issue #3)\n if (name == \"Esc\") name = \"Escape\";\n if (name == \"Del\") name = \"Delete\";\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8860571/\n if (name == \"Left\") name = \"ArrowLeft\";\n if (name == \"Up\") name = \"ArrowUp\";\n if (name == \"Right\") name = \"ArrowRight\";\n if (name == \"Down\") name = \"ArrowDown\";\n return name\n }\n\n function getSelection(root) {\n let target;\n // Browsers differ on whether shadow roots have a getSelection\n // method. If it exists, use that, otherwise, call it on the\n // document.\n if (root.nodeType == 11) { // Shadow root\n target = root.getSelection ? root : root.ownerDocument;\n }\n else {\n target = root;\n }\n return target.getSelection();\n }\n function contains$1(dom, node) {\n return node ? dom == node || dom.contains(node.nodeType != 1 ? node.parentNode : node) : false;\n }\n function deepActiveElement(doc) {\n let elt = doc.activeElement;\n while (elt && elt.shadowRoot)\n elt = elt.shadowRoot.activeElement;\n return elt;\n }\n function hasSelection(dom, selection) {\n if (!selection.anchorNode)\n return false;\n try {\n // Firefox will raise 'permission denied' errors when accessing\n // properties of `sel.anchorNode` when it's in a generated CSS\n // element.\n return contains$1(dom, selection.anchorNode);\n }\n catch (_) {\n return false;\n }\n }\n function clientRectsFor(dom) {\n if (dom.nodeType == 3)\n return textRange(dom, 0, dom.nodeValue.length).getClientRects();\n else if (dom.nodeType == 1)\n return dom.getClientRects();\n else\n return [];\n }\n // Scans forward and backward through DOM positions equivalent to the\n // given one to see if the two are in the same place (i.e. after a\n // text node vs at the end of that text node)\n function isEquivalentPosition(node, off, targetNode, targetOff) {\n return targetNode ? (scanFor(node, off, targetNode, targetOff, -1) ||\n scanFor(node, off, targetNode, targetOff, 1)) : false;\n }\n function domIndex(node) {\n for (var index = 0;; index++) {\n node = node.previousSibling;\n if (!node)\n return index;\n }\n }\n function isBlockElement(node) {\n return node.nodeType == 1 && /^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\\d|SECTION|PRE)$/.test(node.nodeName);\n }\n function scanFor(node, off, targetNode, targetOff, dir) {\n for (;;) {\n if (node == targetNode && off == targetOff)\n return true;\n if (off == (dir < 0 ? 0 : maxOffset(node))) {\n if (node.nodeName == \"DIV\")\n return false;\n let parent = node.parentNode;\n if (!parent || parent.nodeType != 1)\n return false;\n off = domIndex(node) + (dir < 0 ? 0 : 1);\n node = parent;\n }\n else if (node.nodeType == 1) {\n node = node.childNodes[off + (dir < 0 ? -1 : 0)];\n if (node.nodeType == 1 && node.contentEditable == \"false\")\n return false;\n off = dir < 0 ? maxOffset(node) : 0;\n }\n else {\n return false;\n }\n }\n }\n function maxOffset(node) {\n return node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length;\n }\n function flattenRect(rect, left) {\n let x = left ? rect.left : rect.right;\n return { left: x, right: x, top: rect.top, bottom: rect.bottom };\n }\n function windowRect(win) {\n let vp = win.visualViewport;\n if (vp)\n return {\n left: 0, right: vp.width,\n top: 0, bottom: vp.height\n };\n return { left: 0, right: win.innerWidth,\n top: 0, bottom: win.innerHeight };\n }\n function getScale(elt, rect) {\n let scaleX = rect.width / elt.offsetWidth;\n let scaleY = rect.height / elt.offsetHeight;\n if (scaleX > 0.995 && scaleX < 1.005 || !isFinite(scaleX) || Math.abs(rect.width - elt.offsetWidth) < 1)\n scaleX = 1;\n if (scaleY > 0.995 && scaleY < 1.005 || !isFinite(scaleY) || Math.abs(rect.height - elt.offsetHeight) < 1)\n scaleY = 1;\n return { scaleX, scaleY };\n }\n function scrollRectIntoView(dom, rect, side, x, y, xMargin, yMargin, ltr) {\n let doc = dom.ownerDocument, win = doc.defaultView || window;\n for (let cur = dom, stop = false; cur && !stop;) {\n if (cur.nodeType == 1) { // Element\n let bounding, top = cur == doc.body;\n let scaleX = 1, scaleY = 1;\n if (top) {\n bounding = windowRect(win);\n }\n else {\n if (/^(fixed|sticky)$/.test(getComputedStyle(cur).position))\n stop = true;\n if (cur.scrollHeight <= cur.clientHeight && cur.scrollWidth <= cur.clientWidth) {\n cur = cur.assignedSlot || cur.parentNode;\n continue;\n }\n let rect = cur.getBoundingClientRect();\n ({ scaleX, scaleY } = getScale(cur, rect));\n // Make sure scrollbar width isn't included in the rectangle\n bounding = { left: rect.left, right: rect.left + cur.clientWidth * scaleX,\n top: rect.top, bottom: rect.top + cur.clientHeight * scaleY };\n }\n let moveX = 0, moveY = 0;\n if (y == \"nearest\") {\n if (rect.top < bounding.top) {\n moveY = -(bounding.top - rect.top + yMargin);\n if (side > 0 && rect.bottom > bounding.bottom + moveY)\n moveY = rect.bottom - bounding.bottom + moveY + yMargin;\n }\n else if (rect.bottom > bounding.bottom) {\n moveY = rect.bottom - bounding.bottom + yMargin;\n if (side < 0 && (rect.top - moveY) < bounding.top)\n moveY = -(bounding.top + moveY - rect.top + yMargin);\n }\n }\n else {\n let rectHeight = rect.bottom - rect.top, boundingHeight = bounding.bottom - bounding.top;\n let targetTop = y == \"center\" && rectHeight <= boundingHeight ? rect.top + rectHeight / 2 - boundingHeight / 2 :\n y == \"start\" || y == \"center\" && side < 0 ? rect.top - yMargin :\n rect.bottom - boundingHeight + yMargin;\n moveY = targetTop - bounding.top;\n }\n if (x == \"nearest\") {\n if (rect.left < bounding.left) {\n moveX = -(bounding.left - rect.left + xMargin);\n if (side > 0 && rect.right > bounding.right + moveX)\n moveX = rect.right - bounding.right + moveX + xMargin;\n }\n else if (rect.right > bounding.right) {\n moveX = rect.right - bounding.right + xMargin;\n if (side < 0 && rect.left < bounding.left + moveX)\n moveX = -(bounding.left + moveX - rect.left + xMargin);\n }\n }\n else {\n let targetLeft = x == \"center\" ? rect.left + (rect.right - rect.left) / 2 - (bounding.right - bounding.left) / 2 :\n (x == \"start\") == ltr ? rect.left - xMargin :\n rect.right - (bounding.right - bounding.left) + xMargin;\n moveX = targetLeft - bounding.left;\n }\n if (moveX || moveY) {\n if (top) {\n win.scrollBy(moveX, moveY);\n }\n else {\n let movedX = 0, movedY = 0;\n if (moveY) {\n let start = cur.scrollTop;\n cur.scrollTop += moveY / scaleY;\n movedY = (cur.scrollTop - start) * scaleY;\n }\n if (moveX) {\n let start = cur.scrollLeft;\n cur.scrollLeft += moveX / scaleX;\n movedX = (cur.scrollLeft - start) * scaleX;\n }\n rect = { left: rect.left - movedX, top: rect.top - movedY,\n right: rect.right - movedX, bottom: rect.bottom - movedY };\n if (movedX && Math.abs(movedX - moveX) < 1)\n x = \"nearest\";\n if (movedY && Math.abs(movedY - moveY) < 1)\n y = \"nearest\";\n }\n }\n if (top)\n break;\n cur = cur.assignedSlot || cur.parentNode;\n }\n else if (cur.nodeType == 11) { // A shadow root\n cur = cur.host;\n }\n else {\n break;\n }\n }\n }\n function scrollableParents(dom) {\n let doc = dom.ownerDocument, x, y;\n for (let cur = dom.parentNode; cur;) {\n if (cur == doc.body || (x && y)) {\n break;\n }\n else if (cur.nodeType == 1) {\n if (!y && cur.scrollHeight > cur.clientHeight)\n y = cur;\n if (!x && cur.scrollWidth > cur.clientWidth)\n x = cur;\n cur = cur.assignedSlot || cur.parentNode;\n }\n else if (cur.nodeType == 11) {\n cur = cur.host;\n }\n else {\n break;\n }\n }\n return { x, y };\n }\n class DOMSelectionState {\n constructor() {\n this.anchorNode = null;\n this.anchorOffset = 0;\n this.focusNode = null;\n this.focusOffset = 0;\n }\n eq(domSel) {\n return this.anchorNode == domSel.anchorNode && this.anchorOffset == domSel.anchorOffset &&\n this.focusNode == domSel.focusNode && this.focusOffset == domSel.focusOffset;\n }\n setRange(range) {\n let { anchorNode, focusNode } = range;\n // Clip offsets to node size to avoid crashes when Safari reports bogus offsets (#1152)\n this.set(anchorNode, Math.min(range.anchorOffset, anchorNode ? maxOffset(anchorNode) : 0), focusNode, Math.min(range.focusOffset, focusNode ? maxOffset(focusNode) : 0));\n }\n set(anchorNode, anchorOffset, focusNode, focusOffset) {\n this.anchorNode = anchorNode;\n this.anchorOffset = anchorOffset;\n this.focusNode = focusNode;\n this.focusOffset = focusOffset;\n }\n }\n let preventScrollSupported = null;\n // Feature-detects support for .focus({preventScroll: true}), and uses\n // a fallback kludge when not supported.\n function focusPreventScroll(dom) {\n if (dom.setActive)\n return dom.setActive(); // in IE\n if (preventScrollSupported)\n return dom.focus(preventScrollSupported);\n let stack = [];\n for (let cur = dom; cur; cur = cur.parentNode) {\n stack.push(cur, cur.scrollTop, cur.scrollLeft);\n if (cur == cur.ownerDocument)\n break;\n }\n dom.focus(preventScrollSupported == null ? {\n get preventScroll() {\n preventScrollSupported = { preventScroll: true };\n return true;\n }\n } : undefined);\n if (!preventScrollSupported) {\n preventScrollSupported = false;\n for (let i = 0; i < stack.length;) {\n let elt = stack[i++], top = stack[i++], left = stack[i++];\n if (elt.scrollTop != top)\n elt.scrollTop = top;\n if (elt.scrollLeft != left)\n elt.scrollLeft = left;\n }\n }\n }\n let scratchRange;\n function textRange(node, from, to = from) {\n let range = scratchRange || (scratchRange = document.createRange());\n range.setEnd(node, to);\n range.setStart(node, from);\n return range;\n }\n function dispatchKey(elt, name, code, mods) {\n let options = { key: name, code: name, keyCode: code, which: code, cancelable: true };\n if (mods)\n ({ altKey: options.altKey, ctrlKey: options.ctrlKey, shiftKey: options.shiftKey, metaKey: options.metaKey } = mods);\n let down = new KeyboardEvent(\"keydown\", options);\n down.synthetic = true;\n elt.dispatchEvent(down);\n let up = new KeyboardEvent(\"keyup\", options);\n up.synthetic = true;\n elt.dispatchEvent(up);\n return down.defaultPrevented || up.defaultPrevented;\n }\n function getRoot(node) {\n while (node) {\n if (node && (node.nodeType == 9 || node.nodeType == 11 && node.host))\n return node;\n node = node.assignedSlot || node.parentNode;\n }\n return null;\n }\n function clearAttributes(node) {\n while (node.attributes.length)\n node.removeAttributeNode(node.attributes[0]);\n }\n function atElementStart(doc, selection) {\n let node = selection.focusNode, offset = selection.focusOffset;\n if (!node || selection.anchorNode != node || selection.anchorOffset != offset)\n return false;\n // Safari can report bogus offsets (#1152)\n offset = Math.min(offset, maxOffset(node));\n for (;;) {\n if (offset) {\n if (node.nodeType != 1)\n return false;\n let prev = node.childNodes[offset - 1];\n if (prev.contentEditable == \"false\")\n offset--;\n else {\n node = prev;\n offset = maxOffset(node);\n }\n }\n else if (node == doc) {\n return true;\n }\n else {\n offset = domIndex(node);\n node = node.parentNode;\n }\n }\n }\n function isScrolledToBottom(elt) {\n return elt.scrollTop > Math.max(1, elt.scrollHeight - elt.clientHeight - 4);\n }\n function textNodeBefore(startNode, startOffset) {\n for (let node = startNode, offset = startOffset;;) {\n if (node.nodeType == 3 && offset > 0) {\n return { node: node, offset: offset };\n }\n else if (node.nodeType == 1 && offset > 0) {\n if (node.contentEditable == \"false\")\n return null;\n node = node.childNodes[offset - 1];\n offset = maxOffset(node);\n }\n else if (node.parentNode && !isBlockElement(node)) {\n offset = domIndex(node);\n node = node.parentNode;\n }\n else {\n return null;\n }\n }\n }\n function textNodeAfter(startNode, startOffset) {\n for (let node = startNode, offset = startOffset;;) {\n if (node.nodeType == 3 && offset < node.nodeValue.length) {\n return { node: node, offset: offset };\n }\n else if (node.nodeType == 1 && offset < node.childNodes.length) {\n if (node.contentEditable == \"false\")\n return null;\n node = node.childNodes[offset];\n offset = 0;\n }\n else if (node.parentNode && !isBlockElement(node)) {\n offset = domIndex(node) + 1;\n node = node.parentNode;\n }\n else {\n return null;\n }\n }\n }\n\n class DOMPos {\n constructor(node, offset, precise = true) {\n this.node = node;\n this.offset = offset;\n this.precise = precise;\n }\n static before(dom, precise) { return new DOMPos(dom.parentNode, domIndex(dom), precise); }\n static after(dom, precise) { return new DOMPos(dom.parentNode, domIndex(dom) + 1, precise); }\n }\n const noChildren = [];\n class ContentView {\n constructor() {\n this.parent = null;\n this.dom = null;\n this.flags = 2 /* ViewFlag.NodeDirty */;\n }\n get overrideDOMText() { return null; }\n get posAtStart() {\n return this.parent ? this.parent.posBefore(this) : 0;\n }\n get posAtEnd() {\n return this.posAtStart + this.length;\n }\n posBefore(view) {\n let pos = this.posAtStart;\n for (let child of this.children) {\n if (child == view)\n return pos;\n pos += child.length + child.breakAfter;\n }\n throw new RangeError(\"Invalid child in posBefore\");\n }\n posAfter(view) {\n return this.posBefore(view) + view.length;\n }\n sync(view, track) {\n if (this.flags & 2 /* ViewFlag.NodeDirty */) {\n let parent = this.dom;\n let prev = null, next;\n for (let child of this.children) {\n if (child.flags & 7 /* ViewFlag.Dirty */) {\n if (!child.dom && (next = prev ? prev.nextSibling : parent.firstChild)) {\n let contentView = ContentView.get(next);\n if (!contentView || !contentView.parent && contentView.canReuseDOM(child))\n child.reuseDOM(next);\n }\n child.sync(view, track);\n child.flags &= ~7 /* ViewFlag.Dirty */;\n }\n next = prev ? prev.nextSibling : parent.firstChild;\n if (track && !track.written && track.node == parent && next != child.dom)\n track.written = true;\n if (child.dom.parentNode == parent) {\n while (next && next != child.dom)\n next = rm$1(next);\n }\n else {\n parent.insertBefore(child.dom, next);\n }\n prev = child.dom;\n }\n next = prev ? prev.nextSibling : parent.firstChild;\n if (next && track && track.node == parent)\n track.written = true;\n while (next)\n next = rm$1(next);\n }\n else if (this.flags & 1 /* ViewFlag.ChildDirty */) {\n for (let child of this.children)\n if (child.flags & 7 /* ViewFlag.Dirty */) {\n child.sync(view, track);\n child.flags &= ~7 /* ViewFlag.Dirty */;\n }\n }\n }\n reuseDOM(_dom) { }\n localPosFromDOM(node, offset) {\n let after;\n if (node == this.dom) {\n after = this.dom.childNodes[offset];\n }\n else {\n let bias = maxOffset(node) == 0 ? 0 : offset == 0 ? -1 : 1;\n for (;;) {\n let parent = node.parentNode;\n if (parent == this.dom)\n break;\n if (bias == 0 && parent.firstChild != parent.lastChild) {\n if (node == parent.firstChild)\n bias = -1;\n else\n bias = 1;\n }\n node = parent;\n }\n if (bias < 0)\n after = node;\n else\n after = node.nextSibling;\n }\n if (after == this.dom.firstChild)\n return 0;\n while (after && !ContentView.get(after))\n after = after.nextSibling;\n if (!after)\n return this.length;\n for (let i = 0, pos = 0;; i++) {\n let child = this.children[i];\n if (child.dom == after)\n return pos;\n pos += child.length + child.breakAfter;\n }\n }\n domBoundsAround(from, to, offset = 0) {\n let fromI = -1, fromStart = -1, toI = -1, toEnd = -1;\n for (let i = 0, pos = offset, prevEnd = offset; i < this.children.length; i++) {\n let child = this.children[i], end = pos + child.length;\n if (pos < from && end > to)\n return child.domBoundsAround(from, to, pos);\n if (end >= from && fromI == -1) {\n fromI = i;\n fromStart = pos;\n }\n if (pos > to && child.dom.parentNode == this.dom) {\n toI = i;\n toEnd = prevEnd;\n break;\n }\n prevEnd = end;\n pos = end + child.breakAfter;\n }\n return { from: fromStart, to: toEnd < 0 ? offset + this.length : toEnd,\n startDOM: (fromI ? this.children[fromI - 1].dom.nextSibling : null) || this.dom.firstChild,\n endDOM: toI < this.children.length && toI >= 0 ? this.children[toI].dom : null };\n }\n markDirty(andParent = false) {\n this.flags |= 2 /* ViewFlag.NodeDirty */;\n this.markParentsDirty(andParent);\n }\n markParentsDirty(childList) {\n for (let parent = this.parent; parent; parent = parent.parent) {\n if (childList)\n parent.flags |= 2 /* ViewFlag.NodeDirty */;\n if (parent.flags & 1 /* ViewFlag.ChildDirty */)\n return;\n parent.flags |= 1 /* ViewFlag.ChildDirty */;\n childList = false;\n }\n }\n setParent(parent) {\n if (this.parent != parent) {\n this.parent = parent;\n if (this.flags & 7 /* ViewFlag.Dirty */)\n this.markParentsDirty(true);\n }\n }\n setDOM(dom) {\n if (this.dom == dom)\n return;\n if (this.dom)\n this.dom.cmView = null;\n this.dom = dom;\n dom.cmView = this;\n }\n get rootView() {\n for (let v = this;;) {\n let parent = v.parent;\n if (!parent)\n return v;\n v = parent;\n }\n }\n replaceChildren(from, to, children = noChildren) {\n this.markDirty();\n for (let i = from; i < to; i++) {\n let child = this.children[i];\n if (child.parent == this && children.indexOf(child) < 0)\n child.destroy();\n }\n this.children.splice(from, to - from, ...children);\n for (let i = 0; i < children.length; i++)\n children[i].setParent(this);\n }\n ignoreMutation(_rec) { return false; }\n ignoreEvent(_event) { return false; }\n childCursor(pos = this.length) {\n return new ChildCursor(this.children, pos, this.children.length);\n }\n childPos(pos, bias = 1) {\n return this.childCursor().findPos(pos, bias);\n }\n toString() {\n let name = this.constructor.name.replace(\"View\", \"\");\n return name + (this.children.length ? \"(\" + this.children.join() + \")\" :\n this.length ? \"[\" + (name == \"Text\" ? this.text : this.length) + \"]\" : \"\") +\n (this.breakAfter ? \"#\" : \"\");\n }\n static get(node) { return node.cmView; }\n get isEditable() { return true; }\n get isWidget() { return false; }\n get isHidden() { return false; }\n merge(from, to, source, hasStart, openStart, openEnd) {\n return false;\n }\n become(other) { return false; }\n canReuseDOM(other) {\n return other.constructor == this.constructor && !((this.flags | other.flags) & 8 /* ViewFlag.Composition */);\n }\n // When this is a zero-length view with a side, this should return a\n // number <= 0 to indicate it is before its position, or a\n // number > 0 when after its position.\n getSide() { return 0; }\n destroy() {\n for (let child of this.children)\n if (child.parent == this)\n child.destroy();\n this.parent = null;\n }\n }\n ContentView.prototype.breakAfter = 0;\n // Remove a DOM node and return its next sibling.\n function rm$1(dom) {\n let next = dom.nextSibling;\n dom.parentNode.removeChild(dom);\n return next;\n }\n class ChildCursor {\n constructor(children, pos, i) {\n this.children = children;\n this.pos = pos;\n this.i = i;\n this.off = 0;\n }\n findPos(pos, bias = 1) {\n for (;;) {\n if (pos > this.pos || pos == this.pos &&\n (bias > 0 || this.i == 0 || this.children[this.i - 1].breakAfter)) {\n this.off = pos - this.pos;\n return this;\n }\n let next = this.children[--this.i];\n this.pos -= next.length + next.breakAfter;\n }\n }\n }\n function replaceRange(parent, fromI, fromOff, toI, toOff, insert, breakAtStart, openStart, openEnd) {\n let { children } = parent;\n let before = children.length ? children[fromI] : null;\n let last = insert.length ? insert[insert.length - 1] : null;\n let breakAtEnd = last ? last.breakAfter : breakAtStart;\n // Change within a single child\n if (fromI == toI && before && !breakAtStart && !breakAtEnd && insert.length < 2 &&\n before.merge(fromOff, toOff, insert.length ? last : null, fromOff == 0, openStart, openEnd))\n return;\n if (toI < children.length) {\n let after = children[toI];\n // Make sure the end of the child after the update is preserved in `after`\n if (after && (toOff < after.length || after.breakAfter && (last === null || last === void 0 ? void 0 : last.breakAfter))) {\n // If we're splitting a child, separate part of it to avoid that\n // being mangled when updating the child before the update.\n if (fromI == toI) {\n after = after.split(toOff);\n toOff = 0;\n }\n // If the element after the replacement should be merged with\n // the last replacing element, update `content`\n if (!breakAtEnd && last && after.merge(0, toOff, last, true, 0, openEnd)) {\n insert[insert.length - 1] = after;\n }\n else {\n // Remove the start of the after element, if necessary, and\n // add it to `content`.\n if (toOff || after.children.length && !after.children[0].length)\n after.merge(0, toOff, null, false, 0, openEnd);\n insert.push(after);\n }\n }\n else if (after === null || after === void 0 ? void 0 : after.breakAfter) {\n // The element at `toI` is entirely covered by this range.\n // Preserve its line break, if any.\n if (last)\n last.breakAfter = 1;\n else\n breakAtStart = 1;\n }\n // Since we've handled the next element from the current elements\n // now, make sure `toI` points after that.\n toI++;\n }\n if (before) {\n before.breakAfter = breakAtStart;\n if (fromOff > 0) {\n if (!breakAtStart && insert.length && before.merge(fromOff, before.length, insert[0], false, openStart, 0)) {\n before.breakAfter = insert.shift().breakAfter;\n }\n else if (fromOff < before.length || before.children.length && before.children[before.children.length - 1].length == 0) {\n before.merge(fromOff, before.length, null, false, openStart, 0);\n }\n fromI++;\n }\n }\n // Try to merge widgets on the boundaries of the replacement\n while (fromI < toI && insert.length) {\n if (children[toI - 1].become(insert[insert.length - 1])) {\n toI--;\n insert.pop();\n openEnd = insert.length ? 0 : openStart;\n }\n else if (children[fromI].become(insert[0])) {\n fromI++;\n insert.shift();\n openStart = insert.length ? 0 : openEnd;\n }\n else {\n break;\n }\n }\n if (!insert.length && fromI && toI < children.length && !children[fromI - 1].breakAfter &&\n children[toI].merge(0, 0, children[fromI - 1], false, openStart, openEnd))\n fromI--;\n if (fromI < toI || insert.length)\n parent.replaceChildren(fromI, toI, insert);\n }\n function mergeChildrenInto(parent, from, to, insert, openStart, openEnd) {\n let cur = parent.childCursor();\n let { i: toI, off: toOff } = cur.findPos(to, 1);\n let { i: fromI, off: fromOff } = cur.findPos(from, -1);\n let dLen = from - to;\n for (let view of insert)\n dLen += view.length;\n parent.length += dLen;\n replaceRange(parent, fromI, fromOff, toI, toOff, insert, 0, openStart, openEnd);\n }\n\n let nav = typeof navigator != \"undefined\" ? navigator : { userAgent: \"\", vendor: \"\", platform: \"\" };\n let doc = typeof document != \"undefined\" ? document : { documentElement: { style: {} } };\n const ie_edge = /*@__PURE__*//Edge\\/(\\d+)/.exec(nav.userAgent);\n const ie_upto10 = /*@__PURE__*//MSIE \\d/.test(nav.userAgent);\n const ie_11up = /*@__PURE__*//Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(nav.userAgent);\n const ie = !!(ie_upto10 || ie_11up || ie_edge);\n const gecko = !ie && /*@__PURE__*//gecko\\/(\\d+)/i.test(nav.userAgent);\n const chrome = !ie && /*@__PURE__*//Chrome\\/(\\d+)/.exec(nav.userAgent);\n const webkit = \"webkitFontSmoothing\" in doc.documentElement.style;\n const safari = !ie && /*@__PURE__*//Apple Computer/.test(nav.vendor);\n const ios = safari && (/*@__PURE__*//Mobile\\/\\w+/.test(nav.userAgent) || nav.maxTouchPoints > 2);\n var browser = {\n mac: ios || /*@__PURE__*//Mac/.test(nav.platform),\n windows: /*@__PURE__*//Win/.test(nav.platform),\n linux: /*@__PURE__*//Linux|X11/.test(nav.platform),\n ie,\n ie_version: ie_upto10 ? doc.documentMode || 6 : ie_11up ? +ie_11up[1] : ie_edge ? +ie_edge[1] : 0,\n gecko,\n gecko_version: gecko ? +(/*@__PURE__*//Firefox\\/(\\d+)/.exec(nav.userAgent) || [0, 0])[1] : 0,\n chrome: !!chrome,\n chrome_version: chrome ? +chrome[1] : 0,\n ios,\n android: /*@__PURE__*//Android\\b/.test(nav.userAgent),\n webkit,\n safari,\n webkit_version: webkit ? +(/*@__PURE__*//\\bAppleWebKit\\/(\\d+)/.exec(nav.userAgent) || [0, 0])[1] : 0,\n tabSize: doc.documentElement.style.tabSize != null ? \"tab-size\" : \"-moz-tab-size\"\n };\n\n const MaxJoinLen = 256;\n class TextView extends ContentView {\n constructor(text) {\n super();\n this.text = text;\n }\n get length() { return this.text.length; }\n createDOM(textDOM) {\n this.setDOM(textDOM || document.createTextNode(this.text));\n }\n sync(view, track) {\n if (!this.dom)\n this.createDOM();\n if (this.dom.nodeValue != this.text) {\n if (track && track.node == this.dom)\n track.written = true;\n this.dom.nodeValue = this.text;\n }\n }\n reuseDOM(dom) {\n if (dom.nodeType == 3)\n this.createDOM(dom);\n }\n merge(from, to, source) {\n if ((this.flags & 8 /* ViewFlag.Composition */) ||\n source && (!(source instanceof TextView) ||\n this.length - (to - from) + source.length > MaxJoinLen ||\n (source.flags & 8 /* ViewFlag.Composition */)))\n return false;\n this.text = this.text.slice(0, from) + (source ? source.text : \"\") + this.text.slice(to);\n this.markDirty();\n return true;\n }\n split(from) {\n let result = new TextView(this.text.slice(from));\n this.text = this.text.slice(0, from);\n this.markDirty();\n result.flags |= this.flags & 8 /* ViewFlag.Composition */;\n return result;\n }\n localPosFromDOM(node, offset) {\n return node == this.dom ? offset : offset ? this.text.length : 0;\n }\n domAtPos(pos) { return new DOMPos(this.dom, pos); }\n domBoundsAround(_from, _to, offset) {\n return { from: offset, to: offset + this.length, startDOM: this.dom, endDOM: this.dom.nextSibling };\n }\n coordsAt(pos, side) {\n return textCoords(this.dom, pos, side);\n }\n }\n class MarkView extends ContentView {\n constructor(mark, children = [], length = 0) {\n super();\n this.mark = mark;\n this.children = children;\n this.length = length;\n for (let ch of children)\n ch.setParent(this);\n }\n setAttrs(dom) {\n clearAttributes(dom);\n if (this.mark.class)\n dom.className = this.mark.class;\n if (this.mark.attrs)\n for (let name in this.mark.attrs)\n dom.setAttribute(name, this.mark.attrs[name]);\n return dom;\n }\n canReuseDOM(other) {\n return super.canReuseDOM(other) && !((this.flags | other.flags) & 8 /* ViewFlag.Composition */);\n }\n reuseDOM(node) {\n if (node.nodeName == this.mark.tagName.toUpperCase()) {\n this.setDOM(node);\n this.flags |= 4 /* ViewFlag.AttrsDirty */ | 2 /* ViewFlag.NodeDirty */;\n }\n }\n sync(view, track) {\n if (!this.dom)\n this.setDOM(this.setAttrs(document.createElement(this.mark.tagName)));\n else if (this.flags & 4 /* ViewFlag.AttrsDirty */)\n this.setAttrs(this.dom);\n super.sync(view, track);\n }\n merge(from, to, source, _hasStart, openStart, openEnd) {\n if (source && (!(source instanceof MarkView && source.mark.eq(this.mark)) ||\n (from && openStart <= 0) || (to < this.length && openEnd <= 0)))\n return false;\n mergeChildrenInto(this, from, to, source ? source.children.slice() : [], openStart - 1, openEnd - 1);\n this.markDirty();\n return true;\n }\n split(from) {\n let result = [], off = 0, detachFrom = -1, i = 0;\n for (let elt of this.children) {\n let end = off + elt.length;\n if (end > from)\n result.push(off < from ? elt.split(from - off) : elt);\n if (detachFrom < 0 && off >= from)\n detachFrom = i;\n off = end;\n i++;\n }\n let length = this.length - from;\n this.length = from;\n if (detachFrom > -1) {\n this.children.length = detachFrom;\n this.markDirty();\n }\n return new MarkView(this.mark, result, length);\n }\n domAtPos(pos) {\n return inlineDOMAtPos(this, pos);\n }\n coordsAt(pos, side) {\n return coordsInChildren(this, pos, side);\n }\n }\n function textCoords(text, pos, side) {\n let length = text.nodeValue.length;\n if (pos > length)\n pos = length;\n let from = pos, to = pos, flatten = 0;\n if (pos == 0 && side < 0 || pos == length && side >= 0) {\n if (!(browser.chrome || browser.gecko)) { // These browsers reliably return valid rectangles for empty ranges\n if (pos) {\n from--;\n flatten = 1;\n } // FIXME this is wrong in RTL text\n else if (to < length) {\n to++;\n flatten = -1;\n }\n }\n }\n else {\n if (side < 0)\n from--;\n else if (to < length)\n to++;\n }\n let rects = textRange(text, from, to).getClientRects();\n if (!rects.length)\n return null;\n let rect = rects[(flatten ? flatten < 0 : side >= 0) ? 0 : rects.length - 1];\n if (browser.safari && !flatten && rect.width == 0)\n rect = Array.prototype.find.call(rects, r => r.width) || rect;\n return flatten ? flattenRect(rect, flatten < 0) : rect || null;\n }\n // Also used for collapsed ranges that don't have a placeholder widget!\n class WidgetView extends ContentView {\n static create(widget, length, side) {\n return new WidgetView(widget, length, side);\n }\n constructor(widget, length, side) {\n super();\n this.widget = widget;\n this.length = length;\n this.side = side;\n this.prevWidget = null;\n }\n split(from) {\n let result = WidgetView.create(this.widget, this.length - from, this.side);\n this.length -= from;\n return result;\n }\n sync(view) {\n if (!this.dom || !this.widget.updateDOM(this.dom, view)) {\n if (this.dom && this.prevWidget)\n this.prevWidget.destroy(this.dom);\n this.prevWidget = null;\n this.setDOM(this.widget.toDOM(view));\n if (!this.widget.editable)\n this.dom.contentEditable = \"false\";\n }\n }\n getSide() { return this.side; }\n merge(from, to, source, hasStart, openStart, openEnd) {\n if (source && (!(source instanceof WidgetView) || !this.widget.compare(source.widget) ||\n from > 0 && openStart <= 0 || to < this.length && openEnd <= 0))\n return false;\n this.length = from + (source ? source.length : 0) + (this.length - to);\n return true;\n }\n become(other) {\n if (other instanceof WidgetView && other.side == this.side &&\n this.widget.constructor == other.widget.constructor) {\n if (!this.widget.compare(other.widget))\n this.markDirty(true);\n if (this.dom && !this.prevWidget)\n this.prevWidget = this.widget;\n this.widget = other.widget;\n this.length = other.length;\n return true;\n }\n return false;\n }\n ignoreMutation() { return true; }\n ignoreEvent(event) { return this.widget.ignoreEvent(event); }\n get overrideDOMText() {\n if (this.length == 0)\n return Text.empty;\n let top = this;\n while (top.parent)\n top = top.parent;\n let { view } = top, text = view && view.state.doc, start = this.posAtStart;\n return text ? text.slice(start, start + this.length) : Text.empty;\n }\n domAtPos(pos) {\n return (this.length ? pos == 0 : this.side > 0)\n ? DOMPos.before(this.dom)\n : DOMPos.after(this.dom, pos == this.length);\n }\n domBoundsAround() { return null; }\n coordsAt(pos, side) {\n let custom = this.widget.coordsAt(this.dom, pos, side);\n if (custom)\n return custom;\n let rects = this.dom.getClientRects(), rect = null;\n if (!rects.length)\n return null;\n let fromBack = this.side ? this.side < 0 : pos > 0;\n for (let i = fromBack ? rects.length - 1 : 0;; i += (fromBack ? -1 : 1)) {\n rect = rects[i];\n if (pos > 0 ? i == 0 : i == rects.length - 1 || rect.top < rect.bottom)\n break;\n }\n return flattenRect(rect, !fromBack);\n }\n get isEditable() { return false; }\n get isWidget() { return true; }\n get isHidden() { return this.widget.isHidden; }\n destroy() {\n super.destroy();\n if (this.dom)\n this.widget.destroy(this.dom);\n }\n }\n // These are drawn around uneditable widgets to avoid a number of\n // browser bugs that show up when the cursor is directly next to\n // uneditable inline content.\n class WidgetBufferView extends ContentView {\n constructor(side) {\n super();\n this.side = side;\n }\n get length() { return 0; }\n merge() { return false; }\n become(other) {\n return other instanceof WidgetBufferView && other.side == this.side;\n }\n split() { return new WidgetBufferView(this.side); }\n sync() {\n if (!this.dom) {\n let dom = document.createElement(\"img\");\n dom.className = \"cm-widgetBuffer\";\n dom.setAttribute(\"aria-hidden\", \"true\");\n this.setDOM(dom);\n }\n }\n getSide() { return this.side; }\n domAtPos(pos) { return this.side > 0 ? DOMPos.before(this.dom) : DOMPos.after(this.dom); }\n localPosFromDOM() { return 0; }\n domBoundsAround() { return null; }\n coordsAt(pos) {\n return this.dom.getBoundingClientRect();\n }\n get overrideDOMText() {\n return Text.empty;\n }\n get isHidden() { return true; }\n }\n TextView.prototype.children = WidgetView.prototype.children = WidgetBufferView.prototype.children = noChildren;\n function inlineDOMAtPos(parent, pos) {\n let dom = parent.dom, { children } = parent, i = 0;\n for (let off = 0; i < children.length; i++) {\n let child = children[i], end = off + child.length;\n if (end == off && child.getSide() <= 0)\n continue;\n if (pos > off && pos < end && child.dom.parentNode == dom)\n return child.domAtPos(pos - off);\n if (pos <= off)\n break;\n off = end;\n }\n for (let j = i; j > 0; j--) {\n let prev = children[j - 1];\n if (prev.dom.parentNode == dom)\n return prev.domAtPos(prev.length);\n }\n for (let j = i; j < children.length; j++) {\n let next = children[j];\n if (next.dom.parentNode == dom)\n return next.domAtPos(0);\n }\n return new DOMPos(dom, 0);\n }\n // Assumes `view`, if a mark view, has precisely 1 child.\n function joinInlineInto(parent, view, open) {\n let last, { children } = parent;\n if (open > 0 && view instanceof MarkView && children.length &&\n (last = children[children.length - 1]) instanceof MarkView && last.mark.eq(view.mark)) {\n joinInlineInto(last, view.children[0], open - 1);\n }\n else {\n children.push(view);\n view.setParent(parent);\n }\n parent.length += view.length;\n }\n function coordsInChildren(view, pos, side) {\n let before = null, beforePos = -1, after = null, afterPos = -1;\n function scan(view, pos) {\n for (let i = 0, off = 0; i < view.children.length && off <= pos; i++) {\n let child = view.children[i], end = off + child.length;\n if (end >= pos) {\n if (child.children.length) {\n scan(child, pos - off);\n }\n else if ((!after || after.isHidden && side > 0) &&\n (end > pos || off == end && child.getSide() > 0)) {\n after = child;\n afterPos = pos - off;\n }\n else if (off < pos || (off == end && child.getSide() < 0) && !child.isHidden) {\n before = child;\n beforePos = pos - off;\n }\n }\n off = end;\n }\n }\n scan(view, pos);\n let target = (side < 0 ? before : after) || before || after;\n if (target)\n return target.coordsAt(Math.max(0, target == before ? beforePos : afterPos), side);\n return fallbackRect(view);\n }\n function fallbackRect(view) {\n let last = view.dom.lastChild;\n if (!last)\n return view.dom.getBoundingClientRect();\n let rects = clientRectsFor(last);\n return rects[rects.length - 1] || null;\n }\n\n function combineAttrs(source, target) {\n for (let name in source) {\n if (name == \"class\" && target.class)\n target.class += \" \" + source.class;\n else if (name == \"style\" && target.style)\n target.style += \";\" + source.style;\n else\n target[name] = source[name];\n }\n return target;\n }\n const noAttrs$1 = /*@__PURE__*/Object.create(null);\n function attrsEq(a, b, ignore) {\n if (a == b)\n return true;\n if (!a)\n a = noAttrs$1;\n if (!b)\n b = noAttrs$1;\n let keysA = Object.keys(a), keysB = Object.keys(b);\n if (keysA.length - (ignore && keysA.indexOf(ignore) > -1 ? 1 : 0) !=\n keysB.length - (ignore && keysB.indexOf(ignore) > -1 ? 1 : 0))\n return false;\n for (let key of keysA) {\n if (key != ignore && (keysB.indexOf(key) == -1 || a[key] !== b[key]))\n return false;\n }\n return true;\n }\n function updateAttrs(dom, prev, attrs) {\n let changed = false;\n if (prev)\n for (let name in prev)\n if (!(attrs && name in attrs)) {\n changed = true;\n if (name == \"style\")\n dom.style.cssText = \"\";\n else\n dom.removeAttribute(name);\n }\n if (attrs)\n for (let name in attrs)\n if (!(prev && prev[name] == attrs[name])) {\n changed = true;\n if (name == \"style\")\n dom.style.cssText = attrs[name];\n else\n dom.setAttribute(name, attrs[name]);\n }\n return changed;\n }\n function getAttrs$1(dom) {\n let attrs = Object.create(null);\n for (let i = 0; i < dom.attributes.length; i++) {\n let attr = dom.attributes[i];\n attrs[attr.name] = attr.value;\n }\n return attrs;\n }\n\n class LineView extends ContentView {\n constructor() {\n super(...arguments);\n this.children = [];\n this.length = 0;\n this.prevAttrs = undefined;\n this.attrs = null;\n this.breakAfter = 0;\n }\n // Consumes source\n merge(from, to, source, hasStart, openStart, openEnd) {\n if (source) {\n if (!(source instanceof LineView))\n return false;\n if (!this.dom)\n source.transferDOM(this); // Reuse source.dom when appropriate\n }\n if (hasStart)\n this.setDeco(source ? source.attrs : null);\n mergeChildrenInto(this, from, to, source ? source.children.slice() : [], openStart, openEnd);\n return true;\n }\n split(at) {\n let end = new LineView;\n end.breakAfter = this.breakAfter;\n if (this.length == 0)\n return end;\n let { i, off } = this.childPos(at);\n if (off) {\n end.append(this.children[i].split(off), 0);\n this.children[i].merge(off, this.children[i].length, null, false, 0, 0);\n i++;\n }\n for (let j = i; j < this.children.length; j++)\n end.append(this.children[j], 0);\n while (i > 0 && this.children[i - 1].length == 0)\n this.children[--i].destroy();\n this.children.length = i;\n this.markDirty();\n this.length = at;\n return end;\n }\n transferDOM(other) {\n if (!this.dom)\n return;\n this.markDirty();\n other.setDOM(this.dom);\n other.prevAttrs = this.prevAttrs === undefined ? this.attrs : this.prevAttrs;\n this.prevAttrs = undefined;\n this.dom = null;\n }\n setDeco(attrs) {\n if (!attrsEq(this.attrs, attrs)) {\n if (this.dom) {\n this.prevAttrs = this.attrs;\n this.markDirty();\n }\n this.attrs = attrs;\n }\n }\n append(child, openStart) {\n joinInlineInto(this, child, openStart);\n }\n // Only called when building a line view in ContentBuilder\n addLineDeco(deco) {\n let attrs = deco.spec.attributes, cls = deco.spec.class;\n if (attrs)\n this.attrs = combineAttrs(attrs, this.attrs || {});\n if (cls)\n this.attrs = combineAttrs({ class: cls }, this.attrs || {});\n }\n domAtPos(pos) {\n return inlineDOMAtPos(this, pos);\n }\n reuseDOM(node) {\n if (node.nodeName == \"DIV\") {\n this.setDOM(node);\n this.flags |= 4 /* ViewFlag.AttrsDirty */ | 2 /* ViewFlag.NodeDirty */;\n }\n }\n sync(view, track) {\n var _a;\n if (!this.dom) {\n this.setDOM(document.createElement(\"div\"));\n this.dom.className = \"cm-line\";\n this.prevAttrs = this.attrs ? null : undefined;\n }\n else if (this.flags & 4 /* ViewFlag.AttrsDirty */) {\n clearAttributes(this.dom);\n this.dom.className = \"cm-line\";\n this.prevAttrs = this.attrs ? null : undefined;\n }\n if (this.prevAttrs !== undefined) {\n updateAttrs(this.dom, this.prevAttrs, this.attrs);\n this.dom.classList.add(\"cm-line\");\n this.prevAttrs = undefined;\n }\n super.sync(view, track);\n let last = this.dom.lastChild;\n while (last && ContentView.get(last) instanceof MarkView)\n last = last.lastChild;\n if (!last || !this.length ||\n last.nodeName != \"BR\" && ((_a = ContentView.get(last)) === null || _a === void 0 ? void 0 : _a.isEditable) == false &&\n (!browser.ios || !this.children.some(ch => ch instanceof TextView))) {\n let hack = document.createElement(\"BR\");\n hack.cmIgnore = true;\n this.dom.appendChild(hack);\n }\n }\n measureTextSize() {\n if (this.children.length == 0 || this.length > 20)\n return null;\n let totalWidth = 0, textHeight;\n for (let child of this.children) {\n if (!(child instanceof TextView) || /[^ -~]/.test(child.text))\n return null;\n let rects = clientRectsFor(child.dom);\n if (rects.length != 1)\n return null;\n totalWidth += rects[0].width;\n textHeight = rects[0].height;\n }\n return !totalWidth ? null : {\n lineHeight: this.dom.getBoundingClientRect().height,\n charWidth: totalWidth / this.length,\n textHeight\n };\n }\n coordsAt(pos, side) {\n let rect = coordsInChildren(this, pos, side);\n // Correct rectangle height for empty lines when the returned\n // height is larger than the text height.\n if (!this.children.length && rect && this.parent) {\n let { heightOracle } = this.parent.view.viewState, height = rect.bottom - rect.top;\n if (Math.abs(height - heightOracle.lineHeight) < 2 && heightOracle.textHeight < height) {\n let dist = (height - heightOracle.textHeight) / 2;\n return { top: rect.top + dist, bottom: rect.bottom - dist, left: rect.left, right: rect.left };\n }\n }\n return rect;\n }\n become(other) {\n return other instanceof LineView && this.children.length == 0 && other.children.length == 0 &&\n attrsEq(this.attrs, other.attrs) && this.breakAfter == other.breakAfter;\n }\n covers() { return true; }\n static find(docView, pos) {\n for (let i = 0, off = 0; i < docView.children.length; i++) {\n let block = docView.children[i], end = off + block.length;\n if (end >= pos) {\n if (block instanceof LineView)\n return block;\n if (end > pos)\n break;\n }\n off = end + block.breakAfter;\n }\n return null;\n }\n }\n class BlockWidgetView extends ContentView {\n constructor(widget, length, deco) {\n super();\n this.widget = widget;\n this.length = length;\n this.deco = deco;\n this.breakAfter = 0;\n this.prevWidget = null;\n }\n merge(from, to, source, _takeDeco, openStart, openEnd) {\n if (source && (!(source instanceof BlockWidgetView) || !this.widget.compare(source.widget) ||\n from > 0 && openStart <= 0 || to < this.length && openEnd <= 0))\n return false;\n this.length = from + (source ? source.length : 0) + (this.length - to);\n return true;\n }\n domAtPos(pos) {\n return pos == 0 ? DOMPos.before(this.dom) : DOMPos.after(this.dom, pos == this.length);\n }\n split(at) {\n let len = this.length - at;\n this.length = at;\n let end = new BlockWidgetView(this.widget, len, this.deco);\n end.breakAfter = this.breakAfter;\n return end;\n }\n get children() { return noChildren; }\n sync(view) {\n if (!this.dom || !this.widget.updateDOM(this.dom, view)) {\n if (this.dom && this.prevWidget)\n this.prevWidget.destroy(this.dom);\n this.prevWidget = null;\n this.setDOM(this.widget.toDOM(view));\n if (!this.widget.editable)\n this.dom.contentEditable = \"false\";\n }\n }\n get overrideDOMText() {\n return this.parent ? this.parent.view.state.doc.slice(this.posAtStart, this.posAtEnd) : Text.empty;\n }\n domBoundsAround() { return null; }\n become(other) {\n if (other instanceof BlockWidgetView &&\n other.widget.constructor == this.widget.constructor) {\n if (!other.widget.compare(this.widget))\n this.markDirty(true);\n if (this.dom && !this.prevWidget)\n this.prevWidget = this.widget;\n this.widget = other.widget;\n this.length = other.length;\n this.deco = other.deco;\n this.breakAfter = other.breakAfter;\n return true;\n }\n return false;\n }\n ignoreMutation() { return true; }\n ignoreEvent(event) { return this.widget.ignoreEvent(event); }\n get isEditable() { return false; }\n get isWidget() { return true; }\n coordsAt(pos, side) {\n return this.widget.coordsAt(this.dom, pos, side);\n }\n destroy() {\n super.destroy();\n if (this.dom)\n this.widget.destroy(this.dom);\n }\n covers(side) {\n let { startSide, endSide } = this.deco;\n return startSide == endSide ? false : side < 0 ? startSide < 0 : endSide > 0;\n }\n }\n\n /**\n Widgets added to the content are described by subclasses of this\n class. Using a description object like that makes it possible to\n delay creating of the DOM structure for a widget until it is\n needed, and to avoid redrawing widgets even if the decorations\n that define them are recreated.\n */\n class WidgetType {\n /**\n Compare this instance to another instance of the same type.\n (TypeScript can't express this, but only instances of the same\n specific class will be passed to this method.) This is used to\n avoid redrawing widgets when they are replaced by a new\n decoration of the same type. The default implementation just\n returns `false`, which will cause new instances of the widget to\n always be redrawn.\n */\n eq(widget) { return false; }\n /**\n Update a DOM element created by a widget of the same type (but\n different, non-`eq` content) to reflect this widget. May return\n true to indicate that it could update, false to indicate it\n couldn't (in which case the widget will be redrawn). The default\n implementation just returns false.\n */\n updateDOM(dom, view) { return false; }\n /**\n @internal\n */\n compare(other) {\n return this == other || this.constructor == other.constructor && this.eq(other);\n }\n /**\n The estimated height this widget will have, to be used when\n estimating the height of content that hasn't been drawn. May\n return -1 to indicate you don't know. The default implementation\n returns -1.\n */\n get estimatedHeight() { return -1; }\n /**\n For inline widgets that are displayed inline (as opposed to\n `inline-block`) and introduce line breaks (through `<br>` tags\n or textual newlines), this must indicate the amount of line\n breaks they introduce. Defaults to 0.\n */\n get lineBreaks() { return 0; }\n /**\n Can be used to configure which kinds of events inside the widget\n should be ignored by the editor. The default is to ignore all\n events.\n */\n ignoreEvent(event) { return true; }\n /**\n Override the way screen coordinates for positions at/in the\n widget are found. `pos` will be the offset into the widget, and\n `side` the side of the position that is being queried\u2014less than\n zero for before, greater than zero for after, and zero for\n directly at that position.\n */\n coordsAt(dom, pos, side) { return null; }\n /**\n @internal\n */\n get isHidden() { return false; }\n /**\n @internal\n */\n get editable() { return false; }\n /**\n This is called when the an instance of the widget is removed\n from the editor view.\n */\n destroy(dom) { }\n }\n /**\n The different types of blocks that can occur in an editor view.\n */\n var BlockType = /*@__PURE__*/(function (BlockType) {\n /**\n A line of text.\n */\n BlockType[BlockType[\"Text\"] = 0] = \"Text\";\n /**\n A block widget associated with the position after it.\n */\n BlockType[BlockType[\"WidgetBefore\"] = 1] = \"WidgetBefore\";\n /**\n A block widget associated with the position before it.\n */\n BlockType[BlockType[\"WidgetAfter\"] = 2] = \"WidgetAfter\";\n /**\n A block widget [replacing](https://codemirror.net/6/docs/ref/#view.Decoration^replace) a range of content.\n */\n BlockType[BlockType[\"WidgetRange\"] = 3] = \"WidgetRange\";\n return BlockType})(BlockType || (BlockType = {}));\n /**\n A decoration provides information on how to draw or style a piece\n of content. You'll usually use it wrapped in a\n [`Range`](https://codemirror.net/6/docs/ref/#state.Range), which adds a start and end position.\n @nonabstract\n */\n class Decoration extends RangeValue {\n constructor(\n /**\n @internal\n */\n startSide, \n /**\n @internal\n */\n endSide, \n /**\n @internal\n */\n widget, \n /**\n The config object used to create this decoration. You can\n include additional properties in there to store metadata about\n your decoration.\n */\n spec) {\n super();\n this.startSide = startSide;\n this.endSide = endSide;\n this.widget = widget;\n this.spec = spec;\n }\n /**\n @internal\n */\n get heightRelevant() { return false; }\n /**\n Create a mark decoration, which influences the styling of the\n content in its range. Nested mark decorations will cause nested\n DOM elements to be created. Nesting order is determined by\n precedence of the [facet](https://codemirror.net/6/docs/ref/#view.EditorView^decorations), with\n the higher-precedence decorations creating the inner DOM nodes.\n Such elements are split on line boundaries and on the boundaries\n of lower-precedence decorations.\n */\n static mark(spec) {\n return new MarkDecoration(spec);\n }\n /**\n Create a widget decoration, which displays a DOM element at the\n given position.\n */\n static widget(spec) {\n let side = Math.max(-10000, Math.min(10000, spec.side || 0)), block = !!spec.block;\n side += (block && !spec.inlineOrder)\n ? (side > 0 ? 300000000 /* Side.BlockAfter */ : -400000000 /* Side.BlockBefore */)\n : (side > 0 ? 100000000 /* Side.InlineAfter */ : -100000000 /* Side.InlineBefore */);\n return new PointDecoration(spec, side, side, block, spec.widget || null, false);\n }\n /**\n Create a replace decoration which replaces the given range with\n a widget, or simply hides it.\n */\n static replace(spec) {\n let block = !!spec.block, startSide, endSide;\n if (spec.isBlockGap) {\n startSide = -500000000 /* Side.GapStart */;\n endSide = 400000000 /* Side.GapEnd */;\n }\n else {\n let { start, end } = getInclusive(spec, block);\n startSide = (start ? (block ? -300000000 /* Side.BlockIncStart */ : -1 /* Side.InlineIncStart */) : 500000000 /* Side.NonIncStart */) - 1;\n endSide = (end ? (block ? 200000000 /* Side.BlockIncEnd */ : 1 /* Side.InlineIncEnd */) : -600000000 /* Side.NonIncEnd */) + 1;\n }\n return new PointDecoration(spec, startSide, endSide, block, spec.widget || null, true);\n }\n /**\n Create a line decoration, which can add DOM attributes to the\n line starting at the given position.\n */\n static line(spec) {\n return new LineDecoration(spec);\n }\n /**\n Build a [`DecorationSet`](https://codemirror.net/6/docs/ref/#view.DecorationSet) from the given\n decorated range or ranges. If the ranges aren't already sorted,\n pass `true` for `sort` to make the library sort them for you.\n */\n static set(of, sort = false) {\n return RangeSet.of(of, sort);\n }\n /**\n @internal\n */\n hasHeight() { return this.widget ? this.widget.estimatedHeight > -1 : false; }\n }\n /**\n The empty set of decorations.\n */\n Decoration.none = RangeSet.empty;\n class MarkDecoration extends Decoration {\n constructor(spec) {\n let { start, end } = getInclusive(spec);\n super(start ? -1 /* Side.InlineIncStart */ : 500000000 /* Side.NonIncStart */, end ? 1 /* Side.InlineIncEnd */ : -600000000 /* Side.NonIncEnd */, null, spec);\n this.tagName = spec.tagName || \"span\";\n this.class = spec.class || \"\";\n this.attrs = spec.attributes || null;\n }\n eq(other) {\n var _a, _b;\n return this == other ||\n other instanceof MarkDecoration &&\n this.tagName == other.tagName &&\n (this.class || ((_a = this.attrs) === null || _a === void 0 ? void 0 : _a.class)) == (other.class || ((_b = other.attrs) === null || _b === void 0 ? void 0 : _b.class)) &&\n attrsEq(this.attrs, other.attrs, \"class\");\n }\n range(from, to = from) {\n if (from >= to)\n throw new RangeError(\"Mark decorations may not be empty\");\n return super.range(from, to);\n }\n }\n MarkDecoration.prototype.point = false;\n class LineDecoration extends Decoration {\n constructor(spec) {\n super(-200000000 /* Side.Line */, -200000000 /* Side.Line */, null, spec);\n }\n eq(other) {\n return other instanceof LineDecoration &&\n this.spec.class == other.spec.class &&\n attrsEq(this.spec.attributes, other.spec.attributes);\n }\n range(from, to = from) {\n if (to != from)\n throw new RangeError(\"Line decoration ranges must be zero-length\");\n return super.range(from, to);\n }\n }\n LineDecoration.prototype.mapMode = MapMode.TrackBefore;\n LineDecoration.prototype.point = true;\n class PointDecoration extends Decoration {\n constructor(spec, startSide, endSide, block, widget, isReplace) {\n super(startSide, endSide, widget, spec);\n this.block = block;\n this.isReplace = isReplace;\n this.mapMode = !block ? MapMode.TrackDel : startSide <= 0 ? MapMode.TrackBefore : MapMode.TrackAfter;\n }\n // Only relevant when this.block == true\n get type() {\n return this.startSide != this.endSide ? BlockType.WidgetRange\n : this.startSide <= 0 ? BlockType.WidgetBefore : BlockType.WidgetAfter;\n }\n get heightRelevant() {\n return this.block || !!this.widget && (this.widget.estimatedHeight >= 5 || this.widget.lineBreaks > 0);\n }\n eq(other) {\n return other instanceof PointDecoration &&\n widgetsEq(this.widget, other.widget) &&\n this.block == other.block &&\n this.startSide == other.startSide && this.endSide == other.endSide;\n }\n range(from, to = from) {\n if (this.isReplace && (from > to || (from == to && this.startSide > 0 && this.endSide <= 0)))\n throw new RangeError(\"Invalid range for replacement decoration\");\n if (!this.isReplace && to != from)\n throw new RangeError(\"Widget decorations can only have zero-length ranges\");\n return super.range(from, to);\n }\n }\n PointDecoration.prototype.point = true;\n function getInclusive(spec, block = false) {\n let { inclusiveStart: start, inclusiveEnd: end } = spec;\n if (start == null)\n start = spec.inclusive;\n if (end == null)\n end = spec.inclusive;\n return { start: start !== null && start !== void 0 ? start : block, end: end !== null && end !== void 0 ? end : block };\n }\n function widgetsEq(a, b) {\n return a == b || !!(a && b && a.compare(b));\n }\n function addRange(from, to, ranges, margin = 0) {\n let last = ranges.length - 1;\n if (last >= 0 && ranges[last] + margin >= from)\n ranges[last] = Math.max(ranges[last], to);\n else\n ranges.push(from, to);\n }\n\n class ContentBuilder {\n constructor(doc, pos, end, disallowBlockEffectsFor) {\n this.doc = doc;\n this.pos = pos;\n this.end = end;\n this.disallowBlockEffectsFor = disallowBlockEffectsFor;\n this.content = [];\n this.curLine = null;\n this.breakAtStart = 0;\n this.pendingBuffer = 0 /* Buf.No */;\n this.bufferMarks = [];\n // Set to false directly after a widget that covers the position after it\n this.atCursorPos = true;\n this.openStart = -1;\n this.openEnd = -1;\n this.text = \"\";\n this.textOff = 0;\n this.cursor = doc.iter();\n this.skip = pos;\n }\n posCovered() {\n if (this.content.length == 0)\n return !this.breakAtStart && this.doc.lineAt(this.pos).from != this.pos;\n let last = this.content[this.content.length - 1];\n return !(last.breakAfter || last instanceof BlockWidgetView && last.deco.endSide < 0);\n }\n getLine() {\n if (!this.curLine) {\n this.content.push(this.curLine = new LineView);\n this.atCursorPos = true;\n }\n return this.curLine;\n }\n flushBuffer(active = this.bufferMarks) {\n if (this.pendingBuffer) {\n this.curLine.append(wrapMarks(new WidgetBufferView(-1), active), active.length);\n this.pendingBuffer = 0 /* Buf.No */;\n }\n }\n addBlockWidget(view) {\n this.flushBuffer();\n this.curLine = null;\n this.content.push(view);\n }\n finish(openEnd) {\n if (this.pendingBuffer && openEnd <= this.bufferMarks.length)\n this.flushBuffer();\n else\n this.pendingBuffer = 0 /* Buf.No */;\n if (!this.posCovered() &&\n !(openEnd && this.content.length && this.content[this.content.length - 1] instanceof BlockWidgetView))\n this.getLine();\n }\n buildText(length, active, openStart) {\n while (length > 0) {\n if (this.textOff == this.text.length) {\n let { value, lineBreak, done } = this.cursor.next(this.skip);\n this.skip = 0;\n if (done)\n throw new Error(\"Ran out of text content when drawing inline views\");\n if (lineBreak) {\n if (!this.posCovered())\n this.getLine();\n if (this.content.length)\n this.content[this.content.length - 1].breakAfter = 1;\n else\n this.breakAtStart = 1;\n this.flushBuffer();\n this.curLine = null;\n this.atCursorPos = true;\n length--;\n continue;\n }\n else {\n this.text = value;\n this.textOff = 0;\n }\n }\n let take = Math.min(this.text.length - this.textOff, length, 512 /* T.Chunk */);\n this.flushBuffer(active.slice(active.length - openStart));\n this.getLine().append(wrapMarks(new TextView(this.text.slice(this.textOff, this.textOff + take)), active), openStart);\n this.atCursorPos = true;\n this.textOff += take;\n length -= take;\n openStart = 0;\n }\n }\n span(from, to, active, openStart) {\n this.buildText(to - from, active, openStart);\n this.pos = to;\n if (this.openStart < 0)\n this.openStart = openStart;\n }\n point(from, to, deco, active, openStart, index) {\n if (this.disallowBlockEffectsFor[index] && deco instanceof PointDecoration) {\n if (deco.block)\n throw new RangeError(\"Block decorations may not be specified via plugins\");\n if (to > this.doc.lineAt(this.pos).to)\n throw new RangeError(\"Decorations that replace line breaks may not be specified via plugins\");\n }\n let len = to - from;\n if (deco instanceof PointDecoration) {\n if (deco.block) {\n if (deco.startSide > 0 && !this.posCovered())\n this.getLine();\n this.addBlockWidget(new BlockWidgetView(deco.widget || NullWidget.block, len, deco));\n }\n else {\n let view = WidgetView.create(deco.widget || NullWidget.inline, len, len ? 0 : deco.startSide);\n let cursorBefore = this.atCursorPos && !view.isEditable && openStart <= active.length &&\n (from < to || deco.startSide > 0);\n let cursorAfter = !view.isEditable && (from < to || openStart > active.length || deco.startSide <= 0);\n let line = this.getLine();\n if (this.pendingBuffer == 2 /* Buf.IfCursor */ && !cursorBefore && !view.isEditable)\n this.pendingBuffer = 0 /* Buf.No */;\n this.flushBuffer(active);\n if (cursorBefore) {\n line.append(wrapMarks(new WidgetBufferView(1), active), openStart);\n openStart = active.length + Math.max(0, openStart - active.length);\n }\n line.append(wrapMarks(view, active), openStart);\n this.atCursorPos = cursorAfter;\n this.pendingBuffer = !cursorAfter ? 0 /* Buf.No */ : from < to || openStart > active.length ? 1 /* Buf.Yes */ : 2 /* Buf.IfCursor */;\n if (this.pendingBuffer)\n this.bufferMarks = active.slice();\n }\n }\n else if (this.doc.lineAt(this.pos).from == this.pos) { // Line decoration\n this.getLine().addLineDeco(deco);\n }\n if (len) {\n // Advance the iterator past the replaced content\n if (this.textOff + len <= this.text.length) {\n this.textOff += len;\n }\n else {\n this.skip += len - (this.text.length - this.textOff);\n this.text = \"\";\n this.textOff = 0;\n }\n this.pos = to;\n }\n if (this.openStart < 0)\n this.openStart = openStart;\n }\n static build(text, from, to, decorations, dynamicDecorationMap) {\n let builder = new ContentBuilder(text, from, to, dynamicDecorationMap);\n builder.openEnd = RangeSet.spans(decorations, from, to, builder);\n if (builder.openStart < 0)\n builder.openStart = builder.openEnd;\n builder.finish(builder.openEnd);\n return builder;\n }\n }\n function wrapMarks(view, active) {\n for (let mark of active)\n view = new MarkView(mark, [view], view.length);\n return view;\n }\n class NullWidget extends WidgetType {\n constructor(tag) {\n super();\n this.tag = tag;\n }\n eq(other) { return other.tag == this.tag; }\n toDOM() { return document.createElement(this.tag); }\n updateDOM(elt) { return elt.nodeName.toLowerCase() == this.tag; }\n get isHidden() { return true; }\n }\n NullWidget.inline = /*@__PURE__*/new NullWidget(\"span\");\n NullWidget.block = /*@__PURE__*/new NullWidget(\"div\");\n\n /**\n Used to indicate [text direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection).\n */\n var Direction = /*@__PURE__*/(function (Direction) {\n // (These are chosen to match the base levels, in bidi algorithm\n // terms, of spans in that direction.)\n /**\n Left-to-right.\n */\n Direction[Direction[\"LTR\"] = 0] = \"LTR\";\n /**\n Right-to-left.\n */\n Direction[Direction[\"RTL\"] = 1] = \"RTL\";\n return Direction})(Direction || (Direction = {}));\n const LTR = Direction.LTR, RTL = Direction.RTL;\n // Decode a string with each type encoded as log2(type)\n function dec(str) {\n let result = [];\n for (let i = 0; i < str.length; i++)\n result.push(1 << +str[i]);\n return result;\n }\n // Character types for codepoints 0 to 0xf8\n const LowTypes = /*@__PURE__*/dec(\"88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008\");\n // Character types for codepoints 0x600 to 0x6f9\n const ArabicTypes = /*@__PURE__*/dec(\"4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333\");\n const Brackets = /*@__PURE__*/Object.create(null), BracketStack = [];\n // There's a lot more in\n // https://www.unicode.org/Public/UCD/latest/ucd/BidiBrackets.txt,\n // which are left out to keep code size down.\n for (let p of [\"()\", \"[]\", \"{}\"]) {\n let l = /*@__PURE__*/p.charCodeAt(0), r = /*@__PURE__*/p.charCodeAt(1);\n Brackets[l] = r;\n Brackets[r] = -l;\n }\n function charType(ch) {\n return ch <= 0xf7 ? LowTypes[ch] :\n 0x590 <= ch && ch <= 0x5f4 ? 2 /* T.R */ :\n 0x600 <= ch && ch <= 0x6f9 ? ArabicTypes[ch - 0x600] :\n 0x6ee <= ch && ch <= 0x8ac ? 4 /* T.AL */ :\n 0x2000 <= ch && ch <= 0x200c ? 256 /* T.NI */ :\n 0xfb50 <= ch && ch <= 0xfdff ? 4 /* T.AL */ : 1 /* T.L */;\n }\n const BidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac\\ufb50-\\ufdff]/;\n /**\n Represents a contiguous range of text that has a single direction\n (as in left-to-right or right-to-left).\n */\n class BidiSpan {\n /**\n The direction of this span.\n */\n get dir() { return this.level % 2 ? RTL : LTR; }\n /**\n @internal\n */\n constructor(\n /**\n The start of the span (relative to the start of the line).\n */\n from, \n /**\n The end of the span.\n */\n to, \n /**\n The [\"bidi\n level\"](https://unicode.org/reports/tr9/#Basic_Display_Algorithm)\n of the span (in this context, 0 means\n left-to-right, 1 means right-to-left, 2 means left-to-right\n number inside right-to-left text).\n */\n level) {\n this.from = from;\n this.to = to;\n this.level = level;\n }\n /**\n @internal\n */\n side(end, dir) { return (this.dir == dir) == end ? this.to : this.from; }\n /**\n @internal\n */\n forward(forward, dir) { return forward == (this.dir == dir); }\n /**\n @internal\n */\n static find(order, index, level, assoc) {\n let maybe = -1;\n for (let i = 0; i < order.length; i++) {\n let span = order[i];\n if (span.from <= index && span.to >= index) {\n if (span.level == level)\n return i;\n // When multiple spans match, if assoc != 0, take the one that\n // covers that side, otherwise take the one with the minimum\n // level.\n if (maybe < 0 || (assoc != 0 ? (assoc < 0 ? span.from < index : span.to > index) : order[maybe].level > span.level))\n maybe = i;\n }\n }\n if (maybe < 0)\n throw new RangeError(\"Index out of range\");\n return maybe;\n }\n }\n function isolatesEq(a, b) {\n if (a.length != b.length)\n return false;\n for (let i = 0; i < a.length; i++) {\n let iA = a[i], iB = b[i];\n if (iA.from != iB.from || iA.to != iB.to || iA.direction != iB.direction || !isolatesEq(iA.inner, iB.inner))\n return false;\n }\n return true;\n }\n // Reused array of character types\n const types = [];\n // Fill in the character types (in `types`) from `from` to `to` and\n // apply W normalization rules.\n function computeCharTypes(line, rFrom, rTo, isolates, outerType) {\n for (let iI = 0; iI <= isolates.length; iI++) {\n let from = iI ? isolates[iI - 1].to : rFrom, to = iI < isolates.length ? isolates[iI].from : rTo;\n let prevType = iI ? 256 /* T.NI */ : outerType;\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n // (Left after this: L, R, EN, AN, ET, CS, NI)\n for (let i = from, prev = prevType, prevStrong = prevType; i < to; i++) {\n let type = charType(line.charCodeAt(i));\n if (type == 512 /* T.NSM */)\n type = prev;\n else if (type == 8 /* T.EN */ && prevStrong == 4 /* T.AL */)\n type = 16 /* T.AN */;\n types[i] = type == 4 /* T.AL */ ? 2 /* T.R */ : type;\n if (type & 7 /* T.Strong */)\n prevStrong = type;\n prev = type;\n }\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n // (Left after this: L, R, EN+AN, NI)\n for (let i = from, prev = prevType, prevStrong = prevType; i < to; i++) {\n let type = types[i];\n if (type == 128 /* T.CS */) {\n if (i < to - 1 && prev == types[i + 1] && (prev & 24 /* T.Num */))\n type = types[i] = prev;\n else\n types[i] = 256 /* T.NI */;\n }\n else if (type == 64 /* T.ET */) {\n let end = i + 1;\n while (end < to && types[end] == 64 /* T.ET */)\n end++;\n let replace = (i && prev == 8 /* T.EN */) || (end < rTo && types[end] == 8 /* T.EN */) ? (prevStrong == 1 /* T.L */ ? 1 /* T.L */ : 8 /* T.EN */) : 256 /* T.NI */;\n for (let j = i; j < end; j++)\n types[j] = replace;\n i = end - 1;\n }\n else if (type == 8 /* T.EN */ && prevStrong == 1 /* T.L */) {\n types[i] = 1 /* T.L */;\n }\n prev = type;\n if (type & 7 /* T.Strong */)\n prevStrong = type;\n }\n }\n }\n // Process brackets throughout a run sequence.\n function processBracketPairs(line, rFrom, rTo, isolates, outerType) {\n let oppositeType = outerType == 1 /* T.L */ ? 2 /* T.R */ : 1 /* T.L */;\n for (let iI = 0, sI = 0, context = 0; iI <= isolates.length; iI++) {\n let from = iI ? isolates[iI - 1].to : rFrom, to = iI < isolates.length ? isolates[iI].from : rTo;\n // N0. Process bracket pairs in an isolating run sequence\n // sequentially in the logical order of the text positions of the\n // opening paired brackets using the logic given below. Within this\n // scope, bidirectional types EN and AN are treated as R.\n for (let i = from, ch, br, type; i < to; i++) {\n // Keeps [startIndex, type, strongSeen] triples for each open\n // bracket on BracketStack.\n if (br = Brackets[ch = line.charCodeAt(i)]) {\n if (br < 0) { // Closing bracket\n for (let sJ = sI - 3; sJ >= 0; sJ -= 3) {\n if (BracketStack[sJ + 1] == -br) {\n let flags = BracketStack[sJ + 2];\n let type = (flags & 2 /* Bracketed.EmbedInside */) ? outerType :\n !(flags & 4 /* Bracketed.OppositeInside */) ? 0 :\n (flags & 1 /* Bracketed.OppositeBefore */) ? oppositeType : outerType;\n if (type)\n types[i] = types[BracketStack[sJ]] = type;\n sI = sJ;\n break;\n }\n }\n }\n else if (BracketStack.length == 189 /* Bracketed.MaxDepth */) {\n break;\n }\n else {\n BracketStack[sI++] = i;\n BracketStack[sI++] = ch;\n BracketStack[sI++] = context;\n }\n }\n else if ((type = types[i]) == 2 /* T.R */ || type == 1 /* T.L */) {\n let embed = type == outerType;\n context = embed ? 0 : 1 /* Bracketed.OppositeBefore */;\n for (let sJ = sI - 3; sJ >= 0; sJ -= 3) {\n let cur = BracketStack[sJ + 2];\n if (cur & 2 /* Bracketed.EmbedInside */)\n break;\n if (embed) {\n BracketStack[sJ + 2] |= 2 /* Bracketed.EmbedInside */;\n }\n else {\n if (cur & 4 /* Bracketed.OppositeInside */)\n break;\n BracketStack[sJ + 2] |= 4 /* Bracketed.OppositeInside */;\n }\n }\n }\n }\n }\n }\n function processNeutrals(rFrom, rTo, isolates, outerType) {\n for (let iI = 0, prev = outerType; iI <= isolates.length; iI++) {\n let from = iI ? isolates[iI - 1].to : rFrom, to = iI < isolates.length ? isolates[iI].from : rTo;\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n // (Left after this: L, R, EN+AN)\n for (let i = from; i < to;) {\n let type = types[i];\n if (type == 256 /* T.NI */) {\n let end = i + 1;\n for (;;) {\n if (end == to) {\n if (iI == isolates.length)\n break;\n end = isolates[iI++].to;\n to = iI < isolates.length ? isolates[iI].from : rTo;\n }\n else if (types[end] == 256 /* T.NI */) {\n end++;\n }\n else {\n break;\n }\n }\n let beforeL = prev == 1 /* T.L */;\n let afterL = (end < rTo ? types[end] : outerType) == 1 /* T.L */;\n let replace = beforeL == afterL ? (beforeL ? 1 /* T.L */ : 2 /* T.R */) : outerType;\n for (let j = end, jI = iI, fromJ = jI ? isolates[jI - 1].to : rFrom; j > i;) {\n if (j == fromJ) {\n j = isolates[--jI].from;\n fromJ = jI ? isolates[jI - 1].to : rFrom;\n }\n types[--j] = replace;\n }\n i = end;\n }\n else {\n prev = type;\n i++;\n }\n }\n }\n }\n // Find the contiguous ranges of character types in a given range, and\n // emit spans for them. Flip the order of the spans as appropriate\n // based on the level, and call through to compute the spans for\n // isolates at the proper point.\n function emitSpans(line, from, to, level, baseLevel, isolates, order) {\n let ourType = level % 2 ? 2 /* T.R */ : 1 /* T.L */;\n if ((level % 2) == (baseLevel % 2)) { // Same dir as base direction, don't flip\n for (let iCh = from, iI = 0; iCh < to;) {\n // Scan a section of characters in direction ourType, unless\n // there's another type of char right after iCh, in which case\n // we scan a section of other characters (which, if ourType ==\n // T.L, may contain both T.R and T.AN chars).\n let sameDir = true, isNum = false;\n if (iI == isolates.length || iCh < isolates[iI].from) {\n let next = types[iCh];\n if (next != ourType) {\n sameDir = false;\n isNum = next == 16 /* T.AN */;\n }\n }\n // Holds an array of isolates to pass to a recursive call if we\n // must recurse (to distinguish T.AN inside an RTL section in\n // LTR text), null if we can emit directly\n let recurse = !sameDir && ourType == 1 /* T.L */ ? [] : null;\n let localLevel = sameDir ? level : level + 1;\n let iScan = iCh;\n run: for (;;) {\n if (iI < isolates.length && iScan == isolates[iI].from) {\n if (isNum)\n break run;\n let iso = isolates[iI];\n // Scan ahead to verify that there is another char in this dir after the isolate(s)\n if (!sameDir)\n for (let upto = iso.to, jI = iI + 1;;) {\n if (upto == to)\n break run;\n if (jI < isolates.length && isolates[jI].from == upto)\n upto = isolates[jI++].to;\n else if (types[upto] == ourType)\n break run;\n else\n break;\n }\n iI++;\n if (recurse) {\n recurse.push(iso);\n }\n else {\n if (iso.from > iCh)\n order.push(new BidiSpan(iCh, iso.from, localLevel));\n let dirSwap = (iso.direction == LTR) != !(localLevel % 2);\n computeSectionOrder(line, dirSwap ? level + 1 : level, baseLevel, iso.inner, iso.from, iso.to, order);\n iCh = iso.to;\n }\n iScan = iso.to;\n }\n else if (iScan == to || (sameDir ? types[iScan] != ourType : types[iScan] == ourType)) {\n break;\n }\n else {\n iScan++;\n }\n }\n if (recurse)\n emitSpans(line, iCh, iScan, level + 1, baseLevel, recurse, order);\n else if (iCh < iScan)\n order.push(new BidiSpan(iCh, iScan, localLevel));\n iCh = iScan;\n }\n }\n else {\n // Iterate in reverse to flip the span order. Same code again, but\n // going from the back of the section to the front\n for (let iCh = to, iI = isolates.length; iCh > from;) {\n let sameDir = true, isNum = false;\n if (!iI || iCh > isolates[iI - 1].to) {\n let next = types[iCh - 1];\n if (next != ourType) {\n sameDir = false;\n isNum = next == 16 /* T.AN */;\n }\n }\n let recurse = !sameDir && ourType == 1 /* T.L */ ? [] : null;\n let localLevel = sameDir ? level : level + 1;\n let iScan = iCh;\n run: for (;;) {\n if (iI && iScan == isolates[iI - 1].to) {\n if (isNum)\n break run;\n let iso = isolates[--iI];\n // Scan ahead to verify that there is another char in this dir after the isolate(s)\n if (!sameDir)\n for (let upto = iso.from, jI = iI;;) {\n if (upto == from)\n break run;\n if (jI && isolates[jI - 1].to == upto)\n upto = isolates[--jI].from;\n else if (types[upto - 1] == ourType)\n break run;\n else\n break;\n }\n if (recurse) {\n recurse.push(iso);\n }\n else {\n if (iso.to < iCh)\n order.push(new BidiSpan(iso.to, iCh, localLevel));\n let dirSwap = (iso.direction == LTR) != !(localLevel % 2);\n computeSectionOrder(line, dirSwap ? level + 1 : level, baseLevel, iso.inner, iso.from, iso.to, order);\n iCh = iso.from;\n }\n iScan = iso.from;\n }\n else if (iScan == from || (sameDir ? types[iScan - 1] != ourType : types[iScan - 1] == ourType)) {\n break;\n }\n else {\n iScan--;\n }\n }\n if (recurse)\n emitSpans(line, iScan, iCh, level + 1, baseLevel, recurse, order);\n else if (iScan < iCh)\n order.push(new BidiSpan(iScan, iCh, localLevel));\n iCh = iScan;\n }\n }\n }\n function computeSectionOrder(line, level, baseLevel, isolates, from, to, order) {\n let outerType = (level % 2 ? 2 /* T.R */ : 1 /* T.L */);\n computeCharTypes(line, from, to, isolates, outerType);\n processBracketPairs(line, from, to, isolates, outerType);\n processNeutrals(from, to, isolates, outerType);\n emitSpans(line, from, to, level, baseLevel, isolates, order);\n }\n function computeOrder(line, direction, isolates) {\n if (!line)\n return [new BidiSpan(0, 0, direction == RTL ? 1 : 0)];\n if (direction == LTR && !isolates.length && !BidiRE.test(line))\n return trivialOrder(line.length);\n if (isolates.length)\n while (line.length > types.length)\n types[types.length] = 256 /* T.NI */; // Make sure types array has no gaps\n let order = [], level = direction == LTR ? 0 : 1;\n computeSectionOrder(line, level, level, isolates, 0, line.length, order);\n return order;\n }\n function trivialOrder(length) {\n return [new BidiSpan(0, length, 0)];\n }\n let movedOver = \"\";\n // This implementation moves strictly visually, without concern for a\n // traversal visiting every logical position in the string. It will\n // still do so for simple input, but situations like multiple isolates\n // with the same level next to each other, or text going against the\n // main dir at the end of the line, will make some positions\n // unreachable with this motion. Each visible cursor position will\n // correspond to the lower-level bidi span that touches it.\n //\n // The alternative would be to solve an order globally for a given\n // line, making sure that it includes every position, but that would\n // require associating non-canonical (higher bidi span level)\n // positions with a given visual position, which is likely to confuse\n // people. (And would generally be a lot more complicated.)\n function moveVisually(line, order, dir, start, forward) {\n var _a;\n let startIndex = start.head - line.from;\n let spanI = BidiSpan.find(order, startIndex, (_a = start.bidiLevel) !== null && _a !== void 0 ? _a : -1, start.assoc);\n let span = order[spanI], spanEnd = span.side(forward, dir);\n // End of span\n if (startIndex == spanEnd) {\n let nextI = spanI += forward ? 1 : -1;\n if (nextI < 0 || nextI >= order.length)\n return null;\n span = order[spanI = nextI];\n startIndex = span.side(!forward, dir);\n spanEnd = span.side(forward, dir);\n }\n let nextIndex = findClusterBreak(line.text, startIndex, span.forward(forward, dir));\n if (nextIndex < span.from || nextIndex > span.to)\n nextIndex = spanEnd;\n movedOver = line.text.slice(Math.min(startIndex, nextIndex), Math.max(startIndex, nextIndex));\n let nextSpan = spanI == (forward ? order.length - 1 : 0) ? null : order[spanI + (forward ? 1 : -1)];\n if (nextSpan && nextIndex == spanEnd && nextSpan.level + (forward ? 0 : 1) < span.level)\n return EditorSelection.cursor(nextSpan.side(!forward, dir) + line.from, nextSpan.forward(forward, dir) ? 1 : -1, nextSpan.level);\n return EditorSelection.cursor(nextIndex + line.from, span.forward(forward, dir) ? -1 : 1, span.level);\n }\n function autoDirection(text, from, to) {\n for (let i = from; i < to; i++) {\n let type = charType(text.charCodeAt(i));\n if (type == 1 /* T.L */)\n return LTR;\n if (type == 2 /* T.R */ || type == 4 /* T.AL */)\n return RTL;\n }\n return LTR;\n }\n\n const clickAddsSelectionRange = /*@__PURE__*/Facet.define();\n const dragMovesSelection$1 = /*@__PURE__*/Facet.define();\n const mouseSelectionStyle = /*@__PURE__*/Facet.define();\n const exceptionSink = /*@__PURE__*/Facet.define();\n const updateListener = /*@__PURE__*/Facet.define();\n const inputHandler$1 = /*@__PURE__*/Facet.define();\n const focusChangeEffect = /*@__PURE__*/Facet.define();\n const perLineTextDirection = /*@__PURE__*/Facet.define({\n combine: values => values.some(x => x)\n });\n const nativeSelectionHidden = /*@__PURE__*/Facet.define({\n combine: values => values.some(x => x)\n });\n const scrollHandler = /*@__PURE__*/Facet.define();\n class ScrollTarget {\n constructor(range, y = \"nearest\", x = \"nearest\", yMargin = 5, xMargin = 5, \n // This data structure is abused to also store precise scroll\n // snapshots, instead of a `scrollIntoView` request. When this\n // flag is `true`, `range` points at a position in the reference\n // line, `yMargin` holds the difference between the top of that\n // line and the top of the editor, and `xMargin` holds the\n // editor's `scrollLeft`.\n isSnapshot = false) {\n this.range = range;\n this.y = y;\n this.x = x;\n this.yMargin = yMargin;\n this.xMargin = xMargin;\n this.isSnapshot = isSnapshot;\n }\n map(changes) {\n return changes.empty ? this :\n new ScrollTarget(this.range.map(changes), this.y, this.x, this.yMargin, this.xMargin, this.isSnapshot);\n }\n clip(state) {\n return this.range.to <= state.doc.length ? this :\n new ScrollTarget(EditorSelection.cursor(state.doc.length), this.y, this.x, this.yMargin, this.xMargin, this.isSnapshot);\n }\n }\n const scrollIntoView$1 = /*@__PURE__*/StateEffect.define({ map: (t, ch) => t.map(ch) });\n const setEditContextFormatting = /*@__PURE__*/StateEffect.define();\n /**\n Log or report an unhandled exception in client code. Should\n probably only be used by extension code that allows client code to\n provide functions, and calls those functions in a context where an\n exception can't be propagated to calling code in a reasonable way\n (for example when in an event handler).\n\n Either calls a handler registered with\n [`EditorView.exceptionSink`](https://codemirror.net/6/docs/ref/#view.EditorView^exceptionSink),\n `window.onerror`, if defined, or `console.error` (in which case\n it'll pass `context`, when given, as first argument).\n */\n function logException(state, exception, context) {\n let handler = state.facet(exceptionSink);\n if (handler.length)\n handler[0](exception);\n else if (window.onerror)\n window.onerror(String(exception), context, undefined, undefined, exception);\n else if (context)\n console.error(context + \":\", exception);\n else\n console.error(exception);\n }\n const editable = /*@__PURE__*/Facet.define({ combine: values => values.length ? values[0] : true });\n let nextPluginID = 0;\n const viewPlugin = /*@__PURE__*/Facet.define();\n /**\n View plugins associate stateful values with a view. They can\n influence the way the content is drawn, and are notified of things\n that happen in the view.\n */\n class ViewPlugin {\n constructor(\n /**\n @internal\n */\n id, \n /**\n @internal\n */\n create, \n /**\n @internal\n */\n domEventHandlers, \n /**\n @internal\n */\n domEventObservers, buildExtensions) {\n this.id = id;\n this.create = create;\n this.domEventHandlers = domEventHandlers;\n this.domEventObservers = domEventObservers;\n this.extension = buildExtensions(this);\n }\n /**\n Define a plugin from a constructor function that creates the\n plugin's value, given an editor view.\n */\n static define(create, spec) {\n const { eventHandlers, eventObservers, provide, decorations: deco } = spec || {};\n return new ViewPlugin(nextPluginID++, create, eventHandlers, eventObservers, plugin => {\n let ext = [viewPlugin.of(plugin)];\n if (deco)\n ext.push(decorations.of(view => {\n let pluginInst = view.plugin(plugin);\n return pluginInst ? deco(pluginInst) : Decoration.none;\n }));\n if (provide)\n ext.push(provide(plugin));\n return ext;\n });\n }\n /**\n Create a plugin for a class whose constructor takes a single\n editor view as argument.\n */\n static fromClass(cls, spec) {\n return ViewPlugin.define(view => new cls(view), spec);\n }\n }\n class PluginInstance {\n constructor(spec) {\n this.spec = spec;\n // When starting an update, all plugins have this field set to the\n // update object, indicating they need to be updated. When finished\n // updating, it is set to `false`. Retrieving a plugin that needs to\n // be updated with `view.plugin` forces an eager update.\n this.mustUpdate = null;\n // This is null when the plugin is initially created, but\n // initialized on the first update.\n this.value = null;\n }\n update(view) {\n if (!this.value) {\n if (this.spec) {\n try {\n this.value = this.spec.create(view);\n }\n catch (e) {\n logException(view.state, e, \"CodeMirror plugin crashed\");\n this.deactivate();\n }\n }\n }\n else if (this.mustUpdate) {\n let update = this.mustUpdate;\n this.mustUpdate = null;\n if (this.value.update) {\n try {\n this.value.update(update);\n }\n catch (e) {\n logException(update.state, e, \"CodeMirror plugin crashed\");\n if (this.value.destroy)\n try {\n this.value.destroy();\n }\n catch (_) { }\n this.deactivate();\n }\n }\n }\n return this;\n }\n destroy(view) {\n var _a;\n if ((_a = this.value) === null || _a === void 0 ? void 0 : _a.destroy) {\n try {\n this.value.destroy();\n }\n catch (e) {\n logException(view.state, e, \"CodeMirror plugin crashed\");\n }\n }\n }\n deactivate() {\n this.spec = this.value = null;\n }\n }\n const editorAttributes = /*@__PURE__*/Facet.define();\n const contentAttributes = /*@__PURE__*/Facet.define();\n // Provide decorations\n const decorations = /*@__PURE__*/Facet.define();\n const outerDecorations = /*@__PURE__*/Facet.define();\n const atomicRanges = /*@__PURE__*/Facet.define();\n const bidiIsolatedRanges = /*@__PURE__*/Facet.define();\n function getIsolatedRanges(view, line) {\n let isolates = view.state.facet(bidiIsolatedRanges);\n if (!isolates.length)\n return isolates;\n let sets = isolates.map(i => i instanceof Function ? i(view) : i);\n let result = [];\n RangeSet.spans(sets, line.from, line.to, {\n point() { },\n span(fromDoc, toDoc, active, open) {\n let from = fromDoc - line.from, to = toDoc - line.from;\n let level = result;\n for (let i = active.length - 1; i >= 0; i--, open--) {\n let direction = active[i].spec.bidiIsolate, update;\n if (direction == null)\n direction = autoDirection(line.text, from, to);\n if (open > 0 && level.length &&\n (update = level[level.length - 1]).to == from && update.direction == direction) {\n update.to = to;\n level = update.inner;\n }\n else {\n let add = { from, to, direction, inner: [] };\n level.push(add);\n level = add.inner;\n }\n }\n }\n });\n return result;\n }\n const scrollMargins = /*@__PURE__*/Facet.define();\n function getScrollMargins(view) {\n let left = 0, right = 0, top = 0, bottom = 0;\n for (let source of view.state.facet(scrollMargins)) {\n let m = source(view);\n if (m) {\n if (m.left != null)\n left = Math.max(left, m.left);\n if (m.right != null)\n right = Math.max(right, m.right);\n if (m.top != null)\n top = Math.max(top, m.top);\n if (m.bottom != null)\n bottom = Math.max(bottom, m.bottom);\n }\n }\n return { left, right, top, bottom };\n }\n const styleModule = /*@__PURE__*/Facet.define();\n class ChangedRange {\n constructor(fromA, toA, fromB, toB) {\n this.fromA = fromA;\n this.toA = toA;\n this.fromB = fromB;\n this.toB = toB;\n }\n join(other) {\n return new ChangedRange(Math.min(this.fromA, other.fromA), Math.max(this.toA, other.toA), Math.min(this.fromB, other.fromB), Math.max(this.toB, other.toB));\n }\n addToSet(set) {\n let i = set.length, me = this;\n for (; i > 0; i--) {\n let range = set[i - 1];\n if (range.fromA > me.toA)\n continue;\n if (range.toA < me.fromA)\n break;\n me = me.join(range);\n set.splice(i - 1, 1);\n }\n set.splice(i, 0, me);\n return set;\n }\n static extendWithRanges(diff, ranges) {\n if (ranges.length == 0)\n return diff;\n let result = [];\n for (let dI = 0, rI = 0, posA = 0, posB = 0;; dI++) {\n let next = dI == diff.length ? null : diff[dI], off = posA - posB;\n let end = next ? next.fromB : 1e9;\n while (rI < ranges.length && ranges[rI] < end) {\n let from = ranges[rI], to = ranges[rI + 1];\n let fromB = Math.max(posB, from), toB = Math.min(end, to);\n if (fromB <= toB)\n new ChangedRange(fromB + off, toB + off, fromB, toB).addToSet(result);\n if (to > end)\n break;\n else\n rI += 2;\n }\n if (!next)\n return result;\n new ChangedRange(next.fromA, next.toA, next.fromB, next.toB).addToSet(result);\n posA = next.toA;\n posB = next.toB;\n }\n }\n }\n /**\n View [plugins](https://codemirror.net/6/docs/ref/#view.ViewPlugin) are given instances of this\n class, which describe what happened, whenever the view is updated.\n */\n class ViewUpdate {\n constructor(\n /**\n The editor view that the update is associated with.\n */\n view, \n /**\n The new editor state.\n */\n state, \n /**\n The transactions involved in the update. May be empty.\n */\n transactions) {\n this.view = view;\n this.state = state;\n this.transactions = transactions;\n /**\n @internal\n */\n this.flags = 0;\n this.startState = view.state;\n this.changes = ChangeSet.empty(this.startState.doc.length);\n for (let tr of transactions)\n this.changes = this.changes.compose(tr.changes);\n let changedRanges = [];\n this.changes.iterChangedRanges((fromA, toA, fromB, toB) => changedRanges.push(new ChangedRange(fromA, toA, fromB, toB)));\n this.changedRanges = changedRanges;\n }\n /**\n @internal\n */\n static create(view, state, transactions) {\n return new ViewUpdate(view, state, transactions);\n }\n /**\n Tells you whether the [viewport](https://codemirror.net/6/docs/ref/#view.EditorView.viewport) or\n [visible ranges](https://codemirror.net/6/docs/ref/#view.EditorView.visibleRanges) changed in this\n update.\n */\n get viewportChanged() {\n return (this.flags & 4 /* UpdateFlag.Viewport */) > 0;\n }\n /**\n Indicates whether the height of a block element in the editor\n changed in this update.\n */\n get heightChanged() {\n return (this.flags & 2 /* UpdateFlag.Height */) > 0;\n }\n /**\n Returns true when the document was modified or the size of the\n editor, or elements within the editor, changed.\n */\n get geometryChanged() {\n return this.docChanged || (this.flags & (8 /* UpdateFlag.Geometry */ | 2 /* UpdateFlag.Height */)) > 0;\n }\n /**\n True when this update indicates a focus change.\n */\n get focusChanged() {\n return (this.flags & 1 /* UpdateFlag.Focus */) > 0;\n }\n /**\n Whether the document changed in this update.\n */\n get docChanged() {\n return !this.changes.empty;\n }\n /**\n Whether the selection was explicitly set in this update.\n */\n get selectionSet() {\n return this.transactions.some(tr => tr.selection);\n }\n /**\n @internal\n */\n get empty() { return this.flags == 0 && this.transactions.length == 0; }\n }\n\n class DocView extends ContentView {\n get length() { return this.view.state.doc.length; }\n constructor(view) {\n super();\n this.view = view;\n this.decorations = [];\n this.dynamicDecorationMap = [false];\n this.domChanged = null;\n this.hasComposition = null;\n this.markedForComposition = new Set;\n this.editContextFormatting = Decoration.none;\n this.lastCompositionAfterCursor = false;\n // Track a minimum width for the editor. When measuring sizes in\n // measureVisibleLineHeights, this is updated to point at the width\n // of a given element and its extent in the document. When a change\n // happens in that range, these are reset. That way, once we've seen\n // a line/element of a given length, we keep the editor wide enough\n // to fit at least that element, until it is changed, at which point\n // we forget it again.\n this.minWidth = 0;\n this.minWidthFrom = 0;\n this.minWidthTo = 0;\n // Track whether the DOM selection was set in a lossy way, so that\n // we don't mess it up when reading it back it\n this.impreciseAnchor = null;\n this.impreciseHead = null;\n this.forceSelection = false;\n // Used by the resize observer to ignore resizes that we caused\n // ourselves\n this.lastUpdate = Date.now();\n this.setDOM(view.contentDOM);\n this.children = [new LineView];\n this.children[0].setParent(this);\n this.updateDeco();\n this.updateInner([new ChangedRange(0, 0, 0, view.state.doc.length)], 0, null);\n }\n // Update the document view to a given state.\n update(update) {\n var _a;\n let changedRanges = update.changedRanges;\n if (this.minWidth > 0 && changedRanges.length) {\n if (!changedRanges.every(({ fromA, toA }) => toA < this.minWidthFrom || fromA > this.minWidthTo)) {\n this.minWidth = this.minWidthFrom = this.minWidthTo = 0;\n }\n else {\n this.minWidthFrom = update.changes.mapPos(this.minWidthFrom, 1);\n this.minWidthTo = update.changes.mapPos(this.minWidthTo, 1);\n }\n }\n this.updateEditContextFormatting(update);\n let readCompositionAt = -1;\n if (this.view.inputState.composing >= 0 && !this.view.observer.editContext) {\n if ((_a = this.domChanged) === null || _a === void 0 ? void 0 : _a.newSel)\n readCompositionAt = this.domChanged.newSel.head;\n else if (!touchesComposition(update.changes, this.hasComposition) && !update.selectionSet)\n readCompositionAt = update.state.selection.main.head;\n }\n let composition = readCompositionAt > -1 ? findCompositionRange(this.view, update.changes, readCompositionAt) : null;\n this.domChanged = null;\n if (this.hasComposition) {\n this.markedForComposition.clear();\n let { from, to } = this.hasComposition;\n changedRanges = new ChangedRange(from, to, update.changes.mapPos(from, -1), update.changes.mapPos(to, 1))\n .addToSet(changedRanges.slice());\n }\n this.hasComposition = composition ? { from: composition.range.fromB, to: composition.range.toB } : null;\n // When the DOM nodes around the selection are moved to another\n // parent, Chrome sometimes reports a different selection through\n // getSelection than the one that it actually shows to the user.\n // This forces a selection update when lines are joined to work\n // around that. Issue #54\n if ((browser.ie || browser.chrome) && !composition && update &&\n update.state.doc.lines != update.startState.doc.lines)\n this.forceSelection = true;\n let prevDeco = this.decorations, deco = this.updateDeco();\n let decoDiff = findChangedDeco(prevDeco, deco, update.changes);\n changedRanges = ChangedRange.extendWithRanges(changedRanges, decoDiff);\n if (!(this.flags & 7 /* ViewFlag.Dirty */) && changedRanges.length == 0) {\n return false;\n }\n else {\n this.updateInner(changedRanges, update.startState.doc.length, composition);\n if (update.transactions.length)\n this.lastUpdate = Date.now();\n return true;\n }\n }\n // Used by update and the constructor do perform the actual DOM\n // update\n updateInner(changes, oldLength, composition) {\n this.view.viewState.mustMeasureContent = true;\n this.updateChildren(changes, oldLength, composition);\n let { observer } = this.view;\n observer.ignore(() => {\n // Lock the height during redrawing, since Chrome sometimes\n // messes with the scroll position during DOM mutation (though\n // no relayout is triggered and I cannot imagine how it can\n // recompute the scroll position without a layout)\n this.dom.style.height = this.view.viewState.contentHeight / this.view.scaleY + \"px\";\n this.dom.style.flexBasis = this.minWidth ? this.minWidth + \"px\" : \"\";\n // Chrome will sometimes, when DOM mutations occur directly\n // around the selection, get confused and report a different\n // selection from the one it displays (issue #218). This tries\n // to detect that situation.\n let track = browser.chrome || browser.ios ? { node: observer.selectionRange.focusNode, written: false } : undefined;\n this.sync(this.view, track);\n this.flags &= ~7 /* ViewFlag.Dirty */;\n if (track && (track.written || observer.selectionRange.focusNode != track.node))\n this.forceSelection = true;\n this.dom.style.height = \"\";\n });\n this.markedForComposition.forEach(cView => cView.flags &= ~8 /* ViewFlag.Composition */);\n let gaps = [];\n if (this.view.viewport.from || this.view.viewport.to < this.view.state.doc.length)\n for (let child of this.children)\n if (child instanceof BlockWidgetView && child.widget instanceof BlockGapWidget)\n gaps.push(child.dom);\n observer.updateGaps(gaps);\n }\n updateChildren(changes, oldLength, composition) {\n let ranges = composition ? composition.range.addToSet(changes.slice()) : changes;\n let cursor = this.childCursor(oldLength);\n for (let i = ranges.length - 1;; i--) {\n let next = i >= 0 ? ranges[i] : null;\n if (!next)\n break;\n let { fromA, toA, fromB, toB } = next, content, breakAtStart, openStart, openEnd;\n if (composition && composition.range.fromB < toB && composition.range.toB > fromB) {\n let before = ContentBuilder.build(this.view.state.doc, fromB, composition.range.fromB, this.decorations, this.dynamicDecorationMap);\n let after = ContentBuilder.build(this.view.state.doc, composition.range.toB, toB, this.decorations, this.dynamicDecorationMap);\n breakAtStart = before.breakAtStart;\n openStart = before.openStart;\n openEnd = after.openEnd;\n let compLine = this.compositionView(composition);\n if (after.breakAtStart) {\n compLine.breakAfter = 1;\n }\n else if (after.content.length &&\n compLine.merge(compLine.length, compLine.length, after.content[0], false, after.openStart, 0)) {\n compLine.breakAfter = after.content[0].breakAfter;\n after.content.shift();\n }\n if (before.content.length &&\n compLine.merge(0, 0, before.content[before.content.length - 1], true, 0, before.openEnd)) {\n before.content.pop();\n }\n content = before.content.concat(compLine).concat(after.content);\n }\n else {\n ({ content, breakAtStart, openStart, openEnd } =\n ContentBuilder.build(this.view.state.doc, fromB, toB, this.decorations, this.dynamicDecorationMap));\n }\n let { i: toI, off: toOff } = cursor.findPos(toA, 1);\n let { i: fromI, off: fromOff } = cursor.findPos(fromA, -1);\n replaceRange(this, fromI, fromOff, toI, toOff, content, breakAtStart, openStart, openEnd);\n }\n if (composition)\n this.fixCompositionDOM(composition);\n }\n updateEditContextFormatting(update) {\n this.editContextFormatting = this.editContextFormatting.map(update.changes);\n for (let tr of update.transactions)\n for (let effect of tr.effects)\n if (effect.is(setEditContextFormatting)) {\n this.editContextFormatting = effect.value;\n }\n }\n compositionView(composition) {\n let cur = new TextView(composition.text.nodeValue);\n cur.flags |= 8 /* ViewFlag.Composition */;\n for (let { deco } of composition.marks)\n cur = new MarkView(deco, [cur], cur.length);\n let line = new LineView;\n line.append(cur, 0);\n return line;\n }\n fixCompositionDOM(composition) {\n let fix = (dom, cView) => {\n cView.flags |= 8 /* ViewFlag.Composition */ | (cView.children.some(c => c.flags & 7 /* ViewFlag.Dirty */) ? 1 /* ViewFlag.ChildDirty */ : 0);\n this.markedForComposition.add(cView);\n let prev = ContentView.get(dom);\n if (prev && prev != cView)\n prev.dom = null;\n cView.setDOM(dom);\n };\n let pos = this.childPos(composition.range.fromB, 1);\n let cView = this.children[pos.i];\n fix(composition.line, cView);\n for (let i = composition.marks.length - 1; i >= -1; i--) {\n pos = cView.childPos(pos.off, 1);\n cView = cView.children[pos.i];\n fix(i >= 0 ? composition.marks[i].node : composition.text, cView);\n }\n }\n // Sync the DOM selection to this.state.selection\n updateSelection(mustRead = false, fromPointer = false) {\n if (mustRead || !this.view.observer.selectionRange.focusNode)\n this.view.observer.readSelectionRange();\n let activeElt = this.view.root.activeElement, focused = activeElt == this.dom;\n let selectionNotFocus = !focused &&\n hasSelection(this.dom, this.view.observer.selectionRange) && !(activeElt && this.dom.contains(activeElt));\n if (!(focused || fromPointer || selectionNotFocus))\n return;\n let force = this.forceSelection;\n this.forceSelection = false;\n let main = this.view.state.selection.main;\n let anchor = this.moveToLine(this.domAtPos(main.anchor));\n let head = main.empty ? anchor : this.moveToLine(this.domAtPos(main.head));\n // Always reset on Firefox when next to an uneditable node to\n // avoid invisible cursor bugs (#111)\n if (browser.gecko && main.empty && !this.hasComposition && betweenUneditable(anchor)) {\n let dummy = document.createTextNode(\"\");\n this.view.observer.ignore(() => anchor.node.insertBefore(dummy, anchor.node.childNodes[anchor.offset] || null));\n anchor = head = new DOMPos(dummy, 0);\n force = true;\n }\n let domSel = this.view.observer.selectionRange;\n // If the selection is already here, or in an equivalent position, don't touch it\n if (force || !domSel.focusNode || (!isEquivalentPosition(anchor.node, anchor.offset, domSel.anchorNode, domSel.anchorOffset) ||\n !isEquivalentPosition(head.node, head.offset, domSel.focusNode, domSel.focusOffset)) && !this.suppressWidgetCursorChange(domSel, main)) {\n this.view.observer.ignore(() => {\n // Chrome Android will hide the virtual keyboard when tapping\n // inside an uneditable node, and not bring it back when we\n // move the cursor to its proper position. This tries to\n // restore the keyboard by cycling focus.\n if (browser.android && browser.chrome && this.dom.contains(domSel.focusNode) &&\n inUneditable(domSel.focusNode, this.dom)) {\n this.dom.blur();\n this.dom.focus({ preventScroll: true });\n }\n let rawSel = getSelection(this.view.root);\n if (!rawSel) ;\n else if (main.empty) {\n // Work around https://bugzilla.mozilla.org/show_bug.cgi?id=1612076\n if (browser.gecko) {\n let nextTo = nextToUneditable(anchor.node, anchor.offset);\n if (nextTo && nextTo != (1 /* NextTo.Before */ | 2 /* NextTo.After */)) {\n let text = (nextTo == 1 /* NextTo.Before */ ? textNodeBefore : textNodeAfter)(anchor.node, anchor.offset);\n if (text)\n anchor = new DOMPos(text.node, text.offset);\n }\n }\n rawSel.collapse(anchor.node, anchor.offset);\n if (main.bidiLevel != null && rawSel.caretBidiLevel !== undefined)\n rawSel.caretBidiLevel = main.bidiLevel;\n }\n else if (rawSel.extend) {\n // Selection.extend can be used to create an 'inverted' selection\n // (one where the focus is before the anchor), but not all\n // browsers support it yet.\n rawSel.collapse(anchor.node, anchor.offset);\n // Safari will ignore the call above when the editor is\n // hidden, and then raise an error on the call to extend\n // (#940).\n try {\n rawSel.extend(head.node, head.offset);\n }\n catch (_) { }\n }\n else {\n // Primitive (IE) way\n let range = document.createRange();\n if (main.anchor > main.head)\n [anchor, head] = [head, anchor];\n range.setEnd(head.node, head.offset);\n range.setStart(anchor.node, anchor.offset);\n rawSel.removeAllRanges();\n rawSel.addRange(range);\n }\n if (selectionNotFocus && this.view.root.activeElement == this.dom) {\n this.dom.blur();\n if (activeElt)\n activeElt.focus();\n }\n });\n this.view.observer.setSelectionRange(anchor, head);\n }\n this.impreciseAnchor = anchor.precise ? null : new DOMPos(domSel.anchorNode, domSel.anchorOffset);\n this.impreciseHead = head.precise ? null : new DOMPos(domSel.focusNode, domSel.focusOffset);\n }\n // If a zero-length widget is inserted next to the cursor during\n // composition, avoid moving it across it and disrupting the\n // composition.\n suppressWidgetCursorChange(sel, cursor) {\n return this.hasComposition && cursor.empty &&\n isEquivalentPosition(sel.focusNode, sel.focusOffset, sel.anchorNode, sel.anchorOffset) &&\n this.posFromDOM(sel.focusNode, sel.focusOffset) == cursor.head;\n }\n enforceCursorAssoc() {\n if (this.hasComposition)\n return;\n let { view } = this, cursor = view.state.selection.main;\n let sel = getSelection(view.root);\n let { anchorNode, anchorOffset } = view.observer.selectionRange;\n if (!sel || !cursor.empty || !cursor.assoc || !sel.modify)\n return;\n let line = LineView.find(this, cursor.head);\n if (!line)\n return;\n let lineStart = line.posAtStart;\n if (cursor.head == lineStart || cursor.head == lineStart + line.length)\n return;\n let before = this.coordsAt(cursor.head, -1), after = this.coordsAt(cursor.head, 1);\n if (!before || !after || before.bottom > after.top)\n return;\n let dom = this.domAtPos(cursor.head + cursor.assoc);\n sel.collapse(dom.node, dom.offset);\n sel.modify(\"move\", cursor.assoc < 0 ? \"forward\" : \"backward\", \"lineboundary\");\n // This can go wrong in corner cases like single-character lines,\n // so check and reset if necessary.\n view.observer.readSelectionRange();\n let newRange = view.observer.selectionRange;\n if (view.docView.posFromDOM(newRange.anchorNode, newRange.anchorOffset) != cursor.from)\n sel.collapse(anchorNode, anchorOffset);\n }\n // If a position is in/near a block widget, move it to a nearby text\n // line, since we don't want the cursor inside a block widget.\n moveToLine(pos) {\n // Block widgets will return positions before/after them, which\n // are thus directly in the document DOM element.\n let dom = this.dom, newPos;\n if (pos.node != dom)\n return pos;\n for (let i = pos.offset; !newPos && i < dom.childNodes.length; i++) {\n let view = ContentView.get(dom.childNodes[i]);\n if (view instanceof LineView)\n newPos = view.domAtPos(0);\n }\n for (let i = pos.offset - 1; !newPos && i >= 0; i--) {\n let view = ContentView.get(dom.childNodes[i]);\n if (view instanceof LineView)\n newPos = view.domAtPos(view.length);\n }\n return newPos ? new DOMPos(newPos.node, newPos.offset, true) : pos;\n }\n nearest(dom) {\n for (let cur = dom; cur;) {\n let domView = ContentView.get(cur);\n if (domView && domView.rootView == this)\n return domView;\n cur = cur.parentNode;\n }\n return null;\n }\n posFromDOM(node, offset) {\n let view = this.nearest(node);\n if (!view)\n throw new RangeError(\"Trying to find position for a DOM position outside of the document\");\n return view.localPosFromDOM(node, offset) + view.posAtStart;\n }\n domAtPos(pos) {\n let { i, off } = this.childCursor().findPos(pos, -1);\n for (; i < this.children.length - 1;) {\n let child = this.children[i];\n if (off < child.length || child instanceof LineView)\n break;\n i++;\n off = 0;\n }\n return this.children[i].domAtPos(off);\n }\n coordsAt(pos, side) {\n let best = null, bestPos = 0;\n for (let off = this.length, i = this.children.length - 1; i >= 0; i--) {\n let child = this.children[i], end = off - child.breakAfter, start = end - child.length;\n if (end < pos)\n break;\n if (start <= pos && (start < pos || child.covers(-1)) && (end > pos || child.covers(1)) &&\n (!best || child instanceof LineView && !(best instanceof LineView && side >= 0))) {\n best = child;\n bestPos = start;\n }\n else if (best && start == pos && end == pos && child instanceof BlockWidgetView && Math.abs(side) < 2) {\n if (child.deco.startSide < 0)\n break;\n else if (i)\n best = null;\n }\n off = start;\n }\n return best ? best.coordsAt(pos - bestPos, side) : null;\n }\n coordsForChar(pos) {\n let { i, off } = this.childPos(pos, 1), child = this.children[i];\n if (!(child instanceof LineView))\n return null;\n while (child.children.length) {\n let { i, off: childOff } = child.childPos(off, 1);\n for (;; i++) {\n if (i == child.children.length)\n return null;\n if ((child = child.children[i]).length)\n break;\n }\n off = childOff;\n }\n if (!(child instanceof TextView))\n return null;\n let end = findClusterBreak(child.text, off);\n if (end == off)\n return null;\n let rects = textRange(child.dom, off, end).getClientRects();\n for (let i = 0; i < rects.length; i++) {\n let rect = rects[i];\n if (i == rects.length - 1 || rect.top < rect.bottom && rect.left < rect.right)\n return rect;\n }\n return null;\n }\n measureVisibleLineHeights(viewport) {\n let result = [], { from, to } = viewport;\n let contentWidth = this.view.contentDOM.clientWidth;\n let isWider = contentWidth > Math.max(this.view.scrollDOM.clientWidth, this.minWidth) + 1;\n let widest = -1, ltr = this.view.textDirection == Direction.LTR;\n for (let pos = 0, i = 0; i < this.children.length; i++) {\n let child = this.children[i], end = pos + child.length;\n if (end > to)\n break;\n if (pos >= from) {\n let childRect = child.dom.getBoundingClientRect();\n result.push(childRect.height);\n if (isWider) {\n let last = child.dom.lastChild;\n let rects = last ? clientRectsFor(last) : [];\n if (rects.length) {\n let rect = rects[rects.length - 1];\n let width = ltr ? rect.right - childRect.left : childRect.right - rect.left;\n if (width > widest) {\n widest = width;\n this.minWidth = contentWidth;\n this.minWidthFrom = pos;\n this.minWidthTo = end;\n }\n }\n }\n }\n pos = end + child.breakAfter;\n }\n return result;\n }\n textDirectionAt(pos) {\n let { i } = this.childPos(pos, 1);\n return getComputedStyle(this.children[i].dom).direction == \"rtl\" ? Direction.RTL : Direction.LTR;\n }\n measureTextSize() {\n for (let child of this.children) {\n if (child instanceof LineView) {\n let measure = child.measureTextSize();\n if (measure)\n return measure;\n }\n }\n // If no workable line exists, force a layout of a measurable element\n let dummy = document.createElement(\"div\"), lineHeight, charWidth, textHeight;\n dummy.className = \"cm-line\";\n dummy.style.width = \"99999px\";\n dummy.style.position = \"absolute\";\n dummy.textContent = \"abc def ghi jkl mno pqr stu\";\n this.view.observer.ignore(() => {\n this.dom.appendChild(dummy);\n let rect = clientRectsFor(dummy.firstChild)[0];\n lineHeight = dummy.getBoundingClientRect().height;\n charWidth = rect ? rect.width / 27 : 7;\n textHeight = rect ? rect.height : lineHeight;\n dummy.remove();\n });\n return { lineHeight, charWidth, textHeight };\n }\n childCursor(pos = this.length) {\n // Move back to start of last element when possible, so that\n // `ChildCursor.findPos` doesn't have to deal with the edge case\n // of being after the last element.\n let i = this.children.length;\n if (i)\n pos -= this.children[--i].length;\n return new ChildCursor(this.children, pos, i);\n }\n computeBlockGapDeco() {\n let deco = [], vs = this.view.viewState;\n for (let pos = 0, i = 0;; i++) {\n let next = i == vs.viewports.length ? null : vs.viewports[i];\n let end = next ? next.from - 1 : this.length;\n if (end > pos) {\n let height = (vs.lineBlockAt(end).bottom - vs.lineBlockAt(pos).top) / this.view.scaleY;\n deco.push(Decoration.replace({\n widget: new BlockGapWidget(height),\n block: true,\n inclusive: true,\n isBlockGap: true,\n }).range(pos, end));\n }\n if (!next)\n break;\n pos = next.to + 1;\n }\n return Decoration.set(deco);\n }\n updateDeco() {\n let i = 1;\n let allDeco = this.view.state.facet(decorations).map(d => {\n let dynamic = this.dynamicDecorationMap[i++] = typeof d == \"function\";\n return dynamic ? d(this.view) : d;\n });\n let dynamicOuter = false, outerDeco = this.view.state.facet(outerDecorations).map((d, i) => {\n let dynamic = typeof d == \"function\";\n if (dynamic)\n dynamicOuter = true;\n return dynamic ? d(this.view) : d;\n });\n if (outerDeco.length) {\n this.dynamicDecorationMap[i++] = dynamicOuter;\n allDeco.push(RangeSet.join(outerDeco));\n }\n this.decorations = [\n this.editContextFormatting,\n ...allDeco,\n this.computeBlockGapDeco(),\n this.view.viewState.lineGapDeco\n ];\n while (i < this.decorations.length)\n this.dynamicDecorationMap[i++] = false;\n return this.decorations;\n }\n scrollIntoView(target) {\n if (target.isSnapshot) {\n let ref = this.view.viewState.lineBlockAt(target.range.head);\n this.view.scrollDOM.scrollTop = ref.top - target.yMargin;\n this.view.scrollDOM.scrollLeft = target.xMargin;\n return;\n }\n for (let handler of this.view.state.facet(scrollHandler)) {\n try {\n if (handler(this.view, target.range, target))\n return true;\n }\n catch (e) {\n logException(this.view.state, e, \"scroll handler\");\n }\n }\n let { range } = target;\n let rect = this.coordsAt(range.head, range.empty ? range.assoc : range.head > range.anchor ? -1 : 1), other;\n if (!rect)\n return;\n if (!range.empty && (other = this.coordsAt(range.anchor, range.anchor > range.head ? -1 : 1)))\n rect = { left: Math.min(rect.left, other.left), top: Math.min(rect.top, other.top),\n right: Math.max(rect.right, other.right), bottom: Math.max(rect.bottom, other.bottom) };\n let margins = getScrollMargins(this.view);\n let targetRect = {\n left: rect.left - margins.left, top: rect.top - margins.top,\n right: rect.right + margins.right, bottom: rect.bottom + margins.bottom\n };\n let { offsetWidth, offsetHeight } = this.view.scrollDOM;\n scrollRectIntoView(this.view.scrollDOM, targetRect, range.head < range.anchor ? -1 : 1, target.x, target.y, Math.max(Math.min(target.xMargin, offsetWidth), -offsetWidth), Math.max(Math.min(target.yMargin, offsetHeight), -offsetHeight), this.view.textDirection == Direction.LTR);\n }\n }\n function betweenUneditable(pos) {\n return pos.node.nodeType == 1 && pos.node.firstChild &&\n (pos.offset == 0 || pos.node.childNodes[pos.offset - 1].contentEditable == \"false\") &&\n (pos.offset == pos.node.childNodes.length || pos.node.childNodes[pos.offset].contentEditable == \"false\");\n }\n class BlockGapWidget extends WidgetType {\n constructor(height) {\n super();\n this.height = height;\n }\n toDOM() {\n let elt = document.createElement(\"div\");\n elt.className = \"cm-gap\";\n this.updateDOM(elt);\n return elt;\n }\n eq(other) { return other.height == this.height; }\n updateDOM(elt) {\n elt.style.height = this.height + \"px\";\n return true;\n }\n get editable() { return true; }\n get estimatedHeight() { return this.height; }\n ignoreEvent() { return false; }\n }\n function findCompositionNode(view, headPos) {\n let sel = view.observer.selectionRange;\n if (!sel.focusNode)\n return null;\n let textBefore = textNodeBefore(sel.focusNode, sel.focusOffset);\n let textAfter = textNodeAfter(sel.focusNode, sel.focusOffset);\n let textNode = textBefore || textAfter;\n if (textAfter && textBefore && textAfter.node != textBefore.node) {\n let descAfter = ContentView.get(textAfter.node);\n if (!descAfter || descAfter instanceof TextView && descAfter.text != textAfter.node.nodeValue) {\n textNode = textAfter;\n }\n else if (view.docView.lastCompositionAfterCursor) {\n let descBefore = ContentView.get(textBefore.node);\n if (!(!descBefore || descBefore instanceof TextView && descBefore.text != textBefore.node.nodeValue))\n textNode = textAfter;\n }\n }\n view.docView.lastCompositionAfterCursor = textNode != textBefore;\n if (!textNode)\n return null;\n let from = headPos - textNode.offset;\n return { from, to: from + textNode.node.nodeValue.length, node: textNode.node };\n }\n function findCompositionRange(view, changes, headPos) {\n let found = findCompositionNode(view, headPos);\n if (!found)\n return null;\n let { node: textNode, from, to } = found, text = textNode.nodeValue;\n // Don't try to preserve multi-line compositions\n if (/[\\n\\r]/.test(text))\n return null;\n if (view.state.doc.sliceString(found.from, found.to) != text)\n return null;\n let inv = changes.invertedDesc;\n let range = new ChangedRange(inv.mapPos(from), inv.mapPos(to), from, to);\n let marks = [];\n for (let parent = textNode.parentNode;; parent = parent.parentNode) {\n let parentView = ContentView.get(parent);\n if (parentView instanceof MarkView)\n marks.push({ node: parent, deco: parentView.mark });\n else if (parentView instanceof LineView || parent.nodeName == \"DIV\" && parent.parentNode == view.contentDOM)\n return { range, text: textNode, marks, line: parent };\n else if (parent != view.contentDOM)\n marks.push({ node: parent, deco: new MarkDecoration({\n inclusive: true,\n attributes: getAttrs$1(parent),\n tagName: parent.tagName.toLowerCase()\n }) });\n else\n return null;\n }\n }\n function nextToUneditable(node, offset) {\n if (node.nodeType != 1)\n return 0;\n return (offset && node.childNodes[offset - 1].contentEditable == \"false\" ? 1 /* NextTo.Before */ : 0) |\n (offset < node.childNodes.length && node.childNodes[offset].contentEditable == \"false\" ? 2 /* NextTo.After */ : 0);\n }\n let DecorationComparator$1 = class DecorationComparator {\n constructor() {\n this.changes = [];\n }\n compareRange(from, to) { addRange(from, to, this.changes); }\n comparePoint(from, to) { addRange(from, to, this.changes); }\n };\n function findChangedDeco(a, b, diff) {\n let comp = new DecorationComparator$1;\n RangeSet.compare(a, b, diff, comp);\n return comp.changes;\n }\n function inUneditable(node, inside) {\n for (let cur = node; cur && cur != inside; cur = cur.assignedSlot || cur.parentNode) {\n if (cur.nodeType == 1 && cur.contentEditable == 'false') {\n return true;\n }\n }\n return false;\n }\n function touchesComposition(changes, composition) {\n let touched = false;\n if (composition)\n changes.iterChangedRanges((from, to) => {\n if (from < composition.to && to > composition.from)\n touched = true;\n });\n return touched;\n }\n\n function groupAt(state, pos, bias = 1) {\n let categorize = state.charCategorizer(pos);\n let line = state.doc.lineAt(pos), linePos = pos - line.from;\n if (line.length == 0)\n return EditorSelection.cursor(pos);\n if (linePos == 0)\n bias = 1;\n else if (linePos == line.length)\n bias = -1;\n let from = linePos, to = linePos;\n if (bias < 0)\n from = findClusterBreak(line.text, linePos, false);\n else\n to = findClusterBreak(line.text, linePos);\n let cat = categorize(line.text.slice(from, to));\n while (from > 0) {\n let prev = findClusterBreak(line.text, from, false);\n if (categorize(line.text.slice(prev, from)) != cat)\n break;\n from = prev;\n }\n while (to < line.length) {\n let next = findClusterBreak(line.text, to);\n if (categorize(line.text.slice(to, next)) != cat)\n break;\n to = next;\n }\n return EditorSelection.range(from + line.from, to + line.from);\n }\n // Search the DOM for the {node, offset} position closest to the given\n // coordinates. Very inefficient and crude, but can usually be avoided\n // by calling caret(Position|Range)FromPoint instead.\n function getdx(x, rect) {\n return rect.left > x ? rect.left - x : Math.max(0, x - rect.right);\n }\n function getdy(y, rect) {\n return rect.top > y ? rect.top - y : Math.max(0, y - rect.bottom);\n }\n function yOverlap(a, b) {\n return a.top < b.bottom - 1 && a.bottom > b.top + 1;\n }\n function upTop(rect, top) {\n return top < rect.top ? { top, left: rect.left, right: rect.right, bottom: rect.bottom } : rect;\n }\n function upBot(rect, bottom) {\n return bottom > rect.bottom ? { top: rect.top, left: rect.left, right: rect.right, bottom } : rect;\n }\n function domPosAtCoords(parent, x, y) {\n let closest, closestRect, closestX, closestY, closestOverlap = false;\n let above, below, aboveRect, belowRect;\n for (let child = parent.firstChild; child; child = child.nextSibling) {\n let rects = clientRectsFor(child);\n for (let i = 0; i < rects.length; i++) {\n let rect = rects[i];\n if (closestRect && yOverlap(closestRect, rect))\n rect = upTop(upBot(rect, closestRect.bottom), closestRect.top);\n let dx = getdx(x, rect), dy = getdy(y, rect);\n if (dx == 0 && dy == 0)\n return child.nodeType == 3 ? domPosInText(child, x, y) : domPosAtCoords(child, x, y);\n if (!closest || closestY > dy || closestY == dy && closestX > dx) {\n closest = child;\n closestRect = rect;\n closestX = dx;\n closestY = dy;\n let side = dy ? (y < rect.top ? -1 : 1) : dx ? (x < rect.left ? -1 : 1) : 0;\n closestOverlap = !side || (side > 0 ? i < rects.length - 1 : i > 0);\n }\n if (dx == 0) {\n if (y > rect.bottom && (!aboveRect || aboveRect.bottom < rect.bottom)) {\n above = child;\n aboveRect = rect;\n }\n else if (y < rect.top && (!belowRect || belowRect.top > rect.top)) {\n below = child;\n belowRect = rect;\n }\n }\n else if (aboveRect && yOverlap(aboveRect, rect)) {\n aboveRect = upBot(aboveRect, rect.bottom);\n }\n else if (belowRect && yOverlap(belowRect, rect)) {\n belowRect = upTop(belowRect, rect.top);\n }\n }\n }\n if (aboveRect && aboveRect.bottom >= y) {\n closest = above;\n closestRect = aboveRect;\n }\n else if (belowRect && belowRect.top <= y) {\n closest = below;\n closestRect = belowRect;\n }\n if (!closest)\n return { node: parent, offset: 0 };\n let clipX = Math.max(closestRect.left, Math.min(closestRect.right, x));\n if (closest.nodeType == 3)\n return domPosInText(closest, clipX, y);\n if (closestOverlap && closest.contentEditable != \"false\")\n return domPosAtCoords(closest, clipX, y);\n let offset = Array.prototype.indexOf.call(parent.childNodes, closest) +\n (x >= (closestRect.left + closestRect.right) / 2 ? 1 : 0);\n return { node: parent, offset };\n }\n function domPosInText(node, x, y) {\n let len = node.nodeValue.length;\n let closestOffset = -1, closestDY = 1e9, generalSide = 0;\n for (let i = 0; i < len; i++) {\n let rects = textRange(node, i, i + 1).getClientRects();\n for (let j = 0; j < rects.length; j++) {\n let rect = rects[j];\n if (rect.top == rect.bottom)\n continue;\n if (!generalSide)\n generalSide = x - rect.left;\n let dy = (rect.top > y ? rect.top - y : y - rect.bottom) - 1;\n if (rect.left - 1 <= x && rect.right + 1 >= x && dy < closestDY) {\n let right = x >= (rect.left + rect.right) / 2, after = right;\n if (browser.chrome || browser.gecko) {\n // Check for RTL on browsers that support getting client\n // rects for empty ranges.\n let rectBefore = textRange(node, i).getBoundingClientRect();\n if (rectBefore.left == rect.right)\n after = !right;\n }\n if (dy <= 0)\n return { node, offset: i + (after ? 1 : 0) };\n closestOffset = i + (after ? 1 : 0);\n closestDY = dy;\n }\n }\n }\n return { node, offset: closestOffset > -1 ? closestOffset : generalSide > 0 ? node.nodeValue.length : 0 };\n }\n function posAtCoords(view, coords, precise, bias = -1) {\n var _a, _b;\n let content = view.contentDOM.getBoundingClientRect(), docTop = content.top + view.viewState.paddingTop;\n let block, { docHeight } = view.viewState;\n let { x, y } = coords, yOffset = y - docTop;\n if (yOffset < 0)\n return 0;\n if (yOffset > docHeight)\n return view.state.doc.length;\n // Scan for a text block near the queried y position\n for (let halfLine = view.viewState.heightOracle.textHeight / 2, bounced = false;;) {\n block = view.elementAtHeight(yOffset);\n if (block.type == BlockType.Text)\n break;\n for (;;) {\n // Move the y position out of this block\n yOffset = bias > 0 ? block.bottom + halfLine : block.top - halfLine;\n if (yOffset >= 0 && yOffset <= docHeight)\n break;\n // If the document consists entirely of replaced widgets, we\n // won't find a text block, so return 0\n if (bounced)\n return precise ? null : 0;\n bounced = true;\n bias = -bias;\n }\n }\n y = docTop + yOffset;\n let lineStart = block.from;\n // If this is outside of the rendered viewport, we can't determine a position\n if (lineStart < view.viewport.from)\n return view.viewport.from == 0 ? 0 : precise ? null : posAtCoordsImprecise(view, content, block, x, y);\n if (lineStart > view.viewport.to)\n return view.viewport.to == view.state.doc.length ? view.state.doc.length :\n precise ? null : posAtCoordsImprecise(view, content, block, x, y);\n // Prefer ShadowRootOrDocument.elementFromPoint if present, fall back to document if not\n let doc = view.dom.ownerDocument;\n let root = view.root.elementFromPoint ? view.root : doc;\n let element = root.elementFromPoint(x, y);\n if (element && !view.contentDOM.contains(element))\n element = null;\n // If the element is unexpected, clip x at the sides of the content area and try again\n if (!element) {\n x = Math.max(content.left + 1, Math.min(content.right - 1, x));\n element = root.elementFromPoint(x, y);\n if (element && !view.contentDOM.contains(element))\n element = null;\n }\n // There's visible editor content under the point, so we can try\n // using caret(Position|Range)FromPoint as a shortcut\n let node, offset = -1;\n if (element && ((_a = view.docView.nearest(element)) === null || _a === void 0 ? void 0 : _a.isEditable) != false) {\n if (doc.caretPositionFromPoint) {\n let pos = doc.caretPositionFromPoint(x, y);\n if (pos)\n ({ offsetNode: node, offset } = pos);\n }\n else if (doc.caretRangeFromPoint) {\n let range = doc.caretRangeFromPoint(x, y);\n if (range) {\n ({ startContainer: node, startOffset: offset } = range);\n if (!view.contentDOM.contains(node) ||\n browser.safari && isSuspiciousSafariCaretResult(node, offset, x) ||\n browser.chrome && isSuspiciousChromeCaretResult(node, offset, x))\n node = undefined;\n }\n }\n }\n // No luck, do our own (potentially expensive) search\n if (!node || !view.docView.dom.contains(node)) {\n let line = LineView.find(view.docView, lineStart);\n if (!line)\n return yOffset > block.top + block.height / 2 ? block.to : block.from;\n ({ node, offset } = domPosAtCoords(line.dom, x, y));\n }\n let nearest = view.docView.nearest(node);\n if (!nearest)\n return null;\n if (nearest.isWidget && ((_b = nearest.dom) === null || _b === void 0 ? void 0 : _b.nodeType) == 1) {\n let rect = nearest.dom.getBoundingClientRect();\n return coords.y < rect.top || coords.y <= rect.bottom && coords.x <= (rect.left + rect.right) / 2\n ? nearest.posAtStart : nearest.posAtEnd;\n }\n else {\n return nearest.localPosFromDOM(node, offset) + nearest.posAtStart;\n }\n }\n function posAtCoordsImprecise(view, contentRect, block, x, y) {\n let into = Math.round((x - contentRect.left) * view.defaultCharacterWidth);\n if (view.lineWrapping && block.height > view.defaultLineHeight * 1.5) {\n let textHeight = view.viewState.heightOracle.textHeight;\n let line = Math.floor((y - block.top - (view.defaultLineHeight - textHeight) * 0.5) / textHeight);\n into += line * view.viewState.heightOracle.lineLength;\n }\n let content = view.state.sliceDoc(block.from, block.to);\n return block.from + findColumn(content, into, view.state.tabSize);\n }\n // In case of a high line height, Safari's caretRangeFromPoint treats\n // the space between lines as belonging to the last character of the\n // line before. This is used to detect such a result so that it can be\n // ignored (issue #401).\n function isSuspiciousSafariCaretResult(node, offset, x) {\n let len;\n if (node.nodeType != 3 || offset != (len = node.nodeValue.length))\n return false;\n for (let next = node.nextSibling; next; next = next.nextSibling)\n if (next.nodeType != 1 || next.nodeName != \"BR\")\n return false;\n return textRange(node, len - 1, len).getBoundingClientRect().left > x;\n }\n // Chrome will move positions between lines to the start of the next line\n function isSuspiciousChromeCaretResult(node, offset, x) {\n if (offset != 0)\n return false;\n for (let cur = node;;) {\n let parent = cur.parentNode;\n if (!parent || parent.nodeType != 1 || parent.firstChild != cur)\n return false;\n if (parent.classList.contains(\"cm-line\"))\n break;\n cur = parent;\n }\n let rect = node.nodeType == 1 ? node.getBoundingClientRect()\n : textRange(node, 0, Math.max(node.nodeValue.length, 1)).getBoundingClientRect();\n return x - rect.left > 5;\n }\n function blockAt(view, pos) {\n let line = view.lineBlockAt(pos);\n if (Array.isArray(line.type))\n for (let l of line.type) {\n if (l.to > pos || l.to == pos && (l.to == line.to || l.type == BlockType.Text))\n return l;\n }\n return line;\n }\n function moveToLineBoundary(view, start, forward, includeWrap) {\n let line = blockAt(view, start.head);\n let coords = !includeWrap || line.type != BlockType.Text || !(view.lineWrapping || line.widgetLineBreaks) ? null\n : view.coordsAtPos(start.assoc < 0 && start.head > line.from ? start.head - 1 : start.head);\n if (coords) {\n let editorRect = view.dom.getBoundingClientRect();\n let direction = view.textDirectionAt(line.from);\n let pos = view.posAtCoords({ x: forward == (direction == Direction.LTR) ? editorRect.right - 1 : editorRect.left + 1,\n y: (coords.top + coords.bottom) / 2 });\n if (pos != null)\n return EditorSelection.cursor(pos, forward ? -1 : 1);\n }\n return EditorSelection.cursor(forward ? line.to : line.from, forward ? -1 : 1);\n }\n function moveByChar(view, start, forward, by) {\n let line = view.state.doc.lineAt(start.head), spans = view.bidiSpans(line);\n let direction = view.textDirectionAt(line.from);\n for (let cur = start, check = null;;) {\n let next = moveVisually(line, spans, direction, cur, forward), char = movedOver;\n if (!next) {\n if (line.number == (forward ? view.state.doc.lines : 1))\n return cur;\n char = \"\\n\";\n line = view.state.doc.line(line.number + (forward ? 1 : -1));\n spans = view.bidiSpans(line);\n next = view.visualLineSide(line, !forward);\n }\n if (!check) {\n if (!by)\n return next;\n check = by(char);\n }\n else if (!check(char)) {\n return cur;\n }\n cur = next;\n }\n }\n function byGroup(view, pos, start) {\n let categorize = view.state.charCategorizer(pos);\n let cat = categorize(start);\n return (next) => {\n let nextCat = categorize(next);\n if (cat == CharCategory.Space)\n cat = nextCat;\n return cat == nextCat;\n };\n }\n function moveVertically(view, start, forward, distance) {\n let startPos = start.head, dir = forward ? 1 : -1;\n if (startPos == (forward ? view.state.doc.length : 0))\n return EditorSelection.cursor(startPos, start.assoc);\n let goal = start.goalColumn, startY;\n let rect = view.contentDOM.getBoundingClientRect();\n let startCoords = view.coordsAtPos(startPos, start.assoc || -1), docTop = view.documentTop;\n if (startCoords) {\n if (goal == null)\n goal = startCoords.left - rect.left;\n startY = dir < 0 ? startCoords.top : startCoords.bottom;\n }\n else {\n let line = view.viewState.lineBlockAt(startPos);\n if (goal == null)\n goal = Math.min(rect.right - rect.left, view.defaultCharacterWidth * (startPos - line.from));\n startY = (dir < 0 ? line.top : line.bottom) + docTop;\n }\n let resolvedGoal = rect.left + goal;\n let dist = distance !== null && distance !== void 0 ? distance : (view.viewState.heightOracle.textHeight >> 1);\n for (let extra = 0;; extra += 10) {\n let curY = startY + (dist + extra) * dir;\n let pos = posAtCoords(view, { x: resolvedGoal, y: curY }, false, dir);\n if (curY < rect.top || curY > rect.bottom || (dir < 0 ? pos < startPos : pos > startPos)) {\n let charRect = view.docView.coordsForChar(pos);\n let assoc = !charRect || curY < charRect.top ? -1 : 1;\n return EditorSelection.cursor(pos, assoc, undefined, goal);\n }\n }\n }\n function skipAtomicRanges(atoms, pos, bias) {\n for (;;) {\n let moved = 0;\n for (let set of atoms) {\n set.between(pos - 1, pos + 1, (from, to, value) => {\n if (pos > from && pos < to) {\n let side = moved || bias || (pos - from < to - pos ? -1 : 1);\n pos = side < 0 ? from : to;\n moved = side;\n }\n });\n }\n if (!moved)\n return pos;\n }\n }\n function skipAtoms(view, oldPos, pos) {\n let newPos = skipAtomicRanges(view.state.facet(atomicRanges).map(f => f(view)), pos.from, oldPos.head > pos.from ? -1 : 1);\n return newPos == pos.from ? pos : EditorSelection.cursor(newPos, newPos < pos.from ? 1 : -1);\n }\n\n // This will also be where dragging info and such goes\n class InputState {\n setSelectionOrigin(origin) {\n this.lastSelectionOrigin = origin;\n this.lastSelectionTime = Date.now();\n }\n constructor(view) {\n this.view = view;\n this.lastKeyCode = 0;\n this.lastKeyTime = 0;\n this.lastTouchTime = 0;\n this.lastFocusTime = 0;\n this.lastScrollTop = 0;\n this.lastScrollLeft = 0;\n // On iOS, some keys need to have their default behavior happen\n // (after which we retroactively handle them and reset the DOM) to\n // avoid messing up the virtual keyboard state.\n this.pendingIOSKey = undefined;\n /**\n When enabled (>-1), tab presses are not given to key handlers,\n leaving the browser's default behavior. If >0, the mode expires\n at that timestamp, and any other keypress clears it.\n Esc enables temporary tab focus mode for two seconds when not\n otherwise handled.\n */\n this.tabFocusMode = -1;\n this.lastSelectionOrigin = null;\n this.lastSelectionTime = 0;\n this.lastContextMenu = 0;\n this.scrollHandlers = [];\n this.handlers = Object.create(null);\n // -1 means not in a composition. Otherwise, this counts the number\n // of changes made during the composition. The count is used to\n // avoid treating the start state of the composition, before any\n // changes have been made, as part of the composition.\n this.composing = -1;\n // Tracks whether the next change should be marked as starting the\n // composition (null means no composition, true means next is the\n // first, false means first has already been marked for this\n // composition)\n this.compositionFirstChange = null;\n // End time of the previous composition\n this.compositionEndedAt = 0;\n // Used in a kludge to detect when an Enter keypress should be\n // considered part of the composition on Safari, which fires events\n // in the wrong order\n this.compositionPendingKey = false;\n // Used to categorize changes as part of a composition, even when\n // the mutation events fire shortly after the compositionend event\n this.compositionPendingChange = false;\n this.mouseSelection = null;\n // When a drag from the editor is active, this points at the range\n // being dragged.\n this.draggedContent = null;\n this.handleEvent = this.handleEvent.bind(this);\n this.notifiedFocused = view.hasFocus;\n // On Safari adding an input event handler somehow prevents an\n // issue where the composition vanishes when you press enter.\n if (browser.safari)\n view.contentDOM.addEventListener(\"input\", () => null);\n if (browser.gecko)\n firefoxCopyCutHack(view.contentDOM.ownerDocument);\n }\n handleEvent(event) {\n if (!eventBelongsToEditor(this.view, event) || this.ignoreDuringComposition(event))\n return;\n if (event.type == \"keydown\" && this.keydown(event))\n return;\n this.runHandlers(event.type, event);\n }\n runHandlers(type, event) {\n let handlers = this.handlers[type];\n if (handlers) {\n for (let observer of handlers.observers)\n observer(this.view, event);\n for (let handler of handlers.handlers) {\n if (event.defaultPrevented)\n break;\n if (handler(this.view, event)) {\n event.preventDefault();\n break;\n }\n }\n }\n }\n ensureHandlers(plugins) {\n let handlers = computeHandlers(plugins), prev = this.handlers, dom = this.view.contentDOM;\n for (let type in handlers)\n if (type != \"scroll\") {\n let passive = !handlers[type].handlers.length;\n let exists = prev[type];\n if (exists && passive != !exists.handlers.length) {\n dom.removeEventListener(type, this.handleEvent);\n exists = null;\n }\n if (!exists)\n dom.addEventListener(type, this.handleEvent, { passive });\n }\n for (let type in prev)\n if (type != \"scroll\" && !handlers[type])\n dom.removeEventListener(type, this.handleEvent);\n this.handlers = handlers;\n }\n keydown(event) {\n // Must always run, even if a custom handler handled the event\n this.lastKeyCode = event.keyCode;\n this.lastKeyTime = Date.now();\n if (event.keyCode == 9 && this.tabFocusMode > -1 && (!this.tabFocusMode || Date.now() <= this.tabFocusMode))\n return true;\n if (this.tabFocusMode > 0 && event.keyCode != 27 && modifierCodes.indexOf(event.keyCode) < 0)\n this.tabFocusMode = -1;\n // Chrome for Android usually doesn't fire proper key events, but\n // occasionally does, usually surrounded by a bunch of complicated\n // composition changes. When an enter or backspace key event is\n // seen, hold off on handling DOM events for a bit, and then\n // dispatch it.\n if (browser.android && browser.chrome && !event.synthetic &&\n (event.keyCode == 13 || event.keyCode == 8)) {\n this.view.observer.delayAndroidKey(event.key, event.keyCode);\n return true;\n }\n // Preventing the default behavior of Enter on iOS makes the\n // virtual keyboard get stuck in the wrong (lowercase)\n // state. So we let it go through, and then, in\n // applyDOMChange, notify key handlers of it and reset to\n // the state they produce.\n let pending;\n if (browser.ios && !event.synthetic && !event.altKey && !event.metaKey &&\n ((pending = PendingKeys.find(key => key.keyCode == event.keyCode)) && !event.ctrlKey ||\n EmacsyPendingKeys.indexOf(event.key) > -1 && event.ctrlKey && !event.shiftKey)) {\n this.pendingIOSKey = pending || event;\n setTimeout(() => this.flushIOSKey(), 250);\n return true;\n }\n if (event.keyCode != 229)\n this.view.observer.forceFlush();\n return false;\n }\n flushIOSKey(change) {\n let key = this.pendingIOSKey;\n if (!key)\n return false;\n // This looks like an autocorrection before Enter\n if (key.key == \"Enter\" && change && change.from < change.to && /^\\S+$/.test(change.insert.toString()))\n return false;\n this.pendingIOSKey = undefined;\n return dispatchKey(this.view.contentDOM, key.key, key.keyCode, key instanceof KeyboardEvent ? key : undefined);\n }\n ignoreDuringComposition(event) {\n if (!/^key/.test(event.type))\n return false;\n if (this.composing > 0)\n return true;\n // See https://www.stum.de/2016/06/24/handling-ime-events-in-javascript/.\n // On some input method editors (IMEs), the Enter key is used to\n // confirm character selection. On Safari, when Enter is pressed,\n // compositionend and keydown events are sometimes emitted in the\n // wrong order. The key event should still be ignored, even when\n // it happens after the compositionend event.\n if (browser.safari && !browser.ios && this.compositionPendingKey && Date.now() - this.compositionEndedAt < 100) {\n this.compositionPendingKey = false;\n return true;\n }\n return false;\n }\n startMouseSelection(mouseSelection) {\n if (this.mouseSelection)\n this.mouseSelection.destroy();\n this.mouseSelection = mouseSelection;\n }\n update(update) {\n this.view.observer.update(update);\n if (this.mouseSelection)\n this.mouseSelection.update(update);\n if (this.draggedContent && update.docChanged)\n this.draggedContent = this.draggedContent.map(update.changes);\n if (update.transactions.length)\n this.lastKeyCode = this.lastSelectionTime = 0;\n }\n destroy() {\n if (this.mouseSelection)\n this.mouseSelection.destroy();\n }\n }\n function bindHandler(plugin, handler) {\n return (view, event) => {\n try {\n return handler.call(plugin, event, view);\n }\n catch (e) {\n logException(view.state, e);\n }\n };\n }\n function computeHandlers(plugins) {\n let result = Object.create(null);\n function record(type) {\n return result[type] || (result[type] = { observers: [], handlers: [] });\n }\n for (let plugin of plugins) {\n let spec = plugin.spec;\n if (spec && spec.domEventHandlers)\n for (let type in spec.domEventHandlers) {\n let f = spec.domEventHandlers[type];\n if (f)\n record(type).handlers.push(bindHandler(plugin.value, f));\n }\n if (spec && spec.domEventObservers)\n for (let type in spec.domEventObservers) {\n let f = spec.domEventObservers[type];\n if (f)\n record(type).observers.push(bindHandler(plugin.value, f));\n }\n }\n for (let type in handlers)\n record(type).handlers.push(handlers[type]);\n for (let type in observers)\n record(type).observers.push(observers[type]);\n return result;\n }\n const PendingKeys = [\n { key: \"Backspace\", keyCode: 8, inputType: \"deleteContentBackward\" },\n { key: \"Enter\", keyCode: 13, inputType: \"insertParagraph\" },\n { key: \"Enter\", keyCode: 13, inputType: \"insertLineBreak\" },\n { key: \"Delete\", keyCode: 46, inputType: \"deleteContentForward\" }\n ];\n const EmacsyPendingKeys = \"dthko\";\n // Key codes for modifier keys\n const modifierCodes = [16, 17, 18, 20, 91, 92, 224, 225];\n const dragScrollMargin = 6;\n function dragScrollSpeed(dist) {\n return Math.max(0, dist) * 0.7 + 8;\n }\n function dist(a, b) {\n return Math.max(Math.abs(a.clientX - b.clientX), Math.abs(a.clientY - b.clientY));\n }\n class MouseSelection {\n constructor(view, startEvent, style, mustSelect) {\n this.view = view;\n this.startEvent = startEvent;\n this.style = style;\n this.mustSelect = mustSelect;\n this.scrollSpeed = { x: 0, y: 0 };\n this.scrolling = -1;\n this.lastEvent = startEvent;\n this.scrollParents = scrollableParents(view.contentDOM);\n this.atoms = view.state.facet(atomicRanges).map(f => f(view));\n let doc = view.contentDOM.ownerDocument;\n doc.addEventListener(\"mousemove\", this.move = this.move.bind(this));\n doc.addEventListener(\"mouseup\", this.up = this.up.bind(this));\n this.extend = startEvent.shiftKey;\n this.multiple = view.state.facet(EditorState.allowMultipleSelections) && addsSelectionRange(view, startEvent);\n this.dragging = isInPrimarySelection(view, startEvent) && getClickType(startEvent) == 1 ? null : false;\n }\n start(event) {\n // When clicking outside of the selection, immediately apply the\n // effect of starting the selection\n if (this.dragging === false)\n this.select(event);\n }\n move(event) {\n if (event.buttons == 0)\n return this.destroy();\n if (this.dragging || this.dragging == null && dist(this.startEvent, event) < 10)\n return;\n this.select(this.lastEvent = event);\n let sx = 0, sy = 0;\n let left = 0, top = 0, right = this.view.win.innerWidth, bottom = this.view.win.innerHeight;\n if (this.scrollParents.x)\n ({ left, right } = this.scrollParents.x.getBoundingClientRect());\n if (this.scrollParents.y)\n ({ top, bottom } = this.scrollParents.y.getBoundingClientRect());\n let margins = getScrollMargins(this.view);\n if (event.clientX - margins.left <= left + dragScrollMargin)\n sx = -dragScrollSpeed(left - event.clientX);\n else if (event.clientX + margins.right >= right - dragScrollMargin)\n sx = dragScrollSpeed(event.clientX - right);\n if (event.clientY - margins.top <= top + dragScrollMargin)\n sy = -dragScrollSpeed(top - event.clientY);\n else if (event.clientY + margins.bottom >= bottom - dragScrollMargin)\n sy = dragScrollSpeed(event.clientY - bottom);\n this.setScrollSpeed(sx, sy);\n }\n up(event) {\n if (this.dragging == null)\n this.select(this.lastEvent);\n if (!this.dragging)\n event.preventDefault();\n this.destroy();\n }\n destroy() {\n this.setScrollSpeed(0, 0);\n let doc = this.view.contentDOM.ownerDocument;\n doc.removeEventListener(\"mousemove\", this.move);\n doc.removeEventListener(\"mouseup\", this.up);\n this.view.inputState.mouseSelection = this.view.inputState.draggedContent = null;\n }\n setScrollSpeed(sx, sy) {\n this.scrollSpeed = { x: sx, y: sy };\n if (sx || sy) {\n if (this.scrolling < 0)\n this.scrolling = setInterval(() => this.scroll(), 50);\n }\n else if (this.scrolling > -1) {\n clearInterval(this.scrolling);\n this.scrolling = -1;\n }\n }\n scroll() {\n let { x, y } = this.scrollSpeed;\n if (x && this.scrollParents.x) {\n this.scrollParents.x.scrollLeft += x;\n x = 0;\n }\n if (y && this.scrollParents.y) {\n this.scrollParents.y.scrollTop += y;\n y = 0;\n }\n if (x || y)\n this.view.win.scrollBy(x, y);\n if (this.dragging === false)\n this.select(this.lastEvent);\n }\n skipAtoms(sel) {\n let ranges = null;\n for (let i = 0; i < sel.ranges.length; i++) {\n let range = sel.ranges[i], updated = null;\n if (range.empty) {\n let pos = skipAtomicRanges(this.atoms, range.from, 0);\n if (pos != range.from)\n updated = EditorSelection.cursor(pos, -1);\n }\n else {\n let from = skipAtomicRanges(this.atoms, range.from, -1);\n let to = skipAtomicRanges(this.atoms, range.to, 1);\n if (from != range.from || to != range.to)\n updated = EditorSelection.range(range.from == range.anchor ? from : to, range.from == range.head ? from : to);\n }\n if (updated) {\n if (!ranges)\n ranges = sel.ranges.slice();\n ranges[i] = updated;\n }\n }\n return ranges ? EditorSelection.create(ranges, sel.mainIndex) : sel;\n }\n select(event) {\n let { view } = this, selection = this.skipAtoms(this.style.get(event, this.extend, this.multiple));\n if (this.mustSelect || !selection.eq(view.state.selection, this.dragging === false))\n this.view.dispatch({\n selection,\n userEvent: \"select.pointer\"\n });\n this.mustSelect = false;\n }\n update(update) {\n if (update.transactions.some(tr => tr.isUserEvent(\"input.type\")))\n this.destroy();\n else if (this.style.update(update))\n setTimeout(() => this.select(this.lastEvent), 20);\n }\n }\n function addsSelectionRange(view, event) {\n let facet = view.state.facet(clickAddsSelectionRange);\n return facet.length ? facet[0](event) : browser.mac ? event.metaKey : event.ctrlKey;\n }\n function dragMovesSelection(view, event) {\n let facet = view.state.facet(dragMovesSelection$1);\n return facet.length ? facet[0](event) : browser.mac ? !event.altKey : !event.ctrlKey;\n }\n function isInPrimarySelection(view, event) {\n let { main } = view.state.selection;\n if (main.empty)\n return false;\n // On boundary clicks, check whether the coordinates are inside the\n // selection's client rectangles\n let sel = getSelection(view.root);\n if (!sel || sel.rangeCount == 0)\n return true;\n let rects = sel.getRangeAt(0).getClientRects();\n for (let i = 0; i < rects.length; i++) {\n let rect = rects[i];\n if (rect.left <= event.clientX && rect.right >= event.clientX &&\n rect.top <= event.clientY && rect.bottom >= event.clientY)\n return true;\n }\n return false;\n }\n function eventBelongsToEditor(view, event) {\n if (!event.bubbles)\n return true;\n if (event.defaultPrevented)\n return false;\n for (let node = event.target, cView; node != view.contentDOM; node = node.parentNode)\n if (!node || node.nodeType == 11 || ((cView = ContentView.get(node)) && cView.ignoreEvent(event)))\n return false;\n return true;\n }\n const handlers = /*@__PURE__*/Object.create(null);\n const observers = /*@__PURE__*/Object.create(null);\n // This is very crude, but unfortunately both these browsers _pretend_\n // that they have a clipboard API\u2014all the objects and methods are\n // there, they just don't work, and they are hard to test.\n const brokenClipboardAPI = (browser.ie && browser.ie_version < 15) ||\n (browser.ios && browser.webkit_version < 604);\n function capturePaste(view) {\n let parent = view.dom.parentNode;\n if (!parent)\n return;\n let target = parent.appendChild(document.createElement(\"textarea\"));\n target.style.cssText = \"position: fixed; left: -10000px; top: 10px\";\n target.focus();\n setTimeout(() => {\n view.focus();\n target.remove();\n doPaste(view, target.value);\n }, 50);\n }\n function doPaste(view, input) {\n let { state } = view, changes, i = 1, text = state.toText(input);\n let byLine = text.lines == state.selection.ranges.length;\n let linewise = lastLinewiseCopy != null && state.selection.ranges.every(r => r.empty) && lastLinewiseCopy == text.toString();\n if (linewise) {\n let lastLine = -1;\n changes = state.changeByRange(range => {\n let line = state.doc.lineAt(range.from);\n if (line.from == lastLine)\n return { range };\n lastLine = line.from;\n let insert = state.toText((byLine ? text.line(i++).text : input) + state.lineBreak);\n return { changes: { from: line.from, insert },\n range: EditorSelection.cursor(range.from + insert.length) };\n });\n }\n else if (byLine) {\n changes = state.changeByRange(range => {\n let line = text.line(i++);\n return { changes: { from: range.from, to: range.to, insert: line.text },\n range: EditorSelection.cursor(range.from + line.length) };\n });\n }\n else {\n changes = state.replaceSelection(text);\n }\n view.dispatch(changes, {\n userEvent: \"input.paste\",\n scrollIntoView: true\n });\n }\n observers.scroll = view => {\n view.inputState.lastScrollTop = view.scrollDOM.scrollTop;\n view.inputState.lastScrollLeft = view.scrollDOM.scrollLeft;\n };\n handlers.keydown = (view, event) => {\n view.inputState.setSelectionOrigin(\"select\");\n if (event.keyCode == 27 && view.inputState.tabFocusMode != 0)\n view.inputState.tabFocusMode = Date.now() + 2000;\n return false;\n };\n observers.touchstart = (view, e) => {\n view.inputState.lastTouchTime = Date.now();\n view.inputState.setSelectionOrigin(\"select.pointer\");\n };\n observers.touchmove = view => {\n view.inputState.setSelectionOrigin(\"select.pointer\");\n };\n handlers.mousedown = (view, event) => {\n view.observer.flush();\n if (view.inputState.lastTouchTime > Date.now() - 2000)\n return false; // Ignore touch interaction\n let style = null;\n for (let makeStyle of view.state.facet(mouseSelectionStyle)) {\n style = makeStyle(view, event);\n if (style)\n break;\n }\n if (!style && event.button == 0)\n style = basicMouseSelection(view, event);\n if (style) {\n let mustFocus = !view.hasFocus;\n view.inputState.startMouseSelection(new MouseSelection(view, event, style, mustFocus));\n if (mustFocus)\n view.observer.ignore(() => {\n focusPreventScroll(view.contentDOM);\n let active = view.root.activeElement;\n if (active && !active.contains(view.contentDOM))\n active.blur();\n });\n let mouseSel = view.inputState.mouseSelection;\n if (mouseSel) {\n mouseSel.start(event);\n return mouseSel.dragging === false;\n }\n }\n return false;\n };\n function rangeForClick(view, pos, bias, type) {\n if (type == 1) { // Single click\n return EditorSelection.cursor(pos, bias);\n }\n else if (type == 2) { // Double click\n return groupAt(view.state, pos, bias);\n }\n else { // Triple click\n let visual = LineView.find(view.docView, pos), line = view.state.doc.lineAt(visual ? visual.posAtEnd : pos);\n let from = visual ? visual.posAtStart : line.from, to = visual ? visual.posAtEnd : line.to;\n if (to < view.state.doc.length && to == line.to)\n to++;\n return EditorSelection.range(from, to);\n }\n }\n let inside = (x, y, rect) => y >= rect.top && y <= rect.bottom && x >= rect.left && x <= rect.right;\n // Try to determine, for the given coordinates, associated with the\n // given position, whether they are related to the element before or\n // the element after the position.\n function findPositionSide(view, pos, x, y) {\n let line = LineView.find(view.docView, pos);\n if (!line)\n return 1;\n let off = pos - line.posAtStart;\n // Line boundaries point into the line\n if (off == 0)\n return 1;\n if (off == line.length)\n return -1;\n // Positions on top of an element point at that element\n let before = line.coordsAt(off, -1);\n if (before && inside(x, y, before))\n return -1;\n let after = line.coordsAt(off, 1);\n if (after && inside(x, y, after))\n return 1;\n // This is probably a line wrap point. Pick before if the point is\n // above its bottom.\n return before && before.bottom >= y ? -1 : 1;\n }\n function queryPos(view, event) {\n let pos = view.posAtCoords({ x: event.clientX, y: event.clientY }, false);\n return { pos, bias: findPositionSide(view, pos, event.clientX, event.clientY) };\n }\n const BadMouseDetail = browser.ie && browser.ie_version <= 11;\n let lastMouseDown = null, lastMouseDownCount = 0, lastMouseDownTime = 0;\n function getClickType(event) {\n if (!BadMouseDetail)\n return event.detail;\n let last = lastMouseDown, lastTime = lastMouseDownTime;\n lastMouseDown = event;\n lastMouseDownTime = Date.now();\n return lastMouseDownCount = !last || (lastTime > Date.now() - 400 && Math.abs(last.clientX - event.clientX) < 2 &&\n Math.abs(last.clientY - event.clientY) < 2) ? (lastMouseDownCount + 1) % 3 : 1;\n }\n function basicMouseSelection(view, event) {\n let start = queryPos(view, event), type = getClickType(event);\n let startSel = view.state.selection;\n return {\n update(update) {\n if (update.docChanged) {\n start.pos = update.changes.mapPos(start.pos);\n startSel = startSel.map(update.changes);\n }\n },\n get(event, extend, multiple) {\n let cur = queryPos(view, event), removed;\n let range = rangeForClick(view, cur.pos, cur.bias, type);\n if (start.pos != cur.pos && !extend) {\n let startRange = rangeForClick(view, start.pos, start.bias, type);\n let from = Math.min(startRange.from, range.from), to = Math.max(startRange.to, range.to);\n range = from < range.from ? EditorSelection.range(from, to) : EditorSelection.range(to, from);\n }\n if (extend)\n return startSel.replaceRange(startSel.main.extend(range.from, range.to));\n else if (multiple && type == 1 && startSel.ranges.length > 1 && (removed = removeRangeAround(startSel, cur.pos)))\n return removed;\n else if (multiple)\n return startSel.addRange(range);\n else\n return EditorSelection.create([range]);\n }\n };\n }\n function removeRangeAround(sel, pos) {\n for (let i = 0; i < sel.ranges.length; i++) {\n let { from, to } = sel.ranges[i];\n if (from <= pos && to >= pos)\n return EditorSelection.create(sel.ranges.slice(0, i).concat(sel.ranges.slice(i + 1)), sel.mainIndex == i ? 0 : sel.mainIndex - (sel.mainIndex > i ? 1 : 0));\n }\n return null;\n }\n handlers.dragstart = (view, event) => {\n let { selection: { main: range } } = view.state;\n if (event.target.draggable) {\n let cView = view.docView.nearest(event.target);\n if (cView && cView.isWidget) {\n let from = cView.posAtStart, to = from + cView.length;\n if (from >= range.to || to <= range.from)\n range = EditorSelection.range(from, to);\n }\n }\n let { inputState } = view;\n if (inputState.mouseSelection)\n inputState.mouseSelection.dragging = true;\n inputState.draggedContent = range;\n if (event.dataTransfer) {\n event.dataTransfer.setData(\"Text\", view.state.sliceDoc(range.from, range.to));\n event.dataTransfer.effectAllowed = \"copyMove\";\n }\n return false;\n };\n handlers.dragend = view => {\n view.inputState.draggedContent = null;\n return false;\n };\n function dropText(view, event, text, direct) {\n if (!text)\n return;\n let dropPos = view.posAtCoords({ x: event.clientX, y: event.clientY }, false);\n let { draggedContent } = view.inputState;\n let del = direct && draggedContent && dragMovesSelection(view, event)\n ? { from: draggedContent.from, to: draggedContent.to } : null;\n let ins = { from: dropPos, insert: text };\n let changes = view.state.changes(del ? [del, ins] : ins);\n view.focus();\n view.dispatch({\n changes,\n selection: { anchor: changes.mapPos(dropPos, -1), head: changes.mapPos(dropPos, 1) },\n userEvent: del ? \"move.drop\" : \"input.drop\"\n });\n view.inputState.draggedContent = null;\n }\n handlers.drop = (view, event) => {\n if (!event.dataTransfer)\n return false;\n if (view.state.readOnly)\n return true;\n let files = event.dataTransfer.files;\n if (files && files.length) { // For a file drop, read the file's text.\n let text = Array(files.length), read = 0;\n let finishFile = () => {\n if (++read == files.length)\n dropText(view, event, text.filter(s => s != null).join(view.state.lineBreak), false);\n };\n for (let i = 0; i < files.length; i++) {\n let reader = new FileReader;\n reader.onerror = finishFile;\n reader.onload = () => {\n if (!/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(reader.result))\n text[i] = reader.result;\n finishFile();\n };\n reader.readAsText(files[i]);\n }\n return true;\n }\n else {\n let text = event.dataTransfer.getData(\"Text\");\n if (text) {\n dropText(view, event, text, true);\n return true;\n }\n }\n return false;\n };\n handlers.paste = (view, event) => {\n if (view.state.readOnly)\n return true;\n view.observer.flush();\n let data = brokenClipboardAPI ? null : event.clipboardData;\n if (data) {\n doPaste(view, data.getData(\"text/plain\") || data.getData(\"text/uri-list\"));\n return true;\n }\n else {\n capturePaste(view);\n return false;\n }\n };\n function captureCopy(view, text) {\n // The extra wrapper is somehow necessary on IE/Edge to prevent the\n // content from being mangled when it is put onto the clipboard\n let parent = view.dom.parentNode;\n if (!parent)\n return;\n let target = parent.appendChild(document.createElement(\"textarea\"));\n target.style.cssText = \"position: fixed; left: -10000px; top: 10px\";\n target.value = text;\n target.focus();\n target.selectionEnd = text.length;\n target.selectionStart = 0;\n setTimeout(() => {\n target.remove();\n view.focus();\n }, 50);\n }\n function copiedRange(state) {\n let content = [], ranges = [], linewise = false;\n for (let range of state.selection.ranges)\n if (!range.empty) {\n content.push(state.sliceDoc(range.from, range.to));\n ranges.push(range);\n }\n if (!content.length) {\n // Nothing selected, do a line-wise copy\n let upto = -1;\n for (let { from } of state.selection.ranges) {\n let line = state.doc.lineAt(from);\n if (line.number > upto) {\n content.push(line.text);\n ranges.push({ from: line.from, to: Math.min(state.doc.length, line.to + 1) });\n }\n upto = line.number;\n }\n linewise = true;\n }\n return { text: content.join(state.lineBreak), ranges, linewise };\n }\n let lastLinewiseCopy = null;\n handlers.copy = handlers.cut = (view, event) => {\n let { text, ranges, linewise } = copiedRange(view.state);\n if (!text && !linewise)\n return false;\n lastLinewiseCopy = linewise ? text : null;\n if (event.type == \"cut\" && !view.state.readOnly)\n view.dispatch({\n changes: ranges,\n scrollIntoView: true,\n userEvent: \"delete.cut\"\n });\n let data = brokenClipboardAPI ? null : event.clipboardData;\n if (data) {\n data.clearData();\n data.setData(\"text/plain\", text);\n return true;\n }\n else {\n captureCopy(view, text);\n return false;\n }\n };\n const isFocusChange = /*@__PURE__*/Annotation.define();\n function focusChangeTransaction(state, focus) {\n let effects = [];\n for (let getEffect of state.facet(focusChangeEffect)) {\n let effect = getEffect(state, focus);\n if (effect)\n effects.push(effect);\n }\n return effects ? state.update({ effects, annotations: isFocusChange.of(true) }) : null;\n }\n function updateForFocusChange(view) {\n setTimeout(() => {\n let focus = view.hasFocus;\n if (focus != view.inputState.notifiedFocused) {\n let tr = focusChangeTransaction(view.state, focus);\n if (tr)\n view.dispatch(tr);\n else\n view.update([]);\n }\n }, 10);\n }\n observers.focus = view => {\n view.inputState.lastFocusTime = Date.now();\n // When focusing reset the scroll position, move it back to where it was\n if (!view.scrollDOM.scrollTop && (view.inputState.lastScrollTop || view.inputState.lastScrollLeft)) {\n view.scrollDOM.scrollTop = view.inputState.lastScrollTop;\n view.scrollDOM.scrollLeft = view.inputState.lastScrollLeft;\n }\n updateForFocusChange(view);\n };\n observers.blur = view => {\n view.observer.clearSelectionRange();\n updateForFocusChange(view);\n };\n observers.compositionstart = observers.compositionupdate = view => {\n if (view.observer.editContext)\n return; // Composition handled by edit context\n if (view.inputState.compositionFirstChange == null)\n view.inputState.compositionFirstChange = true;\n if (view.inputState.composing < 0) {\n // FIXME possibly set a timeout to clear it again on Android\n view.inputState.composing = 0;\n }\n };\n observers.compositionend = view => {\n if (view.observer.editContext)\n return; // Composition handled by edit context\n view.inputState.composing = -1;\n view.inputState.compositionEndedAt = Date.now();\n view.inputState.compositionPendingKey = true;\n view.inputState.compositionPendingChange = view.observer.pendingRecords().length > 0;\n view.inputState.compositionFirstChange = null;\n if (browser.chrome && browser.android) {\n // Delay flushing for a bit on Android because it'll often fire a\n // bunch of contradictory changes in a row at end of compositon\n view.observer.flushSoon();\n }\n else if (view.inputState.compositionPendingChange) {\n // If we found pending records, schedule a flush.\n Promise.resolve().then(() => view.observer.flush());\n }\n else {\n // Otherwise, make sure that, if no changes come in soon, the\n // composition view is cleared.\n setTimeout(() => {\n if (view.inputState.composing < 0 && view.docView.hasComposition)\n view.update([]);\n }, 50);\n }\n };\n observers.contextmenu = view => {\n view.inputState.lastContextMenu = Date.now();\n };\n handlers.beforeinput = (view, event) => {\n var _a;\n // Because Chrome Android doesn't fire useful key events, use\n // beforeinput to detect backspace (and possibly enter and delete,\n // but those usually don't even seem to fire beforeinput events at\n // the moment) and fake a key event for it.\n //\n // (preventDefault on beforeinput, though supported in the spec,\n // seems to do nothing at all on Chrome).\n let pending;\n if (browser.chrome && browser.android && (pending = PendingKeys.find(key => key.inputType == event.inputType))) {\n view.observer.delayAndroidKey(pending.key, pending.keyCode);\n if (pending.key == \"Backspace\" || pending.key == \"Delete\") {\n let startViewHeight = ((_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.height) || 0;\n setTimeout(() => {\n var _a;\n // Backspacing near uneditable nodes on Chrome Android sometimes\n // closes the virtual keyboard. This tries to crudely detect\n // that and refocus to get it back.\n if ((((_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.height) || 0) > startViewHeight + 10 && view.hasFocus) {\n view.contentDOM.blur();\n view.focus();\n }\n }, 100);\n }\n }\n if (browser.ios && event.inputType == \"deleteContentForward\") {\n // For some reason, DOM changes (and beforeinput) happen _before_\n // the key event for ctrl-d on iOS when using an external\n // keyboard.\n view.observer.flushSoon();\n }\n // Safari will occasionally forget to fire compositionend at the end of a dead-key composition\n if (browser.safari && event.inputType == \"insertText\" && view.inputState.composing >= 0) {\n setTimeout(() => observers.compositionend(view, event), 20);\n }\n return false;\n };\n const appliedFirefoxHack = /*@__PURE__*/new Set;\n // In Firefox, when cut/copy handlers are added to the document, that\n // somehow avoids a bug where those events aren't fired when the\n // selection is empty. See https://github.com/codemirror/dev/issues/1082\n // and https://bugzilla.mozilla.org/show_bug.cgi?id=995961\n function firefoxCopyCutHack(doc) {\n if (!appliedFirefoxHack.has(doc)) {\n appliedFirefoxHack.add(doc);\n doc.addEventListener(\"copy\", () => { });\n doc.addEventListener(\"cut\", () => { });\n }\n }\n\n const wrappingWhiteSpace = [\"pre-wrap\", \"normal\", \"pre-line\", \"break-spaces\"];\n // Used to track, during updateHeight, if any actual heights changed\n let heightChangeFlag = false;\n function clearHeightChangeFlag() { heightChangeFlag = false; }\n class HeightOracle {\n constructor(lineWrapping) {\n this.lineWrapping = lineWrapping;\n this.doc = Text.empty;\n this.heightSamples = {};\n this.lineHeight = 14; // The height of an entire line (line-height)\n this.charWidth = 7;\n this.textHeight = 14; // The height of the actual font (font-size)\n this.lineLength = 30;\n }\n heightForGap(from, to) {\n let lines = this.doc.lineAt(to).number - this.doc.lineAt(from).number + 1;\n if (this.lineWrapping)\n lines += Math.max(0, Math.ceil(((to - from) - (lines * this.lineLength * 0.5)) / this.lineLength));\n return this.lineHeight * lines;\n }\n heightForLine(length) {\n if (!this.lineWrapping)\n return this.lineHeight;\n let lines = 1 + Math.max(0, Math.ceil((length - this.lineLength) / (this.lineLength - 5)));\n return lines * this.lineHeight;\n }\n setDoc(doc) { this.doc = doc; return this; }\n mustRefreshForWrapping(whiteSpace) {\n return (wrappingWhiteSpace.indexOf(whiteSpace) > -1) != this.lineWrapping;\n }\n mustRefreshForHeights(lineHeights) {\n let newHeight = false;\n for (let i = 0; i < lineHeights.length; i++) {\n let h = lineHeights[i];\n if (h < 0) {\n i++;\n }\n else if (!this.heightSamples[Math.floor(h * 10)]) { // Round to .1 pixels\n newHeight = true;\n this.heightSamples[Math.floor(h * 10)] = true;\n }\n }\n return newHeight;\n }\n refresh(whiteSpace, lineHeight, charWidth, textHeight, lineLength, knownHeights) {\n let lineWrapping = wrappingWhiteSpace.indexOf(whiteSpace) > -1;\n let changed = Math.round(lineHeight) != Math.round(this.lineHeight) || this.lineWrapping != lineWrapping;\n this.lineWrapping = lineWrapping;\n this.lineHeight = lineHeight;\n this.charWidth = charWidth;\n this.textHeight = textHeight;\n this.lineLength = lineLength;\n if (changed) {\n this.heightSamples = {};\n for (let i = 0; i < knownHeights.length; i++) {\n let h = knownHeights[i];\n if (h < 0)\n i++;\n else\n this.heightSamples[Math.floor(h * 10)] = true;\n }\n }\n return changed;\n }\n }\n // This object is used by `updateHeight` to make DOM measurements\n // arrive at the right nides. The `heights` array is a sequence of\n // block heights, starting from position `from`.\n class MeasuredHeights {\n constructor(from, heights) {\n this.from = from;\n this.heights = heights;\n this.index = 0;\n }\n get more() { return this.index < this.heights.length; }\n }\n /**\n Record used to represent information about a block-level element\n in the editor view.\n */\n class BlockInfo {\n /**\n @internal\n */\n constructor(\n /**\n The start of the element in the document.\n */\n from, \n /**\n The length of the element.\n */\n length, \n /**\n The top position of the element (relative to the top of the\n document).\n */\n top, \n /**\n Its height.\n */\n height, \n /**\n @internal Weird packed field that holds an array of children\n for composite blocks, a decoration for block widgets, and a\n number indicating the amount of widget-create line breaks for\n text blocks.\n */\n _content) {\n this.from = from;\n this.length = length;\n this.top = top;\n this.height = height;\n this._content = _content;\n }\n /**\n The type of element this is. When querying lines, this may be\n an array of all the blocks that make up the line.\n */\n get type() {\n return typeof this._content == \"number\" ? BlockType.Text :\n Array.isArray(this._content) ? this._content : this._content.type;\n }\n /**\n The end of the element as a document position.\n */\n get to() { return this.from + this.length; }\n /**\n The bottom position of the element.\n */\n get bottom() { return this.top + this.height; }\n /**\n If this is a widget block, this will return the widget\n associated with it.\n */\n get widget() {\n return this._content instanceof PointDecoration ? this._content.widget : null;\n }\n /**\n If this is a textblock, this holds the number of line breaks\n that appear in widgets inside the block.\n */\n get widgetLineBreaks() {\n return typeof this._content == \"number\" ? this._content : 0;\n }\n /**\n @internal\n */\n join(other) {\n let content = (Array.isArray(this._content) ? this._content : [this])\n .concat(Array.isArray(other._content) ? other._content : [other]);\n return new BlockInfo(this.from, this.length + other.length, this.top, this.height + other.height, content);\n }\n }\n var QueryType$1 = /*@__PURE__*/(function (QueryType) {\n QueryType[QueryType[\"ByPos\"] = 0] = \"ByPos\";\n QueryType[QueryType[\"ByHeight\"] = 1] = \"ByHeight\";\n QueryType[QueryType[\"ByPosNoHeight\"] = 2] = \"ByPosNoHeight\";\n return QueryType})(QueryType$1 || (QueryType$1 = {}));\n const Epsilon = 1e-3;\n class HeightMap {\n constructor(length, // The number of characters covered\n height, // Height of this part of the document\n flags = 2 /* Flag.Outdated */) {\n this.length = length;\n this.height = height;\n this.flags = flags;\n }\n get outdated() { return (this.flags & 2 /* Flag.Outdated */) > 0; }\n set outdated(value) { this.flags = (value ? 2 /* Flag.Outdated */ : 0) | (this.flags & ~2 /* Flag.Outdated */); }\n setHeight(height) {\n if (this.height != height) {\n if (Math.abs(this.height - height) > Epsilon)\n heightChangeFlag = true;\n this.height = height;\n }\n }\n // Base case is to replace a leaf node, which simply builds a tree\n // from the new nodes and returns that (HeightMapBranch and\n // HeightMapGap override this to actually use from/to)\n replace(_from, _to, nodes) {\n return HeightMap.of(nodes);\n }\n // Again, these are base cases, and are overridden for branch and gap nodes.\n decomposeLeft(_to, result) { result.push(this); }\n decomposeRight(_from, result) { result.push(this); }\n applyChanges(decorations, oldDoc, oracle, changes) {\n let me = this, doc = oracle.doc;\n for (let i = changes.length - 1; i >= 0; i--) {\n let { fromA, toA, fromB, toB } = changes[i];\n let start = me.lineAt(fromA, QueryType$1.ByPosNoHeight, oracle.setDoc(oldDoc), 0, 0);\n let end = start.to >= toA ? start : me.lineAt(toA, QueryType$1.ByPosNoHeight, oracle, 0, 0);\n toB += end.to - toA;\n toA = end.to;\n while (i > 0 && start.from <= changes[i - 1].toA) {\n fromA = changes[i - 1].fromA;\n fromB = changes[i - 1].fromB;\n i--;\n if (fromA < start.from)\n start = me.lineAt(fromA, QueryType$1.ByPosNoHeight, oracle, 0, 0);\n }\n fromB += start.from - fromA;\n fromA = start.from;\n let nodes = NodeBuilder.build(oracle.setDoc(doc), decorations, fromB, toB);\n me = replace(me, me.replace(fromA, toA, nodes));\n }\n return me.updateHeight(oracle, 0);\n }\n static empty() { return new HeightMapText(0, 0); }\n // nodes uses null values to indicate the position of line breaks.\n // There are never line breaks at the start or end of the array, or\n // two line breaks next to each other, and the array isn't allowed\n // to be empty (same restrictions as return value from the builder).\n static of(nodes) {\n if (nodes.length == 1)\n return nodes[0];\n let i = 0, j = nodes.length, before = 0, after = 0;\n for (;;) {\n if (i == j) {\n if (before > after * 2) {\n let split = nodes[i - 1];\n if (split.break)\n nodes.splice(--i, 1, split.left, null, split.right);\n else\n nodes.splice(--i, 1, split.left, split.right);\n j += 1 + split.break;\n before -= split.size;\n }\n else if (after > before * 2) {\n let split = nodes[j];\n if (split.break)\n nodes.splice(j, 1, split.left, null, split.right);\n else\n nodes.splice(j, 1, split.left, split.right);\n j += 2 + split.break;\n after -= split.size;\n }\n else {\n break;\n }\n }\n else if (before < after) {\n let next = nodes[i++];\n if (next)\n before += next.size;\n }\n else {\n let next = nodes[--j];\n if (next)\n after += next.size;\n }\n }\n let brk = 0;\n if (nodes[i - 1] == null) {\n brk = 1;\n i--;\n }\n else if (nodes[i] == null) {\n brk = 1;\n j++;\n }\n return new HeightMapBranch(HeightMap.of(nodes.slice(0, i)), brk, HeightMap.of(nodes.slice(j)));\n }\n }\n function replace(old, val) {\n if (old == val)\n return old;\n if (old.constructor != val.constructor)\n heightChangeFlag = true;\n return val;\n }\n HeightMap.prototype.size = 1;\n class HeightMapBlock extends HeightMap {\n constructor(length, height, deco) {\n super(length, height);\n this.deco = deco;\n }\n blockAt(_height, _oracle, top, offset) {\n return new BlockInfo(offset, this.length, top, this.height, this.deco || 0);\n }\n lineAt(_value, _type, oracle, top, offset) {\n return this.blockAt(0, oracle, top, offset);\n }\n forEachLine(from, to, oracle, top, offset, f) {\n if (from <= offset + this.length && to >= offset)\n f(this.blockAt(0, oracle, top, offset));\n }\n updateHeight(oracle, offset = 0, _force = false, measured) {\n if (measured && measured.from <= offset && measured.more)\n this.setHeight(measured.heights[measured.index++]);\n this.outdated = false;\n return this;\n }\n toString() { return `block(${this.length})`; }\n }\n class HeightMapText extends HeightMapBlock {\n constructor(length, height) {\n super(length, height, null);\n this.collapsed = 0; // Amount of collapsed content in the line\n this.widgetHeight = 0; // Maximum inline widget height\n this.breaks = 0; // Number of widget-introduced line breaks on the line\n }\n blockAt(_height, _oracle, top, offset) {\n return new BlockInfo(offset, this.length, top, this.height, this.breaks);\n }\n replace(_from, _to, nodes) {\n let node = nodes[0];\n if (nodes.length == 1 && (node instanceof HeightMapText || node instanceof HeightMapGap && (node.flags & 4 /* Flag.SingleLine */)) &&\n Math.abs(this.length - node.length) < 10) {\n if (node instanceof HeightMapGap)\n node = new HeightMapText(node.length, this.height);\n else\n node.height = this.height;\n if (!this.outdated)\n node.outdated = false;\n return node;\n }\n else {\n return HeightMap.of(nodes);\n }\n }\n updateHeight(oracle, offset = 0, force = false, measured) {\n if (measured && measured.from <= offset && measured.more)\n this.setHeight(measured.heights[measured.index++]);\n else if (force || this.outdated)\n this.setHeight(Math.max(this.widgetHeight, oracle.heightForLine(this.length - this.collapsed)) +\n this.breaks * oracle.lineHeight);\n this.outdated = false;\n return this;\n }\n toString() {\n return `line(${this.length}${this.collapsed ? -this.collapsed : \"\"}${this.widgetHeight ? \":\" + this.widgetHeight : \"\"})`;\n }\n }\n class HeightMapGap extends HeightMap {\n constructor(length) { super(length, 0); }\n heightMetrics(oracle, offset) {\n let firstLine = oracle.doc.lineAt(offset).number, lastLine = oracle.doc.lineAt(offset + this.length).number;\n let lines = lastLine - firstLine + 1;\n let perLine, perChar = 0;\n if (oracle.lineWrapping) {\n let totalPerLine = Math.min(this.height, oracle.lineHeight * lines);\n perLine = totalPerLine / lines;\n if (this.length > lines + 1)\n perChar = (this.height - totalPerLine) / (this.length - lines - 1);\n }\n else {\n perLine = this.height / lines;\n }\n return { firstLine, lastLine, perLine, perChar };\n }\n blockAt(height, oracle, top, offset) {\n let { firstLine, lastLine, perLine, perChar } = this.heightMetrics(oracle, offset);\n if (oracle.lineWrapping) {\n let guess = offset + (height < oracle.lineHeight ? 0\n : Math.round(Math.max(0, Math.min(1, (height - top) / this.height)) * this.length));\n let line = oracle.doc.lineAt(guess), lineHeight = perLine + line.length * perChar;\n let lineTop = Math.max(top, height - lineHeight / 2);\n return new BlockInfo(line.from, line.length, lineTop, lineHeight, 0);\n }\n else {\n let line = Math.max(0, Math.min(lastLine - firstLine, Math.floor((height - top) / perLine)));\n let { from, length } = oracle.doc.line(firstLine + line);\n return new BlockInfo(from, length, top + perLine * line, perLine, 0);\n }\n }\n lineAt(value, type, oracle, top, offset) {\n if (type == QueryType$1.ByHeight)\n return this.blockAt(value, oracle, top, offset);\n if (type == QueryType$1.ByPosNoHeight) {\n let { from, to } = oracle.doc.lineAt(value);\n return new BlockInfo(from, to - from, 0, 0, 0);\n }\n let { firstLine, perLine, perChar } = this.heightMetrics(oracle, offset);\n let line = oracle.doc.lineAt(value), lineHeight = perLine + line.length * perChar;\n let linesAbove = line.number - firstLine;\n let lineTop = top + perLine * linesAbove + perChar * (line.from - offset - linesAbove);\n return new BlockInfo(line.from, line.length, Math.max(top, Math.min(lineTop, top + this.height - lineHeight)), lineHeight, 0);\n }\n forEachLine(from, to, oracle, top, offset, f) {\n from = Math.max(from, offset);\n to = Math.min(to, offset + this.length);\n let { firstLine, perLine, perChar } = this.heightMetrics(oracle, offset);\n for (let pos = from, lineTop = top; pos <= to;) {\n let line = oracle.doc.lineAt(pos);\n if (pos == from) {\n let linesAbove = line.number - firstLine;\n lineTop += perLine * linesAbove + perChar * (from - offset - linesAbove);\n }\n let lineHeight = perLine + perChar * line.length;\n f(new BlockInfo(line.from, line.length, lineTop, lineHeight, 0));\n lineTop += lineHeight;\n pos = line.to + 1;\n }\n }\n replace(from, to, nodes) {\n let after = this.length - to;\n if (after > 0) {\n let last = nodes[nodes.length - 1];\n if (last instanceof HeightMapGap)\n nodes[nodes.length - 1] = new HeightMapGap(last.length + after);\n else\n nodes.push(null, new HeightMapGap(after - 1));\n }\n if (from > 0) {\n let first = nodes[0];\n if (first instanceof HeightMapGap)\n nodes[0] = new HeightMapGap(from + first.length);\n else\n nodes.unshift(new HeightMapGap(from - 1), null);\n }\n return HeightMap.of(nodes);\n }\n decomposeLeft(to, result) {\n result.push(new HeightMapGap(to - 1), null);\n }\n decomposeRight(from, result) {\n result.push(null, new HeightMapGap(this.length - from - 1));\n }\n updateHeight(oracle, offset = 0, force = false, measured) {\n let end = offset + this.length;\n if (measured && measured.from <= offset + this.length && measured.more) {\n // Fill in part of this gap with measured lines. We know there\n // can't be widgets or collapsed ranges in those lines, because\n // they would already have been added to the heightmap (gaps\n // only contain plain text).\n let nodes = [], pos = Math.max(offset, measured.from), singleHeight = -1;\n if (measured.from > offset)\n nodes.push(new HeightMapGap(measured.from - offset - 1).updateHeight(oracle, offset));\n while (pos <= end && measured.more) {\n let len = oracle.doc.lineAt(pos).length;\n if (nodes.length)\n nodes.push(null);\n let height = measured.heights[measured.index++];\n if (singleHeight == -1)\n singleHeight = height;\n else if (Math.abs(height - singleHeight) >= Epsilon)\n singleHeight = -2;\n let line = new HeightMapText(len, height);\n line.outdated = false;\n nodes.push(line);\n pos += len + 1;\n }\n if (pos <= end)\n nodes.push(null, new HeightMapGap(end - pos).updateHeight(oracle, pos));\n let result = HeightMap.of(nodes);\n if (singleHeight < 0 || Math.abs(result.height - this.height) >= Epsilon ||\n Math.abs(singleHeight - this.heightMetrics(oracle, offset).perLine) >= Epsilon)\n heightChangeFlag = true;\n return replace(this, result);\n }\n else if (force || this.outdated) {\n this.setHeight(oracle.heightForGap(offset, offset + this.length));\n this.outdated = false;\n }\n return this;\n }\n toString() { return `gap(${this.length})`; }\n }\n class HeightMapBranch extends HeightMap {\n constructor(left, brk, right) {\n super(left.length + brk + right.length, left.height + right.height, brk | (left.outdated || right.outdated ? 2 /* Flag.Outdated */ : 0));\n this.left = left;\n this.right = right;\n this.size = left.size + right.size;\n }\n get break() { return this.flags & 1 /* Flag.Break */; }\n blockAt(height, oracle, top, offset) {\n let mid = top + this.left.height;\n return height < mid ? this.left.blockAt(height, oracle, top, offset)\n : this.right.blockAt(height, oracle, mid, offset + this.left.length + this.break);\n }\n lineAt(value, type, oracle, top, offset) {\n let rightTop = top + this.left.height, rightOffset = offset + this.left.length + this.break;\n let left = type == QueryType$1.ByHeight ? value < rightTop : value < rightOffset;\n let base = left ? this.left.lineAt(value, type, oracle, top, offset)\n : this.right.lineAt(value, type, oracle, rightTop, rightOffset);\n if (this.break || (left ? base.to < rightOffset : base.from > rightOffset))\n return base;\n let subQuery = type == QueryType$1.ByPosNoHeight ? QueryType$1.ByPosNoHeight : QueryType$1.ByPos;\n if (left)\n return base.join(this.right.lineAt(rightOffset, subQuery, oracle, rightTop, rightOffset));\n else\n return this.left.lineAt(rightOffset, subQuery, oracle, top, offset).join(base);\n }\n forEachLine(from, to, oracle, top, offset, f) {\n let rightTop = top + this.left.height, rightOffset = offset + this.left.length + this.break;\n if (this.break) {\n if (from < rightOffset)\n this.left.forEachLine(from, to, oracle, top, offset, f);\n if (to >= rightOffset)\n this.right.forEachLine(from, to, oracle, rightTop, rightOffset, f);\n }\n else {\n let mid = this.lineAt(rightOffset, QueryType$1.ByPos, oracle, top, offset);\n if (from < mid.from)\n this.left.forEachLine(from, mid.from - 1, oracle, top, offset, f);\n if (mid.to >= from && mid.from <= to)\n f(mid);\n if (to > mid.to)\n this.right.forEachLine(mid.to + 1, to, oracle, rightTop, rightOffset, f);\n }\n }\n replace(from, to, nodes) {\n let rightStart = this.left.length + this.break;\n if (to < rightStart)\n return this.balanced(this.left.replace(from, to, nodes), this.right);\n if (from > this.left.length)\n return this.balanced(this.left, this.right.replace(from - rightStart, to - rightStart, nodes));\n let result = [];\n if (from > 0)\n this.decomposeLeft(from, result);\n let left = result.length;\n for (let node of nodes)\n result.push(node);\n if (from > 0)\n mergeGaps(result, left - 1);\n if (to < this.length) {\n let right = result.length;\n this.decomposeRight(to, result);\n mergeGaps(result, right);\n }\n return HeightMap.of(result);\n }\n decomposeLeft(to, result) {\n let left = this.left.length;\n if (to <= left)\n return this.left.decomposeLeft(to, result);\n result.push(this.left);\n if (this.break) {\n left++;\n if (to >= left)\n result.push(null);\n }\n if (to > left)\n this.right.decomposeLeft(to - left, result);\n }\n decomposeRight(from, result) {\n let left = this.left.length, right = left + this.break;\n if (from >= right)\n return this.right.decomposeRight(from - right, result);\n if (from < left)\n this.left.decomposeRight(from, result);\n if (this.break && from < right)\n result.push(null);\n result.push(this.right);\n }\n balanced(left, right) {\n if (left.size > 2 * right.size || right.size > 2 * left.size)\n return HeightMap.of(this.break ? [left, null, right] : [left, right]);\n this.left = replace(this.left, left);\n this.right = replace(this.right, right);\n this.setHeight(left.height + right.height);\n this.outdated = left.outdated || right.outdated;\n this.size = left.size + right.size;\n this.length = left.length + this.break + right.length;\n return this;\n }\n updateHeight(oracle, offset = 0, force = false, measured) {\n let { left, right } = this, rightStart = offset + left.length + this.break, rebalance = null;\n if (measured && measured.from <= offset + left.length && measured.more)\n rebalance = left = left.updateHeight(oracle, offset, force, measured);\n else\n left.updateHeight(oracle, offset, force);\n if (measured && measured.from <= rightStart + right.length && measured.more)\n rebalance = right = right.updateHeight(oracle, rightStart, force, measured);\n else\n right.updateHeight(oracle, rightStart, force);\n if (rebalance)\n return this.balanced(left, right);\n this.height = this.left.height + this.right.height;\n this.outdated = false;\n return this;\n }\n toString() { return this.left + (this.break ? \" \" : \"-\") + this.right; }\n }\n function mergeGaps(nodes, around) {\n let before, after;\n if (nodes[around] == null &&\n (before = nodes[around - 1]) instanceof HeightMapGap &&\n (after = nodes[around + 1]) instanceof HeightMapGap)\n nodes.splice(around - 1, 3, new HeightMapGap(before.length + 1 + after.length));\n }\n const relevantWidgetHeight = 5;\n class NodeBuilder {\n constructor(pos, oracle) {\n this.pos = pos;\n this.oracle = oracle;\n this.nodes = [];\n this.lineStart = -1;\n this.lineEnd = -1;\n this.covering = null;\n this.writtenTo = pos;\n }\n get isCovered() {\n return this.covering && this.nodes[this.nodes.length - 1] == this.covering;\n }\n span(_from, to) {\n if (this.lineStart > -1) {\n let end = Math.min(to, this.lineEnd), last = this.nodes[this.nodes.length - 1];\n if (last instanceof HeightMapText)\n last.length += end - this.pos;\n else if (end > this.pos || !this.isCovered)\n this.nodes.push(new HeightMapText(end - this.pos, -1));\n this.writtenTo = end;\n if (to > end) {\n this.nodes.push(null);\n this.writtenTo++;\n this.lineStart = -1;\n }\n }\n this.pos = to;\n }\n point(from, to, deco) {\n if (from < to || deco.heightRelevant) {\n let height = deco.widget ? deco.widget.estimatedHeight : 0;\n let breaks = deco.widget ? deco.widget.lineBreaks : 0;\n if (height < 0)\n height = this.oracle.lineHeight;\n let len = to - from;\n if (deco.block) {\n this.addBlock(new HeightMapBlock(len, height, deco));\n }\n else if (len || breaks || height >= relevantWidgetHeight) {\n this.addLineDeco(height, breaks, len);\n }\n }\n else if (to > from) {\n this.span(from, to);\n }\n if (this.lineEnd > -1 && this.lineEnd < this.pos)\n this.lineEnd = this.oracle.doc.lineAt(this.pos).to;\n }\n enterLine() {\n if (this.lineStart > -1)\n return;\n let { from, to } = this.oracle.doc.lineAt(this.pos);\n this.lineStart = from;\n this.lineEnd = to;\n if (this.writtenTo < from) {\n if (this.writtenTo < from - 1 || this.nodes[this.nodes.length - 1] == null)\n this.nodes.push(this.blankContent(this.writtenTo, from - 1));\n this.nodes.push(null);\n }\n if (this.pos > from)\n this.nodes.push(new HeightMapText(this.pos - from, -1));\n this.writtenTo = this.pos;\n }\n blankContent(from, to) {\n let gap = new HeightMapGap(to - from);\n if (this.oracle.doc.lineAt(from).to == to)\n gap.flags |= 4 /* Flag.SingleLine */;\n return gap;\n }\n ensureLine() {\n this.enterLine();\n let last = this.nodes.length ? this.nodes[this.nodes.length - 1] : null;\n if (last instanceof HeightMapText)\n return last;\n let line = new HeightMapText(0, -1);\n this.nodes.push(line);\n return line;\n }\n addBlock(block) {\n this.enterLine();\n let deco = block.deco;\n if (deco && deco.startSide > 0 && !this.isCovered)\n this.ensureLine();\n this.nodes.push(block);\n this.writtenTo = this.pos = this.pos + block.length;\n if (deco && deco.endSide > 0)\n this.covering = block;\n }\n addLineDeco(height, breaks, length) {\n let line = this.ensureLine();\n line.length += length;\n line.collapsed += length;\n line.widgetHeight = Math.max(line.widgetHeight, height);\n line.breaks += breaks;\n this.writtenTo = this.pos = this.pos + length;\n }\n finish(from) {\n let last = this.nodes.length == 0 ? null : this.nodes[this.nodes.length - 1];\n if (this.lineStart > -1 && !(last instanceof HeightMapText) && !this.isCovered)\n this.nodes.push(new HeightMapText(0, -1));\n else if (this.writtenTo < this.pos || last == null)\n this.nodes.push(this.blankContent(this.writtenTo, this.pos));\n let pos = from;\n for (let node of this.nodes) {\n if (node instanceof HeightMapText)\n node.updateHeight(this.oracle, pos);\n pos += node ? node.length : 1;\n }\n return this.nodes;\n }\n // Always called with a region that on both sides either stretches\n // to a line break or the end of the document.\n // The returned array uses null to indicate line breaks, but never\n // starts or ends in a line break, or has multiple line breaks next\n // to each other.\n static build(oracle, decorations, from, to) {\n let builder = new NodeBuilder(from, oracle);\n RangeSet.spans(decorations, from, to, builder, 0);\n return builder.finish(from);\n }\n }\n function heightRelevantDecoChanges(a, b, diff) {\n let comp = new DecorationComparator;\n RangeSet.compare(a, b, diff, comp, 0);\n return comp.changes;\n }\n class DecorationComparator {\n constructor() {\n this.changes = [];\n }\n compareRange() { }\n comparePoint(from, to, a, b) {\n if (from < to || a && a.heightRelevant || b && b.heightRelevant)\n addRange(from, to, this.changes, 5);\n }\n }\n\n function visiblePixelRange(dom, paddingTop) {\n let rect = dom.getBoundingClientRect();\n let doc = dom.ownerDocument, win = doc.defaultView || window;\n let left = Math.max(0, rect.left), right = Math.min(win.innerWidth, rect.right);\n let top = Math.max(0, rect.top), bottom = Math.min(win.innerHeight, rect.bottom);\n for (let parent = dom.parentNode; parent && parent != doc.body;) {\n if (parent.nodeType == 1) {\n let elt = parent;\n let style = window.getComputedStyle(elt);\n if ((elt.scrollHeight > elt.clientHeight || elt.scrollWidth > elt.clientWidth) &&\n style.overflow != \"visible\") {\n let parentRect = elt.getBoundingClientRect();\n left = Math.max(left, parentRect.left);\n right = Math.min(right, parentRect.right);\n top = Math.max(top, parentRect.top);\n bottom = parent == dom.parentNode ? parentRect.bottom : Math.min(bottom, parentRect.bottom);\n }\n parent = style.position == \"absolute\" || style.position == \"fixed\" ? elt.offsetParent : elt.parentNode;\n }\n else if (parent.nodeType == 11) { // Shadow root\n parent = parent.host;\n }\n else {\n break;\n }\n }\n return { left: left - rect.left, right: Math.max(left, right) - rect.left,\n top: top - (rect.top + paddingTop), bottom: Math.max(top, bottom) - (rect.top + paddingTop) };\n }\n function fullPixelRange(dom, paddingTop) {\n let rect = dom.getBoundingClientRect();\n return { left: 0, right: rect.right - rect.left,\n top: paddingTop, bottom: rect.bottom - (rect.top + paddingTop) };\n }\n // Line gaps are placeholder widgets used to hide pieces of overlong\n // lines within the viewport, as a kludge to keep the editor\n // responsive when a ridiculously long line is loaded into it.\n class LineGap {\n constructor(from, to, size) {\n this.from = from;\n this.to = to;\n this.size = size;\n }\n static same(a, b) {\n if (a.length != b.length)\n return false;\n for (let i = 0; i < a.length; i++) {\n let gA = a[i], gB = b[i];\n if (gA.from != gB.from || gA.to != gB.to || gA.size != gB.size)\n return false;\n }\n return true;\n }\n draw(viewState, wrapping) {\n return Decoration.replace({\n widget: new LineGapWidget(this.size * (wrapping ? viewState.scaleY : viewState.scaleX), wrapping)\n }).range(this.from, this.to);\n }\n }\n class LineGapWidget extends WidgetType {\n constructor(size, vertical) {\n super();\n this.size = size;\n this.vertical = vertical;\n }\n eq(other) { return other.size == this.size && other.vertical == this.vertical; }\n toDOM() {\n let elt = document.createElement(\"div\");\n if (this.vertical) {\n elt.style.height = this.size + \"px\";\n }\n else {\n elt.style.width = this.size + \"px\";\n elt.style.height = \"2px\";\n elt.style.display = \"inline-block\";\n }\n return elt;\n }\n get estimatedHeight() { return this.vertical ? this.size : -1; }\n }\n class ViewState {\n constructor(state) {\n this.state = state;\n // These are contentDOM-local coordinates\n this.pixelViewport = { left: 0, right: window.innerWidth, top: 0, bottom: 0 };\n this.inView = true;\n this.paddingTop = 0; // Padding above the document, scaled\n this.paddingBottom = 0; // Padding below the document, scaled\n this.contentDOMWidth = 0; // contentDOM.getBoundingClientRect().width\n this.contentDOMHeight = 0; // contentDOM.getBoundingClientRect().height\n this.editorHeight = 0; // scrollDOM.clientHeight, unscaled\n this.editorWidth = 0; // scrollDOM.clientWidth, unscaled\n this.scrollTop = 0; // Last seen scrollDOM.scrollTop, scaled\n this.scrolledToBottom = false;\n // The CSS-transformation scale of the editor (transformed size /\n // concrete size)\n this.scaleX = 1;\n this.scaleY = 1;\n // The vertical position (document-relative) to which to anchor the\n // scroll position. -1 means anchor to the end of the document.\n this.scrollAnchorPos = 0;\n // The height at the anchor position. Set by the DOM update phase.\n // -1 means no height available.\n this.scrollAnchorHeight = -1;\n // See VP.MaxDOMHeight\n this.scaler = IdScaler;\n this.scrollTarget = null;\n // Briefly set to true when printing, to disable viewport limiting\n this.printing = false;\n // Flag set when editor content was redrawn, so that the next\n // measure stage knows it must read DOM layout\n this.mustMeasureContent = true;\n this.defaultTextDirection = Direction.LTR;\n this.visibleRanges = [];\n // Cursor 'assoc' is only significant when the cursor is on a line\n // wrap point, where it must stick to the character that it is\n // associated with. Since browsers don't provide a reasonable\n // interface to set or query this, when a selection is set that\n // might cause this to be significant, this flag is set. The next\n // measure phase will check whether the cursor is on a line-wrapping\n // boundary and, if so, reset it to make sure it is positioned in\n // the right place.\n this.mustEnforceCursorAssoc = false;\n let guessWrapping = state.facet(contentAttributes).some(v => typeof v != \"function\" && v.class == \"cm-lineWrapping\");\n this.heightOracle = new HeightOracle(guessWrapping);\n this.stateDeco = state.facet(decorations).filter(d => typeof d != \"function\");\n this.heightMap = HeightMap.empty().applyChanges(this.stateDeco, Text.empty, this.heightOracle.setDoc(state.doc), [new ChangedRange(0, 0, 0, state.doc.length)]);\n for (let i = 0; i < 2; i++) {\n this.viewport = this.getViewport(0, null);\n if (!this.updateForViewport())\n break;\n }\n this.updateViewportLines();\n this.lineGaps = this.ensureLineGaps([]);\n this.lineGapDeco = Decoration.set(this.lineGaps.map(gap => gap.draw(this, false)));\n this.computeVisibleRanges();\n }\n updateForViewport() {\n let viewports = [this.viewport], { main } = this.state.selection;\n for (let i = 0; i <= 1; i++) {\n let pos = i ? main.head : main.anchor;\n if (!viewports.some(({ from, to }) => pos >= from && pos <= to)) {\n let { from, to } = this.lineBlockAt(pos);\n viewports.push(new Viewport(from, to));\n }\n }\n this.viewports = viewports.sort((a, b) => a.from - b.from);\n return this.updateScaler();\n }\n updateScaler() {\n let scaler = this.scaler;\n this.scaler = this.heightMap.height <= 7000000 /* VP.MaxDOMHeight */ ? IdScaler :\n new BigScaler(this.heightOracle, this.heightMap, this.viewports);\n return scaler.eq(this.scaler) ? 0 : 2 /* UpdateFlag.Height */;\n }\n updateViewportLines() {\n this.viewportLines = [];\n this.heightMap.forEachLine(this.viewport.from, this.viewport.to, this.heightOracle.setDoc(this.state.doc), 0, 0, block => {\n this.viewportLines.push(scaleBlock(block, this.scaler));\n });\n }\n update(update, scrollTarget = null) {\n this.state = update.state;\n let prevDeco = this.stateDeco;\n this.stateDeco = this.state.facet(decorations).filter(d => typeof d != \"function\");\n let contentChanges = update.changedRanges;\n let heightChanges = ChangedRange.extendWithRanges(contentChanges, heightRelevantDecoChanges(prevDeco, this.stateDeco, update ? update.changes : ChangeSet.empty(this.state.doc.length)));\n let prevHeight = this.heightMap.height;\n let scrollAnchor = this.scrolledToBottom ? null : this.scrollAnchorAt(this.scrollTop);\n clearHeightChangeFlag();\n this.heightMap = this.heightMap.applyChanges(this.stateDeco, update.startState.doc, this.heightOracle.setDoc(this.state.doc), heightChanges);\n if (this.heightMap.height != prevHeight || heightChangeFlag)\n update.flags |= 2 /* UpdateFlag.Height */;\n if (scrollAnchor) {\n this.scrollAnchorPos = update.changes.mapPos(scrollAnchor.from, -1);\n this.scrollAnchorHeight = scrollAnchor.top;\n }\n else {\n this.scrollAnchorPos = -1;\n this.scrollAnchorHeight = this.heightMap.height;\n }\n let viewport = heightChanges.length ? this.mapViewport(this.viewport, update.changes) : this.viewport;\n if (scrollTarget && (scrollTarget.range.head < viewport.from || scrollTarget.range.head > viewport.to) ||\n !this.viewportIsAppropriate(viewport))\n viewport = this.getViewport(0, scrollTarget);\n let viewportChange = viewport.from != this.viewport.from || viewport.to != this.viewport.to;\n this.viewport = viewport;\n update.flags |= this.updateForViewport();\n if (viewportChange || !update.changes.empty || (update.flags & 2 /* UpdateFlag.Height */))\n this.updateViewportLines();\n if (this.lineGaps.length || this.viewport.to - this.viewport.from > (2000 /* LG.Margin */ << 1))\n this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps, update.changes)));\n update.flags |= this.computeVisibleRanges();\n if (scrollTarget)\n this.scrollTarget = scrollTarget;\n if (!this.mustEnforceCursorAssoc && update.selectionSet && update.view.lineWrapping &&\n update.state.selection.main.empty && update.state.selection.main.assoc &&\n !update.state.facet(nativeSelectionHidden))\n this.mustEnforceCursorAssoc = true;\n }\n measure(view) {\n let dom = view.contentDOM, style = window.getComputedStyle(dom);\n let oracle = this.heightOracle;\n let whiteSpace = style.whiteSpace;\n this.defaultTextDirection = style.direction == \"rtl\" ? Direction.RTL : Direction.LTR;\n let refresh = this.heightOracle.mustRefreshForWrapping(whiteSpace);\n let domRect = dom.getBoundingClientRect();\n let measureContent = refresh || this.mustMeasureContent || this.contentDOMHeight != domRect.height;\n this.contentDOMHeight = domRect.height;\n this.mustMeasureContent = false;\n let result = 0, bias = 0;\n if (domRect.width && domRect.height) {\n let { scaleX, scaleY } = getScale(dom, domRect);\n if (scaleX > .005 && Math.abs(this.scaleX - scaleX) > .005 ||\n scaleY > .005 && Math.abs(this.scaleY - scaleY) > .005) {\n this.scaleX = scaleX;\n this.scaleY = scaleY;\n result |= 8 /* UpdateFlag.Geometry */;\n refresh = measureContent = true;\n }\n }\n // Vertical padding\n let paddingTop = (parseInt(style.paddingTop) || 0) * this.scaleY;\n let paddingBottom = (parseInt(style.paddingBottom) || 0) * this.scaleY;\n if (this.paddingTop != paddingTop || this.paddingBottom != paddingBottom) {\n this.paddingTop = paddingTop;\n this.paddingBottom = paddingBottom;\n result |= 8 /* UpdateFlag.Geometry */ | 2 /* UpdateFlag.Height */;\n }\n if (this.editorWidth != view.scrollDOM.clientWidth) {\n if (oracle.lineWrapping)\n measureContent = true;\n this.editorWidth = view.scrollDOM.clientWidth;\n result |= 8 /* UpdateFlag.Geometry */;\n }\n let scrollTop = view.scrollDOM.scrollTop * this.scaleY;\n if (this.scrollTop != scrollTop) {\n this.scrollAnchorHeight = -1;\n this.scrollTop = scrollTop;\n }\n this.scrolledToBottom = isScrolledToBottom(view.scrollDOM);\n // Pixel viewport\n let pixelViewport = (this.printing ? fullPixelRange : visiblePixelRange)(dom, this.paddingTop);\n let dTop = pixelViewport.top - this.pixelViewport.top, dBottom = pixelViewport.bottom - this.pixelViewport.bottom;\n this.pixelViewport = pixelViewport;\n let inView = this.pixelViewport.bottom > this.pixelViewport.top && this.pixelViewport.right > this.pixelViewport.left;\n if (inView != this.inView) {\n this.inView = inView;\n if (inView)\n measureContent = true;\n }\n if (!this.inView && !this.scrollTarget)\n return 0;\n let contentWidth = domRect.width;\n if (this.contentDOMWidth != contentWidth || this.editorHeight != view.scrollDOM.clientHeight) {\n this.contentDOMWidth = domRect.width;\n this.editorHeight = view.scrollDOM.clientHeight;\n result |= 8 /* UpdateFlag.Geometry */;\n }\n if (measureContent) {\n let lineHeights = view.docView.measureVisibleLineHeights(this.viewport);\n if (oracle.mustRefreshForHeights(lineHeights))\n refresh = true;\n if (refresh || oracle.lineWrapping && Math.abs(contentWidth - this.contentDOMWidth) > oracle.charWidth) {\n let { lineHeight, charWidth, textHeight } = view.docView.measureTextSize();\n refresh = lineHeight > 0 && oracle.refresh(whiteSpace, lineHeight, charWidth, textHeight, contentWidth / charWidth, lineHeights);\n if (refresh) {\n view.docView.minWidth = 0;\n result |= 8 /* UpdateFlag.Geometry */;\n }\n }\n if (dTop > 0 && dBottom > 0)\n bias = Math.max(dTop, dBottom);\n else if (dTop < 0 && dBottom < 0)\n bias = Math.min(dTop, dBottom);\n clearHeightChangeFlag();\n for (let vp of this.viewports) {\n let heights = vp.from == this.viewport.from ? lineHeights : view.docView.measureVisibleLineHeights(vp);\n this.heightMap = (refresh ? HeightMap.empty().applyChanges(this.stateDeco, Text.empty, this.heightOracle, [new ChangedRange(0, 0, 0, view.state.doc.length)]) : this.heightMap).updateHeight(oracle, 0, refresh, new MeasuredHeights(vp.from, heights));\n }\n if (heightChangeFlag)\n result |= 2 /* UpdateFlag.Height */;\n }\n let viewportChange = !this.viewportIsAppropriate(this.viewport, bias) ||\n this.scrollTarget && (this.scrollTarget.range.head < this.viewport.from ||\n this.scrollTarget.range.head > this.viewport.to);\n if (viewportChange) {\n if (result & 2 /* UpdateFlag.Height */)\n result |= this.updateScaler();\n this.viewport = this.getViewport(bias, this.scrollTarget);\n result |= this.updateForViewport();\n }\n if ((result & 2 /* UpdateFlag.Height */) || viewportChange)\n this.updateViewportLines();\n if (this.lineGaps.length || this.viewport.to - this.viewport.from > (2000 /* LG.Margin */ << 1))\n this.updateLineGaps(this.ensureLineGaps(refresh ? [] : this.lineGaps, view));\n result |= this.computeVisibleRanges();\n if (this.mustEnforceCursorAssoc) {\n this.mustEnforceCursorAssoc = false;\n // This is done in the read stage, because moving the selection\n // to a line end is going to trigger a layout anyway, so it\n // can't be a pure write. It should be rare that it does any\n // writing.\n view.docView.enforceCursorAssoc();\n }\n return result;\n }\n get visibleTop() { return this.scaler.fromDOM(this.pixelViewport.top); }\n get visibleBottom() { return this.scaler.fromDOM(this.pixelViewport.bottom); }\n getViewport(bias, scrollTarget) {\n // This will divide VP.Margin between the top and the\n // bottom, depending on the bias (the change in viewport position\n // since the last update). It'll hold a number between 0 and 1\n let marginTop = 0.5 - Math.max(-0.5, Math.min(0.5, bias / 1000 /* VP.Margin */ / 2));\n let map = this.heightMap, oracle = this.heightOracle;\n let { visibleTop, visibleBottom } = this;\n let viewport = new Viewport(map.lineAt(visibleTop - marginTop * 1000 /* VP.Margin */, QueryType$1.ByHeight, oracle, 0, 0).from, map.lineAt(visibleBottom + (1 - marginTop) * 1000 /* VP.Margin */, QueryType$1.ByHeight, oracle, 0, 0).to);\n // If scrollTarget is given, make sure the viewport includes that position\n if (scrollTarget) {\n let { head } = scrollTarget.range;\n if (head < viewport.from || head > viewport.to) {\n let viewHeight = Math.min(this.editorHeight, this.pixelViewport.bottom - this.pixelViewport.top);\n let block = map.lineAt(head, QueryType$1.ByPos, oracle, 0, 0), topPos;\n if (scrollTarget.y == \"center\")\n topPos = (block.top + block.bottom) / 2 - viewHeight / 2;\n else if (scrollTarget.y == \"start\" || scrollTarget.y == \"nearest\" && head < viewport.from)\n topPos = block.top;\n else\n topPos = block.bottom - viewHeight;\n viewport = new Viewport(map.lineAt(topPos - 1000 /* VP.Margin */ / 2, QueryType$1.ByHeight, oracle, 0, 0).from, map.lineAt(topPos + viewHeight + 1000 /* VP.Margin */ / 2, QueryType$1.ByHeight, oracle, 0, 0).to);\n }\n }\n return viewport;\n }\n mapViewport(viewport, changes) {\n let from = changes.mapPos(viewport.from, -1), to = changes.mapPos(viewport.to, 1);\n return new Viewport(this.heightMap.lineAt(from, QueryType$1.ByPos, this.heightOracle, 0, 0).from, this.heightMap.lineAt(to, QueryType$1.ByPos, this.heightOracle, 0, 0).to);\n }\n // Checks if a given viewport covers the visible part of the\n // document and not too much beyond that.\n viewportIsAppropriate({ from, to }, bias = 0) {\n if (!this.inView)\n return true;\n let { top } = this.heightMap.lineAt(from, QueryType$1.ByPos, this.heightOracle, 0, 0);\n let { bottom } = this.heightMap.lineAt(to, QueryType$1.ByPos, this.heightOracle, 0, 0);\n let { visibleTop, visibleBottom } = this;\n return (from == 0 || top <= visibleTop - Math.max(10 /* VP.MinCoverMargin */, Math.min(-bias, 250 /* VP.MaxCoverMargin */))) &&\n (to == this.state.doc.length ||\n bottom >= visibleBottom + Math.max(10 /* VP.MinCoverMargin */, Math.min(bias, 250 /* VP.MaxCoverMargin */))) &&\n (top > visibleTop - 2 * 1000 /* VP.Margin */ && bottom < visibleBottom + 2 * 1000 /* VP.Margin */);\n }\n mapLineGaps(gaps, changes) {\n if (!gaps.length || changes.empty)\n return gaps;\n let mapped = [];\n for (let gap of gaps)\n if (!changes.touchesRange(gap.from, gap.to))\n mapped.push(new LineGap(changes.mapPos(gap.from), changes.mapPos(gap.to), gap.size));\n return mapped;\n }\n // Computes positions in the viewport where the start or end of a\n // line should be hidden, trying to reuse existing line gaps when\n // appropriate to avoid unneccesary redraws.\n // Uses crude character-counting for the positioning and sizing,\n // since actual DOM coordinates aren't always available and\n // predictable. Relies on generous margins (see LG.Margin) to hide\n // the artifacts this might produce from the user.\n ensureLineGaps(current, mayMeasure) {\n let wrapping = this.heightOracle.lineWrapping;\n let margin = wrapping ? 10000 /* LG.MarginWrap */ : 2000 /* LG.Margin */, halfMargin = margin >> 1, doubleMargin = margin << 1;\n // The non-wrapping logic won't work at all in predominantly right-to-left text.\n if (this.defaultTextDirection != Direction.LTR && !wrapping)\n return [];\n let gaps = [];\n let addGap = (from, to, line, structure) => {\n if (to - from < halfMargin)\n return;\n let sel = this.state.selection.main, avoid = [sel.from];\n if (!sel.empty)\n avoid.push(sel.to);\n for (let pos of avoid) {\n if (pos > from && pos < to) {\n addGap(from, pos - 10 /* LG.SelectionMargin */, line, structure);\n addGap(pos + 10 /* LG.SelectionMargin */, to, line, structure);\n return;\n }\n }\n let gap = find$1(current, gap => gap.from >= line.from && gap.to <= line.to &&\n Math.abs(gap.from - from) < halfMargin && Math.abs(gap.to - to) < halfMargin &&\n !avoid.some(pos => gap.from < pos && gap.to > pos));\n if (!gap) {\n // When scrolling down, snap gap ends to line starts to avoid shifts in wrapping\n if (to < line.to && mayMeasure && wrapping &&\n mayMeasure.visibleRanges.some(r => r.from <= to && r.to >= to)) {\n let lineStart = mayMeasure.moveToLineBoundary(EditorSelection.cursor(to), false, true).head;\n if (lineStart > from)\n to = lineStart;\n }\n gap = new LineGap(from, to, this.gapSize(line, from, to, structure));\n }\n gaps.push(gap);\n };\n let checkLine = (line) => {\n if (line.length < doubleMargin || line.type != BlockType.Text)\n return;\n let structure = lineStructure(line.from, line.to, this.stateDeco);\n if (structure.total < doubleMargin)\n return;\n let target = this.scrollTarget ? this.scrollTarget.range.head : null;\n let viewFrom, viewTo;\n if (wrapping) {\n let marginHeight = (margin / this.heightOracle.lineLength) * this.heightOracle.lineHeight;\n let top, bot;\n if (target != null) {\n let targetFrac = findFraction(structure, target);\n let spaceFrac = ((this.visibleBottom - this.visibleTop) / 2 + marginHeight) / line.height;\n top = targetFrac - spaceFrac;\n bot = targetFrac + spaceFrac;\n }\n else {\n top = (this.visibleTop - line.top - marginHeight) / line.height;\n bot = (this.visibleBottom - line.top + marginHeight) / line.height;\n }\n viewFrom = findPosition(structure, top);\n viewTo = findPosition(structure, bot);\n }\n else {\n let totalWidth = structure.total * this.heightOracle.charWidth;\n let marginWidth = margin * this.heightOracle.charWidth;\n let left, right;\n if (target != null) {\n let targetFrac = findFraction(structure, target);\n let spaceFrac = ((this.pixelViewport.right - this.pixelViewport.left) / 2 + marginWidth) / totalWidth;\n left = targetFrac - spaceFrac;\n right = targetFrac + spaceFrac;\n }\n else {\n left = (this.pixelViewport.left - marginWidth) / totalWidth;\n right = (this.pixelViewport.right + marginWidth) / totalWidth;\n }\n viewFrom = findPosition(structure, left);\n viewTo = findPosition(structure, right);\n }\n if (viewFrom > line.from)\n addGap(line.from, viewFrom, line, structure);\n if (viewTo < line.to)\n addGap(viewTo, line.to, line, structure);\n };\n for (let line of this.viewportLines) {\n if (Array.isArray(line.type))\n line.type.forEach(checkLine);\n else\n checkLine(line);\n }\n return gaps;\n }\n gapSize(line, from, to, structure) {\n let fraction = findFraction(structure, to) - findFraction(structure, from);\n if (this.heightOracle.lineWrapping) {\n return line.height * fraction;\n }\n else {\n return structure.total * this.heightOracle.charWidth * fraction;\n }\n }\n updateLineGaps(gaps) {\n if (!LineGap.same(gaps, this.lineGaps)) {\n this.lineGaps = gaps;\n this.lineGapDeco = Decoration.set(gaps.map(gap => gap.draw(this, this.heightOracle.lineWrapping)));\n }\n }\n computeVisibleRanges() {\n let deco = this.stateDeco;\n if (this.lineGaps.length)\n deco = deco.concat(this.lineGapDeco);\n let ranges = [];\n RangeSet.spans(deco, this.viewport.from, this.viewport.to, {\n span(from, to) { ranges.push({ from, to }); },\n point() { }\n }, 20);\n let changed = ranges.length != this.visibleRanges.length ||\n this.visibleRanges.some((r, i) => r.from != ranges[i].from || r.to != ranges[i].to);\n this.visibleRanges = ranges;\n return changed ? 4 /* UpdateFlag.Viewport */ : 0;\n }\n lineBlockAt(pos) {\n return (pos >= this.viewport.from && pos <= this.viewport.to &&\n this.viewportLines.find(b => b.from <= pos && b.to >= pos)) ||\n scaleBlock(this.heightMap.lineAt(pos, QueryType$1.ByPos, this.heightOracle, 0, 0), this.scaler);\n }\n lineBlockAtHeight(height) {\n return (height >= this.viewportLines[0].top && height <= this.viewportLines[this.viewportLines.length - 1].bottom &&\n this.viewportLines.find(l => l.top <= height && l.bottom >= height)) ||\n scaleBlock(this.heightMap.lineAt(this.scaler.fromDOM(height), QueryType$1.ByHeight, this.heightOracle, 0, 0), this.scaler);\n }\n scrollAnchorAt(scrollTop) {\n let block = this.lineBlockAtHeight(scrollTop + 8);\n return block.from >= this.viewport.from || this.viewportLines[0].top - scrollTop > 200 ? block : this.viewportLines[0];\n }\n elementAtHeight(height) {\n return scaleBlock(this.heightMap.blockAt(this.scaler.fromDOM(height), this.heightOracle, 0, 0), this.scaler);\n }\n get docHeight() {\n return this.scaler.toDOM(this.heightMap.height);\n }\n get contentHeight() {\n return this.docHeight + this.paddingTop + this.paddingBottom;\n }\n }\n class Viewport {\n constructor(from, to) {\n this.from = from;\n this.to = to;\n }\n }\n function lineStructure(from, to, stateDeco) {\n let ranges = [], pos = from, total = 0;\n RangeSet.spans(stateDeco, from, to, {\n span() { },\n point(from, to) {\n if (from > pos) {\n ranges.push({ from: pos, to: from });\n total += from - pos;\n }\n pos = to;\n }\n }, 20); // We're only interested in collapsed ranges of a significant size\n if (pos < to) {\n ranges.push({ from: pos, to });\n total += to - pos;\n }\n return { total, ranges };\n }\n function findPosition({ total, ranges }, ratio) {\n if (ratio <= 0)\n return ranges[0].from;\n if (ratio >= 1)\n return ranges[ranges.length - 1].to;\n let dist = Math.floor(total * ratio);\n for (let i = 0;; i++) {\n let { from, to } = ranges[i], size = to - from;\n if (dist <= size)\n return from + dist;\n dist -= size;\n }\n }\n function findFraction(structure, pos) {\n let counted = 0;\n for (let { from, to } of structure.ranges) {\n if (pos <= to) {\n counted += pos - from;\n break;\n }\n counted += to - from;\n }\n return counted / structure.total;\n }\n function find$1(array, f) {\n for (let val of array)\n if (f(val))\n return val;\n return undefined;\n }\n // Don't scale when the document height is within the range of what\n // the DOM can handle.\n const IdScaler = {\n toDOM(n) { return n; },\n fromDOM(n) { return n; },\n scale: 1,\n eq(other) { return other == this; }\n };\n // When the height is too big (> VP.MaxDOMHeight), scale down the\n // regions outside the viewports so that the total height is\n // VP.MaxDOMHeight.\n class BigScaler {\n constructor(oracle, heightMap, viewports) {\n let vpHeight = 0, base = 0, domBase = 0;\n this.viewports = viewports.map(({ from, to }) => {\n let top = heightMap.lineAt(from, QueryType$1.ByPos, oracle, 0, 0).top;\n let bottom = heightMap.lineAt(to, QueryType$1.ByPos, oracle, 0, 0).bottom;\n vpHeight += bottom - top;\n return { from, to, top, bottom, domTop: 0, domBottom: 0 };\n });\n this.scale = (7000000 /* VP.MaxDOMHeight */ - vpHeight) / (heightMap.height - vpHeight);\n for (let obj of this.viewports) {\n obj.domTop = domBase + (obj.top - base) * this.scale;\n domBase = obj.domBottom = obj.domTop + (obj.bottom - obj.top);\n base = obj.bottom;\n }\n }\n toDOM(n) {\n for (let i = 0, base = 0, domBase = 0;; i++) {\n let vp = i < this.viewports.length ? this.viewports[i] : null;\n if (!vp || n < vp.top)\n return domBase + (n - base) * this.scale;\n if (n <= vp.bottom)\n return vp.domTop + (n - vp.top);\n base = vp.bottom;\n domBase = vp.domBottom;\n }\n }\n fromDOM(n) {\n for (let i = 0, base = 0, domBase = 0;; i++) {\n let vp = i < this.viewports.length ? this.viewports[i] : null;\n if (!vp || n < vp.domTop)\n return base + (n - domBase) / this.scale;\n if (n <= vp.domBottom)\n return vp.top + (n - vp.domTop);\n base = vp.bottom;\n domBase = vp.domBottom;\n }\n }\n eq(other) {\n if (!(other instanceof BigScaler))\n return false;\n return this.scale == other.scale && this.viewports.length == other.viewports.length &&\n this.viewports.every((vp, i) => vp.from == other.viewports[i].from && vp.to == other.viewports[i].to);\n }\n }\n function scaleBlock(block, scaler) {\n if (scaler.scale == 1)\n return block;\n let bTop = scaler.toDOM(block.top), bBottom = scaler.toDOM(block.bottom);\n return new BlockInfo(block.from, block.length, bTop, bBottom - bTop, Array.isArray(block._content) ? block._content.map(b => scaleBlock(b, scaler)) : block._content);\n }\n\n const theme = /*@__PURE__*/Facet.define({ combine: strs => strs.join(\" \") });\n const darkTheme = /*@__PURE__*/Facet.define({ combine: values => values.indexOf(true) > -1 });\n const baseThemeID = /*@__PURE__*/StyleModule.newName(), baseLightID = /*@__PURE__*/StyleModule.newName(), baseDarkID = /*@__PURE__*/StyleModule.newName();\n const lightDarkIDs = { \"&light\": \".\" + baseLightID, \"&dark\": \".\" + baseDarkID };\n function buildTheme(main, spec, scopes) {\n return new StyleModule(spec, {\n finish(sel) {\n return /&/.test(sel) ? sel.replace(/&\\w*/, m => {\n if (m == \"&\")\n return main;\n if (!scopes || !scopes[m])\n throw new RangeError(`Unsupported selector: ${m}`);\n return scopes[m];\n }) : main + \" \" + sel;\n }\n });\n }\n const baseTheme$1$2 = /*@__PURE__*/buildTheme(\".\" + baseThemeID, {\n \"&\": {\n position: \"relative !important\",\n boxSizing: \"border-box\",\n \"&.cm-focused\": {\n // Provide a simple default outline to make sure a focused\n // editor is visually distinct. Can't leave the default behavior\n // because that will apply to the content element, which is\n // inside the scrollable container and doesn't include the\n // gutters. We also can't use an 'auto' outline, since those\n // are, for some reason, drawn behind the element content, which\n // will cause things like the active line background to cover\n // the outline (#297).\n outline: \"1px dotted #212121\"\n },\n display: \"flex !important\",\n flexDirection: \"column\"\n },\n \".cm-scroller\": {\n display: \"flex !important\",\n alignItems: \"flex-start !important\",\n fontFamily: \"monospace\",\n lineHeight: 1.4,\n height: \"100%\",\n overflowX: \"auto\",\n position: \"relative\",\n zIndex: 0\n },\n \".cm-content\": {\n margin: 0,\n flexGrow: 2,\n flexShrink: 0,\n display: \"block\",\n whiteSpace: \"pre\",\n wordWrap: \"normal\", // https://github.com/codemirror/dev/issues/456\n boxSizing: \"border-box\",\n minHeight: \"100%\",\n padding: \"4px 0\",\n outline: \"none\",\n \"&[contenteditable=true]\": {\n WebkitUserModify: \"read-write-plaintext-only\",\n }\n },\n \".cm-lineWrapping\": {\n whiteSpace_fallback: \"pre-wrap\", // For IE\n whiteSpace: \"break-spaces\",\n wordBreak: \"break-word\", // For Safari, which doesn't support overflow-wrap: anywhere\n overflowWrap: \"anywhere\",\n flexShrink: 1\n },\n \"&light .cm-content\": { caretColor: \"black\" },\n \"&dark .cm-content\": { caretColor: \"white\" },\n \".cm-line\": {\n display: \"block\",\n padding: \"0 2px 0 6px\"\n },\n \".cm-layer\": {\n position: \"absolute\",\n left: 0,\n top: 0,\n contain: \"size style\",\n \"& > *\": {\n position: \"absolute\"\n }\n },\n \"&light .cm-selectionBackground\": {\n background: \"#d9d9d9\"\n },\n \"&dark .cm-selectionBackground\": {\n background: \"#222\"\n },\n \"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground\": {\n background: \"#d7d4f0\"\n },\n \"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground\": {\n background: \"#233\"\n },\n \".cm-cursorLayer\": {\n pointerEvents: \"none\"\n },\n \"&.cm-focused > .cm-scroller > .cm-cursorLayer\": {\n animation: \"steps(1) cm-blink 1.2s infinite\"\n },\n // Two animations defined so that we can switch between them to\n // restart the animation without forcing another style\n // recomputation.\n \"@keyframes cm-blink\": { \"0%\": {}, \"50%\": { opacity: 0 }, \"100%\": {} },\n \"@keyframes cm-blink2\": { \"0%\": {}, \"50%\": { opacity: 0 }, \"100%\": {} },\n \".cm-cursor, .cm-dropCursor\": {\n borderLeft: \"1.2px solid black\",\n marginLeft: \"-0.6px\",\n pointerEvents: \"none\",\n },\n \".cm-cursor\": {\n display: \"none\"\n },\n \"&dark .cm-cursor\": {\n borderLeftColor: \"#444\"\n },\n \".cm-dropCursor\": {\n position: \"absolute\"\n },\n \"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor\": {\n display: \"block\"\n },\n \".cm-iso\": {\n unicodeBidi: \"isolate\"\n },\n \".cm-announced\": {\n position: \"fixed\",\n top: \"-10000px\"\n },\n \"@media print\": {\n \".cm-announced\": { display: \"none\" }\n },\n \"&light .cm-activeLine\": { backgroundColor: \"#cceeff44\" },\n \"&dark .cm-activeLine\": { backgroundColor: \"#99eeff33\" },\n \"&light .cm-specialChar\": { color: \"red\" },\n \"&dark .cm-specialChar\": { color: \"#f78\" },\n \".cm-gutters\": {\n flexShrink: 0,\n display: \"flex\",\n height: \"100%\",\n boxSizing: \"border-box\",\n insetInlineStart: 0,\n zIndex: 200\n },\n \"&light .cm-gutters\": {\n backgroundColor: \"#f5f5f5\",\n color: \"#6c6c6c\",\n borderRight: \"1px solid #ddd\"\n },\n \"&dark .cm-gutters\": {\n backgroundColor: \"#333338\",\n color: \"#ccc\"\n },\n \".cm-gutter\": {\n display: \"flex !important\", // Necessary -- prevents margin collapsing\n flexDirection: \"column\",\n flexShrink: 0,\n boxSizing: \"border-box\",\n minHeight: \"100%\",\n overflow: \"hidden\"\n },\n \".cm-gutterElement\": {\n boxSizing: \"border-box\"\n },\n \".cm-lineNumbers .cm-gutterElement\": {\n padding: \"0 3px 0 5px\",\n minWidth: \"20px\",\n textAlign: \"right\",\n whiteSpace: \"nowrap\"\n },\n \"&light .cm-activeLineGutter\": {\n backgroundColor: \"#e2f2ff\"\n },\n \"&dark .cm-activeLineGutter\": {\n backgroundColor: \"#222227\"\n },\n \".cm-panels\": {\n boxSizing: \"border-box\",\n position: \"sticky\",\n left: 0,\n right: 0\n },\n \"&light .cm-panels\": {\n backgroundColor: \"#f5f5f5\",\n color: \"black\"\n },\n \"&light .cm-panels-top\": {\n borderBottom: \"1px solid #ddd\"\n },\n \"&light .cm-panels-bottom\": {\n borderTop: \"1px solid #ddd\"\n },\n \"&dark .cm-panels\": {\n backgroundColor: \"#333338\",\n color: \"white\"\n },\n \".cm-tab\": {\n display: \"inline-block\",\n overflow: \"hidden\",\n verticalAlign: \"bottom\"\n },\n \".cm-widgetBuffer\": {\n verticalAlign: \"text-top\",\n height: \"1em\",\n width: 0,\n display: \"inline\"\n },\n \".cm-placeholder\": {\n color: \"#888\",\n display: \"inline-block\",\n verticalAlign: \"top\",\n },\n \".cm-highlightSpace:before\": {\n content: \"attr(data-display)\",\n position: \"absolute\",\n pointerEvents: \"none\",\n color: \"#888\"\n },\n \".cm-highlightTab\": {\n 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>')`,\n backgroundSize: \"auto 100%\",\n backgroundPosition: \"right 90%\",\n backgroundRepeat: \"no-repeat\"\n },\n \".cm-trailingSpace\": {\n backgroundColor: \"#ff332255\"\n },\n \".cm-button\": {\n verticalAlign: \"middle\",\n color: \"inherit\",\n fontSize: \"70%\",\n padding: \".2em 1em\",\n borderRadius: \"1px\"\n },\n \"&light .cm-button\": {\n backgroundImage: \"linear-gradient(#eff1f5, #d9d9df)\",\n border: \"1px solid #888\",\n \"&:active\": {\n backgroundImage: \"linear-gradient(#b4b4b4, #d0d3d6)\"\n }\n },\n \"&dark .cm-button\": {\n backgroundImage: \"linear-gradient(#393939, #111)\",\n border: \"1px solid #888\",\n \"&:active\": {\n backgroundImage: \"linear-gradient(#111, #333)\"\n }\n },\n \".cm-textfield\": {\n verticalAlign: \"middle\",\n color: \"inherit\",\n fontSize: \"70%\",\n border: \"1px solid silver\",\n padding: \".2em .5em\"\n },\n \"&light .cm-textfield\": {\n backgroundColor: \"white\"\n },\n \"&dark .cm-textfield\": {\n border: \"1px solid #555\",\n backgroundColor: \"inherit\"\n }\n }, lightDarkIDs);\n\n const LineBreakPlaceholder = \"\\uffff\";\n class DOMReader {\n constructor(points, state) {\n this.points = points;\n this.text = \"\";\n this.lineSeparator = state.facet(EditorState.lineSeparator);\n }\n append(text) {\n this.text += text;\n }\n lineBreak() {\n this.text += LineBreakPlaceholder;\n }\n readRange(start, end) {\n if (!start)\n return this;\n let parent = start.parentNode;\n for (let cur = start;;) {\n this.findPointBefore(parent, cur);\n let oldLen = this.text.length;\n this.readNode(cur);\n let next = cur.nextSibling;\n if (next == end)\n break;\n let view = ContentView.get(cur), nextView = ContentView.get(next);\n if (view && nextView ? view.breakAfter :\n (view ? view.breakAfter : isBlockElement(cur)) ||\n (isBlockElement(next) && (cur.nodeName != \"BR\" || cur.cmIgnore) && this.text.length > oldLen))\n this.lineBreak();\n cur = next;\n }\n this.findPointBefore(parent, end);\n return this;\n }\n readTextNode(node) {\n let text = node.nodeValue;\n for (let point of this.points)\n if (point.node == node)\n point.pos = this.text.length + Math.min(point.offset, text.length);\n for (let off = 0, re = this.lineSeparator ? null : /\\r\\n?|\\n/g;;) {\n let nextBreak = -1, breakSize = 1, m;\n if (this.lineSeparator) {\n nextBreak = text.indexOf(this.lineSeparator, off);\n breakSize = this.lineSeparator.length;\n }\n else if (m = re.exec(text)) {\n nextBreak = m.index;\n breakSize = m[0].length;\n }\n this.append(text.slice(off, nextBreak < 0 ? text.length : nextBreak));\n if (nextBreak < 0)\n break;\n this.lineBreak();\n if (breakSize > 1)\n for (let point of this.points)\n if (point.node == node && point.pos > this.text.length)\n point.pos -= breakSize - 1;\n off = nextBreak + breakSize;\n }\n }\n readNode(node) {\n if (node.cmIgnore)\n return;\n let view = ContentView.get(node);\n let fromView = view && view.overrideDOMText;\n if (fromView != null) {\n this.findPointInside(node, fromView.length);\n for (let i = fromView.iter(); !i.next().done;) {\n if (i.lineBreak)\n this.lineBreak();\n else\n this.append(i.value);\n }\n }\n else if (node.nodeType == 3) {\n this.readTextNode(node);\n }\n else if (node.nodeName == \"BR\") {\n if (node.nextSibling)\n this.lineBreak();\n }\n else if (node.nodeType == 1) {\n this.readRange(node.firstChild, null);\n }\n }\n findPointBefore(node, next) {\n for (let point of this.points)\n if (point.node == node && node.childNodes[point.offset] == next)\n point.pos = this.text.length;\n }\n findPointInside(node, length) {\n for (let point of this.points)\n if (node.nodeType == 3 ? point.node == node : node.contains(point.node))\n point.pos = this.text.length + (isAtEnd(node, point.node, point.offset) ? length : 0);\n }\n }\n function isAtEnd(parent, node, offset) {\n for (;;) {\n if (!node || offset < maxOffset(node))\n return false;\n if (node == parent)\n return true;\n offset = domIndex(node) + 1;\n node = node.parentNode;\n }\n }\n class DOMPoint {\n constructor(node, offset) {\n this.node = node;\n this.offset = offset;\n this.pos = -1;\n }\n }\n\n class DOMChange {\n constructor(view, start, end, typeOver) {\n this.typeOver = typeOver;\n this.bounds = null;\n this.text = \"\";\n this.domChanged = start > -1;\n let { impreciseHead: iHead, impreciseAnchor: iAnchor } = view.docView;\n if (view.state.readOnly && start > -1) {\n // Ignore changes when the editor is read-only\n this.newSel = null;\n }\n else if (start > -1 && (this.bounds = view.docView.domBoundsAround(start, end, 0))) {\n let selPoints = iHead || iAnchor ? [] : selectionPoints(view);\n let reader = new DOMReader(selPoints, view.state);\n reader.readRange(this.bounds.startDOM, this.bounds.endDOM);\n this.text = reader.text;\n this.newSel = selectionFromPoints(selPoints, this.bounds.from);\n }\n else {\n let domSel = view.observer.selectionRange;\n let head = iHead && iHead.node == domSel.focusNode && iHead.offset == domSel.focusOffset ||\n !contains$1(view.contentDOM, domSel.focusNode)\n ? view.state.selection.main.head\n : view.docView.posFromDOM(domSel.focusNode, domSel.focusOffset);\n let anchor = iAnchor && iAnchor.node == domSel.anchorNode && iAnchor.offset == domSel.anchorOffset ||\n !contains$1(view.contentDOM, domSel.anchorNode)\n ? view.state.selection.main.anchor\n : view.docView.posFromDOM(domSel.anchorNode, domSel.anchorOffset);\n // iOS will refuse to select the block gaps when doing\n // select-all.\n // Chrome will put the selection *inside* them, confusing\n // posFromDOM\n let vp = view.viewport;\n if ((browser.ios || browser.chrome) && view.state.selection.main.empty && head != anchor &&\n (vp.from > 0 || vp.to < view.state.doc.length)) {\n let from = Math.min(head, anchor), to = Math.max(head, anchor);\n let offFrom = vp.from - from, offTo = vp.to - to;\n if ((offFrom == 0 || offFrom == 1 || from == 0) && (offTo == 0 || offTo == -1 || to == view.state.doc.length)) {\n head = 0;\n anchor = view.state.doc.length;\n }\n }\n this.newSel = EditorSelection.single(anchor, head);\n }\n }\n }\n function applyDOMChange(view, domChange) {\n let change;\n let { newSel } = domChange, sel = view.state.selection.main;\n let lastKey = view.inputState.lastKeyTime > Date.now() - 100 ? view.inputState.lastKeyCode : -1;\n if (domChange.bounds) {\n let { from, to } = domChange.bounds;\n let preferredPos = sel.from, preferredSide = null;\n // Prefer anchoring to end when Backspace is pressed (or, on\n // Android, when something was deleted)\n if (lastKey === 8 || browser.android && domChange.text.length < to - from) {\n preferredPos = sel.to;\n preferredSide = \"end\";\n }\n let diff = findDiff(view.state.doc.sliceString(from, to, LineBreakPlaceholder), domChange.text, preferredPos - from, preferredSide);\n if (diff) {\n // Chrome inserts two newlines when pressing shift-enter at the\n // end of a line. DomChange drops one of those.\n if (browser.chrome && lastKey == 13 &&\n diff.toB == diff.from + 2 && domChange.text.slice(diff.from, diff.toB) == LineBreakPlaceholder + LineBreakPlaceholder)\n diff.toB--;\n change = { from: from + diff.from, to: from + diff.toA,\n insert: Text.of(domChange.text.slice(diff.from, diff.toB).split(LineBreakPlaceholder)) };\n }\n }\n else if (newSel && (!view.hasFocus && view.state.facet(editable) || newSel.main.eq(sel))) {\n newSel = null;\n }\n if (!change && !newSel)\n return false;\n if (!change && domChange.typeOver && !sel.empty && newSel && newSel.main.empty) {\n // Heuristic to notice typing over a selected character\n change = { from: sel.from, to: sel.to, insert: view.state.doc.slice(sel.from, sel.to) };\n }\n else if (change && change.from >= sel.from && change.to <= sel.to &&\n (change.from != sel.from || change.to != sel.to) &&\n (sel.to - sel.from) - (change.to - change.from) <= 4) {\n // If the change is inside the selection and covers most of it,\n // assume it is a selection replace (with identical characters at\n // the start/end not included in the diff)\n change = {\n from: sel.from, to: sel.to,\n insert: view.state.doc.slice(sel.from, change.from).append(change.insert).append(view.state.doc.slice(change.to, sel.to))\n };\n }\n else if ((browser.mac || browser.android) && change && change.from == change.to && change.from == sel.head - 1 &&\n /^\\. ?$/.test(change.insert.toString()) && view.contentDOM.getAttribute(\"autocorrect\") == \"off\") {\n // Detect insert-period-on-double-space Mac and Android behavior,\n // and transform it into a regular space insert.\n if (newSel && change.insert.length == 2)\n newSel = EditorSelection.single(newSel.main.anchor - 1, newSel.main.head - 1);\n change = { from: sel.from, to: sel.to, insert: Text.of([\" \"]) };\n }\n else if (browser.chrome && change && change.from == change.to && change.from == sel.head &&\n change.insert.toString() == \"\\n \" && view.lineWrapping) {\n // In Chrome, if you insert a space at the start of a wrapped\n // line, it will actually insert a newline and a space, causing a\n // bogus new line to be created in CodeMirror (#968)\n if (newSel)\n newSel = EditorSelection.single(newSel.main.anchor - 1, newSel.main.head - 1);\n change = { from: sel.from, to: sel.to, insert: Text.of([\" \"]) };\n }\n if (change) {\n return applyDOMChangeInner(view, change, newSel, lastKey);\n }\n else if (newSel && !newSel.main.eq(sel)) {\n let scrollIntoView = false, userEvent = \"select\";\n if (view.inputState.lastSelectionTime > Date.now() - 50) {\n if (view.inputState.lastSelectionOrigin == \"select\")\n scrollIntoView = true;\n userEvent = view.inputState.lastSelectionOrigin;\n }\n view.dispatch({ selection: newSel, scrollIntoView, userEvent });\n return true;\n }\n else {\n return false;\n }\n }\n function applyDOMChangeInner(view, change, newSel, lastKey = -1) {\n if (browser.ios && view.inputState.flushIOSKey(change))\n return true;\n let sel = view.state.selection.main;\n // Android browsers don't fire reasonable key events for enter,\n // backspace, or delete. So this detects changes that look like\n // they're caused by those keys, and reinterprets them as key\n // events. (Some of these keys are also handled by beforeinput\n // events and the pendingAndroidKey mechanism, but that's not\n // reliable in all situations.)\n if (browser.android &&\n ((change.to == sel.to &&\n // GBoard will sometimes remove a space it just inserted\n // after a completion when you press enter\n (change.from == sel.from || change.from == sel.from - 1 && view.state.sliceDoc(change.from, sel.from) == \" \") &&\n change.insert.length == 1 && change.insert.lines == 2 &&\n dispatchKey(view.contentDOM, \"Enter\", 13)) ||\n ((change.from == sel.from - 1 && change.to == sel.to && change.insert.length == 0 ||\n lastKey == 8 && change.insert.length < change.to - change.from && change.to > sel.head) &&\n dispatchKey(view.contentDOM, \"Backspace\", 8)) ||\n (change.from == sel.from && change.to == sel.to + 1 && change.insert.length == 0 &&\n dispatchKey(view.contentDOM, \"Delete\", 46))))\n return true;\n let text = change.insert.toString();\n if (view.inputState.composing >= 0)\n view.inputState.composing++;\n let defaultTr;\n let defaultInsert = () => defaultTr || (defaultTr = applyDefaultInsert(view, change, newSel));\n if (!view.state.facet(inputHandler$1).some(h => h(view, change.from, change.to, text, defaultInsert)))\n view.dispatch(defaultInsert());\n return true;\n }\n function applyDefaultInsert(view, change, newSel) {\n let tr, startState = view.state, sel = startState.selection.main;\n if (change.from >= sel.from && change.to <= sel.to && change.to - change.from >= (sel.to - sel.from) / 3 &&\n (!newSel || newSel.main.empty && newSel.main.from == change.from + change.insert.length) &&\n view.inputState.composing < 0) {\n let before = sel.from < change.from ? startState.sliceDoc(sel.from, change.from) : \"\";\n let after = sel.to > change.to ? startState.sliceDoc(change.to, sel.to) : \"\";\n tr = startState.replaceSelection(view.state.toText(before + change.insert.sliceString(0, undefined, view.state.lineBreak) + after));\n }\n else {\n let changes = startState.changes(change);\n let mainSel = newSel && newSel.main.to <= changes.newLength ? newSel.main : undefined;\n // Try to apply a composition change to all cursors\n if (startState.selection.ranges.length > 1 && view.inputState.composing >= 0 &&\n change.to <= sel.to && change.to >= sel.to - 10) {\n let replaced = view.state.sliceDoc(change.from, change.to);\n let compositionRange, composition = newSel && findCompositionNode(view, newSel.main.head);\n if (composition) {\n let dLen = change.insert.length - (change.to - change.from);\n compositionRange = { from: composition.from, to: composition.to - dLen };\n }\n else {\n compositionRange = view.state.doc.lineAt(sel.head);\n }\n let offset = sel.to - change.to, size = sel.to - sel.from;\n tr = startState.changeByRange(range => {\n if (range.from == sel.from && range.to == sel.to)\n return { changes, range: mainSel || range.map(changes) };\n let to = range.to - offset, from = to - replaced.length;\n if (range.to - range.from != size || view.state.sliceDoc(from, to) != replaced ||\n // Unfortunately, there's no way to make multiple\n // changes in the same node work without aborting\n // composition, so cursors in the composition range are\n // ignored.\n range.to >= compositionRange.from && range.from <= compositionRange.to)\n return { range };\n let rangeChanges = startState.changes({ from, to, insert: change.insert }), selOff = range.to - sel.to;\n return {\n changes: rangeChanges,\n range: !mainSel ? range.map(rangeChanges) :\n EditorSelection.range(Math.max(0, mainSel.anchor + selOff), Math.max(0, mainSel.head + selOff))\n };\n });\n }\n else {\n tr = {\n changes,\n selection: mainSel && startState.selection.replaceRange(mainSel)\n };\n }\n }\n let userEvent = \"input.type\";\n if (view.composing ||\n view.inputState.compositionPendingChange && view.inputState.compositionEndedAt > Date.now() - 50) {\n view.inputState.compositionPendingChange = false;\n userEvent += \".compose\";\n if (view.inputState.compositionFirstChange) {\n userEvent += \".start\";\n view.inputState.compositionFirstChange = false;\n }\n }\n return startState.update(tr, { userEvent, scrollIntoView: true });\n }\n function findDiff(a, b, preferredPos, preferredSide) {\n let minLen = Math.min(a.length, b.length);\n let from = 0;\n while (from < minLen && a.charCodeAt(from) == b.charCodeAt(from))\n from++;\n if (from == minLen && a.length == b.length)\n return null;\n let toA = a.length, toB = b.length;\n while (toA > 0 && toB > 0 && a.charCodeAt(toA - 1) == b.charCodeAt(toB - 1)) {\n toA--;\n toB--;\n }\n if (preferredSide == \"end\") {\n let adjust = Math.max(0, from - Math.min(toA, toB));\n preferredPos -= toA + adjust - from;\n }\n if (toA < from && a.length < b.length) {\n let move = preferredPos <= from && preferredPos >= toA ? from - preferredPos : 0;\n from -= move;\n toB = from + (toB - toA);\n toA = from;\n }\n else if (toB < from) {\n let move = preferredPos <= from && preferredPos >= toB ? from - preferredPos : 0;\n from -= move;\n toA = from + (toA - toB);\n toB = from;\n }\n return { from, toA, toB };\n }\n function selectionPoints(view) {\n let result = [];\n if (view.root.activeElement != view.contentDOM)\n return result;\n let { anchorNode, anchorOffset, focusNode, focusOffset } = view.observer.selectionRange;\n if (anchorNode) {\n result.push(new DOMPoint(anchorNode, anchorOffset));\n if (focusNode != anchorNode || focusOffset != anchorOffset)\n result.push(new DOMPoint(focusNode, focusOffset));\n }\n return result;\n }\n function selectionFromPoints(points, base) {\n if (points.length == 0)\n return null;\n let anchor = points[0].pos, head = points.length == 2 ? points[1].pos : anchor;\n return anchor > -1 && head > -1 ? EditorSelection.single(anchor + base, head + base) : null;\n }\n\n const observeOptions = {\n childList: true,\n characterData: true,\n subtree: true,\n attributes: true,\n characterDataOldValue: true\n };\n // IE11 has very broken mutation observers, so we also listen to\n // DOMCharacterDataModified there\n const useCharData = browser.ie && browser.ie_version <= 11;\n class DOMObserver {\n constructor(view) {\n this.view = view;\n this.active = false;\n this.editContext = null;\n // The known selection. Kept in our own object, as opposed to just\n // directly accessing the selection because:\n // - Safari doesn't report the right selection in shadow DOM\n // - Reading from the selection forces a DOM layout\n // - This way, we can ignore selectionchange events if we have\n // already seen the 'new' selection\n this.selectionRange = new DOMSelectionState;\n // Set when a selection change is detected, cleared on flush\n this.selectionChanged = false;\n this.delayedFlush = -1;\n this.resizeTimeout = -1;\n this.queue = [];\n this.delayedAndroidKey = null;\n this.flushingAndroidKey = -1;\n this.lastChange = 0;\n this.scrollTargets = [];\n this.intersection = null;\n this.resizeScroll = null;\n this.intersecting = false;\n this.gapIntersection = null;\n this.gaps = [];\n this.printQuery = null;\n // Timeout for scheduling check of the parents that need scroll handlers\n this.parentCheck = -1;\n this.dom = view.contentDOM;\n this.observer = new MutationObserver(mutations => {\n for (let mut of mutations)\n this.queue.push(mut);\n // IE11 will sometimes (on typing over a selection or\n // backspacing out a single character text node) call the\n // observer callback before actually updating the DOM.\n //\n // Unrelatedly, iOS Safari will, when ending a composition,\n // sometimes first clear it, deliver the mutations, and then\n // reinsert the finished text. CodeMirror's handling of the\n // deletion will prevent the reinsertion from happening,\n // breaking composition.\n if ((browser.ie && browser.ie_version <= 11 || browser.ios && view.composing) &&\n mutations.some(m => m.type == \"childList\" && m.removedNodes.length ||\n m.type == \"characterData\" && m.oldValue.length > m.target.nodeValue.length))\n this.flushSoon();\n else\n this.flush();\n });\n if (window.EditContext && view.constructor.EDIT_CONTEXT !== false &&\n // Chrome <126 doesn't support inverted selections in edit context (#1392)\n !(browser.chrome && browser.chrome_version < 126)) {\n this.editContext = new EditContextManager(view);\n if (view.state.facet(editable))\n view.contentDOM.editContext = this.editContext.editContext;\n }\n if (useCharData)\n this.onCharData = (event) => {\n this.queue.push({ target: event.target,\n type: \"characterData\",\n oldValue: event.prevValue });\n this.flushSoon();\n };\n this.onSelectionChange = this.onSelectionChange.bind(this);\n this.onResize = this.onResize.bind(this);\n this.onPrint = this.onPrint.bind(this);\n this.onScroll = this.onScroll.bind(this);\n if (window.matchMedia)\n this.printQuery = window.matchMedia(\"print\");\n if (typeof ResizeObserver == \"function\") {\n this.resizeScroll = new ResizeObserver(() => {\n var _a;\n if (((_a = this.view.docView) === null || _a === void 0 ? void 0 : _a.lastUpdate) < Date.now() - 75)\n this.onResize();\n });\n this.resizeScroll.observe(view.scrollDOM);\n }\n this.addWindowListeners(this.win = view.win);\n this.start();\n if (typeof IntersectionObserver == \"function\") {\n this.intersection = new IntersectionObserver(entries => {\n if (this.parentCheck < 0)\n this.parentCheck = setTimeout(this.listenForScroll.bind(this), 1000);\n if (entries.length > 0 && (entries[entries.length - 1].intersectionRatio > 0) != this.intersecting) {\n this.intersecting = !this.intersecting;\n if (this.intersecting != this.view.inView)\n this.onScrollChanged(document.createEvent(\"Event\"));\n }\n }, { threshold: [0, .001] });\n this.intersection.observe(this.dom);\n this.gapIntersection = new IntersectionObserver(entries => {\n if (entries.length > 0 && entries[entries.length - 1].intersectionRatio > 0)\n this.onScrollChanged(document.createEvent(\"Event\"));\n }, {});\n }\n this.listenForScroll();\n this.readSelectionRange();\n }\n onScrollChanged(e) {\n this.view.inputState.runHandlers(\"scroll\", e);\n if (this.intersecting)\n this.view.measure();\n }\n onScroll(e) {\n if (this.intersecting)\n this.flush(false);\n if (this.editContext)\n this.view.requestMeasure(this.editContext.measureReq);\n this.onScrollChanged(e);\n }\n onResize() {\n if (this.resizeTimeout < 0)\n this.resizeTimeout = setTimeout(() => {\n this.resizeTimeout = -1;\n this.view.requestMeasure();\n }, 50);\n }\n onPrint(event) {\n if ((event.type == \"change\" || !event.type) && !event.matches)\n return;\n this.view.viewState.printing = true;\n this.view.measure();\n setTimeout(() => {\n this.view.viewState.printing = false;\n this.view.requestMeasure();\n }, 500);\n }\n updateGaps(gaps) {\n if (this.gapIntersection && (gaps.length != this.gaps.length || this.gaps.some((g, i) => g != gaps[i]))) {\n this.gapIntersection.disconnect();\n for (let gap of gaps)\n this.gapIntersection.observe(gap);\n this.gaps = gaps;\n }\n }\n onSelectionChange(event) {\n let wasChanged = this.selectionChanged;\n if (!this.readSelectionRange() || this.delayedAndroidKey)\n return;\n let { view } = this, sel = this.selectionRange;\n if (view.state.facet(editable) ? view.root.activeElement != this.dom : !hasSelection(view.dom, sel))\n return;\n let context = sel.anchorNode && view.docView.nearest(sel.anchorNode);\n if (context && context.ignoreEvent(event)) {\n if (!wasChanged)\n this.selectionChanged = false;\n return;\n }\n // Deletions on IE11 fire their events in the wrong order, giving\n // us a selection change event before the DOM changes are\n // reported.\n // Chrome Android has a similar issue when backspacing out a\n // selection (#645).\n if ((browser.ie && browser.ie_version <= 11 || browser.android && browser.chrome) && !view.state.selection.main.empty &&\n // (Selection.isCollapsed isn't reliable on IE)\n sel.focusNode && isEquivalentPosition(sel.focusNode, sel.focusOffset, sel.anchorNode, sel.anchorOffset))\n this.flushSoon();\n else\n this.flush(false);\n }\n readSelectionRange() {\n let { view } = this;\n // The Selection object is broken in shadow roots in Safari. See\n // https://github.com/codemirror/dev/issues/414\n let selection = getSelection(view.root);\n if (!selection)\n return false;\n let range = browser.safari && view.root.nodeType == 11 &&\n deepActiveElement(this.dom.ownerDocument) == this.dom &&\n safariSelectionRangeHack(this.view, selection) || selection;\n if (!range || this.selectionRange.eq(range))\n return false;\n let local = hasSelection(this.dom, range);\n // Detect the situation where the browser has, on focus, moved the\n // selection to the start of the content element. Reset it to the\n // position from the editor state.\n if (local && !this.selectionChanged &&\n view.inputState.lastFocusTime > Date.now() - 200 &&\n view.inputState.lastTouchTime < Date.now() - 300 &&\n atElementStart(this.dom, range)) {\n this.view.inputState.lastFocusTime = 0;\n view.docView.updateSelection();\n return false;\n }\n this.selectionRange.setRange(range);\n if (local)\n this.selectionChanged = true;\n return true;\n }\n setSelectionRange(anchor, head) {\n this.selectionRange.set(anchor.node, anchor.offset, head.node, head.offset);\n this.selectionChanged = false;\n }\n clearSelectionRange() {\n this.selectionRange.set(null, 0, null, 0);\n }\n listenForScroll() {\n this.parentCheck = -1;\n let i = 0, changed = null;\n for (let dom = this.dom; dom;) {\n if (dom.nodeType == 1) {\n if (!changed && i < this.scrollTargets.length && this.scrollTargets[i] == dom)\n i++;\n else if (!changed)\n changed = this.scrollTargets.slice(0, i);\n if (changed)\n changed.push(dom);\n dom = dom.assignedSlot || dom.parentNode;\n }\n else if (dom.nodeType == 11) { // Shadow root\n dom = dom.host;\n }\n else {\n break;\n }\n }\n if (i < this.scrollTargets.length && !changed)\n changed = this.scrollTargets.slice(0, i);\n if (changed) {\n for (let dom of this.scrollTargets)\n dom.removeEventListener(\"scroll\", this.onScroll);\n for (let dom of this.scrollTargets = changed)\n dom.addEventListener(\"scroll\", this.onScroll);\n }\n }\n ignore(f) {\n if (!this.active)\n return f();\n try {\n this.stop();\n return f();\n }\n finally {\n this.start();\n this.clear();\n }\n }\n start() {\n if (this.active)\n return;\n this.observer.observe(this.dom, observeOptions);\n if (useCharData)\n this.dom.addEventListener(\"DOMCharacterDataModified\", this.onCharData);\n this.active = true;\n }\n stop() {\n if (!this.active)\n return;\n this.active = false;\n this.observer.disconnect();\n if (useCharData)\n this.dom.removeEventListener(\"DOMCharacterDataModified\", this.onCharData);\n }\n // Throw away any pending changes\n clear() {\n this.processRecords();\n this.queue.length = 0;\n this.selectionChanged = false;\n }\n // Chrome Android, especially in combination with GBoard, not only\n // doesn't reliably fire regular key events, but also often\n // surrounds the effect of enter or backspace with a bunch of\n // composition events that, when interrupted, cause text duplication\n // or other kinds of corruption. This hack makes the editor back off\n // from handling DOM changes for a moment when such a key is\n // detected (via beforeinput or keydown), and then tries to flush\n // them or, if that has no effect, dispatches the given key.\n delayAndroidKey(key, keyCode) {\n var _a;\n if (!this.delayedAndroidKey) {\n let flush = () => {\n let key = this.delayedAndroidKey;\n if (key) {\n this.clearDelayedAndroidKey();\n this.view.inputState.lastKeyCode = key.keyCode;\n this.view.inputState.lastKeyTime = Date.now();\n let flushed = this.flush();\n if (!flushed && key.force)\n dispatchKey(this.dom, key.key, key.keyCode);\n }\n };\n this.flushingAndroidKey = this.view.win.requestAnimationFrame(flush);\n }\n // Since backspace beforeinput is sometimes signalled spuriously,\n // Enter always takes precedence.\n if (!this.delayedAndroidKey || key == \"Enter\")\n this.delayedAndroidKey = {\n key, keyCode,\n // Only run the key handler when no changes are detected if\n // this isn't coming right after another change, in which case\n // it is probably part of a weird chain of updates, and should\n // be ignored if it returns the DOM to its previous state.\n force: this.lastChange < Date.now() - 50 || !!((_a = this.delayedAndroidKey) === null || _a === void 0 ? void 0 : _a.force)\n };\n }\n clearDelayedAndroidKey() {\n this.win.cancelAnimationFrame(this.flushingAndroidKey);\n this.delayedAndroidKey = null;\n this.flushingAndroidKey = -1;\n }\n flushSoon() {\n if (this.delayedFlush < 0)\n this.delayedFlush = this.view.win.requestAnimationFrame(() => { this.delayedFlush = -1; this.flush(); });\n }\n forceFlush() {\n if (this.delayedFlush >= 0) {\n this.view.win.cancelAnimationFrame(this.delayedFlush);\n this.delayedFlush = -1;\n }\n this.flush();\n }\n pendingRecords() {\n for (let mut of this.observer.takeRecords())\n this.queue.push(mut);\n return this.queue;\n }\n processRecords() {\n let records = this.pendingRecords();\n if (records.length)\n this.queue = [];\n let from = -1, to = -1, typeOver = false;\n for (let record of records) {\n let range = this.readMutation(record);\n if (!range)\n continue;\n if (range.typeOver)\n typeOver = true;\n if (from == -1) {\n ({ from, to } = range);\n }\n else {\n from = Math.min(range.from, from);\n to = Math.max(range.to, to);\n }\n }\n return { from, to, typeOver };\n }\n readChange() {\n let { from, to, typeOver } = this.processRecords();\n let newSel = this.selectionChanged && hasSelection(this.dom, this.selectionRange);\n if (from < 0 && !newSel)\n return null;\n if (from > -1)\n this.lastChange = Date.now();\n this.view.inputState.lastFocusTime = 0;\n this.selectionChanged = false;\n let change = new DOMChange(this.view, from, to, typeOver);\n this.view.docView.domChanged = { newSel: change.newSel ? change.newSel.main : null };\n return change;\n }\n // Apply pending changes, if any\n flush(readSelection = true) {\n // Completely hold off flushing when pending keys are set\u2014the code\n // managing those will make sure processRecords is called and the\n // view is resynchronized after\n if (this.delayedFlush >= 0 || this.delayedAndroidKey)\n return false;\n if (readSelection)\n this.readSelectionRange();\n let domChange = this.readChange();\n if (!domChange) {\n this.view.requestMeasure();\n return false;\n }\n let startState = this.view.state;\n let handled = applyDOMChange(this.view, domChange);\n // The view wasn't updated but DOM/selection changes were seen. Reset the view.\n if (this.view.state == startState &&\n (domChange.domChanged || domChange.newSel && !domChange.newSel.main.eq(this.view.state.selection.main)))\n this.view.update([]);\n return handled;\n }\n readMutation(rec) {\n let cView = this.view.docView.nearest(rec.target);\n if (!cView || cView.ignoreMutation(rec))\n return null;\n cView.markDirty(rec.type == \"attributes\");\n if (rec.type == \"attributes\")\n cView.flags |= 4 /* ViewFlag.AttrsDirty */;\n if (rec.type == \"childList\") {\n let childBefore = findChild(cView, rec.previousSibling || rec.target.previousSibling, -1);\n let childAfter = findChild(cView, rec.nextSibling || rec.target.nextSibling, 1);\n return { from: childBefore ? cView.posAfter(childBefore) : cView.posAtStart,\n to: childAfter ? cView.posBefore(childAfter) : cView.posAtEnd, typeOver: false };\n }\n else if (rec.type == \"characterData\") {\n return { from: cView.posAtStart, to: cView.posAtEnd, typeOver: rec.target.nodeValue == rec.oldValue };\n }\n else {\n return null;\n }\n }\n setWindow(win) {\n if (win != this.win) {\n this.removeWindowListeners(this.win);\n this.win = win;\n this.addWindowListeners(this.win);\n }\n }\n addWindowListeners(win) {\n win.addEventListener(\"resize\", this.onResize);\n if (this.printQuery) {\n if (this.printQuery.addEventListener)\n this.printQuery.addEventListener(\"change\", this.onPrint);\n else\n this.printQuery.addListener(this.onPrint);\n }\n else\n win.addEventListener(\"beforeprint\", this.onPrint);\n win.addEventListener(\"scroll\", this.onScroll);\n win.document.addEventListener(\"selectionchange\", this.onSelectionChange);\n }\n removeWindowListeners(win) {\n win.removeEventListener(\"scroll\", this.onScroll);\n win.removeEventListener(\"resize\", this.onResize);\n if (this.printQuery) {\n if (this.printQuery.removeEventListener)\n this.printQuery.removeEventListener(\"change\", this.onPrint);\n else\n this.printQuery.removeListener(this.onPrint);\n }\n else\n win.removeEventListener(\"beforeprint\", this.onPrint);\n win.document.removeEventListener(\"selectionchange\", this.onSelectionChange);\n }\n update(update) {\n if (this.editContext) {\n this.editContext.update(update);\n if (update.startState.facet(editable) != update.state.facet(editable))\n update.view.contentDOM.editContext = update.state.facet(editable) ? this.editContext.editContext : null;\n }\n }\n destroy() {\n var _a, _b, _c;\n this.stop();\n (_a = this.intersection) === null || _a === void 0 ? void 0 : _a.disconnect();\n (_b = this.gapIntersection) === null || _b === void 0 ? void 0 : _b.disconnect();\n (_c = this.resizeScroll) === null || _c === void 0 ? void 0 : _c.disconnect();\n for (let dom of this.scrollTargets)\n dom.removeEventListener(\"scroll\", this.onScroll);\n this.removeWindowListeners(this.win);\n clearTimeout(this.parentCheck);\n clearTimeout(this.resizeTimeout);\n this.win.cancelAnimationFrame(this.delayedFlush);\n this.win.cancelAnimationFrame(this.flushingAndroidKey);\n if (this.editContext) {\n this.view.contentDOM.editContext = null;\n this.editContext.destroy();\n }\n }\n }\n function findChild(cView, dom, dir) {\n while (dom) {\n let curView = ContentView.get(dom);\n if (curView && curView.parent == cView)\n return curView;\n let parent = dom.parentNode;\n dom = parent != cView.dom ? parent : dir > 0 ? dom.nextSibling : dom.previousSibling;\n }\n return null;\n }\n function buildSelectionRangeFromRange(view, range) {\n let anchorNode = range.startContainer, anchorOffset = range.startOffset;\n let focusNode = range.endContainer, focusOffset = range.endOffset;\n let curAnchor = view.docView.domAtPos(view.state.selection.main.anchor);\n // Since such a range doesn't distinguish between anchor and head,\n // use a heuristic that flips it around if its end matches the\n // current anchor.\n if (isEquivalentPosition(curAnchor.node, curAnchor.offset, focusNode, focusOffset))\n [anchorNode, anchorOffset, focusNode, focusOffset] = [focusNode, focusOffset, anchorNode, anchorOffset];\n return { anchorNode, anchorOffset, focusNode, focusOffset };\n }\n // Used to work around a Safari Selection/shadow DOM bug (#414)\n function safariSelectionRangeHack(view, selection) {\n if (selection.getComposedRanges) {\n let range = selection.getComposedRanges(view.root)[0];\n if (range)\n return buildSelectionRangeFromRange(view, range);\n }\n let found = null;\n // Because Safari (at least in 2018-2021) doesn't provide regular\n // access to the selection inside a shadowroot, we have to perform a\n // ridiculous hack to get at it\u2014using `execCommand` to trigger a\n // `beforeInput` event so that we can read the target range from the\n // event.\n function read(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n found = event.getTargetRanges()[0];\n }\n view.contentDOM.addEventListener(\"beforeinput\", read, true);\n view.dom.ownerDocument.execCommand(\"indent\");\n view.contentDOM.removeEventListener(\"beforeinput\", read, true);\n return found ? buildSelectionRangeFromRange(view, found) : null;\n }\n class EditContextManager {\n constructor(view) {\n // The document window for which the text in the context is\n // maintained. For large documents, this may be smaller than the\n // editor document. This window always includes the selection head.\n this.from = 0;\n this.to = 0;\n // When applying a transaction, this is used to compare the change\n // made to the context content to the change in the transaction in\n // order to make the minimal changes to the context (since touching\n // that sometimes breaks series of multiple edits made for a single\n // user action on some Android keyboards)\n this.pendingContextChange = null;\n this.handlers = Object.create(null);\n this.resetRange(view.state);\n let context = this.editContext = new window.EditContext({\n text: view.state.doc.sliceString(this.from, this.to),\n selectionStart: this.toContextPos(Math.max(this.from, Math.min(this.to, view.state.selection.main.anchor))),\n selectionEnd: this.toContextPos(view.state.selection.main.head)\n });\n this.handlers.textupdate = e => {\n let { anchor } = view.state.selection.main;\n let change = { from: this.toEditorPos(e.updateRangeStart),\n to: this.toEditorPos(e.updateRangeEnd),\n insert: Text.of(e.text.split(\"\\n\")) };\n // If the window doesn't include the anchor, assume changes\n // adjacent to a side go up to the anchor.\n if (change.from == this.from && anchor < this.from)\n change.from = anchor;\n else if (change.to == this.to && anchor > this.to)\n change.to = anchor;\n // Edit contexts sometimes fire empty changes\n if (change.from == change.to && !change.insert.length)\n return;\n this.pendingContextChange = change;\n if (!view.state.readOnly)\n applyDOMChangeInner(view, change, EditorSelection.single(this.toEditorPos(e.selectionStart), this.toEditorPos(e.selectionEnd)));\n // If the transaction didn't flush our change, revert it so\n // that the context is in sync with the editor state again.\n if (this.pendingContextChange) {\n this.revertPending(view.state);\n this.setSelection(view.state);\n }\n };\n this.handlers.characterboundsupdate = e => {\n let rects = [], prev = null;\n for (let i = this.toEditorPos(e.rangeStart), end = this.toEditorPos(e.rangeEnd); i < end; i++) {\n let rect = view.coordsForChar(i);\n prev = (rect && new DOMRect(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top))\n || prev || new DOMRect;\n rects.push(prev);\n }\n context.updateCharacterBounds(e.rangeStart, rects);\n };\n this.handlers.textformatupdate = e => {\n let deco = [];\n for (let format of e.getTextFormats()) {\n let lineStyle = format.underlineStyle, thickness = format.underlineThickness;\n if (lineStyle != \"None\" && thickness != \"None\") {\n let style = `text-decoration: underline ${lineStyle == \"Dashed\" ? \"dashed \" : lineStyle == \"Squiggle\" ? \"wavy \" : \"\"}${thickness == \"Thin\" ? 1 : 2}px`;\n deco.push(Decoration.mark({ attributes: { style } })\n .range(this.toEditorPos(format.rangeStart), this.toEditorPos(format.rangeEnd)));\n }\n }\n view.dispatch({ effects: setEditContextFormatting.of(Decoration.set(deco)) });\n };\n this.handlers.compositionstart = () => {\n if (view.inputState.composing < 0) {\n view.inputState.composing = 0;\n view.inputState.compositionFirstChange = true;\n }\n };\n this.handlers.compositionend = () => {\n view.inputState.composing = -1;\n view.inputState.compositionFirstChange = null;\n };\n for (let event in this.handlers)\n context.addEventListener(event, this.handlers[event]);\n this.measureReq = { read: view => {\n this.editContext.updateControlBounds(view.contentDOM.getBoundingClientRect());\n let sel = getSelection(view.root);\n if (sel && sel.rangeCount)\n this.editContext.updateSelectionBounds(sel.getRangeAt(0).getBoundingClientRect());\n } };\n }\n applyEdits(update) {\n let off = 0, abort = false, pending = this.pendingContextChange;\n update.changes.iterChanges((fromA, toA, _fromB, _toB, insert) => {\n if (abort)\n return;\n let dLen = insert.length - (toA - fromA);\n if (pending && toA >= pending.to) {\n if (pending.from == fromA && pending.to == toA && pending.insert.eq(insert)) {\n pending = this.pendingContextChange = null; // Match\n off += dLen;\n this.to += dLen;\n return;\n }\n else { // Mismatch, revert\n pending = null;\n this.revertPending(update.state);\n }\n }\n fromA += off;\n toA += off;\n if (toA <= this.from) { // Before the window\n this.from += dLen;\n this.to += dLen;\n }\n else if (fromA < this.to) { // Overlaps with window\n if (fromA < this.from || toA > this.to || (this.to - this.from) + insert.length > 30000 /* CxVp.MaxSize */) {\n abort = true;\n return;\n }\n this.editContext.updateText(this.toContextPos(fromA), this.toContextPos(toA), insert.toString());\n this.to += dLen;\n }\n off += dLen;\n });\n if (pending && !abort)\n this.revertPending(update.state);\n return !abort;\n }\n update(update) {\n let reverted = this.pendingContextChange;\n if (!this.applyEdits(update) || !this.rangeIsValid(update.state)) {\n this.pendingContextChange = null;\n this.resetRange(update.state);\n this.editContext.updateText(0, this.editContext.text.length, update.state.doc.sliceString(this.from, this.to));\n this.setSelection(update.state);\n }\n else if (update.docChanged || update.selectionSet || reverted) {\n this.setSelection(update.state);\n }\n if (update.geometryChanged || update.docChanged || update.selectionSet)\n update.view.requestMeasure(this.measureReq);\n }\n resetRange(state) {\n let { head } = state.selection.main;\n this.from = Math.max(0, head - 10000 /* CxVp.Margin */);\n this.to = Math.min(state.doc.length, head + 10000 /* CxVp.Margin */);\n }\n revertPending(state) {\n let pending = this.pendingContextChange;\n this.pendingContextChange = null;\n this.editContext.updateText(this.toContextPos(pending.from), this.toContextPos(pending.from + pending.insert.length), state.doc.sliceString(pending.from, pending.to));\n }\n setSelection(state) {\n let { main } = state.selection;\n let start = this.toContextPos(Math.max(this.from, Math.min(this.to, main.anchor)));\n let end = this.toContextPos(main.head);\n if (this.editContext.selectionStart != start || this.editContext.selectionEnd != end)\n this.editContext.updateSelection(start, end);\n }\n rangeIsValid(state) {\n let { head } = state.selection.main;\n return !(this.from > 0 && head - this.from < 500 /* CxVp.MinMargin */ ||\n this.to < state.doc.length && this.to - head < 500 /* CxVp.MinMargin */ ||\n this.to - this.from > 10000 /* CxVp.Margin */ * 3);\n }\n toEditorPos(contextPos) { return contextPos + this.from; }\n toContextPos(editorPos) { return editorPos - this.from; }\n destroy() {\n for (let event in this.handlers)\n this.editContext.removeEventListener(event, this.handlers[event]);\n }\n }\n\n // The editor's update state machine looks something like this:\n //\n // Idle \u2192 Updating \u21C6 Idle (unchecked) \u2192 Measuring \u2192 Idle\n // \u2191 \u2193\n // Updating (measure)\n //\n // The difference between 'Idle' and 'Idle (unchecked)' lies in\n // whether a layout check has been scheduled. A regular update through\n // the `update` method updates the DOM in a write-only fashion, and\n // relies on a check (scheduled with `requestAnimationFrame`) to make\n // sure everything is where it should be and the viewport covers the\n // visible code. That check continues to measure and then optionally\n // update until it reaches a coherent state.\n /**\n An editor view represents the editor's user interface. It holds\n the editable DOM surface, and possibly other elements such as the\n line number gutter. It handles events and dispatches state\n transactions for editing actions.\n */\n class EditorView {\n /**\n The current editor state.\n */\n get state() { return this.viewState.state; }\n /**\n To be able to display large documents without consuming too much\n memory or overloading the browser, CodeMirror only draws the\n code that is visible (plus a margin around it) to the DOM. This\n property tells you the extent of the current drawn viewport, in\n document positions.\n */\n get viewport() { return this.viewState.viewport; }\n /**\n When there are, for example, large collapsed ranges in the\n viewport, its size can be a lot bigger than the actual visible\n content. Thus, if you are doing something like styling the\n content in the viewport, it is preferable to only do so for\n these ranges, which are the subset of the viewport that is\n actually drawn.\n */\n get visibleRanges() { return this.viewState.visibleRanges; }\n /**\n Returns false when the editor is entirely scrolled out of view\n or otherwise hidden.\n */\n get inView() { return this.viewState.inView; }\n /**\n Indicates whether the user is currently composing text via\n [IME](https://en.wikipedia.org/wiki/Input_method), and at least\n one change has been made in the current composition.\n */\n get composing() { return this.inputState.composing > 0; }\n /**\n Indicates whether the user is currently in composing state. Note\n that on some platforms, like Android, this will be the case a\n lot, since just putting the cursor on a word starts a\n composition there.\n */\n get compositionStarted() { return this.inputState.composing >= 0; }\n /**\n The document or shadow root that the view lives in.\n */\n get root() { return this._root; }\n /**\n @internal\n */\n get win() { return this.dom.ownerDocument.defaultView || window; }\n /**\n Construct a new view. You'll want to either provide a `parent`\n option, or put `view.dom` into your document after creating a\n view, so that the user can see the editor.\n */\n constructor(config = {}) {\n this.plugins = [];\n this.pluginMap = new Map;\n this.editorAttrs = {};\n this.contentAttrs = {};\n this.bidiCache = [];\n this.destroyed = false;\n /**\n @internal\n */\n this.updateState = 2 /* UpdateState.Updating */;\n /**\n @internal\n */\n this.measureScheduled = -1;\n /**\n @internal\n */\n this.measureRequests = [];\n this.contentDOM = document.createElement(\"div\");\n this.scrollDOM = document.createElement(\"div\");\n this.scrollDOM.tabIndex = -1;\n this.scrollDOM.className = \"cm-scroller\";\n this.scrollDOM.appendChild(this.contentDOM);\n this.announceDOM = document.createElement(\"div\");\n this.announceDOM.className = \"cm-announced\";\n this.announceDOM.setAttribute(\"aria-live\", \"polite\");\n this.dom = document.createElement(\"div\");\n this.dom.appendChild(this.announceDOM);\n this.dom.appendChild(this.scrollDOM);\n if (config.parent)\n config.parent.appendChild(this.dom);\n let { dispatch } = config;\n this.dispatchTransactions = config.dispatchTransactions ||\n (dispatch && ((trs) => trs.forEach(tr => dispatch(tr, this)))) ||\n ((trs) => this.update(trs));\n this.dispatch = this.dispatch.bind(this);\n this._root = (config.root || getRoot(config.parent) || document);\n this.viewState = new ViewState(config.state || EditorState.create(config));\n if (config.scrollTo && config.scrollTo.is(scrollIntoView$1))\n this.viewState.scrollTarget = config.scrollTo.value.clip(this.viewState.state);\n this.plugins = this.state.facet(viewPlugin).map(spec => new PluginInstance(spec));\n for (let plugin of this.plugins)\n plugin.update(this);\n this.observer = new DOMObserver(this);\n this.inputState = new InputState(this);\n this.inputState.ensureHandlers(this.plugins);\n this.docView = new DocView(this);\n this.mountStyles();\n this.updateAttrs();\n this.updateState = 0 /* UpdateState.Idle */;\n this.requestMeasure();\n }\n dispatch(...input) {\n let trs = input.length == 1 && input[0] instanceof Transaction ? input\n : input.length == 1 && Array.isArray(input[0]) ? input[0]\n : [this.state.update(...input)];\n this.dispatchTransactions(trs, this);\n }\n /**\n Update the view for the given array of transactions. This will\n update the visible document and selection to match the state\n produced by the transactions, and notify view plugins of the\n change. You should usually call\n [`dispatch`](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) instead, which uses this\n as a primitive.\n */\n update(transactions) {\n if (this.updateState != 0 /* UpdateState.Idle */)\n throw new Error(\"Calls to EditorView.update are not allowed while an update is in progress\");\n let redrawn = false, attrsChanged = false, update;\n let state = this.state;\n for (let tr of transactions) {\n if (tr.startState != state)\n throw new RangeError(\"Trying to update state with a transaction that doesn't start from the previous state.\");\n state = tr.state;\n }\n if (this.destroyed) {\n this.viewState.state = state;\n return;\n }\n let focus = this.hasFocus, focusFlag = 0, dispatchFocus = null;\n if (transactions.some(tr => tr.annotation(isFocusChange))) {\n this.inputState.notifiedFocused = focus;\n // If a focus-change transaction is being dispatched, set this update flag.\n focusFlag = 1 /* UpdateFlag.Focus */;\n }\n else if (focus != this.inputState.notifiedFocused) {\n this.inputState.notifiedFocused = focus;\n // Schedule a separate focus transaction if necessary, otherwise\n // add a flag to this update\n dispatchFocus = focusChangeTransaction(state, focus);\n if (!dispatchFocus)\n focusFlag = 1 /* UpdateFlag.Focus */;\n }\n // If there was a pending DOM change, eagerly read it and try to\n // apply it after the given transactions.\n let pendingKey = this.observer.delayedAndroidKey, domChange = null;\n if (pendingKey) {\n this.observer.clearDelayedAndroidKey();\n domChange = this.observer.readChange();\n // Only try to apply DOM changes if the transactions didn't\n // change the doc or selection.\n if (domChange && !this.state.doc.eq(state.doc) || !this.state.selection.eq(state.selection))\n domChange = null;\n }\n else {\n this.observer.clear();\n }\n // When the phrases change, redraw the editor\n if (state.facet(EditorState.phrases) != this.state.facet(EditorState.phrases))\n return this.setState(state);\n update = ViewUpdate.create(this, state, transactions);\n update.flags |= focusFlag;\n let scrollTarget = this.viewState.scrollTarget;\n try {\n this.updateState = 2 /* UpdateState.Updating */;\n for (let tr of transactions) {\n if (scrollTarget)\n scrollTarget = scrollTarget.map(tr.changes);\n if (tr.scrollIntoView) {\n let { main } = tr.state.selection;\n scrollTarget = new ScrollTarget(main.empty ? main : EditorSelection.cursor(main.head, main.head > main.anchor ? -1 : 1));\n }\n for (let e of tr.effects)\n if (e.is(scrollIntoView$1))\n scrollTarget = e.value.clip(this.state);\n }\n this.viewState.update(update, scrollTarget);\n this.bidiCache = CachedOrder.update(this.bidiCache, update.changes);\n if (!update.empty) {\n this.updatePlugins(update);\n this.inputState.update(update);\n }\n redrawn = this.docView.update(update);\n if (this.state.facet(styleModule) != this.styleModules)\n this.mountStyles();\n attrsChanged = this.updateAttrs();\n this.showAnnouncements(transactions);\n this.docView.updateSelection(redrawn, transactions.some(tr => tr.isUserEvent(\"select.pointer\")));\n }\n finally {\n this.updateState = 0 /* UpdateState.Idle */;\n }\n if (update.startState.facet(theme) != update.state.facet(theme))\n this.viewState.mustMeasureContent = true;\n if (redrawn || attrsChanged || scrollTarget || this.viewState.mustEnforceCursorAssoc || this.viewState.mustMeasureContent)\n this.requestMeasure();\n if (redrawn)\n this.docViewUpdate();\n if (!update.empty)\n for (let listener of this.state.facet(updateListener)) {\n try {\n listener(update);\n }\n catch (e) {\n logException(this.state, e, \"update listener\");\n }\n }\n if (dispatchFocus || domChange)\n Promise.resolve().then(() => {\n if (dispatchFocus && this.state == dispatchFocus.startState)\n this.dispatch(dispatchFocus);\n if (domChange) {\n if (!applyDOMChange(this, domChange) && pendingKey.force)\n dispatchKey(this.contentDOM, pendingKey.key, pendingKey.keyCode);\n }\n });\n }\n /**\n Reset the view to the given state. (This will cause the entire\n document to be redrawn and all view plugins to be reinitialized,\n so you should probably only use it when the new state isn't\n derived from the old state. Otherwise, use\n [`dispatch`](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) instead.)\n */\n setState(newState) {\n if (this.updateState != 0 /* UpdateState.Idle */)\n throw new Error(\"Calls to EditorView.setState are not allowed while an update is in progress\");\n if (this.destroyed) {\n this.viewState.state = newState;\n return;\n }\n this.updateState = 2 /* UpdateState.Updating */;\n let hadFocus = this.hasFocus;\n try {\n for (let plugin of this.plugins)\n plugin.destroy(this);\n this.viewState = new ViewState(newState);\n this.plugins = newState.facet(viewPlugin).map(spec => new PluginInstance(spec));\n this.pluginMap.clear();\n for (let plugin of this.plugins)\n plugin.update(this);\n this.docView.destroy();\n this.docView = new DocView(this);\n this.inputState.ensureHandlers(this.plugins);\n this.mountStyles();\n this.updateAttrs();\n this.bidiCache = [];\n }\n finally {\n this.updateState = 0 /* UpdateState.Idle */;\n }\n if (hadFocus)\n this.focus();\n this.requestMeasure();\n }\n updatePlugins(update) {\n let prevSpecs = update.startState.facet(viewPlugin), specs = update.state.facet(viewPlugin);\n if (prevSpecs != specs) {\n let newPlugins = [];\n for (let spec of specs) {\n let found = prevSpecs.indexOf(spec);\n if (found < 0) {\n newPlugins.push(new PluginInstance(spec));\n }\n else {\n let plugin = this.plugins[found];\n plugin.mustUpdate = update;\n newPlugins.push(plugin);\n }\n }\n for (let plugin of this.plugins)\n if (plugin.mustUpdate != update)\n plugin.destroy(this);\n this.plugins = newPlugins;\n this.pluginMap.clear();\n }\n else {\n for (let p of this.plugins)\n p.mustUpdate = update;\n }\n for (let i = 0; i < this.plugins.length; i++)\n this.plugins[i].update(this);\n if (prevSpecs != specs)\n this.inputState.ensureHandlers(this.plugins);\n }\n docViewUpdate() {\n for (let plugin of this.plugins) {\n let val = plugin.value;\n if (val && val.docViewUpdate) {\n try {\n val.docViewUpdate(this);\n }\n catch (e) {\n logException(this.state, e, \"doc view update listener\");\n }\n }\n }\n }\n /**\n @internal\n */\n measure(flush = true) {\n if (this.destroyed)\n return;\n if (this.measureScheduled > -1)\n this.win.cancelAnimationFrame(this.measureScheduled);\n if (this.observer.delayedAndroidKey) {\n this.measureScheduled = -1;\n this.requestMeasure();\n return;\n }\n this.measureScheduled = 0; // Prevent requestMeasure calls from scheduling another animation frame\n if (flush)\n this.observer.forceFlush();\n let updated = null;\n let sDOM = this.scrollDOM, scrollTop = sDOM.scrollTop * this.scaleY;\n let { scrollAnchorPos, scrollAnchorHeight } = this.viewState;\n if (Math.abs(scrollTop - this.viewState.scrollTop) > 1)\n scrollAnchorHeight = -1;\n this.viewState.scrollAnchorHeight = -1;\n try {\n for (let i = 0;; i++) {\n if (scrollAnchorHeight < 0) {\n if (isScrolledToBottom(sDOM)) {\n scrollAnchorPos = -1;\n scrollAnchorHeight = this.viewState.heightMap.height;\n }\n else {\n let block = this.viewState.scrollAnchorAt(scrollTop);\n scrollAnchorPos = block.from;\n scrollAnchorHeight = block.top;\n }\n }\n this.updateState = 1 /* UpdateState.Measuring */;\n let changed = this.viewState.measure(this);\n if (!changed && !this.measureRequests.length && this.viewState.scrollTarget == null)\n break;\n if (i > 5) {\n console.warn(this.measureRequests.length\n ? \"Measure loop restarted more than 5 times\"\n : \"Viewport failed to stabilize\");\n break;\n }\n let measuring = [];\n // Only run measure requests in this cycle when the viewport didn't change\n if (!(changed & 4 /* UpdateFlag.Viewport */))\n [this.measureRequests, measuring] = [measuring, this.measureRequests];\n let measured = measuring.map(m => {\n try {\n return m.read(this);\n }\n catch (e) {\n logException(this.state, e);\n return BadMeasure;\n }\n });\n let update = ViewUpdate.create(this, this.state, []), redrawn = false;\n update.flags |= changed;\n if (!updated)\n updated = update;\n else\n updated.flags |= changed;\n this.updateState = 2 /* UpdateState.Updating */;\n if (!update.empty) {\n this.updatePlugins(update);\n this.inputState.update(update);\n this.updateAttrs();\n redrawn = this.docView.update(update);\n if (redrawn)\n this.docViewUpdate();\n }\n for (let i = 0; i < measuring.length; i++)\n if (measured[i] != BadMeasure) {\n try {\n let m = measuring[i];\n if (m.write)\n m.write(measured[i], this);\n }\n catch (e) {\n logException(this.state, e);\n }\n }\n if (redrawn)\n this.docView.updateSelection(true);\n if (!update.viewportChanged && this.measureRequests.length == 0) {\n if (this.viewState.editorHeight) {\n if (this.viewState.scrollTarget) {\n this.docView.scrollIntoView(this.viewState.scrollTarget);\n this.viewState.scrollTarget = null;\n scrollAnchorHeight = -1;\n continue;\n }\n else {\n let newAnchorHeight = scrollAnchorPos < 0 ? this.viewState.heightMap.height :\n this.viewState.lineBlockAt(scrollAnchorPos).top;\n let diff = newAnchorHeight - scrollAnchorHeight;\n if (diff > 1 || diff < -1) {\n scrollTop = scrollTop + diff;\n sDOM.scrollTop = scrollTop / this.scaleY;\n scrollAnchorHeight = -1;\n continue;\n }\n }\n }\n break;\n }\n }\n }\n finally {\n this.updateState = 0 /* UpdateState.Idle */;\n this.measureScheduled = -1;\n }\n if (updated && !updated.empty)\n for (let listener of this.state.facet(updateListener))\n listener(updated);\n }\n /**\n Get the CSS classes for the currently active editor themes.\n */\n get themeClasses() {\n return baseThemeID + \" \" +\n (this.state.facet(darkTheme) ? baseDarkID : baseLightID) + \" \" +\n this.state.facet(theme);\n }\n updateAttrs() {\n let editorAttrs = attrsFromFacet(this, editorAttributes, {\n class: \"cm-editor\" + (this.hasFocus ? \" cm-focused \" : \" \") + this.themeClasses\n });\n let contentAttrs = {\n spellcheck: \"false\",\n autocorrect: \"off\",\n autocapitalize: \"off\",\n translate: \"no\",\n contenteditable: !this.state.facet(editable) ? \"false\" : \"true\",\n class: \"cm-content\",\n style: `${browser.tabSize}: ${this.state.tabSize}`,\n role: \"textbox\",\n \"aria-multiline\": \"true\"\n };\n if (this.state.readOnly)\n contentAttrs[\"aria-readonly\"] = \"true\";\n attrsFromFacet(this, contentAttributes, contentAttrs);\n let changed = this.observer.ignore(() => {\n let changedContent = updateAttrs(this.contentDOM, this.contentAttrs, contentAttrs);\n let changedEditor = updateAttrs(this.dom, this.editorAttrs, editorAttrs);\n return changedContent || changedEditor;\n });\n this.editorAttrs = editorAttrs;\n this.contentAttrs = contentAttrs;\n return changed;\n }\n showAnnouncements(trs) {\n let first = true;\n for (let tr of trs)\n for (let effect of tr.effects)\n if (effect.is(EditorView.announce)) {\n if (first)\n this.announceDOM.textContent = \"\";\n first = false;\n let div = this.announceDOM.appendChild(document.createElement(\"div\"));\n div.textContent = effect.value;\n }\n }\n mountStyles() {\n this.styleModules = this.state.facet(styleModule);\n let nonce = this.state.facet(EditorView.cspNonce);\n StyleModule.mount(this.root, this.styleModules.concat(baseTheme$1$2).reverse(), nonce ? { nonce } : undefined);\n }\n readMeasured() {\n if (this.updateState == 2 /* UpdateState.Updating */)\n throw new Error(\"Reading the editor layout isn't allowed during an update\");\n if (this.updateState == 0 /* UpdateState.Idle */ && this.measureScheduled > -1)\n this.measure(false);\n }\n /**\n Schedule a layout measurement, optionally providing callbacks to\n do custom DOM measuring followed by a DOM write phase. Using\n this is preferable reading DOM layout directly from, for\n example, an event handler, because it'll make sure measuring and\n drawing done by other components is synchronized, avoiding\n unnecessary DOM layout computations.\n */\n requestMeasure(request) {\n if (this.measureScheduled < 0)\n this.measureScheduled = this.win.requestAnimationFrame(() => this.measure());\n if (request) {\n if (this.measureRequests.indexOf(request) > -1)\n return;\n if (request.key != null)\n for (let i = 0; i < this.measureRequests.length; i++) {\n if (this.measureRequests[i].key === request.key) {\n this.measureRequests[i] = request;\n return;\n }\n }\n this.measureRequests.push(request);\n }\n }\n /**\n Get the value of a specific plugin, if present. Note that\n plugins that crash can be dropped from a view, so even when you\n know you registered a given plugin, it is recommended to check\n the return value of this method.\n */\n plugin(plugin) {\n let known = this.pluginMap.get(plugin);\n if (known === undefined || known && known.spec != plugin)\n this.pluginMap.set(plugin, known = this.plugins.find(p => p.spec == plugin) || null);\n return known && known.update(this).value;\n }\n /**\n The top position of the document, in screen coordinates. This\n may be negative when the editor is scrolled down. Points\n directly to the top of the first line, not above the padding.\n */\n get documentTop() {\n return this.contentDOM.getBoundingClientRect().top + this.viewState.paddingTop;\n }\n /**\n Reports the padding above and below the document.\n */\n get documentPadding() {\n return { top: this.viewState.paddingTop, bottom: this.viewState.paddingBottom };\n }\n /**\n If the editor is transformed with CSS, this provides the scale\n along the X axis. Otherwise, it will just be 1. Note that\n transforms other than translation and scaling are not supported.\n */\n get scaleX() { return this.viewState.scaleX; }\n /**\n Provide the CSS transformed scale along the Y axis.\n */\n get scaleY() { return this.viewState.scaleY; }\n /**\n Find the text line or block widget at the given vertical\n position (which is interpreted as relative to the [top of the\n document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop)).\n */\n elementAtHeight(height) {\n this.readMeasured();\n return this.viewState.elementAtHeight(height);\n }\n /**\n Find the line block (see\n [`lineBlockAt`](https://codemirror.net/6/docs/ref/#view.EditorView.lineBlockAt) at the given\n height, again interpreted relative to the [top of the\n document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop).\n */\n lineBlockAtHeight(height) {\n this.readMeasured();\n return this.viewState.lineBlockAtHeight(height);\n }\n /**\n Get the extent and vertical position of all [line\n blocks](https://codemirror.net/6/docs/ref/#view.EditorView.lineBlockAt) in the viewport. Positions\n are relative to the [top of the\n document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop);\n */\n get viewportLineBlocks() {\n return this.viewState.viewportLines;\n }\n /**\n Find the line block around the given document position. A line\n block is a range delimited on both sides by either a\n non-[hidden](https://codemirror.net/6/docs/ref/#view.Decoration^replace) line breaks, or the\n start/end of the document. It will usually just hold a line of\n text, but may be broken into multiple textblocks by block\n widgets.\n */\n lineBlockAt(pos) {\n return this.viewState.lineBlockAt(pos);\n }\n /**\n The editor's total content height.\n */\n get contentHeight() {\n return this.viewState.contentHeight;\n }\n /**\n Move a cursor position by [grapheme\n cluster](https://codemirror.net/6/docs/ref/#state.findClusterBreak). `forward` determines whether\n the motion is away from the line start, or towards it. In\n bidirectional text, the line is traversed in visual order, using\n the editor's [text direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection).\n When the start position was the last one on the line, the\n returned position will be across the line break. If there is no\n further line, the original position is returned.\n \n By default, this method moves over a single cluster. The\n optional `by` argument can be used to move across more. It will\n be called with the first cluster as argument, and should return\n a predicate that determines, for each subsequent cluster,\n whether it should also be moved over.\n */\n moveByChar(start, forward, by) {\n return skipAtoms(this, start, moveByChar(this, start, forward, by));\n }\n /**\n Move a cursor position across the next group of either\n [letters](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer) or non-letter\n non-whitespace characters.\n */\n moveByGroup(start, forward) {\n return skipAtoms(this, start, moveByChar(this, start, forward, initial => byGroup(this, start.head, initial)));\n }\n /**\n Get the cursor position visually at the start or end of a line.\n Note that this may differ from the _logical_ position at its\n start or end (which is simply at `line.from`/`line.to`) if text\n at the start or end goes against the line's base text direction.\n */\n visualLineSide(line, end) {\n let order = this.bidiSpans(line), dir = this.textDirectionAt(line.from);\n let span = order[end ? order.length - 1 : 0];\n return EditorSelection.cursor(span.side(end, dir) + line.from, span.forward(!end, dir) ? 1 : -1);\n }\n /**\n Move to the next line boundary in the given direction. If\n `includeWrap` is true, line wrapping is on, and there is a\n further wrap point on the current line, the wrap point will be\n returned. Otherwise this function will return the start or end\n of the line.\n */\n moveToLineBoundary(start, forward, includeWrap = true) {\n return moveToLineBoundary(this, start, forward, includeWrap);\n }\n /**\n Move a cursor position vertically. When `distance` isn't given,\n it defaults to moving to the next line (including wrapped\n lines). Otherwise, `distance` should provide a positive distance\n in pixels.\n \n When `start` has a\n [`goalColumn`](https://codemirror.net/6/docs/ref/#state.SelectionRange.goalColumn), the vertical\n motion will use that as a target horizontal position. Otherwise,\n the cursor's own horizontal position is used. The returned\n cursor will have its goal column set to whichever column was\n used.\n */\n moveVertically(start, forward, distance) {\n return skipAtoms(this, start, moveVertically(this, start, forward, distance));\n }\n /**\n Find the DOM parent node and offset (child offset if `node` is\n an element, character offset when it is a text node) at the\n given document position.\n \n Note that for positions that aren't currently in\n `visibleRanges`, the resulting DOM position isn't necessarily\n meaningful (it may just point before or after a placeholder\n element).\n */\n domAtPos(pos) {\n return this.docView.domAtPos(pos);\n }\n /**\n Find the document position at the given DOM node. Can be useful\n for associating positions with DOM events. Will raise an error\n when `node` isn't part of the editor content.\n */\n posAtDOM(node, offset = 0) {\n return this.docView.posFromDOM(node, offset);\n }\n posAtCoords(coords, precise = true) {\n this.readMeasured();\n return posAtCoords(this, coords, precise);\n }\n /**\n Get the screen coordinates at the given document position.\n `side` determines whether the coordinates are based on the\n element before (-1) or after (1) the position (if no element is\n available on the given side, the method will transparently use\n another strategy to get reasonable coordinates).\n */\n coordsAtPos(pos, side = 1) {\n this.readMeasured();\n let rect = this.docView.coordsAt(pos, side);\n if (!rect || rect.left == rect.right)\n return rect;\n let line = this.state.doc.lineAt(pos), order = this.bidiSpans(line);\n let span = order[BidiSpan.find(order, pos - line.from, -1, side)];\n return flattenRect(rect, (span.dir == Direction.LTR) == (side > 0));\n }\n /**\n Return the rectangle around a given character. If `pos` does not\n point in front of a character that is in the viewport and\n rendered (i.e. not replaced, not a line break), this will return\n null. For space characters that are a line wrap point, this will\n return the position before the line break.\n */\n coordsForChar(pos) {\n this.readMeasured();\n return this.docView.coordsForChar(pos);\n }\n /**\n The default width of a character in the editor. May not\n accurately reflect the width of all characters (given variable\n width fonts or styling of invididual ranges).\n */\n get defaultCharacterWidth() { return this.viewState.heightOracle.charWidth; }\n /**\n The default height of a line in the editor. May not be accurate\n for all lines.\n */\n get defaultLineHeight() { return this.viewState.heightOracle.lineHeight; }\n /**\n The text direction\n ([`direction`](https://developer.mozilla.org/en-US/docs/Web/CSS/direction)\n CSS property) of the editor's content element.\n */\n get textDirection() { return this.viewState.defaultTextDirection; }\n /**\n Find the text direction of the block at the given position, as\n assigned by CSS. If\n [`perLineTextDirection`](https://codemirror.net/6/docs/ref/#view.EditorView^perLineTextDirection)\n isn't enabled, or the given position is outside of the viewport,\n this will always return the same as\n [`textDirection`](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection). Note that\n this may trigger a DOM layout.\n */\n textDirectionAt(pos) {\n let perLine = this.state.facet(perLineTextDirection);\n if (!perLine || pos < this.viewport.from || pos > this.viewport.to)\n return this.textDirection;\n this.readMeasured();\n return this.docView.textDirectionAt(pos);\n }\n /**\n Whether this editor [wraps lines](https://codemirror.net/6/docs/ref/#view.EditorView.lineWrapping)\n (as determined by the\n [`white-space`](https://developer.mozilla.org/en-US/docs/Web/CSS/white-space)\n CSS property of its content element).\n */\n get lineWrapping() { return this.viewState.heightOracle.lineWrapping; }\n /**\n Returns the bidirectional text structure of the given line\n (which should be in the current document) as an array of span\n objects. The order of these spans matches the [text\n direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection)\u2014if that is\n left-to-right, the leftmost spans come first, otherwise the\n rightmost spans come first.\n */\n bidiSpans(line) {\n if (line.length > MaxBidiLine)\n return trivialOrder(line.length);\n let dir = this.textDirectionAt(line.from), isolates;\n for (let entry of this.bidiCache) {\n if (entry.from == line.from && entry.dir == dir &&\n (entry.fresh || isolatesEq(entry.isolates, isolates = getIsolatedRanges(this, line))))\n return entry.order;\n }\n if (!isolates)\n isolates = getIsolatedRanges(this, line);\n let order = computeOrder(line.text, dir, isolates);\n this.bidiCache.push(new CachedOrder(line.from, line.to, dir, isolates, true, order));\n return order;\n }\n /**\n Check whether the editor has focus.\n */\n get hasFocus() {\n var _a;\n // Safari return false for hasFocus when the context menu is open\n // or closing, which leads us to ignore selection changes from the\n // context menu because it looks like the editor isn't focused.\n // This kludges around that.\n return (this.dom.ownerDocument.hasFocus() || browser.safari && ((_a = this.inputState) === null || _a === void 0 ? void 0 : _a.lastContextMenu) > Date.now() - 3e4) &&\n this.root.activeElement == this.contentDOM;\n }\n /**\n Put focus on the editor.\n */\n focus() {\n this.observer.ignore(() => {\n focusPreventScroll(this.contentDOM);\n this.docView.updateSelection();\n });\n }\n /**\n Update the [root](https://codemirror.net/6/docs/ref/##view.EditorViewConfig.root) in which the editor lives. This is only\n necessary when moving the editor's existing DOM to a new window or shadow root.\n */\n setRoot(root) {\n if (this._root != root) {\n this._root = root;\n this.observer.setWindow((root.nodeType == 9 ? root : root.ownerDocument).defaultView || window);\n this.mountStyles();\n }\n }\n /**\n Clean up this editor view, removing its element from the\n document, unregistering event handlers, and notifying\n plugins. The view instance can no longer be used after\n calling this.\n */\n destroy() {\n if (this.root.activeElement == this.contentDOM)\n this.contentDOM.blur();\n for (let plugin of this.plugins)\n plugin.destroy(this);\n this.plugins = [];\n this.inputState.destroy();\n this.docView.destroy();\n this.dom.remove();\n this.observer.destroy();\n if (this.measureScheduled > -1)\n this.win.cancelAnimationFrame(this.measureScheduled);\n this.destroyed = true;\n }\n /**\n Returns an effect that can be\n [added](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) to a transaction to\n cause it to scroll the given position or range into view.\n */\n static scrollIntoView(pos, options = {}) {\n return scrollIntoView$1.of(new ScrollTarget(typeof pos == \"number\" ? EditorSelection.cursor(pos) : pos, options.y, options.x, options.yMargin, options.xMargin));\n }\n /**\n Return an effect that resets the editor to its current (at the\n time this method was called) scroll position. Note that this\n only affects the editor's own scrollable element, not parents.\n See also\n [`EditorViewConfig.scrollTo`](https://codemirror.net/6/docs/ref/#view.EditorViewConfig.scrollTo).\n \n The effect should be used with a document identical to the one\n it was created for. Failing to do so is not an error, but may\n not scroll to the expected position. You can\n [map](https://codemirror.net/6/docs/ref/#state.StateEffect.map) the effect to account for changes.\n */\n scrollSnapshot() {\n let { scrollTop, scrollLeft } = this.scrollDOM;\n let ref = this.viewState.scrollAnchorAt(scrollTop);\n return scrollIntoView$1.of(new ScrollTarget(EditorSelection.cursor(ref.from), \"start\", \"start\", ref.top - scrollTop, scrollLeft, true));\n }\n /**\n Enable or disable tab-focus mode, which disables key bindings\n for Tab and Shift-Tab, letting the browser's default\n focus-changing behavior go through instead. This is useful to\n prevent trapping keyboard users in your editor.\n \n Without argument, this toggles the mode. With a boolean, it\n enables (true) or disables it (false). Given a number, it\n temporarily enables the mode until that number of milliseconds\n have passed or another non-Tab key is pressed.\n */\n setTabFocusMode(to) {\n if (to == null)\n this.inputState.tabFocusMode = this.inputState.tabFocusMode < 0 ? 0 : -1;\n else if (typeof to == \"boolean\")\n this.inputState.tabFocusMode = to ? 0 : -1;\n else if (this.inputState.tabFocusMode != 0)\n this.inputState.tabFocusMode = Date.now() + to;\n }\n /**\n Returns an extension that can be used to add DOM event handlers.\n The value should be an object mapping event names to handler\n functions. For any given event, such functions are ordered by\n extension precedence, and the first handler to return true will\n be assumed to have handled that event, and no other handlers or\n built-in behavior will be activated for it. These are registered\n on the [content element](https://codemirror.net/6/docs/ref/#view.EditorView.contentDOM), except\n for `scroll` handlers, which will be called any time the\n editor's [scroll element](https://codemirror.net/6/docs/ref/#view.EditorView.scrollDOM) or one of\n its parent nodes is scrolled.\n */\n static domEventHandlers(handlers) {\n return ViewPlugin.define(() => ({}), { eventHandlers: handlers });\n }\n /**\n Create an extension that registers DOM event observers. Contrary\n to event [handlers](https://codemirror.net/6/docs/ref/#view.EditorView^domEventHandlers),\n observers can't be prevented from running by a higher-precedence\n handler returning true. They also don't prevent other handlers\n and observers from running when they return true, and should not\n call `preventDefault`.\n */\n static domEventObservers(observers) {\n return ViewPlugin.define(() => ({}), { eventObservers: observers });\n }\n /**\n Create a theme extension. The first argument can be a\n [`style-mod`](https://github.com/marijnh/style-mod#documentation)\n style spec providing the styles for the theme. These will be\n prefixed with a generated class for the style.\n \n Because the selectors will be prefixed with a scope class, rule\n that directly match the editor's [wrapper\n element](https://codemirror.net/6/docs/ref/#view.EditorView.dom)\u2014to which the scope class will be\n added\u2014need to be explicitly differentiated by adding an `&` to\n the selector for that element\u2014for example\n `&.cm-focused`.\n \n When `dark` is set to true, the theme will be marked as dark,\n which will cause the `&dark` rules from [base\n themes](https://codemirror.net/6/docs/ref/#view.EditorView^baseTheme) to be used (as opposed to\n `&light` when a light theme is active).\n */\n static theme(spec, options) {\n let prefix = StyleModule.newName();\n let result = [theme.of(prefix), styleModule.of(buildTheme(`.${prefix}`, spec))];\n if (options && options.dark)\n result.push(darkTheme.of(true));\n return result;\n }\n /**\n Create an extension that adds styles to the base theme. Like\n with [`theme`](https://codemirror.net/6/docs/ref/#view.EditorView^theme), use `&` to indicate the\n place of the editor wrapper element when directly targeting\n that. You can also use `&dark` or `&light` instead to only\n target editors with a dark or light theme.\n */\n static baseTheme(spec) {\n return Prec.lowest(styleModule.of(buildTheme(\".\" + baseThemeID, spec, lightDarkIDs)));\n }\n /**\n Retrieve an editor view instance from the view's DOM\n representation.\n */\n static findFromDOM(dom) {\n var _a;\n let content = dom.querySelector(\".cm-content\");\n let cView = content && ContentView.get(content) || ContentView.get(dom);\n return ((_a = cView === null || cView === void 0 ? void 0 : cView.rootView) === null || _a === void 0 ? void 0 : _a.view) || null;\n }\n }\n /**\n Facet to add a [style\n module](https://github.com/marijnh/style-mod#documentation) to\n an editor view. The view will ensure that the module is\n mounted in its [document\n root](https://codemirror.net/6/docs/ref/#view.EditorView.constructor^config.root).\n */\n EditorView.styleModule = styleModule;\n /**\n An input handler can override the way changes to the editable\n DOM content are handled. Handlers are passed the document\n positions between which the change was found, and the new\n content. When one returns true, no further input handlers are\n called and the default behavior is prevented.\n\n The `insert` argument can be used to get the default transaction\n that would be applied for this input. This can be useful when\n dispatching the custom behavior as a separate transaction.\n */\n EditorView.inputHandler = inputHandler$1;\n /**\n Scroll handlers can override how things are scrolled into view.\n If they return `true`, no further handling happens for the\n scrolling. If they return false, the default scroll behavior is\n applied. Scroll handlers should never initiate editor updates.\n */\n EditorView.scrollHandler = scrollHandler;\n /**\n This facet can be used to provide functions that create effects\n to be dispatched when the editor's focus state changes.\n */\n EditorView.focusChangeEffect = focusChangeEffect;\n /**\n By default, the editor assumes all its content has the same\n [text direction](https://codemirror.net/6/docs/ref/#view.Direction). Configure this with a `true`\n value to make it read the text direction of every (rendered)\n line separately.\n */\n EditorView.perLineTextDirection = perLineTextDirection;\n /**\n Allows you to provide a function that should be called when the\n library catches an exception from an extension (mostly from view\n plugins, but may be used by other extensions to route exceptions\n from user-code-provided callbacks). This is mostly useful for\n debugging and logging. See [`logException`](https://codemirror.net/6/docs/ref/#view.logException).\n */\n EditorView.exceptionSink = exceptionSink;\n /**\n A facet that can be used to register a function to be called\n every time the view updates.\n */\n EditorView.updateListener = updateListener;\n /**\n Facet that controls whether the editor content DOM is editable.\n When its highest-precedence value is `false`, the element will\n not have its `contenteditable` attribute set. (Note that this\n doesn't affect API calls that change the editor content, even\n when those are bound to keys or buttons. See the\n [`readOnly`](https://codemirror.net/6/docs/ref/#state.EditorState.readOnly) facet for that.)\n */\n EditorView.editable = editable;\n /**\n Allows you to influence the way mouse selection happens. The\n functions in this facet will be called for a `mousedown` event\n on the editor, and can return an object that overrides the way a\n selection is computed from that mouse click or drag.\n */\n EditorView.mouseSelectionStyle = mouseSelectionStyle;\n /**\n Facet used to configure whether a given selection drag event\n should move or copy the selection. The given predicate will be\n called with the `mousedown` event, and can return `true` when\n the drag should move the content.\n */\n EditorView.dragMovesSelection = dragMovesSelection$1;\n /**\n Facet used to configure whether a given selecting click adds a\n new range to the existing selection or replaces it entirely. The\n default behavior is to check `event.metaKey` on macOS, and\n `event.ctrlKey` elsewhere.\n */\n EditorView.clickAddsSelectionRange = clickAddsSelectionRange;\n /**\n A facet that determines which [decorations](https://codemirror.net/6/docs/ref/#view.Decoration)\n are shown in the view. Decorations can be provided in two\n ways\u2014directly, or via a function that takes an editor view.\n\n Only decoration sets provided directly are allowed to influence\n the editor's vertical layout structure. The ones provided as\n functions are called _after_ the new viewport has been computed,\n and thus **must not** introduce block widgets or replacing\n decorations that cover line breaks.\n\n If you want decorated ranges to behave like atomic units for\n cursor motion and deletion purposes, also provide the range set\n containing the decorations to\n [`EditorView.atomicRanges`](https://codemirror.net/6/docs/ref/#view.EditorView^atomicRanges).\n */\n EditorView.decorations = decorations;\n /**\n Facet that works much like\n [`decorations`](https://codemirror.net/6/docs/ref/#view.EditorView^decorations), but puts its\n inputs at the very bottom of the precedence stack, meaning mark\n decorations provided here will only be split by other, partially\n overlapping \\`outerDecorations\\` ranges, and wrap around all\n regular decorations. Use this for mark elements that should, as\n much as possible, remain in one piece.\n */\n EditorView.outerDecorations = outerDecorations;\n /**\n Used to provide ranges that should be treated as atoms as far as\n cursor motion is concerned. This causes methods like\n [`moveByChar`](https://codemirror.net/6/docs/ref/#view.EditorView.moveByChar) and\n [`moveVertically`](https://codemirror.net/6/docs/ref/#view.EditorView.moveVertically) (and the\n commands built on top of them) to skip across such regions when\n a selection endpoint would enter them. This does _not_ prevent\n direct programmatic [selection\n updates](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection) from moving into such\n regions.\n */\n EditorView.atomicRanges = atomicRanges;\n /**\n When range decorations add a `unicode-bidi: isolate` style, they\n should also include a\n [`bidiIsolate`](https://codemirror.net/6/docs/ref/#view.MarkDecorationSpec.bidiIsolate) property\n in their decoration spec, and be exposed through this facet, so\n that the editor can compute the proper text order. (Other values\n for `unicode-bidi`, except of course `normal`, are not\n supported.)\n */\n EditorView.bidiIsolatedRanges = bidiIsolatedRanges;\n /**\n Facet that allows extensions to provide additional scroll\n margins (space around the sides of the scrolling element that\n should be considered invisible). This can be useful when the\n plugin introduces elements that cover part of that element (for\n example a horizontally fixed gutter).\n */\n EditorView.scrollMargins = scrollMargins;\n /**\n This facet records whether a dark theme is active. The extension\n returned by [`theme`](https://codemirror.net/6/docs/ref/#view.EditorView^theme) automatically\n includes an instance of this when the `dark` option is set to\n true.\n */\n EditorView.darkTheme = darkTheme;\n /**\n Provides a Content Security Policy nonce to use when creating\n the style sheets for the editor. Holds the empty string when no\n nonce has been provided.\n */\n EditorView.cspNonce = /*@__PURE__*/Facet.define({ combine: values => values.length ? values[0] : \"\" });\n /**\n Facet that provides additional DOM attributes for the editor's\n editable DOM element.\n */\n EditorView.contentAttributes = contentAttributes;\n /**\n Facet that provides DOM attributes for the editor's outer\n element.\n */\n EditorView.editorAttributes = editorAttributes;\n /**\n An extension that enables line wrapping in the editor (by\n setting CSS `white-space` to `pre-wrap` in the content).\n */\n EditorView.lineWrapping = /*@__PURE__*/EditorView.contentAttributes.of({ \"class\": \"cm-lineWrapping\" });\n /**\n State effect used to include screen reader announcements in a\n transaction. These will be added to the DOM in a visually hidden\n element with `aria-live=\"polite\"` set, and should be used to\n describe effects that are visually obvious but may not be\n noticed by screen reader users (such as moving to the next\n search match).\n */\n EditorView.announce = /*@__PURE__*/StateEffect.define();\n // Maximum line length for which we compute accurate bidi info\n const MaxBidiLine = 4096;\n const BadMeasure = {};\n class CachedOrder {\n constructor(from, to, dir, isolates, fresh, order) {\n this.from = from;\n this.to = to;\n this.dir = dir;\n this.isolates = isolates;\n this.fresh = fresh;\n this.order = order;\n }\n static update(cache, changes) {\n if (changes.empty && !cache.some(c => c.fresh))\n return cache;\n let result = [], lastDir = cache.length ? cache[cache.length - 1].dir : Direction.LTR;\n for (let i = Math.max(0, cache.length - 10); i < cache.length; i++) {\n let entry = cache[i];\n if (entry.dir == lastDir && !changes.touchesRange(entry.from, entry.to))\n result.push(new CachedOrder(changes.mapPos(entry.from, 1), changes.mapPos(entry.to, -1), entry.dir, entry.isolates, false, entry.order));\n }\n return result;\n }\n }\n function attrsFromFacet(view, facet, base) {\n for (let sources = view.state.facet(facet), i = sources.length - 1; i >= 0; i--) {\n let source = sources[i], value = typeof source == \"function\" ? source(view) : source;\n if (value)\n combineAttrs(value, base);\n }\n return base;\n }\n\n const currentPlatform = browser.mac ? \"mac\" : browser.windows ? \"win\" : browser.linux ? \"linux\" : \"key\";\n function normalizeKeyName(name, platform) {\n const parts = name.split(/-(?!$)/);\n let result = parts[parts.length - 1];\n if (result == \"Space\")\n result = \" \";\n let alt, ctrl, shift, meta;\n for (let i = 0; i < parts.length - 1; ++i) {\n const mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod))\n meta = true;\n else if (/^a(lt)?$/i.test(mod))\n alt = true;\n else if (/^(c|ctrl|control)$/i.test(mod))\n ctrl = true;\n else if (/^s(hift)?$/i.test(mod))\n shift = true;\n else if (/^mod$/i.test(mod)) {\n if (platform == \"mac\")\n meta = true;\n else\n ctrl = true;\n }\n else\n throw new Error(\"Unrecognized modifier name: \" + mod);\n }\n if (alt)\n result = \"Alt-\" + result;\n if (ctrl)\n result = \"Ctrl-\" + result;\n if (meta)\n result = \"Meta-\" + result;\n if (shift)\n result = \"Shift-\" + result;\n return result;\n }\n function modifiers(name, event, shift) {\n if (event.altKey)\n name = \"Alt-\" + name;\n if (event.ctrlKey)\n name = \"Ctrl-\" + name;\n if (event.metaKey)\n name = \"Meta-\" + name;\n if (shift !== false && event.shiftKey)\n name = \"Shift-\" + name;\n return name;\n }\n const handleKeyEvents = /*@__PURE__*/Prec.default(/*@__PURE__*/EditorView.domEventHandlers({\n keydown(event, view) {\n return runHandlers(getKeymap(view.state), event, view, \"editor\");\n }\n }));\n /**\n Facet used for registering keymaps.\n\n You can add multiple keymaps to an editor. Their priorities\n determine their precedence (the ones specified early or with high\n priority get checked first). When a handler has returned `true`\n for a given key, no further handlers are called.\n */\n const keymap = /*@__PURE__*/Facet.define({ enables: handleKeyEvents });\n const Keymaps = /*@__PURE__*/new WeakMap();\n // This is hidden behind an indirection, rather than directly computed\n // by the facet, to keep internal types out of the facet's type.\n function getKeymap(state) {\n let bindings = state.facet(keymap);\n let map = Keymaps.get(bindings);\n if (!map)\n Keymaps.set(bindings, map = buildKeymap(bindings.reduce((a, b) => a.concat(b), [])));\n return map;\n }\n /**\n Run the key handlers registered for a given scope. The event\n object should be a `\"keydown\"` event. Returns true if any of the\n handlers handled it.\n */\n function runScopeHandlers(view, event, scope) {\n return runHandlers(getKeymap(view.state), event, view, scope);\n }\n let storedPrefix = null;\n const PrefixTimeout = 4000;\n function buildKeymap(bindings, platform = currentPlatform) {\n let bound = Object.create(null);\n let isPrefix = Object.create(null);\n let checkPrefix = (name, is) => {\n let current = isPrefix[name];\n if (current == null)\n isPrefix[name] = is;\n else if (current != is)\n throw new Error(\"Key binding \" + name + \" is used both as a regular binding and as a multi-stroke prefix\");\n };\n let add = (scope, key, command, preventDefault, stopPropagation) => {\n var _a, _b;\n let scopeObj = bound[scope] || (bound[scope] = Object.create(null));\n let parts = key.split(/ (?!$)/).map(k => normalizeKeyName(k, platform));\n for (let i = 1; i < parts.length; i++) {\n let prefix = parts.slice(0, i).join(\" \");\n checkPrefix(prefix, true);\n if (!scopeObj[prefix])\n scopeObj[prefix] = {\n preventDefault: true,\n stopPropagation: false,\n run: [(view) => {\n let ourObj = storedPrefix = { view, prefix, scope };\n setTimeout(() => { if (storedPrefix == ourObj)\n storedPrefix = null; }, PrefixTimeout);\n return true;\n }]\n };\n }\n let full = parts.join(\" \");\n checkPrefix(full, false);\n let binding = scopeObj[full] || (scopeObj[full] = {\n preventDefault: false,\n stopPropagation: false,\n run: ((_b = (_a = scopeObj._any) === null || _a === void 0 ? void 0 : _a.run) === null || _b === void 0 ? void 0 : _b.slice()) || []\n });\n if (command)\n binding.run.push(command);\n if (preventDefault)\n binding.preventDefault = true;\n if (stopPropagation)\n binding.stopPropagation = true;\n };\n for (let b of bindings) {\n let scopes = b.scope ? b.scope.split(\" \") : [\"editor\"];\n if (b.any)\n for (let scope of scopes) {\n let scopeObj = bound[scope] || (bound[scope] = Object.create(null));\n if (!scopeObj._any)\n scopeObj._any = { preventDefault: false, stopPropagation: false, run: [] };\n let { any } = b;\n for (let key in scopeObj)\n scopeObj[key].run.push(view => any(view, currentKeyEvent));\n }\n let name = b[platform] || b.key;\n if (!name)\n continue;\n for (let scope of scopes) {\n add(scope, name, b.run, b.preventDefault, b.stopPropagation);\n if (b.shift)\n add(scope, \"Shift-\" + name, b.shift, b.preventDefault, b.stopPropagation);\n }\n }\n return bound;\n }\n let currentKeyEvent = null;\n function runHandlers(map, event, view, scope) {\n currentKeyEvent = event;\n let name = keyName(event);\n let charCode = codePointAt(name, 0), isChar = codePointSize(charCode) == name.length && name != \" \";\n let prefix = \"\", handled = false, prevented = false, stopPropagation = false;\n if (storedPrefix && storedPrefix.view == view && storedPrefix.scope == scope) {\n prefix = storedPrefix.prefix + \" \";\n if (modifierCodes.indexOf(event.keyCode) < 0) {\n prevented = true;\n storedPrefix = null;\n }\n }\n let ran = new Set;\n let runFor = (binding) => {\n if (binding) {\n for (let cmd of binding.run)\n if (!ran.has(cmd)) {\n ran.add(cmd);\n if (cmd(view)) {\n if (binding.stopPropagation)\n stopPropagation = true;\n return true;\n }\n }\n if (binding.preventDefault) {\n if (binding.stopPropagation)\n stopPropagation = true;\n prevented = true;\n }\n }\n return false;\n };\n let scopeObj = map[scope], baseName, shiftName;\n if (scopeObj) {\n if (runFor(scopeObj[prefix + modifiers(name, event, !isChar)])) {\n handled = true;\n }\n else if (isChar && (event.altKey || event.metaKey || event.ctrlKey) &&\n // Ctrl-Alt may be used for AltGr on Windows\n !(browser.windows && event.ctrlKey && event.altKey) &&\n (baseName = base[event.keyCode]) && baseName != name) {\n if (runFor(scopeObj[prefix + modifiers(baseName, event, true)])) {\n handled = true;\n }\n else if (event.shiftKey && (shiftName = shift[event.keyCode]) != name && shiftName != baseName &&\n runFor(scopeObj[prefix + modifiers(shiftName, event, false)])) {\n handled = true;\n }\n }\n else if (isChar && event.shiftKey &&\n runFor(scopeObj[prefix + modifiers(name, event, true)])) {\n handled = true;\n }\n if (!handled && runFor(scopeObj._any))\n handled = true;\n }\n if (prevented)\n handled = true;\n if (handled && stopPropagation)\n event.stopPropagation();\n currentKeyEvent = null;\n return handled;\n }\n\n /**\n Implementation of [`LayerMarker`](https://codemirror.net/6/docs/ref/#view.LayerMarker) that creates\n a rectangle at a given set of coordinates.\n */\n class RectangleMarker {\n /**\n Create a marker with the given class and dimensions. If `width`\n is null, the DOM element will get no width style.\n */\n constructor(className, \n /**\n The left position of the marker (in pixels, document-relative).\n */\n left, \n /**\n The top position of the marker.\n */\n top, \n /**\n The width of the marker, or null if it shouldn't get a width assigned.\n */\n width, \n /**\n The height of the marker.\n */\n height) {\n this.className = className;\n this.left = left;\n this.top = top;\n this.width = width;\n this.height = height;\n }\n draw() {\n let elt = document.createElement(\"div\");\n elt.className = this.className;\n this.adjust(elt);\n return elt;\n }\n update(elt, prev) {\n if (prev.className != this.className)\n return false;\n this.adjust(elt);\n return true;\n }\n adjust(elt) {\n elt.style.left = this.left + \"px\";\n elt.style.top = this.top + \"px\";\n if (this.width != null)\n elt.style.width = this.width + \"px\";\n elt.style.height = this.height + \"px\";\n }\n eq(p) {\n return this.left == p.left && this.top == p.top && this.width == p.width && this.height == p.height &&\n this.className == p.className;\n }\n /**\n Create a set of rectangles for the given selection range,\n assigning them theclass`className`. Will create a single\n rectangle for empty ranges, and a set of selection-style\n rectangles covering the range's content (in a bidi-aware\n way) for non-empty ones.\n */\n static forRange(view, className, range) {\n if (range.empty) {\n let pos = view.coordsAtPos(range.head, range.assoc || 1);\n if (!pos)\n return [];\n let base = getBase(view);\n return [new RectangleMarker(className, pos.left - base.left, pos.top - base.top, null, pos.bottom - pos.top)];\n }\n else {\n return rectanglesForRange(view, className, range);\n }\n }\n }\n function getBase(view) {\n let rect = view.scrollDOM.getBoundingClientRect();\n let left = view.textDirection == Direction.LTR ? rect.left : rect.right - view.scrollDOM.clientWidth * view.scaleX;\n return { left: left - view.scrollDOM.scrollLeft * view.scaleX, top: rect.top - view.scrollDOM.scrollTop * view.scaleY };\n }\n function wrappedLine(view, pos, side, inside) {\n let coords = view.coordsAtPos(pos, side * 2);\n if (!coords)\n return inside;\n let editorRect = view.dom.getBoundingClientRect();\n let y = (coords.top + coords.bottom) / 2;\n let left = view.posAtCoords({ x: editorRect.left + 1, y });\n let right = view.posAtCoords({ x: editorRect.right - 1, y });\n if (left == null || right == null)\n return inside;\n return { from: Math.max(inside.from, Math.min(left, right)), to: Math.min(inside.to, Math.max(left, right)) };\n }\n function rectanglesForRange(view, className, range) {\n if (range.to <= view.viewport.from || range.from >= view.viewport.to)\n return [];\n let from = Math.max(range.from, view.viewport.from), to = Math.min(range.to, view.viewport.to);\n let ltr = view.textDirection == Direction.LTR;\n let content = view.contentDOM, contentRect = content.getBoundingClientRect(), base = getBase(view);\n let lineElt = content.querySelector(\".cm-line\"), lineStyle = lineElt && window.getComputedStyle(lineElt);\n let leftSide = contentRect.left +\n (lineStyle ? parseInt(lineStyle.paddingLeft) + Math.min(0, parseInt(lineStyle.textIndent)) : 0);\n let rightSide = contentRect.right - (lineStyle ? parseInt(lineStyle.paddingRight) : 0);\n let startBlock = blockAt(view, from), endBlock = blockAt(view, to);\n let visualStart = startBlock.type == BlockType.Text ? startBlock : null;\n let visualEnd = endBlock.type == BlockType.Text ? endBlock : null;\n if (visualStart && (view.lineWrapping || startBlock.widgetLineBreaks))\n visualStart = wrappedLine(view, from, 1, visualStart);\n if (visualEnd && (view.lineWrapping || endBlock.widgetLineBreaks))\n visualEnd = wrappedLine(view, to, -1, visualEnd);\n if (visualStart && visualEnd && visualStart.from == visualEnd.from && visualStart.to == visualEnd.to) {\n return pieces(drawForLine(range.from, range.to, visualStart));\n }\n else {\n let top = visualStart ? drawForLine(range.from, null, visualStart) : drawForWidget(startBlock, false);\n let bottom = visualEnd ? drawForLine(null, range.to, visualEnd) : drawForWidget(endBlock, true);\n let between = [];\n if ((visualStart || startBlock).to < (visualEnd || endBlock).from - (visualStart && visualEnd ? 1 : 0) ||\n startBlock.widgetLineBreaks > 1 && top.bottom + view.defaultLineHeight / 2 < bottom.top)\n between.push(piece(leftSide, top.bottom, rightSide, bottom.top));\n else if (top.bottom < bottom.top && view.elementAtHeight((top.bottom + bottom.top) / 2).type == BlockType.Text)\n top.bottom = bottom.top = (top.bottom + bottom.top) / 2;\n return pieces(top).concat(between).concat(pieces(bottom));\n }\n function piece(left, top, right, bottom) {\n return new RectangleMarker(className, left - base.left, top - base.top - 0.01 /* C.Epsilon */, right - left, bottom - top + 0.01 /* C.Epsilon */);\n }\n function pieces({ top, bottom, horizontal }) {\n let pieces = [];\n for (let i = 0; i < horizontal.length; i += 2)\n pieces.push(piece(horizontal[i], top, horizontal[i + 1], bottom));\n return pieces;\n }\n // Gets passed from/to in line-local positions\n function drawForLine(from, to, line) {\n let top = 1e9, bottom = -1e9, horizontal = [];\n function addSpan(from, fromOpen, to, toOpen, dir) {\n // Passing 2/-2 is a kludge to force the view to return\n // coordinates on the proper side of block widgets, since\n // normalizing the side there, though appropriate for most\n // coordsAtPos queries, would break selection drawing.\n let fromCoords = view.coordsAtPos(from, (from == line.to ? -2 : 2));\n let toCoords = view.coordsAtPos(to, (to == line.from ? 2 : -2));\n if (!fromCoords || !toCoords)\n return;\n top = Math.min(fromCoords.top, toCoords.top, top);\n bottom = Math.max(fromCoords.bottom, toCoords.bottom, bottom);\n if (dir == Direction.LTR)\n horizontal.push(ltr && fromOpen ? leftSide : fromCoords.left, ltr && toOpen ? rightSide : toCoords.right);\n else\n horizontal.push(!ltr && toOpen ? leftSide : toCoords.left, !ltr && fromOpen ? rightSide : fromCoords.right);\n }\n let start = from !== null && from !== void 0 ? from : line.from, end = to !== null && to !== void 0 ? to : line.to;\n // Split the range by visible range and document line\n for (let r of view.visibleRanges)\n if (r.to > start && r.from < end) {\n for (let pos = Math.max(r.from, start), endPos = Math.min(r.to, end);;) {\n let docLine = view.state.doc.lineAt(pos);\n for (let span of view.bidiSpans(docLine)) {\n let spanFrom = span.from + docLine.from, spanTo = span.to + docLine.from;\n if (spanFrom >= endPos)\n break;\n if (spanTo > pos)\n addSpan(Math.max(spanFrom, pos), from == null && spanFrom <= start, Math.min(spanTo, endPos), to == null && spanTo >= end, span.dir);\n }\n pos = docLine.to + 1;\n if (pos >= endPos)\n break;\n }\n }\n if (horizontal.length == 0)\n addSpan(start, from == null, end, to == null, view.textDirection);\n return { top, bottom, horizontal };\n }\n function drawForWidget(block, top) {\n let y = contentRect.top + (top ? block.top : block.bottom);\n return { top: y, bottom: y, horizontal: [] };\n }\n }\n function sameMarker(a, b) {\n return a.constructor == b.constructor && a.eq(b);\n }\n class LayerView {\n constructor(view, layer) {\n this.view = view;\n this.layer = layer;\n this.drawn = [];\n this.scaleX = 1;\n this.scaleY = 1;\n this.measureReq = { read: this.measure.bind(this), write: this.draw.bind(this) };\n this.dom = view.scrollDOM.appendChild(document.createElement(\"div\"));\n this.dom.classList.add(\"cm-layer\");\n if (layer.above)\n this.dom.classList.add(\"cm-layer-above\");\n if (layer.class)\n this.dom.classList.add(layer.class);\n this.scale();\n this.dom.setAttribute(\"aria-hidden\", \"true\");\n this.setOrder(view.state);\n view.requestMeasure(this.measureReq);\n if (layer.mount)\n layer.mount(this.dom, view);\n }\n update(update) {\n if (update.startState.facet(layerOrder) != update.state.facet(layerOrder))\n this.setOrder(update.state);\n if (this.layer.update(update, this.dom) || update.geometryChanged) {\n this.scale();\n update.view.requestMeasure(this.measureReq);\n }\n }\n docViewUpdate(view) {\n if (this.layer.updateOnDocViewUpdate !== false)\n view.requestMeasure(this.measureReq);\n }\n setOrder(state) {\n let pos = 0, order = state.facet(layerOrder);\n while (pos < order.length && order[pos] != this.layer)\n pos++;\n this.dom.style.zIndex = String((this.layer.above ? 150 : -1) - pos);\n }\n measure() {\n return this.layer.markers(this.view);\n }\n scale() {\n let { scaleX, scaleY } = this.view;\n if (scaleX != this.scaleX || scaleY != this.scaleY) {\n this.scaleX = scaleX;\n this.scaleY = scaleY;\n this.dom.style.transform = `scale(${1 / scaleX}, ${1 / scaleY})`;\n }\n }\n draw(markers) {\n if (markers.length != this.drawn.length || markers.some((p, i) => !sameMarker(p, this.drawn[i]))) {\n let old = this.dom.firstChild, oldI = 0;\n for (let marker of markers) {\n if (marker.update && old && marker.constructor && this.drawn[oldI].constructor &&\n marker.update(old, this.drawn[oldI])) {\n old = old.nextSibling;\n oldI++;\n }\n else {\n this.dom.insertBefore(marker.draw(), old);\n }\n }\n while (old) {\n let next = old.nextSibling;\n old.remove();\n old = next;\n }\n this.drawn = markers;\n }\n }\n destroy() {\n if (this.layer.destroy)\n this.layer.destroy(this.dom, this.view);\n this.dom.remove();\n }\n }\n const layerOrder = /*@__PURE__*/Facet.define();\n /**\n Define a layer.\n */\n function layer(config) {\n return [\n ViewPlugin.define(v => new LayerView(v, config)),\n layerOrder.of(config)\n ];\n }\n\n const CanHidePrimary = !browser.ios; // FIXME test IE\n const selectionConfig = /*@__PURE__*/Facet.define({\n combine(configs) {\n return combineConfig(configs, {\n cursorBlinkRate: 1200,\n drawRangeCursor: true\n }, {\n cursorBlinkRate: (a, b) => Math.min(a, b),\n drawRangeCursor: (a, b) => a || b\n });\n }\n });\n /**\n Returns an extension that hides the browser's native selection and\n cursor, replacing the selection with a background behind the text\n (with the `cm-selectionBackground` class), and the\n cursors with elements overlaid over the code (using\n `cm-cursor-primary` and `cm-cursor-secondary`).\n\n This allows the editor to display secondary selection ranges, and\n tends to produce a type of selection more in line with that users\n expect in a text editor (the native selection styling will often\n leave gaps between lines and won't fill the horizontal space after\n a line when the selection continues past it).\n\n It does have a performance cost, in that it requires an extra DOM\n layout cycle for many updates (the selection is drawn based on DOM\n layout information that's only available after laying out the\n content).\n */\n function drawSelection(config = {}) {\n return [\n selectionConfig.of(config),\n cursorLayer,\n selectionLayer,\n hideNativeSelection,\n nativeSelectionHidden.of(true)\n ];\n }\n function configChanged(update) {\n return update.startState.facet(selectionConfig) != update.state.facet(selectionConfig);\n }\n const cursorLayer = /*@__PURE__*/layer({\n above: true,\n markers(view) {\n let { state } = view, conf = state.facet(selectionConfig);\n let cursors = [];\n for (let r of state.selection.ranges) {\n let prim = r == state.selection.main;\n if (r.empty ? !prim || CanHidePrimary : conf.drawRangeCursor) {\n let className = prim ? \"cm-cursor cm-cursor-primary\" : \"cm-cursor cm-cursor-secondary\";\n let cursor = r.empty ? r : EditorSelection.cursor(r.head, r.head > r.anchor ? -1 : 1);\n for (let piece of RectangleMarker.forRange(view, className, cursor))\n cursors.push(piece);\n }\n }\n return cursors;\n },\n update(update, dom) {\n if (update.transactions.some(tr => tr.selection))\n dom.style.animationName = dom.style.animationName == \"cm-blink\" ? \"cm-blink2\" : \"cm-blink\";\n let confChange = configChanged(update);\n if (confChange)\n setBlinkRate(update.state, dom);\n return update.docChanged || update.selectionSet || confChange;\n },\n mount(dom, view) {\n setBlinkRate(view.state, dom);\n },\n class: \"cm-cursorLayer\"\n });\n function setBlinkRate(state, dom) {\n dom.style.animationDuration = state.facet(selectionConfig).cursorBlinkRate + \"ms\";\n }\n const selectionLayer = /*@__PURE__*/layer({\n above: false,\n markers(view) {\n return view.state.selection.ranges.map(r => r.empty ? [] : RectangleMarker.forRange(view, \"cm-selectionBackground\", r))\n .reduce((a, b) => a.concat(b));\n },\n update(update, dom) {\n return update.docChanged || update.selectionSet || update.viewportChanged || configChanged(update);\n },\n class: \"cm-selectionLayer\"\n });\n const themeSpec = {\n \".cm-line\": {\n \"& ::selection, &::selection\": { backgroundColor: \"transparent !important\" },\n },\n \".cm-content\": {\n \"& :focus\": {\n caretColor: \"initial !important\",\n \"&::selection, & ::selection\": {\n backgroundColor: \"Highlight !important\"\n }\n }\n }\n };\n if (CanHidePrimary)\n themeSpec[\".cm-line\"].caretColor = themeSpec[\".cm-content\"].caretColor = \"transparent !important\";\n const hideNativeSelection = /*@__PURE__*/Prec.highest(/*@__PURE__*/EditorView.theme(themeSpec));\n\n const setDropCursorPos = /*@__PURE__*/StateEffect.define({\n map(pos, mapping) { return pos == null ? null : mapping.mapPos(pos); }\n });\n const dropCursorPos = /*@__PURE__*/StateField.define({\n create() { return null; },\n update(pos, tr) {\n if (pos != null)\n pos = tr.changes.mapPos(pos);\n return tr.effects.reduce((pos, e) => e.is(setDropCursorPos) ? e.value : pos, pos);\n }\n });\n const drawDropCursor = /*@__PURE__*/ViewPlugin.fromClass(class {\n constructor(view) {\n this.view = view;\n this.cursor = null;\n this.measureReq = { read: this.readPos.bind(this), write: this.drawCursor.bind(this) };\n }\n update(update) {\n var _a;\n let cursorPos = update.state.field(dropCursorPos);\n if (cursorPos == null) {\n if (this.cursor != null) {\n (_a = this.cursor) === null || _a === void 0 ? void 0 : _a.remove();\n this.cursor = null;\n }\n }\n else {\n if (!this.cursor) {\n this.cursor = this.view.scrollDOM.appendChild(document.createElement(\"div\"));\n this.cursor.className = \"cm-dropCursor\";\n }\n if (update.startState.field(dropCursorPos) != cursorPos || update.docChanged || update.geometryChanged)\n this.view.requestMeasure(this.measureReq);\n }\n }\n readPos() {\n let { view } = this;\n let pos = view.state.field(dropCursorPos);\n let rect = pos != null && view.coordsAtPos(pos);\n if (!rect)\n return null;\n let outer = view.scrollDOM.getBoundingClientRect();\n return {\n left: rect.left - outer.left + view.scrollDOM.scrollLeft * view.scaleX,\n top: rect.top - outer.top + view.scrollDOM.scrollTop * view.scaleY,\n height: rect.bottom - rect.top\n };\n }\n drawCursor(pos) {\n if (this.cursor) {\n let { scaleX, scaleY } = this.view;\n if (pos) {\n this.cursor.style.left = pos.left / scaleX + \"px\";\n this.cursor.style.top = pos.top / scaleY + \"px\";\n this.cursor.style.height = pos.height / scaleY + \"px\";\n }\n else {\n this.cursor.style.left = \"-100000px\";\n }\n }\n }\n destroy() {\n if (this.cursor)\n this.cursor.remove();\n }\n setDropPos(pos) {\n if (this.view.state.field(dropCursorPos) != pos)\n this.view.dispatch({ effects: setDropCursorPos.of(pos) });\n }\n }, {\n eventObservers: {\n dragover(event) {\n this.setDropPos(this.view.posAtCoords({ x: event.clientX, y: event.clientY }));\n },\n dragleave(event) {\n if (event.target == this.view.contentDOM || !this.view.contentDOM.contains(event.relatedTarget))\n this.setDropPos(null);\n },\n dragend() {\n this.setDropPos(null);\n },\n drop() {\n this.setDropPos(null);\n }\n }\n });\n /**\n Draws a cursor at the current drop position when something is\n dragged over the editor.\n */\n function dropCursor() {\n return [dropCursorPos, drawDropCursor];\n }\n\n function iterMatches(doc, re, from, to, f) {\n re.lastIndex = 0;\n for (let cursor = doc.iterRange(from, to), pos = from, m; !cursor.next().done; pos += cursor.value.length) {\n if (!cursor.lineBreak)\n while (m = re.exec(cursor.value))\n f(pos + m.index, m);\n }\n }\n function matchRanges(view, maxLength) {\n let visible = view.visibleRanges;\n if (visible.length == 1 && visible[0].from == view.viewport.from &&\n visible[0].to == view.viewport.to)\n return visible;\n let result = [];\n for (let { from, to } of visible) {\n from = Math.max(view.state.doc.lineAt(from).from, from - maxLength);\n to = Math.min(view.state.doc.lineAt(to).to, to + maxLength);\n if (result.length && result[result.length - 1].to >= from)\n result[result.length - 1].to = to;\n else\n result.push({ from, to });\n }\n return result;\n }\n /**\n Helper class used to make it easier to maintain decorations on\n visible code that matches a given regular expression. To be used\n in a [view plugin](https://codemirror.net/6/docs/ref/#view.ViewPlugin). Instances of this object\n represent a matching configuration.\n */\n class MatchDecorator {\n /**\n Create a decorator.\n */\n constructor(config) {\n const { regexp, decoration, decorate, boundary, maxLength = 1000 } = config;\n if (!regexp.global)\n throw new RangeError(\"The regular expression given to MatchDecorator should have its 'g' flag set\");\n this.regexp = regexp;\n if (decorate) {\n this.addMatch = (match, view, from, add) => decorate(add, from, from + match[0].length, match, view);\n }\n else if (typeof decoration == \"function\") {\n this.addMatch = (match, view, from, add) => {\n let deco = decoration(match, view, from);\n if (deco)\n add(from, from + match[0].length, deco);\n };\n }\n else if (decoration) {\n this.addMatch = (match, _view, from, add) => add(from, from + match[0].length, decoration);\n }\n else {\n throw new RangeError(\"Either 'decorate' or 'decoration' should be provided to MatchDecorator\");\n }\n this.boundary = boundary;\n this.maxLength = maxLength;\n }\n /**\n Compute the full set of decorations for matches in the given\n view's viewport. You'll want to call this when initializing your\n plugin.\n */\n createDeco(view) {\n let build = new RangeSetBuilder(), add = build.add.bind(build);\n for (let { from, to } of matchRanges(view, this.maxLength))\n iterMatches(view.state.doc, this.regexp, from, to, (from, m) => this.addMatch(m, view, from, add));\n return build.finish();\n }\n /**\n Update a set of decorations for a view update. `deco` _must_ be\n the set of decorations produced by _this_ `MatchDecorator` for\n the view state before the update.\n */\n updateDeco(update, deco) {\n let changeFrom = 1e9, changeTo = -1;\n if (update.docChanged)\n update.changes.iterChanges((_f, _t, from, to) => {\n if (to > update.view.viewport.from && from < update.view.viewport.to) {\n changeFrom = Math.min(from, changeFrom);\n changeTo = Math.max(to, changeTo);\n }\n });\n if (update.viewportChanged || changeTo - changeFrom > 1000)\n return this.createDeco(update.view);\n if (changeTo > -1)\n return this.updateRange(update.view, deco.map(update.changes), changeFrom, changeTo);\n return deco;\n }\n updateRange(view, deco, updateFrom, updateTo) {\n for (let r of view.visibleRanges) {\n let from = Math.max(r.from, updateFrom), to = Math.min(r.to, updateTo);\n if (to > from) {\n let fromLine = view.state.doc.lineAt(from), toLine = fromLine.to < to ? view.state.doc.lineAt(to) : fromLine;\n let start = Math.max(r.from, fromLine.from), end = Math.min(r.to, toLine.to);\n if (this.boundary) {\n for (; from > fromLine.from; from--)\n if (this.boundary.test(fromLine.text[from - 1 - fromLine.from])) {\n start = from;\n break;\n }\n for (; to < toLine.to; to++)\n if (this.boundary.test(toLine.text[to - toLine.from])) {\n end = to;\n break;\n }\n }\n let ranges = [], m;\n let add = (from, to, deco) => ranges.push(deco.range(from, to));\n if (fromLine == toLine) {\n this.regexp.lastIndex = start - fromLine.from;\n while ((m = this.regexp.exec(fromLine.text)) && m.index < end - fromLine.from)\n this.addMatch(m, view, m.index + fromLine.from, add);\n }\n else {\n iterMatches(view.state.doc, this.regexp, start, end, (from, m) => this.addMatch(m, view, from, add));\n }\n deco = deco.update({ filterFrom: start, filterTo: end, filter: (from, to) => from < start || to > end, add: ranges });\n }\n }\n return deco;\n }\n }\n\n const UnicodeRegexpSupport = /x/.unicode != null ? \"gu\" : \"g\";\n const Specials = /*@__PURE__*/new RegExp(\"[\\u0000-\\u0008\\u000a-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b\\u200e\\u200f\\u2028\\u2029\\u202d\\u202e\\u2066\\u2067\\u2069\\ufeff\\ufff9-\\ufffc]\", UnicodeRegexpSupport);\n const Names = {\n 0: \"null\",\n 7: \"bell\",\n 8: \"backspace\",\n 10: \"newline\",\n 11: \"vertical tab\",\n 13: \"carriage return\",\n 27: \"escape\",\n 8203: \"zero width space\",\n 8204: \"zero width non-joiner\",\n 8205: \"zero width joiner\",\n 8206: \"left-to-right mark\",\n 8207: \"right-to-left mark\",\n 8232: \"line separator\",\n 8237: \"left-to-right override\",\n 8238: \"right-to-left override\",\n 8294: \"left-to-right isolate\",\n 8295: \"right-to-left isolate\",\n 8297: \"pop directional isolate\",\n 8233: \"paragraph separator\",\n 65279: \"zero width no-break space\",\n 65532: \"object replacement\"\n };\n let _supportsTabSize = null;\n function supportsTabSize() {\n var _a;\n if (_supportsTabSize == null && typeof document != \"undefined\" && document.body) {\n let styles = document.body.style;\n _supportsTabSize = ((_a = styles.tabSize) !== null && _a !== void 0 ? _a : styles.MozTabSize) != null;\n }\n return _supportsTabSize || false;\n }\n const specialCharConfig = /*@__PURE__*/Facet.define({\n combine(configs) {\n let config = combineConfig(configs, {\n render: null,\n specialChars: Specials,\n addSpecialChars: null\n });\n if (config.replaceTabs = !supportsTabSize())\n config.specialChars = new RegExp(\"\\t|\" + config.specialChars.source, UnicodeRegexpSupport);\n if (config.addSpecialChars)\n config.specialChars = new RegExp(config.specialChars.source + \"|\" + config.addSpecialChars.source, UnicodeRegexpSupport);\n return config;\n }\n });\n /**\n Returns an extension that installs highlighting of special\n characters.\n */\n function highlightSpecialChars(\n /**\n Configuration options.\n */\n config = {}) {\n return [specialCharConfig.of(config), specialCharPlugin()];\n }\n let _plugin = null;\n function specialCharPlugin() {\n return _plugin || (_plugin = ViewPlugin.fromClass(class {\n constructor(view) {\n this.view = view;\n this.decorations = Decoration.none;\n this.decorationCache = Object.create(null);\n this.decorator = this.makeDecorator(view.state.facet(specialCharConfig));\n this.decorations = this.decorator.createDeco(view);\n }\n makeDecorator(conf) {\n return new MatchDecorator({\n regexp: conf.specialChars,\n decoration: (m, view, pos) => {\n let { doc } = view.state;\n let code = codePointAt(m[0], 0);\n if (code == 9) {\n let line = doc.lineAt(pos);\n let size = view.state.tabSize, col = countColumn(line.text, size, pos - line.from);\n return Decoration.replace({\n widget: new TabWidget((size - (col % size)) * this.view.defaultCharacterWidth / this.view.scaleX)\n });\n }\n return this.decorationCache[code] ||\n (this.decorationCache[code] = Decoration.replace({ widget: new SpecialCharWidget(conf, code) }));\n },\n boundary: conf.replaceTabs ? undefined : /[^]/\n });\n }\n update(update) {\n let conf = update.state.facet(specialCharConfig);\n if (update.startState.facet(specialCharConfig) != conf) {\n this.decorator = this.makeDecorator(conf);\n this.decorations = this.decorator.createDeco(update.view);\n }\n else {\n this.decorations = this.decorator.updateDeco(update, this.decorations);\n }\n }\n }, {\n decorations: v => v.decorations\n }));\n }\n const DefaultPlaceholder = \"\\u2022\";\n // Assigns placeholder characters from the Control Pictures block to\n // ASCII control characters\n function placeholder$1(code) {\n if (code >= 32)\n return DefaultPlaceholder;\n if (code == 10)\n return \"\\u2424\";\n return String.fromCharCode(9216 + code);\n }\n class SpecialCharWidget extends WidgetType {\n constructor(options, code) {\n super();\n this.options = options;\n this.code = code;\n }\n eq(other) { return other.code == this.code; }\n toDOM(view) {\n let ph = placeholder$1(this.code);\n let desc = view.state.phrase(\"Control character\") + \" \" + (Names[this.code] || \"0x\" + this.code.toString(16));\n let custom = this.options.render && this.options.render(this.code, desc, ph);\n if (custom)\n return custom;\n let span = document.createElement(\"span\");\n span.textContent = ph;\n span.title = desc;\n span.setAttribute(\"aria-label\", desc);\n span.className = \"cm-specialChar\";\n return span;\n }\n ignoreEvent() { return false; }\n }\n class TabWidget extends WidgetType {\n constructor(width) {\n super();\n this.width = width;\n }\n eq(other) { return other.width == this.width; }\n toDOM() {\n let span = document.createElement(\"span\");\n span.textContent = \"\\t\";\n span.className = \"cm-tab\";\n span.style.width = this.width + \"px\";\n return span;\n }\n ignoreEvent() { return false; }\n }\n\n /**\n Mark lines that have a cursor on them with the `\"cm-activeLine\"`\n DOM class.\n */\n function highlightActiveLine() {\n return activeLineHighlighter;\n }\n const lineDeco = /*@__PURE__*/Decoration.line({ class: \"cm-activeLine\" });\n const activeLineHighlighter = /*@__PURE__*/ViewPlugin.fromClass(class {\n constructor(view) {\n this.decorations = this.getDeco(view);\n }\n update(update) {\n if (update.docChanged || update.selectionSet)\n this.decorations = this.getDeco(update.view);\n }\n getDeco(view) {\n let lastLineStart = -1, deco = [];\n for (let r of view.state.selection.ranges) {\n let line = view.lineBlockAt(r.head);\n if (line.from > lastLineStart) {\n deco.push(lineDeco.range(line.from));\n lastLineStart = line.from;\n }\n }\n return Decoration.set(deco);\n }\n }, {\n decorations: v => v.decorations\n });\n\n // Don't compute precise column positions for line offsets above this\n // (since it could get expensive). Assume offset==column for them.\n const MaxOff = 2000;\n function rectangleFor(state, a, b) {\n let startLine = Math.min(a.line, b.line), endLine = Math.max(a.line, b.line);\n let ranges = [];\n if (a.off > MaxOff || b.off > MaxOff || a.col < 0 || b.col < 0) {\n let startOff = Math.min(a.off, b.off), endOff = Math.max(a.off, b.off);\n for (let i = startLine; i <= endLine; i++) {\n let line = state.doc.line(i);\n if (line.length <= endOff)\n ranges.push(EditorSelection.range(line.from + startOff, line.to + endOff));\n }\n }\n else {\n let startCol = Math.min(a.col, b.col), endCol = Math.max(a.col, b.col);\n for (let i = startLine; i <= endLine; i++) {\n let line = state.doc.line(i);\n let start = findColumn(line.text, startCol, state.tabSize, true);\n if (start < 0) {\n ranges.push(EditorSelection.cursor(line.to));\n }\n else {\n let end = findColumn(line.text, endCol, state.tabSize);\n ranges.push(EditorSelection.range(line.from + start, line.from + end));\n }\n }\n }\n return ranges;\n }\n function absoluteColumn(view, x) {\n let ref = view.coordsAtPos(view.viewport.from);\n return ref ? Math.round(Math.abs((ref.left - x) / view.defaultCharacterWidth)) : -1;\n }\n function getPos(view, event) {\n let offset = view.posAtCoords({ x: event.clientX, y: event.clientY }, false);\n let line = view.state.doc.lineAt(offset), off = offset - line.from;\n let col = off > MaxOff ? -1\n : off == line.length ? absoluteColumn(view, event.clientX)\n : countColumn(line.text, view.state.tabSize, offset - line.from);\n return { line: line.number, col, off };\n }\n function rectangleSelectionStyle(view, event) {\n let start = getPos(view, event), startSel = view.state.selection;\n if (!start)\n return null;\n return {\n update(update) {\n if (update.docChanged) {\n let newStart = update.changes.mapPos(update.startState.doc.line(start.line).from);\n let newLine = update.state.doc.lineAt(newStart);\n start = { line: newLine.number, col: start.col, off: Math.min(start.off, newLine.length) };\n startSel = startSel.map(update.changes);\n }\n },\n get(event, _extend, multiple) {\n let cur = getPos(view, event);\n if (!cur)\n return startSel;\n let ranges = rectangleFor(view.state, start, cur);\n if (!ranges.length)\n return startSel;\n if (multiple)\n return EditorSelection.create(ranges.concat(startSel.ranges));\n else\n return EditorSelection.create(ranges);\n }\n };\n }\n /**\n Create an extension that enables rectangular selections. By\n default, it will react to left mouse drag with the Alt key held\n down. When such a selection occurs, the text within the rectangle\n that was dragged over will be selected, as one selection\n [range](https://codemirror.net/6/docs/ref/#state.SelectionRange) per line.\n */\n function rectangularSelection(options) {\n let filter = (options === null || options === void 0 ? void 0 : options.eventFilter) || (e => e.altKey && e.button == 0);\n return EditorView.mouseSelectionStyle.of((view, event) => filter(event) ? rectangleSelectionStyle(view, event) : null);\n }\n const keys = {\n Alt: [18, e => !!e.altKey],\n Control: [17, e => !!e.ctrlKey],\n Shift: [16, e => !!e.shiftKey],\n Meta: [91, e => !!e.metaKey]\n };\n const showCrosshair = { style: \"cursor: crosshair\" };\n /**\n Returns an extension that turns the pointer cursor into a\n crosshair when a given modifier key, defaulting to Alt, is held\n down. Can serve as a visual hint that rectangular selection is\n going to happen when paired with\n [`rectangularSelection`](https://codemirror.net/6/docs/ref/#view.rectangularSelection).\n */\n function crosshairCursor(options = {}) {\n let [code, getter] = keys[options.key || \"Alt\"];\n let plugin = ViewPlugin.fromClass(class {\n constructor(view) {\n this.view = view;\n this.isDown = false;\n }\n set(isDown) {\n if (this.isDown != isDown) {\n this.isDown = isDown;\n this.view.update([]);\n }\n }\n }, {\n eventObservers: {\n keydown(e) {\n this.set(e.keyCode == code || getter(e));\n },\n keyup(e) {\n if (e.keyCode == code || !getter(e))\n this.set(false);\n },\n mousemove(e) {\n this.set(getter(e));\n }\n }\n });\n return [\n plugin,\n EditorView.contentAttributes.of(view => { var _a; return ((_a = view.plugin(plugin)) === null || _a === void 0 ? void 0 : _a.isDown) ? showCrosshair : null; })\n ];\n }\n\n const Outside = \"-10000px\";\n class TooltipViewManager {\n constructor(view, facet, createTooltipView, removeTooltipView) {\n this.facet = facet;\n this.createTooltipView = createTooltipView;\n this.removeTooltipView = removeTooltipView;\n this.input = view.state.facet(facet);\n this.tooltips = this.input.filter(t => t);\n let prev = null;\n this.tooltipViews = this.tooltips.map(t => prev = createTooltipView(t, prev));\n }\n update(update, above) {\n var _a;\n let input = update.state.facet(this.facet);\n let tooltips = input.filter(x => x);\n if (input === this.input) {\n for (let t of this.tooltipViews)\n if (t.update)\n t.update(update);\n return false;\n }\n let tooltipViews = [], newAbove = above ? [] : null;\n for (let i = 0; i < tooltips.length; i++) {\n let tip = tooltips[i], known = -1;\n if (!tip)\n continue;\n for (let i = 0; i < this.tooltips.length; i++) {\n let other = this.tooltips[i];\n if (other && other.create == tip.create)\n known = i;\n }\n if (known < 0) {\n tooltipViews[i] = this.createTooltipView(tip, i ? tooltipViews[i - 1] : null);\n if (newAbove)\n newAbove[i] = !!tip.above;\n }\n else {\n let tooltipView = tooltipViews[i] = this.tooltipViews[known];\n if (newAbove)\n newAbove[i] = above[known];\n if (tooltipView.update)\n tooltipView.update(update);\n }\n }\n for (let t of this.tooltipViews)\n if (tooltipViews.indexOf(t) < 0) {\n this.removeTooltipView(t);\n (_a = t.destroy) === null || _a === void 0 ? void 0 : _a.call(t);\n }\n if (above) {\n newAbove.forEach((val, i) => above[i] = val);\n above.length = newAbove.length;\n }\n this.input = input;\n this.tooltips = tooltips;\n this.tooltipViews = tooltipViews;\n return true;\n }\n }\n function windowSpace(view) {\n let { win } = view;\n return { top: 0, left: 0, bottom: win.innerHeight, right: win.innerWidth };\n }\n const tooltipConfig = /*@__PURE__*/Facet.define({\n combine: values => {\n var _a, _b, _c;\n return ({\n position: browser.ios ? \"absolute\" : ((_a = values.find(conf => conf.position)) === null || _a === void 0 ? void 0 : _a.position) || \"fixed\",\n parent: ((_b = values.find(conf => conf.parent)) === null || _b === void 0 ? void 0 : _b.parent) || null,\n tooltipSpace: ((_c = values.find(conf => conf.tooltipSpace)) === null || _c === void 0 ? void 0 : _c.tooltipSpace) || windowSpace,\n });\n }\n });\n const knownHeight = /*@__PURE__*/new WeakMap();\n const tooltipPlugin = /*@__PURE__*/ViewPlugin.fromClass(class {\n constructor(view) {\n this.view = view;\n this.above = [];\n this.inView = true;\n this.madeAbsolute = false;\n this.lastTransaction = 0;\n this.measureTimeout = -1;\n let config = view.state.facet(tooltipConfig);\n this.position = config.position;\n this.parent = config.parent;\n this.classes = view.themeClasses;\n this.createContainer();\n this.measureReq = { read: this.readMeasure.bind(this), write: this.writeMeasure.bind(this), key: this };\n this.resizeObserver = typeof ResizeObserver == \"function\" ? new ResizeObserver(() => this.measureSoon()) : null;\n this.manager = new TooltipViewManager(view, showTooltip, (t, p) => this.createTooltip(t, p), t => {\n if (this.resizeObserver)\n this.resizeObserver.unobserve(t.dom);\n t.dom.remove();\n });\n this.above = this.manager.tooltips.map(t => !!t.above);\n this.intersectionObserver = typeof IntersectionObserver == \"function\" ? new IntersectionObserver(entries => {\n if (Date.now() > this.lastTransaction - 50 &&\n entries.length > 0 && entries[entries.length - 1].intersectionRatio < 1)\n this.measureSoon();\n }, { threshold: [1] }) : null;\n this.observeIntersection();\n view.win.addEventListener(\"resize\", this.measureSoon = this.measureSoon.bind(this));\n this.maybeMeasure();\n }\n createContainer() {\n if (this.parent) {\n this.container = document.createElement(\"div\");\n this.container.style.position = \"relative\";\n this.container.className = this.view.themeClasses;\n this.parent.appendChild(this.container);\n }\n else {\n this.container = this.view.dom;\n }\n }\n observeIntersection() {\n if (this.intersectionObserver) {\n this.intersectionObserver.disconnect();\n for (let tooltip of this.manager.tooltipViews)\n this.intersectionObserver.observe(tooltip.dom);\n }\n }\n measureSoon() {\n if (this.measureTimeout < 0)\n this.measureTimeout = setTimeout(() => {\n this.measureTimeout = -1;\n this.maybeMeasure();\n }, 50);\n }\n update(update) {\n if (update.transactions.length)\n this.lastTransaction = Date.now();\n let updated = this.manager.update(update, this.above);\n if (updated)\n this.observeIntersection();\n let shouldMeasure = updated || update.geometryChanged;\n let newConfig = update.state.facet(tooltipConfig);\n if (newConfig.position != this.position && !this.madeAbsolute) {\n this.position = newConfig.position;\n for (let t of this.manager.tooltipViews)\n t.dom.style.position = this.position;\n shouldMeasure = true;\n }\n if (newConfig.parent != this.parent) {\n if (this.parent)\n this.container.remove();\n this.parent = newConfig.parent;\n this.createContainer();\n for (let t of this.manager.tooltipViews)\n this.container.appendChild(t.dom);\n shouldMeasure = true;\n }\n else if (this.parent && this.view.themeClasses != this.classes) {\n this.classes = this.container.className = this.view.themeClasses;\n }\n if (shouldMeasure)\n this.maybeMeasure();\n }\n createTooltip(tooltip, prev) {\n let tooltipView = tooltip.create(this.view);\n let before = prev ? prev.dom : null;\n tooltipView.dom.classList.add(\"cm-tooltip\");\n if (tooltip.arrow && !tooltipView.dom.querySelector(\".cm-tooltip > .cm-tooltip-arrow\")) {\n let arrow = document.createElement(\"div\");\n arrow.className = \"cm-tooltip-arrow\";\n tooltipView.dom.appendChild(arrow);\n }\n tooltipView.dom.style.position = this.position;\n tooltipView.dom.style.top = Outside;\n tooltipView.dom.style.left = \"0px\";\n this.container.insertBefore(tooltipView.dom, before);\n if (tooltipView.mount)\n tooltipView.mount(this.view);\n if (this.resizeObserver)\n this.resizeObserver.observe(tooltipView.dom);\n return tooltipView;\n }\n destroy() {\n var _a, _b, _c;\n this.view.win.removeEventListener(\"resize\", this.measureSoon);\n for (let tooltipView of this.manager.tooltipViews) {\n tooltipView.dom.remove();\n (_a = tooltipView.destroy) === null || _a === void 0 ? void 0 : _a.call(tooltipView);\n }\n if (this.parent)\n this.container.remove();\n (_b = this.resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();\n (_c = this.intersectionObserver) === null || _c === void 0 ? void 0 : _c.disconnect();\n clearTimeout(this.measureTimeout);\n }\n readMeasure() {\n let editor = this.view.dom.getBoundingClientRect();\n let scaleX = 1, scaleY = 1, makeAbsolute = false;\n if (this.position == \"fixed\" && this.manager.tooltipViews.length) {\n let { dom } = this.manager.tooltipViews[0];\n if (browser.gecko) {\n // Firefox sets the element's `offsetParent` to the\n // transformed element when a transform interferes with fixed\n // positioning.\n makeAbsolute = dom.offsetParent != this.container.ownerDocument.body;\n }\n else if (dom.style.top == Outside && dom.style.left == \"0px\") {\n // On other browsers, we have to awkwardly try and use other\n // information to detect a transform.\n let rect = dom.getBoundingClientRect();\n makeAbsolute = Math.abs(rect.top + 10000) > 1 || Math.abs(rect.left) > 1;\n }\n }\n if (makeAbsolute || this.position == \"absolute\") {\n if (this.parent) {\n let rect = this.parent.getBoundingClientRect();\n if (rect.width && rect.height) {\n scaleX = rect.width / this.parent.offsetWidth;\n scaleY = rect.height / this.parent.offsetHeight;\n }\n }\n else {\n ({ scaleX, scaleY } = this.view.viewState);\n }\n }\n return {\n editor,\n parent: this.parent ? this.container.getBoundingClientRect() : editor,\n pos: this.manager.tooltips.map((t, i) => {\n let tv = this.manager.tooltipViews[i];\n return tv.getCoords ? tv.getCoords(t.pos) : this.view.coordsAtPos(t.pos);\n }),\n size: this.manager.tooltipViews.map(({ dom }) => dom.getBoundingClientRect()),\n space: this.view.state.facet(tooltipConfig).tooltipSpace(this.view),\n scaleX, scaleY, makeAbsolute\n };\n }\n writeMeasure(measured) {\n var _a;\n if (measured.makeAbsolute) {\n this.madeAbsolute = true;\n this.position = \"absolute\";\n for (let t of this.manager.tooltipViews)\n t.dom.style.position = \"absolute\";\n }\n let { editor, space, scaleX, scaleY } = measured;\n let others = [];\n for (let i = 0; i < this.manager.tooltips.length; i++) {\n let tooltip = this.manager.tooltips[i], tView = this.manager.tooltipViews[i], { dom } = tView;\n let pos = measured.pos[i], size = measured.size[i];\n // Hide tooltips that are outside of the editor.\n if (!pos || pos.bottom <= Math.max(editor.top, space.top) ||\n pos.top >= Math.min(editor.bottom, space.bottom) ||\n pos.right < Math.max(editor.left, space.left) - .1 ||\n pos.left > Math.min(editor.right, space.right) + .1) {\n dom.style.top = Outside;\n continue;\n }\n let arrow = tooltip.arrow ? tView.dom.querySelector(\".cm-tooltip-arrow\") : null;\n let arrowHeight = arrow ? 7 /* Arrow.Size */ : 0;\n let width = size.right - size.left, height = (_a = knownHeight.get(tView)) !== null && _a !== void 0 ? _a : size.bottom - size.top;\n let offset = tView.offset || noOffset, ltr = this.view.textDirection == Direction.LTR;\n let left = size.width > space.right - space.left\n ? (ltr ? space.left : space.right - size.width)\n : ltr ? Math.max(space.left, Math.min(pos.left - (arrow ? 14 /* Arrow.Offset */ : 0) + offset.x, space.right - width))\n : Math.min(Math.max(space.left, pos.left - width + (arrow ? 14 /* Arrow.Offset */ : 0) - offset.x), space.right - width);\n let above = this.above[i];\n if (!tooltip.strictSide && (above\n ? pos.top - (size.bottom - size.top) - offset.y < space.top\n : pos.bottom + (size.bottom - size.top) + offset.y > space.bottom) &&\n above == (space.bottom - pos.bottom > pos.top - space.top))\n above = this.above[i] = !above;\n let spaceVert = (above ? pos.top - space.top : space.bottom - pos.bottom) - arrowHeight;\n if (spaceVert < height && tView.resize !== false) {\n if (spaceVert < this.view.defaultLineHeight) {\n dom.style.top = Outside;\n continue;\n }\n knownHeight.set(tView, height);\n dom.style.height = (height = spaceVert) / scaleY + \"px\";\n }\n else if (dom.style.height) {\n dom.style.height = \"\";\n }\n let top = above ? pos.top - height - arrowHeight - offset.y : pos.bottom + arrowHeight + offset.y;\n let right = left + width;\n if (tView.overlap !== true)\n for (let r of others)\n if (r.left < right && r.right > left && r.top < top + height && r.bottom > top)\n top = above ? r.top - height - 2 - arrowHeight : r.bottom + arrowHeight + 2;\n if (this.position == \"absolute\") {\n dom.style.top = (top - measured.parent.top) / scaleY + \"px\";\n dom.style.left = (left - measured.parent.left) / scaleX + \"px\";\n }\n else {\n dom.style.top = top / scaleY + \"px\";\n dom.style.left = left / scaleX + \"px\";\n }\n if (arrow) {\n let arrowLeft = pos.left + (ltr ? offset.x : -offset.x) - (left + 14 /* Arrow.Offset */ - 7 /* Arrow.Size */);\n arrow.style.left = arrowLeft / scaleX + \"px\";\n }\n if (tView.overlap !== true)\n others.push({ left, top, right, bottom: top + height });\n dom.classList.toggle(\"cm-tooltip-above\", above);\n dom.classList.toggle(\"cm-tooltip-below\", !above);\n if (tView.positioned)\n tView.positioned(measured.space);\n }\n }\n maybeMeasure() {\n if (this.manager.tooltips.length) {\n if (this.view.inView)\n this.view.requestMeasure(this.measureReq);\n if (this.inView != this.view.inView) {\n this.inView = this.view.inView;\n if (!this.inView)\n for (let tv of this.manager.tooltipViews)\n tv.dom.style.top = Outside;\n }\n }\n }\n }, {\n eventObservers: {\n scroll() { this.maybeMeasure(); }\n }\n });\n const baseTheme$4 = /*@__PURE__*/EditorView.baseTheme({\n \".cm-tooltip\": {\n zIndex: 100,\n boxSizing: \"border-box\"\n },\n \"&light .cm-tooltip\": {\n border: \"1px solid #bbb\",\n backgroundColor: \"#f5f5f5\"\n },\n \"&light .cm-tooltip-section:not(:first-child)\": {\n borderTop: \"1px solid #bbb\",\n },\n \"&dark .cm-tooltip\": {\n backgroundColor: \"#333338\",\n color: \"white\"\n },\n \".cm-tooltip-arrow\": {\n height: `${7 /* Arrow.Size */}px`,\n width: `${7 /* Arrow.Size */ * 2}px`,\n position: \"absolute\",\n zIndex: -1,\n overflow: \"hidden\",\n \"&:before, &:after\": {\n content: \"''\",\n position: \"absolute\",\n width: 0,\n height: 0,\n borderLeft: `${7 /* Arrow.Size */}px solid transparent`,\n borderRight: `${7 /* Arrow.Size */}px solid transparent`,\n },\n \".cm-tooltip-above &\": {\n bottom: `-${7 /* Arrow.Size */}px`,\n \"&:before\": {\n borderTop: `${7 /* Arrow.Size */}px solid #bbb`,\n },\n \"&:after\": {\n borderTop: `${7 /* Arrow.Size */}px solid #f5f5f5`,\n bottom: \"1px\"\n }\n },\n \".cm-tooltip-below &\": {\n top: `-${7 /* Arrow.Size */}px`,\n \"&:before\": {\n borderBottom: `${7 /* Arrow.Size */}px solid #bbb`,\n },\n \"&:after\": {\n borderBottom: `${7 /* Arrow.Size */}px solid #f5f5f5`,\n top: \"1px\"\n }\n },\n },\n \"&dark .cm-tooltip .cm-tooltip-arrow\": {\n \"&:before\": {\n borderTopColor: \"#333338\",\n borderBottomColor: \"#333338\"\n },\n \"&:after\": {\n borderTopColor: \"transparent\",\n borderBottomColor: \"transparent\"\n }\n }\n });\n const noOffset = { x: 0, y: 0 };\n /**\n Facet to which an extension can add a value to show a tooltip.\n */\n const showTooltip = /*@__PURE__*/Facet.define({\n enables: [tooltipPlugin, baseTheme$4]\n });\n /**\n Get the active tooltip view for a given tooltip, if available.\n */\n function getTooltip(view, tooltip) {\n let plugin = view.plugin(tooltipPlugin);\n if (!plugin)\n return null;\n let found = plugin.manager.tooltips.indexOf(tooltip);\n return found < 0 ? null : plugin.manager.tooltipViews[found];\n }\n\n const panelConfig = /*@__PURE__*/Facet.define({\n combine(configs) {\n let topContainer, bottomContainer;\n for (let c of configs) {\n topContainer = topContainer || c.topContainer;\n bottomContainer = bottomContainer || c.bottomContainer;\n }\n return { topContainer, bottomContainer };\n }\n });\n /**\n Get the active panel created by the given constructor, if any.\n This can be useful when you need access to your panels' DOM\n structure.\n */\n function getPanel(view, panel) {\n let plugin = view.plugin(panelPlugin);\n let index = plugin ? plugin.specs.indexOf(panel) : -1;\n return index > -1 ? plugin.panels[index] : null;\n }\n const panelPlugin = /*@__PURE__*/ViewPlugin.fromClass(class {\n constructor(view) {\n this.input = view.state.facet(showPanel);\n this.specs = this.input.filter(s => s);\n this.panels = this.specs.map(spec => spec(view));\n let conf = view.state.facet(panelConfig);\n this.top = new PanelGroup(view, true, conf.topContainer);\n this.bottom = new PanelGroup(view, false, conf.bottomContainer);\n this.top.sync(this.panels.filter(p => p.top));\n this.bottom.sync(this.panels.filter(p => !p.top));\n for (let p of this.panels) {\n p.dom.classList.add(\"cm-panel\");\n if (p.mount)\n p.mount();\n }\n }\n update(update) {\n let conf = update.state.facet(panelConfig);\n if (this.top.container != conf.topContainer) {\n this.top.sync([]);\n this.top = new PanelGroup(update.view, true, conf.topContainer);\n }\n if (this.bottom.container != conf.bottomContainer) {\n this.bottom.sync([]);\n this.bottom = new PanelGroup(update.view, false, conf.bottomContainer);\n }\n this.top.syncClasses();\n this.bottom.syncClasses();\n let input = update.state.facet(showPanel);\n if (input != this.input) {\n let specs = input.filter(x => x);\n let panels = [], top = [], bottom = [], mount = [];\n for (let spec of specs) {\n let known = this.specs.indexOf(spec), panel;\n if (known < 0) {\n panel = spec(update.view);\n mount.push(panel);\n }\n else {\n panel = this.panels[known];\n if (panel.update)\n panel.update(update);\n }\n panels.push(panel);\n (panel.top ? top : bottom).push(panel);\n }\n this.specs = specs;\n this.panels = panels;\n this.top.sync(top);\n this.bottom.sync(bottom);\n for (let p of mount) {\n p.dom.classList.add(\"cm-panel\");\n if (p.mount)\n p.mount();\n }\n }\n else {\n for (let p of this.panels)\n if (p.update)\n p.update(update);\n }\n }\n destroy() {\n this.top.sync([]);\n this.bottom.sync([]);\n }\n }, {\n provide: plugin => EditorView.scrollMargins.of(view => {\n let value = view.plugin(plugin);\n return value && { top: value.top.scrollMargin(), bottom: value.bottom.scrollMargin() };\n })\n });\n class PanelGroup {\n constructor(view, top, container) {\n this.view = view;\n this.top = top;\n this.container = container;\n this.dom = undefined;\n this.classes = \"\";\n this.panels = [];\n this.syncClasses();\n }\n sync(panels) {\n for (let p of this.panels)\n if (p.destroy && panels.indexOf(p) < 0)\n p.destroy();\n this.panels = panels;\n this.syncDOM();\n }\n syncDOM() {\n if (this.panels.length == 0) {\n if (this.dom) {\n this.dom.remove();\n this.dom = undefined;\n }\n return;\n }\n if (!this.dom) {\n this.dom = document.createElement(\"div\");\n this.dom.className = this.top ? \"cm-panels cm-panels-top\" : \"cm-panels cm-panels-bottom\";\n this.dom.style[this.top ? \"top\" : \"bottom\"] = \"0\";\n let parent = this.container || this.view.dom;\n parent.insertBefore(this.dom, this.top ? parent.firstChild : null);\n }\n let curDOM = this.dom.firstChild;\n for (let panel of this.panels) {\n if (panel.dom.parentNode == this.dom) {\n while (curDOM != panel.dom)\n curDOM = rm(curDOM);\n curDOM = curDOM.nextSibling;\n }\n else {\n this.dom.insertBefore(panel.dom, curDOM);\n }\n }\n while (curDOM)\n curDOM = rm(curDOM);\n }\n scrollMargin() {\n return !this.dom || this.container ? 0\n : Math.max(0, this.top ?\n this.dom.getBoundingClientRect().bottom - Math.max(0, this.view.scrollDOM.getBoundingClientRect().top) :\n Math.min(innerHeight, this.view.scrollDOM.getBoundingClientRect().bottom) - this.dom.getBoundingClientRect().top);\n }\n syncClasses() {\n if (!this.container || this.classes == this.view.themeClasses)\n return;\n for (let cls of this.classes.split(\" \"))\n if (cls)\n this.container.classList.remove(cls);\n for (let cls of (this.classes = this.view.themeClasses).split(\" \"))\n if (cls)\n this.container.classList.add(cls);\n }\n }\n function rm(node) {\n let next = node.nextSibling;\n node.remove();\n return next;\n }\n /**\n Opening a panel is done by providing a constructor function for\n the panel through this facet. (The panel is closed again when its\n constructor is no longer provided.) Values of `null` are ignored.\n */\n const showPanel = /*@__PURE__*/Facet.define({\n enables: panelPlugin\n });\n\n /**\n A gutter marker represents a bit of information attached to a line\n in a specific gutter. Your own custom markers have to extend this\n class.\n */\n class GutterMarker extends RangeValue {\n /**\n @internal\n */\n compare(other) {\n return this == other || this.constructor == other.constructor && this.eq(other);\n }\n /**\n Compare this marker to another marker of the same type.\n */\n eq(other) { return false; }\n /**\n Called if the marker has a `toDOM` method and its representation\n was removed from a gutter.\n */\n destroy(dom) { }\n }\n GutterMarker.prototype.elementClass = \"\";\n GutterMarker.prototype.toDOM = undefined;\n GutterMarker.prototype.mapMode = MapMode.TrackBefore;\n GutterMarker.prototype.startSide = GutterMarker.prototype.endSide = -1;\n GutterMarker.prototype.point = true;\n /**\n Facet used to add a class to all gutter elements for a given line.\n Markers given to this facet should _only_ define an\n [`elementclass`](https://codemirror.net/6/docs/ref/#view.GutterMarker.elementClass), not a\n [`toDOM`](https://codemirror.net/6/docs/ref/#view.GutterMarker.toDOM) (or the marker will appear\n in all gutters for the line).\n */\n const gutterLineClass = /*@__PURE__*/Facet.define();\n const defaults$1 = {\n class: \"\",\n renderEmptyElements: false,\n elementStyle: \"\",\n markers: () => RangeSet.empty,\n lineMarker: () => null,\n widgetMarker: () => null,\n lineMarkerChange: null,\n initialSpacer: null,\n updateSpacer: null,\n domEventHandlers: {}\n };\n const activeGutters = /*@__PURE__*/Facet.define();\n /**\n Define an editor gutter. The order in which the gutters appear is\n determined by their extension priority.\n */\n function gutter(config) {\n return [gutters(), activeGutters.of(Object.assign(Object.assign({}, defaults$1), config))];\n }\n const unfixGutters = /*@__PURE__*/Facet.define({\n combine: values => values.some(x => x)\n });\n /**\n The gutter-drawing plugin is automatically enabled when you add a\n gutter, but you can use this function to explicitly configure it.\n\n Unless `fixed` is explicitly set to `false`, the gutters are\n fixed, meaning they don't scroll along with the content\n horizontally (except on Internet Explorer, which doesn't support\n CSS [`position:\n sticky`](https://developer.mozilla.org/en-US/docs/Web/CSS/position#sticky)).\n */\n function gutters(config) {\n let result = [\n gutterView,\n ];\n if (config && config.fixed === false)\n result.push(unfixGutters.of(true));\n return result;\n }\n const gutterView = /*@__PURE__*/ViewPlugin.fromClass(class {\n constructor(view) {\n this.view = view;\n this.prevViewport = view.viewport;\n this.dom = document.createElement(\"div\");\n this.dom.className = \"cm-gutters\";\n this.dom.setAttribute(\"aria-hidden\", \"true\");\n this.dom.style.minHeight = (this.view.contentHeight / this.view.scaleY) + \"px\";\n this.gutters = view.state.facet(activeGutters).map(conf => new SingleGutterView(view, conf));\n for (let gutter of this.gutters)\n this.dom.appendChild(gutter.dom);\n this.fixed = !view.state.facet(unfixGutters);\n if (this.fixed) {\n // FIXME IE11 fallback, which doesn't support position: sticky,\n // by using position: relative + event handlers that realign the\n // gutter (or just force fixed=false on IE11?)\n this.dom.style.position = \"sticky\";\n }\n this.syncGutters(false);\n view.scrollDOM.insertBefore(this.dom, view.contentDOM);\n }\n update(update) {\n if (this.updateGutters(update)) {\n // Detach during sync when the viewport changed significantly\n // (such as during scrolling), since for large updates that is\n // faster.\n let vpA = this.prevViewport, vpB = update.view.viewport;\n let vpOverlap = Math.min(vpA.to, vpB.to) - Math.max(vpA.from, vpB.from);\n this.syncGutters(vpOverlap < (vpB.to - vpB.from) * 0.8);\n }\n if (update.geometryChanged) {\n this.dom.style.minHeight = (this.view.contentHeight / this.view.scaleY) + \"px\";\n }\n if (this.view.state.facet(unfixGutters) != !this.fixed) {\n this.fixed = !this.fixed;\n this.dom.style.position = this.fixed ? \"sticky\" : \"\";\n }\n this.prevViewport = update.view.viewport;\n }\n syncGutters(detach) {\n let after = this.dom.nextSibling;\n if (detach)\n this.dom.remove();\n let lineClasses = RangeSet.iter(this.view.state.facet(gutterLineClass), this.view.viewport.from);\n let classSet = [];\n let contexts = this.gutters.map(gutter => new UpdateContext(gutter, this.view.viewport, -this.view.documentPadding.top));\n for (let line of this.view.viewportLineBlocks) {\n if (classSet.length)\n classSet = [];\n if (Array.isArray(line.type)) {\n let first = true;\n for (let b of line.type) {\n if (b.type == BlockType.Text && first) {\n advanceCursor(lineClasses, classSet, b.from);\n for (let cx of contexts)\n cx.line(this.view, b, classSet);\n first = false;\n }\n else if (b.widget) {\n for (let cx of contexts)\n cx.widget(this.view, b);\n }\n }\n }\n else if (line.type == BlockType.Text) {\n advanceCursor(lineClasses, classSet, line.from);\n for (let cx of contexts)\n cx.line(this.view, line, classSet);\n }\n else if (line.widget) {\n for (let cx of contexts)\n cx.widget(this.view, line);\n }\n }\n for (let cx of contexts)\n cx.finish();\n if (detach)\n this.view.scrollDOM.insertBefore(this.dom, after);\n }\n updateGutters(update) {\n let prev = update.startState.facet(activeGutters), cur = update.state.facet(activeGutters);\n let change = update.docChanged || update.heightChanged || update.viewportChanged ||\n !RangeSet.eq(update.startState.facet(gutterLineClass), update.state.facet(gutterLineClass), update.view.viewport.from, update.view.viewport.to);\n if (prev == cur) {\n for (let gutter of this.gutters)\n if (gutter.update(update))\n change = true;\n }\n else {\n change = true;\n let gutters = [];\n for (let conf of cur) {\n let known = prev.indexOf(conf);\n if (known < 0) {\n gutters.push(new SingleGutterView(this.view, conf));\n }\n else {\n this.gutters[known].update(update);\n gutters.push(this.gutters[known]);\n }\n }\n for (let g of this.gutters) {\n g.dom.remove();\n if (gutters.indexOf(g) < 0)\n g.destroy();\n }\n for (let g of gutters)\n this.dom.appendChild(g.dom);\n this.gutters = gutters;\n }\n return change;\n }\n destroy() {\n for (let view of this.gutters)\n view.destroy();\n this.dom.remove();\n }\n }, {\n provide: plugin => EditorView.scrollMargins.of(view => {\n let value = view.plugin(plugin);\n if (!value || value.gutters.length == 0 || !value.fixed)\n return null;\n return view.textDirection == Direction.LTR\n ? { left: value.dom.offsetWidth * view.scaleX }\n : { right: value.dom.offsetWidth * view.scaleX };\n })\n });\n function asArray(val) { return (Array.isArray(val) ? val : [val]); }\n function advanceCursor(cursor, collect, pos) {\n while (cursor.value && cursor.from <= pos) {\n if (cursor.from == pos)\n collect.push(cursor.value);\n cursor.next();\n }\n }\n class UpdateContext {\n constructor(gutter, viewport, height) {\n this.gutter = gutter;\n this.height = height;\n this.i = 0;\n this.cursor = RangeSet.iter(gutter.markers, viewport.from);\n }\n addElement(view, block, markers) {\n let { gutter } = this, above = (block.top - this.height) / view.scaleY, height = block.height / view.scaleY;\n if (this.i == gutter.elements.length) {\n let newElt = new GutterElement(view, height, above, markers);\n gutter.elements.push(newElt);\n gutter.dom.appendChild(newElt.dom);\n }\n else {\n gutter.elements[this.i].update(view, height, above, markers);\n }\n this.height = block.bottom;\n this.i++;\n }\n line(view, line, extraMarkers) {\n let localMarkers = [];\n advanceCursor(this.cursor, localMarkers, line.from);\n if (extraMarkers.length)\n localMarkers = localMarkers.concat(extraMarkers);\n let forLine = this.gutter.config.lineMarker(view, line, localMarkers);\n if (forLine)\n localMarkers.unshift(forLine);\n let gutter = this.gutter;\n if (localMarkers.length == 0 && !gutter.config.renderEmptyElements)\n return;\n this.addElement(view, line, localMarkers);\n }\n widget(view, block) {\n let marker = this.gutter.config.widgetMarker(view, block.widget, block);\n if (marker)\n this.addElement(view, block, [marker]);\n }\n finish() {\n let gutter = this.gutter;\n while (gutter.elements.length > this.i) {\n let last = gutter.elements.pop();\n gutter.dom.removeChild(last.dom);\n last.destroy();\n }\n }\n }\n class SingleGutterView {\n constructor(view, config) {\n this.view = view;\n this.config = config;\n this.elements = [];\n this.spacer = null;\n this.dom = document.createElement(\"div\");\n this.dom.className = \"cm-gutter\" + (this.config.class ? \" \" + this.config.class : \"\");\n for (let prop in config.domEventHandlers) {\n this.dom.addEventListener(prop, (event) => {\n let target = event.target, y;\n if (target != this.dom && this.dom.contains(target)) {\n while (target.parentNode != this.dom)\n target = target.parentNode;\n let rect = target.getBoundingClientRect();\n y = (rect.top + rect.bottom) / 2;\n }\n else {\n y = event.clientY;\n }\n let line = view.lineBlockAtHeight(y - view.documentTop);\n if (config.domEventHandlers[prop](view, line, event))\n event.preventDefault();\n });\n }\n this.markers = asArray(config.markers(view));\n if (config.initialSpacer) {\n this.spacer = new GutterElement(view, 0, 0, [config.initialSpacer(view)]);\n this.dom.appendChild(this.spacer.dom);\n this.spacer.dom.style.cssText += \"visibility: hidden; pointer-events: none\";\n }\n }\n update(update) {\n let prevMarkers = this.markers;\n this.markers = asArray(this.config.markers(update.view));\n if (this.spacer && this.config.updateSpacer) {\n let updated = this.config.updateSpacer(this.spacer.markers[0], update);\n if (updated != this.spacer.markers[0])\n this.spacer.update(update.view, 0, 0, [updated]);\n }\n let vp = update.view.viewport;\n return !RangeSet.eq(this.markers, prevMarkers, vp.from, vp.to) ||\n (this.config.lineMarkerChange ? this.config.lineMarkerChange(update) : false);\n }\n destroy() {\n for (let elt of this.elements)\n elt.destroy();\n }\n }\n class GutterElement {\n constructor(view, height, above, markers) {\n this.height = -1;\n this.above = 0;\n this.markers = [];\n this.dom = document.createElement(\"div\");\n this.dom.className = \"cm-gutterElement\";\n this.update(view, height, above, markers);\n }\n update(view, height, above, markers) {\n if (this.height != height) {\n this.height = height;\n this.dom.style.height = height + \"px\";\n }\n if (this.above != above)\n this.dom.style.marginTop = (this.above = above) ? above + \"px\" : \"\";\n if (!sameMarkers(this.markers, markers))\n this.setMarkers(view, markers);\n }\n setMarkers(view, markers) {\n let cls = \"cm-gutterElement\", domPos = this.dom.firstChild;\n for (let iNew = 0, iOld = 0;;) {\n let skipTo = iOld, marker = iNew < markers.length ? markers[iNew++] : null, matched = false;\n if (marker) {\n let c = marker.elementClass;\n if (c)\n cls += \" \" + c;\n for (let i = iOld; i < this.markers.length; i++)\n if (this.markers[i].compare(marker)) {\n skipTo = i;\n matched = true;\n break;\n }\n }\n else {\n skipTo = this.markers.length;\n }\n while (iOld < skipTo) {\n let next = this.markers[iOld++];\n if (next.toDOM) {\n next.destroy(domPos);\n let after = domPos.nextSibling;\n domPos.remove();\n domPos = after;\n }\n }\n if (!marker)\n break;\n if (marker.toDOM) {\n if (matched)\n domPos = domPos.nextSibling;\n else\n this.dom.insertBefore(marker.toDOM(view), domPos);\n }\n if (matched)\n iOld++;\n }\n this.dom.className = cls;\n this.markers = markers;\n }\n destroy() {\n this.setMarkers(null, []); // First argument not used unless creating markers\n }\n }\n function sameMarkers(a, b) {\n if (a.length != b.length)\n return false;\n for (let i = 0; i < a.length; i++)\n if (!a[i].compare(b[i]))\n return false;\n return true;\n }\n /**\n Facet used to provide markers to the line number gutter.\n */\n const lineNumberMarkers = /*@__PURE__*/Facet.define();\n const lineNumberConfig = /*@__PURE__*/Facet.define({\n combine(values) {\n return combineConfig(values, { formatNumber: String, domEventHandlers: {} }, {\n domEventHandlers(a, b) {\n let result = Object.assign({}, a);\n for (let event in b) {\n let exists = result[event], add = b[event];\n result[event] = exists ? (view, line, event) => exists(view, line, event) || add(view, line, event) : add;\n }\n return result;\n }\n });\n }\n });\n class NumberMarker extends GutterMarker {\n constructor(number) {\n super();\n this.number = number;\n }\n eq(other) { return this.number == other.number; }\n toDOM() { return document.createTextNode(this.number); }\n }\n function formatNumber(view, number) {\n return view.state.facet(lineNumberConfig).formatNumber(number, view.state);\n }\n const lineNumberGutter = /*@__PURE__*/activeGutters.compute([lineNumberConfig], state => ({\n class: \"cm-lineNumbers\",\n renderEmptyElements: false,\n markers(view) { return view.state.facet(lineNumberMarkers); },\n lineMarker(view, line, others) {\n if (others.some(m => m.toDOM))\n return null;\n return new NumberMarker(formatNumber(view, view.state.doc.lineAt(line.from).number));\n },\n widgetMarker: () => null,\n lineMarkerChange: update => update.startState.facet(lineNumberConfig) != update.state.facet(lineNumberConfig),\n initialSpacer(view) {\n return new NumberMarker(formatNumber(view, maxLineNumber(view.state.doc.lines)));\n },\n updateSpacer(spacer, update) {\n let max = formatNumber(update.view, maxLineNumber(update.view.state.doc.lines));\n return max == spacer.number ? spacer : new NumberMarker(max);\n },\n domEventHandlers: state.facet(lineNumberConfig).domEventHandlers\n }));\n /**\n Create a line number gutter extension.\n */\n function lineNumbers(config = {}) {\n return [\n lineNumberConfig.of(config),\n gutters(),\n lineNumberGutter\n ];\n }\n function maxLineNumber(lines) {\n let last = 9;\n while (last < lines)\n last = last * 10 + 9;\n return last;\n }\n const activeLineGutterMarker = /*@__PURE__*/new class extends GutterMarker {\n constructor() {\n super(...arguments);\n this.elementClass = \"cm-activeLineGutter\";\n }\n };\n const activeLineGutterHighlighter = /*@__PURE__*/gutterLineClass.compute([\"selection\"], state => {\n let marks = [], last = -1;\n for (let range of state.selection.ranges) {\n let linePos = state.doc.lineAt(range.head).from;\n if (linePos > last) {\n last = linePos;\n marks.push(activeLineGutterMarker.range(linePos));\n }\n }\n return RangeSet.of(marks);\n });\n /**\n Returns an extension that adds a `cm-activeLineGutter` class to\n all gutter elements on the [active\n line](https://codemirror.net/6/docs/ref/#view.highlightActiveLine).\n */\n function highlightActiveLineGutter() {\n return activeLineGutterHighlighter;\n }\n\n /**\n The default maximum length of a `TreeBuffer` node.\n */\n const DefaultBufferLength = 1024;\n let nextPropID = 0;\n class Range {\n constructor(from, to) {\n this.from = from;\n this.to = to;\n }\n }\n /**\n Each [node type](#common.NodeType) or [individual tree](#common.Tree)\n can have metadata associated with it in props. Instances of this\n class represent prop names.\n */\n class NodeProp {\n /**\n Create a new node prop type.\n */\n constructor(config = {}) {\n this.id = nextPropID++;\n this.perNode = !!config.perNode;\n this.deserialize = config.deserialize || (() => {\n throw new Error(\"This node type doesn't define a deserialize function\");\n });\n }\n /**\n This is meant to be used with\n [`NodeSet.extend`](#common.NodeSet.extend) or\n [`LRParser.configure`](#lr.ParserConfig.props) to compute\n prop values for each node type in the set. Takes a [match\n object](#common.NodeType^match) or function that returns undefined\n if the node type doesn't get this prop, and the prop's value if\n it does.\n */\n add(match) {\n if (this.perNode)\n throw new RangeError(\"Can't add per-node props to node types\");\n if (typeof match != \"function\")\n match = NodeType.match(match);\n return (type) => {\n let result = match(type);\n return result === undefined ? null : [this, result];\n };\n }\n }\n /**\n Prop that is used to describe matching delimiters. For opening\n delimiters, this holds an array of node names (written as a\n space-separated string when declaring this prop in a grammar)\n for the node types of closing delimiters that match it.\n */\n NodeProp.closedBy = new NodeProp({ deserialize: str => str.split(\" \") });\n /**\n The inverse of [`closedBy`](#common.NodeProp^closedBy). This is\n attached to closing delimiters, holding an array of node names\n of types of matching opening delimiters.\n */\n NodeProp.openedBy = new NodeProp({ deserialize: str => str.split(\" \") });\n /**\n Used to assign node types to groups (for example, all node\n types that represent an expression could be tagged with an\n `\"Expression\"` group).\n */\n NodeProp.group = new NodeProp({ deserialize: str => str.split(\" \") });\n /**\n Attached to nodes to indicate these should be\n [displayed](https://codemirror.net/docs/ref/#language.syntaxTree)\n in a bidirectional text isolate, so that direction-neutral\n characters on their sides don't incorrectly get associated with\n surrounding text. You'll generally want to set this for nodes\n that contain arbitrary text, like strings and comments, and for\n nodes that appear _inside_ arbitrary text, like HTML tags. When\n not given a value, in a grammar declaration, defaults to\n `\"auto\"`.\n */\n NodeProp.isolate = new NodeProp({ deserialize: value => {\n if (value && value != \"rtl\" && value != \"ltr\" && value != \"auto\")\n throw new RangeError(\"Invalid value for isolate: \" + value);\n return value || \"auto\";\n } });\n /**\n The hash of the [context](#lr.ContextTracker.constructor)\n that the node was parsed in, if any. Used to limit reuse of\n contextual nodes.\n */\n NodeProp.contextHash = new NodeProp({ perNode: true });\n /**\n The distance beyond the end of the node that the tokenizer\n looked ahead for any of the tokens inside the node. (The LR\n parser only stores this when it is larger than 25, for\n efficiency reasons.)\n */\n NodeProp.lookAhead = new NodeProp({ perNode: true });\n /**\n This per-node prop is used to replace a given node, or part of a\n node, with another tree. This is useful to include trees from\n different languages in mixed-language parsers.\n */\n NodeProp.mounted = new NodeProp({ perNode: true });\n /**\n A mounted tree, which can be [stored](#common.NodeProp^mounted) on\n a tree node to indicate that parts of its content are\n represented by another tree.\n */\n class MountedTree {\n constructor(\n /**\n The inner tree.\n */\n tree, \n /**\n If this is null, this tree replaces the entire node (it will\n be included in the regular iteration instead of its host\n node). If not, only the given ranges are considered to be\n covered by this tree. This is used for trees that are mixed in\n a way that isn't strictly hierarchical. Such mounted trees are\n only entered by [`resolveInner`](#common.Tree.resolveInner)\n and [`enter`](#common.SyntaxNode.enter).\n */\n overlay, \n /**\n The parser used to create this subtree.\n */\n parser) {\n this.tree = tree;\n this.overlay = overlay;\n this.parser = parser;\n }\n /**\n @internal\n */\n static get(tree) {\n return tree && tree.props && tree.props[NodeProp.mounted.id];\n }\n }\n const noProps = Object.create(null);\n /**\n Each node in a syntax tree has a node type associated with it.\n */\n class NodeType {\n /**\n @internal\n */\n constructor(\n /**\n The name of the node type. Not necessarily unique, but if the\n grammar was written properly, different node types with the\n same name within a node set should play the same semantic\n role.\n */\n name, \n /**\n @internal\n */\n props, \n /**\n The id of this node in its set. Corresponds to the term ids\n used in the parser.\n */\n id, \n /**\n @internal\n */\n flags = 0) {\n this.name = name;\n this.props = props;\n this.id = id;\n this.flags = flags;\n }\n /**\n Define a node type.\n */\n static define(spec) {\n let props = spec.props && spec.props.length ? Object.create(null) : noProps;\n let flags = (spec.top ? 1 /* NodeFlag.Top */ : 0) | (spec.skipped ? 2 /* NodeFlag.Skipped */ : 0) |\n (spec.error ? 4 /* NodeFlag.Error */ : 0) | (spec.name == null ? 8 /* NodeFlag.Anonymous */ : 0);\n let type = new NodeType(spec.name || \"\", props, spec.id, flags);\n if (spec.props)\n for (let src of spec.props) {\n if (!Array.isArray(src))\n src = src(type);\n if (src) {\n if (src[0].perNode)\n throw new RangeError(\"Can't store a per-node prop on a node type\");\n props[src[0].id] = src[1];\n }\n }\n return type;\n }\n /**\n Retrieves a node prop for this type. Will return `undefined` if\n the prop isn't present on this node.\n */\n prop(prop) { return this.props[prop.id]; }\n /**\n True when this is the top node of a grammar.\n */\n get isTop() { return (this.flags & 1 /* NodeFlag.Top */) > 0; }\n /**\n True when this node is produced by a skip rule.\n */\n get isSkipped() { return (this.flags & 2 /* NodeFlag.Skipped */) > 0; }\n /**\n Indicates whether this is an error node.\n */\n get isError() { return (this.flags & 4 /* NodeFlag.Error */) > 0; }\n /**\n When true, this node type doesn't correspond to a user-declared\n named node, for example because it is used to cache repetition.\n */\n get isAnonymous() { return (this.flags & 8 /* NodeFlag.Anonymous */) > 0; }\n /**\n Returns true when this node's name or one of its\n [groups](#common.NodeProp^group) matches the given string.\n */\n is(name) {\n if (typeof name == 'string') {\n if (this.name == name)\n return true;\n let group = this.prop(NodeProp.group);\n return group ? group.indexOf(name) > -1 : false;\n }\n return this.id == name;\n }\n /**\n Create a function from node types to arbitrary values by\n specifying an object whose property names are node or\n [group](#common.NodeProp^group) names. Often useful with\n [`NodeProp.add`](#common.NodeProp.add). You can put multiple\n names, separated by spaces, in a single property name to map\n multiple node names to a single value.\n */\n static match(map) {\n let direct = Object.create(null);\n for (let prop in map)\n for (let name of prop.split(\" \"))\n direct[name] = map[prop];\n return (node) => {\n for (let groups = node.prop(NodeProp.group), i = -1; i < (groups ? groups.length : 0); i++) {\n let found = direct[i < 0 ? node.name : groups[i]];\n if (found)\n return found;\n }\n };\n }\n }\n /**\n An empty dummy node type to use when no actual type is available.\n */\n NodeType.none = new NodeType(\"\", Object.create(null), 0, 8 /* NodeFlag.Anonymous */);\n /**\n A node set holds a collection of node types. It is used to\n compactly represent trees by storing their type ids, rather than a\n full pointer to the type object, in a numeric array. Each parser\n [has](#lr.LRParser.nodeSet) a node set, and [tree\n buffers](#common.TreeBuffer) can only store collections of nodes\n from the same set. A set can have a maximum of 2**16 (65536) node\n types in it, so that the ids fit into 16-bit typed array slots.\n */\n class NodeSet {\n /**\n Create a set with the given types. The `id` property of each\n type should correspond to its position within the array.\n */\n constructor(\n /**\n The node types in this set, by id.\n */\n types) {\n this.types = types;\n for (let i = 0; i < types.length; i++)\n if (types[i].id != i)\n throw new RangeError(\"Node type ids should correspond to array positions when creating a node set\");\n }\n /**\n Create a copy of this set with some node properties added. The\n arguments to this method can be created with\n [`NodeProp.add`](#common.NodeProp.add).\n */\n extend(...props) {\n let newTypes = [];\n for (let type of this.types) {\n let newProps = null;\n for (let source of props) {\n let add = source(type);\n if (add) {\n if (!newProps)\n newProps = Object.assign({}, type.props);\n newProps[add[0].id] = add[1];\n }\n }\n newTypes.push(newProps ? new NodeType(type.name, newProps, type.id, type.flags) : type);\n }\n return new NodeSet(newTypes);\n }\n }\n const CachedNode = new WeakMap(), CachedInnerNode = new WeakMap();\n /**\n Options that control iteration. Can be combined with the `|`\n operator to enable multiple ones.\n */\n var IterMode;\n (function (IterMode) {\n /**\n When enabled, iteration will only visit [`Tree`](#common.Tree)\n objects, not nodes packed into\n [`TreeBuffer`](#common.TreeBuffer)s.\n */\n IterMode[IterMode[\"ExcludeBuffers\"] = 1] = \"ExcludeBuffers\";\n /**\n Enable this to make iteration include anonymous nodes (such as\n the nodes that wrap repeated grammar constructs into a balanced\n tree).\n */\n IterMode[IterMode[\"IncludeAnonymous\"] = 2] = \"IncludeAnonymous\";\n /**\n By default, regular [mounted](#common.NodeProp^mounted) nodes\n replace their base node in iteration. Enable this to ignore them\n instead.\n */\n IterMode[IterMode[\"IgnoreMounts\"] = 4] = \"IgnoreMounts\";\n /**\n This option only applies in\n [`enter`](#common.SyntaxNode.enter)-style methods. It tells the\n library to not enter mounted overlays if one covers the given\n position.\n */\n IterMode[IterMode[\"IgnoreOverlays\"] = 8] = \"IgnoreOverlays\";\n })(IterMode || (IterMode = {}));\n /**\n A piece of syntax tree. There are two ways to approach these\n trees: the way they are actually stored in memory, and the\n convenient way.\n\n Syntax trees are stored as a tree of `Tree` and `TreeBuffer`\n objects. By packing detail information into `TreeBuffer` leaf\n nodes, the representation is made a lot more memory-efficient.\n\n However, when you want to actually work with tree nodes, this\n representation is very awkward, so most client code will want to\n use the [`TreeCursor`](#common.TreeCursor) or\n [`SyntaxNode`](#common.SyntaxNode) interface instead, which provides\n a view on some part of this data structure, and can be used to\n move around to adjacent nodes.\n */\n class Tree {\n /**\n Construct a new tree. See also [`Tree.build`](#common.Tree^build).\n */\n constructor(\n /**\n The type of the top node.\n */\n type, \n /**\n This node's child nodes.\n */\n children, \n /**\n The positions (offsets relative to the start of this tree) of\n the children.\n */\n positions, \n /**\n The total length of this tree\n */\n length, \n /**\n Per-node [node props](#common.NodeProp) to associate with this node.\n */\n props) {\n this.type = type;\n this.children = children;\n this.positions = positions;\n this.length = length;\n /**\n @internal\n */\n this.props = null;\n if (props && props.length) {\n this.props = Object.create(null);\n for (let [prop, value] of props)\n this.props[typeof prop == \"number\" ? prop : prop.id] = value;\n }\n }\n /**\n @internal\n */\n toString() {\n let mounted = MountedTree.get(this);\n if (mounted && !mounted.overlay)\n return mounted.tree.toString();\n let children = \"\";\n for (let ch of this.children) {\n let str = ch.toString();\n if (str) {\n if (children)\n children += \",\";\n children += str;\n }\n }\n return !this.type.name ? children :\n (/\\W/.test(this.type.name) && !this.type.isError ? JSON.stringify(this.type.name) : this.type.name) +\n (children.length ? \"(\" + children + \")\" : \"\");\n }\n /**\n Get a [tree cursor](#common.TreeCursor) positioned at the top of\n the tree. Mode can be used to [control](#common.IterMode) which\n nodes the cursor visits.\n */\n cursor(mode = 0) {\n return new TreeCursor(this.topNode, mode);\n }\n /**\n Get a [tree cursor](#common.TreeCursor) pointing into this tree\n at the given position and side (see\n [`moveTo`](#common.TreeCursor.moveTo).\n */\n cursorAt(pos, side = 0, mode = 0) {\n let scope = CachedNode.get(this) || this.topNode;\n let cursor = new TreeCursor(scope);\n cursor.moveTo(pos, side);\n CachedNode.set(this, cursor._tree);\n return cursor;\n }\n /**\n Get a [syntax node](#common.SyntaxNode) object for the top of the\n tree.\n */\n get topNode() {\n return new TreeNode(this, 0, 0, null);\n }\n /**\n Get the [syntax node](#common.SyntaxNode) at the given position.\n If `side` is -1, this will move into nodes that end at the\n position. If 1, it'll move into nodes that start at the\n position. With 0, it'll only enter nodes that cover the position\n from both sides.\n \n Note that this will not enter\n [overlays](#common.MountedTree.overlay), and you often want\n [`resolveInner`](#common.Tree.resolveInner) instead.\n */\n resolve(pos, side = 0) {\n let node = resolveNode$1(CachedNode.get(this) || this.topNode, pos, side, false);\n CachedNode.set(this, node);\n return node;\n }\n /**\n Like [`resolve`](#common.Tree.resolve), but will enter\n [overlaid](#common.MountedTree.overlay) nodes, producing a syntax node\n pointing into the innermost overlaid tree at the given position\n (with parent links going through all parent structure, including\n the host trees).\n */\n resolveInner(pos, side = 0) {\n let node = resolveNode$1(CachedInnerNode.get(this) || this.topNode, pos, side, true);\n CachedInnerNode.set(this, node);\n return node;\n }\n /**\n In some situations, it can be useful to iterate through all\n nodes around a position, including those in overlays that don't\n directly cover the position. This method gives you an iterator\n that will produce all nodes, from small to big, around the given\n position.\n */\n resolveStack(pos, side = 0) {\n return stackIterator(this, pos, side);\n }\n /**\n Iterate over the tree and its children, calling `enter` for any\n node that touches the `from`/`to` region (if given) before\n running over such a node's children, and `leave` (if given) when\n leaving the node. When `enter` returns `false`, that node will\n not have its children iterated over (or `leave` called).\n */\n iterate(spec) {\n let { enter, leave, from = 0, to = this.length } = spec;\n let mode = spec.mode || 0, anon = (mode & IterMode.IncludeAnonymous) > 0;\n for (let c = this.cursor(mode | IterMode.IncludeAnonymous);;) {\n let entered = false;\n if (c.from <= to && c.to >= from && (!anon && c.type.isAnonymous || enter(c) !== false)) {\n if (c.firstChild())\n continue;\n entered = true;\n }\n for (;;) {\n if (entered && leave && (anon || !c.type.isAnonymous))\n leave(c);\n if (c.nextSibling())\n break;\n if (!c.parent())\n return;\n entered = true;\n }\n }\n }\n /**\n Get the value of the given [node prop](#common.NodeProp) for this\n node. Works with both per-node and per-type props.\n */\n prop(prop) {\n return !prop.perNode ? this.type.prop(prop) : this.props ? this.props[prop.id] : undefined;\n }\n /**\n Returns the node's [per-node props](#common.NodeProp.perNode) in a\n format that can be passed to the [`Tree`](#common.Tree)\n constructor.\n */\n get propValues() {\n let result = [];\n if (this.props)\n for (let id in this.props)\n result.push([+id, this.props[id]]);\n return result;\n }\n /**\n Balance the direct children of this tree, producing a copy of\n which may have children grouped into subtrees with type\n [`NodeType.none`](#common.NodeType^none).\n */\n balance(config = {}) {\n return this.children.length <= 8 /* Balance.BranchFactor */ ? this :\n balanceRange(NodeType.none, this.children, this.positions, 0, this.children.length, 0, this.length, (children, positions, length) => new Tree(this.type, children, positions, length, this.propValues), config.makeTree || ((children, positions, length) => new Tree(NodeType.none, children, positions, length)));\n }\n /**\n Build a tree from a postfix-ordered buffer of node information,\n or a cursor over such a buffer.\n */\n static build(data) { return buildTree(data); }\n }\n /**\n The empty tree\n */\n Tree.empty = new Tree(NodeType.none, [], [], 0);\n class FlatBufferCursor {\n constructor(buffer, index) {\n this.buffer = buffer;\n this.index = index;\n }\n get id() { return this.buffer[this.index - 4]; }\n get start() { return this.buffer[this.index - 3]; }\n get end() { return this.buffer[this.index - 2]; }\n get size() { return this.buffer[this.index - 1]; }\n get pos() { return this.index; }\n next() { this.index -= 4; }\n fork() { return new FlatBufferCursor(this.buffer, this.index); }\n }\n /**\n Tree buffers contain (type, start, end, endIndex) quads for each\n node. In such a buffer, nodes are stored in prefix order (parents\n before children, with the endIndex of the parent indicating which\n children belong to it).\n */\n class TreeBuffer {\n /**\n Create a tree buffer.\n */\n constructor(\n /**\n The buffer's content.\n */\n buffer, \n /**\n The total length of the group of nodes in the buffer.\n */\n length, \n /**\n The node set used in this buffer.\n */\n set) {\n this.buffer = buffer;\n this.length = length;\n this.set = set;\n }\n /**\n @internal\n */\n get type() { return NodeType.none; }\n /**\n @internal\n */\n toString() {\n let result = [];\n for (let index = 0; index < this.buffer.length;) {\n result.push(this.childString(index));\n index = this.buffer[index + 3];\n }\n return result.join(\",\");\n }\n /**\n @internal\n */\n childString(index) {\n let id = this.buffer[index], endIndex = this.buffer[index + 3];\n let type = this.set.types[id], result = type.name;\n if (/\\W/.test(result) && !type.isError)\n result = JSON.stringify(result);\n index += 4;\n if (endIndex == index)\n return result;\n let children = [];\n while (index < endIndex) {\n children.push(this.childString(index));\n index = this.buffer[index + 3];\n }\n return result + \"(\" + children.join(\",\") + \")\";\n }\n /**\n @internal\n */\n findChild(startIndex, endIndex, dir, pos, side) {\n let { buffer } = this, pick = -1;\n for (let i = startIndex; i != endIndex; i = buffer[i + 3]) {\n if (checkSide(side, pos, buffer[i + 1], buffer[i + 2])) {\n pick = i;\n if (dir > 0)\n break;\n }\n }\n return pick;\n }\n /**\n @internal\n */\n slice(startI, endI, from) {\n let b = this.buffer;\n let copy = new Uint16Array(endI - startI), len = 0;\n for (let i = startI, j = 0; i < endI;) {\n copy[j++] = b[i++];\n copy[j++] = b[i++] - from;\n let to = copy[j++] = b[i++] - from;\n copy[j++] = b[i++] - startI;\n len = Math.max(len, to);\n }\n return new TreeBuffer(copy, len, this.set);\n }\n }\n function checkSide(side, pos, from, to) {\n switch (side) {\n case -2 /* Side.Before */: return from < pos;\n case -1 /* Side.AtOrBefore */: return to >= pos && from < pos;\n case 0 /* Side.Around */: return from < pos && to > pos;\n case 1 /* Side.AtOrAfter */: return from <= pos && to > pos;\n case 2 /* Side.After */: return to > pos;\n case 4 /* Side.DontCare */: return true;\n }\n }\n function resolveNode$1(node, pos, side, overlays) {\n var _a;\n // Move up to a node that actually holds the position, if possible\n while (node.from == node.to ||\n (side < 1 ? node.from >= pos : node.from > pos) ||\n (side > -1 ? node.to <= pos : node.to < pos)) {\n let parent = !overlays && node instanceof TreeNode && node.index < 0 ? null : node.parent;\n if (!parent)\n return node;\n node = parent;\n }\n let mode = overlays ? 0 : IterMode.IgnoreOverlays;\n // Must go up out of overlays when those do not overlap with pos\n if (overlays)\n for (let scan = node, parent = scan.parent; parent; scan = parent, parent = scan.parent) {\n if (scan instanceof TreeNode && scan.index < 0 && ((_a = parent.enter(pos, side, mode)) === null || _a === void 0 ? void 0 : _a.from) != scan.from)\n node = parent;\n }\n for (;;) {\n let inner = node.enter(pos, side, mode);\n if (!inner)\n return node;\n node = inner;\n }\n }\n class BaseNode {\n cursor(mode = 0) { return new TreeCursor(this, mode); }\n getChild(type, before = null, after = null) {\n let r = getChildren(this, type, before, after);\n return r.length ? r[0] : null;\n }\n getChildren(type, before = null, after = null) {\n return getChildren(this, type, before, after);\n }\n resolve(pos, side = 0) {\n return resolveNode$1(this, pos, side, false);\n }\n resolveInner(pos, side = 0) {\n return resolveNode$1(this, pos, side, true);\n }\n matchContext(context) {\n return matchNodeContext(this, context);\n }\n enterUnfinishedNodesBefore(pos) {\n let scan = this.childBefore(pos), node = this;\n while (scan) {\n let last = scan.lastChild;\n if (!last || last.to != scan.to)\n break;\n if (last.type.isError && last.from == last.to) {\n node = scan;\n scan = last.prevSibling;\n }\n else {\n scan = last;\n }\n }\n return node;\n }\n get node() { return this; }\n get next() { return this.parent; }\n }\n class TreeNode extends BaseNode {\n constructor(_tree, from, \n // Index in parent node, set to -1 if the node is not a direct child of _parent.node (overlay)\n index, _parent) {\n super();\n this._tree = _tree;\n this.from = from;\n this.index = index;\n this._parent = _parent;\n }\n get type() { return this._tree.type; }\n get name() { return this._tree.type.name; }\n get to() { return this.from + this._tree.length; }\n nextChild(i, dir, pos, side, mode = 0) {\n for (let parent = this;;) {\n for (let { children, positions } = parent._tree, e = dir > 0 ? children.length : -1; i != e; i += dir) {\n let next = children[i], start = positions[i] + parent.from;\n if (!checkSide(side, pos, start, start + next.length))\n continue;\n if (next instanceof TreeBuffer) {\n if (mode & IterMode.ExcludeBuffers)\n continue;\n let index = next.findChild(0, next.buffer.length, dir, pos - start, side);\n if (index > -1)\n return new BufferNode(new BufferContext(parent, next, i, start), null, index);\n }\n else if ((mode & IterMode.IncludeAnonymous) || (!next.type.isAnonymous || hasChild(next))) {\n let mounted;\n if (!(mode & IterMode.IgnoreMounts) && (mounted = MountedTree.get(next)) && !mounted.overlay)\n return new TreeNode(mounted.tree, start, i, parent);\n let inner = new TreeNode(next, start, i, parent);\n return (mode & IterMode.IncludeAnonymous) || !inner.type.isAnonymous ? inner\n : inner.nextChild(dir < 0 ? next.children.length - 1 : 0, dir, pos, side);\n }\n }\n if ((mode & IterMode.IncludeAnonymous) || !parent.type.isAnonymous)\n return null;\n if (parent.index >= 0)\n i = parent.index + dir;\n else\n i = dir < 0 ? -1 : parent._parent._tree.children.length;\n parent = parent._parent;\n if (!parent)\n return null;\n }\n }\n get firstChild() { return this.nextChild(0, 1, 0, 4 /* Side.DontCare */); }\n get lastChild() { return this.nextChild(this._tree.children.length - 1, -1, 0, 4 /* Side.DontCare */); }\n childAfter(pos) { return this.nextChild(0, 1, pos, 2 /* Side.After */); }\n childBefore(pos) { return this.nextChild(this._tree.children.length - 1, -1, pos, -2 /* Side.Before */); }\n enter(pos, side, mode = 0) {\n let mounted;\n if (!(mode & IterMode.IgnoreOverlays) && (mounted = MountedTree.get(this._tree)) && mounted.overlay) {\n let rPos = pos - this.from;\n for (let { from, to } of mounted.overlay) {\n if ((side > 0 ? from <= rPos : from < rPos) &&\n (side < 0 ? to >= rPos : to > rPos))\n return new TreeNode(mounted.tree, mounted.overlay[0].from + this.from, -1, this);\n }\n }\n return this.nextChild(0, 1, pos, side, mode);\n }\n nextSignificantParent() {\n let val = this;\n while (val.type.isAnonymous && val._parent)\n val = val._parent;\n return val;\n }\n get parent() {\n return this._parent ? this._parent.nextSignificantParent() : null;\n }\n get nextSibling() {\n return this._parent && this.index >= 0 ? this._parent.nextChild(this.index + 1, 1, 0, 4 /* Side.DontCare */) : null;\n }\n get prevSibling() {\n return this._parent && this.index >= 0 ? this._parent.nextChild(this.index - 1, -1, 0, 4 /* Side.DontCare */) : null;\n }\n get tree() { return this._tree; }\n toTree() { return this._tree; }\n /**\n @internal\n */\n toString() { return this._tree.toString(); }\n }\n function getChildren(node, type, before, after) {\n let cur = node.cursor(), result = [];\n if (!cur.firstChild())\n return result;\n if (before != null)\n for (let found = false; !found;) {\n found = cur.type.is(before);\n if (!cur.nextSibling())\n return result;\n }\n for (;;) {\n if (after != null && cur.type.is(after))\n return result;\n if (cur.type.is(type))\n result.push(cur.node);\n if (!cur.nextSibling())\n return after == null ? result : [];\n }\n }\n function matchNodeContext(node, context, i = context.length - 1) {\n for (let p = node.parent; i >= 0; p = p.parent) {\n if (!p)\n return false;\n if (!p.type.isAnonymous) {\n if (context[i] && context[i] != p.name)\n return false;\n i--;\n }\n }\n return true;\n }\n class BufferContext {\n constructor(parent, buffer, index, start) {\n this.parent = parent;\n this.buffer = buffer;\n this.index = index;\n this.start = start;\n }\n }\n class BufferNode extends BaseNode {\n get name() { return this.type.name; }\n get from() { return this.context.start + this.context.buffer.buffer[this.index + 1]; }\n get to() { return this.context.start + this.context.buffer.buffer[this.index + 2]; }\n constructor(context, _parent, index) {\n super();\n this.context = context;\n this._parent = _parent;\n this.index = index;\n this.type = context.buffer.set.types[context.buffer.buffer[index]];\n }\n child(dir, pos, side) {\n let { buffer } = this.context;\n let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], dir, pos - this.context.start, side);\n return index < 0 ? null : new BufferNode(this.context, this, index);\n }\n get firstChild() { return this.child(1, 0, 4 /* Side.DontCare */); }\n get lastChild() { return this.child(-1, 0, 4 /* Side.DontCare */); }\n childAfter(pos) { return this.child(1, pos, 2 /* Side.After */); }\n childBefore(pos) { return this.child(-1, pos, -2 /* Side.Before */); }\n enter(pos, side, mode = 0) {\n if (mode & IterMode.ExcludeBuffers)\n return null;\n let { buffer } = this.context;\n let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], side > 0 ? 1 : -1, pos - this.context.start, side);\n return index < 0 ? null : new BufferNode(this.context, this, index);\n }\n get parent() {\n return this._parent || this.context.parent.nextSignificantParent();\n }\n externalSibling(dir) {\n return this._parent ? null : this.context.parent.nextChild(this.context.index + dir, dir, 0, 4 /* Side.DontCare */);\n }\n get nextSibling() {\n let { buffer } = this.context;\n let after = buffer.buffer[this.index + 3];\n if (after < (this._parent ? buffer.buffer[this._parent.index + 3] : buffer.buffer.length))\n return new BufferNode(this.context, this._parent, after);\n return this.externalSibling(1);\n }\n get prevSibling() {\n let { buffer } = this.context;\n let parentStart = this._parent ? this._parent.index + 4 : 0;\n if (this.index == parentStart)\n return this.externalSibling(-1);\n return new BufferNode(this.context, this._parent, buffer.findChild(parentStart, this.index, -1, 0, 4 /* Side.DontCare */));\n }\n get tree() { return null; }\n toTree() {\n let children = [], positions = [];\n let { buffer } = this.context;\n let startI = this.index + 4, endI = buffer.buffer[this.index + 3];\n if (endI > startI) {\n let from = buffer.buffer[this.index + 1];\n children.push(buffer.slice(startI, endI, from));\n positions.push(0);\n }\n return new Tree(this.type, children, positions, this.to - this.from);\n }\n /**\n @internal\n */\n toString() { return this.context.buffer.childString(this.index); }\n }\n function iterStack(heads) {\n if (!heads.length)\n return null;\n let pick = 0, picked = heads[0];\n for (let i = 1; i < heads.length; i++) {\n let node = heads[i];\n if (node.from > picked.from || node.to < picked.to) {\n picked = node;\n pick = i;\n }\n }\n let next = picked instanceof TreeNode && picked.index < 0 ? null : picked.parent;\n let newHeads = heads.slice();\n if (next)\n newHeads[pick] = next;\n else\n newHeads.splice(pick, 1);\n return new StackIterator(newHeads, picked);\n }\n class StackIterator {\n constructor(heads, node) {\n this.heads = heads;\n this.node = node;\n }\n get next() { return iterStack(this.heads); }\n }\n function stackIterator(tree, pos, side) {\n let inner = tree.resolveInner(pos, side), layers = null;\n for (let scan = inner instanceof TreeNode ? inner : inner.context.parent; scan; scan = scan.parent) {\n if (scan.index < 0) { // This is an overlay root\n let parent = scan.parent;\n (layers || (layers = [inner])).push(parent.resolve(pos, side));\n scan = parent;\n }\n else {\n let mount = MountedTree.get(scan.tree);\n // Relevant overlay branching off\n if (mount && mount.overlay && mount.overlay[0].from <= pos && mount.overlay[mount.overlay.length - 1].to >= pos) {\n let root = new TreeNode(mount.tree, mount.overlay[0].from + scan.from, -1, scan);\n (layers || (layers = [inner])).push(resolveNode$1(root, pos, side, false));\n }\n }\n }\n return layers ? iterStack(layers) : inner;\n }\n /**\n A tree cursor object focuses on a given node in a syntax tree, and\n allows you to move to adjacent nodes.\n */\n class TreeCursor {\n /**\n Shorthand for `.type.name`.\n */\n get name() { return this.type.name; }\n /**\n @internal\n */\n constructor(node, \n /**\n @internal\n */\n mode = 0) {\n this.mode = mode;\n /**\n @internal\n */\n this.buffer = null;\n this.stack = [];\n /**\n @internal\n */\n this.index = 0;\n this.bufferNode = null;\n if (node instanceof TreeNode) {\n this.yieldNode(node);\n }\n else {\n this._tree = node.context.parent;\n this.buffer = node.context;\n for (let n = node._parent; n; n = n._parent)\n this.stack.unshift(n.index);\n this.bufferNode = node;\n this.yieldBuf(node.index);\n }\n }\n yieldNode(node) {\n if (!node)\n return false;\n this._tree = node;\n this.type = node.type;\n this.from = node.from;\n this.to = node.to;\n return true;\n }\n yieldBuf(index, type) {\n this.index = index;\n let { start, buffer } = this.buffer;\n this.type = type || buffer.set.types[buffer.buffer[index]];\n this.from = start + buffer.buffer[index + 1];\n this.to = start + buffer.buffer[index + 2];\n return true;\n }\n /**\n @internal\n */\n yield(node) {\n if (!node)\n return false;\n if (node instanceof TreeNode) {\n this.buffer = null;\n return this.yieldNode(node);\n }\n this.buffer = node.context;\n return this.yieldBuf(node.index, node.type);\n }\n /**\n @internal\n */\n toString() {\n return this.buffer ? this.buffer.buffer.childString(this.index) : this._tree.toString();\n }\n /**\n @internal\n */\n enterChild(dir, pos, side) {\n if (!this.buffer)\n return this.yield(this._tree.nextChild(dir < 0 ? this._tree._tree.children.length - 1 : 0, dir, pos, side, this.mode));\n let { buffer } = this.buffer;\n let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], dir, pos - this.buffer.start, side);\n if (index < 0)\n return false;\n this.stack.push(this.index);\n return this.yieldBuf(index);\n }\n /**\n Move the cursor to this node's first child. When this returns\n false, the node has no child, and the cursor has not been moved.\n */\n firstChild() { return this.enterChild(1, 0, 4 /* Side.DontCare */); }\n /**\n Move the cursor to this node's last child.\n */\n lastChild() { return this.enterChild(-1, 0, 4 /* Side.DontCare */); }\n /**\n Move the cursor to the first child that ends after `pos`.\n */\n childAfter(pos) { return this.enterChild(1, pos, 2 /* Side.After */); }\n /**\n Move to the last child that starts before `pos`.\n */\n childBefore(pos) { return this.enterChild(-1, pos, -2 /* Side.Before */); }\n /**\n Move the cursor to the child around `pos`. If side is -1 the\n child may end at that position, when 1 it may start there. This\n will also enter [overlaid](#common.MountedTree.overlay)\n [mounted](#common.NodeProp^mounted) trees unless `overlays` is\n set to false.\n */\n enter(pos, side, mode = this.mode) {\n if (!this.buffer)\n return this.yield(this._tree.enter(pos, side, mode));\n return mode & IterMode.ExcludeBuffers ? false : this.enterChild(1, pos, side);\n }\n /**\n Move to the node's parent node, if this isn't the top node.\n */\n parent() {\n if (!this.buffer)\n return this.yieldNode((this.mode & IterMode.IncludeAnonymous) ? this._tree._parent : this._tree.parent);\n if (this.stack.length)\n return this.yieldBuf(this.stack.pop());\n let parent = (this.mode & IterMode.IncludeAnonymous) ? this.buffer.parent : this.buffer.parent.nextSignificantParent();\n this.buffer = null;\n return this.yieldNode(parent);\n }\n /**\n @internal\n */\n sibling(dir) {\n if (!this.buffer)\n return !this._tree._parent ? false\n : this.yield(this._tree.index < 0 ? null\n : this._tree._parent.nextChild(this._tree.index + dir, dir, 0, 4 /* Side.DontCare */, this.mode));\n let { buffer } = this.buffer, d = this.stack.length - 1;\n if (dir < 0) {\n let parentStart = d < 0 ? 0 : this.stack[d] + 4;\n if (this.index != parentStart)\n return this.yieldBuf(buffer.findChild(parentStart, this.index, -1, 0, 4 /* Side.DontCare */));\n }\n else {\n let after = buffer.buffer[this.index + 3];\n if (after < (d < 0 ? buffer.buffer.length : buffer.buffer[this.stack[d] + 3]))\n return this.yieldBuf(after);\n }\n return d < 0 ? this.yield(this.buffer.parent.nextChild(this.buffer.index + dir, dir, 0, 4 /* Side.DontCare */, this.mode)) : false;\n }\n /**\n Move to this node's next sibling, if any.\n */\n nextSibling() { return this.sibling(1); }\n /**\n Move to this node's previous sibling, if any.\n */\n prevSibling() { return this.sibling(-1); }\n atLastNode(dir) {\n let index, parent, { buffer } = this;\n if (buffer) {\n if (dir > 0) {\n if (this.index < buffer.buffer.buffer.length)\n return false;\n }\n else {\n for (let i = 0; i < this.index; i++)\n if (buffer.buffer.buffer[i + 3] < this.index)\n return false;\n }\n ({ index, parent } = buffer);\n }\n else {\n ({ index, _parent: parent } = this._tree);\n }\n for (; parent; { index, _parent: parent } = parent) {\n if (index > -1)\n for (let i = index + dir, e = dir < 0 ? -1 : parent._tree.children.length; i != e; i += dir) {\n let child = parent._tree.children[i];\n if ((this.mode & IterMode.IncludeAnonymous) ||\n child instanceof TreeBuffer ||\n !child.type.isAnonymous ||\n hasChild(child))\n return false;\n }\n }\n return true;\n }\n move(dir, enter) {\n if (enter && this.enterChild(dir, 0, 4 /* Side.DontCare */))\n return true;\n for (;;) {\n if (this.sibling(dir))\n return true;\n if (this.atLastNode(dir) || !this.parent())\n return false;\n }\n }\n /**\n Move to the next node in a\n [pre-order](https://en.wikipedia.org/wiki/Tree_traversal#Pre-order,_NLR)\n traversal, going from a node to its first child or, if the\n current node is empty or `enter` is false, its next sibling or\n the next sibling of the first parent node that has one.\n */\n next(enter = true) { return this.move(1, enter); }\n /**\n Move to the next node in a last-to-first pre-order traveral. A\n node is followed by its last child or, if it has none, its\n previous sibling or the previous sibling of the first parent\n node that has one.\n */\n prev(enter = true) { return this.move(-1, enter); }\n /**\n Move the cursor to the innermost node that covers `pos`. If\n `side` is -1, it will enter nodes that end at `pos`. If it is 1,\n it will enter nodes that start at `pos`.\n */\n moveTo(pos, side = 0) {\n // Move up to a node that actually holds the position, if possible\n while (this.from == this.to ||\n (side < 1 ? this.from >= pos : this.from > pos) ||\n (side > -1 ? this.to <= pos : this.to < pos))\n if (!this.parent())\n break;\n // Then scan down into child nodes as far as possible\n while (this.enterChild(1, pos, side)) { }\n return this;\n }\n /**\n Get a [syntax node](#common.SyntaxNode) at the cursor's current\n position.\n */\n get node() {\n if (!this.buffer)\n return this._tree;\n let cache = this.bufferNode, result = null, depth = 0;\n if (cache && cache.context == this.buffer) {\n scan: for (let index = this.index, d = this.stack.length; d >= 0;) {\n for (let c = cache; c; c = c._parent)\n if (c.index == index) {\n if (index == this.index)\n return c;\n result = c;\n depth = d + 1;\n break scan;\n }\n index = this.stack[--d];\n }\n }\n for (let i = depth; i < this.stack.length; i++)\n result = new BufferNode(this.buffer, result, this.stack[i]);\n return this.bufferNode = new BufferNode(this.buffer, result, this.index);\n }\n /**\n Get the [tree](#common.Tree) that represents the current node, if\n any. Will return null when the node is in a [tree\n buffer](#common.TreeBuffer).\n */\n get tree() {\n return this.buffer ? null : this._tree._tree;\n }\n /**\n Iterate over the current node and all its descendants, calling\n `enter` when entering a node and `leave`, if given, when leaving\n one. When `enter` returns `false`, any children of that node are\n skipped, and `leave` isn't called for it.\n */\n iterate(enter, leave) {\n for (let depth = 0;;) {\n let mustLeave = false;\n if (this.type.isAnonymous || enter(this) !== false) {\n if (this.firstChild()) {\n depth++;\n continue;\n }\n if (!this.type.isAnonymous)\n mustLeave = true;\n }\n for (;;) {\n if (mustLeave && leave)\n leave(this);\n mustLeave = this.type.isAnonymous;\n if (this.nextSibling())\n break;\n if (!depth)\n return;\n this.parent();\n depth--;\n mustLeave = true;\n }\n }\n }\n /**\n Test whether the current node matches a given context\u2014a sequence\n of direct parent node names. Empty strings in the context array\n are treated as wildcards.\n */\n matchContext(context) {\n if (!this.buffer)\n return matchNodeContext(this.node, context);\n let { buffer } = this.buffer, { types } = buffer.set;\n for (let i = context.length - 1, d = this.stack.length - 1; i >= 0; d--) {\n if (d < 0)\n return matchNodeContext(this.node, context, i);\n let type = types[buffer.buffer[this.stack[d]]];\n if (!type.isAnonymous) {\n if (context[i] && context[i] != type.name)\n return false;\n i--;\n }\n }\n return true;\n }\n }\n function hasChild(tree) {\n return tree.children.some(ch => ch instanceof TreeBuffer || !ch.type.isAnonymous || hasChild(ch));\n }\n function buildTree(data) {\n var _a;\n let { buffer, nodeSet, maxBufferLength = DefaultBufferLength, reused = [], minRepeatType = nodeSet.types.length } = data;\n let cursor = Array.isArray(buffer) ? new FlatBufferCursor(buffer, buffer.length) : buffer;\n let types = nodeSet.types;\n let contextHash = 0, lookAhead = 0;\n function takeNode(parentStart, minPos, children, positions, inRepeat, depth) {\n let { id, start, end, size } = cursor;\n let lookAheadAtStart = lookAhead;\n while (size < 0) {\n cursor.next();\n if (size == -1 /* SpecialRecord.Reuse */) {\n let node = reused[id];\n children.push(node);\n positions.push(start - parentStart);\n return;\n }\n else if (size == -3 /* SpecialRecord.ContextChange */) { // Context change\n contextHash = id;\n return;\n }\n else if (size == -4 /* SpecialRecord.LookAhead */) {\n lookAhead = id;\n return;\n }\n else {\n throw new RangeError(`Unrecognized record size: ${size}`);\n }\n }\n let type = types[id], node, buffer;\n let startPos = start - parentStart;\n if (end - start <= maxBufferLength && (buffer = findBufferSize(cursor.pos - minPos, inRepeat))) {\n // Small enough for a buffer, and no reused nodes inside\n let data = new Uint16Array(buffer.size - buffer.skip);\n let endPos = cursor.pos - buffer.size, index = data.length;\n while (cursor.pos > endPos)\n index = copyToBuffer(buffer.start, data, index);\n node = new TreeBuffer(data, end - buffer.start, nodeSet);\n startPos = buffer.start - parentStart;\n }\n else { // Make it a node\n let endPos = cursor.pos - size;\n cursor.next();\n let localChildren = [], localPositions = [];\n let localInRepeat = id >= minRepeatType ? id : -1;\n let lastGroup = 0, lastEnd = end;\n while (cursor.pos > endPos) {\n if (localInRepeat >= 0 && cursor.id == localInRepeat && cursor.size >= 0) {\n if (cursor.end <= lastEnd - maxBufferLength) {\n makeRepeatLeaf(localChildren, localPositions, start, lastGroup, cursor.end, lastEnd, localInRepeat, lookAheadAtStart);\n lastGroup = localChildren.length;\n lastEnd = cursor.end;\n }\n cursor.next();\n }\n else if (depth > 2500 /* CutOff.Depth */) {\n takeFlatNode(start, endPos, localChildren, localPositions);\n }\n else {\n takeNode(start, endPos, localChildren, localPositions, localInRepeat, depth + 1);\n }\n }\n if (localInRepeat >= 0 && lastGroup > 0 && lastGroup < localChildren.length)\n makeRepeatLeaf(localChildren, localPositions, start, lastGroup, start, lastEnd, localInRepeat, lookAheadAtStart);\n localChildren.reverse();\n localPositions.reverse();\n if (localInRepeat > -1 && lastGroup > 0) {\n let make = makeBalanced(type);\n node = balanceRange(type, localChildren, localPositions, 0, localChildren.length, 0, end - start, make, make);\n }\n else {\n node = makeTree(type, localChildren, localPositions, end - start, lookAheadAtStart - end);\n }\n }\n children.push(node);\n positions.push(startPos);\n }\n function takeFlatNode(parentStart, minPos, children, positions) {\n let nodes = []; // Temporary, inverted array of leaf nodes found, with absolute positions\n let nodeCount = 0, stopAt = -1;\n while (cursor.pos > minPos) {\n let { id, start, end, size } = cursor;\n if (size > 4) { // Not a leaf\n cursor.next();\n }\n else if (stopAt > -1 && start < stopAt) {\n break;\n }\n else {\n if (stopAt < 0)\n stopAt = end - maxBufferLength;\n nodes.push(id, start, end);\n nodeCount++;\n cursor.next();\n }\n }\n if (nodeCount) {\n let buffer = new Uint16Array(nodeCount * 4);\n let start = nodes[nodes.length - 2];\n for (let i = nodes.length - 3, j = 0; i >= 0; i -= 3) {\n buffer[j++] = nodes[i];\n buffer[j++] = nodes[i + 1] - start;\n buffer[j++] = nodes[i + 2] - start;\n buffer[j++] = j;\n }\n children.push(new TreeBuffer(buffer, nodes[2] - start, nodeSet));\n positions.push(start - parentStart);\n }\n }\n function makeBalanced(type) {\n return (children, positions, length) => {\n let lookAhead = 0, lastI = children.length - 1, last, lookAheadProp;\n if (lastI >= 0 && (last = children[lastI]) instanceof Tree) {\n if (!lastI && last.type == type && last.length == length)\n return last;\n if (lookAheadProp = last.prop(NodeProp.lookAhead))\n lookAhead = positions[lastI] + last.length + lookAheadProp;\n }\n return makeTree(type, children, positions, length, lookAhead);\n };\n }\n function makeRepeatLeaf(children, positions, base, i, from, to, type, lookAhead) {\n let localChildren = [], localPositions = [];\n while (children.length > i) {\n localChildren.push(children.pop());\n localPositions.push(positions.pop() + base - from);\n }\n children.push(makeTree(nodeSet.types[type], localChildren, localPositions, to - from, lookAhead - to));\n positions.push(from - base);\n }\n function makeTree(type, children, positions, length, lookAhead = 0, props) {\n if (contextHash) {\n let pair = [NodeProp.contextHash, contextHash];\n props = props ? [pair].concat(props) : [pair];\n }\n if (lookAhead > 25) {\n let pair = [NodeProp.lookAhead, lookAhead];\n props = props ? [pair].concat(props) : [pair];\n }\n return new Tree(type, children, positions, length, props);\n }\n function findBufferSize(maxSize, inRepeat) {\n // Scan through the buffer to find previous siblings that fit\n // together in a TreeBuffer, and don't contain any reused nodes\n // (which can't be stored in a buffer).\n // If `inRepeat` is > -1, ignore node boundaries of that type for\n // nesting, but make sure the end falls either at the start\n // (`maxSize`) or before such a node.\n let fork = cursor.fork();\n let size = 0, start = 0, skip = 0, minStart = fork.end - maxBufferLength;\n let result = { size: 0, start: 0, skip: 0 };\n scan: for (let minPos = fork.pos - maxSize; fork.pos > minPos;) {\n let nodeSize = fork.size;\n // Pretend nested repeat nodes of the same type don't exist\n if (fork.id == inRepeat && nodeSize >= 0) {\n // Except that we store the current state as a valid return\n // value.\n result.size = size;\n result.start = start;\n result.skip = skip;\n skip += 4;\n size += 4;\n fork.next();\n continue;\n }\n let startPos = fork.pos - nodeSize;\n if (nodeSize < 0 || startPos < minPos || fork.start < minStart)\n break;\n let localSkipped = fork.id >= minRepeatType ? 4 : 0;\n let nodeStart = fork.start;\n fork.next();\n while (fork.pos > startPos) {\n if (fork.size < 0) {\n if (fork.size == -3 /* SpecialRecord.ContextChange */)\n localSkipped += 4;\n else\n break scan;\n }\n else if (fork.id >= minRepeatType) {\n localSkipped += 4;\n }\n fork.next();\n }\n start = nodeStart;\n size += nodeSize;\n skip += localSkipped;\n }\n if (inRepeat < 0 || size == maxSize) {\n result.size = size;\n result.start = start;\n result.skip = skip;\n }\n return result.size > 4 ? result : undefined;\n }\n function copyToBuffer(bufferStart, buffer, index) {\n let { id, start, end, size } = cursor;\n cursor.next();\n if (size >= 0 && id < minRepeatType) {\n let startIndex = index;\n if (size > 4) {\n let endPos = cursor.pos - (size - 4);\n while (cursor.pos > endPos)\n index = copyToBuffer(bufferStart, buffer, index);\n }\n buffer[--index] = startIndex;\n buffer[--index] = end - bufferStart;\n buffer[--index] = start - bufferStart;\n buffer[--index] = id;\n }\n else if (size == -3 /* SpecialRecord.ContextChange */) {\n contextHash = id;\n }\n else if (size == -4 /* SpecialRecord.LookAhead */) {\n lookAhead = id;\n }\n return index;\n }\n let children = [], positions = [];\n while (cursor.pos > 0)\n takeNode(data.start || 0, data.bufferStart || 0, children, positions, -1, 0);\n let length = (_a = data.length) !== null && _a !== void 0 ? _a : (children.length ? positions[0] + children[0].length : 0);\n return new Tree(types[data.topID], children.reverse(), positions.reverse(), length);\n }\n const nodeSizeCache = new WeakMap;\n function nodeSize(balanceType, node) {\n if (!balanceType.isAnonymous || node instanceof TreeBuffer || node.type != balanceType)\n return 1;\n let size = nodeSizeCache.get(node);\n if (size == null) {\n size = 1;\n for (let child of node.children) {\n if (child.type != balanceType || !(child instanceof Tree)) {\n size = 1;\n break;\n }\n size += nodeSize(balanceType, child);\n }\n nodeSizeCache.set(node, size);\n }\n return size;\n }\n function balanceRange(\n // The type the balanced tree's inner nodes.\n balanceType, \n // The direct children and their positions\n children, positions, \n // The index range in children/positions to use\n from, to, \n // The start position of the nodes, relative to their parent.\n start, \n // Length of the outer node\n length, \n // Function to build the top node of the balanced tree\n mkTop, \n // Function to build internal nodes for the balanced tree\n mkTree) {\n let total = 0;\n for (let i = from; i < to; i++)\n total += nodeSize(balanceType, children[i]);\n let maxChild = Math.ceil((total * 1.5) / 8 /* Balance.BranchFactor */);\n let localChildren = [], localPositions = [];\n function divide(children, positions, from, to, offset) {\n for (let i = from; i < to;) {\n let groupFrom = i, groupStart = positions[i], groupSize = nodeSize(balanceType, children[i]);\n i++;\n for (; i < to; i++) {\n let nextSize = nodeSize(balanceType, children[i]);\n if (groupSize + nextSize >= maxChild)\n break;\n groupSize += nextSize;\n }\n if (i == groupFrom + 1) {\n if (groupSize > maxChild) {\n let only = children[groupFrom]; // Only trees can have a size > 1\n divide(only.children, only.positions, 0, only.children.length, positions[groupFrom] + offset);\n continue;\n }\n localChildren.push(children[groupFrom]);\n }\n else {\n let length = positions[i - 1] + children[i - 1].length - groupStart;\n localChildren.push(balanceRange(balanceType, children, positions, groupFrom, i, groupStart, length, null, mkTree));\n }\n localPositions.push(groupStart + offset - start);\n }\n }\n divide(children, positions, from, to, 0);\n return (mkTop || mkTree)(localChildren, localPositions, length);\n }\n /**\n Provides a way to associate values with pieces of trees. As long\n as that part of the tree is reused, the associated values can be\n retrieved from an updated tree.\n */\n class NodeWeakMap {\n constructor() {\n this.map = new WeakMap();\n }\n setBuffer(buffer, index, value) {\n let inner = this.map.get(buffer);\n if (!inner)\n this.map.set(buffer, inner = new Map);\n inner.set(index, value);\n }\n getBuffer(buffer, index) {\n let inner = this.map.get(buffer);\n return inner && inner.get(index);\n }\n /**\n Set the value for this syntax node.\n */\n set(node, value) {\n if (node instanceof BufferNode)\n this.setBuffer(node.context.buffer, node.index, value);\n else if (node instanceof TreeNode)\n this.map.set(node.tree, value);\n }\n /**\n Retrieve value for this syntax node, if it exists in the map.\n */\n get(node) {\n return node instanceof BufferNode ? this.getBuffer(node.context.buffer, node.index)\n : node instanceof TreeNode ? this.map.get(node.tree) : undefined;\n }\n /**\n Set the value for the node that a cursor currently points to.\n */\n cursorSet(cursor, value) {\n if (cursor.buffer)\n this.setBuffer(cursor.buffer.buffer, cursor.index, value);\n else\n this.map.set(cursor.tree, value);\n }\n /**\n Retrieve the value for the node that a cursor currently points\n to.\n */\n cursorGet(cursor) {\n return cursor.buffer ? this.getBuffer(cursor.buffer.buffer, cursor.index) : this.map.get(cursor.tree);\n }\n }\n\n /**\n Tree fragments are used during [incremental\n parsing](#common.Parser.startParse) to track parts of old trees\n that can be reused in a new parse. An array of fragments is used\n to track regions of an old tree whose nodes might be reused in new\n parses. Use the static\n [`applyChanges`](#common.TreeFragment^applyChanges) method to\n update fragments for document changes.\n */\n class TreeFragment {\n /**\n Construct a tree fragment. You'll usually want to use\n [`addTree`](#common.TreeFragment^addTree) and\n [`applyChanges`](#common.TreeFragment^applyChanges) instead of\n calling this directly.\n */\n constructor(\n /**\n The start of the unchanged range pointed to by this fragment.\n This refers to an offset in the _updated_ document (as opposed\n to the original tree).\n */\n from, \n /**\n The end of the unchanged range.\n */\n to, \n /**\n The tree that this fragment is based on.\n */\n tree, \n /**\n The offset between the fragment's tree and the document that\n this fragment can be used against. Add this when going from\n document to tree positions, subtract it to go from tree to\n document positions.\n */\n offset, openStart = false, openEnd = false) {\n this.from = from;\n this.to = to;\n this.tree = tree;\n this.offset = offset;\n this.open = (openStart ? 1 /* Open.Start */ : 0) | (openEnd ? 2 /* Open.End */ : 0);\n }\n /**\n Whether the start of the fragment represents the start of a\n parse, or the end of a change. (In the second case, it may not\n be safe to reuse some nodes at the start, depending on the\n parsing algorithm.)\n */\n get openStart() { return (this.open & 1 /* Open.Start */) > 0; }\n /**\n Whether the end of the fragment represents the end of a\n full-document parse, or the start of a change.\n */\n get openEnd() { return (this.open & 2 /* Open.End */) > 0; }\n /**\n Create a set of fragments from a freshly parsed tree, or update\n an existing set of fragments by replacing the ones that overlap\n with a tree with content from the new tree. When `partial` is\n true, the parse is treated as incomplete, and the resulting\n fragment has [`openEnd`](#common.TreeFragment.openEnd) set to\n true.\n */\n static addTree(tree, fragments = [], partial = false) {\n let result = [new TreeFragment(0, tree.length, tree, 0, false, partial)];\n for (let f of fragments)\n if (f.to > tree.length)\n result.push(f);\n return result;\n }\n /**\n Apply a set of edits to an array of fragments, removing or\n splitting fragments as necessary to remove edited ranges, and\n adjusting offsets for fragments that moved.\n */\n static applyChanges(fragments, changes, minGap = 128) {\n if (!changes.length)\n return fragments;\n let result = [];\n let fI = 1, nextF = fragments.length ? fragments[0] : null;\n for (let cI = 0, pos = 0, off = 0;; cI++) {\n let nextC = cI < changes.length ? changes[cI] : null;\n let nextPos = nextC ? nextC.fromA : 1e9;\n if (nextPos - pos >= minGap)\n while (nextF && nextF.from < nextPos) {\n let cut = nextF;\n if (pos >= cut.from || nextPos <= cut.to || off) {\n let fFrom = Math.max(cut.from, pos) - off, fTo = Math.min(cut.to, nextPos) - off;\n cut = fFrom >= fTo ? null : new TreeFragment(fFrom, fTo, cut.tree, cut.offset + off, cI > 0, !!nextC);\n }\n if (cut)\n result.push(cut);\n if (nextF.to > nextPos)\n break;\n nextF = fI < fragments.length ? fragments[fI++] : null;\n }\n if (!nextC)\n break;\n pos = nextC.toA;\n off = nextC.toA - nextC.toB;\n }\n return result;\n }\n }\n /**\n A superclass that parsers should extend.\n */\n class Parser {\n /**\n Start a parse, returning a [partial parse](#common.PartialParse)\n object. [`fragments`](#common.TreeFragment) can be passed in to\n make the parse incremental.\n \n By default, the entire input is parsed. You can pass `ranges`,\n which should be a sorted array of non-empty, non-overlapping\n ranges, to parse only those ranges. The tree returned in that\n case will start at `ranges[0].from`.\n */\n startParse(input, fragments, ranges) {\n if (typeof input == \"string\")\n input = new StringInput(input);\n ranges = !ranges ? [new Range(0, input.length)] : ranges.length ? ranges.map(r => new Range(r.from, r.to)) : [new Range(0, 0)];\n return this.createParse(input, fragments || [], ranges);\n }\n /**\n Run a full parse, returning the resulting tree.\n */\n parse(input, fragments, ranges) {\n let parse = this.startParse(input, fragments, ranges);\n for (;;) {\n let done = parse.advance();\n if (done)\n return done;\n }\n }\n }\n class StringInput {\n constructor(string) {\n this.string = string;\n }\n get length() { return this.string.length; }\n chunk(from) { return this.string.slice(from); }\n get lineChunks() { return false; }\n read(from, to) { return this.string.slice(from, to); }\n }\n\n /**\n Create a parse wrapper that, after the inner parse completes,\n scans its tree for mixed language regions with the `nest`\n function, runs the resulting [inner parses](#common.NestedParse),\n and then [mounts](#common.NodeProp^mounted) their results onto the\n tree.\n */\n function parseMixed(nest) {\n return (parse, input, fragments, ranges) => new MixedParse(parse, nest, input, fragments, ranges);\n }\n class InnerParse {\n constructor(parser, parse, overlay, target, from) {\n this.parser = parser;\n this.parse = parse;\n this.overlay = overlay;\n this.target = target;\n this.from = from;\n }\n }\n function checkRanges(ranges) {\n if (!ranges.length || ranges.some(r => r.from >= r.to))\n throw new RangeError(\"Invalid inner parse ranges given: \" + JSON.stringify(ranges));\n }\n class ActiveOverlay {\n constructor(parser, predicate, mounts, index, start, target, prev) {\n this.parser = parser;\n this.predicate = predicate;\n this.mounts = mounts;\n this.index = index;\n this.start = start;\n this.target = target;\n this.prev = prev;\n this.depth = 0;\n this.ranges = [];\n }\n }\n const stoppedInner = new NodeProp({ perNode: true });\n class MixedParse {\n constructor(base, nest, input, fragments, ranges) {\n this.nest = nest;\n this.input = input;\n this.fragments = fragments;\n this.ranges = ranges;\n this.inner = [];\n this.innerDone = 0;\n this.baseTree = null;\n this.stoppedAt = null;\n this.baseParse = base;\n }\n advance() {\n if (this.baseParse) {\n let done = this.baseParse.advance();\n if (!done)\n return null;\n this.baseParse = null;\n this.baseTree = done;\n this.startInner();\n if (this.stoppedAt != null)\n for (let inner of this.inner)\n inner.parse.stopAt(this.stoppedAt);\n }\n if (this.innerDone == this.inner.length) {\n let result = this.baseTree;\n if (this.stoppedAt != null)\n result = new Tree(result.type, result.children, result.positions, result.length, result.propValues.concat([[stoppedInner, this.stoppedAt]]));\n return result;\n }\n let inner = this.inner[this.innerDone], done = inner.parse.advance();\n if (done) {\n this.innerDone++;\n // This is a somewhat dodgy but super helpful hack where we\n // patch up nodes created by the inner parse (and thus\n // presumably not aliased anywhere else) to hold the information\n // about the inner parse.\n let props = Object.assign(Object.create(null), inner.target.props);\n props[NodeProp.mounted.id] = new MountedTree(done, inner.overlay, inner.parser);\n inner.target.props = props;\n }\n return null;\n }\n get parsedPos() {\n if (this.baseParse)\n return 0;\n let pos = this.input.length;\n for (let i = this.innerDone; i < this.inner.length; i++) {\n if (this.inner[i].from < pos)\n pos = Math.min(pos, this.inner[i].parse.parsedPos);\n }\n return pos;\n }\n stopAt(pos) {\n this.stoppedAt = pos;\n if (this.baseParse)\n this.baseParse.stopAt(pos);\n else\n for (let i = this.innerDone; i < this.inner.length; i++)\n this.inner[i].parse.stopAt(pos);\n }\n startInner() {\n let fragmentCursor = new FragmentCursor$2(this.fragments);\n let overlay = null;\n let covered = null;\n let cursor = new TreeCursor(new TreeNode(this.baseTree, this.ranges[0].from, 0, null), IterMode.IncludeAnonymous | IterMode.IgnoreMounts);\n scan: for (let nest, isCovered;;) {\n let enter = true, range;\n if (this.stoppedAt != null && cursor.from >= this.stoppedAt) {\n enter = false;\n }\n else if (fragmentCursor.hasNode(cursor)) {\n if (overlay) {\n let match = overlay.mounts.find(m => m.frag.from <= cursor.from && m.frag.to >= cursor.to && m.mount.overlay);\n if (match)\n for (let r of match.mount.overlay) {\n let from = r.from + match.pos, to = r.to + match.pos;\n if (from >= cursor.from && to <= cursor.to && !overlay.ranges.some(r => r.from < to && r.to > from))\n overlay.ranges.push({ from, to });\n }\n }\n enter = false;\n }\n else if (covered && (isCovered = checkCover(covered.ranges, cursor.from, cursor.to))) {\n enter = isCovered != 2 /* Cover.Full */;\n }\n else if (!cursor.type.isAnonymous && (nest = this.nest(cursor, this.input)) &&\n (cursor.from < cursor.to || !nest.overlay)) {\n if (!cursor.tree)\n materialize(cursor);\n let oldMounts = fragmentCursor.findMounts(cursor.from, nest.parser);\n if (typeof nest.overlay == \"function\") {\n overlay = new ActiveOverlay(nest.parser, nest.overlay, oldMounts, this.inner.length, cursor.from, cursor.tree, overlay);\n }\n else {\n let ranges = punchRanges(this.ranges, nest.overlay ||\n (cursor.from < cursor.to ? [new Range(cursor.from, cursor.to)] : []));\n if (ranges.length)\n checkRanges(ranges);\n if (ranges.length || !nest.overlay)\n this.inner.push(new InnerParse(nest.parser, ranges.length ? nest.parser.startParse(this.input, enterFragments(oldMounts, ranges), ranges)\n : nest.parser.startParse(\"\"), nest.overlay ? nest.overlay.map(r => new Range(r.from - cursor.from, r.to - cursor.from)) : null, cursor.tree, ranges.length ? ranges[0].from : cursor.from));\n if (!nest.overlay)\n enter = false;\n else if (ranges.length)\n covered = { ranges, depth: 0, prev: covered };\n }\n }\n else if (overlay && (range = overlay.predicate(cursor))) {\n if (range === true)\n range = new Range(cursor.from, cursor.to);\n if (range.from < range.to)\n overlay.ranges.push(range);\n }\n if (enter && cursor.firstChild()) {\n if (overlay)\n overlay.depth++;\n if (covered)\n covered.depth++;\n }\n else {\n for (;;) {\n if (cursor.nextSibling())\n break;\n if (!cursor.parent())\n break scan;\n if (overlay && !--overlay.depth) {\n let ranges = punchRanges(this.ranges, overlay.ranges);\n if (ranges.length) {\n checkRanges(ranges);\n this.inner.splice(overlay.index, 0, new InnerParse(overlay.parser, overlay.parser.startParse(this.input, enterFragments(overlay.mounts, ranges), ranges), overlay.ranges.map(r => new Range(r.from - overlay.start, r.to - overlay.start)), overlay.target, ranges[0].from));\n }\n overlay = overlay.prev;\n }\n if (covered && !--covered.depth)\n covered = covered.prev;\n }\n }\n }\n }\n }\n function checkCover(covered, from, to) {\n for (let range of covered) {\n if (range.from >= to)\n break;\n if (range.to > from)\n return range.from <= from && range.to >= to ? 2 /* Cover.Full */ : 1 /* Cover.Partial */;\n }\n return 0 /* Cover.None */;\n }\n // Take a piece of buffer and convert it into a stand-alone\n // TreeBuffer.\n function sliceBuf(buf, startI, endI, nodes, positions, off) {\n if (startI < endI) {\n let from = buf.buffer[startI + 1];\n nodes.push(buf.slice(startI, endI, from));\n positions.push(from - off);\n }\n }\n // This function takes a node that's in a buffer, and converts it, and\n // its parent buffer nodes, into a Tree. This is again acting on the\n // assumption that the trees and buffers have been constructed by the\n // parse that was ran via the mix parser, and thus aren't shared with\n // any other code, making violations of the immutability safe.\n function materialize(cursor) {\n let { node } = cursor, stack = [];\n let buffer = node.context.buffer;\n // Scan up to the nearest tree\n do {\n stack.push(cursor.index);\n cursor.parent();\n } while (!cursor.tree);\n // Find the index of the buffer in that tree\n let base = cursor.tree, i = base.children.indexOf(buffer);\n let buf = base.children[i], b = buf.buffer, newStack = [i];\n // Split a level in the buffer, putting the nodes before and after\n // the child that contains `node` into new buffers.\n function split(startI, endI, type, innerOffset, length, stackPos) {\n let targetI = stack[stackPos];\n let children = [], positions = [];\n sliceBuf(buf, startI, targetI, children, positions, innerOffset);\n let from = b[targetI + 1], to = b[targetI + 2];\n newStack.push(children.length);\n let child = stackPos\n ? split(targetI + 4, b[targetI + 3], buf.set.types[b[targetI]], from, to - from, stackPos - 1)\n : node.toTree();\n children.push(child);\n positions.push(from - innerOffset);\n sliceBuf(buf, b[targetI + 3], endI, children, positions, innerOffset);\n return new Tree(type, children, positions, length);\n }\n base.children[i] = split(0, b.length, NodeType.none, 0, buf.length, stack.length - 1);\n // Move the cursor back to the target node\n for (let index of newStack) {\n let tree = cursor.tree.children[index], pos = cursor.tree.positions[index];\n cursor.yield(new TreeNode(tree, pos + cursor.from, index, cursor._tree));\n }\n }\n class StructureCursor {\n constructor(root, offset) {\n this.offset = offset;\n this.done = false;\n this.cursor = root.cursor(IterMode.IncludeAnonymous | IterMode.IgnoreMounts);\n }\n // Move to the first node (in pre-order) that starts at or after `pos`.\n moveTo(pos) {\n let { cursor } = this, p = pos - this.offset;\n while (!this.done && cursor.from < p) {\n if (cursor.to >= pos && cursor.enter(p, 1, IterMode.IgnoreOverlays | IterMode.ExcludeBuffers)) ;\n else if (!cursor.next(false))\n this.done = true;\n }\n }\n hasNode(cursor) {\n this.moveTo(cursor.from);\n if (!this.done && this.cursor.from + this.offset == cursor.from && this.cursor.tree) {\n for (let tree = this.cursor.tree;;) {\n if (tree == cursor.tree)\n return true;\n if (tree.children.length && tree.positions[0] == 0 && tree.children[0] instanceof Tree)\n tree = tree.children[0];\n else\n break;\n }\n }\n return false;\n }\n }\n class FragmentCursor$2 {\n constructor(fragments) {\n var _a;\n this.fragments = fragments;\n this.curTo = 0;\n this.fragI = 0;\n if (fragments.length) {\n let first = this.curFrag = fragments[0];\n this.curTo = (_a = first.tree.prop(stoppedInner)) !== null && _a !== void 0 ? _a : first.to;\n this.inner = new StructureCursor(first.tree, -first.offset);\n }\n else {\n this.curFrag = this.inner = null;\n }\n }\n hasNode(node) {\n while (this.curFrag && node.from >= this.curTo)\n this.nextFrag();\n return this.curFrag && this.curFrag.from <= node.from && this.curTo >= node.to && this.inner.hasNode(node);\n }\n nextFrag() {\n var _a;\n this.fragI++;\n if (this.fragI == this.fragments.length) {\n this.curFrag = this.inner = null;\n }\n else {\n let frag = this.curFrag = this.fragments[this.fragI];\n this.curTo = (_a = frag.tree.prop(stoppedInner)) !== null && _a !== void 0 ? _a : frag.to;\n this.inner = new StructureCursor(frag.tree, -frag.offset);\n }\n }\n findMounts(pos, parser) {\n var _a;\n let result = [];\n if (this.inner) {\n this.inner.cursor.moveTo(pos, 1);\n for (let pos = this.inner.cursor.node; pos; pos = pos.parent) {\n let mount = (_a = pos.tree) === null || _a === void 0 ? void 0 : _a.prop(NodeProp.mounted);\n if (mount && mount.parser == parser) {\n for (let i = this.fragI; i < this.fragments.length; i++) {\n let frag = this.fragments[i];\n if (frag.from >= pos.to)\n break;\n if (frag.tree == this.curFrag.tree)\n result.push({\n frag,\n pos: pos.from - frag.offset,\n mount\n });\n }\n }\n }\n }\n return result;\n }\n }\n function punchRanges(outer, ranges) {\n let copy = null, current = ranges;\n for (let i = 1, j = 0; i < outer.length; i++) {\n let gapFrom = outer[i - 1].to, gapTo = outer[i].from;\n for (; j < current.length; j++) {\n let r = current[j];\n if (r.from >= gapTo)\n break;\n if (r.to <= gapFrom)\n continue;\n if (!copy)\n current = copy = ranges.slice();\n if (r.from < gapFrom) {\n copy[j] = new Range(r.from, gapFrom);\n if (r.to > gapTo)\n copy.splice(j + 1, 0, new Range(gapTo, r.to));\n }\n else if (r.to > gapTo) {\n copy[j--] = new Range(gapTo, r.to);\n }\n else {\n copy.splice(j--, 1);\n }\n }\n }\n return current;\n }\n function findCoverChanges(a, b, from, to) {\n let iA = 0, iB = 0, inA = false, inB = false, pos = -1e9;\n let result = [];\n for (;;) {\n let nextA = iA == a.length ? 1e9 : inA ? a[iA].to : a[iA].from;\n let nextB = iB == b.length ? 1e9 : inB ? b[iB].to : b[iB].from;\n if (inA != inB) {\n let start = Math.max(pos, from), end = Math.min(nextA, nextB, to);\n if (start < end)\n result.push(new Range(start, end));\n }\n pos = Math.min(nextA, nextB);\n if (pos == 1e9)\n break;\n if (nextA == pos) {\n if (!inA)\n inA = true;\n else {\n inA = false;\n iA++;\n }\n }\n if (nextB == pos) {\n if (!inB)\n inB = true;\n else {\n inB = false;\n iB++;\n }\n }\n }\n return result;\n }\n // Given a number of fragments for the outer tree, and a set of ranges\n // to parse, find fragments for inner trees mounted around those\n // ranges, if any.\n function enterFragments(mounts, ranges) {\n let result = [];\n for (let { pos, mount, frag } of mounts) {\n let startPos = pos + (mount.overlay ? mount.overlay[0].from : 0), endPos = startPos + mount.tree.length;\n let from = Math.max(frag.from, startPos), to = Math.min(frag.to, endPos);\n if (mount.overlay) {\n let overlay = mount.overlay.map(r => new Range(r.from + pos, r.to + pos));\n let changes = findCoverChanges(ranges, overlay, from, to);\n for (let i = 0, pos = from;; i++) {\n let last = i == changes.length, end = last ? to : changes[i].from;\n if (end > pos)\n result.push(new TreeFragment(pos, end, mount.tree, -startPos, frag.from >= pos || frag.openStart, frag.to <= end || frag.openEnd));\n if (last)\n break;\n pos = changes[i].to;\n }\n }\n else {\n result.push(new TreeFragment(from, to, mount.tree, -startPos, frag.from >= startPos || frag.openStart, frag.to <= endPos || frag.openEnd));\n }\n }\n return result;\n }\n\n let nextTagID = 0;\n /**\n Highlighting tags are markers that denote a highlighting category.\n They are [associated](#highlight.styleTags) with parts of a syntax\n tree by a language mode, and then mapped to an actual CSS style by\n a [highlighter](#highlight.Highlighter).\n\n Because syntax tree node types and highlight styles have to be\n able to talk the same language, CodeMirror uses a mostly _closed_\n [vocabulary](#highlight.tags) of syntax tags (as opposed to\n traditional open string-based systems, which make it hard for\n highlighting themes to cover all the tokens produced by the\n various languages).\n\n It _is_ possible to [define](#highlight.Tag^define) your own\n highlighting tags for system-internal use (where you control both\n the language package and the highlighter), but such tags will not\n be picked up by regular highlighters (though you can derive them\n from standard tags to allow highlighters to fall back to those).\n */\n class Tag {\n /**\n @internal\n */\n constructor(\n /**\n The set of this tag and all its parent tags, starting with\n this one itself and sorted in order of decreasing specificity.\n */\n set, \n /**\n The base unmodified tag that this one is based on, if it's\n modified @internal\n */\n base, \n /**\n The modifiers applied to this.base @internal\n */\n modified) {\n this.set = set;\n this.base = base;\n this.modified = modified;\n /**\n @internal\n */\n this.id = nextTagID++;\n }\n /**\n Define a new tag. If `parent` is given, the tag is treated as a\n sub-tag of that parent, and\n [highlighters](#highlight.tagHighlighter) that don't mention\n this tag will try to fall back to the parent tag (or grandparent\n tag, etc).\n */\n static define(parent) {\n if (parent === null || parent === void 0 ? void 0 : parent.base)\n throw new Error(\"Can not derive from a modified tag\");\n let tag = new Tag([], null, []);\n tag.set.push(tag);\n if (parent)\n for (let t of parent.set)\n tag.set.push(t);\n return tag;\n }\n /**\n Define a tag _modifier_, which is a function that, given a tag,\n will return a tag that is a subtag of the original. Applying the\n same modifier to a twice tag will return the same value (`m1(t1)\n == m1(t1)`) and applying multiple modifiers will, regardless or\n order, produce the same tag (`m1(m2(t1)) == m2(m1(t1))`).\n \n When multiple modifiers are applied to a given base tag, each\n smaller set of modifiers is registered as a parent, so that for\n example `m1(m2(m3(t1)))` is a subtype of `m1(m2(t1))`,\n `m1(m3(t1)`, and so on.\n */\n static defineModifier() {\n let mod = new Modifier;\n return (tag) => {\n if (tag.modified.indexOf(mod) > -1)\n return tag;\n return Modifier.get(tag.base || tag, tag.modified.concat(mod).sort((a, b) => a.id - b.id));\n };\n }\n }\n let nextModifierID = 0;\n class Modifier {\n constructor() {\n this.instances = [];\n this.id = nextModifierID++;\n }\n static get(base, mods) {\n if (!mods.length)\n return base;\n let exists = mods[0].instances.find(t => t.base == base && sameArray(mods, t.modified));\n if (exists)\n return exists;\n let set = [], tag = new Tag(set, base, mods);\n for (let m of mods)\n m.instances.push(tag);\n let configs = powerSet(mods);\n for (let parent of base.set)\n if (!parent.modified.length)\n for (let config of configs)\n set.push(Modifier.get(parent, config));\n return tag;\n }\n }\n function sameArray(a, b) {\n return a.length == b.length && a.every((x, i) => x == b[i]);\n }\n function powerSet(array) {\n let sets = [[]];\n for (let i = 0; i < array.length; i++) {\n for (let j = 0, e = sets.length; j < e; j++) {\n sets.push(sets[j].concat(array[i]));\n }\n }\n return sets.sort((a, b) => b.length - a.length);\n }\n /**\n This function is used to add a set of tags to a language syntax\n via [`NodeSet.extend`](#common.NodeSet.extend) or\n [`LRParser.configure`](#lr.LRParser.configure).\n\n The argument object maps node selectors to [highlighting\n tags](#highlight.Tag) or arrays of tags.\n\n Node selectors may hold one or more (space-separated) node paths.\n Such a path can be a [node name](#common.NodeType.name), or\n multiple node names (or `*` wildcards) separated by slash\n characters, as in `\"Block/Declaration/VariableName\"`. Such a path\n matches the final node but only if its direct parent nodes are the\n other nodes mentioned. A `*` in such a path matches any parent,\n but only a single level\u2014wildcards that match multiple parents\n aren't supported, both for efficiency reasons and because Lezer\n trees make it rather hard to reason about what they would match.)\n\n A path can be ended with `/...` to indicate that the tag assigned\n to the node should also apply to all child nodes, even if they\n match their own style (by default, only the innermost style is\n used).\n\n When a path ends in `!`, as in `Attribute!`, no further matching\n happens for the node's child nodes, and the entire node gets the\n given style.\n\n In this notation, node names that contain `/`, `!`, `*`, or `...`\n must be quoted as JSON strings.\n\n For example:\n\n ```javascript\n parser.withProps(\n styleTags({\n // Style Number and BigNumber nodes\n \"Number BigNumber\": tags.number,\n // Style Escape nodes whose parent is String\n \"String/Escape\": tags.escape,\n // Style anything inside Attributes nodes\n \"Attributes!\": tags.meta,\n // Add a style to all content inside Italic nodes\n \"Italic/...\": tags.emphasis,\n // Style InvalidString nodes as both `string` and `invalid`\n \"InvalidString\": [tags.string, tags.invalid],\n // Style the node named \"/\" as punctuation\n '\"/\"': tags.punctuation\n })\n )\n ```\n */\n function styleTags(spec) {\n let byName = Object.create(null);\n for (let prop in spec) {\n let tags = spec[prop];\n if (!Array.isArray(tags))\n tags = [tags];\n for (let part of prop.split(\" \"))\n if (part) {\n let pieces = [], mode = 2 /* Mode.Normal */, rest = part;\n for (let pos = 0;;) {\n if (rest == \"...\" && pos > 0 && pos + 3 == part.length) {\n mode = 1 /* Mode.Inherit */;\n break;\n }\n let m = /^\"(?:[^\"\\\\]|\\\\.)*?\"|[^\\/!]+/.exec(rest);\n if (!m)\n throw new RangeError(\"Invalid path: \" + part);\n pieces.push(m[0] == \"*\" ? \"\" : m[0][0] == '\"' ? JSON.parse(m[0]) : m[0]);\n pos += m[0].length;\n if (pos == part.length)\n break;\n let next = part[pos++];\n if (pos == part.length && next == \"!\") {\n mode = 0 /* Mode.Opaque */;\n break;\n }\n if (next != \"/\")\n throw new RangeError(\"Invalid path: \" + part);\n rest = part.slice(pos);\n }\n let last = pieces.length - 1, inner = pieces[last];\n if (!inner)\n throw new RangeError(\"Invalid path: \" + part);\n let rule = new Rule(tags, mode, last > 0 ? pieces.slice(0, last) : null);\n byName[inner] = rule.sort(byName[inner]);\n }\n }\n return ruleNodeProp.add(byName);\n }\n const ruleNodeProp = new NodeProp();\n class Rule {\n constructor(tags, mode, context, next) {\n this.tags = tags;\n this.mode = mode;\n this.context = context;\n this.next = next;\n }\n get opaque() { return this.mode == 0 /* Mode.Opaque */; }\n get inherit() { return this.mode == 1 /* Mode.Inherit */; }\n sort(other) {\n if (!other || other.depth < this.depth) {\n this.next = other;\n return this;\n }\n other.next = this.sort(other.next);\n return other;\n }\n get depth() { return this.context ? this.context.length : 0; }\n }\n Rule.empty = new Rule([], 2 /* Mode.Normal */, null);\n /**\n Define a [highlighter](#highlight.Highlighter) from an array of\n tag/class pairs. Classes associated with more specific tags will\n take precedence.\n */\n function tagHighlighter(tags, options) {\n let map = Object.create(null);\n for (let style of tags) {\n if (!Array.isArray(style.tag))\n map[style.tag.id] = style.class;\n else\n for (let tag of style.tag)\n map[tag.id] = style.class;\n }\n let { scope, all = null } = options || {};\n return {\n style: (tags) => {\n let cls = all;\n for (let tag of tags) {\n for (let sub of tag.set) {\n let tagClass = map[sub.id];\n if (tagClass) {\n cls = cls ? cls + \" \" + tagClass : tagClass;\n break;\n }\n }\n }\n return cls;\n },\n scope\n };\n }\n function highlightTags(highlighters, tags) {\n let result = null;\n for (let highlighter of highlighters) {\n let value = highlighter.style(tags);\n if (value)\n result = result ? result + \" \" + value : value;\n }\n return result;\n }\n /**\n Highlight the given [tree](#common.Tree) with the given\n [highlighter](#highlight.Highlighter). Often, the higher-level\n [`highlightCode`](#highlight.highlightCode) function is easier to\n use.\n */\n function highlightTree(tree, highlighter, \n /**\n Assign styling to a region of the text. Will be called, in order\n of position, for any ranges where more than zero classes apply.\n `classes` is a space separated string of CSS classes.\n */\n putStyle, \n /**\n The start of the range to highlight.\n */\n from = 0, \n /**\n The end of the range.\n */\n to = tree.length) {\n let builder = new HighlightBuilder(from, Array.isArray(highlighter) ? highlighter : [highlighter], putStyle);\n builder.highlightRange(tree.cursor(), from, to, \"\", builder.highlighters);\n builder.flush(to);\n }\n class HighlightBuilder {\n constructor(at, highlighters, span) {\n this.at = at;\n this.highlighters = highlighters;\n this.span = span;\n this.class = \"\";\n }\n startSpan(at, cls) {\n if (cls != this.class) {\n this.flush(at);\n if (at > this.at)\n this.at = at;\n this.class = cls;\n }\n }\n flush(to) {\n if (to > this.at && this.class)\n this.span(this.at, to, this.class);\n }\n highlightRange(cursor, from, to, inheritedClass, highlighters) {\n let { type, from: start, to: end } = cursor;\n if (start >= to || end <= from)\n return;\n if (type.isTop)\n highlighters = this.highlighters.filter(h => !h.scope || h.scope(type));\n let cls = inheritedClass;\n let rule = getStyleTags(cursor) || Rule.empty;\n let tagCls = highlightTags(highlighters, rule.tags);\n if (tagCls) {\n if (cls)\n cls += \" \";\n cls += tagCls;\n if (rule.mode == 1 /* Mode.Inherit */)\n inheritedClass += (inheritedClass ? \" \" : \"\") + tagCls;\n }\n this.startSpan(Math.max(from, start), cls);\n if (rule.opaque)\n return;\n let mounted = cursor.tree && cursor.tree.prop(NodeProp.mounted);\n if (mounted && mounted.overlay) {\n let inner = cursor.node.enter(mounted.overlay[0].from + start, 1);\n let innerHighlighters = this.highlighters.filter(h => !h.scope || h.scope(mounted.tree.type));\n let hasChild = cursor.firstChild();\n for (let i = 0, pos = start;; i++) {\n let next = i < mounted.overlay.length ? mounted.overlay[i] : null;\n let nextPos = next ? next.from + start : end;\n let rangeFrom = Math.max(from, pos), rangeTo = Math.min(to, nextPos);\n if (rangeFrom < rangeTo && hasChild) {\n while (cursor.from < rangeTo) {\n this.highlightRange(cursor, rangeFrom, rangeTo, inheritedClass, highlighters);\n this.startSpan(Math.min(rangeTo, cursor.to), cls);\n if (cursor.to >= nextPos || !cursor.nextSibling())\n break;\n }\n }\n if (!next || nextPos > to)\n break;\n pos = next.to + start;\n if (pos > from) {\n this.highlightRange(inner.cursor(), Math.max(from, next.from + start), Math.min(to, pos), \"\", innerHighlighters);\n this.startSpan(Math.min(to, pos), cls);\n }\n }\n if (hasChild)\n cursor.parent();\n }\n else if (cursor.firstChild()) {\n if (mounted)\n inheritedClass = \"\";\n do {\n if (cursor.to <= from)\n continue;\n if (cursor.from >= to)\n break;\n this.highlightRange(cursor, from, to, inheritedClass, highlighters);\n this.startSpan(Math.min(to, cursor.to), cls);\n } while (cursor.nextSibling());\n cursor.parent();\n }\n }\n }\n /**\n Match a syntax node's [highlight rules](#highlight.styleTags). If\n there's a match, return its set of tags, and whether it is\n opaque (uses a `!`) or applies to all child nodes (`/...`).\n */\n function getStyleTags(node) {\n let rule = node.type.prop(ruleNodeProp);\n while (rule && rule.context && !node.matchContext(rule.context))\n rule = rule.next;\n return rule || null;\n }\n const t = Tag.define;\n const comment = t(), name = t(), typeName = t(name), propertyName = t(name), literal$3 = t(), string = t(literal$3), number = t(literal$3), content = t(), heading = t(content), keyword = t(), operator$2 = t(), punctuation = t(), bracket$2 = t(punctuation), meta = t();\n /**\n The default set of highlighting [tags](#highlight.Tag).\n\n This collection is heavily biased towards programming languages,\n and necessarily incomplete. A full ontology of syntactic\n constructs would fill a stack of books, and be impractical to\n write themes for. So try to make do with this set. If all else\n fails, [open an\n issue](https://github.com/codemirror/codemirror.next) to propose a\n new tag, or [define](#highlight.Tag^define) a local custom tag for\n your use case.\n\n Note that it is not obligatory to always attach the most specific\n tag possible to an element\u2014if your grammar can't easily\n distinguish a certain type of element (such as a local variable),\n it is okay to style it as its more general variant (a variable).\n\n For tags that extend some parent tag, the documentation links to\n the parent.\n */\n const tags$1 = {\n /**\n A comment.\n */\n comment,\n /**\n A line [comment](#highlight.tags.comment).\n */\n lineComment: t(comment),\n /**\n A block [comment](#highlight.tags.comment).\n */\n blockComment: t(comment),\n /**\n A documentation [comment](#highlight.tags.comment).\n */\n docComment: t(comment),\n /**\n Any kind of identifier.\n */\n name,\n /**\n The [name](#highlight.tags.name) of a variable.\n */\n variableName: t(name),\n /**\n A type [name](#highlight.tags.name).\n */\n typeName: typeName,\n /**\n A tag name (subtag of [`typeName`](#highlight.tags.typeName)).\n */\n tagName: t(typeName),\n /**\n A property or field [name](#highlight.tags.name).\n */\n propertyName: propertyName,\n /**\n An attribute name (subtag of [`propertyName`](#highlight.tags.propertyName)).\n */\n attributeName: t(propertyName),\n /**\n The [name](#highlight.tags.name) of a class.\n */\n className: t(name),\n /**\n A label [name](#highlight.tags.name).\n */\n labelName: t(name),\n /**\n A namespace [name](#highlight.tags.name).\n */\n namespace: t(name),\n /**\n The [name](#highlight.tags.name) of a macro.\n */\n macroName: t(name),\n /**\n A literal value.\n */\n literal: literal$3,\n /**\n A string [literal](#highlight.tags.literal).\n */\n string,\n /**\n A documentation [string](#highlight.tags.string).\n */\n docString: t(string),\n /**\n A character literal (subtag of [string](#highlight.tags.string)).\n */\n character: t(string),\n /**\n An attribute value (subtag of [string](#highlight.tags.string)).\n */\n attributeValue: t(string),\n /**\n A number [literal](#highlight.tags.literal).\n */\n number,\n /**\n An integer [number](#highlight.tags.number) literal.\n */\n integer: t(number),\n /**\n A floating-point [number](#highlight.tags.number) literal.\n */\n float: t(number),\n /**\n A boolean [literal](#highlight.tags.literal).\n */\n bool: t(literal$3),\n /**\n Regular expression [literal](#highlight.tags.literal).\n */\n regexp: t(literal$3),\n /**\n An escape [literal](#highlight.tags.literal), for example a\n backslash escape in a string.\n */\n escape: t(literal$3),\n /**\n A color [literal](#highlight.tags.literal).\n */\n color: t(literal$3),\n /**\n A URL [literal](#highlight.tags.literal).\n */\n url: t(literal$3),\n /**\n A language keyword.\n */\n keyword,\n /**\n The [keyword](#highlight.tags.keyword) for the self or this\n object.\n */\n self: t(keyword),\n /**\n The [keyword](#highlight.tags.keyword) for null.\n */\n null: t(keyword),\n /**\n A [keyword](#highlight.tags.keyword) denoting some atomic value.\n */\n atom: t(keyword),\n /**\n A [keyword](#highlight.tags.keyword) that represents a unit.\n */\n unit: t(keyword),\n /**\n A modifier [keyword](#highlight.tags.keyword).\n */\n modifier: t(keyword),\n /**\n A [keyword](#highlight.tags.keyword) that acts as an operator.\n */\n operatorKeyword: t(keyword),\n /**\n A control-flow related [keyword](#highlight.tags.keyword).\n */\n controlKeyword: t(keyword),\n /**\n A [keyword](#highlight.tags.keyword) that defines something.\n */\n definitionKeyword: t(keyword),\n /**\n A [keyword](#highlight.tags.keyword) related to defining or\n interfacing with modules.\n */\n moduleKeyword: t(keyword),\n /**\n An operator.\n */\n operator: operator$2,\n /**\n An [operator](#highlight.tags.operator) that dereferences something.\n */\n derefOperator: t(operator$2),\n /**\n Arithmetic-related [operator](#highlight.tags.operator).\n */\n arithmeticOperator: t(operator$2),\n /**\n Logical [operator](#highlight.tags.operator).\n */\n logicOperator: t(operator$2),\n /**\n Bit [operator](#highlight.tags.operator).\n */\n bitwiseOperator: t(operator$2),\n /**\n Comparison [operator](#highlight.tags.operator).\n */\n compareOperator: t(operator$2),\n /**\n [Operator](#highlight.tags.operator) that updates its operand.\n */\n updateOperator: t(operator$2),\n /**\n [Operator](#highlight.tags.operator) that defines something.\n */\n definitionOperator: t(operator$2),\n /**\n Type-related [operator](#highlight.tags.operator).\n */\n typeOperator: t(operator$2),\n /**\n Control-flow [operator](#highlight.tags.operator).\n */\n controlOperator: t(operator$2),\n /**\n Program or markup punctuation.\n */\n punctuation,\n /**\n [Punctuation](#highlight.tags.punctuation) that separates\n things.\n */\n separator: t(punctuation),\n /**\n Bracket-style [punctuation](#highlight.tags.punctuation).\n */\n bracket: bracket$2,\n /**\n Angle [brackets](#highlight.tags.bracket) (usually `<` and `>`\n tokens).\n */\n angleBracket: t(bracket$2),\n /**\n Square [brackets](#highlight.tags.bracket) (usually `[` and `]`\n tokens).\n */\n squareBracket: t(bracket$2),\n /**\n Parentheses (usually `(` and `)` tokens). Subtag of\n [bracket](#highlight.tags.bracket).\n */\n paren: t(bracket$2),\n /**\n Braces (usually `{` and `}` tokens). Subtag of\n [bracket](#highlight.tags.bracket).\n */\n brace: t(bracket$2),\n /**\n Content, for example plain text in XML or markup documents.\n */\n content,\n /**\n [Content](#highlight.tags.content) that represents a heading.\n */\n heading,\n /**\n A level 1 [heading](#highlight.tags.heading).\n */\n heading1: t(heading),\n /**\n A level 2 [heading](#highlight.tags.heading).\n */\n heading2: t(heading),\n /**\n A level 3 [heading](#highlight.tags.heading).\n */\n heading3: t(heading),\n /**\n A level 4 [heading](#highlight.tags.heading).\n */\n heading4: t(heading),\n /**\n A level 5 [heading](#highlight.tags.heading).\n */\n heading5: t(heading),\n /**\n A level 6 [heading](#highlight.tags.heading).\n */\n heading6: t(heading),\n /**\n A prose separator (such as a horizontal rule).\n */\n contentSeparator: t(content),\n /**\n [Content](#highlight.tags.content) that represents a list.\n */\n list: t(content),\n /**\n [Content](#highlight.tags.content) that represents a quote.\n */\n quote: t(content),\n /**\n [Content](#highlight.tags.content) that is emphasized.\n */\n emphasis: t(content),\n /**\n [Content](#highlight.tags.content) that is styled strong.\n */\n strong: t(content),\n /**\n [Content](#highlight.tags.content) that is part of a link.\n */\n link: t(content),\n /**\n [Content](#highlight.tags.content) that is styled as code or\n monospace.\n */\n monospace: t(content),\n /**\n [Content](#highlight.tags.content) that has a strike-through\n style.\n */\n strikethrough: t(content),\n /**\n Inserted text in a change-tracking format.\n */\n inserted: t(),\n /**\n Deleted text.\n */\n deleted: t(),\n /**\n Changed text.\n */\n changed: t(),\n /**\n An invalid or unsyntactic element.\n */\n invalid: t(),\n /**\n Metadata or meta-instruction.\n */\n meta,\n /**\n [Metadata](#highlight.tags.meta) that applies to the entire\n document.\n */\n documentMeta: t(meta),\n /**\n [Metadata](#highlight.tags.meta) that annotates or adds\n attributes to a given syntactic element.\n */\n annotation: t(meta),\n /**\n Processing instruction or preprocessor directive. Subtag of\n [meta](#highlight.tags.meta).\n */\n processingInstruction: t(meta),\n /**\n [Modifier](#highlight.Tag^defineModifier) that indicates that a\n given element is being defined. Expected to be used with the\n various [name](#highlight.tags.name) tags.\n */\n definition: Tag.defineModifier(),\n /**\n [Modifier](#highlight.Tag^defineModifier) that indicates that\n something is constant. Mostly expected to be used with\n [variable names](#highlight.tags.variableName).\n */\n constant: Tag.defineModifier(),\n /**\n [Modifier](#highlight.Tag^defineModifier) used to indicate that\n a [variable](#highlight.tags.variableName) or [property\n name](#highlight.tags.propertyName) is being called or defined\n as a function.\n */\n function: Tag.defineModifier(),\n /**\n [Modifier](#highlight.Tag^defineModifier) that can be applied to\n [names](#highlight.tags.name) to indicate that they belong to\n the language's standard environment.\n */\n standard: Tag.defineModifier(),\n /**\n [Modifier](#highlight.Tag^defineModifier) that indicates a given\n [names](#highlight.tags.name) is local to some scope.\n */\n local: Tag.defineModifier(),\n /**\n A generic variant [modifier](#highlight.Tag^defineModifier) that\n can be used to tag language-specific alternative variants of\n some common tag. It is recommended for themes to define special\n forms of at least the [string](#highlight.tags.string) and\n [variable name](#highlight.tags.variableName) tags, since those\n come up a lot.\n */\n special: Tag.defineModifier()\n };\n /**\n This is a highlighter that adds stable, predictable classes to\n tokens, for styling with external CSS.\n\n The following tags are mapped to their name prefixed with `\"tok-\"`\n (for example `\"tok-comment\"`):\n\n * [`link`](#highlight.tags.link)\n * [`heading`](#highlight.tags.heading)\n * [`emphasis`](#highlight.tags.emphasis)\n * [`strong`](#highlight.tags.strong)\n * [`keyword`](#highlight.tags.keyword)\n * [`atom`](#highlight.tags.atom)\n * [`bool`](#highlight.tags.bool)\n * [`url`](#highlight.tags.url)\n * [`labelName`](#highlight.tags.labelName)\n * [`inserted`](#highlight.tags.inserted)\n * [`deleted`](#highlight.tags.deleted)\n * [`literal`](#highlight.tags.literal)\n * [`string`](#highlight.tags.string)\n * [`number`](#highlight.tags.number)\n * [`variableName`](#highlight.tags.variableName)\n * [`typeName`](#highlight.tags.typeName)\n * [`namespace`](#highlight.tags.namespace)\n * [`className`](#highlight.tags.className)\n * [`macroName`](#highlight.tags.macroName)\n * [`propertyName`](#highlight.tags.propertyName)\n * [`operator`](#highlight.tags.operator)\n * [`comment`](#highlight.tags.comment)\n * [`meta`](#highlight.tags.meta)\n * [`punctuation`](#highlight.tags.punctuation)\n * [`invalid`](#highlight.tags.invalid)\n\n In addition, these mappings are provided:\n\n * [`regexp`](#highlight.tags.regexp),\n [`escape`](#highlight.tags.escape), and\n [`special`](#highlight.tags.special)[`(string)`](#highlight.tags.string)\n are mapped to `\"tok-string2\"`\n * [`special`](#highlight.tags.special)[`(variableName)`](#highlight.tags.variableName)\n to `\"tok-variableName2\"`\n * [`local`](#highlight.tags.local)[`(variableName)`](#highlight.tags.variableName)\n to `\"tok-variableName tok-local\"`\n * [`definition`](#highlight.tags.definition)[`(variableName)`](#highlight.tags.variableName)\n to `\"tok-variableName tok-definition\"`\n * [`definition`](#highlight.tags.definition)[`(propertyName)`](#highlight.tags.propertyName)\n to `\"tok-propertyName tok-definition\"`\n */\n tagHighlighter([\n { tag: tags$1.link, class: \"tok-link\" },\n { tag: tags$1.heading, class: \"tok-heading\" },\n { tag: tags$1.emphasis, class: \"tok-emphasis\" },\n { tag: tags$1.strong, class: \"tok-strong\" },\n { tag: tags$1.keyword, class: \"tok-keyword\" },\n { tag: tags$1.atom, class: \"tok-atom\" },\n { tag: tags$1.bool, class: \"tok-bool\" },\n { tag: tags$1.url, class: \"tok-url\" },\n { tag: tags$1.labelName, class: \"tok-labelName\" },\n { tag: tags$1.inserted, class: \"tok-inserted\" },\n { tag: tags$1.deleted, class: \"tok-deleted\" },\n { tag: tags$1.literal, class: \"tok-literal\" },\n { tag: tags$1.string, class: \"tok-string\" },\n { tag: tags$1.number, class: \"tok-number\" },\n { tag: [tags$1.regexp, tags$1.escape, tags$1.special(tags$1.string)], class: \"tok-string2\" },\n { tag: tags$1.variableName, class: \"tok-variableName\" },\n { tag: tags$1.local(tags$1.variableName), class: \"tok-variableName tok-local\" },\n { tag: tags$1.definition(tags$1.variableName), class: \"tok-variableName tok-definition\" },\n { tag: tags$1.special(tags$1.variableName), class: \"tok-variableName2\" },\n { tag: tags$1.definition(tags$1.propertyName), class: \"tok-propertyName tok-definition\" },\n { tag: tags$1.typeName, class: \"tok-typeName\" },\n { tag: tags$1.namespace, class: \"tok-namespace\" },\n { tag: tags$1.className, class: \"tok-className\" },\n { tag: tags$1.macroName, class: \"tok-macroName\" },\n { tag: tags$1.propertyName, class: \"tok-propertyName\" },\n { tag: tags$1.operator, class: \"tok-operator\" },\n { tag: tags$1.comment, class: \"tok-comment\" },\n { tag: tags$1.meta, class: \"tok-meta\" },\n { tag: tags$1.invalid, class: \"tok-invalid\" },\n { tag: tags$1.punctuation, class: \"tok-punctuation\" }\n ]);\n\n var _a;\n /**\n Node prop stored in a parser's top syntax node to provide the\n facet that stores language-specific data for that language.\n */\n const languageDataProp = /*@__PURE__*/new NodeProp();\n /**\n Helper function to define a facet (to be added to the top syntax\n node(s) for a language via\n [`languageDataProp`](https://codemirror.net/6/docs/ref/#language.languageDataProp)), that will be\n used to associate language data with the language. You\n probably only need this when subclassing\n [`Language`](https://codemirror.net/6/docs/ref/#language.Language).\n */\n function defineLanguageFacet(baseData) {\n return Facet.define({\n combine: baseData ? values => values.concat(baseData) : undefined\n });\n }\n /**\n Syntax node prop used to register sublanguages. Should be added to\n the top level node type for the language.\n */\n const sublanguageProp = /*@__PURE__*/new NodeProp();\n /**\n A language object manages parsing and per-language\n [metadata](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt). Parse data is\n managed as a [Lezer](https://lezer.codemirror.net) tree. The class\n can be used directly, via the [`LRLanguage`](https://codemirror.net/6/docs/ref/#language.LRLanguage)\n subclass for [Lezer](https://lezer.codemirror.net/) LR parsers, or\n via the [`StreamLanguage`](https://codemirror.net/6/docs/ref/#language.StreamLanguage) subclass\n for stream parsers.\n */\n class Language {\n /**\n Construct a language object. If you need to invoke this\n directly, first define a data facet with\n [`defineLanguageFacet`](https://codemirror.net/6/docs/ref/#language.defineLanguageFacet), and then\n configure your parser to [attach](https://codemirror.net/6/docs/ref/#language.languageDataProp) it\n to the language's outer syntax node.\n */\n constructor(\n /**\n The [language data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt) facet\n used for this language.\n */\n data, parser, extraExtensions = [], \n /**\n A language name.\n */\n name = \"\") {\n this.data = data;\n this.name = name;\n // Kludge to define EditorState.tree as a debugging helper,\n // without the EditorState package actually knowing about\n // languages and lezer trees.\n if (!EditorState.prototype.hasOwnProperty(\"tree\"))\n Object.defineProperty(EditorState.prototype, \"tree\", { get() { return syntaxTree(this); } });\n this.parser = parser;\n this.extension = [\n language.of(this),\n EditorState.languageData.of((state, pos, side) => {\n let top = topNodeAt(state, pos, side), data = top.type.prop(languageDataProp);\n if (!data)\n return [];\n let base = state.facet(data), sub = top.type.prop(sublanguageProp);\n if (sub) {\n let innerNode = top.resolve(pos - top.from, side);\n for (let sublang of sub)\n if (sublang.test(innerNode, state)) {\n let data = state.facet(sublang.facet);\n return sublang.type == \"replace\" ? data : data.concat(base);\n }\n }\n return base;\n })\n ].concat(extraExtensions);\n }\n /**\n Query whether this language is active at the given position.\n */\n isActiveAt(state, pos, side = -1) {\n return topNodeAt(state, pos, side).type.prop(languageDataProp) == this.data;\n }\n /**\n Find the document regions that were parsed using this language.\n The returned regions will _include_ any nested languages rooted\n in this language, when those exist.\n */\n findRegions(state) {\n let lang = state.facet(language);\n if ((lang === null || lang === void 0 ? void 0 : lang.data) == this.data)\n return [{ from: 0, to: state.doc.length }];\n if (!lang || !lang.allowsNesting)\n return [];\n let result = [];\n let explore = (tree, from) => {\n if (tree.prop(languageDataProp) == this.data) {\n result.push({ from, to: from + tree.length });\n return;\n }\n let mount = tree.prop(NodeProp.mounted);\n if (mount) {\n if (mount.tree.prop(languageDataProp) == this.data) {\n if (mount.overlay)\n for (let r of mount.overlay)\n result.push({ from: r.from + from, to: r.to + from });\n else\n result.push({ from: from, to: from + tree.length });\n return;\n }\n else if (mount.overlay) {\n let size = result.length;\n explore(mount.tree, mount.overlay[0].from + from);\n if (result.length > size)\n return;\n }\n }\n for (let i = 0; i < tree.children.length; i++) {\n let ch = tree.children[i];\n if (ch instanceof Tree)\n explore(ch, tree.positions[i] + from);\n }\n };\n explore(syntaxTree(state), 0);\n return result;\n }\n /**\n Indicates whether this language allows nested languages. The\n default implementation returns true.\n */\n get allowsNesting() { return true; }\n }\n /**\n @internal\n */\n Language.setState = /*@__PURE__*/StateEffect.define();\n function topNodeAt(state, pos, side) {\n let topLang = state.facet(language), tree = syntaxTree(state).topNode;\n if (!topLang || topLang.allowsNesting) {\n for (let node = tree; node; node = node.enter(pos, side, IterMode.ExcludeBuffers))\n if (node.type.isTop)\n tree = node;\n }\n return tree;\n }\n /**\n A subclass of [`Language`](https://codemirror.net/6/docs/ref/#language.Language) for use with Lezer\n [LR parsers](https://lezer.codemirror.net/docs/ref#lr.LRParser)\n parsers.\n */\n class LRLanguage extends Language {\n constructor(data, parser, name) {\n super(data, parser, [], name);\n this.parser = parser;\n }\n /**\n Define a language from a parser.\n */\n static define(spec) {\n let data = defineLanguageFacet(spec.languageData);\n return new LRLanguage(data, spec.parser.configure({\n props: [languageDataProp.add(type => type.isTop ? data : undefined)]\n }), spec.name);\n }\n /**\n Create a new instance of this language with a reconfigured\n version of its parser and optionally a new name.\n */\n configure(options, name) {\n return new LRLanguage(this.data, this.parser.configure(options), name || this.name);\n }\n get allowsNesting() { return this.parser.hasWrappers(); }\n }\n /**\n Get the syntax tree for a state, which is the current (possibly\n incomplete) parse tree of the active\n [language](https://codemirror.net/6/docs/ref/#language.Language), or the empty tree if there is no\n language available.\n */\n function syntaxTree(state) {\n let field = state.field(Language.state, false);\n return field ? field.tree : Tree.empty;\n }\n /**\n Lezer-style\n [`Input`](https://lezer.codemirror.net/docs/ref#common.Input)\n object for a [`Text`](https://codemirror.net/6/docs/ref/#state.Text) object.\n */\n class DocInput {\n /**\n Create an input object for the given document.\n */\n constructor(doc) {\n this.doc = doc;\n this.cursorPos = 0;\n this.string = \"\";\n this.cursor = doc.iter();\n }\n get length() { return this.doc.length; }\n syncTo(pos) {\n this.string = this.cursor.next(pos - this.cursorPos).value;\n this.cursorPos = pos + this.string.length;\n return this.cursorPos - this.string.length;\n }\n chunk(pos) {\n this.syncTo(pos);\n return this.string;\n }\n get lineChunks() { return true; }\n read(from, to) {\n let stringStart = this.cursorPos - this.string.length;\n if (from < stringStart || to >= this.cursorPos)\n return this.doc.sliceString(from, to);\n else\n return this.string.slice(from - stringStart, to - stringStart);\n }\n }\n let currentContext = null;\n /**\n A parse context provided to parsers working on the editor content.\n */\n class ParseContext {\n constructor(parser, \n /**\n The current editor state.\n */\n state, \n /**\n Tree fragments that can be reused by incremental re-parses.\n */\n fragments = [], \n /**\n @internal\n */\n tree, \n /**\n @internal\n */\n treeLen, \n /**\n The current editor viewport (or some overapproximation\n thereof). Intended to be used for opportunistically avoiding\n work (in which case\n [`skipUntilInView`](https://codemirror.net/6/docs/ref/#language.ParseContext.skipUntilInView)\n should be called to make sure the parser is restarted when the\n skipped region becomes visible).\n */\n viewport, \n /**\n @internal\n */\n skipped, \n /**\n This is where skipping parsers can register a promise that,\n when resolved, will schedule a new parse. It is cleared when\n the parse worker picks up the promise. @internal\n */\n scheduleOn) {\n this.parser = parser;\n this.state = state;\n this.fragments = fragments;\n this.tree = tree;\n this.treeLen = treeLen;\n this.viewport = viewport;\n this.skipped = skipped;\n this.scheduleOn = scheduleOn;\n this.parse = null;\n /**\n @internal\n */\n this.tempSkipped = [];\n }\n /**\n @internal\n */\n static create(parser, state, viewport) {\n return new ParseContext(parser, state, [], Tree.empty, 0, viewport, [], null);\n }\n startParse() {\n return this.parser.startParse(new DocInput(this.state.doc), this.fragments);\n }\n /**\n @internal\n */\n work(until, upto) {\n if (upto != null && upto >= this.state.doc.length)\n upto = undefined;\n if (this.tree != Tree.empty && this.isDone(upto !== null && upto !== void 0 ? upto : this.state.doc.length)) {\n this.takeTree();\n return true;\n }\n return this.withContext(() => {\n var _a;\n if (typeof until == \"number\") {\n let endTime = Date.now() + until;\n until = () => Date.now() > endTime;\n }\n if (!this.parse)\n this.parse = this.startParse();\n if (upto != null && (this.parse.stoppedAt == null || this.parse.stoppedAt > upto) &&\n upto < this.state.doc.length)\n this.parse.stopAt(upto);\n for (;;) {\n let done = this.parse.advance();\n if (done) {\n this.fragments = this.withoutTempSkipped(TreeFragment.addTree(done, this.fragments, this.parse.stoppedAt != null));\n this.treeLen = (_a = this.parse.stoppedAt) !== null && _a !== void 0 ? _a : this.state.doc.length;\n this.tree = done;\n this.parse = null;\n if (this.treeLen < (upto !== null && upto !== void 0 ? upto : this.state.doc.length))\n this.parse = this.startParse();\n else\n return true;\n }\n if (until())\n return false;\n }\n });\n }\n /**\n @internal\n */\n takeTree() {\n let pos, tree;\n if (this.parse && (pos = this.parse.parsedPos) >= this.treeLen) {\n if (this.parse.stoppedAt == null || this.parse.stoppedAt > pos)\n this.parse.stopAt(pos);\n this.withContext(() => { while (!(tree = this.parse.advance())) { } });\n this.treeLen = pos;\n this.tree = tree;\n this.fragments = this.withoutTempSkipped(TreeFragment.addTree(this.tree, this.fragments, true));\n this.parse = null;\n }\n }\n withContext(f) {\n let prev = currentContext;\n currentContext = this;\n try {\n return f();\n }\n finally {\n currentContext = prev;\n }\n }\n withoutTempSkipped(fragments) {\n for (let r; r = this.tempSkipped.pop();)\n fragments = cutFragments(fragments, r.from, r.to);\n return fragments;\n }\n /**\n @internal\n */\n changes(changes, newState) {\n let { fragments, tree, treeLen, viewport, skipped } = this;\n this.takeTree();\n if (!changes.empty) {\n let ranges = [];\n changes.iterChangedRanges((fromA, toA, fromB, toB) => ranges.push({ fromA, toA, fromB, toB }));\n fragments = TreeFragment.applyChanges(fragments, ranges);\n tree = Tree.empty;\n treeLen = 0;\n viewport = { from: changes.mapPos(viewport.from, -1), to: changes.mapPos(viewport.to, 1) };\n if (this.skipped.length) {\n skipped = [];\n for (let r of this.skipped) {\n let from = changes.mapPos(r.from, 1), to = changes.mapPos(r.to, -1);\n if (from < to)\n skipped.push({ from, to });\n }\n }\n }\n return new ParseContext(this.parser, newState, fragments, tree, treeLen, viewport, skipped, this.scheduleOn);\n }\n /**\n @internal\n */\n updateViewport(viewport) {\n if (this.viewport.from == viewport.from && this.viewport.to == viewport.to)\n return false;\n this.viewport = viewport;\n let startLen = this.skipped.length;\n for (let i = 0; i < this.skipped.length; i++) {\n let { from, to } = this.skipped[i];\n if (from < viewport.to && to > viewport.from) {\n this.fragments = cutFragments(this.fragments, from, to);\n this.skipped.splice(i--, 1);\n }\n }\n if (this.skipped.length >= startLen)\n return false;\n this.reset();\n return true;\n }\n /**\n @internal\n */\n reset() {\n if (this.parse) {\n this.takeTree();\n this.parse = null;\n }\n }\n /**\n Notify the parse scheduler that the given region was skipped\n because it wasn't in view, and the parse should be restarted\n when it comes into view.\n */\n skipUntilInView(from, to) {\n this.skipped.push({ from, to });\n }\n /**\n Returns a parser intended to be used as placeholder when\n asynchronously loading a nested parser. It'll skip its input and\n mark it as not-really-parsed, so that the next update will parse\n it again.\n \n When `until` is given, a reparse will be scheduled when that\n promise resolves.\n */\n static getSkippingParser(until) {\n return new class extends Parser {\n createParse(input, fragments, ranges) {\n let from = ranges[0].from, to = ranges[ranges.length - 1].to;\n let parser = {\n parsedPos: from,\n advance() {\n let cx = currentContext;\n if (cx) {\n for (let r of ranges)\n cx.tempSkipped.push(r);\n if (until)\n cx.scheduleOn = cx.scheduleOn ? Promise.all([cx.scheduleOn, until]) : until;\n }\n this.parsedPos = to;\n return new Tree(NodeType.none, [], [], to - from);\n },\n stoppedAt: null,\n stopAt() { }\n };\n return parser;\n }\n };\n }\n /**\n @internal\n */\n isDone(upto) {\n upto = Math.min(upto, this.state.doc.length);\n let frags = this.fragments;\n return this.treeLen >= upto && frags.length && frags[0].from == 0 && frags[0].to >= upto;\n }\n /**\n Get the context for the current parse, or `null` if no editor\n parse is in progress.\n */\n static get() { return currentContext; }\n }\n function cutFragments(fragments, from, to) {\n return TreeFragment.applyChanges(fragments, [{ fromA: from, toA: to, fromB: from, toB: to }]);\n }\n class LanguageState {\n constructor(\n // A mutable parse state that is used to preserve work done during\n // the lifetime of a state when moving to the next state.\n context) {\n this.context = context;\n this.tree = context.tree;\n }\n apply(tr) {\n if (!tr.docChanged && this.tree == this.context.tree)\n return this;\n let newCx = this.context.changes(tr.changes, tr.state);\n // If the previous parse wasn't done, go forward only up to its\n // end position or the end of the viewport, to avoid slowing down\n // state updates with parse work beyond the viewport.\n let upto = this.context.treeLen == tr.startState.doc.length ? undefined\n : Math.max(tr.changes.mapPos(this.context.treeLen), newCx.viewport.to);\n if (!newCx.work(20 /* Work.Apply */, upto))\n newCx.takeTree();\n return new LanguageState(newCx);\n }\n static init(state) {\n let vpTo = Math.min(3000 /* Work.InitViewport */, state.doc.length);\n let parseState = ParseContext.create(state.facet(language).parser, state, { from: 0, to: vpTo });\n if (!parseState.work(20 /* Work.Apply */, vpTo))\n parseState.takeTree();\n return new LanguageState(parseState);\n }\n }\n Language.state = /*@__PURE__*/StateField.define({\n create: LanguageState.init,\n update(value, tr) {\n for (let e of tr.effects)\n if (e.is(Language.setState))\n return e.value;\n if (tr.startState.facet(language) != tr.state.facet(language))\n return LanguageState.init(tr.state);\n return value.apply(tr);\n }\n });\n let requestIdle = (callback) => {\n let timeout = setTimeout(() => callback(), 500 /* Work.MaxPause */);\n return () => clearTimeout(timeout);\n };\n if (typeof requestIdleCallback != \"undefined\")\n requestIdle = (callback) => {\n let idle = -1, timeout = setTimeout(() => {\n idle = requestIdleCallback(callback, { timeout: 500 /* Work.MaxPause */ - 100 /* Work.MinPause */ });\n }, 100 /* Work.MinPause */);\n return () => idle < 0 ? clearTimeout(timeout) : cancelIdleCallback(idle);\n };\n const isInputPending = typeof navigator != \"undefined\" && ((_a = navigator.scheduling) === null || _a === void 0 ? void 0 : _a.isInputPending)\n ? () => navigator.scheduling.isInputPending() : null;\n const parseWorker = /*@__PURE__*/ViewPlugin.fromClass(class ParseWorker {\n constructor(view) {\n this.view = view;\n this.working = null;\n this.workScheduled = 0;\n // End of the current time chunk\n this.chunkEnd = -1;\n // Milliseconds of budget left for this chunk\n this.chunkBudget = -1;\n this.work = this.work.bind(this);\n this.scheduleWork();\n }\n update(update) {\n let cx = this.view.state.field(Language.state).context;\n if (cx.updateViewport(update.view.viewport) || this.view.viewport.to > cx.treeLen)\n this.scheduleWork();\n if (update.docChanged || update.selectionSet) {\n if (this.view.hasFocus)\n this.chunkBudget += 50 /* Work.ChangeBonus */;\n this.scheduleWork();\n }\n this.checkAsyncSchedule(cx);\n }\n scheduleWork() {\n if (this.working)\n return;\n let { state } = this.view, field = state.field(Language.state);\n if (field.tree != field.context.tree || !field.context.isDone(state.doc.length))\n this.working = requestIdle(this.work);\n }\n work(deadline) {\n this.working = null;\n let now = Date.now();\n if (this.chunkEnd < now && (this.chunkEnd < 0 || this.view.hasFocus)) { // Start a new chunk\n this.chunkEnd = now + 30000 /* Work.ChunkTime */;\n this.chunkBudget = 3000 /* Work.ChunkBudget */;\n }\n if (this.chunkBudget <= 0)\n return; // No more budget\n let { state, viewport: { to: vpTo } } = this.view, field = state.field(Language.state);\n if (field.tree == field.context.tree && field.context.isDone(vpTo + 100000 /* Work.MaxParseAhead */))\n return;\n let endTime = Date.now() + Math.min(this.chunkBudget, 100 /* Work.Slice */, deadline && !isInputPending ? Math.max(25 /* Work.MinSlice */, deadline.timeRemaining() - 5) : 1e9);\n let viewportFirst = field.context.treeLen < vpTo && state.doc.length > vpTo + 1000;\n let done = field.context.work(() => {\n return isInputPending && isInputPending() || Date.now() > endTime;\n }, vpTo + (viewportFirst ? 0 : 100000 /* Work.MaxParseAhead */));\n this.chunkBudget -= Date.now() - now;\n if (done || this.chunkBudget <= 0) {\n field.context.takeTree();\n this.view.dispatch({ effects: Language.setState.of(new LanguageState(field.context)) });\n }\n if (this.chunkBudget > 0 && !(done && !viewportFirst))\n this.scheduleWork();\n this.checkAsyncSchedule(field.context);\n }\n checkAsyncSchedule(cx) {\n if (cx.scheduleOn) {\n this.workScheduled++;\n cx.scheduleOn\n .then(() => this.scheduleWork())\n .catch(err => logException(this.view.state, err))\n .then(() => this.workScheduled--);\n cx.scheduleOn = null;\n }\n }\n destroy() {\n if (this.working)\n this.working();\n }\n isWorking() {\n return !!(this.working || this.workScheduled > 0);\n }\n }, {\n eventHandlers: { focus() { this.scheduleWork(); } }\n });\n /**\n The facet used to associate a language with an editor state. Used\n by `Language` object's `extension` property (so you don't need to\n manually wrap your languages in this). Can be used to access the\n current language on a state.\n */\n const language = /*@__PURE__*/Facet.define({\n combine(languages) { return languages.length ? languages[0] : null; },\n enables: language => [\n Language.state,\n parseWorker,\n EditorView.contentAttributes.compute([language], state => {\n let lang = state.facet(language);\n return lang && lang.name ? { \"data-language\": lang.name } : {};\n })\n ]\n });\n /**\n This class bundles a [language](https://codemirror.net/6/docs/ref/#language.Language) with an\n optional set of supporting extensions. Language packages are\n encouraged to export a function that optionally takes a\n configuration object and returns a `LanguageSupport` instance, as\n the main way for client code to use the package.\n */\n class LanguageSupport {\n /**\n Create a language support object.\n */\n constructor(\n /**\n The language object.\n */\n language, \n /**\n An optional set of supporting extensions. When nesting a\n language in another language, the outer language is encouraged\n to include the supporting extensions for its inner languages\n in its own set of support extensions.\n */\n support = []) {\n this.language = language;\n this.support = support;\n this.extension = [language, support];\n }\n }\n /**\n Language descriptions are used to store metadata about languages\n and to dynamically load them. Their main role is finding the\n appropriate language for a filename or dynamically loading nested\n parsers.\n */\n class LanguageDescription {\n constructor(\n /**\n The name of this language.\n */\n name, \n /**\n Alternative names for the mode (lowercased, includes `this.name`).\n */\n alias, \n /**\n File extensions associated with this language.\n */\n extensions, \n /**\n Optional filename pattern that should be associated with this\n language.\n */\n filename, loadFunc, \n /**\n If the language has been loaded, this will hold its value.\n */\n support = undefined) {\n this.name = name;\n this.alias = alias;\n this.extensions = extensions;\n this.filename = filename;\n this.loadFunc = loadFunc;\n this.support = support;\n this.loading = null;\n }\n /**\n Start loading the the language. Will return a promise that\n resolves to a [`LanguageSupport`](https://codemirror.net/6/docs/ref/#language.LanguageSupport)\n object when the language successfully loads.\n */\n load() {\n return this.loading || (this.loading = this.loadFunc().then(support => this.support = support, err => { this.loading = null; throw err; }));\n }\n /**\n Create a language description.\n */\n static of(spec) {\n let { load, support } = spec;\n if (!load) {\n if (!support)\n throw new RangeError(\"Must pass either 'load' or 'support' to LanguageDescription.of\");\n load = () => Promise.resolve(support);\n }\n return new LanguageDescription(spec.name, (spec.alias || []).concat(spec.name).map(s => s.toLowerCase()), spec.extensions || [], spec.filename, load, support);\n }\n /**\n Look for a language in the given array of descriptions that\n matches the filename. Will first match\n [`filename`](https://codemirror.net/6/docs/ref/#language.LanguageDescription.filename) patterns,\n and then [extensions](https://codemirror.net/6/docs/ref/#language.LanguageDescription.extensions),\n and return the first language that matches.\n */\n static matchFilename(descs, filename) {\n for (let d of descs)\n if (d.filename && d.filename.test(filename))\n return d;\n let ext = /\\.([^.]+)$/.exec(filename);\n if (ext)\n for (let d of descs)\n if (d.extensions.indexOf(ext[1]) > -1)\n return d;\n return null;\n }\n /**\n Look for a language whose name or alias matches the the given\n name (case-insensitively). If `fuzzy` is true, and no direct\n matchs is found, this'll also search for a language whose name\n or alias occurs in the string (for names shorter than three\n characters, only when surrounded by non-word characters).\n */\n static matchLanguageName(descs, name, fuzzy = true) {\n name = name.toLowerCase();\n for (let d of descs)\n if (d.alias.some(a => a == name))\n return d;\n if (fuzzy)\n for (let d of descs)\n for (let a of d.alias) {\n let found = name.indexOf(a);\n if (found > -1 && (a.length > 2 || !/\\w/.test(name[found - 1]) && !/\\w/.test(name[found + a.length])))\n return d;\n }\n return null;\n }\n }\n\n /**\n Facet that defines a way to provide a function that computes the\n appropriate indentation depth, as a column number (see\n [`indentString`](https://codemirror.net/6/docs/ref/#language.indentString)), at the start of a given\n line. A return value of `null` indicates no indentation can be\n determined, and the line should inherit the indentation of the one\n above it. A return value of `undefined` defers to the next indent\n service.\n */\n const indentService = /*@__PURE__*/Facet.define();\n /**\n Facet for overriding the unit by which indentation happens. Should\n be a string consisting either entirely of the same whitespace\n character. When not set, this defaults to 2 spaces.\n */\n const indentUnit = /*@__PURE__*/Facet.define({\n combine: values => {\n if (!values.length)\n return \" \";\n let unit = values[0];\n if (!unit || /\\S/.test(unit) || Array.from(unit).some(e => e != unit[0]))\n throw new Error(\"Invalid indent unit: \" + JSON.stringify(values[0]));\n return unit;\n }\n });\n /**\n Return the _column width_ of an indent unit in the state.\n Determined by the [`indentUnit`](https://codemirror.net/6/docs/ref/#language.indentUnit)\n facet, and [`tabSize`](https://codemirror.net/6/docs/ref/#state.EditorState^tabSize) when that\n contains tabs.\n */\n function getIndentUnit(state) {\n let unit = state.facet(indentUnit);\n return unit.charCodeAt(0) == 9 ? state.tabSize * unit.length : unit.length;\n }\n /**\n Create an indentation string that covers columns 0 to `cols`.\n Will use tabs for as much of the columns as possible when the\n [`indentUnit`](https://codemirror.net/6/docs/ref/#language.indentUnit) facet contains\n tabs.\n */\n function indentString(state, cols) {\n let result = \"\", ts = state.tabSize, ch = state.facet(indentUnit)[0];\n if (ch == \"\\t\") {\n while (cols >= ts) {\n result += \"\\t\";\n cols -= ts;\n }\n ch = \" \";\n }\n for (let i = 0; i < cols; i++)\n result += ch;\n return result;\n }\n /**\n Get the indentation, as a column number, at the given position.\n Will first consult any [indent services](https://codemirror.net/6/docs/ref/#language.indentService)\n that are registered, and if none of those return an indentation,\n this will check the syntax tree for the [indent node\n prop](https://codemirror.net/6/docs/ref/#language.indentNodeProp) and use that if found. Returns a\n number when an indentation could be determined, and null\n otherwise.\n */\n function getIndentation(context, pos) {\n if (context instanceof EditorState)\n context = new IndentContext(context);\n for (let service of context.state.facet(indentService)) {\n let result = service(context, pos);\n if (result !== undefined)\n return result;\n }\n let tree = syntaxTree(context.state);\n return tree.length >= pos ? syntaxIndentation(context, tree, pos) : null;\n }\n /**\n Indentation contexts are used when calling [indentation\n services](https://codemirror.net/6/docs/ref/#language.indentService). They provide helper utilities\n useful in indentation logic, and can selectively override the\n indentation reported for some lines.\n */\n class IndentContext {\n /**\n Create an indent context.\n */\n constructor(\n /**\n The editor state.\n */\n state, \n /**\n @internal\n */\n options = {}) {\n this.state = state;\n this.options = options;\n this.unit = getIndentUnit(state);\n }\n /**\n Get a description of the line at the given position, taking\n [simulated line\n breaks](https://codemirror.net/6/docs/ref/#language.IndentContext.constructor^options.simulateBreak)\n into account. If there is such a break at `pos`, the `bias`\n argument determines whether the part of the line line before or\n after the break is used.\n */\n lineAt(pos, bias = 1) {\n let line = this.state.doc.lineAt(pos);\n let { simulateBreak, simulateDoubleBreak } = this.options;\n if (simulateBreak != null && simulateBreak >= line.from && simulateBreak <= line.to) {\n if (simulateDoubleBreak && simulateBreak == pos)\n return { text: \"\", from: pos };\n else if (bias < 0 ? simulateBreak < pos : simulateBreak <= pos)\n return { text: line.text.slice(simulateBreak - line.from), from: simulateBreak };\n else\n return { text: line.text.slice(0, simulateBreak - line.from), from: line.from };\n }\n return line;\n }\n /**\n Get the text directly after `pos`, either the entire line\n or the next 100 characters, whichever is shorter.\n */\n textAfterPos(pos, bias = 1) {\n if (this.options.simulateDoubleBreak && pos == this.options.simulateBreak)\n return \"\";\n let { text, from } = this.lineAt(pos, bias);\n return text.slice(pos - from, Math.min(text.length, pos + 100 - from));\n }\n /**\n Find the column for the given position.\n */\n column(pos, bias = 1) {\n let { text, from } = this.lineAt(pos, bias);\n let result = this.countColumn(text, pos - from);\n let override = this.options.overrideIndentation ? this.options.overrideIndentation(from) : -1;\n if (override > -1)\n result += override - this.countColumn(text, text.search(/\\S|$/));\n return result;\n }\n /**\n Find the column position (taking tabs into account) of the given\n position in the given string.\n */\n countColumn(line, pos = line.length) {\n return countColumn(line, this.state.tabSize, pos);\n }\n /**\n Find the indentation column of the line at the given point.\n */\n lineIndent(pos, bias = 1) {\n let { text, from } = this.lineAt(pos, bias);\n let override = this.options.overrideIndentation;\n if (override) {\n let overriden = override(from);\n if (overriden > -1)\n return overriden;\n }\n return this.countColumn(text, text.search(/\\S|$/));\n }\n /**\n Returns the [simulated line\n break](https://codemirror.net/6/docs/ref/#language.IndentContext.constructor^options.simulateBreak)\n for this context, if any.\n */\n get simulatedBreak() {\n return this.options.simulateBreak || null;\n }\n }\n /**\n A syntax tree node prop used to associate indentation strategies\n with node types. Such a strategy is a function from an indentation\n context to a column number (see also\n [`indentString`](https://codemirror.net/6/docs/ref/#language.indentString)) or null, where null\n indicates that no definitive indentation can be determined.\n */\n const indentNodeProp = /*@__PURE__*/new NodeProp();\n // Compute the indentation for a given position from the syntax tree.\n function syntaxIndentation(cx, ast, pos) {\n let stack = ast.resolveStack(pos);\n let inner = stack.node.enterUnfinishedNodesBefore(pos);\n if (inner != stack.node) {\n let add = [];\n for (let cur = inner; cur != stack.node; cur = cur.parent)\n add.push(cur);\n for (let i = add.length - 1; i >= 0; i--)\n stack = { node: add[i], next: stack };\n }\n return indentFor(stack, cx, pos);\n }\n function indentFor(stack, cx, pos) {\n for (let cur = stack; cur; cur = cur.next) {\n let strategy = indentStrategy(cur.node);\n if (strategy)\n return strategy(TreeIndentContext.create(cx, pos, cur));\n }\n return 0;\n }\n function ignoreClosed(cx) {\n return cx.pos == cx.options.simulateBreak && cx.options.simulateDoubleBreak;\n }\n function indentStrategy(tree) {\n let strategy = tree.type.prop(indentNodeProp);\n if (strategy)\n return strategy;\n let first = tree.firstChild, close;\n if (first && (close = first.type.prop(NodeProp.closedBy))) {\n let last = tree.lastChild, closed = last && close.indexOf(last.name) > -1;\n return cx => delimitedStrategy(cx, true, 1, undefined, closed && !ignoreClosed(cx) ? last.from : undefined);\n }\n return tree.parent == null ? topIndent : null;\n }\n function topIndent() { return 0; }\n /**\n Objects of this type provide context information and helper\n methods to indentation functions registered on syntax nodes.\n */\n class TreeIndentContext extends IndentContext {\n constructor(base, \n /**\n The position at which indentation is being computed.\n */\n pos, \n /**\n @internal\n */\n context) {\n super(base.state, base.options);\n this.base = base;\n this.pos = pos;\n this.context = context;\n }\n /**\n The syntax tree node to which the indentation strategy\n applies.\n */\n get node() { return this.context.node; }\n /**\n @internal\n */\n static create(base, pos, context) {\n return new TreeIndentContext(base, pos, context);\n }\n /**\n Get the text directly after `this.pos`, either the entire line\n or the next 100 characters, whichever is shorter.\n */\n get textAfter() {\n return this.textAfterPos(this.pos);\n }\n /**\n Get the indentation at the reference line for `this.node`, which\n is the line on which it starts, unless there is a node that is\n _not_ a parent of this node covering the start of that line. If\n so, the line at the start of that node is tried, again skipping\n on if it is covered by another such node.\n */\n get baseIndent() {\n return this.baseIndentFor(this.node);\n }\n /**\n Get the indentation for the reference line of the given node\n (see [`baseIndent`](https://codemirror.net/6/docs/ref/#language.TreeIndentContext.baseIndent)).\n */\n baseIndentFor(node) {\n let line = this.state.doc.lineAt(node.from);\n // Skip line starts that are covered by a sibling (or cousin, etc)\n for (;;) {\n let atBreak = node.resolve(line.from);\n while (atBreak.parent && atBreak.parent.from == atBreak.from)\n atBreak = atBreak.parent;\n if (isParent(atBreak, node))\n break;\n line = this.state.doc.lineAt(atBreak.from);\n }\n return this.lineIndent(line.from);\n }\n /**\n Continue looking for indentations in the node's parent nodes,\n and return the result of that.\n */\n continue() {\n return indentFor(this.context.next, this.base, this.pos);\n }\n }\n function isParent(parent, of) {\n for (let cur = of; cur; cur = cur.parent)\n if (parent == cur)\n return true;\n return false;\n }\n // Check whether a delimited node is aligned (meaning there are\n // non-skipped nodes on the same line as the opening delimiter). And\n // if so, return the opening token.\n function bracketedAligned(context) {\n let tree = context.node;\n let openToken = tree.childAfter(tree.from), last = tree.lastChild;\n if (!openToken)\n return null;\n let sim = context.options.simulateBreak;\n let openLine = context.state.doc.lineAt(openToken.from);\n let lineEnd = sim == null || sim <= openLine.from ? openLine.to : Math.min(openLine.to, sim);\n for (let pos = openToken.to;;) {\n let next = tree.childAfter(pos);\n if (!next || next == last)\n return null;\n if (!next.type.isSkipped)\n return next.from < lineEnd ? openToken : null;\n pos = next.to;\n }\n }\n /**\n An indentation strategy for delimited (usually bracketed) nodes.\n Will, by default, indent one unit more than the parent's base\n indent unless the line starts with a closing token. When `align`\n is true and there are non-skipped nodes on the node's opening\n line, the content of the node will be aligned with the end of the\n opening node, like this:\n\n foo(bar,\n baz)\n */\n function delimitedIndent({ closing, align = true, units = 1 }) {\n return (context) => delimitedStrategy(context, align, units, closing);\n }\n function delimitedStrategy(context, align, units, closing, closedAt) {\n let after = context.textAfter, space = after.match(/^\\s*/)[0].length;\n let closed = closing && after.slice(space, space + closing.length) == closing || closedAt == context.pos + space;\n let aligned = align ? bracketedAligned(context) : null;\n if (aligned)\n return closed ? context.column(aligned.from) : context.column(aligned.to);\n return context.baseIndent + (closed ? 0 : context.unit * units);\n }\n /**\n An indentation strategy that aligns a node's content to its base\n indentation.\n */\n const flatIndent = (context) => context.baseIndent;\n /**\n Creates an indentation strategy that, by default, indents\n continued lines one unit more than the node's base indentation.\n You can provide `except` to prevent indentation of lines that\n match a pattern (for example `/^else\\b/` in `if`/`else`\n constructs), and you can change the amount of units used with the\n `units` option.\n */\n function continuedIndent({ except, units = 1 } = {}) {\n return (context) => {\n let matchExcept = except && except.test(context.textAfter);\n return context.baseIndent + (matchExcept ? 0 : units * context.unit);\n };\n }\n const DontIndentBeyond = 200;\n /**\n Enables reindentation on input. When a language defines an\n `indentOnInput` field in its [language\n data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt), which must hold a regular\n expression, the line at the cursor will be reindented whenever new\n text is typed and the input from the start of the line up to the\n cursor matches that regexp.\n\n To avoid unneccesary reindents, it is recommended to start the\n regexp with `^` (usually followed by `\\s*`), and end it with `$`.\n For example, `/^\\s*\\}$/` will reindent when a closing brace is\n added at the start of a line.\n */\n function indentOnInput() {\n return EditorState.transactionFilter.of(tr => {\n if (!tr.docChanged || !tr.isUserEvent(\"input.type\") && !tr.isUserEvent(\"input.complete\"))\n return tr;\n let rules = tr.startState.languageDataAt(\"indentOnInput\", tr.startState.selection.main.head);\n if (!rules.length)\n return tr;\n let doc = tr.newDoc, { head } = tr.newSelection.main, line = doc.lineAt(head);\n if (head > line.from + DontIndentBeyond)\n return tr;\n let lineStart = doc.sliceString(line.from, head);\n if (!rules.some(r => r.test(lineStart)))\n return tr;\n let { state } = tr, last = -1, changes = [];\n for (let { head } of state.selection.ranges) {\n let line = state.doc.lineAt(head);\n if (line.from == last)\n continue;\n last = line.from;\n let indent = getIndentation(state, line.from);\n if (indent == null)\n continue;\n let cur = /^\\s*/.exec(line.text)[0];\n let norm = indentString(state, indent);\n if (cur != norm)\n changes.push({ from: line.from, to: line.from + cur.length, insert: norm });\n }\n return changes.length ? [tr, { changes, sequential: true }] : tr;\n });\n }\n\n /**\n A facet that registers a code folding service. When called with\n the extent of a line, such a function should return a foldable\n range that starts on that line (but continues beyond it), if one\n can be found.\n */\n const foldService = /*@__PURE__*/Facet.define();\n /**\n This node prop is used to associate folding information with\n syntax node types. Given a syntax node, it should check whether\n that tree is foldable and return the range that can be collapsed\n when it is.\n */\n const foldNodeProp = /*@__PURE__*/new NodeProp();\n /**\n [Fold](https://codemirror.net/6/docs/ref/#language.foldNodeProp) function that folds everything but\n the first and the last child of a syntax node. Useful for nodes\n that start and end with delimiters.\n */\n function foldInside(node) {\n let first = node.firstChild, last = node.lastChild;\n return first && first.to < last.from ? { from: first.to, to: last.type.isError ? node.to : last.from } : null;\n }\n function syntaxFolding(state, start, end) {\n let tree = syntaxTree(state);\n if (tree.length < end)\n return null;\n let stack = tree.resolveStack(end, 1);\n let found = null;\n for (let iter = stack; iter; iter = iter.next) {\n let cur = iter.node;\n if (cur.to <= end || cur.from > end)\n continue;\n if (found && cur.from < start)\n break;\n let prop = cur.type.prop(foldNodeProp);\n if (prop && (cur.to < tree.length - 50 || tree.length == state.doc.length || !isUnfinished(cur))) {\n let value = prop(cur, state);\n if (value && value.from <= end && value.from >= start && value.to > end)\n found = value;\n }\n }\n return found;\n }\n function isUnfinished(node) {\n let ch = node.lastChild;\n return ch && ch.to == node.to && ch.type.isError;\n }\n /**\n Check whether the given line is foldable. First asks any fold\n services registered through\n [`foldService`](https://codemirror.net/6/docs/ref/#language.foldService), and if none of them return\n a result, tries to query the [fold node\n prop](https://codemirror.net/6/docs/ref/#language.foldNodeProp) of syntax nodes that cover the end\n of the line.\n */\n function foldable(state, lineStart, lineEnd) {\n for (let service of state.facet(foldService)) {\n let result = service(state, lineStart, lineEnd);\n if (result)\n return result;\n }\n return syntaxFolding(state, lineStart, lineEnd);\n }\n function mapRange(range, mapping) {\n let from = mapping.mapPos(range.from, 1), to = mapping.mapPos(range.to, -1);\n return from >= to ? undefined : { from, to };\n }\n /**\n State effect that can be attached to a transaction to fold the\n given range. (You probably only need this in exceptional\n circumstances\u2014usually you'll just want to let\n [`foldCode`](https://codemirror.net/6/docs/ref/#language.foldCode) and the [fold\n gutter](https://codemirror.net/6/docs/ref/#language.foldGutter) create the transactions.)\n */\n const foldEffect = /*@__PURE__*/StateEffect.define({ map: mapRange });\n /**\n State effect that unfolds the given range (if it was folded).\n */\n const unfoldEffect = /*@__PURE__*/StateEffect.define({ map: mapRange });\n function selectedLines(view) {\n let lines = [];\n for (let { head } of view.state.selection.ranges) {\n if (lines.some(l => l.from <= head && l.to >= head))\n continue;\n lines.push(view.lineBlockAt(head));\n }\n return lines;\n }\n /**\n The state field that stores the folded ranges (as a [decoration\n set](https://codemirror.net/6/docs/ref/#view.DecorationSet)). Can be passed to\n [`EditorState.toJSON`](https://codemirror.net/6/docs/ref/#state.EditorState.toJSON) and\n [`fromJSON`](https://codemirror.net/6/docs/ref/#state.EditorState^fromJSON) to serialize the fold\n state.\n */\n const foldState = /*@__PURE__*/StateField.define({\n create() {\n return Decoration.none;\n },\n update(folded, tr) {\n folded = folded.map(tr.changes);\n for (let e of tr.effects) {\n if (e.is(foldEffect) && !foldExists(folded, e.value.from, e.value.to)) {\n let { preparePlaceholder } = tr.state.facet(foldConfig);\n let widget = !preparePlaceholder ? foldWidget :\n Decoration.replace({ widget: new PreparedFoldWidget(preparePlaceholder(tr.state, e.value)) });\n folded = folded.update({ add: [widget.range(e.value.from, e.value.to)] });\n }\n else if (e.is(unfoldEffect)) {\n folded = folded.update({ filter: (from, to) => e.value.from != from || e.value.to != to,\n filterFrom: e.value.from, filterTo: e.value.to });\n }\n }\n // Clear folded ranges that cover the selection head\n if (tr.selection) {\n let onSelection = false, { head } = tr.selection.main;\n folded.between(head, head, (a, b) => { if (a < head && b > head)\n onSelection = true; });\n if (onSelection)\n folded = folded.update({\n filterFrom: head,\n filterTo: head,\n filter: (a, b) => b <= head || a >= head\n });\n }\n return folded;\n },\n provide: f => EditorView.decorations.from(f),\n toJSON(folded, state) {\n let ranges = [];\n folded.between(0, state.doc.length, (from, to) => { ranges.push(from, to); });\n return ranges;\n },\n fromJSON(value) {\n if (!Array.isArray(value) || value.length % 2)\n throw new RangeError(\"Invalid JSON for fold state\");\n let ranges = [];\n for (let i = 0; i < value.length;) {\n let from = value[i++], to = value[i++];\n if (typeof from != \"number\" || typeof to != \"number\")\n throw new RangeError(\"Invalid JSON for fold state\");\n ranges.push(foldWidget.range(from, to));\n }\n return Decoration.set(ranges, true);\n }\n });\n function findFold(state, from, to) {\n var _a;\n let found = null;\n (_a = state.field(foldState, false)) === null || _a === void 0 ? void 0 : _a.between(from, to, (from, to) => {\n if (!found || found.from > from)\n found = { from, to };\n });\n return found;\n }\n function foldExists(folded, from, to) {\n let found = false;\n folded.between(from, from, (a, b) => { if (a == from && b == to)\n found = true; });\n return found;\n }\n function maybeEnable(state, other) {\n return state.field(foldState, false) ? other : other.concat(StateEffect.appendConfig.of(codeFolding()));\n }\n /**\n Fold the lines that are selected, if possible.\n */\n const foldCode = view => {\n for (let line of selectedLines(view)) {\n let range = foldable(view.state, line.from, line.to);\n if (range) {\n view.dispatch({ effects: maybeEnable(view.state, [foldEffect.of(range), announceFold(view, range)]) });\n return true;\n }\n }\n return false;\n };\n /**\n Unfold folded ranges on selected lines.\n */\n const unfoldCode = view => {\n if (!view.state.field(foldState, false))\n return false;\n let effects = [];\n for (let line of selectedLines(view)) {\n let folded = findFold(view.state, line.from, line.to);\n if (folded)\n effects.push(unfoldEffect.of(folded), announceFold(view, folded, false));\n }\n if (effects.length)\n view.dispatch({ effects });\n return effects.length > 0;\n };\n function announceFold(view, range, fold = true) {\n let lineFrom = view.state.doc.lineAt(range.from).number, lineTo = view.state.doc.lineAt(range.to).number;\n return EditorView.announce.of(`${view.state.phrase(fold ? \"Folded lines\" : \"Unfolded lines\")} ${lineFrom} ${view.state.phrase(\"to\")} ${lineTo}.`);\n }\n /**\n Fold all top-level foldable ranges. Note that, in most cases,\n folding information will depend on the [syntax\n tree](https://codemirror.net/6/docs/ref/#language.syntaxTree), and folding everything may not work\n reliably when the document hasn't been fully parsed (either\n because the editor state was only just initialized, or because the\n document is so big that the parser decided not to parse it\n entirely).\n */\n const foldAll = view => {\n let { state } = view, effects = [];\n for (let pos = 0; pos < state.doc.length;) {\n let line = view.lineBlockAt(pos), range = foldable(state, line.from, line.to);\n if (range)\n effects.push(foldEffect.of(range));\n pos = (range ? view.lineBlockAt(range.to) : line).to + 1;\n }\n if (effects.length)\n view.dispatch({ effects: maybeEnable(view.state, effects) });\n return !!effects.length;\n };\n /**\n Unfold all folded code.\n */\n const unfoldAll = view => {\n let field = view.state.field(foldState, false);\n if (!field || !field.size)\n return false;\n let effects = [];\n field.between(0, view.state.doc.length, (from, to) => { effects.push(unfoldEffect.of({ from, to })); });\n view.dispatch({ effects });\n return true;\n };\n /**\n Default fold-related key bindings.\n\n - Ctrl-Shift-[ (Cmd-Alt-[ on macOS): [`foldCode`](https://codemirror.net/6/docs/ref/#language.foldCode).\n - Ctrl-Shift-] (Cmd-Alt-] on macOS): [`unfoldCode`](https://codemirror.net/6/docs/ref/#language.unfoldCode).\n - Ctrl-Alt-[: [`foldAll`](https://codemirror.net/6/docs/ref/#language.foldAll).\n - Ctrl-Alt-]: [`unfoldAll`](https://codemirror.net/6/docs/ref/#language.unfoldAll).\n */\n const foldKeymap = [\n { key: \"Ctrl-Shift-[\", mac: \"Cmd-Alt-[\", run: foldCode },\n { key: \"Ctrl-Shift-]\", mac: \"Cmd-Alt-]\", run: unfoldCode },\n { key: \"Ctrl-Alt-[\", run: foldAll },\n { key: \"Ctrl-Alt-]\", run: unfoldAll }\n ];\n const defaultConfig$2 = {\n placeholderDOM: null,\n preparePlaceholder: null,\n placeholderText: \"\u2026\"\n };\n const foldConfig = /*@__PURE__*/Facet.define({\n combine(values) { return combineConfig(values, defaultConfig$2); }\n });\n /**\n Create an extension that configures code folding.\n */\n function codeFolding(config) {\n let result = [foldState, baseTheme$1$1];\n if (config)\n result.push(foldConfig.of(config));\n return result;\n }\n function widgetToDOM(view, prepared) {\n let { state } = view, conf = state.facet(foldConfig);\n let onclick = (event) => {\n let line = view.lineBlockAt(view.posAtDOM(event.target));\n let folded = findFold(view.state, line.from, line.to);\n if (folded)\n view.dispatch({ effects: unfoldEffect.of(folded) });\n event.preventDefault();\n };\n if (conf.placeholderDOM)\n return conf.placeholderDOM(view, onclick, prepared);\n let element = document.createElement(\"span\");\n element.textContent = conf.placeholderText;\n element.setAttribute(\"aria-label\", state.phrase(\"folded code\"));\n element.title = state.phrase(\"unfold\");\n element.className = \"cm-foldPlaceholder\";\n element.onclick = onclick;\n return element;\n }\n const foldWidget = /*@__PURE__*/Decoration.replace({ widget: /*@__PURE__*/new class extends WidgetType {\n toDOM(view) { return widgetToDOM(view, null); }\n } });\n class PreparedFoldWidget extends WidgetType {\n constructor(value) {\n super();\n this.value = value;\n }\n eq(other) { return this.value == other.value; }\n toDOM(view) { return widgetToDOM(view, this.value); }\n }\n const foldGutterDefaults = {\n openText: \"\u2304\",\n closedText: \"\u203A\",\n markerDOM: null,\n domEventHandlers: {},\n foldingChanged: () => false\n };\n class FoldMarker extends GutterMarker {\n constructor(config, open) {\n super();\n this.config = config;\n this.open = open;\n }\n eq(other) { return this.config == other.config && this.open == other.open; }\n toDOM(view) {\n if (this.config.markerDOM)\n return this.config.markerDOM(this.open);\n let span = document.createElement(\"span\");\n span.textContent = this.open ? this.config.openText : this.config.closedText;\n span.title = view.state.phrase(this.open ? \"Fold line\" : \"Unfold line\");\n return span;\n }\n }\n /**\n Create an extension that registers a fold gutter, which shows a\n fold status indicator before foldable lines (which can be clicked\n to fold or unfold the line).\n */\n function foldGutter(config = {}) {\n let fullConfig = Object.assign(Object.assign({}, foldGutterDefaults), config);\n let canFold = new FoldMarker(fullConfig, true), canUnfold = new FoldMarker(fullConfig, false);\n let markers = ViewPlugin.fromClass(class {\n constructor(view) {\n this.from = view.viewport.from;\n this.markers = this.buildMarkers(view);\n }\n update(update) {\n if (update.docChanged || update.viewportChanged ||\n update.startState.facet(language) != update.state.facet(language) ||\n update.startState.field(foldState, false) != update.state.field(foldState, false) ||\n syntaxTree(update.startState) != syntaxTree(update.state) ||\n fullConfig.foldingChanged(update))\n this.markers = this.buildMarkers(update.view);\n }\n buildMarkers(view) {\n let builder = new RangeSetBuilder();\n for (let line of view.viewportLineBlocks) {\n let mark = findFold(view.state, line.from, line.to) ? canUnfold\n : foldable(view.state, line.from, line.to) ? canFold : null;\n if (mark)\n builder.add(line.from, line.from, mark);\n }\n return builder.finish();\n }\n });\n let { domEventHandlers } = fullConfig;\n return [\n markers,\n gutter({\n class: \"cm-foldGutter\",\n markers(view) { var _a; return ((_a = view.plugin(markers)) === null || _a === void 0 ? void 0 : _a.markers) || RangeSet.empty; },\n initialSpacer() {\n return new FoldMarker(fullConfig, false);\n },\n domEventHandlers: Object.assign(Object.assign({}, domEventHandlers), { click: (view, line, event) => {\n if (domEventHandlers.click && domEventHandlers.click(view, line, event))\n return true;\n let folded = findFold(view.state, line.from, line.to);\n if (folded) {\n view.dispatch({ effects: unfoldEffect.of(folded) });\n return true;\n }\n let range = foldable(view.state, line.from, line.to);\n if (range) {\n view.dispatch({ effects: foldEffect.of(range) });\n return true;\n }\n return false;\n } })\n }),\n codeFolding()\n ];\n }\n const baseTheme$1$1 = /*@__PURE__*/EditorView.baseTheme({\n \".cm-foldPlaceholder\": {\n backgroundColor: \"#eee\",\n border: \"1px solid #ddd\",\n color: \"#888\",\n borderRadius: \".2em\",\n margin: \"0 1px\",\n padding: \"0 1px\",\n cursor: \"pointer\"\n },\n \".cm-foldGutter span\": {\n padding: \"0 1px\",\n cursor: \"pointer\"\n }\n });\n\n /**\n A highlight style associates CSS styles with higlighting\n [tags](https://lezer.codemirror.net/docs/ref#highlight.Tag).\n */\n class HighlightStyle {\n constructor(\n /**\n The tag styles used to create this highlight style.\n */\n specs, options) {\n this.specs = specs;\n let modSpec;\n function def(spec) {\n let cls = StyleModule.newName();\n (modSpec || (modSpec = Object.create(null)))[\".\" + cls] = spec;\n return cls;\n }\n const all = typeof options.all == \"string\" ? options.all : options.all ? def(options.all) : undefined;\n const scopeOpt = options.scope;\n this.scope = scopeOpt instanceof Language ? (type) => type.prop(languageDataProp) == scopeOpt.data\n : scopeOpt ? (type) => type == scopeOpt : undefined;\n this.style = tagHighlighter(specs.map(style => ({\n tag: style.tag,\n class: style.class || def(Object.assign({}, style, { tag: null }))\n })), {\n all,\n }).style;\n this.module = modSpec ? new StyleModule(modSpec) : null;\n this.themeType = options.themeType;\n }\n /**\n Create a highlighter style that associates the given styles to\n the given tags. The specs must be objects that hold a style tag\n or array of tags in their `tag` property, and either a single\n `class` property providing a static CSS class (for highlighter\n that rely on external styling), or a\n [`style-mod`](https://github.com/marijnh/style-mod#documentation)-style\n set of CSS properties (which define the styling for those tags).\n \n The CSS rules created for a highlighter will be emitted in the\n order of the spec's properties. That means that for elements that\n have multiple tags associated with them, styles defined further\n down in the list will have a higher CSS precedence than styles\n defined earlier.\n */\n static define(specs, options) {\n return new HighlightStyle(specs, options || {});\n }\n }\n const highlighterFacet = /*@__PURE__*/Facet.define();\n const fallbackHighlighter = /*@__PURE__*/Facet.define({\n combine(values) { return values.length ? [values[0]] : null; }\n });\n function getHighlighters(state) {\n let main = state.facet(highlighterFacet);\n return main.length ? main : state.facet(fallbackHighlighter);\n }\n /**\n Wrap a highlighter in an editor extension that uses it to apply\n syntax highlighting to the editor content.\n\n When multiple (non-fallback) styles are provided, the styling\n applied is the union of the classes they emit.\n */\n function syntaxHighlighting(highlighter, options) {\n let ext = [treeHighlighter], themeType;\n if (highlighter instanceof HighlightStyle) {\n if (highlighter.module)\n ext.push(EditorView.styleModule.of(highlighter.module));\n themeType = highlighter.themeType;\n }\n if (options === null || options === void 0 ? void 0 : options.fallback)\n ext.push(fallbackHighlighter.of(highlighter));\n else if (themeType)\n ext.push(highlighterFacet.computeN([EditorView.darkTheme], state => {\n return state.facet(EditorView.darkTheme) == (themeType == \"dark\") ? [highlighter] : [];\n }));\n else\n ext.push(highlighterFacet.of(highlighter));\n return ext;\n }\n class TreeHighlighter {\n constructor(view) {\n this.markCache = Object.create(null);\n this.tree = syntaxTree(view.state);\n this.decorations = this.buildDeco(view, getHighlighters(view.state));\n this.decoratedTo = view.viewport.to;\n }\n update(update) {\n let tree = syntaxTree(update.state), highlighters = getHighlighters(update.state);\n let styleChange = highlighters != getHighlighters(update.startState);\n let { viewport } = update.view, decoratedToMapped = update.changes.mapPos(this.decoratedTo, 1);\n if (tree.length < viewport.to && !styleChange && tree.type == this.tree.type && decoratedToMapped >= viewport.to) {\n this.decorations = this.decorations.map(update.changes);\n this.decoratedTo = decoratedToMapped;\n }\n else if (tree != this.tree || update.viewportChanged || styleChange) {\n this.tree = tree;\n this.decorations = this.buildDeco(update.view, highlighters);\n this.decoratedTo = viewport.to;\n }\n }\n buildDeco(view, highlighters) {\n if (!highlighters || !this.tree.length)\n return Decoration.none;\n let builder = new RangeSetBuilder();\n for (let { from, to } of view.visibleRanges) {\n highlightTree(this.tree, highlighters, (from, to, style) => {\n builder.add(from, to, this.markCache[style] || (this.markCache[style] = Decoration.mark({ class: style })));\n }, from, to);\n }\n return builder.finish();\n }\n }\n const treeHighlighter = /*@__PURE__*/Prec.high(/*@__PURE__*/ViewPlugin.fromClass(TreeHighlighter, {\n decorations: v => v.decorations\n }));\n /**\n A default highlight style (works well with light themes).\n */\n const defaultHighlightStyle = /*@__PURE__*/HighlightStyle.define([\n { tag: tags$1.meta,\n color: \"#404740\" },\n { tag: tags$1.link,\n textDecoration: \"underline\" },\n { tag: tags$1.heading,\n textDecoration: \"underline\",\n fontWeight: \"bold\" },\n { tag: tags$1.emphasis,\n fontStyle: \"italic\" },\n { tag: tags$1.strong,\n fontWeight: \"bold\" },\n { tag: tags$1.strikethrough,\n textDecoration: \"line-through\" },\n { tag: tags$1.keyword,\n color: \"#708\" },\n { tag: [tags$1.atom, tags$1.bool, tags$1.url, tags$1.contentSeparator, tags$1.labelName],\n color: \"#219\" },\n { tag: [tags$1.literal, tags$1.inserted],\n color: \"#164\" },\n { tag: [tags$1.string, tags$1.deleted],\n color: \"#a11\" },\n { tag: [tags$1.regexp, tags$1.escape, /*@__PURE__*/tags$1.special(tags$1.string)],\n color: \"#e40\" },\n { tag: /*@__PURE__*/tags$1.definition(tags$1.variableName),\n color: \"#00f\" },\n { tag: /*@__PURE__*/tags$1.local(tags$1.variableName),\n color: \"#30a\" },\n { tag: [tags$1.typeName, tags$1.namespace],\n color: \"#085\" },\n { tag: tags$1.className,\n color: \"#167\" },\n { tag: [/*@__PURE__*/tags$1.special(tags$1.variableName), tags$1.macroName],\n color: \"#256\" },\n { tag: /*@__PURE__*/tags$1.definition(tags$1.propertyName),\n color: \"#00c\" },\n { tag: tags$1.comment,\n color: \"#940\" },\n { tag: tags$1.invalid,\n color: \"#f00\" }\n ]);\n\n const baseTheme$3 = /*@__PURE__*/EditorView.baseTheme({\n \"&.cm-focused .cm-matchingBracket\": { backgroundColor: \"#328c8252\" },\n \"&.cm-focused .cm-nonmatchingBracket\": { backgroundColor: \"#bb555544\" }\n });\n const DefaultScanDist = 10000, DefaultBrackets = \"()[]{}\";\n const bracketMatchingConfig = /*@__PURE__*/Facet.define({\n combine(configs) {\n return combineConfig(configs, {\n afterCursor: true,\n brackets: DefaultBrackets,\n maxScanDistance: DefaultScanDist,\n renderMatch: defaultRenderMatch\n });\n }\n });\n const matchingMark = /*@__PURE__*/Decoration.mark({ class: \"cm-matchingBracket\" }), nonmatchingMark = /*@__PURE__*/Decoration.mark({ class: \"cm-nonmatchingBracket\" });\n function defaultRenderMatch(match) {\n let decorations = [];\n let mark = match.matched ? matchingMark : nonmatchingMark;\n decorations.push(mark.range(match.start.from, match.start.to));\n if (match.end)\n decorations.push(mark.range(match.end.from, match.end.to));\n return decorations;\n }\n const bracketMatchingState = /*@__PURE__*/StateField.define({\n create() { return Decoration.none; },\n update(deco, tr) {\n if (!tr.docChanged && !tr.selection)\n return deco;\n let decorations = [];\n let config = tr.state.facet(bracketMatchingConfig);\n for (let range of tr.state.selection.ranges) {\n if (!range.empty)\n continue;\n let match = matchBrackets(tr.state, range.head, -1, config)\n || (range.head > 0 && matchBrackets(tr.state, range.head - 1, 1, config))\n || (config.afterCursor &&\n (matchBrackets(tr.state, range.head, 1, config) ||\n (range.head < tr.state.doc.length && matchBrackets(tr.state, range.head + 1, -1, config))));\n if (match)\n decorations = decorations.concat(config.renderMatch(match, tr.state));\n }\n return Decoration.set(decorations, true);\n },\n provide: f => EditorView.decorations.from(f)\n });\n const bracketMatchingUnique = [\n bracketMatchingState,\n baseTheme$3\n ];\n /**\n Create an extension that enables bracket matching. Whenever the\n cursor is next to a bracket, that bracket and the one it matches\n are highlighted. Or, when no matching bracket is found, another\n highlighting style is used to indicate this.\n */\n function bracketMatching(config = {}) {\n return [bracketMatchingConfig.of(config), bracketMatchingUnique];\n }\n /**\n When larger syntax nodes, such as HTML tags, are marked as\n opening/closing, it can be a bit messy to treat the whole node as\n a matchable bracket. This node prop allows you to define, for such\n a node, a \u2018handle\u2019\u2014the part of the node that is highlighted, and\n that the cursor must be on to activate highlighting in the first\n place.\n */\n const bracketMatchingHandle = /*@__PURE__*/new NodeProp();\n function matchingNodes(node, dir, brackets) {\n let byProp = node.prop(dir < 0 ? NodeProp.openedBy : NodeProp.closedBy);\n if (byProp)\n return byProp;\n if (node.name.length == 1) {\n let index = brackets.indexOf(node.name);\n if (index > -1 && index % 2 == (dir < 0 ? 1 : 0))\n return [brackets[index + dir]];\n }\n return null;\n }\n function findHandle(node) {\n let hasHandle = node.type.prop(bracketMatchingHandle);\n return hasHandle ? hasHandle(node.node) : node;\n }\n /**\n Find the matching bracket for the token at `pos`, scanning\n direction `dir`. Only the `brackets` and `maxScanDistance`\n properties are used from `config`, if given. Returns null if no\n bracket was found at `pos`, or a match result otherwise.\n */\n function matchBrackets(state, pos, dir, config = {}) {\n let maxScanDistance = config.maxScanDistance || DefaultScanDist, brackets = config.brackets || DefaultBrackets;\n let tree = syntaxTree(state), node = tree.resolveInner(pos, dir);\n for (let cur = node; cur; cur = cur.parent) {\n let matches = matchingNodes(cur.type, dir, brackets);\n if (matches && cur.from < cur.to) {\n let handle = findHandle(cur);\n if (handle && (dir > 0 ? pos >= handle.from && pos < handle.to : pos > handle.from && pos <= handle.to))\n return matchMarkedBrackets(state, pos, dir, cur, handle, matches, brackets);\n }\n }\n return matchPlainBrackets(state, pos, dir, tree, node.type, maxScanDistance, brackets);\n }\n function matchMarkedBrackets(_state, _pos, dir, token, handle, matching, brackets) {\n let parent = token.parent, firstToken = { from: handle.from, to: handle.to };\n let depth = 0, cursor = parent === null || parent === void 0 ? void 0 : parent.cursor();\n if (cursor && (dir < 0 ? cursor.childBefore(token.from) : cursor.childAfter(token.to)))\n do {\n if (dir < 0 ? cursor.to <= token.from : cursor.from >= token.to) {\n if (depth == 0 && matching.indexOf(cursor.type.name) > -1 && cursor.from < cursor.to) {\n let endHandle = findHandle(cursor);\n return { start: firstToken, end: endHandle ? { from: endHandle.from, to: endHandle.to } : undefined, matched: true };\n }\n else if (matchingNodes(cursor.type, dir, brackets)) {\n depth++;\n }\n else if (matchingNodes(cursor.type, -dir, brackets)) {\n if (depth == 0) {\n let endHandle = findHandle(cursor);\n return {\n start: firstToken,\n end: endHandle && endHandle.from < endHandle.to ? { from: endHandle.from, to: endHandle.to } : undefined,\n matched: false\n };\n }\n depth--;\n }\n }\n } while (dir < 0 ? cursor.prevSibling() : cursor.nextSibling());\n return { start: firstToken, matched: false };\n }\n function matchPlainBrackets(state, pos, dir, tree, tokenType, maxScanDistance, brackets) {\n let startCh = dir < 0 ? state.sliceDoc(pos - 1, pos) : state.sliceDoc(pos, pos + 1);\n let bracket = brackets.indexOf(startCh);\n if (bracket < 0 || (bracket % 2 == 0) != (dir > 0))\n return null;\n let startToken = { from: dir < 0 ? pos - 1 : pos, to: dir > 0 ? pos + 1 : pos };\n let iter = state.doc.iterRange(pos, dir > 0 ? state.doc.length : 0), depth = 0;\n for (let distance = 0; !(iter.next()).done && distance <= maxScanDistance;) {\n let text = iter.value;\n if (dir < 0)\n distance += text.length;\n let basePos = pos + distance * dir;\n for (let pos = dir > 0 ? 0 : text.length - 1, end = dir > 0 ? text.length : -1; pos != end; pos += dir) {\n let found = brackets.indexOf(text[pos]);\n if (found < 0 || tree.resolveInner(basePos + pos, 1).type != tokenType)\n continue;\n if ((found % 2 == 0) == (dir > 0)) {\n depth++;\n }\n else if (depth == 1) { // Closing\n return { start: startToken, end: { from: basePos + pos, to: basePos + pos + 1 }, matched: (found >> 1) == (bracket >> 1) };\n }\n else {\n depth--;\n }\n }\n if (dir > 0)\n distance += text.length;\n }\n return iter.done ? { start: startToken, matched: false } : null;\n }\n const noTokens = /*@__PURE__*/Object.create(null);\n const typeArray = [NodeType.none];\n const warned = [];\n // Cache of node types by name and tags\n const byTag = /*@__PURE__*/Object.create(null);\n const defaultTable = /*@__PURE__*/Object.create(null);\n for (let [legacyName, name] of [\n [\"variable\", \"variableName\"],\n [\"variable-2\", \"variableName.special\"],\n [\"string-2\", \"string.special\"],\n [\"def\", \"variableName.definition\"],\n [\"tag\", \"tagName\"],\n [\"attribute\", \"attributeName\"],\n [\"type\", \"typeName\"],\n [\"builtin\", \"variableName.standard\"],\n [\"qualifier\", \"modifier\"],\n [\"error\", \"invalid\"],\n [\"header\", \"heading\"],\n [\"property\", \"propertyName\"]\n ])\n defaultTable[legacyName] = /*@__PURE__*/createTokenType(noTokens, name);\n function warnForPart(part, msg) {\n if (warned.indexOf(part) > -1)\n return;\n warned.push(part);\n console.warn(msg);\n }\n function createTokenType(extra, tagStr) {\n let tags$1$1 = [];\n for (let name of tagStr.split(\" \")) {\n let found = [];\n for (let part of name.split(\".\")) {\n let value = (extra[part] || tags$1[part]);\n if (!value) {\n warnForPart(part, `Unknown highlighting tag ${part}`);\n }\n else if (typeof value == \"function\") {\n if (!found.length)\n warnForPart(part, `Modifier ${part} used at start of tag`);\n else\n found = found.map(value);\n }\n else {\n if (found.length)\n warnForPart(part, `Tag ${part} used as modifier`);\n else\n found = Array.isArray(value) ? value : [value];\n }\n }\n for (let tag of found)\n tags$1$1.push(tag);\n }\n if (!tags$1$1.length)\n return 0;\n let name = tagStr.replace(/ /g, \"_\"), key = name + \" \" + tags$1$1.map(t => t.id);\n let known = byTag[key];\n if (known)\n return known.id;\n let type = byTag[key] = NodeType.define({\n id: typeArray.length,\n name,\n props: [styleTags({ [name]: tags$1$1 })]\n });\n typeArray.push(type);\n return type.id;\n }\n ({\n rtl: /*@__PURE__*/Decoration.mark({ class: \"cm-iso\", inclusive: true, attributes: { dir: \"rtl\" }, bidiIsolate: Direction.RTL }),\n ltr: /*@__PURE__*/Decoration.mark({ class: \"cm-iso\", inclusive: true, attributes: { dir: \"ltr\" }, bidiIsolate: Direction.LTR }),\n auto: /*@__PURE__*/Decoration.mark({ class: \"cm-iso\", inclusive: true, attributes: { dir: \"auto\" }, bidiIsolate: null })\n });\n\n /**\n Comment or uncomment the current selection. Will use line comments\n if available, otherwise falling back to block comments.\n */\n const toggleComment = target => {\n let { state } = target, line = state.doc.lineAt(state.selection.main.from), config = getConfig(target.state, line.from);\n return config.line ? toggleLineComment(target) : config.block ? toggleBlockCommentByLine(target) : false;\n };\n function command(f, option) {\n return ({ state, dispatch }) => {\n if (state.readOnly)\n return false;\n let tr = f(option, state);\n if (!tr)\n return false;\n dispatch(state.update(tr));\n return true;\n };\n }\n /**\n Comment or uncomment the current selection using line comments.\n The line comment syntax is taken from the\n [`commentTokens`](https://codemirror.net/6/docs/ref/#commands.CommentTokens) [language\n data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt).\n */\n const toggleLineComment = /*@__PURE__*/command(changeLineComment, 0 /* CommentOption.Toggle */);\n /**\n Comment or uncomment the current selection using block comments.\n The block comment syntax is taken from the\n [`commentTokens`](https://codemirror.net/6/docs/ref/#commands.CommentTokens) [language\n data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt).\n */\n const toggleBlockComment = /*@__PURE__*/command(changeBlockComment, 0 /* CommentOption.Toggle */);\n /**\n Comment or uncomment the lines around the current selection using\n block comments.\n */\n const toggleBlockCommentByLine = /*@__PURE__*/command((o, s) => changeBlockComment(o, s, selectedLineRanges(s)), 0 /* CommentOption.Toggle */);\n function getConfig(state, pos) {\n let data = state.languageDataAt(\"commentTokens\", pos);\n return data.length ? data[0] : {};\n }\n const SearchMargin = 50;\n /**\n Determines if the given range is block-commented in the given\n state.\n */\n function findBlockComment(state, { open, close }, from, to) {\n let textBefore = state.sliceDoc(from - SearchMargin, from);\n let textAfter = state.sliceDoc(to, to + SearchMargin);\n let spaceBefore = /\\s*$/.exec(textBefore)[0].length, spaceAfter = /^\\s*/.exec(textAfter)[0].length;\n let beforeOff = textBefore.length - spaceBefore;\n if (textBefore.slice(beforeOff - open.length, beforeOff) == open &&\n textAfter.slice(spaceAfter, spaceAfter + close.length) == close) {\n return { open: { pos: from - spaceBefore, margin: spaceBefore && 1 },\n close: { pos: to + spaceAfter, margin: spaceAfter && 1 } };\n }\n let startText, endText;\n if (to - from <= 2 * SearchMargin) {\n startText = endText = state.sliceDoc(from, to);\n }\n else {\n startText = state.sliceDoc(from, from + SearchMargin);\n endText = state.sliceDoc(to - SearchMargin, to);\n }\n let startSpace = /^\\s*/.exec(startText)[0].length, endSpace = /\\s*$/.exec(endText)[0].length;\n let endOff = endText.length - endSpace - close.length;\n if (startText.slice(startSpace, startSpace + open.length) == open &&\n endText.slice(endOff, endOff + close.length) == close) {\n return { open: { pos: from + startSpace + open.length,\n margin: /\\s/.test(startText.charAt(startSpace + open.length)) ? 1 : 0 },\n close: { pos: to - endSpace - close.length,\n margin: /\\s/.test(endText.charAt(endOff - 1)) ? 1 : 0 } };\n }\n return null;\n }\n function selectedLineRanges(state) {\n let ranges = [];\n for (let r of state.selection.ranges) {\n let fromLine = state.doc.lineAt(r.from);\n let toLine = r.to <= fromLine.to ? fromLine : state.doc.lineAt(r.to);\n let last = ranges.length - 1;\n if (last >= 0 && ranges[last].to > fromLine.from)\n ranges[last].to = toLine.to;\n else\n ranges.push({ from: fromLine.from + /^\\s*/.exec(fromLine.text)[0].length, to: toLine.to });\n }\n return ranges;\n }\n // Performs toggle, comment and uncomment of block comments in\n // languages that support them.\n function changeBlockComment(option, state, ranges = state.selection.ranges) {\n let tokens = ranges.map(r => getConfig(state, r.from).block);\n if (!tokens.every(c => c))\n return null;\n let comments = ranges.map((r, i) => findBlockComment(state, tokens[i], r.from, r.to));\n if (option != 2 /* CommentOption.Uncomment */ && !comments.every(c => c)) {\n return { changes: state.changes(ranges.map((range, i) => {\n if (comments[i])\n return [];\n return [{ from: range.from, insert: tokens[i].open + \" \" }, { from: range.to, insert: \" \" + tokens[i].close }];\n })) };\n }\n else if (option != 1 /* CommentOption.Comment */ && comments.some(c => c)) {\n let changes = [];\n for (let i = 0, comment; i < comments.length; i++)\n if (comment = comments[i]) {\n let token = tokens[i], { open, close } = comment;\n changes.push({ from: open.pos - token.open.length, to: open.pos + open.margin }, { from: close.pos - close.margin, to: close.pos + token.close.length });\n }\n return { changes };\n }\n return null;\n }\n // Performs toggle, comment and uncomment of line comments.\n function changeLineComment(option, state, ranges = state.selection.ranges) {\n let lines = [];\n let prevLine = -1;\n for (let { from, to } of ranges) {\n let startI = lines.length, minIndent = 1e9;\n let token = getConfig(state, from).line;\n if (!token)\n continue;\n for (let pos = from; pos <= to;) {\n let line = state.doc.lineAt(pos);\n if (line.from > prevLine && (from == to || to > line.from)) {\n prevLine = line.from;\n let indent = /^\\s*/.exec(line.text)[0].length;\n let empty = indent == line.length;\n let comment = line.text.slice(indent, indent + token.length) == token ? indent : -1;\n if (indent < line.text.length && indent < minIndent)\n minIndent = indent;\n lines.push({ line, comment, token, indent, empty, single: false });\n }\n pos = line.to + 1;\n }\n if (minIndent < 1e9)\n for (let i = startI; i < lines.length; i++)\n if (lines[i].indent < lines[i].line.text.length)\n lines[i].indent = minIndent;\n if (lines.length == startI + 1)\n lines[startI].single = true;\n }\n if (option != 2 /* CommentOption.Uncomment */ && lines.some(l => l.comment < 0 && (!l.empty || l.single))) {\n let changes = [];\n for (let { line, token, indent, empty, single } of lines)\n if (single || !empty)\n changes.push({ from: line.from + indent, insert: token + \" \" });\n let changeSet = state.changes(changes);\n return { changes: changeSet, selection: state.selection.map(changeSet, 1) };\n }\n else if (option != 1 /* CommentOption.Comment */ && lines.some(l => l.comment >= 0)) {\n let changes = [];\n for (let { line, comment, token } of lines)\n if (comment >= 0) {\n let from = line.from + comment, to = from + token.length;\n if (line.text[to - line.from] == \" \")\n to++;\n changes.push({ from, to });\n }\n return { changes };\n }\n return null;\n }\n\n const fromHistory = /*@__PURE__*/Annotation.define();\n /**\n Transaction annotation that will prevent that transaction from\n being combined with other transactions in the undo history. Given\n `\"before\"`, it'll prevent merging with previous transactions. With\n `\"after\"`, subsequent transactions won't be combined with this\n one. With `\"full\"`, the transaction is isolated on both sides.\n */\n const isolateHistory = /*@__PURE__*/Annotation.define();\n /**\n This facet provides a way to register functions that, given a\n transaction, provide a set of effects that the history should\n store when inverting the transaction. This can be used to\n integrate some kinds of effects in the history, so that they can\n be undone (and redone again).\n */\n const invertedEffects = /*@__PURE__*/Facet.define();\n const historyConfig = /*@__PURE__*/Facet.define({\n combine(configs) {\n return combineConfig(configs, {\n minDepth: 100,\n newGroupDelay: 500,\n joinToEvent: (_t, isAdjacent) => isAdjacent,\n }, {\n minDepth: Math.max,\n newGroupDelay: Math.min,\n joinToEvent: (a, b) => (tr, adj) => a(tr, adj) || b(tr, adj)\n });\n }\n });\n const historyField_ = /*@__PURE__*/StateField.define({\n create() {\n return HistoryState.empty;\n },\n update(state, tr) {\n let config = tr.state.facet(historyConfig);\n let fromHist = tr.annotation(fromHistory);\n if (fromHist) {\n let item = HistEvent.fromTransaction(tr, fromHist.selection), from = fromHist.side;\n let other = from == 0 /* BranchName.Done */ ? state.undone : state.done;\n if (item)\n other = updateBranch(other, other.length, config.minDepth, item);\n else\n other = addSelection(other, tr.startState.selection);\n return new HistoryState(from == 0 /* BranchName.Done */ ? fromHist.rest : other, from == 0 /* BranchName.Done */ ? other : fromHist.rest);\n }\n let isolate = tr.annotation(isolateHistory);\n if (isolate == \"full\" || isolate == \"before\")\n state = state.isolate();\n if (tr.annotation(Transaction.addToHistory) === false)\n return !tr.changes.empty ? state.addMapping(tr.changes.desc) : state;\n let event = HistEvent.fromTransaction(tr);\n let time = tr.annotation(Transaction.time), userEvent = tr.annotation(Transaction.userEvent);\n if (event)\n state = state.addChanges(event, time, userEvent, config, tr);\n else if (tr.selection)\n state = state.addSelection(tr.startState.selection, time, userEvent, config.newGroupDelay);\n if (isolate == \"full\" || isolate == \"after\")\n state = state.isolate();\n return state;\n },\n toJSON(value) {\n return { done: value.done.map(e => e.toJSON()), undone: value.undone.map(e => e.toJSON()) };\n },\n fromJSON(json) {\n return new HistoryState(json.done.map(HistEvent.fromJSON), json.undone.map(HistEvent.fromJSON));\n }\n });\n /**\n Create a history extension with the given configuration.\n */\n function history(config = {}) {\n return [\n historyField_,\n historyConfig.of(config),\n EditorView.domEventHandlers({\n beforeinput(e, view) {\n let command = e.inputType == \"historyUndo\" ? undo : e.inputType == \"historyRedo\" ? redo : null;\n if (!command)\n return false;\n e.preventDefault();\n return command(view);\n }\n })\n ];\n }\n function cmd(side, selection) {\n return function ({ state, dispatch }) {\n if (!selection && state.readOnly)\n return false;\n let historyState = state.field(historyField_, false);\n if (!historyState)\n return false;\n let tr = historyState.pop(side, state, selection);\n if (!tr)\n return false;\n dispatch(tr);\n return true;\n };\n }\n /**\n Undo a single group of history events. Returns false if no group\n was available.\n */\n const undo = /*@__PURE__*/cmd(0 /* BranchName.Done */, false);\n /**\n Redo a group of history events. Returns false if no group was\n available.\n */\n const redo = /*@__PURE__*/cmd(1 /* BranchName.Undone */, false);\n /**\n Undo a change or selection change.\n */\n const undoSelection = /*@__PURE__*/cmd(0 /* BranchName.Done */, true);\n /**\n Redo a change or selection change.\n */\n const redoSelection = /*@__PURE__*/cmd(1 /* BranchName.Undone */, true);\n // History events store groups of changes or effects that need to be\n // undone/redone together.\n class HistEvent {\n constructor(\n // The changes in this event. Normal events hold at least one\n // change or effect. But it may be necessary to store selection\n // events before the first change, in which case a special type of\n // instance is created which doesn't hold any changes, with\n // changes == startSelection == undefined\n changes, \n // The effects associated with this event\n effects, \n // Accumulated mapping (from addToHistory==false) that should be\n // applied to events below this one.\n mapped, \n // The selection before this event\n startSelection, \n // Stores selection changes after this event, to be used for\n // selection undo/redo.\n selectionsAfter) {\n this.changes = changes;\n this.effects = effects;\n this.mapped = mapped;\n this.startSelection = startSelection;\n this.selectionsAfter = selectionsAfter;\n }\n setSelAfter(after) {\n return new HistEvent(this.changes, this.effects, this.mapped, this.startSelection, after);\n }\n toJSON() {\n var _a, _b, _c;\n return {\n changes: (_a = this.changes) === null || _a === void 0 ? void 0 : _a.toJSON(),\n mapped: (_b = this.mapped) === null || _b === void 0 ? void 0 : _b.toJSON(),\n startSelection: (_c = this.startSelection) === null || _c === void 0 ? void 0 : _c.toJSON(),\n selectionsAfter: this.selectionsAfter.map(s => s.toJSON())\n };\n }\n static fromJSON(json) {\n return new HistEvent(json.changes && ChangeSet.fromJSON(json.changes), [], json.mapped && ChangeDesc.fromJSON(json.mapped), json.startSelection && EditorSelection.fromJSON(json.startSelection), json.selectionsAfter.map(EditorSelection.fromJSON));\n }\n // This does not check `addToHistory` and such, it assumes the\n // transaction needs to be converted to an item. Returns null when\n // there are no changes or effects in the transaction.\n static fromTransaction(tr, selection) {\n let effects = none$2;\n for (let invert of tr.startState.facet(invertedEffects)) {\n let result = invert(tr);\n if (result.length)\n effects = effects.concat(result);\n }\n if (!effects.length && tr.changes.empty)\n return null;\n return new HistEvent(tr.changes.invert(tr.startState.doc), effects, undefined, selection || tr.startState.selection, none$2);\n }\n static selection(selections) {\n return new HistEvent(undefined, none$2, undefined, undefined, selections);\n }\n }\n function updateBranch(branch, to, maxLen, newEvent) {\n let start = to + 1 > maxLen + 20 ? to - maxLen - 1 : 0;\n let newBranch = branch.slice(start, to);\n newBranch.push(newEvent);\n return newBranch;\n }\n function isAdjacent(a, b) {\n let ranges = [], isAdjacent = false;\n a.iterChangedRanges((f, t) => ranges.push(f, t));\n b.iterChangedRanges((_f, _t, f, t) => {\n for (let i = 0; i < ranges.length;) {\n let from = ranges[i++], to = ranges[i++];\n if (t >= from && f <= to)\n isAdjacent = true;\n }\n });\n return isAdjacent;\n }\n function eqSelectionShape(a, b) {\n return a.ranges.length == b.ranges.length &&\n a.ranges.filter((r, i) => r.empty != b.ranges[i].empty).length === 0;\n }\n function conc(a, b) {\n return !a.length ? b : !b.length ? a : a.concat(b);\n }\n const none$2 = [];\n const MaxSelectionsPerEvent = 200;\n function addSelection(branch, selection) {\n if (!branch.length) {\n return [HistEvent.selection([selection])];\n }\n else {\n let lastEvent = branch[branch.length - 1];\n let sels = lastEvent.selectionsAfter.slice(Math.max(0, lastEvent.selectionsAfter.length - MaxSelectionsPerEvent));\n if (sels.length && sels[sels.length - 1].eq(selection))\n return branch;\n sels.push(selection);\n return updateBranch(branch, branch.length - 1, 1e9, lastEvent.setSelAfter(sels));\n }\n }\n // Assumes the top item has one or more selectionAfter values\n function popSelection(branch) {\n let last = branch[branch.length - 1];\n let newBranch = branch.slice();\n newBranch[branch.length - 1] = last.setSelAfter(last.selectionsAfter.slice(0, last.selectionsAfter.length - 1));\n return newBranch;\n }\n // Add a mapping to the top event in the given branch. If this maps\n // away all the changes and effects in that item, drop it and\n // propagate the mapping to the next item.\n function addMappingToBranch(branch, mapping) {\n if (!branch.length)\n return branch;\n let length = branch.length, selections = none$2;\n while (length) {\n let event = mapEvent(branch[length - 1], mapping, selections);\n if (event.changes && !event.changes.empty || event.effects.length) { // Event survived mapping\n let result = branch.slice(0, length);\n result[length - 1] = event;\n return result;\n }\n else { // Drop this event, since there's no changes or effects left\n mapping = event.mapped;\n length--;\n selections = event.selectionsAfter;\n }\n }\n return selections.length ? [HistEvent.selection(selections)] : none$2;\n }\n function mapEvent(event, mapping, extraSelections) {\n let selections = conc(event.selectionsAfter.length ? event.selectionsAfter.map(s => s.map(mapping)) : none$2, extraSelections);\n // Change-less events don't store mappings (they are always the last event in a branch)\n if (!event.changes)\n return HistEvent.selection(selections);\n let mappedChanges = event.changes.map(mapping), before = mapping.mapDesc(event.changes, true);\n let fullMapping = event.mapped ? event.mapped.composeDesc(before) : before;\n return new HistEvent(mappedChanges, StateEffect.mapEffects(event.effects, mapping), fullMapping, event.startSelection.map(before), selections);\n }\n const joinableUserEvent = /^(input\\.type|delete)($|\\.)/;\n class HistoryState {\n constructor(done, undone, prevTime = 0, prevUserEvent = undefined) {\n this.done = done;\n this.undone = undone;\n this.prevTime = prevTime;\n this.prevUserEvent = prevUserEvent;\n }\n isolate() {\n return this.prevTime ? new HistoryState(this.done, this.undone) : this;\n }\n addChanges(event, time, userEvent, config, tr) {\n let done = this.done, lastEvent = done[done.length - 1];\n if (lastEvent && lastEvent.changes && !lastEvent.changes.empty && event.changes &&\n (!userEvent || joinableUserEvent.test(userEvent)) &&\n ((!lastEvent.selectionsAfter.length &&\n time - this.prevTime < config.newGroupDelay &&\n config.joinToEvent(tr, isAdjacent(lastEvent.changes, event.changes))) ||\n // For compose (but not compose.start) events, always join with previous event\n userEvent == \"input.type.compose\")) {\n done = updateBranch(done, done.length - 1, config.minDepth, new HistEvent(event.changes.compose(lastEvent.changes), conc(event.effects, lastEvent.effects), lastEvent.mapped, lastEvent.startSelection, none$2));\n }\n else {\n done = updateBranch(done, done.length, config.minDepth, event);\n }\n return new HistoryState(done, none$2, time, userEvent);\n }\n addSelection(selection, time, userEvent, newGroupDelay) {\n let last = this.done.length ? this.done[this.done.length - 1].selectionsAfter : none$2;\n if (last.length > 0 &&\n time - this.prevTime < newGroupDelay &&\n userEvent == this.prevUserEvent && userEvent && /^select($|\\.)/.test(userEvent) &&\n eqSelectionShape(last[last.length - 1], selection))\n return this;\n return new HistoryState(addSelection(this.done, selection), this.undone, time, userEvent);\n }\n addMapping(mapping) {\n return new HistoryState(addMappingToBranch(this.done, mapping), addMappingToBranch(this.undone, mapping), this.prevTime, this.prevUserEvent);\n }\n pop(side, state, onlySelection) {\n let branch = side == 0 /* BranchName.Done */ ? this.done : this.undone;\n if (branch.length == 0)\n return null;\n let event = branch[branch.length - 1], selection = event.selectionsAfter[0] || state.selection;\n if (onlySelection && event.selectionsAfter.length) {\n return state.update({\n selection: event.selectionsAfter[event.selectionsAfter.length - 1],\n annotations: fromHistory.of({ side, rest: popSelection(branch), selection }),\n userEvent: side == 0 /* BranchName.Done */ ? \"select.undo\" : \"select.redo\",\n scrollIntoView: true\n });\n }\n else if (!event.changes) {\n return null;\n }\n else {\n let rest = branch.length == 1 ? none$2 : branch.slice(0, branch.length - 1);\n if (event.mapped)\n rest = addMappingToBranch(rest, event.mapped);\n return state.update({\n changes: event.changes,\n selection: event.startSelection,\n effects: event.effects,\n annotations: fromHistory.of({ side, rest, selection }),\n filter: false,\n userEvent: side == 0 /* BranchName.Done */ ? \"undo\" : \"redo\",\n scrollIntoView: true\n });\n }\n }\n }\n HistoryState.empty = /*@__PURE__*/new HistoryState(none$2, none$2);\n /**\n Default key bindings for the undo history.\n\n - Mod-z: [`undo`](https://codemirror.net/6/docs/ref/#commands.undo).\n - Mod-y (Mod-Shift-z on macOS) + Ctrl-Shift-z on Linux: [`redo`](https://codemirror.net/6/docs/ref/#commands.redo).\n - Mod-u: [`undoSelection`](https://codemirror.net/6/docs/ref/#commands.undoSelection).\n - Alt-u (Mod-Shift-u on macOS): [`redoSelection`](https://codemirror.net/6/docs/ref/#commands.redoSelection).\n */\n const historyKeymap = [\n { key: \"Mod-z\", run: undo, preventDefault: true },\n { key: \"Mod-y\", mac: \"Mod-Shift-z\", run: redo, preventDefault: true },\n { linux: \"Ctrl-Shift-z\", run: redo, preventDefault: true },\n { key: \"Mod-u\", run: undoSelection, preventDefault: true },\n { key: \"Alt-u\", mac: \"Mod-Shift-u\", run: redoSelection, preventDefault: true }\n ];\n\n function updateSel(sel, by) {\n return EditorSelection.create(sel.ranges.map(by), sel.mainIndex);\n }\n function setSel(state, selection) {\n return state.update({ selection, scrollIntoView: true, userEvent: \"select\" });\n }\n function moveSel({ state, dispatch }, how) {\n let selection = updateSel(state.selection, how);\n if (selection.eq(state.selection, true))\n return false;\n dispatch(setSel(state, selection));\n return true;\n }\n function rangeEnd(range, forward) {\n return EditorSelection.cursor(forward ? range.to : range.from);\n }\n function cursorByChar(view, forward) {\n return moveSel(view, range => range.empty ? view.moveByChar(range, forward) : rangeEnd(range, forward));\n }\n function ltrAtCursor(view) {\n return view.textDirectionAt(view.state.selection.main.head) == Direction.LTR;\n }\n /**\n Move the selection one character to the left (which is backward in\n left-to-right text, forward in right-to-left text).\n */\n const cursorCharLeft = view => cursorByChar(view, !ltrAtCursor(view));\n /**\n Move the selection one character to the right.\n */\n const cursorCharRight = view => cursorByChar(view, ltrAtCursor(view));\n function cursorByGroup(view, forward) {\n return moveSel(view, range => range.empty ? view.moveByGroup(range, forward) : rangeEnd(range, forward));\n }\n /**\n Move the selection to the left across one group of word or\n non-word (but also non-space) characters.\n */\n const cursorGroupLeft = view => cursorByGroup(view, !ltrAtCursor(view));\n /**\n Move the selection one group to the right.\n */\n const cursorGroupRight = view => cursorByGroup(view, ltrAtCursor(view));\n function interestingNode(state, node, bracketProp) {\n if (node.type.prop(bracketProp))\n return true;\n let len = node.to - node.from;\n return len && (len > 2 || /[^\\s,.;:]/.test(state.sliceDoc(node.from, node.to))) || node.firstChild;\n }\n function moveBySyntax(state, start, forward) {\n let pos = syntaxTree(state).resolveInner(start.head);\n let bracketProp = forward ? NodeProp.closedBy : NodeProp.openedBy;\n // Scan forward through child nodes to see if there's an interesting\n // node ahead.\n for (let at = start.head;;) {\n let next = forward ? pos.childAfter(at) : pos.childBefore(at);\n if (!next)\n break;\n if (interestingNode(state, next, bracketProp))\n pos = next;\n else\n at = forward ? next.to : next.from;\n }\n let bracket = pos.type.prop(bracketProp), match, newPos;\n if (bracket && (match = forward ? matchBrackets(state, pos.from, 1) : matchBrackets(state, pos.to, -1)) && match.matched)\n newPos = forward ? match.end.to : match.end.from;\n else\n newPos = forward ? pos.to : pos.from;\n return EditorSelection.cursor(newPos, forward ? -1 : 1);\n }\n /**\n Move the cursor over the next syntactic element to the left.\n */\n const cursorSyntaxLeft = view => moveSel(view, range => moveBySyntax(view.state, range, !ltrAtCursor(view)));\n /**\n Move the cursor over the next syntactic element to the right.\n */\n const cursorSyntaxRight = view => moveSel(view, range => moveBySyntax(view.state, range, ltrAtCursor(view)));\n function cursorByLine(view, forward) {\n return moveSel(view, range => {\n if (!range.empty)\n return rangeEnd(range, forward);\n let moved = view.moveVertically(range, forward);\n return moved.head != range.head ? moved : view.moveToLineBoundary(range, forward);\n });\n }\n /**\n Move the selection one line up.\n */\n const cursorLineUp = view => cursorByLine(view, false);\n /**\n Move the selection one line down.\n */\n const cursorLineDown = view => cursorByLine(view, true);\n function pageInfo(view) {\n let selfScroll = view.scrollDOM.clientHeight < view.scrollDOM.scrollHeight - 2;\n let marginTop = 0, marginBottom = 0, height;\n if (selfScroll) {\n for (let source of view.state.facet(EditorView.scrollMargins)) {\n let margins = source(view);\n if (margins === null || margins === void 0 ? void 0 : margins.top)\n marginTop = Math.max(margins === null || margins === void 0 ? void 0 : margins.top, marginTop);\n if (margins === null || margins === void 0 ? void 0 : margins.bottom)\n marginBottom = Math.max(margins === null || margins === void 0 ? void 0 : margins.bottom, marginBottom);\n }\n height = view.scrollDOM.clientHeight - marginTop - marginBottom;\n }\n else {\n height = (view.dom.ownerDocument.defaultView || window).innerHeight;\n }\n return { marginTop, marginBottom, selfScroll,\n height: Math.max(view.defaultLineHeight, height - 5) };\n }\n function cursorByPage(view, forward) {\n let page = pageInfo(view);\n let { state } = view, selection = updateSel(state.selection, range => {\n return range.empty ? view.moveVertically(range, forward, page.height)\n : rangeEnd(range, forward);\n });\n if (selection.eq(state.selection))\n return false;\n let effect;\n if (page.selfScroll) {\n let startPos = view.coordsAtPos(state.selection.main.head);\n let scrollRect = view.scrollDOM.getBoundingClientRect();\n let scrollTop = scrollRect.top + page.marginTop, scrollBottom = scrollRect.bottom - page.marginBottom;\n if (startPos && startPos.top > scrollTop && startPos.bottom < scrollBottom)\n effect = EditorView.scrollIntoView(selection.main.head, { y: \"start\", yMargin: startPos.top - scrollTop });\n }\n view.dispatch(setSel(state, selection), { effects: effect });\n return true;\n }\n /**\n Move the selection one page up.\n */\n const cursorPageUp = view => cursorByPage(view, false);\n /**\n Move the selection one page down.\n */\n const cursorPageDown = view => cursorByPage(view, true);\n function moveByLineBoundary(view, start, forward) {\n let line = view.lineBlockAt(start.head), moved = view.moveToLineBoundary(start, forward);\n if (moved.head == start.head && moved.head != (forward ? line.to : line.from))\n moved = view.moveToLineBoundary(start, forward, false);\n if (!forward && moved.head == line.from && line.length) {\n let space = /^\\s*/.exec(view.state.sliceDoc(line.from, Math.min(line.from + 100, line.to)))[0].length;\n if (space && start.head != line.from + space)\n moved = EditorSelection.cursor(line.from + space);\n }\n return moved;\n }\n /**\n Move the selection to the next line wrap point, or to the end of\n the line if there isn't one left on this line.\n */\n const cursorLineBoundaryForward = view => moveSel(view, range => moveByLineBoundary(view, range, true));\n /**\n Move the selection to previous line wrap point, or failing that to\n the start of the line. If the line is indented, and the cursor\n isn't already at the end of the indentation, this will move to the\n end of the indentation instead of the start of the line.\n */\n const cursorLineBoundaryBackward = view => moveSel(view, range => moveByLineBoundary(view, range, false));\n /**\n Move the selection one line wrap point to the left.\n */\n const cursorLineBoundaryLeft = view => moveSel(view, range => moveByLineBoundary(view, range, !ltrAtCursor(view)));\n /**\n Move the selection one line wrap point to the right.\n */\n const cursorLineBoundaryRight = view => moveSel(view, range => moveByLineBoundary(view, range, ltrAtCursor(view)));\n /**\n Move the selection to the start of the line.\n */\n const cursorLineStart = view => moveSel(view, range => EditorSelection.cursor(view.lineBlockAt(range.head).from, 1));\n /**\n Move the selection to the end of the line.\n */\n const cursorLineEnd = view => moveSel(view, range => EditorSelection.cursor(view.lineBlockAt(range.head).to, -1));\n function toMatchingBracket(state, dispatch, extend) {\n let found = false, selection = updateSel(state.selection, range => {\n let matching = matchBrackets(state, range.head, -1)\n || matchBrackets(state, range.head, 1)\n || (range.head > 0 && matchBrackets(state, range.head - 1, 1))\n || (range.head < state.doc.length && matchBrackets(state, range.head + 1, -1));\n if (!matching || !matching.end)\n return range;\n found = true;\n let head = matching.start.from == range.head ? matching.end.to : matching.end.from;\n return extend ? EditorSelection.range(range.anchor, head) : EditorSelection.cursor(head);\n });\n if (!found)\n return false;\n dispatch(setSel(state, selection));\n return true;\n }\n /**\n Move the selection to the bracket matching the one it is currently\n on, if any.\n */\n const cursorMatchingBracket = ({ state, dispatch }) => toMatchingBracket(state, dispatch, false);\n function extendSel(view, how) {\n let selection = updateSel(view.state.selection, range => {\n let head = how(range);\n return EditorSelection.range(range.anchor, head.head, head.goalColumn, head.bidiLevel || undefined);\n });\n if (selection.eq(view.state.selection))\n return false;\n view.dispatch(setSel(view.state, selection));\n return true;\n }\n function selectByChar(view, forward) {\n return extendSel(view, range => view.moveByChar(range, forward));\n }\n /**\n Move the selection head one character to the left, while leaving\n the anchor in place.\n */\n const selectCharLeft = view => selectByChar(view, !ltrAtCursor(view));\n /**\n Move the selection head one character to the right.\n */\n const selectCharRight = view => selectByChar(view, ltrAtCursor(view));\n function selectByGroup(view, forward) {\n return extendSel(view, range => view.moveByGroup(range, forward));\n }\n /**\n Move the selection head one [group](https://codemirror.net/6/docs/ref/#commands.cursorGroupLeft) to\n the left.\n */\n const selectGroupLeft = view => selectByGroup(view, !ltrAtCursor(view));\n /**\n Move the selection head one group to the right.\n */\n const selectGroupRight = view => selectByGroup(view, ltrAtCursor(view));\n /**\n Move the selection head over the next syntactic element to the left.\n */\n const selectSyntaxLeft = view => extendSel(view, range => moveBySyntax(view.state, range, !ltrAtCursor(view)));\n /**\n Move the selection head over the next syntactic element to the right.\n */\n const selectSyntaxRight = view => extendSel(view, range => moveBySyntax(view.state, range, ltrAtCursor(view)));\n function selectByLine(view, forward) {\n return extendSel(view, range => view.moveVertically(range, forward));\n }\n /**\n Move the selection head one line up.\n */\n const selectLineUp = view => selectByLine(view, false);\n /**\n Move the selection head one line down.\n */\n const selectLineDown = view => selectByLine(view, true);\n function selectByPage(view, forward) {\n return extendSel(view, range => view.moveVertically(range, forward, pageInfo(view).height));\n }\n /**\n Move the selection head one page up.\n */\n const selectPageUp = view => selectByPage(view, false);\n /**\n Move the selection head one page down.\n */\n const selectPageDown = view => selectByPage(view, true);\n /**\n Move the selection head to the next line boundary.\n */\n const selectLineBoundaryForward = view => extendSel(view, range => moveByLineBoundary(view, range, true));\n /**\n Move the selection head to the previous line boundary.\n */\n const selectLineBoundaryBackward = view => extendSel(view, range => moveByLineBoundary(view, range, false));\n /**\n Move the selection head one line boundary to the left.\n */\n const selectLineBoundaryLeft = view => extendSel(view, range => moveByLineBoundary(view, range, !ltrAtCursor(view)));\n /**\n Move the selection head one line boundary to the right.\n */\n const selectLineBoundaryRight = view => extendSel(view, range => moveByLineBoundary(view, range, ltrAtCursor(view)));\n /**\n Move the selection head to the start of the line.\n */\n const selectLineStart = view => extendSel(view, range => EditorSelection.cursor(view.lineBlockAt(range.head).from));\n /**\n Move the selection head to the end of the line.\n */\n const selectLineEnd = view => extendSel(view, range => EditorSelection.cursor(view.lineBlockAt(range.head).to));\n /**\n Move the selection to the start of the document.\n */\n const cursorDocStart = ({ state, dispatch }) => {\n dispatch(setSel(state, { anchor: 0 }));\n return true;\n };\n /**\n Move the selection to the end of the document.\n */\n const cursorDocEnd = ({ state, dispatch }) => {\n dispatch(setSel(state, { anchor: state.doc.length }));\n return true;\n };\n /**\n Move the selection head to the start of the document.\n */\n const selectDocStart = ({ state, dispatch }) => {\n dispatch(setSel(state, { anchor: state.selection.main.anchor, head: 0 }));\n return true;\n };\n /**\n Move the selection head to the end of the document.\n */\n const selectDocEnd = ({ state, dispatch }) => {\n dispatch(setSel(state, { anchor: state.selection.main.anchor, head: state.doc.length }));\n return true;\n };\n /**\n Select the entire document.\n */\n const selectAll$1 = ({ state, dispatch }) => {\n dispatch(state.update({ selection: { anchor: 0, head: state.doc.length }, userEvent: \"select\" }));\n return true;\n };\n /**\n Expand the selection to cover entire lines.\n */\n const selectLine = ({ state, dispatch }) => {\n let ranges = selectedLineBlocks(state).map(({ from, to }) => EditorSelection.range(from, Math.min(to + 1, state.doc.length)));\n dispatch(state.update({ selection: EditorSelection.create(ranges), userEvent: \"select\" }));\n return true;\n };\n /**\n Select the next syntactic construct that is larger than the\n selection. Note that this will only work insofar as the language\n [provider](https://codemirror.net/6/docs/ref/#language.language) you use builds up a full\n syntax tree.\n */\n const selectParentSyntax = ({ state, dispatch }) => {\n let selection = updateSel(state.selection, range => {\n var _a;\n let stack = syntaxTree(state).resolveStack(range.from, 1);\n for (let cur = stack; cur; cur = cur.next) {\n let { node } = cur;\n if (((node.from < range.from && node.to >= range.to) ||\n (node.to > range.to && node.from <= range.from)) &&\n ((_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent))\n return EditorSelection.range(node.to, node.from);\n }\n return range;\n });\n dispatch(setSel(state, selection));\n return true;\n };\n /**\n Simplify the current selection. When multiple ranges are selected,\n reduce it to its main range. Otherwise, if the selection is\n non-empty, convert it to a cursor selection.\n */\n const simplifySelection = ({ state, dispatch }) => {\n let cur = state.selection, selection = null;\n if (cur.ranges.length > 1)\n selection = EditorSelection.create([cur.main]);\n else if (!cur.main.empty)\n selection = EditorSelection.create([EditorSelection.cursor(cur.main.head)]);\n if (!selection)\n return false;\n dispatch(setSel(state, selection));\n return true;\n };\n function deleteBy(target, by) {\n if (target.state.readOnly)\n return false;\n let event = \"delete.selection\", { state } = target;\n let changes = state.changeByRange(range => {\n let { from, to } = range;\n if (from == to) {\n let towards = by(range);\n if (towards < from) {\n event = \"delete.backward\";\n towards = skipAtomic(target, towards, false);\n }\n else if (towards > from) {\n event = \"delete.forward\";\n towards = skipAtomic(target, towards, true);\n }\n from = Math.min(from, towards);\n to = Math.max(to, towards);\n }\n else {\n from = skipAtomic(target, from, false);\n to = skipAtomic(target, to, true);\n }\n return from == to ? { range } : { changes: { from, to }, range: EditorSelection.cursor(from, from < range.head ? -1 : 1) };\n });\n if (changes.changes.empty)\n return false;\n target.dispatch(state.update(changes, {\n scrollIntoView: true,\n userEvent: event,\n effects: event == \"delete.selection\" ? EditorView.announce.of(state.phrase(\"Selection deleted\")) : undefined\n }));\n return true;\n }\n function skipAtomic(target, pos, forward) {\n if (target instanceof EditorView)\n for (let ranges of target.state.facet(EditorView.atomicRanges).map(f => f(target)))\n ranges.between(pos, pos, (from, to) => {\n if (from < pos && to > pos)\n pos = forward ? to : from;\n });\n return pos;\n }\n const deleteByChar = (target, forward, byIndentUnit) => deleteBy(target, range => {\n let pos = range.from, { state } = target, line = state.doc.lineAt(pos), before, targetPos;\n if (byIndentUnit && !forward && pos > line.from && pos < line.from + 200 &&\n !/[^ \\t]/.test(before = line.text.slice(0, pos - line.from))) {\n if (before[before.length - 1] == \"\\t\")\n return pos - 1;\n let col = countColumn(before, state.tabSize), drop = col % getIndentUnit(state) || getIndentUnit(state);\n for (let i = 0; i < drop && before[before.length - 1 - i] == \" \"; i++)\n pos--;\n targetPos = pos;\n }\n else {\n targetPos = findClusterBreak(line.text, pos - line.from, forward, forward) + line.from;\n if (targetPos == pos && line.number != (forward ? state.doc.lines : 1))\n targetPos += forward ? 1 : -1;\n else if (!forward && /[\\ufe00-\\ufe0f]/.test(line.text.slice(targetPos - line.from, pos - line.from)))\n targetPos = findClusterBreak(line.text, targetPos - line.from, false, false) + line.from;\n }\n return targetPos;\n });\n /**\n Delete the selection, or, for cursor selections, the character or\n indentation unit before the cursor.\n */\n const deleteCharBackward = view => deleteByChar(view, false, true);\n /**\n Delete the selection or the character after the cursor.\n */\n const deleteCharForward = view => deleteByChar(view, true, false);\n const deleteByGroup = (target, forward) => deleteBy(target, range => {\n let pos = range.head, { state } = target, line = state.doc.lineAt(pos);\n let categorize = state.charCategorizer(pos);\n for (let cat = null;;) {\n if (pos == (forward ? line.to : line.from)) {\n if (pos == range.head && line.number != (forward ? state.doc.lines : 1))\n pos += forward ? 1 : -1;\n break;\n }\n let next = findClusterBreak(line.text, pos - line.from, forward) + line.from;\n let nextChar = line.text.slice(Math.min(pos, next) - line.from, Math.max(pos, next) - line.from);\n let nextCat = categorize(nextChar);\n if (cat != null && nextCat != cat)\n break;\n if (nextChar != \" \" || pos != range.head)\n cat = nextCat;\n pos = next;\n }\n return pos;\n });\n /**\n Delete the selection or backward until the end of the next\n [group](https://codemirror.net/6/docs/ref/#view.EditorView.moveByGroup), only skipping groups of\n whitespace when they consist of a single space.\n */\n const deleteGroupBackward = target => deleteByGroup(target, false);\n /**\n Delete the selection or forward until the end of the next group.\n */\n const deleteGroupForward = target => deleteByGroup(target, true);\n /**\n Delete the selection, or, if it is a cursor selection, delete to\n the end of the line. If the cursor is directly at the end of the\n line, delete the line break after it.\n */\n const deleteToLineEnd = view => deleteBy(view, range => {\n let lineEnd = view.lineBlockAt(range.head).to;\n return range.head < lineEnd ? lineEnd : Math.min(view.state.doc.length, range.head + 1);\n });\n /**\n Delete the selection, or, if it is a cursor selection, delete to\n the start of the line or the next line wrap before the cursor.\n */\n const deleteLineBoundaryBackward = view => deleteBy(view, range => {\n let lineStart = view.moveToLineBoundary(range, false).head;\n return range.head > lineStart ? lineStart : Math.max(0, range.head - 1);\n });\n /**\n Delete the selection, or, if it is a cursor selection, delete to\n the end of the line or the next line wrap after the cursor.\n */\n const deleteLineBoundaryForward = view => deleteBy(view, range => {\n let lineStart = view.moveToLineBoundary(range, true).head;\n return range.head < lineStart ? lineStart : Math.min(view.state.doc.length, range.head + 1);\n });\n /**\n Replace each selection range with a line break, leaving the cursor\n on the line before the break.\n */\n const splitLine = ({ state, dispatch }) => {\n if (state.readOnly)\n return false;\n let changes = state.changeByRange(range => {\n return { changes: { from: range.from, to: range.to, insert: Text.of([\"\", \"\"]) },\n range: EditorSelection.cursor(range.from) };\n });\n dispatch(state.update(changes, { scrollIntoView: true, userEvent: \"input\" }));\n return true;\n };\n /**\n Flip the characters before and after the cursor(s).\n */\n const transposeChars = ({ state, dispatch }) => {\n if (state.readOnly)\n return false;\n let changes = state.changeByRange(range => {\n if (!range.empty || range.from == 0 || range.from == state.doc.length)\n return { range };\n let pos = range.from, line = state.doc.lineAt(pos);\n let from = pos == line.from ? pos - 1 : findClusterBreak(line.text, pos - line.from, false) + line.from;\n let to = pos == line.to ? pos + 1 : findClusterBreak(line.text, pos - line.from, true) + line.from;\n return { changes: { from, to, insert: state.doc.slice(pos, to).append(state.doc.slice(from, pos)) },\n range: EditorSelection.cursor(to) };\n });\n if (changes.changes.empty)\n return false;\n dispatch(state.update(changes, { scrollIntoView: true, userEvent: \"move.character\" }));\n return true;\n };\n function selectedLineBlocks(state) {\n let blocks = [], upto = -1;\n for (let range of state.selection.ranges) {\n let startLine = state.doc.lineAt(range.from), endLine = state.doc.lineAt(range.to);\n if (!range.empty && range.to == endLine.from)\n endLine = state.doc.lineAt(range.to - 1);\n if (upto >= startLine.number) {\n let prev = blocks[blocks.length - 1];\n prev.to = endLine.to;\n prev.ranges.push(range);\n }\n else {\n blocks.push({ from: startLine.from, to: endLine.to, ranges: [range] });\n }\n upto = endLine.number + 1;\n }\n return blocks;\n }\n function moveLine(state, dispatch, forward) {\n if (state.readOnly)\n return false;\n let changes = [], ranges = [];\n for (let block of selectedLineBlocks(state)) {\n if (forward ? block.to == state.doc.length : block.from == 0)\n continue;\n let nextLine = state.doc.lineAt(forward ? block.to + 1 : block.from - 1);\n let size = nextLine.length + 1;\n if (forward) {\n changes.push({ from: block.to, to: nextLine.to }, { from: block.from, insert: nextLine.text + state.lineBreak });\n for (let r of block.ranges)\n ranges.push(EditorSelection.range(Math.min(state.doc.length, r.anchor + size), Math.min(state.doc.length, r.head + size)));\n }\n else {\n changes.push({ from: nextLine.from, to: block.from }, { from: block.to, insert: state.lineBreak + nextLine.text });\n for (let r of block.ranges)\n ranges.push(EditorSelection.range(r.anchor - size, r.head - size));\n }\n }\n if (!changes.length)\n return false;\n dispatch(state.update({\n changes,\n scrollIntoView: true,\n selection: EditorSelection.create(ranges, state.selection.mainIndex),\n userEvent: \"move.line\"\n }));\n return true;\n }\n /**\n Move the selected lines up one line.\n */\n const moveLineUp = ({ state, dispatch }) => moveLine(state, dispatch, false);\n /**\n Move the selected lines down one line.\n */\n const moveLineDown = ({ state, dispatch }) => moveLine(state, dispatch, true);\n function copyLine(state, dispatch, forward) {\n if (state.readOnly)\n return false;\n let changes = [];\n for (let block of selectedLineBlocks(state)) {\n if (forward)\n changes.push({ from: block.from, insert: state.doc.slice(block.from, block.to) + state.lineBreak });\n else\n changes.push({ from: block.to, insert: state.lineBreak + state.doc.slice(block.from, block.to) });\n }\n dispatch(state.update({ changes, scrollIntoView: true, userEvent: \"input.copyline\" }));\n return true;\n }\n /**\n Create a copy of the selected lines. Keep the selection in the top copy.\n */\n const copyLineUp = ({ state, dispatch }) => copyLine(state, dispatch, false);\n /**\n Create a copy of the selected lines. Keep the selection in the bottom copy.\n */\n const copyLineDown = ({ state, dispatch }) => copyLine(state, dispatch, true);\n /**\n Delete selected lines.\n */\n const deleteLine = view => {\n if (view.state.readOnly)\n return false;\n let { state } = view, changes = state.changes(selectedLineBlocks(state).map(({ from, to }) => {\n if (from > 0)\n from--;\n else if (to < state.doc.length)\n to++;\n return { from, to };\n }));\n let selection = updateSel(state.selection, range => {\n let dist = undefined;\n if (view.lineWrapping) {\n let block = view.lineBlockAt(range.head), pos = view.coordsAtPos(range.head, range.assoc || 1);\n if (pos)\n dist = (block.bottom + view.documentTop) - pos.bottom + view.defaultLineHeight / 2;\n }\n return view.moveVertically(range, true, dist);\n }).map(changes);\n view.dispatch({ changes, selection, scrollIntoView: true, userEvent: \"delete.line\" });\n return true;\n };\n function isBetweenBrackets(state, pos) {\n if (/\\(\\)|\\[\\]|\\{\\}/.test(state.sliceDoc(pos - 1, pos + 1)))\n return { from: pos, to: pos };\n let context = syntaxTree(state).resolveInner(pos);\n let before = context.childBefore(pos), after = context.childAfter(pos), closedBy;\n if (before && after && before.to <= pos && after.from >= pos &&\n (closedBy = before.type.prop(NodeProp.closedBy)) && closedBy.indexOf(after.name) > -1 &&\n state.doc.lineAt(before.to).from == state.doc.lineAt(after.from).from &&\n !/\\S/.test(state.sliceDoc(before.to, after.from)))\n return { from: before.to, to: after.from };\n return null;\n }\n /**\n Replace the selection with a newline and indent the newly created\n line(s). If the current line consists only of whitespace, this\n will also delete that whitespace. When the cursor is between\n matching brackets, an additional newline will be inserted after\n the cursor.\n */\n const insertNewlineAndIndent = /*@__PURE__*/newlineAndIndent(false);\n /**\n Create a blank, indented line below the current line.\n */\n const insertBlankLine = /*@__PURE__*/newlineAndIndent(true);\n function newlineAndIndent(atEof) {\n return ({ state, dispatch }) => {\n if (state.readOnly)\n return false;\n let changes = state.changeByRange(range => {\n let { from, to } = range, line = state.doc.lineAt(from);\n let explode = !atEof && from == to && isBetweenBrackets(state, from);\n if (atEof)\n from = to = (to <= line.to ? line : state.doc.lineAt(to)).to;\n let cx = new IndentContext(state, { simulateBreak: from, simulateDoubleBreak: !!explode });\n let indent = getIndentation(cx, from);\n if (indent == null)\n indent = countColumn(/^\\s*/.exec(state.doc.lineAt(from).text)[0], state.tabSize);\n while (to < line.to && /\\s/.test(line.text[to - line.from]))\n to++;\n if (explode)\n ({ from, to } = explode);\n else if (from > line.from && from < line.from + 100 && !/\\S/.test(line.text.slice(0, from)))\n from = line.from;\n let insert = [\"\", indentString(state, indent)];\n if (explode)\n insert.push(indentString(state, cx.lineIndent(line.from, -1)));\n return { changes: { from, to, insert: Text.of(insert) },\n range: EditorSelection.cursor(from + 1 + insert[1].length) };\n });\n dispatch(state.update(changes, { scrollIntoView: true, userEvent: \"input\" }));\n return true;\n };\n }\n function changeBySelectedLine(state, f) {\n let atLine = -1;\n return state.changeByRange(range => {\n let changes = [];\n for (let pos = range.from; pos <= range.to;) {\n let line = state.doc.lineAt(pos);\n if (line.number > atLine && (range.empty || range.to > line.from)) {\n f(line, changes, range);\n atLine = line.number;\n }\n pos = line.to + 1;\n }\n let changeSet = state.changes(changes);\n return { changes,\n range: EditorSelection.range(changeSet.mapPos(range.anchor, 1), changeSet.mapPos(range.head, 1)) };\n });\n }\n /**\n Auto-indent the selected lines. This uses the [indentation service\n facet](https://codemirror.net/6/docs/ref/#language.indentService) as source for auto-indent\n information.\n */\n const indentSelection = ({ state, dispatch }) => {\n if (state.readOnly)\n return false;\n let updated = Object.create(null);\n let context = new IndentContext(state, { overrideIndentation: start => {\n let found = updated[start];\n return found == null ? -1 : found;\n } });\n let changes = changeBySelectedLine(state, (line, changes, range) => {\n let indent = getIndentation(context, line.from);\n if (indent == null)\n return;\n if (!/\\S/.test(line.text))\n indent = 0;\n let cur = /^\\s*/.exec(line.text)[0];\n let norm = indentString(state, indent);\n if (cur != norm || range.from < line.from + cur.length) {\n updated[line.from] = indent;\n changes.push({ from: line.from, to: line.from + cur.length, insert: norm });\n }\n });\n if (!changes.changes.empty)\n dispatch(state.update(changes, { userEvent: \"indent\" }));\n return true;\n };\n /**\n Add a [unit](https://codemirror.net/6/docs/ref/#language.indentUnit) of indentation to all selected\n lines.\n */\n const indentMore = ({ state, dispatch }) => {\n if (state.readOnly)\n return false;\n dispatch(state.update(changeBySelectedLine(state, (line, changes) => {\n changes.push({ from: line.from, insert: state.facet(indentUnit) });\n }), { userEvent: \"input.indent\" }));\n return true;\n };\n /**\n Remove a [unit](https://codemirror.net/6/docs/ref/#language.indentUnit) of indentation from all\n selected lines.\n */\n const indentLess = ({ state, dispatch }) => {\n if (state.readOnly)\n return false;\n dispatch(state.update(changeBySelectedLine(state, (line, changes) => {\n let space = /^\\s*/.exec(line.text)[0];\n if (!space)\n return;\n let col = countColumn(space, state.tabSize), keep = 0;\n let insert = indentString(state, Math.max(0, col - getIndentUnit(state)));\n while (keep < space.length && keep < insert.length && space.charCodeAt(keep) == insert.charCodeAt(keep))\n keep++;\n changes.push({ from: line.from + keep, to: line.from + space.length, insert: insert.slice(keep) });\n }), { userEvent: \"delete.dedent\" }));\n return true;\n };\n /**\n Enables or disables\n [tab-focus mode](https://codemirror.net/6/docs/ref/#view.EditorView.setTabFocusMode). While on, this\n prevents the editor's key bindings from capturing Tab or\n Shift-Tab, making it possible for the user to move focus out of\n the editor with the keyboard.\n */\n const toggleTabFocusMode = view => {\n view.setTabFocusMode();\n return true;\n };\n /**\n Array of key bindings containing the Emacs-style bindings that are\n available on macOS by default.\n\n - Ctrl-b: [`cursorCharLeft`](https://codemirror.net/6/docs/ref/#commands.cursorCharLeft) ([`selectCharLeft`](https://codemirror.net/6/docs/ref/#commands.selectCharLeft) with Shift)\n - Ctrl-f: [`cursorCharRight`](https://codemirror.net/6/docs/ref/#commands.cursorCharRight) ([`selectCharRight`](https://codemirror.net/6/docs/ref/#commands.selectCharRight) with Shift)\n - Ctrl-p: [`cursorLineUp`](https://codemirror.net/6/docs/ref/#commands.cursorLineUp) ([`selectLineUp`](https://codemirror.net/6/docs/ref/#commands.selectLineUp) with Shift)\n - Ctrl-n: [`cursorLineDown`](https://codemirror.net/6/docs/ref/#commands.cursorLineDown) ([`selectLineDown`](https://codemirror.net/6/docs/ref/#commands.selectLineDown) with Shift)\n - Ctrl-a: [`cursorLineStart`](https://codemirror.net/6/docs/ref/#commands.cursorLineStart) ([`selectLineStart`](https://codemirror.net/6/docs/ref/#commands.selectLineStart) with Shift)\n - Ctrl-e: [`cursorLineEnd`](https://codemirror.net/6/docs/ref/#commands.cursorLineEnd) ([`selectLineEnd`](https://codemirror.net/6/docs/ref/#commands.selectLineEnd) with Shift)\n - Ctrl-d: [`deleteCharForward`](https://codemirror.net/6/docs/ref/#commands.deleteCharForward)\n - Ctrl-h: [`deleteCharBackward`](https://codemirror.net/6/docs/ref/#commands.deleteCharBackward)\n - Ctrl-k: [`deleteToLineEnd`](https://codemirror.net/6/docs/ref/#commands.deleteToLineEnd)\n - Ctrl-Alt-h: [`deleteGroupBackward`](https://codemirror.net/6/docs/ref/#commands.deleteGroupBackward)\n - Ctrl-o: [`splitLine`](https://codemirror.net/6/docs/ref/#commands.splitLine)\n - Ctrl-t: [`transposeChars`](https://codemirror.net/6/docs/ref/#commands.transposeChars)\n - Ctrl-v: [`cursorPageDown`](https://codemirror.net/6/docs/ref/#commands.cursorPageDown)\n - Alt-v: [`cursorPageUp`](https://codemirror.net/6/docs/ref/#commands.cursorPageUp)\n */\n const emacsStyleKeymap = [\n { key: \"Ctrl-b\", run: cursorCharLeft, shift: selectCharLeft, preventDefault: true },\n { key: \"Ctrl-f\", run: cursorCharRight, shift: selectCharRight },\n { key: \"Ctrl-p\", run: cursorLineUp, shift: selectLineUp },\n { key: \"Ctrl-n\", run: cursorLineDown, shift: selectLineDown },\n { key: \"Ctrl-a\", run: cursorLineStart, shift: selectLineStart },\n { key: \"Ctrl-e\", run: cursorLineEnd, shift: selectLineEnd },\n { key: \"Ctrl-d\", run: deleteCharForward },\n { key: \"Ctrl-h\", run: deleteCharBackward },\n { key: \"Ctrl-k\", run: deleteToLineEnd },\n { key: \"Ctrl-Alt-h\", run: deleteGroupBackward },\n { key: \"Ctrl-o\", run: splitLine },\n { key: \"Ctrl-t\", run: transposeChars },\n { key: \"Ctrl-v\", run: cursorPageDown },\n ];\n /**\n An array of key bindings closely sticking to platform-standard or\n widely used bindings. (This includes the bindings from\n [`emacsStyleKeymap`](https://codemirror.net/6/docs/ref/#commands.emacsStyleKeymap), with their `key`\n property changed to `mac`.)\n\n - ArrowLeft: [`cursorCharLeft`](https://codemirror.net/6/docs/ref/#commands.cursorCharLeft) ([`selectCharLeft`](https://codemirror.net/6/docs/ref/#commands.selectCharLeft) with Shift)\n - ArrowRight: [`cursorCharRight`](https://codemirror.net/6/docs/ref/#commands.cursorCharRight) ([`selectCharRight`](https://codemirror.net/6/docs/ref/#commands.selectCharRight) with Shift)\n - Ctrl-ArrowLeft (Alt-ArrowLeft on macOS): [`cursorGroupLeft`](https://codemirror.net/6/docs/ref/#commands.cursorGroupLeft) ([`selectGroupLeft`](https://codemirror.net/6/docs/ref/#commands.selectGroupLeft) with Shift)\n - Ctrl-ArrowRight (Alt-ArrowRight on macOS): [`cursorGroupRight`](https://codemirror.net/6/docs/ref/#commands.cursorGroupRight) ([`selectGroupRight`](https://codemirror.net/6/docs/ref/#commands.selectGroupRight) with Shift)\n - Cmd-ArrowLeft (on macOS): [`cursorLineStart`](https://codemirror.net/6/docs/ref/#commands.cursorLineStart) ([`selectLineStart`](https://codemirror.net/6/docs/ref/#commands.selectLineStart) with Shift)\n - Cmd-ArrowRight (on macOS): [`cursorLineEnd`](https://codemirror.net/6/docs/ref/#commands.cursorLineEnd) ([`selectLineEnd`](https://codemirror.net/6/docs/ref/#commands.selectLineEnd) with Shift)\n - ArrowUp: [`cursorLineUp`](https://codemirror.net/6/docs/ref/#commands.cursorLineUp) ([`selectLineUp`](https://codemirror.net/6/docs/ref/#commands.selectLineUp) with Shift)\n - ArrowDown: [`cursorLineDown`](https://codemirror.net/6/docs/ref/#commands.cursorLineDown) ([`selectLineDown`](https://codemirror.net/6/docs/ref/#commands.selectLineDown) with Shift)\n - Cmd-ArrowUp (on macOS): [`cursorDocStart`](https://codemirror.net/6/docs/ref/#commands.cursorDocStart) ([`selectDocStart`](https://codemirror.net/6/docs/ref/#commands.selectDocStart) with Shift)\n - Cmd-ArrowDown (on macOS): [`cursorDocEnd`](https://codemirror.net/6/docs/ref/#commands.cursorDocEnd) ([`selectDocEnd`](https://codemirror.net/6/docs/ref/#commands.selectDocEnd) with Shift)\n - Ctrl-ArrowUp (on macOS): [`cursorPageUp`](https://codemirror.net/6/docs/ref/#commands.cursorPageUp) ([`selectPageUp`](https://codemirror.net/6/docs/ref/#commands.selectPageUp) with Shift)\n - Ctrl-ArrowDown (on macOS): [`cursorPageDown`](https://codemirror.net/6/docs/ref/#commands.cursorPageDown) ([`selectPageDown`](https://codemirror.net/6/docs/ref/#commands.selectPageDown) with Shift)\n - PageUp: [`cursorPageUp`](https://codemirror.net/6/docs/ref/#commands.cursorPageUp) ([`selectPageUp`](https://codemirror.net/6/docs/ref/#commands.selectPageUp) with Shift)\n - PageDown: [`cursorPageDown`](https://codemirror.net/6/docs/ref/#commands.cursorPageDown) ([`selectPageDown`](https://codemirror.net/6/docs/ref/#commands.selectPageDown) with Shift)\n - Home: [`cursorLineBoundaryBackward`](https://codemirror.net/6/docs/ref/#commands.cursorLineBoundaryBackward) ([`selectLineBoundaryBackward`](https://codemirror.net/6/docs/ref/#commands.selectLineBoundaryBackward) with Shift)\n - End: [`cursorLineBoundaryForward`](https://codemirror.net/6/docs/ref/#commands.cursorLineBoundaryForward) ([`selectLineBoundaryForward`](https://codemirror.net/6/docs/ref/#commands.selectLineBoundaryForward) with Shift)\n - Ctrl-Home (Cmd-Home on macOS): [`cursorDocStart`](https://codemirror.net/6/docs/ref/#commands.cursorDocStart) ([`selectDocStart`](https://codemirror.net/6/docs/ref/#commands.selectDocStart) with Shift)\n - Ctrl-End (Cmd-Home on macOS): [`cursorDocEnd`](https://codemirror.net/6/docs/ref/#commands.cursorDocEnd) ([`selectDocEnd`](https://codemirror.net/6/docs/ref/#commands.selectDocEnd) with Shift)\n - Enter: [`insertNewlineAndIndent`](https://codemirror.net/6/docs/ref/#commands.insertNewlineAndIndent)\n - Ctrl-a (Cmd-a on macOS): [`selectAll`](https://codemirror.net/6/docs/ref/#commands.selectAll)\n - Backspace: [`deleteCharBackward`](https://codemirror.net/6/docs/ref/#commands.deleteCharBackward)\n - Delete: [`deleteCharForward`](https://codemirror.net/6/docs/ref/#commands.deleteCharForward)\n - Ctrl-Backspace (Alt-Backspace on macOS): [`deleteGroupBackward`](https://codemirror.net/6/docs/ref/#commands.deleteGroupBackward)\n - Ctrl-Delete (Alt-Delete on macOS): [`deleteGroupForward`](https://codemirror.net/6/docs/ref/#commands.deleteGroupForward)\n - Cmd-Backspace (macOS): [`deleteLineBoundaryBackward`](https://codemirror.net/6/docs/ref/#commands.deleteLineBoundaryBackward).\n - Cmd-Delete (macOS): [`deleteLineBoundaryForward`](https://codemirror.net/6/docs/ref/#commands.deleteLineBoundaryForward).\n */\n const standardKeymap = /*@__PURE__*/[\n { key: \"ArrowLeft\", run: cursorCharLeft, shift: selectCharLeft, preventDefault: true },\n { key: \"Mod-ArrowLeft\", mac: \"Alt-ArrowLeft\", run: cursorGroupLeft, shift: selectGroupLeft, preventDefault: true },\n { mac: \"Cmd-ArrowLeft\", run: cursorLineBoundaryLeft, shift: selectLineBoundaryLeft, preventDefault: true },\n { key: \"ArrowRight\", run: cursorCharRight, shift: selectCharRight, preventDefault: true },\n { key: \"Mod-ArrowRight\", mac: \"Alt-ArrowRight\", run: cursorGroupRight, shift: selectGroupRight, preventDefault: true },\n { mac: \"Cmd-ArrowRight\", run: cursorLineBoundaryRight, shift: selectLineBoundaryRight, preventDefault: true },\n { key: \"ArrowUp\", run: cursorLineUp, shift: selectLineUp, preventDefault: true },\n { mac: \"Cmd-ArrowUp\", run: cursorDocStart, shift: selectDocStart },\n { mac: \"Ctrl-ArrowUp\", run: cursorPageUp, shift: selectPageUp },\n { key: \"ArrowDown\", run: cursorLineDown, shift: selectLineDown, preventDefault: true },\n { mac: \"Cmd-ArrowDown\", run: cursorDocEnd, shift: selectDocEnd },\n { mac: \"Ctrl-ArrowDown\", run: cursorPageDown, shift: selectPageDown },\n { key: \"PageUp\", run: cursorPageUp, shift: selectPageUp },\n { key: \"PageDown\", run: cursorPageDown, shift: selectPageDown },\n { key: \"Home\", run: cursorLineBoundaryBackward, shift: selectLineBoundaryBackward, preventDefault: true },\n { key: \"Mod-Home\", run: cursorDocStart, shift: selectDocStart },\n { key: \"End\", run: cursorLineBoundaryForward, shift: selectLineBoundaryForward, preventDefault: true },\n { key: \"Mod-End\", run: cursorDocEnd, shift: selectDocEnd },\n { key: \"Enter\", run: insertNewlineAndIndent },\n { key: \"Mod-a\", run: selectAll$1 },\n { key: \"Backspace\", run: deleteCharBackward, shift: deleteCharBackward },\n { key: \"Delete\", run: deleteCharForward },\n { key: \"Mod-Backspace\", mac: \"Alt-Backspace\", run: deleteGroupBackward },\n { key: \"Mod-Delete\", mac: \"Alt-Delete\", run: deleteGroupForward },\n { mac: \"Mod-Backspace\", run: deleteLineBoundaryBackward },\n { mac: \"Mod-Delete\", run: deleteLineBoundaryForward }\n ].concat(/*@__PURE__*/emacsStyleKeymap.map(b => ({ mac: b.key, run: b.run, shift: b.shift })));\n /**\n The default keymap. Includes all bindings from\n [`standardKeymap`](https://codemirror.net/6/docs/ref/#commands.standardKeymap) plus the following:\n\n - Alt-ArrowLeft (Ctrl-ArrowLeft on macOS): [`cursorSyntaxLeft`](https://codemirror.net/6/docs/ref/#commands.cursorSyntaxLeft) ([`selectSyntaxLeft`](https://codemirror.net/6/docs/ref/#commands.selectSyntaxLeft) with Shift)\n - Alt-ArrowRight (Ctrl-ArrowRight on macOS): [`cursorSyntaxRight`](https://codemirror.net/6/docs/ref/#commands.cursorSyntaxRight) ([`selectSyntaxRight`](https://codemirror.net/6/docs/ref/#commands.selectSyntaxRight) with Shift)\n - Alt-ArrowUp: [`moveLineUp`](https://codemirror.net/6/docs/ref/#commands.moveLineUp)\n - Alt-ArrowDown: [`moveLineDown`](https://codemirror.net/6/docs/ref/#commands.moveLineDown)\n - Shift-Alt-ArrowUp: [`copyLineUp`](https://codemirror.net/6/docs/ref/#commands.copyLineUp)\n - Shift-Alt-ArrowDown: [`copyLineDown`](https://codemirror.net/6/docs/ref/#commands.copyLineDown)\n - Escape: [`simplifySelection`](https://codemirror.net/6/docs/ref/#commands.simplifySelection)\n - Ctrl-Enter (Cmd-Enter on macOS): [`insertBlankLine`](https://codemirror.net/6/docs/ref/#commands.insertBlankLine)\n - Alt-l (Ctrl-l on macOS): [`selectLine`](https://codemirror.net/6/docs/ref/#commands.selectLine)\n - Ctrl-i (Cmd-i on macOS): [`selectParentSyntax`](https://codemirror.net/6/docs/ref/#commands.selectParentSyntax)\n - Ctrl-[ (Cmd-[ on macOS): [`indentLess`](https://codemirror.net/6/docs/ref/#commands.indentLess)\n - Ctrl-] (Cmd-] on macOS): [`indentMore`](https://codemirror.net/6/docs/ref/#commands.indentMore)\n - Ctrl-Alt-\\\\ (Cmd-Alt-\\\\ on macOS): [`indentSelection`](https://codemirror.net/6/docs/ref/#commands.indentSelection)\n - Shift-Ctrl-k (Shift-Cmd-k on macOS): [`deleteLine`](https://codemirror.net/6/docs/ref/#commands.deleteLine)\n - Shift-Ctrl-\\\\ (Shift-Cmd-\\\\ on macOS): [`cursorMatchingBracket`](https://codemirror.net/6/docs/ref/#commands.cursorMatchingBracket)\n - Ctrl-/ (Cmd-/ on macOS): [`toggleComment`](https://codemirror.net/6/docs/ref/#commands.toggleComment).\n - Shift-Alt-a: [`toggleBlockComment`](https://codemirror.net/6/docs/ref/#commands.toggleBlockComment).\n - Ctrl-m (Alt-Shift-m on macOS): [`toggleTabFocusMode`](https://codemirror.net/6/docs/ref/#commands.toggleTabFocusMode).\n */\n const defaultKeymap = /*@__PURE__*/[\n { key: \"Alt-ArrowLeft\", mac: \"Ctrl-ArrowLeft\", run: cursorSyntaxLeft, shift: selectSyntaxLeft },\n { key: \"Alt-ArrowRight\", mac: \"Ctrl-ArrowRight\", run: cursorSyntaxRight, shift: selectSyntaxRight },\n { key: \"Alt-ArrowUp\", run: moveLineUp },\n { key: \"Shift-Alt-ArrowUp\", run: copyLineUp },\n { key: \"Alt-ArrowDown\", run: moveLineDown },\n { key: \"Shift-Alt-ArrowDown\", run: copyLineDown },\n { key: \"Escape\", run: simplifySelection },\n { key: \"Mod-Enter\", run: insertBlankLine },\n { key: \"Alt-l\", mac: \"Ctrl-l\", run: selectLine },\n { key: \"Mod-i\", run: selectParentSyntax, preventDefault: true },\n { key: \"Mod-[\", run: indentLess },\n { key: \"Mod-]\", run: indentMore },\n { key: \"Mod-Alt-\\\\\", run: indentSelection },\n { key: \"Shift-Mod-k\", run: deleteLine },\n { key: \"Shift-Mod-\\\\\", run: cursorMatchingBracket },\n { key: \"Mod-/\", run: toggleComment },\n { key: \"Alt-A\", run: toggleBlockComment },\n { key: \"Ctrl-m\", mac: \"Shift-Alt-m\", run: toggleTabFocusMode },\n ].concat(standardKeymap);\n /**\n A binding that binds Tab to [`indentMore`](https://codemirror.net/6/docs/ref/#commands.indentMore) and\n Shift-Tab to [`indentLess`](https://codemirror.net/6/docs/ref/#commands.indentLess).\n Please see the [Tab example](../../examples/tab/) before using\n this.\n */\n const indentWithTab = { key: \"Tab\", run: indentMore, shift: indentLess };\n\n function crelt() {\n var elt = arguments[0];\n if (typeof elt == \"string\") elt = document.createElement(elt);\n var i = 1, next = arguments[1];\n if (next && typeof next == \"object\" && next.nodeType == null && !Array.isArray(next)) {\n for (var name in next) if (Object.prototype.hasOwnProperty.call(next, name)) {\n var value = next[name];\n if (typeof value == \"string\") elt.setAttribute(name, value);\n else if (value != null) elt[name] = value;\n }\n i++;\n }\n for (; i < arguments.length; i++) add(elt, arguments[i]);\n return elt\n }\n\n function add(elt, child) {\n if (typeof child == \"string\") {\n elt.appendChild(document.createTextNode(child));\n } else if (child == null) ; else if (child.nodeType != null) {\n elt.appendChild(child);\n } else if (Array.isArray(child)) {\n for (var i = 0; i < child.length; i++) add(elt, child[i]);\n } else {\n throw new RangeError(\"Unsupported child node: \" + child)\n }\n }\n\n const basicNormalize = typeof String.prototype.normalize == \"function\"\n ? x => x.normalize(\"NFKD\") : x => x;\n /**\n A search cursor provides an iterator over text matches in a\n document.\n */\n class SearchCursor {\n /**\n Create a text cursor. The query is the search string, `from` to\n `to` provides the region to search.\n \n When `normalize` is given, it will be called, on both the query\n string and the content it is matched against, before comparing.\n You can, for example, create a case-insensitive search by\n passing `s => s.toLowerCase()`.\n \n Text is always normalized with\n [`.normalize(\"NFKD\")`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize)\n (when supported).\n */\n constructor(text, query, from = 0, to = text.length, normalize, test) {\n this.test = test;\n /**\n The current match (only holds a meaningful value after\n [`next`](https://codemirror.net/6/docs/ref/#search.SearchCursor.next) has been called and when\n `done` is false).\n */\n this.value = { from: 0, to: 0 };\n /**\n Whether the end of the iterated region has been reached.\n */\n this.done = false;\n this.matches = [];\n this.buffer = \"\";\n this.bufferPos = 0;\n this.iter = text.iterRange(from, to);\n this.bufferStart = from;\n this.normalize = normalize ? x => normalize(basicNormalize(x)) : basicNormalize;\n this.query = this.normalize(query);\n }\n peek() {\n if (this.bufferPos == this.buffer.length) {\n this.bufferStart += this.buffer.length;\n this.iter.next();\n if (this.iter.done)\n return -1;\n this.bufferPos = 0;\n this.buffer = this.iter.value;\n }\n return codePointAt(this.buffer, this.bufferPos);\n }\n /**\n Look for the next match. Updates the iterator's\n [`value`](https://codemirror.net/6/docs/ref/#search.SearchCursor.value) and\n [`done`](https://codemirror.net/6/docs/ref/#search.SearchCursor.done) properties. Should be called\n at least once before using the cursor.\n */\n next() {\n while (this.matches.length)\n this.matches.pop();\n return this.nextOverlapping();\n }\n /**\n The `next` method will ignore matches that partially overlap a\n previous match. This method behaves like `next`, but includes\n such matches.\n */\n nextOverlapping() {\n for (;;) {\n let next = this.peek();\n if (next < 0) {\n this.done = true;\n return this;\n }\n let str = fromCodePoint(next), start = this.bufferStart + this.bufferPos;\n this.bufferPos += codePointSize(next);\n let norm = this.normalize(str);\n for (let i = 0, pos = start;; i++) {\n let code = norm.charCodeAt(i);\n let match = this.match(code, pos, this.bufferPos + this.bufferStart);\n if (i == norm.length - 1) {\n if (match) {\n this.value = match;\n return this;\n }\n break;\n }\n if (pos == start && i < str.length && str.charCodeAt(i) == code)\n pos++;\n }\n }\n }\n match(code, pos, end) {\n let match = null;\n for (let i = 0; i < this.matches.length; i += 2) {\n let index = this.matches[i], keep = false;\n if (this.query.charCodeAt(index) == code) {\n if (index == this.query.length - 1) {\n match = { from: this.matches[i + 1], to: end };\n }\n else {\n this.matches[i]++;\n keep = true;\n }\n }\n if (!keep) {\n this.matches.splice(i, 2);\n i -= 2;\n }\n }\n if (this.query.charCodeAt(0) == code) {\n if (this.query.length == 1)\n match = { from: pos, to: end };\n else\n this.matches.push(1, pos);\n }\n if (match && this.test && !this.test(match.from, match.to, this.buffer, this.bufferStart))\n match = null;\n return match;\n }\n }\n if (typeof Symbol != \"undefined\")\n SearchCursor.prototype[Symbol.iterator] = function () { return this; };\n\n const empty = { from: -1, to: -1, match: /*@__PURE__*//.*/.exec(\"\") };\n const baseFlags = \"gm\" + (/x/.unicode == null ? \"\" : \"u\");\n /**\n This class is similar to [`SearchCursor`](https://codemirror.net/6/docs/ref/#search.SearchCursor)\n but searches for a regular expression pattern instead of a plain\n string.\n */\n class RegExpCursor {\n /**\n Create a cursor that will search the given range in the given\n document. `query` should be the raw pattern (as you'd pass it to\n `new RegExp`).\n */\n constructor(text, query, options, from = 0, to = text.length) {\n this.text = text;\n this.to = to;\n this.curLine = \"\";\n /**\n Set to `true` when the cursor has reached the end of the search\n range.\n */\n this.done = false;\n /**\n Will contain an object with the extent of the match and the\n match object when [`next`](https://codemirror.net/6/docs/ref/#search.RegExpCursor.next)\n sucessfully finds a match.\n */\n this.value = empty;\n if (/\\\\[sWDnr]|\\n|\\r|\\[\\^/.test(query))\n return new MultilineRegExpCursor(text, query, options, from, to);\n this.re = new RegExp(query, baseFlags + ((options === null || options === void 0 ? void 0 : options.ignoreCase) ? \"i\" : \"\"));\n this.test = options === null || options === void 0 ? void 0 : options.test;\n this.iter = text.iter();\n let startLine = text.lineAt(from);\n this.curLineStart = startLine.from;\n this.matchPos = toCharEnd(text, from);\n this.getLine(this.curLineStart);\n }\n getLine(skip) {\n this.iter.next(skip);\n if (this.iter.lineBreak) {\n this.curLine = \"\";\n }\n else {\n this.curLine = this.iter.value;\n if (this.curLineStart + this.curLine.length > this.to)\n this.curLine = this.curLine.slice(0, this.to - this.curLineStart);\n this.iter.next();\n }\n }\n nextLine() {\n this.curLineStart = this.curLineStart + this.curLine.length + 1;\n if (this.curLineStart > this.to)\n this.curLine = \"\";\n else\n this.getLine(0);\n }\n /**\n Move to the next match, if there is one.\n */\n next() {\n for (let off = this.matchPos - this.curLineStart;;) {\n this.re.lastIndex = off;\n let match = this.matchPos <= this.to && this.re.exec(this.curLine);\n if (match) {\n let from = this.curLineStart + match.index, to = from + match[0].length;\n this.matchPos = toCharEnd(this.text, to + (from == to ? 1 : 0));\n if (from == this.curLineStart + this.curLine.length)\n this.nextLine();\n if ((from < to || from > this.value.to) && (!this.test || this.test(from, to, match))) {\n this.value = { from, to, match };\n return this;\n }\n off = this.matchPos - this.curLineStart;\n }\n else if (this.curLineStart + this.curLine.length < this.to) {\n this.nextLine();\n off = 0;\n }\n else {\n this.done = true;\n return this;\n }\n }\n }\n }\n const flattened = /*@__PURE__*/new WeakMap();\n // Reusable (partially) flattened document strings\n class FlattenedDoc {\n constructor(from, text) {\n this.from = from;\n this.text = text;\n }\n get to() { return this.from + this.text.length; }\n static get(doc, from, to) {\n let cached = flattened.get(doc);\n if (!cached || cached.from >= to || cached.to <= from) {\n let flat = new FlattenedDoc(from, doc.sliceString(from, to));\n flattened.set(doc, flat);\n return flat;\n }\n if (cached.from == from && cached.to == to)\n return cached;\n let { text, from: cachedFrom } = cached;\n if (cachedFrom > from) {\n text = doc.sliceString(from, cachedFrom) + text;\n cachedFrom = from;\n }\n if (cached.to < to)\n text += doc.sliceString(cached.to, to);\n flattened.set(doc, new FlattenedDoc(cachedFrom, text));\n return new FlattenedDoc(from, text.slice(from - cachedFrom, to - cachedFrom));\n }\n }\n class MultilineRegExpCursor {\n constructor(text, query, options, from, to) {\n this.text = text;\n this.to = to;\n this.done = false;\n this.value = empty;\n this.matchPos = toCharEnd(text, from);\n this.re = new RegExp(query, baseFlags + ((options === null || options === void 0 ? void 0 : options.ignoreCase) ? \"i\" : \"\"));\n this.test = options === null || options === void 0 ? void 0 : options.test;\n this.flat = FlattenedDoc.get(text, from, this.chunkEnd(from + 5000 /* Chunk.Base */));\n }\n chunkEnd(pos) {\n return pos >= this.to ? this.to : this.text.lineAt(pos).to;\n }\n next() {\n for (;;) {\n let off = this.re.lastIndex = this.matchPos - this.flat.from;\n let match = this.re.exec(this.flat.text);\n // Skip empty matches directly after the last match\n if (match && !match[0] && match.index == off) {\n this.re.lastIndex = off + 1;\n match = this.re.exec(this.flat.text);\n }\n if (match) {\n let from = this.flat.from + match.index, to = from + match[0].length;\n // If a match goes almost to the end of a noncomplete chunk, try\n // again, since it'll likely be able to match more\n if ((this.flat.to >= this.to || match.index + match[0].length <= this.flat.text.length - 10) &&\n (!this.test || this.test(from, to, match))) {\n this.value = { from, to, match };\n this.matchPos = toCharEnd(this.text, to + (from == to ? 1 : 0));\n return this;\n }\n }\n if (this.flat.to == this.to) {\n this.done = true;\n return this;\n }\n // Grow the flattened doc\n this.flat = FlattenedDoc.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2));\n }\n }\n }\n if (typeof Symbol != \"undefined\") {\n RegExpCursor.prototype[Symbol.iterator] = MultilineRegExpCursor.prototype[Symbol.iterator] =\n function () { return this; };\n }\n function validRegExp(source) {\n try {\n new RegExp(source, baseFlags);\n return true;\n }\n catch (_a) {\n return false;\n }\n }\n function toCharEnd(text, pos) {\n if (pos >= text.length)\n return pos;\n let line = text.lineAt(pos), next;\n while (pos < line.to && (next = line.text.charCodeAt(pos - line.from)) >= 0xDC00 && next < 0xE000)\n pos++;\n return pos;\n }\n\n function createLineDialog(view) {\n let line = String(view.state.doc.lineAt(view.state.selection.main.head).number);\n let input = crelt(\"input\", { class: \"cm-textfield\", name: \"line\", value: line });\n let dom = crelt(\"form\", {\n class: \"cm-gotoLine\",\n onkeydown: (event) => {\n if (event.keyCode == 27) { // Escape\n event.preventDefault();\n view.dispatch({ effects: dialogEffect.of(false) });\n view.focus();\n }\n else if (event.keyCode == 13) { // Enter\n event.preventDefault();\n go();\n }\n },\n onsubmit: (event) => {\n event.preventDefault();\n go();\n }\n }, crelt(\"label\", view.state.phrase(\"Go to line\"), \": \", input), \" \", crelt(\"button\", { class: \"cm-button\", type: \"submit\" }, view.state.phrase(\"go\")));\n function go() {\n let match = /^([+-])?(\\d+)?(:\\d+)?(%)?$/.exec(input.value);\n if (!match)\n return;\n let { state } = view, startLine = state.doc.lineAt(state.selection.main.head);\n let [, sign, ln, cl, percent] = match;\n let col = cl ? +cl.slice(1) : 0;\n let line = ln ? +ln : startLine.number;\n if (ln && percent) {\n let pc = line / 100;\n if (sign)\n pc = pc * (sign == \"-\" ? -1 : 1) + (startLine.number / state.doc.lines);\n line = Math.round(state.doc.lines * pc);\n }\n else if (ln && sign) {\n line = line * (sign == \"-\" ? -1 : 1) + startLine.number;\n }\n let docLine = state.doc.line(Math.max(1, Math.min(state.doc.lines, line)));\n let selection = EditorSelection.cursor(docLine.from + Math.max(0, Math.min(col, docLine.length)));\n view.dispatch({\n effects: [dialogEffect.of(false), EditorView.scrollIntoView(selection.from, { y: 'center' })],\n selection,\n });\n view.focus();\n }\n return { dom };\n }\n const dialogEffect = /*@__PURE__*/StateEffect.define();\n const dialogField = /*@__PURE__*/StateField.define({\n create() { return true; },\n update(value, tr) {\n for (let e of tr.effects)\n if (e.is(dialogEffect))\n value = e.value;\n return value;\n },\n provide: f => showPanel.from(f, val => val ? createLineDialog : null)\n });\n /**\n Command that shows a dialog asking the user for a line number, and\n when a valid position is provided, moves the cursor to that line.\n\n Supports line numbers, relative line offsets prefixed with `+` or\n `-`, document percentages suffixed with `%`, and an optional\n column position by adding `:` and a second number after the line\n number.\n */\n const gotoLine = view => {\n let panel = getPanel(view, createLineDialog);\n if (!panel) {\n let effects = [dialogEffect.of(true)];\n if (view.state.field(dialogField, false) == null)\n effects.push(StateEffect.appendConfig.of([dialogField, baseTheme$1]));\n view.dispatch({ effects });\n panel = getPanel(view, createLineDialog);\n }\n if (panel)\n panel.dom.querySelector(\"input\").select();\n return true;\n };\n const baseTheme$1 = /*@__PURE__*/EditorView.baseTheme({\n \".cm-panel.cm-gotoLine\": {\n padding: \"2px 6px 4px\",\n \"& label\": { fontSize: \"80%\" }\n }\n });\n\n const defaultHighlightOptions = {\n highlightWordAroundCursor: false,\n minSelectionLength: 1,\n maxMatches: 100,\n wholeWords: false\n };\n const highlightConfig = /*@__PURE__*/Facet.define({\n combine(options) {\n return combineConfig(options, defaultHighlightOptions, {\n highlightWordAroundCursor: (a, b) => a || b,\n minSelectionLength: Math.min,\n maxMatches: Math.min\n });\n }\n });\n /**\n This extension highlights text that matches the selection. It uses\n the `\"cm-selectionMatch\"` class for the highlighting. When\n `highlightWordAroundCursor` is enabled, the word at the cursor\n itself will be highlighted with `\"cm-selectionMatch-main\"`.\n */\n function highlightSelectionMatches(options) {\n let ext = [defaultTheme, matchHighlighter];\n if (options)\n ext.push(highlightConfig.of(options));\n return ext;\n }\n const matchDeco = /*@__PURE__*/Decoration.mark({ class: \"cm-selectionMatch\" });\n const mainMatchDeco = /*@__PURE__*/Decoration.mark({ class: \"cm-selectionMatch cm-selectionMatch-main\" });\n // Whether the characters directly outside the given positions are non-word characters\n function insideWordBoundaries(check, state, from, to) {\n return (from == 0 || check(state.sliceDoc(from - 1, from)) != CharCategory.Word) &&\n (to == state.doc.length || check(state.sliceDoc(to, to + 1)) != CharCategory.Word);\n }\n // Whether the characters directly at the given positions are word characters\n function insideWord(check, state, from, to) {\n return check(state.sliceDoc(from, from + 1)) == CharCategory.Word\n && check(state.sliceDoc(to - 1, to)) == CharCategory.Word;\n }\n const matchHighlighter = /*@__PURE__*/ViewPlugin.fromClass(class {\n constructor(view) {\n this.decorations = this.getDeco(view);\n }\n update(update) {\n if (update.selectionSet || update.docChanged || update.viewportChanged)\n this.decorations = this.getDeco(update.view);\n }\n getDeco(view) {\n let conf = view.state.facet(highlightConfig);\n let { state } = view, sel = state.selection;\n if (sel.ranges.length > 1)\n return Decoration.none;\n let range = sel.main, query, check = null;\n if (range.empty) {\n if (!conf.highlightWordAroundCursor)\n return Decoration.none;\n let word = state.wordAt(range.head);\n if (!word)\n return Decoration.none;\n check = state.charCategorizer(range.head);\n query = state.sliceDoc(word.from, word.to);\n }\n else {\n let len = range.to - range.from;\n if (len < conf.minSelectionLength || len > 200)\n return Decoration.none;\n if (conf.wholeWords) {\n query = state.sliceDoc(range.from, range.to); // TODO: allow and include leading/trailing space?\n check = state.charCategorizer(range.head);\n if (!(insideWordBoundaries(check, state, range.from, range.to) &&\n insideWord(check, state, range.from, range.to)))\n return Decoration.none;\n }\n else {\n query = state.sliceDoc(range.from, range.to);\n if (!query)\n return Decoration.none;\n }\n }\n let deco = [];\n for (let part of view.visibleRanges) {\n let cursor = new SearchCursor(state.doc, query, part.from, part.to);\n while (!cursor.next().done) {\n let { from, to } = cursor.value;\n if (!check || insideWordBoundaries(check, state, from, to)) {\n if (range.empty && from <= range.from && to >= range.to)\n deco.push(mainMatchDeco.range(from, to));\n else if (from >= range.to || to <= range.from)\n deco.push(matchDeco.range(from, to));\n if (deco.length > conf.maxMatches)\n return Decoration.none;\n }\n }\n }\n return Decoration.set(deco);\n }\n }, {\n decorations: v => v.decorations\n });\n const defaultTheme = /*@__PURE__*/EditorView.baseTheme({\n \".cm-selectionMatch\": { backgroundColor: \"#99ff7780\" },\n \".cm-searchMatch .cm-selectionMatch\": { backgroundColor: \"transparent\" }\n });\n // Select the words around the cursors.\n const selectWord = ({ state, dispatch }) => {\n let { selection } = state;\n let newSel = EditorSelection.create(selection.ranges.map(range => state.wordAt(range.head) || EditorSelection.cursor(range.head)), selection.mainIndex);\n if (newSel.eq(selection))\n return false;\n dispatch(state.update({ selection: newSel }));\n return true;\n };\n // Find next occurrence of query relative to last cursor. Wrap around\n // the document if there are no more matches.\n function findNextOccurrence(state, query) {\n let { main, ranges } = state.selection;\n let word = state.wordAt(main.head), fullWord = word && word.from == main.from && word.to == main.to;\n for (let cycled = false, cursor = new SearchCursor(state.doc, query, ranges[ranges.length - 1].to);;) {\n cursor.next();\n if (cursor.done) {\n if (cycled)\n return null;\n cursor = new SearchCursor(state.doc, query, 0, Math.max(0, ranges[ranges.length - 1].from - 1));\n cycled = true;\n }\n else {\n if (cycled && ranges.some(r => r.from == cursor.value.from))\n continue;\n if (fullWord) {\n let word = state.wordAt(cursor.value.from);\n if (!word || word.from != cursor.value.from || word.to != cursor.value.to)\n continue;\n }\n return cursor.value;\n }\n }\n }\n /**\n Select next occurrence of the current selection. Expand selection\n to the surrounding word when the selection is empty.\n */\n const selectNextOccurrence = ({ state, dispatch }) => {\n let { ranges } = state.selection;\n if (ranges.some(sel => sel.from === sel.to))\n return selectWord({ state, dispatch });\n let searchedText = state.sliceDoc(ranges[0].from, ranges[0].to);\n if (state.selection.ranges.some(r => state.sliceDoc(r.from, r.to) != searchedText))\n return false;\n let range = findNextOccurrence(state, searchedText);\n if (!range)\n return false;\n dispatch(state.update({\n selection: state.selection.addRange(EditorSelection.range(range.from, range.to), false),\n effects: EditorView.scrollIntoView(range.to)\n }));\n return true;\n };\n\n const searchConfigFacet = /*@__PURE__*/Facet.define({\n combine(configs) {\n return combineConfig(configs, {\n top: false,\n caseSensitive: false,\n literal: false,\n regexp: false,\n wholeWord: false,\n createPanel: view => new SearchPanel(view),\n scrollToMatch: range => EditorView.scrollIntoView(range)\n });\n }\n });\n /**\n A search query. Part of the editor's search state.\n */\n class SearchQuery {\n /**\n Create a query object.\n */\n constructor(config) {\n this.search = config.search;\n this.caseSensitive = !!config.caseSensitive;\n this.literal = !!config.literal;\n this.regexp = !!config.regexp;\n this.replace = config.replace || \"\";\n this.valid = !!this.search && (!this.regexp || validRegExp(this.search));\n this.unquoted = this.unquote(this.search);\n this.wholeWord = !!config.wholeWord;\n }\n /**\n @internal\n */\n unquote(text) {\n return this.literal ? text :\n text.replace(/\\\\([nrt\\\\])/g, (_, ch) => ch == \"n\" ? \"\\n\" : ch == \"r\" ? \"\\r\" : ch == \"t\" ? \"\\t\" : \"\\\\\");\n }\n /**\n Compare this query to another query.\n */\n eq(other) {\n return this.search == other.search && this.replace == other.replace &&\n this.caseSensitive == other.caseSensitive && this.regexp == other.regexp &&\n this.wholeWord == other.wholeWord;\n }\n /**\n @internal\n */\n create() {\n return this.regexp ? new RegExpQuery(this) : new StringQuery(this);\n }\n /**\n Get a search cursor for this query, searching through the given\n range in the given state.\n */\n getCursor(state, from = 0, to) {\n let st = state.doc ? state : EditorState.create({ doc: state });\n if (to == null)\n to = st.doc.length;\n return this.regexp ? regexpCursor(this, st, from, to) : stringCursor(this, st, from, to);\n }\n }\n class QueryType {\n constructor(spec) {\n this.spec = spec;\n }\n }\n function stringCursor(spec, state, from, to) {\n return new SearchCursor(state.doc, spec.unquoted, from, to, spec.caseSensitive ? undefined : x => x.toLowerCase(), spec.wholeWord ? stringWordTest(state.doc, state.charCategorizer(state.selection.main.head)) : undefined);\n }\n function stringWordTest(doc, categorizer) {\n return (from, to, buf, bufPos) => {\n if (bufPos > from || bufPos + buf.length < to) {\n bufPos = Math.max(0, from - 2);\n buf = doc.sliceString(bufPos, Math.min(doc.length, to + 2));\n }\n return (categorizer(charBefore(buf, from - bufPos)) != CharCategory.Word ||\n categorizer(charAfter(buf, from - bufPos)) != CharCategory.Word) &&\n (categorizer(charAfter(buf, to - bufPos)) != CharCategory.Word ||\n categorizer(charBefore(buf, to - bufPos)) != CharCategory.Word);\n };\n }\n class StringQuery extends QueryType {\n constructor(spec) {\n super(spec);\n }\n nextMatch(state, curFrom, curTo) {\n let cursor = stringCursor(this.spec, state, curTo, state.doc.length).nextOverlapping();\n if (cursor.done)\n cursor = stringCursor(this.spec, state, 0, curFrom).nextOverlapping();\n return cursor.done ? null : cursor.value;\n }\n // Searching in reverse is, rather than implementing an inverted search\n // cursor, done by scanning chunk after chunk forward.\n prevMatchInRange(state, from, to) {\n for (let pos = to;;) {\n let start = Math.max(from, pos - 10000 /* FindPrev.ChunkSize */ - this.spec.unquoted.length);\n let cursor = stringCursor(this.spec, state, start, pos), range = null;\n while (!cursor.nextOverlapping().done)\n range = cursor.value;\n if (range)\n return range;\n if (start == from)\n return null;\n pos -= 10000 /* FindPrev.ChunkSize */;\n }\n }\n prevMatch(state, curFrom, curTo) {\n return this.prevMatchInRange(state, 0, curFrom) ||\n this.prevMatchInRange(state, curTo, state.doc.length);\n }\n getReplacement(_result) { return this.spec.unquote(this.spec.replace); }\n matchAll(state, limit) {\n let cursor = stringCursor(this.spec, state, 0, state.doc.length), ranges = [];\n while (!cursor.next().done) {\n if (ranges.length >= limit)\n return null;\n ranges.push(cursor.value);\n }\n return ranges;\n }\n highlight(state, from, to, add) {\n let cursor = stringCursor(this.spec, state, Math.max(0, from - this.spec.unquoted.length), Math.min(to + this.spec.unquoted.length, state.doc.length));\n while (!cursor.next().done)\n add(cursor.value.from, cursor.value.to);\n }\n }\n function regexpCursor(spec, state, from, to) {\n return new RegExpCursor(state.doc, spec.search, {\n ignoreCase: !spec.caseSensitive,\n test: spec.wholeWord ? regexpWordTest(state.charCategorizer(state.selection.main.head)) : undefined\n }, from, to);\n }\n function charBefore(str, index) {\n return str.slice(findClusterBreak(str, index, false), index);\n }\n function charAfter(str, index) {\n return str.slice(index, findClusterBreak(str, index));\n }\n function regexpWordTest(categorizer) {\n return (_from, _to, match) => !match[0].length ||\n (categorizer(charBefore(match.input, match.index)) != CharCategory.Word ||\n categorizer(charAfter(match.input, match.index)) != CharCategory.Word) &&\n (categorizer(charAfter(match.input, match.index + match[0].length)) != CharCategory.Word ||\n categorizer(charBefore(match.input, match.index + match[0].length)) != CharCategory.Word);\n }\n class RegExpQuery extends QueryType {\n nextMatch(state, curFrom, curTo) {\n let cursor = regexpCursor(this.spec, state, curTo, state.doc.length).next();\n if (cursor.done)\n cursor = regexpCursor(this.spec, state, 0, curFrom).next();\n return cursor.done ? null : cursor.value;\n }\n prevMatchInRange(state, from, to) {\n for (let size = 1;; size++) {\n let start = Math.max(from, to - size * 10000 /* FindPrev.ChunkSize */);\n let cursor = regexpCursor(this.spec, state, start, to), range = null;\n while (!cursor.next().done)\n range = cursor.value;\n if (range && (start == from || range.from > start + 10))\n return range;\n if (start == from)\n return null;\n }\n }\n prevMatch(state, curFrom, curTo) {\n return this.prevMatchInRange(state, 0, curFrom) ||\n this.prevMatchInRange(state, curTo, state.doc.length);\n }\n getReplacement(result) {\n return this.spec.unquote(this.spec.replace).replace(/\\$([$&\\d+])/g, (m, i) => i == \"$\" ? \"$\"\n : i == \"&\" ? result.match[0]\n : i != \"0\" && +i < result.match.length ? result.match[i]\n : m);\n }\n matchAll(state, limit) {\n let cursor = regexpCursor(this.spec, state, 0, state.doc.length), ranges = [];\n while (!cursor.next().done) {\n if (ranges.length >= limit)\n return null;\n ranges.push(cursor.value);\n }\n return ranges;\n }\n highlight(state, from, to, add) {\n let cursor = regexpCursor(this.spec, state, Math.max(0, from - 250 /* RegExp.HighlightMargin */), Math.min(to + 250 /* RegExp.HighlightMargin */, state.doc.length));\n while (!cursor.next().done)\n add(cursor.value.from, cursor.value.to);\n }\n }\n /**\n A state effect that updates the current search query. Note that\n this only has an effect if the search state has been initialized\n (by including [`search`](https://codemirror.net/6/docs/ref/#search.search) in your configuration or\n by running [`openSearchPanel`](https://codemirror.net/6/docs/ref/#search.openSearchPanel) at least\n once).\n */\n const setSearchQuery = /*@__PURE__*/StateEffect.define();\n const togglePanel = /*@__PURE__*/StateEffect.define();\n const searchState = /*@__PURE__*/StateField.define({\n create(state) {\n return new SearchState(defaultQuery(state).create(), null);\n },\n update(value, tr) {\n for (let effect of tr.effects) {\n if (effect.is(setSearchQuery))\n value = new SearchState(effect.value.create(), value.panel);\n else if (effect.is(togglePanel))\n value = new SearchState(value.query, effect.value ? createSearchPanel : null);\n }\n return value;\n },\n provide: f => showPanel.from(f, val => val.panel)\n });\n class SearchState {\n constructor(query, panel) {\n this.query = query;\n this.panel = panel;\n }\n }\n const matchMark = /*@__PURE__*/Decoration.mark({ class: \"cm-searchMatch\" }), selectedMatchMark = /*@__PURE__*/Decoration.mark({ class: \"cm-searchMatch cm-searchMatch-selected\" });\n const searchHighlighter = /*@__PURE__*/ViewPlugin.fromClass(class {\n constructor(view) {\n this.view = view;\n this.decorations = this.highlight(view.state.field(searchState));\n }\n update(update) {\n let state = update.state.field(searchState);\n if (state != update.startState.field(searchState) || update.docChanged || update.selectionSet || update.viewportChanged)\n this.decorations = this.highlight(state);\n }\n highlight({ query, panel }) {\n if (!panel || !query.spec.valid)\n return Decoration.none;\n let { view } = this;\n let builder = new RangeSetBuilder();\n for (let i = 0, ranges = view.visibleRanges, l = ranges.length; i < l; i++) {\n let { from, to } = ranges[i];\n while (i < l - 1 && to > ranges[i + 1].from - 2 * 250 /* RegExp.HighlightMargin */)\n to = ranges[++i].to;\n query.highlight(view.state, from, to, (from, to) => {\n let selected = view.state.selection.ranges.some(r => r.from == from && r.to == to);\n builder.add(from, to, selected ? selectedMatchMark : matchMark);\n });\n }\n return builder.finish();\n }\n }, {\n decorations: v => v.decorations\n });\n function searchCommand(f) {\n return view => {\n let state = view.state.field(searchState, false);\n return state && state.query.spec.valid ? f(view, state) : openSearchPanel(view);\n };\n }\n /**\n Open the search panel if it isn't already open, and move the\n selection to the first match after the current main selection.\n Will wrap around to the start of the document when it reaches the\n end.\n */\n const findNext = /*@__PURE__*/searchCommand((view, { query }) => {\n let { to } = view.state.selection.main;\n let next = query.nextMatch(view.state, to, to);\n if (!next)\n return false;\n let selection = EditorSelection.single(next.from, next.to);\n let config = view.state.facet(searchConfigFacet);\n view.dispatch({\n selection,\n effects: [announceMatch(view, next), config.scrollToMatch(selection.main, view)],\n userEvent: \"select.search\"\n });\n selectSearchInput(view);\n return true;\n });\n /**\n Move the selection to the previous instance of the search query,\n before the current main selection. Will wrap past the start\n of the document to start searching at the end again.\n */\n const findPrevious = /*@__PURE__*/searchCommand((view, { query }) => {\n let { state } = view, { from } = state.selection.main;\n let prev = query.prevMatch(state, from, from);\n if (!prev)\n return false;\n let selection = EditorSelection.single(prev.from, prev.to);\n let config = view.state.facet(searchConfigFacet);\n view.dispatch({\n selection,\n effects: [announceMatch(view, prev), config.scrollToMatch(selection.main, view)],\n userEvent: \"select.search\"\n });\n selectSearchInput(view);\n return true;\n });\n /**\n Select all instances of the search query.\n */\n const selectMatches = /*@__PURE__*/searchCommand((view, { query }) => {\n let ranges = query.matchAll(view.state, 1000);\n if (!ranges || !ranges.length)\n return false;\n view.dispatch({\n selection: EditorSelection.create(ranges.map(r => EditorSelection.range(r.from, r.to))),\n userEvent: \"select.search.matches\"\n });\n return true;\n });\n /**\n Select all instances of the currently selected text.\n */\n const selectSelectionMatches = ({ state, dispatch }) => {\n let sel = state.selection;\n if (sel.ranges.length > 1 || sel.main.empty)\n return false;\n let { from, to } = sel.main;\n let ranges = [], main = 0;\n for (let cur = new SearchCursor(state.doc, state.sliceDoc(from, to)); !cur.next().done;) {\n if (ranges.length > 1000)\n return false;\n if (cur.value.from == from)\n main = ranges.length;\n ranges.push(EditorSelection.range(cur.value.from, cur.value.to));\n }\n dispatch(state.update({\n selection: EditorSelection.create(ranges, main),\n userEvent: \"select.search.matches\"\n }));\n return true;\n };\n /**\n Replace the current match of the search query.\n */\n const replaceNext = /*@__PURE__*/searchCommand((view, { query }) => {\n let { state } = view, { from, to } = state.selection.main;\n if (state.readOnly)\n return false;\n let next = query.nextMatch(state, from, from);\n if (!next)\n return false;\n let changes = [], selection, replacement;\n let effects = [];\n if (next.from == from && next.to == to) {\n replacement = state.toText(query.getReplacement(next));\n changes.push({ from: next.from, to: next.to, insert: replacement });\n next = query.nextMatch(state, next.from, next.to);\n effects.push(EditorView.announce.of(state.phrase(\"replaced match on line $\", state.doc.lineAt(from).number) + \".\"));\n }\n if (next) {\n let off = changes.length == 0 || changes[0].from >= next.to ? 0 : next.to - next.from - replacement.length;\n selection = EditorSelection.single(next.from - off, next.to - off);\n effects.push(announceMatch(view, next));\n effects.push(state.facet(searchConfigFacet).scrollToMatch(selection.main, view));\n }\n view.dispatch({\n changes, selection, effects,\n userEvent: \"input.replace\"\n });\n return true;\n });\n /**\n Replace all instances of the search query with the given\n replacement.\n */\n const replaceAll = /*@__PURE__*/searchCommand((view, { query }) => {\n if (view.state.readOnly)\n return false;\n let changes = query.matchAll(view.state, 1e9).map(match => {\n let { from, to } = match;\n return { from, to, insert: query.getReplacement(match) };\n });\n if (!changes.length)\n return false;\n let announceText = view.state.phrase(\"replaced $ matches\", changes.length) + \".\";\n view.dispatch({\n changes,\n effects: EditorView.announce.of(announceText),\n userEvent: \"input.replace.all\"\n });\n return true;\n });\n function createSearchPanel(view) {\n return view.state.facet(searchConfigFacet).createPanel(view);\n }\n function defaultQuery(state, fallback) {\n var _a, _b, _c, _d, _e;\n let sel = state.selection.main;\n let selText = sel.empty || sel.to > sel.from + 100 ? \"\" : state.sliceDoc(sel.from, sel.to);\n if (fallback && !selText)\n return fallback;\n let config = state.facet(searchConfigFacet);\n return new SearchQuery({\n search: ((_a = fallback === null || fallback === void 0 ? void 0 : fallback.literal) !== null && _a !== void 0 ? _a : config.literal) ? selText : selText.replace(/\\n/g, \"\\\\n\"),\n caseSensitive: (_b = fallback === null || fallback === void 0 ? void 0 : fallback.caseSensitive) !== null && _b !== void 0 ? _b : config.caseSensitive,\n literal: (_c = fallback === null || fallback === void 0 ? void 0 : fallback.literal) !== null && _c !== void 0 ? _c : config.literal,\n regexp: (_d = fallback === null || fallback === void 0 ? void 0 : fallback.regexp) !== null && _d !== void 0 ? _d : config.regexp,\n wholeWord: (_e = fallback === null || fallback === void 0 ? void 0 : fallback.wholeWord) !== null && _e !== void 0 ? _e : config.wholeWord\n });\n }\n function getSearchInput(view) {\n let panel = getPanel(view, createSearchPanel);\n return panel && panel.dom.querySelector(\"[main-field]\");\n }\n function selectSearchInput(view) {\n let input = getSearchInput(view);\n if (input && input == view.root.activeElement)\n input.select();\n }\n /**\n Make sure the search panel is open and focused.\n */\n const openSearchPanel = view => {\n let state = view.state.field(searchState, false);\n if (state && state.panel) {\n let searchInput = getSearchInput(view);\n if (searchInput && searchInput != view.root.activeElement) {\n let query = defaultQuery(view.state, state.query.spec);\n if (query.valid)\n view.dispatch({ effects: setSearchQuery.of(query) });\n searchInput.focus();\n searchInput.select();\n }\n }\n else {\n view.dispatch({ effects: [\n togglePanel.of(true),\n state ? setSearchQuery.of(defaultQuery(view.state, state.query.spec)) : StateEffect.appendConfig.of(searchExtensions)\n ] });\n }\n return true;\n };\n /**\n Close the search panel.\n */\n const closeSearchPanel = view => {\n let state = view.state.field(searchState, false);\n if (!state || !state.panel)\n return false;\n let panel = getPanel(view, createSearchPanel);\n if (panel && panel.dom.contains(view.root.activeElement))\n view.focus();\n view.dispatch({ effects: togglePanel.of(false) });\n return true;\n };\n /**\n Default search-related key bindings.\n\n - Mod-f: [`openSearchPanel`](https://codemirror.net/6/docs/ref/#search.openSearchPanel)\n - F3, Mod-g: [`findNext`](https://codemirror.net/6/docs/ref/#search.findNext)\n - Shift-F3, Shift-Mod-g: [`findPrevious`](https://codemirror.net/6/docs/ref/#search.findPrevious)\n - Mod-Alt-g: [`gotoLine`](https://codemirror.net/6/docs/ref/#search.gotoLine)\n - Mod-d: [`selectNextOccurrence`](https://codemirror.net/6/docs/ref/#search.selectNextOccurrence)\n */\n const searchKeymap = [\n { key: \"Mod-f\", run: openSearchPanel, scope: \"editor search-panel\" },\n { key: \"F3\", run: findNext, shift: findPrevious, scope: \"editor search-panel\", preventDefault: true },\n { key: \"Mod-g\", run: findNext, shift: findPrevious, scope: \"editor search-panel\", preventDefault: true },\n { key: \"Escape\", run: closeSearchPanel, scope: \"editor search-panel\" },\n { key: \"Mod-Shift-l\", run: selectSelectionMatches },\n { key: \"Mod-Alt-g\", run: gotoLine },\n { key: \"Mod-d\", run: selectNextOccurrence, preventDefault: true },\n ];\n class SearchPanel {\n constructor(view) {\n this.view = view;\n let query = this.query = view.state.field(searchState).query.spec;\n this.commit = this.commit.bind(this);\n this.searchField = crelt(\"input\", {\n value: query.search,\n placeholder: phrase(view, \"Find\"),\n \"aria-label\": phrase(view, \"Find\"),\n class: \"cm-textfield\",\n name: \"search\",\n form: \"\",\n \"main-field\": \"true\",\n onchange: this.commit,\n onkeyup: this.commit\n });\n this.replaceField = crelt(\"input\", {\n value: query.replace,\n placeholder: phrase(view, \"Replace\"),\n \"aria-label\": phrase(view, \"Replace\"),\n class: \"cm-textfield\",\n name: \"replace\",\n form: \"\",\n onchange: this.commit,\n onkeyup: this.commit\n });\n this.caseField = crelt(\"input\", {\n type: \"checkbox\",\n name: \"case\",\n form: \"\",\n checked: query.caseSensitive,\n onchange: this.commit\n });\n this.reField = crelt(\"input\", {\n type: \"checkbox\",\n name: \"re\",\n form: \"\",\n checked: query.regexp,\n onchange: this.commit\n });\n this.wordField = crelt(\"input\", {\n type: \"checkbox\",\n name: \"word\",\n form: \"\",\n checked: query.wholeWord,\n onchange: this.commit\n });\n function button(name, onclick, content) {\n return crelt(\"button\", { class: \"cm-button\", name, onclick, type: \"button\" }, content);\n }\n this.dom = crelt(\"div\", { onkeydown: (e) => this.keydown(e), class: \"cm-search\" }, [\n this.searchField,\n button(\"next\", () => findNext(view), [phrase(view, \"next\")]),\n button(\"prev\", () => findPrevious(view), [phrase(view, \"previous\")]),\n button(\"select\", () => selectMatches(view), [phrase(view, \"all\")]),\n crelt(\"label\", null, [this.caseField, phrase(view, \"match case\")]),\n crelt(\"label\", null, [this.reField, phrase(view, \"regexp\")]),\n crelt(\"label\", null, [this.wordField, phrase(view, \"by word\")]),\n ...view.state.readOnly ? [] : [\n crelt(\"br\"),\n this.replaceField,\n button(\"replace\", () => replaceNext(view), [phrase(view, \"replace\")]),\n button(\"replaceAll\", () => replaceAll(view), [phrase(view, \"replace all\")])\n ],\n crelt(\"button\", {\n name: \"close\",\n onclick: () => closeSearchPanel(view),\n \"aria-label\": phrase(view, \"close\"),\n type: \"button\"\n }, [\"\u00D7\"])\n ]);\n }\n commit() {\n let query = new SearchQuery({\n search: this.searchField.value,\n caseSensitive: this.caseField.checked,\n regexp: this.reField.checked,\n wholeWord: this.wordField.checked,\n replace: this.replaceField.value,\n });\n if (!query.eq(this.query)) {\n this.query = query;\n this.view.dispatch({ effects: setSearchQuery.of(query) });\n }\n }\n keydown(e) {\n if (runScopeHandlers(this.view, e, \"search-panel\")) {\n e.preventDefault();\n }\n else if (e.keyCode == 13 && e.target == this.searchField) {\n e.preventDefault();\n (e.shiftKey ? findPrevious : findNext)(this.view);\n }\n else if (e.keyCode == 13 && e.target == this.replaceField) {\n e.preventDefault();\n replaceNext(this.view);\n }\n }\n update(update) {\n for (let tr of update.transactions)\n for (let effect of tr.effects) {\n if (effect.is(setSearchQuery) && !effect.value.eq(this.query))\n this.setQuery(effect.value);\n }\n }\n setQuery(query) {\n this.query = query;\n this.searchField.value = query.search;\n this.replaceField.value = query.replace;\n this.caseField.checked = query.caseSensitive;\n this.reField.checked = query.regexp;\n this.wordField.checked = query.wholeWord;\n }\n mount() {\n this.searchField.select();\n }\n get pos() { return 80; }\n get top() { return this.view.state.facet(searchConfigFacet).top; }\n }\n function phrase(view, phrase) { return view.state.phrase(phrase); }\n const AnnounceMargin = 30;\n const Break = /[\\s\\.,:;?!]/;\n function announceMatch(view, { from, to }) {\n let line = view.state.doc.lineAt(from), lineEnd = view.state.doc.lineAt(to).to;\n let start = Math.max(line.from, from - AnnounceMargin), end = Math.min(lineEnd, to + AnnounceMargin);\n let text = view.state.sliceDoc(start, end);\n if (start != line.from) {\n for (let i = 0; i < AnnounceMargin; i++)\n if (!Break.test(text[i + 1]) && Break.test(text[i])) {\n text = text.slice(i);\n break;\n }\n }\n if (end != lineEnd) {\n for (let i = text.length - 1; i > text.length - AnnounceMargin; i--)\n if (!Break.test(text[i - 1]) && Break.test(text[i])) {\n text = text.slice(0, i);\n break;\n }\n }\n return EditorView.announce.of(`${view.state.phrase(\"current match\")}. ${text} ${view.state.phrase(\"on line\")} ${line.number}.`);\n }\n const baseTheme$2 = /*@__PURE__*/EditorView.baseTheme({\n \".cm-panel.cm-search\": {\n padding: \"2px 6px 4px\",\n position: \"relative\",\n \"& [name=close]\": {\n position: \"absolute\",\n top: \"0\",\n right: \"4px\",\n backgroundColor: \"inherit\",\n border: \"none\",\n font: \"inherit\",\n padding: 0,\n margin: 0\n },\n \"& input, & button, & label\": {\n margin: \".2em .6em .2em 0\"\n },\n \"& input[type=checkbox]\": {\n marginRight: \".2em\"\n },\n \"& label\": {\n fontSize: \"80%\",\n whiteSpace: \"pre\"\n }\n },\n \"&light .cm-searchMatch\": { backgroundColor: \"#ffff0054\" },\n \"&dark .cm-searchMatch\": { backgroundColor: \"#00ffff8a\" },\n \"&light .cm-searchMatch-selected\": { backgroundColor: \"#ff6a0054\" },\n \"&dark .cm-searchMatch-selected\": { backgroundColor: \"#ff00ff8a\" }\n });\n const searchExtensions = [\n searchState,\n /*@__PURE__*/Prec.low(searchHighlighter),\n baseTheme$2\n ];\n\n /**\n An instance of this is passed to completion source functions.\n */\n class CompletionContext {\n /**\n Create a new completion context. (Mostly useful for testing\n completion sources\u2014in the editor, the extension will create\n these for you.)\n */\n constructor(\n /**\n The editor state that the completion happens in.\n */\n state, \n /**\n The position at which the completion is happening.\n */\n pos, \n /**\n Indicates whether completion was activated explicitly, or\n implicitly by typing. The usual way to respond to this is to\n only return completions when either there is part of a\n completable entity before the cursor, or `explicit` is true.\n */\n explicit, \n /**\n The editor view. May be undefined if the context was created\n in a situation where there is no such view available, such as\n in synchronous updates via\n [`CompletionResult.update`](https://codemirror.net/6/docs/ref/#autocomplete.CompletionResult.update)\n or when called by test code.\n */\n view) {\n this.state = state;\n this.pos = pos;\n this.explicit = explicit;\n this.view = view;\n /**\n @internal\n */\n this.abortListeners = [];\n }\n /**\n Get the extent, content, and (if there is a token) type of the\n token before `this.pos`.\n */\n tokenBefore(types) {\n let token = syntaxTree(this.state).resolveInner(this.pos, -1);\n while (token && types.indexOf(token.name) < 0)\n token = token.parent;\n return token ? { from: token.from, to: this.pos,\n text: this.state.sliceDoc(token.from, this.pos),\n type: token.type } : null;\n }\n /**\n Get the match of the given expression directly before the\n cursor.\n */\n matchBefore(expr) {\n let line = this.state.doc.lineAt(this.pos);\n let start = Math.max(line.from, this.pos - 250);\n let str = line.text.slice(start - line.from, this.pos - line.from);\n let found = str.search(ensureAnchor(expr, false));\n return found < 0 ? null : { from: start + found, to: this.pos, text: str.slice(found) };\n }\n /**\n Yields true when the query has been aborted. Can be useful in\n asynchronous queries to avoid doing work that will be ignored.\n */\n get aborted() { return this.abortListeners == null; }\n /**\n Allows you to register abort handlers, which will be called when\n the query is\n [aborted](https://codemirror.net/6/docs/ref/#autocomplete.CompletionContext.aborted).\n */\n addEventListener(type, listener) {\n if (type == \"abort\" && this.abortListeners)\n this.abortListeners.push(listener);\n }\n }\n function toSet(chars) {\n let flat = Object.keys(chars).join(\"\");\n let words = /\\w/.test(flat);\n if (words)\n flat = flat.replace(/\\w/g, \"\");\n return `[${words ? \"\\\\w\" : \"\"}${flat.replace(/[^\\w\\s]/g, \"\\\\$&\")}]`;\n }\n function prefixMatch(options) {\n let first = Object.create(null), rest = Object.create(null);\n for (let { label } of options) {\n first[label[0]] = true;\n for (let i = 1; i < label.length; i++)\n rest[label[i]] = true;\n }\n let source = toSet(first) + toSet(rest) + \"*$\";\n return [new RegExp(\"^\" + source), new RegExp(source)];\n }\n /**\n Given a a fixed array of options, return an autocompleter that\n completes them.\n */\n function completeFromList(list) {\n let options = list.map(o => typeof o == \"string\" ? { label: o } : o);\n let [validFor, match] = options.every(o => /^\\w+$/.test(o.label)) ? [/\\w*$/, /\\w+$/] : prefixMatch(options);\n return (context) => {\n let token = context.matchBefore(match);\n return token || context.explicit ? { from: token ? token.from : context.pos, options, validFor } : null;\n };\n }\n /**\n Wrap the given completion source so that it will not fire when the\n cursor is in a syntax node with one of the given names.\n */\n function ifNotIn(nodes, source) {\n return (context) => {\n for (let pos = syntaxTree(context.state).resolveInner(context.pos, -1); pos; pos = pos.parent) {\n if (nodes.indexOf(pos.name) > -1)\n return null;\n if (pos.type.isTop)\n break;\n }\n return source(context);\n };\n }\n class Option {\n constructor(completion, source, match, score) {\n this.completion = completion;\n this.source = source;\n this.match = match;\n this.score = score;\n }\n }\n function cur(state) { return state.selection.main.from; }\n // Make sure the given regexp has a $ at its end and, if `start` is\n // true, a ^ at its start.\n function ensureAnchor(expr, start) {\n var _a;\n let { source } = expr;\n let addStart = start && source[0] != \"^\", addEnd = source[source.length - 1] != \"$\";\n if (!addStart && !addEnd)\n return expr;\n return new RegExp(`${addStart ? \"^\" : \"\"}(?:${source})${addEnd ? \"$\" : \"\"}`, (_a = expr.flags) !== null && _a !== void 0 ? _a : (expr.ignoreCase ? \"i\" : \"\"));\n }\n /**\n This annotation is added to transactions that are produced by\n picking a completion.\n */\n const pickedCompletion = /*@__PURE__*/Annotation.define();\n /**\n Helper function that returns a transaction spec which inserts a\n completion's text in the main selection range, and any other\n selection range that has the same text in front of it.\n */\n function insertCompletionText(state, text, from, to) {\n let { main } = state.selection, fromOff = from - main.from, toOff = to - main.from;\n return Object.assign(Object.assign({}, state.changeByRange(range => {\n if (range != main && from != to &&\n state.sliceDoc(range.from + fromOff, range.from + toOff) != state.sliceDoc(from, to))\n return { range };\n return {\n changes: { from: range.from + fromOff, to: to == main.from ? range.to : range.from + toOff, insert: text },\n range: EditorSelection.cursor(range.from + fromOff + text.length)\n };\n })), { scrollIntoView: true, userEvent: \"input.complete\" });\n }\n const SourceCache = /*@__PURE__*/new WeakMap();\n function asSource(source) {\n if (!Array.isArray(source))\n return source;\n let known = SourceCache.get(source);\n if (!known)\n SourceCache.set(source, known = completeFromList(source));\n return known;\n }\n const startCompletionEffect = /*@__PURE__*/StateEffect.define();\n const closeCompletionEffect = /*@__PURE__*/StateEffect.define();\n\n // A pattern matcher for fuzzy completion matching. Create an instance\n // once for a pattern, and then use that to match any number of\n // completions.\n class FuzzyMatcher {\n constructor(pattern) {\n this.pattern = pattern;\n this.chars = [];\n this.folded = [];\n // Buffers reused by calls to `match` to track matched character\n // positions.\n this.any = [];\n this.precise = [];\n this.byWord = [];\n this.score = 0;\n this.matched = [];\n for (let p = 0; p < pattern.length;) {\n let char = codePointAt(pattern, p), size = codePointSize(char);\n this.chars.push(char);\n let part = pattern.slice(p, p + size), upper = part.toUpperCase();\n this.folded.push(codePointAt(upper == part ? part.toLowerCase() : upper, 0));\n p += size;\n }\n this.astral = pattern.length != this.chars.length;\n }\n ret(score, matched) {\n this.score = score;\n this.matched = matched;\n return this;\n }\n // Matches a given word (completion) against the pattern (input).\n // Will return a boolean indicating whether there was a match and,\n // on success, set `this.score` to the score, `this.matched` to an\n // array of `from, to` pairs indicating the matched parts of `word`.\n //\n // The score is a number that is more negative the worse the match\n // is. See `Penalty` above.\n match(word) {\n if (this.pattern.length == 0)\n return this.ret(-100 /* Penalty.NotFull */, []);\n if (word.length < this.pattern.length)\n return null;\n let { chars, folded, any, precise, byWord } = this;\n // For single-character queries, only match when they occur right\n // at the start\n if (chars.length == 1) {\n let first = codePointAt(word, 0), firstSize = codePointSize(first);\n let score = firstSize == word.length ? 0 : -100 /* Penalty.NotFull */;\n if (first == chars[0]) ;\n else if (first == folded[0])\n score += -200 /* Penalty.CaseFold */;\n else\n return null;\n return this.ret(score, [0, firstSize]);\n }\n let direct = word.indexOf(this.pattern);\n if (direct == 0)\n return this.ret(word.length == this.pattern.length ? 0 : -100 /* Penalty.NotFull */, [0, this.pattern.length]);\n let len = chars.length, anyTo = 0;\n if (direct < 0) {\n for (let i = 0, e = Math.min(word.length, 200); i < e && anyTo < len;) {\n let next = codePointAt(word, i);\n if (next == chars[anyTo] || next == folded[anyTo])\n any[anyTo++] = i;\n i += codePointSize(next);\n }\n // No match, exit immediately\n if (anyTo < len)\n return null;\n }\n // This tracks the extent of the precise (non-folded, not\n // necessarily adjacent) match\n let preciseTo = 0;\n // Tracks whether there is a match that hits only characters that\n // appear to be starting words. `byWordFolded` is set to true when\n // a case folded character is encountered in such a match\n let byWordTo = 0, byWordFolded = false;\n // If we've found a partial adjacent match, these track its state\n let adjacentTo = 0, adjacentStart = -1, adjacentEnd = -1;\n let hasLower = /[a-z]/.test(word), wordAdjacent = true;\n // Go over the option's text, scanning for the various kinds of matches\n for (let i = 0, e = Math.min(word.length, 200), prevType = 0 /* Tp.NonWord */; i < e && byWordTo < len;) {\n let next = codePointAt(word, i);\n if (direct < 0) {\n if (preciseTo < len && next == chars[preciseTo])\n precise[preciseTo++] = i;\n if (adjacentTo < len) {\n if (next == chars[adjacentTo] || next == folded[adjacentTo]) {\n if (adjacentTo == 0)\n adjacentStart = i;\n adjacentEnd = i + 1;\n adjacentTo++;\n }\n else {\n adjacentTo = 0;\n }\n }\n }\n let ch, type = next < 0xff\n ? (next >= 48 && next <= 57 || next >= 97 && next <= 122 ? 2 /* Tp.Lower */ : next >= 65 && next <= 90 ? 1 /* Tp.Upper */ : 0 /* Tp.NonWord */)\n : ((ch = fromCodePoint(next)) != ch.toLowerCase() ? 1 /* Tp.Upper */ : ch != ch.toUpperCase() ? 2 /* Tp.Lower */ : 0 /* Tp.NonWord */);\n if (!i || type == 1 /* Tp.Upper */ && hasLower || prevType == 0 /* Tp.NonWord */ && type != 0 /* Tp.NonWord */) {\n if (chars[byWordTo] == next || (folded[byWordTo] == next && (byWordFolded = true)))\n byWord[byWordTo++] = i;\n else if (byWord.length)\n wordAdjacent = false;\n }\n prevType = type;\n i += codePointSize(next);\n }\n if (byWordTo == len && byWord[0] == 0 && wordAdjacent)\n return this.result(-100 /* Penalty.ByWord */ + (byWordFolded ? -200 /* Penalty.CaseFold */ : 0), byWord, word);\n if (adjacentTo == len && adjacentStart == 0)\n return this.ret(-200 /* Penalty.CaseFold */ - word.length + (adjacentEnd == word.length ? 0 : -100 /* Penalty.NotFull */), [0, adjacentEnd]);\n if (direct > -1)\n return this.ret(-700 /* Penalty.NotStart */ - word.length, [direct, direct + this.pattern.length]);\n if (adjacentTo == len)\n return this.ret(-200 /* Penalty.CaseFold */ + -700 /* Penalty.NotStart */ - word.length, [adjacentStart, adjacentEnd]);\n if (byWordTo == len)\n return this.result(-100 /* Penalty.ByWord */ + (byWordFolded ? -200 /* Penalty.CaseFold */ : 0) + -700 /* Penalty.NotStart */ +\n (wordAdjacent ? 0 : -1100 /* Penalty.Gap */), byWord, word);\n return chars.length == 2 ? null\n : this.result((any[0] ? -700 /* Penalty.NotStart */ : 0) + -200 /* Penalty.CaseFold */ + -1100 /* Penalty.Gap */, any, word);\n }\n result(score, positions, word) {\n let result = [], i = 0;\n for (let pos of positions) {\n let to = pos + (this.astral ? codePointSize(codePointAt(word, pos)) : 1);\n if (i && result[i - 1] == pos)\n result[i - 1] = to;\n else {\n result[i++] = pos;\n result[i++] = to;\n }\n }\n return this.ret(score - word.length, result);\n }\n }\n class StrictMatcher {\n constructor(pattern) {\n this.pattern = pattern;\n this.matched = [];\n this.score = 0;\n this.folded = pattern.toLowerCase();\n }\n match(word) {\n if (word.length < this.pattern.length)\n return null;\n let start = word.slice(0, this.pattern.length);\n let match = start == this.pattern ? 0 : start.toLowerCase() == this.folded ? -200 /* Penalty.CaseFold */ : null;\n if (match == null)\n return null;\n this.matched = [0, start.length];\n this.score = match + (word.length == this.pattern.length ? 0 : -100 /* Penalty.NotFull */);\n return this;\n }\n }\n\n const completionConfig = /*@__PURE__*/Facet.define({\n combine(configs) {\n return combineConfig(configs, {\n activateOnTyping: true,\n activateOnCompletion: () => false,\n activateOnTypingDelay: 100,\n selectOnOpen: true,\n override: null,\n closeOnBlur: true,\n maxRenderedOptions: 100,\n defaultKeymap: true,\n tooltipClass: () => \"\",\n optionClass: () => \"\",\n aboveCursor: false,\n icons: true,\n addToOptions: [],\n positionInfo: defaultPositionInfo,\n filterStrict: false,\n compareCompletions: (a, b) => a.label.localeCompare(b.label),\n interactionDelay: 75,\n updateSyncTime: 100\n }, {\n defaultKeymap: (a, b) => a && b,\n closeOnBlur: (a, b) => a && b,\n icons: (a, b) => a && b,\n tooltipClass: (a, b) => c => joinClass(a(c), b(c)),\n optionClass: (a, b) => c => joinClass(a(c), b(c)),\n addToOptions: (a, b) => a.concat(b),\n filterStrict: (a, b) => a || b,\n });\n }\n });\n function joinClass(a, b) {\n return a ? b ? a + \" \" + b : a : b;\n }\n function defaultPositionInfo(view, list, option, info, space, tooltip) {\n let rtl = view.textDirection == Direction.RTL, left = rtl, narrow = false;\n let side = \"top\", offset, maxWidth;\n let spaceLeft = list.left - space.left, spaceRight = space.right - list.right;\n let infoWidth = info.right - info.left, infoHeight = info.bottom - info.top;\n if (left && spaceLeft < Math.min(infoWidth, spaceRight))\n left = false;\n else if (!left && spaceRight < Math.min(infoWidth, spaceLeft))\n left = true;\n if (infoWidth <= (left ? spaceLeft : spaceRight)) {\n offset = Math.max(space.top, Math.min(option.top, space.bottom - infoHeight)) - list.top;\n maxWidth = Math.min(400 /* Info.Width */, left ? spaceLeft : spaceRight);\n }\n else {\n narrow = true;\n maxWidth = Math.min(400 /* Info.Width */, (rtl ? list.right : space.right - list.left) - 30 /* Info.Margin */);\n let spaceBelow = space.bottom - list.bottom;\n if (spaceBelow >= infoHeight || spaceBelow > list.top) { // Below the completion\n offset = option.bottom - list.top;\n }\n else { // Above it\n side = \"bottom\";\n offset = list.bottom - option.top;\n }\n }\n let scaleY = (list.bottom - list.top) / tooltip.offsetHeight;\n let scaleX = (list.right - list.left) / tooltip.offsetWidth;\n return {\n style: `${side}: ${offset / scaleY}px; max-width: ${maxWidth / scaleX}px`,\n class: \"cm-completionInfo-\" + (narrow ? (rtl ? \"left-narrow\" : \"right-narrow\") : left ? \"left\" : \"right\")\n };\n }\n\n function optionContent(config) {\n let content = config.addToOptions.slice();\n if (config.icons)\n content.push({\n render(completion) {\n let icon = document.createElement(\"div\");\n icon.classList.add(\"cm-completionIcon\");\n if (completion.type)\n icon.classList.add(...completion.type.split(/\\s+/g).map(cls => \"cm-completionIcon-\" + cls));\n icon.setAttribute(\"aria-hidden\", \"true\");\n return icon;\n },\n position: 20\n });\n content.push({\n render(completion, _s, _v, match) {\n let labelElt = document.createElement(\"span\");\n labelElt.className = \"cm-completionLabel\";\n let label = completion.displayLabel || completion.label, off = 0;\n for (let j = 0; j < match.length;) {\n let from = match[j++], to = match[j++];\n if (from > off)\n labelElt.appendChild(document.createTextNode(label.slice(off, from)));\n let span = labelElt.appendChild(document.createElement(\"span\"));\n span.appendChild(document.createTextNode(label.slice(from, to)));\n span.className = \"cm-completionMatchedText\";\n off = to;\n }\n if (off < label.length)\n labelElt.appendChild(document.createTextNode(label.slice(off)));\n return labelElt;\n },\n position: 50\n }, {\n render(completion) {\n if (!completion.detail)\n return null;\n let detailElt = document.createElement(\"span\");\n detailElt.className = \"cm-completionDetail\";\n detailElt.textContent = completion.detail;\n return detailElt;\n },\n position: 80\n });\n return content.sort((a, b) => a.position - b.position).map(a => a.render);\n }\n function rangeAroundSelected(total, selected, max) {\n if (total <= max)\n return { from: 0, to: total };\n if (selected < 0)\n selected = 0;\n if (selected <= (total >> 1)) {\n let off = Math.floor(selected / max);\n return { from: off * max, to: (off + 1) * max };\n }\n let off = Math.floor((total - selected) / max);\n return { from: total - (off + 1) * max, to: total - off * max };\n }\n class CompletionTooltip {\n constructor(view, stateField, applyCompletion) {\n this.view = view;\n this.stateField = stateField;\n this.applyCompletion = applyCompletion;\n this.info = null;\n this.infoDestroy = null;\n this.placeInfoReq = {\n read: () => this.measureInfo(),\n write: (pos) => this.placeInfo(pos),\n key: this\n };\n this.space = null;\n this.currentClass = \"\";\n let cState = view.state.field(stateField);\n let { options, selected } = cState.open;\n let config = view.state.facet(completionConfig);\n this.optionContent = optionContent(config);\n this.optionClass = config.optionClass;\n this.tooltipClass = config.tooltipClass;\n this.range = rangeAroundSelected(options.length, selected, config.maxRenderedOptions);\n this.dom = document.createElement(\"div\");\n this.dom.className = \"cm-tooltip-autocomplete\";\n this.updateTooltipClass(view.state);\n this.dom.addEventListener(\"mousedown\", (e) => {\n let { options } = view.state.field(stateField).open;\n for (let dom = e.target, match; dom && dom != this.dom; dom = dom.parentNode) {\n if (dom.nodeName == \"LI\" && (match = /-(\\d+)$/.exec(dom.id)) && +match[1] < options.length) {\n this.applyCompletion(view, options[+match[1]]);\n e.preventDefault();\n return;\n }\n }\n });\n this.dom.addEventListener(\"focusout\", (e) => {\n let state = view.state.field(this.stateField, false);\n if (state && state.tooltip && view.state.facet(completionConfig).closeOnBlur &&\n e.relatedTarget != view.contentDOM)\n view.dispatch({ effects: closeCompletionEffect.of(null) });\n });\n this.showOptions(options, cState.id);\n }\n mount() { this.updateSel(); }\n showOptions(options, id) {\n if (this.list)\n this.list.remove();\n this.list = this.dom.appendChild(this.createListBox(options, id, this.range));\n this.list.addEventListener(\"scroll\", () => {\n if (this.info)\n this.view.requestMeasure(this.placeInfoReq);\n });\n }\n update(update) {\n var _a;\n let cState = update.state.field(this.stateField);\n let prevState = update.startState.field(this.stateField);\n this.updateTooltipClass(update.state);\n if (cState != prevState) {\n let { options, selected, disabled } = cState.open;\n if (!prevState.open || prevState.open.options != options) {\n this.range = rangeAroundSelected(options.length, selected, update.state.facet(completionConfig).maxRenderedOptions);\n this.showOptions(options, cState.id);\n }\n this.updateSel();\n if (disabled != ((_a = prevState.open) === null || _a === void 0 ? void 0 : _a.disabled))\n this.dom.classList.toggle(\"cm-tooltip-autocomplete-disabled\", !!disabled);\n }\n }\n updateTooltipClass(state) {\n let cls = this.tooltipClass(state);\n if (cls != this.currentClass) {\n for (let c of this.currentClass.split(\" \"))\n if (c)\n this.dom.classList.remove(c);\n for (let c of cls.split(\" \"))\n if (c)\n this.dom.classList.add(c);\n this.currentClass = cls;\n }\n }\n positioned(space) {\n this.space = space;\n if (this.info)\n this.view.requestMeasure(this.placeInfoReq);\n }\n updateSel() {\n let cState = this.view.state.field(this.stateField), open = cState.open;\n if (open.selected > -1 && open.selected < this.range.from || open.selected >= this.range.to) {\n this.range = rangeAroundSelected(open.options.length, open.selected, this.view.state.facet(completionConfig).maxRenderedOptions);\n this.showOptions(open.options, cState.id);\n }\n if (this.updateSelectedOption(open.selected)) {\n this.destroyInfo();\n let { completion } = open.options[open.selected];\n let { info } = completion;\n if (!info)\n return;\n let infoResult = typeof info === \"string\" ? document.createTextNode(info) : info(completion);\n if (!infoResult)\n return;\n if (\"then\" in infoResult) {\n infoResult.then(obj => {\n if (obj && this.view.state.field(this.stateField, false) == cState)\n this.addInfoPane(obj, completion);\n }).catch(e => logException(this.view.state, e, \"completion info\"));\n }\n else {\n this.addInfoPane(infoResult, completion);\n }\n }\n }\n addInfoPane(content, completion) {\n this.destroyInfo();\n let wrap = this.info = document.createElement(\"div\");\n wrap.className = \"cm-tooltip cm-completionInfo\";\n if (content.nodeType != null) {\n wrap.appendChild(content);\n this.infoDestroy = null;\n }\n else {\n let { dom, destroy } = content;\n wrap.appendChild(dom);\n this.infoDestroy = destroy || null;\n }\n this.dom.appendChild(wrap);\n this.view.requestMeasure(this.placeInfoReq);\n }\n updateSelectedOption(selected) {\n let set = null;\n for (let opt = this.list.firstChild, i = this.range.from; opt; opt = opt.nextSibling, i++) {\n if (opt.nodeName != \"LI\" || !opt.id) {\n i--; // A section header\n }\n else if (i == selected) {\n if (!opt.hasAttribute(\"aria-selected\")) {\n opt.setAttribute(\"aria-selected\", \"true\");\n set = opt;\n }\n }\n else {\n if (opt.hasAttribute(\"aria-selected\"))\n opt.removeAttribute(\"aria-selected\");\n }\n }\n if (set)\n scrollIntoView(this.list, set);\n return set;\n }\n measureInfo() {\n let sel = this.dom.querySelector(\"[aria-selected]\");\n if (!sel || !this.info)\n return null;\n let listRect = this.dom.getBoundingClientRect();\n let infoRect = this.info.getBoundingClientRect();\n let selRect = sel.getBoundingClientRect();\n let space = this.space;\n if (!space) {\n let win = this.dom.ownerDocument.defaultView || window;\n space = { left: 0, top: 0, right: win.innerWidth, bottom: win.innerHeight };\n }\n if (selRect.top > Math.min(space.bottom, listRect.bottom) - 10 ||\n selRect.bottom < Math.max(space.top, listRect.top) + 10)\n return null;\n return this.view.state.facet(completionConfig).positionInfo(this.view, listRect, selRect, infoRect, space, this.dom);\n }\n placeInfo(pos) {\n if (this.info) {\n if (pos) {\n if (pos.style)\n this.info.style.cssText = pos.style;\n this.info.className = \"cm-tooltip cm-completionInfo \" + (pos.class || \"\");\n }\n else {\n this.info.style.cssText = \"top: -1e6px\";\n }\n }\n }\n createListBox(options, id, range) {\n const ul = document.createElement(\"ul\");\n ul.id = id;\n ul.setAttribute(\"role\", \"listbox\");\n ul.setAttribute(\"aria-expanded\", \"true\");\n ul.setAttribute(\"aria-label\", this.view.state.phrase(\"Completions\"));\n let curSection = null;\n for (let i = range.from; i < range.to; i++) {\n let { completion, match } = options[i], { section } = completion;\n if (section) {\n let name = typeof section == \"string\" ? section : section.name;\n if (name != curSection && (i > range.from || range.from == 0)) {\n curSection = name;\n if (typeof section != \"string\" && section.header) {\n ul.appendChild(section.header(section));\n }\n else {\n let header = ul.appendChild(document.createElement(\"completion-section\"));\n header.textContent = name;\n }\n }\n }\n const li = ul.appendChild(document.createElement(\"li\"));\n li.id = id + \"-\" + i;\n li.setAttribute(\"role\", \"option\");\n let cls = this.optionClass(completion);\n if (cls)\n li.className = cls;\n for (let source of this.optionContent) {\n let node = source(completion, this.view.state, this.view, match);\n if (node)\n li.appendChild(node);\n }\n }\n if (range.from)\n ul.classList.add(\"cm-completionListIncompleteTop\");\n if (range.to < options.length)\n ul.classList.add(\"cm-completionListIncompleteBottom\");\n return ul;\n }\n destroyInfo() {\n if (this.info) {\n if (this.infoDestroy)\n this.infoDestroy();\n this.info.remove();\n this.info = null;\n }\n }\n destroy() {\n this.destroyInfo();\n }\n }\n function completionTooltip(stateField, applyCompletion) {\n return (view) => new CompletionTooltip(view, stateField, applyCompletion);\n }\n function scrollIntoView(container, element) {\n let parent = container.getBoundingClientRect();\n let self = element.getBoundingClientRect();\n let scaleY = parent.height / container.offsetHeight;\n if (self.top < parent.top)\n container.scrollTop -= (parent.top - self.top) / scaleY;\n else if (self.bottom > parent.bottom)\n container.scrollTop += (self.bottom - parent.bottom) / scaleY;\n }\n\n // Used to pick a preferred option when two options with the same\n // label occur in the result.\n function score(option) {\n return (option.boost || 0) * 100 + (option.apply ? 10 : 0) + (option.info ? 5 : 0) +\n (option.type ? 1 : 0);\n }\n function sortOptions(active, state) {\n let options = [];\n let sections = null;\n let addOption = (option) => {\n options.push(option);\n let { section } = option.completion;\n if (section) {\n if (!sections)\n sections = [];\n let name = typeof section == \"string\" ? section : section.name;\n if (!sections.some(s => s.name == name))\n sections.push(typeof section == \"string\" ? { name } : section);\n }\n };\n let conf = state.facet(completionConfig);\n for (let a of active)\n if (a.hasResult()) {\n let getMatch = a.result.getMatch;\n if (a.result.filter === false) {\n for (let option of a.result.options) {\n addOption(new Option(option, a.source, getMatch ? getMatch(option) : [], 1e9 - options.length));\n }\n }\n else {\n let pattern = state.sliceDoc(a.from, a.to), match;\n let matcher = conf.filterStrict ? new StrictMatcher(pattern) : new FuzzyMatcher(pattern);\n for (let option of a.result.options)\n if (match = matcher.match(option.label)) {\n let matched = !option.displayLabel ? match.matched : getMatch ? getMatch(option, match.matched) : [];\n addOption(new Option(option, a.source, matched, match.score + (option.boost || 0)));\n }\n }\n }\n if (sections) {\n let sectionOrder = Object.create(null), pos = 0;\n let cmp = (a, b) => { var _a, _b; return ((_a = a.rank) !== null && _a !== void 0 ? _a : 1e9) - ((_b = b.rank) !== null && _b !== void 0 ? _b : 1e9) || (a.name < b.name ? -1 : 1); };\n for (let s of sections.sort(cmp)) {\n pos -= 1e5;\n sectionOrder[s.name] = pos;\n }\n for (let option of options) {\n let { section } = option.completion;\n if (section)\n option.score += sectionOrder[typeof section == \"string\" ? section : section.name];\n }\n }\n let result = [], prev = null;\n let compare = conf.compareCompletions;\n for (let opt of options.sort((a, b) => (b.score - a.score) || compare(a.completion, b.completion))) {\n let cur = opt.completion;\n if (!prev || prev.label != cur.label || prev.detail != cur.detail ||\n (prev.type != null && cur.type != null && prev.type != cur.type) ||\n prev.apply != cur.apply || prev.boost != cur.boost)\n result.push(opt);\n else if (score(opt.completion) > score(prev))\n result[result.length - 1] = opt;\n prev = opt.completion;\n }\n return result;\n }\n class CompletionDialog {\n constructor(options, attrs, tooltip, timestamp, selected, disabled) {\n this.options = options;\n this.attrs = attrs;\n this.tooltip = tooltip;\n this.timestamp = timestamp;\n this.selected = selected;\n this.disabled = disabled;\n }\n setSelected(selected, id) {\n return selected == this.selected || selected >= this.options.length ? this\n : new CompletionDialog(this.options, makeAttrs(id, selected), this.tooltip, this.timestamp, selected, this.disabled);\n }\n static build(active, state, id, prev, conf) {\n let options = sortOptions(active, state);\n if (!options.length) {\n return prev && active.some(a => a.state == 1 /* State.Pending */) ?\n new CompletionDialog(prev.options, prev.attrs, prev.tooltip, prev.timestamp, prev.selected, true) : null;\n }\n let selected = state.facet(completionConfig).selectOnOpen ? 0 : -1;\n if (prev && prev.selected != selected && prev.selected != -1) {\n let selectedValue = prev.options[prev.selected].completion;\n for (let i = 0; i < options.length; i++)\n if (options[i].completion == selectedValue) {\n selected = i;\n break;\n }\n }\n return new CompletionDialog(options, makeAttrs(id, selected), {\n pos: active.reduce((a, b) => b.hasResult() ? Math.min(a, b.from) : a, 1e8),\n create: createTooltip,\n above: conf.aboveCursor,\n }, prev ? prev.timestamp : Date.now(), selected, false);\n }\n map(changes) {\n return new CompletionDialog(this.options, this.attrs, Object.assign(Object.assign({}, this.tooltip), { pos: changes.mapPos(this.tooltip.pos) }), this.timestamp, this.selected, this.disabled);\n }\n }\n class CompletionState {\n constructor(active, id, open) {\n this.active = active;\n this.id = id;\n this.open = open;\n }\n static start() {\n return new CompletionState(none$1, \"cm-ac-\" + Math.floor(Math.random() * 2e6).toString(36), null);\n }\n update(tr) {\n let { state } = tr, conf = state.facet(completionConfig);\n let sources = conf.override ||\n state.languageDataAt(\"autocomplete\", cur(state)).map(asSource);\n let active = sources.map(source => {\n let value = this.active.find(s => s.source == source) ||\n new ActiveSource(source, this.active.some(a => a.state != 0 /* State.Inactive */) ? 1 /* State.Pending */ : 0 /* State.Inactive */);\n return value.update(tr, conf);\n });\n if (active.length == this.active.length && active.every((a, i) => a == this.active[i]))\n active = this.active;\n let open = this.open;\n if (open && tr.docChanged)\n open = open.map(tr.changes);\n if (tr.selection || active.some(a => a.hasResult() && tr.changes.touchesRange(a.from, a.to)) ||\n !sameResults(active, this.active))\n open = CompletionDialog.build(active, state, this.id, open, conf);\n else if (open && open.disabled && !active.some(a => a.state == 1 /* State.Pending */))\n open = null;\n if (!open && active.every(a => a.state != 1 /* State.Pending */) && active.some(a => a.hasResult()))\n active = active.map(a => a.hasResult() ? new ActiveSource(a.source, 0 /* State.Inactive */) : a);\n for (let effect of tr.effects)\n if (effect.is(setSelectedEffect))\n open = open && open.setSelected(effect.value, this.id);\n return active == this.active && open == this.open ? this : new CompletionState(active, this.id, open);\n }\n get tooltip() { return this.open ? this.open.tooltip : null; }\n get attrs() { return this.open ? this.open.attrs : this.active.length ? baseAttrs : noAttrs; }\n }\n function sameResults(a, b) {\n if (a == b)\n return true;\n for (let iA = 0, iB = 0;;) {\n while (iA < a.length && !a[iA].hasResult)\n iA++;\n while (iB < b.length && !b[iB].hasResult)\n iB++;\n let endA = iA == a.length, endB = iB == b.length;\n if (endA || endB)\n return endA == endB;\n if (a[iA++].result != b[iB++].result)\n return false;\n }\n }\n const baseAttrs = {\n \"aria-autocomplete\": \"list\"\n };\n const noAttrs = {};\n function makeAttrs(id, selected) {\n let result = {\n \"aria-autocomplete\": \"list\",\n \"aria-haspopup\": \"listbox\",\n \"aria-controls\": id\n };\n if (selected > -1)\n result[\"aria-activedescendant\"] = id + \"-\" + selected;\n return result;\n }\n const none$1 = [];\n function getUpdateType(tr, conf) {\n if (tr.isUserEvent(\"input.complete\")) {\n let completion = tr.annotation(pickedCompletion);\n if (completion && conf.activateOnCompletion(completion))\n return 4 /* UpdateType.Activate */ | 8 /* UpdateType.Reset */;\n }\n let typing = tr.isUserEvent(\"input.type\");\n return typing && conf.activateOnTyping ? 4 /* UpdateType.Activate */ | 1 /* UpdateType.Typing */\n : typing ? 1 /* UpdateType.Typing */\n : tr.isUserEvent(\"delete.backward\") ? 2 /* UpdateType.Backspacing */\n : tr.selection ? 8 /* UpdateType.Reset */\n : tr.docChanged ? 16 /* UpdateType.ResetIfTouching */ : 0 /* UpdateType.None */;\n }\n class ActiveSource {\n constructor(source, state, explicitPos = -1) {\n this.source = source;\n this.state = state;\n this.explicitPos = explicitPos;\n }\n hasResult() { return false; }\n update(tr, conf) {\n let type = getUpdateType(tr, conf), value = this;\n if ((type & 8 /* UpdateType.Reset */) || (type & 16 /* UpdateType.ResetIfTouching */) && this.touches(tr))\n value = new ActiveSource(value.source, 0 /* State.Inactive */);\n if ((type & 4 /* UpdateType.Activate */) && value.state == 0 /* State.Inactive */)\n value = new ActiveSource(this.source, 1 /* State.Pending */);\n value = value.updateFor(tr, type);\n for (let effect of tr.effects) {\n if (effect.is(startCompletionEffect))\n value = new ActiveSource(value.source, 1 /* State.Pending */, effect.value ? cur(tr.state) : -1);\n else if (effect.is(closeCompletionEffect))\n value = new ActiveSource(value.source, 0 /* State.Inactive */);\n else if (effect.is(setActiveEffect))\n for (let active of effect.value)\n if (active.source == value.source)\n value = active;\n }\n return value;\n }\n updateFor(tr, type) { return this.map(tr.changes); }\n map(changes) {\n return changes.empty || this.explicitPos < 0 ? this : new ActiveSource(this.source, this.state, changes.mapPos(this.explicitPos));\n }\n touches(tr) {\n return tr.changes.touchesRange(cur(tr.state));\n }\n }\n class ActiveResult extends ActiveSource {\n constructor(source, explicitPos, result, from, to) {\n super(source, 2 /* State.Result */, explicitPos);\n this.result = result;\n this.from = from;\n this.to = to;\n }\n hasResult() { return true; }\n updateFor(tr, type) {\n var _a;\n if (!(type & 3 /* UpdateType.SimpleInteraction */))\n return this.map(tr.changes);\n let result = this.result;\n if (result.map && !tr.changes.empty)\n result = result.map(result, tr.changes);\n let from = tr.changes.mapPos(this.from), to = tr.changes.mapPos(this.to, 1);\n let pos = cur(tr.state);\n if ((this.explicitPos < 0 ? pos <= from : pos < this.from) ||\n pos > to || !result ||\n (type & 2 /* UpdateType.Backspacing */) && cur(tr.startState) == this.from)\n return new ActiveSource(this.source, type & 4 /* UpdateType.Activate */ ? 1 /* State.Pending */ : 0 /* State.Inactive */);\n let explicitPos = this.explicitPos < 0 ? -1 : tr.changes.mapPos(this.explicitPos);\n if (checkValid(result.validFor, tr.state, from, to))\n return new ActiveResult(this.source, explicitPos, result, from, to);\n if (result.update &&\n (result = result.update(result, from, to, new CompletionContext(tr.state, pos, explicitPos >= 0))))\n return new ActiveResult(this.source, explicitPos, result, result.from, (_a = result.to) !== null && _a !== void 0 ? _a : cur(tr.state));\n return new ActiveSource(this.source, 1 /* State.Pending */, explicitPos);\n }\n map(mapping) {\n if (mapping.empty)\n return this;\n let result = this.result.map ? this.result.map(this.result, mapping) : this.result;\n if (!result)\n return new ActiveSource(this.source, 0 /* State.Inactive */);\n return new ActiveResult(this.source, this.explicitPos < 0 ? -1 : mapping.mapPos(this.explicitPos), this.result, mapping.mapPos(this.from), mapping.mapPos(this.to, 1));\n }\n touches(tr) {\n return tr.changes.touchesRange(this.from, this.to);\n }\n }\n function checkValid(validFor, state, from, to) {\n if (!validFor)\n return false;\n let text = state.sliceDoc(from, to);\n return typeof validFor == \"function\" ? validFor(text, from, to, state) : ensureAnchor(validFor, true).test(text);\n }\n const setActiveEffect = /*@__PURE__*/StateEffect.define({\n map(sources, mapping) { return sources.map(s => s.map(mapping)); }\n });\n const setSelectedEffect = /*@__PURE__*/StateEffect.define();\n const completionState = /*@__PURE__*/StateField.define({\n create() { return CompletionState.start(); },\n update(value, tr) { return value.update(tr); },\n provide: f => [\n showTooltip.from(f, val => val.tooltip),\n EditorView.contentAttributes.from(f, state => state.attrs)\n ]\n });\n function applyCompletion(view, option) {\n const apply = option.completion.apply || option.completion.label;\n let result = view.state.field(completionState).active.find(a => a.source == option.source);\n if (!(result instanceof ActiveResult))\n return false;\n if (typeof apply == \"string\")\n view.dispatch(Object.assign(Object.assign({}, insertCompletionText(view.state, apply, result.from, result.to)), { annotations: pickedCompletion.of(option.completion) }));\n else\n apply(view, option.completion, result.from, result.to);\n return true;\n }\n const createTooltip = /*@__PURE__*/completionTooltip(completionState, applyCompletion);\n\n /**\n Returns a command that moves the completion selection forward or\n backward by the given amount.\n */\n function moveCompletionSelection(forward, by = \"option\") {\n return (view) => {\n let cState = view.state.field(completionState, false);\n if (!cState || !cState.open || cState.open.disabled ||\n Date.now() - cState.open.timestamp < view.state.facet(completionConfig).interactionDelay)\n return false;\n let step = 1, tooltip;\n if (by == \"page\" && (tooltip = getTooltip(view, cState.open.tooltip)))\n step = Math.max(2, Math.floor(tooltip.dom.offsetHeight /\n tooltip.dom.querySelector(\"li\").offsetHeight) - 1);\n let { length } = cState.open.options;\n let selected = cState.open.selected > -1 ? cState.open.selected + step * (forward ? 1 : -1) : forward ? 0 : length - 1;\n if (selected < 0)\n selected = by == \"page\" ? 0 : length - 1;\n else if (selected >= length)\n selected = by == \"page\" ? length - 1 : 0;\n view.dispatch({ effects: setSelectedEffect.of(selected) });\n return true;\n };\n }\n /**\n Accept the current completion.\n */\n const acceptCompletion = (view) => {\n let cState = view.state.field(completionState, false);\n if (view.state.readOnly || !cState || !cState.open || cState.open.selected < 0 || cState.open.disabled ||\n Date.now() - cState.open.timestamp < view.state.facet(completionConfig).interactionDelay)\n return false;\n return applyCompletion(view, cState.open.options[cState.open.selected]);\n };\n /**\n Explicitly start autocompletion.\n */\n const startCompletion = (view) => {\n let cState = view.state.field(completionState, false);\n if (!cState)\n return false;\n view.dispatch({ effects: startCompletionEffect.of(true) });\n return true;\n };\n /**\n Close the currently active completion.\n */\n const closeCompletion = (view) => {\n let cState = view.state.field(completionState, false);\n if (!cState || !cState.active.some(a => a.state != 0 /* State.Inactive */))\n return false;\n view.dispatch({ effects: closeCompletionEffect.of(null) });\n return true;\n };\n class RunningQuery {\n constructor(active, context) {\n this.active = active;\n this.context = context;\n this.time = Date.now();\n this.updates = [];\n // Note that 'undefined' means 'not done yet', whereas 'null' means\n // 'query returned null'.\n this.done = undefined;\n }\n }\n const MaxUpdateCount = 50, MinAbortTime = 1000;\n const completionPlugin = /*@__PURE__*/ViewPlugin.fromClass(class {\n constructor(view) {\n this.view = view;\n this.debounceUpdate = -1;\n this.running = [];\n this.debounceAccept = -1;\n this.pendingStart = false;\n this.composing = 0 /* CompositionState.None */;\n for (let active of view.state.field(completionState).active)\n if (active.state == 1 /* State.Pending */)\n this.startQuery(active);\n }\n update(update) {\n let cState = update.state.field(completionState);\n let conf = update.state.facet(completionConfig);\n if (!update.selectionSet && !update.docChanged && update.startState.field(completionState) == cState)\n return;\n let doesReset = update.transactions.some(tr => {\n let type = getUpdateType(tr, conf);\n return (type & 8 /* UpdateType.Reset */) || (tr.selection || tr.docChanged) && !(type & 3 /* UpdateType.SimpleInteraction */);\n });\n for (let i = 0; i < this.running.length; i++) {\n let query = this.running[i];\n if (doesReset ||\n query.updates.length + update.transactions.length > MaxUpdateCount && Date.now() - query.time > MinAbortTime) {\n for (let handler of query.context.abortListeners) {\n try {\n handler();\n }\n catch (e) {\n logException(this.view.state, e);\n }\n }\n query.context.abortListeners = null;\n this.running.splice(i--, 1);\n }\n else {\n query.updates.push(...update.transactions);\n }\n }\n if (this.debounceUpdate > -1)\n clearTimeout(this.debounceUpdate);\n if (update.transactions.some(tr => tr.effects.some(e => e.is(startCompletionEffect))))\n this.pendingStart = true;\n let delay = this.pendingStart ? 50 : conf.activateOnTypingDelay;\n this.debounceUpdate = cState.active.some(a => a.state == 1 /* State.Pending */ && !this.running.some(q => q.active.source == a.source))\n ? setTimeout(() => this.startUpdate(), delay) : -1;\n if (this.composing != 0 /* CompositionState.None */)\n for (let tr of update.transactions) {\n if (tr.isUserEvent(\"input.type\"))\n this.composing = 2 /* CompositionState.Changed */;\n else if (this.composing == 2 /* CompositionState.Changed */ && tr.selection)\n this.composing = 3 /* CompositionState.ChangedAndMoved */;\n }\n }\n startUpdate() {\n this.debounceUpdate = -1;\n this.pendingStart = false;\n let { state } = this.view, cState = state.field(completionState);\n for (let active of cState.active) {\n if (active.state == 1 /* State.Pending */ && !this.running.some(r => r.active.source == active.source))\n this.startQuery(active);\n }\n }\n startQuery(active) {\n let { state } = this.view, pos = cur(state);\n let context = new CompletionContext(state, pos, active.explicitPos == pos, this.view);\n let pending = new RunningQuery(active, context);\n this.running.push(pending);\n Promise.resolve(active.source(context)).then(result => {\n if (!pending.context.aborted) {\n pending.done = result || null;\n this.scheduleAccept();\n }\n }, err => {\n this.view.dispatch({ effects: closeCompletionEffect.of(null) });\n logException(this.view.state, err);\n });\n }\n scheduleAccept() {\n if (this.running.every(q => q.done !== undefined))\n this.accept();\n else if (this.debounceAccept < 0)\n this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(completionConfig).updateSyncTime);\n }\n // For each finished query in this.running, try to create a result\n // or, if appropriate, restart the query.\n accept() {\n var _a;\n if (this.debounceAccept > -1)\n clearTimeout(this.debounceAccept);\n this.debounceAccept = -1;\n let updated = [];\n let conf = this.view.state.facet(completionConfig);\n for (let i = 0; i < this.running.length; i++) {\n let query = this.running[i];\n if (query.done === undefined)\n continue;\n this.running.splice(i--, 1);\n if (query.done) {\n let active = new ActiveResult(query.active.source, query.active.explicitPos, query.done, query.done.from, (_a = query.done.to) !== null && _a !== void 0 ? _a : cur(query.updates.length ? query.updates[0].startState : this.view.state));\n // Replay the transactions that happened since the start of\n // the request and see if that preserves the result\n for (let tr of query.updates)\n active = active.update(tr, conf);\n if (active.hasResult()) {\n updated.push(active);\n continue;\n }\n }\n let current = this.view.state.field(completionState).active.find(a => a.source == query.active.source);\n if (current && current.state == 1 /* State.Pending */) {\n if (query.done == null) {\n // Explicitly failed. Should clear the pending status if it\n // hasn't been re-set in the meantime.\n let active = new ActiveSource(query.active.source, 0 /* State.Inactive */);\n for (let tr of query.updates)\n active = active.update(tr, conf);\n if (active.state != 1 /* State.Pending */)\n updated.push(active);\n }\n else {\n // Cleared by subsequent transactions. Restart.\n this.startQuery(current);\n }\n }\n }\n if (updated.length)\n this.view.dispatch({ effects: setActiveEffect.of(updated) });\n }\n }, {\n eventHandlers: {\n blur(event) {\n let state = this.view.state.field(completionState, false);\n if (state && state.tooltip && this.view.state.facet(completionConfig).closeOnBlur) {\n let dialog = state.open && getTooltip(this.view, state.open.tooltip);\n if (!dialog || !dialog.dom.contains(event.relatedTarget))\n setTimeout(() => this.view.dispatch({ effects: closeCompletionEffect.of(null) }), 10);\n }\n },\n compositionstart() {\n this.composing = 1 /* CompositionState.Started */;\n },\n compositionend() {\n if (this.composing == 3 /* CompositionState.ChangedAndMoved */) {\n // Safari fires compositionend events synchronously, possibly\n // from inside an update, so dispatch asynchronously to avoid reentrancy\n setTimeout(() => this.view.dispatch({ effects: startCompletionEffect.of(false) }), 20);\n }\n this.composing = 0 /* CompositionState.None */;\n }\n }\n });\n const windows = typeof navigator == \"object\" && /*@__PURE__*//Win/.test(navigator.platform);\n const commitCharacters = /*@__PURE__*/Prec.highest(/*@__PURE__*/EditorView.domEventHandlers({\n keydown(event, view) {\n let field = view.state.field(completionState, false);\n if (!field || !field.open || field.open.disabled || field.open.selected < 0 ||\n event.key.length > 1 || event.ctrlKey && !(windows && event.altKey) || event.metaKey)\n return false;\n let option = field.open.options[field.open.selected];\n let result = field.active.find(a => a.source == option.source);\n let commitChars = option.completion.commitCharacters || result.result.commitCharacters;\n if (commitChars && commitChars.indexOf(event.key) > -1)\n applyCompletion(view, option);\n return false;\n }\n }));\n\n const baseTheme = /*@__PURE__*/EditorView.baseTheme({\n \".cm-tooltip.cm-tooltip-autocomplete\": {\n \"& > ul\": {\n fontFamily: \"monospace\",\n whiteSpace: \"nowrap\",\n overflow: \"hidden auto\",\n maxWidth_fallback: \"700px\",\n maxWidth: \"min(700px, 95vw)\",\n minWidth: \"250px\",\n maxHeight: \"10em\",\n height: \"100%\",\n listStyle: \"none\",\n margin: 0,\n padding: 0,\n \"& > li, & > completion-section\": {\n padding: \"1px 3px\",\n lineHeight: 1.2\n },\n \"& > li\": {\n overflowX: \"hidden\",\n textOverflow: \"ellipsis\",\n cursor: \"pointer\"\n },\n \"& > completion-section\": {\n display: \"list-item\",\n borderBottom: \"1px solid silver\",\n paddingLeft: \"0.5em\",\n opacity: 0.7\n }\n }\n },\n \"&light .cm-tooltip-autocomplete ul li[aria-selected]\": {\n background: \"#17c\",\n color: \"white\",\n },\n \"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]\": {\n background: \"#777\",\n },\n \"&dark .cm-tooltip-autocomplete ul li[aria-selected]\": {\n background: \"#347\",\n color: \"white\",\n },\n \"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]\": {\n background: \"#444\",\n },\n \".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after\": {\n content: '\"\u00B7\u00B7\u00B7\"',\n opacity: 0.5,\n display: \"block\",\n textAlign: \"center\"\n },\n \".cm-tooltip.cm-completionInfo\": {\n position: \"absolute\",\n padding: \"3px 9px\",\n width: \"max-content\",\n maxWidth: `${400 /* Info.Width */}px`,\n boxSizing: \"border-box\"\n },\n \".cm-completionInfo.cm-completionInfo-left\": { right: \"100%\" },\n \".cm-completionInfo.cm-completionInfo-right\": { left: \"100%\" },\n \".cm-completionInfo.cm-completionInfo-left-narrow\": { right: `${30 /* Info.Margin */}px` },\n \".cm-completionInfo.cm-completionInfo-right-narrow\": { left: `${30 /* Info.Margin */}px` },\n \"&light .cm-snippetField\": { backgroundColor: \"#00000022\" },\n \"&dark .cm-snippetField\": { backgroundColor: \"#ffffff22\" },\n \".cm-snippetFieldPosition\": {\n verticalAlign: \"text-top\",\n width: 0,\n height: \"1.15em\",\n display: \"inline-block\",\n margin: \"0 -0.7px -.7em\",\n borderLeft: \"1.4px dotted #888\"\n },\n \".cm-completionMatchedText\": {\n textDecoration: \"underline\"\n },\n \".cm-completionDetail\": {\n marginLeft: \"0.5em\",\n fontStyle: \"italic\"\n },\n \".cm-completionIcon\": {\n fontSize: \"90%\",\n width: \".8em\",\n display: \"inline-block\",\n textAlign: \"center\",\n paddingRight: \".6em\",\n opacity: \"0.6\",\n boxSizing: \"content-box\"\n },\n \".cm-completionIcon-function, .cm-completionIcon-method\": {\n \"&:after\": { content: \"'\u0192'\" }\n },\n \".cm-completionIcon-class\": {\n \"&:after\": { content: \"'\u25CB'\" }\n },\n \".cm-completionIcon-interface\": {\n \"&:after\": { content: \"'\u25CC'\" }\n },\n \".cm-completionIcon-variable\": {\n \"&:after\": { content: \"'\uD835\uDC65'\" }\n },\n \".cm-completionIcon-constant\": {\n \"&:after\": { content: \"'\uD835\uDC36'\" }\n },\n \".cm-completionIcon-type\": {\n \"&:after\": { content: \"'\uD835\uDC61'\" }\n },\n \".cm-completionIcon-enum\": {\n \"&:after\": { content: \"'\u222A'\" }\n },\n \".cm-completionIcon-property\": {\n \"&:after\": { content: \"'\u25A1'\" }\n },\n \".cm-completionIcon-keyword\": {\n \"&:after\": { content: \"'\uD83D\uDD11\\uFE0E'\" } // Disable emoji rendering\n },\n \".cm-completionIcon-namespace\": {\n \"&:after\": { content: \"'\u25A2'\" }\n },\n \".cm-completionIcon-text\": {\n \"&:after\": { content: \"'abc'\", fontSize: \"50%\", verticalAlign: \"middle\" }\n }\n });\n\n class FieldPos {\n constructor(field, line, from, to) {\n this.field = field;\n this.line = line;\n this.from = from;\n this.to = to;\n }\n }\n class FieldRange {\n constructor(field, from, to) {\n this.field = field;\n this.from = from;\n this.to = to;\n }\n map(changes) {\n let from = changes.mapPos(this.from, -1, MapMode.TrackDel);\n let to = changes.mapPos(this.to, 1, MapMode.TrackDel);\n return from == null || to == null ? null : new FieldRange(this.field, from, to);\n }\n }\n class Snippet {\n constructor(lines, fieldPositions) {\n this.lines = lines;\n this.fieldPositions = fieldPositions;\n }\n instantiate(state, pos) {\n let text = [], lineStart = [pos];\n let lineObj = state.doc.lineAt(pos), baseIndent = /^\\s*/.exec(lineObj.text)[0];\n for (let line of this.lines) {\n if (text.length) {\n let indent = baseIndent, tabs = /^\\t*/.exec(line)[0].length;\n for (let i = 0; i < tabs; i++)\n indent += state.facet(indentUnit);\n lineStart.push(pos + indent.length - tabs);\n line = indent + line.slice(tabs);\n }\n text.push(line);\n pos += line.length + 1;\n }\n let ranges = this.fieldPositions.map(pos => new FieldRange(pos.field, lineStart[pos.line] + pos.from, lineStart[pos.line] + pos.to));\n return { text, ranges };\n }\n static parse(template) {\n let fields = [];\n let lines = [], positions = [], m;\n for (let line of template.split(/\\r\\n?|\\n/)) {\n while (m = /[#$]\\{(?:(\\d+)(?::([^}]*))?|((?:\\\\[{}]|[^}])*))\\}/.exec(line)) {\n let seq = m[1] ? +m[1] : null, rawName = m[2] || m[3] || \"\", found = -1;\n let name = rawName.replace(/\\\\[{}]/g, m => m[1]);\n for (let i = 0; i < fields.length; i++) {\n if (seq != null ? fields[i].seq == seq : name ? fields[i].name == name : false)\n found = i;\n }\n if (found < 0) {\n let i = 0;\n while (i < fields.length && (seq == null || (fields[i].seq != null && fields[i].seq < seq)))\n i++;\n fields.splice(i, 0, { seq, name });\n found = i;\n for (let pos of positions)\n if (pos.field >= found)\n pos.field++;\n }\n positions.push(new FieldPos(found, lines.length, m.index, m.index + name.length));\n line = line.slice(0, m.index) + rawName + line.slice(m.index + m[0].length);\n }\n line = line.replace(/\\\\([{}])/g, (_, brace, index) => {\n for (let pos of positions)\n if (pos.line == lines.length && pos.from > index) {\n pos.from--;\n pos.to--;\n }\n return brace;\n });\n lines.push(line);\n }\n return new Snippet(lines, positions);\n }\n }\n let fieldMarker = /*@__PURE__*/Decoration.widget({ widget: /*@__PURE__*/new class extends WidgetType {\n toDOM() {\n let span = document.createElement(\"span\");\n span.className = \"cm-snippetFieldPosition\";\n return span;\n }\n ignoreEvent() { return false; }\n } });\n let fieldRange = /*@__PURE__*/Decoration.mark({ class: \"cm-snippetField\" });\n class ActiveSnippet {\n constructor(ranges, active) {\n this.ranges = ranges;\n this.active = active;\n this.deco = Decoration.set(ranges.map(r => (r.from == r.to ? fieldMarker : fieldRange).range(r.from, r.to)));\n }\n map(changes) {\n let ranges = [];\n for (let r of this.ranges) {\n let mapped = r.map(changes);\n if (!mapped)\n return null;\n ranges.push(mapped);\n }\n return new ActiveSnippet(ranges, this.active);\n }\n selectionInsideField(sel) {\n return sel.ranges.every(range => this.ranges.some(r => r.field == this.active && r.from <= range.from && r.to >= range.to));\n }\n }\n const setActive = /*@__PURE__*/StateEffect.define({\n map(value, changes) { return value && value.map(changes); }\n });\n const moveToField = /*@__PURE__*/StateEffect.define();\n const snippetState = /*@__PURE__*/StateField.define({\n create() { return null; },\n update(value, tr) {\n for (let effect of tr.effects) {\n if (effect.is(setActive))\n return effect.value;\n if (effect.is(moveToField) && value)\n return new ActiveSnippet(value.ranges, effect.value);\n }\n if (value && tr.docChanged)\n value = value.map(tr.changes);\n if (value && tr.selection && !value.selectionInsideField(tr.selection))\n value = null;\n return value;\n },\n provide: f => EditorView.decorations.from(f, val => val ? val.deco : Decoration.none)\n });\n function fieldSelection(ranges, field) {\n return EditorSelection.create(ranges.filter(r => r.field == field).map(r => EditorSelection.range(r.from, r.to)));\n }\n /**\n Convert a snippet template to a function that can\n [apply](https://codemirror.net/6/docs/ref/#autocomplete.Completion.apply) it. Snippets are written\n using syntax like this:\n\n \"for (let ${index} = 0; ${index} < ${end}; ${index}++) {\\n\\t${}\\n}\"\n\n Each `${}` placeholder (you may also use `#{}`) indicates a field\n that the user can fill in. Its name, if any, will be the default\n content for the field.\n\n When the snippet is activated by calling the returned function,\n the code is inserted at the given position. Newlines in the\n template are indented by the indentation of the start line, plus\n one [indent unit](https://codemirror.net/6/docs/ref/#language.indentUnit) per tab character after\n the newline.\n\n On activation, (all instances of) the first field are selected.\n The user can move between fields with Tab and Shift-Tab as long as\n the fields are active. Moving to the last field or moving the\n cursor out of the current field deactivates the fields.\n\n The order of fields defaults to textual order, but you can add\n numbers to placeholders (`${1}` or `${1:defaultText}`) to provide\n a custom order.\n\n To include a literal `{` or `}` in your template, put a backslash\n in front of it. This will be removed and the brace will not be\n interpreted as indicating a placeholder.\n */\n function snippet(template) {\n let snippet = Snippet.parse(template);\n return (editor, completion, from, to) => {\n let { text, ranges } = snippet.instantiate(editor.state, from);\n let spec = {\n changes: { from, to, insert: Text.of(text) },\n scrollIntoView: true,\n annotations: completion ? [pickedCompletion.of(completion), Transaction.userEvent.of(\"input.complete\")] : undefined\n };\n if (ranges.length)\n spec.selection = fieldSelection(ranges, 0);\n if (ranges.some(r => r.field > 0)) {\n let active = new ActiveSnippet(ranges, 0);\n let effects = spec.effects = [setActive.of(active)];\n if (editor.state.field(snippetState, false) === undefined)\n effects.push(StateEffect.appendConfig.of([snippetState, addSnippetKeymap, snippetPointerHandler, baseTheme]));\n }\n editor.dispatch(editor.state.update(spec));\n };\n }\n function moveField(dir) {\n return ({ state, dispatch }) => {\n let active = state.field(snippetState, false);\n if (!active || dir < 0 && active.active == 0)\n return false;\n let next = active.active + dir, last = dir > 0 && !active.ranges.some(r => r.field == next + dir);\n dispatch(state.update({\n selection: fieldSelection(active.ranges, next),\n effects: setActive.of(last ? null : new ActiveSnippet(active.ranges, next)),\n scrollIntoView: true\n }));\n return true;\n };\n }\n /**\n A command that clears the active snippet, if any.\n */\n const clearSnippet = ({ state, dispatch }) => {\n let active = state.field(snippetState, false);\n if (!active)\n return false;\n dispatch(state.update({ effects: setActive.of(null) }));\n return true;\n };\n /**\n Move to the next snippet field, if available.\n */\n const nextSnippetField = /*@__PURE__*/moveField(1);\n /**\n Move to the previous snippet field, if available.\n */\n const prevSnippetField = /*@__PURE__*/moveField(-1);\n const defaultSnippetKeymap = [\n { key: \"Tab\", run: nextSnippetField, shift: prevSnippetField },\n { key: \"Escape\", run: clearSnippet }\n ];\n /**\n A facet that can be used to configure the key bindings used by\n snippets. The default binds Tab to\n [`nextSnippetField`](https://codemirror.net/6/docs/ref/#autocomplete.nextSnippetField), Shift-Tab to\n [`prevSnippetField`](https://codemirror.net/6/docs/ref/#autocomplete.prevSnippetField), and Escape\n to [`clearSnippet`](https://codemirror.net/6/docs/ref/#autocomplete.clearSnippet).\n */\n const snippetKeymap = /*@__PURE__*/Facet.define({\n combine(maps) { return maps.length ? maps[0] : defaultSnippetKeymap; }\n });\n const addSnippetKeymap = /*@__PURE__*/Prec.highest(/*@__PURE__*/keymap.compute([snippetKeymap], state => state.facet(snippetKeymap)));\n /**\n Create a completion from a snippet. Returns an object with the\n properties from `completion`, plus an `apply` function that\n applies the snippet.\n */\n function snippetCompletion(template, completion) {\n return Object.assign(Object.assign({}, completion), { apply: snippet(template) });\n }\n const snippetPointerHandler = /*@__PURE__*/EditorView.domEventHandlers({\n mousedown(event, view) {\n let active = view.state.field(snippetState, false), pos;\n if (!active || (pos = view.posAtCoords({ x: event.clientX, y: event.clientY })) == null)\n return false;\n let match = active.ranges.find(r => r.from <= pos && r.to >= pos);\n if (!match || match.field == active.active)\n return false;\n view.dispatch({\n selection: fieldSelection(active.ranges, match.field),\n effects: setActive.of(active.ranges.some(r => r.field > match.field)\n ? new ActiveSnippet(active.ranges, match.field) : null),\n scrollIntoView: true\n });\n return true;\n }\n });\n\n const defaults = {\n brackets: [\"(\", \"[\", \"{\", \"'\", '\"'],\n before: \")]}:;>\",\n stringPrefixes: []\n };\n const closeBracketEffect = /*@__PURE__*/StateEffect.define({\n map(value, mapping) {\n let mapped = mapping.mapPos(value, -1, MapMode.TrackAfter);\n return mapped == null ? undefined : mapped;\n }\n });\n const closedBracket = /*@__PURE__*/new class extends RangeValue {\n };\n closedBracket.startSide = 1;\n closedBracket.endSide = -1;\n const bracketState = /*@__PURE__*/StateField.define({\n create() { return RangeSet.empty; },\n update(value, tr) {\n value = value.map(tr.changes);\n if (tr.selection) {\n let line = tr.state.doc.lineAt(tr.selection.main.head);\n value = value.update({ filter: from => from >= line.from && from <= line.to });\n }\n for (let effect of tr.effects)\n if (effect.is(closeBracketEffect))\n value = value.update({ add: [closedBracket.range(effect.value, effect.value + 1)] });\n return value;\n }\n });\n /**\n Extension to enable bracket-closing behavior. When a closeable\n bracket is typed, its closing bracket is immediately inserted\n after the cursor. When closing a bracket directly in front of a\n closing bracket inserted by the extension, the cursor moves over\n that bracket.\n */\n function closeBrackets() {\n return [inputHandler, bracketState];\n }\n const definedClosing = \"()[]{}<>\";\n function closing(ch) {\n for (let i = 0; i < definedClosing.length; i += 2)\n if (definedClosing.charCodeAt(i) == ch)\n return definedClosing.charAt(i + 1);\n return fromCodePoint(ch < 128 ? ch : ch + 1);\n }\n function config$1(state, pos) {\n return state.languageDataAt(\"closeBrackets\", pos)[0] || defaults;\n }\n const android$1 = typeof navigator == \"object\" && /*@__PURE__*//Android\\b/.test(navigator.userAgent);\n const inputHandler = /*@__PURE__*/EditorView.inputHandler.of((view, from, to, insert) => {\n if ((android$1 ? view.composing : view.compositionStarted) || view.state.readOnly)\n return false;\n let sel = view.state.selection.main;\n if (insert.length > 2 || insert.length == 2 && codePointSize(codePointAt(insert, 0)) == 1 ||\n from != sel.from || to != sel.to)\n return false;\n let tr = insertBracket(view.state, insert);\n if (!tr)\n return false;\n view.dispatch(tr);\n return true;\n });\n /**\n Command that implements deleting a pair of matching brackets when\n the cursor is between them.\n */\n const deleteBracketPair = ({ state, dispatch }) => {\n if (state.readOnly)\n return false;\n let conf = config$1(state, state.selection.main.head);\n let tokens = conf.brackets || defaults.brackets;\n let dont = null, changes = state.changeByRange(range => {\n if (range.empty) {\n let before = prevChar(state.doc, range.head);\n for (let token of tokens) {\n if (token == before && nextChar(state.doc, range.head) == closing(codePointAt(token, 0)))\n return { changes: { from: range.head - token.length, to: range.head + token.length },\n range: EditorSelection.cursor(range.head - token.length) };\n }\n }\n return { range: dont = range };\n });\n if (!dont)\n dispatch(state.update(changes, { scrollIntoView: true, userEvent: \"delete.backward\" }));\n return !dont;\n };\n /**\n Close-brackets related key bindings. Binds Backspace to\n [`deleteBracketPair`](https://codemirror.net/6/docs/ref/#autocomplete.deleteBracketPair).\n */\n const closeBracketsKeymap = [\n { key: \"Backspace\", run: deleteBracketPair }\n ];\n /**\n Implements the extension's behavior on text insertion. If the\n given string counts as a bracket in the language around the\n selection, and replacing the selection with it requires custom\n behavior (inserting a closing version or skipping past a\n previously-closed bracket), this function returns a transaction\n representing that custom behavior. (You only need this if you want\n to programmatically insert brackets\u2014the\n [`closeBrackets`](https://codemirror.net/6/docs/ref/#autocomplete.closeBrackets) extension will\n take care of running this for user input.)\n */\n function insertBracket(state, bracket) {\n let conf = config$1(state, state.selection.main.head);\n let tokens = conf.brackets || defaults.brackets;\n for (let tok of tokens) {\n let closed = closing(codePointAt(tok, 0));\n if (bracket == tok)\n return closed == tok ? handleSame(state, tok, tokens.indexOf(tok + tok + tok) > -1, conf)\n : handleOpen(state, tok, closed, conf.before || defaults.before);\n if (bracket == closed && closedBracketAt(state, state.selection.main.from))\n return handleClose(state, tok, closed);\n }\n return null;\n }\n function closedBracketAt(state, pos) {\n let found = false;\n state.field(bracketState).between(0, state.doc.length, from => {\n if (from == pos)\n found = true;\n });\n return found;\n }\n function nextChar(doc, pos) {\n let next = doc.sliceString(pos, pos + 2);\n return next.slice(0, codePointSize(codePointAt(next, 0)));\n }\n function prevChar(doc, pos) {\n let prev = doc.sliceString(pos - 2, pos);\n return codePointSize(codePointAt(prev, 0)) == prev.length ? prev : prev.slice(1);\n }\n function handleOpen(state, open, close, closeBefore) {\n let dont = null, changes = state.changeByRange(range => {\n if (!range.empty)\n return { changes: [{ insert: open, from: range.from }, { insert: close, from: range.to }],\n effects: closeBracketEffect.of(range.to + open.length),\n range: EditorSelection.range(range.anchor + open.length, range.head + open.length) };\n let next = nextChar(state.doc, range.head);\n if (!next || /\\s/.test(next) || closeBefore.indexOf(next) > -1)\n return { changes: { insert: open + close, from: range.head },\n effects: closeBracketEffect.of(range.head + open.length),\n range: EditorSelection.cursor(range.head + open.length) };\n return { range: dont = range };\n });\n return dont ? null : state.update(changes, {\n scrollIntoView: true,\n userEvent: \"input.type\"\n });\n }\n function handleClose(state, _open, close) {\n let dont = null, changes = state.changeByRange(range => {\n if (range.empty && nextChar(state.doc, range.head) == close)\n return { changes: { from: range.head, to: range.head + close.length, insert: close },\n range: EditorSelection.cursor(range.head + close.length) };\n return dont = { range };\n });\n return dont ? null : state.update(changes, {\n scrollIntoView: true,\n userEvent: \"input.type\"\n });\n }\n // Handles cases where the open and close token are the same, and\n // possibly triple quotes (as in `\"\"\"abc\"\"\"`-style quoting).\n function handleSame(state, token, allowTriple, config) {\n let stringPrefixes = config.stringPrefixes || defaults.stringPrefixes;\n let dont = null, changes = state.changeByRange(range => {\n if (!range.empty)\n return { changes: [{ insert: token, from: range.from }, { insert: token, from: range.to }],\n effects: closeBracketEffect.of(range.to + token.length),\n range: EditorSelection.range(range.anchor + token.length, range.head + token.length) };\n let pos = range.head, next = nextChar(state.doc, pos), start;\n if (next == token) {\n if (nodeStart(state, pos)) {\n return { changes: { insert: token + token, from: pos },\n effects: closeBracketEffect.of(pos + token.length),\n range: EditorSelection.cursor(pos + token.length) };\n }\n else if (closedBracketAt(state, pos)) {\n let isTriple = allowTriple && state.sliceDoc(pos, pos + token.length * 3) == token + token + token;\n let content = isTriple ? token + token + token : token;\n return { changes: { from: pos, to: pos + content.length, insert: content },\n range: EditorSelection.cursor(pos + content.length) };\n }\n }\n else if (allowTriple && state.sliceDoc(pos - 2 * token.length, pos) == token + token &&\n (start = canStartStringAt(state, pos - 2 * token.length, stringPrefixes)) > -1 &&\n nodeStart(state, start)) {\n return { changes: { insert: token + token + token + token, from: pos },\n effects: closeBracketEffect.of(pos + token.length),\n range: EditorSelection.cursor(pos + token.length) };\n }\n else if (state.charCategorizer(pos)(next) != CharCategory.Word) {\n if (canStartStringAt(state, pos, stringPrefixes) > -1 && !probablyInString(state, pos, token, stringPrefixes))\n return { changes: { insert: token + token, from: pos },\n effects: closeBracketEffect.of(pos + token.length),\n range: EditorSelection.cursor(pos + token.length) };\n }\n return { range: dont = range };\n });\n return dont ? null : state.update(changes, {\n scrollIntoView: true,\n userEvent: \"input.type\"\n });\n }\n function nodeStart(state, pos) {\n let tree = syntaxTree(state).resolveInner(pos + 1);\n return tree.parent && tree.from == pos;\n }\n function probablyInString(state, pos, quoteToken, prefixes) {\n let node = syntaxTree(state).resolveInner(pos, -1);\n let maxPrefix = prefixes.reduce((m, p) => Math.max(m, p.length), 0);\n for (let i = 0; i < 5; i++) {\n let start = state.sliceDoc(node.from, Math.min(node.to, node.from + quoteToken.length + maxPrefix));\n let quotePos = start.indexOf(quoteToken);\n if (!quotePos || quotePos > -1 && prefixes.indexOf(start.slice(0, quotePos)) > -1) {\n let first = node.firstChild;\n while (first && first.from == node.from && first.to - first.from > quoteToken.length + quotePos) {\n if (state.sliceDoc(first.to - quoteToken.length, first.to) == quoteToken)\n return false;\n first = first.firstChild;\n }\n return true;\n }\n let parent = node.to == pos && node.parent;\n if (!parent)\n break;\n node = parent;\n }\n return false;\n }\n function canStartStringAt(state, pos, prefixes) {\n let charCat = state.charCategorizer(pos);\n if (charCat(state.sliceDoc(pos - 1, pos)) != CharCategory.Word)\n return pos;\n for (let prefix of prefixes) {\n let start = pos - prefix.length;\n if (state.sliceDoc(start, pos) == prefix && charCat(state.sliceDoc(start - 1, start)) != CharCategory.Word)\n return start;\n }\n return -1;\n }\n\n /**\n Returns an extension that enables autocompletion.\n */\n function autocompletion(config = {}) {\n return [\n commitCharacters,\n completionState,\n completionConfig.of(config),\n completionPlugin,\n completionKeymapExt,\n baseTheme\n ];\n }\n /**\n Basic keybindings for autocompletion.\n\n - Ctrl-Space: [`startCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.startCompletion)\n - Escape: [`closeCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.closeCompletion)\n - ArrowDown: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(true)`\n - ArrowUp: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(false)`\n - PageDown: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(true, \"page\")`\n - PageDown: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(true, \"page\")`\n - Enter: [`acceptCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.acceptCompletion)\n */\n const completionKeymap = [\n { key: \"Ctrl-Space\", run: startCompletion },\n { key: \"Escape\", run: closeCompletion },\n { key: \"ArrowDown\", run: /*@__PURE__*/moveCompletionSelection(true) },\n { key: \"ArrowUp\", run: /*@__PURE__*/moveCompletionSelection(false) },\n { key: \"PageDown\", run: /*@__PURE__*/moveCompletionSelection(true, \"page\") },\n { key: \"PageUp\", run: /*@__PURE__*/moveCompletionSelection(false, \"page\") },\n { key: \"Enter\", run: acceptCompletion }\n ];\n const completionKeymapExt = /*@__PURE__*/Prec.highest(/*@__PURE__*/keymap.computeN([completionConfig], state => state.facet(completionConfig).defaultKeymap ? [completionKeymap] : []));\n /**\n Get the current completion status. When completions are available,\n this will return `\"active\"`. When completions are pending (in the\n process of being queried), this returns `\"pending\"`. Otherwise, it\n returns `null`.\n */\n function completionStatus(state) {\n let cState = state.field(completionState, false);\n return cState && cState.active.some(a => a.state == 1 /* State.Pending */) ? \"pending\"\n : cState && cState.active.some(a => a.state != 0 /* State.Inactive */) ? \"active\" : null;\n }\n\n class CompositeBlock {\n static create(type, value, from, parentHash, end) {\n let hash = (parentHash + (parentHash << 8) + type + (value << 4)) | 0;\n return new CompositeBlock(type, value, from, hash, end, [], []);\n }\n constructor(type, \n // Used for indentation in list items, markup character in lists\n value, from, hash, end, children, positions) {\n this.type = type;\n this.value = value;\n this.from = from;\n this.hash = hash;\n this.end = end;\n this.children = children;\n this.positions = positions;\n this.hashProp = [[NodeProp.contextHash, hash]];\n }\n addChild(child, pos) {\n if (child.prop(NodeProp.contextHash) != this.hash)\n child = new Tree(child.type, child.children, child.positions, child.length, this.hashProp);\n this.children.push(child);\n this.positions.push(pos);\n }\n toTree(nodeSet, end = this.end) {\n let last = this.children.length - 1;\n if (last >= 0)\n end = Math.max(end, this.positions[last] + this.children[last].length + this.from);\n return new Tree(nodeSet.types[this.type], this.children, this.positions, end - this.from).balance({\n makeTree: (children, positions, length) => new Tree(NodeType.none, children, positions, length, this.hashProp)\n });\n }\n }\n var Type;\n (function (Type) {\n Type[Type[\"Document\"] = 1] = \"Document\";\n Type[Type[\"CodeBlock\"] = 2] = \"CodeBlock\";\n Type[Type[\"FencedCode\"] = 3] = \"FencedCode\";\n Type[Type[\"Blockquote\"] = 4] = \"Blockquote\";\n Type[Type[\"HorizontalRule\"] = 5] = \"HorizontalRule\";\n Type[Type[\"BulletList\"] = 6] = \"BulletList\";\n Type[Type[\"OrderedList\"] = 7] = \"OrderedList\";\n Type[Type[\"ListItem\"] = 8] = \"ListItem\";\n Type[Type[\"ATXHeading1\"] = 9] = \"ATXHeading1\";\n Type[Type[\"ATXHeading2\"] = 10] = \"ATXHeading2\";\n Type[Type[\"ATXHeading3\"] = 11] = \"ATXHeading3\";\n Type[Type[\"ATXHeading4\"] = 12] = \"ATXHeading4\";\n Type[Type[\"ATXHeading5\"] = 13] = \"ATXHeading5\";\n Type[Type[\"ATXHeading6\"] = 14] = \"ATXHeading6\";\n Type[Type[\"SetextHeading1\"] = 15] = \"SetextHeading1\";\n Type[Type[\"SetextHeading2\"] = 16] = \"SetextHeading2\";\n Type[Type[\"HTMLBlock\"] = 17] = \"HTMLBlock\";\n Type[Type[\"LinkReference\"] = 18] = \"LinkReference\";\n Type[Type[\"Paragraph\"] = 19] = \"Paragraph\";\n Type[Type[\"CommentBlock\"] = 20] = \"CommentBlock\";\n Type[Type[\"ProcessingInstructionBlock\"] = 21] = \"ProcessingInstructionBlock\";\n // Inline\n Type[Type[\"Escape\"] = 22] = \"Escape\";\n Type[Type[\"Entity\"] = 23] = \"Entity\";\n Type[Type[\"HardBreak\"] = 24] = \"HardBreak\";\n Type[Type[\"Emphasis\"] = 25] = \"Emphasis\";\n Type[Type[\"StrongEmphasis\"] = 26] = \"StrongEmphasis\";\n Type[Type[\"Link\"] = 27] = \"Link\";\n Type[Type[\"Image\"] = 28] = \"Image\";\n Type[Type[\"InlineCode\"] = 29] = \"InlineCode\";\n Type[Type[\"HTMLTag\"] = 30] = \"HTMLTag\";\n Type[Type[\"Comment\"] = 31] = \"Comment\";\n Type[Type[\"ProcessingInstruction\"] = 32] = \"ProcessingInstruction\";\n Type[Type[\"Autolink\"] = 33] = \"Autolink\";\n // Smaller tokens\n Type[Type[\"HeaderMark\"] = 34] = \"HeaderMark\";\n Type[Type[\"QuoteMark\"] = 35] = \"QuoteMark\";\n Type[Type[\"ListMark\"] = 36] = \"ListMark\";\n Type[Type[\"LinkMark\"] = 37] = \"LinkMark\";\n Type[Type[\"EmphasisMark\"] = 38] = \"EmphasisMark\";\n Type[Type[\"CodeMark\"] = 39] = \"CodeMark\";\n Type[Type[\"CodeText\"] = 40] = \"CodeText\";\n Type[Type[\"CodeInfo\"] = 41] = \"CodeInfo\";\n Type[Type[\"LinkTitle\"] = 42] = \"LinkTitle\";\n Type[Type[\"LinkLabel\"] = 43] = \"LinkLabel\";\n Type[Type[\"URL\"] = 44] = \"URL\";\n })(Type || (Type = {}));\n /// Data structure used to accumulate a block's content during [leaf\n /// block parsing](#BlockParser.leaf).\n class LeafBlock {\n /// @internal\n constructor(\n /// The start position of the block.\n start, \n /// The block's text content.\n content) {\n this.start = start;\n this.content = content;\n /// @internal\n this.marks = [];\n /// The block parsers active for this block.\n this.parsers = [];\n }\n }\n /// Data structure used during block-level per-line parsing.\n class Line {\n constructor() {\n /// The line's full text.\n this.text = \"\";\n /// The base indent provided by the composite contexts (that have\n /// been handled so far).\n this.baseIndent = 0;\n /// The string position corresponding to the base indent.\n this.basePos = 0;\n /// The number of contexts handled @internal\n this.depth = 0;\n /// Any markers (i.e. block quote markers) parsed for the contexts. @internal\n this.markers = [];\n /// The position of the next non-whitespace character beyond any\n /// list, blockquote, or other composite block markers.\n this.pos = 0;\n /// The column of the next non-whitespace character.\n this.indent = 0;\n /// The character code of the character after `pos`.\n this.next = -1;\n }\n /// @internal\n forward() {\n if (this.basePos > this.pos)\n this.forwardInner();\n }\n /// @internal\n forwardInner() {\n let newPos = this.skipSpace(this.basePos);\n this.indent = this.countIndent(newPos, this.pos, this.indent);\n this.pos = newPos;\n this.next = newPos == this.text.length ? -1 : this.text.charCodeAt(newPos);\n }\n /// Skip whitespace after the given position, return the position of\n /// the next non-space character or the end of the line if there's\n /// only space after `from`.\n skipSpace(from) { return skipSpace(this.text, from); }\n /// @internal\n reset(text) {\n this.text = text;\n this.baseIndent = this.basePos = this.pos = this.indent = 0;\n this.forwardInner();\n this.depth = 1;\n while (this.markers.length)\n this.markers.pop();\n }\n /// Move the line's base position forward to the given position.\n /// This should only be called by composite [block\n /// parsers](#BlockParser.parse) or [markup skipping\n /// functions](#NodeSpec.composite).\n moveBase(to) {\n this.basePos = to;\n this.baseIndent = this.countIndent(to, this.pos, this.indent);\n }\n /// Move the line's base position forward to the given _column_.\n moveBaseColumn(indent) {\n this.baseIndent = indent;\n this.basePos = this.findColumn(indent);\n }\n /// Store a composite-block-level marker. Should be called from\n /// [markup skipping functions](#NodeSpec.composite) when they\n /// consume any non-whitespace characters.\n addMarker(elt) {\n this.markers.push(elt);\n }\n /// Find the column position at `to`, optionally starting at a given\n /// position and column.\n countIndent(to, from = 0, indent = 0) {\n for (let i = from; i < to; i++)\n indent += this.text.charCodeAt(i) == 9 ? 4 - indent % 4 : 1;\n return indent;\n }\n /// Find the position corresponding to the given column.\n findColumn(goal) {\n let i = 0;\n for (let indent = 0; i < this.text.length && indent < goal; i++)\n indent += this.text.charCodeAt(i) == 9 ? 4 - indent % 4 : 1;\n return i;\n }\n /// @internal\n scrub() {\n if (!this.baseIndent)\n return this.text;\n let result = \"\";\n for (let i = 0; i < this.basePos; i++)\n result += \" \";\n return result + this.text.slice(this.basePos);\n }\n }\n function skipForList(bl, cx, line) {\n if (line.pos == line.text.length ||\n (bl != cx.block && line.indent >= cx.stack[line.depth + 1].value + line.baseIndent))\n return true;\n if (line.indent >= line.baseIndent + 4)\n return false;\n let size = (bl.type == Type.OrderedList ? isOrderedList : isBulletList)(line, cx, false);\n return size > 0 &&\n (bl.type != Type.BulletList || isHorizontalRule(line, cx, false) < 0) &&\n line.text.charCodeAt(line.pos + size - 1) == bl.value;\n }\n const DefaultSkipMarkup = {\n [Type.Blockquote](bl, cx, line) {\n if (line.next != 62 /* '>' */)\n return false;\n line.markers.push(elt(Type.QuoteMark, cx.lineStart + line.pos, cx.lineStart + line.pos + 1));\n line.moveBase(line.pos + (space$2(line.text.charCodeAt(line.pos + 1)) ? 2 : 1));\n bl.end = cx.lineStart + line.text.length;\n return true;\n },\n [Type.ListItem](bl, _cx, line) {\n if (line.indent < line.baseIndent + bl.value && line.next > -1)\n return false;\n line.moveBaseColumn(line.baseIndent + bl.value);\n return true;\n },\n [Type.OrderedList]: skipForList,\n [Type.BulletList]: skipForList,\n [Type.Document]() { return true; }\n };\n function space$2(ch) { return ch == 32 || ch == 9 || ch == 10 || ch == 13; }\n function skipSpace(line, i = 0) {\n while (i < line.length && space$2(line.charCodeAt(i)))\n i++;\n return i;\n }\n function skipSpaceBack(line, i, to) {\n while (i > to && space$2(line.charCodeAt(i - 1)))\n i--;\n return i;\n }\n function isFencedCode(line) {\n if (line.next != 96 && line.next != 126 /* '`~' */)\n return -1;\n let pos = line.pos + 1;\n while (pos < line.text.length && line.text.charCodeAt(pos) == line.next)\n pos++;\n if (pos < line.pos + 3)\n return -1;\n if (line.next == 96)\n for (let i = pos; i < line.text.length; i++)\n if (line.text.charCodeAt(i) == 96)\n return -1;\n return pos;\n }\n function isBlockquote(line) {\n return line.next != 62 /* '>' */ ? -1 : line.text.charCodeAt(line.pos + 1) == 32 ? 2 : 1;\n }\n function isHorizontalRule(line, cx, breaking) {\n if (line.next != 42 && line.next != 45 && line.next != 95 /* '_-*' */)\n return -1;\n let count = 1;\n for (let pos = line.pos + 1; pos < line.text.length; pos++) {\n let ch = line.text.charCodeAt(pos);\n if (ch == line.next)\n count++;\n else if (!space$2(ch))\n return -1;\n }\n // Setext headers take precedence\n if (breaking && line.next == 45 && isSetextUnderline(line) > -1 && line.depth == cx.stack.length)\n return -1;\n return count < 3 ? -1 : 1;\n }\n function inList(cx, type) {\n for (let i = cx.stack.length - 1; i >= 0; i--)\n if (cx.stack[i].type == type)\n return true;\n return false;\n }\n function isBulletList(line, cx, breaking) {\n return (line.next == 45 || line.next == 43 || line.next == 42 /* '-+*' */) &&\n (line.pos == line.text.length - 1 || space$2(line.text.charCodeAt(line.pos + 1))) &&\n (!breaking || inList(cx, Type.BulletList) || line.skipSpace(line.pos + 2) < line.text.length) ? 1 : -1;\n }\n function isOrderedList(line, cx, breaking) {\n let pos = line.pos, next = line.next;\n for (;;) {\n if (next >= 48 && next <= 57 /* '0-9' */)\n pos++;\n else\n break;\n if (pos == line.text.length)\n return -1;\n next = line.text.charCodeAt(pos);\n }\n if (pos == line.pos || pos > line.pos + 9 ||\n (next != 46 && next != 41 /* '.)' */) ||\n (pos < line.text.length - 1 && !space$2(line.text.charCodeAt(pos + 1))) ||\n breaking && !inList(cx, Type.OrderedList) &&\n (line.skipSpace(pos + 1) == line.text.length || pos > line.pos + 1 || line.next != 49 /* '1' */))\n return -1;\n return pos + 1 - line.pos;\n }\n function isAtxHeading(line) {\n if (line.next != 35 /* '#' */)\n return -1;\n let pos = line.pos + 1;\n while (pos < line.text.length && line.text.charCodeAt(pos) == 35)\n pos++;\n if (pos < line.text.length && line.text.charCodeAt(pos) != 32)\n return -1;\n let size = pos - line.pos;\n return size > 6 ? -1 : size;\n }\n function isSetextUnderline(line) {\n if (line.next != 45 && line.next != 61 /* '-=' */ || line.indent >= line.baseIndent + 4)\n return -1;\n let pos = line.pos + 1;\n while (pos < line.text.length && line.text.charCodeAt(pos) == line.next)\n pos++;\n let end = pos;\n while (pos < line.text.length && space$2(line.text.charCodeAt(pos)))\n pos++;\n return pos == line.text.length ? end : -1;\n }\n const EmptyLine = /^[ \\t]*$/, CommentEnd = /-->/, ProcessingEnd = /\\?>/;\n const HTMLBlockStyle = [\n [/^<(?:script|pre|style)(?:\\s|>|$)/i, /<\\/(?:script|pre|style)>/i],\n [/^\\s*<!--/, CommentEnd],\n [/^\\s*<\\?/, ProcessingEnd],\n [/^\\s*<![A-Z]/, />/],\n [/^\\s*<!\\[CDATA\\[/, /\\]\\]>/],\n [/^\\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, EmptyLine],\n [/^\\s*(?:<\\/[a-z][\\w-]*\\s*>|<[a-z][\\w-]*(\\s+[a-z:_][\\w-.]*(?:\\s*=\\s*(?:[^\\s\"'=<>`]+|'[^']*'|\"[^\"]*\"))?)*\\s*>)\\s*$/i, EmptyLine]\n ];\n function isHTMLBlock(line, _cx, breaking) {\n if (line.next != 60 /* '<' */)\n return -1;\n let rest = line.text.slice(line.pos);\n for (let i = 0, e = HTMLBlockStyle.length - (breaking ? 1 : 0); i < e; i++)\n if (HTMLBlockStyle[i][0].test(rest))\n return i;\n return -1;\n }\n function getListIndent(line, pos) {\n let indentAfter = line.countIndent(pos, line.pos, line.indent);\n let indented = line.countIndent(line.skipSpace(pos), pos, indentAfter);\n return indented >= indentAfter + 5 ? indentAfter + 1 : indented;\n }\n function addCodeText(marks, from, to) {\n let last = marks.length - 1;\n if (last >= 0 && marks[last].to == from && marks[last].type == Type.CodeText)\n marks[last].to = to;\n else\n marks.push(elt(Type.CodeText, from, to));\n }\n // Rules for parsing blocks. A return value of false means the rule\n // doesn't apply here, true means it does. When true is returned and\n // `p.line` has been updated, the rule is assumed to have consumed a\n // leaf block. Otherwise, it is assumed to have opened a context.\n const DefaultBlockParsers = {\n LinkReference: undefined,\n IndentedCode(cx, line) {\n let base = line.baseIndent + 4;\n if (line.indent < base)\n return false;\n let start = line.findColumn(base);\n let from = cx.lineStart + start, to = cx.lineStart + line.text.length;\n let marks = [], pendingMarks = [];\n addCodeText(marks, from, to);\n while (cx.nextLine() && line.depth >= cx.stack.length) {\n if (line.pos == line.text.length) { // Empty\n addCodeText(pendingMarks, cx.lineStart - 1, cx.lineStart);\n for (let m of line.markers)\n pendingMarks.push(m);\n }\n else if (line.indent < base) {\n break;\n }\n else {\n if (pendingMarks.length) {\n for (let m of pendingMarks) {\n if (m.type == Type.CodeText)\n addCodeText(marks, m.from, m.to);\n else\n marks.push(m);\n }\n pendingMarks = [];\n }\n addCodeText(marks, cx.lineStart - 1, cx.lineStart);\n for (let m of line.markers)\n marks.push(m);\n to = cx.lineStart + line.text.length;\n let codeStart = cx.lineStart + line.findColumn(line.baseIndent + 4);\n if (codeStart < to)\n addCodeText(marks, codeStart, to);\n }\n }\n if (pendingMarks.length) {\n pendingMarks = pendingMarks.filter(m => m.type != Type.CodeText);\n if (pendingMarks.length)\n line.markers = pendingMarks.concat(line.markers);\n }\n cx.addNode(cx.buffer.writeElements(marks, -from).finish(Type.CodeBlock, to - from), from);\n return true;\n },\n FencedCode(cx, line) {\n let fenceEnd = isFencedCode(line);\n if (fenceEnd < 0)\n return false;\n let from = cx.lineStart + line.pos, ch = line.next, len = fenceEnd - line.pos;\n let infoFrom = line.skipSpace(fenceEnd), infoTo = skipSpaceBack(line.text, line.text.length, infoFrom);\n let marks = [elt(Type.CodeMark, from, from + len)];\n if (infoFrom < infoTo)\n marks.push(elt(Type.CodeInfo, cx.lineStart + infoFrom, cx.lineStart + infoTo));\n for (let first = true; cx.nextLine() && line.depth >= cx.stack.length; first = false) {\n let i = line.pos;\n if (line.indent - line.baseIndent < 4)\n while (i < line.text.length && line.text.charCodeAt(i) == ch)\n i++;\n if (i - line.pos >= len && line.skipSpace(i) == line.text.length) {\n for (let m of line.markers)\n marks.push(m);\n marks.push(elt(Type.CodeMark, cx.lineStart + line.pos, cx.lineStart + i));\n cx.nextLine();\n break;\n }\n else {\n if (!first)\n addCodeText(marks, cx.lineStart - 1, cx.lineStart);\n for (let m of line.markers)\n marks.push(m);\n let textStart = cx.lineStart + line.basePos, textEnd = cx.lineStart + line.text.length;\n if (textStart < textEnd)\n addCodeText(marks, textStart, textEnd);\n }\n }\n cx.addNode(cx.buffer.writeElements(marks, -from)\n .finish(Type.FencedCode, cx.prevLineEnd() - from), from);\n return true;\n },\n Blockquote(cx, line) {\n let size = isBlockquote(line);\n if (size < 0)\n return false;\n cx.startContext(Type.Blockquote, line.pos);\n cx.addNode(Type.QuoteMark, cx.lineStart + line.pos, cx.lineStart + line.pos + 1);\n line.moveBase(line.pos + size);\n return null;\n },\n HorizontalRule(cx, line) {\n if (isHorizontalRule(line, cx, false) < 0)\n return false;\n let from = cx.lineStart + line.pos;\n cx.nextLine();\n cx.addNode(Type.HorizontalRule, from);\n return true;\n },\n BulletList(cx, line) {\n let size = isBulletList(line, cx, false);\n if (size < 0)\n return false;\n if (cx.block.type != Type.BulletList)\n cx.startContext(Type.BulletList, line.basePos, line.next);\n let newBase = getListIndent(line, line.pos + 1);\n cx.startContext(Type.ListItem, line.basePos, newBase - line.baseIndent);\n cx.addNode(Type.ListMark, cx.lineStart + line.pos, cx.lineStart + line.pos + size);\n line.moveBaseColumn(newBase);\n return null;\n },\n OrderedList(cx, line) {\n let size = isOrderedList(line, cx, false);\n if (size < 0)\n return false;\n if (cx.block.type != Type.OrderedList)\n cx.startContext(Type.OrderedList, line.basePos, line.text.charCodeAt(line.pos + size - 1));\n let newBase = getListIndent(line, line.pos + size);\n cx.startContext(Type.ListItem, line.basePos, newBase - line.baseIndent);\n cx.addNode(Type.ListMark, cx.lineStart + line.pos, cx.lineStart + line.pos + size);\n line.moveBaseColumn(newBase);\n return null;\n },\n ATXHeading(cx, line) {\n let size = isAtxHeading(line);\n if (size < 0)\n return false;\n let off = line.pos, from = cx.lineStart + off;\n let endOfSpace = skipSpaceBack(line.text, line.text.length, off), after = endOfSpace;\n while (after > off && line.text.charCodeAt(after - 1) == line.next)\n after--;\n if (after == endOfSpace || after == off || !space$2(line.text.charCodeAt(after - 1)))\n after = line.text.length;\n let buf = cx.buffer\n .write(Type.HeaderMark, 0, size)\n .writeElements(cx.parser.parseInline(line.text.slice(off + size + 1, after), from + size + 1), -from);\n if (after < line.text.length)\n buf.write(Type.HeaderMark, after - off, endOfSpace - off);\n let node = buf.finish(Type.ATXHeading1 - 1 + size, line.text.length - off);\n cx.nextLine();\n cx.addNode(node, from);\n return true;\n },\n HTMLBlock(cx, line) {\n let type = isHTMLBlock(line, cx, false);\n if (type < 0)\n return false;\n let from = cx.lineStart + line.pos, end = HTMLBlockStyle[type][1];\n let marks = [], trailing = end != EmptyLine;\n while (!end.test(line.text) && cx.nextLine()) {\n if (line.depth < cx.stack.length) {\n trailing = false;\n break;\n }\n for (let m of line.markers)\n marks.push(m);\n }\n if (trailing)\n cx.nextLine();\n let nodeType = end == CommentEnd ? Type.CommentBlock : end == ProcessingEnd ? Type.ProcessingInstructionBlock : Type.HTMLBlock;\n let to = cx.prevLineEnd();\n cx.addNode(cx.buffer.writeElements(marks, -from).finish(nodeType, to - from), from);\n return true;\n },\n SetextHeading: undefined // Specifies relative precedence for block-continue function\n };\n // This implements a state machine that incrementally parses link references. At each\n // next line, it looks ahead to see if the line continues the reference or not. If it\n // doesn't and a valid link is available ending before that line, it finishes that.\n // Similarly, on `finish` (when the leaf is terminated by external circumstances), it\n // creates a link reference if there's a valid reference up to the current point.\n class LinkReferenceParser {\n constructor(leaf) {\n this.stage = 0 /* RefStage.Start */;\n this.elts = [];\n this.pos = 0;\n this.start = leaf.start;\n this.advance(leaf.content);\n }\n nextLine(cx, line, leaf) {\n if (this.stage == -1 /* RefStage.Failed */)\n return false;\n let content = leaf.content + \"\\n\" + line.scrub();\n let finish = this.advance(content);\n if (finish > -1 && finish < content.length)\n return this.complete(cx, leaf, finish);\n return false;\n }\n finish(cx, leaf) {\n if ((this.stage == 2 /* RefStage.Link */ || this.stage == 3 /* RefStage.Title */) && skipSpace(leaf.content, this.pos) == leaf.content.length)\n return this.complete(cx, leaf, leaf.content.length);\n return false;\n }\n complete(cx, leaf, len) {\n cx.addLeafElement(leaf, elt(Type.LinkReference, this.start, this.start + len, this.elts));\n return true;\n }\n nextStage(elt) {\n if (elt) {\n this.pos = elt.to - this.start;\n this.elts.push(elt);\n this.stage++;\n return true;\n }\n if (elt === false)\n this.stage = -1 /* RefStage.Failed */;\n return false;\n }\n advance(content) {\n for (;;) {\n if (this.stage == -1 /* RefStage.Failed */) {\n return -1;\n }\n else if (this.stage == 0 /* RefStage.Start */) {\n if (!this.nextStage(parseLinkLabel(content, this.pos, this.start, true)))\n return -1;\n if (content.charCodeAt(this.pos) != 58 /* ':' */)\n return this.stage = -1 /* RefStage.Failed */;\n this.elts.push(elt(Type.LinkMark, this.pos + this.start, this.pos + this.start + 1));\n this.pos++;\n }\n else if (this.stage == 1 /* RefStage.Label */) {\n if (!this.nextStage(parseURL(content, skipSpace(content, this.pos), this.start)))\n return -1;\n }\n else if (this.stage == 2 /* RefStage.Link */) {\n let skip = skipSpace(content, this.pos), end = 0;\n if (skip > this.pos) {\n let title = parseLinkTitle(content, skip, this.start);\n if (title) {\n let titleEnd = lineEnd(content, title.to - this.start);\n if (titleEnd > 0) {\n this.nextStage(title);\n end = titleEnd;\n }\n }\n }\n if (!end)\n end = lineEnd(content, this.pos);\n return end > 0 && end < content.length ? end : -1;\n }\n else { // RefStage.Title\n return lineEnd(content, this.pos);\n }\n }\n }\n }\n function lineEnd(text, pos) {\n for (; pos < text.length; pos++) {\n let next = text.charCodeAt(pos);\n if (next == 10)\n break;\n if (!space$2(next))\n return -1;\n }\n return pos;\n }\n class SetextHeadingParser {\n nextLine(cx, line, leaf) {\n let underline = line.depth < cx.stack.length ? -1 : isSetextUnderline(line);\n let next = line.next;\n if (underline < 0)\n return false;\n let underlineMark = elt(Type.HeaderMark, cx.lineStart + line.pos, cx.lineStart + underline);\n cx.nextLine();\n cx.addLeafElement(leaf, elt(next == 61 ? Type.SetextHeading1 : Type.SetextHeading2, leaf.start, cx.prevLineEnd(), [\n ...cx.parser.parseInline(leaf.content, leaf.start),\n underlineMark\n ]));\n return true;\n }\n finish() {\n return false;\n }\n }\n const DefaultLeafBlocks = {\n LinkReference(_, leaf) { return leaf.content.charCodeAt(0) == 91 /* '[' */ ? new LinkReferenceParser(leaf) : null; },\n SetextHeading() { return new SetextHeadingParser; }\n };\n const DefaultEndLeaf = [\n (_, line) => isAtxHeading(line) >= 0,\n (_, line) => isFencedCode(line) >= 0,\n (_, line) => isBlockquote(line) >= 0,\n (p, line) => isBulletList(line, p, true) >= 0,\n (p, line) => isOrderedList(line, p, true) >= 0,\n (p, line) => isHorizontalRule(line, p, true) >= 0,\n (p, line) => isHTMLBlock(line, p, true) >= 0\n ];\n const scanLineResult = { text: \"\", end: 0 };\n /// Block-level parsing functions get access to this context object.\n class BlockContext {\n /// @internal\n constructor(\n /// The parser configuration used.\n parser, \n /// @internal\n input, fragments, \n /// @internal\n ranges) {\n this.parser = parser;\n this.input = input;\n this.ranges = ranges;\n this.line = new Line();\n this.atEnd = false;\n /// For reused nodes on gaps, we can't directly put the original\n /// node into the tree, since that may be bitter than its parent.\n /// When this happens, we create a dummy tree that is replaced by\n /// the proper node in `injectGaps` @internal\n this.reusePlaceholders = new Map;\n this.stoppedAt = null;\n /// The range index that absoluteLineStart points into @internal\n this.rangeI = 0;\n this.to = ranges[ranges.length - 1].to;\n this.lineStart = this.absoluteLineStart = this.absoluteLineEnd = ranges[0].from;\n this.block = CompositeBlock.create(Type.Document, 0, this.lineStart, 0, 0);\n this.stack = [this.block];\n this.fragments = fragments.length ? new FragmentCursor$1(fragments, input) : null;\n this.readLine();\n }\n get parsedPos() {\n return this.absoluteLineStart;\n }\n advance() {\n if (this.stoppedAt != null && this.absoluteLineStart > this.stoppedAt)\n return this.finish();\n let { line } = this;\n for (;;) {\n for (let markI = 0;;) {\n let next = line.depth < this.stack.length ? this.stack[this.stack.length - 1] : null;\n while (markI < line.markers.length && (!next || line.markers[markI].from < next.end)) {\n let mark = line.markers[markI++];\n this.addNode(mark.type, mark.from, mark.to);\n }\n if (!next)\n break;\n this.finishContext();\n }\n if (line.pos < line.text.length)\n break;\n // Empty line\n if (!this.nextLine())\n return this.finish();\n }\n if (this.fragments && this.reuseFragment(line.basePos))\n return null;\n start: for (;;) {\n for (let type of this.parser.blockParsers)\n if (type) {\n let result = type(this, line);\n if (result != false) {\n if (result == true)\n return null;\n line.forward();\n continue start;\n }\n }\n break;\n }\n let leaf = new LeafBlock(this.lineStart + line.pos, line.text.slice(line.pos));\n for (let parse of this.parser.leafBlockParsers)\n if (parse) {\n let parser = parse(this, leaf);\n if (parser)\n leaf.parsers.push(parser);\n }\n lines: while (this.nextLine()) {\n if (line.pos == line.text.length)\n break;\n if (line.indent < line.baseIndent + 4) {\n for (let stop of this.parser.endLeafBlock)\n if (stop(this, line, leaf))\n break lines;\n }\n for (let parser of leaf.parsers)\n if (parser.nextLine(this, line, leaf))\n return null;\n leaf.content += \"\\n\" + line.scrub();\n for (let m of line.markers)\n leaf.marks.push(m);\n }\n this.finishLeaf(leaf);\n return null;\n }\n stopAt(pos) {\n if (this.stoppedAt != null && this.stoppedAt < pos)\n throw new RangeError(\"Can't move stoppedAt forward\");\n this.stoppedAt = pos;\n }\n reuseFragment(start) {\n if (!this.fragments.moveTo(this.absoluteLineStart + start, this.absoluteLineStart) ||\n !this.fragments.matches(this.block.hash))\n return false;\n let taken = this.fragments.takeNodes(this);\n if (!taken)\n return false;\n this.absoluteLineStart += taken;\n this.lineStart = toRelative(this.absoluteLineStart, this.ranges);\n this.moveRangeI();\n if (this.absoluteLineStart < this.to) {\n this.lineStart++;\n this.absoluteLineStart++;\n this.readLine();\n }\n else {\n this.atEnd = true;\n this.readLine();\n }\n return true;\n }\n /// The number of parent blocks surrounding the current block.\n get depth() {\n return this.stack.length;\n }\n /// Get the type of the parent block at the given depth. When no\n /// depth is passed, return the type of the innermost parent.\n parentType(depth = this.depth - 1) {\n return this.parser.nodeSet.types[this.stack[depth].type];\n }\n /// Move to the next input line. This should only be called by\n /// (non-composite) [block parsers](#BlockParser.parse) that consume\n /// the line directly, or leaf block parser\n /// [`nextLine`](#LeafBlockParser.nextLine) methods when they\n /// consume the current line (and return true).\n nextLine() {\n this.lineStart += this.line.text.length;\n if (this.absoluteLineEnd >= this.to) {\n this.absoluteLineStart = this.absoluteLineEnd;\n this.atEnd = true;\n this.readLine();\n return false;\n }\n else {\n this.lineStart++;\n this.absoluteLineStart = this.absoluteLineEnd + 1;\n this.moveRangeI();\n this.readLine();\n return true;\n }\n }\n moveRangeI() {\n while (this.rangeI < this.ranges.length - 1 && this.absoluteLineStart >= this.ranges[this.rangeI].to) {\n this.rangeI++;\n this.absoluteLineStart = Math.max(this.absoluteLineStart, this.ranges[this.rangeI].from);\n }\n }\n /// @internal\n scanLine(start) {\n let r = scanLineResult;\n r.end = start;\n if (start >= this.to) {\n r.text = \"\";\n }\n else {\n r.text = this.lineChunkAt(start);\n r.end += r.text.length;\n if (this.ranges.length > 1) {\n let textOffset = this.absoluteLineStart, rangeI = this.rangeI;\n while (this.ranges[rangeI].to < r.end) {\n rangeI++;\n let nextFrom = this.ranges[rangeI].from;\n let after = this.lineChunkAt(nextFrom);\n r.end = nextFrom + after.length;\n r.text = r.text.slice(0, this.ranges[rangeI - 1].to - textOffset) + after;\n textOffset = r.end - r.text.length;\n }\n }\n }\n return r;\n }\n /// @internal\n readLine() {\n let { line } = this, { text, end } = this.scanLine(this.absoluteLineStart);\n this.absoluteLineEnd = end;\n line.reset(text);\n for (; line.depth < this.stack.length; line.depth++) {\n let cx = this.stack[line.depth], handler = this.parser.skipContextMarkup[cx.type];\n if (!handler)\n throw new Error(\"Unhandled block context \" + Type[cx.type]);\n if (!handler(cx, this, line))\n break;\n line.forward();\n }\n }\n lineChunkAt(pos) {\n let next = this.input.chunk(pos), text;\n if (!this.input.lineChunks) {\n let eol = next.indexOf(\"\\n\");\n text = eol < 0 ? next : next.slice(0, eol);\n }\n else {\n text = next == \"\\n\" ? \"\" : next;\n }\n return pos + text.length > this.to ? text.slice(0, this.to - pos) : text;\n }\n /// The end position of the previous line.\n prevLineEnd() { return this.atEnd ? this.lineStart : this.lineStart - 1; }\n /// @internal\n startContext(type, start, value = 0) {\n this.block = CompositeBlock.create(type, value, this.lineStart + start, this.block.hash, this.lineStart + this.line.text.length);\n this.stack.push(this.block);\n }\n /// Start a composite block. Should only be called from [block\n /// parser functions](#BlockParser.parse) that return null.\n startComposite(type, start, value = 0) {\n this.startContext(this.parser.getNodeType(type), start, value);\n }\n /// @internal\n addNode(block, from, to) {\n if (typeof block == \"number\")\n block = new Tree(this.parser.nodeSet.types[block], none, none, (to !== null && to !== void 0 ? to : this.prevLineEnd()) - from);\n this.block.addChild(block, from - this.block.from);\n }\n /// Add a block element. Can be called by [block\n /// parsers](#BlockParser.parse).\n addElement(elt) {\n this.block.addChild(elt.toTree(this.parser.nodeSet), elt.from - this.block.from);\n }\n /// Add a block element from a [leaf parser](#LeafBlockParser). This\n /// makes sure any extra composite block markup (such as blockquote\n /// markers) inside the block are also added to the syntax tree.\n addLeafElement(leaf, elt) {\n this.addNode(this.buffer\n .writeElements(injectMarks(elt.children, leaf.marks), -elt.from)\n .finish(elt.type, elt.to - elt.from), elt.from);\n }\n /// @internal\n finishContext() {\n let cx = this.stack.pop();\n let top = this.stack[this.stack.length - 1];\n top.addChild(cx.toTree(this.parser.nodeSet), cx.from - top.from);\n this.block = top;\n }\n finish() {\n while (this.stack.length > 1)\n this.finishContext();\n return this.addGaps(this.block.toTree(this.parser.nodeSet, this.lineStart));\n }\n addGaps(tree) {\n return this.ranges.length > 1 ?\n injectGaps(this.ranges, 0, tree.topNode, this.ranges[0].from, this.reusePlaceholders) : tree;\n }\n /// @internal\n finishLeaf(leaf) {\n for (let parser of leaf.parsers)\n if (parser.finish(this, leaf))\n return;\n let inline = injectMarks(this.parser.parseInline(leaf.content, leaf.start), leaf.marks);\n this.addNode(this.buffer\n .writeElements(inline, -leaf.start)\n .finish(Type.Paragraph, leaf.content.length), leaf.start);\n }\n elt(type, from, to, children) {\n if (typeof type == \"string\")\n return elt(this.parser.getNodeType(type), from, to, children);\n return new TreeElement(type, from);\n }\n /// @internal\n get buffer() { return new Buffer(this.parser.nodeSet); }\n }\n function injectGaps(ranges, rangeI, tree, offset, dummies) {\n let rangeEnd = ranges[rangeI].to;\n let children = [], positions = [], start = tree.from + offset;\n function movePastNext(upto, inclusive) {\n while (inclusive ? upto >= rangeEnd : upto > rangeEnd) {\n let size = ranges[rangeI + 1].from - rangeEnd;\n offset += size;\n upto += size;\n rangeI++;\n rangeEnd = ranges[rangeI].to;\n }\n }\n for (let ch = tree.firstChild; ch; ch = ch.nextSibling) {\n movePastNext(ch.from + offset, true);\n let from = ch.from + offset, node, reuse = dummies.get(ch.tree);\n if (reuse) {\n node = reuse;\n }\n else if (ch.to + offset > rangeEnd) {\n node = injectGaps(ranges, rangeI, ch, offset, dummies);\n movePastNext(ch.to + offset, false);\n }\n else {\n node = ch.toTree();\n }\n children.push(node);\n positions.push(from - start);\n }\n movePastNext(tree.to + offset, false);\n return new Tree(tree.type, children, positions, tree.to + offset - start, tree.tree ? tree.tree.propValues : undefined);\n }\n /// A Markdown parser configuration.\n class MarkdownParser extends Parser {\n /// @internal\n constructor(\n /// The parser's syntax [node\n /// types](https://lezer.codemirror.net/docs/ref/#common.NodeSet).\n nodeSet, \n /// @internal\n blockParsers, \n /// @internal\n leafBlockParsers, \n /// @internal\n blockNames, \n /// @internal\n endLeafBlock, \n /// @internal\n skipContextMarkup, \n /// @internal\n inlineParsers, \n /// @internal\n inlineNames, \n /// @internal\n wrappers) {\n super();\n this.nodeSet = nodeSet;\n this.blockParsers = blockParsers;\n this.leafBlockParsers = leafBlockParsers;\n this.blockNames = blockNames;\n this.endLeafBlock = endLeafBlock;\n this.skipContextMarkup = skipContextMarkup;\n this.inlineParsers = inlineParsers;\n this.inlineNames = inlineNames;\n this.wrappers = wrappers;\n /// @internal\n this.nodeTypes = Object.create(null);\n for (let t of nodeSet.types)\n this.nodeTypes[t.name] = t.id;\n }\n createParse(input, fragments, ranges) {\n let parse = new BlockContext(this, input, fragments, ranges);\n for (let w of this.wrappers)\n parse = w(parse, input, fragments, ranges);\n return parse;\n }\n /// Reconfigure the parser.\n configure(spec) {\n let config = resolveConfig$1(spec);\n if (!config)\n return this;\n let { nodeSet, skipContextMarkup } = this;\n let blockParsers = this.blockParsers.slice(), leafBlockParsers = this.leafBlockParsers.slice(), blockNames = this.blockNames.slice(), inlineParsers = this.inlineParsers.slice(), inlineNames = this.inlineNames.slice(), endLeafBlock = this.endLeafBlock.slice(), wrappers = this.wrappers;\n if (nonEmpty(config.defineNodes)) {\n skipContextMarkup = Object.assign({}, skipContextMarkup);\n let nodeTypes = nodeSet.types.slice(), styles;\n for (let s of config.defineNodes) {\n let { name, block, composite, style } = typeof s == \"string\" ? { name: s } : s;\n if (nodeTypes.some(t => t.name == name))\n continue;\n if (composite)\n skipContextMarkup[nodeTypes.length] =\n (bl, cx, line) => composite(cx, line, bl.value);\n let id = nodeTypes.length;\n let group = composite ? [\"Block\", \"BlockContext\"] : !block ? undefined\n : id >= Type.ATXHeading1 && id <= Type.SetextHeading2 ? [\"Block\", \"LeafBlock\", \"Heading\"] : [\"Block\", \"LeafBlock\"];\n nodeTypes.push(NodeType.define({\n id,\n name,\n props: group && [[NodeProp.group, group]]\n }));\n if (style) {\n if (!styles)\n styles = {};\n if (Array.isArray(style) || style instanceof Tag)\n styles[name] = style;\n else\n Object.assign(styles, style);\n }\n }\n nodeSet = new NodeSet(nodeTypes);\n if (styles)\n nodeSet = nodeSet.extend(styleTags(styles));\n }\n if (nonEmpty(config.props))\n nodeSet = nodeSet.extend(...config.props);\n if (nonEmpty(config.remove)) {\n for (let rm of config.remove) {\n let block = this.blockNames.indexOf(rm), inline = this.inlineNames.indexOf(rm);\n if (block > -1)\n blockParsers[block] = leafBlockParsers[block] = undefined;\n if (inline > -1)\n inlineParsers[inline] = undefined;\n }\n }\n if (nonEmpty(config.parseBlock)) {\n for (let spec of config.parseBlock) {\n let found = blockNames.indexOf(spec.name);\n if (found > -1) {\n blockParsers[found] = spec.parse;\n leafBlockParsers[found] = spec.leaf;\n }\n else {\n let pos = spec.before ? findName(blockNames, spec.before)\n : spec.after ? findName(blockNames, spec.after) + 1 : blockNames.length - 1;\n blockParsers.splice(pos, 0, spec.parse);\n leafBlockParsers.splice(pos, 0, spec.leaf);\n blockNames.splice(pos, 0, spec.name);\n }\n if (spec.endLeaf)\n endLeafBlock.push(spec.endLeaf);\n }\n }\n if (nonEmpty(config.parseInline)) {\n for (let spec of config.parseInline) {\n let found = inlineNames.indexOf(spec.name);\n if (found > -1) {\n inlineParsers[found] = spec.parse;\n }\n else {\n let pos = spec.before ? findName(inlineNames, spec.before)\n : spec.after ? findName(inlineNames, spec.after) + 1 : inlineNames.length - 1;\n inlineParsers.splice(pos, 0, spec.parse);\n inlineNames.splice(pos, 0, spec.name);\n }\n }\n }\n if (config.wrap)\n wrappers = wrappers.concat(config.wrap);\n return new MarkdownParser(nodeSet, blockParsers, leafBlockParsers, blockNames, endLeafBlock, skipContextMarkup, inlineParsers, inlineNames, wrappers);\n }\n /// @internal\n getNodeType(name) {\n let found = this.nodeTypes[name];\n if (found == null)\n throw new RangeError(`Unknown node type '${name}'`);\n return found;\n }\n /// Parse the given piece of inline text at the given offset,\n /// returning an array of [`Element`](#Element) objects representing\n /// the inline content.\n parseInline(text, offset) {\n let cx = new InlineContext(this, text, offset);\n outer: for (let pos = offset; pos < cx.end;) {\n let next = cx.char(pos);\n for (let token of this.inlineParsers)\n if (token) {\n let result = token(cx, next, pos);\n if (result >= 0) {\n pos = result;\n continue outer;\n }\n }\n pos++;\n }\n return cx.resolveMarkers(0);\n }\n }\n function nonEmpty(a) {\n return a != null && a.length > 0;\n }\n function resolveConfig$1(spec) {\n if (!Array.isArray(spec))\n return spec;\n if (spec.length == 0)\n return null;\n let conf = resolveConfig$1(spec[0]);\n if (spec.length == 1)\n return conf;\n let rest = resolveConfig$1(spec.slice(1));\n if (!rest || !conf)\n return conf || rest;\n let conc = (a, b) => (a || none).concat(b || none);\n let wrapA = conf.wrap, wrapB = rest.wrap;\n return {\n props: conc(conf.props, rest.props),\n defineNodes: conc(conf.defineNodes, rest.defineNodes),\n parseBlock: conc(conf.parseBlock, rest.parseBlock),\n parseInline: conc(conf.parseInline, rest.parseInline),\n remove: conc(conf.remove, rest.remove),\n wrap: !wrapA ? wrapB : !wrapB ? wrapA :\n (inner, input, fragments, ranges) => wrapA(wrapB(inner, input, fragments, ranges), input, fragments, ranges)\n };\n }\n function findName(names, name) {\n let found = names.indexOf(name);\n if (found < 0)\n throw new RangeError(`Position specified relative to unknown parser ${name}`);\n return found;\n }\n let nodeTypes = [NodeType.none];\n for (let i = 1, name; name = Type[i]; i++) {\n nodeTypes[i] = NodeType.define({\n id: i,\n name,\n props: i >= Type.Escape ? [] : [[NodeProp.group, i in DefaultSkipMarkup ? [\"Block\", \"BlockContext\"] : [\"Block\", \"LeafBlock\"]]],\n top: name == \"Document\"\n });\n }\n const none = [];\n class Buffer {\n constructor(nodeSet) {\n this.nodeSet = nodeSet;\n this.content = [];\n this.nodes = [];\n }\n write(type, from, to, children = 0) {\n this.content.push(type, from, to, 4 + children * 4);\n return this;\n }\n writeElements(elts, offset = 0) {\n for (let e of elts)\n e.writeTo(this, offset);\n return this;\n }\n finish(type, length) {\n return Tree.build({\n buffer: this.content,\n nodeSet: this.nodeSet,\n reused: this.nodes,\n topID: type,\n length\n });\n }\n }\n /// Elements are used to compose syntax nodes during parsing.\n class Element$1 {\n /// @internal\n constructor(\n /// The node's\n /// [id](https://lezer.codemirror.net/docs/ref/#common.NodeType.id).\n type, \n /// The start of the node, as an offset from the start of the document.\n from, \n /// The end of the node.\n to, \n /// The node's child nodes @internal\n children = none) {\n this.type = type;\n this.from = from;\n this.to = to;\n this.children = children;\n }\n /// @internal\n writeTo(buf, offset) {\n let startOff = buf.content.length;\n buf.writeElements(this.children, offset);\n buf.content.push(this.type, this.from + offset, this.to + offset, buf.content.length + 4 - startOff);\n }\n /// @internal\n toTree(nodeSet) {\n return new Buffer(nodeSet).writeElements(this.children, -this.from).finish(this.type, this.to - this.from);\n }\n }\n class TreeElement {\n constructor(tree, from) {\n this.tree = tree;\n this.from = from;\n }\n get to() { return this.from + this.tree.length; }\n get type() { return this.tree.type.id; }\n get children() { return none; }\n writeTo(buf, offset) {\n buf.nodes.push(this.tree);\n buf.content.push(buf.nodes.length - 1, this.from + offset, this.to + offset, -1);\n }\n toTree() { return this.tree; }\n }\n function elt(type, from, to, children) {\n return new Element$1(type, from, to, children);\n }\n const EmphasisUnderscore = { resolve: \"Emphasis\", mark: \"EmphasisMark\" };\n const EmphasisAsterisk = { resolve: \"Emphasis\", mark: \"EmphasisMark\" };\n const LinkStart = {}, ImageStart = {};\n class InlineDelimiter {\n constructor(type, from, to, side) {\n this.type = type;\n this.from = from;\n this.to = to;\n this.side = side;\n }\n }\n const Escapable = \"!\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\";\n let Punctuation = /[!\"#$%&'()*+,\\-.\\/:;<=>?@\\[\\\\\\]^_`{|}~\\xA1\\u2010-\\u2027]/;\n try {\n Punctuation = new RegExp(\"[\\\\p{Pc}|\\\\p{Pd}|\\\\p{Pe}|\\\\p{Pf}|\\\\p{Pi}|\\\\p{Po}|\\\\p{Ps}]\", \"u\");\n }\n catch (_) { }\n const DefaultInline = {\n Escape(cx, next, start) {\n if (next != 92 /* '\\\\' */ || start == cx.end - 1)\n return -1;\n let escaped = cx.char(start + 1);\n for (let i = 0; i < Escapable.length; i++)\n if (Escapable.charCodeAt(i) == escaped)\n return cx.append(elt(Type.Escape, start, start + 2));\n return -1;\n },\n Entity(cx, next, start) {\n if (next != 38 /* '&' */)\n return -1;\n let m = /^(?:#\\d+|#x[a-f\\d]+|\\w+);/i.exec(cx.slice(start + 1, start + 31));\n return m ? cx.append(elt(Type.Entity, start, start + 1 + m[0].length)) : -1;\n },\n InlineCode(cx, next, start) {\n if (next != 96 /* '`' */ || start && cx.char(start - 1) == 96)\n return -1;\n let pos = start + 1;\n while (pos < cx.end && cx.char(pos) == 96)\n pos++;\n let size = pos - start, curSize = 0;\n for (; pos < cx.end; pos++) {\n if (cx.char(pos) == 96) {\n curSize++;\n if (curSize == size && cx.char(pos + 1) != 96)\n return cx.append(elt(Type.InlineCode, start, pos + 1, [\n elt(Type.CodeMark, start, start + size),\n elt(Type.CodeMark, pos + 1 - size, pos + 1)\n ]));\n }\n else {\n curSize = 0;\n }\n }\n return -1;\n },\n HTMLTag(cx, next, start) {\n if (next != 60 /* '<' */ || start == cx.end - 1)\n return -1;\n let after = cx.slice(start + 1, cx.end);\n let url = /^(?:[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(after);\n if (url) {\n return cx.append(elt(Type.Autolink, start, start + 1 + url[0].length, [\n elt(Type.LinkMark, start, start + 1),\n // url[0] includes the closing bracket, so exclude it from this slice\n elt(Type.URL, start + 1, start + url[0].length),\n elt(Type.LinkMark, start + url[0].length, start + 1 + url[0].length)\n ]));\n }\n let comment = /^!--[^>](?:-[^-]|[^-])*?-->/i.exec(after);\n if (comment)\n return cx.append(elt(Type.Comment, start, start + 1 + comment[0].length));\n let procInst = /^\\?[^]*?\\?>/.exec(after);\n if (procInst)\n return cx.append(elt(Type.ProcessingInstruction, start, start + 1 + procInst[0].length));\n let m = /^(?:![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(after);\n if (!m)\n return -1;\n return cx.append(elt(Type.HTMLTag, start, start + 1 + m[0].length));\n },\n Emphasis(cx, next, start) {\n if (next != 95 && next != 42)\n return -1;\n let pos = start + 1;\n while (cx.char(pos) == next)\n pos++;\n let before = cx.slice(start - 1, start), after = cx.slice(pos, pos + 1);\n let pBefore = Punctuation.test(before), pAfter = Punctuation.test(after);\n let sBefore = /\\s|^$/.test(before), sAfter = /\\s|^$/.test(after);\n let leftFlanking = !sAfter && (!pAfter || sBefore || pBefore);\n let rightFlanking = !sBefore && (!pBefore || sAfter || pAfter);\n let canOpen = leftFlanking && (next == 42 || !rightFlanking || pBefore);\n let canClose = rightFlanking && (next == 42 || !leftFlanking || pAfter);\n return cx.append(new InlineDelimiter(next == 95 ? EmphasisUnderscore : EmphasisAsterisk, start, pos, (canOpen ? 1 /* Mark.Open */ : 0 /* Mark.None */) | (canClose ? 2 /* Mark.Close */ : 0 /* Mark.None */)));\n },\n HardBreak(cx, next, start) {\n if (next == 92 /* '\\\\' */ && cx.char(start + 1) == 10 /* '\\n' */)\n return cx.append(elt(Type.HardBreak, start, start + 2));\n if (next == 32) {\n let pos = start + 1;\n while (cx.char(pos) == 32)\n pos++;\n if (cx.char(pos) == 10 && pos >= start + 2)\n return cx.append(elt(Type.HardBreak, start, pos + 1));\n }\n return -1;\n },\n Link(cx, next, start) {\n return next == 91 /* '[' */ ? cx.append(new InlineDelimiter(LinkStart, start, start + 1, 1 /* Mark.Open */)) : -1;\n },\n Image(cx, next, start) {\n return next == 33 /* '!' */ && cx.char(start + 1) == 91 /* '[' */\n ? cx.append(new InlineDelimiter(ImageStart, start, start + 2, 1 /* Mark.Open */)) : -1;\n },\n LinkEnd(cx, next, start) {\n if (next != 93 /* ']' */)\n return -1;\n // Scanning back to the next link/image start marker\n for (let i = cx.parts.length - 1; i >= 0; i--) {\n let part = cx.parts[i];\n if (part instanceof InlineDelimiter && (part.type == LinkStart || part.type == ImageStart)) {\n // If this one has been set invalid (because it would produce\n // a nested link) or there's no valid link here ignore both.\n if (!part.side || cx.skipSpace(part.to) == start && !/[(\\[]/.test(cx.slice(start + 1, start + 2))) {\n cx.parts[i] = null;\n return -1;\n }\n // Finish the content and replace the entire range in\n // this.parts with the link/image node.\n let content = cx.takeContent(i);\n let link = cx.parts[i] = finishLink(cx, content, part.type == LinkStart ? Type.Link : Type.Image, part.from, start + 1);\n // Set any open-link markers before this link to invalid.\n if (part.type == LinkStart)\n for (let j = 0; j < i; j++) {\n let p = cx.parts[j];\n if (p instanceof InlineDelimiter && p.type == LinkStart)\n p.side = 0 /* Mark.None */;\n }\n return link.to;\n }\n }\n return -1;\n }\n };\n function finishLink(cx, content, type, start, startPos) {\n let { text } = cx, next = cx.char(startPos), endPos = startPos;\n content.unshift(elt(Type.LinkMark, start, start + (type == Type.Image ? 2 : 1)));\n content.push(elt(Type.LinkMark, startPos - 1, startPos));\n if (next == 40 /* '(' */) {\n let pos = cx.skipSpace(startPos + 1);\n let dest = parseURL(text, pos - cx.offset, cx.offset), title;\n if (dest) {\n pos = cx.skipSpace(dest.to);\n // The destination and title must be separated by whitespace\n if (pos != dest.to) {\n title = parseLinkTitle(text, pos - cx.offset, cx.offset);\n if (title)\n pos = cx.skipSpace(title.to);\n }\n }\n if (cx.char(pos) == 41 /* ')' */) {\n content.push(elt(Type.LinkMark, startPos, startPos + 1));\n endPos = pos + 1;\n if (dest)\n content.push(dest);\n if (title)\n content.push(title);\n content.push(elt(Type.LinkMark, pos, endPos));\n }\n }\n else if (next == 91 /* '[' */) {\n let label = parseLinkLabel(text, startPos - cx.offset, cx.offset, false);\n if (label) {\n content.push(label);\n endPos = label.to;\n }\n }\n return elt(type, start, endPos, content);\n }\n // These return `null` when falling off the end of the input, `false`\n // when parsing fails otherwise (for use in the incremental link\n // reference parser).\n function parseURL(text, start, offset) {\n let next = text.charCodeAt(start);\n if (next == 60 /* '<' */) {\n for (let pos = start + 1; pos < text.length; pos++) {\n let ch = text.charCodeAt(pos);\n if (ch == 62 /* '>' */)\n return elt(Type.URL, start + offset, pos + 1 + offset);\n if (ch == 60 || ch == 10 /* '<\\n' */)\n return false;\n }\n return null;\n }\n else {\n let depth = 0, pos = start;\n for (let escaped = false; pos < text.length; pos++) {\n let ch = text.charCodeAt(pos);\n if (space$2(ch)) {\n break;\n }\n else if (escaped) {\n escaped = false;\n }\n else if (ch == 40 /* '(' */) {\n depth++;\n }\n else if (ch == 41 /* ')' */) {\n if (!depth)\n break;\n depth--;\n }\n else if (ch == 92 /* '\\\\' */) {\n escaped = true;\n }\n }\n return pos > start ? elt(Type.URL, start + offset, pos + offset) : pos == text.length ? null : false;\n }\n }\n function parseLinkTitle(text, start, offset) {\n let next = text.charCodeAt(start);\n if (next != 39 && next != 34 && next != 40 /* '\"\\'(' */)\n return false;\n let end = next == 40 ? 41 : next;\n for (let pos = start + 1, escaped = false; pos < text.length; pos++) {\n let ch = text.charCodeAt(pos);\n if (escaped)\n escaped = false;\n else if (ch == end)\n return elt(Type.LinkTitle, start + offset, pos + 1 + offset);\n else if (ch == 92 /* '\\\\' */)\n escaped = true;\n }\n return null;\n }\n function parseLinkLabel(text, start, offset, requireNonWS) {\n for (let escaped = false, pos = start + 1, end = Math.min(text.length, pos + 999); pos < end; pos++) {\n let ch = text.charCodeAt(pos);\n if (escaped)\n escaped = false;\n else if (ch == 93 /* ']' */)\n return requireNonWS ? false : elt(Type.LinkLabel, start + offset, pos + 1 + offset);\n else {\n if (requireNonWS && !space$2(ch))\n requireNonWS = false;\n if (ch == 91 /* '[' */)\n return false;\n else if (ch == 92 /* '\\\\' */)\n escaped = true;\n }\n }\n return null;\n }\n /// Inline parsing functions get access to this context, and use it to\n /// read the content and emit syntax nodes.\n class InlineContext {\n /// @internal\n constructor(\n /// The parser that is being used.\n parser, \n /// The text of this inline section.\n text, \n /// The starting offset of the section in the document.\n offset) {\n this.parser = parser;\n this.text = text;\n this.offset = offset;\n /// @internal\n this.parts = [];\n }\n /// Get the character code at the given (document-relative)\n /// position.\n char(pos) { return pos >= this.end ? -1 : this.text.charCodeAt(pos - this.offset); }\n /// The position of the end of this inline section.\n get end() { return this.offset + this.text.length; }\n /// Get a substring of this inline section. Again uses\n /// document-relative positions.\n slice(from, to) { return this.text.slice(from - this.offset, to - this.offset); }\n /// @internal\n append(elt) {\n this.parts.push(elt);\n return elt.to;\n }\n /// Add a [delimiter](#DelimiterType) at this given position. `open`\n /// and `close` indicate whether this delimiter is opening, closing,\n /// or both. Returns the end of the delimiter, for convenient\n /// returning from [parse functions](#InlineParser.parse).\n addDelimiter(type, from, to, open, close) {\n return this.append(new InlineDelimiter(type, from, to, (open ? 1 /* Mark.Open */ : 0 /* Mark.None */) | (close ? 2 /* Mark.Close */ : 0 /* Mark.None */)));\n }\n /// Returns true when there is an unmatched link or image opening\n /// token before the current position.\n get hasOpenLink() {\n for (let i = this.parts.length - 1; i >= 0; i--) {\n let part = this.parts[i];\n if (part instanceof InlineDelimiter && (part.type == LinkStart || part.type == ImageStart))\n return true;\n }\n return false;\n }\n /// Add an inline element. Returns the end of the element.\n addElement(elt) {\n return this.append(elt);\n }\n /// Resolve markers between this.parts.length and from, wrapping matched markers in the\n /// appropriate node and updating the content of this.parts. @internal\n resolveMarkers(from) {\n // Scan forward, looking for closing tokens\n for (let i = from; i < this.parts.length; i++) {\n let close = this.parts[i];\n if (!(close instanceof InlineDelimiter && close.type.resolve && (close.side & 2 /* Mark.Close */)))\n continue;\n let emp = close.type == EmphasisUnderscore || close.type == EmphasisAsterisk;\n let closeSize = close.to - close.from;\n let open, j = i - 1;\n // Continue scanning for a matching opening token\n for (; j >= from; j--) {\n let part = this.parts[j];\n if (part instanceof InlineDelimiter && (part.side & 1 /* Mark.Open */) && part.type == close.type &&\n // Ignore emphasis delimiters where the character count doesn't match\n !(emp && ((close.side & 1 /* Mark.Open */) || (part.side & 2 /* Mark.Close */)) &&\n (part.to - part.from + closeSize) % 3 == 0 && ((part.to - part.from) % 3 || closeSize % 3))) {\n open = part;\n break;\n }\n }\n if (!open)\n continue;\n let type = close.type.resolve, content = [];\n let start = open.from, end = close.to;\n // Emphasis marker effect depends on the character count. Size consumed is minimum of the two\n // markers.\n if (emp) {\n let size = Math.min(2, open.to - open.from, closeSize);\n start = open.to - size;\n end = close.from + size;\n type = size == 1 ? \"Emphasis\" : \"StrongEmphasis\";\n }\n // Move the covered region into content, optionally adding marker nodes\n if (open.type.mark)\n content.push(this.elt(open.type.mark, start, open.to));\n for (let k = j + 1; k < i; k++) {\n if (this.parts[k] instanceof Element$1)\n content.push(this.parts[k]);\n this.parts[k] = null;\n }\n if (close.type.mark)\n content.push(this.elt(close.type.mark, close.from, end));\n let element = this.elt(type, start, end, content);\n // If there are leftover emphasis marker characters, shrink the close/open markers. Otherwise, clear them.\n this.parts[j] = emp && open.from != start ? new InlineDelimiter(open.type, open.from, start, open.side) : null;\n let keep = this.parts[i] = emp && close.to != end ? new InlineDelimiter(close.type, end, close.to, close.side) : null;\n // Insert the new element in this.parts\n if (keep)\n this.parts.splice(i, 0, element);\n else\n this.parts[i] = element;\n }\n // Collect the elements remaining in this.parts into an array.\n let result = [];\n for (let i = from; i < this.parts.length; i++) {\n let part = this.parts[i];\n if (part instanceof Element$1)\n result.push(part);\n }\n return result;\n }\n /// Find an opening delimiter of the given type. Returns `null` if\n /// no delimiter is found, or an index that can be passed to\n /// [`takeContent`](#InlineContext.takeContent) otherwise.\n findOpeningDelimiter(type) {\n for (let i = this.parts.length - 1; i >= 0; i--) {\n let part = this.parts[i];\n if (part instanceof InlineDelimiter && part.type == type)\n return i;\n }\n return null;\n }\n /// Remove all inline elements and delimiters starting from the\n /// given index (which you should get from\n /// [`findOpeningDelimiter`](#InlineContext.findOpeningDelimiter),\n /// resolve delimiters inside of them, and return them as an array\n /// of elements.\n takeContent(startIndex) {\n let content = this.resolveMarkers(startIndex);\n this.parts.length = startIndex;\n return content;\n }\n /// Skip space after the given (document) position, returning either\n /// the position of the next non-space character or the end of the\n /// section.\n skipSpace(from) { return skipSpace(this.text, from - this.offset) + this.offset; }\n elt(type, from, to, children) {\n if (typeof type == \"string\")\n return elt(this.parser.getNodeType(type), from, to, children);\n return new TreeElement(type, from);\n }\n }\n function injectMarks(elements, marks) {\n if (!marks.length)\n return elements;\n if (!elements.length)\n return marks;\n let elts = elements.slice(), eI = 0;\n for (let mark of marks) {\n while (eI < elts.length && elts[eI].to < mark.to)\n eI++;\n if (eI < elts.length && elts[eI].from < mark.from) {\n let e = elts[eI];\n if (e instanceof Element$1)\n elts[eI] = new Element$1(e.type, e.from, e.to, injectMarks(e.children, [mark]));\n }\n else {\n elts.splice(eI++, 0, mark);\n }\n }\n return elts;\n }\n // These are blocks that can span blank lines, and should thus only be\n // reused if their next sibling is also being reused.\n const NotLast = [Type.CodeBlock, Type.ListItem, Type.OrderedList, Type.BulletList];\n class FragmentCursor$1 {\n constructor(fragments, input) {\n this.fragments = fragments;\n this.input = input;\n // Index into fragment array\n this.i = 0;\n // Active fragment\n this.fragment = null;\n this.fragmentEnd = -1;\n // Cursor into the current fragment, if any. When `moveTo` returns\n // true, this points at the first block after `pos`.\n this.cursor = null;\n if (fragments.length)\n this.fragment = fragments[this.i++];\n }\n nextFragment() {\n this.fragment = this.i < this.fragments.length ? this.fragments[this.i++] : null;\n this.cursor = null;\n this.fragmentEnd = -1;\n }\n moveTo(pos, lineStart) {\n while (this.fragment && this.fragment.to <= pos)\n this.nextFragment();\n if (!this.fragment || this.fragment.from > (pos ? pos - 1 : 0))\n return false;\n if (this.fragmentEnd < 0) {\n let end = this.fragment.to;\n while (end > 0 && this.input.read(end - 1, end) != \"\\n\")\n end--;\n this.fragmentEnd = end ? end - 1 : 0;\n }\n let c = this.cursor;\n if (!c) {\n c = this.cursor = this.fragment.tree.cursor();\n c.firstChild();\n }\n let rPos = pos + this.fragment.offset;\n while (c.to <= rPos)\n if (!c.parent())\n return false;\n for (;;) {\n if (c.from >= rPos)\n return this.fragment.from <= lineStart;\n if (!c.childAfter(rPos))\n return false;\n }\n }\n matches(hash) {\n let tree = this.cursor.tree;\n return tree && tree.prop(NodeProp.contextHash) == hash;\n }\n takeNodes(cx) {\n let cur = this.cursor, off = this.fragment.offset, fragEnd = this.fragmentEnd - (this.fragment.openEnd ? 1 : 0);\n let start = cx.absoluteLineStart, end = start, blockI = cx.block.children.length;\n let prevEnd = end, prevI = blockI;\n for (;;) {\n if (cur.to - off > fragEnd) {\n if (cur.type.isAnonymous && cur.firstChild())\n continue;\n break;\n }\n let pos = toRelative(cur.from - off, cx.ranges);\n if (cur.to - off <= cx.ranges[cx.rangeI].to) { // Fits in current range\n cx.addNode(cur.tree, pos);\n }\n else {\n let dummy = new Tree(cx.parser.nodeSet.types[Type.Paragraph], [], [], 0, cx.block.hashProp);\n cx.reusePlaceholders.set(dummy, cur.tree);\n cx.addNode(dummy, pos);\n }\n // Taken content must always end in a block, because incremental\n // parsing happens on block boundaries. Never stop directly\n // after an indented code block, since those can continue after\n // any number of blank lines.\n if (cur.type.is(\"Block\")) {\n if (NotLast.indexOf(cur.type.id) < 0) {\n end = cur.to - off;\n blockI = cx.block.children.length;\n }\n else {\n end = prevEnd;\n blockI = prevI;\n prevEnd = cur.to - off;\n prevI = cx.block.children.length;\n }\n }\n if (!cur.nextSibling())\n break;\n }\n while (cx.block.children.length > blockI) {\n cx.block.children.pop();\n cx.block.positions.pop();\n }\n return end - start;\n }\n }\n // Convert an input-stream-relative position to a\n // Markdown-doc-relative position by subtracting the size of all input\n // gaps before `abs`.\n function toRelative(abs, ranges) {\n let pos = abs;\n for (let i = 1; i < ranges.length; i++) {\n let gapFrom = ranges[i - 1].to, gapTo = ranges[i].from;\n if (gapFrom < abs)\n pos -= gapTo - gapFrom;\n }\n return pos;\n }\n const markdownHighlighting = styleTags({\n \"Blockquote/...\": tags$1.quote,\n HorizontalRule: tags$1.contentSeparator,\n \"ATXHeading1/... SetextHeading1/...\": tags$1.heading1,\n \"ATXHeading2/... SetextHeading2/...\": tags$1.heading2,\n \"ATXHeading3/...\": tags$1.heading3,\n \"ATXHeading4/...\": tags$1.heading4,\n \"ATXHeading5/...\": tags$1.heading5,\n \"ATXHeading6/...\": tags$1.heading6,\n \"Comment CommentBlock\": tags$1.comment,\n Escape: tags$1.escape,\n Entity: tags$1.character,\n \"Emphasis/...\": tags$1.emphasis,\n \"StrongEmphasis/...\": tags$1.strong,\n \"Link/... Image/...\": tags$1.link,\n \"OrderedList/... BulletList/...\": tags$1.list,\n \"BlockQuote/...\": tags$1.quote,\n \"InlineCode CodeText\": tags$1.monospace,\n \"URL Autolink\": tags$1.url,\n \"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark\": tags$1.processingInstruction,\n \"CodeInfo LinkLabel\": tags$1.labelName,\n LinkTitle: tags$1.string,\n Paragraph: tags$1.content\n });\n /// The default CommonMark parser.\n const parser$4 = new MarkdownParser(new NodeSet(nodeTypes).extend(markdownHighlighting), Object.keys(DefaultBlockParsers).map(n => DefaultBlockParsers[n]), Object.keys(DefaultBlockParsers).map(n => DefaultLeafBlocks[n]), Object.keys(DefaultBlockParsers), DefaultEndLeaf, DefaultSkipMarkup, Object.keys(DefaultInline).map(n => DefaultInline[n]), Object.keys(DefaultInline), []);\n\n function leftOverSpace(node, from, to) {\n let ranges = [];\n for (let n = node.firstChild, pos = from;; n = n.nextSibling) {\n let nextPos = n ? n.from : to;\n if (nextPos > pos)\n ranges.push({ from: pos, to: nextPos });\n if (!n)\n break;\n pos = n.to;\n }\n return ranges;\n }\n /// Create a Markdown extension to enable nested parsing on code\n /// blocks and/or embedded HTML.\n function parseCode(config) {\n let { codeParser, htmlParser } = config;\n let wrap = parseMixed((node, input) => {\n let id = node.type.id;\n if (codeParser && (id == Type.CodeBlock || id == Type.FencedCode)) {\n let info = \"\";\n if (id == Type.FencedCode) {\n let infoNode = node.node.getChild(Type.CodeInfo);\n if (infoNode)\n info = input.read(infoNode.from, infoNode.to);\n }\n let parser = codeParser(info);\n if (parser)\n return { parser, overlay: node => node.type.id == Type.CodeText };\n }\n else if (htmlParser && (id == Type.HTMLBlock || id == Type.HTMLTag)) {\n return { parser: htmlParser, overlay: leftOverSpace(node.node, node.from, node.to) };\n }\n return null;\n });\n return { wrap };\n }\n\n const StrikethroughDelim = { resolve: \"Strikethrough\", mark: \"StrikethroughMark\" };\n /// An extension that implements\n /// [GFM-style](https://github.github.com/gfm/#strikethrough-extension-)\n /// Strikethrough syntax using `~~` delimiters.\n const Strikethrough = {\n defineNodes: [{\n name: \"Strikethrough\",\n style: { \"Strikethrough/...\": tags$1.strikethrough }\n }, {\n name: \"StrikethroughMark\",\n style: tags$1.processingInstruction\n }],\n parseInline: [{\n name: \"Strikethrough\",\n parse(cx, next, pos) {\n if (next != 126 /* '~' */ || cx.char(pos + 1) != 126 || cx.char(pos + 2) == 126)\n return -1;\n let before = cx.slice(pos - 1, pos), after = cx.slice(pos + 2, pos + 3);\n let sBefore = /\\s|^$/.test(before), sAfter = /\\s|^$/.test(after);\n let pBefore = Punctuation.test(before), pAfter = Punctuation.test(after);\n return cx.addDelimiter(StrikethroughDelim, pos, pos + 2, !sAfter && (!pAfter || sBefore || pBefore), !sBefore && (!pBefore || sAfter || pAfter));\n },\n after: \"Emphasis\"\n }]\n };\n function parseRow(cx, line, startI = 0, elts, offset = 0) {\n let count = 0, first = true, cellStart = -1, cellEnd = -1, esc = false;\n let parseCell = () => {\n elts.push(cx.elt(\"TableCell\", offset + cellStart, offset + cellEnd, cx.parser.parseInline(line.slice(cellStart, cellEnd), offset + cellStart)));\n };\n for (let i = startI; i < line.length; i++) {\n let next = line.charCodeAt(i);\n if (next == 124 /* '|' */ && !esc) {\n if (!first || cellStart > -1)\n count++;\n first = false;\n if (elts) {\n if (cellStart > -1)\n parseCell();\n elts.push(cx.elt(\"TableDelimiter\", i + offset, i + offset + 1));\n }\n cellStart = cellEnd = -1;\n }\n else if (esc || next != 32 && next != 9) {\n if (cellStart < 0)\n cellStart = i;\n cellEnd = i + 1;\n }\n esc = !esc && next == 92;\n }\n if (cellStart > -1) {\n count++;\n if (elts)\n parseCell();\n }\n return count;\n }\n function hasPipe(str, start) {\n for (let i = start; i < str.length; i++) {\n let next = str.charCodeAt(i);\n if (next == 124 /* '|' */)\n return true;\n if (next == 92 /* '\\\\' */)\n i++;\n }\n return false;\n }\n const delimiterLine = /^\\|?(\\s*:?-+:?\\s*\\|)+(\\s*:?-+:?\\s*)?$/;\n class TableParser {\n constructor() {\n // Null means we haven't seen the second line yet, false means this\n // isn't a table, and an array means this is a table and we've\n // parsed the given rows so far.\n this.rows = null;\n }\n nextLine(cx, line, leaf) {\n if (this.rows == null) { // Second line\n this.rows = false;\n let lineText;\n if ((line.next == 45 || line.next == 58 || line.next == 124 /* '-:|' */) &&\n delimiterLine.test(lineText = line.text.slice(line.pos))) {\n let firstRow = [], firstCount = parseRow(cx, leaf.content, 0, firstRow, leaf.start);\n if (firstCount == parseRow(cx, lineText, line.pos))\n this.rows = [cx.elt(\"TableHeader\", leaf.start, leaf.start + leaf.content.length, firstRow),\n cx.elt(\"TableDelimiter\", cx.lineStart + line.pos, cx.lineStart + line.text.length)];\n }\n }\n else if (this.rows) { // Line after the second\n let content = [];\n parseRow(cx, line.text, line.pos, content, cx.lineStart);\n this.rows.push(cx.elt(\"TableRow\", cx.lineStart + line.pos, cx.lineStart + line.text.length, content));\n }\n return false;\n }\n finish(cx, leaf) {\n if (!this.rows)\n return false;\n cx.addLeafElement(leaf, cx.elt(\"Table\", leaf.start, leaf.start + leaf.content.length, this.rows));\n return true;\n }\n }\n /// This extension provides\n /// [GFM-style](https://github.github.com/gfm/#tables-extension-)\n /// tables, using syntax like this:\n ///\n /// ```\n /// | head 1 | head 2 |\n /// | --- | --- |\n /// | cell 1 | cell 2 |\n /// ```\n const Table = {\n defineNodes: [\n { name: \"Table\", block: true },\n { name: \"TableHeader\", style: { \"TableHeader/...\": tags$1.heading } },\n \"TableRow\",\n { name: \"TableCell\", style: tags$1.content },\n { name: \"TableDelimiter\", style: tags$1.processingInstruction },\n ],\n parseBlock: [{\n name: \"Table\",\n leaf(_, leaf) { return hasPipe(leaf.content, 0) ? new TableParser : null; },\n endLeaf(cx, line, leaf) {\n if (leaf.parsers.some(p => p instanceof TableParser) || !hasPipe(line.text, line.basePos))\n return false;\n let next = cx.scanLine(cx.absoluteLineEnd + 1).text;\n return delimiterLine.test(next) && parseRow(cx, line.text, line.basePos) == parseRow(cx, next, line.basePos);\n },\n before: \"SetextHeading\"\n }]\n };\n class TaskParser {\n nextLine() { return false; }\n finish(cx, leaf) {\n cx.addLeafElement(leaf, cx.elt(\"Task\", leaf.start, leaf.start + leaf.content.length, [\n cx.elt(\"TaskMarker\", leaf.start, leaf.start + 3),\n ...cx.parser.parseInline(leaf.content.slice(3), leaf.start + 3)\n ]));\n return true;\n }\n }\n /// Extension providing\n /// [GFM-style](https://github.github.com/gfm/#task-list-items-extension-)\n /// task list items, where list items can be prefixed with `[ ]` or\n /// `[x]` to add a checkbox.\n const TaskList = {\n defineNodes: [\n { name: \"Task\", block: true, style: tags$1.list },\n { name: \"TaskMarker\", style: tags$1.atom }\n ],\n parseBlock: [{\n name: \"TaskList\",\n leaf(cx, leaf) {\n return /^\\[[ xX]\\][ \\t]/.test(leaf.content) && cx.parentType().name == \"ListItem\" ? new TaskParser : null;\n },\n after: \"SetextHeading\"\n }]\n };\n const autolinkRE = /(www\\.)|(https?:\\/\\/)|([\\w.+-]+@)|(mailto:|xmpp:)/gy;\n const urlRE = /[\\w-]+(\\.[\\w-]+)+(\\/[^\\s<]*)?/gy;\n const lastTwoDomainWords = /[\\w-]+\\.[\\w-]+($|\\/)/;\n const emailRE = /[\\w.+-]+@[\\w-]+(\\.[\\w.-]+)+/gy;\n const xmppResourceRE = /\\/[a-zA-Z\\d@.]+/gy;\n function count(str, from, to, ch) {\n let result = 0;\n for (let i = from; i < to; i++)\n if (str[i] == ch)\n result++;\n return result;\n }\n function autolinkURLEnd(text, from) {\n urlRE.lastIndex = from;\n let m = urlRE.exec(text);\n if (!m || lastTwoDomainWords.exec(m[0])[0].indexOf(\"_\") > -1)\n return -1;\n let end = from + m[0].length;\n for (;;) {\n let last = text[end - 1], m;\n if (/[?!.,:*_~]/.test(last) ||\n last == \")\" && count(text, from, end, \")\") > count(text, from, end, \"(\"))\n end--;\n else if (last == \";\" && (m = /&(?:#\\d+|#x[a-f\\d]+|\\w+);$/.exec(text.slice(from, end))))\n end = from + m.index;\n else\n break;\n }\n return end;\n }\n function autolinkEmailEnd(text, from) {\n emailRE.lastIndex = from;\n let m = emailRE.exec(text);\n if (!m)\n return -1;\n let last = m[0][m[0].length - 1];\n return last == \"_\" || last == \"-\" ? -1 : from + m[0].length - (last == \".\" ? 1 : 0);\n }\n /// Extension that implements autolinking for\n /// `www.`/`http://`/`https://`/`mailto:`/`xmpp:` URLs and email\n /// addresses.\n const Autolink = {\n parseInline: [{\n name: \"Autolink\",\n parse(cx, next, absPos) {\n let pos = absPos - cx.offset;\n autolinkRE.lastIndex = pos;\n let m = autolinkRE.exec(cx.text), end = -1;\n if (!m)\n return -1;\n if (m[1] || m[2]) { // www., http://\n end = autolinkURLEnd(cx.text, pos + m[0].length);\n if (end > -1 && cx.hasOpenLink) {\n let noBracket = /([^\\[\\]]|\\[[^\\]]*\\])*/.exec(cx.text.slice(pos, end));\n end = pos + noBracket[0].length;\n }\n }\n else if (m[3]) { // email address\n end = autolinkEmailEnd(cx.text, pos);\n }\n else { // mailto:/xmpp:\n end = autolinkEmailEnd(cx.text, pos + m[0].length);\n if (end > -1 && m[0] == \"xmpp:\") {\n xmppResourceRE.lastIndex = end;\n m = xmppResourceRE.exec(cx.text);\n if (m)\n end = m.index + m[0].length;\n }\n }\n if (end < 0)\n return -1;\n cx.addElement(cx.elt(\"URL\", absPos, end + cx.offset));\n return end + cx.offset;\n }\n }]\n };\n /// Extension bundle containing [`Table`](#Table),\n /// [`TaskList`](#TaskList), [`Strikethrough`](#Strikethrough), and\n /// [`Autolink`](#Autolink).\n const GFM = [Table, TaskList, Strikethrough, Autolink];\n function parseSubSuper(ch, node, mark) {\n return (cx, next, pos) => {\n if (next != ch || cx.char(pos + 1) == ch)\n return -1;\n let elts = [cx.elt(mark, pos, pos + 1)];\n for (let i = pos + 1; i < cx.end; i++) {\n let next = cx.char(i);\n if (next == ch)\n return cx.addElement(cx.elt(node, pos, i + 1, elts.concat(cx.elt(mark, i, i + 1))));\n if (next == 92 /* '\\\\' */)\n elts.push(cx.elt(\"Escape\", i, i++ + 2));\n if (space$2(next))\n break;\n }\n return -1;\n };\n }\n /// Extension providing\n /// [Pandoc-style](https://pandoc.org/MANUAL.html#superscripts-and-subscripts)\n /// superscript using `^` markers.\n const Superscript = {\n defineNodes: [\n { name: \"Superscript\", style: tags$1.special(tags$1.content) },\n { name: \"SuperscriptMark\", style: tags$1.processingInstruction }\n ],\n parseInline: [{\n name: \"Superscript\",\n parse: parseSubSuper(94 /* '^' */, \"Superscript\", \"SuperscriptMark\")\n }]\n };\n /// Extension providing\n /// [Pandoc-style](https://pandoc.org/MANUAL.html#superscripts-and-subscripts)\n /// subscript using `~` markers.\n const Subscript = {\n defineNodes: [\n { name: \"Subscript\", style: tags$1.special(tags$1.content) },\n { name: \"SubscriptMark\", style: tags$1.processingInstruction }\n ],\n parseInline: [{\n name: \"Subscript\",\n parse: parseSubSuper(126 /* '~' */, \"Subscript\", \"SubscriptMark\")\n }]\n };\n /// Extension that parses two colons with only letters, underscores,\n /// and numbers between them as `Emoji` nodes.\n const Emoji = {\n defineNodes: [{ name: \"Emoji\", style: tags$1.character }],\n parseInline: [{\n name: \"Emoji\",\n parse(cx, next, pos) {\n let match;\n if (next != 58 /* ':' */ || !(match = /^[a-zA-Z_0-9]+:/.exec(cx.slice(pos + 1, cx.end))))\n return -1;\n return cx.addElement(cx.elt(\"Emoji\", pos, pos + 1 + match[0].length));\n }\n }]\n };\n\n /**\n A parse stack. These are used internally by the parser to track\n parsing progress. They also provide some properties and methods\n that external code such as a tokenizer can use to get information\n about the parse state.\n */\n class Stack {\n /**\n @internal\n */\n constructor(\n /**\n The parse that this stack is part of @internal\n */\n p, \n /**\n Holds state, input pos, buffer index triplets for all but the\n top state @internal\n */\n stack, \n /**\n The current parse state @internal\n */\n state, \n // The position at which the next reduce should take place. This\n // can be less than `this.pos` when skipped expressions have been\n // added to the stack (which should be moved outside of the next\n // reduction)\n /**\n @internal\n */\n reducePos, \n /**\n The input position up to which this stack has parsed.\n */\n pos, \n /**\n The dynamic score of the stack, including dynamic precedence\n and error-recovery penalties\n @internal\n */\n score, \n // The output buffer. Holds (type, start, end, size) quads\n // representing nodes created by the parser, where `size` is\n // amount of buffer array entries covered by this node.\n /**\n @internal\n */\n buffer, \n // The base offset of the buffer. When stacks are split, the split\n // instance shared the buffer history with its parent up to\n // `bufferBase`, which is the absolute offset (including the\n // offset of previous splits) into the buffer at which this stack\n // starts writing.\n /**\n @internal\n */\n bufferBase, \n /**\n @internal\n */\n curContext, \n /**\n @internal\n */\n lookAhead = 0, \n // A parent stack from which this was split off, if any. This is\n // set up so that it always points to a stack that has some\n // additional buffer content, never to a stack with an equal\n // `bufferBase`.\n /**\n @internal\n */\n parent) {\n this.p = p;\n this.stack = stack;\n this.state = state;\n this.reducePos = reducePos;\n this.pos = pos;\n this.score = score;\n this.buffer = buffer;\n this.bufferBase = bufferBase;\n this.curContext = curContext;\n this.lookAhead = lookAhead;\n this.parent = parent;\n }\n /**\n @internal\n */\n toString() {\n return `[${this.stack.filter((_, i) => i % 3 == 0).concat(this.state)}]@${this.pos}${this.score ? \"!\" + this.score : \"\"}`;\n }\n // Start an empty stack\n /**\n @internal\n */\n static start(p, state, pos = 0) {\n let cx = p.parser.context;\n return new Stack(p, [], state, pos, pos, 0, [], 0, cx ? new StackContext(cx, cx.start) : null, 0, null);\n }\n /**\n The stack's current [context](#lr.ContextTracker) value, if\n any. Its type will depend on the context tracker's type\n parameter, or it will be `null` if there is no context\n tracker.\n */\n get context() { return this.curContext ? this.curContext.context : null; }\n // Push a state onto the stack, tracking its start position as well\n // as the buffer base at that point.\n /**\n @internal\n */\n pushState(state, start) {\n this.stack.push(this.state, start, this.bufferBase + this.buffer.length);\n this.state = state;\n }\n // Apply a reduce action\n /**\n @internal\n */\n reduce(action) {\n var _a;\n let depth = action >> 19 /* Action.ReduceDepthShift */, type = action & 65535 /* Action.ValueMask */;\n let { parser } = this.p;\n let lookaheadRecord = this.reducePos < this.pos - 25 /* Lookahead.Margin */;\n if (lookaheadRecord)\n this.setLookAhead(this.pos);\n let dPrec = parser.dynamicPrecedence(type);\n if (dPrec)\n this.score += dPrec;\n if (depth == 0) {\n this.pushState(parser.getGoto(this.state, type, true), this.reducePos);\n // Zero-depth reductions are a special case\u2014they add stuff to\n // the stack without popping anything off.\n if (type < parser.minRepeatTerm)\n this.storeNode(type, this.reducePos, this.reducePos, lookaheadRecord ? 8 : 4, true);\n this.reduceContext(type, this.reducePos);\n return;\n }\n // Find the base index into `this.stack`, content after which will\n // be dropped. Note that with `StayFlag` reductions we need to\n // consume two extra frames (the dummy parent node for the skipped\n // expression and the state that we'll be staying in, which should\n // be moved to `this.state`).\n let base = this.stack.length - ((depth - 1) * 3) - (action & 262144 /* Action.StayFlag */ ? 6 : 0);\n let start = base ? this.stack[base - 2] : this.p.ranges[0].from, size = this.reducePos - start;\n // This is a kludge to try and detect overly deep left-associative\n // trees, which will not increase the parse stack depth and thus\n // won't be caught by the regular stack-depth limit check.\n if (size >= 2000 /* Recover.MinBigReduction */ && !((_a = this.p.parser.nodeSet.types[type]) === null || _a === void 0 ? void 0 : _a.isAnonymous)) {\n if (start == this.p.lastBigReductionStart) {\n this.p.bigReductionCount++;\n this.p.lastBigReductionSize = size;\n }\n else if (this.p.lastBigReductionSize < size) {\n this.p.bigReductionCount = 1;\n this.p.lastBigReductionStart = start;\n this.p.lastBigReductionSize = size;\n }\n }\n let bufferBase = base ? this.stack[base - 1] : 0, count = this.bufferBase + this.buffer.length - bufferBase;\n // Store normal terms or `R -> R R` repeat reductions\n if (type < parser.minRepeatTerm || (action & 131072 /* Action.RepeatFlag */)) {\n let pos = parser.stateFlag(this.state, 1 /* StateFlag.Skipped */) ? this.pos : this.reducePos;\n this.storeNode(type, start, pos, count + 4, true);\n }\n if (action & 262144 /* Action.StayFlag */) {\n this.state = this.stack[base];\n }\n else {\n let baseStateID = this.stack[base - 3];\n this.state = parser.getGoto(baseStateID, type, true);\n }\n while (this.stack.length > base)\n this.stack.pop();\n this.reduceContext(type, start);\n }\n // Shift a value into the buffer\n /**\n @internal\n */\n storeNode(term, start, end, size = 4, mustSink = false) {\n if (term == 0 /* Term.Err */ &&\n (!this.stack.length || this.stack[this.stack.length - 1] < this.buffer.length + this.bufferBase)) {\n // Try to omit/merge adjacent error nodes\n let cur = this, top = this.buffer.length;\n if (top == 0 && cur.parent) {\n top = cur.bufferBase - cur.parent.bufferBase;\n cur = cur.parent;\n }\n if (top > 0 && cur.buffer[top - 4] == 0 /* Term.Err */ && cur.buffer[top - 1] > -1) {\n if (start == end)\n return;\n if (cur.buffer[top - 2] >= start) {\n cur.buffer[top - 2] = end;\n return;\n }\n }\n }\n if (!mustSink || this.pos == end) { // Simple case, just append\n this.buffer.push(term, start, end, size);\n }\n else { // There may be skipped nodes that have to be moved forward\n let index = this.buffer.length;\n if (index > 0 && this.buffer[index - 4] != 0 /* Term.Err */) {\n let mustMove = false;\n for (let scan = index; scan > 0 && this.buffer[scan - 2] > end; scan -= 4) {\n if (this.buffer[scan - 1] >= 0) {\n mustMove = true;\n break;\n }\n }\n if (mustMove)\n while (index > 0 && this.buffer[index - 2] > end) {\n // Move this record forward\n this.buffer[index] = this.buffer[index - 4];\n this.buffer[index + 1] = this.buffer[index - 3];\n this.buffer[index + 2] = this.buffer[index - 2];\n this.buffer[index + 3] = this.buffer[index - 1];\n index -= 4;\n if (size > 4)\n size -= 4;\n }\n }\n this.buffer[index] = term;\n this.buffer[index + 1] = start;\n this.buffer[index + 2] = end;\n this.buffer[index + 3] = size;\n }\n }\n // Apply a shift action\n /**\n @internal\n */\n shift(action, type, start, end) {\n if (action & 131072 /* Action.GotoFlag */) {\n this.pushState(action & 65535 /* Action.ValueMask */, this.pos);\n }\n else if ((action & 262144 /* Action.StayFlag */) == 0) { // Regular shift\n let nextState = action, { parser } = this.p;\n if (end > this.pos || type <= parser.maxNode) {\n this.pos = end;\n if (!parser.stateFlag(nextState, 1 /* StateFlag.Skipped */))\n this.reducePos = end;\n }\n this.pushState(nextState, start);\n this.shiftContext(type, start);\n if (type <= parser.maxNode)\n this.buffer.push(type, start, end, 4);\n }\n else { // Shift-and-stay, which means this is a skipped token\n this.pos = end;\n this.shiftContext(type, start);\n if (type <= this.p.parser.maxNode)\n this.buffer.push(type, start, end, 4);\n }\n }\n // Apply an action\n /**\n @internal\n */\n apply(action, next, nextStart, nextEnd) {\n if (action & 65536 /* Action.ReduceFlag */)\n this.reduce(action);\n else\n this.shift(action, next, nextStart, nextEnd);\n }\n // Add a prebuilt (reused) node into the buffer.\n /**\n @internal\n */\n useNode(value, next) {\n let index = this.p.reused.length - 1;\n if (index < 0 || this.p.reused[index] != value) {\n this.p.reused.push(value);\n index++;\n }\n let start = this.pos;\n this.reducePos = this.pos = start + value.length;\n this.pushState(next, start);\n this.buffer.push(index, start, this.reducePos, -1 /* size == -1 means this is a reused value */);\n if (this.curContext)\n this.updateContext(this.curContext.tracker.reuse(this.curContext.context, value, this, this.p.stream.reset(this.pos - value.length)));\n }\n // Split the stack. Due to the buffer sharing and the fact\n // that `this.stack` tends to stay quite shallow, this isn't very\n // expensive.\n /**\n @internal\n */\n split() {\n let parent = this;\n let off = parent.buffer.length;\n // Because the top of the buffer (after this.pos) may be mutated\n // to reorder reductions and skipped tokens, and shared buffers\n // should be immutable, this copies any outstanding skipped tokens\n // to the new buffer, and puts the base pointer before them.\n while (off > 0 && parent.buffer[off - 2] > parent.reducePos)\n off -= 4;\n let buffer = parent.buffer.slice(off), base = parent.bufferBase + off;\n // Make sure parent points to an actual parent with content, if there is such a parent.\n while (parent && base == parent.bufferBase)\n parent = parent.parent;\n return new Stack(this.p, this.stack.slice(), this.state, this.reducePos, this.pos, this.score, buffer, base, this.curContext, this.lookAhead, parent);\n }\n // Try to recover from an error by 'deleting' (ignoring) one token.\n /**\n @internal\n */\n recoverByDelete(next, nextEnd) {\n let isNode = next <= this.p.parser.maxNode;\n if (isNode)\n this.storeNode(next, this.pos, nextEnd, 4);\n this.storeNode(0 /* Term.Err */, this.pos, nextEnd, isNode ? 8 : 4);\n this.pos = this.reducePos = nextEnd;\n this.score -= 190 /* Recover.Delete */;\n }\n /**\n Check if the given term would be able to be shifted (optionally\n after some reductions) on this stack. This can be useful for\n external tokenizers that want to make sure they only provide a\n given token when it applies.\n */\n canShift(term) {\n for (let sim = new SimulatedStack(this);;) {\n let action = this.p.parser.stateSlot(sim.state, 4 /* ParseState.DefaultReduce */) || this.p.parser.hasAction(sim.state, term);\n if (action == 0)\n return false;\n if ((action & 65536 /* Action.ReduceFlag */) == 0)\n return true;\n sim.reduce(action);\n }\n }\n // Apply up to Recover.MaxNext recovery actions that conceptually\n // inserts some missing token or rule.\n /**\n @internal\n */\n recoverByInsert(next) {\n if (this.stack.length >= 300 /* Recover.MaxInsertStackDepth */)\n return [];\n let nextStates = this.p.parser.nextStates(this.state);\n if (nextStates.length > 4 /* Recover.MaxNext */ << 1 || this.stack.length >= 120 /* Recover.DampenInsertStackDepth */) {\n let best = [];\n for (let i = 0, s; i < nextStates.length; i += 2) {\n if ((s = nextStates[i + 1]) != this.state && this.p.parser.hasAction(s, next))\n best.push(nextStates[i], s);\n }\n if (this.stack.length < 120 /* Recover.DampenInsertStackDepth */)\n for (let i = 0; best.length < 4 /* Recover.MaxNext */ << 1 && i < nextStates.length; i += 2) {\n let s = nextStates[i + 1];\n if (!best.some((v, i) => (i & 1) && v == s))\n best.push(nextStates[i], s);\n }\n nextStates = best;\n }\n let result = [];\n for (let i = 0; i < nextStates.length && result.length < 4 /* Recover.MaxNext */; i += 2) {\n let s = nextStates[i + 1];\n if (s == this.state)\n continue;\n let stack = this.split();\n stack.pushState(s, this.pos);\n stack.storeNode(0 /* Term.Err */, stack.pos, stack.pos, 4, true);\n stack.shiftContext(nextStates[i], this.pos);\n stack.reducePos = this.pos;\n stack.score -= 200 /* Recover.Insert */;\n result.push(stack);\n }\n return result;\n }\n // Force a reduce, if possible. Return false if that can't\n // be done.\n /**\n @internal\n */\n forceReduce() {\n let { parser } = this.p;\n let reduce = parser.stateSlot(this.state, 5 /* ParseState.ForcedReduce */);\n if ((reduce & 65536 /* Action.ReduceFlag */) == 0)\n return false;\n if (!parser.validAction(this.state, reduce)) {\n let depth = reduce >> 19 /* Action.ReduceDepthShift */, term = reduce & 65535 /* Action.ValueMask */;\n let target = this.stack.length - depth * 3;\n if (target < 0 || parser.getGoto(this.stack[target], term, false) < 0) {\n let backup = this.findForcedReduction();\n if (backup == null)\n return false;\n reduce = backup;\n }\n this.storeNode(0 /* Term.Err */, this.pos, this.pos, 4, true);\n this.score -= 100 /* Recover.Reduce */;\n }\n this.reducePos = this.pos;\n this.reduce(reduce);\n return true;\n }\n /**\n Try to scan through the automaton to find some kind of reduction\n that can be applied. Used when the regular ForcedReduce field\n isn't a valid action. @internal\n */\n findForcedReduction() {\n let { parser } = this.p, seen = [];\n let explore = (state, depth) => {\n if (seen.includes(state))\n return;\n seen.push(state);\n return parser.allActions(state, (action) => {\n if (action & (262144 /* Action.StayFlag */ | 131072 /* Action.GotoFlag */)) ;\n else if (action & 65536 /* Action.ReduceFlag */) {\n let rDepth = (action >> 19 /* Action.ReduceDepthShift */) - depth;\n if (rDepth > 1) {\n let term = action & 65535 /* Action.ValueMask */, target = this.stack.length - rDepth * 3;\n if (target >= 0 && parser.getGoto(this.stack[target], term, false) >= 0)\n return (rDepth << 19 /* Action.ReduceDepthShift */) | 65536 /* Action.ReduceFlag */ | term;\n }\n }\n else {\n let found = explore(action, depth + 1);\n if (found != null)\n return found;\n }\n });\n };\n return explore(this.state, 0);\n }\n /**\n @internal\n */\n forceAll() {\n while (!this.p.parser.stateFlag(this.state, 2 /* StateFlag.Accepting */)) {\n if (!this.forceReduce()) {\n this.storeNode(0 /* Term.Err */, this.pos, this.pos, 4, true);\n break;\n }\n }\n return this;\n }\n /**\n Check whether this state has no further actions (assumed to be a direct descendant of the\n top state, since any other states must be able to continue\n somehow). @internal\n */\n get deadEnd() {\n if (this.stack.length != 3)\n return false;\n let { parser } = this.p;\n return parser.data[parser.stateSlot(this.state, 1 /* ParseState.Actions */)] == 65535 /* Seq.End */ &&\n !parser.stateSlot(this.state, 4 /* ParseState.DefaultReduce */);\n }\n /**\n Restart the stack (put it back in its start state). Only safe\n when this.stack.length == 3 (state is directly below the top\n state). @internal\n */\n restart() {\n this.storeNode(0 /* Term.Err */, this.pos, this.pos, 4, true);\n this.state = this.stack[0];\n this.stack.length = 0;\n }\n /**\n @internal\n */\n sameState(other) {\n if (this.state != other.state || this.stack.length != other.stack.length)\n return false;\n for (let i = 0; i < this.stack.length; i += 3)\n if (this.stack[i] != other.stack[i])\n return false;\n return true;\n }\n /**\n Get the parser used by this stack.\n */\n get parser() { return this.p.parser; }\n /**\n Test whether a given dialect (by numeric ID, as exported from\n the terms file) is enabled.\n */\n dialectEnabled(dialectID) { return this.p.parser.dialect.flags[dialectID]; }\n shiftContext(term, start) {\n if (this.curContext)\n this.updateContext(this.curContext.tracker.shift(this.curContext.context, term, this, this.p.stream.reset(start)));\n }\n reduceContext(term, start) {\n if (this.curContext)\n this.updateContext(this.curContext.tracker.reduce(this.curContext.context, term, this, this.p.stream.reset(start)));\n }\n /**\n @internal\n */\n emitContext() {\n let last = this.buffer.length - 1;\n if (last < 0 || this.buffer[last] != -3)\n this.buffer.push(this.curContext.hash, this.pos, this.pos, -3);\n }\n /**\n @internal\n */\n emitLookAhead() {\n let last = this.buffer.length - 1;\n if (last < 0 || this.buffer[last] != -4)\n this.buffer.push(this.lookAhead, this.pos, this.pos, -4);\n }\n updateContext(context) {\n if (context != this.curContext.context) {\n let newCx = new StackContext(this.curContext.tracker, context);\n if (newCx.hash != this.curContext.hash)\n this.emitContext();\n this.curContext = newCx;\n }\n }\n /**\n @internal\n */\n setLookAhead(lookAhead) {\n if (lookAhead > this.lookAhead) {\n this.emitLookAhead();\n this.lookAhead = lookAhead;\n }\n }\n /**\n @internal\n */\n close() {\n if (this.curContext && this.curContext.tracker.strict)\n this.emitContext();\n if (this.lookAhead > 0)\n this.emitLookAhead();\n }\n }\n class StackContext {\n constructor(tracker, context) {\n this.tracker = tracker;\n this.context = context;\n this.hash = tracker.strict ? tracker.hash(context) : 0;\n }\n }\n // Used to cheaply run some reductions to scan ahead without mutating\n // an entire stack\n class SimulatedStack {\n constructor(start) {\n this.start = start;\n this.state = start.state;\n this.stack = start.stack;\n this.base = this.stack.length;\n }\n reduce(action) {\n let term = action & 65535 /* Action.ValueMask */, depth = action >> 19 /* Action.ReduceDepthShift */;\n if (depth == 0) {\n if (this.stack == this.start.stack)\n this.stack = this.stack.slice();\n this.stack.push(this.state, 0, 0);\n this.base += 3;\n }\n else {\n this.base -= (depth - 1) * 3;\n }\n let goto = this.start.p.parser.getGoto(this.stack[this.base - 3], term, true);\n this.state = goto;\n }\n }\n // This is given to `Tree.build` to build a buffer, and encapsulates\n // the parent-stack-walking necessary to read the nodes.\n class StackBufferCursor {\n constructor(stack, pos, index) {\n this.stack = stack;\n this.pos = pos;\n this.index = index;\n this.buffer = stack.buffer;\n if (this.index == 0)\n this.maybeNext();\n }\n static create(stack, pos = stack.bufferBase + stack.buffer.length) {\n return new StackBufferCursor(stack, pos, pos - stack.bufferBase);\n }\n maybeNext() {\n let next = this.stack.parent;\n if (next != null) {\n this.index = this.stack.bufferBase - next.bufferBase;\n this.stack = next;\n this.buffer = next.buffer;\n }\n }\n get id() { return this.buffer[this.index - 4]; }\n get start() { return this.buffer[this.index - 3]; }\n get end() { return this.buffer[this.index - 2]; }\n get size() { return this.buffer[this.index - 1]; }\n next() {\n this.index -= 4;\n this.pos -= 4;\n if (this.index == 0)\n this.maybeNext();\n }\n fork() {\n return new StackBufferCursor(this.stack, this.pos, this.index);\n }\n }\n\n // See lezer-generator/src/encode.ts for comments about the encoding\n // used here\n function decodeArray(input, Type = Uint16Array) {\n if (typeof input != \"string\")\n return input;\n let array = null;\n for (let pos = 0, out = 0; pos < input.length;) {\n let value = 0;\n for (;;) {\n let next = input.charCodeAt(pos++), stop = false;\n if (next == 126 /* Encode.BigValCode */) {\n value = 65535 /* Encode.BigVal */;\n break;\n }\n if (next >= 92 /* Encode.Gap2 */)\n next--;\n if (next >= 34 /* Encode.Gap1 */)\n next--;\n let digit = next - 32 /* Encode.Start */;\n if (digit >= 46 /* Encode.Base */) {\n digit -= 46 /* Encode.Base */;\n stop = true;\n }\n value += digit;\n if (stop)\n break;\n value *= 46 /* Encode.Base */;\n }\n if (array)\n array[out++] = value;\n else\n array = new Type(value);\n }\n return array;\n }\n\n class CachedToken {\n constructor() {\n this.start = -1;\n this.value = -1;\n this.end = -1;\n this.extended = -1;\n this.lookAhead = 0;\n this.mask = 0;\n this.context = 0;\n }\n }\n const nullToken = new CachedToken;\n /**\n [Tokenizers](#lr.ExternalTokenizer) interact with the input\n through this interface. It presents the input as a stream of\n characters, tracking lookahead and hiding the complexity of\n [ranges](#common.Parser.parse^ranges) from tokenizer code.\n */\n class InputStream {\n /**\n @internal\n */\n constructor(\n /**\n @internal\n */\n input, \n /**\n @internal\n */\n ranges) {\n this.input = input;\n this.ranges = ranges;\n /**\n @internal\n */\n this.chunk = \"\";\n /**\n @internal\n */\n this.chunkOff = 0;\n /**\n Backup chunk\n */\n this.chunk2 = \"\";\n this.chunk2Pos = 0;\n /**\n The character code of the next code unit in the input, or -1\n when the stream is at the end of the input.\n */\n this.next = -1;\n /**\n @internal\n */\n this.token = nullToken;\n this.rangeIndex = 0;\n this.pos = this.chunkPos = ranges[0].from;\n this.range = ranges[0];\n this.end = ranges[ranges.length - 1].to;\n this.readNext();\n }\n /**\n @internal\n */\n resolveOffset(offset, assoc) {\n let range = this.range, index = this.rangeIndex;\n let pos = this.pos + offset;\n while (pos < range.from) {\n if (!index)\n return null;\n let next = this.ranges[--index];\n pos -= range.from - next.to;\n range = next;\n }\n while (assoc < 0 ? pos > range.to : pos >= range.to) {\n if (index == this.ranges.length - 1)\n return null;\n let next = this.ranges[++index];\n pos += next.from - range.to;\n range = next;\n }\n return pos;\n }\n /**\n @internal\n */\n clipPos(pos) {\n if (pos >= this.range.from && pos < this.range.to)\n return pos;\n for (let range of this.ranges)\n if (range.to > pos)\n return Math.max(pos, range.from);\n return this.end;\n }\n /**\n Look at a code unit near the stream position. `.peek(0)` equals\n `.next`, `.peek(-1)` gives you the previous character, and so\n on.\n \n Note that looking around during tokenizing creates dependencies\n on potentially far-away content, which may reduce the\n effectiveness incremental parsing\u2014when looking forward\u2014or even\n cause invalid reparses when looking backward more than 25 code\n units, since the library does not track lookbehind.\n */\n peek(offset) {\n let idx = this.chunkOff + offset, pos, result;\n if (idx >= 0 && idx < this.chunk.length) {\n pos = this.pos + offset;\n result = this.chunk.charCodeAt(idx);\n }\n else {\n let resolved = this.resolveOffset(offset, 1);\n if (resolved == null)\n return -1;\n pos = resolved;\n if (pos >= this.chunk2Pos && pos < this.chunk2Pos + this.chunk2.length) {\n result = this.chunk2.charCodeAt(pos - this.chunk2Pos);\n }\n else {\n let i = this.rangeIndex, range = this.range;\n while (range.to <= pos)\n range = this.ranges[++i];\n this.chunk2 = this.input.chunk(this.chunk2Pos = pos);\n if (pos + this.chunk2.length > range.to)\n this.chunk2 = this.chunk2.slice(0, range.to - pos);\n result = this.chunk2.charCodeAt(0);\n }\n }\n if (pos >= this.token.lookAhead)\n this.token.lookAhead = pos + 1;\n return result;\n }\n /**\n Accept a token. By default, the end of the token is set to the\n current stream position, but you can pass an offset (relative to\n the stream position) to change that.\n */\n acceptToken(token, endOffset = 0) {\n let end = endOffset ? this.resolveOffset(endOffset, -1) : this.pos;\n if (end == null || end < this.token.start)\n throw new RangeError(\"Token end out of bounds\");\n this.token.value = token;\n this.token.end = end;\n }\n /**\n Accept a token ending at a specific given position.\n */\n acceptTokenTo(token, endPos) {\n this.token.value = token;\n this.token.end = endPos;\n }\n getChunk() {\n if (this.pos >= this.chunk2Pos && this.pos < this.chunk2Pos + this.chunk2.length) {\n let { chunk, chunkPos } = this;\n this.chunk = this.chunk2;\n this.chunkPos = this.chunk2Pos;\n this.chunk2 = chunk;\n this.chunk2Pos = chunkPos;\n this.chunkOff = this.pos - this.chunkPos;\n }\n else {\n this.chunk2 = this.chunk;\n this.chunk2Pos = this.chunkPos;\n let nextChunk = this.input.chunk(this.pos);\n let end = this.pos + nextChunk.length;\n this.chunk = end > this.range.to ? nextChunk.slice(0, this.range.to - this.pos) : nextChunk;\n this.chunkPos = this.pos;\n this.chunkOff = 0;\n }\n }\n readNext() {\n if (this.chunkOff >= this.chunk.length) {\n this.getChunk();\n if (this.chunkOff == this.chunk.length)\n return this.next = -1;\n }\n return this.next = this.chunk.charCodeAt(this.chunkOff);\n }\n /**\n Move the stream forward N (defaults to 1) code units. Returns\n the new value of [`next`](#lr.InputStream.next).\n */\n advance(n = 1) {\n this.chunkOff += n;\n while (this.pos + n >= this.range.to) {\n if (this.rangeIndex == this.ranges.length - 1)\n return this.setDone();\n n -= this.range.to - this.pos;\n this.range = this.ranges[++this.rangeIndex];\n this.pos = this.range.from;\n }\n this.pos += n;\n if (this.pos >= this.token.lookAhead)\n this.token.lookAhead = this.pos + 1;\n return this.readNext();\n }\n setDone() {\n this.pos = this.chunkPos = this.end;\n this.range = this.ranges[this.rangeIndex = this.ranges.length - 1];\n this.chunk = \"\";\n return this.next = -1;\n }\n /**\n @internal\n */\n reset(pos, token) {\n if (token) {\n this.token = token;\n token.start = pos;\n token.lookAhead = pos + 1;\n token.value = token.extended = -1;\n }\n else {\n this.token = nullToken;\n }\n if (this.pos != pos) {\n this.pos = pos;\n if (pos == this.end) {\n this.setDone();\n return this;\n }\n while (pos < this.range.from)\n this.range = this.ranges[--this.rangeIndex];\n while (pos >= this.range.to)\n this.range = this.ranges[++this.rangeIndex];\n if (pos >= this.chunkPos && pos < this.chunkPos + this.chunk.length) {\n this.chunkOff = pos - this.chunkPos;\n }\n else {\n this.chunk = \"\";\n this.chunkOff = 0;\n }\n this.readNext();\n }\n return this;\n }\n /**\n @internal\n */\n read(from, to) {\n if (from >= this.chunkPos && to <= this.chunkPos + this.chunk.length)\n return this.chunk.slice(from - this.chunkPos, to - this.chunkPos);\n if (from >= this.chunk2Pos && to <= this.chunk2Pos + this.chunk2.length)\n return this.chunk2.slice(from - this.chunk2Pos, to - this.chunk2Pos);\n if (from >= this.range.from && to <= this.range.to)\n return this.input.read(from, to);\n let result = \"\";\n for (let r of this.ranges) {\n if (r.from >= to)\n break;\n if (r.to > from)\n result += this.input.read(Math.max(r.from, from), Math.min(r.to, to));\n }\n return result;\n }\n }\n /**\n @internal\n */\n class TokenGroup {\n constructor(data, id) {\n this.data = data;\n this.id = id;\n }\n token(input, stack) {\n let { parser } = stack.p;\n readToken(this.data, input, stack, this.id, parser.data, parser.tokenPrecTable);\n }\n }\n TokenGroup.prototype.contextual = TokenGroup.prototype.fallback = TokenGroup.prototype.extend = false;\n /**\n @hide\n */\n class LocalTokenGroup {\n constructor(data, precTable, elseToken) {\n this.precTable = precTable;\n this.elseToken = elseToken;\n this.data = typeof data == \"string\" ? decodeArray(data) : data;\n }\n token(input, stack) {\n let start = input.pos, skipped = 0;\n for (;;) {\n let atEof = input.next < 0, nextPos = input.resolveOffset(1, 1);\n readToken(this.data, input, stack, 0, this.data, this.precTable);\n if (input.token.value > -1)\n break;\n if (this.elseToken == null)\n return;\n if (!atEof)\n skipped++;\n if (nextPos == null)\n break;\n input.reset(nextPos, input.token);\n }\n if (skipped) {\n input.reset(start, input.token);\n input.acceptToken(this.elseToken, skipped);\n }\n }\n }\n LocalTokenGroup.prototype.contextual = TokenGroup.prototype.fallback = TokenGroup.prototype.extend = false;\n /**\n `@external tokens` declarations in the grammar should resolve to\n an instance of this class.\n */\n class ExternalTokenizer {\n /**\n Create a tokenizer. The first argument is the function that,\n given an input stream, scans for the types of tokens it\n recognizes at the stream's position, and calls\n [`acceptToken`](#lr.InputStream.acceptToken) when it finds\n one.\n */\n constructor(\n /**\n @internal\n */\n token, options = {}) {\n this.token = token;\n this.contextual = !!options.contextual;\n this.fallback = !!options.fallback;\n this.extend = !!options.extend;\n }\n }\n // Tokenizer data is stored a big uint16 array containing, for each\n // state:\n //\n // - A group bitmask, indicating what token groups are reachable from\n // this state, so that paths that can only lead to tokens not in\n // any of the current groups can be cut off early.\n //\n // - The position of the end of the state's sequence of accepting\n // tokens\n //\n // - The number of outgoing edges for the state\n //\n // - The accepting tokens, as (token id, group mask) pairs\n //\n // - The outgoing edges, as (start character, end character, state\n // index) triples, with end character being exclusive\n //\n // This function interprets that data, running through a stream as\n // long as new states with the a matching group mask can be reached,\n // and updating `input.token` when it matches a token.\n function readToken(data, input, stack, group, precTable, precOffset) {\n let state = 0, groupMask = 1 << group, { dialect } = stack.p.parser;\n scan: for (;;) {\n if ((groupMask & data[state]) == 0)\n break;\n let accEnd = data[state + 1];\n // Check whether this state can lead to a token in the current group\n // Accept tokens in this state, possibly overwriting\n // lower-precedence / shorter tokens\n for (let i = state + 3; i < accEnd; i += 2)\n if ((data[i + 1] & groupMask) > 0) {\n let term = data[i];\n if (dialect.allows(term) &&\n (input.token.value == -1 || input.token.value == term ||\n overrides(term, input.token.value, precTable, precOffset))) {\n input.acceptToken(term);\n break;\n }\n }\n let next = input.next, low = 0, high = data[state + 2];\n // Special case for EOF\n if (input.next < 0 && high > low && data[accEnd + high * 3 - 3] == 65535 /* Seq.End */) {\n state = data[accEnd + high * 3 - 1];\n continue scan;\n }\n // Do a binary search on the state's edges\n for (; low < high;) {\n let mid = (low + high) >> 1;\n let index = accEnd + mid + (mid << 1);\n let from = data[index], to = data[index + 1] || 0x10000;\n if (next < from)\n high = mid;\n else if (next >= to)\n low = mid + 1;\n else {\n state = data[index + 2];\n input.advance();\n continue scan;\n }\n }\n break;\n }\n }\n function findOffset(data, start, term) {\n for (let i = start, next; (next = data[i]) != 65535 /* Seq.End */; i++)\n if (next == term)\n return i - start;\n return -1;\n }\n function overrides(token, prev, tableData, tableOffset) {\n let iPrev = findOffset(tableData, tableOffset, prev);\n return iPrev < 0 || findOffset(tableData, tableOffset, token) < iPrev;\n }\n\n // Environment variable used to control console output\n const verbose = typeof process != \"undefined\" && process.env && /\\bparse\\b/.test(process.env.LOG);\n let stackIDs = null;\n function cutAt(tree, pos, side) {\n let cursor = tree.cursor(IterMode.IncludeAnonymous);\n cursor.moveTo(pos);\n for (;;) {\n if (!(side < 0 ? cursor.childBefore(pos) : cursor.childAfter(pos)))\n for (;;) {\n if ((side < 0 ? cursor.to < pos : cursor.from > pos) && !cursor.type.isError)\n return side < 0 ? Math.max(0, Math.min(cursor.to - 1, pos - 25 /* Lookahead.Margin */))\n : Math.min(tree.length, Math.max(cursor.from + 1, pos + 25 /* Lookahead.Margin */));\n if (side < 0 ? cursor.prevSibling() : cursor.nextSibling())\n break;\n if (!cursor.parent())\n return side < 0 ? 0 : tree.length;\n }\n }\n }\n class FragmentCursor {\n constructor(fragments, nodeSet) {\n this.fragments = fragments;\n this.nodeSet = nodeSet;\n this.i = 0;\n this.fragment = null;\n this.safeFrom = -1;\n this.safeTo = -1;\n this.trees = [];\n this.start = [];\n this.index = [];\n this.nextFragment();\n }\n nextFragment() {\n let fr = this.fragment = this.i == this.fragments.length ? null : this.fragments[this.i++];\n if (fr) {\n this.safeFrom = fr.openStart ? cutAt(fr.tree, fr.from + fr.offset, 1) - fr.offset : fr.from;\n this.safeTo = fr.openEnd ? cutAt(fr.tree, fr.to + fr.offset, -1) - fr.offset : fr.to;\n while (this.trees.length) {\n this.trees.pop();\n this.start.pop();\n this.index.pop();\n }\n this.trees.push(fr.tree);\n this.start.push(-fr.offset);\n this.index.push(0);\n this.nextStart = this.safeFrom;\n }\n else {\n this.nextStart = 1e9;\n }\n }\n // `pos` must be >= any previously given `pos` for this cursor\n nodeAt(pos) {\n if (pos < this.nextStart)\n return null;\n while (this.fragment && this.safeTo <= pos)\n this.nextFragment();\n if (!this.fragment)\n return null;\n for (;;) {\n let last = this.trees.length - 1;\n if (last < 0) { // End of tree\n this.nextFragment();\n return null;\n }\n let top = this.trees[last], index = this.index[last];\n if (index == top.children.length) {\n this.trees.pop();\n this.start.pop();\n this.index.pop();\n continue;\n }\n let next = top.children[index];\n let start = this.start[last] + top.positions[index];\n if (start > pos) {\n this.nextStart = start;\n return null;\n }\n if (next instanceof Tree) {\n if (start == pos) {\n if (start < this.safeFrom)\n return null;\n let end = start + next.length;\n if (end <= this.safeTo) {\n let lookAhead = next.prop(NodeProp.lookAhead);\n if (!lookAhead || end + lookAhead < this.fragment.to)\n return next;\n }\n }\n this.index[last]++;\n if (start + next.length >= Math.max(this.safeFrom, pos)) { // Enter this node\n this.trees.push(next);\n this.start.push(start);\n this.index.push(0);\n }\n }\n else {\n this.index[last]++;\n this.nextStart = start + next.length;\n }\n }\n }\n }\n class TokenCache {\n constructor(parser, stream) {\n this.stream = stream;\n this.tokens = [];\n this.mainToken = null;\n this.actions = [];\n this.tokens = parser.tokenizers.map(_ => new CachedToken);\n }\n getActions(stack) {\n let actionIndex = 0;\n let main = null;\n let { parser } = stack.p, { tokenizers } = parser;\n let mask = parser.stateSlot(stack.state, 3 /* ParseState.TokenizerMask */);\n let context = stack.curContext ? stack.curContext.hash : 0;\n let lookAhead = 0;\n for (let i = 0; i < tokenizers.length; i++) {\n if (((1 << i) & mask) == 0)\n continue;\n let tokenizer = tokenizers[i], token = this.tokens[i];\n if (main && !tokenizer.fallback)\n continue;\n if (tokenizer.contextual || token.start != stack.pos || token.mask != mask || token.context != context) {\n this.updateCachedToken(token, tokenizer, stack);\n token.mask = mask;\n token.context = context;\n }\n if (token.lookAhead > token.end + 25 /* Lookahead.Margin */)\n lookAhead = Math.max(token.lookAhead, lookAhead);\n if (token.value != 0 /* Term.Err */) {\n let startIndex = actionIndex;\n if (token.extended > -1)\n actionIndex = this.addActions(stack, token.extended, token.end, actionIndex);\n actionIndex = this.addActions(stack, token.value, token.end, actionIndex);\n if (!tokenizer.extend) {\n main = token;\n if (actionIndex > startIndex)\n break;\n }\n }\n }\n while (this.actions.length > actionIndex)\n this.actions.pop();\n if (lookAhead)\n stack.setLookAhead(lookAhead);\n if (!main && stack.pos == this.stream.end) {\n main = new CachedToken;\n main.value = stack.p.parser.eofTerm;\n main.start = main.end = stack.pos;\n actionIndex = this.addActions(stack, main.value, main.end, actionIndex);\n }\n this.mainToken = main;\n return this.actions;\n }\n getMainToken(stack) {\n if (this.mainToken)\n return this.mainToken;\n let main = new CachedToken, { pos, p } = stack;\n main.start = pos;\n main.end = Math.min(pos + 1, p.stream.end);\n main.value = pos == p.stream.end ? p.parser.eofTerm : 0 /* Term.Err */;\n return main;\n }\n updateCachedToken(token, tokenizer, stack) {\n let start = this.stream.clipPos(stack.pos);\n tokenizer.token(this.stream.reset(start, token), stack);\n if (token.value > -1) {\n let { parser } = stack.p;\n for (let i = 0; i < parser.specialized.length; i++)\n if (parser.specialized[i] == token.value) {\n let result = parser.specializers[i](this.stream.read(token.start, token.end), stack);\n if (result >= 0 && stack.p.parser.dialect.allows(result >> 1)) {\n if ((result & 1) == 0 /* Specialize.Specialize */)\n token.value = result >> 1;\n else\n token.extended = result >> 1;\n break;\n }\n }\n }\n else {\n token.value = 0 /* Term.Err */;\n token.end = this.stream.clipPos(start + 1);\n }\n }\n putAction(action, token, end, index) {\n // Don't add duplicate actions\n for (let i = 0; i < index; i += 3)\n if (this.actions[i] == action)\n return index;\n this.actions[index++] = action;\n this.actions[index++] = token;\n this.actions[index++] = end;\n return index;\n }\n addActions(stack, token, end, index) {\n let { state } = stack, { parser } = stack.p, { data } = parser;\n for (let set = 0; set < 2; set++) {\n for (let i = parser.stateSlot(state, set ? 2 /* ParseState.Skip */ : 1 /* ParseState.Actions */);; i += 3) {\n if (data[i] == 65535 /* Seq.End */) {\n if (data[i + 1] == 1 /* Seq.Next */) {\n i = pair(data, i + 2);\n }\n else {\n if (index == 0 && data[i + 1] == 2 /* Seq.Other */)\n index = this.putAction(pair(data, i + 2), token, end, index);\n break;\n }\n }\n if (data[i] == token)\n index = this.putAction(pair(data, i + 1), token, end, index);\n }\n }\n return index;\n }\n }\n class Parse {\n constructor(parser, input, fragments, ranges) {\n this.parser = parser;\n this.input = input;\n this.ranges = ranges;\n this.recovering = 0;\n this.nextStackID = 0x2654; // \u2654, \u2655, \u2656, \u2657, \u2658, \u2659, \u2660, \u2661, \u2662, \u2663, \u2664, \u2665, \u2666, \u2667\n this.minStackPos = 0;\n this.reused = [];\n this.stoppedAt = null;\n this.lastBigReductionStart = -1;\n this.lastBigReductionSize = 0;\n this.bigReductionCount = 0;\n this.stream = new InputStream(input, ranges);\n this.tokens = new TokenCache(parser, this.stream);\n this.topTerm = parser.top[1];\n let { from } = ranges[0];\n this.stacks = [Stack.start(this, parser.top[0], from)];\n this.fragments = fragments.length && this.stream.end - from > parser.bufferLength * 4\n ? new FragmentCursor(fragments, parser.nodeSet) : null;\n }\n get parsedPos() {\n return this.minStackPos;\n }\n // Move the parser forward. This will process all parse stacks at\n // `this.pos` and try to advance them to a further position. If no\n // stack for such a position is found, it'll start error-recovery.\n //\n // When the parse is finished, this will return a syntax tree. When\n // not, it returns `null`.\n advance() {\n let stacks = this.stacks, pos = this.minStackPos;\n // This will hold stacks beyond `pos`.\n let newStacks = this.stacks = [];\n let stopped, stoppedTokens;\n // If a large amount of reductions happened with the same start\n // position, force the stack out of that production in order to\n // avoid creating a tree too deep to recurse through.\n // (This is an ugly kludge, because unfortunately there is no\n // straightforward, cheap way to check for this happening, due to\n // the history of reductions only being available in an\n // expensive-to-access format in the stack buffers.)\n if (this.bigReductionCount > 300 /* Rec.MaxLeftAssociativeReductionCount */ && stacks.length == 1) {\n let [s] = stacks;\n while (s.forceReduce() && s.stack.length && s.stack[s.stack.length - 2] >= this.lastBigReductionStart) { }\n this.bigReductionCount = this.lastBigReductionSize = 0;\n }\n // Keep advancing any stacks at `pos` until they either move\n // forward or can't be advanced. Gather stacks that can't be\n // advanced further in `stopped`.\n for (let i = 0; i < stacks.length; i++) {\n let stack = stacks[i];\n for (;;) {\n this.tokens.mainToken = null;\n if (stack.pos > pos) {\n newStacks.push(stack);\n }\n else if (this.advanceStack(stack, newStacks, stacks)) {\n continue;\n }\n else {\n if (!stopped) {\n stopped = [];\n stoppedTokens = [];\n }\n stopped.push(stack);\n let tok = this.tokens.getMainToken(stack);\n stoppedTokens.push(tok.value, tok.end);\n }\n break;\n }\n }\n if (!newStacks.length) {\n let finished = stopped && findFinished(stopped);\n if (finished) {\n if (verbose)\n console.log(\"Finish with \" + this.stackID(finished));\n return this.stackToTree(finished);\n }\n if (this.parser.strict) {\n if (verbose && stopped)\n console.log(\"Stuck with token \" + (this.tokens.mainToken ? this.parser.getName(this.tokens.mainToken.value) : \"none\"));\n throw new SyntaxError(\"No parse at \" + pos);\n }\n if (!this.recovering)\n this.recovering = 5 /* Rec.Distance */;\n }\n if (this.recovering && stopped) {\n let finished = this.stoppedAt != null && stopped[0].pos > this.stoppedAt ? stopped[0]\n : this.runRecovery(stopped, stoppedTokens, newStacks);\n if (finished) {\n if (verbose)\n console.log(\"Force-finish \" + this.stackID(finished));\n return this.stackToTree(finished.forceAll());\n }\n }\n if (this.recovering) {\n let maxRemaining = this.recovering == 1 ? 1 : this.recovering * 3 /* Rec.MaxRemainingPerStep */;\n if (newStacks.length > maxRemaining) {\n newStacks.sort((a, b) => b.score - a.score);\n while (newStacks.length > maxRemaining)\n newStacks.pop();\n }\n if (newStacks.some(s => s.reducePos > pos))\n this.recovering--;\n }\n else if (newStacks.length > 1) {\n // Prune stacks that are in the same state, or that have been\n // running without splitting for a while, to avoid getting stuck\n // with multiple successful stacks running endlessly on.\n outer: for (let i = 0; i < newStacks.length - 1; i++) {\n let stack = newStacks[i];\n for (let j = i + 1; j < newStacks.length; j++) {\n let other = newStacks[j];\n if (stack.sameState(other) ||\n stack.buffer.length > 500 /* Rec.MinBufferLengthPrune */ && other.buffer.length > 500 /* Rec.MinBufferLengthPrune */) {\n if (((stack.score - other.score) || (stack.buffer.length - other.buffer.length)) > 0) {\n newStacks.splice(j--, 1);\n }\n else {\n newStacks.splice(i--, 1);\n continue outer;\n }\n }\n }\n }\n if (newStacks.length > 12 /* Rec.MaxStackCount */)\n newStacks.splice(12 /* Rec.MaxStackCount */, newStacks.length - 12 /* Rec.MaxStackCount */);\n }\n this.minStackPos = newStacks[0].pos;\n for (let i = 1; i < newStacks.length; i++)\n if (newStacks[i].pos < this.minStackPos)\n this.minStackPos = newStacks[i].pos;\n return null;\n }\n stopAt(pos) {\n if (this.stoppedAt != null && this.stoppedAt < pos)\n throw new RangeError(\"Can't move stoppedAt forward\");\n this.stoppedAt = pos;\n }\n // Returns an updated version of the given stack, or null if the\n // stack can't advance normally. When `split` and `stacks` are\n // given, stacks split off by ambiguous operations will be pushed to\n // `split`, or added to `stacks` if they move `pos` forward.\n advanceStack(stack, stacks, split) {\n let start = stack.pos, { parser } = this;\n let base = verbose ? this.stackID(stack) + \" -> \" : \"\";\n if (this.stoppedAt != null && start > this.stoppedAt)\n return stack.forceReduce() ? stack : null;\n if (this.fragments) {\n let strictCx = stack.curContext && stack.curContext.tracker.strict, cxHash = strictCx ? stack.curContext.hash : 0;\n for (let cached = this.fragments.nodeAt(start); cached;) {\n let match = this.parser.nodeSet.types[cached.type.id] == cached.type ? parser.getGoto(stack.state, cached.type.id) : -1;\n if (match > -1 && cached.length && (!strictCx || (cached.prop(NodeProp.contextHash) || 0) == cxHash)) {\n stack.useNode(cached, match);\n if (verbose)\n console.log(base + this.stackID(stack) + ` (via reuse of ${parser.getName(cached.type.id)})`);\n return true;\n }\n if (!(cached instanceof Tree) || cached.children.length == 0 || cached.positions[0] > 0)\n break;\n let inner = cached.children[0];\n if (inner instanceof Tree && cached.positions[0] == 0)\n cached = inner;\n else\n break;\n }\n }\n let defaultReduce = parser.stateSlot(stack.state, 4 /* ParseState.DefaultReduce */);\n if (defaultReduce > 0) {\n stack.reduce(defaultReduce);\n if (verbose)\n console.log(base + this.stackID(stack) + ` (via always-reduce ${parser.getName(defaultReduce & 65535 /* Action.ValueMask */)})`);\n return true;\n }\n if (stack.stack.length >= 8400 /* Rec.CutDepth */) {\n while (stack.stack.length > 6000 /* Rec.CutTo */ && stack.forceReduce()) { }\n }\n let actions = this.tokens.getActions(stack);\n for (let i = 0; i < actions.length;) {\n let action = actions[i++], term = actions[i++], end = actions[i++];\n let last = i == actions.length || !split;\n let localStack = last ? stack : stack.split();\n let main = this.tokens.mainToken;\n localStack.apply(action, term, main ? main.start : localStack.pos, end);\n if (verbose)\n console.log(base + this.stackID(localStack) + ` (via ${(action & 65536 /* Action.ReduceFlag */) == 0 ? \"shift\"\n : `reduce of ${parser.getName(action & 65535 /* Action.ValueMask */)}`} for ${parser.getName(term)} @ ${start}${localStack == stack ? \"\" : \", split\"})`);\n if (last)\n return true;\n else if (localStack.pos > start)\n stacks.push(localStack);\n else\n split.push(localStack);\n }\n return false;\n }\n // Advance a given stack forward as far as it will go. Returns the\n // (possibly updated) stack if it got stuck, or null if it moved\n // forward and was given to `pushStackDedup`.\n advanceFully(stack, newStacks) {\n let pos = stack.pos;\n for (;;) {\n if (!this.advanceStack(stack, null, null))\n return false;\n if (stack.pos > pos) {\n pushStackDedup(stack, newStacks);\n return true;\n }\n }\n }\n runRecovery(stacks, tokens, newStacks) {\n let finished = null, restarted = false;\n for (let i = 0; i < stacks.length; i++) {\n let stack = stacks[i], token = tokens[i << 1], tokenEnd = tokens[(i << 1) + 1];\n let base = verbose ? this.stackID(stack) + \" -> \" : \"\";\n if (stack.deadEnd) {\n if (restarted)\n continue;\n restarted = true;\n stack.restart();\n if (verbose)\n console.log(base + this.stackID(stack) + \" (restarted)\");\n let done = this.advanceFully(stack, newStacks);\n if (done)\n continue;\n }\n let force = stack.split(), forceBase = base;\n for (let j = 0; force.forceReduce() && j < 10 /* Rec.ForceReduceLimit */; j++) {\n if (verbose)\n console.log(forceBase + this.stackID(force) + \" (via force-reduce)\");\n let done = this.advanceFully(force, newStacks);\n if (done)\n break;\n if (verbose)\n forceBase = this.stackID(force) + \" -> \";\n }\n for (let insert of stack.recoverByInsert(token)) {\n if (verbose)\n console.log(base + this.stackID(insert) + \" (via recover-insert)\");\n this.advanceFully(insert, newStacks);\n }\n if (this.stream.end > stack.pos) {\n if (tokenEnd == stack.pos) {\n tokenEnd++;\n token = 0 /* Term.Err */;\n }\n stack.recoverByDelete(token, tokenEnd);\n if (verbose)\n console.log(base + this.stackID(stack) + ` (via recover-delete ${this.parser.getName(token)})`);\n pushStackDedup(stack, newStacks);\n }\n else if (!finished || finished.score < stack.score) {\n finished = stack;\n }\n }\n return finished;\n }\n // Convert the stack's buffer to a syntax tree.\n stackToTree(stack) {\n stack.close();\n return Tree.build({ buffer: StackBufferCursor.create(stack),\n nodeSet: this.parser.nodeSet,\n topID: this.topTerm,\n maxBufferLength: this.parser.bufferLength,\n reused: this.reused,\n start: this.ranges[0].from,\n length: stack.pos - this.ranges[0].from,\n minRepeatType: this.parser.minRepeatTerm });\n }\n stackID(stack) {\n let id = (stackIDs || (stackIDs = new WeakMap)).get(stack);\n if (!id)\n stackIDs.set(stack, id = String.fromCodePoint(this.nextStackID++));\n return id + stack;\n }\n }\n function pushStackDedup(stack, newStacks) {\n for (let i = 0; i < newStacks.length; i++) {\n let other = newStacks[i];\n if (other.pos == stack.pos && other.sameState(stack)) {\n if (newStacks[i].score < stack.score)\n newStacks[i] = stack;\n return;\n }\n }\n newStacks.push(stack);\n }\n class Dialect {\n constructor(source, flags, disabled) {\n this.source = source;\n this.flags = flags;\n this.disabled = disabled;\n }\n allows(term) { return !this.disabled || this.disabled[term] == 0; }\n }\n const id = x => x;\n /**\n Context trackers are used to track stateful context (such as\n indentation in the Python grammar, or parent elements in the XML\n grammar) needed by external tokenizers. You declare them in a\n grammar file as `@context exportName from \"module\"`.\n\n Context values should be immutable, and can be updated (replaced)\n on shift or reduce actions.\n\n The export used in a `@context` declaration should be of this\n type.\n */\n class ContextTracker {\n /**\n Define a context tracker.\n */\n constructor(spec) {\n this.start = spec.start;\n this.shift = spec.shift || id;\n this.reduce = spec.reduce || id;\n this.reuse = spec.reuse || id;\n this.hash = spec.hash || (() => 0);\n this.strict = spec.strict !== false;\n }\n }\n /**\n Holds the parse tables for a given grammar, as generated by\n `lezer-generator`, and provides [methods](#common.Parser) to parse\n content with.\n */\n class LRParser extends Parser {\n /**\n @internal\n */\n constructor(spec) {\n super();\n /**\n @internal\n */\n this.wrappers = [];\n if (spec.version != 14 /* File.Version */)\n throw new RangeError(`Parser version (${spec.version}) doesn't match runtime version (${14 /* File.Version */})`);\n let nodeNames = spec.nodeNames.split(\" \");\n this.minRepeatTerm = nodeNames.length;\n for (let i = 0; i < spec.repeatNodeCount; i++)\n nodeNames.push(\"\");\n let topTerms = Object.keys(spec.topRules).map(r => spec.topRules[r][1]);\n let nodeProps = [];\n for (let i = 0; i < nodeNames.length; i++)\n nodeProps.push([]);\n function setProp(nodeID, prop, value) {\n nodeProps[nodeID].push([prop, prop.deserialize(String(value))]);\n }\n if (spec.nodeProps)\n for (let propSpec of spec.nodeProps) {\n let prop = propSpec[0];\n if (typeof prop == \"string\")\n prop = NodeProp[prop];\n for (let i = 1; i < propSpec.length;) {\n let next = propSpec[i++];\n if (next >= 0) {\n setProp(next, prop, propSpec[i++]);\n }\n else {\n let value = propSpec[i + -next];\n for (let j = -next; j > 0; j--)\n setProp(propSpec[i++], prop, value);\n i++;\n }\n }\n }\n this.nodeSet = new NodeSet(nodeNames.map((name, i) => NodeType.define({\n name: i >= this.minRepeatTerm ? undefined : name,\n id: i,\n props: nodeProps[i],\n top: topTerms.indexOf(i) > -1,\n error: i == 0,\n skipped: spec.skippedNodes && spec.skippedNodes.indexOf(i) > -1\n })));\n if (spec.propSources)\n this.nodeSet = this.nodeSet.extend(...spec.propSources);\n this.strict = false;\n this.bufferLength = DefaultBufferLength;\n let tokenArray = decodeArray(spec.tokenData);\n this.context = spec.context;\n this.specializerSpecs = spec.specialized || [];\n this.specialized = new Uint16Array(this.specializerSpecs.length);\n for (let i = 0; i < this.specializerSpecs.length; i++)\n this.specialized[i] = this.specializerSpecs[i].term;\n this.specializers = this.specializerSpecs.map(getSpecializer);\n this.states = decodeArray(spec.states, Uint32Array);\n this.data = decodeArray(spec.stateData);\n this.goto = decodeArray(spec.goto);\n this.maxTerm = spec.maxTerm;\n this.tokenizers = spec.tokenizers.map(value => typeof value == \"number\" ? new TokenGroup(tokenArray, value) : value);\n this.topRules = spec.topRules;\n this.dialects = spec.dialects || {};\n this.dynamicPrecedences = spec.dynamicPrecedences || null;\n this.tokenPrecTable = spec.tokenPrec;\n this.termNames = spec.termNames || null;\n this.maxNode = this.nodeSet.types.length - 1;\n this.dialect = this.parseDialect();\n this.top = this.topRules[Object.keys(this.topRules)[0]];\n }\n createParse(input, fragments, ranges) {\n let parse = new Parse(this, input, fragments, ranges);\n for (let w of this.wrappers)\n parse = w(parse, input, fragments, ranges);\n return parse;\n }\n /**\n Get a goto table entry @internal\n */\n getGoto(state, term, loose = false) {\n let table = this.goto;\n if (term >= table[0])\n return -1;\n for (let pos = table[term + 1];;) {\n let groupTag = table[pos++], last = groupTag & 1;\n let target = table[pos++];\n if (last && loose)\n return target;\n for (let end = pos + (groupTag >> 1); pos < end; pos++)\n if (table[pos] == state)\n return target;\n if (last)\n return -1;\n }\n }\n /**\n Check if this state has an action for a given terminal @internal\n */\n hasAction(state, terminal) {\n let data = this.data;\n for (let set = 0; set < 2; set++) {\n for (let i = this.stateSlot(state, set ? 2 /* ParseState.Skip */ : 1 /* ParseState.Actions */), next;; i += 3) {\n if ((next = data[i]) == 65535 /* Seq.End */) {\n if (data[i + 1] == 1 /* Seq.Next */)\n next = data[i = pair(data, i + 2)];\n else if (data[i + 1] == 2 /* Seq.Other */)\n return pair(data, i + 2);\n else\n break;\n }\n if (next == terminal || next == 0 /* Term.Err */)\n return pair(data, i + 1);\n }\n }\n return 0;\n }\n /**\n @internal\n */\n stateSlot(state, slot) {\n return this.states[(state * 6 /* ParseState.Size */) + slot];\n }\n /**\n @internal\n */\n stateFlag(state, flag) {\n return (this.stateSlot(state, 0 /* ParseState.Flags */) & flag) > 0;\n }\n /**\n @internal\n */\n validAction(state, action) {\n return !!this.allActions(state, a => a == action ? true : null);\n }\n /**\n @internal\n */\n allActions(state, action) {\n let deflt = this.stateSlot(state, 4 /* ParseState.DefaultReduce */);\n let result = deflt ? action(deflt) : undefined;\n for (let i = this.stateSlot(state, 1 /* ParseState.Actions */); result == null; i += 3) {\n if (this.data[i] == 65535 /* Seq.End */) {\n if (this.data[i + 1] == 1 /* Seq.Next */)\n i = pair(this.data, i + 2);\n else\n break;\n }\n result = action(pair(this.data, i + 1));\n }\n return result;\n }\n /**\n Get the states that can follow this one through shift actions or\n goto jumps. @internal\n */\n nextStates(state) {\n let result = [];\n for (let i = this.stateSlot(state, 1 /* ParseState.Actions */);; i += 3) {\n if (this.data[i] == 65535 /* Seq.End */) {\n if (this.data[i + 1] == 1 /* Seq.Next */)\n i = pair(this.data, i + 2);\n else\n break;\n }\n if ((this.data[i + 2] & (65536 /* Action.ReduceFlag */ >> 16)) == 0) {\n let value = this.data[i + 1];\n if (!result.some((v, i) => (i & 1) && v == value))\n result.push(this.data[i], value);\n }\n }\n return result;\n }\n /**\n Configure the parser. Returns a new parser instance that has the\n given settings modified. Settings not provided in `config` are\n kept from the original parser.\n */\n configure(config) {\n // Hideous reflection-based kludge to make it easy to create a\n // slightly modified copy of a parser.\n let copy = Object.assign(Object.create(LRParser.prototype), this);\n if (config.props)\n copy.nodeSet = this.nodeSet.extend(...config.props);\n if (config.top) {\n let info = this.topRules[config.top];\n if (!info)\n throw new RangeError(`Invalid top rule name ${config.top}`);\n copy.top = info;\n }\n if (config.tokenizers)\n copy.tokenizers = this.tokenizers.map(t => {\n let found = config.tokenizers.find(r => r.from == t);\n return found ? found.to : t;\n });\n if (config.specializers) {\n copy.specializers = this.specializers.slice();\n copy.specializerSpecs = this.specializerSpecs.map((s, i) => {\n let found = config.specializers.find(r => r.from == s.external);\n if (!found)\n return s;\n let spec = Object.assign(Object.assign({}, s), { external: found.to });\n copy.specializers[i] = getSpecializer(spec);\n return spec;\n });\n }\n if (config.contextTracker)\n copy.context = config.contextTracker;\n if (config.dialect)\n copy.dialect = this.parseDialect(config.dialect);\n if (config.strict != null)\n copy.strict = config.strict;\n if (config.wrap)\n copy.wrappers = copy.wrappers.concat(config.wrap);\n if (config.bufferLength != null)\n copy.bufferLength = config.bufferLength;\n return copy;\n }\n /**\n Tells you whether any [parse wrappers](#lr.ParserConfig.wrap)\n are registered for this parser.\n */\n hasWrappers() {\n return this.wrappers.length > 0;\n }\n /**\n Returns the name associated with a given term. This will only\n work for all terms when the parser was generated with the\n `--names` option. By default, only the names of tagged terms are\n stored.\n */\n getName(term) {\n return this.termNames ? this.termNames[term] : String(term <= this.maxNode && this.nodeSet.types[term].name || term);\n }\n /**\n The eof term id is always allocated directly after the node\n types. @internal\n */\n get eofTerm() { return this.maxNode + 1; }\n /**\n The type of top node produced by the parser.\n */\n get topNode() { return this.nodeSet.types[this.top[1]]; }\n /**\n @internal\n */\n dynamicPrecedence(term) {\n let prec = this.dynamicPrecedences;\n return prec == null ? 0 : prec[term] || 0;\n }\n /**\n @internal\n */\n parseDialect(dialect) {\n let values = Object.keys(this.dialects), flags = values.map(() => false);\n if (dialect)\n for (let part of dialect.split(\" \")) {\n let id = values.indexOf(part);\n if (id >= 0)\n flags[id] = true;\n }\n let disabled = null;\n for (let i = 0; i < values.length; i++)\n if (!flags[i]) {\n for (let j = this.dialects[values[i]], id; (id = this.data[j++]) != 65535 /* Seq.End */;)\n (disabled || (disabled = new Uint8Array(this.maxTerm + 1)))[id] = 1;\n }\n return new Dialect(dialect, flags, disabled);\n }\n /**\n Used by the output of the parser generator. Not available to\n user code. @hide\n */\n static deserialize(spec) {\n return new LRParser(spec);\n }\n }\n function pair(data, off) { return data[off] | (data[off + 1] << 16); }\n function findFinished(stacks) {\n let best = null;\n for (let stack of stacks) {\n let stopped = stack.p.stoppedAt;\n if ((stack.pos == stack.p.stream.end || stopped != null && stack.pos > stopped) &&\n stack.p.parser.stateFlag(stack.state, 2 /* StateFlag.Accepting */) &&\n (!best || best.score < stack.score))\n best = stack;\n }\n return best;\n }\n function getSpecializer(spec) {\n if (spec.external) {\n let mask = spec.extend ? 1 /* Specialize.Extend */ : 0 /* Specialize.Specialize */;\n return (value, stack) => (spec.external(value, stack) << 1) | mask;\n }\n return spec.get;\n }\n\n // This file was generated by lezer-generator. You probably shouldn't edit it.\n const scriptText = 54,\n StartCloseScriptTag = 1,\n styleText = 55,\n StartCloseStyleTag = 2,\n textareaText = 56,\n StartCloseTextareaTag = 3,\n EndTag = 4,\n SelfClosingEndTag = 5,\n StartTag = 6,\n StartScriptTag = 7,\n StartStyleTag = 8,\n StartTextareaTag = 9,\n StartSelfClosingTag = 10,\n StartCloseTag = 11,\n NoMatchStartCloseTag = 12,\n MismatchedStartCloseTag = 13,\n missingCloseTag = 57,\n IncompleteCloseTag = 14,\n commentContent$1 = 58,\n Element = 20,\n TagName = 22,\n Attribute = 23,\n AttributeName = 24,\n AttributeValue = 26,\n UnquotedAttributeValue = 27,\n ScriptText = 28,\n StyleText = 31,\n TextareaText = 34,\n OpenTag = 36,\n CloseTag = 37,\n Dialect_noMatch = 0,\n Dialect_selfClosing = 1;\n\n /* Hand-written tokenizers for HTML. */\n\n const selfClosers$1 = {\n area: true, base: true, br: true, col: true, command: true,\n embed: true, frame: true, hr: true, img: true, input: true,\n keygen: true, link: true, meta: true, param: true, source: true,\n track: true, wbr: true, menuitem: true\n };\n\n const implicitlyClosed = {\n dd: true, li: true, optgroup: true, option: true, p: true,\n rp: true, rt: true, tbody: true, td: true, tfoot: true,\n th: true, tr: true\n };\n\n const closeOnOpen = {\n dd: {dd: true, dt: true},\n dt: {dd: true, dt: true},\n li: {li: true},\n option: {option: true, optgroup: true},\n optgroup: {optgroup: true},\n p: {\n address: true, article: true, aside: true, blockquote: true, dir: true,\n div: true, dl: true, fieldset: true, footer: true, form: true,\n h1: true, h2: true, h3: true, h4: true, h5: true, h6: true,\n header: true, hgroup: true, hr: true, menu: true, nav: true, ol: true,\n p: true, pre: true, section: true, table: true, ul: true\n },\n rp: {rp: true, rt: true},\n rt: {rp: true, rt: true},\n tbody: {tbody: true, tfoot: true},\n td: {td: true, th: true},\n tfoot: {tbody: true},\n th: {td: true, th: true},\n thead: {tbody: true, tfoot: true},\n tr: {tr: true}\n };\n\n function nameChar(ch) {\n return ch == 45 || ch == 46 || ch == 58 || ch >= 65 && ch <= 90 || ch == 95 || ch >= 97 && ch <= 122 || ch >= 161\n }\n\n function isSpace(ch) {\n return ch == 9 || ch == 10 || ch == 13 || ch == 32\n }\n\n let cachedName = null, cachedInput = null, cachedPos = 0;\n function tagNameAfter(input, offset) {\n let pos = input.pos + offset;\n if (cachedPos == pos && cachedInput == input) return cachedName\n let next = input.peek(offset);\n while (isSpace(next)) next = input.peek(++offset);\n let name = \"\";\n for (;;) {\n if (!nameChar(next)) break\n name += String.fromCharCode(next);\n next = input.peek(++offset);\n }\n // Undefined to signal there's a <? or <!, null for just missing\n cachedInput = input; cachedPos = pos;\n return cachedName = name ? name.toLowerCase() : next == question$1 || next == bang ? undefined : null\n }\n\n const lessThan = 60, greaterThan = 62, slash$1 = 47, question$1 = 63, bang = 33, dash$1 = 45;\n\n function ElementContext(name, parent) {\n this.name = name;\n this.parent = parent;\n }\n\n const startTagTerms = [StartTag, StartSelfClosingTag, StartScriptTag, StartStyleTag, StartTextareaTag];\n\n const elementContext = new ContextTracker({\n start: null,\n shift(context, term, stack, input) {\n return startTagTerms.indexOf(term) > -1 ? new ElementContext(tagNameAfter(input, 1) || \"\", context) : context\n },\n reduce(context, term) {\n return term == Element && context ? context.parent : context\n },\n reuse(context, node, stack, input) {\n let type = node.type.id;\n return type == StartTag || type == OpenTag\n ? new ElementContext(tagNameAfter(input, 1) || \"\", context) : context\n },\n strict: false\n });\n\n const tagStart = new ExternalTokenizer((input, stack) => {\n if (input.next != lessThan) {\n // End of file, close any open tags\n if (input.next < 0 && stack.context) input.acceptToken(missingCloseTag);\n return\n }\n input.advance();\n let close = input.next == slash$1;\n if (close) input.advance();\n let name = tagNameAfter(input, 0);\n if (name === undefined) return\n if (!name) return input.acceptToken(close ? IncompleteCloseTag : StartTag)\n\n let parent = stack.context ? stack.context.name : null;\n if (close) {\n if (name == parent) return input.acceptToken(StartCloseTag)\n if (parent && implicitlyClosed[parent]) return input.acceptToken(missingCloseTag, -2)\n if (stack.dialectEnabled(Dialect_noMatch)) return input.acceptToken(NoMatchStartCloseTag)\n for (let cx = stack.context; cx; cx = cx.parent) if (cx.name == name) return\n input.acceptToken(MismatchedStartCloseTag);\n } else {\n if (name == \"script\") return input.acceptToken(StartScriptTag)\n if (name == \"style\") return input.acceptToken(StartStyleTag)\n if (name == \"textarea\") return input.acceptToken(StartTextareaTag)\n if (selfClosers$1.hasOwnProperty(name)) return input.acceptToken(StartSelfClosingTag)\n if (parent && closeOnOpen[parent] && closeOnOpen[parent][name]) input.acceptToken(missingCloseTag, -1);\n else input.acceptToken(StartTag);\n }\n }, {contextual: true});\n\n const commentContent = new ExternalTokenizer(input => {\n for (let dashes = 0, i = 0;; i++) {\n if (input.next < 0) {\n if (i) input.acceptToken(commentContent$1);\n break\n }\n if (input.next == dash$1) {\n dashes++;\n } else if (input.next == greaterThan && dashes >= 2) {\n if (i >= 3) input.acceptToken(commentContent$1, -2);\n break\n } else {\n dashes = 0;\n }\n input.advance();\n }\n });\n\n function inForeignElement(context) {\n for (; context; context = context.parent)\n if (context.name == \"svg\" || context.name == \"math\") return true\n return false\n }\n\n const endTag = new ExternalTokenizer((input, stack) => {\n if (input.next == slash$1 && input.peek(1) == greaterThan) {\n let selfClosing = stack.dialectEnabled(Dialect_selfClosing) || inForeignElement(stack.context);\n input.acceptToken(selfClosing ? SelfClosingEndTag : EndTag, 2);\n } else if (input.next == greaterThan) {\n input.acceptToken(EndTag, 1);\n }\n });\n\n function contentTokenizer(tag, textToken, endToken) {\n let lastState = 2 + tag.length;\n return new ExternalTokenizer(input => {\n // state means:\n // - 0 nothing matched\n // - 1 '<' matched\n // - 2 '</' + possibly whitespace matched\n // - 3-(1+tag.length) part of the tag matched\n // - lastState whole tag + possibly whitespace matched\n for (let state = 0, matchedLen = 0, i = 0;; i++) {\n if (input.next < 0) {\n if (i) input.acceptToken(textToken);\n break\n }\n if (state == 0 && input.next == lessThan ||\n state == 1 && input.next == slash$1 ||\n state >= 2 && state < lastState && input.next == tag.charCodeAt(state - 2)) {\n state++;\n matchedLen++;\n } else if ((state == 2 || state == lastState) && isSpace(input.next)) {\n matchedLen++;\n } else if (state == lastState && input.next == greaterThan) {\n if (i > matchedLen)\n input.acceptToken(textToken, -matchedLen);\n else\n input.acceptToken(endToken, -(matchedLen - 2));\n break\n } else if ((input.next == 10 /* '\\n' */ || input.next == 13 /* '\\r' */) && i) {\n input.acceptToken(textToken, 1);\n break\n } else {\n state = matchedLen = 0;\n }\n input.advance();\n }\n })\n }\n\n const scriptTokens = contentTokenizer(\"script\", scriptText, StartCloseScriptTag);\n\n const styleTokens = contentTokenizer(\"style\", styleText, StartCloseStyleTag);\n\n const textareaTokens = contentTokenizer(\"textarea\", textareaText, StartCloseTextareaTag);\n\n const htmlHighlighting = styleTags({\n \"Text RawText\": tags$1.content,\n \"StartTag StartCloseTag SelfClosingEndTag EndTag\": tags$1.angleBracket,\n TagName: tags$1.tagName,\n \"MismatchedCloseTag/TagName\": [tags$1.tagName, tags$1.invalid],\n AttributeName: tags$1.attributeName,\n \"AttributeValue UnquotedAttributeValue\": tags$1.attributeValue,\n Is: tags$1.definitionOperator,\n \"EntityReference CharacterReference\": tags$1.character,\n Comment: tags$1.blockComment,\n ProcessingInst: tags$1.processingInstruction,\n DoctypeDecl: tags$1.documentMeta\n });\n\n // This file was generated by lez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CloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag 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\",\n maxTerm: 67,\n context: elementContext,\n nodeProps: [\n [\"closedBy\", -10,1,2,3,7,8,9,10,11,12,13,\"EndTag\",6,\"EndTag SelfClosingEndTag\",-4,21,30,33,36,\"CloseTag\"],\n [\"openedBy\", 4,\"StartTag StartCloseTag\",5,\"StartTag\",-4,29,32,35,37,\"OpenTag\"],\n [\"group\", -9,14,17,18,19,20,39,40,41,42,\"Entity\",16,\"Entity TextContent\",-3,28,31,34,\"TextContent Entity\"],\n [\"isolate\", -11,21,29,30,32,33,35,36,37,38,41,42,\"ltr\",-3,26,27,39,\"\"]\n ],\n propSources: [htmlHighlighting],\n skippedNodes: [0],\n repeatNodeCount: 9,\n 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$|c`PkW!a`!cpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S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osing: 509},\n tokenPrec: 511\n });\n\n function getAttrs(openTag, input) {\n let attrs = Object.create(null);\n for (let att of openTag.getChildren(Attribute)) {\n let name = att.getChild(AttributeName), value = att.getChild(AttributeValue) || att.getChild(UnquotedAttributeValue);\n if (name) attrs[input.read(name.from, name.to)] =\n !value ? \"\" : value.type.id == AttributeValue ? input.read(value.from + 1, value.to - 1) : input.read(value.from, value.to);\n }\n return attrs\n }\n\n function findTagName(openTag, input) {\n let tagNameNode = openTag.getChild(TagName);\n return tagNameNode ? input.read(tagNameNode.from, tagNameNode.to) : \" \"\n }\n\n function maybeNest(node, input, tags) {\n let attrs;\n for (let tag of tags) {\n if (!tag.attrs || tag.attrs(attrs || (attrs = getAttrs(node.node.parent.firstChild, input))))\n return {parser: tag.parser}\n }\n return null\n }\n\n // tags?: {\n // tag: string,\n // attrs?: ({[attr: string]: string}) => boolean,\n // parser: Parser\n // }[]\n // attributes?: {\n // name: string,\n // tagName?: string,\n // parser: Parser\n // }[]\n \n function configureNesting(tags = [], attributes = []) {\n let script = [], style = [], textarea = [], other = [];\n for (let tag of tags) {\n let array = tag.tag == \"script\" ? script : tag.tag == \"style\" ? style : tag.tag == \"textarea\" ? textarea : other;\n array.push(tag);\n }\n let attrs = attributes.length ? Object.create(null) : null;\n for (let attr of attributes) (attrs[attr.name] || (attrs[attr.name] = [])).push(attr);\n\n return parseMixed((node, input) => {\n let id = node.type.id;\n if (id == ScriptText) return maybeNest(node, input, script)\n if (id == StyleText) return maybeNest(node, input, style)\n if (id == TextareaText) return maybeNest(node, input, textarea)\n\n if (id == Element && other.length) {\n let n = node.node, open = n.firstChild, tagName = open && findTagName(open, input), attrs;\n if (tagName) for (let tag of other) {\n if (tag.tag == tagName && (!tag.attrs || tag.attrs(attrs || (attrs = getAttrs(open, input))))) {\n let close = n.lastChild;\n let to = close.type.id == CloseTag ? close.from : n.to;\n if (to > open.to)\n return {parser: tag.parser, overlay: [{from: open.to, to}]}\n }\n }\n }\n\n if (attrs && id == Attribute) {\n let n = node.node, nameNode;\n if (nameNode = n.firstChild) {\n let matches = attrs[input.read(nameNode.from, nameNode.to)];\n if (matches) for (let attr of matches) {\n if (attr.tagName && attr.tagName != findTagName(n.parent, input)) continue\n let value = n.lastChild;\n if (value.type.id == AttributeValue) {\n let from = value.from + 1;\n let last = value.lastChild, to = value.to - (last && last.isError ? 0 : 1);\n if (to > from) return {parser: attr.parser, overlay: [{from, to}]}\n } else if (value.type.id == UnquotedAttributeValue) {\n return {parser: attr.parser, overlay: [{from: value.from, to: value.to}]}\n }\n }\n }\n }\n return null\n })\n }\n\n // This file was generated by lezer-generator. You probably shouldn't edit it.\n const descendantOp = 99,\n Unit = 1,\n callee = 100,\n identifier$2 = 101,\n VariableName = 2;\n\n /* Hand-written tokenizers for CSS tokens that can't be\n expressed by Lezer's built-in tokenizer. */\n\n const space$1 = [9, 10, 11, 12, 13, 32, 133, 160, 5760, 8192, 8193, 8194, 8195, 8196, 8197,\n 8198, 8199, 8200, 8201, 8202, 8232, 8233, 8239, 8287, 12288];\n const colon = 58, parenL = 40, underscore = 95, bracketL = 91, dash = 45, period = 46,\n hash = 35, percent = 37, ampersand = 38, backslash = 92, newline$1 = 10;\n\n function isAlpha$2(ch) { return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 161 }\n\n function isDigit(ch) { return ch >= 48 && ch <= 57 }\n\n const identifiers = new ExternalTokenizer((input, stack) => {\n for (let inside = false, dashes = 0, i = 0;; i++) {\n let {next} = input;\n if (isAlpha$2(next) || next == dash || next == underscore || (inside && isDigit(next))) {\n if (!inside && (next != dash || i > 0)) inside = true;\n if (dashes === i && next == dash) dashes++;\n input.advance();\n } else if (next == backslash && input.peek(1) != newline$1) {\n input.advance();\n if (input.next > -1) input.advance();\n inside = true;\n } else {\n if (inside)\n input.acceptToken(next == parenL ? callee : dashes == 2 && stack.canShift(VariableName) ? VariableName : identifier$2);\n break\n }\n }\n });\n\n const descendant = new ExternalTokenizer(input => {\n if (space$1.includes(input.peek(-1))) {\n let {next} = input;\n if (isAlpha$2(next) || next == underscore || next == hash || next == period ||\n next == bracketL || next == colon && isAlpha$2(input.peek(1)) ||\n next == dash || next == ampersand)\n input.acceptToken(descendantOp);\n }\n });\n\n const unitToken = new ExternalTokenizer(input => {\n if (!space$1.includes(input.peek(-1))) {\n let {next} = input;\n if (next == percent) { input.advance(); input.acceptToken(Unit); }\n if (isAlpha$2(next)) {\n do { input.advance(); } while (isAlpha$2(input.next) || isDigit(input.next))\n input.acceptToken(Unit);\n }\n }\n });\n\n const cssHighlighting = styleTags({\n \"AtKeyword import charset namespace keyframes media supports\": tags$1.definitionKeyword,\n \"from to selector\": tags$1.keyword,\n NamespaceName: tags$1.namespace,\n KeyframeName: tags$1.labelName,\n KeyframeRangeName: tags$1.operatorKeyword,\n TagName: tags$1.tagName,\n ClassName: tags$1.className,\n PseudoClassName: tags$1.constant(tags$1.className),\n IdName: tags$1.labelName,\n \"FeatureName PropertyName\": tags$1.propertyName,\n AttributeName: tags$1.attributeName,\n NumberLiteral: tags$1.number,\n KeywordQuery: tags$1.keyword,\n UnaryQueryOp: tags$1.operatorKeyword,\n \"CallTag ValueName\": tags$1.atom,\n VariableName: tags$1.variableName,\n Callee: tags$1.operatorKeyword,\n Unit: tags$1.unit,\n \"UniversalSelector NestingSelector\": tags$1.definitionOperator,\n MatchOp: tags$1.compareOperator,\n \"ChildOp SiblingOp, LogicOp\": tags$1.logicOperator,\n BinOp: tags$1.arithmeticOperator,\n Important: tags$1.modifier,\n Comment: tags$1.blockComment,\n ColorLiteral: tags$1.color,\n \"ParenthesizedContent StringLiteral\": tags$1.string,\n \":\": tags$1.punctuation,\n \"PseudoOp #\": tags$1.derefOperator,\n \"; ,\": tags$1.separator,\n \"( )\": tags$1.paren,\n \"[ ]\": tags$1.squareBracket,\n \"{ }\": tags$1.brace\n });\n\n // This file was generated by lezer-generator. You probably shouldn't edit it.\n const spec_callee = {__proto__:null,lang:32, \"nth-child\":32, \"nth-last-child\":32, \"nth-of-type\":32, \"nth-last-of-type\":32, dir:32, \"host-context\":32, url:60, \"url-prefix\":60, domain:60, regexp:60, selector:138};\n const spec_AtKeyword = {__proto__:null,\"@import\":118, \"@media\":142, \"@charset\":146, \"@namespace\":150, \"@keyframes\":156, \"@supports\":168};\n const spec_identifier$1 = {__proto__:null,not:132, only:132};\n const parser$2 = LRParser.deserialize({\n version: 14,\n states: \":^QYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO${QdO,59}O-kQ[O'#E^O-x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Literal BinaryExpression BinOp CallExpression Callee CallLiteral CallTag ParenthesizedContent ] [ LineNames LineName , PseudoClassName ArgList IdSelector # IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp } { Block Declaration PropertyName Important ; ImportStatement AtKeyword import KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports AtRule Styles\",\n maxTerm: 117,\n nodeProps: [\n [\"isolate\", -2,3,24,\"\"],\n [\"openedBy\", 17,\"(\",32,\"[\",50,\"{\"],\n [\"closedBy\", 18,\")\",33,\"]\",51,\"}\"]\n ],\n propSources: [cssHighlighting],\n skippedNodes: [0,3,87],\n repeatNodeCount: 11,\n tokenData: \"J^~R!^OX$}X^%u^p$}pq%uqr)Xrs.Rst/utu6duv$}vw7^wx7oxy9^yz9oz{9t{|:_|}?Q}!O?c!O!P@Q!P!Q@i!Q![Ab![!]B]!]!^CX!^!_$}!_!`Cj!`!aC{!a!b$}!b!cDw!c!}$}!}#OFa#O#P$}#P#QFr#Q#R6d#R#T$}#T#UGT#U#c$}#c#dHf#d#o$}#o#pH{#p#q6d#q#rI^#r#sIo#s#y$}#y#z%u#z$f$}$f$g%u$g#BY$}#BY#BZ%u#BZ$IS$}$IS$I_%u$I_$I|$}$I|$JO%u$JO$JT$}$JT$JU%u$JU$KV$}$KV$KW%u$KW&FU$}&FU&FV%u&FV;'S$};'S;=`JW<%lO$}`%QSOy%^z;'S%^;'S;=`%o<%lO%^`%cSo`Oy%^z;'S%^;'S;=`%o<%lO%^`%rP;=`<%l%^~%zh#Z~OX%^X^'f^p%^pq'fqy%^z#y%^#y#z'f#z$f%^$f$g'f$g#BY%^#BY#BZ'f#BZ$IS%^$IS$I_'f$I_$I|%^$I|$JO'f$JO$JT%^$JT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JZP;=`<%l$}\",\n tokenizers: [descendant, unitToken, identifiers, 1, 2, 3, 4, new LocalTokenGroup(\"m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~\", 28, 105)],\n topRules: {\"StyleSheet\":[0,4],\"Styles\":[1,86]},\n specialized: [{term: 100, get: (value) => spec_callee[value] || -1},{term: 58, get: (value) => spec_AtKeyword[value] || -1},{term: 101, get: (value) => spec_identifier$1[value] || -1}],\n tokenPrec: 1200\n });\n\n let _properties = null;\n function properties() {\n if (!_properties && typeof document == \"object\" && document.body) {\n let { style } = document.body, names = [], seen = new Set;\n for (let prop in style)\n if (prop != \"cssText\" && prop != \"cssFloat\") {\n if (typeof style[prop] == \"string\") {\n if (/[A-Z]/.test(prop))\n prop = prop.replace(/[A-Z]/g, ch => \"-\" + ch.toLowerCase());\n if (!seen.has(prop)) {\n names.push(prop);\n seen.add(prop);\n }\n }\n }\n _properties = names.sort().map(name => ({ type: \"property\", label: name }));\n }\n return _properties || [];\n }\n const pseudoClasses = /*@__PURE__*/[\n \"active\", \"after\", \"any-link\", \"autofill\", \"backdrop\", \"before\",\n \"checked\", \"cue\", \"default\", \"defined\", \"disabled\", \"empty\",\n \"enabled\", \"file-selector-button\", \"first\", \"first-child\",\n \"first-letter\", \"first-line\", \"first-of-type\", \"focus\",\n \"focus-visible\", \"focus-within\", \"fullscreen\", \"has\", \"host\",\n \"host-context\", \"hover\", \"in-range\", \"indeterminate\", \"invalid\",\n \"is\", \"lang\", \"last-child\", \"last-of-type\", \"left\", \"link\", \"marker\",\n \"modal\", \"not\", \"nth-child\", \"nth-last-child\", \"nth-last-of-type\",\n \"nth-of-type\", \"only-child\", \"only-of-type\", \"optional\", \"out-of-range\",\n \"part\", \"placeholder\", \"placeholder-shown\", \"read-only\", \"read-write\",\n \"required\", \"right\", \"root\", \"scope\", \"selection\", \"slotted\", \"target\",\n \"target-text\", \"valid\", \"visited\", \"where\"\n ].map(name => ({ type: \"class\", label: name }));\n const values = /*@__PURE__*/[\n \"above\", \"absolute\", \"activeborder\", \"additive\", \"activecaption\", \"after-white-space\",\n \"ahead\", \"alias\", \"all\", \"all-scroll\", \"alphabetic\", \"alternate\", \"always\",\n \"antialiased\", \"appworkspace\", \"asterisks\", \"attr\", \"auto\", \"auto-flow\", \"avoid\", \"avoid-column\",\n \"avoid-page\", \"avoid-region\", \"axis-pan\", \"background\", \"backwards\", \"baseline\", \"below\",\n \"bidi-override\", \"blink\", \"block\", \"block-axis\", \"bold\", \"bolder\", \"border\", \"border-box\",\n \"both\", \"bottom\", \"break\", \"break-all\", \"break-word\", \"bullets\", \"button\", \"button-bevel\",\n \"buttonface\", \"buttonhighlight\", \"buttonshadow\", \"buttontext\", \"calc\", \"capitalize\",\n \"caps-lock-indicator\", \"caption\", \"captiontext\", \"caret\", \"cell\", \"center\", \"checkbox\", \"circle\",\n \"cjk-decimal\", \"clear\", \"clip\", \"close-quote\", \"col-resize\", \"collapse\", \"color\", \"color-burn\",\n \"color-dodge\", \"column\", \"column-reverse\", \"compact\", \"condensed\", \"contain\", \"content\",\n \"contents\", \"content-box\", \"context-menu\", \"continuous\", \"copy\", \"counter\", \"counters\", \"cover\",\n \"crop\", \"cross\", \"crosshair\", \"currentcolor\", \"cursive\", \"cyclic\", \"darken\", \"dashed\", \"decimal\",\n \"decimal-leading-zero\", \"default\", \"default-button\", \"dense\", \"destination-atop\", \"destination-in\",\n \"destination-out\", \"destination-over\", \"difference\", \"disc\", \"discard\", \"disclosure-closed\",\n \"disclosure-open\", \"document\", \"dot-dash\", \"dot-dot-dash\", \"dotted\", \"double\", \"down\", \"e-resize\",\n \"ease\", \"ease-in\", \"ease-in-out\", \"ease-out\", \"element\", \"ellipse\", \"ellipsis\", \"embed\", \"end\",\n \"ethiopic-abegede-gez\", \"ethiopic-halehame-aa-er\", \"ethiopic-halehame-gez\", \"ew-resize\", \"exclusion\",\n \"expanded\", \"extends\", \"extra-condensed\", \"extra-expanded\", \"fantasy\", \"fast\", \"fill\", \"fill-box\",\n \"fixed\", \"flat\", \"flex\", \"flex-end\", \"flex-start\", \"footnotes\", \"forwards\", \"from\",\n \"geometricPrecision\", \"graytext\", \"grid\", \"groove\", \"hand\", \"hard-light\", \"help\", \"hidden\", \"hide\",\n \"higher\", \"highlight\", \"highlighttext\", \"horizontal\", \"hsl\", \"hsla\", \"hue\", \"icon\", \"ignore\",\n \"inactiveborder\", \"inactivecaption\", \"inactivecaptiontext\", \"infinite\", \"infobackground\", \"infotext\",\n \"inherit\", \"initial\", \"inline\", \"inline-axis\", \"inline-block\", \"inline-flex\", \"inline-grid\",\n \"inline-table\", \"inset\", \"inside\", \"intrinsic\", \"invert\", \"italic\", \"justify\", \"keep-all\",\n \"landscape\", \"large\", \"larger\", \"left\", \"level\", \"lighter\", \"lighten\", \"line-through\", \"linear\",\n \"linear-gradient\", \"lines\", \"list-item\", \"listbox\", \"listitem\", \"local\", \"logical\", \"loud\", \"lower\",\n \"lower-hexadecimal\", \"lower-latin\", \"lower-norwegian\", \"lowercase\", \"ltr\", \"luminosity\", \"manipulation\",\n \"match\", \"matrix\", \"matrix3d\", \"medium\", \"menu\", \"menutext\", \"message-box\", \"middle\", \"min-intrinsic\",\n \"mix\", \"monospace\", \"move\", \"multiple\", \"multiple_mask_images\", \"multiply\", \"n-resize\", \"narrower\",\n \"ne-resize\", \"nesw-resize\", \"no-close-quote\", \"no-drop\", \"no-open-quote\", \"no-repeat\", \"none\",\n \"normal\", \"not-allowed\", \"nowrap\", \"ns-resize\", \"numbers\", \"numeric\", \"nw-resize\", \"nwse-resize\",\n \"oblique\", \"opacity\", \"open-quote\", \"optimizeLegibility\", \"optimizeSpeed\", \"outset\", \"outside\",\n \"outside-shape\", \"overlay\", \"overline\", \"padding\", \"padding-box\", \"painted\", \"page\", \"paused\",\n \"perspective\", \"pinch-zoom\", \"plus-darker\", \"plus-lighter\", \"pointer\", \"polygon\", \"portrait\",\n \"pre\", \"pre-line\", \"pre-wrap\", \"preserve-3d\", \"progress\", \"push-button\", \"radial-gradient\", \"radio\",\n \"read-only\", \"read-write\", \"read-write-plaintext-only\", \"rectangle\", \"region\", \"relative\", \"repeat\",\n \"repeating-linear-gradient\", \"repeating-radial-gradient\", \"repeat-x\", \"repeat-y\", \"reset\", \"reverse\",\n \"rgb\", \"rgba\", \"ridge\", \"right\", \"rotate\", \"rotate3d\", \"rotateX\", \"rotateY\", \"rotateZ\", \"round\",\n \"row\", \"row-resize\", \"row-reverse\", \"rtl\", \"run-in\", \"running\", \"s-resize\", \"sans-serif\", \"saturation\",\n \"scale\", \"scale3d\", \"scaleX\", \"scaleY\", \"scaleZ\", \"screen\", \"scroll\", \"scrollbar\", \"scroll-position\",\n \"se-resize\", \"self-start\", \"self-end\", \"semi-condensed\", \"semi-expanded\", \"separate\", \"serif\", \"show\",\n \"single\", \"skew\", \"skewX\", \"skewY\", \"skip-white-space\", \"slide\", \"slider-horizontal\",\n \"slider-vertical\", \"sliderthumb-horizontal\", \"sliderthumb-vertical\", \"slow\", \"small\", \"small-caps\",\n \"small-caption\", \"smaller\", \"soft-light\", \"solid\", \"source-atop\", \"source-in\", \"source-out\",\n \"source-over\", \"space\", \"space-around\", \"space-between\", \"space-evenly\", \"spell-out\", \"square\", \"start\",\n \"static\", \"status-bar\", \"stretch\", \"stroke\", \"stroke-box\", \"sub\", \"subpixel-antialiased\", \"svg_masks\",\n \"super\", \"sw-resize\", \"symbolic\", \"symbols\", \"system-ui\", \"table\", \"table-caption\", \"table-cell\",\n \"table-column\", \"table-column-group\", \"table-footer-group\", \"table-header-group\", \"table-row\",\n \"table-row-group\", \"text\", \"text-bottom\", \"text-top\", \"textarea\", \"textfield\", \"thick\", \"thin\",\n \"threeddarkshadow\", \"threedface\", \"threedhighlight\", \"threedlightshadow\", \"threedshadow\", \"to\", \"top\",\n \"transform\", \"translate\", \"translate3d\", \"translateX\", \"translateY\", \"translateZ\", \"transparent\",\n \"ultra-condensed\", \"ultra-expanded\", \"underline\", \"unidirectional-pan\", \"unset\", \"up\", \"upper-latin\",\n \"uppercase\", \"url\", \"var\", \"vertical\", \"vertical-text\", \"view-box\", \"visible\", \"visibleFill\",\n \"visiblePainted\", \"visibleStroke\", \"visual\", \"w-resize\", \"wait\", \"wave\", \"wider\", \"window\", \"windowframe\",\n \"windowtext\", \"words\", \"wrap\", \"wrap-reverse\", \"x-large\", \"x-small\", \"xor\", \"xx-large\", \"xx-small\"\n ].map(name => ({ type: \"keyword\", label: name })).concat(/*@__PURE__*/[\n \"aliceblue\", \"antiquewhite\", \"aqua\", \"aquamarine\", \"azure\", \"beige\",\n \"bisque\", \"black\", \"blanchedalmond\", \"blue\", \"blueviolet\", \"brown\",\n \"burlywood\", \"cadetblue\", \"chartreuse\", \"chocolate\", \"coral\", \"cornflowerblue\",\n \"cornsilk\", \"crimson\", \"cyan\", \"darkblue\", \"darkcyan\", \"darkgoldenrod\",\n \"darkgray\", \"darkgreen\", \"darkkhaki\", \"darkmagenta\", \"darkolivegreen\",\n \"darkorange\", \"darkorchid\", \"darkred\", \"darksalmon\", \"darkseagreen\",\n \"darkslateblue\", \"darkslategray\", \"darkturquoise\", \"darkviolet\",\n \"deeppink\", \"deepskyblue\", \"dimgray\", \"dodgerblue\", \"firebrick\",\n \"floralwhite\", \"forestgreen\", \"fuchsia\", \"gainsboro\", \"ghostwhite\",\n \"gold\", \"goldenrod\", \"gray\", \"grey\", \"green\", \"greenyellow\", \"honeydew\",\n \"hotpink\", \"indianred\", \"indigo\", \"ivory\", \"khaki\", \"lavender\",\n \"lavenderblush\", \"lawngreen\", \"lemonchiffon\", \"lightblue\", \"lightcoral\",\n \"lightcyan\", \"lightgoldenrodyellow\", \"lightgray\", \"lightgreen\", \"lightpink\",\n \"lightsalmon\", \"lightseagreen\", \"lightskyblue\", \"lightslategray\",\n \"lightsteelblue\", \"lightyellow\", \"lime\", \"limegreen\", \"linen\", \"magenta\",\n \"maroon\", \"mediumaquamarine\", \"mediumblue\", \"mediumorchid\", \"mediumpurple\",\n \"mediumseagreen\", \"mediumslateblue\", \"mediumspringgreen\", \"mediumturquoise\",\n \"mediumvioletred\", \"midnightblue\", \"mintcream\", \"mistyrose\", \"moccasin\",\n \"navajowhite\", \"navy\", \"oldlace\", \"olive\", \"olivedrab\", \"orange\", \"orangered\",\n \"orchid\", \"palegoldenrod\", \"palegreen\", \"paleturquoise\", \"palevioletred\",\n \"papayawhip\", \"peachpuff\", \"peru\", \"pink\", \"plum\", \"powderblue\",\n \"purple\", \"rebeccapurple\", \"red\", \"rosybrown\", \"royalblue\", \"saddlebrown\",\n \"salmon\", \"sandybrown\", \"seagreen\", \"seashell\", \"sienna\", \"silver\", \"skyblue\",\n \"slateblue\", \"slategray\", \"snow\", \"springgreen\", \"steelblue\", \"tan\",\n \"teal\", \"thistle\", \"tomato\", \"turquoise\", \"violet\", \"wheat\", \"white\",\n \"whitesmoke\", \"yellow\", \"yellowgreen\"\n ].map(name => ({ type: \"constant\", label: name })));\n const tags = /*@__PURE__*/[\n \"a\", \"abbr\", \"address\", \"article\", \"aside\", \"b\", \"bdi\", \"bdo\", \"blockquote\", \"body\",\n \"br\", \"button\", \"canvas\", \"caption\", \"cite\", \"code\", \"col\", \"colgroup\", \"dd\", \"del\",\n \"details\", \"dfn\", \"dialog\", \"div\", \"dl\", \"dt\", \"em\", \"figcaption\", \"figure\", \"footer\",\n \"form\", \"header\", \"hgroup\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"hr\", \"html\", \"i\", \"iframe\",\n \"img\", \"input\", \"ins\", \"kbd\", \"label\", \"legend\", \"li\", \"main\", \"meter\", \"nav\", \"ol\", \"output\",\n \"p\", \"pre\", \"ruby\", \"section\", \"select\", \"small\", \"source\", \"span\", \"strong\", \"sub\", \"summary\",\n \"sup\", \"table\", \"tbody\", \"td\", \"template\", \"textarea\", \"tfoot\", \"th\", \"thead\", \"tr\", \"u\", \"ul\"\n ].map(name => ({ type: \"type\", label: name }));\n const identifier$1 = /^(\\w[\\w-]*|-\\w[\\w-]*|)$/, variable = /^-(-[\\w-]*)?$/;\n function isVarArg(node, doc) {\n var _a;\n if (node.name == \"(\" || node.type.isError)\n node = node.parent || node;\n if (node.name != \"ArgList\")\n return false;\n let callee = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.firstChild;\n if ((callee === null || callee === void 0 ? void 0 : callee.name) != \"Callee\")\n return false;\n return doc.sliceString(callee.from, callee.to) == \"var\";\n }\n const VariablesByNode = /*@__PURE__*/new NodeWeakMap();\n const declSelector = [\"Declaration\"];\n function astTop(node) {\n for (let cur = node;;) {\n if (cur.type.isTop)\n return cur;\n if (!(cur = cur.parent))\n return node;\n }\n }\n function variableNames(doc, node, isVariable) {\n if (node.to - node.from > 4096) {\n let known = VariablesByNode.get(node);\n if (known)\n return known;\n let result = [], seen = new Set, cursor = node.cursor(IterMode.IncludeAnonymous);\n if (cursor.firstChild())\n do {\n for (let option of variableNames(doc, cursor.node, isVariable))\n if (!seen.has(option.label)) {\n seen.add(option.label);\n result.push(option);\n }\n } while (cursor.nextSibling());\n VariablesByNode.set(node, result);\n return result;\n }\n else {\n let result = [], seen = new Set;\n node.cursor().iterate(node => {\n var _a;\n if (isVariable(node) && node.matchContext(declSelector) && ((_a = node.node.nextSibling) === null || _a === void 0 ? void 0 : _a.name) == \":\") {\n let name = doc.sliceString(node.from, node.to);\n if (!seen.has(name)) {\n seen.add(name);\n result.push({ label: name, type: \"variable\" });\n }\n }\n });\n return result;\n }\n }\n /**\n Create a completion source for a CSS dialect, providing a\n predicate for determining what kind of syntax node can act as a\n completable variable. This is used by language modes like Sass and\n Less to reuse this package's completion logic.\n */\n const defineCSSCompletionSource = (isVariable) => context => {\n let { state, pos } = context, node = syntaxTree(state).resolveInner(pos, -1);\n let isDash = node.type.isError && node.from == node.to - 1 && state.doc.sliceString(node.from, node.to) == \"-\";\n if (node.name == \"PropertyName\" ||\n (isDash || node.name == \"TagName\") && /^(Block|Styles)$/.test(node.resolve(node.to).name))\n return { from: node.from, options: properties(), validFor: identifier$1 };\n if (node.name == \"ValueName\")\n return { from: node.from, options: values, validFor: identifier$1 };\n if (node.name == \"PseudoClassName\")\n return { from: node.from, options: pseudoClasses, validFor: identifier$1 };\n if (isVariable(node) || (context.explicit || isDash) && isVarArg(node, state.doc))\n return { from: isVariable(node) || isDash ? node.from : pos,\n options: variableNames(state.doc, astTop(node), isVariable),\n validFor: variable };\n if (node.name == \"TagName\") {\n for (let { parent } = node; parent; parent = parent.parent)\n if (parent.name == \"Block\")\n return { from: node.from, options: properties(), validFor: identifier$1 };\n return { from: node.from, options: tags, validFor: identifier$1 };\n }\n if (!context.explicit)\n return null;\n let above = node.resolve(pos), before = above.childBefore(pos);\n if (before && before.name == \":\" && above.name == \"PseudoClassSelector\")\n return { from: pos, options: pseudoClasses, validFor: identifier$1 };\n if (before && before.name == \":\" && above.name == \"Declaration\" || above.name == \"ArgList\")\n return { from: pos, options: values, validFor: identifier$1 };\n if (above.name == \"Block\" || above.name == \"Styles\")\n return { from: pos, options: properties(), validFor: identifier$1 };\n return null;\n };\n /**\n CSS property, variable, and value keyword completion source.\n */\n const cssCompletionSource = /*@__PURE__*/defineCSSCompletionSource(n => n.name == \"VariableName\");\n\n /**\n A language provider based on the [Lezer CSS\n parser](https://github.com/lezer-parser/css), extended with\n highlighting and indentation information.\n */\n const cssLanguage = /*@__PURE__*/LRLanguage.define({\n name: \"css\",\n parser: /*@__PURE__*/parser$2.configure({\n props: [\n /*@__PURE__*/indentNodeProp.add({\n Declaration: /*@__PURE__*/continuedIndent()\n }),\n /*@__PURE__*/foldNodeProp.add({\n \"Block KeyframeList\": foldInside\n })\n ]\n }),\n languageData: {\n commentTokens: { block: { open: \"/*\", close: \"*/\" } },\n indentOnInput: /^\\s*\\}$/,\n wordChars: \"-\"\n }\n });\n /**\n Language support for CSS.\n */\n function css$1() {\n return new LanguageSupport(cssLanguage, cssLanguage.data.of({ autocomplete: cssCompletionSource }));\n }\n\n // This file was generated by lezer-generator. You probably shouldn't edit it.\n const noSemi = 312,\n incdec = 1,\n incdecPrefix = 2,\n questionDot = 3,\n JSXStartTag = 4,\n insertSemi = 313,\n spaces = 315,\n newline = 316,\n LineComment = 5,\n BlockComment = 6,\n Dialect_jsx = 0;\n\n /* Hand-written tokenizers for JavaScript tokens that can't be\n expressed by lezer's built-in tokenizer. */\n\n const space = [9, 10, 11, 12, 13, 32, 133, 160, 5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200,\n 8201, 8202, 8232, 8233, 8239, 8287, 12288];\n\n const braceR = 125, semicolon = 59, slash = 47, star = 42, plus = 43, minus = 45, lt = 60, comma = 44,\n question = 63, dot = 46;\n\n const trackNewline = new ContextTracker({\n start: false,\n shift(context, term) {\n return term == LineComment || term == BlockComment || term == spaces ? context : term == newline\n },\n strict: false\n });\n\n const insertSemicolon = new ExternalTokenizer((input, stack) => {\n let {next} = input;\n if (next == braceR || next == -1 || stack.context)\n input.acceptToken(insertSemi);\n }, {contextual: true, fallback: true});\n\n const noSemicolon = new ExternalTokenizer((input, stack) => {\n let {next} = input, after;\n if (space.indexOf(next) > -1) return\n if (next == slash && ((after = input.peek(1)) == slash || after == star)) return\n if (next != braceR && next != semicolon && next != -1 && !stack.context)\n input.acceptToken(noSemi);\n }, {contextual: true});\n\n const operatorToken = new ExternalTokenizer((input, stack) => {\n let {next} = input;\n if (next == plus || next == minus) {\n input.advance();\n if (next == input.next) {\n input.advance();\n let mayPostfix = !stack.context && stack.canShift(incdec);\n input.acceptToken(mayPostfix ? incdec : incdecPrefix);\n }\n } else if (next == question && input.peek(1) == dot) {\n input.advance(); input.advance();\n if (input.next < 48 || input.next > 57) // No digit after\n input.acceptToken(questionDot);\n }\n }, {contextual: true});\n\n function identifierChar(ch, start) {\n return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch == 95 || ch >= 192 ||\n !start && ch >= 48 && ch <= 57\n }\n\n const jsx$1 = new ExternalTokenizer((input, stack) => {\n if (input.next != lt || !stack.dialectEnabled(Dialect_jsx)) return\n input.advance();\n if (input.next == slash) return\n // Scan for an identifier followed by a comma or 'extends', don't\n // treat this as a start tag if present.\n let back = 0;\n while (space.indexOf(input.next) > -1) { input.advance(); back++; }\n if (identifierChar(input.next, true)) {\n input.advance();\n back++;\n while (identifierChar(input.next, false)) { input.advance(); back++; }\n while (space.indexOf(input.next) > -1) { input.advance(); back++; }\n if (input.next == comma) return\n for (let i = 0;; i++) {\n if (i == 7) {\n if (!identifierChar(input.next, true)) return\n break\n }\n if (input.next != \"extends\".charCodeAt(i)) break\n input.advance();\n back++;\n }\n }\n input.acceptToken(JSXStartTag, -back);\n });\n\n const jsHighlight = styleTags({\n \"get set async static\": tags$1.modifier,\n \"for while do if else switch try catch finally return throw break continue default case\": tags$1.controlKeyword,\n \"in of await yield void typeof delete instanceof\": tags$1.operatorKeyword,\n \"let var const using function class extends\": tags$1.definitionKeyword,\n \"import export from\": tags$1.moduleKeyword,\n \"with debugger as new\": tags$1.keyword,\n TemplateString: tags$1.special(tags$1.string),\n super: tags$1.atom,\n BooleanLiteral: tags$1.bool,\n this: tags$1.self,\n null: tags$1.null,\n Star: tags$1.modifier,\n VariableName: tags$1.variableName,\n \"CallExpression/VariableName TaggedTemplateExpression/VariableName\": tags$1.function(tags$1.variableName),\n VariableDefinition: tags$1.definition(tags$1.variableName),\n Label: tags$1.labelName,\n PropertyName: tags$1.propertyName,\n PrivatePropertyName: tags$1.special(tags$1.propertyName),\n \"CallExpression/MemberExpression/PropertyName\": tags$1.function(tags$1.propertyName),\n \"FunctionDeclaration/VariableDefinition\": tags$1.function(tags$1.definition(tags$1.variableName)),\n \"ClassDeclaration/VariableDefinition\": tags$1.definition(tags$1.className),\n PropertyDefinition: tags$1.definition(tags$1.propertyName),\n PrivatePropertyDefinition: tags$1.definition(tags$1.special(tags$1.propertyName)),\n UpdateOp: tags$1.updateOperator,\n \"LineComment Hashbang\": tags$1.lineComment,\n BlockComment: tags$1.blockComment,\n Number: tags$1.number,\n String: tags$1.string,\n Escape: tags$1.escape,\n ArithOp: tags$1.arithmeticOperator,\n LogicOp: tags$1.logicOperator,\n BitOp: tags$1.bitwiseOperator,\n CompareOp: tags$1.compareOperator,\n RegExp: tags$1.regexp,\n Equals: tags$1.definitionOperator,\n Arrow: tags$1.function(tags$1.punctuation),\n \": Spread\": tags$1.punctuation,\n \"( )\": tags$1.paren,\n \"[ ]\": tags$1.squareBracket,\n \"{ }\": tags$1.brace,\n \"InterpolationStart InterpolationEnd\": tags$1.special(tags$1.brace),\n \".\": tags$1.derefOperator,\n \", ;\": tags$1.separator,\n \"@\": tags$1.meta,\n\n TypeName: tags$1.typeName,\n TypeDefinition: tags$1.definition(tags$1.typeName),\n \"type enum interface implements namespace module declare\": tags$1.definitionKeyword,\n \"abstract global Privacy readonly override\": tags$1.modifier,\n \"is keyof unique infer\": tags$1.operatorKeyword,\n\n JSXAttributeValue: tags$1.attributeValue,\n JSXText: tags$1.content,\n \"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag\": tags$1.angleBracket,\n \"JSXIdentifier JSXNameSpacedName\": tags$1.tagName,\n \"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName\": tags$1.attributeName,\n \"JSXBuiltin/JSXIdentifier\": tags$1.standard(tags$1.tagName)\n });\n\n // This file was generated by lezer-generator. You probably shouldn't edit it.\n const spec_identifier = {__proto__:null,export:20, as:25, from:33, default:36, async:41, function:42, extends:54, this:58, true:66, false:66, null:78, void:82, typeof:86, super:102, new:136, delete:148, yield:157, await:161, class:166, public:229, private:229, protected:229, readonly:231, instanceof:250, satisfies:253, in:254, const:256, import:290, keyof:345, unique:349, infer:355, is:391, abstract:411, implements:413, type:415, let:418, var:420, using:423, interface:429, enum:433, namespace:439, module:441, declare:445, global:449, for:468, of:477, while:480, with:484, do:488, if:492, else:494, switch:498, case:504, try:510, catch:514, finally:518, return:522, throw:526, break:530, continue:534, debugger:538};\n const spec_word = {__proto__:null,async:123, get:125, set:127, declare:189, public:191, private:191, protected:191, static:193, abstract:195, override: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]Q/l*YQ1v,gQ2^,}Q4P/hQ6Z2UQ7[4QQ8k6[T<g'U+UV#aW%f*UU#`W%f*US(Q#W(YU(V#Z+T/eS-S'U+UT-v(P-{V'Z!e%g*VQ$lfR)t$qT)i$l)jR3w.|T*Z$x*]T*c${*UQ0l+`Q3P.^Q5i1cQ6q3TQ8V5lQ8v6pQ9j8UQ9|8uQ:b9lQ:j:OQ:r:cR:u:knqOXst!Z#d%k&o&q&r&t,k,p1|2PQ&i!VR,`&ftmOXst!U!V!Z#d%k&f&o&q&r&t,k,p1|2PR,g&lT%jm,gR1],PR,_&dQ&S|R+w&TR+m%}T&m!W&pT&n!W&pT2O,p2P\",\n nodeNames: \"\u26A0 ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList 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 Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const 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 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 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\",\n maxTerm: 376,\n context: trackNewline,\n nodeProps: [\n [\"isolate\", -8,5,6,14,34,36,48,50,52,\"\"],\n [\"group\", -26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,\"Statement\",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,\"Expression\",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,\"Type\",-3,85,100,106,\"ClassItem\"],\n [\"openedBy\", 23,\"<\",35,\"InterpolationStart\",53,\"[\",57,\"{\",70,\"(\",159,\"JSXStartCloseTag\"],\n [\"closedBy\", 24,\">\",37,\"InterpolationEnd\",47,\"]\",58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^O'{~~aP!P!Qd~iO'|~~\", 25, 318)],\n topRules: {\"Script\":[0,7],\"SingleExpression\":[1,272],\"SingleClassItem\":[2,273]},\n dialects: {jsx: 0, ts: 14725},\n dynamicPrecedences: {\"77\":1,\"79\":1,\"91\":1,\"167\":1,\"196\":1},\n specialized: [{term: 322, get: (value) => spec_identifier[value] || -1},{term: 338, get: (value) => spec_word[value] || -1},{term: 92, get: (value) => spec_LessThan[value] || -1}],\n tokenPrec: 14749\n });\n\n /**\n A collection of JavaScript-related\n [snippets](https://codemirror.net/6/docs/ref/#autocomplete.snippet).\n */\n const snippets = [\n /*@__PURE__*/snippetCompletion(\"function ${name}(${params}) {\\n\\t${}\\n}\", {\n label: \"function\",\n detail: \"definition\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\\n\\t${}\\n}\", {\n label: \"for\",\n detail: \"loop\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"for (let ${name} of ${collection}) {\\n\\t${}\\n}\", {\n label: \"for\",\n detail: \"of loop\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"do {\\n\\t${}\\n} while (${})\", {\n label: \"do\",\n detail: \"loop\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"while (${}) {\\n\\t${}\\n}\", {\n label: \"while\",\n detail: \"loop\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"try {\\n\\t${}\\n} catch (${error}) {\\n\\t${}\\n}\", {\n label: \"try\",\n detail: \"/ catch block\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"if (${}) {\\n\\t${}\\n}\", {\n label: \"if\",\n detail: \"block\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"if (${}) {\\n\\t${}\\n} else {\\n\\t${}\\n}\", {\n label: \"if\",\n detail: \"/ else block\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"class ${name} {\\n\\tconstructor(${params}) {\\n\\t\\t${}\\n\\t}\\n}\", {\n label: \"class\",\n detail: \"definition\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"import {${names}} from \\\"${module}\\\"\\n${}\", {\n label: \"import\",\n detail: \"named\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"import ${name} from \\\"${module}\\\"\\n${}\", {\n label: \"import\",\n detail: \"default\",\n type: \"keyword\"\n })\n ];\n /**\n A collection of snippet completions for TypeScript. Includes the\n JavaScript [snippets](https://codemirror.net/6/docs/ref/#lang-javascript.snippets).\n */\n const typescriptSnippets = /*@__PURE__*/snippets.concat([\n /*@__PURE__*/snippetCompletion(\"interface ${name} {\\n\\t${}\\n}\", {\n label: \"interface\",\n detail: \"definition\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"type ${name} = ${type}\", {\n label: \"type\",\n detail: \"definition\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"enum ${name} {\\n\\t${}\\n}\", {\n label: \"enum\",\n detail: \"definition\",\n type: \"keyword\"\n })\n ]);\n\n const cache$1 = /*@__PURE__*/new NodeWeakMap();\n const ScopeNodes = /*@__PURE__*/new Set([\n \"Script\", \"Block\",\n \"FunctionExpression\", \"FunctionDeclaration\", \"ArrowFunction\", \"MethodDeclaration\",\n \"ForStatement\"\n ]);\n function defID(type) {\n return (node, def) => {\n let id = node.node.getChild(\"VariableDefinition\");\n if (id)\n def(id, type);\n return true;\n };\n }\n const functionContext = [\"FunctionDeclaration\"];\n const gatherCompletions = {\n FunctionDeclaration: /*@__PURE__*/defID(\"function\"),\n ClassDeclaration: /*@__PURE__*/defID(\"class\"),\n ClassExpression: () => true,\n EnumDeclaration: /*@__PURE__*/defID(\"constant\"),\n TypeAliasDeclaration: /*@__PURE__*/defID(\"type\"),\n NamespaceDeclaration: /*@__PURE__*/defID(\"namespace\"),\n VariableDefinition(node, def) { if (!node.matchContext(functionContext))\n def(node, \"variable\"); },\n TypeDefinition(node, def) { def(node, \"type\"); },\n __proto__: null\n };\n function getScope(doc, node) {\n let cached = cache$1.get(node);\n if (cached)\n return cached;\n let completions = [], top = true;\n function def(node, type) {\n let name = doc.sliceString(node.from, node.to);\n completions.push({ label: name, type });\n }\n node.cursor(IterMode.IncludeAnonymous).iterate(node => {\n if (top) {\n top = false;\n }\n else if (node.name) {\n let gather = gatherCompletions[node.name];\n if (gather && gather(node, def) || ScopeNodes.has(node.name))\n return false;\n }\n else if (node.to - node.from > 8192) {\n // Allow caching for bigger internal nodes\n for (let c of getScope(doc, node.node))\n completions.push(c);\n return false;\n }\n });\n cache$1.set(node, completions);\n return completions;\n }\n const Identifier = /^[\\w$\\xa1-\\uffff][\\w$\\d\\xa1-\\uffff]*$/;\n const dontComplete = [\n \"TemplateString\", \"String\", \"RegExp\",\n \"LineComment\", \"BlockComment\",\n \"VariableDefinition\", \"TypeDefinition\", \"Label\",\n \"PropertyDefinition\", \"PropertyName\",\n \"PrivatePropertyDefinition\", \"PrivatePropertyName\",\n \".\", \"?.\"\n ];\n /**\n Completion source that looks up locally defined names in\n JavaScript code.\n */\n function localCompletionSource(context) {\n let inner = syntaxTree(context.state).resolveInner(context.pos, -1);\n if (dontComplete.indexOf(inner.name) > -1)\n return null;\n let isWord = inner.name == \"VariableName\" ||\n inner.to - inner.from < 20 && Identifier.test(context.state.sliceDoc(inner.from, inner.to));\n if (!isWord && !context.explicit)\n return null;\n let options = [];\n for (let pos = inner; pos; pos = pos.parent) {\n if (ScopeNodes.has(pos.name))\n options = options.concat(getScope(context.state.doc, pos));\n }\n return {\n options,\n from: isWord ? inner.from : context.pos,\n validFor: Identifier\n };\n }\n\n /**\n A language provider based on the [Lezer JavaScript\n parser](https://github.com/lezer-parser/javascript), extended with\n highlighting and indentation information.\n */\n const javascriptLanguage = /*@__PURE__*/LRLanguage.define({\n name: \"javascript\",\n parser: /*@__PURE__*/parser$1.configure({\n props: [\n /*@__PURE__*/indentNodeProp.add({\n IfStatement: /*@__PURE__*/continuedIndent({ except: /^\\s*({|else\\b)/ }),\n TryStatement: /*@__PURE__*/continuedIndent({ except: /^\\s*({|catch\\b|finally\\b)/ }),\n LabeledStatement: flatIndent,\n SwitchBody: context => {\n let after = context.textAfter, closed = /^\\s*\\}/.test(after), isCase = /^\\s*(case|default)\\b/.test(after);\n return context.baseIndent + (closed ? 0 : isCase ? 1 : 2) * context.unit;\n },\n Block: /*@__PURE__*/delimitedIndent({ closing: \"}\" }),\n ArrowFunction: cx => cx.baseIndent + cx.unit,\n \"TemplateString BlockComment\": () => null,\n \"Statement Property\": /*@__PURE__*/continuedIndent({ except: /^{/ }),\n JSXElement(context) {\n let closed = /^\\s*<\\//.test(context.textAfter);\n return context.lineIndent(context.node.from) + (closed ? 0 : context.unit);\n },\n JSXEscape(context) {\n let closed = /\\s*\\}/.test(context.textAfter);\n return context.lineIndent(context.node.from) + (closed ? 0 : context.unit);\n },\n \"JSXOpenTag JSXSelfClosingTag\"(context) {\n return context.column(context.node.from) + context.unit;\n }\n }),\n /*@__PURE__*/foldNodeProp.add({\n \"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType\": foldInside,\n BlockComment(tree) { return { from: tree.from + 2, to: tree.to - 2 }; }\n })\n ]\n }),\n languageData: {\n closeBrackets: { brackets: [\"(\", \"[\", \"{\", \"'\", '\"', \"`\"] },\n commentTokens: { line: \"//\", block: { open: \"/*\", close: \"*/\" } },\n indentOnInput: /^\\s*(?:case |default:|\\{|\\}|<\\/)$/,\n wordChars: \"$\"\n }\n });\n const jsxSublanguage = {\n test: node => /^JSX/.test(node.name),\n facet: /*@__PURE__*/defineLanguageFacet({ commentTokens: { block: { open: \"{/*\", close: \"*/}\" } } })\n };\n /**\n A language provider for TypeScript.\n */\n const typescriptLanguage = /*@__PURE__*/javascriptLanguage.configure({ dialect: \"ts\" }, \"typescript\");\n /**\n Language provider for JSX.\n */\n const jsxLanguage = /*@__PURE__*/javascriptLanguage.configure({\n dialect: \"jsx\",\n props: [/*@__PURE__*/sublanguageProp.add(n => n.isTop ? [jsxSublanguage] : undefined)]\n });\n /**\n Language provider for JSX + TypeScript.\n */\n const tsxLanguage = /*@__PURE__*/javascriptLanguage.configure({\n dialect: \"jsx ts\",\n props: [/*@__PURE__*/sublanguageProp.add(n => n.isTop ? [jsxSublanguage] : undefined)]\n }, \"typescript\");\n let kwCompletion = (name) => ({ label: name, type: \"keyword\" });\n const keywords = /*@__PURE__*/\"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(kwCompletion);\n const typescriptKeywords = /*@__PURE__*/keywords.concat(/*@__PURE__*/[\"declare\", \"implements\", \"private\", \"protected\", \"public\"].map(kwCompletion));\n /**\n JavaScript support. Includes [snippet](https://codemirror.net/6/docs/ref/#lang-javascript.snippets)\n and local variable completion.\n */\n function javascript(config = {}) {\n let lang = config.jsx ? (config.typescript ? tsxLanguage : jsxLanguage)\n : config.typescript ? typescriptLanguage : javascriptLanguage;\n let completions = config.typescript ? typescriptSnippets.concat(typescriptKeywords) : snippets.concat(keywords);\n return new LanguageSupport(lang, [\n javascriptLanguage.data.of({\n autocomplete: ifNotIn(dontComplete, completeFromList(completions))\n }),\n javascriptLanguage.data.of({\n autocomplete: localCompletionSource\n }),\n config.jsx ? autoCloseTags$1 : [],\n ]);\n }\n function findOpenTag(node) {\n for (;;) {\n if (node.name == \"JSXOpenTag\" || node.name == \"JSXSelfClosingTag\" || node.name == \"JSXFragmentTag\")\n return node;\n if (node.name == \"JSXEscape\" || !node.parent)\n return null;\n node = node.parent;\n }\n }\n function elementName$2(doc, tree, max = doc.length) {\n for (let ch = tree === null || tree === void 0 ? void 0 : tree.firstChild; ch; ch = ch.nextSibling) {\n if (ch.name == \"JSXIdentifier\" || ch.name == \"JSXBuiltin\" || ch.name == \"JSXNamespacedName\" ||\n ch.name == \"JSXMemberExpression\")\n return doc.sliceString(ch.from, Math.min(ch.to, max));\n }\n return \"\";\n }\n const android = typeof navigator == \"object\" && /*@__PURE__*//Android\\b/.test(navigator.userAgent);\n /**\n Extension that will automatically insert JSX close tags when a `>` or\n `/` is typed.\n */\n const autoCloseTags$1 = /*@__PURE__*/EditorView.inputHandler.of((view, from, to, text, defaultInsert) => {\n if ((android ? view.composing : view.compositionStarted) || view.state.readOnly ||\n from != to || (text != \">\" && text != \"/\") ||\n !javascriptLanguage.isActiveAt(view.state, from, -1))\n return false;\n let base = defaultInsert(), { state } = base;\n let closeTags = state.changeByRange(range => {\n var _a;\n let { head } = range, around = syntaxTree(state).resolveInner(head - 1, -1), name;\n if (around.name == \"JSXStartTag\")\n around = around.parent;\n if (state.doc.sliceString(head - 1, head) != text || around.name == \"JSXAttributeValue\" && around.to > head) ;\n else if (text == \">\" && around.name == \"JSXFragmentTag\") {\n return { range, changes: { from: head, insert: `</>` } };\n }\n else if (text == \"/\" && around.name == \"JSXStartCloseTag\") {\n let empty = around.parent, base = empty.parent;\n if (base && empty.from == head - 2 &&\n ((name = elementName$2(state.doc, base.firstChild, head)) || ((_a = base.firstChild) === null || _a === void 0 ? void 0 : _a.name) == \"JSXFragmentTag\")) {\n let insert = `${name}>`;\n return { range: EditorSelection.cursor(head + insert.length, -1), changes: { from: head, insert } };\n }\n }\n else if (text == \">\") {\n let openTag = findOpenTag(around);\n if (openTag && openTag.name == \"JSXOpenTag\" &&\n !/^\\/?>|^<\\//.test(state.doc.sliceString(head, head + 2)) &&\n (name = elementName$2(state.doc, openTag, head)))\n return { range, changes: { from: head, insert: `</${name}>` } };\n }\n return { range };\n });\n if (closeTags.changes.empty)\n return false;\n view.dispatch([\n base,\n state.update(closeTags, { userEvent: \"input.complete\", scrollIntoView: true })\n ]);\n return true;\n });\n\n const Targets = [\"_blank\", \"_self\", \"_top\", \"_parent\"];\n const Charsets = [\"ascii\", \"utf-8\", \"utf-16\", \"latin1\", \"latin1\"];\n const Methods = [\"get\", \"post\", \"put\", \"delete\"];\n const Encs = [\"application/x-www-form-urlencoded\", \"multipart/form-data\", \"text/plain\"];\n const Bool = [\"true\", \"false\"];\n const S = {}; // Empty tag spec\n const Tags = {\n a: {\n attrs: {\n href: null, ping: null, type: null,\n media: null,\n target: Targets,\n hreflang: null\n }\n },\n abbr: S,\n address: S,\n area: {\n attrs: {\n alt: null, coords: null, href: null, target: null, ping: null,\n media: null, hreflang: null, type: null,\n shape: [\"default\", \"rect\", \"circle\", \"poly\"]\n }\n },\n article: S,\n aside: S,\n audio: {\n attrs: {\n src: null, mediagroup: null,\n crossorigin: [\"anonymous\", \"use-credentials\"],\n preload: [\"none\", \"metadata\", \"auto\"],\n autoplay: [\"autoplay\"],\n loop: [\"loop\"],\n controls: [\"controls\"]\n }\n },\n b: S,\n base: { attrs: { href: null, target: Targets } },\n bdi: S,\n bdo: S,\n blockquote: { attrs: { cite: null } },\n body: S,\n br: S,\n button: {\n attrs: {\n form: null, formaction: null, name: null, value: null,\n autofocus: [\"autofocus\"],\n disabled: [\"autofocus\"],\n formenctype: Encs,\n formmethod: Methods,\n formnovalidate: [\"novalidate\"],\n formtarget: Targets,\n type: [\"submit\", \"reset\", \"button\"]\n }\n },\n canvas: { attrs: { width: null, height: null } },\n caption: S,\n center: S,\n cite: S,\n code: S,\n col: { attrs: { span: null } },\n colgroup: { attrs: { span: null } },\n command: {\n attrs: {\n type: [\"command\", \"checkbox\", \"radio\"],\n label: null, icon: null, radiogroup: null, command: null, title: null,\n disabled: [\"disabled\"],\n checked: [\"checked\"]\n }\n },\n data: { attrs: { value: null } },\n datagrid: { attrs: { disabled: [\"disabled\"], multiple: [\"multiple\"] } },\n datalist: { attrs: { data: null } },\n dd: S,\n del: { attrs: { cite: null, datetime: null } },\n details: { attrs: { open: [\"open\"] } },\n dfn: S,\n div: S,\n dl: S,\n dt: S,\n em: S,\n embed: { attrs: { src: null, type: null, width: null, height: null } },\n eventsource: { attrs: { src: null } },\n fieldset: { attrs: { disabled: [\"disabled\"], form: null, name: null } },\n figcaption: S,\n figure: S,\n footer: S,\n form: {\n attrs: {\n action: null, name: null,\n \"accept-charset\": Charsets,\n autocomplete: [\"on\", \"off\"],\n enctype: Encs,\n method: Methods,\n novalidate: [\"novalidate\"],\n target: Targets\n }\n },\n h1: S, h2: S, h3: S, h4: S, h5: S, h6: S,\n head: {\n children: [\"title\", \"base\", \"link\", \"style\", \"meta\", \"script\", \"noscript\", \"command\"]\n },\n header: S,\n hgroup: S,\n hr: S,\n html: {\n attrs: { manifest: null }\n },\n i: S,\n iframe: {\n attrs: {\n src: null, srcdoc: null, name: null, width: null, height: null,\n sandbox: [\"allow-top-navigation\", \"allow-same-origin\", \"allow-forms\", \"allow-scripts\"],\n seamless: [\"seamless\"]\n }\n },\n img: {\n attrs: {\n alt: null, src: null, ismap: null, usemap: null, width: null, height: null,\n crossorigin: [\"anonymous\", \"use-credentials\"]\n }\n },\n input: {\n attrs: {\n alt: null, dirname: null, form: null, formaction: null,\n height: null, list: null, max: null, maxlength: null, min: null,\n name: null, pattern: null, placeholder: null, size: null, src: null,\n step: null, value: null, width: null,\n accept: [\"audio/*\", \"video/*\", \"image/*\"],\n autocomplete: [\"on\", \"off\"],\n autofocus: [\"autofocus\"],\n checked: [\"checked\"],\n disabled: [\"disabled\"],\n formenctype: Encs,\n formmethod: Methods,\n formnovalidate: [\"novalidate\"],\n formtarget: Targets,\n multiple: [\"multiple\"],\n readonly: [\"readonly\"],\n required: [\"required\"],\n type: [\"hidden\", \"text\", \"search\", \"tel\", \"url\", \"email\", \"password\", \"datetime\", \"date\", \"month\",\n \"week\", \"time\", \"datetime-local\", \"number\", \"range\", \"color\", \"checkbox\", \"radio\",\n \"file\", \"submit\", \"image\", \"reset\", \"button\"]\n }\n },\n ins: { attrs: { cite: null, datetime: null } },\n kbd: S,\n keygen: {\n attrs: {\n challenge: null, form: null, name: null,\n autofocus: [\"autofocus\"],\n disabled: [\"disabled\"],\n keytype: [\"RSA\"]\n }\n },\n label: { attrs: { for: null, form: null } },\n legend: S,\n li: { attrs: { value: null } },\n link: {\n attrs: {\n href: null, type: null,\n hreflang: null,\n media: null,\n sizes: [\"all\", \"16x16\", \"16x16 32x32\", \"16x16 32x32 64x64\"]\n }\n },\n map: { attrs: { name: null } },\n mark: S,\n menu: { attrs: { label: null, type: [\"list\", \"context\", \"toolbar\"] } },\n meta: {\n attrs: {\n content: null,\n charset: Charsets,\n name: [\"viewport\", \"application-name\", \"author\", \"description\", \"generator\", \"keywords\"],\n \"http-equiv\": [\"content-language\", \"content-type\", \"default-style\", \"refresh\"]\n }\n },\n meter: { attrs: { value: null, min: null, low: null, high: null, max: null, optimum: null } },\n nav: S,\n noscript: S,\n object: {\n attrs: {\n data: null, type: null, name: null, usemap: null, form: null, width: null, height: null,\n typemustmatch: [\"typemustmatch\"]\n }\n },\n ol: { attrs: { reversed: [\"reversed\"], start: null, type: [\"1\", \"a\", \"A\", \"i\", \"I\"] },\n children: [\"li\", \"script\", \"template\", \"ul\", \"ol\"] },\n optgroup: { attrs: { disabled: [\"disabled\"], label: null } },\n option: { attrs: { disabled: [\"disabled\"], label: null, selected: [\"selected\"], value: null } },\n output: { attrs: { for: null, form: null, name: null } },\n p: S,\n param: { attrs: { name: null, value: null } },\n pre: S,\n progress: { attrs: { value: null, max: null } },\n q: { attrs: { cite: null } },\n rp: S,\n rt: S,\n ruby: S,\n samp: S,\n script: {\n attrs: {\n type: [\"text/javascript\"],\n src: null,\n async: [\"async\"],\n defer: [\"defer\"],\n charset: Charsets\n }\n },\n section: S,\n select: {\n attrs: {\n form: null, name: null, size: null,\n autofocus: [\"autofocus\"],\n disabled: [\"disabled\"],\n multiple: [\"multiple\"]\n }\n },\n slot: { attrs: { name: null } },\n small: S,\n source: { attrs: { src: null, type: null, media: null } },\n span: S,\n strong: S,\n style: {\n attrs: {\n type: [\"text/css\"],\n media: null,\n scoped: null\n }\n },\n sub: S,\n summary: S,\n sup: S,\n table: S,\n tbody: S,\n td: { attrs: { colspan: null, rowspan: null, headers: null } },\n template: S,\n textarea: {\n attrs: {\n dirname: null, form: null, maxlength: null, name: null, placeholder: null,\n rows: null, cols: null,\n autofocus: [\"autofocus\"],\n disabled: [\"disabled\"],\n readonly: [\"readonly\"],\n required: [\"required\"],\n wrap: [\"soft\", \"hard\"]\n }\n },\n tfoot: S,\n th: { attrs: { colspan: null, rowspan: null, headers: null, scope: [\"row\", \"col\", \"rowgroup\", \"colgroup\"] } },\n thead: S,\n time: { attrs: { datetime: null } },\n title: S,\n tr: S,\n track: {\n attrs: {\n src: null, label: null, default: null,\n kind: [\"subtitles\", \"captions\", \"descriptions\", \"chapters\", \"metadata\"],\n srclang: null\n }\n },\n ul: { children: [\"li\", \"script\", \"template\", \"ul\", \"ol\"] },\n var: S,\n video: {\n attrs: {\n src: null, poster: null, width: null, height: null,\n crossorigin: [\"anonymous\", \"use-credentials\"],\n preload: [\"auto\", \"metadata\", \"none\"],\n autoplay: [\"autoplay\"],\n mediagroup: [\"movie\"],\n muted: [\"muted\"],\n controls: [\"controls\"]\n }\n },\n wbr: S\n };\n const GlobalAttrs = {\n accesskey: null,\n class: null,\n contenteditable: Bool,\n contextmenu: null,\n dir: [\"ltr\", \"rtl\", \"auto\"],\n draggable: [\"true\", \"false\", \"auto\"],\n dropzone: [\"copy\", \"move\", \"link\", \"string:\", \"file:\"],\n hidden: [\"hidden\"],\n id: null,\n inert: [\"inert\"],\n itemid: null,\n itemprop: null,\n itemref: null,\n itemscope: [\"itemscope\"],\n itemtype: null,\n lang: [\"ar\", \"bn\", \"de\", \"en-GB\", \"en-US\", \"es\", \"fr\", \"hi\", \"id\", \"ja\", \"pa\", \"pt\", \"ru\", \"tr\", \"zh\"],\n spellcheck: Bool,\n autocorrect: Bool,\n autocapitalize: Bool,\n style: null,\n tabindex: null,\n title: null,\n translate: [\"yes\", \"no\"],\n rel: [\"stylesheet\", \"alternate\", \"author\", \"bookmark\", \"help\", \"license\", \"next\", \"nofollow\", \"noreferrer\", \"prefetch\", \"prev\", \"search\", \"tag\"],\n role: /*@__PURE__*/\"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(\" \"),\n \"aria-activedescendant\": null,\n \"aria-atomic\": Bool,\n \"aria-autocomplete\": [\"inline\", \"list\", \"both\", \"none\"],\n \"aria-busy\": Bool,\n \"aria-checked\": [\"true\", \"false\", \"mixed\", \"undefined\"],\n \"aria-controls\": null,\n \"aria-describedby\": null,\n \"aria-disabled\": Bool,\n \"aria-dropeffect\": null,\n \"aria-expanded\": [\"true\", \"false\", \"undefined\"],\n \"aria-flowto\": null,\n \"aria-grabbed\": [\"true\", \"false\", \"undefined\"],\n \"aria-haspopup\": Bool,\n \"aria-hidden\": Bool,\n \"aria-invalid\": [\"true\", \"false\", \"grammar\", \"spelling\"],\n \"aria-label\": null,\n \"aria-labelledby\": null,\n \"aria-level\": null,\n \"aria-live\": [\"off\", \"polite\", \"assertive\"],\n \"aria-multiline\": Bool,\n \"aria-multiselectable\": Bool,\n \"aria-owns\": null,\n \"aria-posinset\": null,\n \"aria-pressed\": [\"true\", \"false\", \"mixed\", \"undefined\"],\n \"aria-readonly\": Bool,\n \"aria-relevant\": null,\n \"aria-required\": Bool,\n \"aria-selected\": [\"true\", \"false\", \"undefined\"],\n \"aria-setsize\": null,\n \"aria-sort\": [\"ascending\", \"descending\", \"none\", \"other\"],\n \"aria-valuemax\": null,\n \"aria-valuemin\": null,\n \"aria-valuenow\": null,\n \"aria-valuetext\": null\n };\n const eventAttributes = /*@__PURE__*/(\"beforeunload copy cut dragstart dragover dragleave dragenter dragend \" +\n \"drag paste focus blur change click load mousedown mouseenter mouseleave \" +\n \"mouseup keydown keyup resize scroll unload\").split(\" \").map(n => \"on\" + n);\n for (let a of eventAttributes)\n GlobalAttrs[a] = null;\n class Schema {\n constructor(extraTags, extraAttrs) {\n this.tags = Object.assign(Object.assign({}, Tags), extraTags);\n this.globalAttrs = Object.assign(Object.assign({}, GlobalAttrs), extraAttrs);\n this.allTags = Object.keys(this.tags);\n this.globalAttrNames = Object.keys(this.globalAttrs);\n }\n }\n Schema.default = /*@__PURE__*/new Schema;\n function elementName$1(doc, tree, max = doc.length) {\n if (!tree)\n return \"\";\n let tag = tree.firstChild;\n let name = tag && tag.getChild(\"TagName\");\n return name ? doc.sliceString(name.from, Math.min(name.to, max)) : \"\";\n }\n function findParentElement(tree, skip = false) {\n for (; tree; tree = tree.parent)\n if (tree.name == \"Element\") {\n if (skip)\n skip = false;\n else\n return tree;\n }\n return null;\n }\n function allowedChildren(doc, tree, schema) {\n let parentInfo = schema.tags[elementName$1(doc, findParentElement(tree))];\n return (parentInfo === null || parentInfo === void 0 ? void 0 : parentInfo.children) || schema.allTags;\n }\n function openTags(doc, tree) {\n let open = [];\n for (let parent = findParentElement(tree); parent && !parent.type.isTop; parent = findParentElement(parent.parent)) {\n let tagName = elementName$1(doc, parent);\n if (tagName && parent.lastChild.name == \"CloseTag\")\n break;\n if (tagName && open.indexOf(tagName) < 0 && (tree.name == \"EndTag\" || tree.from >= parent.firstChild.to))\n open.push(tagName);\n }\n return open;\n }\n const identifier = /^[:\\-\\.\\w\\u00b7-\\uffff]*$/;\n function completeTag(state, schema, tree, from, to) {\n let end = /\\s*>/.test(state.sliceDoc(to, to + 5)) ? \"\" : \">\";\n let parent = findParentElement(tree, true);\n return { from, to,\n options: allowedChildren(state.doc, parent, schema).map(tagName => ({ label: tagName, type: \"type\" })).concat(openTags(state.doc, tree).map((tag, i) => ({ label: \"/\" + tag, apply: \"/\" + tag + end,\n type: \"type\", boost: 99 - i }))),\n validFor: /^\\/?[:\\-\\.\\w\\u00b7-\\uffff]*$/ };\n }\n function completeCloseTag(state, tree, from, to) {\n let end = /\\s*>/.test(state.sliceDoc(to, to + 5)) ? \"\" : \">\";\n return { from, to,\n options: openTags(state.doc, tree).map((tag, i) => ({ label: tag, apply: tag + end, type: \"type\", boost: 99 - i })),\n validFor: identifier };\n }\n function completeStartTag(state, schema, tree, pos) {\n let options = [], level = 0;\n for (let tagName of allowedChildren(state.doc, tree, schema))\n options.push({ label: \"<\" + tagName, type: \"type\" });\n for (let open of openTags(state.doc, tree))\n options.push({ label: \"</\" + open + \">\", type: \"type\", boost: 99 - level++ });\n return { from: pos, to: pos, options, validFor: /^<\\/?[:\\-\\.\\w\\u00b7-\\uffff]*$/ };\n }\n function completeAttrName(state, schema, tree, from, to) {\n let elt = findParentElement(tree), info = elt ? schema.tags[elementName$1(state.doc, elt)] : null;\n let localAttrs = info && info.attrs ? Object.keys(info.attrs) : [];\n let names = info && info.globalAttrs === false ? localAttrs\n : localAttrs.length ? localAttrs.concat(schema.globalAttrNames) : schema.globalAttrNames;\n return { from, to,\n options: names.map(attrName => ({ label: attrName, type: \"property\" })),\n validFor: identifier };\n }\n function completeAttrValue(state, schema, tree, from, to) {\n var _a;\n let nameNode = (_a = tree.parent) === null || _a === void 0 ? void 0 : _a.getChild(\"AttributeName\");\n let options = [], token = undefined;\n if (nameNode) {\n let attrName = state.sliceDoc(nameNode.from, nameNode.to);\n let attrs = schema.globalAttrs[attrName];\n if (!attrs) {\n let elt = findParentElement(tree), info = elt ? schema.tags[elementName$1(state.doc, elt)] : null;\n attrs = (info === null || info === void 0 ? void 0 : info.attrs) && info.attrs[attrName];\n }\n if (attrs) {\n let base = state.sliceDoc(from, to).toLowerCase(), quoteStart = '\"', quoteEnd = '\"';\n if (/^['\"]/.test(base)) {\n token = base[0] == '\"' ? /^[^\"]*$/ : /^[^']*$/;\n quoteStart = \"\";\n quoteEnd = state.sliceDoc(to, to + 1) == base[0] ? \"\" : base[0];\n base = base.slice(1);\n from++;\n }\n else {\n token = /^[^\\s<>='\"]*$/;\n }\n for (let value of attrs)\n options.push({ label: value, apply: quoteStart + value + quoteEnd, type: \"constant\" });\n }\n }\n return { from, to, options, validFor: token };\n }\n function htmlCompletionFor(schema, context) {\n let { state, pos } = context, tree = syntaxTree(state).resolveInner(pos, -1), around = tree.resolve(pos);\n for (let scan = pos, before; around == tree && (before = tree.childBefore(scan));) {\n let last = before.lastChild;\n if (!last || !last.type.isError || last.from < last.to)\n break;\n around = tree = before;\n scan = last.from;\n }\n if (tree.name == \"TagName\") {\n return tree.parent && /CloseTag$/.test(tree.parent.name) ? completeCloseTag(state, tree, tree.from, pos)\n : completeTag(state, schema, tree, tree.from, pos);\n }\n else if (tree.name == \"StartTag\") {\n return completeTag(state, schema, tree, pos, pos);\n }\n else if (tree.name == \"StartCloseTag\" || tree.name == \"IncompleteCloseTag\") {\n return completeCloseTag(state, tree, pos, pos);\n }\n else if (tree.name == \"OpenTag\" || tree.name == \"SelfClosingTag\" || tree.name == \"AttributeName\") {\n return completeAttrName(state, schema, tree, tree.name == \"AttributeName\" ? tree.from : pos, pos);\n }\n else if (tree.name == \"Is\" || tree.name == \"AttributeValue\" || tree.name == \"UnquotedAttributeValue\") {\n return completeAttrValue(state, schema, tree, tree.name == \"Is\" ? pos : tree.from, pos);\n }\n else if (context.explicit && (around.name == \"Element\" || around.name == \"Text\" || around.name == \"Document\")) {\n return completeStartTag(state, schema, tree, pos);\n }\n else {\n return null;\n }\n }\n /**\n HTML tag completion. Opens and closes tags and attributes in a\n context-aware way.\n */\n function htmlCompletionSource(context) {\n return htmlCompletionFor(Schema.default, context);\n }\n /**\n Create a completion source for HTML extended with additional tags\n or attributes.\n */\n function htmlCompletionSourceWith(config) {\n let { extraTags, extraGlobalAttributes: extraAttrs } = config;\n let schema = extraAttrs || extraTags ? new Schema(extraTags, extraAttrs) : Schema.default;\n return (context) => htmlCompletionFor(schema, context);\n }\n\n const jsonParser = /*@__PURE__*/javascriptLanguage.parser.configure({ top: \"SingleExpression\" });\n const defaultNesting = [\n { tag: \"script\",\n attrs: attrs => attrs.type == \"text/typescript\" || attrs.lang == \"ts\",\n parser: typescriptLanguage.parser },\n { tag: \"script\",\n attrs: attrs => attrs.type == \"text/babel\" || attrs.type == \"text/jsx\",\n parser: jsxLanguage.parser },\n { tag: \"script\",\n attrs: attrs => attrs.type == \"text/typescript-jsx\",\n parser: tsxLanguage.parser },\n { tag: \"script\",\n attrs(attrs) {\n return /^(importmap|speculationrules|application\\/(.+\\+)?json)$/i.test(attrs.type);\n },\n parser: jsonParser },\n { tag: \"script\",\n attrs(attrs) {\n return !attrs.type || /^(?:text|application)\\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(attrs.type);\n },\n parser: javascriptLanguage.parser },\n { tag: \"style\",\n attrs(attrs) {\n return (!attrs.lang || attrs.lang == \"css\") && (!attrs.type || /^(text\\/)?(x-)?(stylesheet|css)$/i.test(attrs.type));\n },\n parser: cssLanguage.parser }\n ];\n const defaultAttrs = /*@__PURE__*/[\n { name: \"style\",\n parser: /*@__PURE__*/cssLanguage.parser.configure({ top: \"Styles\" }) }\n ].concat(/*@__PURE__*/eventAttributes.map(name => ({ name, parser: javascriptLanguage.parser })));\n /**\n A language provider based on the [Lezer HTML\n parser](https://github.com/lezer-parser/html), extended with the\n JavaScript and CSS parsers to parse the content of `<script>` and\n `<style>` tags.\n */\n const htmlPlain = /*@__PURE__*/LRLanguage.define({\n name: \"html\",\n parser: /*@__PURE__*/parser$3.configure({\n props: [\n /*@__PURE__*/indentNodeProp.add({\n Element(context) {\n let after = /^(\\s*)(<\\/)?/.exec(context.textAfter);\n if (context.node.to <= context.pos + after[0].length)\n return context.continue();\n return context.lineIndent(context.node.from) + (after[2] ? 0 : context.unit);\n },\n \"OpenTag CloseTag SelfClosingTag\"(context) {\n return context.column(context.node.from) + context.unit;\n },\n Document(context) {\n if (context.pos + /\\s*/.exec(context.textAfter)[0].length < context.node.to)\n return context.continue();\n let endElt = null, close;\n for (let cur = context.node;;) {\n let last = cur.lastChild;\n if (!last || last.name != \"Element\" || last.to != cur.to)\n break;\n endElt = cur = last;\n }\n if (endElt && !((close = endElt.lastChild) && (close.name == \"CloseTag\" || close.name == \"SelfClosingTag\")))\n return context.lineIndent(endElt.from) + context.unit;\n return null;\n }\n }),\n /*@__PURE__*/foldNodeProp.add({\n Element(node) {\n let first = node.firstChild, last = node.lastChild;\n if (!first || first.name != \"OpenTag\")\n return null;\n return { from: first.to, to: last.name == \"CloseTag\" ? last.from : node.to };\n }\n }),\n /*@__PURE__*/bracketMatchingHandle.add({\n \"OpenTag CloseTag\": node => node.getChild(\"TagName\")\n })\n ]\n }),\n languageData: {\n commentTokens: { block: { open: \"<!--\", close: \"-->\" } },\n indentOnInput: /^\\s*<\\/\\w+\\W$/,\n wordChars: \"-._\"\n }\n });\n /**\n A language provider based on the [Lezer HTML\n parser](https://github.com/lezer-parser/html), extended with the\n JavaScript and CSS parsers to parse the content of `<script>` and\n `<style>` tags.\n */\n const htmlLanguage = /*@__PURE__*/htmlPlain.configure({\n wrap: /*@__PURE__*/configureNesting(defaultNesting, defaultAttrs)\n });\n /**\n Language support for HTML, including\n [`htmlCompletion`](https://codemirror.net/6/docs/ref/#lang-html.htmlCompletion) and JavaScript and\n CSS support extensions.\n */\n function html$1(config = {}) {\n let dialect = \"\", wrap;\n if (config.matchClosingTags === false)\n dialect = \"noMatch\";\n if (config.selfClosingTags === true)\n dialect = (dialect ? dialect + \" \" : \"\") + \"selfClosing\";\n if (config.nestedLanguages && config.nestedLanguages.length ||\n config.nestedAttributes && config.nestedAttributes.length)\n wrap = configureNesting((config.nestedLanguages || []).concat(defaultNesting), (config.nestedAttributes || []).concat(defaultAttrs));\n let lang = wrap ? htmlPlain.configure({ wrap, dialect }) : dialect ? htmlLanguage.configure({ dialect }) : htmlLanguage;\n return new LanguageSupport(lang, [\n htmlLanguage.data.of({ autocomplete: htmlCompletionSourceWith(config) }),\n config.autoCloseTags !== false ? autoCloseTags : [],\n javascript().support,\n css$1().support\n ]);\n }\n const selfClosers = /*@__PURE__*/new Set(/*@__PURE__*/\"area base br col command embed frame hr img input keygen link meta param source track wbr menuitem\".split(\" \"));\n /**\n Extension that will automatically insert close tags when a `>` or\n `/` is typed.\n */\n const autoCloseTags = /*@__PURE__*/EditorView.inputHandler.of((view, from, to, text, insertTransaction) => {\n if (view.composing || view.state.readOnly || from != to || (text != \">\" && text != \"/\") ||\n !htmlLanguage.isActiveAt(view.state, from, -1))\n return false;\n let base = insertTransaction(), { state } = base;\n let closeTags = state.changeByRange(range => {\n var _a, _b, _c;\n let didType = state.doc.sliceString(range.from - 1, range.to) == text;\n let { head } = range, after = syntaxTree(state).resolveInner(head, -1), name;\n if (didType && text == \">\" && after.name == \"EndTag\") {\n let tag = after.parent;\n if (((_b = (_a = tag.parent) === null || _a === void 0 ? void 0 : _a.lastChild) === null || _b === void 0 ? void 0 : _b.name) != \"CloseTag\" &&\n (name = elementName$1(state.doc, tag.parent, head)) &&\n !selfClosers.has(name)) {\n let to = head + (state.doc.sliceString(head, head + 1) === \">\" ? 1 : 0);\n let insert = `</${name}>`;\n return { range, changes: { from: head, to, insert } };\n }\n }\n else if (didType && text == \"/\" && after.name == \"IncompleteCloseTag\") {\n let tag = after.parent;\n if (after.from == head - 2 && ((_c = tag.lastChild) === null || _c === void 0 ? void 0 : _c.name) != \"CloseTag\" &&\n (name = elementName$1(state.doc, tag, head)) && !selfClosers.has(name)) {\n let to = head + (state.doc.sliceString(head, head + 1) === \">\" ? 1 : 0);\n let insert = `${name}>`;\n return {\n range: EditorSelection.cursor(head + insert.length, -1),\n changes: { from: head, to, insert }\n };\n }\n }\n return { range };\n });\n if (closeTags.changes.empty)\n return false;\n view.dispatch([\n base,\n state.update(closeTags, {\n userEvent: \"input.complete\",\n scrollIntoView: true\n })\n ]);\n return true;\n });\n\n const data$1 = /*@__PURE__*/defineLanguageFacet({ commentTokens: { block: { open: \"<!--\", close: \"-->\" } } });\n const headingProp = /*@__PURE__*/new NodeProp();\n const commonmark = /*@__PURE__*/parser$4.configure({\n props: [\n /*@__PURE__*/foldNodeProp.add(type => {\n return !type.is(\"Block\") || type.is(\"Document\") || isHeading(type) != null || isList(type) ? undefined\n : (tree, state) => ({ from: state.doc.lineAt(tree.from).to, to: tree.to });\n }),\n /*@__PURE__*/headingProp.add(isHeading),\n /*@__PURE__*/indentNodeProp.add({\n Document: () => null\n }),\n /*@__PURE__*/languageDataProp.add({\n Document: data$1\n })\n ]\n });\n function isHeading(type) {\n let match = /^(?:ATX|Setext)Heading(\\d)$/.exec(type.name);\n return match ? +match[1] : undefined;\n }\n function isList(type) {\n return type.name == \"OrderedList\" || type.name == \"BulletList\";\n }\n function findSectionEnd(headerNode, level) {\n let last = headerNode;\n for (;;) {\n let next = last.nextSibling, heading;\n if (!next || (heading = isHeading(next.type)) != null && heading <= level)\n break;\n last = next;\n }\n return last.to;\n }\n const headerIndent = /*@__PURE__*/foldService.of((state, start, end) => {\n for (let node = syntaxTree(state).resolveInner(end, -1); node; node = node.parent) {\n if (node.from < start)\n break;\n let heading = node.type.prop(headingProp);\n if (heading == null)\n continue;\n let upto = findSectionEnd(node, heading);\n if (upto > end)\n return { from: end, to: upto };\n }\n return null;\n });\n function mkLang(parser) {\n return new Language(data$1, parser, [headerIndent], \"markdown\");\n }\n /**\n Language support for strict CommonMark.\n */\n const commonmarkLanguage = /*@__PURE__*/mkLang(commonmark);\n const extended = /*@__PURE__*/commonmark.configure([GFM, Subscript, Superscript, Emoji, {\n props: [\n /*@__PURE__*/foldNodeProp.add({\n Table: (tree, state) => ({ from: state.doc.lineAt(tree.from).to, to: tree.to })\n })\n ]\n }]);\n /**\n Language support for [GFM](https://github.github.com/gfm/) plus\n subscript, superscript, and emoji syntax.\n */\n const markdownLanguage = /*@__PURE__*/mkLang(extended);\n function getCodeParser(languages, defaultLanguage) {\n return (info) => {\n if (info && languages) {\n let found = null;\n // Strip anything after whitespace\n info = /\\S*/.exec(info)[0];\n if (typeof languages == \"function\")\n found = languages(info);\n else\n found = LanguageDescription.matchLanguageName(languages, info, true);\n if (found instanceof LanguageDescription)\n return found.support ? found.support.language.parser : ParseContext.getSkippingParser(found.load());\n else if (found)\n return found.parser;\n }\n return defaultLanguage ? defaultLanguage.parser : null;\n };\n }\n\n class Context {\n constructor(node, from, to, spaceBefore, spaceAfter, type, item) {\n this.node = node;\n this.from = from;\n this.to = to;\n this.spaceBefore = spaceBefore;\n this.spaceAfter = spaceAfter;\n this.type = type;\n this.item = item;\n }\n blank(maxWidth, trailing = true) {\n let result = this.spaceBefore + (this.node.name == \"Blockquote\" ? \">\" : \"\");\n if (maxWidth != null) {\n while (result.length < maxWidth)\n result += \" \";\n return result;\n }\n else {\n for (let i = this.to - this.from - result.length - this.spaceAfter.length; i > 0; i--)\n result += \" \";\n return result + (trailing ? this.spaceAfter : \"\");\n }\n }\n marker(doc, add) {\n let number = this.node.name == \"OrderedList\" ? String((+itemNumber(this.item, doc)[2] + add)) : \"\";\n return this.spaceBefore + number + this.type + this.spaceAfter;\n }\n }\n function getContext$1(node, doc) {\n let nodes = [];\n for (let cur = node; cur && cur.name != \"Document\"; cur = cur.parent) {\n if (cur.name == \"ListItem\" || cur.name == \"Blockquote\" || cur.name == \"FencedCode\")\n nodes.push(cur);\n }\n let context = [];\n for (let i = nodes.length - 1; i >= 0; i--) {\n let node = nodes[i], match;\n let line = doc.lineAt(node.from), startPos = node.from - line.from;\n if (node.name == \"FencedCode\") {\n context.push(new Context(node, startPos, startPos, \"\", \"\", \"\", null));\n }\n else if (node.name == \"Blockquote\" && (match = /^ *>( ?)/.exec(line.text.slice(startPos)))) {\n context.push(new Context(node, startPos, startPos + match[0].length, \"\", match[1], \">\", null));\n }\n else if (node.name == \"ListItem\" && node.parent.name == \"OrderedList\" &&\n (match = /^( *)\\d+([.)])( *)/.exec(line.text.slice(startPos)))) {\n let after = match[3], len = match[0].length;\n if (after.length >= 4) {\n after = after.slice(0, after.length - 4);\n len -= 4;\n }\n context.push(new Context(node.parent, startPos, startPos + len, match[1], after, match[2], node));\n }\n else if (node.name == \"ListItem\" && node.parent.name == \"BulletList\" &&\n (match = /^( *)([-+*])( {1,4}\\[[ xX]\\])?( +)/.exec(line.text.slice(startPos)))) {\n let after = match[4], len = match[0].length;\n if (after.length > 4) {\n after = after.slice(0, after.length - 4);\n len -= 4;\n }\n let type = match[2];\n if (match[3])\n type += match[3].replace(/[xX]/, ' ');\n context.push(new Context(node.parent, startPos, startPos + len, match[1], after, type, node));\n }\n }\n return context;\n }\n function itemNumber(item, doc) {\n return /^(\\s*)(\\d+)(?=[.)])/.exec(doc.sliceString(item.from, item.from + 10));\n }\n function renumberList(after, doc, changes, offset = 0) {\n for (let prev = -1, node = after;;) {\n if (node.name == \"ListItem\") {\n let m = itemNumber(node, doc);\n let number = +m[2];\n if (prev >= 0) {\n if (number != prev + 1)\n return;\n changes.push({ from: node.from + m[1].length, to: node.from + m[0].length, insert: String(prev + 2 + offset) });\n }\n prev = number;\n }\n let next = node.nextSibling;\n if (!next)\n break;\n node = next;\n }\n }\n function normalizeIndent(content, state) {\n let blank = /^[ \\t]*/.exec(content)[0].length;\n if (!blank || state.facet(indentUnit) != \"\\t\")\n return content;\n let col = countColumn(content, 4, blank);\n let space = \"\";\n for (let i = col; i > 0;) {\n if (i >= 4) {\n space += \"\\t\";\n i -= 4;\n }\n else {\n space += \" \";\n i--;\n }\n }\n return space + content.slice(blank);\n }\n /**\n This command, when invoked in Markdown context with cursor\n selection(s), will create a new line with the markup for\n blockquotes and lists that were active on the old line. If the\n cursor was directly after the end of the markup for the old line,\n trailing whitespace and list markers are removed from that line.\n\n The command does nothing in non-Markdown context, so it should\n not be used as the only binding for Enter (even in a Markdown\n document, HTML and code regions might use a different language).\n */\n const insertNewlineContinueMarkup = ({ state, dispatch }) => {\n let tree = syntaxTree(state), { doc } = state;\n let dont = null, changes = state.changeByRange(range => {\n if (!range.empty || !markdownLanguage.isActiveAt(state, range.from))\n return dont = { range };\n let pos = range.from, line = doc.lineAt(pos);\n let context = getContext$1(tree.resolveInner(pos, -1), doc);\n while (context.length && context[context.length - 1].from > pos - line.from)\n context.pop();\n if (!context.length)\n return dont = { range };\n let inner = context[context.length - 1];\n if (inner.to - inner.spaceAfter.length > pos - line.from)\n return dont = { range };\n let emptyLine = pos >= (inner.to - inner.spaceAfter.length) && !/\\S/.test(line.text.slice(inner.to));\n // Empty line in list\n if (inner.item && emptyLine) {\n let first = inner.node.firstChild, second = inner.node.getChild(\"ListItem\", \"ListItem\");\n // Not second item or blank line before: delete a level of markup\n if (first.to >= pos || second && second.to < pos ||\n line.from > 0 && !/[^\\s>]/.test(doc.lineAt(line.from - 1).text)) {\n let next = context.length > 1 ? context[context.length - 2] : null;\n let delTo, insert = \"\";\n if (next && next.item) { // Re-add marker for the list at the next level\n delTo = line.from + next.from;\n insert = next.marker(doc, 1);\n }\n else {\n delTo = line.from + (next ? next.to : 0);\n }\n let changes = [{ from: delTo, to: pos, insert }];\n if (inner.node.name == \"OrderedList\")\n renumberList(inner.item, doc, changes, -2);\n if (next && next.node.name == \"OrderedList\")\n renumberList(next.item, doc, changes);\n return { range: EditorSelection.cursor(delTo + insert.length), changes };\n }\n else { // Move second item down, making tight two-item list non-tight\n let insert = blankLine(context, state, line);\n return { range: EditorSelection.cursor(pos + insert.length + 1),\n changes: { from: line.from, insert: insert + state.lineBreak } };\n }\n }\n if (inner.node.name == \"Blockquote\" && emptyLine && line.from) {\n let prevLine = doc.lineAt(line.from - 1), quoted = />\\s*$/.exec(prevLine.text);\n // Two aligned empty quoted lines in a row\n if (quoted && quoted.index == inner.from) {\n let changes = state.changes([{ from: prevLine.from + quoted.index, to: prevLine.to },\n { from: line.from + inner.from, to: line.to }]);\n return { range: range.map(changes), changes };\n }\n }\n let changes = [];\n if (inner.node.name == \"OrderedList\")\n renumberList(inner.item, doc, changes);\n let continued = inner.item && inner.item.from < line.from;\n let insert = \"\";\n // If not dedented\n if (!continued || /^[\\s\\d.)\\-+*>]*/.exec(line.text)[0].length >= inner.to) {\n for (let i = 0, e = context.length - 1; i <= e; i++) {\n insert += i == e && !continued ? context[i].marker(doc, 1)\n : context[i].blank(i < e ? countColumn(line.text, 4, context[i + 1].from) - insert.length : null);\n }\n }\n let from = pos;\n while (from > line.from && /\\s/.test(line.text.charAt(from - line.from - 1)))\n from--;\n insert = normalizeIndent(insert, state);\n if (nonTightList(inner.node, state.doc))\n insert = blankLine(context, state, line) + state.lineBreak + insert;\n changes.push({ from, to: pos, insert: state.lineBreak + insert });\n return { range: EditorSelection.cursor(from + insert.length + 1), changes };\n });\n if (dont)\n return false;\n dispatch(state.update(changes, { scrollIntoView: true, userEvent: \"input\" }));\n return true;\n };\n function isMark(node) {\n return node.name == \"QuoteMark\" || node.name == \"ListMark\";\n }\n function nonTightList(node, doc) {\n if (node.name != \"OrderedList\" && node.name != \"BulletList\")\n return false;\n let first = node.firstChild, second = node.getChild(\"ListItem\", \"ListItem\");\n if (!second)\n return false;\n let line1 = doc.lineAt(first.to), line2 = doc.lineAt(second.from);\n let empty = /^[\\s>]*$/.test(line1.text);\n return line1.number + (empty ? 0 : 1) < line2.number;\n }\n function blankLine(context, state, line) {\n let insert = \"\";\n for (let i = 0, e = context.length - 2; i <= e; i++) {\n insert += context[i].blank(i < e ? countColumn(line.text, 4, context[i + 1].from) - insert.length : null, i < e);\n }\n return normalizeIndent(insert, state);\n }\n function contextNodeForDelete(tree, pos) {\n let node = tree.resolveInner(pos, -1), scan = pos;\n if (isMark(node)) {\n scan = node.from;\n node = node.parent;\n }\n for (let prev; prev = node.childBefore(scan);) {\n if (isMark(prev)) {\n scan = prev.from;\n }\n else if (prev.name == \"OrderedList\" || prev.name == \"BulletList\") {\n node = prev.lastChild;\n scan = node.to;\n }\n else {\n break;\n }\n }\n return node;\n }\n /**\n This command will, when invoked in a Markdown context with the\n cursor directly after list or blockquote markup, delete one level\n of markup. When the markup is for a list, it will be replaced by\n spaces on the first invocation (a further invocation will delete\n the spaces), to make it easy to continue a list.\n\n When not after Markdown block markup, this command will return\n false, so it is intended to be bound alongside other deletion\n commands, with a higher precedence than the more generic commands.\n */\n const deleteMarkupBackward = ({ state, dispatch }) => {\n let tree = syntaxTree(state);\n let dont = null, changes = state.changeByRange(range => {\n let pos = range.from, { doc } = state;\n if (range.empty && markdownLanguage.isActiveAt(state, range.from)) {\n let line = doc.lineAt(pos);\n let context = getContext$1(contextNodeForDelete(tree, pos), doc);\n if (context.length) {\n let inner = context[context.length - 1];\n let spaceEnd = inner.to - inner.spaceAfter.length + (inner.spaceAfter ? 1 : 0);\n // Delete extra trailing space after markup\n if (pos - line.from > spaceEnd && !/\\S/.test(line.text.slice(spaceEnd, pos - line.from)))\n return { range: EditorSelection.cursor(line.from + spaceEnd),\n changes: { from: line.from + spaceEnd, to: pos } };\n if (pos - line.from == spaceEnd &&\n // Only apply this if we're on the line that has the\n // construct's syntax, or there's only indentation in the\n // target range\n (!inner.item || line.from <= inner.item.from || !/\\S/.test(line.text.slice(0, inner.to)))) {\n let start = line.from + inner.from;\n // Replace a list item marker with blank space\n if (inner.item && inner.node.from < inner.item.from && /\\S/.test(line.text.slice(inner.from, inner.to))) {\n let insert = inner.blank(countColumn(line.text, 4, inner.to) - countColumn(line.text, 4, inner.from));\n if (start == line.from)\n insert = normalizeIndent(insert, state);\n return { range: EditorSelection.cursor(start + insert.length),\n changes: { from: start, to: line.from + inner.to, insert } };\n }\n // Delete one level of indentation\n if (start < pos)\n return { range: EditorSelection.cursor(start), changes: { from: start, to: pos } };\n }\n }\n }\n return dont = { range };\n });\n if (dont)\n return false;\n dispatch(state.update(changes, { scrollIntoView: true, userEvent: \"delete\" }));\n return true;\n };\n\n /**\n A small keymap with Markdown-specific bindings. Binds Enter to\n [`insertNewlineContinueMarkup`](https://codemirror.net/6/docs/ref/#lang-markdown.insertNewlineContinueMarkup)\n and Backspace to\n [`deleteMarkupBackward`](https://codemirror.net/6/docs/ref/#lang-markdown.deleteMarkupBackward).\n */\n const markdownKeymap = [\n { key: \"Enter\", run: insertNewlineContinueMarkup },\n { key: \"Backspace\", run: deleteMarkupBackward }\n ];\n const htmlNoMatch = /*@__PURE__*/html$1({ matchClosingTags: false });\n /**\n Markdown language support.\n */\n function markdown(config = {}) {\n let { codeLanguages, defaultCodeLanguage, addKeymap = true, base: { parser } = commonmarkLanguage, completeHTMLTags = true } = config;\n if (!(parser instanceof MarkdownParser))\n throw new RangeError(\"Base parser provided to `markdown` should be a Markdown parser\");\n let extensions = config.extensions ? [config.extensions] : [];\n let support = [htmlNoMatch.support], defaultCode;\n if (defaultCodeLanguage instanceof LanguageSupport) {\n support.push(defaultCodeLanguage.support);\n defaultCode = defaultCodeLanguage.language;\n }\n else if (defaultCodeLanguage) {\n defaultCode = defaultCodeLanguage;\n }\n let codeParser = codeLanguages || defaultCode ? getCodeParser(codeLanguages, defaultCode) : undefined;\n extensions.push(parseCode({ codeParser, htmlParser: htmlNoMatch.language.parser }));\n if (addKeymap)\n support.push(Prec.high(keymap.of(markdownKeymap)));\n let lang = mkLang(parser.configure(extensions));\n if (completeHTMLTags)\n support.push(lang.data.of({ autocomplete: htmlTagCompletion }));\n return new LanguageSupport(lang, support);\n }\n function htmlTagCompletion(context) {\n let { state, pos } = context, m = /<[:\\-\\.\\w\\u00b7-\\uffff]*$/.exec(state.sliceDoc(pos - 25, pos));\n if (!m)\n return null;\n let tree = syntaxTree(state).resolveInner(pos, -1);\n while (tree && !tree.type.isTop) {\n if (tree.name == \"CodeBlock\" || tree.name == \"FencedCode\" || tree.name == \"ProcessingInstructionBlock\" ||\n tree.name == \"CommentBlock\" || tree.name == \"Link\" || tree.name == \"Image\")\n return null;\n tree = tree.parent;\n }\n return {\n from: pos - m[0].length, to: pos,\n options: htmlTagCompletions(),\n validFor: /^<[:\\-\\.\\w\\u00b7-\\uffff]*$/\n };\n }\n let _tagCompletions = null;\n function htmlTagCompletions() {\n if (_tagCompletions)\n return _tagCompletions;\n let result = htmlCompletionSource(new CompletionContext(EditorState.create({ extensions: htmlNoMatch }), 0, true));\n return _tagCompletions = result ? result.options : [];\n }\n\n const namedColors = /*@__PURE__*/new Map([\n ['aliceblue', '#f0f8ff'],\n ['antiquewhite', '#faebd7'],\n ['aqua', '#00ffff'],\n ['aquamarine', '#7fffd4'],\n ['azure', '#f0ffff'],\n ['beige', '#f5f5dc'],\n ['bisque', '#ffe4c4'],\n ['black', '#000000'],\n ['blanchedalmond', '#ffebcd'],\n ['blue', '#0000ff'],\n ['blueviolet', '#8a2be2'],\n ['brown', '#a52a2a'],\n ['burlywood', '#deb887'],\n ['cadetblue', '#5f9ea0'],\n ['chartreuse', '#7fff00'],\n ['chocolate', '#d2691e'],\n ['coral', '#ff7f50'],\n ['cornflowerblue', '#6495ed'],\n ['cornsilk', '#fff8dc'],\n ['crimson', '#dc143c'],\n ['cyan', '#00ffff'],\n ['darkblue', '#00008b'],\n ['darkcyan', '#008b8b'],\n ['darkgoldenrod', '#b8860b'],\n ['darkgray', '#a9a9a9'],\n ['darkgreen', '#006400'],\n ['darkgrey', '#a9a9a9'],\n ['darkkhaki', '#bdb76b'],\n ['darkmagenta', '#8b008b'],\n ['darkolivegreen', '#556b2f'],\n ['darkorange', '#ff8c00'],\n ['darkorchid', '#9932cc'],\n ['darkred', '#8b0000'],\n ['darksalmon', '#e9967a'],\n ['darkseagreen', '#8fbc8f'],\n ['darkslateblue', '#483d8b'],\n ['darkslategray', '#2f4f4f'],\n ['darkslategrey', '#2f4f4f'],\n ['darkturquoise', '#00ced1'],\n ['darkviolet', '#9400d3'],\n ['deeppink', '#ff1493'],\n ['deepskyblue', '#00bfff'],\n ['dimgray', '#696969'],\n ['dimgrey', '#696969'],\n ['dodgerblue', '#1e90ff'],\n ['firebrick', '#b22222'],\n ['floralwhite', '#fffaf0'],\n ['forestgreen', '#228b22'],\n ['fuchsia', '#ff00ff'],\n ['gainsboro', '#dcdcdc'],\n ['ghostwhite', '#f8f8ff'],\n ['goldenrod', '#daa520'],\n ['gold', '#ffd700'],\n ['gray', '#808080'],\n ['green', '#008000'],\n ['greenyellow', '#adff2f'],\n ['grey', '#808080'],\n ['honeydew', '#f0fff0'],\n ['hotpink', '#ff69b4'],\n ['indianred', '#cd5c5c'],\n ['indigo', '#4b0082'],\n ['ivory', '#fffff0'],\n ['khaki', '#f0e68c'],\n ['lavenderblush', '#fff0f5'],\n ['lavender', '#e6e6fa'],\n ['lawngreen', '#7cfc00'],\n ['lemonchiffon', '#fffacd'],\n ['lightblue', '#add8e6'],\n ['lightcoral', '#f08080'],\n ['lightcyan', '#e0ffff'],\n ['lightgoldenrodyellow', '#fafad2'],\n ['lightgray', '#d3d3d3'],\n ['lightgreen', '#90ee90'],\n ['lightgrey', '#d3d3d3'],\n ['lightpink', '#ffb6c1'],\n ['lightsalmon', '#ffa07a'],\n ['lightseagreen', '#20b2aa'],\n ['lightskyblue', '#87cefa'],\n ['lightslategray', '#778899'],\n ['lightslategrey', '#778899'],\n ['lightsteelblue', '#b0c4de'],\n ['lightyellow', '#ffffe0'],\n ['lime', '#00ff00'],\n ['limegreen', '#32cd32'],\n ['linen', '#faf0e6'],\n ['magenta', '#ff00ff'],\n ['maroon', '#800000'],\n ['mediumaquamarine', '#66cdaa'],\n ['mediumblue', '#0000cd'],\n ['mediumorchid', '#ba55d3'],\n ['mediumpurple', '#9370db'],\n ['mediumseagreen', '#3cb371'],\n ['mediumslateblue', '#7b68ee'],\n ['mediumspringgreen', '#00fa9a'],\n ['mediumturquoise', '#48d1cc'],\n ['mediumvioletred', '#c71585'],\n ['midnightblue', '#191970'],\n ['mintcream', '#f5fffa'],\n ['mistyrose', '#ffe4e1'],\n ['moccasin', '#ffe4b5'],\n ['navajowhite', '#ffdead'],\n ['navy', '#000080'],\n ['oldlace', '#fdf5e6'],\n ['olive', '#808000'],\n ['olivedrab', '#6b8e23'],\n ['orange', '#ffa500'],\n ['orangered', '#ff4500'],\n ['orchid', '#da70d6'],\n ['palegoldenrod', '#eee8aa'],\n ['palegreen', '#98fb98'],\n ['paleturquoise', '#afeeee'],\n ['palevioletred', '#db7093'],\n ['papayawhip', '#ffefd5'],\n ['peachpuff', '#ffdab9'],\n ['peru', '#cd853f'],\n ['pink', '#ffc0cb'],\n ['plum', '#dda0dd'],\n ['powderblue', '#b0e0e6'],\n ['purple', '#800080'],\n ['rebeccapurple', '#663399'],\n ['red', '#ff0000'],\n ['rosybrown', '#bc8f8f'],\n ['royalblue', '#4169e1'],\n ['saddlebrown', '#8b4513'],\n ['salmon', '#fa8072'],\n ['sandybrown', '#f4a460'],\n ['seagreen', '#2e8b57'],\n ['seashell', '#fff5ee'],\n ['sienna', '#a0522d'],\n ['silver', '#c0c0c0'],\n ['skyblue', '#87ceeb'],\n ['slateblue', '#6a5acd'],\n ['slategray', '#708090'],\n ['slategrey', '#708090'],\n ['snow', '#fffafa'],\n ['springgreen', '#00ff7f'],\n ['steelblue', '#4682b4'],\n ['tan', '#d2b48c'],\n ['teal', '#008080'],\n ['thistle', '#d8bfd8'],\n ['tomato', '#ff6347'],\n ['turquoise', '#40e0d0'],\n ['violet', '#ee82ee'],\n ['wheat', '#f5deb3'],\n ['white', '#ffffff'],\n ['whitesmoke', '#f5f5f5'],\n ['yellow', '#ffff00'],\n ['yellowgreen', '#9acd32'],\n ]);\n\n var __rest = function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n };\n const pickerState = /*@__PURE__*/new WeakMap();\n var ColorType = /*@__PURE__*/(function (ColorType) {\n ColorType[\"rgb\"] = \"RGB\";\n ColorType[\"hex\"] = \"HEX\";\n ColorType[\"named\"] = \"NAMED\";\n ColorType[\"hsl\"] = \"HSL\";\n return ColorType})(ColorType || (ColorType = {}));\n const rgbCallExpRegex = /rgb(?:a)?\\(\\s*(\\d{1,3}%?)\\s*,?\\s*(\\d{1,3}%?)\\s*,?\\s*(\\d{1,3}%?)\\s*(,\\s*0?\\.\\d+)?\\)/;\n const hslCallExpRegex = /hsl\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})%\\s*,\\s*(\\d{1,3})%\\s*(,\\s*0?\\.\\d+)?\\)/;\n const hexRegex = /(^|\\b)(#[0-9a-f]{3,9})(\\b|$)/i;\n function discoverColorsInCSS(syntaxTree, from, to, typeName, doc, language) {\n var _a;\n switch (typeName) {\n case 'AttributeValue': {\n const innerTree = syntaxTree.resolveInner(from, 0).tree;\n if (!innerTree) {\n return null;\n }\n const overlayTree = (_a = innerTree.prop(NodeProp.mounted)) === null || _a === void 0 ? void 0 : _a.tree;\n if ((overlayTree === null || overlayTree === void 0 ? void 0 : overlayTree.type.name) !== 'Styles') {\n return null;\n }\n const ret = [];\n overlayTree.iterate({\n from: 0,\n to: overlayTree.length,\n enter: ({ type, from: overlayFrom, to: overlayTo }) => {\n const maybeWidgetOptions = discoverColorsInCSS(syntaxTree, \n // We add one because the tree doesn't include the\n // quotation mark from the style tag\n from + 1 + overlayFrom, from + 1 + overlayTo, type.name, doc);\n if (maybeWidgetOptions) {\n if (Array.isArray(maybeWidgetOptions)) {\n throw new Error('Unexpected nested overlays');\n }\n ret.push(maybeWidgetOptions);\n }\n },\n });\n return ret;\n }\n case 'CallExpression': {\n const callExp = doc.sliceString(from, to);\n const result = parseCallExpression(callExp);\n if (!result) {\n return null;\n }\n return Object.assign(Object.assign({}, result), { from,\n to });\n }\n case 'ColorLiteral': {\n const result = parseColorLiteral(doc.sliceString(from, to));\n if (!result) {\n return null;\n }\n return Object.assign(Object.assign({}, result), { from,\n to });\n }\n case 'ValueName': {\n const colorName = doc.sliceString(from, to);\n const result = parseNamedColor(colorName);\n if (!result) {\n return null;\n }\n return Object.assign(Object.assign({}, result), { from,\n to });\n }\n default:\n return null;\n }\n }\n function parseCallExpression(callExp) {\n const fn = callExp.slice(0, 3);\n switch (fn) {\n case 'rgb': {\n const match = rgbCallExpRegex.exec(callExp);\n if (!match) {\n return null;\n }\n const [_, r, g, b, a] = match;\n const color = rgbToHex(r, g, b);\n return {\n colorType: ColorType.rgb,\n color,\n alpha: a || '',\n };\n }\n case 'hsl': {\n const match = hslCallExpRegex.exec(callExp);\n if (!match) {\n return null;\n }\n const [_, h, s, l, a] = match;\n const color = hslToHex(h, s, l);\n return {\n colorType: ColorType.hsl,\n color,\n alpha: a || '',\n };\n }\n default:\n return null;\n }\n }\n function parseColorLiteral(colorLiteral) {\n const match = hexRegex.exec(colorLiteral);\n if (!match) {\n return null;\n }\n const [color, alpha] = toFullHex(colorLiteral);\n return {\n colorType: ColorType.hex,\n color,\n alpha,\n };\n }\n function parseNamedColor(colorName) {\n const color = namedColors.get(colorName);\n if (!color) {\n return null;\n }\n return {\n colorType: ColorType.named,\n color,\n alpha: '',\n };\n }\n function colorPickersDecorations(view, discoverColors) {\n const widgets = [];\n const st = syntaxTree(view.state);\n for (const range of view.visibleRanges) {\n st.iterate({\n from: range.from,\n to: range.to,\n enter: ({ type, from, to }) => {\n var _a;\n const maybeWidgetOptions = discoverColors(st, from, to, type.name, view.state.doc, (_a = view.state.facet(language)) === null || _a === void 0 ? void 0 : _a.name);\n if (!maybeWidgetOptions) {\n return;\n }\n if (!Array.isArray(maybeWidgetOptions)) {\n widgets.push(Decoration.widget({\n widget: new ColorPickerWidget(maybeWidgetOptions),\n side: 1,\n }).range(maybeWidgetOptions.from));\n return;\n }\n for (const wo of maybeWidgetOptions) {\n widgets.push(Decoration.widget({\n widget: new ColorPickerWidget(wo),\n side: 1,\n }).range(wo.from));\n }\n },\n });\n }\n return Decoration.set(widgets);\n }\n function toFullHex(color) {\n if (color.length === 4) {\n // 3-char hex\n return [\n `#${color[1].repeat(2)}${color[2].repeat(2)}${color[3].repeat(2)}`,\n '',\n ];\n }\n if (color.length === 5) {\n // 4-char hex (alpha)\n return [\n `#${color[1].repeat(2)}${color[2].repeat(2)}${color[3].repeat(2)}`,\n color[4].repeat(2),\n ];\n }\n if (color.length === 9) {\n // 8-char hex (alpha)\n return [`#${color.slice(1, -2)}`, color.slice(-2)];\n }\n return [color, ''];\n }\n function rgbComponentToHex(component) {\n let numericValue;\n if (component.endsWith('%')) {\n // 0-100%\n const percent = Number(component.slice(0, -1));\n numericValue = Math.round((percent / 100) * 255.0);\n }\n else {\n numericValue = Number(component); // assume 0-255\n }\n return decimalToHex(numericValue);\n }\n function decimalToHex(decimal) {\n const hex = decimal.toString(16);\n return hex.length === 1 ? '0' + hex : hex;\n }\n function hexToRGBComponents(hex) {\n const r = hex.slice(1, 3);\n const g = hex.slice(3, 5);\n const b = hex.slice(5, 7);\n return [parseInt(r, 16), parseInt(g, 16), parseInt(b, 16)];\n }\n function rgbToHex(r, g, b) {\n return `#${rgbComponentToHex(r)}${rgbComponentToHex(g)}${rgbComponentToHex(b)}`;\n }\n function hslToHex(h, s, l) {\n const sFloat = Number(s) / 100;\n const lFloat = Number(l) / 100;\n const [r, g, b] = hslToRGB(Number(h), sFloat, lFloat);\n return `#${decimalToHex(r)}${decimalToHex(g)}${decimalToHex(b)}`;\n }\n function hslToRGB(hue, saturation, luminance) {\n // If there is no Saturation it means that it\u2019s a shade of grey.\n // So in that case we just need to convert the Luminance and set R,G and B to that level.\n if (saturation === 0) {\n const value = Math.round(luminance * 255);\n return [value, value, value];\n }\n let temp1;\n // If Luminance is smaller then 0.5 (50%) then temporary_1 = Luminance x (1.0+Saturation)\n if (luminance < 0.5) {\n temp1 = luminance * (1.0 + saturation);\n }\n else {\n // If Luminance is equal or larger then 0.5 (50%) then temporary_1 = Luminance + Saturation \u2013 Luminance x Saturation\n temp1 = luminance + saturation - luminance * saturation;\n }\n // temporary_2 = 2 x Luminance \u2013 temporary _1\n const temp2 = 2 * luminance - temp1;\n // The next step is to convert the 360 degrees in a circle to 1 by dividing the angle by 360.\n hue = hue / 360.0;\n // And now we need another temporary variable for each color channel, temporary_R, temporary_G and temporary_B.\n // All values need to be between 0 and 1. In our case all the values are between 0 and 1\n const tempR = clamp(hue + 0.333);\n const tempG = hue;\n const tempB = clamp(hue - 0.333);\n const red = hueToRGB(temp1, temp2, tempR);\n const green = hueToRGB(temp1, temp2, tempG);\n const blue = hueToRGB(temp1, temp2, tempB);\n return [\n Math.round(red * 255),\n Math.round(green * 255),\n Math.round(blue * 255),\n ];\n }\n // If you get a negative value you need to add 1 to it.\n // If you get a value above 1 you need to subtract 1 from it.\n function clamp(num) {\n if (num < 0) {\n return num + 1;\n }\n if (num > 1) {\n return num - 1;\n }\n return num;\n }\n /**\n * Now we need to do up to 3 tests to select the correct formula for each color channel. Let\u2019s start with Red.\n *\n * test 1 \u2013 If 6 x temporary_R is smaller then 1, Red = temporary_2 + (temporary_1 \u2013 temporary_2) x 6 x temporary_R\n * In the case the first test is larger then 1 check the following\n *\n * test 2 \u2013 If 2 x temporary_R is smaller then 1, Red = temporary_1\n * In the case the second test also is larger then 1 do the following\n *\n * test 3 \u2013 If 3 x temporary_R is smaller then 2, Red = temporary_2 + (temporary_1 \u2013 temporary_2) x (0.666 \u2013 temporary_R) x 6\n * In the case the third test also is larger then 2 you do the following\n *\n * Red = temporary_2\n */\n function hueToRGB(temp1, temp2, tempHue) {\n if (6 * tempHue < 1) {\n return temp2 + (temp1 - temp2) * 6 * tempHue;\n }\n if (2 * tempHue < 1) {\n return temp1;\n }\n if (3 * tempHue < 2) {\n return temp2 + (temp1 - temp2) * (0.666 - tempHue) * 6;\n }\n return temp2;\n }\n // https://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl/\n function rgbToHSL(r, g, b) {\n const redPercent = r / 255;\n const greenPercent = g / 255;\n const bluePercent = b / 255;\n const min = Math.min(redPercent, greenPercent, bluePercent);\n const max = Math.max(redPercent, greenPercent, bluePercent);\n const luminance = (max + min) / 2;\n // If the min and max value are the same, it means that there is no saturation. ...\n // If there is no Saturation, we don\u2019t need to calculate the Hue. So we set it to 0 degrees.\n if (max === min) {\n return [0, 0, luminance];\n }\n let saturation;\n // If Luminance is less or equal to 0.5, then Saturation = (max-min)/(max+min)\n if (luminance <= 0.5) {\n saturation = (max - min) / (max + min);\n }\n else {\n // If Luminance is bigger then 0.5. then Saturation = ( max-min)/(2.0-max-min)\n saturation = (max - min) / (2.0 - max - min);\n }\n let hue;\n // If Red is max, then Hue = (G-B)/(max-min)\n if (max === redPercent) {\n hue = (greenPercent - bluePercent) / (max - min);\n }\n else if (greenPercent === max) {\n // If Green is max, then Hue = 2.0 + (B-R)/(max-min)\n hue = 2.0 + (bluePercent - redPercent) / (max - min);\n }\n else {\n // If Blue is max, then Hue = 4.0 + (R-G)/(max-min)\n hue = 4.0 + (redPercent - greenPercent) / (max - min);\n }\n hue = Math.round(hue * 60); // convert to degrees\n // make hue positive angle/degrees\n while (hue < 0) {\n hue += 360;\n }\n return [hue, saturation, luminance];\n }\n const wrapperClassName = 'cm-css-color-picker-wrapper';\n class ColorPickerWidget extends WidgetType {\n constructor(_a) {\n var { color } = _a, state = __rest(_a, [\"color\"]);\n super();\n this.state = state;\n this.color = color;\n }\n eq(other) {\n return (other.state.colorType === this.state.colorType &&\n other.color === this.color &&\n other.state.from === this.state.from &&\n other.state.to === this.state.to &&\n other.state.alpha === this.state.alpha);\n }\n toDOM() {\n const picker = document.createElement('input');\n pickerState.set(picker, this.state);\n picker.type = 'color';\n picker.value = this.color;\n const wrapper = document.createElement('span');\n wrapper.appendChild(picker);\n wrapper.className = wrapperClassName;\n return wrapper;\n }\n ignoreEvent() {\n return false;\n }\n }\n const colorPickerTheme = /*@__PURE__*/EditorView.baseTheme({\n [`.${wrapperClassName}`]: {\n display: 'inline-block',\n outline: '1px solid #eee',\n marginRight: '0.6ch',\n height: '1em',\n width: '1em',\n transform: 'translateY(1px)',\n },\n [`.${wrapperClassName} input[type=\"color\"]`]: {\n cursor: 'pointer',\n height: '100%',\n width: '100%',\n padding: 0,\n border: 'none',\n '&::-webkit-color-swatch-wrapper': {\n padding: 0,\n },\n '&::-webkit-color-swatch': {\n border: 'none',\n },\n '&::-moz-color-swatch': {\n border: 'none',\n },\n },\n });\n const makeColorPicker = (options) => ViewPlugin.fromClass(class ColorPickerViewPlugin {\n constructor(view) {\n this.decorations = colorPickersDecorations(view, options.discoverColors);\n }\n update(update) {\n if (update.docChanged || update.viewportChanged) {\n this.decorations = colorPickersDecorations(update.view, options.discoverColors);\n }\n }\n }, {\n decorations: (v) => v.decorations,\n eventHandlers: {\n change: (e, view) => {\n const target = e.target;\n if (target.nodeName !== 'INPUT' ||\n !target.parentElement ||\n !target.parentElement.classList.contains(wrapperClassName)) {\n return false;\n }\n const data = pickerState.get(target);\n let converted = target.value + data.alpha;\n if (data.colorType === ColorType.rgb) {\n converted = `rgb(${hexToRGBComponents(target.value).join(', ')}${data.alpha})`;\n }\n else if (data.colorType === ColorType.named) {\n // If the hex is an exact match for another named color, prefer retaining name\n for (const [key, value] of namedColors.entries()) {\n if (value === target.value) {\n converted = key;\n }\n }\n }\n else if (data.colorType === ColorType.hsl) {\n const [r, g, b] = hexToRGBComponents(target.value);\n const [h, s, l] = rgbToHSL(r, g, b);\n converted = `hsl(${h}, ${Math.round(s * 100)}%, ${Math.round(l * 100)}%${data.alpha})`;\n }\n view.dispatch({\n changes: {\n from: data.from,\n to: data.to,\n insert: converted,\n },\n });\n return true;\n },\n },\n });\n const colorPicker = [/*@__PURE__*/makeColorPicker({ discoverColors: discoverColorsInCSS }), colorPickerTheme];\n\n var __defProp = Object.defineProperty;\n var __defProps = Object.defineProperties;\n var __getOwnPropDescs = Object.getOwnPropertyDescriptors;\n var __getOwnPropSymbols = Object.getOwnPropertySymbols;\n var __hasOwnProp = Object.prototype.hasOwnProperty;\n var __propIsEnum = Object.prototype.propertyIsEnumerable;\n var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\n var __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n };\n var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\n var __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n };\n function isNumber$3(code2) {\n return code2 > 47 && code2 < 58;\n }\n function isAlpha$1(code2, from, to) {\n from = from || 65;\n to = to || 90;\n code2 &= ~32;\n return code2 >= from && code2 <= to;\n }\n function isAlphaNumericWord(code2) {\n return isNumber$3(code2) || isAlphaWord(code2);\n }\n function isAlphaWord(code2) {\n return code2 === 95 || isAlpha$1(code2);\n }\n function isWhiteSpace$4(code2) {\n return code2 === 32 || code2 === 9 || code2 === 160;\n }\n function isSpace$2(code2) {\n return isWhiteSpace$4(code2) || code2 === 10 || code2 === 13;\n }\n function isQuote$3(code2) {\n return code2 === 39 || code2 === 34;\n }\n class Scanner$1 {\n constructor(str, start, end) {\n if (end == null && typeof str === \"string\") {\n end = str.length;\n }\n this.string = str;\n this.pos = this.start = start || 0;\n this.end = end || 0;\n }\n eof() {\n return this.pos >= this.end;\n }\n limit(start, end) {\n return new Scanner$1(this.string, start, end);\n }\n peek() {\n return this.string.charCodeAt(this.pos);\n }\n next() {\n if (this.pos < this.string.length) {\n return this.string.charCodeAt(this.pos++);\n }\n }\n eat(match) {\n const ch = this.peek();\n const ok = typeof match === \"function\" ? match(ch) : ch === match;\n if (ok) {\n this.next();\n }\n return ok;\n }\n eatWhile(match) {\n const start = this.pos;\n while (!this.eof() && this.eat(match)) {\n }\n return this.pos !== start;\n }\n backUp(n) {\n this.pos -= n || 1;\n }\n current() {\n return this.substring(this.start, this.pos);\n }\n substring(start, end) {\n return this.string.slice(start, end);\n }\n error(message, pos = this.pos) {\n return new ScannerError$1(`${message} at ${pos + 1}`, pos, this.string);\n }\n }\n class ScannerError$1 extends Error {\n constructor(message, pos, str) {\n super(message);\n this.pos = pos;\n this.string = str;\n }\n }\n function tokenScanner$1(tokens) {\n return {\n tokens,\n start: 0,\n pos: 0,\n size: tokens.length\n };\n }\n function peek$3(scanner) {\n return scanner.tokens[scanner.pos];\n }\n function next(scanner) {\n return scanner.tokens[scanner.pos++];\n }\n function slice(scanner, from = scanner.start, to = scanner.pos) {\n return scanner.tokens.slice(from, to);\n }\n function readable$1(scanner) {\n return scanner.pos < scanner.size;\n }\n function consume$2(scanner, test) {\n const token2 = peek$3(scanner);\n if (token2 && test(token2)) {\n scanner.pos++;\n return true;\n }\n return false;\n }\n function error$2(scanner, message, token2 = peek$3(scanner)) {\n if (token2 && token2.start != null) {\n message += ` at ${token2.start}`;\n }\n const err = new Error(message);\n err[\"pos\"] = token2 && token2.start;\n return err;\n }\n function abbreviation(abbr, options = {}) {\n const scanner = tokenScanner$1(abbr);\n const result = statements(scanner, options);\n if (readable$1(scanner)) {\n throw error$2(scanner, \"Unexpected character\");\n }\n return result;\n }\n function statements(scanner, options) {\n const result = {\n type: \"TokenGroup\",\n elements: []\n };\n let ctx = result;\n let node;\n const stack = [];\n while (readable$1(scanner)) {\n if (node = element$2(scanner, options) || group(scanner, options)) {\n ctx.elements.push(node);\n if (consume$2(scanner, isChildOperator)) {\n stack.push(ctx);\n ctx = node;\n } else if (consume$2(scanner, isSiblingOperator$1)) {\n continue;\n } else if (consume$2(scanner, isClimbOperator)) {\n do {\n if (stack.length) {\n ctx = stack.pop();\n }\n } while (consume$2(scanner, isClimbOperator));\n }\n } else {\n break;\n }\n }\n return result;\n }\n function group(scanner, options) {\n if (consume$2(scanner, isGroupStart)) {\n const result = statements(scanner, options);\n const token2 = next(scanner);\n if (isBracket$2(token2, \"group\", false)) {\n result.repeat = repeater(scanner);\n }\n return result;\n }\n }\n function element$2(scanner, options) {\n let attr;\n const elem = {\n type: \"TokenElement\",\n name: void 0,\n attributes: void 0,\n value: void 0,\n repeat: void 0,\n selfClose: false,\n elements: []\n };\n if (elementName(scanner, options)) {\n elem.name = slice(scanner);\n }\n while (readable$1(scanner)) {\n scanner.start = scanner.pos;\n if (!elem.repeat && !isEmpty(elem) && consume$2(scanner, isRepeater)) {\n elem.repeat = scanner.tokens[scanner.pos - 1];\n } else if (!elem.value && text(scanner)) {\n elem.value = getText(scanner);\n } else if (attr = shortAttribute(scanner, \"id\", options) || shortAttribute(scanner, \"class\", options) || attributeSet(scanner)) {\n if (!elem.attributes) {\n elem.attributes = Array.isArray(attr) ? attr.slice() : [attr];\n } else {\n elem.attributes = elem.attributes.concat(attr);\n }\n } else {\n if (!isEmpty(elem) && consume$2(scanner, isCloseOperator)) {\n elem.selfClose = true;\n if (!elem.repeat && consume$2(scanner, isRepeater)) {\n elem.repeat = scanner.tokens[scanner.pos - 1];\n }\n }\n break;\n }\n }\n return !isEmpty(elem) ? elem : void 0;\n }\n function attributeSet(scanner) {\n if (consume$2(scanner, isAttributeSetStart)) {\n const attributes = [];\n let attr;\n while (readable$1(scanner)) {\n if (attr = attribute(scanner)) {\n attributes.push(attr);\n } else if (consume$2(scanner, isAttributeSetEnd)) {\n break;\n } else if (!consume$2(scanner, isWhiteSpace$3)) {\n throw error$2(scanner, `Unexpected \"${peek$3(scanner).type}\" token`);\n }\n }\n return attributes;\n }\n }\n function shortAttribute(scanner, type, options) {\n if (isOperator$2(peek$3(scanner), type)) {\n scanner.pos++;\n const attr = {\n name: [createLiteral$1(type)]\n };\n if (options.jsx && text(scanner)) {\n attr.value = getText(scanner);\n attr.expression = true;\n } else {\n attr.value = literal$2(scanner) ? slice(scanner) : void 0;\n }\n return attr;\n }\n }\n function attribute(scanner) {\n if (quoted(scanner)) {\n return {\n value: slice(scanner)\n };\n }\n if (literal$2(scanner, true)) {\n return {\n name: slice(scanner),\n value: consume$2(scanner, isEquals) && (quoted(scanner) || literal$2(scanner, true)) ? slice(scanner) : void 0\n };\n }\n }\n function repeater(scanner) {\n return isRepeater(peek$3(scanner)) ? scanner.tokens[scanner.pos++] : void 0;\n }\n function quoted(scanner) {\n const start = scanner.pos;\n const quote2 = peek$3(scanner);\n if (isQuote$2(quote2)) {\n scanner.pos++;\n while (readable$1(scanner)) {\n if (isQuote$2(next(scanner), quote2.single)) {\n scanner.start = start;\n return true;\n }\n }\n throw error$2(scanner, \"Unclosed quote\", quote2);\n }\n return false;\n }\n function literal$2(scanner, allowBrackets) {\n const start = scanner.pos;\n const brackets = {\n attribute: 0,\n expression: 0,\n group: 0\n };\n while (readable$1(scanner)) {\n const token2 = peek$3(scanner);\n if (brackets.expression) {\n if (isBracket$2(token2, \"expression\")) {\n brackets[token2.context] += token2.open ? 1 : -1;\n }\n } else if (isQuote$2(token2) || isOperator$2(token2) || isWhiteSpace$3(token2) || isRepeater(token2)) {\n break;\n } else if (isBracket$2(token2)) {\n if (!allowBrackets) {\n break;\n }\n if (token2.open) {\n brackets[token2.context]++;\n } else if (!brackets[token2.context]) {\n break;\n } else {\n brackets[token2.context]--;\n }\n }\n scanner.pos++;\n }\n if (start !== scanner.pos) {\n scanner.start = start;\n return true;\n }\n return false;\n }\n function elementName(scanner, options) {\n const start = scanner.pos;\n if (options.jsx && consume$2(scanner, isCapitalizedLiteral)) {\n while (readable$1(scanner)) {\n const { pos } = scanner;\n if (!consume$2(scanner, isClassNameOperator) || !consume$2(scanner, isCapitalizedLiteral)) {\n scanner.pos = pos;\n break;\n }\n }\n }\n while (readable$1(scanner) && consume$2(scanner, isElementName)) {\n }\n if (scanner.pos !== start) {\n scanner.start = start;\n return true;\n }\n return false;\n }\n function text(scanner) {\n const start = scanner.pos;\n if (consume$2(scanner, isTextStart)) {\n let brackets = 0;\n while (readable$1(scanner)) {\n const token2 = next(scanner);\n if (isBracket$2(token2, \"expression\")) {\n if (token2.open) {\n brackets++;\n } else if (!brackets) {\n break;\n } else {\n brackets--;\n }\n }\n }\n scanner.start = start;\n return true;\n }\n return false;\n }\n function getText(scanner) {\n let from = scanner.start;\n let to = scanner.pos;\n if (isBracket$2(scanner.tokens[from], \"expression\", true)) {\n from++;\n }\n if (isBracket$2(scanner.tokens[to - 1], \"expression\", false)) {\n to--;\n }\n return slice(scanner, from, to);\n }\n function isBracket$2(token2, context, isOpen) {\n return Boolean(token2 && token2.type === \"Bracket\" && (!context || token2.context === context) && (isOpen == null || token2.open === isOpen));\n }\n function isOperator$2(token2, type) {\n return Boolean(token2 && token2.type === \"Operator\" && (!type || token2.operator === type));\n }\n function isQuote$2(token2, isSingle) {\n return Boolean(token2 && token2.type === \"Quote\" && (isSingle == null || token2.single === isSingle));\n }\n function isWhiteSpace$3(token2) {\n return Boolean(token2 && token2.type === \"WhiteSpace\");\n }\n function isEquals(token2) {\n return isOperator$2(token2, \"equal\");\n }\n function isRepeater(token2) {\n return Boolean(token2 && token2.type === \"Repeater\");\n }\n function isLiteral$2(token2) {\n return token2.type === \"Literal\";\n }\n function isCapitalizedLiteral(token2) {\n if (isLiteral$2(token2)) {\n const ch = token2.value.charCodeAt(0);\n return ch >= 65 && ch <= 90;\n }\n return false;\n }\n function isElementName(token2) {\n return token2.type === \"Literal\" || token2.type === \"RepeaterNumber\" || token2.type === \"RepeaterPlaceholder\";\n }\n function isClassNameOperator(token2) {\n return isOperator$2(token2, \"class\");\n }\n function isAttributeSetStart(token2) {\n return isBracket$2(token2, \"attribute\", true);\n }\n function isAttributeSetEnd(token2) {\n return isBracket$2(token2, \"attribute\", false);\n }\n function isTextStart(token2) {\n return isBracket$2(token2, \"expression\", true);\n }\n function isGroupStart(token2) {\n return isBracket$2(token2, \"group\", true);\n }\n function createLiteral$1(value) {\n return { type: \"Literal\", value };\n }\n function isEmpty(elem) {\n return !elem.name && !elem.value && !elem.attributes;\n }\n function isChildOperator(token2) {\n return isOperator$2(token2, \"child\");\n }\n function isSiblingOperator$1(token2) {\n return isOperator$2(token2, \"sibling\");\n }\n function isClimbOperator(token2) {\n return isOperator$2(token2, \"climb\");\n }\n function isCloseOperator(token2) {\n return isOperator$2(token2, \"close\");\n }\n function escaped(scanner) {\n if (scanner.eat(92)) {\n scanner.start = scanner.pos;\n if (!scanner.eof()) {\n scanner.pos++;\n }\n return true;\n }\n return false;\n }\n function tokenize$1(source) {\n const scanner = new Scanner$1(source);\n const result = [];\n const ctx = {\n group: 0,\n attribute: 0,\n expression: 0,\n quote: 0\n };\n let ch = 0;\n let token2;\n while (!scanner.eof()) {\n ch = scanner.peek();\n token2 = getToken$1(scanner, ctx);\n if (token2) {\n result.push(token2);\n if (token2.type === \"Quote\") {\n ctx.quote = ch === ctx.quote ? 0 : ch;\n } else if (token2.type === \"Bracket\") {\n ctx[token2.context] += token2.open ? 1 : -1;\n }\n } else {\n throw scanner.error(\"Unexpected character\");\n }\n }\n return result;\n }\n function getToken$1(scanner, ctx) {\n return field$3(scanner, ctx) || repeaterPlaceholder(scanner) || repeaterNumber(scanner) || repeater$1(scanner) || whiteSpace$1(scanner) || literal$1$1(scanner, ctx) || operator$1(scanner) || quote(scanner) || bracket$1(scanner);\n }\n function literal$1$1(scanner, ctx) {\n const start = scanner.pos;\n let value = \"\";\n while (!scanner.eof()) {\n if (escaped(scanner)) {\n value += scanner.current();\n continue;\n }\n const ch = scanner.peek();\n if (ch === ctx.quote || ch === 36 || isAllowedOperator(ch, ctx)) {\n break;\n }\n if (ctx.expression && ch === 125) {\n break;\n }\n if (!ctx.quote && !ctx.expression) {\n if (!ctx.attribute && !isElementName$1(ch)) {\n break;\n }\n if (isAllowedSpace(ch, ctx) || isAllowedRepeater(ch, ctx) || isQuote$3(ch) || bracketType(ch)) {\n break;\n }\n }\n value += scanner.string[scanner.pos++];\n }\n if (start !== scanner.pos) {\n scanner.start = start;\n return {\n type: \"Literal\",\n value,\n start,\n end: scanner.pos\n };\n }\n }\n function whiteSpace$1(scanner) {\n const start = scanner.pos;\n if (scanner.eatWhile(isSpace$2)) {\n return {\n type: \"WhiteSpace\",\n start,\n end: scanner.pos,\n value: scanner.substring(start, scanner.pos)\n };\n }\n }\n function quote(scanner) {\n const ch = scanner.peek();\n if (isQuote$3(ch)) {\n return {\n type: \"Quote\",\n single: ch === 39,\n start: scanner.pos++,\n end: scanner.pos\n };\n }\n }\n function bracket$1(scanner) {\n const ch = scanner.peek();\n const context = bracketType(ch);\n if (context) {\n return {\n type: \"Bracket\",\n open: isOpenBracket$2(ch),\n context,\n start: scanner.pos++,\n end: scanner.pos\n };\n }\n }\n function operator$1(scanner) {\n const op = operatorType$1(scanner.peek());\n if (op) {\n return {\n type: \"Operator\",\n operator: op,\n start: scanner.pos++,\n end: scanner.pos\n };\n }\n }\n function repeater$1(scanner) {\n const start = scanner.pos;\n if (scanner.eat(42)) {\n scanner.start = scanner.pos;\n let count = 1;\n let implicit = false;\n if (scanner.eatWhile(isNumber$3)) {\n count = Number(scanner.current());\n } else {\n implicit = true;\n }\n return {\n type: \"Repeater\",\n count,\n value: 0,\n implicit,\n start,\n end: scanner.pos\n };\n }\n }\n function repeaterPlaceholder(scanner) {\n const start = scanner.pos;\n if (scanner.eat(36) && scanner.eat(35)) {\n return {\n type: \"RepeaterPlaceholder\",\n value: void 0,\n start,\n end: scanner.pos\n };\n }\n scanner.pos = start;\n }\n function repeaterNumber(scanner) {\n const start = scanner.pos;\n if (scanner.eatWhile(36)) {\n const size = scanner.pos - start;\n let reverse = false;\n let base = 1;\n let parent = 0;\n if (scanner.eat(64)) {\n while (scanner.eat(94)) {\n parent++;\n }\n reverse = scanner.eat(45);\n scanner.start = scanner.pos;\n if (scanner.eatWhile(isNumber$3)) {\n base = Number(scanner.current());\n }\n }\n scanner.start = start;\n return {\n type: \"RepeaterNumber\",\n size,\n reverse,\n base,\n parent,\n start,\n end: scanner.pos\n };\n }\n }\n function field$3(scanner, ctx) {\n const start = scanner.pos;\n if ((ctx.expression || ctx.attribute) && scanner.eat(36) && scanner.eat(123)) {\n scanner.start = scanner.pos;\n let index;\n let name = \"\";\n if (scanner.eatWhile(isNumber$3)) {\n index = Number(scanner.current());\n name = scanner.eat(58) ? consumePlaceholder$2(scanner) : \"\";\n } else if (isAlpha$1(scanner.peek())) {\n name = consumePlaceholder$2(scanner);\n }\n if (scanner.eat(125)) {\n return {\n type: \"Field\",\n index,\n name,\n start,\n end: scanner.pos\n };\n }\n throw scanner.error(\"Expecting }\");\n }\n scanner.pos = start;\n }\n function consumePlaceholder$2(stream) {\n const stack = [];\n stream.start = stream.pos;\n while (!stream.eof()) {\n if (stream.eat(123)) {\n stack.push(stream.pos);\n } else if (stream.eat(125)) {\n if (!stack.length) {\n stream.pos--;\n break;\n }\n stack.pop();\n } else {\n stream.pos++;\n }\n }\n if (stack.length) {\n stream.pos = stack.pop();\n throw stream.error(`Expecting }`);\n }\n return stream.current();\n }\n function isAllowedOperator(ch, ctx) {\n const op = operatorType$1(ch);\n if (!op || ctx.quote || ctx.expression) {\n return false;\n }\n return !ctx.attribute || op === \"equal\";\n }\n function isAllowedSpace(ch, ctx) {\n return isSpace$2(ch) && !ctx.expression;\n }\n function isAllowedRepeater(ch, ctx) {\n return ch === 42 && !ctx.attribute && !ctx.expression;\n }\n function bracketType(ch) {\n if (ch === 40 || ch === 41) {\n return \"group\";\n }\n if (ch === 91 || ch === 93) {\n return \"attribute\";\n }\n if (ch === 123 || ch === 125) {\n return \"expression\";\n }\n }\n function operatorType$1(ch) {\n return ch === 62 && \"child\" || ch === 43 && \"sibling\" || ch === 94 && \"climb\" || ch === 46 && \"class\" || ch === 35 && \"id\" || ch === 47 && \"close\" || ch === 61 && \"equal\" || void 0;\n }\n function isOpenBracket$2(ch) {\n return ch === 123 || ch === 91 || ch === 40;\n }\n function isElementName$1(ch) {\n return isAlphaNumericWord(ch) || ch === 45 || ch === 58 || ch === 33;\n }\n const operators = {\n child: \">\",\n class: \".\",\n climb: \"^\",\n id: \"#\",\n equal: \"=\",\n close: \"/\",\n sibling: \"+\"\n };\n const tokenVisitor = {\n Literal(token2) {\n return token2.value;\n },\n Quote(token2) {\n return token2.single ? \"'\" : '\"';\n },\n Bracket(token2) {\n if (token2.context === \"attribute\") {\n return token2.open ? \"[\" : \"]\";\n } else if (token2.context === \"expression\") {\n return token2.open ? \"{\" : \"}\";\n } else {\n return token2.open ? \"(\" : \"}\";\n }\n },\n Operator(token2) {\n return operators[token2.operator];\n },\n Field(token2, state) {\n if (token2.index != null) {\n return token2.name ? `\\${${token2.index}:${token2.name}}` : `\\${${token2.index}`;\n } else if (token2.name) {\n return state.getVariable(token2.name);\n }\n return \"\";\n },\n RepeaterPlaceholder(token2, state) {\n let repeater2;\n for (let i = state.repeaters.length - 1; i >= 0; i--) {\n if (state.repeaters[i].implicit) {\n repeater2 = state.repeaters[i];\n break;\n }\n }\n state.inserted = true;\n return state.getText(repeater2 && repeater2.value);\n },\n RepeaterNumber(token2, state) {\n let value = 1;\n const lastIx = state.repeaters.length - 1;\n const repeater2 = state.repeaters[lastIx];\n if (repeater2) {\n value = token2.reverse ? token2.base + repeater2.count - repeater2.value - 1 : token2.base + repeater2.value;\n if (token2.parent) {\n const parentIx = Math.max(0, lastIx - token2.parent);\n if (parentIx !== lastIx) {\n const parentRepeater = state.repeaters[parentIx];\n value += repeater2.count * parentRepeater.value;\n }\n }\n }\n let result = String(value);\n while (result.length < token2.size) {\n result = \"0\" + result;\n }\n return result;\n },\n WhiteSpace(token2) {\n return token2.value;\n }\n };\n function stringify$1(token2, state) {\n if (!tokenVisitor[token2.type]) {\n throw new Error(`Unknown token ${token2.type}`);\n }\n return tokenVisitor[token2.type](token2, state);\n }\n const urlRegex = /^((https?:|ftp:|file:)?\\/\\/|(www|ftp)\\.)[^ ]*$/;\n const emailRegex = /^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,5}$/;\n function convert(abbr, options = {}) {\n let textInserted = false;\n let cleanText;\n if (options.text) {\n if (Array.isArray(options.text)) {\n cleanText = options.text.filter((s) => s.trim());\n } else {\n cleanText = options.text;\n }\n }\n const result = {\n type: \"Abbreviation\",\n children: convertGroup(abbr, {\n inserted: false,\n repeaters: [],\n text: options.text,\n cleanText,\n repeatGuard: options.maxRepeat || Number.POSITIVE_INFINITY,\n getText(pos) {\n var _a;\n textInserted = true;\n let value;\n if (Array.isArray(options.text)) {\n if (pos !== void 0 && pos >= 0 && pos < cleanText.length) {\n return cleanText[pos];\n }\n value = pos !== void 0 ? options.text[pos] : options.text.join(\"\\n\");\n } else {\n value = (_a = options.text) !== null && _a !== void 0 ? _a : \"\";\n }\n return value;\n },\n getVariable(name) {\n const varValue = options.variables && options.variables[name];\n return varValue != null ? varValue : name;\n }\n })\n };\n if (options.text != null && !textInserted) {\n const deepest = deepestNode(last$2(result.children));\n if (deepest) {\n const text2 = Array.isArray(options.text) ? options.text.join(\"\\n\") : options.text;\n insertText(deepest, text2);\n if (deepest.name === \"a\" && options.href) {\n insertHref(deepest, text2);\n }\n }\n }\n return result;\n }\n function convertStatement(node, state) {\n let result = [];\n if (node.repeat) {\n const original = node.repeat;\n const repeat = Object.assign({}, original);\n repeat.count = repeat.implicit && Array.isArray(state.text) ? state.cleanText.length : repeat.count || 1;\n let items;\n state.repeaters.push(repeat);\n for (let i = 0; i < repeat.count; i++) {\n repeat.value = i;\n node.repeat = repeat;\n items = isGroup(node) ? convertGroup(node, state) : convertElement(node, state);\n if (repeat.implicit && !state.inserted) {\n const target = last$2(items);\n const deepest = target && deepestNode(target);\n if (deepest) {\n insertText(deepest, state.getText(repeat.value));\n }\n }\n result = result.concat(items);\n if (--state.repeatGuard <= 0) {\n break;\n }\n }\n state.repeaters.pop();\n node.repeat = original;\n if (repeat.implicit) {\n state.inserted = true;\n }\n } else {\n result = result.concat(isGroup(node) ? convertGroup(node, state) : convertElement(node, state));\n }\n return result;\n }\n function convertElement(node, state) {\n let children = [];\n const elem = {\n type: \"AbbreviationNode\",\n name: node.name && stringifyName(node.name, state),\n value: node.value && stringifyValue$1(node.value, state),\n attributes: void 0,\n children,\n repeat: node.repeat && Object.assign({}, node.repeat),\n selfClosing: node.selfClose\n };\n let result = [elem];\n for (const child of node.elements) {\n children = children.concat(convertStatement(child, state));\n }\n if (node.attributes) {\n elem.attributes = [];\n for (const attr of node.attributes) {\n elem.attributes.push(convertAttribute(attr, state));\n }\n }\n if (!elem.name && !elem.attributes && elem.value && !elem.value.some(isField$1)) {\n result = result.concat(children);\n } else {\n elem.children = children;\n }\n return result;\n }\n function convertGroup(node, state) {\n let result = [];\n for (const child of node.elements) {\n result = result.concat(convertStatement(child, state));\n }\n if (node.repeat) {\n result = attachRepeater(result, node.repeat);\n }\n return result;\n }\n function convertAttribute(node, state) {\n let implied = false;\n let isBoolean = false;\n let valueType = node.expression ? \"expression\" : \"raw\";\n let value;\n const name = node.name && stringifyName(node.name, state);\n if (name && name[0] === \"!\") {\n implied = true;\n }\n if (name && name[name.length - 1] === \".\") {\n isBoolean = true;\n }\n if (node.value) {\n const tokens = node.value.slice();\n if (isQuote$2(tokens[0])) {\n const quote2 = tokens.shift();\n if (tokens.length && last$2(tokens).type === quote2.type) {\n tokens.pop();\n }\n valueType = quote2.single ? \"singleQuote\" : \"doubleQuote\";\n } else if (isBracket$2(tokens[0], \"expression\", true)) {\n valueType = \"expression\";\n tokens.shift();\n if (isBracket$2(last$2(tokens), \"expression\", false)) {\n tokens.pop();\n }\n }\n value = stringifyValue$1(tokens, state);\n }\n return {\n name: isBoolean || implied ? name.slice(implied ? 1 : 0, isBoolean ? -1 : void 0) : name,\n value,\n boolean: isBoolean,\n implied,\n valueType\n };\n }\n function stringifyName(tokens, state) {\n let str = \"\";\n for (let i = 0; i < tokens.length; i++) {\n str += stringify$1(tokens[i], state);\n }\n return str;\n }\n function stringifyValue$1(tokens, state) {\n const result = [];\n let str = \"\";\n for (let i = 0, token2; i < tokens.length; i++) {\n token2 = tokens[i];\n if (isField$1(token2)) {\n if (str) {\n result.push(str);\n str = \"\";\n }\n result.push(token2);\n } else {\n str += stringify$1(token2, state);\n }\n }\n if (str) {\n result.push(str);\n }\n return result;\n }\n function isGroup(node) {\n return node.type === \"TokenGroup\";\n }\n function isField$1(token2) {\n return typeof token2 === \"object\" && token2.type === \"Field\" && token2.index != null;\n }\n function last$2(arr) {\n return arr[arr.length - 1];\n }\n function deepestNode(node) {\n return node.children.length ? deepestNode(last$2(node.children)) : node;\n }\n function insertText(node, text2) {\n if (node.value) {\n const lastToken = last$2(node.value);\n if (typeof lastToken === \"string\") {\n node.value[node.value.length - 1] += text2;\n } else {\n node.value.push(text2);\n }\n } else {\n node.value = [text2];\n }\n }\n function insertHref(node, text2) {\n var _a;\n let href = \"\";\n if (urlRegex.test(text2)) {\n href = text2;\n if (!/\\w+:/.test(href) && !href.startsWith(\"//\")) {\n href = `http://${href}`;\n }\n } else if (emailRegex.test(text2)) {\n href = `mailto:${text2}`;\n }\n const hrefAttribute = (_a = node.attributes) === null || _a === void 0 ? void 0 : _a.find((attr) => attr.name === \"href\");\n if (!hrefAttribute) {\n node.attributes = [{ name: \"href\", value: [href], valueType: \"doubleQuote\" }];\n } else if (!hrefAttribute.value) {\n hrefAttribute.value = [href];\n }\n }\n function attachRepeater(items, repeater2) {\n for (const item of items) {\n if (!item.repeat) {\n item.repeat = Object.assign({}, repeater2);\n }\n }\n return items;\n }\n function parseAbbreviation(abbr, options) {\n try {\n const tokens = typeof abbr === \"string\" ? tokenize$1(abbr) : abbr;\n return convert(abbreviation(tokens, options), options);\n } catch (err) {\n if (err instanceof ScannerError$1 && typeof abbr === \"string\") {\n err.message += `\n${abbr}\n${\"-\".repeat(err.pos)}^`;\n }\n throw err;\n }\n }\n function tokenize(abbr, isValue2) {\n let brackets = 0;\n let token2;\n const scanner = new Scanner$1(abbr);\n const tokens = [];\n while (!scanner.eof()) {\n token2 = getToken(scanner, brackets === 0 && !isValue2);\n if (!token2) {\n throw scanner.error(\"Unexpected character\");\n }\n if (token2.type === \"Bracket\") {\n if (!brackets && token2.open) {\n mergeTokens(scanner, tokens);\n }\n brackets += token2.open ? 1 : -1;\n if (brackets < 0) {\n throw scanner.error(\"Unexpected bracket\", token2.start);\n }\n }\n tokens.push(token2);\n if (shouldConsumeDashAfter(token2) && (token2 = operator(scanner))) {\n tokens.push(token2);\n }\n }\n return tokens;\n }\n function getToken(scanner, short) {\n return field$2(scanner) || numberValue(scanner) || colorValue(scanner) || stringValue(scanner) || bracket(scanner) || operator(scanner) || whiteSpace(scanner) || literal$1(scanner, short);\n }\n function field$2(scanner) {\n const start = scanner.pos;\n if (scanner.eat(36) && scanner.eat(123)) {\n scanner.start = scanner.pos;\n let index;\n let name = \"\";\n if (scanner.eatWhile(isNumber$3)) {\n index = Number(scanner.current());\n name = scanner.eat(58) ? consumePlaceholder$1(scanner) : \"\";\n } else if (isAlpha$1(scanner.peek())) {\n name = consumePlaceholder$1(scanner);\n }\n if (scanner.eat(125)) {\n return {\n type: \"Field\",\n index,\n name,\n start,\n end: scanner.pos\n };\n }\n throw scanner.error(\"Expecting }\");\n }\n scanner.pos = start;\n }\n function consumePlaceholder$1(stream) {\n const stack = [];\n stream.start = stream.pos;\n while (!stream.eof()) {\n if (stream.eat(123)) {\n stack.push(stream.pos);\n } else if (stream.eat(125)) {\n if (!stack.length) {\n stream.pos--;\n break;\n }\n stack.pop();\n } else {\n stream.pos++;\n }\n }\n if (stack.length) {\n stream.pos = stack.pop();\n throw stream.error(`Expecting }`);\n }\n return stream.current();\n }\n function literal$1(scanner, short) {\n const start = scanner.pos;\n if (scanner.eat(isIdentPrefix)) {\n scanner.eatWhile(start ? isKeyword : isLiteral);\n } else if (scanner.eat(isAlphaWord)) {\n scanner.eatWhile(short ? isLiteral : isKeyword);\n } else {\n scanner.eat(46);\n scanner.eatWhile(isLiteral);\n }\n if (start !== scanner.pos) {\n scanner.start = start;\n return createLiteral(scanner, scanner.start = start);\n }\n }\n function createLiteral(scanner, start = scanner.start, end = scanner.pos) {\n return {\n type: \"Literal\",\n value: scanner.substring(start, end),\n start,\n end\n };\n }\n function numberValue(scanner) {\n const start = scanner.pos;\n if (consumeNumber$1(scanner)) {\n scanner.start = start;\n const rawValue = scanner.current();\n scanner.start = scanner.pos;\n scanner.eat(37) || scanner.eatWhile(isAlphaWord);\n return {\n type: \"NumberValue\",\n value: Number(rawValue),\n rawValue,\n unit: scanner.current(),\n start,\n end: scanner.pos\n };\n }\n }\n function stringValue(scanner) {\n const ch = scanner.peek();\n const start = scanner.pos;\n let finished = false;\n if (isQuote$3(ch)) {\n scanner.pos++;\n while (!scanner.eof()) {\n if (scanner.eat(ch)) {\n finished = true;\n break;\n } else {\n scanner.pos++;\n }\n }\n scanner.start = start;\n return {\n type: \"StringValue\",\n value: scanner.substring(start + 1, scanner.pos - (finished ? 1 : 0)),\n quote: ch === 39 ? \"single\" : \"double\",\n start,\n end: scanner.pos\n };\n }\n }\n function colorValue(scanner) {\n const start = scanner.pos;\n if (scanner.eat(35)) {\n const valueStart = scanner.pos;\n let color2 = \"\";\n let alpha = \"\";\n if (scanner.eatWhile(isHex)) {\n color2 = scanner.substring(valueStart, scanner.pos);\n alpha = colorAlpha(scanner);\n } else if (scanner.eat(116)) {\n color2 = \"0\";\n alpha = colorAlpha(scanner) || \"0\";\n } else {\n alpha = colorAlpha(scanner);\n }\n if (color2 || alpha || scanner.eof()) {\n const { r, g, b, a } = parseColor(color2, alpha);\n return {\n type: \"ColorValue\",\n r,\n g,\n b,\n a,\n raw: scanner.substring(start + 1, scanner.pos),\n start,\n end: scanner.pos\n };\n } else {\n return createLiteral(scanner, start);\n }\n }\n scanner.pos = start;\n }\n function colorAlpha(scanner) {\n const start = scanner.pos;\n if (scanner.eat(46)) {\n scanner.start = start;\n if (scanner.eatWhile(isNumber$3)) {\n return scanner.current();\n }\n return \"1\";\n }\n return \"\";\n }\n function whiteSpace(scanner) {\n const start = scanner.pos;\n if (scanner.eatWhile(isSpace$2)) {\n return {\n type: \"WhiteSpace\",\n start,\n end: scanner.pos\n };\n }\n }\n function bracket(scanner) {\n const ch = scanner.peek();\n if (isBracket(ch)) {\n return {\n type: \"Bracket\",\n open: ch === 40,\n start: scanner.pos++,\n end: scanner.pos\n };\n }\n }\n function operator(scanner) {\n const op = operatorType(scanner.peek());\n if (op) {\n return {\n type: \"Operator\",\n operator: op,\n start: scanner.pos++,\n end: scanner.pos\n };\n }\n }\n function consumeNumber$1(stream) {\n const start = stream.pos;\n stream.eat(45);\n const afterNegative = stream.pos;\n const hasDecimal = stream.eatWhile(isNumber$3);\n const prevPos = stream.pos;\n if (stream.eat(46)) {\n const hasFloat = stream.eatWhile(isNumber$3);\n if (!hasDecimal && !hasFloat) {\n stream.pos = prevPos;\n }\n }\n if (stream.pos === afterNegative) {\n stream.pos = start;\n }\n return stream.pos !== start;\n }\n function isIdentPrefix(code2) {\n return code2 === 64 || code2 === 36;\n }\n function operatorType(ch) {\n return ch === 43 && \"+\" || ch === 33 && \"!\" || ch === 44 && \",\" || ch === 58 && \":\" || ch === 45 && \"-\" || void 0;\n }\n function isHex(code2) {\n return isNumber$3(code2) || isAlpha$1(code2, 65, 70);\n }\n function isKeyword(code2) {\n return isAlphaNumericWord(code2) || code2 === 45;\n }\n function isBracket(code2) {\n return code2 === 40 || code2 === 41;\n }\n function isLiteral(code2) {\n return isAlphaWord(code2) || code2 === 37 || code2 === 47;\n }\n function parseColor(value, alpha) {\n let r = \"0\";\n let g = \"0\";\n let b = \"0\";\n let a = Number(alpha != null && alpha !== \"\" ? alpha : 1);\n if (value === \"t\") {\n a = 0;\n } else {\n switch (value.length) {\n case 0:\n break;\n case 1:\n r = g = b = value + value;\n break;\n case 2:\n r = g = b = value;\n break;\n case 3:\n r = value[0] + value[0];\n g = value[1] + value[1];\n b = value[2] + value[2];\n break;\n default:\n value += value;\n r = value.slice(0, 2);\n g = value.slice(2, 4);\n b = value.slice(4, 6);\n }\n }\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16),\n a\n };\n }\n function shouldConsumeDashAfter(token2) {\n return token2.type === \"ColorValue\" || token2.type === \"NumberValue\" && !token2.unit;\n }\n function mergeTokens(scanner, tokens) {\n let start = 0;\n let end = 0;\n while (tokens.length) {\n const token2 = last$1(tokens);\n if (token2.type === \"Literal\" || token2.type === \"NumberValue\") {\n start = token2.start;\n if (!end) {\n end = token2.end;\n }\n tokens.pop();\n } else {\n break;\n }\n }\n if (start !== end) {\n tokens.push(createLiteral(scanner, start, end));\n }\n }\n function last$1(arr) {\n return arr[arr.length - 1];\n }\n function tokenScanner(tokens) {\n return {\n tokens,\n start: 0,\n pos: 0,\n size: tokens.length\n };\n }\n function peek$2(scanner) {\n return scanner.tokens[scanner.pos];\n }\n function readable(scanner) {\n return scanner.pos < scanner.size;\n }\n function consume$1(scanner, test) {\n if (test(peek$2(scanner))) {\n scanner.pos++;\n return true;\n }\n return false;\n }\n function error$1(scanner, message, token2 = peek$2(scanner)) {\n if (token2 && token2.start != null) {\n message += ` at ${token2.start}`;\n }\n const err = new Error(message);\n err[\"pos\"] = token2 && token2.start;\n return err;\n }\n function parser(tokens, options = {}) {\n const scanner = tokenScanner(tokens);\n const result = [];\n let property2;\n while (readable(scanner)) {\n if (property2 = consumeProperty(scanner, options)) {\n result.push(property2);\n } else if (!consume$1(scanner, isSiblingOperator)) {\n throw error$1(scanner, \"Unexpected token\");\n }\n }\n return result;\n }\n function consumeProperty(scanner, options) {\n let name;\n let important = false;\n let valueFragment;\n const value = [];\n const token2 = peek$2(scanner);\n const valueMode = !!options.value;\n if (!valueMode && isLiteral$1(token2) && !isFunctionStart(scanner)) {\n scanner.pos++;\n name = token2.value;\n consume$1(scanner, isValueDelimiter);\n }\n if (valueMode) {\n consume$1(scanner, isWhiteSpace$2);\n }\n while (readable(scanner)) {\n if (consume$1(scanner, isImportant)) {\n important = true;\n } else if (valueFragment = consumeValue(scanner, valueMode)) {\n value.push(valueFragment);\n } else if (!consume$1(scanner, isFragmentDelimiter)) {\n break;\n }\n }\n if (name || value.length || important) {\n return { name, value, important };\n }\n }\n function consumeValue(scanner, inArgument) {\n const result = [];\n let token2;\n let args;\n while (readable(scanner)) {\n token2 = peek$2(scanner);\n if (isValue(token2)) {\n scanner.pos++;\n if (isLiteral$1(token2) && (args = consumeArguments(scanner))) {\n result.push({\n type: \"FunctionCall\",\n name: token2.value,\n arguments: args\n });\n } else {\n result.push(token2);\n }\n } else if (isValueDelimiter(token2) || inArgument && isWhiteSpace$2(token2)) {\n scanner.pos++;\n } else {\n break;\n }\n }\n return result.length ? { type: \"CSSValue\", value: result } : void 0;\n }\n function consumeArguments(scanner) {\n const start = scanner.pos;\n if (consume$1(scanner, isOpenBracket$1)) {\n const args = [];\n let value;\n while (readable(scanner) && !consume$1(scanner, isCloseBracket$1)) {\n if (value = consumeValue(scanner, true)) {\n args.push(value);\n } else if (!consume$1(scanner, isWhiteSpace$2) && !consume$1(scanner, isArgumentDelimiter)) {\n throw error$1(scanner, \"Unexpected token\");\n }\n }\n scanner.start = start;\n return args;\n }\n }\n function isLiteral$1(token2) {\n return token2 && token2.type === \"Literal\";\n }\n function isBracket$1(token2, open) {\n return token2 && token2.type === \"Bracket\" && (open == null || token2.open === open);\n }\n function isOpenBracket$1(token2) {\n return isBracket$1(token2, true);\n }\n function isCloseBracket$1(token2) {\n return isBracket$1(token2, false);\n }\n function isWhiteSpace$2(token2) {\n return token2 && token2.type === \"WhiteSpace\";\n }\n function isOperator$1(token2, operator2) {\n return token2 && token2.type === \"Operator\" && (!operator2 || token2.operator === operator2);\n }\n function isSiblingOperator(token2) {\n return isOperator$1(token2, \"+\");\n }\n function isArgumentDelimiter(token2) {\n return isOperator$1(token2, \",\");\n }\n function isFragmentDelimiter(token2) {\n return isArgumentDelimiter(token2);\n }\n function isImportant(token2) {\n return isOperator$1(token2, \"!\");\n }\n function isValue(token2) {\n return token2.type === \"StringValue\" || token2.type === \"ColorValue\" || token2.type === \"NumberValue\" || token2.type === \"Literal\" || token2.type === \"Field\";\n }\n function isValueDelimiter(token2) {\n return isOperator$1(token2, \":\") || isOperator$1(token2, \"-\");\n }\n function isFunctionStart(scanner) {\n const t1 = scanner.tokens[scanner.pos];\n const t2 = scanner.tokens[scanner.pos + 1];\n return t1 && t2 && isLiteral$1(t1) && t2.type === \"Bracket\";\n }\n function parse$2(abbr, options) {\n try {\n const tokens = typeof abbr === \"string\" ? tokenize(abbr, options && options.value) : abbr;\n return parser(tokens, options);\n } catch (err) {\n if (err instanceof ScannerError$1 && typeof abbr === \"string\") {\n err.message += `\n${abbr}\n${\"-\".repeat(err.pos)}^`;\n }\n throw err;\n }\n }\n function mergeAttributes(node, config2) {\n if (!node.attributes) {\n return;\n }\n const attributes = [];\n const lookup = {};\n for (const attr of node.attributes) {\n if (attr.name) {\n const attrName2 = attr.name;\n if (attrName2 in lookup) {\n const prev2 = lookup[attrName2];\n if (attrName2 === \"class\") {\n prev2.value = mergeValue(prev2.value, attr.value, \" \");\n } else {\n mergeDeclarations(prev2, attr, config2);\n }\n } else {\n attributes.push(lookup[attrName2] = Object.assign({}, attr));\n }\n } else {\n attributes.push(attr);\n }\n }\n node.attributes = attributes;\n }\n function mergeValue(prev2, next2, glue) {\n if (prev2 && next2) {\n if (prev2.length && glue) {\n append(prev2, glue);\n }\n for (const t of next2) {\n append(prev2, t);\n }\n return prev2;\n }\n const result = prev2 || next2;\n return result && result.slice();\n }\n function mergeDeclarations(dest, src, config2) {\n dest.name = src.name;\n if (!config2.options[\"output.reverseAttributes\"]) {\n dest.value = src.value;\n }\n if (!dest.implied) {\n dest.implied = src.implied;\n }\n if (!dest.boolean) {\n dest.boolean = src.boolean;\n }\n if (dest.valueType !== \"expression\") {\n dest.valueType = src.valueType;\n }\n return dest;\n }\n function append(tokens, value) {\n const lastIx = tokens.length - 1;\n if (typeof tokens[lastIx] === \"string\" && typeof value === \"string\") {\n tokens[lastIx] += value;\n } else {\n tokens.push(value);\n }\n }\n function walk(node, fn, state) {\n const ancestors = [node];\n const callback = (ctx) => {\n fn(ctx, ancestors, state);\n ancestors.push(ctx);\n ctx.children.forEach(callback);\n ancestors.pop();\n };\n node.children.forEach(callback);\n }\n function findDeepest(node) {\n let parent;\n while (node.children.length) {\n parent = node;\n node = node.children[node.children.length - 1];\n }\n return { parent, node };\n }\n function isNode(node) {\n return node.type === \"AbbreviationNode\";\n }\n function resolveSnippets(abbr, config2) {\n const stack = [];\n const reversed = config2.options[\"output.reverseAttributes\"];\n const resolve = (child) => {\n const snippet2 = child.name && config2.snippets[child.name];\n if (!snippet2 || stack.includes(snippet2)) {\n return null;\n }\n const snippetAbbr = parseAbbreviation(snippet2, config2);\n stack.push(snippet2);\n walkResolve(snippetAbbr, resolve);\n stack.pop();\n for (const topNode of snippetAbbr.children) {\n if (child.attributes) {\n const from = topNode.attributes || [];\n const to = child.attributes || [];\n topNode.attributes = reversed ? to.concat(from) : from.concat(to);\n }\n mergeNodes(child, topNode);\n }\n return snippetAbbr;\n };\n walkResolve(abbr, resolve);\n return abbr;\n }\n function walkResolve(node, resolve, config2) {\n let children = [];\n for (const child of node.children) {\n const resolved = resolve(child);\n if (resolved) {\n children = children.concat(resolved.children);\n const deepest = findDeepest(resolved);\n if (isNode(deepest.node)) {\n deepest.node.children = deepest.node.children.concat(walkResolve(child, resolve));\n }\n } else {\n children.push(child);\n child.children = walkResolve(child, resolve);\n }\n }\n return node.children = children;\n }\n function mergeNodes(from, to) {\n if (from.selfClosing) {\n to.selfClosing = true;\n }\n if (from.value != null) {\n to.value = from.value;\n }\n if (from.repeat) {\n to.repeat = from.repeat;\n }\n }\n function createOutputStream(options, level = 0) {\n return {\n options,\n value: \"\",\n level,\n offset: 0,\n line: 0,\n column: 0\n };\n }\n function push(stream, text2) {\n const processText = stream.options[\"output.text\"];\n _push(stream, processText(text2, stream.offset, stream.line, stream.column));\n }\n function pushString(stream, value) {\n const lines = splitByLines(value);\n for (let i = 0, il = lines.length - 1; i <= il; i++) {\n push(stream, lines[i]);\n if (i !== il) {\n pushNewline(stream, true);\n }\n }\n }\n function pushNewline(stream, indent) {\n const baseIndent = stream.options[\"output.baseIndent\"];\n const newline = stream.options[\"output.newline\"];\n push(stream, newline + baseIndent);\n stream.line++;\n stream.column = baseIndent.length;\n if (indent) {\n pushIndent(stream, indent === true ? stream.level : indent);\n }\n }\n function pushIndent(stream, size = stream.level) {\n const indent = stream.options[\"output.indent\"];\n push(stream, indent.repeat(Math.max(size, 0)));\n }\n function pushField(stream, index, placeholder) {\n const field2 = stream.options[\"output.field\"];\n _push(stream, field2(index, placeholder, stream.offset, stream.line, stream.column));\n }\n function tagName(name, config2) {\n return strCase(name, config2.options[\"output.tagCase\"]);\n }\n function attrName(name, config2) {\n return strCase(name, config2.options[\"output.attributeCase\"]);\n }\n function attrQuote(attr, config2, isOpen) {\n if (attr.valueType === \"expression\") {\n return isOpen ? \"{\" : \"}\";\n }\n return config2.options[\"output.attributeQuotes\"] === \"single\" ? \"'\" : '\"';\n }\n function isBooleanAttribute(attr, config2) {\n return attr.boolean || config2.options[\"output.booleanAttributes\"].includes((attr.name || \"\").toLowerCase());\n }\n function selfClose(config2) {\n switch (config2.options[\"output.selfClosingStyle\"]) {\n case \"xhtml\":\n return \" /\";\n case \"xml\":\n return \"/\";\n default:\n return \"\";\n }\n }\n function isInline(node, config2) {\n if (typeof node === \"string\") {\n return config2.options.inlineElements.includes(node.toLowerCase());\n }\n return node.name ? isInline(node.name, config2) : Boolean(node.value && !node.attributes);\n }\n function splitByLines(text2) {\n return text2.split(/\\r\\n|\\r|\\n/g);\n }\n function _push(stream, text2) {\n stream.value += text2;\n stream.offset += text2.length;\n stream.column += text2.length;\n }\n function strCase(str, type) {\n if (type) {\n return type === \"upper\" ? str.toUpperCase() : str.toLowerCase();\n }\n return str;\n }\n const elementMap = {\n p: \"span\",\n ul: \"li\",\n ol: \"li\",\n table: \"tr\",\n tr: \"td\",\n tbody: \"tr\",\n thead: \"tr\",\n tfoot: \"tr\",\n colgroup: \"col\",\n select: \"option\",\n optgroup: \"option\",\n audio: \"source\",\n video: \"source\",\n object: \"param\",\n map: \"area\"\n };\n function implicitTag(node, ancestors, config2) {\n if (!node.name && node.attributes) {\n resolveImplicitTag(node, ancestors, config2);\n }\n }\n function resolveImplicitTag(node, ancestors, config2) {\n const parent = getParentElement(ancestors);\n const contextName = config2.context ? config2.context.name : \"\";\n const parentName = lowercase(parent ? parent.name : contextName);\n node.name = elementMap[parentName] || (isInline(parentName, config2) ? \"span\" : \"div\");\n }\n function lowercase(str) {\n return (str || \"\").toLowerCase();\n }\n function getParentElement(ancestors) {\n for (let i = ancestors.length - 1; i >= 0; i--) {\n const elem = ancestors[i];\n if (isNode(elem)) {\n return elem;\n }\n }\n }\n var latin = {\n \"common\": [\"lorem\", \"ipsum\", \"dolor\", \"sit\", \"amet\", \"consectetur\", \"adipisicing\", \"elit\"],\n \"words\": [\n \"exercitationem\",\n \"perferendis\",\n \"perspiciatis\",\n \"laborum\",\n \"eveniet\",\n \"sunt\",\n \"iure\",\n \"nam\",\n \"nobis\",\n \"eum\",\n \"cum\",\n \"officiis\",\n \"excepturi\",\n \"odio\",\n \"consectetur\",\n \"quasi\",\n \"aut\",\n \"quisquam\",\n \"vel\",\n \"eligendi\",\n \"itaque\",\n \"non\",\n \"odit\",\n \"tempore\",\n \"quaerat\",\n \"dignissimos\",\n \"facilis\",\n \"neque\",\n \"nihil\",\n \"expedita\",\n \"vitae\",\n \"vero\",\n \"ipsum\",\n \"nisi\",\n \"animi\",\n \"cumque\",\n \"pariatur\",\n \"velit\",\n \"modi\",\n \"natus\",\n \"iusto\",\n \"eaque\",\n \"sequi\",\n \"illo\",\n \"sed\",\n \"ex\",\n \"et\",\n \"voluptatibus\",\n \"tempora\",\n \"veritatis\",\n \"ratione\",\n \"assumenda\",\n \"incidunt\",\n \"nostrum\",\n \"placeat\",\n \"aliquid\",\n \"fuga\",\n \"provident\",\n \"praesentium\",\n \"rem\",\n \"necessitatibus\",\n \"suscipit\",\n \"adipisci\",\n \"quidem\",\n \"possimus\",\n \"voluptas\",\n \"debitis\",\n \"sint\",\n \"accusantium\",\n \"unde\",\n \"sapiente\",\n \"voluptate\",\n \"qui\",\n \"aspernatur\",\n \"laudantium\",\n \"soluta\",\n \"amet\",\n \"quo\",\n \"aliquam\",\n \"saepe\",\n \"culpa\",\n \"libero\",\n \"ipsa\",\n \"dicta\",\n \"reiciendis\",\n \"nesciunt\",\n \"doloribus\",\n \"autem\",\n \"impedit\",\n \"minima\",\n \"maiores\",\n \"repudiandae\",\n \"ipsam\",\n \"obcaecati\",\n \"ullam\",\n \"enim\",\n \"totam\",\n \"delectus\",\n \"ducimus\",\n \"quis\",\n \"voluptates\",\n \"dolores\",\n \"molestiae\",\n \"harum\",\n \"dolorem\",\n \"quia\",\n \"voluptatem\",\n \"molestias\",\n \"magni\",\n \"distinctio\",\n \"omnis\",\n \"illum\",\n \"dolorum\",\n \"voluptatum\",\n \"ea\",\n \"quas\",\n \"quam\",\n \"corporis\",\n \"quae\",\n \"blanditiis\",\n \"atque\",\n \"deserunt\",\n \"laboriosam\",\n \"earum\",\n \"consequuntur\",\n \"hic\",\n \"cupiditate\",\n \"quibusdam\",\n \"accusamus\",\n \"ut\",\n \"rerum\",\n \"error\",\n \"minus\",\n \"eius\",\n \"ab\",\n \"ad\",\n \"nemo\",\n \"fugit\",\n \"officia\",\n \"at\",\n \"in\",\n \"id\",\n \"quos\",\n \"reprehenderit\",\n \"numquam\",\n \"iste\",\n \"fugiat\",\n \"sit\",\n \"inventore\",\n \"beatae\",\n \"repellendus\",\n \"magnam\",\n \"recusandae\",\n \"quod\",\n \"explicabo\",\n \"doloremque\",\n \"aperiam\",\n \"consequatur\",\n \"asperiores\",\n \"commodi\",\n \"optio\",\n \"dolor\",\n \"labore\",\n \"temporibus\",\n \"repellat\",\n \"veniam\",\n \"architecto\",\n \"est\",\n \"esse\",\n \"mollitia\",\n \"nulla\",\n \"a\",\n \"similique\",\n \"eos\",\n \"alias\",\n \"dolore\",\n \"tenetur\",\n \"deleniti\",\n \"porro\",\n \"facere\",\n \"maxime\",\n \"corrupti\"\n ]\n };\n var ru = {\n \"common\": [\"\\u0434\\u0430\\u043B\\u0435\\u043A\\u043E-\\u0434\\u0430\\u043B\\u0435\\u043A\\u043E\", \"\\u0437\\u0430\", \"\\u0441\\u043B\\u043E\\u0432\\u0435\\u0441\\u043D\\u044B\\u043C\\u0438\", \"\\u0433\\u043E\\u0440\\u0430\\u043C\\u0438\", \"\\u0432 \\u0441\\u0442\\u0440\\u0430\\u043D\\u0435\", \"\\u0433\\u043B\\u0430\\u0441\\u043D\\u044B\\u0445\", \"\\u0438 \\u0441\\u043E\\u0433\\u043B\\u0430\\u0441\\u043D\\u044B\\u0445\", \"\\u0436\\u0438\\u0432\\u0443\\u0442\", \"\\u0440\\u044B\\u0431\\u043D\\u044B\\u0435\", \"\\u0442\\u0435\\u043A\\u0441\\u0442\\u044B\"],\n \"words\": [\n \"\\u0432\\u0434\\u0430\\u043B\\u0438\",\n \"\\u043E\\u0442 \\u0432\\u0441\\u0435\\u0445\",\n \"\\u043E\\u043D\\u0438\",\n \"\\u0431\\u0443\\u043A\\u0432\\u0435\\u043D\\u043D\\u044B\\u0445\",\n \"\\u0434\\u043E\\u043C\\u0430\\u0445\",\n \"\\u043D\\u0430 \\u0431\\u0435\\u0440\\u0435\\u0433\\u0443\",\n \"\\u0441\\u0435\\u043C\\u0430\\u043D\\u0442\\u0438\\u043A\\u0430\",\n \"\\u0431\\u043E\\u043B\\u044C\\u0448\\u043E\\u0433\\u043E\",\n \"\\u044F\\u0437\\u044B\\u043A\\u043E\\u0432\\u043E\\u0433\\u043E\",\n \"\\u043E\\u043A\\u0435\\u0430\\u043D\\u0430\",\n \"\\u043C\\u0430\\u043B\\u0435\\u043D\\u044C\\u043A\\u0438\\u0439\",\n \"\\u0440\\u0443\\u0447\\u0435\\u0435\\u043A\",\n \"\\u0434\\u0430\\u043B\\u044C\",\n \"\\u0436\\u0443\\u0440\\u0447\\u0438\\u0442\",\n \"\\u043F\\u043E \\u0432\\u0441\\u0435\\u0439\",\n \"\\u043E\\u0431\\u0435\\u0441\\u043F\\u0435\\u0447\\u0438\\u0432\\u0430\\u0435\\u0442\",\n \"\\u0435\\u0435\",\n \"\\u0432\\u0441\\u0435\\u043C\\u0438\",\n \"\\u043D\\u0435\\u043E\\u0431\\u0445\\u043E\\u0434\\u0438\\u043C\\u044B\\u043C\\u0438\",\n \"\\u043F\\u0440\\u0430\\u0432\\u0438\\u043B\\u0430\\u043C\\u0438\",\n \"\\u044D\\u0442\\u0430\",\n \"\\u043F\\u0430\\u0440\\u0430\\u0434\\u0438\\u0433\\u043C\\u0430\\u0442\\u0438\\u0447\\u0435\\u0441\\u043A\\u0430\\u044F\",\n \"\\u0441\\u0442\\u0440\\u0430\\u043D\\u0430\",\n \"\\u043A\\u043E\\u0442\\u043E\\u0440\\u043E\\u0439\",\n \"\\u0436\\u0430\\u0440\\u0435\\u043D\\u043D\\u044B\\u0435\",\n \"\\u043F\\u0440\\u0435\\u0434\\u043B\\u043E\\u0436\\u0435\\u043D\\u0438\\u044F\",\n \"\\u0437\\u0430\\u043B\\u0435\\u0442\\u0430\\u044E\\u0442\",\n \"\\u043F\\u0440\\u044F\\u043C\\u043E\",\n \"\\u0440\\u043E\\u0442\",\n \"\\u0434\\u0430\\u0436\\u0435\",\n \"\\u0432\\u0441\\u0435\\u043C\\u043E\\u0433\\u0443\\u0449\\u0430\\u044F\",\n \"\\u043F\\u0443\\u043D\\u043A\\u0442\\u0443\\u0430\\u0446\\u0438\\u044F\",\n \"\\u043D\\u0435\",\n \"\\u0438\\u043C\\u0435\\u0435\\u0442\",\n \"\\u0432\\u043B\\u0430\\u0441\\u0442\\u0438\",\n \"\\u043D\\u0430\\u0434\",\n \"\\u0440\\u044B\\u0431\\u043D\\u044B\\u043C\\u0438\",\n \"\\u0442\\u0435\\u043A\\u0441\\u0442\\u0430\\u043C\\u0438\",\n \"\\u0432\\u0435\\u0434\\u0443\\u0449\\u0438\\u043C\\u0438\",\n \"\\u0431\\u0435\\u0437\\u043E\\u0440\\u0444\\u043E\\u0433\\u0440\\u0430\\u0444\\u0438\\u0447\\u043D\\u044B\\u0439\",\n \"\\u043E\\u0431\\u0440\\u0430\\u0437\",\n \"\\u0436\\u0438\\u0437\\u043D\\u0438\",\n \"\\u043E\\u0434\\u043D\\u0430\\u0436\\u0434\\u044B\",\n \"\\u043E\\u0434\\u043D\\u0430\",\n \"\\u043C\\u0430\\u043B\\u0435\\u043D\\u044C\\u043A\\u0430\\u044F\",\n \"\\u0441\\u0442\\u0440\\u043E\\u0447\\u043A\\u0430\",\n \"\\u0440\\u044B\\u0431\\u043D\\u043E\\u0433\\u043E\",\n \"\\u0442\\u0435\\u043A\\u0441\\u0442\\u0430\",\n \"\\u0438\\u043C\\u0435\\u043D\\u0438\",\n \"lorem\",\n \"ipsum\",\n \"\\u0440\\u0435\\u0448\\u0438\\u043B\\u0430\",\n \"\\u0432\\u044B\\u0439\\u0442\\u0438\",\n \"\\u0431\\u043E\\u043B\\u044C\\u0448\\u043E\\u0439\",\n \"\\u043C\\u0438\\u0440\",\n \"\\u0433\\u0440\\u0430\\u043C\\u043C\\u0430\\u0442\\u0438\\u043A\\u0438\",\n \"\\u0432\\u0435\\u043B\\u0438\\u043A\\u0438\\u0439\",\n \"\\u043E\\u043A\\u0441\\u043C\\u043E\\u043A\\u0441\",\n \"\\u043F\\u0440\\u0435\\u0434\\u0443\\u043F\\u0440\\u0435\\u0436\\u0434\\u0430\\u043B\",\n \"\\u043E\",\n \"\\u0437\\u043B\\u044B\\u0445\",\n \"\\u0437\\u0430\\u043F\\u044F\\u0442\\u044B\\u0445\",\n \"\\u0434\\u0438\\u043A\\u0438\\u0445\",\n \"\\u0437\\u043D\\u0430\\u043A\\u0430\\u0445\",\n \"\\u0432\\u043E\\u043F\\u0440\\u043E\\u0441\\u0430\",\n \"\\u043A\\u043E\\u0432\\u0430\\u0440\\u043D\\u044B\\u0445\",\n \"\\u0442\\u043E\\u0447\\u043A\\u0430\\u0445\",\n \"\\u0437\\u0430\\u043F\\u044F\\u0442\\u043E\\u0439\",\n \"\\u043D\\u043E\",\n \"\\u0442\\u0435\\u043A\\u0441\\u0442\",\n \"\\u0434\\u0430\\u043B\",\n \"\\u0441\\u0431\\u0438\\u0442\\u044C\",\n \"\\u0441\\u0435\\u0431\\u044F\",\n \"\\u0442\\u043E\\u043B\\u043A\\u0443\",\n \"\\u043E\\u043D\",\n \"\\u0441\\u043E\\u0431\\u0440\\u0430\\u043B\",\n \"\\u0441\\u0435\\u043C\\u044C\",\n \"\\u0441\\u0432\\u043E\\u0438\\u0445\",\n \"\\u0437\\u0430\\u0433\\u043B\\u0430\\u0432\\u043D\\u044B\\u0445\",\n \"\\u0431\\u0443\\u043A\\u0432\",\n \"\\u043F\\u043E\\u0434\\u043F\\u043E\\u044F\\u0441\\u0430\\u043B\",\n \"\\u0438\\u043D\\u0438\\u0446\\u0438\\u0430\\u043B\",\n \"\\u0437\\u0430\",\n \"\\u043F\\u043E\\u044F\\u0441\",\n \"\\u043F\\u0443\\u0441\\u0442\\u0438\\u043B\\u0441\\u044F\",\n \"\\u0434\\u043E\\u0440\\u043E\\u0433\\u0443\",\n \"\\u0432\\u0437\\u043E\\u0431\\u0440\\u0430\\u0432\\u0448\\u0438\\u0441\\u044C\",\n \"\\u043F\\u0435\\u0440\\u0432\\u0443\\u044E\",\n \"\\u0432\\u0435\\u0440\\u0448\\u0438\\u043D\\u0443\",\n \"\\u043A\\u0443\\u0440\\u0441\\u0438\\u0432\\u043D\\u044B\\u0445\",\n \"\\u0433\\u043E\\u0440\",\n \"\\u0431\\u0440\\u043E\\u0441\\u0438\\u043B\",\n \"\\u043F\\u043E\\u0441\\u043B\\u0435\\u0434\\u043D\\u0438\\u0439\",\n \"\\u0432\\u0437\\u0433\\u043B\\u044F\\u0434\",\n \"\\u043D\\u0430\\u0437\\u0430\\u0434\",\n \"\\u0441\\u0438\\u043B\\u0443\\u044D\\u0442\",\n \"\\u0441\\u0432\\u043E\\u0435\\u0433\\u043E\",\n \"\\u0440\\u043E\\u0434\\u043D\\u043E\\u0433\\u043E\",\n \"\\u0433\\u043E\\u0440\\u043E\\u0434\\u0430\",\n \"\\u0431\\u0443\\u043A\\u0432\\u043E\\u0433\\u0440\\u0430\\u0434\",\n \"\\u0437\\u0430\\u0433\\u043E\\u043B\\u043E\\u0432\\u043E\\u043A\",\n \"\\u0434\\u0435\\u0440\\u0435\\u0432\\u043D\\u0438\",\n \"\\u0430\\u043B\\u0444\\u0430\\u0432\\u0438\\u0442\",\n \"\\u043F\\u043E\\u0434\\u0437\\u0430\\u0433\\u043E\\u043B\\u043E\\u0432\\u043E\\u043A\",\n \"\\u0441\\u0432\\u043E\\u0435\\u0433\\u043E\",\n \"\\u043F\\u0435\\u0440\\u0435\\u0443\\u043B\\u043A\\u0430\",\n \"\\u0433\\u0440\\u0443\\u0441\\u0442\\u043D\\u044B\\u0439\",\n \"\\u0440\\u0435\\u0442\\u043E\\u0440\\u0438\\u0447\\u0435\\u0441\\u043A\\u0438\\u0439\",\n \"\\u0432\\u043E\\u043F\\u0440\\u043E\\u0441\",\n \"\\u0441\\u043A\\u0430\\u0442\\u0438\\u043B\\u0441\\u044F\",\n \"\\u0435\\u0433\\u043E\",\n \"\\u0449\\u0435\\u043A\\u0435\",\n \"\\u043F\\u0440\\u043E\\u0434\\u043E\\u043B\\u0436\\u0438\\u043B\",\n \"\\u0441\\u0432\\u043E\\u0439\",\n \"\\u043F\\u0443\\u0442\\u044C\",\n \"\\u0434\\u043E\\u0440\\u043E\\u0433\\u0435\",\n \"\\u0432\\u0441\\u0442\\u0440\\u0435\\u0442\\u0438\\u043B\",\n \"\\u0440\\u0443\\u043A\\u043E\\u043F\\u0438\\u0441\\u044C\",\n \"\\u043E\\u043D\\u0430\",\n \"\\u043F\\u0440\\u0435\\u0434\\u0443\\u043F\\u0440\\u0435\\u0434\\u0438\\u043B\\u0430\",\n \"\\u043C\\u043E\\u0435\\u0439\",\n \"\\u0432\\u0441\\u0435\",\n \"\\u043F\\u0435\\u0440\\u0435\\u043F\\u0438\\u0441\\u044B\\u0432\\u0430\\u0435\\u0442\\u0441\\u044F\",\n \"\\u043D\\u0435\\u0441\\u043A\\u043E\\u043B\\u044C\\u043A\\u043E\",\n \"\\u0440\\u0430\\u0437\",\n \"\\u0435\\u0434\\u0438\\u043D\\u0441\\u0442\\u0432\\u0435\\u043D\\u043D\\u043E\\u0435\",\n \"\\u0447\\u0442\\u043E\",\n \"\\u043C\\u0435\\u043D\\u044F\",\n \"\\u043E\\u0441\\u0442\\u0430\\u043B\\u043E\\u0441\\u044C\",\n \"\\u044D\\u0442\\u043E\",\n \"\\u043F\\u0440\\u0438\\u0441\\u0442\\u0430\\u0432\\u043A\\u0430\",\n \"\\u0432\\u043E\\u0437\\u0432\\u0440\\u0430\\u0449\\u0430\\u0439\\u0441\\u044F\",\n \"\\u0442\\u044B\",\n \"\\u043B\\u0443\\u0447\\u0448\\u0435\",\n \"\\u0441\\u0432\\u043E\\u044E\",\n \"\\u0431\\u0435\\u0437\\u043E\\u043F\\u0430\\u0441\\u043D\\u0443\\u044E\",\n \"\\u0441\\u0442\\u0440\\u0430\\u043D\\u0443\",\n \"\\u043F\\u043E\\u0441\\u043B\\u0443\\u0448\\u0430\\u0432\\u0448\\u0438\\u0441\\u044C\",\n \"\\u0440\\u0443\\u043A\\u043E\\u043F\\u0438\\u0441\\u0438\",\n \"\\u043D\\u0430\\u0448\",\n \"\\u043F\\u0440\\u043E\\u0434\\u043E\\u043B\\u0436\\u0438\\u043B\",\n \"\\u0441\\u0432\\u043E\\u0439\",\n \"\\u043F\\u0443\\u0442\\u044C\",\n \"\\u0432\\u0441\\u043A\\u043E\\u0440\\u0435\",\n \"\\u0435\\u043C\\u0443\",\n \"\\u043F\\u043E\\u0432\\u0441\\u0442\\u0440\\u0435\\u0447\\u0430\\u043B\\u0441\\u044F\",\n \"\\u043A\\u043E\\u0432\\u0430\\u0440\\u043D\\u044B\\u0439\",\n \"\\u0441\\u043E\\u0441\\u0442\\u0430\\u0432\\u0438\\u0442\\u0435\\u043B\\u044C\",\n \"\\u0440\\u0435\\u043A\\u043B\\u0430\\u043C\\u043D\\u044B\\u0445\",\n \"\\u0442\\u0435\\u043A\\u0441\\u0442\\u043E\\u0432\",\n \"\\u043D\\u0430\\u043F\\u043E\\u0438\\u0432\\u0448\\u0438\\u0439\",\n \"\\u044F\\u0437\\u044B\\u043A\\u043E\\u043C\",\n \"\\u0440\\u0435\\u0447\\u044C\\u044E\",\n \"\\u0437\\u0430\\u043C\\u0430\\u043D\\u0438\\u0432\\u0448\\u0438\\u0439\",\n \"\\u0441\\u0432\\u043E\\u0435\",\n \"\\u0430\\u0433\\u0435\\u043D\\u0442\\u0441\\u0442\\u0432\\u043E\",\n \"\\u043A\\u043E\\u0442\\u043E\\u0440\\u043E\\u0435\",\n \"\\u0438\\u0441\\u043F\\u043E\\u043B\\u044C\\u0437\\u043E\\u0432\\u0430\\u043B\\u043E\",\n \"\\u0441\\u043D\\u043E\\u0432\\u0430\",\n \"\\u0441\\u043D\\u043E\\u0432\\u0430\",\n \"\\u0441\\u0432\\u043E\\u0438\\u0445\",\n \"\\u043F\\u0440\\u043E\\u0435\\u043A\\u0442\\u0430\\u0445\",\n \"\\u0435\\u0441\\u043B\\u0438\",\n \"\\u043F\\u0435\\u0440\\u0435\\u043F\\u0438\\u0441\\u0430\\u043B\\u0438\",\n \"\\u0442\\u043E\",\n \"\\u0436\\u0438\\u0432\\u0435\\u0442\",\n \"\\u0442\\u0430\\u043C\",\n \"\\u0434\\u043E\",\n \"\\u0441\\u0438\\u0445\",\n \"\\u043F\\u043E\\u0440\"\n ]\n };\n var sp = {\n \"common\": [\"mujer\", \"uno\", \"dolor\", \"m\\xE1s\", \"de\", \"poder\", \"mismo\", \"si\"],\n \"words\": [\n \"ejercicio\",\n \"preferencia\",\n \"perspicacia\",\n \"laboral\",\n \"pa\\xF1o\",\n \"suntuoso\",\n \"molde\",\n \"namibia\",\n \"planeador\",\n \"mirar\",\n \"dem\\xE1s\",\n \"oficinista\",\n \"excepci\\xF3n\",\n \"odio\",\n \"consecuencia\",\n \"casi\",\n \"auto\",\n \"chicharra\",\n \"velo\",\n \"elixir\",\n \"ataque\",\n \"no\",\n \"odio\",\n \"temporal\",\n \"cu\\xF3rum\",\n \"dign\\xEDsimo\",\n \"facilismo\",\n \"letra\",\n \"nihilista\",\n \"expedici\\xF3n\",\n \"alma\",\n \"alveolar\",\n \"aparte\",\n \"le\\xF3n\",\n \"animal\",\n \"como\",\n \"paria\",\n \"belleza\",\n \"modo\",\n \"natividad\",\n \"justo\",\n \"ataque\",\n \"s\\xE9quito\",\n \"pillo\",\n \"sed\",\n \"ex\",\n \"y\",\n \"voluminoso\",\n \"temporalidad\",\n \"verdades\",\n \"racional\",\n \"asunci\\xF3n\",\n \"incidente\",\n \"marejada\",\n \"placenta\",\n \"amanecer\",\n \"fuga\",\n \"previsor\",\n \"presentaci\\xF3n\",\n \"lejos\",\n \"necesariamente\",\n \"sospechoso\",\n \"adiposidad\",\n \"quind\\xEDo\",\n \"p\\xF3cima\",\n \"voluble\",\n \"d\\xE9bito\",\n \"sinti\\xF3\",\n \"accesorio\",\n \"falda\",\n \"sapiencia\",\n \"volutas\",\n \"queso\",\n \"permacultura\",\n \"laudo\",\n \"soluciones\",\n \"entero\",\n \"pan\",\n \"litro\",\n \"tonelada\",\n \"culpa\",\n \"libertario\",\n \"mosca\",\n \"dictado\",\n \"reincidente\",\n \"nascimiento\",\n \"dolor\",\n \"escolar\",\n \"impedimento\",\n \"m\\xEDnima\",\n \"mayores\",\n \"repugnante\",\n \"dulce\",\n \"obcecado\",\n \"monta\\xF1a\",\n \"enigma\",\n \"total\",\n \"delet\\xE9reo\",\n \"d\\xE9cima\",\n \"c\\xE1bala\",\n \"fotograf\\xEDa\",\n \"dolores\",\n \"molesto\",\n \"olvido\",\n \"paciencia\",\n \"resiliencia\",\n \"voluntad\",\n \"molestias\",\n \"magn\\xEDfico\",\n \"distinci\\xF3n\",\n \"ovni\",\n \"marejada\",\n \"cerro\",\n \"torre\",\n \"y\",\n \"abogada\",\n \"manantial\",\n \"corporal\",\n \"agua\",\n \"crep\\xFAsculo\",\n \"ataque\",\n \"desierto\",\n \"laboriosamente\",\n \"angustia\",\n \"afortunado\",\n \"alma\",\n \"encefalograma\",\n \"materialidad\",\n \"cosas\",\n \"o\",\n \"renuncia\",\n \"error\",\n \"menos\",\n \"conejo\",\n \"abad\\xEDa\",\n \"analfabeto\",\n \"remo\",\n \"fugacidad\",\n \"oficio\",\n \"en\",\n \"alm\\xE1cigo\",\n \"vos\",\n \"pan\",\n \"represi\\xF3n\",\n \"n\\xFAmeros\",\n \"triste\",\n \"refugiado\",\n \"trote\",\n \"inventor\",\n \"corchea\",\n \"repelente\",\n \"magma\",\n \"recusado\",\n \"patr\\xF3n\",\n \"expl\\xEDcito\",\n \"paloma\",\n \"s\\xEDndrome\",\n \"inmune\",\n \"autoinmune\",\n \"comodidad\",\n \"ley\",\n \"vietnamita\",\n \"demonio\",\n \"tasmania\",\n \"repeler\",\n \"ap\\xE9ndice\",\n \"arquitecto\",\n \"columna\",\n \"yugo\",\n \"computador\",\n \"mula\",\n \"a\",\n \"prop\\xF3sito\",\n \"fantas\\xEDa\",\n \"alias\",\n \"rayo\",\n \"tenedor\",\n \"deleznable\",\n \"ventana\",\n \"cara\",\n \"anemia\",\n \"corrupto\"\n ]\n };\n const vocabularies = { ru, sp, latin };\n const reLorem = /^lorem([a-z]*)(\\d*)(-\\d*)?$/i;\n function lorem(node, ancestors, config2) {\n let m;\n if (node.name && (m = node.name.match(reLorem))) {\n const db = vocabularies[m[1]] || vocabularies.latin;\n const minWordCount = m[2] ? Math.max(1, Number(m[2])) : 30;\n const maxWordCount = m[3] ? Math.max(minWordCount, Number(m[3].slice(1))) : minWordCount;\n const wordCount = rand(minWordCount, maxWordCount);\n const repeat = node.repeat || findRepeater(ancestors);\n node.name = node.attributes = void 0;\n node.value = [paragraph(db, wordCount, !repeat || repeat.value === 0)];\n if (node.repeat && ancestors.length > 1) {\n resolveImplicitTag(node, ancestors, config2);\n }\n }\n }\n function rand(from, to) {\n return Math.floor(Math.random() * (to - from) + from);\n }\n function sample(arr, count) {\n const len = arr.length;\n const iterations = Math.min(len, count);\n const result = [];\n while (result.length < iterations) {\n const str = arr[rand(0, len)];\n if (!result.includes(str)) {\n result.push(str);\n }\n }\n return result;\n }\n function choice(val) {\n return val[rand(0, val.length - 1)];\n }\n function sentence(words, end) {\n if (words.length) {\n words = [capitalize(words[0])].concat(words.slice(1));\n }\n return words.join(\" \") + (end || choice(\"?!...\"));\n }\n function capitalize(word) {\n return word[0].toUpperCase() + word.slice(1);\n }\n function insertCommas(words) {\n if (words.length < 2) {\n return words;\n }\n words = words.slice();\n const len = words.length;\n const hasComma = /,$/;\n let totalCommas = 0;\n if (len > 3 && len <= 6) {\n totalCommas = rand(0, 1);\n } else if (len > 6 && len <= 12) {\n totalCommas = rand(0, 2);\n } else {\n totalCommas = rand(1, 4);\n }\n for (let i = 0, pos; i < totalCommas; i++) {\n pos = rand(0, len - 2);\n if (!hasComma.test(words[pos])) {\n words[pos] += \",\";\n }\n }\n return words;\n }\n function paragraph(dict, wordCount, startWithCommon) {\n const result = [];\n let totalWords = 0;\n let words;\n if (startWithCommon && dict.common) {\n words = dict.common.slice(0, wordCount);\n totalWords += words.length;\n result.push(sentence(insertCommas(words), \".\"));\n }\n while (totalWords < wordCount) {\n words = sample(dict.words, Math.min(rand(2, 30), wordCount - totalWords));\n totalWords += words.length;\n result.push(sentence(insertCommas(words)));\n }\n return result.join(\" \");\n }\n function findRepeater(ancestors) {\n for (let i = ancestors.length - 1; i >= 0; i--) {\n const element2 = ancestors[i];\n if (element2.type === \"AbbreviationNode\" && element2.repeat) {\n return element2.repeat;\n }\n }\n }\n function jsx(node) {\n if (node.attributes) {\n node.attributes.forEach(rename);\n }\n }\n function rename(attr) {\n if (attr.name === \"class\") {\n attr.name = \"className\";\n } else if (attr.name === \"for\") {\n attr.name = \"htmlFor\";\n }\n }\n function xsl(node) {\n if (matchesName(node.name) && node.attributes && (node.children.length || node.value)) {\n node.attributes = node.attributes.filter(isAllowed);\n }\n }\n function isAllowed(attr) {\n return attr.name !== \"select\";\n }\n function matchesName(name) {\n return name === \"xsl:variable\" || name === \"xsl:with-param\";\n }\n const reElement = /^(-+)([a-z0-9]+[a-z0-9-]*)/i;\n const reModifier = /^(_+)([a-z0-9]+[a-z0-9-_]*)/i;\n const blockCandidates1 = (className) => /^[a-z]\\-/i.test(className);\n const blockCandidates2 = (className) => /^[a-z]/i.test(className);\n function bem(node, ancestors, config2) {\n expandClassNames(node);\n expandShortNotation(node, ancestors, config2);\n }\n function expandClassNames(node) {\n const data = getBEMData(node);\n const classNames = [];\n for (const cl of data.classNames) {\n const ix = cl.indexOf(\"_\");\n if (ix > 0 && !cl.startsWith(\"-\")) {\n classNames.push(cl.slice(0, ix));\n classNames.push(cl.slice(ix));\n } else {\n classNames.push(cl);\n }\n }\n if (classNames.length) {\n data.classNames = classNames.filter(uniqueClass);\n data.block = findBlockName(data.classNames);\n updateClass(node, data.classNames.join(\" \"));\n }\n }\n function expandShortNotation(node, ancestors, config2) {\n const data = getBEMData(node);\n const classNames = [];\n const { options } = config2;\n const path = ancestors.slice(1).concat(node);\n for (let cl of data.classNames) {\n let prefix = \"\";\n let m;\n const originalClass = cl;\n if (m = cl.match(reElement)) {\n prefix = getBlockName(path, m[1].length, config2.context) + options[\"bem.element\"] + m[2];\n classNames.push(prefix);\n cl = cl.slice(m[0].length);\n }\n if (m = cl.match(reModifier)) {\n if (!prefix) {\n prefix = getBlockName(path, m[1].length);\n classNames.push(prefix);\n }\n classNames.push(`${prefix}${options[\"bem.modifier\"]}${m[2]}`);\n cl = cl.slice(m[0].length);\n }\n if (cl === originalClass) {\n classNames.push(originalClass);\n }\n }\n const arrClassNames = classNames.filter(uniqueClass);\n if (arrClassNames.length) {\n updateClass(node, arrClassNames.join(\" \"));\n }\n }\n function getBEMData(node) {\n if (!node._bem) {\n let classValue = \"\";\n if (node.attributes) {\n for (const attr of node.attributes) {\n if (attr.name === \"class\" && attr.value) {\n classValue = stringifyValue(attr.value);\n break;\n }\n }\n }\n node._bem = parseBEM(classValue);\n }\n return node._bem;\n }\n function getBEMDataFromContext(context) {\n if (!context._bem) {\n context._bem = parseBEM(context.attributes && context.attributes.class || \"\");\n }\n return context._bem;\n }\n function parseBEM(classValue) {\n const classNames = classValue ? classValue.split(/\\s+/) : [];\n return {\n classNames,\n block: findBlockName(classNames)\n };\n }\n function getBlockName(ancestors, depth = 0, context) {\n const maxParentIx = 0;\n let parentIx = Math.max(ancestors.length - depth, maxParentIx);\n do {\n const parent = ancestors[parentIx];\n if (parent) {\n const data = getBEMData(parent);\n if (data.block) {\n return data.block;\n }\n }\n } while (maxParentIx < parentIx--);\n if (context) {\n const data = getBEMDataFromContext(context);\n if (data.block) {\n return data.block;\n }\n }\n return \"\";\n }\n function findBlockName(classNames) {\n return find(classNames, blockCandidates1) || find(classNames, blockCandidates2) || void 0;\n }\n function find(classNames, filter) {\n for (const cl of classNames) {\n if (reElement.test(cl) || reModifier.test(cl)) {\n break;\n }\n if (filter(cl)) {\n return cl;\n }\n }\n }\n function updateClass(node, value) {\n for (const attr of node.attributes) {\n if (attr.name === \"class\") {\n attr.value = [value];\n break;\n }\n }\n }\n function stringifyValue(value) {\n let result = \"\";\n for (const t of value) {\n result += typeof t === \"string\" ? t : t.name;\n }\n return result;\n }\n function uniqueClass(item, ix, arr) {\n return !!item && arr.indexOf(item) === ix;\n }\n function walk$1(abbr, visitor, state) {\n const callback = (ctx, index, items) => {\n const { parent, current } = state;\n state.parent = current;\n state.current = ctx;\n visitor(ctx, index, items, state, next2);\n state.current = current;\n state.parent = parent;\n };\n const next2 = (node, index, items) => {\n state.ancestors.push(state.current);\n callback(node, index, items);\n state.ancestors.pop();\n };\n abbr.children.forEach(callback);\n }\n function createWalkState(config2) {\n return {\n current: null,\n parent: void 0,\n ancestors: [],\n config: config2,\n field: 1,\n out: createOutputStream(config2.options)\n };\n }\n const caret = [{ type: \"Field\", index: 0, name: \"\" }];\n function isSnippet(node) {\n return node ? !node.name && !node.attributes : false;\n }\n function isInlineElement(node, config2) {\n return node ? isInline(node, config2) : false;\n }\n function isField(token2) {\n return typeof token2 === \"object\" && token2.type === \"Field\";\n }\n function pushTokens(tokens, state) {\n const { out } = state;\n let largestIndex = -1;\n for (const t of tokens) {\n if (typeof t === \"string\") {\n pushString(out, t);\n } else {\n pushField(out, state.field + t.index, t.name);\n if (t.index > largestIndex) {\n largestIndex = t.index;\n }\n }\n }\n if (largestIndex !== -1) {\n state.field += largestIndex + 1;\n }\n }\n function splitByLines$1(tokens) {\n const result = [];\n let line = [];\n for (const t of tokens) {\n if (typeof t === \"string\") {\n const lines = t.split(/\\r\\n?|\\n/g);\n line.push(lines.shift() || \"\");\n while (lines.length) {\n result.push(line);\n line = [lines.shift() || \"\"];\n }\n } else {\n line.push(t);\n }\n }\n line.length && result.push(line);\n return result;\n }\n function shouldOutputAttribute(attr) {\n return !attr.implied || attr.valueType !== \"raw\" || !!attr.value && attr.value.length > 0;\n }\n function template(text2) {\n const tokens = [];\n const scanner = { pos: 0, text: text2 };\n let placeholder;\n let offset = scanner.pos;\n let pos = scanner.pos;\n while (scanner.pos < scanner.text.length) {\n pos = scanner.pos;\n if (placeholder = consumePlaceholder(scanner)) {\n if (offset !== scanner.pos) {\n tokens.push(text2.slice(offset, pos));\n }\n tokens.push(placeholder);\n offset = scanner.pos;\n } else {\n scanner.pos++;\n }\n }\n if (offset !== scanner.pos) {\n tokens.push(text2.slice(offset));\n }\n return tokens;\n }\n function consumePlaceholder(scanner) {\n if (peek(scanner) === 91) {\n const start = ++scanner.pos;\n let namePos = start;\n let afterPos = start;\n let stack = 1;\n while (scanner.pos < scanner.text.length) {\n const code2 = peek(scanner);\n if (isTokenStart(code2)) {\n namePos = scanner.pos;\n while (isToken(peek(scanner))) {\n scanner.pos++;\n }\n afterPos = scanner.pos;\n } else {\n if (code2 === 91) {\n stack++;\n } else if (code2 === 93) {\n if (--stack === 0) {\n return {\n before: scanner.text.slice(start, namePos),\n after: scanner.text.slice(afterPos, scanner.pos++),\n name: scanner.text.slice(namePos, afterPos)\n };\n }\n }\n scanner.pos++;\n }\n }\n }\n }\n function peek(scanner, pos = scanner.pos) {\n return scanner.text.charCodeAt(pos);\n }\n function isTokenStart(code2) {\n return code2 >= 65 && code2 <= 90;\n }\n function isToken(code2) {\n return isTokenStart(code2) || code2 > 47 && code2 < 58 || code2 === 95 || code2 === 45;\n }\n function createCommentState(config2) {\n const { options } = config2;\n return {\n enabled: options[\"comment.enabled\"],\n trigger: options[\"comment.trigger\"],\n before: options[\"comment.before\"] ? template(options[\"comment.before\"]) : void 0,\n after: options[\"comment.after\"] ? template(options[\"comment.after\"]) : void 0\n };\n }\n function commentNodeBefore(node, state) {\n if (shouldComment(node, state) && state.comment.before) {\n output(node, state.comment.before, state);\n }\n }\n function commentNodeAfter(node, state) {\n if (shouldComment(node, state) && state.comment.after) {\n output(node, state.comment.after, state);\n }\n }\n function shouldComment(node, state) {\n const { comment } = state;\n if (!comment.enabled || !comment.trigger || !node.name || !node.attributes) {\n return false;\n }\n for (const attr of node.attributes) {\n if (attr.name && comment.trigger.includes(attr.name)) {\n return true;\n }\n }\n return false;\n }\n function output(node, tokens, state) {\n const attrs = {};\n const { out } = state;\n for (const attr of node.attributes) {\n if (attr.name && attr.value) {\n attrs[attr.name.toUpperCase()] = attr.value;\n }\n }\n for (const token2 of tokens) {\n if (typeof token2 === \"string\") {\n pushString(out, token2);\n } else if (attrs[token2.name]) {\n pushString(out, token2.before);\n pushTokens(attrs[token2.name], state);\n pushString(out, token2.after);\n }\n }\n }\n const htmlTagRegex = /^<([\\w\\-:]+)[\\s>]/;\n function html(abbr, config2) {\n const state = createWalkState(config2);\n state.comment = createCommentState(config2);\n walk$1(abbr, element, state);\n return state.out.value;\n }\n function element(node, index, items, state, next2) {\n const { out, config: config2 } = state;\n const format = shouldFormat(node, index, items, state);\n const level = getIndent(state);\n out.level += level;\n format && pushNewline(out, true);\n if (node.name) {\n const name = tagName(node.name, config2);\n commentNodeBefore(node, state);\n pushString(out, `<${name}`);\n if (node.attributes) {\n for (const attr of node.attributes) {\n if (shouldOutputAttribute(attr)) {\n pushAttribute(attr, state);\n }\n }\n }\n if (node.selfClosing && !node.children.length && !node.value) {\n pushString(out, `${selfClose(config2)}>`);\n } else {\n pushString(out, \">\");\n if (!pushSnippet(node, state, next2)) {\n if (node.value) {\n const innerFormat = node.value.some(hasNewline) || startsWithBlockTag(node.value, config2);\n innerFormat && pushNewline(state.out, ++out.level);\n pushTokens(node.value, state);\n innerFormat && pushNewline(state.out, --out.level);\n }\n node.children.forEach(next2);\n if (!node.value && !node.children.length) {\n const innerFormat = config2.options[\"output.formatLeafNode\"] || config2.options[\"output.formatForce\"].includes(node.name);\n innerFormat && pushNewline(state.out, ++out.level);\n pushTokens(caret, state);\n innerFormat && pushNewline(state.out, --out.level);\n }\n }\n pushString(out, `</${name}>`);\n commentNodeAfter(node, state);\n }\n } else if (!pushSnippet(node, state, next2) && node.value) {\n pushTokens(node.value, state);\n node.children.forEach(next2);\n }\n if (format && index === items.length - 1 && state.parent) {\n const offset = isSnippet(state.parent) ? 0 : 1;\n pushNewline(out, out.level - offset);\n }\n out.level -= level;\n }\n function pushAttribute(attr, state) {\n const { out, config: config2 } = state;\n if (attr.name) {\n const name = attrName(attr.name, config2);\n const lQuote = attrQuote(attr, config2, true);\n const rQuote = attrQuote(attr, config2);\n let value = attr.value;\n if (isBooleanAttribute(attr, config2) && !value) {\n if (!config2.options[\"output.compactBoolean\"]) {\n value = [name];\n }\n } else if (!value) {\n value = caret;\n }\n pushString(out, \" \" + name);\n if (value) {\n pushString(out, \"=\" + lQuote);\n pushTokens(value, state);\n pushString(out, rQuote);\n } else if (config2.options[\"output.selfClosingStyle\"] !== \"html\") {\n pushString(out, \"=\" + lQuote + rQuote);\n }\n }\n }\n function pushSnippet(node, state, next2) {\n if (node.value && node.children.length) {\n const fieldIx = node.value.findIndex(isField);\n if (fieldIx !== -1) {\n pushTokens(node.value.slice(0, fieldIx), state);\n const line = state.out.line;\n let pos = fieldIx + 1;\n node.children.forEach(next2);\n if (state.out.line !== line && typeof node.value[pos] === \"string\") {\n pushString(state.out, node.value[pos++].trimLeft());\n }\n pushTokens(node.value.slice(pos), state);\n return true;\n }\n }\n return false;\n }\n function shouldFormat(node, index, items, state) {\n const { config: config2, parent } = state;\n if (!config2.options[\"output.format\"]) {\n return false;\n }\n if (index === 0 && !parent) {\n return false;\n }\n if (parent && isSnippet(parent) && items.length === 1) {\n return false;\n }\n if (isSnippet(node)) {\n const format = isSnippet(items[index - 1]) || isSnippet(items[index + 1]) || node.value.some(hasNewline) || node.value.some(isField) && node.children.length;\n if (format) {\n return true;\n }\n }\n if (isInline(node, config2)) {\n if (index === 0) {\n for (let i = 0; i < items.length; i++) {\n if (!isInline(items[i], config2)) {\n return true;\n }\n }\n } else if (!isInline(items[index - 1], config2)) {\n return true;\n }\n if (config2.options[\"output.inlineBreak\"]) {\n let adjacentInline = 1;\n let before = index;\n let after = index;\n while (isInlineElement(items[--before], config2)) {\n adjacentInline++;\n }\n while (isInlineElement(items[++after], config2)) {\n adjacentInline++;\n }\n if (adjacentInline >= config2.options[\"output.inlineBreak\"]) {\n return true;\n }\n }\n for (let i = 0, il = node.children.length; i < il; i++) {\n if (shouldFormat(node.children[i], i, node.children, state)) {\n return true;\n }\n }\n return false;\n }\n return true;\n }\n function getIndent(state) {\n const { config: config2, parent } = state;\n if (!parent || isSnippet(parent) || parent.name && config2.options[\"output.formatSkip\"].includes(parent.name)) {\n return 0;\n }\n return 1;\n }\n function hasNewline(value) {\n return typeof value === \"string\" && /\\r|\\n/.test(value);\n }\n function startsWithBlockTag(value, config2) {\n if (value.length && typeof value[0] === \"string\") {\n const matches = htmlTagRegex.exec(value[0]);\n if ((matches === null || matches === void 0 ? void 0 : matches.length) && !config2.options[\"inlineElements\"].includes(matches[1].toLowerCase())) {\n return true;\n }\n }\n return false;\n }\n function indentFormat(abbr, config2, options) {\n const state = createWalkState(config2);\n state.options = options || {};\n walk$1(abbr, element$1, state);\n return state.out.value;\n }\n function element$1(node, index, items, state, next2) {\n const { out, options } = state;\n const { primary, secondary } = collectAttributes(node);\n const level = state.parent ? 1 : 0;\n out.level += level;\n if (shouldFormat$1(node, index, items, state)) {\n pushNewline(out, true);\n }\n if (node.name && (node.name !== \"div\" || !primary.length)) {\n pushString(out, (options.beforeName || \"\") + node.name + (options.afterName || \"\"));\n }\n pushPrimaryAttributes(primary, state);\n pushSecondaryAttributes(secondary.filter(shouldOutputAttribute), state);\n if (node.selfClosing && !node.value && !node.children.length) {\n if (state.options.selfClose) {\n pushString(out, state.options.selfClose);\n }\n } else {\n pushValue(node, state);\n node.children.forEach(next2);\n }\n out.level -= level;\n }\n function collectAttributes(node) {\n const primary = [];\n const secondary = [];\n if (node.attributes) {\n for (const attr of node.attributes) {\n if (isPrimaryAttribute(attr)) {\n primary.push(attr);\n } else {\n secondary.push(attr);\n }\n }\n }\n return { primary, secondary };\n }\n function pushPrimaryAttributes(attrs, state) {\n for (const attr of attrs) {\n if (attr.value) {\n if (attr.name === \"class\") {\n pushString(state.out, \".\");\n const tokens = attr.value.map((t) => typeof t === \"string\" ? t.replace(/\\s+/g, \".\") : t);\n pushTokens(tokens, state);\n } else {\n pushString(state.out, \"#\");\n pushTokens(attr.value, state);\n }\n }\n }\n }\n function pushSecondaryAttributes(attrs, state) {\n if (attrs.length) {\n const { out, config: config2, options } = state;\n options.beforeAttribute && pushString(out, options.beforeAttribute);\n for (let i = 0; i < attrs.length; i++) {\n const attr = attrs[i];\n pushString(out, attrName(attr.name || \"\", config2));\n if (isBooleanAttribute(attr, config2) && !attr.value) {\n if (!config2.options[\"output.compactBoolean\"] && options.booleanValue) {\n pushString(out, \"=\" + options.booleanValue);\n }\n } else {\n pushString(out, \"=\" + attrQuote(attr, config2, true));\n pushTokens(attr.value || caret, state);\n pushString(out, attrQuote(attr, config2));\n }\n if (i !== attrs.length - 1 && options.glueAttribute) {\n pushString(out, options.glueAttribute);\n }\n }\n options.afterAttribute && pushString(out, options.afterAttribute);\n }\n }\n function pushValue(node, state) {\n if (!node.value && node.children.length) {\n return;\n }\n const value = node.value || caret;\n const lines = splitByLines$1(value);\n const { out, options } = state;\n if (lines.length === 1) {\n if (node.name || node.attributes) {\n push(out, \" \");\n }\n pushTokens(value, state);\n } else {\n const lineLengths = [];\n let maxLength = 0;\n for (const line of lines) {\n const len = valueLength(line);\n lineLengths.push(len);\n if (len > maxLength) {\n maxLength = len;\n }\n }\n out.level++;\n for (let i = 0; i < lines.length; i++) {\n pushNewline(out, true);\n options.beforeTextLine && push(out, options.beforeTextLine);\n pushTokens(lines[i], state);\n if (options.afterTextLine) {\n push(out, \" \".repeat(maxLength - lineLengths[i]));\n push(out, options.afterTextLine);\n }\n }\n out.level--;\n }\n }\n function isPrimaryAttribute(attr) {\n return attr.name === \"class\" || attr.name === \"id\";\n }\n function valueLength(tokens) {\n let len = 0;\n for (const token2 of tokens) {\n len += typeof token2 === \"string\" ? token2.length : token2.name.length;\n }\n return len;\n }\n function shouldFormat$1(node, index, items, state) {\n if (!state.parent && index === 0) {\n return false;\n }\n return !isSnippet(node);\n }\n function haml(abbr, config2) {\n return indentFormat(abbr, config2, {\n beforeName: \"%\",\n beforeAttribute: \"(\",\n afterAttribute: \")\",\n glueAttribute: \" \",\n afterTextLine: \" |\",\n booleanValue: \"true\",\n selfClose: \"/\"\n });\n }\n function slim(abbr, config2) {\n return indentFormat(abbr, config2, {\n beforeAttribute: \" \",\n glueAttribute: \" \",\n beforeTextLine: \"| \",\n selfClose: \"/\"\n });\n }\n function pug(abbr, config2) {\n return indentFormat(abbr, config2, {\n beforeAttribute: \"(\",\n afterAttribute: \")\",\n glueAttribute: \", \",\n beforeTextLine: \"| \",\n selfClose: config2.options[\"output.selfClosingStyle\"] === \"xml\" ? \"/\" : \"\"\n });\n }\n const formatters = { html, haml, slim, pug };\n function parse$1(abbr, config2) {\n let oldTextValue;\n if (typeof abbr === \"string\") {\n let parseOpt = config2;\n if (config2.options[\"jsx.enabled\"]) {\n parseOpt = Object.assign(Object.assign({}, parseOpt), { jsx: true });\n }\n if (config2.options[\"markup.href\"]) {\n parseOpt = Object.assign(Object.assign({}, parseOpt), { href: true });\n }\n abbr = parseAbbreviation(abbr, parseOpt);\n oldTextValue = config2.text;\n config2.text = void 0;\n }\n abbr = resolveSnippets(abbr, config2);\n walk(abbr, transform, config2);\n config2.text = oldTextValue !== null && oldTextValue !== void 0 ? oldTextValue : config2.text;\n return abbr;\n }\n function stringify(abbr, config2) {\n const formatter = formatters[config2.syntax] || html;\n return formatter(abbr, config2);\n }\n function transform(node, ancestors, config2) {\n implicitTag(node, ancestors, config2);\n mergeAttributes(node, config2);\n lorem(node, ancestors, config2);\n if (config2.syntax === \"xsl\") {\n xsl(node);\n }\n if (config2.options[\"jsx.enabled\"]) {\n jsx(node);\n }\n if (config2.options[\"bem.enabled\"]) {\n bem(node, ancestors, config2);\n }\n }\n const reProperty = /^([a-z-]+)(?:\\s*:\\s*([^\\n\\r;]+?);*)?$/;\n const opt = { value: true };\n function createSnippet(key, value) {\n const m = value.match(reProperty);\n if (m) {\n const keywords = {};\n const parsed = m[2] ? m[2].split(\"|\").map(parseValue) : [];\n for (const item of parsed) {\n for (const cssVal of item) {\n collectKeywords(cssVal, keywords);\n }\n }\n return {\n type: \"Property\",\n key,\n property: m[1],\n value: parsed,\n keywords,\n dependencies: []\n };\n }\n return { type: \"Raw\", key, value };\n }\n function nest(snippets) {\n snippets = snippets.slice().sort(snippetsSort);\n const stack = [];\n let prev2;\n for (const cur2 of snippets.filter(isProperty)) {\n while (stack.length) {\n prev2 = stack[stack.length - 1];\n if (cur2.property.startsWith(prev2.property) && cur2.property.charCodeAt(prev2.property.length) === 45) {\n prev2.dependencies.push(cur2);\n stack.push(cur2);\n break;\n }\n stack.pop();\n }\n if (!stack.length) {\n stack.push(cur2);\n }\n }\n return snippets;\n }\n function snippetsSort(a, b) {\n if (a.key === b.key) {\n return 0;\n }\n return a.key < b.key ? -1 : 1;\n }\n function parseValue(value) {\n return parse$2(value.trim(), opt)[0].value;\n }\n function isProperty(snippet2) {\n return snippet2.type === \"Property\";\n }\n function collectKeywords(cssVal, dest) {\n for (const v of cssVal.value) {\n if (v.type === \"Literal\") {\n dest[v.value] = v;\n } else if (v.type === \"FunctionCall\") {\n dest[v.name] = v;\n } else if (v.type === \"Field\") {\n const value = v.name.trim();\n if (value) {\n dest[value] = { type: \"Literal\", value };\n }\n }\n }\n }\n function scoreMatch(str1, str2, partialMatch = false) {\n str1 = str1.toLowerCase();\n str2 = str2.toLowerCase();\n if (str1 === str2) {\n return 1;\n }\n if (!str1 || !str2 || str1.charCodeAt(0) !== str2.charCodeAt(0)) {\n return 0;\n }\n const str1Len = str1.length;\n const str2Len = str2.length;\n if (!partialMatch && str1Len > str2Len) {\n return 0;\n }\n const minLength = Math.min(str1Len, str2Len);\n const maxLength = Math.max(str1Len, str2Len);\n let i = 1;\n let j = 1;\n let score = maxLength;\n let ch1 = 0;\n let ch2 = 0;\n let found = false;\n let acronym = false;\n while (i < str1Len) {\n ch1 = str1.charCodeAt(i);\n found = false;\n acronym = false;\n while (j < str2Len) {\n ch2 = str2.charCodeAt(j);\n if (ch1 === ch2) {\n found = true;\n score += maxLength - (acronym ? i : j);\n break;\n }\n acronym = ch2 === 45;\n j++;\n }\n if (!found) {\n if (!partialMatch) {\n return 0;\n }\n break;\n }\n i++;\n }\n const matchRatio = i / maxLength;\n const delta = maxLength - minLength;\n const maxScore = sum(maxLength) - sum(delta);\n return score * matchRatio / maxScore;\n }\n function sum(n) {\n return n * (n + 1) / 2;\n }\n function color(token2, shortHex) {\n if (!token2.r && !token2.g && !token2.b && !token2.a) {\n return \"transparent\";\n } else if (token2.a === 1) {\n return asHex(token2, shortHex);\n }\n return asRGB(token2);\n }\n function asHex(token2, short) {\n const fn = short && isShortHex(token2.r) && isShortHex(token2.g) && isShortHex(token2.b) ? toShortHex : toHex;\n return \"#\" + fn(token2.r) + fn(token2.g) + fn(token2.b);\n }\n function asRGB(token2) {\n const values = [token2.r, token2.g, token2.b];\n if (token2.a !== 1) {\n values.push(frac(token2.a, 8));\n }\n return `${values.length === 3 ? \"rgb\" : \"rgba\"}(${values.join(\", \")})`;\n }\n function frac(num, digits = 4) {\n return num.toFixed(digits).replace(/\\.?0+$/, \"\");\n }\n function isShortHex(hex) {\n return !(hex % 17);\n }\n function toShortHex(num) {\n return (num >> 4).toString(16);\n }\n function toHex(num) {\n return pad(num.toString(16), 2);\n }\n function pad(value, len) {\n while (value.length < len) {\n value = \"0\" + value;\n }\n return value;\n }\n function css(abbr, config2) {\n var _a;\n const out = createOutputStream(config2.options);\n const format = config2.options[\"output.format\"];\n if (((_a = config2.context) === null || _a === void 0 ? void 0 : _a.name) === \"@@section\") {\n abbr = abbr.filter((node) => node.snippet);\n }\n for (let i = 0; i < abbr.length; i++) {\n if (format && i !== 0) {\n pushNewline(out, true);\n }\n property(abbr[i], out, config2);\n }\n return out.value;\n }\n function property(node, out, config2) {\n const isJSON = config2.options[\"stylesheet.json\"];\n if (node.name) {\n const name = isJSON ? toCamelCase(node.name) : node.name;\n pushString(out, name + config2.options[\"stylesheet.between\"]);\n if (node.value.length) {\n propertyValue(node, out, config2);\n } else {\n pushField(out, 0, \"\");\n }\n if (isJSON) {\n push(out, \",\");\n } else {\n outputImportant(node, out, true);\n push(out, config2.options[\"stylesheet.after\"]);\n }\n } else {\n for (const cssVal of node.value) {\n for (const v of cssVal.value) {\n outputToken(v, out, config2);\n }\n }\n outputImportant(node, out, node.value.length > 0);\n }\n }\n function propertyValue(node, out, config2) {\n const isJSON = config2.options[\"stylesheet.json\"];\n const num = isJSON ? getSingleNumeric(node) : null;\n if (num && (!num.unit || num.unit === \"px\")) {\n push(out, String(num.value));\n } else {\n const quote2 = getQuote(config2);\n isJSON && push(out, quote2);\n for (let i = 0; i < node.value.length; i++) {\n if (i !== 0) {\n push(out, \", \");\n }\n outputValue(node.value[i], out, config2);\n }\n isJSON && push(out, quote2);\n }\n }\n function outputImportant(node, out, separator) {\n if (node.important) {\n if (separator) {\n push(out, \" \");\n }\n push(out, \"!important\");\n }\n }\n function outputValue(value, out, config2) {\n for (let i = 0, prevEnd = -1; i < value.value.length; i++) {\n const token2 = value.value[i];\n if (i !== 0 && (token2.type !== \"Field\" || token2.start !== prevEnd)) {\n push(out, \" \");\n }\n outputToken(token2, out, config2);\n prevEnd = token2[\"end\"];\n }\n }\n function outputToken(token2, out, config2) {\n if (token2.type === \"ColorValue\") {\n push(out, color(token2, config2.options[\"stylesheet.shortHex\"]));\n } else if (token2.type === \"Literal\") {\n pushString(out, token2.value);\n } else if (token2.type === \"NumberValue\") {\n pushString(out, frac(token2.value, 4) + token2.unit);\n } else if (token2.type === \"StringValue\") {\n const quote2 = token2.quote === \"double\" ? '\"' : \"'\";\n pushString(out, quote2 + token2.value + quote2);\n } else if (token2.type === \"Field\") {\n pushField(out, token2.index, token2.name);\n } else if (token2.type === \"FunctionCall\") {\n push(out, token2.name + \"(\");\n for (let i = 0; i < token2.arguments.length; i++) {\n if (i) {\n push(out, \", \");\n }\n outputValue(token2.arguments[i], out, config2);\n }\n push(out, \")\");\n }\n }\n function getSingleNumeric(node) {\n if (node.value.length === 1) {\n const cssVal = node.value[0];\n if (cssVal.value.length === 1 && cssVal.value[0].type === \"NumberValue\") {\n return cssVal.value[0];\n }\n }\n }\n function toCamelCase(str) {\n return str.replace(/\\-(\\w)/g, (_, letter) => letter.toUpperCase());\n }\n function getQuote(config2) {\n return config2.options[\"stylesheet.jsonDoubleQuotes\"] ? '\"' : \"'\";\n }\n const gradientName = \"lg\";\n function parse$1$1(abbr, config2) {\n var _a;\n const snippets = ((_a = config2.cache) === null || _a === void 0 ? void 0 : _a.stylesheetSnippets) || convertSnippets(config2.snippets);\n if (config2.cache) {\n config2.cache.stylesheetSnippets = snippets;\n }\n if (typeof abbr === \"string\") {\n abbr = parse$2(abbr, { value: isValueScope(config2) });\n }\n const filteredSnippets = getSnippetsForScope(snippets, config2);\n for (const node of abbr) {\n resolveNode(node, filteredSnippets, config2);\n }\n return abbr;\n }\n function convertSnippets(snippets) {\n const result = [];\n for (const key of Object.keys(snippets)) {\n result.push(createSnippet(key, snippets[key]));\n }\n return nest(result);\n }\n function resolveNode(node, snippets, config2) {\n if (!resolveGradient(node, config2)) {\n const score = config2.options[\"stylesheet.fuzzySearchMinScore\"];\n if (isValueScope(config2)) {\n const propName = config2.context.name;\n const snippet2 = snippets.find((s) => s.type === \"Property\" && s.property === propName);\n resolveValueKeywords(node, config2, snippet2, score);\n node.snippet = snippet2;\n } else if (node.name) {\n const snippet2 = findBestMatch(node.name, snippets, score, true);\n node.snippet = snippet2;\n if (snippet2) {\n if (snippet2.type === \"Property\") {\n resolveAsProperty(node, snippet2, config2);\n } else {\n resolveAsSnippet(node, snippet2);\n }\n }\n }\n }\n if (node.name || config2.context) {\n resolveNumericValue(node, config2);\n }\n return node;\n }\n function resolveGradient(node, config2) {\n let gradientFn = null;\n const cssVal = node.value.length === 1 ? node.value[0] : null;\n if (cssVal && cssVal.value.length === 1) {\n const v = cssVal.value[0];\n if (v.type === \"FunctionCall\" && v.name === gradientName) {\n gradientFn = v;\n }\n }\n if (gradientFn || node.name === gradientName) {\n if (!gradientFn) {\n gradientFn = {\n type: \"FunctionCall\",\n name: \"linear-gradient\",\n arguments: [cssValue(field$1(0, \"\"))]\n };\n } else {\n gradientFn = Object.assign(Object.assign({}, gradientFn), { name: \"linear-gradient\" });\n }\n if (!config2.context) {\n node.name = \"background-image\";\n }\n node.value = [cssValue(gradientFn)];\n return true;\n }\n return false;\n }\n function resolveAsProperty(node, snippet2, config2) {\n const abbr = node.name;\n const inlineValue = getUnmatchedPart(abbr, snippet2.key);\n if (inlineValue) {\n if (node.value.length) {\n return node;\n }\n const kw = resolveKeyword(inlineValue, config2, snippet2);\n if (!kw) {\n return node;\n }\n node.value.push(cssValue(kw));\n }\n node.name = snippet2.property;\n if (node.value.length) {\n resolveValueKeywords(node, config2, snippet2);\n } else if (snippet2.value.length) {\n const defaultValue = snippet2.value[0];\n node.value = snippet2.value.length === 1 || defaultValue.some(hasField) ? defaultValue : defaultValue.map((n) => wrapWithField(n, config2));\n }\n return node;\n }\n function resolveValueKeywords(node, config2, snippet2, minScore) {\n for (const cssVal of node.value) {\n const value = [];\n for (const token2 of cssVal.value) {\n if (token2.type === \"Literal\") {\n value.push(resolveKeyword(token2.value, config2, snippet2, minScore) || token2);\n } else if (token2.type === \"FunctionCall\") {\n const match = resolveKeyword(token2.name, config2, snippet2, minScore);\n if (match && match.type === \"FunctionCall\") {\n value.push(Object.assign(Object.assign({}, match), { arguments: token2.arguments.concat(match.arguments.slice(token2.arguments.length)) }));\n } else {\n value.push(token2);\n }\n } else {\n value.push(token2);\n }\n }\n cssVal.value = value;\n }\n }\n function resolveAsSnippet(node, snippet2) {\n let offset = 0;\n let m;\n const reField = /\\$\\{(\\d+)(:[^}]+)?\\}/g;\n const inputValue = node.value[0];\n const outputValue2 = [];\n while (m = reField.exec(snippet2.value)) {\n if (offset !== m.index) {\n outputValue2.push(literal(snippet2.value.slice(offset, m.index)));\n }\n offset = m.index + m[0].length;\n if (inputValue && inputValue.value.length) {\n outputValue2.push(inputValue.value.shift());\n } else {\n outputValue2.push(field$1(Number(m[1]), m[2] ? m[2].slice(1) : \"\"));\n }\n }\n const tail = snippet2.value.slice(offset);\n if (tail) {\n outputValue2.push(literal(tail));\n }\n node.name = void 0;\n node.value = [cssValue(...outputValue2)];\n return node;\n }\n function findBestMatch(abbr, items, minScore = 0, partialMatch = false) {\n let matchedItem = null;\n let maxScore = 0;\n for (const item of items) {\n const score = scoreMatch(abbr, getScoringPart(item), partialMatch);\n if (score === 1) {\n return item;\n }\n if (score && score >= maxScore) {\n maxScore = score;\n matchedItem = item;\n }\n }\n return maxScore >= minScore ? matchedItem : null;\n }\n function getScoringPart(item) {\n return typeof item === \"string\" ? item : item.key;\n }\n function getUnmatchedPart(abbr, str) {\n for (let i = 0, lastPos = 0; i < abbr.length; i++) {\n lastPos = str.indexOf(abbr[i], lastPos);\n if (lastPos === -1) {\n return abbr.slice(i);\n }\n lastPos++;\n }\n return \"\";\n }\n function resolveKeyword(kw, config2, snippet2, minScore) {\n let ref;\n if (snippet2) {\n if (ref = findBestMatch(kw, Object.keys(snippet2.keywords), minScore)) {\n return snippet2.keywords[ref];\n }\n for (const dep of snippet2.dependencies) {\n if (ref = findBestMatch(kw, Object.keys(dep.keywords), minScore)) {\n return dep.keywords[ref];\n }\n }\n }\n if (ref = findBestMatch(kw, config2.options[\"stylesheet.keywords\"], minScore)) {\n return literal(ref);\n }\n return null;\n }\n function resolveNumericValue(node, config2) {\n const aliases = config2.options[\"stylesheet.unitAliases\"];\n const unitless = config2.options[\"stylesheet.unitless\"];\n for (const v of node.value) {\n for (const t of v.value) {\n if (t.type === \"NumberValue\") {\n if (t.unit) {\n t.unit = aliases[t.unit] || t.unit;\n } else if (t.value !== 0 && !unitless.includes(node.name)) {\n t.unit = t.rawValue.includes(\".\") ? config2.options[\"stylesheet.floatUnit\"] : config2.options[\"stylesheet.intUnit\"];\n }\n }\n }\n }\n }\n function cssValue(...args) {\n return {\n type: \"CSSValue\",\n value: args\n };\n }\n function literal(value) {\n return { type: \"Literal\", value };\n }\n function field$1(index, name) {\n return { type: \"Field\", index, name };\n }\n function hasField(value) {\n for (const v of value.value) {\n if (v.type === \"Field\" || v.type === \"FunctionCall\" && v.arguments.some(hasField)) {\n return true;\n }\n }\n return false;\n }\n function wrapWithField(node, config2, state = { index: 1 }) {\n let value = [];\n for (const v of node.value) {\n switch (v.type) {\n case \"ColorValue\":\n value.push(field$1(state.index++, color(v, config2.options[\"stylesheet.shortHex\"])));\n break;\n case \"Literal\":\n value.push(field$1(state.index++, v.value));\n break;\n case \"NumberValue\":\n value.push(field$1(state.index++, `${v.value}${v.unit}`));\n break;\n case \"StringValue\":\n const q = v.quote === \"single\" ? \"'\" : '\"';\n value.push(field$1(state.index++, q + v.value + q));\n break;\n case \"FunctionCall\":\n value.push(field$1(state.index++, v.name), literal(\"(\"));\n for (let i = 0, il = v.arguments.length; i < il; i++) {\n value = value.concat(wrapWithField(v.arguments[i], config2, state).value);\n if (i !== il - 1) {\n value.push(literal(\", \"));\n }\n }\n value.push(literal(\")\"));\n break;\n default:\n value.push(v);\n }\n }\n return Object.assign(Object.assign({}, node), { value });\n }\n function isValueScope(config2) {\n if (config2.context) {\n return config2.context.name === \"@@value\" || !config2.context.name.startsWith(\"@@\");\n }\n return false;\n }\n function getSnippetsForScope(snippets, config2) {\n if (config2.context) {\n if (config2.context.name === \"@@section\") {\n return snippets.filter((s) => s.type === \"Raw\");\n }\n if (config2.context.name === \"@@property\") {\n return snippets.filter((s) => s.type === \"Property\");\n }\n }\n return snippets;\n }\n var markupSnippets = {\n \"a\": \"a[href]\",\n \"a:blank\": \"a[href='http://${0}' target='_blank' rel='noopener noreferrer']\",\n \"a:link\": \"a[href='http://${0}']\",\n \"a:mail\": \"a[href='mailto:${0}']\",\n \"a:tel\": \"a[href='tel:+${0}']\",\n \"abbr\": \"abbr[title]\",\n \"acr|acronym\": \"acronym[title]\",\n \"base\": \"base[href]/\",\n \"basefont\": \"basefont/\",\n \"br\": \"br/\",\n \"frame\": \"frame/\",\n \"hr\": \"hr/\",\n \"bdo\": \"bdo[dir]\",\n \"bdo:r\": \"bdo[dir=rtl]\",\n \"bdo:l\": \"bdo[dir=ltr]\",\n \"col\": \"col/\",\n \"link\": \"link[rel=stylesheet href]/\",\n \"link:css\": \"link[href='${1:style}.css']\",\n \"link:print\": \"link[href='${1:print}.css' media=print]\",\n \"link:favicon\": \"link[rel='shortcut icon' type=image/x-icon href='${1:favicon.ico}']\",\n \"link:mf|link:manifest\": \"link[rel='manifest' href='${1:manifest.json}']\",\n \"link:touch\": \"link[rel=apple-touch-icon href='${1:favicon.png}']\",\n \"link:rss\": \"link[rel=alternate type=application/rss+xml title=RSS href='${1:rss.xml}']\",\n \"link:atom\": \"link[rel=alternate type=application/atom+xml title=Atom href='${1:atom.xml}']\",\n \"link:im|link:import\": \"link[rel=import href='${1:component}.html']\",\n \"meta\": \"meta/\",\n \"meta:utf\": \"meta[http-equiv=Content-Type content='text/html;charset=UTF-8']\",\n \"meta:vp\": \"meta[name=viewport content='width=${1:device-width}, initial-scale=${2:1.0}']\",\n \"meta:compat\": \"meta[http-equiv=X-UA-Compatible content='${1:IE=7}']\",\n \"meta:edge\": \"meta:compat[content='${1:ie=edge}']\",\n \"meta:redirect\": \"meta[http-equiv=refresh content='0; url=${1:http://example.com}']\",\n \"meta:kw\": \"meta[name=keywords content]\",\n \"meta:desc\": \"meta[name=description content]\",\n \"style\": \"style\",\n \"script\": \"script\",\n \"script:src\": \"script[src]\",\n \"img\": \"img[src alt]/\",\n \"img:s|img:srcset\": \"img[srcset src alt]\",\n \"img:z|img:sizes\": \"img[sizes srcset src alt]\",\n \"picture\": \"picture\",\n \"src|source\": \"source/\",\n \"src:sc|source:src\": \"source[src type]\",\n \"src:s|source:srcset\": \"source[srcset]\",\n \"src:t|source:type\": \"source[srcset type='${1:image/}']\",\n \"src:z|source:sizes\": \"source[sizes srcset]\",\n \"src:m|source:media\": \"source[media='(${1:min-width: })' srcset]\",\n \"src:mt|source:media:type\": \"source:media[type='${2:image/}']\",\n \"src:mz|source:media:sizes\": \"source:media[sizes srcset]\",\n \"src:zt|source:sizes:type\": \"source[sizes srcset type='${1:image/}']\",\n \"iframe\": \"iframe[src frameborder=0]\",\n \"embed\": \"embed[src type]/\",\n \"object\": \"object[data type]\",\n \"param\": \"param[name value]/\",\n \"map\": \"map[name]\",\n \"area\": \"area[shape coords href alt]/\",\n \"area:d\": \"area[shape=default]\",\n \"area:c\": \"area[shape=circle]\",\n \"area:r\": \"area[shape=rect]\",\n \"area:p\": \"area[shape=poly]\",\n \"form\": \"form[action]\",\n \"form:get\": \"form[method=get]\",\n \"form:post\": \"form[method=post]\",\n \"label\": \"label[for]\",\n \"input\": \"input[type=${1:text}]/\",\n \"inp\": \"input[name=${1} id=${1}]\",\n \"input:h|input:hidden\": \"input[type=hidden name]\",\n \"input:t|input:text\": \"inp[type=text]\",\n \"input:search\": \"inp[type=search]\",\n \"input:email\": \"inp[type=email]\",\n \"input:url\": \"inp[type=url]\",\n \"input:p|input:password\": \"inp[type=password]\",\n \"input:datetime\": \"inp[type=datetime]\",\n \"input:date\": \"inp[type=date]\",\n \"input:datetime-local\": \"inp[type=datetime-local]\",\n \"input:month\": \"inp[type=month]\",\n \"input:week\": \"inp[type=week]\",\n \"input:time\": \"inp[type=time]\",\n \"input:tel\": \"inp[type=tel]\",\n \"input:number\": \"inp[type=number]\",\n \"input:color\": \"inp[type=color]\",\n \"input:c|input:checkbox\": \"inp[type=checkbox]\",\n \"input:r|input:radio\": \"inp[type=radio]\",\n \"input:range\": \"inp[type=range]\",\n \"input:f|input:file\": \"inp[type=file]\",\n \"input:s|input:submit\": \"input[type=submit value]\",\n \"input:i|input:image\": \"input[type=image src alt]\",\n \"input:b|input:btn|input:button\": \"input[type=button value]\",\n \"input:reset\": \"input:button[type=reset]\",\n \"isindex\": \"isindex/\",\n \"select\": \"select[name=${1} id=${1}]\",\n \"select:d|select:disabled\": \"select[disabled.]\",\n \"opt|option\": \"option[value]\",\n \"textarea\": \"textarea[name=${1} id=${1} cols=${2:30} rows=${3:10}]\",\n \"marquee\": \"marquee[behavior direction]\",\n \"menu:c|menu:context\": \"menu[type=context]\",\n \"menu:t|menu:toolbar\": \"menu[type=toolbar]\",\n \"video\": \"video[src]\",\n \"audio\": \"audio[src]\",\n \"html:xml\": \"html[xmlns=http://www.w3.org/1999/xhtml]\",\n \"keygen\": \"keygen/\",\n \"command\": \"command/\",\n \"btn:s|button:s|button:submit\": \"button[type=submit]\",\n \"btn:r|button:r|button:reset\": \"button[type=reset]\",\n \"btn:d|button:d|button:disabled\": \"button[disabled.]\",\n \"fst:d|fset:d|fieldset:d|fieldset:disabled\": \"fieldset[disabled.]\",\n \"bq\": \"blockquote\",\n \"fig\": \"figure\",\n \"figc\": \"figcaption\",\n \"pic\": \"picture\",\n \"ifr\": \"iframe\",\n \"emb\": \"embed\",\n \"obj\": \"object\",\n \"cap\": \"caption\",\n \"colg\": \"colgroup\",\n \"fst\": \"fieldset\",\n \"btn\": \"button\",\n \"optg\": \"optgroup\",\n \"tarea\": \"textarea\",\n \"leg\": \"legend\",\n \"sect\": \"section\",\n \"art\": \"article\",\n \"hdr\": \"header\",\n \"ftr\": \"footer\",\n \"adr\": \"address\",\n \"dlg\": \"dialog\",\n \"str\": \"strong\",\n \"prog\": \"progress\",\n \"mn\": \"main\",\n \"tem\": \"template\",\n \"fset\": \"fieldset\",\n \"datag\": \"datagrid\",\n \"datal\": \"datalist\",\n \"kg\": \"keygen\",\n \"out\": \"output\",\n \"det\": \"details\",\n \"sum\": \"summary\",\n \"cmd\": \"command\",\n \"ri:d|ri:dpr\": \"img:s\",\n \"ri:v|ri:viewport\": \"img:z\",\n \"ri:a|ri:art\": \"pic>src:m+img\",\n \"ri:t|ri:type\": \"pic>src:t+img\",\n \"!!!\": \"{<!DOCTYPE html>}\",\n \"doc\": \"html[lang=${lang}]>(head>meta[charset=${charset}]+meta[http-equiv='X-UA-Compatible'][content='IE=edge']+meta:vp+title{${1:Document}})+body\",\n \"!|html:5\": \"!!!+doc\",\n \"c\": \"{<!-- ${0} -->}\",\n \"cc:ie\": \"{<!--[if IE]>${0}<![endif]-->}\",\n \"cc:noie\": \"{<!--[if !IE]><!-->${0}<!--<![endif]-->}\"\n };\n var stylesheetSnippets = {\n \"@f\": \"@font-face {\\n\tfont-family: ${1};\\n\tsrc: url(${2});\\n}\",\n \"@ff\": \"@font-face {\\n\tfont-family: '${1:FontName}';\\n\tsrc: url('${2:FileName}.eot');\\n\tsrc: url('${2:FileName}.eot?#iefix') format('embedded-opentype'),\\n\t\t url('${2:FileName}.woff') format('woff'),\\n\t\t url('${2:FileName}.ttf') format('truetype'),\\n\t\t url('${2:FileName}.svg#${1:FontName}') format('svg');\\n\tfont-style: ${3:normal};\\n\tfont-weight: ${4:normal};\\n}\",\n \"@i|@import\": \"@import url(${0});\",\n \"@kf\": \"@keyframes ${1:identifier} {\\n\t${2}\\n}\",\n \"@m|@media\": \"@media ${1:screen} {\\n\t${0}\\n}\",\n \"ac\": \"align-content:start|end|flex-start|flex-end|center|space-between|space-around|stretch|space-evenly\",\n \"ai\": \"align-items:start|end|flex-start|flex-end|center|baseline|stretch\",\n \"anim\": \"animation:${1:name} ${2:duration} ${3:timing-function} ${4:delay} ${5:iteration-count} ${6:direction} ${7:fill-mode}\",\n \"animdel\": \"animation-delay:time\",\n \"animdir\": \"animation-direction:normal|reverse|alternate|alternate-reverse\",\n \"animdur\": \"animation-duration:${1:0}s\",\n \"animfm\": \"animation-fill-mode:both|forwards|backwards\",\n \"animic\": \"animation-iteration-count:1|infinite\",\n \"animn\": \"animation-name\",\n \"animps\": \"animation-play-state:running|paused\",\n \"animtf\": \"animation-timing-function:linear|ease|ease-in|ease-out|ease-in-out|cubic-bezier(${1:0.1}, ${2:0.7}, ${3:1.0}, ${3:0.1})\",\n \"ap\": \"appearance:none\",\n \"as\": \"align-self:start|end|auto|flex-start|flex-end|center|baseline|stretch\",\n \"b\": \"bottom\",\n \"bd\": \"border:${1:1px} ${2:solid} ${3:#000}\",\n \"bdb\": \"border-bottom:${1:1px} ${2:solid} ${3:#000}\",\n \"bdbc\": \"border-bottom-color:${1:#000}\",\n \"bdbi\": \"border-bottom-image:url(${0})\",\n \"bdbk\": \"border-break:close\",\n \"bdbli\": \"border-bottom-left-image:url(${0})|continue\",\n \"bdblrs\": \"border-bottom-left-radius\",\n \"bdbri\": \"border-bottom-right-image:url(${0})|continue\",\n \"bdbrrs\": \"border-bottom-right-radius\",\n \"bdbs\": \"border-bottom-style\",\n \"bdbw\": \"border-bottom-width\",\n \"bdc\": \"border-color:${1:#000}\",\n \"bdci\": \"border-corner-image:url(${0})|continue\",\n \"bdcl\": \"border-collapse:collapse|separate\",\n \"bdf\": \"border-fit:repeat|clip|scale|stretch|overwrite|overflow|space\",\n \"bdi\": \"border-image:url(${0})\",\n \"bdl\": \"border-left:${1:1px} ${2:solid} ${3:#000}\",\n \"bdlc\": \"border-left-color:${1:#000}\",\n \"bdlen\": \"border-length\",\n \"bdli\": \"border-left-image:url(${0})\",\n \"bdls\": \"border-left-style\",\n \"bdlw\": \"border-left-width\",\n \"bdr\": \"border-right:${1:1px} ${2:solid} ${3:#000}\",\n \"bdrc\": \"border-right-color:${1:#000}\",\n \"bdri\": \"border-right-image:url(${0})\",\n \"bdrs\": \"border-radius\",\n \"bdrst\": \"border-right-style\",\n \"bdrw\": \"border-right-width\",\n \"bds\": \"border-style:none|hidden|dotted|dashed|solid|double|dot-dash|dot-dot-dash|wave|groove|ridge|inset|outset\",\n \"bdsp\": \"border-spacing\",\n \"bdt\": \"border-top:${1:1px} ${2:solid} ${3:#000}\",\n \"bdtc\": \"border-top-color:${1:#000}\",\n \"bdti\": \"border-top-image:url(${0})\",\n \"bdtli\": \"border-top-left-image:url(${0})|continue\",\n \"bdtlrs\": \"border-top-left-radius\",\n \"bdtri\": \"border-top-right-image:url(${0})|continue\",\n \"bdtrrs\": \"border-top-right-radius\",\n \"bdts\": \"border-top-style\",\n \"bdtw\": \"border-top-width\",\n \"bdw\": \"border-width\",\n \"bfv\": \"backface-visibility:hidden|visible\",\n \"bg\": \"background:${1:#000}\",\n \"bga\": \"background-attachment:fixed|scroll\",\n \"bgbk\": \"background-break:bounding-box|each-box|continuous\",\n \"bgc\": \"background-color:#${1:fff}\",\n \"bgcp\": \"background-clip:padding-box|border-box|content-box|no-clip\",\n \"bgi\": \"background-image:url(${0})\",\n \"bgo\": \"background-origin:padding-box|border-box|content-box\",\n \"bgp\": \"background-position:${1:0} ${2:0}\",\n \"bgpx\": \"background-position-x\",\n \"bgpy\": \"background-position-y\",\n \"bgr\": \"background-repeat:no-repeat|repeat-x|repeat-y|space|round\",\n \"bgsz\": \"background-size:contain|cover\",\n \"bxsh\": \"box-shadow:${1:inset }${2:hoff} ${3:voff} ${4:blur} ${5:#000}|none\",\n \"bxsz\": \"box-sizing:border-box|content-box|border-box\",\n \"c\": \"color:${1:#000}\",\n \"cr\": \"color:rgb(${1:0}, ${2:0}, ${3:0})\",\n \"cra\": \"color:rgba(${1:0}, ${2:0}, ${3:0}, ${4:.5})\",\n \"cl\": \"clear:both|left|right|none\",\n \"cm\": \"/* ${0} */\",\n \"cnt\": \"content:'${0}'|normal|open-quote|no-open-quote|close-quote|no-close-quote|attr(${0})|counter(${0})|counters(${0})\",\n \"coi\": \"counter-increment\",\n \"colm\": \"columns\",\n \"colmc\": \"column-count\",\n \"colmf\": \"column-fill\",\n \"colmg\": \"column-gap\",\n \"colmr\": \"column-rule\",\n \"colmrc\": \"column-rule-color\",\n \"colmrs\": \"column-rule-style\",\n \"colmrw\": \"column-rule-width\",\n \"colms\": \"column-span\",\n \"colmw\": \"column-width\",\n \"cor\": \"counter-reset\",\n \"cp\": \"clip:auto|rect(${1:top} ${2:right} ${3:bottom} ${4:left})\",\n \"cps\": \"caption-side:top|bottom\",\n \"cur\": \"cursor:pointer|auto|default|crosshair|hand|help|move|pointer|text\",\n \"d\": \"display:block|none|flex|inline-flex|inline|inline-block|grid|inline-grid|subgrid|list-item|run-in|compact|table|inline-table|table-caption|table-column|table-column-group|table-header-group|table-footer-group|table-row|table-row-group|table-cell|ruby|ruby-base|ruby-base-group|ruby-text|ruby-text-group\",\n \"ec\": \"empty-cells:show|hide\",\n \"f\": \"font:${1:1em} ${2:sans-serif}\",\n \"fd\": \"font-display:auto|block|swap|fallback|optional\",\n \"fef\": \"font-effect:none|engrave|emboss|outline\",\n \"fem\": \"font-emphasize\",\n \"femp\": \"font-emphasize-position:before|after\",\n \"fems\": \"font-emphasize-style:none|accent|dot|circle|disc\",\n \"ff\": \"font-family:serif|sans-serif|cursive|fantasy|monospace\",\n \"fft\": 'font-family:\"Times New Roman\", Times, Baskerville, Georgia, serif',\n \"ffa\": 'font-family:Arial, \"Helvetica Neue\", Helvetica, sans-serif',\n \"ffv\": \"font-family:Verdana, Geneva, sans-serif\",\n \"fl\": \"float:left|right|none\",\n \"fs\": \"font-style:italic|normal|oblique\",\n \"fsm\": \"font-smoothing:antialiased|subpixel-antialiased|none\",\n \"fst\": \"font-stretch:normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded\",\n \"fv\": \"font-variant:normal|small-caps\",\n \"fvs\": \"font-variation-settings:normal|inherit|initial|unset\",\n \"fw\": \"font-weight:normal|bold|bolder|lighter\",\n \"fx\": \"flex\",\n \"fxb\": \"flex-basis:fill|max-content|min-content|fit-content|content\",\n \"fxd\": \"flex-direction:row|row-reverse|column|column-reverse\",\n \"fxf\": \"flex-flow\",\n \"fxg\": \"flex-grow\",\n \"fxsh\": \"flex-shrink\",\n \"fxw\": \"flex-wrap:nowrap|wrap|wrap-reverse\",\n \"fsz\": \"font-size\",\n \"fsza\": \"font-size-adjust\",\n \"gtc\": \"grid-template-columns:repeat(${0})|minmax()\",\n \"gtr\": \"grid-template-rows:repeat(${0})|minmax()\",\n \"gta\": \"grid-template-areas\",\n \"gt\": \"grid-template\",\n \"gg\": \"grid-gap\",\n \"gcg\": \"grid-column-gap\",\n \"grg\": \"grid-row-gap\",\n \"gac\": \"grid-auto-columns:auto|minmax()\",\n \"gar\": \"grid-auto-rows:auto|minmax()\",\n \"gaf\": \"grid-auto-flow:row|column|dense|inherit|initial|unset\",\n \"gd\": \"grid\",\n \"gc\": \"grid-column\",\n \"gcs\": \"grid-column-start\",\n \"gce\": \"grid-column-end\",\n \"gr\": \"grid-row\",\n \"grs\": \"grid-row-start\",\n \"gre\": \"grid-row-end\",\n \"ga\": \"grid-area\",\n \"h\": \"height\",\n \"jc\": \"justify-content:start|end|stretch|flex-start|flex-end|center|space-between|space-around|space-evenly\",\n \"ji\": \"justify-items:start|end|center|stretch\",\n \"js\": \"justify-self:start|end|center|stretch\",\n \"l\": \"left\",\n \"lg\": \"background-image:linear-gradient(${1})\",\n \"lh\": \"line-height\",\n \"lis\": \"list-style\",\n \"lisi\": \"list-style-image\",\n \"lisp\": \"list-style-position:inside|outside\",\n \"list\": \"list-style-type:disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman\",\n \"lts\": \"letter-spacing:normal\",\n \"m\": \"margin\",\n \"mah\": \"max-height\",\n \"mar\": \"max-resolution\",\n \"maw\": \"max-width\",\n \"mb\": \"margin-bottom\",\n \"mih\": \"min-height\",\n \"mir\": \"min-resolution\",\n \"miw\": \"min-width\",\n \"ml\": \"margin-left\",\n \"mr\": \"margin-right\",\n \"mt\": \"margin-top\",\n \"ol\": \"outline\",\n \"olc\": \"outline-color:${1:#000}|invert\",\n \"olo\": \"outline-offset\",\n \"ols\": \"outline-style:none|dotted|dashed|solid|double|groove|ridge|inset|outset\",\n \"olw\": \"outline-width|thin|medium|thick\",\n \"op|opa\": \"opacity\",\n \"ord\": \"order\",\n \"ori\": \"orientation:landscape|portrait\",\n \"orp\": \"orphans\",\n \"ov\": \"overflow:hidden|visible|hidden|scroll|auto\",\n \"ovs\": \"overflow-style:scrollbar|auto|scrollbar|panner|move|marquee\",\n \"ovx\": \"overflow-x:hidden|visible|hidden|scroll|auto\",\n \"ovy\": \"overflow-y:hidden|visible|hidden|scroll|auto\",\n \"p\": \"padding\",\n \"pb\": \"padding-bottom\",\n \"pgba\": \"page-break-after:auto|always|left|right\",\n \"pgbb\": \"page-break-before:auto|always|left|right\",\n \"pgbi\": \"page-break-inside:auto|avoid\",\n \"pl\": \"padding-left\",\n \"pos\": \"position:relative|absolute|relative|fixed|static\",\n \"pr\": \"padding-right\",\n \"pt\": \"padding-top\",\n \"q\": \"quotes\",\n \"qen\": \"quotes:'\\\\201C' '\\\\201D' '\\\\2018' '\\\\2019'\",\n \"qru\": \"quotes:'\\\\00AB' '\\\\00BB' '\\\\201E' '\\\\201C'\",\n \"r\": \"right\",\n \"rsz\": \"resize:none|both|horizontal|vertical\",\n \"t\": \"top\",\n \"ta\": \"text-align:left|center|right|justify\",\n \"tal\": \"text-align-last:left|center|right\",\n \"tbl\": \"table-layout:fixed\",\n \"td\": \"text-decoration:none|underline|overline|line-through\",\n \"te\": \"text-emphasis:none|accent|dot|circle|disc|before|after\",\n \"th\": \"text-height:auto|font-size|text-size|max-size\",\n \"ti\": \"text-indent\",\n \"tj\": \"text-justify:auto|inter-word|inter-ideograph|inter-cluster|distribute|kashida|tibetan\",\n \"to\": \"text-outline:${1:0} ${2:0} ${3:#000}\",\n \"tov\": \"text-overflow:ellipsis|clip\",\n \"tr\": \"text-replace\",\n \"trf\": \"transform:${1}|skewX(${1:angle})|skewY(${1:angle})|scale(${1:x}, ${2:y})|scaleX(${1:x})|scaleY(${1:y})|scaleZ(${1:z})|scale3d(${1:x}, ${2:y}, ${3:z})|rotate(${1:angle})|rotateX(${1:angle})|rotateY(${1:angle})|rotateZ(${1:angle})|translate(${1:x}, ${2:y})|translateX(${1:x})|translateY(${1:y})|translateZ(${1:z})|translate3d(${1:tx}, ${2:ty}, ${3:tz})\",\n \"trfo\": \"transform-origin\",\n \"trfs\": \"transform-style:preserve-3d\",\n \"trs\": \"transition:${1:prop} ${2:time}\",\n \"trsde\": \"transition-delay:${1:time}\",\n \"trsdu\": \"transition-duration:${1:time}\",\n \"trsp\": \"transition-property:${1:prop}\",\n \"trstf\": \"transition-timing-function:${1:fn}\",\n \"tsh\": \"text-shadow:${1:hoff} ${2:voff} ${3:blur} ${4:#000}\",\n \"tt\": \"text-transform:uppercase|lowercase|capitalize|none\",\n \"tw\": \"text-wrap:none|normal|unrestricted|suppress\",\n \"us\": \"user-select:none\",\n \"v\": \"visibility:hidden|visible|collapse\",\n \"va\": \"vertical-align:top|super|text-top|middle|baseline|bottom|text-bottom|sub\",\n \"w\": \"width\",\n \"whs\": \"white-space:nowrap|pre|pre-wrap|pre-line|normal\",\n \"whsc\": \"white-space-collapse:normal|keep-all|loose|break-strict|break-all\",\n \"wid\": \"widows\",\n \"wm\": \"writing-mode:lr-tb|lr-tb|lr-bt|rl-tb|rl-bt|tb-rl|tb-lr|bt-lr|bt-rl\",\n \"wob\": \"word-break:normal|keep-all|break-all\",\n \"wos\": \"word-spacing\",\n \"wow\": \"word-wrap:none|unrestricted|suppress|break-word|normal\",\n \"z\": \"z-index\",\n \"zom\": \"zoom:1\"\n };\n var xslSnippets = {\n \"tm|tmatch\": \"xsl:template[match mode]\",\n \"tn|tname\": \"xsl:template[name]\",\n \"call\": \"xsl:call-template[name]\",\n \"ap\": \"xsl:apply-templates[select mode]\",\n \"api\": \"xsl:apply-imports\",\n \"imp\": \"xsl:import[href]\",\n \"inc\": \"xsl:include[href]\",\n \"ch\": \"xsl:choose\",\n \"wh|xsl:when\": \"xsl:when[test]\",\n \"ot\": \"xsl:otherwise\",\n \"if\": \"xsl:if[test]\",\n \"par\": \"xsl:param[name]\",\n \"pare\": \"xsl:param[name select]\",\n \"var\": \"xsl:variable[name]\",\n \"vare\": \"xsl:variable[name select]\",\n \"wp\": \"xsl:with-param[name select]\",\n \"key\": \"xsl:key[name match use]\",\n \"elem\": \"xsl:element[name]\",\n \"attr\": \"xsl:attribute[name]\",\n \"attrs\": \"xsl:attribute-set[name]\",\n \"cp\": \"xsl:copy[select]\",\n \"co\": \"xsl:copy-of[select]\",\n \"val\": \"xsl:value-of[select]\",\n \"for|each\": \"xsl:for-each[select]\",\n \"tex\": \"xsl:text\",\n \"com\": \"xsl:comment\",\n \"msg\": \"xsl:message[terminate=no]\",\n \"fall\": \"xsl:fallback\",\n \"num\": \"xsl:number[value]\",\n \"nam\": \"namespace-alias[stylesheet-prefix result-prefix]\",\n \"pres\": \"xsl:preserve-space[elements]\",\n \"strip\": \"xsl:strip-space[elements]\",\n \"proc\": \"xsl:processing-instruction[name]\",\n \"sort\": \"xsl:sort[select order]\",\n \"choose\": \"xsl:choose>xsl:when+xsl:otherwise\",\n \"xsl\": \"!!!+xsl:stylesheet[version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform]>{\\n|}\",\n \"!!!\": '{<?xml version=\"1.0\" encoding=\"UTF-8\"?>}'\n };\n var pugSnippets = {\n \"!!!\": \"{doctype html}\"\n };\n var variables = {\n \"lang\": \"en\",\n \"locale\": \"en-US\",\n \"charset\": \"UTF-8\",\n \"indentation\": \"\t\",\n \"newline\": \"\\n\"\n };\n const defaultSyntaxes = {\n markup: \"html\",\n stylesheet: \"css\"\n };\n const defaultOptions$1 = {\n \"inlineElements\": [\n \"a\",\n \"abbr\",\n \"acronym\",\n \"applet\",\n \"b\",\n \"basefont\",\n \"bdo\",\n \"big\",\n \"br\",\n \"button\",\n \"cite\",\n \"code\",\n \"del\",\n \"dfn\",\n \"em\",\n \"font\",\n \"i\",\n \"iframe\",\n \"img\",\n \"input\",\n \"ins\",\n \"kbd\",\n \"label\",\n \"map\",\n \"object\",\n \"q\",\n \"s\",\n \"samp\",\n \"select\",\n \"small\",\n \"span\",\n \"strike\",\n \"strong\",\n \"sub\",\n \"sup\",\n \"textarea\",\n \"tt\",\n \"u\",\n \"var\"\n ],\n \"output.indent\": \"\t\",\n \"output.baseIndent\": \"\",\n \"output.newline\": \"\\n\",\n \"output.tagCase\": \"\",\n \"output.attributeCase\": \"\",\n \"output.attributeQuotes\": \"double\",\n \"output.format\": true,\n \"output.formatLeafNode\": false,\n \"output.formatSkip\": [\"html\"],\n \"output.formatForce\": [\"body\"],\n \"output.inlineBreak\": 3,\n \"output.compactBoolean\": false,\n \"output.booleanAttributes\": [\n \"contenteditable\",\n \"seamless\",\n \"async\",\n \"autofocus\",\n \"autoplay\",\n \"checked\",\n \"controls\",\n \"defer\",\n \"disabled\",\n \"formnovalidate\",\n \"hidden\",\n \"ismap\",\n \"loop\",\n \"multiple\",\n \"muted\",\n \"novalidate\",\n \"readonly\",\n \"required\",\n \"reversed\",\n \"selected\",\n \"typemustmatch\"\n ],\n \"output.reverseAttributes\": false,\n \"output.selfClosingStyle\": \"html\",\n \"output.field\": (index, placeholder) => placeholder,\n \"output.text\": (text2) => text2,\n \"markup.href\": true,\n \"comment.enabled\": false,\n \"comment.trigger\": [\"id\", \"class\"],\n \"comment.before\": \"\",\n \"comment.after\": \"\\n<!-- /[#ID][.CLASS] -->\",\n \"bem.enabled\": false,\n \"bem.element\": \"__\",\n \"bem.modifier\": \"_\",\n \"jsx.enabled\": false,\n \"stylesheet.keywords\": [\"auto\", \"inherit\", \"unset\", \"none\"],\n \"stylesheet.unitless\": [\"z-index\", \"line-height\", \"opacity\", \"font-weight\", \"zoom\", \"flex\", \"flex-grow\", \"flex-shrink\"],\n \"stylesheet.shortHex\": true,\n \"stylesheet.between\": \": \",\n \"stylesheet.after\": \";\",\n \"stylesheet.intUnit\": \"px\",\n \"stylesheet.floatUnit\": \"em\",\n \"stylesheet.unitAliases\": { e: \"em\", p: \"%\", x: \"ex\", r: \"rem\" },\n \"stylesheet.json\": false,\n \"stylesheet.jsonDoubleQuotes\": false,\n \"stylesheet.fuzzySearchMinScore\": 0\n };\n const defaultConfig$1 = {\n type: \"markup\",\n syntax: \"html\",\n variables,\n snippets: {},\n options: defaultOptions$1\n };\n const syntaxConfig = {\n markup: {\n snippets: parseSnippets(markupSnippets)\n },\n xhtml: {\n options: {\n \"output.selfClosingStyle\": \"xhtml\"\n }\n },\n xml: {\n options: {\n \"output.selfClosingStyle\": \"xml\"\n }\n },\n xsl: {\n snippets: parseSnippets(xslSnippets),\n options: {\n \"output.selfClosingStyle\": \"xml\"\n }\n },\n jsx: {\n options: {\n \"jsx.enabled\": true\n }\n },\n pug: {\n snippets: parseSnippets(pugSnippets)\n },\n stylesheet: {\n snippets: parseSnippets(stylesheetSnippets)\n },\n sass: {\n options: {\n \"stylesheet.after\": \"\"\n }\n },\n stylus: {\n options: {\n \"stylesheet.between\": \" \",\n \"stylesheet.after\": \"\"\n }\n }\n };\n function parseSnippets(snippets) {\n const result = {};\n Object.keys(snippets).forEach((k) => {\n for (const name of k.split(\"|\")) {\n result[name] = snippets[k];\n }\n });\n return result;\n }\n function resolveConfig(config2 = {}, globals = {}) {\n const type = config2.type || \"markup\";\n const syntax = config2.syntax || defaultSyntaxes[type];\n return Object.assign(Object.assign(Object.assign({}, defaultConfig$1), config2), {\n type,\n syntax,\n variables: mergedData(type, syntax, \"variables\", config2, globals),\n snippets: mergedData(type, syntax, \"snippets\", config2, globals),\n options: mergedData(type, syntax, \"options\", config2, globals)\n });\n }\n function mergedData(type, syntax, key, config2, globals = {}) {\n const typeDefaults = syntaxConfig[type];\n const typeOverride = globals[type];\n const syntaxDefaults = syntaxConfig[syntax];\n const syntaxOverride = globals[syntax];\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, defaultConfig$1[key]), typeDefaults && typeDefaults[key]), syntaxDefaults && syntaxDefaults[key]), typeOverride && typeOverride[key]), syntaxOverride && syntaxOverride[key]), config2[key]);\n }\n function backwardScanner(text2, start = 0) {\n return { text: text2, start, pos: text2.length };\n }\n function sol(scanner) {\n return scanner.pos === scanner.start;\n }\n function peek$1(scanner, offset = 0) {\n return scanner.text.charCodeAt(scanner.pos - 1 + offset);\n }\n function previous(scanner) {\n if (!sol(scanner)) {\n return scanner.text.charCodeAt(--scanner.pos);\n }\n }\n function consume(scanner, match) {\n if (sol(scanner)) {\n return false;\n }\n const ok = typeof match === \"function\" ? match(peek$1(scanner)) : match === peek$1(scanner);\n if (ok) {\n scanner.pos--;\n }\n return !!ok;\n }\n function consumeWhile(scanner, match) {\n const start = scanner.pos;\n while (consume(scanner, match)) {\n }\n return scanner.pos < start;\n }\n function isQuote$1(c) {\n return c === 39 || c === 34;\n }\n function consumeQuoted(scanner) {\n const start = scanner.pos;\n const quote2 = previous(scanner);\n if (isQuote$1(quote2)) {\n while (!sol(scanner)) {\n if (previous(scanner) === quote2 && peek$1(scanner) !== 92) {\n return true;\n }\n }\n }\n scanner.pos = start;\n return false;\n }\n const bracePairs = {\n [91]: 93,\n [40]: 41,\n [123]: 125\n };\n function isHtml(scanner) {\n const start = scanner.pos;\n if (!consume(scanner, 62)) {\n return false;\n }\n let ok = false;\n consume(scanner, 47);\n while (!sol(scanner)) {\n consumeWhile(scanner, isWhiteSpace$1);\n if (consumeIdent(scanner)) {\n if (consume(scanner, 47)) {\n ok = consume(scanner, 60);\n break;\n } else if (consume(scanner, 60)) {\n ok = true;\n break;\n } else if (consume(scanner, isWhiteSpace$1)) {\n continue;\n } else if (consume(scanner, 61)) {\n if (consumeIdent(scanner)) {\n continue;\n }\n break;\n } else if (consumeAttributeWithUnquotedValue(scanner)) {\n ok = true;\n break;\n }\n break;\n }\n if (consumeAttribute(scanner)) {\n continue;\n }\n break;\n }\n scanner.pos = start;\n return ok;\n }\n function consumeAttribute(scanner) {\n return consumeAttributeWithQuotedValue(scanner) || consumeAttributeWithUnquotedValue(scanner);\n }\n function consumeAttributeWithQuotedValue(scanner) {\n const start = scanner.pos;\n if (consumeQuoted(scanner) && consume(scanner, 61) && consumeIdent(scanner)) {\n return true;\n }\n scanner.pos = start;\n return false;\n }\n function consumeAttributeWithUnquotedValue(scanner) {\n const start = scanner.pos;\n const stack = [];\n while (!sol(scanner)) {\n const ch = peek$1(scanner);\n if (isCloseBracket(ch)) {\n stack.push(ch);\n } else if (isOpenBracket(ch)) {\n if (stack.pop() !== bracePairs[ch]) {\n break;\n }\n } else if (!isUnquotedValue(ch)) {\n break;\n }\n scanner.pos--;\n }\n if (start !== scanner.pos && consume(scanner, 61) && consumeIdent(scanner)) {\n return true;\n }\n scanner.pos = start;\n return false;\n }\n function consumeIdent(scanner) {\n return consumeWhile(scanner, isIdent);\n }\n function isIdent(ch) {\n return ch === 58 || ch === 45 || isAlpha(ch) || isNumber$2(ch);\n }\n function isAlpha(ch) {\n ch &= ~32;\n return ch >= 65 && ch <= 90;\n }\n function isNumber$2(ch) {\n return ch > 47 && ch < 58;\n }\n function isWhiteSpace$1(ch) {\n return ch === 32 || ch === 9;\n }\n function isUnquotedValue(ch) {\n return !isNaN(ch) && ch !== 61 && !isWhiteSpace$1(ch) && !isQuote$1(ch);\n }\n function isOpenBracket(ch) {\n return ch === 123 || ch === 40 || ch === 91;\n }\n function isCloseBracket(ch) {\n return ch === 125 || ch === 41 || ch === 93;\n }\n const code = (ch) => ch.charCodeAt(0);\n const specialChars = \"#.*:$-_!@%^+>/\".split(\"\").map(code);\n const defaultOptions$1$1 = {\n type: \"markup\",\n lookAhead: true,\n prefix: \"\"\n };\n function extractAbbreviation(line, pos = line.length, options = {}) {\n const opt2 = Object.assign(Object.assign({}, defaultOptions$1$1), options);\n pos = Math.min(line.length, Math.max(0, pos == null ? line.length : pos));\n if (opt2.lookAhead) {\n pos = offsetPastAutoClosed(line, pos, opt2);\n }\n let ch;\n const start = getStartOffset(line, pos, opt2.prefix || \"\");\n if (start === -1) {\n return void 0;\n }\n const scanner = backwardScanner(line, start);\n scanner.pos = pos;\n const stack = [];\n while (!sol(scanner)) {\n ch = peek$1(scanner);\n if (stack.includes(125)) {\n if (ch === 125) {\n stack.push(ch);\n scanner.pos--;\n continue;\n }\n if (ch !== 123) {\n scanner.pos--;\n continue;\n }\n }\n if (isCloseBrace(ch, opt2.type)) {\n stack.push(ch);\n } else if (isOpenBrace(ch, opt2.type)) {\n if (stack.pop() !== bracePairs[ch]) {\n break;\n }\n } else if (stack.includes(93) || stack.includes(125)) {\n scanner.pos--;\n continue;\n } else if (isHtml(scanner) || !isAbbreviation(ch)) {\n break;\n }\n scanner.pos--;\n }\n if (!stack.length && scanner.pos !== pos) {\n const abbreviation2 = line.slice(scanner.pos, pos).replace(/^[*+>^]+/, \"\");\n return {\n abbreviation: abbreviation2,\n location: pos - abbreviation2.length,\n start: options.prefix ? start - options.prefix.length : pos - abbreviation2.length,\n end: pos\n };\n }\n }\n function offsetPastAutoClosed(line, pos, options) {\n if (isQuote$1(line.charCodeAt(pos))) {\n pos++;\n }\n while (isCloseBrace(line.charCodeAt(pos), options.type)) {\n pos++;\n }\n return pos;\n }\n function getStartOffset(line, pos, prefix) {\n if (!prefix) {\n return 0;\n }\n const scanner = backwardScanner(line);\n const compiledPrefix = prefix.split(\"\").map(code);\n scanner.pos = pos;\n let result;\n while (!sol(scanner)) {\n if (consumePair(scanner, 93, 91) || consumePair(scanner, 125, 123)) {\n continue;\n }\n result = scanner.pos;\n if (consumeArray(scanner, compiledPrefix)) {\n return result;\n }\n scanner.pos--;\n }\n return -1;\n }\n function consumePair(scanner, close, open) {\n const start = scanner.pos;\n if (consume(scanner, close)) {\n while (!sol(scanner)) {\n if (consume(scanner, open)) {\n return true;\n }\n scanner.pos--;\n }\n }\n scanner.pos = start;\n return false;\n }\n function consumeArray(scanner, arr) {\n const start = scanner.pos;\n let consumed = false;\n for (let i = arr.length - 1; i >= 0 && !sol(scanner); i--) {\n if (!consume(scanner, arr[i])) {\n break;\n }\n consumed = i === 0;\n }\n if (!consumed) {\n scanner.pos = start;\n }\n return consumed;\n }\n function isAbbreviation(ch) {\n return ch > 64 && ch < 91 || ch > 96 && ch < 123 || ch > 47 && ch < 58 || specialChars.includes(ch);\n }\n function isOpenBrace(ch, syntax) {\n return ch === 40 || syntax === \"markup\" && (ch === 91 || ch === 123);\n }\n function isCloseBrace(ch, syntax) {\n return ch === 41 || syntax === \"markup\" && (ch === 93 || ch === 125);\n }\n function expandAbbreviation$1(abbr, config2) {\n const resolvedConfig = resolveConfig(config2);\n return resolvedConfig.type === \"stylesheet\" ? stylesheet(abbr, resolvedConfig) : markup(abbr, resolvedConfig);\n }\n function markup(abbr, config2) {\n return stringify(parse$1(abbr, config2), config2);\n }\n function stylesheet(abbr, config2) {\n return css(parse$1$1(abbr, config2), config2);\n }\n const tabStopStart = String.fromCodePoint(65520);\n const tabStopEnd = String.fromCodePoint(65521);\n function getCaret(state) {\n return state.selection.main.from;\n }\n function substr(state, range) {\n return state.doc.sliceString(range.from, range.to);\n }\n function contains(range, pos) {\n return pos >= range.from && pos <= range.to;\n }\n function isQuote(ch) {\n return ch === '\"' || ch === \"'\";\n }\n function getAttributeValueRange(state, node) {\n let { from, to } = node;\n const value = substr(state, node);\n if (isQuote(value[0])) {\n from++;\n }\n if (isQuote(value[value.length - 1])) {\n to--;\n }\n return { from, to };\n }\n function getTagAttributes(state, node) {\n const result = {};\n for (const attr of node.getChildren(\"Attribute\")) {\n const attrNameNode = attr.getChild(\"AttributeName\");\n if (attrNameNode) {\n const attrName2 = substr(state, attrNameNode);\n const attrValueNode = attr.getChild(\"AttributeValue\");\n result[attrName2] = attrValueNode ? substr(state, getAttributeValueRange(state, attrValueNode)) : null;\n }\n }\n return result;\n }\n function rangeEmpty(r) {\n return r.from === r.to;\n }\n function last(arr) {\n return arr.length > 0 ? arr[arr.length - 1] : void 0;\n }\n function getSelectionsFromSnippet(snippet2, base = 0) {\n const ranges = [];\n let result = \"\";\n let sel = null;\n let offset = 0;\n let i = 0;\n let ch;\n while (i < snippet2.length) {\n ch = snippet2.charAt(i++);\n if (ch === tabStopStart || ch === tabStopEnd) {\n result += snippet2.slice(offset, i - 1);\n offset = i;\n if (ch === tabStopStart) {\n sel = {\n from: base + result.length,\n to: base + result.length\n };\n ranges.push(sel);\n } else if (sel) {\n sel = null;\n }\n }\n }\n if (!ranges.length) {\n ranges.push({\n from: snippet2.length + base,\n to: snippet2.length + base\n });\n }\n return {\n ranges,\n snippet: result + snippet2.slice(offset)\n };\n }\n const nodeToHTMLType = {\n OpenTag: \"open\",\n CloseTag: \"close\",\n SelfClosingTag: \"selfClose\"\n };\n function getContext(state, pos) {\n if (cssLanguage.isActiveAt(state, pos)) {\n return getCSSContext(state, pos);\n }\n if (htmlLanguage.isActiveAt(state, pos)) {\n return getHTMLContext(state, pos);\n }\n return;\n }\n function getCSSContext(state, pos, embedded) {\n const result = {\n type: \"css\",\n ancestors: [],\n current: null,\n inline: false,\n embedded\n };\n const tree = syntaxTree(state).resolveInner(pos, -1);\n const stack = [];\n for (let node = tree; node; node = node.parent) {\n if (node.name === \"RuleSet\") {\n const sel = getSelectorRange(node);\n stack.push({\n name: substr(state, sel),\n type: \"selector\",\n range: node\n });\n } else if (node.name === \"Declaration\") {\n const { name, value } = getPropertyRanges(node);\n if (value && contains(value, pos)) {\n stack.push({\n name: substr(state, value),\n type: \"propertyValue\",\n range: value\n });\n }\n if (name) {\n stack.push({\n name: substr(state, name),\n type: \"propertyName\",\n range: name\n });\n }\n }\n }\n const tip = stack.shift();\n if (tip) {\n const range = tip.type === \"selector\" ? { from: tip.range.from, to: tip.range.from + tip.name.length } : tip.range;\n if (contains(range, pos)) {\n result.current = tip;\n tip.range = range;\n } else {\n stack.unshift(tip);\n }\n }\n result.ancestors = stack.reverse();\n return result;\n }\n function getHTMLContext(state, pos) {\n const result = {\n type: \"html\",\n ancestors: [],\n current: null\n };\n const tree = syntaxTree(state).resolveInner(pos);\n for (let node = tree; node; node = node ? node.parent : null) {\n if (node.name in nodeToHTMLType) {\n const m = getContextMatchFromTag(state, node);\n if (m) {\n result.current = __spreadProps(__spreadValues({}, m), {\n type: nodeToHTMLType[node.name]\n });\n node = node.parent;\n }\n } else if (node.name === \"Element\") {\n const child = node.getChild(\"OpenTag\");\n if (child) {\n const m = getContextMatchFromTag(state, child);\n if (m) {\n result.ancestors.push(m);\n }\n }\n }\n }\n result.ancestors.reverse();\n detectCSSContextFromHTML(state, pos, result);\n return result;\n }\n function detectCSSContextFromHTML(state, pos, ctx) {\n var _a;\n if (((_a = ctx.current) == null ? void 0 : _a.type) === \"open\") {\n let node = syntaxTree(state).resolve(ctx.current.range.from, 1);\n while (node && node.name !== \"OpenTag\") {\n node = node.parent;\n }\n if (node) {\n for (const attr of node.getChildren(\"Attribute\")) {\n if (attr.from > pos) {\n break;\n }\n if (contains(attr, pos) && getAttributeName(state, attr) === \"style\") {\n const attrValue = attr.getChild(\"AttributeValue\");\n if (attrValue) {\n const cleanValueRange = getAttributeValueRange(state, attrValue);\n if (contains(cleanValueRange, pos)) {\n ctx.css = getInlineCSSContext(substr(state, cleanValueRange), pos - cleanValueRange.from, cleanValueRange.from);\n }\n }\n }\n }\n }\n }\n }\n function getContextMatchFromTag(state, node) {\n const tagName2 = node.getChild(\"TagName\");\n if (tagName2) {\n return {\n name: substr(state, tagName2).toLowerCase(),\n range: node\n };\n }\n }\n function getSelectorRange(node) {\n let from = node.from;\n let to = from;\n for (let child = node.firstChild; child && child.name !== \"Block\"; child = child.nextSibling) {\n to = child.to;\n }\n return { from, to };\n }\n function getPropertyRanges(node) {\n let name;\n let value;\n let ptr = node.firstChild;\n if ((ptr == null ? void 0 : ptr.name) === \"PropertyName\") {\n name = ptr;\n ptr = ptr.nextSibling;\n if ((ptr == null ? void 0 : ptr.name) === \":\") {\n ptr = ptr.nextSibling;\n }\n if (ptr) {\n value = {\n from: ptr.from,\n to: node.lastChild.to\n };\n }\n }\n return { name, value };\n }\n function getAttributeName(state, node) {\n const name = node.getChild(\"AttributeName\");\n return name ? substr(state, name).toLowerCase() : \"\";\n }\n function getInlineCSSContext(code2, pos, base = 0) {\n const result = {\n type: \"css\",\n ancestors: [],\n current: null,\n inline: true,\n embedded: {\n from: pos + base,\n to: pos + base + code2.length\n }\n };\n const props = parseInlineProps(code2, pos);\n for (const prop of props) {\n if (prop.value && contains(prop.value, pos)) {\n result.current = {\n name: code2.substring(prop.value.from, prop.value.to).trim(),\n type: \"propertyValue\",\n range: {\n from: base + prop.value.from,\n to: base + prop.value.to\n }\n };\n result.ancestors.push({\n name: code2.substring(prop.name.from, prop.name.to).trim(),\n type: \"propertyName\",\n range: {\n from: base + prop.name.from,\n to: base + prop.value.to\n }\n });\n break;\n } else if (contains(prop.name, pos)) {\n const end = prop.value ? prop.value.to : prop.name.to;\n result.current = {\n name: code2.substring(prop.name.from, prop.name.to).trim(),\n type: \"propertyName\",\n range: {\n from: base + prop.name.from,\n to: base + end\n }\n };\n break;\n }\n }\n return result;\n }\n function parseInlineProps(code2, limit = code2.length) {\n var _a;\n const space = \" \t\\n\\r\";\n const propList = [];\n let prop;\n for (let i = 0; i < code2.length; i++) {\n const ch = code2[i];\n if (prop) {\n if (prop.value) {\n if (prop.value.from !== -1) {\n prop.value.to = i;\n }\n } else {\n prop.name.to = i;\n }\n }\n if (ch === \";\") {\n prop = void 0;\n if (i > limit) {\n break;\n }\n } else if (ch === \":\") {\n if (prop && !prop.value) {\n prop.value = { from: -1, to: -1 };\n }\n } else {\n if (prop) {\n if (((_a = prop.value) == null ? void 0 : _a.from) === -1 && !space.includes(ch)) {\n prop.value.from = prop.value.to = i;\n }\n } else if (!space.includes(ch)) {\n prop = {\n name: { from: i, to: i }\n };\n propList.push(prop);\n }\n }\n }\n if (prop) {\n if (prop.value) {\n prop.value.to++;\n } else {\n prop.name.to++;\n }\n }\n return propList;\n }\n const xmlSyntaxes = [\"xml\", \"xsl\", \"jsx\"];\n const htmlSyntaxes = [\"html\", \"htmlmixed\", \"vue\"];\n const cssSyntaxes = [\"css\", \"scss\", \"less\"];\n const jsxSyntaxes = [\"jsx\", \"tsx\"];\n const stylesheetSyntaxes = [\"sass\", \"sss\", \"stylus\", \"postcss\"].concat(cssSyntaxes);\n function syntaxInfo(state, ctx) {\n let syntax = docSyntax(state);\n let inline;\n let context = typeof ctx === \"number\" ? getContext(state, ctx) : ctx;\n if ((context == null ? void 0 : context.type) === \"html\" && context.css) {\n inline = true;\n syntax = \"css\";\n context = context.css;\n } else if ((context == null ? void 0 : context.type) === \"css\") {\n syntax = \"css\";\n }\n return {\n type: getSyntaxType(syntax),\n syntax,\n inline,\n context\n };\n }\n function docSyntax(state) {\n const topLang = state.facet(language);\n if (topLang === cssLanguage) {\n return \"css\";\n }\n if (topLang === htmlLanguage) {\n return \"html\";\n }\n return \"\";\n }\n function getSyntaxType(syntax) {\n return syntax && stylesheetSyntaxes.includes(syntax) ? \"stylesheet\" : \"markup\";\n }\n function isXML(syntax) {\n return syntax ? xmlSyntaxes.includes(syntax) : false;\n }\n function isHTML(syntax) {\n return syntax ? htmlSyntaxes.includes(syntax) || isXML(syntax) : false;\n }\n function isCSS(syntax) {\n return syntax ? cssSyntaxes.includes(syntax) : false;\n }\n function isJSX(syntax) {\n return syntax ? jsxSyntaxes.includes(syntax) : false;\n }\n function getMarkupAbbreviationContext(state, ctx) {\n const parent = last(ctx.ancestors);\n if (parent) {\n let node = syntaxTree(state).resolve(parent.range.from, 1);\n while (node && node.name !== \"OpenTag\") {\n node = node.parent;\n }\n return {\n name: parent.name,\n attributes: node ? getTagAttributes(state, node) : {}\n };\n }\n return;\n }\n function getStylesheetAbbreviationContext(ctx) {\n if (ctx.inline) {\n return { name: \"@@property\" };\n }\n const parent = last(ctx.ancestors);\n let scope = \"@@global\";\n if (ctx.current) {\n if (ctx.current.type === \"propertyValue\" && parent) {\n scope = parent.name;\n } else if ((ctx.current.type === \"selector\" || ctx.current.type === \"propertyName\") && !parent) {\n scope = \"@@section\";\n }\n } else if (!parent) {\n scope = \"@@section\";\n }\n return {\n name: scope\n };\n }\n let cache = {};\n function expand(state, abbr, config2) {\n let opt2 = { cache };\n const outputOpt = {\n \"output.field\": field\n };\n if (config2) {\n Object.assign(opt2, config2);\n if (config2.options) {\n Object.assign(outputOpt, config2.options);\n }\n }\n opt2.options = outputOpt;\n const pluginConfig = getEmmetConfig(state);\n if (pluginConfig.config) {\n opt2 = resolveConfig(opt2, pluginConfig.config);\n }\n return expandAbbreviation$1(abbr, opt2);\n }\n function extract$1(code2, pos, type = \"markup\", options) {\n return extractAbbreviation(code2, pos, __spreadValues({\n lookAhead: type !== \"stylesheet\",\n type\n }, options));\n }\n function getOptions(state, pos) {\n const info = syntaxInfo(state, pos);\n const { context } = info;\n const config2 = {\n type: info.type,\n syntax: info.syntax || \"html\",\n options: getOutputOptions(state, info.inline)\n };\n if (context) {\n if (context.type === \"html\" && context.ancestors.length) {\n config2.context = getMarkupAbbreviationContext(state, context);\n } else if (context.type === \"css\") {\n config2.context = getStylesheetAbbreviationContext(context);\n }\n }\n return config2;\n }\n function resetCache() {\n cache = {};\n }\n const defaultConfig = {\n mark: true,\n preview: {},\n previewEnabled: true,\n autoRenameTags: true,\n markTagPairs: true,\n previewOpenTag: false,\n attributeQuotes: \"double\",\n markupStyle: \"html\",\n comments: false,\n commentsTemplate: \"<!-- /[#ID][.CLASS] -->\",\n bem: false,\n completionBoost: 99\n };\n const config = Facet.define({\n combine(value) {\n resetCache();\n const baseConfig = __spreadValues({}, defaultConfig);\n const { preview } = baseConfig;\n for (const item of value) {\n Object.assign(baseConfig, item);\n if (item.preview) {\n baseConfig.preview = __spreadValues(__spreadValues({}, preview), item.preview);\n }\n }\n return baseConfig;\n }\n });\n function getEmmetConfig(state, opt2) {\n let conf = state.facet(config);\n if (opt2) {\n conf = __spreadValues(__spreadValues({}, conf), opt2);\n }\n return conf;\n }\n function getOutputOptions(state, inline) {\n const syntax = docSyntax(state) || \"html\";\n const config2 = getEmmetConfig(state);\n const opt2 = {\n \"output.field\": field,\n \"output.indent\": \"\t\",\n \"output.format\": !inline,\n \"output.attributeQuotes\": config2.attributeQuotes,\n \"stylesheet.shortHex\": config2.shortHex\n };\n if (syntax === \"html\") {\n opt2[\"output.selfClosingStyle\"] = config2.markupStyle;\n opt2[\"output.compactBoolean\"] = config2.markupStyle === \"html\";\n }\n if (isHTML(syntax)) {\n if (config2.comments) {\n opt2[\"comment.enabled\"] = true;\n if (config2.commentsTemplate) {\n opt2[\"comment.after\"] = config2.commentsTemplate;\n }\n }\n opt2[\"bem.enabled\"] = config2.bem;\n }\n return opt2;\n }\n function field(index, placeholder) {\n return placeholder ? `\\${${index}:${placeholder}}` : `\\${${index}}`;\n }\n function createPreview(value, syntax, options) {\n const elem = document.createElement(\"div\");\n elem.className = \"emmet-preview\";\n if (syntax === \"error\") {\n elem.classList.add(\"emmet-preview_error\");\n }\n let ext = syntax === \"css\" ? css$1 : html$1;\n if (options && syntax in options) {\n ext = options[syntax];\n }\n const view = new EditorView({\n doc: value,\n extensions: [\n EditorState.readOnly.of(true),\n syntaxHighlighting(defaultHighlightStyle, { fallback: true }),\n syntax === \"css\" ? css$1() : html$1(),\n ext()\n ],\n parent: elem\n });\n elem.update = (nextValue) => {\n const tr = view.state.update({\n changes: {\n from: 0,\n to: view.state.doc.length,\n insert: nextValue\n }\n });\n view.dispatch(tr);\n };\n return elem;\n }\n const icon = \"data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM5MyIgdmlld0JveD0iMCAwIDM5MyAzOTMiIHdpZHRoPSIzOTMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxkZWZzPjxsaW5lYXJHcmFkaWVudCBpZD0iYSIgeDE9Ijk4LjYwODY5JSIgeDI9IjUwJSIgeTE9IjUwJSIgeTI9IjUwJSI+PHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjY2VmYmFkIi8+PHN0b3Agb2Zmc2V0PSIuODM2OTcyNTM1IiBzdG9wLWNvbG9yPSIjY2VmYmFkIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLW9wYWNpdHk9IjAiLz48L2xpbmVhckdyYWRpZW50PjxwYXRoIGlkPSJiIiBkPSJtMTE2IDQ4IDEwNSA2M3YzNC45ODVsLTc1LTQ0Ljk5OTI4OXY2Ny42NjcyODlsNDkuNSAyOS4zNDctNDkuNSAyOS4zNDZ2NjcuNjY4Mjg5bDc1LTQ1LjAwMDI4OXYzNC45ODZsLTEwNSA2M3ptMTQ1IDg3IDEwNSA2My0xMDUgNjN2LTM0Ljk4Nmw0Ni42OTA0ODEtMjguMDE0LTQ2LjY5MDQ4MS0yOC4wMTR6Ii8+PC9kZWZzPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgdHJhbnNmb3JtPSJtYXRyaXgoLjcwNzEwNjc4IC0uNzA3MTA2NzggLjcwNzEwNjc4IC43MDcxMDY3OCAtODEuMzkyOTY1IDE5Ni41KSI+PGNpcmNsZSBjeD0iMTk2LjUiIGN5PSIxOTYuNSIgZmlsbD0iIzI1MjcyYiIgcj0iMTk2LjUiLz48dXNlIGZpbGw9IiM5MmMxMzEiIHhsaW5rOmhyZWY9IiNiIi8+PHVzZSBmaWxsPSJ1cmwoI2EpIiB4bGluazpocmVmPSIjYiIvPjwvZz48L3N2Zz4=\";\n const emmetCompletionSource = (context) => {\n const tracker2 = context.state.field(trackerField);\n if ((tracker2 == null ? void 0 : tracker2.type) === \"abbreviation\" && tracker2.preview) {\n return {\n from: tracker2.range.from,\n to: tracker2.range.to,\n filter: false,\n update(current, _from, _to, context2) {\n const tracker3 = context2.state.field(trackerField);\n if (!tracker3 || tracker3.type === \"error\") {\n return null;\n }\n return __spreadProps(__spreadValues({}, current), {\n from: tracker3.range.from,\n to: tracker3.range.to,\n options: completionOptionsFromTracker(context2.state, tracker3)\n });\n },\n options: completionOptionsFromTracker(context.state, tracker2)\n };\n }\n return null;\n };\n const cssCompletion = cssLanguage.data.of({ autocomplete: emmetCompletionSource });\n const JSX_PREFIX = \"<\";\n const trackerMark = Decoration.mark({ class: \"emmet-tracker\" });\n const resetTracker = StateEffect.define();\n const forceTracker = StateEffect.define();\n const trackerField = StateField.define({\n create: () => null,\n update(value, tr) {\n const hasCompletion = tr.annotation(pickedCompletion);\n if (hasCompletion) {\n return null;\n }\n for (const effect of tr.effects) {\n if (effect.is(resetTracker)) {\n return null;\n }\n if (effect.is(forceTracker)) {\n const sel = tr.newSelection.main;\n const config2 = getActivationContext(tr.state, sel.from);\n if (config2) {\n return createTracker(tr.state, sel, {\n forced: true,\n config: config2\n });\n }\n }\n }\n if (!tr.docChanged) {\n return value;\n }\n return handleUpdate(tr.state, value, tr);\n }\n });\n const abbreviationPreview = StateField.define({\n create: getAbbreviationPreview,\n update(tooltip, tr) {\n if (!tr.docChanged && !tr.selection) {\n const tracker2 = tr.state.field(trackerField);\n return tracker2 ? tooltip : null;\n }\n return getAbbreviationPreview(tr.state, tooltip);\n },\n provide: (f) => showTooltip.from(f)\n });\n function getAbbreviationPreview(state, prevTooltip) {\n const tracker2 = state.field(trackerField);\n if (tracker2 && !tracker2.inactive && completionStatus(state) !== \"active\") {\n if (tracker2.config.type === \"stylesheet\") {\n return null;\n }\n if (prevTooltip && prevTooltip.tracker.type !== tracker2.type) {\n prevTooltip = null;\n }\n const { range } = tracker2;\n if (canDisplayPreview(state, tracker2)) {\n return prevTooltip || {\n pos: range.from,\n above: false,\n arrow: false,\n tracker: tracker2,\n create() {\n const previewConfig = state.facet(config).preview;\n let preview = \"\";\n let syntax = \"\";\n if (tracker2.type === \"error\") {\n preview = tracker2.error.message;\n syntax = \"error\";\n } else {\n preview = tracker2.preview;\n syntax = tracker2.config.syntax || \"html\";\n }\n const dom = createPreview(preview, syntax, previewConfig);\n return {\n dom,\n update({ state: state2 }) {\n const tracker3 = state2.field(trackerField);\n if (tracker3 && dom.update) {\n const value = tracker3.type === \"error\" ? tracker3.error.message : tracker3.preview;\n dom.update(value);\n }\n }\n };\n }\n };\n }\n }\n return null;\n }\n const abbreviationTracker = ViewPlugin.fromClass(class {\n constructor() {\n __publicField(this, \"decorations\");\n this.decorations = Decoration.none;\n }\n update(update) {\n const { state } = update;\n const tracker2 = state.field(trackerField);\n const decors = [];\n if (tracker2 && !tracker2.inactive) {\n const { range } = tracker2;\n if (!rangeEmpty(range)) {\n decors.push(trackerMark.range(range.from, range.to));\n }\n this.decorations = Decoration.set(decors, true);\n } else {\n this.decorations = Decoration.none;\n }\n }\n }, {\n decorations: (v) => v.decorations\n });\n function expandTracker(view, tracker2) {\n const { from, to } = tracker2.range;\n const expanded = expand(view.state, tracker2.abbreviation, tracker2.config);\n const fn = snippet(expanded);\n view.dispatch(view.state.update({\n effects: resetTracker.of(null)\n }));\n fn(view, { label: \"expand\" }, from, to);\n }\n const tabKeyHandler = (view) => {\n const { state } = view;\n if (completionStatus(state)) {\n return false;\n }\n const tracker2 = state.field(trackerField, false);\n if (tracker2 && !tracker2.inactive && contains(tracker2.range, getCaret(state))) {\n expandTracker(view, tracker2);\n return true;\n }\n return false;\n };\n const escKeyHandler = ({ state, dispatch }) => {\n const tracker2 = state.field(trackerField, false);\n if (tracker2) {\n dispatch({\n effects: resetTracker.of(null)\n });\n return true;\n }\n return false;\n };\n const trackerTheme = EditorView.baseTheme({\n \".emmet-tracker\": {\n textDecoration: \"underline 1px green\"\n },\n \".emmet-preview\": {\n fontSize: \"0.9em\"\n },\n \".emmet-preview_error\": {\n color: \"red\"\n },\n \".cm-completionIcon-emmet::after\": {\n content: '\" \"',\n background: `url(\"${icon}\") center/contain no-repeat`,\n display: \"inline-block\",\n width: \"11px\",\n height: \"11px\",\n verticalAlign: \"middle\"\n }\n });\n function tracker(options) {\n return [\n trackerField,\n abbreviationTracker,\n abbreviationPreview,\n trackerTheme,\n cssCompletion,\n options ? config.of(options) : [],\n keymap.of([{\n key: \"Tab\",\n run: tabKeyHandler\n }, {\n key: \"Escape\",\n run: escKeyHandler\n }])\n ];\n }\n function typingAbbreviation(state, pos, input) {\n if (input.length !== 1) {\n return null;\n }\n const line = state.doc.lineAt(pos);\n const prefix = line.text.substring(Math.max(0, pos - line.from - 1), pos - line.from);\n if (!canStartTyping(prefix, input, getSyntaxFromPos(state, pos))) {\n return null;\n }\n const config2 = getActivationContext(state, pos);\n if (!config2) {\n return null;\n }\n if (config2.type === \"stylesheet\" && !canStartTyping(prefix, input, \"css\")) {\n return null;\n }\n const syntax = config2.syntax || \"html\";\n let from = pos;\n let to = pos + input.length;\n let offset = 0;\n if (isJSX(syntax) && prefix === JSX_PREFIX) {\n offset = JSX_PREFIX.length;\n from -= offset;\n }\n return createTracker(state, { from, to }, { config: config2 });\n }\n function getActivationContext(state, pos) {\n if (cssLanguage.isActiveAt(state, pos)) {\n return getCSSActivationContext(state, pos, \"css\", getCSSContext(state, pos));\n }\n const syntax = docSyntax(state);\n if (isHTML(syntax)) {\n const ctx = getHTMLContext(state, pos);\n if (ctx.css) {\n return getCSSActivationContext(state, pos, \"css\", ctx.css);\n }\n if (!ctx.current) {\n return {\n syntax,\n type: \"markup\",\n context: getMarkupAbbreviationContext(state, ctx),\n options: getOutputOptions(state)\n };\n }\n } else {\n return {\n syntax,\n type: getSyntaxType(syntax),\n options: getOutputOptions(state)\n };\n }\n return void 0;\n }\n function getCSSActivationContext(state, pos, syntax, ctx) {\n const allowedContext = !ctx.current || ctx.current.type === \"propertyName\" || ctx.current.type === \"propertyValue\" || isTypingBeforeSelector(state, pos, ctx);\n if (allowedContext) {\n return {\n syntax,\n type: \"stylesheet\",\n context: getStylesheetAbbreviationContext(ctx),\n options: getOutputOptions(state, ctx.inline)\n };\n }\n return;\n }\n function isTypingBeforeSelector(state, pos, { current }) {\n if ((current == null ? void 0 : current.type) === \"selector\" && current.range.from === pos - 1) {\n const line = state.doc.lineAt(current.range.from);\n return line.text.trim().length === 1;\n }\n return false;\n }\n function isValidPrefix(prefix, syntax) {\n if (isJSX(syntax)) {\n return prefix === JSX_PREFIX;\n }\n if (isCSS(syntax)) {\n return prefix === \"\" || /^[\\s>;\"\\']$/.test(prefix);\n }\n return prefix === \"\" || /^[\\s>;\"\\']$/.test(prefix);\n }\n function isValidAbbreviationStart(input, syntax) {\n if (isJSX(syntax)) {\n return /^[a-zA-Z.#\\[\\(]$/.test(input);\n }\n if (isCSS(syntax)) {\n return /^[a-zA-Z!@#]$/.test(input);\n }\n return /^[a-zA-Z.#!@\\[\\(]$/.test(input);\n }\n function createTracker(state, range, params) {\n if (range.from > range.to) {\n return null;\n }\n let abbreviation2 = substr(state, range);\n const { config: config2, forced } = params;\n if (params.offset) {\n abbreviation2 = abbreviation2.slice(params.offset);\n }\n if (!abbreviation2 && !forced || hasInvalidChars(abbreviation2)) {\n return null;\n }\n const base = {\n abbreviation: abbreviation2,\n range,\n config: config2,\n forced: !!forced,\n inactive: false,\n offset: params.offset || 0\n };\n try {\n let parsedAbbr;\n let simple = false;\n if (config2.type === \"markup\") {\n parsedAbbr = parseAbbreviation(abbreviation2, {\n jsx: config2.syntax === \"jsx\"\n });\n simple = isSimpleMarkupAbbreviation(parsedAbbr);\n }\n const previewConfig = createPreviewConfig(config2);\n const preview = expand(state, parsedAbbr || abbreviation2, previewConfig);\n if (!preview) {\n return null;\n }\n return __spreadProps(__spreadValues({}, base), {\n type: \"abbreviation\",\n simple,\n preview\n });\n } catch (error2) {\n return base.forced ? __spreadProps(__spreadValues({}, base), {\n type: \"error\",\n error: error2\n }) : null;\n }\n }\n function hasInvalidChars(abbreviation2) {\n return /[\\r\\n]/.test(abbreviation2);\n }\n function isSimpleMarkupAbbreviation(abbr) {\n if (abbr.children.length === 1 && !abbr.children[0].children.length) {\n const first = abbr.children[0];\n return !first.name || /^[a-z]/i.test(first.name);\n }\n return !abbr.children.length;\n }\n function createPreviewConfig(config2) {\n return __spreadProps(__spreadValues({}, config2), {\n options: __spreadProps(__spreadValues({}, config2.options), {\n \"output.field\": previewField,\n \"output.indent\": \" \",\n \"output.baseIndent\": \"\"\n })\n });\n }\n function previewField(_, placeholder) {\n return placeholder;\n }\n function handleUpdate(state, tracker2, update) {\n if (hasSnippet(state)) {\n return null;\n }\n if (!tracker2 || tracker2.inactive) {\n update.changes.iterChanges((_fromA, _toA, fromB, _toB, text2) => {\n if (text2.length) {\n tracker2 = typingAbbreviation(state, fromB, text2.toString()) || tracker2;\n }\n });\n if (!tracker2 || !tracker2.inactive) {\n return tracker2;\n }\n }\n update.changes.iterChanges((fromA, toA, fromB, toB, text2) => {\n if (!tracker2) {\n return;\n }\n const { range } = tracker2;\n if (!contains(range, fromA)) {\n if (!tracker2.inactive) {\n tracker2 = null;\n }\n } else if (contains(range, fromB)) {\n const removed = toA - fromA;\n const inserted = toB - fromA;\n const to = range.to + inserted - removed;\n if (to <= range.from || hasInvalidChars(text2.toString())) {\n tracker2 = null;\n } else {\n const abbrRange = tracker2.inactive ? range : { from: range.from, to };\n const nextTracker = createTracker(state, abbrRange, {\n config: tracker2.config,\n forced: tracker2.forced\n });\n if (!nextTracker) {\n tracker2 = __spreadProps(__spreadValues({}, tracker2), { inactive: true });\n } else {\n tracker2 = nextTracker;\n }\n }\n }\n });\n return tracker2;\n }\n function getSyntaxFromPos(state, pos) {\n if (cssLanguage.isActiveAt(state, pos)) {\n return \"css\";\n }\n if (htmlLanguage.isActiveAt(state, pos)) {\n return \"html\";\n }\n return \"\";\n }\n function canStartTyping(prefix, input, syntax) {\n return isValidPrefix(prefix, syntax) && isValidAbbreviationStart(input, syntax);\n }\n function hasSnippet(state) {\n if (Array.isArray(state.values)) {\n return state.values.some((item) => {\n var _a;\n return item && ((_a = item.constructor) == null ? void 0 : _a.name) === \"ActiveSnippet\";\n });\n }\n return false;\n }\n function canDisplayPreview(state, tracker2) {\n if (completionStatus(state) === \"active\") {\n return false;\n }\n const config2 = getEmmetConfig(state);\n if (!config2.previewEnabled) {\n return false;\n }\n if (Array.isArray(config2.previewEnabled)) {\n const { type, syntax } = tracker2.config;\n if (!config2.previewEnabled.includes(type) && !config2.previewEnabled.includes(syntax)) {\n return false;\n }\n }\n return tracker2.type === \"error\" || (!tracker2.simple || tracker2.forced) && !!tracker2.abbreviation && contains(tracker2.range, getCaret(state));\n }\n function completionOptionsFromTracker(state, tracker2, prev2) {\n const opt2 = state.facet(config);\n return [{\n label: \"Emmet abbreviation\",\n type: \"emmet\",\n boost: opt2.completionBoost,\n tracker: tracker2,\n previewConfig: opt2.preview,\n preview: prev2 == null ? void 0 : prev2.preview,\n info: completionInfo,\n apply: (view, completion) => {\n view.dispatch({\n annotations: pickedCompletion.of(completion)\n });\n expandTracker(view, tracker2);\n }\n }];\n }\n function completionInfo(completion) {\n let { tracker: tracker2, previewConfig, preview } = completion;\n if (preview == null ? void 0 : preview.update) {\n preview.update(tracker2.preview);\n } else {\n completion.preview = preview = createPreview(tracker2.preview, tracker2.config.syntax || \"html\", previewConfig);\n }\n return preview;\n }\n const expandAbbreviation = ({ state, dispatch }) => {\n const sel = state.selection.main;\n const line = state.doc.lineAt(sel.anchor);\n const options = getOptions(state, sel.anchor);\n const abbr = extract$1(line.text, sel.anchor - line.from, getSyntaxType(options.syntax));\n if (abbr) {\n const start = line.from + abbr.start;\n const expanded = expand(state, abbr.abbreviation, getActivationContext(state, start) || options);\n const fn = snippet(expanded);\n fn({ state, dispatch }, { label: \"expand\" }, start, line.from + abbr.end);\n return true;\n }\n return false;\n };\n const updateAbbreviation = StateEffect.define();\n const wrapAbbreviationField = StateField.define({\n create: () => null,\n update(value, tr) {\n for (const effect of tr.effects) {\n if (effect.is(updateAbbreviation)) {\n value = effect.value;\n }\n }\n return value;\n }\n });\n EditorView.baseTheme({\n \".emmet-wrap-with-abbreviation\": {\n position: \"absolute\",\n top: 0,\n zIndex: 2,\n width: \"100%\"\n },\n \".emmet-wrap-with-abbreviation__content\": {\n background: \"#fff\",\n margin: \"0 auto\",\n padding: \"5px\",\n boxSizing: \"border-box\",\n width: \"100%\",\n maxWidth: \"30em\",\n borderBottomLeftRadius: \"5px\",\n borderBottomRightRadius: \"5px\",\n boxShadow: \"0 3px 10px rgba(0, 0, 0, 0.3)\"\n },\n \".emmet-wrap-with-abbreviation__content input\": {\n width: \"100%\",\n boxSizing: \"border-box\"\n }\n });\n ViewPlugin.fromClass(class WrapWithAbbreviationViewPlugin {\n constructor() {\n __publicField(this, \"widget\", null);\n __publicField(this, \"input\", null);\n }\n update(update) {\n const { state, view } = update;\n const abbr = state.field(wrapAbbreviationField);\n if (abbr) {\n if (!this.widget) {\n this.createInputPanel(view);\n }\n this.updateAbbreviation(abbr.abbreviation);\n } else if (this.widget) {\n this.disposeWidget();\n view.focus();\n }\n }\n createInputPanel(view) {\n const widget = document.createElement(\"div\");\n widget.className = \"emmet-wrap-with-abbreviation\";\n const content = document.createElement(\"div\");\n content.className = \"emmet-wrap-with-abbreviation__content\";\n const input = document.createElement(\"input\");\n input.placeholder = \"Enter abbreviation\";\n let updated = false;\n const undoUpdate = () => {\n if (updated) {\n undo(view);\n updated = false;\n }\n };\n input.addEventListener(\"input\", () => {\n const abbr = view.state.field(wrapAbbreviationField);\n if (abbr) {\n const nextAbbreviation = input.value;\n undoUpdate();\n const nextAbbr = __spreadProps(__spreadValues({}, abbr), {\n abbreviation: nextAbbreviation\n });\n if (nextAbbr.abbreviation) {\n updated = true;\n const { from, to } = nextAbbr.range;\n const expanded = expand(view.state, nextAbbr.abbreviation, nextAbbr.options);\n const { ranges, snippet: snippet2 } = getSelectionsFromSnippet(expanded, from);\n const nextSel = ranges[0];\n view.dispatch({\n effects: [updateAbbreviation.of(nextAbbr)],\n changes: [{\n from,\n to,\n insert: snippet2\n }],\n selection: {\n head: nextSel.from,\n anchor: nextSel.to\n }\n });\n } else {\n view.dispatch({\n effects: [updateAbbreviation.of(nextAbbr)]\n });\n }\n }\n });\n input.addEventListener(\"keydown\", (evt) => {\n if (evt.key === \"Escape\" || evt.key === \"Enter\") {\n if (evt.key === \"Escape\") {\n undoUpdate();\n }\n evt.preventDefault();\n view.dispatch({\n effects: [updateAbbreviation.of(null)]\n });\n }\n });\n content.append(input);\n widget.append(content);\n view.dom.append(widget);\n this.widget = widget;\n this.input = input;\n input.focus();\n }\n updateAbbreviation(value) {\n if (this.input && this.input.value !== value) {\n this.input.value = value;\n }\n }\n disposeWidget() {\n if (this.widget) {\n this.widget.remove();\n this.widget = this.input = null;\n }\n }\n });\n\n const basicSetup = [\n lineNumbers(),\n highlightActiveLineGutter(),\n highlightSpecialChars(),\n history(),\n foldGutter(),\n drawSelection(),\n dropCursor(),\n EditorState.allowMultipleSelections.of(true),\n indentOnInput(),\n syntaxHighlighting(defaultHighlightStyle),\n bracketMatching(),\n closeBrackets(),\n autocompletion(),\n rectangularSelection(),\n crosshairCursor(),\n highlightActiveLine(),\n highlightSelectionMatches(),\n keymap.of([\n {\n key: \"Tab\",\n run: indentMore\n },\n ])\n ];\n\n // Global object to store editor instances and active editor\n window.editorManager = {\n htmlEditor: null,\n cssEditor: null,\n jsEditor: null,\n activeEditor: null,\n setMode(preprocessor, editor) {\n const newExtensions = getEditorExtensions(preprocessor);\n \n // Create a new EditorState with the new extensions\n const newState = EditorState.create({\n doc: editor.state.doc, // Preserve the current document content\n extensions: newExtensions // Apply new extensions\n });\n \n // Update the editor state with the new extensions\n editor.dispatch({\n effects: EditorView.updateListener.of((v) => {\n // Preserve the update listener and other features\n }),\n // Replace the state with the new state containing updated extensions\n state: newState\n });\n }\n };\n\n // Helper functions to set and get the active editor\n window.setActiveEditor = function(editor) {\n window.editorManager.activeEditor = editor;\n };\n window.getActiveEditor = function() {\n return window.editorManager.activeEditor;\n };\n\n // init editors\n function getEditorExtensions(preprocessor) {\n // Common setup for all editors\n const commonKeymap = keymap.of([\n indentWithTab,\n ...closeBracketsKeymap,\n ...defaultKeymap,\n ...searchKeymap,\n ...historyKeymap,\n ...foldKeymap,\n ...completionKeymap\n ]);\n\n // Specific keymap for expandAbbreviation\n const htmlMarkdownKeymap = keymap.of([\n { key: \"Enter\", run: expandAbbreviation },\n indentWithTab,\n ...closeBracketsKeymap,\n ...defaultKeymap,\n ...searchKeymap,\n ...historyKeymap,\n ...foldKeymap,\n ...completionKeymap\n ]);\n\n // Common setup for all editors\n const extensions = [\n ...basicSetup,\n EditorView.lineWrapping,\n commonKeymap,\n colorPicker,\n tracker()\n ];\n const htmlExtensions = [\n ...basicSetup,\n EditorView.lineWrapping,\n htmlMarkdownKeymap,\n colorPicker,\n tracker()\n ];\n\n // Add specific extensions based on the preprocessor type\n switch (preprocessor) {\n case 'html':\n case 'markdown':\n return [\n ...htmlExtensions,\n preprocessor === 'html' ? html$1() : markdown({ base: markdownLanguage, codeLanguages: [] })\n ];\n case 'css':\n return [\n ...extensions,\n css$1()\n ];\n case 'javascript':\n return [\n ...extensions,\n javascript()\n ];\n case 'typescript':\n return [\n ...extensions,\n javascript({ typescript: true })\n ];\n case 'babel':\n return [\n ...extensions,\n javascript({ jsx: true })\n ];\n case 'jsxtypescript':\n return [\n ...extensions,\n javascript({ jsx: true, typescript: true })\n ];\n case 'none':\n return extensions; // No additional extensions\n default:\n console.warn(`Unknown preprocessor type: ${preprocessor}`);\n return extensions;\n }\n }\n\n function initEditors() {\n const htmlEditor = new EditorView({\n state: EditorState.create({\n doc: project.html,\n extensions: [\n ...getEditorExtensions(project.html_pre_processor),\n EditorView.updateListener.of((v) => {\n if (window.editorManager.activeEditor !== htmlEditor) window.setActiveEditor(htmlEditor);\n const newHtml = htmlEditor.state.doc.toString();\n if (project.html !== newHtml) project.html = newHtml;\n }),\n ],\n }),\n docChanged: true,\n parent: document.getElementById('htmlEditor'),\n allowMultipleSelections: true,\n });\n const cssEditor = new EditorView({\n state: EditorState.create({\n doc: project.css,\n extensions: [\n ...getEditorExtensions(project.css_pre_processor),\n EditorView.updateListener.of((v) => {\n if (data.activeEditor !== 'css') window.setActiveEditor(cssEditor);\n const newCSS = cssEditor.state.doc.toString();\n if (project.css !== newCSS) project.css = newCSS;\n }),\n ],\n }),\n docChanged: true,\n parent: document.getElementById('cssEditor'),\n allowMultipleSelections: true,\n });\n const jsEditor = new EditorView({\n state: EditorState.create({\n doc: project.javascript,\n extensions: [\n ...getEditorExtensions(project.javascript_pre_processor),\n EditorView.updateListener.of((v) => {\n if (data.activeEditor !== 'javascript') window.setActiveEditor(jsEditor);\n const newJS = jsEditor.state.doc.toString();\n if (project.javascript !== newJS) project.javascript = newJS;\n }),\n ],\n }),\n docChanged: true,\n parent: document.getElementById('jsEditor'),\n allowMultipleSelections: true,\n });\n\n // Store editor instances in the global object\n window.editorManager.htmlEditor = htmlEditor;\n window.editorManager.cssEditor = cssEditor;\n window.editorManager.jsEditor = jsEditor;\n\n // Set the default active editor\n window.setActiveEditor(htmlEditor);\n }\n\n // editor functions\n function dispatchChanges(editor, content) {\n editor.dispatch({\n changes: {\n from: 0,\n to: editor.state.doc.toString().length,\n insert: content,\n },\n });\n }\n\n // Command functions\n window.editorCommand = async function(string) {\n if (string === \"indent\") indentMore(getActiveEditor());\n if (string === \"outdent\") indentLess(getActiveEditor());\n if (string === \"goto\") gotoLine(getActiveEditor());\n if (string === \"undo\") undo(getActiveEditor());\n if (string === \"redo\") redo(getActiveEditor());\n if (string === \"search\") openSearchPanel(getActiveEditor());\n if (string === \"toggleComment\") toggleComment(getActiveEditor());\n if (string === \"foldAll\") foldAll(getActiveEditor());\n if (string === \"unfoldAll\") unfoldAll(getActiveEditor());\n if (string === \"cut\") cutSelection(getActiveEditor());\n if (string === \"copy\") copySelection(getActiveEditor());\n if (string === \"paste\") pasteText(getActiveEditor());\n if (string === \"selectAll\") selectAll(getActiveEditor());\n };\n \n // Function to cut the selected text\n const cutSelection = editor => {\n const { state, dispatch } = editor;\n const { selection } = state;\n const selectedText = state.sliceDoc(selection.main.from, selection.main.to);\n navigator.clipboard.writeText(selectedText);\n dispatch(state.update({\n changes: { from: selection.main.from, to: selection.main.to, insert: '' }\n }));\n };\n\n // Function to copy the selected text\n const copySelection = editor => {\n const { state } = editor;\n const { selection } = state;\n const selectedText = state.sliceDoc(selection.main.from, selection.main.to);\n navigator.clipboard.writeText(selectedText);\n };\n\n // Function to paste text at the cursor position\n const pasteText = async editor => {\n const { state, dispatch } = editor;\n try {\n const text = await navigator.clipboard.readText();\n if (text) {\n const { selection } = state;\n dispatch(state.update({ changes: { from: selection.main.from, to: selection.main.to, insert: text } }));\n } else {\n console.log('Clipboard is empty or does not contain text.');\n }\n } catch (error) {\n console.error('Failed to paste text:', error);\n }\n };\n\n // Function to select all text in the active editor\n const selectAll = editor => {\n const { state, dispatch } = editor;\n const { doc } = state;\n const selection = { anchor: 0, head: doc.length };\n dispatch(state.update({ selection }));\n };\n\n // Make functions available in global space\n window.initEditors = initEditors;\n window.dispatchChanges = dispatchChanges;\n window.indentMore = indentMore;\n window.indentLess = indentLess;\n window.gotoLine = gotoLine;\n window.undo = undo;\n window.redo = redo;\n window.openSearchPanel = openSearchPanel;\n window.toggleComment = toggleComment;\n window.foldAll = foldAll;\n window.unfoldAll = unfoldAll;\n window.cutSelection = cutSelection;\n window.copySelection = copySelection;\n window.pasteText = pasteText;\n window.selectAll = selectAll;\n window.getEditorExtensions = getEditorExtensions;\n\n})();\n"], - "mappings": "gQACA,SAASA,GAASC,EAAQC,EAAUC,EAAO,CAAC,EAAG,CAC7C,SAASC,EAAYH,EAAQE,EAAM,CACjC,OAAI,OAAOF,GAAW,UAAYA,IAAW,KACpCA,EAGF,IAAI,MAAMA,EAAQ,CACvB,IAAII,EAAKC,EAAUC,GAAO,CACxB,IAAMC,GAAW,CAAC,GAAGL,EAAMG,CAAQ,EAC7BG,EAAWJ,EAAIC,CAAQ,EACvBI,EAAS,QAAQ,IAAIL,EAAKC,EAAUF,EAAYG,GAAOC,EAAQ,CAAC,EAEtE,OAAIC,IAAaF,IACfL,EAASM,GA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,KAAM,EACR,EACA,QAAW,CACT,UAAW,CAAC,EACZ,KAAM,4EACR,EACA,WAAY,CACV,UAAW,CACT,oEACF,EACA,KAAM,EACR,EACA,cAAe,CACb,UAAW,CACT,+EACA,mFACF,EACA,KAAM,EACR,EACA,WAAY,CACV,UAAW,CACT,uEACA,mFACA,gFACF,EACA,KAAM,EACR,EACA,YAAa,CACX,UAAW,CACT,4EACF,EACA,KAAM,EACR,EACA,WAAY,CACV,UAAW,CACT,uCACF,EACA,KAAM,EACR,EACA,SAAY,CACV,UAAW,CACT,+DACA,6DACF,EACA,KAAM,EACR,EACA,GAAM,CACJ,UAAW,CACT,+BACF,EACA,KAAM,EACR,EACA,KAAQ,CACN,UAAW,CACT,4DACF,EACA,KAAM,EACR,EACA,QAAW,CACT,UAAW,CACT,qEACF,EACA,KAAM,EACR,EACA,aAAc,CACZ,UAAW,CACT,4EACF,EACA,KAAM,EACR,EACA,WAAc,CACZ,UAAW,CACT,iFACA,8EACF,EACA,KAAM,EACR,EACA,cAAe,CACb,UAAW,CACT,6EACA,2EACF,EACA,KAAM,EACR,EACA,OAAU,CACR,UAAW,CACT,mEACF,EACA,KAAM,EACR,EACA,gBAAiB,CACf,UAAW,CACT,2EACF,EACA,KAAM,EACR,EACA,KAAQ,CACN,UAAW,CACT,2CACF,EACA,KAAM,EACR,EACA,YAAa,CACX,UAAW,CACT,6EACA,0EACF,EACA,KAAM,EACR,EACA,WAAY,CACV,UAAW,CACT,oEACF,EACA,KAAM,EACR,EACA,SAAY,CACV,UAAW,CAAC,EACZ,KAAM,4DACR,EACA,OAAU,CACR,UAAW,CACT,mEACF,EACA,KAAM,EACR,EACA,MAAS,CACP,UAAW,CACT,6EACA,kEACF,EACA,KAAM,EACR,EACA,cAAe,CACb,UAAW,CACT,0EACF,EACA,KAAM,EACR,EACA,QAAW,CACT,UAAW,CACT,iEACF,EACA,KAAM,EACR,EACA,oBAAqB,CACnB,UAAW,CACT,2FACA,yFACF,EACA,KAAM,EACR,EACA,OAAU,CACR,UAAW,CACT,wEACF,EACA,KAAM,EACR,EACA,aAAc,CACZ,UAAW,CACT,6DACF,EACA,KAAM,EACR,EACA,YAAe,CACb,UAAW,CACT,mFACA,gFACF,EACA,KAAM,EACR,EACA,gBAAiB,CACf,UAAW,CACT,0EACF,EACA,KAAM,EACR,EACA,QAAW,CACT,UAAW,CACT,2DACF,EACA,KAAM,EACR,EACA,YAAa,CACX,UAAW,CACT,uEACF,EACA,KAAM,EACR,EACA,UAAW,CACT,UAAW,CAAC,EACZ,KAAM,mDACR,EACA,cAAe,CACb,UAAW,CACT,0DACF,EACA,KAAM,EACR,EACA,WAAY,CACV,UAAW,CACT,oEACA,sEACF,EACA,KAAM,EACR,EACA,OAAU,CACR,UAAW,CACT,oDACF,EACA,KAAM,EACR,EACA,aAAc,CACZ,UAAW,CACT,uDACF,EACA,KAAM,EACR,EACA,YAAa,CACX,UAAW,CACT,gEACF,EACA,KAAM,EACR,EACA,WAAY,CACV,UAAW,CACT,gEACF,EACA,KAAM,EACR,EACA,aAAc,CACZ,UAAW,CACT,qEACF,EACA,KAAM,EACR,EACA,aAAc,CACZ,UAAW,CACT,qEACF,EACA,KAAM,EACR,EACA,WAAY,CACV,UAAW,CACT,0DACA,iEACF,EACA,KAAM,EACR,EACA,cAAe,CACb,UAAW,CACT,4EACA,0EACF,EACA,KAAM,EACR,EACA,eAAgB,CACd,UAAW,CACT,wEACF,EACA,KAAM,EACR,EACA,cAAe,CACb,UAAW,CACT,0EACF,EACA,KAAM,EACR,EACA,SAAY,CACV,UAAW,CACT,6EACA,4FACF,EACA,KAAM,EACR,EACA,OAAU,CACR,UAAW,CACT,4EACA,0EACF,EACA,KAAM,EACR,EACA,SAAY,CACV,UAAW,CACT,yEACF,EACA,KAAM,EACR,EACA,eAAgB,CACd,UAAW,CACT,sEACF,EACA,KAAM,EACR,EACA,WAAY,CACV,UAAW,CACT,mEACF,EACA,KAAM,EACR,EACA,WAAY,CACV,UAAW,CACT,+EACF,EACA,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P,EACA,SAASC,GAAY97F,EAAMk6F,EAAWX,EAAS,CACzC,CAACv5F,EAAK,MAAQA,EAAK,YACrB+7F,GAAmB/7F,EAAMk6F,EAAWX,CAAO,CAE/C,CACA,SAASwC,GAAmB/7F,EAAMk6F,EAAWX,EAAS,CACpD,IAAMrhF,EAAS8jF,GAAiB9B,CAAS,EACnC+B,EAAc1C,EAAQ,QAAUA,EAAQ,QAAQ,KAAO,GACvD2C,EAAaC,GAAUjkF,EAASA,EAAO,KAAO+jF,CAAW,EAC/Dj8F,EAAK,KAAO67F,GAAWK,CAAU,IAAMN,GAASM,EAAY3C,CAAO,EAAI,OAAS,MAClF,CACA,SAAS4C,GAAUh7F,EAAK,CACtB,OAAQA,GAAO,IAAI,YAAY,CACjC,CACA,SAAS66F,GAAiB9B,EAAW,CACnC,QAASz8F,EAAIy8F,EAAU,OAAS,EAAGz8F,GAAK,EAAGA,IAAK,CAC9C,IAAM0yF,EAAO+J,EAAUz8F,CAAC,EACxB,GAAIq2E,GAAOqc,CAAI,EACb,OAAOA,CAEX,CACF,CACA,IAAIiM,GAAQ,CACV,OAAU,CAAC,QAAS,QAAS,QAAS,MAAO,OAAQ,cAAe,cAAe,MAAM,EACzF,MAAS,CACP,iBACA,cACA,eACA,UACA,UACA,OACA,OACA,MACA,QACA,MACA,MACA,WACA,YACA,OACA,cACA,QACA,MACA,WACA,MACA,WACA,SACA,MACA,OACA,UACA,UACA,cACA,UACA,QACA,QACA,WACA,QACA,OACA,QACA,OACA,QACA,SACA,WACA,QACA,OACA,QACA,QACA,QACA,QACA,OACA,MACA,KACA,KACA,eACA,UACA,YACA,UACA,YACA,WACA,UACA,UACA,UACA,OACA,YACA,cACA,MACA,iBACA,WACA,WACA,SACA,WACA,WACA,UACA,OACA,cACA,OACA,WACA,YACA,MACA,aACA,aACA,SACA,OACA,MACA,UACA,QACA,QACA,SACA,OACA,QACA,aACA,WACA,YACA,QACA,UACA,SACA,UACA,cACA,QACA,YACA,QACA,OACA,QACA,WACA,UACA,OACA,aACA,UACA,YACA,QACA,UACA,OACA,aACA,YACA,QACA,aACA,QACA,QACA,UACA,aACA,KACA,OACA,OACA,WACA,OACA,aACA,QACA,WACA,aACA,QACA,eACA,MACA,aACA,YACA,YACA,KACA,QACA,QACA,QACA,OACA,KACA,KACA,OACA,QACA,UACA,KACA,KACA,KACA,OACA,gBACA,UACA,OACA,SACA,MACA,YACA,SACA,cACA,SACA,aACA,OACA,YACA,aACA,UACA,cACA,aACA,UACA,QACA,QACA,SACA,aACA,WACA,SACA,aACA,MACA,OACA,WACA,QACA,IACA,YACA,MACA,QACA,SACA,UACA,WACA,QACA,SACA,SACA,UACF,CACF,EACIC,GAAK,CACP,OAAU,CAAC,4EAA6E,eAAgB,+DAAgE,uCAAwC,8CAA+C,6CAA8C,gEAAiE,iCAAkC,uCAAwC,sCAAsC,EAC9d,MAAS,CACP,iCACA,wCACA,qBACA,yDACA,iCACA,oDACA,yDACA,mDACA,yDACA,uCACA,yDACA,uCACA,2BACA,uCACA,wCACA,2EACA,eACA,iCACA,2EACA,yDACA,qBACA,yGACA,uCACA,6CACA,mDACA,qEACA,mDACA,iCACA,qBACA,2BACA,+DACA,+DACA,eACA,iCACA,uCACA,qBACA,6CACA,mDACA,mDACA,mGACA,iCACA,iCACA,6CACA,2BACA,yDACA,6CACA,6CACA,uCACA,iCACA,QACA,QACA,uCACA,iCACA,6CACA,qBACA,+DACA,6CACA,6CACA,2EACA,SACA,2BACA,6CACA,iCACA,uCACA,6CACA,mDACA,uCACA,6CACA,eACA,iCACA,qBACA,iCACA,2BACA,iCACA,eACA,uCACA,2BACA,iCACA,yDACA,2BACA,yDACA,6CACA,eACA,2BACA,mDACA,uCACA,qEACA,uCACA,6CACA,yDACA,qBACA,uCACA,yDACA,uCACA,iCACA,uCACA,uCACA,6CACA,uCACA,yDACA,yDACA,6CACA,6CACA,2EACA,uCACA,mDACA,mDACA,2EACA,uCACA,mDACA,qBACA,2BACA,yDACA,2BACA,2BACA,uCACA,mDACA,mDACA,qBACA,2EACA,2BACA,qBACA,uFACA,yDACA,qBACA,2EACA,qBACA,2BACA,mDACA,qBACA,yDACA,qEACA,eACA,iCACA,2BACA,+DACA,uCACA,2EACA,mDACA,qBACA,yDACA,2BACA,2BACA,uCACA,qBACA,2EACA,mDACA,qEACA,yDACA,6CACA,yDACA,uCACA,iCACA,+DACA,2BACA,yDACA,6CACA,2EACA,iCACA,iCACA,iCACA,mDACA,2BACA,+DACA,eACA,iCACA,qBACA,eACA,qBACA,oBACF,CACF,EACIC,GAAK,CACP,OAAU,CAAC,QAAS,MAAO,QAAS,SAAU,KAAM,QAAS,QAAS,IAAI,EAC1E,MAAS,CACP,YACA,cACA,cACA,UACA,UACA,WACA,QACA,UACA,YACA,QACA,WACA,aACA,eACA,OACA,eACA,OACA,OACA,YACA,OACA,SACA,SACA,KACA,OACA,WACA,YACA,eACA,YACA,QACA,YACA,gBACA,OACA,WACA,SACA,UACA,SACA,OACA,QACA,UACA,OACA,YACA,QACA,SACA,aACA,QACA,MACA,KACA,IACA,aACA,eACA,WACA,WACA,cACA,YACA,WACA,WACA,WACA,OACA,WACA,kBACA,QACA,iBACA,aACA,aACA,aACA,YACA,UACA,YACA,YACA,YACA,QACA,YACA,UACA,QACA,eACA,QACA,aACA,SACA,MACA,QACA,WACA,QACA,aACA,QACA,UACA,cACA,cACA,QACA,UACA,cACA,YACA,UACA,aACA,QACA,WACA,aACA,SACA,QACA,eACA,YACA,YACA,gBACA,UACA,UACA,SACA,YACA,cACA,WACA,YACA,eACA,gBACA,OACA,WACA,QACA,QACA,IACA,UACA,YACA,WACA,OACA,gBACA,SACA,WACA,iBACA,WACA,aACA,OACA,gBACA,eACA,QACA,IACA,WACA,QACA,QACA,SACA,YACA,aACA,OACA,YACA,SACA,KACA,cACA,MACA,MACA,eACA,aACA,SACA,YACA,QACA,WACA,UACA,YACA,QACA,WACA,YACA,eACA,SACA,cACA,SACA,aACA,YACA,MACA,aACA,UACA,WACA,UACA,cACA,a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P,IAAO,oBACP,GAAM,aACN,cAAe,iBACf,GAAM,gBACN,GAAM,eACN,IAAO,kBACP,KAAQ,yBACR,IAAO,qBACP,KAAQ,4BACR,GAAM,8BACN,IAAO,0BACP,KAAQ,oBACR,KAAQ,sBACR,MAAS,0BACT,GAAM,mBACN,GAAM,sBACN,IAAO,uBACP,WAAY,uBACZ,IAAO,WACP,IAAO,cACP,IAAO,4BACP,KAAQ,eACR,IAAO,oBACP,IAAO,mDACP,KAAQ,+BACR,MAAS,4BACT,KAAQ,mCACR,KAAQ,yBACR,OAAU,oCACV,IAAO;AAAA,IACP,MAAO,0CACT,EACIC,GAAc,CAChB,MAAO,gBACT,EACIC,GAAY,CACd,KAAQ,KACR,OAAU,QACV,QAAW,QACX,YAAe,IACf,QAAW;AAAA,CACb,EACA,IAAMC,GAAkB,CACtB,OAAQ,OACR,WAAY,KACd,EAuGMC,GAAkB,CACtB,KAAM,SACN,OAAQ,OACR,UAAAF,GACA,SAAU,CAAC,EACX,QA3GuB,CACvB,eAAkB,CAChB,IACA,OACA,UACA,SACA,IACA,WACA,MACA,MACA,KACA,SACA,OACA,OACA,MACA,MACA,KACA,OACA,IACA,SACA,MACA,QACA,MACA,MACA,QACA,MACA,SACA,IACA,IACA,OACA,SACA,QACA,OACA,SACA,SACA,MACA,MACA,WACA,KACA,IACA,KACF,EACA,gBAAiB,IACjB,oBAAqB,GACrB,iBAAkB;AAAA,EAClB,iBAAkB,GAClB,uBAAwB,GACxB,yBAA0B,SAC1B,gBAAiB,GACjB,wBAAyB,GACzB,oBAAqB,CAAC,MAAM,EAC5B,qBAAsB,CAAC,MAAM,EAC7B,qBAAsB,EACtB,wBAAyB,GACzB,2BAA4B,CAC1B,kBACA,WACA,QACA,YACA,WACA,UACA,WACA,QACA,WACA,iBACA,SACA,QACA,OACA,WACA,QACA,aACA,WACA,WACA,WACA,WACA,eACF,EACA,2BAA4B,GAC5B,0BAA2B,OAC3B,eAAgB,CAACzkG,EAAO63F,IAAgBA,EAC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MhB,EAAU,KAAK,KAAM,GAAIA,EAAU,KAAK,GAAI,OAAQtK,CAAK,CAAE,CAAC,CAAC,CACxG,MACE,QAAQ,IAAI,8CAA8C,CAE9D,OAASy3G,EAAO,CACd,QAAQ,MAAM,wBAAyBA,CAAK,CAC9C,CACF,EAGMF,GAAYtkE,GAAU,CAC1B,GAAM,CAAE,MAAA3nC,EAAO,SAAAs7B,CAAS,EAAIqM,EACtB,CAAE,IAAA/rC,CAAI,EAAIoE,EACVhB,EAAY,CAAE,OAAQ,EAAG,KAAMpD,EAAI,MAAO,EAChD0/B,EAASt7B,EAAM,OAAO,CAAE,UAAAhB,CAAU,CAAC,CAAC,CACtC,EAGA,OAAO,YAAcssG,GACrB,OAAO,gBAAkBO,GACzB,OAAO,WAAan8C,GACpB,OAAO,WAAaC,GACpB,OAAO,SAAW+B,GAClB,OAAO,KAAOzK,GACd,OAAO,KAAOC,GACd,OAAO,gBAAkBqN,GACzB,OAAO,cAAgBhQ,GACvB,OAAO,QAAUvE,GACjB,OAAO,UAAYC,GACnB,OAAO,aAAe6rD,GACtB,OAAO,cAAgBC,GACvB,OAAO,UAAYC,GACnB,OAAO,UAAYC,GACnB,OAAO,oBAAsBf,EAEhC,GAAG", + "sourcesContent": ["// Function for reactive state management\nfunction onChange(target, callback, path = []) {\n function createProxy(target, path) {\n if (typeof target !== 'object' || target === null) {\n return target;\n }\n\n return new Proxy(target, {\n set(obj, property, value) {\n const fullPath = [...path, property];\n const oldValue = obj[property];\n const result = Reflect.set(obj, property, createProxy(value, fullPath));\n\n if (oldValue !== value) {\n callback(fullPath, oldValue, value);\n }\n\n return result;\n },\n get(obj, property) {\n const value = obj[property];\n if (typeof value === 'object' && value !== null) {\n return createProxy(value, [...path, property]);\n }\n return value;\n }\n });\n }\n\n return createProxy(target, path);\n}\n\n// Keep project and data in the global scope\nlet app = {\n name: 'kodeWeave',\n author: {\n name: 'Michael Schwartz',\n href: 'https://michaelsboost.com/',\n src: 'imgs/author.jpg'\n },\n version: '1.2.3',\n url: 'https://github.com/michaelsboost/kodeWeave/',\n license: 'https://github.com/michaelsboost/kodeWeave/blob/main/LICENSE'\n}\nlet p = {\n name: \"App name\",\n version: \"0.0.1\",\n title: \"An attractive title\",\n description: \"The most attractive description ever!\",\n author: \"kodeWeave\",\n url: \"https://michaelsboost.com/\",\n meta: \"\",\n libraries: [],\n html_pre_processor: \"html\",\n css_pre_processor: \"css\",\n javascript_pre_processor: \"javascript\",\n html: ``,\n css: ``,\n javascript: ``,\n logo: \"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+CjxzdmcKICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIgogICB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiCiAgIHhtbG5zOnN2Zz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciCiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiCiAgIHZpZXdCb3g9IjAgMCA1MTEuOTk5OTkgNTExLjk5OTk5IgogICBoZWlnaHQ9IjUxMiIKICAgd2lkdGg9IjUxMiIKICAgdmVyc2lvbj0iMS4xIgogICBpZD0ic3ZnNDE5MCI+CiAgPG1ldGFkYXRhCiAgICAgaWQ9Im1ldGFkYXRhNDE5NiI+CiAgICA8cmRmOlJERj4KICAgICAgPGNjOldvcmsKICAgICAgICAgcmRmOmFib3V0PSIiPgogICAgICAgIDxkYzpmb3JtYXQ+aW1hZ2Uvc3ZnK3htbDwvZGM6Zm9ybWF0PgogICAgICAgIDxkYzp0eXBl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zNCAtMi45NDE1NCwtMC41NTIwMSAtMy45NzUxOSwtMC4yNDY3ODggLTUuOTE3NjYsMS43NDIyMDEgLTEuMjk1NjQsMS4zMjY2NDggLTIwLjM1MDEyLDMyLjM0ODMwMyAtNDIuMzQwNDgsNjguOTM1NzIzIC0yMS45OTAzNiwzNi41ODc0IC00MS4wNjUzOSw2Ny45OTE2NyAtNDIuMzg2NjUsNjkuNzg3MDIgLTIuNjE5NTQsMy41NTkzNyAtNi43MzI4MSw2LjA5MzA2IC04LjczNDYzLDUuMzc4MzggLTAuOTk5NDcsLTAuMzU2ODMgLTEuMjY2NjUsLTE4LjE3MDM1IC0xLjI2NjY1LC04NC40NDM5NCAwLC00OS41MTMxOTYgLTAuMzc4NjQsLTg0LjIxOTIyNiAtMC45MjM2LC04NC41NTYxMzggLTAuMTE5ODQsLTAuMDc0MSAtMC41MzYwMSwtMC4xMDI0NDYgLTEuMTg3NDgsLTAuMDkyMzggeiIKICAgICAgIGlkPSJwYXRoNDI2MCIgLz4KICA8L2c+Cjwvc3ZnPgo=\",\n console: false,\n dark: true,\n previewDark: true,\n module: true,\n autorun: true,\n pwa: false,\n preview: true,\n activePanel: 'html',\n columns: false,\n columnsRight: true\n};\nlet d = {\n searchLibKey: null,\n librarySuggestions: null,\n iframeSize: null,\n selectedSize: 'none',\n compiledJSX: null,\n menuDialog: null,\n settings: null,\n libraries: null,\n demos: null,\n chosenFramework: '',\n frameworks: {\n 'alpine.js': {\n libraries: [\n \"https://cdn.jsdelivr.net/npm/alpinejs@3.14.1/dist/cdn.min.js\"\n ],\n meta: ''\n },\n 'algolia.js': {\n libraries: [\n \"https://cdn.jsdelivr.net/npm/algoliasearch@4.17.0/dist/algoliasearch.umd.js\"\n ],\n meta: ''\n },\n 'angular': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/rxjs/6.6.3/rxjs.umd.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/core-js/2.5.7/core.js\",\n \"https://unpkg.com/@angular/core@11.0.5/bundles/core.umd.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.10.3/zone.min.js\",\n \"https://unpkg.com/@angular/common@11.0.5/bundles/common.umd.js\",\n \"https://unpkg.com/@angular/compiler@11.0.5/bundles/compiler.umd.js\",\n \"https://unpkg.com/@angular/platform-browser@11.0.5/bundles/platform-browser.umd.js\",\n \"https://unpkg.com/@angular/platform-browser-dynamic@11.0.5/bundles/platform-browser-dynamic.umd.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ],\n meta: ''\n },\n 'animate.css': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css\"\n ],\n meta: ''\n },\n 'anime js': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js\"\n ],\n meta: ''\n },\n 'aos': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/aos/2.3.4/aos.css\",\n \"https://cdnjs.cloudflare.com/ajax/libs/aos/2.3.4/aos.js\"\n ],\n meta: ''\n },\n 'apex charts js': {\n libraries: [\n \"https://cdn.jsdelivr.net/npm/apexcharts@3.40.0/dist/apexcharts.min.css\",\n \"https://cdn.jsdelivr.net/npm/apexcharts@3.40.0/dist/apexcharts.min.js\"\n ],\n meta: ''\n },\n 'aurelia': {\n libraries: [],\n meta: '<script src=\"https://cdn.jsdelivr.net/npm/aurelia-script@1.4.0\"></script>'\n },\n 'barba.js': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/barba.js/2.9.7/barba.min.js\"\n ],\n meta: ''\n },\n 'bootstrap 5': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/css/bootstrap.min.css\",\n \"https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/js/bootstrap.bundle.min.js\"\n ],\n meta: ''\n },\n 'bulm css': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.4/css/bulma.min.css\",\n \"https://cdn.jsdelivr.net/npm/bulma-extensions@6.2.7/css/bulma-extensions.min.css\",\n \"https://cdn.jsdelivr.net/npm/bulma-extensions@6.2.7/js/bulma-extensions.min.js\"\n ],\n meta: ''\n },\n 'chakra-ui': {\n libraries: [\n \"https://cdn.jsdelivr.net/npm/@chakra-ui/react@2.0.0/dist/chakra-ui.min.css\"\n ],\n meta: ''\n },\n 'chart js': {\n libraries: [\n \"https://cdn.jsdelivr.net/npm/chart.js\"\n ],\n meta: ''\n },\n 'chartist': {\n libraries: [\n \"https://cdn.jsdelivr.net/chartist.js/latest/chartist.min.css\",\n \"https://cdn.jsdelivr.net/chartist.js/latest/chartist.min.js\"\n ],\n meta: ''\n },\n 'd3': {\n libraries: [\n \"https://d3js.org/d3.v7.min.js\"\n ],\n meta: ''\n },\n 'dojo': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/dojo/1.17.3/dojo.js\"\n ],\n meta: ''\n },\n 'echarts': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/echarts/5.3.3/echarts.min.js\"\n ],\n meta: ''\n },\n 'file-saver': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js\"\n ],\n meta: ''\n },\n 'foundation': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/foundation/6.6.3/css/foundation.min.css\",\n \"https://cdnjs.cloudflare.com/ajax/libs/foundation/6.6.3/js/foundation.min.js\"\n ],\n meta: ''\n },\n 'fullpage.js': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/4.0.11/fullpage.min.css\",\n \"https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/4.0.11/fullpage.min.js\"\n ],\n meta: ''\n },\n 'granim': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/granim/2.0.0/granim.min.js\"\n ],\n meta: ''\n },\n 'google charts': {\n libraries: [\n \"https://cdn.jsdelivr.net/npm/google-charts@2.0.0/dist/googleCharts.min.js\"\n ],\n meta: ''\n },\n 'gsap': {\n libraries: [\n \"https://unpkg.com/gsap@3/dist/gsap.min.js\"\n ],\n meta: ''\n },\n 'half moon': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/Halfmoon/1.0.4/css/halfmoon.min.css\",\n \"https://cdnjs.cloudflare.com/ajax/libs/Halfmoon/1.0.4/js/halfmoon.min.js\"\n ],\n meta: ''\n },\n 'hint css': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/hint.css/3.0.0/hint.min.css\"\n ],\n meta: ''\n },\n 'hyperapp': {\n libraries: [],\n meta: '<script src=\"https://unpkg.com/hyperapp@0.16.0\"></script>'\n },\n 'jquery': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js\"\n ],\n meta: ''\n },\n 'jszip': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js\"\n ],\n meta: ''\n },\n 'knockout.js': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/knockout/3.5.1/knockout-latest.js\"\n ],\n meta: ''\n },\n 'leaflet': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/leaflet.js\"\n ],\n meta: ''\n },\n 'locomotive-scroll': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/locomotive-scroll/4.1.4/locomotive-scroll.min.css\",\n \"https://cdnjs.cloudflare.com/ajax/libs/locomotive-scroll/4.1.4/locomotive-scroll.min.js\"\n ],\n meta: ''\n },\n 'lodash': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js\"\n ],\n meta: ''\n },\n 'masonry js': {\n libraries: [\n \"https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.min.js\"\n ],\n meta: ''\n },\n 'materialize': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css\",\n \"https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js\"\n ],\n meta: ''\n },\n 'milligram css': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/milligram/1.4.1/milligram.min.css\"\n ],\n meta: ''\n },\n 'mithril': {\n libraries: [\n \"https://cdn.jsdelivr.net/npm/mithril@2.0.4/mithril.min.js\"\n ],\n meta: ''\n },\n 'moment js': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment.min.js\"\n ],\n meta: ''\n },\n 'moon.js': {\n libraries: [],\n meta: '<script src=\"https://unpkg.com/moonjs\"></script>'\n },\n 'pattern css': {\n libraries: [\n \"https://unpkg.com/pattern.css@1.0.0/dist/pattern.min.css\"\n ],\n meta: ''\n },\n 'pico.css': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ],\n meta: ''\n },\n 'preact': {\n libraries: [\n \"https://unpkg.com/preact@latest/dist/preact.min.js\"\n ],\n meta: ''\n },\n 'primer css': {\n libraries: [\n \"https://unpkg.com/@primer/css@^20.2.4/dist/primer.css\"\n ],\n meta: ''\n },\n 'popper js': {\n libraries: [\n \"https://unpkg.com/@popperjs/core@2.11.7/dist/umd/popper.min.js\"\n ],\n meta: ''\n },\n 'pure.css': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/pure/2.0.6/pure-min.css\"\n ],\n meta: ''\n },\n 'raisin css': {\n libraries: [\n \"https://cdn.jsdelivr.net/gh/tretapey/raisincss@1.1.1/raisin.min.css\"\n ],\n meta: ''\n },\n 'raphael js': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/raphael/2.3.0/raphael.min.js\"\n ],\n meta: ''\n },\n 'react js': {\n libraries: [\n \"https://unpkg.com/react@latest/umd/react.development.js\",\n \"https://unpkg.com/react-dom@latest/umd/react-dom.development.js\"\n ],\n meta: ''\n },\n 'semantic ui': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.2/semantic.min.css\",\n \"https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.4.2/semantic.min.js\"\n ],\n meta: ''\n },\n 'skeleton css': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.min.css\"\n ],\n meta: ''\n },\n 'spectre.css': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/spectre.css/0.5.9/spectre.min.css\"\n ],\n meta: ''\n },\n 'stimulus': {\n libraries: [\n \"https://cdn.jsdelivr.net/npm/@hotwired/stimulus@3.1.0/dist/stimulus.umd.js\",\n \"https://cdn.jsdelivr.net/npm/@hotwired/stimulus-loading@1.0.0/dist/stimulus-loading.umd.js\"\n ],\n meta: ''\n },\n 'swiper': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/Swiper/9.1.2/swiper-bundle.min.css\",\n \"https://cdnjs.cloudflare.com/ajax/libs/Swiper/9.1.2/swiper-bundle.min.js\"\n ],\n meta: ''\n },\n 'tachyons': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/tachyons/4.12.0/tachyons.min.css\"\n ],\n meta: ''\n },\n 'tailwind css': {\n libraries: [\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ],\n meta: ''\n },\n 'three.js': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/three.js/r148/three.min.js\"\n ],\n meta: ''\n },\n 'tippy js': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/tippy.js/6.3.7/tippy-bundle.umd.min.js\"\n ],\n meta: ''\n },\n 'uikit': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/uikit/3.17.2/css/uikit.min.css\",\n \"https://cdnjs.cloudflare.com/ajax/libs/uikit/3.17.2/js/uikit.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/uikit/3.17.2/js/uikit-icons.min.js\"\n ],\n meta: ''\n },\n 'vivus': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/vivus/0.4.6/vivus.min.js\"\n ],\n meta: ''\n },\n 'vite': {\n libraries: [\n \"https://unpkg.com/vite@latest/dist/vite.min.js\"\n ],\n meta: ''\n },\n 'vue js': {\n libraries: [\n \"https://unpkg.com/vue@latest/dist/vue.global.prod.js\"\n ],\n meta: ''\n },\n 'water.css': {\n libraries: [\n \"https://cdnjs.cloudflare.com/ajax/libs/water.css/2.1.1/water.min.css\"\n ],\n meta: ''\n }\n }\n};\nconst icons = (function() {\n const SidebarIconCSS = \"h-4 w-4\";\n const navIconCSS = \"h-3 w-3\";\n const modalIconCSS = \"h-4 w-4\";\n const panelIconCSS = \"h-3 w-3\";\n const previewIconCSS = \"h-3 -mt-1\";\n\n return {\n logo: `<svg\n class=\"${SidebarIconCSS}\" \n xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n xmlns:cc=\"http://creativecommons.org/ns#\"\n xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n xmlns:svg=\"http://www.w3.org/2000/svg\"\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 0 511.99999 511.99999\"\n height=\"512\"\n width=\"512\"\n version=\"1.1\"\n id=\"svg4190\">\n <metadata\n id=\"metadata4196\">\n <rdf:RDF>\n <cc:Work\n rdf:about=\"\">\n <dc:format>image/svg+xml</dc:format>\n <dc:type\n rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\" />\n <dc:title></dc:title>\n </cc:Work>\n </rdf:RDF>\n </metadata>\n <defs\n id=\"defs4194\">\n <linearGradient\n id=\"linearGradient4276\">\n <stop\n id=\"stop4278\"\n offset=\"0\"\n style=\"stop-color:#fd5d92;stop-opacity:1\" />\n <stop\n id=\"stop4280\"\n offset=\"1\"\n style=\"stop-color:#ff0000;stop-opacity:1\" />\n </linearGradient>\n <linearGradient\n gradientUnits=\"userSpaceOnUse\"\n y2=\"257.3125\"\n x2=\"0.13404165\"\n y1=\"257.3125\"\n x1=\"511.71875\"\n id=\"linearGradient4282\"\n xlink:href=\"#linearGradient4276\" />\n </defs>\n <g\n id=\"g4284\">\n <circle\n style=\"opacity:1;fill:url(#linearGradient4282);fill-opacity:1;stroke:none;stroke-width:12;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:72, 72;stroke-dashoffset:0;stroke-opacity:1\"\n id=\"path4270\"\n cx=\"256\"\n cy=\"256\"\n r=\"256\" />\n <path\n style=\"opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:12;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:72, 72;stroke-dashoffset:0;stroke-opacity:1\"\n d=\"m 251.06068,58.678272 c -4.56032,0.07035 -20.76061,2.041945 -29.29792,3.655984 -28.34391,5.35862 -66.88081,22.619814 -73.03699,32.719061 -1.89755,3.112935 -1.94616,7.147013 -1.94616,160.817023 0,152.2588 0.0671,157.72464 1.89998,160.73121 5.20599,8.53989 36.72003,23.70934 63.45133,30.54134 9.76572,2.49593 34.33509,6.3448 38.50754,6.03169 2.00388,-0.15036 2.03203,-0.97469 2.28921,-73.09324 0.14558,-40.83759 0.65643,-73.33414 1.16109,-73.83896 1.37751,-1.37795 7.34739,1.88473 10.35752,5.66215 1.46202,1.83468 13.79755,20.65528 27.41774,41.81943 51.44452,79.93847 50.46511,78.47798 53.30494,79.19094 3.32478,0.83474 12.56708,-3.78947 27.57606,-13.78583 14.24338,-9.48646 23.8855,-17.7831 34.81972,-29.96717 11.29502,-12.58615 14.83039,-17.41785 14.83039,-20.25308 0,-1.22009 -14.9706,-24.54033 -33.40133,-52.02846 -18.37057,-27.39837 -34.10107,-51.16876 -34.95828,-52.82696 -0.85723,-1.6582 -1.55693,-4.07335 -1.55693,-5.36519 0,-1.32123 12.48959,-22.29487 28.54584,-47.94352 44.48315,-71.05856 41.93833,-66.29178 38.83081,-72.84247 -2.55755,-5.39136 -15.36262,-19.65809 -26.13129,-29.11587 -11.45459,-10.060191 -35.06413,-25.950276 -39.90612,-26.858934 -2.94154,-0.55201 -3.97519,-0.246788 -5.91766,1.742201 -1.29564,1.326648 -20.35012,32.348303 -42.34048,68.935723 -21.99036,36.5874 -41.06539,67.99167 -42.38665,69.78702 -2.61954,3.55937 -6.73281,6.09306 -8.73463,5.37838 -0.99947,-0.35683 -1.26665,-18.17035 -1.26665,-84.44394 0,-49.513196 -0.37864,-84.219226 -0.9236,-84.556138 -0.11984,-0.0741 -0.53601,-0.102446 -1.18748,-0.09238 z\"\n id=\"path4260\" />\n </g>\n </svg>`,\n twitterfill: `<svg class=\"${SidebarIconCSS}\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path d=\"M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z\"/>\n </svg>`,\n twitter: `<svg class=\"${SidebarIconCSS}\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <defs\n id=\"defs2\"><clipPath\n clipPathUnits=\"userSpaceOnUse\"\n id=\"clipPath7\"><path\n style=\"display:none;fill:#2a34ff;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1\"\n d=\"M 2.7194315,3.6106111 H 8.5920036 L 21.280954,20.389389 h -5.727371 z\"\n id=\"path7\" /><path\n id=\"lpe_path-effect7\"\n style=\"fill:#2a34ff;fill-opacity:1;stroke:none;stroke-width:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1\"\n class=\"powerclip\"\n d=\"M -2.8448815,-3.9722732 H 26.113213 V 27.972273 H -2.8448815 Z M 2.7194315,3.6106111 15.553583,20.389389 h 5.727371 L 8.5920036,3.6106111 Z\" /></clipPath><clipPath\n clipPathUnits=\"userSpaceOnUse\"\n id=\"clipPath11\"><rect\n style=\"fill:#ff2a2a;fill-opacity:1;stroke:none;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1\"\n id=\"rect11\"\n width=\"21.586601\"\n height=\"18.278778\"\n x=\"1.2021173\"\n y=\"2.8606112\" /></clipPath></defs><g\n style=\"fill:none;stroke:currentColor;stroke-width:1.5\"\n id=\"g2\"\n transform=\"translate(-0.04613684)\"><g\n id=\"g8\"\n clip-path=\"url(#clipPath11)\"><path\n d=\"M 2.7194315,3.6106111 H 8.5920036 L 21.280954,20.389389 h -5.727371 z\"\n id=\"path2-8\" /><path\n d=\"M 20.541589,1.5132639 19.650846,2.5619375 18.760104,3.6106111 17.869362,4.6592848 16.978619,5.7079584 16.087877,6.756632 15.197135,7.8053056 14.306392,8.8539793 13.41565,9.9026529 12.524908,10.951326 11.634165,12 10.743423,13.048674 9.852681,14.097347 8.961938,15.146021 8.071196,16.194695 7.1804539,17.243368 6.2897116,18.292042 5.3989693,19.340715 4.5082269,20.389389 3.6174846,21.438063 2.7267423,22.486736\"\n id=\"path4\"\n clip-path=\"url(#clipPath7)\" /></g></g>\n </svg>`,\n heart: `<svg class=\"w-3\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path d=\"M47.6 300.4L228.3 469.1c7.5 7 17.4 10.9 27.7 10.9s20.2-3.9 27.7-10.9L464.4 300.4c30.4-28.3 47.6-68 47.6-109.5v-5.8c0-69.9-50.5-129.5-119.4-141C347 36.5 300.6 51.4 268 84L256 96 244 84c-32.6-32.6-79-47.5-124.6-39.9C50.5 55.6 0 115.2 0 185.1v5.8c0 41.5 17.2 81.2 47.6 109.5z\" />\n </svg>`,\n html: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" viewBox=\"0 0 384 512\">\n <path \n d=\"M0 32l34.9 395.8L191.5 480l157.6-52.2L384 32H0zm308.2 127.9H124.4l4.1 49.4h175.6l-13.6 148.4-97.9 27v.3h-1.1l-98.7-27.3-6-75.8h47.7L138 320l53.5 14.5 53.7-14.5 6-62.2H84.3L71.5 112.2h241.1l-4.4 47.7z\"/>\n </svg>`,\n css: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" viewBox=\"0 0 512 512\">\n <path \n d=\"M480 32l-64 368-223.3 80L0 400l19.6-94.8h82l-8 40.6L210 390.2l134.1-44.4 18.8-97.1H29.5l16-82h333.7l10.5-52.7H56.3l16.3-82H480z\"/>\n </svg>`,\n javascript: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"currentColor\" viewBox=\"0 0 448 512\">\n <path \n d=\"M0 32v448h448V32H0zm243.8 349.4c0 43.6-25.6 63.5-62.9 63.5-33.7 0-53.2-17.4-63.2-38.5l34.3-20.7c6.6 11.7 12.6 21.6 27.1 21.6 13.8 0 22.6-5.4 22.6-26.5V237.7h42.1v143.7zm99.6 63.5c-39.1 0-64.4-18.6-76.7-43l34.3-19.8c9 14.7 20.8 25.6 41.5 25.6 17.4 0 28.6-8.7 28.6-20.8 0-14.4-11.4-19.5-30.7-28l-10.5-4.5c-30.4-12.9-50.5-29.2-50.5-63.5 0-31.6 24.1-55.6 61.6-55.6 26.8 0 46 9.3 59.8 33.7L368 290c-7.2-12.9-15-18-27.1-18-12.3 0-20.1 7.8-20.1 18 0 12.6 7.8 17.7 25.9 25.6l10.5 4.5c35.8 15.3 55.9 31 55.9 66.2 0 37.8-29.8 58.6-69.7 58.6z\"/>\n </svg>`,\n columns: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 4.5v15m6-15v15m-10.875 0h15.75c.621 0 1.125-.504 1.125-1.125V5.625c0-.621-.504-1.125-1.125-1.125H4.125C3.504 4.5 3 5.004 3 5.625v12.75c0 .621.504 1.125 1.125 1.125Z\" />\n </svg>`,\n leftChev: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15.75 19.5 8.25 12l7.5-7.5\" />\n </svg>`,\n rightChev: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m8.25 4.5 7.5 7.5-7.5 7.5\" />\n </svg>`,\n console: `<svg class=\"${SidebarIconCSS}\" fill=\"none\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"1.5\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n <path d=\"m 12,18.340203 h 8.757019\" />\n <path d=\"M 3.3316546,18.340203 10.159567,11.778315 3.2429806,5.6597968\" />\n </svg>`,\n sun: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z\" />\n </svg>`,\n moon: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z\" />\n </svg>`,\n play: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z\" />\n </svg>`,\n camera: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6.827 6.175A2.31 2.31 0 0 1 5.186 7.23c-.38.054-.757.112-1.134.175C2.999 7.58 2.25 8.507 2.25 9.574V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9.574c0-1.067-.75-1.994-1.802-2.169a47.865 47.865 0 0 0-1.134-.175 2.31 2.31 0 0 1-1.64-1.055l-.822-1.316a2.192 2.192 0 0 0-1.736-1.039 48.774 48.774 0 0 0-5.232 0 2.192 2.192 0 0 0-1.736 1.039l-.821 1.316Z\" />\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M16.5 12.75a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0ZM18.75 10.5h.008v.008h-.008V10.5Z\" />\n </svg>`,\n cog: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z\" />\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z\" />\n </svg>`,\n tidy: `<svg class=\"${previewIconCSS}\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\">\n <path d=\"M566.6 54.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192-34.7-34.7c-4.2-4.2-10-6.6-16-6.6c-12.5 0-22.6 10.1-22.6 22.6l0 29.1L364.3 320l29.1 0c12.5 0 22.6-10.1 22.6-22.6c0-6-2.4-11.8-6.6-16l-34.7-34.7 192-192zM341.1 353.4L222.6 234.9c-42.7-3.7-85.2 11.7-115.8 42.3l-8 8C76.5 307.5 64 337.7 64 369.2c0 6.8 7.1 11.2 13.2 8.2l51.1-25.5c5-2.5 9.5 4.1 5.4 7.9L7.3 473.4C2.7 477.6 0 483.6 0 489.9C0 502.1 9.9 512 22.1 512l173.3 0c38.8 0 75.9-15.4 103.4-42.8c30.6-30.6 45.9-73.1 42.3-115.8z\"/>\n </svg>`,\n rotate: `<svg class=\"${previewIconCSS}\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path d=\"M463.5 224H472c13.3 0 24-10.7 24-24V72c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8H463.5z\" />\n </svg>`,\n times: `<svg class=\"${modalIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18 18 6M6 6l12 12\" />\n </svg>`,\n file: `<svg class=\"h-3 -mt-1\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 384 512\">\n <path d=\"M0 64C0 28.7 28.7 0 64 0H224V128c0 17.7 14.3 32 32 32H384V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V64zm384 64H256V0L384 128z\" />\n </svg>`,\n import: `<svg class=\"h-3 -mt-1 transform origin-center scale-125\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path d=\"M128 64c0-35.3 28.7-64 64-64H352V128c0 17.7 14.3 32 32 32H512V448c0 35.3-28.7 64-64 64H192c-35.3 0-64-28.7-64-64V336H302.1l-39 39c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l80-80c9.4-9.4 9.4-24.6 0-33.9l-80-80c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l39 39H128V64zm0 224v48H24c-13.3 0-24-10.7-24-24s10.7-24 24-24H128zM512 128H384V0L512 128z\" />\n </svg>`,\n download: `<svg class=\"h-3 -mt-1 transform origin-center scale-125\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path d=\"M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32V274.7l-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7V32zM64 352c-35.3 0-64 28.7-64 64v32c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V416c0-35.3-28.7-64-64-64H346.5l-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352H64zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z\" />\n </svg>`,\n codepen: `<svg class=\"h-3 -mt-1 transform origin-center scale-125\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\">\n <path d=\"M502.285 159.704l-234-156c-7.987-4.915-16.511-4.96-24.571 0l-234 156C3.714 163.703 0 170.847 0 177.989v155.999c0 7.143 3.714 14.286 9.715 18.286l234 156.022c7.987 4.915 16.511 4.96 24.571 0l234-156.022c6-3.999 9.715-11.143 9.715-18.286V177.989c-.001-7.142-3.715-14.286-9.716-18.285zM278 63.131l172.286 114.858-76.857 51.429L278 165.703V63.131zm-44 0v102.572l-95.429 63.715-76.857-51.429L234 63.131zM44 219.132l55.143 36.857L44 292.846v-73.714zm190 229.715L61.714 333.989l76.857-51.429L234 346.275v102.572zm22-140.858l-77.715-52 77.715-52 77.715 52-77.715 52zm22 140.858V346.275l95.429-63.715 76.857 51.429L278 448.847zm190-156.001l-55.143-36.857L468 219.132v73.714z\" />\n </svg>`,\n trash: `<svg class=\"${panelIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0\" />\n </svg>`,\n undo: `<svg class=\"${navIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m7.49 12-3.75 3.75m0 0 3.75 3.75m-3.75-3.75h16.5V4.499\" />\n </svg>`,\n redo: `<svg class=\"${navIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m16.49 12 3.75 3.75m0 0-3.75 3.75m3.75-3.75H3.74V4.499\" />\n </svg>`,\n cut: `<svg class=\"${navIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m7.848 8.25 1.536.887M7.848 8.25a3 3 0 1 1-5.196-3 3 3 0 0 1 5.196 3Zm1.536.887a2.165 2.165 0 0 1 1.083 1.839c.005.351.054.695.14 1.024M9.384 9.137l2.077 1.199M7.848 15.75l1.536-.887m-1.536.887a3 3 0 1 1-5.196 3 3 3 0 0 1 5.196-3Zm1.536-.887a2.165 2.165 0 0 0 1.083-1.838c.005-.352.054-.695.14-1.025m-1.223 2.863 2.077-1.199m0-3.328a4.323 4.323 0 0 1 2.068-1.379l5.325-1.628a4.5 4.5 0 0 1 2.48-.044l.803.215-7.794 4.5m-2.882-1.664A4.33 4.33 0 0 0 10.607 12m3.736 0 7.794 4.5-.802.215a4.5 4.5 0 0 1-2.48-.043l-5.326-1.629a4.324 4.324 0 0 1-2.068-1.379M14.343 12l-2.882 1.664\" />\n </svg>`,\n copy: `<svg class=\"${navIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15.666 3.888A2.25 2.25 0 0 0 13.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 0 1-.75.75H9a.75.75 0 0 1-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 0 1 1.927-.184\" />\n </svg>`,\n paste: `<svg class=\"${navIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M8.25 7.5V6.108c0-1.135.845-2.098 1.976-2.192.373-.03.748-.057 1.123-.08M15.75 18H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08M15.75 18.75v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5A3.375 3.375 0 0 0 6.375 7.5H5.25m11.9-3.664A2.251 2.251 0 0 0 15 2.25h-1.5a2.251 2.251 0 0 0-2.15 1.586m5.8 0c.065.21.1.433.1.664v.75h-6V4.5c0-.231.035-.454.1-.664M6.75 7.5H4.875c-.621 0-1.125.504-1.125 1.125v12c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V16.5a9 9 0 0 0-9-9Z\" />\n </svg>`,\n indent: `<svg class=\"${navIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M17.25 8.25 21 12m0 0-3.75 3.75M21 12H3\" />\n </svg>`,\n outdent: `<svg class=\"${navIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6.75 15.75 3 12m0 0 3.75-3.75M3 12h18\" />\n </svg>`,\n search: `<svg class=\"${navIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z\" />\n </svg>`,\n goto: `<svg class=\"${navIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m5.231 13.481L15 17.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v16.5c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Zm3.75 11.625a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z\" />\n </svg>`,\n comment: `<svg class=\"${navIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M2.25 12.76c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.076-4.076a1.526 1.526 0 0 1 1.037-.443 48.282 48.282 0 0 0 5.68-.494c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z\" />\n </svg>`,\n fold: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m8.25 4.5 7.5 7.5-7.5 7.5\" />\n </svg>`,\n unfold: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"m19.5 8.25-7.5 7.5-7.5-7.5\" />\n </svg>`,\n cursor: `<svg class=\"${SidebarIconCSS}\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M15.042 21.672 13.684 16.6m0 0-2.51 2.225.569-9.47 5.227 7.917-3.286-.672ZM12 2.25V4.5m5.834.166-1.591 1.591M20.25 10.5H18M7.757 14.743l-1.59 1.59M6 10.5H3.75m4.007-4.243-1.59-1.59\" />\n </svg>`\n };\n})();\n\n// Reactive objects\nwindow.project = onChange(p, async (property, oldValue, newValue) => {\n const iframe = document.getElementById('iframe');\n const doc = iframe ? iframe.contentWindow.document : null;\n if (oldValue !== newValue) {\n localStorage.setItem('kodeWeave', JSON.stringify(project));\n App.render('#app');\n \n if (property.toString() === 'activePanel') {\n getIFrameClientSize();\n if (!window.editorManager) return;\n if (project.activePanel === 'html') setActiveEditor(editorManager.htmlEditor)\n if (project.activePanel === 'css') setActiveEditor(editorManager.cssEditor)\n if (project.activePanel === 'javascript') setActiveEditor(editorManager.javascriptEditor)\n }\n \n if (!App.initialRender) {\n let string = property.toString();\n \n if (string === 'css' || string === 'console') {\n let consoleCSS = `\n [data-zwj=zwjkonsole] {\n display: ${project.console ? 'flex' : 'none'};\n }\n \n ${project.css}`\n\n if (!window.editorManager) return;\n if (string === 'css' && editorManager.cssEditor.state.doc.toString() !== project.css) {\n dispatchChanges(editorManager.cssEditor, project.css);\n }\n if (doc.getElementById('cuxjju3ew')) {\n doc.getElementById('cuxjju3ew').textContent = consoleCSS;\n }\n }\n \n if (string === 'html') {\n renderPreview(project.autorun);\n if (!window.editorManager) return;\n if (window.editorManager.htmlEditor.state.doc.toString() !== project.html) {\n dispatchChanges(editorManager.htmlEditor, project.html);\n }\n }\n\n if (string === 'javascript') {\n renderPreview(project.autorun);\n if (!window.editorManager) return;\n if (window.editorManager.jsEditor.state.doc.toString() !== project.javascript) {\n dispatchChanges(editorManager.jsEditor, project.javascript);\n }\n }\n\n if (string === 'module' || string === 'meta' || string === 'libraries' || string === 'html_pre_processor' || string === 'css_pre_processor' || string === 'javascript_pre_processor') {\n renderPreview(project.autorun);\n }\n\n if (string === \"previewDark\") {\n if (doc) {\n doc.documentElement.setAttribute('data-theme', project.previewDark ? 'dark' : 'light');\n }\n }\n\n if (string === \"dark\") {\n App.render('#app');\n document.documentElement.setAttribute('data-theme', project.dark ? 'dark' : 'light');\n document.querySelector('meta[name=apple-mobile-web-app-status-bar-style]').setAttribute('content', project.dark ? 'black-translucent' : 'default');\n document.querySelector('meta[name=theme-color]').setAttribute('content', project.dark ? '#13171f' : '#ffffff');\n document.querySelector('meta[name=msapplication-navbutton-color]').setAttribute('content', project.dark ? '#13171f' : '#ffffff');\n }\n }\n }\n});\nwindow.data = onChange(d, (property, oldValue, newValue) => {\n // Only render if the actual value has changed\n if (oldValue !== newValue) App.render('#app');\n});\n\n// Components\nfunction LeftMenubar() {\n const buttonSize = \"w-full\";\n\n return `<ul class=\"p-0 m-0\">\n <li class=\"list-none m-0\">\n <button\n aria-label=\"toggle menu\"\n name=\"toggle menu\"\n class=\"${buttonSize} text-sm border-0 px-0 py-3 rounded-md bg-transparent\"\n style=\"color: unset;\"\n onclick=\"data.menuDialog = true\"\n >\n ${icons.logo}\n </button>\n </li>\n <li class=\"list-none m-0\">\n <a\n aria-label=\"toggle html\"\n name=\"toggle html\"\n class=\"${buttonSize} text-sm border-0 px-4 py-3 rounded-md bg-transparent\"\n style=\"color: unset;\"\n role=\"button\"\n href=\"https://twitter.com/kodeweave_app\"\n >\n ${icons.twitter}\n </a>\n </li>\n <li class=\"list-none m-0\">\n <a\n href=\"https://michaelsboost.com/donate/\"\n aria-label=\"Donation helps developer maintence\"\n target=\"_blank\"\n role=\"button\"\n class=\"${buttonSize} text-sm border-0 px-4 py-3 rounded-md bg-transparent text-red-400\"\n >\n ${icons.heart}\n </a>\n </li>\n <li class=\"list-none m-0\">\n <button \n aria-label=\"add blocks\" \n name=\"add blocks\" \n class=\"w-11 text-sm border-0 px-0 py-3 mb-2\"\n onclick=\"searchMedia()\"\n >\n ${icons.search}\n </button>\n </li>\n</ul>\n<ul class=\"p-0 m-0\">\n <li class=\"list-none m-0\">\n <hr />\n </li>\n <li class=\"list-none m-0\">\n <button\n aria-label=\"toggle html\"\n name=\"toggle html\"\n class=\"${buttonSize} text-sm border-0 px-0 py-3 rounded-md bg-transparent ${project.activePanel === 'html' ? 'text-blue-500' : ''}\"\n ${project.activePanel === 'html' ? '' : 'style=\"color: unset;\"'}\n onclick=\"setActiveEditor(htmlEditor); project.activePanel = project.activePanel === 'html' ? null : 'html';\"\n >\n ${icons.html}\n </button>\n </li>\n <li class=\"list-none m-0\">\n <button\n aria-label=\"toggle css\"\n name=\"toggle css\"\n class=\"${buttonSize} text-sm border-0 px-0 py-3 rounded-md bg-transparent ${project.activePanel === 'css' ? 'text-blue-500' : ''}\"\n ${project.activePanel === 'css' ? '' : 'style=\"color: unset;\"'}\n onclick=\"setActiveEditor(cssEditor); project.activePanel = project.activePanel === 'css' ? null : 'css';\"\n >\n ${icons.css}\n </button>\n </li>\n <li class=\"list-none m-0\">\n <button\n aria-label=\"toggle javascript\"\n name=\"toggle javascript\"\n class=\"${buttonSize} text-sm border-0 px-0 py-3 rounded-md bg-transparent ${project.activePanel === 'javascript' ? 'text-blue-500' : ''}\"\n ${project.activePanel === 'javascript' ? '' : 'style=\"color: unset;\"'}\n onclick=\"setActiveEditor(jsEditor); project.activePanel = project.activePanel === 'javascript' ? null : 'javascript';\"\n >\n ${icons.javascript}\n </button>\n </li>\n <li class=\"list-none m-0\">\n <hr />\n </li>\n</ul>\n<ul class=\"p-0 m-0\">\n <li class=\"list-none m-0\">\n <button\n aria-label=\"toggle theme\"\n name=\"toggle theme\"\n class=\"${buttonSize} text-sm border-0 px-0 py-3 rounded-md bg-transparent\"\n style=\"color: unset;\"\n onclick=\"project.previewDark = !project.previewDark;\"\n >\n ${project.previewDark ? icons.sun : icons.moon}\n </button>\n </li>\n <li class=\"list-none m-0\">\n <button\n aria-label=\"toggle preview\"\n name=\"toggle preview\"\n class=\"${buttonSize} text-sm border-0 px-0 py-3 rounded-md bg-transparent ${project.preview ? 'text-blue-500' : ''}\"\n onclick=\"project.preview = !project.preview\"\n >\n ${icons.play}\n </button>\n </li>\n <li class=\"list-none m-0\">\n <button\n aria-label=\"toggle console\"\n name=\"toggle console\"\n class=\"${buttonSize} text-sm border-0 px-0 py-3 rounded-md bg-transparent ${project.console ? 'text-green-500' : ''}\"\n onclick=\"project.console = !project.console;\"\n style=\"${project.dark ? '' : `${project.console ? '' : 'color: unset;'}`}\"\n >\n ${icons.console}\n </button>\n </li>\n <li class=\"list-none m-0\">\n <button\n aria-label=\"full page screenshot\"\n name=\"full page screenshot\"\n class=\"${buttonSize} text-sm border-0 px-0 py-3 rounded-md bg-transparent\"\n style=\"color: unset;\"\n onclick=\"screenshot()\"\n >\n ${icons.camera}\n </button>\n </li>\n <li class=\"list-none m-0\">\n <button\n aria-label=\"settings button\"\n name=\"settings\"\n class=\"${buttonSize} text-sm border-0 px-4 py-3 rounded-md bg-transparent -mt-1\"\n style=\"color: unset;\"\n onclick=\"data.settings = !data.settings\"\n >\n ${icons.cog}\n </button>\n </li>\n</ul>`;\n}\nfunction PreviewMenu() {\n const buttonClass = 'border-0 bg-transparent text-sm';\n const selectClass = 'mx-0 my-2 w-auto rounded-md capitalize text-[.6rem]';\n const selectStyle = 'padding: 0.5rem;';\n\n const sizeOptions = {\n Phones: {\n '320x480': 'iPhone 3GS',\n '375x667': 'iPhone 6/7/8',\n '414x736': 'iPhone 6/7/8 Plus',\n '375x812': 'iPhone X/XS/11 Pro',\n '414x896': 'iPhone XR/XS Max/11/11 Pro Max',\n '360x640': 'Samsung Galaxy S5',\n '360x740': 'Samsung Galaxy S8+',\n '1440x3200': 'Samsung Galaxy S21 Ultra',\n '1080x2340': 'Google Pixel 5',\n '1080x2400': 'OnePlus 8 Pro',\n '1440x3200': 'Xiaomi Mi 11 Ultra',\n '1644x3840': 'Sony Xperia 1 III'\n },\n Tablets: {\n '2048x2732': 'iPad Pro 12.9\" (3rd/4th Gen)',\n '2388x1668': 'iPad Pro 11\" (1st/2nd/3rd Gen)',\n '2736x1824': 'Microsoft Surface Pro 7',\n '2800x1752': 'Samsung Galaxy Tab S7+',\n '2560x1600': 'Huawei MatePad Pro',\n '2000x1200': 'Lenovo Tab P11 Pro',\n '1920x1200': 'Amazon Fire HD 10',\n '1536x2048': 'iPad Air (3rd Gen)',\n '1620x2160': 'iPad Air (4th Gen)',\n '1620x2160': 'iPad 10.2\" (8th Gen)',\n '1668x2224': 'iPad Pro 11\" (2021)'\n },\n Desktops: {\n '3840x2160': '4K UHD (3840x2160)',\n '2560x1440': 'WQHD (2560x1440)',\n '1920x1080': 'Full HD (1920x1080)',\n '1366x768': 'Laptop (1366x768)',\n '3440x1440': 'UltraWide QHD (3440x1440)',\n '5120x2880': '5K Retina (5120x2880)',\n '1280x800': 'MacBook (1280x800)',\n '2560x1600': 'MacBook Pro (2560x1600)',\n '2880x1800': 'MacBook Pro Retina (2880x1800)'\n }\n };\n\n const previewSize = `<label for=\"selectedSize\" aria-label=\"resize canvas\" class=\"mx-2\">\n <select id=\"selectedSize\" onchange=\"resizeCanvas(this.value)\" class=\"${selectClass}\" style=\"${selectStyle}\">\n <option value=\"none\">Select Size</option>\n ${Object.keys(sizeOptions).map(group => `\n <optgroup label=\"${group}\">\n ${Object.keys(sizeOptions[group]).map(option => `\n <option value=\"${option}\">${sizeOptions[group][option]}</option>\n `).join('')}\n </optgroup>\n `).join('')}\n </select>\n </label>`;\n\n function canTidyShow() {\n if (!project.activePanel) return 'hidden'\n if (project.activePanel) {\n if (project.activePanel === 'html') {\n if (project.html_pre_processor !== 'html') {\n return 'hidden'\n }\n }\n if (project.activePanel === 'css') {\n if (project.css_pre_processor !== 'css') {\n return 'hidden'\n }\n }\n if (project.activePanel === 'javascript') {\n if (project.javascript_pre_processor !== 'javascript') {\n return 'hidden'\n }\n }\n }\n }\n\n return `<div class=\"flex justify-between items-center overflow-auto\">\n ${previewSize}\n\n <ul class=\"m-0 p-0 flex whitespace-nowrap overflow-x-auto overflow-y-hidden\">\n <li class=\"list-none\">\n <button \n aria-label=\"rotate canvas\"\n name=\"rotate canvas\" \n class=\"${buttonClass} ${data.selectedSize === 'none' ? 'hidden' : ''}\"\n style=\"color: unset;\"\n onclick=\"rotateCanvas()\">\n ${icons.rotate}\n </button>\n </li>\n <li class=\"list-none ${project.activePanel ? '' : 'hidden'}\">\n <button\n aria-label=\"change view\"\n name=\"change view\"\n class=\"${buttonClass} hidden sm:inline-block\"\n style=\"color: unset; ${project.columns ? '' : 'transform: rotate(90deg);'}\"\n onclick=\"project.columns = !project.columns;\"\n >\n ${icons.columns}\n </button>\n </li>\n <li class=\"list-none ${project.activePanel ? '' : 'hidden'}\">\n <button\n aria-label=\"toggle columns left or right\"\n name=\"toggle columns left or right\"\n class=\"${buttonClass} hidden ${project.activePanel ? `${project.columns ? '' : 'sm:inline-block'}` : ''}\"\n style=\"color: unset;\"\n onclick=\"project.columnsRight = !project.columnsRight;\"\n >\n ${project.columnsRight ? icons.leftChev : icons.rightChev}\n </button>\n </li>\n <li class=\"list-none\">\n <button \n aria-label=\"tidy code\"\n name=\"tidy code\"\n class=\"${buttonClass} ${canTidyShow()}\"\n style=\"color: unset;\"\n onclick=\"tidy()\">\n ${icons.tidy}\n </button>\n </li>\n <li class=\"list-none\">\n <button\n aria-label=\"run preview\"\n name=\"run preview\"\n class=\"${buttonClass} ${project.autorun ? 'hidden' : ''}\"\n style=\"color: unset;\"\n onclick=\"renderPreview(true)\"\n >\n ${icons.play}\n </button>\n </li>\n </ul>\n</div>`;\n}\nfunction Menu() {\n let menuDialog = `<ul class=\"py-4 px-0\">\n <li class=\"list-none\">\n <div class=\"items-center text-center\">\n <div>\n <a \n aria-label=\"project homepage\"\n name=\"project homepage\"\n target=\"_blank\" \n href=\"${app.url}\">\n <img \n alt=\"logo\"\n class=\"my-4 w-24 m-auto\"\n src=\"imgs/logo.svg\"\n loading=\"lazy\" />\n </a>\n <div class=\"text-2xl\">\n About ${app.name}\n </div>\n <div class=\"my-2 text-xs\">\n Version ${app.version}\n </div>\n <a \n target=\"_blank\" \n class=\"text-sm underline mb-2 text-blue-500\" \n href=\"${app.license}\">\n Open Source License\n </a>\n </div>\n </div>\n </li>\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <li class=\"p-0 list-none -mt-2\">\n <button \n class=\"w-full flex gap-2 text-sm capitalize border-0 p-2 rounded-md bg-transparent\" \n style=\"color: unset;\" \n onclick=\"data.menuDialog = null; data.demos = true;\">\n <svg class=\"h-5 w-5\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z\" />\n </svg>\n <span>new project</span>\n </button>\n </li>\n <li class=\"p-0 list-none\">\n <button \n class=\"w-full flex gap-2 text-sm capitalize border-0 p-2 rounded-md bg-transparent\" \n style=\"color: unset;\" \n onclick=\"data.menuDialog = null; importProject()\">\n <svg class=\"h-5 w-5\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m6.75 12-3-3m0 0-3 3m3-3v6m-1.5-15H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z\" />\n </svg>\n <span>import project</span>\n </button>\n </li>\n <li class=\"p-0 list-none\">\n <button \n class=\"w-full flex gap-2 text-sm capitalize border-0 p-2 rounded-md bg-transparent\" \n style=\"color: unset;\" \n onclick=\"data.menuDialog = null; downloadJSON()\">\n <svg class=\"h-5 w-5\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 8.25H7.5a2.25 2.25 0 0 0-2.25 2.25v9a2.25 2.25 0 0 0 2.25 2.25h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25H15M9 12l3 3m0 0 3-3m-3 3V2.25\" />\n </svg>\n <span>download json</span>\n </button>\n </li>\n <li class=\"p-0 list-none\">\n <button \n class=\"w-full flex gap-2 text-sm capitalize border-0 p-2 rounded-md bg-transparent\" \n style=\"color: unset;\" \n onclick=\"data.menuDialog = null; downloadProject()\">\n <svg class=\"h-5 w-5\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3\" />\n </svg>\n <span>download zip</span>\n </button>\n </li>\n <li class=\"p-0 list-none\">\n <button \n class=\"w-full flex gap-2 text-sm capitalize border-0 p-2 rounded-md bg-transparent\" \n style=\"color: unset;\" \n onclick=\"data.menuDialog = null; share()\">\n <svg class=\"h-5 w-5\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M7.217 10.907a2.25 2.25 0 1 0 0 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186 9.566-5.314m-9.566 7.5 9.566 5.314m0 0a2.25 2.25 0 1 0 3.935 2.186 2.25 2.25 0 0 0-3.935-2.186Zm0-12.814a2.25 2.25 0 1 0 3.933-2.185 2.25 2.25 0 0 0-3.933 2.185Z\" />\n </svg>\n <span>share to codepen</span>\n </button>\n </li>\n <li class=\"p-0 list-none\">\n <button \n aria-label=\"Empty storage saved from kodeWeave\"\n name=\"Empty storage saved from kodeWeave\"\n class=\"w-full flex gap-2 text-sm capitalize border-0 p-2 rounded-md bg-transparent\" \n style=\"color: unset;\" \n onclick=\"emptyStorage()\">\n <svg class=\"h-5 w-5\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 576 512\">\n <path d=\"M566.6 54.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192-34.7-34.7c-4.2-4.2-10-6.6-16-6.6c-12.5 0-22.6 10.1-22.6 22.6l0 29.1L364.3 320l29.1 0c12.5 0 22.6-10.1 22.6-22.6c0-6-2.4-11.8-6.6-16l-34.7-34.7 192-192zM341.1 353.4L222.6 234.9c-42.7-3.7-85.2 11.7-115.8 42.3l-8 8C76.5 307.5 64 337.7 64 369.2c0 6.8 7.1 11.2 13.2 8.2l51.1-25.5c5-2.5 9.5 4.1 5.4 7.9L7.3 473.4C2.7 477.6 0 483.6 0 489.9C0 502.1 9.9 512 22.1 512l173.3 0c38.8 0 75.9-15.4 103.4-42.8c30.6-30.6 45.9-73.1 42.3-115.8z\"/>\n </svg>\n <span>empty storage</span>\n </button>\n </li>\n </ul>`;\n menuDialog = `<dialog ${data.menuDialog ? 'open' : ''}>\n <article class=\"rounded-md\">\n <header class=\"flex justify-between items-center\">\n <h1 class=\"text-lg font-thin m-0 capitalize\">\n file menu\n </h1>\n <button \n class=\"text-xs w-auto px-3 py-2 m-0 capitalize rounded-md bg-transparent border-0\" \n style=\"color: unset;\" \n aria-label=\"Close\"\n onclick=\"data.menuDialog = null\">\n ${icons.times}\n </button>\n </header>\n <main class=\"font-thin\">\n ${menuDialog}\n </main>\n <footer>\n <button \n class=\"text-xs w-auto px-3 py-2 m-0 capitalize rounded-md bg-transparent border ${project.dark ? 'border-gray-600' : 'border-gray-200'}\" \n style=\"color: unset;\" \n aria-label=\"Close\" \n onclick=\"data.menuDialog = null\">\n close\n </button>\n </footer>\n </article>\n </dialog>`;\n return menuDialog;\n}\nfunction Demos() {\n const buttonClass = \"grid grid-rows-1 items-center bg-transparent border-0 focus-within:shadow-none\";\n const buttonContentClass = \"flex flex-col justify-between h-full\";\n const imageContentClass = \"grid h-full items-center\";\n const textContentClass = \"capitalize text-center mt-4\";\n\n const frameworks = [\n \"javascript\",\n \"typescript\",\n \"react\",\n \"vue\",\n \"preact\",\n \"angular\",\n \"alpine\",\n \"solid\",\n \"stimulus\",\n \"mithril\",\n \"hyperapp\",\n \"aurelia\",\n \"lit\",\n \"knockout\",\n \"moon\"\n ]\n\n let buttonHTML = \"\";\n for (const name of frameworks) {\n buttonHTML += `<button\n aria-label=\"new ${name} project\"\n name=\"new ${name} project\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"newProject('${name}')\">\n <div class=\"${buttonContentClass}\">\n <div class=\"${imageContentClass}\">\n <img loading=\"lazy\" width=\"256\" height=\"256\" src=\"imgs/frameworks/${name}.svg\" alt=\"${name}\" />\n </div>\n <div class=\"${textContentClass}\">\n ${name}\n </div>\n </div>\n </button>`;\n }\n\n let demosDialog = `<dialog ${data.demos ? 'open' : ''}>\n <article class=\"rounded-md\">\n <header class=\"flex justify-between items-center\">\n <h1 class=\"text-lg font-thin m-0\">\n Are you sure you want to start a new project?\n </h1>\n <button \n class=\"text-xs w-auto px-3 py-2 m-0 capitalize rounded-md bg-transparent border-0\" \n style=\"color: unset;\" \n aria-label=\"Close\"\n onclick=\"data.demos = null;\">\n ${icons.times}\n </button>\n </header>\n <main class=\"font-thin\">\n <div class=\"p-4 text-center\">All current data will be lost.</div>\n <div class=\"p-4 relative h-80 overflow-auto\">\n <div class=\"grid grid-cols-2 sm:grid-cols-4 gap-4\">\n ${buttonHTML}\n </div>\n </div>\n </main>\n <footer>\n <button \n class=\"text-xs w-auto px-3 py-2 m-0 capitalize rounded-md bg-transparent border ${project.dark ? 'border-gray-600' : 'border-gray-200'}\" \n style=\"color: unset;\" \n aria-label=\"Close\" \n onclick=\"data.demos = null;\">\n close\n </button>\n </footer>\n </article>\n</dialog>`;\n return demosDialog;\n}\nfunction Settings() {\n let frameworks = data.frameworks;\n\n // Get the keys, sort them alphabetically, and reduce them back into an object\n let sortedFrameworks = Object.keys(frameworks)\n .sort()\n .reduce((acc, key) => {\n acc[key] = frameworks[key];\n return acc;\n }, {});\n\n let settingsHTML = `<ul class=\"px-0\">\n <li class=\"list-none\">\n <div class=\"mb-2\">\n <input \n id=\"pjqgd1wka\"\n type=\"file\" \n name=\"project logo\" \n class=\"hidden\"\n onchange=\"handleLogoChange(event)\"\n />\n <label \n for=\"pjqgd1wka\"\n class=\"mb-2 flex justify-between items-center cursor-pointer\">\n <span>Project logo:</span>\n\n <img \n id=\"projectLogo\"\n class=\"w-8\"\n alt=\"Project Logo\"\n src=\"${project.logo}\"\n loading=\"lazy\">\n </label>\n </div>\n </li>\n <li class=\"list-none\">\n <nav class=\"flex justify-between mt-5 items-center\">\n <label \n for=\"o14tigo4m\"\n class=\"mb-2 flex justify-between items-center cursor-pointer\">\n <span>Dark:</span>\n </label>\n\n <input \n id=\"o14tigo4m\"\n class=\"m-0\"\n type=\"checkbox\" \n role=\"switch\"\n name=\"toggle css reset\"\n onchange=\"project.dark = this.checked;\"\n ${project.dark ? 'checked' : ''}\n />\n </nav>\n </li>\n <li class=\"list-none\">\n <nav class=\"flex justify-between mt-5 items-center\">\n <label \n for=\"ep0b8bd4c\"\n class=\"mb-2 flex justify-between items-center cursor-pointer\">\n <span>Module:</span>\n </label>\n\n <input \n id=\"ep0b8bd4c\"\n class=\"m-0\"\n type=\"checkbox\" \n role=\"switch\"\n name=\"toggle module\"\n onchange=\"project.module = this.checked;\"\n ${project.module ? 'checked' : ''}\n />\n </nav>\n </li>\n <li class=\"list-none\">\n <nav class=\"flex justify-between mt-5 items-center\">\n <label \n for=\"if2s51d22\"\n class=\"mb-2 flex justify-between items-center cursor-pointer\">\n <span>Auto run:</span>\n </label>\n\n <input \n id=\"if2s51d22\"\n class=\"m-0\"\n type=\"checkbox\" \n role=\"switch\"\n name=\"toggle auto run\"\n onchange=\"project.autorun = this.checked;\"\n ${project.autorun ? 'checked' : ''}\n />\n </nav>\n </li>\n <li class=\"list-none\">\n <nav class=\"flex justify-between mt-5 items-center\">\n <label \n for=\"osbpm2k0q\"\n class=\"mb-2 flex justify-between items-center cursor-pointer\">\n <span>PWA:</span>\n </label>\n\n <input \n id=\"osbpm2k0q\"\n class=\"m-0\"\n type=\"checkbox\" \n role=\"switch\"\n name=\"export project as a pwa\"\n onchange=\"project.pwa = this.checked\"\n ${project.pwa ? 'checked' : ''}\n />\n </nav>\n </li>\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <li class=\"list-none\">\n <nav class=\"flex justifu-between -mt-3 items-center\">\n <label \n for=\"wl7i1adq7\"\n class=\"m-0 flex justify-between items-center cursor-pointer\">\n <span>Libraries:</span>\n </label>\n\n <button\n aria-label=\"search libraries\"\n name=\"search libraries\"\n class=\"bg-transparent border-0 focus-within:shadow-none\"\n style=\"color: unset;\"\n onclick=\"data.libraries = true; searchInput.focus();\">\n ${icons.search}\n </button>\n </nav>\n\n <select onchange=\"\n if (this.value) {\n data.chosenFramework = this.value.toLowerCase();\n let framework = data.frameworks[\\`\\${data.chosenFramework}\\`];\n if (!project.libraries.includes(framework.libraries)) {\n for (item of framework.libraries) {\n project.libraries.push(item);\n }\n }\n if (framework.meta) project.meta += framework.meta;\n } else {\n data.chosenFramework = '';\n }\n \">\n <option value=\"\" ${!data.chosenFramework ? 'selected' : ''}>-- Popular Libraries/Frameworks --</option>\n ${Object.keys(sortedFrameworks).map(framework => {\n // Lowercase except first character is uppercase\n let name = framework.toLowerCase();\n name = name.charAt(0).toUpperCase() + name.slice(1);\n return `<option value=\"${name}\" ${name === data.chosenFramework ? 'selected' : ''}>${name}</option>`\n }).join('')}\n </select>\n\n <div id=\"librariesBox\">\n ${project.libraries.map((library, index) => `\n <nav class=\"flex justify-between py-2\" data-index=\"${index}\">\n <input \n type=\"text\" \n placeholder=\"https://cdnjs.cloudflare.com/ajax/libs/Sortable/1.15.2/Sortable.min.js\" \n data=\"library\" \n class=\"w-full pl-3 pr-0 rounded-md rounded-r-none focus:shadow-none\"\n style=\"margin-bottom: 0;\"\n value=\"${library}\" \n oninput=\"project.libraries[${index}] = this.value; renderPreview(true);\" />\n <button \n aria-label=\"delete library\"\n name=\"delete library\"\n class=\"px-3 py-[15px] h-full border-0 rounded-md rounded-l-none\"\n onclick=\"project.libraries.splice(${index}, 1); renderPreview(true);\">\n ${icons.trash}\n </button>\n </nav>\n `).join('')}\n </div>\n <button \n aria-label=\"add another library or framework\" \n name=\"add another library or framework\" \n onclick=\"project.libraries.push('')\" \n class=\"capitalize py-2 w-full items-center rounded-md\">\n <span class=\"text-[.75rem]\">\n Add another\n </span>\n </button>\n </li>\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <!--\n <li class=\"list-none\">\n <nav class=\"flex justify-between mt-5 items-center\">\n <div class=\"mb-2\">\n HTML:\n </div>\n\n <select \n aria-label=\"html preprocessor\"\n name=\"html preprocessor\"\n onchange=\"setPreprocessor('html', this.value);\" \n class=\"w-auto my-0 text-[.75rem]\">\n <option value=\"html\" ${project.html_pre_processor === 'html' ? 'selected' : ''}>HTML</option>\n <option value=\"markdown\" ${project.html_pre_processor === 'markdown' ? 'selected' : ''}>Markdown</option>\n <option value=\"pug\" ${project.html_pre_processor === 'pug' ? 'selected' : ''}>Pug</option>\n </select>\n </nav>\n </li>\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <li class=\"list-none\">\n <nav class=\"flex justify-between mt-5 items-center\">\n <div class=\"mb-2\">\n CSS:\n </div>\n\n <select \n aria-label=\"css preprocessor\"\n name=\"css preprocessor\"\n onchange=\"setPreprocessor('css', this.value);\" \n class=\"w-auto my-0 text-[.75rem]\">\n <option value=\"css\" ${project.css_pre_processor === 'css' ? 'selected' : ''}>CSS</option>\n <option value=\"sass\" ${project.css_pre_processor === 'sass' ? 'selected' : ''}>Sass</option>\n <option value=\"less\" ${project.css_pre_processor === 'less' ? 'selected' : ''}>LESS</option>\n <option value=\"stylus\" ${project.css_pre_processor === 'stylus' ? 'selected' : ''}>Stylus</option>\n </select>\n </nav>\n </li>\n -->\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <li class=\"list-none\">\n <nav class=\"flex justify-between mt-5 items-center\">\n <div class=\"mb-2\">\n JS:\n </div>\n\n <select \n aria-label=\"javascript preprocessor\"\n name=\"javascript preprocessor\"\n onchange=\"setPreprocessor('javascript', this.value);\" \n class=\"w-auto my-0 text-[.75rem]\">\n <option value=\"javascript\" ${project.javascript_pre_processor === 'javascript' ? 'selected' : ''}>Javascript</option>\n <option value=\"babel\" ${project.javascript_pre_processor === 'babel' ? 'selected' : ''}>Babel (JSX / ES6)</option>\n <option value=\"typescript\" ${project.javascript_pre_processor === 'typescript' ? 'selected' : ''}>Typescript</option>\n </select>\n </nav>\n </li>\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <li class=\"list-none\">\n <div class=\"mb-2\">\n Project name:\n </div>\n <input \n type=\"text\" \n name=\"project name\"\n placeholder=\"Project name\" \n class=\"p-2 rounded-md w-full\" \n value=\"${project.name}\"\n oninput=\"project.name = this.value;\"\n />\n </li>\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <li class=\"list-none\">\n <div class=\"mb-2\">\n Project version:\n </div>\n <section class=\"flex justify-between gap-4\">\n <input \n type=\"number\" \n min=\"0\"\n step=\"1\"\n name=\"project-major-version\"\n placeholder=\"Major\"\n class=\"p-2 rounded-md w-full\" \n value=\"${project.version.split('.')[0]}\"\n oninput=\"updateVersionPart('major', this.value);\"\n />\n <input \n type=\"number\" \n min=\"0\"\n step=\"1\"\n name=\"project-minor-version\"\n placeholder=\"Minor\" \n class=\"p-2 rounded-md w-full\" \n value=\"${project.version.split('.')[1]}\"\n oninput=\"updateVersionPart('minor', this.value);\"\n />\n <input \n type=\"number\" \n min=\"0\"\n step=\"1\"\n name=\"project-patch-version\"\n placeholder=\"Patch\" \n class=\"p-2 rounded-md w-full\" \n value=\"${project.version.split('.')[2]}\"\n oninput=\"updateVersionPart('patch', this.value);\"\n />\n </section>\n </li>\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <li class=\"list-none\">\n <div class=\"mb-2\">\n Project title:\n </div>\n <input \n type=\"text\" \n name=\"project title\"\n placeholder=\"Project title\"\n class=\"p-2 rounded-md w-full\" \n value=\"${project.title}\"\n oninput=\"project.title = this.value;\"\n />\n </li>\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <li class=\"list-none\">\n <div class=\"mb-2\">\n Project description:\n </div>\n <textarea \n name=\"project description\"\n placeholder=\"Project description\" \n class=\"p-2 rounded-md w-full resize-vertical h-56\"\n oninput=\"project.description = this.value;\"\n >${project.description}</textarea>\n </li>\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <li class=\"list-none\">\n <div class=\"mb-2\">\n Project author:\n </div>\n <input \n type=\"text\" \n name=\"project author\"\n placeholder=\"Project author\" \n class=\"p-2 rounded-md w-full\" \n value=\"${project.author}\"\n oninput=\"project.author = this.value;\"\n />\n </li>\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <li class=\"list-none\">\n <div class=\"mb-2\">\n Project url:\n </div>\n <input \n type=\"text\" \n name=\"project url\"\n placeholder=\"Project url\" \n class=\"p-2 rounded-md w-full\" \n value=\"${project.url}\"\n oninput=\"project.url = this.value;\"\n />\n </li>\n <li class=\"p-0 list-none\">\n <hr />\n </li>\n <li class=\"list-none\">\n <div class=\"my-2\">\n HTML before closing head tag:\n </div>\n <textarea \n placeholder=\"HTML before closing </head> tag\" \n class=\"p-2 rounded-md w-full resize-vertical h-56\"\n oninput=\"project.meta = this.value;\"\n >${project.meta}</textarea>\n </li>\n </ul>`;\n settingsHTML = `<dialog ${data.settings ? 'open' : ''}>\n <article class=\"rounded-md\">\n <header class=\"flex justify-between items-center\">\n <h1 class=\"text-lg font-thin m-0 capitalize\">\n settings\n </h1>\n <button \n class=\"text-xs w-auto px-3 py-2 m-0 capitalize rounded-md bg-transparent border-0\" \n style=\"color: unset;\" \n aria-label=\"Close\"\n onclick=\"data.settings = null\">\n ${icons.times}\n </button>\n </header>\n <main class=\"font-thin\">\n ${settingsHTML}\n </main>\n <footer>\n <button \n class=\"text-xs w-auto px-3 py-2 m-0 capitalize rounded-md bg-transparent border ${project.dark ? 'border-gray-600' : 'border-gray-200'}\" \n style=\"color: unset;\" \n aria-label=\"Close\" \n onclick=\"data.settings = null\">\n close\n </button>\n </footer>\n </article>\n </dialog>`;\n return settingsHTML;\n}\nfunction Libraries() {\n let librariesDialog = `<dialog ${data.libraries ? 'open' : ''}>\n <article class=\"rounded-md\">\n <header class=\"flex justify-between items-center\">\n <h1 class=\"text-lg font-thin m-0\">\n Search for resources (JQuery, Bootstrap, Foundation...)\n </h1>\n <button \n class=\"text-xs w-auto px-3 py-2 m-0 capitalize rounded-md bg-transparent border-0\" \n style=\"color: unset;\" \n aria-label=\"Close\"\n onclick=\"data.libraries = null; data.searchLibKey = null; searchInput.value = null;\">\n ${icons.times}\n </button>\n </header>\n <main class=\"font-thin\">\n <div class=\"p-4\">\n <input \n id=\"searchInput\" \n type=\"search\" \n placeholder=\"Search for resources (JQuery, Bootstrap, Foundation...)\" \n class=\"w-full p-3 rounded-full bg-[#1c212c]\" \n oninput=\"this.value ? data.searchLibKey = this.value : data.searchLibKey = null; data.searchLibKey ? fetchSuggestions(data.searchLibKey) : ''\" />\n \n <div class=\"relative px-4 capitalize h-auto max-h-64 overflow-auto\">\n ${data.librarySuggestions && data.searchLibKey ? data.librarySuggestions : ''}\n </div>\n </div>\n </main>\n <footer>\n <button \n class=\"text-xs w-auto px-3 py-2 m-0 capitalize rounded-md bg-transparent border ${project.dark ? 'border-gray-600' : 'border-gray-200'}\" \n style=\"color: unset;\" \n aria-label=\"Close\" \n onclick=\"data.libraries = null; data.searchLibKey = null; searchInput.value = null;\">\n close\n </button>\n </footer>\n </article>\n </dialog>`;\n\n return librariesDialog;\n}\nwindow.App = {\n initialRender: true,\n render(container) {\n // Calculate zoom transform based on viewport size and iframe size\n const size = data.selectedSize;\n let viewportWidth, viewportHeight;\n const previewElm = document.getElementById('previewElm');\n if (document.getElementById('previewElm')) {\n viewportWidth = previewElm.clientWidth;\n viewportHeight = previewElm.clientHeight;\n }\n let [width, height] = size.split('x').map(Number);\n \n const html = `\n <div>\n <div class=\"absolute inset-y-0 left-0 flex flex-col text-center justify-between px-2 py-4 overflow-auto no-scrollbar\">\n ${LeftMenubar()}\n </div>\n \n <!-- flexbox for panels and preview -->\n <div class=\"flex flex-col flex-col-reverse sm:flex-row absolute inset-y-0 right-0 left-16 bottom-0 overflow-hidden\">\n <div class=\"relative w-full h-full border-0 border-x border-solid overflow-auto p-4 ${project.dark ? \"border-gray-800\" : \"border-gray-200\"}\">\n <nav class=\"absolute inset-0 flex flex-col ${project.columns ? 'flex-col' : `sm:flex-row ${project.columnsRight ? 'sm:flex-row-reverse' : ''}`}\">\n <div class=\"flex-grow w-full h-full flex flex-col ${project.columns ? '' : `border-0 border-x border-solid ${project.dark ? \"border-gray-800\" : \"border-gray-200\"}`} ${project.preview ? '' : 'hidden'}\">\n <div class=\"flex-none border-0 border-b border-solid ${project.dark ? \"border-gray-800\" : \"border-gray-200\"}\">\n ${PreviewMenu()}\n </div>\n <div class=\"flex-grow overflow-hidden h-full\">\n <div id=\"previewElm\" class=\"relative grid grid-cols-1 align-center items-center w-full h-full\">\n <iframe\n id=\"iframe\"\n title=\"${project.title}\"\n class=\"bg-white ${data.selectedSize !== 'none' ? `border border-solid ${project.dark ? \"border-gray-800\" : \"border-gray-200\"} shadow-2xl shadow-blue-500` : ''}\"\n style=\"${data.selectedSize === 'none' ? 'width: 100%; height: 100%' : `\n width: ${width}px;\n height: ${height}px;\n transform: scale(${Math.min(viewportWidth / width, viewportHeight / height)});\n position: absolute;\n top: 50%;\n left: 50%;\n margin-top: -${height / 2}px;\n margin-left: -${width / 2}px;`}\"\n allow=\"accelerometer *; bluetooth *; camera *; encrypted-media *; display-capture *; geolocation *; gyroscope *; microphone *; midi *; clipboard-read *; clipboard-write *; web-share *; serial *; xr-spatial-tracking *\"\n allowfullscreen=\"true\"\n allowpaymentrequest=\"true\"\n allowtransparency=\"true\"\n sandbox=\"allow-downloads allow-forms allow-modals allow-pointer-lock allow-popups-to-escape-sandbox allow-popups allow-presentation allow-same-origin allow-scripts allow-top-navigation-by-user-activation\"\n loading=\"lazy\"\n ></iframe>\n\n <span \n id=\"iframeClientSize\" \n class=\"hidden opacity-0 transition-opacity duration-300 absolute top-0 right-0 ${project.dark ? 'bg-gray-800' : 'bg-gray-200'} p-1 text-xs\">\n ${data.iframeSize}\n </span>\n </div>\n </div>\n </div>\n <div class=\"relative flex-grow w-full h-full ${project.columns ? '' : '2xl:w-1/2 sm:border-solid sm:border-0 lg:border-r '+project.dark ? \"border-gray-800\" : \"border-gray-200\"+''} ${project.activePanel ? '' : 'hidden'}\">\n <div class=\"absolute inset-0 flex flex-col justify-between\">\n <div class=\"flex-grow overflow-auto ${project.columns ? `border-0 border-t border-solid ${project.dark ? \"border-gray-800\" : \"border-gray-200\"}` : ''}\">\n <div class=\"h-full ${project.activePanel === 'html' ? '' : 'hidden'}\">\n <div \n data-ignore\n class=\"h-full\"\n aria-label=\"html editor\"\n name=\"html editor\"\n id=\"htmlEditor\"></div>\n </div>\n <div class=\"h-full ${project.activePanel === 'css' ? '' : 'hidden'}\">\n <div \n data-ignore\n class=\"h-full\"\n aria-label=\"css editor\"\n name=\"css editor\"\n id=\"cssEditor\"></div>\n </div>\n <div class=\"h-full ${project.activePanel === 'javascript' ? '' : 'hidden'}\">\n <div \n data-ignore\n class=\"h-full\"\n aria-label=\"javascript editor\"\n name=\"javascript editor\"\n id=\"jsEditor\"></div>\n </div>\n </div>\n <div class=\"flex-none overflow-auto border-0 border-t border-solid ${project.dark ? \"border-gray-800\" : \"border-gray-200\"}\">\n ${editorNav()}\n </div>\n </div>\n </div>\n </nav>\n </div>\n </div>\n\n ${Menu()}\n ${Settings()}\n ${Libraries()}\n ${Demos()}\n </div>`\n \n const element = document.querySelector(container);\n if (!element) return;\n\n // Create a new temporary element to compare\n const parser = new DOMParser();\n const doc = parser.parseFromString(html, 'text/html');\n if (doc.body.innerHTML.trim() === html.trim()) return;\n if (App.initialRender) {\n element.innerHTML = html;\n renderPreview(true);\n App.initialRender = false;\n return false;\n }\n\n // Compare and update only the changed parts\n const currentDoc = element.firstElementChild;\n const newDoc = doc.body.firstElementChild;\n diffNodes(currentDoc, newDoc);\n }\n}\nwindow.Modal = {\n render({\n large,\n title = \"Are you sure you want to proceed?\",\n content,\n CloseLabel,\n ConfirmLabel,\n onLoad,\n onClose,\n onConfirm\n }) {\n // if (!options) return false;\n const hClass = \"text-lg font-thin m-0\";\n const buttonClass = \"text-xs w-auto px-3 py-2 m-0 capitalize rounded-md\";\n const svgClass = \"w-3\";\n const times = `<svg class=\"${svgClass}\" viewBox=\"0 0 384 512\">\n <path \n fill=\"currentColor\" \n d=\"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z\"/>\n </svg>`;\n\n const html = `<article class=\"${large ? 'flex flex-col h-3/4' : ''} rounded-md\">\n <header class=\"${large ? 'flex-none' : ''} flex justify-between items-center\">\n <h1 class=\"${hClass}\">${title}</h1>\n <button class=\"${buttonClass} bg-transparent border-0\" style=\"color: unset;\" aria-label=\"Close\">\n ${times}\n </button>\n </header>\n <main class=\"font-thin ${large ? 'flex-grow' : ''}\">\n ${content ? content : ''}\n </main>\n <footer ${large ? 'class=\"flex-none\"' : ''}>\n <button class=\"${buttonClass} bg-transparent border ${project.dark ? 'border-gray-600' : 'border-gray-200'}\" style=\"color: unset;\" aria-label=\"Close\" onclick=\"this.closest('dialog').close()\">${CloseLabel ? CloseLabel : 'close'}</button>\n ${onConfirm ? `<button class=\"${buttonClass}\" aria-label=\"Confirm\">${ConfirmLabel ? ConfirmLabel : 'confirm'}</button>` : ''}\n </footer>\n </article>`;\n\n const modal = document.createElement('dialog');\n modal.open = true;\n modal.innerHTML = html;\n\n document.body.appendChild(modal);\n if (onLoad && typeof onLoad === 'function') {\n onLoad();\n }\n\n const timesBtn = modal.querySelector('header button');\n const closeBtn = modal.querySelector('footer button:first-child');\n const confirmBtn = modal.querySelector('footer button:last-child');\n\n // Confirm handler function\n timesBtn.onclick = function() {\n if (onClose && typeof onClose === 'function') {\n onClose();\n }\n document.body.removeChild(modal);\n }\n closeBtn.onclick = function() {\n if (onClose && typeof onClose === 'function') {\n onClose();\n }\n document.body.removeChild(modal);\n }\n confirmBtn.onclick = function() {\n if (onConfirm && typeof onConfirm === 'function') {\n onConfirm();\n }\n document.body.removeChild(modal);\n }\n }\n}\nfunction editorNav() {\n const buttonClass = \"border-0 bg-transparent py-1\";\n\n return `<div class=\"flex justify-between\">\n <button\n aria-label=\"indent\"\n name=\"indent\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('indent', getActiveEditor())\">\n ${icons.indent}\n </button>\n <button\n aria-label=\"outdent\"\n name=\"outdent\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('outdent', getActiveEditor())\">\n ${icons.outdent}\n </button>\n <button\n aria-label=\"undo\"\n name=\"undo\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('undo', getActiveEditor())\">\n ${icons.undo}\n </button>\n <button\n aria-label=\"redo\"\n name=\"redo\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('redo', getActiveEditor())\">\n ${icons.redo}\n </button>\n <button\n aria-label=\"search\"\n name=\"search\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('search', getActiveEditor())\">\n ${icons.search}\n </button>\n <button\n aria-label=\"goto line\"\n name=\"goto line\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('goto', getActiveEditor())\">\n ${icons.goto}\n </button>\n </div>\n\n <div class=\"flex justify-between\">\n <button\n aria-label=\"comment\"\n name=\"comment\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('toggleComment', getActiveEditor())\">\n ${icons.comment}\n </button>\n <button\n aria-label=\"fold\"\n name=\"fold\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('foldAll', getActiveEditor())\">\n ${icons.fold}\n </button>\n <button\n aria-label=\"unfold\"\n name=\"unfold\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('unfoldAll', getActiveEditor())\">\n ${icons.unfold}\n </button>\n <button\n aria-label=\"cut\"\n name=\"cut\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('cut', getActiveEditor())\">\n ${icons.cut}\n </button>\n <button\n aria-label=\"copy\"\n name=\"copy\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('copy', getActiveEditor())\">\n ${icons.copy}\n </button>\n <button\n aria-label=\"paste\"\n name=\"paste\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('paste', getActiveEditor())\">\n ${icons.paste}\n </button>\n <button\n aria-label=\"select all\"\n name=\"select all\"\n class=\"${buttonClass}\"\n style=\"color: unset;\"\n onclick=\"editorCommand('selectAll', getActiveEditor())\">\n ${icons.cursor}\n </button>\n </div>`;\n}\nwindow.emptyStorage = () => {\n Modal.render({\n title: \"Are you sure you want to empty storage?\",\n content: '<div class=\"p-4 text-center\">All current data will be lost.</div>',\n onConfirm() {\n // Clear local storage\n localStorage.removeItem('kodeWeave');\n \n // Clear session storage specific to kodeWeave (if you use a specific key)\n sessionStorage.removeItem('kodeWeave');\n \n // Clear cookies specific to kodeWeave\n document.cookie.split(\";\").forEach(function(c) {\n if (c.trim().startsWith('kodeWeave')) {\n document.cookie = c.trim().split(\"=\")[0] + \n '=;expires=Thu, 01 Jan 1970 00:00:00 UTC;path=/';\n }\n });\n \n // Clear service worker caches specific to kodeWeave\n if ('caches' in window) {\n caches.keys().then(function(names) {\n names.forEach(function(name) {\n if (name === 'kodeWeave-cache') {\n caches.delete(name);\n }\n });\n });\n }\n \n // Unregister service workers specific to kodeWeave\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.getRegistrations().then(function(registrations) {\n registrations.forEach(function(registration) {\n if (registration.scope.includes('kodeWeave')) {\n registration.unregister();\n }\n });\n });\n }\n \n location.reload();\n }\n });\n}\nwindow.updateVersionPart = (part, value) => {\n const versionParts = project.version.split('.');\n if (part === 'major') {\n versionParts[0] = value;\n } else if (part === 'minor') {\n versionParts[1] = value;\n } else if (part === 'patch') {\n versionParts[2] = value;\n }\n project.version = versionParts.join('.');\n}\nwindow.searchMedia = () => {\n let modalContent = `\n <input class=\"hidden\" type=\"file\" name=\"file\" id=\"file-input\">\n\n <div class=\"p-4 text-center grid grid-cols-1 gap-4 items-center\">\n <!-- Media Type Dropdown -->\n <nav class=\"w-full flex justify-between place-items-center\">\n <div>Select Media Type:</div>\n <button class=\"ml-4 font-thin text-xs bg-transparent border-0\" style=\"color: unset;\" onclick=\"document.getElementById('file-input').click();\">\n <svg class=\"h-4 w-4\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5\"></path>\n </svg>\n </button>\n </nav>\n <select id=\"media-type-select\" class=\"p-2 w-full\">\n <option value=\"all\">All</option>\n <option value=\"image\" selected>Images</option>\n <option value=\"audio\">Audios</option>\n <option value=\"svg\">SVGs</option>\n </select>\n\n <!-- Search Input and Button -->\n <fieldset role=\"group\" class=\"border-0 shadow-none\">\n <input \n id=\"search-input\" \n type=\"text\" \n placeholder=\"Search for media...\" \n class=\"p-2 w-full\" \n onkeydown=\"if (event.key === 'Enter') { document.getElementById('search-btn').click(); }\"\n />\n <button id=\"search-btn\">${icons.search}</button>\n </fieldset>\n\n <!-- Search Results -->\n <div id=\"search-results\" class=\"mt-4 grid grid-cols-4 gap-4\"></div>\n\n <!-- Additional Information -->\n <div class=\"font-thin text-xs\">\n You can grab your own media from <a href=\"https://pixabay.com/\" target=\"_blank\">Pixabay.com</a>, \n <a href=\"https://pexels.com/\" target=\"_blank\">Pexels.com</a>, or <a href=\"https://freesound.org/\" target=\"_blank\">freesound.org</a>.\n </div>\n </div>`;\n\n Modal.render({\n title: \"Search Media\",\n content: modalContent,\n onLoad: async function() {\n const apiConnection = await checkApiConnection();\n const searchInput = document.getElementById('search-input');\n const searchBtn = document.getElementById('search-btn');\n const mediaTypeSelect = document.getElementById('media-type-select');\n const resultsContainer = document.getElementById('search-results');\n const fileInput = document.getElementById('file-input');\n searchInput.focus();\n\n const handleSearch = async () => {\n const query = searchInput.value;\n const mediaType = mediaTypeSelect.value;\n\n if (query) {\n let results = [];\n if (mediaType === 'all' || mediaType === 'image') {\n const images = await searchOpenverseImage(query);\n results.push(...images.map(img => ({ type: 'image', ...img })));\n }\n if (mediaType === 'all' || mediaType === 'audio') {\n const audios = await searchOpenverseAudio(query);\n results.push(...audios.map(audio => ({ type: 'audio', ...audio })));\n }\n if (mediaType === 'all' || mediaType === 'svg') {\n const icons = await searchIcons(query);\n results.push(...icons.map(icon => ({ type: 'icon', url: `https://api.iconify.design/${icon}.svg` })));\n }\n displayResults(results);\n } else {\n resultsContainer.innerHTML = '';\n }\n };\n\n mediaTypeSelect.onchange = handleSearch;\n searchInput.oninput = handleSearch;\n searchBtn.onclick = handleSearch;\n\n fileInput.onchange = async (event) => {\n const file = event.target.files[0];\n if (file) {\n const base64 = await fileToBase64(file);\n let resultHTML;\n\n if (file.type.startsWith('image/')) {\n resultHTML = `<img \n src=\"${base64}\" \n alt=\"${file.name}\" \n title=\"${file.name}\"\n loading=\"lazy\"\n class=\"cursor-pointer w-full\"\n/>`;\ncopyToClipboard(resultHTML);\nalert('Image copied to clipboard');\n } else if (file.type.startsWith('audio/')) {\n resultHTML = `<audio controls class=\"w-full\" preload=\"true\">\n <source src=\"${base64}\" type=\"${file.type}\">\n Your browser does not support the audio element.\n</audio>`;\n copyToClipboard(resultHTML);\n alert('Audio copied to clipboard');\n } else if (file.type === 'image/svg+xml') {\n const reader = new FileReader();\n reader.onload = () => {\n const svgContent = reader.result;\n copyToClipboard(svgContent);\n alert('SVG copied to clipboard');\n };\n reader.readAsText(file);\n return;\n } else if (file.type.startsWith('video/')) {\n const resultHTML = `<video controls preload=\"true\">\n <source src=\"${base64}\" type=\"${file.type}\">\n Your browser does not support the video tag.\n</video>`\n copyToClipboard(resultHTML);\n alert('Video copied to clipboard');\n return;\n }\n\n closeOpenDialog();\n }\n };\n\n function displayResults(results) {\n if (navigator.onLine) {\n resultsContainer.innerHTML = results.map(result => {\n if (result.type === 'image') {\n resultsContainer.className = \"mt-4 grid grid-cols-4 gap-4\";\n const imgHTML = `\n <img \n src=\"${result.url}\" \n alt=\"${result.title}\" \n title=\"${result.title}\"\n loading=\"lazy\"\n class=\"cursor-pointer w-full\"\n />`;\n // Remove 'class' attribute\n const parser = new DOMParser();\n const imgDoc = parser.parseFromString(imgHTML, 'text/html');\n const imgElement = imgDoc.querySelector('img');\n if (imgElement) imgElement.removeAttribute('class');\n const cleanedImgHTML = imgElement.outerHTML;\n\n // Properly escape HTML for the onclick attribute\n const escapedImgHTML = cleanedImgHTML\n .replace(/`/g, '\\\\`') // Escape backticks\n .replace(/</g, '<') // Escape less than signs\n .replace(/>/g, '>') // Escape greater than signs\n .replace(/\"/g, '"'); // Escape double quotes\n\n return `\n <div class=\"cursor-pointer\" onclick=\"copyToClipboard(\\`${escapedImgHTML}\\`); alert('Image HTML copied to clipboard'); closeOpenDialog();\">\n ${imgHTML}\n </div>`;\n } else if (result.type === 'audio') {\n resultsContainer.className = \"mt-4 grid grid-cols-1 gap-1\";\n return `\n <div>\n <div class=\"font-thin mb-2 text-left\">${result.title}</div>\n <figure class=\"m-0 mb-2\">\n <nav class=\"text-center flex justify-between place-items-center\">\n<audio controls class=\"w-full\" preload=\"true\">\n <source src=\"${result.url}\" type=\"${result.mime_type}\">\n Your browser does not support the audio element.\n</audio>\n <button \n class=\"ml-4 font-thin text-xs\" \n onclick=\"copyToClipboard(this.previousElementSibling.outerHTML); alert('Audio HTML copied to clipboard'); closeOpenDialog();\"\n >\n Select\n </button>\n </nav>\n <figcaption class=\"font-thin text-sm text-left mt-2\">\n <span>Artist is \n <a href=\"${result.foreign_landing_url}\" target=\"_blank\">${result.creator}</a>.\n </figcaption>\n </figure>\n <hr/>\n </div>`;\n } else if (result.type === 'icon') {\n resultsContainer.className = \"mt-4 grid grid-cols-4 gap-4\";\n if (apiConnection) {\n // Fetch and render SVG content\n getFile(result.url, (error, svgContent) => {\n if (error) {\n resultsContainer.innerHTML = \"Unable to fetch SVG.\";\n } else {\n // Remove width and height attributes from SVG content\n const parser = new DOMParser();\n const svgDoc = parser.parseFromString(svgContent, 'image/svg+xml');\n const svgElement = svgDoc.querySelector('svg');\n if (svgElement) {\n svgElement.removeAttribute('width');\n svgElement.removeAttribute('height');\n const serializer = new XMLSerializer();\n const cleanedSvgContent = serializer.serializeToString(svgElement);\n resultsContainer.innerHTML += `\n <div class=\"cursor-pointer\" onclick=\"copyToClipboard(this.innerHTML); alert('copied to clipboard'); closeOpenDialog();\">${cleanedSvgContent}</div>`;\n }\n }\n });\n } else {\n resultsContainer.className = \"mt-4 grid grid-cols-1 gap-4\";\n resultsContainer.innerHTML = \"Unable to search: Connection not found!\";\n }\n }\n }).join('');\n } else {\n resultsContainer.innerHTML = \"Unable to search: Connection not found!\";\n }\n }\n }\n });\n}\nwindow.checkApiConnection = async () => {\n try {\n const response = await fetch('https://api.iconify.design/collections');\n if (response.ok) {\n return true;\n }\n } catch (error) {\n console.error(\"API connection failed:\", error);\n }\n return false;\n}\nwindow.searchOpenverseImage = async query => {\n const url = `https://api.openverse.org/v1/images?q=${encodeURIComponent(query)}`;\n const response = await fetch(url);\n if (response.ok) {\n const data = await response.json();\n return data.results;\n } else {\n console.error(\"API request failed:\", response.status);\n return [];\n }\n}\nwindow.searchOpenverseAudio = async query => {\n const url = `https://api.openverse.org/v1/audio?q=${encodeURIComponent(query)}`;\n const response = await fetch(url);\n if (response.ok) {\n const data = await response.json();\n return data.results;\n } else {\n console.error(\"API request failed:\", response.status);\n return [];\n }\n}\nwindow.searchIcons = async query => {\n const searchUrl = `https://api.iconify.design/search?query=${encodeURIComponent(query)}`;\n try {\n const response = await fetch(searchUrl);\n if (response.ok) {\n const data = await response.json();\n return data.icons || [];\n } else {\n console.error(\"Failed to fetch icon search results.\");\n }\n } catch (error) {\n console.error(\"Error during icon search:\", error);\n }\n return [];\n}\nwindow.copyToClipboard = text => {\n navigator.clipboard.writeText(text).then(function() {\n }).catch(function(error) {\n console.error('Failed to copy text: ', error);\n });\n}\n\n// editor functions\nwindow.addLibrary = url => {\n if (!url) {\n project.libraries.push('');\n document.getElementById('librariesBox').innerHTML = renderLibraries();\n return false;\n }\n\n if (!project.libraries.includes(url)) {\n project.libraries.push(url);\n } else {\n console.error(`Library already exists: ${url}`);\n }\n\n if (document.getElementById('librariesBox')) {\n document.getElementById('librariesBox').innerHTML = renderLibraries();\n }\n};\nfunction renderLibraries() {\n return project.libraries.map((library, index) => `\n <nav class=\"flex justify-between py-2\" data-index=\"${index}\">\n <input \n type=\"text\" \n placeholder=\"https://cdnjs.cloudflare.com/ajax/libs/Sortable/1.15.2/Sortable.min.js\" \n data=\"library\" \n class=\"w-full pl-3 pr-0 rounded-md rounded-r-none focus:shadow-none\"\n style=\"margin-bottom: 0;\"\n value=\"${library}\" \n oninput=\"project.libraries[${index}] = this.value\" />\n <button \n aria-label=\"delete library\"\n name=\"delete library\"\n class=\"px-3 py-[15px] h-full border-0 rounded-md rounded-l-none\"\n onclick=\"project.libraries.splice(${index}, 1);\">\n ${icons.trash}\n </button>\n </nav>\n `).join('')\n}\nwindow.fetchSuggestions = key => {\n fetch(\n `https://api.cdnjs.com/libraries?search=${key}&fields=filename,description,version`\n )\n .then(response => {\n if (!response.ok) {\n throw new Error(\"Network response was not ok\");\n }\n return response.json();\n })\n .then(item => {\n if (item && item.results && item.results.length > 0) {\n const suggestions = item.results.map(result => result);\n\n data.librarySuggestions = suggestions.map(result => {\n return `\n <section \n class=\"cursor-pointer\"\n onclick=\"\n if (!project.libraries.includes('${result.latest}')) project.libraries.push('${result.latest}'); \n data.libraries = null;\n data.searchLibKey = null;\n data.librarySuggestions = null;\n searchInput.value = null;\n \">\n <div class=\"flex justify-between mb-2 font-bold text-1xl\">\n <span class=\"font-bold\">${result.name}</span>\n <span class=\"font-bold\">${result.version}</span>\n </div>\n <div class=\"text-sm font-thin\">${result.description}<br><hr></div>\n </section>`;\n }).join('');\n }\n })\n .catch(error => {\n console.error(\"Error fetching data:\", error);\n });\n}\nwindow.removeScript = src => {\n const script = document.querySelector(`script[src=\"${src}\"]`);\n if (script) script.remove();\n}\nwindow.removeScripts = scripts => {\n scripts.forEach(src => {\n const script = document.querySelector(`script[src=\"${src}\"]`);\n if (script) script.remove();\n });\n}\nwindow.loadScript = async scriptUrl => {\n return new Promise((resolve, reject) => {\n // Check if the script is already loaded\n const existingScript = document.querySelector(`script[src=\"${scriptUrl}\"]`);\n if (existingScript) {\n resolve(); // If the script is already present, resolve immediately\n return;\n }\n\n // Create a new script element if not present\n const scriptElement = document.createElement('script');\n scriptElement.src = scriptUrl;\n scriptElement.onload = resolve; // Resolve when the script is successfully loaded\n scriptElement.onerror = () => reject(new Error(`Failed to load script: ${scriptUrl}`)); // Reject on error\n document.body.appendChild(scriptElement); // Append the script to the body\n });\n}\nwindow.loadScripts = async srcArray => {\n return Promise.all(srcArray.map(loadScript));\n}\nwindow.setPreprocessor = async (editor, value) => {\n const scriptMap = {\n html: {\n markdown: \"libraries/preprocessors/marked.min.js\",\n jade: \"libraries/preprocessors/jade.js\",\n pug: \"libraries/preprocessors/pug.js\"\n },\n css: {\n sass: \"libraries/preprocessors/sass.sync.min.js\",\n less: \"libraries/preprocessors/less.min.js\",\n stylus: \"libraries/preprocessors/stylus.min.js\"\n },\n javascript: {\n typescript: \"libraries/preprocessors/typescript.min.js\",\n babel: \"libraries/preprocessors/babel.min.js\"\n }\n };\n\n const currentPreprocessors = {\n html: project.html_pre_processor,\n css: project.css_pre_processor,\n javascript: project.javascript_pre_processor\n };\n\n try {\n const scriptSrcCondition = (value !== 'html' || value !== 'css' || value !== 'javascript');\n const scriptSrc = scriptSrcCondition ? scriptMap[editor][value] : null;\n\n // Remove the current preprocessor scripts\n if (currentPreprocessors[editor] && scriptSrcCondition) {\n const currentScriptSrc = scriptMap[editor][currentPreprocessors[editor]];\n Array.isArray(currentScriptSrc) ? removeScripts(currentScriptSrc) : removeScript(currentScriptSrc)\n\n // Load the new preprocessor scripts\n if (Array.isArray(scriptSrc)) {\n await loadScripts(scriptSrc);\n } else if (scriptSrc) {\n await loadScript(scriptSrc);\n }\n }\n\n // Set the new preprocessor\n if (editor === 'html') {\n project.html_pre_processor = value;\n // if (!window.editorManager || !window.editorManager.htmlEditor) return;\n // window.editorManager.setMode(project.html_pre_processor === 'html' ? 'html' : value, editorManager.htmlEditor);\n } else if (editor === 'css') {\n project.css_pre_processor = value;\n // if (!window.editorManager || !window.editorManager.cssEditor) return;\n // window.editorManager.setMode(project.css_pre_processor === 'css' ? 'css' : value, editorManager.cssEditor);\n } else if (editor === 'javascript') {\n project.javascript_pre_processor = value;\n if (!window.editorManager || !window.editorManager.jsEditor) return;\n window.editorManager.setMode(project.javascript_pre_processor === 'javascript' ? 'javascript' : value, editorManager.jsEditor);\n }\n } catch (error) {\n console.error('Error setting preprocessor:', error);\n }\n}\nwindow.initializePreprocessors = async () => {\n await Promise.all([\n setPreprocessor('html', project.html_pre_processor),\n setPreprocessor('css', project.css_pre_processor),\n setPreprocessor('javascript', project.javascript_pre_processor)\n ]);\n \n if (!window.editorManager) return;\n dispatchChanges(editorManager.htmlEditor, project.html);\n dispatchChanges(editorManager.cssEditor, project.css);\n dispatchChanges(editorManager.jsEditor, project.javascript);\n renderPreview(true);\n}\nwindow.loadBeautifyLibraries = async () => {\n const beautifyLibraries = [\n \"libraries/js-beautify/beautify.min.js\",\n \"libraries/js-beautify/beautify-css.min.js\",\n \"libraries/js-beautify/beautify-html.min.js\"\n ];\n await loadScripts(beautifyLibraries);\n}\nwindow.removeBeautifyLibraries = async () => {\n const beautifyLibraries = [\n \"libraries/js-beautify/beautify.min.js\",\n \"libraries/js-beautify/beautify-css.min.js\",\n \"libraries/js-beautify/beautify-html.min.js\"\n ];\n removeScripts(beautifyLibraries);\n}\nwindow.tidy = async () => {\n await loadBeautifyLibraries();\n\n let formattedCode;\n switch (project.activePanel) {\n case 'html':\n formattedCode = html_beautify(project.html, {\n indent_size: 2,\n max_preserve_newlines: 1\n });\n dispatchChanges(editorManager.htmlEditor, formattedCode);\n break;\n case 'css':\n formattedCode = css_beautify(project.css, {\n indent_size: 2,\n max_preserve_newlines: 1\n });\n project.css = formattedCode;\n dispatchChanges(editorManager.cssEditor, formattedCode);\n break;\n case 'javascript':\n formattedCode = js_beautify(project.javascript, {\n indent_size: 2,\n max_preserve_newlines: 1\n });\n project.javascript = formattedCode;\n dispatchChanges(editorManager.jsEditor, formattedCode);\n break;\n default:\n formattedCode = 'Unknown editor panel.';\n }\n\n await removeBeautifyLibraries();\n}\nwindow.closeOpenDialog = () => {\n document.querySelector('dialog[open] footer button:last-child').click();\n}\n\n// iframe functions\nwindow.generateId = () => {\n let id = '';\n while (!/^[a-zA-Z]/.test(id)) {\n id = Math.random().toString(36).substr(2, 9);\n }\n return id;\n}\nwindow.resizeCanvas =size => {\n data.selectedSize = size;\n getIFrameClientSize();\n}\nwindow.rotateCanvas = () => {\n const iframe = document.getElementById('previewElm').firstElementChild;\n if (iframe.style.width === '100%') return false;\n\n // Extract current width and height\n let width = parseInt(iframe.style.width);\n let height = parseInt(iframe.style.height);\n\n // Swap width and height\n [width, height] = [height, width];\n\n // Calculate the new transform scale\n const viewportWidth = previewElm.clientWidth;\n const viewportHeight = previewElm.clientHeight;\n const scale = Math.min(viewportWidth / width, viewportHeight / height);\n\n // Apply the new styles\n iframe.style.width = `${width}px`;\n iframe.style.height = `${height}px`;\n iframe.style.transform = `scale(${scale})`;\n iframe.style.marginTop = `-${height / 2}px`;\n iframe.style.marginLeft = `-${width / 2}px`;\n data.selectedSize = width+'x'+height;\n getIFrameClientSize();\n}\nlet fadeTimeout;\nwindow.getIFrameClientSize = () => {\n const iframe = document.getElementById('iframe');\n data.iframeSize = `${iframe.offsetWidth}px x ${iframe.offsetHeight}px`;\n const element = document.getElementById('iframeClientSize');\n\n if (element.classList.contains('hidden')) {\n // Clear existing timeout to prevent multiple calls\n if (fadeTimeout) clearTimeout(fadeTimeout);\n\n // Remove hidden and add opacity-100 to show the element\n element.classList.remove('hidden', 'opacity-0');\n element.classList.add('opacity-100');\n\n // Set a timeout to handle fade-out\n fadeTimeout = setTimeout(() => {\n element.classList.remove('opacity-100');\n element.classList.add('opacity-0');\n\n // Add hidden class after fade-out\n setTimeout(() => {\n element.classList.add('hidden');\n }, 300); // Match the duration of the opacity transition\n }, 2000); // Show duration\n }\n}\nwindow.compileCode = async detect => {\n try {\n if (detect === 'html') {\n switch (project.html_pre_processor) {\n case 'html':\n return project.html;\n case 'markdown':\n return marked.parse(project.html);\n case 'jade':\n return jade.render(project.html, { pretty: true });\n case 'pug':\n const appScript = document.getElementById('appScript');\n if (appScript.hasAttribute('type') && appScript.getAttribute('type') === 'module') {\n // import pug from 'libraries/preprocessors/pug.js';\n console.error('Cannot import pug as script is a module!');\n return false;\n }\n\n const pug = require(\"pug\");\n return pug.compile(project.html)({name: this.name });\n default:\n return project.html;\n }\n }\n\n if (detect === 'css') {\n switch (project.css_pre_processor) {\n case 'css':\n return project.css;\n case 'stylus':\n return stylus.render(project.css);\n case 'less':\n return new Promise((resolve, reject) => {\n less.render(project.css, (err, output) => err ? reject(err) : resolve(output.css));\n });\n case 'sass':\n return new Promise((resolve, reject) => {\n Sass.compile(project.css, result => result.status === 0 ? resolve(result.text) : reject(new Error(result.message)));\n });\n default:\n return project.css;\n }\n }\n\n if (detect === 'javascript') {\n switch (project.javascript_pre_processor) {\n case 'javascript':\n return project.javascript;\n case 'babel':\n if (typeof Babel === 'undefined') {\n await loadScript(\"libraries/preprocessors/babel.min.js\");\n }\n return Babel.transform(project.javascript, { presets: ['env', 'react'] }).code;\n case 'typescript':\n return ts.transpileModule(project.javascript, { compilerOptions: { module: ts.ModuleKind.CommonJS } }).outputText;\n default:\n return project.javascript;\n }\n }\n } catch (error) {\n console.error('Error compiling code:', error);\n }\n}\n\n// save functions\nwindow.handleLogoChange = async event => {\n const file = event.target.files[0];\n if (!file) return; // If no file selected, return\n\n try {\n // Convert file to base64 string\n const base64String = await fileToBase64(file);\n // Update project.logo with base64String\n project.logo = base64String;\n } catch (error) {\n console.error('Error converting image to base64:', error);\n }\n}\nwindow.fileToBase64 = file => {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = () => resolve(reader.result);\n reader.onerror = error => reject(error);\n });\n}\nwindow.newProject = name => {\n function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }\n const capitalizedTitle = capitalizeFirstLetter(name);\n setPreprocessor('html', 'html');\n setPreprocessor('css', 'css');\n if (name !== \"typescript\") setPreprocessor('javascript', 'javascript');\n if (name === \"typescript\" || name === \"angular\") setPreprocessor('javascript', 'typescript');\n project.name = `${capitalizedTitle} name`;\n project.version = '0.0.1';\n project.title = `A Cool ${capitalizedTitle} App`;\n project.description = `A modern ${capitalizedTitle} application!`;\n project.author = \"kodeWeave\";\n project.url = \"https://michaelsboost.com/\";\n project.module = true;\n project.preview = true;\n if (name === 'angular') project.module = false;\n project.pwa = false;\n\n if (name === 'javascript') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `<div class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span id=\"counter\" class=\"font-mono\">0</span></p>\n <button id=\"incrementButton\" class=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\">\n +\n </button>\n</div>`;\n project.css = ``;\n project.javascript = `let counter = 0;\nconst counterElement = document.getElementById('counter');\nconst incrementButton = document.getElementById('incrementButton');\n\nincrementButton.addEventListener('click', function() {\n counter++;\n counterElement.textContent = counter;\n});`;\n }\n if (name === 'typescript') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `<div class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span id=\"counter\" class=\"font-mono\">0</span></p>\n <button id=\"incrementButton\" class=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\">\n +\n </button>\n</div>`;\n project.css = ``;\n project.javascript = `let counter: number = 0;\nconst counterElement: HTMLElement | null = document.getElementById('counter');\nconst incrementButton: HTMLElement | null = document.getElementById('incrementButton');\n\nif (counterElement && incrementButton) {\n incrementButton.addEventListener('click', function() {\n counter++;\n counterElement.textContent = counter.toString();\n });\n}`;\n }\n if (name === 'react') {\n project.meta = \"\";\n project.libraries = [\n \"https://unpkg.com/react@latest/umd/react.development.js\",\n \"https://unpkg.com/react-dom@latest/umd/react-dom.development.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `<div id=\"root\"></div>`;\n project.css = ``;\n project.javascript = `/** @jsxRuntime classic */\n/** @jsx React.createElement */\nconst { useState } = React;\n\nfunction App() {\n const [counter, setCounter] = useState(0);\n\n return (\n <div className=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 className=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E</h1>\n <p className=\"text-xl mb-4\">Counter: <span id=\"counter\" className=\"font-mono\">{counter}</span></p>\n <button\n id=\"incrementButton\"\n className=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\"\n onClick={() => setCounter(counter + 1)}\n >\n +\n </button>\n </div>\n );\n}\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(<App />);`;\n }\n if (name === 'vue') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/vue/3.2.37/vue.global.prod.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `<div id=\"root\"></div>`;\n project.css = ``;\n project.javascript = `const App = {\n data() {\n return {\n counter: 0,\n message: '\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E'\n };\n },\n methods: {\n incrementCounter() {\n this.counter++;\n }\n },\n template: \\`\n <div class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">{{ message }}</h1>\n <p class=\"text-xl mb-4\">Counter: <span id=\"counter\" class=\"font-mono\">{{ counter }}</span></p>\n <button\n id=\"incrementButton\"\n class=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\"\n @click=\"incrementCounter\"\n >\n +\n </button>\n </div>\n \\`\n};\n\nconst app = Vue.createApp(App);\napp.mount('#root');`;\n }\n if (name === 'preact') {\n project.meta = `<script src=\"https://cdn.jsdelivr.net/npm/alpinejs@3.14.1/dist/cdn.min.js\" defer></script>`;\n project.libraries = [\n \"https://unpkg.com/preact@latest/dist/preact.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `<div id=\"root\"></div>`;\n project.css = ``;\n project.javascript = `/** @jsx h */\nimport { html, render, useState, useEffect } from 'https://unpkg.com/htm@3.1.1/preact/standalone.module.js';\n\nfunction App() {\n const [counter, setCounter] = useState(0);\n\n return html\\`\n <div class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span id=\"counter\" class=\"font-mono\">\\${counter}</span></p>\n <button\n id=\"incrementButton\"\n class=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\"\n onClick=\\${() => setCounter(counter + 1)}\n >\n +\n </button>\n </div>\n \\`;\n}\n\nrender(html\\`<\\${App} />\\`, document.getElementById('root'));`;\n }\n if (name === 'angularold') {\n project.meta = ``;\n project.libraries = [\n \"https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `<div ng-app=\"myApp\" ng-controller=\"MainController\" class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span id=\"counter\" class=\"font-mono\">{{counter}}</span></p>\n <button\n id=\"incrementButton\"\n class=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\"\n ng-click=\"incrementCounter()\"\n >\n +\n </button>\n </div>`;\n project.css = ``;\n project.javascript = `angular.module('myApp', [])\n .controller('MainController', function($scope) {\n $scope.counter = 0;\n $scope.incrementCounter = function() {\n $scope.counter++;\n };\n });`;\n }\n if (name === 'angular') {\n project.meta = ``;\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/rxjs/6.6.3/rxjs.umd.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/core-js/2.5.7/core.js\",\n \"https://unpkg.com/@angular/core@11.0.5/bundles/core.umd.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/zone.js/0.10.3/zone.min.js\",\n \"https://unpkg.com/@angular/common@11.0.5/bundles/common.umd.js\",\n \"https://unpkg.com/@angular/compiler@11.0.5/bundles/compiler.umd.js\",\n \"https://unpkg.com/@angular/platform-browser@11.0.5/bundles/platform-browser.umd.js\",\n \"https://unpkg.com/@angular/platform-browser-dynamic@11.0.5/bundles/platform-browser-dynamic.umd.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `<app-root>Loading...</app-root>`;\n project.css = ``;\n project.javascript = `const { Component, NgModule, enableProdMode } = ng.core;\nconst { BrowserModule } = ng.platformBrowser;\nconst { platformBrowserDynamic } = ng.platformBrowserDynamic;\n\nenableProdMode();\n\n@Component({\n selector: 'app-root',\n template: \\`\n <div class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, Angular 11! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span id=\"counter\" class=\"font-mono\">{{ counter }}</span></p>\n <button\n id=\"incrementButton\"\n class=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\"\n (click)=\"incrementCounter()\"\n >\n +\n </button>\n </div>\n \\`,\n})\nclass AppComponent {\n counter = 0;\n \n incrementCounter() {\n this.counter++;\n }\n}\n\n@NgModule({\n declarations: [AppComponent],\n imports: [BrowserModule],\n bootstrap: [AppComponent]\n})\nclass AppModule {}\n\nplatformBrowserDynamic().bootstrapModule(AppModule);`;\n }\n if (name === 'alpine') {\n project.meta = `<script src=\"https://cdn.jsdelivr.net/npm/alpinejs@3.14.1/dist/cdn.min.js\" defer></script>`;\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `<div x-data=\"{ counter: 0 }\" class=\"flex flex-col items-center justify-center absolute inset-0\">\n <div class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span class=\"font-mono\" x-text=\"counter\"></span></p>\n <button\n class=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\"\n x-on:click=\"counter++\"\n >\n +\n </button>\n </div>\n</div>`;\n project.css = ``;\n project.javascript = ``;\n }\n if (name === 'solid') {\n project.meta = ``;\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `<div id=\"root\"></div>`;\n project.css = ``;\n project.javascript = `import { createSignal } from \"https://cdn.skypack.dev/solid-js@1.2.6\";\nimport { render } from \"https://cdn.skypack.dev/solid-js@1.2.6/web\";\nimport html from \"https://cdn.skypack.dev/solid-js@1.2.6/html\";\n\nfunction Counter() {\n const [count, setCount] = createSignal(0);\n const increment = () => setCount(count() + 1);\n\n return html\\`\n <div class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span class=\"font-mono\">\\${count}</span></p>\n <button type=\"button\" onClick=\\${increment}>\n +\n </button>\n </div>\n \\`;\n}\n\nrender(Counter, document.getElementById(\"root\"));`;\n }\n if (name === 'stimulus') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdn.jsdelivr.net/npm/@hotwired/stimulus@3.1.0/dist/stimulus.umd.js\",\n \"https://cdn.jsdelivr.net/npm/@hotwired/stimulus-loading@1.0.0/dist/stimulus-loading.umd.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `<div data-controller=\"counter\" class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span data-counter-target=\"output\" class=\"font-mono\">0</span></p>\n <button\n data-action=\"click->counter#increment\"\n class=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\"\n >\n +\n </button>\n</div>`;\n project.css = ``;\n project.javascript = `const application = Stimulus.Application.start();\n\napplication.register('counter', class extends Stimulus.Controller {\n static targets = ['output'];\n\n initialize() {\n this.counter = 0;\n }\n\n increment() {\n this.counter += 1;\n this.outputTarget.textContent = this.counter;\n }\n});`;\n }\n if (name === 'mithril') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdn.jsdelivr.net/npm/mithril@2.0.4/mithril.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `<div id=\"root\"></div>`;\n project.css = ``;\n project.javascript = `import htm from 'https://unpkg.com/htm?module'\nconst html = htm.bind(m)\n\nconst app = () => {\n let count = 0\n \n return {\n view: () => html\\`\n <div class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, Mithril! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span class=\"font-mono\">\\${count}</span></p>\n <button onclick=\\${() => count++}>+</button>\n </div>\\`\n }\n}\n\nm.mount(document.getElementById('root'), app)`;\n }\n if (name === 'hyperapp') {\n project.meta = `<script src=\"https://unpkg.com/hyperapp@0.16.0\"></script>`;\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `<h1 id=\"root\"></h1>`;\n project.css = ``;\n project.javascript = `import { app } from 'https://unpkg.com/hyperapp';\nimport html from 'https://unpkg.com/hyperlit';\n\napp({\n init: 0,\n view: count => html\\`\n <div class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, Hyperapp! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span class=\"font-mono\">\\${count}</span></p>\n <button onclick=\\${count => count + 1}>+</button>\n </div>\\`,\n node: document.getElementById('root')\n})`;\n }\n if (name === 'aurelia') {\n project.meta = '<script src=\"https://cdn.jsdelivr.net/npm/aurelia-script@1.4.0\"></script>';\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\"\n ];\n project.html = `<template id=\"root\">\n <div class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span id=\"counter\" class=\"font-mono\">0</span></p>\n <button \n class=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\"\n click.delegate=\"incrementCounter()\">\n +\n </button>\n </div>\n</template>`;\n project.css = ``;\n project.javascript = `class App {\n static $view() {\n return document.querySelector('#root');\n }\n constructor() {\n this.message = '${capitalizedTitle}';\n this.counter = 0;\n }\n incrementCounter() {\n this.counter++;\n document.getElementById('counter').textContent = this.counter;\n }\n}\n\nau.start({ root: App });`;\n }\n if (name === 'lit') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\"\n ];\n project.html = `<my-element></my-element>`;\n project.css = ``;\n project.javascript = `import {LitElement, html} from 'https://cdn.jsdelivr.net/gh/lit/dist@2/core/lit-core.min.js';\n \nclass MyElement extends LitElement {\n static properties = {\n counter: { type: Number }\n };\n\n constructor() {\n super();\n this.counter = 0;\n }\n\n incrementCounter() {\n this.counter++;\n }\n\n render() {\n return html\\`\n <main>\n <h1>\uD83D\uDC4B Hello, ${capitalizedTitle}! \uD83C\uDF0E</h1>\n <p>Counter: \\${this.counter}</p>\n <button @click=\"\\${this.incrementCounter}\">\n +\n </button>\n </main>\n \\`;\n }\n}\ncustomElements.define('my-element', MyElement);`;\n }\n if (name === 'knockout') {\n project.meta = \"\";\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\",\n \"https://cdnjs.cloudflare.com/ajax/libs/knockout/3.5.1/knockout-latest.js\"\n ];\n project.html = `<div class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, Knockout.js! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span class=\"font-mono\" data-bind=\"text: counter\">0</span></p>\n <button class=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\" \n data-bind=\"click: increment\">\n +\n </button>\n</div>`;\n project.css = ``;\n project.javascript = `function AppViewModel() {\n this.counter = ko.observable(0);\n\n this.increment = () => {\n this.counter(this.counter() + 1);\n };\n}\n\nko.applyBindings(new AppViewModel());`;\n }\n if (name === 'moon') {\n project.meta = `<script src=\"https://unpkg.com/moonjs\"></script>`;\n project.libraries = [\n \"https://cdnjs.cloudflare.com/ajax/libs/picocss/2.0.6/pico.min.css\",\n \"https://michaelsboost.com/TailwindCSSMod/tailwind-mod-noreset.min.js\",\n ];\n project.html = `<div id=\"root\" class=\"flex flex-col items-center justify-center absolute inset-0\">\n <h1 class=\"text-3xl font-thin mb-4\">\uD83D\uDC4B Hello, Moon.js! \uD83C\uDF0E</h1>\n <p class=\"text-xl mb-4\">Counter: <span class=\"font-mono\">{{ count }}</span></p>\n <button class=\"px-4 py-2 bg-blue-500 text-white rounded hover:bg-blue-700 transition\" m-on:click=\"increment\">\n +\n </button>\n</div>`;\n project.css = ``;\n project.javascript = `var app = new Moon({\n el: '#root',\n data: {\n count: 0\n },\n methods: {\n increment() {\n this.set('count', this.get('count') + 1);\n }\n }\n});`;\n }\n\n dispatchChanges(editorManager.htmlEditor, project.html);\n dispatchChanges(editorManager.cssEditor, project.css);\n dispatchChanges(editorManager.jsEditor, project.javascript);\n if (name === 'react') setPreprocessor('javascript', 'babel');\n data.demos = false;\n renderPreview(true);\n}\nwindow.importJSON = obj => {\n if (obj === null) return;\n const clone = { ...obj };\n project.autorun = false;\n project.name = obj.name;\n project.version = obj.version;\n project.title = obj.title;\n project.description = obj.description;\n project.author = obj.author;\n project.url = obj.url;\n project.logo = obj.logo;\n project.console = obj.console;\n project.dark = obj.dark;\n project.module = obj.module;\n project.pwa = obj.pwa;\n project.activePanel = obj.activePanel;\n project.preview = obj.preview;\n project.columns = obj.columns;\n project.columnsRight = obj.columnsRight;\n \n // Check and set previewDark state\n if (typeof project.previewDark === 'undefined') {\n project.previewDark = obj.previewDark !== undefined ? obj.previewDark : obj.dark;\n } else {\n project.previewDark = obj.previewDark;\n }\n \n project.meta = obj.meta;\n project.libraries = obj.libraries;\n project.html = obj.html;\n project.css = obj.css;\n project.javascript = obj.javascript;\n\n // Dispatch changes to editors\n if (window.editorManager) {\n dispatchChanges(editorManager.htmlEditor, project.html);\n dispatchChanges(editorManager.cssEditor, project.css);\n dispatchChanges(editorManager.jsEditor, project.javascript);\n }\n\n setPreprocessor('html', obj.html_pre_processor);\n setPreprocessor('css', obj.css_pre_processor);\n setPreprocessor('javascript', obj.javascript_pre_processor);\n project.autorun = clone.autorun;\n}\nwindow.importProject = () => {\n Modal.render({\n title: \"Are you sure you want to load a new project?\",\n content: `<div class=\"p-4 text-center\">All current data will be lost.</div>`,\n onClose: function () {\n data.menuDialog = true;\n },\n onConfirm: function() {\n const input = document.createElement('input');\n input.type = 'file';\n input.accept = '.json';\n\n input.addEventListener('change', (event) => {\n const file = event.target.files[0];\n \n if (!file) {\n console.error('No file selected.');\n return;\n }\n \n const reader = new FileReader();\n \n reader.onload = event => {\n try {\n importJSON(JSON.parse(event.target.result));\n renderPreview(true);\n } catch (error) {\n console.error('Error parsing JSON file:', error);\n }\n };\n \n reader.readAsText(file);\n input.remove();\n });\n \n input.click();\n }\n });\n}\nwindow.getFileNameAndType = url => {\n // Extract the file name with extension from the URL\n const fileName = url.substring(url.lastIndexOf('/') + 1);\n \n // Extract the file extension\n const fileExtension = fileName.split('.').pop().toLowerCase();\n \n // Map file extensions to MIME types\n const mimeTypes = {\n 'jpeg': 'image/jpeg',\n 'jpg': 'image/jpeg',\n 'png': 'image/png',\n 'gif': 'image/gif',\n 'bmp': 'image/bmp',\n 'webp': 'image/webp',\n 'svg': 'image/svg+xml',\n 'mp3': 'audio/mpeg',\n 'wav': 'audio/wav',\n 'ogg': 'audio/ogg',\n 'mp4': 'video/mp4',\n 'webm': 'video/webm',\n 'ogv': 'video/ogg'\n };\n \n // Get the MIME type based on the file extension\n const fileType = mimeTypes[fileExtension] || 'application/octet-stream';\n \n return {\n fileName,\n fileType\n };\n}\nwindow.fetchResources = obj => {\n try {\n const doc = new DOMParser().parseFromString(obj.html, 'text/html');\n const body = doc.body;\n\n const imageResources = [];\n const audioResources = [];\n const vectorResources = [];\n const videoResources = [];\n\n let fileCounter = 1;\n\n // Helper function to check if a string is Base64\n function isBase64(str) {\n return str.startsWith('data:') && str.includes('base64,');\n }\n\n // Helper function to extract file type from Base64 string\n function getBase64FileType(str) {\n const mimeMatch = str.match(/^data:(.*);base64,/);\n if (mimeMatch) {\n const mimeType = mimeMatch[1];\n return mimeTypeToExtension(mimeType);\n }\n return 'unknown';\n }\n\n // Helper function to map MIME types to file extensions\n function mimeTypeToExtension(mimeType) {\n const typeMap = {\n // Images\n 'image/jpeg': 'jpg',\n 'image/png': 'png',\n 'image/gif': 'gif',\n 'image/svg+xml': 'svg',\n 'image/webp': 'webp',\n 'image/tiff': 'tiff',\n 'image/bmp': 'bmp',\n 'image/x-icon': 'ico',\n\n // Audio\n 'audio/mpeg': 'mp3',\n 'audio/wav': 'wav',\n 'audio/ogg': 'ogg',\n 'audio/aac': 'aac',\n 'audio/webm': 'webm',\n 'audio/flac': 'flac',\n\n // Video\n 'video/mp4': 'mp4',\n 'video/webm': 'webm',\n 'video/ogg': 'ogv',\n 'video/avi': 'avi',\n 'video/mpeg': 'mpg',\n 'video/quicktime': 'mov',\n 'video/x-msvideo': 'avi',\n 'video/x-matroska': 'mkv',\n\n // Fallback for unknown types\n 'unknown': 'bin'\n };\n return typeMap[mimeType] || 'bin';\n }\n\n // Helper function to extract file name from URL\n function getFileName(url) {\n return url.substring(url.lastIndexOf('/') + 1);\n }\n\n // Generate a file name for Base64 resources\n function getBase64FileName() {\n return `file-${fileCounter++}`;\n }\n\n // Extract image URLs and filenames\n body.querySelectorAll('img').forEach(img => {\n if (img.hasAttribute('src')) {\n const src = img.getAttribute('src');\n\n if (isBase64(src)) {\n const fileType = getBase64FileType(src);\n const fileName = `${getBase64FileName()}.${fileType}`;\n imageResources.push({ url: src, fileName: fileName });\n img.src = `imgs/${fileName}`;\n } else {\n const fileName = getFileName(src);\n imageResources.push({ url: src, fileName: fileName });\n img.src = `imgs/${getFileNameAndType(src).fileName}`;\n }\n }\n\n if (img.hasAttribute('srcset')) {\n img.srcset.split(',').forEach(srcset => {\n const url = srcset.trim().split(' ')[0];\n if (isBase64(url)) {\n const fileType = getBase64FileType(src);\n const fileName = `${getBase64FileName()}.${fileType}`;\n imageResources.push({ url: url, fileName: fileName });\n img.src = `imgs/${fileName}`;\n } else {\n const fileName = getFileName(url);\n imageResources.push({ url: url, fileName: fileName });\n img.src = `imgs/${getFileNameAndType(img.getAttribute('src')).fileName}`;\n }\n });\n }\n });\n\n // Extract audio URLs and filenames\n body.querySelectorAll('audio').forEach(audio => {\n audio.querySelectorAll('source').forEach(source => {\n if (source.hasAttribute('src')) {\n const src = source.getAttribute('src');\n\n if (isBase64(src)) {\n const fileType = getBase64FileType(src);\n const fileName = `${getBase64FileName()}.${fileType}`;\n audioResources.push({ url: src, fileName: fileName });\n source.src = `audios/${fileName}`;\n } else {\n const fileName = getFileName(src);\n audioResources.push({ url: src, fileName: fileName });\n source.src = `audios/${getFileNameAndType(src).fileName}`;\n }\n }\n });\n });\n\n // Extract vectors\n body.querySelectorAll('svg').forEach(svg => {\n vectorResources.push({ content: svg.outerHTML, fileName: `vector-${vectorResources.length + 1}.svg` });\n });\n\n // Extract video URLs and filenames\n body.querySelectorAll('video').forEach(video => {\n video.querySelectorAll('source').forEach(source => {\n if (source.hasAttribute('src')) {\n const src = source.getAttribute('src');\n\n if (isBase64(src)) {\n const fileType = getBase64FileType(src);\n const fileName = `${getBase64FileName()}.${fileType}`;\n videoResources.push({ url: src, fileName: fileName });\n source.src = `vids/${fileName}`;\n } else {\n const fileName = getFileName(src);\n videoResources.push({ url: src, fileName: fileName });\n source.src = `vids/${getFileNameAndType(src).fileName}`;\n }\n }\n });\n });\n\n // Function to extract and process background images from CSS\n function extractBackgroundImageUrls(css) {\n const urls = [];\n const regex = /background-image\\s*:\\s*url\\(([^)]+)\\)/g;\n let match;\n while ((match = regex.exec(css)) !== null) {\n let url = match[1].replace(/['\"]/g, \"\"); // Remove quotes around URLs\n if (isBase64(url)) {\n const fileType = getBase64FileType(url);\n const fileName = `${getBase64FileName()}.${fileType}`;\n imageResources.push({ url: url, fileName: fileName });\n } else {\n const fileName = getFileName(url);\n imageResources.push({ url: url, fileName: fileName });\n }\n urls.push(url);\n }\n return urls;\n }\n\n // Extract background-image URLs from project CSS\n const projectCss = obj.css || '';\n extractBackgroundImageUrls(projectCss);\n\n return {\n html: doc.body.innerHTML,\n imageResources,\n audioResources,\n vectorResources,\n videoResources\n };\n } catch (error) {\n console.error('Error fetching resources:', error);\n return null; // Or handle the error in an appropriate way\n }\n}\nwindow.getBase64Media = async mediaUrl => {\n const response = await fetch(mediaUrl);\n const blob = await response.blob();\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onloadend = () => resolve(reader.result.split(',')[1]);\n reader.onerror = reject;\n reader.readAsDataURL(blob);\n });\n}\nwindow.downloadJSON = async () => {\n try {\n await loadScript(\"libraries/jszip/FileSaver.min.js\");\n let blob = new Blob([JSON.stringify(project, null, 2)], {type: \"application/json\"});\n saveAs(blob, `${project.name.split(' ').join('').toLowerCase()}-kodeWeave.json`);\n\n } catch (error) {\n console.error('Error:', error);\n } finally {\n // Clean up scripts after use\n removeScript(\"libraries/jszip/FileSaver.min.js\");\n }\n}\nwindow.getFile = async (url, callback = null) => {\n try {\n const response = await fetch(url);\n if (!response.ok) throw new Error(\"Network response was not ok\");\n const fileContent = await response.text();\n if (callback && typeof callback === 'function') {\n callback(null, fileContent); // Call the callback with the file content\n } else {\n return fileContent; // Return the file content\n }\n } catch (error) {\n console.warn(\"Request error:\", error);\n if (callback && typeof callback === 'function') {\n callback(error, null); // Call the callback with the error\n } else {\n throw error; // Re-throw to handle in caller\n }\n }\n}\nwindow.downloadProject = async () => {\n try {\n await loadScripts([\n \"libraries/jszip/jszip.min.js\",\n \"libraries/jszip/FileSaver.min.js\"\n ]);\n\n // Extract srcset URLs\n const iframe = document.getElementById('iframe');\n if (!iframe) return;\n const idoc = iframe.contentDocument || iframe.contentWindow.document;\n const { html, imageResources, audioResources, vectorResources, videoResources } = fetchResources(project);\n\n const zip = new JSZip();\n\n // Project file\n zip.file(`${project.name.split(' ').join('').toLowerCase()}-kodeWeave.json`, JSON.stringify(project, null, 2));\n\n function checkCSSDependencies() {\n if (!twFound && project.css.trim() !== '') {\n return `,\n \"postcss\": \"^8.4.6\",\n \"autoprefixer\": \"^10.4.2\",\n \"cssnano\": \"^5.0.12\"`;\n }\n return '';\n }\n \n function checkJSDependencies() {\n if (project.javascript_pre_processor === 'babel') {\n return `,\n \"@babel/core\": \"^7.15.5\",\n \"@babel/preset-env\": \"^7.15.6\",\n \"@babel/preset-react\": \"^7.14.5\",\n \"rollup-plugin-babel\": \"^4.4.0\"`;\n }\n if (project.javascript_pre_processor === 'typescript') {\n return `,\n \"rollup-plugin-typescript2\": \"^0.31.1\",\n \"typescript\": \"^4.4.3\"`;\n }\n return '';\n }\n\n let rollupInput = ``;\n \n // Rollup Configuration\n let rollupPlugins = `import { terser } from 'rollup-plugin-terser';\n`;\n \n if (project.javascript_pre_processor === 'javascript') {\n rollupInput = `src/script.js`;\n }\n\n if (project.javascript_pre_processor === 'babel') {\n rollupPlugins += `import babel from 'rollup-plugin-babel';\n`;\n rollupInput = `src/script.jsx`;\n }\n \n if (project.javascript_pre_processor === 'typescript') {\n rollupPlugins += `import typescript from 'rollup-plugin-typescript2';\n`;\n rollupInput = `src/script.ts`;\n }\n \n let rollupStr = `${rollupPlugins}\nexport default {\n input: '${rollupInput}', // entry point to your Javascript\n output: {\n file: 'dist/script.js',\n format: ${project.module ? \"'es'\" : \"'iife'\"}, // Immediately Invoked Function Expression, suitable for <script> tags\n name: '${project.name.toLowerCase().split(' ').join('')}'\n },\n plugins: [\n ${project.javascript_pre_processor === 'typescript' ? 'typescript(),' : ''}\n ${project.javascript_pre_processor === 'babel' ? `babel({\n exclude: \"node_modules/**\",\n presets: [\"@babel/preset-env\", \"@babel/preset-react\"]\n }),` : ''}\n terser() // minifies the JavaScript\n ]\n};`;\n zip.file(\"rollup.config.js\", rollupStr);\n \n // Babel Configuration\n if (project.javascript_pre_processor === 'babel') {\n let babelStr = `{\n \"presets\": [\n \"@babel/preset-env\",\n \"@babel/preset-react\"\n ]\n}`;\n zip.file(\"babel.config.json\", babelStr);\n }\n \n // TypeScript Configuration\n if (project.javascript_pre_processor === 'typescript') {\n let tsconfig = `{\n \"compilerOptions\": {\n \"target\": \"ES5\",\n \"module\": \"ESNext\",\n \"moduleResolution\": \"Node\",\n \"jsx\": \"react\",\n \"allowJs\": true,\n \"checkJs\": false,\n \"outDir\": \"./dist\",\n \"strict\": true\n },\n \"include\": [\"src/**/*\"]\n}`;\n zip.file(\"tsconfig.json\", tsconfig);\n }\n\n let licenseStr = `The MIT License (MIT)\nCopyright (c) ${new Date().getFullYear()} ${project.author}\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.`;\n zip.file(\"LICENSE.md\", licenseStr);\n\n let READMEStr = `# ${project.name}\n\nA Weave created on [kodeWeave](https://michaelsboost.com/kodeWeave/go)\n\n${project.description}`;\n zip.file(\"README.md\", READMEStr);\n\n // Always include the original logo\n if (project.logo) {\n try {\n let base64Logo = '';\n \n if (project.logo.startsWith('data:')) {\n // If logo is already a data URL, extract base64 part\n base64Logo = project.logo; // Get the base64 part\n } else {\n // Otherwise fetch and convert to base64\n base64Logo = await getBase64Media(project.logo);\n }\n \n // Determine file extension based on MIME type\n let logoType;\n if (project.logo.startsWith('data:image/png')) {\n logoType = 'png';\n } else if (project.logo.startsWith('data:image/jpeg')) {\n logoType = 'jpeg';\n } else if (project.logo.startsWith('data:image/svg+xml')) {\n logoType = 'svg';\n } else {\n console.error('Unsupported logo MIME type:', project.logo);\n return; // Exit or handle error appropriately\n }\n \n const logoFileName = `logo.${logoType}`;\n zip.folder('imgs').file(logoFileName, base64Logo.split(\",\")[1], { base64: true });\n \n // Add icons to manifest.json based on image sizes\n const sizes = ['192x192', '256x256', '384x384', '512x512'];\n const icons = sizes.map(size => ({\n \"src\": `./imgs/logo-${size}.png`,\n \"sizes\": size,\n \"type\": \"image/png\",\n \"purpose\": \"any\"\n }));\n\n // Helper function to create resized images\n const createResizedImage = (size) => {\n return new Promise((resolve, reject) => {\n const canvas = document.createElement('canvas');\n canvas.width = parseInt(size.split('x')[0]);\n canvas.height = parseInt(size.split('x')[1]);\n const ctx = canvas.getContext('2d');\n \n const img = new Image();\n img.src = base64Logo;\n img.onload = function() {\n ctx.drawImage(img, 0, 0, canvas.width, canvas.height);\n const base64Image = canvas.toDataURL('image/png').replace(/^data:image\\/png;base64,/, '');\n zip.folder('imgs').file(`logo-${size}.png`, base64Image, { base64: true });\n resolve();\n };\n img.onerror = reject;\n \n // Clean up canvas element\n canvas.remove();\n });\n };\n \n // Create all resized images\n await Promise.all(sizes.map(createResizedImage));\n \n zip.file(`manifest.json`, JSON.stringify({\n \"theme_color\": \"#13171f\",\n \"background_color\": \"#13171f\",\n \"display\": \"standalone\",\n \"start_url\": \"./index.html\",\n \"lang\": \"en-US\",\n \"name\": project.name,\n \"short_name\": project.name,\n \"description\": project.description,\n \"icons\": icons\n }, null, 2));\n \n } catch (error) {\n console.error('Error adding logo to ZIP:', error);\n return; // Exit method or handle error as needed\n }\n }\n\n function minifyCSS(cssCode) {\n // Remove comments\n let minified = cssCode.replace(/\\/\\*[\\s\\S]*?\\*\\//g, '');\n // Remove whitespace and newlines\n minified = minified.replace(/\\s{2,}/g, ' ').replace(/\\n/g, '');\n // Remove spaces around selectors, properties, and values\n minified = minified.replace(/\\s*([{}:;])\\s*/g, '$1');\n // Remove the last semicolon before the closing brace\n minified = minified.replace(/;}/g, '}');\n return minified;\n }\n\n let cssContent = '';\n let cssBuildItems = [];\n let cssBuildItemsString = '';\n let TailwindNoReset = null;\n const promises = project.libraries.map(async library => {\n try {\n const data = await getFile(library);\n const parts = library.split(\"/\");\n const name = parts[parts.length - 1];\n\n // Check if the library is one of the Tailwind files to ignore\n if (name === \"tailwind-mod-noreset.min.js\") {\n TailwindNoReset = true;\n }\n \n // Assuming libraries have .css extensions for simplicity\n if (name.endsWith('.css')) {\n cssContent += data + '\\n';\n cssBuildItems.push(name);\n cssBuildItemsString += `libraries/${name} `;\n zip.folder('libraries').file(name, data);\n }\n \n // Assuming libraries have .js extensions for simplicity\n if (name.endsWith('.js')) {\n zip.folder('libraries').file(name, data);\n }\n } catch (error) {\n console.warn(`Failed to fetch library ${library}:`, error);\n }\n });\n await Promise.all(promises);\n\n // Checks css for html\n let cssBuild = '';\n let css4html = '';\n let twFound = '';\n let tailwindDirectives = '';\n let tailwindStyles = '';\n let cssImport = '';\n\n // Find out if user is using tailwind\n if (idoc.getElementById('vyhibnq91')) {\n twFound = true;\n tailwindDirectives = `\n ${!TailwindNoReset ? `@tailwind base;` : ''}\n@tailwind components;\n@tailwind utilities;\n`\n\n if (twFound) {\n cssBuildItems.map(async library => {\n cssImport += `@import '../libraries/${library}';\n`;\n });\n cssImport += tailwindDirectives;\n } else {\n cssImport = cssContent;\n }\n tailwindStyles = idoc.getElementById('vyhibnq91').textContent;\n\n // Tailwind config\n if (twFound) {\n let twJS = \"\";\n if (project.javascript_pre_processor === \"javascript\") {\n twJS = `\n './src/**/*.js',`;\n }\n if (project.javascript_pre_processor === \"babel\") {\n twJS = `\n './src/**/*.jsx',`;\n }\n if (project.javascript_pre_processor === \"typescript\") {\n twJS = `\n './src/**/*.ts',`;\n }\n let configCode = `module.exports = {\n content: [\n './src/**/*.html',${twJS}\n ],\n theme: {\n extend: {},\n },\n plugins: [],\n };`\n zip.file(\"tailwind.config.js\", configCode);\n }\n }\n\n // Add style.css & tailwind build\n if (cssContent && project.css) {\n css4html = `<link rel=\"stylesheet\" href=\"dist/bundle.css\">\n `;\n cssBuild = `\"build:css\": \"postcss src/bundle.css -o dist/bundle.css\",`;\n zip.file(\"src/style.css\", project.css + cssImport);\n zip.file(\"src/bundle.css\", cssImport + project.css);\n zip.file('dist/bundle.css', minifyCSS(cssContent + tailwindStyles + project.css));\n }\n if (cssContent && !project.css) {\n css4html = `<link rel=\"stylesheet\" href=\"dist/bundle.css\">\n `;\n cssBuild = `\"build:css\": \"postcss src/bundle.css -o dist/bundle.css\",`;\n zip.file(\"src/bundle.css\", cssImport);\n zip.file('dist/bundle.css', minifyCSS(cssContent + tailwindStyles));\n }\n if (!cssContent && project.css) {\n css4html = `<link rel=\"stylesheet\" href=\"dist/bundle.css\">\n `;\n cssBuild = `\"build:css\": \"postcss src/bundle.css -o dist/bundle.css\",`;\n zip.file(\"src/bundle.css\", project.css + cssImport);\n zip.file(\"src/style.css\", project.css);\n zip.file('dist/bundle.css', minifyCSS(tailwindStyles + project.css));\n }\n\n // Nodejs Package JSON\n let npmBuildConditions = '';\n if (cssBuild && !project.javascript) {\n npmBuildConditions = `\"build\": \"npm run build:css\",`\n }\n if (!cssBuild && project.javascript) {\n npmBuildConditions = `\"build\": \"npm run build:js\",`\n }\n if (cssBuild && project.javascript) {\n npmBuildConditions = `\"build\": \"npm run build:css && npm run build:js\",`\n }\n\n let nodeStr = `{\n \"name\": \"${project.name.toLowerCase().split(' ').join('')}\",\n \"version\": \"${project.version}\",\n \"type\": \"module\",\n \"scripts\": {\n ${cssBuild}\n ${project.javascript ? '\"build:js\": \"rollup -c\",' : ''}\n ${npmBuildConditions}\n \"serve\": \"http-server -c-1 -p 8081\"\n },\n \"devDependencies\": {\n ${cssBuild || twFound ? `\"autoprefixer\": \"^10.4.19\",\n \"postcss\": \"^8.4.38\",\n \"postcss-import\": \"^16.1.0\",\n \"cssnano\": \"^7.0.2\",${twFound ? `\n \"tailwindcss\": \"^3.4.4\",` : ''}` : ''}\n \"rollup\": \"^2.79.1\",\n \"rollup-plugin-terser\": \"^7.0.2\",\n \"terser\": \"^5.10.0\",\n \"http-server\": \"^14.1.1\"${checkCSSDependencies()}${checkJSDependencies()}\n }\n}`;\n zip.file(\"package.json\", nodeStr);\n\n // PostCSS config\n if (cssBuild) {\n zip.file(\"postcss.config.cjs\", `module.exports = {\n plugins: [\n require('postcss-import'),\n require('autoprefixer'),${twFound ? `\n require('tailwindcss'),` : ''}\n require('cssnano')({\n preset: ['default', {\n discardComments: { removeAll: true }, // Remove all comments\n }],\n }),\n ],\n};`);\n }\n\n // if pwa is enabled\n let swinit = '';\n if (project.pwa) {\n swinit = `\n <script src=\"https://storage.googleapis.com/workbox-cdn/releases/6.4.1/workbox-sw.js\"></script>\n <script>\n // service worker for progressive web app\n if ('serviceWorker' in navigator) {\n window.addEventListener('load', () => {\n navigator.serviceWorker.register('./sw.js')\n })\n }\n </script>`;\n const swjs = `// Service worker code\nimportScripts('https://storage.googleapis.com/workbox-cdn/releases/6.4.1/workbox-sw.js');\n\nconst { registerRoute } = workbox.routing;\nconst { CacheFirst } = workbox.strategies;\n\nconst cacheName = '${project.name.split(' ').join('')}-cache';\n\nworkbox.routing.registerRoute(\n({ request }) => request.destination === 'script' ||\n request.destination === 'style' ||\n request.destination === 'document' ||\n request.destination === 'image' ||\n request.destination === 'font' ||\n request.destination === 'audio' ||\n request.destination === 'video',\nnew CacheFirst({\ncacheName: cacheName,\nplugins: [\n// Any additional plugins can be added here\n],\n})\n);`\n zip.file(\"sw.js\", swjs);\n }\n\n // Iterate over each library\n let scriptTags = '';\n let scriptTagsTWChecked = '';\n let cssTags = '';\n let gFonts = '';\n project.libraries.forEach(library => {\n if (library.endsWith('.js')) {\n scriptTags += `<script src=\"${library}\"></script>\\n `;\n if (twFound && (library.startsWith('https://michaelsboost.com/TailwindCSSMod/') || library.startsWith('http://michaelsboost.com/TailwindCSSMod/') || library.startsWith('//michaelsboost.com/TailwindCSSMod/'))) return;\n scriptTagsTWChecked += `<script src=\"${library}\"></script>\\n `;\n } else if (library.endsWith('.css')) {\n cssTags += `<link href=\"${library}\" rel=\"stylesheet\">\\n `;\n } else {\n // Assuming it's a Google font\n gFonts += `<link href=\"${library}\" rel=\"stylesheet\">\\n `;\n }\n });\n\n async function minifyJS(jsCode) {\n // detect if terser exists\n if (!document.querySelector(\"script[src='libraries/terser/bundle.min.js']\")) {\n await loadScript(\"libraries/terser/bundle.min.js\");\n }\n return Terser.minify(jsCode);\n }\n\n let minifiedJS = await minifyJS(await compileCode('javascript'));\n minifiedJS = minifiedJS.code;\n\n // Add script.js\n zip.file(`${rollupInput}`, project.javascript);\n if (project.javascript_pre_processor === 'javascript') zip.file('dist/script.js', project.javascript);\n if (project.javascript_pre_processor === 'babel') zip.file('dist/script.js', minifiedJS);\n if (project.javascript_pre_processor === 'typescript') zip.file('dist/script.js', minifiedJS);\n\n // script tag for test.html\n let placeScript = `<script src=\"dist/script.js\" ${project.module ? 'type=\"module\"' : ''}></script>`;\n if (project.javascript_pre_processor === 'babel') {\n const library = \"libraries/preprocessors/babel.min.js\";\n const data = await getFile(library);\n const parts = library.split(\"/\");\n const name = parts[parts.length - 1];\n\n zip.folder('libraries').file(name, data);\n\n placeScript = `<script src=\"libraries/babel.min.js\"></script>\n <script type=\"text/babel\" src=\"src/script.jsx\" ${project.module ? 'data-type=\"module\"' : ''}></script>`;\n }\n if (project.javascript_pre_processor === 'typescript') {\n let library = \"libraries/preprocessors/typescript.min.js\";\n let data = await getFile(library);\n let parts = library.split(\"/\");\n let name = parts[parts.length - 1];\n zip.folder('libraries').file(name, data);\n\n library = \"libraries/preprocessors/typescript.compile.min.js\";\n data = await getFile(library);\n parts = library.split(\"/\");\n name = parts[parts.length - 1];\n zip.folder('libraries').file(name, data);\n\n placeScript = `<script type=\"text/typescript\" src=\"src/script.ts\"></script>\n <script type=\"text/javascript\" src=\"libraries/typescript.min.js\"></script>\n <script type=\"text/javascript\" src=\"libraries/typescript.compile.min.js\"></script>`;\n }\n \n // Add index.html\n const indexHtmlContent = `<!DOCTYPE html>\n<html lang=\"en\" data-theme=\"${project.previewDark ? 'dark' : 'light'}\">\n <head>\n <title>${project.title}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ${gFonts}${cssTags ? cssTags : ''}${project.meta ? `${project.meta}\\n ` : ''}\n ${twFound ? \n cssContent ? `` : `` \n : ``}\n \n \n\n${html}\n\n ${scriptTags ? scriptTags : ''}\n ${project.javascript ? placeScript : ''}\n \n`;\n const indexHtmlContentCompiled = `\n\n \n ${project.title}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n ${gFonts}${css4html}${project.meta ? `${project.meta}\\n ` : ''}${scriptTags ? twFound ? scriptTagsTWChecked : scriptTags : ''}\n \n \n \n${html}\n\n ${project.javascript ? `` : ''}${(project.pwa ? swinit : '')}\n \n`;\n zip.file('test.html', indexHtmlContent);\n zip.file('index.html', indexHtmlContentCompiled);\n if (project.html_pre_processor === 'html') zip.file('src/source.html', project.html);\n if (project.html_pre_processor === 'markdown') zip.file('src/source.md', project.html);\n if (project.html_pre_processor === 'pug') zip.file('src/source.pug', project.html);\n if (project.html_pre_processor === 'jade') zip.file('src/source.jade', project.html);\n\n // Save audio files to ZIP\n if (audioResources.length > 0) {\n const audioFolder = zip.folder('audios');\n try {\n for (const { url, fileName } of audioResources) {\n const base64Audio = await getBase64Media(url);\n audioFolder.file(fileName, base64Audio, { base64: true });\n }\n } catch (error) {\n console.error('Error adding audio to ZIP:', error);\n return;\n }\n }\n\n // Save image files to ZIP\n if (imageResources.length > 0) {\n try {\n for (const { url, fileName } of imageResources) {\n const base64Image = await getBase64Media(url);\n zip.folder('imgs').file(fileName, base64Image, { base64: true });\n }\n } catch (error) {\n console.error('Error adding images to ZIP:', error);\n return;\n }\n }\n\n // Save SVG files to ZIP\n if (vectorResources.length > 0) {\n const svgFolder = zip.folder('svgs');\n try {\n for (const { content, fileName } of vectorResources) {\n svgFolder.file(fileName, content);\n }\n } catch (error) {\n console.error('Error adding SVGs to ZIP:', error);\n return;\n }\n }\n\n // Save video files to ZIP\n if (videoResources.length > 0) {\n const videoFolder = zip.folder('vids');\n try {\n for (const { url, fileName } of videoResources) {\n const base64Video = await getBase64Media(url);\n videoFolder.file(fileName, base64Video, { base64: true });\n }\n } catch (error) {\n console.error('Error adding videos to ZIP:', error);\n return;\n }\n }\n\n // Generate the ZIP file\n const blob = await zip.generateAsync({ type: 'blob' });\n saveAs(blob, `${project.name.toLowerCase().split(' ').join('')}.zip`);\n \n // Clear all arrays after saving\n imageResources.length = audioResources.length = vectorResources.length = videoResources.length = 0;\n } catch (error) {\n console.error('Error:', error);\n } finally {\n // Clean up scripts after use\n const scriptsToRemove = [\n 'libraries/jszip/FileSaver.min.js',\n 'libraries/jszip/jszip.min.js'\n ];\n\n removeScripts(scriptsToRemove);\n }\n}\nwindow.share = async () => {\n try {\n if (navigator.onLine) {\n let jsPreprocessor = null;\n if (project.javascript_pre_processor === 'javascript') {\n jsPreprocessor = \"none\";\n } else {\n jsPreprocessor = project.javascript_pre_processor;\n }\n\n const shareProject = {\n title: project.title,\n description: project.description,\n head: project.meta,\n html: project.html,\n html_pre_processor: project.html_pre_processor === \"html\" ? \"none\" : \"\",\n css: project.css,\n css_pre_processor: project.css_pre_processor === \"css\" ? \"none\" : \"\",\n css_external: project.libraries.filter(lib => lib.endsWith('.css')).join(';'),\n css_starter: \"neither\",\n css_prefix: \"neither\",\n js_module: project.module,\n js: `document.documentElement.setAttribute('data-theme', '${project.previewDark ? 'dark' : 'light'}');\n \n${project.javascript}`,\n js_pre_processor: jsPreprocessor,\n js_external: project.libraries.filter(lib => lib.endsWith('.js')).join(';'),\n editors: '111',\n layout: 'left'\n };\n\n // Stringify the JSON object and escape quotes\n const JSONstring = JSON.stringify(shareProject)\n .replace(/\"/g, \""\")\n .replace(/'/g, \"'\");\n\n // Create form element\n const form = `\n
\n \n \n
`;\n\n // Append form to the document body and submit\n document.body.insertAdjacentHTML('beforeend', form);\n document.querySelector('form').submit();\n document.querySelector('form').remove();\n } else {\n Modal.render({\n title: \"Unable to share!\",\n content: `
No internet connection!
`\n });\n }\n } catch (error) {\n console.error('Error sharing project:', error);\n }\n}\n\nwindow.screenshot = async () => {\n const iframe = document.getElementById('iframe');\n const iframeDocument = iframe.contentDocument || iframe.contentWindow.document;\n\n try {\n await loadScripts([\n \"libraries/html2canvas/html2canvas.min.js\",\n \"libraries/jszip/FileSaver.min.js\"\n ]);\n \n html2canvas(iframeDocument.documentElement).then(canvas => {\n const context = canvas.getContext('2d');\n const videoElements = iframeDocument.getElementsByTagName('video');\n\n // Draw video elements\n Array.from(videoElements).forEach(video => {\n const { currentTime, paused, volume } = video;\n\n // Set volume to 0 for the screenshot process\n video.volume = 0;\n\n // Draw the video frame\n if (!paused) video.pause();\n context.drawImage(video, video.offsetLeft, video.offsetTop, video.clientWidth, video.clientHeight);\n\n // Restore the original volume and playback state\n video.volume = volume;\n video.currentTime = currentTime;\n if (!paused) video.play();\n });\n\n // Convert canvas to Blob\n canvas.toBlob(blob => {\n // Save the Blob using FileSaver.js\n saveAs(blob, 'screenshot.png');\n }, 'image/png');\n }).catch(error => {\n console.error('Error taking screenshot:', error);\n });\n } catch (error) {\n console.error('Error:', error);\n } finally {\n // Clean up scripts after use\n removeScript(\"../libraries/html2canvas/html2canvas.min.js\");\n removeScript(\"../libraries/jszip/FileSaver.min.js\");\n }\n}\nwindow.createBlobURL = (content, type) => {\n const blob = new Blob([content], { type });\n return URL.createObjectURL(blob);\n}\nwindow.renderPreview = async (forceRun = false) => {\n const iframe = document.getElementById('iframe');\n if (!iframe) return;\n\n let scriptTags = '';\n let cssTags = '';\n project.libraries.forEach(library => {\n if (library.endsWith('.js')) {\n scriptTags += `\\n `;\n } else if (library.endsWith('.css')) {\n cssTags += `\\n `;\n } else {\n cssTags += `\\n `;\n }\n });\n\n const javascriptCode = await compileCode('javascript');\n const cssCode = await compileCode('css');\n const consoleCSS = `[data-zwj=zwjkonsole] {\n display: ${project.console ? 'flex' : 'none'};\n}\n\n`\n\n const domconsoleContent = await fetch('libraries/domconsole/dom-console-mod.min.js').then(response => response.text());\n let jsLink = createBlobURL(javascriptCode, 'application/javascript');\n const iframeSrc = `\n \n ${project.title}\n \n \n \n \n ${project.meta ? project.meta : ''}\n ${cssTags}\n \n \n \n \n ${await compileCode('html')}\n ${scriptTags ? scriptTags : ''}\n ${project.css_pre_processor === 'less' ? '' : ''}\n \n \n`;\n const newHtmlBlobURL = createBlobURL(iframeSrc, 'text/html');\n\n if (forceRun) {\n iframe.setAttribute('src', newHtmlBlobURL);\n }\n}\n\n// Diffing algorithm to update ui when changes occur\nwindow.diffNodes = (oldNode, newNode) => {\n if (!oldNode || !newNode) {\n return;\n }\n\n // Check for data-ignore attribute\n if (oldNode.hasAttribute && oldNode.hasAttribute('data-ignore') || \n newNode.hasAttribute && newNode.hasAttribute('data-ignore')) {\n return;\n }\n\n // Check if nodes are iframe elements\n if (oldNode.nodeName === 'IFRAME' && newNode.nodeName === 'IFRAME') {\n const acceptableIframeAttributes = ['id', 'title', 'class', 'style', 'sandbox'];\n // Compare acceptable attributes only\n acceptableIframeAttributes.forEach(attr => {\n if (oldNode.getAttribute(attr) !== newNode.getAttribute(attr)) {\n oldNode.setAttribute(attr, newNode.getAttribute(attr));\n }\n });\n\n const oldSrcdoc = oldNode.getAttribute('srcdoc');\n const newSrcdoc = newNode.getAttribute('srcdoc');\n // Ignore srcdoc attribute if it hasn't changed\n if (oldSrcdoc === newSrcdoc) return;\n return;\n }\n\n // If nodes are different types, replace the old node\n if (oldNode.nodeName !== newNode.nodeName) {\n oldNode.replaceWith(newNode.cloneNode(true));\n // console.log('Different node names:', oldNode, newNode);\n return;\n }\n\n // Diff the attributes of the nodes\n if (oldNode.nodeType === Node.ELEMENT_NODE && newNode.nodeType === Node.ELEMENT_NODE) {\n const oldAttributes = Array.from(oldNode.attributes);\n const newAttributes = Array.from(newNode.attributes);\n\n // Remove old attributes not present in the new node\n oldAttributes.forEach(attr => {\n if (!newNode.hasAttribute(attr.name)) {\n oldNode.removeAttribute(attr.name);\n }\n });\n\n // Add or update attributes from the new node\n newAttributes.forEach(attr => {\n if (oldNode.getAttribute(attr.name) !== attr.value) {\n oldNode.setAttribute(attr.name, attr.value);\n }\n });\n }\n\n const oldChildren = Array.from(oldNode.childNodes);\n const newChildren = Array.from(newNode.childNodes);\n\n // Update or remove existing child nodes\n oldChildren.forEach((oldChild, index) => {\n const newChild = newChildren[index];\n if (!newChild) {\n oldNode.removeChild(oldChild);\n return;\n }\n // Special handling for elements\n if (oldNode.tagName === 'TITLE' || oldNode.tagName === 'STYLE' && oldNode.textContent !== newNode.textContent) {\n oldNode.textContent = newNode.textContent;\n } else if (oldChild.nodeType === Node.TEXT_NODE && oldChild.nodeValue !== newChild.nodeValue) {\n oldChild.nodeValue = newChild.nodeValue;\n }\n diffNodes(oldChild, newChild);\n });\n\n // Add new child nodes\n newChildren.slice(oldChildren.length).forEach(newChild => {\n oldNode.appendChild(newChild.cloneNode(true));\n });\n}\n\n// Once dom has loaded init functions\ndocument.addEventListener('DOMContentLoaded', function() {\n window.onload = () => {\n App.render('#app');\n if (window.initEditors) initEditors();\n getIFrameClientSize();\n\n if (localStorage.getItem('kodeWeave')) {\n importJSON(JSON.parse(localStorage.getItem('kodeWeave')));\n renderPreview(true);\n }\n }\n window.onresize = () => getIFrameClientSize();\n});", "(function () {\n 'use strict';\n\n /**\n The data structure for documents. @nonabstract\n */\n class Text {\n /**\n Get the line description around the given position.\n */\n lineAt(pos) {\n if (pos < 0 || pos > this.length)\n throw new RangeError(`Invalid position ${pos} in document of length ${this.length}`);\n return this.lineInner(pos, false, 1, 0);\n }\n /**\n Get the description for the given (1-based) line number.\n */\n line(n) {\n if (n < 1 || n > this.lines)\n throw new RangeError(`Invalid line number ${n} in ${this.lines}-line document`);\n return this.lineInner(n, true, 1, 0);\n }\n /**\n Replace a range of the text with the given content.\n */\n replace(from, to, text) {\n [from, to] = clip(this, from, to);\n let parts = [];\n this.decompose(0, from, parts, 2 /* Open.To */);\n if (text.length)\n text.decompose(0, text.length, parts, 1 /* Open.From */ | 2 /* Open.To */);\n this.decompose(to, this.length, parts, 1 /* Open.From */);\n return TextNode.from(parts, this.length - (to - from) + text.length);\n }\n /**\n Append another document to this one.\n */\n append(other) {\n return this.replace(this.length, this.length, other);\n }\n /**\n Retrieve the text between the given points.\n */\n slice(from, to = this.length) {\n [from, to] = clip(this, from, to);\n let parts = [];\n this.decompose(from, to, parts, 0);\n return TextNode.from(parts, to - from);\n }\n /**\n Test whether this text is equal to another instance.\n */\n eq(other) {\n if (other == this)\n return true;\n if (other.length != this.length || other.lines != this.lines)\n return false;\n let start = this.scanIdentical(other, 1), end = this.length - this.scanIdentical(other, -1);\n let a = new RawTextCursor(this), b = new RawTextCursor(other);\n for (let skip = start, pos = start;;) {\n a.next(skip);\n b.next(skip);\n skip = 0;\n if (a.lineBreak != b.lineBreak || a.done != b.done || a.value != b.value)\n return false;\n pos += a.value.length;\n if (a.done || pos >= end)\n return true;\n }\n }\n /**\n Iterate over the text. When `dir` is `-1`, iteration happens\n from end to start. This will return lines and the breaks between\n them as separate strings.\n */\n iter(dir = 1) { return new RawTextCursor(this, dir); }\n /**\n Iterate over a range of the text. When `from` > `to`, the\n iterator will run in reverse.\n */\n iterRange(from, to = this.length) { return new PartialTextCursor(this, from, to); }\n /**\n Return a cursor that iterates over the given range of lines,\n _without_ returning the line breaks between, and yielding empty\n strings for empty lines.\n \n When `from` and `to` are given, they should be 1-based line numbers.\n */\n iterLines(from, to) {\n let inner;\n if (from == null) {\n inner = this.iter();\n }\n else {\n if (to == null)\n to = this.lines + 1;\n let start = this.line(from).from;\n inner = this.iterRange(start, Math.max(start, to == this.lines + 1 ? this.length : to <= 1 ? 0 : this.line(to - 1).to));\n }\n return new LineCursor(inner);\n }\n /**\n Return the document as a string, using newline characters to\n separate lines.\n */\n toString() { return this.sliceString(0); }\n /**\n Convert the document to an array of lines (which can be\n deserialized again via [`Text.of`](https://codemirror.net/6/docs/ref/#state.Text^of)).\n */\n toJSON() {\n let lines = [];\n this.flatten(lines);\n return lines;\n }\n /**\n @internal\n */\n constructor() { }\n /**\n Create a `Text` instance for the given array of lines.\n */\n static of(text) {\n if (text.length == 0)\n throw new RangeError(\"A document must have at least one line\");\n if (text.length == 1 && !text[0])\n return Text.empty;\n return text.length <= 32 /* Tree.Branch */ ? new TextLeaf(text) : TextNode.from(TextLeaf.split(text, []));\n }\n }\n // Leaves store an array of line strings. There are always line breaks\n // between these strings. Leaves are limited in size and have to be\n // contained in TextNode instances for bigger documents.\n class TextLeaf extends Text {\n constructor(text, length = textLength(text)) {\n super();\n this.text = text;\n this.length = length;\n }\n get lines() { return this.text.length; }\n get children() { return null; }\n lineInner(target, isLine, line, offset) {\n for (let i = 0;; i++) {\n let string = this.text[i], end = offset + string.length;\n if ((isLine ? line : end) >= target)\n return new Line$1(offset, end, line, string);\n offset = end + 1;\n line++;\n }\n }\n decompose(from, to, target, open) {\n let text = from <= 0 && to >= this.length ? this\n : new TextLeaf(sliceText(this.text, from, to), Math.min(to, this.length) - Math.max(0, from));\n if (open & 1 /* Open.From */) {\n let prev = target.pop();\n let joined = appendText(text.text, prev.text.slice(), 0, text.length);\n if (joined.length <= 32 /* Tree.Branch */) {\n target.push(new TextLeaf(joined, prev.length + text.length));\n }\n else {\n let mid = joined.length >> 1;\n target.push(new TextLeaf(joined.slice(0, mid)), new TextLeaf(joined.slice(mid)));\n }\n }\n else {\n target.push(text);\n }\n }\n replace(from, to, text) {\n if (!(text instanceof TextLeaf))\n return super.replace(from, to, text);\n [from, to] = clip(this, from, to);\n let lines = appendText(this.text, appendText(text.text, sliceText(this.text, 0, from)), to);\n let newLen = this.length + text.length - (to - from);\n if (lines.length <= 32 /* Tree.Branch */)\n return new TextLeaf(lines, newLen);\n return TextNode.from(TextLeaf.split(lines, []), newLen);\n }\n sliceString(from, to = this.length, lineSep = \"\\n\") {\n [from, to] = clip(this, from, to);\n let result = \"\";\n for (let pos = 0, i = 0; pos <= to && i < this.text.length; i++) {\n let line = this.text[i], end = pos + line.length;\n if (pos > from && i)\n result += lineSep;\n if (from < end && to > pos)\n result += line.slice(Math.max(0, from - pos), to - pos);\n pos = end + 1;\n }\n return result;\n }\n flatten(target) {\n for (let line of this.text)\n target.push(line);\n }\n scanIdentical() { return 0; }\n static split(text, target) {\n let part = [], len = -1;\n for (let line of text) {\n part.push(line);\n len += line.length + 1;\n if (part.length == 32 /* Tree.Branch */) {\n target.push(new TextLeaf(part, len));\n part = [];\n len = -1;\n }\n }\n if (len > -1)\n target.push(new TextLeaf(part, len));\n return target;\n }\n }\n // Nodes provide the tree structure of the `Text` type. They store a\n // number of other nodes or leaves, taking care to balance themselves\n // on changes. There are implied line breaks _between_ the children of\n // a node (but not before the first or after the last child).\n class TextNode extends Text {\n constructor(children, length) {\n super();\n this.children = children;\n this.length = length;\n this.lines = 0;\n for (let child of children)\n this.lines += child.lines;\n }\n lineInner(target, isLine, line, offset) {\n for (let i = 0;; i++) {\n let child = this.children[i], end = offset + child.length, endLine = line + child.lines - 1;\n if ((isLine ? endLine : end) >= target)\n return child.lineInner(target, isLine, line, offset);\n offset = end + 1;\n line = endLine + 1;\n }\n }\n decompose(from, to, target, open) {\n for (let i = 0, pos = 0; pos <= to && i < this.children.length; i++) {\n let child = this.children[i], end = pos + child.length;\n if (from <= end && to >= pos) {\n let childOpen = open & ((pos <= from ? 1 /* Open.From */ : 0) | (end >= to ? 2 /* Open.To */ : 0));\n if (pos >= from && end <= to && !childOpen)\n target.push(child);\n else\n child.decompose(from - pos, to - pos, target, childOpen);\n }\n pos = end + 1;\n }\n }\n replace(from, to, text) {\n [from, to] = clip(this, from, to);\n if (text.lines < this.lines)\n for (let i = 0, pos = 0; i < this.children.length; i++) {\n let child = this.children[i], end = pos + child.length;\n // Fast path: if the change only affects one child and the\n // child's size remains in the acceptable range, only update\n // that child\n if (from >= pos && to <= end) {\n let updated = child.replace(from - pos, to - pos, text);\n let totalLines = this.lines - child.lines + updated.lines;\n if (updated.lines < (totalLines >> (5 /* Tree.BranchShift */ - 1)) &&\n updated.lines > (totalLines >> (5 /* Tree.BranchShift */ + 1))) {\n let copy = this.children.slice();\n copy[i] = updated;\n return new TextNode(copy, this.length - (to - from) + text.length);\n }\n return super.replace(pos, end, updated);\n }\n pos = end + 1;\n }\n return super.replace(from, to, text);\n }\n sliceString(from, to = this.length, lineSep = \"\\n\") {\n [from, to] = clip(this, from, to);\n let result = \"\";\n for (let i = 0, pos = 0; i < this.children.length && pos <= to; i++) {\n let child = this.children[i], end = pos + child.length;\n if (pos > from && i)\n result += lineSep;\n if (from < end && to > pos)\n result += child.sliceString(from - pos, to - pos, lineSep);\n pos = end + 1;\n }\n return result;\n }\n flatten(target) {\n for (let child of this.children)\n child.flatten(target);\n }\n scanIdentical(other, dir) {\n if (!(other instanceof TextNode))\n return 0;\n let length = 0;\n let [iA, iB, eA, eB] = dir > 0 ? [0, 0, this.children.length, other.children.length]\n : [this.children.length - 1, other.children.length - 1, -1, -1];\n for (;; iA += dir, iB += dir) {\n if (iA == eA || iB == eB)\n return length;\n let chA = this.children[iA], chB = other.children[iB];\n if (chA != chB)\n return length + chA.scanIdentical(chB, dir);\n length += chA.length + 1;\n }\n }\n static from(children, length = children.reduce((l, ch) => l + ch.length + 1, -1)) {\n let lines = 0;\n for (let ch of children)\n lines += ch.lines;\n if (lines < 32 /* Tree.Branch */) {\n let flat = [];\n for (let ch of children)\n ch.flatten(flat);\n return new TextLeaf(flat, length);\n }\n let chunk = Math.max(32 /* Tree.Branch */, lines >> 5 /* Tree.BranchShift */), maxChunk = chunk << 1, minChunk = chunk >> 1;\n let chunked = [], currentLines = 0, currentLen = -1, currentChunk = [];\n function add(child) {\n let last;\n if (child.lines > maxChunk && child instanceof TextNode) {\n for (let node of child.children)\n add(node);\n }\n else if (child.lines > minChunk && (currentLines > minChunk || !currentLines)) {\n flush();\n chunked.push(child);\n }\n else if (child instanceof TextLeaf && currentLines &&\n (last = currentChunk[currentChunk.length - 1]) instanceof TextLeaf &&\n child.lines + last.lines <= 32 /* Tree.Branch */) {\n currentLines += child.lines;\n currentLen += child.length + 1;\n currentChunk[currentChunk.length - 1] = new TextLeaf(last.text.concat(child.text), last.length + 1 + child.length);\n }\n else {\n if (currentLines + child.lines > chunk)\n flush();\n currentLines += child.lines;\n currentLen += child.length + 1;\n currentChunk.push(child);\n }\n }\n function flush() {\n if (currentLines == 0)\n return;\n chunked.push(currentChunk.length == 1 ? currentChunk[0] : TextNode.from(currentChunk, currentLen));\n currentLen = -1;\n currentLines = currentChunk.length = 0;\n }\n for (let child of children)\n add(child);\n flush();\n return chunked.length == 1 ? chunked[0] : new TextNode(chunked, length);\n }\n }\n Text.empty = /*@__PURE__*/new TextLeaf([\"\"], 0);\n function textLength(text) {\n let length = -1;\n for (let line of text)\n length += line.length + 1;\n return length;\n }\n function appendText(text, target, from = 0, to = 1e9) {\n for (let pos = 0, i = 0, first = true; i < text.length && pos <= to; i++) {\n let line = text[i], end = pos + line.length;\n if (end >= from) {\n if (end > to)\n line = line.slice(0, to - pos);\n if (pos < from)\n line = line.slice(from - pos);\n if (first) {\n target[target.length - 1] += line;\n first = false;\n }\n else\n target.push(line);\n }\n pos = end + 1;\n }\n return target;\n }\n function sliceText(text, from, to) {\n return appendText(text, [\"\"], from, to);\n }\n class RawTextCursor {\n constructor(text, dir = 1) {\n this.dir = dir;\n this.done = false;\n this.lineBreak = false;\n this.value = \"\";\n this.nodes = [text];\n this.offsets = [dir > 0 ? 1 : (text instanceof TextLeaf ? text.text.length : text.children.length) << 1];\n }\n nextInner(skip, dir) {\n this.done = this.lineBreak = false;\n for (;;) {\n let last = this.nodes.length - 1;\n let top = this.nodes[last], offsetValue = this.offsets[last], offset = offsetValue >> 1;\n let size = top instanceof TextLeaf ? top.text.length : top.children.length;\n if (offset == (dir > 0 ? size : 0)) {\n if (last == 0) {\n this.done = true;\n this.value = \"\";\n return this;\n }\n if (dir > 0)\n this.offsets[last - 1]++;\n this.nodes.pop();\n this.offsets.pop();\n }\n else if ((offsetValue & 1) == (dir > 0 ? 0 : 1)) {\n this.offsets[last] += dir;\n if (skip == 0) {\n this.lineBreak = true;\n this.value = \"\\n\";\n return this;\n }\n skip--;\n }\n else if (top instanceof TextLeaf) {\n // Move to the next string\n let next = top.text[offset + (dir < 0 ? -1 : 0)];\n this.offsets[last] += dir;\n if (next.length > Math.max(0, skip)) {\n this.value = skip == 0 ? next : dir > 0 ? next.slice(skip) : next.slice(0, next.length - skip);\n return this;\n }\n skip -= next.length;\n }\n else {\n let next = top.children[offset + (dir < 0 ? -1 : 0)];\n if (skip > next.length) {\n skip -= next.length;\n this.offsets[last] += dir;\n }\n else {\n if (dir < 0)\n this.offsets[last]--;\n this.nodes.push(next);\n this.offsets.push(dir > 0 ? 1 : (next instanceof TextLeaf ? next.text.length : next.children.length) << 1);\n }\n }\n }\n }\n next(skip = 0) {\n if (skip < 0) {\n this.nextInner(-skip, (-this.dir));\n skip = this.value.length;\n }\n return this.nextInner(skip, this.dir);\n }\n }\n class PartialTextCursor {\n constructor(text, start, end) {\n this.value = \"\";\n this.done = false;\n this.cursor = new RawTextCursor(text, start > end ? -1 : 1);\n this.pos = start > end ? text.length : 0;\n this.from = Math.min(start, end);\n this.to = Math.max(start, end);\n }\n nextInner(skip, dir) {\n if (dir < 0 ? this.pos <= this.from : this.pos >= this.to) {\n this.value = \"\";\n this.done = true;\n return this;\n }\n skip += Math.max(0, dir < 0 ? this.pos - this.to : this.from - this.pos);\n let limit = dir < 0 ? this.pos - this.from : this.to - this.pos;\n if (skip > limit)\n skip = limit;\n limit -= skip;\n let { value } = this.cursor.next(skip);\n this.pos += (value.length + skip) * dir;\n this.value = value.length <= limit ? value : dir < 0 ? value.slice(value.length - limit) : value.slice(0, limit);\n this.done = !this.value;\n return this;\n }\n next(skip = 0) {\n if (skip < 0)\n skip = Math.max(skip, this.from - this.pos);\n else if (skip > 0)\n skip = Math.min(skip, this.to - this.pos);\n return this.nextInner(skip, this.cursor.dir);\n }\n get lineBreak() { return this.cursor.lineBreak && this.value != \"\"; }\n }\n class LineCursor {\n constructor(inner) {\n this.inner = inner;\n this.afterBreak = true;\n this.value = \"\";\n this.done = false;\n }\n next(skip = 0) {\n let { done, lineBreak, value } = this.inner.next(skip);\n if (done && this.afterBreak) {\n this.value = \"\";\n this.afterBreak = false;\n }\n else if (done) {\n this.done = true;\n this.value = \"\";\n }\n else if (lineBreak) {\n if (this.afterBreak) {\n this.value = \"\";\n }\n else {\n this.afterBreak = true;\n this.next();\n }\n }\n else {\n this.value = value;\n this.afterBreak = false;\n }\n return this;\n }\n get lineBreak() { return false; }\n }\n if (typeof Symbol != \"undefined\") {\n Text.prototype[Symbol.iterator] = function () { return this.iter(); };\n RawTextCursor.prototype[Symbol.iterator] = PartialTextCursor.prototype[Symbol.iterator] =\n LineCursor.prototype[Symbol.iterator] = function () { return this; };\n }\n /**\n This type describes a line in the document. It is created\n on-demand when lines are [queried](https://codemirror.net/6/docs/ref/#state.Text.lineAt).\n */\n class Line$1 {\n /**\n @internal\n */\n constructor(\n /**\n The position of the start of the line.\n */\n from, \n /**\n The position at the end of the line (_before_ the line break,\n or at the end of document for the last line).\n */\n to, \n /**\n This line's line number (1-based).\n */\n number, \n /**\n The line's content.\n */\n text) {\n this.from = from;\n this.to = to;\n this.number = number;\n this.text = text;\n }\n /**\n The length of the line (not including any line break after it).\n */\n get length() { return this.to - this.from; }\n }\n function clip(text, from, to) {\n from = Math.max(0, Math.min(text.length, from));\n return [from, Math.max(from, Math.min(text.length, to))];\n }\n\n // Compressed representation of the Grapheme_Cluster_Break=Extend\n // information from\n // http://www.unicode.org/Public/13.0.0/ucd/auxiliary/GraphemeBreakProperty.txt.\n // Each pair of elements represents a range, as an offet from the\n // previous range and a length. Numbers are in base-36, with the empty\n // string being a shorthand for 1.\n let extend = /*@__PURE__*/\"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,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o\".split(\",\").map(s => s ? parseInt(s, 36) : 1);\n // Convert offsets into absolute values\n for (let i = 1; i < extend.length; i++)\n extend[i] += extend[i - 1];\n function isExtendingChar(code) {\n for (let i = 1; i < extend.length; i += 2)\n if (extend[i] > code)\n return extend[i - 1] <= code;\n return false;\n }\n function isRegionalIndicator(code) {\n return code >= 0x1F1E6 && code <= 0x1F1FF;\n }\n const ZWJ = 0x200d;\n /**\n Returns a next grapheme cluster break _after_ (not equal to)\n `pos`, if `forward` is true, or before otherwise. Returns `pos`\n itself if no further cluster break is available in the string.\n Moves across surrogate pairs, extending characters (when\n `includeExtending` is true), characters joined with zero-width\n joiners, and flag emoji.\n */\n function findClusterBreak(str, pos, forward = true, includeExtending = true) {\n return (forward ? nextClusterBreak : prevClusterBreak)(str, pos, includeExtending);\n }\n function nextClusterBreak(str, pos, includeExtending) {\n if (pos == str.length)\n return pos;\n // If pos is in the middle of a surrogate pair, move to its start\n if (pos && surrogateLow(str.charCodeAt(pos)) && surrogateHigh(str.charCodeAt(pos - 1)))\n pos--;\n let prev = codePointAt(str, pos);\n pos += codePointSize(prev);\n while (pos < str.length) {\n let next = codePointAt(str, pos);\n if (prev == ZWJ || next == ZWJ || includeExtending && isExtendingChar(next)) {\n pos += codePointSize(next);\n prev = next;\n }\n else if (isRegionalIndicator(next)) {\n let countBefore = 0, i = pos - 2;\n while (i >= 0 && isRegionalIndicator(codePointAt(str, i))) {\n countBefore++;\n i -= 2;\n }\n if (countBefore % 2 == 0)\n break;\n else\n pos += 2;\n }\n else {\n break;\n }\n }\n return pos;\n }\n function prevClusterBreak(str, pos, includeExtending) {\n while (pos > 0) {\n let found = nextClusterBreak(str, pos - 2, includeExtending);\n if (found < pos)\n return found;\n pos--;\n }\n return 0;\n }\n function surrogateLow(ch) { return ch >= 0xDC00 && ch < 0xE000; }\n function surrogateHigh(ch) { return ch >= 0xD800 && ch < 0xDC00; }\n /**\n Find the code point at the given position in a string (like the\n [`codePointAt`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt)\n string method).\n */\n function codePointAt(str, pos) {\n let code0 = str.charCodeAt(pos);\n if (!surrogateHigh(code0) || pos + 1 == str.length)\n return code0;\n let code1 = str.charCodeAt(pos + 1);\n if (!surrogateLow(code1))\n return code0;\n return ((code0 - 0xd800) << 10) + (code1 - 0xdc00) + 0x10000;\n }\n /**\n Given a Unicode codepoint, return the JavaScript string that\n respresents it (like\n [`String.fromCodePoint`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint)).\n */\n function fromCodePoint(code) {\n if (code <= 0xffff)\n return String.fromCharCode(code);\n code -= 0x10000;\n return String.fromCharCode((code >> 10) + 0xd800, (code & 1023) + 0xdc00);\n }\n /**\n The amount of positions a character takes up a JavaScript string.\n */\n function codePointSize(code) { return code < 0x10000 ? 1 : 2; }\n\n const DefaultSplit = /\\r\\n?|\\n/;\n /**\n Distinguishes different ways in which positions can be mapped.\n */\n var MapMode = /*@__PURE__*/(function (MapMode) {\n /**\n Map a position to a valid new position, even when its context\n was deleted.\n */\n MapMode[MapMode[\"Simple\"] = 0] = \"Simple\";\n /**\n Return null if deletion happens across the position.\n */\n MapMode[MapMode[\"TrackDel\"] = 1] = \"TrackDel\";\n /**\n Return null if the character _before_ the position is deleted.\n */\n MapMode[MapMode[\"TrackBefore\"] = 2] = \"TrackBefore\";\n /**\n Return null if the character _after_ the position is deleted.\n */\n MapMode[MapMode[\"TrackAfter\"] = 3] = \"TrackAfter\";\n return MapMode})(MapMode || (MapMode = {}));\n /**\n A change description is a variant of [change set](https://codemirror.net/6/docs/ref/#state.ChangeSet)\n that doesn't store the inserted text. As such, it can't be\n applied, but is cheaper to store and manipulate.\n */\n class ChangeDesc {\n // Sections are encoded as pairs of integers. The first is the\n // length in the current document, and the second is -1 for\n // unaffected sections, and the length of the replacement content\n // otherwise. So an insertion would be (0, n>0), a deletion (n>0,\n // 0), and a replacement two positive numbers.\n /**\n @internal\n */\n constructor(\n /**\n @internal\n */\n sections) {\n this.sections = sections;\n }\n /**\n The length of the document before the change.\n */\n get length() {\n let result = 0;\n for (let i = 0; i < this.sections.length; i += 2)\n result += this.sections[i];\n return result;\n }\n /**\n The length of the document after the change.\n */\n get newLength() {\n let result = 0;\n for (let i = 0; i < this.sections.length; i += 2) {\n let ins = this.sections[i + 1];\n result += ins < 0 ? this.sections[i] : ins;\n }\n return result;\n }\n /**\n False when there are actual changes in this set.\n */\n get empty() { return this.sections.length == 0 || this.sections.length == 2 && this.sections[1] < 0; }\n /**\n Iterate over the unchanged parts left by these changes. `posA`\n provides the position of the range in the old document, `posB`\n the new position in the changed document.\n */\n iterGaps(f) {\n for (let i = 0, posA = 0, posB = 0; i < this.sections.length;) {\n let len = this.sections[i++], ins = this.sections[i++];\n if (ins < 0) {\n f(posA, posB, len);\n posB += len;\n }\n else {\n posB += ins;\n }\n posA += len;\n }\n }\n /**\n Iterate over the ranges changed by these changes. (See\n [`ChangeSet.iterChanges`](https://codemirror.net/6/docs/ref/#state.ChangeSet.iterChanges) for a\n variant that also provides you with the inserted text.)\n `fromA`/`toA` provides the extent of the change in the starting\n document, `fromB`/`toB` the extent of the replacement in the\n changed document.\n \n When `individual` is true, adjacent changes (which are kept\n separate for [position mapping](https://codemirror.net/6/docs/ref/#state.ChangeDesc.mapPos)) are\n reported separately.\n */\n iterChangedRanges(f, individual = false) {\n iterChanges(this, f, individual);\n }\n /**\n Get a description of the inverted form of these changes.\n */\n get invertedDesc() {\n let sections = [];\n for (let i = 0; i < this.sections.length;) {\n let len = this.sections[i++], ins = this.sections[i++];\n if (ins < 0)\n sections.push(len, ins);\n else\n sections.push(ins, len);\n }\n return new ChangeDesc(sections);\n }\n /**\n Compute the combined effect of applying another set of changes\n after this one. The length of the document after this set should\n match the length before `other`.\n */\n composeDesc(other) { return this.empty ? other : other.empty ? this : composeSets(this, other); }\n /**\n Map this description, which should start with the same document\n as `other`, over another set of changes, so that it can be\n applied after it. When `before` is true, map as if the changes\n in `other` happened before the ones in `this`.\n */\n mapDesc(other, before = false) { return other.empty ? this : mapSet(this, other, before); }\n mapPos(pos, assoc = -1, mode = MapMode.Simple) {\n let posA = 0, posB = 0;\n for (let i = 0; i < this.sections.length;) {\n let len = this.sections[i++], ins = this.sections[i++], endA = posA + len;\n if (ins < 0) {\n if (endA > pos)\n return posB + (pos - posA);\n posB += len;\n }\n else {\n if (mode != MapMode.Simple && endA >= pos &&\n (mode == MapMode.TrackDel && posA < pos && endA > pos ||\n mode == MapMode.TrackBefore && posA < pos ||\n mode == MapMode.TrackAfter && endA > pos))\n return null;\n if (endA > pos || endA == pos && assoc < 0 && !len)\n return pos == posA || assoc < 0 ? posB : posB + ins;\n posB += ins;\n }\n posA = endA;\n }\n if (pos > posA)\n throw new RangeError(`Position ${pos} is out of range for changeset of length ${posA}`);\n return posB;\n }\n /**\n Check whether these changes touch a given range. When one of the\n changes entirely covers the range, the string `\"cover\"` is\n returned.\n */\n touchesRange(from, to = from) {\n for (let i = 0, pos = 0; i < this.sections.length && pos <= to;) {\n let len = this.sections[i++], ins = this.sections[i++], end = pos + len;\n if (ins >= 0 && pos <= to && end >= from)\n return pos < from && end > to ? \"cover\" : true;\n pos = end;\n }\n return false;\n }\n /**\n @internal\n */\n toString() {\n let result = \"\";\n for (let i = 0; i < this.sections.length;) {\n let len = this.sections[i++], ins = this.sections[i++];\n result += (result ? \" \" : \"\") + len + (ins >= 0 ? \":\" + ins : \"\");\n }\n return result;\n }\n /**\n Serialize this change desc to a JSON-representable value.\n */\n toJSON() { return this.sections; }\n /**\n Create a change desc from its JSON representation (as produced\n by [`toJSON`](https://codemirror.net/6/docs/ref/#state.ChangeDesc.toJSON).\n */\n static fromJSON(json) {\n if (!Array.isArray(json) || json.length % 2 || json.some(a => typeof a != \"number\"))\n throw new RangeError(\"Invalid JSON representation of ChangeDesc\");\n return new ChangeDesc(json);\n }\n /**\n @internal\n */\n static create(sections) { return new ChangeDesc(sections); }\n }\n /**\n A change set represents a group of modifications to a document. It\n stores the document length, and can only be applied to documents\n with exactly that length.\n */\n class ChangeSet extends ChangeDesc {\n constructor(sections, \n /**\n @internal\n */\n inserted) {\n super(sections);\n this.inserted = inserted;\n }\n /**\n Apply the changes to a document, returning the modified\n document.\n */\n apply(doc) {\n if (this.length != doc.length)\n throw new RangeError(\"Applying change set to a document with the wrong length\");\n iterChanges(this, (fromA, toA, fromB, _toB, text) => doc = doc.replace(fromB, fromB + (toA - fromA), text), false);\n return doc;\n }\n mapDesc(other, before = false) { return mapSet(this, other, before, true); }\n /**\n Given the document as it existed _before_ the changes, return a\n change set that represents the inverse of this set, which could\n be used to go from the document created by the changes back to\n the document as it existed before the changes.\n */\n invert(doc) {\n let sections = this.sections.slice(), inserted = [];\n for (let i = 0, pos = 0; i < sections.length; i += 2) {\n let len = sections[i], ins = sections[i + 1];\n if (ins >= 0) {\n sections[i] = ins;\n sections[i + 1] = len;\n let index = i >> 1;\n while (inserted.length < index)\n inserted.push(Text.empty);\n inserted.push(len ? doc.slice(pos, pos + len) : Text.empty);\n }\n pos += len;\n }\n return new ChangeSet(sections, inserted);\n }\n /**\n Combine two subsequent change sets into a single set. `other`\n must start in the document produced by `this`. If `this` goes\n `docA` \u2192 `docB` and `other` represents `docB` \u2192 `docC`, the\n returned value will represent the change `docA` \u2192 `docC`.\n */\n compose(other) { return this.empty ? other : other.empty ? this : composeSets(this, other, true); }\n /**\n Given another change set starting in the same document, maps this\n change set over the other, producing a new change set that can be\n applied to the document produced by applying `other`. When\n `before` is `true`, order changes as if `this` comes before\n `other`, otherwise (the default) treat `other` as coming first.\n \n Given two changes `A` and `B`, `A.compose(B.map(A))` and\n `B.compose(A.map(B, true))` will produce the same document. This\n provides a basic form of [operational\n transformation](https://en.wikipedia.org/wiki/Operational_transformation),\n and can be used for collaborative editing.\n */\n map(other, before = false) { return other.empty ? this : mapSet(this, other, before, true); }\n /**\n Iterate over the changed ranges in the document, calling `f` for\n each, with the range in the original document (`fromA`-`toA`)\n and the range that replaces it in the new document\n (`fromB`-`toB`).\n \n When `individual` is true, adjacent changes are reported\n separately.\n */\n iterChanges(f, individual = false) {\n iterChanges(this, f, individual);\n }\n /**\n Get a [change description](https://codemirror.net/6/docs/ref/#state.ChangeDesc) for this change\n set.\n */\n get desc() { return ChangeDesc.create(this.sections); }\n /**\n @internal\n */\n filter(ranges) {\n let resultSections = [], resultInserted = [], filteredSections = [];\n let iter = new SectionIter(this);\n done: for (let i = 0, pos = 0;;) {\n let next = i == ranges.length ? 1e9 : ranges[i++];\n while (pos < next || pos == next && iter.len == 0) {\n if (iter.done)\n break done;\n let len = Math.min(iter.len, next - pos);\n addSection(filteredSections, len, -1);\n let ins = iter.ins == -1 ? -1 : iter.off == 0 ? iter.ins : 0;\n addSection(resultSections, len, ins);\n if (ins > 0)\n addInsert(resultInserted, resultSections, iter.text);\n iter.forward(len);\n pos += len;\n }\n let end = ranges[i++];\n while (pos < end) {\n if (iter.done)\n break done;\n let len = Math.min(iter.len, end - pos);\n addSection(resultSections, len, -1);\n addSection(filteredSections, len, iter.ins == -1 ? -1 : iter.off == 0 ? iter.ins : 0);\n iter.forward(len);\n pos += len;\n }\n }\n return { changes: new ChangeSet(resultSections, resultInserted),\n filtered: ChangeDesc.create(filteredSections) };\n }\n /**\n Serialize this change set to a JSON-representable value.\n */\n toJSON() {\n let parts = [];\n for (let i = 0; i < this.sections.length; i += 2) {\n let len = this.sections[i], ins = this.sections[i + 1];\n if (ins < 0)\n parts.push(len);\n else if (ins == 0)\n parts.push([len]);\n else\n parts.push([len].concat(this.inserted[i >> 1].toJSON()));\n }\n return parts;\n }\n /**\n Create a change set for the given changes, for a document of the\n given length, using `lineSep` as line separator.\n */\n static of(changes, length, lineSep) {\n let sections = [], inserted = [], pos = 0;\n let total = null;\n function flush(force = false) {\n if (!force && !sections.length)\n return;\n if (pos < length)\n addSection(sections, length - pos, -1);\n let set = new ChangeSet(sections, inserted);\n total = total ? total.compose(set.map(total)) : set;\n sections = [];\n inserted = [];\n pos = 0;\n }\n function process(spec) {\n if (Array.isArray(spec)) {\n for (let sub of spec)\n process(sub);\n }\n else if (spec instanceof ChangeSet) {\n if (spec.length != length)\n throw new RangeError(`Mismatched change set length (got ${spec.length}, expected ${length})`);\n flush();\n total = total ? total.compose(spec.map(total)) : spec;\n }\n else {\n let { from, to = from, insert } = spec;\n if (from > to || from < 0 || to > length)\n throw new RangeError(`Invalid change range ${from} to ${to} (in doc of length ${length})`);\n let insText = !insert ? Text.empty : typeof insert == \"string\" ? Text.of(insert.split(lineSep || DefaultSplit)) : insert;\n let insLen = insText.length;\n if (from == to && insLen == 0)\n return;\n if (from < pos)\n flush();\n if (from > pos)\n addSection(sections, from - pos, -1);\n addSection(sections, to - from, insLen);\n addInsert(inserted, sections, insText);\n pos = to;\n }\n }\n process(changes);\n flush(!total);\n return total;\n }\n /**\n Create an empty changeset of the given length.\n */\n static empty(length) {\n return new ChangeSet(length ? [length, -1] : [], []);\n }\n /**\n Create a changeset from its JSON representation (as produced by\n [`toJSON`](https://codemirror.net/6/docs/ref/#state.ChangeSet.toJSON).\n */\n static fromJSON(json) {\n if (!Array.isArray(json))\n throw new RangeError(\"Invalid JSON representation of ChangeSet\");\n let sections = [], inserted = [];\n for (let i = 0; i < json.length; i++) {\n let part = json[i];\n if (typeof part == \"number\") {\n sections.push(part, -1);\n }\n else if (!Array.isArray(part) || typeof part[0] != \"number\" || part.some((e, i) => i && typeof e != \"string\")) {\n throw new RangeError(\"Invalid JSON representation of ChangeSet\");\n }\n else if (part.length == 1) {\n sections.push(part[0], 0);\n }\n else {\n while (inserted.length < i)\n inserted.push(Text.empty);\n inserted[i] = Text.of(part.slice(1));\n sections.push(part[0], inserted[i].length);\n }\n }\n return new ChangeSet(sections, inserted);\n }\n /**\n @internal\n */\n static createSet(sections, inserted) {\n return new ChangeSet(sections, inserted);\n }\n }\n function addSection(sections, len, ins, forceJoin = false) {\n if (len == 0 && ins <= 0)\n return;\n let last = sections.length - 2;\n if (last >= 0 && ins <= 0 && ins == sections[last + 1])\n sections[last] += len;\n else if (len == 0 && sections[last] == 0)\n sections[last + 1] += ins;\n else if (forceJoin) {\n sections[last] += len;\n sections[last + 1] += ins;\n }\n else\n sections.push(len, ins);\n }\n function addInsert(values, sections, value) {\n if (value.length == 0)\n return;\n let index = (sections.length - 2) >> 1;\n if (index < values.length) {\n values[values.length - 1] = values[values.length - 1].append(value);\n }\n else {\n while (values.length < index)\n values.push(Text.empty);\n values.push(value);\n }\n }\n function iterChanges(desc, f, individual) {\n let inserted = desc.inserted;\n for (let posA = 0, posB = 0, i = 0; i < desc.sections.length;) {\n let len = desc.sections[i++], ins = desc.sections[i++];\n if (ins < 0) {\n posA += len;\n posB += len;\n }\n else {\n let endA = posA, endB = posB, text = Text.empty;\n for (;;) {\n endA += len;\n endB += ins;\n if (ins && inserted)\n text = text.append(inserted[(i - 2) >> 1]);\n if (individual || i == desc.sections.length || desc.sections[i + 1] < 0)\n break;\n len = desc.sections[i++];\n ins = desc.sections[i++];\n }\n f(posA, endA, posB, endB, text);\n posA = endA;\n posB = endB;\n }\n }\n }\n function mapSet(setA, setB, before, mkSet = false) {\n // Produce a copy of setA that applies to the document after setB\n // has been applied (assuming both start at the same document).\n let sections = [], insert = mkSet ? [] : null;\n let a = new SectionIter(setA), b = new SectionIter(setB);\n // Iterate over both sets in parallel. inserted tracks, for changes\n // in A that have to be processed piece-by-piece, whether their\n // content has been inserted already, and refers to the section\n // index.\n for (let inserted = -1;;) {\n if (a.ins == -1 && b.ins == -1) {\n // Move across ranges skipped by both sets.\n let len = Math.min(a.len, b.len);\n addSection(sections, len, -1);\n a.forward(len);\n b.forward(len);\n }\n else if (b.ins >= 0 && (a.ins < 0 || inserted == a.i || a.off == 0 && (b.len < a.len || b.len == a.len && !before))) {\n // If there's a change in B that comes before the next change in\n // A (ordered by start pos, then len, then before flag), skip\n // that (and process any changes in A it covers).\n let len = b.len;\n addSection(sections, b.ins, -1);\n while (len) {\n let piece = Math.min(a.len, len);\n if (a.ins >= 0 && inserted < a.i && a.len <= piece) {\n addSection(sections, 0, a.ins);\n if (insert)\n addInsert(insert, sections, a.text);\n inserted = a.i;\n }\n a.forward(piece);\n len -= piece;\n }\n b.next();\n }\n else if (a.ins >= 0) {\n // Process the part of a change in A up to the start of the next\n // non-deletion change in B (if overlapping).\n let len = 0, left = a.len;\n while (left) {\n if (b.ins == -1) {\n let piece = Math.min(left, b.len);\n len += piece;\n left -= piece;\n b.forward(piece);\n }\n else if (b.ins == 0 && b.len < left) {\n left -= b.len;\n b.next();\n }\n else {\n break;\n }\n }\n addSection(sections, len, inserted < a.i ? a.ins : 0);\n if (insert && inserted < a.i)\n addInsert(insert, sections, a.text);\n inserted = a.i;\n a.forward(a.len - left);\n }\n else if (a.done && b.done) {\n return insert ? ChangeSet.createSet(sections, insert) : ChangeDesc.create(sections);\n }\n else {\n throw new Error(\"Mismatched change set lengths\");\n }\n }\n }\n function composeSets(setA, setB, mkSet = false) {\n let sections = [];\n let insert = mkSet ? [] : null;\n let a = new SectionIter(setA), b = new SectionIter(setB);\n for (let open = false;;) {\n if (a.done && b.done) {\n return insert ? ChangeSet.createSet(sections, insert) : ChangeDesc.create(sections);\n }\n else if (a.ins == 0) { // Deletion in A\n addSection(sections, a.len, 0, open);\n a.next();\n }\n else if (b.len == 0 && !b.done) { // Insertion in B\n addSection(sections, 0, b.ins, open);\n if (insert)\n addInsert(insert, sections, b.text);\n b.next();\n }\n else if (a.done || b.done) {\n throw new Error(\"Mismatched change set lengths\");\n }\n else {\n let len = Math.min(a.len2, b.len), sectionLen = sections.length;\n if (a.ins == -1) {\n let insB = b.ins == -1 ? -1 : b.off ? 0 : b.ins;\n addSection(sections, len, insB, open);\n if (insert && insB)\n addInsert(insert, sections, b.text);\n }\n else if (b.ins == -1) {\n addSection(sections, a.off ? 0 : a.len, len, open);\n if (insert)\n addInsert(insert, sections, a.textBit(len));\n }\n else {\n addSection(sections, a.off ? 0 : a.len, b.off ? 0 : b.ins, open);\n if (insert && !b.off)\n addInsert(insert, sections, b.text);\n }\n open = (a.ins > len || b.ins >= 0 && b.len > len) && (open || sections.length > sectionLen);\n a.forward2(len);\n b.forward(len);\n }\n }\n }\n class SectionIter {\n constructor(set) {\n this.set = set;\n this.i = 0;\n this.next();\n }\n next() {\n let { sections } = this.set;\n if (this.i < sections.length) {\n this.len = sections[this.i++];\n this.ins = sections[this.i++];\n }\n else {\n this.len = 0;\n this.ins = -2;\n }\n this.off = 0;\n }\n get done() { return this.ins == -2; }\n get len2() { return this.ins < 0 ? this.len : this.ins; }\n get text() {\n let { inserted } = this.set, index = (this.i - 2) >> 1;\n return index >= inserted.length ? Text.empty : inserted[index];\n }\n textBit(len) {\n let { inserted } = this.set, index = (this.i - 2) >> 1;\n return index >= inserted.length && !len ? Text.empty\n : inserted[index].slice(this.off, len == null ? undefined : this.off + len);\n }\n forward(len) {\n if (len == this.len)\n this.next();\n else {\n this.len -= len;\n this.off += len;\n }\n }\n forward2(len) {\n if (this.ins == -1)\n this.forward(len);\n else if (len == this.ins)\n this.next();\n else {\n this.ins -= len;\n this.off += len;\n }\n }\n }\n\n /**\n A single selection range. When\n [`allowMultipleSelections`](https://codemirror.net/6/docs/ref/#state.EditorState^allowMultipleSelections)\n is enabled, a [selection](https://codemirror.net/6/docs/ref/#state.EditorSelection) may hold\n multiple ranges. By default, selections hold exactly one range.\n */\n class SelectionRange {\n constructor(\n /**\n The lower boundary of the range.\n */\n from, \n /**\n The upper boundary of the range.\n */\n to, flags) {\n this.from = from;\n this.to = to;\n this.flags = flags;\n }\n /**\n The anchor of the range\u2014the side that doesn't move when you\n extend it.\n */\n get anchor() { return this.flags & 32 /* RangeFlag.Inverted */ ? this.to : this.from; }\n /**\n The head of the range, which is moved when the range is\n [extended](https://codemirror.net/6/docs/ref/#state.SelectionRange.extend).\n */\n get head() { return this.flags & 32 /* RangeFlag.Inverted */ ? this.from : this.to; }\n /**\n True when `anchor` and `head` are at the same position.\n */\n get empty() { return this.from == this.to; }\n /**\n If this is a cursor that is explicitly associated with the\n character on one of its sides, this returns the side. -1 means\n the character before its position, 1 the character after, and 0\n means no association.\n */\n get assoc() { return this.flags & 8 /* RangeFlag.AssocBefore */ ? -1 : this.flags & 16 /* RangeFlag.AssocAfter */ ? 1 : 0; }\n /**\n The bidirectional text level associated with this cursor, if\n any.\n */\n get bidiLevel() {\n let level = this.flags & 7 /* RangeFlag.BidiLevelMask */;\n return level == 7 ? null : level;\n }\n /**\n The goal column (stored vertical offset) associated with a\n cursor. This is used to preserve the vertical position when\n [moving](https://codemirror.net/6/docs/ref/#view.EditorView.moveVertically) across\n lines of different length.\n */\n get goalColumn() {\n let value = this.flags >> 6 /* RangeFlag.GoalColumnOffset */;\n return value == 16777215 /* RangeFlag.NoGoalColumn */ ? undefined : value;\n }\n /**\n Map this range through a change, producing a valid range in the\n updated document.\n */\n map(change, assoc = -1) {\n let from, to;\n if (this.empty) {\n from = to = change.mapPos(this.from, assoc);\n }\n else {\n from = change.mapPos(this.from, 1);\n to = change.mapPos(this.to, -1);\n }\n return from == this.from && to == this.to ? this : new SelectionRange(from, to, this.flags);\n }\n /**\n Extend this range to cover at least `from` to `to`.\n */\n extend(from, to = from) {\n if (from <= this.anchor && to >= this.anchor)\n return EditorSelection.range(from, to);\n let head = Math.abs(from - this.anchor) > Math.abs(to - this.anchor) ? from : to;\n return EditorSelection.range(this.anchor, head);\n }\n /**\n Compare this range to another range.\n */\n eq(other, includeAssoc = false) {\n return this.anchor == other.anchor && this.head == other.head &&\n (!includeAssoc || !this.empty || this.assoc == other.assoc);\n }\n /**\n Return a JSON-serializable object representing the range.\n */\n toJSON() { return { anchor: this.anchor, head: this.head }; }\n /**\n Convert a JSON representation of a range to a `SelectionRange`\n instance.\n */\n static fromJSON(json) {\n if (!json || typeof json.anchor != \"number\" || typeof json.head != \"number\")\n throw new RangeError(\"Invalid JSON representation for SelectionRange\");\n return EditorSelection.range(json.anchor, json.head);\n }\n /**\n @internal\n */\n static create(from, to, flags) {\n return new SelectionRange(from, to, flags);\n }\n }\n /**\n An editor selection holds one or more selection ranges.\n */\n class EditorSelection {\n constructor(\n /**\n The ranges in the selection, sorted by position. Ranges cannot\n overlap (but they may touch, if they aren't empty).\n */\n ranges, \n /**\n The index of the _main_ range in the selection (which is\n usually the range that was added last).\n */\n mainIndex) {\n this.ranges = ranges;\n this.mainIndex = mainIndex;\n }\n /**\n Map a selection through a change. Used to adjust the selection\n position for changes.\n */\n map(change, assoc = -1) {\n if (change.empty)\n return this;\n return EditorSelection.create(this.ranges.map(r => r.map(change, assoc)), this.mainIndex);\n }\n /**\n Compare this selection to another selection. By default, ranges\n are compared only by position. When `includeAssoc` is true,\n cursor ranges must also have the same\n [`assoc`](https://codemirror.net/6/docs/ref/#state.SelectionRange.assoc) value.\n */\n eq(other, includeAssoc = false) {\n if (this.ranges.length != other.ranges.length ||\n this.mainIndex != other.mainIndex)\n return false;\n for (let i = 0; i < this.ranges.length; i++)\n if (!this.ranges[i].eq(other.ranges[i], includeAssoc))\n return false;\n return true;\n }\n /**\n Get the primary selection range. Usually, you should make sure\n your code applies to _all_ ranges, by using methods like\n [`changeByRange`](https://codemirror.net/6/docs/ref/#state.EditorState.changeByRange).\n */\n get main() { return this.ranges[this.mainIndex]; }\n /**\n Make sure the selection only has one range. Returns a selection\n holding only the main range from this selection.\n */\n asSingle() {\n return this.ranges.length == 1 ? this : new EditorSelection([this.main], 0);\n }\n /**\n Extend this selection with an extra range.\n */\n addRange(range, main = true) {\n return EditorSelection.create([range].concat(this.ranges), main ? 0 : this.mainIndex + 1);\n }\n /**\n Replace a given range with another range, and then normalize the\n selection to merge and sort ranges if necessary.\n */\n replaceRange(range, which = this.mainIndex) {\n let ranges = this.ranges.slice();\n ranges[which] = range;\n return EditorSelection.create(ranges, this.mainIndex);\n }\n /**\n Convert this selection to an object that can be serialized to\n JSON.\n */\n toJSON() {\n return { ranges: this.ranges.map(r => r.toJSON()), main: this.mainIndex };\n }\n /**\n Create a selection from a JSON representation.\n */\n static fromJSON(json) {\n if (!json || !Array.isArray(json.ranges) || typeof json.main != \"number\" || json.main >= json.ranges.length)\n throw new RangeError(\"Invalid JSON representation for EditorSelection\");\n return new EditorSelection(json.ranges.map((r) => SelectionRange.fromJSON(r)), json.main);\n }\n /**\n Create a selection holding a single range.\n */\n static single(anchor, head = anchor) {\n return new EditorSelection([EditorSelection.range(anchor, head)], 0);\n }\n /**\n Sort and merge the given set of ranges, creating a valid\n selection.\n */\n static create(ranges, mainIndex = 0) {\n if (ranges.length == 0)\n throw new RangeError(\"A selection needs at least one range\");\n for (let pos = 0, i = 0; i < ranges.length; i++) {\n let range = ranges[i];\n if (range.empty ? range.from <= pos : range.from < pos)\n return EditorSelection.normalized(ranges.slice(), mainIndex);\n pos = range.to;\n }\n return new EditorSelection(ranges, mainIndex);\n }\n /**\n Create a cursor selection range at the given position. You can\n safely ignore the optional arguments in most situations.\n */\n static cursor(pos, assoc = 0, bidiLevel, goalColumn) {\n return SelectionRange.create(pos, pos, (assoc == 0 ? 0 : assoc < 0 ? 8 /* RangeFlag.AssocBefore */ : 16 /* RangeFlag.AssocAfter */) |\n (bidiLevel == null ? 7 : Math.min(6, bidiLevel)) |\n ((goalColumn !== null && goalColumn !== void 0 ? goalColumn : 16777215 /* RangeFlag.NoGoalColumn */) << 6 /* RangeFlag.GoalColumnOffset */));\n }\n /**\n Create a selection range.\n */\n static range(anchor, head, goalColumn, bidiLevel) {\n let flags = ((goalColumn !== null && goalColumn !== void 0 ? goalColumn : 16777215 /* RangeFlag.NoGoalColumn */) << 6 /* RangeFlag.GoalColumnOffset */) |\n (bidiLevel == null ? 7 : Math.min(6, bidiLevel));\n return head < anchor ? SelectionRange.create(head, anchor, 32 /* RangeFlag.Inverted */ | 16 /* RangeFlag.AssocAfter */ | flags)\n : SelectionRange.create(anchor, head, (head > anchor ? 8 /* RangeFlag.AssocBefore */ : 0) | flags);\n }\n /**\n @internal\n */\n static normalized(ranges, mainIndex = 0) {\n let main = ranges[mainIndex];\n ranges.sort((a, b) => a.from - b.from);\n mainIndex = ranges.indexOf(main);\n for (let i = 1; i < ranges.length; i++) {\n let range = ranges[i], prev = ranges[i - 1];\n if (range.empty ? range.from <= prev.to : range.from < prev.to) {\n let from = prev.from, to = Math.max(range.to, prev.to);\n if (i <= mainIndex)\n mainIndex--;\n ranges.splice(--i, 2, range.anchor > range.head ? EditorSelection.range(to, from) : EditorSelection.range(from, to));\n }\n }\n return new EditorSelection(ranges, mainIndex);\n }\n }\n function checkSelection(selection, docLength) {\n for (let range of selection.ranges)\n if (range.to > docLength)\n throw new RangeError(\"Selection points outside of document\");\n }\n\n let nextID = 0;\n /**\n A facet is a labeled value that is associated with an editor\n state. It takes inputs from any number of extensions, and combines\n those into a single output value.\n\n Examples of uses of facets are the [tab\n size](https://codemirror.net/6/docs/ref/#state.EditorState^tabSize), [editor\n attributes](https://codemirror.net/6/docs/ref/#view.EditorView^editorAttributes), and [update\n listeners](https://codemirror.net/6/docs/ref/#view.EditorView^updateListener).\n\n Note that `Facet` instances can be used anywhere where\n [`FacetReader`](https://codemirror.net/6/docs/ref/#state.FacetReader) is expected.\n */\n class Facet {\n constructor(\n /**\n @internal\n */\n combine, \n /**\n @internal\n */\n compareInput, \n /**\n @internal\n */\n compare, isStatic, enables) {\n this.combine = combine;\n this.compareInput = compareInput;\n this.compare = compare;\n this.isStatic = isStatic;\n /**\n @internal\n */\n this.id = nextID++;\n this.default = combine([]);\n this.extensions = typeof enables == \"function\" ? enables(this) : enables;\n }\n /**\n Returns a facet reader for this facet, which can be used to\n [read](https://codemirror.net/6/docs/ref/#state.EditorState.facet) it but not to define values for it.\n */\n get reader() { return this; }\n /**\n Define a new facet.\n */\n static define(config = {}) {\n return new Facet(config.combine || ((a) => a), config.compareInput || ((a, b) => a === b), config.compare || (!config.combine ? sameArray$1 : (a, b) => a === b), !!config.static, config.enables);\n }\n /**\n Returns an extension that adds the given value to this facet.\n */\n of(value) {\n return new FacetProvider([], this, 0 /* Provider.Static */, value);\n }\n /**\n Create an extension that computes a value for the facet from a\n state. You must take care to declare the parts of the state that\n this value depends on, since your function is only called again\n for a new state when one of those parts changed.\n \n In cases where your value depends only on a single field, you'll\n want to use the [`from`](https://codemirror.net/6/docs/ref/#state.Facet.from) method instead.\n */\n compute(deps, get) {\n if (this.isStatic)\n throw new Error(\"Can't compute a static facet\");\n return new FacetProvider(deps, this, 1 /* Provider.Single */, get);\n }\n /**\n Create an extension that computes zero or more values for this\n facet from a state.\n */\n computeN(deps, get) {\n if (this.isStatic)\n throw new Error(\"Can't compute a static facet\");\n return new FacetProvider(deps, this, 2 /* Provider.Multi */, get);\n }\n from(field, get) {\n if (!get)\n get = x => x;\n return this.compute([field], state => get(state.field(field)));\n }\n }\n function sameArray$1(a, b) {\n return a == b || a.length == b.length && a.every((e, i) => e === b[i]);\n }\n class FacetProvider {\n constructor(dependencies, facet, type, value) {\n this.dependencies = dependencies;\n this.facet = facet;\n this.type = type;\n this.value = value;\n this.id = nextID++;\n }\n dynamicSlot(addresses) {\n var _a;\n let getter = this.value;\n let compare = this.facet.compareInput;\n let id = this.id, idx = addresses[id] >> 1, multi = this.type == 2 /* Provider.Multi */;\n let depDoc = false, depSel = false, depAddrs = [];\n for (let dep of this.dependencies) {\n if (dep == \"doc\")\n depDoc = true;\n else if (dep == \"selection\")\n depSel = true;\n else if ((((_a = addresses[dep.id]) !== null && _a !== void 0 ? _a : 1) & 1) == 0)\n depAddrs.push(addresses[dep.id]);\n }\n return {\n create(state) {\n state.values[idx] = getter(state);\n return 1 /* SlotStatus.Changed */;\n },\n update(state, tr) {\n if ((depDoc && tr.docChanged) || (depSel && (tr.docChanged || tr.selection)) || ensureAll(state, depAddrs)) {\n let newVal = getter(state);\n if (multi ? !compareArray(newVal, state.values[idx], compare) : !compare(newVal, state.values[idx])) {\n state.values[idx] = newVal;\n return 1 /* SlotStatus.Changed */;\n }\n }\n return 0;\n },\n reconfigure: (state, oldState) => {\n let newVal, oldAddr = oldState.config.address[id];\n if (oldAddr != null) {\n let oldVal = getAddr(oldState, oldAddr);\n if (this.dependencies.every(dep => {\n return dep instanceof Facet ? oldState.facet(dep) === state.facet(dep) :\n dep instanceof StateField ? oldState.field(dep, false) == state.field(dep, false) : true;\n }) || (multi ? compareArray(newVal = getter(state), oldVal, compare) : compare(newVal = getter(state), oldVal))) {\n state.values[idx] = oldVal;\n return 0;\n }\n }\n else {\n newVal = getter(state);\n }\n state.values[idx] = newVal;\n return 1 /* SlotStatus.Changed */;\n }\n };\n }\n }\n function compareArray(a, b, compare) {\n if (a.length != b.length)\n return false;\n for (let i = 0; i < a.length; i++)\n if (!compare(a[i], b[i]))\n return false;\n return true;\n }\n function ensureAll(state, addrs) {\n let changed = false;\n for (let addr of addrs)\n if (ensureAddr(state, addr) & 1 /* SlotStatus.Changed */)\n changed = true;\n return changed;\n }\n function dynamicFacetSlot(addresses, facet, providers) {\n let providerAddrs = providers.map(p => addresses[p.id]);\n let providerTypes = providers.map(p => p.type);\n let dynamic = providerAddrs.filter(p => !(p & 1));\n let idx = addresses[facet.id] >> 1;\n function get(state) {\n let values = [];\n for (let i = 0; i < providerAddrs.length; i++) {\n let value = getAddr(state, providerAddrs[i]);\n if (providerTypes[i] == 2 /* Provider.Multi */)\n for (let val of value)\n values.push(val);\n else\n values.push(value);\n }\n return facet.combine(values);\n }\n return {\n create(state) {\n for (let addr of providerAddrs)\n ensureAddr(state, addr);\n state.values[idx] = get(state);\n return 1 /* SlotStatus.Changed */;\n },\n update(state, tr) {\n if (!ensureAll(state, dynamic))\n return 0;\n let value = get(state);\n if (facet.compare(value, state.values[idx]))\n return 0;\n state.values[idx] = value;\n return 1 /* SlotStatus.Changed */;\n },\n reconfigure(state, oldState) {\n let depChanged = ensureAll(state, providerAddrs);\n let oldProviders = oldState.config.facets[facet.id], oldValue = oldState.facet(facet);\n if (oldProviders && !depChanged && sameArray$1(providers, oldProviders)) {\n state.values[idx] = oldValue;\n return 0;\n }\n let value = get(state);\n if (facet.compare(value, oldValue)) {\n state.values[idx] = oldValue;\n return 0;\n }\n state.values[idx] = value;\n return 1 /* SlotStatus.Changed */;\n }\n };\n }\n const initField = /*@__PURE__*/Facet.define({ static: true });\n /**\n Fields can store additional information in an editor state, and\n keep it in sync with the rest of the state.\n */\n class StateField {\n constructor(\n /**\n @internal\n */\n id, createF, updateF, compareF, \n /**\n @internal\n */\n spec) {\n this.id = id;\n this.createF = createF;\n this.updateF = updateF;\n this.compareF = compareF;\n this.spec = spec;\n /**\n @internal\n */\n this.provides = undefined;\n }\n /**\n Define a state field.\n */\n static define(config) {\n let field = new StateField(nextID++, config.create, config.update, config.compare || ((a, b) => a === b), config);\n if (config.provide)\n field.provides = config.provide(field);\n return field;\n }\n create(state) {\n let init = state.facet(initField).find(i => i.field == this);\n return ((init === null || init === void 0 ? void 0 : init.create) || this.createF)(state);\n }\n /**\n @internal\n */\n slot(addresses) {\n let idx = addresses[this.id] >> 1;\n return {\n create: (state) => {\n state.values[idx] = this.create(state);\n return 1 /* SlotStatus.Changed */;\n },\n update: (state, tr) => {\n let oldVal = state.values[idx];\n let value = this.updateF(oldVal, tr);\n if (this.compareF(oldVal, value))\n return 0;\n state.values[idx] = value;\n return 1 /* SlotStatus.Changed */;\n },\n reconfigure: (state, oldState) => {\n if (oldState.config.address[this.id] != null) {\n state.values[idx] = oldState.field(this);\n return 0;\n }\n state.values[idx] = this.create(state);\n return 1 /* SlotStatus.Changed */;\n }\n };\n }\n /**\n Returns an extension that enables this field and overrides the\n way it is initialized. Can be useful when you need to provide a\n non-default starting value for the field.\n */\n init(create) {\n return [this, initField.of({ field: this, create })];\n }\n /**\n State field instances can be used as\n [`Extension`](https://codemirror.net/6/docs/ref/#state.Extension) values to enable the field in a\n given state.\n */\n get extension() { return this; }\n }\n const Prec_ = { lowest: 4, low: 3, default: 2, high: 1, highest: 0 };\n function prec(value) {\n return (ext) => new PrecExtension(ext, value);\n }\n /**\n By default extensions are registered in the order they are found\n in the flattened form of nested array that was provided.\n Individual extension values can be assigned a precedence to\n override this. Extensions that do not have a precedence set get\n the precedence of the nearest parent with a precedence, or\n [`default`](https://codemirror.net/6/docs/ref/#state.Prec.default) if there is no such parent. The\n final ordering of extensions is determined by first sorting by\n precedence and then by order within each precedence.\n */\n const Prec = {\n /**\n The highest precedence level, for extensions that should end up\n near the start of the precedence ordering.\n */\n highest: /*@__PURE__*/prec(Prec_.highest),\n /**\n A higher-than-default precedence, for extensions that should\n come before those with default precedence.\n */\n high: /*@__PURE__*/prec(Prec_.high),\n /**\n The default precedence, which is also used for extensions\n without an explicit precedence.\n */\n default: /*@__PURE__*/prec(Prec_.default),\n /**\n A lower-than-default precedence.\n */\n low: /*@__PURE__*/prec(Prec_.low),\n /**\n The lowest precedence level. Meant for things that should end up\n near the end of the extension order.\n */\n lowest: /*@__PURE__*/prec(Prec_.lowest)\n };\n class PrecExtension {\n constructor(inner, prec) {\n this.inner = inner;\n this.prec = prec;\n }\n }\n /**\n Extension compartments can be used to make a configuration\n dynamic. By [wrapping](https://codemirror.net/6/docs/ref/#state.Compartment.of) part of your\n configuration in a compartment, you can later\n [replace](https://codemirror.net/6/docs/ref/#state.Compartment.reconfigure) that part through a\n transaction.\n */\n class Compartment {\n /**\n Create an instance of this compartment to add to your [state\n configuration](https://codemirror.net/6/docs/ref/#state.EditorStateConfig.extensions).\n */\n of(ext) { return new CompartmentInstance(this, ext); }\n /**\n Create an [effect](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) that\n reconfigures this compartment.\n */\n reconfigure(content) {\n return Compartment.reconfigure.of({ compartment: this, extension: content });\n }\n /**\n Get the current content of the compartment in the state, or\n `undefined` if it isn't present.\n */\n get(state) {\n return state.config.compartments.get(this);\n }\n }\n class CompartmentInstance {\n constructor(compartment, inner) {\n this.compartment = compartment;\n this.inner = inner;\n }\n }\n class Configuration {\n constructor(base, compartments, dynamicSlots, address, staticValues, facets) {\n this.base = base;\n this.compartments = compartments;\n this.dynamicSlots = dynamicSlots;\n this.address = address;\n this.staticValues = staticValues;\n this.facets = facets;\n this.statusTemplate = [];\n while (this.statusTemplate.length < dynamicSlots.length)\n this.statusTemplate.push(0 /* SlotStatus.Unresolved */);\n }\n staticFacet(facet) {\n let addr = this.address[facet.id];\n return addr == null ? facet.default : this.staticValues[addr >> 1];\n }\n static resolve(base, compartments, oldState) {\n let fields = [];\n let facets = Object.create(null);\n let newCompartments = new Map();\n for (let ext of flatten(base, compartments, newCompartments)) {\n if (ext instanceof StateField)\n fields.push(ext);\n else\n (facets[ext.facet.id] || (facets[ext.facet.id] = [])).push(ext);\n }\n let address = Object.create(null);\n let staticValues = [];\n let dynamicSlots = [];\n for (let field of fields) {\n address[field.id] = dynamicSlots.length << 1;\n dynamicSlots.push(a => field.slot(a));\n }\n let oldFacets = oldState === null || oldState === void 0 ? void 0 : oldState.config.facets;\n for (let id in facets) {\n let providers = facets[id], facet = providers[0].facet;\n let oldProviders = oldFacets && oldFacets[id] || [];\n if (providers.every(p => p.type == 0 /* Provider.Static */)) {\n address[facet.id] = (staticValues.length << 1) | 1;\n if (sameArray$1(oldProviders, providers)) {\n staticValues.push(oldState.facet(facet));\n }\n else {\n let value = facet.combine(providers.map(p => p.value));\n staticValues.push(oldState && facet.compare(value, oldState.facet(facet)) ? oldState.facet(facet) : value);\n }\n }\n else {\n for (let p of providers) {\n if (p.type == 0 /* Provider.Static */) {\n address[p.id] = (staticValues.length << 1) | 1;\n staticValues.push(p.value);\n }\n else {\n address[p.id] = dynamicSlots.length << 1;\n dynamicSlots.push(a => p.dynamicSlot(a));\n }\n }\n address[facet.id] = dynamicSlots.length << 1;\n dynamicSlots.push(a => dynamicFacetSlot(a, facet, providers));\n }\n }\n let dynamic = dynamicSlots.map(f => f(address));\n return new Configuration(base, newCompartments, dynamic, address, staticValues, facets);\n }\n }\n function flatten(extension, compartments, newCompartments) {\n let result = [[], [], [], [], []];\n let seen = new Map();\n function inner(ext, prec) {\n let known = seen.get(ext);\n if (known != null) {\n if (known <= prec)\n return;\n let found = result[known].indexOf(ext);\n if (found > -1)\n result[known].splice(found, 1);\n if (ext instanceof CompartmentInstance)\n newCompartments.delete(ext.compartment);\n }\n seen.set(ext, prec);\n if (Array.isArray(ext)) {\n for (let e of ext)\n inner(e, prec);\n }\n else if (ext instanceof CompartmentInstance) {\n if (newCompartments.has(ext.compartment))\n throw new RangeError(`Duplicate use of compartment in extensions`);\n let content = compartments.get(ext.compartment) || ext.inner;\n newCompartments.set(ext.compartment, content);\n inner(content, prec);\n }\n else if (ext instanceof PrecExtension) {\n inner(ext.inner, ext.prec);\n }\n else if (ext instanceof StateField) {\n result[prec].push(ext);\n if (ext.provides)\n inner(ext.provides, prec);\n }\n else if (ext instanceof FacetProvider) {\n result[prec].push(ext);\n if (ext.facet.extensions)\n inner(ext.facet.extensions, Prec_.default);\n }\n else {\n let content = ext.extension;\n if (!content)\n throw new Error(`Unrecognized extension value in extension set (${ext}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);\n inner(content, prec);\n }\n }\n inner(extension, Prec_.default);\n return result.reduce((a, b) => a.concat(b));\n }\n function ensureAddr(state, addr) {\n if (addr & 1)\n return 2 /* SlotStatus.Computed */;\n let idx = addr >> 1;\n let status = state.status[idx];\n if (status == 4 /* SlotStatus.Computing */)\n throw new Error(\"Cyclic dependency between fields and/or facets\");\n if (status & 2 /* SlotStatus.Computed */)\n return status;\n state.status[idx] = 4 /* SlotStatus.Computing */;\n let changed = state.computeSlot(state, state.config.dynamicSlots[idx]);\n return state.status[idx] = 2 /* SlotStatus.Computed */ | changed;\n }\n function getAddr(state, addr) {\n return addr & 1 ? state.config.staticValues[addr >> 1] : state.values[addr >> 1];\n }\n\n const languageData = /*@__PURE__*/Facet.define();\n const allowMultipleSelections = /*@__PURE__*/Facet.define({\n combine: values => values.some(v => v),\n static: true\n });\n const lineSeparator = /*@__PURE__*/Facet.define({\n combine: values => values.length ? values[0] : undefined,\n static: true\n });\n const changeFilter = /*@__PURE__*/Facet.define();\n const transactionFilter = /*@__PURE__*/Facet.define();\n const transactionExtender = /*@__PURE__*/Facet.define();\n const readOnly = /*@__PURE__*/Facet.define({\n combine: values => values.length ? values[0] : false\n });\n\n /**\n Annotations are tagged values that are used to add metadata to\n transactions in an extensible way. They should be used to model\n things that effect the entire transaction (such as its [time\n stamp](https://codemirror.net/6/docs/ref/#state.Transaction^time) or information about its\n [origin](https://codemirror.net/6/docs/ref/#state.Transaction^userEvent)). For effects that happen\n _alongside_ the other changes made by the transaction, [state\n effects](https://codemirror.net/6/docs/ref/#state.StateEffect) are more appropriate.\n */\n class Annotation {\n /**\n @internal\n */\n constructor(\n /**\n The annotation type.\n */\n type, \n /**\n The value of this annotation.\n */\n value) {\n this.type = type;\n this.value = value;\n }\n /**\n Define a new type of annotation.\n */\n static define() { return new AnnotationType(); }\n }\n /**\n Marker that identifies a type of [annotation](https://codemirror.net/6/docs/ref/#state.Annotation).\n */\n class AnnotationType {\n /**\n Create an instance of this annotation.\n */\n of(value) { return new Annotation(this, value); }\n }\n /**\n Representation of a type of state effect. Defined with\n [`StateEffect.define`](https://codemirror.net/6/docs/ref/#state.StateEffect^define).\n */\n class StateEffectType {\n /**\n @internal\n */\n constructor(\n // The `any` types in these function types are there to work\n // around TypeScript issue #37631, where the type guard on\n // `StateEffect.is` mysteriously stops working when these properly\n // have type `Value`.\n /**\n @internal\n */\n map) {\n this.map = map;\n }\n /**\n Create a [state effect](https://codemirror.net/6/docs/ref/#state.StateEffect) instance of this\n type.\n */\n of(value) { return new StateEffect(this, value); }\n }\n /**\n State effects can be used to represent additional effects\n associated with a [transaction](https://codemirror.net/6/docs/ref/#state.Transaction.effects). They\n are often useful to model changes to custom [state\n fields](https://codemirror.net/6/docs/ref/#state.StateField), when those changes aren't implicit in\n document or selection changes.\n */\n class StateEffect {\n /**\n @internal\n */\n constructor(\n /**\n @internal\n */\n type, \n /**\n The value of this effect.\n */\n value) {\n this.type = type;\n this.value = value;\n }\n /**\n Map this effect through a position mapping. Will return\n `undefined` when that ends up deleting the effect.\n */\n map(mapping) {\n let mapped = this.type.map(this.value, mapping);\n return mapped === undefined ? undefined : mapped == this.value ? this : new StateEffect(this.type, mapped);\n }\n /**\n Tells you whether this effect object is of a given\n [type](https://codemirror.net/6/docs/ref/#state.StateEffectType).\n */\n is(type) { return this.type == type; }\n /**\n Define a new effect type. The type parameter indicates the type\n of values that his effect holds. It should be a type that\n doesn't include `undefined`, since that is used in\n [mapping](https://codemirror.net/6/docs/ref/#state.StateEffect.map) to indicate that an effect is\n removed.\n */\n static define(spec = {}) {\n return new StateEffectType(spec.map || (v => v));\n }\n /**\n Map an array of effects through a change set.\n */\n static mapEffects(effects, mapping) {\n if (!effects.length)\n return effects;\n let result = [];\n for (let effect of effects) {\n let mapped = effect.map(mapping);\n if (mapped)\n result.push(mapped);\n }\n return result;\n }\n }\n /**\n This effect can be used to reconfigure the root extensions of\n the editor. Doing this will discard any extensions\n [appended](https://codemirror.net/6/docs/ref/#state.StateEffect^appendConfig), but does not reset\n the content of [reconfigured](https://codemirror.net/6/docs/ref/#state.Compartment.reconfigure)\n compartments.\n */\n StateEffect.reconfigure = /*@__PURE__*/StateEffect.define();\n /**\n Append extensions to the top-level configuration of the editor.\n */\n StateEffect.appendConfig = /*@__PURE__*/StateEffect.define();\n /**\n Changes to the editor state are grouped into transactions.\n Typically, a user action creates a single transaction, which may\n contain any number of document changes, may change the selection,\n or have other effects. Create a transaction by calling\n [`EditorState.update`](https://codemirror.net/6/docs/ref/#state.EditorState.update), or immediately\n dispatch one by calling\n [`EditorView.dispatch`](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch).\n */\n class Transaction {\n constructor(\n /**\n The state from which the transaction starts.\n */\n startState, \n /**\n The document changes made by this transaction.\n */\n changes, \n /**\n The selection set by this transaction, or undefined if it\n doesn't explicitly set a selection.\n */\n selection, \n /**\n The effects added to the transaction.\n */\n effects, \n /**\n @internal\n */\n annotations, \n /**\n Whether the selection should be scrolled into view after this\n transaction is dispatched.\n */\n scrollIntoView) {\n this.startState = startState;\n this.changes = changes;\n this.selection = selection;\n this.effects = effects;\n this.annotations = annotations;\n this.scrollIntoView = scrollIntoView;\n /**\n @internal\n */\n this._doc = null;\n /**\n @internal\n */\n this._state = null;\n if (selection)\n checkSelection(selection, changes.newLength);\n if (!annotations.some((a) => a.type == Transaction.time))\n this.annotations = annotations.concat(Transaction.time.of(Date.now()));\n }\n /**\n @internal\n */\n static create(startState, changes, selection, effects, annotations, scrollIntoView) {\n return new Transaction(startState, changes, selection, effects, annotations, scrollIntoView);\n }\n /**\n The new document produced by the transaction. Contrary to\n [`.state`](https://codemirror.net/6/docs/ref/#state.Transaction.state)`.doc`, accessing this won't\n force the entire new state to be computed right away, so it is\n recommended that [transaction\n filters](https://codemirror.net/6/docs/ref/#state.EditorState^transactionFilter) use this getter\n when they need to look at the new document.\n */\n get newDoc() {\n return this._doc || (this._doc = this.changes.apply(this.startState.doc));\n }\n /**\n The new selection produced by the transaction. If\n [`this.selection`](https://codemirror.net/6/docs/ref/#state.Transaction.selection) is undefined,\n this will [map](https://codemirror.net/6/docs/ref/#state.EditorSelection.map) the start state's\n current selection through the changes made by the transaction.\n */\n get newSelection() {\n return this.selection || this.startState.selection.map(this.changes);\n }\n /**\n The new state created by the transaction. Computed on demand\n (but retained for subsequent access), so it is recommended not to\n access it in [transaction\n filters](https://codemirror.net/6/docs/ref/#state.EditorState^transactionFilter) when possible.\n */\n get state() {\n if (!this._state)\n this.startState.applyTransaction(this);\n return this._state;\n }\n /**\n Get the value of the given annotation type, if any.\n */\n annotation(type) {\n for (let ann of this.annotations)\n if (ann.type == type)\n return ann.value;\n return undefined;\n }\n /**\n Indicates whether the transaction changed the document.\n */\n get docChanged() { return !this.changes.empty; }\n /**\n Indicates whether this transaction reconfigures the state\n (through a [configuration compartment](https://codemirror.net/6/docs/ref/#state.Compartment) or\n with a top-level configuration\n [effect](https://codemirror.net/6/docs/ref/#state.StateEffect^reconfigure).\n */\n get reconfigured() { return this.startState.config != this.state.config; }\n /**\n Returns true if the transaction has a [user\n event](https://codemirror.net/6/docs/ref/#state.Transaction^userEvent) annotation that is equal to\n or more specific than `event`. For example, if the transaction\n has `\"select.pointer\"` as user event, `\"select\"` and\n `\"select.pointer\"` will match it.\n */\n isUserEvent(event) {\n let e = this.annotation(Transaction.userEvent);\n return !!(e && (e == event || e.length > event.length && e.slice(0, event.length) == event && e[event.length] == \".\"));\n }\n }\n /**\n Annotation used to store transaction timestamps. Automatically\n added to every transaction, holding `Date.now()`.\n */\n Transaction.time = /*@__PURE__*/Annotation.define();\n /**\n Annotation used to associate a transaction with a user interface\n event. Holds a string identifying the event, using a\n dot-separated format to support attaching more specific\n information. The events used by the core libraries are:\n\n - `\"input\"` when content is entered\n - `\"input.type\"` for typed input\n - `\"input.type.compose\"` for composition\n - `\"input.paste\"` for pasted input\n - `\"input.drop\"` when adding content with drag-and-drop\n - `\"input.complete\"` when autocompleting\n - `\"delete\"` when the user deletes content\n - `\"delete.selection\"` when deleting the selection\n - `\"delete.forward\"` when deleting forward from the selection\n - `\"delete.backward\"` when deleting backward from the selection\n - `\"delete.cut\"` when cutting to the clipboard\n - `\"move\"` when content is moved\n - `\"move.drop\"` when content is moved within the editor through drag-and-drop\n - `\"select\"` when explicitly changing the selection\n - `\"select.pointer\"` when selecting with a mouse or other pointing device\n - `\"undo\"` and `\"redo\"` for history actions\n\n Use [`isUserEvent`](https://codemirror.net/6/docs/ref/#state.Transaction.isUserEvent) to check\n whether the annotation matches a given event.\n */\n Transaction.userEvent = /*@__PURE__*/Annotation.define();\n /**\n Annotation indicating whether a transaction should be added to\n the undo history or not.\n */\n Transaction.addToHistory = /*@__PURE__*/Annotation.define();\n /**\n Annotation indicating (when present and true) that a transaction\n represents a change made by some other actor, not the user. This\n is used, for example, to tag other people's changes in\n collaborative editing.\n */\n Transaction.remote = /*@__PURE__*/Annotation.define();\n function joinRanges(a, b) {\n let result = [];\n for (let iA = 0, iB = 0;;) {\n let from, to;\n if (iA < a.length && (iB == b.length || b[iB] >= a[iA])) {\n from = a[iA++];\n to = a[iA++];\n }\n else if (iB < b.length) {\n from = b[iB++];\n to = b[iB++];\n }\n else\n return result;\n if (!result.length || result[result.length - 1] < from)\n result.push(from, to);\n else if (result[result.length - 1] < to)\n result[result.length - 1] = to;\n }\n }\n function mergeTransaction(a, b, sequential) {\n var _a;\n let mapForA, mapForB, changes;\n if (sequential) {\n mapForA = b.changes;\n mapForB = ChangeSet.empty(b.changes.length);\n changes = a.changes.compose(b.changes);\n }\n else {\n mapForA = b.changes.map(a.changes);\n mapForB = a.changes.mapDesc(b.changes, true);\n changes = a.changes.compose(mapForA);\n }\n return {\n changes,\n selection: b.selection ? b.selection.map(mapForB) : (_a = a.selection) === null || _a === void 0 ? void 0 : _a.map(mapForA),\n effects: StateEffect.mapEffects(a.effects, mapForA).concat(StateEffect.mapEffects(b.effects, mapForB)),\n annotations: a.annotations.length ? a.annotations.concat(b.annotations) : b.annotations,\n scrollIntoView: a.scrollIntoView || b.scrollIntoView\n };\n }\n function resolveTransactionInner(state, spec, docSize) {\n let sel = spec.selection, annotations = asArray$1(spec.annotations);\n if (spec.userEvent)\n annotations = annotations.concat(Transaction.userEvent.of(spec.userEvent));\n return {\n changes: spec.changes instanceof ChangeSet ? spec.changes\n : ChangeSet.of(spec.changes || [], docSize, state.facet(lineSeparator)),\n selection: sel && (sel instanceof EditorSelection ? sel : EditorSelection.single(sel.anchor, sel.head)),\n effects: asArray$1(spec.effects),\n annotations,\n scrollIntoView: !!spec.scrollIntoView\n };\n }\n function resolveTransaction(state, specs, filter) {\n let s = resolveTransactionInner(state, specs.length ? specs[0] : {}, state.doc.length);\n if (specs.length && specs[0].filter === false)\n filter = false;\n for (let i = 1; i < specs.length; i++) {\n if (specs[i].filter === false)\n filter = false;\n let seq = !!specs[i].sequential;\n s = mergeTransaction(s, resolveTransactionInner(state, specs[i], seq ? s.changes.newLength : state.doc.length), seq);\n }\n let tr = Transaction.create(state, s.changes, s.selection, s.effects, s.annotations, s.scrollIntoView);\n return extendTransaction(filter ? filterTransaction(tr) : tr);\n }\n // Finish a transaction by applying filters if necessary.\n function filterTransaction(tr) {\n let state = tr.startState;\n // Change filters\n let result = true;\n for (let filter of state.facet(changeFilter)) {\n let value = filter(tr);\n if (value === false) {\n result = false;\n break;\n }\n if (Array.isArray(value))\n result = result === true ? value : joinRanges(result, value);\n }\n if (result !== true) {\n let changes, back;\n if (result === false) {\n back = tr.changes.invertedDesc;\n changes = ChangeSet.empty(state.doc.length);\n }\n else {\n let filtered = tr.changes.filter(result);\n changes = filtered.changes;\n back = filtered.filtered.mapDesc(filtered.changes).invertedDesc;\n }\n tr = Transaction.create(state, changes, tr.selection && tr.selection.map(back), StateEffect.mapEffects(tr.effects, back), tr.annotations, tr.scrollIntoView);\n }\n // Transaction filters\n let filters = state.facet(transactionFilter);\n for (let i = filters.length - 1; i >= 0; i--) {\n let filtered = filters[i](tr);\n if (filtered instanceof Transaction)\n tr = filtered;\n else if (Array.isArray(filtered) && filtered.length == 1 && filtered[0] instanceof Transaction)\n tr = filtered[0];\n else\n tr = resolveTransaction(state, asArray$1(filtered), false);\n }\n return tr;\n }\n function extendTransaction(tr) {\n let state = tr.startState, extenders = state.facet(transactionExtender), spec = tr;\n for (let i = extenders.length - 1; i >= 0; i--) {\n let extension = extenders[i](tr);\n if (extension && Object.keys(extension).length)\n spec = mergeTransaction(spec, resolveTransactionInner(state, extension, tr.changes.newLength), true);\n }\n return spec == tr ? tr : Transaction.create(state, tr.changes, tr.selection, spec.effects, spec.annotations, spec.scrollIntoView);\n }\n const none$3 = [];\n function asArray$1(value) {\n return value == null ? none$3 : Array.isArray(value) ? value : [value];\n }\n\n /**\n The categories produced by a [character\n categorizer](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer). These are used\n do things like selecting by word.\n */\n var CharCategory = /*@__PURE__*/(function (CharCategory) {\n /**\n Word characters.\n */\n CharCategory[CharCategory[\"Word\"] = 0] = \"Word\";\n /**\n Whitespace.\n */\n CharCategory[CharCategory[\"Space\"] = 1] = \"Space\";\n /**\n Anything else.\n */\n CharCategory[CharCategory[\"Other\"] = 2] = \"Other\";\n return CharCategory})(CharCategory || (CharCategory = {}));\n const nonASCIISingleCaseWordChar = /[\\u00df\\u0587\\u0590-\\u05f4\\u0600-\\u06ff\\u3040-\\u309f\\u30a0-\\u30ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\uac00-\\ud7af]/;\n let wordChar;\n try {\n wordChar = /*@__PURE__*/new RegExp(\"[\\\\p{Alphabetic}\\\\p{Number}_]\", \"u\");\n }\n catch (_) { }\n function hasWordChar(str) {\n if (wordChar)\n return wordChar.test(str);\n for (let i = 0; i < str.length; i++) {\n let ch = str[i];\n if (/\\w/.test(ch) || ch > \"\\x80\" && (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)))\n return true;\n }\n return false;\n }\n function makeCategorizer(wordChars) {\n return (char) => {\n if (!/\\S/.test(char))\n return CharCategory.Space;\n if (hasWordChar(char))\n return CharCategory.Word;\n for (let i = 0; i < wordChars.length; i++)\n if (char.indexOf(wordChars[i]) > -1)\n return CharCategory.Word;\n return CharCategory.Other;\n };\n }\n\n /**\n The editor state class is a persistent (immutable) data structure.\n To update a state, you [create](https://codemirror.net/6/docs/ref/#state.EditorState.update) a\n [transaction](https://codemirror.net/6/docs/ref/#state.Transaction), which produces a _new_ state\n instance, without modifying the original object.\n\n As such, _never_ mutate properties of a state directly. That'll\n just break things.\n */\n class EditorState {\n constructor(\n /**\n @internal\n */\n config, \n /**\n The current document.\n */\n doc, \n /**\n The current selection.\n */\n selection, \n /**\n @internal\n */\n values, computeSlot, tr) {\n this.config = config;\n this.doc = doc;\n this.selection = selection;\n this.values = values;\n this.status = config.statusTemplate.slice();\n this.computeSlot = computeSlot;\n // Fill in the computed state immediately, so that further queries\n // for it made during the update return this state\n if (tr)\n tr._state = this;\n for (let i = 0; i < this.config.dynamicSlots.length; i++)\n ensureAddr(this, i << 1);\n this.computeSlot = null;\n }\n field(field, require = true) {\n let addr = this.config.address[field.id];\n if (addr == null) {\n if (require)\n throw new RangeError(\"Field is not present in this state\");\n return undefined;\n }\n ensureAddr(this, addr);\n return getAddr(this, addr);\n }\n /**\n Create a [transaction](https://codemirror.net/6/docs/ref/#state.Transaction) that updates this\n state. Any number of [transaction specs](https://codemirror.net/6/docs/ref/#state.TransactionSpec)\n can be passed. Unless\n [`sequential`](https://codemirror.net/6/docs/ref/#state.TransactionSpec.sequential) is set, the\n [changes](https://codemirror.net/6/docs/ref/#state.TransactionSpec.changes) (if any) of each spec\n are assumed to start in the _current_ document (not the document\n produced by previous specs), and its\n [selection](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection) and\n [effects](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) are assumed to refer\n to the document created by its _own_ changes. The resulting\n transaction contains the combined effect of all the different\n specs. For [selection](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection), later\n specs take precedence over earlier ones.\n */\n update(...specs) {\n return resolveTransaction(this, specs, true);\n }\n /**\n @internal\n */\n applyTransaction(tr) {\n let conf = this.config, { base, compartments } = conf;\n for (let effect of tr.effects) {\n if (effect.is(Compartment.reconfigure)) {\n if (conf) {\n compartments = new Map;\n conf.compartments.forEach((val, key) => compartments.set(key, val));\n conf = null;\n }\n compartments.set(effect.value.compartment, effect.value.extension);\n }\n else if (effect.is(StateEffect.reconfigure)) {\n conf = null;\n base = effect.value;\n }\n else if (effect.is(StateEffect.appendConfig)) {\n conf = null;\n base = asArray$1(base).concat(effect.value);\n }\n }\n let startValues;\n if (!conf) {\n conf = Configuration.resolve(base, compartments, this);\n let intermediateState = new EditorState(conf, this.doc, this.selection, conf.dynamicSlots.map(() => null), (state, slot) => slot.reconfigure(state, this), null);\n startValues = intermediateState.values;\n }\n else {\n startValues = tr.startState.values.slice();\n }\n let selection = tr.startState.facet(allowMultipleSelections) ? tr.newSelection : tr.newSelection.asSingle();\n new EditorState(conf, tr.newDoc, selection, startValues, (state, slot) => slot.update(state, tr), tr);\n }\n /**\n Create a [transaction spec](https://codemirror.net/6/docs/ref/#state.TransactionSpec) that\n replaces every selection range with the given content.\n */\n replaceSelection(text) {\n if (typeof text == \"string\")\n text = this.toText(text);\n return this.changeByRange(range => ({ changes: { from: range.from, to: range.to, insert: text },\n range: EditorSelection.cursor(range.from + text.length) }));\n }\n /**\n Create a set of changes and a new selection by running the given\n function for each range in the active selection. The function\n can return an optional set of changes (in the coordinate space\n of the start document), plus an updated range (in the coordinate\n space of the document produced by the call's own changes). This\n method will merge all the changes and ranges into a single\n changeset and selection, and return it as a [transaction\n spec](https://codemirror.net/6/docs/ref/#state.TransactionSpec), which can be passed to\n [`update`](https://codemirror.net/6/docs/ref/#state.EditorState.update).\n */\n changeByRange(f) {\n let sel = this.selection;\n let result1 = f(sel.ranges[0]);\n let changes = this.changes(result1.changes), ranges = [result1.range];\n let effects = asArray$1(result1.effects);\n for (let i = 1; i < sel.ranges.length; i++) {\n let result = f(sel.ranges[i]);\n let newChanges = this.changes(result.changes), newMapped = newChanges.map(changes);\n for (let j = 0; j < i; j++)\n ranges[j] = ranges[j].map(newMapped);\n let mapBy = changes.mapDesc(newChanges, true);\n ranges.push(result.range.map(mapBy));\n changes = changes.compose(newMapped);\n effects = StateEffect.mapEffects(effects, newMapped).concat(StateEffect.mapEffects(asArray$1(result.effects), mapBy));\n }\n return {\n changes,\n selection: EditorSelection.create(ranges, sel.mainIndex),\n effects\n };\n }\n /**\n Create a [change set](https://codemirror.net/6/docs/ref/#state.ChangeSet) from the given change\n description, taking the state's document length and line\n separator into account.\n */\n changes(spec = []) {\n if (spec instanceof ChangeSet)\n return spec;\n return ChangeSet.of(spec, this.doc.length, this.facet(EditorState.lineSeparator));\n }\n /**\n Using the state's [line\n separator](https://codemirror.net/6/docs/ref/#state.EditorState^lineSeparator), create a\n [`Text`](https://codemirror.net/6/docs/ref/#state.Text) instance from the given string.\n */\n toText(string) {\n return Text.of(string.split(this.facet(EditorState.lineSeparator) || DefaultSplit));\n }\n /**\n Return the given range of the document as a string.\n */\n sliceDoc(from = 0, to = this.doc.length) {\n return this.doc.sliceString(from, to, this.lineBreak);\n }\n /**\n Get the value of a state [facet](https://codemirror.net/6/docs/ref/#state.Facet).\n */\n facet(facet) {\n let addr = this.config.address[facet.id];\n if (addr == null)\n return facet.default;\n ensureAddr(this, addr);\n return getAddr(this, addr);\n }\n /**\n Convert this state to a JSON-serializable object. When custom\n fields should be serialized, you can pass them in as an object\n mapping property names (in the resulting object, which should\n not use `doc` or `selection`) to fields.\n */\n toJSON(fields) {\n let result = {\n doc: this.sliceDoc(),\n selection: this.selection.toJSON()\n };\n if (fields)\n for (let prop in fields) {\n let value = fields[prop];\n if (value instanceof StateField && this.config.address[value.id] != null)\n result[prop] = value.spec.toJSON(this.field(fields[prop]), this);\n }\n return result;\n }\n /**\n Deserialize a state from its JSON representation. When custom\n fields should be deserialized, pass the same object you passed\n to [`toJSON`](https://codemirror.net/6/docs/ref/#state.EditorState.toJSON) when serializing as\n third argument.\n */\n static fromJSON(json, config = {}, fields) {\n if (!json || typeof json.doc != \"string\")\n throw new RangeError(\"Invalid JSON representation for EditorState\");\n let fieldInit = [];\n if (fields)\n for (let prop in fields) {\n if (Object.prototype.hasOwnProperty.call(json, prop)) {\n let field = fields[prop], value = json[prop];\n fieldInit.push(field.init(state => field.spec.fromJSON(value, state)));\n }\n }\n return EditorState.create({\n doc: json.doc,\n selection: EditorSelection.fromJSON(json.selection),\n extensions: config.extensions ? fieldInit.concat([config.extensions]) : fieldInit\n });\n }\n /**\n Create a new state. You'll usually only need this when\n initializing an editor\u2014updated states are created by applying\n transactions.\n */\n static create(config = {}) {\n let configuration = Configuration.resolve(config.extensions || [], new Map);\n let doc = config.doc instanceof Text ? config.doc\n : Text.of((config.doc || \"\").split(configuration.staticFacet(EditorState.lineSeparator) || DefaultSplit));\n let selection = !config.selection ? EditorSelection.single(0)\n : config.selection instanceof EditorSelection ? config.selection\n : EditorSelection.single(config.selection.anchor, config.selection.head);\n checkSelection(selection, doc.length);\n if (!configuration.staticFacet(allowMultipleSelections))\n selection = selection.asSingle();\n return new EditorState(configuration, doc, selection, configuration.dynamicSlots.map(() => null), (state, slot) => slot.create(state), null);\n }\n /**\n The size (in columns) of a tab in the document, determined by\n the [`tabSize`](https://codemirror.net/6/docs/ref/#state.EditorState^tabSize) facet.\n */\n get tabSize() { return this.facet(EditorState.tabSize); }\n /**\n Get the proper [line-break](https://codemirror.net/6/docs/ref/#state.EditorState^lineSeparator)\n string for this state.\n */\n get lineBreak() { return this.facet(EditorState.lineSeparator) || \"\\n\"; }\n /**\n Returns true when the editor is\n [configured](https://codemirror.net/6/docs/ref/#state.EditorState^readOnly) to be read-only.\n */\n get readOnly() { return this.facet(readOnly); }\n /**\n Look up a translation for the given phrase (via the\n [`phrases`](https://codemirror.net/6/docs/ref/#state.EditorState^phrases) facet), or return the\n original string if no translation is found.\n \n If additional arguments are passed, they will be inserted in\n place of markers like `$1` (for the first value) and `$2`, etc.\n A single `$` is equivalent to `$1`, and `$$` will produce a\n literal dollar sign.\n */\n phrase(phrase, ...insert) {\n for (let map of this.facet(EditorState.phrases))\n if (Object.prototype.hasOwnProperty.call(map, phrase)) {\n phrase = map[phrase];\n break;\n }\n if (insert.length)\n phrase = phrase.replace(/\\$(\\$|\\d*)/g, (m, i) => {\n if (i == \"$\")\n return \"$\";\n let n = +(i || 1);\n return !n || n > insert.length ? m : insert[n - 1];\n });\n return phrase;\n }\n /**\n Find the values for a given language data field, provided by the\n the [`languageData`](https://codemirror.net/6/docs/ref/#state.EditorState^languageData) facet.\n \n Examples of language data fields are...\n \n - [`\"commentTokens\"`](https://codemirror.net/6/docs/ref/#commands.CommentTokens) for specifying\n comment syntax.\n - [`\"autocomplete\"`](https://codemirror.net/6/docs/ref/#autocomplete.autocompletion^config.override)\n for providing language-specific completion sources.\n - [`\"wordChars\"`](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer) for adding\n characters that should be considered part of words in this\n language.\n - [`\"closeBrackets\"`](https://codemirror.net/6/docs/ref/#autocomplete.CloseBracketConfig) controls\n bracket closing behavior.\n */\n languageDataAt(name, pos, side = -1) {\n let values = [];\n for (let provider of this.facet(languageData)) {\n for (let result of provider(this, pos, side)) {\n if (Object.prototype.hasOwnProperty.call(result, name))\n values.push(result[name]);\n }\n }\n return values;\n }\n /**\n Return a function that can categorize strings (expected to\n represent a single [grapheme cluster](https://codemirror.net/6/docs/ref/#state.findClusterBreak))\n into one of:\n \n - Word (contains an alphanumeric character or a character\n explicitly listed in the local language's `\"wordChars\"`\n language data, which should be a string)\n - Space (contains only whitespace)\n - Other (anything else)\n */\n charCategorizer(at) {\n return makeCategorizer(this.languageDataAt(\"wordChars\", at).join(\"\"));\n }\n /**\n Find the word at the given position, meaning the range\n containing all [word](https://codemirror.net/6/docs/ref/#state.CharCategory.Word) characters\n around it. If no word characters are adjacent to the position,\n this returns null.\n */\n wordAt(pos) {\n let { text, from, length } = this.doc.lineAt(pos);\n let cat = this.charCategorizer(pos);\n let start = pos - from, end = pos - from;\n while (start > 0) {\n let prev = findClusterBreak(text, start, false);\n if (cat(text.slice(prev, start)) != CharCategory.Word)\n break;\n start = prev;\n }\n while (end < length) {\n let next = findClusterBreak(text, end);\n if (cat(text.slice(end, next)) != CharCategory.Word)\n break;\n end = next;\n }\n return start == end ? null : EditorSelection.range(start + from, end + from);\n }\n }\n /**\n A facet that, when enabled, causes the editor to allow multiple\n ranges to be selected. Be careful though, because by default the\n editor relies on the native DOM selection, which cannot handle\n multiple selections. An extension like\n [`drawSelection`](https://codemirror.net/6/docs/ref/#view.drawSelection) can be used to make\n secondary selections visible to the user.\n */\n EditorState.allowMultipleSelections = allowMultipleSelections;\n /**\n Configures the tab size to use in this state. The first\n (highest-precedence) value of the facet is used. If no value is\n given, this defaults to 4.\n */\n EditorState.tabSize = /*@__PURE__*/Facet.define({\n combine: values => values.length ? values[0] : 4\n });\n /**\n The line separator to use. By default, any of `\"\\n\"`, `\"\\r\\n\"`\n and `\"\\r\"` is treated as a separator when splitting lines, and\n lines are joined with `\"\\n\"`.\n\n When you configure a value here, only that precise separator\n will be used, allowing you to round-trip documents through the\n editor without normalizing line separators.\n */\n EditorState.lineSeparator = lineSeparator;\n /**\n This facet controls the value of the\n [`readOnly`](https://codemirror.net/6/docs/ref/#state.EditorState.readOnly) getter, which is\n consulted by commands and extensions that implement editing\n functionality to determine whether they should apply. It\n defaults to false, but when its highest-precedence value is\n `true`, such functionality disables itself.\n\n Not to be confused with\n [`EditorView.editable`](https://codemirror.net/6/docs/ref/#view.EditorView^editable), which\n controls whether the editor's DOM is set to be editable (and\n thus focusable).\n */\n EditorState.readOnly = readOnly;\n /**\n Registers translation phrases. The\n [`phrase`](https://codemirror.net/6/docs/ref/#state.EditorState.phrase) method will look through\n all objects registered with this facet to find translations for\n its argument.\n */\n EditorState.phrases = /*@__PURE__*/Facet.define({\n compare(a, b) {\n let kA = Object.keys(a), kB = Object.keys(b);\n return kA.length == kB.length && kA.every(k => a[k] == b[k]);\n }\n });\n /**\n A facet used to register [language\n data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt) providers.\n */\n EditorState.languageData = languageData;\n /**\n Facet used to register change filters, which are called for each\n transaction (unless explicitly\n [disabled](https://codemirror.net/6/docs/ref/#state.TransactionSpec.filter)), and can suppress\n part of the transaction's changes.\n\n Such a function can return `true` to indicate that it doesn't\n want to do anything, `false` to completely stop the changes in\n the transaction, or a set of ranges in which changes should be\n suppressed. Such ranges are represented as an array of numbers,\n with each pair of two numbers indicating the start and end of a\n range. So for example `[10, 20, 100, 110]` suppresses changes\n between 10 and 20, and between 100 and 110.\n */\n EditorState.changeFilter = changeFilter;\n /**\n Facet used to register a hook that gets a chance to update or\n replace transaction specs before they are applied. This will\n only be applied for transactions that don't have\n [`filter`](https://codemirror.net/6/docs/ref/#state.TransactionSpec.filter) set to `false`. You\n can either return a single transaction spec (possibly the input\n transaction), or an array of specs (which will be combined in\n the same way as the arguments to\n [`EditorState.update`](https://codemirror.net/6/docs/ref/#state.EditorState.update)).\n\n When possible, it is recommended to avoid accessing\n [`Transaction.state`](https://codemirror.net/6/docs/ref/#state.Transaction.state) in a filter,\n since it will force creation of a state that will then be\n discarded again, if the transaction is actually filtered.\n\n (This functionality should be used with care. Indiscriminately\n modifying transaction is likely to break something or degrade\n the user experience.)\n */\n EditorState.transactionFilter = transactionFilter;\n /**\n This is a more limited form of\n [`transactionFilter`](https://codemirror.net/6/docs/ref/#state.EditorState^transactionFilter),\n which can only add\n [annotations](https://codemirror.net/6/docs/ref/#state.TransactionSpec.annotations) and\n [effects](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects). _But_, this type\n of filter runs even if the transaction has disabled regular\n [filtering](https://codemirror.net/6/docs/ref/#state.TransactionSpec.filter), making it suitable\n for effects that don't need to touch the changes or selection,\n but do want to process every transaction.\n\n Extenders run _after_ filters, when both are present.\n */\n EditorState.transactionExtender = transactionExtender;\n Compartment.reconfigure = /*@__PURE__*/StateEffect.define();\n\n /**\n Utility function for combining behaviors to fill in a config\n object from an array of provided configs. `defaults` should hold\n default values for all optional fields in `Config`.\n\n The function will, by default, error\n when a field gets two values that aren't `===`-equal, but you can\n provide combine functions per field to do something else.\n */\n function combineConfig(configs, defaults, // Should hold only the optional properties of Config, but I haven't managed to express that\n combine = {}) {\n let result = {};\n for (let config of configs)\n for (let key of Object.keys(config)) {\n let value = config[key], current = result[key];\n if (current === undefined)\n result[key] = value;\n else if (current === value || value === undefined) ; // No conflict\n else if (Object.hasOwnProperty.call(combine, key))\n result[key] = combine[key](current, value);\n else\n throw new Error(\"Config merge conflict for field \" + key);\n }\n for (let key in defaults)\n if (result[key] === undefined)\n result[key] = defaults[key];\n return result;\n }\n\n /**\n Each range is associated with a value, which must inherit from\n this class.\n */\n class RangeValue {\n /**\n Compare this value with another value. Used when comparing\n rangesets. The default implementation compares by identity.\n Unless you are only creating a fixed number of unique instances\n of your value type, it is a good idea to implement this\n properly.\n */\n eq(other) { return this == other; }\n /**\n Create a [range](https://codemirror.net/6/docs/ref/#state.Range) with this value.\n */\n range(from, to = from) { return Range$1.create(from, to, this); }\n }\n RangeValue.prototype.startSide = RangeValue.prototype.endSide = 0;\n RangeValue.prototype.point = false;\n RangeValue.prototype.mapMode = MapMode.TrackDel;\n /**\n A range associates a value with a range of positions.\n */\n class Range$1 {\n constructor(\n /**\n The range's start position.\n */\n from, \n /**\n Its end position.\n */\n to, \n /**\n The value associated with this range.\n */\n value) {\n this.from = from;\n this.to = to;\n this.value = value;\n }\n /**\n @internal\n */\n static create(from, to, value) {\n return new Range$1(from, to, value);\n }\n }\n function cmpRange(a, b) {\n return a.from - b.from || a.value.startSide - b.value.startSide;\n }\n class Chunk {\n constructor(from, to, value, \n // Chunks are marked with the largest point that occurs\n // in them (or -1 for no points), so that scans that are\n // only interested in points (such as the\n // heightmap-related logic) can skip range-only chunks.\n maxPoint) {\n this.from = from;\n this.to = to;\n this.value = value;\n this.maxPoint = maxPoint;\n }\n get length() { return this.to[this.to.length - 1]; }\n // Find the index of the given position and side. Use the ranges'\n // `from` pos when `end == false`, `to` when `end == true`.\n findIndex(pos, side, end, startAt = 0) {\n let arr = end ? this.to : this.from;\n for (let lo = startAt, hi = arr.length;;) {\n if (lo == hi)\n return lo;\n let mid = (lo + hi) >> 1;\n let diff = arr[mid] - pos || (end ? this.value[mid].endSide : this.value[mid].startSide) - side;\n if (mid == lo)\n return diff >= 0 ? lo : hi;\n if (diff >= 0)\n hi = mid;\n else\n lo = mid + 1;\n }\n }\n between(offset, from, to, f) {\n for (let i = this.findIndex(from, -1000000000 /* C.Far */, true), e = this.findIndex(to, 1000000000 /* C.Far */, false, i); i < e; i++)\n if (f(this.from[i] + offset, this.to[i] + offset, this.value[i]) === false)\n return false;\n }\n map(offset, changes) {\n let value = [], from = [], to = [], newPos = -1, maxPoint = -1;\n for (let i = 0; i < this.value.length; i++) {\n let val = this.value[i], curFrom = this.from[i] + offset, curTo = this.to[i] + offset, newFrom, newTo;\n if (curFrom == curTo) {\n let mapped = changes.mapPos(curFrom, val.startSide, val.mapMode);\n if (mapped == null)\n continue;\n newFrom = newTo = mapped;\n if (val.startSide != val.endSide) {\n newTo = changes.mapPos(curFrom, val.endSide);\n if (newTo < newFrom)\n continue;\n }\n }\n else {\n newFrom = changes.mapPos(curFrom, val.startSide);\n newTo = changes.mapPos(curTo, val.endSide);\n if (newFrom > newTo || newFrom == newTo && val.startSide > 0 && val.endSide <= 0)\n continue;\n }\n if ((newTo - newFrom || val.endSide - val.startSide) < 0)\n continue;\n if (newPos < 0)\n newPos = newFrom;\n if (val.point)\n maxPoint = Math.max(maxPoint, newTo - newFrom);\n value.push(val);\n from.push(newFrom - newPos);\n to.push(newTo - newPos);\n }\n return { mapped: value.length ? new Chunk(from, to, value, maxPoint) : null, pos: newPos };\n }\n }\n /**\n A range set stores a collection of [ranges](https://codemirror.net/6/docs/ref/#state.Range) in a\n way that makes them efficient to [map](https://codemirror.net/6/docs/ref/#state.RangeSet.map) and\n [update](https://codemirror.net/6/docs/ref/#state.RangeSet.update). This is an immutable data\n structure.\n */\n class RangeSet {\n constructor(\n /**\n @internal\n */\n chunkPos, \n /**\n @internal\n */\n chunk, \n /**\n @internal\n */\n nextLayer, \n /**\n @internal\n */\n maxPoint) {\n this.chunkPos = chunkPos;\n this.chunk = chunk;\n this.nextLayer = nextLayer;\n this.maxPoint = maxPoint;\n }\n /**\n @internal\n */\n static create(chunkPos, chunk, nextLayer, maxPoint) {\n return new RangeSet(chunkPos, chunk, nextLayer, maxPoint);\n }\n /**\n @internal\n */\n get length() {\n let last = this.chunk.length - 1;\n return last < 0 ? 0 : Math.max(this.chunkEnd(last), this.nextLayer.length);\n }\n /**\n The number of ranges in the set.\n */\n get size() {\n if (this.isEmpty)\n return 0;\n let size = this.nextLayer.size;\n for (let chunk of this.chunk)\n size += chunk.value.length;\n return size;\n }\n /**\n @internal\n */\n chunkEnd(index) {\n return this.chunkPos[index] + this.chunk[index].length;\n }\n /**\n Update the range set, optionally adding new ranges or filtering\n out existing ones.\n \n (Note: The type parameter is just there as a kludge to work\n around TypeScript variance issues that prevented `RangeSet<X>`\n from being a subtype of `RangeSet<Y>` when `X` is a subtype of\n `Y`.)\n */\n update(updateSpec) {\n let { add = [], sort = false, filterFrom = 0, filterTo = this.length } = updateSpec;\n let filter = updateSpec.filter;\n if (add.length == 0 && !filter)\n return this;\n if (sort)\n add = add.slice().sort(cmpRange);\n if (this.isEmpty)\n return add.length ? RangeSet.of(add) : this;\n let cur = new LayerCursor(this, null, -1).goto(0), i = 0, spill = [];\n let builder = new RangeSetBuilder();\n while (cur.value || i < add.length) {\n if (i < add.length && (cur.from - add[i].from || cur.startSide - add[i].value.startSide) >= 0) {\n let range = add[i++];\n if (!builder.addInner(range.from, range.to, range.value))\n spill.push(range);\n }\n else if (cur.rangeIndex == 1 && cur.chunkIndex < this.chunk.length &&\n (i == add.length || this.chunkEnd(cur.chunkIndex) < add[i].from) &&\n (!filter || filterFrom > this.chunkEnd(cur.chunkIndex) || filterTo < this.chunkPos[cur.chunkIndex]) &&\n builder.addChunk(this.chunkPos[cur.chunkIndex], this.chunk[cur.chunkIndex])) {\n cur.nextChunk();\n }\n else {\n if (!filter || filterFrom > cur.to || filterTo < cur.from || filter(cur.from, cur.to, cur.value)) {\n if (!builder.addInner(cur.from, cur.to, cur.value))\n spill.push(Range$1.create(cur.from, cur.to, cur.value));\n }\n cur.next();\n }\n }\n return builder.finishInner(this.nextLayer.isEmpty && !spill.length ? RangeSet.empty\n : this.nextLayer.update({ add: spill, filter, filterFrom, filterTo }));\n }\n /**\n Map this range set through a set of changes, return the new set.\n */\n map(changes) {\n if (changes.empty || this.isEmpty)\n return this;\n let chunks = [], chunkPos = [], maxPoint = -1;\n for (let i = 0; i < this.chunk.length; i++) {\n let start = this.chunkPos[i], chunk = this.chunk[i];\n let touch = changes.touchesRange(start, start + chunk.length);\n if (touch === false) {\n maxPoint = Math.max(maxPoint, chunk.maxPoint);\n chunks.push(chunk);\n chunkPos.push(changes.mapPos(start));\n }\n else if (touch === true) {\n let { mapped, pos } = chunk.map(start, changes);\n if (mapped) {\n maxPoint = Math.max(maxPoint, mapped.maxPoint);\n chunks.push(mapped);\n chunkPos.push(pos);\n }\n }\n }\n let next = this.nextLayer.map(changes);\n return chunks.length == 0 ? next : new RangeSet(chunkPos, chunks, next || RangeSet.empty, maxPoint);\n }\n /**\n Iterate over the ranges that touch the region `from` to `to`,\n calling `f` for each. There is no guarantee that the ranges will\n be reported in any specific order. When the callback returns\n `false`, iteration stops.\n */\n between(from, to, f) {\n if (this.isEmpty)\n return;\n for (let i = 0; i < this.chunk.length; i++) {\n let start = this.chunkPos[i], chunk = this.chunk[i];\n if (to >= start && from <= start + chunk.length &&\n chunk.between(start, from - start, to - start, f) === false)\n return;\n }\n this.nextLayer.between(from, to, f);\n }\n /**\n Iterate over the ranges in this set, in order, including all\n ranges that end at or after `from`.\n */\n iter(from = 0) {\n return HeapCursor.from([this]).goto(from);\n }\n /**\n @internal\n */\n get isEmpty() { return this.nextLayer == this; }\n /**\n Iterate over the ranges in a collection of sets, in order,\n starting from `from`.\n */\n static iter(sets, from = 0) {\n return HeapCursor.from(sets).goto(from);\n }\n /**\n Iterate over two groups of sets, calling methods on `comparator`\n to notify it of possible differences.\n */\n static compare(oldSets, newSets, \n /**\n This indicates how the underlying data changed between these\n ranges, and is needed to synchronize the iteration.\n */\n textDiff, comparator, \n /**\n Can be used to ignore all non-point ranges, and points below\n the given size. When -1, all ranges are compared.\n */\n minPointSize = -1) {\n let a = oldSets.filter(set => set.maxPoint > 0 || !set.isEmpty && set.maxPoint >= minPointSize);\n let b = newSets.filter(set => set.maxPoint > 0 || !set.isEmpty && set.maxPoint >= minPointSize);\n let sharedChunks = findSharedChunks(a, b, textDiff);\n let sideA = new SpanCursor(a, sharedChunks, minPointSize);\n let sideB = new SpanCursor(b, sharedChunks, minPointSize);\n textDiff.iterGaps((fromA, fromB, length) => compare(sideA, fromA, sideB, fromB, length, comparator));\n if (textDiff.empty && textDiff.length == 0)\n compare(sideA, 0, sideB, 0, 0, comparator);\n }\n /**\n Compare the contents of two groups of range sets, returning true\n if they are equivalent in the given range.\n */\n static eq(oldSets, newSets, from = 0, to) {\n if (to == null)\n to = 1000000000 /* C.Far */ - 1;\n let a = oldSets.filter(set => !set.isEmpty && newSets.indexOf(set) < 0);\n let b = newSets.filter(set => !set.isEmpty && oldSets.indexOf(set) < 0);\n if (a.length != b.length)\n return false;\n if (!a.length)\n return true;\n let sharedChunks = findSharedChunks(a, b);\n let sideA = new SpanCursor(a, sharedChunks, 0).goto(from), sideB = new SpanCursor(b, sharedChunks, 0).goto(from);\n for (;;) {\n if (sideA.to != sideB.to ||\n !sameValues(sideA.active, sideB.active) ||\n sideA.point && (!sideB.point || !sideA.point.eq(sideB.point)))\n return false;\n if (sideA.to > to)\n return true;\n sideA.next();\n sideB.next();\n }\n }\n /**\n Iterate over a group of range sets at the same time, notifying\n the iterator about the ranges covering every given piece of\n content. Returns the open count (see\n [`SpanIterator.span`](https://codemirror.net/6/docs/ref/#state.SpanIterator.span)) at the end\n of the iteration.\n */\n static spans(sets, from, to, iterator, \n /**\n When given and greater than -1, only points of at least this\n size are taken into account.\n */\n minPointSize = -1) {\n let cursor = new SpanCursor(sets, null, minPointSize).goto(from), pos = from;\n let openRanges = cursor.openStart;\n for (;;) {\n let curTo = Math.min(cursor.to, to);\n if (cursor.point) {\n let active = cursor.activeForPoint(cursor.to);\n let openCount = cursor.pointFrom < from ? active.length + 1\n : cursor.point.startSide < 0 ? active.length\n : Math.min(active.length, openRanges);\n iterator.point(pos, curTo, cursor.point, active, openCount, cursor.pointRank);\n openRanges = Math.min(cursor.openEnd(curTo), active.length);\n }\n else if (curTo > pos) {\n iterator.span(pos, curTo, cursor.active, openRanges);\n openRanges = cursor.openEnd(curTo);\n }\n if (cursor.to > to)\n return openRanges + (cursor.point && cursor.to > to ? 1 : 0);\n pos = cursor.to;\n cursor.next();\n }\n }\n /**\n Create a range set for the given range or array of ranges. By\n default, this expects the ranges to be _sorted_ (by start\n position and, if two start at the same position,\n `value.startSide`). You can pass `true` as second argument to\n cause the method to sort them.\n */\n static of(ranges, sort = false) {\n let build = new RangeSetBuilder();\n for (let range of ranges instanceof Range$1 ? [ranges] : sort ? lazySort(ranges) : ranges)\n build.add(range.from, range.to, range.value);\n return build.finish();\n }\n /**\n Join an array of range sets into a single set.\n */\n static join(sets) {\n if (!sets.length)\n return RangeSet.empty;\n let result = sets[sets.length - 1];\n for (let i = sets.length - 2; i >= 0; i--) {\n for (let layer = sets[i]; layer != RangeSet.empty; layer = layer.nextLayer)\n result = new RangeSet(layer.chunkPos, layer.chunk, result, Math.max(layer.maxPoint, result.maxPoint));\n }\n return result;\n }\n }\n /**\n The empty set of ranges.\n */\n RangeSet.empty = /*@__PURE__*/new RangeSet([], [], null, -1);\n function lazySort(ranges) {\n if (ranges.length > 1)\n for (let prev = ranges[0], i = 1; i < ranges.length; i++) {\n let cur = ranges[i];\n if (cmpRange(prev, cur) > 0)\n return ranges.slice().sort(cmpRange);\n prev = cur;\n }\n return ranges;\n }\n RangeSet.empty.nextLayer = RangeSet.empty;\n /**\n A range set builder is a data structure that helps build up a\n [range set](https://codemirror.net/6/docs/ref/#state.RangeSet) directly, without first allocating\n an array of [`Range`](https://codemirror.net/6/docs/ref/#state.Range) objects.\n */\n class RangeSetBuilder {\n finishChunk(newArrays) {\n this.chunks.push(new Chunk(this.from, this.to, this.value, this.maxPoint));\n this.chunkPos.push(this.chunkStart);\n this.chunkStart = -1;\n this.setMaxPoint = Math.max(this.setMaxPoint, this.maxPoint);\n this.maxPoint = -1;\n if (newArrays) {\n this.from = [];\n this.to = [];\n this.value = [];\n }\n }\n /**\n Create an empty builder.\n */\n constructor() {\n this.chunks = [];\n this.chunkPos = [];\n this.chunkStart = -1;\n this.last = null;\n this.lastFrom = -1000000000 /* C.Far */;\n this.lastTo = -1000000000 /* C.Far */;\n this.from = [];\n this.to = [];\n this.value = [];\n this.maxPoint = -1;\n this.setMaxPoint = -1;\n this.nextLayer = null;\n }\n /**\n Add a range. Ranges should be added in sorted (by `from` and\n `value.startSide`) order.\n */\n add(from, to, value) {\n if (!this.addInner(from, to, value))\n (this.nextLayer || (this.nextLayer = new RangeSetBuilder)).add(from, to, value);\n }\n /**\n @internal\n */\n addInner(from, to, value) {\n let diff = from - this.lastTo || value.startSide - this.last.endSide;\n if (diff <= 0 && (from - this.lastFrom || value.startSide - this.last.startSide) < 0)\n throw new Error(\"Ranges must be added sorted by `from` position and `startSide`\");\n if (diff < 0)\n return false;\n if (this.from.length == 250 /* C.ChunkSize */)\n this.finishChunk(true);\n if (this.chunkStart < 0)\n this.chunkStart = from;\n this.from.push(from - this.chunkStart);\n this.to.push(to - this.chunkStart);\n this.last = value;\n this.lastFrom = from;\n this.lastTo = to;\n this.value.push(value);\n if (value.point)\n this.maxPoint = Math.max(this.maxPoint, to - from);\n return true;\n }\n /**\n @internal\n */\n addChunk(from, chunk) {\n if ((from - this.lastTo || chunk.value[0].startSide - this.last.endSide) < 0)\n return false;\n if (this.from.length)\n this.finishChunk(true);\n this.setMaxPoint = Math.max(this.setMaxPoint, chunk.maxPoint);\n this.chunks.push(chunk);\n this.chunkPos.push(from);\n let last = chunk.value.length - 1;\n this.last = chunk.value[last];\n this.lastFrom = chunk.from[last] + from;\n this.lastTo = chunk.to[last] + from;\n return true;\n }\n /**\n Finish the range set. Returns the new set. The builder can't be\n used anymore after this has been called.\n */\n finish() { return this.finishInner(RangeSet.empty); }\n /**\n @internal\n */\n finishInner(next) {\n if (this.from.length)\n this.finishChunk(false);\n if (this.chunks.length == 0)\n return next;\n let result = RangeSet.create(this.chunkPos, this.chunks, this.nextLayer ? this.nextLayer.finishInner(next) : next, this.setMaxPoint);\n this.from = null; // Make sure further `add` calls produce errors\n return result;\n }\n }\n function findSharedChunks(a, b, textDiff) {\n let inA = new Map();\n for (let set of a)\n for (let i = 0; i < set.chunk.length; i++)\n if (set.chunk[i].maxPoint <= 0)\n inA.set(set.chunk[i], set.chunkPos[i]);\n let shared = new Set();\n for (let set of b)\n for (let i = 0; i < set.chunk.length; i++) {\n let known = inA.get(set.chunk[i]);\n if (known != null && (textDiff ? textDiff.mapPos(known) : known) == set.chunkPos[i] &&\n !(textDiff === null || textDiff === void 0 ? void 0 : textDiff.touchesRange(known, known + set.chunk[i].length)))\n shared.add(set.chunk[i]);\n }\n return shared;\n }\n class LayerCursor {\n constructor(layer, skip, minPoint, rank = 0) {\n this.layer = layer;\n this.skip = skip;\n this.minPoint = minPoint;\n this.rank = rank;\n }\n get startSide() { return this.value ? this.value.startSide : 0; }\n get endSide() { return this.value ? this.value.endSide : 0; }\n goto(pos, side = -1000000000 /* C.Far */) {\n this.chunkIndex = this.rangeIndex = 0;\n this.gotoInner(pos, side, false);\n return this;\n }\n gotoInner(pos, side, forward) {\n while (this.chunkIndex < this.layer.chunk.length) {\n let next = this.layer.chunk[this.chunkIndex];\n if (!(this.skip && this.skip.has(next) ||\n this.layer.chunkEnd(this.chunkIndex) < pos ||\n next.maxPoint < this.minPoint))\n break;\n this.chunkIndex++;\n forward = false;\n }\n if (this.chunkIndex < this.layer.chunk.length) {\n let rangeIndex = this.layer.chunk[this.chunkIndex].findIndex(pos - this.layer.chunkPos[this.chunkIndex], side, true);\n if (!forward || this.rangeIndex < rangeIndex)\n this.setRangeIndex(rangeIndex);\n }\n this.next();\n }\n forward(pos, side) {\n if ((this.to - pos || this.endSide - side) < 0)\n this.gotoInner(pos, side, true);\n }\n next() {\n for (;;) {\n if (this.chunkIndex == this.layer.chunk.length) {\n this.from = this.to = 1000000000 /* C.Far */;\n this.value = null;\n break;\n }\n else {\n let chunkPos = this.layer.chunkPos[this.chunkIndex], chunk = this.layer.chunk[this.chunkIndex];\n let from = chunkPos + chunk.from[this.rangeIndex];\n this.from = from;\n this.to = chunkPos + chunk.to[this.rangeIndex];\n this.value = chunk.value[this.rangeIndex];\n this.setRangeIndex(this.rangeIndex + 1);\n if (this.minPoint < 0 || this.value.point && this.to - this.from >= this.minPoint)\n break;\n }\n }\n }\n setRangeIndex(index) {\n if (index == this.layer.chunk[this.chunkIndex].value.length) {\n this.chunkIndex++;\n if (this.skip) {\n while (this.chunkIndex < this.layer.chunk.length && this.skip.has(this.layer.chunk[this.chunkIndex]))\n this.chunkIndex++;\n }\n this.rangeIndex = 0;\n }\n else {\n this.rangeIndex = index;\n }\n }\n nextChunk() {\n this.chunkIndex++;\n this.rangeIndex = 0;\n this.next();\n }\n compare(other) {\n return this.from - other.from || this.startSide - other.startSide || this.rank - other.rank ||\n this.to - other.to || this.endSide - other.endSide;\n }\n }\n class HeapCursor {\n constructor(heap) {\n this.heap = heap;\n }\n static from(sets, skip = null, minPoint = -1) {\n let heap = [];\n for (let i = 0; i < sets.length; i++) {\n for (let cur = sets[i]; !cur.isEmpty; cur = cur.nextLayer) {\n if (cur.maxPoint >= minPoint)\n heap.push(new LayerCursor(cur, skip, minPoint, i));\n }\n }\n return heap.length == 1 ? heap[0] : new HeapCursor(heap);\n }\n get startSide() { return this.value ? this.value.startSide : 0; }\n goto(pos, side = -1000000000 /* C.Far */) {\n for (let cur of this.heap)\n cur.goto(pos, side);\n for (let i = this.heap.length >> 1; i >= 0; i--)\n heapBubble(this.heap, i);\n this.next();\n return this;\n }\n forward(pos, side) {\n for (let cur of this.heap)\n cur.forward(pos, side);\n for (let i = this.heap.length >> 1; i >= 0; i--)\n heapBubble(this.heap, i);\n if ((this.to - pos || this.value.endSide - side) < 0)\n this.next();\n }\n next() {\n if (this.heap.length == 0) {\n this.from = this.to = 1000000000 /* C.Far */;\n this.value = null;\n this.rank = -1;\n }\n else {\n let top = this.heap[0];\n this.from = top.from;\n this.to = top.to;\n this.value = top.value;\n this.rank = top.rank;\n if (top.value)\n top.next();\n heapBubble(this.heap, 0);\n }\n }\n }\n function heapBubble(heap, index) {\n for (let cur = heap[index];;) {\n let childIndex = (index << 1) + 1;\n if (childIndex >= heap.length)\n break;\n let child = heap[childIndex];\n if (childIndex + 1 < heap.length && child.compare(heap[childIndex + 1]) >= 0) {\n child = heap[childIndex + 1];\n childIndex++;\n }\n if (cur.compare(child) < 0)\n break;\n heap[childIndex] = cur;\n heap[index] = child;\n index = childIndex;\n }\n }\n class SpanCursor {\n constructor(sets, skip, minPoint) {\n this.minPoint = minPoint;\n this.active = [];\n this.activeTo = [];\n this.activeRank = [];\n this.minActive = -1;\n // A currently active point range, if any\n this.point = null;\n this.pointFrom = 0;\n this.pointRank = 0;\n this.to = -1000000000 /* C.Far */;\n this.endSide = 0;\n // The amount of open active ranges at the start of the iterator.\n // Not including points.\n this.openStart = -1;\n this.cursor = HeapCursor.from(sets, skip, minPoint);\n }\n goto(pos, side = -1000000000 /* C.Far */) {\n this.cursor.goto(pos, side);\n this.active.length = this.activeTo.length = this.activeRank.length = 0;\n this.minActive = -1;\n this.to = pos;\n this.endSide = side;\n this.openStart = -1;\n this.next();\n return this;\n }\n forward(pos, side) {\n while (this.minActive > -1 && (this.activeTo[this.minActive] - pos || this.active[this.minActive].endSide - side) < 0)\n this.removeActive(this.minActive);\n this.cursor.forward(pos, side);\n }\n removeActive(index) {\n remove(this.active, index);\n remove(this.activeTo, index);\n remove(this.activeRank, index);\n this.minActive = findMinIndex(this.active, this.activeTo);\n }\n addActive(trackOpen) {\n let i = 0, { value, to, rank } = this.cursor;\n // Organize active marks by rank first, then by size\n while (i < this.activeRank.length && (rank - this.activeRank[i] || to - this.activeTo[i]) > 0)\n i++;\n insert(this.active, i, value);\n insert(this.activeTo, i, to);\n insert(this.activeRank, i, rank);\n if (trackOpen)\n insert(trackOpen, i, this.cursor.from);\n this.minActive = findMinIndex(this.active, this.activeTo);\n }\n // After calling this, if `this.point` != null, the next range is a\n // point. Otherwise, it's a regular range, covered by `this.active`.\n next() {\n let from = this.to, wasPoint = this.point;\n this.point = null;\n let trackOpen = this.openStart < 0 ? [] : null;\n for (;;) {\n let a = this.minActive;\n if (a > -1 && (this.activeTo[a] - this.cursor.from || this.active[a].endSide - this.cursor.startSide) < 0) {\n if (this.activeTo[a] > from) {\n this.to = this.activeTo[a];\n this.endSide = this.active[a].endSide;\n break;\n }\n this.removeActive(a);\n if (trackOpen)\n remove(trackOpen, a);\n }\n else if (!this.cursor.value) {\n this.to = this.endSide = 1000000000 /* C.Far */;\n break;\n }\n else if (this.cursor.from > from) {\n this.to = this.cursor.from;\n this.endSide = this.cursor.startSide;\n break;\n }\n else {\n let nextVal = this.cursor.value;\n if (!nextVal.point) { // Opening a range\n this.addActive(trackOpen);\n this.cursor.next();\n }\n else if (wasPoint && this.cursor.to == this.to && this.cursor.from < this.cursor.to) {\n // Ignore any non-empty points that end precisely at the end of the prev point\n this.cursor.next();\n }\n else { // New point\n this.point = nextVal;\n this.pointFrom = this.cursor.from;\n this.pointRank = this.cursor.rank;\n this.to = this.cursor.to;\n this.endSide = nextVal.endSide;\n this.cursor.next();\n this.forward(this.to, this.endSide);\n break;\n }\n }\n }\n if (trackOpen) {\n this.openStart = 0;\n for (let i = trackOpen.length - 1; i >= 0 && trackOpen[i] < from; i--)\n this.openStart++;\n }\n }\n activeForPoint(to) {\n if (!this.active.length)\n return this.active;\n let active = [];\n for (let i = this.active.length - 1; i >= 0; i--) {\n if (this.activeRank[i] < this.pointRank)\n break;\n if (this.activeTo[i] > to || this.activeTo[i] == to && this.active[i].endSide >= this.point.endSide)\n active.push(this.active[i]);\n }\n return active.reverse();\n }\n openEnd(to) {\n let open = 0;\n for (let i = this.activeTo.length - 1; i >= 0 && this.activeTo[i] > to; i--)\n open++;\n return open;\n }\n }\n function compare(a, startA, b, startB, length, comparator) {\n a.goto(startA);\n b.goto(startB);\n let endB = startB + length;\n let pos = startB, dPos = startB - startA;\n for (;;) {\n let diff = (a.to + dPos) - b.to || a.endSide - b.endSide;\n let end = diff < 0 ? a.to + dPos : b.to, clipEnd = Math.min(end, endB);\n if (a.point || b.point) {\n if (!(a.point && b.point && (a.point == b.point || a.point.eq(b.point)) &&\n sameValues(a.activeForPoint(a.to), b.activeForPoint(b.to))))\n comparator.comparePoint(pos, clipEnd, a.point, b.point);\n }\n else {\n if (clipEnd > pos && !sameValues(a.active, b.active))\n comparator.compareRange(pos, clipEnd, a.active, b.active);\n }\n if (end > endB)\n break;\n pos = end;\n if (diff <= 0)\n a.next();\n if (diff >= 0)\n b.next();\n }\n }\n function sameValues(a, b) {\n if (a.length != b.length)\n return false;\n for (let i = 0; i < a.length; i++)\n if (a[i] != b[i] && !a[i].eq(b[i]))\n return false;\n return true;\n }\n function remove(array, index) {\n for (let i = index, e = array.length - 1; i < e; i++)\n array[i] = array[i + 1];\n array.pop();\n }\n function insert(array, index, value) {\n for (let i = array.length - 1; i >= index; i--)\n array[i + 1] = array[i];\n array[index] = value;\n }\n function findMinIndex(value, array) {\n let found = -1, foundPos = 1000000000 /* C.Far */;\n for (let i = 0; i < array.length; i++)\n if ((array[i] - foundPos || value[i].endSide - value[found].endSide) < 0) {\n found = i;\n foundPos = array[i];\n }\n return found;\n }\n\n /**\n Count the column position at the given offset into the string,\n taking extending characters and tab size into account.\n */\n function countColumn(string, tabSize, to = string.length) {\n let n = 0;\n for (let i = 0; i < to;) {\n if (string.charCodeAt(i) == 9) {\n n += tabSize - (n % tabSize);\n i++;\n }\n else {\n n++;\n i = findClusterBreak(string, i);\n }\n }\n return n;\n }\n /**\n Find the offset that corresponds to the given column position in a\n string, taking extending characters and tab size into account. By\n default, the string length is returned when it is too short to\n reach the column. Pass `strict` true to make it return -1 in that\n situation.\n */\n function findColumn(string, col, tabSize, strict) {\n for (let i = 0, n = 0;;) {\n if (n >= col)\n return i;\n if (i == string.length)\n break;\n n += string.charCodeAt(i) == 9 ? tabSize - (n % tabSize) : 1;\n i = findClusterBreak(string, i);\n }\n return strict === true ? -1 : string.length;\n }\n\n const C = \"\\u037c\";\n const COUNT = typeof Symbol == \"undefined\" ? \"__\" + C : Symbol.for(C);\n const SET = typeof Symbol == \"undefined\" ? \"__styleSet\" + Math.floor(Math.random() * 1e8) : Symbol(\"styleSet\");\n const top = typeof globalThis != \"undefined\" ? globalThis : typeof window != \"undefined\" ? window : {};\n\n // :: - Style modules encapsulate a set of CSS rules defined from\n // JavaScript. Their definitions are only available in a given DOM\n // root after it has been _mounted_ there with `StyleModule.mount`.\n //\n // Style modules should be created once and stored somewhere, as\n // opposed to re-creating them every time you need them. The amount of\n // CSS rules generated for a given DOM root is bounded by the amount\n // of style modules that were used. So to avoid leaking rules, don't\n // create these dynamically, but treat them as one-time allocations.\n class StyleModule {\n // :: (Object<Style>, ?{finish: ?(string) \u2192 string})\n // Create a style module from the given spec.\n //\n // When `finish` is given, it is called on regular (non-`@`)\n // selectors (after `&` expansion) to compute the final selector.\n constructor(spec, options) {\n this.rules = [];\n let {finish} = options || {};\n\n function splitSelector(selector) {\n return /^@/.test(selector) ? [selector] : selector.split(/,\\s*/)\n }\n\n function render(selectors, spec, target, isKeyframes) {\n let local = [], isAt = /^@(\\w+)\\b/.exec(selectors[0]), keyframes = isAt && isAt[1] == \"keyframes\";\n if (isAt && spec == null) return target.push(selectors[0] + \";\")\n for (let prop in spec) {\n let value = spec[prop];\n if (/&/.test(prop)) {\n render(prop.split(/,\\s*/).map(part => selectors.map(sel => part.replace(/&/, sel))).reduce((a, b) => a.concat(b)),\n value, target);\n } else if (value && typeof value == \"object\") {\n if (!isAt) throw new RangeError(\"The value of a property (\" + prop + \") should be a primitive value.\")\n render(splitSelector(prop), value, local, keyframes);\n } else if (value != null) {\n local.push(prop.replace(/_.*/, \"\").replace(/[A-Z]/g, l => \"-\" + l.toLowerCase()) + \": \" + value + \";\");\n }\n }\n if (local.length || keyframes) {\n target.push((finish && !isAt && !isKeyframes ? selectors.map(finish) : selectors).join(\", \") +\n \" {\" + local.join(\" \") + \"}\");\n }\n }\n\n for (let prop in spec) render(splitSelector(prop), spec[prop], this.rules);\n }\n\n // :: () \u2192 string\n // Returns a string containing the module's CSS rules.\n getRules() { return this.rules.join(\"\\n\") }\n\n // :: () \u2192 string\n // Generate a new unique CSS class name.\n static newName() {\n let id = top[COUNT] || 1;\n top[COUNT] = id + 1;\n return C + id.toString(36)\n }\n\n // :: (union<Document, ShadowRoot>, union<[StyleModule], StyleModule>, ?{nonce: ?string})\n //\n // Mount the given set of modules in the given DOM root, which ensures\n // that the CSS rules defined by the module are available in that\n // context.\n //\n // Rules are only added to the document once per root.\n //\n // Rule order will follow the order of the modules, so that rules from\n // modules later in the array take precedence of those from earlier\n // modules. If you call this function multiple times for the same root\n // in a way that changes the order of already mounted modules, the old\n // order will be changed.\n //\n // If a Content Security Policy nonce is provided, it is added to\n // the `<style>` tag generated by the library.\n static mount(root, modules, options) {\n let set = root[SET], nonce = options && options.nonce;\n if (!set) set = new StyleSet(root, nonce);\n else if (nonce) set.setNonce(nonce);\n set.mount(Array.isArray(modules) ? modules : [modules], root);\n }\n }\n\n let adoptedSet = new Map; //<Document, StyleSet>\n\n class StyleSet {\n constructor(root, nonce) {\n let doc = root.ownerDocument || root, win = doc.defaultView;\n if (!root.head && root.adoptedStyleSheets && win.CSSStyleSheet) {\n let adopted = adoptedSet.get(doc);\n if (adopted) return root[SET] = adopted\n this.sheet = new win.CSSStyleSheet;\n adoptedSet.set(doc, this);\n } else {\n this.styleTag = doc.createElement(\"style\");\n if (nonce) this.styleTag.setAttribute(\"nonce\", nonce);\n }\n this.modules = [];\n root[SET] = this;\n }\n\n mount(modules, root) {\n let sheet = this.sheet;\n let pos = 0 /* Current rule offset */, j = 0; /* Index into this.modules */\n for (let i = 0; i < modules.length; i++) {\n let mod = modules[i], index = this.modules.indexOf(mod);\n if (index < j && index > -1) { // Ordering conflict\n this.modules.splice(index, 1);\n j--;\n index = -1;\n }\n if (index == -1) {\n this.modules.splice(j++, 0, mod);\n if (sheet) for (let k = 0; k < mod.rules.length; k++)\n sheet.insertRule(mod.rules[k], pos++);\n } else {\n while (j < index) pos += this.modules[j++].rules.length;\n pos += mod.rules.length;\n j++;\n }\n }\n\n if (sheet) {\n if (root.adoptedStyleSheets.indexOf(this.sheet) < 0)\n root.adoptedStyleSheets = [this.sheet, ...root.adoptedStyleSheets];\n } else {\n let text = \"\";\n for (let i = 0; i < this.modules.length; i++)\n text += this.modules[i].getRules() + \"\\n\";\n this.styleTag.textContent = text;\n let target = root.head || root;\n if (this.styleTag.parentNode != target)\n target.insertBefore(this.styleTag, target.firstChild);\n }\n }\n\n setNonce(nonce) {\n if (this.styleTag && this.styleTag.getAttribute(\"nonce\") != nonce)\n this.styleTag.setAttribute(\"nonce\", nonce);\n }\n }\n\n // Style::Object<union<Style,string>>\n //\n // A style is an object that, in the simple case, maps CSS property\n // names to strings holding their values, as in `{color: \"red\",\n // fontWeight: \"bold\"}`. The property names can be given in\n // camel-case\u2014the library will insert a dash before capital letters\n // when converting them to CSS.\n //\n // If you include an underscore in a property name, it and everything\n // after it will be removed from the output, which can be useful when\n // providing a property multiple times, for browser compatibility\n // reasons.\n //\n // A property in a style object can also be a sub-selector, which\n // extends the current context to add a pseudo-selector or a child\n // selector. Such a property should contain a `&` character, which\n // will be replaced by the current selector. For example `{\"&:before\":\n // {content: '\"hi\"'}}`. Sub-selectors and regular properties can\n // freely be mixed in a given object. Any property containing a `&` is\n // assumed to be a sub-selector.\n //\n // Finally, a property can specify an @-block to be wrapped around the\n // styles defined inside the object that's the property's value. For\n // example to create a media query you can do `{\"@media screen and\n // (min-width: 400px)\": {...}}`.\n\n var base = {\n 8: \"Backspace\",\n 9: \"Tab\",\n 10: \"Enter\",\n 12: \"NumLock\",\n 13: \"Enter\",\n 16: \"Shift\",\n 17: \"Control\",\n 18: \"Alt\",\n 20: \"CapsLock\",\n 27: \"Escape\",\n 32: \" \",\n 33: \"PageUp\",\n 34: \"PageDown\",\n 35: \"End\",\n 36: \"Home\",\n 37: \"ArrowLeft\",\n 38: \"ArrowUp\",\n 39: \"ArrowRight\",\n 40: \"ArrowDown\",\n 44: \"PrintScreen\",\n 45: \"Insert\",\n 46: \"Delete\",\n 59: \";\",\n 61: \"=\",\n 91: \"Meta\",\n 92: \"Meta\",\n 106: \"*\",\n 107: \"+\",\n 108: \",\",\n 109: \"-\",\n 110: \".\",\n 111: \"/\",\n 144: \"NumLock\",\n 145: \"ScrollLock\",\n 160: \"Shift\",\n 161: \"Shift\",\n 162: \"Control\",\n 163: \"Control\",\n 164: \"Alt\",\n 165: \"Alt\",\n 173: \"-\",\n 186: \";\",\n 187: \"=\",\n 188: \",\",\n 189: \"-\",\n 190: \".\",\n 191: \"/\",\n 192: \"`\",\n 219: \"[\",\n 220: \"\\\\\",\n 221: \"]\",\n 222: \"'\"\n };\n\n var shift = {\n 48: \")\",\n 49: \"!\",\n 50: \"@\",\n 51: \"#\",\n 52: \"$\",\n 53: \"%\",\n 54: \"^\",\n 55: \"&\",\n 56: \"*\",\n 57: \"(\",\n 59: \":\",\n 61: \"+\",\n 173: \"_\",\n 186: \":\",\n 187: \"+\",\n 188: \"<\",\n 189: \"_\",\n 190: \">\",\n 191: \"?\",\n 192: \"~\",\n 219: \"{\",\n 220: \"|\",\n 221: \"}\",\n 222: \"\\\"\"\n };\n\n var mac = typeof navigator != \"undefined\" && /Mac/.test(navigator.platform);\n var ie$1 = typeof navigator != \"undefined\" && /MSIE \\d|Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(navigator.userAgent);\n\n // Fill in the digit keys\n for (var i = 0; i < 10; i++) base[48 + i] = base[96 + i] = String(i);\n\n // The function keys\n for (var i = 1; i <= 24; i++) base[i + 111] = \"F\" + i;\n\n // And the alphabetic keys\n for (var i = 65; i <= 90; i++) {\n base[i] = String.fromCharCode(i + 32);\n shift[i] = String.fromCharCode(i);\n }\n\n // For each code that doesn't have a shift-equivalent, copy the base name\n for (var code$1 in base) if (!shift.hasOwnProperty(code$1)) shift[code$1] = base[code$1];\n\n function keyName(event) {\n // On macOS, keys held with Shift and Cmd don't reflect the effect of Shift in `.key`.\n // On IE, shift effect is never included in `.key`.\n var ignoreKey = mac && event.metaKey && event.shiftKey && !event.ctrlKey && !event.altKey ||\n ie$1 && event.shiftKey && event.key && event.key.length == 1 ||\n event.key == \"Unidentified\";\n var name = (!ignoreKey && event.key) ||\n (event.shiftKey ? shift : base)[event.keyCode] ||\n event.key || \"Unidentified\";\n // Edge sometimes produces wrong names (Issue #3)\n if (name == \"Esc\") name = \"Escape\";\n if (name == \"Del\") name = \"Delete\";\n // https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8860571/\n if (name == \"Left\") name = \"ArrowLeft\";\n if (name == \"Up\") name = \"ArrowUp\";\n if (name == \"Right\") name = \"ArrowRight\";\n if (name == \"Down\") name = \"ArrowDown\";\n return name\n }\n\n function getSelection(root) {\n let target;\n // Browsers differ on whether shadow roots have a getSelection\n // method. If it exists, use that, otherwise, call it on the\n // document.\n if (root.nodeType == 11) { // Shadow root\n target = root.getSelection ? root : root.ownerDocument;\n }\n else {\n target = root;\n }\n return target.getSelection();\n }\n function contains$1(dom, node) {\n return node ? dom == node || dom.contains(node.nodeType != 1 ? node.parentNode : node) : false;\n }\n function deepActiveElement(doc) {\n let elt = doc.activeElement;\n while (elt && elt.shadowRoot)\n elt = elt.shadowRoot.activeElement;\n return elt;\n }\n function hasSelection(dom, selection) {\n if (!selection.anchorNode)\n return false;\n try {\n // Firefox will raise 'permission denied' errors when accessing\n // properties of `sel.anchorNode` when it's in a generated CSS\n // element.\n return contains$1(dom, selection.anchorNode);\n }\n catch (_) {\n return false;\n }\n }\n function clientRectsFor(dom) {\n if (dom.nodeType == 3)\n return textRange(dom, 0, dom.nodeValue.length).getClientRects();\n else if (dom.nodeType == 1)\n return dom.getClientRects();\n else\n return [];\n }\n // Scans forward and backward through DOM positions equivalent to the\n // given one to see if the two are in the same place (i.e. after a\n // text node vs at the end of that text node)\n function isEquivalentPosition(node, off, targetNode, targetOff) {\n return targetNode ? (scanFor(node, off, targetNode, targetOff, -1) ||\n scanFor(node, off, targetNode, targetOff, 1)) : false;\n }\n function domIndex(node) {\n for (var index = 0;; index++) {\n node = node.previousSibling;\n if (!node)\n return index;\n }\n }\n function isBlockElement(node) {\n return node.nodeType == 1 && /^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\\d|SECTION|PRE)$/.test(node.nodeName);\n }\n function scanFor(node, off, targetNode, targetOff, dir) {\n for (;;) {\n if (node == targetNode && off == targetOff)\n return true;\n if (off == (dir < 0 ? 0 : maxOffset(node))) {\n if (node.nodeName == \"DIV\")\n return false;\n let parent = node.parentNode;\n if (!parent || parent.nodeType != 1)\n return false;\n off = domIndex(node) + (dir < 0 ? 0 : 1);\n node = parent;\n }\n else if (node.nodeType == 1) {\n node = node.childNodes[off + (dir < 0 ? -1 : 0)];\n if (node.nodeType == 1 && node.contentEditable == \"false\")\n return false;\n off = dir < 0 ? maxOffset(node) : 0;\n }\n else {\n return false;\n }\n }\n }\n function maxOffset(node) {\n return node.nodeType == 3 ? node.nodeValue.length : node.childNodes.length;\n }\n function flattenRect(rect, left) {\n let x = left ? rect.left : rect.right;\n return { left: x, right: x, top: rect.top, bottom: rect.bottom };\n }\n function windowRect(win) {\n let vp = win.visualViewport;\n if (vp)\n return {\n left: 0, right: vp.width,\n top: 0, bottom: vp.height\n };\n return { left: 0, right: win.innerWidth,\n top: 0, bottom: win.innerHeight };\n }\n function getScale(elt, rect) {\n let scaleX = rect.width / elt.offsetWidth;\n let scaleY = rect.height / elt.offsetHeight;\n if (scaleX > 0.995 && scaleX < 1.005 || !isFinite(scaleX) || Math.abs(rect.width - elt.offsetWidth) < 1)\n scaleX = 1;\n if (scaleY > 0.995 && scaleY < 1.005 || !isFinite(scaleY) || Math.abs(rect.height - elt.offsetHeight) < 1)\n scaleY = 1;\n return { scaleX, scaleY };\n }\n function scrollRectIntoView(dom, rect, side, x, y, xMargin, yMargin, ltr) {\n let doc = dom.ownerDocument, win = doc.defaultView || window;\n for (let cur = dom, stop = false; cur && !stop;) {\n if (cur.nodeType == 1) { // Element\n let bounding, top = cur == doc.body;\n let scaleX = 1, scaleY = 1;\n if (top) {\n bounding = windowRect(win);\n }\n else {\n if (/^(fixed|sticky)$/.test(getComputedStyle(cur).position))\n stop = true;\n if (cur.scrollHeight <= cur.clientHeight && cur.scrollWidth <= cur.clientWidth) {\n cur = cur.assignedSlot || cur.parentNode;\n continue;\n }\n let rect = cur.getBoundingClientRect();\n ({ scaleX, scaleY } = getScale(cur, rect));\n // Make sure scrollbar width isn't included in the rectangle\n bounding = { left: rect.left, right: rect.left + cur.clientWidth * scaleX,\n top: rect.top, bottom: rect.top + cur.clientHeight * scaleY };\n }\n let moveX = 0, moveY = 0;\n if (y == \"nearest\") {\n if (rect.top < bounding.top) {\n moveY = -(bounding.top - rect.top + yMargin);\n if (side > 0 && rect.bottom > bounding.bottom + moveY)\n moveY = rect.bottom - bounding.bottom + moveY + yMargin;\n }\n else if (rect.bottom > bounding.bottom) {\n moveY = rect.bottom - bounding.bottom + yMargin;\n if (side < 0 && (rect.top - moveY) < bounding.top)\n moveY = -(bounding.top + moveY - rect.top + yMargin);\n }\n }\n else {\n let rectHeight = rect.bottom - rect.top, boundingHeight = bounding.bottom - bounding.top;\n let targetTop = y == \"center\" && rectHeight <= boundingHeight ? rect.top + rectHeight / 2 - boundingHeight / 2 :\n y == \"start\" || y == \"center\" && side < 0 ? rect.top - yMargin :\n rect.bottom - boundingHeight + yMargin;\n moveY = targetTop - bounding.top;\n }\n if (x == \"nearest\") {\n if (rect.left < bounding.left) {\n moveX = -(bounding.left - rect.left + xMargin);\n if (side > 0 && rect.right > bounding.right + moveX)\n moveX = rect.right - bounding.right + moveX + xMargin;\n }\n else if (rect.right > bounding.right) {\n moveX = rect.right - bounding.right + xMargin;\n if (side < 0 && rect.left < bounding.left + moveX)\n moveX = -(bounding.left + moveX - rect.left + xMargin);\n }\n }\n else {\n let targetLeft = x == \"center\" ? rect.left + (rect.right - rect.left) / 2 - (bounding.right - bounding.left) / 2 :\n (x == \"start\") == ltr ? rect.left - xMargin :\n rect.right - (bounding.right - bounding.left) + xMargin;\n moveX = targetLeft - bounding.left;\n }\n if (moveX || moveY) {\n if (top) {\n win.scrollBy(moveX, moveY);\n }\n else {\n let movedX = 0, movedY = 0;\n if (moveY) {\n let start = cur.scrollTop;\n cur.scrollTop += moveY / scaleY;\n movedY = (cur.scrollTop - start) * scaleY;\n }\n if (moveX) {\n let start = cur.scrollLeft;\n cur.scrollLeft += moveX / scaleX;\n movedX = (cur.scrollLeft - start) * scaleX;\n }\n rect = { left: rect.left - movedX, top: rect.top - movedY,\n right: rect.right - movedX, bottom: rect.bottom - movedY };\n if (movedX && Math.abs(movedX - moveX) < 1)\n x = \"nearest\";\n if (movedY && Math.abs(movedY - moveY) < 1)\n y = \"nearest\";\n }\n }\n if (top)\n break;\n cur = cur.assignedSlot || cur.parentNode;\n }\n else if (cur.nodeType == 11) { // A shadow root\n cur = cur.host;\n }\n else {\n break;\n }\n }\n }\n function scrollableParents(dom) {\n let doc = dom.ownerDocument, x, y;\n for (let cur = dom.parentNode; cur;) {\n if (cur == doc.body || (x && y)) {\n break;\n }\n else if (cur.nodeType == 1) {\n if (!y && cur.scrollHeight > cur.clientHeight)\n y = cur;\n if (!x && cur.scrollWidth > cur.clientWidth)\n x = cur;\n cur = cur.assignedSlot || cur.parentNode;\n }\n else if (cur.nodeType == 11) {\n cur = cur.host;\n }\n else {\n break;\n }\n }\n return { x, y };\n }\n class DOMSelectionState {\n constructor() {\n this.anchorNode = null;\n this.anchorOffset = 0;\n this.focusNode = null;\n this.focusOffset = 0;\n }\n eq(domSel) {\n return this.anchorNode == domSel.anchorNode && this.anchorOffset == domSel.anchorOffset &&\n this.focusNode == domSel.focusNode && this.focusOffset == domSel.focusOffset;\n }\n setRange(range) {\n let { anchorNode, focusNode } = range;\n // Clip offsets to node size to avoid crashes when Safari reports bogus offsets (#1152)\n this.set(anchorNode, Math.min(range.anchorOffset, anchorNode ? maxOffset(anchorNode) : 0), focusNode, Math.min(range.focusOffset, focusNode ? maxOffset(focusNode) : 0));\n }\n set(anchorNode, anchorOffset, focusNode, focusOffset) {\n this.anchorNode = anchorNode;\n this.anchorOffset = anchorOffset;\n this.focusNode = focusNode;\n this.focusOffset = focusOffset;\n }\n }\n let preventScrollSupported = null;\n // Feature-detects support for .focus({preventScroll: true}), and uses\n // a fallback kludge when not supported.\n function focusPreventScroll(dom) {\n if (dom.setActive)\n return dom.setActive(); // in IE\n if (preventScrollSupported)\n return dom.focus(preventScrollSupported);\n let stack = [];\n for (let cur = dom; cur; cur = cur.parentNode) {\n stack.push(cur, cur.scrollTop, cur.scrollLeft);\n if (cur == cur.ownerDocument)\n break;\n }\n dom.focus(preventScrollSupported == null ? {\n get preventScroll() {\n preventScrollSupported = { preventScroll: true };\n return true;\n }\n } : undefined);\n if (!preventScrollSupported) {\n preventScrollSupported = false;\n for (let i = 0; i < stack.length;) {\n let elt = stack[i++], top = stack[i++], left = stack[i++];\n if (elt.scrollTop != top)\n elt.scrollTop = top;\n if (elt.scrollLeft != left)\n elt.scrollLeft = left;\n }\n }\n }\n let scratchRange;\n function textRange(node, from, to = from) {\n let range = scratchRange || (scratchRange = document.createRange());\n range.setEnd(node, to);\n range.setStart(node, from);\n return range;\n }\n function dispatchKey(elt, name, code, mods) {\n let options = { key: name, code: name, keyCode: code, which: code, cancelable: true };\n if (mods)\n ({ altKey: options.altKey, ctrlKey: options.ctrlKey, shiftKey: options.shiftKey, metaKey: options.metaKey } = mods);\n let down = new KeyboardEvent(\"keydown\", options);\n down.synthetic = true;\n elt.dispatchEvent(down);\n let up = new KeyboardEvent(\"keyup\", options);\n up.synthetic = true;\n elt.dispatchEvent(up);\n return down.defaultPrevented || up.defaultPrevented;\n }\n function getRoot(node) {\n while (node) {\n if (node && (node.nodeType == 9 || node.nodeType == 11 && node.host))\n return node;\n node = node.assignedSlot || node.parentNode;\n }\n return null;\n }\n function clearAttributes(node) {\n while (node.attributes.length)\n node.removeAttributeNode(node.attributes[0]);\n }\n function atElementStart(doc, selection) {\n let node = selection.focusNode, offset = selection.focusOffset;\n if (!node || selection.anchorNode != node || selection.anchorOffset != offset)\n return false;\n // Safari can report bogus offsets (#1152)\n offset = Math.min(offset, maxOffset(node));\n for (;;) {\n if (offset) {\n if (node.nodeType != 1)\n return false;\n let prev = node.childNodes[offset - 1];\n if (prev.contentEditable == \"false\")\n offset--;\n else {\n node = prev;\n offset = maxOffset(node);\n }\n }\n else if (node == doc) {\n return true;\n }\n else {\n offset = domIndex(node);\n node = node.parentNode;\n }\n }\n }\n function isScrolledToBottom(elt) {\n return elt.scrollTop > Math.max(1, elt.scrollHeight - elt.clientHeight - 4);\n }\n function textNodeBefore(startNode, startOffset) {\n for (let node = startNode, offset = startOffset;;) {\n if (node.nodeType == 3 && offset > 0) {\n return { node: node, offset: offset };\n }\n else if (node.nodeType == 1 && offset > 0) {\n if (node.contentEditable == \"false\")\n return null;\n node = node.childNodes[offset - 1];\n offset = maxOffset(node);\n }\n else if (node.parentNode && !isBlockElement(node)) {\n offset = domIndex(node);\n node = node.parentNode;\n }\n else {\n return null;\n }\n }\n }\n function textNodeAfter(startNode, startOffset) {\n for (let node = startNode, offset = startOffset;;) {\n if (node.nodeType == 3 && offset < node.nodeValue.length) {\n return { node: node, offset: offset };\n }\n else if (node.nodeType == 1 && offset < node.childNodes.length) {\n if (node.contentEditable == \"false\")\n return null;\n node = node.childNodes[offset];\n offset = 0;\n }\n else if (node.parentNode && !isBlockElement(node)) {\n offset = domIndex(node) + 1;\n node = node.parentNode;\n }\n else {\n return null;\n }\n }\n }\n\n class DOMPos {\n constructor(node, offset, precise = true) {\n this.node = node;\n this.offset = offset;\n this.precise = precise;\n }\n static before(dom, precise) { return new DOMPos(dom.parentNode, domIndex(dom), precise); }\n static after(dom, precise) { return new DOMPos(dom.parentNode, domIndex(dom) + 1, precise); }\n }\n const noChildren = [];\n class ContentView {\n constructor() {\n this.parent = null;\n this.dom = null;\n this.flags = 2 /* ViewFlag.NodeDirty */;\n }\n get overrideDOMText() { return null; }\n get posAtStart() {\n return this.parent ? this.parent.posBefore(this) : 0;\n }\n get posAtEnd() {\n return this.posAtStart + this.length;\n }\n posBefore(view) {\n let pos = this.posAtStart;\n for (let child of this.children) {\n if (child == view)\n return pos;\n pos += child.length + child.breakAfter;\n }\n throw new RangeError(\"Invalid child in posBefore\");\n }\n posAfter(view) {\n return this.posBefore(view) + view.length;\n }\n sync(view, track) {\n if (this.flags & 2 /* ViewFlag.NodeDirty */) {\n let parent = this.dom;\n let prev = null, next;\n for (let child of this.children) {\n if (child.flags & 7 /* ViewFlag.Dirty */) {\n if (!child.dom && (next = prev ? prev.nextSibling : parent.firstChild)) {\n let contentView = ContentView.get(next);\n if (!contentView || !contentView.parent && contentView.canReuseDOM(child))\n child.reuseDOM(next);\n }\n child.sync(view, track);\n child.flags &= ~7 /* ViewFlag.Dirty */;\n }\n next = prev ? prev.nextSibling : parent.firstChild;\n if (track && !track.written && track.node == parent && next != child.dom)\n track.written = true;\n if (child.dom.parentNode == parent) {\n while (next && next != child.dom)\n next = rm$1(next);\n }\n else {\n parent.insertBefore(child.dom, next);\n }\n prev = child.dom;\n }\n next = prev ? prev.nextSibling : parent.firstChild;\n if (next && track && track.node == parent)\n track.written = true;\n while (next)\n next = rm$1(next);\n }\n else if (this.flags & 1 /* ViewFlag.ChildDirty */) {\n for (let child of this.children)\n if (child.flags & 7 /* ViewFlag.Dirty */) {\n child.sync(view, track);\n child.flags &= ~7 /* ViewFlag.Dirty */;\n }\n }\n }\n reuseDOM(_dom) { }\n localPosFromDOM(node, offset) {\n let after;\n if (node == this.dom) {\n after = this.dom.childNodes[offset];\n }\n else {\n let bias = maxOffset(node) == 0 ? 0 : offset == 0 ? -1 : 1;\n for (;;) {\n let parent = node.parentNode;\n if (parent == this.dom)\n break;\n if (bias == 0 && parent.firstChild != parent.lastChild) {\n if (node == parent.firstChild)\n bias = -1;\n else\n bias = 1;\n }\n node = parent;\n }\n if (bias < 0)\n after = node;\n else\n after = node.nextSibling;\n }\n if (after == this.dom.firstChild)\n return 0;\n while (after && !ContentView.get(after))\n after = after.nextSibling;\n if (!after)\n return this.length;\n for (let i = 0, pos = 0;; i++) {\n let child = this.children[i];\n if (child.dom == after)\n return pos;\n pos += child.length + child.breakAfter;\n }\n }\n domBoundsAround(from, to, offset = 0) {\n let fromI = -1, fromStart = -1, toI = -1, toEnd = -1;\n for (let i = 0, pos = offset, prevEnd = offset; i < this.children.length; i++) {\n let child = this.children[i], end = pos + child.length;\n if (pos < from && end > to)\n return child.domBoundsAround(from, to, pos);\n if (end >= from && fromI == -1) {\n fromI = i;\n fromStart = pos;\n }\n if (pos > to && child.dom.parentNode == this.dom) {\n toI = i;\n toEnd = prevEnd;\n break;\n }\n prevEnd = end;\n pos = end + child.breakAfter;\n }\n return { from: fromStart, to: toEnd < 0 ? offset + this.length : toEnd,\n startDOM: (fromI ? this.children[fromI - 1].dom.nextSibling : null) || this.dom.firstChild,\n endDOM: toI < this.children.length && toI >= 0 ? this.children[toI].dom : null };\n }\n markDirty(andParent = false) {\n this.flags |= 2 /* ViewFlag.NodeDirty */;\n this.markParentsDirty(andParent);\n }\n markParentsDirty(childList) {\n for (let parent = this.parent; parent; parent = parent.parent) {\n if (childList)\n parent.flags |= 2 /* ViewFlag.NodeDirty */;\n if (parent.flags & 1 /* ViewFlag.ChildDirty */)\n return;\n parent.flags |= 1 /* ViewFlag.ChildDirty */;\n childList = false;\n }\n }\n setParent(parent) {\n if (this.parent != parent) {\n this.parent = parent;\n if (this.flags & 7 /* ViewFlag.Dirty */)\n this.markParentsDirty(true);\n }\n }\n setDOM(dom) {\n if (this.dom == dom)\n return;\n if (this.dom)\n this.dom.cmView = null;\n this.dom = dom;\n dom.cmView = this;\n }\n get rootView() {\n for (let v = this;;) {\n let parent = v.parent;\n if (!parent)\n return v;\n v = parent;\n }\n }\n replaceChildren(from, to, children = noChildren) {\n this.markDirty();\n for (let i = from; i < to; i++) {\n let child = this.children[i];\n if (child.parent == this && children.indexOf(child) < 0)\n child.destroy();\n }\n this.children.splice(from, to - from, ...children);\n for (let i = 0; i < children.length; i++)\n children[i].setParent(this);\n }\n ignoreMutation(_rec) { return false; }\n ignoreEvent(_event) { return false; }\n childCursor(pos = this.length) {\n return new ChildCursor(this.children, pos, this.children.length);\n }\n childPos(pos, bias = 1) {\n return this.childCursor().findPos(pos, bias);\n }\n toString() {\n let name = this.constructor.name.replace(\"View\", \"\");\n return name + (this.children.length ? \"(\" + this.children.join() + \")\" :\n this.length ? \"[\" + (name == \"Text\" ? this.text : this.length) + \"]\" : \"\") +\n (this.breakAfter ? \"#\" : \"\");\n }\n static get(node) { return node.cmView; }\n get isEditable() { return true; }\n get isWidget() { return false; }\n get isHidden() { return false; }\n merge(from, to, source, hasStart, openStart, openEnd) {\n return false;\n }\n become(other) { return false; }\n canReuseDOM(other) {\n return other.constructor == this.constructor && !((this.flags | other.flags) & 8 /* ViewFlag.Composition */);\n }\n // When this is a zero-length view with a side, this should return a\n // number <= 0 to indicate it is before its position, or a\n // number > 0 when after its position.\n getSide() { return 0; }\n destroy() {\n for (let child of this.children)\n if (child.parent == this)\n child.destroy();\n this.parent = null;\n }\n }\n ContentView.prototype.breakAfter = 0;\n // Remove a DOM node and return its next sibling.\n function rm$1(dom) {\n let next = dom.nextSibling;\n dom.parentNode.removeChild(dom);\n return next;\n }\n class ChildCursor {\n constructor(children, pos, i) {\n this.children = children;\n this.pos = pos;\n this.i = i;\n this.off = 0;\n }\n findPos(pos, bias = 1) {\n for (;;) {\n if (pos > this.pos || pos == this.pos &&\n (bias > 0 || this.i == 0 || this.children[this.i - 1].breakAfter)) {\n this.off = pos - this.pos;\n return this;\n }\n let next = this.children[--this.i];\n this.pos -= next.length + next.breakAfter;\n }\n }\n }\n function replaceRange(parent, fromI, fromOff, toI, toOff, insert, breakAtStart, openStart, openEnd) {\n let { children } = parent;\n let before = children.length ? children[fromI] : null;\n let last = insert.length ? insert[insert.length - 1] : null;\n let breakAtEnd = last ? last.breakAfter : breakAtStart;\n // Change within a single child\n if (fromI == toI && before && !breakAtStart && !breakAtEnd && insert.length < 2 &&\n before.merge(fromOff, toOff, insert.length ? last : null, fromOff == 0, openStart, openEnd))\n return;\n if (toI < children.length) {\n let after = children[toI];\n // Make sure the end of the child after the update is preserved in `after`\n if (after && (toOff < after.length || after.breakAfter && (last === null || last === void 0 ? void 0 : last.breakAfter))) {\n // If we're splitting a child, separate part of it to avoid that\n // being mangled when updating the child before the update.\n if (fromI == toI) {\n after = after.split(toOff);\n toOff = 0;\n }\n // If the element after the replacement should be merged with\n // the last replacing element, update `content`\n if (!breakAtEnd && last && after.merge(0, toOff, last, true, 0, openEnd)) {\n insert[insert.length - 1] = after;\n }\n else {\n // Remove the start of the after element, if necessary, and\n // add it to `content`.\n if (toOff || after.children.length && !after.children[0].length)\n after.merge(0, toOff, null, false, 0, openEnd);\n insert.push(after);\n }\n }\n else if (after === null || after === void 0 ? void 0 : after.breakAfter) {\n // The element at `toI` is entirely covered by this range.\n // Preserve its line break, if any.\n if (last)\n last.breakAfter = 1;\n else\n breakAtStart = 1;\n }\n // Since we've handled the next element from the current elements\n // now, make sure `toI` points after that.\n toI++;\n }\n if (before) {\n before.breakAfter = breakAtStart;\n if (fromOff > 0) {\n if (!breakAtStart && insert.length && before.merge(fromOff, before.length, insert[0], false, openStart, 0)) {\n before.breakAfter = insert.shift().breakAfter;\n }\n else if (fromOff < before.length || before.children.length && before.children[before.children.length - 1].length == 0) {\n before.merge(fromOff, before.length, null, false, openStart, 0);\n }\n fromI++;\n }\n }\n // Try to merge widgets on the boundaries of the replacement\n while (fromI < toI && insert.length) {\n if (children[toI - 1].become(insert[insert.length - 1])) {\n toI--;\n insert.pop();\n openEnd = insert.length ? 0 : openStart;\n }\n else if (children[fromI].become(insert[0])) {\n fromI++;\n insert.shift();\n openStart = insert.length ? 0 : openEnd;\n }\n else {\n break;\n }\n }\n if (!insert.length && fromI && toI < children.length && !children[fromI - 1].breakAfter &&\n children[toI].merge(0, 0, children[fromI - 1], false, openStart, openEnd))\n fromI--;\n if (fromI < toI || insert.length)\n parent.replaceChildren(fromI, toI, insert);\n }\n function mergeChildrenInto(parent, from, to, insert, openStart, openEnd) {\n let cur = parent.childCursor();\n let { i: toI, off: toOff } = cur.findPos(to, 1);\n let { i: fromI, off: fromOff } = cur.findPos(from, -1);\n let dLen = from - to;\n for (let view of insert)\n dLen += view.length;\n parent.length += dLen;\n replaceRange(parent, fromI, fromOff, toI, toOff, insert, 0, openStart, openEnd);\n }\n\n let nav = typeof navigator != \"undefined\" ? navigator : { userAgent: \"\", vendor: \"\", platform: \"\" };\n let doc = typeof document != \"undefined\" ? document : { documentElement: { style: {} } };\n const ie_edge = /*@__PURE__*//Edge\\/(\\d+)/.exec(nav.userAgent);\n const ie_upto10 = /*@__PURE__*//MSIE \\d/.test(nav.userAgent);\n const ie_11up = /*@__PURE__*//Trident\\/(?:[7-9]|\\d{2,})\\..*rv:(\\d+)/.exec(nav.userAgent);\n const ie = !!(ie_upto10 || ie_11up || ie_edge);\n const gecko = !ie && /*@__PURE__*//gecko\\/(\\d+)/i.test(nav.userAgent);\n const chrome = !ie && /*@__PURE__*//Chrome\\/(\\d+)/.exec(nav.userAgent);\n const webkit = \"webkitFontSmoothing\" in doc.documentElement.style;\n const safari = !ie && /*@__PURE__*//Apple Computer/.test(nav.vendor);\n const ios = safari && (/*@__PURE__*//Mobile\\/\\w+/.test(nav.userAgent) || nav.maxTouchPoints > 2);\n var browser = {\n mac: ios || /*@__PURE__*//Mac/.test(nav.platform),\n windows: /*@__PURE__*//Win/.test(nav.platform),\n linux: /*@__PURE__*//Linux|X11/.test(nav.platform),\n ie,\n ie_version: ie_upto10 ? doc.documentMode || 6 : ie_11up ? +ie_11up[1] : ie_edge ? +ie_edge[1] : 0,\n gecko,\n gecko_version: gecko ? +(/*@__PURE__*//Firefox\\/(\\d+)/.exec(nav.userAgent) || [0, 0])[1] : 0,\n chrome: !!chrome,\n chrome_version: chrome ? +chrome[1] : 0,\n ios,\n android: /*@__PURE__*//Android\\b/.test(nav.userAgent),\n webkit,\n safari,\n webkit_version: webkit ? +(/*@__PURE__*//\\bAppleWebKit\\/(\\d+)/.exec(nav.userAgent) || [0, 0])[1] : 0,\n tabSize: doc.documentElement.style.tabSize != null ? \"tab-size\" : \"-moz-tab-size\"\n };\n\n const MaxJoinLen = 256;\n class TextView extends ContentView {\n constructor(text) {\n super();\n this.text = text;\n }\n get length() { return this.text.length; }\n createDOM(textDOM) {\n this.setDOM(textDOM || document.createTextNode(this.text));\n }\n sync(view, track) {\n if (!this.dom)\n this.createDOM();\n if (this.dom.nodeValue != this.text) {\n if (track && track.node == this.dom)\n track.written = true;\n this.dom.nodeValue = this.text;\n }\n }\n reuseDOM(dom) {\n if (dom.nodeType == 3)\n this.createDOM(dom);\n }\n merge(from, to, source) {\n if ((this.flags & 8 /* ViewFlag.Composition */) ||\n source && (!(source instanceof TextView) ||\n this.length - (to - from) + source.length > MaxJoinLen ||\n (source.flags & 8 /* ViewFlag.Composition */)))\n return false;\n this.text = this.text.slice(0, from) + (source ? source.text : \"\") + this.text.slice(to);\n this.markDirty();\n return true;\n }\n split(from) {\n let result = new TextView(this.text.slice(from));\n this.text = this.text.slice(0, from);\n this.markDirty();\n result.flags |= this.flags & 8 /* ViewFlag.Composition */;\n return result;\n }\n localPosFromDOM(node, offset) {\n return node == this.dom ? offset : offset ? this.text.length : 0;\n }\n domAtPos(pos) { return new DOMPos(this.dom, pos); }\n domBoundsAround(_from, _to, offset) {\n return { from: offset, to: offset + this.length, startDOM: this.dom, endDOM: this.dom.nextSibling };\n }\n coordsAt(pos, side) {\n return textCoords(this.dom, pos, side);\n }\n }\n class MarkView extends ContentView {\n constructor(mark, children = [], length = 0) {\n super();\n this.mark = mark;\n this.children = children;\n this.length = length;\n for (let ch of children)\n ch.setParent(this);\n }\n setAttrs(dom) {\n clearAttributes(dom);\n if (this.mark.class)\n dom.className = this.mark.class;\n if (this.mark.attrs)\n for (let name in this.mark.attrs)\n dom.setAttribute(name, this.mark.attrs[name]);\n return dom;\n }\n canReuseDOM(other) {\n return super.canReuseDOM(other) && !((this.flags | other.flags) & 8 /* ViewFlag.Composition */);\n }\n reuseDOM(node) {\n if (node.nodeName == this.mark.tagName.toUpperCase()) {\n this.setDOM(node);\n this.flags |= 4 /* ViewFlag.AttrsDirty */ | 2 /* ViewFlag.NodeDirty */;\n }\n }\n sync(view, track) {\n if (!this.dom)\n this.setDOM(this.setAttrs(document.createElement(this.mark.tagName)));\n else if (this.flags & 4 /* ViewFlag.AttrsDirty */)\n this.setAttrs(this.dom);\n super.sync(view, track);\n }\n merge(from, to, source, _hasStart, openStart, openEnd) {\n if (source && (!(source instanceof MarkView && source.mark.eq(this.mark)) ||\n (from && openStart <= 0) || (to < this.length && openEnd <= 0)))\n return false;\n mergeChildrenInto(this, from, to, source ? source.children.slice() : [], openStart - 1, openEnd - 1);\n this.markDirty();\n return true;\n }\n split(from) {\n let result = [], off = 0, detachFrom = -1, i = 0;\n for (let elt of this.children) {\n let end = off + elt.length;\n if (end > from)\n result.push(off < from ? elt.split(from - off) : elt);\n if (detachFrom < 0 && off >= from)\n detachFrom = i;\n off = end;\n i++;\n }\n let length = this.length - from;\n this.length = from;\n if (detachFrom > -1) {\n this.children.length = detachFrom;\n this.markDirty();\n }\n return new MarkView(this.mark, result, length);\n }\n domAtPos(pos) {\n return inlineDOMAtPos(this, pos);\n }\n coordsAt(pos, side) {\n return coordsInChildren(this, pos, side);\n }\n }\n function textCoords(text, pos, side) {\n let length = text.nodeValue.length;\n if (pos > length)\n pos = length;\n let from = pos, to = pos, flatten = 0;\n if (pos == 0 && side < 0 || pos == length && side >= 0) {\n if (!(browser.chrome || browser.gecko)) { // These browsers reliably return valid rectangles for empty ranges\n if (pos) {\n from--;\n flatten = 1;\n } // FIXME this is wrong in RTL text\n else if (to < length) {\n to++;\n flatten = -1;\n }\n }\n }\n else {\n if (side < 0)\n from--;\n else if (to < length)\n to++;\n }\n let rects = textRange(text, from, to).getClientRects();\n if (!rects.length)\n return null;\n let rect = rects[(flatten ? flatten < 0 : side >= 0) ? 0 : rects.length - 1];\n if (browser.safari && !flatten && rect.width == 0)\n rect = Array.prototype.find.call(rects, r => r.width) || rect;\n return flatten ? flattenRect(rect, flatten < 0) : rect || null;\n }\n // Also used for collapsed ranges that don't have a placeholder widget!\n class WidgetView extends ContentView {\n static create(widget, length, side) {\n return new WidgetView(widget, length, side);\n }\n constructor(widget, length, side) {\n super();\n this.widget = widget;\n this.length = length;\n this.side = side;\n this.prevWidget = null;\n }\n split(from) {\n let result = WidgetView.create(this.widget, this.length - from, this.side);\n this.length -= from;\n return result;\n }\n sync(view) {\n if (!this.dom || !this.widget.updateDOM(this.dom, view)) {\n if (this.dom && this.prevWidget)\n this.prevWidget.destroy(this.dom);\n this.prevWidget = null;\n this.setDOM(this.widget.toDOM(view));\n if (!this.widget.editable)\n this.dom.contentEditable = \"false\";\n }\n }\n getSide() { return this.side; }\n merge(from, to, source, hasStart, openStart, openEnd) {\n if (source && (!(source instanceof WidgetView) || !this.widget.compare(source.widget) ||\n from > 0 && openStart <= 0 || to < this.length && openEnd <= 0))\n return false;\n this.length = from + (source ? source.length : 0) + (this.length - to);\n return true;\n }\n become(other) {\n if (other instanceof WidgetView && other.side == this.side &&\n this.widget.constructor == other.widget.constructor) {\n if (!this.widget.compare(other.widget))\n this.markDirty(true);\n if (this.dom && !this.prevWidget)\n this.prevWidget = this.widget;\n this.widget = other.widget;\n this.length = other.length;\n return true;\n }\n return false;\n }\n ignoreMutation() { return true; }\n ignoreEvent(event) { return this.widget.ignoreEvent(event); }\n get overrideDOMText() {\n if (this.length == 0)\n return Text.empty;\n let top = this;\n while (top.parent)\n top = top.parent;\n let { view } = top, text = view && view.state.doc, start = this.posAtStart;\n return text ? text.slice(start, start + this.length) : Text.empty;\n }\n domAtPos(pos) {\n return (this.length ? pos == 0 : this.side > 0)\n ? DOMPos.before(this.dom)\n : DOMPos.after(this.dom, pos == this.length);\n }\n domBoundsAround() { return null; }\n coordsAt(pos, side) {\n let custom = this.widget.coordsAt(this.dom, pos, side);\n if (custom)\n return custom;\n let rects = this.dom.getClientRects(), rect = null;\n if (!rects.length)\n return null;\n let fromBack = this.side ? this.side < 0 : pos > 0;\n for (let i = fromBack ? rects.length - 1 : 0;; i += (fromBack ? -1 : 1)) {\n rect = rects[i];\n if (pos > 0 ? i == 0 : i == rects.length - 1 || rect.top < rect.bottom)\n break;\n }\n return flattenRect(rect, !fromBack);\n }\n get isEditable() { return false; }\n get isWidget() { return true; }\n get isHidden() { return this.widget.isHidden; }\n destroy() {\n super.destroy();\n if (this.dom)\n this.widget.destroy(this.dom);\n }\n }\n // These are drawn around uneditable widgets to avoid a number of\n // browser bugs that show up when the cursor is directly next to\n // uneditable inline content.\n class WidgetBufferView extends ContentView {\n constructor(side) {\n super();\n this.side = side;\n }\n get length() { return 0; }\n merge() { return false; }\n become(other) {\n return other instanceof WidgetBufferView && other.side == this.side;\n }\n split() { return new WidgetBufferView(this.side); }\n sync() {\n if (!this.dom) {\n let dom = document.createElement(\"img\");\n dom.className = \"cm-widgetBuffer\";\n dom.setAttribute(\"aria-hidden\", \"true\");\n this.setDOM(dom);\n }\n }\n getSide() { return this.side; }\n domAtPos(pos) { return this.side > 0 ? DOMPos.before(this.dom) : DOMPos.after(this.dom); }\n localPosFromDOM() { return 0; }\n domBoundsAround() { return null; }\n coordsAt(pos) {\n return this.dom.getBoundingClientRect();\n }\n get overrideDOMText() {\n return Text.empty;\n }\n get isHidden() { return true; }\n }\n TextView.prototype.children = WidgetView.prototype.children = WidgetBufferView.prototype.children = noChildren;\n function inlineDOMAtPos(parent, pos) {\n let dom = parent.dom, { children } = parent, i = 0;\n for (let off = 0; i < children.length; i++) {\n let child = children[i], end = off + child.length;\n if (end == off && child.getSide() <= 0)\n continue;\n if (pos > off && pos < end && child.dom.parentNode == dom)\n return child.domAtPos(pos - off);\n if (pos <= off)\n break;\n off = end;\n }\n for (let j = i; j > 0; j--) {\n let prev = children[j - 1];\n if (prev.dom.parentNode == dom)\n return prev.domAtPos(prev.length);\n }\n for (let j = i; j < children.length; j++) {\n let next = children[j];\n if (next.dom.parentNode == dom)\n return next.domAtPos(0);\n }\n return new DOMPos(dom, 0);\n }\n // Assumes `view`, if a mark view, has precisely 1 child.\n function joinInlineInto(parent, view, open) {\n let last, { children } = parent;\n if (open > 0 && view instanceof MarkView && children.length &&\n (last = children[children.length - 1]) instanceof MarkView && last.mark.eq(view.mark)) {\n joinInlineInto(last, view.children[0], open - 1);\n }\n else {\n children.push(view);\n view.setParent(parent);\n }\n parent.length += view.length;\n }\n function coordsInChildren(view, pos, side) {\n let before = null, beforePos = -1, after = null, afterPos = -1;\n function scan(view, pos) {\n for (let i = 0, off = 0; i < view.children.length && off <= pos; i++) {\n let child = view.children[i], end = off + child.length;\n if (end >= pos) {\n if (child.children.length) {\n scan(child, pos - off);\n }\n else if ((!after || after.isHidden && side > 0) &&\n (end > pos || off == end && child.getSide() > 0)) {\n after = child;\n afterPos = pos - off;\n }\n else if (off < pos || (off == end && child.getSide() < 0) && !child.isHidden) {\n before = child;\n beforePos = pos - off;\n }\n }\n off = end;\n }\n }\n scan(view, pos);\n let target = (side < 0 ? before : after) || before || after;\n if (target)\n return target.coordsAt(Math.max(0, target == before ? beforePos : afterPos), side);\n return fallbackRect(view);\n }\n function fallbackRect(view) {\n let last = view.dom.lastChild;\n if (!last)\n return view.dom.getBoundingClientRect();\n let rects = clientRectsFor(last);\n return rects[rects.length - 1] || null;\n }\n\n function combineAttrs(source, target) {\n for (let name in source) {\n if (name == \"class\" && target.class)\n target.class += \" \" + source.class;\n else if (name == \"style\" && target.style)\n target.style += \";\" + source.style;\n else\n target[name] = source[name];\n }\n return target;\n }\n const noAttrs$1 = /*@__PURE__*/Object.create(null);\n function attrsEq(a, b, ignore) {\n if (a == b)\n return true;\n if (!a)\n a = noAttrs$1;\n if (!b)\n b = noAttrs$1;\n let keysA = Object.keys(a), keysB = Object.keys(b);\n if (keysA.length - (ignore && keysA.indexOf(ignore) > -1 ? 1 : 0) !=\n keysB.length - (ignore && keysB.indexOf(ignore) > -1 ? 1 : 0))\n return false;\n for (let key of keysA) {\n if (key != ignore && (keysB.indexOf(key) == -1 || a[key] !== b[key]))\n return false;\n }\n return true;\n }\n function updateAttrs(dom, prev, attrs) {\n let changed = false;\n if (prev)\n for (let name in prev)\n if (!(attrs && name in attrs)) {\n changed = true;\n if (name == \"style\")\n dom.style.cssText = \"\";\n else\n dom.removeAttribute(name);\n }\n if (attrs)\n for (let name in attrs)\n if (!(prev && prev[name] == attrs[name])) {\n changed = true;\n if (name == \"style\")\n dom.style.cssText = attrs[name];\n else\n dom.setAttribute(name, attrs[name]);\n }\n return changed;\n }\n function getAttrs$1(dom) {\n let attrs = Object.create(null);\n for (let i = 0; i < dom.attributes.length; i++) {\n let attr = dom.attributes[i];\n attrs[attr.name] = attr.value;\n }\n return attrs;\n }\n\n class LineView extends ContentView {\n constructor() {\n super(...arguments);\n this.children = [];\n this.length = 0;\n this.prevAttrs = undefined;\n this.attrs = null;\n this.breakAfter = 0;\n }\n // Consumes source\n merge(from, to, source, hasStart, openStart, openEnd) {\n if (source) {\n if (!(source instanceof LineView))\n return false;\n if (!this.dom)\n source.transferDOM(this); // Reuse source.dom when appropriate\n }\n if (hasStart)\n this.setDeco(source ? source.attrs : null);\n mergeChildrenInto(this, from, to, source ? source.children.slice() : [], openStart, openEnd);\n return true;\n }\n split(at) {\n let end = new LineView;\n end.breakAfter = this.breakAfter;\n if (this.length == 0)\n return end;\n let { i, off } = this.childPos(at);\n if (off) {\n end.append(this.children[i].split(off), 0);\n this.children[i].merge(off, this.children[i].length, null, false, 0, 0);\n i++;\n }\n for (let j = i; j < this.children.length; j++)\n end.append(this.children[j], 0);\n while (i > 0 && this.children[i - 1].length == 0)\n this.children[--i].destroy();\n this.children.length = i;\n this.markDirty();\n this.length = at;\n return end;\n }\n transferDOM(other) {\n if (!this.dom)\n return;\n this.markDirty();\n other.setDOM(this.dom);\n other.prevAttrs = this.prevAttrs === undefined ? this.attrs : this.prevAttrs;\n this.prevAttrs = undefined;\n this.dom = null;\n }\n setDeco(attrs) {\n if (!attrsEq(this.attrs, attrs)) {\n if (this.dom) {\n this.prevAttrs = this.attrs;\n this.markDirty();\n }\n this.attrs = attrs;\n }\n }\n append(child, openStart) {\n joinInlineInto(this, child, openStart);\n }\n // Only called when building a line view in ContentBuilder\n addLineDeco(deco) {\n let attrs = deco.spec.attributes, cls = deco.spec.class;\n if (attrs)\n this.attrs = combineAttrs(attrs, this.attrs || {});\n if (cls)\n this.attrs = combineAttrs({ class: cls }, this.attrs || {});\n }\n domAtPos(pos) {\n return inlineDOMAtPos(this, pos);\n }\n reuseDOM(node) {\n if (node.nodeName == \"DIV\") {\n this.setDOM(node);\n this.flags |= 4 /* ViewFlag.AttrsDirty */ | 2 /* ViewFlag.NodeDirty */;\n }\n }\n sync(view, track) {\n var _a;\n if (!this.dom) {\n this.setDOM(document.createElement(\"div\"));\n this.dom.className = \"cm-line\";\n this.prevAttrs = this.attrs ? null : undefined;\n }\n else if (this.flags & 4 /* ViewFlag.AttrsDirty */) {\n clearAttributes(this.dom);\n this.dom.className = \"cm-line\";\n this.prevAttrs = this.attrs ? null : undefined;\n }\n if (this.prevAttrs !== undefined) {\n updateAttrs(this.dom, this.prevAttrs, this.attrs);\n this.dom.classList.add(\"cm-line\");\n this.prevAttrs = undefined;\n }\n super.sync(view, track);\n let last = this.dom.lastChild;\n while (last && ContentView.get(last) instanceof MarkView)\n last = last.lastChild;\n if (!last || !this.length ||\n last.nodeName != \"BR\" && ((_a = ContentView.get(last)) === null || _a === void 0 ? void 0 : _a.isEditable) == false &&\n (!browser.ios || !this.children.some(ch => ch instanceof TextView))) {\n let hack = document.createElement(\"BR\");\n hack.cmIgnore = true;\n this.dom.appendChild(hack);\n }\n }\n measureTextSize() {\n if (this.children.length == 0 || this.length > 20)\n return null;\n let totalWidth = 0, textHeight;\n for (let child of this.children) {\n if (!(child instanceof TextView) || /[^ -~]/.test(child.text))\n return null;\n let rects = clientRectsFor(child.dom);\n if (rects.length != 1)\n return null;\n totalWidth += rects[0].width;\n textHeight = rects[0].height;\n }\n return !totalWidth ? null : {\n lineHeight: this.dom.getBoundingClientRect().height,\n charWidth: totalWidth / this.length,\n textHeight\n };\n }\n coordsAt(pos, side) {\n let rect = coordsInChildren(this, pos, side);\n // Correct rectangle height for empty lines when the returned\n // height is larger than the text height.\n if (!this.children.length && rect && this.parent) {\n let { heightOracle } = this.parent.view.viewState, height = rect.bottom - rect.top;\n if (Math.abs(height - heightOracle.lineHeight) < 2 && heightOracle.textHeight < height) {\n let dist = (height - heightOracle.textHeight) / 2;\n return { top: rect.top + dist, bottom: rect.bottom - dist, left: rect.left, right: rect.left };\n }\n }\n return rect;\n }\n become(other) {\n return other instanceof LineView && this.children.length == 0 && other.children.length == 0 &&\n attrsEq(this.attrs, other.attrs) && this.breakAfter == other.breakAfter;\n }\n covers() { return true; }\n static find(docView, pos) {\n for (let i = 0, off = 0; i < docView.children.length; i++) {\n let block = docView.children[i], end = off + block.length;\n if (end >= pos) {\n if (block instanceof LineView)\n return block;\n if (end > pos)\n break;\n }\n off = end + block.breakAfter;\n }\n return null;\n }\n }\n class BlockWidgetView extends ContentView {\n constructor(widget, length, deco) {\n super();\n this.widget = widget;\n this.length = length;\n this.deco = deco;\n this.breakAfter = 0;\n this.prevWidget = null;\n }\n merge(from, to, source, _takeDeco, openStart, openEnd) {\n if (source && (!(source instanceof BlockWidgetView) || !this.widget.compare(source.widget) ||\n from > 0 && openStart <= 0 || to < this.length && openEnd <= 0))\n return false;\n this.length = from + (source ? source.length : 0) + (this.length - to);\n return true;\n }\n domAtPos(pos) {\n return pos == 0 ? DOMPos.before(this.dom) : DOMPos.after(this.dom, pos == this.length);\n }\n split(at) {\n let len = this.length - at;\n this.length = at;\n let end = new BlockWidgetView(this.widget, len, this.deco);\n end.breakAfter = this.breakAfter;\n return end;\n }\n get children() { return noChildren; }\n sync(view) {\n if (!this.dom || !this.widget.updateDOM(this.dom, view)) {\n if (this.dom && this.prevWidget)\n this.prevWidget.destroy(this.dom);\n this.prevWidget = null;\n this.setDOM(this.widget.toDOM(view));\n if (!this.widget.editable)\n this.dom.contentEditable = \"false\";\n }\n }\n get overrideDOMText() {\n return this.parent ? this.parent.view.state.doc.slice(this.posAtStart, this.posAtEnd) : Text.empty;\n }\n domBoundsAround() { return null; }\n become(other) {\n if (other instanceof BlockWidgetView &&\n other.widget.constructor == this.widget.constructor) {\n if (!other.widget.compare(this.widget))\n this.markDirty(true);\n if (this.dom && !this.prevWidget)\n this.prevWidget = this.widget;\n this.widget = other.widget;\n this.length = other.length;\n this.deco = other.deco;\n this.breakAfter = other.breakAfter;\n return true;\n }\n return false;\n }\n ignoreMutation() { return true; }\n ignoreEvent(event) { return this.widget.ignoreEvent(event); }\n get isEditable() { return false; }\n get isWidget() { return true; }\n coordsAt(pos, side) {\n return this.widget.coordsAt(this.dom, pos, side);\n }\n destroy() {\n super.destroy();\n if (this.dom)\n this.widget.destroy(this.dom);\n }\n covers(side) {\n let { startSide, endSide } = this.deco;\n return startSide == endSide ? false : side < 0 ? startSide < 0 : endSide > 0;\n }\n }\n\n /**\n Widgets added to the content are described by subclasses of this\n class. Using a description object like that makes it possible to\n delay creating of the DOM structure for a widget until it is\n needed, and to avoid redrawing widgets even if the decorations\n that define them are recreated.\n */\n class WidgetType {\n /**\n Compare this instance to another instance of the same type.\n (TypeScript can't express this, but only instances of the same\n specific class will be passed to this method.) This is used to\n avoid redrawing widgets when they are replaced by a new\n decoration of the same type. The default implementation just\n returns `false`, which will cause new instances of the widget to\n always be redrawn.\n */\n eq(widget) { return false; }\n /**\n Update a DOM element created by a widget of the same type (but\n different, non-`eq` content) to reflect this widget. May return\n true to indicate that it could update, false to indicate it\n couldn't (in which case the widget will be redrawn). The default\n implementation just returns false.\n */\n updateDOM(dom, view) { return false; }\n /**\n @internal\n */\n compare(other) {\n return this == other || this.constructor == other.constructor && this.eq(other);\n }\n /**\n The estimated height this widget will have, to be used when\n estimating the height of content that hasn't been drawn. May\n return -1 to indicate you don't know. The default implementation\n returns -1.\n */\n get estimatedHeight() { return -1; }\n /**\n For inline widgets that are displayed inline (as opposed to\n `inline-block`) and introduce line breaks (through `<br>` tags\n or textual newlines), this must indicate the amount of line\n breaks they introduce. Defaults to 0.\n */\n get lineBreaks() { return 0; }\n /**\n Can be used to configure which kinds of events inside the widget\n should be ignored by the editor. The default is to ignore all\n events.\n */\n ignoreEvent(event) { return true; }\n /**\n Override the way screen coordinates for positions at/in the\n widget are found. `pos` will be the offset into the widget, and\n `side` the side of the position that is being queried\u2014less than\n zero for before, greater than zero for after, and zero for\n directly at that position.\n */\n coordsAt(dom, pos, side) { return null; }\n /**\n @internal\n */\n get isHidden() { return false; }\n /**\n @internal\n */\n get editable() { return false; }\n /**\n This is called when the an instance of the widget is removed\n from the editor view.\n */\n destroy(dom) { }\n }\n /**\n The different types of blocks that can occur in an editor view.\n */\n var BlockType = /*@__PURE__*/(function (BlockType) {\n /**\n A line of text.\n */\n BlockType[BlockType[\"Text\"] = 0] = \"Text\";\n /**\n A block widget associated with the position after it.\n */\n BlockType[BlockType[\"WidgetBefore\"] = 1] = \"WidgetBefore\";\n /**\n A block widget associated with the position before it.\n */\n BlockType[BlockType[\"WidgetAfter\"] = 2] = \"WidgetAfter\";\n /**\n A block widget [replacing](https://codemirror.net/6/docs/ref/#view.Decoration^replace) a range of content.\n */\n BlockType[BlockType[\"WidgetRange\"] = 3] = \"WidgetRange\";\n return BlockType})(BlockType || (BlockType = {}));\n /**\n A decoration provides information on how to draw or style a piece\n of content. You'll usually use it wrapped in a\n [`Range`](https://codemirror.net/6/docs/ref/#state.Range), which adds a start and end position.\n @nonabstract\n */\n class Decoration extends RangeValue {\n constructor(\n /**\n @internal\n */\n startSide, \n /**\n @internal\n */\n endSide, \n /**\n @internal\n */\n widget, \n /**\n The config object used to create this decoration. You can\n include additional properties in there to store metadata about\n your decoration.\n */\n spec) {\n super();\n this.startSide = startSide;\n this.endSide = endSide;\n this.widget = widget;\n this.spec = spec;\n }\n /**\n @internal\n */\n get heightRelevant() { return false; }\n /**\n Create a mark decoration, which influences the styling of the\n content in its range. Nested mark decorations will cause nested\n DOM elements to be created. Nesting order is determined by\n precedence of the [facet](https://codemirror.net/6/docs/ref/#view.EditorView^decorations), with\n the higher-precedence decorations creating the inner DOM nodes.\n Such elements are split on line boundaries and on the boundaries\n of lower-precedence decorations.\n */\n static mark(spec) {\n return new MarkDecoration(spec);\n }\n /**\n Create a widget decoration, which displays a DOM element at the\n given position.\n */\n static widget(spec) {\n let side = Math.max(-10000, Math.min(10000, spec.side || 0)), block = !!spec.block;\n side += (block && !spec.inlineOrder)\n ? (side > 0 ? 300000000 /* Side.BlockAfter */ : -400000000 /* Side.BlockBefore */)\n : (side > 0 ? 100000000 /* Side.InlineAfter */ : -100000000 /* Side.InlineBefore */);\n return new PointDecoration(spec, side, side, block, spec.widget || null, false);\n }\n /**\n Create a replace decoration which replaces the given range with\n a widget, or simply hides it.\n */\n static replace(spec) {\n let block = !!spec.block, startSide, endSide;\n if (spec.isBlockGap) {\n startSide = -500000000 /* Side.GapStart */;\n endSide = 400000000 /* Side.GapEnd */;\n }\n else {\n let { start, end } = getInclusive(spec, block);\n startSide = (start ? (block ? -300000000 /* Side.BlockIncStart */ : -1 /* Side.InlineIncStart */) : 500000000 /* Side.NonIncStart */) - 1;\n endSide = (end ? (block ? 200000000 /* Side.BlockIncEnd */ : 1 /* Side.InlineIncEnd */) : -600000000 /* Side.NonIncEnd */) + 1;\n }\n return new PointDecoration(spec, startSide, endSide, block, spec.widget || null, true);\n }\n /**\n Create a line decoration, which can add DOM attributes to the\n line starting at the given position.\n */\n static line(spec) {\n return new LineDecoration(spec);\n }\n /**\n Build a [`DecorationSet`](https://codemirror.net/6/docs/ref/#view.DecorationSet) from the given\n decorated range or ranges. If the ranges aren't already sorted,\n pass `true` for `sort` to make the library sort them for you.\n */\n static set(of, sort = false) {\n return RangeSet.of(of, sort);\n }\n /**\n @internal\n */\n hasHeight() { return this.widget ? this.widget.estimatedHeight > -1 : false; }\n }\n /**\n The empty set of decorations.\n */\n Decoration.none = RangeSet.empty;\n class MarkDecoration extends Decoration {\n constructor(spec) {\n let { start, end } = getInclusive(spec);\n super(start ? -1 /* Side.InlineIncStart */ : 500000000 /* Side.NonIncStart */, end ? 1 /* Side.InlineIncEnd */ : -600000000 /* Side.NonIncEnd */, null, spec);\n this.tagName = spec.tagName || \"span\";\n this.class = spec.class || \"\";\n this.attrs = spec.attributes || null;\n }\n eq(other) {\n var _a, _b;\n return this == other ||\n other instanceof MarkDecoration &&\n this.tagName == other.tagName &&\n (this.class || ((_a = this.attrs) === null || _a === void 0 ? void 0 : _a.class)) == (other.class || ((_b = other.attrs) === null || _b === void 0 ? void 0 : _b.class)) &&\n attrsEq(this.attrs, other.attrs, \"class\");\n }\n range(from, to = from) {\n if (from >= to)\n throw new RangeError(\"Mark decorations may not be empty\");\n return super.range(from, to);\n }\n }\n MarkDecoration.prototype.point = false;\n class LineDecoration extends Decoration {\n constructor(spec) {\n super(-200000000 /* Side.Line */, -200000000 /* Side.Line */, null, spec);\n }\n eq(other) {\n return other instanceof LineDecoration &&\n this.spec.class == other.spec.class &&\n attrsEq(this.spec.attributes, other.spec.attributes);\n }\n range(from, to = from) {\n if (to != from)\n throw new RangeError(\"Line decoration ranges must be zero-length\");\n return super.range(from, to);\n }\n }\n LineDecoration.prototype.mapMode = MapMode.TrackBefore;\n LineDecoration.prototype.point = true;\n class PointDecoration extends Decoration {\n constructor(spec, startSide, endSide, block, widget, isReplace) {\n super(startSide, endSide, widget, spec);\n this.block = block;\n this.isReplace = isReplace;\n this.mapMode = !block ? MapMode.TrackDel : startSide <= 0 ? MapMode.TrackBefore : MapMode.TrackAfter;\n }\n // Only relevant when this.block == true\n get type() {\n return this.startSide != this.endSide ? BlockType.WidgetRange\n : this.startSide <= 0 ? BlockType.WidgetBefore : BlockType.WidgetAfter;\n }\n get heightRelevant() {\n return this.block || !!this.widget && (this.widget.estimatedHeight >= 5 || this.widget.lineBreaks > 0);\n }\n eq(other) {\n return other instanceof PointDecoration &&\n widgetsEq(this.widget, other.widget) &&\n this.block == other.block &&\n this.startSide == other.startSide && this.endSide == other.endSide;\n }\n range(from, to = from) {\n if (this.isReplace && (from > to || (from == to && this.startSide > 0 && this.endSide <= 0)))\n throw new RangeError(\"Invalid range for replacement decoration\");\n if (!this.isReplace && to != from)\n throw new RangeError(\"Widget decorations can only have zero-length ranges\");\n return super.range(from, to);\n }\n }\n PointDecoration.prototype.point = true;\n function getInclusive(spec, block = false) {\n let { inclusiveStart: start, inclusiveEnd: end } = spec;\n if (start == null)\n start = spec.inclusive;\n if (end == null)\n end = spec.inclusive;\n return { start: start !== null && start !== void 0 ? start : block, end: end !== null && end !== void 0 ? end : block };\n }\n function widgetsEq(a, b) {\n return a == b || !!(a && b && a.compare(b));\n }\n function addRange(from, to, ranges, margin = 0) {\n let last = ranges.length - 1;\n if (last >= 0 && ranges[last] + margin >= from)\n ranges[last] = Math.max(ranges[last], to);\n else\n ranges.push(from, to);\n }\n\n class ContentBuilder {\n constructor(doc, pos, end, disallowBlockEffectsFor) {\n this.doc = doc;\n this.pos = pos;\n this.end = end;\n this.disallowBlockEffectsFor = disallowBlockEffectsFor;\n this.content = [];\n this.curLine = null;\n this.breakAtStart = 0;\n this.pendingBuffer = 0 /* Buf.No */;\n this.bufferMarks = [];\n // Set to false directly after a widget that covers the position after it\n this.atCursorPos = true;\n this.openStart = -1;\n this.openEnd = -1;\n this.text = \"\";\n this.textOff = 0;\n this.cursor = doc.iter();\n this.skip = pos;\n }\n posCovered() {\n if (this.content.length == 0)\n return !this.breakAtStart && this.doc.lineAt(this.pos).from != this.pos;\n let last = this.content[this.content.length - 1];\n return !(last.breakAfter || last instanceof BlockWidgetView && last.deco.endSide < 0);\n }\n getLine() {\n if (!this.curLine) {\n this.content.push(this.curLine = new LineView);\n this.atCursorPos = true;\n }\n return this.curLine;\n }\n flushBuffer(active = this.bufferMarks) {\n if (this.pendingBuffer) {\n this.curLine.append(wrapMarks(new WidgetBufferView(-1), active), active.length);\n this.pendingBuffer = 0 /* Buf.No */;\n }\n }\n addBlockWidget(view) {\n this.flushBuffer();\n this.curLine = null;\n this.content.push(view);\n }\n finish(openEnd) {\n if (this.pendingBuffer && openEnd <= this.bufferMarks.length)\n this.flushBuffer();\n else\n this.pendingBuffer = 0 /* Buf.No */;\n if (!this.posCovered() &&\n !(openEnd && this.content.length && this.content[this.content.length - 1] instanceof BlockWidgetView))\n this.getLine();\n }\n buildText(length, active, openStart) {\n while (length > 0) {\n if (this.textOff == this.text.length) {\n let { value, lineBreak, done } = this.cursor.next(this.skip);\n this.skip = 0;\n if (done)\n throw new Error(\"Ran out of text content when drawing inline views\");\n if (lineBreak) {\n if (!this.posCovered())\n this.getLine();\n if (this.content.length)\n this.content[this.content.length - 1].breakAfter = 1;\n else\n this.breakAtStart = 1;\n this.flushBuffer();\n this.curLine = null;\n this.atCursorPos = true;\n length--;\n continue;\n }\n else {\n this.text = value;\n this.textOff = 0;\n }\n }\n let take = Math.min(this.text.length - this.textOff, length, 512 /* T.Chunk */);\n this.flushBuffer(active.slice(active.length - openStart));\n this.getLine().append(wrapMarks(new TextView(this.text.slice(this.textOff, this.textOff + take)), active), openStart);\n this.atCursorPos = true;\n this.textOff += take;\n length -= take;\n openStart = 0;\n }\n }\n span(from, to, active, openStart) {\n this.buildText(to - from, active, openStart);\n this.pos = to;\n if (this.openStart < 0)\n this.openStart = openStart;\n }\n point(from, to, deco, active, openStart, index) {\n if (this.disallowBlockEffectsFor[index] && deco instanceof PointDecoration) {\n if (deco.block)\n throw new RangeError(\"Block decorations may not be specified via plugins\");\n if (to > this.doc.lineAt(this.pos).to)\n throw new RangeError(\"Decorations that replace line breaks may not be specified via plugins\");\n }\n let len = to - from;\n if (deco instanceof PointDecoration) {\n if (deco.block) {\n if (deco.startSide > 0 && !this.posCovered())\n this.getLine();\n this.addBlockWidget(new BlockWidgetView(deco.widget || NullWidget.block, len, deco));\n }\n else {\n let view = WidgetView.create(deco.widget || NullWidget.inline, len, len ? 0 : deco.startSide);\n let cursorBefore = this.atCursorPos && !view.isEditable && openStart <= active.length &&\n (from < to || deco.startSide > 0);\n let cursorAfter = !view.isEditable && (from < to || openStart > active.length || deco.startSide <= 0);\n let line = this.getLine();\n if (this.pendingBuffer == 2 /* Buf.IfCursor */ && !cursorBefore && !view.isEditable)\n this.pendingBuffer = 0 /* Buf.No */;\n this.flushBuffer(active);\n if (cursorBefore) {\n line.append(wrapMarks(new WidgetBufferView(1), active), openStart);\n openStart = active.length + Math.max(0, openStart - active.length);\n }\n line.append(wrapMarks(view, active), openStart);\n this.atCursorPos = cursorAfter;\n this.pendingBuffer = !cursorAfter ? 0 /* Buf.No */ : from < to || openStart > active.length ? 1 /* Buf.Yes */ : 2 /* Buf.IfCursor */;\n if (this.pendingBuffer)\n this.bufferMarks = active.slice();\n }\n }\n else if (this.doc.lineAt(this.pos).from == this.pos) { // Line decoration\n this.getLine().addLineDeco(deco);\n }\n if (len) {\n // Advance the iterator past the replaced content\n if (this.textOff + len <= this.text.length) {\n this.textOff += len;\n }\n else {\n this.skip += len - (this.text.length - this.textOff);\n this.text = \"\";\n this.textOff = 0;\n }\n this.pos = to;\n }\n if (this.openStart < 0)\n this.openStart = openStart;\n }\n static build(text, from, to, decorations, dynamicDecorationMap) {\n let builder = new ContentBuilder(text, from, to, dynamicDecorationMap);\n builder.openEnd = RangeSet.spans(decorations, from, to, builder);\n if (builder.openStart < 0)\n builder.openStart = builder.openEnd;\n builder.finish(builder.openEnd);\n return builder;\n }\n }\n function wrapMarks(view, active) {\n for (let mark of active)\n view = new MarkView(mark, [view], view.length);\n return view;\n }\n class NullWidget extends WidgetType {\n constructor(tag) {\n super();\n this.tag = tag;\n }\n eq(other) { return other.tag == this.tag; }\n toDOM() { return document.createElement(this.tag); }\n updateDOM(elt) { return elt.nodeName.toLowerCase() == this.tag; }\n get isHidden() { return true; }\n }\n NullWidget.inline = /*@__PURE__*/new NullWidget(\"span\");\n NullWidget.block = /*@__PURE__*/new NullWidget(\"div\");\n\n /**\n Used to indicate [text direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection).\n */\n var Direction = /*@__PURE__*/(function (Direction) {\n // (These are chosen to match the base levels, in bidi algorithm\n // terms, of spans in that direction.)\n /**\n Left-to-right.\n */\n Direction[Direction[\"LTR\"] = 0] = \"LTR\";\n /**\n Right-to-left.\n */\n Direction[Direction[\"RTL\"] = 1] = \"RTL\";\n return Direction})(Direction || (Direction = {}));\n const LTR = Direction.LTR, RTL = Direction.RTL;\n // Decode a string with each type encoded as log2(type)\n function dec(str) {\n let result = [];\n for (let i = 0; i < str.length; i++)\n result.push(1 << +str[i]);\n return result;\n }\n // Character types for codepoints 0 to 0xf8\n const LowTypes = /*@__PURE__*/dec(\"88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008\");\n // Character types for codepoints 0x600 to 0x6f9\n const ArabicTypes = /*@__PURE__*/dec(\"4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333\");\n const Brackets = /*@__PURE__*/Object.create(null), BracketStack = [];\n // There's a lot more in\n // https://www.unicode.org/Public/UCD/latest/ucd/BidiBrackets.txt,\n // which are left out to keep code size down.\n for (let p of [\"()\", \"[]\", \"{}\"]) {\n let l = /*@__PURE__*/p.charCodeAt(0), r = /*@__PURE__*/p.charCodeAt(1);\n Brackets[l] = r;\n Brackets[r] = -l;\n }\n function charType(ch) {\n return ch <= 0xf7 ? LowTypes[ch] :\n 0x590 <= ch && ch <= 0x5f4 ? 2 /* T.R */ :\n 0x600 <= ch && ch <= 0x6f9 ? ArabicTypes[ch - 0x600] :\n 0x6ee <= ch && ch <= 0x8ac ? 4 /* T.AL */ :\n 0x2000 <= ch && ch <= 0x200c ? 256 /* T.NI */ :\n 0xfb50 <= ch && ch <= 0xfdff ? 4 /* T.AL */ : 1 /* T.L */;\n }\n const BidiRE = /[\\u0590-\\u05f4\\u0600-\\u06ff\\u0700-\\u08ac\\ufb50-\\ufdff]/;\n /**\n Represents a contiguous range of text that has a single direction\n (as in left-to-right or right-to-left).\n */\n class BidiSpan {\n /**\n The direction of this span.\n */\n get dir() { return this.level % 2 ? RTL : LTR; }\n /**\n @internal\n */\n constructor(\n /**\n The start of the span (relative to the start of the line).\n */\n from, \n /**\n The end of the span.\n */\n to, \n /**\n The [\"bidi\n level\"](https://unicode.org/reports/tr9/#Basic_Display_Algorithm)\n of the span (in this context, 0 means\n left-to-right, 1 means right-to-left, 2 means left-to-right\n number inside right-to-left text).\n */\n level) {\n this.from = from;\n this.to = to;\n this.level = level;\n }\n /**\n @internal\n */\n side(end, dir) { return (this.dir == dir) == end ? this.to : this.from; }\n /**\n @internal\n */\n forward(forward, dir) { return forward == (this.dir == dir); }\n /**\n @internal\n */\n static find(order, index, level, assoc) {\n let maybe = -1;\n for (let i = 0; i < order.length; i++) {\n let span = order[i];\n if (span.from <= index && span.to >= index) {\n if (span.level == level)\n return i;\n // When multiple spans match, if assoc != 0, take the one that\n // covers that side, otherwise take the one with the minimum\n // level.\n if (maybe < 0 || (assoc != 0 ? (assoc < 0 ? span.from < index : span.to > index) : order[maybe].level > span.level))\n maybe = i;\n }\n }\n if (maybe < 0)\n throw new RangeError(\"Index out of range\");\n return maybe;\n }\n }\n function isolatesEq(a, b) {\n if (a.length != b.length)\n return false;\n for (let i = 0; i < a.length; i++) {\n let iA = a[i], iB = b[i];\n if (iA.from != iB.from || iA.to != iB.to || iA.direction != iB.direction || !isolatesEq(iA.inner, iB.inner))\n return false;\n }\n return true;\n }\n // Reused array of character types\n const types = [];\n // Fill in the character types (in `types`) from `from` to `to` and\n // apply W normalization rules.\n function computeCharTypes(line, rFrom, rTo, isolates, outerType) {\n for (let iI = 0; iI <= isolates.length; iI++) {\n let from = iI ? isolates[iI - 1].to : rFrom, to = iI < isolates.length ? isolates[iI].from : rTo;\n let prevType = iI ? 256 /* T.NI */ : outerType;\n // W1. Examine each non-spacing mark (NSM) in the level run, and\n // change the type of the NSM to the type of the previous\n // character. If the NSM is at the start of the level run, it will\n // get the type of sor.\n // W2. Search backwards from each instance of a European number\n // until the first strong type (R, L, AL, or sor) is found. If an\n // AL is found, change the type of the European number to Arabic\n // number.\n // W3. Change all ALs to R.\n // (Left after this: L, R, EN, AN, ET, CS, NI)\n for (let i = from, prev = prevType, prevStrong = prevType; i < to; i++) {\n let type = charType(line.charCodeAt(i));\n if (type == 512 /* T.NSM */)\n type = prev;\n else if (type == 8 /* T.EN */ && prevStrong == 4 /* T.AL */)\n type = 16 /* T.AN */;\n types[i] = type == 4 /* T.AL */ ? 2 /* T.R */ : type;\n if (type & 7 /* T.Strong */)\n prevStrong = type;\n prev = type;\n }\n // W5. A sequence of European terminators adjacent to European\n // numbers changes to all European numbers.\n // W6. Otherwise, separators and terminators change to Other\n // Neutral.\n // W7. Search backwards from each instance of a European number\n // until the first strong type (R, L, or sor) is found. If an L is\n // found, then change the type of the European number to L.\n // (Left after this: L, R, EN+AN, NI)\n for (let i = from, prev = prevType, prevStrong = prevType; i < to; i++) {\n let type = types[i];\n if (type == 128 /* T.CS */) {\n if (i < to - 1 && prev == types[i + 1] && (prev & 24 /* T.Num */))\n type = types[i] = prev;\n else\n types[i] = 256 /* T.NI */;\n }\n else if (type == 64 /* T.ET */) {\n let end = i + 1;\n while (end < to && types[end] == 64 /* T.ET */)\n end++;\n let replace = (i && prev == 8 /* T.EN */) || (end < rTo && types[end] == 8 /* T.EN */) ? (prevStrong == 1 /* T.L */ ? 1 /* T.L */ : 8 /* T.EN */) : 256 /* T.NI */;\n for (let j = i; j < end; j++)\n types[j] = replace;\n i = end - 1;\n }\n else if (type == 8 /* T.EN */ && prevStrong == 1 /* T.L */) {\n types[i] = 1 /* T.L */;\n }\n prev = type;\n if (type & 7 /* T.Strong */)\n prevStrong = type;\n }\n }\n }\n // Process brackets throughout a run sequence.\n function processBracketPairs(line, rFrom, rTo, isolates, outerType) {\n let oppositeType = outerType == 1 /* T.L */ ? 2 /* T.R */ : 1 /* T.L */;\n for (let iI = 0, sI = 0, context = 0; iI <= isolates.length; iI++) {\n let from = iI ? isolates[iI - 1].to : rFrom, to = iI < isolates.length ? isolates[iI].from : rTo;\n // N0. Process bracket pairs in an isolating run sequence\n // sequentially in the logical order of the text positions of the\n // opening paired brackets using the logic given below. Within this\n // scope, bidirectional types EN and AN are treated as R.\n for (let i = from, ch, br, type; i < to; i++) {\n // Keeps [startIndex, type, strongSeen] triples for each open\n // bracket on BracketStack.\n if (br = Brackets[ch = line.charCodeAt(i)]) {\n if (br < 0) { // Closing bracket\n for (let sJ = sI - 3; sJ >= 0; sJ -= 3) {\n if (BracketStack[sJ + 1] == -br) {\n let flags = BracketStack[sJ + 2];\n let type = (flags & 2 /* Bracketed.EmbedInside */) ? outerType :\n !(flags & 4 /* Bracketed.OppositeInside */) ? 0 :\n (flags & 1 /* Bracketed.OppositeBefore */) ? oppositeType : outerType;\n if (type)\n types[i] = types[BracketStack[sJ]] = type;\n sI = sJ;\n break;\n }\n }\n }\n else if (BracketStack.length == 189 /* Bracketed.MaxDepth */) {\n break;\n }\n else {\n BracketStack[sI++] = i;\n BracketStack[sI++] = ch;\n BracketStack[sI++] = context;\n }\n }\n else if ((type = types[i]) == 2 /* T.R */ || type == 1 /* T.L */) {\n let embed = type == outerType;\n context = embed ? 0 : 1 /* Bracketed.OppositeBefore */;\n for (let sJ = sI - 3; sJ >= 0; sJ -= 3) {\n let cur = BracketStack[sJ + 2];\n if (cur & 2 /* Bracketed.EmbedInside */)\n break;\n if (embed) {\n BracketStack[sJ + 2] |= 2 /* Bracketed.EmbedInside */;\n }\n else {\n if (cur & 4 /* Bracketed.OppositeInside */)\n break;\n BracketStack[sJ + 2] |= 4 /* Bracketed.OppositeInside */;\n }\n }\n }\n }\n }\n }\n function processNeutrals(rFrom, rTo, isolates, outerType) {\n for (let iI = 0, prev = outerType; iI <= isolates.length; iI++) {\n let from = iI ? isolates[iI - 1].to : rFrom, to = iI < isolates.length ? isolates[iI].from : rTo;\n // N1. A sequence of neutrals takes the direction of the\n // surrounding strong text if the text on both sides has the same\n // direction. European and Arabic numbers act as if they were R in\n // terms of their influence on neutrals. Start-of-level-run (sor)\n // and end-of-level-run (eor) are used at level run boundaries.\n // N2. Any remaining neutrals take the embedding direction.\n // (Left after this: L, R, EN+AN)\n for (let i = from; i < to;) {\n let type = types[i];\n if (type == 256 /* T.NI */) {\n let end = i + 1;\n for (;;) {\n if (end == to) {\n if (iI == isolates.length)\n break;\n end = isolates[iI++].to;\n to = iI < isolates.length ? isolates[iI].from : rTo;\n }\n else if (types[end] == 256 /* T.NI */) {\n end++;\n }\n else {\n break;\n }\n }\n let beforeL = prev == 1 /* T.L */;\n let afterL = (end < rTo ? types[end] : outerType) == 1 /* T.L */;\n let replace = beforeL == afterL ? (beforeL ? 1 /* T.L */ : 2 /* T.R */) : outerType;\n for (let j = end, jI = iI, fromJ = jI ? isolates[jI - 1].to : rFrom; j > i;) {\n if (j == fromJ) {\n j = isolates[--jI].from;\n fromJ = jI ? isolates[jI - 1].to : rFrom;\n }\n types[--j] = replace;\n }\n i = end;\n }\n else {\n prev = type;\n i++;\n }\n }\n }\n }\n // Find the contiguous ranges of character types in a given range, and\n // emit spans for them. Flip the order of the spans as appropriate\n // based on the level, and call through to compute the spans for\n // isolates at the proper point.\n function emitSpans(line, from, to, level, baseLevel, isolates, order) {\n let ourType = level % 2 ? 2 /* T.R */ : 1 /* T.L */;\n if ((level % 2) == (baseLevel % 2)) { // Same dir as base direction, don't flip\n for (let iCh = from, iI = 0; iCh < to;) {\n // Scan a section of characters in direction ourType, unless\n // there's another type of char right after iCh, in which case\n // we scan a section of other characters (which, if ourType ==\n // T.L, may contain both T.R and T.AN chars).\n let sameDir = true, isNum = false;\n if (iI == isolates.length || iCh < isolates[iI].from) {\n let next = types[iCh];\n if (next != ourType) {\n sameDir = false;\n isNum = next == 16 /* T.AN */;\n }\n }\n // Holds an array of isolates to pass to a recursive call if we\n // must recurse (to distinguish T.AN inside an RTL section in\n // LTR text), null if we can emit directly\n let recurse = !sameDir && ourType == 1 /* T.L */ ? [] : null;\n let localLevel = sameDir ? level : level + 1;\n let iScan = iCh;\n run: for (;;) {\n if (iI < isolates.length && iScan == isolates[iI].from) {\n if (isNum)\n break run;\n let iso = isolates[iI];\n // Scan ahead to verify that there is another char in this dir after the isolate(s)\n if (!sameDir)\n for (let upto = iso.to, jI = iI + 1;;) {\n if (upto == to)\n break run;\n if (jI < isolates.length && isolates[jI].from == upto)\n upto = isolates[jI++].to;\n else if (types[upto] == ourType)\n break run;\n else\n break;\n }\n iI++;\n if (recurse) {\n recurse.push(iso);\n }\n else {\n if (iso.from > iCh)\n order.push(new BidiSpan(iCh, iso.from, localLevel));\n let dirSwap = (iso.direction == LTR) != !(localLevel % 2);\n computeSectionOrder(line, dirSwap ? level + 1 : level, baseLevel, iso.inner, iso.from, iso.to, order);\n iCh = iso.to;\n }\n iScan = iso.to;\n }\n else if (iScan == to || (sameDir ? types[iScan] != ourType : types[iScan] == ourType)) {\n break;\n }\n else {\n iScan++;\n }\n }\n if (recurse)\n emitSpans(line, iCh, iScan, level + 1, baseLevel, recurse, order);\n else if (iCh < iScan)\n order.push(new BidiSpan(iCh, iScan, localLevel));\n iCh = iScan;\n }\n }\n else {\n // Iterate in reverse to flip the span order. Same code again, but\n // going from the back of the section to the front\n for (let iCh = to, iI = isolates.length; iCh > from;) {\n let sameDir = true, isNum = false;\n if (!iI || iCh > isolates[iI - 1].to) {\n let next = types[iCh - 1];\n if (next != ourType) {\n sameDir = false;\n isNum = next == 16 /* T.AN */;\n }\n }\n let recurse = !sameDir && ourType == 1 /* T.L */ ? [] : null;\n let localLevel = sameDir ? level : level + 1;\n let iScan = iCh;\n run: for (;;) {\n if (iI && iScan == isolates[iI - 1].to) {\n if (isNum)\n break run;\n let iso = isolates[--iI];\n // Scan ahead to verify that there is another char in this dir after the isolate(s)\n if (!sameDir)\n for (let upto = iso.from, jI = iI;;) {\n if (upto == from)\n break run;\n if (jI && isolates[jI - 1].to == upto)\n upto = isolates[--jI].from;\n else if (types[upto - 1] == ourType)\n break run;\n else\n break;\n }\n if (recurse) {\n recurse.push(iso);\n }\n else {\n if (iso.to < iCh)\n order.push(new BidiSpan(iso.to, iCh, localLevel));\n let dirSwap = (iso.direction == LTR) != !(localLevel % 2);\n computeSectionOrder(line, dirSwap ? level + 1 : level, baseLevel, iso.inner, iso.from, iso.to, order);\n iCh = iso.from;\n }\n iScan = iso.from;\n }\n else if (iScan == from || (sameDir ? types[iScan - 1] != ourType : types[iScan - 1] == ourType)) {\n break;\n }\n else {\n iScan--;\n }\n }\n if (recurse)\n emitSpans(line, iScan, iCh, level + 1, baseLevel, recurse, order);\n else if (iScan < iCh)\n order.push(new BidiSpan(iScan, iCh, localLevel));\n iCh = iScan;\n }\n }\n }\n function computeSectionOrder(line, level, baseLevel, isolates, from, to, order) {\n let outerType = (level % 2 ? 2 /* T.R */ : 1 /* T.L */);\n computeCharTypes(line, from, to, isolates, outerType);\n processBracketPairs(line, from, to, isolates, outerType);\n processNeutrals(from, to, isolates, outerType);\n emitSpans(line, from, to, level, baseLevel, isolates, order);\n }\n function computeOrder(line, direction, isolates) {\n if (!line)\n return [new BidiSpan(0, 0, direction == RTL ? 1 : 0)];\n if (direction == LTR && !isolates.length && !BidiRE.test(line))\n return trivialOrder(line.length);\n if (isolates.length)\n while (line.length > types.length)\n types[types.length] = 256 /* T.NI */; // Make sure types array has no gaps\n let order = [], level = direction == LTR ? 0 : 1;\n computeSectionOrder(line, level, level, isolates, 0, line.length, order);\n return order;\n }\n function trivialOrder(length) {\n return [new BidiSpan(0, length, 0)];\n }\n let movedOver = \"\";\n // This implementation moves strictly visually, without concern for a\n // traversal visiting every logical position in the string. It will\n // still do so for simple input, but situations like multiple isolates\n // with the same level next to each other, or text going against the\n // main dir at the end of the line, will make some positions\n // unreachable with this motion. Each visible cursor position will\n // correspond to the lower-level bidi span that touches it.\n //\n // The alternative would be to solve an order globally for a given\n // line, making sure that it includes every position, but that would\n // require associating non-canonical (higher bidi span level)\n // positions with a given visual position, which is likely to confuse\n // people. (And would generally be a lot more complicated.)\n function moveVisually(line, order, dir, start, forward) {\n var _a;\n let startIndex = start.head - line.from;\n let spanI = BidiSpan.find(order, startIndex, (_a = start.bidiLevel) !== null && _a !== void 0 ? _a : -1, start.assoc);\n let span = order[spanI], spanEnd = span.side(forward, dir);\n // End of span\n if (startIndex == spanEnd) {\n let nextI = spanI += forward ? 1 : -1;\n if (nextI < 0 || nextI >= order.length)\n return null;\n span = order[spanI = nextI];\n startIndex = span.side(!forward, dir);\n spanEnd = span.side(forward, dir);\n }\n let nextIndex = findClusterBreak(line.text, startIndex, span.forward(forward, dir));\n if (nextIndex < span.from || nextIndex > span.to)\n nextIndex = spanEnd;\n movedOver = line.text.slice(Math.min(startIndex, nextIndex), Math.max(startIndex, nextIndex));\n let nextSpan = spanI == (forward ? order.length - 1 : 0) ? null : order[spanI + (forward ? 1 : -1)];\n if (nextSpan && nextIndex == spanEnd && nextSpan.level + (forward ? 0 : 1) < span.level)\n return EditorSelection.cursor(nextSpan.side(!forward, dir) + line.from, nextSpan.forward(forward, dir) ? 1 : -1, nextSpan.level);\n return EditorSelection.cursor(nextIndex + line.from, span.forward(forward, dir) ? -1 : 1, span.level);\n }\n function autoDirection(text, from, to) {\n for (let i = from; i < to; i++) {\n let type = charType(text.charCodeAt(i));\n if (type == 1 /* T.L */)\n return LTR;\n if (type == 2 /* T.R */ || type == 4 /* T.AL */)\n return RTL;\n }\n return LTR;\n }\n\n const clickAddsSelectionRange = /*@__PURE__*/Facet.define();\n const dragMovesSelection$1 = /*@__PURE__*/Facet.define();\n const mouseSelectionStyle = /*@__PURE__*/Facet.define();\n const exceptionSink = /*@__PURE__*/Facet.define();\n const updateListener = /*@__PURE__*/Facet.define();\n const inputHandler$1 = /*@__PURE__*/Facet.define();\n const focusChangeEffect = /*@__PURE__*/Facet.define();\n const perLineTextDirection = /*@__PURE__*/Facet.define({\n combine: values => values.some(x => x)\n });\n const nativeSelectionHidden = /*@__PURE__*/Facet.define({\n combine: values => values.some(x => x)\n });\n const scrollHandler = /*@__PURE__*/Facet.define();\n class ScrollTarget {\n constructor(range, y = \"nearest\", x = \"nearest\", yMargin = 5, xMargin = 5, \n // This data structure is abused to also store precise scroll\n // snapshots, instead of a `scrollIntoView` request. When this\n // flag is `true`, `range` points at a position in the reference\n // line, `yMargin` holds the difference between the top of that\n // line and the top of the editor, and `xMargin` holds the\n // editor's `scrollLeft`.\n isSnapshot = false) {\n this.range = range;\n this.y = y;\n this.x = x;\n this.yMargin = yMargin;\n this.xMargin = xMargin;\n this.isSnapshot = isSnapshot;\n }\n map(changes) {\n return changes.empty ? this :\n new ScrollTarget(this.range.map(changes), this.y, this.x, this.yMargin, this.xMargin, this.isSnapshot);\n }\n clip(state) {\n return this.range.to <= state.doc.length ? this :\n new ScrollTarget(EditorSelection.cursor(state.doc.length), this.y, this.x, this.yMargin, this.xMargin, this.isSnapshot);\n }\n }\n const scrollIntoView$1 = /*@__PURE__*/StateEffect.define({ map: (t, ch) => t.map(ch) });\n const setEditContextFormatting = /*@__PURE__*/StateEffect.define();\n /**\n Log or report an unhandled exception in client code. Should\n probably only be used by extension code that allows client code to\n provide functions, and calls those functions in a context where an\n exception can't be propagated to calling code in a reasonable way\n (for example when in an event handler).\n\n Either calls a handler registered with\n [`EditorView.exceptionSink`](https://codemirror.net/6/docs/ref/#view.EditorView^exceptionSink),\n `window.onerror`, if defined, or `console.error` (in which case\n it'll pass `context`, when given, as first argument).\n */\n function logException(state, exception, context) {\n let handler = state.facet(exceptionSink);\n if (handler.length)\n handler[0](exception);\n else if (window.onerror)\n window.onerror(String(exception), context, undefined, undefined, exception);\n else if (context)\n console.error(context + \":\", exception);\n else\n console.error(exception);\n }\n const editable = /*@__PURE__*/Facet.define({ combine: values => values.length ? values[0] : true });\n let nextPluginID = 0;\n const viewPlugin = /*@__PURE__*/Facet.define();\n /**\n View plugins associate stateful values with a view. They can\n influence the way the content is drawn, and are notified of things\n that happen in the view.\n */\n class ViewPlugin {\n constructor(\n /**\n @internal\n */\n id, \n /**\n @internal\n */\n create, \n /**\n @internal\n */\n domEventHandlers, \n /**\n @internal\n */\n domEventObservers, buildExtensions) {\n this.id = id;\n this.create = create;\n this.domEventHandlers = domEventHandlers;\n this.domEventObservers = domEventObservers;\n this.extension = buildExtensions(this);\n }\n /**\n Define a plugin from a constructor function that creates the\n plugin's value, given an editor view.\n */\n static define(create, spec) {\n const { eventHandlers, eventObservers, provide, decorations: deco } = spec || {};\n return new ViewPlugin(nextPluginID++, create, eventHandlers, eventObservers, plugin => {\n let ext = [viewPlugin.of(plugin)];\n if (deco)\n ext.push(decorations.of(view => {\n let pluginInst = view.plugin(plugin);\n return pluginInst ? deco(pluginInst) : Decoration.none;\n }));\n if (provide)\n ext.push(provide(plugin));\n return ext;\n });\n }\n /**\n Create a plugin for a class whose constructor takes a single\n editor view as argument.\n */\n static fromClass(cls, spec) {\n return ViewPlugin.define(view => new cls(view), spec);\n }\n }\n class PluginInstance {\n constructor(spec) {\n this.spec = spec;\n // When starting an update, all plugins have this field set to the\n // update object, indicating they need to be updated. When finished\n // updating, it is set to `false`. Retrieving a plugin that needs to\n // be updated with `view.plugin` forces an eager update.\n this.mustUpdate = null;\n // This is null when the plugin is initially created, but\n // initialized on the first update.\n this.value = null;\n }\n update(view) {\n if (!this.value) {\n if (this.spec) {\n try {\n this.value = this.spec.create(view);\n }\n catch (e) {\n logException(view.state, e, \"CodeMirror plugin crashed\");\n this.deactivate();\n }\n }\n }\n else if (this.mustUpdate) {\n let update = this.mustUpdate;\n this.mustUpdate = null;\n if (this.value.update) {\n try {\n this.value.update(update);\n }\n catch (e) {\n logException(update.state, e, \"CodeMirror plugin crashed\");\n if (this.value.destroy)\n try {\n this.value.destroy();\n }\n catch (_) { }\n this.deactivate();\n }\n }\n }\n return this;\n }\n destroy(view) {\n var _a;\n if ((_a = this.value) === null || _a === void 0 ? void 0 : _a.destroy) {\n try {\n this.value.destroy();\n }\n catch (e) {\n logException(view.state, e, \"CodeMirror plugin crashed\");\n }\n }\n }\n deactivate() {\n this.spec = this.value = null;\n }\n }\n const editorAttributes = /*@__PURE__*/Facet.define();\n const contentAttributes = /*@__PURE__*/Facet.define();\n // Provide decorations\n const decorations = /*@__PURE__*/Facet.define();\n const outerDecorations = /*@__PURE__*/Facet.define();\n const atomicRanges = /*@__PURE__*/Facet.define();\n const bidiIsolatedRanges = /*@__PURE__*/Facet.define();\n function getIsolatedRanges(view, line) {\n let isolates = view.state.facet(bidiIsolatedRanges);\n if (!isolates.length)\n return isolates;\n let sets = isolates.map(i => i instanceof Function ? i(view) : i);\n let result = [];\n RangeSet.spans(sets, line.from, line.to, {\n point() { },\n span(fromDoc, toDoc, active, open) {\n let from = fromDoc - line.from, to = toDoc - line.from;\n let level = result;\n for (let i = active.length - 1; i >= 0; i--, open--) {\n let direction = active[i].spec.bidiIsolate, update;\n if (direction == null)\n direction = autoDirection(line.text, from, to);\n if (open > 0 && level.length &&\n (update = level[level.length - 1]).to == from && update.direction == direction) {\n update.to = to;\n level = update.inner;\n }\n else {\n let add = { from, to, direction, inner: [] };\n level.push(add);\n level = add.inner;\n }\n }\n }\n });\n return result;\n }\n const scrollMargins = /*@__PURE__*/Facet.define();\n function getScrollMargins(view) {\n let left = 0, right = 0, top = 0, bottom = 0;\n for (let source of view.state.facet(scrollMargins)) {\n let m = source(view);\n if (m) {\n if (m.left != null)\n left = Math.max(left, m.left);\n if (m.right != null)\n right = Math.max(right, m.right);\n if (m.top != null)\n top = Math.max(top, m.top);\n if (m.bottom != null)\n bottom = Math.max(bottom, m.bottom);\n }\n }\n return { left, right, top, bottom };\n }\n const styleModule = /*@__PURE__*/Facet.define();\n class ChangedRange {\n constructor(fromA, toA, fromB, toB) {\n this.fromA = fromA;\n this.toA = toA;\n this.fromB = fromB;\n this.toB = toB;\n }\n join(other) {\n return new ChangedRange(Math.min(this.fromA, other.fromA), Math.max(this.toA, other.toA), Math.min(this.fromB, other.fromB), Math.max(this.toB, other.toB));\n }\n addToSet(set) {\n let i = set.length, me = this;\n for (; i > 0; i--) {\n let range = set[i - 1];\n if (range.fromA > me.toA)\n continue;\n if (range.toA < me.fromA)\n break;\n me = me.join(range);\n set.splice(i - 1, 1);\n }\n set.splice(i, 0, me);\n return set;\n }\n static extendWithRanges(diff, ranges) {\n if (ranges.length == 0)\n return diff;\n let result = [];\n for (let dI = 0, rI = 0, posA = 0, posB = 0;; dI++) {\n let next = dI == diff.length ? null : diff[dI], off = posA - posB;\n let end = next ? next.fromB : 1e9;\n while (rI < ranges.length && ranges[rI] < end) {\n let from = ranges[rI], to = ranges[rI + 1];\n let fromB = Math.max(posB, from), toB = Math.min(end, to);\n if (fromB <= toB)\n new ChangedRange(fromB + off, toB + off, fromB, toB).addToSet(result);\n if (to > end)\n break;\n else\n rI += 2;\n }\n if (!next)\n return result;\n new ChangedRange(next.fromA, next.toA, next.fromB, next.toB).addToSet(result);\n posA = next.toA;\n posB = next.toB;\n }\n }\n }\n /**\n View [plugins](https://codemirror.net/6/docs/ref/#view.ViewPlugin) are given instances of this\n class, which describe what happened, whenever the view is updated.\n */\n class ViewUpdate {\n constructor(\n /**\n The editor view that the update is associated with.\n */\n view, \n /**\n The new editor state.\n */\n state, \n /**\n The transactions involved in the update. May be empty.\n */\n transactions) {\n this.view = view;\n this.state = state;\n this.transactions = transactions;\n /**\n @internal\n */\n this.flags = 0;\n this.startState = view.state;\n this.changes = ChangeSet.empty(this.startState.doc.length);\n for (let tr of transactions)\n this.changes = this.changes.compose(tr.changes);\n let changedRanges = [];\n this.changes.iterChangedRanges((fromA, toA, fromB, toB) => changedRanges.push(new ChangedRange(fromA, toA, fromB, toB)));\n this.changedRanges = changedRanges;\n }\n /**\n @internal\n */\n static create(view, state, transactions) {\n return new ViewUpdate(view, state, transactions);\n }\n /**\n Tells you whether the [viewport](https://codemirror.net/6/docs/ref/#view.EditorView.viewport) or\n [visible ranges](https://codemirror.net/6/docs/ref/#view.EditorView.visibleRanges) changed in this\n update.\n */\n get viewportChanged() {\n return (this.flags & 4 /* UpdateFlag.Viewport */) > 0;\n }\n /**\n Indicates whether the height of a block element in the editor\n changed in this update.\n */\n get heightChanged() {\n return (this.flags & 2 /* UpdateFlag.Height */) > 0;\n }\n /**\n Returns true when the document was modified or the size of the\n editor, or elements within the editor, changed.\n */\n get geometryChanged() {\n return this.docChanged || (this.flags & (8 /* UpdateFlag.Geometry */ | 2 /* UpdateFlag.Height */)) > 0;\n }\n /**\n True when this update indicates a focus change.\n */\n get focusChanged() {\n return (this.flags & 1 /* UpdateFlag.Focus */) > 0;\n }\n /**\n Whether the document changed in this update.\n */\n get docChanged() {\n return !this.changes.empty;\n }\n /**\n Whether the selection was explicitly set in this update.\n */\n get selectionSet() {\n return this.transactions.some(tr => tr.selection);\n }\n /**\n @internal\n */\n get empty() { return this.flags == 0 && this.transactions.length == 0; }\n }\n\n class DocView extends ContentView {\n get length() { return this.view.state.doc.length; }\n constructor(view) {\n super();\n this.view = view;\n this.decorations = [];\n this.dynamicDecorationMap = [false];\n this.domChanged = null;\n this.hasComposition = null;\n this.markedForComposition = new Set;\n this.editContextFormatting = Decoration.none;\n this.lastCompositionAfterCursor = false;\n // Track a minimum width for the editor. When measuring sizes in\n // measureVisibleLineHeights, this is updated to point at the width\n // of a given element and its extent in the document. When a change\n // happens in that range, these are reset. That way, once we've seen\n // a line/element of a given length, we keep the editor wide enough\n // to fit at least that element, until it is changed, at which point\n // we forget it again.\n this.minWidth = 0;\n this.minWidthFrom = 0;\n this.minWidthTo = 0;\n // Track whether the DOM selection was set in a lossy way, so that\n // we don't mess it up when reading it back it\n this.impreciseAnchor = null;\n this.impreciseHead = null;\n this.forceSelection = false;\n // Used by the resize observer to ignore resizes that we caused\n // ourselves\n this.lastUpdate = Date.now();\n this.setDOM(view.contentDOM);\n this.children = [new LineView];\n this.children[0].setParent(this);\n this.updateDeco();\n this.updateInner([new ChangedRange(0, 0, 0, view.state.doc.length)], 0, null);\n }\n // Update the document view to a given state.\n update(update) {\n var _a;\n let changedRanges = update.changedRanges;\n if (this.minWidth > 0 && changedRanges.length) {\n if (!changedRanges.every(({ fromA, toA }) => toA < this.minWidthFrom || fromA > this.minWidthTo)) {\n this.minWidth = this.minWidthFrom = this.minWidthTo = 0;\n }\n else {\n this.minWidthFrom = update.changes.mapPos(this.minWidthFrom, 1);\n this.minWidthTo = update.changes.mapPos(this.minWidthTo, 1);\n }\n }\n this.updateEditContextFormatting(update);\n let readCompositionAt = -1;\n if (this.view.inputState.composing >= 0 && !this.view.observer.editContext) {\n if ((_a = this.domChanged) === null || _a === void 0 ? void 0 : _a.newSel)\n readCompositionAt = this.domChanged.newSel.head;\n else if (!touchesComposition(update.changes, this.hasComposition) && !update.selectionSet)\n readCompositionAt = update.state.selection.main.head;\n }\n let composition = readCompositionAt > -1 ? findCompositionRange(this.view, update.changes, readCompositionAt) : null;\n this.domChanged = null;\n if (this.hasComposition) {\n this.markedForComposition.clear();\n let { from, to } = this.hasComposition;\n changedRanges = new ChangedRange(from, to, update.changes.mapPos(from, -1), update.changes.mapPos(to, 1))\n .addToSet(changedRanges.slice());\n }\n this.hasComposition = composition ? { from: composition.range.fromB, to: composition.range.toB } : null;\n // When the DOM nodes around the selection are moved to another\n // parent, Chrome sometimes reports a different selection through\n // getSelection than the one that it actually shows to the user.\n // This forces a selection update when lines are joined to work\n // around that. Issue #54\n if ((browser.ie || browser.chrome) && !composition && update &&\n update.state.doc.lines != update.startState.doc.lines)\n this.forceSelection = true;\n let prevDeco = this.decorations, deco = this.updateDeco();\n let decoDiff = findChangedDeco(prevDeco, deco, update.changes);\n changedRanges = ChangedRange.extendWithRanges(changedRanges, decoDiff);\n if (!(this.flags & 7 /* ViewFlag.Dirty */) && changedRanges.length == 0) {\n return false;\n }\n else {\n this.updateInner(changedRanges, update.startState.doc.length, composition);\n if (update.transactions.length)\n this.lastUpdate = Date.now();\n return true;\n }\n }\n // Used by update and the constructor do perform the actual DOM\n // update\n updateInner(changes, oldLength, composition) {\n this.view.viewState.mustMeasureContent = true;\n this.updateChildren(changes, oldLength, composition);\n let { observer } = this.view;\n observer.ignore(() => {\n // Lock the height during redrawing, since Chrome sometimes\n // messes with the scroll position during DOM mutation (though\n // no relayout is triggered and I cannot imagine how it can\n // recompute the scroll position without a layout)\n this.dom.style.height = this.view.viewState.contentHeight / this.view.scaleY + \"px\";\n this.dom.style.flexBasis = this.minWidth ? this.minWidth + \"px\" : \"\";\n // Chrome will sometimes, when DOM mutations occur directly\n // around the selection, get confused and report a different\n // selection from the one it displays (issue #218). This tries\n // to detect that situation.\n let track = browser.chrome || browser.ios ? { node: observer.selectionRange.focusNode, written: false } : undefined;\n this.sync(this.view, track);\n this.flags &= ~7 /* ViewFlag.Dirty */;\n if (track && (track.written || observer.selectionRange.focusNode != track.node))\n this.forceSelection = true;\n this.dom.style.height = \"\";\n });\n this.markedForComposition.forEach(cView => cView.flags &= ~8 /* ViewFlag.Composition */);\n let gaps = [];\n if (this.view.viewport.from || this.view.viewport.to < this.view.state.doc.length)\n for (let child of this.children)\n if (child instanceof BlockWidgetView && child.widget instanceof BlockGapWidget)\n gaps.push(child.dom);\n observer.updateGaps(gaps);\n }\n updateChildren(changes, oldLength, composition) {\n let ranges = composition ? composition.range.addToSet(changes.slice()) : changes;\n let cursor = this.childCursor(oldLength);\n for (let i = ranges.length - 1;; i--) {\n let next = i >= 0 ? ranges[i] : null;\n if (!next)\n break;\n let { fromA, toA, fromB, toB } = next, content, breakAtStart, openStart, openEnd;\n if (composition && composition.range.fromB < toB && composition.range.toB > fromB) {\n let before = ContentBuilder.build(this.view.state.doc, fromB, composition.range.fromB, this.decorations, this.dynamicDecorationMap);\n let after = ContentBuilder.build(this.view.state.doc, composition.range.toB, toB, this.decorations, this.dynamicDecorationMap);\n breakAtStart = before.breakAtStart;\n openStart = before.openStart;\n openEnd = after.openEnd;\n let compLine = this.compositionView(composition);\n if (after.breakAtStart) {\n compLine.breakAfter = 1;\n }\n else if (after.content.length &&\n compLine.merge(compLine.length, compLine.length, after.content[0], false, after.openStart, 0)) {\n compLine.breakAfter = after.content[0].breakAfter;\n after.content.shift();\n }\n if (before.content.length &&\n compLine.merge(0, 0, before.content[before.content.length - 1], true, 0, before.openEnd)) {\n before.content.pop();\n }\n content = before.content.concat(compLine).concat(after.content);\n }\n else {\n ({ content, breakAtStart, openStart, openEnd } =\n ContentBuilder.build(this.view.state.doc, fromB, toB, this.decorations, this.dynamicDecorationMap));\n }\n let { i: toI, off: toOff } = cursor.findPos(toA, 1);\n let { i: fromI, off: fromOff } = cursor.findPos(fromA, -1);\n replaceRange(this, fromI, fromOff, toI, toOff, content, breakAtStart, openStart, openEnd);\n }\n if (composition)\n this.fixCompositionDOM(composition);\n }\n updateEditContextFormatting(update) {\n this.editContextFormatting = this.editContextFormatting.map(update.changes);\n for (let tr of update.transactions)\n for (let effect of tr.effects)\n if (effect.is(setEditContextFormatting)) {\n this.editContextFormatting = effect.value;\n }\n }\n compositionView(composition) {\n let cur = new TextView(composition.text.nodeValue);\n cur.flags |= 8 /* ViewFlag.Composition */;\n for (let { deco } of composition.marks)\n cur = new MarkView(deco, [cur], cur.length);\n let line = new LineView;\n line.append(cur, 0);\n return line;\n }\n fixCompositionDOM(composition) {\n let fix = (dom, cView) => {\n cView.flags |= 8 /* ViewFlag.Composition */ | (cView.children.some(c => c.flags & 7 /* ViewFlag.Dirty */) ? 1 /* ViewFlag.ChildDirty */ : 0);\n this.markedForComposition.add(cView);\n let prev = ContentView.get(dom);\n if (prev && prev != cView)\n prev.dom = null;\n cView.setDOM(dom);\n };\n let pos = this.childPos(composition.range.fromB, 1);\n let cView = this.children[pos.i];\n fix(composition.line, cView);\n for (let i = composition.marks.length - 1; i >= -1; i--) {\n pos = cView.childPos(pos.off, 1);\n cView = cView.children[pos.i];\n fix(i >= 0 ? composition.marks[i].node : composition.text, cView);\n }\n }\n // Sync the DOM selection to this.state.selection\n updateSelection(mustRead = false, fromPointer = false) {\n if (mustRead || !this.view.observer.selectionRange.focusNode)\n this.view.observer.readSelectionRange();\n let activeElt = this.view.root.activeElement, focused = activeElt == this.dom;\n let selectionNotFocus = !focused &&\n hasSelection(this.dom, this.view.observer.selectionRange) && !(activeElt && this.dom.contains(activeElt));\n if (!(focused || fromPointer || selectionNotFocus))\n return;\n let force = this.forceSelection;\n this.forceSelection = false;\n let main = this.view.state.selection.main;\n let anchor = this.moveToLine(this.domAtPos(main.anchor));\n let head = main.empty ? anchor : this.moveToLine(this.domAtPos(main.head));\n // Always reset on Firefox when next to an uneditable node to\n // avoid invisible cursor bugs (#111)\n if (browser.gecko && main.empty && !this.hasComposition && betweenUneditable(anchor)) {\n let dummy = document.createTextNode(\"\");\n this.view.observer.ignore(() => anchor.node.insertBefore(dummy, anchor.node.childNodes[anchor.offset] || null));\n anchor = head = new DOMPos(dummy, 0);\n force = true;\n }\n let domSel = this.view.observer.selectionRange;\n // If the selection is already here, or in an equivalent position, don't touch it\n if (force || !domSel.focusNode || (!isEquivalentPosition(anchor.node, anchor.offset, domSel.anchorNode, domSel.anchorOffset) ||\n !isEquivalentPosition(head.node, head.offset, domSel.focusNode, domSel.focusOffset)) && !this.suppressWidgetCursorChange(domSel, main)) {\n this.view.observer.ignore(() => {\n // Chrome Android will hide the virtual keyboard when tapping\n // inside an uneditable node, and not bring it back when we\n // move the cursor to its proper position. This tries to\n // restore the keyboard by cycling focus.\n if (browser.android && browser.chrome && this.dom.contains(domSel.focusNode) &&\n inUneditable(domSel.focusNode, this.dom)) {\n this.dom.blur();\n this.dom.focus({ preventScroll: true });\n }\n let rawSel = getSelection(this.view.root);\n if (!rawSel) ;\n else if (main.empty) {\n // Work around https://bugzilla.mozilla.org/show_bug.cgi?id=1612076\n if (browser.gecko) {\n let nextTo = nextToUneditable(anchor.node, anchor.offset);\n if (nextTo && nextTo != (1 /* NextTo.Before */ | 2 /* NextTo.After */)) {\n let text = (nextTo == 1 /* NextTo.Before */ ? textNodeBefore : textNodeAfter)(anchor.node, anchor.offset);\n if (text)\n anchor = new DOMPos(text.node, text.offset);\n }\n }\n rawSel.collapse(anchor.node, anchor.offset);\n if (main.bidiLevel != null && rawSel.caretBidiLevel !== undefined)\n rawSel.caretBidiLevel = main.bidiLevel;\n }\n else if (rawSel.extend) {\n // Selection.extend can be used to create an 'inverted' selection\n // (one where the focus is before the anchor), but not all\n // browsers support it yet.\n rawSel.collapse(anchor.node, anchor.offset);\n // Safari will ignore the call above when the editor is\n // hidden, and then raise an error on the call to extend\n // (#940).\n try {\n rawSel.extend(head.node, head.offset);\n }\n catch (_) { }\n }\n else {\n // Primitive (IE) way\n let range = document.createRange();\n if (main.anchor > main.head)\n [anchor, head] = [head, anchor];\n range.setEnd(head.node, head.offset);\n range.setStart(anchor.node, anchor.offset);\n rawSel.removeAllRanges();\n rawSel.addRange(range);\n }\n if (selectionNotFocus && this.view.root.activeElement == this.dom) {\n this.dom.blur();\n if (activeElt)\n activeElt.focus();\n }\n });\n this.view.observer.setSelectionRange(anchor, head);\n }\n this.impreciseAnchor = anchor.precise ? null : new DOMPos(domSel.anchorNode, domSel.anchorOffset);\n this.impreciseHead = head.precise ? null : new DOMPos(domSel.focusNode, domSel.focusOffset);\n }\n // If a zero-length widget is inserted next to the cursor during\n // composition, avoid moving it across it and disrupting the\n // composition.\n suppressWidgetCursorChange(sel, cursor) {\n return this.hasComposition && cursor.empty &&\n isEquivalentPosition(sel.focusNode, sel.focusOffset, sel.anchorNode, sel.anchorOffset) &&\n this.posFromDOM(sel.focusNode, sel.focusOffset) == cursor.head;\n }\n enforceCursorAssoc() {\n if (this.hasComposition)\n return;\n let { view } = this, cursor = view.state.selection.main;\n let sel = getSelection(view.root);\n let { anchorNode, anchorOffset } = view.observer.selectionRange;\n if (!sel || !cursor.empty || !cursor.assoc || !sel.modify)\n return;\n let line = LineView.find(this, cursor.head);\n if (!line)\n return;\n let lineStart = line.posAtStart;\n if (cursor.head == lineStart || cursor.head == lineStart + line.length)\n return;\n let before = this.coordsAt(cursor.head, -1), after = this.coordsAt(cursor.head, 1);\n if (!before || !after || before.bottom > after.top)\n return;\n let dom = this.domAtPos(cursor.head + cursor.assoc);\n sel.collapse(dom.node, dom.offset);\n sel.modify(\"move\", cursor.assoc < 0 ? \"forward\" : \"backward\", \"lineboundary\");\n // This can go wrong in corner cases like single-character lines,\n // so check and reset if necessary.\n view.observer.readSelectionRange();\n let newRange = view.observer.selectionRange;\n if (view.docView.posFromDOM(newRange.anchorNode, newRange.anchorOffset) != cursor.from)\n sel.collapse(anchorNode, anchorOffset);\n }\n // If a position is in/near a block widget, move it to a nearby text\n // line, since we don't want the cursor inside a block widget.\n moveToLine(pos) {\n // Block widgets will return positions before/after them, which\n // are thus directly in the document DOM element.\n let dom = this.dom, newPos;\n if (pos.node != dom)\n return pos;\n for (let i = pos.offset; !newPos && i < dom.childNodes.length; i++) {\n let view = ContentView.get(dom.childNodes[i]);\n if (view instanceof LineView)\n newPos = view.domAtPos(0);\n }\n for (let i = pos.offset - 1; !newPos && i >= 0; i--) {\n let view = ContentView.get(dom.childNodes[i]);\n if (view instanceof LineView)\n newPos = view.domAtPos(view.length);\n }\n return newPos ? new DOMPos(newPos.node, newPos.offset, true) : pos;\n }\n nearest(dom) {\n for (let cur = dom; cur;) {\n let domView = ContentView.get(cur);\n if (domView && domView.rootView == this)\n return domView;\n cur = cur.parentNode;\n }\n return null;\n }\n posFromDOM(node, offset) {\n let view = this.nearest(node);\n if (!view)\n throw new RangeError(\"Trying to find position for a DOM position outside of the document\");\n return view.localPosFromDOM(node, offset) + view.posAtStart;\n }\n domAtPos(pos) {\n let { i, off } = this.childCursor().findPos(pos, -1);\n for (; i < this.children.length - 1;) {\n let child = this.children[i];\n if (off < child.length || child instanceof LineView)\n break;\n i++;\n off = 0;\n }\n return this.children[i].domAtPos(off);\n }\n coordsAt(pos, side) {\n let best = null, bestPos = 0;\n for (let off = this.length, i = this.children.length - 1; i >= 0; i--) {\n let child = this.children[i], end = off - child.breakAfter, start = end - child.length;\n if (end < pos)\n break;\n if (start <= pos && (start < pos || child.covers(-1)) && (end > pos || child.covers(1)) &&\n (!best || child instanceof LineView && !(best instanceof LineView && side >= 0))) {\n best = child;\n bestPos = start;\n }\n else if (best && start == pos && end == pos && child instanceof BlockWidgetView && Math.abs(side) < 2) {\n if (child.deco.startSide < 0)\n break;\n else if (i)\n best = null;\n }\n off = start;\n }\n return best ? best.coordsAt(pos - bestPos, side) : null;\n }\n coordsForChar(pos) {\n let { i, off } = this.childPos(pos, 1), child = this.children[i];\n if (!(child instanceof LineView))\n return null;\n while (child.children.length) {\n let { i, off: childOff } = child.childPos(off, 1);\n for (;; i++) {\n if (i == child.children.length)\n return null;\n if ((child = child.children[i]).length)\n break;\n }\n off = childOff;\n }\n if (!(child instanceof TextView))\n return null;\n let end = findClusterBreak(child.text, off);\n if (end == off)\n return null;\n let rects = textRange(child.dom, off, end).getClientRects();\n for (let i = 0; i < rects.length; i++) {\n let rect = rects[i];\n if (i == rects.length - 1 || rect.top < rect.bottom && rect.left < rect.right)\n return rect;\n }\n return null;\n }\n measureVisibleLineHeights(viewport) {\n let result = [], { from, to } = viewport;\n let contentWidth = this.view.contentDOM.clientWidth;\n let isWider = contentWidth > Math.max(this.view.scrollDOM.clientWidth, this.minWidth) + 1;\n let widest = -1, ltr = this.view.textDirection == Direction.LTR;\n for (let pos = 0, i = 0; i < this.children.length; i++) {\n let child = this.children[i], end = pos + child.length;\n if (end > to)\n break;\n if (pos >= from) {\n let childRect = child.dom.getBoundingClientRect();\n result.push(childRect.height);\n if (isWider) {\n let last = child.dom.lastChild;\n let rects = last ? clientRectsFor(last) : [];\n if (rects.length) {\n let rect = rects[rects.length - 1];\n let width = ltr ? rect.right - childRect.left : childRect.right - rect.left;\n if (width > widest) {\n widest = width;\n this.minWidth = contentWidth;\n this.minWidthFrom = pos;\n this.minWidthTo = end;\n }\n }\n }\n }\n pos = end + child.breakAfter;\n }\n return result;\n }\n textDirectionAt(pos) {\n let { i } = this.childPos(pos, 1);\n return getComputedStyle(this.children[i].dom).direction == \"rtl\" ? Direction.RTL : Direction.LTR;\n }\n measureTextSize() {\n for (let child of this.children) {\n if (child instanceof LineView) {\n let measure = child.measureTextSize();\n if (measure)\n return measure;\n }\n }\n // If no workable line exists, force a layout of a measurable element\n let dummy = document.createElement(\"div\"), lineHeight, charWidth, textHeight;\n dummy.className = \"cm-line\";\n dummy.style.width = \"99999px\";\n dummy.style.position = \"absolute\";\n dummy.textContent = \"abc def ghi jkl mno pqr stu\";\n this.view.observer.ignore(() => {\n this.dom.appendChild(dummy);\n let rect = clientRectsFor(dummy.firstChild)[0];\n lineHeight = dummy.getBoundingClientRect().height;\n charWidth = rect ? rect.width / 27 : 7;\n textHeight = rect ? rect.height : lineHeight;\n dummy.remove();\n });\n return { lineHeight, charWidth, textHeight };\n }\n childCursor(pos = this.length) {\n // Move back to start of last element when possible, so that\n // `ChildCursor.findPos` doesn't have to deal with the edge case\n // of being after the last element.\n let i = this.children.length;\n if (i)\n pos -= this.children[--i].length;\n return new ChildCursor(this.children, pos, i);\n }\n computeBlockGapDeco() {\n let deco = [], vs = this.view.viewState;\n for (let pos = 0, i = 0;; i++) {\n let next = i == vs.viewports.length ? null : vs.viewports[i];\n let end = next ? next.from - 1 : this.length;\n if (end > pos) {\n let height = (vs.lineBlockAt(end).bottom - vs.lineBlockAt(pos).top) / this.view.scaleY;\n deco.push(Decoration.replace({\n widget: new BlockGapWidget(height),\n block: true,\n inclusive: true,\n isBlockGap: true,\n }).range(pos, end));\n }\n if (!next)\n break;\n pos = next.to + 1;\n }\n return Decoration.set(deco);\n }\n updateDeco() {\n let i = 1;\n let allDeco = this.view.state.facet(decorations).map(d => {\n let dynamic = this.dynamicDecorationMap[i++] = typeof d == \"function\";\n return dynamic ? d(this.view) : d;\n });\n let dynamicOuter = false, outerDeco = this.view.state.facet(outerDecorations).map((d, i) => {\n let dynamic = typeof d == \"function\";\n if (dynamic)\n dynamicOuter = true;\n return dynamic ? d(this.view) : d;\n });\n if (outerDeco.length) {\n this.dynamicDecorationMap[i++] = dynamicOuter;\n allDeco.push(RangeSet.join(outerDeco));\n }\n this.decorations = [\n this.editContextFormatting,\n ...allDeco,\n this.computeBlockGapDeco(),\n this.view.viewState.lineGapDeco\n ];\n while (i < this.decorations.length)\n this.dynamicDecorationMap[i++] = false;\n return this.decorations;\n }\n scrollIntoView(target) {\n if (target.isSnapshot) {\n let ref = this.view.viewState.lineBlockAt(target.range.head);\n this.view.scrollDOM.scrollTop = ref.top - target.yMargin;\n this.view.scrollDOM.scrollLeft = target.xMargin;\n return;\n }\n for (let handler of this.view.state.facet(scrollHandler)) {\n try {\n if (handler(this.view, target.range, target))\n return true;\n }\n catch (e) {\n logException(this.view.state, e, \"scroll handler\");\n }\n }\n let { range } = target;\n let rect = this.coordsAt(range.head, range.empty ? range.assoc : range.head > range.anchor ? -1 : 1), other;\n if (!rect)\n return;\n if (!range.empty && (other = this.coordsAt(range.anchor, range.anchor > range.head ? -1 : 1)))\n rect = { left: Math.min(rect.left, other.left), top: Math.min(rect.top, other.top),\n right: Math.max(rect.right, other.right), bottom: Math.max(rect.bottom, other.bottom) };\n let margins = getScrollMargins(this.view);\n let targetRect = {\n left: rect.left - margins.left, top: rect.top - margins.top,\n right: rect.right + margins.right, bottom: rect.bottom + margins.bottom\n };\n let { offsetWidth, offsetHeight } = this.view.scrollDOM;\n scrollRectIntoView(this.view.scrollDOM, targetRect, range.head < range.anchor ? -1 : 1, target.x, target.y, Math.max(Math.min(target.xMargin, offsetWidth), -offsetWidth), Math.max(Math.min(target.yMargin, offsetHeight), -offsetHeight), this.view.textDirection == Direction.LTR);\n }\n }\n function betweenUneditable(pos) {\n return pos.node.nodeType == 1 && pos.node.firstChild &&\n (pos.offset == 0 || pos.node.childNodes[pos.offset - 1].contentEditable == \"false\") &&\n (pos.offset == pos.node.childNodes.length || pos.node.childNodes[pos.offset].contentEditable == \"false\");\n }\n class BlockGapWidget extends WidgetType {\n constructor(height) {\n super();\n this.height = height;\n }\n toDOM() {\n let elt = document.createElement(\"div\");\n elt.className = \"cm-gap\";\n this.updateDOM(elt);\n return elt;\n }\n eq(other) { return other.height == this.height; }\n updateDOM(elt) {\n elt.style.height = this.height + \"px\";\n return true;\n }\n get editable() { return true; }\n get estimatedHeight() { return this.height; }\n ignoreEvent() { return false; }\n }\n function findCompositionNode(view, headPos) {\n let sel = view.observer.selectionRange;\n if (!sel.focusNode)\n return null;\n let textBefore = textNodeBefore(sel.focusNode, sel.focusOffset);\n let textAfter = textNodeAfter(sel.focusNode, sel.focusOffset);\n let textNode = textBefore || textAfter;\n if (textAfter && textBefore && textAfter.node != textBefore.node) {\n let descAfter = ContentView.get(textAfter.node);\n if (!descAfter || descAfter instanceof TextView && descAfter.text != textAfter.node.nodeValue) {\n textNode = textAfter;\n }\n else if (view.docView.lastCompositionAfterCursor) {\n let descBefore = ContentView.get(textBefore.node);\n if (!(!descBefore || descBefore instanceof TextView && descBefore.text != textBefore.node.nodeValue))\n textNode = textAfter;\n }\n }\n view.docView.lastCompositionAfterCursor = textNode != textBefore;\n if (!textNode)\n return null;\n let from = headPos - textNode.offset;\n return { from, to: from + textNode.node.nodeValue.length, node: textNode.node };\n }\n function findCompositionRange(view, changes, headPos) {\n let found = findCompositionNode(view, headPos);\n if (!found)\n return null;\n let { node: textNode, from, to } = found, text = textNode.nodeValue;\n // Don't try to preserve multi-line compositions\n if (/[\\n\\r]/.test(text))\n return null;\n if (view.state.doc.sliceString(found.from, found.to) != text)\n return null;\n let inv = changes.invertedDesc;\n let range = new ChangedRange(inv.mapPos(from), inv.mapPos(to), from, to);\n let marks = [];\n for (let parent = textNode.parentNode;; parent = parent.parentNode) {\n let parentView = ContentView.get(parent);\n if (parentView instanceof MarkView)\n marks.push({ node: parent, deco: parentView.mark });\n else if (parentView instanceof LineView || parent.nodeName == \"DIV\" && parent.parentNode == view.contentDOM)\n return { range, text: textNode, marks, line: parent };\n else if (parent != view.contentDOM)\n marks.push({ node: parent, deco: new MarkDecoration({\n inclusive: true,\n attributes: getAttrs$1(parent),\n tagName: parent.tagName.toLowerCase()\n }) });\n else\n return null;\n }\n }\n function nextToUneditable(node, offset) {\n if (node.nodeType != 1)\n return 0;\n return (offset && node.childNodes[offset - 1].contentEditable == \"false\" ? 1 /* NextTo.Before */ : 0) |\n (offset < node.childNodes.length && node.childNodes[offset].contentEditable == \"false\" ? 2 /* NextTo.After */ : 0);\n }\n let DecorationComparator$1 = class DecorationComparator {\n constructor() {\n this.changes = [];\n }\n compareRange(from, to) { addRange(from, to, this.changes); }\n comparePoint(from, to) { addRange(from, to, this.changes); }\n };\n function findChangedDeco(a, b, diff) {\n let comp = new DecorationComparator$1;\n RangeSet.compare(a, b, diff, comp);\n return comp.changes;\n }\n function inUneditable(node, inside) {\n for (let cur = node; cur && cur != inside; cur = cur.assignedSlot || cur.parentNode) {\n if (cur.nodeType == 1 && cur.contentEditable == 'false') {\n return true;\n }\n }\n return false;\n }\n function touchesComposition(changes, composition) {\n let touched = false;\n if (composition)\n changes.iterChangedRanges((from, to) => {\n if (from < composition.to && to > composition.from)\n touched = true;\n });\n return touched;\n }\n\n function groupAt(state, pos, bias = 1) {\n let categorize = state.charCategorizer(pos);\n let line = state.doc.lineAt(pos), linePos = pos - line.from;\n if (line.length == 0)\n return EditorSelection.cursor(pos);\n if (linePos == 0)\n bias = 1;\n else if (linePos == line.length)\n bias = -1;\n let from = linePos, to = linePos;\n if (bias < 0)\n from = findClusterBreak(line.text, linePos, false);\n else\n to = findClusterBreak(line.text, linePos);\n let cat = categorize(line.text.slice(from, to));\n while (from > 0) {\n let prev = findClusterBreak(line.text, from, false);\n if (categorize(line.text.slice(prev, from)) != cat)\n break;\n from = prev;\n }\n while (to < line.length) {\n let next = findClusterBreak(line.text, to);\n if (categorize(line.text.slice(to, next)) != cat)\n break;\n to = next;\n }\n return EditorSelection.range(from + line.from, to + line.from);\n }\n // Search the DOM for the {node, offset} position closest to the given\n // coordinates. Very inefficient and crude, but can usually be avoided\n // by calling caret(Position|Range)FromPoint instead.\n function getdx(x, rect) {\n return rect.left > x ? rect.left - x : Math.max(0, x - rect.right);\n }\n function getdy(y, rect) {\n return rect.top > y ? rect.top - y : Math.max(0, y - rect.bottom);\n }\n function yOverlap(a, b) {\n return a.top < b.bottom - 1 && a.bottom > b.top + 1;\n }\n function upTop(rect, top) {\n return top < rect.top ? { top, left: rect.left, right: rect.right, bottom: rect.bottom } : rect;\n }\n function upBot(rect, bottom) {\n return bottom > rect.bottom ? { top: rect.top, left: rect.left, right: rect.right, bottom } : rect;\n }\n function domPosAtCoords(parent, x, y) {\n let closest, closestRect, closestX, closestY, closestOverlap = false;\n let above, below, aboveRect, belowRect;\n for (let child = parent.firstChild; child; child = child.nextSibling) {\n let rects = clientRectsFor(child);\n for (let i = 0; i < rects.length; i++) {\n let rect = rects[i];\n if (closestRect && yOverlap(closestRect, rect))\n rect = upTop(upBot(rect, closestRect.bottom), closestRect.top);\n let dx = getdx(x, rect), dy = getdy(y, rect);\n if (dx == 0 && dy == 0)\n return child.nodeType == 3 ? domPosInText(child, x, y) : domPosAtCoords(child, x, y);\n if (!closest || closestY > dy || closestY == dy && closestX > dx) {\n closest = child;\n closestRect = rect;\n closestX = dx;\n closestY = dy;\n let side = dy ? (y < rect.top ? -1 : 1) : dx ? (x < rect.left ? -1 : 1) : 0;\n closestOverlap = !side || (side > 0 ? i < rects.length - 1 : i > 0);\n }\n if (dx == 0) {\n if (y > rect.bottom && (!aboveRect || aboveRect.bottom < rect.bottom)) {\n above = child;\n aboveRect = rect;\n }\n else if (y < rect.top && (!belowRect || belowRect.top > rect.top)) {\n below = child;\n belowRect = rect;\n }\n }\n else if (aboveRect && yOverlap(aboveRect, rect)) {\n aboveRect = upBot(aboveRect, rect.bottom);\n }\n else if (belowRect && yOverlap(belowRect, rect)) {\n belowRect = upTop(belowRect, rect.top);\n }\n }\n }\n if (aboveRect && aboveRect.bottom >= y) {\n closest = above;\n closestRect = aboveRect;\n }\n else if (belowRect && belowRect.top <= y) {\n closest = below;\n closestRect = belowRect;\n }\n if (!closest)\n return { node: parent, offset: 0 };\n let clipX = Math.max(closestRect.left, Math.min(closestRect.right, x));\n if (closest.nodeType == 3)\n return domPosInText(closest, clipX, y);\n if (closestOverlap && closest.contentEditable != \"false\")\n return domPosAtCoords(closest, clipX, y);\n let offset = Array.prototype.indexOf.call(parent.childNodes, closest) +\n (x >= (closestRect.left + closestRect.right) / 2 ? 1 : 0);\n return { node: parent, offset };\n }\n function domPosInText(node, x, y) {\n let len = node.nodeValue.length;\n let closestOffset = -1, closestDY = 1e9, generalSide = 0;\n for (let i = 0; i < len; i++) {\n let rects = textRange(node, i, i + 1).getClientRects();\n for (let j = 0; j < rects.length; j++) {\n let rect = rects[j];\n if (rect.top == rect.bottom)\n continue;\n if (!generalSide)\n generalSide = x - rect.left;\n let dy = (rect.top > y ? rect.top - y : y - rect.bottom) - 1;\n if (rect.left - 1 <= x && rect.right + 1 >= x && dy < closestDY) {\n let right = x >= (rect.left + rect.right) / 2, after = right;\n if (browser.chrome || browser.gecko) {\n // Check for RTL on browsers that support getting client\n // rects for empty ranges.\n let rectBefore = textRange(node, i).getBoundingClientRect();\n if (rectBefore.left == rect.right)\n after = !right;\n }\n if (dy <= 0)\n return { node, offset: i + (after ? 1 : 0) };\n closestOffset = i + (after ? 1 : 0);\n closestDY = dy;\n }\n }\n }\n return { node, offset: closestOffset > -1 ? closestOffset : generalSide > 0 ? node.nodeValue.length : 0 };\n }\n function posAtCoords(view, coords, precise, bias = -1) {\n var _a, _b;\n let content = view.contentDOM.getBoundingClientRect(), docTop = content.top + view.viewState.paddingTop;\n let block, { docHeight } = view.viewState;\n let { x, y } = coords, yOffset = y - docTop;\n if (yOffset < 0)\n return 0;\n if (yOffset > docHeight)\n return view.state.doc.length;\n // Scan for a text block near the queried y position\n for (let halfLine = view.viewState.heightOracle.textHeight / 2, bounced = false;;) {\n block = view.elementAtHeight(yOffset);\n if (block.type == BlockType.Text)\n break;\n for (;;) {\n // Move the y position out of this block\n yOffset = bias > 0 ? block.bottom + halfLine : block.top - halfLine;\n if (yOffset >= 0 && yOffset <= docHeight)\n break;\n // If the document consists entirely of replaced widgets, we\n // won't find a text block, so return 0\n if (bounced)\n return precise ? null : 0;\n bounced = true;\n bias = -bias;\n }\n }\n y = docTop + yOffset;\n let lineStart = block.from;\n // If this is outside of the rendered viewport, we can't determine a position\n if (lineStart < view.viewport.from)\n return view.viewport.from == 0 ? 0 : precise ? null : posAtCoordsImprecise(view, content, block, x, y);\n if (lineStart > view.viewport.to)\n return view.viewport.to == view.state.doc.length ? view.state.doc.length :\n precise ? null : posAtCoordsImprecise(view, content, block, x, y);\n // Prefer ShadowRootOrDocument.elementFromPoint if present, fall back to document if not\n let doc = view.dom.ownerDocument;\n let root = view.root.elementFromPoint ? view.root : doc;\n let element = root.elementFromPoint(x, y);\n if (element && !view.contentDOM.contains(element))\n element = null;\n // If the element is unexpected, clip x at the sides of the content area and try again\n if (!element) {\n x = Math.max(content.left + 1, Math.min(content.right - 1, x));\n element = root.elementFromPoint(x, y);\n if (element && !view.contentDOM.contains(element))\n element = null;\n }\n // There's visible editor content under the point, so we can try\n // using caret(Position|Range)FromPoint as a shortcut\n let node, offset = -1;\n if (element && ((_a = view.docView.nearest(element)) === null || _a === void 0 ? void 0 : _a.isEditable) != false) {\n if (doc.caretPositionFromPoint) {\n let pos = doc.caretPositionFromPoint(x, y);\n if (pos)\n ({ offsetNode: node, offset } = pos);\n }\n else if (doc.caretRangeFromPoint) {\n let range = doc.caretRangeFromPoint(x, y);\n if (range) {\n ({ startContainer: node, startOffset: offset } = range);\n if (!view.contentDOM.contains(node) ||\n browser.safari && isSuspiciousSafariCaretResult(node, offset, x) ||\n browser.chrome && isSuspiciousChromeCaretResult(node, offset, x))\n node = undefined;\n }\n }\n }\n // No luck, do our own (potentially expensive) search\n if (!node || !view.docView.dom.contains(node)) {\n let line = LineView.find(view.docView, lineStart);\n if (!line)\n return yOffset > block.top + block.height / 2 ? block.to : block.from;\n ({ node, offset } = domPosAtCoords(line.dom, x, y));\n }\n let nearest = view.docView.nearest(node);\n if (!nearest)\n return null;\n if (nearest.isWidget && ((_b = nearest.dom) === null || _b === void 0 ? void 0 : _b.nodeType) == 1) {\n let rect = nearest.dom.getBoundingClientRect();\n return coords.y < rect.top || coords.y <= rect.bottom && coords.x <= (rect.left + rect.right) / 2\n ? nearest.posAtStart : nearest.posAtEnd;\n }\n else {\n return nearest.localPosFromDOM(node, offset) + nearest.posAtStart;\n }\n }\n function posAtCoordsImprecise(view, contentRect, block, x, y) {\n let into = Math.round((x - contentRect.left) * view.defaultCharacterWidth);\n if (view.lineWrapping && block.height > view.defaultLineHeight * 1.5) {\n let textHeight = view.viewState.heightOracle.textHeight;\n let line = Math.floor((y - block.top - (view.defaultLineHeight - textHeight) * 0.5) / textHeight);\n into += line * view.viewState.heightOracle.lineLength;\n }\n let content = view.state.sliceDoc(block.from, block.to);\n return block.from + findColumn(content, into, view.state.tabSize);\n }\n // In case of a high line height, Safari's caretRangeFromPoint treats\n // the space between lines as belonging to the last character of the\n // line before. This is used to detect such a result so that it can be\n // ignored (issue #401).\n function isSuspiciousSafariCaretResult(node, offset, x) {\n let len;\n if (node.nodeType != 3 || offset != (len = node.nodeValue.length))\n return false;\n for (let next = node.nextSibling; next; next = next.nextSibling)\n if (next.nodeType != 1 || next.nodeName != \"BR\")\n return false;\n return textRange(node, len - 1, len).getBoundingClientRect().left > x;\n }\n // Chrome will move positions between lines to the start of the next line\n function isSuspiciousChromeCaretResult(node, offset, x) {\n if (offset != 0)\n return false;\n for (let cur = node;;) {\n let parent = cur.parentNode;\n if (!parent || parent.nodeType != 1 || parent.firstChild != cur)\n return false;\n if (parent.classList.contains(\"cm-line\"))\n break;\n cur = parent;\n }\n let rect = node.nodeType == 1 ? node.getBoundingClientRect()\n : textRange(node, 0, Math.max(node.nodeValue.length, 1)).getBoundingClientRect();\n return x - rect.left > 5;\n }\n function blockAt(view, pos) {\n let line = view.lineBlockAt(pos);\n if (Array.isArray(line.type))\n for (let l of line.type) {\n if (l.to > pos || l.to == pos && (l.to == line.to || l.type == BlockType.Text))\n return l;\n }\n return line;\n }\n function moveToLineBoundary(view, start, forward, includeWrap) {\n let line = blockAt(view, start.head);\n let coords = !includeWrap || line.type != BlockType.Text || !(view.lineWrapping || line.widgetLineBreaks) ? null\n : view.coordsAtPos(start.assoc < 0 && start.head > line.from ? start.head - 1 : start.head);\n if (coords) {\n let editorRect = view.dom.getBoundingClientRect();\n let direction = view.textDirectionAt(line.from);\n let pos = view.posAtCoords({ x: forward == (direction == Direction.LTR) ? editorRect.right - 1 : editorRect.left + 1,\n y: (coords.top + coords.bottom) / 2 });\n if (pos != null)\n return EditorSelection.cursor(pos, forward ? -1 : 1);\n }\n return EditorSelection.cursor(forward ? line.to : line.from, forward ? -1 : 1);\n }\n function moveByChar(view, start, forward, by) {\n let line = view.state.doc.lineAt(start.head), spans = view.bidiSpans(line);\n let direction = view.textDirectionAt(line.from);\n for (let cur = start, check = null;;) {\n let next = moveVisually(line, spans, direction, cur, forward), char = movedOver;\n if (!next) {\n if (line.number == (forward ? view.state.doc.lines : 1))\n return cur;\n char = \"\\n\";\n line = view.state.doc.line(line.number + (forward ? 1 : -1));\n spans = view.bidiSpans(line);\n next = view.visualLineSide(line, !forward);\n }\n if (!check) {\n if (!by)\n return next;\n check = by(char);\n }\n else if (!check(char)) {\n return cur;\n }\n cur = next;\n }\n }\n function byGroup(view, pos, start) {\n let categorize = view.state.charCategorizer(pos);\n let cat = categorize(start);\n return (next) => {\n let nextCat = categorize(next);\n if (cat == CharCategory.Space)\n cat = nextCat;\n return cat == nextCat;\n };\n }\n function moveVertically(view, start, forward, distance) {\n let startPos = start.head, dir = forward ? 1 : -1;\n if (startPos == (forward ? view.state.doc.length : 0))\n return EditorSelection.cursor(startPos, start.assoc);\n let goal = start.goalColumn, startY;\n let rect = view.contentDOM.getBoundingClientRect();\n let startCoords = view.coordsAtPos(startPos, start.assoc || -1), docTop = view.documentTop;\n if (startCoords) {\n if (goal == null)\n goal = startCoords.left - rect.left;\n startY = dir < 0 ? startCoords.top : startCoords.bottom;\n }\n else {\n let line = view.viewState.lineBlockAt(startPos);\n if (goal == null)\n goal = Math.min(rect.right - rect.left, view.defaultCharacterWidth * (startPos - line.from));\n startY = (dir < 0 ? line.top : line.bottom) + docTop;\n }\n let resolvedGoal = rect.left + goal;\n let dist = distance !== null && distance !== void 0 ? distance : (view.viewState.heightOracle.textHeight >> 1);\n for (let extra = 0;; extra += 10) {\n let curY = startY + (dist + extra) * dir;\n let pos = posAtCoords(view, { x: resolvedGoal, y: curY }, false, dir);\n if (curY < rect.top || curY > rect.bottom || (dir < 0 ? pos < startPos : pos > startPos)) {\n let charRect = view.docView.coordsForChar(pos);\n let assoc = !charRect || curY < charRect.top ? -1 : 1;\n return EditorSelection.cursor(pos, assoc, undefined, goal);\n }\n }\n }\n function skipAtomicRanges(atoms, pos, bias) {\n for (;;) {\n let moved = 0;\n for (let set of atoms) {\n set.between(pos - 1, pos + 1, (from, to, value) => {\n if (pos > from && pos < to) {\n let side = moved || bias || (pos - from < to - pos ? -1 : 1);\n pos = side < 0 ? from : to;\n moved = side;\n }\n });\n }\n if (!moved)\n return pos;\n }\n }\n function skipAtoms(view, oldPos, pos) {\n let newPos = skipAtomicRanges(view.state.facet(atomicRanges).map(f => f(view)), pos.from, oldPos.head > pos.from ? -1 : 1);\n return newPos == pos.from ? pos : EditorSelection.cursor(newPos, newPos < pos.from ? 1 : -1);\n }\n\n // This will also be where dragging info and such goes\n class InputState {\n setSelectionOrigin(origin) {\n this.lastSelectionOrigin = origin;\n this.lastSelectionTime = Date.now();\n }\n constructor(view) {\n this.view = view;\n this.lastKeyCode = 0;\n this.lastKeyTime = 0;\n this.lastTouchTime = 0;\n this.lastFocusTime = 0;\n this.lastScrollTop = 0;\n this.lastScrollLeft = 0;\n // On iOS, some keys need to have their default behavior happen\n // (after which we retroactively handle them and reset the DOM) to\n // avoid messing up the virtual keyboard state.\n this.pendingIOSKey = undefined;\n /**\n When enabled (>-1), tab presses are not given to key handlers,\n leaving the browser's default behavior. If >0, the mode expires\n at that timestamp, and any other keypress clears it.\n Esc enables temporary tab focus mode for two seconds when not\n otherwise handled.\n */\n this.tabFocusMode = -1;\n this.lastSelectionOrigin = null;\n this.lastSelectionTime = 0;\n this.lastContextMenu = 0;\n this.scrollHandlers = [];\n this.handlers = Object.create(null);\n // -1 means not in a composition. Otherwise, this counts the number\n // of changes made during the composition. The count is used to\n // avoid treating the start state of the composition, before any\n // changes have been made, as part of the composition.\n this.composing = -1;\n // Tracks whether the next change should be marked as starting the\n // composition (null means no composition, true means next is the\n // first, false means first has already been marked for this\n // composition)\n this.compositionFirstChange = null;\n // End time of the previous composition\n this.compositionEndedAt = 0;\n // Used in a kludge to detect when an Enter keypress should be\n // considered part of the composition on Safari, which fires events\n // in the wrong order\n this.compositionPendingKey = false;\n // Used to categorize changes as part of a composition, even when\n // the mutation events fire shortly after the compositionend event\n this.compositionPendingChange = false;\n this.mouseSelection = null;\n // When a drag from the editor is active, this points at the range\n // being dragged.\n this.draggedContent = null;\n this.handleEvent = this.handleEvent.bind(this);\n this.notifiedFocused = view.hasFocus;\n // On Safari adding an input event handler somehow prevents an\n // issue where the composition vanishes when you press enter.\n if (browser.safari)\n view.contentDOM.addEventListener(\"input\", () => null);\n if (browser.gecko)\n firefoxCopyCutHack(view.contentDOM.ownerDocument);\n }\n handleEvent(event) {\n if (!eventBelongsToEditor(this.view, event) || this.ignoreDuringComposition(event))\n return;\n if (event.type == \"keydown\" && this.keydown(event))\n return;\n this.runHandlers(event.type, event);\n }\n runHandlers(type, event) {\n let handlers = this.handlers[type];\n if (handlers) {\n for (let observer of handlers.observers)\n observer(this.view, event);\n for (let handler of handlers.handlers) {\n if (event.defaultPrevented)\n break;\n if (handler(this.view, event)) {\n event.preventDefault();\n break;\n }\n }\n }\n }\n ensureHandlers(plugins) {\n let handlers = computeHandlers(plugins), prev = this.handlers, dom = this.view.contentDOM;\n for (let type in handlers)\n if (type != \"scroll\") {\n let passive = !handlers[type].handlers.length;\n let exists = prev[type];\n if (exists && passive != !exists.handlers.length) {\n dom.removeEventListener(type, this.handleEvent);\n exists = null;\n }\n if (!exists)\n dom.addEventListener(type, this.handleEvent, { passive });\n }\n for (let type in prev)\n if (type != \"scroll\" && !handlers[type])\n dom.removeEventListener(type, this.handleEvent);\n this.handlers = handlers;\n }\n keydown(event) {\n // Must always run, even if a custom handler handled the event\n this.lastKeyCode = event.keyCode;\n this.lastKeyTime = Date.now();\n if (event.keyCode == 9 && this.tabFocusMode > -1 && (!this.tabFocusMode || Date.now() <= this.tabFocusMode))\n return true;\n if (this.tabFocusMode > 0 && event.keyCode != 27 && modifierCodes.indexOf(event.keyCode) < 0)\n this.tabFocusMode = -1;\n // Chrome for Android usually doesn't fire proper key events, but\n // occasionally does, usually surrounded by a bunch of complicated\n // composition changes. When an enter or backspace key event is\n // seen, hold off on handling DOM events for a bit, and then\n // dispatch it.\n if (browser.android && browser.chrome && !event.synthetic &&\n (event.keyCode == 13 || event.keyCode == 8)) {\n this.view.observer.delayAndroidKey(event.key, event.keyCode);\n return true;\n }\n // Preventing the default behavior of Enter on iOS makes the\n // virtual keyboard get stuck in the wrong (lowercase)\n // state. So we let it go through, and then, in\n // applyDOMChange, notify key handlers of it and reset to\n // the state they produce.\n let pending;\n if (browser.ios && !event.synthetic && !event.altKey && !event.metaKey &&\n ((pending = PendingKeys.find(key => key.keyCode == event.keyCode)) && !event.ctrlKey ||\n EmacsyPendingKeys.indexOf(event.key) > -1 && event.ctrlKey && !event.shiftKey)) {\n this.pendingIOSKey = pending || event;\n setTimeout(() => this.flushIOSKey(), 250);\n return true;\n }\n if (event.keyCode != 229)\n this.view.observer.forceFlush();\n return false;\n }\n flushIOSKey(change) {\n let key = this.pendingIOSKey;\n if (!key)\n return false;\n // This looks like an autocorrection before Enter\n if (key.key == \"Enter\" && change && change.from < change.to && /^\\S+$/.test(change.insert.toString()))\n return false;\n this.pendingIOSKey = undefined;\n return dispatchKey(this.view.contentDOM, key.key, key.keyCode, key instanceof KeyboardEvent ? key : undefined);\n }\n ignoreDuringComposition(event) {\n if (!/^key/.test(event.type))\n return false;\n if (this.composing > 0)\n return true;\n // See https://www.stum.de/2016/06/24/handling-ime-events-in-javascript/.\n // On some input method editors (IMEs), the Enter key is used to\n // confirm character selection. On Safari, when Enter is pressed,\n // compositionend and keydown events are sometimes emitted in the\n // wrong order. The key event should still be ignored, even when\n // it happens after the compositionend event.\n if (browser.safari && !browser.ios && this.compositionPendingKey && Date.now() - this.compositionEndedAt < 100) {\n this.compositionPendingKey = false;\n return true;\n }\n return false;\n }\n startMouseSelection(mouseSelection) {\n if (this.mouseSelection)\n this.mouseSelection.destroy();\n this.mouseSelection = mouseSelection;\n }\n update(update) {\n this.view.observer.update(update);\n if (this.mouseSelection)\n this.mouseSelection.update(update);\n if (this.draggedContent && update.docChanged)\n this.draggedContent = this.draggedContent.map(update.changes);\n if (update.transactions.length)\n this.lastKeyCode = this.lastSelectionTime = 0;\n }\n destroy() {\n if (this.mouseSelection)\n this.mouseSelection.destroy();\n }\n }\n function bindHandler(plugin, handler) {\n return (view, event) => {\n try {\n return handler.call(plugin, event, view);\n }\n catch (e) {\n logException(view.state, e);\n }\n };\n }\n function computeHandlers(plugins) {\n let result = Object.create(null);\n function record(type) {\n return result[type] || (result[type] = { observers: [], handlers: [] });\n }\n for (let plugin of plugins) {\n let spec = plugin.spec;\n if (spec && spec.domEventHandlers)\n for (let type in spec.domEventHandlers) {\n let f = spec.domEventHandlers[type];\n if (f)\n record(type).handlers.push(bindHandler(plugin.value, f));\n }\n if (spec && spec.domEventObservers)\n for (let type in spec.domEventObservers) {\n let f = spec.domEventObservers[type];\n if (f)\n record(type).observers.push(bindHandler(plugin.value, f));\n }\n }\n for (let type in handlers)\n record(type).handlers.push(handlers[type]);\n for (let type in observers)\n record(type).observers.push(observers[type]);\n return result;\n }\n const PendingKeys = [\n { key: \"Backspace\", keyCode: 8, inputType: \"deleteContentBackward\" },\n { key: \"Enter\", keyCode: 13, inputType: \"insertParagraph\" },\n { key: \"Enter\", keyCode: 13, inputType: \"insertLineBreak\" },\n { key: \"Delete\", keyCode: 46, inputType: \"deleteContentForward\" }\n ];\n const EmacsyPendingKeys = \"dthko\";\n // Key codes for modifier keys\n const modifierCodes = [16, 17, 18, 20, 91, 92, 224, 225];\n const dragScrollMargin = 6;\n function dragScrollSpeed(dist) {\n return Math.max(0, dist) * 0.7 + 8;\n }\n function dist(a, b) {\n return Math.max(Math.abs(a.clientX - b.clientX), Math.abs(a.clientY - b.clientY));\n }\n class MouseSelection {\n constructor(view, startEvent, style, mustSelect) {\n this.view = view;\n this.startEvent = startEvent;\n this.style = style;\n this.mustSelect = mustSelect;\n this.scrollSpeed = { x: 0, y: 0 };\n this.scrolling = -1;\n this.lastEvent = startEvent;\n this.scrollParents = scrollableParents(view.contentDOM);\n this.atoms = view.state.facet(atomicRanges).map(f => f(view));\n let doc = view.contentDOM.ownerDocument;\n doc.addEventListener(\"mousemove\", this.move = this.move.bind(this));\n doc.addEventListener(\"mouseup\", this.up = this.up.bind(this));\n this.extend = startEvent.shiftKey;\n this.multiple = view.state.facet(EditorState.allowMultipleSelections) && addsSelectionRange(view, startEvent);\n this.dragging = isInPrimarySelection(view, startEvent) && getClickType(startEvent) == 1 ? null : false;\n }\n start(event) {\n // When clicking outside of the selection, immediately apply the\n // effect of starting the selection\n if (this.dragging === false)\n this.select(event);\n }\n move(event) {\n if (event.buttons == 0)\n return this.destroy();\n if (this.dragging || this.dragging == null && dist(this.startEvent, event) < 10)\n return;\n this.select(this.lastEvent = event);\n let sx = 0, sy = 0;\n let left = 0, top = 0, right = this.view.win.innerWidth, bottom = this.view.win.innerHeight;\n if (this.scrollParents.x)\n ({ left, right } = this.scrollParents.x.getBoundingClientRect());\n if (this.scrollParents.y)\n ({ top, bottom } = this.scrollParents.y.getBoundingClientRect());\n let margins = getScrollMargins(this.view);\n if (event.clientX - margins.left <= left + dragScrollMargin)\n sx = -dragScrollSpeed(left - event.clientX);\n else if (event.clientX + margins.right >= right - dragScrollMargin)\n sx = dragScrollSpeed(event.clientX - right);\n if (event.clientY - margins.top <= top + dragScrollMargin)\n sy = -dragScrollSpeed(top - event.clientY);\n else if (event.clientY + margins.bottom >= bottom - dragScrollMargin)\n sy = dragScrollSpeed(event.clientY - bottom);\n this.setScrollSpeed(sx, sy);\n }\n up(event) {\n if (this.dragging == null)\n this.select(this.lastEvent);\n if (!this.dragging)\n event.preventDefault();\n this.destroy();\n }\n destroy() {\n this.setScrollSpeed(0, 0);\n let doc = this.view.contentDOM.ownerDocument;\n doc.removeEventListener(\"mousemove\", this.move);\n doc.removeEventListener(\"mouseup\", this.up);\n this.view.inputState.mouseSelection = this.view.inputState.draggedContent = null;\n }\n setScrollSpeed(sx, sy) {\n this.scrollSpeed = { x: sx, y: sy };\n if (sx || sy) {\n if (this.scrolling < 0)\n this.scrolling = setInterval(() => this.scroll(), 50);\n }\n else if (this.scrolling > -1) {\n clearInterval(this.scrolling);\n this.scrolling = -1;\n }\n }\n scroll() {\n let { x, y } = this.scrollSpeed;\n if (x && this.scrollParents.x) {\n this.scrollParents.x.scrollLeft += x;\n x = 0;\n }\n if (y && this.scrollParents.y) {\n this.scrollParents.y.scrollTop += y;\n y = 0;\n }\n if (x || y)\n this.view.win.scrollBy(x, y);\n if (this.dragging === false)\n this.select(this.lastEvent);\n }\n skipAtoms(sel) {\n let ranges = null;\n for (let i = 0; i < sel.ranges.length; i++) {\n let range = sel.ranges[i], updated = null;\n if (range.empty) {\n let pos = skipAtomicRanges(this.atoms, range.from, 0);\n if (pos != range.from)\n updated = EditorSelection.cursor(pos, -1);\n }\n else {\n let from = skipAtomicRanges(this.atoms, range.from, -1);\n let to = skipAtomicRanges(this.atoms, range.to, 1);\n if (from != range.from || to != range.to)\n updated = EditorSelection.range(range.from == range.anchor ? from : to, range.from == range.head ? from : to);\n }\n if (updated) {\n if (!ranges)\n ranges = sel.ranges.slice();\n ranges[i] = updated;\n }\n }\n return ranges ? EditorSelection.create(ranges, sel.mainIndex) : sel;\n }\n select(event) {\n let { view } = this, selection = this.skipAtoms(this.style.get(event, this.extend, this.multiple));\n if (this.mustSelect || !selection.eq(view.state.selection, this.dragging === false))\n this.view.dispatch({\n selection,\n userEvent: \"select.pointer\"\n });\n this.mustSelect = false;\n }\n update(update) {\n if (update.transactions.some(tr => tr.isUserEvent(\"input.type\")))\n this.destroy();\n else if (this.style.update(update))\n setTimeout(() => this.select(this.lastEvent), 20);\n }\n }\n function addsSelectionRange(view, event) {\n let facet = view.state.facet(clickAddsSelectionRange);\n return facet.length ? facet[0](event) : browser.mac ? event.metaKey : event.ctrlKey;\n }\n function dragMovesSelection(view, event) {\n let facet = view.state.facet(dragMovesSelection$1);\n return facet.length ? facet[0](event) : browser.mac ? !event.altKey : !event.ctrlKey;\n }\n function isInPrimarySelection(view, event) {\n let { main } = view.state.selection;\n if (main.empty)\n return false;\n // On boundary clicks, check whether the coordinates are inside the\n // selection's client rectangles\n let sel = getSelection(view.root);\n if (!sel || sel.rangeCount == 0)\n return true;\n let rects = sel.getRangeAt(0).getClientRects();\n for (let i = 0; i < rects.length; i++) {\n let rect = rects[i];\n if (rect.left <= event.clientX && rect.right >= event.clientX &&\n rect.top <= event.clientY && rect.bottom >= event.clientY)\n return true;\n }\n return false;\n }\n function eventBelongsToEditor(view, event) {\n if (!event.bubbles)\n return true;\n if (event.defaultPrevented)\n return false;\n for (let node = event.target, cView; node != view.contentDOM; node = node.parentNode)\n if (!node || node.nodeType == 11 || ((cView = ContentView.get(node)) && cView.ignoreEvent(event)))\n return false;\n return true;\n }\n const handlers = /*@__PURE__*/Object.create(null);\n const observers = /*@__PURE__*/Object.create(null);\n // This is very crude, but unfortunately both these browsers _pretend_\n // that they have a clipboard API\u2014all the objects and methods are\n // there, they just don't work, and they are hard to test.\n const brokenClipboardAPI = (browser.ie && browser.ie_version < 15) ||\n (browser.ios && browser.webkit_version < 604);\n function capturePaste(view) {\n let parent = view.dom.parentNode;\n if (!parent)\n return;\n let target = parent.appendChild(document.createElement(\"textarea\"));\n target.style.cssText = \"position: fixed; left: -10000px; top: 10px\";\n target.focus();\n setTimeout(() => {\n view.focus();\n target.remove();\n doPaste(view, target.value);\n }, 50);\n }\n function doPaste(view, input) {\n let { state } = view, changes, i = 1, text = state.toText(input);\n let byLine = text.lines == state.selection.ranges.length;\n let linewise = lastLinewiseCopy != null && state.selection.ranges.every(r => r.empty) && lastLinewiseCopy == text.toString();\n if (linewise) {\n let lastLine = -1;\n changes = state.changeByRange(range => {\n let line = state.doc.lineAt(range.from);\n if (line.from == lastLine)\n return { range };\n lastLine = line.from;\n let insert = state.toText((byLine ? text.line(i++).text : input) + state.lineBreak);\n return { changes: { from: line.from, insert },\n range: EditorSelection.cursor(range.from + insert.length) };\n });\n }\n else if (byLine) {\n changes = state.changeByRange(range => {\n let line = text.line(i++);\n return { changes: { from: range.from, to: range.to, insert: line.text },\n range: EditorSelection.cursor(range.from + line.length) };\n });\n }\n else {\n changes = state.replaceSelection(text);\n }\n view.dispatch(changes, {\n userEvent: \"input.paste\",\n scrollIntoView: true\n });\n }\n observers.scroll = view => {\n view.inputState.lastScrollTop = view.scrollDOM.scrollTop;\n view.inputState.lastScrollLeft = view.scrollDOM.scrollLeft;\n };\n handlers.keydown = (view, event) => {\n view.inputState.setSelectionOrigin(\"select\");\n if (event.keyCode == 27 && view.inputState.tabFocusMode != 0)\n view.inputState.tabFocusMode = Date.now() + 2000;\n return false;\n };\n observers.touchstart = (view, e) => {\n view.inputState.lastTouchTime = Date.now();\n view.inputState.setSelectionOrigin(\"select.pointer\");\n };\n observers.touchmove = view => {\n view.inputState.setSelectionOrigin(\"select.pointer\");\n };\n handlers.mousedown = (view, event) => {\n view.observer.flush();\n if (view.inputState.lastTouchTime > Date.now() - 2000)\n return false; // Ignore touch interaction\n let style = null;\n for (let makeStyle of view.state.facet(mouseSelectionStyle)) {\n style = makeStyle(view, event);\n if (style)\n break;\n }\n if (!style && event.button == 0)\n style = basicMouseSelection(view, event);\n if (style) {\n let mustFocus = !view.hasFocus;\n view.inputState.startMouseSelection(new MouseSelection(view, event, style, mustFocus));\n if (mustFocus)\n view.observer.ignore(() => {\n focusPreventScroll(view.contentDOM);\n let active = view.root.activeElement;\n if (active && !active.contains(view.contentDOM))\n active.blur();\n });\n let mouseSel = view.inputState.mouseSelection;\n if (mouseSel) {\n mouseSel.start(event);\n return mouseSel.dragging === false;\n }\n }\n return false;\n };\n function rangeForClick(view, pos, bias, type) {\n if (type == 1) { // Single click\n return EditorSelection.cursor(pos, bias);\n }\n else if (type == 2) { // Double click\n return groupAt(view.state, pos, bias);\n }\n else { // Triple click\n let visual = LineView.find(view.docView, pos), line = view.state.doc.lineAt(visual ? visual.posAtEnd : pos);\n let from = visual ? visual.posAtStart : line.from, to = visual ? visual.posAtEnd : line.to;\n if (to < view.state.doc.length && to == line.to)\n to++;\n return EditorSelection.range(from, to);\n }\n }\n let inside = (x, y, rect) => y >= rect.top && y <= rect.bottom && x >= rect.left && x <= rect.right;\n // Try to determine, for the given coordinates, associated with the\n // given position, whether they are related to the element before or\n // the element after the position.\n function findPositionSide(view, pos, x, y) {\n let line = LineView.find(view.docView, pos);\n if (!line)\n return 1;\n let off = pos - line.posAtStart;\n // Line boundaries point into the line\n if (off == 0)\n return 1;\n if (off == line.length)\n return -1;\n // Positions on top of an element point at that element\n let before = line.coordsAt(off, -1);\n if (before && inside(x, y, before))\n return -1;\n let after = line.coordsAt(off, 1);\n if (after && inside(x, y, after))\n return 1;\n // This is probably a line wrap point. Pick before if the point is\n // above its bottom.\n return before && before.bottom >= y ? -1 : 1;\n }\n function queryPos(view, event) {\n let pos = view.posAtCoords({ x: event.clientX, y: event.clientY }, false);\n return { pos, bias: findPositionSide(view, pos, event.clientX, event.clientY) };\n }\n const BadMouseDetail = browser.ie && browser.ie_version <= 11;\n let lastMouseDown = null, lastMouseDownCount = 0, lastMouseDownTime = 0;\n function getClickType(event) {\n if (!BadMouseDetail)\n return event.detail;\n let last = lastMouseDown, lastTime = lastMouseDownTime;\n lastMouseDown = event;\n lastMouseDownTime = Date.now();\n return lastMouseDownCount = !last || (lastTime > Date.now() - 400 && Math.abs(last.clientX - event.clientX) < 2 &&\n Math.abs(last.clientY - event.clientY) < 2) ? (lastMouseDownCount + 1) % 3 : 1;\n }\n function basicMouseSelection(view, event) {\n let start = queryPos(view, event), type = getClickType(event);\n let startSel = view.state.selection;\n return {\n update(update) {\n if (update.docChanged) {\n start.pos = update.changes.mapPos(start.pos);\n startSel = startSel.map(update.changes);\n }\n },\n get(event, extend, multiple) {\n let cur = queryPos(view, event), removed;\n let range = rangeForClick(view, cur.pos, cur.bias, type);\n if (start.pos != cur.pos && !extend) {\n let startRange = rangeForClick(view, start.pos, start.bias, type);\n let from = Math.min(startRange.from, range.from), to = Math.max(startRange.to, range.to);\n range = from < range.from ? EditorSelection.range(from, to) : EditorSelection.range(to, from);\n }\n if (extend)\n return startSel.replaceRange(startSel.main.extend(range.from, range.to));\n else if (multiple && type == 1 && startSel.ranges.length > 1 && (removed = removeRangeAround(startSel, cur.pos)))\n return removed;\n else if (multiple)\n return startSel.addRange(range);\n else\n return EditorSelection.create([range]);\n }\n };\n }\n function removeRangeAround(sel, pos) {\n for (let i = 0; i < sel.ranges.length; i++) {\n let { from, to } = sel.ranges[i];\n if (from <= pos && to >= pos)\n return EditorSelection.create(sel.ranges.slice(0, i).concat(sel.ranges.slice(i + 1)), sel.mainIndex == i ? 0 : sel.mainIndex - (sel.mainIndex > i ? 1 : 0));\n }\n return null;\n }\n handlers.dragstart = (view, event) => {\n let { selection: { main: range } } = view.state;\n if (event.target.draggable) {\n let cView = view.docView.nearest(event.target);\n if (cView && cView.isWidget) {\n let from = cView.posAtStart, to = from + cView.length;\n if (from >= range.to || to <= range.from)\n range = EditorSelection.range(from, to);\n }\n }\n let { inputState } = view;\n if (inputState.mouseSelection)\n inputState.mouseSelection.dragging = true;\n inputState.draggedContent = range;\n if (event.dataTransfer) {\n event.dataTransfer.setData(\"Text\", view.state.sliceDoc(range.from, range.to));\n event.dataTransfer.effectAllowed = \"copyMove\";\n }\n return false;\n };\n handlers.dragend = view => {\n view.inputState.draggedContent = null;\n return false;\n };\n function dropText(view, event, text, direct) {\n if (!text)\n return;\n let dropPos = view.posAtCoords({ x: event.clientX, y: event.clientY }, false);\n let { draggedContent } = view.inputState;\n let del = direct && draggedContent && dragMovesSelection(view, event)\n ? { from: draggedContent.from, to: draggedContent.to } : null;\n let ins = { from: dropPos, insert: text };\n let changes = view.state.changes(del ? [del, ins] : ins);\n view.focus();\n view.dispatch({\n changes,\n selection: { anchor: changes.mapPos(dropPos, -1), head: changes.mapPos(dropPos, 1) },\n userEvent: del ? \"move.drop\" : \"input.drop\"\n });\n view.inputState.draggedContent = null;\n }\n handlers.drop = (view, event) => {\n if (!event.dataTransfer)\n return false;\n if (view.state.readOnly)\n return true;\n let files = event.dataTransfer.files;\n if (files && files.length) { // For a file drop, read the file's text.\n let text = Array(files.length), read = 0;\n let finishFile = () => {\n if (++read == files.length)\n dropText(view, event, text.filter(s => s != null).join(view.state.lineBreak), false);\n };\n for (let i = 0; i < files.length; i++) {\n let reader = new FileReader;\n reader.onerror = finishFile;\n reader.onload = () => {\n if (!/[\\x00-\\x08\\x0e-\\x1f]{2}/.test(reader.result))\n text[i] = reader.result;\n finishFile();\n };\n reader.readAsText(files[i]);\n }\n return true;\n }\n else {\n let text = event.dataTransfer.getData(\"Text\");\n if (text) {\n dropText(view, event, text, true);\n return true;\n }\n }\n return false;\n };\n handlers.paste = (view, event) => {\n if (view.state.readOnly)\n return true;\n view.observer.flush();\n let data = brokenClipboardAPI ? null : event.clipboardData;\n if (data) {\n doPaste(view, data.getData(\"text/plain\") || data.getData(\"text/uri-list\"));\n return true;\n }\n else {\n capturePaste(view);\n return false;\n }\n };\n function captureCopy(view, text) {\n // The extra wrapper is somehow necessary on IE/Edge to prevent the\n // content from being mangled when it is put onto the clipboard\n let parent = view.dom.parentNode;\n if (!parent)\n return;\n let target = parent.appendChild(document.createElement(\"textarea\"));\n target.style.cssText = \"position: fixed; left: -10000px; top: 10px\";\n target.value = text;\n target.focus();\n target.selectionEnd = text.length;\n target.selectionStart = 0;\n setTimeout(() => {\n target.remove();\n view.focus();\n }, 50);\n }\n function copiedRange(state) {\n let content = [], ranges = [], linewise = false;\n for (let range of state.selection.ranges)\n if (!range.empty) {\n content.push(state.sliceDoc(range.from, range.to));\n ranges.push(range);\n }\n if (!content.length) {\n // Nothing selected, do a line-wise copy\n let upto = -1;\n for (let { from } of state.selection.ranges) {\n let line = state.doc.lineAt(from);\n if (line.number > upto) {\n content.push(line.text);\n ranges.push({ from: line.from, to: Math.min(state.doc.length, line.to + 1) });\n }\n upto = line.number;\n }\n linewise = true;\n }\n return { text: content.join(state.lineBreak), ranges, linewise };\n }\n let lastLinewiseCopy = null;\n handlers.copy = handlers.cut = (view, event) => {\n let { text, ranges, linewise } = copiedRange(view.state);\n if (!text && !linewise)\n return false;\n lastLinewiseCopy = linewise ? text : null;\n if (event.type == \"cut\" && !view.state.readOnly)\n view.dispatch({\n changes: ranges,\n scrollIntoView: true,\n userEvent: \"delete.cut\"\n });\n let data = brokenClipboardAPI ? null : event.clipboardData;\n if (data) {\n data.clearData();\n data.setData(\"text/plain\", text);\n return true;\n }\n else {\n captureCopy(view, text);\n return false;\n }\n };\n const isFocusChange = /*@__PURE__*/Annotation.define();\n function focusChangeTransaction(state, focus) {\n let effects = [];\n for (let getEffect of state.facet(focusChangeEffect)) {\n let effect = getEffect(state, focus);\n if (effect)\n effects.push(effect);\n }\n return effects ? state.update({ effects, annotations: isFocusChange.of(true) }) : null;\n }\n function updateForFocusChange(view) {\n setTimeout(() => {\n let focus = view.hasFocus;\n if (focus != view.inputState.notifiedFocused) {\n let tr = focusChangeTransaction(view.state, focus);\n if (tr)\n view.dispatch(tr);\n else\n view.update([]);\n }\n }, 10);\n }\n observers.focus = view => {\n view.inputState.lastFocusTime = Date.now();\n // When focusing reset the scroll position, move it back to where it was\n if (!view.scrollDOM.scrollTop && (view.inputState.lastScrollTop || view.inputState.lastScrollLeft)) {\n view.scrollDOM.scrollTop = view.inputState.lastScrollTop;\n view.scrollDOM.scrollLeft = view.inputState.lastScrollLeft;\n }\n updateForFocusChange(view);\n };\n observers.blur = view => {\n view.observer.clearSelectionRange();\n updateForFocusChange(view);\n };\n observers.compositionstart = observers.compositionupdate = view => {\n if (view.observer.editContext)\n return; // Composition handled by edit context\n if (view.inputState.compositionFirstChange == null)\n view.inputState.compositionFirstChange = true;\n if (view.inputState.composing < 0) {\n // FIXME possibly set a timeout to clear it again on Android\n view.inputState.composing = 0;\n }\n };\n observers.compositionend = view => {\n if (view.observer.editContext)\n return; // Composition handled by edit context\n view.inputState.composing = -1;\n view.inputState.compositionEndedAt = Date.now();\n view.inputState.compositionPendingKey = true;\n view.inputState.compositionPendingChange = view.observer.pendingRecords().length > 0;\n view.inputState.compositionFirstChange = null;\n if (browser.chrome && browser.android) {\n // Delay flushing for a bit on Android because it'll often fire a\n // bunch of contradictory changes in a row at end of compositon\n view.observer.flushSoon();\n }\n else if (view.inputState.compositionPendingChange) {\n // If we found pending records, schedule a flush.\n Promise.resolve().then(() => view.observer.flush());\n }\n else {\n // Otherwise, make sure that, if no changes come in soon, the\n // composition view is cleared.\n setTimeout(() => {\n if (view.inputState.composing < 0 && view.docView.hasComposition)\n view.update([]);\n }, 50);\n }\n };\n observers.contextmenu = view => {\n view.inputState.lastContextMenu = Date.now();\n };\n handlers.beforeinput = (view, event) => {\n var _a;\n // Because Chrome Android doesn't fire useful key events, use\n // beforeinput to detect backspace (and possibly enter and delete,\n // but those usually don't even seem to fire beforeinput events at\n // the moment) and fake a key event for it.\n //\n // (preventDefault on beforeinput, though supported in the spec,\n // seems to do nothing at all on Chrome).\n let pending;\n if (browser.chrome && browser.android && (pending = PendingKeys.find(key => key.inputType == event.inputType))) {\n view.observer.delayAndroidKey(pending.key, pending.keyCode);\n if (pending.key == \"Backspace\" || pending.key == \"Delete\") {\n let startViewHeight = ((_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.height) || 0;\n setTimeout(() => {\n var _a;\n // Backspacing near uneditable nodes on Chrome Android sometimes\n // closes the virtual keyboard. This tries to crudely detect\n // that and refocus to get it back.\n if ((((_a = window.visualViewport) === null || _a === void 0 ? void 0 : _a.height) || 0) > startViewHeight + 10 && view.hasFocus) {\n view.contentDOM.blur();\n view.focus();\n }\n }, 100);\n }\n }\n if (browser.ios && event.inputType == \"deleteContentForward\") {\n // For some reason, DOM changes (and beforeinput) happen _before_\n // the key event for ctrl-d on iOS when using an external\n // keyboard.\n view.observer.flushSoon();\n }\n // Safari will occasionally forget to fire compositionend at the end of a dead-key composition\n if (browser.safari && event.inputType == \"insertText\" && view.inputState.composing >= 0) {\n setTimeout(() => observers.compositionend(view, event), 20);\n }\n return false;\n };\n const appliedFirefoxHack = /*@__PURE__*/new Set;\n // In Firefox, when cut/copy handlers are added to the document, that\n // somehow avoids a bug where those events aren't fired when the\n // selection is empty. See https://github.com/codemirror/dev/issues/1082\n // and https://bugzilla.mozilla.org/show_bug.cgi?id=995961\n function firefoxCopyCutHack(doc) {\n if (!appliedFirefoxHack.has(doc)) {\n appliedFirefoxHack.add(doc);\n doc.addEventListener(\"copy\", () => { });\n doc.addEventListener(\"cut\", () => { });\n }\n }\n\n const wrappingWhiteSpace = [\"pre-wrap\", \"normal\", \"pre-line\", \"break-spaces\"];\n // Used to track, during updateHeight, if any actual heights changed\n let heightChangeFlag = false;\n function clearHeightChangeFlag() { heightChangeFlag = false; }\n class HeightOracle {\n constructor(lineWrapping) {\n this.lineWrapping = lineWrapping;\n this.doc = Text.empty;\n this.heightSamples = {};\n this.lineHeight = 14; // The height of an entire line (line-height)\n this.charWidth = 7;\n this.textHeight = 14; // The height of the actual font (font-size)\n this.lineLength = 30;\n }\n heightForGap(from, to) {\n let lines = this.doc.lineAt(to).number - this.doc.lineAt(from).number + 1;\n if (this.lineWrapping)\n lines += Math.max(0, Math.ceil(((to - from) - (lines * this.lineLength * 0.5)) / this.lineLength));\n return this.lineHeight * lines;\n }\n heightForLine(length) {\n if (!this.lineWrapping)\n return this.lineHeight;\n let lines = 1 + Math.max(0, Math.ceil((length - this.lineLength) / (this.lineLength - 5)));\n return lines * this.lineHeight;\n }\n setDoc(doc) { this.doc = doc; return this; }\n mustRefreshForWrapping(whiteSpace) {\n return (wrappingWhiteSpace.indexOf(whiteSpace) > -1) != this.lineWrapping;\n }\n mustRefreshForHeights(lineHeights) {\n let newHeight = false;\n for (let i = 0; i < lineHeights.length; i++) {\n let h = lineHeights[i];\n if (h < 0) {\n i++;\n }\n else if (!this.heightSamples[Math.floor(h * 10)]) { // Round to .1 pixels\n newHeight = true;\n this.heightSamples[Math.floor(h * 10)] = true;\n }\n }\n return newHeight;\n }\n refresh(whiteSpace, lineHeight, charWidth, textHeight, lineLength, knownHeights) {\n let lineWrapping = wrappingWhiteSpace.indexOf(whiteSpace) > -1;\n let changed = Math.round(lineHeight) != Math.round(this.lineHeight) || this.lineWrapping != lineWrapping;\n this.lineWrapping = lineWrapping;\n this.lineHeight = lineHeight;\n this.charWidth = charWidth;\n this.textHeight = textHeight;\n this.lineLength = lineLength;\n if (changed) {\n this.heightSamples = {};\n for (let i = 0; i < knownHeights.length; i++) {\n let h = knownHeights[i];\n if (h < 0)\n i++;\n else\n this.heightSamples[Math.floor(h * 10)] = true;\n }\n }\n return changed;\n }\n }\n // This object is used by `updateHeight` to make DOM measurements\n // arrive at the right nides. The `heights` array is a sequence of\n // block heights, starting from position `from`.\n class MeasuredHeights {\n constructor(from, heights) {\n this.from = from;\n this.heights = heights;\n this.index = 0;\n }\n get more() { return this.index < this.heights.length; }\n }\n /**\n Record used to represent information about a block-level element\n in the editor view.\n */\n class BlockInfo {\n /**\n @internal\n */\n constructor(\n /**\n The start of the element in the document.\n */\n from, \n /**\n The length of the element.\n */\n length, \n /**\n The top position of the element (relative to the top of the\n document).\n */\n top, \n /**\n Its height.\n */\n height, \n /**\n @internal Weird packed field that holds an array of children\n for composite blocks, a decoration for block widgets, and a\n number indicating the amount of widget-create line breaks for\n text blocks.\n */\n _content) {\n this.from = from;\n this.length = length;\n this.top = top;\n this.height = height;\n this._content = _content;\n }\n /**\n The type of element this is. When querying lines, this may be\n an array of all the blocks that make up the line.\n */\n get type() {\n return typeof this._content == \"number\" ? BlockType.Text :\n Array.isArray(this._content) ? this._content : this._content.type;\n }\n /**\n The end of the element as a document position.\n */\n get to() { return this.from + this.length; }\n /**\n The bottom position of the element.\n */\n get bottom() { return this.top + this.height; }\n /**\n If this is a widget block, this will return the widget\n associated with it.\n */\n get widget() {\n return this._content instanceof PointDecoration ? this._content.widget : null;\n }\n /**\n If this is a textblock, this holds the number of line breaks\n that appear in widgets inside the block.\n */\n get widgetLineBreaks() {\n return typeof this._content == \"number\" ? this._content : 0;\n }\n /**\n @internal\n */\n join(other) {\n let content = (Array.isArray(this._content) ? this._content : [this])\n .concat(Array.isArray(other._content) ? other._content : [other]);\n return new BlockInfo(this.from, this.length + other.length, this.top, this.height + other.height, content);\n }\n }\n var QueryType$1 = /*@__PURE__*/(function (QueryType) {\n QueryType[QueryType[\"ByPos\"] = 0] = \"ByPos\";\n QueryType[QueryType[\"ByHeight\"] = 1] = \"ByHeight\";\n QueryType[QueryType[\"ByPosNoHeight\"] = 2] = \"ByPosNoHeight\";\n return QueryType})(QueryType$1 || (QueryType$1 = {}));\n const Epsilon = 1e-3;\n class HeightMap {\n constructor(length, // The number of characters covered\n height, // Height of this part of the document\n flags = 2 /* Flag.Outdated */) {\n this.length = length;\n this.height = height;\n this.flags = flags;\n }\n get outdated() { return (this.flags & 2 /* Flag.Outdated */) > 0; }\n set outdated(value) { this.flags = (value ? 2 /* Flag.Outdated */ : 0) | (this.flags & ~2 /* Flag.Outdated */); }\n setHeight(height) {\n if (this.height != height) {\n if (Math.abs(this.height - height) > Epsilon)\n heightChangeFlag = true;\n this.height = height;\n }\n }\n // Base case is to replace a leaf node, which simply builds a tree\n // from the new nodes and returns that (HeightMapBranch and\n // HeightMapGap override this to actually use from/to)\n replace(_from, _to, nodes) {\n return HeightMap.of(nodes);\n }\n // Again, these are base cases, and are overridden for branch and gap nodes.\n decomposeLeft(_to, result) { result.push(this); }\n decomposeRight(_from, result) { result.push(this); }\n applyChanges(decorations, oldDoc, oracle, changes) {\n let me = this, doc = oracle.doc;\n for (let i = changes.length - 1; i >= 0; i--) {\n let { fromA, toA, fromB, toB } = changes[i];\n let start = me.lineAt(fromA, QueryType$1.ByPosNoHeight, oracle.setDoc(oldDoc), 0, 0);\n let end = start.to >= toA ? start : me.lineAt(toA, QueryType$1.ByPosNoHeight, oracle, 0, 0);\n toB += end.to - toA;\n toA = end.to;\n while (i > 0 && start.from <= changes[i - 1].toA) {\n fromA = changes[i - 1].fromA;\n fromB = changes[i - 1].fromB;\n i--;\n if (fromA < start.from)\n start = me.lineAt(fromA, QueryType$1.ByPosNoHeight, oracle, 0, 0);\n }\n fromB += start.from - fromA;\n fromA = start.from;\n let nodes = NodeBuilder.build(oracle.setDoc(doc), decorations, fromB, toB);\n me = replace(me, me.replace(fromA, toA, nodes));\n }\n return me.updateHeight(oracle, 0);\n }\n static empty() { return new HeightMapText(0, 0); }\n // nodes uses null values to indicate the position of line breaks.\n // There are never line breaks at the start or end of the array, or\n // two line breaks next to each other, and the array isn't allowed\n // to be empty (same restrictions as return value from the builder).\n static of(nodes) {\n if (nodes.length == 1)\n return nodes[0];\n let i = 0, j = nodes.length, before = 0, after = 0;\n for (;;) {\n if (i == j) {\n if (before > after * 2) {\n let split = nodes[i - 1];\n if (split.break)\n nodes.splice(--i, 1, split.left, null, split.right);\n else\n nodes.splice(--i, 1, split.left, split.right);\n j += 1 + split.break;\n before -= split.size;\n }\n else if (after > before * 2) {\n let split = nodes[j];\n if (split.break)\n nodes.splice(j, 1, split.left, null, split.right);\n else\n nodes.splice(j, 1, split.left, split.right);\n j += 2 + split.break;\n after -= split.size;\n }\n else {\n break;\n }\n }\n else if (before < after) {\n let next = nodes[i++];\n if (next)\n before += next.size;\n }\n else {\n let next = nodes[--j];\n if (next)\n after += next.size;\n }\n }\n let brk = 0;\n if (nodes[i - 1] == null) {\n brk = 1;\n i--;\n }\n else if (nodes[i] == null) {\n brk = 1;\n j++;\n }\n return new HeightMapBranch(HeightMap.of(nodes.slice(0, i)), brk, HeightMap.of(nodes.slice(j)));\n }\n }\n function replace(old, val) {\n if (old == val)\n return old;\n if (old.constructor != val.constructor)\n heightChangeFlag = true;\n return val;\n }\n HeightMap.prototype.size = 1;\n class HeightMapBlock extends HeightMap {\n constructor(length, height, deco) {\n super(length, height);\n this.deco = deco;\n }\n blockAt(_height, _oracle, top, offset) {\n return new BlockInfo(offset, this.length, top, this.height, this.deco || 0);\n }\n lineAt(_value, _type, oracle, top, offset) {\n return this.blockAt(0, oracle, top, offset);\n }\n forEachLine(from, to, oracle, top, offset, f) {\n if (from <= offset + this.length && to >= offset)\n f(this.blockAt(0, oracle, top, offset));\n }\n updateHeight(oracle, offset = 0, _force = false, measured) {\n if (measured && measured.from <= offset && measured.more)\n this.setHeight(measured.heights[measured.index++]);\n this.outdated = false;\n return this;\n }\n toString() { return `block(${this.length})`; }\n }\n class HeightMapText extends HeightMapBlock {\n constructor(length, height) {\n super(length, height, null);\n this.collapsed = 0; // Amount of collapsed content in the line\n this.widgetHeight = 0; // Maximum inline widget height\n this.breaks = 0; // Number of widget-introduced line breaks on the line\n }\n blockAt(_height, _oracle, top, offset) {\n return new BlockInfo(offset, this.length, top, this.height, this.breaks);\n }\n replace(_from, _to, nodes) {\n let node = nodes[0];\n if (nodes.length == 1 && (node instanceof HeightMapText || node instanceof HeightMapGap && (node.flags & 4 /* Flag.SingleLine */)) &&\n Math.abs(this.length - node.length) < 10) {\n if (node instanceof HeightMapGap)\n node = new HeightMapText(node.length, this.height);\n else\n node.height = this.height;\n if (!this.outdated)\n node.outdated = false;\n return node;\n }\n else {\n return HeightMap.of(nodes);\n }\n }\n updateHeight(oracle, offset = 0, force = false, measured) {\n if (measured && measured.from <= offset && measured.more)\n this.setHeight(measured.heights[measured.index++]);\n else if (force || this.outdated)\n this.setHeight(Math.max(this.widgetHeight, oracle.heightForLine(this.length - this.collapsed)) +\n this.breaks * oracle.lineHeight);\n this.outdated = false;\n return this;\n }\n toString() {\n return `line(${this.length}${this.collapsed ? -this.collapsed : \"\"}${this.widgetHeight ? \":\" + this.widgetHeight : \"\"})`;\n }\n }\n class HeightMapGap extends HeightMap {\n constructor(length) { super(length, 0); }\n heightMetrics(oracle, offset) {\n let firstLine = oracle.doc.lineAt(offset).number, lastLine = oracle.doc.lineAt(offset + this.length).number;\n let lines = lastLine - firstLine + 1;\n let perLine, perChar = 0;\n if (oracle.lineWrapping) {\n let totalPerLine = Math.min(this.height, oracle.lineHeight * lines);\n perLine = totalPerLine / lines;\n if (this.length > lines + 1)\n perChar = (this.height - totalPerLine) / (this.length - lines - 1);\n }\n else {\n perLine = this.height / lines;\n }\n return { firstLine, lastLine, perLine, perChar };\n }\n blockAt(height, oracle, top, offset) {\n let { firstLine, lastLine, perLine, perChar } = this.heightMetrics(oracle, offset);\n if (oracle.lineWrapping) {\n let guess = offset + (height < oracle.lineHeight ? 0\n : Math.round(Math.max(0, Math.min(1, (height - top) / this.height)) * this.length));\n let line = oracle.doc.lineAt(guess), lineHeight = perLine + line.length * perChar;\n let lineTop = Math.max(top, height - lineHeight / 2);\n return new BlockInfo(line.from, line.length, lineTop, lineHeight, 0);\n }\n else {\n let line = Math.max(0, Math.min(lastLine - firstLine, Math.floor((height - top) / perLine)));\n let { from, length } = oracle.doc.line(firstLine + line);\n return new BlockInfo(from, length, top + perLine * line, perLine, 0);\n }\n }\n lineAt(value, type, oracle, top, offset) {\n if (type == QueryType$1.ByHeight)\n return this.blockAt(value, oracle, top, offset);\n if (type == QueryType$1.ByPosNoHeight) {\n let { from, to } = oracle.doc.lineAt(value);\n return new BlockInfo(from, to - from, 0, 0, 0);\n }\n let { firstLine, perLine, perChar } = this.heightMetrics(oracle, offset);\n let line = oracle.doc.lineAt(value), lineHeight = perLine + line.length * perChar;\n let linesAbove = line.number - firstLine;\n let lineTop = top + perLine * linesAbove + perChar * (line.from - offset - linesAbove);\n return new BlockInfo(line.from, line.length, Math.max(top, Math.min(lineTop, top + this.height - lineHeight)), lineHeight, 0);\n }\n forEachLine(from, to, oracle, top, offset, f) {\n from = Math.max(from, offset);\n to = Math.min(to, offset + this.length);\n let { firstLine, perLine, perChar } = this.heightMetrics(oracle, offset);\n for (let pos = from, lineTop = top; pos <= to;) {\n let line = oracle.doc.lineAt(pos);\n if (pos == from) {\n let linesAbove = line.number - firstLine;\n lineTop += perLine * linesAbove + perChar * (from - offset - linesAbove);\n }\n let lineHeight = perLine + perChar * line.length;\n f(new BlockInfo(line.from, line.length, lineTop, lineHeight, 0));\n lineTop += lineHeight;\n pos = line.to + 1;\n }\n }\n replace(from, to, nodes) {\n let after = this.length - to;\n if (after > 0) {\n let last = nodes[nodes.length - 1];\n if (last instanceof HeightMapGap)\n nodes[nodes.length - 1] = new HeightMapGap(last.length + after);\n else\n nodes.push(null, new HeightMapGap(after - 1));\n }\n if (from > 0) {\n let first = nodes[0];\n if (first instanceof HeightMapGap)\n nodes[0] = new HeightMapGap(from + first.length);\n else\n nodes.unshift(new HeightMapGap(from - 1), null);\n }\n return HeightMap.of(nodes);\n }\n decomposeLeft(to, result) {\n result.push(new HeightMapGap(to - 1), null);\n }\n decomposeRight(from, result) {\n result.push(null, new HeightMapGap(this.length - from - 1));\n }\n updateHeight(oracle, offset = 0, force = false, measured) {\n let end = offset + this.length;\n if (measured && measured.from <= offset + this.length && measured.more) {\n // Fill in part of this gap with measured lines. We know there\n // can't be widgets or collapsed ranges in those lines, because\n // they would already have been added to the heightmap (gaps\n // only contain plain text).\n let nodes = [], pos = Math.max(offset, measured.from), singleHeight = -1;\n if (measured.from > offset)\n nodes.push(new HeightMapGap(measured.from - offset - 1).updateHeight(oracle, offset));\n while (pos <= end && measured.more) {\n let len = oracle.doc.lineAt(pos).length;\n if (nodes.length)\n nodes.push(null);\n let height = measured.heights[measured.index++];\n if (singleHeight == -1)\n singleHeight = height;\n else if (Math.abs(height - singleHeight) >= Epsilon)\n singleHeight = -2;\n let line = new HeightMapText(len, height);\n line.outdated = false;\n nodes.push(line);\n pos += len + 1;\n }\n if (pos <= end)\n nodes.push(null, new HeightMapGap(end - pos).updateHeight(oracle, pos));\n let result = HeightMap.of(nodes);\n if (singleHeight < 0 || Math.abs(result.height - this.height) >= Epsilon ||\n Math.abs(singleHeight - this.heightMetrics(oracle, offset).perLine) >= Epsilon)\n heightChangeFlag = true;\n return replace(this, result);\n }\n else if (force || this.outdated) {\n this.setHeight(oracle.heightForGap(offset, offset + this.length));\n this.outdated = false;\n }\n return this;\n }\n toString() { return `gap(${this.length})`; }\n }\n class HeightMapBranch extends HeightMap {\n constructor(left, brk, right) {\n super(left.length + brk + right.length, left.height + right.height, brk | (left.outdated || right.outdated ? 2 /* Flag.Outdated */ : 0));\n this.left = left;\n this.right = right;\n this.size = left.size + right.size;\n }\n get break() { return this.flags & 1 /* Flag.Break */; }\n blockAt(height, oracle, top, offset) {\n let mid = top + this.left.height;\n return height < mid ? this.left.blockAt(height, oracle, top, offset)\n : this.right.blockAt(height, oracle, mid, offset + this.left.length + this.break);\n }\n lineAt(value, type, oracle, top, offset) {\n let rightTop = top + this.left.height, rightOffset = offset + this.left.length + this.break;\n let left = type == QueryType$1.ByHeight ? value < rightTop : value < rightOffset;\n let base = left ? this.left.lineAt(value, type, oracle, top, offset)\n : this.right.lineAt(value, type, oracle, rightTop, rightOffset);\n if (this.break || (left ? base.to < rightOffset : base.from > rightOffset))\n return base;\n let subQuery = type == QueryType$1.ByPosNoHeight ? QueryType$1.ByPosNoHeight : QueryType$1.ByPos;\n if (left)\n return base.join(this.right.lineAt(rightOffset, subQuery, oracle, rightTop, rightOffset));\n else\n return this.left.lineAt(rightOffset, subQuery, oracle, top, offset).join(base);\n }\n forEachLine(from, to, oracle, top, offset, f) {\n let rightTop = top + this.left.height, rightOffset = offset + this.left.length + this.break;\n if (this.break) {\n if (from < rightOffset)\n this.left.forEachLine(from, to, oracle, top, offset, f);\n if (to >= rightOffset)\n this.right.forEachLine(from, to, oracle, rightTop, rightOffset, f);\n }\n else {\n let mid = this.lineAt(rightOffset, QueryType$1.ByPos, oracle, top, offset);\n if (from < mid.from)\n this.left.forEachLine(from, mid.from - 1, oracle, top, offset, f);\n if (mid.to >= from && mid.from <= to)\n f(mid);\n if (to > mid.to)\n this.right.forEachLine(mid.to + 1, to, oracle, rightTop, rightOffset, f);\n }\n }\n replace(from, to, nodes) {\n let rightStart = this.left.length + this.break;\n if (to < rightStart)\n return this.balanced(this.left.replace(from, to, nodes), this.right);\n if (from > this.left.length)\n return this.balanced(this.left, this.right.replace(from - rightStart, to - rightStart, nodes));\n let result = [];\n if (from > 0)\n this.decomposeLeft(from, result);\n let left = result.length;\n for (let node of nodes)\n result.push(node);\n if (from > 0)\n mergeGaps(result, left - 1);\n if (to < this.length) {\n let right = result.length;\n this.decomposeRight(to, result);\n mergeGaps(result, right);\n }\n return HeightMap.of(result);\n }\n decomposeLeft(to, result) {\n let left = this.left.length;\n if (to <= left)\n return this.left.decomposeLeft(to, result);\n result.push(this.left);\n if (this.break) {\n left++;\n if (to >= left)\n result.push(null);\n }\n if (to > left)\n this.right.decomposeLeft(to - left, result);\n }\n decomposeRight(from, result) {\n let left = this.left.length, right = left + this.break;\n if (from >= right)\n return this.right.decomposeRight(from - right, result);\n if (from < left)\n this.left.decomposeRight(from, result);\n if (this.break && from < right)\n result.push(null);\n result.push(this.right);\n }\n balanced(left, right) {\n if (left.size > 2 * right.size || right.size > 2 * left.size)\n return HeightMap.of(this.break ? [left, null, right] : [left, right]);\n this.left = replace(this.left, left);\n this.right = replace(this.right, right);\n this.setHeight(left.height + right.height);\n this.outdated = left.outdated || right.outdated;\n this.size = left.size + right.size;\n this.length = left.length + this.break + right.length;\n return this;\n }\n updateHeight(oracle, offset = 0, force = false, measured) {\n let { left, right } = this, rightStart = offset + left.length + this.break, rebalance = null;\n if (measured && measured.from <= offset + left.length && measured.more)\n rebalance = left = left.updateHeight(oracle, offset, force, measured);\n else\n left.updateHeight(oracle, offset, force);\n if (measured && measured.from <= rightStart + right.length && measured.more)\n rebalance = right = right.updateHeight(oracle, rightStart, force, measured);\n else\n right.updateHeight(oracle, rightStart, force);\n if (rebalance)\n return this.balanced(left, right);\n this.height = this.left.height + this.right.height;\n this.outdated = false;\n return this;\n }\n toString() { return this.left + (this.break ? \" \" : \"-\") + this.right; }\n }\n function mergeGaps(nodes, around) {\n let before, after;\n if (nodes[around] == null &&\n (before = nodes[around - 1]) instanceof HeightMapGap &&\n (after = nodes[around + 1]) instanceof HeightMapGap)\n nodes.splice(around - 1, 3, new HeightMapGap(before.length + 1 + after.length));\n }\n const relevantWidgetHeight = 5;\n class NodeBuilder {\n constructor(pos, oracle) {\n this.pos = pos;\n this.oracle = oracle;\n this.nodes = [];\n this.lineStart = -1;\n this.lineEnd = -1;\n this.covering = null;\n this.writtenTo = pos;\n }\n get isCovered() {\n return this.covering && this.nodes[this.nodes.length - 1] == this.covering;\n }\n span(_from, to) {\n if (this.lineStart > -1) {\n let end = Math.min(to, this.lineEnd), last = this.nodes[this.nodes.length - 1];\n if (last instanceof HeightMapText)\n last.length += end - this.pos;\n else if (end > this.pos || !this.isCovered)\n this.nodes.push(new HeightMapText(end - this.pos, -1));\n this.writtenTo = end;\n if (to > end) {\n this.nodes.push(null);\n this.writtenTo++;\n this.lineStart = -1;\n }\n }\n this.pos = to;\n }\n point(from, to, deco) {\n if (from < to || deco.heightRelevant) {\n let height = deco.widget ? deco.widget.estimatedHeight : 0;\n let breaks = deco.widget ? deco.widget.lineBreaks : 0;\n if (height < 0)\n height = this.oracle.lineHeight;\n let len = to - from;\n if (deco.block) {\n this.addBlock(new HeightMapBlock(len, height, deco));\n }\n else if (len || breaks || height >= relevantWidgetHeight) {\n this.addLineDeco(height, breaks, len);\n }\n }\n else if (to > from) {\n this.span(from, to);\n }\n if (this.lineEnd > -1 && this.lineEnd < this.pos)\n this.lineEnd = this.oracle.doc.lineAt(this.pos).to;\n }\n enterLine() {\n if (this.lineStart > -1)\n return;\n let { from, to } = this.oracle.doc.lineAt(this.pos);\n this.lineStart = from;\n this.lineEnd = to;\n if (this.writtenTo < from) {\n if (this.writtenTo < from - 1 || this.nodes[this.nodes.length - 1] == null)\n this.nodes.push(this.blankContent(this.writtenTo, from - 1));\n this.nodes.push(null);\n }\n if (this.pos > from)\n this.nodes.push(new HeightMapText(this.pos - from, -1));\n this.writtenTo = this.pos;\n }\n blankContent(from, to) {\n let gap = new HeightMapGap(to - from);\n if (this.oracle.doc.lineAt(from).to == to)\n gap.flags |= 4 /* Flag.SingleLine */;\n return gap;\n }\n ensureLine() {\n this.enterLine();\n let last = this.nodes.length ? this.nodes[this.nodes.length - 1] : null;\n if (last instanceof HeightMapText)\n return last;\n let line = new HeightMapText(0, -1);\n this.nodes.push(line);\n return line;\n }\n addBlock(block) {\n this.enterLine();\n let deco = block.deco;\n if (deco && deco.startSide > 0 && !this.isCovered)\n this.ensureLine();\n this.nodes.push(block);\n this.writtenTo = this.pos = this.pos + block.length;\n if (deco && deco.endSide > 0)\n this.covering = block;\n }\n addLineDeco(height, breaks, length) {\n let line = this.ensureLine();\n line.length += length;\n line.collapsed += length;\n line.widgetHeight = Math.max(line.widgetHeight, height);\n line.breaks += breaks;\n this.writtenTo = this.pos = this.pos + length;\n }\n finish(from) {\n let last = this.nodes.length == 0 ? null : this.nodes[this.nodes.length - 1];\n if (this.lineStart > -1 && !(last instanceof HeightMapText) && !this.isCovered)\n this.nodes.push(new HeightMapText(0, -1));\n else if (this.writtenTo < this.pos || last == null)\n this.nodes.push(this.blankContent(this.writtenTo, this.pos));\n let pos = from;\n for (let node of this.nodes) {\n if (node instanceof HeightMapText)\n node.updateHeight(this.oracle, pos);\n pos += node ? node.length : 1;\n }\n return this.nodes;\n }\n // Always called with a region that on both sides either stretches\n // to a line break or the end of the document.\n // The returned array uses null to indicate line breaks, but never\n // starts or ends in a line break, or has multiple line breaks next\n // to each other.\n static build(oracle, decorations, from, to) {\n let builder = new NodeBuilder(from, oracle);\n RangeSet.spans(decorations, from, to, builder, 0);\n return builder.finish(from);\n }\n }\n function heightRelevantDecoChanges(a, b, diff) {\n let comp = new DecorationComparator;\n RangeSet.compare(a, b, diff, comp, 0);\n return comp.changes;\n }\n class DecorationComparator {\n constructor() {\n this.changes = [];\n }\n compareRange() { }\n comparePoint(from, to, a, b) {\n if (from < to || a && a.heightRelevant || b && b.heightRelevant)\n addRange(from, to, this.changes, 5);\n }\n }\n\n function visiblePixelRange(dom, paddingTop) {\n let rect = dom.getBoundingClientRect();\n let doc = dom.ownerDocument, win = doc.defaultView || window;\n let left = Math.max(0, rect.left), right = Math.min(win.innerWidth, rect.right);\n let top = Math.max(0, rect.top), bottom = Math.min(win.innerHeight, rect.bottom);\n for (let parent = dom.parentNode; parent && parent != doc.body;) {\n if (parent.nodeType == 1) {\n let elt = parent;\n let style = window.getComputedStyle(elt);\n if ((elt.scrollHeight > elt.clientHeight || elt.scrollWidth > elt.clientWidth) &&\n style.overflow != \"visible\") {\n let parentRect = elt.getBoundingClientRect();\n left = Math.max(left, parentRect.left);\n right = Math.min(right, parentRect.right);\n top = Math.max(top, parentRect.top);\n bottom = parent == dom.parentNode ? parentRect.bottom : Math.min(bottom, parentRect.bottom);\n }\n parent = style.position == \"absolute\" || style.position == \"fixed\" ? elt.offsetParent : elt.parentNode;\n }\n else if (parent.nodeType == 11) { // Shadow root\n parent = parent.host;\n }\n else {\n break;\n }\n }\n return { left: left - rect.left, right: Math.max(left, right) - rect.left,\n top: top - (rect.top + paddingTop), bottom: Math.max(top, bottom) - (rect.top + paddingTop) };\n }\n function fullPixelRange(dom, paddingTop) {\n let rect = dom.getBoundingClientRect();\n return { left: 0, right: rect.right - rect.left,\n top: paddingTop, bottom: rect.bottom - (rect.top + paddingTop) };\n }\n // Line gaps are placeholder widgets used to hide pieces of overlong\n // lines within the viewport, as a kludge to keep the editor\n // responsive when a ridiculously long line is loaded into it.\n class LineGap {\n constructor(from, to, size) {\n this.from = from;\n this.to = to;\n this.size = size;\n }\n static same(a, b) {\n if (a.length != b.length)\n return false;\n for (let i = 0; i < a.length; i++) {\n let gA = a[i], gB = b[i];\n if (gA.from != gB.from || gA.to != gB.to || gA.size != gB.size)\n return false;\n }\n return true;\n }\n draw(viewState, wrapping) {\n return Decoration.replace({\n widget: new LineGapWidget(this.size * (wrapping ? viewState.scaleY : viewState.scaleX), wrapping)\n }).range(this.from, this.to);\n }\n }\n class LineGapWidget extends WidgetType {\n constructor(size, vertical) {\n super();\n this.size = size;\n this.vertical = vertical;\n }\n eq(other) { return other.size == this.size && other.vertical == this.vertical; }\n toDOM() {\n let elt = document.createElement(\"div\");\n if (this.vertical) {\n elt.style.height = this.size + \"px\";\n }\n else {\n elt.style.width = this.size + \"px\";\n elt.style.height = \"2px\";\n elt.style.display = \"inline-block\";\n }\n return elt;\n }\n get estimatedHeight() { return this.vertical ? this.size : -1; }\n }\n class ViewState {\n constructor(state) {\n this.state = state;\n // These are contentDOM-local coordinates\n this.pixelViewport = { left: 0, right: window.innerWidth, top: 0, bottom: 0 };\n this.inView = true;\n this.paddingTop = 0; // Padding above the document, scaled\n this.paddingBottom = 0; // Padding below the document, scaled\n this.contentDOMWidth = 0; // contentDOM.getBoundingClientRect().width\n this.contentDOMHeight = 0; // contentDOM.getBoundingClientRect().height\n this.editorHeight = 0; // scrollDOM.clientHeight, unscaled\n this.editorWidth = 0; // scrollDOM.clientWidth, unscaled\n this.scrollTop = 0; // Last seen scrollDOM.scrollTop, scaled\n this.scrolledToBottom = false;\n // The CSS-transformation scale of the editor (transformed size /\n // concrete size)\n this.scaleX = 1;\n this.scaleY = 1;\n // The vertical position (document-relative) to which to anchor the\n // scroll position. -1 means anchor to the end of the document.\n this.scrollAnchorPos = 0;\n // The height at the anchor position. Set by the DOM update phase.\n // -1 means no height available.\n this.scrollAnchorHeight = -1;\n // See VP.MaxDOMHeight\n this.scaler = IdScaler;\n this.scrollTarget = null;\n // Briefly set to true when printing, to disable viewport limiting\n this.printing = false;\n // Flag set when editor content was redrawn, so that the next\n // measure stage knows it must read DOM layout\n this.mustMeasureContent = true;\n this.defaultTextDirection = Direction.LTR;\n this.visibleRanges = [];\n // Cursor 'assoc' is only significant when the cursor is on a line\n // wrap point, where it must stick to the character that it is\n // associated with. Since browsers don't provide a reasonable\n // interface to set or query this, when a selection is set that\n // might cause this to be significant, this flag is set. The next\n // measure phase will check whether the cursor is on a line-wrapping\n // boundary and, if so, reset it to make sure it is positioned in\n // the right place.\n this.mustEnforceCursorAssoc = false;\n let guessWrapping = state.facet(contentAttributes).some(v => typeof v != \"function\" && v.class == \"cm-lineWrapping\");\n this.heightOracle = new HeightOracle(guessWrapping);\n this.stateDeco = state.facet(decorations).filter(d => typeof d != \"function\");\n this.heightMap = HeightMap.empty().applyChanges(this.stateDeco, Text.empty, this.heightOracle.setDoc(state.doc), [new ChangedRange(0, 0, 0, state.doc.length)]);\n for (let i = 0; i < 2; i++) {\n this.viewport = this.getViewport(0, null);\n if (!this.updateForViewport())\n break;\n }\n this.updateViewportLines();\n this.lineGaps = this.ensureLineGaps([]);\n this.lineGapDeco = Decoration.set(this.lineGaps.map(gap => gap.draw(this, false)));\n this.computeVisibleRanges();\n }\n updateForViewport() {\n let viewports = [this.viewport], { main } = this.state.selection;\n for (let i = 0; i <= 1; i++) {\n let pos = i ? main.head : main.anchor;\n if (!viewports.some(({ from, to }) => pos >= from && pos <= to)) {\n let { from, to } = this.lineBlockAt(pos);\n viewports.push(new Viewport(from, to));\n }\n }\n this.viewports = viewports.sort((a, b) => a.from - b.from);\n return this.updateScaler();\n }\n updateScaler() {\n let scaler = this.scaler;\n this.scaler = this.heightMap.height <= 7000000 /* VP.MaxDOMHeight */ ? IdScaler :\n new BigScaler(this.heightOracle, this.heightMap, this.viewports);\n return scaler.eq(this.scaler) ? 0 : 2 /* UpdateFlag.Height */;\n }\n updateViewportLines() {\n this.viewportLines = [];\n this.heightMap.forEachLine(this.viewport.from, this.viewport.to, this.heightOracle.setDoc(this.state.doc), 0, 0, block => {\n this.viewportLines.push(scaleBlock(block, this.scaler));\n });\n }\n update(update, scrollTarget = null) {\n this.state = update.state;\n let prevDeco = this.stateDeco;\n this.stateDeco = this.state.facet(decorations).filter(d => typeof d != \"function\");\n let contentChanges = update.changedRanges;\n let heightChanges = ChangedRange.extendWithRanges(contentChanges, heightRelevantDecoChanges(prevDeco, this.stateDeco, update ? update.changes : ChangeSet.empty(this.state.doc.length)));\n let prevHeight = this.heightMap.height;\n let scrollAnchor = this.scrolledToBottom ? null : this.scrollAnchorAt(this.scrollTop);\n clearHeightChangeFlag();\n this.heightMap = this.heightMap.applyChanges(this.stateDeco, update.startState.doc, this.heightOracle.setDoc(this.state.doc), heightChanges);\n if (this.heightMap.height != prevHeight || heightChangeFlag)\n update.flags |= 2 /* UpdateFlag.Height */;\n if (scrollAnchor) {\n this.scrollAnchorPos = update.changes.mapPos(scrollAnchor.from, -1);\n this.scrollAnchorHeight = scrollAnchor.top;\n }\n else {\n this.scrollAnchorPos = -1;\n this.scrollAnchorHeight = this.heightMap.height;\n }\n let viewport = heightChanges.length ? this.mapViewport(this.viewport, update.changes) : this.viewport;\n if (scrollTarget && (scrollTarget.range.head < viewport.from || scrollTarget.range.head > viewport.to) ||\n !this.viewportIsAppropriate(viewport))\n viewport = this.getViewport(0, scrollTarget);\n let viewportChange = viewport.from != this.viewport.from || viewport.to != this.viewport.to;\n this.viewport = viewport;\n update.flags |= this.updateForViewport();\n if (viewportChange || !update.changes.empty || (update.flags & 2 /* UpdateFlag.Height */))\n this.updateViewportLines();\n if (this.lineGaps.length || this.viewport.to - this.viewport.from > (2000 /* LG.Margin */ << 1))\n this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps, update.changes)));\n update.flags |= this.computeVisibleRanges();\n if (scrollTarget)\n this.scrollTarget = scrollTarget;\n if (!this.mustEnforceCursorAssoc && update.selectionSet && update.view.lineWrapping &&\n update.state.selection.main.empty && update.state.selection.main.assoc &&\n !update.state.facet(nativeSelectionHidden))\n this.mustEnforceCursorAssoc = true;\n }\n measure(view) {\n let dom = view.contentDOM, style = window.getComputedStyle(dom);\n let oracle = this.heightOracle;\n let whiteSpace = style.whiteSpace;\n this.defaultTextDirection = style.direction == \"rtl\" ? Direction.RTL : Direction.LTR;\n let refresh = this.heightOracle.mustRefreshForWrapping(whiteSpace);\n let domRect = dom.getBoundingClientRect();\n let measureContent = refresh || this.mustMeasureContent || this.contentDOMHeight != domRect.height;\n this.contentDOMHeight = domRect.height;\n this.mustMeasureContent = false;\n let result = 0, bias = 0;\n if (domRect.width && domRect.height) {\n let { scaleX, scaleY } = getScale(dom, domRect);\n if (scaleX > .005 && Math.abs(this.scaleX - scaleX) > .005 ||\n scaleY > .005 && Math.abs(this.scaleY - scaleY) > .005) {\n this.scaleX = scaleX;\n this.scaleY = scaleY;\n result |= 8 /* UpdateFlag.Geometry */;\n refresh = measureContent = true;\n }\n }\n // Vertical padding\n let paddingTop = (parseInt(style.paddingTop) || 0) * this.scaleY;\n let paddingBottom = (parseInt(style.paddingBottom) || 0) * this.scaleY;\n if (this.paddingTop != paddingTop || this.paddingBottom != paddingBottom) {\n this.paddingTop = paddingTop;\n this.paddingBottom = paddingBottom;\n result |= 8 /* UpdateFlag.Geometry */ | 2 /* UpdateFlag.Height */;\n }\n if (this.editorWidth != view.scrollDOM.clientWidth) {\n if (oracle.lineWrapping)\n measureContent = true;\n this.editorWidth = view.scrollDOM.clientWidth;\n result |= 8 /* UpdateFlag.Geometry */;\n }\n let scrollTop = view.scrollDOM.scrollTop * this.scaleY;\n if (this.scrollTop != scrollTop) {\n this.scrollAnchorHeight = -1;\n this.scrollTop = scrollTop;\n }\n this.scrolledToBottom = isScrolledToBottom(view.scrollDOM);\n // Pixel viewport\n let pixelViewport = (this.printing ? fullPixelRange : visiblePixelRange)(dom, this.paddingTop);\n let dTop = pixelViewport.top - this.pixelViewport.top, dBottom = pixelViewport.bottom - this.pixelViewport.bottom;\n this.pixelViewport = pixelViewport;\n let inView = this.pixelViewport.bottom > this.pixelViewport.top && this.pixelViewport.right > this.pixelViewport.left;\n if (inView != this.inView) {\n this.inView = inView;\n if (inView)\n measureContent = true;\n }\n if (!this.inView && !this.scrollTarget)\n return 0;\n let contentWidth = domRect.width;\n if (this.contentDOMWidth != contentWidth || this.editorHeight != view.scrollDOM.clientHeight) {\n this.contentDOMWidth = domRect.width;\n this.editorHeight = view.scrollDOM.clientHeight;\n result |= 8 /* UpdateFlag.Geometry */;\n }\n if (measureContent) {\n let lineHeights = view.docView.measureVisibleLineHeights(this.viewport);\n if (oracle.mustRefreshForHeights(lineHeights))\n refresh = true;\n if (refresh || oracle.lineWrapping && Math.abs(contentWidth - this.contentDOMWidth) > oracle.charWidth) {\n let { lineHeight, charWidth, textHeight } = view.docView.measureTextSize();\n refresh = lineHeight > 0 && oracle.refresh(whiteSpace, lineHeight, charWidth, textHeight, contentWidth / charWidth, lineHeights);\n if (refresh) {\n view.docView.minWidth = 0;\n result |= 8 /* UpdateFlag.Geometry */;\n }\n }\n if (dTop > 0 && dBottom > 0)\n bias = Math.max(dTop, dBottom);\n else if (dTop < 0 && dBottom < 0)\n bias = Math.min(dTop, dBottom);\n clearHeightChangeFlag();\n for (let vp of this.viewports) {\n let heights = vp.from == this.viewport.from ? lineHeights : view.docView.measureVisibleLineHeights(vp);\n this.heightMap = (refresh ? HeightMap.empty().applyChanges(this.stateDeco, Text.empty, this.heightOracle, [new ChangedRange(0, 0, 0, view.state.doc.length)]) : this.heightMap).updateHeight(oracle, 0, refresh, new MeasuredHeights(vp.from, heights));\n }\n if (heightChangeFlag)\n result |= 2 /* UpdateFlag.Height */;\n }\n let viewportChange = !this.viewportIsAppropriate(this.viewport, bias) ||\n this.scrollTarget && (this.scrollTarget.range.head < this.viewport.from ||\n this.scrollTarget.range.head > this.viewport.to);\n if (viewportChange) {\n if (result & 2 /* UpdateFlag.Height */)\n result |= this.updateScaler();\n this.viewport = this.getViewport(bias, this.scrollTarget);\n result |= this.updateForViewport();\n }\n if ((result & 2 /* UpdateFlag.Height */) || viewportChange)\n this.updateViewportLines();\n if (this.lineGaps.length || this.viewport.to - this.viewport.from > (2000 /* LG.Margin */ << 1))\n this.updateLineGaps(this.ensureLineGaps(refresh ? [] : this.lineGaps, view));\n result |= this.computeVisibleRanges();\n if (this.mustEnforceCursorAssoc) {\n this.mustEnforceCursorAssoc = false;\n // This is done in the read stage, because moving the selection\n // to a line end is going to trigger a layout anyway, so it\n // can't be a pure write. It should be rare that it does any\n // writing.\n view.docView.enforceCursorAssoc();\n }\n return result;\n }\n get visibleTop() { return this.scaler.fromDOM(this.pixelViewport.top); }\n get visibleBottom() { return this.scaler.fromDOM(this.pixelViewport.bottom); }\n getViewport(bias, scrollTarget) {\n // This will divide VP.Margin between the top and the\n // bottom, depending on the bias (the change in viewport position\n // since the last update). It'll hold a number between 0 and 1\n let marginTop = 0.5 - Math.max(-0.5, Math.min(0.5, bias / 1000 /* VP.Margin */ / 2));\n let map = this.heightMap, oracle = this.heightOracle;\n let { visibleTop, visibleBottom } = this;\n let viewport = new Viewport(map.lineAt(visibleTop - marginTop * 1000 /* VP.Margin */, QueryType$1.ByHeight, oracle, 0, 0).from, map.lineAt(visibleBottom + (1 - marginTop) * 1000 /* VP.Margin */, QueryType$1.ByHeight, oracle, 0, 0).to);\n // If scrollTarget is given, make sure the viewport includes that position\n if (scrollTarget) {\n let { head } = scrollTarget.range;\n if (head < viewport.from || head > viewport.to) {\n let viewHeight = Math.min(this.editorHeight, this.pixelViewport.bottom - this.pixelViewport.top);\n let block = map.lineAt(head, QueryType$1.ByPos, oracle, 0, 0), topPos;\n if (scrollTarget.y == \"center\")\n topPos = (block.top + block.bottom) / 2 - viewHeight / 2;\n else if (scrollTarget.y == \"start\" || scrollTarget.y == \"nearest\" && head < viewport.from)\n topPos = block.top;\n else\n topPos = block.bottom - viewHeight;\n viewport = new Viewport(map.lineAt(topPos - 1000 /* VP.Margin */ / 2, QueryType$1.ByHeight, oracle, 0, 0).from, map.lineAt(topPos + viewHeight + 1000 /* VP.Margin */ / 2, QueryType$1.ByHeight, oracle, 0, 0).to);\n }\n }\n return viewport;\n }\n mapViewport(viewport, changes) {\n let from = changes.mapPos(viewport.from, -1), to = changes.mapPos(viewport.to, 1);\n return new Viewport(this.heightMap.lineAt(from, QueryType$1.ByPos, this.heightOracle, 0, 0).from, this.heightMap.lineAt(to, QueryType$1.ByPos, this.heightOracle, 0, 0).to);\n }\n // Checks if a given viewport covers the visible part of the\n // document and not too much beyond that.\n viewportIsAppropriate({ from, to }, bias = 0) {\n if (!this.inView)\n return true;\n let { top } = this.heightMap.lineAt(from, QueryType$1.ByPos, this.heightOracle, 0, 0);\n let { bottom } = this.heightMap.lineAt(to, QueryType$1.ByPos, this.heightOracle, 0, 0);\n let { visibleTop, visibleBottom } = this;\n return (from == 0 || top <= visibleTop - Math.max(10 /* VP.MinCoverMargin */, Math.min(-bias, 250 /* VP.MaxCoverMargin */))) &&\n (to == this.state.doc.length ||\n bottom >= visibleBottom + Math.max(10 /* VP.MinCoverMargin */, Math.min(bias, 250 /* VP.MaxCoverMargin */))) &&\n (top > visibleTop - 2 * 1000 /* VP.Margin */ && bottom < visibleBottom + 2 * 1000 /* VP.Margin */);\n }\n mapLineGaps(gaps, changes) {\n if (!gaps.length || changes.empty)\n return gaps;\n let mapped = [];\n for (let gap of gaps)\n if (!changes.touchesRange(gap.from, gap.to))\n mapped.push(new LineGap(changes.mapPos(gap.from), changes.mapPos(gap.to), gap.size));\n return mapped;\n }\n // Computes positions in the viewport where the start or end of a\n // line should be hidden, trying to reuse existing line gaps when\n // appropriate to avoid unneccesary redraws.\n // Uses crude character-counting for the positioning and sizing,\n // since actual DOM coordinates aren't always available and\n // predictable. Relies on generous margins (see LG.Margin) to hide\n // the artifacts this might produce from the user.\n ensureLineGaps(current, mayMeasure) {\n let wrapping = this.heightOracle.lineWrapping;\n let margin = wrapping ? 10000 /* LG.MarginWrap */ : 2000 /* LG.Margin */, halfMargin = margin >> 1, doubleMargin = margin << 1;\n // The non-wrapping logic won't work at all in predominantly right-to-left text.\n if (this.defaultTextDirection != Direction.LTR && !wrapping)\n return [];\n let gaps = [];\n let addGap = (from, to, line, structure) => {\n if (to - from < halfMargin)\n return;\n let sel = this.state.selection.main, avoid = [sel.from];\n if (!sel.empty)\n avoid.push(sel.to);\n for (let pos of avoid) {\n if (pos > from && pos < to) {\n addGap(from, pos - 10 /* LG.SelectionMargin */, line, structure);\n addGap(pos + 10 /* LG.SelectionMargin */, to, line, structure);\n return;\n }\n }\n let gap = find$1(current, gap => gap.from >= line.from && gap.to <= line.to &&\n Math.abs(gap.from - from) < halfMargin && Math.abs(gap.to - to) < halfMargin &&\n !avoid.some(pos => gap.from < pos && gap.to > pos));\n if (!gap) {\n // When scrolling down, snap gap ends to line starts to avoid shifts in wrapping\n if (to < line.to && mayMeasure && wrapping &&\n mayMeasure.visibleRanges.some(r => r.from <= to && r.to >= to)) {\n let lineStart = mayMeasure.moveToLineBoundary(EditorSelection.cursor(to), false, true).head;\n if (lineStart > from)\n to = lineStart;\n }\n gap = new LineGap(from, to, this.gapSize(line, from, to, structure));\n }\n gaps.push(gap);\n };\n let checkLine = (line) => {\n if (line.length < doubleMargin || line.type != BlockType.Text)\n return;\n let structure = lineStructure(line.from, line.to, this.stateDeco);\n if (structure.total < doubleMargin)\n return;\n let target = this.scrollTarget ? this.scrollTarget.range.head : null;\n let viewFrom, viewTo;\n if (wrapping) {\n let marginHeight = (margin / this.heightOracle.lineLength) * this.heightOracle.lineHeight;\n let top, bot;\n if (target != null) {\n let targetFrac = findFraction(structure, target);\n let spaceFrac = ((this.visibleBottom - this.visibleTop) / 2 + marginHeight) / line.height;\n top = targetFrac - spaceFrac;\n bot = targetFrac + spaceFrac;\n }\n else {\n top = (this.visibleTop - line.top - marginHeight) / line.height;\n bot = (this.visibleBottom - line.top + marginHeight) / line.height;\n }\n viewFrom = findPosition(structure, top);\n viewTo = findPosition(structure, bot);\n }\n else {\n let totalWidth = structure.total * this.heightOracle.charWidth;\n let marginWidth = margin * this.heightOracle.charWidth;\n let left, right;\n if (target != null) {\n let targetFrac = findFraction(structure, target);\n let spaceFrac = ((this.pixelViewport.right - this.pixelViewport.left) / 2 + marginWidth) / totalWidth;\n left = targetFrac - spaceFrac;\n right = targetFrac + spaceFrac;\n }\n else {\n left = (this.pixelViewport.left - marginWidth) / totalWidth;\n right = (this.pixelViewport.right + marginWidth) / totalWidth;\n }\n viewFrom = findPosition(structure, left);\n viewTo = findPosition(structure, right);\n }\n if (viewFrom > line.from)\n addGap(line.from, viewFrom, line, structure);\n if (viewTo < line.to)\n addGap(viewTo, line.to, line, structure);\n };\n for (let line of this.viewportLines) {\n if (Array.isArray(line.type))\n line.type.forEach(checkLine);\n else\n checkLine(line);\n }\n return gaps;\n }\n gapSize(line, from, to, structure) {\n let fraction = findFraction(structure, to) - findFraction(structure, from);\n if (this.heightOracle.lineWrapping) {\n return line.height * fraction;\n }\n else {\n return structure.total * this.heightOracle.charWidth * fraction;\n }\n }\n updateLineGaps(gaps) {\n if (!LineGap.same(gaps, this.lineGaps)) {\n this.lineGaps = gaps;\n this.lineGapDeco = Decoration.set(gaps.map(gap => gap.draw(this, this.heightOracle.lineWrapping)));\n }\n }\n computeVisibleRanges() {\n let deco = this.stateDeco;\n if (this.lineGaps.length)\n deco = deco.concat(this.lineGapDeco);\n let ranges = [];\n RangeSet.spans(deco, this.viewport.from, this.viewport.to, {\n span(from, to) { ranges.push({ from, to }); },\n point() { }\n }, 20);\n let changed = ranges.length != this.visibleRanges.length ||\n this.visibleRanges.some((r, i) => r.from != ranges[i].from || r.to != ranges[i].to);\n this.visibleRanges = ranges;\n return changed ? 4 /* UpdateFlag.Viewport */ : 0;\n }\n lineBlockAt(pos) {\n return (pos >= this.viewport.from && pos <= this.viewport.to &&\n this.viewportLines.find(b => b.from <= pos && b.to >= pos)) ||\n scaleBlock(this.heightMap.lineAt(pos, QueryType$1.ByPos, this.heightOracle, 0, 0), this.scaler);\n }\n lineBlockAtHeight(height) {\n return (height >= this.viewportLines[0].top && height <= this.viewportLines[this.viewportLines.length - 1].bottom &&\n this.viewportLines.find(l => l.top <= height && l.bottom >= height)) ||\n scaleBlock(this.heightMap.lineAt(this.scaler.fromDOM(height), QueryType$1.ByHeight, this.heightOracle, 0, 0), this.scaler);\n }\n scrollAnchorAt(scrollTop) {\n let block = this.lineBlockAtHeight(scrollTop + 8);\n return block.from >= this.viewport.from || this.viewportLines[0].top - scrollTop > 200 ? block : this.viewportLines[0];\n }\n elementAtHeight(height) {\n return scaleBlock(this.heightMap.blockAt(this.scaler.fromDOM(height), this.heightOracle, 0, 0), this.scaler);\n }\n get docHeight() {\n return this.scaler.toDOM(this.heightMap.height);\n }\n get contentHeight() {\n return this.docHeight + this.paddingTop + this.paddingBottom;\n }\n }\n class Viewport {\n constructor(from, to) {\n this.from = from;\n this.to = to;\n }\n }\n function lineStructure(from, to, stateDeco) {\n let ranges = [], pos = from, total = 0;\n RangeSet.spans(stateDeco, from, to, {\n span() { },\n point(from, to) {\n if (from > pos) {\n ranges.push({ from: pos, to: from });\n total += from - pos;\n }\n pos = to;\n }\n }, 20); // We're only interested in collapsed ranges of a significant size\n if (pos < to) {\n ranges.push({ from: pos, to });\n total += to - pos;\n }\n return { total, ranges };\n }\n function findPosition({ total, ranges }, ratio) {\n if (ratio <= 0)\n return ranges[0].from;\n if (ratio >= 1)\n return ranges[ranges.length - 1].to;\n let dist = Math.floor(total * ratio);\n for (let i = 0;; i++) {\n let { from, to } = ranges[i], size = to - from;\n if (dist <= size)\n return from + dist;\n dist -= size;\n }\n }\n function findFraction(structure, pos) {\n let counted = 0;\n for (let { from, to } of structure.ranges) {\n if (pos <= to) {\n counted += pos - from;\n break;\n }\n counted += to - from;\n }\n return counted / structure.total;\n }\n function find$1(array, f) {\n for (let val of array)\n if (f(val))\n return val;\n return undefined;\n }\n // Don't scale when the document height is within the range of what\n // the DOM can handle.\n const IdScaler = {\n toDOM(n) { return n; },\n fromDOM(n) { return n; },\n scale: 1,\n eq(other) { return other == this; }\n };\n // When the height is too big (> VP.MaxDOMHeight), scale down the\n // regions outside the viewports so that the total height is\n // VP.MaxDOMHeight.\n class BigScaler {\n constructor(oracle, heightMap, viewports) {\n let vpHeight = 0, base = 0, domBase = 0;\n this.viewports = viewports.map(({ from, to }) => {\n let top = heightMap.lineAt(from, QueryType$1.ByPos, oracle, 0, 0).top;\n let bottom = heightMap.lineAt(to, QueryType$1.ByPos, oracle, 0, 0).bottom;\n vpHeight += bottom - top;\n return { from, to, top, bottom, domTop: 0, domBottom: 0 };\n });\n this.scale = (7000000 /* VP.MaxDOMHeight */ - vpHeight) / (heightMap.height - vpHeight);\n for (let obj of this.viewports) {\n obj.domTop = domBase + (obj.top - base) * this.scale;\n domBase = obj.domBottom = obj.domTop + (obj.bottom - obj.top);\n base = obj.bottom;\n }\n }\n toDOM(n) {\n for (let i = 0, base = 0, domBase = 0;; i++) {\n let vp = i < this.viewports.length ? this.viewports[i] : null;\n if (!vp || n < vp.top)\n return domBase + (n - base) * this.scale;\n if (n <= vp.bottom)\n return vp.domTop + (n - vp.top);\n base = vp.bottom;\n domBase = vp.domBottom;\n }\n }\n fromDOM(n) {\n for (let i = 0, base = 0, domBase = 0;; i++) {\n let vp = i < this.viewports.length ? this.viewports[i] : null;\n if (!vp || n < vp.domTop)\n return base + (n - domBase) / this.scale;\n if (n <= vp.domBottom)\n return vp.top + (n - vp.domTop);\n base = vp.bottom;\n domBase = vp.domBottom;\n }\n }\n eq(other) {\n if (!(other instanceof BigScaler))\n return false;\n return this.scale == other.scale && this.viewports.length == other.viewports.length &&\n this.viewports.every((vp, i) => vp.from == other.viewports[i].from && vp.to == other.viewports[i].to);\n }\n }\n function scaleBlock(block, scaler) {\n if (scaler.scale == 1)\n return block;\n let bTop = scaler.toDOM(block.top), bBottom = scaler.toDOM(block.bottom);\n return new BlockInfo(block.from, block.length, bTop, bBottom - bTop, Array.isArray(block._content) ? block._content.map(b => scaleBlock(b, scaler)) : block._content);\n }\n\n const theme = /*@__PURE__*/Facet.define({ combine: strs => strs.join(\" \") });\n const darkTheme = /*@__PURE__*/Facet.define({ combine: values => values.indexOf(true) > -1 });\n const baseThemeID = /*@__PURE__*/StyleModule.newName(), baseLightID = /*@__PURE__*/StyleModule.newName(), baseDarkID = /*@__PURE__*/StyleModule.newName();\n const lightDarkIDs = { \"&light\": \".\" + baseLightID, \"&dark\": \".\" + baseDarkID };\n function buildTheme(main, spec, scopes) {\n return new StyleModule(spec, {\n finish(sel) {\n return /&/.test(sel) ? sel.replace(/&\\w*/, m => {\n if (m == \"&\")\n return main;\n if (!scopes || !scopes[m])\n throw new RangeError(`Unsupported selector: ${m}`);\n return scopes[m];\n }) : main + \" \" + sel;\n }\n });\n }\n const baseTheme$1$2 = /*@__PURE__*/buildTheme(\".\" + baseThemeID, {\n \"&\": {\n position: \"relative !important\",\n boxSizing: \"border-box\",\n \"&.cm-focused\": {\n // Provide a simple default outline to make sure a focused\n // editor is visually distinct. Can't leave the default behavior\n // because that will apply to the content element, which is\n // inside the scrollable container and doesn't include the\n // gutters. We also can't use an 'auto' outline, since those\n // are, for some reason, drawn behind the element content, which\n // will cause things like the active line background to cover\n // the outline (#297).\n outline: \"1px dotted #212121\"\n },\n display: \"flex !important\",\n flexDirection: \"column\"\n },\n \".cm-scroller\": {\n display: \"flex !important\",\n alignItems: \"flex-start !important\",\n fontFamily: \"monospace\",\n lineHeight: 1.4,\n height: \"100%\",\n overflowX: \"auto\",\n position: \"relative\",\n zIndex: 0\n },\n \".cm-content\": {\n margin: 0,\n flexGrow: 2,\n flexShrink: 0,\n display: \"block\",\n whiteSpace: \"pre\",\n wordWrap: \"normal\", // https://github.com/codemirror/dev/issues/456\n boxSizing: \"border-box\",\n minHeight: \"100%\",\n padding: \"4px 0\",\n outline: \"none\",\n \"&[contenteditable=true]\": {\n WebkitUserModify: \"read-write-plaintext-only\",\n }\n },\n \".cm-lineWrapping\": {\n whiteSpace_fallback: \"pre-wrap\", // For IE\n whiteSpace: \"break-spaces\",\n wordBreak: \"break-word\", // For Safari, which doesn't support overflow-wrap: anywhere\n overflowWrap: \"anywhere\",\n flexShrink: 1\n },\n \"&light .cm-content\": { caretColor: \"black\" },\n \"&dark .cm-content\": { caretColor: \"white\" },\n \".cm-line\": {\n display: \"block\",\n padding: \"0 2px 0 6px\"\n },\n \".cm-layer\": {\n position: \"absolute\",\n left: 0,\n top: 0,\n contain: \"size style\",\n \"& > *\": {\n position: \"absolute\"\n }\n },\n \"&light .cm-selectionBackground\": {\n background: \"#d9d9d9\"\n },\n \"&dark .cm-selectionBackground\": {\n background: \"#222\"\n },\n \"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground\": {\n background: \"#d7d4f0\"\n },\n \"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground\": {\n background: \"#233\"\n },\n \".cm-cursorLayer\": {\n pointerEvents: \"none\"\n },\n \"&.cm-focused > .cm-scroller > .cm-cursorLayer\": {\n animation: \"steps(1) cm-blink 1.2s infinite\"\n },\n // Two animations defined so that we can switch between them to\n // restart the animation without forcing another style\n // recomputation.\n \"@keyframes cm-blink\": { \"0%\": {}, \"50%\": { opacity: 0 }, \"100%\": {} },\n \"@keyframes cm-blink2\": { \"0%\": {}, \"50%\": { opacity: 0 }, \"100%\": {} },\n \".cm-cursor, .cm-dropCursor\": {\n borderLeft: \"1.2px solid black\",\n marginLeft: \"-0.6px\",\n pointerEvents: \"none\",\n },\n \".cm-cursor\": {\n display: \"none\"\n },\n \"&dark .cm-cursor\": {\n borderLeftColor: \"#444\"\n },\n \".cm-dropCursor\": {\n position: \"absolute\"\n },\n \"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor\": {\n display: \"block\"\n },\n \".cm-iso\": {\n unicodeBidi: \"isolate\"\n },\n \".cm-announced\": {\n position: \"fixed\",\n top: \"-10000px\"\n },\n \"@media print\": {\n \".cm-announced\": { display: \"none\" }\n },\n \"&light .cm-activeLine\": { backgroundColor: \"#cceeff44\" },\n \"&dark .cm-activeLine\": { backgroundColor: \"#99eeff33\" },\n \"&light .cm-specialChar\": { color: \"red\" },\n \"&dark .cm-specialChar\": { color: \"#f78\" },\n \".cm-gutters\": {\n flexShrink: 0,\n display: \"flex\",\n height: \"100%\",\n boxSizing: \"border-box\",\n insetInlineStart: 0,\n zIndex: 200\n },\n \"&light .cm-gutters\": {\n backgroundColor: \"#f5f5f5\",\n color: \"#6c6c6c\",\n borderRight: \"1px solid #ddd\"\n },\n \"&dark .cm-gutters\": {\n backgroundColor: \"#333338\",\n color: \"#ccc\"\n },\n \".cm-gutter\": {\n display: \"flex !important\", // Necessary -- prevents margin collapsing\n flexDirection: \"column\",\n flexShrink: 0,\n boxSizing: \"border-box\",\n minHeight: \"100%\",\n overflow: \"hidden\"\n },\n \".cm-gutterElement\": {\n boxSizing: \"border-box\"\n },\n \".cm-lineNumbers .cm-gutterElement\": {\n padding: \"0 3px 0 5px\",\n minWidth: \"20px\",\n textAlign: \"right\",\n whiteSpace: \"nowrap\"\n },\n \"&light .cm-activeLineGutter\": {\n backgroundColor: \"#e2f2ff\"\n },\n \"&dark .cm-activeLineGutter\": {\n backgroundColor: \"#222227\"\n },\n \".cm-panels\": {\n boxSizing: \"border-box\",\n position: \"sticky\",\n left: 0,\n right: 0\n },\n \"&light .cm-panels\": {\n backgroundColor: \"#f5f5f5\",\n color: \"black\"\n },\n \"&light .cm-panels-top\": {\n borderBottom: \"1px solid #ddd\"\n },\n \"&light .cm-panels-bottom\": {\n borderTop: \"1px solid #ddd\"\n },\n \"&dark .cm-panels\": {\n backgroundColor: \"#333338\",\n color: \"white\"\n },\n \".cm-tab\": {\n display: \"inline-block\",\n overflow: \"hidden\",\n verticalAlign: \"bottom\"\n },\n \".cm-widgetBuffer\": {\n verticalAlign: \"text-top\",\n height: \"1em\",\n width: 0,\n display: \"inline\"\n },\n \".cm-placeholder\": {\n color: \"#888\",\n display: \"inline-block\",\n verticalAlign: \"top\",\n },\n \".cm-highlightSpace:before\": {\n content: \"attr(data-display)\",\n position: \"absolute\",\n pointerEvents: \"none\",\n color: \"#888\"\n },\n \".cm-highlightTab\": {\n 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>')`,\n backgroundSize: \"auto 100%\",\n backgroundPosition: \"right 90%\",\n backgroundRepeat: \"no-repeat\"\n },\n \".cm-trailingSpace\": {\n backgroundColor: \"#ff332255\"\n },\n \".cm-button\": {\n verticalAlign: \"middle\",\n color: \"inherit\",\n fontSize: \"70%\",\n padding: \".2em 1em\",\n borderRadius: \"1px\"\n },\n \"&light .cm-button\": {\n backgroundImage: \"linear-gradient(#eff1f5, #d9d9df)\",\n border: \"1px solid #888\",\n \"&:active\": {\n backgroundImage: \"linear-gradient(#b4b4b4, #d0d3d6)\"\n }\n },\n \"&dark .cm-button\": {\n backgroundImage: \"linear-gradient(#393939, #111)\",\n border: \"1px solid #888\",\n \"&:active\": {\n backgroundImage: \"linear-gradient(#111, #333)\"\n }\n },\n \".cm-textfield\": {\n verticalAlign: \"middle\",\n color: \"inherit\",\n fontSize: \"70%\",\n border: \"1px solid silver\",\n padding: \".2em .5em\"\n },\n \"&light .cm-textfield\": {\n backgroundColor: \"white\"\n },\n \"&dark .cm-textfield\": {\n border: \"1px solid #555\",\n backgroundColor: \"inherit\"\n }\n }, lightDarkIDs);\n\n const LineBreakPlaceholder = \"\\uffff\";\n class DOMReader {\n constructor(points, state) {\n this.points = points;\n this.text = \"\";\n this.lineSeparator = state.facet(EditorState.lineSeparator);\n }\n append(text) {\n this.text += text;\n }\n lineBreak() {\n this.text += LineBreakPlaceholder;\n }\n readRange(start, end) {\n if (!start)\n return this;\n let parent = start.parentNode;\n for (let cur = start;;) {\n this.findPointBefore(parent, cur);\n let oldLen = this.text.length;\n this.readNode(cur);\n let next = cur.nextSibling;\n if (next == end)\n break;\n let view = ContentView.get(cur), nextView = ContentView.get(next);\n if (view && nextView ? view.breakAfter :\n (view ? view.breakAfter : isBlockElement(cur)) ||\n (isBlockElement(next) && (cur.nodeName != \"BR\" || cur.cmIgnore) && this.text.length > oldLen))\n this.lineBreak();\n cur = next;\n }\n this.findPointBefore(parent, end);\n return this;\n }\n readTextNode(node) {\n let text = node.nodeValue;\n for (let point of this.points)\n if (point.node == node)\n point.pos = this.text.length + Math.min(point.offset, text.length);\n for (let off = 0, re = this.lineSeparator ? null : /\\r\\n?|\\n/g;;) {\n let nextBreak = -1, breakSize = 1, m;\n if (this.lineSeparator) {\n nextBreak = text.indexOf(this.lineSeparator, off);\n breakSize = this.lineSeparator.length;\n }\n else if (m = re.exec(text)) {\n nextBreak = m.index;\n breakSize = m[0].length;\n }\n this.append(text.slice(off, nextBreak < 0 ? text.length : nextBreak));\n if (nextBreak < 0)\n break;\n this.lineBreak();\n if (breakSize > 1)\n for (let point of this.points)\n if (point.node == node && point.pos > this.text.length)\n point.pos -= breakSize - 1;\n off = nextBreak + breakSize;\n }\n }\n readNode(node) {\n if (node.cmIgnore)\n return;\n let view = ContentView.get(node);\n let fromView = view && view.overrideDOMText;\n if (fromView != null) {\n this.findPointInside(node, fromView.length);\n for (let i = fromView.iter(); !i.next().done;) {\n if (i.lineBreak)\n this.lineBreak();\n else\n this.append(i.value);\n }\n }\n else if (node.nodeType == 3) {\n this.readTextNode(node);\n }\n else if (node.nodeName == \"BR\") {\n if (node.nextSibling)\n this.lineBreak();\n }\n else if (node.nodeType == 1) {\n this.readRange(node.firstChild, null);\n }\n }\n findPointBefore(node, next) {\n for (let point of this.points)\n if (point.node == node && node.childNodes[point.offset] == next)\n point.pos = this.text.length;\n }\n findPointInside(node, length) {\n for (let point of this.points)\n if (node.nodeType == 3 ? point.node == node : node.contains(point.node))\n point.pos = this.text.length + (isAtEnd(node, point.node, point.offset) ? length : 0);\n }\n }\n function isAtEnd(parent, node, offset) {\n for (;;) {\n if (!node || offset < maxOffset(node))\n return false;\n if (node == parent)\n return true;\n offset = domIndex(node) + 1;\n node = node.parentNode;\n }\n }\n class DOMPoint {\n constructor(node, offset) {\n this.node = node;\n this.offset = offset;\n this.pos = -1;\n }\n }\n\n class DOMChange {\n constructor(view, start, end, typeOver) {\n this.typeOver = typeOver;\n this.bounds = null;\n this.text = \"\";\n this.domChanged = start > -1;\n let { impreciseHead: iHead, impreciseAnchor: iAnchor } = view.docView;\n if (view.state.readOnly && start > -1) {\n // Ignore changes when the editor is read-only\n this.newSel = null;\n }\n else if (start > -1 && (this.bounds = view.docView.domBoundsAround(start, end, 0))) {\n let selPoints = iHead || iAnchor ? [] : selectionPoints(view);\n let reader = new DOMReader(selPoints, view.state);\n reader.readRange(this.bounds.startDOM, this.bounds.endDOM);\n this.text = reader.text;\n this.newSel = selectionFromPoints(selPoints, this.bounds.from);\n }\n else {\n let domSel = view.observer.selectionRange;\n let head = iHead && iHead.node == domSel.focusNode && iHead.offset == domSel.focusOffset ||\n !contains$1(view.contentDOM, domSel.focusNode)\n ? view.state.selection.main.head\n : view.docView.posFromDOM(domSel.focusNode, domSel.focusOffset);\n let anchor = iAnchor && iAnchor.node == domSel.anchorNode && iAnchor.offset == domSel.anchorOffset ||\n !contains$1(view.contentDOM, domSel.anchorNode)\n ? view.state.selection.main.anchor\n : view.docView.posFromDOM(domSel.anchorNode, domSel.anchorOffset);\n // iOS will refuse to select the block gaps when doing\n // select-all.\n // Chrome will put the selection *inside* them, confusing\n // posFromDOM\n let vp = view.viewport;\n if ((browser.ios || browser.chrome) && view.state.selection.main.empty && head != anchor &&\n (vp.from > 0 || vp.to < view.state.doc.length)) {\n let from = Math.min(head, anchor), to = Math.max(head, anchor);\n let offFrom = vp.from - from, offTo = vp.to - to;\n if ((offFrom == 0 || offFrom == 1 || from == 0) && (offTo == 0 || offTo == -1 || to == view.state.doc.length)) {\n head = 0;\n anchor = view.state.doc.length;\n }\n }\n this.newSel = EditorSelection.single(anchor, head);\n }\n }\n }\n function applyDOMChange(view, domChange) {\n let change;\n let { newSel } = domChange, sel = view.state.selection.main;\n let lastKey = view.inputState.lastKeyTime > Date.now() - 100 ? view.inputState.lastKeyCode : -1;\n if (domChange.bounds) {\n let { from, to } = domChange.bounds;\n let preferredPos = sel.from, preferredSide = null;\n // Prefer anchoring to end when Backspace is pressed (or, on\n // Android, when something was deleted)\n if (lastKey === 8 || browser.android && domChange.text.length < to - from) {\n preferredPos = sel.to;\n preferredSide = \"end\";\n }\n let diff = findDiff(view.state.doc.sliceString(from, to, LineBreakPlaceholder), domChange.text, preferredPos - from, preferredSide);\n if (diff) {\n // Chrome inserts two newlines when pressing shift-enter at the\n // end of a line. DomChange drops one of those.\n if (browser.chrome && lastKey == 13 &&\n diff.toB == diff.from + 2 && domChange.text.slice(diff.from, diff.toB) == LineBreakPlaceholder + LineBreakPlaceholder)\n diff.toB--;\n change = { from: from + diff.from, to: from + diff.toA,\n insert: Text.of(domChange.text.slice(diff.from, diff.toB).split(LineBreakPlaceholder)) };\n }\n }\n else if (newSel && (!view.hasFocus && view.state.facet(editable) || newSel.main.eq(sel))) {\n newSel = null;\n }\n if (!change && !newSel)\n return false;\n if (!change && domChange.typeOver && !sel.empty && newSel && newSel.main.empty) {\n // Heuristic to notice typing over a selected character\n change = { from: sel.from, to: sel.to, insert: view.state.doc.slice(sel.from, sel.to) };\n }\n else if (change && change.from >= sel.from && change.to <= sel.to &&\n (change.from != sel.from || change.to != sel.to) &&\n (sel.to - sel.from) - (change.to - change.from) <= 4) {\n // If the change is inside the selection and covers most of it,\n // assume it is a selection replace (with identical characters at\n // the start/end not included in the diff)\n change = {\n from: sel.from, to: sel.to,\n insert: view.state.doc.slice(sel.from, change.from).append(change.insert).append(view.state.doc.slice(change.to, sel.to))\n };\n }\n else if ((browser.mac || browser.android) && change && change.from == change.to && change.from == sel.head - 1 &&\n /^\\. ?$/.test(change.insert.toString()) && view.contentDOM.getAttribute(\"autocorrect\") == \"off\") {\n // Detect insert-period-on-double-space Mac and Android behavior,\n // and transform it into a regular space insert.\n if (newSel && change.insert.length == 2)\n newSel = EditorSelection.single(newSel.main.anchor - 1, newSel.main.head - 1);\n change = { from: sel.from, to: sel.to, insert: Text.of([\" \"]) };\n }\n else if (browser.chrome && change && change.from == change.to && change.from == sel.head &&\n change.insert.toString() == \"\\n \" && view.lineWrapping) {\n // In Chrome, if you insert a space at the start of a wrapped\n // line, it will actually insert a newline and a space, causing a\n // bogus new line to be created in CodeMirror (#968)\n if (newSel)\n newSel = EditorSelection.single(newSel.main.anchor - 1, newSel.main.head - 1);\n change = { from: sel.from, to: sel.to, insert: Text.of([\" \"]) };\n }\n if (change) {\n return applyDOMChangeInner(view, change, newSel, lastKey);\n }\n else if (newSel && !newSel.main.eq(sel)) {\n let scrollIntoView = false, userEvent = \"select\";\n if (view.inputState.lastSelectionTime > Date.now() - 50) {\n if (view.inputState.lastSelectionOrigin == \"select\")\n scrollIntoView = true;\n userEvent = view.inputState.lastSelectionOrigin;\n }\n view.dispatch({ selection: newSel, scrollIntoView, userEvent });\n return true;\n }\n else {\n return false;\n }\n }\n function applyDOMChangeInner(view, change, newSel, lastKey = -1) {\n if (browser.ios && view.inputState.flushIOSKey(change))\n return true;\n let sel = view.state.selection.main;\n // Android browsers don't fire reasonable key events for enter,\n // backspace, or delete. So this detects changes that look like\n // they're caused by those keys, and reinterprets them as key\n // events. (Some of these keys are also handled by beforeinput\n // events and the pendingAndroidKey mechanism, but that's not\n // reliable in all situations.)\n if (browser.android &&\n ((change.to == sel.to &&\n // GBoard will sometimes remove a space it just inserted\n // after a completion when you press enter\n (change.from == sel.from || change.from == sel.from - 1 && view.state.sliceDoc(change.from, sel.from) == \" \") &&\n change.insert.length == 1 && change.insert.lines == 2 &&\n dispatchKey(view.contentDOM, \"Enter\", 13)) ||\n ((change.from == sel.from - 1 && change.to == sel.to && change.insert.length == 0 ||\n lastKey == 8 && change.insert.length < change.to - change.from && change.to > sel.head) &&\n dispatchKey(view.contentDOM, \"Backspace\", 8)) ||\n (change.from == sel.from && change.to == sel.to + 1 && change.insert.length == 0 &&\n dispatchKey(view.contentDOM, \"Delete\", 46))))\n return true;\n let text = change.insert.toString();\n if (view.inputState.composing >= 0)\n view.inputState.composing++;\n let defaultTr;\n let defaultInsert = () => defaultTr || (defaultTr = applyDefaultInsert(view, change, newSel));\n if (!view.state.facet(inputHandler$1).some(h => h(view, change.from, change.to, text, defaultInsert)))\n view.dispatch(defaultInsert());\n return true;\n }\n function applyDefaultInsert(view, change, newSel) {\n let tr, startState = view.state, sel = startState.selection.main;\n if (change.from >= sel.from && change.to <= sel.to && change.to - change.from >= (sel.to - sel.from) / 3 &&\n (!newSel || newSel.main.empty && newSel.main.from == change.from + change.insert.length) &&\n view.inputState.composing < 0) {\n let before = sel.from < change.from ? startState.sliceDoc(sel.from, change.from) : \"\";\n let after = sel.to > change.to ? startState.sliceDoc(change.to, sel.to) : \"\";\n tr = startState.replaceSelection(view.state.toText(before + change.insert.sliceString(0, undefined, view.state.lineBreak) + after));\n }\n else {\n let changes = startState.changes(change);\n let mainSel = newSel && newSel.main.to <= changes.newLength ? newSel.main : undefined;\n // Try to apply a composition change to all cursors\n if (startState.selection.ranges.length > 1 && view.inputState.composing >= 0 &&\n change.to <= sel.to && change.to >= sel.to - 10) {\n let replaced = view.state.sliceDoc(change.from, change.to);\n let compositionRange, composition = newSel && findCompositionNode(view, newSel.main.head);\n if (composition) {\n let dLen = change.insert.length - (change.to - change.from);\n compositionRange = { from: composition.from, to: composition.to - dLen };\n }\n else {\n compositionRange = view.state.doc.lineAt(sel.head);\n }\n let offset = sel.to - change.to, size = sel.to - sel.from;\n tr = startState.changeByRange(range => {\n if (range.from == sel.from && range.to == sel.to)\n return { changes, range: mainSel || range.map(changes) };\n let to = range.to - offset, from = to - replaced.length;\n if (range.to - range.from != size || view.state.sliceDoc(from, to) != replaced ||\n // Unfortunately, there's no way to make multiple\n // changes in the same node work without aborting\n // composition, so cursors in the composition range are\n // ignored.\n range.to >= compositionRange.from && range.from <= compositionRange.to)\n return { range };\n let rangeChanges = startState.changes({ from, to, insert: change.insert }), selOff = range.to - sel.to;\n return {\n changes: rangeChanges,\n range: !mainSel ? range.map(rangeChanges) :\n EditorSelection.range(Math.max(0, mainSel.anchor + selOff), Math.max(0, mainSel.head + selOff))\n };\n });\n }\n else {\n tr = {\n changes,\n selection: mainSel && startState.selection.replaceRange(mainSel)\n };\n }\n }\n let userEvent = \"input.type\";\n if (view.composing ||\n view.inputState.compositionPendingChange && view.inputState.compositionEndedAt > Date.now() - 50) {\n view.inputState.compositionPendingChange = false;\n userEvent += \".compose\";\n if (view.inputState.compositionFirstChange) {\n userEvent += \".start\";\n view.inputState.compositionFirstChange = false;\n }\n }\n return startState.update(tr, { userEvent, scrollIntoView: true });\n }\n function findDiff(a, b, preferredPos, preferredSide) {\n let minLen = Math.min(a.length, b.length);\n let from = 0;\n while (from < minLen && a.charCodeAt(from) == b.charCodeAt(from))\n from++;\n if (from == minLen && a.length == b.length)\n return null;\n let toA = a.length, toB = b.length;\n while (toA > 0 && toB > 0 && a.charCodeAt(toA - 1) == b.charCodeAt(toB - 1)) {\n toA--;\n toB--;\n }\n if (preferredSide == \"end\") {\n let adjust = Math.max(0, from - Math.min(toA, toB));\n preferredPos -= toA + adjust - from;\n }\n if (toA < from && a.length < b.length) {\n let move = preferredPos <= from && preferredPos >= toA ? from - preferredPos : 0;\n from -= move;\n toB = from + (toB - toA);\n toA = from;\n }\n else if (toB < from) {\n let move = preferredPos <= from && preferredPos >= toB ? from - preferredPos : 0;\n from -= move;\n toA = from + (toA - toB);\n toB = from;\n }\n return { from, toA, toB };\n }\n function selectionPoints(view) {\n let result = [];\n if (view.root.activeElement != view.contentDOM)\n return result;\n let { anchorNode, anchorOffset, focusNode, focusOffset } = view.observer.selectionRange;\n if (anchorNode) {\n result.push(new DOMPoint(anchorNode, anchorOffset));\n if (focusNode != anchorNode || focusOffset != anchorOffset)\n result.push(new DOMPoint(focusNode, focusOffset));\n }\n return result;\n }\n function selectionFromPoints(points, base) {\n if (points.length == 0)\n return null;\n let anchor = points[0].pos, head = points.length == 2 ? points[1].pos : anchor;\n return anchor > -1 && head > -1 ? EditorSelection.single(anchor + base, head + base) : null;\n }\n\n const observeOptions = {\n childList: true,\n characterData: true,\n subtree: true,\n attributes: true,\n characterDataOldValue: true\n };\n // IE11 has very broken mutation observers, so we also listen to\n // DOMCharacterDataModified there\n const useCharData = browser.ie && browser.ie_version <= 11;\n class DOMObserver {\n constructor(view) {\n this.view = view;\n this.active = false;\n this.editContext = null;\n // The known selection. Kept in our own object, as opposed to just\n // directly accessing the selection because:\n // - Safari doesn't report the right selection in shadow DOM\n // - Reading from the selection forces a DOM layout\n // - This way, we can ignore selectionchange events if we have\n // already seen the 'new' selection\n this.selectionRange = new DOMSelectionState;\n // Set when a selection change is detected, cleared on flush\n this.selectionChanged = false;\n this.delayedFlush = -1;\n this.resizeTimeout = -1;\n this.queue = [];\n this.delayedAndroidKey = null;\n this.flushingAndroidKey = -1;\n this.lastChange = 0;\n this.scrollTargets = [];\n this.intersection = null;\n this.resizeScroll = null;\n this.intersecting = false;\n this.gapIntersection = null;\n this.gaps = [];\n this.printQuery = null;\n // Timeout for scheduling check of the parents that need scroll handlers\n this.parentCheck = -1;\n this.dom = view.contentDOM;\n this.observer = new MutationObserver(mutations => {\n for (let mut of mutations)\n this.queue.push(mut);\n // IE11 will sometimes (on typing over a selection or\n // backspacing out a single character text node) call the\n // observer callback before actually updating the DOM.\n //\n // Unrelatedly, iOS Safari will, when ending a composition,\n // sometimes first clear it, deliver the mutations, and then\n // reinsert the finished text. CodeMirror's handling of the\n // deletion will prevent the reinsertion from happening,\n // breaking composition.\n if ((browser.ie && browser.ie_version <= 11 || browser.ios && view.composing) &&\n mutations.some(m => m.type == \"childList\" && m.removedNodes.length ||\n m.type == \"characterData\" && m.oldValue.length > m.target.nodeValue.length))\n this.flushSoon();\n else\n this.flush();\n });\n if (window.EditContext && view.constructor.EDIT_CONTEXT !== false &&\n // Chrome <126 doesn't support inverted selections in edit context (#1392)\n !(browser.chrome && browser.chrome_version < 126)) {\n this.editContext = new EditContextManager(view);\n if (view.state.facet(editable))\n view.contentDOM.editContext = this.editContext.editContext;\n }\n if (useCharData)\n this.onCharData = (event) => {\n this.queue.push({ target: event.target,\n type: \"characterData\",\n oldValue: event.prevValue });\n this.flushSoon();\n };\n this.onSelectionChange = this.onSelectionChange.bind(this);\n this.onResize = this.onResize.bind(this);\n this.onPrint = this.onPrint.bind(this);\n this.onScroll = this.onScroll.bind(this);\n if (window.matchMedia)\n this.printQuery = window.matchMedia(\"print\");\n if (typeof ResizeObserver == \"function\") {\n this.resizeScroll = new ResizeObserver(() => {\n var _a;\n if (((_a = this.view.docView) === null || _a === void 0 ? void 0 : _a.lastUpdate) < Date.now() - 75)\n this.onResize();\n });\n this.resizeScroll.observe(view.scrollDOM);\n }\n this.addWindowListeners(this.win = view.win);\n this.start();\n if (typeof IntersectionObserver == \"function\") {\n this.intersection = new IntersectionObserver(entries => {\n if (this.parentCheck < 0)\n this.parentCheck = setTimeout(this.listenForScroll.bind(this), 1000);\n if (entries.length > 0 && (entries[entries.length - 1].intersectionRatio > 0) != this.intersecting) {\n this.intersecting = !this.intersecting;\n if (this.intersecting != this.view.inView)\n this.onScrollChanged(document.createEvent(\"Event\"));\n }\n }, { threshold: [0, .001] });\n this.intersection.observe(this.dom);\n this.gapIntersection = new IntersectionObserver(entries => {\n if (entries.length > 0 && entries[entries.length - 1].intersectionRatio > 0)\n this.onScrollChanged(document.createEvent(\"Event\"));\n }, {});\n }\n this.listenForScroll();\n this.readSelectionRange();\n }\n onScrollChanged(e) {\n this.view.inputState.runHandlers(\"scroll\", e);\n if (this.intersecting)\n this.view.measure();\n }\n onScroll(e) {\n if (this.intersecting)\n this.flush(false);\n if (this.editContext)\n this.view.requestMeasure(this.editContext.measureReq);\n this.onScrollChanged(e);\n }\n onResize() {\n if (this.resizeTimeout < 0)\n this.resizeTimeout = setTimeout(() => {\n this.resizeTimeout = -1;\n this.view.requestMeasure();\n }, 50);\n }\n onPrint(event) {\n if ((event.type == \"change\" || !event.type) && !event.matches)\n return;\n this.view.viewState.printing = true;\n this.view.measure();\n setTimeout(() => {\n this.view.viewState.printing = false;\n this.view.requestMeasure();\n }, 500);\n }\n updateGaps(gaps) {\n if (this.gapIntersection && (gaps.length != this.gaps.length || this.gaps.some((g, i) => g != gaps[i]))) {\n this.gapIntersection.disconnect();\n for (let gap of gaps)\n this.gapIntersection.observe(gap);\n this.gaps = gaps;\n }\n }\n onSelectionChange(event) {\n let wasChanged = this.selectionChanged;\n if (!this.readSelectionRange() || this.delayedAndroidKey)\n return;\n let { view } = this, sel = this.selectionRange;\n if (view.state.facet(editable) ? view.root.activeElement != this.dom : !hasSelection(view.dom, sel))\n return;\n let context = sel.anchorNode && view.docView.nearest(sel.anchorNode);\n if (context && context.ignoreEvent(event)) {\n if (!wasChanged)\n this.selectionChanged = false;\n return;\n }\n // Deletions on IE11 fire their events in the wrong order, giving\n // us a selection change event before the DOM changes are\n // reported.\n // Chrome Android has a similar issue when backspacing out a\n // selection (#645).\n if ((browser.ie && browser.ie_version <= 11 || browser.android && browser.chrome) && !view.state.selection.main.empty &&\n // (Selection.isCollapsed isn't reliable on IE)\n sel.focusNode && isEquivalentPosition(sel.focusNode, sel.focusOffset, sel.anchorNode, sel.anchorOffset))\n this.flushSoon();\n else\n this.flush(false);\n }\n readSelectionRange() {\n let { view } = this;\n // The Selection object is broken in shadow roots in Safari. See\n // https://github.com/codemirror/dev/issues/414\n let selection = getSelection(view.root);\n if (!selection)\n return false;\n let range = browser.safari && view.root.nodeType == 11 &&\n deepActiveElement(this.dom.ownerDocument) == this.dom &&\n safariSelectionRangeHack(this.view, selection) || selection;\n if (!range || this.selectionRange.eq(range))\n return false;\n let local = hasSelection(this.dom, range);\n // Detect the situation where the browser has, on focus, moved the\n // selection to the start of the content element. Reset it to the\n // position from the editor state.\n if (local && !this.selectionChanged &&\n view.inputState.lastFocusTime > Date.now() - 200 &&\n view.inputState.lastTouchTime < Date.now() - 300 &&\n atElementStart(this.dom, range)) {\n this.view.inputState.lastFocusTime = 0;\n view.docView.updateSelection();\n return false;\n }\n this.selectionRange.setRange(range);\n if (local)\n this.selectionChanged = true;\n return true;\n }\n setSelectionRange(anchor, head) {\n this.selectionRange.set(anchor.node, anchor.offset, head.node, head.offset);\n this.selectionChanged = false;\n }\n clearSelectionRange() {\n this.selectionRange.set(null, 0, null, 0);\n }\n listenForScroll() {\n this.parentCheck = -1;\n let i = 0, changed = null;\n for (let dom = this.dom; dom;) {\n if (dom.nodeType == 1) {\n if (!changed && i < this.scrollTargets.length && this.scrollTargets[i] == dom)\n i++;\n else if (!changed)\n changed = this.scrollTargets.slice(0, i);\n if (changed)\n changed.push(dom);\n dom = dom.assignedSlot || dom.parentNode;\n }\n else if (dom.nodeType == 11) { // Shadow root\n dom = dom.host;\n }\n else {\n break;\n }\n }\n if (i < this.scrollTargets.length && !changed)\n changed = this.scrollTargets.slice(0, i);\n if (changed) {\n for (let dom of this.scrollTargets)\n dom.removeEventListener(\"scroll\", this.onScroll);\n for (let dom of this.scrollTargets = changed)\n dom.addEventListener(\"scroll\", this.onScroll);\n }\n }\n ignore(f) {\n if (!this.active)\n return f();\n try {\n this.stop();\n return f();\n }\n finally {\n this.start();\n this.clear();\n }\n }\n start() {\n if (this.active)\n return;\n this.observer.observe(this.dom, observeOptions);\n if (useCharData)\n this.dom.addEventListener(\"DOMCharacterDataModified\", this.onCharData);\n this.active = true;\n }\n stop() {\n if (!this.active)\n return;\n this.active = false;\n this.observer.disconnect();\n if (useCharData)\n this.dom.removeEventListener(\"DOMCharacterDataModified\", this.onCharData);\n }\n // Throw away any pending changes\n clear() {\n this.processRecords();\n this.queue.length = 0;\n this.selectionChanged = false;\n }\n // Chrome Android, especially in combination with GBoard, not only\n // doesn't reliably fire regular key events, but also often\n // surrounds the effect of enter or backspace with a bunch of\n // composition events that, when interrupted, cause text duplication\n // or other kinds of corruption. This hack makes the editor back off\n // from handling DOM changes for a moment when such a key is\n // detected (via beforeinput or keydown), and then tries to flush\n // them or, if that has no effect, dispatches the given key.\n delayAndroidKey(key, keyCode) {\n var _a;\n if (!this.delayedAndroidKey) {\n let flush = () => {\n let key = this.delayedAndroidKey;\n if (key) {\n this.clearDelayedAndroidKey();\n this.view.inputState.lastKeyCode = key.keyCode;\n this.view.inputState.lastKeyTime = Date.now();\n let flushed = this.flush();\n if (!flushed && key.force)\n dispatchKey(this.dom, key.key, key.keyCode);\n }\n };\n this.flushingAndroidKey = this.view.win.requestAnimationFrame(flush);\n }\n // Since backspace beforeinput is sometimes signalled spuriously,\n // Enter always takes precedence.\n if (!this.delayedAndroidKey || key == \"Enter\")\n this.delayedAndroidKey = {\n key, keyCode,\n // Only run the key handler when no changes are detected if\n // this isn't coming right after another change, in which case\n // it is probably part of a weird chain of updates, and should\n // be ignored if it returns the DOM to its previous state.\n force: this.lastChange < Date.now() - 50 || !!((_a = this.delayedAndroidKey) === null || _a === void 0 ? void 0 : _a.force)\n };\n }\n clearDelayedAndroidKey() {\n this.win.cancelAnimationFrame(this.flushingAndroidKey);\n this.delayedAndroidKey = null;\n this.flushingAndroidKey = -1;\n }\n flushSoon() {\n if (this.delayedFlush < 0)\n this.delayedFlush = this.view.win.requestAnimationFrame(() => { this.delayedFlush = -1; this.flush(); });\n }\n forceFlush() {\n if (this.delayedFlush >= 0) {\n this.view.win.cancelAnimationFrame(this.delayedFlush);\n this.delayedFlush = -1;\n }\n this.flush();\n }\n pendingRecords() {\n for (let mut of this.observer.takeRecords())\n this.queue.push(mut);\n return this.queue;\n }\n processRecords() {\n let records = this.pendingRecords();\n if (records.length)\n this.queue = [];\n let from = -1, to = -1, typeOver = false;\n for (let record of records) {\n let range = this.readMutation(record);\n if (!range)\n continue;\n if (range.typeOver)\n typeOver = true;\n if (from == -1) {\n ({ from, to } = range);\n }\n else {\n from = Math.min(range.from, from);\n to = Math.max(range.to, to);\n }\n }\n return { from, to, typeOver };\n }\n readChange() {\n let { from, to, typeOver } = this.processRecords();\n let newSel = this.selectionChanged && hasSelection(this.dom, this.selectionRange);\n if (from < 0 && !newSel)\n return null;\n if (from > -1)\n this.lastChange = Date.now();\n this.view.inputState.lastFocusTime = 0;\n this.selectionChanged = false;\n let change = new DOMChange(this.view, from, to, typeOver);\n this.view.docView.domChanged = { newSel: change.newSel ? change.newSel.main : null };\n return change;\n }\n // Apply pending changes, if any\n flush(readSelection = true) {\n // Completely hold off flushing when pending keys are set\u2014the code\n // managing those will make sure processRecords is called and the\n // view is resynchronized after\n if (this.delayedFlush >= 0 || this.delayedAndroidKey)\n return false;\n if (readSelection)\n this.readSelectionRange();\n let domChange = this.readChange();\n if (!domChange) {\n this.view.requestMeasure();\n return false;\n }\n let startState = this.view.state;\n let handled = applyDOMChange(this.view, domChange);\n // The view wasn't updated but DOM/selection changes were seen. Reset the view.\n if (this.view.state == startState &&\n (domChange.domChanged || domChange.newSel && !domChange.newSel.main.eq(this.view.state.selection.main)))\n this.view.update([]);\n return handled;\n }\n readMutation(rec) {\n let cView = this.view.docView.nearest(rec.target);\n if (!cView || cView.ignoreMutation(rec))\n return null;\n cView.markDirty(rec.type == \"attributes\");\n if (rec.type == \"attributes\")\n cView.flags |= 4 /* ViewFlag.AttrsDirty */;\n if (rec.type == \"childList\") {\n let childBefore = findChild(cView, rec.previousSibling || rec.target.previousSibling, -1);\n let childAfter = findChild(cView, rec.nextSibling || rec.target.nextSibling, 1);\n return { from: childBefore ? cView.posAfter(childBefore) : cView.posAtStart,\n to: childAfter ? cView.posBefore(childAfter) : cView.posAtEnd, typeOver: false };\n }\n else if (rec.type == \"characterData\") {\n return { from: cView.posAtStart, to: cView.posAtEnd, typeOver: rec.target.nodeValue == rec.oldValue };\n }\n else {\n return null;\n }\n }\n setWindow(win) {\n if (win != this.win) {\n this.removeWindowListeners(this.win);\n this.win = win;\n this.addWindowListeners(this.win);\n }\n }\n addWindowListeners(win) {\n win.addEventListener(\"resize\", this.onResize);\n if (this.printQuery) {\n if (this.printQuery.addEventListener)\n this.printQuery.addEventListener(\"change\", this.onPrint);\n else\n this.printQuery.addListener(this.onPrint);\n }\n else\n win.addEventListener(\"beforeprint\", this.onPrint);\n win.addEventListener(\"scroll\", this.onScroll);\n win.document.addEventListener(\"selectionchange\", this.onSelectionChange);\n }\n removeWindowListeners(win) {\n win.removeEventListener(\"scroll\", this.onScroll);\n win.removeEventListener(\"resize\", this.onResize);\n if (this.printQuery) {\n if (this.printQuery.removeEventListener)\n this.printQuery.removeEventListener(\"change\", this.onPrint);\n else\n this.printQuery.removeListener(this.onPrint);\n }\n else\n win.removeEventListener(\"beforeprint\", this.onPrint);\n win.document.removeEventListener(\"selectionchange\", this.onSelectionChange);\n }\n update(update) {\n if (this.editContext) {\n this.editContext.update(update);\n if (update.startState.facet(editable) != update.state.facet(editable))\n update.view.contentDOM.editContext = update.state.facet(editable) ? this.editContext.editContext : null;\n }\n }\n destroy() {\n var _a, _b, _c;\n this.stop();\n (_a = this.intersection) === null || _a === void 0 ? void 0 : _a.disconnect();\n (_b = this.gapIntersection) === null || _b === void 0 ? void 0 : _b.disconnect();\n (_c = this.resizeScroll) === null || _c === void 0 ? void 0 : _c.disconnect();\n for (let dom of this.scrollTargets)\n dom.removeEventListener(\"scroll\", this.onScroll);\n this.removeWindowListeners(this.win);\n clearTimeout(this.parentCheck);\n clearTimeout(this.resizeTimeout);\n this.win.cancelAnimationFrame(this.delayedFlush);\n this.win.cancelAnimationFrame(this.flushingAndroidKey);\n if (this.editContext) {\n this.view.contentDOM.editContext = null;\n this.editContext.destroy();\n }\n }\n }\n function findChild(cView, dom, dir) {\n while (dom) {\n let curView = ContentView.get(dom);\n if (curView && curView.parent == cView)\n return curView;\n let parent = dom.parentNode;\n dom = parent != cView.dom ? parent : dir > 0 ? dom.nextSibling : dom.previousSibling;\n }\n return null;\n }\n function buildSelectionRangeFromRange(view, range) {\n let anchorNode = range.startContainer, anchorOffset = range.startOffset;\n let focusNode = range.endContainer, focusOffset = range.endOffset;\n let curAnchor = view.docView.domAtPos(view.state.selection.main.anchor);\n // Since such a range doesn't distinguish between anchor and head,\n // use a heuristic that flips it around if its end matches the\n // current anchor.\n if (isEquivalentPosition(curAnchor.node, curAnchor.offset, focusNode, focusOffset))\n [anchorNode, anchorOffset, focusNode, focusOffset] = [focusNode, focusOffset, anchorNode, anchorOffset];\n return { anchorNode, anchorOffset, focusNode, focusOffset };\n }\n // Used to work around a Safari Selection/shadow DOM bug (#414)\n function safariSelectionRangeHack(view, selection) {\n if (selection.getComposedRanges) {\n let range = selection.getComposedRanges(view.root)[0];\n if (range)\n return buildSelectionRangeFromRange(view, range);\n }\n let found = null;\n // Because Safari (at least in 2018-2021) doesn't provide regular\n // access to the selection inside a shadowroot, we have to perform a\n // ridiculous hack to get at it\u2014using `execCommand` to trigger a\n // `beforeInput` event so that we can read the target range from the\n // event.\n function read(event) {\n event.preventDefault();\n event.stopImmediatePropagation();\n found = event.getTargetRanges()[0];\n }\n view.contentDOM.addEventListener(\"beforeinput\", read, true);\n view.dom.ownerDocument.execCommand(\"indent\");\n view.contentDOM.removeEventListener(\"beforeinput\", read, true);\n return found ? buildSelectionRangeFromRange(view, found) : null;\n }\n class EditContextManager {\n constructor(view) {\n // The document window for which the text in the context is\n // maintained. For large documents, this may be smaller than the\n // editor document. This window always includes the selection head.\n this.from = 0;\n this.to = 0;\n // When applying a transaction, this is used to compare the change\n // made to the context content to the change in the transaction in\n // order to make the minimal changes to the context (since touching\n // that sometimes breaks series of multiple edits made for a single\n // user action on some Android keyboards)\n this.pendingContextChange = null;\n this.handlers = Object.create(null);\n this.resetRange(view.state);\n let context = this.editContext = new window.EditContext({\n text: view.state.doc.sliceString(this.from, this.to),\n selectionStart: this.toContextPos(Math.max(this.from, Math.min(this.to, view.state.selection.main.anchor))),\n selectionEnd: this.toContextPos(view.state.selection.main.head)\n });\n this.handlers.textupdate = e => {\n let { anchor } = view.state.selection.main;\n let change = { from: this.toEditorPos(e.updateRangeStart),\n to: this.toEditorPos(e.updateRangeEnd),\n insert: Text.of(e.text.split(\"\\n\")) };\n // If the window doesn't include the anchor, assume changes\n // adjacent to a side go up to the anchor.\n if (change.from == this.from && anchor < this.from)\n change.from = anchor;\n else if (change.to == this.to && anchor > this.to)\n change.to = anchor;\n // Edit contexts sometimes fire empty changes\n if (change.from == change.to && !change.insert.length)\n return;\n this.pendingContextChange = change;\n if (!view.state.readOnly)\n applyDOMChangeInner(view, change, EditorSelection.single(this.toEditorPos(e.selectionStart), this.toEditorPos(e.selectionEnd)));\n // If the transaction didn't flush our change, revert it so\n // that the context is in sync with the editor state again.\n if (this.pendingContextChange) {\n this.revertPending(view.state);\n this.setSelection(view.state);\n }\n };\n this.handlers.characterboundsupdate = e => {\n let rects = [], prev = null;\n for (let i = this.toEditorPos(e.rangeStart), end = this.toEditorPos(e.rangeEnd); i < end; i++) {\n let rect = view.coordsForChar(i);\n prev = (rect && new DOMRect(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top))\n || prev || new DOMRect;\n rects.push(prev);\n }\n context.updateCharacterBounds(e.rangeStart, rects);\n };\n this.handlers.textformatupdate = e => {\n let deco = [];\n for (let format of e.getTextFormats()) {\n let lineStyle = format.underlineStyle, thickness = format.underlineThickness;\n if (lineStyle != \"None\" && thickness != \"None\") {\n let style = `text-decoration: underline ${lineStyle == \"Dashed\" ? \"dashed \" : lineStyle == \"Squiggle\" ? \"wavy \" : \"\"}${thickness == \"Thin\" ? 1 : 2}px`;\n deco.push(Decoration.mark({ attributes: { style } })\n .range(this.toEditorPos(format.rangeStart), this.toEditorPos(format.rangeEnd)));\n }\n }\n view.dispatch({ effects: setEditContextFormatting.of(Decoration.set(deco)) });\n };\n this.handlers.compositionstart = () => {\n if (view.inputState.composing < 0) {\n view.inputState.composing = 0;\n view.inputState.compositionFirstChange = true;\n }\n };\n this.handlers.compositionend = () => {\n view.inputState.composing = -1;\n view.inputState.compositionFirstChange = null;\n };\n for (let event in this.handlers)\n context.addEventListener(event, this.handlers[event]);\n this.measureReq = { read: view => {\n this.editContext.updateControlBounds(view.contentDOM.getBoundingClientRect());\n let sel = getSelection(view.root);\n if (sel && sel.rangeCount)\n this.editContext.updateSelectionBounds(sel.getRangeAt(0).getBoundingClientRect());\n } };\n }\n applyEdits(update) {\n let off = 0, abort = false, pending = this.pendingContextChange;\n update.changes.iterChanges((fromA, toA, _fromB, _toB, insert) => {\n if (abort)\n return;\n let dLen = insert.length - (toA - fromA);\n if (pending && toA >= pending.to) {\n if (pending.from == fromA && pending.to == toA && pending.insert.eq(insert)) {\n pending = this.pendingContextChange = null; // Match\n off += dLen;\n this.to += dLen;\n return;\n }\n else { // Mismatch, revert\n pending = null;\n this.revertPending(update.state);\n }\n }\n fromA += off;\n toA += off;\n if (toA <= this.from) { // Before the window\n this.from += dLen;\n this.to += dLen;\n }\n else if (fromA < this.to) { // Overlaps with window\n if (fromA < this.from || toA > this.to || (this.to - this.from) + insert.length > 30000 /* CxVp.MaxSize */) {\n abort = true;\n return;\n }\n this.editContext.updateText(this.toContextPos(fromA), this.toContextPos(toA), insert.toString());\n this.to += dLen;\n }\n off += dLen;\n });\n if (pending && !abort)\n this.revertPending(update.state);\n return !abort;\n }\n update(update) {\n let reverted = this.pendingContextChange;\n if (!this.applyEdits(update) || !this.rangeIsValid(update.state)) {\n this.pendingContextChange = null;\n this.resetRange(update.state);\n this.editContext.updateText(0, this.editContext.text.length, update.state.doc.sliceString(this.from, this.to));\n this.setSelection(update.state);\n }\n else if (update.docChanged || update.selectionSet || reverted) {\n this.setSelection(update.state);\n }\n if (update.geometryChanged || update.docChanged || update.selectionSet)\n update.view.requestMeasure(this.measureReq);\n }\n resetRange(state) {\n let { head } = state.selection.main;\n this.from = Math.max(0, head - 10000 /* CxVp.Margin */);\n this.to = Math.min(state.doc.length, head + 10000 /* CxVp.Margin */);\n }\n revertPending(state) {\n let pending = this.pendingContextChange;\n this.pendingContextChange = null;\n this.editContext.updateText(this.toContextPos(pending.from), this.toContextPos(pending.from + pending.insert.length), state.doc.sliceString(pending.from, pending.to));\n }\n setSelection(state) {\n let { main } = state.selection;\n let start = this.toContextPos(Math.max(this.from, Math.min(this.to, main.anchor)));\n let end = this.toContextPos(main.head);\n if (this.editContext.selectionStart != start || this.editContext.selectionEnd != end)\n this.editContext.updateSelection(start, end);\n }\n rangeIsValid(state) {\n let { head } = state.selection.main;\n return !(this.from > 0 && head - this.from < 500 /* CxVp.MinMargin */ ||\n this.to < state.doc.length && this.to - head < 500 /* CxVp.MinMargin */ ||\n this.to - this.from > 10000 /* CxVp.Margin */ * 3);\n }\n toEditorPos(contextPos) { return contextPos + this.from; }\n toContextPos(editorPos) { return editorPos - this.from; }\n destroy() {\n for (let event in this.handlers)\n this.editContext.removeEventListener(event, this.handlers[event]);\n }\n }\n\n // The editor's update state machine looks something like this:\n //\n // Idle \u2192 Updating \u21C6 Idle (unchecked) \u2192 Measuring \u2192 Idle\n // \u2191 \u2193\n // Updating (measure)\n //\n // The difference between 'Idle' and 'Idle (unchecked)' lies in\n // whether a layout check has been scheduled. A regular update through\n // the `update` method updates the DOM in a write-only fashion, and\n // relies on a check (scheduled with `requestAnimationFrame`) to make\n // sure everything is where it should be and the viewport covers the\n // visible code. That check continues to measure and then optionally\n // update until it reaches a coherent state.\n /**\n An editor view represents the editor's user interface. It holds\n the editable DOM surface, and possibly other elements such as the\n line number gutter. It handles events and dispatches state\n transactions for editing actions.\n */\n class EditorView {\n /**\n The current editor state.\n */\n get state() { return this.viewState.state; }\n /**\n To be able to display large documents without consuming too much\n memory or overloading the browser, CodeMirror only draws the\n code that is visible (plus a margin around it) to the DOM. This\n property tells you the extent of the current drawn viewport, in\n document positions.\n */\n get viewport() { return this.viewState.viewport; }\n /**\n When there are, for example, large collapsed ranges in the\n viewport, its size can be a lot bigger than the actual visible\n content. Thus, if you are doing something like styling the\n content in the viewport, it is preferable to only do so for\n these ranges, which are the subset of the viewport that is\n actually drawn.\n */\n get visibleRanges() { return this.viewState.visibleRanges; }\n /**\n Returns false when the editor is entirely scrolled out of view\n or otherwise hidden.\n */\n get inView() { return this.viewState.inView; }\n /**\n Indicates whether the user is currently composing text via\n [IME](https://en.wikipedia.org/wiki/Input_method), and at least\n one change has been made in the current composition.\n */\n get composing() { return this.inputState.composing > 0; }\n /**\n Indicates whether the user is currently in composing state. Note\n that on some platforms, like Android, this will be the case a\n lot, since just putting the cursor on a word starts a\n composition there.\n */\n get compositionStarted() { return this.inputState.composing >= 0; }\n /**\n The document or shadow root that the view lives in.\n */\n get root() { return this._root; }\n /**\n @internal\n */\n get win() { return this.dom.ownerDocument.defaultView || window; }\n /**\n Construct a new view. You'll want to either provide a `parent`\n option, or put `view.dom` into your document after creating a\n view, so that the user can see the editor.\n */\n constructor(config = {}) {\n this.plugins = [];\n this.pluginMap = new Map;\n this.editorAttrs = {};\n this.contentAttrs = {};\n this.bidiCache = [];\n this.destroyed = false;\n /**\n @internal\n */\n this.updateState = 2 /* UpdateState.Updating */;\n /**\n @internal\n */\n this.measureScheduled = -1;\n /**\n @internal\n */\n this.measureRequests = [];\n this.contentDOM = document.createElement(\"div\");\n this.scrollDOM = document.createElement(\"div\");\n this.scrollDOM.tabIndex = -1;\n this.scrollDOM.className = \"cm-scroller\";\n this.scrollDOM.appendChild(this.contentDOM);\n this.announceDOM = document.createElement(\"div\");\n this.announceDOM.className = \"cm-announced\";\n this.announceDOM.setAttribute(\"aria-live\", \"polite\");\n this.dom = document.createElement(\"div\");\n this.dom.appendChild(this.announceDOM);\n this.dom.appendChild(this.scrollDOM);\n if (config.parent)\n config.parent.appendChild(this.dom);\n let { dispatch } = config;\n this.dispatchTransactions = config.dispatchTransactions ||\n (dispatch && ((trs) => trs.forEach(tr => dispatch(tr, this)))) ||\n ((trs) => this.update(trs));\n this.dispatch = this.dispatch.bind(this);\n this._root = (config.root || getRoot(config.parent) || document);\n this.viewState = new ViewState(config.state || EditorState.create(config));\n if (config.scrollTo && config.scrollTo.is(scrollIntoView$1))\n this.viewState.scrollTarget = config.scrollTo.value.clip(this.viewState.state);\n this.plugins = this.state.facet(viewPlugin).map(spec => new PluginInstance(spec));\n for (let plugin of this.plugins)\n plugin.update(this);\n this.observer = new DOMObserver(this);\n this.inputState = new InputState(this);\n this.inputState.ensureHandlers(this.plugins);\n this.docView = new DocView(this);\n this.mountStyles();\n this.updateAttrs();\n this.updateState = 0 /* UpdateState.Idle */;\n this.requestMeasure();\n }\n dispatch(...input) {\n let trs = input.length == 1 && input[0] instanceof Transaction ? input\n : input.length == 1 && Array.isArray(input[0]) ? input[0]\n : [this.state.update(...input)];\n this.dispatchTransactions(trs, this);\n }\n /**\n Update the view for the given array of transactions. This will\n update the visible document and selection to match the state\n produced by the transactions, and notify view plugins of the\n change. You should usually call\n [`dispatch`](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) instead, which uses this\n as a primitive.\n */\n update(transactions) {\n if (this.updateState != 0 /* UpdateState.Idle */)\n throw new Error(\"Calls to EditorView.update are not allowed while an update is in progress\");\n let redrawn = false, attrsChanged = false, update;\n let state = this.state;\n for (let tr of transactions) {\n if (tr.startState != state)\n throw new RangeError(\"Trying to update state with a transaction that doesn't start from the previous state.\");\n state = tr.state;\n }\n if (this.destroyed) {\n this.viewState.state = state;\n return;\n }\n let focus = this.hasFocus, focusFlag = 0, dispatchFocus = null;\n if (transactions.some(tr => tr.annotation(isFocusChange))) {\n this.inputState.notifiedFocused = focus;\n // If a focus-change transaction is being dispatched, set this update flag.\n focusFlag = 1 /* UpdateFlag.Focus */;\n }\n else if (focus != this.inputState.notifiedFocused) {\n this.inputState.notifiedFocused = focus;\n // Schedule a separate focus transaction if necessary, otherwise\n // add a flag to this update\n dispatchFocus = focusChangeTransaction(state, focus);\n if (!dispatchFocus)\n focusFlag = 1 /* UpdateFlag.Focus */;\n }\n // If there was a pending DOM change, eagerly read it and try to\n // apply it after the given transactions.\n let pendingKey = this.observer.delayedAndroidKey, domChange = null;\n if (pendingKey) {\n this.observer.clearDelayedAndroidKey();\n domChange = this.observer.readChange();\n // Only try to apply DOM changes if the transactions didn't\n // change the doc or selection.\n if (domChange && !this.state.doc.eq(state.doc) || !this.state.selection.eq(state.selection))\n domChange = null;\n }\n else {\n this.observer.clear();\n }\n // When the phrases change, redraw the editor\n if (state.facet(EditorState.phrases) != this.state.facet(EditorState.phrases))\n return this.setState(state);\n update = ViewUpdate.create(this, state, transactions);\n update.flags |= focusFlag;\n let scrollTarget = this.viewState.scrollTarget;\n try {\n this.updateState = 2 /* UpdateState.Updating */;\n for (let tr of transactions) {\n if (scrollTarget)\n scrollTarget = scrollTarget.map(tr.changes);\n if (tr.scrollIntoView) {\n let { main } = tr.state.selection;\n scrollTarget = new ScrollTarget(main.empty ? main : EditorSelection.cursor(main.head, main.head > main.anchor ? -1 : 1));\n }\n for (let e of tr.effects)\n if (e.is(scrollIntoView$1))\n scrollTarget = e.value.clip(this.state);\n }\n this.viewState.update(update, scrollTarget);\n this.bidiCache = CachedOrder.update(this.bidiCache, update.changes);\n if (!update.empty) {\n this.updatePlugins(update);\n this.inputState.update(update);\n }\n redrawn = this.docView.update(update);\n if (this.state.facet(styleModule) != this.styleModules)\n this.mountStyles();\n attrsChanged = this.updateAttrs();\n this.showAnnouncements(transactions);\n this.docView.updateSelection(redrawn, transactions.some(tr => tr.isUserEvent(\"select.pointer\")));\n }\n finally {\n this.updateState = 0 /* UpdateState.Idle */;\n }\n if (update.startState.facet(theme) != update.state.facet(theme))\n this.viewState.mustMeasureContent = true;\n if (redrawn || attrsChanged || scrollTarget || this.viewState.mustEnforceCursorAssoc || this.viewState.mustMeasureContent)\n this.requestMeasure();\n if (redrawn)\n this.docViewUpdate();\n if (!update.empty)\n for (let listener of this.state.facet(updateListener)) {\n try {\n listener(update);\n }\n catch (e) {\n logException(this.state, e, \"update listener\");\n }\n }\n if (dispatchFocus || domChange)\n Promise.resolve().then(() => {\n if (dispatchFocus && this.state == dispatchFocus.startState)\n this.dispatch(dispatchFocus);\n if (domChange) {\n if (!applyDOMChange(this, domChange) && pendingKey.force)\n dispatchKey(this.contentDOM, pendingKey.key, pendingKey.keyCode);\n }\n });\n }\n /**\n Reset the view to the given state. (This will cause the entire\n document to be redrawn and all view plugins to be reinitialized,\n so you should probably only use it when the new state isn't\n derived from the old state. Otherwise, use\n [`dispatch`](https://codemirror.net/6/docs/ref/#view.EditorView.dispatch) instead.)\n */\n setState(newState) {\n if (this.updateState != 0 /* UpdateState.Idle */)\n throw new Error(\"Calls to EditorView.setState are not allowed while an update is in progress\");\n if (this.destroyed) {\n this.viewState.state = newState;\n return;\n }\n this.updateState = 2 /* UpdateState.Updating */;\n let hadFocus = this.hasFocus;\n try {\n for (let plugin of this.plugins)\n plugin.destroy(this);\n this.viewState = new ViewState(newState);\n this.plugins = newState.facet(viewPlugin).map(spec => new PluginInstance(spec));\n this.pluginMap.clear();\n for (let plugin of this.plugins)\n plugin.update(this);\n this.docView.destroy();\n this.docView = new DocView(this);\n this.inputState.ensureHandlers(this.plugins);\n this.mountStyles();\n this.updateAttrs();\n this.bidiCache = [];\n }\n finally {\n this.updateState = 0 /* UpdateState.Idle */;\n }\n if (hadFocus)\n this.focus();\n this.requestMeasure();\n }\n updatePlugins(update) {\n let prevSpecs = update.startState.facet(viewPlugin), specs = update.state.facet(viewPlugin);\n if (prevSpecs != specs) {\n let newPlugins = [];\n for (let spec of specs) {\n let found = prevSpecs.indexOf(spec);\n if (found < 0) {\n newPlugins.push(new PluginInstance(spec));\n }\n else {\n let plugin = this.plugins[found];\n plugin.mustUpdate = update;\n newPlugins.push(plugin);\n }\n }\n for (let plugin of this.plugins)\n if (plugin.mustUpdate != update)\n plugin.destroy(this);\n this.plugins = newPlugins;\n this.pluginMap.clear();\n }\n else {\n for (let p of this.plugins)\n p.mustUpdate = update;\n }\n for (let i = 0; i < this.plugins.length; i++)\n this.plugins[i].update(this);\n if (prevSpecs != specs)\n this.inputState.ensureHandlers(this.plugins);\n }\n docViewUpdate() {\n for (let plugin of this.plugins) {\n let val = plugin.value;\n if (val && val.docViewUpdate) {\n try {\n val.docViewUpdate(this);\n }\n catch (e) {\n logException(this.state, e, \"doc view update listener\");\n }\n }\n }\n }\n /**\n @internal\n */\n measure(flush = true) {\n if (this.destroyed)\n return;\n if (this.measureScheduled > -1)\n this.win.cancelAnimationFrame(this.measureScheduled);\n if (this.observer.delayedAndroidKey) {\n this.measureScheduled = -1;\n this.requestMeasure();\n return;\n }\n this.measureScheduled = 0; // Prevent requestMeasure calls from scheduling another animation frame\n if (flush)\n this.observer.forceFlush();\n let updated = null;\n let sDOM = this.scrollDOM, scrollTop = sDOM.scrollTop * this.scaleY;\n let { scrollAnchorPos, scrollAnchorHeight } = this.viewState;\n if (Math.abs(scrollTop - this.viewState.scrollTop) > 1)\n scrollAnchorHeight = -1;\n this.viewState.scrollAnchorHeight = -1;\n try {\n for (let i = 0;; i++) {\n if (scrollAnchorHeight < 0) {\n if (isScrolledToBottom(sDOM)) {\n scrollAnchorPos = -1;\n scrollAnchorHeight = this.viewState.heightMap.height;\n }\n else {\n let block = this.viewState.scrollAnchorAt(scrollTop);\n scrollAnchorPos = block.from;\n scrollAnchorHeight = block.top;\n }\n }\n this.updateState = 1 /* UpdateState.Measuring */;\n let changed = this.viewState.measure(this);\n if (!changed && !this.measureRequests.length && this.viewState.scrollTarget == null)\n break;\n if (i > 5) {\n console.warn(this.measureRequests.length\n ? \"Measure loop restarted more than 5 times\"\n : \"Viewport failed to stabilize\");\n break;\n }\n let measuring = [];\n // Only run measure requests in this cycle when the viewport didn't change\n if (!(changed & 4 /* UpdateFlag.Viewport */))\n [this.measureRequests, measuring] = [measuring, this.measureRequests];\n let measured = measuring.map(m => {\n try {\n return m.read(this);\n }\n catch (e) {\n logException(this.state, e);\n return BadMeasure;\n }\n });\n let update = ViewUpdate.create(this, this.state, []), redrawn = false;\n update.flags |= changed;\n if (!updated)\n updated = update;\n else\n updated.flags |= changed;\n this.updateState = 2 /* UpdateState.Updating */;\n if (!update.empty) {\n this.updatePlugins(update);\n this.inputState.update(update);\n this.updateAttrs();\n redrawn = this.docView.update(update);\n if (redrawn)\n this.docViewUpdate();\n }\n for (let i = 0; i < measuring.length; i++)\n if (measured[i] != BadMeasure) {\n try {\n let m = measuring[i];\n if (m.write)\n m.write(measured[i], this);\n }\n catch (e) {\n logException(this.state, e);\n }\n }\n if (redrawn)\n this.docView.updateSelection(true);\n if (!update.viewportChanged && this.measureRequests.length == 0) {\n if (this.viewState.editorHeight) {\n if (this.viewState.scrollTarget) {\n this.docView.scrollIntoView(this.viewState.scrollTarget);\n this.viewState.scrollTarget = null;\n scrollAnchorHeight = -1;\n continue;\n }\n else {\n let newAnchorHeight = scrollAnchorPos < 0 ? this.viewState.heightMap.height :\n this.viewState.lineBlockAt(scrollAnchorPos).top;\n let diff = newAnchorHeight - scrollAnchorHeight;\n if (diff > 1 || diff < -1) {\n scrollTop = scrollTop + diff;\n sDOM.scrollTop = scrollTop / this.scaleY;\n scrollAnchorHeight = -1;\n continue;\n }\n }\n }\n break;\n }\n }\n }\n finally {\n this.updateState = 0 /* UpdateState.Idle */;\n this.measureScheduled = -1;\n }\n if (updated && !updated.empty)\n for (let listener of this.state.facet(updateListener))\n listener(updated);\n }\n /**\n Get the CSS classes for the currently active editor themes.\n */\n get themeClasses() {\n return baseThemeID + \" \" +\n (this.state.facet(darkTheme) ? baseDarkID : baseLightID) + \" \" +\n this.state.facet(theme);\n }\n updateAttrs() {\n let editorAttrs = attrsFromFacet(this, editorAttributes, {\n class: \"cm-editor\" + (this.hasFocus ? \" cm-focused \" : \" \") + this.themeClasses\n });\n let contentAttrs = {\n spellcheck: \"false\",\n autocorrect: \"off\",\n autocapitalize: \"off\",\n translate: \"no\",\n contenteditable: !this.state.facet(editable) ? \"false\" : \"true\",\n class: \"cm-content\",\n style: `${browser.tabSize}: ${this.state.tabSize}`,\n role: \"textbox\",\n \"aria-multiline\": \"true\"\n };\n if (this.state.readOnly)\n contentAttrs[\"aria-readonly\"] = \"true\";\n attrsFromFacet(this, contentAttributes, contentAttrs);\n let changed = this.observer.ignore(() => {\n let changedContent = updateAttrs(this.contentDOM, this.contentAttrs, contentAttrs);\n let changedEditor = updateAttrs(this.dom, this.editorAttrs, editorAttrs);\n return changedContent || changedEditor;\n });\n this.editorAttrs = editorAttrs;\n this.contentAttrs = contentAttrs;\n return changed;\n }\n showAnnouncements(trs) {\n let first = true;\n for (let tr of trs)\n for (let effect of tr.effects)\n if (effect.is(EditorView.announce)) {\n if (first)\n this.announceDOM.textContent = \"\";\n first = false;\n let div = this.announceDOM.appendChild(document.createElement(\"div\"));\n div.textContent = effect.value;\n }\n }\n mountStyles() {\n this.styleModules = this.state.facet(styleModule);\n let nonce = this.state.facet(EditorView.cspNonce);\n StyleModule.mount(this.root, this.styleModules.concat(baseTheme$1$2).reverse(), nonce ? { nonce } : undefined);\n }\n readMeasured() {\n if (this.updateState == 2 /* UpdateState.Updating */)\n throw new Error(\"Reading the editor layout isn't allowed during an update\");\n if (this.updateState == 0 /* UpdateState.Idle */ && this.measureScheduled > -1)\n this.measure(false);\n }\n /**\n Schedule a layout measurement, optionally providing callbacks to\n do custom DOM measuring followed by a DOM write phase. Using\n this is preferable reading DOM layout directly from, for\n example, an event handler, because it'll make sure measuring and\n drawing done by other components is synchronized, avoiding\n unnecessary DOM layout computations.\n */\n requestMeasure(request) {\n if (this.measureScheduled < 0)\n this.measureScheduled = this.win.requestAnimationFrame(() => this.measure());\n if (request) {\n if (this.measureRequests.indexOf(request) > -1)\n return;\n if (request.key != null)\n for (let i = 0; i < this.measureRequests.length; i++) {\n if (this.measureRequests[i].key === request.key) {\n this.measureRequests[i] = request;\n return;\n }\n }\n this.measureRequests.push(request);\n }\n }\n /**\n Get the value of a specific plugin, if present. Note that\n plugins that crash can be dropped from a view, so even when you\n know you registered a given plugin, it is recommended to check\n the return value of this method.\n */\n plugin(plugin) {\n let known = this.pluginMap.get(plugin);\n if (known === undefined || known && known.spec != plugin)\n this.pluginMap.set(plugin, known = this.plugins.find(p => p.spec == plugin) || null);\n return known && known.update(this).value;\n }\n /**\n The top position of the document, in screen coordinates. This\n may be negative when the editor is scrolled down. Points\n directly to the top of the first line, not above the padding.\n */\n get documentTop() {\n return this.contentDOM.getBoundingClientRect().top + this.viewState.paddingTop;\n }\n /**\n Reports the padding above and below the document.\n */\n get documentPadding() {\n return { top: this.viewState.paddingTop, bottom: this.viewState.paddingBottom };\n }\n /**\n If the editor is transformed with CSS, this provides the scale\n along the X axis. Otherwise, it will just be 1. Note that\n transforms other than translation and scaling are not supported.\n */\n get scaleX() { return this.viewState.scaleX; }\n /**\n Provide the CSS transformed scale along the Y axis.\n */\n get scaleY() { return this.viewState.scaleY; }\n /**\n Find the text line or block widget at the given vertical\n position (which is interpreted as relative to the [top of the\n document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop)).\n */\n elementAtHeight(height) {\n this.readMeasured();\n return this.viewState.elementAtHeight(height);\n }\n /**\n Find the line block (see\n [`lineBlockAt`](https://codemirror.net/6/docs/ref/#view.EditorView.lineBlockAt) at the given\n height, again interpreted relative to the [top of the\n document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop).\n */\n lineBlockAtHeight(height) {\n this.readMeasured();\n return this.viewState.lineBlockAtHeight(height);\n }\n /**\n Get the extent and vertical position of all [line\n blocks](https://codemirror.net/6/docs/ref/#view.EditorView.lineBlockAt) in the viewport. Positions\n are relative to the [top of the\n document](https://codemirror.net/6/docs/ref/#view.EditorView.documentTop);\n */\n get viewportLineBlocks() {\n return this.viewState.viewportLines;\n }\n /**\n Find the line block around the given document position. A line\n block is a range delimited on both sides by either a\n non-[hidden](https://codemirror.net/6/docs/ref/#view.Decoration^replace) line breaks, or the\n start/end of the document. It will usually just hold a line of\n text, but may be broken into multiple textblocks by block\n widgets.\n */\n lineBlockAt(pos) {\n return this.viewState.lineBlockAt(pos);\n }\n /**\n The editor's total content height.\n */\n get contentHeight() {\n return this.viewState.contentHeight;\n }\n /**\n Move a cursor position by [grapheme\n cluster](https://codemirror.net/6/docs/ref/#state.findClusterBreak). `forward` determines whether\n the motion is away from the line start, or towards it. In\n bidirectional text, the line is traversed in visual order, using\n the editor's [text direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection).\n When the start position was the last one on the line, the\n returned position will be across the line break. If there is no\n further line, the original position is returned.\n \n By default, this method moves over a single cluster. The\n optional `by` argument can be used to move across more. It will\n be called with the first cluster as argument, and should return\n a predicate that determines, for each subsequent cluster,\n whether it should also be moved over.\n */\n moveByChar(start, forward, by) {\n return skipAtoms(this, start, moveByChar(this, start, forward, by));\n }\n /**\n Move a cursor position across the next group of either\n [letters](https://codemirror.net/6/docs/ref/#state.EditorState.charCategorizer) or non-letter\n non-whitespace characters.\n */\n moveByGroup(start, forward) {\n return skipAtoms(this, start, moveByChar(this, start, forward, initial => byGroup(this, start.head, initial)));\n }\n /**\n Get the cursor position visually at the start or end of a line.\n Note that this may differ from the _logical_ position at its\n start or end (which is simply at `line.from`/`line.to`) if text\n at the start or end goes against the line's base text direction.\n */\n visualLineSide(line, end) {\n let order = this.bidiSpans(line), dir = this.textDirectionAt(line.from);\n let span = order[end ? order.length - 1 : 0];\n return EditorSelection.cursor(span.side(end, dir) + line.from, span.forward(!end, dir) ? 1 : -1);\n }\n /**\n Move to the next line boundary in the given direction. If\n `includeWrap` is true, line wrapping is on, and there is a\n further wrap point on the current line, the wrap point will be\n returned. Otherwise this function will return the start or end\n of the line.\n */\n moveToLineBoundary(start, forward, includeWrap = true) {\n return moveToLineBoundary(this, start, forward, includeWrap);\n }\n /**\n Move a cursor position vertically. When `distance` isn't given,\n it defaults to moving to the next line (including wrapped\n lines). Otherwise, `distance` should provide a positive distance\n in pixels.\n \n When `start` has a\n [`goalColumn`](https://codemirror.net/6/docs/ref/#state.SelectionRange.goalColumn), the vertical\n motion will use that as a target horizontal position. Otherwise,\n the cursor's own horizontal position is used. The returned\n cursor will have its goal column set to whichever column was\n used.\n */\n moveVertically(start, forward, distance) {\n return skipAtoms(this, start, moveVertically(this, start, forward, distance));\n }\n /**\n Find the DOM parent node and offset (child offset if `node` is\n an element, character offset when it is a text node) at the\n given document position.\n \n Note that for positions that aren't currently in\n `visibleRanges`, the resulting DOM position isn't necessarily\n meaningful (it may just point before or after a placeholder\n element).\n */\n domAtPos(pos) {\n return this.docView.domAtPos(pos);\n }\n /**\n Find the document position at the given DOM node. Can be useful\n for associating positions with DOM events. Will raise an error\n when `node` isn't part of the editor content.\n */\n posAtDOM(node, offset = 0) {\n return this.docView.posFromDOM(node, offset);\n }\n posAtCoords(coords, precise = true) {\n this.readMeasured();\n return posAtCoords(this, coords, precise);\n }\n /**\n Get the screen coordinates at the given document position.\n `side` determines whether the coordinates are based on the\n element before (-1) or after (1) the position (if no element is\n available on the given side, the method will transparently use\n another strategy to get reasonable coordinates).\n */\n coordsAtPos(pos, side = 1) {\n this.readMeasured();\n let rect = this.docView.coordsAt(pos, side);\n if (!rect || rect.left == rect.right)\n return rect;\n let line = this.state.doc.lineAt(pos), order = this.bidiSpans(line);\n let span = order[BidiSpan.find(order, pos - line.from, -1, side)];\n return flattenRect(rect, (span.dir == Direction.LTR) == (side > 0));\n }\n /**\n Return the rectangle around a given character. If `pos` does not\n point in front of a character that is in the viewport and\n rendered (i.e. not replaced, not a line break), this will return\n null. For space characters that are a line wrap point, this will\n return the position before the line break.\n */\n coordsForChar(pos) {\n this.readMeasured();\n return this.docView.coordsForChar(pos);\n }\n /**\n The default width of a character in the editor. May not\n accurately reflect the width of all characters (given variable\n width fonts or styling of invididual ranges).\n */\n get defaultCharacterWidth() { return this.viewState.heightOracle.charWidth; }\n /**\n The default height of a line in the editor. May not be accurate\n for all lines.\n */\n get defaultLineHeight() { return this.viewState.heightOracle.lineHeight; }\n /**\n The text direction\n ([`direction`](https://developer.mozilla.org/en-US/docs/Web/CSS/direction)\n CSS property) of the editor's content element.\n */\n get textDirection() { return this.viewState.defaultTextDirection; }\n /**\n Find the text direction of the block at the given position, as\n assigned by CSS. If\n [`perLineTextDirection`](https://codemirror.net/6/docs/ref/#view.EditorView^perLineTextDirection)\n isn't enabled, or the given position is outside of the viewport,\n this will always return the same as\n [`textDirection`](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection). Note that\n this may trigger a DOM layout.\n */\n textDirectionAt(pos) {\n let perLine = this.state.facet(perLineTextDirection);\n if (!perLine || pos < this.viewport.from || pos > this.viewport.to)\n return this.textDirection;\n this.readMeasured();\n return this.docView.textDirectionAt(pos);\n }\n /**\n Whether this editor [wraps lines](https://codemirror.net/6/docs/ref/#view.EditorView.lineWrapping)\n (as determined by the\n [`white-space`](https://developer.mozilla.org/en-US/docs/Web/CSS/white-space)\n CSS property of its content element).\n */\n get lineWrapping() { return this.viewState.heightOracle.lineWrapping; }\n /**\n Returns the bidirectional text structure of the given line\n (which should be in the current document) as an array of span\n objects. The order of these spans matches the [text\n direction](https://codemirror.net/6/docs/ref/#view.EditorView.textDirection)\u2014if that is\n left-to-right, the leftmost spans come first, otherwise the\n rightmost spans come first.\n */\n bidiSpans(line) {\n if (line.length > MaxBidiLine)\n return trivialOrder(line.length);\n let dir = this.textDirectionAt(line.from), isolates;\n for (let entry of this.bidiCache) {\n if (entry.from == line.from && entry.dir == dir &&\n (entry.fresh || isolatesEq(entry.isolates, isolates = getIsolatedRanges(this, line))))\n return entry.order;\n }\n if (!isolates)\n isolates = getIsolatedRanges(this, line);\n let order = computeOrder(line.text, dir, isolates);\n this.bidiCache.push(new CachedOrder(line.from, line.to, dir, isolates, true, order));\n return order;\n }\n /**\n Check whether the editor has focus.\n */\n get hasFocus() {\n var _a;\n // Safari return false for hasFocus when the context menu is open\n // or closing, which leads us to ignore selection changes from the\n // context menu because it looks like the editor isn't focused.\n // This kludges around that.\n return (this.dom.ownerDocument.hasFocus() || browser.safari && ((_a = this.inputState) === null || _a === void 0 ? void 0 : _a.lastContextMenu) > Date.now() - 3e4) &&\n this.root.activeElement == this.contentDOM;\n }\n /**\n Put focus on the editor.\n */\n focus() {\n this.observer.ignore(() => {\n focusPreventScroll(this.contentDOM);\n this.docView.updateSelection();\n });\n }\n /**\n Update the [root](https://codemirror.net/6/docs/ref/##view.EditorViewConfig.root) in which the editor lives. This is only\n necessary when moving the editor's existing DOM to a new window or shadow root.\n */\n setRoot(root) {\n if (this._root != root) {\n this._root = root;\n this.observer.setWindow((root.nodeType == 9 ? root : root.ownerDocument).defaultView || window);\n this.mountStyles();\n }\n }\n /**\n Clean up this editor view, removing its element from the\n document, unregistering event handlers, and notifying\n plugins. The view instance can no longer be used after\n calling this.\n */\n destroy() {\n if (this.root.activeElement == this.contentDOM)\n this.contentDOM.blur();\n for (let plugin of this.plugins)\n plugin.destroy(this);\n this.plugins = [];\n this.inputState.destroy();\n this.docView.destroy();\n this.dom.remove();\n this.observer.destroy();\n if (this.measureScheduled > -1)\n this.win.cancelAnimationFrame(this.measureScheduled);\n this.destroyed = true;\n }\n /**\n Returns an effect that can be\n [added](https://codemirror.net/6/docs/ref/#state.TransactionSpec.effects) to a transaction to\n cause it to scroll the given position or range into view.\n */\n static scrollIntoView(pos, options = {}) {\n return scrollIntoView$1.of(new ScrollTarget(typeof pos == \"number\" ? EditorSelection.cursor(pos) : pos, options.y, options.x, options.yMargin, options.xMargin));\n }\n /**\n Return an effect that resets the editor to its current (at the\n time this method was called) scroll position. Note that this\n only affects the editor's own scrollable element, not parents.\n See also\n [`EditorViewConfig.scrollTo`](https://codemirror.net/6/docs/ref/#view.EditorViewConfig.scrollTo).\n \n The effect should be used with a document identical to the one\n it was created for. Failing to do so is not an error, but may\n not scroll to the expected position. You can\n [map](https://codemirror.net/6/docs/ref/#state.StateEffect.map) the effect to account for changes.\n */\n scrollSnapshot() {\n let { scrollTop, scrollLeft } = this.scrollDOM;\n let ref = this.viewState.scrollAnchorAt(scrollTop);\n return scrollIntoView$1.of(new ScrollTarget(EditorSelection.cursor(ref.from), \"start\", \"start\", ref.top - scrollTop, scrollLeft, true));\n }\n /**\n Enable or disable tab-focus mode, which disables key bindings\n for Tab and Shift-Tab, letting the browser's default\n focus-changing behavior go through instead. This is useful to\n prevent trapping keyboard users in your editor.\n \n Without argument, this toggles the mode. With a boolean, it\n enables (true) or disables it (false). Given a number, it\n temporarily enables the mode until that number of milliseconds\n have passed or another non-Tab key is pressed.\n */\n setTabFocusMode(to) {\n if (to == null)\n this.inputState.tabFocusMode = this.inputState.tabFocusMode < 0 ? 0 : -1;\n else if (typeof to == \"boolean\")\n this.inputState.tabFocusMode = to ? 0 : -1;\n else if (this.inputState.tabFocusMode != 0)\n this.inputState.tabFocusMode = Date.now() + to;\n }\n /**\n Returns an extension that can be used to add DOM event handlers.\n The value should be an object mapping event names to handler\n functions. For any given event, such functions are ordered by\n extension precedence, and the first handler to return true will\n be assumed to have handled that event, and no other handlers or\n built-in behavior will be activated for it. These are registered\n on the [content element](https://codemirror.net/6/docs/ref/#view.EditorView.contentDOM), except\n for `scroll` handlers, which will be called any time the\n editor's [scroll element](https://codemirror.net/6/docs/ref/#view.EditorView.scrollDOM) or one of\n its parent nodes is scrolled.\n */\n static domEventHandlers(handlers) {\n return ViewPlugin.define(() => ({}), { eventHandlers: handlers });\n }\n /**\n Create an extension that registers DOM event observers. Contrary\n to event [handlers](https://codemirror.net/6/docs/ref/#view.EditorView^domEventHandlers),\n observers can't be prevented from running by a higher-precedence\n handler returning true. They also don't prevent other handlers\n and observers from running when they return true, and should not\n call `preventDefault`.\n */\n static domEventObservers(observers) {\n return ViewPlugin.define(() => ({}), { eventObservers: observers });\n }\n /**\n Create a theme extension. The first argument can be a\n [`style-mod`](https://github.com/marijnh/style-mod#documentation)\n style spec providing the styles for the theme. These will be\n prefixed with a generated class for the style.\n \n Because the selectors will be prefixed with a scope class, rule\n that directly match the editor's [wrapper\n element](https://codemirror.net/6/docs/ref/#view.EditorView.dom)\u2014to which the scope class will be\n added\u2014need to be explicitly differentiated by adding an `&` to\n the selector for that element\u2014for example\n `&.cm-focused`.\n \n When `dark` is set to true, the theme will be marked as dark,\n which will cause the `&dark` rules from [base\n themes](https://codemirror.net/6/docs/ref/#view.EditorView^baseTheme) to be used (as opposed to\n `&light` when a light theme is active).\n */\n static theme(spec, options) {\n let prefix = StyleModule.newName();\n let result = [theme.of(prefix), styleModule.of(buildTheme(`.${prefix}`, spec))];\n if (options && options.dark)\n result.push(darkTheme.of(true));\n return result;\n }\n /**\n Create an extension that adds styles to the base theme. Like\n with [`theme`](https://codemirror.net/6/docs/ref/#view.EditorView^theme), use `&` to indicate the\n place of the editor wrapper element when directly targeting\n that. You can also use `&dark` or `&light` instead to only\n target editors with a dark or light theme.\n */\n static baseTheme(spec) {\n return Prec.lowest(styleModule.of(buildTheme(\".\" + baseThemeID, spec, lightDarkIDs)));\n }\n /**\n Retrieve an editor view instance from the view's DOM\n representation.\n */\n static findFromDOM(dom) {\n var _a;\n let content = dom.querySelector(\".cm-content\");\n let cView = content && ContentView.get(content) || ContentView.get(dom);\n return ((_a = cView === null || cView === void 0 ? void 0 : cView.rootView) === null || _a === void 0 ? void 0 : _a.view) || null;\n }\n }\n /**\n Facet to add a [style\n module](https://github.com/marijnh/style-mod#documentation) to\n an editor view. The view will ensure that the module is\n mounted in its [document\n root](https://codemirror.net/6/docs/ref/#view.EditorView.constructor^config.root).\n */\n EditorView.styleModule = styleModule;\n /**\n An input handler can override the way changes to the editable\n DOM content are handled. Handlers are passed the document\n positions between which the change was found, and the new\n content. When one returns true, no further input handlers are\n called and the default behavior is prevented.\n\n The `insert` argument can be used to get the default transaction\n that would be applied for this input. This can be useful when\n dispatching the custom behavior as a separate transaction.\n */\n EditorView.inputHandler = inputHandler$1;\n /**\n Scroll handlers can override how things are scrolled into view.\n If they return `true`, no further handling happens for the\n scrolling. If they return false, the default scroll behavior is\n applied. Scroll handlers should never initiate editor updates.\n */\n EditorView.scrollHandler = scrollHandler;\n /**\n This facet can be used to provide functions that create effects\n to be dispatched when the editor's focus state changes.\n */\n EditorView.focusChangeEffect = focusChangeEffect;\n /**\n By default, the editor assumes all its content has the same\n [text direction](https://codemirror.net/6/docs/ref/#view.Direction). Configure this with a `true`\n value to make it read the text direction of every (rendered)\n line separately.\n */\n EditorView.perLineTextDirection = perLineTextDirection;\n /**\n Allows you to provide a function that should be called when the\n library catches an exception from an extension (mostly from view\n plugins, but may be used by other extensions to route exceptions\n from user-code-provided callbacks). This is mostly useful for\n debugging and logging. See [`logException`](https://codemirror.net/6/docs/ref/#view.logException).\n */\n EditorView.exceptionSink = exceptionSink;\n /**\n A facet that can be used to register a function to be called\n every time the view updates.\n */\n EditorView.updateListener = updateListener;\n /**\n Facet that controls whether the editor content DOM is editable.\n When its highest-precedence value is `false`, the element will\n not have its `contenteditable` attribute set. (Note that this\n doesn't affect API calls that change the editor content, even\n when those are bound to keys or buttons. See the\n [`readOnly`](https://codemirror.net/6/docs/ref/#state.EditorState.readOnly) facet for that.)\n */\n EditorView.editable = editable;\n /**\n Allows you to influence the way mouse selection happens. The\n functions in this facet will be called for a `mousedown` event\n on the editor, and can return an object that overrides the way a\n selection is computed from that mouse click or drag.\n */\n EditorView.mouseSelectionStyle = mouseSelectionStyle;\n /**\n Facet used to configure whether a given selection drag event\n should move or copy the selection. The given predicate will be\n called with the `mousedown` event, and can return `true` when\n the drag should move the content.\n */\n EditorView.dragMovesSelection = dragMovesSelection$1;\n /**\n Facet used to configure whether a given selecting click adds a\n new range to the existing selection or replaces it entirely. The\n default behavior is to check `event.metaKey` on macOS, and\n `event.ctrlKey` elsewhere.\n */\n EditorView.clickAddsSelectionRange = clickAddsSelectionRange;\n /**\n A facet that determines which [decorations](https://codemirror.net/6/docs/ref/#view.Decoration)\n are shown in the view. Decorations can be provided in two\n ways\u2014directly, or via a function that takes an editor view.\n\n Only decoration sets provided directly are allowed to influence\n the editor's vertical layout structure. The ones provided as\n functions are called _after_ the new viewport has been computed,\n and thus **must not** introduce block widgets or replacing\n decorations that cover line breaks.\n\n If you want decorated ranges to behave like atomic units for\n cursor motion and deletion purposes, also provide the range set\n containing the decorations to\n [`EditorView.atomicRanges`](https://codemirror.net/6/docs/ref/#view.EditorView^atomicRanges).\n */\n EditorView.decorations = decorations;\n /**\n Facet that works much like\n [`decorations`](https://codemirror.net/6/docs/ref/#view.EditorView^decorations), but puts its\n inputs at the very bottom of the precedence stack, meaning mark\n decorations provided here will only be split by other, partially\n overlapping \\`outerDecorations\\` ranges, and wrap around all\n regular decorations. Use this for mark elements that should, as\n much as possible, remain in one piece.\n */\n EditorView.outerDecorations = outerDecorations;\n /**\n Used to provide ranges that should be treated as atoms as far as\n cursor motion is concerned. This causes methods like\n [`moveByChar`](https://codemirror.net/6/docs/ref/#view.EditorView.moveByChar) and\n [`moveVertically`](https://codemirror.net/6/docs/ref/#view.EditorView.moveVertically) (and the\n commands built on top of them) to skip across such regions when\n a selection endpoint would enter them. This does _not_ prevent\n direct programmatic [selection\n updates](https://codemirror.net/6/docs/ref/#state.TransactionSpec.selection) from moving into such\n regions.\n */\n EditorView.atomicRanges = atomicRanges;\n /**\n When range decorations add a `unicode-bidi: isolate` style, they\n should also include a\n [`bidiIsolate`](https://codemirror.net/6/docs/ref/#view.MarkDecorationSpec.bidiIsolate) property\n in their decoration spec, and be exposed through this facet, so\n that the editor can compute the proper text order. (Other values\n for `unicode-bidi`, except of course `normal`, are not\n supported.)\n */\n EditorView.bidiIsolatedRanges = bidiIsolatedRanges;\n /**\n Facet that allows extensions to provide additional scroll\n margins (space around the sides of the scrolling element that\n should be considered invisible). This can be useful when the\n plugin introduces elements that cover part of that element (for\n example a horizontally fixed gutter).\n */\n EditorView.scrollMargins = scrollMargins;\n /**\n This facet records whether a dark theme is active. The extension\n returned by [`theme`](https://codemirror.net/6/docs/ref/#view.EditorView^theme) automatically\n includes an instance of this when the `dark` option is set to\n true.\n */\n EditorView.darkTheme = darkTheme;\n /**\n Provides a Content Security Policy nonce to use when creating\n the style sheets for the editor. Holds the empty string when no\n nonce has been provided.\n */\n EditorView.cspNonce = /*@__PURE__*/Facet.define({ combine: values => values.length ? values[0] : \"\" });\n /**\n Facet that provides additional DOM attributes for the editor's\n editable DOM element.\n */\n EditorView.contentAttributes = contentAttributes;\n /**\n Facet that provides DOM attributes for the editor's outer\n element.\n */\n EditorView.editorAttributes = editorAttributes;\n /**\n An extension that enables line wrapping in the editor (by\n setting CSS `white-space` to `pre-wrap` in the content).\n */\n EditorView.lineWrapping = /*@__PURE__*/EditorView.contentAttributes.of({ \"class\": \"cm-lineWrapping\" });\n /**\n State effect used to include screen reader announcements in a\n transaction. These will be added to the DOM in a visually hidden\n element with `aria-live=\"polite\"` set, and should be used to\n describe effects that are visually obvious but may not be\n noticed by screen reader users (such as moving to the next\n search match).\n */\n EditorView.announce = /*@__PURE__*/StateEffect.define();\n // Maximum line length for which we compute accurate bidi info\n const MaxBidiLine = 4096;\n const BadMeasure = {};\n class CachedOrder {\n constructor(from, to, dir, isolates, fresh, order) {\n this.from = from;\n this.to = to;\n this.dir = dir;\n this.isolates = isolates;\n this.fresh = fresh;\n this.order = order;\n }\n static update(cache, changes) {\n if (changes.empty && !cache.some(c => c.fresh))\n return cache;\n let result = [], lastDir = cache.length ? cache[cache.length - 1].dir : Direction.LTR;\n for (let i = Math.max(0, cache.length - 10); i < cache.length; i++) {\n let entry = cache[i];\n if (entry.dir == lastDir && !changes.touchesRange(entry.from, entry.to))\n result.push(new CachedOrder(changes.mapPos(entry.from, 1), changes.mapPos(entry.to, -1), entry.dir, entry.isolates, false, entry.order));\n }\n return result;\n }\n }\n function attrsFromFacet(view, facet, base) {\n for (let sources = view.state.facet(facet), i = sources.length - 1; i >= 0; i--) {\n let source = sources[i], value = typeof source == \"function\" ? source(view) : source;\n if (value)\n combineAttrs(value, base);\n }\n return base;\n }\n\n const currentPlatform = browser.mac ? \"mac\" : browser.windows ? \"win\" : browser.linux ? \"linux\" : \"key\";\n function normalizeKeyName(name, platform) {\n const parts = name.split(/-(?!$)/);\n let result = parts[parts.length - 1];\n if (result == \"Space\")\n result = \" \";\n let alt, ctrl, shift, meta;\n for (let i = 0; i < parts.length - 1; ++i) {\n const mod = parts[i];\n if (/^(cmd|meta|m)$/i.test(mod))\n meta = true;\n else if (/^a(lt)?$/i.test(mod))\n alt = true;\n else if (/^(c|ctrl|control)$/i.test(mod))\n ctrl = true;\n else if (/^s(hift)?$/i.test(mod))\n shift = true;\n else if (/^mod$/i.test(mod)) {\n if (platform == \"mac\")\n meta = true;\n else\n ctrl = true;\n }\n else\n throw new Error(\"Unrecognized modifier name: \" + mod);\n }\n if (alt)\n result = \"Alt-\" + result;\n if (ctrl)\n result = \"Ctrl-\" + result;\n if (meta)\n result = \"Meta-\" + result;\n if (shift)\n result = \"Shift-\" + result;\n return result;\n }\n function modifiers(name, event, shift) {\n if (event.altKey)\n name = \"Alt-\" + name;\n if (event.ctrlKey)\n name = \"Ctrl-\" + name;\n if (event.metaKey)\n name = \"Meta-\" + name;\n if (shift !== false && event.shiftKey)\n name = \"Shift-\" + name;\n return name;\n }\n const handleKeyEvents = /*@__PURE__*/Prec.default(/*@__PURE__*/EditorView.domEventHandlers({\n keydown(event, view) {\n return runHandlers(getKeymap(view.state), event, view, \"editor\");\n }\n }));\n /**\n Facet used for registering keymaps.\n\n You can add multiple keymaps to an editor. Their priorities\n determine their precedence (the ones specified early or with high\n priority get checked first). When a handler has returned `true`\n for a given key, no further handlers are called.\n */\n const keymap = /*@__PURE__*/Facet.define({ enables: handleKeyEvents });\n const Keymaps = /*@__PURE__*/new WeakMap();\n // This is hidden behind an indirection, rather than directly computed\n // by the facet, to keep internal types out of the facet's type.\n function getKeymap(state) {\n let bindings = state.facet(keymap);\n let map = Keymaps.get(bindings);\n if (!map)\n Keymaps.set(bindings, map = buildKeymap(bindings.reduce((a, b) => a.concat(b), [])));\n return map;\n }\n /**\n Run the key handlers registered for a given scope. The event\n object should be a `\"keydown\"` event. Returns true if any of the\n handlers handled it.\n */\n function runScopeHandlers(view, event, scope) {\n return runHandlers(getKeymap(view.state), event, view, scope);\n }\n let storedPrefix = null;\n const PrefixTimeout = 4000;\n function buildKeymap(bindings, platform = currentPlatform) {\n let bound = Object.create(null);\n let isPrefix = Object.create(null);\n let checkPrefix = (name, is) => {\n let current = isPrefix[name];\n if (current == null)\n isPrefix[name] = is;\n else if (current != is)\n throw new Error(\"Key binding \" + name + \" is used both as a regular binding and as a multi-stroke prefix\");\n };\n let add = (scope, key, command, preventDefault, stopPropagation) => {\n var _a, _b;\n let scopeObj = bound[scope] || (bound[scope] = Object.create(null));\n let parts = key.split(/ (?!$)/).map(k => normalizeKeyName(k, platform));\n for (let i = 1; i < parts.length; i++) {\n let prefix = parts.slice(0, i).join(\" \");\n checkPrefix(prefix, true);\n if (!scopeObj[prefix])\n scopeObj[prefix] = {\n preventDefault: true,\n stopPropagation: false,\n run: [(view) => {\n let ourObj = storedPrefix = { view, prefix, scope };\n setTimeout(() => { if (storedPrefix == ourObj)\n storedPrefix = null; }, PrefixTimeout);\n return true;\n }]\n };\n }\n let full = parts.join(\" \");\n checkPrefix(full, false);\n let binding = scopeObj[full] || (scopeObj[full] = {\n preventDefault: false,\n stopPropagation: false,\n run: ((_b = (_a = scopeObj._any) === null || _a === void 0 ? void 0 : _a.run) === null || _b === void 0 ? void 0 : _b.slice()) || []\n });\n if (command)\n binding.run.push(command);\n if (preventDefault)\n binding.preventDefault = true;\n if (stopPropagation)\n binding.stopPropagation = true;\n };\n for (let b of bindings) {\n let scopes = b.scope ? b.scope.split(\" \") : [\"editor\"];\n if (b.any)\n for (let scope of scopes) {\n let scopeObj = bound[scope] || (bound[scope] = Object.create(null));\n if (!scopeObj._any)\n scopeObj._any = { preventDefault: false, stopPropagation: false, run: [] };\n let { any } = b;\n for (let key in scopeObj)\n scopeObj[key].run.push(view => any(view, currentKeyEvent));\n }\n let name = b[platform] || b.key;\n if (!name)\n continue;\n for (let scope of scopes) {\n add(scope, name, b.run, b.preventDefault, b.stopPropagation);\n if (b.shift)\n add(scope, \"Shift-\" + name, b.shift, b.preventDefault, b.stopPropagation);\n }\n }\n return bound;\n }\n let currentKeyEvent = null;\n function runHandlers(map, event, view, scope) {\n currentKeyEvent = event;\n let name = keyName(event);\n let charCode = codePointAt(name, 0), isChar = codePointSize(charCode) == name.length && name != \" \";\n let prefix = \"\", handled = false, prevented = false, stopPropagation = false;\n if (storedPrefix && storedPrefix.view == view && storedPrefix.scope == scope) {\n prefix = storedPrefix.prefix + \" \";\n if (modifierCodes.indexOf(event.keyCode) < 0) {\n prevented = true;\n storedPrefix = null;\n }\n }\n let ran = new Set;\n let runFor = (binding) => {\n if (binding) {\n for (let cmd of binding.run)\n if (!ran.has(cmd)) {\n ran.add(cmd);\n if (cmd(view)) {\n if (binding.stopPropagation)\n stopPropagation = true;\n return true;\n }\n }\n if (binding.preventDefault) {\n if (binding.stopPropagation)\n stopPropagation = true;\n prevented = true;\n }\n }\n return false;\n };\n let scopeObj = map[scope], baseName, shiftName;\n if (scopeObj) {\n if (runFor(scopeObj[prefix + modifiers(name, event, !isChar)])) {\n handled = true;\n }\n else if (isChar && (event.altKey || event.metaKey || event.ctrlKey) &&\n // Ctrl-Alt may be used for AltGr on Windows\n !(browser.windows && event.ctrlKey && event.altKey) &&\n (baseName = base[event.keyCode]) && baseName != name) {\n if (runFor(scopeObj[prefix + modifiers(baseName, event, true)])) {\n handled = true;\n }\n else if (event.shiftKey && (shiftName = shift[event.keyCode]) != name && shiftName != baseName &&\n runFor(scopeObj[prefix + modifiers(shiftName, event, false)])) {\n handled = true;\n }\n }\n else if (isChar && event.shiftKey &&\n runFor(scopeObj[prefix + modifiers(name, event, true)])) {\n handled = true;\n }\n if (!handled && runFor(scopeObj._any))\n handled = true;\n }\n if (prevented)\n handled = true;\n if (handled && stopPropagation)\n event.stopPropagation();\n currentKeyEvent = null;\n return handled;\n }\n\n /**\n Implementation of [`LayerMarker`](https://codemirror.net/6/docs/ref/#view.LayerMarker) that creates\n a rectangle at a given set of coordinates.\n */\n class RectangleMarker {\n /**\n Create a marker with the given class and dimensions. If `width`\n is null, the DOM element will get no width style.\n */\n constructor(className, \n /**\n The left position of the marker (in pixels, document-relative).\n */\n left, \n /**\n The top position of the marker.\n */\n top, \n /**\n The width of the marker, or null if it shouldn't get a width assigned.\n */\n width, \n /**\n The height of the marker.\n */\n height) {\n this.className = className;\n this.left = left;\n this.top = top;\n this.width = width;\n this.height = height;\n }\n draw() {\n let elt = document.createElement(\"div\");\n elt.className = this.className;\n this.adjust(elt);\n return elt;\n }\n update(elt, prev) {\n if (prev.className != this.className)\n return false;\n this.adjust(elt);\n return true;\n }\n adjust(elt) {\n elt.style.left = this.left + \"px\";\n elt.style.top = this.top + \"px\";\n if (this.width != null)\n elt.style.width = this.width + \"px\";\n elt.style.height = this.height + \"px\";\n }\n eq(p) {\n return this.left == p.left && this.top == p.top && this.width == p.width && this.height == p.height &&\n this.className == p.className;\n }\n /**\n Create a set of rectangles for the given selection range,\n assigning them theclass`className`. Will create a single\n rectangle for empty ranges, and a set of selection-style\n rectangles covering the range's content (in a bidi-aware\n way) for non-empty ones.\n */\n static forRange(view, className, range) {\n if (range.empty) {\n let pos = view.coordsAtPos(range.head, range.assoc || 1);\n if (!pos)\n return [];\n let base = getBase(view);\n return [new RectangleMarker(className, pos.left - base.left, pos.top - base.top, null, pos.bottom - pos.top)];\n }\n else {\n return rectanglesForRange(view, className, range);\n }\n }\n }\n function getBase(view) {\n let rect = view.scrollDOM.getBoundingClientRect();\n let left = view.textDirection == Direction.LTR ? rect.left : rect.right - view.scrollDOM.clientWidth * view.scaleX;\n return { left: left - view.scrollDOM.scrollLeft * view.scaleX, top: rect.top - view.scrollDOM.scrollTop * view.scaleY };\n }\n function wrappedLine(view, pos, side, inside) {\n let coords = view.coordsAtPos(pos, side * 2);\n if (!coords)\n return inside;\n let editorRect = view.dom.getBoundingClientRect();\n let y = (coords.top + coords.bottom) / 2;\n let left = view.posAtCoords({ x: editorRect.left + 1, y });\n let right = view.posAtCoords({ x: editorRect.right - 1, y });\n if (left == null || right == null)\n return inside;\n return { from: Math.max(inside.from, Math.min(left, right)), to: Math.min(inside.to, Math.max(left, right)) };\n }\n function rectanglesForRange(view, className, range) {\n if (range.to <= view.viewport.from || range.from >= view.viewport.to)\n return [];\n let from = Math.max(range.from, view.viewport.from), to = Math.min(range.to, view.viewport.to);\n let ltr = view.textDirection == Direction.LTR;\n let content = view.contentDOM, contentRect = content.getBoundingClientRect(), base = getBase(view);\n let lineElt = content.querySelector(\".cm-line\"), lineStyle = lineElt && window.getComputedStyle(lineElt);\n let leftSide = contentRect.left +\n (lineStyle ? parseInt(lineStyle.paddingLeft) + Math.min(0, parseInt(lineStyle.textIndent)) : 0);\n let rightSide = contentRect.right - (lineStyle ? parseInt(lineStyle.paddingRight) : 0);\n let startBlock = blockAt(view, from), endBlock = blockAt(view, to);\n let visualStart = startBlock.type == BlockType.Text ? startBlock : null;\n let visualEnd = endBlock.type == BlockType.Text ? endBlock : null;\n if (visualStart && (view.lineWrapping || startBlock.widgetLineBreaks))\n visualStart = wrappedLine(view, from, 1, visualStart);\n if (visualEnd && (view.lineWrapping || endBlock.widgetLineBreaks))\n visualEnd = wrappedLine(view, to, -1, visualEnd);\n if (visualStart && visualEnd && visualStart.from == visualEnd.from && visualStart.to == visualEnd.to) {\n return pieces(drawForLine(range.from, range.to, visualStart));\n }\n else {\n let top = visualStart ? drawForLine(range.from, null, visualStart) : drawForWidget(startBlock, false);\n let bottom = visualEnd ? drawForLine(null, range.to, visualEnd) : drawForWidget(endBlock, true);\n let between = [];\n if ((visualStart || startBlock).to < (visualEnd || endBlock).from - (visualStart && visualEnd ? 1 : 0) ||\n startBlock.widgetLineBreaks > 1 && top.bottom + view.defaultLineHeight / 2 < bottom.top)\n between.push(piece(leftSide, top.bottom, rightSide, bottom.top));\n else if (top.bottom < bottom.top && view.elementAtHeight((top.bottom + bottom.top) / 2).type == BlockType.Text)\n top.bottom = bottom.top = (top.bottom + bottom.top) / 2;\n return pieces(top).concat(between).concat(pieces(bottom));\n }\n function piece(left, top, right, bottom) {\n return new RectangleMarker(className, left - base.left, top - base.top - 0.01 /* C.Epsilon */, right - left, bottom - top + 0.01 /* C.Epsilon */);\n }\n function pieces({ top, bottom, horizontal }) {\n let pieces = [];\n for (let i = 0; i < horizontal.length; i += 2)\n pieces.push(piece(horizontal[i], top, horizontal[i + 1], bottom));\n return pieces;\n }\n // Gets passed from/to in line-local positions\n function drawForLine(from, to, line) {\n let top = 1e9, bottom = -1e9, horizontal = [];\n function addSpan(from, fromOpen, to, toOpen, dir) {\n // Passing 2/-2 is a kludge to force the view to return\n // coordinates on the proper side of block widgets, since\n // normalizing the side there, though appropriate for most\n // coordsAtPos queries, would break selection drawing.\n let fromCoords = view.coordsAtPos(from, (from == line.to ? -2 : 2));\n let toCoords = view.coordsAtPos(to, (to == line.from ? 2 : -2));\n if (!fromCoords || !toCoords)\n return;\n top = Math.min(fromCoords.top, toCoords.top, top);\n bottom = Math.max(fromCoords.bottom, toCoords.bottom, bottom);\n if (dir == Direction.LTR)\n horizontal.push(ltr && fromOpen ? leftSide : fromCoords.left, ltr && toOpen ? rightSide : toCoords.right);\n else\n horizontal.push(!ltr && toOpen ? leftSide : toCoords.left, !ltr && fromOpen ? rightSide : fromCoords.right);\n }\n let start = from !== null && from !== void 0 ? from : line.from, end = to !== null && to !== void 0 ? to : line.to;\n // Split the range by visible range and document line\n for (let r of view.visibleRanges)\n if (r.to > start && r.from < end) {\n for (let pos = Math.max(r.from, start), endPos = Math.min(r.to, end);;) {\n let docLine = view.state.doc.lineAt(pos);\n for (let span of view.bidiSpans(docLine)) {\n let spanFrom = span.from + docLine.from, spanTo = span.to + docLine.from;\n if (spanFrom >= endPos)\n break;\n if (spanTo > pos)\n addSpan(Math.max(spanFrom, pos), from == null && spanFrom <= start, Math.min(spanTo, endPos), to == null && spanTo >= end, span.dir);\n }\n pos = docLine.to + 1;\n if (pos >= endPos)\n break;\n }\n }\n if (horizontal.length == 0)\n addSpan(start, from == null, end, to == null, view.textDirection);\n return { top, bottom, horizontal };\n }\n function drawForWidget(block, top) {\n let y = contentRect.top + (top ? block.top : block.bottom);\n return { top: y, bottom: y, horizontal: [] };\n }\n }\n function sameMarker(a, b) {\n return a.constructor == b.constructor && a.eq(b);\n }\n class LayerView {\n constructor(view, layer) {\n this.view = view;\n this.layer = layer;\n this.drawn = [];\n this.scaleX = 1;\n this.scaleY = 1;\n this.measureReq = { read: this.measure.bind(this), write: this.draw.bind(this) };\n this.dom = view.scrollDOM.appendChild(document.createElement(\"div\"));\n this.dom.classList.add(\"cm-layer\");\n if (layer.above)\n this.dom.classList.add(\"cm-layer-above\");\n if (layer.class)\n this.dom.classList.add(layer.class);\n this.scale();\n this.dom.setAttribute(\"aria-hidden\", \"true\");\n this.setOrder(view.state);\n view.requestMeasure(this.measureReq);\n if (layer.mount)\n layer.mount(this.dom, view);\n }\n update(update) {\n if (update.startState.facet(layerOrder) != update.state.facet(layerOrder))\n this.setOrder(update.state);\n if (this.layer.update(update, this.dom) || update.geometryChanged) {\n this.scale();\n update.view.requestMeasure(this.measureReq);\n }\n }\n docViewUpdate(view) {\n if (this.layer.updateOnDocViewUpdate !== false)\n view.requestMeasure(this.measureReq);\n }\n setOrder(state) {\n let pos = 0, order = state.facet(layerOrder);\n while (pos < order.length && order[pos] != this.layer)\n pos++;\n this.dom.style.zIndex = String((this.layer.above ? 150 : -1) - pos);\n }\n measure() {\n return this.layer.markers(this.view);\n }\n scale() {\n let { scaleX, scaleY } = this.view;\n if (scaleX != this.scaleX || scaleY != this.scaleY) {\n this.scaleX = scaleX;\n this.scaleY = scaleY;\n this.dom.style.transform = `scale(${1 / scaleX}, ${1 / scaleY})`;\n }\n }\n draw(markers) {\n if (markers.length != this.drawn.length || markers.some((p, i) => !sameMarker(p, this.drawn[i]))) {\n let old = this.dom.firstChild, oldI = 0;\n for (let marker of markers) {\n if (marker.update && old && marker.constructor && this.drawn[oldI].constructor &&\n marker.update(old, this.drawn[oldI])) {\n old = old.nextSibling;\n oldI++;\n }\n else {\n this.dom.insertBefore(marker.draw(), old);\n }\n }\n while (old) {\n let next = old.nextSibling;\n old.remove();\n old = next;\n }\n this.drawn = markers;\n }\n }\n destroy() {\n if (this.layer.destroy)\n this.layer.destroy(this.dom, this.view);\n this.dom.remove();\n }\n }\n const layerOrder = /*@__PURE__*/Facet.define();\n /**\n Define a layer.\n */\n function layer(config) {\n return [\n ViewPlugin.define(v => new LayerView(v, config)),\n layerOrder.of(config)\n ];\n }\n\n const CanHidePrimary = !browser.ios; // FIXME test IE\n const selectionConfig = /*@__PURE__*/Facet.define({\n combine(configs) {\n return combineConfig(configs, {\n cursorBlinkRate: 1200,\n drawRangeCursor: true\n }, {\n cursorBlinkRate: (a, b) => Math.min(a, b),\n drawRangeCursor: (a, b) => a || b\n });\n }\n });\n /**\n Returns an extension that hides the browser's native selection and\n cursor, replacing the selection with a background behind the text\n (with the `cm-selectionBackground` class), and the\n cursors with elements overlaid over the code (using\n `cm-cursor-primary` and `cm-cursor-secondary`).\n\n This allows the editor to display secondary selection ranges, and\n tends to produce a type of selection more in line with that users\n expect in a text editor (the native selection styling will often\n leave gaps between lines and won't fill the horizontal space after\n a line when the selection continues past it).\n\n It does have a performance cost, in that it requires an extra DOM\n layout cycle for many updates (the selection is drawn based on DOM\n layout information that's only available after laying out the\n content).\n */\n function drawSelection(config = {}) {\n return [\n selectionConfig.of(config),\n cursorLayer,\n selectionLayer,\n hideNativeSelection,\n nativeSelectionHidden.of(true)\n ];\n }\n function configChanged(update) {\n return update.startState.facet(selectionConfig) != update.state.facet(selectionConfig);\n }\n const cursorLayer = /*@__PURE__*/layer({\n above: true,\n markers(view) {\n let { state } = view, conf = state.facet(selectionConfig);\n let cursors = [];\n for (let r of state.selection.ranges) {\n let prim = r == state.selection.main;\n if (r.empty ? !prim || CanHidePrimary : conf.drawRangeCursor) {\n let className = prim ? \"cm-cursor cm-cursor-primary\" : \"cm-cursor cm-cursor-secondary\";\n let cursor = r.empty ? r : EditorSelection.cursor(r.head, r.head > r.anchor ? -1 : 1);\n for (let piece of RectangleMarker.forRange(view, className, cursor))\n cursors.push(piece);\n }\n }\n return cursors;\n },\n update(update, dom) {\n if (update.transactions.some(tr => tr.selection))\n dom.style.animationName = dom.style.animationName == \"cm-blink\" ? \"cm-blink2\" : \"cm-blink\";\n let confChange = configChanged(update);\n if (confChange)\n setBlinkRate(update.state, dom);\n return update.docChanged || update.selectionSet || confChange;\n },\n mount(dom, view) {\n setBlinkRate(view.state, dom);\n },\n class: \"cm-cursorLayer\"\n });\n function setBlinkRate(state, dom) {\n dom.style.animationDuration = state.facet(selectionConfig).cursorBlinkRate + \"ms\";\n }\n const selectionLayer = /*@__PURE__*/layer({\n above: false,\n markers(view) {\n return view.state.selection.ranges.map(r => r.empty ? [] : RectangleMarker.forRange(view, \"cm-selectionBackground\", r))\n .reduce((a, b) => a.concat(b));\n },\n update(update, dom) {\n return update.docChanged || update.selectionSet || update.viewportChanged || configChanged(update);\n },\n class: \"cm-selectionLayer\"\n });\n const themeSpec = {\n \".cm-line\": {\n \"& ::selection, &::selection\": { backgroundColor: \"transparent !important\" },\n },\n \".cm-content\": {\n \"& :focus\": {\n caretColor: \"initial !important\",\n \"&::selection, & ::selection\": {\n backgroundColor: \"Highlight !important\"\n }\n }\n }\n };\n if (CanHidePrimary)\n themeSpec[\".cm-line\"].caretColor = themeSpec[\".cm-content\"].caretColor = \"transparent !important\";\n const hideNativeSelection = /*@__PURE__*/Prec.highest(/*@__PURE__*/EditorView.theme(themeSpec));\n\n const setDropCursorPos = /*@__PURE__*/StateEffect.define({\n map(pos, mapping) { return pos == null ? null : mapping.mapPos(pos); }\n });\n const dropCursorPos = /*@__PURE__*/StateField.define({\n create() { return null; },\n update(pos, tr) {\n if (pos != null)\n pos = tr.changes.mapPos(pos);\n return tr.effects.reduce((pos, e) => e.is(setDropCursorPos) ? e.value : pos, pos);\n }\n });\n const drawDropCursor = /*@__PURE__*/ViewPlugin.fromClass(class {\n constructor(view) {\n this.view = view;\n this.cursor = null;\n this.measureReq = { read: this.readPos.bind(this), write: this.drawCursor.bind(this) };\n }\n update(update) {\n var _a;\n let cursorPos = update.state.field(dropCursorPos);\n if (cursorPos == null) {\n if (this.cursor != null) {\n (_a = this.cursor) === null || _a === void 0 ? void 0 : _a.remove();\n this.cursor = null;\n }\n }\n else {\n if (!this.cursor) {\n this.cursor = this.view.scrollDOM.appendChild(document.createElement(\"div\"));\n this.cursor.className = \"cm-dropCursor\";\n }\n if (update.startState.field(dropCursorPos) != cursorPos || update.docChanged || update.geometryChanged)\n this.view.requestMeasure(this.measureReq);\n }\n }\n readPos() {\n let { view } = this;\n let pos = view.state.field(dropCursorPos);\n let rect = pos != null && view.coordsAtPos(pos);\n if (!rect)\n return null;\n let outer = view.scrollDOM.getBoundingClientRect();\n return {\n left: rect.left - outer.left + view.scrollDOM.scrollLeft * view.scaleX,\n top: rect.top - outer.top + view.scrollDOM.scrollTop * view.scaleY,\n height: rect.bottom - rect.top\n };\n }\n drawCursor(pos) {\n if (this.cursor) {\n let { scaleX, scaleY } = this.view;\n if (pos) {\n this.cursor.style.left = pos.left / scaleX + \"px\";\n this.cursor.style.top = pos.top / scaleY + \"px\";\n this.cursor.style.height = pos.height / scaleY + \"px\";\n }\n else {\n this.cursor.style.left = \"-100000px\";\n }\n }\n }\n destroy() {\n if (this.cursor)\n this.cursor.remove();\n }\n setDropPos(pos) {\n if (this.view.state.field(dropCursorPos) != pos)\n this.view.dispatch({ effects: setDropCursorPos.of(pos) });\n }\n }, {\n eventObservers: {\n dragover(event) {\n this.setDropPos(this.view.posAtCoords({ x: event.clientX, y: event.clientY }));\n },\n dragleave(event) {\n if (event.target == this.view.contentDOM || !this.view.contentDOM.contains(event.relatedTarget))\n this.setDropPos(null);\n },\n dragend() {\n this.setDropPos(null);\n },\n drop() {\n this.setDropPos(null);\n }\n }\n });\n /**\n Draws a cursor at the current drop position when something is\n dragged over the editor.\n */\n function dropCursor() {\n return [dropCursorPos, drawDropCursor];\n }\n\n function iterMatches(doc, re, from, to, f) {\n re.lastIndex = 0;\n for (let cursor = doc.iterRange(from, to), pos = from, m; !cursor.next().done; pos += cursor.value.length) {\n if (!cursor.lineBreak)\n while (m = re.exec(cursor.value))\n f(pos + m.index, m);\n }\n }\n function matchRanges(view, maxLength) {\n let visible = view.visibleRanges;\n if (visible.length == 1 && visible[0].from == view.viewport.from &&\n visible[0].to == view.viewport.to)\n return visible;\n let result = [];\n for (let { from, to } of visible) {\n from = Math.max(view.state.doc.lineAt(from).from, from - maxLength);\n to = Math.min(view.state.doc.lineAt(to).to, to + maxLength);\n if (result.length && result[result.length - 1].to >= from)\n result[result.length - 1].to = to;\n else\n result.push({ from, to });\n }\n return result;\n }\n /**\n Helper class used to make it easier to maintain decorations on\n visible code that matches a given regular expression. To be used\n in a [view plugin](https://codemirror.net/6/docs/ref/#view.ViewPlugin). Instances of this object\n represent a matching configuration.\n */\n class MatchDecorator {\n /**\n Create a decorator.\n */\n constructor(config) {\n const { regexp, decoration, decorate, boundary, maxLength = 1000 } = config;\n if (!regexp.global)\n throw new RangeError(\"The regular expression given to MatchDecorator should have its 'g' flag set\");\n this.regexp = regexp;\n if (decorate) {\n this.addMatch = (match, view, from, add) => decorate(add, from, from + match[0].length, match, view);\n }\n else if (typeof decoration == \"function\") {\n this.addMatch = (match, view, from, add) => {\n let deco = decoration(match, view, from);\n if (deco)\n add(from, from + match[0].length, deco);\n };\n }\n else if (decoration) {\n this.addMatch = (match, _view, from, add) => add(from, from + match[0].length, decoration);\n }\n else {\n throw new RangeError(\"Either 'decorate' or 'decoration' should be provided to MatchDecorator\");\n }\n this.boundary = boundary;\n this.maxLength = maxLength;\n }\n /**\n Compute the full set of decorations for matches in the given\n view's viewport. You'll want to call this when initializing your\n plugin.\n */\n createDeco(view) {\n let build = new RangeSetBuilder(), add = build.add.bind(build);\n for (let { from, to } of matchRanges(view, this.maxLength))\n iterMatches(view.state.doc, this.regexp, from, to, (from, m) => this.addMatch(m, view, from, add));\n return build.finish();\n }\n /**\n Update a set of decorations for a view update. `deco` _must_ be\n the set of decorations produced by _this_ `MatchDecorator` for\n the view state before the update.\n */\n updateDeco(update, deco) {\n let changeFrom = 1e9, changeTo = -1;\n if (update.docChanged)\n update.changes.iterChanges((_f, _t, from, to) => {\n if (to > update.view.viewport.from && from < update.view.viewport.to) {\n changeFrom = Math.min(from, changeFrom);\n changeTo = Math.max(to, changeTo);\n }\n });\n if (update.viewportChanged || changeTo - changeFrom > 1000)\n return this.createDeco(update.view);\n if (changeTo > -1)\n return this.updateRange(update.view, deco.map(update.changes), changeFrom, changeTo);\n return deco;\n }\n updateRange(view, deco, updateFrom, updateTo) {\n for (let r of view.visibleRanges) {\n let from = Math.max(r.from, updateFrom), to = Math.min(r.to, updateTo);\n if (to > from) {\n let fromLine = view.state.doc.lineAt(from), toLine = fromLine.to < to ? view.state.doc.lineAt(to) : fromLine;\n let start = Math.max(r.from, fromLine.from), end = Math.min(r.to, toLine.to);\n if (this.boundary) {\n for (; from > fromLine.from; from--)\n if (this.boundary.test(fromLine.text[from - 1 - fromLine.from])) {\n start = from;\n break;\n }\n for (; to < toLine.to; to++)\n if (this.boundary.test(toLine.text[to - toLine.from])) {\n end = to;\n break;\n }\n }\n let ranges = [], m;\n let add = (from, to, deco) => ranges.push(deco.range(from, to));\n if (fromLine == toLine) {\n this.regexp.lastIndex = start - fromLine.from;\n while ((m = this.regexp.exec(fromLine.text)) && m.index < end - fromLine.from)\n this.addMatch(m, view, m.index + fromLine.from, add);\n }\n else {\n iterMatches(view.state.doc, this.regexp, start, end, (from, m) => this.addMatch(m, view, from, add));\n }\n deco = deco.update({ filterFrom: start, filterTo: end, filter: (from, to) => from < start || to > end, add: ranges });\n }\n }\n return deco;\n }\n }\n\n const UnicodeRegexpSupport = /x/.unicode != null ? \"gu\" : \"g\";\n const Specials = /*@__PURE__*/new RegExp(\"[\\u0000-\\u0008\\u000a-\\u001f\\u007f-\\u009f\\u00ad\\u061c\\u200b\\u200e\\u200f\\u2028\\u2029\\u202d\\u202e\\u2066\\u2067\\u2069\\ufeff\\ufff9-\\ufffc]\", UnicodeRegexpSupport);\n const Names = {\n 0: \"null\",\n 7: \"bell\",\n 8: \"backspace\",\n 10: \"newline\",\n 11: \"vertical tab\",\n 13: \"carriage return\",\n 27: \"escape\",\n 8203: \"zero width space\",\n 8204: \"zero width non-joiner\",\n 8205: \"zero width joiner\",\n 8206: \"left-to-right mark\",\n 8207: \"right-to-left mark\",\n 8232: \"line separator\",\n 8237: \"left-to-right override\",\n 8238: \"right-to-left override\",\n 8294: \"left-to-right isolate\",\n 8295: \"right-to-left isolate\",\n 8297: \"pop directional isolate\",\n 8233: \"paragraph separator\",\n 65279: \"zero width no-break space\",\n 65532: \"object replacement\"\n };\n let _supportsTabSize = null;\n function supportsTabSize() {\n var _a;\n if (_supportsTabSize == null && typeof document != \"undefined\" && document.body) {\n let styles = document.body.style;\n _supportsTabSize = ((_a = styles.tabSize) !== null && _a !== void 0 ? _a : styles.MozTabSize) != null;\n }\n return _supportsTabSize || false;\n }\n const specialCharConfig = /*@__PURE__*/Facet.define({\n combine(configs) {\n let config = combineConfig(configs, {\n render: null,\n specialChars: Specials,\n addSpecialChars: null\n });\n if (config.replaceTabs = !supportsTabSize())\n config.specialChars = new RegExp(\"\\t|\" + config.specialChars.source, UnicodeRegexpSupport);\n if (config.addSpecialChars)\n config.specialChars = new RegExp(config.specialChars.source + \"|\" + config.addSpecialChars.source, UnicodeRegexpSupport);\n return config;\n }\n });\n /**\n Returns an extension that installs highlighting of special\n characters.\n */\n function highlightSpecialChars(\n /**\n Configuration options.\n */\n config = {}) {\n return [specialCharConfig.of(config), specialCharPlugin()];\n }\n let _plugin = null;\n function specialCharPlugin() {\n return _plugin || (_plugin = ViewPlugin.fromClass(class {\n constructor(view) {\n this.view = view;\n this.decorations = Decoration.none;\n this.decorationCache = Object.create(null);\n this.decorator = this.makeDecorator(view.state.facet(specialCharConfig));\n this.decorations = this.decorator.createDeco(view);\n }\n makeDecorator(conf) {\n return new MatchDecorator({\n regexp: conf.specialChars,\n decoration: (m, view, pos) => {\n let { doc } = view.state;\n let code = codePointAt(m[0], 0);\n if (code == 9) {\n let line = doc.lineAt(pos);\n let size = view.state.tabSize, col = countColumn(line.text, size, pos - line.from);\n return Decoration.replace({\n widget: new TabWidget((size - (col % size)) * this.view.defaultCharacterWidth / this.view.scaleX)\n });\n }\n return this.decorationCache[code] ||\n (this.decorationCache[code] = Decoration.replace({ widget: new SpecialCharWidget(conf, code) }));\n },\n boundary: conf.replaceTabs ? undefined : /[^]/\n });\n }\n update(update) {\n let conf = update.state.facet(specialCharConfig);\n if (update.startState.facet(specialCharConfig) != conf) {\n this.decorator = this.makeDecorator(conf);\n this.decorations = this.decorator.createDeco(update.view);\n }\n else {\n this.decorations = this.decorator.updateDeco(update, this.decorations);\n }\n }\n }, {\n decorations: v => v.decorations\n }));\n }\n const DefaultPlaceholder = \"\\u2022\";\n // Assigns placeholder characters from the Control Pictures block to\n // ASCII control characters\n function placeholder$1(code) {\n if (code >= 32)\n return DefaultPlaceholder;\n if (code == 10)\n return \"\\u2424\";\n return String.fromCharCode(9216 + code);\n }\n class SpecialCharWidget extends WidgetType {\n constructor(options, code) {\n super();\n this.options = options;\n this.code = code;\n }\n eq(other) { return other.code == this.code; }\n toDOM(view) {\n let ph = placeholder$1(this.code);\n let desc = view.state.phrase(\"Control character\") + \" \" + (Names[this.code] || \"0x\" + this.code.toString(16));\n let custom = this.options.render && this.options.render(this.code, desc, ph);\n if (custom)\n return custom;\n let span = document.createElement(\"span\");\n span.textContent = ph;\n span.title = desc;\n span.setAttribute(\"aria-label\", desc);\n span.className = \"cm-specialChar\";\n return span;\n }\n ignoreEvent() { return false; }\n }\n class TabWidget extends WidgetType {\n constructor(width) {\n super();\n this.width = width;\n }\n eq(other) { return other.width == this.width; }\n toDOM() {\n let span = document.createElement(\"span\");\n span.textContent = \"\\t\";\n span.className = \"cm-tab\";\n span.style.width = this.width + \"px\";\n return span;\n }\n ignoreEvent() { return false; }\n }\n\n /**\n Mark lines that have a cursor on them with the `\"cm-activeLine\"`\n DOM class.\n */\n function highlightActiveLine() {\n return activeLineHighlighter;\n }\n const lineDeco = /*@__PURE__*/Decoration.line({ class: \"cm-activeLine\" });\n const activeLineHighlighter = /*@__PURE__*/ViewPlugin.fromClass(class {\n constructor(view) {\n this.decorations = this.getDeco(view);\n }\n update(update) {\n if (update.docChanged || update.selectionSet)\n this.decorations = this.getDeco(update.view);\n }\n getDeco(view) {\n let lastLineStart = -1, deco = [];\n for (let r of view.state.selection.ranges) {\n let line = view.lineBlockAt(r.head);\n if (line.from > lastLineStart) {\n deco.push(lineDeco.range(line.from));\n lastLineStart = line.from;\n }\n }\n return Decoration.set(deco);\n }\n }, {\n decorations: v => v.decorations\n });\n\n // Don't compute precise column positions for line offsets above this\n // (since it could get expensive). Assume offset==column for them.\n const MaxOff = 2000;\n function rectangleFor(state, a, b) {\n let startLine = Math.min(a.line, b.line), endLine = Math.max(a.line, b.line);\n let ranges = [];\n if (a.off > MaxOff || b.off > MaxOff || a.col < 0 || b.col < 0) {\n let startOff = Math.min(a.off, b.off), endOff = Math.max(a.off, b.off);\n for (let i = startLine; i <= endLine; i++) {\n let line = state.doc.line(i);\n if (line.length <= endOff)\n ranges.push(EditorSelection.range(line.from + startOff, line.to + endOff));\n }\n }\n else {\n let startCol = Math.min(a.col, b.col), endCol = Math.max(a.col, b.col);\n for (let i = startLine; i <= endLine; i++) {\n let line = state.doc.line(i);\n let start = findColumn(line.text, startCol, state.tabSize, true);\n if (start < 0) {\n ranges.push(EditorSelection.cursor(line.to));\n }\n else {\n let end = findColumn(line.text, endCol, state.tabSize);\n ranges.push(EditorSelection.range(line.from + start, line.from + end));\n }\n }\n }\n return ranges;\n }\n function absoluteColumn(view, x) {\n let ref = view.coordsAtPos(view.viewport.from);\n return ref ? Math.round(Math.abs((ref.left - x) / view.defaultCharacterWidth)) : -1;\n }\n function getPos(view, event) {\n let offset = view.posAtCoords({ x: event.clientX, y: event.clientY }, false);\n let line = view.state.doc.lineAt(offset), off = offset - line.from;\n let col = off > MaxOff ? -1\n : off == line.length ? absoluteColumn(view, event.clientX)\n : countColumn(line.text, view.state.tabSize, offset - line.from);\n return { line: line.number, col, off };\n }\n function rectangleSelectionStyle(view, event) {\n let start = getPos(view, event), startSel = view.state.selection;\n if (!start)\n return null;\n return {\n update(update) {\n if (update.docChanged) {\n let newStart = update.changes.mapPos(update.startState.doc.line(start.line).from);\n let newLine = update.state.doc.lineAt(newStart);\n start = { line: newLine.number, col: start.col, off: Math.min(start.off, newLine.length) };\n startSel = startSel.map(update.changes);\n }\n },\n get(event, _extend, multiple) {\n let cur = getPos(view, event);\n if (!cur)\n return startSel;\n let ranges = rectangleFor(view.state, start, cur);\n if (!ranges.length)\n return startSel;\n if (multiple)\n return EditorSelection.create(ranges.concat(startSel.ranges));\n else\n return EditorSelection.create(ranges);\n }\n };\n }\n /**\n Create an extension that enables rectangular selections. By\n default, it will react to left mouse drag with the Alt key held\n down. When such a selection occurs, the text within the rectangle\n that was dragged over will be selected, as one selection\n [range](https://codemirror.net/6/docs/ref/#state.SelectionRange) per line.\n */\n function rectangularSelection(options) {\n let filter = (options === null || options === void 0 ? void 0 : options.eventFilter) || (e => e.altKey && e.button == 0);\n return EditorView.mouseSelectionStyle.of((view, event) => filter(event) ? rectangleSelectionStyle(view, event) : null);\n }\n const keys = {\n Alt: [18, e => !!e.altKey],\n Control: [17, e => !!e.ctrlKey],\n Shift: [16, e => !!e.shiftKey],\n Meta: [91, e => !!e.metaKey]\n };\n const showCrosshair = { style: \"cursor: crosshair\" };\n /**\n Returns an extension that turns the pointer cursor into a\n crosshair when a given modifier key, defaulting to Alt, is held\n down. Can serve as a visual hint that rectangular selection is\n going to happen when paired with\n [`rectangularSelection`](https://codemirror.net/6/docs/ref/#view.rectangularSelection).\n */\n function crosshairCursor(options = {}) {\n let [code, getter] = keys[options.key || \"Alt\"];\n let plugin = ViewPlugin.fromClass(class {\n constructor(view) {\n this.view = view;\n this.isDown = false;\n }\n set(isDown) {\n if (this.isDown != isDown) {\n this.isDown = isDown;\n this.view.update([]);\n }\n }\n }, {\n eventObservers: {\n keydown(e) {\n this.set(e.keyCode == code || getter(e));\n },\n keyup(e) {\n if (e.keyCode == code || !getter(e))\n this.set(false);\n },\n mousemove(e) {\n this.set(getter(e));\n }\n }\n });\n return [\n plugin,\n EditorView.contentAttributes.of(view => { var _a; return ((_a = view.plugin(plugin)) === null || _a === void 0 ? void 0 : _a.isDown) ? showCrosshair : null; })\n ];\n }\n\n const Outside = \"-10000px\";\n class TooltipViewManager {\n constructor(view, facet, createTooltipView, removeTooltipView) {\n this.facet = facet;\n this.createTooltipView = createTooltipView;\n this.removeTooltipView = removeTooltipView;\n this.input = view.state.facet(facet);\n this.tooltips = this.input.filter(t => t);\n let prev = null;\n this.tooltipViews = this.tooltips.map(t => prev = createTooltipView(t, prev));\n }\n update(update, above) {\n var _a;\n let input = update.state.facet(this.facet);\n let tooltips = input.filter(x => x);\n if (input === this.input) {\n for (let t of this.tooltipViews)\n if (t.update)\n t.update(update);\n return false;\n }\n let tooltipViews = [], newAbove = above ? [] : null;\n for (let i = 0; i < tooltips.length; i++) {\n let tip = tooltips[i], known = -1;\n if (!tip)\n continue;\n for (let i = 0; i < this.tooltips.length; i++) {\n let other = this.tooltips[i];\n if (other && other.create == tip.create)\n known = i;\n }\n if (known < 0) {\n tooltipViews[i] = this.createTooltipView(tip, i ? tooltipViews[i - 1] : null);\n if (newAbove)\n newAbove[i] = !!tip.above;\n }\n else {\n let tooltipView = tooltipViews[i] = this.tooltipViews[known];\n if (newAbove)\n newAbove[i] = above[known];\n if (tooltipView.update)\n tooltipView.update(update);\n }\n }\n for (let t of this.tooltipViews)\n if (tooltipViews.indexOf(t) < 0) {\n this.removeTooltipView(t);\n (_a = t.destroy) === null || _a === void 0 ? void 0 : _a.call(t);\n }\n if (above) {\n newAbove.forEach((val, i) => above[i] = val);\n above.length = newAbove.length;\n }\n this.input = input;\n this.tooltips = tooltips;\n this.tooltipViews = tooltipViews;\n return true;\n }\n }\n function windowSpace(view) {\n let { win } = view;\n return { top: 0, left: 0, bottom: win.innerHeight, right: win.innerWidth };\n }\n const tooltipConfig = /*@__PURE__*/Facet.define({\n combine: values => {\n var _a, _b, _c;\n return ({\n position: browser.ios ? \"absolute\" : ((_a = values.find(conf => conf.position)) === null || _a === void 0 ? void 0 : _a.position) || \"fixed\",\n parent: ((_b = values.find(conf => conf.parent)) === null || _b === void 0 ? void 0 : _b.parent) || null,\n tooltipSpace: ((_c = values.find(conf => conf.tooltipSpace)) === null || _c === void 0 ? void 0 : _c.tooltipSpace) || windowSpace,\n });\n }\n });\n const knownHeight = /*@__PURE__*/new WeakMap();\n const tooltipPlugin = /*@__PURE__*/ViewPlugin.fromClass(class {\n constructor(view) {\n this.view = view;\n this.above = [];\n this.inView = true;\n this.madeAbsolute = false;\n this.lastTransaction = 0;\n this.measureTimeout = -1;\n let config = view.state.facet(tooltipConfig);\n this.position = config.position;\n this.parent = config.parent;\n this.classes = view.themeClasses;\n this.createContainer();\n this.measureReq = { read: this.readMeasure.bind(this), write: this.writeMeasure.bind(this), key: this };\n this.resizeObserver = typeof ResizeObserver == \"function\" ? new ResizeObserver(() => this.measureSoon()) : null;\n this.manager = new TooltipViewManager(view, showTooltip, (t, p) => this.createTooltip(t, p), t => {\n if (this.resizeObserver)\n this.resizeObserver.unobserve(t.dom);\n t.dom.remove();\n });\n this.above = this.manager.tooltips.map(t => !!t.above);\n this.intersectionObserver = typeof IntersectionObserver == \"function\" ? new IntersectionObserver(entries => {\n if (Date.now() > this.lastTransaction - 50 &&\n entries.length > 0 && entries[entries.length - 1].intersectionRatio < 1)\n this.measureSoon();\n }, { threshold: [1] }) : null;\n this.observeIntersection();\n view.win.addEventListener(\"resize\", this.measureSoon = this.measureSoon.bind(this));\n this.maybeMeasure();\n }\n createContainer() {\n if (this.parent) {\n this.container = document.createElement(\"div\");\n this.container.style.position = \"relative\";\n this.container.className = this.view.themeClasses;\n this.parent.appendChild(this.container);\n }\n else {\n this.container = this.view.dom;\n }\n }\n observeIntersection() {\n if (this.intersectionObserver) {\n this.intersectionObserver.disconnect();\n for (let tooltip of this.manager.tooltipViews)\n this.intersectionObserver.observe(tooltip.dom);\n }\n }\n measureSoon() {\n if (this.measureTimeout < 0)\n this.measureTimeout = setTimeout(() => {\n this.measureTimeout = -1;\n this.maybeMeasure();\n }, 50);\n }\n update(update) {\n if (update.transactions.length)\n this.lastTransaction = Date.now();\n let updated = this.manager.update(update, this.above);\n if (updated)\n this.observeIntersection();\n let shouldMeasure = updated || update.geometryChanged;\n let newConfig = update.state.facet(tooltipConfig);\n if (newConfig.position != this.position && !this.madeAbsolute) {\n this.position = newConfig.position;\n for (let t of this.manager.tooltipViews)\n t.dom.style.position = this.position;\n shouldMeasure = true;\n }\n if (newConfig.parent != this.parent) {\n if (this.parent)\n this.container.remove();\n this.parent = newConfig.parent;\n this.createContainer();\n for (let t of this.manager.tooltipViews)\n this.container.appendChild(t.dom);\n shouldMeasure = true;\n }\n else if (this.parent && this.view.themeClasses != this.classes) {\n this.classes = this.container.className = this.view.themeClasses;\n }\n if (shouldMeasure)\n this.maybeMeasure();\n }\n createTooltip(tooltip, prev) {\n let tooltipView = tooltip.create(this.view);\n let before = prev ? prev.dom : null;\n tooltipView.dom.classList.add(\"cm-tooltip\");\n if (tooltip.arrow && !tooltipView.dom.querySelector(\".cm-tooltip > .cm-tooltip-arrow\")) {\n let arrow = document.createElement(\"div\");\n arrow.className = \"cm-tooltip-arrow\";\n tooltipView.dom.appendChild(arrow);\n }\n tooltipView.dom.style.position = this.position;\n tooltipView.dom.style.top = Outside;\n tooltipView.dom.style.left = \"0px\";\n this.container.insertBefore(tooltipView.dom, before);\n if (tooltipView.mount)\n tooltipView.mount(this.view);\n if (this.resizeObserver)\n this.resizeObserver.observe(tooltipView.dom);\n return tooltipView;\n }\n destroy() {\n var _a, _b, _c;\n this.view.win.removeEventListener(\"resize\", this.measureSoon);\n for (let tooltipView of this.manager.tooltipViews) {\n tooltipView.dom.remove();\n (_a = tooltipView.destroy) === null || _a === void 0 ? void 0 : _a.call(tooltipView);\n }\n if (this.parent)\n this.container.remove();\n (_b = this.resizeObserver) === null || _b === void 0 ? void 0 : _b.disconnect();\n (_c = this.intersectionObserver) === null || _c === void 0 ? void 0 : _c.disconnect();\n clearTimeout(this.measureTimeout);\n }\n readMeasure() {\n let editor = this.view.dom.getBoundingClientRect();\n let scaleX = 1, scaleY = 1, makeAbsolute = false;\n if (this.position == \"fixed\" && this.manager.tooltipViews.length) {\n let { dom } = this.manager.tooltipViews[0];\n if (browser.gecko) {\n // Firefox sets the element's `offsetParent` to the\n // transformed element when a transform interferes with fixed\n // positioning.\n makeAbsolute = dom.offsetParent != this.container.ownerDocument.body;\n }\n else if (dom.style.top == Outside && dom.style.left == \"0px\") {\n // On other browsers, we have to awkwardly try and use other\n // information to detect a transform.\n let rect = dom.getBoundingClientRect();\n makeAbsolute = Math.abs(rect.top + 10000) > 1 || Math.abs(rect.left) > 1;\n }\n }\n if (makeAbsolute || this.position == \"absolute\") {\n if (this.parent) {\n let rect = this.parent.getBoundingClientRect();\n if (rect.width && rect.height) {\n scaleX = rect.width / this.parent.offsetWidth;\n scaleY = rect.height / this.parent.offsetHeight;\n }\n }\n else {\n ({ scaleX, scaleY } = this.view.viewState);\n }\n }\n return {\n editor,\n parent: this.parent ? this.container.getBoundingClientRect() : editor,\n pos: this.manager.tooltips.map((t, i) => {\n let tv = this.manager.tooltipViews[i];\n return tv.getCoords ? tv.getCoords(t.pos) : this.view.coordsAtPos(t.pos);\n }),\n size: this.manager.tooltipViews.map(({ dom }) => dom.getBoundingClientRect()),\n space: this.view.state.facet(tooltipConfig).tooltipSpace(this.view),\n scaleX, scaleY, makeAbsolute\n };\n }\n writeMeasure(measured) {\n var _a;\n if (measured.makeAbsolute) {\n this.madeAbsolute = true;\n this.position = \"absolute\";\n for (let t of this.manager.tooltipViews)\n t.dom.style.position = \"absolute\";\n }\n let { editor, space, scaleX, scaleY } = measured;\n let others = [];\n for (let i = 0; i < this.manager.tooltips.length; i++) {\n let tooltip = this.manager.tooltips[i], tView = this.manager.tooltipViews[i], { dom } = tView;\n let pos = measured.pos[i], size = measured.size[i];\n // Hide tooltips that are outside of the editor.\n if (!pos || pos.bottom <= Math.max(editor.top, space.top) ||\n pos.top >= Math.min(editor.bottom, space.bottom) ||\n pos.right < Math.max(editor.left, space.left) - .1 ||\n pos.left > Math.min(editor.right, space.right) + .1) {\n dom.style.top = Outside;\n continue;\n }\n let arrow = tooltip.arrow ? tView.dom.querySelector(\".cm-tooltip-arrow\") : null;\n let arrowHeight = arrow ? 7 /* Arrow.Size */ : 0;\n let width = size.right - size.left, height = (_a = knownHeight.get(tView)) !== null && _a !== void 0 ? _a : size.bottom - size.top;\n let offset = tView.offset || noOffset, ltr = this.view.textDirection == Direction.LTR;\n let left = size.width > space.right - space.left\n ? (ltr ? space.left : space.right - size.width)\n : ltr ? Math.max(space.left, Math.min(pos.left - (arrow ? 14 /* Arrow.Offset */ : 0) + offset.x, space.right - width))\n : Math.min(Math.max(space.left, pos.left - width + (arrow ? 14 /* Arrow.Offset */ : 0) - offset.x), space.right - width);\n let above = this.above[i];\n if (!tooltip.strictSide && (above\n ? pos.top - (size.bottom - size.top) - offset.y < space.top\n : pos.bottom + (size.bottom - size.top) + offset.y > space.bottom) &&\n above == (space.bottom - pos.bottom > pos.top - space.top))\n above = this.above[i] = !above;\n let spaceVert = (above ? pos.top - space.top : space.bottom - pos.bottom) - arrowHeight;\n if (spaceVert < height && tView.resize !== false) {\n if (spaceVert < this.view.defaultLineHeight) {\n dom.style.top = Outside;\n continue;\n }\n knownHeight.set(tView, height);\n dom.style.height = (height = spaceVert) / scaleY + \"px\";\n }\n else if (dom.style.height) {\n dom.style.height = \"\";\n }\n let top = above ? pos.top - height - arrowHeight - offset.y : pos.bottom + arrowHeight + offset.y;\n let right = left + width;\n if (tView.overlap !== true)\n for (let r of others)\n if (r.left < right && r.right > left && r.top < top + height && r.bottom > top)\n top = above ? r.top - height - 2 - arrowHeight : r.bottom + arrowHeight + 2;\n if (this.position == \"absolute\") {\n dom.style.top = (top - measured.parent.top) / scaleY + \"px\";\n dom.style.left = (left - measured.parent.left) / scaleX + \"px\";\n }\n else {\n dom.style.top = top / scaleY + \"px\";\n dom.style.left = left / scaleX + \"px\";\n }\n if (arrow) {\n let arrowLeft = pos.left + (ltr ? offset.x : -offset.x) - (left + 14 /* Arrow.Offset */ - 7 /* Arrow.Size */);\n arrow.style.left = arrowLeft / scaleX + \"px\";\n }\n if (tView.overlap !== true)\n others.push({ left, top, right, bottom: top + height });\n dom.classList.toggle(\"cm-tooltip-above\", above);\n dom.classList.toggle(\"cm-tooltip-below\", !above);\n if (tView.positioned)\n tView.positioned(measured.space);\n }\n }\n maybeMeasure() {\n if (this.manager.tooltips.length) {\n if (this.view.inView)\n this.view.requestMeasure(this.measureReq);\n if (this.inView != this.view.inView) {\n this.inView = this.view.inView;\n if (!this.inView)\n for (let tv of this.manager.tooltipViews)\n tv.dom.style.top = Outside;\n }\n }\n }\n }, {\n eventObservers: {\n scroll() { this.maybeMeasure(); }\n }\n });\n const baseTheme$4 = /*@__PURE__*/EditorView.baseTheme({\n \".cm-tooltip\": {\n zIndex: 100,\n boxSizing: \"border-box\"\n },\n \"&light .cm-tooltip\": {\n border: \"1px solid #bbb\",\n backgroundColor: \"#f5f5f5\"\n },\n \"&light .cm-tooltip-section:not(:first-child)\": {\n borderTop: \"1px solid #bbb\",\n },\n \"&dark .cm-tooltip\": {\n backgroundColor: \"#333338\",\n color: \"white\"\n },\n \".cm-tooltip-arrow\": {\n height: `${7 /* Arrow.Size */}px`,\n width: `${7 /* Arrow.Size */ * 2}px`,\n position: \"absolute\",\n zIndex: -1,\n overflow: \"hidden\",\n \"&:before, &:after\": {\n content: \"''\",\n position: \"absolute\",\n width: 0,\n height: 0,\n borderLeft: `${7 /* Arrow.Size */}px solid transparent`,\n borderRight: `${7 /* Arrow.Size */}px solid transparent`,\n },\n \".cm-tooltip-above &\": {\n bottom: `-${7 /* Arrow.Size */}px`,\n \"&:before\": {\n borderTop: `${7 /* Arrow.Size */}px solid #bbb`,\n },\n \"&:after\": {\n borderTop: `${7 /* Arrow.Size */}px solid #f5f5f5`,\n bottom: \"1px\"\n }\n },\n \".cm-tooltip-below &\": {\n top: `-${7 /* Arrow.Size */}px`,\n \"&:before\": {\n borderBottom: `${7 /* Arrow.Size */}px solid #bbb`,\n },\n \"&:after\": {\n borderBottom: `${7 /* Arrow.Size */}px solid #f5f5f5`,\n top: \"1px\"\n }\n },\n },\n \"&dark .cm-tooltip .cm-tooltip-arrow\": {\n \"&:before\": {\n borderTopColor: \"#333338\",\n borderBottomColor: \"#333338\"\n },\n \"&:after\": {\n borderTopColor: \"transparent\",\n borderBottomColor: \"transparent\"\n }\n }\n });\n const noOffset = { x: 0, y: 0 };\n /**\n Facet to which an extension can add a value to show a tooltip.\n */\n const showTooltip = /*@__PURE__*/Facet.define({\n enables: [tooltipPlugin, baseTheme$4]\n });\n /**\n Get the active tooltip view for a given tooltip, if available.\n */\n function getTooltip(view, tooltip) {\n let plugin = view.plugin(tooltipPlugin);\n if (!plugin)\n return null;\n let found = plugin.manager.tooltips.indexOf(tooltip);\n return found < 0 ? null : plugin.manager.tooltipViews[found];\n }\n\n const panelConfig = /*@__PURE__*/Facet.define({\n combine(configs) {\n let topContainer, bottomContainer;\n for (let c of configs) {\n topContainer = topContainer || c.topContainer;\n bottomContainer = bottomContainer || c.bottomContainer;\n }\n return { topContainer, bottomContainer };\n }\n });\n /**\n Get the active panel created by the given constructor, if any.\n This can be useful when you need access to your panels' DOM\n structure.\n */\n function getPanel(view, panel) {\n let plugin = view.plugin(panelPlugin);\n let index = plugin ? plugin.specs.indexOf(panel) : -1;\n return index > -1 ? plugin.panels[index] : null;\n }\n const panelPlugin = /*@__PURE__*/ViewPlugin.fromClass(class {\n constructor(view) {\n this.input = view.state.facet(showPanel);\n this.specs = this.input.filter(s => s);\n this.panels = this.specs.map(spec => spec(view));\n let conf = view.state.facet(panelConfig);\n this.top = new PanelGroup(view, true, conf.topContainer);\n this.bottom = new PanelGroup(view, false, conf.bottomContainer);\n this.top.sync(this.panels.filter(p => p.top));\n this.bottom.sync(this.panels.filter(p => !p.top));\n for (let p of this.panels) {\n p.dom.classList.add(\"cm-panel\");\n if (p.mount)\n p.mount();\n }\n }\n update(update) {\n let conf = update.state.facet(panelConfig);\n if (this.top.container != conf.topContainer) {\n this.top.sync([]);\n this.top = new PanelGroup(update.view, true, conf.topContainer);\n }\n if (this.bottom.container != conf.bottomContainer) {\n this.bottom.sync([]);\n this.bottom = new PanelGroup(update.view, false, conf.bottomContainer);\n }\n this.top.syncClasses();\n this.bottom.syncClasses();\n let input = update.state.facet(showPanel);\n if (input != this.input) {\n let specs = input.filter(x => x);\n let panels = [], top = [], bottom = [], mount = [];\n for (let spec of specs) {\n let known = this.specs.indexOf(spec), panel;\n if (known < 0) {\n panel = spec(update.view);\n mount.push(panel);\n }\n else {\n panel = this.panels[known];\n if (panel.update)\n panel.update(update);\n }\n panels.push(panel);\n (panel.top ? top : bottom).push(panel);\n }\n this.specs = specs;\n this.panels = panels;\n this.top.sync(top);\n this.bottom.sync(bottom);\n for (let p of mount) {\n p.dom.classList.add(\"cm-panel\");\n if (p.mount)\n p.mount();\n }\n }\n else {\n for (let p of this.panels)\n if (p.update)\n p.update(update);\n }\n }\n destroy() {\n this.top.sync([]);\n this.bottom.sync([]);\n }\n }, {\n provide: plugin => EditorView.scrollMargins.of(view => {\n let value = view.plugin(plugin);\n return value && { top: value.top.scrollMargin(), bottom: value.bottom.scrollMargin() };\n })\n });\n class PanelGroup {\n constructor(view, top, container) {\n this.view = view;\n this.top = top;\n this.container = container;\n this.dom = undefined;\n this.classes = \"\";\n this.panels = [];\n this.syncClasses();\n }\n sync(panels) {\n for (let p of this.panels)\n if (p.destroy && panels.indexOf(p) < 0)\n p.destroy();\n this.panels = panels;\n this.syncDOM();\n }\n syncDOM() {\n if (this.panels.length == 0) {\n if (this.dom) {\n this.dom.remove();\n this.dom = undefined;\n }\n return;\n }\n if (!this.dom) {\n this.dom = document.createElement(\"div\");\n this.dom.className = this.top ? \"cm-panels cm-panels-top\" : \"cm-panels cm-panels-bottom\";\n this.dom.style[this.top ? \"top\" : \"bottom\"] = \"0\";\n let parent = this.container || this.view.dom;\n parent.insertBefore(this.dom, this.top ? parent.firstChild : null);\n }\n let curDOM = this.dom.firstChild;\n for (let panel of this.panels) {\n if (panel.dom.parentNode == this.dom) {\n while (curDOM != panel.dom)\n curDOM = rm(curDOM);\n curDOM = curDOM.nextSibling;\n }\n else {\n this.dom.insertBefore(panel.dom, curDOM);\n }\n }\n while (curDOM)\n curDOM = rm(curDOM);\n }\n scrollMargin() {\n return !this.dom || this.container ? 0\n : Math.max(0, this.top ?\n this.dom.getBoundingClientRect().bottom - Math.max(0, this.view.scrollDOM.getBoundingClientRect().top) :\n Math.min(innerHeight, this.view.scrollDOM.getBoundingClientRect().bottom) - this.dom.getBoundingClientRect().top);\n }\n syncClasses() {\n if (!this.container || this.classes == this.view.themeClasses)\n return;\n for (let cls of this.classes.split(\" \"))\n if (cls)\n this.container.classList.remove(cls);\n for (let cls of (this.classes = this.view.themeClasses).split(\" \"))\n if (cls)\n this.container.classList.add(cls);\n }\n }\n function rm(node) {\n let next = node.nextSibling;\n node.remove();\n return next;\n }\n /**\n Opening a panel is done by providing a constructor function for\n the panel through this facet. (The panel is closed again when its\n constructor is no longer provided.) Values of `null` are ignored.\n */\n const showPanel = /*@__PURE__*/Facet.define({\n enables: panelPlugin\n });\n\n /**\n A gutter marker represents a bit of information attached to a line\n in a specific gutter. Your own custom markers have to extend this\n class.\n */\n class GutterMarker extends RangeValue {\n /**\n @internal\n */\n compare(other) {\n return this == other || this.constructor == other.constructor && this.eq(other);\n }\n /**\n Compare this marker to another marker of the same type.\n */\n eq(other) { return false; }\n /**\n Called if the marker has a `toDOM` method and its representation\n was removed from a gutter.\n */\n destroy(dom) { }\n }\n GutterMarker.prototype.elementClass = \"\";\n GutterMarker.prototype.toDOM = undefined;\n GutterMarker.prototype.mapMode = MapMode.TrackBefore;\n GutterMarker.prototype.startSide = GutterMarker.prototype.endSide = -1;\n GutterMarker.prototype.point = true;\n /**\n Facet used to add a class to all gutter elements for a given line.\n Markers given to this facet should _only_ define an\n [`elementclass`](https://codemirror.net/6/docs/ref/#view.GutterMarker.elementClass), not a\n [`toDOM`](https://codemirror.net/6/docs/ref/#view.GutterMarker.toDOM) (or the marker will appear\n in all gutters for the line).\n */\n const gutterLineClass = /*@__PURE__*/Facet.define();\n const defaults$1 = {\n class: \"\",\n renderEmptyElements: false,\n elementStyle: \"\",\n markers: () => RangeSet.empty,\n lineMarker: () => null,\n widgetMarker: () => null,\n lineMarkerChange: null,\n initialSpacer: null,\n updateSpacer: null,\n domEventHandlers: {}\n };\n const activeGutters = /*@__PURE__*/Facet.define();\n /**\n Define an editor gutter. The order in which the gutters appear is\n determined by their extension priority.\n */\n function gutter(config) {\n return [gutters(), activeGutters.of(Object.assign(Object.assign({}, defaults$1), config))];\n }\n const unfixGutters = /*@__PURE__*/Facet.define({\n combine: values => values.some(x => x)\n });\n /**\n The gutter-drawing plugin is automatically enabled when you add a\n gutter, but you can use this function to explicitly configure it.\n\n Unless `fixed` is explicitly set to `false`, the gutters are\n fixed, meaning they don't scroll along with the content\n horizontally (except on Internet Explorer, which doesn't support\n CSS [`position:\n sticky`](https://developer.mozilla.org/en-US/docs/Web/CSS/position#sticky)).\n */\n function gutters(config) {\n let result = [\n gutterView,\n ];\n if (config && config.fixed === false)\n result.push(unfixGutters.of(true));\n return result;\n }\n const gutterView = /*@__PURE__*/ViewPlugin.fromClass(class {\n constructor(view) {\n this.view = view;\n this.prevViewport = view.viewport;\n this.dom = document.createElement(\"div\");\n this.dom.className = \"cm-gutters\";\n this.dom.setAttribute(\"aria-hidden\", \"true\");\n this.dom.style.minHeight = (this.view.contentHeight / this.view.scaleY) + \"px\";\n this.gutters = view.state.facet(activeGutters).map(conf => new SingleGutterView(view, conf));\n for (let gutter of this.gutters)\n this.dom.appendChild(gutter.dom);\n this.fixed = !view.state.facet(unfixGutters);\n if (this.fixed) {\n // FIXME IE11 fallback, which doesn't support position: sticky,\n // by using position: relative + event handlers that realign the\n // gutter (or just force fixed=false on IE11?)\n this.dom.style.position = \"sticky\";\n }\n this.syncGutters(false);\n view.scrollDOM.insertBefore(this.dom, view.contentDOM);\n }\n update(update) {\n if (this.updateGutters(update)) {\n // Detach during sync when the viewport changed significantly\n // (such as during scrolling), since for large updates that is\n // faster.\n let vpA = this.prevViewport, vpB = update.view.viewport;\n let vpOverlap = Math.min(vpA.to, vpB.to) - Math.max(vpA.from, vpB.from);\n this.syncGutters(vpOverlap < (vpB.to - vpB.from) * 0.8);\n }\n if (update.geometryChanged) {\n this.dom.style.minHeight = (this.view.contentHeight / this.view.scaleY) + \"px\";\n }\n if (this.view.state.facet(unfixGutters) != !this.fixed) {\n this.fixed = !this.fixed;\n this.dom.style.position = this.fixed ? \"sticky\" : \"\";\n }\n this.prevViewport = update.view.viewport;\n }\n syncGutters(detach) {\n let after = this.dom.nextSibling;\n if (detach)\n this.dom.remove();\n let lineClasses = RangeSet.iter(this.view.state.facet(gutterLineClass), this.view.viewport.from);\n let classSet = [];\n let contexts = this.gutters.map(gutter => new UpdateContext(gutter, this.view.viewport, -this.view.documentPadding.top));\n for (let line of this.view.viewportLineBlocks) {\n if (classSet.length)\n classSet = [];\n if (Array.isArray(line.type)) {\n let first = true;\n for (let b of line.type) {\n if (b.type == BlockType.Text && first) {\n advanceCursor(lineClasses, classSet, b.from);\n for (let cx of contexts)\n cx.line(this.view, b, classSet);\n first = false;\n }\n else if (b.widget) {\n for (let cx of contexts)\n cx.widget(this.view, b);\n }\n }\n }\n else if (line.type == BlockType.Text) {\n advanceCursor(lineClasses, classSet, line.from);\n for (let cx of contexts)\n cx.line(this.view, line, classSet);\n }\n else if (line.widget) {\n for (let cx of contexts)\n cx.widget(this.view, line);\n }\n }\n for (let cx of contexts)\n cx.finish();\n if (detach)\n this.view.scrollDOM.insertBefore(this.dom, after);\n }\n updateGutters(update) {\n let prev = update.startState.facet(activeGutters), cur = update.state.facet(activeGutters);\n let change = update.docChanged || update.heightChanged || update.viewportChanged ||\n !RangeSet.eq(update.startState.facet(gutterLineClass), update.state.facet(gutterLineClass), update.view.viewport.from, update.view.viewport.to);\n if (prev == cur) {\n for (let gutter of this.gutters)\n if (gutter.update(update))\n change = true;\n }\n else {\n change = true;\n let gutters = [];\n for (let conf of cur) {\n let known = prev.indexOf(conf);\n if (known < 0) {\n gutters.push(new SingleGutterView(this.view, conf));\n }\n else {\n this.gutters[known].update(update);\n gutters.push(this.gutters[known]);\n }\n }\n for (let g of this.gutters) {\n g.dom.remove();\n if (gutters.indexOf(g) < 0)\n g.destroy();\n }\n for (let g of gutters)\n this.dom.appendChild(g.dom);\n this.gutters = gutters;\n }\n return change;\n }\n destroy() {\n for (let view of this.gutters)\n view.destroy();\n this.dom.remove();\n }\n }, {\n provide: plugin => EditorView.scrollMargins.of(view => {\n let value = view.plugin(plugin);\n if (!value || value.gutters.length == 0 || !value.fixed)\n return null;\n return view.textDirection == Direction.LTR\n ? { left: value.dom.offsetWidth * view.scaleX }\n : { right: value.dom.offsetWidth * view.scaleX };\n })\n });\n function asArray(val) { return (Array.isArray(val) ? val : [val]); }\n function advanceCursor(cursor, collect, pos) {\n while (cursor.value && cursor.from <= pos) {\n if (cursor.from == pos)\n collect.push(cursor.value);\n cursor.next();\n }\n }\n class UpdateContext {\n constructor(gutter, viewport, height) {\n this.gutter = gutter;\n this.height = height;\n this.i = 0;\n this.cursor = RangeSet.iter(gutter.markers, viewport.from);\n }\n addElement(view, block, markers) {\n let { gutter } = this, above = (block.top - this.height) / view.scaleY, height = block.height / view.scaleY;\n if (this.i == gutter.elements.length) {\n let newElt = new GutterElement(view, height, above, markers);\n gutter.elements.push(newElt);\n gutter.dom.appendChild(newElt.dom);\n }\n else {\n gutter.elements[this.i].update(view, height, above, markers);\n }\n this.height = block.bottom;\n this.i++;\n }\n line(view, line, extraMarkers) {\n let localMarkers = [];\n advanceCursor(this.cursor, localMarkers, line.from);\n if (extraMarkers.length)\n localMarkers = localMarkers.concat(extraMarkers);\n let forLine = this.gutter.config.lineMarker(view, line, localMarkers);\n if (forLine)\n localMarkers.unshift(forLine);\n let gutter = this.gutter;\n if (localMarkers.length == 0 && !gutter.config.renderEmptyElements)\n return;\n this.addElement(view, line, localMarkers);\n }\n widget(view, block) {\n let marker = this.gutter.config.widgetMarker(view, block.widget, block);\n if (marker)\n this.addElement(view, block, [marker]);\n }\n finish() {\n let gutter = this.gutter;\n while (gutter.elements.length > this.i) {\n let last = gutter.elements.pop();\n gutter.dom.removeChild(last.dom);\n last.destroy();\n }\n }\n }\n class SingleGutterView {\n constructor(view, config) {\n this.view = view;\n this.config = config;\n this.elements = [];\n this.spacer = null;\n this.dom = document.createElement(\"div\");\n this.dom.className = \"cm-gutter\" + (this.config.class ? \" \" + this.config.class : \"\");\n for (let prop in config.domEventHandlers) {\n this.dom.addEventListener(prop, (event) => {\n let target = event.target, y;\n if (target != this.dom && this.dom.contains(target)) {\n while (target.parentNode != this.dom)\n target = target.parentNode;\n let rect = target.getBoundingClientRect();\n y = (rect.top + rect.bottom) / 2;\n }\n else {\n y = event.clientY;\n }\n let line = view.lineBlockAtHeight(y - view.documentTop);\n if (config.domEventHandlers[prop](view, line, event))\n event.preventDefault();\n });\n }\n this.markers = asArray(config.markers(view));\n if (config.initialSpacer) {\n this.spacer = new GutterElement(view, 0, 0, [config.initialSpacer(view)]);\n this.dom.appendChild(this.spacer.dom);\n this.spacer.dom.style.cssText += \"visibility: hidden; pointer-events: none\";\n }\n }\n update(update) {\n let prevMarkers = this.markers;\n this.markers = asArray(this.config.markers(update.view));\n if (this.spacer && this.config.updateSpacer) {\n let updated = this.config.updateSpacer(this.spacer.markers[0], update);\n if (updated != this.spacer.markers[0])\n this.spacer.update(update.view, 0, 0, [updated]);\n }\n let vp = update.view.viewport;\n return !RangeSet.eq(this.markers, prevMarkers, vp.from, vp.to) ||\n (this.config.lineMarkerChange ? this.config.lineMarkerChange(update) : false);\n }\n destroy() {\n for (let elt of this.elements)\n elt.destroy();\n }\n }\n class GutterElement {\n constructor(view, height, above, markers) {\n this.height = -1;\n this.above = 0;\n this.markers = [];\n this.dom = document.createElement(\"div\");\n this.dom.className = \"cm-gutterElement\";\n this.update(view, height, above, markers);\n }\n update(view, height, above, markers) {\n if (this.height != height) {\n this.height = height;\n this.dom.style.height = height + \"px\";\n }\n if (this.above != above)\n this.dom.style.marginTop = (this.above = above) ? above + \"px\" : \"\";\n if (!sameMarkers(this.markers, markers))\n this.setMarkers(view, markers);\n }\n setMarkers(view, markers) {\n let cls = \"cm-gutterElement\", domPos = this.dom.firstChild;\n for (let iNew = 0, iOld = 0;;) {\n let skipTo = iOld, marker = iNew < markers.length ? markers[iNew++] : null, matched = false;\n if (marker) {\n let c = marker.elementClass;\n if (c)\n cls += \" \" + c;\n for (let i = iOld; i < this.markers.length; i++)\n if (this.markers[i].compare(marker)) {\n skipTo = i;\n matched = true;\n break;\n }\n }\n else {\n skipTo = this.markers.length;\n }\n while (iOld < skipTo) {\n let next = this.markers[iOld++];\n if (next.toDOM) {\n next.destroy(domPos);\n let after = domPos.nextSibling;\n domPos.remove();\n domPos = after;\n }\n }\n if (!marker)\n break;\n if (marker.toDOM) {\n if (matched)\n domPos = domPos.nextSibling;\n else\n this.dom.insertBefore(marker.toDOM(view), domPos);\n }\n if (matched)\n iOld++;\n }\n this.dom.className = cls;\n this.markers = markers;\n }\n destroy() {\n this.setMarkers(null, []); // First argument not used unless creating markers\n }\n }\n function sameMarkers(a, b) {\n if (a.length != b.length)\n return false;\n for (let i = 0; i < a.length; i++)\n if (!a[i].compare(b[i]))\n return false;\n return true;\n }\n /**\n Facet used to provide markers to the line number gutter.\n */\n const lineNumberMarkers = /*@__PURE__*/Facet.define();\n const lineNumberConfig = /*@__PURE__*/Facet.define({\n combine(values) {\n return combineConfig(values, { formatNumber: String, domEventHandlers: {} }, {\n domEventHandlers(a, b) {\n let result = Object.assign({}, a);\n for (let event in b) {\n let exists = result[event], add = b[event];\n result[event] = exists ? (view, line, event) => exists(view, line, event) || add(view, line, event) : add;\n }\n return result;\n }\n });\n }\n });\n class NumberMarker extends GutterMarker {\n constructor(number) {\n super();\n this.number = number;\n }\n eq(other) { return this.number == other.number; }\n toDOM() { return document.createTextNode(this.number); }\n }\n function formatNumber(view, number) {\n return view.state.facet(lineNumberConfig).formatNumber(number, view.state);\n }\n const lineNumberGutter = /*@__PURE__*/activeGutters.compute([lineNumberConfig], state => ({\n class: \"cm-lineNumbers\",\n renderEmptyElements: false,\n markers(view) { return view.state.facet(lineNumberMarkers); },\n lineMarker(view, line, others) {\n if (others.some(m => m.toDOM))\n return null;\n return new NumberMarker(formatNumber(view, view.state.doc.lineAt(line.from).number));\n },\n widgetMarker: () => null,\n lineMarkerChange: update => update.startState.facet(lineNumberConfig) != update.state.facet(lineNumberConfig),\n initialSpacer(view) {\n return new NumberMarker(formatNumber(view, maxLineNumber(view.state.doc.lines)));\n },\n updateSpacer(spacer, update) {\n let max = formatNumber(update.view, maxLineNumber(update.view.state.doc.lines));\n return max == spacer.number ? spacer : new NumberMarker(max);\n },\n domEventHandlers: state.facet(lineNumberConfig).domEventHandlers\n }));\n /**\n Create a line number gutter extension.\n */\n function lineNumbers(config = {}) {\n return [\n lineNumberConfig.of(config),\n gutters(),\n lineNumberGutter\n ];\n }\n function maxLineNumber(lines) {\n let last = 9;\n while (last < lines)\n last = last * 10 + 9;\n return last;\n }\n const activeLineGutterMarker = /*@__PURE__*/new class extends GutterMarker {\n constructor() {\n super(...arguments);\n this.elementClass = \"cm-activeLineGutter\";\n }\n };\n const activeLineGutterHighlighter = /*@__PURE__*/gutterLineClass.compute([\"selection\"], state => {\n let marks = [], last = -1;\n for (let range of state.selection.ranges) {\n let linePos = state.doc.lineAt(range.head).from;\n if (linePos > last) {\n last = linePos;\n marks.push(activeLineGutterMarker.range(linePos));\n }\n }\n return RangeSet.of(marks);\n });\n /**\n Returns an extension that adds a `cm-activeLineGutter` class to\n all gutter elements on the [active\n line](https://codemirror.net/6/docs/ref/#view.highlightActiveLine).\n */\n function highlightActiveLineGutter() {\n return activeLineGutterHighlighter;\n }\n\n /**\n The default maximum length of a `TreeBuffer` node.\n */\n const DefaultBufferLength = 1024;\n let nextPropID = 0;\n class Range {\n constructor(from, to) {\n this.from = from;\n this.to = to;\n }\n }\n /**\n Each [node type](#common.NodeType) or [individual tree](#common.Tree)\n can have metadata associated with it in props. Instances of this\n class represent prop names.\n */\n class NodeProp {\n /**\n Create a new node prop type.\n */\n constructor(config = {}) {\n this.id = nextPropID++;\n this.perNode = !!config.perNode;\n this.deserialize = config.deserialize || (() => {\n throw new Error(\"This node type doesn't define a deserialize function\");\n });\n }\n /**\n This is meant to be used with\n [`NodeSet.extend`](#common.NodeSet.extend) or\n [`LRParser.configure`](#lr.ParserConfig.props) to compute\n prop values for each node type in the set. Takes a [match\n object](#common.NodeType^match) or function that returns undefined\n if the node type doesn't get this prop, and the prop's value if\n it does.\n */\n add(match) {\n if (this.perNode)\n throw new RangeError(\"Can't add per-node props to node types\");\n if (typeof match != \"function\")\n match = NodeType.match(match);\n return (type) => {\n let result = match(type);\n return result === undefined ? null : [this, result];\n };\n }\n }\n /**\n Prop that is used to describe matching delimiters. For opening\n delimiters, this holds an array of node names (written as a\n space-separated string when declaring this prop in a grammar)\n for the node types of closing delimiters that match it.\n */\n NodeProp.closedBy = new NodeProp({ deserialize: str => str.split(\" \") });\n /**\n The inverse of [`closedBy`](#common.NodeProp^closedBy). This is\n attached to closing delimiters, holding an array of node names\n of types of matching opening delimiters.\n */\n NodeProp.openedBy = new NodeProp({ deserialize: str => str.split(\" \") });\n /**\n Used to assign node types to groups (for example, all node\n types that represent an expression could be tagged with an\n `\"Expression\"` group).\n */\n NodeProp.group = new NodeProp({ deserialize: str => str.split(\" \") });\n /**\n Attached to nodes to indicate these should be\n [displayed](https://codemirror.net/docs/ref/#language.syntaxTree)\n in a bidirectional text isolate, so that direction-neutral\n characters on their sides don't incorrectly get associated with\n surrounding text. You'll generally want to set this for nodes\n that contain arbitrary text, like strings and comments, and for\n nodes that appear _inside_ arbitrary text, like HTML tags. When\n not given a value, in a grammar declaration, defaults to\n `\"auto\"`.\n */\n NodeProp.isolate = new NodeProp({ deserialize: value => {\n if (value && value != \"rtl\" && value != \"ltr\" && value != \"auto\")\n throw new RangeError(\"Invalid value for isolate: \" + value);\n return value || \"auto\";\n } });\n /**\n The hash of the [context](#lr.ContextTracker.constructor)\n that the node was parsed in, if any. Used to limit reuse of\n contextual nodes.\n */\n NodeProp.contextHash = new NodeProp({ perNode: true });\n /**\n The distance beyond the end of the node that the tokenizer\n looked ahead for any of the tokens inside the node. (The LR\n parser only stores this when it is larger than 25, for\n efficiency reasons.)\n */\n NodeProp.lookAhead = new NodeProp({ perNode: true });\n /**\n This per-node prop is used to replace a given node, or part of a\n node, with another tree. This is useful to include trees from\n different languages in mixed-language parsers.\n */\n NodeProp.mounted = new NodeProp({ perNode: true });\n /**\n A mounted tree, which can be [stored](#common.NodeProp^mounted) on\n a tree node to indicate that parts of its content are\n represented by another tree.\n */\n class MountedTree {\n constructor(\n /**\n The inner tree.\n */\n tree, \n /**\n If this is null, this tree replaces the entire node (it will\n be included in the regular iteration instead of its host\n node). If not, only the given ranges are considered to be\n covered by this tree. This is used for trees that are mixed in\n a way that isn't strictly hierarchical. Such mounted trees are\n only entered by [`resolveInner`](#common.Tree.resolveInner)\n and [`enter`](#common.SyntaxNode.enter).\n */\n overlay, \n /**\n The parser used to create this subtree.\n */\n parser) {\n this.tree = tree;\n this.overlay = overlay;\n this.parser = parser;\n }\n /**\n @internal\n */\n static get(tree) {\n return tree && tree.props && tree.props[NodeProp.mounted.id];\n }\n }\n const noProps = Object.create(null);\n /**\n Each node in a syntax tree has a node type associated with it.\n */\n class NodeType {\n /**\n @internal\n */\n constructor(\n /**\n The name of the node type. Not necessarily unique, but if the\n grammar was written properly, different node types with the\n same name within a node set should play the same semantic\n role.\n */\n name, \n /**\n @internal\n */\n props, \n /**\n The id of this node in its set. Corresponds to the term ids\n used in the parser.\n */\n id, \n /**\n @internal\n */\n flags = 0) {\n this.name = name;\n this.props = props;\n this.id = id;\n this.flags = flags;\n }\n /**\n Define a node type.\n */\n static define(spec) {\n let props = spec.props && spec.props.length ? Object.create(null) : noProps;\n let flags = (spec.top ? 1 /* NodeFlag.Top */ : 0) | (spec.skipped ? 2 /* NodeFlag.Skipped */ : 0) |\n (spec.error ? 4 /* NodeFlag.Error */ : 0) | (spec.name == null ? 8 /* NodeFlag.Anonymous */ : 0);\n let type = new NodeType(spec.name || \"\", props, spec.id, flags);\n if (spec.props)\n for (let src of spec.props) {\n if (!Array.isArray(src))\n src = src(type);\n if (src) {\n if (src[0].perNode)\n throw new RangeError(\"Can't store a per-node prop on a node type\");\n props[src[0].id] = src[1];\n }\n }\n return type;\n }\n /**\n Retrieves a node prop for this type. Will return `undefined` if\n the prop isn't present on this node.\n */\n prop(prop) { return this.props[prop.id]; }\n /**\n True when this is the top node of a grammar.\n */\n get isTop() { return (this.flags & 1 /* NodeFlag.Top */) > 0; }\n /**\n True when this node is produced by a skip rule.\n */\n get isSkipped() { return (this.flags & 2 /* NodeFlag.Skipped */) > 0; }\n /**\n Indicates whether this is an error node.\n */\n get isError() { return (this.flags & 4 /* NodeFlag.Error */) > 0; }\n /**\n When true, this node type doesn't correspond to a user-declared\n named node, for example because it is used to cache repetition.\n */\n get isAnonymous() { return (this.flags & 8 /* NodeFlag.Anonymous */) > 0; }\n /**\n Returns true when this node's name or one of its\n [groups](#common.NodeProp^group) matches the given string.\n */\n is(name) {\n if (typeof name == 'string') {\n if (this.name == name)\n return true;\n let group = this.prop(NodeProp.group);\n return group ? group.indexOf(name) > -1 : false;\n }\n return this.id == name;\n }\n /**\n Create a function from node types to arbitrary values by\n specifying an object whose property names are node or\n [group](#common.NodeProp^group) names. Often useful with\n [`NodeProp.add`](#common.NodeProp.add). You can put multiple\n names, separated by spaces, in a single property name to map\n multiple node names to a single value.\n */\n static match(map) {\n let direct = Object.create(null);\n for (let prop in map)\n for (let name of prop.split(\" \"))\n direct[name] = map[prop];\n return (node) => {\n for (let groups = node.prop(NodeProp.group), i = -1; i < (groups ? groups.length : 0); i++) {\n let found = direct[i < 0 ? node.name : groups[i]];\n if (found)\n return found;\n }\n };\n }\n }\n /**\n An empty dummy node type to use when no actual type is available.\n */\n NodeType.none = new NodeType(\"\", Object.create(null), 0, 8 /* NodeFlag.Anonymous */);\n /**\n A node set holds a collection of node types. It is used to\n compactly represent trees by storing their type ids, rather than a\n full pointer to the type object, in a numeric array. Each parser\n [has](#lr.LRParser.nodeSet) a node set, and [tree\n buffers](#common.TreeBuffer) can only store collections of nodes\n from the same set. A set can have a maximum of 2**16 (65536) node\n types in it, so that the ids fit into 16-bit typed array slots.\n */\n class NodeSet {\n /**\n Create a set with the given types. The `id` property of each\n type should correspond to its position within the array.\n */\n constructor(\n /**\n The node types in this set, by id.\n */\n types) {\n this.types = types;\n for (let i = 0; i < types.length; i++)\n if (types[i].id != i)\n throw new RangeError(\"Node type ids should correspond to array positions when creating a node set\");\n }\n /**\n Create a copy of this set with some node properties added. The\n arguments to this method can be created with\n [`NodeProp.add`](#common.NodeProp.add).\n */\n extend(...props) {\n let newTypes = [];\n for (let type of this.types) {\n let newProps = null;\n for (let source of props) {\n let add = source(type);\n if (add) {\n if (!newProps)\n newProps = Object.assign({}, type.props);\n newProps[add[0].id] = add[1];\n }\n }\n newTypes.push(newProps ? new NodeType(type.name, newProps, type.id, type.flags) : type);\n }\n return new NodeSet(newTypes);\n }\n }\n const CachedNode = new WeakMap(), CachedInnerNode = new WeakMap();\n /**\n Options that control iteration. Can be combined with the `|`\n operator to enable multiple ones.\n */\n var IterMode;\n (function (IterMode) {\n /**\n When enabled, iteration will only visit [`Tree`](#common.Tree)\n objects, not nodes packed into\n [`TreeBuffer`](#common.TreeBuffer)s.\n */\n IterMode[IterMode[\"ExcludeBuffers\"] = 1] = \"ExcludeBuffers\";\n /**\n Enable this to make iteration include anonymous nodes (such as\n the nodes that wrap repeated grammar constructs into a balanced\n tree).\n */\n IterMode[IterMode[\"IncludeAnonymous\"] = 2] = \"IncludeAnonymous\";\n /**\n By default, regular [mounted](#common.NodeProp^mounted) nodes\n replace their base node in iteration. Enable this to ignore them\n instead.\n */\n IterMode[IterMode[\"IgnoreMounts\"] = 4] = \"IgnoreMounts\";\n /**\n This option only applies in\n [`enter`](#common.SyntaxNode.enter)-style methods. It tells the\n library to not enter mounted overlays if one covers the given\n position.\n */\n IterMode[IterMode[\"IgnoreOverlays\"] = 8] = \"IgnoreOverlays\";\n })(IterMode || (IterMode = {}));\n /**\n A piece of syntax tree. There are two ways to approach these\n trees: the way they are actually stored in memory, and the\n convenient way.\n\n Syntax trees are stored as a tree of `Tree` and `TreeBuffer`\n objects. By packing detail information into `TreeBuffer` leaf\n nodes, the representation is made a lot more memory-efficient.\n\n However, when you want to actually work with tree nodes, this\n representation is very awkward, so most client code will want to\n use the [`TreeCursor`](#common.TreeCursor) or\n [`SyntaxNode`](#common.SyntaxNode) interface instead, which provides\n a view on some part of this data structure, and can be used to\n move around to adjacent nodes.\n */\n class Tree {\n /**\n Construct a new tree. See also [`Tree.build`](#common.Tree^build).\n */\n constructor(\n /**\n The type of the top node.\n */\n type, \n /**\n This node's child nodes.\n */\n children, \n /**\n The positions (offsets relative to the start of this tree) of\n the children.\n */\n positions, \n /**\n The total length of this tree\n */\n length, \n /**\n Per-node [node props](#common.NodeProp) to associate with this node.\n */\n props) {\n this.type = type;\n this.children = children;\n this.positions = positions;\n this.length = length;\n /**\n @internal\n */\n this.props = null;\n if (props && props.length) {\n this.props = Object.create(null);\n for (let [prop, value] of props)\n this.props[typeof prop == \"number\" ? prop : prop.id] = value;\n }\n }\n /**\n @internal\n */\n toString() {\n let mounted = MountedTree.get(this);\n if (mounted && !mounted.overlay)\n return mounted.tree.toString();\n let children = \"\";\n for (let ch of this.children) {\n let str = ch.toString();\n if (str) {\n if (children)\n children += \",\";\n children += str;\n }\n }\n return !this.type.name ? children :\n (/\\W/.test(this.type.name) && !this.type.isError ? JSON.stringify(this.type.name) : this.type.name) +\n (children.length ? \"(\" + children + \")\" : \"\");\n }\n /**\n Get a [tree cursor](#common.TreeCursor) positioned at the top of\n the tree. Mode can be used to [control](#common.IterMode) which\n nodes the cursor visits.\n */\n cursor(mode = 0) {\n return new TreeCursor(this.topNode, mode);\n }\n /**\n Get a [tree cursor](#common.TreeCursor) pointing into this tree\n at the given position and side (see\n [`moveTo`](#common.TreeCursor.moveTo).\n */\n cursorAt(pos, side = 0, mode = 0) {\n let scope = CachedNode.get(this) || this.topNode;\n let cursor = new TreeCursor(scope);\n cursor.moveTo(pos, side);\n CachedNode.set(this, cursor._tree);\n return cursor;\n }\n /**\n Get a [syntax node](#common.SyntaxNode) object for the top of the\n tree.\n */\n get topNode() {\n return new TreeNode(this, 0, 0, null);\n }\n /**\n Get the [syntax node](#common.SyntaxNode) at the given position.\n If `side` is -1, this will move into nodes that end at the\n position. If 1, it'll move into nodes that start at the\n position. With 0, it'll only enter nodes that cover the position\n from both sides.\n \n Note that this will not enter\n [overlays](#common.MountedTree.overlay), and you often want\n [`resolveInner`](#common.Tree.resolveInner) instead.\n */\n resolve(pos, side = 0) {\n let node = resolveNode$1(CachedNode.get(this) || this.topNode, pos, side, false);\n CachedNode.set(this, node);\n return node;\n }\n /**\n Like [`resolve`](#common.Tree.resolve), but will enter\n [overlaid](#common.MountedTree.overlay) nodes, producing a syntax node\n pointing into the innermost overlaid tree at the given position\n (with parent links going through all parent structure, including\n the host trees).\n */\n resolveInner(pos, side = 0) {\n let node = resolveNode$1(CachedInnerNode.get(this) || this.topNode, pos, side, true);\n CachedInnerNode.set(this, node);\n return node;\n }\n /**\n In some situations, it can be useful to iterate through all\n nodes around a position, including those in overlays that don't\n directly cover the position. This method gives you an iterator\n that will produce all nodes, from small to big, around the given\n position.\n */\n resolveStack(pos, side = 0) {\n return stackIterator(this, pos, side);\n }\n /**\n Iterate over the tree and its children, calling `enter` for any\n node that touches the `from`/`to` region (if given) before\n running over such a node's children, and `leave` (if given) when\n leaving the node. When `enter` returns `false`, that node will\n not have its children iterated over (or `leave` called).\n */\n iterate(spec) {\n let { enter, leave, from = 0, to = this.length } = spec;\n let mode = spec.mode || 0, anon = (mode & IterMode.IncludeAnonymous) > 0;\n for (let c = this.cursor(mode | IterMode.IncludeAnonymous);;) {\n let entered = false;\n if (c.from <= to && c.to >= from && (!anon && c.type.isAnonymous || enter(c) !== false)) {\n if (c.firstChild())\n continue;\n entered = true;\n }\n for (;;) {\n if (entered && leave && (anon || !c.type.isAnonymous))\n leave(c);\n if (c.nextSibling())\n break;\n if (!c.parent())\n return;\n entered = true;\n }\n }\n }\n /**\n Get the value of the given [node prop](#common.NodeProp) for this\n node. Works with both per-node and per-type props.\n */\n prop(prop) {\n return !prop.perNode ? this.type.prop(prop) : this.props ? this.props[prop.id] : undefined;\n }\n /**\n Returns the node's [per-node props](#common.NodeProp.perNode) in a\n format that can be passed to the [`Tree`](#common.Tree)\n constructor.\n */\n get propValues() {\n let result = [];\n if (this.props)\n for (let id in this.props)\n result.push([+id, this.props[id]]);\n return result;\n }\n /**\n Balance the direct children of this tree, producing a copy of\n which may have children grouped into subtrees with type\n [`NodeType.none`](#common.NodeType^none).\n */\n balance(config = {}) {\n return this.children.length <= 8 /* Balance.BranchFactor */ ? this :\n balanceRange(NodeType.none, this.children, this.positions, 0, this.children.length, 0, this.length, (children, positions, length) => new Tree(this.type, children, positions, length, this.propValues), config.makeTree || ((children, positions, length) => new Tree(NodeType.none, children, positions, length)));\n }\n /**\n Build a tree from a postfix-ordered buffer of node information,\n or a cursor over such a buffer.\n */\n static build(data) { return buildTree(data); }\n }\n /**\n The empty tree\n */\n Tree.empty = new Tree(NodeType.none, [], [], 0);\n class FlatBufferCursor {\n constructor(buffer, index) {\n this.buffer = buffer;\n this.index = index;\n }\n get id() { return this.buffer[this.index - 4]; }\n get start() { return this.buffer[this.index - 3]; }\n get end() { return this.buffer[this.index - 2]; }\n get size() { return this.buffer[this.index - 1]; }\n get pos() { return this.index; }\n next() { this.index -= 4; }\n fork() { return new FlatBufferCursor(this.buffer, this.index); }\n }\n /**\n Tree buffers contain (type, start, end, endIndex) quads for each\n node. In such a buffer, nodes are stored in prefix order (parents\n before children, with the endIndex of the parent indicating which\n children belong to it).\n */\n class TreeBuffer {\n /**\n Create a tree buffer.\n */\n constructor(\n /**\n The buffer's content.\n */\n buffer, \n /**\n The total length of the group of nodes in the buffer.\n */\n length, \n /**\n The node set used in this buffer.\n */\n set) {\n this.buffer = buffer;\n this.length = length;\n this.set = set;\n }\n /**\n @internal\n */\n get type() { return NodeType.none; }\n /**\n @internal\n */\n toString() {\n let result = [];\n for (let index = 0; index < this.buffer.length;) {\n result.push(this.childString(index));\n index = this.buffer[index + 3];\n }\n return result.join(\",\");\n }\n /**\n @internal\n */\n childString(index) {\n let id = this.buffer[index], endIndex = this.buffer[index + 3];\n let type = this.set.types[id], result = type.name;\n if (/\\W/.test(result) && !type.isError)\n result = JSON.stringify(result);\n index += 4;\n if (endIndex == index)\n return result;\n let children = [];\n while (index < endIndex) {\n children.push(this.childString(index));\n index = this.buffer[index + 3];\n }\n return result + \"(\" + children.join(\",\") + \")\";\n }\n /**\n @internal\n */\n findChild(startIndex, endIndex, dir, pos, side) {\n let { buffer } = this, pick = -1;\n for (let i = startIndex; i != endIndex; i = buffer[i + 3]) {\n if (checkSide(side, pos, buffer[i + 1], buffer[i + 2])) {\n pick = i;\n if (dir > 0)\n break;\n }\n }\n return pick;\n }\n /**\n @internal\n */\n slice(startI, endI, from) {\n let b = this.buffer;\n let copy = new Uint16Array(endI - startI), len = 0;\n for (let i = startI, j = 0; i < endI;) {\n copy[j++] = b[i++];\n copy[j++] = b[i++] - from;\n let to = copy[j++] = b[i++] - from;\n copy[j++] = b[i++] - startI;\n len = Math.max(len, to);\n }\n return new TreeBuffer(copy, len, this.set);\n }\n }\n function checkSide(side, pos, from, to) {\n switch (side) {\n case -2 /* Side.Before */: return from < pos;\n case -1 /* Side.AtOrBefore */: return to >= pos && from < pos;\n case 0 /* Side.Around */: return from < pos && to > pos;\n case 1 /* Side.AtOrAfter */: return from <= pos && to > pos;\n case 2 /* Side.After */: return to > pos;\n case 4 /* Side.DontCare */: return true;\n }\n }\n function resolveNode$1(node, pos, side, overlays) {\n var _a;\n // Move up to a node that actually holds the position, if possible\n while (node.from == node.to ||\n (side < 1 ? node.from >= pos : node.from > pos) ||\n (side > -1 ? node.to <= pos : node.to < pos)) {\n let parent = !overlays && node instanceof TreeNode && node.index < 0 ? null : node.parent;\n if (!parent)\n return node;\n node = parent;\n }\n let mode = overlays ? 0 : IterMode.IgnoreOverlays;\n // Must go up out of overlays when those do not overlap with pos\n if (overlays)\n for (let scan = node, parent = scan.parent; parent; scan = parent, parent = scan.parent) {\n if (scan instanceof TreeNode && scan.index < 0 && ((_a = parent.enter(pos, side, mode)) === null || _a === void 0 ? void 0 : _a.from) != scan.from)\n node = parent;\n }\n for (;;) {\n let inner = node.enter(pos, side, mode);\n if (!inner)\n return node;\n node = inner;\n }\n }\n class BaseNode {\n cursor(mode = 0) { return new TreeCursor(this, mode); }\n getChild(type, before = null, after = null) {\n let r = getChildren(this, type, before, after);\n return r.length ? r[0] : null;\n }\n getChildren(type, before = null, after = null) {\n return getChildren(this, type, before, after);\n }\n resolve(pos, side = 0) {\n return resolveNode$1(this, pos, side, false);\n }\n resolveInner(pos, side = 0) {\n return resolveNode$1(this, pos, side, true);\n }\n matchContext(context) {\n return matchNodeContext(this, context);\n }\n enterUnfinishedNodesBefore(pos) {\n let scan = this.childBefore(pos), node = this;\n while (scan) {\n let last = scan.lastChild;\n if (!last || last.to != scan.to)\n break;\n if (last.type.isError && last.from == last.to) {\n node = scan;\n scan = last.prevSibling;\n }\n else {\n scan = last;\n }\n }\n return node;\n }\n get node() { return this; }\n get next() { return this.parent; }\n }\n class TreeNode extends BaseNode {\n constructor(_tree, from, \n // Index in parent node, set to -1 if the node is not a direct child of _parent.node (overlay)\n index, _parent) {\n super();\n this._tree = _tree;\n this.from = from;\n this.index = index;\n this._parent = _parent;\n }\n get type() { return this._tree.type; }\n get name() { return this._tree.type.name; }\n get to() { return this.from + this._tree.length; }\n nextChild(i, dir, pos, side, mode = 0) {\n for (let parent = this;;) {\n for (let { children, positions } = parent._tree, e = dir > 0 ? children.length : -1; i != e; i += dir) {\n let next = children[i], start = positions[i] + parent.from;\n if (!checkSide(side, pos, start, start + next.length))\n continue;\n if (next instanceof TreeBuffer) {\n if (mode & IterMode.ExcludeBuffers)\n continue;\n let index = next.findChild(0, next.buffer.length, dir, pos - start, side);\n if (index > -1)\n return new BufferNode(new BufferContext(parent, next, i, start), null, index);\n }\n else if ((mode & IterMode.IncludeAnonymous) || (!next.type.isAnonymous || hasChild(next))) {\n let mounted;\n if (!(mode & IterMode.IgnoreMounts) && (mounted = MountedTree.get(next)) && !mounted.overlay)\n return new TreeNode(mounted.tree, start, i, parent);\n let inner = new TreeNode(next, start, i, parent);\n return (mode & IterMode.IncludeAnonymous) || !inner.type.isAnonymous ? inner\n : inner.nextChild(dir < 0 ? next.children.length - 1 : 0, dir, pos, side);\n }\n }\n if ((mode & IterMode.IncludeAnonymous) || !parent.type.isAnonymous)\n return null;\n if (parent.index >= 0)\n i = parent.index + dir;\n else\n i = dir < 0 ? -1 : parent._parent._tree.children.length;\n parent = parent._parent;\n if (!parent)\n return null;\n }\n }\n get firstChild() { return this.nextChild(0, 1, 0, 4 /* Side.DontCare */); }\n get lastChild() { return this.nextChild(this._tree.children.length - 1, -1, 0, 4 /* Side.DontCare */); }\n childAfter(pos) { return this.nextChild(0, 1, pos, 2 /* Side.After */); }\n childBefore(pos) { return this.nextChild(this._tree.children.length - 1, -1, pos, -2 /* Side.Before */); }\n enter(pos, side, mode = 0) {\n let mounted;\n if (!(mode & IterMode.IgnoreOverlays) && (mounted = MountedTree.get(this._tree)) && mounted.overlay) {\n let rPos = pos - this.from;\n for (let { from, to } of mounted.overlay) {\n if ((side > 0 ? from <= rPos : from < rPos) &&\n (side < 0 ? to >= rPos : to > rPos))\n return new TreeNode(mounted.tree, mounted.overlay[0].from + this.from, -1, this);\n }\n }\n return this.nextChild(0, 1, pos, side, mode);\n }\n nextSignificantParent() {\n let val = this;\n while (val.type.isAnonymous && val._parent)\n val = val._parent;\n return val;\n }\n get parent() {\n return this._parent ? this._parent.nextSignificantParent() : null;\n }\n get nextSibling() {\n return this._parent && this.index >= 0 ? this._parent.nextChild(this.index + 1, 1, 0, 4 /* Side.DontCare */) : null;\n }\n get prevSibling() {\n return this._parent && this.index >= 0 ? this._parent.nextChild(this.index - 1, -1, 0, 4 /* Side.DontCare */) : null;\n }\n get tree() { return this._tree; }\n toTree() { return this._tree; }\n /**\n @internal\n */\n toString() { return this._tree.toString(); }\n }\n function getChildren(node, type, before, after) {\n let cur = node.cursor(), result = [];\n if (!cur.firstChild())\n return result;\n if (before != null)\n for (let found = false; !found;) {\n found = cur.type.is(before);\n if (!cur.nextSibling())\n return result;\n }\n for (;;) {\n if (after != null && cur.type.is(after))\n return result;\n if (cur.type.is(type))\n result.push(cur.node);\n if (!cur.nextSibling())\n return after == null ? result : [];\n }\n }\n function matchNodeContext(node, context, i = context.length - 1) {\n for (let p = node.parent; i >= 0; p = p.parent) {\n if (!p)\n return false;\n if (!p.type.isAnonymous) {\n if (context[i] && context[i] != p.name)\n return false;\n i--;\n }\n }\n return true;\n }\n class BufferContext {\n constructor(parent, buffer, index, start) {\n this.parent = parent;\n this.buffer = buffer;\n this.index = index;\n this.start = start;\n }\n }\n class BufferNode extends BaseNode {\n get name() { return this.type.name; }\n get from() { return this.context.start + this.context.buffer.buffer[this.index + 1]; }\n get to() { return this.context.start + this.context.buffer.buffer[this.index + 2]; }\n constructor(context, _parent, index) {\n super();\n this.context = context;\n this._parent = _parent;\n this.index = index;\n this.type = context.buffer.set.types[context.buffer.buffer[index]];\n }\n child(dir, pos, side) {\n let { buffer } = this.context;\n let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], dir, pos - this.context.start, side);\n return index < 0 ? null : new BufferNode(this.context, this, index);\n }\n get firstChild() { return this.child(1, 0, 4 /* Side.DontCare */); }\n get lastChild() { return this.child(-1, 0, 4 /* Side.DontCare */); }\n childAfter(pos) { return this.child(1, pos, 2 /* Side.After */); }\n childBefore(pos) { return this.child(-1, pos, -2 /* Side.Before */); }\n enter(pos, side, mode = 0) {\n if (mode & IterMode.ExcludeBuffers)\n return null;\n let { buffer } = this.context;\n let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], side > 0 ? 1 : -1, pos - this.context.start, side);\n return index < 0 ? null : new BufferNode(this.context, this, index);\n }\n get parent() {\n return this._parent || this.context.parent.nextSignificantParent();\n }\n externalSibling(dir) {\n return this._parent ? null : this.context.parent.nextChild(this.context.index + dir, dir, 0, 4 /* Side.DontCare */);\n }\n get nextSibling() {\n let { buffer } = this.context;\n let after = buffer.buffer[this.index + 3];\n if (after < (this._parent ? buffer.buffer[this._parent.index + 3] : buffer.buffer.length))\n return new BufferNode(this.context, this._parent, after);\n return this.externalSibling(1);\n }\n get prevSibling() {\n let { buffer } = this.context;\n let parentStart = this._parent ? this._parent.index + 4 : 0;\n if (this.index == parentStart)\n return this.externalSibling(-1);\n return new BufferNode(this.context, this._parent, buffer.findChild(parentStart, this.index, -1, 0, 4 /* Side.DontCare */));\n }\n get tree() { return null; }\n toTree() {\n let children = [], positions = [];\n let { buffer } = this.context;\n let startI = this.index + 4, endI = buffer.buffer[this.index + 3];\n if (endI > startI) {\n let from = buffer.buffer[this.index + 1];\n children.push(buffer.slice(startI, endI, from));\n positions.push(0);\n }\n return new Tree(this.type, children, positions, this.to - this.from);\n }\n /**\n @internal\n */\n toString() { return this.context.buffer.childString(this.index); }\n }\n function iterStack(heads) {\n if (!heads.length)\n return null;\n let pick = 0, picked = heads[0];\n for (let i = 1; i < heads.length; i++) {\n let node = heads[i];\n if (node.from > picked.from || node.to < picked.to) {\n picked = node;\n pick = i;\n }\n }\n let next = picked instanceof TreeNode && picked.index < 0 ? null : picked.parent;\n let newHeads = heads.slice();\n if (next)\n newHeads[pick] = next;\n else\n newHeads.splice(pick, 1);\n return new StackIterator(newHeads, picked);\n }\n class StackIterator {\n constructor(heads, node) {\n this.heads = heads;\n this.node = node;\n }\n get next() { return iterStack(this.heads); }\n }\n function stackIterator(tree, pos, side) {\n let inner = tree.resolveInner(pos, side), layers = null;\n for (let scan = inner instanceof TreeNode ? inner : inner.context.parent; scan; scan = scan.parent) {\n if (scan.index < 0) { // This is an overlay root\n let parent = scan.parent;\n (layers || (layers = [inner])).push(parent.resolve(pos, side));\n scan = parent;\n }\n else {\n let mount = MountedTree.get(scan.tree);\n // Relevant overlay branching off\n if (mount && mount.overlay && mount.overlay[0].from <= pos && mount.overlay[mount.overlay.length - 1].to >= pos) {\n let root = new TreeNode(mount.tree, mount.overlay[0].from + scan.from, -1, scan);\n (layers || (layers = [inner])).push(resolveNode$1(root, pos, side, false));\n }\n }\n }\n return layers ? iterStack(layers) : inner;\n }\n /**\n A tree cursor object focuses on a given node in a syntax tree, and\n allows you to move to adjacent nodes.\n */\n class TreeCursor {\n /**\n Shorthand for `.type.name`.\n */\n get name() { return this.type.name; }\n /**\n @internal\n */\n constructor(node, \n /**\n @internal\n */\n mode = 0) {\n this.mode = mode;\n /**\n @internal\n */\n this.buffer = null;\n this.stack = [];\n /**\n @internal\n */\n this.index = 0;\n this.bufferNode = null;\n if (node instanceof TreeNode) {\n this.yieldNode(node);\n }\n else {\n this._tree = node.context.parent;\n this.buffer = node.context;\n for (let n = node._parent; n; n = n._parent)\n this.stack.unshift(n.index);\n this.bufferNode = node;\n this.yieldBuf(node.index);\n }\n }\n yieldNode(node) {\n if (!node)\n return false;\n this._tree = node;\n this.type = node.type;\n this.from = node.from;\n this.to = node.to;\n return true;\n }\n yieldBuf(index, type) {\n this.index = index;\n let { start, buffer } = this.buffer;\n this.type = type || buffer.set.types[buffer.buffer[index]];\n this.from = start + buffer.buffer[index + 1];\n this.to = start + buffer.buffer[index + 2];\n return true;\n }\n /**\n @internal\n */\n yield(node) {\n if (!node)\n return false;\n if (node instanceof TreeNode) {\n this.buffer = null;\n return this.yieldNode(node);\n }\n this.buffer = node.context;\n return this.yieldBuf(node.index, node.type);\n }\n /**\n @internal\n */\n toString() {\n return this.buffer ? this.buffer.buffer.childString(this.index) : this._tree.toString();\n }\n /**\n @internal\n */\n enterChild(dir, pos, side) {\n if (!this.buffer)\n return this.yield(this._tree.nextChild(dir < 0 ? this._tree._tree.children.length - 1 : 0, dir, pos, side, this.mode));\n let { buffer } = this.buffer;\n let index = buffer.findChild(this.index + 4, buffer.buffer[this.index + 3], dir, pos - this.buffer.start, side);\n if (index < 0)\n return false;\n this.stack.push(this.index);\n return this.yieldBuf(index);\n }\n /**\n Move the cursor to this node's first child. When this returns\n false, the node has no child, and the cursor has not been moved.\n */\n firstChild() { return this.enterChild(1, 0, 4 /* Side.DontCare */); }\n /**\n Move the cursor to this node's last child.\n */\n lastChild() { return this.enterChild(-1, 0, 4 /* Side.DontCare */); }\n /**\n Move the cursor to the first child that ends after `pos`.\n */\n childAfter(pos) { return this.enterChild(1, pos, 2 /* Side.After */); }\n /**\n Move to the last child that starts before `pos`.\n */\n childBefore(pos) { return this.enterChild(-1, pos, -2 /* Side.Before */); }\n /**\n Move the cursor to the child around `pos`. If side is -1 the\n child may end at that position, when 1 it may start there. This\n will also enter [overlaid](#common.MountedTree.overlay)\n [mounted](#common.NodeProp^mounted) trees unless `overlays` is\n set to false.\n */\n enter(pos, side, mode = this.mode) {\n if (!this.buffer)\n return this.yield(this._tree.enter(pos, side, mode));\n return mode & IterMode.ExcludeBuffers ? false : this.enterChild(1, pos, side);\n }\n /**\n Move to the node's parent node, if this isn't the top node.\n */\n parent() {\n if (!this.buffer)\n return this.yieldNode((this.mode & IterMode.IncludeAnonymous) ? this._tree._parent : this._tree.parent);\n if (this.stack.length)\n return this.yieldBuf(this.stack.pop());\n let parent = (this.mode & IterMode.IncludeAnonymous) ? this.buffer.parent : this.buffer.parent.nextSignificantParent();\n this.buffer = null;\n return this.yieldNode(parent);\n }\n /**\n @internal\n */\n sibling(dir) {\n if (!this.buffer)\n return !this._tree._parent ? false\n : this.yield(this._tree.index < 0 ? null\n : this._tree._parent.nextChild(this._tree.index + dir, dir, 0, 4 /* Side.DontCare */, this.mode));\n let { buffer } = this.buffer, d = this.stack.length - 1;\n if (dir < 0) {\n let parentStart = d < 0 ? 0 : this.stack[d] + 4;\n if (this.index != parentStart)\n return this.yieldBuf(buffer.findChild(parentStart, this.index, -1, 0, 4 /* Side.DontCare */));\n }\n else {\n let after = buffer.buffer[this.index + 3];\n if (after < (d < 0 ? buffer.buffer.length : buffer.buffer[this.stack[d] + 3]))\n return this.yieldBuf(after);\n }\n return d < 0 ? this.yield(this.buffer.parent.nextChild(this.buffer.index + dir, dir, 0, 4 /* Side.DontCare */, this.mode)) : false;\n }\n /**\n Move to this node's next sibling, if any.\n */\n nextSibling() { return this.sibling(1); }\n /**\n Move to this node's previous sibling, if any.\n */\n prevSibling() { return this.sibling(-1); }\n atLastNode(dir) {\n let index, parent, { buffer } = this;\n if (buffer) {\n if (dir > 0) {\n if (this.index < buffer.buffer.buffer.length)\n return false;\n }\n else {\n for (let i = 0; i < this.index; i++)\n if (buffer.buffer.buffer[i + 3] < this.index)\n return false;\n }\n ({ index, parent } = buffer);\n }\n else {\n ({ index, _parent: parent } = this._tree);\n }\n for (; parent; { index, _parent: parent } = parent) {\n if (index > -1)\n for (let i = index + dir, e = dir < 0 ? -1 : parent._tree.children.length; i != e; i += dir) {\n let child = parent._tree.children[i];\n if ((this.mode & IterMode.IncludeAnonymous) ||\n child instanceof TreeBuffer ||\n !child.type.isAnonymous ||\n hasChild(child))\n return false;\n }\n }\n return true;\n }\n move(dir, enter) {\n if (enter && this.enterChild(dir, 0, 4 /* Side.DontCare */))\n return true;\n for (;;) {\n if (this.sibling(dir))\n return true;\n if (this.atLastNode(dir) || !this.parent())\n return false;\n }\n }\n /**\n Move to the next node in a\n [pre-order](https://en.wikipedia.org/wiki/Tree_traversal#Pre-order,_NLR)\n traversal, going from a node to its first child or, if the\n current node is empty or `enter` is false, its next sibling or\n the next sibling of the first parent node that has one.\n */\n next(enter = true) { return this.move(1, enter); }\n /**\n Move to the next node in a last-to-first pre-order traveral. A\n node is followed by its last child or, if it has none, its\n previous sibling or the previous sibling of the first parent\n node that has one.\n */\n prev(enter = true) { return this.move(-1, enter); }\n /**\n Move the cursor to the innermost node that covers `pos`. If\n `side` is -1, it will enter nodes that end at `pos`. If it is 1,\n it will enter nodes that start at `pos`.\n */\n moveTo(pos, side = 0) {\n // Move up to a node that actually holds the position, if possible\n while (this.from == this.to ||\n (side < 1 ? this.from >= pos : this.from > pos) ||\n (side > -1 ? this.to <= pos : this.to < pos))\n if (!this.parent())\n break;\n // Then scan down into child nodes as far as possible\n while (this.enterChild(1, pos, side)) { }\n return this;\n }\n /**\n Get a [syntax node](#common.SyntaxNode) at the cursor's current\n position.\n */\n get node() {\n if (!this.buffer)\n return this._tree;\n let cache = this.bufferNode, result = null, depth = 0;\n if (cache && cache.context == this.buffer) {\n scan: for (let index = this.index, d = this.stack.length; d >= 0;) {\n for (let c = cache; c; c = c._parent)\n if (c.index == index) {\n if (index == this.index)\n return c;\n result = c;\n depth = d + 1;\n break scan;\n }\n index = this.stack[--d];\n }\n }\n for (let i = depth; i < this.stack.length; i++)\n result = new BufferNode(this.buffer, result, this.stack[i]);\n return this.bufferNode = new BufferNode(this.buffer, result, this.index);\n }\n /**\n Get the [tree](#common.Tree) that represents the current node, if\n any. Will return null when the node is in a [tree\n buffer](#common.TreeBuffer).\n */\n get tree() {\n return this.buffer ? null : this._tree._tree;\n }\n /**\n Iterate over the current node and all its descendants, calling\n `enter` when entering a node and `leave`, if given, when leaving\n one. When `enter` returns `false`, any children of that node are\n skipped, and `leave` isn't called for it.\n */\n iterate(enter, leave) {\n for (let depth = 0;;) {\n let mustLeave = false;\n if (this.type.isAnonymous || enter(this) !== false) {\n if (this.firstChild()) {\n depth++;\n continue;\n }\n if (!this.type.isAnonymous)\n mustLeave = true;\n }\n for (;;) {\n if (mustLeave && leave)\n leave(this);\n mustLeave = this.type.isAnonymous;\n if (this.nextSibling())\n break;\n if (!depth)\n return;\n this.parent();\n depth--;\n mustLeave = true;\n }\n }\n }\n /**\n Test whether the current node matches a given context\u2014a sequence\n of direct parent node names. Empty strings in the context array\n are treated as wildcards.\n */\n matchContext(context) {\n if (!this.buffer)\n return matchNodeContext(this.node, context);\n let { buffer } = this.buffer, { types } = buffer.set;\n for (let i = context.length - 1, d = this.stack.length - 1; i >= 0; d--) {\n if (d < 0)\n return matchNodeContext(this.node, context, i);\n let type = types[buffer.buffer[this.stack[d]]];\n if (!type.isAnonymous) {\n if (context[i] && context[i] != type.name)\n return false;\n i--;\n }\n }\n return true;\n }\n }\n function hasChild(tree) {\n return tree.children.some(ch => ch instanceof TreeBuffer || !ch.type.isAnonymous || hasChild(ch));\n }\n function buildTree(data) {\n var _a;\n let { buffer, nodeSet, maxBufferLength = DefaultBufferLength, reused = [], minRepeatType = nodeSet.types.length } = data;\n let cursor = Array.isArray(buffer) ? new FlatBufferCursor(buffer, buffer.length) : buffer;\n let types = nodeSet.types;\n let contextHash = 0, lookAhead = 0;\n function takeNode(parentStart, minPos, children, positions, inRepeat, depth) {\n let { id, start, end, size } = cursor;\n let lookAheadAtStart = lookAhead;\n while (size < 0) {\n cursor.next();\n if (size == -1 /* SpecialRecord.Reuse */) {\n let node = reused[id];\n children.push(node);\n positions.push(start - parentStart);\n return;\n }\n else if (size == -3 /* SpecialRecord.ContextChange */) { // Context change\n contextHash = id;\n return;\n }\n else if (size == -4 /* SpecialRecord.LookAhead */) {\n lookAhead = id;\n return;\n }\n else {\n throw new RangeError(`Unrecognized record size: ${size}`);\n }\n }\n let type = types[id], node, buffer;\n let startPos = start - parentStart;\n if (end - start <= maxBufferLength && (buffer = findBufferSize(cursor.pos - minPos, inRepeat))) {\n // Small enough for a buffer, and no reused nodes inside\n let data = new Uint16Array(buffer.size - buffer.skip);\n let endPos = cursor.pos - buffer.size, index = data.length;\n while (cursor.pos > endPos)\n index = copyToBuffer(buffer.start, data, index);\n node = new TreeBuffer(data, end - buffer.start, nodeSet);\n startPos = buffer.start - parentStart;\n }\n else { // Make it a node\n let endPos = cursor.pos - size;\n cursor.next();\n let localChildren = [], localPositions = [];\n let localInRepeat = id >= minRepeatType ? id : -1;\n let lastGroup = 0, lastEnd = end;\n while (cursor.pos > endPos) {\n if (localInRepeat >= 0 && cursor.id == localInRepeat && cursor.size >= 0) {\n if (cursor.end <= lastEnd - maxBufferLength) {\n makeRepeatLeaf(localChildren, localPositions, start, lastGroup, cursor.end, lastEnd, localInRepeat, lookAheadAtStart);\n lastGroup = localChildren.length;\n lastEnd = cursor.end;\n }\n cursor.next();\n }\n else if (depth > 2500 /* CutOff.Depth */) {\n takeFlatNode(start, endPos, localChildren, localPositions);\n }\n else {\n takeNode(start, endPos, localChildren, localPositions, localInRepeat, depth + 1);\n }\n }\n if (localInRepeat >= 0 && lastGroup > 0 && lastGroup < localChildren.length)\n makeRepeatLeaf(localChildren, localPositions, start, lastGroup, start, lastEnd, localInRepeat, lookAheadAtStart);\n localChildren.reverse();\n localPositions.reverse();\n if (localInRepeat > -1 && lastGroup > 0) {\n let make = makeBalanced(type);\n node = balanceRange(type, localChildren, localPositions, 0, localChildren.length, 0, end - start, make, make);\n }\n else {\n node = makeTree(type, localChildren, localPositions, end - start, lookAheadAtStart - end);\n }\n }\n children.push(node);\n positions.push(startPos);\n }\n function takeFlatNode(parentStart, minPos, children, positions) {\n let nodes = []; // Temporary, inverted array of leaf nodes found, with absolute positions\n let nodeCount = 0, stopAt = -1;\n while (cursor.pos > minPos) {\n let { id, start, end, size } = cursor;\n if (size > 4) { // Not a leaf\n cursor.next();\n }\n else if (stopAt > -1 && start < stopAt) {\n break;\n }\n else {\n if (stopAt < 0)\n stopAt = end - maxBufferLength;\n nodes.push(id, start, end);\n nodeCount++;\n cursor.next();\n }\n }\n if (nodeCount) {\n let buffer = new Uint16Array(nodeCount * 4);\n let start = nodes[nodes.length - 2];\n for (let i = nodes.length - 3, j = 0; i >= 0; i -= 3) {\n buffer[j++] = nodes[i];\n buffer[j++] = nodes[i + 1] - start;\n buffer[j++] = nodes[i + 2] - start;\n buffer[j++] = j;\n }\n children.push(new TreeBuffer(buffer, nodes[2] - start, nodeSet));\n positions.push(start - parentStart);\n }\n }\n function makeBalanced(type) {\n return (children, positions, length) => {\n let lookAhead = 0, lastI = children.length - 1, last, lookAheadProp;\n if (lastI >= 0 && (last = children[lastI]) instanceof Tree) {\n if (!lastI && last.type == type && last.length == length)\n return last;\n if (lookAheadProp = last.prop(NodeProp.lookAhead))\n lookAhead = positions[lastI] + last.length + lookAheadProp;\n }\n return makeTree(type, children, positions, length, lookAhead);\n };\n }\n function makeRepeatLeaf(children, positions, base, i, from, to, type, lookAhead) {\n let localChildren = [], localPositions = [];\n while (children.length > i) {\n localChildren.push(children.pop());\n localPositions.push(positions.pop() + base - from);\n }\n children.push(makeTree(nodeSet.types[type], localChildren, localPositions, to - from, lookAhead - to));\n positions.push(from - base);\n }\n function makeTree(type, children, positions, length, lookAhead = 0, props) {\n if (contextHash) {\n let pair = [NodeProp.contextHash, contextHash];\n props = props ? [pair].concat(props) : [pair];\n }\n if (lookAhead > 25) {\n let pair = [NodeProp.lookAhead, lookAhead];\n props = props ? [pair].concat(props) : [pair];\n }\n return new Tree(type, children, positions, length, props);\n }\n function findBufferSize(maxSize, inRepeat) {\n // Scan through the buffer to find previous siblings that fit\n // together in a TreeBuffer, and don't contain any reused nodes\n // (which can't be stored in a buffer).\n // If `inRepeat` is > -1, ignore node boundaries of that type for\n // nesting, but make sure the end falls either at the start\n // (`maxSize`) or before such a node.\n let fork = cursor.fork();\n let size = 0, start = 0, skip = 0, minStart = fork.end - maxBufferLength;\n let result = { size: 0, start: 0, skip: 0 };\n scan: for (let minPos = fork.pos - maxSize; fork.pos > minPos;) {\n let nodeSize = fork.size;\n // Pretend nested repeat nodes of the same type don't exist\n if (fork.id == inRepeat && nodeSize >= 0) {\n // Except that we store the current state as a valid return\n // value.\n result.size = size;\n result.start = start;\n result.skip = skip;\n skip += 4;\n size += 4;\n fork.next();\n continue;\n }\n let startPos = fork.pos - nodeSize;\n if (nodeSize < 0 || startPos < minPos || fork.start < minStart)\n break;\n let localSkipped = fork.id >= minRepeatType ? 4 : 0;\n let nodeStart = fork.start;\n fork.next();\n while (fork.pos > startPos) {\n if (fork.size < 0) {\n if (fork.size == -3 /* SpecialRecord.ContextChange */)\n localSkipped += 4;\n else\n break scan;\n }\n else if (fork.id >= minRepeatType) {\n localSkipped += 4;\n }\n fork.next();\n }\n start = nodeStart;\n size += nodeSize;\n skip += localSkipped;\n }\n if (inRepeat < 0 || size == maxSize) {\n result.size = size;\n result.start = start;\n result.skip = skip;\n }\n return result.size > 4 ? result : undefined;\n }\n function copyToBuffer(bufferStart, buffer, index) {\n let { id, start, end, size } = cursor;\n cursor.next();\n if (size >= 0 && id < minRepeatType) {\n let startIndex = index;\n if (size > 4) {\n let endPos = cursor.pos - (size - 4);\n while (cursor.pos > endPos)\n index = copyToBuffer(bufferStart, buffer, index);\n }\n buffer[--index] = startIndex;\n buffer[--index] = end - bufferStart;\n buffer[--index] = start - bufferStart;\n buffer[--index] = id;\n }\n else if (size == -3 /* SpecialRecord.ContextChange */) {\n contextHash = id;\n }\n else if (size == -4 /* SpecialRecord.LookAhead */) {\n lookAhead = id;\n }\n return index;\n }\n let children = [], positions = [];\n while (cursor.pos > 0)\n takeNode(data.start || 0, data.bufferStart || 0, children, positions, -1, 0);\n let length = (_a = data.length) !== null && _a !== void 0 ? _a : (children.length ? positions[0] + children[0].length : 0);\n return new Tree(types[data.topID], children.reverse(), positions.reverse(), length);\n }\n const nodeSizeCache = new WeakMap;\n function nodeSize(balanceType, node) {\n if (!balanceType.isAnonymous || node instanceof TreeBuffer || node.type != balanceType)\n return 1;\n let size = nodeSizeCache.get(node);\n if (size == null) {\n size = 1;\n for (let child of node.children) {\n if (child.type != balanceType || !(child instanceof Tree)) {\n size = 1;\n break;\n }\n size += nodeSize(balanceType, child);\n }\n nodeSizeCache.set(node, size);\n }\n return size;\n }\n function balanceRange(\n // The type the balanced tree's inner nodes.\n balanceType, \n // The direct children and their positions\n children, positions, \n // The index range in children/positions to use\n from, to, \n // The start position of the nodes, relative to their parent.\n start, \n // Length of the outer node\n length, \n // Function to build the top node of the balanced tree\n mkTop, \n // Function to build internal nodes for the balanced tree\n mkTree) {\n let total = 0;\n for (let i = from; i < to; i++)\n total += nodeSize(balanceType, children[i]);\n let maxChild = Math.ceil((total * 1.5) / 8 /* Balance.BranchFactor */);\n let localChildren = [], localPositions = [];\n function divide(children, positions, from, to, offset) {\n for (let i = from; i < to;) {\n let groupFrom = i, groupStart = positions[i], groupSize = nodeSize(balanceType, children[i]);\n i++;\n for (; i < to; i++) {\n let nextSize = nodeSize(balanceType, children[i]);\n if (groupSize + nextSize >= maxChild)\n break;\n groupSize += nextSize;\n }\n if (i == groupFrom + 1) {\n if (groupSize > maxChild) {\n let only = children[groupFrom]; // Only trees can have a size > 1\n divide(only.children, only.positions, 0, only.children.length, positions[groupFrom] + offset);\n continue;\n }\n localChildren.push(children[groupFrom]);\n }\n else {\n let length = positions[i - 1] + children[i - 1].length - groupStart;\n localChildren.push(balanceRange(balanceType, children, positions, groupFrom, i, groupStart, length, null, mkTree));\n }\n localPositions.push(groupStart + offset - start);\n }\n }\n divide(children, positions, from, to, 0);\n return (mkTop || mkTree)(localChildren, localPositions, length);\n }\n /**\n Provides a way to associate values with pieces of trees. As long\n as that part of the tree is reused, the associated values can be\n retrieved from an updated tree.\n */\n class NodeWeakMap {\n constructor() {\n this.map = new WeakMap();\n }\n setBuffer(buffer, index, value) {\n let inner = this.map.get(buffer);\n if (!inner)\n this.map.set(buffer, inner = new Map);\n inner.set(index, value);\n }\n getBuffer(buffer, index) {\n let inner = this.map.get(buffer);\n return inner && inner.get(index);\n }\n /**\n Set the value for this syntax node.\n */\n set(node, value) {\n if (node instanceof BufferNode)\n this.setBuffer(node.context.buffer, node.index, value);\n else if (node instanceof TreeNode)\n this.map.set(node.tree, value);\n }\n /**\n Retrieve value for this syntax node, if it exists in the map.\n */\n get(node) {\n return node instanceof BufferNode ? this.getBuffer(node.context.buffer, node.index)\n : node instanceof TreeNode ? this.map.get(node.tree) : undefined;\n }\n /**\n Set the value for the node that a cursor currently points to.\n */\n cursorSet(cursor, value) {\n if (cursor.buffer)\n this.setBuffer(cursor.buffer.buffer, cursor.index, value);\n else\n this.map.set(cursor.tree, value);\n }\n /**\n Retrieve the value for the node that a cursor currently points\n to.\n */\n cursorGet(cursor) {\n return cursor.buffer ? this.getBuffer(cursor.buffer.buffer, cursor.index) : this.map.get(cursor.tree);\n }\n }\n\n /**\n Tree fragments are used during [incremental\n parsing](#common.Parser.startParse) to track parts of old trees\n that can be reused in a new parse. An array of fragments is used\n to track regions of an old tree whose nodes might be reused in new\n parses. Use the static\n [`applyChanges`](#common.TreeFragment^applyChanges) method to\n update fragments for document changes.\n */\n class TreeFragment {\n /**\n Construct a tree fragment. You'll usually want to use\n [`addTree`](#common.TreeFragment^addTree) and\n [`applyChanges`](#common.TreeFragment^applyChanges) instead of\n calling this directly.\n */\n constructor(\n /**\n The start of the unchanged range pointed to by this fragment.\n This refers to an offset in the _updated_ document (as opposed\n to the original tree).\n */\n from, \n /**\n The end of the unchanged range.\n */\n to, \n /**\n The tree that this fragment is based on.\n */\n tree, \n /**\n The offset between the fragment's tree and the document that\n this fragment can be used against. Add this when going from\n document to tree positions, subtract it to go from tree to\n document positions.\n */\n offset, openStart = false, openEnd = false) {\n this.from = from;\n this.to = to;\n this.tree = tree;\n this.offset = offset;\n this.open = (openStart ? 1 /* Open.Start */ : 0) | (openEnd ? 2 /* Open.End */ : 0);\n }\n /**\n Whether the start of the fragment represents the start of a\n parse, or the end of a change. (In the second case, it may not\n be safe to reuse some nodes at the start, depending on the\n parsing algorithm.)\n */\n get openStart() { return (this.open & 1 /* Open.Start */) > 0; }\n /**\n Whether the end of the fragment represents the end of a\n full-document parse, or the start of a change.\n */\n get openEnd() { return (this.open & 2 /* Open.End */) > 0; }\n /**\n Create a set of fragments from a freshly parsed tree, or update\n an existing set of fragments by replacing the ones that overlap\n with a tree with content from the new tree. When `partial` is\n true, the parse is treated as incomplete, and the resulting\n fragment has [`openEnd`](#common.TreeFragment.openEnd) set to\n true.\n */\n static addTree(tree, fragments = [], partial = false) {\n let result = [new TreeFragment(0, tree.length, tree, 0, false, partial)];\n for (let f of fragments)\n if (f.to > tree.length)\n result.push(f);\n return result;\n }\n /**\n Apply a set of edits to an array of fragments, removing or\n splitting fragments as necessary to remove edited ranges, and\n adjusting offsets for fragments that moved.\n */\n static applyChanges(fragments, changes, minGap = 128) {\n if (!changes.length)\n return fragments;\n let result = [];\n let fI = 1, nextF = fragments.length ? fragments[0] : null;\n for (let cI = 0, pos = 0, off = 0;; cI++) {\n let nextC = cI < changes.length ? changes[cI] : null;\n let nextPos = nextC ? nextC.fromA : 1e9;\n if (nextPos - pos >= minGap)\n while (nextF && nextF.from < nextPos) {\n let cut = nextF;\n if (pos >= cut.from || nextPos <= cut.to || off) {\n let fFrom = Math.max(cut.from, pos) - off, fTo = Math.min(cut.to, nextPos) - off;\n cut = fFrom >= fTo ? null : new TreeFragment(fFrom, fTo, cut.tree, cut.offset + off, cI > 0, !!nextC);\n }\n if (cut)\n result.push(cut);\n if (nextF.to > nextPos)\n break;\n nextF = fI < fragments.length ? fragments[fI++] : null;\n }\n if (!nextC)\n break;\n pos = nextC.toA;\n off = nextC.toA - nextC.toB;\n }\n return result;\n }\n }\n /**\n A superclass that parsers should extend.\n */\n class Parser {\n /**\n Start a parse, returning a [partial parse](#common.PartialParse)\n object. [`fragments`](#common.TreeFragment) can be passed in to\n make the parse incremental.\n \n By default, the entire input is parsed. You can pass `ranges`,\n which should be a sorted array of non-empty, non-overlapping\n ranges, to parse only those ranges. The tree returned in that\n case will start at `ranges[0].from`.\n */\n startParse(input, fragments, ranges) {\n if (typeof input == \"string\")\n input = new StringInput(input);\n ranges = !ranges ? [new Range(0, input.length)] : ranges.length ? ranges.map(r => new Range(r.from, r.to)) : [new Range(0, 0)];\n return this.createParse(input, fragments || [], ranges);\n }\n /**\n Run a full parse, returning the resulting tree.\n */\n parse(input, fragments, ranges) {\n let parse = this.startParse(input, fragments, ranges);\n for (;;) {\n let done = parse.advance();\n if (done)\n return done;\n }\n }\n }\n class StringInput {\n constructor(string) {\n this.string = string;\n }\n get length() { return this.string.length; }\n chunk(from) { return this.string.slice(from); }\n get lineChunks() { return false; }\n read(from, to) { return this.string.slice(from, to); }\n }\n\n /**\n Create a parse wrapper that, after the inner parse completes,\n scans its tree for mixed language regions with the `nest`\n function, runs the resulting [inner parses](#common.NestedParse),\n and then [mounts](#common.NodeProp^mounted) their results onto the\n tree.\n */\n function parseMixed(nest) {\n return (parse, input, fragments, ranges) => new MixedParse(parse, nest, input, fragments, ranges);\n }\n class InnerParse {\n constructor(parser, parse, overlay, target, from) {\n this.parser = parser;\n this.parse = parse;\n this.overlay = overlay;\n this.target = target;\n this.from = from;\n }\n }\n function checkRanges(ranges) {\n if (!ranges.length || ranges.some(r => r.from >= r.to))\n throw new RangeError(\"Invalid inner parse ranges given: \" + JSON.stringify(ranges));\n }\n class ActiveOverlay {\n constructor(parser, predicate, mounts, index, start, target, prev) {\n this.parser = parser;\n this.predicate = predicate;\n this.mounts = mounts;\n this.index = index;\n this.start = start;\n this.target = target;\n this.prev = prev;\n this.depth = 0;\n this.ranges = [];\n }\n }\n const stoppedInner = new NodeProp({ perNode: true });\n class MixedParse {\n constructor(base, nest, input, fragments, ranges) {\n this.nest = nest;\n this.input = input;\n this.fragments = fragments;\n this.ranges = ranges;\n this.inner = [];\n this.innerDone = 0;\n this.baseTree = null;\n this.stoppedAt = null;\n this.baseParse = base;\n }\n advance() {\n if (this.baseParse) {\n let done = this.baseParse.advance();\n if (!done)\n return null;\n this.baseParse = null;\n this.baseTree = done;\n this.startInner();\n if (this.stoppedAt != null)\n for (let inner of this.inner)\n inner.parse.stopAt(this.stoppedAt);\n }\n if (this.innerDone == this.inner.length) {\n let result = this.baseTree;\n if (this.stoppedAt != null)\n result = new Tree(result.type, result.children, result.positions, result.length, result.propValues.concat([[stoppedInner, this.stoppedAt]]));\n return result;\n }\n let inner = this.inner[this.innerDone], done = inner.parse.advance();\n if (done) {\n this.innerDone++;\n // This is a somewhat dodgy but super helpful hack where we\n // patch up nodes created by the inner parse (and thus\n // presumably not aliased anywhere else) to hold the information\n // about the inner parse.\n let props = Object.assign(Object.create(null), inner.target.props);\n props[NodeProp.mounted.id] = new MountedTree(done, inner.overlay, inner.parser);\n inner.target.props = props;\n }\n return null;\n }\n get parsedPos() {\n if (this.baseParse)\n return 0;\n let pos = this.input.length;\n for (let i = this.innerDone; i < this.inner.length; i++) {\n if (this.inner[i].from < pos)\n pos = Math.min(pos, this.inner[i].parse.parsedPos);\n }\n return pos;\n }\n stopAt(pos) {\n this.stoppedAt = pos;\n if (this.baseParse)\n this.baseParse.stopAt(pos);\n else\n for (let i = this.innerDone; i < this.inner.length; i++)\n this.inner[i].parse.stopAt(pos);\n }\n startInner() {\n let fragmentCursor = new FragmentCursor$2(this.fragments);\n let overlay = null;\n let covered = null;\n let cursor = new TreeCursor(new TreeNode(this.baseTree, this.ranges[0].from, 0, null), IterMode.IncludeAnonymous | IterMode.IgnoreMounts);\n scan: for (let nest, isCovered;;) {\n let enter = true, range;\n if (this.stoppedAt != null && cursor.from >= this.stoppedAt) {\n enter = false;\n }\n else if (fragmentCursor.hasNode(cursor)) {\n if (overlay) {\n let match = overlay.mounts.find(m => m.frag.from <= cursor.from && m.frag.to >= cursor.to && m.mount.overlay);\n if (match)\n for (let r of match.mount.overlay) {\n let from = r.from + match.pos, to = r.to + match.pos;\n if (from >= cursor.from && to <= cursor.to && !overlay.ranges.some(r => r.from < to && r.to > from))\n overlay.ranges.push({ from, to });\n }\n }\n enter = false;\n }\n else if (covered && (isCovered = checkCover(covered.ranges, cursor.from, cursor.to))) {\n enter = isCovered != 2 /* Cover.Full */;\n }\n else if (!cursor.type.isAnonymous && (nest = this.nest(cursor, this.input)) &&\n (cursor.from < cursor.to || !nest.overlay)) {\n if (!cursor.tree)\n materialize(cursor);\n let oldMounts = fragmentCursor.findMounts(cursor.from, nest.parser);\n if (typeof nest.overlay == \"function\") {\n overlay = new ActiveOverlay(nest.parser, nest.overlay, oldMounts, this.inner.length, cursor.from, cursor.tree, overlay);\n }\n else {\n let ranges = punchRanges(this.ranges, nest.overlay ||\n (cursor.from < cursor.to ? [new Range(cursor.from, cursor.to)] : []));\n if (ranges.length)\n checkRanges(ranges);\n if (ranges.length || !nest.overlay)\n this.inner.push(new InnerParse(nest.parser, ranges.length ? nest.parser.startParse(this.input, enterFragments(oldMounts, ranges), ranges)\n : nest.parser.startParse(\"\"), nest.overlay ? nest.overlay.map(r => new Range(r.from - cursor.from, r.to - cursor.from)) : null, cursor.tree, ranges.length ? ranges[0].from : cursor.from));\n if (!nest.overlay)\n enter = false;\n else if (ranges.length)\n covered = { ranges, depth: 0, prev: covered };\n }\n }\n else if (overlay && (range = overlay.predicate(cursor))) {\n if (range === true)\n range = new Range(cursor.from, cursor.to);\n if (range.from < range.to)\n overlay.ranges.push(range);\n }\n if (enter && cursor.firstChild()) {\n if (overlay)\n overlay.depth++;\n if (covered)\n covered.depth++;\n }\n else {\n for (;;) {\n if (cursor.nextSibling())\n break;\n if (!cursor.parent())\n break scan;\n if (overlay && !--overlay.depth) {\n let ranges = punchRanges(this.ranges, overlay.ranges);\n if (ranges.length) {\n checkRanges(ranges);\n this.inner.splice(overlay.index, 0, new InnerParse(overlay.parser, overlay.parser.startParse(this.input, enterFragments(overlay.mounts, ranges), ranges), overlay.ranges.map(r => new Range(r.from - overlay.start, r.to - overlay.start)), overlay.target, ranges[0].from));\n }\n overlay = overlay.prev;\n }\n if (covered && !--covered.depth)\n covered = covered.prev;\n }\n }\n }\n }\n }\n function checkCover(covered, from, to) {\n for (let range of covered) {\n if (range.from >= to)\n break;\n if (range.to > from)\n return range.from <= from && range.to >= to ? 2 /* Cover.Full */ : 1 /* Cover.Partial */;\n }\n return 0 /* Cover.None */;\n }\n // Take a piece of buffer and convert it into a stand-alone\n // TreeBuffer.\n function sliceBuf(buf, startI, endI, nodes, positions, off) {\n if (startI < endI) {\n let from = buf.buffer[startI + 1];\n nodes.push(buf.slice(startI, endI, from));\n positions.push(from - off);\n }\n }\n // This function takes a node that's in a buffer, and converts it, and\n // its parent buffer nodes, into a Tree. This is again acting on the\n // assumption that the trees and buffers have been constructed by the\n // parse that was ran via the mix parser, and thus aren't shared with\n // any other code, making violations of the immutability safe.\n function materialize(cursor) {\n let { node } = cursor, stack = [];\n let buffer = node.context.buffer;\n // Scan up to the nearest tree\n do {\n stack.push(cursor.index);\n cursor.parent();\n } while (!cursor.tree);\n // Find the index of the buffer in that tree\n let base = cursor.tree, i = base.children.indexOf(buffer);\n let buf = base.children[i], b = buf.buffer, newStack = [i];\n // Split a level in the buffer, putting the nodes before and after\n // the child that contains `node` into new buffers.\n function split(startI, endI, type, innerOffset, length, stackPos) {\n let targetI = stack[stackPos];\n let children = [], positions = [];\n sliceBuf(buf, startI, targetI, children, positions, innerOffset);\n let from = b[targetI + 1], to = b[targetI + 2];\n newStack.push(children.length);\n let child = stackPos\n ? split(targetI + 4, b[targetI + 3], buf.set.types[b[targetI]], from, to - from, stackPos - 1)\n : node.toTree();\n children.push(child);\n positions.push(from - innerOffset);\n sliceBuf(buf, b[targetI + 3], endI, children, positions, innerOffset);\n return new Tree(type, children, positions, length);\n }\n base.children[i] = split(0, b.length, NodeType.none, 0, buf.length, stack.length - 1);\n // Move the cursor back to the target node\n for (let index of newStack) {\n let tree = cursor.tree.children[index], pos = cursor.tree.positions[index];\n cursor.yield(new TreeNode(tree, pos + cursor.from, index, cursor._tree));\n }\n }\n class StructureCursor {\n constructor(root, offset) {\n this.offset = offset;\n this.done = false;\n this.cursor = root.cursor(IterMode.IncludeAnonymous | IterMode.IgnoreMounts);\n }\n // Move to the first node (in pre-order) that starts at or after `pos`.\n moveTo(pos) {\n let { cursor } = this, p = pos - this.offset;\n while (!this.done && cursor.from < p) {\n if (cursor.to >= pos && cursor.enter(p, 1, IterMode.IgnoreOverlays | IterMode.ExcludeBuffers)) ;\n else if (!cursor.next(false))\n this.done = true;\n }\n }\n hasNode(cursor) {\n this.moveTo(cursor.from);\n if (!this.done && this.cursor.from + this.offset == cursor.from && this.cursor.tree) {\n for (let tree = this.cursor.tree;;) {\n if (tree == cursor.tree)\n return true;\n if (tree.children.length && tree.positions[0] == 0 && tree.children[0] instanceof Tree)\n tree = tree.children[0];\n else\n break;\n }\n }\n return false;\n }\n }\n class FragmentCursor$2 {\n constructor(fragments) {\n var _a;\n this.fragments = fragments;\n this.curTo = 0;\n this.fragI = 0;\n if (fragments.length) {\n let first = this.curFrag = fragments[0];\n this.curTo = (_a = first.tree.prop(stoppedInner)) !== null && _a !== void 0 ? _a : first.to;\n this.inner = new StructureCursor(first.tree, -first.offset);\n }\n else {\n this.curFrag = this.inner = null;\n }\n }\n hasNode(node) {\n while (this.curFrag && node.from >= this.curTo)\n this.nextFrag();\n return this.curFrag && this.curFrag.from <= node.from && this.curTo >= node.to && this.inner.hasNode(node);\n }\n nextFrag() {\n var _a;\n this.fragI++;\n if (this.fragI == this.fragments.length) {\n this.curFrag = this.inner = null;\n }\n else {\n let frag = this.curFrag = this.fragments[this.fragI];\n this.curTo = (_a = frag.tree.prop(stoppedInner)) !== null && _a !== void 0 ? _a : frag.to;\n this.inner = new StructureCursor(frag.tree, -frag.offset);\n }\n }\n findMounts(pos, parser) {\n var _a;\n let result = [];\n if (this.inner) {\n this.inner.cursor.moveTo(pos, 1);\n for (let pos = this.inner.cursor.node; pos; pos = pos.parent) {\n let mount = (_a = pos.tree) === null || _a === void 0 ? void 0 : _a.prop(NodeProp.mounted);\n if (mount && mount.parser == parser) {\n for (let i = this.fragI; i < this.fragments.length; i++) {\n let frag = this.fragments[i];\n if (frag.from >= pos.to)\n break;\n if (frag.tree == this.curFrag.tree)\n result.push({\n frag,\n pos: pos.from - frag.offset,\n mount\n });\n }\n }\n }\n }\n return result;\n }\n }\n function punchRanges(outer, ranges) {\n let copy = null, current = ranges;\n for (let i = 1, j = 0; i < outer.length; i++) {\n let gapFrom = outer[i - 1].to, gapTo = outer[i].from;\n for (; j < current.length; j++) {\n let r = current[j];\n if (r.from >= gapTo)\n break;\n if (r.to <= gapFrom)\n continue;\n if (!copy)\n current = copy = ranges.slice();\n if (r.from < gapFrom) {\n copy[j] = new Range(r.from, gapFrom);\n if (r.to > gapTo)\n copy.splice(j + 1, 0, new Range(gapTo, r.to));\n }\n else if (r.to > gapTo) {\n copy[j--] = new Range(gapTo, r.to);\n }\n else {\n copy.splice(j--, 1);\n }\n }\n }\n return current;\n }\n function findCoverChanges(a, b, from, to) {\n let iA = 0, iB = 0, inA = false, inB = false, pos = -1e9;\n let result = [];\n for (;;) {\n let nextA = iA == a.length ? 1e9 : inA ? a[iA].to : a[iA].from;\n let nextB = iB == b.length ? 1e9 : inB ? b[iB].to : b[iB].from;\n if (inA != inB) {\n let start = Math.max(pos, from), end = Math.min(nextA, nextB, to);\n if (start < end)\n result.push(new Range(start, end));\n }\n pos = Math.min(nextA, nextB);\n if (pos == 1e9)\n break;\n if (nextA == pos) {\n if (!inA)\n inA = true;\n else {\n inA = false;\n iA++;\n }\n }\n if (nextB == pos) {\n if (!inB)\n inB = true;\n else {\n inB = false;\n iB++;\n }\n }\n }\n return result;\n }\n // Given a number of fragments for the outer tree, and a set of ranges\n // to parse, find fragments for inner trees mounted around those\n // ranges, if any.\n function enterFragments(mounts, ranges) {\n let result = [];\n for (let { pos, mount, frag } of mounts) {\n let startPos = pos + (mount.overlay ? mount.overlay[0].from : 0), endPos = startPos + mount.tree.length;\n let from = Math.max(frag.from, startPos), to = Math.min(frag.to, endPos);\n if (mount.overlay) {\n let overlay = mount.overlay.map(r => new Range(r.from + pos, r.to + pos));\n let changes = findCoverChanges(ranges, overlay, from, to);\n for (let i = 0, pos = from;; i++) {\n let last = i == changes.length, end = last ? to : changes[i].from;\n if (end > pos)\n result.push(new TreeFragment(pos, end, mount.tree, -startPos, frag.from >= pos || frag.openStart, frag.to <= end || frag.openEnd));\n if (last)\n break;\n pos = changes[i].to;\n }\n }\n else {\n result.push(new TreeFragment(from, to, mount.tree, -startPos, frag.from >= startPos || frag.openStart, frag.to <= endPos || frag.openEnd));\n }\n }\n return result;\n }\n\n let nextTagID = 0;\n /**\n Highlighting tags are markers that denote a highlighting category.\n They are [associated](#highlight.styleTags) with parts of a syntax\n tree by a language mode, and then mapped to an actual CSS style by\n a [highlighter](#highlight.Highlighter).\n\n Because syntax tree node types and highlight styles have to be\n able to talk the same language, CodeMirror uses a mostly _closed_\n [vocabulary](#highlight.tags) of syntax tags (as opposed to\n traditional open string-based systems, which make it hard for\n highlighting themes to cover all the tokens produced by the\n various languages).\n\n It _is_ possible to [define](#highlight.Tag^define) your own\n highlighting tags for system-internal use (where you control both\n the language package and the highlighter), but such tags will not\n be picked up by regular highlighters (though you can derive them\n from standard tags to allow highlighters to fall back to those).\n */\n class Tag {\n /**\n @internal\n */\n constructor(\n /**\n The set of this tag and all its parent tags, starting with\n this one itself and sorted in order of decreasing specificity.\n */\n set, \n /**\n The base unmodified tag that this one is based on, if it's\n modified @internal\n */\n base, \n /**\n The modifiers applied to this.base @internal\n */\n modified) {\n this.set = set;\n this.base = base;\n this.modified = modified;\n /**\n @internal\n */\n this.id = nextTagID++;\n }\n /**\n Define a new tag. If `parent` is given, the tag is treated as a\n sub-tag of that parent, and\n [highlighters](#highlight.tagHighlighter) that don't mention\n this tag will try to fall back to the parent tag (or grandparent\n tag, etc).\n */\n static define(parent) {\n if (parent === null || parent === void 0 ? void 0 : parent.base)\n throw new Error(\"Can not derive from a modified tag\");\n let tag = new Tag([], null, []);\n tag.set.push(tag);\n if (parent)\n for (let t of parent.set)\n tag.set.push(t);\n return tag;\n }\n /**\n Define a tag _modifier_, which is a function that, given a tag,\n will return a tag that is a subtag of the original. Applying the\n same modifier to a twice tag will return the same value (`m1(t1)\n == m1(t1)`) and applying multiple modifiers will, regardless or\n order, produce the same tag (`m1(m2(t1)) == m2(m1(t1))`).\n \n When multiple modifiers are applied to a given base tag, each\n smaller set of modifiers is registered as a parent, so that for\n example `m1(m2(m3(t1)))` is a subtype of `m1(m2(t1))`,\n `m1(m3(t1)`, and so on.\n */\n static defineModifier() {\n let mod = new Modifier;\n return (tag) => {\n if (tag.modified.indexOf(mod) > -1)\n return tag;\n return Modifier.get(tag.base || tag, tag.modified.concat(mod).sort((a, b) => a.id - b.id));\n };\n }\n }\n let nextModifierID = 0;\n class Modifier {\n constructor() {\n this.instances = [];\n this.id = nextModifierID++;\n }\n static get(base, mods) {\n if (!mods.length)\n return base;\n let exists = mods[0].instances.find(t => t.base == base && sameArray(mods, t.modified));\n if (exists)\n return exists;\n let set = [], tag = new Tag(set, base, mods);\n for (let m of mods)\n m.instances.push(tag);\n let configs = powerSet(mods);\n for (let parent of base.set)\n if (!parent.modified.length)\n for (let config of configs)\n set.push(Modifier.get(parent, config));\n return tag;\n }\n }\n function sameArray(a, b) {\n return a.length == b.length && a.every((x, i) => x == b[i]);\n }\n function powerSet(array) {\n let sets = [[]];\n for (let i = 0; i < array.length; i++) {\n for (let j = 0, e = sets.length; j < e; j++) {\n sets.push(sets[j].concat(array[i]));\n }\n }\n return sets.sort((a, b) => b.length - a.length);\n }\n /**\n This function is used to add a set of tags to a language syntax\n via [`NodeSet.extend`](#common.NodeSet.extend) or\n [`LRParser.configure`](#lr.LRParser.configure).\n\n The argument object maps node selectors to [highlighting\n tags](#highlight.Tag) or arrays of tags.\n\n Node selectors may hold one or more (space-separated) node paths.\n Such a path can be a [node name](#common.NodeType.name), or\n multiple node names (or `*` wildcards) separated by slash\n characters, as in `\"Block/Declaration/VariableName\"`. Such a path\n matches the final node but only if its direct parent nodes are the\n other nodes mentioned. A `*` in such a path matches any parent,\n but only a single level\u2014wildcards that match multiple parents\n aren't supported, both for efficiency reasons and because Lezer\n trees make it rather hard to reason about what they would match.)\n\n A path can be ended with `/...` to indicate that the tag assigned\n to the node should also apply to all child nodes, even if they\n match their own style (by default, only the innermost style is\n used).\n\n When a path ends in `!`, as in `Attribute!`, no further matching\n happens for the node's child nodes, and the entire node gets the\n given style.\n\n In this notation, node names that contain `/`, `!`, `*`, or `...`\n must be quoted as JSON strings.\n\n For example:\n\n ```javascript\n parser.withProps(\n styleTags({\n // Style Number and BigNumber nodes\n \"Number BigNumber\": tags.number,\n // Style Escape nodes whose parent is String\n \"String/Escape\": tags.escape,\n // Style anything inside Attributes nodes\n \"Attributes!\": tags.meta,\n // Add a style to all content inside Italic nodes\n \"Italic/...\": tags.emphasis,\n // Style InvalidString nodes as both `string` and `invalid`\n \"InvalidString\": [tags.string, tags.invalid],\n // Style the node named \"/\" as punctuation\n '\"/\"': tags.punctuation\n })\n )\n ```\n */\n function styleTags(spec) {\n let byName = Object.create(null);\n for (let prop in spec) {\n let tags = spec[prop];\n if (!Array.isArray(tags))\n tags = [tags];\n for (let part of prop.split(\" \"))\n if (part) {\n let pieces = [], mode = 2 /* Mode.Normal */, rest = part;\n for (let pos = 0;;) {\n if (rest == \"...\" && pos > 0 && pos + 3 == part.length) {\n mode = 1 /* Mode.Inherit */;\n break;\n }\n let m = /^\"(?:[^\"\\\\]|\\\\.)*?\"|[^\\/!]+/.exec(rest);\n if (!m)\n throw new RangeError(\"Invalid path: \" + part);\n pieces.push(m[0] == \"*\" ? \"\" : m[0][0] == '\"' ? JSON.parse(m[0]) : m[0]);\n pos += m[0].length;\n if (pos == part.length)\n break;\n let next = part[pos++];\n if (pos == part.length && next == \"!\") {\n mode = 0 /* Mode.Opaque */;\n break;\n }\n if (next != \"/\")\n throw new RangeError(\"Invalid path: \" + part);\n rest = part.slice(pos);\n }\n let last = pieces.length - 1, inner = pieces[last];\n if (!inner)\n throw new RangeError(\"Invalid path: \" + part);\n let rule = new Rule(tags, mode, last > 0 ? pieces.slice(0, last) : null);\n byName[inner] = rule.sort(byName[inner]);\n }\n }\n return ruleNodeProp.add(byName);\n }\n const ruleNodeProp = new NodeProp();\n class Rule {\n constructor(tags, mode, context, next) {\n this.tags = tags;\n this.mode = mode;\n this.context = context;\n this.next = next;\n }\n get opaque() { return this.mode == 0 /* Mode.Opaque */; }\n get inherit() { return this.mode == 1 /* Mode.Inherit */; }\n sort(other) {\n if (!other || other.depth < this.depth) {\n this.next = other;\n return this;\n }\n other.next = this.sort(other.next);\n return other;\n }\n get depth() { return this.context ? this.context.length : 0; }\n }\n Rule.empty = new Rule([], 2 /* Mode.Normal */, null);\n /**\n Define a [highlighter](#highlight.Highlighter) from an array of\n tag/class pairs. Classes associated with more specific tags will\n take precedence.\n */\n function tagHighlighter(tags, options) {\n let map = Object.create(null);\n for (let style of tags) {\n if (!Array.isArray(style.tag))\n map[style.tag.id] = style.class;\n else\n for (let tag of style.tag)\n map[tag.id] = style.class;\n }\n let { scope, all = null } = options || {};\n return {\n style: (tags) => {\n let cls = all;\n for (let tag of tags) {\n for (let sub of tag.set) {\n let tagClass = map[sub.id];\n if (tagClass) {\n cls = cls ? cls + \" \" + tagClass : tagClass;\n break;\n }\n }\n }\n return cls;\n },\n scope\n };\n }\n function highlightTags(highlighters, tags) {\n let result = null;\n for (let highlighter of highlighters) {\n let value = highlighter.style(tags);\n if (value)\n result = result ? result + \" \" + value : value;\n }\n return result;\n }\n /**\n Highlight the given [tree](#common.Tree) with the given\n [highlighter](#highlight.Highlighter). Often, the higher-level\n [`highlightCode`](#highlight.highlightCode) function is easier to\n use.\n */\n function highlightTree(tree, highlighter, \n /**\n Assign styling to a region of the text. Will be called, in order\n of position, for any ranges where more than zero classes apply.\n `classes` is a space separated string of CSS classes.\n */\n putStyle, \n /**\n The start of the range to highlight.\n */\n from = 0, \n /**\n The end of the range.\n */\n to = tree.length) {\n let builder = new HighlightBuilder(from, Array.isArray(highlighter) ? highlighter : [highlighter], putStyle);\n builder.highlightRange(tree.cursor(), from, to, \"\", builder.highlighters);\n builder.flush(to);\n }\n class HighlightBuilder {\n constructor(at, highlighters, span) {\n this.at = at;\n this.highlighters = highlighters;\n this.span = span;\n this.class = \"\";\n }\n startSpan(at, cls) {\n if (cls != this.class) {\n this.flush(at);\n if (at > this.at)\n this.at = at;\n this.class = cls;\n }\n }\n flush(to) {\n if (to > this.at && this.class)\n this.span(this.at, to, this.class);\n }\n highlightRange(cursor, from, to, inheritedClass, highlighters) {\n let { type, from: start, to: end } = cursor;\n if (start >= to || end <= from)\n return;\n if (type.isTop)\n highlighters = this.highlighters.filter(h => !h.scope || h.scope(type));\n let cls = inheritedClass;\n let rule = getStyleTags(cursor) || Rule.empty;\n let tagCls = highlightTags(highlighters, rule.tags);\n if (tagCls) {\n if (cls)\n cls += \" \";\n cls += tagCls;\n if (rule.mode == 1 /* Mode.Inherit */)\n inheritedClass += (inheritedClass ? \" \" : \"\") + tagCls;\n }\n this.startSpan(Math.max(from, start), cls);\n if (rule.opaque)\n return;\n let mounted = cursor.tree && cursor.tree.prop(NodeProp.mounted);\n if (mounted && mounted.overlay) {\n let inner = cursor.node.enter(mounted.overlay[0].from + start, 1);\n let innerHighlighters = this.highlighters.filter(h => !h.scope || h.scope(mounted.tree.type));\n let hasChild = cursor.firstChild();\n for (let i = 0, pos = start;; i++) {\n let next = i < mounted.overlay.length ? mounted.overlay[i] : null;\n let nextPos = next ? next.from + start : end;\n let rangeFrom = Math.max(from, pos), rangeTo = Math.min(to, nextPos);\n if (rangeFrom < rangeTo && hasChild) {\n while (cursor.from < rangeTo) {\n this.highlightRange(cursor, rangeFrom, rangeTo, inheritedClass, highlighters);\n this.startSpan(Math.min(rangeTo, cursor.to), cls);\n if (cursor.to >= nextPos || !cursor.nextSibling())\n break;\n }\n }\n if (!next || nextPos > to)\n break;\n pos = next.to + start;\n if (pos > from) {\n this.highlightRange(inner.cursor(), Math.max(from, next.from + start), Math.min(to, pos), \"\", innerHighlighters);\n this.startSpan(Math.min(to, pos), cls);\n }\n }\n if (hasChild)\n cursor.parent();\n }\n else if (cursor.firstChild()) {\n if (mounted)\n inheritedClass = \"\";\n do {\n if (cursor.to <= from)\n continue;\n if (cursor.from >= to)\n break;\n this.highlightRange(cursor, from, to, inheritedClass, highlighters);\n this.startSpan(Math.min(to, cursor.to), cls);\n } while (cursor.nextSibling());\n cursor.parent();\n }\n }\n }\n /**\n Match a syntax node's [highlight rules](#highlight.styleTags). If\n there's a match, return its set of tags, and whether it is\n opaque (uses a `!`) or applies to all child nodes (`/...`).\n */\n function getStyleTags(node) {\n let rule = node.type.prop(ruleNodeProp);\n while (rule && rule.context && !node.matchContext(rule.context))\n rule = rule.next;\n return rule || null;\n }\n const t = Tag.define;\n const comment = t(), name = t(), typeName = t(name), propertyName = t(name), literal$3 = t(), string = t(literal$3), number = t(literal$3), content = t(), heading = t(content), keyword = t(), operator$2 = t(), punctuation = t(), bracket$2 = t(punctuation), meta = t();\n /**\n The default set of highlighting [tags](#highlight.Tag).\n\n This collection is heavily biased towards programming languages,\n and necessarily incomplete. A full ontology of syntactic\n constructs would fill a stack of books, and be impractical to\n write themes for. So try to make do with this set. If all else\n fails, [open an\n issue](https://github.com/codemirror/codemirror.next) to propose a\n new tag, or [define](#highlight.Tag^define) a local custom tag for\n your use case.\n\n Note that it is not obligatory to always attach the most specific\n tag possible to an element\u2014if your grammar can't easily\n distinguish a certain type of element (such as a local variable),\n it is okay to style it as its more general variant (a variable).\n\n For tags that extend some parent tag, the documentation links to\n the parent.\n */\n const tags$1 = {\n /**\n A comment.\n */\n comment,\n /**\n A line [comment](#highlight.tags.comment).\n */\n lineComment: t(comment),\n /**\n A block [comment](#highlight.tags.comment).\n */\n blockComment: t(comment),\n /**\n A documentation [comment](#highlight.tags.comment).\n */\n docComment: t(comment),\n /**\n Any kind of identifier.\n */\n name,\n /**\n The [name](#highlight.tags.name) of a variable.\n */\n variableName: t(name),\n /**\n A type [name](#highlight.tags.name).\n */\n typeName: typeName,\n /**\n A tag name (subtag of [`typeName`](#highlight.tags.typeName)).\n */\n tagName: t(typeName),\n /**\n A property or field [name](#highlight.tags.name).\n */\n propertyName: propertyName,\n /**\n An attribute name (subtag of [`propertyName`](#highlight.tags.propertyName)).\n */\n attributeName: t(propertyName),\n /**\n The [name](#highlight.tags.name) of a class.\n */\n className: t(name),\n /**\n A label [name](#highlight.tags.name).\n */\n labelName: t(name),\n /**\n A namespace [name](#highlight.tags.name).\n */\n namespace: t(name),\n /**\n The [name](#highlight.tags.name) of a macro.\n */\n macroName: t(name),\n /**\n A literal value.\n */\n literal: literal$3,\n /**\n A string [literal](#highlight.tags.literal).\n */\n string,\n /**\n A documentation [string](#highlight.tags.string).\n */\n docString: t(string),\n /**\n A character literal (subtag of [string](#highlight.tags.string)).\n */\n character: t(string),\n /**\n An attribute value (subtag of [string](#highlight.tags.string)).\n */\n attributeValue: t(string),\n /**\n A number [literal](#highlight.tags.literal).\n */\n number,\n /**\n An integer [number](#highlight.tags.number) literal.\n */\n integer: t(number),\n /**\n A floating-point [number](#highlight.tags.number) literal.\n */\n float: t(number),\n /**\n A boolean [literal](#highlight.tags.literal).\n */\n bool: t(literal$3),\n /**\n Regular expression [literal](#highlight.tags.literal).\n */\n regexp: t(literal$3),\n /**\n An escape [literal](#highlight.tags.literal), for example a\n backslash escape in a string.\n */\n escape: t(literal$3),\n /**\n A color [literal](#highlight.tags.literal).\n */\n color: t(literal$3),\n /**\n A URL [literal](#highlight.tags.literal).\n */\n url: t(literal$3),\n /**\n A language keyword.\n */\n keyword,\n /**\n The [keyword](#highlight.tags.keyword) for the self or this\n object.\n */\n self: t(keyword),\n /**\n The [keyword](#highlight.tags.keyword) for null.\n */\n null: t(keyword),\n /**\n A [keyword](#highlight.tags.keyword) denoting some atomic value.\n */\n atom: t(keyword),\n /**\n A [keyword](#highlight.tags.keyword) that represents a unit.\n */\n unit: t(keyword),\n /**\n A modifier [keyword](#highlight.tags.keyword).\n */\n modifier: t(keyword),\n /**\n A [keyword](#highlight.tags.keyword) that acts as an operator.\n */\n operatorKeyword: t(keyword),\n /**\n A control-flow related [keyword](#highlight.tags.keyword).\n */\n controlKeyword: t(keyword),\n /**\n A [keyword](#highlight.tags.keyword) that defines something.\n */\n definitionKeyword: t(keyword),\n /**\n A [keyword](#highlight.tags.keyword) related to defining or\n interfacing with modules.\n */\n moduleKeyword: t(keyword),\n /**\n An operator.\n */\n operator: operator$2,\n /**\n An [operator](#highlight.tags.operator) that dereferences something.\n */\n derefOperator: t(operator$2),\n /**\n Arithmetic-related [operator](#highlight.tags.operator).\n */\n arithmeticOperator: t(operator$2),\n /**\n Logical [operator](#highlight.tags.operator).\n */\n logicOperator: t(operator$2),\n /**\n Bit [operator](#highlight.tags.operator).\n */\n bitwiseOperator: t(operator$2),\n /**\n Comparison [operator](#highlight.tags.operator).\n */\n compareOperator: t(operator$2),\n /**\n [Operator](#highlight.tags.operator) that updates its operand.\n */\n updateOperator: t(operator$2),\n /**\n [Operator](#highlight.tags.operator) that defines something.\n */\n definitionOperator: t(operator$2),\n /**\n Type-related [operator](#highlight.tags.operator).\n */\n typeOperator: t(operator$2),\n /**\n Control-flow [operator](#highlight.tags.operator).\n */\n controlOperator: t(operator$2),\n /**\n Program or markup punctuation.\n */\n punctuation,\n /**\n [Punctuation](#highlight.tags.punctuation) that separates\n things.\n */\n separator: t(punctuation),\n /**\n Bracket-style [punctuation](#highlight.tags.punctuation).\n */\n bracket: bracket$2,\n /**\n Angle [brackets](#highlight.tags.bracket) (usually `<` and `>`\n tokens).\n */\n angleBracket: t(bracket$2),\n /**\n Square [brackets](#highlight.tags.bracket) (usually `[` and `]`\n tokens).\n */\n squareBracket: t(bracket$2),\n /**\n Parentheses (usually `(` and `)` tokens). Subtag of\n [bracket](#highlight.tags.bracket).\n */\n paren: t(bracket$2),\n /**\n Braces (usually `{` and `}` tokens). Subtag of\n [bracket](#highlight.tags.bracket).\n */\n brace: t(bracket$2),\n /**\n Content, for example plain text in XML or markup documents.\n */\n content,\n /**\n [Content](#highlight.tags.content) that represents a heading.\n */\n heading,\n /**\n A level 1 [heading](#highlight.tags.heading).\n */\n heading1: t(heading),\n /**\n A level 2 [heading](#highlight.tags.heading).\n */\n heading2: t(heading),\n /**\n A level 3 [heading](#highlight.tags.heading).\n */\n heading3: t(heading),\n /**\n A level 4 [heading](#highlight.tags.heading).\n */\n heading4: t(heading),\n /**\n A level 5 [heading](#highlight.tags.heading).\n */\n heading5: t(heading),\n /**\n A level 6 [heading](#highlight.tags.heading).\n */\n heading6: t(heading),\n /**\n A prose separator (such as a horizontal rule).\n */\n contentSeparator: t(content),\n /**\n [Content](#highlight.tags.content) that represents a list.\n */\n list: t(content),\n /**\n [Content](#highlight.tags.content) that represents a quote.\n */\n quote: t(content),\n /**\n [Content](#highlight.tags.content) that is emphasized.\n */\n emphasis: t(content),\n /**\n [Content](#highlight.tags.content) that is styled strong.\n */\n strong: t(content),\n /**\n [Content](#highlight.tags.content) that is part of a link.\n */\n link: t(content),\n /**\n [Content](#highlight.tags.content) that is styled as code or\n monospace.\n */\n monospace: t(content),\n /**\n [Content](#highlight.tags.content) that has a strike-through\n style.\n */\n strikethrough: t(content),\n /**\n Inserted text in a change-tracking format.\n */\n inserted: t(),\n /**\n Deleted text.\n */\n deleted: t(),\n /**\n Changed text.\n */\n changed: t(),\n /**\n An invalid or unsyntactic element.\n */\n invalid: t(),\n /**\n Metadata or meta-instruction.\n */\n meta,\n /**\n [Metadata](#highlight.tags.meta) that applies to the entire\n document.\n */\n documentMeta: t(meta),\n /**\n [Metadata](#highlight.tags.meta) that annotates or adds\n attributes to a given syntactic element.\n */\n annotation: t(meta),\n /**\n Processing instruction or preprocessor directive. Subtag of\n [meta](#highlight.tags.meta).\n */\n processingInstruction: t(meta),\n /**\n [Modifier](#highlight.Tag^defineModifier) that indicates that a\n given element is being defined. Expected to be used with the\n various [name](#highlight.tags.name) tags.\n */\n definition: Tag.defineModifier(),\n /**\n [Modifier](#highlight.Tag^defineModifier) that indicates that\n something is constant. Mostly expected to be used with\n [variable names](#highlight.tags.variableName).\n */\n constant: Tag.defineModifier(),\n /**\n [Modifier](#highlight.Tag^defineModifier) used to indicate that\n a [variable](#highlight.tags.variableName) or [property\n name](#highlight.tags.propertyName) is being called or defined\n as a function.\n */\n function: Tag.defineModifier(),\n /**\n [Modifier](#highlight.Tag^defineModifier) that can be applied to\n [names](#highlight.tags.name) to indicate that they belong to\n the language's standard environment.\n */\n standard: Tag.defineModifier(),\n /**\n [Modifier](#highlight.Tag^defineModifier) that indicates a given\n [names](#highlight.tags.name) is local to some scope.\n */\n local: Tag.defineModifier(),\n /**\n A generic variant [modifier](#highlight.Tag^defineModifier) that\n can be used to tag language-specific alternative variants of\n some common tag. It is recommended for themes to define special\n forms of at least the [string](#highlight.tags.string) and\n [variable name](#highlight.tags.variableName) tags, since those\n come up a lot.\n */\n special: Tag.defineModifier()\n };\n /**\n This is a highlighter that adds stable, predictable classes to\n tokens, for styling with external CSS.\n\n The following tags are mapped to their name prefixed with `\"tok-\"`\n (for example `\"tok-comment\"`):\n\n * [`link`](#highlight.tags.link)\n * [`heading`](#highlight.tags.heading)\n * [`emphasis`](#highlight.tags.emphasis)\n * [`strong`](#highlight.tags.strong)\n * [`keyword`](#highlight.tags.keyword)\n * [`atom`](#highlight.tags.atom)\n * [`bool`](#highlight.tags.bool)\n * [`url`](#highlight.tags.url)\n * [`labelName`](#highlight.tags.labelName)\n * [`inserted`](#highlight.tags.inserted)\n * [`deleted`](#highlight.tags.deleted)\n * [`literal`](#highlight.tags.literal)\n * [`string`](#highlight.tags.string)\n * [`number`](#highlight.tags.number)\n * [`variableName`](#highlight.tags.variableName)\n * [`typeName`](#highlight.tags.typeName)\n * [`namespace`](#highlight.tags.namespace)\n * [`className`](#highlight.tags.className)\n * [`macroName`](#highlight.tags.macroName)\n * [`propertyName`](#highlight.tags.propertyName)\n * [`operator`](#highlight.tags.operator)\n * [`comment`](#highlight.tags.comment)\n * [`meta`](#highlight.tags.meta)\n * [`punctuation`](#highlight.tags.punctuation)\n * [`invalid`](#highlight.tags.invalid)\n\n In addition, these mappings are provided:\n\n * [`regexp`](#highlight.tags.regexp),\n [`escape`](#highlight.tags.escape), and\n [`special`](#highlight.tags.special)[`(string)`](#highlight.tags.string)\n are mapped to `\"tok-string2\"`\n * [`special`](#highlight.tags.special)[`(variableName)`](#highlight.tags.variableName)\n to `\"tok-variableName2\"`\n * [`local`](#highlight.tags.local)[`(variableName)`](#highlight.tags.variableName)\n to `\"tok-variableName tok-local\"`\n * [`definition`](#highlight.tags.definition)[`(variableName)`](#highlight.tags.variableName)\n to `\"tok-variableName tok-definition\"`\n * [`definition`](#highlight.tags.definition)[`(propertyName)`](#highlight.tags.propertyName)\n to `\"tok-propertyName tok-definition\"`\n */\n tagHighlighter([\n { tag: tags$1.link, class: \"tok-link\" },\n { tag: tags$1.heading, class: \"tok-heading\" },\n { tag: tags$1.emphasis, class: \"tok-emphasis\" },\n { tag: tags$1.strong, class: \"tok-strong\" },\n { tag: tags$1.keyword, class: \"tok-keyword\" },\n { tag: tags$1.atom, class: \"tok-atom\" },\n { tag: tags$1.bool, class: \"tok-bool\" },\n { tag: tags$1.url, class: \"tok-url\" },\n { tag: tags$1.labelName, class: \"tok-labelName\" },\n { tag: tags$1.inserted, class: \"tok-inserted\" },\n { tag: tags$1.deleted, class: \"tok-deleted\" },\n { tag: tags$1.literal, class: \"tok-literal\" },\n { tag: tags$1.string, class: \"tok-string\" },\n { tag: tags$1.number, class: \"tok-number\" },\n { tag: [tags$1.regexp, tags$1.escape, tags$1.special(tags$1.string)], class: \"tok-string2\" },\n { tag: tags$1.variableName, class: \"tok-variableName\" },\n { tag: tags$1.local(tags$1.variableName), class: \"tok-variableName tok-local\" },\n { tag: tags$1.definition(tags$1.variableName), class: \"tok-variableName tok-definition\" },\n { tag: tags$1.special(tags$1.variableName), class: \"tok-variableName2\" },\n { tag: tags$1.definition(tags$1.propertyName), class: \"tok-propertyName tok-definition\" },\n { tag: tags$1.typeName, class: \"tok-typeName\" },\n { tag: tags$1.namespace, class: \"tok-namespace\" },\n { tag: tags$1.className, class: \"tok-className\" },\n { tag: tags$1.macroName, class: \"tok-macroName\" },\n { tag: tags$1.propertyName, class: \"tok-propertyName\" },\n { tag: tags$1.operator, class: \"tok-operator\" },\n { tag: tags$1.comment, class: \"tok-comment\" },\n { tag: tags$1.meta, class: \"tok-meta\" },\n { tag: tags$1.invalid, class: \"tok-invalid\" },\n { tag: tags$1.punctuation, class: \"tok-punctuation\" }\n ]);\n\n var _a;\n /**\n Node prop stored in a parser's top syntax node to provide the\n facet that stores language-specific data for that language.\n */\n const languageDataProp = /*@__PURE__*/new NodeProp();\n /**\n Helper function to define a facet (to be added to the top syntax\n node(s) for a language via\n [`languageDataProp`](https://codemirror.net/6/docs/ref/#language.languageDataProp)), that will be\n used to associate language data with the language. You\n probably only need this when subclassing\n [`Language`](https://codemirror.net/6/docs/ref/#language.Language).\n */\n function defineLanguageFacet(baseData) {\n return Facet.define({\n combine: baseData ? values => values.concat(baseData) : undefined\n });\n }\n /**\n Syntax node prop used to register sublanguages. Should be added to\n the top level node type for the language.\n */\n const sublanguageProp = /*@__PURE__*/new NodeProp();\n /**\n A language object manages parsing and per-language\n [metadata](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt). Parse data is\n managed as a [Lezer](https://lezer.codemirror.net) tree. The class\n can be used directly, via the [`LRLanguage`](https://codemirror.net/6/docs/ref/#language.LRLanguage)\n subclass for [Lezer](https://lezer.codemirror.net/) LR parsers, or\n via the [`StreamLanguage`](https://codemirror.net/6/docs/ref/#language.StreamLanguage) subclass\n for stream parsers.\n */\n class Language {\n /**\n Construct a language object. If you need to invoke this\n directly, first define a data facet with\n [`defineLanguageFacet`](https://codemirror.net/6/docs/ref/#language.defineLanguageFacet), and then\n configure your parser to [attach](https://codemirror.net/6/docs/ref/#language.languageDataProp) it\n to the language's outer syntax node.\n */\n constructor(\n /**\n The [language data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt) facet\n used for this language.\n */\n data, parser, extraExtensions = [], \n /**\n A language name.\n */\n name = \"\") {\n this.data = data;\n this.name = name;\n // Kludge to define EditorState.tree as a debugging helper,\n // without the EditorState package actually knowing about\n // languages and lezer trees.\n if (!EditorState.prototype.hasOwnProperty(\"tree\"))\n Object.defineProperty(EditorState.prototype, \"tree\", { get() { return syntaxTree(this); } });\n this.parser = parser;\n this.extension = [\n language.of(this),\n EditorState.languageData.of((state, pos, side) => {\n let top = topNodeAt(state, pos, side), data = top.type.prop(languageDataProp);\n if (!data)\n return [];\n let base = state.facet(data), sub = top.type.prop(sublanguageProp);\n if (sub) {\n let innerNode = top.resolve(pos - top.from, side);\n for (let sublang of sub)\n if (sublang.test(innerNode, state)) {\n let data = state.facet(sublang.facet);\n return sublang.type == \"replace\" ? data : data.concat(base);\n }\n }\n return base;\n })\n ].concat(extraExtensions);\n }\n /**\n Query whether this language is active at the given position.\n */\n isActiveAt(state, pos, side = -1) {\n return topNodeAt(state, pos, side).type.prop(languageDataProp) == this.data;\n }\n /**\n Find the document regions that were parsed using this language.\n The returned regions will _include_ any nested languages rooted\n in this language, when those exist.\n */\n findRegions(state) {\n let lang = state.facet(language);\n if ((lang === null || lang === void 0 ? void 0 : lang.data) == this.data)\n return [{ from: 0, to: state.doc.length }];\n if (!lang || !lang.allowsNesting)\n return [];\n let result = [];\n let explore = (tree, from) => {\n if (tree.prop(languageDataProp) == this.data) {\n result.push({ from, to: from + tree.length });\n return;\n }\n let mount = tree.prop(NodeProp.mounted);\n if (mount) {\n if (mount.tree.prop(languageDataProp) == this.data) {\n if (mount.overlay)\n for (let r of mount.overlay)\n result.push({ from: r.from + from, to: r.to + from });\n else\n result.push({ from: from, to: from + tree.length });\n return;\n }\n else if (mount.overlay) {\n let size = result.length;\n explore(mount.tree, mount.overlay[0].from + from);\n if (result.length > size)\n return;\n }\n }\n for (let i = 0; i < tree.children.length; i++) {\n let ch = tree.children[i];\n if (ch instanceof Tree)\n explore(ch, tree.positions[i] + from);\n }\n };\n explore(syntaxTree(state), 0);\n return result;\n }\n /**\n Indicates whether this language allows nested languages. The\n default implementation returns true.\n */\n get allowsNesting() { return true; }\n }\n /**\n @internal\n */\n Language.setState = /*@__PURE__*/StateEffect.define();\n function topNodeAt(state, pos, side) {\n let topLang = state.facet(language), tree = syntaxTree(state).topNode;\n if (!topLang || topLang.allowsNesting) {\n for (let node = tree; node; node = node.enter(pos, side, IterMode.ExcludeBuffers))\n if (node.type.isTop)\n tree = node;\n }\n return tree;\n }\n /**\n A subclass of [`Language`](https://codemirror.net/6/docs/ref/#language.Language) for use with Lezer\n [LR parsers](https://lezer.codemirror.net/docs/ref#lr.LRParser)\n parsers.\n */\n class LRLanguage extends Language {\n constructor(data, parser, name) {\n super(data, parser, [], name);\n this.parser = parser;\n }\n /**\n Define a language from a parser.\n */\n static define(spec) {\n let data = defineLanguageFacet(spec.languageData);\n return new LRLanguage(data, spec.parser.configure({\n props: [languageDataProp.add(type => type.isTop ? data : undefined)]\n }), spec.name);\n }\n /**\n Create a new instance of this language with a reconfigured\n version of its parser and optionally a new name.\n */\n configure(options, name) {\n return new LRLanguage(this.data, this.parser.configure(options), name || this.name);\n }\n get allowsNesting() { return this.parser.hasWrappers(); }\n }\n /**\n Get the syntax tree for a state, which is the current (possibly\n incomplete) parse tree of the active\n [language](https://codemirror.net/6/docs/ref/#language.Language), or the empty tree if there is no\n language available.\n */\n function syntaxTree(state) {\n let field = state.field(Language.state, false);\n return field ? field.tree : Tree.empty;\n }\n /**\n Lezer-style\n [`Input`](https://lezer.codemirror.net/docs/ref#common.Input)\n object for a [`Text`](https://codemirror.net/6/docs/ref/#state.Text) object.\n */\n class DocInput {\n /**\n Create an input object for the given document.\n */\n constructor(doc) {\n this.doc = doc;\n this.cursorPos = 0;\n this.string = \"\";\n this.cursor = doc.iter();\n }\n get length() { return this.doc.length; }\n syncTo(pos) {\n this.string = this.cursor.next(pos - this.cursorPos).value;\n this.cursorPos = pos + this.string.length;\n return this.cursorPos - this.string.length;\n }\n chunk(pos) {\n this.syncTo(pos);\n return this.string;\n }\n get lineChunks() { return true; }\n read(from, to) {\n let stringStart = this.cursorPos - this.string.length;\n if (from < stringStart || to >= this.cursorPos)\n return this.doc.sliceString(from, to);\n else\n return this.string.slice(from - stringStart, to - stringStart);\n }\n }\n let currentContext = null;\n /**\n A parse context provided to parsers working on the editor content.\n */\n class ParseContext {\n constructor(parser, \n /**\n The current editor state.\n */\n state, \n /**\n Tree fragments that can be reused by incremental re-parses.\n */\n fragments = [], \n /**\n @internal\n */\n tree, \n /**\n @internal\n */\n treeLen, \n /**\n The current editor viewport (or some overapproximation\n thereof). Intended to be used for opportunistically avoiding\n work (in which case\n [`skipUntilInView`](https://codemirror.net/6/docs/ref/#language.ParseContext.skipUntilInView)\n should be called to make sure the parser is restarted when the\n skipped region becomes visible).\n */\n viewport, \n /**\n @internal\n */\n skipped, \n /**\n This is where skipping parsers can register a promise that,\n when resolved, will schedule a new parse. It is cleared when\n the parse worker picks up the promise. @internal\n */\n scheduleOn) {\n this.parser = parser;\n this.state = state;\n this.fragments = fragments;\n this.tree = tree;\n this.treeLen = treeLen;\n this.viewport = viewport;\n this.skipped = skipped;\n this.scheduleOn = scheduleOn;\n this.parse = null;\n /**\n @internal\n */\n this.tempSkipped = [];\n }\n /**\n @internal\n */\n static create(parser, state, viewport) {\n return new ParseContext(parser, state, [], Tree.empty, 0, viewport, [], null);\n }\n startParse() {\n return this.parser.startParse(new DocInput(this.state.doc), this.fragments);\n }\n /**\n @internal\n */\n work(until, upto) {\n if (upto != null && upto >= this.state.doc.length)\n upto = undefined;\n if (this.tree != Tree.empty && this.isDone(upto !== null && upto !== void 0 ? upto : this.state.doc.length)) {\n this.takeTree();\n return true;\n }\n return this.withContext(() => {\n var _a;\n if (typeof until == \"number\") {\n let endTime = Date.now() + until;\n until = () => Date.now() > endTime;\n }\n if (!this.parse)\n this.parse = this.startParse();\n if (upto != null && (this.parse.stoppedAt == null || this.parse.stoppedAt > upto) &&\n upto < this.state.doc.length)\n this.parse.stopAt(upto);\n for (;;) {\n let done = this.parse.advance();\n if (done) {\n this.fragments = this.withoutTempSkipped(TreeFragment.addTree(done, this.fragments, this.parse.stoppedAt != null));\n this.treeLen = (_a = this.parse.stoppedAt) !== null && _a !== void 0 ? _a : this.state.doc.length;\n this.tree = done;\n this.parse = null;\n if (this.treeLen < (upto !== null && upto !== void 0 ? upto : this.state.doc.length))\n this.parse = this.startParse();\n else\n return true;\n }\n if (until())\n return false;\n }\n });\n }\n /**\n @internal\n */\n takeTree() {\n let pos, tree;\n if (this.parse && (pos = this.parse.parsedPos) >= this.treeLen) {\n if (this.parse.stoppedAt == null || this.parse.stoppedAt > pos)\n this.parse.stopAt(pos);\n this.withContext(() => { while (!(tree = this.parse.advance())) { } });\n this.treeLen = pos;\n this.tree = tree;\n this.fragments = this.withoutTempSkipped(TreeFragment.addTree(this.tree, this.fragments, true));\n this.parse = null;\n }\n }\n withContext(f) {\n let prev = currentContext;\n currentContext = this;\n try {\n return f();\n }\n finally {\n currentContext = prev;\n }\n }\n withoutTempSkipped(fragments) {\n for (let r; r = this.tempSkipped.pop();)\n fragments = cutFragments(fragments, r.from, r.to);\n return fragments;\n }\n /**\n @internal\n */\n changes(changes, newState) {\n let { fragments, tree, treeLen, viewport, skipped } = this;\n this.takeTree();\n if (!changes.empty) {\n let ranges = [];\n changes.iterChangedRanges((fromA, toA, fromB, toB) => ranges.push({ fromA, toA, fromB, toB }));\n fragments = TreeFragment.applyChanges(fragments, ranges);\n tree = Tree.empty;\n treeLen = 0;\n viewport = { from: changes.mapPos(viewport.from, -1), to: changes.mapPos(viewport.to, 1) };\n if (this.skipped.length) {\n skipped = [];\n for (let r of this.skipped) {\n let from = changes.mapPos(r.from, 1), to = changes.mapPos(r.to, -1);\n if (from < to)\n skipped.push({ from, to });\n }\n }\n }\n return new ParseContext(this.parser, newState, fragments, tree, treeLen, viewport, skipped, this.scheduleOn);\n }\n /**\n @internal\n */\n updateViewport(viewport) {\n if (this.viewport.from == viewport.from && this.viewport.to == viewport.to)\n return false;\n this.viewport = viewport;\n let startLen = this.skipped.length;\n for (let i = 0; i < this.skipped.length; i++) {\n let { from, to } = this.skipped[i];\n if (from < viewport.to && to > viewport.from) {\n this.fragments = cutFragments(this.fragments, from, to);\n this.skipped.splice(i--, 1);\n }\n }\n if (this.skipped.length >= startLen)\n return false;\n this.reset();\n return true;\n }\n /**\n @internal\n */\n reset() {\n if (this.parse) {\n this.takeTree();\n this.parse = null;\n }\n }\n /**\n Notify the parse scheduler that the given region was skipped\n because it wasn't in view, and the parse should be restarted\n when it comes into view.\n */\n skipUntilInView(from, to) {\n this.skipped.push({ from, to });\n }\n /**\n Returns a parser intended to be used as placeholder when\n asynchronously loading a nested parser. It'll skip its input and\n mark it as not-really-parsed, so that the next update will parse\n it again.\n \n When `until` is given, a reparse will be scheduled when that\n promise resolves.\n */\n static getSkippingParser(until) {\n return new class extends Parser {\n createParse(input, fragments, ranges) {\n let from = ranges[0].from, to = ranges[ranges.length - 1].to;\n let parser = {\n parsedPos: from,\n advance() {\n let cx = currentContext;\n if (cx) {\n for (let r of ranges)\n cx.tempSkipped.push(r);\n if (until)\n cx.scheduleOn = cx.scheduleOn ? Promise.all([cx.scheduleOn, until]) : until;\n }\n this.parsedPos = to;\n return new Tree(NodeType.none, [], [], to - from);\n },\n stoppedAt: null,\n stopAt() { }\n };\n return parser;\n }\n };\n }\n /**\n @internal\n */\n isDone(upto) {\n upto = Math.min(upto, this.state.doc.length);\n let frags = this.fragments;\n return this.treeLen >= upto && frags.length && frags[0].from == 0 && frags[0].to >= upto;\n }\n /**\n Get the context for the current parse, or `null` if no editor\n parse is in progress.\n */\n static get() { return currentContext; }\n }\n function cutFragments(fragments, from, to) {\n return TreeFragment.applyChanges(fragments, [{ fromA: from, toA: to, fromB: from, toB: to }]);\n }\n class LanguageState {\n constructor(\n // A mutable parse state that is used to preserve work done during\n // the lifetime of a state when moving to the next state.\n context) {\n this.context = context;\n this.tree = context.tree;\n }\n apply(tr) {\n if (!tr.docChanged && this.tree == this.context.tree)\n return this;\n let newCx = this.context.changes(tr.changes, tr.state);\n // If the previous parse wasn't done, go forward only up to its\n // end position or the end of the viewport, to avoid slowing down\n // state updates with parse work beyond the viewport.\n let upto = this.context.treeLen == tr.startState.doc.length ? undefined\n : Math.max(tr.changes.mapPos(this.context.treeLen), newCx.viewport.to);\n if (!newCx.work(20 /* Work.Apply */, upto))\n newCx.takeTree();\n return new LanguageState(newCx);\n }\n static init(state) {\n let vpTo = Math.min(3000 /* Work.InitViewport */, state.doc.length);\n let parseState = ParseContext.create(state.facet(language).parser, state, { from: 0, to: vpTo });\n if (!parseState.work(20 /* Work.Apply */, vpTo))\n parseState.takeTree();\n return new LanguageState(parseState);\n }\n }\n Language.state = /*@__PURE__*/StateField.define({\n create: LanguageState.init,\n update(value, tr) {\n for (let e of tr.effects)\n if (e.is(Language.setState))\n return e.value;\n if (tr.startState.facet(language) != tr.state.facet(language))\n return LanguageState.init(tr.state);\n return value.apply(tr);\n }\n });\n let requestIdle = (callback) => {\n let timeout = setTimeout(() => callback(), 500 /* Work.MaxPause */);\n return () => clearTimeout(timeout);\n };\n if (typeof requestIdleCallback != \"undefined\")\n requestIdle = (callback) => {\n let idle = -1, timeout = setTimeout(() => {\n idle = requestIdleCallback(callback, { timeout: 500 /* Work.MaxPause */ - 100 /* Work.MinPause */ });\n }, 100 /* Work.MinPause */);\n return () => idle < 0 ? clearTimeout(timeout) : cancelIdleCallback(idle);\n };\n const isInputPending = typeof navigator != \"undefined\" && ((_a = navigator.scheduling) === null || _a === void 0 ? void 0 : _a.isInputPending)\n ? () => navigator.scheduling.isInputPending() : null;\n const parseWorker = /*@__PURE__*/ViewPlugin.fromClass(class ParseWorker {\n constructor(view) {\n this.view = view;\n this.working = null;\n this.workScheduled = 0;\n // End of the current time chunk\n this.chunkEnd = -1;\n // Milliseconds of budget left for this chunk\n this.chunkBudget = -1;\n this.work = this.work.bind(this);\n this.scheduleWork();\n }\n update(update) {\n let cx = this.view.state.field(Language.state).context;\n if (cx.updateViewport(update.view.viewport) || this.view.viewport.to > cx.treeLen)\n this.scheduleWork();\n if (update.docChanged || update.selectionSet) {\n if (this.view.hasFocus)\n this.chunkBudget += 50 /* Work.ChangeBonus */;\n this.scheduleWork();\n }\n this.checkAsyncSchedule(cx);\n }\n scheduleWork() {\n if (this.working)\n return;\n let { state } = this.view, field = state.field(Language.state);\n if (field.tree != field.context.tree || !field.context.isDone(state.doc.length))\n this.working = requestIdle(this.work);\n }\n work(deadline) {\n this.working = null;\n let now = Date.now();\n if (this.chunkEnd < now && (this.chunkEnd < 0 || this.view.hasFocus)) { // Start a new chunk\n this.chunkEnd = now + 30000 /* Work.ChunkTime */;\n this.chunkBudget = 3000 /* Work.ChunkBudget */;\n }\n if (this.chunkBudget <= 0)\n return; // No more budget\n let { state, viewport: { to: vpTo } } = this.view, field = state.field(Language.state);\n if (field.tree == field.context.tree && field.context.isDone(vpTo + 100000 /* Work.MaxParseAhead */))\n return;\n let endTime = Date.now() + Math.min(this.chunkBudget, 100 /* Work.Slice */, deadline && !isInputPending ? Math.max(25 /* Work.MinSlice */, deadline.timeRemaining() - 5) : 1e9);\n let viewportFirst = field.context.treeLen < vpTo && state.doc.length > vpTo + 1000;\n let done = field.context.work(() => {\n return isInputPending && isInputPending() || Date.now() > endTime;\n }, vpTo + (viewportFirst ? 0 : 100000 /* Work.MaxParseAhead */));\n this.chunkBudget -= Date.now() - now;\n if (done || this.chunkBudget <= 0) {\n field.context.takeTree();\n this.view.dispatch({ effects: Language.setState.of(new LanguageState(field.context)) });\n }\n if (this.chunkBudget > 0 && !(done && !viewportFirst))\n this.scheduleWork();\n this.checkAsyncSchedule(field.context);\n }\n checkAsyncSchedule(cx) {\n if (cx.scheduleOn) {\n this.workScheduled++;\n cx.scheduleOn\n .then(() => this.scheduleWork())\n .catch(err => logException(this.view.state, err))\n .then(() => this.workScheduled--);\n cx.scheduleOn = null;\n }\n }\n destroy() {\n if (this.working)\n this.working();\n }\n isWorking() {\n return !!(this.working || this.workScheduled > 0);\n }\n }, {\n eventHandlers: { focus() { this.scheduleWork(); } }\n });\n /**\n The facet used to associate a language with an editor state. Used\n by `Language` object's `extension` property (so you don't need to\n manually wrap your languages in this). Can be used to access the\n current language on a state.\n */\n const language = /*@__PURE__*/Facet.define({\n combine(languages) { return languages.length ? languages[0] : null; },\n enables: language => [\n Language.state,\n parseWorker,\n EditorView.contentAttributes.compute([language], state => {\n let lang = state.facet(language);\n return lang && lang.name ? { \"data-language\": lang.name } : {};\n })\n ]\n });\n /**\n This class bundles a [language](https://codemirror.net/6/docs/ref/#language.Language) with an\n optional set of supporting extensions. Language packages are\n encouraged to export a function that optionally takes a\n configuration object and returns a `LanguageSupport` instance, as\n the main way for client code to use the package.\n */\n class LanguageSupport {\n /**\n Create a language support object.\n */\n constructor(\n /**\n The language object.\n */\n language, \n /**\n An optional set of supporting extensions. When nesting a\n language in another language, the outer language is encouraged\n to include the supporting extensions for its inner languages\n in its own set of support extensions.\n */\n support = []) {\n this.language = language;\n this.support = support;\n this.extension = [language, support];\n }\n }\n /**\n Language descriptions are used to store metadata about languages\n and to dynamically load them. Their main role is finding the\n appropriate language for a filename or dynamically loading nested\n parsers.\n */\n class LanguageDescription {\n constructor(\n /**\n The name of this language.\n */\n name, \n /**\n Alternative names for the mode (lowercased, includes `this.name`).\n */\n alias, \n /**\n File extensions associated with this language.\n */\n extensions, \n /**\n Optional filename pattern that should be associated with this\n language.\n */\n filename, loadFunc, \n /**\n If the language has been loaded, this will hold its value.\n */\n support = undefined) {\n this.name = name;\n this.alias = alias;\n this.extensions = extensions;\n this.filename = filename;\n this.loadFunc = loadFunc;\n this.support = support;\n this.loading = null;\n }\n /**\n Start loading the the language. Will return a promise that\n resolves to a [`LanguageSupport`](https://codemirror.net/6/docs/ref/#language.LanguageSupport)\n object when the language successfully loads.\n */\n load() {\n return this.loading || (this.loading = this.loadFunc().then(support => this.support = support, err => { this.loading = null; throw err; }));\n }\n /**\n Create a language description.\n */\n static of(spec) {\n let { load, support } = spec;\n if (!load) {\n if (!support)\n throw new RangeError(\"Must pass either 'load' or 'support' to LanguageDescription.of\");\n load = () => Promise.resolve(support);\n }\n return new LanguageDescription(spec.name, (spec.alias || []).concat(spec.name).map(s => s.toLowerCase()), spec.extensions || [], spec.filename, load, support);\n }\n /**\n Look for a language in the given array of descriptions that\n matches the filename. Will first match\n [`filename`](https://codemirror.net/6/docs/ref/#language.LanguageDescription.filename) patterns,\n and then [extensions](https://codemirror.net/6/docs/ref/#language.LanguageDescription.extensions),\n and return the first language that matches.\n */\n static matchFilename(descs, filename) {\n for (let d of descs)\n if (d.filename && d.filename.test(filename))\n return d;\n let ext = /\\.([^.]+)$/.exec(filename);\n if (ext)\n for (let d of descs)\n if (d.extensions.indexOf(ext[1]) > -1)\n return d;\n return null;\n }\n /**\n Look for a language whose name or alias matches the the given\n name (case-insensitively). If `fuzzy` is true, and no direct\n matchs is found, this'll also search for a language whose name\n or alias occurs in the string (for names shorter than three\n characters, only when surrounded by non-word characters).\n */\n static matchLanguageName(descs, name, fuzzy = true) {\n name = name.toLowerCase();\n for (let d of descs)\n if (d.alias.some(a => a == name))\n return d;\n if (fuzzy)\n for (let d of descs)\n for (let a of d.alias) {\n let found = name.indexOf(a);\n if (found > -1 && (a.length > 2 || !/\\w/.test(name[found - 1]) && !/\\w/.test(name[found + a.length])))\n return d;\n }\n return null;\n }\n }\n\n /**\n Facet that defines a way to provide a function that computes the\n appropriate indentation depth, as a column number (see\n [`indentString`](https://codemirror.net/6/docs/ref/#language.indentString)), at the start of a given\n line. A return value of `null` indicates no indentation can be\n determined, and the line should inherit the indentation of the one\n above it. A return value of `undefined` defers to the next indent\n service.\n */\n const indentService = /*@__PURE__*/Facet.define();\n /**\n Facet for overriding the unit by which indentation happens. Should\n be a string consisting either entirely of the same whitespace\n character. When not set, this defaults to 2 spaces.\n */\n const indentUnit = /*@__PURE__*/Facet.define({\n combine: values => {\n if (!values.length)\n return \" \";\n let unit = values[0];\n if (!unit || /\\S/.test(unit) || Array.from(unit).some(e => e != unit[0]))\n throw new Error(\"Invalid indent unit: \" + JSON.stringify(values[0]));\n return unit;\n }\n });\n /**\n Return the _column width_ of an indent unit in the state.\n Determined by the [`indentUnit`](https://codemirror.net/6/docs/ref/#language.indentUnit)\n facet, and [`tabSize`](https://codemirror.net/6/docs/ref/#state.EditorState^tabSize) when that\n contains tabs.\n */\n function getIndentUnit(state) {\n let unit = state.facet(indentUnit);\n return unit.charCodeAt(0) == 9 ? state.tabSize * unit.length : unit.length;\n }\n /**\n Create an indentation string that covers columns 0 to `cols`.\n Will use tabs for as much of the columns as possible when the\n [`indentUnit`](https://codemirror.net/6/docs/ref/#language.indentUnit) facet contains\n tabs.\n */\n function indentString(state, cols) {\n let result = \"\", ts = state.tabSize, ch = state.facet(indentUnit)[0];\n if (ch == \"\\t\") {\n while (cols >= ts) {\n result += \"\\t\";\n cols -= ts;\n }\n ch = \" \";\n }\n for (let i = 0; i < cols; i++)\n result += ch;\n return result;\n }\n /**\n Get the indentation, as a column number, at the given position.\n Will first consult any [indent services](https://codemirror.net/6/docs/ref/#language.indentService)\n that are registered, and if none of those return an indentation,\n this will check the syntax tree for the [indent node\n prop](https://codemirror.net/6/docs/ref/#language.indentNodeProp) and use that if found. Returns a\n number when an indentation could be determined, and null\n otherwise.\n */\n function getIndentation(context, pos) {\n if (context instanceof EditorState)\n context = new IndentContext(context);\n for (let service of context.state.facet(indentService)) {\n let result = service(context, pos);\n if (result !== undefined)\n return result;\n }\n let tree = syntaxTree(context.state);\n return tree.length >= pos ? syntaxIndentation(context, tree, pos) : null;\n }\n /**\n Indentation contexts are used when calling [indentation\n services](https://codemirror.net/6/docs/ref/#language.indentService). They provide helper utilities\n useful in indentation logic, and can selectively override the\n indentation reported for some lines.\n */\n class IndentContext {\n /**\n Create an indent context.\n */\n constructor(\n /**\n The editor state.\n */\n state, \n /**\n @internal\n */\n options = {}) {\n this.state = state;\n this.options = options;\n this.unit = getIndentUnit(state);\n }\n /**\n Get a description of the line at the given position, taking\n [simulated line\n breaks](https://codemirror.net/6/docs/ref/#language.IndentContext.constructor^options.simulateBreak)\n into account. If there is such a break at `pos`, the `bias`\n argument determines whether the part of the line line before or\n after the break is used.\n */\n lineAt(pos, bias = 1) {\n let line = this.state.doc.lineAt(pos);\n let { simulateBreak, simulateDoubleBreak } = this.options;\n if (simulateBreak != null && simulateBreak >= line.from && simulateBreak <= line.to) {\n if (simulateDoubleBreak && simulateBreak == pos)\n return { text: \"\", from: pos };\n else if (bias < 0 ? simulateBreak < pos : simulateBreak <= pos)\n return { text: line.text.slice(simulateBreak - line.from), from: simulateBreak };\n else\n return { text: line.text.slice(0, simulateBreak - line.from), from: line.from };\n }\n return line;\n }\n /**\n Get the text directly after `pos`, either the entire line\n or the next 100 characters, whichever is shorter.\n */\n textAfterPos(pos, bias = 1) {\n if (this.options.simulateDoubleBreak && pos == this.options.simulateBreak)\n return \"\";\n let { text, from } = this.lineAt(pos, bias);\n return text.slice(pos - from, Math.min(text.length, pos + 100 - from));\n }\n /**\n Find the column for the given position.\n */\n column(pos, bias = 1) {\n let { text, from } = this.lineAt(pos, bias);\n let result = this.countColumn(text, pos - from);\n let override = this.options.overrideIndentation ? this.options.overrideIndentation(from) : -1;\n if (override > -1)\n result += override - this.countColumn(text, text.search(/\\S|$/));\n return result;\n }\n /**\n Find the column position (taking tabs into account) of the given\n position in the given string.\n */\n countColumn(line, pos = line.length) {\n return countColumn(line, this.state.tabSize, pos);\n }\n /**\n Find the indentation column of the line at the given point.\n */\n lineIndent(pos, bias = 1) {\n let { text, from } = this.lineAt(pos, bias);\n let override = this.options.overrideIndentation;\n if (override) {\n let overriden = override(from);\n if (overriden > -1)\n return overriden;\n }\n return this.countColumn(text, text.search(/\\S|$/));\n }\n /**\n Returns the [simulated line\n break](https://codemirror.net/6/docs/ref/#language.IndentContext.constructor^options.simulateBreak)\n for this context, if any.\n */\n get simulatedBreak() {\n return this.options.simulateBreak || null;\n }\n }\n /**\n A syntax tree node prop used to associate indentation strategies\n with node types. Such a strategy is a function from an indentation\n context to a column number (see also\n [`indentString`](https://codemirror.net/6/docs/ref/#language.indentString)) or null, where null\n indicates that no definitive indentation can be determined.\n */\n const indentNodeProp = /*@__PURE__*/new NodeProp();\n // Compute the indentation for a given position from the syntax tree.\n function syntaxIndentation(cx, ast, pos) {\n let stack = ast.resolveStack(pos);\n let inner = stack.node.enterUnfinishedNodesBefore(pos);\n if (inner != stack.node) {\n let add = [];\n for (let cur = inner; cur != stack.node; cur = cur.parent)\n add.push(cur);\n for (let i = add.length - 1; i >= 0; i--)\n stack = { node: add[i], next: stack };\n }\n return indentFor(stack, cx, pos);\n }\n function indentFor(stack, cx, pos) {\n for (let cur = stack; cur; cur = cur.next) {\n let strategy = indentStrategy(cur.node);\n if (strategy)\n return strategy(TreeIndentContext.create(cx, pos, cur));\n }\n return 0;\n }\n function ignoreClosed(cx) {\n return cx.pos == cx.options.simulateBreak && cx.options.simulateDoubleBreak;\n }\n function indentStrategy(tree) {\n let strategy = tree.type.prop(indentNodeProp);\n if (strategy)\n return strategy;\n let first = tree.firstChild, close;\n if (first && (close = first.type.prop(NodeProp.closedBy))) {\n let last = tree.lastChild, closed = last && close.indexOf(last.name) > -1;\n return cx => delimitedStrategy(cx, true, 1, undefined, closed && !ignoreClosed(cx) ? last.from : undefined);\n }\n return tree.parent == null ? topIndent : null;\n }\n function topIndent() { return 0; }\n /**\n Objects of this type provide context information and helper\n methods to indentation functions registered on syntax nodes.\n */\n class TreeIndentContext extends IndentContext {\n constructor(base, \n /**\n The position at which indentation is being computed.\n */\n pos, \n /**\n @internal\n */\n context) {\n super(base.state, base.options);\n this.base = base;\n this.pos = pos;\n this.context = context;\n }\n /**\n The syntax tree node to which the indentation strategy\n applies.\n */\n get node() { return this.context.node; }\n /**\n @internal\n */\n static create(base, pos, context) {\n return new TreeIndentContext(base, pos, context);\n }\n /**\n Get the text directly after `this.pos`, either the entire line\n or the next 100 characters, whichever is shorter.\n */\n get textAfter() {\n return this.textAfterPos(this.pos);\n }\n /**\n Get the indentation at the reference line for `this.node`, which\n is the line on which it starts, unless there is a node that is\n _not_ a parent of this node covering the start of that line. If\n so, the line at the start of that node is tried, again skipping\n on if it is covered by another such node.\n */\n get baseIndent() {\n return this.baseIndentFor(this.node);\n }\n /**\n Get the indentation for the reference line of the given node\n (see [`baseIndent`](https://codemirror.net/6/docs/ref/#language.TreeIndentContext.baseIndent)).\n */\n baseIndentFor(node) {\n let line = this.state.doc.lineAt(node.from);\n // Skip line starts that are covered by a sibling (or cousin, etc)\n for (;;) {\n let atBreak = node.resolve(line.from);\n while (atBreak.parent && atBreak.parent.from == atBreak.from)\n atBreak = atBreak.parent;\n if (isParent(atBreak, node))\n break;\n line = this.state.doc.lineAt(atBreak.from);\n }\n return this.lineIndent(line.from);\n }\n /**\n Continue looking for indentations in the node's parent nodes,\n and return the result of that.\n */\n continue() {\n return indentFor(this.context.next, this.base, this.pos);\n }\n }\n function isParent(parent, of) {\n for (let cur = of; cur; cur = cur.parent)\n if (parent == cur)\n return true;\n return false;\n }\n // Check whether a delimited node is aligned (meaning there are\n // non-skipped nodes on the same line as the opening delimiter). And\n // if so, return the opening token.\n function bracketedAligned(context) {\n let tree = context.node;\n let openToken = tree.childAfter(tree.from), last = tree.lastChild;\n if (!openToken)\n return null;\n let sim = context.options.simulateBreak;\n let openLine = context.state.doc.lineAt(openToken.from);\n let lineEnd = sim == null || sim <= openLine.from ? openLine.to : Math.min(openLine.to, sim);\n for (let pos = openToken.to;;) {\n let next = tree.childAfter(pos);\n if (!next || next == last)\n return null;\n if (!next.type.isSkipped)\n return next.from < lineEnd ? openToken : null;\n pos = next.to;\n }\n }\n /**\n An indentation strategy for delimited (usually bracketed) nodes.\n Will, by default, indent one unit more than the parent's base\n indent unless the line starts with a closing token. When `align`\n is true and there are non-skipped nodes on the node's opening\n line, the content of the node will be aligned with the end of the\n opening node, like this:\n\n foo(bar,\n baz)\n */\n function delimitedIndent({ closing, align = true, units = 1 }) {\n return (context) => delimitedStrategy(context, align, units, closing);\n }\n function delimitedStrategy(context, align, units, closing, closedAt) {\n let after = context.textAfter, space = after.match(/^\\s*/)[0].length;\n let closed = closing && after.slice(space, space + closing.length) == closing || closedAt == context.pos + space;\n let aligned = align ? bracketedAligned(context) : null;\n if (aligned)\n return closed ? context.column(aligned.from) : context.column(aligned.to);\n return context.baseIndent + (closed ? 0 : context.unit * units);\n }\n /**\n An indentation strategy that aligns a node's content to its base\n indentation.\n */\n const flatIndent = (context) => context.baseIndent;\n /**\n Creates an indentation strategy that, by default, indents\n continued lines one unit more than the node's base indentation.\n You can provide `except` to prevent indentation of lines that\n match a pattern (for example `/^else\\b/` in `if`/`else`\n constructs), and you can change the amount of units used with the\n `units` option.\n */\n function continuedIndent({ except, units = 1 } = {}) {\n return (context) => {\n let matchExcept = except && except.test(context.textAfter);\n return context.baseIndent + (matchExcept ? 0 : units * context.unit);\n };\n }\n const DontIndentBeyond = 200;\n /**\n Enables reindentation on input. When a language defines an\n `indentOnInput` field in its [language\n data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt), which must hold a regular\n expression, the line at the cursor will be reindented whenever new\n text is typed and the input from the start of the line up to the\n cursor matches that regexp.\n\n To avoid unneccesary reindents, it is recommended to start the\n regexp with `^` (usually followed by `\\s*`), and end it with `$`.\n For example, `/^\\s*\\}$/` will reindent when a closing brace is\n added at the start of a line.\n */\n function indentOnInput() {\n return EditorState.transactionFilter.of(tr => {\n if (!tr.docChanged || !tr.isUserEvent(\"input.type\") && !tr.isUserEvent(\"input.complete\"))\n return tr;\n let rules = tr.startState.languageDataAt(\"indentOnInput\", tr.startState.selection.main.head);\n if (!rules.length)\n return tr;\n let doc = tr.newDoc, { head } = tr.newSelection.main, line = doc.lineAt(head);\n if (head > line.from + DontIndentBeyond)\n return tr;\n let lineStart = doc.sliceString(line.from, head);\n if (!rules.some(r => r.test(lineStart)))\n return tr;\n let { state } = tr, last = -1, changes = [];\n for (let { head } of state.selection.ranges) {\n let line = state.doc.lineAt(head);\n if (line.from == last)\n continue;\n last = line.from;\n let indent = getIndentation(state, line.from);\n if (indent == null)\n continue;\n let cur = /^\\s*/.exec(line.text)[0];\n let norm = indentString(state, indent);\n if (cur != norm)\n changes.push({ from: line.from, to: line.from + cur.length, insert: norm });\n }\n return changes.length ? [tr, { changes, sequential: true }] : tr;\n });\n }\n\n /**\n A facet that registers a code folding service. When called with\n the extent of a line, such a function should return a foldable\n range that starts on that line (but continues beyond it), if one\n can be found.\n */\n const foldService = /*@__PURE__*/Facet.define();\n /**\n This node prop is used to associate folding information with\n syntax node types. Given a syntax node, it should check whether\n that tree is foldable and return the range that can be collapsed\n when it is.\n */\n const foldNodeProp = /*@__PURE__*/new NodeProp();\n /**\n [Fold](https://codemirror.net/6/docs/ref/#language.foldNodeProp) function that folds everything but\n the first and the last child of a syntax node. Useful for nodes\n that start and end with delimiters.\n */\n function foldInside(node) {\n let first = node.firstChild, last = node.lastChild;\n return first && first.to < last.from ? { from: first.to, to: last.type.isError ? node.to : last.from } : null;\n }\n function syntaxFolding(state, start, end) {\n let tree = syntaxTree(state);\n if (tree.length < end)\n return null;\n let stack = tree.resolveStack(end, 1);\n let found = null;\n for (let iter = stack; iter; iter = iter.next) {\n let cur = iter.node;\n if (cur.to <= end || cur.from > end)\n continue;\n if (found && cur.from < start)\n break;\n let prop = cur.type.prop(foldNodeProp);\n if (prop && (cur.to < tree.length - 50 || tree.length == state.doc.length || !isUnfinished(cur))) {\n let value = prop(cur, state);\n if (value && value.from <= end && value.from >= start && value.to > end)\n found = value;\n }\n }\n return found;\n }\n function isUnfinished(node) {\n let ch = node.lastChild;\n return ch && ch.to == node.to && ch.type.isError;\n }\n /**\n Check whether the given line is foldable. First asks any fold\n services registered through\n [`foldService`](https://codemirror.net/6/docs/ref/#language.foldService), and if none of them return\n a result, tries to query the [fold node\n prop](https://codemirror.net/6/docs/ref/#language.foldNodeProp) of syntax nodes that cover the end\n of the line.\n */\n function foldable(state, lineStart, lineEnd) {\n for (let service of state.facet(foldService)) {\n let result = service(state, lineStart, lineEnd);\n if (result)\n return result;\n }\n return syntaxFolding(state, lineStart, lineEnd);\n }\n function mapRange(range, mapping) {\n let from = mapping.mapPos(range.from, 1), to = mapping.mapPos(range.to, -1);\n return from >= to ? undefined : { from, to };\n }\n /**\n State effect that can be attached to a transaction to fold the\n given range. (You probably only need this in exceptional\n circumstances\u2014usually you'll just want to let\n [`foldCode`](https://codemirror.net/6/docs/ref/#language.foldCode) and the [fold\n gutter](https://codemirror.net/6/docs/ref/#language.foldGutter) create the transactions.)\n */\n const foldEffect = /*@__PURE__*/StateEffect.define({ map: mapRange });\n /**\n State effect that unfolds the given range (if it was folded).\n */\n const unfoldEffect = /*@__PURE__*/StateEffect.define({ map: mapRange });\n function selectedLines(view) {\n let lines = [];\n for (let { head } of view.state.selection.ranges) {\n if (lines.some(l => l.from <= head && l.to >= head))\n continue;\n lines.push(view.lineBlockAt(head));\n }\n return lines;\n }\n /**\n The state field that stores the folded ranges (as a [decoration\n set](https://codemirror.net/6/docs/ref/#view.DecorationSet)). Can be passed to\n [`EditorState.toJSON`](https://codemirror.net/6/docs/ref/#state.EditorState.toJSON) and\n [`fromJSON`](https://codemirror.net/6/docs/ref/#state.EditorState^fromJSON) to serialize the fold\n state.\n */\n const foldState = /*@__PURE__*/StateField.define({\n create() {\n return Decoration.none;\n },\n update(folded, tr) {\n folded = folded.map(tr.changes);\n for (let e of tr.effects) {\n if (e.is(foldEffect) && !foldExists(folded, e.value.from, e.value.to)) {\n let { preparePlaceholder } = tr.state.facet(foldConfig);\n let widget = !preparePlaceholder ? foldWidget :\n Decoration.replace({ widget: new PreparedFoldWidget(preparePlaceholder(tr.state, e.value)) });\n folded = folded.update({ add: [widget.range(e.value.from, e.value.to)] });\n }\n else if (e.is(unfoldEffect)) {\n folded = folded.update({ filter: (from, to) => e.value.from != from || e.value.to != to,\n filterFrom: e.value.from, filterTo: e.value.to });\n }\n }\n // Clear folded ranges that cover the selection head\n if (tr.selection) {\n let onSelection = false, { head } = tr.selection.main;\n folded.between(head, head, (a, b) => { if (a < head && b > head)\n onSelection = true; });\n if (onSelection)\n folded = folded.update({\n filterFrom: head,\n filterTo: head,\n filter: (a, b) => b <= head || a >= head\n });\n }\n return folded;\n },\n provide: f => EditorView.decorations.from(f),\n toJSON(folded, state) {\n let ranges = [];\n folded.between(0, state.doc.length, (from, to) => { ranges.push(from, to); });\n return ranges;\n },\n fromJSON(value) {\n if (!Array.isArray(value) || value.length % 2)\n throw new RangeError(\"Invalid JSON for fold state\");\n let ranges = [];\n for (let i = 0; i < value.length;) {\n let from = value[i++], to = value[i++];\n if (typeof from != \"number\" || typeof to != \"number\")\n throw new RangeError(\"Invalid JSON for fold state\");\n ranges.push(foldWidget.range(from, to));\n }\n return Decoration.set(ranges, true);\n }\n });\n function findFold(state, from, to) {\n var _a;\n let found = null;\n (_a = state.field(foldState, false)) === null || _a === void 0 ? void 0 : _a.between(from, to, (from, to) => {\n if (!found || found.from > from)\n found = { from, to };\n });\n return found;\n }\n function foldExists(folded, from, to) {\n let found = false;\n folded.between(from, from, (a, b) => { if (a == from && b == to)\n found = true; });\n return found;\n }\n function maybeEnable(state, other) {\n return state.field(foldState, false) ? other : other.concat(StateEffect.appendConfig.of(codeFolding()));\n }\n /**\n Fold the lines that are selected, if possible.\n */\n const foldCode = view => {\n for (let line of selectedLines(view)) {\n let range = foldable(view.state, line.from, line.to);\n if (range) {\n view.dispatch({ effects: maybeEnable(view.state, [foldEffect.of(range), announceFold(view, range)]) });\n return true;\n }\n }\n return false;\n };\n /**\n Unfold folded ranges on selected lines.\n */\n const unfoldCode = view => {\n if (!view.state.field(foldState, false))\n return false;\n let effects = [];\n for (let line of selectedLines(view)) {\n let folded = findFold(view.state, line.from, line.to);\n if (folded)\n effects.push(unfoldEffect.of(folded), announceFold(view, folded, false));\n }\n if (effects.length)\n view.dispatch({ effects });\n return effects.length > 0;\n };\n function announceFold(view, range, fold = true) {\n let lineFrom = view.state.doc.lineAt(range.from).number, lineTo = view.state.doc.lineAt(range.to).number;\n return EditorView.announce.of(`${view.state.phrase(fold ? \"Folded lines\" : \"Unfolded lines\")} ${lineFrom} ${view.state.phrase(\"to\")} ${lineTo}.`);\n }\n /**\n Fold all top-level foldable ranges. Note that, in most cases,\n folding information will depend on the [syntax\n tree](https://codemirror.net/6/docs/ref/#language.syntaxTree), and folding everything may not work\n reliably when the document hasn't been fully parsed (either\n because the editor state was only just initialized, or because the\n document is so big that the parser decided not to parse it\n entirely).\n */\n const foldAll = view => {\n let { state } = view, effects = [];\n for (let pos = 0; pos < state.doc.length;) {\n let line = view.lineBlockAt(pos), range = foldable(state, line.from, line.to);\n if (range)\n effects.push(foldEffect.of(range));\n pos = (range ? view.lineBlockAt(range.to) : line).to + 1;\n }\n if (effects.length)\n view.dispatch({ effects: maybeEnable(view.state, effects) });\n return !!effects.length;\n };\n /**\n Unfold all folded code.\n */\n const unfoldAll = view => {\n let field = view.state.field(foldState, false);\n if (!field || !field.size)\n return false;\n let effects = [];\n field.between(0, view.state.doc.length, (from, to) => { effects.push(unfoldEffect.of({ from, to })); });\n view.dispatch({ effects });\n return true;\n };\n /**\n Default fold-related key bindings.\n\n - Ctrl-Shift-[ (Cmd-Alt-[ on macOS): [`foldCode`](https://codemirror.net/6/docs/ref/#language.foldCode).\n - Ctrl-Shift-] (Cmd-Alt-] on macOS): [`unfoldCode`](https://codemirror.net/6/docs/ref/#language.unfoldCode).\n - Ctrl-Alt-[: [`foldAll`](https://codemirror.net/6/docs/ref/#language.foldAll).\n - Ctrl-Alt-]: [`unfoldAll`](https://codemirror.net/6/docs/ref/#language.unfoldAll).\n */\n const foldKeymap = [\n { key: \"Ctrl-Shift-[\", mac: \"Cmd-Alt-[\", run: foldCode },\n { key: \"Ctrl-Shift-]\", mac: \"Cmd-Alt-]\", run: unfoldCode },\n { key: \"Ctrl-Alt-[\", run: foldAll },\n { key: \"Ctrl-Alt-]\", run: unfoldAll }\n ];\n const defaultConfig$2 = {\n placeholderDOM: null,\n preparePlaceholder: null,\n placeholderText: \"\u2026\"\n };\n const foldConfig = /*@__PURE__*/Facet.define({\n combine(values) { return combineConfig(values, defaultConfig$2); }\n });\n /**\n Create an extension that configures code folding.\n */\n function codeFolding(config) {\n let result = [foldState, baseTheme$1$1];\n if (config)\n result.push(foldConfig.of(config));\n return result;\n }\n function widgetToDOM(view, prepared) {\n let { state } = view, conf = state.facet(foldConfig);\n let onclick = (event) => {\n let line = view.lineBlockAt(view.posAtDOM(event.target));\n let folded = findFold(view.state, line.from, line.to);\n if (folded)\n view.dispatch({ effects: unfoldEffect.of(folded) });\n event.preventDefault();\n };\n if (conf.placeholderDOM)\n return conf.placeholderDOM(view, onclick, prepared);\n let element = document.createElement(\"span\");\n element.textContent = conf.placeholderText;\n element.setAttribute(\"aria-label\", state.phrase(\"folded code\"));\n element.title = state.phrase(\"unfold\");\n element.className = \"cm-foldPlaceholder\";\n element.onclick = onclick;\n return element;\n }\n const foldWidget = /*@__PURE__*/Decoration.replace({ widget: /*@__PURE__*/new class extends WidgetType {\n toDOM(view) { return widgetToDOM(view, null); }\n } });\n class PreparedFoldWidget extends WidgetType {\n constructor(value) {\n super();\n this.value = value;\n }\n eq(other) { return this.value == other.value; }\n toDOM(view) { return widgetToDOM(view, this.value); }\n }\n const foldGutterDefaults = {\n openText: \"\u2304\",\n closedText: \"\u203A\",\n markerDOM: null,\n domEventHandlers: {},\n foldingChanged: () => false\n };\n class FoldMarker extends GutterMarker {\n constructor(config, open) {\n super();\n this.config = config;\n this.open = open;\n }\n eq(other) { return this.config == other.config && this.open == other.open; }\n toDOM(view) {\n if (this.config.markerDOM)\n return this.config.markerDOM(this.open);\n let span = document.createElement(\"span\");\n span.textContent = this.open ? this.config.openText : this.config.closedText;\n span.title = view.state.phrase(this.open ? \"Fold line\" : \"Unfold line\");\n return span;\n }\n }\n /**\n Create an extension that registers a fold gutter, which shows a\n fold status indicator before foldable lines (which can be clicked\n to fold or unfold the line).\n */\n function foldGutter(config = {}) {\n let fullConfig = Object.assign(Object.assign({}, foldGutterDefaults), config);\n let canFold = new FoldMarker(fullConfig, true), canUnfold = new FoldMarker(fullConfig, false);\n let markers = ViewPlugin.fromClass(class {\n constructor(view) {\n this.from = view.viewport.from;\n this.markers = this.buildMarkers(view);\n }\n update(update) {\n if (update.docChanged || update.viewportChanged ||\n update.startState.facet(language) != update.state.facet(language) ||\n update.startState.field(foldState, false) != update.state.field(foldState, false) ||\n syntaxTree(update.startState) != syntaxTree(update.state) ||\n fullConfig.foldingChanged(update))\n this.markers = this.buildMarkers(update.view);\n }\n buildMarkers(view) {\n let builder = new RangeSetBuilder();\n for (let line of view.viewportLineBlocks) {\n let mark = findFold(view.state, line.from, line.to) ? canUnfold\n : foldable(view.state, line.from, line.to) ? canFold : null;\n if (mark)\n builder.add(line.from, line.from, mark);\n }\n return builder.finish();\n }\n });\n let { domEventHandlers } = fullConfig;\n return [\n markers,\n gutter({\n class: \"cm-foldGutter\",\n markers(view) { var _a; return ((_a = view.plugin(markers)) === null || _a === void 0 ? void 0 : _a.markers) || RangeSet.empty; },\n initialSpacer() {\n return new FoldMarker(fullConfig, false);\n },\n domEventHandlers: Object.assign(Object.assign({}, domEventHandlers), { click: (view, line, event) => {\n if (domEventHandlers.click && domEventHandlers.click(view, line, event))\n return true;\n let folded = findFold(view.state, line.from, line.to);\n if (folded) {\n view.dispatch({ effects: unfoldEffect.of(folded) });\n return true;\n }\n let range = foldable(view.state, line.from, line.to);\n if (range) {\n view.dispatch({ effects: foldEffect.of(range) });\n return true;\n }\n return false;\n } })\n }),\n codeFolding()\n ];\n }\n const baseTheme$1$1 = /*@__PURE__*/EditorView.baseTheme({\n \".cm-foldPlaceholder\": {\n backgroundColor: \"#eee\",\n border: \"1px solid #ddd\",\n color: \"#888\",\n borderRadius: \".2em\",\n margin: \"0 1px\",\n padding: \"0 1px\",\n cursor: \"pointer\"\n },\n \".cm-foldGutter span\": {\n padding: \"0 1px\",\n cursor: \"pointer\"\n }\n });\n\n /**\n A highlight style associates CSS styles with higlighting\n [tags](https://lezer.codemirror.net/docs/ref#highlight.Tag).\n */\n class HighlightStyle {\n constructor(\n /**\n The tag styles used to create this highlight style.\n */\n specs, options) {\n this.specs = specs;\n let modSpec;\n function def(spec) {\n let cls = StyleModule.newName();\n (modSpec || (modSpec = Object.create(null)))[\".\" + cls] = spec;\n return cls;\n }\n const all = typeof options.all == \"string\" ? options.all : options.all ? def(options.all) : undefined;\n const scopeOpt = options.scope;\n this.scope = scopeOpt instanceof Language ? (type) => type.prop(languageDataProp) == scopeOpt.data\n : scopeOpt ? (type) => type == scopeOpt : undefined;\n this.style = tagHighlighter(specs.map(style => ({\n tag: style.tag,\n class: style.class || def(Object.assign({}, style, { tag: null }))\n })), {\n all,\n }).style;\n this.module = modSpec ? new StyleModule(modSpec) : null;\n this.themeType = options.themeType;\n }\n /**\n Create a highlighter style that associates the given styles to\n the given tags. The specs must be objects that hold a style tag\n or array of tags in their `tag` property, and either a single\n `class` property providing a static CSS class (for highlighter\n that rely on external styling), or a\n [`style-mod`](https://github.com/marijnh/style-mod#documentation)-style\n set of CSS properties (which define the styling for those tags).\n \n The CSS rules created for a highlighter will be emitted in the\n order of the spec's properties. That means that for elements that\n have multiple tags associated with them, styles defined further\n down in the list will have a higher CSS precedence than styles\n defined earlier.\n */\n static define(specs, options) {\n return new HighlightStyle(specs, options || {});\n }\n }\n const highlighterFacet = /*@__PURE__*/Facet.define();\n const fallbackHighlighter = /*@__PURE__*/Facet.define({\n combine(values) { return values.length ? [values[0]] : null; }\n });\n function getHighlighters(state) {\n let main = state.facet(highlighterFacet);\n return main.length ? main : state.facet(fallbackHighlighter);\n }\n /**\n Wrap a highlighter in an editor extension that uses it to apply\n syntax highlighting to the editor content.\n\n When multiple (non-fallback) styles are provided, the styling\n applied is the union of the classes they emit.\n */\n function syntaxHighlighting(highlighter, options) {\n let ext = [treeHighlighter], themeType;\n if (highlighter instanceof HighlightStyle) {\n if (highlighter.module)\n ext.push(EditorView.styleModule.of(highlighter.module));\n themeType = highlighter.themeType;\n }\n if (options === null || options === void 0 ? void 0 : options.fallback)\n ext.push(fallbackHighlighter.of(highlighter));\n else if (themeType)\n ext.push(highlighterFacet.computeN([EditorView.darkTheme], state => {\n return state.facet(EditorView.darkTheme) == (themeType == \"dark\") ? [highlighter] : [];\n }));\n else\n ext.push(highlighterFacet.of(highlighter));\n return ext;\n }\n class TreeHighlighter {\n constructor(view) {\n this.markCache = Object.create(null);\n this.tree = syntaxTree(view.state);\n this.decorations = this.buildDeco(view, getHighlighters(view.state));\n this.decoratedTo = view.viewport.to;\n }\n update(update) {\n let tree = syntaxTree(update.state), highlighters = getHighlighters(update.state);\n let styleChange = highlighters != getHighlighters(update.startState);\n let { viewport } = update.view, decoratedToMapped = update.changes.mapPos(this.decoratedTo, 1);\n if (tree.length < viewport.to && !styleChange && tree.type == this.tree.type && decoratedToMapped >= viewport.to) {\n this.decorations = this.decorations.map(update.changes);\n this.decoratedTo = decoratedToMapped;\n }\n else if (tree != this.tree || update.viewportChanged || styleChange) {\n this.tree = tree;\n this.decorations = this.buildDeco(update.view, highlighters);\n this.decoratedTo = viewport.to;\n }\n }\n buildDeco(view, highlighters) {\n if (!highlighters || !this.tree.length)\n return Decoration.none;\n let builder = new RangeSetBuilder();\n for (let { from, to } of view.visibleRanges) {\n highlightTree(this.tree, highlighters, (from, to, style) => {\n builder.add(from, to, this.markCache[style] || (this.markCache[style] = Decoration.mark({ class: style })));\n }, from, to);\n }\n return builder.finish();\n }\n }\n const treeHighlighter = /*@__PURE__*/Prec.high(/*@__PURE__*/ViewPlugin.fromClass(TreeHighlighter, {\n decorations: v => v.decorations\n }));\n /**\n A default highlight style (works well with light themes).\n */\n const defaultHighlightStyle = /*@__PURE__*/HighlightStyle.define([\n { tag: tags$1.meta,\n color: \"#404740\" },\n { tag: tags$1.link,\n textDecoration: \"underline\" },\n { tag: tags$1.heading,\n textDecoration: \"underline\",\n fontWeight: \"bold\" },\n { tag: tags$1.emphasis,\n fontStyle: \"italic\" },\n { tag: tags$1.strong,\n fontWeight: \"bold\" },\n { tag: tags$1.strikethrough,\n textDecoration: \"line-through\" },\n { tag: tags$1.keyword,\n color: \"#708\" },\n { tag: [tags$1.atom, tags$1.bool, tags$1.url, tags$1.contentSeparator, tags$1.labelName],\n color: \"#219\" },\n { tag: [tags$1.literal, tags$1.inserted],\n color: \"#164\" },\n { tag: [tags$1.string, tags$1.deleted],\n color: \"#a11\" },\n { tag: [tags$1.regexp, tags$1.escape, /*@__PURE__*/tags$1.special(tags$1.string)],\n color: \"#e40\" },\n { tag: /*@__PURE__*/tags$1.definition(tags$1.variableName),\n color: \"#00f\" },\n { tag: /*@__PURE__*/tags$1.local(tags$1.variableName),\n color: \"#30a\" },\n { tag: [tags$1.typeName, tags$1.namespace],\n color: \"#085\" },\n { tag: tags$1.className,\n color: \"#167\" },\n { tag: [/*@__PURE__*/tags$1.special(tags$1.variableName), tags$1.macroName],\n color: \"#256\" },\n { tag: /*@__PURE__*/tags$1.definition(tags$1.propertyName),\n color: \"#00c\" },\n { tag: tags$1.comment,\n color: \"#940\" },\n { tag: tags$1.invalid,\n color: \"#f00\" }\n ]);\n\n const baseTheme$3 = /*@__PURE__*/EditorView.baseTheme({\n \"&.cm-focused .cm-matchingBracket\": { backgroundColor: \"#328c8252\" },\n \"&.cm-focused .cm-nonmatchingBracket\": { backgroundColor: \"#bb555544\" }\n });\n const DefaultScanDist = 10000, DefaultBrackets = \"()[]{}\";\n const bracketMatchingConfig = /*@__PURE__*/Facet.define({\n combine(configs) {\n return combineConfig(configs, {\n afterCursor: true,\n brackets: DefaultBrackets,\n maxScanDistance: DefaultScanDist,\n renderMatch: defaultRenderMatch\n });\n }\n });\n const matchingMark = /*@__PURE__*/Decoration.mark({ class: \"cm-matchingBracket\" }), nonmatchingMark = /*@__PURE__*/Decoration.mark({ class: \"cm-nonmatchingBracket\" });\n function defaultRenderMatch(match) {\n let decorations = [];\n let mark = match.matched ? matchingMark : nonmatchingMark;\n decorations.push(mark.range(match.start.from, match.start.to));\n if (match.end)\n decorations.push(mark.range(match.end.from, match.end.to));\n return decorations;\n }\n const bracketMatchingState = /*@__PURE__*/StateField.define({\n create() { return Decoration.none; },\n update(deco, tr) {\n if (!tr.docChanged && !tr.selection)\n return deco;\n let decorations = [];\n let config = tr.state.facet(bracketMatchingConfig);\n for (let range of tr.state.selection.ranges) {\n if (!range.empty)\n continue;\n let match = matchBrackets(tr.state, range.head, -1, config)\n || (range.head > 0 && matchBrackets(tr.state, range.head - 1, 1, config))\n || (config.afterCursor &&\n (matchBrackets(tr.state, range.head, 1, config) ||\n (range.head < tr.state.doc.length && matchBrackets(tr.state, range.head + 1, -1, config))));\n if (match)\n decorations = decorations.concat(config.renderMatch(match, tr.state));\n }\n return Decoration.set(decorations, true);\n },\n provide: f => EditorView.decorations.from(f)\n });\n const bracketMatchingUnique = [\n bracketMatchingState,\n baseTheme$3\n ];\n /**\n Create an extension that enables bracket matching. Whenever the\n cursor is next to a bracket, that bracket and the one it matches\n are highlighted. Or, when no matching bracket is found, another\n highlighting style is used to indicate this.\n */\n function bracketMatching(config = {}) {\n return [bracketMatchingConfig.of(config), bracketMatchingUnique];\n }\n /**\n When larger syntax nodes, such as HTML tags, are marked as\n opening/closing, it can be a bit messy to treat the whole node as\n a matchable bracket. This node prop allows you to define, for such\n a node, a \u2018handle\u2019\u2014the part of the node that is highlighted, and\n that the cursor must be on to activate highlighting in the first\n place.\n */\n const bracketMatchingHandle = /*@__PURE__*/new NodeProp();\n function matchingNodes(node, dir, brackets) {\n let byProp = node.prop(dir < 0 ? NodeProp.openedBy : NodeProp.closedBy);\n if (byProp)\n return byProp;\n if (node.name.length == 1) {\n let index = brackets.indexOf(node.name);\n if (index > -1 && index % 2 == (dir < 0 ? 1 : 0))\n return [brackets[index + dir]];\n }\n return null;\n }\n function findHandle(node) {\n let hasHandle = node.type.prop(bracketMatchingHandle);\n return hasHandle ? hasHandle(node.node) : node;\n }\n /**\n Find the matching bracket for the token at `pos`, scanning\n direction `dir`. Only the `brackets` and `maxScanDistance`\n properties are used from `config`, if given. Returns null if no\n bracket was found at `pos`, or a match result otherwise.\n */\n function matchBrackets(state, pos, dir, config = {}) {\n let maxScanDistance = config.maxScanDistance || DefaultScanDist, brackets = config.brackets || DefaultBrackets;\n let tree = syntaxTree(state), node = tree.resolveInner(pos, dir);\n for (let cur = node; cur; cur = cur.parent) {\n let matches = matchingNodes(cur.type, dir, brackets);\n if (matches && cur.from < cur.to) {\n let handle = findHandle(cur);\n if (handle && (dir > 0 ? pos >= handle.from && pos < handle.to : pos > handle.from && pos <= handle.to))\n return matchMarkedBrackets(state, pos, dir, cur, handle, matches, brackets);\n }\n }\n return matchPlainBrackets(state, pos, dir, tree, node.type, maxScanDistance, brackets);\n }\n function matchMarkedBrackets(_state, _pos, dir, token, handle, matching, brackets) {\n let parent = token.parent, firstToken = { from: handle.from, to: handle.to };\n let depth = 0, cursor = parent === null || parent === void 0 ? void 0 : parent.cursor();\n if (cursor && (dir < 0 ? cursor.childBefore(token.from) : cursor.childAfter(token.to)))\n do {\n if (dir < 0 ? cursor.to <= token.from : cursor.from >= token.to) {\n if (depth == 0 && matching.indexOf(cursor.type.name) > -1 && cursor.from < cursor.to) {\n let endHandle = findHandle(cursor);\n return { start: firstToken, end: endHandle ? { from: endHandle.from, to: endHandle.to } : undefined, matched: true };\n }\n else if (matchingNodes(cursor.type, dir, brackets)) {\n depth++;\n }\n else if (matchingNodes(cursor.type, -dir, brackets)) {\n if (depth == 0) {\n let endHandle = findHandle(cursor);\n return {\n start: firstToken,\n end: endHandle && endHandle.from < endHandle.to ? { from: endHandle.from, to: endHandle.to } : undefined,\n matched: false\n };\n }\n depth--;\n }\n }\n } while (dir < 0 ? cursor.prevSibling() : cursor.nextSibling());\n return { start: firstToken, matched: false };\n }\n function matchPlainBrackets(state, pos, dir, tree, tokenType, maxScanDistance, brackets) {\n let startCh = dir < 0 ? state.sliceDoc(pos - 1, pos) : state.sliceDoc(pos, pos + 1);\n let bracket = brackets.indexOf(startCh);\n if (bracket < 0 || (bracket % 2 == 0) != (dir > 0))\n return null;\n let startToken = { from: dir < 0 ? pos - 1 : pos, to: dir > 0 ? pos + 1 : pos };\n let iter = state.doc.iterRange(pos, dir > 0 ? state.doc.length : 0), depth = 0;\n for (let distance = 0; !(iter.next()).done && distance <= maxScanDistance;) {\n let text = iter.value;\n if (dir < 0)\n distance += text.length;\n let basePos = pos + distance * dir;\n for (let pos = dir > 0 ? 0 : text.length - 1, end = dir > 0 ? text.length : -1; pos != end; pos += dir) {\n let found = brackets.indexOf(text[pos]);\n if (found < 0 || tree.resolveInner(basePos + pos, 1).type != tokenType)\n continue;\n if ((found % 2 == 0) == (dir > 0)) {\n depth++;\n }\n else if (depth == 1) { // Closing\n return { start: startToken, end: { from: basePos + pos, to: basePos + pos + 1 }, matched: (found >> 1) == (bracket >> 1) };\n }\n else {\n depth--;\n }\n }\n if (dir > 0)\n distance += text.length;\n }\n return iter.done ? { start: startToken, matched: false } : null;\n }\n const noTokens = /*@__PURE__*/Object.create(null);\n const typeArray = [NodeType.none];\n const warned = [];\n // Cache of node types by name and tags\n const byTag = /*@__PURE__*/Object.create(null);\n const defaultTable = /*@__PURE__*/Object.create(null);\n for (let [legacyName, name] of [\n [\"variable\", \"variableName\"],\n [\"variable-2\", \"variableName.special\"],\n [\"string-2\", \"string.special\"],\n [\"def\", \"variableName.definition\"],\n [\"tag\", \"tagName\"],\n [\"attribute\", \"attributeName\"],\n [\"type\", \"typeName\"],\n [\"builtin\", \"variableName.standard\"],\n [\"qualifier\", \"modifier\"],\n [\"error\", \"invalid\"],\n [\"header\", \"heading\"],\n [\"property\", \"propertyName\"]\n ])\n defaultTable[legacyName] = /*@__PURE__*/createTokenType(noTokens, name);\n function warnForPart(part, msg) {\n if (warned.indexOf(part) > -1)\n return;\n warned.push(part);\n console.warn(msg);\n }\n function createTokenType(extra, tagStr) {\n let tags$1$1 = [];\n for (let name of tagStr.split(\" \")) {\n let found = [];\n for (let part of name.split(\".\")) {\n let value = (extra[part] || tags$1[part]);\n if (!value) {\n warnForPart(part, `Unknown highlighting tag ${part}`);\n }\n else if (typeof value == \"function\") {\n if (!found.length)\n warnForPart(part, `Modifier ${part} used at start of tag`);\n else\n found = found.map(value);\n }\n else {\n if (found.length)\n warnForPart(part, `Tag ${part} used as modifier`);\n else\n found = Array.isArray(value) ? value : [value];\n }\n }\n for (let tag of found)\n tags$1$1.push(tag);\n }\n if (!tags$1$1.length)\n return 0;\n let name = tagStr.replace(/ /g, \"_\"), key = name + \" \" + tags$1$1.map(t => t.id);\n let known = byTag[key];\n if (known)\n return known.id;\n let type = byTag[key] = NodeType.define({\n id: typeArray.length,\n name,\n props: [styleTags({ [name]: tags$1$1 })]\n });\n typeArray.push(type);\n return type.id;\n }\n ({\n rtl: /*@__PURE__*/Decoration.mark({ class: \"cm-iso\", inclusive: true, attributes: { dir: \"rtl\" }, bidiIsolate: Direction.RTL }),\n ltr: /*@__PURE__*/Decoration.mark({ class: \"cm-iso\", inclusive: true, attributes: { dir: \"ltr\" }, bidiIsolate: Direction.LTR }),\n auto: /*@__PURE__*/Decoration.mark({ class: \"cm-iso\", inclusive: true, attributes: { dir: \"auto\" }, bidiIsolate: null })\n });\n\n /**\n Comment or uncomment the current selection. Will use line comments\n if available, otherwise falling back to block comments.\n */\n const toggleComment = target => {\n let { state } = target, line = state.doc.lineAt(state.selection.main.from), config = getConfig(target.state, line.from);\n return config.line ? toggleLineComment(target) : config.block ? toggleBlockCommentByLine(target) : false;\n };\n function command(f, option) {\n return ({ state, dispatch }) => {\n if (state.readOnly)\n return false;\n let tr = f(option, state);\n if (!tr)\n return false;\n dispatch(state.update(tr));\n return true;\n };\n }\n /**\n Comment or uncomment the current selection using line comments.\n The line comment syntax is taken from the\n [`commentTokens`](https://codemirror.net/6/docs/ref/#commands.CommentTokens) [language\n data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt).\n */\n const toggleLineComment = /*@__PURE__*/command(changeLineComment, 0 /* CommentOption.Toggle */);\n /**\n Comment or uncomment the current selection using block comments.\n The block comment syntax is taken from the\n [`commentTokens`](https://codemirror.net/6/docs/ref/#commands.CommentTokens) [language\n data](https://codemirror.net/6/docs/ref/#state.EditorState.languageDataAt).\n */\n const toggleBlockComment = /*@__PURE__*/command(changeBlockComment, 0 /* CommentOption.Toggle */);\n /**\n Comment or uncomment the lines around the current selection using\n block comments.\n */\n const toggleBlockCommentByLine = /*@__PURE__*/command((o, s) => changeBlockComment(o, s, selectedLineRanges(s)), 0 /* CommentOption.Toggle */);\n function getConfig(state, pos) {\n let data = state.languageDataAt(\"commentTokens\", pos);\n return data.length ? data[0] : {};\n }\n const SearchMargin = 50;\n /**\n Determines if the given range is block-commented in the given\n state.\n */\n function findBlockComment(state, { open, close }, from, to) {\n let textBefore = state.sliceDoc(from - SearchMargin, from);\n let textAfter = state.sliceDoc(to, to + SearchMargin);\n let spaceBefore = /\\s*$/.exec(textBefore)[0].length, spaceAfter = /^\\s*/.exec(textAfter)[0].length;\n let beforeOff = textBefore.length - spaceBefore;\n if (textBefore.slice(beforeOff - open.length, beforeOff) == open &&\n textAfter.slice(spaceAfter, spaceAfter + close.length) == close) {\n return { open: { pos: from - spaceBefore, margin: spaceBefore && 1 },\n close: { pos: to + spaceAfter, margin: spaceAfter && 1 } };\n }\n let startText, endText;\n if (to - from <= 2 * SearchMargin) {\n startText = endText = state.sliceDoc(from, to);\n }\n else {\n startText = state.sliceDoc(from, from + SearchMargin);\n endText = state.sliceDoc(to - SearchMargin, to);\n }\n let startSpace = /^\\s*/.exec(startText)[0].length, endSpace = /\\s*$/.exec(endText)[0].length;\n let endOff = endText.length - endSpace - close.length;\n if (startText.slice(startSpace, startSpace + open.length) == open &&\n endText.slice(endOff, endOff + close.length) == close) {\n return { open: { pos: from + startSpace + open.length,\n margin: /\\s/.test(startText.charAt(startSpace + open.length)) ? 1 : 0 },\n close: { pos: to - endSpace - close.length,\n margin: /\\s/.test(endText.charAt(endOff - 1)) ? 1 : 0 } };\n }\n return null;\n }\n function selectedLineRanges(state) {\n let ranges = [];\n for (let r of state.selection.ranges) {\n let fromLine = state.doc.lineAt(r.from);\n let toLine = r.to <= fromLine.to ? fromLine : state.doc.lineAt(r.to);\n let last = ranges.length - 1;\n if (last >= 0 && ranges[last].to > fromLine.from)\n ranges[last].to = toLine.to;\n else\n ranges.push({ from: fromLine.from + /^\\s*/.exec(fromLine.text)[0].length, to: toLine.to });\n }\n return ranges;\n }\n // Performs toggle, comment and uncomment of block comments in\n // languages that support them.\n function changeBlockComment(option, state, ranges = state.selection.ranges) {\n let tokens = ranges.map(r => getConfig(state, r.from).block);\n if (!tokens.every(c => c))\n return null;\n let comments = ranges.map((r, i) => findBlockComment(state, tokens[i], r.from, r.to));\n if (option != 2 /* CommentOption.Uncomment */ && !comments.every(c => c)) {\n return { changes: state.changes(ranges.map((range, i) => {\n if (comments[i])\n return [];\n return [{ from: range.from, insert: tokens[i].open + \" \" }, { from: range.to, insert: \" \" + tokens[i].close }];\n })) };\n }\n else if (option != 1 /* CommentOption.Comment */ && comments.some(c => c)) {\n let changes = [];\n for (let i = 0, comment; i < comments.length; i++)\n if (comment = comments[i]) {\n let token = tokens[i], { open, close } = comment;\n changes.push({ from: open.pos - token.open.length, to: open.pos + open.margin }, { from: close.pos - close.margin, to: close.pos + token.close.length });\n }\n return { changes };\n }\n return null;\n }\n // Performs toggle, comment and uncomment of line comments.\n function changeLineComment(option, state, ranges = state.selection.ranges) {\n let lines = [];\n let prevLine = -1;\n for (let { from, to } of ranges) {\n let startI = lines.length, minIndent = 1e9;\n let token = getConfig(state, from).line;\n if (!token)\n continue;\n for (let pos = from; pos <= to;) {\n let line = state.doc.lineAt(pos);\n if (line.from > prevLine && (from == to || to > line.from)) {\n prevLine = line.from;\n let indent = /^\\s*/.exec(line.text)[0].length;\n let empty = indent == line.length;\n let comment = line.text.slice(indent, indent + token.length) == token ? indent : -1;\n if (indent < line.text.length && indent < minIndent)\n minIndent = indent;\n lines.push({ line, comment, token, indent, empty, single: false });\n }\n pos = line.to + 1;\n }\n if (minIndent < 1e9)\n for (let i = startI; i < lines.length; i++)\n if (lines[i].indent < lines[i].line.text.length)\n lines[i].indent = minIndent;\n if (lines.length == startI + 1)\n lines[startI].single = true;\n }\n if (option != 2 /* CommentOption.Uncomment */ && lines.some(l => l.comment < 0 && (!l.empty || l.single))) {\n let changes = [];\n for (let { line, token, indent, empty, single } of lines)\n if (single || !empty)\n changes.push({ from: line.from + indent, insert: token + \" \" });\n let changeSet = state.changes(changes);\n return { changes: changeSet, selection: state.selection.map(changeSet, 1) };\n }\n else if (option != 1 /* CommentOption.Comment */ && lines.some(l => l.comment >= 0)) {\n let changes = [];\n for (let { line, comment, token } of lines)\n if (comment >= 0) {\n let from = line.from + comment, to = from + token.length;\n if (line.text[to - line.from] == \" \")\n to++;\n changes.push({ from, to });\n }\n return { changes };\n }\n return null;\n }\n\n const fromHistory = /*@__PURE__*/Annotation.define();\n /**\n Transaction annotation that will prevent that transaction from\n being combined with other transactions in the undo history. Given\n `\"before\"`, it'll prevent merging with previous transactions. With\n `\"after\"`, subsequent transactions won't be combined with this\n one. With `\"full\"`, the transaction is isolated on both sides.\n */\n const isolateHistory = /*@__PURE__*/Annotation.define();\n /**\n This facet provides a way to register functions that, given a\n transaction, provide a set of effects that the history should\n store when inverting the transaction. This can be used to\n integrate some kinds of effects in the history, so that they can\n be undone (and redone again).\n */\n const invertedEffects = /*@__PURE__*/Facet.define();\n const historyConfig = /*@__PURE__*/Facet.define({\n combine(configs) {\n return combineConfig(configs, {\n minDepth: 100,\n newGroupDelay: 500,\n joinToEvent: (_t, isAdjacent) => isAdjacent,\n }, {\n minDepth: Math.max,\n newGroupDelay: Math.min,\n joinToEvent: (a, b) => (tr, adj) => a(tr, adj) || b(tr, adj)\n });\n }\n });\n const historyField_ = /*@__PURE__*/StateField.define({\n create() {\n return HistoryState.empty;\n },\n update(state, tr) {\n let config = tr.state.facet(historyConfig);\n let fromHist = tr.annotation(fromHistory);\n if (fromHist) {\n let item = HistEvent.fromTransaction(tr, fromHist.selection), from = fromHist.side;\n let other = from == 0 /* BranchName.Done */ ? state.undone : state.done;\n if (item)\n other = updateBranch(other, other.length, config.minDepth, item);\n else\n other = addSelection(other, tr.startState.selection);\n return new HistoryState(from == 0 /* BranchName.Done */ ? fromHist.rest : other, from == 0 /* BranchName.Done */ ? other : fromHist.rest);\n }\n let isolate = tr.annotation(isolateHistory);\n if (isolate == \"full\" || isolate == \"before\")\n state = state.isolate();\n if (tr.annotation(Transaction.addToHistory) === false)\n return !tr.changes.empty ? state.addMapping(tr.changes.desc) : state;\n let event = HistEvent.fromTransaction(tr);\n let time = tr.annotation(Transaction.time), userEvent = tr.annotation(Transaction.userEvent);\n if (event)\n state = state.addChanges(event, time, userEvent, config, tr);\n else if (tr.selection)\n state = state.addSelection(tr.startState.selection, time, userEvent, config.newGroupDelay);\n if (isolate == \"full\" || isolate == \"after\")\n state = state.isolate();\n return state;\n },\n toJSON(value) {\n return { done: value.done.map(e => e.toJSON()), undone: value.undone.map(e => e.toJSON()) };\n },\n fromJSON(json) {\n return new HistoryState(json.done.map(HistEvent.fromJSON), json.undone.map(HistEvent.fromJSON));\n }\n });\n /**\n Create a history extension with the given configuration.\n */\n function history(config = {}) {\n return [\n historyField_,\n historyConfig.of(config),\n EditorView.domEventHandlers({\n beforeinput(e, view) {\n let command = e.inputType == \"historyUndo\" ? undo : e.inputType == \"historyRedo\" ? redo : null;\n if (!command)\n return false;\n e.preventDefault();\n return command(view);\n }\n })\n ];\n }\n function cmd(side, selection) {\n return function ({ state, dispatch }) {\n if (!selection && state.readOnly)\n return false;\n let historyState = state.field(historyField_, false);\n if (!historyState)\n return false;\n let tr = historyState.pop(side, state, selection);\n if (!tr)\n return false;\n dispatch(tr);\n return true;\n };\n }\n /**\n Undo a single group of history events. Returns false if no group\n was available.\n */\n const undo = /*@__PURE__*/cmd(0 /* BranchName.Done */, false);\n /**\n Redo a group of history events. Returns false if no group was\n available.\n */\n const redo = /*@__PURE__*/cmd(1 /* BranchName.Undone */, false);\n /**\n Undo a change or selection change.\n */\n const undoSelection = /*@__PURE__*/cmd(0 /* BranchName.Done */, true);\n /**\n Redo a change or selection change.\n */\n const redoSelection = /*@__PURE__*/cmd(1 /* BranchName.Undone */, true);\n // History events store groups of changes or effects that need to be\n // undone/redone together.\n class HistEvent {\n constructor(\n // The changes in this event. Normal events hold at least one\n // change or effect. But it may be necessary to store selection\n // events before the first change, in which case a special type of\n // instance is created which doesn't hold any changes, with\n // changes == startSelection == undefined\n changes, \n // The effects associated with this event\n effects, \n // Accumulated mapping (from addToHistory==false) that should be\n // applied to events below this one.\n mapped, \n // The selection before this event\n startSelection, \n // Stores selection changes after this event, to be used for\n // selection undo/redo.\n selectionsAfter) {\n this.changes = changes;\n this.effects = effects;\n this.mapped = mapped;\n this.startSelection = startSelection;\n this.selectionsAfter = selectionsAfter;\n }\n setSelAfter(after) {\n return new HistEvent(this.changes, this.effects, this.mapped, this.startSelection, after);\n }\n toJSON() {\n var _a, _b, _c;\n return {\n changes: (_a = this.changes) === null || _a === void 0 ? void 0 : _a.toJSON(),\n mapped: (_b = this.mapped) === null || _b === void 0 ? void 0 : _b.toJSON(),\n startSelection: (_c = this.startSelection) === null || _c === void 0 ? void 0 : _c.toJSON(),\n selectionsAfter: this.selectionsAfter.map(s => s.toJSON())\n };\n }\n static fromJSON(json) {\n return new HistEvent(json.changes && ChangeSet.fromJSON(json.changes), [], json.mapped && ChangeDesc.fromJSON(json.mapped), json.startSelection && EditorSelection.fromJSON(json.startSelection), json.selectionsAfter.map(EditorSelection.fromJSON));\n }\n // This does not check `addToHistory` and such, it assumes the\n // transaction needs to be converted to an item. Returns null when\n // there are no changes or effects in the transaction.\n static fromTransaction(tr, selection) {\n let effects = none$2;\n for (let invert of tr.startState.facet(invertedEffects)) {\n let result = invert(tr);\n if (result.length)\n effects = effects.concat(result);\n }\n if (!effects.length && tr.changes.empty)\n return null;\n return new HistEvent(tr.changes.invert(tr.startState.doc), effects, undefined, selection || tr.startState.selection, none$2);\n }\n static selection(selections) {\n return new HistEvent(undefined, none$2, undefined, undefined, selections);\n }\n }\n function updateBranch(branch, to, maxLen, newEvent) {\n let start = to + 1 > maxLen + 20 ? to - maxLen - 1 : 0;\n let newBranch = branch.slice(start, to);\n newBranch.push(newEvent);\n return newBranch;\n }\n function isAdjacent(a, b) {\n let ranges = [], isAdjacent = false;\n a.iterChangedRanges((f, t) => ranges.push(f, t));\n b.iterChangedRanges((_f, _t, f, t) => {\n for (let i = 0; i < ranges.length;) {\n let from = ranges[i++], to = ranges[i++];\n if (t >= from && f <= to)\n isAdjacent = true;\n }\n });\n return isAdjacent;\n }\n function eqSelectionShape(a, b) {\n return a.ranges.length == b.ranges.length &&\n a.ranges.filter((r, i) => r.empty != b.ranges[i].empty).length === 0;\n }\n function conc(a, b) {\n return !a.length ? b : !b.length ? a : a.concat(b);\n }\n const none$2 = [];\n const MaxSelectionsPerEvent = 200;\n function addSelection(branch, selection) {\n if (!branch.length) {\n return [HistEvent.selection([selection])];\n }\n else {\n let lastEvent = branch[branch.length - 1];\n let sels = lastEvent.selectionsAfter.slice(Math.max(0, lastEvent.selectionsAfter.length - MaxSelectionsPerEvent));\n if (sels.length && sels[sels.length - 1].eq(selection))\n return branch;\n sels.push(selection);\n return updateBranch(branch, branch.length - 1, 1e9, lastEvent.setSelAfter(sels));\n }\n }\n // Assumes the top item has one or more selectionAfter values\n function popSelection(branch) {\n let last = branch[branch.length - 1];\n let newBranch = branch.slice();\n newBranch[branch.length - 1] = last.setSelAfter(last.selectionsAfter.slice(0, last.selectionsAfter.length - 1));\n return newBranch;\n }\n // Add a mapping to the top event in the given branch. If this maps\n // away all the changes and effects in that item, drop it and\n // propagate the mapping to the next item.\n function addMappingToBranch(branch, mapping) {\n if (!branch.length)\n return branch;\n let length = branch.length, selections = none$2;\n while (length) {\n let event = mapEvent(branch[length - 1], mapping, selections);\n if (event.changes && !event.changes.empty || event.effects.length) { // Event survived mapping\n let result = branch.slice(0, length);\n result[length - 1] = event;\n return result;\n }\n else { // Drop this event, since there's no changes or effects left\n mapping = event.mapped;\n length--;\n selections = event.selectionsAfter;\n }\n }\n return selections.length ? [HistEvent.selection(selections)] : none$2;\n }\n function mapEvent(event, mapping, extraSelections) {\n let selections = conc(event.selectionsAfter.length ? event.selectionsAfter.map(s => s.map(mapping)) : none$2, extraSelections);\n // Change-less events don't store mappings (they are always the last event in a branch)\n if (!event.changes)\n return HistEvent.selection(selections);\n let mappedChanges = event.changes.map(mapping), before = mapping.mapDesc(event.changes, true);\n let fullMapping = event.mapped ? event.mapped.composeDesc(before) : before;\n return new HistEvent(mappedChanges, StateEffect.mapEffects(event.effects, mapping), fullMapping, event.startSelection.map(before), selections);\n }\n const joinableUserEvent = /^(input\\.type|delete)($|\\.)/;\n class HistoryState {\n constructor(done, undone, prevTime = 0, prevUserEvent = undefined) {\n this.done = done;\n this.undone = undone;\n this.prevTime = prevTime;\n this.prevUserEvent = prevUserEvent;\n }\n isolate() {\n return this.prevTime ? new HistoryState(this.done, this.undone) : this;\n }\n addChanges(event, time, userEvent, config, tr) {\n let done = this.done, lastEvent = done[done.length - 1];\n if (lastEvent && lastEvent.changes && !lastEvent.changes.empty && event.changes &&\n (!userEvent || joinableUserEvent.test(userEvent)) &&\n ((!lastEvent.selectionsAfter.length &&\n time - this.prevTime < config.newGroupDelay &&\n config.joinToEvent(tr, isAdjacent(lastEvent.changes, event.changes))) ||\n // For compose (but not compose.start) events, always join with previous event\n userEvent == \"input.type.compose\")) {\n done = updateBranch(done, done.length - 1, config.minDepth, new HistEvent(event.changes.compose(lastEvent.changes), conc(event.effects, lastEvent.effects), lastEvent.mapped, lastEvent.startSelection, none$2));\n }\n else {\n done = updateBranch(done, done.length, config.minDepth, event);\n }\n return new HistoryState(done, none$2, time, userEvent);\n }\n addSelection(selection, time, userEvent, newGroupDelay) {\n let last = this.done.length ? this.done[this.done.length - 1].selectionsAfter : none$2;\n if (last.length > 0 &&\n time - this.prevTime < newGroupDelay &&\n userEvent == this.prevUserEvent && userEvent && /^select($|\\.)/.test(userEvent) &&\n eqSelectionShape(last[last.length - 1], selection))\n return this;\n return new HistoryState(addSelection(this.done, selection), this.undone, time, userEvent);\n }\n addMapping(mapping) {\n return new HistoryState(addMappingToBranch(this.done, mapping), addMappingToBranch(this.undone, mapping), this.prevTime, this.prevUserEvent);\n }\n pop(side, state, onlySelection) {\n let branch = side == 0 /* BranchName.Done */ ? this.done : this.undone;\n if (branch.length == 0)\n return null;\n let event = branch[branch.length - 1], selection = event.selectionsAfter[0] || state.selection;\n if (onlySelection && event.selectionsAfter.length) {\n return state.update({\n selection: event.selectionsAfter[event.selectionsAfter.length - 1],\n annotations: fromHistory.of({ side, rest: popSelection(branch), selection }),\n userEvent: side == 0 /* BranchName.Done */ ? \"select.undo\" : \"select.redo\",\n scrollIntoView: true\n });\n }\n else if (!event.changes) {\n return null;\n }\n else {\n let rest = branch.length == 1 ? none$2 : branch.slice(0, branch.length - 1);\n if (event.mapped)\n rest = addMappingToBranch(rest, event.mapped);\n return state.update({\n changes: event.changes,\n selection: event.startSelection,\n effects: event.effects,\n annotations: fromHistory.of({ side, rest, selection }),\n filter: false,\n userEvent: side == 0 /* BranchName.Done */ ? \"undo\" : \"redo\",\n scrollIntoView: true\n });\n }\n }\n }\n HistoryState.empty = /*@__PURE__*/new HistoryState(none$2, none$2);\n /**\n Default key bindings for the undo history.\n\n - Mod-z: [`undo`](https://codemirror.net/6/docs/ref/#commands.undo).\n - Mod-y (Mod-Shift-z on macOS) + Ctrl-Shift-z on Linux: [`redo`](https://codemirror.net/6/docs/ref/#commands.redo).\n - Mod-u: [`undoSelection`](https://codemirror.net/6/docs/ref/#commands.undoSelection).\n - Alt-u (Mod-Shift-u on macOS): [`redoSelection`](https://codemirror.net/6/docs/ref/#commands.redoSelection).\n */\n const historyKeymap = [\n { key: \"Mod-z\", run: undo, preventDefault: true },\n { key: \"Mod-y\", mac: \"Mod-Shift-z\", run: redo, preventDefault: true },\n { linux: \"Ctrl-Shift-z\", run: redo, preventDefault: true },\n { key: \"Mod-u\", run: undoSelection, preventDefault: true },\n { key: \"Alt-u\", mac: \"Mod-Shift-u\", run: redoSelection, preventDefault: true }\n ];\n\n function updateSel(sel, by) {\n return EditorSelection.create(sel.ranges.map(by), sel.mainIndex);\n }\n function setSel(state, selection) {\n return state.update({ selection, scrollIntoView: true, userEvent: \"select\" });\n }\n function moveSel({ state, dispatch }, how) {\n let selection = updateSel(state.selection, how);\n if (selection.eq(state.selection, true))\n return false;\n dispatch(setSel(state, selection));\n return true;\n }\n function rangeEnd(range, forward) {\n return EditorSelection.cursor(forward ? range.to : range.from);\n }\n function cursorByChar(view, forward) {\n return moveSel(view, range => range.empty ? view.moveByChar(range, forward) : rangeEnd(range, forward));\n }\n function ltrAtCursor(view) {\n return view.textDirectionAt(view.state.selection.main.head) == Direction.LTR;\n }\n /**\n Move the selection one character to the left (which is backward in\n left-to-right text, forward in right-to-left text).\n */\n const cursorCharLeft = view => cursorByChar(view, !ltrAtCursor(view));\n /**\n Move the selection one character to the right.\n */\n const cursorCharRight = view => cursorByChar(view, ltrAtCursor(view));\n function cursorByGroup(view, forward) {\n return moveSel(view, range => range.empty ? view.moveByGroup(range, forward) : rangeEnd(range, forward));\n }\n /**\n Move the selection to the left across one group of word or\n non-word (but also non-space) characters.\n */\n const cursorGroupLeft = view => cursorByGroup(view, !ltrAtCursor(view));\n /**\n Move the selection one group to the right.\n */\n const cursorGroupRight = view => cursorByGroup(view, ltrAtCursor(view));\n function interestingNode(state, node, bracketProp) {\n if (node.type.prop(bracketProp))\n return true;\n let len = node.to - node.from;\n return len && (len > 2 || /[^\\s,.;:]/.test(state.sliceDoc(node.from, node.to))) || node.firstChild;\n }\n function moveBySyntax(state, start, forward) {\n let pos = syntaxTree(state).resolveInner(start.head);\n let bracketProp = forward ? NodeProp.closedBy : NodeProp.openedBy;\n // Scan forward through child nodes to see if there's an interesting\n // node ahead.\n for (let at = start.head;;) {\n let next = forward ? pos.childAfter(at) : pos.childBefore(at);\n if (!next)\n break;\n if (interestingNode(state, next, bracketProp))\n pos = next;\n else\n at = forward ? next.to : next.from;\n }\n let bracket = pos.type.prop(bracketProp), match, newPos;\n if (bracket && (match = forward ? matchBrackets(state, pos.from, 1) : matchBrackets(state, pos.to, -1)) && match.matched)\n newPos = forward ? match.end.to : match.end.from;\n else\n newPos = forward ? pos.to : pos.from;\n return EditorSelection.cursor(newPos, forward ? -1 : 1);\n }\n /**\n Move the cursor over the next syntactic element to the left.\n */\n const cursorSyntaxLeft = view => moveSel(view, range => moveBySyntax(view.state, range, !ltrAtCursor(view)));\n /**\n Move the cursor over the next syntactic element to the right.\n */\n const cursorSyntaxRight = view => moveSel(view, range => moveBySyntax(view.state, range, ltrAtCursor(view)));\n function cursorByLine(view, forward) {\n return moveSel(view, range => {\n if (!range.empty)\n return rangeEnd(range, forward);\n let moved = view.moveVertically(range, forward);\n return moved.head != range.head ? moved : view.moveToLineBoundary(range, forward);\n });\n }\n /**\n Move the selection one line up.\n */\n const cursorLineUp = view => cursorByLine(view, false);\n /**\n Move the selection one line down.\n */\n const cursorLineDown = view => cursorByLine(view, true);\n function pageInfo(view) {\n let selfScroll = view.scrollDOM.clientHeight < view.scrollDOM.scrollHeight - 2;\n let marginTop = 0, marginBottom = 0, height;\n if (selfScroll) {\n for (let source of view.state.facet(EditorView.scrollMargins)) {\n let margins = source(view);\n if (margins === null || margins === void 0 ? void 0 : margins.top)\n marginTop = Math.max(margins === null || margins === void 0 ? void 0 : margins.top, marginTop);\n if (margins === null || margins === void 0 ? void 0 : margins.bottom)\n marginBottom = Math.max(margins === null || margins === void 0 ? void 0 : margins.bottom, marginBottom);\n }\n height = view.scrollDOM.clientHeight - marginTop - marginBottom;\n }\n else {\n height = (view.dom.ownerDocument.defaultView || window).innerHeight;\n }\n return { marginTop, marginBottom, selfScroll,\n height: Math.max(view.defaultLineHeight, height - 5) };\n }\n function cursorByPage(view, forward) {\n let page = pageInfo(view);\n let { state } = view, selection = updateSel(state.selection, range => {\n return range.empty ? view.moveVertically(range, forward, page.height)\n : rangeEnd(range, forward);\n });\n if (selection.eq(state.selection))\n return false;\n let effect;\n if (page.selfScroll) {\n let startPos = view.coordsAtPos(state.selection.main.head);\n let scrollRect = view.scrollDOM.getBoundingClientRect();\n let scrollTop = scrollRect.top + page.marginTop, scrollBottom = scrollRect.bottom - page.marginBottom;\n if (startPos && startPos.top > scrollTop && startPos.bottom < scrollBottom)\n effect = EditorView.scrollIntoView(selection.main.head, { y: \"start\", yMargin: startPos.top - scrollTop });\n }\n view.dispatch(setSel(state, selection), { effects: effect });\n return true;\n }\n /**\n Move the selection one page up.\n */\n const cursorPageUp = view => cursorByPage(view, false);\n /**\n Move the selection one page down.\n */\n const cursorPageDown = view => cursorByPage(view, true);\n function moveByLineBoundary(view, start, forward) {\n let line = view.lineBlockAt(start.head), moved = view.moveToLineBoundary(start, forward);\n if (moved.head == start.head && moved.head != (forward ? line.to : line.from))\n moved = view.moveToLineBoundary(start, forward, false);\n if (!forward && moved.head == line.from && line.length) {\n let space = /^\\s*/.exec(view.state.sliceDoc(line.from, Math.min(line.from + 100, line.to)))[0].length;\n if (space && start.head != line.from + space)\n moved = EditorSelection.cursor(line.from + space);\n }\n return moved;\n }\n /**\n Move the selection to the next line wrap point, or to the end of\n the line if there isn't one left on this line.\n */\n const cursorLineBoundaryForward = view => moveSel(view, range => moveByLineBoundary(view, range, true));\n /**\n Move the selection to previous line wrap point, or failing that to\n the start of the line. If the line is indented, and the cursor\n isn't already at the end of the indentation, this will move to the\n end of the indentation instead of the start of the line.\n */\n const cursorLineBoundaryBackward = view => moveSel(view, range => moveByLineBoundary(view, range, false));\n /**\n Move the selection one line wrap point to the left.\n */\n const cursorLineBoundaryLeft = view => moveSel(view, range => moveByLineBoundary(view, range, !ltrAtCursor(view)));\n /**\n Move the selection one line wrap point to the right.\n */\n const cursorLineBoundaryRight = view => moveSel(view, range => moveByLineBoundary(view, range, ltrAtCursor(view)));\n /**\n Move the selection to the start of the line.\n */\n const cursorLineStart = view => moveSel(view, range => EditorSelection.cursor(view.lineBlockAt(range.head).from, 1));\n /**\n Move the selection to the end of the line.\n */\n const cursorLineEnd = view => moveSel(view, range => EditorSelection.cursor(view.lineBlockAt(range.head).to, -1));\n function toMatchingBracket(state, dispatch, extend) {\n let found = false, selection = updateSel(state.selection, range => {\n let matching = matchBrackets(state, range.head, -1)\n || matchBrackets(state, range.head, 1)\n || (range.head > 0 && matchBrackets(state, range.head - 1, 1))\n || (range.head < state.doc.length && matchBrackets(state, range.head + 1, -1));\n if (!matching || !matching.end)\n return range;\n found = true;\n let head = matching.start.from == range.head ? matching.end.to : matching.end.from;\n return extend ? EditorSelection.range(range.anchor, head) : EditorSelection.cursor(head);\n });\n if (!found)\n return false;\n dispatch(setSel(state, selection));\n return true;\n }\n /**\n Move the selection to the bracket matching the one it is currently\n on, if any.\n */\n const cursorMatchingBracket = ({ state, dispatch }) => toMatchingBracket(state, dispatch, false);\n function extendSel(view, how) {\n let selection = updateSel(view.state.selection, range => {\n let head = how(range);\n return EditorSelection.range(range.anchor, head.head, head.goalColumn, head.bidiLevel || undefined);\n });\n if (selection.eq(view.state.selection))\n return false;\n view.dispatch(setSel(view.state, selection));\n return true;\n }\n function selectByChar(view, forward) {\n return extendSel(view, range => view.moveByChar(range, forward));\n }\n /**\n Move the selection head one character to the left, while leaving\n the anchor in place.\n */\n const selectCharLeft = view => selectByChar(view, !ltrAtCursor(view));\n /**\n Move the selection head one character to the right.\n */\n const selectCharRight = view => selectByChar(view, ltrAtCursor(view));\n function selectByGroup(view, forward) {\n return extendSel(view, range => view.moveByGroup(range, forward));\n }\n /**\n Move the selection head one [group](https://codemirror.net/6/docs/ref/#commands.cursorGroupLeft) to\n the left.\n */\n const selectGroupLeft = view => selectByGroup(view, !ltrAtCursor(view));\n /**\n Move the selection head one group to the right.\n */\n const selectGroupRight = view => selectByGroup(view, ltrAtCursor(view));\n /**\n Move the selection head over the next syntactic element to the left.\n */\n const selectSyntaxLeft = view => extendSel(view, range => moveBySyntax(view.state, range, !ltrAtCursor(view)));\n /**\n Move the selection head over the next syntactic element to the right.\n */\n const selectSyntaxRight = view => extendSel(view, range => moveBySyntax(view.state, range, ltrAtCursor(view)));\n function selectByLine(view, forward) {\n return extendSel(view, range => view.moveVertically(range, forward));\n }\n /**\n Move the selection head one line up.\n */\n const selectLineUp = view => selectByLine(view, false);\n /**\n Move the selection head one line down.\n */\n const selectLineDown = view => selectByLine(view, true);\n function selectByPage(view, forward) {\n return extendSel(view, range => view.moveVertically(range, forward, pageInfo(view).height));\n }\n /**\n Move the selection head one page up.\n */\n const selectPageUp = view => selectByPage(view, false);\n /**\n Move the selection head one page down.\n */\n const selectPageDown = view => selectByPage(view, true);\n /**\n Move the selection head to the next line boundary.\n */\n const selectLineBoundaryForward = view => extendSel(view, range => moveByLineBoundary(view, range, true));\n /**\n Move the selection head to the previous line boundary.\n */\n const selectLineBoundaryBackward = view => extendSel(view, range => moveByLineBoundary(view, range, false));\n /**\n Move the selection head one line boundary to the left.\n */\n const selectLineBoundaryLeft = view => extendSel(view, range => moveByLineBoundary(view, range, !ltrAtCursor(view)));\n /**\n Move the selection head one line boundary to the right.\n */\n const selectLineBoundaryRight = view => extendSel(view, range => moveByLineBoundary(view, range, ltrAtCursor(view)));\n /**\n Move the selection head to the start of the line.\n */\n const selectLineStart = view => extendSel(view, range => EditorSelection.cursor(view.lineBlockAt(range.head).from));\n /**\n Move the selection head to the end of the line.\n */\n const selectLineEnd = view => extendSel(view, range => EditorSelection.cursor(view.lineBlockAt(range.head).to));\n /**\n Move the selection to the start of the document.\n */\n const cursorDocStart = ({ state, dispatch }) => {\n dispatch(setSel(state, { anchor: 0 }));\n return true;\n };\n /**\n Move the selection to the end of the document.\n */\n const cursorDocEnd = ({ state, dispatch }) => {\n dispatch(setSel(state, { anchor: state.doc.length }));\n return true;\n };\n /**\n Move the selection head to the start of the document.\n */\n const selectDocStart = ({ state, dispatch }) => {\n dispatch(setSel(state, { anchor: state.selection.main.anchor, head: 0 }));\n return true;\n };\n /**\n Move the selection head to the end of the document.\n */\n const selectDocEnd = ({ state, dispatch }) => {\n dispatch(setSel(state, { anchor: state.selection.main.anchor, head: state.doc.length }));\n return true;\n };\n /**\n Select the entire document.\n */\n const selectAll$1 = ({ state, dispatch }) => {\n dispatch(state.update({ selection: { anchor: 0, head: state.doc.length }, userEvent: \"select\" }));\n return true;\n };\n /**\n Expand the selection to cover entire lines.\n */\n const selectLine = ({ state, dispatch }) => {\n let ranges = selectedLineBlocks(state).map(({ from, to }) => EditorSelection.range(from, Math.min(to + 1, state.doc.length)));\n dispatch(state.update({ selection: EditorSelection.create(ranges), userEvent: \"select\" }));\n return true;\n };\n /**\n Select the next syntactic construct that is larger than the\n selection. Note that this will only work insofar as the language\n [provider](https://codemirror.net/6/docs/ref/#language.language) you use builds up a full\n syntax tree.\n */\n const selectParentSyntax = ({ state, dispatch }) => {\n let selection = updateSel(state.selection, range => {\n var _a;\n let stack = syntaxTree(state).resolveStack(range.from, 1);\n for (let cur = stack; cur; cur = cur.next) {\n let { node } = cur;\n if (((node.from < range.from && node.to >= range.to) ||\n (node.to > range.to && node.from <= range.from)) &&\n ((_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent))\n return EditorSelection.range(node.to, node.from);\n }\n return range;\n });\n dispatch(setSel(state, selection));\n return true;\n };\n /**\n Simplify the current selection. When multiple ranges are selected,\n reduce it to its main range. Otherwise, if the selection is\n non-empty, convert it to a cursor selection.\n */\n const simplifySelection = ({ state, dispatch }) => {\n let cur = state.selection, selection = null;\n if (cur.ranges.length > 1)\n selection = EditorSelection.create([cur.main]);\n else if (!cur.main.empty)\n selection = EditorSelection.create([EditorSelection.cursor(cur.main.head)]);\n if (!selection)\n return false;\n dispatch(setSel(state, selection));\n return true;\n };\n function deleteBy(target, by) {\n if (target.state.readOnly)\n return false;\n let event = \"delete.selection\", { state } = target;\n let changes = state.changeByRange(range => {\n let { from, to } = range;\n if (from == to) {\n let towards = by(range);\n if (towards < from) {\n event = \"delete.backward\";\n towards = skipAtomic(target, towards, false);\n }\n else if (towards > from) {\n event = \"delete.forward\";\n towards = skipAtomic(target, towards, true);\n }\n from = Math.min(from, towards);\n to = Math.max(to, towards);\n }\n else {\n from = skipAtomic(target, from, false);\n to = skipAtomic(target, to, true);\n }\n return from == to ? { range } : { changes: { from, to }, range: EditorSelection.cursor(from, from < range.head ? -1 : 1) };\n });\n if (changes.changes.empty)\n return false;\n target.dispatch(state.update(changes, {\n scrollIntoView: true,\n userEvent: event,\n effects: event == \"delete.selection\" ? EditorView.announce.of(state.phrase(\"Selection deleted\")) : undefined\n }));\n return true;\n }\n function skipAtomic(target, pos, forward) {\n if (target instanceof EditorView)\n for (let ranges of target.state.facet(EditorView.atomicRanges).map(f => f(target)))\n ranges.between(pos, pos, (from, to) => {\n if (from < pos && to > pos)\n pos = forward ? to : from;\n });\n return pos;\n }\n const deleteByChar = (target, forward, byIndentUnit) => deleteBy(target, range => {\n let pos = range.from, { state } = target, line = state.doc.lineAt(pos), before, targetPos;\n if (byIndentUnit && !forward && pos > line.from && pos < line.from + 200 &&\n !/[^ \\t]/.test(before = line.text.slice(0, pos - line.from))) {\n if (before[before.length - 1] == \"\\t\")\n return pos - 1;\n let col = countColumn(before, state.tabSize), drop = col % getIndentUnit(state) || getIndentUnit(state);\n for (let i = 0; i < drop && before[before.length - 1 - i] == \" \"; i++)\n pos--;\n targetPos = pos;\n }\n else {\n targetPos = findClusterBreak(line.text, pos - line.from, forward, forward) + line.from;\n if (targetPos == pos && line.number != (forward ? state.doc.lines : 1))\n targetPos += forward ? 1 : -1;\n else if (!forward && /[\\ufe00-\\ufe0f]/.test(line.text.slice(targetPos - line.from, pos - line.from)))\n targetPos = findClusterBreak(line.text, targetPos - line.from, false, false) + line.from;\n }\n return targetPos;\n });\n /**\n Delete the selection, or, for cursor selections, the character or\n indentation unit before the cursor.\n */\n const deleteCharBackward = view => deleteByChar(view, false, true);\n /**\n Delete the selection or the character after the cursor.\n */\n const deleteCharForward = view => deleteByChar(view, true, false);\n const deleteByGroup = (target, forward) => deleteBy(target, range => {\n let pos = range.head, { state } = target, line = state.doc.lineAt(pos);\n let categorize = state.charCategorizer(pos);\n for (let cat = null;;) {\n if (pos == (forward ? line.to : line.from)) {\n if (pos == range.head && line.number != (forward ? state.doc.lines : 1))\n pos += forward ? 1 : -1;\n break;\n }\n let next = findClusterBreak(line.text, pos - line.from, forward) + line.from;\n let nextChar = line.text.slice(Math.min(pos, next) - line.from, Math.max(pos, next) - line.from);\n let nextCat = categorize(nextChar);\n if (cat != null && nextCat != cat)\n break;\n if (nextChar != \" \" || pos != range.head)\n cat = nextCat;\n pos = next;\n }\n return pos;\n });\n /**\n Delete the selection or backward until the end of the next\n [group](https://codemirror.net/6/docs/ref/#view.EditorView.moveByGroup), only skipping groups of\n whitespace when they consist of a single space.\n */\n const deleteGroupBackward = target => deleteByGroup(target, false);\n /**\n Delete the selection or forward until the end of the next group.\n */\n const deleteGroupForward = target => deleteByGroup(target, true);\n /**\n Delete the selection, or, if it is a cursor selection, delete to\n the end of the line. If the cursor is directly at the end of the\n line, delete the line break after it.\n */\n const deleteToLineEnd = view => deleteBy(view, range => {\n let lineEnd = view.lineBlockAt(range.head).to;\n return range.head < lineEnd ? lineEnd : Math.min(view.state.doc.length, range.head + 1);\n });\n /**\n Delete the selection, or, if it is a cursor selection, delete to\n the start of the line or the next line wrap before the cursor.\n */\n const deleteLineBoundaryBackward = view => deleteBy(view, range => {\n let lineStart = view.moveToLineBoundary(range, false).head;\n return range.head > lineStart ? lineStart : Math.max(0, range.head - 1);\n });\n /**\n Delete the selection, or, if it is a cursor selection, delete to\n the end of the line or the next line wrap after the cursor.\n */\n const deleteLineBoundaryForward = view => deleteBy(view, range => {\n let lineStart = view.moveToLineBoundary(range, true).head;\n return range.head < lineStart ? lineStart : Math.min(view.state.doc.length, range.head + 1);\n });\n /**\n Replace each selection range with a line break, leaving the cursor\n on the line before the break.\n */\n const splitLine = ({ state, dispatch }) => {\n if (state.readOnly)\n return false;\n let changes = state.changeByRange(range => {\n return { changes: { from: range.from, to: range.to, insert: Text.of([\"\", \"\"]) },\n range: EditorSelection.cursor(range.from) };\n });\n dispatch(state.update(changes, { scrollIntoView: true, userEvent: \"input\" }));\n return true;\n };\n /**\n Flip the characters before and after the cursor(s).\n */\n const transposeChars = ({ state, dispatch }) => {\n if (state.readOnly)\n return false;\n let changes = state.changeByRange(range => {\n if (!range.empty || range.from == 0 || range.from == state.doc.length)\n return { range };\n let pos = range.from, line = state.doc.lineAt(pos);\n let from = pos == line.from ? pos - 1 : findClusterBreak(line.text, pos - line.from, false) + line.from;\n let to = pos == line.to ? pos + 1 : findClusterBreak(line.text, pos - line.from, true) + line.from;\n return { changes: { from, to, insert: state.doc.slice(pos, to).append(state.doc.slice(from, pos)) },\n range: EditorSelection.cursor(to) };\n });\n if (changes.changes.empty)\n return false;\n dispatch(state.update(changes, { scrollIntoView: true, userEvent: \"move.character\" }));\n return true;\n };\n function selectedLineBlocks(state) {\n let blocks = [], upto = -1;\n for (let range of state.selection.ranges) {\n let startLine = state.doc.lineAt(range.from), endLine = state.doc.lineAt(range.to);\n if (!range.empty && range.to == endLine.from)\n endLine = state.doc.lineAt(range.to - 1);\n if (upto >= startLine.number) {\n let prev = blocks[blocks.length - 1];\n prev.to = endLine.to;\n prev.ranges.push(range);\n }\n else {\n blocks.push({ from: startLine.from, to: endLine.to, ranges: [range] });\n }\n upto = endLine.number + 1;\n }\n return blocks;\n }\n function moveLine(state, dispatch, forward) {\n if (state.readOnly)\n return false;\n let changes = [], ranges = [];\n for (let block of selectedLineBlocks(state)) {\n if (forward ? block.to == state.doc.length : block.from == 0)\n continue;\n let nextLine = state.doc.lineAt(forward ? block.to + 1 : block.from - 1);\n let size = nextLine.length + 1;\n if (forward) {\n changes.push({ from: block.to, to: nextLine.to }, { from: block.from, insert: nextLine.text + state.lineBreak });\n for (let r of block.ranges)\n ranges.push(EditorSelection.range(Math.min(state.doc.length, r.anchor + size), Math.min(state.doc.length, r.head + size)));\n }\n else {\n changes.push({ from: nextLine.from, to: block.from }, { from: block.to, insert: state.lineBreak + nextLine.text });\n for (let r of block.ranges)\n ranges.push(EditorSelection.range(r.anchor - size, r.head - size));\n }\n }\n if (!changes.length)\n return false;\n dispatch(state.update({\n changes,\n scrollIntoView: true,\n selection: EditorSelection.create(ranges, state.selection.mainIndex),\n userEvent: \"move.line\"\n }));\n return true;\n }\n /**\n Move the selected lines up one line.\n */\n const moveLineUp = ({ state, dispatch }) => moveLine(state, dispatch, false);\n /**\n Move the selected lines down one line.\n */\n const moveLineDown = ({ state, dispatch }) => moveLine(state, dispatch, true);\n function copyLine(state, dispatch, forward) {\n if (state.readOnly)\n return false;\n let changes = [];\n for (let block of selectedLineBlocks(state)) {\n if (forward)\n changes.push({ from: block.from, insert: state.doc.slice(block.from, block.to) + state.lineBreak });\n else\n changes.push({ from: block.to, insert: state.lineBreak + state.doc.slice(block.from, block.to) });\n }\n dispatch(state.update({ changes, scrollIntoView: true, userEvent: \"input.copyline\" }));\n return true;\n }\n /**\n Create a copy of the selected lines. Keep the selection in the top copy.\n */\n const copyLineUp = ({ state, dispatch }) => copyLine(state, dispatch, false);\n /**\n Create a copy of the selected lines. Keep the selection in the bottom copy.\n */\n const copyLineDown = ({ state, dispatch }) => copyLine(state, dispatch, true);\n /**\n Delete selected lines.\n */\n const deleteLine = view => {\n if (view.state.readOnly)\n return false;\n let { state } = view, changes = state.changes(selectedLineBlocks(state).map(({ from, to }) => {\n if (from > 0)\n from--;\n else if (to < state.doc.length)\n to++;\n return { from, to };\n }));\n let selection = updateSel(state.selection, range => {\n let dist = undefined;\n if (view.lineWrapping) {\n let block = view.lineBlockAt(range.head), pos = view.coordsAtPos(range.head, range.assoc || 1);\n if (pos)\n dist = (block.bottom + view.documentTop) - pos.bottom + view.defaultLineHeight / 2;\n }\n return view.moveVertically(range, true, dist);\n }).map(changes);\n view.dispatch({ changes, selection, scrollIntoView: true, userEvent: \"delete.line\" });\n return true;\n };\n function isBetweenBrackets(state, pos) {\n if (/\\(\\)|\\[\\]|\\{\\}/.test(state.sliceDoc(pos - 1, pos + 1)))\n return { from: pos, to: pos };\n let context = syntaxTree(state).resolveInner(pos);\n let before = context.childBefore(pos), after = context.childAfter(pos), closedBy;\n if (before && after && before.to <= pos && after.from >= pos &&\n (closedBy = before.type.prop(NodeProp.closedBy)) && closedBy.indexOf(after.name) > -1 &&\n state.doc.lineAt(before.to).from == state.doc.lineAt(after.from).from &&\n !/\\S/.test(state.sliceDoc(before.to, after.from)))\n return { from: before.to, to: after.from };\n return null;\n }\n /**\n Replace the selection with a newline and indent the newly created\n line(s). If the current line consists only of whitespace, this\n will also delete that whitespace. When the cursor is between\n matching brackets, an additional newline will be inserted after\n the cursor.\n */\n const insertNewlineAndIndent = /*@__PURE__*/newlineAndIndent(false);\n /**\n Create a blank, indented line below the current line.\n */\n const insertBlankLine = /*@__PURE__*/newlineAndIndent(true);\n function newlineAndIndent(atEof) {\n return ({ state, dispatch }) => {\n if (state.readOnly)\n return false;\n let changes = state.changeByRange(range => {\n let { from, to } = range, line = state.doc.lineAt(from);\n let explode = !atEof && from == to && isBetweenBrackets(state, from);\n if (atEof)\n from = to = (to <= line.to ? line : state.doc.lineAt(to)).to;\n let cx = new IndentContext(state, { simulateBreak: from, simulateDoubleBreak: !!explode });\n let indent = getIndentation(cx, from);\n if (indent == null)\n indent = countColumn(/^\\s*/.exec(state.doc.lineAt(from).text)[0], state.tabSize);\n while (to < line.to && /\\s/.test(line.text[to - line.from]))\n to++;\n if (explode)\n ({ from, to } = explode);\n else if (from > line.from && from < line.from + 100 && !/\\S/.test(line.text.slice(0, from)))\n from = line.from;\n let insert = [\"\", indentString(state, indent)];\n if (explode)\n insert.push(indentString(state, cx.lineIndent(line.from, -1)));\n return { changes: { from, to, insert: Text.of(insert) },\n range: EditorSelection.cursor(from + 1 + insert[1].length) };\n });\n dispatch(state.update(changes, { scrollIntoView: true, userEvent: \"input\" }));\n return true;\n };\n }\n function changeBySelectedLine(state, f) {\n let atLine = -1;\n return state.changeByRange(range => {\n let changes = [];\n for (let pos = range.from; pos <= range.to;) {\n let line = state.doc.lineAt(pos);\n if (line.number > atLine && (range.empty || range.to > line.from)) {\n f(line, changes, range);\n atLine = line.number;\n }\n pos = line.to + 1;\n }\n let changeSet = state.changes(changes);\n return { changes,\n range: EditorSelection.range(changeSet.mapPos(range.anchor, 1), changeSet.mapPos(range.head, 1)) };\n });\n }\n /**\n Auto-indent the selected lines. This uses the [indentation service\n facet](https://codemirror.net/6/docs/ref/#language.indentService) as source for auto-indent\n information.\n */\n const indentSelection = ({ state, dispatch }) => {\n if (state.readOnly)\n return false;\n let updated = Object.create(null);\n let context = new IndentContext(state, { overrideIndentation: start => {\n let found = updated[start];\n return found == null ? -1 : found;\n } });\n let changes = changeBySelectedLine(state, (line, changes, range) => {\n let indent = getIndentation(context, line.from);\n if (indent == null)\n return;\n if (!/\\S/.test(line.text))\n indent = 0;\n let cur = /^\\s*/.exec(line.text)[0];\n let norm = indentString(state, indent);\n if (cur != norm || range.from < line.from + cur.length) {\n updated[line.from] = indent;\n changes.push({ from: line.from, to: line.from + cur.length, insert: norm });\n }\n });\n if (!changes.changes.empty)\n dispatch(state.update(changes, { userEvent: \"indent\" }));\n return true;\n };\n /**\n Add a [unit](https://codemirror.net/6/docs/ref/#language.indentUnit) of indentation to all selected\n lines.\n */\n const indentMore = ({ state, dispatch }) => {\n if (state.readOnly)\n return false;\n dispatch(state.update(changeBySelectedLine(state, (line, changes) => {\n changes.push({ from: line.from, insert: state.facet(indentUnit) });\n }), { userEvent: \"input.indent\" }));\n return true;\n };\n /**\n Remove a [unit](https://codemirror.net/6/docs/ref/#language.indentUnit) of indentation from all\n selected lines.\n */\n const indentLess = ({ state, dispatch }) => {\n if (state.readOnly)\n return false;\n dispatch(state.update(changeBySelectedLine(state, (line, changes) => {\n let space = /^\\s*/.exec(line.text)[0];\n if (!space)\n return;\n let col = countColumn(space, state.tabSize), keep = 0;\n let insert = indentString(state, Math.max(0, col - getIndentUnit(state)));\n while (keep < space.length && keep < insert.length && space.charCodeAt(keep) == insert.charCodeAt(keep))\n keep++;\n changes.push({ from: line.from + keep, to: line.from + space.length, insert: insert.slice(keep) });\n }), { userEvent: \"delete.dedent\" }));\n return true;\n };\n /**\n Enables or disables\n [tab-focus mode](https://codemirror.net/6/docs/ref/#view.EditorView.setTabFocusMode). While on, this\n prevents the editor's key bindings from capturing Tab or\n Shift-Tab, making it possible for the user to move focus out of\n the editor with the keyboard.\n */\n const toggleTabFocusMode = view => {\n view.setTabFocusMode();\n return true;\n };\n /**\n Array of key bindings containing the Emacs-style bindings that are\n available on macOS by default.\n\n - Ctrl-b: [`cursorCharLeft`](https://codemirror.net/6/docs/ref/#commands.cursorCharLeft) ([`selectCharLeft`](https://codemirror.net/6/docs/ref/#commands.selectCharLeft) with Shift)\n - Ctrl-f: [`cursorCharRight`](https://codemirror.net/6/docs/ref/#commands.cursorCharRight) ([`selectCharRight`](https://codemirror.net/6/docs/ref/#commands.selectCharRight) with Shift)\n - Ctrl-p: [`cursorLineUp`](https://codemirror.net/6/docs/ref/#commands.cursorLineUp) ([`selectLineUp`](https://codemirror.net/6/docs/ref/#commands.selectLineUp) with Shift)\n - Ctrl-n: [`cursorLineDown`](https://codemirror.net/6/docs/ref/#commands.cursorLineDown) ([`selectLineDown`](https://codemirror.net/6/docs/ref/#commands.selectLineDown) with Shift)\n - Ctrl-a: [`cursorLineStart`](https://codemirror.net/6/docs/ref/#commands.cursorLineStart) ([`selectLineStart`](https://codemirror.net/6/docs/ref/#commands.selectLineStart) with Shift)\n - Ctrl-e: [`cursorLineEnd`](https://codemirror.net/6/docs/ref/#commands.cursorLineEnd) ([`selectLineEnd`](https://codemirror.net/6/docs/ref/#commands.selectLineEnd) with Shift)\n - Ctrl-d: [`deleteCharForward`](https://codemirror.net/6/docs/ref/#commands.deleteCharForward)\n - Ctrl-h: [`deleteCharBackward`](https://codemirror.net/6/docs/ref/#commands.deleteCharBackward)\n - Ctrl-k: [`deleteToLineEnd`](https://codemirror.net/6/docs/ref/#commands.deleteToLineEnd)\n - Ctrl-Alt-h: [`deleteGroupBackward`](https://codemirror.net/6/docs/ref/#commands.deleteGroupBackward)\n - Ctrl-o: [`splitLine`](https://codemirror.net/6/docs/ref/#commands.splitLine)\n - Ctrl-t: [`transposeChars`](https://codemirror.net/6/docs/ref/#commands.transposeChars)\n - Ctrl-v: [`cursorPageDown`](https://codemirror.net/6/docs/ref/#commands.cursorPageDown)\n - Alt-v: [`cursorPageUp`](https://codemirror.net/6/docs/ref/#commands.cursorPageUp)\n */\n const emacsStyleKeymap = [\n { key: \"Ctrl-b\", run: cursorCharLeft, shift: selectCharLeft, preventDefault: true },\n { key: \"Ctrl-f\", run: cursorCharRight, shift: selectCharRight },\n { key: \"Ctrl-p\", run: cursorLineUp, shift: selectLineUp },\n { key: \"Ctrl-n\", run: cursorLineDown, shift: selectLineDown },\n { key: \"Ctrl-a\", run: cursorLineStart, shift: selectLineStart },\n { key: \"Ctrl-e\", run: cursorLineEnd, shift: selectLineEnd },\n { key: \"Ctrl-d\", run: deleteCharForward },\n { key: \"Ctrl-h\", run: deleteCharBackward },\n { key: \"Ctrl-k\", run: deleteToLineEnd },\n { key: \"Ctrl-Alt-h\", run: deleteGroupBackward },\n { key: \"Ctrl-o\", run: splitLine },\n { key: \"Ctrl-t\", run: transposeChars },\n { key: \"Ctrl-v\", run: cursorPageDown },\n ];\n /**\n An array of key bindings closely sticking to platform-standard or\n widely used bindings. (This includes the bindings from\n [`emacsStyleKeymap`](https://codemirror.net/6/docs/ref/#commands.emacsStyleKeymap), with their `key`\n property changed to `mac`.)\n\n - ArrowLeft: [`cursorCharLeft`](https://codemirror.net/6/docs/ref/#commands.cursorCharLeft) ([`selectCharLeft`](https://codemirror.net/6/docs/ref/#commands.selectCharLeft) with Shift)\n - ArrowRight: [`cursorCharRight`](https://codemirror.net/6/docs/ref/#commands.cursorCharRight) ([`selectCharRight`](https://codemirror.net/6/docs/ref/#commands.selectCharRight) with Shift)\n - Ctrl-ArrowLeft (Alt-ArrowLeft on macOS): [`cursorGroupLeft`](https://codemirror.net/6/docs/ref/#commands.cursorGroupLeft) ([`selectGroupLeft`](https://codemirror.net/6/docs/ref/#commands.selectGroupLeft) with Shift)\n - Ctrl-ArrowRight (Alt-ArrowRight on macOS): [`cursorGroupRight`](https://codemirror.net/6/docs/ref/#commands.cursorGroupRight) ([`selectGroupRight`](https://codemirror.net/6/docs/ref/#commands.selectGroupRight) with Shift)\n - Cmd-ArrowLeft (on macOS): [`cursorLineStart`](https://codemirror.net/6/docs/ref/#commands.cursorLineStart) ([`selectLineStart`](https://codemirror.net/6/docs/ref/#commands.selectLineStart) with Shift)\n - Cmd-ArrowRight (on macOS): [`cursorLineEnd`](https://codemirror.net/6/docs/ref/#commands.cursorLineEnd) ([`selectLineEnd`](https://codemirror.net/6/docs/ref/#commands.selectLineEnd) with Shift)\n - ArrowUp: [`cursorLineUp`](https://codemirror.net/6/docs/ref/#commands.cursorLineUp) ([`selectLineUp`](https://codemirror.net/6/docs/ref/#commands.selectLineUp) with Shift)\n - ArrowDown: [`cursorLineDown`](https://codemirror.net/6/docs/ref/#commands.cursorLineDown) ([`selectLineDown`](https://codemirror.net/6/docs/ref/#commands.selectLineDown) with Shift)\n - Cmd-ArrowUp (on macOS): [`cursorDocStart`](https://codemirror.net/6/docs/ref/#commands.cursorDocStart) ([`selectDocStart`](https://codemirror.net/6/docs/ref/#commands.selectDocStart) with Shift)\n - Cmd-ArrowDown (on macOS): [`cursorDocEnd`](https://codemirror.net/6/docs/ref/#commands.cursorDocEnd) ([`selectDocEnd`](https://codemirror.net/6/docs/ref/#commands.selectDocEnd) with Shift)\n - Ctrl-ArrowUp (on macOS): [`cursorPageUp`](https://codemirror.net/6/docs/ref/#commands.cursorPageUp) ([`selectPageUp`](https://codemirror.net/6/docs/ref/#commands.selectPageUp) with Shift)\n - Ctrl-ArrowDown (on macOS): [`cursorPageDown`](https://codemirror.net/6/docs/ref/#commands.cursorPageDown) ([`selectPageDown`](https://codemirror.net/6/docs/ref/#commands.selectPageDown) with Shift)\n - PageUp: [`cursorPageUp`](https://codemirror.net/6/docs/ref/#commands.cursorPageUp) ([`selectPageUp`](https://codemirror.net/6/docs/ref/#commands.selectPageUp) with Shift)\n - PageDown: [`cursorPageDown`](https://codemirror.net/6/docs/ref/#commands.cursorPageDown) ([`selectPageDown`](https://codemirror.net/6/docs/ref/#commands.selectPageDown) with Shift)\n - Home: [`cursorLineBoundaryBackward`](https://codemirror.net/6/docs/ref/#commands.cursorLineBoundaryBackward) ([`selectLineBoundaryBackward`](https://codemirror.net/6/docs/ref/#commands.selectLineBoundaryBackward) with Shift)\n - End: [`cursorLineBoundaryForward`](https://codemirror.net/6/docs/ref/#commands.cursorLineBoundaryForward) ([`selectLineBoundaryForward`](https://codemirror.net/6/docs/ref/#commands.selectLineBoundaryForward) with Shift)\n - Ctrl-Home (Cmd-Home on macOS): [`cursorDocStart`](https://codemirror.net/6/docs/ref/#commands.cursorDocStart) ([`selectDocStart`](https://codemirror.net/6/docs/ref/#commands.selectDocStart) with Shift)\n - Ctrl-End (Cmd-Home on macOS): [`cursorDocEnd`](https://codemirror.net/6/docs/ref/#commands.cursorDocEnd) ([`selectDocEnd`](https://codemirror.net/6/docs/ref/#commands.selectDocEnd) with Shift)\n - Enter: [`insertNewlineAndIndent`](https://codemirror.net/6/docs/ref/#commands.insertNewlineAndIndent)\n - Ctrl-a (Cmd-a on macOS): [`selectAll`](https://codemirror.net/6/docs/ref/#commands.selectAll)\n - Backspace: [`deleteCharBackward`](https://codemirror.net/6/docs/ref/#commands.deleteCharBackward)\n - Delete: [`deleteCharForward`](https://codemirror.net/6/docs/ref/#commands.deleteCharForward)\n - Ctrl-Backspace (Alt-Backspace on macOS): [`deleteGroupBackward`](https://codemirror.net/6/docs/ref/#commands.deleteGroupBackward)\n - Ctrl-Delete (Alt-Delete on macOS): [`deleteGroupForward`](https://codemirror.net/6/docs/ref/#commands.deleteGroupForward)\n - Cmd-Backspace (macOS): [`deleteLineBoundaryBackward`](https://codemirror.net/6/docs/ref/#commands.deleteLineBoundaryBackward).\n - Cmd-Delete (macOS): [`deleteLineBoundaryForward`](https://codemirror.net/6/docs/ref/#commands.deleteLineBoundaryForward).\n */\n const standardKeymap = /*@__PURE__*/[\n { key: \"ArrowLeft\", run: cursorCharLeft, shift: selectCharLeft, preventDefault: true },\n { key: \"Mod-ArrowLeft\", mac: \"Alt-ArrowLeft\", run: cursorGroupLeft, shift: selectGroupLeft, preventDefault: true },\n { mac: \"Cmd-ArrowLeft\", run: cursorLineBoundaryLeft, shift: selectLineBoundaryLeft, preventDefault: true },\n { key: \"ArrowRight\", run: cursorCharRight, shift: selectCharRight, preventDefault: true },\n { key: \"Mod-ArrowRight\", mac: \"Alt-ArrowRight\", run: cursorGroupRight, shift: selectGroupRight, preventDefault: true },\n { mac: \"Cmd-ArrowRight\", run: cursorLineBoundaryRight, shift: selectLineBoundaryRight, preventDefault: true },\n { key: \"ArrowUp\", run: cursorLineUp, shift: selectLineUp, preventDefault: true },\n { mac: \"Cmd-ArrowUp\", run: cursorDocStart, shift: selectDocStart },\n { mac: \"Ctrl-ArrowUp\", run: cursorPageUp, shift: selectPageUp },\n { key: \"ArrowDown\", run: cursorLineDown, shift: selectLineDown, preventDefault: true },\n { mac: \"Cmd-ArrowDown\", run: cursorDocEnd, shift: selectDocEnd },\n { mac: \"Ctrl-ArrowDown\", run: cursorPageDown, shift: selectPageDown },\n { key: \"PageUp\", run: cursorPageUp, shift: selectPageUp },\n { key: \"PageDown\", run: cursorPageDown, shift: selectPageDown },\n { key: \"Home\", run: cursorLineBoundaryBackward, shift: selectLineBoundaryBackward, preventDefault: true },\n { key: \"Mod-Home\", run: cursorDocStart, shift: selectDocStart },\n { key: \"End\", run: cursorLineBoundaryForward, shift: selectLineBoundaryForward, preventDefault: true },\n { key: \"Mod-End\", run: cursorDocEnd, shift: selectDocEnd },\n { key: \"Enter\", run: insertNewlineAndIndent },\n { key: \"Mod-a\", run: selectAll$1 },\n { key: \"Backspace\", run: deleteCharBackward, shift: deleteCharBackward },\n { key: \"Delete\", run: deleteCharForward },\n { key: \"Mod-Backspace\", mac: \"Alt-Backspace\", run: deleteGroupBackward },\n { key: \"Mod-Delete\", mac: \"Alt-Delete\", run: deleteGroupForward },\n { mac: \"Mod-Backspace\", run: deleteLineBoundaryBackward },\n { mac: \"Mod-Delete\", run: deleteLineBoundaryForward }\n ].concat(/*@__PURE__*/emacsStyleKeymap.map(b => ({ mac: b.key, run: b.run, shift: b.shift })));\n /**\n The default keymap. Includes all bindings from\n [`standardKeymap`](https://codemirror.net/6/docs/ref/#commands.standardKeymap) plus the following:\n\n - Alt-ArrowLeft (Ctrl-ArrowLeft on macOS): [`cursorSyntaxLeft`](https://codemirror.net/6/docs/ref/#commands.cursorSyntaxLeft) ([`selectSyntaxLeft`](https://codemirror.net/6/docs/ref/#commands.selectSyntaxLeft) with Shift)\n - Alt-ArrowRight (Ctrl-ArrowRight on macOS): [`cursorSyntaxRight`](https://codemirror.net/6/docs/ref/#commands.cursorSyntaxRight) ([`selectSyntaxRight`](https://codemirror.net/6/docs/ref/#commands.selectSyntaxRight) with Shift)\n - Alt-ArrowUp: [`moveLineUp`](https://codemirror.net/6/docs/ref/#commands.moveLineUp)\n - Alt-ArrowDown: [`moveLineDown`](https://codemirror.net/6/docs/ref/#commands.moveLineDown)\n - Shift-Alt-ArrowUp: [`copyLineUp`](https://codemirror.net/6/docs/ref/#commands.copyLineUp)\n - Shift-Alt-ArrowDown: [`copyLineDown`](https://codemirror.net/6/docs/ref/#commands.copyLineDown)\n - Escape: [`simplifySelection`](https://codemirror.net/6/docs/ref/#commands.simplifySelection)\n - Ctrl-Enter (Cmd-Enter on macOS): [`insertBlankLine`](https://codemirror.net/6/docs/ref/#commands.insertBlankLine)\n - Alt-l (Ctrl-l on macOS): [`selectLine`](https://codemirror.net/6/docs/ref/#commands.selectLine)\n - Ctrl-i (Cmd-i on macOS): [`selectParentSyntax`](https://codemirror.net/6/docs/ref/#commands.selectParentSyntax)\n - Ctrl-[ (Cmd-[ on macOS): [`indentLess`](https://codemirror.net/6/docs/ref/#commands.indentLess)\n - Ctrl-] (Cmd-] on macOS): [`indentMore`](https://codemirror.net/6/docs/ref/#commands.indentMore)\n - Ctrl-Alt-\\\\ (Cmd-Alt-\\\\ on macOS): [`indentSelection`](https://codemirror.net/6/docs/ref/#commands.indentSelection)\n - Shift-Ctrl-k (Shift-Cmd-k on macOS): [`deleteLine`](https://codemirror.net/6/docs/ref/#commands.deleteLine)\n - Shift-Ctrl-\\\\ (Shift-Cmd-\\\\ on macOS): [`cursorMatchingBracket`](https://codemirror.net/6/docs/ref/#commands.cursorMatchingBracket)\n - Ctrl-/ (Cmd-/ on macOS): [`toggleComment`](https://codemirror.net/6/docs/ref/#commands.toggleComment).\n - Shift-Alt-a: [`toggleBlockComment`](https://codemirror.net/6/docs/ref/#commands.toggleBlockComment).\n - Ctrl-m (Alt-Shift-m on macOS): [`toggleTabFocusMode`](https://codemirror.net/6/docs/ref/#commands.toggleTabFocusMode).\n */\n const defaultKeymap = /*@__PURE__*/[\n { key: \"Alt-ArrowLeft\", mac: \"Ctrl-ArrowLeft\", run: cursorSyntaxLeft, shift: selectSyntaxLeft },\n { key: \"Alt-ArrowRight\", mac: \"Ctrl-ArrowRight\", run: cursorSyntaxRight, shift: selectSyntaxRight },\n { key: \"Alt-ArrowUp\", run: moveLineUp },\n { key: \"Shift-Alt-ArrowUp\", run: copyLineUp },\n { key: \"Alt-ArrowDown\", run: moveLineDown },\n { key: \"Shift-Alt-ArrowDown\", run: copyLineDown },\n { key: \"Escape\", run: simplifySelection },\n { key: \"Mod-Enter\", run: insertBlankLine },\n { key: \"Alt-l\", mac: \"Ctrl-l\", run: selectLine },\n { key: \"Mod-i\", run: selectParentSyntax, preventDefault: true },\n { key: \"Mod-[\", run: indentLess },\n { key: \"Mod-]\", run: indentMore },\n { key: \"Mod-Alt-\\\\\", run: indentSelection },\n { key: \"Shift-Mod-k\", run: deleteLine },\n { key: \"Shift-Mod-\\\\\", run: cursorMatchingBracket },\n { key: \"Mod-/\", run: toggleComment },\n { key: \"Alt-A\", run: toggleBlockComment },\n { key: \"Ctrl-m\", mac: \"Shift-Alt-m\", run: toggleTabFocusMode },\n ].concat(standardKeymap);\n /**\n A binding that binds Tab to [`indentMore`](https://codemirror.net/6/docs/ref/#commands.indentMore) and\n Shift-Tab to [`indentLess`](https://codemirror.net/6/docs/ref/#commands.indentLess).\n Please see the [Tab example](../../examples/tab/) before using\n this.\n */\n const indentWithTab = { key: \"Tab\", run: indentMore, shift: indentLess };\n\n function crelt() {\n var elt = arguments[0];\n if (typeof elt == \"string\") elt = document.createElement(elt);\n var i = 1, next = arguments[1];\n if (next && typeof next == \"object\" && next.nodeType == null && !Array.isArray(next)) {\n for (var name in next) if (Object.prototype.hasOwnProperty.call(next, name)) {\n var value = next[name];\n if (typeof value == \"string\") elt.setAttribute(name, value);\n else if (value != null) elt[name] = value;\n }\n i++;\n }\n for (; i < arguments.length; i++) add(elt, arguments[i]);\n return elt\n }\n\n function add(elt, child) {\n if (typeof child == \"string\") {\n elt.appendChild(document.createTextNode(child));\n } else if (child == null) ; else if (child.nodeType != null) {\n elt.appendChild(child);\n } else if (Array.isArray(child)) {\n for (var i = 0; i < child.length; i++) add(elt, child[i]);\n } else {\n throw new RangeError(\"Unsupported child node: \" + child)\n }\n }\n\n const basicNormalize = typeof String.prototype.normalize == \"function\"\n ? x => x.normalize(\"NFKD\") : x => x;\n /**\n A search cursor provides an iterator over text matches in a\n document.\n */\n class SearchCursor {\n /**\n Create a text cursor. The query is the search string, `from` to\n `to` provides the region to search.\n \n When `normalize` is given, it will be called, on both the query\n string and the content it is matched against, before comparing.\n You can, for example, create a case-insensitive search by\n passing `s => s.toLowerCase()`.\n \n Text is always normalized with\n [`.normalize(\"NFKD\")`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize)\n (when supported).\n */\n constructor(text, query, from = 0, to = text.length, normalize, test) {\n this.test = test;\n /**\n The current match (only holds a meaningful value after\n [`next`](https://codemirror.net/6/docs/ref/#search.SearchCursor.next) has been called and when\n `done` is false).\n */\n this.value = { from: 0, to: 0 };\n /**\n Whether the end of the iterated region has been reached.\n */\n this.done = false;\n this.matches = [];\n this.buffer = \"\";\n this.bufferPos = 0;\n this.iter = text.iterRange(from, to);\n this.bufferStart = from;\n this.normalize = normalize ? x => normalize(basicNormalize(x)) : basicNormalize;\n this.query = this.normalize(query);\n }\n peek() {\n if (this.bufferPos == this.buffer.length) {\n this.bufferStart += this.buffer.length;\n this.iter.next();\n if (this.iter.done)\n return -1;\n this.bufferPos = 0;\n this.buffer = this.iter.value;\n }\n return codePointAt(this.buffer, this.bufferPos);\n }\n /**\n Look for the next match. Updates the iterator's\n [`value`](https://codemirror.net/6/docs/ref/#search.SearchCursor.value) and\n [`done`](https://codemirror.net/6/docs/ref/#search.SearchCursor.done) properties. Should be called\n at least once before using the cursor.\n */\n next() {\n while (this.matches.length)\n this.matches.pop();\n return this.nextOverlapping();\n }\n /**\n The `next` method will ignore matches that partially overlap a\n previous match. This method behaves like `next`, but includes\n such matches.\n */\n nextOverlapping() {\n for (;;) {\n let next = this.peek();\n if (next < 0) {\n this.done = true;\n return this;\n }\n let str = fromCodePoint(next), start = this.bufferStart + this.bufferPos;\n this.bufferPos += codePointSize(next);\n let norm = this.normalize(str);\n for (let i = 0, pos = start;; i++) {\n let code = norm.charCodeAt(i);\n let match = this.match(code, pos, this.bufferPos + this.bufferStart);\n if (i == norm.length - 1) {\n if (match) {\n this.value = match;\n return this;\n }\n break;\n }\n if (pos == start && i < str.length && str.charCodeAt(i) == code)\n pos++;\n }\n }\n }\n match(code, pos, end) {\n let match = null;\n for (let i = 0; i < this.matches.length; i += 2) {\n let index = this.matches[i], keep = false;\n if (this.query.charCodeAt(index) == code) {\n if (index == this.query.length - 1) {\n match = { from: this.matches[i + 1], to: end };\n }\n else {\n this.matches[i]++;\n keep = true;\n }\n }\n if (!keep) {\n this.matches.splice(i, 2);\n i -= 2;\n }\n }\n if (this.query.charCodeAt(0) == code) {\n if (this.query.length == 1)\n match = { from: pos, to: end };\n else\n this.matches.push(1, pos);\n }\n if (match && this.test && !this.test(match.from, match.to, this.buffer, this.bufferStart))\n match = null;\n return match;\n }\n }\n if (typeof Symbol != \"undefined\")\n SearchCursor.prototype[Symbol.iterator] = function () { return this; };\n\n const empty = { from: -1, to: -1, match: /*@__PURE__*//.*/.exec(\"\") };\n const baseFlags = \"gm\" + (/x/.unicode == null ? \"\" : \"u\");\n /**\n This class is similar to [`SearchCursor`](https://codemirror.net/6/docs/ref/#search.SearchCursor)\n but searches for a regular expression pattern instead of a plain\n string.\n */\n class RegExpCursor {\n /**\n Create a cursor that will search the given range in the given\n document. `query` should be the raw pattern (as you'd pass it to\n `new RegExp`).\n */\n constructor(text, query, options, from = 0, to = text.length) {\n this.text = text;\n this.to = to;\n this.curLine = \"\";\n /**\n Set to `true` when the cursor has reached the end of the search\n range.\n */\n this.done = false;\n /**\n Will contain an object with the extent of the match and the\n match object when [`next`](https://codemirror.net/6/docs/ref/#search.RegExpCursor.next)\n sucessfully finds a match.\n */\n this.value = empty;\n if (/\\\\[sWDnr]|\\n|\\r|\\[\\^/.test(query))\n return new MultilineRegExpCursor(text, query, options, from, to);\n this.re = new RegExp(query, baseFlags + ((options === null || options === void 0 ? void 0 : options.ignoreCase) ? \"i\" : \"\"));\n this.test = options === null || options === void 0 ? void 0 : options.test;\n this.iter = text.iter();\n let startLine = text.lineAt(from);\n this.curLineStart = startLine.from;\n this.matchPos = toCharEnd(text, from);\n this.getLine(this.curLineStart);\n }\n getLine(skip) {\n this.iter.next(skip);\n if (this.iter.lineBreak) {\n this.curLine = \"\";\n }\n else {\n this.curLine = this.iter.value;\n if (this.curLineStart + this.curLine.length > this.to)\n this.curLine = this.curLine.slice(0, this.to - this.curLineStart);\n this.iter.next();\n }\n }\n nextLine() {\n this.curLineStart = this.curLineStart + this.curLine.length + 1;\n if (this.curLineStart > this.to)\n this.curLine = \"\";\n else\n this.getLine(0);\n }\n /**\n Move to the next match, if there is one.\n */\n next() {\n for (let off = this.matchPos - this.curLineStart;;) {\n this.re.lastIndex = off;\n let match = this.matchPos <= this.to && this.re.exec(this.curLine);\n if (match) {\n let from = this.curLineStart + match.index, to = from + match[0].length;\n this.matchPos = toCharEnd(this.text, to + (from == to ? 1 : 0));\n if (from == this.curLineStart + this.curLine.length)\n this.nextLine();\n if ((from < to || from > this.value.to) && (!this.test || this.test(from, to, match))) {\n this.value = { from, to, match };\n return this;\n }\n off = this.matchPos - this.curLineStart;\n }\n else if (this.curLineStart + this.curLine.length < this.to) {\n this.nextLine();\n off = 0;\n }\n else {\n this.done = true;\n return this;\n }\n }\n }\n }\n const flattened = /*@__PURE__*/new WeakMap();\n // Reusable (partially) flattened document strings\n class FlattenedDoc {\n constructor(from, text) {\n this.from = from;\n this.text = text;\n }\n get to() { return this.from + this.text.length; }\n static get(doc, from, to) {\n let cached = flattened.get(doc);\n if (!cached || cached.from >= to || cached.to <= from) {\n let flat = new FlattenedDoc(from, doc.sliceString(from, to));\n flattened.set(doc, flat);\n return flat;\n }\n if (cached.from == from && cached.to == to)\n return cached;\n let { text, from: cachedFrom } = cached;\n if (cachedFrom > from) {\n text = doc.sliceString(from, cachedFrom) + text;\n cachedFrom = from;\n }\n if (cached.to < to)\n text += doc.sliceString(cached.to, to);\n flattened.set(doc, new FlattenedDoc(cachedFrom, text));\n return new FlattenedDoc(from, text.slice(from - cachedFrom, to - cachedFrom));\n }\n }\n class MultilineRegExpCursor {\n constructor(text, query, options, from, to) {\n this.text = text;\n this.to = to;\n this.done = false;\n this.value = empty;\n this.matchPos = toCharEnd(text, from);\n this.re = new RegExp(query, baseFlags + ((options === null || options === void 0 ? void 0 : options.ignoreCase) ? \"i\" : \"\"));\n this.test = options === null || options === void 0 ? void 0 : options.test;\n this.flat = FlattenedDoc.get(text, from, this.chunkEnd(from + 5000 /* Chunk.Base */));\n }\n chunkEnd(pos) {\n return pos >= this.to ? this.to : this.text.lineAt(pos).to;\n }\n next() {\n for (;;) {\n let off = this.re.lastIndex = this.matchPos - this.flat.from;\n let match = this.re.exec(this.flat.text);\n // Skip empty matches directly after the last match\n if (match && !match[0] && match.index == off) {\n this.re.lastIndex = off + 1;\n match = this.re.exec(this.flat.text);\n }\n if (match) {\n let from = this.flat.from + match.index, to = from + match[0].length;\n // If a match goes almost to the end of a noncomplete chunk, try\n // again, since it'll likely be able to match more\n if ((this.flat.to >= this.to || match.index + match[0].length <= this.flat.text.length - 10) &&\n (!this.test || this.test(from, to, match))) {\n this.value = { from, to, match };\n this.matchPos = toCharEnd(this.text, to + (from == to ? 1 : 0));\n return this;\n }\n }\n if (this.flat.to == this.to) {\n this.done = true;\n return this;\n }\n // Grow the flattened doc\n this.flat = FlattenedDoc.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2));\n }\n }\n }\n if (typeof Symbol != \"undefined\") {\n RegExpCursor.prototype[Symbol.iterator] = MultilineRegExpCursor.prototype[Symbol.iterator] =\n function () { return this; };\n }\n function validRegExp(source) {\n try {\n new RegExp(source, baseFlags);\n return true;\n }\n catch (_a) {\n return false;\n }\n }\n function toCharEnd(text, pos) {\n if (pos >= text.length)\n return pos;\n let line = text.lineAt(pos), next;\n while (pos < line.to && (next = line.text.charCodeAt(pos - line.from)) >= 0xDC00 && next < 0xE000)\n pos++;\n return pos;\n }\n\n function createLineDialog(view) {\n let line = String(view.state.doc.lineAt(view.state.selection.main.head).number);\n let input = crelt(\"input\", { class: \"cm-textfield\", name: \"line\", value: line });\n let dom = crelt(\"form\", {\n class: \"cm-gotoLine\",\n onkeydown: (event) => {\n if (event.keyCode == 27) { // Escape\n event.preventDefault();\n view.dispatch({ effects: dialogEffect.of(false) });\n view.focus();\n }\n else if (event.keyCode == 13) { // Enter\n event.preventDefault();\n go();\n }\n },\n onsubmit: (event) => {\n event.preventDefault();\n go();\n }\n }, crelt(\"label\", view.state.phrase(\"Go to line\"), \": \", input), \" \", crelt(\"button\", { class: \"cm-button\", type: \"submit\" }, view.state.phrase(\"go\")));\n function go() {\n let match = /^([+-])?(\\d+)?(:\\d+)?(%)?$/.exec(input.value);\n if (!match)\n return;\n let { state } = view, startLine = state.doc.lineAt(state.selection.main.head);\n let [, sign, ln, cl, percent] = match;\n let col = cl ? +cl.slice(1) : 0;\n let line = ln ? +ln : startLine.number;\n if (ln && percent) {\n let pc = line / 100;\n if (sign)\n pc = pc * (sign == \"-\" ? -1 : 1) + (startLine.number / state.doc.lines);\n line = Math.round(state.doc.lines * pc);\n }\n else if (ln && sign) {\n line = line * (sign == \"-\" ? -1 : 1) + startLine.number;\n }\n let docLine = state.doc.line(Math.max(1, Math.min(state.doc.lines, line)));\n let selection = EditorSelection.cursor(docLine.from + Math.max(0, Math.min(col, docLine.length)));\n view.dispatch({\n effects: [dialogEffect.of(false), EditorView.scrollIntoView(selection.from, { y: 'center' })],\n selection,\n });\n view.focus();\n }\n return { dom };\n }\n const dialogEffect = /*@__PURE__*/StateEffect.define();\n const dialogField = /*@__PURE__*/StateField.define({\n create() { return true; },\n update(value, tr) {\n for (let e of tr.effects)\n if (e.is(dialogEffect))\n value = e.value;\n return value;\n },\n provide: f => showPanel.from(f, val => val ? createLineDialog : null)\n });\n /**\n Command that shows a dialog asking the user for a line number, and\n when a valid position is provided, moves the cursor to that line.\n\n Supports line numbers, relative line offsets prefixed with `+` or\n `-`, document percentages suffixed with `%`, and an optional\n column position by adding `:` and a second number after the line\n number.\n */\n const gotoLine = view => {\n let panel = getPanel(view, createLineDialog);\n if (!panel) {\n let effects = [dialogEffect.of(true)];\n if (view.state.field(dialogField, false) == null)\n effects.push(StateEffect.appendConfig.of([dialogField, baseTheme$1]));\n view.dispatch({ effects });\n panel = getPanel(view, createLineDialog);\n }\n if (panel)\n panel.dom.querySelector(\"input\").select();\n return true;\n };\n const baseTheme$1 = /*@__PURE__*/EditorView.baseTheme({\n \".cm-panel.cm-gotoLine\": {\n padding: \"2px 6px 4px\",\n \"& label\": { fontSize: \"80%\" }\n }\n });\n\n const defaultHighlightOptions = {\n highlightWordAroundCursor: false,\n minSelectionLength: 1,\n maxMatches: 100,\n wholeWords: false\n };\n const highlightConfig = /*@__PURE__*/Facet.define({\n combine(options) {\n return combineConfig(options, defaultHighlightOptions, {\n highlightWordAroundCursor: (a, b) => a || b,\n minSelectionLength: Math.min,\n maxMatches: Math.min\n });\n }\n });\n /**\n This extension highlights text that matches the selection. It uses\n the `\"cm-selectionMatch\"` class for the highlighting. When\n `highlightWordAroundCursor` is enabled, the word at the cursor\n itself will be highlighted with `\"cm-selectionMatch-main\"`.\n */\n function highlightSelectionMatches(options) {\n let ext = [defaultTheme, matchHighlighter];\n if (options)\n ext.push(highlightConfig.of(options));\n return ext;\n }\n const matchDeco = /*@__PURE__*/Decoration.mark({ class: \"cm-selectionMatch\" });\n const mainMatchDeco = /*@__PURE__*/Decoration.mark({ class: \"cm-selectionMatch cm-selectionMatch-main\" });\n // Whether the characters directly outside the given positions are non-word characters\n function insideWordBoundaries(check, state, from, to) {\n return (from == 0 || check(state.sliceDoc(from - 1, from)) != CharCategory.Word) &&\n (to == state.doc.length || check(state.sliceDoc(to, to + 1)) != CharCategory.Word);\n }\n // Whether the characters directly at the given positions are word characters\n function insideWord(check, state, from, to) {\n return check(state.sliceDoc(from, from + 1)) == CharCategory.Word\n && check(state.sliceDoc(to - 1, to)) == CharCategory.Word;\n }\n const matchHighlighter = /*@__PURE__*/ViewPlugin.fromClass(class {\n constructor(view) {\n this.decorations = this.getDeco(view);\n }\n update(update) {\n if (update.selectionSet || update.docChanged || update.viewportChanged)\n this.decorations = this.getDeco(update.view);\n }\n getDeco(view) {\n let conf = view.state.facet(highlightConfig);\n let { state } = view, sel = state.selection;\n if (sel.ranges.length > 1)\n return Decoration.none;\n let range = sel.main, query, check = null;\n if (range.empty) {\n if (!conf.highlightWordAroundCursor)\n return Decoration.none;\n let word = state.wordAt(range.head);\n if (!word)\n return Decoration.none;\n check = state.charCategorizer(range.head);\n query = state.sliceDoc(word.from, word.to);\n }\n else {\n let len = range.to - range.from;\n if (len < conf.minSelectionLength || len > 200)\n return Decoration.none;\n if (conf.wholeWords) {\n query = state.sliceDoc(range.from, range.to); // TODO: allow and include leading/trailing space?\n check = state.charCategorizer(range.head);\n if (!(insideWordBoundaries(check, state, range.from, range.to) &&\n insideWord(check, state, range.from, range.to)))\n return Decoration.none;\n }\n else {\n query = state.sliceDoc(range.from, range.to);\n if (!query)\n return Decoration.none;\n }\n }\n let deco = [];\n for (let part of view.visibleRanges) {\n let cursor = new SearchCursor(state.doc, query, part.from, part.to);\n while (!cursor.next().done) {\n let { from, to } = cursor.value;\n if (!check || insideWordBoundaries(check, state, from, to)) {\n if (range.empty && from <= range.from && to >= range.to)\n deco.push(mainMatchDeco.range(from, to));\n else if (from >= range.to || to <= range.from)\n deco.push(matchDeco.range(from, to));\n if (deco.length > conf.maxMatches)\n return Decoration.none;\n }\n }\n }\n return Decoration.set(deco);\n }\n }, {\n decorations: v => v.decorations\n });\n const defaultTheme = /*@__PURE__*/EditorView.baseTheme({\n \".cm-selectionMatch\": { backgroundColor: \"#99ff7780\" },\n \".cm-searchMatch .cm-selectionMatch\": { backgroundColor: \"transparent\" }\n });\n // Select the words around the cursors.\n const selectWord = ({ state, dispatch }) => {\n let { selection } = state;\n let newSel = EditorSelection.create(selection.ranges.map(range => state.wordAt(range.head) || EditorSelection.cursor(range.head)), selection.mainIndex);\n if (newSel.eq(selection))\n return false;\n dispatch(state.update({ selection: newSel }));\n return true;\n };\n // Find next occurrence of query relative to last cursor. Wrap around\n // the document if there are no more matches.\n function findNextOccurrence(state, query) {\n let { main, ranges } = state.selection;\n let word = state.wordAt(main.head), fullWord = word && word.from == main.from && word.to == main.to;\n for (let cycled = false, cursor = new SearchCursor(state.doc, query, ranges[ranges.length - 1].to);;) {\n cursor.next();\n if (cursor.done) {\n if (cycled)\n return null;\n cursor = new SearchCursor(state.doc, query, 0, Math.max(0, ranges[ranges.length - 1].from - 1));\n cycled = true;\n }\n else {\n if (cycled && ranges.some(r => r.from == cursor.value.from))\n continue;\n if (fullWord) {\n let word = state.wordAt(cursor.value.from);\n if (!word || word.from != cursor.value.from || word.to != cursor.value.to)\n continue;\n }\n return cursor.value;\n }\n }\n }\n /**\n Select next occurrence of the current selection. Expand selection\n to the surrounding word when the selection is empty.\n */\n const selectNextOccurrence = ({ state, dispatch }) => {\n let { ranges } = state.selection;\n if (ranges.some(sel => sel.from === sel.to))\n return selectWord({ state, dispatch });\n let searchedText = state.sliceDoc(ranges[0].from, ranges[0].to);\n if (state.selection.ranges.some(r => state.sliceDoc(r.from, r.to) != searchedText))\n return false;\n let range = findNextOccurrence(state, searchedText);\n if (!range)\n return false;\n dispatch(state.update({\n selection: state.selection.addRange(EditorSelection.range(range.from, range.to), false),\n effects: EditorView.scrollIntoView(range.to)\n }));\n return true;\n };\n\n const searchConfigFacet = /*@__PURE__*/Facet.define({\n combine(configs) {\n return combineConfig(configs, {\n top: false,\n caseSensitive: false,\n literal: false,\n regexp: false,\n wholeWord: false,\n createPanel: view => new SearchPanel(view),\n scrollToMatch: range => EditorView.scrollIntoView(range)\n });\n }\n });\n /**\n A search query. Part of the editor's search state.\n */\n class SearchQuery {\n /**\n Create a query object.\n */\n constructor(config) {\n this.search = config.search;\n this.caseSensitive = !!config.caseSensitive;\n this.literal = !!config.literal;\n this.regexp = !!config.regexp;\n this.replace = config.replace || \"\";\n this.valid = !!this.search && (!this.regexp || validRegExp(this.search));\n this.unquoted = this.unquote(this.search);\n this.wholeWord = !!config.wholeWord;\n }\n /**\n @internal\n */\n unquote(text) {\n return this.literal ? text :\n text.replace(/\\\\([nrt\\\\])/g, (_, ch) => ch == \"n\" ? \"\\n\" : ch == \"r\" ? \"\\r\" : ch == \"t\" ? \"\\t\" : \"\\\\\");\n }\n /**\n Compare this query to another query.\n */\n eq(other) {\n return this.search == other.search && this.replace == other.replace &&\n this.caseSensitive == other.caseSensitive && this.regexp == other.regexp &&\n this.wholeWord == other.wholeWord;\n }\n /**\n @internal\n */\n create() {\n return this.regexp ? new RegExpQuery(this) : new StringQuery(this);\n }\n /**\n Get a search cursor for this query, searching through the given\n range in the given state.\n */\n getCursor(state, from = 0, to) {\n let st = state.doc ? state : EditorState.create({ doc: state });\n if (to == null)\n to = st.doc.length;\n return this.regexp ? regexpCursor(this, st, from, to) : stringCursor(this, st, from, to);\n }\n }\n class QueryType {\n constructor(spec) {\n this.spec = spec;\n }\n }\n function stringCursor(spec, state, from, to) {\n return new SearchCursor(state.doc, spec.unquoted, from, to, spec.caseSensitive ? undefined : x => x.toLowerCase(), spec.wholeWord ? stringWordTest(state.doc, state.charCategorizer(state.selection.main.head)) : undefined);\n }\n function stringWordTest(doc, categorizer) {\n return (from, to, buf, bufPos) => {\n if (bufPos > from || bufPos + buf.length < to) {\n bufPos = Math.max(0, from - 2);\n buf = doc.sliceString(bufPos, Math.min(doc.length, to + 2));\n }\n return (categorizer(charBefore(buf, from - bufPos)) != CharCategory.Word ||\n categorizer(charAfter(buf, from - bufPos)) != CharCategory.Word) &&\n (categorizer(charAfter(buf, to - bufPos)) != CharCategory.Word ||\n categorizer(charBefore(buf, to - bufPos)) != CharCategory.Word);\n };\n }\n class StringQuery extends QueryType {\n constructor(spec) {\n super(spec);\n }\n nextMatch(state, curFrom, curTo) {\n let cursor = stringCursor(this.spec, state, curTo, state.doc.length).nextOverlapping();\n if (cursor.done)\n cursor = stringCursor(this.spec, state, 0, curFrom).nextOverlapping();\n return cursor.done ? null : cursor.value;\n }\n // Searching in reverse is, rather than implementing an inverted search\n // cursor, done by scanning chunk after chunk forward.\n prevMatchInRange(state, from, to) {\n for (let pos = to;;) {\n let start = Math.max(from, pos - 10000 /* FindPrev.ChunkSize */ - this.spec.unquoted.length);\n let cursor = stringCursor(this.spec, state, start, pos), range = null;\n while (!cursor.nextOverlapping().done)\n range = cursor.value;\n if (range)\n return range;\n if (start == from)\n return null;\n pos -= 10000 /* FindPrev.ChunkSize */;\n }\n }\n prevMatch(state, curFrom, curTo) {\n return this.prevMatchInRange(state, 0, curFrom) ||\n this.prevMatchInRange(state, curTo, state.doc.length);\n }\n getReplacement(_result) { return this.spec.unquote(this.spec.replace); }\n matchAll(state, limit) {\n let cursor = stringCursor(this.spec, state, 0, state.doc.length), ranges = [];\n while (!cursor.next().done) {\n if (ranges.length >= limit)\n return null;\n ranges.push(cursor.value);\n }\n return ranges;\n }\n highlight(state, from, to, add) {\n let cursor = stringCursor(this.spec, state, Math.max(0, from - this.spec.unquoted.length), Math.min(to + this.spec.unquoted.length, state.doc.length));\n while (!cursor.next().done)\n add(cursor.value.from, cursor.value.to);\n }\n }\n function regexpCursor(spec, state, from, to) {\n return new RegExpCursor(state.doc, spec.search, {\n ignoreCase: !spec.caseSensitive,\n test: spec.wholeWord ? regexpWordTest(state.charCategorizer(state.selection.main.head)) : undefined\n }, from, to);\n }\n function charBefore(str, index) {\n return str.slice(findClusterBreak(str, index, false), index);\n }\n function charAfter(str, index) {\n return str.slice(index, findClusterBreak(str, index));\n }\n function regexpWordTest(categorizer) {\n return (_from, _to, match) => !match[0].length ||\n (categorizer(charBefore(match.input, match.index)) != CharCategory.Word ||\n categorizer(charAfter(match.input, match.index)) != CharCategory.Word) &&\n (categorizer(charAfter(match.input, match.index + match[0].length)) != CharCategory.Word ||\n categorizer(charBefore(match.input, match.index + match[0].length)) != CharCategory.Word);\n }\n class RegExpQuery extends QueryType {\n nextMatch(state, curFrom, curTo) {\n let cursor = regexpCursor(this.spec, state, curTo, state.doc.length).next();\n if (cursor.done)\n cursor = regexpCursor(this.spec, state, 0, curFrom).next();\n return cursor.done ? null : cursor.value;\n }\n prevMatchInRange(state, from, to) {\n for (let size = 1;; size++) {\n let start = Math.max(from, to - size * 10000 /* FindPrev.ChunkSize */);\n let cursor = regexpCursor(this.spec, state, start, to), range = null;\n while (!cursor.next().done)\n range = cursor.value;\n if (range && (start == from || range.from > start + 10))\n return range;\n if (start == from)\n return null;\n }\n }\n prevMatch(state, curFrom, curTo) {\n return this.prevMatchInRange(state, 0, curFrom) ||\n this.prevMatchInRange(state, curTo, state.doc.length);\n }\n getReplacement(result) {\n return this.spec.unquote(this.spec.replace).replace(/\\$([$&\\d+])/g, (m, i) => i == \"$\" ? \"$\"\n : i == \"&\" ? result.match[0]\n : i != \"0\" && +i < result.match.length ? result.match[i]\n : m);\n }\n matchAll(state, limit) {\n let cursor = regexpCursor(this.spec, state, 0, state.doc.length), ranges = [];\n while (!cursor.next().done) {\n if (ranges.length >= limit)\n return null;\n ranges.push(cursor.value);\n }\n return ranges;\n }\n highlight(state, from, to, add) {\n let cursor = regexpCursor(this.spec, state, Math.max(0, from - 250 /* RegExp.HighlightMargin */), Math.min(to + 250 /* RegExp.HighlightMargin */, state.doc.length));\n while (!cursor.next().done)\n add(cursor.value.from, cursor.value.to);\n }\n }\n /**\n A state effect that updates the current search query. Note that\n this only has an effect if the search state has been initialized\n (by including [`search`](https://codemirror.net/6/docs/ref/#search.search) in your configuration or\n by running [`openSearchPanel`](https://codemirror.net/6/docs/ref/#search.openSearchPanel) at least\n once).\n */\n const setSearchQuery = /*@__PURE__*/StateEffect.define();\n const togglePanel = /*@__PURE__*/StateEffect.define();\n const searchState = /*@__PURE__*/StateField.define({\n create(state) {\n return new SearchState(defaultQuery(state).create(), null);\n },\n update(value, tr) {\n for (let effect of tr.effects) {\n if (effect.is(setSearchQuery))\n value = new SearchState(effect.value.create(), value.panel);\n else if (effect.is(togglePanel))\n value = new SearchState(value.query, effect.value ? createSearchPanel : null);\n }\n return value;\n },\n provide: f => showPanel.from(f, val => val.panel)\n });\n class SearchState {\n constructor(query, panel) {\n this.query = query;\n this.panel = panel;\n }\n }\n const matchMark = /*@__PURE__*/Decoration.mark({ class: \"cm-searchMatch\" }), selectedMatchMark = /*@__PURE__*/Decoration.mark({ class: \"cm-searchMatch cm-searchMatch-selected\" });\n const searchHighlighter = /*@__PURE__*/ViewPlugin.fromClass(class {\n constructor(view) {\n this.view = view;\n this.decorations = this.highlight(view.state.field(searchState));\n }\n update(update) {\n let state = update.state.field(searchState);\n if (state != update.startState.field(searchState) || update.docChanged || update.selectionSet || update.viewportChanged)\n this.decorations = this.highlight(state);\n }\n highlight({ query, panel }) {\n if (!panel || !query.spec.valid)\n return Decoration.none;\n let { view } = this;\n let builder = new RangeSetBuilder();\n for (let i = 0, ranges = view.visibleRanges, l = ranges.length; i < l; i++) {\n let { from, to } = ranges[i];\n while (i < l - 1 && to > ranges[i + 1].from - 2 * 250 /* RegExp.HighlightMargin */)\n to = ranges[++i].to;\n query.highlight(view.state, from, to, (from, to) => {\n let selected = view.state.selection.ranges.some(r => r.from == from && r.to == to);\n builder.add(from, to, selected ? selectedMatchMark : matchMark);\n });\n }\n return builder.finish();\n }\n }, {\n decorations: v => v.decorations\n });\n function searchCommand(f) {\n return view => {\n let state = view.state.field(searchState, false);\n return state && state.query.spec.valid ? f(view, state) : openSearchPanel(view);\n };\n }\n /**\n Open the search panel if it isn't already open, and move the\n selection to the first match after the current main selection.\n Will wrap around to the start of the document when it reaches the\n end.\n */\n const findNext = /*@__PURE__*/searchCommand((view, { query }) => {\n let { to } = view.state.selection.main;\n let next = query.nextMatch(view.state, to, to);\n if (!next)\n return false;\n let selection = EditorSelection.single(next.from, next.to);\n let config = view.state.facet(searchConfigFacet);\n view.dispatch({\n selection,\n effects: [announceMatch(view, next), config.scrollToMatch(selection.main, view)],\n userEvent: \"select.search\"\n });\n selectSearchInput(view);\n return true;\n });\n /**\n Move the selection to the previous instance of the search query,\n before the current main selection. Will wrap past the start\n of the document to start searching at the end again.\n */\n const findPrevious = /*@__PURE__*/searchCommand((view, { query }) => {\n let { state } = view, { from } = state.selection.main;\n let prev = query.prevMatch(state, from, from);\n if (!prev)\n return false;\n let selection = EditorSelection.single(prev.from, prev.to);\n let config = view.state.facet(searchConfigFacet);\n view.dispatch({\n selection,\n effects: [announceMatch(view, prev), config.scrollToMatch(selection.main, view)],\n userEvent: \"select.search\"\n });\n selectSearchInput(view);\n return true;\n });\n /**\n Select all instances of the search query.\n */\n const selectMatches = /*@__PURE__*/searchCommand((view, { query }) => {\n let ranges = query.matchAll(view.state, 1000);\n if (!ranges || !ranges.length)\n return false;\n view.dispatch({\n selection: EditorSelection.create(ranges.map(r => EditorSelection.range(r.from, r.to))),\n userEvent: \"select.search.matches\"\n });\n return true;\n });\n /**\n Select all instances of the currently selected text.\n */\n const selectSelectionMatches = ({ state, dispatch }) => {\n let sel = state.selection;\n if (sel.ranges.length > 1 || sel.main.empty)\n return false;\n let { from, to } = sel.main;\n let ranges = [], main = 0;\n for (let cur = new SearchCursor(state.doc, state.sliceDoc(from, to)); !cur.next().done;) {\n if (ranges.length > 1000)\n return false;\n if (cur.value.from == from)\n main = ranges.length;\n ranges.push(EditorSelection.range(cur.value.from, cur.value.to));\n }\n dispatch(state.update({\n selection: EditorSelection.create(ranges, main),\n userEvent: \"select.search.matches\"\n }));\n return true;\n };\n /**\n Replace the current match of the search query.\n */\n const replaceNext = /*@__PURE__*/searchCommand((view, { query }) => {\n let { state } = view, { from, to } = state.selection.main;\n if (state.readOnly)\n return false;\n let next = query.nextMatch(state, from, from);\n if (!next)\n return false;\n let changes = [], selection, replacement;\n let effects = [];\n if (next.from == from && next.to == to) {\n replacement = state.toText(query.getReplacement(next));\n changes.push({ from: next.from, to: next.to, insert: replacement });\n next = query.nextMatch(state, next.from, next.to);\n effects.push(EditorView.announce.of(state.phrase(\"replaced match on line $\", state.doc.lineAt(from).number) + \".\"));\n }\n if (next) {\n let off = changes.length == 0 || changes[0].from >= next.to ? 0 : next.to - next.from - replacement.length;\n selection = EditorSelection.single(next.from - off, next.to - off);\n effects.push(announceMatch(view, next));\n effects.push(state.facet(searchConfigFacet).scrollToMatch(selection.main, view));\n }\n view.dispatch({\n changes, selection, effects,\n userEvent: \"input.replace\"\n });\n return true;\n });\n /**\n Replace all instances of the search query with the given\n replacement.\n */\n const replaceAll = /*@__PURE__*/searchCommand((view, { query }) => {\n if (view.state.readOnly)\n return false;\n let changes = query.matchAll(view.state, 1e9).map(match => {\n let { from, to } = match;\n return { from, to, insert: query.getReplacement(match) };\n });\n if (!changes.length)\n return false;\n let announceText = view.state.phrase(\"replaced $ matches\", changes.length) + \".\";\n view.dispatch({\n changes,\n effects: EditorView.announce.of(announceText),\n userEvent: \"input.replace.all\"\n });\n return true;\n });\n function createSearchPanel(view) {\n return view.state.facet(searchConfigFacet).createPanel(view);\n }\n function defaultQuery(state, fallback) {\n var _a, _b, _c, _d, _e;\n let sel = state.selection.main;\n let selText = sel.empty || sel.to > sel.from + 100 ? \"\" : state.sliceDoc(sel.from, sel.to);\n if (fallback && !selText)\n return fallback;\n let config = state.facet(searchConfigFacet);\n return new SearchQuery({\n search: ((_a = fallback === null || fallback === void 0 ? void 0 : fallback.literal) !== null && _a !== void 0 ? _a : config.literal) ? selText : selText.replace(/\\n/g, \"\\\\n\"),\n caseSensitive: (_b = fallback === null || fallback === void 0 ? void 0 : fallback.caseSensitive) !== null && _b !== void 0 ? _b : config.caseSensitive,\n literal: (_c = fallback === null || fallback === void 0 ? void 0 : fallback.literal) !== null && _c !== void 0 ? _c : config.literal,\n regexp: (_d = fallback === null || fallback === void 0 ? void 0 : fallback.regexp) !== null && _d !== void 0 ? _d : config.regexp,\n wholeWord: (_e = fallback === null || fallback === void 0 ? void 0 : fallback.wholeWord) !== null && _e !== void 0 ? _e : config.wholeWord\n });\n }\n function getSearchInput(view) {\n let panel = getPanel(view, createSearchPanel);\n return panel && panel.dom.querySelector(\"[main-field]\");\n }\n function selectSearchInput(view) {\n let input = getSearchInput(view);\n if (input && input == view.root.activeElement)\n input.select();\n }\n /**\n Make sure the search panel is open and focused.\n */\n const openSearchPanel = view => {\n let state = view.state.field(searchState, false);\n if (state && state.panel) {\n let searchInput = getSearchInput(view);\n if (searchInput && searchInput != view.root.activeElement) {\n let query = defaultQuery(view.state, state.query.spec);\n if (query.valid)\n view.dispatch({ effects: setSearchQuery.of(query) });\n searchInput.focus();\n searchInput.select();\n }\n }\n else {\n view.dispatch({ effects: [\n togglePanel.of(true),\n state ? setSearchQuery.of(defaultQuery(view.state, state.query.spec)) : StateEffect.appendConfig.of(searchExtensions)\n ] });\n }\n return true;\n };\n /**\n Close the search panel.\n */\n const closeSearchPanel = view => {\n let state = view.state.field(searchState, false);\n if (!state || !state.panel)\n return false;\n let panel = getPanel(view, createSearchPanel);\n if (panel && panel.dom.contains(view.root.activeElement))\n view.focus();\n view.dispatch({ effects: togglePanel.of(false) });\n return true;\n };\n /**\n Default search-related key bindings.\n\n - Mod-f: [`openSearchPanel`](https://codemirror.net/6/docs/ref/#search.openSearchPanel)\n - F3, Mod-g: [`findNext`](https://codemirror.net/6/docs/ref/#search.findNext)\n - Shift-F3, Shift-Mod-g: [`findPrevious`](https://codemirror.net/6/docs/ref/#search.findPrevious)\n - Mod-Alt-g: [`gotoLine`](https://codemirror.net/6/docs/ref/#search.gotoLine)\n - Mod-d: [`selectNextOccurrence`](https://codemirror.net/6/docs/ref/#search.selectNextOccurrence)\n */\n const searchKeymap = [\n { key: \"Mod-f\", run: openSearchPanel, scope: \"editor search-panel\" },\n { key: \"F3\", run: findNext, shift: findPrevious, scope: \"editor search-panel\", preventDefault: true },\n { key: \"Mod-g\", run: findNext, shift: findPrevious, scope: \"editor search-panel\", preventDefault: true },\n { key: \"Escape\", run: closeSearchPanel, scope: \"editor search-panel\" },\n { key: \"Mod-Shift-l\", run: selectSelectionMatches },\n { key: \"Mod-Alt-g\", run: gotoLine },\n { key: \"Mod-d\", run: selectNextOccurrence, preventDefault: true },\n ];\n class SearchPanel {\n constructor(view) {\n this.view = view;\n let query = this.query = view.state.field(searchState).query.spec;\n this.commit = this.commit.bind(this);\n this.searchField = crelt(\"input\", {\n value: query.search,\n placeholder: phrase(view, \"Find\"),\n \"aria-label\": phrase(view, \"Find\"),\n class: \"cm-textfield\",\n name: \"search\",\n form: \"\",\n \"main-field\": \"true\",\n onchange: this.commit,\n onkeyup: this.commit\n });\n this.replaceField = crelt(\"input\", {\n value: query.replace,\n placeholder: phrase(view, \"Replace\"),\n \"aria-label\": phrase(view, \"Replace\"),\n class: \"cm-textfield\",\n name: \"replace\",\n form: \"\",\n onchange: this.commit,\n onkeyup: this.commit\n });\n this.caseField = crelt(\"input\", {\n type: \"checkbox\",\n name: \"case\",\n form: \"\",\n checked: query.caseSensitive,\n onchange: this.commit\n });\n this.reField = crelt(\"input\", {\n type: \"checkbox\",\n name: \"re\",\n form: \"\",\n checked: query.regexp,\n onchange: this.commit\n });\n this.wordField = crelt(\"input\", {\n type: \"checkbox\",\n name: \"word\",\n form: \"\",\n checked: query.wholeWord,\n onchange: this.commit\n });\n function button(name, onclick, content) {\n return crelt(\"button\", { class: \"cm-button\", name, onclick, type: \"button\" }, content);\n }\n this.dom = crelt(\"div\", { onkeydown: (e) => this.keydown(e), class: \"cm-search\" }, [\n this.searchField,\n button(\"next\", () => findNext(view), [phrase(view, \"next\")]),\n button(\"prev\", () => findPrevious(view), [phrase(view, \"previous\")]),\n button(\"select\", () => selectMatches(view), [phrase(view, \"all\")]),\n crelt(\"label\", null, [this.caseField, phrase(view, \"match case\")]),\n crelt(\"label\", null, [this.reField, phrase(view, \"regexp\")]),\n crelt(\"label\", null, [this.wordField, phrase(view, \"by word\")]),\n ...view.state.readOnly ? [] : [\n crelt(\"br\"),\n this.replaceField,\n button(\"replace\", () => replaceNext(view), [phrase(view, \"replace\")]),\n button(\"replaceAll\", () => replaceAll(view), [phrase(view, \"replace all\")])\n ],\n crelt(\"button\", {\n name: \"close\",\n onclick: () => closeSearchPanel(view),\n \"aria-label\": phrase(view, \"close\"),\n type: \"button\"\n }, [\"\u00D7\"])\n ]);\n }\n commit() {\n let query = new SearchQuery({\n search: this.searchField.value,\n caseSensitive: this.caseField.checked,\n regexp: this.reField.checked,\n wholeWord: this.wordField.checked,\n replace: this.replaceField.value,\n });\n if (!query.eq(this.query)) {\n this.query = query;\n this.view.dispatch({ effects: setSearchQuery.of(query) });\n }\n }\n keydown(e) {\n if (runScopeHandlers(this.view, e, \"search-panel\")) {\n e.preventDefault();\n }\n else if (e.keyCode == 13 && e.target == this.searchField) {\n e.preventDefault();\n (e.shiftKey ? findPrevious : findNext)(this.view);\n }\n else if (e.keyCode == 13 && e.target == this.replaceField) {\n e.preventDefault();\n replaceNext(this.view);\n }\n }\n update(update) {\n for (let tr of update.transactions)\n for (let effect of tr.effects) {\n if (effect.is(setSearchQuery) && !effect.value.eq(this.query))\n this.setQuery(effect.value);\n }\n }\n setQuery(query) {\n this.query = query;\n this.searchField.value = query.search;\n this.replaceField.value = query.replace;\n this.caseField.checked = query.caseSensitive;\n this.reField.checked = query.regexp;\n this.wordField.checked = query.wholeWord;\n }\n mount() {\n this.searchField.select();\n }\n get pos() { return 80; }\n get top() { return this.view.state.facet(searchConfigFacet).top; }\n }\n function phrase(view, phrase) { return view.state.phrase(phrase); }\n const AnnounceMargin = 30;\n const Break = /[\\s\\.,:;?!]/;\n function announceMatch(view, { from, to }) {\n let line = view.state.doc.lineAt(from), lineEnd = view.state.doc.lineAt(to).to;\n let start = Math.max(line.from, from - AnnounceMargin), end = Math.min(lineEnd, to + AnnounceMargin);\n let text = view.state.sliceDoc(start, end);\n if (start != line.from) {\n for (let i = 0; i < AnnounceMargin; i++)\n if (!Break.test(text[i + 1]) && Break.test(text[i])) {\n text = text.slice(i);\n break;\n }\n }\n if (end != lineEnd) {\n for (let i = text.length - 1; i > text.length - AnnounceMargin; i--)\n if (!Break.test(text[i - 1]) && Break.test(text[i])) {\n text = text.slice(0, i);\n break;\n }\n }\n return EditorView.announce.of(`${view.state.phrase(\"current match\")}. ${text} ${view.state.phrase(\"on line\")} ${line.number}.`);\n }\n const baseTheme$2 = /*@__PURE__*/EditorView.baseTheme({\n \".cm-panel.cm-search\": {\n padding: \"2px 6px 4px\",\n position: \"relative\",\n \"& [name=close]\": {\n position: \"absolute\",\n top: \"0\",\n right: \"4px\",\n backgroundColor: \"inherit\",\n border: \"none\",\n font: \"inherit\",\n padding: 0,\n margin: 0\n },\n \"& input, & button, & label\": {\n margin: \".2em .6em .2em 0\"\n },\n \"& input[type=checkbox]\": {\n marginRight: \".2em\"\n },\n \"& label\": {\n fontSize: \"80%\",\n whiteSpace: \"pre\"\n }\n },\n \"&light .cm-searchMatch\": { backgroundColor: \"#ffff0054\" },\n \"&dark .cm-searchMatch\": { backgroundColor: \"#00ffff8a\" },\n \"&light .cm-searchMatch-selected\": { backgroundColor: \"#ff6a0054\" },\n \"&dark .cm-searchMatch-selected\": { backgroundColor: \"#ff00ff8a\" }\n });\n const searchExtensions = [\n searchState,\n /*@__PURE__*/Prec.low(searchHighlighter),\n baseTheme$2\n ];\n\n /**\n An instance of this is passed to completion source functions.\n */\n class CompletionContext {\n /**\n Create a new completion context. (Mostly useful for testing\n completion sources\u2014in the editor, the extension will create\n these for you.)\n */\n constructor(\n /**\n The editor state that the completion happens in.\n */\n state, \n /**\n The position at which the completion is happening.\n */\n pos, \n /**\n Indicates whether completion was activated explicitly, or\n implicitly by typing. The usual way to respond to this is to\n only return completions when either there is part of a\n completable entity before the cursor, or `explicit` is true.\n */\n explicit, \n /**\n The editor view. May be undefined if the context was created\n in a situation where there is no such view available, such as\n in synchronous updates via\n [`CompletionResult.update`](https://codemirror.net/6/docs/ref/#autocomplete.CompletionResult.update)\n or when called by test code.\n */\n view) {\n this.state = state;\n this.pos = pos;\n this.explicit = explicit;\n this.view = view;\n /**\n @internal\n */\n this.abortListeners = [];\n }\n /**\n Get the extent, content, and (if there is a token) type of the\n token before `this.pos`.\n */\n tokenBefore(types) {\n let token = syntaxTree(this.state).resolveInner(this.pos, -1);\n while (token && types.indexOf(token.name) < 0)\n token = token.parent;\n return token ? { from: token.from, to: this.pos,\n text: this.state.sliceDoc(token.from, this.pos),\n type: token.type } : null;\n }\n /**\n Get the match of the given expression directly before the\n cursor.\n */\n matchBefore(expr) {\n let line = this.state.doc.lineAt(this.pos);\n let start = Math.max(line.from, this.pos - 250);\n let str = line.text.slice(start - line.from, this.pos - line.from);\n let found = str.search(ensureAnchor(expr, false));\n return found < 0 ? null : { from: start + found, to: this.pos, text: str.slice(found) };\n }\n /**\n Yields true when the query has been aborted. Can be useful in\n asynchronous queries to avoid doing work that will be ignored.\n */\n get aborted() { return this.abortListeners == null; }\n /**\n Allows you to register abort handlers, which will be called when\n the query is\n [aborted](https://codemirror.net/6/docs/ref/#autocomplete.CompletionContext.aborted).\n */\n addEventListener(type, listener) {\n if (type == \"abort\" && this.abortListeners)\n this.abortListeners.push(listener);\n }\n }\n function toSet(chars) {\n let flat = Object.keys(chars).join(\"\");\n let words = /\\w/.test(flat);\n if (words)\n flat = flat.replace(/\\w/g, \"\");\n return `[${words ? \"\\\\w\" : \"\"}${flat.replace(/[^\\w\\s]/g, \"\\\\$&\")}]`;\n }\n function prefixMatch(options) {\n let first = Object.create(null), rest = Object.create(null);\n for (let { label } of options) {\n first[label[0]] = true;\n for (let i = 1; i < label.length; i++)\n rest[label[i]] = true;\n }\n let source = toSet(first) + toSet(rest) + \"*$\";\n return [new RegExp(\"^\" + source), new RegExp(source)];\n }\n /**\n Given a a fixed array of options, return an autocompleter that\n completes them.\n */\n function completeFromList(list) {\n let options = list.map(o => typeof o == \"string\" ? { label: o } : o);\n let [validFor, match] = options.every(o => /^\\w+$/.test(o.label)) ? [/\\w*$/, /\\w+$/] : prefixMatch(options);\n return (context) => {\n let token = context.matchBefore(match);\n return token || context.explicit ? { from: token ? token.from : context.pos, options, validFor } : null;\n };\n }\n /**\n Wrap the given completion source so that it will not fire when the\n cursor is in a syntax node with one of the given names.\n */\n function ifNotIn(nodes, source) {\n return (context) => {\n for (let pos = syntaxTree(context.state).resolveInner(context.pos, -1); pos; pos = pos.parent) {\n if (nodes.indexOf(pos.name) > -1)\n return null;\n if (pos.type.isTop)\n break;\n }\n return source(context);\n };\n }\n class Option {\n constructor(completion, source, match, score) {\n this.completion = completion;\n this.source = source;\n this.match = match;\n this.score = score;\n }\n }\n function cur(state) { return state.selection.main.from; }\n // Make sure the given regexp has a $ at its end and, if `start` is\n // true, a ^ at its start.\n function ensureAnchor(expr, start) {\n var _a;\n let { source } = expr;\n let addStart = start && source[0] != \"^\", addEnd = source[source.length - 1] != \"$\";\n if (!addStart && !addEnd)\n return expr;\n return new RegExp(`${addStart ? \"^\" : \"\"}(?:${source})${addEnd ? \"$\" : \"\"}`, (_a = expr.flags) !== null && _a !== void 0 ? _a : (expr.ignoreCase ? \"i\" : \"\"));\n }\n /**\n This annotation is added to transactions that are produced by\n picking a completion.\n */\n const pickedCompletion = /*@__PURE__*/Annotation.define();\n /**\n Helper function that returns a transaction spec which inserts a\n completion's text in the main selection range, and any other\n selection range that has the same text in front of it.\n */\n function insertCompletionText(state, text, from, to) {\n let { main } = state.selection, fromOff = from - main.from, toOff = to - main.from;\n return Object.assign(Object.assign({}, state.changeByRange(range => {\n if (range != main && from != to &&\n state.sliceDoc(range.from + fromOff, range.from + toOff) != state.sliceDoc(from, to))\n return { range };\n return {\n changes: { from: range.from + fromOff, to: to == main.from ? range.to : range.from + toOff, insert: text },\n range: EditorSelection.cursor(range.from + fromOff + text.length)\n };\n })), { scrollIntoView: true, userEvent: \"input.complete\" });\n }\n const SourceCache = /*@__PURE__*/new WeakMap();\n function asSource(source) {\n if (!Array.isArray(source))\n return source;\n let known = SourceCache.get(source);\n if (!known)\n SourceCache.set(source, known = completeFromList(source));\n return known;\n }\n const startCompletionEffect = /*@__PURE__*/StateEffect.define();\n const closeCompletionEffect = /*@__PURE__*/StateEffect.define();\n\n // A pattern matcher for fuzzy completion matching. Create an instance\n // once for a pattern, and then use that to match any number of\n // completions.\n class FuzzyMatcher {\n constructor(pattern) {\n this.pattern = pattern;\n this.chars = [];\n this.folded = [];\n // Buffers reused by calls to `match` to track matched character\n // positions.\n this.any = [];\n this.precise = [];\n this.byWord = [];\n this.score = 0;\n this.matched = [];\n for (let p = 0; p < pattern.length;) {\n let char = codePointAt(pattern, p), size = codePointSize(char);\n this.chars.push(char);\n let part = pattern.slice(p, p + size), upper = part.toUpperCase();\n this.folded.push(codePointAt(upper == part ? part.toLowerCase() : upper, 0));\n p += size;\n }\n this.astral = pattern.length != this.chars.length;\n }\n ret(score, matched) {\n this.score = score;\n this.matched = matched;\n return this;\n }\n // Matches a given word (completion) against the pattern (input).\n // Will return a boolean indicating whether there was a match and,\n // on success, set `this.score` to the score, `this.matched` to an\n // array of `from, to` pairs indicating the matched parts of `word`.\n //\n // The score is a number that is more negative the worse the match\n // is. See `Penalty` above.\n match(word) {\n if (this.pattern.length == 0)\n return this.ret(-100 /* Penalty.NotFull */, []);\n if (word.length < this.pattern.length)\n return null;\n let { chars, folded, any, precise, byWord } = this;\n // For single-character queries, only match when they occur right\n // at the start\n if (chars.length == 1) {\n let first = codePointAt(word, 0), firstSize = codePointSize(first);\n let score = firstSize == word.length ? 0 : -100 /* Penalty.NotFull */;\n if (first == chars[0]) ;\n else if (first == folded[0])\n score += -200 /* Penalty.CaseFold */;\n else\n return null;\n return this.ret(score, [0, firstSize]);\n }\n let direct = word.indexOf(this.pattern);\n if (direct == 0)\n return this.ret(word.length == this.pattern.length ? 0 : -100 /* Penalty.NotFull */, [0, this.pattern.length]);\n let len = chars.length, anyTo = 0;\n if (direct < 0) {\n for (let i = 0, e = Math.min(word.length, 200); i < e && anyTo < len;) {\n let next = codePointAt(word, i);\n if (next == chars[anyTo] || next == folded[anyTo])\n any[anyTo++] = i;\n i += codePointSize(next);\n }\n // No match, exit immediately\n if (anyTo < len)\n return null;\n }\n // This tracks the extent of the precise (non-folded, not\n // necessarily adjacent) match\n let preciseTo = 0;\n // Tracks whether there is a match that hits only characters that\n // appear to be starting words. `byWordFolded` is set to true when\n // a case folded character is encountered in such a match\n let byWordTo = 0, byWordFolded = false;\n // If we've found a partial adjacent match, these track its state\n let adjacentTo = 0, adjacentStart = -1, adjacentEnd = -1;\n let hasLower = /[a-z]/.test(word), wordAdjacent = true;\n // Go over the option's text, scanning for the various kinds of matches\n for (let i = 0, e = Math.min(word.length, 200), prevType = 0 /* Tp.NonWord */; i < e && byWordTo < len;) {\n let next = codePointAt(word, i);\n if (direct < 0) {\n if (preciseTo < len && next == chars[preciseTo])\n precise[preciseTo++] = i;\n if (adjacentTo < len) {\n if (next == chars[adjacentTo] || next == folded[adjacentTo]) {\n if (adjacentTo == 0)\n adjacentStart = i;\n adjacentEnd = i + 1;\n adjacentTo++;\n }\n else {\n adjacentTo = 0;\n }\n }\n }\n let ch, type = next < 0xff\n ? (next >= 48 && next <= 57 || next >= 97 && next <= 122 ? 2 /* Tp.Lower */ : next >= 65 && next <= 90 ? 1 /* Tp.Upper */ : 0 /* Tp.NonWord */)\n : ((ch = fromCodePoint(next)) != ch.toLowerCase() ? 1 /* Tp.Upper */ : ch != ch.toUpperCase() ? 2 /* Tp.Lower */ : 0 /* Tp.NonWord */);\n if (!i || type == 1 /* Tp.Upper */ && hasLower || prevType == 0 /* Tp.NonWord */ && type != 0 /* Tp.NonWord */) {\n if (chars[byWordTo] == next || (folded[byWordTo] == next && (byWordFolded = true)))\n byWord[byWordTo++] = i;\n else if (byWord.length)\n wordAdjacent = false;\n }\n prevType = type;\n i += codePointSize(next);\n }\n if (byWordTo == len && byWord[0] == 0 && wordAdjacent)\n return this.result(-100 /* Penalty.ByWord */ + (byWordFolded ? -200 /* Penalty.CaseFold */ : 0), byWord, word);\n if (adjacentTo == len && adjacentStart == 0)\n return this.ret(-200 /* Penalty.CaseFold */ - word.length + (adjacentEnd == word.length ? 0 : -100 /* Penalty.NotFull */), [0, adjacentEnd]);\n if (direct > -1)\n return this.ret(-700 /* Penalty.NotStart */ - word.length, [direct, direct + this.pattern.length]);\n if (adjacentTo == len)\n return this.ret(-200 /* Penalty.CaseFold */ + -700 /* Penalty.NotStart */ - word.length, [adjacentStart, adjacentEnd]);\n if (byWordTo == len)\n return this.result(-100 /* Penalty.ByWord */ + (byWordFolded ? -200 /* Penalty.CaseFold */ : 0) + -700 /* Penalty.NotStart */ +\n (wordAdjacent ? 0 : -1100 /* Penalty.Gap */), byWord, word);\n return chars.length == 2 ? null\n : this.result((any[0] ? -700 /* Penalty.NotStart */ : 0) + -200 /* Penalty.CaseFold */ + -1100 /* Penalty.Gap */, any, word);\n }\n result(score, positions, word) {\n let result = [], i = 0;\n for (let pos of positions) {\n let to = pos + (this.astral ? codePointSize(codePointAt(word, pos)) : 1);\n if (i && result[i - 1] == pos)\n result[i - 1] = to;\n else {\n result[i++] = pos;\n result[i++] = to;\n }\n }\n return this.ret(score - word.length, result);\n }\n }\n class StrictMatcher {\n constructor(pattern) {\n this.pattern = pattern;\n this.matched = [];\n this.score = 0;\n this.folded = pattern.toLowerCase();\n }\n match(word) {\n if (word.length < this.pattern.length)\n return null;\n let start = word.slice(0, this.pattern.length);\n let match = start == this.pattern ? 0 : start.toLowerCase() == this.folded ? -200 /* Penalty.CaseFold */ : null;\n if (match == null)\n return null;\n this.matched = [0, start.length];\n this.score = match + (word.length == this.pattern.length ? 0 : -100 /* Penalty.NotFull */);\n return this;\n }\n }\n\n const completionConfig = /*@__PURE__*/Facet.define({\n combine(configs) {\n return combineConfig(configs, {\n activateOnTyping: true,\n activateOnCompletion: () => false,\n activateOnTypingDelay: 100,\n selectOnOpen: true,\n override: null,\n closeOnBlur: true,\n maxRenderedOptions: 100,\n defaultKeymap: true,\n tooltipClass: () => \"\",\n optionClass: () => \"\",\n aboveCursor: false,\n icons: true,\n addToOptions: [],\n positionInfo: defaultPositionInfo,\n filterStrict: false,\n compareCompletions: (a, b) => a.label.localeCompare(b.label),\n interactionDelay: 75,\n updateSyncTime: 100\n }, {\n defaultKeymap: (a, b) => a && b,\n closeOnBlur: (a, b) => a && b,\n icons: (a, b) => a && b,\n tooltipClass: (a, b) => c => joinClass(a(c), b(c)),\n optionClass: (a, b) => c => joinClass(a(c), b(c)),\n addToOptions: (a, b) => a.concat(b),\n filterStrict: (a, b) => a || b,\n });\n }\n });\n function joinClass(a, b) {\n return a ? b ? a + \" \" + b : a : b;\n }\n function defaultPositionInfo(view, list, option, info, space, tooltip) {\n let rtl = view.textDirection == Direction.RTL, left = rtl, narrow = false;\n let side = \"top\", offset, maxWidth;\n let spaceLeft = list.left - space.left, spaceRight = space.right - list.right;\n let infoWidth = info.right - info.left, infoHeight = info.bottom - info.top;\n if (left && spaceLeft < Math.min(infoWidth, spaceRight))\n left = false;\n else if (!left && spaceRight < Math.min(infoWidth, spaceLeft))\n left = true;\n if (infoWidth <= (left ? spaceLeft : spaceRight)) {\n offset = Math.max(space.top, Math.min(option.top, space.bottom - infoHeight)) - list.top;\n maxWidth = Math.min(400 /* Info.Width */, left ? spaceLeft : spaceRight);\n }\n else {\n narrow = true;\n maxWidth = Math.min(400 /* Info.Width */, (rtl ? list.right : space.right - list.left) - 30 /* Info.Margin */);\n let spaceBelow = space.bottom - list.bottom;\n if (spaceBelow >= infoHeight || spaceBelow > list.top) { // Below the completion\n offset = option.bottom - list.top;\n }\n else { // Above it\n side = \"bottom\";\n offset = list.bottom - option.top;\n }\n }\n let scaleY = (list.bottom - list.top) / tooltip.offsetHeight;\n let scaleX = (list.right - list.left) / tooltip.offsetWidth;\n return {\n style: `${side}: ${offset / scaleY}px; max-width: ${maxWidth / scaleX}px`,\n class: \"cm-completionInfo-\" + (narrow ? (rtl ? \"left-narrow\" : \"right-narrow\") : left ? \"left\" : \"right\")\n };\n }\n\n function optionContent(config) {\n let content = config.addToOptions.slice();\n if (config.icons)\n content.push({\n render(completion) {\n let icon = document.createElement(\"div\");\n icon.classList.add(\"cm-completionIcon\");\n if (completion.type)\n icon.classList.add(...completion.type.split(/\\s+/g).map(cls => \"cm-completionIcon-\" + cls));\n icon.setAttribute(\"aria-hidden\", \"true\");\n return icon;\n },\n position: 20\n });\n content.push({\n render(completion, _s, _v, match) {\n let labelElt = document.createElement(\"span\");\n labelElt.className = \"cm-completionLabel\";\n let label = completion.displayLabel || completion.label, off = 0;\n for (let j = 0; j < match.length;) {\n let from = match[j++], to = match[j++];\n if (from > off)\n labelElt.appendChild(document.createTextNode(label.slice(off, from)));\n let span = labelElt.appendChild(document.createElement(\"span\"));\n span.appendChild(document.createTextNode(label.slice(from, to)));\n span.className = \"cm-completionMatchedText\";\n off = to;\n }\n if (off < label.length)\n labelElt.appendChild(document.createTextNode(label.slice(off)));\n return labelElt;\n },\n position: 50\n }, {\n render(completion) {\n if (!completion.detail)\n return null;\n let detailElt = document.createElement(\"span\");\n detailElt.className = \"cm-completionDetail\";\n detailElt.textContent = completion.detail;\n return detailElt;\n },\n position: 80\n });\n return content.sort((a, b) => a.position - b.position).map(a => a.render);\n }\n function rangeAroundSelected(total, selected, max) {\n if (total <= max)\n return { from: 0, to: total };\n if (selected < 0)\n selected = 0;\n if (selected <= (total >> 1)) {\n let off = Math.floor(selected / max);\n return { from: off * max, to: (off + 1) * max };\n }\n let off = Math.floor((total - selected) / max);\n return { from: total - (off + 1) * max, to: total - off * max };\n }\n class CompletionTooltip {\n constructor(view, stateField, applyCompletion) {\n this.view = view;\n this.stateField = stateField;\n this.applyCompletion = applyCompletion;\n this.info = null;\n this.infoDestroy = null;\n this.placeInfoReq = {\n read: () => this.measureInfo(),\n write: (pos) => this.placeInfo(pos),\n key: this\n };\n this.space = null;\n this.currentClass = \"\";\n let cState = view.state.field(stateField);\n let { options, selected } = cState.open;\n let config = view.state.facet(completionConfig);\n this.optionContent = optionContent(config);\n this.optionClass = config.optionClass;\n this.tooltipClass = config.tooltipClass;\n this.range = rangeAroundSelected(options.length, selected, config.maxRenderedOptions);\n this.dom = document.createElement(\"div\");\n this.dom.className = \"cm-tooltip-autocomplete\";\n this.updateTooltipClass(view.state);\n this.dom.addEventListener(\"mousedown\", (e) => {\n let { options } = view.state.field(stateField).open;\n for (let dom = e.target, match; dom && dom != this.dom; dom = dom.parentNode) {\n if (dom.nodeName == \"LI\" && (match = /-(\\d+)$/.exec(dom.id)) && +match[1] < options.length) {\n this.applyCompletion(view, options[+match[1]]);\n e.preventDefault();\n return;\n }\n }\n });\n this.dom.addEventListener(\"focusout\", (e) => {\n let state = view.state.field(this.stateField, false);\n if (state && state.tooltip && view.state.facet(completionConfig).closeOnBlur &&\n e.relatedTarget != view.contentDOM)\n view.dispatch({ effects: closeCompletionEffect.of(null) });\n });\n this.showOptions(options, cState.id);\n }\n mount() { this.updateSel(); }\n showOptions(options, id) {\n if (this.list)\n this.list.remove();\n this.list = this.dom.appendChild(this.createListBox(options, id, this.range));\n this.list.addEventListener(\"scroll\", () => {\n if (this.info)\n this.view.requestMeasure(this.placeInfoReq);\n });\n }\n update(update) {\n var _a;\n let cState = update.state.field(this.stateField);\n let prevState = update.startState.field(this.stateField);\n this.updateTooltipClass(update.state);\n if (cState != prevState) {\n let { options, selected, disabled } = cState.open;\n if (!prevState.open || prevState.open.options != options) {\n this.range = rangeAroundSelected(options.length, selected, update.state.facet(completionConfig).maxRenderedOptions);\n this.showOptions(options, cState.id);\n }\n this.updateSel();\n if (disabled != ((_a = prevState.open) === null || _a === void 0 ? void 0 : _a.disabled))\n this.dom.classList.toggle(\"cm-tooltip-autocomplete-disabled\", !!disabled);\n }\n }\n updateTooltipClass(state) {\n let cls = this.tooltipClass(state);\n if (cls != this.currentClass) {\n for (let c of this.currentClass.split(\" \"))\n if (c)\n this.dom.classList.remove(c);\n for (let c of cls.split(\" \"))\n if (c)\n this.dom.classList.add(c);\n this.currentClass = cls;\n }\n }\n positioned(space) {\n this.space = space;\n if (this.info)\n this.view.requestMeasure(this.placeInfoReq);\n }\n updateSel() {\n let cState = this.view.state.field(this.stateField), open = cState.open;\n if (open.selected > -1 && open.selected < this.range.from || open.selected >= this.range.to) {\n this.range = rangeAroundSelected(open.options.length, open.selected, this.view.state.facet(completionConfig).maxRenderedOptions);\n this.showOptions(open.options, cState.id);\n }\n if (this.updateSelectedOption(open.selected)) {\n this.destroyInfo();\n let { completion } = open.options[open.selected];\n let { info } = completion;\n if (!info)\n return;\n let infoResult = typeof info === \"string\" ? document.createTextNode(info) : info(completion);\n if (!infoResult)\n return;\n if (\"then\" in infoResult) {\n infoResult.then(obj => {\n if (obj && this.view.state.field(this.stateField, false) == cState)\n this.addInfoPane(obj, completion);\n }).catch(e => logException(this.view.state, e, \"completion info\"));\n }\n else {\n this.addInfoPane(infoResult, completion);\n }\n }\n }\n addInfoPane(content, completion) {\n this.destroyInfo();\n let wrap = this.info = document.createElement(\"div\");\n wrap.className = \"cm-tooltip cm-completionInfo\";\n if (content.nodeType != null) {\n wrap.appendChild(content);\n this.infoDestroy = null;\n }\n else {\n let { dom, destroy } = content;\n wrap.appendChild(dom);\n this.infoDestroy = destroy || null;\n }\n this.dom.appendChild(wrap);\n this.view.requestMeasure(this.placeInfoReq);\n }\n updateSelectedOption(selected) {\n let set = null;\n for (let opt = this.list.firstChild, i = this.range.from; opt; opt = opt.nextSibling, i++) {\n if (opt.nodeName != \"LI\" || !opt.id) {\n i--; // A section header\n }\n else if (i == selected) {\n if (!opt.hasAttribute(\"aria-selected\")) {\n opt.setAttribute(\"aria-selected\", \"true\");\n set = opt;\n }\n }\n else {\n if (opt.hasAttribute(\"aria-selected\"))\n opt.removeAttribute(\"aria-selected\");\n }\n }\n if (set)\n scrollIntoView(this.list, set);\n return set;\n }\n measureInfo() {\n let sel = this.dom.querySelector(\"[aria-selected]\");\n if (!sel || !this.info)\n return null;\n let listRect = this.dom.getBoundingClientRect();\n let infoRect = this.info.getBoundingClientRect();\n let selRect = sel.getBoundingClientRect();\n let space = this.space;\n if (!space) {\n let win = this.dom.ownerDocument.defaultView || window;\n space = { left: 0, top: 0, right: win.innerWidth, bottom: win.innerHeight };\n }\n if (selRect.top > Math.min(space.bottom, listRect.bottom) - 10 ||\n selRect.bottom < Math.max(space.top, listRect.top) + 10)\n return null;\n return this.view.state.facet(completionConfig).positionInfo(this.view, listRect, selRect, infoRect, space, this.dom);\n }\n placeInfo(pos) {\n if (this.info) {\n if (pos) {\n if (pos.style)\n this.info.style.cssText = pos.style;\n this.info.className = \"cm-tooltip cm-completionInfo \" + (pos.class || \"\");\n }\n else {\n this.info.style.cssText = \"top: -1e6px\";\n }\n }\n }\n createListBox(options, id, range) {\n const ul = document.createElement(\"ul\");\n ul.id = id;\n ul.setAttribute(\"role\", \"listbox\");\n ul.setAttribute(\"aria-expanded\", \"true\");\n ul.setAttribute(\"aria-label\", this.view.state.phrase(\"Completions\"));\n let curSection = null;\n for (let i = range.from; i < range.to; i++) {\n let { completion, match } = options[i], { section } = completion;\n if (section) {\n let name = typeof section == \"string\" ? section : section.name;\n if (name != curSection && (i > range.from || range.from == 0)) {\n curSection = name;\n if (typeof section != \"string\" && section.header) {\n ul.appendChild(section.header(section));\n }\n else {\n let header = ul.appendChild(document.createElement(\"completion-section\"));\n header.textContent = name;\n }\n }\n }\n const li = ul.appendChild(document.createElement(\"li\"));\n li.id = id + \"-\" + i;\n li.setAttribute(\"role\", \"option\");\n let cls = this.optionClass(completion);\n if (cls)\n li.className = cls;\n for (let source of this.optionContent) {\n let node = source(completion, this.view.state, this.view, match);\n if (node)\n li.appendChild(node);\n }\n }\n if (range.from)\n ul.classList.add(\"cm-completionListIncompleteTop\");\n if (range.to < options.length)\n ul.classList.add(\"cm-completionListIncompleteBottom\");\n return ul;\n }\n destroyInfo() {\n if (this.info) {\n if (this.infoDestroy)\n this.infoDestroy();\n this.info.remove();\n this.info = null;\n }\n }\n destroy() {\n this.destroyInfo();\n }\n }\n function completionTooltip(stateField, applyCompletion) {\n return (view) => new CompletionTooltip(view, stateField, applyCompletion);\n }\n function scrollIntoView(container, element) {\n let parent = container.getBoundingClientRect();\n let self = element.getBoundingClientRect();\n let scaleY = parent.height / container.offsetHeight;\n if (self.top < parent.top)\n container.scrollTop -= (parent.top - self.top) / scaleY;\n else if (self.bottom > parent.bottom)\n container.scrollTop += (self.bottom - parent.bottom) / scaleY;\n }\n\n // Used to pick a preferred option when two options with the same\n // label occur in the result.\n function score(option) {\n return (option.boost || 0) * 100 + (option.apply ? 10 : 0) + (option.info ? 5 : 0) +\n (option.type ? 1 : 0);\n }\n function sortOptions(active, state) {\n let options = [];\n let sections = null;\n let addOption = (option) => {\n options.push(option);\n let { section } = option.completion;\n if (section) {\n if (!sections)\n sections = [];\n let name = typeof section == \"string\" ? section : section.name;\n if (!sections.some(s => s.name == name))\n sections.push(typeof section == \"string\" ? { name } : section);\n }\n };\n let conf = state.facet(completionConfig);\n for (let a of active)\n if (a.hasResult()) {\n let getMatch = a.result.getMatch;\n if (a.result.filter === false) {\n for (let option of a.result.options) {\n addOption(new Option(option, a.source, getMatch ? getMatch(option) : [], 1e9 - options.length));\n }\n }\n else {\n let pattern = state.sliceDoc(a.from, a.to), match;\n let matcher = conf.filterStrict ? new StrictMatcher(pattern) : new FuzzyMatcher(pattern);\n for (let option of a.result.options)\n if (match = matcher.match(option.label)) {\n let matched = !option.displayLabel ? match.matched : getMatch ? getMatch(option, match.matched) : [];\n addOption(new Option(option, a.source, matched, match.score + (option.boost || 0)));\n }\n }\n }\n if (sections) {\n let sectionOrder = Object.create(null), pos = 0;\n let cmp = (a, b) => { var _a, _b; return ((_a = a.rank) !== null && _a !== void 0 ? _a : 1e9) - ((_b = b.rank) !== null && _b !== void 0 ? _b : 1e9) || (a.name < b.name ? -1 : 1); };\n for (let s of sections.sort(cmp)) {\n pos -= 1e5;\n sectionOrder[s.name] = pos;\n }\n for (let option of options) {\n let { section } = option.completion;\n if (section)\n option.score += sectionOrder[typeof section == \"string\" ? section : section.name];\n }\n }\n let result = [], prev = null;\n let compare = conf.compareCompletions;\n for (let opt of options.sort((a, b) => (b.score - a.score) || compare(a.completion, b.completion))) {\n let cur = opt.completion;\n if (!prev || prev.label != cur.label || prev.detail != cur.detail ||\n (prev.type != null && cur.type != null && prev.type != cur.type) ||\n prev.apply != cur.apply || prev.boost != cur.boost)\n result.push(opt);\n else if (score(opt.completion) > score(prev))\n result[result.length - 1] = opt;\n prev = opt.completion;\n }\n return result;\n }\n class CompletionDialog {\n constructor(options, attrs, tooltip, timestamp, selected, disabled) {\n this.options = options;\n this.attrs = attrs;\n this.tooltip = tooltip;\n this.timestamp = timestamp;\n this.selected = selected;\n this.disabled = disabled;\n }\n setSelected(selected, id) {\n return selected == this.selected || selected >= this.options.length ? this\n : new CompletionDialog(this.options, makeAttrs(id, selected), this.tooltip, this.timestamp, selected, this.disabled);\n }\n static build(active, state, id, prev, conf) {\n let options = sortOptions(active, state);\n if (!options.length) {\n return prev && active.some(a => a.state == 1 /* State.Pending */) ?\n new CompletionDialog(prev.options, prev.attrs, prev.tooltip, prev.timestamp, prev.selected, true) : null;\n }\n let selected = state.facet(completionConfig).selectOnOpen ? 0 : -1;\n if (prev && prev.selected != selected && prev.selected != -1) {\n let selectedValue = prev.options[prev.selected].completion;\n for (let i = 0; i < options.length; i++)\n if (options[i].completion == selectedValue) {\n selected = i;\n break;\n }\n }\n return new CompletionDialog(options, makeAttrs(id, selected), {\n pos: active.reduce((a, b) => b.hasResult() ? Math.min(a, b.from) : a, 1e8),\n create: createTooltip,\n above: conf.aboveCursor,\n }, prev ? prev.timestamp : Date.now(), selected, false);\n }\n map(changes) {\n return new CompletionDialog(this.options, this.attrs, Object.assign(Object.assign({}, this.tooltip), { pos: changes.mapPos(this.tooltip.pos) }), this.timestamp, this.selected, this.disabled);\n }\n }\n class CompletionState {\n constructor(active, id, open) {\n this.active = active;\n this.id = id;\n this.open = open;\n }\n static start() {\n return new CompletionState(none$1, \"cm-ac-\" + Math.floor(Math.random() * 2e6).toString(36), null);\n }\n update(tr) {\n let { state } = tr, conf = state.facet(completionConfig);\n let sources = conf.override ||\n state.languageDataAt(\"autocomplete\", cur(state)).map(asSource);\n let active = sources.map(source => {\n let value = this.active.find(s => s.source == source) ||\n new ActiveSource(source, this.active.some(a => a.state != 0 /* State.Inactive */) ? 1 /* State.Pending */ : 0 /* State.Inactive */);\n return value.update(tr, conf);\n });\n if (active.length == this.active.length && active.every((a, i) => a == this.active[i]))\n active = this.active;\n let open = this.open;\n if (open && tr.docChanged)\n open = open.map(tr.changes);\n if (tr.selection || active.some(a => a.hasResult() && tr.changes.touchesRange(a.from, a.to)) ||\n !sameResults(active, this.active))\n open = CompletionDialog.build(active, state, this.id, open, conf);\n else if (open && open.disabled && !active.some(a => a.state == 1 /* State.Pending */))\n open = null;\n if (!open && active.every(a => a.state != 1 /* State.Pending */) && active.some(a => a.hasResult()))\n active = active.map(a => a.hasResult() ? new ActiveSource(a.source, 0 /* State.Inactive */) : a);\n for (let effect of tr.effects)\n if (effect.is(setSelectedEffect))\n open = open && open.setSelected(effect.value, this.id);\n return active == this.active && open == this.open ? this : new CompletionState(active, this.id, open);\n }\n get tooltip() { return this.open ? this.open.tooltip : null; }\n get attrs() { return this.open ? this.open.attrs : this.active.length ? baseAttrs : noAttrs; }\n }\n function sameResults(a, b) {\n if (a == b)\n return true;\n for (let iA = 0, iB = 0;;) {\n while (iA < a.length && !a[iA].hasResult)\n iA++;\n while (iB < b.length && !b[iB].hasResult)\n iB++;\n let endA = iA == a.length, endB = iB == b.length;\n if (endA || endB)\n return endA == endB;\n if (a[iA++].result != b[iB++].result)\n return false;\n }\n }\n const baseAttrs = {\n \"aria-autocomplete\": \"list\"\n };\n const noAttrs = {};\n function makeAttrs(id, selected) {\n let result = {\n \"aria-autocomplete\": \"list\",\n \"aria-haspopup\": \"listbox\",\n \"aria-controls\": id\n };\n if (selected > -1)\n result[\"aria-activedescendant\"] = id + \"-\" + selected;\n return result;\n }\n const none$1 = [];\n function getUpdateType(tr, conf) {\n if (tr.isUserEvent(\"input.complete\")) {\n let completion = tr.annotation(pickedCompletion);\n if (completion && conf.activateOnCompletion(completion))\n return 4 /* UpdateType.Activate */ | 8 /* UpdateType.Reset */;\n }\n let typing = tr.isUserEvent(\"input.type\");\n return typing && conf.activateOnTyping ? 4 /* UpdateType.Activate */ | 1 /* UpdateType.Typing */\n : typing ? 1 /* UpdateType.Typing */\n : tr.isUserEvent(\"delete.backward\") ? 2 /* UpdateType.Backspacing */\n : tr.selection ? 8 /* UpdateType.Reset */\n : tr.docChanged ? 16 /* UpdateType.ResetIfTouching */ : 0 /* UpdateType.None */;\n }\n class ActiveSource {\n constructor(source, state, explicitPos = -1) {\n this.source = source;\n this.state = state;\n this.explicitPos = explicitPos;\n }\n hasResult() { return false; }\n update(tr, conf) {\n let type = getUpdateType(tr, conf), value = this;\n if ((type & 8 /* UpdateType.Reset */) || (type & 16 /* UpdateType.ResetIfTouching */) && this.touches(tr))\n value = new ActiveSource(value.source, 0 /* State.Inactive */);\n if ((type & 4 /* UpdateType.Activate */) && value.state == 0 /* State.Inactive */)\n value = new ActiveSource(this.source, 1 /* State.Pending */);\n value = value.updateFor(tr, type);\n for (let effect of tr.effects) {\n if (effect.is(startCompletionEffect))\n value = new ActiveSource(value.source, 1 /* State.Pending */, effect.value ? cur(tr.state) : -1);\n else if (effect.is(closeCompletionEffect))\n value = new ActiveSource(value.source, 0 /* State.Inactive */);\n else if (effect.is(setActiveEffect))\n for (let active of effect.value)\n if (active.source == value.source)\n value = active;\n }\n return value;\n }\n updateFor(tr, type) { return this.map(tr.changes); }\n map(changes) {\n return changes.empty || this.explicitPos < 0 ? this : new ActiveSource(this.source, this.state, changes.mapPos(this.explicitPos));\n }\n touches(tr) {\n return tr.changes.touchesRange(cur(tr.state));\n }\n }\n class ActiveResult extends ActiveSource {\n constructor(source, explicitPos, result, from, to) {\n super(source, 2 /* State.Result */, explicitPos);\n this.result = result;\n this.from = from;\n this.to = to;\n }\n hasResult() { return true; }\n updateFor(tr, type) {\n var _a;\n if (!(type & 3 /* UpdateType.SimpleInteraction */))\n return this.map(tr.changes);\n let result = this.result;\n if (result.map && !tr.changes.empty)\n result = result.map(result, tr.changes);\n let from = tr.changes.mapPos(this.from), to = tr.changes.mapPos(this.to, 1);\n let pos = cur(tr.state);\n if ((this.explicitPos < 0 ? pos <= from : pos < this.from) ||\n pos > to || !result ||\n (type & 2 /* UpdateType.Backspacing */) && cur(tr.startState) == this.from)\n return new ActiveSource(this.source, type & 4 /* UpdateType.Activate */ ? 1 /* State.Pending */ : 0 /* State.Inactive */);\n let explicitPos = this.explicitPos < 0 ? -1 : tr.changes.mapPos(this.explicitPos);\n if (checkValid(result.validFor, tr.state, from, to))\n return new ActiveResult(this.source, explicitPos, result, from, to);\n if (result.update &&\n (result = result.update(result, from, to, new CompletionContext(tr.state, pos, explicitPos >= 0))))\n return new ActiveResult(this.source, explicitPos, result, result.from, (_a = result.to) !== null && _a !== void 0 ? _a : cur(tr.state));\n return new ActiveSource(this.source, 1 /* State.Pending */, explicitPos);\n }\n map(mapping) {\n if (mapping.empty)\n return this;\n let result = this.result.map ? this.result.map(this.result, mapping) : this.result;\n if (!result)\n return new ActiveSource(this.source, 0 /* State.Inactive */);\n return new ActiveResult(this.source, this.explicitPos < 0 ? -1 : mapping.mapPos(this.explicitPos), this.result, mapping.mapPos(this.from), mapping.mapPos(this.to, 1));\n }\n touches(tr) {\n return tr.changes.touchesRange(this.from, this.to);\n }\n }\n function checkValid(validFor, state, from, to) {\n if (!validFor)\n return false;\n let text = state.sliceDoc(from, to);\n return typeof validFor == \"function\" ? validFor(text, from, to, state) : ensureAnchor(validFor, true).test(text);\n }\n const setActiveEffect = /*@__PURE__*/StateEffect.define({\n map(sources, mapping) { return sources.map(s => s.map(mapping)); }\n });\n const setSelectedEffect = /*@__PURE__*/StateEffect.define();\n const completionState = /*@__PURE__*/StateField.define({\n create() { return CompletionState.start(); },\n update(value, tr) { return value.update(tr); },\n provide: f => [\n showTooltip.from(f, val => val.tooltip),\n EditorView.contentAttributes.from(f, state => state.attrs)\n ]\n });\n function applyCompletion(view, option) {\n const apply = option.completion.apply || option.completion.label;\n let result = view.state.field(completionState).active.find(a => a.source == option.source);\n if (!(result instanceof ActiveResult))\n return false;\n if (typeof apply == \"string\")\n view.dispatch(Object.assign(Object.assign({}, insertCompletionText(view.state, apply, result.from, result.to)), { annotations: pickedCompletion.of(option.completion) }));\n else\n apply(view, option.completion, result.from, result.to);\n return true;\n }\n const createTooltip = /*@__PURE__*/completionTooltip(completionState, applyCompletion);\n\n /**\n Returns a command that moves the completion selection forward or\n backward by the given amount.\n */\n function moveCompletionSelection(forward, by = \"option\") {\n return (view) => {\n let cState = view.state.field(completionState, false);\n if (!cState || !cState.open || cState.open.disabled ||\n Date.now() - cState.open.timestamp < view.state.facet(completionConfig).interactionDelay)\n return false;\n let step = 1, tooltip;\n if (by == \"page\" && (tooltip = getTooltip(view, cState.open.tooltip)))\n step = Math.max(2, Math.floor(tooltip.dom.offsetHeight /\n tooltip.dom.querySelector(\"li\").offsetHeight) - 1);\n let { length } = cState.open.options;\n let selected = cState.open.selected > -1 ? cState.open.selected + step * (forward ? 1 : -1) : forward ? 0 : length - 1;\n if (selected < 0)\n selected = by == \"page\" ? 0 : length - 1;\n else if (selected >= length)\n selected = by == \"page\" ? length - 1 : 0;\n view.dispatch({ effects: setSelectedEffect.of(selected) });\n return true;\n };\n }\n /**\n Accept the current completion.\n */\n const acceptCompletion = (view) => {\n let cState = view.state.field(completionState, false);\n if (view.state.readOnly || !cState || !cState.open || cState.open.selected < 0 || cState.open.disabled ||\n Date.now() - cState.open.timestamp < view.state.facet(completionConfig).interactionDelay)\n return false;\n return applyCompletion(view, cState.open.options[cState.open.selected]);\n };\n /**\n Explicitly start autocompletion.\n */\n const startCompletion = (view) => {\n let cState = view.state.field(completionState, false);\n if (!cState)\n return false;\n view.dispatch({ effects: startCompletionEffect.of(true) });\n return true;\n };\n /**\n Close the currently active completion.\n */\n const closeCompletion = (view) => {\n let cState = view.state.field(completionState, false);\n if (!cState || !cState.active.some(a => a.state != 0 /* State.Inactive */))\n return false;\n view.dispatch({ effects: closeCompletionEffect.of(null) });\n return true;\n };\n class RunningQuery {\n constructor(active, context) {\n this.active = active;\n this.context = context;\n this.time = Date.now();\n this.updates = [];\n // Note that 'undefined' means 'not done yet', whereas 'null' means\n // 'query returned null'.\n this.done = undefined;\n }\n }\n const MaxUpdateCount = 50, MinAbortTime = 1000;\n const completionPlugin = /*@__PURE__*/ViewPlugin.fromClass(class {\n constructor(view) {\n this.view = view;\n this.debounceUpdate = -1;\n this.running = [];\n this.debounceAccept = -1;\n this.pendingStart = false;\n this.composing = 0 /* CompositionState.None */;\n for (let active of view.state.field(completionState).active)\n if (active.state == 1 /* State.Pending */)\n this.startQuery(active);\n }\n update(update) {\n let cState = update.state.field(completionState);\n let conf = update.state.facet(completionConfig);\n if (!update.selectionSet && !update.docChanged && update.startState.field(completionState) == cState)\n return;\n let doesReset = update.transactions.some(tr => {\n let type = getUpdateType(tr, conf);\n return (type & 8 /* UpdateType.Reset */) || (tr.selection || tr.docChanged) && !(type & 3 /* UpdateType.SimpleInteraction */);\n });\n for (let i = 0; i < this.running.length; i++) {\n let query = this.running[i];\n if (doesReset ||\n query.updates.length + update.transactions.length > MaxUpdateCount && Date.now() - query.time > MinAbortTime) {\n for (let handler of query.context.abortListeners) {\n try {\n handler();\n }\n catch (e) {\n logException(this.view.state, e);\n }\n }\n query.context.abortListeners = null;\n this.running.splice(i--, 1);\n }\n else {\n query.updates.push(...update.transactions);\n }\n }\n if (this.debounceUpdate > -1)\n clearTimeout(this.debounceUpdate);\n if (update.transactions.some(tr => tr.effects.some(e => e.is(startCompletionEffect))))\n this.pendingStart = true;\n let delay = this.pendingStart ? 50 : conf.activateOnTypingDelay;\n this.debounceUpdate = cState.active.some(a => a.state == 1 /* State.Pending */ && !this.running.some(q => q.active.source == a.source))\n ? setTimeout(() => this.startUpdate(), delay) : -1;\n if (this.composing != 0 /* CompositionState.None */)\n for (let tr of update.transactions) {\n if (tr.isUserEvent(\"input.type\"))\n this.composing = 2 /* CompositionState.Changed */;\n else if (this.composing == 2 /* CompositionState.Changed */ && tr.selection)\n this.composing = 3 /* CompositionState.ChangedAndMoved */;\n }\n }\n startUpdate() {\n this.debounceUpdate = -1;\n this.pendingStart = false;\n let { state } = this.view, cState = state.field(completionState);\n for (let active of cState.active) {\n if (active.state == 1 /* State.Pending */ && !this.running.some(r => r.active.source == active.source))\n this.startQuery(active);\n }\n }\n startQuery(active) {\n let { state } = this.view, pos = cur(state);\n let context = new CompletionContext(state, pos, active.explicitPos == pos, this.view);\n let pending = new RunningQuery(active, context);\n this.running.push(pending);\n Promise.resolve(active.source(context)).then(result => {\n if (!pending.context.aborted) {\n pending.done = result || null;\n this.scheduleAccept();\n }\n }, err => {\n this.view.dispatch({ effects: closeCompletionEffect.of(null) });\n logException(this.view.state, err);\n });\n }\n scheduleAccept() {\n if (this.running.every(q => q.done !== undefined))\n this.accept();\n else if (this.debounceAccept < 0)\n this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(completionConfig).updateSyncTime);\n }\n // For each finished query in this.running, try to create a result\n // or, if appropriate, restart the query.\n accept() {\n var _a;\n if (this.debounceAccept > -1)\n clearTimeout(this.debounceAccept);\n this.debounceAccept = -1;\n let updated = [];\n let conf = this.view.state.facet(completionConfig);\n for (let i = 0; i < this.running.length; i++) {\n let query = this.running[i];\n if (query.done === undefined)\n continue;\n this.running.splice(i--, 1);\n if (query.done) {\n let active = new ActiveResult(query.active.source, query.active.explicitPos, query.done, query.done.from, (_a = query.done.to) !== null && _a !== void 0 ? _a : cur(query.updates.length ? query.updates[0].startState : this.view.state));\n // Replay the transactions that happened since the start of\n // the request and see if that preserves the result\n for (let tr of query.updates)\n active = active.update(tr, conf);\n if (active.hasResult()) {\n updated.push(active);\n continue;\n }\n }\n let current = this.view.state.field(completionState).active.find(a => a.source == query.active.source);\n if (current && current.state == 1 /* State.Pending */) {\n if (query.done == null) {\n // Explicitly failed. Should clear the pending status if it\n // hasn't been re-set in the meantime.\n let active = new ActiveSource(query.active.source, 0 /* State.Inactive */);\n for (let tr of query.updates)\n active = active.update(tr, conf);\n if (active.state != 1 /* State.Pending */)\n updated.push(active);\n }\n else {\n // Cleared by subsequent transactions. Restart.\n this.startQuery(current);\n }\n }\n }\n if (updated.length)\n this.view.dispatch({ effects: setActiveEffect.of(updated) });\n }\n }, {\n eventHandlers: {\n blur(event) {\n let state = this.view.state.field(completionState, false);\n if (state && state.tooltip && this.view.state.facet(completionConfig).closeOnBlur) {\n let dialog = state.open && getTooltip(this.view, state.open.tooltip);\n if (!dialog || !dialog.dom.contains(event.relatedTarget))\n setTimeout(() => this.view.dispatch({ effects: closeCompletionEffect.of(null) }), 10);\n }\n },\n compositionstart() {\n this.composing = 1 /* CompositionState.Started */;\n },\n compositionend() {\n if (this.composing == 3 /* CompositionState.ChangedAndMoved */) {\n // Safari fires compositionend events synchronously, possibly\n // from inside an update, so dispatch asynchronously to avoid reentrancy\n setTimeout(() => this.view.dispatch({ effects: startCompletionEffect.of(false) }), 20);\n }\n this.composing = 0 /* CompositionState.None */;\n }\n }\n });\n const windows = typeof navigator == \"object\" && /*@__PURE__*//Win/.test(navigator.platform);\n const commitCharacters = /*@__PURE__*/Prec.highest(/*@__PURE__*/EditorView.domEventHandlers({\n keydown(event, view) {\n let field = view.state.field(completionState, false);\n if (!field || !field.open || field.open.disabled || field.open.selected < 0 ||\n event.key.length > 1 || event.ctrlKey && !(windows && event.altKey) || event.metaKey)\n return false;\n let option = field.open.options[field.open.selected];\n let result = field.active.find(a => a.source == option.source);\n let commitChars = option.completion.commitCharacters || result.result.commitCharacters;\n if (commitChars && commitChars.indexOf(event.key) > -1)\n applyCompletion(view, option);\n return false;\n }\n }));\n\n const baseTheme = /*@__PURE__*/EditorView.baseTheme({\n \".cm-tooltip.cm-tooltip-autocomplete\": {\n \"& > ul\": {\n fontFamily: \"monospace\",\n whiteSpace: \"nowrap\",\n overflow: \"hidden auto\",\n maxWidth_fallback: \"700px\",\n maxWidth: \"min(700px, 95vw)\",\n minWidth: \"250px\",\n maxHeight: \"10em\",\n height: \"100%\",\n listStyle: \"none\",\n margin: 0,\n padding: 0,\n \"& > li, & > completion-section\": {\n padding: \"1px 3px\",\n lineHeight: 1.2\n },\n \"& > li\": {\n overflowX: \"hidden\",\n textOverflow: \"ellipsis\",\n cursor: \"pointer\"\n },\n \"& > completion-section\": {\n display: \"list-item\",\n borderBottom: \"1px solid silver\",\n paddingLeft: \"0.5em\",\n opacity: 0.7\n }\n }\n },\n \"&light .cm-tooltip-autocomplete ul li[aria-selected]\": {\n background: \"#17c\",\n color: \"white\",\n },\n \"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]\": {\n background: \"#777\",\n },\n \"&dark .cm-tooltip-autocomplete ul li[aria-selected]\": {\n background: \"#347\",\n color: \"white\",\n },\n \"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]\": {\n background: \"#444\",\n },\n \".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after\": {\n content: '\"\u00B7\u00B7\u00B7\"',\n opacity: 0.5,\n display: \"block\",\n textAlign: \"center\"\n },\n \".cm-tooltip.cm-completionInfo\": {\n position: \"absolute\",\n padding: \"3px 9px\",\n width: \"max-content\",\n maxWidth: `${400 /* Info.Width */}px`,\n boxSizing: \"border-box\"\n },\n \".cm-completionInfo.cm-completionInfo-left\": { right: \"100%\" },\n \".cm-completionInfo.cm-completionInfo-right\": { left: \"100%\" },\n \".cm-completionInfo.cm-completionInfo-left-narrow\": { right: `${30 /* Info.Margin */}px` },\n \".cm-completionInfo.cm-completionInfo-right-narrow\": { left: `${30 /* Info.Margin */}px` },\n \"&light .cm-snippetField\": { backgroundColor: \"#00000022\" },\n \"&dark .cm-snippetField\": { backgroundColor: \"#ffffff22\" },\n \".cm-snippetFieldPosition\": {\n verticalAlign: \"text-top\",\n width: 0,\n height: \"1.15em\",\n display: \"inline-block\",\n margin: \"0 -0.7px -.7em\",\n borderLeft: \"1.4px dotted #888\"\n },\n \".cm-completionMatchedText\": {\n textDecoration: \"underline\"\n },\n \".cm-completionDetail\": {\n marginLeft: \"0.5em\",\n fontStyle: \"italic\"\n },\n \".cm-completionIcon\": {\n fontSize: \"90%\",\n width: \".8em\",\n display: \"inline-block\",\n textAlign: \"center\",\n paddingRight: \".6em\",\n opacity: \"0.6\",\n boxSizing: \"content-box\"\n },\n \".cm-completionIcon-function, .cm-completionIcon-method\": {\n \"&:after\": { content: \"'\u0192'\" }\n },\n \".cm-completionIcon-class\": {\n \"&:after\": { content: \"'\u25CB'\" }\n },\n \".cm-completionIcon-interface\": {\n \"&:after\": { content: \"'\u25CC'\" }\n },\n \".cm-completionIcon-variable\": {\n \"&:after\": { content: \"'\uD835\uDC65'\" }\n },\n \".cm-completionIcon-constant\": {\n \"&:after\": { content: \"'\uD835\uDC36'\" }\n },\n \".cm-completionIcon-type\": {\n \"&:after\": { content: \"'\uD835\uDC61'\" }\n },\n \".cm-completionIcon-enum\": {\n \"&:after\": { content: \"'\u222A'\" }\n },\n \".cm-completionIcon-property\": {\n \"&:after\": { content: \"'\u25A1'\" }\n },\n \".cm-completionIcon-keyword\": {\n \"&:after\": { content: \"'\uD83D\uDD11\\uFE0E'\" } // Disable emoji rendering\n },\n \".cm-completionIcon-namespace\": {\n \"&:after\": { content: \"'\u25A2'\" }\n },\n \".cm-completionIcon-text\": {\n \"&:after\": { content: \"'abc'\", fontSize: \"50%\", verticalAlign: \"middle\" }\n }\n });\n\n class FieldPos {\n constructor(field, line, from, to) {\n this.field = field;\n this.line = line;\n this.from = from;\n this.to = to;\n }\n }\n class FieldRange {\n constructor(field, from, to) {\n this.field = field;\n this.from = from;\n this.to = to;\n }\n map(changes) {\n let from = changes.mapPos(this.from, -1, MapMode.TrackDel);\n let to = changes.mapPos(this.to, 1, MapMode.TrackDel);\n return from == null || to == null ? null : new FieldRange(this.field, from, to);\n }\n }\n class Snippet {\n constructor(lines, fieldPositions) {\n this.lines = lines;\n this.fieldPositions = fieldPositions;\n }\n instantiate(state, pos) {\n let text = [], lineStart = [pos];\n let lineObj = state.doc.lineAt(pos), baseIndent = /^\\s*/.exec(lineObj.text)[0];\n for (let line of this.lines) {\n if (text.length) {\n let indent = baseIndent, tabs = /^\\t*/.exec(line)[0].length;\n for (let i = 0; i < tabs; i++)\n indent += state.facet(indentUnit);\n lineStart.push(pos + indent.length - tabs);\n line = indent + line.slice(tabs);\n }\n text.push(line);\n pos += line.length + 1;\n }\n let ranges = this.fieldPositions.map(pos => new FieldRange(pos.field, lineStart[pos.line] + pos.from, lineStart[pos.line] + pos.to));\n return { text, ranges };\n }\n static parse(template) {\n let fields = [];\n let lines = [], positions = [], m;\n for (let line of template.split(/\\r\\n?|\\n/)) {\n while (m = /[#$]\\{(?:(\\d+)(?::([^}]*))?|((?:\\\\[{}]|[^}])*))\\}/.exec(line)) {\n let seq = m[1] ? +m[1] : null, rawName = m[2] || m[3] || \"\", found = -1;\n let name = rawName.replace(/\\\\[{}]/g, m => m[1]);\n for (let i = 0; i < fields.length; i++) {\n if (seq != null ? fields[i].seq == seq : name ? fields[i].name == name : false)\n found = i;\n }\n if (found < 0) {\n let i = 0;\n while (i < fields.length && (seq == null || (fields[i].seq != null && fields[i].seq < seq)))\n i++;\n fields.splice(i, 0, { seq, name });\n found = i;\n for (let pos of positions)\n if (pos.field >= found)\n pos.field++;\n }\n positions.push(new FieldPos(found, lines.length, m.index, m.index + name.length));\n line = line.slice(0, m.index) + rawName + line.slice(m.index + m[0].length);\n }\n line = line.replace(/\\\\([{}])/g, (_, brace, index) => {\n for (let pos of positions)\n if (pos.line == lines.length && pos.from > index) {\n pos.from--;\n pos.to--;\n }\n return brace;\n });\n lines.push(line);\n }\n return new Snippet(lines, positions);\n }\n }\n let fieldMarker = /*@__PURE__*/Decoration.widget({ widget: /*@__PURE__*/new class extends WidgetType {\n toDOM() {\n let span = document.createElement(\"span\");\n span.className = \"cm-snippetFieldPosition\";\n return span;\n }\n ignoreEvent() { return false; }\n } });\n let fieldRange = /*@__PURE__*/Decoration.mark({ class: \"cm-snippetField\" });\n class ActiveSnippet {\n constructor(ranges, active) {\n this.ranges = ranges;\n this.active = active;\n this.deco = Decoration.set(ranges.map(r => (r.from == r.to ? fieldMarker : fieldRange).range(r.from, r.to)));\n }\n map(changes) {\n let ranges = [];\n for (let r of this.ranges) {\n let mapped = r.map(changes);\n if (!mapped)\n return null;\n ranges.push(mapped);\n }\n return new ActiveSnippet(ranges, this.active);\n }\n selectionInsideField(sel) {\n return sel.ranges.every(range => this.ranges.some(r => r.field == this.active && r.from <= range.from && r.to >= range.to));\n }\n }\n const setActive = /*@__PURE__*/StateEffect.define({\n map(value, changes) { return value && value.map(changes); }\n });\n const moveToField = /*@__PURE__*/StateEffect.define();\n const snippetState = /*@__PURE__*/StateField.define({\n create() { return null; },\n update(value, tr) {\n for (let effect of tr.effects) {\n if (effect.is(setActive))\n return effect.value;\n if (effect.is(moveToField) && value)\n return new ActiveSnippet(value.ranges, effect.value);\n }\n if (value && tr.docChanged)\n value = value.map(tr.changes);\n if (value && tr.selection && !value.selectionInsideField(tr.selection))\n value = null;\n return value;\n },\n provide: f => EditorView.decorations.from(f, val => val ? val.deco : Decoration.none)\n });\n function fieldSelection(ranges, field) {\n return EditorSelection.create(ranges.filter(r => r.field == field).map(r => EditorSelection.range(r.from, r.to)));\n }\n /**\n Convert a snippet template to a function that can\n [apply](https://codemirror.net/6/docs/ref/#autocomplete.Completion.apply) it. Snippets are written\n using syntax like this:\n\n \"for (let ${index} = 0; ${index} < ${end}; ${index}++) {\\n\\t${}\\n}\"\n\n Each `${}` placeholder (you may also use `#{}`) indicates a field\n that the user can fill in. Its name, if any, will be the default\n content for the field.\n\n When the snippet is activated by calling the returned function,\n the code is inserted at the given position. Newlines in the\n template are indented by the indentation of the start line, plus\n one [indent unit](https://codemirror.net/6/docs/ref/#language.indentUnit) per tab character after\n the newline.\n\n On activation, (all instances of) the first field are selected.\n The user can move between fields with Tab and Shift-Tab as long as\n the fields are active. Moving to the last field or moving the\n cursor out of the current field deactivates the fields.\n\n The order of fields defaults to textual order, but you can add\n numbers to placeholders (`${1}` or `${1:defaultText}`) to provide\n a custom order.\n\n To include a literal `{` or `}` in your template, put a backslash\n in front of it. This will be removed and the brace will not be\n interpreted as indicating a placeholder.\n */\n function snippet(template) {\n let snippet = Snippet.parse(template);\n return (editor, completion, from, to) => {\n let { text, ranges } = snippet.instantiate(editor.state, from);\n let spec = {\n changes: { from, to, insert: Text.of(text) },\n scrollIntoView: true,\n annotations: completion ? [pickedCompletion.of(completion), Transaction.userEvent.of(\"input.complete\")] : undefined\n };\n if (ranges.length)\n spec.selection = fieldSelection(ranges, 0);\n if (ranges.some(r => r.field > 0)) {\n let active = new ActiveSnippet(ranges, 0);\n let effects = spec.effects = [setActive.of(active)];\n if (editor.state.field(snippetState, false) === undefined)\n effects.push(StateEffect.appendConfig.of([snippetState, addSnippetKeymap, snippetPointerHandler, baseTheme]));\n }\n editor.dispatch(editor.state.update(spec));\n };\n }\n function moveField(dir) {\n return ({ state, dispatch }) => {\n let active = state.field(snippetState, false);\n if (!active || dir < 0 && active.active == 0)\n return false;\n let next = active.active + dir, last = dir > 0 && !active.ranges.some(r => r.field == next + dir);\n dispatch(state.update({\n selection: fieldSelection(active.ranges, next),\n effects: setActive.of(last ? null : new ActiveSnippet(active.ranges, next)),\n scrollIntoView: true\n }));\n return true;\n };\n }\n /**\n A command that clears the active snippet, if any.\n */\n const clearSnippet = ({ state, dispatch }) => {\n let active = state.field(snippetState, false);\n if (!active)\n return false;\n dispatch(state.update({ effects: setActive.of(null) }));\n return true;\n };\n /**\n Move to the next snippet field, if available.\n */\n const nextSnippetField = /*@__PURE__*/moveField(1);\n /**\n Move to the previous snippet field, if available.\n */\n const prevSnippetField = /*@__PURE__*/moveField(-1);\n const defaultSnippetKeymap = [\n { key: \"Tab\", run: nextSnippetField, shift: prevSnippetField },\n { key: \"Escape\", run: clearSnippet }\n ];\n /**\n A facet that can be used to configure the key bindings used by\n snippets. The default binds Tab to\n [`nextSnippetField`](https://codemirror.net/6/docs/ref/#autocomplete.nextSnippetField), Shift-Tab to\n [`prevSnippetField`](https://codemirror.net/6/docs/ref/#autocomplete.prevSnippetField), and Escape\n to [`clearSnippet`](https://codemirror.net/6/docs/ref/#autocomplete.clearSnippet).\n */\n const snippetKeymap = /*@__PURE__*/Facet.define({\n combine(maps) { return maps.length ? maps[0] : defaultSnippetKeymap; }\n });\n const addSnippetKeymap = /*@__PURE__*/Prec.highest(/*@__PURE__*/keymap.compute([snippetKeymap], state => state.facet(snippetKeymap)));\n /**\n Create a completion from a snippet. Returns an object with the\n properties from `completion`, plus an `apply` function that\n applies the snippet.\n */\n function snippetCompletion(template, completion) {\n return Object.assign(Object.assign({}, completion), { apply: snippet(template) });\n }\n const snippetPointerHandler = /*@__PURE__*/EditorView.domEventHandlers({\n mousedown(event, view) {\n let active = view.state.field(snippetState, false), pos;\n if (!active || (pos = view.posAtCoords({ x: event.clientX, y: event.clientY })) == null)\n return false;\n let match = active.ranges.find(r => r.from <= pos && r.to >= pos);\n if (!match || match.field == active.active)\n return false;\n view.dispatch({\n selection: fieldSelection(active.ranges, match.field),\n effects: setActive.of(active.ranges.some(r => r.field > match.field)\n ? new ActiveSnippet(active.ranges, match.field) : null),\n scrollIntoView: true\n });\n return true;\n }\n });\n\n const defaults = {\n brackets: [\"(\", \"[\", \"{\", \"'\", '\"'],\n before: \")]}:;>\",\n stringPrefixes: []\n };\n const closeBracketEffect = /*@__PURE__*/StateEffect.define({\n map(value, mapping) {\n let mapped = mapping.mapPos(value, -1, MapMode.TrackAfter);\n return mapped == null ? undefined : mapped;\n }\n });\n const closedBracket = /*@__PURE__*/new class extends RangeValue {\n };\n closedBracket.startSide = 1;\n closedBracket.endSide = -1;\n const bracketState = /*@__PURE__*/StateField.define({\n create() { return RangeSet.empty; },\n update(value, tr) {\n value = value.map(tr.changes);\n if (tr.selection) {\n let line = tr.state.doc.lineAt(tr.selection.main.head);\n value = value.update({ filter: from => from >= line.from && from <= line.to });\n }\n for (let effect of tr.effects)\n if (effect.is(closeBracketEffect))\n value = value.update({ add: [closedBracket.range(effect.value, effect.value + 1)] });\n return value;\n }\n });\n /**\n Extension to enable bracket-closing behavior. When a closeable\n bracket is typed, its closing bracket is immediately inserted\n after the cursor. When closing a bracket directly in front of a\n closing bracket inserted by the extension, the cursor moves over\n that bracket.\n */\n function closeBrackets() {\n return [inputHandler, bracketState];\n }\n const definedClosing = \"()[]{}<>\";\n function closing(ch) {\n for (let i = 0; i < definedClosing.length; i += 2)\n if (definedClosing.charCodeAt(i) == ch)\n return definedClosing.charAt(i + 1);\n return fromCodePoint(ch < 128 ? ch : ch + 1);\n }\n function config$1(state, pos) {\n return state.languageDataAt(\"closeBrackets\", pos)[0] || defaults;\n }\n const android$1 = typeof navigator == \"object\" && /*@__PURE__*//Android\\b/.test(navigator.userAgent);\n const inputHandler = /*@__PURE__*/EditorView.inputHandler.of((view, from, to, insert) => {\n if ((android$1 ? view.composing : view.compositionStarted) || view.state.readOnly)\n return false;\n let sel = view.state.selection.main;\n if (insert.length > 2 || insert.length == 2 && codePointSize(codePointAt(insert, 0)) == 1 ||\n from != sel.from || to != sel.to)\n return false;\n let tr = insertBracket(view.state, insert);\n if (!tr)\n return false;\n view.dispatch(tr);\n return true;\n });\n /**\n Command that implements deleting a pair of matching brackets when\n the cursor is between them.\n */\n const deleteBracketPair = ({ state, dispatch }) => {\n if (state.readOnly)\n return false;\n let conf = config$1(state, state.selection.main.head);\n let tokens = conf.brackets || defaults.brackets;\n let dont = null, changes = state.changeByRange(range => {\n if (range.empty) {\n let before = prevChar(state.doc, range.head);\n for (let token of tokens) {\n if (token == before && nextChar(state.doc, range.head) == closing(codePointAt(token, 0)))\n return { changes: { from: range.head - token.length, to: range.head + token.length },\n range: EditorSelection.cursor(range.head - token.length) };\n }\n }\n return { range: dont = range };\n });\n if (!dont)\n dispatch(state.update(changes, { scrollIntoView: true, userEvent: \"delete.backward\" }));\n return !dont;\n };\n /**\n Close-brackets related key bindings. Binds Backspace to\n [`deleteBracketPair`](https://codemirror.net/6/docs/ref/#autocomplete.deleteBracketPair).\n */\n const closeBracketsKeymap = [\n { key: \"Backspace\", run: deleteBracketPair }\n ];\n /**\n Implements the extension's behavior on text insertion. If the\n given string counts as a bracket in the language around the\n selection, and replacing the selection with it requires custom\n behavior (inserting a closing version or skipping past a\n previously-closed bracket), this function returns a transaction\n representing that custom behavior. (You only need this if you want\n to programmatically insert brackets\u2014the\n [`closeBrackets`](https://codemirror.net/6/docs/ref/#autocomplete.closeBrackets) extension will\n take care of running this for user input.)\n */\n function insertBracket(state, bracket) {\n let conf = config$1(state, state.selection.main.head);\n let tokens = conf.brackets || defaults.brackets;\n for (let tok of tokens) {\n let closed = closing(codePointAt(tok, 0));\n if (bracket == tok)\n return closed == tok ? handleSame(state, tok, tokens.indexOf(tok + tok + tok) > -1, conf)\n : handleOpen(state, tok, closed, conf.before || defaults.before);\n if (bracket == closed && closedBracketAt(state, state.selection.main.from))\n return handleClose(state, tok, closed);\n }\n return null;\n }\n function closedBracketAt(state, pos) {\n let found = false;\n state.field(bracketState).between(0, state.doc.length, from => {\n if (from == pos)\n found = true;\n });\n return found;\n }\n function nextChar(doc, pos) {\n let next = doc.sliceString(pos, pos + 2);\n return next.slice(0, codePointSize(codePointAt(next, 0)));\n }\n function prevChar(doc, pos) {\n let prev = doc.sliceString(pos - 2, pos);\n return codePointSize(codePointAt(prev, 0)) == prev.length ? prev : prev.slice(1);\n }\n function handleOpen(state, open, close, closeBefore) {\n let dont = null, changes = state.changeByRange(range => {\n if (!range.empty)\n return { changes: [{ insert: open, from: range.from }, { insert: close, from: range.to }],\n effects: closeBracketEffect.of(range.to + open.length),\n range: EditorSelection.range(range.anchor + open.length, range.head + open.length) };\n let next = nextChar(state.doc, range.head);\n if (!next || /\\s/.test(next) || closeBefore.indexOf(next) > -1)\n return { changes: { insert: open + close, from: range.head },\n effects: closeBracketEffect.of(range.head + open.length),\n range: EditorSelection.cursor(range.head + open.length) };\n return { range: dont = range };\n });\n return dont ? null : state.update(changes, {\n scrollIntoView: true,\n userEvent: \"input.type\"\n });\n }\n function handleClose(state, _open, close) {\n let dont = null, changes = state.changeByRange(range => {\n if (range.empty && nextChar(state.doc, range.head) == close)\n return { changes: { from: range.head, to: range.head + close.length, insert: close },\n range: EditorSelection.cursor(range.head + close.length) };\n return dont = { range };\n });\n return dont ? null : state.update(changes, {\n scrollIntoView: true,\n userEvent: \"input.type\"\n });\n }\n // Handles cases where the open and close token are the same, and\n // possibly triple quotes (as in `\"\"\"abc\"\"\"`-style quoting).\n function handleSame(state, token, allowTriple, config) {\n let stringPrefixes = config.stringPrefixes || defaults.stringPrefixes;\n let dont = null, changes = state.changeByRange(range => {\n if (!range.empty)\n return { changes: [{ insert: token, from: range.from }, { insert: token, from: range.to }],\n effects: closeBracketEffect.of(range.to + token.length),\n range: EditorSelection.range(range.anchor + token.length, range.head + token.length) };\n let pos = range.head, next = nextChar(state.doc, pos), start;\n if (next == token) {\n if (nodeStart(state, pos)) {\n return { changes: { insert: token + token, from: pos },\n effects: closeBracketEffect.of(pos + token.length),\n range: EditorSelection.cursor(pos + token.length) };\n }\n else if (closedBracketAt(state, pos)) {\n let isTriple = allowTriple && state.sliceDoc(pos, pos + token.length * 3) == token + token + token;\n let content = isTriple ? token + token + token : token;\n return { changes: { from: pos, to: pos + content.length, insert: content },\n range: EditorSelection.cursor(pos + content.length) };\n }\n }\n else if (allowTriple && state.sliceDoc(pos - 2 * token.length, pos) == token + token &&\n (start = canStartStringAt(state, pos - 2 * token.length, stringPrefixes)) > -1 &&\n nodeStart(state, start)) {\n return { changes: { insert: token + token + token + token, from: pos },\n effects: closeBracketEffect.of(pos + token.length),\n range: EditorSelection.cursor(pos + token.length) };\n }\n else if (state.charCategorizer(pos)(next) != CharCategory.Word) {\n if (canStartStringAt(state, pos, stringPrefixes) > -1 && !probablyInString(state, pos, token, stringPrefixes))\n return { changes: { insert: token + token, from: pos },\n effects: closeBracketEffect.of(pos + token.length),\n range: EditorSelection.cursor(pos + token.length) };\n }\n return { range: dont = range };\n });\n return dont ? null : state.update(changes, {\n scrollIntoView: true,\n userEvent: \"input.type\"\n });\n }\n function nodeStart(state, pos) {\n let tree = syntaxTree(state).resolveInner(pos + 1);\n return tree.parent && tree.from == pos;\n }\n function probablyInString(state, pos, quoteToken, prefixes) {\n let node = syntaxTree(state).resolveInner(pos, -1);\n let maxPrefix = prefixes.reduce((m, p) => Math.max(m, p.length), 0);\n for (let i = 0; i < 5; i++) {\n let start = state.sliceDoc(node.from, Math.min(node.to, node.from + quoteToken.length + maxPrefix));\n let quotePos = start.indexOf(quoteToken);\n if (!quotePos || quotePos > -1 && prefixes.indexOf(start.slice(0, quotePos)) > -1) {\n let first = node.firstChild;\n while (first && first.from == node.from && first.to - first.from > quoteToken.length + quotePos) {\n if (state.sliceDoc(first.to - quoteToken.length, first.to) == quoteToken)\n return false;\n first = first.firstChild;\n }\n return true;\n }\n let parent = node.to == pos && node.parent;\n if (!parent)\n break;\n node = parent;\n }\n return false;\n }\n function canStartStringAt(state, pos, prefixes) {\n let charCat = state.charCategorizer(pos);\n if (charCat(state.sliceDoc(pos - 1, pos)) != CharCategory.Word)\n return pos;\n for (let prefix of prefixes) {\n let start = pos - prefix.length;\n if (state.sliceDoc(start, pos) == prefix && charCat(state.sliceDoc(start - 1, start)) != CharCategory.Word)\n return start;\n }\n return -1;\n }\n\n /**\n Returns an extension that enables autocompletion.\n */\n function autocompletion(config = {}) {\n return [\n commitCharacters,\n completionState,\n completionConfig.of(config),\n completionPlugin,\n completionKeymapExt,\n baseTheme\n ];\n }\n /**\n Basic keybindings for autocompletion.\n\n - Ctrl-Space: [`startCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.startCompletion)\n - Escape: [`closeCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.closeCompletion)\n - ArrowDown: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(true)`\n - ArrowUp: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(false)`\n - PageDown: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(true, \"page\")`\n - PageDown: [`moveCompletionSelection`](https://codemirror.net/6/docs/ref/#autocomplete.moveCompletionSelection)`(true, \"page\")`\n - Enter: [`acceptCompletion`](https://codemirror.net/6/docs/ref/#autocomplete.acceptCompletion)\n */\n const completionKeymap = [\n { key: \"Ctrl-Space\", run: startCompletion },\n { key: \"Escape\", run: closeCompletion },\n { key: \"ArrowDown\", run: /*@__PURE__*/moveCompletionSelection(true) },\n { key: \"ArrowUp\", run: /*@__PURE__*/moveCompletionSelection(false) },\n { key: \"PageDown\", run: /*@__PURE__*/moveCompletionSelection(true, \"page\") },\n { key: \"PageUp\", run: /*@__PURE__*/moveCompletionSelection(false, \"page\") },\n { key: \"Enter\", run: acceptCompletion }\n ];\n const completionKeymapExt = /*@__PURE__*/Prec.highest(/*@__PURE__*/keymap.computeN([completionConfig], state => state.facet(completionConfig).defaultKeymap ? [completionKeymap] : []));\n /**\n Get the current completion status. When completions are available,\n this will return `\"active\"`. When completions are pending (in the\n process of being queried), this returns `\"pending\"`. Otherwise, it\n returns `null`.\n */\n function completionStatus(state) {\n let cState = state.field(completionState, false);\n return cState && cState.active.some(a => a.state == 1 /* State.Pending */) ? \"pending\"\n : cState && cState.active.some(a => a.state != 0 /* State.Inactive */) ? \"active\" : null;\n }\n\n class CompositeBlock {\n static create(type, value, from, parentHash, end) {\n let hash = (parentHash + (parentHash << 8) + type + (value << 4)) | 0;\n return new CompositeBlock(type, value, from, hash, end, [], []);\n }\n constructor(type, \n // Used for indentation in list items, markup character in lists\n value, from, hash, end, children, positions) {\n this.type = type;\n this.value = value;\n this.from = from;\n this.hash = hash;\n this.end = end;\n this.children = children;\n this.positions = positions;\n this.hashProp = [[NodeProp.contextHash, hash]];\n }\n addChild(child, pos) {\n if (child.prop(NodeProp.contextHash) != this.hash)\n child = new Tree(child.type, child.children, child.positions, child.length, this.hashProp);\n this.children.push(child);\n this.positions.push(pos);\n }\n toTree(nodeSet, end = this.end) {\n let last = this.children.length - 1;\n if (last >= 0)\n end = Math.max(end, this.positions[last] + this.children[last].length + this.from);\n return new Tree(nodeSet.types[this.type], this.children, this.positions, end - this.from).balance({\n makeTree: (children, positions, length) => new Tree(NodeType.none, children, positions, length, this.hashProp)\n });\n }\n }\n var Type;\n (function (Type) {\n Type[Type[\"Document\"] = 1] = \"Document\";\n Type[Type[\"CodeBlock\"] = 2] = \"CodeBlock\";\n Type[Type[\"FencedCode\"] = 3] = \"FencedCode\";\n Type[Type[\"Blockquote\"] = 4] = \"Blockquote\";\n Type[Type[\"HorizontalRule\"] = 5] = \"HorizontalRule\";\n Type[Type[\"BulletList\"] = 6] = \"BulletList\";\n Type[Type[\"OrderedList\"] = 7] = \"OrderedList\";\n Type[Type[\"ListItem\"] = 8] = \"ListItem\";\n Type[Type[\"ATXHeading1\"] = 9] = \"ATXHeading1\";\n Type[Type[\"ATXHeading2\"] = 10] = \"ATXHeading2\";\n Type[Type[\"ATXHeading3\"] = 11] = \"ATXHeading3\";\n Type[Type[\"ATXHeading4\"] = 12] = \"ATXHeading4\";\n Type[Type[\"ATXHeading5\"] = 13] = \"ATXHeading5\";\n Type[Type[\"ATXHeading6\"] = 14] = \"ATXHeading6\";\n Type[Type[\"SetextHeading1\"] = 15] = \"SetextHeading1\";\n Type[Type[\"SetextHeading2\"] = 16] = \"SetextHeading2\";\n Type[Type[\"HTMLBlock\"] = 17] = \"HTMLBlock\";\n Type[Type[\"LinkReference\"] = 18] = \"LinkReference\";\n Type[Type[\"Paragraph\"] = 19] = \"Paragraph\";\n Type[Type[\"CommentBlock\"] = 20] = \"CommentBlock\";\n Type[Type[\"ProcessingInstructionBlock\"] = 21] = \"ProcessingInstructionBlock\";\n // Inline\n Type[Type[\"Escape\"] = 22] = \"Escape\";\n Type[Type[\"Entity\"] = 23] = \"Entity\";\n Type[Type[\"HardBreak\"] = 24] = \"HardBreak\";\n Type[Type[\"Emphasis\"] = 25] = \"Emphasis\";\n Type[Type[\"StrongEmphasis\"] = 26] = \"StrongEmphasis\";\n Type[Type[\"Link\"] = 27] = \"Link\";\n Type[Type[\"Image\"] = 28] = \"Image\";\n Type[Type[\"InlineCode\"] = 29] = \"InlineCode\";\n Type[Type[\"HTMLTag\"] = 30] = \"HTMLTag\";\n Type[Type[\"Comment\"] = 31] = \"Comment\";\n Type[Type[\"ProcessingInstruction\"] = 32] = \"ProcessingInstruction\";\n Type[Type[\"Autolink\"] = 33] = \"Autolink\";\n // Smaller tokens\n Type[Type[\"HeaderMark\"] = 34] = \"HeaderMark\";\n Type[Type[\"QuoteMark\"] = 35] = \"QuoteMark\";\n Type[Type[\"ListMark\"] = 36] = \"ListMark\";\n Type[Type[\"LinkMark\"] = 37] = \"LinkMark\";\n Type[Type[\"EmphasisMark\"] = 38] = \"EmphasisMark\";\n Type[Type[\"CodeMark\"] = 39] = \"CodeMark\";\n Type[Type[\"CodeText\"] = 40] = \"CodeText\";\n Type[Type[\"CodeInfo\"] = 41] = \"CodeInfo\";\n Type[Type[\"LinkTitle\"] = 42] = \"LinkTitle\";\n Type[Type[\"LinkLabel\"] = 43] = \"LinkLabel\";\n Type[Type[\"URL\"] = 44] = \"URL\";\n })(Type || (Type = {}));\n /// Data structure used to accumulate a block's content during [leaf\n /// block parsing](#BlockParser.leaf).\n class LeafBlock {\n /// @internal\n constructor(\n /// The start position of the block.\n start, \n /// The block's text content.\n content) {\n this.start = start;\n this.content = content;\n /// @internal\n this.marks = [];\n /// The block parsers active for this block.\n this.parsers = [];\n }\n }\n /// Data structure used during block-level per-line parsing.\n class Line {\n constructor() {\n /// The line's full text.\n this.text = \"\";\n /// The base indent provided by the composite contexts (that have\n /// been handled so far).\n this.baseIndent = 0;\n /// The string position corresponding to the base indent.\n this.basePos = 0;\n /// The number of contexts handled @internal\n this.depth = 0;\n /// Any markers (i.e. block quote markers) parsed for the contexts. @internal\n this.markers = [];\n /// The position of the next non-whitespace character beyond any\n /// list, blockquote, or other composite block markers.\n this.pos = 0;\n /// The column of the next non-whitespace character.\n this.indent = 0;\n /// The character code of the character after `pos`.\n this.next = -1;\n }\n /// @internal\n forward() {\n if (this.basePos > this.pos)\n this.forwardInner();\n }\n /// @internal\n forwardInner() {\n let newPos = this.skipSpace(this.basePos);\n this.indent = this.countIndent(newPos, this.pos, this.indent);\n this.pos = newPos;\n this.next = newPos == this.text.length ? -1 : this.text.charCodeAt(newPos);\n }\n /// Skip whitespace after the given position, return the position of\n /// the next non-space character or the end of the line if there's\n /// only space after `from`.\n skipSpace(from) { return skipSpace(this.text, from); }\n /// @internal\n reset(text) {\n this.text = text;\n this.baseIndent = this.basePos = this.pos = this.indent = 0;\n this.forwardInner();\n this.depth = 1;\n while (this.markers.length)\n this.markers.pop();\n }\n /// Move the line's base position forward to the given position.\n /// This should only be called by composite [block\n /// parsers](#BlockParser.parse) or [markup skipping\n /// functions](#NodeSpec.composite).\n moveBase(to) {\n this.basePos = to;\n this.baseIndent = this.countIndent(to, this.pos, this.indent);\n }\n /// Move the line's base position forward to the given _column_.\n moveBaseColumn(indent) {\n this.baseIndent = indent;\n this.basePos = this.findColumn(indent);\n }\n /// Store a composite-block-level marker. Should be called from\n /// [markup skipping functions](#NodeSpec.composite) when they\n /// consume any non-whitespace characters.\n addMarker(elt) {\n this.markers.push(elt);\n }\n /// Find the column position at `to`, optionally starting at a given\n /// position and column.\n countIndent(to, from = 0, indent = 0) {\n for (let i = from; i < to; i++)\n indent += this.text.charCodeAt(i) == 9 ? 4 - indent % 4 : 1;\n return indent;\n }\n /// Find the position corresponding to the given column.\n findColumn(goal) {\n let i = 0;\n for (let indent = 0; i < this.text.length && indent < goal; i++)\n indent += this.text.charCodeAt(i) == 9 ? 4 - indent % 4 : 1;\n return i;\n }\n /// @internal\n scrub() {\n if (!this.baseIndent)\n return this.text;\n let result = \"\";\n for (let i = 0; i < this.basePos; i++)\n result += \" \";\n return result + this.text.slice(this.basePos);\n }\n }\n function skipForList(bl, cx, line) {\n if (line.pos == line.text.length ||\n (bl != cx.block && line.indent >= cx.stack[line.depth + 1].value + line.baseIndent))\n return true;\n if (line.indent >= line.baseIndent + 4)\n return false;\n let size = (bl.type == Type.OrderedList ? isOrderedList : isBulletList)(line, cx, false);\n return size > 0 &&\n (bl.type != Type.BulletList || isHorizontalRule(line, cx, false) < 0) &&\n line.text.charCodeAt(line.pos + size - 1) == bl.value;\n }\n const DefaultSkipMarkup = {\n [Type.Blockquote](bl, cx, line) {\n if (line.next != 62 /* '>' */)\n return false;\n line.markers.push(elt(Type.QuoteMark, cx.lineStart + line.pos, cx.lineStart + line.pos + 1));\n line.moveBase(line.pos + (space$2(line.text.charCodeAt(line.pos + 1)) ? 2 : 1));\n bl.end = cx.lineStart + line.text.length;\n return true;\n },\n [Type.ListItem](bl, _cx, line) {\n if (line.indent < line.baseIndent + bl.value && line.next > -1)\n return false;\n line.moveBaseColumn(line.baseIndent + bl.value);\n return true;\n },\n [Type.OrderedList]: skipForList,\n [Type.BulletList]: skipForList,\n [Type.Document]() { return true; }\n };\n function space$2(ch) { return ch == 32 || ch == 9 || ch == 10 || ch == 13; }\n function skipSpace(line, i = 0) {\n while (i < line.length && space$2(line.charCodeAt(i)))\n i++;\n return i;\n }\n function skipSpaceBack(line, i, to) {\n while (i > to && space$2(line.charCodeAt(i - 1)))\n i--;\n return i;\n }\n function isFencedCode(line) {\n if (line.next != 96 && line.next != 126 /* '`~' */)\n return -1;\n let pos = line.pos + 1;\n while (pos < line.text.length && line.text.charCodeAt(pos) == line.next)\n pos++;\n if (pos < line.pos + 3)\n return -1;\n if (line.next == 96)\n for (let i = pos; i < line.text.length; i++)\n if (line.text.charCodeAt(i) == 96)\n return -1;\n return pos;\n }\n function isBlockquote(line) {\n return line.next != 62 /* '>' */ ? -1 : line.text.charCodeAt(line.pos + 1) == 32 ? 2 : 1;\n }\n function isHorizontalRule(line, cx, breaking) {\n if (line.next != 42 && line.next != 45 && line.next != 95 /* '_-*' */)\n return -1;\n let count = 1;\n for (let pos = line.pos + 1; pos < line.text.length; pos++) {\n let ch = line.text.charCodeAt(pos);\n if (ch == line.next)\n count++;\n else if (!space$2(ch))\n return -1;\n }\n // Setext headers take precedence\n if (breaking && line.next == 45 && isSetextUnderline(line) > -1 && line.depth == cx.stack.length)\n return -1;\n return count < 3 ? -1 : 1;\n }\n function inList(cx, type) {\n for (let i = cx.stack.length - 1; i >= 0; i--)\n if (cx.stack[i].type == type)\n return true;\n return false;\n }\n function isBulletList(line, cx, breaking) {\n return (line.next == 45 || line.next == 43 || line.next == 42 /* '-+*' */) &&\n (line.pos == line.text.length - 1 || space$2(line.text.charCodeAt(line.pos + 1))) &&\n (!breaking || inList(cx, Type.BulletList) || line.skipSpace(line.pos + 2) < line.text.length) ? 1 : -1;\n }\n function isOrderedList(line, cx, breaking) {\n let pos = line.pos, next = line.next;\n for (;;) {\n if (next >= 48 && next <= 57 /* '0-9' */)\n pos++;\n else\n break;\n if (pos == line.text.length)\n return -1;\n next = line.text.charCodeAt(pos);\n }\n if (pos == line.pos || pos > line.pos + 9 ||\n (next != 46 && next != 41 /* '.)' */) ||\n (pos < line.text.length - 1 && !space$2(line.text.charCodeAt(pos + 1))) ||\n breaking && !inList(cx, Type.OrderedList) &&\n (line.skipSpace(pos + 1) == line.text.length || pos > line.pos + 1 || line.next != 49 /* '1' */))\n return -1;\n return pos + 1 - line.pos;\n }\n function isAtxHeading(line) {\n if (line.next != 35 /* '#' */)\n return -1;\n let pos = line.pos + 1;\n while (pos < line.text.length && line.text.charCodeAt(pos) == 35)\n pos++;\n if (pos < line.text.length && line.text.charCodeAt(pos) != 32)\n return -1;\n let size = pos - line.pos;\n return size > 6 ? -1 : size;\n }\n function isSetextUnderline(line) {\n if (line.next != 45 && line.next != 61 /* '-=' */ || line.indent >= line.baseIndent + 4)\n return -1;\n let pos = line.pos + 1;\n while (pos < line.text.length && line.text.charCodeAt(pos) == line.next)\n pos++;\n let end = pos;\n while (pos < line.text.length && space$2(line.text.charCodeAt(pos)))\n pos++;\n return pos == line.text.length ? end : -1;\n }\n const EmptyLine = /^[ \\t]*$/, CommentEnd = /-->/, ProcessingEnd = /\\?>/;\n const HTMLBlockStyle = [\n [/^<(?:script|pre|style)(?:\\s|>|$)/i, /<\\/(?:script|pre|style)>/i],\n [/^\\s*<!--/, CommentEnd],\n [/^\\s*<\\?/, ProcessingEnd],\n [/^\\s*<![A-Z]/, />/],\n [/^\\s*<!\\[CDATA\\[/, /\\]\\]>/],\n [/^\\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, EmptyLine],\n [/^\\s*(?:<\\/[a-z][\\w-]*\\s*>|<[a-z][\\w-]*(\\s+[a-z:_][\\w-.]*(?:\\s*=\\s*(?:[^\\s\"'=<>`]+|'[^']*'|\"[^\"]*\"))?)*\\s*>)\\s*$/i, EmptyLine]\n ];\n function isHTMLBlock(line, _cx, breaking) {\n if (line.next != 60 /* '<' */)\n return -1;\n let rest = line.text.slice(line.pos);\n for (let i = 0, e = HTMLBlockStyle.length - (breaking ? 1 : 0); i < e; i++)\n if (HTMLBlockStyle[i][0].test(rest))\n return i;\n return -1;\n }\n function getListIndent(line, pos) {\n let indentAfter = line.countIndent(pos, line.pos, line.indent);\n let indented = line.countIndent(line.skipSpace(pos), pos, indentAfter);\n return indented >= indentAfter + 5 ? indentAfter + 1 : indented;\n }\n function addCodeText(marks, from, to) {\n let last = marks.length - 1;\n if (last >= 0 && marks[last].to == from && marks[last].type == Type.CodeText)\n marks[last].to = to;\n else\n marks.push(elt(Type.CodeText, from, to));\n }\n // Rules for parsing blocks. A return value of false means the rule\n // doesn't apply here, true means it does. When true is returned and\n // `p.line` has been updated, the rule is assumed to have consumed a\n // leaf block. Otherwise, it is assumed to have opened a context.\n const DefaultBlockParsers = {\n LinkReference: undefined,\n IndentedCode(cx, line) {\n let base = line.baseIndent + 4;\n if (line.indent < base)\n return false;\n let start = line.findColumn(base);\n let from = cx.lineStart + start, to = cx.lineStart + line.text.length;\n let marks = [], pendingMarks = [];\n addCodeText(marks, from, to);\n while (cx.nextLine() && line.depth >= cx.stack.length) {\n if (line.pos == line.text.length) { // Empty\n addCodeText(pendingMarks, cx.lineStart - 1, cx.lineStart);\n for (let m of line.markers)\n pendingMarks.push(m);\n }\n else if (line.indent < base) {\n break;\n }\n else {\n if (pendingMarks.length) {\n for (let m of pendingMarks) {\n if (m.type == Type.CodeText)\n addCodeText(marks, m.from, m.to);\n else\n marks.push(m);\n }\n pendingMarks = [];\n }\n addCodeText(marks, cx.lineStart - 1, cx.lineStart);\n for (let m of line.markers)\n marks.push(m);\n to = cx.lineStart + line.text.length;\n let codeStart = cx.lineStart + line.findColumn(line.baseIndent + 4);\n if (codeStart < to)\n addCodeText(marks, codeStart, to);\n }\n }\n if (pendingMarks.length) {\n pendingMarks = pendingMarks.filter(m => m.type != Type.CodeText);\n if (pendingMarks.length)\n line.markers = pendingMarks.concat(line.markers);\n }\n cx.addNode(cx.buffer.writeElements(marks, -from).finish(Type.CodeBlock, to - from), from);\n return true;\n },\n FencedCode(cx, line) {\n let fenceEnd = isFencedCode(line);\n if (fenceEnd < 0)\n return false;\n let from = cx.lineStart + line.pos, ch = line.next, len = fenceEnd - line.pos;\n let infoFrom = line.skipSpace(fenceEnd), infoTo = skipSpaceBack(line.text, line.text.length, infoFrom);\n let marks = [elt(Type.CodeMark, from, from + len)];\n if (infoFrom < infoTo)\n marks.push(elt(Type.CodeInfo, cx.lineStart + infoFrom, cx.lineStart + infoTo));\n for (let first = true; cx.nextLine() && line.depth >= cx.stack.length; first = false) {\n let i = line.pos;\n if (line.indent - line.baseIndent < 4)\n while (i < line.text.length && line.text.charCodeAt(i) == ch)\n i++;\n if (i - line.pos >= len && line.skipSpace(i) == line.text.length) {\n for (let m of line.markers)\n marks.push(m);\n marks.push(elt(Type.CodeMark, cx.lineStart + line.pos, cx.lineStart + i));\n cx.nextLine();\n break;\n }\n else {\n if (!first)\n addCodeText(marks, cx.lineStart - 1, cx.lineStart);\n for (let m of line.markers)\n marks.push(m);\n let textStart = cx.lineStart + line.basePos, textEnd = cx.lineStart + line.text.length;\n if (textStart < textEnd)\n addCodeText(marks, textStart, textEnd);\n }\n }\n cx.addNode(cx.buffer.writeElements(marks, -from)\n .finish(Type.FencedCode, cx.prevLineEnd() - from), from);\n return true;\n },\n Blockquote(cx, line) {\n let size = isBlockquote(line);\n if (size < 0)\n return false;\n cx.startContext(Type.Blockquote, line.pos);\n cx.addNode(Type.QuoteMark, cx.lineStart + line.pos, cx.lineStart + line.pos + 1);\n line.moveBase(line.pos + size);\n return null;\n },\n HorizontalRule(cx, line) {\n if (isHorizontalRule(line, cx, false) < 0)\n return false;\n let from = cx.lineStart + line.pos;\n cx.nextLine();\n cx.addNode(Type.HorizontalRule, from);\n return true;\n },\n BulletList(cx, line) {\n let size = isBulletList(line, cx, false);\n if (size < 0)\n return false;\n if (cx.block.type != Type.BulletList)\n cx.startContext(Type.BulletList, line.basePos, line.next);\n let newBase = getListIndent(line, line.pos + 1);\n cx.startContext(Type.ListItem, line.basePos, newBase - line.baseIndent);\n cx.addNode(Type.ListMark, cx.lineStart + line.pos, cx.lineStart + line.pos + size);\n line.moveBaseColumn(newBase);\n return null;\n },\n OrderedList(cx, line) {\n let size = isOrderedList(line, cx, false);\n if (size < 0)\n return false;\n if (cx.block.type != Type.OrderedList)\n cx.startContext(Type.OrderedList, line.basePos, line.text.charCodeAt(line.pos + size - 1));\n let newBase = getListIndent(line, line.pos + size);\n cx.startContext(Type.ListItem, line.basePos, newBase - line.baseIndent);\n cx.addNode(Type.ListMark, cx.lineStart + line.pos, cx.lineStart + line.pos + size);\n line.moveBaseColumn(newBase);\n return null;\n },\n ATXHeading(cx, line) {\n let size = isAtxHeading(line);\n if (size < 0)\n return false;\n let off = line.pos, from = cx.lineStart + off;\n let endOfSpace = skipSpaceBack(line.text, line.text.length, off), after = endOfSpace;\n while (after > off && line.text.charCodeAt(after - 1) == line.next)\n after--;\n if (after == endOfSpace || after == off || !space$2(line.text.charCodeAt(after - 1)))\n after = line.text.length;\n let buf = cx.buffer\n .write(Type.HeaderMark, 0, size)\n .writeElements(cx.parser.parseInline(line.text.slice(off + size + 1, after), from + size + 1), -from);\n if (after < line.text.length)\n buf.write(Type.HeaderMark, after - off, endOfSpace - off);\n let node = buf.finish(Type.ATXHeading1 - 1 + size, line.text.length - off);\n cx.nextLine();\n cx.addNode(node, from);\n return true;\n },\n HTMLBlock(cx, line) {\n let type = isHTMLBlock(line, cx, false);\n if (type < 0)\n return false;\n let from = cx.lineStart + line.pos, end = HTMLBlockStyle[type][1];\n let marks = [], trailing = end != EmptyLine;\n while (!end.test(line.text) && cx.nextLine()) {\n if (line.depth < cx.stack.length) {\n trailing = false;\n break;\n }\n for (let m of line.markers)\n marks.push(m);\n }\n if (trailing)\n cx.nextLine();\n let nodeType = end == CommentEnd ? Type.CommentBlock : end == ProcessingEnd ? Type.ProcessingInstructionBlock : Type.HTMLBlock;\n let to = cx.prevLineEnd();\n cx.addNode(cx.buffer.writeElements(marks, -from).finish(nodeType, to - from), from);\n return true;\n },\n SetextHeading: undefined // Specifies relative precedence for block-continue function\n };\n // This implements a state machine that incrementally parses link references. At each\n // next line, it looks ahead to see if the line continues the reference or not. If it\n // doesn't and a valid link is available ending before that line, it finishes that.\n // Similarly, on `finish` (when the leaf is terminated by external circumstances), it\n // creates a link reference if there's a valid reference up to the current point.\n class LinkReferenceParser {\n constructor(leaf) {\n this.stage = 0 /* RefStage.Start */;\n this.elts = [];\n this.pos = 0;\n this.start = leaf.start;\n this.advance(leaf.content);\n }\n nextLine(cx, line, leaf) {\n if (this.stage == -1 /* RefStage.Failed */)\n return false;\n let content = leaf.content + \"\\n\" + line.scrub();\n let finish = this.advance(content);\n if (finish > -1 && finish < content.length)\n return this.complete(cx, leaf, finish);\n return false;\n }\n finish(cx, leaf) {\n if ((this.stage == 2 /* RefStage.Link */ || this.stage == 3 /* RefStage.Title */) && skipSpace(leaf.content, this.pos) == leaf.content.length)\n return this.complete(cx, leaf, leaf.content.length);\n return false;\n }\n complete(cx, leaf, len) {\n cx.addLeafElement(leaf, elt(Type.LinkReference, this.start, this.start + len, this.elts));\n return true;\n }\n nextStage(elt) {\n if (elt) {\n this.pos = elt.to - this.start;\n this.elts.push(elt);\n this.stage++;\n return true;\n }\n if (elt === false)\n this.stage = -1 /* RefStage.Failed */;\n return false;\n }\n advance(content) {\n for (;;) {\n if (this.stage == -1 /* RefStage.Failed */) {\n return -1;\n }\n else if (this.stage == 0 /* RefStage.Start */) {\n if (!this.nextStage(parseLinkLabel(content, this.pos, this.start, true)))\n return -1;\n if (content.charCodeAt(this.pos) != 58 /* ':' */)\n return this.stage = -1 /* RefStage.Failed */;\n this.elts.push(elt(Type.LinkMark, this.pos + this.start, this.pos + this.start + 1));\n this.pos++;\n }\n else if (this.stage == 1 /* RefStage.Label */) {\n if (!this.nextStage(parseURL(content, skipSpace(content, this.pos), this.start)))\n return -1;\n }\n else if (this.stage == 2 /* RefStage.Link */) {\n let skip = skipSpace(content, this.pos), end = 0;\n if (skip > this.pos) {\n let title = parseLinkTitle(content, skip, this.start);\n if (title) {\n let titleEnd = lineEnd(content, title.to - this.start);\n if (titleEnd > 0) {\n this.nextStage(title);\n end = titleEnd;\n }\n }\n }\n if (!end)\n end = lineEnd(content, this.pos);\n return end > 0 && end < content.length ? end : -1;\n }\n else { // RefStage.Title\n return lineEnd(content, this.pos);\n }\n }\n }\n }\n function lineEnd(text, pos) {\n for (; pos < text.length; pos++) {\n let next = text.charCodeAt(pos);\n if (next == 10)\n break;\n if (!space$2(next))\n return -1;\n }\n return pos;\n }\n class SetextHeadingParser {\n nextLine(cx, line, leaf) {\n let underline = line.depth < cx.stack.length ? -1 : isSetextUnderline(line);\n let next = line.next;\n if (underline < 0)\n return false;\n let underlineMark = elt(Type.HeaderMark, cx.lineStart + line.pos, cx.lineStart + underline);\n cx.nextLine();\n cx.addLeafElement(leaf, elt(next == 61 ? Type.SetextHeading1 : Type.SetextHeading2, leaf.start, cx.prevLineEnd(), [\n ...cx.parser.parseInline(leaf.content, leaf.start),\n underlineMark\n ]));\n return true;\n }\n finish() {\n return false;\n }\n }\n const DefaultLeafBlocks = {\n LinkReference(_, leaf) { return leaf.content.charCodeAt(0) == 91 /* '[' */ ? new LinkReferenceParser(leaf) : null; },\n SetextHeading() { return new SetextHeadingParser; }\n };\n const DefaultEndLeaf = [\n (_, line) => isAtxHeading(line) >= 0,\n (_, line) => isFencedCode(line) >= 0,\n (_, line) => isBlockquote(line) >= 0,\n (p, line) => isBulletList(line, p, true) >= 0,\n (p, line) => isOrderedList(line, p, true) >= 0,\n (p, line) => isHorizontalRule(line, p, true) >= 0,\n (p, line) => isHTMLBlock(line, p, true) >= 0\n ];\n const scanLineResult = { text: \"\", end: 0 };\n /// Block-level parsing functions get access to this context object.\n class BlockContext {\n /// @internal\n constructor(\n /// The parser configuration used.\n parser, \n /// @internal\n input, fragments, \n /// @internal\n ranges) {\n this.parser = parser;\n this.input = input;\n this.ranges = ranges;\n this.line = new Line();\n this.atEnd = false;\n /// For reused nodes on gaps, we can't directly put the original\n /// node into the tree, since that may be bitter than its parent.\n /// When this happens, we create a dummy tree that is replaced by\n /// the proper node in `injectGaps` @internal\n this.reusePlaceholders = new Map;\n this.stoppedAt = null;\n /// The range index that absoluteLineStart points into @internal\n this.rangeI = 0;\n this.to = ranges[ranges.length - 1].to;\n this.lineStart = this.absoluteLineStart = this.absoluteLineEnd = ranges[0].from;\n this.block = CompositeBlock.create(Type.Document, 0, this.lineStart, 0, 0);\n this.stack = [this.block];\n this.fragments = fragments.length ? new FragmentCursor$1(fragments, input) : null;\n this.readLine();\n }\n get parsedPos() {\n return this.absoluteLineStart;\n }\n advance() {\n if (this.stoppedAt != null && this.absoluteLineStart > this.stoppedAt)\n return this.finish();\n let { line } = this;\n for (;;) {\n for (let markI = 0;;) {\n let next = line.depth < this.stack.length ? this.stack[this.stack.length - 1] : null;\n while (markI < line.markers.length && (!next || line.markers[markI].from < next.end)) {\n let mark = line.markers[markI++];\n this.addNode(mark.type, mark.from, mark.to);\n }\n if (!next)\n break;\n this.finishContext();\n }\n if (line.pos < line.text.length)\n break;\n // Empty line\n if (!this.nextLine())\n return this.finish();\n }\n if (this.fragments && this.reuseFragment(line.basePos))\n return null;\n start: for (;;) {\n for (let type of this.parser.blockParsers)\n if (type) {\n let result = type(this, line);\n if (result != false) {\n if (result == true)\n return null;\n line.forward();\n continue start;\n }\n }\n break;\n }\n let leaf = new LeafBlock(this.lineStart + line.pos, line.text.slice(line.pos));\n for (let parse of this.parser.leafBlockParsers)\n if (parse) {\n let parser = parse(this, leaf);\n if (parser)\n leaf.parsers.push(parser);\n }\n lines: while (this.nextLine()) {\n if (line.pos == line.text.length)\n break;\n if (line.indent < line.baseIndent + 4) {\n for (let stop of this.parser.endLeafBlock)\n if (stop(this, line, leaf))\n break lines;\n }\n for (let parser of leaf.parsers)\n if (parser.nextLine(this, line, leaf))\n return null;\n leaf.content += \"\\n\" + line.scrub();\n for (let m of line.markers)\n leaf.marks.push(m);\n }\n this.finishLeaf(leaf);\n return null;\n }\n stopAt(pos) {\n if (this.stoppedAt != null && this.stoppedAt < pos)\n throw new RangeError(\"Can't move stoppedAt forward\");\n this.stoppedAt = pos;\n }\n reuseFragment(start) {\n if (!this.fragments.moveTo(this.absoluteLineStart + start, this.absoluteLineStart) ||\n !this.fragments.matches(this.block.hash))\n return false;\n let taken = this.fragments.takeNodes(this);\n if (!taken)\n return false;\n this.absoluteLineStart += taken;\n this.lineStart = toRelative(this.absoluteLineStart, this.ranges);\n this.moveRangeI();\n if (this.absoluteLineStart < this.to) {\n this.lineStart++;\n this.absoluteLineStart++;\n this.readLine();\n }\n else {\n this.atEnd = true;\n this.readLine();\n }\n return true;\n }\n /// The number of parent blocks surrounding the current block.\n get depth() {\n return this.stack.length;\n }\n /// Get the type of the parent block at the given depth. When no\n /// depth is passed, return the type of the innermost parent.\n parentType(depth = this.depth - 1) {\n return this.parser.nodeSet.types[this.stack[depth].type];\n }\n /// Move to the next input line. This should only be called by\n /// (non-composite) [block parsers](#BlockParser.parse) that consume\n /// the line directly, or leaf block parser\n /// [`nextLine`](#LeafBlockParser.nextLine) methods when they\n /// consume the current line (and return true).\n nextLine() {\n this.lineStart += this.line.text.length;\n if (this.absoluteLineEnd >= this.to) {\n this.absoluteLineStart = this.absoluteLineEnd;\n this.atEnd = true;\n this.readLine();\n return false;\n }\n else {\n this.lineStart++;\n this.absoluteLineStart = this.absoluteLineEnd + 1;\n this.moveRangeI();\n this.readLine();\n return true;\n }\n }\n moveRangeI() {\n while (this.rangeI < this.ranges.length - 1 && this.absoluteLineStart >= this.ranges[this.rangeI].to) {\n this.rangeI++;\n this.absoluteLineStart = Math.max(this.absoluteLineStart, this.ranges[this.rangeI].from);\n }\n }\n /// @internal\n scanLine(start) {\n let r = scanLineResult;\n r.end = start;\n if (start >= this.to) {\n r.text = \"\";\n }\n else {\n r.text = this.lineChunkAt(start);\n r.end += r.text.length;\n if (this.ranges.length > 1) {\n let textOffset = this.absoluteLineStart, rangeI = this.rangeI;\n while (this.ranges[rangeI].to < r.end) {\n rangeI++;\n let nextFrom = this.ranges[rangeI].from;\n let after = this.lineChunkAt(nextFrom);\n r.end = nextFrom + after.length;\n r.text = r.text.slice(0, this.ranges[rangeI - 1].to - textOffset) + after;\n textOffset = r.end - r.text.length;\n }\n }\n }\n return r;\n }\n /// @internal\n readLine() {\n let { line } = this, { text, end } = this.scanLine(this.absoluteLineStart);\n this.absoluteLineEnd = end;\n line.reset(text);\n for (; line.depth < this.stack.length; line.depth++) {\n let cx = this.stack[line.depth], handler = this.parser.skipContextMarkup[cx.type];\n if (!handler)\n throw new Error(\"Unhandled block context \" + Type[cx.type]);\n if (!handler(cx, this, line))\n break;\n line.forward();\n }\n }\n lineChunkAt(pos) {\n let next = this.input.chunk(pos), text;\n if (!this.input.lineChunks) {\n let eol = next.indexOf(\"\\n\");\n text = eol < 0 ? next : next.slice(0, eol);\n }\n else {\n text = next == \"\\n\" ? \"\" : next;\n }\n return pos + text.length > this.to ? text.slice(0, this.to - pos) : text;\n }\n /// The end position of the previous line.\n prevLineEnd() { return this.atEnd ? this.lineStart : this.lineStart - 1; }\n /// @internal\n startContext(type, start, value = 0) {\n this.block = CompositeBlock.create(type, value, this.lineStart + start, this.block.hash, this.lineStart + this.line.text.length);\n this.stack.push(this.block);\n }\n /// Start a composite block. Should only be called from [block\n /// parser functions](#BlockParser.parse) that return null.\n startComposite(type, start, value = 0) {\n this.startContext(this.parser.getNodeType(type), start, value);\n }\n /// @internal\n addNode(block, from, to) {\n if (typeof block == \"number\")\n block = new Tree(this.parser.nodeSet.types[block], none, none, (to !== null && to !== void 0 ? to : this.prevLineEnd()) - from);\n this.block.addChild(block, from - this.block.from);\n }\n /// Add a block element. Can be called by [block\n /// parsers](#BlockParser.parse).\n addElement(elt) {\n this.block.addChild(elt.toTree(this.parser.nodeSet), elt.from - this.block.from);\n }\n /// Add a block element from a [leaf parser](#LeafBlockParser). This\n /// makes sure any extra composite block markup (such as blockquote\n /// markers) inside the block are also added to the syntax tree.\n addLeafElement(leaf, elt) {\n this.addNode(this.buffer\n .writeElements(injectMarks(elt.children, leaf.marks), -elt.from)\n .finish(elt.type, elt.to - elt.from), elt.from);\n }\n /// @internal\n finishContext() {\n let cx = this.stack.pop();\n let top = this.stack[this.stack.length - 1];\n top.addChild(cx.toTree(this.parser.nodeSet), cx.from - top.from);\n this.block = top;\n }\n finish() {\n while (this.stack.length > 1)\n this.finishContext();\n return this.addGaps(this.block.toTree(this.parser.nodeSet, this.lineStart));\n }\n addGaps(tree) {\n return this.ranges.length > 1 ?\n injectGaps(this.ranges, 0, tree.topNode, this.ranges[0].from, this.reusePlaceholders) : tree;\n }\n /// @internal\n finishLeaf(leaf) {\n for (let parser of leaf.parsers)\n if (parser.finish(this, leaf))\n return;\n let inline = injectMarks(this.parser.parseInline(leaf.content, leaf.start), leaf.marks);\n this.addNode(this.buffer\n .writeElements(inline, -leaf.start)\n .finish(Type.Paragraph, leaf.content.length), leaf.start);\n }\n elt(type, from, to, children) {\n if (typeof type == \"string\")\n return elt(this.parser.getNodeType(type), from, to, children);\n return new TreeElement(type, from);\n }\n /// @internal\n get buffer() { return new Buffer(this.parser.nodeSet); }\n }\n function injectGaps(ranges, rangeI, tree, offset, dummies) {\n let rangeEnd = ranges[rangeI].to;\n let children = [], positions = [], start = tree.from + offset;\n function movePastNext(upto, inclusive) {\n while (inclusive ? upto >= rangeEnd : upto > rangeEnd) {\n let size = ranges[rangeI + 1].from - rangeEnd;\n offset += size;\n upto += size;\n rangeI++;\n rangeEnd = ranges[rangeI].to;\n }\n }\n for (let ch = tree.firstChild; ch; ch = ch.nextSibling) {\n movePastNext(ch.from + offset, true);\n let from = ch.from + offset, node, reuse = dummies.get(ch.tree);\n if (reuse) {\n node = reuse;\n }\n else if (ch.to + offset > rangeEnd) {\n node = injectGaps(ranges, rangeI, ch, offset, dummies);\n movePastNext(ch.to + offset, false);\n }\n else {\n node = ch.toTree();\n }\n children.push(node);\n positions.push(from - start);\n }\n movePastNext(tree.to + offset, false);\n return new Tree(tree.type, children, positions, tree.to + offset - start, tree.tree ? tree.tree.propValues : undefined);\n }\n /// A Markdown parser configuration.\n class MarkdownParser extends Parser {\n /// @internal\n constructor(\n /// The parser's syntax [node\n /// types](https://lezer.codemirror.net/docs/ref/#common.NodeSet).\n nodeSet, \n /// @internal\n blockParsers, \n /// @internal\n leafBlockParsers, \n /// @internal\n blockNames, \n /// @internal\n endLeafBlock, \n /// @internal\n skipContextMarkup, \n /// @internal\n inlineParsers, \n /// @internal\n inlineNames, \n /// @internal\n wrappers) {\n super();\n this.nodeSet = nodeSet;\n this.blockParsers = blockParsers;\n this.leafBlockParsers = leafBlockParsers;\n this.blockNames = blockNames;\n this.endLeafBlock = endLeafBlock;\n this.skipContextMarkup = skipContextMarkup;\n this.inlineParsers = inlineParsers;\n this.inlineNames = inlineNames;\n this.wrappers = wrappers;\n /// @internal\n this.nodeTypes = Object.create(null);\n for (let t of nodeSet.types)\n this.nodeTypes[t.name] = t.id;\n }\n createParse(input, fragments, ranges) {\n let parse = new BlockContext(this, input, fragments, ranges);\n for (let w of this.wrappers)\n parse = w(parse, input, fragments, ranges);\n return parse;\n }\n /// Reconfigure the parser.\n configure(spec) {\n let config = resolveConfig$1(spec);\n if (!config)\n return this;\n let { nodeSet, skipContextMarkup } = this;\n let blockParsers = this.blockParsers.slice(), leafBlockParsers = this.leafBlockParsers.slice(), blockNames = this.blockNames.slice(), inlineParsers = this.inlineParsers.slice(), inlineNames = this.inlineNames.slice(), endLeafBlock = this.endLeafBlock.slice(), wrappers = this.wrappers;\n if (nonEmpty(config.defineNodes)) {\n skipContextMarkup = Object.assign({}, skipContextMarkup);\n let nodeTypes = nodeSet.types.slice(), styles;\n for (let s of config.defineNodes) {\n let { name, block, composite, style } = typeof s == \"string\" ? { name: s } : s;\n if (nodeTypes.some(t => t.name == name))\n continue;\n if (composite)\n skipContextMarkup[nodeTypes.length] =\n (bl, cx, line) => composite(cx, line, bl.value);\n let id = nodeTypes.length;\n let group = composite ? [\"Block\", \"BlockContext\"] : !block ? undefined\n : id >= Type.ATXHeading1 && id <= Type.SetextHeading2 ? [\"Block\", \"LeafBlock\", \"Heading\"] : [\"Block\", \"LeafBlock\"];\n nodeTypes.push(NodeType.define({\n id,\n name,\n props: group && [[NodeProp.group, group]]\n }));\n if (style) {\n if (!styles)\n styles = {};\n if (Array.isArray(style) || style instanceof Tag)\n styles[name] = style;\n else\n Object.assign(styles, style);\n }\n }\n nodeSet = new NodeSet(nodeTypes);\n if (styles)\n nodeSet = nodeSet.extend(styleTags(styles));\n }\n if (nonEmpty(config.props))\n nodeSet = nodeSet.extend(...config.props);\n if (nonEmpty(config.remove)) {\n for (let rm of config.remove) {\n let block = this.blockNames.indexOf(rm), inline = this.inlineNames.indexOf(rm);\n if (block > -1)\n blockParsers[block] = leafBlockParsers[block] = undefined;\n if (inline > -1)\n inlineParsers[inline] = undefined;\n }\n }\n if (nonEmpty(config.parseBlock)) {\n for (let spec of config.parseBlock) {\n let found = blockNames.indexOf(spec.name);\n if (found > -1) {\n blockParsers[found] = spec.parse;\n leafBlockParsers[found] = spec.leaf;\n }\n else {\n let pos = spec.before ? findName(blockNames, spec.before)\n : spec.after ? findName(blockNames, spec.after) + 1 : blockNames.length - 1;\n blockParsers.splice(pos, 0, spec.parse);\n leafBlockParsers.splice(pos, 0, spec.leaf);\n blockNames.splice(pos, 0, spec.name);\n }\n if (spec.endLeaf)\n endLeafBlock.push(spec.endLeaf);\n }\n }\n if (nonEmpty(config.parseInline)) {\n for (let spec of config.parseInline) {\n let found = inlineNames.indexOf(spec.name);\n if (found > -1) {\n inlineParsers[found] = spec.parse;\n }\n else {\n let pos = spec.before ? findName(inlineNames, spec.before)\n : spec.after ? findName(inlineNames, spec.after) + 1 : inlineNames.length - 1;\n inlineParsers.splice(pos, 0, spec.parse);\n inlineNames.splice(pos, 0, spec.name);\n }\n }\n }\n if (config.wrap)\n wrappers = wrappers.concat(config.wrap);\n return new MarkdownParser(nodeSet, blockParsers, leafBlockParsers, blockNames, endLeafBlock, skipContextMarkup, inlineParsers, inlineNames, wrappers);\n }\n /// @internal\n getNodeType(name) {\n let found = this.nodeTypes[name];\n if (found == null)\n throw new RangeError(`Unknown node type '${name}'`);\n return found;\n }\n /// Parse the given piece of inline text at the given offset,\n /// returning an array of [`Element`](#Element) objects representing\n /// the inline content.\n parseInline(text, offset) {\n let cx = new InlineContext(this, text, offset);\n outer: for (let pos = offset; pos < cx.end;) {\n let next = cx.char(pos);\n for (let token of this.inlineParsers)\n if (token) {\n let result = token(cx, next, pos);\n if (result >= 0) {\n pos = result;\n continue outer;\n }\n }\n pos++;\n }\n return cx.resolveMarkers(0);\n }\n }\n function nonEmpty(a) {\n return a != null && a.length > 0;\n }\n function resolveConfig$1(spec) {\n if (!Array.isArray(spec))\n return spec;\n if (spec.length == 0)\n return null;\n let conf = resolveConfig$1(spec[0]);\n if (spec.length == 1)\n return conf;\n let rest = resolveConfig$1(spec.slice(1));\n if (!rest || !conf)\n return conf || rest;\n let conc = (a, b) => (a || none).concat(b || none);\n let wrapA = conf.wrap, wrapB = rest.wrap;\n return {\n props: conc(conf.props, rest.props),\n defineNodes: conc(conf.defineNodes, rest.defineNodes),\n parseBlock: conc(conf.parseBlock, rest.parseBlock),\n parseInline: conc(conf.parseInline, rest.parseInline),\n remove: conc(conf.remove, rest.remove),\n wrap: !wrapA ? wrapB : !wrapB ? wrapA :\n (inner, input, fragments, ranges) => wrapA(wrapB(inner, input, fragments, ranges), input, fragments, ranges)\n };\n }\n function findName(names, name) {\n let found = names.indexOf(name);\n if (found < 0)\n throw new RangeError(`Position specified relative to unknown parser ${name}`);\n return found;\n }\n let nodeTypes = [NodeType.none];\n for (let i = 1, name; name = Type[i]; i++) {\n nodeTypes[i] = NodeType.define({\n id: i,\n name,\n props: i >= Type.Escape ? [] : [[NodeProp.group, i in DefaultSkipMarkup ? [\"Block\", \"BlockContext\"] : [\"Block\", \"LeafBlock\"]]],\n top: name == \"Document\"\n });\n }\n const none = [];\n class Buffer {\n constructor(nodeSet) {\n this.nodeSet = nodeSet;\n this.content = [];\n this.nodes = [];\n }\n write(type, from, to, children = 0) {\n this.content.push(type, from, to, 4 + children * 4);\n return this;\n }\n writeElements(elts, offset = 0) {\n for (let e of elts)\n e.writeTo(this, offset);\n return this;\n }\n finish(type, length) {\n return Tree.build({\n buffer: this.content,\n nodeSet: this.nodeSet,\n reused: this.nodes,\n topID: type,\n length\n });\n }\n }\n /// Elements are used to compose syntax nodes during parsing.\n class Element$1 {\n /// @internal\n constructor(\n /// The node's\n /// [id](https://lezer.codemirror.net/docs/ref/#common.NodeType.id).\n type, \n /// The start of the node, as an offset from the start of the document.\n from, \n /// The end of the node.\n to, \n /// The node's child nodes @internal\n children = none) {\n this.type = type;\n this.from = from;\n this.to = to;\n this.children = children;\n }\n /// @internal\n writeTo(buf, offset) {\n let startOff = buf.content.length;\n buf.writeElements(this.children, offset);\n buf.content.push(this.type, this.from + offset, this.to + offset, buf.content.length + 4 - startOff);\n }\n /// @internal\n toTree(nodeSet) {\n return new Buffer(nodeSet).writeElements(this.children, -this.from).finish(this.type, this.to - this.from);\n }\n }\n class TreeElement {\n constructor(tree, from) {\n this.tree = tree;\n this.from = from;\n }\n get to() { return this.from + this.tree.length; }\n get type() { return this.tree.type.id; }\n get children() { return none; }\n writeTo(buf, offset) {\n buf.nodes.push(this.tree);\n buf.content.push(buf.nodes.length - 1, this.from + offset, this.to + offset, -1);\n }\n toTree() { return this.tree; }\n }\n function elt(type, from, to, children) {\n return new Element$1(type, from, to, children);\n }\n const EmphasisUnderscore = { resolve: \"Emphasis\", mark: \"EmphasisMark\" };\n const EmphasisAsterisk = { resolve: \"Emphasis\", mark: \"EmphasisMark\" };\n const LinkStart = {}, ImageStart = {};\n class InlineDelimiter {\n constructor(type, from, to, side) {\n this.type = type;\n this.from = from;\n this.to = to;\n this.side = side;\n }\n }\n const Escapable = \"!\\\"#$%&'()*+,-./:;<=>?@[\\\\]^_`{|}~\";\n let Punctuation = /[!\"#$%&'()*+,\\-.\\/:;<=>?@\\[\\\\\\]^_`{|}~\\xA1\\u2010-\\u2027]/;\n try {\n Punctuation = new RegExp(\"[\\\\p{Pc}|\\\\p{Pd}|\\\\p{Pe}|\\\\p{Pf}|\\\\p{Pi}|\\\\p{Po}|\\\\p{Ps}]\", \"u\");\n }\n catch (_) { }\n const DefaultInline = {\n Escape(cx, next, start) {\n if (next != 92 /* '\\\\' */ || start == cx.end - 1)\n return -1;\n let escaped = cx.char(start + 1);\n for (let i = 0; i < Escapable.length; i++)\n if (Escapable.charCodeAt(i) == escaped)\n return cx.append(elt(Type.Escape, start, start + 2));\n return -1;\n },\n Entity(cx, next, start) {\n if (next != 38 /* '&' */)\n return -1;\n let m = /^(?:#\\d+|#x[a-f\\d]+|\\w+);/i.exec(cx.slice(start + 1, start + 31));\n return m ? cx.append(elt(Type.Entity, start, start + 1 + m[0].length)) : -1;\n },\n InlineCode(cx, next, start) {\n if (next != 96 /* '`' */ || start && cx.char(start - 1) == 96)\n return -1;\n let pos = start + 1;\n while (pos < cx.end && cx.char(pos) == 96)\n pos++;\n let size = pos - start, curSize = 0;\n for (; pos < cx.end; pos++) {\n if (cx.char(pos) == 96) {\n curSize++;\n if (curSize == size && cx.char(pos + 1) != 96)\n return cx.append(elt(Type.InlineCode, start, pos + 1, [\n elt(Type.CodeMark, start, start + size),\n elt(Type.CodeMark, pos + 1 - size, pos + 1)\n ]));\n }\n else {\n curSize = 0;\n }\n }\n return -1;\n },\n HTMLTag(cx, next, start) {\n if (next != 60 /* '<' */ || start == cx.end - 1)\n return -1;\n let after = cx.slice(start + 1, cx.end);\n let url = /^(?:[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(after);\n if (url) {\n return cx.append(elt(Type.Autolink, start, start + 1 + url[0].length, [\n elt(Type.LinkMark, start, start + 1),\n // url[0] includes the closing bracket, so exclude it from this slice\n elt(Type.URL, start + 1, start + url[0].length),\n elt(Type.LinkMark, start + url[0].length, start + 1 + url[0].length)\n ]));\n }\n let comment = /^!--[^>](?:-[^-]|[^-])*?-->/i.exec(after);\n if (comment)\n return cx.append(elt(Type.Comment, start, start + 1 + comment[0].length));\n let procInst = /^\\?[^]*?\\?>/.exec(after);\n if (procInst)\n return cx.append(elt(Type.ProcessingInstruction, start, start + 1 + procInst[0].length));\n let m = /^(?:![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(after);\n if (!m)\n return -1;\n return cx.append(elt(Type.HTMLTag, start, start + 1 + m[0].length));\n },\n Emphasis(cx, next, start) {\n if (next != 95 && next != 42)\n return -1;\n let pos = start + 1;\n while (cx.char(pos) == next)\n pos++;\n let before = cx.slice(start - 1, start), after = cx.slice(pos, pos + 1);\n let pBefore = Punctuation.test(before), pAfter = Punctuation.test(after);\n let sBefore = /\\s|^$/.test(before), sAfter = /\\s|^$/.test(after);\n let leftFlanking = !sAfter && (!pAfter || sBefore || pBefore);\n let rightFlanking = !sBefore && (!pBefore || sAfter || pAfter);\n let canOpen = leftFlanking && (next == 42 || !rightFlanking || pBefore);\n let canClose = rightFlanking && (next == 42 || !leftFlanking || pAfter);\n return cx.append(new InlineDelimiter(next == 95 ? EmphasisUnderscore : EmphasisAsterisk, start, pos, (canOpen ? 1 /* Mark.Open */ : 0 /* Mark.None */) | (canClose ? 2 /* Mark.Close */ : 0 /* Mark.None */)));\n },\n HardBreak(cx, next, start) {\n if (next == 92 /* '\\\\' */ && cx.char(start + 1) == 10 /* '\\n' */)\n return cx.append(elt(Type.HardBreak, start, start + 2));\n if (next == 32) {\n let pos = start + 1;\n while (cx.char(pos) == 32)\n pos++;\n if (cx.char(pos) == 10 && pos >= start + 2)\n return cx.append(elt(Type.HardBreak, start, pos + 1));\n }\n return -1;\n },\n Link(cx, next, start) {\n return next == 91 /* '[' */ ? cx.append(new InlineDelimiter(LinkStart, start, start + 1, 1 /* Mark.Open */)) : -1;\n },\n Image(cx, next, start) {\n return next == 33 /* '!' */ && cx.char(start + 1) == 91 /* '[' */\n ? cx.append(new InlineDelimiter(ImageStart, start, start + 2, 1 /* Mark.Open */)) : -1;\n },\n LinkEnd(cx, next, start) {\n if (next != 93 /* ']' */)\n return -1;\n // Scanning back to the next link/image start marker\n for (let i = cx.parts.length - 1; i >= 0; i--) {\n let part = cx.parts[i];\n if (part instanceof InlineDelimiter && (part.type == LinkStart || part.type == ImageStart)) {\n // If this one has been set invalid (because it would produce\n // a nested link) or there's no valid link here ignore both.\n if (!part.side || cx.skipSpace(part.to) == start && !/[(\\[]/.test(cx.slice(start + 1, start + 2))) {\n cx.parts[i] = null;\n return -1;\n }\n // Finish the content and replace the entire range in\n // this.parts with the link/image node.\n let content = cx.takeContent(i);\n let link = cx.parts[i] = finishLink(cx, content, part.type == LinkStart ? Type.Link : Type.Image, part.from, start + 1);\n // Set any open-link markers before this link to invalid.\n if (part.type == LinkStart)\n for (let j = 0; j < i; j++) {\n let p = cx.parts[j];\n if (p instanceof InlineDelimiter && p.type == LinkStart)\n p.side = 0 /* Mark.None */;\n }\n return link.to;\n }\n }\n return -1;\n }\n };\n function finishLink(cx, content, type, start, startPos) {\n let { text } = cx, next = cx.char(startPos), endPos = startPos;\n content.unshift(elt(Type.LinkMark, start, start + (type == Type.Image ? 2 : 1)));\n content.push(elt(Type.LinkMark, startPos - 1, startPos));\n if (next == 40 /* '(' */) {\n let pos = cx.skipSpace(startPos + 1);\n let dest = parseURL(text, pos - cx.offset, cx.offset), title;\n if (dest) {\n pos = cx.skipSpace(dest.to);\n // The destination and title must be separated by whitespace\n if (pos != dest.to) {\n title = parseLinkTitle(text, pos - cx.offset, cx.offset);\n if (title)\n pos = cx.skipSpace(title.to);\n }\n }\n if (cx.char(pos) == 41 /* ')' */) {\n content.push(elt(Type.LinkMark, startPos, startPos + 1));\n endPos = pos + 1;\n if (dest)\n content.push(dest);\n if (title)\n content.push(title);\n content.push(elt(Type.LinkMark, pos, endPos));\n }\n }\n else if (next == 91 /* '[' */) {\n let label = parseLinkLabel(text, startPos - cx.offset, cx.offset, false);\n if (label) {\n content.push(label);\n endPos = label.to;\n }\n }\n return elt(type, start, endPos, content);\n }\n // These return `null` when falling off the end of the input, `false`\n // when parsing fails otherwise (for use in the incremental link\n // reference parser).\n function parseURL(text, start, offset) {\n let next = text.charCodeAt(start);\n if (next == 60 /* '<' */) {\n for (let pos = start + 1; pos < text.length; pos++) {\n let ch = text.charCodeAt(pos);\n if (ch == 62 /* '>' */)\n return elt(Type.URL, start + offset, pos + 1 + offset);\n if (ch == 60 || ch == 10 /* '<\\n' */)\n return false;\n }\n return null;\n }\n else {\n let depth = 0, pos = start;\n for (let escaped = false; pos < text.length; pos++) {\n let ch = text.charCodeAt(pos);\n if (space$2(ch)) {\n break;\n }\n else if (escaped) {\n escaped = false;\n }\n else if (ch == 40 /* '(' */) {\n depth++;\n }\n else if (ch == 41 /* ')' */) {\n if (!depth)\n break;\n depth--;\n }\n else if (ch == 92 /* '\\\\' */) {\n escaped = true;\n }\n }\n return pos > start ? elt(Type.URL, start + offset, pos + offset) : pos == text.length ? null : false;\n }\n }\n function parseLinkTitle(text, start, offset) {\n let next = text.charCodeAt(start);\n if (next != 39 && next != 34 && next != 40 /* '\"\\'(' */)\n return false;\n let end = next == 40 ? 41 : next;\n for (let pos = start + 1, escaped = false; pos < text.length; pos++) {\n let ch = text.charCodeAt(pos);\n if (escaped)\n escaped = false;\n else if (ch == end)\n return elt(Type.LinkTitle, start + offset, pos + 1 + offset);\n else if (ch == 92 /* '\\\\' */)\n escaped = true;\n }\n return null;\n }\n function parseLinkLabel(text, start, offset, requireNonWS) {\n for (let escaped = false, pos = start + 1, end = Math.min(text.length, pos + 999); pos < end; pos++) {\n let ch = text.charCodeAt(pos);\n if (escaped)\n escaped = false;\n else if (ch == 93 /* ']' */)\n return requireNonWS ? false : elt(Type.LinkLabel, start + offset, pos + 1 + offset);\n else {\n if (requireNonWS && !space$2(ch))\n requireNonWS = false;\n if (ch == 91 /* '[' */)\n return false;\n else if (ch == 92 /* '\\\\' */)\n escaped = true;\n }\n }\n return null;\n }\n /// Inline parsing functions get access to this context, and use it to\n /// read the content and emit syntax nodes.\n class InlineContext {\n /// @internal\n constructor(\n /// The parser that is being used.\n parser, \n /// The text of this inline section.\n text, \n /// The starting offset of the section in the document.\n offset) {\n this.parser = parser;\n this.text = text;\n this.offset = offset;\n /// @internal\n this.parts = [];\n }\n /// Get the character code at the given (document-relative)\n /// position.\n char(pos) { return pos >= this.end ? -1 : this.text.charCodeAt(pos - this.offset); }\n /// The position of the end of this inline section.\n get end() { return this.offset + this.text.length; }\n /// Get a substring of this inline section. Again uses\n /// document-relative positions.\n slice(from, to) { return this.text.slice(from - this.offset, to - this.offset); }\n /// @internal\n append(elt) {\n this.parts.push(elt);\n return elt.to;\n }\n /// Add a [delimiter](#DelimiterType) at this given position. `open`\n /// and `close` indicate whether this delimiter is opening, closing,\n /// or both. Returns the end of the delimiter, for convenient\n /// returning from [parse functions](#InlineParser.parse).\n addDelimiter(type, from, to, open, close) {\n return this.append(new InlineDelimiter(type, from, to, (open ? 1 /* Mark.Open */ : 0 /* Mark.None */) | (close ? 2 /* Mark.Close */ : 0 /* Mark.None */)));\n }\n /// Returns true when there is an unmatched link or image opening\n /// token before the current position.\n get hasOpenLink() {\n for (let i = this.parts.length - 1; i >= 0; i--) {\n let part = this.parts[i];\n if (part instanceof InlineDelimiter && (part.type == LinkStart || part.type == ImageStart))\n return true;\n }\n return false;\n }\n /// Add an inline element. Returns the end of the element.\n addElement(elt) {\n return this.append(elt);\n }\n /// Resolve markers between this.parts.length and from, wrapping matched markers in the\n /// appropriate node and updating the content of this.parts. @internal\n resolveMarkers(from) {\n // Scan forward, looking for closing tokens\n for (let i = from; i < this.parts.length; i++) {\n let close = this.parts[i];\n if (!(close instanceof InlineDelimiter && close.type.resolve && (close.side & 2 /* Mark.Close */)))\n continue;\n let emp = close.type == EmphasisUnderscore || close.type == EmphasisAsterisk;\n let closeSize = close.to - close.from;\n let open, j = i - 1;\n // Continue scanning for a matching opening token\n for (; j >= from; j--) {\n let part = this.parts[j];\n if (part instanceof InlineDelimiter && (part.side & 1 /* Mark.Open */) && part.type == close.type &&\n // Ignore emphasis delimiters where the character count doesn't match\n !(emp && ((close.side & 1 /* Mark.Open */) || (part.side & 2 /* Mark.Close */)) &&\n (part.to - part.from + closeSize) % 3 == 0 && ((part.to - part.from) % 3 || closeSize % 3))) {\n open = part;\n break;\n }\n }\n if (!open)\n continue;\n let type = close.type.resolve, content = [];\n let start = open.from, end = close.to;\n // Emphasis marker effect depends on the character count. Size consumed is minimum of the two\n // markers.\n if (emp) {\n let size = Math.min(2, open.to - open.from, closeSize);\n start = open.to - size;\n end = close.from + size;\n type = size == 1 ? \"Emphasis\" : \"StrongEmphasis\";\n }\n // Move the covered region into content, optionally adding marker nodes\n if (open.type.mark)\n content.push(this.elt(open.type.mark, start, open.to));\n for (let k = j + 1; k < i; k++) {\n if (this.parts[k] instanceof Element$1)\n content.push(this.parts[k]);\n this.parts[k] = null;\n }\n if (close.type.mark)\n content.push(this.elt(close.type.mark, close.from, end));\n let element = this.elt(type, start, end, content);\n // If there are leftover emphasis marker characters, shrink the close/open markers. Otherwise, clear them.\n this.parts[j] = emp && open.from != start ? new InlineDelimiter(open.type, open.from, start, open.side) : null;\n let keep = this.parts[i] = emp && close.to != end ? new InlineDelimiter(close.type, end, close.to, close.side) : null;\n // Insert the new element in this.parts\n if (keep)\n this.parts.splice(i, 0, element);\n else\n this.parts[i] = element;\n }\n // Collect the elements remaining in this.parts into an array.\n let result = [];\n for (let i = from; i < this.parts.length; i++) {\n let part = this.parts[i];\n if (part instanceof Element$1)\n result.push(part);\n }\n return result;\n }\n /// Find an opening delimiter of the given type. Returns `null` if\n /// no delimiter is found, or an index that can be passed to\n /// [`takeContent`](#InlineContext.takeContent) otherwise.\n findOpeningDelimiter(type) {\n for (let i = this.parts.length - 1; i >= 0; i--) {\n let part = this.parts[i];\n if (part instanceof InlineDelimiter && part.type == type)\n return i;\n }\n return null;\n }\n /// Remove all inline elements and delimiters starting from the\n /// given index (which you should get from\n /// [`findOpeningDelimiter`](#InlineContext.findOpeningDelimiter),\n /// resolve delimiters inside of them, and return them as an array\n /// of elements.\n takeContent(startIndex) {\n let content = this.resolveMarkers(startIndex);\n this.parts.length = startIndex;\n return content;\n }\n /// Skip space after the given (document) position, returning either\n /// the position of the next non-space character or the end of the\n /// section.\n skipSpace(from) { return skipSpace(this.text, from - this.offset) + this.offset; }\n elt(type, from, to, children) {\n if (typeof type == \"string\")\n return elt(this.parser.getNodeType(type), from, to, children);\n return new TreeElement(type, from);\n }\n }\n function injectMarks(elements, marks) {\n if (!marks.length)\n return elements;\n if (!elements.length)\n return marks;\n let elts = elements.slice(), eI = 0;\n for (let mark of marks) {\n while (eI < elts.length && elts[eI].to < mark.to)\n eI++;\n if (eI < elts.length && elts[eI].from < mark.from) {\n let e = elts[eI];\n if (e instanceof Element$1)\n elts[eI] = new Element$1(e.type, e.from, e.to, injectMarks(e.children, [mark]));\n }\n else {\n elts.splice(eI++, 0, mark);\n }\n }\n return elts;\n }\n // These are blocks that can span blank lines, and should thus only be\n // reused if their next sibling is also being reused.\n const NotLast = [Type.CodeBlock, Type.ListItem, Type.OrderedList, Type.BulletList];\n class FragmentCursor$1 {\n constructor(fragments, input) {\n this.fragments = fragments;\n this.input = input;\n // Index into fragment array\n this.i = 0;\n // Active fragment\n this.fragment = null;\n this.fragmentEnd = -1;\n // Cursor into the current fragment, if any. When `moveTo` returns\n // true, this points at the first block after `pos`.\n this.cursor = null;\n if (fragments.length)\n this.fragment = fragments[this.i++];\n }\n nextFragment() {\n this.fragment = this.i < this.fragments.length ? this.fragments[this.i++] : null;\n this.cursor = null;\n this.fragmentEnd = -1;\n }\n moveTo(pos, lineStart) {\n while (this.fragment && this.fragment.to <= pos)\n this.nextFragment();\n if (!this.fragment || this.fragment.from > (pos ? pos - 1 : 0))\n return false;\n if (this.fragmentEnd < 0) {\n let end = this.fragment.to;\n while (end > 0 && this.input.read(end - 1, end) != \"\\n\")\n end--;\n this.fragmentEnd = end ? end - 1 : 0;\n }\n let c = this.cursor;\n if (!c) {\n c = this.cursor = this.fragment.tree.cursor();\n c.firstChild();\n }\n let rPos = pos + this.fragment.offset;\n while (c.to <= rPos)\n if (!c.parent())\n return false;\n for (;;) {\n if (c.from >= rPos)\n return this.fragment.from <= lineStart;\n if (!c.childAfter(rPos))\n return false;\n }\n }\n matches(hash) {\n let tree = this.cursor.tree;\n return tree && tree.prop(NodeProp.contextHash) == hash;\n }\n takeNodes(cx) {\n let cur = this.cursor, off = this.fragment.offset, fragEnd = this.fragmentEnd - (this.fragment.openEnd ? 1 : 0);\n let start = cx.absoluteLineStart, end = start, blockI = cx.block.children.length;\n let prevEnd = end, prevI = blockI;\n for (;;) {\n if (cur.to - off > fragEnd) {\n if (cur.type.isAnonymous && cur.firstChild())\n continue;\n break;\n }\n let pos = toRelative(cur.from - off, cx.ranges);\n if (cur.to - off <= cx.ranges[cx.rangeI].to) { // Fits in current range\n cx.addNode(cur.tree, pos);\n }\n else {\n let dummy = new Tree(cx.parser.nodeSet.types[Type.Paragraph], [], [], 0, cx.block.hashProp);\n cx.reusePlaceholders.set(dummy, cur.tree);\n cx.addNode(dummy, pos);\n }\n // Taken content must always end in a block, because incremental\n // parsing happens on block boundaries. Never stop directly\n // after an indented code block, since those can continue after\n // any number of blank lines.\n if (cur.type.is(\"Block\")) {\n if (NotLast.indexOf(cur.type.id) < 0) {\n end = cur.to - off;\n blockI = cx.block.children.length;\n }\n else {\n end = prevEnd;\n blockI = prevI;\n prevEnd = cur.to - off;\n prevI = cx.block.children.length;\n }\n }\n if (!cur.nextSibling())\n break;\n }\n while (cx.block.children.length > blockI) {\n cx.block.children.pop();\n cx.block.positions.pop();\n }\n return end - start;\n }\n }\n // Convert an input-stream-relative position to a\n // Markdown-doc-relative position by subtracting the size of all input\n // gaps before `abs`.\n function toRelative(abs, ranges) {\n let pos = abs;\n for (let i = 1; i < ranges.length; i++) {\n let gapFrom = ranges[i - 1].to, gapTo = ranges[i].from;\n if (gapFrom < abs)\n pos -= gapTo - gapFrom;\n }\n return pos;\n }\n const markdownHighlighting = styleTags({\n \"Blockquote/...\": tags$1.quote,\n HorizontalRule: tags$1.contentSeparator,\n \"ATXHeading1/... SetextHeading1/...\": tags$1.heading1,\n \"ATXHeading2/... SetextHeading2/...\": tags$1.heading2,\n \"ATXHeading3/...\": tags$1.heading3,\n \"ATXHeading4/...\": tags$1.heading4,\n \"ATXHeading5/...\": tags$1.heading5,\n \"ATXHeading6/...\": tags$1.heading6,\n \"Comment CommentBlock\": tags$1.comment,\n Escape: tags$1.escape,\n Entity: tags$1.character,\n \"Emphasis/...\": tags$1.emphasis,\n \"StrongEmphasis/...\": tags$1.strong,\n \"Link/... Image/...\": tags$1.link,\n \"OrderedList/... BulletList/...\": tags$1.list,\n \"BlockQuote/...\": tags$1.quote,\n \"InlineCode CodeText\": tags$1.monospace,\n \"URL Autolink\": tags$1.url,\n \"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark\": tags$1.processingInstruction,\n \"CodeInfo LinkLabel\": tags$1.labelName,\n LinkTitle: tags$1.string,\n Paragraph: tags$1.content\n });\n /// The default CommonMark parser.\n const parser$4 = new MarkdownParser(new NodeSet(nodeTypes).extend(markdownHighlighting), Object.keys(DefaultBlockParsers).map(n => DefaultBlockParsers[n]), Object.keys(DefaultBlockParsers).map(n => DefaultLeafBlocks[n]), Object.keys(DefaultBlockParsers), DefaultEndLeaf, DefaultSkipMarkup, Object.keys(DefaultInline).map(n => DefaultInline[n]), Object.keys(DefaultInline), []);\n\n function leftOverSpace(node, from, to) {\n let ranges = [];\n for (let n = node.firstChild, pos = from;; n = n.nextSibling) {\n let nextPos = n ? n.from : to;\n if (nextPos > pos)\n ranges.push({ from: pos, to: nextPos });\n if (!n)\n break;\n pos = n.to;\n }\n return ranges;\n }\n /// Create a Markdown extension to enable nested parsing on code\n /// blocks and/or embedded HTML.\n function parseCode(config) {\n let { codeParser, htmlParser } = config;\n let wrap = parseMixed((node, input) => {\n let id = node.type.id;\n if (codeParser && (id == Type.CodeBlock || id == Type.FencedCode)) {\n let info = \"\";\n if (id == Type.FencedCode) {\n let infoNode = node.node.getChild(Type.CodeInfo);\n if (infoNode)\n info = input.read(infoNode.from, infoNode.to);\n }\n let parser = codeParser(info);\n if (parser)\n return { parser, overlay: node => node.type.id == Type.CodeText };\n }\n else if (htmlParser && (id == Type.HTMLBlock || id == Type.HTMLTag)) {\n return { parser: htmlParser, overlay: leftOverSpace(node.node, node.from, node.to) };\n }\n return null;\n });\n return { wrap };\n }\n\n const StrikethroughDelim = { resolve: \"Strikethrough\", mark: \"StrikethroughMark\" };\n /// An extension that implements\n /// [GFM-style](https://github.github.com/gfm/#strikethrough-extension-)\n /// Strikethrough syntax using `~~` delimiters.\n const Strikethrough = {\n defineNodes: [{\n name: \"Strikethrough\",\n style: { \"Strikethrough/...\": tags$1.strikethrough }\n }, {\n name: \"StrikethroughMark\",\n style: tags$1.processingInstruction\n }],\n parseInline: [{\n name: \"Strikethrough\",\n parse(cx, next, pos) {\n if (next != 126 /* '~' */ || cx.char(pos + 1) != 126 || cx.char(pos + 2) == 126)\n return -1;\n let before = cx.slice(pos - 1, pos), after = cx.slice(pos + 2, pos + 3);\n let sBefore = /\\s|^$/.test(before), sAfter = /\\s|^$/.test(after);\n let pBefore = Punctuation.test(before), pAfter = Punctuation.test(after);\n return cx.addDelimiter(StrikethroughDelim, pos, pos + 2, !sAfter && (!pAfter || sBefore || pBefore), !sBefore && (!pBefore || sAfter || pAfter));\n },\n after: \"Emphasis\"\n }]\n };\n function parseRow(cx, line, startI = 0, elts, offset = 0) {\n let count = 0, first = true, cellStart = -1, cellEnd = -1, esc = false;\n let parseCell = () => {\n elts.push(cx.elt(\"TableCell\", offset + cellStart, offset + cellEnd, cx.parser.parseInline(line.slice(cellStart, cellEnd), offset + cellStart)));\n };\n for (let i = startI; i < line.length; i++) {\n let next = line.charCodeAt(i);\n if (next == 124 /* '|' */ && !esc) {\n if (!first || cellStart > -1)\n count++;\n first = false;\n if (elts) {\n if (cellStart > -1)\n parseCell();\n elts.push(cx.elt(\"TableDelimiter\", i + offset, i + offset + 1));\n }\n cellStart = cellEnd = -1;\n }\n else if (esc || next != 32 && next != 9) {\n if (cellStart < 0)\n cellStart = i;\n cellEnd = i + 1;\n }\n esc = !esc && next == 92;\n }\n if (cellStart > -1) {\n count++;\n if (elts)\n parseCell();\n }\n return count;\n }\n function hasPipe(str, start) {\n for (let i = start; i < str.length; i++) {\n let next = str.charCodeAt(i);\n if (next == 124 /* '|' */)\n return true;\n if (next == 92 /* '\\\\' */)\n i++;\n }\n return false;\n }\n const delimiterLine = /^\\|?(\\s*:?-+:?\\s*\\|)+(\\s*:?-+:?\\s*)?$/;\n class TableParser {\n constructor() {\n // Null means we haven't seen the second line yet, false means this\n // isn't a table, and an array means this is a table and we've\n // parsed the given rows so far.\n this.rows = null;\n }\n nextLine(cx, line, leaf) {\n if (this.rows == null) { // Second line\n this.rows = false;\n let lineText;\n if ((line.next == 45 || line.next == 58 || line.next == 124 /* '-:|' */) &&\n delimiterLine.test(lineText = line.text.slice(line.pos))) {\n let firstRow = [], firstCount = parseRow(cx, leaf.content, 0, firstRow, leaf.start);\n if (firstCount == parseRow(cx, lineText, line.pos))\n this.rows = [cx.elt(\"TableHeader\", leaf.start, leaf.start + leaf.content.length, firstRow),\n cx.elt(\"TableDelimiter\", cx.lineStart + line.pos, cx.lineStart + line.text.length)];\n }\n }\n else if (this.rows) { // Line after the second\n let content = [];\n parseRow(cx, line.text, line.pos, content, cx.lineStart);\n this.rows.push(cx.elt(\"TableRow\", cx.lineStart + line.pos, cx.lineStart + line.text.length, content));\n }\n return false;\n }\n finish(cx, leaf) {\n if (!this.rows)\n return false;\n cx.addLeafElement(leaf, cx.elt(\"Table\", leaf.start, leaf.start + leaf.content.length, this.rows));\n return true;\n }\n }\n /// This extension provides\n /// [GFM-style](https://github.github.com/gfm/#tables-extension-)\n /// tables, using syntax like this:\n ///\n /// ```\n /// | head 1 | head 2 |\n /// | --- | --- |\n /// | cell 1 | cell 2 |\n /// ```\n const Table = {\n defineNodes: [\n { name: \"Table\", block: true },\n { name: \"TableHeader\", style: { \"TableHeader/...\": tags$1.heading } },\n \"TableRow\",\n { name: \"TableCell\", style: tags$1.content },\n { name: \"TableDelimiter\", style: tags$1.processingInstruction },\n ],\n parseBlock: [{\n name: \"Table\",\n leaf(_, leaf) { return hasPipe(leaf.content, 0) ? new TableParser : null; },\n endLeaf(cx, line, leaf) {\n if (leaf.parsers.some(p => p instanceof TableParser) || !hasPipe(line.text, line.basePos))\n return false;\n let next = cx.scanLine(cx.absoluteLineEnd + 1).text;\n return delimiterLine.test(next) && parseRow(cx, line.text, line.basePos) == parseRow(cx, next, line.basePos);\n },\n before: \"SetextHeading\"\n }]\n };\n class TaskParser {\n nextLine() { return false; }\n finish(cx, leaf) {\n cx.addLeafElement(leaf, cx.elt(\"Task\", leaf.start, leaf.start + leaf.content.length, [\n cx.elt(\"TaskMarker\", leaf.start, leaf.start + 3),\n ...cx.parser.parseInline(leaf.content.slice(3), leaf.start + 3)\n ]));\n return true;\n }\n }\n /// Extension providing\n /// [GFM-style](https://github.github.com/gfm/#task-list-items-extension-)\n /// task list items, where list items can be prefixed with `[ ]` or\n /// `[x]` to add a checkbox.\n const TaskList = {\n defineNodes: [\n { name: \"Task\", block: true, style: tags$1.list },\n { name: \"TaskMarker\", style: tags$1.atom }\n ],\n parseBlock: [{\n name: \"TaskList\",\n leaf(cx, leaf) {\n return /^\\[[ xX]\\][ \\t]/.test(leaf.content) && cx.parentType().name == \"ListItem\" ? new TaskParser : null;\n },\n after: \"SetextHeading\"\n }]\n };\n const autolinkRE = /(www\\.)|(https?:\\/\\/)|([\\w.+-]+@)|(mailto:|xmpp:)/gy;\n const urlRE = /[\\w-]+(\\.[\\w-]+)+(\\/[^\\s<]*)?/gy;\n const lastTwoDomainWords = /[\\w-]+\\.[\\w-]+($|\\/)/;\n const emailRE = /[\\w.+-]+@[\\w-]+(\\.[\\w.-]+)+/gy;\n const xmppResourceRE = /\\/[a-zA-Z\\d@.]+/gy;\n function count(str, from, to, ch) {\n let result = 0;\n for (let i = from; i < to; i++)\n if (str[i] == ch)\n result++;\n return result;\n }\n function autolinkURLEnd(text, from) {\n urlRE.lastIndex = from;\n let m = urlRE.exec(text);\n if (!m || lastTwoDomainWords.exec(m[0])[0].indexOf(\"_\") > -1)\n return -1;\n let end = from + m[0].length;\n for (;;) {\n let last = text[end - 1], m;\n if (/[?!.,:*_~]/.test(last) ||\n last == \")\" && count(text, from, end, \")\") > count(text, from, end, \"(\"))\n end--;\n else if (last == \";\" && (m = /&(?:#\\d+|#x[a-f\\d]+|\\w+);$/.exec(text.slice(from, end))))\n end = from + m.index;\n else\n break;\n }\n return end;\n }\n function autolinkEmailEnd(text, from) {\n emailRE.lastIndex = from;\n let m = emailRE.exec(text);\n if (!m)\n return -1;\n let last = m[0][m[0].length - 1];\n return last == \"_\" || last == \"-\" ? -1 : from + m[0].length - (last == \".\" ? 1 : 0);\n }\n /// Extension that implements autolinking for\n /// `www.`/`http://`/`https://`/`mailto:`/`xmpp:` URLs and email\n /// addresses.\n const Autolink = {\n parseInline: [{\n name: \"Autolink\",\n parse(cx, next, absPos) {\n let pos = absPos - cx.offset;\n autolinkRE.lastIndex = pos;\n let m = autolinkRE.exec(cx.text), end = -1;\n if (!m)\n return -1;\n if (m[1] || m[2]) { // www., http://\n end = autolinkURLEnd(cx.text, pos + m[0].length);\n if (end > -1 && cx.hasOpenLink) {\n let noBracket = /([^\\[\\]]|\\[[^\\]]*\\])*/.exec(cx.text.slice(pos, end));\n end = pos + noBracket[0].length;\n }\n }\n else if (m[3]) { // email address\n end = autolinkEmailEnd(cx.text, pos);\n }\n else { // mailto:/xmpp:\n end = autolinkEmailEnd(cx.text, pos + m[0].length);\n if (end > -1 && m[0] == \"xmpp:\") {\n xmppResourceRE.lastIndex = end;\n m = xmppResourceRE.exec(cx.text);\n if (m)\n end = m.index + m[0].length;\n }\n }\n if (end < 0)\n return -1;\n cx.addElement(cx.elt(\"URL\", absPos, end + cx.offset));\n return end + cx.offset;\n }\n }]\n };\n /// Extension bundle containing [`Table`](#Table),\n /// [`TaskList`](#TaskList), [`Strikethrough`](#Strikethrough), and\n /// [`Autolink`](#Autolink).\n const GFM = [Table, TaskList, Strikethrough, Autolink];\n function parseSubSuper(ch, node, mark) {\n return (cx, next, pos) => {\n if (next != ch || cx.char(pos + 1) == ch)\n return -1;\n let elts = [cx.elt(mark, pos, pos + 1)];\n for (let i = pos + 1; i < cx.end; i++) {\n let next = cx.char(i);\n if (next == ch)\n return cx.addElement(cx.elt(node, pos, i + 1, elts.concat(cx.elt(mark, i, i + 1))));\n if (next == 92 /* '\\\\' */)\n elts.push(cx.elt(\"Escape\", i, i++ + 2));\n if (space$2(next))\n break;\n }\n return -1;\n };\n }\n /// Extension providing\n /// [Pandoc-style](https://pandoc.org/MANUAL.html#superscripts-and-subscripts)\n /// superscript using `^` markers.\n const Superscript = {\n defineNodes: [\n { name: \"Superscript\", style: tags$1.special(tags$1.content) },\n { name: \"SuperscriptMark\", style: tags$1.processingInstruction }\n ],\n parseInline: [{\n name: \"Superscript\",\n parse: parseSubSuper(94 /* '^' */, \"Superscript\", \"SuperscriptMark\")\n }]\n };\n /// Extension providing\n /// [Pandoc-style](https://pandoc.org/MANUAL.html#superscripts-and-subscripts)\n /// subscript using `~` markers.\n const Subscript = {\n defineNodes: [\n { name: \"Subscript\", style: tags$1.special(tags$1.content) },\n { name: \"SubscriptMark\", style: tags$1.processingInstruction }\n ],\n parseInline: [{\n name: \"Subscript\",\n parse: parseSubSuper(126 /* '~' */, \"Subscript\", \"SubscriptMark\")\n }]\n };\n /// Extension that parses two colons with only letters, underscores,\n /// and numbers between them as `Emoji` nodes.\n const Emoji = {\n defineNodes: [{ name: \"Emoji\", style: tags$1.character }],\n parseInline: [{\n name: \"Emoji\",\n parse(cx, next, pos) {\n let match;\n if (next != 58 /* ':' */ || !(match = /^[a-zA-Z_0-9]+:/.exec(cx.slice(pos + 1, cx.end))))\n return -1;\n return cx.addElement(cx.elt(\"Emoji\", pos, pos + 1 + match[0].length));\n }\n }]\n };\n\n /**\n A parse stack. These are used internally by the parser to track\n parsing progress. They also provide some properties and methods\n that external code such as a tokenizer can use to get information\n about the parse state.\n */\n class Stack {\n /**\n @internal\n */\n constructor(\n /**\n The parse that this stack is part of @internal\n */\n p, \n /**\n Holds state, input pos, buffer index triplets for all but the\n top state @internal\n */\n stack, \n /**\n The current parse state @internal\n */\n state, \n // The position at which the next reduce should take place. This\n // can be less than `this.pos` when skipped expressions have been\n // added to the stack (which should be moved outside of the next\n // reduction)\n /**\n @internal\n */\n reducePos, \n /**\n The input position up to which this stack has parsed.\n */\n pos, \n /**\n The dynamic score of the stack, including dynamic precedence\n and error-recovery penalties\n @internal\n */\n score, \n // The output buffer. Holds (type, start, end, size) quads\n // representing nodes created by the parser, where `size` is\n // amount of buffer array entries covered by this node.\n /**\n @internal\n */\n buffer, \n // The base offset of the buffer. When stacks are split, the split\n // instance shared the buffer history with its parent up to\n // `bufferBase`, which is the absolute offset (including the\n // offset of previous splits) into the buffer at which this stack\n // starts writing.\n /**\n @internal\n */\n bufferBase, \n /**\n @internal\n */\n curContext, \n /**\n @internal\n */\n lookAhead = 0, \n // A parent stack from which this was split off, if any. This is\n // set up so that it always points to a stack that has some\n // additional buffer content, never to a stack with an equal\n // `bufferBase`.\n /**\n @internal\n */\n parent) {\n this.p = p;\n this.stack = stack;\n this.state = state;\n this.reducePos = reducePos;\n this.pos = pos;\n this.score = score;\n this.buffer = buffer;\n this.bufferBase = bufferBase;\n this.curContext = curContext;\n this.lookAhead = lookAhead;\n this.parent = parent;\n }\n /**\n @internal\n */\n toString() {\n return `[${this.stack.filter((_, i) => i % 3 == 0).concat(this.state)}]@${this.pos}${this.score ? \"!\" + this.score : \"\"}`;\n }\n // Start an empty stack\n /**\n @internal\n */\n static start(p, state, pos = 0) {\n let cx = p.parser.context;\n return new Stack(p, [], state, pos, pos, 0, [], 0, cx ? new StackContext(cx, cx.start) : null, 0, null);\n }\n /**\n The stack's current [context](#lr.ContextTracker) value, if\n any. Its type will depend on the context tracker's type\n parameter, or it will be `null` if there is no context\n tracker.\n */\n get context() { return this.curContext ? this.curContext.context : null; }\n // Push a state onto the stack, tracking its start position as well\n // as the buffer base at that point.\n /**\n @internal\n */\n pushState(state, start) {\n this.stack.push(this.state, start, this.bufferBase + this.buffer.length);\n this.state = state;\n }\n // Apply a reduce action\n /**\n @internal\n */\n reduce(action) {\n var _a;\n let depth = action >> 19 /* Action.ReduceDepthShift */, type = action & 65535 /* Action.ValueMask */;\n let { parser } = this.p;\n let lookaheadRecord = this.reducePos < this.pos - 25 /* Lookahead.Margin */;\n if (lookaheadRecord)\n this.setLookAhead(this.pos);\n let dPrec = parser.dynamicPrecedence(type);\n if (dPrec)\n this.score += dPrec;\n if (depth == 0) {\n this.pushState(parser.getGoto(this.state, type, true), this.reducePos);\n // Zero-depth reductions are a special case\u2014they add stuff to\n // the stack without popping anything off.\n if (type < parser.minRepeatTerm)\n this.storeNode(type, this.reducePos, this.reducePos, lookaheadRecord ? 8 : 4, true);\n this.reduceContext(type, this.reducePos);\n return;\n }\n // Find the base index into `this.stack`, content after which will\n // be dropped. Note that with `StayFlag` reductions we need to\n // consume two extra frames (the dummy parent node for the skipped\n // expression and the state that we'll be staying in, which should\n // be moved to `this.state`).\n let base = this.stack.length - ((depth - 1) * 3) - (action & 262144 /* Action.StayFlag */ ? 6 : 0);\n let start = base ? this.stack[base - 2] : this.p.ranges[0].from, size = this.reducePos - start;\n // This is a kludge to try and detect overly deep left-associative\n // trees, which will not increase the parse stack depth and thus\n // won't be caught by the regular stack-depth limit check.\n if (size >= 2000 /* Recover.MinBigReduction */ && !((_a = this.p.parser.nodeSet.types[type]) === null || _a === void 0 ? void 0 : _a.isAnonymous)) {\n if (start == this.p.lastBigReductionStart) {\n this.p.bigReductionCount++;\n this.p.lastBigReductionSize = size;\n }\n else if (this.p.lastBigReductionSize < size) {\n this.p.bigReductionCount = 1;\n this.p.lastBigReductionStart = start;\n this.p.lastBigReductionSize = size;\n }\n }\n let bufferBase = base ? this.stack[base - 1] : 0, count = this.bufferBase + this.buffer.length - bufferBase;\n // Store normal terms or `R -> R R` repeat reductions\n if (type < parser.minRepeatTerm || (action & 131072 /* Action.RepeatFlag */)) {\n let pos = parser.stateFlag(this.state, 1 /* StateFlag.Skipped */) ? this.pos : this.reducePos;\n this.storeNode(type, start, pos, count + 4, true);\n }\n if (action & 262144 /* Action.StayFlag */) {\n this.state = this.stack[base];\n }\n else {\n let baseStateID = this.stack[base - 3];\n this.state = parser.getGoto(baseStateID, type, true);\n }\n while (this.stack.length > base)\n this.stack.pop();\n this.reduceContext(type, start);\n }\n // Shift a value into the buffer\n /**\n @internal\n */\n storeNode(term, start, end, size = 4, mustSink = false) {\n if (term == 0 /* Term.Err */ &&\n (!this.stack.length || this.stack[this.stack.length - 1] < this.buffer.length + this.bufferBase)) {\n // Try to omit/merge adjacent error nodes\n let cur = this, top = this.buffer.length;\n if (top == 0 && cur.parent) {\n top = cur.bufferBase - cur.parent.bufferBase;\n cur = cur.parent;\n }\n if (top > 0 && cur.buffer[top - 4] == 0 /* Term.Err */ && cur.buffer[top - 1] > -1) {\n if (start == end)\n return;\n if (cur.buffer[top - 2] >= start) {\n cur.buffer[top - 2] = end;\n return;\n }\n }\n }\n if (!mustSink || this.pos == end) { // Simple case, just append\n this.buffer.push(term, start, end, size);\n }\n else { // There may be skipped nodes that have to be moved forward\n let index = this.buffer.length;\n if (index > 0 && this.buffer[index - 4] != 0 /* Term.Err */) {\n let mustMove = false;\n for (let scan = index; scan > 0 && this.buffer[scan - 2] > end; scan -= 4) {\n if (this.buffer[scan - 1] >= 0) {\n mustMove = true;\n break;\n }\n }\n if (mustMove)\n while (index > 0 && this.buffer[index - 2] > end) {\n // Move this record forward\n this.buffer[index] = this.buffer[index - 4];\n this.buffer[index + 1] = this.buffer[index - 3];\n this.buffer[index + 2] = this.buffer[index - 2];\n this.buffer[index + 3] = this.buffer[index - 1];\n index -= 4;\n if (size > 4)\n size -= 4;\n }\n }\n this.buffer[index] = term;\n this.buffer[index + 1] = start;\n this.buffer[index + 2] = end;\n this.buffer[index + 3] = size;\n }\n }\n // Apply a shift action\n /**\n @internal\n */\n shift(action, type, start, end) {\n if (action & 131072 /* Action.GotoFlag */) {\n this.pushState(action & 65535 /* Action.ValueMask */, this.pos);\n }\n else if ((action & 262144 /* Action.StayFlag */) == 0) { // Regular shift\n let nextState = action, { parser } = this.p;\n if (end > this.pos || type <= parser.maxNode) {\n this.pos = end;\n if (!parser.stateFlag(nextState, 1 /* StateFlag.Skipped */))\n this.reducePos = end;\n }\n this.pushState(nextState, start);\n this.shiftContext(type, start);\n if (type <= parser.maxNode)\n this.buffer.push(type, start, end, 4);\n }\n else { // Shift-and-stay, which means this is a skipped token\n this.pos = end;\n this.shiftContext(type, start);\n if (type <= this.p.parser.maxNode)\n this.buffer.push(type, start, end, 4);\n }\n }\n // Apply an action\n /**\n @internal\n */\n apply(action, next, nextStart, nextEnd) {\n if (action & 65536 /* Action.ReduceFlag */)\n this.reduce(action);\n else\n this.shift(action, next, nextStart, nextEnd);\n }\n // Add a prebuilt (reused) node into the buffer.\n /**\n @internal\n */\n useNode(value, next) {\n let index = this.p.reused.length - 1;\n if (index < 0 || this.p.reused[index] != value) {\n this.p.reused.push(value);\n index++;\n }\n let start = this.pos;\n this.reducePos = this.pos = start + value.length;\n this.pushState(next, start);\n this.buffer.push(index, start, this.reducePos, -1 /* size == -1 means this is a reused value */);\n if (this.curContext)\n this.updateContext(this.curContext.tracker.reuse(this.curContext.context, value, this, this.p.stream.reset(this.pos - value.length)));\n }\n // Split the stack. Due to the buffer sharing and the fact\n // that `this.stack` tends to stay quite shallow, this isn't very\n // expensive.\n /**\n @internal\n */\n split() {\n let parent = this;\n let off = parent.buffer.length;\n // Because the top of the buffer (after this.pos) may be mutated\n // to reorder reductions and skipped tokens, and shared buffers\n // should be immutable, this copies any outstanding skipped tokens\n // to the new buffer, and puts the base pointer before them.\n while (off > 0 && parent.buffer[off - 2] > parent.reducePos)\n off -= 4;\n let buffer = parent.buffer.slice(off), base = parent.bufferBase + off;\n // Make sure parent points to an actual parent with content, if there is such a parent.\n while (parent && base == parent.bufferBase)\n parent = parent.parent;\n return new Stack(this.p, this.stack.slice(), this.state, this.reducePos, this.pos, this.score, buffer, base, this.curContext, this.lookAhead, parent);\n }\n // Try to recover from an error by 'deleting' (ignoring) one token.\n /**\n @internal\n */\n recoverByDelete(next, nextEnd) {\n let isNode = next <= this.p.parser.maxNode;\n if (isNode)\n this.storeNode(next, this.pos, nextEnd, 4);\n this.storeNode(0 /* Term.Err */, this.pos, nextEnd, isNode ? 8 : 4);\n this.pos = this.reducePos = nextEnd;\n this.score -= 190 /* Recover.Delete */;\n }\n /**\n Check if the given term would be able to be shifted (optionally\n after some reductions) on this stack. This can be useful for\n external tokenizers that want to make sure they only provide a\n given token when it applies.\n */\n canShift(term) {\n for (let sim = new SimulatedStack(this);;) {\n let action = this.p.parser.stateSlot(sim.state, 4 /* ParseState.DefaultReduce */) || this.p.parser.hasAction(sim.state, term);\n if (action == 0)\n return false;\n if ((action & 65536 /* Action.ReduceFlag */) == 0)\n return true;\n sim.reduce(action);\n }\n }\n // Apply up to Recover.MaxNext recovery actions that conceptually\n // inserts some missing token or rule.\n /**\n @internal\n */\n recoverByInsert(next) {\n if (this.stack.length >= 300 /* Recover.MaxInsertStackDepth */)\n return [];\n let nextStates = this.p.parser.nextStates(this.state);\n if (nextStates.length > 4 /* Recover.MaxNext */ << 1 || this.stack.length >= 120 /* Recover.DampenInsertStackDepth */) {\n let best = [];\n for (let i = 0, s; i < nextStates.length; i += 2) {\n if ((s = nextStates[i + 1]) != this.state && this.p.parser.hasAction(s, next))\n best.push(nextStates[i], s);\n }\n if (this.stack.length < 120 /* Recover.DampenInsertStackDepth */)\n for (let i = 0; best.length < 4 /* Recover.MaxNext */ << 1 && i < nextStates.length; i += 2) {\n let s = nextStates[i + 1];\n if (!best.some((v, i) => (i & 1) && v == s))\n best.push(nextStates[i], s);\n }\n nextStates = best;\n }\n let result = [];\n for (let i = 0; i < nextStates.length && result.length < 4 /* Recover.MaxNext */; i += 2) {\n let s = nextStates[i + 1];\n if (s == this.state)\n continue;\n let stack = this.split();\n stack.pushState(s, this.pos);\n stack.storeNode(0 /* Term.Err */, stack.pos, stack.pos, 4, true);\n stack.shiftContext(nextStates[i], this.pos);\n stack.reducePos = this.pos;\n stack.score -= 200 /* Recover.Insert */;\n result.push(stack);\n }\n return result;\n }\n // Force a reduce, if possible. Return false if that can't\n // be done.\n /**\n @internal\n */\n forceReduce() {\n let { parser } = this.p;\n let reduce = parser.stateSlot(this.state, 5 /* ParseState.ForcedReduce */);\n if ((reduce & 65536 /* Action.ReduceFlag */) == 0)\n return false;\n if (!parser.validAction(this.state, reduce)) {\n let depth = reduce >> 19 /* Action.ReduceDepthShift */, term = reduce & 65535 /* Action.ValueMask */;\n let target = this.stack.length - depth * 3;\n if (target < 0 || parser.getGoto(this.stack[target], term, false) < 0) {\n let backup = this.findForcedReduction();\n if (backup == null)\n return false;\n reduce = backup;\n }\n this.storeNode(0 /* Term.Err */, this.pos, this.pos, 4, true);\n this.score -= 100 /* Recover.Reduce */;\n }\n this.reducePos = this.pos;\n this.reduce(reduce);\n return true;\n }\n /**\n Try to scan through the automaton to find some kind of reduction\n that can be applied. Used when the regular ForcedReduce field\n isn't a valid action. @internal\n */\n findForcedReduction() {\n let { parser } = this.p, seen = [];\n let explore = (state, depth) => {\n if (seen.includes(state))\n return;\n seen.push(state);\n return parser.allActions(state, (action) => {\n if (action & (262144 /* Action.StayFlag */ | 131072 /* Action.GotoFlag */)) ;\n else if (action & 65536 /* Action.ReduceFlag */) {\n let rDepth = (action >> 19 /* Action.ReduceDepthShift */) - depth;\n if (rDepth > 1) {\n let term = action & 65535 /* Action.ValueMask */, target = this.stack.length - rDepth * 3;\n if (target >= 0 && parser.getGoto(this.stack[target], term, false) >= 0)\n return (rDepth << 19 /* Action.ReduceDepthShift */) | 65536 /* Action.ReduceFlag */ | term;\n }\n }\n else {\n let found = explore(action, depth + 1);\n if (found != null)\n return found;\n }\n });\n };\n return explore(this.state, 0);\n }\n /**\n @internal\n */\n forceAll() {\n while (!this.p.parser.stateFlag(this.state, 2 /* StateFlag.Accepting */)) {\n if (!this.forceReduce()) {\n this.storeNode(0 /* Term.Err */, this.pos, this.pos, 4, true);\n break;\n }\n }\n return this;\n }\n /**\n Check whether this state has no further actions (assumed to be a direct descendant of the\n top state, since any other states must be able to continue\n somehow). @internal\n */\n get deadEnd() {\n if (this.stack.length != 3)\n return false;\n let { parser } = this.p;\n return parser.data[parser.stateSlot(this.state, 1 /* ParseState.Actions */)] == 65535 /* Seq.End */ &&\n !parser.stateSlot(this.state, 4 /* ParseState.DefaultReduce */);\n }\n /**\n Restart the stack (put it back in its start state). Only safe\n when this.stack.length == 3 (state is directly below the top\n state). @internal\n */\n restart() {\n this.storeNode(0 /* Term.Err */, this.pos, this.pos, 4, true);\n this.state = this.stack[0];\n this.stack.length = 0;\n }\n /**\n @internal\n */\n sameState(other) {\n if (this.state != other.state || this.stack.length != other.stack.length)\n return false;\n for (let i = 0; i < this.stack.length; i += 3)\n if (this.stack[i] != other.stack[i])\n return false;\n return true;\n }\n /**\n Get the parser used by this stack.\n */\n get parser() { return this.p.parser; }\n /**\n Test whether a given dialect (by numeric ID, as exported from\n the terms file) is enabled.\n */\n dialectEnabled(dialectID) { return this.p.parser.dialect.flags[dialectID]; }\n shiftContext(term, start) {\n if (this.curContext)\n this.updateContext(this.curContext.tracker.shift(this.curContext.context, term, this, this.p.stream.reset(start)));\n }\n reduceContext(term, start) {\n if (this.curContext)\n this.updateContext(this.curContext.tracker.reduce(this.curContext.context, term, this, this.p.stream.reset(start)));\n }\n /**\n @internal\n */\n emitContext() {\n let last = this.buffer.length - 1;\n if (last < 0 || this.buffer[last] != -3)\n this.buffer.push(this.curContext.hash, this.pos, this.pos, -3);\n }\n /**\n @internal\n */\n emitLookAhead() {\n let last = this.buffer.length - 1;\n if (last < 0 || this.buffer[last] != -4)\n this.buffer.push(this.lookAhead, this.pos, this.pos, -4);\n }\n updateContext(context) {\n if (context != this.curContext.context) {\n let newCx = new StackContext(this.curContext.tracker, context);\n if (newCx.hash != this.curContext.hash)\n this.emitContext();\n this.curContext = newCx;\n }\n }\n /**\n @internal\n */\n setLookAhead(lookAhead) {\n if (lookAhead > this.lookAhead) {\n this.emitLookAhead();\n this.lookAhead = lookAhead;\n }\n }\n /**\n @internal\n */\n close() {\n if (this.curContext && this.curContext.tracker.strict)\n this.emitContext();\n if (this.lookAhead > 0)\n this.emitLookAhead();\n }\n }\n class StackContext {\n constructor(tracker, context) {\n this.tracker = tracker;\n this.context = context;\n this.hash = tracker.strict ? tracker.hash(context) : 0;\n }\n }\n // Used to cheaply run some reductions to scan ahead without mutating\n // an entire stack\n class SimulatedStack {\n constructor(start) {\n this.start = start;\n this.state = start.state;\n this.stack = start.stack;\n this.base = this.stack.length;\n }\n reduce(action) {\n let term = action & 65535 /* Action.ValueMask */, depth = action >> 19 /* Action.ReduceDepthShift */;\n if (depth == 0) {\n if (this.stack == this.start.stack)\n this.stack = this.stack.slice();\n this.stack.push(this.state, 0, 0);\n this.base += 3;\n }\n else {\n this.base -= (depth - 1) * 3;\n }\n let goto = this.start.p.parser.getGoto(this.stack[this.base - 3], term, true);\n this.state = goto;\n }\n }\n // This is given to `Tree.build` to build a buffer, and encapsulates\n // the parent-stack-walking necessary to read the nodes.\n class StackBufferCursor {\n constructor(stack, pos, index) {\n this.stack = stack;\n this.pos = pos;\n this.index = index;\n this.buffer = stack.buffer;\n if (this.index == 0)\n this.maybeNext();\n }\n static create(stack, pos = stack.bufferBase + stack.buffer.length) {\n return new StackBufferCursor(stack, pos, pos - stack.bufferBase);\n }\n maybeNext() {\n let next = this.stack.parent;\n if (next != null) {\n this.index = this.stack.bufferBase - next.bufferBase;\n this.stack = next;\n this.buffer = next.buffer;\n }\n }\n get id() { return this.buffer[this.index - 4]; }\n get start() { return this.buffer[this.index - 3]; }\n get end() { return this.buffer[this.index - 2]; }\n get size() { return this.buffer[this.index - 1]; }\n next() {\n this.index -= 4;\n this.pos -= 4;\n if (this.index == 0)\n this.maybeNext();\n }\n fork() {\n return new StackBufferCursor(this.stack, this.pos, this.index);\n }\n }\n\n // See lezer-generator/src/encode.ts for comments about the encoding\n // used here\n function decodeArray(input, Type = Uint16Array) {\n if (typeof input != \"string\")\n return input;\n let array = null;\n for (let pos = 0, out = 0; pos < input.length;) {\n let value = 0;\n for (;;) {\n let next = input.charCodeAt(pos++), stop = false;\n if (next == 126 /* Encode.BigValCode */) {\n value = 65535 /* Encode.BigVal */;\n break;\n }\n if (next >= 92 /* Encode.Gap2 */)\n next--;\n if (next >= 34 /* Encode.Gap1 */)\n next--;\n let digit = next - 32 /* Encode.Start */;\n if (digit >= 46 /* Encode.Base */) {\n digit -= 46 /* Encode.Base */;\n stop = true;\n }\n value += digit;\n if (stop)\n break;\n value *= 46 /* Encode.Base */;\n }\n if (array)\n array[out++] = value;\n else\n array = new Type(value);\n }\n return array;\n }\n\n class CachedToken {\n constructor() {\n this.start = -1;\n this.value = -1;\n this.end = -1;\n this.extended = -1;\n this.lookAhead = 0;\n this.mask = 0;\n this.context = 0;\n }\n }\n const nullToken = new CachedToken;\n /**\n [Tokenizers](#lr.ExternalTokenizer) interact with the input\n through this interface. It presents the input as a stream of\n characters, tracking lookahead and hiding the complexity of\n [ranges](#common.Parser.parse^ranges) from tokenizer code.\n */\n class InputStream {\n /**\n @internal\n */\n constructor(\n /**\n @internal\n */\n input, \n /**\n @internal\n */\n ranges) {\n this.input = input;\n this.ranges = ranges;\n /**\n @internal\n */\n this.chunk = \"\";\n /**\n @internal\n */\n this.chunkOff = 0;\n /**\n Backup chunk\n */\n this.chunk2 = \"\";\n this.chunk2Pos = 0;\n /**\n The character code of the next code unit in the input, or -1\n when the stream is at the end of the input.\n */\n this.next = -1;\n /**\n @internal\n */\n this.token = nullToken;\n this.rangeIndex = 0;\n this.pos = this.chunkPos = ranges[0].from;\n this.range = ranges[0];\n this.end = ranges[ranges.length - 1].to;\n this.readNext();\n }\n /**\n @internal\n */\n resolveOffset(offset, assoc) {\n let range = this.range, index = this.rangeIndex;\n let pos = this.pos + offset;\n while (pos < range.from) {\n if (!index)\n return null;\n let next = this.ranges[--index];\n pos -= range.from - next.to;\n range = next;\n }\n while (assoc < 0 ? pos > range.to : pos >= range.to) {\n if (index == this.ranges.length - 1)\n return null;\n let next = this.ranges[++index];\n pos += next.from - range.to;\n range = next;\n }\n return pos;\n }\n /**\n @internal\n */\n clipPos(pos) {\n if (pos >= this.range.from && pos < this.range.to)\n return pos;\n for (let range of this.ranges)\n if (range.to > pos)\n return Math.max(pos, range.from);\n return this.end;\n }\n /**\n Look at a code unit near the stream position. `.peek(0)` equals\n `.next`, `.peek(-1)` gives you the previous character, and so\n on.\n \n Note that looking around during tokenizing creates dependencies\n on potentially far-away content, which may reduce the\n effectiveness incremental parsing\u2014when looking forward\u2014or even\n cause invalid reparses when looking backward more than 25 code\n units, since the library does not track lookbehind.\n */\n peek(offset) {\n let idx = this.chunkOff + offset, pos, result;\n if (idx >= 0 && idx < this.chunk.length) {\n pos = this.pos + offset;\n result = this.chunk.charCodeAt(idx);\n }\n else {\n let resolved = this.resolveOffset(offset, 1);\n if (resolved == null)\n return -1;\n pos = resolved;\n if (pos >= this.chunk2Pos && pos < this.chunk2Pos + this.chunk2.length) {\n result = this.chunk2.charCodeAt(pos - this.chunk2Pos);\n }\n else {\n let i = this.rangeIndex, range = this.range;\n while (range.to <= pos)\n range = this.ranges[++i];\n this.chunk2 = this.input.chunk(this.chunk2Pos = pos);\n if (pos + this.chunk2.length > range.to)\n this.chunk2 = this.chunk2.slice(0, range.to - pos);\n result = this.chunk2.charCodeAt(0);\n }\n }\n if (pos >= this.token.lookAhead)\n this.token.lookAhead = pos + 1;\n return result;\n }\n /**\n Accept a token. By default, the end of the token is set to the\n current stream position, but you can pass an offset (relative to\n the stream position) to change that.\n */\n acceptToken(token, endOffset = 0) {\n let end = endOffset ? this.resolveOffset(endOffset, -1) : this.pos;\n if (end == null || end < this.token.start)\n throw new RangeError(\"Token end out of bounds\");\n this.token.value = token;\n this.token.end = end;\n }\n /**\n Accept a token ending at a specific given position.\n */\n acceptTokenTo(token, endPos) {\n this.token.value = token;\n this.token.end = endPos;\n }\n getChunk() {\n if (this.pos >= this.chunk2Pos && this.pos < this.chunk2Pos + this.chunk2.length) {\n let { chunk, chunkPos } = this;\n this.chunk = this.chunk2;\n this.chunkPos = this.chunk2Pos;\n this.chunk2 = chunk;\n this.chunk2Pos = chunkPos;\n this.chunkOff = this.pos - this.chunkPos;\n }\n else {\n this.chunk2 = this.chunk;\n this.chunk2Pos = this.chunkPos;\n let nextChunk = this.input.chunk(this.pos);\n let end = this.pos + nextChunk.length;\n this.chunk = end > this.range.to ? nextChunk.slice(0, this.range.to - this.pos) : nextChunk;\n this.chunkPos = this.pos;\n this.chunkOff = 0;\n }\n }\n readNext() {\n if (this.chunkOff >= this.chunk.length) {\n this.getChunk();\n if (this.chunkOff == this.chunk.length)\n return this.next = -1;\n }\n return this.next = this.chunk.charCodeAt(this.chunkOff);\n }\n /**\n Move the stream forward N (defaults to 1) code units. Returns\n the new value of [`next`](#lr.InputStream.next).\n */\n advance(n = 1) {\n this.chunkOff += n;\n while (this.pos + n >= this.range.to) {\n if (this.rangeIndex == this.ranges.length - 1)\n return this.setDone();\n n -= this.range.to - this.pos;\n this.range = this.ranges[++this.rangeIndex];\n this.pos = this.range.from;\n }\n this.pos += n;\n if (this.pos >= this.token.lookAhead)\n this.token.lookAhead = this.pos + 1;\n return this.readNext();\n }\n setDone() {\n this.pos = this.chunkPos = this.end;\n this.range = this.ranges[this.rangeIndex = this.ranges.length - 1];\n this.chunk = \"\";\n return this.next = -1;\n }\n /**\n @internal\n */\n reset(pos, token) {\n if (token) {\n this.token = token;\n token.start = pos;\n token.lookAhead = pos + 1;\n token.value = token.extended = -1;\n }\n else {\n this.token = nullToken;\n }\n if (this.pos != pos) {\n this.pos = pos;\n if (pos == this.end) {\n this.setDone();\n return this;\n }\n while (pos < this.range.from)\n this.range = this.ranges[--this.rangeIndex];\n while (pos >= this.range.to)\n this.range = this.ranges[++this.rangeIndex];\n if (pos >= this.chunkPos && pos < this.chunkPos + this.chunk.length) {\n this.chunkOff = pos - this.chunkPos;\n }\n else {\n this.chunk = \"\";\n this.chunkOff = 0;\n }\n this.readNext();\n }\n return this;\n }\n /**\n @internal\n */\n read(from, to) {\n if (from >= this.chunkPos && to <= this.chunkPos + this.chunk.length)\n return this.chunk.slice(from - this.chunkPos, to - this.chunkPos);\n if (from >= this.chunk2Pos && to <= this.chunk2Pos + this.chunk2.length)\n return this.chunk2.slice(from - this.chunk2Pos, to - this.chunk2Pos);\n if (from >= this.range.from && to <= this.range.to)\n return this.input.read(from, to);\n let result = \"\";\n for (let r of this.ranges) {\n if (r.from >= to)\n break;\n if (r.to > from)\n result += this.input.read(Math.max(r.from, from), Math.min(r.to, to));\n }\n return result;\n }\n }\n /**\n @internal\n */\n class TokenGroup {\n constructor(data, id) {\n this.data = data;\n this.id = id;\n }\n token(input, stack) {\n let { parser } = stack.p;\n readToken(this.data, input, stack, this.id, parser.data, parser.tokenPrecTable);\n }\n }\n TokenGroup.prototype.contextual = TokenGroup.prototype.fallback = TokenGroup.prototype.extend = false;\n /**\n @hide\n */\n class LocalTokenGroup {\n constructor(data, precTable, elseToken) {\n this.precTable = precTable;\n this.elseToken = elseToken;\n this.data = typeof data == \"string\" ? decodeArray(data) : data;\n }\n token(input, stack) {\n let start = input.pos, skipped = 0;\n for (;;) {\n let atEof = input.next < 0, nextPos = input.resolveOffset(1, 1);\n readToken(this.data, input, stack, 0, this.data, this.precTable);\n if (input.token.value > -1)\n break;\n if (this.elseToken == null)\n return;\n if (!atEof)\n skipped++;\n if (nextPos == null)\n break;\n input.reset(nextPos, input.token);\n }\n if (skipped) {\n input.reset(start, input.token);\n input.acceptToken(this.elseToken, skipped);\n }\n }\n }\n LocalTokenGroup.prototype.contextual = TokenGroup.prototype.fallback = TokenGroup.prototype.extend = false;\n /**\n `@external tokens` declarations in the grammar should resolve to\n an instance of this class.\n */\n class ExternalTokenizer {\n /**\n Create a tokenizer. The first argument is the function that,\n given an input stream, scans for the types of tokens it\n recognizes at the stream's position, and calls\n [`acceptToken`](#lr.InputStream.acceptToken) when it finds\n one.\n */\n constructor(\n /**\n @internal\n */\n token, options = {}) {\n this.token = token;\n this.contextual = !!options.contextual;\n this.fallback = !!options.fallback;\n this.extend = !!options.extend;\n }\n }\n // Tokenizer data is stored a big uint16 array containing, for each\n // state:\n //\n // - A group bitmask, indicating what token groups are reachable from\n // this state, so that paths that can only lead to tokens not in\n // any of the current groups can be cut off early.\n //\n // - The position of the end of the state's sequence of accepting\n // tokens\n //\n // - The number of outgoing edges for the state\n //\n // - The accepting tokens, as (token id, group mask) pairs\n //\n // - The outgoing edges, as (start character, end character, state\n // index) triples, with end character being exclusive\n //\n // This function interprets that data, running through a stream as\n // long as new states with the a matching group mask can be reached,\n // and updating `input.token` when it matches a token.\n function readToken(data, input, stack, group, precTable, precOffset) {\n let state = 0, groupMask = 1 << group, { dialect } = stack.p.parser;\n scan: for (;;) {\n if ((groupMask & data[state]) == 0)\n break;\n let accEnd = data[state + 1];\n // Check whether this state can lead to a token in the current group\n // Accept tokens in this state, possibly overwriting\n // lower-precedence / shorter tokens\n for (let i = state + 3; i < accEnd; i += 2)\n if ((data[i + 1] & groupMask) > 0) {\n let term = data[i];\n if (dialect.allows(term) &&\n (input.token.value == -1 || input.token.value == term ||\n overrides(term, input.token.value, precTable, precOffset))) {\n input.acceptToken(term);\n break;\n }\n }\n let next = input.next, low = 0, high = data[state + 2];\n // Special case for EOF\n if (input.next < 0 && high > low && data[accEnd + high * 3 - 3] == 65535 /* Seq.End */) {\n state = data[accEnd + high * 3 - 1];\n continue scan;\n }\n // Do a binary search on the state's edges\n for (; low < high;) {\n let mid = (low + high) >> 1;\n let index = accEnd + mid + (mid << 1);\n let from = data[index], to = data[index + 1] || 0x10000;\n if (next < from)\n high = mid;\n else if (next >= to)\n low = mid + 1;\n else {\n state = data[index + 2];\n input.advance();\n continue scan;\n }\n }\n break;\n }\n }\n function findOffset(data, start, term) {\n for (let i = start, next; (next = data[i]) != 65535 /* Seq.End */; i++)\n if (next == term)\n return i - start;\n return -1;\n }\n function overrides(token, prev, tableData, tableOffset) {\n let iPrev = findOffset(tableData, tableOffset, prev);\n return iPrev < 0 || findOffset(tableData, tableOffset, token) < iPrev;\n }\n\n // Environment variable used to control console output\n const verbose = typeof process != \"undefined\" && process.env && /\\bparse\\b/.test(process.env.LOG);\n let stackIDs = null;\n function cutAt(tree, pos, side) {\n let cursor = tree.cursor(IterMode.IncludeAnonymous);\n cursor.moveTo(pos);\n for (;;) {\n if (!(side < 0 ? cursor.childBefore(pos) : cursor.childAfter(pos)))\n for (;;) {\n if ((side < 0 ? cursor.to < pos : cursor.from > pos) && !cursor.type.isError)\n return side < 0 ? Math.max(0, Math.min(cursor.to - 1, pos - 25 /* Lookahead.Margin */))\n : Math.min(tree.length, Math.max(cursor.from + 1, pos + 25 /* Lookahead.Margin */));\n if (side < 0 ? cursor.prevSibling() : cursor.nextSibling())\n break;\n if (!cursor.parent())\n return side < 0 ? 0 : tree.length;\n }\n }\n }\n class FragmentCursor {\n constructor(fragments, nodeSet) {\n this.fragments = fragments;\n this.nodeSet = nodeSet;\n this.i = 0;\n this.fragment = null;\n this.safeFrom = -1;\n this.safeTo = -1;\n this.trees = [];\n this.start = [];\n this.index = [];\n this.nextFragment();\n }\n nextFragment() {\n let fr = this.fragment = this.i == this.fragments.length ? null : this.fragments[this.i++];\n if (fr) {\n this.safeFrom = fr.openStart ? cutAt(fr.tree, fr.from + fr.offset, 1) - fr.offset : fr.from;\n this.safeTo = fr.openEnd ? cutAt(fr.tree, fr.to + fr.offset, -1) - fr.offset : fr.to;\n while (this.trees.length) {\n this.trees.pop();\n this.start.pop();\n this.index.pop();\n }\n this.trees.push(fr.tree);\n this.start.push(-fr.offset);\n this.index.push(0);\n this.nextStart = this.safeFrom;\n }\n else {\n this.nextStart = 1e9;\n }\n }\n // `pos` must be >= any previously given `pos` for this cursor\n nodeAt(pos) {\n if (pos < this.nextStart)\n return null;\n while (this.fragment && this.safeTo <= pos)\n this.nextFragment();\n if (!this.fragment)\n return null;\n for (;;) {\n let last = this.trees.length - 1;\n if (last < 0) { // End of tree\n this.nextFragment();\n return null;\n }\n let top = this.trees[last], index = this.index[last];\n if (index == top.children.length) {\n this.trees.pop();\n this.start.pop();\n this.index.pop();\n continue;\n }\n let next = top.children[index];\n let start = this.start[last] + top.positions[index];\n if (start > pos) {\n this.nextStart = start;\n return null;\n }\n if (next instanceof Tree) {\n if (start == pos) {\n if (start < this.safeFrom)\n return null;\n let end = start + next.length;\n if (end <= this.safeTo) {\n let lookAhead = next.prop(NodeProp.lookAhead);\n if (!lookAhead || end + lookAhead < this.fragment.to)\n return next;\n }\n }\n this.index[last]++;\n if (start + next.length >= Math.max(this.safeFrom, pos)) { // Enter this node\n this.trees.push(next);\n this.start.push(start);\n this.index.push(0);\n }\n }\n else {\n this.index[last]++;\n this.nextStart = start + next.length;\n }\n }\n }\n }\n class TokenCache {\n constructor(parser, stream) {\n this.stream = stream;\n this.tokens = [];\n this.mainToken = null;\n this.actions = [];\n this.tokens = parser.tokenizers.map(_ => new CachedToken);\n }\n getActions(stack) {\n let actionIndex = 0;\n let main = null;\n let { parser } = stack.p, { tokenizers } = parser;\n let mask = parser.stateSlot(stack.state, 3 /* ParseState.TokenizerMask */);\n let context = stack.curContext ? stack.curContext.hash : 0;\n let lookAhead = 0;\n for (let i = 0; i < tokenizers.length; i++) {\n if (((1 << i) & mask) == 0)\n continue;\n let tokenizer = tokenizers[i], token = this.tokens[i];\n if (main && !tokenizer.fallback)\n continue;\n if (tokenizer.contextual || token.start != stack.pos || token.mask != mask || token.context != context) {\n this.updateCachedToken(token, tokenizer, stack);\n token.mask = mask;\n token.context = context;\n }\n if (token.lookAhead > token.end + 25 /* Lookahead.Margin */)\n lookAhead = Math.max(token.lookAhead, lookAhead);\n if (token.value != 0 /* Term.Err */) {\n let startIndex = actionIndex;\n if (token.extended > -1)\n actionIndex = this.addActions(stack, token.extended, token.end, actionIndex);\n actionIndex = this.addActions(stack, token.value, token.end, actionIndex);\n if (!tokenizer.extend) {\n main = token;\n if (actionIndex > startIndex)\n break;\n }\n }\n }\n while (this.actions.length > actionIndex)\n this.actions.pop();\n if (lookAhead)\n stack.setLookAhead(lookAhead);\n if (!main && stack.pos == this.stream.end) {\n main = new CachedToken;\n main.value = stack.p.parser.eofTerm;\n main.start = main.end = stack.pos;\n actionIndex = this.addActions(stack, main.value, main.end, actionIndex);\n }\n this.mainToken = main;\n return this.actions;\n }\n getMainToken(stack) {\n if (this.mainToken)\n return this.mainToken;\n let main = new CachedToken, { pos, p } = stack;\n main.start = pos;\n main.end = Math.min(pos + 1, p.stream.end);\n main.value = pos == p.stream.end ? p.parser.eofTerm : 0 /* Term.Err */;\n return main;\n }\n updateCachedToken(token, tokenizer, stack) {\n let start = this.stream.clipPos(stack.pos);\n tokenizer.token(this.stream.reset(start, token), stack);\n if (token.value > -1) {\n let { parser } = stack.p;\n for (let i = 0; i < parser.specialized.length; i++)\n if (parser.specialized[i] == token.value) {\n let result = parser.specializers[i](this.stream.read(token.start, token.end), stack);\n if (result >= 0 && stack.p.parser.dialect.allows(result >> 1)) {\n if ((result & 1) == 0 /* Specialize.Specialize */)\n token.value = result >> 1;\n else\n token.extended = result >> 1;\n break;\n }\n }\n }\n else {\n token.value = 0 /* Term.Err */;\n token.end = this.stream.clipPos(start + 1);\n }\n }\n putAction(action, token, end, index) {\n // Don't add duplicate actions\n for (let i = 0; i < index; i += 3)\n if (this.actions[i] == action)\n return index;\n this.actions[index++] = action;\n this.actions[index++] = token;\n this.actions[index++] = end;\n return index;\n }\n addActions(stack, token, end, index) {\n let { state } = stack, { parser } = stack.p, { data } = parser;\n for (let set = 0; set < 2; set++) {\n for (let i = parser.stateSlot(state, set ? 2 /* ParseState.Skip */ : 1 /* ParseState.Actions */);; i += 3) {\n if (data[i] == 65535 /* Seq.End */) {\n if (data[i + 1] == 1 /* Seq.Next */) {\n i = pair(data, i + 2);\n }\n else {\n if (index == 0 && data[i + 1] == 2 /* Seq.Other */)\n index = this.putAction(pair(data, i + 2), token, end, index);\n break;\n }\n }\n if (data[i] == token)\n index = this.putAction(pair(data, i + 1), token, end, index);\n }\n }\n return index;\n }\n }\n class Parse {\n constructor(parser, input, fragments, ranges) {\n this.parser = parser;\n this.input = input;\n this.ranges = ranges;\n this.recovering = 0;\n this.nextStackID = 0x2654; // \u2654, \u2655, \u2656, \u2657, \u2658, \u2659, \u2660, \u2661, \u2662, \u2663, \u2664, \u2665, \u2666, \u2667\n this.minStackPos = 0;\n this.reused = [];\n this.stoppedAt = null;\n this.lastBigReductionStart = -1;\n this.lastBigReductionSize = 0;\n this.bigReductionCount = 0;\n this.stream = new InputStream(input, ranges);\n this.tokens = new TokenCache(parser, this.stream);\n this.topTerm = parser.top[1];\n let { from } = ranges[0];\n this.stacks = [Stack.start(this, parser.top[0], from)];\n this.fragments = fragments.length && this.stream.end - from > parser.bufferLength * 4\n ? new FragmentCursor(fragments, parser.nodeSet) : null;\n }\n get parsedPos() {\n return this.minStackPos;\n }\n // Move the parser forward. This will process all parse stacks at\n // `this.pos` and try to advance them to a further position. If no\n // stack for such a position is found, it'll start error-recovery.\n //\n // When the parse is finished, this will return a syntax tree. When\n // not, it returns `null`.\n advance() {\n let stacks = this.stacks, pos = this.minStackPos;\n // This will hold stacks beyond `pos`.\n let newStacks = this.stacks = [];\n let stopped, stoppedTokens;\n // If a large amount of reductions happened with the same start\n // position, force the stack out of that production in order to\n // avoid creating a tree too deep to recurse through.\n // (This is an ugly kludge, because unfortunately there is no\n // straightforward, cheap way to check for this happening, due to\n // the history of reductions only being available in an\n // expensive-to-access format in the stack buffers.)\n if (this.bigReductionCount > 300 /* Rec.MaxLeftAssociativeReductionCount */ && stacks.length == 1) {\n let [s] = stacks;\n while (s.forceReduce() && s.stack.length && s.stack[s.stack.length - 2] >= this.lastBigReductionStart) { }\n this.bigReductionCount = this.lastBigReductionSize = 0;\n }\n // Keep advancing any stacks at `pos` until they either move\n // forward or can't be advanced. Gather stacks that can't be\n // advanced further in `stopped`.\n for (let i = 0; i < stacks.length; i++) {\n let stack = stacks[i];\n for (;;) {\n this.tokens.mainToken = null;\n if (stack.pos > pos) {\n newStacks.push(stack);\n }\n else if (this.advanceStack(stack, newStacks, stacks)) {\n continue;\n }\n else {\n if (!stopped) {\n stopped = [];\n stoppedTokens = [];\n }\n stopped.push(stack);\n let tok = this.tokens.getMainToken(stack);\n stoppedTokens.push(tok.value, tok.end);\n }\n break;\n }\n }\n if (!newStacks.length) {\n let finished = stopped && findFinished(stopped);\n if (finished) {\n if (verbose)\n console.log(\"Finish with \" + this.stackID(finished));\n return this.stackToTree(finished);\n }\n if (this.parser.strict) {\n if (verbose && stopped)\n console.log(\"Stuck with token \" + (this.tokens.mainToken ? this.parser.getName(this.tokens.mainToken.value) : \"none\"));\n throw new SyntaxError(\"No parse at \" + pos);\n }\n if (!this.recovering)\n this.recovering = 5 /* Rec.Distance */;\n }\n if (this.recovering && stopped) {\n let finished = this.stoppedAt != null && stopped[0].pos > this.stoppedAt ? stopped[0]\n : this.runRecovery(stopped, stoppedTokens, newStacks);\n if (finished) {\n if (verbose)\n console.log(\"Force-finish \" + this.stackID(finished));\n return this.stackToTree(finished.forceAll());\n }\n }\n if (this.recovering) {\n let maxRemaining = this.recovering == 1 ? 1 : this.recovering * 3 /* Rec.MaxRemainingPerStep */;\n if (newStacks.length > maxRemaining) {\n newStacks.sort((a, b) => b.score - a.score);\n while (newStacks.length > maxRemaining)\n newStacks.pop();\n }\n if (newStacks.some(s => s.reducePos > pos))\n this.recovering--;\n }\n else if (newStacks.length > 1) {\n // Prune stacks that are in the same state, or that have been\n // running without splitting for a while, to avoid getting stuck\n // with multiple successful stacks running endlessly on.\n outer: for (let i = 0; i < newStacks.length - 1; i++) {\n let stack = newStacks[i];\n for (let j = i + 1; j < newStacks.length; j++) {\n let other = newStacks[j];\n if (stack.sameState(other) ||\n stack.buffer.length > 500 /* Rec.MinBufferLengthPrune */ && other.buffer.length > 500 /* Rec.MinBufferLengthPrune */) {\n if (((stack.score - other.score) || (stack.buffer.length - other.buffer.length)) > 0) {\n newStacks.splice(j--, 1);\n }\n else {\n newStacks.splice(i--, 1);\n continue outer;\n }\n }\n }\n }\n if (newStacks.length > 12 /* Rec.MaxStackCount */)\n newStacks.splice(12 /* Rec.MaxStackCount */, newStacks.length - 12 /* Rec.MaxStackCount */);\n }\n this.minStackPos = newStacks[0].pos;\n for (let i = 1; i < newStacks.length; i++)\n if (newStacks[i].pos < this.minStackPos)\n this.minStackPos = newStacks[i].pos;\n return null;\n }\n stopAt(pos) {\n if (this.stoppedAt != null && this.stoppedAt < pos)\n throw new RangeError(\"Can't move stoppedAt forward\");\n this.stoppedAt = pos;\n }\n // Returns an updated version of the given stack, or null if the\n // stack can't advance normally. When `split` and `stacks` are\n // given, stacks split off by ambiguous operations will be pushed to\n // `split`, or added to `stacks` if they move `pos` forward.\n advanceStack(stack, stacks, split) {\n let start = stack.pos, { parser } = this;\n let base = verbose ? this.stackID(stack) + \" -> \" : \"\";\n if (this.stoppedAt != null && start > this.stoppedAt)\n return stack.forceReduce() ? stack : null;\n if (this.fragments) {\n let strictCx = stack.curContext && stack.curContext.tracker.strict, cxHash = strictCx ? stack.curContext.hash : 0;\n for (let cached = this.fragments.nodeAt(start); cached;) {\n let match = this.parser.nodeSet.types[cached.type.id] == cached.type ? parser.getGoto(stack.state, cached.type.id) : -1;\n if (match > -1 && cached.length && (!strictCx || (cached.prop(NodeProp.contextHash) || 0) == cxHash)) {\n stack.useNode(cached, match);\n if (verbose)\n console.log(base + this.stackID(stack) + ` (via reuse of ${parser.getName(cached.type.id)})`);\n return true;\n }\n if (!(cached instanceof Tree) || cached.children.length == 0 || cached.positions[0] > 0)\n break;\n let inner = cached.children[0];\n if (inner instanceof Tree && cached.positions[0] == 0)\n cached = inner;\n else\n break;\n }\n }\n let defaultReduce = parser.stateSlot(stack.state, 4 /* ParseState.DefaultReduce */);\n if (defaultReduce > 0) {\n stack.reduce(defaultReduce);\n if (verbose)\n console.log(base + this.stackID(stack) + ` (via always-reduce ${parser.getName(defaultReduce & 65535 /* Action.ValueMask */)})`);\n return true;\n }\n if (stack.stack.length >= 8400 /* Rec.CutDepth */) {\n while (stack.stack.length > 6000 /* Rec.CutTo */ && stack.forceReduce()) { }\n }\n let actions = this.tokens.getActions(stack);\n for (let i = 0; i < actions.length;) {\n let action = actions[i++], term = actions[i++], end = actions[i++];\n let last = i == actions.length || !split;\n let localStack = last ? stack : stack.split();\n let main = this.tokens.mainToken;\n localStack.apply(action, term, main ? main.start : localStack.pos, end);\n if (verbose)\n console.log(base + this.stackID(localStack) + ` (via ${(action & 65536 /* Action.ReduceFlag */) == 0 ? \"shift\"\n : `reduce of ${parser.getName(action & 65535 /* Action.ValueMask */)}`} for ${parser.getName(term)} @ ${start}${localStack == stack ? \"\" : \", split\"})`);\n if (last)\n return true;\n else if (localStack.pos > start)\n stacks.push(localStack);\n else\n split.push(localStack);\n }\n return false;\n }\n // Advance a given stack forward as far as it will go. Returns the\n // (possibly updated) stack if it got stuck, or null if it moved\n // forward and was given to `pushStackDedup`.\n advanceFully(stack, newStacks) {\n let pos = stack.pos;\n for (;;) {\n if (!this.advanceStack(stack, null, null))\n return false;\n if (stack.pos > pos) {\n pushStackDedup(stack, newStacks);\n return true;\n }\n }\n }\n runRecovery(stacks, tokens, newStacks) {\n let finished = null, restarted = false;\n for (let i = 0; i < stacks.length; i++) {\n let stack = stacks[i], token = tokens[i << 1], tokenEnd = tokens[(i << 1) + 1];\n let base = verbose ? this.stackID(stack) + \" -> \" : \"\";\n if (stack.deadEnd) {\n if (restarted)\n continue;\n restarted = true;\n stack.restart();\n if (verbose)\n console.log(base + this.stackID(stack) + \" (restarted)\");\n let done = this.advanceFully(stack, newStacks);\n if (done)\n continue;\n }\n let force = stack.split(), forceBase = base;\n for (let j = 0; force.forceReduce() && j < 10 /* Rec.ForceReduceLimit */; j++) {\n if (verbose)\n console.log(forceBase + this.stackID(force) + \" (via force-reduce)\");\n let done = this.advanceFully(force, newStacks);\n if (done)\n break;\n if (verbose)\n forceBase = this.stackID(force) + \" -> \";\n }\n for (let insert of stack.recoverByInsert(token)) {\n if (verbose)\n console.log(base + this.stackID(insert) + \" (via recover-insert)\");\n this.advanceFully(insert, newStacks);\n }\n if (this.stream.end > stack.pos) {\n if (tokenEnd == stack.pos) {\n tokenEnd++;\n token = 0 /* Term.Err */;\n }\n stack.recoverByDelete(token, tokenEnd);\n if (verbose)\n console.log(base + this.stackID(stack) + ` (via recover-delete ${this.parser.getName(token)})`);\n pushStackDedup(stack, newStacks);\n }\n else if (!finished || finished.score < stack.score) {\n finished = stack;\n }\n }\n return finished;\n }\n // Convert the stack's buffer to a syntax tree.\n stackToTree(stack) {\n stack.close();\n return Tree.build({ buffer: StackBufferCursor.create(stack),\n nodeSet: this.parser.nodeSet,\n topID: this.topTerm,\n maxBufferLength: this.parser.bufferLength,\n reused: this.reused,\n start: this.ranges[0].from,\n length: stack.pos - this.ranges[0].from,\n minRepeatType: this.parser.minRepeatTerm });\n }\n stackID(stack) {\n let id = (stackIDs || (stackIDs = new WeakMap)).get(stack);\n if (!id)\n stackIDs.set(stack, id = String.fromCodePoint(this.nextStackID++));\n return id + stack;\n }\n }\n function pushStackDedup(stack, newStacks) {\n for (let i = 0; i < newStacks.length; i++) {\n let other = newStacks[i];\n if (other.pos == stack.pos && other.sameState(stack)) {\n if (newStacks[i].score < stack.score)\n newStacks[i] = stack;\n return;\n }\n }\n newStacks.push(stack);\n }\n class Dialect {\n constructor(source, flags, disabled) {\n this.source = source;\n this.flags = flags;\n this.disabled = disabled;\n }\n allows(term) { return !this.disabled || this.disabled[term] == 0; }\n }\n const id = x => x;\n /**\n Context trackers are used to track stateful context (such as\n indentation in the Python grammar, or parent elements in the XML\n grammar) needed by external tokenizers. You declare them in a\n grammar file as `@context exportName from \"module\"`.\n\n Context values should be immutable, and can be updated (replaced)\n on shift or reduce actions.\n\n The export used in a `@context` declaration should be of this\n type.\n */\n class ContextTracker {\n /**\n Define a context tracker.\n */\n constructor(spec) {\n this.start = spec.start;\n this.shift = spec.shift || id;\n this.reduce = spec.reduce || id;\n this.reuse = spec.reuse || id;\n this.hash = spec.hash || (() => 0);\n this.strict = spec.strict !== false;\n }\n }\n /**\n Holds the parse tables for a given grammar, as generated by\n `lezer-generator`, and provides [methods](#common.Parser) to parse\n content with.\n */\n class LRParser extends Parser {\n /**\n @internal\n */\n constructor(spec) {\n super();\n /**\n @internal\n */\n this.wrappers = [];\n if (spec.version != 14 /* File.Version */)\n throw new RangeError(`Parser version (${spec.version}) doesn't match runtime version (${14 /* File.Version */})`);\n let nodeNames = spec.nodeNames.split(\" \");\n this.minRepeatTerm = nodeNames.length;\n for (let i = 0; i < spec.repeatNodeCount; i++)\n nodeNames.push(\"\");\n let topTerms = Object.keys(spec.topRules).map(r => spec.topRules[r][1]);\n let nodeProps = [];\n for (let i = 0; i < nodeNames.length; i++)\n nodeProps.push([]);\n function setProp(nodeID, prop, value) {\n nodeProps[nodeID].push([prop, prop.deserialize(String(value))]);\n }\n if (spec.nodeProps)\n for (let propSpec of spec.nodeProps) {\n let prop = propSpec[0];\n if (typeof prop == \"string\")\n prop = NodeProp[prop];\n for (let i = 1; i < propSpec.length;) {\n let next = propSpec[i++];\n if (next >= 0) {\n setProp(next, prop, propSpec[i++]);\n }\n else {\n let value = propSpec[i + -next];\n for (let j = -next; j > 0; j--)\n setProp(propSpec[i++], prop, value);\n i++;\n }\n }\n }\n this.nodeSet = new NodeSet(nodeNames.map((name, i) => NodeType.define({\n name: i >= this.minRepeatTerm ? undefined : name,\n id: i,\n props: nodeProps[i],\n top: topTerms.indexOf(i) > -1,\n error: i == 0,\n skipped: spec.skippedNodes && spec.skippedNodes.indexOf(i) > -1\n })));\n if (spec.propSources)\n this.nodeSet = this.nodeSet.extend(...spec.propSources);\n this.strict = false;\n this.bufferLength = DefaultBufferLength;\n let tokenArray = decodeArray(spec.tokenData);\n this.context = spec.context;\n this.specializerSpecs = spec.specialized || [];\n this.specialized = new Uint16Array(this.specializerSpecs.length);\n for (let i = 0; i < this.specializerSpecs.length; i++)\n this.specialized[i] = this.specializerSpecs[i].term;\n this.specializers = this.specializerSpecs.map(getSpecializer);\n this.states = decodeArray(spec.states, Uint32Array);\n this.data = decodeArray(spec.stateData);\n this.goto = decodeArray(spec.goto);\n this.maxTerm = spec.maxTerm;\n this.tokenizers = spec.tokenizers.map(value => typeof value == \"number\" ? new TokenGroup(tokenArray, value) : value);\n this.topRules = spec.topRules;\n this.dialects = spec.dialects || {};\n this.dynamicPrecedences = spec.dynamicPrecedences || null;\n this.tokenPrecTable = spec.tokenPrec;\n this.termNames = spec.termNames || null;\n this.maxNode = this.nodeSet.types.length - 1;\n this.dialect = this.parseDialect();\n this.top = this.topRules[Object.keys(this.topRules)[0]];\n }\n createParse(input, fragments, ranges) {\n let parse = new Parse(this, input, fragments, ranges);\n for (let w of this.wrappers)\n parse = w(parse, input, fragments, ranges);\n return parse;\n }\n /**\n Get a goto table entry @internal\n */\n getGoto(state, term, loose = false) {\n let table = this.goto;\n if (term >= table[0])\n return -1;\n for (let pos = table[term + 1];;) {\n let groupTag = table[pos++], last = groupTag & 1;\n let target = table[pos++];\n if (last && loose)\n return target;\n for (let end = pos + (groupTag >> 1); pos < end; pos++)\n if (table[pos] == state)\n return target;\n if (last)\n return -1;\n }\n }\n /**\n Check if this state has an action for a given terminal @internal\n */\n hasAction(state, terminal) {\n let data = this.data;\n for (let set = 0; set < 2; set++) {\n for (let i = this.stateSlot(state, set ? 2 /* ParseState.Skip */ : 1 /* ParseState.Actions */), next;; i += 3) {\n if ((next = data[i]) == 65535 /* Seq.End */) {\n if (data[i + 1] == 1 /* Seq.Next */)\n next = data[i = pair(data, i + 2)];\n else if (data[i + 1] == 2 /* Seq.Other */)\n return pair(data, i + 2);\n else\n break;\n }\n if (next == terminal || next == 0 /* Term.Err */)\n return pair(data, i + 1);\n }\n }\n return 0;\n }\n /**\n @internal\n */\n stateSlot(state, slot) {\n return this.states[(state * 6 /* ParseState.Size */) + slot];\n }\n /**\n @internal\n */\n stateFlag(state, flag) {\n return (this.stateSlot(state, 0 /* ParseState.Flags */) & flag) > 0;\n }\n /**\n @internal\n */\n validAction(state, action) {\n return !!this.allActions(state, a => a == action ? true : null);\n }\n /**\n @internal\n */\n allActions(state, action) {\n let deflt = this.stateSlot(state, 4 /* ParseState.DefaultReduce */);\n let result = deflt ? action(deflt) : undefined;\n for (let i = this.stateSlot(state, 1 /* ParseState.Actions */); result == null; i += 3) {\n if (this.data[i] == 65535 /* Seq.End */) {\n if (this.data[i + 1] == 1 /* Seq.Next */)\n i = pair(this.data, i + 2);\n else\n break;\n }\n result = action(pair(this.data, i + 1));\n }\n return result;\n }\n /**\n Get the states that can follow this one through shift actions or\n goto jumps. @internal\n */\n nextStates(state) {\n let result = [];\n for (let i = this.stateSlot(state, 1 /* ParseState.Actions */);; i += 3) {\n if (this.data[i] == 65535 /* Seq.End */) {\n if (this.data[i + 1] == 1 /* Seq.Next */)\n i = pair(this.data, i + 2);\n else\n break;\n }\n if ((this.data[i + 2] & (65536 /* Action.ReduceFlag */ >> 16)) == 0) {\n let value = this.data[i + 1];\n if (!result.some((v, i) => (i & 1) && v == value))\n result.push(this.data[i], value);\n }\n }\n return result;\n }\n /**\n Configure the parser. Returns a new parser instance that has the\n given settings modified. Settings not provided in `config` are\n kept from the original parser.\n */\n configure(config) {\n // Hideous reflection-based kludge to make it easy to create a\n // slightly modified copy of a parser.\n let copy = Object.assign(Object.create(LRParser.prototype), this);\n if (config.props)\n copy.nodeSet = this.nodeSet.extend(...config.props);\n if (config.top) {\n let info = this.topRules[config.top];\n if (!info)\n throw new RangeError(`Invalid top rule name ${config.top}`);\n copy.top = info;\n }\n if (config.tokenizers)\n copy.tokenizers = this.tokenizers.map(t => {\n let found = config.tokenizers.find(r => r.from == t);\n return found ? found.to : t;\n });\n if (config.specializers) {\n copy.specializers = this.specializers.slice();\n copy.specializerSpecs = this.specializerSpecs.map((s, i) => {\n let found = config.specializers.find(r => r.from == s.external);\n if (!found)\n return s;\n let spec = Object.assign(Object.assign({}, s), { external: found.to });\n copy.specializers[i] = getSpecializer(spec);\n return spec;\n });\n }\n if (config.contextTracker)\n copy.context = config.contextTracker;\n if (config.dialect)\n copy.dialect = this.parseDialect(config.dialect);\n if (config.strict != null)\n copy.strict = config.strict;\n if (config.wrap)\n copy.wrappers = copy.wrappers.concat(config.wrap);\n if (config.bufferLength != null)\n copy.bufferLength = config.bufferLength;\n return copy;\n }\n /**\n Tells you whether any [parse wrappers](#lr.ParserConfig.wrap)\n are registered for this parser.\n */\n hasWrappers() {\n return this.wrappers.length > 0;\n }\n /**\n Returns the name associated with a given term. This will only\n work for all terms when the parser was generated with the\n `--names` option. By default, only the names of tagged terms are\n stored.\n */\n getName(term) {\n return this.termNames ? this.termNames[term] : String(term <= this.maxNode && this.nodeSet.types[term].name || term);\n }\n /**\n The eof term id is always allocated directly after the node\n types. @internal\n */\n get eofTerm() { return this.maxNode + 1; }\n /**\n The type of top node produced by the parser.\n */\n get topNode() { return this.nodeSet.types[this.top[1]]; }\n /**\n @internal\n */\n dynamicPrecedence(term) {\n let prec = this.dynamicPrecedences;\n return prec == null ? 0 : prec[term] || 0;\n }\n /**\n @internal\n */\n parseDialect(dialect) {\n let values = Object.keys(this.dialects), flags = values.map(() => false);\n if (dialect)\n for (let part of dialect.split(\" \")) {\n let id = values.indexOf(part);\n if (id >= 0)\n flags[id] = true;\n }\n let disabled = null;\n for (let i = 0; i < values.length; i++)\n if (!flags[i]) {\n for (let j = this.dialects[values[i]], id; (id = this.data[j++]) != 65535 /* Seq.End */;)\n (disabled || (disabled = new Uint8Array(this.maxTerm + 1)))[id] = 1;\n }\n return new Dialect(dialect, flags, disabled);\n }\n /**\n Used by the output of the parser generator. Not available to\n user code. @hide\n */\n static deserialize(spec) {\n return new LRParser(spec);\n }\n }\n function pair(data, off) { return data[off] | (data[off + 1] << 16); }\n function findFinished(stacks) {\n let best = null;\n for (let stack of stacks) {\n let stopped = stack.p.stoppedAt;\n if ((stack.pos == stack.p.stream.end || stopped != null && stack.pos > stopped) &&\n stack.p.parser.stateFlag(stack.state, 2 /* StateFlag.Accepting */) &&\n (!best || best.score < stack.score))\n best = stack;\n }\n return best;\n }\n function getSpecializer(spec) {\n if (spec.external) {\n let mask = spec.extend ? 1 /* Specialize.Extend */ : 0 /* Specialize.Specialize */;\n return (value, stack) => (spec.external(value, stack) << 1) | mask;\n }\n return spec.get;\n }\n\n // This file was generated by lezer-generator. You probably shouldn't edit it.\n const scriptText = 54,\n StartCloseScriptTag = 1,\n styleText = 55,\n StartCloseStyleTag = 2,\n textareaText = 56,\n StartCloseTextareaTag = 3,\n EndTag = 4,\n SelfClosingEndTag = 5,\n StartTag = 6,\n StartScriptTag = 7,\n StartStyleTag = 8,\n StartTextareaTag = 9,\n StartSelfClosingTag = 10,\n StartCloseTag = 11,\n NoMatchStartCloseTag = 12,\n MismatchedStartCloseTag = 13,\n missingCloseTag = 57,\n IncompleteCloseTag = 14,\n commentContent$1 = 58,\n Element = 20,\n TagName = 22,\n Attribute = 23,\n AttributeName = 24,\n AttributeValue = 26,\n UnquotedAttributeValue = 27,\n ScriptText = 28,\n StyleText = 31,\n TextareaText = 34,\n OpenTag = 36,\n CloseTag = 37,\n Dialect_noMatch = 0,\n Dialect_selfClosing = 1;\n\n /* Hand-written tokenizers for HTML. */\n\n const selfClosers$1 = {\n area: true, base: true, br: true, col: true, command: true,\n embed: true, frame: true, hr: true, img: true, input: true,\n keygen: true, link: true, meta: true, param: true, source: true,\n track: true, wbr: true, menuitem: true\n };\n\n const implicitlyClosed = {\n dd: true, li: true, optgroup: true, option: true, p: true,\n rp: true, rt: true, tbody: true, td: true, tfoot: true,\n th: true, tr: true\n };\n\n const closeOnOpen = {\n dd: {dd: true, dt: true},\n dt: {dd: true, dt: true},\n li: {li: true},\n option: {option: true, optgroup: true},\n optgroup: {optgroup: true},\n p: {\n address: true, article: true, aside: true, blockquote: true, dir: true,\n div: true, dl: true, fieldset: true, footer: true, form: true,\n h1: true, h2: true, h3: true, h4: true, h5: true, h6: true,\n header: true, hgroup: true, hr: true, menu: true, nav: true, ol: true,\n p: true, pre: true, section: true, table: true, ul: true\n },\n rp: {rp: true, rt: true},\n rt: {rp: true, rt: true},\n tbody: {tbody: true, tfoot: true},\n td: {td: true, th: true},\n tfoot: {tbody: true},\n th: {td: true, th: true},\n thead: {tbody: true, tfoot: true},\n tr: {tr: true}\n };\n\n function nameChar(ch) {\n return ch == 45 || ch == 46 || ch == 58 || ch >= 65 && ch <= 90 || ch == 95 || ch >= 97 && ch <= 122 || ch >= 161\n }\n\n function isSpace(ch) {\n return ch == 9 || ch == 10 || ch == 13 || ch == 32\n }\n\n let cachedName = null, cachedInput = null, cachedPos = 0;\n function tagNameAfter(input, offset) {\n let pos = input.pos + offset;\n if (cachedPos == pos && cachedInput == input) return cachedName\n let next = input.peek(offset);\n while (isSpace(next)) next = input.peek(++offset);\n let name = \"\";\n for (;;) {\n if (!nameChar(next)) break\n name += String.fromCharCode(next);\n next = input.peek(++offset);\n }\n // Undefined to signal there's a <? or <!, null for just missing\n cachedInput = input; cachedPos = pos;\n return cachedName = name ? name.toLowerCase() : next == question$1 || next == bang ? undefined : null\n }\n\n const lessThan = 60, greaterThan = 62, slash$1 = 47, question$1 = 63, bang = 33, dash$1 = 45;\n\n function ElementContext(name, parent) {\n this.name = name;\n this.parent = parent;\n }\n\n const startTagTerms = [StartTag, StartSelfClosingTag, StartScriptTag, StartStyleTag, StartTextareaTag];\n\n const elementContext = new ContextTracker({\n start: null,\n shift(context, term, stack, input) {\n return startTagTerms.indexOf(term) > -1 ? new ElementContext(tagNameAfter(input, 1) || \"\", context) : context\n },\n reduce(context, term) {\n return term == Element && context ? context.parent : context\n },\n reuse(context, node, stack, input) {\n let type = node.type.id;\n return type == StartTag || type == OpenTag\n ? new ElementContext(tagNameAfter(input, 1) || \"\", context) : context\n },\n strict: false\n });\n\n const tagStart = new ExternalTokenizer((input, stack) => {\n if (input.next != lessThan) {\n // End of file, close any open tags\n if (input.next < 0 && stack.context) input.acceptToken(missingCloseTag);\n return\n }\n input.advance();\n let close = input.next == slash$1;\n if (close) input.advance();\n let name = tagNameAfter(input, 0);\n if (name === undefined) return\n if (!name) return input.acceptToken(close ? IncompleteCloseTag : StartTag)\n\n let parent = stack.context ? stack.context.name : null;\n if (close) {\n if (name == parent) return input.acceptToken(StartCloseTag)\n if (parent && implicitlyClosed[parent]) return input.acceptToken(missingCloseTag, -2)\n if (stack.dialectEnabled(Dialect_noMatch)) return input.acceptToken(NoMatchStartCloseTag)\n for (let cx = stack.context; cx; cx = cx.parent) if (cx.name == name) return\n input.acceptToken(MismatchedStartCloseTag);\n } else {\n if (name == \"script\") return input.acceptToken(StartScriptTag)\n if (name == \"style\") return input.acceptToken(StartStyleTag)\n if (name == \"textarea\") return input.acceptToken(StartTextareaTag)\n if (selfClosers$1.hasOwnProperty(name)) return input.acceptToken(StartSelfClosingTag)\n if (parent && closeOnOpen[parent] && closeOnOpen[parent][name]) input.acceptToken(missingCloseTag, -1);\n else input.acceptToken(StartTag);\n }\n }, {contextual: true});\n\n const commentContent = new ExternalTokenizer(input => {\n for (let dashes = 0, i = 0;; i++) {\n if (input.next < 0) {\n if (i) input.acceptToken(commentContent$1);\n break\n }\n if (input.next == dash$1) {\n dashes++;\n } else if (input.next == greaterThan && dashes >= 2) {\n if (i >= 3) input.acceptToken(commentContent$1, -2);\n break\n } else {\n dashes = 0;\n }\n input.advance();\n }\n });\n\n function inForeignElement(context) {\n for (; context; context = context.parent)\n if (context.name == \"svg\" || context.name == \"math\") return true\n return false\n }\n\n const endTag = new ExternalTokenizer((input, stack) => {\n if (input.next == slash$1 && input.peek(1) == greaterThan) {\n let selfClosing = stack.dialectEnabled(Dialect_selfClosing) || inForeignElement(stack.context);\n input.acceptToken(selfClosing ? SelfClosingEndTag : EndTag, 2);\n } else if (input.next == greaterThan) {\n input.acceptToken(EndTag, 1);\n }\n });\n\n function contentTokenizer(tag, textToken, endToken) {\n let lastState = 2 + tag.length;\n return new ExternalTokenizer(input => {\n // state means:\n // - 0 nothing matched\n // - 1 '<' matched\n // - 2 '</' + possibly whitespace matched\n // - 3-(1+tag.length) part of the tag matched\n // - lastState whole tag + possibly whitespace matched\n for (let state = 0, matchedLen = 0, i = 0;; i++) {\n if (input.next < 0) {\n if (i) input.acceptToken(textToken);\n break\n }\n if (state == 0 && input.next == lessThan ||\n state == 1 && input.next == slash$1 ||\n state >= 2 && state < lastState && input.next == tag.charCodeAt(state - 2)) {\n state++;\n matchedLen++;\n } else if ((state == 2 || state == lastState) && isSpace(input.next)) {\n matchedLen++;\n } else if (state == lastState && input.next == greaterThan) {\n if (i > matchedLen)\n input.acceptToken(textToken, -matchedLen);\n else\n input.acceptToken(endToken, -(matchedLen - 2));\n break\n } else if ((input.next == 10 /* '\\n' */ || input.next == 13 /* '\\r' */) && i) {\n input.acceptToken(textToken, 1);\n break\n } else {\n state = matchedLen = 0;\n }\n input.advance();\n }\n })\n }\n\n const scriptTokens = contentTokenizer(\"script\", scriptText, StartCloseScriptTag);\n\n const styleTokens = contentTokenizer(\"style\", styleText, StartCloseStyleTag);\n\n const textareaTokens = contentTokenizer(\"textarea\", textareaText, StartCloseTextareaTag);\n\n const htmlHighlighting = styleTags({\n \"Text RawText\": tags$1.content,\n \"StartTag StartCloseTag SelfClosingEndTag EndTag\": tags$1.angleBracket,\n TagName: tags$1.tagName,\n \"MismatchedCloseTag/TagName\": [tags$1.tagName, tags$1.invalid],\n AttributeName: tags$1.attributeName,\n \"AttributeValue UnquotedAttributeValue\": tags$1.attributeValue,\n Is: tags$1.definitionOperator,\n \"EntityReference CharacterReference\": tags$1.character,\n Comment: tags$1.blockComment,\n ProcessingInst: tags$1.processingInstruction,\n DoctypeDecl: tags$1.documentMeta\n });\n\n // This file was generated by lezer-generator. You probably shouldn't edit it.\n const parser$3 = LRParser.deserialize({\n version: 14,\n states: \",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W-E7WO(SQ&rO'#CsOOQW'#DZ'#DZO(bQ&rO1G.wOOOa1G.w1G.wOOO`1G/Y1G/YO(mQ&rO1G/QOOOb1G/Q1G/QO(xQ&rO1G/TOOOd1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uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~\",\n goto: \"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^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\",\n nodeNames: \"\u26A0 StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag 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\",\n maxTerm: 67,\n context: elementContext,\n nodeProps: [\n [\"closedBy\", -10,1,2,3,7,8,9,10,11,12,13,\"EndTag\",6,\"EndTag SelfClosingEndTag\",-4,21,30,33,36,\"CloseTag\"],\n [\"openedBy\", 4,\"StartTag StartCloseTag\",5,\"StartTag\",-4,29,32,35,37,\"OpenTag\"],\n [\"group\", -9,14,17,18,19,20,39,40,41,42,\"Entity\",16,\"Entity TextContent\",-3,28,31,34,\"TextContent Entity\"],\n [\"isolate\", -11,21,29,30,32,33,35,36,37,38,41,42,\"ltr\",-3,26,27,39,\"\"]\n ],\n propSources: [htmlHighlighting],\n skippedNodes: [0],\n repeatNodeCount: 9,\n tokenData: \"!<p!aR!YOX$qXY,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8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXiS`P!a`!cpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X\",\n tokenizers: [scriptTokens, styleTokens, textareaTokens, endTag, tagStart, commentContent, 0, 1, 2, 3, 4, 5],\n topRules: {\"Document\":[0,15]},\n dialects: {noMatch: 0, selfClosing: 509},\n tokenPrec: 511\n });\n\n function getAttrs(openTag, input) {\n let attrs = Object.create(null);\n for (let att of openTag.getChildren(Attribute)) {\n let name = att.getChild(AttributeName), value = att.getChild(AttributeValue) || att.getChild(UnquotedAttributeValue);\n if (name) attrs[input.read(name.from, name.to)] =\n !value ? \"\" : value.type.id == AttributeValue ? input.read(value.from + 1, value.to - 1) : input.read(value.from, value.to);\n }\n return attrs\n }\n\n function findTagName(openTag, input) {\n let tagNameNode = openTag.getChild(TagName);\n return tagNameNode ? input.read(tagNameNode.from, tagNameNode.to) : \" \"\n }\n\n function maybeNest(node, input, tags) {\n let attrs;\n for (let tag of tags) {\n if (!tag.attrs || tag.attrs(attrs || (attrs = getAttrs(node.node.parent.firstChild, input))))\n return {parser: tag.parser}\n }\n return null\n }\n\n // tags?: {\n // tag: string,\n // attrs?: ({[attr: string]: string}) => boolean,\n // parser: Parser\n // }[]\n // attributes?: {\n // name: string,\n // tagName?: string,\n // parser: Parser\n // }[]\n \n function configureNesting(tags = [], attributes = []) {\n let script = [], style = [], textarea = [], other = [];\n for (let tag of tags) {\n let array = tag.tag == \"script\" ? script : tag.tag == \"style\" ? style : tag.tag == \"textarea\" ? textarea : other;\n array.push(tag);\n }\n let attrs = attributes.length ? Object.create(null) : null;\n for (let attr of attributes) (attrs[attr.name] || (attrs[attr.name] = [])).push(attr);\n\n return parseMixed((node, input) => {\n let id = node.type.id;\n if (id == ScriptText) return maybeNest(node, input, script)\n if (id == StyleText) return maybeNest(node, input, style)\n if (id == TextareaText) return maybeNest(node, input, textarea)\n\n if (id == Element && other.length) {\n let n = node.node, open = n.firstChild, tagName = open && findTagName(open, input), attrs;\n if (tagName) for (let tag of other) {\n if (tag.tag == tagName && (!tag.attrs || tag.attrs(attrs || (attrs = getAttrs(open, input))))) {\n let close = n.lastChild;\n let to = close.type.id == CloseTag ? close.from : n.to;\n if (to > open.to)\n return {parser: tag.parser, overlay: [{from: open.to, to}]}\n }\n }\n }\n\n if (attrs && id == Attribute) {\n let n = node.node, nameNode;\n if (nameNode = n.firstChild) {\n let matches = attrs[input.read(nameNode.from, nameNode.to)];\n if (matches) for (let attr of matches) {\n if (attr.tagName && attr.tagName != findTagName(n.parent, input)) continue\n let value = n.lastChild;\n if (value.type.id == AttributeValue) {\n let from = value.from + 1;\n let last = value.lastChild, to = value.to - (last && last.isError ? 0 : 1);\n if (to > from) return {parser: attr.parser, overlay: [{from, to}]}\n } else if (value.type.id == UnquotedAttributeValue) {\n return {parser: attr.parser, overlay: [{from: value.from, to: value.to}]}\n }\n }\n }\n }\n return null\n })\n }\n\n // This file was generated by lezer-generator. You probably shouldn't edit it.\n const descendantOp = 99,\n Unit = 1,\n callee = 100,\n identifier$2 = 101,\n VariableName = 2;\n\n /* Hand-written tokenizers for CSS tokens that can't be\n expressed by Lezer's built-in tokenizer. */\n\n const space$1 = [9, 10, 11, 12, 13, 32, 133, 160, 5760, 8192, 8193, 8194, 8195, 8196, 8197,\n 8198, 8199, 8200, 8201, 8202, 8232, 8233, 8239, 8287, 12288];\n const colon = 58, parenL = 40, underscore = 95, bracketL = 91, dash = 45, period = 46,\n hash = 35, percent = 37, ampersand = 38, backslash = 92, newline$1 = 10;\n\n function isAlpha$2(ch) { return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch >= 161 }\n\n function isDigit(ch) { return ch >= 48 && ch <= 57 }\n\n const identifiers = new ExternalTokenizer((input, stack) => {\n for (let inside = false, dashes = 0, i = 0;; i++) {\n let {next} = input;\n if (isAlpha$2(next) || next == dash || next == underscore || (inside && isDigit(next))) {\n if (!inside && (next != dash || i > 0)) inside = true;\n if (dashes === i && next == dash) dashes++;\n input.advance();\n } else if (next == backslash && input.peek(1) != newline$1) {\n input.advance();\n if (input.next > -1) input.advance();\n inside = true;\n } else {\n if (inside)\n input.acceptToken(next == parenL ? callee : dashes == 2 && stack.canShift(VariableName) ? VariableName : identifier$2);\n break\n }\n }\n });\n\n const descendant = new ExternalTokenizer(input => {\n if (space$1.includes(input.peek(-1))) {\n let {next} = input;\n if (isAlpha$2(next) || next == underscore || next == hash || next == period ||\n next == bracketL || next == colon && isAlpha$2(input.peek(1)) ||\n next == dash || next == ampersand)\n input.acceptToken(descendantOp);\n }\n });\n\n const unitToken = new ExternalTokenizer(input => {\n if (!space$1.includes(input.peek(-1))) {\n let {next} = input;\n if (next == percent) { input.advance(); input.acceptToken(Unit); }\n if (isAlpha$2(next)) {\n do { input.advance(); } while (isAlpha$2(input.next) || isDigit(input.next))\n input.acceptToken(Unit);\n }\n }\n });\n\n const cssHighlighting = styleTags({\n \"AtKeyword import charset namespace keyframes media supports\": tags$1.definitionKeyword,\n \"from to selector\": tags$1.keyword,\n NamespaceName: tags$1.namespace,\n KeyframeName: tags$1.labelName,\n KeyframeRangeName: tags$1.operatorKeyword,\n TagName: tags$1.tagName,\n ClassName: tags$1.className,\n PseudoClassName: tags$1.constant(tags$1.className),\n IdName: tags$1.labelName,\n \"FeatureName PropertyName\": tags$1.propertyName,\n AttributeName: tags$1.attributeName,\n NumberLiteral: tags$1.number,\n KeywordQuery: tags$1.keyword,\n UnaryQueryOp: tags$1.operatorKeyword,\n \"CallTag ValueName\": tags$1.atom,\n VariableName: tags$1.variableName,\n Callee: tags$1.operatorKeyword,\n Unit: tags$1.unit,\n \"UniversalSelector NestingSelector\": tags$1.definitionOperator,\n MatchOp: tags$1.compareOperator,\n \"ChildOp SiblingOp, LogicOp\": tags$1.logicOperator,\n BinOp: tags$1.arithmeticOperator,\n Important: tags$1.modifier,\n Comment: tags$1.blockComment,\n ColorLiteral: tags$1.color,\n \"ParenthesizedContent StringLiteral\": tags$1.string,\n \":\": tags$1.punctuation,\n \"PseudoOp #\": tags$1.derefOperator,\n \"; ,\": tags$1.separator,\n \"( )\": tags$1.paren,\n \"[ ]\": tags$1.squareBracket,\n \"{ }\": tags$1.brace\n });\n\n // This file was generated by lezer-generator. You probably shouldn't edit it.\n const spec_callee = {__proto__:null,lang:32, \"nth-child\":32, \"nth-last-child\":32, \"nth-of-type\":32, \"nth-last-of-type\":32, dir:32, \"host-context\":32, url:60, \"url-prefix\":60, domain:60, regexp:60, selector:138};\n const spec_AtKeyword = {__proto__:null,\"@import\":118, \"@media\":142, \"@charset\":146, \"@namespace\":150, \"@keyframes\":156, \"@supports\":168};\n const spec_identifier$1 = {__proto__:null,not:132, only:132};\n const parser$2 = LRParser.deserialize({\n version: 14,\n states: \":^QYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59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YR%S$qQ#_!ZR$W#_Q$r$PR%T$rQpUS!vp$nR$n#|Q$j#qR%P$jQ!ogS#t!o#uR#u!pQ#f!_R$^#fQ$f#mR$|$fQ$z$eR%W$z_cOPdhw!n#s^UOPdhw!n#sQ!uoQ!}tQ#OuQ#PvQ#|#RR$_#hR$Q#SQ!VZQ!d]Q#V!TQ#q!m[$O#S$P$Y$q$v%SQ$R#UQ$T#XS$h#q$jQ$m#zR%O$iR#}#RQiPR#QwQ!c[Q!kaR#Y!VU!_[a!VQ!j`Q#c!^Q#g!`Q$[#dR$]#e\",\n nodeNames: \"\u26A0 Unit VariableName Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee CallLiteral CallTag ParenthesizedContent ] [ LineNames LineName , PseudoClassName ArgList IdSelector # IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp } { Block Declaration PropertyName Important ; ImportStatement AtKeyword import KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports AtRule Styles\",\n maxTerm: 117,\n nodeProps: [\n [\"isolate\", -2,3,24,\"\"],\n [\"openedBy\", 17,\"(\",32,\"[\",50,\"{\"],\n [\"closedBy\", 18,\")\",33,\"]\",51,\"}\"]\n ],\n propSources: [cssHighlighting],\n skippedNodes: [0,3,87],\n repeatNodeCount: 11,\n tokenData: \"J^~R!^OX$}X^%u^p$}pq%uqr)Xrs.Rst/utu6duv$}vw7^wx7oxy9^yz9oz{9t{|:_|}?Q}!O?c!O!P@Q!P!Q@i!Q![Ab![!]B]!]!^CX!^!_$}!_!`Cj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o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}\",\n tokenizers: [descendant, unitToken, identifiers, 1, 2, 3, 4, new LocalTokenGroup(\"m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~\", 28, 105)],\n topRules: {\"StyleSheet\":[0,4],\"Styles\":[1,86]},\n specialized: [{term: 100, get: (value) => spec_callee[value] || -1},{term: 58, get: (value) => spec_AtKeyword[value] || -1},{term: 101, get: (value) => spec_identifier$1[value] || -1}],\n tokenPrec: 1200\n });\n\n let _properties = null;\n function properties() {\n if (!_properties && typeof document == \"object\" && document.body) {\n let { style } = document.body, names = [], seen = new Set;\n for (let prop in style)\n if (prop != \"cssText\" && prop != \"cssFloat\") {\n if (typeof style[prop] == \"string\") {\n if (/[A-Z]/.test(prop))\n prop = prop.replace(/[A-Z]/g, ch => \"-\" + ch.toLowerCase());\n if (!seen.has(prop)) {\n names.push(prop);\n seen.add(prop);\n }\n }\n }\n _properties = names.sort().map(name => ({ type: \"property\", label: name }));\n }\n return _properties || [];\n }\n const pseudoClasses = /*@__PURE__*/[\n \"active\", \"after\", \"any-link\", \"autofill\", \"backdrop\", \"before\",\n \"checked\", \"cue\", \"default\", \"defined\", \"disabled\", \"empty\",\n \"enabled\", \"file-selector-button\", \"first\", \"first-child\",\n \"first-letter\", \"first-line\", \"first-of-type\", \"focus\",\n \"focus-visible\", \"focus-within\", \"fullscreen\", \"has\", \"host\",\n \"host-context\", \"hover\", \"in-range\", \"indeterminate\", \"invalid\",\n \"is\", \"lang\", \"last-child\", \"last-of-type\", \"left\", \"link\", \"marker\",\n \"modal\", \"not\", \"nth-child\", \"nth-last-child\", \"nth-last-of-type\",\n \"nth-of-type\", \"only-child\", \"only-of-type\", \"optional\", \"out-of-range\",\n \"part\", \"placeholder\", \"placeholder-shown\", \"read-only\", \"read-write\",\n \"required\", \"right\", \"root\", \"scope\", \"selection\", \"slotted\", \"target\",\n \"target-text\", \"valid\", \"visited\", \"where\"\n ].map(name => ({ type: \"class\", label: name }));\n const values = /*@__PURE__*/[\n \"above\", \"absolute\", \"activeborder\", \"additive\", \"activecaption\", \"after-white-space\",\n \"ahead\", \"alias\", \"all\", \"all-scroll\", \"alphabetic\", \"alternate\", \"always\",\n \"antialiased\", \"appworkspace\", \"asterisks\", \"attr\", \"auto\", \"auto-flow\", \"avoid\", \"avoid-column\",\n \"avoid-page\", \"avoid-region\", \"axis-pan\", \"background\", \"backwards\", \"baseline\", \"below\",\n \"bidi-override\", \"blink\", \"block\", \"block-axis\", \"bold\", \"bolder\", \"border\", \"border-box\",\n \"both\", \"bottom\", \"break\", \"break-all\", \"break-word\", \"bullets\", \"button\", \"button-bevel\",\n \"buttonface\", \"buttonhighlight\", \"buttonshadow\", \"buttontext\", \"calc\", \"capitalize\",\n \"caps-lock-indicator\", \"caption\", \"captiontext\", \"caret\", \"cell\", \"center\", \"checkbox\", \"circle\",\n \"cjk-decimal\", \"clear\", \"clip\", \"close-quote\", \"col-resize\", \"collapse\", \"color\", \"color-burn\",\n \"color-dodge\", \"column\", \"column-reverse\", \"compact\", \"condensed\", \"contain\", \"content\",\n \"contents\", \"content-box\", \"context-menu\", \"continuous\", \"copy\", \"counter\", \"counters\", \"cover\",\n \"crop\", \"cross\", \"crosshair\", \"currentcolor\", \"cursive\", \"cyclic\", \"darken\", \"dashed\", \"decimal\",\n \"decimal-leading-zero\", \"default\", \"default-button\", \"dense\", \"destination-atop\", \"destination-in\",\n \"destination-out\", \"destination-over\", \"difference\", \"disc\", \"discard\", \"disclosure-closed\",\n \"disclosure-open\", \"document\", \"dot-dash\", \"dot-dot-dash\", \"dotted\", \"double\", \"down\", \"e-resize\",\n \"ease\", \"ease-in\", \"ease-in-out\", \"ease-out\", \"element\", \"ellipse\", \"ellipsis\", \"embed\", \"end\",\n \"ethiopic-abegede-gez\", \"ethiopic-halehame-aa-er\", \"ethiopic-halehame-gez\", \"ew-resize\", \"exclusion\",\n \"expanded\", \"extends\", \"extra-condensed\", \"extra-expanded\", \"fantasy\", \"fast\", \"fill\", \"fill-box\",\n \"fixed\", \"flat\", \"flex\", \"flex-end\", \"flex-start\", \"footnotes\", \"forwards\", \"from\",\n \"geometricPrecision\", \"graytext\", \"grid\", \"groove\", \"hand\", \"hard-light\", \"help\", \"hidden\", \"hide\",\n \"higher\", \"highlight\", \"highlighttext\", \"horizontal\", \"hsl\", \"hsla\", \"hue\", \"icon\", \"ignore\",\n \"inactiveborder\", \"inactivecaption\", \"inactivecaptiontext\", \"infinite\", \"infobackground\", \"infotext\",\n \"inherit\", \"initial\", \"inline\", \"inline-axis\", \"inline-block\", \"inline-flex\", \"inline-grid\",\n \"inline-table\", \"inset\", \"inside\", \"intrinsic\", \"invert\", \"italic\", \"justify\", \"keep-all\",\n \"landscape\", \"large\", \"larger\", \"left\", \"level\", \"lighter\", \"lighten\", \"line-through\", \"linear\",\n \"linear-gradient\", \"lines\", \"list-item\", \"listbox\", \"listitem\", \"local\", \"logical\", \"loud\", \"lower\",\n \"lower-hexadecimal\", \"lower-latin\", \"lower-norwegian\", \"lowercase\", \"ltr\", \"luminosity\", \"manipulation\",\n \"match\", \"matrix\", \"matrix3d\", \"medium\", \"menu\", \"menutext\", \"message-box\", \"middle\", \"min-intrinsic\",\n \"mix\", \"monospace\", \"move\", \"multiple\", \"multiple_mask_images\", \"multiply\", \"n-resize\", \"narrower\",\n \"ne-resize\", \"nesw-resize\", \"no-close-quote\", \"no-drop\", \"no-open-quote\", \"no-repeat\", \"none\",\n \"normal\", \"not-allowed\", \"nowrap\", \"ns-resize\", \"numbers\", \"numeric\", \"nw-resize\", \"nwse-resize\",\n \"oblique\", \"opacity\", \"open-quote\", \"optimizeLegibility\", \"optimizeSpeed\", \"outset\", \"outside\",\n \"outside-shape\", \"overlay\", \"overline\", \"padding\", \"padding-box\", \"painted\", \"page\", \"paused\",\n \"perspective\", \"pinch-zoom\", \"plus-darker\", \"plus-lighter\", \"pointer\", \"polygon\", \"portrait\",\n \"pre\", \"pre-line\", \"pre-wrap\", \"preserve-3d\", \"progress\", \"push-button\", \"radial-gradient\", \"radio\",\n \"read-only\", \"read-write\", \"read-write-plaintext-only\", \"rectangle\", \"region\", \"relative\", \"repeat\",\n \"repeating-linear-gradient\", \"repeating-radial-gradient\", \"repeat-x\", \"repeat-y\", \"reset\", \"reverse\",\n \"rgb\", \"rgba\", \"ridge\", \"right\", \"rotate\", \"rotate3d\", \"rotateX\", \"rotateY\", \"rotateZ\", \"round\",\n \"row\", \"row-resize\", \"row-reverse\", \"rtl\", \"run-in\", \"running\", \"s-resize\", \"sans-serif\", \"saturation\",\n \"scale\", \"scale3d\", \"scaleX\", \"scaleY\", \"scaleZ\", \"screen\", \"scroll\", \"scrollbar\", \"scroll-position\",\n \"se-resize\", \"self-start\", \"self-end\", \"semi-condensed\", \"semi-expanded\", \"separate\", \"serif\", \"show\",\n \"single\", \"skew\", \"skewX\", \"skewY\", \"skip-white-space\", \"slide\", \"slider-horizontal\",\n \"slider-vertical\", \"sliderthumb-horizontal\", \"sliderthumb-vertical\", \"slow\", \"small\", \"small-caps\",\n \"small-caption\", \"smaller\", \"soft-light\", \"solid\", \"source-atop\", \"source-in\", \"source-out\",\n \"source-over\", \"space\", \"space-around\", \"space-between\", \"space-evenly\", \"spell-out\", \"square\", \"start\",\n \"static\", \"status-bar\", \"stretch\", \"stroke\", \"stroke-box\", \"sub\", \"subpixel-antialiased\", \"svg_masks\",\n \"super\", \"sw-resize\", \"symbolic\", \"symbols\", \"system-ui\", \"table\", \"table-caption\", \"table-cell\",\n \"table-column\", \"table-column-group\", \"table-footer-group\", \"table-header-group\", \"table-row\",\n \"table-row-group\", \"text\", \"text-bottom\", \"text-top\", \"textarea\", \"textfield\", \"thick\", \"thin\",\n \"threeddarkshadow\", \"threedface\", \"threedhighlight\", \"threedlightshadow\", \"threedshadow\", \"to\", \"top\",\n \"transform\", \"translate\", \"translate3d\", \"translateX\", \"translateY\", \"translateZ\", \"transparent\",\n \"ultra-condensed\", \"ultra-expanded\", \"underline\", \"unidirectional-pan\", \"unset\", \"up\", \"upper-latin\",\n \"uppercase\", \"url\", \"var\", \"vertical\", \"vertical-text\", \"view-box\", \"visible\", \"visibleFill\",\n \"visiblePainted\", \"visibleStroke\", \"visual\", \"w-resize\", \"wait\", \"wave\", \"wider\", \"window\", \"windowframe\",\n \"windowtext\", \"words\", \"wrap\", \"wrap-reverse\", \"x-large\", \"x-small\", \"xor\", \"xx-large\", \"xx-small\"\n ].map(name => ({ type: \"keyword\", label: name })).concat(/*@__PURE__*/[\n \"aliceblue\", \"antiquewhite\", \"aqua\", \"aquamarine\", \"azure\", \"beige\",\n \"bisque\", \"black\", \"blanchedalmond\", \"blue\", \"blueviolet\", \"brown\",\n \"burlywood\", \"cadetblue\", \"chartreuse\", \"chocolate\", \"coral\", \"cornflowerblue\",\n \"cornsilk\", \"crimson\", \"cyan\", \"darkblue\", \"darkcyan\", \"darkgoldenrod\",\n \"darkgray\", \"darkgreen\", \"darkkhaki\", \"darkmagenta\", \"darkolivegreen\",\n \"darkorange\", \"darkorchid\", \"darkred\", \"darksalmon\", \"darkseagreen\",\n \"darkslateblue\", \"darkslategray\", \"darkturquoise\", \"darkviolet\",\n \"deeppink\", \"deepskyblue\", \"dimgray\", \"dodgerblue\", \"firebrick\",\n \"floralwhite\", \"forestgreen\", \"fuchsia\", \"gainsboro\", \"ghostwhite\",\n \"gold\", \"goldenrod\", \"gray\", \"grey\", \"green\", \"greenyellow\", \"honeydew\",\n \"hotpink\", \"indianred\", \"indigo\", \"ivory\", \"khaki\", \"lavender\",\n \"lavenderblush\", \"lawngreen\", \"lemonchiffon\", \"lightblue\", \"lightcoral\",\n \"lightcyan\", \"lightgoldenrodyellow\", \"lightgray\", \"lightgreen\", \"lightpink\",\n \"lightsalmon\", \"lightseagreen\", \"lightskyblue\", \"lightslategray\",\n \"lightsteelblue\", \"lightyellow\", \"lime\", \"limegreen\", \"linen\", \"magenta\",\n \"maroon\", \"mediumaquamarine\", \"mediumblue\", \"mediumorchid\", \"mediumpurple\",\n \"mediumseagreen\", \"mediumslateblue\", \"mediumspringgreen\", \"mediumturquoise\",\n \"mediumvioletred\", \"midnightblue\", \"mintcream\", \"mistyrose\", \"moccasin\",\n \"navajowhite\", \"navy\", \"oldlace\", \"olive\", \"olivedrab\", \"orange\", \"orangered\",\n \"orchid\", \"palegoldenrod\", \"palegreen\", \"paleturquoise\", \"palevioletred\",\n \"papayawhip\", \"peachpuff\", \"peru\", \"pink\", \"plum\", \"powderblue\",\n \"purple\", \"rebeccapurple\", \"red\", \"rosybrown\", \"royalblue\", \"saddlebrown\",\n \"salmon\", \"sandybrown\", \"seagreen\", \"seashell\", \"sienna\", \"silver\", \"skyblue\",\n \"slateblue\", \"slategray\", \"snow\", \"springgreen\", \"steelblue\", \"tan\",\n \"teal\", \"thistle\", \"tomato\", \"turquoise\", \"violet\", \"wheat\", \"white\",\n \"whitesmoke\", \"yellow\", \"yellowgreen\"\n ].map(name => ({ type: \"constant\", label: name })));\n const tags = /*@__PURE__*/[\n \"a\", \"abbr\", \"address\", \"article\", \"aside\", \"b\", \"bdi\", \"bdo\", \"blockquote\", \"body\",\n \"br\", \"button\", \"canvas\", \"caption\", \"cite\", \"code\", \"col\", \"colgroup\", \"dd\", \"del\",\n \"details\", \"dfn\", \"dialog\", \"div\", \"dl\", \"dt\", \"em\", \"figcaption\", \"figure\", \"footer\",\n \"form\", \"header\", \"hgroup\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"hr\", \"html\", \"i\", \"iframe\",\n \"img\", \"input\", \"ins\", \"kbd\", \"label\", \"legend\", \"li\", \"main\", \"meter\", \"nav\", \"ol\", \"output\",\n \"p\", \"pre\", \"ruby\", \"section\", \"select\", \"small\", \"source\", \"span\", \"strong\", \"sub\", \"summary\",\n \"sup\", \"table\", \"tbody\", \"td\", \"template\", \"textarea\", \"tfoot\", \"th\", \"thead\", \"tr\", \"u\", \"ul\"\n ].map(name => ({ type: \"type\", label: name }));\n const identifier$1 = /^(\\w[\\w-]*|-\\w[\\w-]*|)$/, variable = /^-(-[\\w-]*)?$/;\n function isVarArg(node, doc) {\n var _a;\n if (node.name == \"(\" || node.type.isError)\n node = node.parent || node;\n if (node.name != \"ArgList\")\n return false;\n let callee = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.firstChild;\n if ((callee === null || callee === void 0 ? void 0 : callee.name) != \"Callee\")\n return false;\n return doc.sliceString(callee.from, callee.to) == \"var\";\n }\n const VariablesByNode = /*@__PURE__*/new NodeWeakMap();\n const declSelector = [\"Declaration\"];\n function astTop(node) {\n for (let cur = node;;) {\n if (cur.type.isTop)\n return cur;\n if (!(cur = cur.parent))\n return node;\n }\n }\n function variableNames(doc, node, isVariable) {\n if (node.to - node.from > 4096) {\n let known = VariablesByNode.get(node);\n if (known)\n return known;\n let result = [], seen = new Set, cursor = node.cursor(IterMode.IncludeAnonymous);\n if (cursor.firstChild())\n do {\n for (let option of variableNames(doc, cursor.node, isVariable))\n if (!seen.has(option.label)) {\n seen.add(option.label);\n result.push(option);\n }\n } while (cursor.nextSibling());\n VariablesByNode.set(node, result);\n return result;\n }\n else {\n let result = [], seen = new Set;\n node.cursor().iterate(node => {\n var _a;\n if (isVariable(node) && node.matchContext(declSelector) && ((_a = node.node.nextSibling) === null || _a === void 0 ? void 0 : _a.name) == \":\") {\n let name = doc.sliceString(node.from, node.to);\n if (!seen.has(name)) {\n seen.add(name);\n result.push({ label: name, type: \"variable\" });\n }\n }\n });\n return result;\n }\n }\n /**\n Create a completion source for a CSS dialect, providing a\n predicate for determining what kind of syntax node can act as a\n completable variable. This is used by language modes like Sass and\n Less to reuse this package's completion logic.\n */\n const defineCSSCompletionSource = (isVariable) => context => {\n let { state, pos } = context, node = syntaxTree(state).resolveInner(pos, -1);\n let isDash = node.type.isError && node.from == node.to - 1 && state.doc.sliceString(node.from, node.to) == \"-\";\n if (node.name == \"PropertyName\" ||\n (isDash || node.name == \"TagName\") && /^(Block|Styles)$/.test(node.resolve(node.to).name))\n return { from: node.from, options: properties(), validFor: identifier$1 };\n if (node.name == \"ValueName\")\n return { from: node.from, options: values, validFor: identifier$1 };\n if (node.name == \"PseudoClassName\")\n return { from: node.from, options: pseudoClasses, validFor: identifier$1 };\n if (isVariable(node) || (context.explicit || isDash) && isVarArg(node, state.doc))\n return { from: isVariable(node) || isDash ? node.from : pos,\n options: variableNames(state.doc, astTop(node), isVariable),\n validFor: variable };\n if (node.name == \"TagName\") {\n for (let { parent } = node; parent; parent = parent.parent)\n if (parent.name == \"Block\")\n return { from: node.from, options: properties(), validFor: identifier$1 };\n return { from: node.from, options: tags, validFor: identifier$1 };\n }\n if (!context.explicit)\n return null;\n let above = node.resolve(pos), before = above.childBefore(pos);\n if (before && before.name == \":\" && above.name == \"PseudoClassSelector\")\n return { from: pos, options: pseudoClasses, validFor: identifier$1 };\n if (before && before.name == \":\" && above.name == \"Declaration\" || above.name == \"ArgList\")\n return { from: pos, options: values, validFor: identifier$1 };\n if (above.name == \"Block\" || above.name == \"Styles\")\n return { from: pos, options: properties(), validFor: identifier$1 };\n return null;\n };\n /**\n CSS property, variable, and value keyword completion source.\n */\n const cssCompletionSource = /*@__PURE__*/defineCSSCompletionSource(n => n.name == \"VariableName\");\n\n /**\n A language provider based on the [Lezer CSS\n parser](https://github.com/lezer-parser/css), extended with\n highlighting and indentation information.\n */\n const cssLanguage = /*@__PURE__*/LRLanguage.define({\n name: \"css\",\n parser: /*@__PURE__*/parser$2.configure({\n props: [\n /*@__PURE__*/indentNodeProp.add({\n Declaration: /*@__PURE__*/continuedIndent()\n }),\n /*@__PURE__*/foldNodeProp.add({\n \"Block KeyframeList\": foldInside\n })\n ]\n }),\n languageData: {\n commentTokens: { block: { open: \"/*\", close: \"*/\" } },\n indentOnInput: /^\\s*\\}$/,\n wordChars: \"-\"\n }\n });\n /**\n Language support for CSS.\n */\n function css$1() {\n return new LanguageSupport(cssLanguage, cssLanguage.data.of({ autocomplete: cssCompletionSource }));\n }\n\n // This file was generated by lezer-generator. You probably shouldn't edit it.\n const noSemi = 312,\n incdec = 1,\n incdecPrefix = 2,\n questionDot = 3,\n JSXStartTag = 4,\n insertSemi = 313,\n spaces = 315,\n newline = 316,\n LineComment = 5,\n BlockComment = 6,\n Dialect_jsx = 0;\n\n /* Hand-written tokenizers for JavaScript tokens that can't be\n expressed by lezer's built-in tokenizer. */\n\n const space = [9, 10, 11, 12, 13, 32, 133, 160, 5760, 8192, 8193, 8194, 8195, 8196, 8197, 8198, 8199, 8200,\n 8201, 8202, 8232, 8233, 8239, 8287, 12288];\n\n const braceR = 125, semicolon = 59, slash = 47, star = 42, plus = 43, minus = 45, lt = 60, comma = 44,\n question = 63, dot = 46;\n\n const trackNewline = new ContextTracker({\n start: false,\n shift(context, term) {\n return term == LineComment || term == BlockComment || term == spaces ? context : term == newline\n },\n strict: false\n });\n\n const insertSemicolon = new ExternalTokenizer((input, stack) => {\n let {next} = input;\n if (next == braceR || next == -1 || stack.context)\n input.acceptToken(insertSemi);\n }, {contextual: true, fallback: true});\n\n const noSemicolon = new ExternalTokenizer((input, stack) => {\n let {next} = input, after;\n if (space.indexOf(next) > -1) return\n if (next == slash && ((after = input.peek(1)) == slash || after == star)) return\n if (next != braceR && next != semicolon && next != -1 && !stack.context)\n input.acceptToken(noSemi);\n }, {contextual: true});\n\n const operatorToken = new ExternalTokenizer((input, stack) => {\n let {next} = input;\n if (next == plus || next == minus) {\n input.advance();\n if (next == input.next) {\n input.advance();\n let mayPostfix = !stack.context && stack.canShift(incdec);\n input.acceptToken(mayPostfix ? incdec : incdecPrefix);\n }\n } else if (next == question && input.peek(1) == dot) {\n input.advance(); input.advance();\n if (input.next < 48 || input.next > 57) // No digit after\n input.acceptToken(questionDot);\n }\n }, {contextual: true});\n\n function identifierChar(ch, start) {\n return ch >= 65 && ch <= 90 || ch >= 97 && ch <= 122 || ch == 95 || ch >= 192 ||\n !start && ch >= 48 && ch <= 57\n }\n\n const jsx$1 = new ExternalTokenizer((input, stack) => {\n if (input.next != lt || !stack.dialectEnabled(Dialect_jsx)) return\n input.advance();\n if (input.next == slash) return\n // Scan for an identifier followed by a comma or 'extends', don't\n // treat this as a start tag if present.\n let back = 0;\n while (space.indexOf(input.next) > -1) { input.advance(); back++; }\n if (identifierChar(input.next, true)) {\n input.advance();\n back++;\n while (identifierChar(input.next, false)) { input.advance(); back++; }\n while (space.indexOf(input.next) > -1) { input.advance(); back++; }\n if (input.next == comma) return\n for (let i = 0;; i++) {\n if (i == 7) {\n if (!identifierChar(input.next, true)) return\n break\n }\n if (input.next != \"extends\".charCodeAt(i)) break\n input.advance();\n back++;\n }\n }\n input.acceptToken(JSXStartTag, -back);\n });\n\n const jsHighlight = styleTags({\n \"get set async static\": tags$1.modifier,\n \"for while do if else switch try catch finally return throw break continue default case\": tags$1.controlKeyword,\n \"in of await yield void typeof delete instanceof\": tags$1.operatorKeyword,\n \"let var const using function class extends\": tags$1.definitionKeyword,\n \"import export from\": tags$1.moduleKeyword,\n \"with debugger as new\": tags$1.keyword,\n TemplateString: tags$1.special(tags$1.string),\n super: tags$1.atom,\n BooleanLiteral: tags$1.bool,\n this: tags$1.self,\n null: tags$1.null,\n Star: tags$1.modifier,\n VariableName: tags$1.variableName,\n \"CallExpression/VariableName TaggedTemplateExpression/VariableName\": tags$1.function(tags$1.variableName),\n VariableDefinition: tags$1.definition(tags$1.variableName),\n Label: tags$1.labelName,\n PropertyName: tags$1.propertyName,\n PrivatePropertyName: tags$1.special(tags$1.propertyName),\n \"CallExpression/MemberExpression/PropertyName\": tags$1.function(tags$1.propertyName),\n \"FunctionDeclaration/VariableDefinition\": tags$1.function(tags$1.definition(tags$1.variableName)),\n \"ClassDeclaration/VariableDefinition\": tags$1.definition(tags$1.className),\n PropertyDefinition: tags$1.definition(tags$1.propertyName),\n PrivatePropertyDefinition: tags$1.definition(tags$1.special(tags$1.propertyName)),\n UpdateOp: tags$1.updateOperator,\n \"LineComment Hashbang\": tags$1.lineComment,\n BlockComment: tags$1.blockComment,\n Number: tags$1.number,\n String: tags$1.string,\n Escape: tags$1.escape,\n ArithOp: tags$1.arithmeticOperator,\n LogicOp: tags$1.logicOperator,\n BitOp: tags$1.bitwiseOperator,\n CompareOp: tags$1.compareOperator,\n RegExp: tags$1.regexp,\n Equals: tags$1.definitionOperator,\n Arrow: tags$1.function(tags$1.punctuation),\n \": Spread\": tags$1.punctuation,\n \"( )\": tags$1.paren,\n \"[ ]\": tags$1.squareBracket,\n \"{ }\": tags$1.brace,\n \"InterpolationStart InterpolationEnd\": tags$1.special(tags$1.brace),\n \".\": tags$1.derefOperator,\n \", ;\": tags$1.separator,\n \"@\": tags$1.meta,\n\n TypeName: tags$1.typeName,\n TypeDefinition: tags$1.definition(tags$1.typeName),\n \"type enum interface implements namespace module declare\": tags$1.definitionKeyword,\n \"abstract global Privacy readonly override\": tags$1.modifier,\n \"is keyof unique infer\": tags$1.operatorKeyword,\n\n JSXAttributeValue: tags$1.attributeValue,\n JSXText: tags$1.content,\n \"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag\": tags$1.angleBracket,\n \"JSXIdentifier JSXNameSpacedName\": tags$1.tagName,\n \"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName\": tags$1.attributeName,\n \"JSXBuiltin/JSXIdentifier\": tags$1.standard(tags$1.tagName)\n });\n\n // This file was generated by lezer-generator. You probably shouldn't edit it.\n const spec_identifier = {__proto__:null,export:20, as:25, from:33, default:36, async:41, function:42, extends:54, this:58, true:66, false:66, null:78, void:82, typeof:86, super:102, new:136, delete:148, yield:157, await:161, class:166, public:229, private:229, protected:229, readonly:231, instanceof:250, satisfies:253, in:254, const:256, import:290, keyof:345, unique:349, infer:355, is:391, abstract:411, implements:413, type:415, let:418, var:420, using:423, interface:429, enum:433, namespace:439, module:441, declare:445, global:449, for:468, of:477, while:480, with:484, do:488, if:492, else:494, switch:498, case:504, try:510, catch:514, finally:518, return:522, throw:526, break:530, continue:534, debugger:538};\n const spec_word = {__proto__:null,async:123, get:125, set:127, declare:189, public:191, private:191, protected:191, static:193, abstract:195, override:197, readonly:203, accessor:205, new:395};\n const spec_LessThan = {__proto__:null,\"<\":187};\n const parser$1 = LRParser.deserialize({\n version: 14,\n states: \"$@QO%TQ^OOO%[Q^OOO'_Q`OOP(lOWOOO*zQ?NdO'#CiO+RO!bO'#CjO+aO#tO'#CjO+oO!0LbO'#D^O.QQ^O'#DdO.bQ^O'#DoO%[Q^O'#DwO0fQ^O'#EPOOQ?Mr'#EX'#EXO1PQWO'#EUOOQO'#Em'#EmOOQO'#Ih'#IhO1XQWO'#GpO1dQWO'#ElO1iQWO'#ElO3hQ?NdO'#JmO6[Q?NdO'#JnO6uQWO'#F[O6zQ&jO'#FsOOQ?Mr'#Fe'#FeO7VO,YO'#FeO7eQ7[O'#FzO9RQWO'#FyOOQ?Mr'#Jn'#JnOOQ?Mp'#Jm'#JmO9WQWO'#GtOOQU'#KZ'#KZO9cQWO'#IUO9hQ?MxO'#IVOOQU'#JZ'#JZOOQU'#IZ'#IZQ`Q^OOO`Q^OOO9pQMnO'#DsO9wQ^O'#D{O:OQ^O'#D}O9^QWO'#GpO:VQ7[O'#CoO:eQWO'#EkO:pQWO'#EvO:uQ7[O'#FdO;dQWO'#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3q;iQ3r;vQ3y;dQ4r0gQ4{0vQ6_;xQ6e2rQ6j2xQ6y3^Q6z;yQ7T;{Q7U<TQ7}5`Q8l6]Q8p6fQ8z<UQ9Q<_Q9R<`Q9{8rQ:`9hQ:g9yQ;R#SR<o<{R#[WR'W!el!tQ!r!v!y!z']'i'j'k-]-m1a5e5gS'S!e-TS-Q'T'[R2g-ZR(w#xQ!fQT-[']-]]!qQ!r']-]1a5eQ#p]R'f;QR)b$dY!uQ']-]1a5eQ'h!rS'r!v!yS't!z5gS-l'i'jQ-n'kR2u-mT#kZ%cS#jZ%cS%im,gU(c#h#i#lS.Q(d(eQ.U(fQ0i+WQ2z.RU2{.S.T.VS6l2|2}R8s6md#^W#W#Z%f(P(Y*U+T-{/er#gZm#h#i#l%c(d(e(f+W.R.S.T.V2|2}6mS*X$x*]Q/l*YQ1v,gQ2^,}Q4P/hQ6Z2UQ7[4QQ8k6[T<g'U+UV#aW%f*UU#`W%f*US(Q#W(YU(V#Z+T/eS-S'U+UT-v(P-{V'Z!e%g*VQ$lfR)t$qT)i$l)jR3w.|T*Z$x*]T*c${*UQ0l+`Q3P.^Q5i1cQ6q3TQ8V5lQ8v6pQ9j8UQ9|8uQ:b9lQ:j:OQ:r:cR:u:knqOXst!Z#d%k&o&q&r&t,k,p1|2PQ&i!VR,`&ftmOXst!U!V!Z#d%k&f&o&q&r&t,k,p1|2PR,g&lT%jm,gR1],PR,_&dQ&S|R+w&TR+m%}T&m!W&pT&n!W&pT2O,p2P\",\n nodeNames: \"\u26A0 ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList 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 Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const 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 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 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\",\n maxTerm: 376,\n context: trackNewline,\n nodeProps: [\n [\"isolate\", -8,5,6,14,34,36,48,50,52,\"\"],\n [\"group\", -26,9,17,19,65,204,208,212,213,215,218,221,231,233,239,241,243,245,248,254,260,262,264,266,268,270,271,\"Statement\",-34,13,14,29,32,33,39,48,51,52,54,59,67,69,73,77,79,81,82,107,108,117,118,135,138,140,141,142,143,144,146,147,166,167,169,\"Expression\",-23,28,30,34,38,40,42,171,173,175,176,178,179,180,182,183,184,186,187,188,198,200,202,203,\"Type\",-3,85,100,106,\"ClassItem\"],\n [\"openedBy\", 23,\"<\",35,\"InterpolationStart\",53,\"[\",57,\"{\",70,\"(\",159,\"JSXStartCloseTag\"],\n [\"closedBy\", 24,\">\",37,\"InterpolationEnd\",47,\"]\",58,\"}\",71,\")\",164,\"JSXEndTag\"]\n ],\n propSources: [jsHighlight],\n skippedNodes: [0,5,6,274],\n repeatNodeCount: 37,\n tokenData: \"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$h&j(Rp(U!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o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#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr\",\n tokenizers: [noSemicolon, operatorToken, jsx$1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, insertSemicolon, new LocalTokenGroup(\"$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOu~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!R~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(^~~\", 141, 335), new LocalTokenGroup(\"j~RQYZXz{^~^O'{~~aP!P!Qd~iO'|~~\", 25, 318)],\n topRules: {\"Script\":[0,7],\"SingleExpression\":[1,272],\"SingleClassItem\":[2,273]},\n dialects: {jsx: 0, ts: 14725},\n dynamicPrecedences: {\"77\":1,\"79\":1,\"91\":1,\"167\":1,\"196\":1},\n specialized: [{term: 322, get: (value) => spec_identifier[value] || -1},{term: 338, get: (value) => spec_word[value] || -1},{term: 92, get: (value) => spec_LessThan[value] || -1}],\n tokenPrec: 14749\n });\n\n /**\n A collection of JavaScript-related\n [snippets](https://codemirror.net/6/docs/ref/#autocomplete.snippet).\n */\n const snippets = [\n /*@__PURE__*/snippetCompletion(\"function ${name}(${params}) {\\n\\t${}\\n}\", {\n label: \"function\",\n detail: \"definition\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\\n\\t${}\\n}\", {\n label: \"for\",\n detail: \"loop\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"for (let ${name} of ${collection}) {\\n\\t${}\\n}\", {\n label: \"for\",\n detail: \"of loop\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"do {\\n\\t${}\\n} while (${})\", {\n label: \"do\",\n detail: \"loop\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"while (${}) {\\n\\t${}\\n}\", {\n label: \"while\",\n detail: \"loop\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"try {\\n\\t${}\\n} catch (${error}) {\\n\\t${}\\n}\", {\n label: \"try\",\n detail: \"/ catch block\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"if (${}) {\\n\\t${}\\n}\", {\n label: \"if\",\n detail: \"block\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"if (${}) {\\n\\t${}\\n} else {\\n\\t${}\\n}\", {\n label: \"if\",\n detail: \"/ else block\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"class ${name} {\\n\\tconstructor(${params}) {\\n\\t\\t${}\\n\\t}\\n}\", {\n label: \"class\",\n detail: \"definition\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"import {${names}} from \\\"${module}\\\"\\n${}\", {\n label: \"import\",\n detail: \"named\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"import ${name} from \\\"${module}\\\"\\n${}\", {\n label: \"import\",\n detail: \"default\",\n type: \"keyword\"\n })\n ];\n /**\n A collection of snippet completions for TypeScript. Includes the\n JavaScript [snippets](https://codemirror.net/6/docs/ref/#lang-javascript.snippets).\n */\n const typescriptSnippets = /*@__PURE__*/snippets.concat([\n /*@__PURE__*/snippetCompletion(\"interface ${name} {\\n\\t${}\\n}\", {\n label: \"interface\",\n detail: \"definition\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"type ${name} = ${type}\", {\n label: \"type\",\n detail: \"definition\",\n type: \"keyword\"\n }),\n /*@__PURE__*/snippetCompletion(\"enum ${name} {\\n\\t${}\\n}\", {\n label: \"enum\",\n detail: \"definition\",\n type: \"keyword\"\n })\n ]);\n\n const cache$1 = /*@__PURE__*/new NodeWeakMap();\n const ScopeNodes = /*@__PURE__*/new Set([\n \"Script\", \"Block\",\n \"FunctionExpression\", \"FunctionDeclaration\", \"ArrowFunction\", \"MethodDeclaration\",\n \"ForStatement\"\n ]);\n function defID(type) {\n return (node, def) => {\n let id = node.node.getChild(\"VariableDefinition\");\n if (id)\n def(id, type);\n return true;\n };\n }\n const functionContext = [\"FunctionDeclaration\"];\n const gatherCompletions = {\n FunctionDeclaration: /*@__PURE__*/defID(\"function\"),\n ClassDeclaration: /*@__PURE__*/defID(\"class\"),\n ClassExpression: () => true,\n EnumDeclaration: /*@__PURE__*/defID(\"constant\"),\n TypeAliasDeclaration: /*@__PURE__*/defID(\"type\"),\n NamespaceDeclaration: /*@__PURE__*/defID(\"namespace\"),\n VariableDefinition(node, def) { if (!node.matchContext(functionContext))\n def(node, \"variable\"); },\n TypeDefinition(node, def) { def(node, \"type\"); },\n __proto__: null\n };\n function getScope(doc, node) {\n let cached = cache$1.get(node);\n if (cached)\n return cached;\n let completions = [], top = true;\n function def(node, type) {\n let name = doc.sliceString(node.from, node.to);\n completions.push({ label: name, type });\n }\n node.cursor(IterMode.IncludeAnonymous).iterate(node => {\n if (top) {\n top = false;\n }\n else if (node.name) {\n let gather = gatherCompletions[node.name];\n if (gather && gather(node, def) || ScopeNodes.has(node.name))\n return false;\n }\n else if (node.to - node.from > 8192) {\n // Allow caching for bigger internal nodes\n for (let c of getScope(doc, node.node))\n completions.push(c);\n return false;\n }\n });\n cache$1.set(node, completions);\n return completions;\n }\n const Identifier = /^[\\w$\\xa1-\\uffff][\\w$\\d\\xa1-\\uffff]*$/;\n const dontComplete = [\n \"TemplateString\", \"String\", \"RegExp\",\n \"LineComment\", \"BlockComment\",\n \"VariableDefinition\", \"TypeDefinition\", \"Label\",\n \"PropertyDefinition\", \"PropertyName\",\n \"PrivatePropertyDefinition\", \"PrivatePropertyName\",\n \".\", \"?.\"\n ];\n /**\n Completion source that looks up locally defined names in\n JavaScript code.\n */\n function localCompletionSource(context) {\n let inner = syntaxTree(context.state).resolveInner(context.pos, -1);\n if (dontComplete.indexOf(inner.name) > -1)\n return null;\n let isWord = inner.name == \"VariableName\" ||\n inner.to - inner.from < 20 && Identifier.test(context.state.sliceDoc(inner.from, inner.to));\n if (!isWord && !context.explicit)\n return null;\n let options = [];\n for (let pos = inner; pos; pos = pos.parent) {\n if (ScopeNodes.has(pos.name))\n options = options.concat(getScope(context.state.doc, pos));\n }\n return {\n options,\n from: isWord ? inner.from : context.pos,\n validFor: Identifier\n };\n }\n\n /**\n A language provider based on the [Lezer JavaScript\n parser](https://github.com/lezer-parser/javascript), extended with\n highlighting and indentation information.\n */\n const javascriptLanguage = /*@__PURE__*/LRLanguage.define({\n name: \"javascript\",\n parser: /*@__PURE__*/parser$1.configure({\n props: [\n /*@__PURE__*/indentNodeProp.add({\n IfStatement: /*@__PURE__*/continuedIndent({ except: /^\\s*({|else\\b)/ }),\n TryStatement: /*@__PURE__*/continuedIndent({ except: /^\\s*({|catch\\b|finally\\b)/ }),\n LabeledStatement: flatIndent,\n SwitchBody: context => {\n let after = context.textAfter, closed = /^\\s*\\}/.test(after), isCase = /^\\s*(case|default)\\b/.test(after);\n return context.baseIndent + (closed ? 0 : isCase ? 1 : 2) * context.unit;\n },\n Block: /*@__PURE__*/delimitedIndent({ closing: \"}\" }),\n ArrowFunction: cx => cx.baseIndent + cx.unit,\n \"TemplateString BlockComment\": () => null,\n \"Statement Property\": /*@__PURE__*/continuedIndent({ except: /^{/ }),\n JSXElement(context) {\n let closed = /^\\s*<\\//.test(context.textAfter);\n return context.lineIndent(context.node.from) + (closed ? 0 : context.unit);\n },\n JSXEscape(context) {\n let closed = /\\s*\\}/.test(context.textAfter);\n return context.lineIndent(context.node.from) + (closed ? 0 : context.unit);\n },\n \"JSXOpenTag JSXSelfClosingTag\"(context) {\n return context.column(context.node.from) + context.unit;\n }\n }),\n /*@__PURE__*/foldNodeProp.add({\n \"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType\": foldInside,\n BlockComment(tree) { return { from: tree.from + 2, to: tree.to - 2 }; }\n })\n ]\n }),\n languageData: {\n closeBrackets: { brackets: [\"(\", \"[\", \"{\", \"'\", '\"', \"`\"] },\n commentTokens: { line: \"//\", block: { open: \"/*\", close: \"*/\" } },\n indentOnInput: /^\\s*(?:case |default:|\\{|\\}|<\\/)$/,\n wordChars: \"$\"\n }\n });\n const jsxSublanguage = {\n test: node => /^JSX/.test(node.name),\n facet: /*@__PURE__*/defineLanguageFacet({ commentTokens: { block: { open: \"{/*\", close: \"*/}\" } } })\n };\n /**\n A language provider for TypeScript.\n */\n const typescriptLanguage = /*@__PURE__*/javascriptLanguage.configure({ dialect: \"ts\" }, \"typescript\");\n /**\n Language provider for JSX.\n */\n const jsxLanguage = /*@__PURE__*/javascriptLanguage.configure({\n dialect: \"jsx\",\n props: [/*@__PURE__*/sublanguageProp.add(n => n.isTop ? [jsxSublanguage] : undefined)]\n });\n /**\n Language provider for JSX + TypeScript.\n */\n const tsxLanguage = /*@__PURE__*/javascriptLanguage.configure({\n dialect: \"jsx ts\",\n props: [/*@__PURE__*/sublanguageProp.add(n => n.isTop ? [jsxSublanguage] : undefined)]\n }, \"typescript\");\n let kwCompletion = (name) => ({ label: name, type: \"keyword\" });\n const keywords = /*@__PURE__*/\"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(kwCompletion);\n const typescriptKeywords = /*@__PURE__*/keywords.concat(/*@__PURE__*/[\"declare\", \"implements\", \"private\", \"protected\", \"public\"].map(kwCompletion));\n /**\n JavaScript support. Includes [snippet](https://codemirror.net/6/docs/ref/#lang-javascript.snippets)\n and local variable completion.\n */\n function javascript(config = {}) {\n let lang = config.jsx ? (config.typescript ? tsxLanguage : jsxLanguage)\n : config.typescript ? typescriptLanguage : javascriptLanguage;\n let completions = config.typescript ? typescriptSnippets.concat(typescriptKeywords) : snippets.concat(keywords);\n return new LanguageSupport(lang, [\n javascriptLanguage.data.of({\n autocomplete: ifNotIn(dontComplete, completeFromList(completions))\n }),\n javascriptLanguage.data.of({\n autocomplete: localCompletionSource\n }),\n config.jsx ? autoCloseTags$1 : [],\n ]);\n }\n function findOpenTag(node) {\n for (;;) {\n if (node.name == \"JSXOpenTag\" || node.name == \"JSXSelfClosingTag\" || node.name == \"JSXFragmentTag\")\n return node;\n if (node.name == \"JSXEscape\" || !node.parent)\n return null;\n node = node.parent;\n }\n }\n function elementName$2(doc, tree, max = doc.length) {\n for (let ch = tree === null || tree === void 0 ? void 0 : tree.firstChild; ch; ch = ch.nextSibling) {\n if (ch.name == \"JSXIdentifier\" || ch.name == \"JSXBuiltin\" || ch.name == \"JSXNamespacedName\" ||\n ch.name == \"JSXMemberExpression\")\n return doc.sliceString(ch.from, Math.min(ch.to, max));\n }\n return \"\";\n }\n const android = typeof navigator == \"object\" && /*@__PURE__*//Android\\b/.test(navigator.userAgent);\n /**\n Extension that will automatically insert JSX close tags when a `>` or\n `/` is typed.\n */\n const autoCloseTags$1 = /*@__PURE__*/EditorView.inputHandler.of((view, from, to, text, defaultInsert) => {\n if ((android ? view.composing : view.compositionStarted) || view.state.readOnly ||\n from != to || (text != \">\" && text != \"/\") ||\n !javascriptLanguage.isActiveAt(view.state, from, -1))\n return false;\n let base = defaultInsert(), { state } = base;\n let closeTags = state.changeByRange(range => {\n var _a;\n let { head } = range, around = syntaxTree(state).resolveInner(head - 1, -1), name;\n if (around.name == \"JSXStartTag\")\n around = around.parent;\n if (state.doc.sliceString(head - 1, head) != text || around.name == \"JSXAttributeValue\" && around.to > head) ;\n else if (text == \">\" && around.name == \"JSXFragmentTag\") {\n return { range, changes: { from: head, insert: `</>` } };\n }\n else if (text == \"/\" && around.name == \"JSXStartCloseTag\") {\n let empty = around.parent, base = empty.parent;\n if (base && empty.from == head - 2 &&\n ((name = elementName$2(state.doc, base.firstChild, head)) || ((_a = base.firstChild) === null || _a === void 0 ? void 0 : _a.name) == \"JSXFragmentTag\")) {\n let insert = `${name}>`;\n return { range: EditorSelection.cursor(head + insert.length, -1), changes: { from: head, insert } };\n }\n }\n else if (text == \">\") {\n let openTag = findOpenTag(around);\n if (openTag && openTag.name == \"JSXOpenTag\" &&\n !/^\\/?>|^<\\//.test(state.doc.sliceString(head, head + 2)) &&\n (name = elementName$2(state.doc, openTag, head)))\n return { range, changes: { from: head, insert: `</${name}>` } };\n }\n return { range };\n });\n if (closeTags.changes.empty)\n return false;\n view.dispatch([\n base,\n state.update(closeTags, { userEvent: \"input.complete\", scrollIntoView: true })\n ]);\n return true;\n });\n\n const Targets = [\"_blank\", \"_self\", \"_top\", \"_parent\"];\n const Charsets = [\"ascii\", \"utf-8\", \"utf-16\", \"latin1\", \"latin1\"];\n const Methods = [\"get\", \"post\", \"put\", \"delete\"];\n const Encs = [\"application/x-www-form-urlencoded\", \"multipart/form-data\", \"text/plain\"];\n const Bool = [\"true\", \"false\"];\n const S = {}; // Empty tag spec\n const Tags = {\n a: {\n attrs: {\n href: null, ping: null, type: null,\n media: null,\n target: Targets,\n hreflang: null\n }\n },\n abbr: S,\n address: S,\n area: {\n attrs: {\n alt: null, coords: null, href: null, target: null, ping: null,\n media: null, hreflang: null, type: null,\n shape: [\"default\", \"rect\", \"circle\", \"poly\"]\n }\n },\n article: S,\n aside: S,\n audio: {\n attrs: {\n src: null, mediagroup: null,\n crossorigin: [\"anonymous\", \"use-credentials\"],\n preload: [\"none\", \"metadata\", \"auto\"],\n autoplay: [\"autoplay\"],\n loop: [\"loop\"],\n controls: [\"controls\"]\n }\n },\n b: S,\n base: { attrs: { href: null, target: Targets } },\n bdi: S,\n bdo: S,\n blockquote: { attrs: { cite: null } },\n body: S,\n br: S,\n button: {\n attrs: {\n form: null, formaction: null, name: null, value: null,\n autofocus: [\"autofocus\"],\n disabled: [\"autofocus\"],\n formenctype: Encs,\n formmethod: Methods,\n formnovalidate: [\"novalidate\"],\n formtarget: Targets,\n type: [\"submit\", \"reset\", \"button\"]\n }\n },\n canvas: { attrs: { width: null, height: null } },\n caption: S,\n center: S,\n cite: S,\n code: S,\n col: { attrs: { span: null } },\n colgroup: { attrs: { span: null } },\n command: {\n attrs: {\n type: [\"command\", \"checkbox\", \"radio\"],\n label: null, icon: null, radiogroup: null, command: null, title: null,\n disabled: [\"disabled\"],\n checked: [\"checked\"]\n }\n },\n data: { attrs: { value: null } },\n datagrid: { attrs: { disabled: [\"disabled\"], multiple: [\"multiple\"] } },\n datalist: { attrs: { data: null } },\n dd: S,\n del: { attrs: { cite: null, datetime: null } },\n details: { attrs: { open: [\"open\"] } },\n dfn: S,\n div: S,\n dl: S,\n dt: S,\n em: S,\n embed: { attrs: { src: null, type: null, width: null, height: null } },\n eventsource: { attrs: { src: null } },\n fieldset: { attrs: { disabled: [\"disabled\"], form: null, name: null } },\n figcaption: S,\n figure: S,\n footer: S,\n form: {\n attrs: {\n action: null, name: null,\n \"accept-charset\": Charsets,\n autocomplete: [\"on\", \"off\"],\n enctype: Encs,\n method: Methods,\n novalidate: [\"novalidate\"],\n target: Targets\n }\n },\n h1: S, h2: S, h3: S, h4: S, h5: S, h6: S,\n head: {\n children: [\"title\", \"base\", \"link\", \"style\", \"meta\", \"script\", \"noscript\", \"command\"]\n },\n header: S,\n hgroup: S,\n hr: S,\n html: {\n attrs: { manifest: null }\n },\n i: S,\n iframe: {\n attrs: {\n src: null, srcdoc: null, name: null, width: null, height: null,\n sandbox: [\"allow-top-navigation\", \"allow-same-origin\", \"allow-forms\", \"allow-scripts\"],\n seamless: [\"seamless\"]\n }\n },\n img: {\n attrs: {\n alt: null, src: null, ismap: null, usemap: null, width: null, height: null,\n crossorigin: [\"anonymous\", \"use-credentials\"]\n }\n },\n input: {\n attrs: {\n alt: null, dirname: null, form: null, formaction: null,\n height: null, list: null, max: null, maxlength: null, min: null,\n name: null, pattern: null, placeholder: null, size: null, src: null,\n step: null, value: null, width: null,\n accept: [\"audio/*\", \"video/*\", \"image/*\"],\n autocomplete: [\"on\", \"off\"],\n autofocus: [\"autofocus\"],\n checked: [\"checked\"],\n disabled: [\"disabled\"],\n formenctype: Encs,\n formmethod: Methods,\n formnovalidate: [\"novalidate\"],\n formtarget: Targets,\n multiple: [\"multiple\"],\n readonly: [\"readonly\"],\n required: [\"required\"],\n type: [\"hidden\", \"text\", \"search\", \"tel\", \"url\", \"email\", \"password\", \"datetime\", \"date\", \"month\",\n \"week\", \"time\", \"datetime-local\", \"number\", \"range\", \"color\", \"checkbox\", \"radio\",\n \"file\", \"submit\", \"image\", \"reset\", \"button\"]\n }\n },\n ins: { attrs: { cite: null, datetime: null } },\n kbd: S,\n keygen: {\n attrs: {\n challenge: null, form: null, name: null,\n autofocus: [\"autofocus\"],\n disabled: [\"disabled\"],\n keytype: [\"RSA\"]\n }\n },\n label: { attrs: { for: null, form: null } },\n legend: S,\n li: { attrs: { value: null } },\n link: {\n attrs: {\n href: null, type: null,\n hreflang: null,\n media: null,\n sizes: [\"all\", \"16x16\", \"16x16 32x32\", \"16x16 32x32 64x64\"]\n }\n },\n map: { attrs: { name: null } },\n mark: S,\n menu: { attrs: { label: null, type: [\"list\", \"context\", \"toolbar\"] } },\n meta: {\n attrs: {\n content: null,\n charset: Charsets,\n name: [\"viewport\", \"application-name\", \"author\", \"description\", \"generator\", \"keywords\"],\n \"http-equiv\": [\"content-language\", \"content-type\", \"default-style\", \"refresh\"]\n }\n },\n meter: { attrs: { value: null, min: null, low: null, high: null, max: null, optimum: null } },\n nav: S,\n noscript: S,\n object: {\n attrs: {\n data: null, type: null, name: null, usemap: null, form: null, width: null, height: null,\n typemustmatch: [\"typemustmatch\"]\n }\n },\n ol: { attrs: { reversed: [\"reversed\"], start: null, type: [\"1\", \"a\", \"A\", \"i\", \"I\"] },\n children: [\"li\", \"script\", \"template\", \"ul\", \"ol\"] },\n optgroup: { attrs: { disabled: [\"disabled\"], label: null } },\n option: { attrs: { disabled: [\"disabled\"], label: null, selected: [\"selected\"], value: null } },\n output: { attrs: { for: null, form: null, name: null } },\n p: S,\n param: { attrs: { name: null, value: null } },\n pre: S,\n progress: { attrs: { value: null, max: null } },\n q: { attrs: { cite: null } },\n rp: S,\n rt: S,\n ruby: S,\n samp: S,\n script: {\n attrs: {\n type: [\"text/javascript\"],\n src: null,\n async: [\"async\"],\n defer: [\"defer\"],\n charset: Charsets\n }\n },\n section: S,\n select: {\n attrs: {\n form: null, name: null, size: null,\n autofocus: [\"autofocus\"],\n disabled: [\"disabled\"],\n multiple: [\"multiple\"]\n }\n },\n slot: { attrs: { name: null } },\n small: S,\n source: { attrs: { src: null, type: null, media: null } },\n span: S,\n strong: S,\n style: {\n attrs: {\n type: [\"text/css\"],\n media: null,\n scoped: null\n }\n },\n sub: S,\n summary: S,\n sup: S,\n table: S,\n tbody: S,\n td: { attrs: { colspan: null, rowspan: null, headers: null } },\n template: S,\n textarea: {\n attrs: {\n dirname: null, form: null, maxlength: null, name: null, placeholder: null,\n rows: null, cols: null,\n autofocus: [\"autofocus\"],\n disabled: [\"disabled\"],\n readonly: [\"readonly\"],\n required: [\"required\"],\n wrap: [\"soft\", \"hard\"]\n }\n },\n tfoot: S,\n th: { attrs: { colspan: null, rowspan: null, headers: null, scope: [\"row\", \"col\", \"rowgroup\", \"colgroup\"] } },\n thead: S,\n time: { attrs: { datetime: null } },\n title: S,\n tr: S,\n track: {\n attrs: {\n src: null, label: null, default: null,\n kind: [\"subtitles\", \"captions\", \"descriptions\", \"chapters\", \"metadata\"],\n srclang: null\n }\n },\n ul: { children: [\"li\", \"script\", \"template\", \"ul\", \"ol\"] },\n var: S,\n video: {\n attrs: {\n src: null, poster: null, width: null, height: null,\n crossorigin: [\"anonymous\", \"use-credentials\"],\n preload: [\"auto\", \"metadata\", \"none\"],\n autoplay: [\"autoplay\"],\n mediagroup: [\"movie\"],\n muted: [\"muted\"],\n controls: [\"controls\"]\n }\n },\n wbr: S\n };\n const GlobalAttrs = {\n accesskey: null,\n class: null,\n contenteditable: Bool,\n contextmenu: null,\n dir: [\"ltr\", \"rtl\", \"auto\"],\n draggable: [\"true\", \"false\", \"auto\"],\n dropzone: [\"copy\", \"move\", \"link\", \"string:\", \"file:\"],\n hidden: [\"hidden\"],\n id: null,\n inert: [\"inert\"],\n itemid: null,\n itemprop: null,\n itemref: null,\n itemscope: [\"itemscope\"],\n itemtype: null,\n lang: [\"ar\", \"bn\", \"de\", \"en-GB\", \"en-US\", \"es\", \"fr\", \"hi\", \"id\", \"ja\", \"pa\", \"pt\", \"ru\", \"tr\", \"zh\"],\n spellcheck: Bool,\n autocorrect: Bool,\n autocapitalize: Bool,\n style: null,\n tabindex: null,\n title: null,\n translate: [\"yes\", \"no\"],\n rel: [\"stylesheet\", \"alternate\", \"author\", \"bookmark\", \"help\", \"license\", \"next\", \"nofollow\", \"noreferrer\", \"prefetch\", \"prev\", \"search\", \"tag\"],\n role: /*@__PURE__*/\"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(\" \"),\n \"aria-activedescendant\": null,\n \"aria-atomic\": Bool,\n \"aria-autocomplete\": [\"inline\", \"list\", \"both\", \"none\"],\n \"aria-busy\": Bool,\n \"aria-checked\": [\"true\", \"false\", \"mixed\", \"undefined\"],\n \"aria-controls\": null,\n \"aria-describedby\": null,\n \"aria-disabled\": Bool,\n \"aria-dropeffect\": null,\n \"aria-expanded\": [\"true\", \"false\", \"undefined\"],\n \"aria-flowto\": null,\n \"aria-grabbed\": [\"true\", \"false\", \"undefined\"],\n \"aria-haspopup\": Bool,\n \"aria-hidden\": Bool,\n \"aria-invalid\": [\"true\", \"false\", \"grammar\", \"spelling\"],\n \"aria-label\": null,\n \"aria-labelledby\": null,\n \"aria-level\": null,\n \"aria-live\": [\"off\", \"polite\", \"assertive\"],\n \"aria-multiline\": Bool,\n \"aria-multiselectable\": Bool,\n \"aria-owns\": null,\n \"aria-posinset\": null,\n \"aria-pressed\": [\"true\", \"false\", \"mixed\", \"undefined\"],\n \"aria-readonly\": Bool,\n \"aria-relevant\": null,\n \"aria-required\": Bool,\n \"aria-selected\": [\"true\", \"false\", \"undefined\"],\n \"aria-setsize\": null,\n \"aria-sort\": [\"ascending\", \"descending\", \"none\", \"other\"],\n \"aria-valuemax\": null,\n \"aria-valuemin\": null,\n \"aria-valuenow\": null,\n \"aria-valuetext\": null\n };\n const eventAttributes = /*@__PURE__*/(\"beforeunload copy cut dragstart dragover dragleave dragenter dragend \" +\n \"drag paste focus blur change click load mousedown mouseenter mouseleave \" +\n \"mouseup keydown keyup resize scroll unload\").split(\" \").map(n => \"on\" + n);\n for (let a of eventAttributes)\n GlobalAttrs[a] = null;\n class Schema {\n constructor(extraTags, extraAttrs) {\n this.tags = Object.assign(Object.assign({}, Tags), extraTags);\n this.globalAttrs = Object.assign(Object.assign({}, GlobalAttrs), extraAttrs);\n this.allTags = Object.keys(this.tags);\n this.globalAttrNames = Object.keys(this.globalAttrs);\n }\n }\n Schema.default = /*@__PURE__*/new Schema;\n function elementName$1(doc, tree, max = doc.length) {\n if (!tree)\n return \"\";\n let tag = tree.firstChild;\n let name = tag && tag.getChild(\"TagName\");\n return name ? doc.sliceString(name.from, Math.min(name.to, max)) : \"\";\n }\n function findParentElement(tree, skip = false) {\n for (; tree; tree = tree.parent)\n if (tree.name == \"Element\") {\n if (skip)\n skip = false;\n else\n return tree;\n }\n return null;\n }\n function allowedChildren(doc, tree, schema) {\n let parentInfo = schema.tags[elementName$1(doc, findParentElement(tree))];\n return (parentInfo === null || parentInfo === void 0 ? void 0 : parentInfo.children) || schema.allTags;\n }\n function openTags(doc, tree) {\n let open = [];\n for (let parent = findParentElement(tree); parent && !parent.type.isTop; parent = findParentElement(parent.parent)) {\n let tagName = elementName$1(doc, parent);\n if (tagName && parent.lastChild.name == \"CloseTag\")\n break;\n if (tagName && open.indexOf(tagName) < 0 && (tree.name == \"EndTag\" || tree.from >= parent.firstChild.to))\n open.push(tagName);\n }\n return open;\n }\n const identifier = /^[:\\-\\.\\w\\u00b7-\\uffff]*$/;\n function completeTag(state, schema, tree, from, to) {\n let end = /\\s*>/.test(state.sliceDoc(to, to + 5)) ? \"\" : \">\";\n let parent = findParentElement(tree, true);\n return { from, to,\n options: allowedChildren(state.doc, parent, schema).map(tagName => ({ label: tagName, type: \"type\" })).concat(openTags(state.doc, tree).map((tag, i) => ({ label: \"/\" + tag, apply: \"/\" + tag + end,\n type: \"type\", boost: 99 - i }))),\n validFor: /^\\/?[:\\-\\.\\w\\u00b7-\\uffff]*$/ };\n }\n function completeCloseTag(state, tree, from, to) {\n let end = /\\s*>/.test(state.sliceDoc(to, to + 5)) ? \"\" : \">\";\n return { from, to,\n options: openTags(state.doc, tree).map((tag, i) => ({ label: tag, apply: tag + end, type: \"type\", boost: 99 - i })),\n validFor: identifier };\n }\n function completeStartTag(state, schema, tree, pos) {\n let options = [], level = 0;\n for (let tagName of allowedChildren(state.doc, tree, schema))\n options.push({ label: \"<\" + tagName, type: \"type\" });\n for (let open of openTags(state.doc, tree))\n options.push({ label: \"</\" + open + \">\", type: \"type\", boost: 99 - level++ });\n return { from: pos, to: pos, options, validFor: /^<\\/?[:\\-\\.\\w\\u00b7-\\uffff]*$/ };\n }\n function completeAttrName(state, schema, tree, from, to) {\n let elt = findParentElement(tree), info = elt ? schema.tags[elementName$1(state.doc, elt)] : null;\n let localAttrs = info && info.attrs ? Object.keys(info.attrs) : [];\n let names = info && info.globalAttrs === false ? localAttrs\n : localAttrs.length ? localAttrs.concat(schema.globalAttrNames) : schema.globalAttrNames;\n return { from, to,\n options: names.map(attrName => ({ label: attrName, type: \"property\" })),\n validFor: identifier };\n }\n function completeAttrValue(state, schema, tree, from, to) {\n var _a;\n let nameNode = (_a = tree.parent) === null || _a === void 0 ? void 0 : _a.getChild(\"AttributeName\");\n let options = [], token = undefined;\n if (nameNode) {\n let attrName = state.sliceDoc(nameNode.from, nameNode.to);\n let attrs = schema.globalAttrs[attrName];\n if (!attrs) {\n let elt = findParentElement(tree), info = elt ? schema.tags[elementName$1(state.doc, elt)] : null;\n attrs = (info === null || info === void 0 ? void 0 : info.attrs) && info.attrs[attrName];\n }\n if (attrs) {\n let base = state.sliceDoc(from, to).toLowerCase(), quoteStart = '\"', quoteEnd = '\"';\n if (/^['\"]/.test(base)) {\n token = base[0] == '\"' ? /^[^\"]*$/ : /^[^']*$/;\n quoteStart = \"\";\n quoteEnd = state.sliceDoc(to, to + 1) == base[0] ? \"\" : base[0];\n base = base.slice(1);\n from++;\n }\n else {\n token = /^[^\\s<>='\"]*$/;\n }\n for (let value of attrs)\n options.push({ label: value, apply: quoteStart + value + quoteEnd, type: \"constant\" });\n }\n }\n return { from, to, options, validFor: token };\n }\n function htmlCompletionFor(schema, context) {\n let { state, pos } = context, tree = syntaxTree(state).resolveInner(pos, -1), around = tree.resolve(pos);\n for (let scan = pos, before; around == tree && (before = tree.childBefore(scan));) {\n let last = before.lastChild;\n if (!last || !last.type.isError || last.from < last.to)\n break;\n around = tree = before;\n scan = last.from;\n }\n if (tree.name == \"TagName\") {\n return tree.parent && /CloseTag$/.test(tree.parent.name) ? completeCloseTag(state, tree, tree.from, pos)\n : completeTag(state, schema, tree, tree.from, pos);\n }\n else if (tree.name == \"StartTag\") {\n return completeTag(state, schema, tree, pos, pos);\n }\n else if (tree.name == \"StartCloseTag\" || tree.name == \"IncompleteCloseTag\") {\n return completeCloseTag(state, tree, pos, pos);\n }\n else if (tree.name == \"OpenTag\" || tree.name == \"SelfClosingTag\" || tree.name == \"AttributeName\") {\n return completeAttrName(state, schema, tree, tree.name == \"AttributeName\" ? tree.from : pos, pos);\n }\n else if (tree.name == \"Is\" || tree.name == \"AttributeValue\" || tree.name == \"UnquotedAttributeValue\") {\n return completeAttrValue(state, schema, tree, tree.name == \"Is\" ? pos : tree.from, pos);\n }\n else if (context.explicit && (around.name == \"Element\" || around.name == \"Text\" || around.name == \"Document\")) {\n return completeStartTag(state, schema, tree, pos);\n }\n else {\n return null;\n }\n }\n /**\n HTML tag completion. Opens and closes tags and attributes in a\n context-aware way.\n */\n function htmlCompletionSource(context) {\n return htmlCompletionFor(Schema.default, context);\n }\n /**\n Create a completion source for HTML extended with additional tags\n or attributes.\n */\n function htmlCompletionSourceWith(config) {\n let { extraTags, extraGlobalAttributes: extraAttrs } = config;\n let schema = extraAttrs || extraTags ? new Schema(extraTags, extraAttrs) : Schema.default;\n return (context) => htmlCompletionFor(schema, context);\n }\n\n const jsonParser = /*@__PURE__*/javascriptLanguage.parser.configure({ top: \"SingleExpression\" });\n const defaultNesting = [\n { tag: \"script\",\n attrs: attrs => attrs.type == \"text/typescript\" || attrs.lang == \"ts\",\n parser: typescriptLanguage.parser },\n { tag: \"script\",\n attrs: attrs => attrs.type == \"text/babel\" || attrs.type == \"text/jsx\",\n parser: jsxLanguage.parser },\n { tag: \"script\",\n attrs: attrs => attrs.type == \"text/typescript-jsx\",\n parser: tsxLanguage.parser },\n { tag: \"script\",\n attrs(attrs) {\n return /^(importmap|speculationrules|application\\/(.+\\+)?json)$/i.test(attrs.type);\n },\n parser: jsonParser },\n { tag: \"script\",\n attrs(attrs) {\n return !attrs.type || /^(?:text|application)\\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(attrs.type);\n },\n parser: javascriptLanguage.parser },\n { tag: \"style\",\n attrs(attrs) {\n return (!attrs.lang || attrs.lang == \"css\") && (!attrs.type || /^(text\\/)?(x-)?(stylesheet|css)$/i.test(attrs.type));\n },\n parser: cssLanguage.parser }\n ];\n const defaultAttrs = /*@__PURE__*/[\n { name: \"style\",\n parser: /*@__PURE__*/cssLanguage.parser.configure({ top: \"Styles\" }) }\n ].concat(/*@__PURE__*/eventAttributes.map(name => ({ name, parser: javascriptLanguage.parser })));\n /**\n A language provider based on the [Lezer HTML\n parser](https://github.com/lezer-parser/html), extended with the\n JavaScript and CSS parsers to parse the content of `<script>` and\n `<style>` tags.\n */\n const htmlPlain = /*@__PURE__*/LRLanguage.define({\n name: \"html\",\n parser: /*@__PURE__*/parser$3.configure({\n props: [\n /*@__PURE__*/indentNodeProp.add({\n Element(context) {\n let after = /^(\\s*)(<\\/)?/.exec(context.textAfter);\n if (context.node.to <= context.pos + after[0].length)\n return context.continue();\n return context.lineIndent(context.node.from) + (after[2] ? 0 : context.unit);\n },\n \"OpenTag CloseTag SelfClosingTag\"(context) {\n return context.column(context.node.from) + context.unit;\n },\n Document(context) {\n if (context.pos + /\\s*/.exec(context.textAfter)[0].length < context.node.to)\n return context.continue();\n let endElt = null, close;\n for (let cur = context.node;;) {\n let last = cur.lastChild;\n if (!last || last.name != \"Element\" || last.to != cur.to)\n break;\n endElt = cur = last;\n }\n if (endElt && !((close = endElt.lastChild) && (close.name == \"CloseTag\" || close.name == \"SelfClosingTag\")))\n return context.lineIndent(endElt.from) + context.unit;\n return null;\n }\n }),\n /*@__PURE__*/foldNodeProp.add({\n Element(node) {\n let first = node.firstChild, last = node.lastChild;\n if (!first || first.name != \"OpenTag\")\n return null;\n return { from: first.to, to: last.name == \"CloseTag\" ? last.from : node.to };\n }\n }),\n /*@__PURE__*/bracketMatchingHandle.add({\n \"OpenTag CloseTag\": node => node.getChild(\"TagName\")\n })\n ]\n }),\n languageData: {\n commentTokens: { block: { open: \"<!--\", close: \"-->\" } },\n indentOnInput: /^\\s*<\\/\\w+\\W$/,\n wordChars: \"-._\"\n }\n });\n /**\n A language provider based on the [Lezer HTML\n parser](https://github.com/lezer-parser/html), extended with the\n JavaScript and CSS parsers to parse the content of `<script>` and\n `<style>` tags.\n */\n const htmlLanguage = /*@__PURE__*/htmlPlain.configure({\n wrap: /*@__PURE__*/configureNesting(defaultNesting, defaultAttrs)\n });\n /**\n Language support for HTML, including\n [`htmlCompletion`](https://codemirror.net/6/docs/ref/#lang-html.htmlCompletion) and JavaScript and\n CSS support extensions.\n */\n function html$1(config = {}) {\n let dialect = \"\", wrap;\n if (config.matchClosingTags === false)\n dialect = \"noMatch\";\n if (config.selfClosingTags === true)\n dialect = (dialect ? dialect + \" \" : \"\") + \"selfClosing\";\n if (config.nestedLanguages && config.nestedLanguages.length ||\n config.nestedAttributes && config.nestedAttributes.length)\n wrap = configureNesting((config.nestedLanguages || []).concat(defaultNesting), (config.nestedAttributes || []).concat(defaultAttrs));\n let lang = wrap ? htmlPlain.configure({ wrap, dialect }) : dialect ? htmlLanguage.configure({ dialect }) : htmlLanguage;\n return new LanguageSupport(lang, [\n htmlLanguage.data.of({ autocomplete: htmlCompletionSourceWith(config) }),\n config.autoCloseTags !== false ? autoCloseTags : [],\n javascript().support,\n css$1().support\n ]);\n }\n const selfClosers = /*@__PURE__*/new Set(/*@__PURE__*/\"area base br col command embed frame hr img input keygen link meta param source track wbr menuitem\".split(\" \"));\n /**\n Extension that will automatically insert close tags when a `>` or\n `/` is typed.\n */\n const autoCloseTags = /*@__PURE__*/EditorView.inputHandler.of((view, from, to, text, insertTransaction) => {\n if (view.composing || view.state.readOnly || from != to || (text != \">\" && text != \"/\") ||\n !htmlLanguage.isActiveAt(view.state, from, -1))\n return false;\n let base = insertTransaction(), { state } = base;\n let closeTags = state.changeByRange(range => {\n var _a, _b, _c;\n let didType = state.doc.sliceString(range.from - 1, range.to) == text;\n let { head } = range, after = syntaxTree(state).resolveInner(head, -1), name;\n if (didType && text == \">\" && after.name == \"EndTag\") {\n let tag = after.parent;\n if (((_b = (_a = tag.parent) === null || _a === void 0 ? void 0 : _a.lastChild) === null || _b === void 0 ? void 0 : _b.name) != \"CloseTag\" &&\n (name = elementName$1(state.doc, tag.parent, head)) &&\n !selfClosers.has(name)) {\n let to = head + (state.doc.sliceString(head, head + 1) === \">\" ? 1 : 0);\n let insert = `</${name}>`;\n return { range, changes: { from: head, to, insert } };\n }\n }\n else if (didType && text == \"/\" && after.name == \"IncompleteCloseTag\") {\n let tag = after.parent;\n if (after.from == head - 2 && ((_c = tag.lastChild) === null || _c === void 0 ? void 0 : _c.name) != \"CloseTag\" &&\n (name = elementName$1(state.doc, tag, head)) && !selfClosers.has(name)) {\n let to = head + (state.doc.sliceString(head, head + 1) === \">\" ? 1 : 0);\n let insert = `${name}>`;\n return {\n range: EditorSelection.cursor(head + insert.length, -1),\n changes: { from: head, to, insert }\n };\n }\n }\n return { range };\n });\n if (closeTags.changes.empty)\n return false;\n view.dispatch([\n base,\n state.update(closeTags, {\n userEvent: \"input.complete\",\n scrollIntoView: true\n })\n ]);\n return true;\n });\n\n const data$1 = /*@__PURE__*/defineLanguageFacet({ commentTokens: { block: { open: \"<!--\", close: \"-->\" } } });\n const headingProp = /*@__PURE__*/new NodeProp();\n const commonmark = /*@__PURE__*/parser$4.configure({\n props: [\n /*@__PURE__*/foldNodeProp.add(type => {\n return !type.is(\"Block\") || type.is(\"Document\") || isHeading(type) != null || isList(type) ? undefined\n : (tree, state) => ({ from: state.doc.lineAt(tree.from).to, to: tree.to });\n }),\n /*@__PURE__*/headingProp.add(isHeading),\n /*@__PURE__*/indentNodeProp.add({\n Document: () => null\n }),\n /*@__PURE__*/languageDataProp.add({\n Document: data$1\n })\n ]\n });\n function isHeading(type) {\n let match = /^(?:ATX|Setext)Heading(\\d)$/.exec(type.name);\n return match ? +match[1] : undefined;\n }\n function isList(type) {\n return type.name == \"OrderedList\" || type.name == \"BulletList\";\n }\n function findSectionEnd(headerNode, level) {\n let last = headerNode;\n for (;;) {\n let next = last.nextSibling, heading;\n if (!next || (heading = isHeading(next.type)) != null && heading <= level)\n break;\n last = next;\n }\n return last.to;\n }\n const headerIndent = /*@__PURE__*/foldService.of((state, start, end) => {\n for (let node = syntaxTree(state).resolveInner(end, -1); node; node = node.parent) {\n if (node.from < start)\n break;\n let heading = node.type.prop(headingProp);\n if (heading == null)\n continue;\n let upto = findSectionEnd(node, heading);\n if (upto > end)\n return { from: end, to: upto };\n }\n return null;\n });\n function mkLang(parser) {\n return new Language(data$1, parser, [headerIndent], \"markdown\");\n }\n /**\n Language support for strict CommonMark.\n */\n const commonmarkLanguage = /*@__PURE__*/mkLang(commonmark);\n const extended = /*@__PURE__*/commonmark.configure([GFM, Subscript, Superscript, Emoji, {\n props: [\n /*@__PURE__*/foldNodeProp.add({\n Table: (tree, state) => ({ from: state.doc.lineAt(tree.from).to, to: tree.to })\n })\n ]\n }]);\n /**\n Language support for [GFM](https://github.github.com/gfm/) plus\n subscript, superscript, and emoji syntax.\n */\n const markdownLanguage = /*@__PURE__*/mkLang(extended);\n function getCodeParser(languages, defaultLanguage) {\n return (info) => {\n if (info && languages) {\n let found = null;\n // Strip anything after whitespace\n info = /\\S*/.exec(info)[0];\n if (typeof languages == \"function\")\n found = languages(info);\n else\n found = LanguageDescription.matchLanguageName(languages, info, true);\n if (found instanceof LanguageDescription)\n return found.support ? found.support.language.parser : ParseContext.getSkippingParser(found.load());\n else if (found)\n return found.parser;\n }\n return defaultLanguage ? defaultLanguage.parser : null;\n };\n }\n\n class Context {\n constructor(node, from, to, spaceBefore, spaceAfter, type, item) {\n this.node = node;\n this.from = from;\n this.to = to;\n this.spaceBefore = spaceBefore;\n this.spaceAfter = spaceAfter;\n this.type = type;\n this.item = item;\n }\n blank(maxWidth, trailing = true) {\n let result = this.spaceBefore + (this.node.name == \"Blockquote\" ? \">\" : \"\");\n if (maxWidth != null) {\n while (result.length < maxWidth)\n result += \" \";\n return result;\n }\n else {\n for (let i = this.to - this.from - result.length - this.spaceAfter.length; i > 0; i--)\n result += \" \";\n return result + (trailing ? this.spaceAfter : \"\");\n }\n }\n marker(doc, add) {\n let number = this.node.name == \"OrderedList\" ? String((+itemNumber(this.item, doc)[2] + add)) : \"\";\n return this.spaceBefore + number + this.type + this.spaceAfter;\n }\n }\n function getContext$1(node, doc) {\n let nodes = [];\n for (let cur = node; cur && cur.name != \"Document\"; cur = cur.parent) {\n if (cur.name == \"ListItem\" || cur.name == \"Blockquote\" || cur.name == \"FencedCode\")\n nodes.push(cur);\n }\n let context = [];\n for (let i = nodes.length - 1; i >= 0; i--) {\n let node = nodes[i], match;\n let line = doc.lineAt(node.from), startPos = node.from - line.from;\n if (node.name == \"FencedCode\") {\n context.push(new Context(node, startPos, startPos, \"\", \"\", \"\", null));\n }\n else if (node.name == \"Blockquote\" && (match = /^ *>( ?)/.exec(line.text.slice(startPos)))) {\n context.push(new Context(node, startPos, startPos + match[0].length, \"\", match[1], \">\", null));\n }\n else if (node.name == \"ListItem\" && node.parent.name == \"OrderedList\" &&\n (match = /^( *)\\d+([.)])( *)/.exec(line.text.slice(startPos)))) {\n let after = match[3], len = match[0].length;\n if (after.length >= 4) {\n after = after.slice(0, after.length - 4);\n len -= 4;\n }\n context.push(new Context(node.parent, startPos, startPos + len, match[1], after, match[2], node));\n }\n else if (node.name == \"ListItem\" && node.parent.name == \"BulletList\" &&\n (match = /^( *)([-+*])( {1,4}\\[[ xX]\\])?( +)/.exec(line.text.slice(startPos)))) {\n let after = match[4], len = match[0].length;\n if (after.length > 4) {\n after = after.slice(0, after.length - 4);\n len -= 4;\n }\n let type = match[2];\n if (match[3])\n type += match[3].replace(/[xX]/, ' ');\n context.push(new Context(node.parent, startPos, startPos + len, match[1], after, type, node));\n }\n }\n return context;\n }\n function itemNumber(item, doc) {\n return /^(\\s*)(\\d+)(?=[.)])/.exec(doc.sliceString(item.from, item.from + 10));\n }\n function renumberList(after, doc, changes, offset = 0) {\n for (let prev = -1, node = after;;) {\n if (node.name == \"ListItem\") {\n let m = itemNumber(node, doc);\n let number = +m[2];\n if (prev >= 0) {\n if (number != prev + 1)\n return;\n changes.push({ from: node.from + m[1].length, to: node.from + m[0].length, insert: String(prev + 2 + offset) });\n }\n prev = number;\n }\n let next = node.nextSibling;\n if (!next)\n break;\n node = next;\n }\n }\n function normalizeIndent(content, state) {\n let blank = /^[ \\t]*/.exec(content)[0].length;\n if (!blank || state.facet(indentUnit) != \"\\t\")\n return content;\n let col = countColumn(content, 4, blank);\n let space = \"\";\n for (let i = col; i > 0;) {\n if (i >= 4) {\n space += \"\\t\";\n i -= 4;\n }\n else {\n space += \" \";\n i--;\n }\n }\n return space + content.slice(blank);\n }\n /**\n This command, when invoked in Markdown context with cursor\n selection(s), will create a new line with the markup for\n blockquotes and lists that were active on the old line. If the\n cursor was directly after the end of the markup for the old line,\n trailing whitespace and list markers are removed from that line.\n\n The command does nothing in non-Markdown context, so it should\n not be used as the only binding for Enter (even in a Markdown\n document, HTML and code regions might use a different language).\n */\n const insertNewlineContinueMarkup = ({ state, dispatch }) => {\n let tree = syntaxTree(state), { doc } = state;\n let dont = null, changes = state.changeByRange(range => {\n if (!range.empty || !markdownLanguage.isActiveAt(state, range.from))\n return dont = { range };\n let pos = range.from, line = doc.lineAt(pos);\n let context = getContext$1(tree.resolveInner(pos, -1), doc);\n while (context.length && context[context.length - 1].from > pos - line.from)\n context.pop();\n if (!context.length)\n return dont = { range };\n let inner = context[context.length - 1];\n if (inner.to - inner.spaceAfter.length > pos - line.from)\n return dont = { range };\n let emptyLine = pos >= (inner.to - inner.spaceAfter.length) && !/\\S/.test(line.text.slice(inner.to));\n // Empty line in list\n if (inner.item && emptyLine) {\n let first = inner.node.firstChild, second = inner.node.getChild(\"ListItem\", \"ListItem\");\n // Not second item or blank line before: delete a level of markup\n if (first.to >= pos || second && second.to < pos ||\n line.from > 0 && !/[^\\s>]/.test(doc.lineAt(line.from - 1).text)) {\n let next = context.length > 1 ? context[context.length - 2] : null;\n let delTo, insert = \"\";\n if (next && next.item) { // Re-add marker for the list at the next level\n delTo = line.from + next.from;\n insert = next.marker(doc, 1);\n }\n else {\n delTo = line.from + (next ? next.to : 0);\n }\n let changes = [{ from: delTo, to: pos, insert }];\n if (inner.node.name == \"OrderedList\")\n renumberList(inner.item, doc, changes, -2);\n if (next && next.node.name == \"OrderedList\")\n renumberList(next.item, doc, changes);\n return { range: EditorSelection.cursor(delTo + insert.length), changes };\n }\n else { // Move second item down, making tight two-item list non-tight\n let insert = blankLine(context, state, line);\n return { range: EditorSelection.cursor(pos + insert.length + 1),\n changes: { from: line.from, insert: insert + state.lineBreak } };\n }\n }\n if (inner.node.name == \"Blockquote\" && emptyLine && line.from) {\n let prevLine = doc.lineAt(line.from - 1), quoted = />\\s*$/.exec(prevLine.text);\n // Two aligned empty quoted lines in a row\n if (quoted && quoted.index == inner.from) {\n let changes = state.changes([{ from: prevLine.from + quoted.index, to: prevLine.to },\n { from: line.from + inner.from, to: line.to }]);\n return { range: range.map(changes), changes };\n }\n }\n let changes = [];\n if (inner.node.name == \"OrderedList\")\n renumberList(inner.item, doc, changes);\n let continued = inner.item && inner.item.from < line.from;\n let insert = \"\";\n // If not dedented\n if (!continued || /^[\\s\\d.)\\-+*>]*/.exec(line.text)[0].length >= inner.to) {\n for (let i = 0, e = context.length - 1; i <= e; i++) {\n insert += i == e && !continued ? context[i].marker(doc, 1)\n : context[i].blank(i < e ? countColumn(line.text, 4, context[i + 1].from) - insert.length : null);\n }\n }\n let from = pos;\n while (from > line.from && /\\s/.test(line.text.charAt(from - line.from - 1)))\n from--;\n insert = normalizeIndent(insert, state);\n if (nonTightList(inner.node, state.doc))\n insert = blankLine(context, state, line) + state.lineBreak + insert;\n changes.push({ from, to: pos, insert: state.lineBreak + insert });\n return { range: EditorSelection.cursor(from + insert.length + 1), changes };\n });\n if (dont)\n return false;\n dispatch(state.update(changes, { scrollIntoView: true, userEvent: \"input\" }));\n return true;\n };\n function isMark(node) {\n return node.name == \"QuoteMark\" || node.name == \"ListMark\";\n }\n function nonTightList(node, doc) {\n if (node.name != \"OrderedList\" && node.name != \"BulletList\")\n return false;\n let first = node.firstChild, second = node.getChild(\"ListItem\", \"ListItem\");\n if (!second)\n return false;\n let line1 = doc.lineAt(first.to), line2 = doc.lineAt(second.from);\n let empty = /^[\\s>]*$/.test(line1.text);\n return line1.number + (empty ? 0 : 1) < line2.number;\n }\n function blankLine(context, state, line) {\n let insert = \"\";\n for (let i = 0, e = context.length - 2; i <= e; i++) {\n insert += context[i].blank(i < e ? countColumn(line.text, 4, context[i + 1].from) - insert.length : null, i < e);\n }\n return normalizeIndent(insert, state);\n }\n function contextNodeForDelete(tree, pos) {\n let node = tree.resolveInner(pos, -1), scan = pos;\n if (isMark(node)) {\n scan = node.from;\n node = node.parent;\n }\n for (let prev; prev = node.childBefore(scan);) {\n if (isMark(prev)) {\n scan = prev.from;\n }\n else if (prev.name == \"OrderedList\" || prev.name == \"BulletList\") {\n node = prev.lastChild;\n scan = node.to;\n }\n else {\n break;\n }\n }\n return node;\n }\n /**\n This command will, when invoked in a Markdown context with the\n cursor directly after list or blockquote markup, delete one level\n of markup. When the markup is for a list, it will be replaced by\n spaces on the first invocation (a further invocation will delete\n the spaces), to make it easy to continue a list.\n\n When not after Markdown block markup, this command will return\n false, so it is intended to be bound alongside other deletion\n commands, with a higher precedence than the more generic commands.\n */\n const deleteMarkupBackward = ({ state, dispatch }) => {\n let tree = syntaxTree(state);\n let dont = null, changes = state.changeByRange(range => {\n let pos = range.from, { doc } = state;\n if (range.empty && markdownLanguage.isActiveAt(state, range.from)) {\n let line = doc.lineAt(pos);\n let context = getContext$1(contextNodeForDelete(tree, pos), doc);\n if (context.length) {\n let inner = context[context.length - 1];\n let spaceEnd = inner.to - inner.spaceAfter.length + (inner.spaceAfter ? 1 : 0);\n // Delete extra trailing space after markup\n if (pos - line.from > spaceEnd && !/\\S/.test(line.text.slice(spaceEnd, pos - line.from)))\n return { range: EditorSelection.cursor(line.from + spaceEnd),\n changes: { from: line.from + spaceEnd, to: pos } };\n if (pos - line.from == spaceEnd &&\n // Only apply this if we're on the line that has the\n // construct's syntax, or there's only indentation in the\n // target range\n (!inner.item || line.from <= inner.item.from || !/\\S/.test(line.text.slice(0, inner.to)))) {\n let start = line.from + inner.from;\n // Replace a list item marker with blank space\n if (inner.item && inner.node.from < inner.item.from && /\\S/.test(line.text.slice(inner.from, inner.to))) {\n let insert = inner.blank(countColumn(line.text, 4, inner.to) - countColumn(line.text, 4, inner.from));\n if (start == line.from)\n insert = normalizeIndent(insert, state);\n return { range: EditorSelection.cursor(start + insert.length),\n changes: { from: start, to: line.from + inner.to, insert } };\n }\n // Delete one level of indentation\n if (start < pos)\n return { range: EditorSelection.cursor(start), changes: { from: start, to: pos } };\n }\n }\n }\n return dont = { range };\n });\n if (dont)\n return false;\n dispatch(state.update(changes, { scrollIntoView: true, userEvent: \"delete\" }));\n return true;\n };\n\n /**\n A small keymap with Markdown-specific bindings. Binds Enter to\n [`insertNewlineContinueMarkup`](https://codemirror.net/6/docs/ref/#lang-markdown.insertNewlineContinueMarkup)\n and Backspace to\n [`deleteMarkupBackward`](https://codemirror.net/6/docs/ref/#lang-markdown.deleteMarkupBackward).\n */\n const markdownKeymap = [\n { key: \"Enter\", run: insertNewlineContinueMarkup },\n { key: \"Backspace\", run: deleteMarkupBackward }\n ];\n const htmlNoMatch = /*@__PURE__*/html$1({ matchClosingTags: false });\n /**\n Markdown language support.\n */\n function markdown(config = {}) {\n let { codeLanguages, defaultCodeLanguage, addKeymap = true, base: { parser } = commonmarkLanguage, completeHTMLTags = true } = config;\n if (!(parser instanceof MarkdownParser))\n throw new RangeError(\"Base parser provided to `markdown` should be a Markdown parser\");\n let extensions = config.extensions ? [config.extensions] : [];\n let support = [htmlNoMatch.support], defaultCode;\n if (defaultCodeLanguage instanceof LanguageSupport) {\n support.push(defaultCodeLanguage.support);\n defaultCode = defaultCodeLanguage.language;\n }\n else if (defaultCodeLanguage) {\n defaultCode = defaultCodeLanguage;\n }\n let codeParser = codeLanguages || defaultCode ? getCodeParser(codeLanguages, defaultCode) : undefined;\n extensions.push(parseCode({ codeParser, htmlParser: htmlNoMatch.language.parser }));\n if (addKeymap)\n support.push(Prec.high(keymap.of(markdownKeymap)));\n let lang = mkLang(parser.configure(extensions));\n if (completeHTMLTags)\n support.push(lang.data.of({ autocomplete: htmlTagCompletion }));\n return new LanguageSupport(lang, support);\n }\n function htmlTagCompletion(context) {\n let { state, pos } = context, m = /<[:\\-\\.\\w\\u00b7-\\uffff]*$/.exec(state.sliceDoc(pos - 25, pos));\n if (!m)\n return null;\n let tree = syntaxTree(state).resolveInner(pos, -1);\n while (tree && !tree.type.isTop) {\n if (tree.name == \"CodeBlock\" || tree.name == \"FencedCode\" || tree.name == \"ProcessingInstructionBlock\" ||\n tree.name == \"CommentBlock\" || tree.name == \"Link\" || tree.name == \"Image\")\n return null;\n tree = tree.parent;\n }\n return {\n from: pos - m[0].length, to: pos,\n options: htmlTagCompletions(),\n validFor: /^<[:\\-\\.\\w\\u00b7-\\uffff]*$/\n };\n }\n let _tagCompletions = null;\n function htmlTagCompletions() {\n if (_tagCompletions)\n return _tagCompletions;\n let result = htmlCompletionSource(new CompletionContext(EditorState.create({ extensions: htmlNoMatch }), 0, true));\n return _tagCompletions = result ? result.options : [];\n }\n\n const namedColors = /*@__PURE__*/new Map([\n ['aliceblue', '#f0f8ff'],\n ['antiquewhite', '#faebd7'],\n ['aqua', '#00ffff'],\n ['aquamarine', '#7fffd4'],\n ['azure', '#f0ffff'],\n ['beige', '#f5f5dc'],\n ['bisque', '#ffe4c4'],\n ['black', '#000000'],\n ['blanchedalmond', '#ffebcd'],\n ['blue', '#0000ff'],\n ['blueviolet', '#8a2be2'],\n ['brown', '#a52a2a'],\n ['burlywood', '#deb887'],\n ['cadetblue', '#5f9ea0'],\n ['chartreuse', '#7fff00'],\n ['chocolate', '#d2691e'],\n ['coral', '#ff7f50'],\n ['cornflowerblue', '#6495ed'],\n ['cornsilk', '#fff8dc'],\n ['crimson', '#dc143c'],\n ['cyan', '#00ffff'],\n ['darkblue', '#00008b'],\n ['darkcyan', '#008b8b'],\n ['darkgoldenrod', '#b8860b'],\n ['darkgray', '#a9a9a9'],\n ['darkgreen', '#006400'],\n ['darkgrey', '#a9a9a9'],\n ['darkkhaki', '#bdb76b'],\n ['darkmagenta', '#8b008b'],\n ['darkolivegreen', '#556b2f'],\n ['darkorange', '#ff8c00'],\n ['darkorchid', '#9932cc'],\n ['darkred', '#8b0000'],\n ['darksalmon', '#e9967a'],\n ['darkseagreen', '#8fbc8f'],\n ['darkslateblue', '#483d8b'],\n ['darkslategray', '#2f4f4f'],\n ['darkslategrey', '#2f4f4f'],\n ['darkturquoise', '#00ced1'],\n ['darkviolet', '#9400d3'],\n ['deeppink', '#ff1493'],\n ['deepskyblue', '#00bfff'],\n ['dimgray', '#696969'],\n ['dimgrey', '#696969'],\n ['dodgerblue', '#1e90ff'],\n ['firebrick', '#b22222'],\n ['floralwhite', '#fffaf0'],\n ['forestgreen', '#228b22'],\n ['fuchsia', '#ff00ff'],\n ['gainsboro', '#dcdcdc'],\n ['ghostwhite', '#f8f8ff'],\n ['goldenrod', '#daa520'],\n ['gold', '#ffd700'],\n ['gray', '#808080'],\n ['green', '#008000'],\n ['greenyellow', '#adff2f'],\n ['grey', '#808080'],\n ['honeydew', '#f0fff0'],\n ['hotpink', '#ff69b4'],\n ['indianred', '#cd5c5c'],\n ['indigo', '#4b0082'],\n ['ivory', '#fffff0'],\n ['khaki', '#f0e68c'],\n ['lavenderblush', '#fff0f5'],\n ['lavender', '#e6e6fa'],\n ['lawngreen', '#7cfc00'],\n ['lemonchiffon', '#fffacd'],\n ['lightblue', '#add8e6'],\n ['lightcoral', '#f08080'],\n ['lightcyan', '#e0ffff'],\n ['lightgoldenrodyellow', '#fafad2'],\n ['lightgray', '#d3d3d3'],\n ['lightgreen', '#90ee90'],\n ['lightgrey', '#d3d3d3'],\n ['lightpink', '#ffb6c1'],\n ['lightsalmon', '#ffa07a'],\n ['lightseagreen', '#20b2aa'],\n ['lightskyblue', '#87cefa'],\n ['lightslategray', '#778899'],\n ['lightslategrey', '#778899'],\n ['lightsteelblue', '#b0c4de'],\n ['lightyellow', '#ffffe0'],\n ['lime', '#00ff00'],\n ['limegreen', '#32cd32'],\n ['linen', '#faf0e6'],\n ['magenta', '#ff00ff'],\n ['maroon', '#800000'],\n ['mediumaquamarine', '#66cdaa'],\n ['mediumblue', '#0000cd'],\n ['mediumorchid', '#ba55d3'],\n ['mediumpurple', '#9370db'],\n ['mediumseagreen', '#3cb371'],\n ['mediumslateblue', '#7b68ee'],\n ['mediumspringgreen', '#00fa9a'],\n ['mediumturquoise', '#48d1cc'],\n ['mediumvioletred', '#c71585'],\n ['midnightblue', '#191970'],\n ['mintcream', '#f5fffa'],\n ['mistyrose', '#ffe4e1'],\n ['moccasin', '#ffe4b5'],\n ['navajowhite', '#ffdead'],\n ['navy', '#000080'],\n ['oldlace', '#fdf5e6'],\n ['olive', '#808000'],\n ['olivedrab', '#6b8e23'],\n ['orange', '#ffa500'],\n ['orangered', '#ff4500'],\n ['orchid', '#da70d6'],\n ['palegoldenrod', '#eee8aa'],\n ['palegreen', '#98fb98'],\n ['paleturquoise', '#afeeee'],\n ['palevioletred', '#db7093'],\n ['papayawhip', '#ffefd5'],\n ['peachpuff', '#ffdab9'],\n ['peru', '#cd853f'],\n ['pink', '#ffc0cb'],\n ['plum', '#dda0dd'],\n ['powderblue', '#b0e0e6'],\n ['purple', '#800080'],\n ['rebeccapurple', '#663399'],\n ['red', '#ff0000'],\n ['rosybrown', '#bc8f8f'],\n ['royalblue', '#4169e1'],\n ['saddlebrown', '#8b4513'],\n ['salmon', '#fa8072'],\n ['sandybrown', '#f4a460'],\n ['seagreen', '#2e8b57'],\n ['seashell', '#fff5ee'],\n ['sienna', '#a0522d'],\n ['silver', '#c0c0c0'],\n ['skyblue', '#87ceeb'],\n ['slateblue', '#6a5acd'],\n ['slategray', '#708090'],\n ['slategrey', '#708090'],\n ['snow', '#fffafa'],\n ['springgreen', '#00ff7f'],\n ['steelblue', '#4682b4'],\n ['tan', '#d2b48c'],\n ['teal', '#008080'],\n ['thistle', '#d8bfd8'],\n ['tomato', '#ff6347'],\n ['turquoise', '#40e0d0'],\n ['violet', '#ee82ee'],\n ['wheat', '#f5deb3'],\n ['white', '#ffffff'],\n ['whitesmoke', '#f5f5f5'],\n ['yellow', '#ffff00'],\n ['yellowgreen', '#9acd32'],\n ]);\n\n var __rest = function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n };\n const pickerState = /*@__PURE__*/new WeakMap();\n var ColorType = /*@__PURE__*/(function (ColorType) {\n ColorType[\"rgb\"] = \"RGB\";\n ColorType[\"hex\"] = \"HEX\";\n ColorType[\"named\"] = \"NAMED\";\n ColorType[\"hsl\"] = \"HSL\";\n return ColorType})(ColorType || (ColorType = {}));\n const rgbCallExpRegex = /rgb(?:a)?\\(\\s*(\\d{1,3}%?)\\s*,?\\s*(\\d{1,3}%?)\\s*,?\\s*(\\d{1,3}%?)\\s*(,\\s*0?\\.\\d+)?\\)/;\n const hslCallExpRegex = /hsl\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})%\\s*,\\s*(\\d{1,3})%\\s*(,\\s*0?\\.\\d+)?\\)/;\n const hexRegex = /(^|\\b)(#[0-9a-f]{3,9})(\\b|$)/i;\n function discoverColorsInCSS(syntaxTree, from, to, typeName, doc, language) {\n var _a;\n switch (typeName) {\n case 'AttributeValue': {\n const innerTree = syntaxTree.resolveInner(from, 0).tree;\n if (!innerTree) {\n return null;\n }\n const overlayTree = (_a = innerTree.prop(NodeProp.mounted)) === null || _a === void 0 ? void 0 : _a.tree;\n if ((overlayTree === null || overlayTree === void 0 ? void 0 : overlayTree.type.name) !== 'Styles') {\n return null;\n }\n const ret = [];\n overlayTree.iterate({\n from: 0,\n to: overlayTree.length,\n enter: ({ type, from: overlayFrom, to: overlayTo }) => {\n const maybeWidgetOptions = discoverColorsInCSS(syntaxTree, \n // We add one because the tree doesn't include the\n // quotation mark from the style tag\n from + 1 + overlayFrom, from + 1 + overlayTo, type.name, doc);\n if (maybeWidgetOptions) {\n if (Array.isArray(maybeWidgetOptions)) {\n throw new Error('Unexpected nested overlays');\n }\n ret.push(maybeWidgetOptions);\n }\n },\n });\n return ret;\n }\n case 'CallExpression': {\n const callExp = doc.sliceString(from, to);\n const result = parseCallExpression(callExp);\n if (!result) {\n return null;\n }\n return Object.assign(Object.assign({}, result), { from,\n to });\n }\n case 'ColorLiteral': {\n const result = parseColorLiteral(doc.sliceString(from, to));\n if (!result) {\n return null;\n }\n return Object.assign(Object.assign({}, result), { from,\n to });\n }\n case 'ValueName': {\n const colorName = doc.sliceString(from, to);\n const result = parseNamedColor(colorName);\n if (!result) {\n return null;\n }\n return Object.assign(Object.assign({}, result), { from,\n to });\n }\n default:\n return null;\n }\n }\n function parseCallExpression(callExp) {\n const fn = callExp.slice(0, 3);\n switch (fn) {\n case 'rgb': {\n const match = rgbCallExpRegex.exec(callExp);\n if (!match) {\n return null;\n }\n const [_, r, g, b, a] = match;\n const color = rgbToHex(r, g, b);\n return {\n colorType: ColorType.rgb,\n color,\n alpha: a || '',\n };\n }\n case 'hsl': {\n const match = hslCallExpRegex.exec(callExp);\n if (!match) {\n return null;\n }\n const [_, h, s, l, a] = match;\n const color = hslToHex(h, s, l);\n return {\n colorType: ColorType.hsl,\n color,\n alpha: a || '',\n };\n }\n default:\n return null;\n }\n }\n function parseColorLiteral(colorLiteral) {\n const match = hexRegex.exec(colorLiteral);\n if (!match) {\n return null;\n }\n const [color, alpha] = toFullHex(colorLiteral);\n return {\n colorType: ColorType.hex,\n color,\n alpha,\n };\n }\n function parseNamedColor(colorName) {\n const color = namedColors.get(colorName);\n if (!color) {\n return null;\n }\n return {\n colorType: ColorType.named,\n color,\n alpha: '',\n };\n }\n function colorPickersDecorations(view, discoverColors) {\n const widgets = [];\n const st = syntaxTree(view.state);\n for (const range of view.visibleRanges) {\n st.iterate({\n from: range.from,\n to: range.to,\n enter: ({ type, from, to }) => {\n var _a;\n const maybeWidgetOptions = discoverColors(st, from, to, type.name, view.state.doc, (_a = view.state.facet(language)) === null || _a === void 0 ? void 0 : _a.name);\n if (!maybeWidgetOptions) {\n return;\n }\n if (!Array.isArray(maybeWidgetOptions)) {\n widgets.push(Decoration.widget({\n widget: new ColorPickerWidget(maybeWidgetOptions),\n side: 1,\n }).range(maybeWidgetOptions.from));\n return;\n }\n for (const wo of maybeWidgetOptions) {\n widgets.push(Decoration.widget({\n widget: new ColorPickerWidget(wo),\n side: 1,\n }).range(wo.from));\n }\n },\n });\n }\n return Decoration.set(widgets);\n }\n function toFullHex(color) {\n if (color.length === 4) {\n // 3-char hex\n return [\n `#${color[1].repeat(2)}${color[2].repeat(2)}${color[3].repeat(2)}`,\n '',\n ];\n }\n if (color.length === 5) {\n // 4-char hex (alpha)\n return [\n `#${color[1].repeat(2)}${color[2].repeat(2)}${color[3].repeat(2)}`,\n color[4].repeat(2),\n ];\n }\n if (color.length === 9) {\n // 8-char hex (alpha)\n return [`#${color.slice(1, -2)}`, color.slice(-2)];\n }\n return [color, ''];\n }\n function rgbComponentToHex(component) {\n let numericValue;\n if (component.endsWith('%')) {\n // 0-100%\n const percent = Number(component.slice(0, -1));\n numericValue = Math.round((percent / 100) * 255.0);\n }\n else {\n numericValue = Number(component); // assume 0-255\n }\n return decimalToHex(numericValue);\n }\n function decimalToHex(decimal) {\n const hex = decimal.toString(16);\n return hex.length === 1 ? '0' + hex : hex;\n }\n function hexToRGBComponents(hex) {\n const r = hex.slice(1, 3);\n const g = hex.slice(3, 5);\n const b = hex.slice(5, 7);\n return [parseInt(r, 16), parseInt(g, 16), parseInt(b, 16)];\n }\n function rgbToHex(r, g, b) {\n return `#${rgbComponentToHex(r)}${rgbComponentToHex(g)}${rgbComponentToHex(b)}`;\n }\n function hslToHex(h, s, l) {\n const sFloat = Number(s) / 100;\n const lFloat = Number(l) / 100;\n const [r, g, b] = hslToRGB(Number(h), sFloat, lFloat);\n return `#${decimalToHex(r)}${decimalToHex(g)}${decimalToHex(b)}`;\n }\n function hslToRGB(hue, saturation, luminance) {\n // If there is no Saturation it means that it\u2019s a shade of grey.\n // So in that case we just need to convert the Luminance and set R,G and B to that level.\n if (saturation === 0) {\n const value = Math.round(luminance * 255);\n return [value, value, value];\n }\n let temp1;\n // If Luminance is smaller then 0.5 (50%) then temporary_1 = Luminance x (1.0+Saturation)\n if (luminance < 0.5) {\n temp1 = luminance * (1.0 + saturation);\n }\n else {\n // If Luminance is equal or larger then 0.5 (50%) then temporary_1 = Luminance + Saturation \u2013 Luminance x Saturation\n temp1 = luminance + saturation - luminance * saturation;\n }\n // temporary_2 = 2 x Luminance \u2013 temporary _1\n const temp2 = 2 * luminance - temp1;\n // The next step is to convert the 360 degrees in a circle to 1 by dividing the angle by 360.\n hue = hue / 360.0;\n // And now we need another temporary variable for each color channel, temporary_R, temporary_G and temporary_B.\n // All values need to be between 0 and 1. In our case all the values are between 0 and 1\n const tempR = clamp(hue + 0.333);\n const tempG = hue;\n const tempB = clamp(hue - 0.333);\n const red = hueToRGB(temp1, temp2, tempR);\n const green = hueToRGB(temp1, temp2, tempG);\n const blue = hueToRGB(temp1, temp2, tempB);\n return [\n Math.round(red * 255),\n Math.round(green * 255),\n Math.round(blue * 255),\n ];\n }\n // If you get a negative value you need to add 1 to it.\n // If you get a value above 1 you need to subtract 1 from it.\n function clamp(num) {\n if (num < 0) {\n return num + 1;\n }\n if (num > 1) {\n return num - 1;\n }\n return num;\n }\n /**\n * Now we need to do up to 3 tests to select the correct formula for each color channel. Let\u2019s start with Red.\n *\n * test 1 \u2013 If 6 x temporary_R is smaller then 1, Red = temporary_2 + (temporary_1 \u2013 temporary_2) x 6 x temporary_R\n * In the case the first test is larger then 1 check the following\n *\n * test 2 \u2013 If 2 x temporary_R is smaller then 1, Red = temporary_1\n * In the case the second test also is larger then 1 do the following\n *\n * test 3 \u2013 If 3 x temporary_R is smaller then 2, Red = temporary_2 + (temporary_1 \u2013 temporary_2) x (0.666 \u2013 temporary_R) x 6\n * In the case the third test also is larger then 2 you do the following\n *\n * Red = temporary_2\n */\n function hueToRGB(temp1, temp2, tempHue) {\n if (6 * tempHue < 1) {\n return temp2 + (temp1 - temp2) * 6 * tempHue;\n }\n if (2 * tempHue < 1) {\n return temp1;\n }\n if (3 * tempHue < 2) {\n return temp2 + (temp1 - temp2) * (0.666 - tempHue) * 6;\n }\n return temp2;\n }\n // https://www.niwa.nu/2013/05/math-behind-colorspace-conversions-rgb-hsl/\n function rgbToHSL(r, g, b) {\n const redPercent = r / 255;\n const greenPercent = g / 255;\n const bluePercent = b / 255;\n const min = Math.min(redPercent, greenPercent, bluePercent);\n const max = Math.max(redPercent, greenPercent, bluePercent);\n const luminance = (max + min) / 2;\n // If the min and max value are the same, it means that there is no saturation. ...\n // If there is no Saturation, we don\u2019t need to calculate the Hue. So we set it to 0 degrees.\n if (max === min) {\n return [0, 0, luminance];\n }\n let saturation;\n // If Luminance is less or equal to 0.5, then Saturation = (max-min)/(max+min)\n if (luminance <= 0.5) {\n saturation = (max - min) / (max + min);\n }\n else {\n // If Luminance is bigger then 0.5. then Saturation = ( max-min)/(2.0-max-min)\n saturation = (max - min) / (2.0 - max - min);\n }\n let hue;\n // If Red is max, then Hue = (G-B)/(max-min)\n if (max === redPercent) {\n hue = (greenPercent - bluePercent) / (max - min);\n }\n else if (greenPercent === max) {\n // If Green is max, then Hue = 2.0 + (B-R)/(max-min)\n hue = 2.0 + (bluePercent - redPercent) / (max - min);\n }\n else {\n // If Blue is max, then Hue = 4.0 + (R-G)/(max-min)\n hue = 4.0 + (redPercent - greenPercent) / (max - min);\n }\n hue = Math.round(hue * 60); // convert to degrees\n // make hue positive angle/degrees\n while (hue < 0) {\n hue += 360;\n }\n return [hue, saturation, luminance];\n }\n const wrapperClassName = 'cm-css-color-picker-wrapper';\n class ColorPickerWidget extends WidgetType {\n constructor(_a) {\n var { color } = _a, state = __rest(_a, [\"color\"]);\n super();\n this.state = state;\n this.color = color;\n }\n eq(other) {\n return (other.state.colorType === this.state.colorType &&\n other.color === this.color &&\n other.state.from === this.state.from &&\n other.state.to === this.state.to &&\n other.state.alpha === this.state.alpha);\n }\n toDOM() {\n const picker = document.createElement('input');\n pickerState.set(picker, this.state);\n picker.type = 'color';\n picker.value = this.color;\n const wrapper = document.createElement('span');\n wrapper.appendChild(picker);\n wrapper.className = wrapperClassName;\n return wrapper;\n }\n ignoreEvent() {\n return false;\n }\n }\n const colorPickerTheme = /*@__PURE__*/EditorView.baseTheme({\n [`.${wrapperClassName}`]: {\n display: 'inline-block',\n outline: '1px solid #eee',\n marginRight: '0.6ch',\n height: '1em',\n width: '1em',\n transform: 'translateY(1px)',\n },\n [`.${wrapperClassName} input[type=\"color\"]`]: {\n cursor: 'pointer',\n height: '100%',\n width: '100%',\n padding: 0,\n border: 'none',\n '&::-webkit-color-swatch-wrapper': {\n padding: 0,\n },\n '&::-webkit-color-swatch': {\n border: 'none',\n },\n '&::-moz-color-swatch': {\n border: 'none',\n },\n },\n });\n const makeColorPicker = (options) => ViewPlugin.fromClass(class ColorPickerViewPlugin {\n constructor(view) {\n this.decorations = colorPickersDecorations(view, options.discoverColors);\n }\n update(update) {\n if (update.docChanged || update.viewportChanged) {\n this.decorations = colorPickersDecorations(update.view, options.discoverColors);\n }\n }\n }, {\n decorations: (v) => v.decorations,\n eventHandlers: {\n change: (e, view) => {\n const target = e.target;\n if (target.nodeName !== 'INPUT' ||\n !target.parentElement ||\n !target.parentElement.classList.contains(wrapperClassName)) {\n return false;\n }\n const data = pickerState.get(target);\n let converted = target.value + data.alpha;\n if (data.colorType === ColorType.rgb) {\n converted = `rgb(${hexToRGBComponents(target.value).join(', ')}${data.alpha})`;\n }\n else if (data.colorType === ColorType.named) {\n // If the hex is an exact match for another named color, prefer retaining name\n for (const [key, value] of namedColors.entries()) {\n if (value === target.value) {\n converted = key;\n }\n }\n }\n else if (data.colorType === ColorType.hsl) {\n const [r, g, b] = hexToRGBComponents(target.value);\n const [h, s, l] = rgbToHSL(r, g, b);\n converted = `hsl(${h}, ${Math.round(s * 100)}%, ${Math.round(l * 100)}%${data.alpha})`;\n }\n view.dispatch({\n changes: {\n from: data.from,\n to: data.to,\n insert: converted,\n },\n });\n return true;\n },\n },\n });\n const colorPicker = [/*@__PURE__*/makeColorPicker({ discoverColors: discoverColorsInCSS }), colorPickerTheme];\n\n var __defProp = Object.defineProperty;\n var __defProps = Object.defineProperties;\n var __getOwnPropDescs = Object.getOwnPropertyDescriptors;\n var __getOwnPropSymbols = Object.getOwnPropertySymbols;\n var __hasOwnProp = Object.prototype.hasOwnProperty;\n var __propIsEnum = Object.prototype.propertyIsEnumerable;\n var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\n var __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n };\n var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\n var __publicField = (obj, key, value) => {\n __defNormalProp(obj, typeof key !== \"symbol\" ? key + \"\" : key, value);\n return value;\n };\n function isNumber$3(code2) {\n return code2 > 47 && code2 < 58;\n }\n function isAlpha$1(code2, from, to) {\n from = from || 65;\n to = to || 90;\n code2 &= ~32;\n return code2 >= from && code2 <= to;\n }\n function isAlphaNumericWord(code2) {\n return isNumber$3(code2) || isAlphaWord(code2);\n }\n function isAlphaWord(code2) {\n return code2 === 95 || isAlpha$1(code2);\n }\n function isWhiteSpace$4(code2) {\n return code2 === 32 || code2 === 9 || code2 === 160;\n }\n function isSpace$2(code2) {\n return isWhiteSpace$4(code2) || code2 === 10 || code2 === 13;\n }\n function isQuote$3(code2) {\n return code2 === 39 || code2 === 34;\n }\n class Scanner$1 {\n constructor(str, start, end) {\n if (end == null && typeof str === \"string\") {\n end = str.length;\n }\n this.string = str;\n this.pos = this.start = start || 0;\n this.end = end || 0;\n }\n eof() {\n return this.pos >= this.end;\n }\n limit(start, end) {\n return new Scanner$1(this.string, start, end);\n }\n peek() {\n return this.string.charCodeAt(this.pos);\n }\n next() {\n if (this.pos < this.string.length) {\n return this.string.charCodeAt(this.pos++);\n }\n }\n eat(match) {\n const ch = this.peek();\n const ok = typeof match === \"function\" ? match(ch) : ch === match;\n if (ok) {\n this.next();\n }\n return ok;\n }\n eatWhile(match) {\n const start = this.pos;\n while (!this.eof() && this.eat(match)) {\n }\n return this.pos !== start;\n }\n backUp(n) {\n this.pos -= n || 1;\n }\n current() {\n return this.substring(this.start, this.pos);\n }\n substring(start, end) {\n return this.string.slice(start, end);\n }\n error(message, pos = this.pos) {\n return new ScannerError$1(`${message} at ${pos + 1}`, pos, this.string);\n }\n }\n class ScannerError$1 extends Error {\n constructor(message, pos, str) {\n super(message);\n this.pos = pos;\n this.string = str;\n }\n }\n function tokenScanner$1(tokens) {\n return {\n tokens,\n start: 0,\n pos: 0,\n size: tokens.length\n };\n }\n function peek$3(scanner) {\n return scanner.tokens[scanner.pos];\n }\n function next(scanner) {\n return scanner.tokens[scanner.pos++];\n }\n function slice(scanner, from = scanner.start, to = scanner.pos) {\n return scanner.tokens.slice(from, to);\n }\n function readable$1(scanner) {\n return scanner.pos < scanner.size;\n }\n function consume$2(scanner, test) {\n const token2 = peek$3(scanner);\n if (token2 && test(token2)) {\n scanner.pos++;\n return true;\n }\n return false;\n }\n function error$2(scanner, message, token2 = peek$3(scanner)) {\n if (token2 && token2.start != null) {\n message += ` at ${token2.start}`;\n }\n const err = new Error(message);\n err[\"pos\"] = token2 && token2.start;\n return err;\n }\n function abbreviation(abbr, options = {}) {\n const scanner = tokenScanner$1(abbr);\n const result = statements(scanner, options);\n if (readable$1(scanner)) {\n throw error$2(scanner, \"Unexpected character\");\n }\n return result;\n }\n function statements(scanner, options) {\n const result = {\n type: \"TokenGroup\",\n elements: []\n };\n let ctx = result;\n let node;\n const stack = [];\n while (readable$1(scanner)) {\n if (node = element$2(scanner, options) || group(scanner, options)) {\n ctx.elements.push(node);\n if (consume$2(scanner, isChildOperator)) {\n stack.push(ctx);\n ctx = node;\n } else if (consume$2(scanner, isSiblingOperator$1)) {\n continue;\n } else if (consume$2(scanner, isClimbOperator)) {\n do {\n if (stack.length) {\n ctx = stack.pop();\n }\n } while (consume$2(scanner, isClimbOperator));\n }\n } else {\n break;\n }\n }\n return result;\n }\n function group(scanner, options) {\n if (consume$2(scanner, isGroupStart)) {\n const result = statements(scanner, options);\n const token2 = next(scanner);\n if (isBracket$2(token2, \"group\", false)) {\n result.repeat = repeater(scanner);\n }\n return result;\n }\n }\n function element$2(scanner, options) {\n let attr;\n const elem = {\n type: \"TokenElement\",\n name: void 0,\n attributes: void 0,\n value: void 0,\n repeat: void 0,\n selfClose: false,\n elements: []\n };\n if (elementName(scanner, options)) {\n elem.name = slice(scanner);\n }\n while (readable$1(scanner)) {\n scanner.start = scanner.pos;\n if (!elem.repeat && !isEmpty(elem) && consume$2(scanner, isRepeater)) {\n elem.repeat = scanner.tokens[scanner.pos - 1];\n } else if (!elem.value && text(scanner)) {\n elem.value = getText(scanner);\n } else if (attr = shortAttribute(scanner, \"id\", options) || shortAttribute(scanner, \"class\", options) || attributeSet(scanner)) {\n if (!elem.attributes) {\n elem.attributes = Array.isArray(attr) ? attr.slice() : [attr];\n } else {\n elem.attributes = elem.attributes.concat(attr);\n }\n } else {\n if (!isEmpty(elem) && consume$2(scanner, isCloseOperator)) {\n elem.selfClose = true;\n if (!elem.repeat && consume$2(scanner, isRepeater)) {\n elem.repeat = scanner.tokens[scanner.pos - 1];\n }\n }\n break;\n }\n }\n return !isEmpty(elem) ? elem : void 0;\n }\n function attributeSet(scanner) {\n if (consume$2(scanner, isAttributeSetStart)) {\n const attributes = [];\n let attr;\n while (readable$1(scanner)) {\n if (attr = attribute(scanner)) {\n attributes.push(attr);\n } else if (consume$2(scanner, isAttributeSetEnd)) {\n break;\n } else if (!consume$2(scanner, isWhiteSpace$3)) {\n throw error$2(scanner, `Unexpected \"${peek$3(scanner).type}\" token`);\n }\n }\n return attributes;\n }\n }\n function shortAttribute(scanner, type, options) {\n if (isOperator$2(peek$3(scanner), type)) {\n scanner.pos++;\n const attr = {\n name: [createLiteral$1(type)]\n };\n if (options.jsx && text(scanner)) {\n attr.value = getText(scanner);\n attr.expression = true;\n } else {\n attr.value = literal$2(scanner) ? slice(scanner) : void 0;\n }\n return attr;\n }\n }\n function attribute(scanner) {\n if (quoted(scanner)) {\n return {\n value: slice(scanner)\n };\n }\n if (literal$2(scanner, true)) {\n return {\n name: slice(scanner),\n value: consume$2(scanner, isEquals) && (quoted(scanner) || literal$2(scanner, true)) ? slice(scanner) : void 0\n };\n }\n }\n function repeater(scanner) {\n return isRepeater(peek$3(scanner)) ? scanner.tokens[scanner.pos++] : void 0;\n }\n function quoted(scanner) {\n const start = scanner.pos;\n const quote2 = peek$3(scanner);\n if (isQuote$2(quote2)) {\n scanner.pos++;\n while (readable$1(scanner)) {\n if (isQuote$2(next(scanner), quote2.single)) {\n scanner.start = start;\n return true;\n }\n }\n throw error$2(scanner, \"Unclosed quote\", quote2);\n }\n return false;\n }\n function literal$2(scanner, allowBrackets) {\n const start = scanner.pos;\n const brackets = {\n attribute: 0,\n expression: 0,\n group: 0\n };\n while (readable$1(scanner)) {\n const token2 = peek$3(scanner);\n if (brackets.expression) {\n if (isBracket$2(token2, \"expression\")) {\n brackets[token2.context] += token2.open ? 1 : -1;\n }\n } else if (isQuote$2(token2) || isOperator$2(token2) || isWhiteSpace$3(token2) || isRepeater(token2)) {\n break;\n } else if (isBracket$2(token2)) {\n if (!allowBrackets) {\n break;\n }\n if (token2.open) {\n brackets[token2.context]++;\n } else if (!brackets[token2.context]) {\n break;\n } else {\n brackets[token2.context]--;\n }\n }\n scanner.pos++;\n }\n if (start !== scanner.pos) {\n scanner.start = start;\n return true;\n }\n return false;\n }\n function elementName(scanner, options) {\n const start = scanner.pos;\n if (options.jsx && consume$2(scanner, isCapitalizedLiteral)) {\n while (readable$1(scanner)) {\n const { pos } = scanner;\n if (!consume$2(scanner, isClassNameOperator) || !consume$2(scanner, isCapitalizedLiteral)) {\n scanner.pos = pos;\n break;\n }\n }\n }\n while (readable$1(scanner) && consume$2(scanner, isElementName)) {\n }\n if (scanner.pos !== start) {\n scanner.start = start;\n return true;\n }\n return false;\n }\n function text(scanner) {\n const start = scanner.pos;\n if (consume$2(scanner, isTextStart)) {\n let brackets = 0;\n while (readable$1(scanner)) {\n const token2 = next(scanner);\n if (isBracket$2(token2, \"expression\")) {\n if (token2.open) {\n brackets++;\n } else if (!brackets) {\n break;\n } else {\n brackets--;\n }\n }\n }\n scanner.start = start;\n return true;\n }\n return false;\n }\n function getText(scanner) {\n let from = scanner.start;\n let to = scanner.pos;\n if (isBracket$2(scanner.tokens[from], \"expression\", true)) {\n from++;\n }\n if (isBracket$2(scanner.tokens[to - 1], \"expression\", false)) {\n to--;\n }\n return slice(scanner, from, to);\n }\n function isBracket$2(token2, context, isOpen) {\n return Boolean(token2 && token2.type === \"Bracket\" && (!context || token2.context === context) && (isOpen == null || token2.open === isOpen));\n }\n function isOperator$2(token2, type) {\n return Boolean(token2 && token2.type === \"Operator\" && (!type || token2.operator === type));\n }\n function isQuote$2(token2, isSingle) {\n return Boolean(token2 && token2.type === \"Quote\" && (isSingle == null || token2.single === isSingle));\n }\n function isWhiteSpace$3(token2) {\n return Boolean(token2 && token2.type === \"WhiteSpace\");\n }\n function isEquals(token2) {\n return isOperator$2(token2, \"equal\");\n }\n function isRepeater(token2) {\n return Boolean(token2 && token2.type === \"Repeater\");\n }\n function isLiteral$2(token2) {\n return token2.type === \"Literal\";\n }\n function isCapitalizedLiteral(token2) {\n if (isLiteral$2(token2)) {\n const ch = token2.value.charCodeAt(0);\n return ch >= 65 && ch <= 90;\n }\n return false;\n }\n function isElementName(token2) {\n return token2.type === \"Literal\" || token2.type === \"RepeaterNumber\" || token2.type === \"RepeaterPlaceholder\";\n }\n function isClassNameOperator(token2) {\n return isOperator$2(token2, \"class\");\n }\n function isAttributeSetStart(token2) {\n return isBracket$2(token2, \"attribute\", true);\n }\n function isAttributeSetEnd(token2) {\n return isBracket$2(token2, \"attribute\", false);\n }\n function isTextStart(token2) {\n return isBracket$2(token2, \"expression\", true);\n }\n function isGroupStart(token2) {\n return isBracket$2(token2, \"group\", true);\n }\n function createLiteral$1(value) {\n return { type: \"Literal\", value };\n }\n function isEmpty(elem) {\n return !elem.name && !elem.value && !elem.attributes;\n }\n function isChildOperator(token2) {\n return isOperator$2(token2, \"child\");\n }\n function isSiblingOperator$1(token2) {\n return isOperator$2(token2, \"sibling\");\n }\n function isClimbOperator(token2) {\n return isOperator$2(token2, \"climb\");\n }\n function isCloseOperator(token2) {\n return isOperator$2(token2, \"close\");\n }\n function escaped(scanner) {\n if (scanner.eat(92)) {\n scanner.start = scanner.pos;\n if (!scanner.eof()) {\n scanner.pos++;\n }\n return true;\n }\n return false;\n }\n function tokenize$1(source) {\n const scanner = new Scanner$1(source);\n const result = [];\n const ctx = {\n group: 0,\n attribute: 0,\n expression: 0,\n quote: 0\n };\n let ch = 0;\n let token2;\n while (!scanner.eof()) {\n ch = scanner.peek();\n token2 = getToken$1(scanner, ctx);\n if (token2) {\n result.push(token2);\n if (token2.type === \"Quote\") {\n ctx.quote = ch === ctx.quote ? 0 : ch;\n } else if (token2.type === \"Bracket\") {\n ctx[token2.context] += token2.open ? 1 : -1;\n }\n } else {\n throw scanner.error(\"Unexpected character\");\n }\n }\n return result;\n }\n function getToken$1(scanner, ctx) {\n return field$3(scanner, ctx) || repeaterPlaceholder(scanner) || repeaterNumber(scanner) || repeater$1(scanner) || whiteSpace$1(scanner) || literal$1$1(scanner, ctx) || operator$1(scanner) || quote(scanner) || bracket$1(scanner);\n }\n function literal$1$1(scanner, ctx) {\n const start = scanner.pos;\n let value = \"\";\n while (!scanner.eof()) {\n if (escaped(scanner)) {\n value += scanner.current();\n continue;\n }\n const ch = scanner.peek();\n if (ch === ctx.quote || ch === 36 || isAllowedOperator(ch, ctx)) {\n break;\n }\n if (ctx.expression && ch === 125) {\n break;\n }\n if (!ctx.quote && !ctx.expression) {\n if (!ctx.attribute && !isElementName$1(ch)) {\n break;\n }\n if (isAllowedSpace(ch, ctx) || isAllowedRepeater(ch, ctx) || isQuote$3(ch) || bracketType(ch)) {\n break;\n }\n }\n value += scanner.string[scanner.pos++];\n }\n if (start !== scanner.pos) {\n scanner.start = start;\n return {\n type: \"Literal\",\n value,\n start,\n end: scanner.pos\n };\n }\n }\n function whiteSpace$1(scanner) {\n const start = scanner.pos;\n if (scanner.eatWhile(isSpace$2)) {\n return {\n type: \"WhiteSpace\",\n start,\n end: scanner.pos,\n value: scanner.substring(start, scanner.pos)\n };\n }\n }\n function quote(scanner) {\n const ch = scanner.peek();\n if (isQuote$3(ch)) {\n return {\n type: \"Quote\",\n single: ch === 39,\n start: scanner.pos++,\n end: scanner.pos\n };\n }\n }\n function bracket$1(scanner) {\n const ch = scanner.peek();\n const context = bracketType(ch);\n if (context) {\n return {\n type: \"Bracket\",\n open: isOpenBracket$2(ch),\n context,\n start: scanner.pos++,\n end: scanner.pos\n };\n }\n }\n function operator$1(scanner) {\n const op = operatorType$1(scanner.peek());\n if (op) {\n return {\n type: \"Operator\",\n operator: op,\n start: scanner.pos++,\n end: scanner.pos\n };\n }\n }\n function repeater$1(scanner) {\n const start = scanner.pos;\n if (scanner.eat(42)) {\n scanner.start = scanner.pos;\n let count = 1;\n let implicit = false;\n if (scanner.eatWhile(isNumber$3)) {\n count = Number(scanner.current());\n } else {\n implicit = true;\n }\n return {\n type: \"Repeater\",\n count,\n value: 0,\n implicit,\n start,\n end: scanner.pos\n };\n }\n }\n function repeaterPlaceholder(scanner) {\n const start = scanner.pos;\n if (scanner.eat(36) && scanner.eat(35)) {\n return {\n type: \"RepeaterPlaceholder\",\n value: void 0,\n start,\n end: scanner.pos\n };\n }\n scanner.pos = start;\n }\n function repeaterNumber(scanner) {\n const start = scanner.pos;\n if (scanner.eatWhile(36)) {\n const size = scanner.pos - start;\n let reverse = false;\n let base = 1;\n let parent = 0;\n if (scanner.eat(64)) {\n while (scanner.eat(94)) {\n parent++;\n }\n reverse = scanner.eat(45);\n scanner.start = scanner.pos;\n if (scanner.eatWhile(isNumber$3)) {\n base = Number(scanner.current());\n }\n }\n scanner.start = start;\n return {\n type: \"RepeaterNumber\",\n size,\n reverse,\n base,\n parent,\n start,\n end: scanner.pos\n };\n }\n }\n function field$3(scanner, ctx) {\n const start = scanner.pos;\n if ((ctx.expression || ctx.attribute) && scanner.eat(36) && scanner.eat(123)) {\n scanner.start = scanner.pos;\n let index;\n let name = \"\";\n if (scanner.eatWhile(isNumber$3)) {\n index = Number(scanner.current());\n name = scanner.eat(58) ? consumePlaceholder$2(scanner) : \"\";\n } else if (isAlpha$1(scanner.peek())) {\n name = consumePlaceholder$2(scanner);\n }\n if (scanner.eat(125)) {\n return {\n type: \"Field\",\n index,\n name,\n start,\n end: scanner.pos\n };\n }\n throw scanner.error(\"Expecting }\");\n }\n scanner.pos = start;\n }\n function consumePlaceholder$2(stream) {\n const stack = [];\n stream.start = stream.pos;\n while (!stream.eof()) {\n if (stream.eat(123)) {\n stack.push(stream.pos);\n } else if (stream.eat(125)) {\n if (!stack.length) {\n stream.pos--;\n break;\n }\n stack.pop();\n } else {\n stream.pos++;\n }\n }\n if (stack.length) {\n stream.pos = stack.pop();\n throw stream.error(`Expecting }`);\n }\n return stream.current();\n }\n function isAllowedOperator(ch, ctx) {\n const op = operatorType$1(ch);\n if (!op || ctx.quote || ctx.expression) {\n return false;\n }\n return !ctx.attribute || op === \"equal\";\n }\n function isAllowedSpace(ch, ctx) {\n return isSpace$2(ch) && !ctx.expression;\n }\n function isAllowedRepeater(ch, ctx) {\n return ch === 42 && !ctx.attribute && !ctx.expression;\n }\n function bracketType(ch) {\n if (ch === 40 || ch === 41) {\n return \"group\";\n }\n if (ch === 91 || ch === 93) {\n return \"attribute\";\n }\n if (ch === 123 || ch === 125) {\n return \"expression\";\n }\n }\n function operatorType$1(ch) {\n return ch === 62 && \"child\" || ch === 43 && \"sibling\" || ch === 94 && \"climb\" || ch === 46 && \"class\" || ch === 35 && \"id\" || ch === 47 && \"close\" || ch === 61 && \"equal\" || void 0;\n }\n function isOpenBracket$2(ch) {\n return ch === 123 || ch === 91 || ch === 40;\n }\n function isElementName$1(ch) {\n return isAlphaNumericWord(ch) || ch === 45 || ch === 58 || ch === 33;\n }\n const operators = {\n child: \">\",\n class: \".\",\n climb: \"^\",\n id: \"#\",\n equal: \"=\",\n close: \"/\",\n sibling: \"+\"\n };\n const tokenVisitor = {\n Literal(token2) {\n return token2.value;\n },\n Quote(token2) {\n return token2.single ? \"'\" : '\"';\n },\n Bracket(token2) {\n if (token2.context === \"attribute\") {\n return token2.open ? \"[\" : \"]\";\n } else if (token2.context === \"expression\") {\n return token2.open ? \"{\" : \"}\";\n } else {\n return token2.open ? \"(\" : \"}\";\n }\n },\n Operator(token2) {\n return operators[token2.operator];\n },\n Field(token2, state) {\n if (token2.index != null) {\n return token2.name ? `\\${${token2.index}:${token2.name}}` : `\\${${token2.index}`;\n } else if (token2.name) {\n return state.getVariable(token2.name);\n }\n return \"\";\n },\n RepeaterPlaceholder(token2, state) {\n let repeater2;\n for (let i = state.repeaters.length - 1; i >= 0; i--) {\n if (state.repeaters[i].implicit) {\n repeater2 = state.repeaters[i];\n break;\n }\n }\n state.inserted = true;\n return state.getText(repeater2 && repeater2.value);\n },\n RepeaterNumber(token2, state) {\n let value = 1;\n const lastIx = state.repeaters.length - 1;\n const repeater2 = state.repeaters[lastIx];\n if (repeater2) {\n value = token2.reverse ? token2.base + repeater2.count - repeater2.value - 1 : token2.base + repeater2.value;\n if (token2.parent) {\n const parentIx = Math.max(0, lastIx - token2.parent);\n if (parentIx !== lastIx) {\n const parentRepeater = state.repeaters[parentIx];\n value += repeater2.count * parentRepeater.value;\n }\n }\n }\n let result = String(value);\n while (result.length < token2.size) {\n result = \"0\" + result;\n }\n return result;\n },\n WhiteSpace(token2) {\n return token2.value;\n }\n };\n function stringify$1(token2, state) {\n if (!tokenVisitor[token2.type]) {\n throw new Error(`Unknown token ${token2.type}`);\n }\n return tokenVisitor[token2.type](token2, state);\n }\n const urlRegex = /^((https?:|ftp:|file:)?\\/\\/|(www|ftp)\\.)[^ ]*$/;\n const emailRegex = /^[a-z0-9._%+-]+@[a-z0-9.-]+\\.[a-z]{2,5}$/;\n function convert(abbr, options = {}) {\n let textInserted = false;\n let cleanText;\n if (options.text) {\n if (Array.isArray(options.text)) {\n cleanText = options.text.filter((s) => s.trim());\n } else {\n cleanText = options.text;\n }\n }\n const result = {\n type: \"Abbreviation\",\n children: convertGroup(abbr, {\n inserted: false,\n repeaters: [],\n text: options.text,\n cleanText,\n repeatGuard: options.maxRepeat || Number.POSITIVE_INFINITY,\n getText(pos) {\n var _a;\n textInserted = true;\n let value;\n if (Array.isArray(options.text)) {\n if (pos !== void 0 && pos >= 0 && pos < cleanText.length) {\n return cleanText[pos];\n }\n value = pos !== void 0 ? options.text[pos] : options.text.join(\"\\n\");\n } else {\n value = (_a = options.text) !== null && _a !== void 0 ? _a : \"\";\n }\n return value;\n },\n getVariable(name) {\n const varValue = options.variables && options.variables[name];\n return varValue != null ? varValue : name;\n }\n })\n };\n if (options.text != null && !textInserted) {\n const deepest = deepestNode(last$2(result.children));\n if (deepest) {\n const text2 = Array.isArray(options.text) ? options.text.join(\"\\n\") : options.text;\n insertText(deepest, text2);\n if (deepest.name === \"a\" && options.href) {\n insertHref(deepest, text2);\n }\n }\n }\n return result;\n }\n function convertStatement(node, state) {\n let result = [];\n if (node.repeat) {\n const original = node.repeat;\n const repeat = Object.assign({}, original);\n repeat.count = repeat.implicit && Array.isArray(state.text) ? state.cleanText.length : repeat.count || 1;\n let items;\n state.repeaters.push(repeat);\n for (let i = 0; i < repeat.count; i++) {\n repeat.value = i;\n node.repeat = repeat;\n items = isGroup(node) ? convertGroup(node, state) : convertElement(node, state);\n if (repeat.implicit && !state.inserted) {\n const target = last$2(items);\n const deepest = target && deepestNode(target);\n if (deepest) {\n insertText(deepest, state.getText(repeat.value));\n }\n }\n result = result.concat(items);\n if (--state.repeatGuard <= 0) {\n break;\n }\n }\n state.repeaters.pop();\n node.repeat = original;\n if (repeat.implicit) {\n state.inserted = true;\n }\n } else {\n result = result.concat(isGroup(node) ? convertGroup(node, state) : convertElement(node, state));\n }\n return result;\n }\n function convertElement(node, state) {\n let children = [];\n const elem = {\n type: \"AbbreviationNode\",\n name: node.name && stringifyName(node.name, state),\n value: node.value && stringifyValue$1(node.value, state),\n attributes: void 0,\n children,\n repeat: node.repeat && Object.assign({}, node.repeat),\n selfClosing: node.selfClose\n };\n let result = [elem];\n for (const child of node.elements) {\n children = children.concat(convertStatement(child, state));\n }\n if (node.attributes) {\n elem.attributes = [];\n for (const attr of node.attributes) {\n elem.attributes.push(convertAttribute(attr, state));\n }\n }\n if (!elem.name && !elem.attributes && elem.value && !elem.value.some(isField$1)) {\n result = result.concat(children);\n } else {\n elem.children = children;\n }\n return result;\n }\n function convertGroup(node, state) {\n let result = [];\n for (const child of node.elements) {\n result = result.concat(convertStatement(child, state));\n }\n if (node.repeat) {\n result = attachRepeater(result, node.repeat);\n }\n return result;\n }\n function convertAttribute(node, state) {\n let implied = false;\n let isBoolean = false;\n let valueType = node.expression ? \"expression\" : \"raw\";\n let value;\n const name = node.name && stringifyName(node.name, state);\n if (name && name[0] === \"!\") {\n implied = true;\n }\n if (name && name[name.length - 1] === \".\") {\n isBoolean = true;\n }\n if (node.value) {\n const tokens = node.value.slice();\n if (isQuote$2(tokens[0])) {\n const quote2 = tokens.shift();\n if (tokens.length && last$2(tokens).type === quote2.type) {\n tokens.pop();\n }\n valueType = quote2.single ? \"singleQuote\" : \"doubleQuote\";\n } else if (isBracket$2(tokens[0], \"expression\", true)) {\n valueType = \"expression\";\n tokens.shift();\n if (isBracket$2(last$2(tokens), \"expression\", false)) {\n tokens.pop();\n }\n }\n value = stringifyValue$1(tokens, state);\n }\n return {\n name: isBoolean || implied ? name.slice(implied ? 1 : 0, isBoolean ? -1 : void 0) : name,\n value,\n boolean: isBoolean,\n implied,\n valueType\n };\n }\n function stringifyName(tokens, state) {\n let str = \"\";\n for (let i = 0; i < tokens.length; i++) {\n str += stringify$1(tokens[i], state);\n }\n return str;\n }\n function stringifyValue$1(tokens, state) {\n const result = [];\n let str = \"\";\n for (let i = 0, token2; i < tokens.length; i++) {\n token2 = tokens[i];\n if (isField$1(token2)) {\n if (str) {\n result.push(str);\n str = \"\";\n }\n result.push(token2);\n } else {\n str += stringify$1(token2, state);\n }\n }\n if (str) {\n result.push(str);\n }\n return result;\n }\n function isGroup(node) {\n return node.type === \"TokenGroup\";\n }\n function isField$1(token2) {\n return typeof token2 === \"object\" && token2.type === \"Field\" && token2.index != null;\n }\n function last$2(arr) {\n return arr[arr.length - 1];\n }\n function deepestNode(node) {\n return node.children.length ? deepestNode(last$2(node.children)) : node;\n }\n function insertText(node, text2) {\n if (node.value) {\n const lastToken = last$2(node.value);\n if (typeof lastToken === \"string\") {\n node.value[node.value.length - 1] += text2;\n } else {\n node.value.push(text2);\n }\n } else {\n node.value = [text2];\n }\n }\n function insertHref(node, text2) {\n var _a;\n let href = \"\";\n if (urlRegex.test(text2)) {\n href = text2;\n if (!/\\w+:/.test(href) && !href.startsWith(\"//\")) {\n href = `http://${href}`;\n }\n } else if (emailRegex.test(text2)) {\n href = `mailto:${text2}`;\n }\n const hrefAttribute = (_a = node.attributes) === null || _a === void 0 ? void 0 : _a.find((attr) => attr.name === \"href\");\n if (!hrefAttribute) {\n node.attributes = [{ name: \"href\", value: [href], valueType: \"doubleQuote\" }];\n } else if (!hrefAttribute.value) {\n hrefAttribute.value = [href];\n }\n }\n function attachRepeater(items, repeater2) {\n for (const item of items) {\n if (!item.repeat) {\n item.repeat = Object.assign({}, repeater2);\n }\n }\n return items;\n }\n function parseAbbreviation(abbr, options) {\n try {\n const tokens = typeof abbr === \"string\" ? tokenize$1(abbr) : abbr;\n return convert(abbreviation(tokens, options), options);\n } catch (err) {\n if (err instanceof ScannerError$1 && typeof abbr === \"string\") {\n err.message += `\n${abbr}\n${\"-\".repeat(err.pos)}^`;\n }\n throw err;\n }\n }\n function tokenize(abbr, isValue2) {\n let brackets = 0;\n let token2;\n const scanner = new Scanner$1(abbr);\n const tokens = [];\n while (!scanner.eof()) {\n token2 = getToken(scanner, brackets === 0 && !isValue2);\n if (!token2) {\n throw scanner.error(\"Unexpected character\");\n }\n if (token2.type === \"Bracket\") {\n if (!brackets && token2.open) {\n mergeTokens(scanner, tokens);\n }\n brackets += token2.open ? 1 : -1;\n if (brackets < 0) {\n throw scanner.error(\"Unexpected bracket\", token2.start);\n }\n }\n tokens.push(token2);\n if (shouldConsumeDashAfter(token2) && (token2 = operator(scanner))) {\n tokens.push(token2);\n }\n }\n return tokens;\n }\n function getToken(scanner, short) {\n return field$2(scanner) || numberValue(scanner) || colorValue(scanner) || stringValue(scanner) || bracket(scanner) || operator(scanner) || whiteSpace(scanner) || literal$1(scanner, short);\n }\n function field$2(scanner) {\n const start = scanner.pos;\n if (scanner.eat(36) && scanner.eat(123)) {\n scanner.start = scanner.pos;\n let index;\n let name = \"\";\n if (scanner.eatWhile(isNumber$3)) {\n index = Number(scanner.current());\n name = scanner.eat(58) ? consumePlaceholder$1(scanner) : \"\";\n } else if (isAlpha$1(scanner.peek())) {\n name = consumePlaceholder$1(scanner);\n }\n if (scanner.eat(125)) {\n return {\n type: \"Field\",\n index,\n name,\n start,\n end: scanner.pos\n };\n }\n throw scanner.error(\"Expecting }\");\n }\n scanner.pos = start;\n }\n function consumePlaceholder$1(stream) {\n const stack = [];\n stream.start = stream.pos;\n while (!stream.eof()) {\n if (stream.eat(123)) {\n stack.push(stream.pos);\n } else if (stream.eat(125)) {\n if (!stack.length) {\n stream.pos--;\n break;\n }\n stack.pop();\n } else {\n stream.pos++;\n }\n }\n if (stack.length) {\n stream.pos = stack.pop();\n throw stream.error(`Expecting }`);\n }\n return stream.current();\n }\n function literal$1(scanner, short) {\n const start = scanner.pos;\n if (scanner.eat(isIdentPrefix)) {\n scanner.eatWhile(start ? isKeyword : isLiteral);\n } else if (scanner.eat(isAlphaWord)) {\n scanner.eatWhile(short ? isLiteral : isKeyword);\n } else {\n scanner.eat(46);\n scanner.eatWhile(isLiteral);\n }\n if (start !== scanner.pos) {\n scanner.start = start;\n return createLiteral(scanner, scanner.start = start);\n }\n }\n function createLiteral(scanner, start = scanner.start, end = scanner.pos) {\n return {\n type: \"Literal\",\n value: scanner.substring(start, end),\n start,\n end\n };\n }\n function numberValue(scanner) {\n const start = scanner.pos;\n if (consumeNumber$1(scanner)) {\n scanner.start = start;\n const rawValue = scanner.current();\n scanner.start = scanner.pos;\n scanner.eat(37) || scanner.eatWhile(isAlphaWord);\n return {\n type: \"NumberValue\",\n value: Number(rawValue),\n rawValue,\n unit: scanner.current(),\n start,\n end: scanner.pos\n };\n }\n }\n function stringValue(scanner) {\n const ch = scanner.peek();\n const start = scanner.pos;\n let finished = false;\n if (isQuote$3(ch)) {\n scanner.pos++;\n while (!scanner.eof()) {\n if (scanner.eat(ch)) {\n finished = true;\n break;\n } else {\n scanner.pos++;\n }\n }\n scanner.start = start;\n return {\n type: \"StringValue\",\n value: scanner.substring(start + 1, scanner.pos - (finished ? 1 : 0)),\n quote: ch === 39 ? \"single\" : \"double\",\n start,\n end: scanner.pos\n };\n }\n }\n function colorValue(scanner) {\n const start = scanner.pos;\n if (scanner.eat(35)) {\n const valueStart = scanner.pos;\n let color2 = \"\";\n let alpha = \"\";\n if (scanner.eatWhile(isHex)) {\n color2 = scanner.substring(valueStart, scanner.pos);\n alpha = colorAlpha(scanner);\n } else if (scanner.eat(116)) {\n color2 = \"0\";\n alpha = colorAlpha(scanner) || \"0\";\n } else {\n alpha = colorAlpha(scanner);\n }\n if (color2 || alpha || scanner.eof()) {\n const { r, g, b, a } = parseColor(color2, alpha);\n return {\n type: \"ColorValue\",\n r,\n g,\n b,\n a,\n raw: scanner.substring(start + 1, scanner.pos),\n start,\n end: scanner.pos\n };\n } else {\n return createLiteral(scanner, start);\n }\n }\n scanner.pos = start;\n }\n function colorAlpha(scanner) {\n const start = scanner.pos;\n if (scanner.eat(46)) {\n scanner.start = start;\n if (scanner.eatWhile(isNumber$3)) {\n return scanner.current();\n }\n return \"1\";\n }\n return \"\";\n }\n function whiteSpace(scanner) {\n const start = scanner.pos;\n if (scanner.eatWhile(isSpace$2)) {\n return {\n type: \"WhiteSpace\",\n start,\n end: scanner.pos\n };\n }\n }\n function bracket(scanner) {\n const ch = scanner.peek();\n if (isBracket(ch)) {\n return {\n type: \"Bracket\",\n open: ch === 40,\n start: scanner.pos++,\n end: scanner.pos\n };\n }\n }\n function operator(scanner) {\n const op = operatorType(scanner.peek());\n if (op) {\n return {\n type: \"Operator\",\n operator: op,\n start: scanner.pos++,\n end: scanner.pos\n };\n }\n }\n function consumeNumber$1(stream) {\n const start = stream.pos;\n stream.eat(45);\n const afterNegative = stream.pos;\n const hasDecimal = stream.eatWhile(isNumber$3);\n const prevPos = stream.pos;\n if (stream.eat(46)) {\n const hasFloat = stream.eatWhile(isNumber$3);\n if (!hasDecimal && !hasFloat) {\n stream.pos = prevPos;\n }\n }\n if (stream.pos === afterNegative) {\n stream.pos = start;\n }\n return stream.pos !== start;\n }\n function isIdentPrefix(code2) {\n return code2 === 64 || code2 === 36;\n }\n function operatorType(ch) {\n return ch === 43 && \"+\" || ch === 33 && \"!\" || ch === 44 && \",\" || ch === 58 && \":\" || ch === 45 && \"-\" || void 0;\n }\n function isHex(code2) {\n return isNumber$3(code2) || isAlpha$1(code2, 65, 70);\n }\n function isKeyword(code2) {\n return isAlphaNumericWord(code2) || code2 === 45;\n }\n function isBracket(code2) {\n return code2 === 40 || code2 === 41;\n }\n function isLiteral(code2) {\n return isAlphaWord(code2) || code2 === 37 || code2 === 47;\n }\n function parseColor(value, alpha) {\n let r = \"0\";\n let g = \"0\";\n let b = \"0\";\n let a = Number(alpha != null && alpha !== \"\" ? alpha : 1);\n if (value === \"t\") {\n a = 0;\n } else {\n switch (value.length) {\n case 0:\n break;\n case 1:\n r = g = b = value + value;\n break;\n case 2:\n r = g = b = value;\n break;\n case 3:\n r = value[0] + value[0];\n g = value[1] + value[1];\n b = value[2] + value[2];\n break;\n default:\n value += value;\n r = value.slice(0, 2);\n g = value.slice(2, 4);\n b = value.slice(4, 6);\n }\n }\n return {\n r: parseInt(r, 16),\n g: parseInt(g, 16),\n b: parseInt(b, 16),\n a\n };\n }\n function shouldConsumeDashAfter(token2) {\n return token2.type === \"ColorValue\" || token2.type === \"NumberValue\" && !token2.unit;\n }\n function mergeTokens(scanner, tokens) {\n let start = 0;\n let end = 0;\n while (tokens.length) {\n const token2 = last$1(tokens);\n if (token2.type === \"Literal\" || token2.type === \"NumberValue\") {\n start = token2.start;\n if (!end) {\n end = token2.end;\n }\n tokens.pop();\n } else {\n break;\n }\n }\n if (start !== end) {\n tokens.push(createLiteral(scanner, start, end));\n }\n }\n function last$1(arr) {\n return arr[arr.length - 1];\n }\n function tokenScanner(tokens) {\n return {\n tokens,\n start: 0,\n pos: 0,\n size: tokens.length\n };\n }\n function peek$2(scanner) {\n return scanner.tokens[scanner.pos];\n }\n function readable(scanner) {\n return scanner.pos < scanner.size;\n }\n function consume$1(scanner, test) {\n if (test(peek$2(scanner))) {\n scanner.pos++;\n return true;\n }\n return false;\n }\n function error$1(scanner, message, token2 = peek$2(scanner)) {\n if (token2 && token2.start != null) {\n message += ` at ${token2.start}`;\n }\n const err = new Error(message);\n err[\"pos\"] = token2 && token2.start;\n return err;\n }\n function parser(tokens, options = {}) {\n const scanner = tokenScanner(tokens);\n const result = [];\n let property2;\n while (readable(scanner)) {\n if (property2 = consumeProperty(scanner, options)) {\n result.push(property2);\n } else if (!consume$1(scanner, isSiblingOperator)) {\n throw error$1(scanner, \"Unexpected token\");\n }\n }\n return result;\n }\n function consumeProperty(scanner, options) {\n let name;\n let important = false;\n let valueFragment;\n const value = [];\n const token2 = peek$2(scanner);\n const valueMode = !!options.value;\n if (!valueMode && isLiteral$1(token2) && !isFunctionStart(scanner)) {\n scanner.pos++;\n name = token2.value;\n consume$1(scanner, isValueDelimiter);\n }\n if (valueMode) {\n consume$1(scanner, isWhiteSpace$2);\n }\n while (readable(scanner)) {\n if (consume$1(scanner, isImportant)) {\n important = true;\n } else if (valueFragment = consumeValue(scanner, valueMode)) {\n value.push(valueFragment);\n } else if (!consume$1(scanner, isFragmentDelimiter)) {\n break;\n }\n }\n if (name || value.length || important) {\n return { name, value, important };\n }\n }\n function consumeValue(scanner, inArgument) {\n const result = [];\n let token2;\n let args;\n while (readable(scanner)) {\n token2 = peek$2(scanner);\n if (isValue(token2)) {\n scanner.pos++;\n if (isLiteral$1(token2) && (args = consumeArguments(scanner))) {\n result.push({\n type: \"FunctionCall\",\n name: token2.value,\n arguments: args\n });\n } else {\n result.push(token2);\n }\n } else if (isValueDelimiter(token2) || inArgument && isWhiteSpace$2(token2)) {\n scanner.pos++;\n } else {\n break;\n }\n }\n return result.length ? { type: \"CSSValue\", value: result } : void 0;\n }\n function consumeArguments(scanner) {\n const start = scanner.pos;\n if (consume$1(scanner, isOpenBracket$1)) {\n const args = [];\n let value;\n while (readable(scanner) && !consume$1(scanner, isCloseBracket$1)) {\n if (value = consumeValue(scanner, true)) {\n args.push(value);\n } else if (!consume$1(scanner, isWhiteSpace$2) && !consume$1(scanner, isArgumentDelimiter)) {\n throw error$1(scanner, \"Unexpected token\");\n }\n }\n scanner.start = start;\n return args;\n }\n }\n function isLiteral$1(token2) {\n return token2 && token2.type === \"Literal\";\n }\n function isBracket$1(token2, open) {\n return token2 && token2.type === \"Bracket\" && (open == null || token2.open === open);\n }\n function isOpenBracket$1(token2) {\n return isBracket$1(token2, true);\n }\n function isCloseBracket$1(token2) {\n return isBracket$1(token2, false);\n }\n function isWhiteSpace$2(token2) {\n return token2 && token2.type === \"WhiteSpace\";\n }\n function isOperator$1(token2, operator2) {\n return token2 && token2.type === \"Operator\" && (!operator2 || token2.operator === operator2);\n }\n function isSiblingOperator(token2) {\n return isOperator$1(token2, \"+\");\n }\n function isArgumentDelimiter(token2) {\n return isOperator$1(token2, \",\");\n }\n function isFragmentDelimiter(token2) {\n return isArgumentDelimiter(token2);\n }\n function isImportant(token2) {\n return isOperator$1(token2, \"!\");\n }\n function isValue(token2) {\n return token2.type === \"StringValue\" || token2.type === \"ColorValue\" || token2.type === \"NumberValue\" || token2.type === \"Literal\" || token2.type === \"Field\";\n }\n function isValueDelimiter(token2) {\n return isOperator$1(token2, \":\") || isOperator$1(token2, \"-\");\n }\n function isFunctionStart(scanner) {\n const t1 = scanner.tokens[scanner.pos];\n const t2 = scanner.tokens[scanner.pos + 1];\n return t1 && t2 && isLiteral$1(t1) && t2.type === \"Bracket\";\n }\n function parse$2(abbr, options) {\n try {\n const tokens = typeof abbr === \"string\" ? tokenize(abbr, options && options.value) : abbr;\n return parser(tokens, options);\n } catch (err) {\n if (err instanceof ScannerError$1 && typeof abbr === \"string\") {\n err.message += `\n${abbr}\n${\"-\".repeat(err.pos)}^`;\n }\n throw err;\n }\n }\n function mergeAttributes(node, config2) {\n if (!node.attributes) {\n return;\n }\n const attributes = [];\n const lookup = {};\n for (const attr of node.attributes) {\n if (attr.name) {\n const attrName2 = attr.name;\n if (attrName2 in lookup) {\n const prev2 = lookup[attrName2];\n if (attrName2 === \"class\") {\n prev2.value = mergeValue(prev2.value, attr.value, \" \");\n } else {\n mergeDeclarations(prev2, attr, config2);\n }\n } else {\n attributes.push(lookup[attrName2] = Object.assign({}, attr));\n }\n } else {\n attributes.push(attr);\n }\n }\n node.attributes = attributes;\n }\n function mergeValue(prev2, next2, glue) {\n if (prev2 && next2) {\n if (prev2.length && glue) {\n append(prev2, glue);\n }\n for (const t of next2) {\n append(prev2, t);\n }\n return prev2;\n }\n const result = prev2 || next2;\n return result && result.slice();\n }\n function mergeDeclarations(dest, src, config2) {\n dest.name = src.name;\n if (!config2.options[\"output.reverseAttributes\"]) {\n dest.value = src.value;\n }\n if (!dest.implied) {\n dest.implied = src.implied;\n }\n if (!dest.boolean) {\n dest.boolean = src.boolean;\n }\n if (dest.valueType !== \"expression\") {\n dest.valueType = src.valueType;\n }\n return dest;\n }\n function append(tokens, value) {\n const lastIx = tokens.length - 1;\n if (typeof tokens[lastIx] === \"string\" && typeof value === \"string\") {\n tokens[lastIx] += value;\n } else {\n tokens.push(value);\n }\n }\n function walk(node, fn, state) {\n const ancestors = [node];\n const callback = (ctx) => {\n fn(ctx, ancestors, state);\n ancestors.push(ctx);\n ctx.children.forEach(callback);\n ancestors.pop();\n };\n node.children.forEach(callback);\n }\n function findDeepest(node) {\n let parent;\n while (node.children.length) {\n parent = node;\n node = node.children[node.children.length - 1];\n }\n return { parent, node };\n }\n function isNode(node) {\n return node.type === \"AbbreviationNode\";\n }\n function resolveSnippets(abbr, config2) {\n const stack = [];\n const reversed = config2.options[\"output.reverseAttributes\"];\n const resolve = (child) => {\n const snippet2 = child.name && config2.snippets[child.name];\n if (!snippet2 || stack.includes(snippet2)) {\n return null;\n }\n const snippetAbbr = parseAbbreviation(snippet2, config2);\n stack.push(snippet2);\n walkResolve(snippetAbbr, resolve);\n stack.pop();\n for (const topNode of snippetAbbr.children) {\n if (child.attributes) {\n const from = topNode.attributes || [];\n const to = child.attributes || [];\n topNode.attributes = reversed ? to.concat(from) : from.concat(to);\n }\n mergeNodes(child, topNode);\n }\n return snippetAbbr;\n };\n walkResolve(abbr, resolve);\n return abbr;\n }\n function walkResolve(node, resolve, config2) {\n let children = [];\n for (const child of node.children) {\n const resolved = resolve(child);\n if (resolved) {\n children = children.concat(resolved.children);\n const deepest = findDeepest(resolved);\n if (isNode(deepest.node)) {\n deepest.node.children = deepest.node.children.concat(walkResolve(child, resolve));\n }\n } else {\n children.push(child);\n child.children = walkResolve(child, resolve);\n }\n }\n return node.children = children;\n }\n function mergeNodes(from, to) {\n if (from.selfClosing) {\n to.selfClosing = true;\n }\n if (from.value != null) {\n to.value = from.value;\n }\n if (from.repeat) {\n to.repeat = from.repeat;\n }\n }\n function createOutputStream(options, level = 0) {\n return {\n options,\n value: \"\",\n level,\n offset: 0,\n line: 0,\n column: 0\n };\n }\n function push(stream, text2) {\n const processText = stream.options[\"output.text\"];\n _push(stream, processText(text2, stream.offset, stream.line, stream.column));\n }\n function pushString(stream, value) {\n const lines = splitByLines(value);\n for (let i = 0, il = lines.length - 1; i <= il; i++) {\n push(stream, lines[i]);\n if (i !== il) {\n pushNewline(stream, true);\n }\n }\n }\n function pushNewline(stream, indent) {\n const baseIndent = stream.options[\"output.baseIndent\"];\n const newline = stream.options[\"output.newline\"];\n push(stream, newline + baseIndent);\n stream.line++;\n stream.column = baseIndent.length;\n if (indent) {\n pushIndent(stream, indent === true ? stream.level : indent);\n }\n }\n function pushIndent(stream, size = stream.level) {\n const indent = stream.options[\"output.indent\"];\n push(stream, indent.repeat(Math.max(size, 0)));\n }\n function pushField(stream, index, placeholder) {\n const field2 = stream.options[\"output.field\"];\n _push(stream, field2(index, placeholder, stream.offset, stream.line, stream.column));\n }\n function tagName(name, config2) {\n return strCase(name, config2.options[\"output.tagCase\"]);\n }\n function attrName(name, config2) {\n return strCase(name, config2.options[\"output.attributeCase\"]);\n }\n function attrQuote(attr, config2, isOpen) {\n if (attr.valueType === \"expression\") {\n return isOpen ? \"{\" : \"}\";\n }\n return config2.options[\"output.attributeQuotes\"] === \"single\" ? \"'\" : '\"';\n }\n function isBooleanAttribute(attr, config2) {\n return attr.boolean || config2.options[\"output.booleanAttributes\"].includes((attr.name || \"\").toLowerCase());\n }\n function selfClose(config2) {\n switch (config2.options[\"output.selfClosingStyle\"]) {\n case \"xhtml\":\n return \" /\";\n case \"xml\":\n return \"/\";\n default:\n return \"\";\n }\n }\n function isInline(node, config2) {\n if (typeof node === \"string\") {\n return config2.options.inlineElements.includes(node.toLowerCase());\n }\n return node.name ? isInline(node.name, config2) : Boolean(node.value && !node.attributes);\n }\n function splitByLines(text2) {\n return text2.split(/\\r\\n|\\r|\\n/g);\n }\n function _push(stream, text2) {\n stream.value += text2;\n stream.offset += text2.length;\n stream.column += text2.length;\n }\n function strCase(str, type) {\n if (type) {\n return type === \"upper\" ? str.toUpperCase() : str.toLowerCase();\n }\n return str;\n }\n const elementMap = {\n p: \"span\",\n ul: \"li\",\n ol: \"li\",\n table: \"tr\",\n tr: \"td\",\n tbody: \"tr\",\n thead: \"tr\",\n tfoot: \"tr\",\n colgroup: \"col\",\n select: \"option\",\n optgroup: \"option\",\n audio: \"source\",\n video: \"source\",\n object: \"param\",\n map: \"area\"\n };\n function implicitTag(node, ancestors, config2) {\n if (!node.name && node.attributes) {\n resolveImplicitTag(node, ancestors, config2);\n }\n }\n function resolveImplicitTag(node, ancestors, config2) {\n const parent = getParentElement(ancestors);\n const contextName = config2.context ? config2.context.name : \"\";\n const parentName = lowercase(parent ? parent.name : contextName);\n node.name = elementMap[parentName] || (isInline(parentName, config2) ? \"span\" : \"div\");\n }\n function lowercase(str) {\n return (str || \"\").toLowerCase();\n }\n function getParentElement(ancestors) {\n for (let i = ancestors.length - 1; i >= 0; i--) {\n const elem = ancestors[i];\n if (isNode(elem)) {\n return elem;\n }\n }\n }\n var latin = {\n \"common\": [\"lorem\", \"ipsum\", \"dolor\", \"sit\", \"amet\", \"consectetur\", \"adipisicing\", \"elit\"],\n \"words\": [\n \"exercitationem\",\n \"perferendis\",\n \"perspiciatis\",\n \"laborum\",\n \"eveniet\",\n \"sunt\",\n \"iure\",\n \"nam\",\n \"nobis\",\n \"eum\",\n \"cum\",\n \"officiis\",\n \"excepturi\",\n \"odio\",\n \"consectetur\",\n \"quasi\",\n \"aut\",\n \"quisquam\",\n \"vel\",\n \"eligendi\",\n \"itaque\",\n \"non\",\n \"odit\",\n \"tempore\",\n \"quaerat\",\n \"dignissimos\",\n \"facilis\",\n \"neque\",\n \"nihil\",\n \"expedita\",\n \"vitae\",\n \"vero\",\n \"ipsum\",\n \"nisi\",\n \"animi\",\n \"cumque\",\n \"pariatur\",\n \"velit\",\n \"modi\",\n \"natus\",\n \"iusto\",\n \"eaque\",\n \"sequi\",\n \"illo\",\n \"sed\",\n \"ex\",\n \"et\",\n \"voluptatibus\",\n \"tempora\",\n \"veritatis\",\n \"ratione\",\n \"assumenda\",\n \"incidunt\",\n \"nostrum\",\n \"placeat\",\n \"aliquid\",\n \"fuga\",\n \"provident\",\n \"praesentium\",\n \"rem\",\n \"necessitatibus\",\n \"suscipit\",\n \"adipisci\",\n \"quidem\",\n \"possimus\",\n \"voluptas\",\n \"debitis\",\n \"sint\",\n \"accusantium\",\n \"unde\",\n \"sapiente\",\n \"voluptate\",\n \"qui\",\n \"aspernatur\",\n \"laudantium\",\n \"soluta\",\n \"amet\",\n \"quo\",\n \"aliquam\",\n \"saepe\",\n \"culpa\",\n \"libero\",\n \"ipsa\",\n \"dicta\",\n \"reiciendis\",\n \"nesciunt\",\n \"doloribus\",\n \"autem\",\n \"impedit\",\n \"minima\",\n \"maiores\",\n \"repudiandae\",\n \"ipsam\",\n \"obcaecati\",\n \"ullam\",\n \"enim\",\n \"totam\",\n \"delectus\",\n \"ducimus\",\n \"quis\",\n \"voluptates\",\n \"dolores\",\n \"molestiae\",\n \"harum\",\n \"dolorem\",\n \"quia\",\n \"voluptatem\",\n \"molestias\",\n \"magni\",\n \"distinctio\",\n \"omnis\",\n \"illum\",\n \"dolorum\",\n \"voluptatum\",\n \"ea\",\n \"quas\",\n \"quam\",\n \"corporis\",\n \"quae\",\n \"blanditiis\",\n \"atque\",\n \"deserunt\",\n \"laboriosam\",\n \"earum\",\n \"consequuntur\",\n \"hic\",\n \"cupiditate\",\n \"quibusdam\",\n \"accusamus\",\n \"ut\",\n \"rerum\",\n \"error\",\n \"minus\",\n \"eius\",\n \"ab\",\n \"ad\",\n \"nemo\",\n \"fugit\",\n \"officia\",\n \"at\",\n \"in\",\n \"id\",\n \"quos\",\n \"reprehenderit\",\n \"numquam\",\n \"iste\",\n \"fugiat\",\n \"sit\",\n \"inventore\",\n \"beatae\",\n \"repellendus\",\n \"magnam\",\n \"recusandae\",\n \"quod\",\n \"explicabo\",\n \"doloremque\",\n \"aperiam\",\n \"consequatur\",\n \"asperiores\",\n \"commodi\",\n \"optio\",\n \"dolor\",\n \"labore\",\n \"temporibus\",\n \"repellat\",\n \"veniam\",\n \"architecto\",\n \"est\",\n \"esse\",\n \"mollitia\",\n \"nulla\",\n \"a\",\n \"similique\",\n \"eos\",\n \"alias\",\n \"dolore\",\n \"tenetur\",\n \"deleniti\",\n \"porro\",\n \"facere\",\n \"maxime\",\n \"corrupti\"\n ]\n };\n var ru = {\n \"common\": [\"\\u0434\\u0430\\u043B\\u0435\\u043A\\u043E-\\u0434\\u0430\\u043B\\u0435\\u043A\\u043E\", \"\\u0437\\u0430\", \"\\u0441\\u043B\\u043E\\u0432\\u0435\\u0441\\u043D\\u044B\\u043C\\u0438\", \"\\u0433\\u043E\\u0440\\u0430\\u043C\\u0438\", \"\\u0432 \\u0441\\u0442\\u0440\\u0430\\u043D\\u0435\", \"\\u0433\\u043B\\u0430\\u0441\\u043D\\u044B\\u0445\", \"\\u0438 \\u0441\\u043E\\u0433\\u043B\\u0430\\u0441\\u043D\\u044B\\u0445\", \"\\u0436\\u0438\\u0432\\u0443\\u0442\", \"\\u0440\\u044B\\u0431\\u043D\\u044B\\u0435\", \"\\u0442\\u0435\\u043A\\u0441\\u0442\\u044B\"],\n \"words\": [\n \"\\u0432\\u0434\\u0430\\u043B\\u0438\",\n \"\\u043E\\u0442 \\u0432\\u0441\\u0435\\u0445\",\n \"\\u043E\\u043D\\u0438\",\n \"\\u0431\\u0443\\u043A\\u0432\\u0435\\u043D\\u043D\\u044B\\u0445\",\n \"\\u0434\\u043E\\u043C\\u0430\\u0445\",\n \"\\u043D\\u0430 \\u0431\\u0435\\u0440\\u0435\\u0433\\u0443\",\n \"\\u0441\\u0435\\u043C\\u0430\\u043D\\u0442\\u0438\\u043A\\u0430\",\n \"\\u0431\\u043E\\u043B\\u044C\\u0448\\u043E\\u0433\\u043E\",\n \"\\u044F\\u0437\\u044B\\u043A\\u043E\\u0432\\u043E\\u0433\\u043E\",\n \"\\u043E\\u043A\\u0435\\u0430\\u043D\\u0430\",\n \"\\u043C\\u0430\\u043B\\u0435\\u043D\\u044C\\u043A\\u0438\\u0439\",\n \"\\u0440\\u0443\\u0447\\u0435\\u0435\\u043A\",\n \"\\u0434\\u0430\\u043B\\u044C\",\n \"\\u0436\\u0443\\u0440\\u0447\\u0438\\u0442\",\n \"\\u043F\\u043E \\u0432\\u0441\\u0435\\u0439\",\n \"\\u043E\\u0431\\u0435\\u0441\\u043F\\u0435\\u0447\\u0438\\u0432\\u0430\\u0435\\u0442\",\n \"\\u0435\\u0435\",\n \"\\u0432\\u0441\\u0435\\u043C\\u0438\",\n \"\\u043D\\u0435\\u043E\\u0431\\u0445\\u043E\\u0434\\u0438\\u043C\\u044B\\u043C\\u0438\",\n \"\\u043F\\u0440\\u0430\\u0432\\u0438\\u043B\\u0430\\u043C\\u0438\",\n \"\\u044D\\u0442\\u0430\",\n \"\\u043F\\u0430\\u0440\\u0430\\u0434\\u0438\\u0433\\u043C\\u0430\\u0442\\u0438\\u0447\\u0435\\u0441\\u043A\\u0430\\u044F\",\n \"\\u0441\\u0442\\u0440\\u0430\\u043D\\u0430\",\n \"\\u043A\\u043E\\u0442\\u043E\\u0440\\u043E\\u0439\",\n \"\\u0436\\u0430\\u0440\\u0435\\u043D\\u043D\\u044B\\u0435\",\n \"\\u043F\\u0440\\u0435\\u0434\\u043B\\u043E\\u0436\\u0435\\u043D\\u0438\\u044F\",\n \"\\u0437\\u0430\\u043B\\u0435\\u0442\\u0430\\u044E\\u0442\",\n \"\\u043F\\u0440\\u044F\\u043C\\u043E\",\n \"\\u0440\\u043E\\u0442\",\n \"\\u0434\\u0430\\u0436\\u0435\",\n \"\\u0432\\u0441\\u0435\\u043C\\u043E\\u0433\\u0443\\u0449\\u0430\\u044F\",\n \"\\u043F\\u0443\\u043D\\u043A\\u0442\\u0443\\u0430\\u0446\\u0438\\u044F\",\n \"\\u043D\\u0435\",\n \"\\u0438\\u043C\\u0435\\u0435\\u0442\",\n \"\\u0432\\u043B\\u0430\\u0441\\u0442\\u0438\",\n \"\\u043D\\u0430\\u0434\",\n \"\\u0440\\u044B\\u0431\\u043D\\u044B\\u043C\\u0438\",\n \"\\u0442\\u0435\\u043A\\u0441\\u0442\\u0430\\u043C\\u0438\",\n \"\\u0432\\u0435\\u0434\\u0443\\u0449\\u0438\\u043C\\u0438\",\n \"\\u0431\\u0435\\u0437\\u043E\\u0440\\u0444\\u043E\\u0433\\u0440\\u0430\\u0444\\u0438\\u0447\\u043D\\u044B\\u0439\",\n \"\\u043E\\u0431\\u0440\\u0430\\u0437\",\n \"\\u0436\\u0438\\u0437\\u043D\\u0438\",\n \"\\u043E\\u0434\\u043D\\u0430\\u0436\\u0434\\u044B\",\n \"\\u043E\\u0434\\u043D\\u0430\",\n \"\\u043C\\u0430\\u043B\\u0435\\u043D\\u044C\\u043A\\u0430\\u044F\",\n \"\\u0441\\u0442\\u0440\\u043E\\u0447\\u043A\\u0430\",\n \"\\u0440\\u044B\\u0431\\u043D\\u043E\\u0433\\u043E\",\n \"\\u0442\\u0435\\u043A\\u0441\\u0442\\u0430\",\n \"\\u0438\\u043C\\u0435\\u043D\\u0438\",\n \"lorem\",\n \"ipsum\",\n \"\\u0440\\u0435\\u0448\\u0438\\u043B\\u0430\",\n \"\\u0432\\u044B\\u0439\\u0442\\u0438\",\n \"\\u0431\\u043E\\u043B\\u044C\\u0448\\u043E\\u0439\",\n \"\\u043C\\u0438\\u0440\",\n \"\\u0433\\u0440\\u0430\\u043C\\u043C\\u0430\\u0442\\u0438\\u043A\\u0438\",\n \"\\u0432\\u0435\\u043B\\u0438\\u043A\\u0438\\u0439\",\n \"\\u043E\\u043A\\u0441\\u043C\\u043E\\u043A\\u0441\",\n \"\\u043F\\u0440\\u0435\\u0434\\u0443\\u043F\\u0440\\u0435\\u0436\\u0434\\u0430\\u043B\",\n \"\\u043E\",\n \"\\u0437\\u043B\\u044B\\u0445\",\n \"\\u0437\\u0430\\u043F\\u044F\\u0442\\u044B\\u0445\",\n \"\\u0434\\u0438\\u043A\\u0438\\u0445\",\n \"\\u0437\\u043D\\u0430\\u043A\\u0430\\u0445\",\n \"\\u0432\\u043E\\u043F\\u0440\\u043E\\u0441\\u0430\",\n \"\\u043A\\u043E\\u0432\\u0430\\u0440\\u043D\\u044B\\u0445\",\n \"\\u0442\\u043E\\u0447\\u043A\\u0430\\u0445\",\n \"\\u0437\\u0430\\u043F\\u044F\\u0442\\u043E\\u0439\",\n \"\\u043D\\u043E\",\n \"\\u0442\\u0435\\u043A\\u0441\\u0442\",\n \"\\u0434\\u0430\\u043B\",\n \"\\u0441\\u0431\\u0438\\u0442\\u044C\",\n \"\\u0441\\u0435\\u0431\\u044F\",\n \"\\u0442\\u043E\\u043B\\u043A\\u0443\",\n \"\\u043E\\u043D\",\n \"\\u0441\\u043E\\u0431\\u0440\\u0430\\u043B\",\n \"\\u0441\\u0435\\u043C\\u044C\",\n \"\\u0441\\u0432\\u043E\\u0438\\u0445\",\n \"\\u0437\\u0430\\u0433\\u043B\\u0430\\u0432\\u043D\\u044B\\u0445\",\n \"\\u0431\\u0443\\u043A\\u0432\",\n \"\\u043F\\u043E\\u0434\\u043F\\u043E\\u044F\\u0441\\u0430\\u043B\",\n \"\\u0438\\u043D\\u0438\\u0446\\u0438\\u0430\\u043B\",\n \"\\u0437\\u0430\",\n \"\\u043F\\u043E\\u044F\\u0441\",\n \"\\u043F\\u0443\\u0441\\u0442\\u0438\\u043B\\u0441\\u044F\",\n \"\\u0434\\u043E\\u0440\\u043E\\u0433\\u0443\",\n \"\\u0432\\u0437\\u043E\\u0431\\u0440\\u0430\\u0432\\u0448\\u0438\\u0441\\u044C\",\n \"\\u043F\\u0435\\u0440\\u0432\\u0443\\u044E\",\n \"\\u0432\\u0435\\u0440\\u0448\\u0438\\u043D\\u0443\",\n \"\\u043A\\u0443\\u0440\\u0441\\u0438\\u0432\\u043D\\u044B\\u0445\",\n \"\\u0433\\u043E\\u0440\",\n \"\\u0431\\u0440\\u043E\\u0441\\u0438\\u043B\",\n \"\\u043F\\u043E\\u0441\\u043B\\u0435\\u0434\\u043D\\u0438\\u0439\",\n \"\\u0432\\u0437\\u0433\\u043B\\u044F\\u0434\",\n \"\\u043D\\u0430\\u0437\\u0430\\u0434\",\n \"\\u0441\\u0438\\u043B\\u0443\\u044D\\u0442\",\n \"\\u0441\\u0432\\u043E\\u0435\\u0433\\u043E\",\n \"\\u0440\\u043E\\u0434\\u043D\\u043E\\u0433\\u043E\",\n \"\\u0433\\u043E\\u0440\\u043E\\u0434\\u0430\",\n \"\\u0431\\u0443\\u043A\\u0432\\u043E\\u0433\\u0440\\u0430\\u0434\",\n \"\\u0437\\u0430\\u0433\\u043E\\u043B\\u043E\\u0432\\u043E\\u043A\",\n \"\\u0434\\u0435\\u0440\\u0435\\u0432\\u043D\\u0438\",\n \"\\u0430\\u043B\\u0444\\u0430\\u0432\\u0438\\u0442\",\n \"\\u043F\\u043E\\u0434\\u0437\\u0430\\u0433\\u043E\\u043B\\u043E\\u0432\\u043E\\u043A\",\n \"\\u0441\\u0432\\u043E\\u0435\\u0433\\u043E\",\n \"\\u043F\\u0435\\u0440\\u0435\\u0443\\u043B\\u043A\\u0430\",\n \"\\u0433\\u0440\\u0443\\u0441\\u0442\\u043D\\u044B\\u0439\",\n \"\\u0440\\u0435\\u0442\\u043E\\u0440\\u0438\\u0447\\u0435\\u0441\\u043A\\u0438\\u0439\",\n \"\\u0432\\u043E\\u043F\\u0440\\u043E\\u0441\",\n \"\\u0441\\u043A\\u0430\\u0442\\u0438\\u043B\\u0441\\u044F\",\n \"\\u0435\\u0433\\u043E\",\n \"\\u0449\\u0435\\u043A\\u0435\",\n \"\\u043F\\u0440\\u043E\\u0434\\u043E\\u043B\\u0436\\u0438\\u043B\",\n \"\\u0441\\u0432\\u043E\\u0439\",\n \"\\u043F\\u0443\\u0442\\u044C\",\n \"\\u0434\\u043E\\u0440\\u043E\\u0433\\u0435\",\n \"\\u0432\\u0441\\u0442\\u0440\\u0435\\u0442\\u0438\\u043B\",\n \"\\u0440\\u0443\\u043A\\u043E\\u043F\\u0438\\u0441\\u044C\",\n \"\\u043E\\u043D\\u0430\",\n \"\\u043F\\u0440\\u0435\\u0434\\u0443\\u043F\\u0440\\u0435\\u0434\\u0438\\u043B\\u0430\",\n \"\\u043C\\u043E\\u0435\\u0439\",\n \"\\u0432\\u0441\\u0435\",\n \"\\u043F\\u0435\\u0440\\u0435\\u043F\\u0438\\u0441\\u044B\\u0432\\u0430\\u0435\\u0442\\u0441\\u044F\",\n \"\\u043D\\u0435\\u0441\\u043A\\u043E\\u043B\\u044C\\u043A\\u043E\",\n \"\\u0440\\u0430\\u0437\",\n \"\\u0435\\u0434\\u0438\\u043D\\u0441\\u0442\\u0432\\u0435\\u043D\\u043D\\u043E\\u0435\",\n \"\\u0447\\u0442\\u043E\",\n \"\\u043C\\u0435\\u043D\\u044F\",\n \"\\u043E\\u0441\\u0442\\u0430\\u043B\\u043E\\u0441\\u044C\",\n \"\\u044D\\u0442\\u043E\",\n \"\\u043F\\u0440\\u0438\\u0441\\u0442\\u0430\\u0432\\u043A\\u0430\",\n \"\\u0432\\u043E\\u0437\\u0432\\u0440\\u0430\\u0449\\u0430\\u0439\\u0441\\u044F\",\n \"\\u0442\\u044B\",\n \"\\u043B\\u0443\\u0447\\u0448\\u0435\",\n \"\\u0441\\u0432\\u043E\\u044E\",\n \"\\u0431\\u0435\\u0437\\u043E\\u043F\\u0430\\u0441\\u043D\\u0443\\u044E\",\n \"\\u0441\\u0442\\u0440\\u0430\\u043D\\u0443\",\n \"\\u043F\\u043E\\u0441\\u043B\\u0443\\u0448\\u0430\\u0432\\u0448\\u0438\\u0441\\u044C\",\n \"\\u0440\\u0443\\u043A\\u043E\\u043F\\u0438\\u0441\\u0438\",\n \"\\u043D\\u0430\\u0448\",\n \"\\u043F\\u0440\\u043E\\u0434\\u043E\\u043B\\u0436\\u0438\\u043B\",\n \"\\u0441\\u0432\\u043E\\u0439\",\n \"\\u043F\\u0443\\u0442\\u044C\",\n \"\\u0432\\u0441\\u043A\\u043E\\u0440\\u0435\",\n \"\\u0435\\u043C\\u0443\",\n \"\\u043F\\u043E\\u0432\\u0441\\u0442\\u0440\\u0435\\u0447\\u0430\\u043B\\u0441\\u044F\",\n \"\\u043A\\u043E\\u0432\\u0430\\u0440\\u043D\\u044B\\u0439\",\n \"\\u0441\\u043E\\u0441\\u0442\\u0430\\u0432\\u0438\\u0442\\u0435\\u043B\\u044C\",\n \"\\u0440\\u0435\\u043A\\u043B\\u0430\\u043C\\u043D\\u044B\\u0445\",\n \"\\u0442\\u0435\\u043A\\u0441\\u0442\\u043E\\u0432\",\n \"\\u043D\\u0430\\u043F\\u043E\\u0438\\u0432\\u0448\\u0438\\u0439\",\n \"\\u044F\\u0437\\u044B\\u043A\\u043E\\u043C\",\n \"\\u0440\\u0435\\u0447\\u044C\\u044E\",\n \"\\u0437\\u0430\\u043C\\u0430\\u043D\\u0438\\u0432\\u0448\\u0438\\u0439\",\n \"\\u0441\\u0432\\u043E\\u0435\",\n \"\\u0430\\u0433\\u0435\\u043D\\u0442\\u0441\\u0442\\u0432\\u043E\",\n \"\\u043A\\u043E\\u0442\\u043E\\u0440\\u043E\\u0435\",\n \"\\u0438\\u0441\\u043F\\u043E\\u043B\\u044C\\u0437\\u043E\\u0432\\u0430\\u043B\\u043E\",\n \"\\u0441\\u043D\\u043E\\u0432\\u0430\",\n \"\\u0441\\u043D\\u043E\\u0432\\u0430\",\n \"\\u0441\\u0432\\u043E\\u0438\\u0445\",\n \"\\u043F\\u0440\\u043E\\u0435\\u043A\\u0442\\u0430\\u0445\",\n \"\\u0435\\u0441\\u043B\\u0438\",\n \"\\u043F\\u0435\\u0440\\u0435\\u043F\\u0438\\u0441\\u0430\\u043B\\u0438\",\n \"\\u0442\\u043E\",\n \"\\u0436\\u0438\\u0432\\u0435\\u0442\",\n \"\\u0442\\u0430\\u043C\",\n \"\\u0434\\u043E\",\n \"\\u0441\\u0438\\u0445\",\n \"\\u043F\\u043E\\u0440\"\n ]\n };\n var sp = {\n \"common\": [\"mujer\", \"uno\", \"dolor\", \"m\\xE1s\", \"de\", \"poder\", \"mismo\", \"si\"],\n \"words\": [\n \"ejercicio\",\n \"preferencia\",\n \"perspicacia\",\n \"laboral\",\n \"pa\\xF1o\",\n \"suntuoso\",\n \"molde\",\n \"namibia\",\n \"planeador\",\n \"mirar\",\n \"dem\\xE1s\",\n \"oficinista\",\n \"excepci\\xF3n\",\n \"odio\",\n \"consecuencia\",\n \"casi\",\n \"auto\",\n \"chicharra\",\n \"velo\",\n \"elixir\",\n \"ataque\",\n \"no\",\n \"odio\",\n \"temporal\",\n \"cu\\xF3rum\",\n \"dign\\xEDsimo\",\n \"facilismo\",\n \"letra\",\n \"nihilista\",\n \"expedici\\xF3n\",\n \"alma\",\n \"alveolar\",\n \"aparte\",\n \"le\\xF3n\",\n \"animal\",\n \"como\",\n \"paria\",\n \"belleza\",\n \"modo\",\n \"natividad\",\n \"justo\",\n \"ataque\",\n \"s\\xE9quito\",\n \"pillo\",\n \"sed\",\n \"ex\",\n \"y\",\n \"voluminoso\",\n \"temporalidad\",\n \"verdades\",\n \"racional\",\n \"asunci\\xF3n\",\n \"incidente\",\n \"marejada\",\n \"placenta\",\n \"amanecer\",\n \"fuga\",\n \"previsor\",\n \"presentaci\\xF3n\",\n \"lejos\",\n \"necesariamente\",\n \"sospechoso\",\n \"adiposidad\",\n \"quind\\xEDo\",\n \"p\\xF3cima\",\n \"voluble\",\n \"d\\xE9bito\",\n \"sinti\\xF3\",\n \"accesorio\",\n \"falda\",\n \"sapiencia\",\n \"volutas\",\n \"queso\",\n \"permacultura\",\n \"laudo\",\n \"soluciones\",\n \"entero\",\n \"pan\",\n \"litro\",\n \"tonelada\",\n \"culpa\",\n \"libertario\",\n \"mosca\",\n \"dictado\",\n \"reincidente\",\n \"nascimiento\",\n \"dolor\",\n \"escolar\",\n \"impedimento\",\n \"m\\xEDnima\",\n \"mayores\",\n \"repugnante\",\n \"dulce\",\n \"obcecado\",\n \"monta\\xF1a\",\n \"enigma\",\n \"total\",\n \"delet\\xE9reo\",\n \"d\\xE9cima\",\n \"c\\xE1bala\",\n \"fotograf\\xEDa\",\n \"dolores\",\n \"molesto\",\n \"olvido\",\n \"paciencia\",\n \"resiliencia\",\n \"voluntad\",\n \"molestias\",\n \"magn\\xEDfico\",\n \"distinci\\xF3n\",\n \"ovni\",\n \"marejada\",\n \"cerro\",\n \"torre\",\n \"y\",\n \"abogada\",\n \"manantial\",\n \"corporal\",\n \"agua\",\n \"crep\\xFAsculo\",\n \"ataque\",\n \"desierto\",\n \"laboriosamente\",\n \"angustia\",\n \"afortunado\",\n \"alma\",\n \"encefalograma\",\n \"materialidad\",\n \"cosas\",\n \"o\",\n \"renuncia\",\n \"error\",\n \"menos\",\n \"conejo\",\n \"abad\\xEDa\",\n \"analfabeto\",\n \"remo\",\n \"fugacidad\",\n \"oficio\",\n \"en\",\n \"alm\\xE1cigo\",\n \"vos\",\n \"pan\",\n \"represi\\xF3n\",\n \"n\\xFAmeros\",\n \"triste\",\n \"refugiado\",\n \"trote\",\n \"inventor\",\n \"corchea\",\n \"repelente\",\n \"magma\",\n \"recusado\",\n \"patr\\xF3n\",\n \"expl\\xEDcito\",\n \"paloma\",\n \"s\\xEDndrome\",\n \"inmune\",\n \"autoinmune\",\n \"comodidad\",\n \"ley\",\n \"vietnamita\",\n \"demonio\",\n \"tasmania\",\n \"repeler\",\n \"ap\\xE9ndice\",\n \"arquitecto\",\n \"columna\",\n \"yugo\",\n \"computador\",\n \"mula\",\n \"a\",\n \"prop\\xF3sito\",\n \"fantas\\xEDa\",\n \"alias\",\n \"rayo\",\n \"tenedor\",\n \"deleznable\",\n \"ventana\",\n \"cara\",\n \"anemia\",\n \"corrupto\"\n ]\n };\n const vocabularies = { ru, sp, latin };\n const reLorem = /^lorem([a-z]*)(\\d*)(-\\d*)?$/i;\n function lorem(node, ancestors, config2) {\n let m;\n if (node.name && (m = node.name.match(reLorem))) {\n const db = vocabularies[m[1]] || vocabularies.latin;\n const minWordCount = m[2] ? Math.max(1, Number(m[2])) : 30;\n const maxWordCount = m[3] ? Math.max(minWordCount, Number(m[3].slice(1))) : minWordCount;\n const wordCount = rand(minWordCount, maxWordCount);\n const repeat = node.repeat || findRepeater(ancestors);\n node.name = node.attributes = void 0;\n node.value = [paragraph(db, wordCount, !repeat || repeat.value === 0)];\n if (node.repeat && ancestors.length > 1) {\n resolveImplicitTag(node, ancestors, config2);\n }\n }\n }\n function rand(from, to) {\n return Math.floor(Math.random() * (to - from) + from);\n }\n function sample(arr, count) {\n const len = arr.length;\n const iterations = Math.min(len, count);\n const result = [];\n while (result.length < iterations) {\n const str = arr[rand(0, len)];\n if (!result.includes(str)) {\n result.push(str);\n }\n }\n return result;\n }\n function choice(val) {\n return val[rand(0, val.length - 1)];\n }\n function sentence(words, end) {\n if (words.length) {\n words = [capitalize(words[0])].concat(words.slice(1));\n }\n return words.join(\" \") + (end || choice(\"?!...\"));\n }\n function capitalize(word) {\n return word[0].toUpperCase() + word.slice(1);\n }\n function insertCommas(words) {\n if (words.length < 2) {\n return words;\n }\n words = words.slice();\n const len = words.length;\n const hasComma = /,$/;\n let totalCommas = 0;\n if (len > 3 && len <= 6) {\n totalCommas = rand(0, 1);\n } else if (len > 6 && len <= 12) {\n totalCommas = rand(0, 2);\n } else {\n totalCommas = rand(1, 4);\n }\n for (let i = 0, pos; i < totalCommas; i++) {\n pos = rand(0, len - 2);\n if (!hasComma.test(words[pos])) {\n words[pos] += \",\";\n }\n }\n return words;\n }\n function paragraph(dict, wordCount, startWithCommon) {\n const result = [];\n let totalWords = 0;\n let words;\n if (startWithCommon && dict.common) {\n words = dict.common.slice(0, wordCount);\n totalWords += words.length;\n result.push(sentence(insertCommas(words), \".\"));\n }\n while (totalWords < wordCount) {\n words = sample(dict.words, Math.min(rand(2, 30), wordCount - totalWords));\n totalWords += words.length;\n result.push(sentence(insertCommas(words)));\n }\n return result.join(\" \");\n }\n function findRepeater(ancestors) {\n for (let i = ancestors.length - 1; i >= 0; i--) {\n const element2 = ancestors[i];\n if (element2.type === \"AbbreviationNode\" && element2.repeat) {\n return element2.repeat;\n }\n }\n }\n function jsx(node) {\n if (node.attributes) {\n node.attributes.forEach(rename);\n }\n }\n function rename(attr) {\n if (attr.name === \"class\") {\n attr.name = \"className\";\n } else if (attr.name === \"for\") {\n attr.name = \"htmlFor\";\n }\n }\n function xsl(node) {\n if (matchesName(node.name) && node.attributes && (node.children.length || node.value)) {\n node.attributes = node.attributes.filter(isAllowed);\n }\n }\n function isAllowed(attr) {\n return attr.name !== \"select\";\n }\n function matchesName(name) {\n return name === \"xsl:variable\" || name === \"xsl:with-param\";\n }\n const reElement = /^(-+)([a-z0-9]+[a-z0-9-]*)/i;\n const reModifier = /^(_+)([a-z0-9]+[a-z0-9-_]*)/i;\n const blockCandidates1 = (className) => /^[a-z]\\-/i.test(className);\n const blockCandidates2 = (className) => /^[a-z]/i.test(className);\n function bem(node, ancestors, config2) {\n expandClassNames(node);\n expandShortNotation(node, ancestors, config2);\n }\n function expandClassNames(node) {\n const data = getBEMData(node);\n const classNames = [];\n for (const cl of data.classNames) {\n const ix = cl.indexOf(\"_\");\n if (ix > 0 && !cl.startsWith(\"-\")) {\n classNames.push(cl.slice(0, ix));\n classNames.push(cl.slice(ix));\n } else {\n classNames.push(cl);\n }\n }\n if (classNames.length) {\n data.classNames = classNames.filter(uniqueClass);\n data.block = findBlockName(data.classNames);\n updateClass(node, data.classNames.join(\" \"));\n }\n }\n function expandShortNotation(node, ancestors, config2) {\n const data = getBEMData(node);\n const classNames = [];\n const { options } = config2;\n const path = ancestors.slice(1).concat(node);\n for (let cl of data.classNames) {\n let prefix = \"\";\n let m;\n const originalClass = cl;\n if (m = cl.match(reElement)) {\n prefix = getBlockName(path, m[1].length, config2.context) + options[\"bem.element\"] + m[2];\n classNames.push(prefix);\n cl = cl.slice(m[0].length);\n }\n if (m = cl.match(reModifier)) {\n if (!prefix) {\n prefix = getBlockName(path, m[1].length);\n classNames.push(prefix);\n }\n classNames.push(`${prefix}${options[\"bem.modifier\"]}${m[2]}`);\n cl = cl.slice(m[0].length);\n }\n if (cl === originalClass) {\n classNames.push(originalClass);\n }\n }\n const arrClassNames = classNames.filter(uniqueClass);\n if (arrClassNames.length) {\n updateClass(node, arrClassNames.join(\" \"));\n }\n }\n function getBEMData(node) {\n if (!node._bem) {\n let classValue = \"\";\n if (node.attributes) {\n for (const attr of node.attributes) {\n if (attr.name === \"class\" && attr.value) {\n classValue = stringifyValue(attr.value);\n break;\n }\n }\n }\n node._bem = parseBEM(classValue);\n }\n return node._bem;\n }\n function getBEMDataFromContext(context) {\n if (!context._bem) {\n context._bem = parseBEM(context.attributes && context.attributes.class || \"\");\n }\n return context._bem;\n }\n function parseBEM(classValue) {\n const classNames = classValue ? classValue.split(/\\s+/) : [];\n return {\n classNames,\n block: findBlockName(classNames)\n };\n }\n function getBlockName(ancestors, depth = 0, context) {\n const maxParentIx = 0;\n let parentIx = Math.max(ancestors.length - depth, maxParentIx);\n do {\n const parent = ancestors[parentIx];\n if (parent) {\n const data = getBEMData(parent);\n if (data.block) {\n return data.block;\n }\n }\n } while (maxParentIx < parentIx--);\n if (context) {\n const data = getBEMDataFromContext(context);\n if (data.block) {\n return data.block;\n }\n }\n return \"\";\n }\n function findBlockName(classNames) {\n return find(classNames, blockCandidates1) || find(classNames, blockCandidates2) || void 0;\n }\n function find(classNames, filter) {\n for (const cl of classNames) {\n if (reElement.test(cl) || reModifier.test(cl)) {\n break;\n }\n if (filter(cl)) {\n return cl;\n }\n }\n }\n function updateClass(node, value) {\n for (const attr of node.attributes) {\n if (attr.name === \"class\") {\n attr.value = [value];\n break;\n }\n }\n }\n function stringifyValue(value) {\n let result = \"\";\n for (const t of value) {\n result += typeof t === \"string\" ? t : t.name;\n }\n return result;\n }\n function uniqueClass(item, ix, arr) {\n return !!item && arr.indexOf(item) === ix;\n }\n function walk$1(abbr, visitor, state) {\n const callback = (ctx, index, items) => {\n const { parent, current } = state;\n state.parent = current;\n state.current = ctx;\n visitor(ctx, index, items, state, next2);\n state.current = current;\n state.parent = parent;\n };\n const next2 = (node, index, items) => {\n state.ancestors.push(state.current);\n callback(node, index, items);\n state.ancestors.pop();\n };\n abbr.children.forEach(callback);\n }\n function createWalkState(config2) {\n return {\n current: null,\n parent: void 0,\n ancestors: [],\n config: config2,\n field: 1,\n out: createOutputStream(config2.options)\n };\n }\n const caret = [{ type: \"Field\", index: 0, name: \"\" }];\n function isSnippet(node) {\n return node ? !node.name && !node.attributes : false;\n }\n function isInlineElement(node, config2) {\n return node ? isInline(node, config2) : false;\n }\n function isField(token2) {\n return typeof token2 === \"object\" && token2.type === \"Field\";\n }\n function pushTokens(tokens, state) {\n const { out } = state;\n let largestIndex = -1;\n for (const t of tokens) {\n if (typeof t === \"string\") {\n pushString(out, t);\n } else {\n pushField(out, state.field + t.index, t.name);\n if (t.index > largestIndex) {\n largestIndex = t.index;\n }\n }\n }\n if (largestIndex !== -1) {\n state.field += largestIndex + 1;\n }\n }\n function splitByLines$1(tokens) {\n const result = [];\n let line = [];\n for (const t of tokens) {\n if (typeof t === \"string\") {\n const lines = t.split(/\\r\\n?|\\n/g);\n line.push(lines.shift() || \"\");\n while (lines.length) {\n result.push(line);\n line = [lines.shift() || \"\"];\n }\n } else {\n line.push(t);\n }\n }\n line.length && result.push(line);\n return result;\n }\n function shouldOutputAttribute(attr) {\n return !attr.implied || attr.valueType !== \"raw\" || !!attr.value && attr.value.length > 0;\n }\n function template(text2) {\n const tokens = [];\n const scanner = { pos: 0, text: text2 };\n let placeholder;\n let offset = scanner.pos;\n let pos = scanner.pos;\n while (scanner.pos < scanner.text.length) {\n pos = scanner.pos;\n if (placeholder = consumePlaceholder(scanner)) {\n if (offset !== scanner.pos) {\n tokens.push(text2.slice(offset, pos));\n }\n tokens.push(placeholder);\n offset = scanner.pos;\n } else {\n scanner.pos++;\n }\n }\n if (offset !== scanner.pos) {\n tokens.push(text2.slice(offset));\n }\n return tokens;\n }\n function consumePlaceholder(scanner) {\n if (peek(scanner) === 91) {\n const start = ++scanner.pos;\n let namePos = start;\n let afterPos = start;\n let stack = 1;\n while (scanner.pos < scanner.text.length) {\n const code2 = peek(scanner);\n if (isTokenStart(code2)) {\n namePos = scanner.pos;\n while (isToken(peek(scanner))) {\n scanner.pos++;\n }\n afterPos = scanner.pos;\n } else {\n if (code2 === 91) {\n stack++;\n } else if (code2 === 93) {\n if (--stack === 0) {\n return {\n before: scanner.text.slice(start, namePos),\n after: scanner.text.slice(afterPos, scanner.pos++),\n name: scanner.text.slice(namePos, afterPos)\n };\n }\n }\n scanner.pos++;\n }\n }\n }\n }\n function peek(scanner, pos = scanner.pos) {\n return scanner.text.charCodeAt(pos);\n }\n function isTokenStart(code2) {\n return code2 >= 65 && code2 <= 90;\n }\n function isToken(code2) {\n return isTokenStart(code2) || code2 > 47 && code2 < 58 || code2 === 95 || code2 === 45;\n }\n function createCommentState(config2) {\n const { options } = config2;\n return {\n enabled: options[\"comment.enabled\"],\n trigger: options[\"comment.trigger\"],\n before: options[\"comment.before\"] ? template(options[\"comment.before\"]) : void 0,\n after: options[\"comment.after\"] ? template(options[\"comment.after\"]) : void 0\n };\n }\n function commentNodeBefore(node, state) {\n if (shouldComment(node, state) && state.comment.before) {\n output(node, state.comment.before, state);\n }\n }\n function commentNodeAfter(node, state) {\n if (shouldComment(node, state) && state.comment.after) {\n output(node, state.comment.after, state);\n }\n }\n function shouldComment(node, state) {\n const { comment } = state;\n if (!comment.enabled || !comment.trigger || !node.name || !node.attributes) {\n return false;\n }\n for (const attr of node.attributes) {\n if (attr.name && comment.trigger.includes(attr.name)) {\n return true;\n }\n }\n return false;\n }\n function output(node, tokens, state) {\n const attrs = {};\n const { out } = state;\n for (const attr of node.attributes) {\n if (attr.name && attr.value) {\n attrs[attr.name.toUpperCase()] = attr.value;\n }\n }\n for (const token2 of tokens) {\n if (typeof token2 === \"string\") {\n pushString(out, token2);\n } else if (attrs[token2.name]) {\n pushString(out, token2.before);\n pushTokens(attrs[token2.name], state);\n pushString(out, token2.after);\n }\n }\n }\n const htmlTagRegex = /^<([\\w\\-:]+)[\\s>]/;\n function html(abbr, config2) {\n const state = createWalkState(config2);\n state.comment = createCommentState(config2);\n walk$1(abbr, element, state);\n return state.out.value;\n }\n function element(node, index, items, state, next2) {\n const { out, config: config2 } = state;\n const format = shouldFormat(node, index, items, state);\n const level = getIndent(state);\n out.level += level;\n format && pushNewline(out, true);\n if (node.name) {\n const name = tagName(node.name, config2);\n commentNodeBefore(node, state);\n pushString(out, `<${name}`);\n if (node.attributes) {\n for (const attr of node.attributes) {\n if (shouldOutputAttribute(attr)) {\n pushAttribute(attr, state);\n }\n }\n }\n if (node.selfClosing && !node.children.length && !node.value) {\n pushString(out, `${selfClose(config2)}>`);\n } else {\n pushString(out, \">\");\n if (!pushSnippet(node, state, next2)) {\n if (node.value) {\n const innerFormat = node.value.some(hasNewline) || startsWithBlockTag(node.value, config2);\n innerFormat && pushNewline(state.out, ++out.level);\n pushTokens(node.value, state);\n innerFormat && pushNewline(state.out, --out.level);\n }\n node.children.forEach(next2);\n if (!node.value && !node.children.length) {\n const innerFormat = config2.options[\"output.formatLeafNode\"] || config2.options[\"output.formatForce\"].includes(node.name);\n innerFormat && pushNewline(state.out, ++out.level);\n pushTokens(caret, state);\n innerFormat && pushNewline(state.out, --out.level);\n }\n }\n pushString(out, `</${name}>`);\n commentNodeAfter(node, state);\n }\n } else if (!pushSnippet(node, state, next2) && node.value) {\n pushTokens(node.value, state);\n node.children.forEach(next2);\n }\n if (format && index === items.length - 1 && state.parent) {\n const offset = isSnippet(state.parent) ? 0 : 1;\n pushNewline(out, out.level - offset);\n }\n out.level -= level;\n }\n function pushAttribute(attr, state) {\n const { out, config: config2 } = state;\n if (attr.name) {\n const name = attrName(attr.name, config2);\n const lQuote = attrQuote(attr, config2, true);\n const rQuote = attrQuote(attr, config2);\n let value = attr.value;\n if (isBooleanAttribute(attr, config2) && !value) {\n if (!config2.options[\"output.compactBoolean\"]) {\n value = [name];\n }\n } else if (!value) {\n value = caret;\n }\n pushString(out, \" \" + name);\n if (value) {\n pushString(out, \"=\" + lQuote);\n pushTokens(value, state);\n pushString(out, rQuote);\n } else if (config2.options[\"output.selfClosingStyle\"] !== \"html\") {\n pushString(out, \"=\" + lQuote + rQuote);\n }\n }\n }\n function pushSnippet(node, state, next2) {\n if (node.value && node.children.length) {\n const fieldIx = node.value.findIndex(isField);\n if (fieldIx !== -1) {\n pushTokens(node.value.slice(0, fieldIx), state);\n const line = state.out.line;\n let pos = fieldIx + 1;\n node.children.forEach(next2);\n if (state.out.line !== line && typeof node.value[pos] === \"string\") {\n pushString(state.out, node.value[pos++].trimLeft());\n }\n pushTokens(node.value.slice(pos), state);\n return true;\n }\n }\n return false;\n }\n function shouldFormat(node, index, items, state) {\n const { config: config2, parent } = state;\n if (!config2.options[\"output.format\"]) {\n return false;\n }\n if (index === 0 && !parent) {\n return false;\n }\n if (parent && isSnippet(parent) && items.length === 1) {\n return false;\n }\n if (isSnippet(node)) {\n const format = isSnippet(items[index - 1]) || isSnippet(items[index + 1]) || node.value.some(hasNewline) || node.value.some(isField) && node.children.length;\n if (format) {\n return true;\n }\n }\n if (isInline(node, config2)) {\n if (index === 0) {\n for (let i = 0; i < items.length; i++) {\n if (!isInline(items[i], config2)) {\n return true;\n }\n }\n } else if (!isInline(items[index - 1], config2)) {\n return true;\n }\n if (config2.options[\"output.inlineBreak\"]) {\n let adjacentInline = 1;\n let before = index;\n let after = index;\n while (isInlineElement(items[--before], config2)) {\n adjacentInline++;\n }\n while (isInlineElement(items[++after], config2)) {\n adjacentInline++;\n }\n if (adjacentInline >= config2.options[\"output.inlineBreak\"]) {\n return true;\n }\n }\n for (let i = 0, il = node.children.length; i < il; i++) {\n if (shouldFormat(node.children[i], i, node.children, state)) {\n return true;\n }\n }\n return false;\n }\n return true;\n }\n function getIndent(state) {\n const { config: config2, parent } = state;\n if (!parent || isSnippet(parent) || parent.name && config2.options[\"output.formatSkip\"].includes(parent.name)) {\n return 0;\n }\n return 1;\n }\n function hasNewline(value) {\n return typeof value === \"string\" && /\\r|\\n/.test(value);\n }\n function startsWithBlockTag(value, config2) {\n if (value.length && typeof value[0] === \"string\") {\n const matches = htmlTagRegex.exec(value[0]);\n if ((matches === null || matches === void 0 ? void 0 : matches.length) && !config2.options[\"inlineElements\"].includes(matches[1].toLowerCase())) {\n return true;\n }\n }\n return false;\n }\n function indentFormat(abbr, config2, options) {\n const state = createWalkState(config2);\n state.options = options || {};\n walk$1(abbr, element$1, state);\n return state.out.value;\n }\n function element$1(node, index, items, state, next2) {\n const { out, options } = state;\n const { primary, secondary } = collectAttributes(node);\n const level = state.parent ? 1 : 0;\n out.level += level;\n if (shouldFormat$1(node, index, items, state)) {\n pushNewline(out, true);\n }\n if (node.name && (node.name !== \"div\" || !primary.length)) {\n pushString(out, (options.beforeName || \"\") + node.name + (options.afterName || \"\"));\n }\n pushPrimaryAttributes(primary, state);\n pushSecondaryAttributes(secondary.filter(shouldOutputAttribute), state);\n if (node.selfClosing && !node.value && !node.children.length) {\n if (state.options.selfClose) {\n pushString(out, state.options.selfClose);\n }\n } else {\n pushValue(node, state);\n node.children.forEach(next2);\n }\n out.level -= level;\n }\n function collectAttributes(node) {\n const primary = [];\n const secondary = [];\n if (node.attributes) {\n for (const attr of node.attributes) {\n if (isPrimaryAttribute(attr)) {\n primary.push(attr);\n } else {\n secondary.push(attr);\n }\n }\n }\n return { primary, secondary };\n }\n function pushPrimaryAttributes(attrs, state) {\n for (const attr of attrs) {\n if (attr.value) {\n if (attr.name === \"class\") {\n pushString(state.out, \".\");\n const tokens = attr.value.map((t) => typeof t === \"string\" ? t.replace(/\\s+/g, \".\") : t);\n pushTokens(tokens, state);\n } else {\n pushString(state.out, \"#\");\n pushTokens(attr.value, state);\n }\n }\n }\n }\n function pushSecondaryAttributes(attrs, state) {\n if (attrs.length) {\n const { out, config: config2, options } = state;\n options.beforeAttribute && pushString(out, options.beforeAttribute);\n for (let i = 0; i < attrs.length; i++) {\n const attr = attrs[i];\n pushString(out, attrName(attr.name || \"\", config2));\n if (isBooleanAttribute(attr, config2) && !attr.value) {\n if (!config2.options[\"output.compactBoolean\"] && options.booleanValue) {\n pushString(out, \"=\" + options.booleanValue);\n }\n } else {\n pushString(out, \"=\" + attrQuote(attr, config2, true));\n pushTokens(attr.value || caret, state);\n pushString(out, attrQuote(attr, config2));\n }\n if (i !== attrs.length - 1 && options.glueAttribute) {\n pushString(out, options.glueAttribute);\n }\n }\n options.afterAttribute && pushString(out, options.afterAttribute);\n }\n }\n function pushValue(node, state) {\n if (!node.value && node.children.length) {\n return;\n }\n const value = node.value || caret;\n const lines = splitByLines$1(value);\n const { out, options } = state;\n if (lines.length === 1) {\n if (node.name || node.attributes) {\n push(out, \" \");\n }\n pushTokens(value, state);\n } else {\n const lineLengths = [];\n let maxLength = 0;\n for (const line of lines) {\n const len = valueLength(line);\n lineLengths.push(len);\n if (len > maxLength) {\n maxLength = len;\n }\n }\n out.level++;\n for (let i = 0; i < lines.length; i++) {\n pushNewline(out, true);\n options.beforeTextLine && push(out, options.beforeTextLine);\n pushTokens(lines[i], state);\n if (options.afterTextLine) {\n push(out, \" \".repeat(maxLength - lineLengths[i]));\n push(out, options.afterTextLine);\n }\n }\n out.level--;\n }\n }\n function isPrimaryAttribute(attr) {\n return attr.name === \"class\" || attr.name === \"id\";\n }\n function valueLength(tokens) {\n let len = 0;\n for (const token2 of tokens) {\n len += typeof token2 === \"string\" ? token2.length : token2.name.length;\n }\n return len;\n }\n function shouldFormat$1(node, index, items, state) {\n if (!state.parent && index === 0) {\n return false;\n }\n return !isSnippet(node);\n }\n function haml(abbr, config2) {\n return indentFormat(abbr, config2, {\n beforeName: \"%\",\n beforeAttribute: \"(\",\n afterAttribute: \")\",\n glueAttribute: \" \",\n afterTextLine: \" |\",\n booleanValue: \"true\",\n selfClose: \"/\"\n });\n }\n function slim(abbr, config2) {\n return indentFormat(abbr, config2, {\n beforeAttribute: \" \",\n glueAttribute: \" \",\n beforeTextLine: \"| \",\n selfClose: \"/\"\n });\n }\n function pug(abbr, config2) {\n return indentFormat(abbr, config2, {\n beforeAttribute: \"(\",\n afterAttribute: \")\",\n glueAttribute: \", \",\n beforeTextLine: \"| \",\n selfClose: config2.options[\"output.selfClosingStyle\"] === \"xml\" ? \"/\" : \"\"\n });\n }\n const formatters = { html, haml, slim, pug };\n function parse$1(abbr, config2) {\n let oldTextValue;\n if (typeof abbr === \"string\") {\n let parseOpt = config2;\n if (config2.options[\"jsx.enabled\"]) {\n parseOpt = Object.assign(Object.assign({}, parseOpt), { jsx: true });\n }\n if (config2.options[\"markup.href\"]) {\n parseOpt = Object.assign(Object.assign({}, parseOpt), { href: true });\n }\n abbr = parseAbbreviation(abbr, parseOpt);\n oldTextValue = config2.text;\n config2.text = void 0;\n }\n abbr = resolveSnippets(abbr, config2);\n walk(abbr, transform, config2);\n config2.text = oldTextValue !== null && oldTextValue !== void 0 ? oldTextValue : config2.text;\n return abbr;\n }\n function stringify(abbr, config2) {\n const formatter = formatters[config2.syntax] || html;\n return formatter(abbr, config2);\n }\n function transform(node, ancestors, config2) {\n implicitTag(node, ancestors, config2);\n mergeAttributes(node, config2);\n lorem(node, ancestors, config2);\n if (config2.syntax === \"xsl\") {\n xsl(node);\n }\n if (config2.options[\"jsx.enabled\"]) {\n jsx(node);\n }\n if (config2.options[\"bem.enabled\"]) {\n bem(node, ancestors, config2);\n }\n }\n const reProperty = /^([a-z-]+)(?:\\s*:\\s*([^\\n\\r;]+?);*)?$/;\n const opt = { value: true };\n function createSnippet(key, value) {\n const m = value.match(reProperty);\n if (m) {\n const keywords = {};\n const parsed = m[2] ? m[2].split(\"|\").map(parseValue) : [];\n for (const item of parsed) {\n for (const cssVal of item) {\n collectKeywords(cssVal, keywords);\n }\n }\n return {\n type: \"Property\",\n key,\n property: m[1],\n value: parsed,\n keywords,\n dependencies: []\n };\n }\n return { type: \"Raw\", key, value };\n }\n function nest(snippets) {\n snippets = snippets.slice().sort(snippetsSort);\n const stack = [];\n let prev2;\n for (const cur2 of snippets.filter(isProperty)) {\n while (stack.length) {\n prev2 = stack[stack.length - 1];\n if (cur2.property.startsWith(prev2.property) && cur2.property.charCodeAt(prev2.property.length) === 45) {\n prev2.dependencies.push(cur2);\n stack.push(cur2);\n break;\n }\n stack.pop();\n }\n if (!stack.length) {\n stack.push(cur2);\n }\n }\n return snippets;\n }\n function snippetsSort(a, b) {\n if (a.key === b.key) {\n return 0;\n }\n return a.key < b.key ? -1 : 1;\n }\n function parseValue(value) {\n return parse$2(value.trim(), opt)[0].value;\n }\n function isProperty(snippet2) {\n return snippet2.type === \"Property\";\n }\n function collectKeywords(cssVal, dest) {\n for (const v of cssVal.value) {\n if (v.type === \"Literal\") {\n dest[v.value] = v;\n } else if (v.type === \"FunctionCall\") {\n dest[v.name] = v;\n } else if (v.type === \"Field\") {\n const value = v.name.trim();\n if (value) {\n dest[value] = { type: \"Literal\", value };\n }\n }\n }\n }\n function scoreMatch(str1, str2, partialMatch = false) {\n str1 = str1.toLowerCase();\n str2 = str2.toLowerCase();\n if (str1 === str2) {\n return 1;\n }\n if (!str1 || !str2 || str1.charCodeAt(0) !== str2.charCodeAt(0)) {\n return 0;\n }\n const str1Len = str1.length;\n const str2Len = str2.length;\n if (!partialMatch && str1Len > str2Len) {\n return 0;\n }\n const minLength = Math.min(str1Len, str2Len);\n const maxLength = Math.max(str1Len, str2Len);\n let i = 1;\n let j = 1;\n let score = maxLength;\n let ch1 = 0;\n let ch2 = 0;\n let found = false;\n let acronym = false;\n while (i < str1Len) {\n ch1 = str1.charCodeAt(i);\n found = false;\n acronym = false;\n while (j < str2Len) {\n ch2 = str2.charCodeAt(j);\n if (ch1 === ch2) {\n found = true;\n score += maxLength - (acronym ? i : j);\n break;\n }\n acronym = ch2 === 45;\n j++;\n }\n if (!found) {\n if (!partialMatch) {\n return 0;\n }\n break;\n }\n i++;\n }\n const matchRatio = i / maxLength;\n const delta = maxLength - minLength;\n const maxScore = sum(maxLength) - sum(delta);\n return score * matchRatio / maxScore;\n }\n function sum(n) {\n return n * (n + 1) / 2;\n }\n function color(token2, shortHex) {\n if (!token2.r && !token2.g && !token2.b && !token2.a) {\n return \"transparent\";\n } else if (token2.a === 1) {\n return asHex(token2, shortHex);\n }\n return asRGB(token2);\n }\n function asHex(token2, short) {\n const fn = short && isShortHex(token2.r) && isShortHex(token2.g) && isShortHex(token2.b) ? toShortHex : toHex;\n return \"#\" + fn(token2.r) + fn(token2.g) + fn(token2.b);\n }\n function asRGB(token2) {\n const values = [token2.r, token2.g, token2.b];\n if (token2.a !== 1) {\n values.push(frac(token2.a, 8));\n }\n return `${values.length === 3 ? \"rgb\" : \"rgba\"}(${values.join(\", \")})`;\n }\n function frac(num, digits = 4) {\n return num.toFixed(digits).replace(/\\.?0+$/, \"\");\n }\n function isShortHex(hex) {\n return !(hex % 17);\n }\n function toShortHex(num) {\n return (num >> 4).toString(16);\n }\n function toHex(num) {\n return pad(num.toString(16), 2);\n }\n function pad(value, len) {\n while (value.length < len) {\n value = \"0\" + value;\n }\n return value;\n }\n function css(abbr, config2) {\n var _a;\n const out = createOutputStream(config2.options);\n const format = config2.options[\"output.format\"];\n if (((_a = config2.context) === null || _a === void 0 ? void 0 : _a.name) === \"@@section\") {\n abbr = abbr.filter((node) => node.snippet);\n }\n for (let i = 0; i < abbr.length; i++) {\n if (format && i !== 0) {\n pushNewline(out, true);\n }\n property(abbr[i], out, config2);\n }\n return out.value;\n }\n function property(node, out, config2) {\n const isJSON = config2.options[\"stylesheet.json\"];\n if (node.name) {\n const name = isJSON ? toCamelCase(node.name) : node.name;\n pushString(out, name + config2.options[\"stylesheet.between\"]);\n if (node.value.length) {\n propertyValue(node, out, config2);\n } else {\n pushField(out, 0, \"\");\n }\n if (isJSON) {\n push(out, \",\");\n } else {\n outputImportant(node, out, true);\n push(out, config2.options[\"stylesheet.after\"]);\n }\n } else {\n for (const cssVal of node.value) {\n for (const v of cssVal.value) {\n outputToken(v, out, config2);\n }\n }\n outputImportant(node, out, node.value.length > 0);\n }\n }\n function propertyValue(node, out, config2) {\n const isJSON = config2.options[\"stylesheet.json\"];\n const num = isJSON ? getSingleNumeric(node) : null;\n if (num && (!num.unit || num.unit === \"px\")) {\n push(out, String(num.value));\n } else {\n const quote2 = getQuote(config2);\n isJSON && push(out, quote2);\n for (let i = 0; i < node.value.length; i++) {\n if (i !== 0) {\n push(out, \", \");\n }\n outputValue(node.value[i], out, config2);\n }\n isJSON && push(out, quote2);\n }\n }\n function outputImportant(node, out, separator) {\n if (node.important) {\n if (separator) {\n push(out, \" \");\n }\n push(out, \"!important\");\n }\n }\n function outputValue(value, out, config2) {\n for (let i = 0, prevEnd = -1; i < value.value.length; i++) {\n const token2 = value.value[i];\n if (i !== 0 && (token2.type !== \"Field\" || token2.start !== prevEnd)) {\n push(out, \" \");\n }\n outputToken(token2, out, config2);\n prevEnd = token2[\"end\"];\n }\n }\n function outputToken(token2, out, config2) {\n if (token2.type === \"ColorValue\") {\n push(out, color(token2, config2.options[\"stylesheet.shortHex\"]));\n } else if (token2.type === \"Literal\") {\n pushString(out, token2.value);\n } else if (token2.type === \"NumberValue\") {\n pushString(out, frac(token2.value, 4) + token2.unit);\n } else if (token2.type === \"StringValue\") {\n const quote2 = token2.quote === \"double\" ? '\"' : \"'\";\n pushString(out, quote2 + token2.value + quote2);\n } else if (token2.type === \"Field\") {\n pushField(out, token2.index, token2.name);\n } else if (token2.type === \"FunctionCall\") {\n push(out, token2.name + \"(\");\n for (let i = 0; i < token2.arguments.length; i++) {\n if (i) {\n push(out, \", \");\n }\n outputValue(token2.arguments[i], out, config2);\n }\n push(out, \")\");\n }\n }\n function getSingleNumeric(node) {\n if (node.value.length === 1) {\n const cssVal = node.value[0];\n if (cssVal.value.length === 1 && cssVal.value[0].type === \"NumberValue\") {\n return cssVal.value[0];\n }\n }\n }\n function toCamelCase(str) {\n return str.replace(/\\-(\\w)/g, (_, letter) => letter.toUpperCase());\n }\n function getQuote(config2) {\n return config2.options[\"stylesheet.jsonDoubleQuotes\"] ? '\"' : \"'\";\n }\n const gradientName = \"lg\";\n function parse$1$1(abbr, config2) {\n var _a;\n const snippets = ((_a = config2.cache) === null || _a === void 0 ? void 0 : _a.stylesheetSnippets) || convertSnippets(config2.snippets);\n if (config2.cache) {\n config2.cache.stylesheetSnippets = snippets;\n }\n if (typeof abbr === \"string\") {\n abbr = parse$2(abbr, { value: isValueScope(config2) });\n }\n const filteredSnippets = getSnippetsForScope(snippets, config2);\n for (const node of abbr) {\n resolveNode(node, filteredSnippets, config2);\n }\n return abbr;\n }\n function convertSnippets(snippets) {\n const result = [];\n for (const key of Object.keys(snippets)) {\n result.push(createSnippet(key, snippets[key]));\n }\n return nest(result);\n }\n function resolveNode(node, snippets, config2) {\n if (!resolveGradient(node, config2)) {\n const score = config2.options[\"stylesheet.fuzzySearchMinScore\"];\n if (isValueScope(config2)) {\n const propName = config2.context.name;\n const snippet2 = snippets.find((s) => s.type === \"Property\" && s.property === propName);\n resolveValueKeywords(node, config2, snippet2, score);\n node.snippet = snippet2;\n } else if (node.name) {\n const snippet2 = findBestMatch(node.name, snippets, score, true);\n node.snippet = snippet2;\n if (snippet2) {\n if (snippet2.type === \"Property\") {\n resolveAsProperty(node, snippet2, config2);\n } else {\n resolveAsSnippet(node, snippet2);\n }\n }\n }\n }\n if (node.name || config2.context) {\n resolveNumericValue(node, config2);\n }\n return node;\n }\n function resolveGradient(node, config2) {\n let gradientFn = null;\n const cssVal = node.value.length === 1 ? node.value[0] : null;\n if (cssVal && cssVal.value.length === 1) {\n const v = cssVal.value[0];\n if (v.type === \"FunctionCall\" && v.name === gradientName) {\n gradientFn = v;\n }\n }\n if (gradientFn || node.name === gradientName) {\n if (!gradientFn) {\n gradientFn = {\n type: \"FunctionCall\",\n name: \"linear-gradient\",\n arguments: [cssValue(field$1(0, \"\"))]\n };\n } else {\n gradientFn = Object.assign(Object.assign({}, gradientFn), { name: \"linear-gradient\" });\n }\n if (!config2.context) {\n node.name = \"background-image\";\n }\n node.value = [cssValue(gradientFn)];\n return true;\n }\n return false;\n }\n function resolveAsProperty(node, snippet2, config2) {\n const abbr = node.name;\n const inlineValue = getUnmatchedPart(abbr, snippet2.key);\n if (inlineValue) {\n if (node.value.length) {\n return node;\n }\n const kw = resolveKeyword(inlineValue, config2, snippet2);\n if (!kw) {\n return node;\n }\n node.value.push(cssValue(kw));\n }\n node.name = snippet2.property;\n if (node.value.length) {\n resolveValueKeywords(node, config2, snippet2);\n } else if (snippet2.value.length) {\n const defaultValue = snippet2.value[0];\n node.value = snippet2.value.length === 1 || defaultValue.some(hasField) ? defaultValue : defaultValue.map((n) => wrapWithField(n, config2));\n }\n return node;\n }\n function resolveValueKeywords(node, config2, snippet2, minScore) {\n for (const cssVal of node.value) {\n const value = [];\n for (const token2 of cssVal.value) {\n if (token2.type === \"Literal\") {\n value.push(resolveKeyword(token2.value, config2, snippet2, minScore) || token2);\n } else if (token2.type === \"FunctionCall\") {\n const match = resolveKeyword(token2.name, config2, snippet2, minScore);\n if (match && match.type === \"FunctionCall\") {\n value.push(Object.assign(Object.assign({}, match), { arguments: token2.arguments.concat(match.arguments.slice(token2.arguments.length)) }));\n } else {\n value.push(token2);\n }\n } else {\n value.push(token2);\n }\n }\n cssVal.value = value;\n }\n }\n function resolveAsSnippet(node, snippet2) {\n let offset = 0;\n let m;\n const reField = /\\$\\{(\\d+)(:[^}]+)?\\}/g;\n const inputValue = node.value[0];\n const outputValue2 = [];\n while (m = reField.exec(snippet2.value)) {\n if (offset !== m.index) {\n outputValue2.push(literal(snippet2.value.slice(offset, m.index)));\n }\n offset = m.index + m[0].length;\n if (inputValue && inputValue.value.length) {\n outputValue2.push(inputValue.value.shift());\n } else {\n outputValue2.push(field$1(Number(m[1]), m[2] ? m[2].slice(1) : \"\"));\n }\n }\n const tail = snippet2.value.slice(offset);\n if (tail) {\n outputValue2.push(literal(tail));\n }\n node.name = void 0;\n node.value = [cssValue(...outputValue2)];\n return node;\n }\n function findBestMatch(abbr, items, minScore = 0, partialMatch = false) {\n let matchedItem = null;\n let maxScore = 0;\n for (const item of items) {\n const score = scoreMatch(abbr, getScoringPart(item), partialMatch);\n if (score === 1) {\n return item;\n }\n if (score && score >= maxScore) {\n maxScore = score;\n matchedItem = item;\n }\n }\n return maxScore >= minScore ? matchedItem : null;\n }\n function getScoringPart(item) {\n return typeof item === \"string\" ? item : item.key;\n }\n function getUnmatchedPart(abbr, str) {\n for (let i = 0, lastPos = 0; i < abbr.length; i++) {\n lastPos = str.indexOf(abbr[i], lastPos);\n if (lastPos === -1) {\n return abbr.slice(i);\n }\n lastPos++;\n }\n return \"\";\n }\n function resolveKeyword(kw, config2, snippet2, minScore) {\n let ref;\n if (snippet2) {\n if (ref = findBestMatch(kw, Object.keys(snippet2.keywords), minScore)) {\n return snippet2.keywords[ref];\n }\n for (const dep of snippet2.dependencies) {\n if (ref = findBestMatch(kw, Object.keys(dep.keywords), minScore)) {\n return dep.keywords[ref];\n }\n }\n }\n if (ref = findBestMatch(kw, config2.options[\"stylesheet.keywords\"], minScore)) {\n return literal(ref);\n }\n return null;\n }\n function resolveNumericValue(node, config2) {\n const aliases = config2.options[\"stylesheet.unitAliases\"];\n const unitless = config2.options[\"stylesheet.unitless\"];\n for (const v of node.value) {\n for (const t of v.value) {\n if (t.type === \"NumberValue\") {\n if (t.unit) {\n t.unit = aliases[t.unit] || t.unit;\n } else if (t.value !== 0 && !unitless.includes(node.name)) {\n t.unit = t.rawValue.includes(\".\") ? config2.options[\"stylesheet.floatUnit\"] : config2.options[\"stylesheet.intUnit\"];\n }\n }\n }\n }\n }\n function cssValue(...args) {\n return {\n type: \"CSSValue\",\n value: args\n };\n }\n function literal(value) {\n return { type: \"Literal\", value };\n }\n function field$1(index, name) {\n return { type: \"Field\", index, name };\n }\n function hasField(value) {\n for (const v of value.value) {\n if (v.type === \"Field\" || v.type === \"FunctionCall\" && v.arguments.some(hasField)) {\n return true;\n }\n }\n return false;\n }\n function wrapWithField(node, config2, state = { index: 1 }) {\n let value = [];\n for (const v of node.value) {\n switch (v.type) {\n case \"ColorValue\":\n value.push(field$1(state.index++, color(v, config2.options[\"stylesheet.shortHex\"])));\n break;\n case \"Literal\":\n value.push(field$1(state.index++, v.value));\n break;\n case \"NumberValue\":\n value.push(field$1(state.index++, `${v.value}${v.unit}`));\n break;\n case \"StringValue\":\n const q = v.quote === \"single\" ? \"'\" : '\"';\n value.push(field$1(state.index++, q + v.value + q));\n break;\n case \"FunctionCall\":\n value.push(field$1(state.index++, v.name), literal(\"(\"));\n for (let i = 0, il = v.arguments.length; i < il; i++) {\n value = value.concat(wrapWithField(v.arguments[i], config2, state).value);\n if (i !== il - 1) {\n value.push(literal(\", \"));\n }\n }\n value.push(literal(\")\"));\n break;\n default:\n value.push(v);\n }\n }\n return Object.assign(Object.assign({}, node), { value });\n }\n function isValueScope(config2) {\n if (config2.context) {\n return config2.context.name === \"@@value\" || !config2.context.name.startsWith(\"@@\");\n }\n return false;\n }\n function getSnippetsForScope(snippets, config2) {\n if (config2.context) {\n if (config2.context.name === \"@@section\") {\n return snippets.filter((s) => s.type === \"Raw\");\n }\n if (config2.context.name === \"@@property\") {\n return snippets.filter((s) => s.type === \"Property\");\n }\n }\n return snippets;\n }\n var markupSnippets = {\n \"a\": \"a[href]\",\n \"a:blank\": \"a[href='http://${0}' target='_blank' rel='noopener noreferrer']\",\n \"a:link\": \"a[href='http://${0}']\",\n \"a:mail\": \"a[href='mailto:${0}']\",\n \"a:tel\": \"a[href='tel:+${0}']\",\n \"abbr\": \"abbr[title]\",\n \"acr|acronym\": \"acronym[title]\",\n \"base\": \"base[href]/\",\n \"basefont\": \"basefont/\",\n \"br\": \"br/\",\n \"frame\": \"frame/\",\n \"hr\": \"hr/\",\n \"bdo\": \"bdo[dir]\",\n \"bdo:r\": \"bdo[dir=rtl]\",\n \"bdo:l\": \"bdo[dir=ltr]\",\n \"col\": \"col/\",\n \"link\": \"link[rel=stylesheet href]/\",\n \"link:css\": \"link[href='${1:style}.css']\",\n \"link:print\": \"link[href='${1:print}.css' media=print]\",\n \"link:favicon\": \"link[rel='shortcut icon' type=image/x-icon href='${1:favicon.ico}']\",\n \"link:mf|link:manifest\": \"link[rel='manifest' href='${1:manifest.json}']\",\n \"link:touch\": \"link[rel=apple-touch-icon href='${1:favicon.png}']\",\n \"link:rss\": \"link[rel=alternate type=application/rss+xml title=RSS href='${1:rss.xml}']\",\n \"link:atom\": \"link[rel=alternate type=application/atom+xml title=Atom href='${1:atom.xml}']\",\n \"link:im|link:import\": \"link[rel=import href='${1:component}.html']\",\n \"meta\": \"meta/\",\n \"meta:utf\": \"meta[http-equiv=Content-Type content='text/html;charset=UTF-8']\",\n \"meta:vp\": \"meta[name=viewport content='width=${1:device-width}, initial-scale=${2:1.0}']\",\n \"meta:compat\": \"meta[http-equiv=X-UA-Compatible content='${1:IE=7}']\",\n \"meta:edge\": \"meta:compat[content='${1:ie=edge}']\",\n \"meta:redirect\": \"meta[http-equiv=refresh content='0; url=${1:http://example.com}']\",\n \"meta:kw\": \"meta[name=keywords content]\",\n \"meta:desc\": \"meta[name=description content]\",\n \"style\": \"style\",\n \"script\": \"script\",\n \"script:src\": \"script[src]\",\n \"img\": \"img[src alt]/\",\n \"img:s|img:srcset\": \"img[srcset src alt]\",\n \"img:z|img:sizes\": \"img[sizes srcset src alt]\",\n \"picture\": \"picture\",\n \"src|source\": \"source/\",\n \"src:sc|source:src\": \"source[src type]\",\n \"src:s|source:srcset\": \"source[srcset]\",\n \"src:t|source:type\": \"source[srcset type='${1:image/}']\",\n \"src:z|source:sizes\": \"source[sizes srcset]\",\n \"src:m|source:media\": \"source[media='(${1:min-width: })' srcset]\",\n \"src:mt|source:media:type\": \"source:media[type='${2:image/}']\",\n \"src:mz|source:media:sizes\": \"source:media[sizes srcset]\",\n \"src:zt|source:sizes:type\": \"source[sizes srcset type='${1:image/}']\",\n \"iframe\": \"iframe[src frameborder=0]\",\n \"embed\": \"embed[src type]/\",\n \"object\": \"object[data type]\",\n \"param\": \"param[name value]/\",\n \"map\": \"map[name]\",\n \"area\": \"area[shape coords href alt]/\",\n \"area:d\": \"area[shape=default]\",\n \"area:c\": \"area[shape=circle]\",\n \"area:r\": \"area[shape=rect]\",\n \"area:p\": \"area[shape=poly]\",\n \"form\": \"form[action]\",\n \"form:get\": \"form[method=get]\",\n \"form:post\": \"form[method=post]\",\n \"label\": \"label[for]\",\n \"input\": \"input[type=${1:text}]/\",\n \"inp\": \"input[name=${1} id=${1}]\",\n \"input:h|input:hidden\": \"input[type=hidden name]\",\n \"input:t|input:text\": \"inp[type=text]\",\n \"input:search\": \"inp[type=search]\",\n \"input:email\": \"inp[type=email]\",\n \"input:url\": \"inp[type=url]\",\n \"input:p|input:password\": \"inp[type=password]\",\n \"input:datetime\": \"inp[type=datetime]\",\n \"input:date\": \"inp[type=date]\",\n \"input:datetime-local\": \"inp[type=datetime-local]\",\n \"input:month\": \"inp[type=month]\",\n \"input:week\": \"inp[type=week]\",\n \"input:time\": \"inp[type=time]\",\n \"input:tel\": \"inp[type=tel]\",\n \"input:number\": \"inp[type=number]\",\n \"input:color\": \"inp[type=color]\",\n \"input:c|input:checkbox\": \"inp[type=checkbox]\",\n \"input:r|input:radio\": \"inp[type=radio]\",\n \"input:range\": \"inp[type=range]\",\n \"input:f|input:file\": \"inp[type=file]\",\n \"input:s|input:submit\": \"input[type=submit value]\",\n \"input:i|input:image\": \"input[type=image src alt]\",\n \"input:b|input:btn|input:button\": \"input[type=button value]\",\n \"input:reset\": \"input:button[type=reset]\",\n \"isindex\": \"isindex/\",\n \"select\": \"select[name=${1} id=${1}]\",\n \"select:d|select:disabled\": \"select[disabled.]\",\n \"opt|option\": \"option[value]\",\n \"textarea\": \"textarea[name=${1} id=${1} cols=${2:30} rows=${3:10}]\",\n \"marquee\": \"marquee[behavior direction]\",\n \"menu:c|menu:context\": \"menu[type=context]\",\n \"menu:t|menu:toolbar\": \"menu[type=toolbar]\",\n \"video\": \"video[src]\",\n \"audio\": \"audio[src]\",\n \"html:xml\": \"html[xmlns=http://www.w3.org/1999/xhtml]\",\n \"keygen\": \"keygen/\",\n \"command\": \"command/\",\n \"btn:s|button:s|button:submit\": \"button[type=submit]\",\n \"btn:r|button:r|button:reset\": \"button[type=reset]\",\n \"btn:d|button:d|button:disabled\": \"button[disabled.]\",\n \"fst:d|fset:d|fieldset:d|fieldset:disabled\": \"fieldset[disabled.]\",\n \"bq\": \"blockquote\",\n \"fig\": \"figure\",\n \"figc\": \"figcaption\",\n \"pic\": \"picture\",\n \"ifr\": \"iframe\",\n \"emb\": \"embed\",\n \"obj\": \"object\",\n \"cap\": \"caption\",\n \"colg\": \"colgroup\",\n \"fst\": \"fieldset\",\n \"btn\": \"button\",\n \"optg\": \"optgroup\",\n \"tarea\": \"textarea\",\n \"leg\": \"legend\",\n \"sect\": \"section\",\n \"art\": \"article\",\n \"hdr\": \"header\",\n \"ftr\": \"footer\",\n \"adr\": \"address\",\n \"dlg\": \"dialog\",\n \"str\": \"strong\",\n \"prog\": \"progress\",\n \"mn\": \"main\",\n \"tem\": \"template\",\n \"fset\": \"fieldset\",\n \"datag\": \"datagrid\",\n \"datal\": \"datalist\",\n \"kg\": \"keygen\",\n \"out\": \"output\",\n \"det\": \"details\",\n \"sum\": \"summary\",\n \"cmd\": \"command\",\n \"ri:d|ri:dpr\": \"img:s\",\n \"ri:v|ri:viewport\": \"img:z\",\n \"ri:a|ri:art\": \"pic>src:m+img\",\n \"ri:t|ri:type\": \"pic>src:t+img\",\n \"!!!\": \"{<!DOCTYPE html>}\",\n \"doc\": \"html[lang=${lang}]>(head>meta[charset=${charset}]+meta[http-equiv='X-UA-Compatible'][content='IE=edge']+meta:vp+title{${1:Document}})+body\",\n \"!|html:5\": \"!!!+doc\",\n \"c\": \"{<!-- ${0} -->}\",\n \"cc:ie\": \"{<!--[if IE]>${0}<![endif]-->}\",\n \"cc:noie\": \"{<!--[if !IE]><!-->${0}<!--<![endif]-->}\"\n };\n var stylesheetSnippets = {\n \"@f\": \"@font-face {\\n\tfont-family: ${1};\\n\tsrc: url(${2});\\n}\",\n \"@ff\": \"@font-face {\\n\tfont-family: '${1:FontName}';\\n\tsrc: url('${2:FileName}.eot');\\n\tsrc: url('${2:FileName}.eot?#iefix') format('embedded-opentype'),\\n\t\t url('${2:FileName}.woff') format('woff'),\\n\t\t url('${2:FileName}.ttf') format('truetype'),\\n\t\t url('${2:FileName}.svg#${1:FontName}') format('svg');\\n\tfont-style: ${3:normal};\\n\tfont-weight: ${4:normal};\\n}\",\n \"@i|@import\": \"@import url(${0});\",\n \"@kf\": \"@keyframes ${1:identifier} {\\n\t${2}\\n}\",\n \"@m|@media\": \"@media ${1:screen} {\\n\t${0}\\n}\",\n \"ac\": \"align-content:start|end|flex-start|flex-end|center|space-between|space-around|stretch|space-evenly\",\n \"ai\": \"align-items:start|end|flex-start|flex-end|center|baseline|stretch\",\n \"anim\": \"animation:${1:name} ${2:duration} ${3:timing-function} ${4:delay} ${5:iteration-count} ${6:direction} ${7:fill-mode}\",\n \"animdel\": \"animation-delay:time\",\n \"animdir\": \"animation-direction:normal|reverse|alternate|alternate-reverse\",\n \"animdur\": \"animation-duration:${1:0}s\",\n \"animfm\": \"animation-fill-mode:both|forwards|backwards\",\n \"animic\": \"animation-iteration-count:1|infinite\",\n \"animn\": \"animation-name\",\n \"animps\": \"animation-play-state:running|paused\",\n \"animtf\": \"animation-timing-function:linear|ease|ease-in|ease-out|ease-in-out|cubic-bezier(${1:0.1}, ${2:0.7}, ${3:1.0}, ${3:0.1})\",\n \"ap\": \"appearance:none\",\n \"as\": \"align-self:start|end|auto|flex-start|flex-end|center|baseline|stretch\",\n \"b\": \"bottom\",\n \"bd\": \"border:${1:1px} ${2:solid} ${3:#000}\",\n \"bdb\": \"border-bottom:${1:1px} ${2:solid} ${3:#000}\",\n \"bdbc\": \"border-bottom-color:${1:#000}\",\n \"bdbi\": \"border-bottom-image:url(${0})\",\n \"bdbk\": \"border-break:close\",\n \"bdbli\": \"border-bottom-left-image:url(${0})|continue\",\n \"bdblrs\": \"border-bottom-left-radius\",\n \"bdbri\": \"border-bottom-right-image:url(${0})|continue\",\n \"bdbrrs\": \"border-bottom-right-radius\",\n \"bdbs\": \"border-bottom-style\",\n \"bdbw\": \"border-bottom-width\",\n \"bdc\": \"border-color:${1:#000}\",\n \"bdci\": \"border-corner-image:url(${0})|continue\",\n \"bdcl\": \"border-collapse:collapse|separate\",\n \"bdf\": \"border-fit:repeat|clip|scale|stretch|overwrite|overflow|space\",\n \"bdi\": \"border-image:url(${0})\",\n \"bdl\": \"border-left:${1:1px} ${2:solid} ${3:#000}\",\n \"bdlc\": \"border-left-color:${1:#000}\",\n \"bdlen\": \"border-length\",\n \"bdli\": \"border-left-image:url(${0})\",\n \"bdls\": \"border-left-style\",\n \"bdlw\": \"border-left-width\",\n \"bdr\": \"border-right:${1:1px} ${2:solid} ${3:#000}\",\n \"bdrc\": \"border-right-color:${1:#000}\",\n \"bdri\": \"border-right-image:url(${0})\",\n \"bdrs\": \"border-radius\",\n \"bdrst\": \"border-right-style\",\n \"bdrw\": \"border-right-width\",\n \"bds\": \"border-style:none|hidden|dotted|dashed|solid|double|dot-dash|dot-dot-dash|wave|groove|ridge|inset|outset\",\n \"bdsp\": \"border-spacing\",\n \"bdt\": \"border-top:${1:1px} ${2:solid} ${3:#000}\",\n \"bdtc\": \"border-top-color:${1:#000}\",\n \"bdti\": \"border-top-image:url(${0})\",\n \"bdtli\": \"border-top-left-image:url(${0})|continue\",\n \"bdtlrs\": \"border-top-left-radius\",\n \"bdtri\": \"border-top-right-image:url(${0})|continue\",\n \"bdtrrs\": \"border-top-right-radius\",\n \"bdts\": \"border-top-style\",\n \"bdtw\": \"border-top-width\",\n \"bdw\": \"border-width\",\n \"bfv\": \"backface-visibility:hidden|visible\",\n \"bg\": \"background:${1:#000}\",\n \"bga\": \"background-attachment:fixed|scroll\",\n \"bgbk\": \"background-break:bounding-box|each-box|continuous\",\n \"bgc\": \"background-color:#${1:fff}\",\n \"bgcp\": \"background-clip:padding-box|border-box|content-box|no-clip\",\n \"bgi\": \"background-image:url(${0})\",\n \"bgo\": \"background-origin:padding-box|border-box|content-box\",\n \"bgp\": \"background-position:${1:0} ${2:0}\",\n \"bgpx\": \"background-position-x\",\n \"bgpy\": \"background-position-y\",\n \"bgr\": \"background-repeat:no-repeat|repeat-x|repeat-y|space|round\",\n \"bgsz\": \"background-size:contain|cover\",\n \"bxsh\": \"box-shadow:${1:inset }${2:hoff} ${3:voff} ${4:blur} ${5:#000}|none\",\n \"bxsz\": \"box-sizing:border-box|content-box|border-box\",\n \"c\": \"color:${1:#000}\",\n \"cr\": \"color:rgb(${1:0}, ${2:0}, ${3:0})\",\n \"cra\": \"color:rgba(${1:0}, ${2:0}, ${3:0}, ${4:.5})\",\n \"cl\": \"clear:both|left|right|none\",\n \"cm\": \"/* ${0} */\",\n \"cnt\": \"content:'${0}'|normal|open-quote|no-open-quote|close-quote|no-close-quote|attr(${0})|counter(${0})|counters(${0})\",\n \"coi\": \"counter-increment\",\n \"colm\": \"columns\",\n \"colmc\": \"column-count\",\n \"colmf\": \"column-fill\",\n \"colmg\": \"column-gap\",\n \"colmr\": \"column-rule\",\n \"colmrc\": \"column-rule-color\",\n \"colmrs\": \"column-rule-style\",\n \"colmrw\": \"column-rule-width\",\n \"colms\": \"column-span\",\n \"colmw\": \"column-width\",\n \"cor\": \"counter-reset\",\n \"cp\": \"clip:auto|rect(${1:top} ${2:right} ${3:bottom} ${4:left})\",\n \"cps\": \"caption-side:top|bottom\",\n \"cur\": \"cursor:pointer|auto|default|crosshair|hand|help|move|pointer|text\",\n \"d\": \"display:block|none|flex|inline-flex|inline|inline-block|grid|inline-grid|subgrid|list-item|run-in|compact|table|inline-table|table-caption|table-column|table-column-group|table-header-group|table-footer-group|table-row|table-row-group|table-cell|ruby|ruby-base|ruby-base-group|ruby-text|ruby-text-group\",\n \"ec\": \"empty-cells:show|hide\",\n \"f\": \"font:${1:1em} ${2:sans-serif}\",\n \"fd\": \"font-display:auto|block|swap|fallback|optional\",\n \"fef\": \"font-effect:none|engrave|emboss|outline\",\n \"fem\": \"font-emphasize\",\n \"femp\": \"font-emphasize-position:before|after\",\n \"fems\": \"font-emphasize-style:none|accent|dot|circle|disc\",\n \"ff\": \"font-family:serif|sans-serif|cursive|fantasy|monospace\",\n \"fft\": 'font-family:\"Times New Roman\", Times, Baskerville, Georgia, serif',\n \"ffa\": 'font-family:Arial, \"Helvetica Neue\", Helvetica, sans-serif',\n \"ffv\": \"font-family:Verdana, Geneva, sans-serif\",\n \"fl\": \"float:left|right|none\",\n \"fs\": \"font-style:italic|normal|oblique\",\n \"fsm\": \"font-smoothing:antialiased|subpixel-antialiased|none\",\n \"fst\": \"font-stretch:normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded\",\n \"fv\": \"font-variant:normal|small-caps\",\n \"fvs\": \"font-variation-settings:normal|inherit|initial|unset\",\n \"fw\": \"font-weight:normal|bold|bolder|lighter\",\n \"fx\": \"flex\",\n \"fxb\": \"flex-basis:fill|max-content|min-content|fit-content|content\",\n \"fxd\": \"flex-direction:row|row-reverse|column|column-reverse\",\n \"fxf\": \"flex-flow\",\n \"fxg\": \"flex-grow\",\n \"fxsh\": \"flex-shrink\",\n \"fxw\": \"flex-wrap:nowrap|wrap|wrap-reverse\",\n \"fsz\": \"font-size\",\n \"fsza\": \"font-size-adjust\",\n \"gtc\": \"grid-template-columns:repeat(${0})|minmax()\",\n \"gtr\": \"grid-template-rows:repeat(${0})|minmax()\",\n \"gta\": \"grid-template-areas\",\n \"gt\": \"grid-template\",\n \"gg\": \"grid-gap\",\n \"gcg\": \"grid-column-gap\",\n \"grg\": \"grid-row-gap\",\n \"gac\": \"grid-auto-columns:auto|minmax()\",\n \"gar\": \"grid-auto-rows:auto|minmax()\",\n \"gaf\": \"grid-auto-flow:row|column|dense|inherit|initial|unset\",\n \"gd\": \"grid\",\n \"gc\": \"grid-column\",\n \"gcs\": \"grid-column-start\",\n \"gce\": \"grid-column-end\",\n \"gr\": \"grid-row\",\n \"grs\": \"grid-row-start\",\n \"gre\": \"grid-row-end\",\n \"ga\": \"grid-area\",\n \"h\": \"height\",\n \"jc\": \"justify-content:start|end|stretch|flex-start|flex-end|center|space-between|space-around|space-evenly\",\n \"ji\": \"justify-items:start|end|center|stretch\",\n \"js\": \"justify-self:start|end|center|stretch\",\n \"l\": \"left\",\n \"lg\": \"background-image:linear-gradient(${1})\",\n \"lh\": \"line-height\",\n \"lis\": \"list-style\",\n \"lisi\": \"list-style-image\",\n \"lisp\": \"list-style-position:inside|outside\",\n \"list\": \"list-style-type:disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman\",\n \"lts\": \"letter-spacing:normal\",\n \"m\": \"margin\",\n \"mah\": \"max-height\",\n \"mar\": \"max-resolution\",\n \"maw\": \"max-width\",\n \"mb\": \"margin-bottom\",\n \"mih\": \"min-height\",\n \"mir\": \"min-resolution\",\n \"miw\": \"min-width\",\n \"ml\": \"margin-left\",\n \"mr\": \"margin-right\",\n \"mt\": \"margin-top\",\n \"ol\": \"outline\",\n \"olc\": \"outline-color:${1:#000}|invert\",\n \"olo\": \"outline-offset\",\n \"ols\": \"outline-style:none|dotted|dashed|solid|double|groove|ridge|inset|outset\",\n \"olw\": \"outline-width|thin|medium|thick\",\n \"op|opa\": \"opacity\",\n \"ord\": \"order\",\n \"ori\": \"orientation:landscape|portrait\",\n \"orp\": \"orphans\",\n \"ov\": \"overflow:hidden|visible|hidden|scroll|auto\",\n \"ovs\": \"overflow-style:scrollbar|auto|scrollbar|panner|move|marquee\",\n \"ovx\": \"overflow-x:hidden|visible|hidden|scroll|auto\",\n \"ovy\": \"overflow-y:hidden|visible|hidden|scroll|auto\",\n \"p\": \"padding\",\n \"pb\": \"padding-bottom\",\n \"pgba\": \"page-break-after:auto|always|left|right\",\n \"pgbb\": \"page-break-before:auto|always|left|right\",\n \"pgbi\": \"page-break-inside:auto|avoid\",\n \"pl\": \"padding-left\",\n \"pos\": \"position:relative|absolute|relative|fixed|static\",\n \"pr\": \"padding-right\",\n \"pt\": \"padding-top\",\n \"q\": \"quotes\",\n \"qen\": \"quotes:'\\\\201C' '\\\\201D' '\\\\2018' '\\\\2019'\",\n \"qru\": \"quotes:'\\\\00AB' '\\\\00BB' '\\\\201E' '\\\\201C'\",\n \"r\": \"right\",\n \"rsz\": \"resize:none|both|horizontal|vertical\",\n \"t\": \"top\",\n \"ta\": \"text-align:left|center|right|justify\",\n \"tal\": \"text-align-last:left|center|right\",\n \"tbl\": \"table-layout:fixed\",\n \"td\": \"text-decoration:none|underline|overline|line-through\",\n \"te\": \"text-emphasis:none|accent|dot|circle|disc|before|after\",\n \"th\": \"text-height:auto|font-size|text-size|max-size\",\n \"ti\": \"text-indent\",\n \"tj\": \"text-justify:auto|inter-word|inter-ideograph|inter-cluster|distribute|kashida|tibetan\",\n \"to\": \"text-outline:${1:0} ${2:0} ${3:#000}\",\n \"tov\": \"text-overflow:ellipsis|clip\",\n \"tr\": \"text-replace\",\n \"trf\": \"transform:${1}|skewX(${1:angle})|skewY(${1:angle})|scale(${1:x}, ${2:y})|scaleX(${1:x})|scaleY(${1:y})|scaleZ(${1:z})|scale3d(${1:x}, ${2:y}, ${3:z})|rotate(${1:angle})|rotateX(${1:angle})|rotateY(${1:angle})|rotateZ(${1:angle})|translate(${1:x}, ${2:y})|translateX(${1:x})|translateY(${1:y})|translateZ(${1:z})|translate3d(${1:tx}, ${2:ty}, ${3:tz})\",\n \"trfo\": \"transform-origin\",\n \"trfs\": \"transform-style:preserve-3d\",\n \"trs\": \"transition:${1:prop} ${2:time}\",\n \"trsde\": \"transition-delay:${1:time}\",\n \"trsdu\": \"transition-duration:${1:time}\",\n \"trsp\": \"transition-property:${1:prop}\",\n \"trstf\": \"transition-timing-function:${1:fn}\",\n \"tsh\": \"text-shadow:${1:hoff} ${2:voff} ${3:blur} ${4:#000}\",\n \"tt\": \"text-transform:uppercase|lowercase|capitalize|none\",\n \"tw\": \"text-wrap:none|normal|unrestricted|suppress\",\n \"us\": \"user-select:none\",\n \"v\": \"visibility:hidden|visible|collapse\",\n \"va\": \"vertical-align:top|super|text-top|middle|baseline|bottom|text-bottom|sub\",\n \"w\": \"width\",\n \"whs\": \"white-space:nowrap|pre|pre-wrap|pre-line|normal\",\n \"whsc\": \"white-space-collapse:normal|keep-all|loose|break-strict|break-all\",\n \"wid\": \"widows\",\n \"wm\": \"writing-mode:lr-tb|lr-tb|lr-bt|rl-tb|rl-bt|tb-rl|tb-lr|bt-lr|bt-rl\",\n \"wob\": \"word-break:normal|keep-all|break-all\",\n \"wos\": \"word-spacing\",\n \"wow\": \"word-wrap:none|unrestricted|suppress|break-word|normal\",\n \"z\": \"z-index\",\n \"zom\": \"zoom:1\"\n };\n var xslSnippets = {\n \"tm|tmatch\": \"xsl:template[match mode]\",\n \"tn|tname\": \"xsl:template[name]\",\n \"call\": \"xsl:call-template[name]\",\n \"ap\": \"xsl:apply-templates[select mode]\",\n \"api\": \"xsl:apply-imports\",\n \"imp\": \"xsl:import[href]\",\n \"inc\": \"xsl:include[href]\",\n \"ch\": \"xsl:choose\",\n \"wh|xsl:when\": \"xsl:when[test]\",\n \"ot\": \"xsl:otherwise\",\n \"if\": \"xsl:if[test]\",\n \"par\": \"xsl:param[name]\",\n \"pare\": \"xsl:param[name select]\",\n \"var\": \"xsl:variable[name]\",\n \"vare\": \"xsl:variable[name select]\",\n \"wp\": \"xsl:with-param[name select]\",\n \"key\": \"xsl:key[name match use]\",\n \"elem\": \"xsl:element[name]\",\n \"attr\": \"xsl:attribute[name]\",\n \"attrs\": \"xsl:attribute-set[name]\",\n \"cp\": \"xsl:copy[select]\",\n \"co\": \"xsl:copy-of[select]\",\n \"val\": \"xsl:value-of[select]\",\n \"for|each\": \"xsl:for-each[select]\",\n \"tex\": \"xsl:text\",\n \"com\": \"xsl:comment\",\n \"msg\": \"xsl:message[terminate=no]\",\n \"fall\": \"xsl:fallback\",\n \"num\": \"xsl:number[value]\",\n \"nam\": \"namespace-alias[stylesheet-prefix result-prefix]\",\n \"pres\": \"xsl:preserve-space[elements]\",\n \"strip\": \"xsl:strip-space[elements]\",\n \"proc\": \"xsl:processing-instruction[name]\",\n \"sort\": \"xsl:sort[select order]\",\n \"choose\": \"xsl:choose>xsl:when+xsl:otherwise\",\n \"xsl\": \"!!!+xsl:stylesheet[version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform]>{\\n|}\",\n \"!!!\": '{<?xml version=\"1.0\" encoding=\"UTF-8\"?>}'\n };\n var pugSnippets = {\n \"!!!\": \"{doctype html}\"\n };\n var variables = {\n \"lang\": \"en\",\n \"locale\": \"en-US\",\n \"charset\": \"UTF-8\",\n \"indentation\": \"\t\",\n \"newline\": \"\\n\"\n };\n const defaultSyntaxes = {\n markup: \"html\",\n stylesheet: \"css\"\n };\n const defaultOptions$1 = {\n \"inlineElements\": [\n \"a\",\n \"abbr\",\n \"acronym\",\n \"applet\",\n \"b\",\n \"basefont\",\n \"bdo\",\n \"big\",\n \"br\",\n \"button\",\n \"cite\",\n \"code\",\n \"del\",\n \"dfn\",\n \"em\",\n \"font\",\n \"i\",\n \"iframe\",\n \"img\",\n \"input\",\n \"ins\",\n \"kbd\",\n \"label\",\n \"map\",\n \"object\",\n \"q\",\n \"s\",\n \"samp\",\n \"select\",\n \"small\",\n \"span\",\n \"strike\",\n \"strong\",\n \"sub\",\n \"sup\",\n \"textarea\",\n \"tt\",\n \"u\",\n \"var\"\n ],\n \"output.indent\": \"\t\",\n \"output.baseIndent\": \"\",\n \"output.newline\": \"\\n\",\n \"output.tagCase\": \"\",\n \"output.attributeCase\": \"\",\n \"output.attributeQuotes\": \"double\",\n \"output.format\": true,\n \"output.formatLeafNode\": false,\n \"output.formatSkip\": [\"html\"],\n \"output.formatForce\": [\"body\"],\n \"output.inlineBreak\": 3,\n \"output.compactBoolean\": false,\n \"output.booleanAttributes\": [\n \"contenteditable\",\n \"seamless\",\n \"async\",\n \"autofocus\",\n \"autoplay\",\n \"checked\",\n \"controls\",\n \"defer\",\n \"disabled\",\n \"formnovalidate\",\n \"hidden\",\n \"ismap\",\n \"loop\",\n \"multiple\",\n \"muted\",\n \"novalidate\",\n \"readonly\",\n \"required\",\n \"reversed\",\n \"selected\",\n \"typemustmatch\"\n ],\n \"output.reverseAttributes\": false,\n \"output.selfClosingStyle\": \"html\",\n \"output.field\": (index, placeholder) => placeholder,\n \"output.text\": (text2) => text2,\n \"markup.href\": true,\n \"comment.enabled\": false,\n \"comment.trigger\": [\"id\", \"class\"],\n \"comment.before\": \"\",\n \"comment.after\": \"\\n<!-- /[#ID][.CLASS] -->\",\n \"bem.enabled\": false,\n \"bem.element\": \"__\",\n \"bem.modifier\": \"_\",\n \"jsx.enabled\": false,\n \"stylesheet.keywords\": [\"auto\", \"inherit\", \"unset\", \"none\"],\n \"stylesheet.unitless\": [\"z-index\", \"line-height\", \"opacity\", \"font-weight\", \"zoom\", \"flex\", \"flex-grow\", \"flex-shrink\"],\n \"stylesheet.shortHex\": true,\n \"stylesheet.between\": \": \",\n \"stylesheet.after\": \";\",\n \"stylesheet.intUnit\": \"px\",\n \"stylesheet.floatUnit\": \"em\",\n \"stylesheet.unitAliases\": { e: \"em\", p: \"%\", x: \"ex\", r: \"rem\" },\n \"stylesheet.json\": false,\n \"stylesheet.jsonDoubleQuotes\": false,\n \"stylesheet.fuzzySearchMinScore\": 0\n };\n const defaultConfig$1 = {\n type: \"markup\",\n syntax: \"html\",\n variables,\n snippets: {},\n options: defaultOptions$1\n };\n const syntaxConfig = {\n markup: {\n snippets: parseSnippets(markupSnippets)\n },\n xhtml: {\n options: {\n \"output.selfClosingStyle\": \"xhtml\"\n }\n },\n xml: {\n options: {\n \"output.selfClosingStyle\": \"xml\"\n }\n },\n xsl: {\n snippets: parseSnippets(xslSnippets),\n options: {\n \"output.selfClosingStyle\": \"xml\"\n }\n },\n jsx: {\n options: {\n \"jsx.enabled\": true\n }\n },\n pug: {\n snippets: parseSnippets(pugSnippets)\n },\n stylesheet: {\n snippets: parseSnippets(stylesheetSnippets)\n },\n sass: {\n options: {\n \"stylesheet.after\": \"\"\n }\n },\n stylus: {\n options: {\n \"stylesheet.between\": \" \",\n \"stylesheet.after\": \"\"\n }\n }\n };\n function parseSnippets(snippets) {\n const result = {};\n Object.keys(snippets).forEach((k) => {\n for (const name of k.split(\"|\")) {\n result[name] = snippets[k];\n }\n });\n return result;\n }\n function resolveConfig(config2 = {}, globals = {}) {\n const type = config2.type || \"markup\";\n const syntax = config2.syntax || defaultSyntaxes[type];\n return Object.assign(Object.assign(Object.assign({}, defaultConfig$1), config2), {\n type,\n syntax,\n variables: mergedData(type, syntax, \"variables\", config2, globals),\n snippets: mergedData(type, syntax, \"snippets\", config2, globals),\n options: mergedData(type, syntax, \"options\", config2, globals)\n });\n }\n function mergedData(type, syntax, key, config2, globals = {}) {\n const typeDefaults = syntaxConfig[type];\n const typeOverride = globals[type];\n const syntaxDefaults = syntaxConfig[syntax];\n const syntaxOverride = globals[syntax];\n return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, defaultConfig$1[key]), typeDefaults && typeDefaults[key]), syntaxDefaults && syntaxDefaults[key]), typeOverride && typeOverride[key]), syntaxOverride && syntaxOverride[key]), config2[key]);\n }\n function backwardScanner(text2, start = 0) {\n return { text: text2, start, pos: text2.length };\n }\n function sol(scanner) {\n return scanner.pos === scanner.start;\n }\n function peek$1(scanner, offset = 0) {\n return scanner.text.charCodeAt(scanner.pos - 1 + offset);\n }\n function previous(scanner) {\n if (!sol(scanner)) {\n return scanner.text.charCodeAt(--scanner.pos);\n }\n }\n function consume(scanner, match) {\n if (sol(scanner)) {\n return false;\n }\n const ok = typeof match === \"function\" ? match(peek$1(scanner)) : match === peek$1(scanner);\n if (ok) {\n scanner.pos--;\n }\n return !!ok;\n }\n function consumeWhile(scanner, match) {\n const start = scanner.pos;\n while (consume(scanner, match)) {\n }\n return scanner.pos < start;\n }\n function isQuote$1(c) {\n return c === 39 || c === 34;\n }\n function consumeQuoted(scanner) {\n const start = scanner.pos;\n const quote2 = previous(scanner);\n if (isQuote$1(quote2)) {\n while (!sol(scanner)) {\n if (previous(scanner) === quote2 && peek$1(scanner) !== 92) {\n return true;\n }\n }\n }\n scanner.pos = start;\n return false;\n }\n const bracePairs = {\n [91]: 93,\n [40]: 41,\n [123]: 125\n };\n function isHtml(scanner) {\n const start = scanner.pos;\n if (!consume(scanner, 62)) {\n return false;\n }\n let ok = false;\n consume(scanner, 47);\n while (!sol(scanner)) {\n consumeWhile(scanner, isWhiteSpace$1);\n if (consumeIdent(scanner)) {\n if (consume(scanner, 47)) {\n ok = consume(scanner, 60);\n break;\n } else if (consume(scanner, 60)) {\n ok = true;\n break;\n } else if (consume(scanner, isWhiteSpace$1)) {\n continue;\n } else if (consume(scanner, 61)) {\n if (consumeIdent(scanner)) {\n continue;\n }\n break;\n } else if (consumeAttributeWithUnquotedValue(scanner)) {\n ok = true;\n break;\n }\n break;\n }\n if (consumeAttribute(scanner)) {\n continue;\n }\n break;\n }\n scanner.pos = start;\n return ok;\n }\n function consumeAttribute(scanner) {\n return consumeAttributeWithQuotedValue(scanner) || consumeAttributeWithUnquotedValue(scanner);\n }\n function consumeAttributeWithQuotedValue(scanner) {\n const start = scanner.pos;\n if (consumeQuoted(scanner) && consume(scanner, 61) && consumeIdent(scanner)) {\n return true;\n }\n scanner.pos = start;\n return false;\n }\n function consumeAttributeWithUnquotedValue(scanner) {\n const start = scanner.pos;\n const stack = [];\n while (!sol(scanner)) {\n const ch = peek$1(scanner);\n if (isCloseBracket(ch)) {\n stack.push(ch);\n } else if (isOpenBracket(ch)) {\n if (stack.pop() !== bracePairs[ch]) {\n break;\n }\n } else if (!isUnquotedValue(ch)) {\n break;\n }\n scanner.pos--;\n }\n if (start !== scanner.pos && consume(scanner, 61) && consumeIdent(scanner)) {\n return true;\n }\n scanner.pos = start;\n return false;\n }\n function consumeIdent(scanner) {\n return consumeWhile(scanner, isIdent);\n }\n function isIdent(ch) {\n return ch === 58 || ch === 45 || isAlpha(ch) || isNumber$2(ch);\n }\n function isAlpha(ch) {\n ch &= ~32;\n return ch >= 65 && ch <= 90;\n }\n function isNumber$2(ch) {\n return ch > 47 && ch < 58;\n }\n function isWhiteSpace$1(ch) {\n return ch === 32 || ch === 9;\n }\n function isUnquotedValue(ch) {\n return !isNaN(ch) && ch !== 61 && !isWhiteSpace$1(ch) && !isQuote$1(ch);\n }\n function isOpenBracket(ch) {\n return ch === 123 || ch === 40 || ch === 91;\n }\n function isCloseBracket(ch) {\n return ch === 125 || ch === 41 || ch === 93;\n }\n const code = (ch) => ch.charCodeAt(0);\n const specialChars = \"#.*:$-_!@%^+>/\".split(\"\").map(code);\n const defaultOptions$1$1 = {\n type: \"markup\",\n lookAhead: true,\n prefix: \"\"\n };\n function extractAbbreviation(line, pos = line.length, options = {}) {\n const opt2 = Object.assign(Object.assign({}, defaultOptions$1$1), options);\n pos = Math.min(line.length, Math.max(0, pos == null ? line.length : pos));\n if (opt2.lookAhead) {\n pos = offsetPastAutoClosed(line, pos, opt2);\n }\n let ch;\n const start = getStartOffset(line, pos, opt2.prefix || \"\");\n if (start === -1) {\n return void 0;\n }\n const scanner = backwardScanner(line, start);\n scanner.pos = pos;\n const stack = [];\n while (!sol(scanner)) {\n ch = peek$1(scanner);\n if (stack.includes(125)) {\n if (ch === 125) {\n stack.push(ch);\n scanner.pos--;\n continue;\n }\n if (ch !== 123) {\n scanner.pos--;\n continue;\n }\n }\n if (isCloseBrace(ch, opt2.type)) {\n stack.push(ch);\n } else if (isOpenBrace(ch, opt2.type)) {\n if (stack.pop() !== bracePairs[ch]) {\n break;\n }\n } else if (stack.includes(93) || stack.includes(125)) {\n scanner.pos--;\n continue;\n } else if (isHtml(scanner) || !isAbbreviation(ch)) {\n break;\n }\n scanner.pos--;\n }\n if (!stack.length && scanner.pos !== pos) {\n const abbreviation2 = line.slice(scanner.pos, pos).replace(/^[*+>^]+/, \"\");\n return {\n abbreviation: abbreviation2,\n location: pos - abbreviation2.length,\n start: options.prefix ? start - options.prefix.length : pos - abbreviation2.length,\n end: pos\n };\n }\n }\n function offsetPastAutoClosed(line, pos, options) {\n if (isQuote$1(line.charCodeAt(pos))) {\n pos++;\n }\n while (isCloseBrace(line.charCodeAt(pos), options.type)) {\n pos++;\n }\n return pos;\n }\n function getStartOffset(line, pos, prefix) {\n if (!prefix) {\n return 0;\n }\n const scanner = backwardScanner(line);\n const compiledPrefix = prefix.split(\"\").map(code);\n scanner.pos = pos;\n let result;\n while (!sol(scanner)) {\n if (consumePair(scanner, 93, 91) || consumePair(scanner, 125, 123)) {\n continue;\n }\n result = scanner.pos;\n if (consumeArray(scanner, compiledPrefix)) {\n return result;\n }\n scanner.pos--;\n }\n return -1;\n }\n function consumePair(scanner, close, open) {\n const start = scanner.pos;\n if (consume(scanner, close)) {\n while (!sol(scanner)) {\n if (consume(scanner, open)) {\n return true;\n }\n scanner.pos--;\n }\n }\n scanner.pos = start;\n return false;\n }\n function consumeArray(scanner, arr) {\n const start = scanner.pos;\n let consumed = false;\n for (let i = arr.length - 1; i >= 0 && !sol(scanner); i--) {\n if (!consume(scanner, arr[i])) {\n break;\n }\n consumed = i === 0;\n }\n if (!consumed) {\n scanner.pos = start;\n }\n return consumed;\n }\n function isAbbreviation(ch) {\n return ch > 64 && ch < 91 || ch > 96 && ch < 123 || ch > 47 && ch < 58 || specialChars.includes(ch);\n }\n function isOpenBrace(ch, syntax) {\n return ch === 40 || syntax === \"markup\" && (ch === 91 || ch === 123);\n }\n function isCloseBrace(ch, syntax) {\n return ch === 41 || syntax === \"markup\" && (ch === 93 || ch === 125);\n }\n function expandAbbreviation$1(abbr, config2) {\n const resolvedConfig = resolveConfig(config2);\n return resolvedConfig.type === \"stylesheet\" ? stylesheet(abbr, resolvedConfig) : markup(abbr, resolvedConfig);\n }\n function markup(abbr, config2) {\n return stringify(parse$1(abbr, config2), config2);\n }\n function stylesheet(abbr, config2) {\n return css(parse$1$1(abbr, config2), config2);\n }\n const tabStopStart = String.fromCodePoint(65520);\n const tabStopEnd = String.fromCodePoint(65521);\n function getCaret(state) {\n return state.selection.main.from;\n }\n function substr(state, range) {\n return state.doc.sliceString(range.from, range.to);\n }\n function contains(range, pos) {\n return pos >= range.from && pos <= range.to;\n }\n function isQuote(ch) {\n return ch === '\"' || ch === \"'\";\n }\n function getAttributeValueRange(state, node) {\n let { from, to } = node;\n const value = substr(state, node);\n if (isQuote(value[0])) {\n from++;\n }\n if (isQuote(value[value.length - 1])) {\n to--;\n }\n return { from, to };\n }\n function getTagAttributes(state, node) {\n const result = {};\n for (const attr of node.getChildren(\"Attribute\")) {\n const attrNameNode = attr.getChild(\"AttributeName\");\n if (attrNameNode) {\n const attrName2 = substr(state, attrNameNode);\n const attrValueNode = attr.getChild(\"AttributeValue\");\n result[attrName2] = attrValueNode ? substr(state, getAttributeValueRange(state, attrValueNode)) : null;\n }\n }\n return result;\n }\n function rangeEmpty(r) {\n return r.from === r.to;\n }\n function last(arr) {\n return arr.length > 0 ? arr[arr.length - 1] : void 0;\n }\n function getSelectionsFromSnippet(snippet2, base = 0) {\n const ranges = [];\n let result = \"\";\n let sel = null;\n let offset = 0;\n let i = 0;\n let ch;\n while (i < snippet2.length) {\n ch = snippet2.charAt(i++);\n if (ch === tabStopStart || ch === tabStopEnd) {\n result += snippet2.slice(offset, i - 1);\n offset = i;\n if (ch === tabStopStart) {\n sel = {\n from: base + result.length,\n to: base + result.length\n };\n ranges.push(sel);\n } else if (sel) {\n sel = null;\n }\n }\n }\n if (!ranges.length) {\n ranges.push({\n from: snippet2.length + base,\n to: snippet2.length + base\n });\n }\n return {\n ranges,\n snippet: result + snippet2.slice(offset)\n };\n }\n const nodeToHTMLType = {\n OpenTag: \"open\",\n CloseTag: \"close\",\n SelfClosingTag: \"selfClose\"\n };\n function getContext(state, pos) {\n if (cssLanguage.isActiveAt(state, pos)) {\n return getCSSContext(state, pos);\n }\n if (htmlLanguage.isActiveAt(state, pos)) {\n return getHTMLContext(state, pos);\n }\n return;\n }\n function getCSSContext(state, pos, embedded) {\n const result = {\n type: \"css\",\n ancestors: [],\n current: null,\n inline: false,\n embedded\n };\n const tree = syntaxTree(state).resolveInner(pos, -1);\n const stack = [];\n for (let node = tree; node; node = node.parent) {\n if (node.name === \"RuleSet\") {\n const sel = getSelectorRange(node);\n stack.push({\n name: substr(state, sel),\n type: \"selector\",\n range: node\n });\n } else if (node.name === \"Declaration\") {\n const { name, value } = getPropertyRanges(node);\n if (value && contains(value, pos)) {\n stack.push({\n name: substr(state, value),\n type: \"propertyValue\",\n range: value\n });\n }\n if (name) {\n stack.push({\n name: substr(state, name),\n type: \"propertyName\",\n range: name\n });\n }\n }\n }\n const tip = stack.shift();\n if (tip) {\n const range = tip.type === \"selector\" ? { from: tip.range.from, to: tip.range.from + tip.name.length } : tip.range;\n if (contains(range, pos)) {\n result.current = tip;\n tip.range = range;\n } else {\n stack.unshift(tip);\n }\n }\n result.ancestors = stack.reverse();\n return result;\n }\n function getHTMLContext(state, pos) {\n const result = {\n type: \"html\",\n ancestors: [],\n current: null\n };\n const tree = syntaxTree(state).resolveInner(pos);\n for (let node = tree; node; node = node ? node.parent : null) {\n if (node.name in nodeToHTMLType) {\n const m = getContextMatchFromTag(state, node);\n if (m) {\n result.current = __spreadProps(__spreadValues({}, m), {\n type: nodeToHTMLType[node.name]\n });\n node = node.parent;\n }\n } else if (node.name === \"Element\") {\n const child = node.getChild(\"OpenTag\");\n if (child) {\n const m = getContextMatchFromTag(state, child);\n if (m) {\n result.ancestors.push(m);\n }\n }\n }\n }\n result.ancestors.reverse();\n detectCSSContextFromHTML(state, pos, result);\n return result;\n }\n function detectCSSContextFromHTML(state, pos, ctx) {\n var _a;\n if (((_a = ctx.current) == null ? void 0 : _a.type) === \"open\") {\n let node = syntaxTree(state).resolve(ctx.current.range.from, 1);\n while (node && node.name !== \"OpenTag\") {\n node = node.parent;\n }\n if (node) {\n for (const attr of node.getChildren(\"Attribute\")) {\n if (attr.from > pos) {\n break;\n }\n if (contains(attr, pos) && getAttributeName(state, attr) === \"style\") {\n const attrValue = attr.getChild(\"AttributeValue\");\n if (attrValue) {\n const cleanValueRange = getAttributeValueRange(state, attrValue);\n if (contains(cleanValueRange, pos)) {\n ctx.css = getInlineCSSContext(substr(state, cleanValueRange), pos - cleanValueRange.from, cleanValueRange.from);\n }\n }\n }\n }\n }\n }\n }\n function getContextMatchFromTag(state, node) {\n const tagName2 = node.getChild(\"TagName\");\n if (tagName2) {\n return {\n name: substr(state, tagName2).toLowerCase(),\n range: node\n };\n }\n }\n function getSelectorRange(node) {\n let from = node.from;\n let to = from;\n for (let child = node.firstChild; child && child.name !== \"Block\"; child = child.nextSibling) {\n to = child.to;\n }\n return { from, to };\n }\n function getPropertyRanges(node) {\n let name;\n let value;\n let ptr = node.firstChild;\n if ((ptr == null ? void 0 : ptr.name) === \"PropertyName\") {\n name = ptr;\n ptr = ptr.nextSibling;\n if ((ptr == null ? void 0 : ptr.name) === \":\") {\n ptr = ptr.nextSibling;\n }\n if (ptr) {\n value = {\n from: ptr.from,\n to: node.lastChild.to\n };\n }\n }\n return { name, value };\n }\n function getAttributeName(state, node) {\n const name = node.getChild(\"AttributeName\");\n return name ? substr(state, name).toLowerCase() : \"\";\n }\n function getInlineCSSContext(code2, pos, base = 0) {\n const result = {\n type: \"css\",\n ancestors: [],\n current: null,\n inline: true,\n embedded: {\n from: pos + base,\n to: pos + base + code2.length\n }\n };\n const props = parseInlineProps(code2, pos);\n for (const prop of props) {\n if (prop.value && contains(prop.value, pos)) {\n result.current = {\n name: code2.substring(prop.value.from, prop.value.to).trim(),\n type: \"propertyValue\",\n range: {\n from: base + prop.value.from,\n to: base + prop.value.to\n }\n };\n result.ancestors.push({\n name: code2.substring(prop.name.from, prop.name.to).trim(),\n type: \"propertyName\",\n range: {\n from: base + prop.name.from,\n to: base + prop.value.to\n }\n });\n break;\n } else if (contains(prop.name, pos)) {\n const end = prop.value ? prop.value.to : prop.name.to;\n result.current = {\n name: code2.substring(prop.name.from, prop.name.to).trim(),\n type: \"propertyName\",\n range: {\n from: base + prop.name.from,\n to: base + end\n }\n };\n break;\n }\n }\n return result;\n }\n function parseInlineProps(code2, limit = code2.length) {\n var _a;\n const space = \" \t\\n\\r\";\n const propList = [];\n let prop;\n for (let i = 0; i < code2.length; i++) {\n const ch = code2[i];\n if (prop) {\n if (prop.value) {\n if (prop.value.from !== -1) {\n prop.value.to = i;\n }\n } else {\n prop.name.to = i;\n }\n }\n if (ch === \";\") {\n prop = void 0;\n if (i > limit) {\n break;\n }\n } else if (ch === \":\") {\n if (prop && !prop.value) {\n prop.value = { from: -1, to: -1 };\n }\n } else {\n if (prop) {\n if (((_a = prop.value) == null ? void 0 : _a.from) === -1 && !space.includes(ch)) {\n prop.value.from = prop.value.to = i;\n }\n } else if (!space.includes(ch)) {\n prop = {\n name: { from: i, to: i }\n };\n propList.push(prop);\n }\n }\n }\n if (prop) {\n if (prop.value) {\n prop.value.to++;\n } else {\n prop.name.to++;\n }\n }\n return propList;\n }\n const xmlSyntaxes = [\"xml\", \"xsl\", \"jsx\"];\n const htmlSyntaxes = [\"html\", \"htmlmixed\", \"vue\"];\n const cssSyntaxes = [\"css\", \"scss\", \"less\"];\n const jsxSyntaxes = [\"jsx\", \"tsx\"];\n const stylesheetSyntaxes = [\"sass\", \"sss\", \"stylus\", \"postcss\"].concat(cssSyntaxes);\n function syntaxInfo(state, ctx) {\n let syntax = docSyntax(state);\n let inline;\n let context = typeof ctx === \"number\" ? getContext(state, ctx) : ctx;\n if ((context == null ? void 0 : context.type) === \"html\" && context.css) {\n inline = true;\n syntax = \"css\";\n context = context.css;\n } else if ((context == null ? void 0 : context.type) === \"css\") {\n syntax = \"css\";\n }\n return {\n type: getSyntaxType(syntax),\n syntax,\n inline,\n context\n };\n }\n function docSyntax(state) {\n const topLang = state.facet(language);\n if (topLang === cssLanguage) {\n return \"css\";\n }\n if (topLang === htmlLanguage) {\n return \"html\";\n }\n return \"\";\n }\n function getSyntaxType(syntax) {\n return syntax && stylesheetSyntaxes.includes(syntax) ? \"stylesheet\" : \"markup\";\n }\n function isXML(syntax) {\n return syntax ? xmlSyntaxes.includes(syntax) : false;\n }\n function isHTML(syntax) {\n return syntax ? htmlSyntaxes.includes(syntax) || isXML(syntax) : false;\n }\n function isCSS(syntax) {\n return syntax ? cssSyntaxes.includes(syntax) : false;\n }\n function isJSX(syntax) {\n return syntax ? jsxSyntaxes.includes(syntax) : false;\n }\n function getMarkupAbbreviationContext(state, ctx) {\n const parent = last(ctx.ancestors);\n if (parent) {\n let node = syntaxTree(state).resolve(parent.range.from, 1);\n while (node && node.name !== \"OpenTag\") {\n node = node.parent;\n }\n return {\n name: parent.name,\n attributes: node ? getTagAttributes(state, node) : {}\n };\n }\n return;\n }\n function getStylesheetAbbreviationContext(ctx) {\n if (ctx.inline) {\n return { name: \"@@property\" };\n }\n const parent = last(ctx.ancestors);\n let scope = \"@@global\";\n if (ctx.current) {\n if (ctx.current.type === \"propertyValue\" && parent) {\n scope = parent.name;\n } else if ((ctx.current.type === \"selector\" || ctx.current.type === \"propertyName\") && !parent) {\n scope = \"@@section\";\n }\n } else if (!parent) {\n scope = \"@@section\";\n }\n return {\n name: scope\n };\n }\n let cache = {};\n function expand(state, abbr, config2) {\n let opt2 = { cache };\n const outputOpt = {\n \"output.field\": field\n };\n if (config2) {\n Object.assign(opt2, config2);\n if (config2.options) {\n Object.assign(outputOpt, config2.options);\n }\n }\n opt2.options = outputOpt;\n const pluginConfig = getEmmetConfig(state);\n if (pluginConfig.config) {\n opt2 = resolveConfig(opt2, pluginConfig.config);\n }\n return expandAbbreviation$1(abbr, opt2);\n }\n function extract$1(code2, pos, type = \"markup\", options) {\n return extractAbbreviation(code2, pos, __spreadValues({\n lookAhead: type !== \"stylesheet\",\n type\n }, options));\n }\n function getOptions(state, pos) {\n const info = syntaxInfo(state, pos);\n const { context } = info;\n const config2 = {\n type: info.type,\n syntax: info.syntax || \"html\",\n options: getOutputOptions(state, info.inline)\n };\n if (context) {\n if (context.type === \"html\" && context.ancestors.length) {\n config2.context = getMarkupAbbreviationContext(state, context);\n } else if (context.type === \"css\") {\n config2.context = getStylesheetAbbreviationContext(context);\n }\n }\n return config2;\n }\n function resetCache() {\n cache = {};\n }\n const defaultConfig = {\n mark: true,\n preview: {},\n previewEnabled: true,\n autoRenameTags: true,\n markTagPairs: true,\n previewOpenTag: false,\n attributeQuotes: \"double\",\n markupStyle: \"html\",\n comments: false,\n commentsTemplate: \"<!-- /[#ID][.CLASS] -->\",\n bem: false,\n completionBoost: 99\n };\n const config = Facet.define({\n combine(value) {\n resetCache();\n const baseConfig = __spreadValues({}, defaultConfig);\n const { preview } = baseConfig;\n for (const item of value) {\n Object.assign(baseConfig, item);\n if (item.preview) {\n baseConfig.preview = __spreadValues(__spreadValues({}, preview), item.preview);\n }\n }\n return baseConfig;\n }\n });\n function getEmmetConfig(state, opt2) {\n let conf = state.facet(config);\n if (opt2) {\n conf = __spreadValues(__spreadValues({}, conf), opt2);\n }\n return conf;\n }\n function getOutputOptions(state, inline) {\n const syntax = docSyntax(state) || \"html\";\n const config2 = getEmmetConfig(state);\n const opt2 = {\n \"output.field\": field,\n \"output.indent\": \"\t\",\n \"output.format\": !inline,\n \"output.attributeQuotes\": config2.attributeQuotes,\n \"stylesheet.shortHex\": config2.shortHex\n };\n if (syntax === \"html\") {\n opt2[\"output.selfClosingStyle\"] = config2.markupStyle;\n opt2[\"output.compactBoolean\"] = config2.markupStyle === \"html\";\n }\n if (isHTML(syntax)) {\n if (config2.comments) {\n opt2[\"comment.enabled\"] = true;\n if (config2.commentsTemplate) {\n opt2[\"comment.after\"] = config2.commentsTemplate;\n }\n }\n opt2[\"bem.enabled\"] = config2.bem;\n }\n return opt2;\n }\n function field(index, placeholder) {\n return placeholder ? `\\${${index}:${placeholder}}` : `\\${${index}}`;\n }\n function createPreview(value, syntax, options) {\n const elem = document.createElement(\"div\");\n elem.className = \"emmet-preview\";\n if (syntax === \"error\") {\n elem.classList.add(\"emmet-preview_error\");\n }\n let ext = syntax === \"css\" ? css$1 : html$1;\n if (options && syntax in options) {\n ext = options[syntax];\n }\n const view = new EditorView({\n doc: value,\n extensions: [\n EditorState.readOnly.of(true),\n syntaxHighlighting(defaultHighlightStyle, { fallback: true }),\n syntax === \"css\" ? css$1() : html$1(),\n ext()\n ],\n parent: elem\n });\n elem.update = (nextValue) => {\n const tr = view.state.update({\n changes: {\n from: 0,\n to: view.state.doc.length,\n insert: nextValue\n }\n });\n view.dispatch(tr);\n };\n return elem;\n }\n const icon = \"data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM5MyIgdmlld0JveD0iMCAwIDM5MyAzOTMiIHdpZHRoPSIzOTMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxkZWZzPjxsaW5lYXJHcmFkaWVudCBpZD0iYSIgeDE9Ijk4LjYwODY5JSIgeDI9IjUwJSIgeTE9IjUwJSIgeTI9IjUwJSI+PHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjY2VmYmFkIi8+PHN0b3Agb2Zmc2V0PSIuODM2OTcyNTM1IiBzdG9wLWNvbG9yPSIjY2VmYmFkIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLW9wYWNpdHk9IjAiLz48L2xpbmVhckdyYWRpZW50PjxwYXRoIGlkPSJiIiBkPSJtMTE2IDQ4IDEwNSA2M3YzNC45ODVsLTc1LTQ0Ljk5OTI4OXY2Ny42NjcyODlsNDkuNSAyOS4zNDctNDkuNSAyOS4zNDZ2NjcuNjY4Mjg5bDc1LTQ1LjAwMDI4OXYzNC45ODZsLTEwNSA2M3ptMTQ1IDg3IDEwNSA2My0xMDUgNjN2LTM0Ljk4Nmw0Ni42OTA0ODEtMjguMDE0LTQ2LjY5MDQ4MS0yOC4wMTR6Ii8+PC9kZWZzPjxnIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgdHJhbnNmb3JtPSJtYXRyaXgoLjcwNzEwNjc4IC0uNzA3MTA2NzggLjcwNzEwNjc4IC43MDcxMDY3OCAtODEuMzkyOTY1IDE5Ni41KSI+PGNpcmNsZSBjeD0iMTk2LjUiIGN5PSIxOTYuNSIgZmlsbD0iIzI1MjcyYiIgcj0iMTk2LjUiLz48dXNlIGZpbGw9IiM5MmMxMzEiIHhsaW5rOmhyZWY9IiNiIi8+PHVzZSBmaWxsPSJ1cmwoI2EpIiB4bGluazpocmVmPSIjYiIvPjwvZz48L3N2Zz4=\";\n const emmetCompletionSource = (context) => {\n const tracker2 = context.state.field(trackerField);\n if ((tracker2 == null ? void 0 : tracker2.type) === \"abbreviation\" && tracker2.preview) {\n return {\n from: tracker2.range.from,\n to: tracker2.range.to,\n filter: false,\n update(current, _from, _to, context2) {\n const tracker3 = context2.state.field(trackerField);\n if (!tracker3 || tracker3.type === \"error\") {\n return null;\n }\n return __spreadProps(__spreadValues({}, current), {\n from: tracker3.range.from,\n to: tracker3.range.to,\n options: completionOptionsFromTracker(context2.state, tracker3)\n });\n },\n options: completionOptionsFromTracker(context.state, tracker2)\n };\n }\n return null;\n };\n const cssCompletion = cssLanguage.data.of({ autocomplete: emmetCompletionSource });\n const JSX_PREFIX = \"<\";\n const trackerMark = Decoration.mark({ class: \"emmet-tracker\" });\n const resetTracker = StateEffect.define();\n const forceTracker = StateEffect.define();\n const trackerField = StateField.define({\n create: () => null,\n update(value, tr) {\n const hasCompletion = tr.annotation(pickedCompletion);\n if (hasCompletion) {\n return null;\n }\n for (const effect of tr.effects) {\n if (effect.is(resetTracker)) {\n return null;\n }\n if (effect.is(forceTracker)) {\n const sel = tr.newSelection.main;\n const config2 = getActivationContext(tr.state, sel.from);\n if (config2) {\n return createTracker(tr.state, sel, {\n forced: true,\n config: config2\n });\n }\n }\n }\n if (!tr.docChanged) {\n return value;\n }\n return handleUpdate(tr.state, value, tr);\n }\n });\n const abbreviationPreview = StateField.define({\n create: getAbbreviationPreview,\n update(tooltip, tr) {\n if (!tr.docChanged && !tr.selection) {\n const tracker2 = tr.state.field(trackerField);\n return tracker2 ? tooltip : null;\n }\n return getAbbreviationPreview(tr.state, tooltip);\n },\n provide: (f) => showTooltip.from(f)\n });\n function getAbbreviationPreview(state, prevTooltip) {\n const tracker2 = state.field(trackerField);\n if (tracker2 && !tracker2.inactive && completionStatus(state) !== \"active\") {\n if (tracker2.config.type === \"stylesheet\") {\n return null;\n }\n if (prevTooltip && prevTooltip.tracker.type !== tracker2.type) {\n prevTooltip = null;\n }\n const { range } = tracker2;\n if (canDisplayPreview(state, tracker2)) {\n return prevTooltip || {\n pos: range.from,\n above: false,\n arrow: false,\n tracker: tracker2,\n create() {\n const previewConfig = state.facet(config).preview;\n let preview = \"\";\n let syntax = \"\";\n if (tracker2.type === \"error\") {\n preview = tracker2.error.message;\n syntax = \"error\";\n } else {\n preview = tracker2.preview;\n syntax = tracker2.config.syntax || \"html\";\n }\n const dom = createPreview(preview, syntax, previewConfig);\n return {\n dom,\n update({ state: state2 }) {\n const tracker3 = state2.field(trackerField);\n if (tracker3 && dom.update) {\n const value = tracker3.type === \"error\" ? tracker3.error.message : tracker3.preview;\n dom.update(value);\n }\n }\n };\n }\n };\n }\n }\n return null;\n }\n const abbreviationTracker = ViewPlugin.fromClass(class {\n constructor() {\n __publicField(this, \"decorations\");\n this.decorations = Decoration.none;\n }\n update(update) {\n const { state } = update;\n const tracker2 = state.field(trackerField);\n const decors = [];\n if (tracker2 && !tracker2.inactive) {\n const { range } = tracker2;\n if (!rangeEmpty(range)) {\n decors.push(trackerMark.range(range.from, range.to));\n }\n this.decorations = Decoration.set(decors, true);\n } else {\n this.decorations = Decoration.none;\n }\n }\n }, {\n decorations: (v) => v.decorations\n });\n function expandTracker(view, tracker2) {\n const { from, to } = tracker2.range;\n const expanded = expand(view.state, tracker2.abbreviation, tracker2.config);\n const fn = snippet(expanded);\n view.dispatch(view.state.update({\n effects: resetTracker.of(null)\n }));\n fn(view, { label: \"expand\" }, from, to);\n }\n const tabKeyHandler = (view) => {\n const { state } = view;\n if (completionStatus(state)) {\n return false;\n }\n const tracker2 = state.field(trackerField, false);\n if (tracker2 && !tracker2.inactive && contains(tracker2.range, getCaret(state))) {\n expandTracker(view, tracker2);\n return true;\n }\n return false;\n };\n const escKeyHandler = ({ state, dispatch }) => {\n const tracker2 = state.field(trackerField, false);\n if (tracker2) {\n dispatch({\n effects: resetTracker.of(null)\n });\n return true;\n }\n return false;\n };\n const trackerTheme = EditorView.baseTheme({\n \".emmet-tracker\": {\n textDecoration: \"underline 1px green\"\n },\n \".emmet-preview\": {\n fontSize: \"0.9em\"\n },\n \".emmet-preview_error\": {\n color: \"red\"\n },\n \".cm-completionIcon-emmet::after\": {\n content: '\" \"',\n background: `url(\"${icon}\") center/contain no-repeat`,\n display: \"inline-block\",\n width: \"11px\",\n height: \"11px\",\n verticalAlign: \"middle\"\n }\n });\n function tracker(options) {\n return [\n trackerField,\n abbreviationTracker,\n abbreviationPreview,\n trackerTheme,\n cssCompletion,\n options ? config.of(options) : [],\n keymap.of([{\n key: \"Tab\",\n run: tabKeyHandler\n }, {\n key: \"Escape\",\n run: escKeyHandler\n }])\n ];\n }\n function typingAbbreviation(state, pos, input) {\n if (input.length !== 1) {\n return null;\n }\n const line = state.doc.lineAt(pos);\n const prefix = line.text.substring(Math.max(0, pos - line.from - 1), pos - line.from);\n if (!canStartTyping(prefix, input, getSyntaxFromPos(state, pos))) {\n return null;\n }\n const config2 = getActivationContext(state, pos);\n if (!config2) {\n return null;\n }\n if (config2.type === \"stylesheet\" && !canStartTyping(prefix, input, \"css\")) {\n return null;\n }\n const syntax = config2.syntax || \"html\";\n let from = pos;\n let to = pos + input.length;\n let offset = 0;\n if (isJSX(syntax) && prefix === JSX_PREFIX) {\n offset = JSX_PREFIX.length;\n from -= offset;\n }\n return createTracker(state, { from, to }, { config: config2 });\n }\n function getActivationContext(state, pos) {\n if (cssLanguage.isActiveAt(state, pos)) {\n return getCSSActivationContext(state, pos, \"css\", getCSSContext(state, pos));\n }\n const syntax = docSyntax(state);\n if (isHTML(syntax)) {\n const ctx = getHTMLContext(state, pos);\n if (ctx.css) {\n return getCSSActivationContext(state, pos, \"css\", ctx.css);\n }\n if (!ctx.current) {\n return {\n syntax,\n type: \"markup\",\n context: getMarkupAbbreviationContext(state, ctx),\n options: getOutputOptions(state)\n };\n }\n } else {\n return {\n syntax,\n type: getSyntaxType(syntax),\n options: getOutputOptions(state)\n };\n }\n return void 0;\n }\n function getCSSActivationContext(state, pos, syntax, ctx) {\n const allowedContext = !ctx.current || ctx.current.type === \"propertyName\" || ctx.current.type === \"propertyValue\" || isTypingBeforeSelector(state, pos, ctx);\n if (allowedContext) {\n return {\n syntax,\n type: \"stylesheet\",\n context: getStylesheetAbbreviationContext(ctx),\n options: getOutputOptions(state, ctx.inline)\n };\n }\n return;\n }\n function isTypingBeforeSelector(state, pos, { current }) {\n if ((current == null ? void 0 : current.type) === \"selector\" && current.range.from === pos - 1) {\n const line = state.doc.lineAt(current.range.from);\n return line.text.trim().length === 1;\n }\n return false;\n }\n function isValidPrefix(prefix, syntax) {\n if (isJSX(syntax)) {\n return prefix === JSX_PREFIX;\n }\n if (isCSS(syntax)) {\n return prefix === \"\" || /^[\\s>;\"\\']$/.test(prefix);\n }\n return prefix === \"\" || /^[\\s>;\"\\']$/.test(prefix);\n }\n function isValidAbbreviationStart(input, syntax) {\n if (isJSX(syntax)) {\n return /^[a-zA-Z.#\\[\\(]$/.test(input);\n }\n if (isCSS(syntax)) {\n return /^[a-zA-Z!@#]$/.test(input);\n }\n return /^[a-zA-Z.#!@\\[\\(]$/.test(input);\n }\n function createTracker(state, range, params) {\n if (range.from > range.to) {\n return null;\n }\n let abbreviation2 = substr(state, range);\n const { config: config2, forced } = params;\n if (params.offset) {\n abbreviation2 = abbreviation2.slice(params.offset);\n }\n if (!abbreviation2 && !forced || hasInvalidChars(abbreviation2)) {\n return null;\n }\n const base = {\n abbreviation: abbreviation2,\n range,\n config: config2,\n forced: !!forced,\n inactive: false,\n offset: params.offset || 0\n };\n try {\n let parsedAbbr;\n let simple = false;\n if (config2.type === \"markup\") {\n parsedAbbr = parseAbbreviation(abbreviation2, {\n jsx: config2.syntax === \"jsx\"\n });\n simple = isSimpleMarkupAbbreviation(parsedAbbr);\n }\n const previewConfig = createPreviewConfig(config2);\n const preview = expand(state, parsedAbbr || abbreviation2, previewConfig);\n if (!preview) {\n return null;\n }\n return __spreadProps(__spreadValues({}, base), {\n type: \"abbreviation\",\n simple,\n preview\n });\n } catch (error2) {\n return base.forced ? __spreadProps(__spreadValues({}, base), {\n type: \"error\",\n error: error2\n }) : null;\n }\n }\n function hasInvalidChars(abbreviation2) {\n return /[\\r\\n]/.test(abbreviation2);\n }\n function isSimpleMarkupAbbreviation(abbr) {\n if (abbr.children.length === 1 && !abbr.children[0].children.length) {\n const first = abbr.children[0];\n return !first.name || /^[a-z]/i.test(first.name);\n }\n return !abbr.children.length;\n }\n function createPreviewConfig(config2) {\n return __spreadProps(__spreadValues({}, config2), {\n options: __spreadProps(__spreadValues({}, config2.options), {\n \"output.field\": previewField,\n \"output.indent\": \" \",\n \"output.baseIndent\": \"\"\n })\n });\n }\n function previewField(_, placeholder) {\n return placeholder;\n }\n function handleUpdate(state, tracker2, update) {\n if (hasSnippet(state)) {\n return null;\n }\n if (!tracker2 || tracker2.inactive) {\n update.changes.iterChanges((_fromA, _toA, fromB, _toB, text2) => {\n if (text2.length) {\n tracker2 = typingAbbreviation(state, fromB, text2.toString()) || tracker2;\n }\n });\n if (!tracker2 || !tracker2.inactive) {\n return tracker2;\n }\n }\n update.changes.iterChanges((fromA, toA, fromB, toB, text2) => {\n if (!tracker2) {\n return;\n }\n const { range } = tracker2;\n if (!contains(range, fromA)) {\n if (!tracker2.inactive) {\n tracker2 = null;\n }\n } else if (contains(range, fromB)) {\n const removed = toA - fromA;\n const inserted = toB - fromA;\n const to = range.to + inserted - removed;\n if (to <= range.from || hasInvalidChars(text2.toString())) {\n tracker2 = null;\n } else {\n const abbrRange = tracker2.inactive ? range : { from: range.from, to };\n const nextTracker = createTracker(state, abbrRange, {\n config: tracker2.config,\n forced: tracker2.forced\n });\n if (!nextTracker) {\n tracker2 = __spreadProps(__spreadValues({}, tracker2), { inactive: true });\n } else {\n tracker2 = nextTracker;\n }\n }\n }\n });\n return tracker2;\n }\n function getSyntaxFromPos(state, pos) {\n if (cssLanguage.isActiveAt(state, pos)) {\n return \"css\";\n }\n if (htmlLanguage.isActiveAt(state, pos)) {\n return \"html\";\n }\n return \"\";\n }\n function canStartTyping(prefix, input, syntax) {\n return isValidPrefix(prefix, syntax) && isValidAbbreviationStart(input, syntax);\n }\n function hasSnippet(state) {\n if (Array.isArray(state.values)) {\n return state.values.some((item) => {\n var _a;\n return item && ((_a = item.constructor) == null ? void 0 : _a.name) === \"ActiveSnippet\";\n });\n }\n return false;\n }\n function canDisplayPreview(state, tracker2) {\n if (completionStatus(state) === \"active\") {\n return false;\n }\n const config2 = getEmmetConfig(state);\n if (!config2.previewEnabled) {\n return false;\n }\n if (Array.isArray(config2.previewEnabled)) {\n const { type, syntax } = tracker2.config;\n if (!config2.previewEnabled.includes(type) && !config2.previewEnabled.includes(syntax)) {\n return false;\n }\n }\n return tracker2.type === \"error\" || (!tracker2.simple || tracker2.forced) && !!tracker2.abbreviation && contains(tracker2.range, getCaret(state));\n }\n function completionOptionsFromTracker(state, tracker2, prev2) {\n const opt2 = state.facet(config);\n return [{\n label: \"Emmet abbreviation\",\n type: \"emmet\",\n boost: opt2.completionBoost,\n tracker: tracker2,\n previewConfig: opt2.preview,\n preview: prev2 == null ? void 0 : prev2.preview,\n info: completionInfo,\n apply: (view, completion) => {\n view.dispatch({\n annotations: pickedCompletion.of(completion)\n });\n expandTracker(view, tracker2);\n }\n }];\n }\n function completionInfo(completion) {\n let { tracker: tracker2, previewConfig, preview } = completion;\n if (preview == null ? void 0 : preview.update) {\n preview.update(tracker2.preview);\n } else {\n completion.preview = preview = createPreview(tracker2.preview, tracker2.config.syntax || \"html\", previewConfig);\n }\n return preview;\n }\n const expandAbbreviation = ({ state, dispatch }) => {\n const sel = state.selection.main;\n const line = state.doc.lineAt(sel.anchor);\n const options = getOptions(state, sel.anchor);\n const abbr = extract$1(line.text, sel.anchor - line.from, getSyntaxType(options.syntax));\n if (abbr) {\n const start = line.from + abbr.start;\n const expanded = expand(state, abbr.abbreviation, getActivationContext(state, start) || options);\n const fn = snippet(expanded);\n fn({ state, dispatch }, { label: \"expand\" }, start, line.from + abbr.end);\n return true;\n }\n return false;\n };\n const updateAbbreviation = StateEffect.define();\n const wrapAbbreviationField = StateField.define({\n create: () => null,\n update(value, tr) {\n for (const effect of tr.effects) {\n if (effect.is(updateAbbreviation)) {\n value = effect.value;\n }\n }\n return value;\n }\n });\n EditorView.baseTheme({\n \".emmet-wrap-with-abbreviation\": {\n position: \"absolute\",\n top: 0,\n zIndex: 2,\n width: \"100%\"\n },\n \".emmet-wrap-with-abbreviation__content\": {\n background: \"#fff\",\n margin: \"0 auto\",\n padding: \"5px\",\n boxSizing: \"border-box\",\n width: \"100%\",\n maxWidth: \"30em\",\n borderBottomLeftRadius: \"5px\",\n borderBottomRightRadius: \"5px\",\n boxShadow: \"0 3px 10px rgba(0, 0, 0, 0.3)\"\n },\n \".emmet-wrap-with-abbreviation__content input\": {\n width: \"100%\",\n boxSizing: \"border-box\"\n }\n });\n ViewPlugin.fromClass(class WrapWithAbbreviationViewPlugin {\n constructor() {\n __publicField(this, \"widget\", null);\n __publicField(this, \"input\", null);\n }\n update(update) {\n const { state, view } = update;\n const abbr = state.field(wrapAbbreviationField);\n if (abbr) {\n if (!this.widget) {\n this.createInputPanel(view);\n }\n this.updateAbbreviation(abbr.abbreviation);\n } else if (this.widget) {\n this.disposeWidget();\n view.focus();\n }\n }\n createInputPanel(view) {\n const widget = document.createElement(\"div\");\n widget.className = \"emmet-wrap-with-abbreviation\";\n const content = document.createElement(\"div\");\n content.className = \"emmet-wrap-with-abbreviation__content\";\n const input = document.createElement(\"input\");\n input.placeholder = \"Enter abbreviation\";\n let updated = false;\n const undoUpdate = () => {\n if (updated) {\n undo(view);\n updated = false;\n }\n };\n input.addEventListener(\"input\", () => {\n const abbr = view.state.field(wrapAbbreviationField);\n if (abbr) {\n const nextAbbreviation = input.value;\n undoUpdate();\n const nextAbbr = __spreadProps(__spreadValues({}, abbr), {\n abbreviation: nextAbbreviation\n });\n if (nextAbbr.abbreviation) {\n updated = true;\n const { from, to } = nextAbbr.range;\n const expanded = expand(view.state, nextAbbr.abbreviation, nextAbbr.options);\n const { ranges, snippet: snippet2 } = getSelectionsFromSnippet(expanded, from);\n const nextSel = ranges[0];\n view.dispatch({\n effects: [updateAbbreviation.of(nextAbbr)],\n changes: [{\n from,\n to,\n insert: snippet2\n }],\n selection: {\n head: nextSel.from,\n anchor: nextSel.to\n }\n });\n } else {\n view.dispatch({\n effects: [updateAbbreviation.of(nextAbbr)]\n });\n }\n }\n });\n input.addEventListener(\"keydown\", (evt) => {\n if (evt.key === \"Escape\" || evt.key === \"Enter\") {\n if (evt.key === \"Escape\") {\n undoUpdate();\n }\n evt.preventDefault();\n view.dispatch({\n effects: [updateAbbreviation.of(null)]\n });\n }\n });\n content.append(input);\n widget.append(content);\n view.dom.append(widget);\n this.widget = widget;\n this.input = input;\n input.focus();\n }\n updateAbbreviation(value) {\n if (this.input && this.input.value !== value) {\n this.input.value = value;\n }\n }\n disposeWidget() {\n if (this.widget) {\n this.widget.remove();\n this.widget = this.input = null;\n }\n }\n });\n\n const basicSetup = [\n lineNumbers(),\n highlightActiveLineGutter(),\n highlightSpecialChars(),\n history(),\n foldGutter(),\n drawSelection(),\n dropCursor(),\n EditorState.allowMultipleSelections.of(true),\n indentOnInput(),\n syntaxHighlighting(defaultHighlightStyle),\n bracketMatching(),\n closeBrackets(),\n autocompletion(),\n rectangularSelection(),\n crosshairCursor(),\n highlightActiveLine(),\n highlightSelectionMatches(),\n keymap.of([\n {\n key: \"Tab\",\n run: indentMore\n },\n ])\n ];\n\n // Global object to store editor instances and active editor\n window.editorManager = {\n htmlEditor: null,\n cssEditor: null,\n jsEditor: null,\n activeEditor: null,\n setMode(preprocessor, editor) {\n const newExtensions = getEditorExtensions(preprocessor);\n \n // Create a new EditorState with the new extensions\n const newState = EditorState.create({\n doc: editor.state.doc, // Preserve the current document content\n extensions: newExtensions // Apply new extensions\n });\n \n // Update the editor state with the new extensions\n editor.dispatch({\n effects: EditorView.updateListener.of((v) => {\n // Preserve the update listener and other features\n }),\n // Replace the state with the new state containing updated extensions\n state: newState\n });\n }\n };\n\n // Helper functions to set and get the active editor\n window.setActiveEditor = function(editor) {\n window.editorManager.activeEditor = editor;\n };\n window.getActiveEditor = function() {\n return window.editorManager.activeEditor;\n };\n\n // init editors\n function getEditorExtensions(preprocessor) {\n // Common setup for all editors\n const commonKeymap = keymap.of([\n indentWithTab,\n ...closeBracketsKeymap,\n ...defaultKeymap,\n ...searchKeymap,\n ...historyKeymap,\n ...foldKeymap,\n ...completionKeymap\n ]);\n\n // Specific keymap for expandAbbreviation\n const htmlMarkdownKeymap = keymap.of([\n { key: \"Enter\", run: expandAbbreviation },\n indentWithTab,\n ...closeBracketsKeymap,\n ...defaultKeymap,\n ...searchKeymap,\n ...historyKeymap,\n ...foldKeymap,\n ...completionKeymap\n ]);\n\n // Common setup for all editors\n const extensions = [\n ...basicSetup,\n EditorView.lineWrapping,\n commonKeymap,\n colorPicker,\n tracker()\n ];\n const htmlExtensions = [\n ...basicSetup,\n EditorView.lineWrapping,\n htmlMarkdownKeymap,\n colorPicker,\n tracker()\n ];\n\n // Add specific extensions based on the preprocessor type\n switch (preprocessor) {\n case 'html':\n case 'markdown':\n return [\n ...htmlExtensions,\n preprocessor === 'html' ? html$1() : markdown({ base: markdownLanguage, codeLanguages: [] })\n ];\n case 'css':\n return [\n ...extensions,\n css$1()\n ];\n case 'javascript':\n return [\n ...extensions,\n javascript()\n ];\n case 'typescript':\n return [\n ...extensions,\n javascript({ typescript: true })\n ];\n case 'babel':\n return [\n ...extensions,\n javascript({ jsx: true })\n ];\n case 'jsxtypescript':\n return [\n ...extensions,\n javascript({ jsx: true, typescript: true })\n ];\n case 'none':\n return extensions; // No additional extensions\n default:\n console.warn(`Unknown preprocessor type: ${preprocessor}`);\n return extensions;\n }\n }\n\n function initEditors() {\n const htmlEditor = new EditorView({\n state: EditorState.create({\n doc: project.html,\n extensions: [\n ...getEditorExtensions(project.html_pre_processor),\n EditorView.updateListener.of((v) => {\n if (window.editorManager.activeEditor !== htmlEditor) window.setActiveEditor(htmlEditor);\n const newHtml = htmlEditor.state.doc.toString();\n if (project.html !== newHtml) project.html = newHtml;\n }),\n ],\n }),\n docChanged: true,\n parent: document.getElementById('htmlEditor'),\n allowMultipleSelections: true,\n });\n const cssEditor = new EditorView({\n state: EditorState.create({\n doc: project.css,\n extensions: [\n ...getEditorExtensions(project.css_pre_processor),\n EditorView.updateListener.of((v) => {\n if (data.activeEditor !== 'css') window.setActiveEditor(cssEditor);\n const newCSS = cssEditor.state.doc.toString();\n if (project.css !== newCSS) project.css = newCSS;\n }),\n ],\n }),\n docChanged: true,\n parent: document.getElementById('cssEditor'),\n allowMultipleSelections: true,\n });\n const jsEditor = new EditorView({\n state: EditorState.create({\n doc: project.javascript,\n extensions: [\n ...getEditorExtensions(project.javascript_pre_processor),\n EditorView.updateListener.of((v) => {\n if (data.activeEditor !== 'javascript') window.setActiveEditor(jsEditor);\n const newJS = jsEditor.state.doc.toString();\n if (project.javascript !== newJS) project.javascript = newJS;\n }),\n ],\n }),\n docChanged: true,\n parent: document.getElementById('jsEditor'),\n allowMultipleSelections: true,\n });\n\n // Store editor instances in the global object\n window.editorManager.htmlEditor = htmlEditor;\n window.editorManager.cssEditor = cssEditor;\n window.editorManager.jsEditor = jsEditor;\n\n // Set the default active editor\n window.setActiveEditor(htmlEditor);\n }\n\n // editor functions\n function dispatchChanges(editor, content) {\n editor.dispatch({\n changes: {\n from: 0,\n to: editor.state.doc.toString().length,\n insert: content,\n },\n });\n }\n\n // Command functions\n window.editorCommand = async function(string) {\n if (string === \"indent\") indentMore(getActiveEditor());\n if (string === \"outdent\") indentLess(getActiveEditor());\n if (string === \"goto\") gotoLine(getActiveEditor());\n if (string === \"undo\") undo(getActiveEditor());\n if (string === \"redo\") redo(getActiveEditor());\n if (string === \"search\") openSearchPanel(getActiveEditor());\n if (string === \"toggleComment\") toggleComment(getActiveEditor());\n if (string === \"foldAll\") foldAll(getActiveEditor());\n if (string === \"unfoldAll\") unfoldAll(getActiveEditor());\n if (string === \"cut\") cutSelection(getActiveEditor());\n if (string === \"copy\") copySelection(getActiveEditor());\n if (string === \"paste\") pasteText(getActiveEditor());\n if (string === \"selectAll\") selectAll(getActiveEditor());\n };\n \n // Function to cut the selected text\n const cutSelection = editor => {\n const { state, dispatch } = editor;\n const { selection } = state;\n const selectedText = state.sliceDoc(selection.main.from, selection.main.to);\n navigator.clipboard.writeText(selectedText);\n dispatch(state.update({\n changes: { from: selection.main.from, to: selection.main.to, insert: '' }\n }));\n };\n\n // Function to copy the selected text\n const copySelection = editor => {\n const { state } = editor;\n const { selection } = state;\n const selectedText = state.sliceDoc(selection.main.from, selection.main.to);\n navigator.clipboard.writeText(selectedText);\n };\n\n // Function to paste text at the cursor position\n const pasteText = async editor => {\n const { state, dispatch } = editor;\n try {\n const text = await navigator.clipboard.readText();\n if (text) {\n const { selection } = state;\n dispatch(state.update({ changes: { from: selection.main.from, to: selection.main.to, insert: text } }));\n } else {\n console.log('Clipboard is empty or does not contain text.');\n }\n } catch (error) {\n console.error('Failed to paste text:', error);\n }\n };\n\n // Function to select all text in the active editor\n const selectAll = editor => {\n const { state, dispatch } = editor;\n const { doc } = state;\n const selection = { anchor: 0, head: doc.length };\n dispatch(state.update({ selection }));\n };\n\n // Make functions available in global space\n window.initEditors = initEditors;\n window.dispatchChanges = dispatchChanges;\n window.indentMore = indentMore;\n window.indentLess = indentLess;\n window.gotoLine = gotoLine;\n window.undo = undo;\n window.redo = redo;\n window.openSearchPanel = openSearchPanel;\n window.toggleComment = toggleComment;\n window.foldAll = foldAll;\n window.unfoldAll = unfoldAll;\n window.cutSelection = cutSelection;\n window.copySelection = copySelection;\n window.pasteText = pasteText;\n window.selectAll = selectAll;\n window.getEditorExtensions = getEditorExtensions;\n\n})();\n"], + "mappings": "gQACA,SAASA,GAASC,EAAQC,EAAUC,EAAO,CAAC,EAAG,CAC7C,SAASC,EAAYH,EAAQE,EAAM,CACjC,OAAI,OAAOF,GAAW,UAAYA,IAAW,KACpCA,EAGF,IAAI,MAAMA,EAAQ,CACvB,IAAII,EAAKC,EAAUC,GAAO,CACxB,IAAMC,GAAW,CAAC,GAAGL,EAAMG,CAAQ,EAC7BG,EAAWJ,EAAIC,CAAQ,EACvBI,EAAS,QAAQ,IAAIL,EAAKC,EAAUF,EAAYG,GAAOC,EAAQ,CAAC,EAEtE,OAAIC,IAAaF,IACfL,EAASM,GAAUC,EAAUF,EAAK,EAG7BG,CACT,EACA,IAAIL,EAAKC,EAAU,CACjB,IAAMC,GAAQF,EAAIC,CAAQ,EAC1B,OAAI,OAAOC,IAAU,UAAYA,KAAU,KAClCH,EAAYG,GAAO,CAAC,GAAGJ,EAAMG,CAAQ,CAAC,EAExCC,EACT,CACF,CAAC,CACH,CAEA,OAAOH,EAAYH,EAAQE,CAAI,CACjC,CAGA,IAAIQ,GAAM,CACR,KAAM,YACN,OAAQ,CACN,KAAM,mBACN,KAAM,6BACN,IAAK,iBACP,EACA,QAAS,QACT,IAAK,8CACL,QAAS,8DACX,EACIC,GAAI,CACN,KAAM,WACN,QAAS,QACT,MAAO,sBACP,YAAa,wCACb,OAAQ,YACR,IAAK,6BACL,KAAM,GACN,UAAW,CAAC,EACZ,mBAAoB,OACpB,kBAAmB,MACnB,yBAA0B,aAC1B,KAAM,GACN,IAAK,GACL,WAAY,GACZ,KAAM,q+IACN,QAAS,GACT,KAAM,GACN,YAAa,GACb,OAAQ,GACR,QAAS,GACT,IAAK,GACL,QAAS,GACT,YAAa,OACb,QAAS,GACT,aAAc,EAChB,EACIC,GAAI,CACN,aAAc,KACd,mBAAoB,KACpB,WAAY,KACZ,aAAc,OACd,YAAa,KACb,WAAY,KACZ,SAAU,KACV,UAAW,KACX,MAAO,KACP,gBAAiB,GACjB,WAAY,CACV,YAAa,CACX,UAAW,CACT,8DACF,EACA,KAAM,EACR,EACA,aAAc,CACZ,UAAW,CACT,6EACF,EACA,KAAM,EACR,EACA,QAAW,CACT,UAAW,CACT,oEACA,+DACA,6DACA,oEACA,iEACA,qEACA,qFACA,qGACA,oEACA,sEACF,EACA,KAAM,EACR,EACA,cAAe,CACb,UAAW,CACT,0EACF,EACA,KAAM,EACR,EACA,WAAY,CACV,UAAW,CACT,mEACF,EACA,KAAM,EACR,EACA,IAAO,CACL,UAAW,CACT,2DACA,yDACF,EACA,KAAM,EACR,EACA,iBAAkB,CAChB,UAAW,CACT,yEACA,uEACF,EACA,KAAM,EACR,EACA,QAAW,CACT,UAAW,CAAC,EACZ,KAAM,4EACR,EACA,WAAY,CACV,UAAW,CACT,oEACF,EACA,KAAM,EACR,EACA,cAAe,CACb,UAAW,CACT,+EACA,mFACF,EACA,KAAM,EACR,EACA,WAAY,CACV,UAAW,CACT,uEACA,mFACA,gFACF,EACA,KAAM,EACR,EACA,YAAa,CACX,UAAW,CACT,4EACF,EACA,KAAM,EACR,EACA,WAAY,CACV,UAAW,CACT,uCACF,EACA,KAAM,EACR,EACA,SAAY,CACV,UAAW,CACT,+DACA,6DACF,EACA,KAAM,EACR,EACA,GAAM,CACJ,UAAW,CACT,+BACF,EACA,KAAM,EACR,EACA,KAAQ,CACN,UAAW,CACT,4DACF,EACA,KAAM,EACR,EACA,QAAW,CACT,UAAW,CACT,qEACF,EACA,KAAM,EACR,EACA,aAAc,CACZ,UAAW,CACT,4EACF,EACA,KAAM,EACR,EACA,WAAc,CACZ,UAAW,CACT,iFACA,8EACF,EACA,KAAM,EACR,EACA,cAAe,CACb,UAAW,CACT,6EACA,2EACF,EACA,KAAM,EACR,EACA,OAAU,CACR,UAAW,CACT,mEACF,EACA,KAAM,EACR,EACA,gBAAiB,CACf,UAAW,CACT,2EACF,EACA,KAAM,EACR,EACA,KAAQ,CACN,UAAW,CACT,2CACF,EACA,KAAM,EACR,EACA,YAAa,CACX,UAAW,CACT,6EACA,0EACF,EACA,KAAM,EACR,EACA,WAAY,CACV,UAAW,CACT,oEACF,EACA,KAAM,EACR,EACA,SAAY,CACV,UAAW,CAAC,EACZ,KAAM,4DACR,EACA,OAAU,CACR,UAAW,CACT,mEACF,EACA,KAAM,EACR,EACA,MAAS,CACP,UAAW,CACT,6EACA,kEACF,EACA,KAAM,EACR,EACA,cAAe,CACb,UAAW,CACT,0EACF,EACA,KAAM,EACR,EACA,QAAW,CACT,UAAW,CACT,iEACF,EACA,KAAM,EACR,EACA,oBAAqB,CACnB,UAAW,CACT,2FACA,yFACF,EACA,KAAM,EACR,EACA,OAAU,CACR,UAAW,CACT,wEACF,EACA,KAAM,EACR,EACA,aAAc,CACZ,UAAW,CACT,6DACF,EACA,KAAM,EACR,EACA,YAAe,CACb,UAAW,CACT,mFACA,gFACF,EACA,KAAM,EACR,EACA,gBAAiB,CACf,UAAW,CACT,0EACF,EACA,KAAM,EACR,EACA,QAAW,CACT,UAAW,CACT,2DACF,EACA,KAAM,EACR,EACA,YAAa,CACX,UAAW,CACT,uEACF,EACA,KAAM,EACR,EACA,UAAW,CACT,UAAW,CAAC,EACZ,KAAM,mDACR,EACA,cAAe,CACb,UAAW,CACT,0DACF,EACA,KAAM,EACR,EACA,WAAY,CACV,UAAW,CACT,oEACA,sEACF,EACA,KAAM,EACR,EACA,OAAU,CACR,UAAW,CACT,oDACF,EACA,KAAM,EACR,EACA,aAAc,CACZ,UAAW,CACT,uDACF,EACA,KAAM,EACR,EACA,YAAa,CACX,UAAW,CACT,gEACF,EACA,KAAM,EACR,EACA,WAAY,CACV,UAAW,CACT,gEACF,EACA,KAAM,EACR,EACA,aAAc,CACZ,UAAW,CACT,qEACF,EACA,KAAM,EACR,EACA,aAAc,CACZ,UAAW,CACT,qEACF,EACA,KAAM,EACR,EACA,WAAY,CACV,UAAW,CACT,0DACA,iEACF,EACA,KAAM,EACR,EACA,cAAe,CACb,UAAW,CACT,4EACA,0EACF,EACA,KAAM,EACR,EACA,eAAgB,CACd,UAAW,CACT,wEACF,EACA,KAAM,EACR,EACA,cAAe,CACb,UAAW,CACT,0EACF,EACA,KAAM,EACR,EACA,SAAY,CACV,UAAW,CACT,6EACA,4FACF,EACA,KAAM,EACR,EACA,OAAU,CACR,UAAW,CACT,4EACA,0EACF,EACA,KAAM,EACR,EACA,SAAY,CACV,UAAW,CACT,yEACF,EACA,KAAM,EACR,EACA,eAAgB,CACd,UAAW,CACT,sEACF,EACA,KAAM,EACR,EACA,WAAY,CACV,UAAW,CACT,mEACF,EACA,KAAM,EACR,EACA,WAAY,CACV,UAAW,CACT,+EACF,EACA,KAAM,EACR,EACA,MAAS,CACP,UAAW,CACT,wEACA,sEACA,2EACF,EACA,KAAM,EACR,EACA,MAAS,CACP,UAAW,CACT,iEACF,EACA,KAAM,EACR,EACA,KAAQ,CACN,UAAW,CACT,gDACF,EACA,KAAM,EACR,EACA,SAAU,CACR,UAAW,CACT,sDACF,EACA,KAAM,EACR,EACA,YAAa,CACX,UAAW,CACT,sEACF,EACA,KAAM,EACR,CACF,CACF,EACMC,EAAS,UAAW,CACxB,IAAMC,EAAiB,UACjBC,EAAa,UACbC,EAAe,UACfC,EAAe,UACfC,EAAiB,YAEvB,MAAO,CACL,KAAM;AAAA,eACKJ,CAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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A,SAASwC,GAAmB/7F,EAAMk6F,EAAWX,EAAS,CACpD,IAAMrhF,EAAS8jF,GAAiB9B,CAAS,EACnC+B,EAAc1C,EAAQ,QAAUA,EAAQ,QAAQ,KAAO,GACvD2C,EAAaC,GAAUjkF,EAASA,EAAO,KAAO+jF,CAAW,EAC/Dj8F,EAAK,KAAO67F,GAAWK,CAAU,IAAMN,GAASM,EAAY3C,CAAO,EAAI,OAAS,MAClF,CACA,SAAS4C,GAAUh7F,EAAK,CACtB,OAAQA,GAAO,IAAI,YAAY,CACjC,CACA,SAAS66F,GAAiB9B,EAAW,CACnC,QAASz8F,EAAIy8F,EAAU,OAAS,EAAGz8F,GAAK,EAAGA,IAAK,CAC9C,IAAM0yF,EAAO+J,EAAUz8F,CAAC,EACxB,GAAIq2E,GAAOqc,CAAI,EACb,OAAOA,CAEX,CACF,CACA,IAAIiM,GAAQ,CACV,OAAU,CAAC,QAAS,QAAS,QAAS,MAAO,OAAQ,cAAe,cAAe,MAAM,EACzF,MAAS,CACP,iBACA,cACA,eACA,UACA,UACA,OACA,OACA,MACA,QACA,MACA,MACA,WACA,YACA,OACA,cACA,QACA,MACA,WACA,MACA,WACA,SACA,MACA,OACA,UACA,UACA,cACA,UACA,QACA,QACA,WACA,QACA,OACA,QACA,OACA,QACA,SACA,WACA,QACA,OACA,QACA,QACA,QACA,QACA,OACA,MACA,KACA,KACA,eACA,UACA,YACA,UACA,YACA,WACA,UACA,UACA,UACA,OACA,YACA,cACA,MACA,iBACA,WACA,WACA,SACA,WACA,WACA,UACA,OACA,cACA,OACA,WACA,YACA,MACA,aACA,aACA,SACA,OACA,MACA,UACA,QACA,QACA,SACA,OACA,QACA,aACA,WACA,YACA,QACA,UACA,SACA,UACA,cACA,QACA,YACA,QACA,OACA,QACA,WACA,UACA,OACA,aACA,UACA,YACA,QACA,UACA,OACA,aACA,YACA,QACA,aACA,QACA,QACA,UACA,aACA,KACA,OACA,OACA,WACA,OACA,aACA,QACA,WACA,aACA,QACA,eACA,MACA,aACA,YACA,YACA,KACA,QACA,QACA,QACA,OACA,KACA,KACA,OACA,QACA,UACA,KACA,KACA,KACA,OACA,gBACA,UACA,OACA,SACA,MACA,YACA,SACA,cACA,SACA,aACA,OACA,YACA,aACA,UACA,cACA,aACA,UACA,QACA,QACA,SACA,aACA,WACA,SACA,aACA,MACA,OACA,WACA,QACA,IACA,YACA,MACA,QACA,SACA,UACA,WACA,QACA,SACA,SACA,UACF,CACF,EACIC,GAAK,CACP,OAAU,CAAC,4EAA6E,eAAgB,+DAAgE,uCAAwC,8CAA+C,6CAA8C,gEAAiE,iCAAkC,uCAAwC,sCAAsC,EAC9d,MAAS,CACP,iCACA,wCACA,qBACA,yDACA,iCACA,oDACA,yDACA,mDACA,yDACA,uCACA,yDACA,uCACA,2BACA,uCACA,wCACA,2EACA,eACA,iCACA,2EACA,yDACA,qBACA,yGACA,uCACA,6CACA,mDACA,qEACA,mDACA,iCACA,qBACA,2BACA,+DACA,+DACA,eACA,iCACA,uCACA,qBACA,6CACA,mDACA,mDACA,mGACA,iCACA,iCACA,6CACA,2BACA,yDACA,6CACA,6CACA,uCACA,iCACA,QACA,QACA,uCACA,iCACA,6CACA,qBACA,+DACA,6CACA,6CACA,2EACA,SACA,2BACA,6CACA,iCACA,uCACA,6CACA,mDACA,uCACA,6CACA,eACA,iCACA,qBACA,iCACA,2BACA,iCACA,eACA,uCACA,2BACA,iCACA,yDACA,2BACA,yDACA,6CACA,eACA,2BACA,mDACA,uCACA,qEACA,uCACA,6CACA,yDACA,qBACA,uCACA,yDACA,uCACA,iCACA,uCACA,uCACA,6CACA,uCACA,yDACA,yDACA,6CACA,6CACA,2EACA,uCACA,mDACA,mDACA,2EACA,uCACA,mDACA,qBACA,2BACA,yDACA,2BACA,2BACA,uCACA,mDACA,mDACA,qBACA,2EACA,2BACA,qBACA,uFACA,yDACA,qBACA,2EACA,qBACA,2BACA,mDACA,qBACA,yDACA,qEACA,eACA,iCACA,2BACA,+DACA,uCACA,2EACA,mDACA,qBACA,yDACA,2BACA,2BACA,uCACA,qBACA,2EACA,mDACA,qEACA,yDACA,6CACA,yDACA,uCACA,iCACA,+DACA,2BACA,yDACA,6CACA,2EACA,iCACA,iCACA,iCACA,mDACA,2BACA,+DACA,eACA,iCACA,qBACA,eACA,qBACA,oBACF,CACF,EACIC,GAAK,CACP,OAAU,CAAC,QAAS,MAAO,QAAS,SAAU,KAAM,QAAS,QAAS,IAAI,EAC1E,MAAS,CACP,YACA,cACA,cACA,UACA,UACA,WACA,QACA,UACA,YACA,QACA,WACA,aACA,eACA,OACA,eACA,OACA,OACA,YACA,OACA,SACA,SACA,KACA,OACA,WACA,YACA,eACA,YACA,QACA,YACA,gBACA,OACA,WACA,SACA,UACA,SACA,OACA,QACA,UACA,OACA,YACA,QACA,SACA,aACA,QACA,MACA,KACA,IACA,aACA,eACA,WACA,WACA,cACA,YACA,WACA,WACA,WACA,OACA,WACA,kBACA,QACA,iBACA,aACA,aACA,aACA,YACA,UACA,YACA,YACA,YACA,QACA,YACA,UACA,QACA,eACA,QACA,aACA,SACA,MACA,QACA,WACA,QACA,aACA,QACA,UACA,cACA,cACA,QACA,UACA,cACA,YACA,UACA,aACA,QACA,WACA,aACA,SACA,QACA,eACA,YACA,YACA,gBACA,UACA,UACA,SACA,YACA,cACA,WACA,YACA,eACA,gBACA,OACA,WACA,QACA,QACA,IACA,UACA,YACA,WACA,OACA,gBACA,SACA,WACA,iBACA,WACA,aACA,OACA,gBACA,eACA,QACA,IACA,WACA,QACA,QACA,SACA,YACA,aACA,OACA,YACA,SACA,KACA,cACA,MACA,MACA,eACA,aACA,SACA,YACA,QACA,WACA,UACA,YACA,QACA,WACA,YACA,eACA,SACA,cACA,SACA,aACA,YACA,MACA,aACA,UACA,WACA,UACA,cACA,aACA,UACA,OACA,aACA,OACA,IACA,eACA,cACA,QACA,OACA,UACA,aACA,UACA,OACA,SACA,UACF,CACF,EACA,IAAMC,GAAe,CAAE,GAAAF,GAAI,GAAAC,GAAI,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ACP,KAAQ,oBACR,KAAQ,sBACR,MAAS,0BACT,GAAM,mBACN,GAAM,sBACN,IAAO,uBACP,WAAY,uBACZ,IAAO,WACP,IAAO,cACP,IAAO,4BACP,KAAQ,eACR,IAAO,oBACP,IAAO,mDACP,KAAQ,+BACR,MAAS,4BACT,KAAQ,mCACR,KAAQ,yBACR,OAAU,oCACV,IAAO;AAAA,IACP,MAAO,0CACT,EACIC,GAAc,CAChB,MAAO,gBACT,EACIC,GAAY,CACd,KAAQ,KACR,OAAU,QACV,QAAW,QACX,YAAe,IACf,QAAW;AAAA,CACb,EACA,IAAMC,GAAkB,CACtB,OAAQ,OACR,WAAY,KACd,EAuGMC,GAAkB,CACtB,KAAM,SACN,OAAQ,OACR,UAAAF,GACA,SAAU,CAAC,EACX,QA3GuB,CACvB,eAAkB,CAChB,IACA,OACA,UACA,SACA,IACA,WACA,MACA,MACA,KACA,SACA,OACA,OACA,MACA,MACA,KACA,OACA,IACA,SACA,MACA,QACA,MACA,MACA,QACA,MACA,SACA,IACA,IACA,OACA,SACA,QACA,OACA,SACA,SACA,MACA,MACA,WACA,KACA,IACA,KACF,EACA,gBAAiB,IACjB,oBAAqB,GACrB,iBAAkB;AAAA,EAClB,iBAAkB,GAClB,uBAAwB,GACxB,yBAA0B,SAC1B,gBAAiB,GACjB,wBAAyB,GACzB,oBAAqB,CAAC,MAAM,EAC5B,qBAAsB,CAAC,MAAM,EAC7B,qBAAsB,EACtB,wBAAyB,GACzB,2BAA4B,CAC1B,kBACA,WACA,QACA,YACA,WACA,UACA,WACA,QACA,WACA,iBACA,SACA,QACA,OACA,WACA,QACA,aACA,WACA,WACA,WACA,WACA,eACF,EACA,2BAA4B,GAC5B,0BAA2B,OAC3B,eAAgB,CAACzkG,EAAO63F,IAAgBA,EACxC,cAAgBlH,GAAUA,EAC1B,cAAe,GACf,kBAAmB,GACnB,kBAAmB,CAAC,KAAM,OAAO,EACjC,iBAAkB,GAClB,gBAAiB;AAAA,yBACjB,cAAe,GACf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AO,CACd,QAAQ,MAAM,wBAAyBA,CAAK,CAC9C,CACF,EAGMF,GAAYtkE,GAAU,CAC1B,GAAM,CAAE,MAAA3nC,EAAO,SAAAs7B,CAAS,EAAIqM,EACtB,CAAE,IAAA/rC,CAAI,EAAIoE,EACVhB,EAAY,CAAE,OAAQ,EAAG,KAAMpD,EAAI,MAAO,EAChD0/B,EAASt7B,EAAM,OAAO,CAAE,UAAAhB,CAAU,CAAC,CAAC,CACtC,EAGA,OAAO,YAAcssG,GACrB,OAAO,gBAAkBO,GACzB,OAAO,WAAan8C,GACpB,OAAO,WAAaC,GACpB,OAAO,SAAW+B,GAClB,OAAO,KAAOzK,GACd,OAAO,KAAOC,GACd,OAAO,gBAAkBqN,GACzB,OAAO,cAAgBhQ,GACvB,OAAO,QAAUvE,GACjB,OAAO,UAAYC,GACnB,OAAO,aAAe6rD,GACtB,OAAO,cAAgBC,GACvB,OAAO,UAAYC,GACnB,OAAO,UAAYC,GACnB,OAAO,oBAAsBf,EAEhC,GAAG", "names": ["onChange", "target", "callback", "path", "createProxy", "obj", "property", "value", "fullPath", "oldValue", "result", "app", "p", "d", "icons", "SidebarIconCSS", "navIconCSS", "modalIconCSS", "panelIconCSS", "previewIconCSS", "newValue", "iframe", "doc", "string", "consoleCSS", "LeftMenubar", "buttonSize", "PreviewMenu", "buttonClass", "selectClass", "selectStyle", "sizeOptions", "previewSize", "group", "option", "canTidyShow", "Menu", "menuDialog", "Demos", "buttonContentClass", "imageContentClass", "textContentClass", "frameworks", "buttonHTML", "name", "Settings", "sortedFrameworks", "acc", "key", "settingsHTML", "framework", "library", "index", "Libraries", "container", "size", "viewportWidth", "viewportHeight", "previewElm", "width", "height", "html", "editorNav", "element", "currentDoc", "newDoc", "large", "title", "content", "CloseLabel", "ConfirmLabel", "onLoad", "onClose", "onConfirm", "hClass", "modal", "timesBtn", "closeBtn", "confirmBtn", "c", "names", "registrations", "registration", "part", "versionParts", "modalContent", "apiConnection", "searchInput", "searchBtn", "mediaTypeSelect", "resultsContainer", "fileInput", "handleSearch", "query", "mediaType", "results", "images", "img", "audios", "audio", "icon", "displayResults", "event", "file", "base64", "resultHTML", "reader", "svgContent", "imgHTML", "imgElement", "error", "svgElement", "cleanedSvgContent", "url", "response", "searchUrl", "text", "renderLibraries", "item", "suggestions", "src", "script", "scripts", "scriptUrl", "resolve", "reject", "scriptElement", "srcArray", "editor", "scriptMap", "currentPreprocessors", "scriptSrcCondition", "scriptSrc", "currentScriptSrc", "beautifyLibraries", "formattedCode", "id", "scale", "fadeTimeout", "detect", "appScript", "err", "output", "base64String", "capitalizeFirstLetter", "capitalizedTitle", "clone", "input", "fileName", "fileExtension", "fileType", "isBase64", "str", "getBase64FileType", "mimeMatch", "mimeType", "mimeTypeToExtension", "getFileName", "getBase64FileName", "fileCounter", "extractBackgroundImageUrls", "css", "urls", "regex", "match", "imageResources", "body", "audioResources", "vectorResources", "videoResources", "srcset", "source", "svg", "video", "projectCss", "mediaUrl", "blob", "fileContent", "checkCSSDependencies", "twFound", "checkJSDependencies", "minifyCSS", "cssCode", "minified", "idoc", "zip", "rollupInput", "rollupPlugins", "rollupStr", "licenseStr", "READMEStr", "base64Logo", "logoType", "logoFileName", "sizes", "createResizedImage", "canvas", "ctx", "base64Image", "cssContent", "cssBuildItems", "cssBuildItemsString", "TailwindNoReset", "promises", "data", "parts", "cssBuild", "css4html", "tailwindDirectives", "tailwindStyles", "cssImport", "twJS", "configCode", "npmBuildConditions", "nodeStr", "swinit", "swjs", "scriptTags", "scriptTagsTWChecked", "cssTags", "gFonts", "minifyJS", "jsCode", "minifiedJS", "placeScript", "indexHtmlContent", "indexHtmlContentCompiled", "audioFolder", "base64Audio", "svgFolder", "videoFolder", "base64Video", "scriptsToRemove", "jsPreprocessor", "shareProject", "lib", "form", "iframeDocument", "context", "videoElements", "currentTime", "paused", "volume", "type", "forceRun", "javascriptCode", "domconsoleContent", "jsLink", "iframeSrc", "newHtmlBlobURL", "oldNode", "newNode", "attr", "oldSrcdoc", "newSrcdoc", "oldAttributes", "newAttributes", "oldChildren", "newChildren", "oldChild", "newChild", "Text", "pos", "n", "from", "to", "text", "clip", "parts", "TextNode", "other", "start", "end", "a", "RawTextCursor", "b", "skip", "dir", "PartialTextCursor", "inner", "LineCursor", "lines", "TextLeaf", "length", "textLength", "target", "isLine", "line", "offset", "i", "string", "Line$1", "open", "sliceText", "prev", "joined", "appendText", "mid", "newLen", "lineSep", "result", "part", "len", "children", "child", "endLine", "childOpen", "updated", "totalLines", "copy", "iA", "iB", "eA", "eB", "chA", "chB", "l", "ch", "flat", "chunk", "maxChunk", "minChunk", "chunked", "currentLines", "currentLen", "currentChunk", "add", "last", "node", "flush", "first", "top", "offsetValue", "size", "next", "limit", "value", "done", "lineBreak", "number", "extend", "s", "isExtendingChar", "code", "isRegionalIndicator", "ZWJ", "findClusterBreak", "str", "forward", "includeExtending", "nextClusterBreak", "prevClusterBreak", "surrogateLow", "surrogateHigh", "codePointAt", "codePointSize", "countBefore", "found", "code0", "code1", "fromCodePoint", "DefaultSplit", "MapMode", "ChangeDesc", "sections", "ins", "f", "posA", "posB", "individual", "iterChanges", "composeSets", "before", "mapSet", "assoc", "mode", "endA", "json", "ChangeSet", "inserted", "doc", "fromA", "toA", "fromB", "_toB", "index", "ranges", "resultSections", "resultInserted", "filteredSections", "iter", "SectionIter", "addSection", "addInsert", "changes", "total", "force", "set", "process", "spec", "sub", "insert", "insText", "insLen", "e", "forceJoin", "values", "desc", "endB", "setA", "setB", "mkSet", "piece", "left", "sectionLen", "insB", "SelectionRange", "flags", "level", "change", "EditorSelection", "head", "includeAssoc", "mainIndex", "range", "main", "which", "r", "anchor", "bidiLevel", "goalColumn", "checkSelection", "selection", "docLength", "nextID", "Facet", "combine", "compareInput", "compare", "isStatic", "enables", "config", "sameArray$1", "FacetProvider", "deps", "get", "field", "x", "state", "dependencies", "facet", "type", "addresses", "_a", "getter", "id", "idx", "multi", "depDoc", "depSel", "depAddrs", "dep", "tr", "ensureAll", "newVal", "compareArray", "oldState", "oldAddr", "oldVal", "getAddr", "StateField", "addrs", "changed", "addr", "ensureAddr", "dynamicFacetSlot", "providers", "providerAddrs", "p", "providerTypes", "dynamic", "val", "depChanged", "oldProviders", "oldValue", "initField", "createF", "updateF", "compareF", "init", "create", "Prec_", "prec", "ext", "PrecExtension", "Prec", "Compartment", "CompartmentInstance", "content", "compartment", "Configuration", "base", "compartments", "dynamicSlots", "address", "staticValues", "facets", "fields", "newCompartments", "flatten", "oldFacets", "extension", "seen", "known", "status", "languageData", "allowMultipleSelections", "v", "lineSeparator", "changeFilter", "transactionFilter", "transactionExtender", "readOnly", "Annotation", "AnnotationType", "StateEffectType", "map", "StateEffect", "mapping", "mapped", "effects", "effect", "Transaction", "startState", "annotations", "scrollIntoView", "ann", "event", "joinRanges", "mergeTransaction", "sequential", "mapForA", "mapForB", "resolveTransactionInner", "docSize", "sel", "asArray$1", "resolveTransaction", "specs", "filter", "seq", "extendTransaction", "filterTransaction", "back", "filtered", "filters", "extenders", "none$3", "CharCategory", "nonASCIISingleCaseWordChar", "wordChar", "hasWordChar", "makeCategorizer", "wordChars", "char", "EditorState", "computeSlot", "require", "conf", "key", "startValues", "slot", "result1", "newChanges", "newMapped", "j", "mapBy", "prop", "fieldInit", "configuration", "phrase", "m", "name", "side", "provider", "at", "cat", "kA", "kB", "k", "combineConfig", "configs", "defaults", "current", "RangeValue", "Range$1", "cmpRange", "Chunk", "maxPoint", "startAt", "arr", "lo", "hi", "diff", "newPos", "curFrom", "curTo", "newFrom", "newTo", "RangeSet", "chunkPos", "nextLayer", "updateSpec", "sort", "filterFrom", "filterTo", "cur", "LayerCursor", "spill", "builder", "RangeSetBuilder", "chunks", "touch", "HeapCursor", "sets", "oldSets", "newSets", "textDiff", "comparator", "minPointSize", "sharedChunks", "findSharedChunks", "sideA", "SpanCursor", "sideB", "sameValues", "iterator", "cursor", "openRanges", "active", "openCount", "build", "lazySort", "layer", "newArrays", "inA", "shared", "minPoint", "rank", "rangeIndex", "heap", "heapBubble", "childIndex", "remove", "findMinIndex", "trackOpen", "wasPoint", "nextVal", "startA", "startB", "dPos", "clipEnd", "array", "foundPos", "countColumn", "tabSize", "findColumn", "col", "strict", "C", "COUNT", "SET", "StyleModule", "options", "finish", "splitSelector", "selector", "render", "selectors", "isKeyframes", "local", "isAt", "keyframes", "root", "modules", "nonce", "StyleSet", "adoptedSet", "win", "adopted", "sheet", "mod", "shift", "mac", "ie$1", "code$1", "keyName", "ignoreKey", "getSelection", "contains$1", "dom", "deepActiveElement", "elt", "hasSelection", "clientRectsFor", "textRange", "isEquivalentPosition", "off", "targetNode", "targetOff", "scanFor", "domIndex", "isBlockElement", "maxOffset", "parent", "flattenRect", "rect", "windowRect", "vp", "getScale", "scaleX", "scaleY", "scrollRectIntoView", "y", "xMargin", "yMargin", "ltr", "stop", "bounding", "moveX", "moveY", "rectHeight", "boundingHeight", "movedX", "movedY", "scrollableParents", "DOMSelectionState", "domSel", "anchorNode", "focusNode", "anchorOffset", "focusOffset", "preventScrollSupported", "focusPreventScroll", "stack", "scratchRange", "dispatchKey", "mods", "down", "up", "getRoot", "clearAttributes", "atElementStart", "isScrolledToBottom", "textNodeBefore", "startNode", "startOffset", "textNodeAfter", "DOMPos", "precise", "noChildren", "ContentView", "view", "track", "contentView", "rm$1", "_dom", "after", "bias", "fromI", "fromStart", "toI", "toEnd", "prevEnd", "andParent", "childList", "_rec", "_event", "ChildCursor", "source", "hasStart", "openStart", "openEnd", "replaceRange", "fromOff", "toOff", "breakAtStart", "breakAtEnd", "mergeChildrenInto", "dLen", "nav", "ie_edge", "ie_upto10", "ie_11up", "ie", "gecko", "chrome", "webkit", "safari", "ios", "browser", "MaxJoinLen", "TextView", "textDOM", "_from", "_to", "textCoords", "MarkView", "mark", "_hasStart", "detachFrom", "inlineDOMAtPos", "coordsInChildren", "rects", "WidgetView", "widget", "custom", "fromBack", "WidgetBufferView", "joinInlineInto", "beforePos", "afterPos", "scan", "fallbackRect", "combineAttrs", "noAttrs$1", "attrsEq", "ignore", "keysA", "keysB", "updateAttrs", "attrs", "getAttrs$1", "attr", "LineView", "deco", "cls", "hack", "totalWidth", "textHeight", "heightOracle", "height", "dist", "docView", "block", "BlockWidgetView", "_takeDeco", "startSide", "endSide", "WidgetType", "BlockType", "Decoration", "MarkDecoration", "PointDecoration", "getInclusive", "LineDecoration", "of", "_b", "isReplace", "widgetsEq", "addRange", "margin", "ContentBuilder", "disallowBlockEffectsFor", "wrapMarks", "take", "NullWidget", "cursorBefore", "cursorAfter", "decorations", "dynamicDecorationMap", "tag", "Direction", "LTR", "RTL", "dec", "LowTypes", "ArabicTypes", "Brackets", "BracketStack", "charType", "BidiRE", "BidiSpan", "order", "maybe", "span", "isolatesEq", "types", "computeCharTypes", "rFrom", "rTo", "isolates", "outerType", "iI", "prevType", "prevStrong", "replace", "processBracketPairs", "oppositeType", "sI", "context", "br", "sJ", "embed", "processNeutrals", "beforeL", "afterL", "jI", "fromJ", "emitSpans", "baseLevel", "ourType", "iCh", "sameDir", "isNum", "recurse", "localLevel", "iScan", "run", "iso", "upto", "dirSwap", "computeSectionOrder", "computeOrder", "direction", "trivialOrder", "movedOver", "moveVisually", "startIndex", "spanI", "spanEnd", "nextI", "nextIndex", "nextSpan", "autoDirection", "clickAddsSelectionRange", "dragMovesSelection$1", "mouseSelectionStyle", "exceptionSink", "updateListener", "inputHandler$1", "focusChangeEffect", "perLineTextDirection", "nativeSelectionHidden", "scrollHandler", "ScrollTarget", "isSnapshot", "scrollIntoView$1", "t", "setEditContextFormatting", "logException", "exception", "handler", "editable", "nextPluginID", "viewPlugin", "ViewPlugin", "domEventHandlers", "domEventObservers", "buildExtensions", "eventHandlers", "eventObservers", "provide", "plugin", "pluginInst", "PluginInstance", "update", "editorAttributes", "contentAttributes", "outerDecorations", "atomicRanges", "bidiIsolatedRanges", "getIsolatedRanges", "fromDoc", "toDoc", "scrollMargins", "getScrollMargins", "right", "bottom", "styleModule", "ChangedRange", "toB", "me", "dI", "rI", "ViewUpdate", "transactions", "changedRanges", "DocView", "readCompositionAt", "touchesComposition", "composition", "findCompositionRange", "prevDeco", "decoDiff", "findChangedDeco", "oldLength", "observer", "cView", "gaps", "BlockGapWidget", "compLine", "fix", "c", "mustRead", "fromPointer", "activeElt", "focused", "selectionNotFocus", "betweenUneditable", "dummy", "inUneditable", "rawSel", "nextTo", "nextToUneditable", "lineStart", "newRange", "domView", "best", "bestPos", "childOff", "viewport", "contentWidth", "isWider", "widest", "childRect", "width", "measure", "lineHeight", "charWidth", "vs", "allDeco", "d", "dynamicOuter", "outerDeco", "ref", "margins", "targetRect", "offsetWidth", "offsetHeight", "findCompositionNode", "headPos", "textBefore", "textAfter", "textNode", "descAfter", "descBefore", "inv", "marks", "parentView", "DecorationComparator$1", "comp", "inside", "touched", "groupAt", "categorize", "linePos", "getdx", "getdy", "yOverlap", "upTop", "upBot", "domPosAtCoords", "closest", "closestRect", "closestX", "closestY", "closestOverlap", "above", "below", "aboveRect", "belowRect", "dx", "dy", "domPosInText", "clipX", "closestOffset", "closestDY", "generalSide", "posAtCoords", "coords", "docTop", "docHeight", "yOffset", "halfLine", "bounced", "posAtCoordsImprecise", "element", "isSuspiciousSafariCaretResult", "isSuspiciousChromeCaretResult", "nearest", "contentRect", "into", "blockAt", "moveToLineBoundary", "includeWrap", "editorRect", "moveByChar", "by", "spans", "check", "byGroup", "nextCat", "moveVertically", "distance", "startPos", "goal", "startY", "startCoords", "resolvedGoal", "extra", "curY", "charRect", "skipAtomicRanges", "atoms", "moved", "skipAtoms", "oldPos", "InputState", "origin", "firefoxCopyCutHack", "eventBelongsToEditor", "handlers", "plugins", "computeHandlers", "passive", "exists", "modifierCodes", "pending", "PendingKeys", "EmacsyPendingKeys", "mouseSelection", "bindHandler", "record", "observers", "dragScrollMargin", "dragScrollSpeed", "MouseSelection", "startEvent", "style", "mustSelect", "addsSelectionRange", "isInPrimarySelection", "getClickType", "sx", "sy", "dragMovesSelection", "brokenClipboardAPI", "capturePaste", "doPaste", "input", "byLine", "lastLinewiseCopy", "lastLine", "makeStyle", "basicMouseSelection", "mustFocus", "mouseSel", "rangeForClick", "visual", "findPositionSide", "queryPos", "BadMouseDetail", "lastMouseDown", "lastMouseDownCount", "lastMouseDownTime", "lastTime", "startSel", "multiple", "removed", "startRange", "removeRangeAround", "inputState", "dropText", "direct", "dropPos", "draggedContent", "del", "files", "read", "finishFile", "reader", "data", "captureCopy", "copiedRange", "linewise", "isFocusChange", "focusChangeTransaction", "focus", "getEffect", "updateForFocusChange", "startViewHeight", "appliedFirefoxHack", "wrappingWhiteSpace", "heightChangeFlag", "clearHeightChangeFlag", "HeightOracle", "lineWrapping", "whiteSpace", "lineHeights", "newHeight", "h", "lineLength", "knownHeights", "MeasuredHeights", "heights", "BlockInfo", "_content", "QueryType$1", "QueryType", "Epsilon", "HeightMap", "nodes", "oldDoc", "oracle", "NodeBuilder", "HeightMapText", "split", "brk", "HeightMapBranch", "old", "HeightMapBlock", "_height", "_oracle", "_value", "_type", "_force", "measured", "HeightMapGap", "firstLine", "perLine", "perChar", "totalPerLine", "guess", "lineTop", "linesAbove", "singleHeight", "rightTop", "rightOffset", "subQuery", "rightStart", "mergeGaps", "rebalance", "around", "relevantWidgetHeight", "breaks", "gap", "heightRelevantDecoChanges", "DecorationComparator", "visiblePixelRange", "paddingTop", "parentRect", "fullPixelRange", "LineGap", "gA", "gB", "viewState", "wrapping", "LineGapWidget", "vertical", "ViewState", "IdScaler", "guessWrapping", "viewports", "Viewport", "scaler", "BigScaler", "scaleBlock", "scrollTarget", "contentChanges", "heightChanges", "prevHeight", "scrollAnchor", "viewportChange", "refresh", "domRect", "measureContent", "paddingBottom", "scrollTop", "pixelViewport", "dTop", "dBottom", "inView", "marginTop", "visibleTop", "visibleBottom", "viewHeight", "topPos", "mayMeasure", "halfMargin", "doubleMargin", "addGap", "structure", "avoid", "find$1", "checkLine", "lineStructure", "viewFrom", "viewTo", "marginHeight", "bot", "targetFrac", "findFraction", "spaceFrac", "findPosition", "marginWidth", "fraction", "stateDeco", "ratio", "counted", "heightMap", "vpHeight", "domBase", "obj", "bTop", "bBottom", "theme", "strs", "darkTheme", "baseThemeID", "baseLightID", "baseDarkID", "lightDarkIDs", "buildTheme", "scopes", "baseTheme$1$2", "LineBreakPlaceholder", "DOMReader", "points", "oldLen", "nextView", "point", "re", "nextBreak", "breakSize", "fromView", "isAtEnd", "DOMPoint", "DOMChange", "typeOver", "iHead", "iAnchor", "selPoints", "selectionPoints", "selectionFromPoints", "offFrom", "offTo", "applyDOMChange", "domChange", "newSel", "lastKey", "preferredPos", "preferredSide", "findDiff", "applyDOMChangeInner", "userEvent", "defaultTr", "defaultInsert", "applyDefaultInsert", "mainSel", "replaced", "compositionRange", "rangeChanges", "selOff", "minLen", "adjust", "move", "observeOptions", "useCharData", "DOMObserver", "mutations", "mut", "EditContextManager", "entries", "g", "wasChanged", "safariSelectionRangeHack", "keyCode", "records", "readSelection", "handled", "rec", "childBefore", "findChild", "childAfter", "_c", "curView", "buildSelectionRangeFromRange", "curAnchor", "format", "lineStyle", "thickness", "abort", "_fromB", "reverted", "contextPos", "editorPos", "EditorView", "dispatch", "trs", "redrawn", "attrsChanged", "focusFlag", "dispatchFocus", "pendingKey", "CachedOrder", "listener", "newState", "hadFocus", "prevSpecs", "newPlugins", "sDOM", "scrollAnchorPos", "scrollAnchorHeight", "measuring", "BadMeasure", "editorAttrs", "attrsFromFacet", "contentAttrs", "changedContent", "changedEditor", "div", "request", "initial", "MaxBidiLine", "entry", "scrollLeft", "prefix", "fresh", "cache", "lastDir", "sources", "currentPlatform", "normalizeKeyName", "platform", "alt", "ctrl", "meta", "modifiers", "handleKeyEvents", "runHandlers", "getKeymap", "keymap", "Keymaps", "bindings", "buildKeymap", "runScopeHandlers", "scope", "storedPrefix", "PrefixTimeout", "bound", "isPrefix", "checkPrefix", "is", "command", "preventDefault", "stopPropagation", "scopeObj", "ourObj", "full", "binding", "any", "currentKeyEvent", "charCode", "isChar", "prevented", "ran", "runFor", "cmd", "baseName", "shiftName", "RectangleMarker", "className", "getBase", "rectanglesForRange", "wrappedLine", "lineElt", "leftSide", "rightSide", "startBlock", "endBlock", "visualStart", "visualEnd", "pieces", "drawForLine", "drawForWidget", "between", "horizontal", "addSpan", "fromOpen", "toOpen", "fromCoords", "toCoords", "endPos", "docLine", "spanFrom", "spanTo", "sameMarker", "LayerView", "layerOrder", "markers", "oldI", "marker", "CanHidePrimary", "selectionConfig", "drawSelection", "cursorLayer", "selectionLayer", "hideNativeSelection", "configChanged", "cursors", "prim", "confChange", "setBlinkRate", "themeSpec", "setDropCursorPos", "dropCursorPos", "drawDropCursor", "cursorPos", "outer", "dropCursor", "iterMatches", "matchRanges", "maxLength", "visible", "MatchDecorator", "regexp", "decoration", "decorate", "boundary", "match", "_view", "changeFrom", "changeTo", "_f", "_t", "updateFrom", "updateTo", "fromLine", "toLine", "UnicodeRegexpSupport", "Specials", "Names", "_supportsTabSize", "supportsTabSize", "styles", "specialCharConfig", "highlightSpecialChars", "specialCharPlugin", "_plugin", "TabWidget", "SpecialCharWidget", "DefaultPlaceholder", "placeholder$1", "ph", "highlightActiveLine", "activeLineHighlighter", "lineDeco", "lastLineStart", "MaxOff", "rectangleFor", "startLine", "startOff", "endOff", "startCol", "endCol", "absoluteColumn", "getPos", "rectangleSelectionStyle", "newStart", "newLine", "_extend", "rectangularSelection", "keys", "showCrosshair", "crosshairCursor", "isDown", "Outside", "TooltipViewManager", "createTooltipView", "removeTooltipView", "tooltips", "tooltipViews", "newAbove", "tip", "tooltipView", "windowSpace", "tooltipConfig", "knownHeight", "tooltipPlugin", "showTooltip", "tooltip", "shouldMeasure", "newConfig", "arrow", "editor", "makeAbsolute", "tv", "space", "others", "tView", "arrowHeight", "noOffset", "spaceVert", "arrowLeft", "baseTheme$4", "getTooltip", "panelConfig", "topContainer", "bottomContainer", "getPanel", "panel", "panelPlugin", "showPanel", "PanelGroup", "panels", "mount", "container", "curDOM", "rm", "GutterMarker", "gutterLineClass", "defaults$1", "activeGutters", "gutter", "gutters", "unfixGutters", "gutterView", "SingleGutterView", "vpA", "vpB", "vpOverlap", "detach", "lineClasses", "classSet", "contexts", "UpdateContext", "advanceCursor", "cx", "asArray", "collect", "newElt", "GutterElement", "extraMarkers", "localMarkers", "forLine", "prevMarkers", "sameMarkers", "domPos", "iNew", "iOld", "skipTo", "matched", "lineNumberMarkers", "lineNumberConfig", "NumberMarker", "formatNumber", "lineNumberGutter", "maxLineNumber", "spacer", "max", "lineNumbers", "activeLineGutterMarker", "activeLineGutterHighlighter", "highlightActiveLineGutter", "DefaultBufferLength", "nextPropID", "Range", "NodeProp", "NodeType", "MountedTree", "tree", "overlay", "parser", "noProps", "props", "src", "group", "groups", "NodeSet", "newTypes", "newProps", "CachedNode", "CachedInnerNode", "IterMode", "Tree", "positions", "mounted", "TreeCursor", "TreeNode", "resolveNode$1", "stackIterator", "enter", "leave", "anon", "entered", "balanceRange", "buildTree", "FlatBufferCursor", "buffer", "TreeBuffer", "endIndex", "pick", "checkSide", "startI", "endI", "overlays", "BaseNode", "getChildren", "matchNodeContext", "_tree", "_parent", "BufferNode", "BufferContext", "hasChild", "rPos", "parentStart", "iterStack", "heads", "picked", "newHeads", "StackIterator", "layers", "depth", "mustLeave", "nodeSet", "maxBufferLength", "reused", "minRepeatType", "contextHash", "lookAhead", "takeNode", "minPos", "inRepeat", "lookAheadAtStart", "findBufferSize", "copyToBuffer", "localChildren", "localPositions", "localInRepeat", "lastGroup", "lastEnd", "makeRepeatLeaf", "takeFlatNode", "make", "makeBalanced", "makeTree", "nodeCount", "stopAt", "lastI", "lookAheadProp", "pair", "maxSize", "fork", "minStart", "nodeSize", "localSkipped", "nodeStart", "bufferStart", "nodeSizeCache", "balanceType", "mkTop", "mkTree", "maxChild", "divide", "groupFrom", "groupStart", "groupSize", "nextSize", "only", "NodeWeakMap", "TreeFragment", "fragments", "partial", "minGap", "fI", "nextF", "cI", "nextC", "nextPos", "cut", "fFrom", "fTo", "Parser", "StringInput", "parse", "parseMixed", "nest", "MixedParse", "InnerParse", "checkRanges", "ActiveOverlay", "predicate", "mounts", "stoppedInner", "fragmentCursor", "FragmentCursor$2", "covered", "isCovered", "checkCover", "materialize", "oldMounts", "punchRanges", "enterFragments", "sliceBuf", "buf", "newStack", "innerOffset", "stackPos", "targetI", "StructureCursor", "frag", "gapFrom", "gapTo", "findCoverChanges", "inB", "nextA", "nextB", "nextTagID", "Tag", "modified", "Modifier", "nextModifierID", "sameArray", "powerSet", "styleTags", "byName", "tags", "rest", "rule", "Rule", "ruleNodeProp", "tagHighlighter", "all", "tagClass", "highlightTags", "highlighters", "highlighter", "highlightTree", "putStyle", "HighlightBuilder", "inheritedClass", "getStyleTags", "tagCls", "innerHighlighters", "rangeFrom", "rangeTo", "comment", "typeName", "propertyName", "literal$3", "heading", "keyword", "operator$2", "punctuation", "bracket$2", "tags$1", "languageDataProp", "defineLanguageFacet", "baseData", "sublanguageProp", "Language", "extraExtensions", "syntaxTree", "language", "topNodeAt", "innerNode", "sublang", "lang", "explore", "topLang", "LRLanguage", "DocInput", "stringStart", "currentContext", "ParseContext", "treeLen", "skipped", "scheduleOn", "until", "endTime", "cutFragments", "startLen", "frags", "LanguageState", "newCx", "vpTo", "parseState", "requestIdle", "callback", "timeout", "idle", "isInputPending", "parseWorker", "deadline", "now", "viewportFirst", "err", "languages", "LanguageSupport", "support", "LanguageDescription", "alias", "extensions", "filename", "loadFunc", "load", "descs", "fuzzy", "indentService", "indentUnit", "unit", "getIndentUnit", "indentString", "cols", "ts", "getIndentation", "IndentContext", "service", "syntaxIndentation", "simulateBreak", "simulateDoubleBreak", "override", "overriden", "indentNodeProp", "ast", "indentFor", "strategy", "indentStrategy", "TreeIndentContext", "ignoreClosed", "close", "closed", "delimitedStrategy", "topIndent", "atBreak", "isParent", "bracketedAligned", "openToken", "sim", "openLine", "lineEnd", "delimitedIndent", "closing", "align", "units", "closedAt", "aligned", "flatIndent", "continuedIndent", "except", "matchExcept", "DontIndentBeyond", "indentOnInput", "rules", "indent", "norm", "foldService", "foldNodeProp", "foldInside", "syntaxFolding", "isUnfinished", "foldable", "mapRange", "foldEffect", "unfoldEffect", "selectedLines", "foldState", "folded", "foldExists", "preparePlaceholder", "foldConfig", "PreparedFoldWidget", "foldWidget", "onSelection", "findFold", "maybeEnable", "codeFolding", "foldCode", "announceFold", "unfoldCode", "fold", "lineFrom", "lineTo", "foldAll", "unfoldAll", "foldKeymap", "defaultConfig$2", "baseTheme$1$1", "widgetToDOM", "prepared", "onclick", "foldGutterDefaults", "FoldMarker", "foldGutter", "fullConfig", "canFold", "canUnfold", "HighlightStyle", "modSpec", "def", "scopeOpt", "highlighterFacet", "fallbackHighlighter", "getHighlighters", "syntaxHighlighting", "treeHighlighter", "themeType", "TreeHighlighter", "styleChange", "decoratedToMapped", "defaultHighlightStyle", "baseTheme$3", "DefaultScanDist", "DefaultBrackets", "bracketMatchingConfig", "defaultRenderMatch", "matchingMark", "nonmatchingMark", "bracketMatchingUnique", "matchBrackets", "bracketMatching", "bracketMatchingHandle", "matchingNodes", "brackets", "byProp", "findHandle", "hasHandle", "maxScanDistance", "matches", "handle", "matchMarkedBrackets", "matchPlainBrackets", "_state", "_pos", "token", "matching", "firstToken", "endHandle", "tokenType", "startCh", "bracket", "startToken", "basePos", "noTokens", "typeArray", "warned", "byTag", "defaultTable", "legacyName", "createTokenType", "warnForPart", "msg", "tagStr", "tags$1$1", "toggleComment", "getConfig", "toggleLineComment", "toggleBlockCommentByLine", "option", "changeLineComment", "toggleBlockComment", "changeBlockComment", "o", "selectedLineRanges", "SearchMargin", "findBlockComment", "spaceBefore", "spaceAfter", "beforeOff", "startText", "endText", "startSpace", "endSpace", "tokens", "comments", "prevLine", "minIndent", "empty", "single", "changeSet", "fromHistory", "isolateHistory", "invertedEffects", "historyConfig", "isAdjacent", "adj", "historyField_", "HistoryState", "fromHist", "item", "HistEvent", "updateBranch", "addSelection", "isolate", "time", "history", "undo", "redo", "historyState", "undoSelection", "redoSelection", "startSelection", "selectionsAfter", "none$2", "invert", "selections", "branch", "maxLen", "newEvent", "newBranch", "eqSelectionShape", "conc", "MaxSelectionsPerEvent", "lastEvent", "sels", "popSelection", "addMappingToBranch", "mapEvent", "extraSelections", "mappedChanges", "fullMapping", "joinableUserEvent", "undone", "prevTime", "prevUserEvent", "newGroupDelay", "onlySelection", "historyKeymap", "updateSel", "setSel", "moveSel", "how", "rangeEnd", "cursorByChar", "ltrAtCursor", "cursorCharLeft", "cursorCharRight", "cursorByGroup", "cursorGroupLeft", "cursorGroupRight", "interestingNode", "bracketProp", "moveBySyntax", "cursorSyntaxLeft", "cursorSyntaxRight", "cursorByLine", "cursorLineUp", "cursorLineDown", "pageInfo", "selfScroll", "marginBottom", "cursorByPage", "page", "scrollRect", "scrollBottom", "cursorPageUp", "cursorPageDown", "moveByLineBoundary", "cursorLineBoundaryForward", "cursorLineBoundaryBackward", "cursorLineBoundaryLeft", "cursorLineBoundaryRight", "cursorLineStart", "cursorLineEnd", "toMatchingBracket", "cursorMatchingBracket", "extendSel", "selectByChar", "selectCharLeft", "selectCharRight", "selectByGroup", "selectGroupLeft", "selectGroupRight", "selectSyntaxLeft", "selectSyntaxRight", "selectByLine", "selectLineUp", "selectLineDown", "selectByPage", "selectPageUp", "selectPageDown", "selectLineBoundaryForward", "selectLineBoundaryBackward", "selectLineBoundaryLeft", "selectLineBoundaryRight", "selectLineStart", "selectLineEnd", "cursorDocStart", "cursorDocEnd", "selectDocStart", "selectDocEnd", "selectAll$1", "selectLine", "selectedLineBlocks", "selectParentSyntax", "simplifySelection", "deleteBy", "towards", "skipAtomic", "deleteByChar", "byIndentUnit", "targetPos", "drop", "deleteCharBackward", "deleteCharForward", "deleteByGroup", "nextChar", "deleteGroupBackward", "deleteGroupForward", "deleteToLineEnd", "deleteLineBoundaryBackward", "deleteLineBoundaryForward", "splitLine", "transposeChars", "blocks", "moveLine", "nextLine", "moveLineUp", "moveLineDown", "copyLine", "copyLineUp", "copyLineDown", "deleteLine", "isBetweenBrackets", "closedBy", "insertNewlineAndIndent", "newlineAndIndent", "insertBlankLine", "atEof", "explode", "changeBySelectedLine", "atLine", "indentSelection", "indentMore", "indentLess", "keep", "toggleTabFocusMode", "emacsStyleKeymap", "standardKeymap", "defaultKeymap", "indentWithTab", "crelt", "basicNormalize", "SearchCursor", "query", "normalize", "test", "baseFlags", "RegExpCursor", "MultilineRegExpCursor", "toCharEnd", "flattened", "FlattenedDoc", "cached", "cachedFrom", "validRegExp", "createLineDialog", "dialogEffect", "go", "sign", "ln", "cl", "percent", "pc", "dialogField", "gotoLine", "baseTheme$1", "defaultHighlightOptions", "highlightConfig", "highlightSelectionMatches", "defaultTheme", "matchHighlighter", "matchDeco", "mainMatchDeco", "insideWordBoundaries", "insideWord", "word", "selectWord", "findNextOccurrence", "fullWord", "cycled", "selectNextOccurrence", "searchedText", "searchConfigFacet", "SearchPanel", "SearchQuery", "_", "RegExpQuery", "StringQuery", "st", "regexpCursor", "stringCursor", "stringWordTest", "categorizer", "bufPos", "charBefore", "charAfter", "_result", "regexpWordTest", "setSearchQuery", "togglePanel", "searchState", "SearchState", "defaultQuery", "createSearchPanel", "matchMark", "selectedMatchMark", "searchHighlighter", "selected", "searchCommand", "openSearchPanel", "findNext", "announceMatch", "selectSearchInput", "findPrevious", "selectMatches", "selectSelectionMatches", "replaceNext", "replacement", "replaceAll", "announceText", "fallback", "_d", "_e", "selText", "getSearchInput", "searchInput", "searchExtensions", "closeSearchPanel", "searchKeymap", "button", "AnnounceMargin", "Break", "baseTheme$2", "CompletionContext", "explicit", "expr", "ensureAnchor", "toSet", "chars", "words", "prefixMatch", "label", "completeFromList", "list", "validFor", "ifNotIn", "Option", "completion", "score", "addStart", "addEnd", "pickedCompletion", "insertCompletionText", "SourceCache", "asSource", "startCompletionEffect", "closeCompletionEffect", "FuzzyMatcher", "pattern", "upper", "byWord", "firstSize", "anyTo", "preciseTo", "byWordTo", "byWordFolded", "adjacentTo", "adjacentStart", "adjacentEnd", "hasLower", "wordAdjacent", "StrictMatcher", "completionConfig", "defaultPositionInfo", "joinClass", "info", "rtl", "narrow", "maxWidth", "spaceLeft", "spaceRight", "infoWidth", "infoHeight", "spaceBelow", "optionContent", "icon", "_s", "_v", "labelElt", "detailElt", "rangeAroundSelected", "CompletionTooltip", "stateField", "applyCompletion", "cState", "prevState", "disabled", "infoResult", "wrap", "destroy", "opt", "listRect", "infoRect", "selRect", "ul", "curSection", "section", "header", "li", "completionTooltip", "self", "sortOptions", "addOption", "getMatch", "matcher", "sectionOrder", "cmp", "CompletionDialog", "timestamp", "makeAttrs", "selectedValue", "createTooltip", "CompletionState", "none$1", "ActiveSource", "sameResults", "setSelectedEffect", "baseAttrs", "noAttrs", "getUpdateType", "typing", "explicitPos", "setActiveEffect", "ActiveResult", "checkValid", "completionState", "apply", "moveCompletionSelection", "step", "acceptCompletion", "startCompletion", "closeCompletion", "RunningQuery", "MaxUpdateCount", "MinAbortTime", "completionPlugin", "doesReset", "delay", "q", "dialog", "windows", "commitCharacters", "commitChars", "baseTheme", "FieldPos", "FieldRange", "Snippet", "fieldPositions", "lineObj", "baseIndent", "tabs", "template", "rawName", "brace", "fieldMarker", "fieldRange", "ActiveSnippet", "setActive", "moveToField", "snippetState", "fieldSelection", "snippet", "addSnippetKeymap", "snippetPointerHandler", "moveField", "defaultSnippetKeymap", "snippetKeymap", "maps", "snippetCompletion", "closeBracketEffect", "closedBracket", "bracketState", "closeBrackets", "inputHandler", "definedClosing", "config$1", "android$1", "insertBracket", "closeBracketsKeymap", "dont", "prevChar", "tok", "handleSame", "handleOpen", "closedBracketAt", "handleClose", "closeBefore", "_open", "allowTriple", "stringPrefixes", "canStartStringAt", "probablyInString", "quoteToken", "prefixes", "maxPrefix", "quotePos", "charCat", "autocompletion", "completionKeymapExt", "completionKeymap", "completionStatus", "CompositeBlock", "parentHash", "hash", "Type", "LeafBlock", "Line", "skipSpace", "skipForList", "bl", "isOrderedList", "isBulletList", "isHorizontalRule", "DefaultSkipMarkup", "space$2", "_cx", "skipSpaceBack", "isFencedCode", "isBlockquote", "breaking", "count", "isSetextUnderline", "inList", "isAtxHeading", "EmptyLine", "CommentEnd", "ProcessingEnd", "HTMLBlockStyle", "isHTMLBlock", "getListIndent", "indentAfter", "indented", "addCodeText", "DefaultBlockParsers", "pendingMarks", "codeStart", "fenceEnd", "infoFrom", "infoTo", "textStart", "textEnd", "newBase", "endOfSpace", "trailing", "nodeType", "LinkReferenceParser", "leaf", "parseLinkLabel", "parseURL", "title", "parseLinkTitle", "titleEnd", "SetextHeadingParser", "underline", "underlineMark", "DefaultLeafBlocks", "DefaultEndLeaf", "scanLineResult", "BlockContext", "FragmentCursor$1", "markI", "taken", "toRelative", "textOffset", "rangeI", "nextFrom", "eol", "none", "injectMarks", "injectGaps", "inline", "TreeElement", "Buffer", "dummies", "movePastNext", "inclusive", "reuse", "MarkdownParser", "blockParsers", "leafBlockParsers", "blockNames", "endLeafBlock", "skipContextMarkup", "inlineParsers", "inlineNames", "wrappers", "w", "resolveConfig$1", "nonEmpty", "nodeTypes", "composite", "findName", "InlineContext", "wrapA", "wrapB", "names", "elts", "Element$1", "EmphasisUnderscore", "EmphasisAsterisk", "LinkStart", "ImageStart", "InlineDelimiter", "Escapable", "Punctuation", "DefaultInline", "escaped", "curSize", "url", "procInst", "pBefore", "pAfter", "sBefore", "sAfter", "leftFlanking", "rightFlanking", "canOpen", "canClose", "link", "finishLink", "dest", "requireNonWS", "emp", "closeSize", "elements", "eI", "NotLast", "fragEnd", "blockI", "prevI", "abs", "markdownHighlighting", "parser$4", "leftOverSpace", "parseCode", "codeParser", "htmlParser", "infoNode", "StrikethroughDelim", "Strikethrough", "parseRow", "cellStart", "cellEnd", "esc", "parseCell", "hasPipe", "delimiterLine", "TableParser", "lineText", "firstRow", "Table", "TaskParser", "TaskList", "autolinkRE", "urlRE", "lastTwoDomainWords", "emailRE", "xmppResourceRE", "autolinkURLEnd", "autolinkEmailEnd", "GFM", "absPos", "noBracket", "parseSubSuper", "Superscript", "Subscript", "Emoji", "Stack", "reducePos", "bufferBase", "curContext", "StackContext", "action", "lookaheadRecord", "dPrec", "baseStateID", "term", "mustSink", "mustMove", "nextState", "nextStart", "nextEnd", "isNode", "SimulatedStack", "nextStates", "reduce", "backup", "rDepth", "dialectID", "tracker", "goto", "StackBufferCursor", "decodeArray", "out", "digit", "CachedToken", "nullToken", "InputStream", "resolved", "endOffset", "nextChunk", "TokenGroup", "readToken", "LocalTokenGroup", "precTable", "elseToken", "ExternalTokenizer", "precOffset", "groupMask", "dialect", "accEnd", "overrides", "low", "high", "findOffset", "tableData", "tableOffset", "iPrev", "verbose", "stackIDs", "cutAt", "FragmentCursor", "fr", "TokenCache", "stream", "actionIndex", "tokenizers", "mask", "tokenizer", "Parse", "stacks", "newStacks", "stopped", "stoppedTokens", "finished", "findFinished", "maxRemaining", "strictCx", "cxHash", "defaultReduce", "actions", "localStack", "pushStackDedup", "restarted", "tokenEnd", "forceBase", "Dialect", "ContextTracker", "LRParser", "nodeNames", "topTerms", "nodeProps", "setProp", "nodeID", "propSpec", "tokenArray", "getSpecializer", "loose", "table", "groupTag", "terminal", "flag", "deflt", "scriptText", "StartCloseScriptTag", "styleText", "StartCloseStyleTag", "textareaText", "StartCloseTextareaTag", "EndTag", "SelfClosingEndTag", "StartTag", "StartScriptTag", "StartStyleTag", "StartTextareaTag", "StartSelfClosingTag", "StartCloseTag", "NoMatchStartCloseTag", "MismatchedStartCloseTag", "missingCloseTag", "IncompleteCloseTag", "commentContent$1", "Element", "TagName", "Attribute", "AttributeName", "AttributeValue", "UnquotedAttributeValue", "ScriptText", "StyleText", "TextareaText", "OpenTag", "CloseTag", "Dialect_noMatch", "Dialect_selfClosing", "selfClosers$1", "implicitlyClosed", "closeOnOpen", "nameChar", "isSpace", "cachedName", "cachedInput", "cachedPos", "tagNameAfter", "question$1", "bang", "lessThan", "greaterThan", "slash$1", "dash$1", "ElementContext", "startTagTerms", "elementContext", "tagStart", "commentContent", "dashes", "inForeignElement", "endTag", "selfClosing", "contentTokenizer", "textToken", "endToken", "lastState", "matchedLen", "scriptTokens", "styleTokens", "textareaTokens", "htmlHighlighting", "parser$3", "getAttrs", "openTag", "att", "findTagName", "tagNameNode", "maybeNest", "configureNesting", "attributes", "script", "textarea", "tagName", "nameNode", "descendantOp", "Unit", "callee", "identifier$2", "VariableName", "space$1", "colon", "parenL", "underscore", "bracketL", "dash", "period", "ampersand", "backslash", "newline$1", "isAlpha$2", "isDigit", "identifiers", "descendant", "unitToken", "cssHighlighting", "spec_callee", "spec_AtKeyword", "spec_identifier$1", "parser$2", "_properties", "properties", "pseudoClasses", "identifier$1", "variable", "isVarArg", "VariablesByNode", "declSelector", "astTop", "variableNames", "isVariable", "cssCompletionSource", "isDash", "cssLanguage", "css$1", "noSemi", "incdec", "incdecPrefix", "questionDot", "JSXStartTag", "insertSemi", "spaces", "newline", "LineComment", "BlockComment", "Dialect_jsx", "braceR", "semicolon", "slash", "star", "plus", "minus", "lt", "comma", "question", "dot", "trackNewline", "insertSemicolon", "noSemicolon", "operatorToken", "mayPostfix", "identifierChar", "jsx$1", "jsHighlight", "spec_identifier", "spec_word", "spec_LessThan", "parser$1", "snippets", "typescriptSnippets", "cache$1", "ScopeNodes", "defID", "functionContext", "gatherCompletions", "getScope", "completions", "gather", "Identifier", "dontComplete", "localCompletionSource", "isWord", "javascriptLanguage", "isCase", "jsxSublanguage", "typescriptLanguage", "jsxLanguage", "tsxLanguage", "kwCompletion", "keywords", "typescriptKeywords", "javascript", "autoCloseTags$1", "findOpenTag", "elementName$2", "android", "closeTags", "Targets", "Charsets", "Methods", "Encs", "Bool", "S", "Tags", "GlobalAttrs", "eventAttributes", "Schema", "extraTags", "extraAttrs", "elementName$1", "findParentElement", "allowedChildren", "schema", "parentInfo", "openTags", "identifier", "completeTag", "completeCloseTag", "completeStartTag", "completeAttrName", "localAttrs", "attrName", "completeAttrValue", "quoteStart", "quoteEnd", "htmlCompletionFor", "htmlCompletionSource", "htmlCompletionSourceWith", "jsonParser", "defaultNesting", "defaultAttrs", "htmlPlain", "endElt", "htmlLanguage", "html$1", "autoCloseTags", "selfClosers", "insertTransaction", "didType", "data$1", "headingProp", "commonmark", "isHeading", "isList", "findSectionEnd", "headerNode", "headerIndent", "mkLang", "commonmarkLanguage", "markdownLanguage", "getCodeParser", "defaultLanguage", "Context", "itemNumber", "getContext$1", "renumberList", "normalizeIndent", "blank", "insertNewlineContinueMarkup", "emptyLine", "second", "delTo", "blankLine", "quoted", "continued", "nonTightList", "isMark", "line1", "line2", "contextNodeForDelete", "markdownKeymap", "spaceEnd", "htmlNoMatch", "markdown", "codeLanguages", "defaultCodeLanguage", "addKeymap", "completeHTMLTags", "defaultCode", "htmlTagCompletion", "htmlTagCompletions", "_tagCompletions", "namedColors", "__rest", "pickerState", "ColorType", "rgbCallExpRegex", "hslCallExpRegex", "hexRegex", "discoverColorsInCSS", "innerTree", "overlayTree", "ret", "overlayFrom", "overlayTo", "maybeWidgetOptions", "callExp", "parseCallExpression", "parseColorLiteral", "colorName", "parseNamedColor", "color", "rgbToHex", "hslToHex", "colorLiteral", "alpha", "toFullHex", "colorPickersDecorations", "discoverColors", "widgets", "ColorPickerWidget", "wo", "rgbComponentToHex", "component", "numericValue", "decimalToHex", "decimal", "hex", "hexToRGBComponents", "sFloat", "lFloat", "hslToRGB", "hue", "saturation", "luminance", "temp1", "temp2", "tempR", "clamp", "tempG", "tempB", "red", "hueToRGB", "green", "blue", "num", "tempHue", "rgbToHSL", "redPercent", "greenPercent", "bluePercent", "min", "wrapperClassName", "picker", "wrapper", "colorPickerTheme", "colorPicker", "converted", "__defProp", "__defProps", "__getOwnPropDescs", "__getOwnPropSymbols", "__hasOwnProp", "__propIsEnum", "__defNormalProp", "__spreadValues", "__spreadProps", "__publicField", "isNumber$3", "code2", "isAlpha$1", "isAlphaNumericWord", "isAlphaWord", "isWhiteSpace$4", "isSpace$2", "isQuote$3", "Scanner$1", "ok", "message", "ScannerError$1", "tokenScanner$1", "peek$3", "scanner", "slice", "readable$1", "consume$2", "token2", "error$2", "abbreviation", "abbr", "statements", "ctx", "element$2", "isChildOperator", "isSiblingOperator$1", "isClimbOperator", "isGroupStart", "isBracket$2", "repeater", "elem", "elementName", "isEmpty", "isRepeater", "getText", "shortAttribute", "attributeSet", "isCloseOperator", "isAttributeSetStart", "attribute", "isAttributeSetEnd", "isWhiteSpace$3", "isOperator$2", "createLiteral$1", "literal$2", "isEquals", "quote2", "isQuote$2", "allowBrackets", "isCapitalizedLiteral", "isClassNameOperator", "isElementName", "isTextStart", "isOpen", "isSingle", "isLiteral$2", "tokenize$1", "getToken$1", "field$3", "repeaterPlaceholder", "repeaterNumber", "repeater$1", "whiteSpace$1", "literal$1$1", "operator$1", "quote", "bracket$1", "isAllowedOperator", "isElementName$1", "isAllowedSpace", "isAllowedRepeater", "bracketType", "isOpenBracket$2", "op", "operatorType$1", "implicit", "reverse", "consumePlaceholder$2", "operators", "tokenVisitor", "repeater2", "lastIx", "parentIx", "parentRepeater", "stringify$1", "urlRegex", "emailRegex", "convert", "textInserted", "cleanText", "convertGroup", "varValue", "deepest", "deepestNode", "last$2", "text2", "insertText", "insertHref", "convertStatement", "original", "repeat", "items", "isGroup", "convertElement", "stringifyName", "stringifyValue$1", "convertAttribute", "isField$1", "attachRepeater", "implied", "isBoolean", "valueType", "href", "hrefAttribute", "parseAbbreviation", "tokenize", "isValue2", "getToken", "mergeTokens", "shouldConsumeDashAfter", "operator", "short", "field$2", "numberValue", "colorValue", "stringValue", "literal$1", "consumePlaceholder$1", "isIdentPrefix", "isKeyword", "isLiteral", "createLiteral", "consumeNumber$1", "rawValue", "valueStart", "color2", "isHex", "colorAlpha", "parseColor", "isBracket", "operatorType", "afterNegative", "hasDecimal", "prevPos", "hasFloat", "last$1", "tokenScanner", "peek$2", "readable", "consume$1", "error$1", "property2", "consumeProperty", "isSiblingOperator", "important", "valueFragment", "valueMode", "isLiteral$1", "isFunctionStart", "isValueDelimiter", "isWhiteSpace$2", "isImportant", "consumeValue", "isFragmentDelimiter", "inArgument", "args", "isValue", "consumeArguments", "isOpenBracket$1", "isCloseBracket$1", "isArgumentDelimiter", "isBracket$1", "isOperator$1", "operator2", "t1", "t2", "parse$2", "mergeAttributes", "config2", "lookup", "attrName2", "prev2", "mergeValue", "mergeDeclarations", "next2", "glue", "append", "walk", "fn", "ancestors", "findDeepest", "resolveSnippets", "reversed", "resolve", "snippet2", "snippetAbbr", "walkResolve", "topNode", "mergeNodes", "createOutputStream", "push", "processText", "_push", "pushString", "splitByLines", "il", "pushNewline", "pushIndent", "pushField", "placeholder", "field2", "strCase", "attrQuote", "isBooleanAttribute", "selfClose", "isInline", "elementMap", "implicitTag", "resolveImplicitTag", "getParentElement", "contextName", "parentName", "lowercase", "latin", "ru", "sp", "vocabularies", "reLorem", "lorem", "db", "minWordCount", "maxWordCount", "wordCount", "rand", "findRepeater", "paragraph", "sample", "iterations", "choice", "sentence", "capitalize", "insertCommas", "hasComma", "totalCommas", "dict", "startWithCommon", "totalWords", "element2", "jsx", "rename", "xsl", "matchesName", "isAllowed", "reElement", "reModifier", "blockCandidates1", "blockCandidates2", "bem", "expandClassNames", "expandShortNotation", "getBEMData", "classNames", "ix", "uniqueClass", "findBlockName", "updateClass", "path", "originalClass", "getBlockName", "arrClassNames", "classValue", "stringifyValue", "parseBEM", "getBEMDataFromContext", "find", "walk$1", "visitor", "createWalkState", "caret", "isSnippet", "isInlineElement", "isField", "pushTokens", "largestIndex", "splitByLines$1", "shouldOutputAttribute", "consumePlaceholder", "peek", "namePos", "isTokenStart", "isToken", "createCommentState", "commentNodeBefore", "shouldComment", "output", "commentNodeAfter", "htmlTagRegex", "html", "shouldFormat", "getIndent", "pushAttribute", "pushSnippet", "innerFormat", "hasNewline", "startsWithBlockTag", "lQuote", "rQuote", "fieldIx", "adjacentInline", "indentFormat", "element$1", "primary", "secondary", "collectAttributes", "shouldFormat$1", "pushPrimaryAttributes", "pushSecondaryAttributes", "pushValue", "isPrimaryAttribute", "lineLengths", "valueLength", "haml", "slim", "pug", "formatters", "parse$1", "oldTextValue", "parseOpt", "transform", "stringify", "reProperty", "createSnippet", "parsed", "parseValue", "cssVal", "collectKeywords", "snippetsSort", "cur2", "isProperty", "scoreMatch", "str1", "str2", "partialMatch", "str1Len", "str2Len", "minLength", "ch1", "ch2", "acronym", "matchRatio", "delta", "maxScore", "sum", "shortHex", "asHex", "asRGB", "isShortHex", "toShortHex", "toHex", "frac", "digits", "pad", "css", "property", "isJSON", "toCamelCase", "propertyValue", "outputImportant", "outputToken", "getSingleNumeric", "getQuote", "outputValue", "separator", "letter", "gradientName", "parse$1$1", "convertSnippets", "isValueScope", "filteredSnippets", "getSnippetsForScope", "resolveNode", "resolveGradient", "propName", "resolveValueKeywords", "findBestMatch", "resolveAsProperty", "resolveAsSnippet", "resolveNumericValue", "gradientFn", "cssValue", "field$1", "inlineValue", "getUnmatchedPart", "kw", "resolveKeyword", "defaultValue", "hasField", "wrapWithField", "minScore", "reField", "inputValue", "outputValue2", "literal", "tail", "matchedItem", "getScoringPart", "lastPos", "aliases", "unitless", "markupSnippets", "stylesheetSnippets", "xslSnippets", "pugSnippets", "variables", "defaultSyntaxes", "defaultConfig$1", "syntaxConfig", "parseSnippets", "resolveConfig", "globals", "syntax", "mergedData", "typeDefaults", "typeOverride", "syntaxDefaults", "syntaxOverride", "backwardScanner", "sol", "peek$1", "previous", "consume", "consumeWhile", "isQuote$1", "consumeQuoted", "bracePairs", "isHtml", "isWhiteSpace$1", "consumeIdent", "consumeAttributeWithUnquotedValue", "consumeAttribute", "consumeAttributeWithQuotedValue", "isCloseBracket", "isOpenBracket", "isUnquotedValue", "isIdent", "isAlpha", "isNumber$2", "specialChars", "defaultOptions$1$1", "extractAbbreviation", "opt2", "offsetPastAutoClosed", "getStartOffset", "isCloseBrace", "isOpenBrace", "isAbbreviation", "abbreviation2", "compiledPrefix", "consumePair", "consumeArray", "consumed", "expandAbbreviation$1", "resolvedConfig", "stylesheet", "markup", "tabStopStart", "tabStopEnd", "getCaret", "substr", "contains", "isQuote", "getAttributeValueRange", "getTagAttributes", "attrNameNode", "attrValueNode", "rangeEmpty", "getSelectionsFromSnippet", "nodeToHTMLType", "getContext", "getCSSContext", "getHTMLContext", "embedded", "getSelectorRange", "getPropertyRanges", "getContextMatchFromTag", "detectCSSContextFromHTML", "getAttributeName", "attrValue", "cleanValueRange", "getInlineCSSContext", "tagName2", "ptr", "parseInlineProps", "propList", "xmlSyntaxes", "htmlSyntaxes", "cssSyntaxes", "jsxSyntaxes", "stylesheetSyntaxes", "syntaxInfo", "docSyntax", "getSyntaxType", "isXML", "isHTML", "isCSS", "isJSX", "getMarkupAbbreviationContext", "getStylesheetAbbreviationContext", "expand", "outputOpt", "pluginConfig", "getEmmetConfig", "extract$1", "getOptions", "getOutputOptions", "resetCache", "defaultConfig", "baseConfig", "preview", "createPreview", "nextValue", "emmetCompletionSource", "tracker2", "trackerField", "context2", "tracker3", "completionOptionsFromTracker", "cssCompletion", "JSX_PREFIX", "trackerMark", "resetTracker", "forceTracker", "getActivationContext", "createTracker", "handleUpdate", "abbreviationPreview", "getAbbreviationPreview", "prevTooltip", "canDisplayPreview", "previewConfig", "state2", "abbreviationTracker", "decors", "expandTracker", "expanded", "tabKeyHandler", "escKeyHandler", "trackerTheme", "typingAbbreviation", "canStartTyping", "getSyntaxFromPos", "getCSSActivationContext", "isTypingBeforeSelector", "isValidPrefix", "isValidAbbreviationStart", "params", "forced", "hasInvalidChars", "parsedAbbr", "simple", "isSimpleMarkupAbbreviation", "createPreviewConfig", "error2", "previewField", "hasSnippet", "_fromA", "_toA", "abbrRange", "nextTracker", "completionInfo", "expandAbbreviation", "updateAbbreviation", "wrapAbbreviationField", "undoUpdate", "nextAbbreviation", "nextAbbr", "nextSel", "evt", "basicSetup", "preprocessor", "newExtensions", "getEditorExtensions", "commonKeymap", "htmlMarkdownKeymap", "htmlExtensions", "initEditors", "htmlEditor", "newHtml", "cssEditor", "newCSS", "jsEditor", "newJS", "dispatchChanges", "cutSelection", "copySelection", "pasteText", "selectAll", "selectedText", "error"] } diff --git a/go/src/App.js b/go/src/App.js index 891a2d1..36b27f9 100644 --- a/go/src/App.js +++ b/go/src/App.js @@ -3842,26 +3842,30 @@ ${project.description}`; let cssBuildItemsString = ''; let TailwindNoReset = null; const promises = project.libraries.map(async library => { - const data = await getFile(library); - const parts = library.split("/"); - const name = parts[parts.length - 1]; + try { + const data = await getFile(library); + const parts = library.split("/"); + const name = parts[parts.length - 1]; - // Check if the library is one of the Tailwind files to ignore - if (name === "tailwind-mod-noreset.min.js") { - TailwindNoReset = true; - } - - // Assuming libraries have .css extensions for simplicity - if (name.endsWith('.css')) { - cssContent += data + '\n'; - cssBuildItems.push(name); - cssBuildItemsString += `libraries/${name} `; - zip.folder('libraries').file(name, data); - } - - // Assuming libraries have .js extensions for simplicity - if (name.endsWith('.js')) { - zip.folder('libraries').file(name, data); + // Check if the library is one of the Tailwind files to ignore + if (name === "tailwind-mod-noreset.min.js") { + TailwindNoReset = true; + } + + // Assuming libraries have .css extensions for simplicity + if (name.endsWith('.css')) { + cssContent += data + '\n'; + cssBuildItems.push(name); + cssBuildItemsString += `libraries/${name} `; + zip.folder('libraries').file(name, data); + } + + // Assuming libraries have .js extensions for simplicity + if (name.endsWith('.js')) { + zip.folder('libraries').file(name, data); + } + } catch (error) { + console.warn(`Failed to fetch library ${library}:`, error); } }); await Promise.all(promises);