}`,{label:"class",detail:"definition",type:"keyword"}),X('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),X('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],he=new we,Le=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function q(e){return(O,a)=>{let t=O.node.getChild("VariableDefinition");return t&&a(t,e),!0}}const Gi=["FunctionDeclaration"],Ai={FunctionDeclaration:q("function"),ClassDeclaration:q("class"),ClassExpression:()=>!0,EnumDeclaration:q("constant"),TypeAliasDeclaration:q("type"),NamespaceDeclaration:q("namespace"),VariableDefinition(e,O){e.matchContext(Gi)||O(e,"variable")},TypeDefinition(e,O){O(e,"type")},__proto__:null};function Me(e,O){let a=he.get(O);if(a)return a;let t=[],i=!0;function r(s,n){let o=e.sliceString(s.from,s.to);t.push({label:o,type:n})}return O.cursor(YO.IncludeAnonymous).iterate(s=>{if(i)i=!1;else if(s.name){let n=Ai[s.name];if(n&&n(s,r)||Le.has(s.name))return!1}else if(s.to-s.from>8192){for(let n of Me(e,s.node))t.push(n);return!1}}),he.set(O,t),t}const ue=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,He=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName"];function Ii(e){let O=C(e.state).resolveInner(e.pos,-1);if(He.indexOf(O.name)>-1)return null;let a=O.name=="VariableName"||O.to-O.from<20&&ue.test(e.state.sliceDoc(O.from,O.to));if(!a&&!e.explicit)return null;let t=[];for(let i=O;i;i=i.parent)Le.has(i.name)&&(t=t.concat(Me(e.state.doc,i)));return{options:t,from:a?O.from:e.pos,validFor:ue}}const x=sO.define({name:"javascript",parser:zi.configure({props:[nO.add({IfStatement:j({except:/^\s*({|else\b)/}),TryStatement:j({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:qt,SwitchBody:e=>{let O=e.textAfter,a=/^\s*\}/.test(O),t=/^\s*(case|default)\b/.test(O);return e.baseIndent+(a?0:t?1:2)*e.unit},Block:Rt({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":j({except:/^{/}),JSXElement(e){let O=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(O?0:e.unit)},JSXEscape(e){let O=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(O?0:e.unit)},"JSXOpenTag JSXSelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),lO.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":ye,BlockComment(e){return{from:e.from+2,to:e.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Fe={test:e=>/^JSX/.test(e.name),facet:zt({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Ke=x.configure({dialect:"ts"},"typescript"),Ot=x.configure({dialect:"jsx",props:[Te.add(e=>e.isTop?[Fe]:void 0)]}),et=x.configure({dialect:"jsx ts",props:[Te.add(e=>e.isTop?[Fe]:void 0)]},"typescript"),Ni="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(e=>({label:e,type:"keyword"}));function tt(e={}){let O=e.jsx?e.typescript?et:Ot:e.typescript?Ke:x;return new oO(O,[x.data.of({autocomplete:Ye(He,ve(ji.concat(Ni)))}),x.data.of({autocomplete:Ii}),e.jsx?Di:[]])}function Ei(e){for(;;){if(e.name=="JSXOpenTag"||e.name=="JSXSelfClosingTag"||e.name=="JSXFragmentTag")return e;if(e.name=="JSXEscape"||!e.parent)return null;e=e.parent}}function fe(e,O,a=e.length){for(let t=O==null?void 0:O.firstChild;t;t=t.nextSibling)if(t.name=="JSXIdentifier"||t.name=="JSXBuiltin"||t.name=="JSXNamespacedName"||t.name=="JSXMemberExpression")return e.sliceString(t.from,Math.min(t.to,a));return""}const Bi=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Di=v.inputHandler.of((e,O,a,t)=>{if((Bi?e.composing:e.compositionStarted)||e.state.readOnly||O!=a||t!=">"&&t!="/"||!x.isActiveAt(e.state,O,-1))re
`;function ut(e,O,a){let t=Object.create(null);t.true=t.false=ir,t.null=t.unknown=rr;for(let i of e.split(" "))i&&(t[i]=Qt);for(let i of O.split(" "))i&&(t[i]=ct);for(let i of(a||"").split(" "))i&&(t[i]=gr);return t}const Zr="array binary bit boolean char character clob date decimal double float int integer interval large national nchar nclob numeric object precision real smallint time timestamp varchar varying ",br="absolute action add after all allocate alter and any are as asc assertion at authorization before begin between both breadth by call cascade cascaded case cast catalog check close collate collation column commit condition connect connection constraint constraints constructor continue corresponding count create cross cube current current_date current_default_transform_group current_transform_group_for_type current_path current_role current_time current_timestamp current_user cursor cycle data day deallocate declare default deferrable deferred delete depth deref desc describe descriptor deterministic diagnostics disconnect distinct do domain drop dynamic each else elseif end end-exec equals escape except exception exec execute exists exit external fetch first for foreign found from free full function general get global go goto grant group grouping handle having hold hour identity if immediate in indicator initially inner inout input insert intersect into is isolation join key language last lateral leading leave left level like limit local localtime localtimestamp locator loop map match method minute modifies module month names natural nesting new next no none not of old on only open option or order ordinality out outer output overlaps pad parameter partial path prepare preserve primary prior privileges procedure public read reads recursive redo ref references referencing relative release repeat resignal restrict result return returns revoke right role rollback rollup routine row rows savepoint schema scroll search second section select session session_user set sets signal similar size some space specific specifictype sql sqlexception sqlstate sqlwarning start state static system_user table temporary then timezone_hour timezone_minute to trailing transaction translation treat trigger under undo union unique unnest until update usage user using value values view when whenever where while with without work write year zone ",xO={backslashEscapes:!1,hashComments:!1,spaceAfterDashes:!1,slashComments:!1,doubleQuotedStrings:!1,doubleDollarQuotedStrings:!1,unquotedBitLiterals:!1,treatBitsAsBytes:!1,charSetCasts:!1,operatorChars:"*+-%<>!=&|~^/",specialVar:"?",identifierQuotes:'"',words:ut(br,Zr)};function kr(e,O,a,t){let i={};for(let r in xO)i[r]=(e.hasOwnProperty(r)?e:xO)[r];return O&&(i.words=ut(O,a||"",t)),i}function ft(e){return new b(O=>{var a;let{next:t}=O;if(O.advance(),U(t,be)){for(;U(O.next,be);)O.advance();O.acceptToken(tr)}else if(t==36&&O.next==36&&e.doubleDollarQuotedStrings)mr(O),O.acceptToken(B);else if(t==39||t==34&&e.doubleQuotedStrings)Y(O,t,e.backslashEscapes),O.acceptToken(B);else if(t==35&&e.hashComments||t==47&&O.next==47&&e.slashComments)Ze(O),O.acceptToken($e);else if(t==45&&O.next==45&&(!e.spaceAfterDashes||O.peek(1)==32))Ze(O),O.acceptToken($e);else if(t==47&&O.next==42){O.advance();for(let i=1;;){let r=O.next;if(O.next<0)break;if(O.advance(),r==42&&O.next==47){if(i--,O.advance(),!i)break}else r==47&&O.next==42&&(i++,O.advance())}O.acceptToken(ar)}else if((t==101||t==69)&&O.next==39)O.advance(),Y(O,39,!0);else if((t==110||t==78)&&O.next==39&&e.charSetCasts)O.advance(),Y(O,39,e.backslashEscapes),O.acceptToken(B);else if(t==95&&e.charSetCasts)for(let i=0;;i++){if(O.next==39&&i>1){O.advance(),Y(O,39,e.backslashEscapes),O.acceptToken(B);break}if(!kO(O.next))break;O.advance()}else if(t==40)O.acceptToken(sr);else if(t==41)O.acceptToken(nr);else if(t==123)O.acceptToken(lr);else if(t==125)O.acceptToken(or);else if(t==91)O.acceptToken(Qr);else if(t==93)O.acceptToken(cr);else if(t==59)O.acceptToken(hr);else if(e.unquotedBitLiterals&&t==48&&O.next==98)O.advance(),me(O),O.acceptToken(Pe);else if((t==98||t