UNPKG

imba

Version:

Intuitive and powerful language for building webapps that fly

14 lines 106 kB
var V=Symbol.for("#__init__"),Or=Symbol.for("#__initor__"),Tn=Symbol.for("#__inited__"),Mr=Symbol.for("#__hooks__");var Cn=Symbol.for("#meta"),Fe=Symbol.for("imba");var W={IsExtension:1,IsTag:2,HasDescriptors:4,HasSuperCalls:8,HasConstructor:16,HasFields:32,HasMixins:64,HasInitor:128,HasDecorators:256,IsObjectExtension:512,IsMixin:1024},te=new Map,Mn=globalThis[Fe]||(globalThis[Fe]={counter:0,classes:te});function re(s,e={}){var t;return te.has(s)||te.set(s,{symbol:Symbol(s.name),parent:(t=Object.getPrototypeOf(s.prototype))==null?void 0:t.constructor,for:s,uses:null,inits:null,id:Mn.counter++,...e}),te.get(s)}function B(s,e){var t;return typeof e=="string"?typeof s===e:(t=e==null?void 0:e[Symbol.hasInstance])==null?void 0:t.call(e,s)}function M(s){var e;return((e=s==null?void 0:s.toIterable)==null?void 0:e.call(s))||s}function On(s,e){if(!s||!e)return!1;if(s.get)return e.get===s.get;if(s.set)return e.set===s.set;if(s.value)return s.value===e.value}function Lr(s,e,t,r={}){let n=s.constructor;!t&&e&&(t=Object.getOwnPropertyDescriptors(e),delete t.constructor,t[V]&&(console.warn(`Cannot define plain fields when extending class ${n.name}`),delete t[V]));let i=re(n);if(i&&i.augments){let a=new Map;for(let o of Object.keys(t)){let p=Object.getOwnPropertyDescriptor(s,o);for(let c of i.augments){let l=a.get(c);l||a.set(c,l={});let h=Object.getOwnPropertyDescriptor(c.prototype,o);h&&!On(p,h)?console.warn("wont extend",o,h,p):l[o]=t[o]}}for(let[o,p]of a)Object.keys(p).length&&Lr(o.prototype,null,p)}return Object.defineProperties(s,t),s}function ze(s,e){var a;let t=re(s),r=re(e),n=r.parent;for(;n&&((a=re(n))==null?void 0:a.flags)&W.IsMixin;){ze(s,n),n=null;break}if(n&&!(s.prototype instanceof n))throw new Error(`Mixin ${e.name} has superclass not present in target class`);if(!r.augments){r.augments=new Set;let o=r.ref=Symbol(e.name),p=Object[Symbol.hasInstance];e.prototype[o]=!0,Object.defineProperty(e,Symbol.hasInstance,{value:function(c){return this===e?c&&!!c[o]:p.call(this,c)}})}if(s.prototype[r.ref])return s;if(r.uses)for(let o of r.uses)ze(s,o);r.augments.add(s),t.uses||(t.uses=[]),t.uses.push(e);let i=Object.getOwnPropertyDescriptors(e.prototype);return delete i.constructor,i[V]&&(t.inits||(t.inits=[]),t.inits.push(e.prototype[V]),delete i[V]),Object.defineProperties(s.prototype,i),(e==null?void 0:e.mixed)instanceof Function&&e.mixed(s),s}var J={cache:{},self:null,target:null,proxy:new Proxy({},{apply:(s,e,t)=>Reflect.apply(J.target,e,t),get:(s,e)=>{let t=Reflect.get(J.target,e,J.self);return t instanceof Function?t.bind(J.self):t},set:(s,e,t,r)=>Reflect.set(J.target,e,t,J.self)})};function k(s,e,t,r,n=null){var c;let i=Object.getPrototypeOf(s.prototype),a=(r&(W.HasMixins|W.IsExtension))==W.HasMixins,o;if(a&&(te.set(s,te.get(i.constructor)),i=Object.getPrototypeOf(i)),n){let l=r&W.IsObjectExtension?n:n.prototype,h=re(s);if(h.uses){n===l&&console.warn("Cannot extend object with mixins");for(let f of h.uses)ze(n,f)}return r&W.HasSuperCalls&&(J.cache[e]=Object.create(Object.getPrototypeOf(l),Object.getOwnPropertyDescriptors(l))),Lr(l,s.prototype),n}let p=i==null?void 0:i.constructor;if(o=re(s,{symbol:e}),Object.defineProperty(s,Cn,{value:o,enumerable:!1,configurable:!0}),t&&s.name!==t&&Object.defineProperty(s,"name",{value:t,configurable:!0}),o.flags=r,r&W.HasConstructor&&(s.prototype[Or]=e),o.uses)for(let l of o.uses)(c=l.mixes)==null||c.call(l,s);return(p==null?void 0:p.inherited)instanceof Function&&p.inherited(s),s}function G(s,e){var t;s[Or]===e&&((t=s[Tn])==null||t.call(s),s[Mr]&&s[Mr].inited(s))}var ne=Symbol.for("#source"),Ln=Symbol.for("#lineText"),In=Symbol.for("#version"),Ir=new WeakMap,Ar=Symbol(),Ve=class Ve{[V](e=null,t=!0,r=!0){this.line=e?e.line:void 0,this.character=e?e.character:void 0,this.offset=e?e.offset:void 0}constructor(e,t,r,n=null){this[V](),this.line=e,this.character=t,this.offset=r,this[In]=n,G(this,Ar)}toString(){return""+this.line+":"+this.character}valueOf(){return this.offset}};k(Ve,Ar,"Position",16);var X=Ve,Er=Symbol(),Be=class Be{[V](e=null,t=!0,r=!0){this.start=e?e.start:void 0,this.end=e?e.end:void 0}constructor(e,t){this[V](),this.start=e,this.end=t,G(this,Er)}get offset(){return this.start.offset}get length(){return this.end.offset-this.start.offset}get 0(){return this.start.offset}get 1(){return this.end.offset}getText(e){return e.slice(this.start,this.end)}equals(e){return e.offset==this.offset&&e.length==this.length}};k(Be,Er,"Range",16);var K=Be,An={Error:1,Warning:2,Information:3,Hint:4,error:1,warning:2,warn:2,info:3,hint:4},Fr=Symbol(),Pe=class Pe{constructor(e,t=null){this.range=e.range,this.severity=An[e.severity]||e.severity,this.code=e.code,this.source=e.source,this.message=e.message,Ir.set(this,t),G(this,Fr)}get[ne](){return Ir.get(this)}get[Ln](){return this[ne].doc.getLineText(this.range.start.line)}toSnippet(){let e=this.range.start,t=this.range.end,r=""+this[ne].sourcePath+":"+(e.line+1)+":"+(e.character+1)+": "+this.message,n=this[ne].doc.getLineText(e.line),i=[r,n];return i.push(n.replace(/[^\t]/g," ").slice(0,e.character)+"^".repeat(t.character-e.character)),i.join(`
`).replace(/\t/g,"    ")+`
`}toError(){let e=this.range.start,t=this.range.end,r=""+this[ne].sourcePath+":"+(e.line+1)+":"+(e.character+1)+": "+this.message,n=new SyntaxError(r),i=this[ne].doc.getLineText(e.line),a=[r,i];return a.push(i.replace(/[^\t]/g," ").slice(0,e.character)+"^".repeat(t.character-e.character)),n.stack=`
`+a.join(`
`).replace(/\t/g,"    ")+`
`,n}raise(){throw this.toError()}};k(Pe,Fr,"Diagnostic",16);var zr=Pe;var Vr=Symbol(),Re=class Re{constructor(e,t){this.cache={},this.rules=e,this.matcher=t,G(this,Vr)}convert(e){for(let t=0,r=M(this.rules),n=r.length;t<n;t++){let i=r[t];if(this.matcher&&this.matcher(i[0],e))return e[1]}return 0}};k(Re,Vr,"Converter",16);var Br=Re;function se(s,e,t=1e5,r=1e5){let n=s;for(;n&&t>0&&r>0;){if(n.match(e))return n;t--,(n.type=="br"||n.value==`
`)&&r--,n=n.prev}return null}function Pr(s){return"Γ"+Vn(s)}function He(s,e,t){t===void 0&&(t=0);for(var r=e?[t]:[],n=0;n<s.length;){var i=s.charCodeAt(n);(i===13||i===10)&&(i===13&&n+1<s.length&&s.charCodeAt(n+1)===10&&n++,r.push(t+n+1)),n++}return r}function Gr(s){var e=s.start,t=s.end;return e.line>t.line||e.line===t.line&&e.character>t.character?new K(t,e):B(s,K)?s:new K(e,t)}function Hr(s){return s!=null&&typeof s.text=="string"&&s.range===void 0}function Rr(s){let e=s.split(/\n/),t=[],r={indent:-1,children:[]},n=r,i,a=Date.now();for(let o=0,p=M(e),c=p.length;o<c;o++){let l=p[o];if(l.match(/^\s*$/))continue;let h=l.match(/^\t*/)[0].length;for(;r.indent>=h;)r=r.parent||n;if(i=l.match(/^(\t*((?:export )?(?:static )?(?:extend )?)(class|tag|def|get|set|prop|attr) )(\@?[\w\-\$\:]+(?:\.[\w\-\$]+)?)/),i){let f=i[3],u=i[4],v=r.name?r.name+".":"",$=i[2].trim().split(/\s+/),I="",_={start:{line:o,character:i[1].length},end:{line:o,character:i[0].length}},m={kind:f,ownName:u,name:v+u,span:_,indent:h,modifiers:$,children:[],parent:r==n?null:r,type:f,data:{},static:$.indexOf("static")>=0,extends:$.indexOf("extend")>=0};m.static&&(m.containerName="static"),m.containerName=i[2]+i[3],f=="tag"&&(i=l.match(/\<\s+([\w\-\$\:]+(?:\.[\w\-\$]+)?)/))&&(m.superclass=i[1]),r.type=="tag"&&(I="```html\n<"+r.name+" "+u+">\n```\n",m.description={kind:"markdown",value:I}),r.children.push(m),r=m,t.push(m)}}return n.all=t,n}var En={"-":"Ξ","?":"Φ","#":"Ψ","@":"α"},Fn=new RegExp("[-?#@]","gu"),zn=function(s){return En[s]};function Vn(s){return s.replace(Fn,zn)}var Bn={Ξ:"-",Φ:"?",Ψ:"#",Γ:"",α:"@"},Pn=new RegExp("[ΞΦΨΓα]","gu"),Gn=function(s){return Bn[s]};function Hn(s){return s&&s.replace(Pn,Gn)}var ye={"":[-1,{id:1,className:"class",slot:1,part:1,elementTiming:"elementtiming"}],HTML:[-1,{title:1,lang:1,translate:1,dir:1,accessKey:"accesskey",draggable:1,spellcheck:1,autocapitalize:1,inputMode:"inputmode",style:1,tabIndex:"tabindex",enterKeyHint:"enterkeyhint"}],HTMLAnchor:[1,{target:1,download:1,ping:1,rel:1,relList:"rel",hreflang:1,type:1,referrerPolicy:"referrerpolicy",coords:1,charset:1,name:1,rev:1,shape:1,href:1}],HTMLArea:[1,{alt:1,coords:1,download:1,shape:1,target:1,ping:1,rel:1,relList:"rel",referrerPolicy:"referrerpolicy",href:1}],HTMLMedia:[1,{src:1,crossOrigin:"crossorigin",preload:1,controlsList:"controlslist"}],HTMLAudio:[4,{}],HTMLBase:[1,{href:1,target:1}],HTMLQuote:[1,{cite:1}],HTMLBody:[1,{text:1,link:1,vLink:"vlink",aLink:"alink",bgColor:"bgcolor",background:1}],HTMLBR:[1,{clear:1}],HTMLButton:[1,{formAction:"formaction",formEnctype:"formenctype",formMethod:"formmethod",formTarget:"formtarget",name:1,type:1,value:1}],HTMLCanvas:[1,{width:1,height:1}],HTMLTableCaption:[1,{align:1}],HTMLTableCol:[1,{span:1,align:1,ch:"char",chOff:"charoff",vAlign:"valign",width:1}],HTMLData:[1,{value:1}],HTMLDataList:[1,{}],HTMLMod:[1,{cite:1,dateTime:"datetime"}],HTMLDetails:[1,{}],HTMLDialog:[1,{}],HTMLDiv:[1,{align:1}],HTMLDList:[1,{}],HTMLEmbed:[1,{src:1,type:1,width:1,height:1,align:1,name:1}],HTMLFieldSet:[1,{name:1}],HTMLForm:[1,{acceptCharset:"accept-charset",action:1,autocomplete:1,enctype:1,encoding:"enctype",method:1,name:1,target:1}],HTMLHeading:[1,{align:1}],HTMLHead:[1,{}],HTMLHR:[1,{align:1,color:1,size:1,width:1}],HTMLHtml:[1,{version:1}],HTMLIFrame:[1,{src:1,srcdoc:1,name:1,sandbox:1,width:1,height:1,referrerPolicy:"referrerpolicy",csp:1,allow:1,align:1,scrolling:1,frameBorder:"frameborder",longDesc:"longdesc",marginHeight:"marginheight",marginWidth:"marginwidth",loading:1}],HTMLImage:[1,{alt:1,src:1,srcset:1,sizes:1,crossOrigin:"crossorigin",useMap:"usemap",width:1,height:1,referrerPolicy:"referrerpolicy",decoding:1,name:1,lowsrc:1,align:1,hspace:1,vspace:1,longDesc:"longdesc",border:1,loading:1}],HTMLInput:[1,{accept:1,alt:1,autocomplete:1,dirName:"dirname",formAction:"formaction",formEnctype:"formenctype",formMethod:"formmethod",formTarget:"formtarget",height:1,max:1,maxLength:"maxlength",min:1,minLength:"minlength",name:1,pattern:1,placeholder:1,src:1,step:1,type:1,defaultValue:"value",width:1,align:1,useMap:"usemap"}],HTMLLabel:[1,{htmlFor:"for"}],HTMLLegend:[1,{align:1}],HTMLLI:[1,{value:1,type:1}],HTMLLink:[1,{href:1,crossOrigin:"crossorigin",rel:1,relList:"rel",media:1,hreflang:1,type:1,as:1,referrerPolicy:"referrerpolicy",sizes:1,imageSrcset:"imagesrcset",imageSizes:"imagesizes",charset:1,rev:1,target:1,integrity:1}],HTMLMap:[1,{name:1}],HTMLMenu:[1,{}],HTMLMeta:[1,{name:1,httpEquiv:"http-equiv",content:1,scheme:1}],HTMLMeter:[1,{value:1,min:1,max:1,low:1,high:1,optimum:1}],HTMLObject:[1,{data:1,type:1,name:1,useMap:"usemap",width:1,height:1,align:1,archive:1,code:1,hspace:1,standby:1,vspace:1,codeBase:"codebase",codeType:"codetype",border:1}],HTMLOList:[1,{start:1,type:1}],HTMLOptGroup:[1,{label:1}],HTMLOption:[1,{label:1,value:1}],HTMLOutput:[1,{htmlFor:"for",name:1}],HTMLParagraph:[1,{align:1}],HTMLParam:[1,{name:1,value:1,type:1,valueType:"valuetype"}],HTMLPicture:[1,{}],HTMLPre:[1,{width:1}],HTMLProgress:[1,{value:1,max:1}],HTMLScript:[1,{src:1,type:1,charset:1,crossOrigin:"crossorigin",referrerPolicy:"referrerpolicy",event:1,htmlFor:"for",integrity:1}],HTMLSelect:[1,{autocomplete:1,name:1,size:1}],HTMLSlot:[1,{name:1}],HTMLSource:[1,{src:1,type:1,srcset:1,sizes:1,media:1}],HTMLSpan:[1,{}],HTMLStyle:[1,{media:1,type:1}],HTMLTable:[1,{align:1,border:1,frame:1,rules:1,summary:1,width:1,bgColor:"bgcolor",cellPadding:"cellpadding",cellSpacing:"cellspacing"}],HTMLTableSection:[1,{align:1,ch:"char",chOff:"charoff",vAlign:"valign"}],HTMLTableCell:[1,{colSpan:"colspan",rowSpan:"rowspan",headers:1,align:1,axis:1,height:1,width:1,ch:"char",chOff:"charoff",vAlign:"valign",bgColor:"bgcolor",abbr:1,scope:1}],HTMLTemplate:[1,{}],HTMLTextArea:[1,{autocomplete:1,cols:1,dirName:"dirname",maxLength:"maxlength",minLength:"minlength",name:1,placeholder:1,rows:1,wrap:1}],HTMLTime:[1,{dateTime:"datetime"}],HTMLTitle:[1,{}],HTMLTableRow:[1,{align:1,ch:"char",chOff:"charoff",vAlign:"valign",bgColor:"bgcolor"}],HTMLTrack:[1,{kind:1,src:1,srclang:1,label:1}],HTMLUList:[1,{type:1}],HTMLVideo:[4,{width:1,height:1,poster:1}],SVG:[-1,{}],SVGGraphics:[66,{transform:1}],SVGA:[67,{}],SVGAnimation:[66,{}],SVGAnimate:[69,{}],SVGAnimateMotion:[69,{}],SVGAnimateTransform:[69,{}],SVGGeometry:[67,{}],SVGCircle:[73,{cx:1,cy:1,r:1}],SVGClipPath:[67,{clipPathUnits:1}],SVGDefs:[67,{}],SVGDesc:[66,{}],SVGDiscard:[66,{}],SVGEllipse:[73,{cx:1,cy:1,rx:1,ry:1}],SVGFEBlend:[66,{mode:1,x:1,y:1,width:1,height:1}],SVGFEColorMatrix:[66,{type:1,values:1,x:1,y:1,width:1,height:1}],SVGFEComponentTransfer:[66,{x:1,y:1,width:1,height:1}],SVGFEComposite:[66,{operator:1,x:1,y:1,width:1,height:1}],SVGFEConvolveMatrix:[66,{orderX:1,orderY:1,kernelMatrix:1,divisor:1,edgeMode:1,x:1,y:1,width:1,height:1}],SVGFEDiffuseLighting:[66,{surfaceScale:1,diffuseConstant:1,x:1,y:1,width:1,height:1}],SVGFEDisplacementMap:[66,{xChannelSelector:1,yChannelSelector:1,x:1,y:1,width:1,height:1}],SVGFEDistantLight:[66,{}],SVGFEDropShadow:[66,{dx:1,dy:1,stdDeviationX:1,stdDeviationY:1,x:1,y:1,width:1,height:1}],SVGFEFlood:[66,{x:1,y:1,width:1,height:1}],SVGComponentTransferFunction:[66,{type:1,tableValues:1,slope:1,amplitude:1,exponent:1}],SVGFEFuncA:[90,{}],SVGFEFuncB:[90,{}],SVGFEFuncG:[90,{}],SVGFEFuncR:[90,{}],SVGFEGaussianBlur:[66,{x:1,y:1,width:1,height:1}],SVGFEImage:[66,{preserveAspectRatio:1,x:1,y:1,width:1,height:1}],SVGFEMerge:[66,{x:1,y:1,width:1,height:1}],SVGFEMergeNode:[66,{}],SVGFEMorphology:[66,{operator:1,x:1,y:1,width:1,height:1}],SVGFEOffset:[66,{x:1,y:1,width:1,height:1}],SVGFEPointLight:[66,{}],SVGFESpecularLighting:[66,{surfaceScale:1,specularConstant:1,specularExponent:1,x:1,y:1,width:1,height:1}],SVGFESpotLight:[66,{specularExponent:1}],SVGFETile:[66,{x:1,y:1,width:1,height:1}],SVGFETurbulence:[66,{numOctaves:1,stitchTiles:1,type:1,x:1,y:1,width:1,height:1}],SVGFilter:[66,{filterUnits:1,primitiveUnits:1,x:1,y:1,width:1,height:1}],SVGForeignObject:[67,{x:1,y:1,width:1,height:1}],SVGG:[67,{}],SVGImage:[67,{x:1,y:1,width:1,height:1,preserveAspectRatio:1}],SVGLine:[73,{x1:1,y1:1,x2:1,y2:1}],SVGGradient:[66,{gradientUnits:1,gradientTransform:1,spreadMethod:1}],SVGLinearGradient:[111,{x1:1,y1:1,x2:1,y2:1}],SVGMarker:[66,{refX:1,refY:1,markerUnits:1,markerWidth:1,markerHeight:1,orientType:1,orientAngle:1,viewBox:1,preserveAspectRatio:1}],SVGMask:[66,{maskUnits:1,maskContentUnits:1,x:1,y:1,width:1,height:1}],SVGMetadata:[66,{}],SVGMPath:[66,{}],SVGPath:[73,{}],SVGPattern:[66,{patternUnits:1,patternContentUnits:1,patternTransform:1,x:1,y:1,width:1,height:1,viewBox:1,preserveAspectRatio:1}],SVGPolygon:[73,{}],SVGPolyline:[73,{}],SVGRadialGradient:[111,{cx:1,cy:1,r:1,fx:1,fy:1,fr:1}],SVGRect:[73,{x:1,y:1,width:1,height:1,rx:1,ry:1}],SVGScript:[66,{}],SVGSet:[69,{}],SVGStop:[66,{}],SVGStyle:[66,{}],SVGSVG:[67,{x:1,y:1,width:1,height:1,viewBox:1,preserveAspectRatio:1}],SVGSwitch:[67,{}],SVGSymbol:[66,{viewBox:1,preserveAspectRatio:1}],SVGTextContent:[67,{textLength:1,lengthAdjust:1}],SVGTextPositioning:[130,{x:1,y:1,dx:1,dy:1,rotate:1}],SVGText:[131,{}],SVGTextPath:[130,{startOffset:1,method:1,spacing:1}],SVGTitle:[66,{}],SVGTSpan:[131,{}],SVGUse:[67,{x:1,y:1,width:1,height:1}],SVGView:[66,{viewBox:1,preserveAspectRatio:1}]},ge={a:2,abbr:1,address:1,area:3,article:1,aside:1,audio:5,b:1,base:6,bdi:1,bdo:1,blockquote:7,body:8,br:9,button:10,canvas:11,caption:12,cite:1,code:1,col:13,colgroup:13,data:14,datalist:15,dd:1,del:16,details:17,dfn:1,dialog:18,div:19,dl:20,dt:1,em:1,embed:21,fieldset:22,figcaption:1,figure:1,footer:1,form:23,h1:24,h2:24,h3:24,h4:24,h5:24,h6:24,head:25,header:1,hgroup:1,hr:26,html:27,i:1,iframe:28,img:29,input:30,ins:16,kbd:1,label:31,legend:32,li:33,link:34,main:1,map:35,mark:1,menu:36,meta:37,meter:38,nav:1,noscript:1,object:39,ol:40,optgroup:41,option:42,output:43,p:44,param:45,picture:46,pre:47,progress:48,q:7,rp:1,rt:1,ruby:1,s:1,samp:1,script:49,section:1,select:50,slot:51,small:1,source:52,span:53,strike:1,strong:1,style:54,sub:1,summary:1,sup:1,table:55,tbody:56,td:57,template:58,textarea:59,tfoot:56,th:57,thead:56,time:60,title:61,tr:62,track:63,u:1,ul:64,var:1,video:65,wbr:1,svg_a:68,svg_animate:70,svg_animateMotion:71,svg_animateTransform:72,svg_audio:66,svg_canvas:66,svg_circle:74,svg_clipPath:75,svg_defs:76,svg_desc:77,svg_discard:78,svg_ellipse:79,svg_feBlend:80,svg_feColorMatrix:81,svg_feComponentTransfer:82,svg_feComposite:83,svg_feConvolveMatrix:84,svg_feDiffuseLighting:85,svg_feDisplacementMap:86,svg_feDistantLight:87,svg_feDropShadow:88,svg_feFlood:89,svg_feFuncA:91,svg_feFuncB:92,svg_feFuncG:93,svg_feFuncR:94,svg_feGaussianBlur:95,svg_feImage:96,svg_feMerge:97,svg_feMergeNode:98,svg_feMorphology:99,svg_feOffset:100,svg_fePointLight:101,svg_feSpecularLighting:102,svg_feSpotLight:103,svg_feTile:104,svg_feTurbulence:105,svg_filter:106,svg_foreignObject:107,svg_g:108,svg_iframe:66,svg_image:109,svg_line:110,svg_linearGradient:112,svg_marker:113,svg_mask:114,svg_metadata:115,svg_mpath:116,svg_path:117,svg_pattern:118,svg_polygon:119,svg_polyline:120,svg_radialGradient:121,svg_rect:122,svg_script:123,svg_set:124,svg_stop:125,svg_style:126,svg_svg:127,svg_switch:128,svg_symbol:129,svg_text:132,svg_textPath:133,svg_title:134,svg_tspan:135,svg_unknown:66,svg_use:136,svg_video:66,svg_view:137,element:0},Ge=Object.keys(ye);for(let s=0,e=M(Ge),t=e.length;s<t;s++){let r=e[s],n=ye[r];n.up=ye[Ge[n[0]]],n.name=r+"Element",n.props=n[1]}for(let s=0,e=Object.keys(ge),t=e.length,r,n;s<t;s++)r=e[s],n=ge[r],ge[r]=ye[Ge[n]];function Nr(s){let e=Hn(s);return ge[e]}var Ne=[/^/,{token:"@rematch",next:"@pop"}],jr={token:"@rematch",next:"@pop"},Dr={token:"white.indent",next:"@>illegal_indent"};function Nn(s,e="#"){typeof s=="string"&&(s=s.split(" "));let t=s.slice().sort(function(r,n){return n.length-r.length});return t=t.map(function(r){let n=r.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&");return e.replace("#",n)}),new RegExp("(?:"+t.join("|")+")")}function L(s,e,t,r={}){var o;var n;s==null?s=Dr:s==1?s={next:"@>"}:s==2?s={next:"@>_indent&-_indent"}:typeof s=="string"&&(s={next:s}),e==-1&&(e=jr),t==-1?t=jr:t==0&&((o=r.comment)!=null||(r.comment=!0),t={}),s=Object.assign({token:"white.tabs"},s||{}),t=Object.assign({token:"white.tabs"},t||{}),e=Object.assign({token:"@rematch",next:"@pop"},e||{});let i={"$1==$S2	":s,"$1==$S2":{cases:{"$1==$S6":t,"@default":{token:"@rematch",switchTo:"@*$1"}}},"@default":e};n=0;for(let p of["next","switchTo"]){let c=n++;s[p]&&s[p].indexOf("*")==-1&&(s[p]+="*$1")}let a=[/^(\t*)(?=[^ \t\n])/,{cases:i}];if(r.comment){let p={};for(let c=0,l=Object.keys(i),h=l.length,f,u;c<h;c++){f=l[c],u=i[f];let v=Object.assign({},u);!v.next&&!v.switchTo&&(v.next="@>_comment"),p[f]=v}return[[/^(\t*)(?=#\s|#$)/,{cases:p}],a]}return a}var je={root:[[/^(\t+)(?=[^\t\n])/,{cases:{"$1==$S2	":{token:"white.indent",next:"@>_indent*$1"},"@default":"white.indent"}}],"block_"],_comment:[[/^([\t\s\n]*)$/,"comment"],[/^(\t*)([\S\s]*)/,{cases:{"$1~$S2	*":{token:"comment"},"@default":{token:"@rematch",next:"@pop"}}}],[/[\S\s]+/,"comment"]],illegal_indent:[L()],identifier_:[[/\$\w+\$/,"identifier.env"],[/\$\d+/,"identifier.special"],[/\#+@id/,"identifier.symbol"],[/\¶@id/,"ivar"],[/@id\!?/,{cases:{this:"this",self:"self","@keywords":"keyword.$#","$0~[A-Z].*":"identifier.uppercase.$F","@default":"identifier.$F"}}]],block_:[[/^(\t+)(?=[\r\n]|$)/,"white.tabs"],"extend_class_","class_","tagclass_","augmentation_","var_","func_","import_","export_","flow_","for_","try_","catch_","while_","css_","tag_","do_","block_comment_","expr_","decorator_",[/[ ]+/,"white"],"common_"],indentable_:[[/^[ ]+/,"white"],L("@>_paren_indent&-_indent",null,null),[/^(\t+)(?=[\r\n]|$)/,"white.tabs"],"whitespace"],_indent:[L(2,-1,0),"block_"],_paren_indent:[L(2,-1,0),"block_",[/\)|\}|\]/,"@rematch","@pop"]],block:[L("@>",-1,0),"block_"],bool_:[[/(true|false|yes|no|undefined|null)(?![\:\-\w\.\_])/,"boolean"]],op_:[[/\s+\:\s+/,"operator.ternary"],[/(@unspaced_ops)/,{cases:{"@spread":"operator.spread","@access":"operator.access","@default":"operator"}}],[/\/(?!\/)/,"operator.math"],[/\&(?=[,\)])/,"operator.special.blockparam"],[/(\s*)(@symbols)(\s*)/,{cases:{"$2@assignments":"operator.assign","$2@math":"operator.math","$2@operators":"operator","$2@logic":"operator.logic","$2@access":"operator.access","@default":"delimiter"}}],[/\&\b/,"operator"]],keyword_:[[/new@B/,"keyword.new"],[/isa@B/,"keyword.isa"],[/is@B/,"keyword.is"],[/(switch|when|throw|continue|break|then|await|typeof|by)@B/,"keyword.$1"],[/delete@B/,"keyword.delete"],[/and@B|or@B/,"operator.flow"]],return_:[[/return@B/,"keyword.return"]],yield_:[[/yield/,"keyword.yield"]],primitive_:["string_","number_","regexp_","bool_"],value_:["primitive_","keyword_","implicit_call_","parens_","key_","access_","identifier_","array_","object_"],expr_:["comment_","inline_var_","return_","yield_","value_","tag_","op_","type_","spread_"],attr_expr_:["primitive_","parens_","access_","identifier_","array_","object_","tag_","op_"],access_:[[/(\.\.?)(@propid\!?)/,{cases:{"$2~[A-Z].*":["operator.access","accessor.uppercase"],"$2~#.*":["operator.access","accessor.symbol"],"@default":["operator.access","accessor"]}}]],call_:[[/\(/,"(","@call_body"]],key_:[[/(\#+@id)(\:\s*)/,["key.symbol","operator.assign.key-value"]],[/(@propid)(\:\s*)/,{cases:{"@default":["key","operator.assign.key-value"]}}]],implicit_call_:[[/(\.\.?)(@propid)@implicitCall/,{cases:{"$2~[A-Z].*":["operator.access","accessor.uppercase","@implicit_call_body"],"@default":["operator.access","accessor","@implicit_call_body"]}}],[/(@propid)@implicitCall/,"@rematch","@implicit_call_start"]],implicit_call_start:["identifier_",[/@implicitCall/,"@rematch",{switchTo:"@implicit_call_body"}]],implicit_call_body:[Ne,[/\)|\}|\]|\>/,"@rematch","@pop"],"arglist_","whitespace"],arglist_:["do_","expr_",[/\s*\,\s*/,"delimiter.comma"]],params_:[[/\[/,"array.[","@array_var_body=decl-param"],[/\{/,"object.{","@object_body=decl-param"],[/(@variable)/,"identifier.decl-param"],"spread_","type_",[/\s*\=\s*/,"operator","@var_value="],[/\s*\,\s*/,"separator"],[/\s/,"white.params"]],object_:[[/\{/,"object.{","@object_body"]],parens_:[[/\(/,"parens.(","@parens_body"]],parens_body:[[/\)/,")","@pop"],"indentable_","arglist_"],array_:[[/\[/,"array.[","@array_body"]],array_body:[[/\]@implicitCall/,{token:"]",switchTo:"@implicit_call_body="}],[/\]/,"]","@pop"],[/\)|\}/,"invalid"],"indentable_","expr_",[",","delimiter"]],object_body:[[/\}/,"}","@pop"],[/(@id)(\s*:\s*)/,["key","operator.assign.key-value","@object_value"]],[/(@id)/,"identifier.$F"],[/\[/,"[","@object_dynamic_key="],[/\s*=\s*/,"operator.assign","@object_value="],[/:/,"operator.assign.key-value","@object_value="],[/\,/,"delimiter.comma"],"indentable_","expr_"],object_value:[Ne,[/,|\}|\]|\)/,"@rematch","@pop"],"expr_"],object_dynamic_key:[["]","]","@pop"],"expr_"],comment_:[[/#(\s.*)?(?=\n|$)/,"comment"]],block_comment_:[[/###/,"comment.start","@_block_comment"]],_block_comment:[[/###/,"comment.end","@pop"],[/[^#]+/,"comment"],[/#(?!##)/,"comment"]],try_:[[/try@B/,"keyword.try","@>_try&try"]],catch_:[[/(catch\s+)(?=@id(\s|$))/,"keyword.catch","@catch_start&catch"],[/catch@B/,"keyword.catch","@catch_start&catch"]],catch_start:[[/@id/,"identifier.decl-const",{switchTo:"@>_catch"}],[/.?/,"@rematch",{switchTo:"@>_catch"}]],_catch:[L("@>block",-1,0),"block_"],_try:[L("@>block",-1,0),"block_"],do_:[[/do(?=\()/,"keyword.do","@>do_start&do"],[/do(?=\s*\|)/,"keyword.do","@>do_piped&do"],[/do@B/,"keyword.do","@>_do&do"]],do_start:[L(null,-1,-1),[/\(/,"(",{switchTo:"@_do_params"}],[/./,"@rematch",{switchTo:"@_do"}]],do_piped:[L(null,-1,-1),[/\s*\|/,"args.open",{switchTo:"@_do_piped_params"}],[/./,"@rematch",{switchTo:"@_do"}]],_do_piped_params:[[/\|/,"args.close",{switchTo:"@_do"}],"params_"],_do_params:[[/\)/,")",{switchTo:"@_do"}],"params_"],_do:[L(2,-1,0),[/(\}|\)|\])/,"@rematch","@pop"],"block_"],class_:[[/(extend)(?=\s+(global )?(class|interface|mixin) )/,"keyword.$1"],[/(global)(?=\s+(class|interface|mixin|abstract) )/,"keyword.$1"],[/(abstract)(?=\s+(class|interface) )/,"keyword.$1"],[/(class|interface|mixin)(\s)(?=@id\.@id)/,["keyword.$1","white.$1name","@classname_start/$3"]],[/(class|interface|mixin)(\s)(@classid)/,["keyword.$1","white.$1name","entity.name.class.decl-const","@class_start="]],[/(class|interface|mixin)(?=\n)/,"keyword.$1","@>_class&class="]],classname_start:[[/\w/,"@rematch","@assignable&-assignable"],[/(\s+\<\s+)/,["keyword.extends.$/","@assignable&-value"]],[/@comment/,"comment"],[/\n/,"@rematch",{switchTo:"@>_class&class="}],"whitespace"],assignable:["identifier_","access_",[/\s+|\n/,"@rematch","@pop"]],extend_class_:[[/(extend)(\s)(class|interface|mixin)(\s)/,["keyword.$1","white.$1","keyword.$3","white.extendclass","@classname_start/$3"]]],augmentation_:[[/(extend)(?=\s+@id)/,"keyword.$1","@augmentation_start="]],augmentation_start:[L({switchTo:"@>_class&class="},-1,-1),[/[ \t]+/,"white"],"expr_"],class_start:[[/(\s+\<\s+)(@id)/,["keyword.extends","identifier.superclass"]],[/@comment/,"comment"],[/^/,"@rematch",{switchTo:"@>_class&class="}],"whitespace"],tagclass_:[[/(extend)(?=\s+tag )/,"keyword.$1"],[/(global)(?=\s+tag )/,"keyword.$1"],[/(tag)(\s)(@constant)/,["keyword.tag","white.tagname","entity.name.component.local","@tagclass_start="]],[/(tag)(\s)(@id)/,["keyword.tag","white.tagname","entity.name.component.global","@tagclass_start="]]],tagclass_start:[[/(\s+\<\s+)(@id)/,["keyword.extends","identifier.superclass"]],[/@comment/,"comment"],[/^/,"@rematch",{switchTo:"@>_tagclass&component="}]],import_:[[/(import)(?=\s+['"])/,"keyword.import","@>import_source"],[/(import)(\s+type)(?=\s[\w\$\@\{])/,["keyword.import","keyword.type","@>import_body&-_imports=decl-import-type/part"]],[/(import)@B/,"keyword.import","@>import_body&-_imports=decl-import/part"]],import_body:[L(null,-1,0),[/(@esmIdentifier)( +from)/,["identifier.$F.default","keyword.from",{switchTo:"@import_source"}]],[/(\*)(\s+as\s+)(@esmIdentifier)(\s+from)/,["keyword.star","keyword.as","identifier.$F.ns","keyword.from",{switchTo:"@import_source"}]],[/(@esmIdentifier)(\s*,\s*)(\*)(\s+as\s+)(@esmIdentifier)(from)/,["identifier.$F.default","delimiter.comma","keyword.star","keyword.as","identifier.$F.ns","keyword.from",{switchTo:"@import_source"}]],[/\ *from/,"keyword.from",{switchTo:"@import_source"}],[/\{/,"specifiers.{","@esm_specifiers/part"],[/(@esmIdentifier)/,"identifier.$F",{switchTo:"@/delim"}],[/\s*\,\s*/,"delimiter.comma",{switchTo:"@/part"}],"comma_","common_"],import_source:[L(null,-1,0),[/["']/,"path.open","@_path=$#"],Ne],export_:[[/(export)( +)(default)@B/,["keyword.export","white","keyword.default"]],[/(export)( +)(abstract)@B/,["keyword.export","white","keyword.abstract"]],[/(export)(?= +(let|const|var|class|tag|interface)@B)/,"keyword.export"],[/(export)( +)(global)@B/,["keyword.export","white","keyword.global"]],[/(export)(\s+\*\s+)(from)@B/,["keyword.export","operator.star","keyword.from","@>import_source"]],[/(export)@B/,"keyword.export","@>export_body"]],export_body:[L(null,-1,0),[/(\*)(\s+as\s+)(@esmIdentifier)/,["keyword.star","keyword.as","identifier.const.export"]],[/(@esmIdentifier)(\s+as\s+)(default)/,["alias","keyword.as","alias.default"]],[/(@esmIdentifier)(\s+as\s+)(@esmIdentifier)/,["alias","keyword.as","identifier.const.export"]],[/from/,"keyword.from",{switchTo:"@import_source"}],[/\{/,"{","@esm_specifiers=export/part"],[/(@esmIdentifier)/,"identifier.const.export"],[/\*/,"operator.star"],"comma_","common_"],esm_specifiers:[[/\}/,"}","@pop"],[/(@esmIdentifier)(\s+as\s+)(@esmIdentifier)/,["alias","keyword.as","identifier.const.$F",{switchTo:"@/delim"}]],[/@esmIdentifier/,{cases:{"$/==part":{token:"identifier.const.$S4",switchTo:"@/delim"},"@default":{token:"invalid"}}}],[/\s*\,\s*/,"delimiter.comma",{switchTo:"@/part"}],"whitespace"],_path:[[/[^"'\`\{\\]+/,"path"],[/@escapes/,"path.escape"],[/\./,"path.escape.invalid"],[/\{/,"invalid"],[/["'`]/,{cases:{"$#==$F":{token:"path.close",next:"@pop"},"@default":"path"}}]],member_:[[/(constructor)@B/,"entity.name.constructor","@>def_params&def/def=decl-param"],[/(protected|private)(\s)(?=def|get|set)/,["keyword.$1","white.entity"]],[/(def|get|set)(\s)(@defid)/,["keyword.$1","white.entity","entity.name.$1","@>def_params&$1/$1=decl-param"]],[/(def|get|set)(\s)(\[)/,["keyword.$1","white.entity","$$","@>def_dynamic_name/$1"]]],func_:[[/export(?=\s+(get|set|def|global) )/,"keyword.export"],[/global(?=\s+(get|set|def) )/,"keyword.global"],[/(def)(\s)(@id)(\.)(@defid)/,["keyword.$1","white.entity","identifier.target","operator","entity.name.def","@>def_params&$1/$1"]],[/(def)(\s)(@defid)/,["keyword.$1","white.entity","entity.name.function.decl-const-func","@>def_params&$1/$1"]]],flow_:[[/(else)(?=\s|$)/,["keyword.$1","@>_flow&$1"]],[/(if|else|elif|unless)(?=\s|$)/,["keyword.$1","@flow_start=$1"]]],flow_start:[L({switchTo:"@>_flow&$F"},-1,-1),[/[ \t]+/,"white"],"expr_"],for_:[[/for(?: own| await)?@B/,"keyword.$#","@for_start&forscope=decl-for"]],while_:[[/(while|until)@B/,"keyword.$#","@>while_body"]],while_body:[L(2,-1,0),"block_"],for_start:[L({switchTo:"@>for_body"},-1,-1),[/\[/,"array.[","@array_var_body"],[/\{/,"object.{","@object_body"],[/(@variable)/,"identifier.$F"],[/(\s*\,\s*)/,"separator","@=decl-for-index"],[/\s(in|of)@B/,"keyword.$1",{switchTo:"@>for_source="}],[/[ \t]+/,"white"],"type_"],for_source:[L({switchTo:"@>for_body"},-1,{switchTo:"@for_body"}),"expr_",[/[ \t]+/,"white"]],for_body:[L(2,-1,0),"block_"],decorator_:[[/(?=@decid)/,"","@_decorator&-_decorator"]],_decorator:[[/(@decid)/,"decorator.name"],[/(\.)(\!?@optid)/,["decorator.modifier.start","decorator.modifier.name"]],[/\(/,{token:"decorator.parens.open",next:"@_decorator_parens/0"}],[/\[/,{token:"decorator.brackets.open",next:"@_decorator_brackets/0"}],[/\{/,{token:"decorator.braces.open",next:"@_decorator_braces/0"}],[/(\s*\=\s*)/,"operator.equals.decorator/","@_tag_value&handler"],[/\s+/,"@rematch","@pop"]],_decorator_parens:[[/\)/,"decorator.$/.parens.close","@pop"],"arglist_",[/\]|\}/,"invalid"]],_decorator_params:[[/\)/,")","@pop"],"expr_",[/\s*\,\s*/,"delimiter.comma"]],_decorator_brackets:[[/\]/,"]","@pop"],"expr_",[/\s*\,\s*/,"delimiter.comma"]],_decorator_braces:[[/\}/,"}","@pop"],"expr_",[/\s*\,\s*/,"delimiter.comma"]],field_:[[/((?:lazy )?)((?:static )?)(const|let|attr|prop|isa)(?=\s|$)/,["keyword.lazy","keyword.static","keyword.$1","@_vardecl=field-$3"]],[/(declare\s+)(?=@fieldid)/,"keyword.declare"],[/(static\s+)(?=@fieldid)/,"keyword.static"],[/\/(?![\s=])(?:[^[\/\n\\]|\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*\])*\/[a-z]{0,8}(?!\w)/,"entity.name.field.regexp","@_field_1"],[/(@fieldid)(?=$)/,"entity.name.field"],[/(@fieldid)/,["entity.name.field","@_field_1"]]],_field_1:[L(null,-1,-1),"type_",[/(\s*=)(?!\=)/,["operator.assign","@_field_value&field"]],[/(\s*(?:\@)set\s*)/,["keyword.spy","@>_def&spy"]],[/(\s*as)(?=\s)/,["keyword.accessor","@>_def&field"]],[/(?=\s\@|$)/,"","@>_def&field"]],_field_value:[L(2,-1,-1),"block_",[/(\s*(?:\@)set\s*)/,["@rematch","@pop"]]],var_:[[/(const|let)(?=\s[\[\{\$a-zA-Z]|\s*$)/,["keyword.$1","@_vardecl=decl-$1"]],[/(const|let)(?=\s|$)/,["keyword.$1"]]],inline_var_:[[/(const|let)(?=\s[\[\{\$a-zA-Z]|\s*$)/,["keyword.$1","@inline_var_body=decl-$1"]]],string_:[[/"""/,"string",'@_herestring="""'],[/'''/,"string","@_herestring='''"],[/["'`]/,"string.open","@_string=$#"]],number_:[[/0[xX][0-9a-fA-F_]+/,"number.hex"],[/0[b][01_]+/,"number.binary"],[/0[o][0-9_]+/,"number.octal"],[/(\d+)([a-z]+|\%)/,["number","unit"]],[/(\d*\.\d+(?:[eE][\-+]?\d+)?)([a-z]+|\%)/,["number.float","unit"]],[/\d+[eE]([\-+]?\d+)?/,"number.float"],[/\d[\d_]*\.\d[\d_]*([eE][\-+]?\d+)?/,"number.float"],[/\d[\d_]*/,"number.integer"],[/0[0-7]+(?!\d)/,"number.octal"],[/\d+/,"number"]],_string:[[/[^"'\`\{\\]+/,"string"],[/@escapes/,"string.escape"],[/\./,"string.escape.invalid"],[/\{/,{cases:{"$F=='":"string","@default":{token:"string.bracket.open",next:"@interpolation_body"}}}],[/["'`]/,{cases:{"$#==$F":{token:"string.close",next:"@pop"},"@default":"string"}}],[/#/,"string"]],_herestring:[[/("""|''')/,{cases:{"$1==$F":{token:"string",next:"@pop"},"@default":"string"}}],[/[^#\\'"\{]+/,"string"],[/['"]+/,"string"],[/@escapes/,"string.escape"],[/\./,"string.escape.invalid"],[/\{/,{cases:{'$F=="""':{token:"string",next:"@interpolation_body"},"@default":"string"}}],[/#/,"string"]],interpolation_body:[[/\}/,"string.bracket.close","@pop"],"expr_"],_class:[L(Dr,-1,0),"css_","member_","comment_","block_comment_","decorator_",[/@envvar/,"keyword.env.$0"],[/(get|set|def|static|prop|attr)@B/,"keyword.$0"],"field_","common_"],_tagclass:["_class",[/(?=\<self)/,"entity.name.def.render","@_render&def"]],def_params:[[/\(/,"(","@def_parens"],[/^/,"@rematch",{switchTo:"@_def="}],[/do@B/,"keyword.do",{switchTo:"@_def="}],"params_",[/@comment/,"comment"]],def_parens:[[/\)/,")","@pop"],"params_"],def_dynamic_name:[["]",{token:"square.close",switchTo:"@def_params&$/=decl-param"}],"expr_"],_render:[L(2,-1,-1),"block_"],_def:[L(2,-1,0),"block_"],_flow:[L(2,-1,0),"block_"],_varblock:[L(1,-1,-1),[/\[/,"array.[","@array_var_body"],[/\{/,"object.{","@object_body"],[/(@variable)/,"identifier.$F"],[/\s*\,\s*/,"separator"],[/(\s*\=\s*)(?=(for|while|until|if|unless|try)\s)/,"operator","@pop"],[/(\s*\=\s*)/,"operator","@var_value="],"type_",[/#(\s.*)?\n?$/,"comment"]],_vardecl:[L(null,-1,-1),[/\[/,"array.[","@array_var_body"],[/\{/,"object.{","@object_body"],[/(@variable)(?=\n|,|$)/,"identifier.$F","@pop"],[/(@variable)/,"identifier.$F"],[/(\s*\=\s*)/,"operator.declval",{switchTo:"@var_value&value="}],"type_","whitespace"],array_var_body:[[/\]/,"]","@pop"],[/\{/,"object.{","@object_body"],[/\[/,"array.[","@array_var_body"],"spread_",[/(@variable)/,"identifier.$F"],[/(\s*\=\s*)/,"operator.assign","@array_var_body_value="],[",","delimiter"]],array_var_body_value:[[/(?=,|\)|]|})/,"delimiter","@pop"],"expr_"],inline_var_body:[[/\[/,"array.[","@array_var_body"],[/\{/,"object.{","@object_body"],[/(@variable)/,"identifier.$F"],[/(\s*\=\s*)/,"operator","@pop"],"type_"],var_value:[[/(?=,|\)|]|})/,"delimiter","@pop"],L({switchTo:"@>block"},-1,-1),"block_"],common_:[[/^(\t+)(?=\n|$)/,"white.tabs"],"whitespace"],comma_:[[/\s*,\s*/,"delimiter.comma"]],spread_:[[/\.\.\./,"operator.spread"]],type_:[[/\\(?!\/)/,"@rematch","@_type&-_type/0"]],_type:[L(-1,-1,-1),[/\\/,"delimiter.type.prefix"],[/\[/,"delimiter.type","@/]"],[/\(/,"delimiter.type","@/)"],[/\{/,"delimiter.type","@/}"],[/\</,"delimiter.type","@/>"],[/\|/,"delimiter.type.union"],[/\,|\s|\=|\./,{cases:{"$/==0":{token:"@rematch",next:"@pop"},"@default":"type"}}],[/[\]\}\)\>]/,{cases:{"$#==$/":{token:"delimiter.type",next:"@pop"},"@default":{token:"@rematch",next:"@pop"}}}],[/[\w\-\$]+/,"type"]],css_:[[/global(?=\s+css@B)/,"keyword.$#"],[/css(?=\s+|$)/,"keyword.css","@>css_selector&rule-_sel"],[/(\%)([\w\-]+)/,["style.selector.mixin.prefix","style.selector.mixin.name","@>css_selector&rule-_sel"]]],sel_:[[/(\%)((?:@id)?)/,["style.selector.mixin.prefix","style.selector.mixin.name"]],[/(\@)(\.{0,2}[\w\-\<\>\!]*\+?)/,"style.selector.modifier"],[/(\@)(\.{0,2}[\w\-\<\>\!]*)/,"style.selector.modifier"],[/\.([\w\-]+)?/,"style.selector.class-name"],[/\#([\w\-]+)?/,"style.selector.id"],[/([\w\-]+)/,"style.selector.element"],[/(>+|~|\+)/,"style.selector.operator"],[/(\*+)/,"style.selector.element.any"],[/(\$)((?:@id)?)/,["style.selector.reference.prefix","style.selector.reference"]],[/\&/,"style.selector.context"],[/\(/,"delimiter.selector.parens.open","@css_selector_parens"],[/\[/,"delimiter.selector.attr.open","@css_selector_attr"],[/\s+/,"white"],[/,/,"style.selector.delimiter"],[/#(\s.*)?\n?$/,"comment"]],css_props:[L(null,-1,0),[/(?=@cssPropertyKey)/,"","@css_property&-_styleprop-_stylepropkey"],[/#(\s.*)?\n?$/,"comment"],[/(?=[\%\*\w\&\$\>\.\[\@\!]|\#[\w\-])/,"","@>css_selector&rule-_sel"],[/\s+/,"white"]],css_selector:[L({switchTo:"@css_props&_props"},-1,{token:"@rematch",switchTo:"@css_props&_props"}),[/(\}|\)|\])/,"@rematch","@pop"],[/(?=\s*@cssPropertyKey)/,"",{switchTo:"@css_props&_props"}],[/\s*#\s/,"@rematch",{switchTo:"@css_props&_props"}],"sel_"],css_inline:[[/\]/,"style.close","@pop"],[/(?=@cssPropertyKey)/,"","@css_property&-_styleprop-_stylepropkey"],[/(?=@cssPropertyPath\])/,"","@css_property&-_styleprop-_stylepropkey"]],css_selector_parens:[[/\)/,"delimiter.selector.parens.close","@pop"],"sel_"],css_selector_attr:[[/\]/,"delimiter.selector.parens.close","@pop"],"sel_"],css_property:[L(null,-1,-1),[/\]/,"@rematch","@pop"],[/(\d+)(@id)/,["style.property.unit.number","style.property.unit.name"]],[/((--|\$)@id)/,"style.property.var"],[/((\#)@id)/,"style.property.colorvar"],[/(-*@id)/,"style.property.name"],[/(\^+)(@cssModifier)/,["style.property.modifier.up","style.property.modifier"]],[/@cssModifier/,"style.property.modifier"],[/(\.+)(@id\-?)/,["style.property.modifier.start","style.property.modifier"]],[/\+(@id)/,"style.property.scope"],[/\s*([\:\=]\s*)(?=@br|$)/,"style.property.operator",{switchTo:"@>css_multiline_value&_stylevalue"}],[/\s*([\:\=]\s*)/,"style.property.operator",{switchTo:"@>css_value&_stylevalue"}]],css_value_:[[/(x?xs|sm\-?|md\-?|lg\-?|xx*l|\dxl|hg|x+h)\b/,"style.value.size"],[/\#[0-9a-fA-F]{6,8}/,"style.value.color.hex"],[/\#\w+/,"style.value.colorvar"],[/((--|\$)@id)/,"style.value.var"],[/(@optid)(\@+|\.+)(@optid)/,["style.property.name","style.property.modifier.prefix","style.property.modifier"]],"op_","string_",[/(\d+)([a-z]+|\%)/,["style.value.number","style.value.unit"]],[/(\d*\.\d+(?:[eE][\-+]?\d+)?)([a-z]+|\%)/,["style.value.number.float","style.value.unit"]],[/\d[\d_]*\.\d[\d_]*([eE][\-+]?\d+)?/,"style.value.number.float"],[/\d[\d_]*/,"style.value.number.integer"],[/0[0-7]+(?!\d)/,"style.value.number.octal"],[/\d+/,"style.value.number"],"number_","comment_",[/\s+/,"style.value.white"],[/\(/,"delimiter.style.parens.open","@css_expressions"],[/\{/,"delimiter.style.curly.open","@css_interpolation&-_styleinterpolation"],[/(@id)/,"style.value"]],css_value:[L({switchTo:"@>css_multiline_value"},-1,-1),[/@cssPropertyKey/,"@rematch","@pop"],[/;/,"style.delimiter","@pop"],[/(\}|\)|\])/,"@rematch","@pop"],"css_value_"],css_multiline_value:[L(null,-1,0),[/@cssPropertyKey/,"invalid"],"css_value_"],css_expressions:[[/\)/,"delimiter.style.parens.close","@pop"],[/\(/,"delimiter.style.parens.open","@css_expressions"],"css_value"],css_interpolation:[[/\}/,"delimiter.style.curly.close","@pop"],"expr_"],expressions:[[/\,/,"delimiter.comma"]],whitespace:[[/[\r\n]+/,"br"],[/[ \t\r\n]+/,"white"]],space:[[/[ \t]+/,"white"]],tag_:[[/(\s*)(<)(?=\.)/,["white","tag.open","@_tag/flag"]],[/(\s*)(<)(\w[\-\w]*)(?=\()/,["white","tag.open","identifier.tag.name","@_tag/name"]],[/(\s*)(<)(?=\w|\{|\[|\%|\#|\(|>)/,["white","tag.open","@_tag/name"]]],tag_content:[L(2,-1,0),[/\)|\}|\]/,"@rematch","@pop"],"common_","flow_","var_","for_","css_","expr_","do_"],tag_children:[],_tag:[[/\/>/,"tag.close","@pop"],[/>/,"tag.close",{switchTo:"@>tag_content=&-_tagcontent"}],[/>/,"tag.close","@pop"],[/(\-?\d+)/,"tag.$S3"],[/(\%)(@id)/,["tag.mixin.prefix","tag.mixin.name"]],[/\#@id/,"tag.id"],[/\./,{cases:{"$/==event":{token:"tag.event-modifier.start",switchTo:"@/event-modifier"},"$/==event-modifier":{token:"tag.event-modifier.start",switchTo:"@/event-modifier"},"$/==modifier":{token:"tag.modifier.start",switchTo:"@/modifier"},"$/==rule":{token:"tag.rule-modifier.start",switchTo:"@/rule-modifier"},"$/==rule-modifier":{token:"tag.rule-modifier.start",switchTo:"@/rule-modifier"},"@default":{token:"tag.flag.start",switchTo:"@/flag"}}}],[/(\$@id)/,{cases:{"$/==name":"tag.reference","$/==attr":{token:"@rematch",next:"@_tag_attr&-_tagattr"},"@default":"tag.$/"}}],[/\{/,"tag.$/.interpolation.open","@_tag_interpolation"],[/\[/,"style.open","@css_inline"],[/(\s*\=\s*)/,"operator.equals.tagop.tag-$/","@_tag_value&-value"],[/\:/,{token:"tag.event.start",switchTo:"@/event"}],"tag_event_",[/(\-?@tagIdentifier)(\:@id)?/,{cases:{"$/==attr":{token:"@rematch",next:"@_tag_attr&-_tagattr"},"@default":{token:"tag.$/"}}}],[/\(/,{token:"tag.$/.parens.open",next:"@_tag_parens/0"}],[/\s+/,{token:"tag.white",switchTo:"@/attr"}],"comment_"],tag_event_:[[/(?=\@@optid)/,"","@_tag_event&-_listener"]],_tag_part:[[/\)|\}|\]|\>/,"@rematch","@pop"]],_tag_event:["_tag_part",[/(\@)(@optid)/,["tag.event.start","tag.event.name"]],[/(\.)(\!?@optid)/,["tag.event-modifier.start","tag.event-modifier.name"]],[/\(/,{token:"tag.$/.parens.open",next:"@_tag_parens/0"}],[/(\s*\=\s*)/,"operator.equals.tagop.tag-$/","@_tag_value&handler"],[/\s+/,"@rematch","@pop"]],tag_attr_:[[/(?=@tagIdentifier(\:@id)?)/,"","@_tag_attr&-_attribute"]],_tag_attr:["_tag_part",[/(\-?@tagIdentifier)(\:@id)?/,"tag.attr"],[/\.(@optid)/,"tag.event-modifierzz"],[/\(/,{token:"tag.parens.open.$/",next:"@_tag_parens/0"}],[/(\s*\=\s*)/,"operator.equals.tagop.tag-$/","@_tag_value&-tagattrvalue"],[/\s+/,"@rematch","@pop"]],_tag_interpolation:[[/\}/,"tag.$/.interpolation.close","@pop"],"expr_",[/\)|\]/,"invalid"]],_tag_parens:[[/\)/,"tag.$/.parens.close","@pop"],"arglist_",[/\]|\}/,"invalid"]],_tag_value:[[/(?=(\/?\>|\s))/,"","@pop"],"attr_expr_"],regexp_:[[/\/(?!\ )(?=([^\\\/]|\\.)+\/)/,{token:"regexp.slash.open",bracket:"@open",next:"@_regexp"}],[/\/\/\//,{token:"regexp.slash.open",bracket:"@open",next:"@_hereregexp"}],[/(\/)(\/)/,["regexp.slash.open","regexp.slash.close"]]],_regexp:[[/(\{)(\d+(?:,\d*)?)(\})/,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/,["regexp.escape.control",{token:"regexp.escape.control",next:"@_regexrange"}]],[/(\()(\?:|\?=|\?!)/,["regexp.escape.control","regexp.escape.control"]],[/[()]/,"regexp.escape.control"],[/@regexpctl/,"regexp.escape.control"],[/[^\\\/]/,"regexp"],[/@regexpesc/,"regexp.escape"],[/\\:/,"regexp.escape"],[/\\\./,"regexp.invalid"],[/(\/)(\w+)/,[{token:"regexp.slash.close"},{token:"regexp.flags",next:"@pop"}]],["/",{token:"regexp.slash.close",next:"@pop"}],[/./,"regexp.invalid"]],_regexrange:[[/-/,"regexp.escape.control"],[/\^/,"regexp.invalid"],[/@regexpesc/,"regexp.escape"],[/[^\]]/,"regexp"],[/\]/,"regexp.escape.control","@pop"]],_hereregexp:[[/[^\\\/#]/,"regexp"],[/\\./,"regexp"],[/#.*$/,"comment"],["///[igm]*","regexp","@pop"],[/\//,"regexp"],"comment_"]};function xe(s){let e=["$S1","$S2","$S3","$S4","$S5","$S6"];if(s.match(/\@(pop|push|popall)/)||(s[0]=="@"&&(s=s.slice(1)),s.indexOf(".")>=0))return s;s=_e(s),s[0]==">"&&(e[1]="$S6	",s=s.slice(1));for(let t=0,r=M(s.split(/(?=[\/\&\=\*])/)),n=r.length;t<n;t++){let i=r[t];i[0]=="&"?i[1]=="-"||i[1]=="_"?e[2]="$S3"+i.slice(1):e[2]="$S3-"+i.slice(1):i[0]=="+"?e[3]="$S4-"+i.slice(1):i[0]=="="?e[3]=i.slice(1):i[0]=="/"?e[4]=i.slice(1):i[0]=="*"?e[5]=i.slice(1):e[0]=i}return e.join(".")}function _e(s){let e=s;return s=s.replace("$/","$S5"),s=s.replace("$F","$S4"),s=s.replace("$&","$S3"),s=s.replace("$I","$S2"),s=s.replace("$T","$S2"),s}function De(s,e){if(typeof s=="string"&&(s={token:s}),s&&s.token!=null)s.token=_e(s.token),typeof e=="string"?s.next=e:e&&Object.assign(s,e),s.next&&(s.next=xe(s.next)),s.switchTo&&(s.switchTo=xe(s.switchTo));else if(s&&s.cases){let t={};for(let r=s.cases,n=0,i=Object.keys(r),a=i.length,o,p;n<a;n++){o=i[n],p=r[o];let c=_e(o);t[c]=De(p)}s.cases=t}else if(B(s,Array)){let t=[],r=null;for(let n=0,i=M(s),a=i.length;n<a;n++){let o=i[n];o[0]=="@"&&n==s.length-1&&r&&(o={next:o}),typeof o=="object"?o.token!=null||o.cases?t.push(r=Object.assign({},o)):Object.assign(r,o):typeof o=="string"&&t.push(r={token:_e(o)})}s=t}if(B(s,Array))for(let t=0,r=M(s),n=r.length;t<n;t++){let i=r[t];i.token&&i.token.indexOf("$$")>=0&&(i.token=i.token.replace("$$","$"+(t+1))),i.next&&(i.next=xe(i.next)),i.switchTo&&(i.switchTo=xe(i.switchTo))}return s}for(let s=0,e=Object.keys(je),t=e.length,r,n;s<t;s++){r=e[s],n=je[r];let i=0;for(;i<n.length;){let a=n[i];if(B(a[0],Array)){n.splice(i,1,...a);continue}else typeof a=="string"?n[i]={include:a}:B(a[1],Array)?a[1]=De(a[1]):B(a,Array)&&a.splice(1,2,De(a[1],a[2]));i++}}var Ke={defaultToken:"invalid",ignoreCase:!1,tokenPostfix:"",brackets:[{open:"{",close:"}",token:"bracket.curly"},{open:"[",close:"]",token:"bracket.square"},{open:"(",close:")",token:"bracket.parenthesis"}],keywords:["def","and","or","is","isnt","not","on","yes","@","no","off","true","false","null","this","self","as","new","delete","typeof","in","instanceof","return","throw","break","continue","debugger","if","elif","else","switch","for","while","do","try","catch","finally","class","extends","super","undefined","then","unless","until","loop","of","by","when","prop","attr","export","import","extend","var","let","const","require","isa","await"],boolean:["true","false","yes","no","undefined","null"],operators:["=","!","~","?",":","!!","??","&","|","^","%","<<","!&",">>",">>>","+=","-=","*=","/=","&=","|=","?=","??=","^=","%=","~=","<<=",">>=",">>>=","..","...","||=","&&=","**=","**","|=?","~=?","^=?","=?","and","or"],assignments:["=","|=?","~=?","^=?","=?","^=","%=","~=","<<=",">>=",">>>=","||=","&&=","?=","??=","+=","-=","*=","/=","&=","|=","**="],logic:[">","<","==","<=",">=","!=","&&","||","===","!=="],ranges:["..","..."],spread:["..."],dot:["."],access:[".",".."],math:["+","-","*","/","++","--"],unspaced_ops:Nn("... . .. + * ++ --"),comment:/#(\s.*)?(?=\n|$)/,symbols:/[=><!~?&%|+\-*\^,]+/,escapes:/\\(?:[abfnrtv\\"'$]|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,postaccess:/(:(?=\w))?/,ivar:/\@[a-zA-Z_]\w*/,B:/(?=\s|$)/,br:/[\r\n]+/,constant:/[A-Z][\w\$]*(?:\-+[\w\$]+)*/,id:/[A-Za-z_\$][\w\$]*(?:\-+[\w\$]+)*\??/,classid:/\@?[A-Za-z_\$][\w\$]*(?:\-+[\w\$]+)*\??/,plainid:/[A-Za-z_\$][\w\$]*(?:\-+[\w\$]+)*\??/,fieldid:/[\@\#]*@plainid/,propid:/[\@\#]*@plainid/,defid:/[\@\#]*@plainid/,decid:/\@(?:@plainid)?/,symid:/\#+@plainid/,envvar:/\$+[\w\-]+\$/,symref:/\#+@plainid/,optid:/(?:@id)?/,esmIdentifier:/[A-Za-z_\$\@][\w\$]*(?:\-+[\w\$]+)*\??/,propertyPath:/(?:[A-Za-z_\$][A-Za-z\d\-\_\$]*\.)?(?:[A-Za-z_\$][A-Za-z\d\-\_\$]*)/,tagNameIdentifier:/(?:[\w\-]+\:)?\w+(?:\-\w+)*/,variable:/[\w\$]+(?:-[\w\$]*)*\??/,varKeyword:/var|let|const/,tagIdentifier:/-*[\$a-zA-Z][\w\-\$]*/,implicitCall:/(?!\s(?:and|or|is|isa)\s)(?=\s[\w\'\"\/\[\{])/,cssModifier:/(?:\@+[\<\>\!]?[\w\-]+\+?|\.+@id\-?)/,cssPropertyPath:/[\@\.]*[\w\-\$]+(?:[\@\.]+[\w\-\$]+)*/,cssVariable:/(?:--|\$)[\w\-\$]+/,cssPropertyName:/\#?[\w\-\$]+/,cssPropertyKey:/(?:@cssPropertyName(?:@cssModifier)*|\^*@cssModifier+)(?:\s*[\:\=])/,cssUpModifier:/\.\.[\w\-\$]+/,cssIsModifier:/\.[\w\-\$]+/,regEx:/\/(?!\/\/)(?:[^\/\\]|\\.)*\/[igm]*/,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/,tokenizer:je};function jn(s){return Array.isArray(s)}function Kr(s){return!jn(s)}function Ue(s){return typeof s=="string"}function qr(s){return!Ue(s)}function Ur(s){return!s}function Y(s,e){return s.ignoreCase&&e?e.toLowerCase():e}function Ze(s){return s.replace(/[&<>'"_]/g,"-")}function Zr(s,e){console.log(`${s.languageId}: ${e}`)}function A(s,e){return new Error(`${s.languageId}: ${e}`)}var Wr={};function Dn(s){let e=[],t=0,r=s.length,n="",i=0;for(;t<r;){let a=s[t++];if(a=="$"){let o=s[t++];if(o=="$"){n+="$";continue}n&&e.push(n),n="",o=="#"?e.push(0):o=="S"?e.push(parseInt(s[t++])+100):e.push(parseInt(o)+1)}else n+=a}return n&&e.push(n),Wr[s]=e,e}function q(s,e,t,r,n){let i=null,a=Wr[e]||Dn(e),o="";for(let p=0;p<a.length;p++){let c=a[p];typeof c=="string"?o+=c:c>100?(i===null&&(i=n.split(".")),o+=i[c-101]||""):c===100?o+=n:c===0?o+=t:c>0&&(o+=r[c-1])}return o}var qe={};function be(s,e){let t=e;if(qe[t])return s.tokenizer[qe[t]];for(;t&&t.length>0;){let r=s.tokenizer[t];if(r)return qe[e]=t,r;let n=t.lastIndexOf(".");n<0?t=null:t=t.substr(0,n)}return null}function Jr(s,e){let t=e;for(;t&&t.length>0;){if(s.stateNames[t])return!0;let n=t.lastIndexOf(".");n<0?t=null:t=t.substr(0,n)}return!1}function qn(s,e){if(!e||!Array.isArray(e))return!1;for(let t of e)if(!s(t))return!1;return!0}function Yr(s,e){return typeof s=="boolean"?s:e}function Qr(s,e){return typeof s=="string"?s:e}function Un(s){let e={};for(let t of s)e[t]=!0;return e}function en(s,e=!1){e&&(s=s.map(function(r){return r.toLowerCase()}));let t=Un(s);return e?function(r){return t[r.toLowerCase()]!==void 0&&t.hasOwnProperty(r.toLowerCase())}:function(r){return t[r]!==void 0&&t.hasOwnProperty(r)}}function We(s,e){let t=0;for(;e.indexOf("@")>=0&&t<5;)t++,e=e.replace(/@(\w+)/g,function(r,n){let i="";if(typeof s[n]=="string")i=s[n];else if(s[n]&&s[n]instanceof RegExp)i=s[n].source;else throw s[n]===void 0?A(s,"language definition does not contain attribute '"+n+"', used at: "+e):A(s,"attribute reference '"+n+"' must be a string, used at: "+e);return Ur(i)?"":"(?:"+i+")"});return new RegExp(e,s.ignoreCase?"i":"")}function Zn(s,e,t,r){if(r<0)return s;if(r<e.length)return e[r];if(r>=100){r=r-100;let n=t.split(".");if(n.unshift(t),r<n.length)return n[r]}return null}function Wn(s,e,t,r){let n=-1,i=t,a=t.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);a&&(a[3]&&(n=parseInt(a[3]),a[2]&&(n=n+100)),i=a[4]);let o="~",p=i;!i||i.length===0?(o="!=",p=""):/^\w*$/.test(p)?o="==":(a=i.match(/^(@|!@|~|!~|==|!=)(.*)$/),a&&(o=a[1],p=a[2]));let c;if((o==="~"||o==="!~")&&/^(\w|\|)*$/.test(p)){let l=en(p.split("|"),s.ignoreCase);c=function(h){return o==="~"?l(h):!l(h)}}else if(o==="@"||o==="!@"){let l=s[p];if(!l)throw A(s,"the @ match target '"+p+"' is not defined, in rule: "+e);if(!qn(function(f){return typeof f=="string"},l))throw A(s,"the @ match target '"+p+"' must be an array of strings, in rule: "+e);let h=en(l,s.ignoreCase);c=function(f){return o==="@"?h(f):!h(f)}}else if(o==="~"||o==="!~")if(p.indexOf("$")<0){let l=We(s,"^"+p+"$");c=function(h){return o==="~"?l.test(h):!l.test(h)}}else c=function(l,h,f,u){return We(s,"^"+q(s,p,h,f,u)+"$").test(l)};else if(p.indexOf("$")<0){let l=Y(s,p);c=function(h){return o==="=="?h===l:h!==l}}else{let l=Y(s,p);c=function(h,f,u,v,$){let I=q(s,l,f,u,v);return o==="=="?h===I:h!==I}}return n===-1?{name:t,value:r,test:function(l,h,f,u){return c(l,l,h,f,u)}}:{name:t,value:r,test:function(l,h,f,u){let v=Zn(l,h,f,n);return c(v||"",l,h,f,u)}}}function Je(s,e,t){if(t){if(typeof t=="string")return t;if(t.token||t.token===""){if(typeof t.token!="string")throw A(s,"a 'token' attribute must be of type string, in rule: "+e);{let r={token:t.token};if(t.token.indexOf("$")>=0&&(r.tokenSubst=!0),typeof t.bracket=="string")if(t.bracket==="@open")r.bracket=1;else if(t.bracket==="@close")r.bracket=-1;else throw A(s,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+e);if(t.next){if(typeof t.next!="string")throw A(s,"the next state must be a string value in rule: "+e);{let n=t.next;if(!/^(@pop|@push|@popall)$/.test(n)&&(n[0]==="@"&&(n=n.substr(1)),n.indexOf("$")<0&&!Jr(s,q(s,n,"",[],""))))throw A(s,"the next state '"+t.next+"' is not defined in rule: "+e);r.next=n}}return typeof t.goBack=="number"&&(r.goBack=t.goBack),typeof t.switchTo=="string"&&(r.switchTo=t.switchTo),typeof t.log=="string"&&(r.log=t.log),typeof t._push=="string"&&(r._push=t._push),typeof t._pop=="string"&&(r._pop=t._pop),typeof t.mark=="string"&&(r.mark=t.mark),typeof t.fn=="string"&&(r.fn=t.fn),typeof t.nextEmbedded=="string"&&(r.nextEmbedded=t.nextEmbedded,s.usesEmbedded=!0),r}}else if(Array.isArray(t)){let r=[];for(let n=0,i=t.length;n<i;n++)r[n]=Je(s,e,t[n]);return{group:r}}else if(t.cases){let r=[];for(let i in t.cases)if(t.cases.hasOwnProperty(i)){let a=Je(s,e,t.cases[i]);i==="@default"||i==="@"||i===""?r.push({test:void 0,value:a,name:i}):i==="@eos"?r.push({test:function(o,p,c,l){return l},value:a,name:i}):r.push(Wn(s,e,i,a))}let n=s.defaultToken;return{test:function(i,a,o,p){for(let c of r)if(!c.test||c.test(i,a,o,p))return c.value;return n}}}else throw A(s,"an action must be a string, an object with a 'token' or 'cases' attribute, or an array of actions; in rule: "+e)}else return{token:""}}var Xe=class{regex=new RegExp("");action={token:""};matchOnlyAtLineStart=!1;name="";stats;string;constructor(e){this.name=e,this.stats={time:0,count:0,hits:0}}setRegex(e,t){let r;if(typeof t=="string")r=t;else if(t instanceof RegExp)r=t.source;else throw A(e,"rules must start with a match string or regular expression: "+this.name);r.length==2&&r[0]=="\\"&&/[\{\}\(\)\[\]]/.test(r[1])&&(this.string=r[1]),this.matchOnlyAtLineStart=r.length>0&&r[0]==="^",this.name=this.name+": "+r,this.regex=We(e,"^(?:"+(this.matchOnlyAtLineStart?r.substr(1):r)+")")}setAction(e,t){this.action=Je(e,this.name,t)}};function ke(s,e){if(!e||typeof e!="object")throw new Error("Monarch: expecting a language definition object");let t={};t.languageId=s,t.noThrow=!1,t.maxStack=100,t.start=typeof e.start=="string"?e.start:null,t.ignoreCase=Yr(e.ignoreCase,!1),t.tokenPostfix=Qr(e.tokenPostfix,"."+t.languageId),t.defaultToken=Qr(e.defaultToken,"source"),t.usesEmbedded=!1;let r=e;r.languageId=s,r.ignoreCase=t.ignoreCase,r.noThrow=t.noThrow,r.usesEmbedded=t.usesEmbedded,r.stateNames=e.tokenizer,r.defaultToken=t.defaultToken;function n(a,o,p){for(let c of p){let l=c.include;if(l){if(typeof l!="string")throw A(t,"an 'include' attribute must be a string at: "+a);if(l[0]==="@"&&(l=l.substr(1)),!e.tokenizer[l])throw A(t,"include target '"+l+"' is not defined at: "+a);n(a+"."+l,o,e.tokenizer[l])}else{let h=new Xe(a);if(Array.isArray(c)&&c.length>=1&&c.length<=3)if(h.setRegex(r,c[0]),c.length>=3)if(typeof c[1]=="string")h.setAction(r,{token:c[1],next:c[2]});else if(typeof c[1]=="object"){let f=c[1];f.next=c[2],h.setAction(r,f)}else throw A(t,"a next state as the last element of a rule can only be given if the action is either an object or a string, at: "+a);else h.setAction(r,c[1]);else{if(!c.regex)throw A(t,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+a);c.name&&typeof c.name=="string"&&(h.name=c.name),c.matchOnlyAtStart&&(h.matchOnlyAtLineStart=Yr(c.matchOnlyAtLineStart,!1)),h.setRegex(r,c.regex),h.setAction(r,c.action)}o.push(h)}}}if(!e.tokenizer||typeof e.tokenizer!="object")throw A(t,"a language definition must define the 'tokenizer' attribute as an object");t.tokenizer=[];for(let a in e.tokenizer)if(e.tokenizer.hasOwnProperty(a)){t.start||(t.start=a);let o=e.tokenizer[a];t.tokenizer[a]=new Array,n("tokenizer."+a,t.tokenizer[a],o)}if(t.usesEmbedded=r.usesEmbedded,e.brackets){if(!Array.isArray(e.brackets))throw A(t,"the 'brackets' attribute must be defined as an array")}else e.brackets=[{open:"{",close:"}",token:"delimiter.curly"},{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"},{open:"<",close:">",token:"delimiter.angle"}];let i=[];for(let a of e.brackets){let o=a;if(o&&Array.isArray(o)&&o.length===3&&(o={token:o[2],open:o[0],close:o[1]}),o.open===o.close)throw A(t,"open and close brackets in a 'brackets' attribute must be different: "+o.open+`
 hint: use the 'bracket' attribute if matching on equal brackets is required.`);if(typeof o.open=="string"&&typeof o.token=="string"&&typeof o.close=="string")i.push({token:o.token+t.tokenPostfix,open:Y(t,o.open),close:Y(t,o.close)});else throw A(t,"every element in the 'brackets' array must be a '{open,close,token}' object or array")}return t.brackets=i,t.noThrow=!0,t}var j=class s{_tokenBrand;offset;type;language;value;scope;stack;mods;kind;symbol;next;context;prev;op;constructor(e,t,r){this.offset=e|0,this.type=t,this.language=r,this.kind=0,this.mods=0,this.value=null,this.stack=null}toString(){return this.value||""}get span(){return{offset:this.offset,start:this.offset,length:this.value?this.value.length:0,source:"imba"}}get indent(){return 0}get startOffset(){return this.offset}get endOffset(){return this.offset+(this.value?this.value.length:0)}clone(){let e=new s(this.offset,this.type,this.language);return e.value=this.value,e.stack=this.stack,e}match(e){if(typeof e=="string")if(e.indexOf(" ")>0)e=e.split(" ");else{let t=this.type.indexOf(e);return e[0]=="."?t>=0:t==0}if(e instanceof Array)for(let t of e){let r=this.type.indexOf(t);if(t[0]=="."?r>=0:r==0)return!0}return e instanceof RegExp?e.test(this.type):!1}},we=class{_tokenizationResultBrand;tokens;endState;constructor(e,t){this.tokens=e,this.endState=t}};var tn=10;function ce(s,e){return s.split(".")[e]}var pe=class s{static _INSTANCE=new s(tn);static create(e,t){return this._INSTANCE.create(e,t)}_maxCacheDepth;_entries;constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(e!==null&&e.depth>=this._maxCacheDepth)return new ie(e,t);let r=ie.getStackElementId(e);r.length>0&&(r+="|"),r+=t;let n=this._entries[r];return n||(n=new ie(e,t),this._entries[r]=n,n)}},ie=class s{parent;state;depth;constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;e!==null;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;e!==null&&t!==null;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return e===null&&t===null}get indent(){return this.state.lastIndexOf("	")-this.state.indexOf("	")}get scope(){return this.part(2)}get detail(){return this.part(2)}part(e){return this.state.split(".")[e]}equals(e){return s._equals(this,e)}push(e){return pe.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return pe.create(this.parent,e)}},he=class s{static _INSTANCE=new s(tn);static create(e){return this._INSTANCE.create(e)}_maxCacheDepth;_entries;constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e){if(e!==null&&e.depth>=this._maxCacheDepth)return new ve(e);let t=ie.getStackElementId(e),r=this._entries[t];return r||(r=new ve(e),this._entries[t]=r,r)}},ve=class s{stack;constructor(e){this.stack=e}clone(){return he.create(this.stack)}equals(e){return!(!(e instanceof s)||!this.stack.equals(e.stack))}},Ye=class{_tokens;_language;_lastTokenType;_lastToken;constructor(){this._tokens=[],this._language=null,this._lastToken=new j(0,"start","imba"),this._lastTokenType=null}enterMode(e,t){this._language=t}emit(e,t,r){this._lastTokenType;let n=new j(e,t,this._language);return this._lastTokenType=t,this._lastToken=n,this._tokens.push(n),n}finalize(e){return new we(this._tokens,e)}},oe=class{_modeId;_lexer;_profile;constructor(e,t){this._modeId=e,this._lexer=t,this._profile=!1}dispose(){}getLoadStatus(){return{loaded:!0}}getInitialState(){let e=pe.create(null,this._lexer.start);return he.create(e)}tokenize(e,t,r){let n=new Ye,i=this._tokenize(e,t,r,n);return n.finalize(i)}_tokenize(e,t,r,n){return this._myTokenize(e,t,r,n)}_safeRuleName(e){return e?e.name:"(unknown)"}_rescope(e,t,r,n){let i=(e||"").split("-"),a=(t||"").split("-");if(e==t)return;let o=1;for(;i[o]&&i[o]==a[o];)o++;let p=i.length;for(;p>o;)r.push("pop."+i[--p]+"."+p);for(;a.length>o;){let c="push."+a[o++]+"."+(o-1);if(n){let l=ce(n,1);c+="."+l}r.push(c)}}_myTokenize(e,t,r,n){n.enterMode(r,this._modeId);let i=e.length,a=t.stack,o=null,p=0,c=this._profile,l=null,h=!0,f=[],u=0,v=[],$=null;for(;h||p<i;){if(u++,u>1e3)throw console.log("infinite recursion"),"infinite recursion in tokenizer?";let I=p,_=a.depth,m=l?l.groups.length:0,y=a.state,b=null,w=null,d=null,C=null;if(l){b=l.matches;let S=l.groups.shift();w=S.matched,d=S.action,C=l.rule,l.groups.length===0&&(l=null)}else{if(!h&&p>=i)break;if(h=!1,v=this._lexer.tokenizer[y],!v&&(v=be(this._lexer,y),!v))throw A(this._lexer,"tokenizer state is not defined: "+y);let S=e.substr(p);for(let T of v)if(T.string!==void 0){if(S[0]===T.string){b=[T.string],w=T.string,d=T.action;break}}else if(p===0||!T.matchOnlyAtLineStart){if(c){T.stats.count++;let H=performance.now();b=S.match(T.regex),T.stats.time+=performance.now()-H,b&&T.stats.hits++}else b=S.match(T.regex);if(b){w=b[0],d=T.action;break}}}if(b||(b=[""],w=""),d||(p<i&&(b=[e.charAt(p)],w=b[0]),d=this._lexer.defaultToken),w===null)break;for(p+=w.length;Kr(d)&&qr(d)&&d.test;)d=d.test(w,b,y,p===i);let O=null;if(typeof d=="string"||Array.isArray(d))O=d;else if(d.group)O=d.group;else if(d.token!==null&&d.token!==void 0){if(d.tokenSubst?O=q(this._lexer,d.token,w,b,y):O=d.token,d.goBack&&(p=Math.max(0,p-d.goBack)),d.switchTo&&typeof d.switchTo=="string"){let S=q(this._lexer,d.switchTo,w,b,y);if(S[0]==="@"&&(S=S.substr(1)),be(this._lexer,S)){let T=a.scope,H=ce(S,2);T!==H&&this._rescope(T,H,f,S),a=a.switchTo(S)}else throw A(this._lexer,"trying to switch to a state '"+S+"' that is undefined in rule: "+this._safeRuleName(C))}else{if(d.transform&&typeof d.transform=="function")throw A(this._lexer,"action.transform not supported");if(d.next)if(d.next==="@push"){if(a.depth>=this._lexer.maxStack)throw A(this._lexer,"maximum tokenizer stack size reached: ["+a.state+","+a.parent.state+",...]");a=a.push(y)}else if(d.next==="@pop"){if(a.depth<=1)throw A(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(C));{let S=a;a=a.pop();let T=ce(S.state,2),H=ce(a.state,2);T!==H&&this._rescope(T,H,f,a.state)}}else if(d.next==="@popall")a=a.popall();else{let S=q(this._lexer,d.next,w,b,y);S[0]==="@"&&(S=S.substr(1));let T=ce(S,2);if(be(this._lexer,S))T!=a.scope&&this._rescope(a.scope||"",T,f,S),a=a.push(S);else throw A(this._lexer,"trying to set a next state '"+S+"' that is undefined in rule: "+this._safeRuleName(C))}}d.log&&typeof d.log=="string"&&Zr(this._lexer,this._lexer.languageId+": "+q(this._lexer,d.log,w,b,y)),d.mark&&n.emit(I+r,d.mark,a)}if(O===null)throw A(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(C));if(Array.isArray(O)){if(l&&l.groups.length>0)throw A(this._lexer,"groups cannot be nested: "+this._safeRuleName(C));if(b.length!==O.length+1)throw A(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(C));let S=0;for(let T=1;T<b.length;T++)S+=b[T].length;if(S!==w.length)throw A(this._lexer,"with groups, all characters should be matched in consecutive groups in rule: "+this._safeRuleName(C));l={rule:C,matches:b,groups:[]};for(let T=0;T<O.length;T++)l.groups[T]={action:O[T],matched:b[T+1]};p-=w.length;continue}else{if(O==="@rematch"&&(p-=w.length,w="",b=null,O=""),w.length===0)if(i===0||_!==a.depth||y!==a.state||(l?l.groups.length:0)!==m){for(typeof O=="string"&&O&&n.emit(p+r,O,a);f.length>0;)n.emit(p+r,f.shift(),a);continue}else throw A(this._lexer,"no progress in tokenizer in rule: "+this._safeRuleName(C));let S=null;if(Ue(O)&&O.indexOf("@brackets")===0){let H=O.substr(9),Ae=Jn(this._lexer,w);if(!Ae)throw A(this._lexer,"@brackets token returned but no bracket defined as: "+w);S=Ze(Ae.token+H)}else{let H=O===""?"":O+this._lexer.tokenPostfix;S=Ze(H)}let T=n.emit(I+r,S,a);for(T.stack=a,o&&o!=T&&(o.value=e.slice(o.offset-r,I)),o=T;f.length>0;)n.emit(p+r,f.shift(),a)}}return o&&!o.value&&(o.value=e.slice(o.offset-r)),he.create(a)}};function Jn(s,e){if(!e)return null;e=Y(s,e);let t=s.brackets;for(let r of t){if(r.open===e)return{token:r.token,bracketType:1};if(r.close===e)return{token:r.token,bracketType:-1}}return null}var Xn=Symbol(),Qe=class Qe{get node(){return this.scope&&this.scope.start==this?this.scope:this.pops?this.pops:this}get nextNode(){var e;return(e=this.next)==null?void 0:e.node}get prevNode(){var e;return(e=this.prev)==null?void 0:e.node}};k(Qe,Xn,"Token",1,j);var rn=Qe,nn=Symbol(),Se=class Se{constructor(e=null){this[V](e),G(this,nn)}[V](e=null,t=!0,r=!0){this.offset=e?e.offset:void 0,this.text=e?e.text:void 0,this.tokens=e?e.tokens:void 0,this.startState=e?e.startState:void 0,this.endState=e?e.endState:void 0}clone(e=this.offset){let t=[],r=e-this.offset;for(let n=0,i=M(this.tokens),a=i.length;n<a;n++){let o=i[n],p=o.clone();p.offset=o.offset+r,t.push(p)}return new Se({offset:e,startState:this.startState,endState:this.endState,text:this.text,tokens:t})}};k(Se,nn,"LexedLine",16);var $e=Se,Yn=ke("imba",Ke),ae=new oe("imba",Yn);var fe=["comment","string","keyword","number","regexp","operator","namespace","type","struct","class","interface","enum","typeParameter","function","member","macro","variable","parameter","property","label"];for(let s=0,e=M(fe),t=e.length;s<t;s++){let r=e[s];fe[r]=s}var F={Declaration:1,Import:2,Export:4,Global:8,ReadOnly:16,Static:32,Modification:64,Deprecated:128,Access:256,Root:512,Special:1024,Class:2048,Member:4096,Function:8192,Def:16384,Var:32768,Let:65536,Const:1<<17,Get:1<<18,Set:1<<19},Qn=Object.keys(F).map(function(s){return s.toLowerCase()});for(let s=0,e=M(Object.keys(F)),t=e.length;s<t;s++){let r=e[s];F[r.toLowerCase()]=F[r]}var N={Keyword:1,Access:2,Key:4,TagName:8,TagEvent:16,TagFlag:32,TagProp:64,TagEventModifier:128,Value:256,Path:512,StyleProp:1024,StyleValue:2048,Type:4096,StyleModifier:8192,StyleSelector:16384,VarName:32768,ImportName:65536,ClassBody:1<<17,ComponentBody:1<<18,TagId:1<<19,Decorator:1<<20,StyleVar:1<<21,StyleUnit:1<<22,ImportStatement:1<<23,DecoratorModifier:1<<24,StyleColor:1<<25},x={Keyword:1,Root:2,Class:4,Block:8},Ce={and:x.Block,await:x.Block,begin:x.Block,break:x.Block,by:x.Block,case:x.Block,catch:x.Block,class:x.Block,const:x.Block,continue:x.Block,css:x.Class|x.Root,debugger:x.Block,def:x.Class|x.Block,get:x.Class,set:x.Class,delete:x.Block,do:x.Block,elif:x.Block,else:x.Block,export:x.Root,extends:x.Block,false:x.Block,finally:x.Block,for:x.Block,if:x.Block,import:x.Root,in:x.Block,instanceof:x.Block,is:x.Block,isa:x.Block,isnt:x.Block,let:x.Block,loop:x.Block,module:x.Block,nil:x.Block,no:x.Block,not:x.Block,null:x.Block,of:x.Block,or:x.Block,require:x.Block,return:x.Block,self:x.Block,static:x.Block|x.Class,super:x.Block,switch:x.Block,tag:x.Root,then:x.Block,this:x.Block,throw:x.Block,true:x.Block,try:x.Block,typeof:x.Block,undefined:x.Block,unless:x.Block,until:x.Block,var:x.Block,when:x.Block,while:x.Block,yes:x.Block},P={File:1,Module:2,Namespace:3,Package:4,Class:5,Method:6,Property:7,Field:8,Constructor:9,Enum:10,Interface:11,Function:12,Variable:13,Constant:14,String:15,Number:16,Boolean:17,Array:18,Object:19,Key:20,Null:21,EnumMember:22,Struct:23,Event:24,Operator:25,TypeParameter:26},Te={};for(let s=0,e=Object.keys(P),t=e.length,r,n;s<t;s++){r=e[s],n=P[r];let i=r.replace(/([a-z])([A-Z])/g,function(a,o,p){return""+o+" "+p});i=i.toLowerCase(),i=="variable"&&(i="var"),Te[r]=Te[n]=i}for(let s=0,e=Object.keys(P),t=e.length,r,n;s<t;s++)r=e[s],n=P[r],P[n]=r;var ue=Symbol.for("#datatype"),et=Symbol.for("#scope"),g={None:0,ConstVariable:1,LetVariable:2,Property:4,EnumMember:8,Function:16,Class:32,LocalComponent:64,GlobalComponent:128,RegularEnum:256,ValueModule:512,Parameter:1024,TypeLiteral:2048,ObjectLiteral:4096,Method:8192,Constructor:16384,GetAccessor:32768,SetAccessor:65536,Signature:1<<17,TypeParameter:1<<18,TypeAlias:1<<19,ExportValue:1<<20,Alias:1<<21,Prototype:1<<22,ExportStar:1<<23,Optional:1<<24,IsGlobal:1<<25,IsRoot:1<<26};g.Component=g.LocalComponent|g.GlobalComponent;g.Variable=g.LetVariable|g.ConstVariable|g.Parameter;g.Accessor=g.GetAccessor|g.SetAccessor;g.ClassMember=g.Method|g.Accessor|g.Property;g.Scoped=g.Function|g.Variable|g.Class|g.Enum|g.LocalComponent;g.Entity=g.ClassMember|g.Function;g.Type=g.Component|g.Class;g.GlobalVar=g.ConstVariable|g.IsGlobal;var sn=[["entity.name.component.local",0,g.LocalComponent],["entity.name.component.global",0,g.GlobalComponent],["entity.name.function",0,g.Function],["entity.name.class",0,g.Class],["entity.name.constructor",0,g.Method],["entity.name.def",0,g.Method],["entity.name.get",0,g.GetAccessor],["entity.name.set",0,g.SetAccessor],["field",0,g.Property],["decl-let",0,g.LetVariable],["decl-for-index",0,g.LetVariable,{datatype:"\\number"}],["decl-for",0,g.LetVariable,{kind:"for"}],["decl-var",0,g.LetVariable],["decl-param",0,g.Parameter],["decl-const",0,g.ConstVariable],["decl-import-type",0,g.TypeAlias],["decl-import",0,g.ConstVariable]],tt={},on=Symbol(),rt=class rt{[V](e=null,t=!0,r=!0){var n;this.value=e?e.value:void 0,this.body=e&&(n=e.body)!==void 0?n:null}static typeMatch(e){if(tt[e]!=null)return tt[e];for(let t=0,r=M(sn),n=r.length;t<n;t++){let[i,a,o,p]=r[t];if(e.indexOf(i)>=0)return tt[e]=sn[t]}return null}static forToken(e,t,r=0){let n=this.typeMatch(t);return n?new this(n[2],e.value,e,n[3]):null}constructor(e,t,r,n=null){this[V](),this.flags=e,this.name=t,this.node=r,this.desc=n,G(this,on)}get importSource(){return this.importedΦ?this.node.context.closest("imports").sourcePath:null}get exportName(){return this.node.prev.match("keyword.as")?this.node.prev.prev.value:this.node.match(".default")?"default":this.node.value}get importInfo(){if(!this.importedΦ)return null;let e=this.node.context.closest("imports");return{exportName:this.exportName,name:this.node.value,isTypeOnly:e.isTypeOnly,path:e.sourcePath}}get datatype(){var i;let e,t=this.desc&&this.desc.datatype;if(t)return t;if(this[ue])return this[ue];let r=this.node&&this.node.nextNode;if(r&&r.type=="type")return r;let n=this.scope;if(n&&((i=this.desc)==null?void 0:i.kind)=="for"){let a=n.doc.getDestructuredPath(this.node,[[n.expression,"__@iterable"]]);return this[ue]||(this[ue]=a)}return(e=this.importInfo)?e:null}get staticΦ(){return this.node&&this.node.mods&F.Static}get entityΦ(){return this.flags&g.Entity}get itervarΦ(){return this.node&&this.node.match(".decl-for")}get variableΦ(){return this.flags&g.Variable}get parameterΦ(){return this.flags&g.Parameter}get memberΦ(){return this.flags&g.ClassMember}get scopedΦ(){return this.flags&g.Scoped}get typeΦ(){return this.flags&g.Type}get globalΦ(){return!this[et]}get rootΦ(){return this[et]&&this[et].rootΦ}get importedΦ(){return this.node&&this.node.match(".decl-import")}get componentΦ(){return this.flags&g.Component}get escapedName(){return this.name}get scope(){var e,t;return(t=(e=this.node)==null?void 0:e.context)==null?void 0:t.scope}addReference(e){return this.references||(this.references=[]),this.references.push(e),e.symbol=this,this}dereference(e){let t=this.references.indexOf(e);return t>=0&&(e.symbol=null,this.references.splice(t,1)),this}get kind(){return this.variableΦ?P.Variable:this.flags&g.Class?P.Class:this.flags&g.Component?P.Class:this.flags&g.Property?P.Field:this.flags&g.Method?this.escapedName=="constructor"?P.Constructor:P.Method:this.flags&g.GetAccessor?"getter":this.flags&g.SetAccessor?"setter":this.flags&g.Function?P.Function:P.Method}get semanticKind(){return this.flags&g.Parameter?"parameter":this.variableΦ?"variable":this.typeΦ?"type":this.flags&g.Function?"function":this.memberΦ?"member":this.componentΦ?"component":"variable"}get outlineKind(){return Te[this.kind]}get outlineText(){return this.node?this.node.value:"--"}toOutline(e){return{kind:this.outlineKind,name:this.outlineText}}get semanticFlags(){let e=0;return this.flags&g.ConstVariable&&(e|=F.ReadOnly),this.staticΦ&&(e|=F.Static),this.importedΦ&&(e|=F.Import),this.globalΦ&&(e|=F.Global),this.rootΦ&&(e|=F.Root),this.flags&g.IsSpecial&&(e|=F.Special),e}asNavigateToItem(){var t;if(!this.node)return null;let e={name:this.outlineText,kind:this.outlineKind,kindModifiers:"",textSpan:this.node.textSpan||this.node.span,containerName:"",containerKind:""};try{let r=(t=this.body)==null?void 0:t.parent;r&&!r.rootΦ&&(e.containerName=r.outlineText,e.containerKind=r.outlineKind)}catch{}return e}};k(rt,on,"Sym",16);var D=rt,es=Symbol(),nt=class nt extends D{};k(nt,es,"ForVar",0);var an=nt,ts=Symbol(),st=class st{};k(st,ts,"SymbolMap",0);var ln=st;var Me=Symbol.for("#scope"),cn={global:{datatype:"globalThis"},imba:{datatype:"globalThis.imba"},module:{},window:{datatype:"globalThis.window"},document:{datatype:"globalThis.document"},exports:{},console:{datatype:"globalThis.console"},process:{datatype:"globalThis.process"},parseInt:{datatype:"globalThis.parseInt"},parseFloat:{datatype:"globalThis.parseFloat"},setTimeout:{datatype:"globalThis.setTimeout"},setInterval:{datatype:"globalThis.setInterval"},setImmediate:{datatype:"globalThis.setImmediate"},clearTimeout:{datatype:"globalThis.clearTimeout"},clearInterval:{datatype:"globalThis.clearInterval"},clearImmediate:{datatype:"globalThis.clearImmediate"},globalThis:{datatype:"globalThis"},isNaN:{datatype:"globalThis.isNaN"},isFinite:{datatype:"globalThis.isFinite"},__dirname:{datatype:"\\string"},__filename:{datatype:"\\string"},__realname:{datatype:"\\string"}},pn=Symbol(),Et=class Et{[V](e=null,t=!0,r=!0){var n;this.type=e&&(n=e.type)!==void 0?n:"",this.start=e?e.start:void 0,this.end=e?e.end:void 0,this.parent=e?e.parent:void 0}static build(e,t,r,n,i){return new this(e,t,r,n,i)}constructor(e,t,r,n,i=null){this[V](),this.doc=e,this.start=t,this.end=null,this.type=n,this.parent=r,this.$name=null,t.scope=this,G(this,pn)}pop(e){return this.end=e,e.start=this.start,e.pops=this,this.start.end=e,this.visit(),this.parent}find(e){return this.findChildren(e,!0)[0]}get childNodes(){return this.doc.getNodesInScope(this,!0,!0)}get children(){return this.doc.getNodesInScope(this)}get allTokens(){let e=[],t=this.start;for(;t&&(e.push(t),t!=this.end);)t=t.next;return e}get parents(){return[this.parent].concat(this.parent.parents)}get span(){let e=this.start.startOffset,t=this.end?this.end.endOffset:this.doc.content.length;return{start:e,length:t-e}}get contextSpan(){return this.span}findChildren(e,t=!1){let r=[],n=this.start;for(;n;){if(t&&r.length)return r;if(n.scope&&n.scope!=this){n.scope.match(e)&&r.push(n.scope),n=n.scope.next;continue}if(n.match(e)&&r.push(n),n==this.end)break;n=n.next}return r}closest(e){return this.match(e)?this:this.parent?this.parent.closest(e):null}visit(){return this}get memberΦ(){return!1}get topΦ(){return!1}get scopeΦ(){return!1}get selfScope(){return this.memberΦ||this.topΦ?this:this.parent.selfScope}get name(){return this.$name||""}get value(){return this.doc.content.slice(this.start.offset,this.end?this.end.endOffset:-1)}get outerText(){return this.doc.getText(this.contextSpan)}get next(){return this.end?this.end.next:null}get prev(){return this.start?this.start.prev:null}match(e){return typeof e=="string"?this.type==e:B(e,RegExp)?e.test(this.type):B(e,Function)?e(this):!0}get startOffset(){return this.start.offset}get endOffset(){return this.end.endOffset}get outlineText(){return"item"}get outlineKind(){return this.symbol?this.symbol.outlineKind:this.type}toOutline(){return{text:this.outlineText,kind:this.outlineKind}}};k(Et,pn,"Node",16);var me=Et,hn=Symbol(),Ft=class Ft extends me{constructor(e,t,r,n,i=[]){super(e,t,r,n),G(this,hn)}get scope(){return this.parent.scope}get varmap(){return this.parent.varmap}register(e){return this.parent.register(e)}lookup(...e){return this.parent.lookup(...e)}get comment(){var n;let t=this.value.match(/\s\#\s([^\n]+)\n/);if(t)return t[1];let r=this.start.prev;return r&&r.match("white.tabs")&&(r=r.prev),(n=r==null?void 0:r.match)!=null&&n.call(r,"comment")?r.value.replace(/(^\#\s)|(\n+$)/g,""):null}};k(Ft,hn,"Group",16);var E=Ft,rs=Symbol(),zt=class zt extends E{};k(zt,rs,"ValueNode",0);var it=zt,ns=Symbol(),Vt=class Vt extends E{};k(Vt,ns,"StringNode",0);var ot=Vt,ss=Symbol(),Bt=class Bt extends E{get properties(){return this.findChildren("styleprop")}};k(Bt,ss,"StyleNode",0);var at=Bt,is=Symbol(),Pt=class Pt extends E{};k(Pt,is,"StyleRuleNode",0);var lt=Pt,fn=Symbol(),Gt=class Gt extends me{constructor(e,t,r,n,i=[]){if(super(e,t,r,n),this.entities=[],this.refs=[],this.varmap=Object.create(r?r.varmap:{}),B(this,Q))for(let a=0,o=Object.keys(cn),p=o.length,c,l;a<p;a++){c=o[a],l=cn[c];let h={value:c,offset:-1,mods:0,match:function(){return!1}};this.varmap[c]=new D(g.GlobalVar,c,h,l)}return this.indent=i[3]&&i[3][0]=="	"?i[3].length:0,this.setup(),this;G(this,fn)}get outlineText(){return this.ident?this.ident.value:"something"}setup(){var e,t,r;if(this.handlerΦ){let n="ImbaEvents."+this.parent.name;this.varmap.e=new D(g.Parameter,"e",null,{datatype:n}),this.varmap.e[Me]=this}if(this.classΦ||this.propertyΦ){this.ident=this.token=se(this.start,"entity.");let n=se(this.start,"keyword.class keyword.tag",1e4,2);if(this.keyword=n,this.classΦ&&n&&(this.token=(e=n.next)==null?void 0:e.next,(r=(t=this.token)==null?void 0:t.match)!=null&&r.call(t,"push.assignable")&&(this.token=this.token.scope),this.ident=this.token),this.ident&&(this.ident.body=this),this.ident&&this.ident.type=="entity.name.def.render"&&(this.$name="render",this.ident.symbol))return this.ident.symbol.name="render"}}get selfPath(){let e=this.path;return this.propertyΦ?e.slice(0,e.lastIndexOf(".")):e}get path(){let e=this.parent?this.parent.path:"";if(this.propertyΦ){let t=this.staticΦ?".":".prototype.";return this.parent?""+this.parent.path+t+this.name:this.name}if(this.componentΦ)if(this.name[0]==this.name[0].toLowerCase()){let t=Nr(this.name);return t?t.name:Pr(this.name)}else return this.name;return this.classΦ?this.name:e}get allowedKeywordTypes(){return this.classΦ?x.Class:this.rootΦ?x.Root|x.Block:x.Block}get componentΦ(){return!!this.type.match(/^component/)}get rootΦ(){return B(this,Q)}get topΦ(){return B(this,Q)}get scopeΦ(){return!0}get classΦ(){return!!this.type.match(/^class/)||this.componentΦ}get exportForDtsΦ(){var e;return this.classΦ&&!!(this.extendsΦ||this.globalΦ||this.namespacedΦ&&(!((e=this.namespace)!=null&&e.symbol)||this.namespace.symbol.importSource))}get namespace(){if(!this.namespacedΦ)return null;let e=this.ident;return B(e,Le)?e.start.next:e}get namespacedΦ(){var e,t,r;return this.classΦ&&((r=(t=(e=this.ident)==null?void 0:e.value)==null?void 0:t.indexOf)==null?void 0:r.call(t,"."))>0}get extendsΦ(){var e,t;return this.classΦ&&this.keyword&&((t=(e=this.keyword.prev.prev)==null?void 0:e.match)==null?void 0:t.call(e,"keyword.extend"))}get exportsΦ(){var e,t;return this.classΦ&&this.keyword&&((t=(e=this.keyword.prev.prev)==null?void 0:e.match)==null?void 0:t.call(e,"keyword.export"))}get globalΦ(){return this.classΦ&&(!!se(this.keyword,"keyword.global",3,1)||this.componentΦ&&this.name[0]==this.name[0].toLowerCase())}get defΦ(){return!!this.type.match(/def|get|set/)}get staticΦ(){return!!(this.ident&&this.ident.mods&F.Static)}get handlerΦ(){return!!this.type.match(/handler|spy/)}get memberΦ(){return!!this.type.match(/def|get|set/)}get propertyΦ(){return!!this.type.match(/def|get|set|field/)}get flowΦ(){return!!this.type.match(/if|else|elif|unless|for|while|until/)}get closureΦ(){return!!this.type.match(/class|component|def|get|set|do/)}get scope(){return this}get name(){return this.$name||(this.ident?this.ident.value:"")}get span(){let e=this.start.startOffset;this.ident&&(e=this.ident.startOffset);let t=this.end?this.end.endOffset:this.doc.content.length;return{start:e,length:t-e}}get textSpan(){return this.ident?this.ident.span:this.span}get contextSpan(){return this.classΦ||this.componentΦ||this.defΦ?this.doc.expandSpanToLines(this.span):this.span}visit(){return this}register(e){return e.scopedΦ&&(this.varmap[e.name]=e,e[Me]||(e[Me]=this),this.rootΦ&&(e.flags|=g.IsRoot)),e}lookup(e,t=g.Scoped){let r,n=e.value;return n[n.length-1]=="!"&&(n=n.slice(0,-1)),(r=this.varmap[n])?r:null}};k(Gt,fn,"Scope",16);var R=Gt,os=Symbol(),Ht=class Ht extends R{};k(Ht,os,"GlobalScope",0);var un=Ht,as=Symbol(),Rt=class Rt extends R{get parents(){return[]}};k(Rt,as,"Root",0);var Q=Rt,ls=Symbol(),Nt=class Nt extends R{};k(Nt,ls,"Class",0);var mn=Nt,cs=Symbol(),jt=class jt extends R{};k(jt,cs,"Method",0);var dn=jt,ps=Symbol(),Dt=class Dt extends R{};k(Dt,ps,"Flow",0);var gn=Dt,hs=Symbol(),Kt=class Kt extends R{get expression(){return this.find("keyword.in keyword.of").next.next}get forvars(){return Object.values(this.varmap).filter(function(e){return e.itervarΦ})}};k(Kt,hs,"ForScope",0);var ct=Kt,fs=Symbol(),qt=class qt extends R{};k(qt,fs,"BlockScope",0);var pt=qt,us=Symbol(),Ut=class Ut extends R{register(e){return this.parent.register(e)}lookup(...e){return this.parent.lookup(...e)}};k(Ut,us,"WeakScope",0);var yn=Ut,ms=Symbol(),Zt=class Zt extends R{get selfScope(){return this}};k(Zt,ms,"FieldScope",0);var ht=Zt,ds=Symbol(),Wt=class Wt extends R{};k(Wt,ds,"StyleRule",0);var ft=Wt,gs=Symbol(),Jt=class Jt extends E{};k(Jt,gs,"SelectorNode",0);var ut=Jt,ys=Symbol(),Xt=class Xt extends E{get propertyName(){var e;return this.start.next.match("style.property.name")?this.start.next.value:(e=this.parent.prevProperty)==null?void 0:e.propertyName}get modifier(){if(this.start.next.match("style.property.modifier"))return this.start.next.value}get styleValue(){return!0}};k(Xt,ys,"StylePropKey",0);var mt=Xt,xs=Symbol(),Yt=class Yt extends E{get properties(){return this.findChildren("styleprop")}};k(Yt,xs,"StyleProps",0);var dt=Yt,_s=Symbol(),Qt=class Qt extends E{get key(){return this.parent.key}get propertyName(){return this.parent.propertyName}get modifier(){return this.parent.modifier}};k(Qt,_s,"StylePropValue",0);var gt=Qt,bs=Symbol(),er=class er extends E{get key(){return this.find("stylepropkey")}get prevProperty(){return this.start.prev.pops?this.start.prev.pops:null}get propertyName(){var e;return(e=this.key)==null?void 0:e.propertyName}get modifier(){var e;return(e=this.key)==null?void 0:e.modifier}};k(er,bs,"StylePropNode",0);var yt=er,ks=Symbol(),tr=class tr extends E{};k(tr,ks,"StyleInterpolation",0);var xt=tr,ws=Symbol(),rr=class rr extends E{get innerText(){return this.value.slice(1,-1)}};k(rr,ws,"PathNode",0);var _t=rr,vs=Symbol(),nr=class nr extends E{get name(){var t,r;if((r=(t=this.start.next)==null?void 0:t.match)!=null&&r.call(t,"tag.name.parens"))return"any";let e=this.findChildren("tag.name").join("");return e=="self"?this.closest("component").name:e}get nameNode(){return this.findChildren("tag.name")[0]}get localΦ(){return this.name[0]==this.name[0].toUpperCase()}get tagName(){return this.name}get parentTag(){var e;return(e=this.closest("tagcontent"))==null?void 0:e.ownerTag}get ancestorTags(){var e;return(e=this.closest("tagcontent"))==null?void 0:e.ownerTags}get ancestorPath(){return this.ancestorTags.map(function(e){return e.tagName}).join(".")}get pathName(){return"<"+this.name+">"}get outlineText(){let e=this.findChildren(/tag\.(reference|name|id|white|flag|mixin|event(?!\-))/).join("").trim();return e=e.replace(/\.\s+/g,""),"<"+e+">"}toOutline(){return{text:this.outlineText,kind:"string",nameSpan:this.span}}};k(nr,vs,"TagNode",0);var bt=nr,$s=Symbol(),sr=class sr extends E{get propertyName(){return this.start.next.match("tag.attr")?this.start.next.value:""}get tagName(){return this.parent.name}};k(sr,$s,"TagAttrNode",0);var kt=sr,Ss=Symbol(),ir=class ir extends E{get propertyName(){return this.parent.propertyName}get tagName(){return this.parent.tagName}};k(ir,Ss,"TagAttrValueNode",0);var wt=ir,Ts=Symbol(),or=class or extends pt{get ownerTag(){return this.start.prev.pops}get ownerTags(){let e=[this.ownerTag],t;for(;t=e[0].parentTag;)e.unshift(t);return e}};k(or,Ts,"TagContent",0);var vt=or,Cs=Symbol(),ar=class ar extends E{get name(){return this.findChildren("tag.event.name").join("").replace("@","")}};k(ar,Cs,"Listener",0);var $t=ar,Ms=Symbol(),lr=class lr extends E{get name(){return this.findChildren("decorator.name").join("")}get nameToken(){return this.findChildren("decorator.name",!0)[0]}get valueSpan(){let e=this.start.startOffset,[t]=this.findChildren("decorator.modifier.start",!0);return t?{start:e,length:t.offset-e}:this.span}};k(lr,Ms,"Decorator",0);var St=lr,Os=Symbol(),cr=class cr extends E{};k(cr,Os,"ParensNode",0);var Oe=cr,Ls=Symbol(),pr=class pr extends E{static build(e,t,r,n,i){let a=this,o=e.getText(t.offset-1,t.offset);return!o||` [{(|=&-;
	:/*%+-`.indexOf(o)>=0?(n="array",a=Ct):(n="index",a=Mt),new a(e,t,r,n,i)}};k(pr,Ls,"BracketsNode",0);var le=pr,Is=Symbol(),hr=class hr extends E{};k(hr,Is,"BracesNode",0);var de=hr,As=Symbol(),fr=class fr extends de{};k(fr,As,"SpecifiersNode",0);var Tt=fr,Es=Symbol(),ur=class ur extends le{get delimiters(){return this.children.filter(function(e){return e.match("delimiter")})}indexOfNode(e){var t;let r=this.delimiters,n=0;t=0;for(let i of M(r)){let a=t++;e.offset>i.offset&&n++}return n}};k(ur,Es,"ArrayNode",0);var Ct=ur,Fs=Symbol(),mr=class mr extends le{};k(mr,Fs,"IndexNode",0);var Mt=mr,xn=Symbol(),dr=class dr extends E{constructor(){super(...arguments),this.prev.datatype=this,G(this,xn)}toString(){return this.value}};k(dr,xn,"TypeAnnotationNode",16);var Ot=dr,zs=Symbol(),gr=class gr extends E{};k(gr,zs,"InterpolatedValueNode",0);var Lt=gr,Vs=Symbol(),yr=class yr extends de{};k(yr,Vs,"ObjectNode",0);var It=yr,Bs=Symbol(),xr=class xr extends E{get isTypeOnly(){return!!this.start.prev.match("keyword.type")}get sourcePath(){let e=this.children.find(function(t){return t.match("path")});return e==null?void 0:e.innerText}get specifiers(){return this.children.find(function(e){return e.match("specifiers")})}get default(){return this.children.find(function(e){return e.match(".default")})}get namespace(){return this.children.find(function(e){return e.match(".ns")})}};k(xr,Bs,"ImportsNode",0);var At=xr,Ps=Symbol(),_r=class _r extends E{};k(_r,Ps,"Assignable",0);var Le=_r,U={rule:ft,style:at,array:le,stylerule:lt,sel:ut,path:_t,value:it,tag:bt,forscope:ct,field:ht,type:Ot,parens:Oe,brackets:le,object:It,braces:de,specifiers:Tt,string:ot,tagattr:kt,imports:At,interpolation:Lt,tagattrvalue:wt,tagcontent:vt,listener:$t,decorator:St,styleinterpolation:xt,styleprop:yt,stylepropkey:mt,stylevalue:gt,_sel_props:dt,args:Oe,assignable:Le};var br=Symbol.for("#ins"),kr=Symbol.for("#del"),_n=Symbol.for("#version"),bn=Symbol.for("#multiline"),kn=Symbol.for("#significant"),wr=Symbol.for("#body"),ee=Symbol.for("#lexed"),Gs=Symbol(),$r=class $r{get node(){return this.scope&&this.scope.start==this?this.scope:this.pops?this.pops:this}get nextNode(){var e;return(e=this.next)==null?void 0:e.node}get prevNode(){var e;return(e=this.prev)==null?void 0:e.node}};k($r,Gs,"Token",1,j);var wn=$r,vn=Symbol(),Ie=class Ie{static tmp(e){return new this("file://temporary.imba","imba",0,e)}static from(e,t,r,n){return new this(e,t,r,n)}constructor(e,t,r,n){this.uri=e,this.languageId=t,this.version=r,this.content=n,this.connection=null,this.lineTokens=[],this.isLegacy=t=="imba1"||e&&e.match(/\.imba1$/),this.head=this.seed=new j(0,"eol","imba"),this.initialState=ae.getInitialState(),this.seed.stack=ae.getInitialState(),this.history=[],this.lexer=ae,this.versionToHistoryMap={},this.versionToHistoryMap[r]=-1,n&&n.match(/^\#[^\n]+imba1/m)&&(this.isLegacy=!0),G(this,vn)}log(...e){return console.log(...e)}get lineCount(){return this.lineOffsets.length}get lineOffsets(){return this._lineOffsets||(this._lineOffsets=He(this.content,!0))}getText(e=null,t=null){if(typeof e=="number")return this.content.substring(e,t==null?this.content.length:t);if(e&&typeof e.start=="number")return this.content.substring(e.start,e.start+e.length);if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this.content.substring(r,n)}return this.content}expandSpanToLines(e){let t=this.positionAt(e.start),r=this.lineOffsets[t.line];return e.length=(e.length||0)+(e.start-r),e.start=r,e}getLineText(e){let t=this.lineOffsets[e],r=this.lineOffsets[e+1];return this.content.substring(t,r).replace(/[\r\n]/g,"")}positionAt(e){if(B(e,X))return e;typeof e=="object"&&(e=e.offset),e=Math.max(Math.min(e,this.content.length),0);let t=this.lineOffsets,r=0,n=t.length;if(n===0)return new X(0,e,e,this.version);for(;r<n;){let a=Math.floor((r+n)/2);t[a]>e?n=a:r=a+1}let i=r-1;return new X(i,e-t[i],e,this.version)}offsetAt(e){if(e.offset)return e.offset;let t=this.lineOffsets;if(e.line>=t.length)return this.content.length;if(e.line<0)return 0;let r=t[e.line],n=e.line+1<t.length?t[e.line+1]:this.content.length;return e.offset=Math.max(Math.min(r+e.character,n),r)}rangeAt(e,t=e){return new K(this.positionAt(e),this.positionAt(t))}overwrite(e,t){return this.version=t||this.version+1,this.content=e,this._lineOffsets=null,this.invalidateFromLine(0),this}update(e,t){t==null&&(t=this.version+1);let r=[],n=!1;r[br]="",r[kr]="";for(let o=0,p=M(e),c=p.length;o<c;o++){let l=p[o];if(Hr(l)){this.overwrite(l.text,t),r.push([0,this.content.length,l.text]),n=!0;continue}let h=Gr(l.range),f=this.offsetAt(h.start),u=this.offsetAt(h.end);l.range=h,l.offset=f,l.length=u-f,h.start.offset=f,h.end.offset=u;let $=u-f?this.content.slice(f,u):"";r[kr]+=$,r[br]+=l.text||"",this.applyEdit(l,t,e),r.push([f,u-f,l.text||"",$]);let I=Math.max(h.start.line,0),_=Math.max(h.end.line,0),m=this.lineOffsets,y=He(l.text,!1,f);if(_-I===y.length)for(let w=0,d=M(y),C=d.length;w<C;w++){let O=d[w];m[w+I+1]=y[o]}else y.length<1e4?m.splice.apply(m,[I+1,_-I].concat(y)):this._lineOffsets=m=m.slice(0,I+1).concat(y,m.slice(_+1));let b=l.text.length-(u-f);if(b!==0){let w=I+1+y.length;for(;w<m.length;)m[w]=m[w]+b,w++}}this.history.push(r),r[_n]=t;let i=this.history[this.history.length-2];return(r[br]+r[kr]).indexOf(`
`)>=0&&(r[bn]=!0,i&&!i[bn]&&(r[kn]=!0,r[wr]=this.content)),this.versionToHistoryMap[t]=this.history.length-1,this.updated(e,t)}get lastSignificantVersion(){let e=this.history.length;for(;e>0;){let t=this.history[--e];if(t&&t[kn])return t[_n]}return null}editsSinceVersion(e){let t=this.versionToHistoryMap[e],r=[];for(let n=0,i=M(this.history.slice(t+1)),a=i.length;n<a;n++){let o=i[n];r.push(...o)}return r}contentAtVersion(e){let t=this.versionToHistoryMap[e],r=this.history[t];return r[wr]!=null?r[wr]:null}offsetAtVersion(e,t,r=this.version,n=!1){let i=this.versionToHistoryMap[t],a=this.versionToHistoryMap[r],o=e,p=!1;if(i<a)for(;i<a;){let c=this.history[++i];for(let l=0,h=M(c),f=h.length;l<f;l++){let[u,v,$]=h[l];u>o||(n&&(u-=1),o>u&&o>u+v&&(o+=$.length-v))}}else if(a<i)for(;a<i;){let c=this.history[i--];for(let l=0,h=M(c),f=h.length;l<f;l++){let[u,v,$]=h[l];u>o||o>u&&o>u+v&&(o-=$.length-v)}}return o}historicalOffset(e,t){return this.offsetAtVersion(e,this.version,t,!0)}applyEdit(e,t,r){this.content=this.content.substring(0,e.range.start.offset)+e.text+this.content.substring(e.range.end.offset,this.content.length);let n=e.range.start.line;this.invalidateFromLine(n)}updated(e,t){return this.version=t,this}invalidateFromLine(e){return this.head=this.seed,this}after(e,t){let r=this.tokens.indexOf(e);if(t){for(;r<this.tokens.length;){let n=this.tokens[++r];if(n&&this.matchToken(n,t))return n}return null}return this.tokens[r+1]}matchToken(e,t){return B(t,RegExp)?e.type.match(t):typeof t=="string"?e.type==t:!1}before(e,t,r=0){let n=this.tokens.indexOf(e)+r;if(t){for(;n>0;){let i=this.tokens[--n];if(this.matchToken(i,t))return i}return null}return this.tokens[n-1]}getTokenRange(e){return{start:this.positionAt(e.offset),end:this.positionAt(e.offset+e.value.length)}}getTokensInScope(e){let t=this.tokens.indexOf(e.start),r=e.end?this.tokens.indexOf(e.end):this.tokens.length,n=t,i=[];for(;n<r;){let a=this.tokens[n++];a.scope&&a.scope!=e?(i.push(a.scope),n=a.scope.endIndex+1):i.push(a)}return i}getSymbols(){var e;return this.astify(),(e=this[ee]).symbols||(e.symbols=this.tokens.map(function(t){return t.symbol}).filter(function(t){return t}).filter(function(t,r,n){return n.indexOf(t)==r}))}getImportedSymbols(){return this.getSymbols().filter(function(e){return e.importedΦ})}getImportNodes(){return this.tokens.filter(function(t){return t.match("push._imports")}).map(function(t){return t.scope})}getNodesInScope(e,t=!1){let r=e.start,n=e.end;t?n=n.next:r=r.next;let i=[];for(;r&&r!=n;){if(r.scope&&r.scope!=e){i.push(r.scope),r=r.scope.end.next;continue}else r.type!="white"&&i.push(r);r=r.next}return i}getTokenAtOffset(e,t=!1){return this.tokenAtOffset(e)}getSemanticTokens(e=g.Scoped){let t=this.parse(),r=[];for(let n=0,i=M(t),a=i.length;n<a;n++){let o=i[n],p=o.symbol;if(!(p&&(!e||p.flags&e)))continue;let c=fe[p.semanticKind],l=o.mods|p.semanticFlags;r.push([o.offset,o.value.length,c,l])}return r}getEncodedSemanticTokens(){let e=this.getSemanticTokens(),t=[],r=0,n=0;for(let i=0,a=M(e),o=a.length;i<o;i++){let p=a[i],c=this.positionAt(p[0]),l=c.line-r,h=l?c.character:c.character-n;t.push(l,h,p[1],p[2],p[3]),r=c.line,n=c.character}return t}getDestructuredPath(e,t=[],r=null){if(e.context.type=="array")return this.getDestructuredPath(e.context.start,t,r),t.push(e.context.indexOfNode(e)),t;let n=e.value;return e.prev.match("operator.assign.key-value")&&(n=e.prev.prev.value),e.context.type=="object"&&(this.getDestructuredPath(e.context.start,t,r),t.push(n)),t}tokenAtOffset(e){let t=this.tokens[0];for(;t;){let r=t.next;if(t.offset>=e)return t.prev;if(t.end&&t.end.offset<e)t=t.end;else if(r)t=r;else return t}return t}patternAtOffset(e,t=/[\w\-\.\%]/){let r=e,n=e,i=this.content;for(;r>0&&t.test(this.content[r-1]);)r--;for(;t.test(this.content[n+1]||"");)n++;return[i.slice(r,n+1),r,n]}adjustmentAtOffset(e,t=1){let[r,n,i]=this.patternAtOffset(e),[a,o=""]=r.split(/[\d\.]+/),p=parseFloat(r.slice(a.length).slice(0,o.length?-o.length:1e3));return Number.isNaN(p)?null:(p+=t,[n+a.length,r.length-a.length-o.length,String(p)])}contextAtOffset(e){var t;this.ensureParsed();let r=this.positionAt(e),n=this.tokenAtOffset(e),i=this.lineOffsets[r.line],a=e-n.offset,o=n.context,p={character:this.content[e-1],line:this.content.slice(i,e),token:n.value.slice(0,a)},c={character:this.content[e],token:n.value.slice(a),line:this.content.slice(e,this.lineOffsets[r.line+1]).replace(/[\r\n]+/,"")};n.scope&&!c.token&&(o=n.scope),n.next&&n.next.value==null&&n.next.scope&&!c.token&&n.match("operator.assign")&&(o=n.next.scope);let l=se(n,"white.tabs"),h=l?l.value.length:0,f=o,u=o.scope,v={},$=n,I=n.stack.state||"",_=N;f&&(f.start&&(p.group=this.content.slice(f.start.offset,e)),f.end&&(c.group=this.content.slice(e,f.end.offset)));let m={keywords:[]},y=0;if(n==l&&(h=a),n.match("br white.tabs"))for(;u.indent>h;)u=u.parent;if(f.type=="tag",n.match("entity string regexp comment style.")&&(y=0),n.match("tag.event.name tag.event-modifier.name")&&($=n.prev),(n.type=="path"||n.type=="path.open")&&(y|=N.Path,m.paths=1),n.match("identifier tag.operator.equals br white delimiter array operator ( self")&&(y|=N.Value,$=null),n.match("operator.access")&&(y|=N.Access,$=n),n.match("accessor")&&(y|=N.Access,$=n.prev),n.match("delimiter.type.prefix type")&&(y|=N.Type),n.match("tag.name tag.open")?y|=N.TagName:n.match("tag.attr tag.white")?y|=N.TagProp:n.match("tag.flag")?y|=N.TagFlag:n.match("tag.event.modifier")?y|=N.TagEventModifier:n.match("tag.event")?y|=N.TagEvent:n.match("operator.equals.tagop")&&(y|=N.Value),n.match("style.property.operator")||f.closest("stylevalue")){y|=_.StyleValue;try{m.styleProperty=f.closest("styleprop").propertyName}catch{}}n.match("style.open style.property.name")&&(y|=_.StyleProp),(n.match("style.value.white")||n.prev&&n.prev.match("style.value.white"))&&(y|=_.StyleProp),n.match("style.selector.element")&&c.line.match(/^\s*$/)&&(y|=_.StyleProp),u.closest("rule")&&(y|=_.StyleProp,y&=~_.Value),n.match("style.property.operator")&&(y&=~_.StyleProp),f.match("stylevalue")&&p.group.indexOf(" ")==-1&&(y=_.StyleValue),n.match("style.selector.modifier style.property.modifier")&&(y=_.StyleModifier),n.match("style.selector.element")&&(y|=_.StyleSelector),u.closest("rule")&&p.line.match(/^\s*$/)&&(y|=_.StyleSelector,y&=~_.StyleValue),n.match("operator.access accessor white.classname white.tagname")&&(y&=~_.Value),f.closest("imports")&&(y&=~_.Value,y|=_.ImportName),(I.match(/\.decl-(let|var|const|param|for)/)||n.match(/\.decl-(for|let|var|const|param)/))&&(y&=~_.Value,y|=_.VarName);let b=u.allowedKeywordTypes;t=[];for(let d=0,C=Object.keys(Ce),O=C.length,S,T;d<O;d++)S=C[d],T=Ce[S],T&b&&t.push(S);m.keywords=t,m.flags=y;for(let d=0,C=Object.keys(_),O=C.length,S,T;d<O;d++)S=C[d],T=_[S],y&T&&(m[S]||(m[S]=!0));return{token:n,offset:e,position:r,linePos:i,scope:u,indent:h,group:o,mode:"",target:$,path:u.path,suggest:m,before:p,after:c}}textBefore(e){let t=this.content.slice(0,e),r=t.lastIndexOf(`
`);return t.slice(r+1)}varsAtOffset(e,t=!1){let r=this.tokenAtOffset(e),n=[],i=r.context.scope,a={};for(;i;){for(let o=0,p=M(Object.values(i.varmap)),c=p.length;o<c;o++){let l=p[o];l.globalΦ&&!t||a[l.name]||(!l.node||l.node.offset<e)&&(n.push(l),a[l.name]=l)}i=i.parent}return n}getOutline(e=null){var t,r,n,i;if(this.isLegacy){let _=Rr(this.content);for(let m=0,y=M(_.all),b=y.length;m<b;m++){let w=y[m];t=w.parent,delete w.parent,w.path=w.name,w.name=w.ownName,e&&e(w,_.all)}return _}this.ensureParsed();let a=Date.now(),o=[],p={children:[]},c=p,l=null,h={},f=new Set,u=null;function v(_,m){return B(_,D)&&(f.add(_),_={name:_.name,kind:_.kind}),h=_,_.token=m,_.children||(_.children=[]),_.span||(_.span=m.span),_.name||(_.name=m.value),o.push(_),c.children.push(_)}function $(_){return h.children||(h.children=[]),h.parent||(h.parent=c),c=h,c.end=_}function I(_){return c=c.parent}for(let _=0,m=M(this.tokens),y=m.length;_<y;_++){let b=m[_],w=b.symbol,d=b.scope;if(b.type=="key")v({kind:P.Key},b);else if(w){if(w.parameterΦ)continue;f.has(w)||v(w,b),w.body&&(u=w.body.start)}else if(d&&d.type=="do"){let C=this.textBefore(b.offset-3).replace(/^\s*(return\s*)?/,"");C+=" callback",v({kind:P.Function,name:C},b.prev),u=b}else d&&d.type=="tag"&&v({kind:P.Field,name:d.outline},b);b==u&&$(b.end),b==c.end&&I()}for(let _=0,m=M(o),y=m.length;_<y;_++){let b=m[_];if(b.span){let w=b.span.length;b.span.start=this.positionAt(b.span.offset),b.span.end=w?this.positionAt(b.span.offset+w):b.span.start}e&&e(b,o),r=b.parent,delete b.parent,n=b.end,delete b.end,i=b.token,delete b.token}return p}getContextAtOffset(e,t=!1){return this.contextAtOffset(e)}ensureParsed(){return this.parse(),this}reparse(){return this.invalidateFromLine(0),this.parse()}profileReparse(){let e=Date.now(),t=this.reparse();return console.log("took",Date.now()-e),t}tokenize(e=!1){var h;let t=this[ee]||{lines:[],version:-1};if(t.version==this.version&&!e)return t;let r=this.content;this.isLegacy&&(r=r.replace(/\@\w/g,function(f){return"¶"+f.slice(1)}),r=r.replace(/\w\:(?=\w)/g,function(f){return f[0]+"."}),r=r.replace(/(do)(\s?)\|([^\|]*)\|/g,function(f,u,v,$){return u+"("+(v||"")+$+")"}));let n=this.lineOffsets,i=[],o=this.seed,p=Date.now(),c=this.initialState;this[ee]={version:this.version,lines:[],tokens:i};let l={};this[ee].cache=l;for(let f=0,u=M(t.lines),v=u.length;f<v;f++){let $=u[f];(l[h=$.text]||(l[h]=[])).push($)}for(let f=0,u=M(n),v=u.length;f<v;f++){let $=u[f],_=n[f+1]||r.length,m=r.slice($,_),y=c,b=l[m],w=b&&b.filter(function(O){return O.startState==y}),d=w&&(w.find(function(O){return O.offset==$})||w[0]),C=null;if(d&&(d.offset==$,C=d.clone($)),!C){let O=ae.tokenize(m,y,$);C=new $e({offset:$,text:m,startState:y,endState:O.endState,tokens:O.tokens})}for(let O=0,S=M(C.tokens),T=S.length;O<T;O++){let H=S[O];i.push(H)}this[ee].lines.push(C),c=C.endState}return this[ee]}get tokens(){return this.astify(),this[ee].tokens}getTokens(e=null){return this.tokens}astify(){let e=this.tokenize();if(e.root)return this;let t={"]":"[",")":"(","}":"{",">":"<"},r={"[":"]","(":")","{":"}","<":">"},n=/[\w\$\)\]\?]/,i=Date.now(),a=null,o=e.root=new Q(this,this.seed,null,"root"),p=this.content,c=console.log.bind(console),l=null,h=null,f=null,u=null,v=0;for(let $=0,I=M(e.tokens),_=I.length;$<_;$++){let m=I[$],y=m.type.split("."),b=m.value,w=e.tokens[$+1],[d,C,O]=y,S=y[y.length-1],T=y[y.length-2],H=null,Ae=0;if(d=="ivar"&&(b=m.value="@"+b.slice(1)),u&&(u.next=m),m.prev=u,m.context=o,d=="("&&u){let z=p[m.offset-1]||"";n.test(z)&&(o=m.scope=U.args.build(this,m,o,"args",y))}if(d=="operator"&&(m.op=m.value.trim()),d=="keyword"&&(F[C]&&(v|=F[C]),(b=="let"||b=="const")&&(h=m,f=null)),d=="entity"&&(m.mods|=v,v=0),d=="push"){let z=C,Z=C.lastIndexOf("_"),Ee=Z>=0?E:R;Z>=0?(z=z.slice(Z+1),Ee=U[z]||E):U[z]&&(Ee=U[z]),o=m.scope=new Ee(this,m,o,z,y),l&&(l.body=o,o.symbol=l,l=null),o==o.scope&&(h=null,f=null)}else d=="pop"?(C=="value"&&(f=null),o=o.pop(m)):(C=="open"||r[C])&&U[d]?o=m.scope=U[d].build(this,m,o,d,y):S=="open"&&(H=U[T])?o=m.scope=H.build(this,m,o,T,y):(S=="close"&&o.type==T||C=="close"&&U[d]||t[d]&&o&&o.start.value==t[d])&&(o=o.pop(m));if(m.match(/entity\.name|decl-/)){let z=D.forToken(m,m.type,m.mods);z&&(l=m.symbol=z,m.symbol.keyword=h,o.register(m.symbol)),m.mods|=F.Declaration}if(C=="declval"&&(f=m),m.match("identifier")&&!m.symbol){let z=o.lookup(m,h);if(z&&z.scopedΦ&&(f&&z.keyword==h||z.addReference(m)),u&&u.op=="="&&z){let Z=u.prev;Z&&Z.symbol==z&&(Z.mods&F.Declaration?z.dereference(m):(!w||w.match("br"))&&z.dereference(Z))}}u=m}return this}parse(){return this.tokens}getMatchingTokens(e){let t=this.getTokens();return t=t.slice(0).filter(function(r){return r.match(e)}),t}migrateToImba2(){let e=this.content;e=e.replace(/\bdef self\./g,"static def "),e=e.replace(/\b(var|let|const) def /g,"def "),e=e.replace(/\?\./g,".."),e=e.replace(/def ([\w\-]+)\=/g,"set $1"),e=e.replace(/do\s?\|([^\|]+)\|/g,"do($1)"),e=e.replace(/(prop) ([\w\-]+) (.+)$/gm,function(i,a,o,p){var c,l;let h={};p.split(/,\s*/).map(function(u){return u.split(/\:\s*/)}).map(function(u){return h[u[0]]=u[1]});let f=""+a+" "+o;return h.watch&&h.watch[0].match(/[\'\"\:]/)?f="@watch("+h.watch+") "+f:h.watch&&(f="@watch "+f),c=h.watch,delete h.watch,h.default&&(f=""+f+" = "+h.default,l=h.default,delete h.default),Object.keys(h).length&&console.log("more prop values",i,h),f});let r=Ie.tmp(e).getTokens(),n="";for(let i=0,a=M(r),o=a.length;i<o;i++){let p=a[i],c=r[i+1],{value:l,type:h,offset:f}=p,u=f+l.length;h=="operator.dot.legacy"&&(l=".",c&&(c.access=!0)),h=="operator.spread.legacy"&&(l="..."),h=="identifier.tagname"&&l.indexOf(":")>=0&&(l=l.replace(":","-")),h=="identifier.def.propname"&&l=="initialize"&&(l="constructor"),h=="decorator"&&!e.slice(u).match(/^\s(prop|def|get|set)/)&&(l=n+l.slice(1)),h=="property"&&(l[0]=="@"?(l=l.replace(/^\@/,n),p.access=!0):l=="len"?l="length":/^(\n|\s\:|\)|\,|\.)/.test(e.slice(u))&&!p.access&&l[0]==l[0].toLowerCase()&&(l=l+"!")),h=="identifier"&&!p.access&&l[0]==l[0].toLowerCase()&&l[0]!="_"&&!p.variable&&/^(\n|\s\:|\)|\,|\.)/.test(e.slice(u))&&l!="new"&&(l=l+"!"),p.value=l}return r.map(function(i){return i.value}).join("")}createImportEdit(e,t,r=t){e=e.replace(/\.imba$/,"");let n=this.getImportNodes().filter(function(c){return c.sourcePath==e}),i="",a=0,o=[],p={changes:o};if(this.getImportedSymbols().map(function(h){return h.importInfo}).find(function(h){return h.path==e&&h.name==r&&h.exportName==t}))return p;t!="default"&&t!="*"&&(n=n.filter(function(c){return c.specifiers||!c.ns}));for(let c=0,l=M(n),h=l.length;c<h;c++){let f=l[c],u=f.default,v=f.specifiers,$=f.namespace;if(t=="default")if(a=f.start.offset+1,u){if(u.value==r)return p;p.alias=u.value,a=0;continue}else i=r,($||v)&&(i+=", ");else if(t=="*"){if(v)continue;u?(a=u.endOffset,i=", * as "+r):(a=f.start.offset+1,i="* as "+r+" ")}else if($){p.alias=""+$.value+"."+t;continue}else{let I=t;r!=t&&(I+=" as "+r),v?(a=v.start.offset+1,i=" "+I+","):u?(a=u.endOffset,i=", { "+I+" }"):(i="{ "+I+" }",a=f.start.offset+1)}if(i)break}return i||(t=="default"?i="import "+r+" from '"+e+"'":t=="*"?i="import * as "+r+" from '"+e+"'":r!=t?i="import { "+t+" as "+r+" } from '"+e+"'":i="import { "+t+" } from '"+e+"'",i+=`
`),o.push({newText:i,range:this.rangeAt(a,a)}),p}};k(Ie,vn,"ImbaDocument",16);var vr=Ie;var $n={defaultToken:"",tokenPostfix:".xml",ignoreCase:!0,qualifiedName:/(?:[\w\.\-]+:)?[\w\.\-]+/,tokenizer:{root:[[/[^<&]+/,""],{include:"@whitespace"},[/(<)(@qualifiedName)/,[{token:"delimiter"},{token:"tag",next:"@tag"}]],[/(<\/)(@qualifiedName)(\s*)(>)/,[{token:"delimiter"},{token:"tag"},"",{token:"delimiter"}]],[/(<\?)(@qualifiedName)/,[{token:"delimiter"},{token:"metatag",next:"@tag"}]],[/(<\!)(@qualifiedName)/,[{token:"delimiter"},{token:"metatag",next:"@tag"}]],[/<\!\[CDATA\[/,{token:"delimiter.cdata",next:"@cdata"}],[/&\w+;/,"string.escape"]],cdata:[[/[^\]]+/,""],[/\]\]>/,{token:"delimiter.cdata",next:"@pop"}],[/\]/,""]],tag:[[/[ \t\r\n]+/,""],[/(@qualifiedName)(\s*=\s*)("[^"]*"|'[^']*')/,["attribute.name","","attribute.value"]],[/(@qualifiedName)(\s*=\s*)("[^">?\/]*|'[^'>?\/]*)(?=[\?\/]\>)/,["attribute.name","","attribute.value"]],[/(@qualifiedName)(\s*=\s*)("[^">]*|'[^'>]*)/,["attribute.name","","attribute.value"]],[/@qualifiedName/,"attribute.name"],[/\?>/,{token:"delimiter",next:"@pop"}],[/(\/)(>)/,[{token:"tag"},{token:"delimiter",next:"@pop"}]],[/>/,{token:"delimiter",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[/<!--/,{token:"comment",next:"@comment"}]],comment:[[/[^<\-]+/,"comment.content"],[/-->/,{token:"comment",next:"@pop"}],[/<!--/,"comment.content.invalid"],[/[<\-]/,"comment.content"]]}};var Sr={},Hs=Symbol(),Cr=class Cr{static getTokenizer(e){return e=="xml"&&!Sr[e]?this.createTokenizer("xml",$n):Sr[e]}static createTokenizer(e,t){let r=ke(e,t);return Sr[e]=new oe(e,r)}};k(Cr,Hs,"Monarch",0);var Tr=Cr;var Rs={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ns={"[":"square open","]":"square close","{":"curly open","}":"curly close","(":"paren open",")":"paren close"};function Sn(s){return s.replace(/[\&\<\>]/g,function(e){return Rs[e]})}function js(s){return s.join(" ").replace(/[\[\]\{\}\(\)]/g,function(e){return Ns[e]})}function Ds(s,{verbose:e=!1}){let t=[],r=0,n=0,i=[];for(let a=0,o=M(s),p=o.length;a<p;a++){let c=o[a],l=c.value,h=c.type.split("."),[f,u]=h,v=c.mods;if(c.var){let $=i.indexOf(c.var);$==-1&&($=i.push(c.var)-1),h.push("vref"),h.push("var"+$),h.push(c.var.type+"-ref"),v|=c.var.mods}if(v&F.Declaration&&h.push("decl"),v&F.Root&&h.push("root"),v&F.Local&&h.push("local"),c.end&&c.end.start==c&&t.push("<b>"),!((u=="start"||u=="open")&&(t.push("<b class='"+f+"'>"),!l))){if((u=="end"||u=="close")&&!l){t.push("</b>");continue}if(f=="push"){l=String(++r);let $=u.indexOf("_")>=0?"group":"scope",I=c.scope&&c.scope.end;t.push("<div class='"+$+"-"+u.split("_").pop()+" _"+u+" l"+r+" o"+c.offset+" e"+(I&&I.offset)+"'>");continue}else if(f=="pop"){l=String(--r),t.push("</div>");continue}f!="white"&&f!="line"?l="<i class='"+js(h)+" o"+c.offset+"'>"+Sn(l||"")+"</i>":f=="white"&&l!=`
`&&(l="<i raw='"+JSON.stringify(l)+"'>"+Sn(l||"")+"</i>"),t.push(l),(u=="end"||u=="close"||c.start)&&t.push("</b>")}}return t.join("")}export{N as CompletionTypes,E as Group,vr as ImbaDocument,x as KeywordTypes,Ce as Keywords,F as M,Tr as Monarch,me as Node,X as Position,K as Range,R as Scope,Qn as SemanticTokenModifiers,fe as SemanticTokenTypes,D as Sym,g as SymbolFlags,P as SymbolKind,j as Token,Ke as grammar,Ds as highlight,ae as lexer};