likec4 1.20.3 → 1.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1855 @@
1
+ import*as SD from"node:fs";import{writeFileSync as TD,statSync as _1,readFileSync as qm,appendFileSync as P1,createWriteStream as kD,createReadStream as CD,existsSync as x1}from"node:fs";import Wr,{sep as AD,resolve as I1,basename as N1}from"node:path";import{fileURLToPath as Gm,pathToFileURL as O1}from"node:url";import{isatty as F1}from"tty";import L1,{formatWithOptions as _D,debuglog as M1,stripVTControlCharacters as z1,inspect as Wd,promisify as B1,callbackify as Da,aborted as q1}from"node:util";import G1 from"util";import $r from"path";import j1 from"os";import U1 from"crypto";import W1 from"net";import H1 from"url";import Ea from"fs";import PD from"child_process";import{nonexhaustive as Ae,invariant as _e,defaultTheme as jt,DefaultRelationshipColor as Co,hierarchyDistance as V1,DefaultThemeColor as Ra,nameFromFqn as Hd,nonNullable as pn,isThemeColor as xD,compareFqnHierarchically as K1,DefaultArrowType as ls,ComputedNode as Vd,extractStep as Y1,ComputedView as Ao,delay as X1,DefaultLineStyle as J1,LinkedList as jm,AsFqn as Q1,stringHash as Z1,parentFqn as Kd,compareNatural as ID,LikeC4Model as ND,isScopedElementView as eN,computeColorValues as tN,sortByFqnHierarchically as OD,compareRelations as nN,DeploymentElement as rN,FqnRef as _o,isSameHierarchy as FD,isAncestor as Um,FqnExpr as Po,isNonEmptyArray as Un,isAutoLayoutDirection as iN,isOrOperator as LD,isAndOperator as MD,hasAtLeast as sN}from"@likec4/core";import ot,{cwd as aN,platform as oN,hrtime as Yd,execPath as uN,execArgv as cN}from"node:process";import*as Wm from"node:tty";import zD from"node:tty";import{ComputedNode as BD,DefaultPaddingSize as lN,DefaultShapeSize as dN,DefaultTextSize as fN}from"@likec4/core/types";import{EventEmitter as pN}from"events";import{Buffer as Hm}from"buffer";import{Graphviz as Vm}from"@hpcc-js/wasm-graphviz";import{resolveRulesExtendedViews as hN}from"@likec4/core/compute-view";import{createLogger as mN}from"vite";import{ChildProcess as qD,spawnSync as gN,spawn as yN}from"node:child_process";import{StringDecoder as GD}from"node:string_decoder";import{setTimeout as jD,scheduler as UD,setImmediate as wN}from"node:timers/promises";import{constants as ds,cpus as vN}from"node:os";import{once as Sn,addAbortListener as WD,EventEmitter as bN,on as Xd,setMaxListeners as DN}from"node:events";import{serialize as EN}from"node:v8";import{Transform as RN,getDefaultHighWaterMark as Jd,Duplex as Km,Writable as Ym,Readable as fs,PassThrough as HD}from"node:stream";import{Buffer as Xm}from"node:buffer";import{finished as $i}from"node:stream/promises";import{LikeC4Model as VD}from"@likec4/core/model";function Jm(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function Qm(t,e,n=".",r){if(!Jm(e))return Qm(t,{},n,r);const i=Object.assign({},e);for(const s in t){if(s==="__proto__"||s==="constructor")continue;const a=t[s];a!=null&&(r&&r(i,s,a,n)||(Array.isArray(a)&&Array.isArray(i[s])?i[s]=[...a,...i[s]]:Jm(a)&&Jm(i[s])?i[s]=Qm(a,i[s],(n?`${n}.`:"")+s.toString(),r):i[s]=a))}return i}function $N(t){return(...e)=>e.reduce((n,r)=>Qm(n,r,"",t),{})}const Zm=$N();function $t(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function Wn(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"}function SN(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function Qd(t){return typeof t=="object"&&t!==null&&$t(t.container)&&Wn(t.reference)&&typeof t.message=="string"}class KD{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,n){return $t(e)&&this.isSubtype(e.$type,n)}isSubtype(e,n){if(e===n)return!0;let r=this.subtypes[e];r||(r=this.subtypes[e]={});const i=r[n];if(i!==void 0)return i;{const s=this.computeIsSubtype(e,n);return r[n]=s,s}}getAllSubTypes(e){const n=this.allSubtypes[e];if(n)return n;{const r=this.getAllTypes(),i=[];for(const s of r)this.isSubtype(s,e)&&i.push(s);return this.allSubtypes[e]=i,i}}}function Si(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function ps(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function YD(t){return Si(t)&&typeof t.fullText=="string"}class Ot{constructor(e,n){this.startFn=e,this.nextFn=n}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let n=0,r=e.next();for(;!r.done;)n++,r=e.next();return n}toArray(){const e=[],n=this.iterator();let r;do r=n.next(),r.value!==void 0&&e.push(r.value);while(!r.done);return e}toSet(){return new Set(this)}toMap(e,n){const r=this.map(i=>[e?e(i):i,n?n(i):i]);return new Map(r)}toString(){return this.join()}concat(e){return new Ot(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),n=>{let r;if(!n.firstDone){do if(r=this.nextFn(n.first),!r.done)return r;while(!r.done);n.firstDone=!0}do if(r=n.iterator.next(),!r.done)return r;while(!r.done);return tn})}join(e=","){const n=this.iterator();let r="",i,s=!1;do i=n.next(),i.done||(s&&(r+=e),r+=TN(i.value)),s=!0;while(!i.done);return r}indexOf(e,n=0){const r=this.iterator();let i=0,s=r.next();for(;!s.done;){if(i>=n&&s.value===e)return i;s=r.next(),i++}return-1}every(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(!e(r.value))return!1;r=n.next()}return!0}some(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return!0;r=n.next()}return!1}forEach(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;)e(i.value,r),i=n.next(),r++}map(e){return new Ot(this.startFn,n=>{const{done:r,value:i}=this.nextFn(n);return r?tn:{done:!1,value:e(i)}})}filter(e){return new Ot(this.startFn,n=>{let r;do if(r=this.nextFn(n),!r.done&&e(r.value))return r;while(!r.done);return tn})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,n){const r=this.iterator();let i=n,s=r.next();for(;!s.done;)i===void 0?i=s.value:i=e(i,s.value),s=r.next();return i}reduceRight(e,n){return this.recursiveReduce(this.iterator(),e,n)}recursiveReduce(e,n,r){const i=e.next();if(i.done)return r;const s=this.recursiveReduce(e,n,r);return s===void 0?i.value:n(s,i.value)}find(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return r.value;r=n.next()}}findIndex(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;){if(e(i.value))return r;i=n.next(),r++}return-1}includes(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(r.value===e)return!0;r=n.next()}return!1}flatMap(e){return new Ot(()=>({this:this.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:r,value:i}=this.nextFn(n.this);if(!r){const s=e(i);if(Zd(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(n.iterator);return tn})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const n=e>1?this.flat(e-1):this;return new Ot(()=>({this:n.startFn()}),r=>{do{if(r.iterator){const a=r.iterator.next();if(a.done)r.iterator=void 0;else return a}const{done:i,value:s}=n.nextFn(r.this);if(!i)if(Zd(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(r.iterator);return tn})}head(){const n=this.iterator().next();if(!n.done)return n.value}tail(e=1){return new Ot(()=>{const n=this.startFn();for(let r=0;r<e;r++)if(this.nextFn(n).done)return n;return n},this.nextFn)}limit(e){return new Ot(()=>({size:0,state:this.startFn()}),n=>(n.size++,n.size>e?tn:this.nextFn(n.state)))}distinct(e){return new Ot(()=>({set:new Set,internalState:this.startFn()}),n=>{let r;do if(r=this.nextFn(n.internalState),!r.done){const i=e?e(r.value):r.value;if(!n.set.has(i))return n.set.add(i),r}while(!r.done);return tn})}exclude(e,n){const r=new Set;for(const i of e){const s=n?n(i):i;r.add(s)}return this.filter(i=>{const s=n?n(i):i;return!r.has(s)})}}function TN(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Zd(t){return!!t&&typeof t[Symbol.iterator]=="function"}const $a=new Ot(()=>{},()=>tn),tn=Object.freeze({done:!0,value:void 0});function rt(...t){if(t.length===1){const e=t[0];if(e instanceof Ot)return e;if(Zd(e))return new Ot(()=>e[Symbol.iterator](),n=>n.next());if(typeof e.length=="number")return new Ot(()=>({index:0}),n=>n.index<e.length?{done:!1,value:e[n.index++]}:tn)}return t.length>1?new Ot(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const n=e.iterator.next();if(!n.done)return n;e.iterator=void 0}if(e.array){if(e.arrIndex<e.array.length)return{done:!1,value:e.array[e.arrIndex++]};e.array=void 0,e.arrIndex=0}if(e.collIndex<t.length){const n=t[e.collIndex++];Zd(n)?e.iterator=n[Symbol.iterator]():n&&typeof n.length=="number"&&(e.array=n)}}while(e.iterator||e.array||e.collIndex<t.length);return tn}):$a}class Sa extends Ot{constructor(e,n,r){super(()=>({iterators:r?.includeRoot?[[e][Symbol.iterator]()]:[n(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const a=i.iterators[i.iterators.length-1].next();if(a.done)i.iterators.pop();else return i.iterators.push(n(a.value)[Symbol.iterator]()),a}return tn})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var eg;(function(t){function e(s){return s.reduce((a,o)=>a+o,0)}t.sum=e;function n(s){return s.reduce((a,o)=>a*o,0)}t.product=n;function r(s){return s.reduce((a,o)=>Math.min(a,o))}t.min=r;function i(s){return s.reduce((a,o)=>Math.max(a,o))}t.max=i})(eg||(eg={}));function xo(t){return new Sa(t,e=>Si(e)?e.content:[],{includeRoot:!0})}function XD(t){return xo(t).filter(ps)}function JD(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function ef(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function Io(t){if(!t)return;const{offset:e,end:n,range:r}=t;return{range:r,offset:e,end:n,length:n-e}}var Sr;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(Sr||(Sr={}));function QD(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return Sr.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return Sr.After;const n=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,r=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return n&&r?Sr.Inside:n?Sr.OverlapBack:r?Sr.OverlapFront:Sr.Outside}function tg(t,e){return QD(t,e)>Sr.After}const ng=/^[\w\p{L}]$/u;function Ti(t,e,n=ng){if(t){if(e>0){const r=e-t.offset,i=t.text.charAt(r);n.test(i)||e--}return ig(t,e)}}function tf(t,e){if(t){const n=eE(t,!0);if(n&&rg(n,e))return n;if(YD(t)){const r=t.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){const s=t.content[i];if(rg(s,e))return s}}}}function rg(t,e){return ps(t)&&e.includes(t.tokenType.name)}function ig(t,e){if(ps(t))return t;if(Si(t)){const n=ZD(t,e,!1);if(n)return ig(n,e)}}function nf(t,e){if(ps(t))return t;if(Si(t)){const n=ZD(t,e,!0);if(n)return nf(n,e)}}function ZD(t,e,n){let r=0,i=t.content.length-1,s;for(;r<=i;){const a=Math.floor((r+i)/2),o=t.content[a];if(o.offset<=e&&o.end>e)return o;o.end<=e?(s=n?o:void 0,r=a+1):i=a-1}return s}function eE(t,e=!0){for(;t.container;){const n=t.container;let r=n.content.indexOf(t);for(;r>0;){r--;const i=n.content[r];if(e||!i.hidden)return i}t=n}}function tE(t,e=!0){for(;t.container;){const n=t.container;let r=n.content.indexOf(t);const i=n.content.length-1;for(;r<i;){r++;const s=n.content[r];if(e||!s.hidden)return s}t=n}}function kN(t){if(t.range.start.character===0)return t;const e=t.range.start.line;let n=t,r;for(;t.container;){const i=t.container,s=r??i.content.indexOf(t);if(s===0?(t=i,r=void 0):(r=s-1,t=i.content[r]),t.range.start.line!==e)break;n=t}return n}function nE(t,e){const n=CN(t,e);return n?n.parent.content.slice(n.a+1,n.b):[]}function CN(t,e){const n=rE(t),r=rE(e);let i;for(let s=0;s<n.length&&s<r.length;s++){const a=n[s],o=r[s];if(a.parent===o.parent)i={parent:a.parent,a:a.index,b:o.index};else break}return i}function rE(t){const e=[];for(;t.container;){const n=t.container,r=n.content.indexOf(t);e.push({parent:n,index:r}),t=n}return e.reverse()}const AN={__proto__:null,DefaultNameRegexp:ng,get RangeComparison(){return Sr},compareRange:QD,findCommentNode:tf,findDeclarationNodeAtOffset:Ti,findLeafNodeAtOffset:ig,findLeafNodeBeforeOffset:nf,flattenCst:XD,getInteriorNodes:nE,getNextNode:tE,getPreviousNode:eE,getStartlineNode:kN,inRange:tg,isChildNode:JD,isCommentNode:rg,streamCst:xo,toDocumentSegment:Io,tokenToRange:ef};class iE extends Error{constructor(e,n){super(e?`${n} at ${e.range.start.line}:${e.range.start.character}`:n)}}function No(t){throw new Error("Error! The input value was not handled.")}const rf="AbstractRule",sf="AbstractType",sg="Condition",sE="TypeDefinition",ag="ValueLiteral",Oo="AbstractElement";function og(t){return He.isInstance(t,Oo)}const af="ArrayLiteral",Fo="ArrayType";function _N(t){return He.isInstance(t,Fo)}const Lo="BooleanLiteral";function PN(t){return He.isInstance(t,Lo)}const Mo="Conjunction";function xN(t){return He.isInstance(t,Mo)}const zo="Disjunction";function IN(t){return He.isInstance(t,zo)}const of="Grammar",ug="GrammarImport",Bo="InferredType";function aE(t){return He.isInstance(t,Bo)}const qo="Interface";function oE(t){return He.isInstance(t,qo)}const cg="NamedArgument",Go="Negation";function NN(t){return He.isInstance(t,Go)}const uf="NumberLiteral",cf="Parameter",jo="ParameterReference";function ON(t){return He.isInstance(t,jo)}const Uo="ParserRule";function nn(t){return He.isInstance(t,Uo)}const Wo="ReferenceType";function FN(t){return He.isInstance(t,Wo)}const lf="ReturnType";function LN(t){return He.isInstance(t,lf)}const Ho="SimpleType";function uE(t){return He.isInstance(t,Ho)}const df="StringLiteral",Ta="TerminalRule";function Hr(t){return He.isInstance(t,Ta)}const Vo="Type";function lg(t){return He.isInstance(t,Vo)}const dg="TypeAttribute",Ko="UnionType";function MN(t){return He.isInstance(t,Ko)}const Yo="Action";function hs(t){return He.isInstance(t,Yo)}const Xo="Alternatives";function fg(t){return He.isInstance(t,Xo)}const Jo="Assignment";function Tr(t){return He.isInstance(t,Jo)}const Qo="CharacterRange";function zN(t){return He.isInstance(t,Qo)}const Zo="CrossReference";function eu(t){return He.isInstance(t,Zo)}const tu="EndOfFile";function BN(t){return He.isInstance(t,tu)}const nu="Group";function ki(t){return He.isInstance(t,nu)}const ru="Keyword";function kr(t){return He.isInstance(t,ru)}const iu="NegatedToken";function qN(t){return He.isInstance(t,iu)}const su="RegexToken";function GN(t){return He.isInstance(t,su)}const au="RuleCall";function Vr(t){return He.isInstance(t,au)}const ou="TerminalAlternatives";function jN(t){return He.isInstance(t,ou)}const uu="TerminalGroup";function UN(t){return He.isInstance(t,uu)}const cu="TerminalRuleCall";function cE(t){return He.isInstance(t,cu)}const lu="UnorderedGroup";function pg(t){return He.isInstance(t,lu)}const du="UntilToken";function WN(t){return He.isInstance(t,du)}const fu="Wildcard";function HN(t){return He.isInstance(t,fu)}class lE extends KD{getAllTypes(){return[Oo,rf,sf,Yo,Xo,af,Fo,Jo,Lo,Qo,sg,Mo,Zo,zo,tu,of,ug,nu,Bo,qo,ru,cg,iu,Go,uf,cf,jo,Uo,Wo,su,lf,au,Ho,df,ou,uu,Ta,cu,Vo,dg,sE,Ko,lu,du,ag,fu]}computeIsSubtype(e,n){switch(e){case Yo:case Xo:case Jo:case Qo:case Zo:case tu:case nu:case ru:case iu:case su:case au:case ou:case uu:case cu:case lu:case du:case fu:return this.isSubtype(Oo,n);case af:case uf:case df:return this.isSubtype(ag,n);case Fo:case Wo:case Ho:case Ko:return this.isSubtype(sE,n);case Lo:return this.isSubtype(sg,n)||this.isSubtype(ag,n);case Mo:case zo:case Go:case jo:return this.isSubtype(sg,n);case Bo:case qo:case Vo:return this.isSubtype(sf,n);case Uo:return this.isSubtype(rf,n)||this.isSubtype(sf,n);case Ta:return this.isSubtype(rf,n);default:return!1}}getReferenceType(e){const n=`${e.container.$type}:${e.property}`;switch(n){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return sf;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return rf;case"Grammar:usedGrammars":return of;case"NamedArgument:parameter":case"ParameterReference:parameter":return cf;case"TerminalRuleCall:rule":return Ta;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case Oo:return{name:Oo,properties:[{name:"cardinality"},{name:"lookahead"}]};case af:return{name:af,properties:[{name:"elements",defaultValue:[]}]};case Fo:return{name:Fo,properties:[{name:"elementType"}]};case Lo:return{name:Lo,properties:[{name:"true",defaultValue:!1}]};case Mo:return{name:Mo,properties:[{name:"left"},{name:"right"}]};case zo:return{name:zo,properties:[{name:"left"},{name:"right"}]};case of:return{name:of,properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case ug:return{name:ug,properties:[{name:"path"}]};case Bo:return{name:Bo,properties:[{name:"name"}]};case qo:return{name:qo,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case cg:return{name:cg,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case Go:return{name:Go,properties:[{name:"value"}]};case uf:return{name:uf,properties:[{name:"value"}]};case cf:return{name:cf,properties:[{name:"name"}]};case jo:return{name:jo,properties:[{name:"parameter"}]};case Uo:return{name:Uo,properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case Wo:return{name:Wo,properties:[{name:"referenceType"}]};case lf:return{name:lf,properties:[{name:"name"}]};case Ho:return{name:Ho,properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case df:return{name:df,properties:[{name:"value"}]};case Ta:return{name:Ta,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case Vo:return{name:Vo,properties:[{name:"name"},{name:"type"}]};case dg:return{name:dg,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case Ko:return{name:Ko,properties:[{name:"types",defaultValue:[]}]};case Yo:return{name:Yo,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case Xo:return{name:Xo,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Jo:return{name:Jo,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case Qo:return{name:Qo,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case Zo:return{name:Zo,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case tu:return{name:tu,properties:[{name:"cardinality"},{name:"lookahead"}]};case nu:return{name:nu,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case ru:return{name:ru,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case iu:return{name:iu,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case su:return{name:su,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case au:return{name:au,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case ou:return{name:ou,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case uu:return{name:uu,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case cu:return{name:cu,properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case lu:return{name:lu,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case du:return{name:du,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case fu:return{name:fu,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}}const He=new lE;function hg(t){for(const[e,n]of Object.entries(t))e.startsWith("$")||(Array.isArray(n)?n.forEach((r,i)=>{$t(r)&&(r.$container=t,r.$containerProperty=e,r.$containerIndex=i)}):$t(n)&&(n.$container=t,n.$containerProperty=e))}function rn(t,e){let n=t;for(;n;){if(e(n))return n;n=n.$container}}function Ci(t,e){let n=t;for(;n;){if(e(n))return!0;n=n.$container}return!1}function wt(t){const n=ff(t).$document;if(!n)throw new Error("AST node has no document.");return n}function ff(t){for(;t.$container;)t=t.$container;return t}function pu(t,e){if(!t)throw new Error("Node must be an AstNode.");const n=e?.range;return new Ot(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),r=>{for(;r.keyIndex<r.keys.length;){const i=r.keys[r.keyIndex];if(!i.startsWith("$")){const s=t[i];if($t(s)){if(r.keyIndex++,mg(s,n))return{done:!1,value:s}}else if(Array.isArray(s)){for(;r.arrayIndex<s.length;){const a=r.arrayIndex++,o=s[a];if($t(o)&&mg(o,n))return{done:!1,value:o}}r.arrayIndex=0}}r.keyIndex++}return tn})}function Cr(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Sa(t,n=>pu(n,e))}function Kr(t,e){if(t){if(e?.range&&!mg(t,e.range))return new Sa(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new Sa(t,n=>pu(n,e),{includeRoot:!0})}function mg(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)===null||n===void 0?void 0:n.range;return r?tg(r,e):!1}function pf(t){return new Ot(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){const n=e.keys[e.keyIndex];if(!n.startsWith("$")){const r=t[n];if(Wn(r))return e.keyIndex++,{done:!1,value:{reference:r,container:t,property:n}};if(Array.isArray(r)){for(;e.arrayIndex<r.length;){const i=e.arrayIndex++,s=r[i];if(Wn(s))return{done:!1,value:{reference:s,container:t,property:n,index:i}}}e.arrayIndex=0}}e.keyIndex++}return tn})}function VN(t,e=wt(t).parseResult.value){const n=[];return Kr(e).forEach(r=>{pf(r).forEach(i=>{i.reference.ref===t&&n.push(i.reference)})}),rt(n)}function gg(t,e){const n=t.getTypeMetaData(e.$type),r=e;for(const i of n.properties)i.defaultValue!==void 0&&r[i.name]===void 0&&(r[i.name]=dE(i.defaultValue))}function dE(t){return Array.isArray(t)?[...t.map(dE)]:t}function yg(t,e){const n={$type:t.$type};for(const[r,i]of Object.entries(t))if(!r.startsWith("$"))if($t(i))n[r]=yg(i,e);else if(Wn(i))n[r]=e(n,r,i.$refNode,i.$refText);else if(Array.isArray(i)){const s=[];for(const a of i)$t(a)?s.push(yg(a,e)):Wn(a)?s.push(e(n,r,a.$refNode,a.$refText)):s.push(a);n[r]=s}else n[r]=i;return hg(n),n}const hu={__proto__:null,assignMandatoryProperties:gg,copyAstNode:yg,findLocalReferences:VN,findRootNode:ff,getContainerOfType:rn,getDocument:wt,hasContainerOfType:Ci,linkContentToContainer:hg,streamAllContents:Cr,streamAst:Kr,streamContents:pu,streamReferences:pf};function Te(t){return t.charCodeAt(0)}function wg(t,e){Array.isArray(t)?t.forEach(function(n){e.push(n)}):e.push(t)}function mu(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function ka(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function KN(){throw Error("Internal Error - Should never get here!")}function fE(t){return t.type==="Character"}const hf=[];for(let t=Te("0");t<=Te("9");t++)hf.push(t);const mf=[Te("_")].concat(hf);for(let t=Te("a");t<=Te("z");t++)mf.push(t);for(let t=Te("A");t<=Te("Z");t++)mf.push(t);const pE=[Te(" "),Te("\f"),Te(`
2
+ `),Te("\r"),Te(" "),Te("\v"),Te(" "),Te("\xA0"),Te("\u1680"),Te("\u2000"),Te("\u2001"),Te("\u2002"),Te("\u2003"),Te("\u2004"),Te("\u2005"),Te("\u2006"),Te("\u2007"),Te("\u2008"),Te("\u2009"),Te("\u200A"),Te("\u2028"),Te("\u2029"),Te("\u202F"),Te("\u205F"),Te("\u3000"),Te("\uFEFF")],YN=/[0-9a-fA-F]/,gf=/[0-9]/,XN=/[1-9]/;class hE{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const n=this.disjunction();this.consumeChar("/");const r={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":mu(r,"global");break;case"i":mu(r,"ignoreCase");break;case"m":mu(r,"multiLine");break;case"u":mu(r,"unicode");break;case"y":mu(r,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:n,loc:this.loc(0)}}disjunction(){const e=[],n=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(n)}}alternative(){const e=[],n=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(n)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let n;switch(this.popChar()){case"=":n="Lookahead";break;case"!":n="NegativeLookahead";break}ka(n);const r=this.disjunction();return this.consumeChar(")"),{type:n,value:r,loc:this.loc(e)}}return KN()}quantifier(e=!1){let n;const r=this.idx;switch(this.popChar()){case"*":n={atLeast:0,atMost:1/0};break;case"+":n={atLeast:1,atMost:1/0};break;case"?":n={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":n={atLeast:i,atMost:i};break;case",":let s;this.isDigit()?(s=this.integerIncludingZero(),n={atLeast:i,atMost:s}):n={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&n===void 0)return;ka(n);break}if(!(e===!0&&n===void 0)&&ka(n))return this.peekChar(0)==="?"?(this.consumeChar("?"),n.greedy=!1):n.greedy=!0,n.type="Quantifier",n.loc=this.loc(r),n}atom(){let e;const n=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),ka(e))return e.loc=this.loc(n),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[Te(`
3
+ `),Te("\r"),Te("\u2028"),Te("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,n=!1;switch(this.popChar()){case"d":e=hf;break;case"D":e=hf,n=!0;break;case"s":e=pE;break;case"S":e=pE,n=!0;break;case"w":e=mf;break;case"W":e=mf,n=!0;break}if(ka(e))return{type:"Set",value:e,complement:n}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=Te("\f");break;case"n":e=Te(`
4
+ `);break;case"r":e=Te("\r");break;case"t":e=Te(" ");break;case"v":e=Te("\v");break}if(ka(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:Te("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:Te(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
5
+ `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:Te(e)}}}characterClass(){const e=[];let n=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),n=!0);this.isClassAtom();){const r=this.classAtom();if(r.type,fE(r)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,fE(i)){if(i.value<r.value)throw Error("Range out of order in character class");e.push({from:r.value,to:i.value})}else wg(r.value,e),e.push(Te("-")),wg(i.value,e)}else wg(r.value,e)}return this.consumeChar("]"),{type:"Set",complement:n,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
6
+ `:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:Te("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}const n=this.disjunction();this.consumeChar(")");const r={type:"Group",capturing:e,value:n};return e&&(r.idx=this.groupIdx),r}positiveInteger(){let e=this.popChar();if(XN.test(e)===!1)throw Error("Expecting a positive integer");for(;gf.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(gf.test(e)===!1)throw Error("Expecting an integer");for(;gf.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case`
7
+ `:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:Te(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return gf.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
8
+ `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}}isQuantifier(){const e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
9
+ `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let n="";for(let i=0;i<e;i++){const s=this.popChar();if(YN.test(s)===!1)throw Error("Expecting a HexDecimal digits");n+=s}return{type:"Character",value:parseInt(n,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){const e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}}class yf{visitChildren(e){for(const n in e){const r=e[n];e.hasOwnProperty(n)&&(r.type!==void 0?this.visit(r):Array.isArray(r)&&r.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}const mE=/\r?\n/gm,JN=new hE;class QN extends yf{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const n=String.fromCharCode(e.value);if(!this.multiline&&n===`
10
+ `&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=wf(n);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitSet(e){if(!this.multiline){const n=this.regex.substring(e.loc.begin,e.loc.end),r=new RegExp(n);this.multiline=!!`
11
+ `.match(r)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}}const vg=new QN;function ZN(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),vg.reset(t),vg.visit(JN.pattern(t)),vg.multiline}catch{return!1}}const eO=`\f
12
+ \r \v \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`.split("");function bg(t){const e=typeof t=="string"?new RegExp(t):t;return eO.some(n=>e.test(n))}function wf(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tO(t){return Array.prototype.map.call(t,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:wf(e)).join("")}function nO(t,e){const n=rO(t),r=e.match(n);return!!r&&r[0].length>0}function rO(t){typeof t=="string"&&(t=new RegExp(t));const e=t,n=t.source;let r=0;function i(){let s="",a;function o(c){s+=n.substr(r,c),r+=c}function u(c){s+="(?:"+n.substr(r,c)+"|$)",r+=c}for(;r<n.length;)switch(n[r]){case"\\":switch(n[r+1]){case"c":u(3);break;case"x":u(4);break;case"u":e.unicode?n[r+2]==="{"?u(n.indexOf("}",r)-r+1):u(6):u(2);break;case"p":case"P":e.unicode?u(n.indexOf("}",r)-r+1):u(2);break;case"k":u(n.indexOf(">",r)-r+1);break;default:u(2);break}break;case"[":a=/\[(?:\\.|.)*?\]/g,a.lastIndex=r,a=a.exec(n)||[],u(a[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":o(1);break;case"{":a=/\{\d+,?\d*\}/g,a.lastIndex=r,a=a.exec(n),a?o(a[0].length):u(1);break;case"(":if(n[r+1]==="?")switch(n[r+2]){case":":s+="(?:",r+=3,s+=i()+"|$)";break;case"=":s+="(?=",r+=3,s+=i()+")";break;case"!":a=r,r+=3,i(),s+=n.substr(a,r-a);break;case"<":switch(n[r+3]){case"=":case"!":a=r,r+=4,i(),s+=n.substr(a,r-a);break;default:o(n.indexOf(">",r)-r+1),s+=i()+"|$)";break}break}else o(1),s+=i()+"|$)";break;case")":return++r,s;default:u(1);break}return s}return new RegExp(i(),t.flags)}function vf(t){return t.rules.find(e=>nn(e)&&e.entry)}function gE(t){return t.rules.filter(e=>Hr(e)&&e.hidden)}function Dg(t,e){const n=new Set,r=vf(t);if(!r)return new Set(t.rules);const i=[r].concat(gE(t));for(const a of i)yE(a,n,e);const s=new Set;for(const a of t.rules)(n.has(a.name)||Hr(a)&&a.hidden)&&s.add(a);return s}function yE(t,e,n){e.add(t.name),Cr(t).forEach(r=>{if(Vr(r)||n&&cE(r)){const i=r.rule.ref;i&&!e.has(i.name)&&yE(i,e,n)}})}function Eg(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=Tg(t.type.ref);return e?.terminal}}function wE(t){return t.hidden&&!bg(wu(t))}function Ca(t,e){return!t||!e?[]:Rg(t,e,t.astNode,!0)}function sn(t,e,n){if(!t||!e)return;const r=Rg(t,e,t.astNode,!0);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function Rg(t,e,n,r){if(!r){const i=rn(t.grammarSource,Tr);if(i&&i.feature===e)return[t]}return Si(t)&&t.astNode===n?t.content.flatMap(i=>Rg(i,e,n,!1)):[]}function $g(t,e){return t?Sg(t,e,t?.astNode):[]}function gu(t,e,n){if(!t)return;const r=Sg(t,e,t?.astNode);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function Sg(t,e,n){if(t.astNode!==n)return[];if(kr(t.grammarSource)&&t.grammarSource.value===e)return[t];const r=xo(t).iterator();let i;const s=[];do if(i=r.next(),!i.done){const a=i.value;a.astNode===n?kr(a.grammarSource)&&a.grammarSource.value===e&&s.push(a):r.prune()}while(!i.done);return s}function vE(t){var e;const n=t.astNode;for(;n===((e=t.container)===null||e===void 0?void 0:e.astNode);){const r=rn(t.grammarSource,Tr);if(r)return r;t=t.container}}function Tg(t){let e=t;return aE(e)&&(hs(e.$container)?e=e.$container.$container:nn(e.$container)?e=e.$container:No(e.$container)),bE(t,e,new Map)}function bE(t,e,n){var r;function i(s,a){let o;return rn(s,Tr)||(o=bE(a,a,n)),n.set(t,o),o}if(n.has(t))return n.get(t);n.set(t,void 0);for(const s of Cr(e)){if(Tr(s)&&s.feature.toLowerCase()==="name")return n.set(t,s),s;if(Vr(s)&&nn(s.rule.ref))return i(s,s.rule.ref);if(uE(s)&&(!((r=s.typeRef)===null||r===void 0)&&r.ref))return i(s,s.typeRef.ref)}}function DE(t){const e=t.$container;if(ki(e)){const n=e.elements,r=n.indexOf(t);for(let i=r-1;i>=0;i--){const s=n[i];if(hs(s))return s;{const a=Cr(n[i]).find(hs);if(a)return a}}}if(og(e))return DE(e)}function Aa(t,e){return t==="?"||t==="*"||ki(e)&&!!e.guardCondition}function EE(t){return t==="*"||t==="+"}function iO(t){return t==="+="}function bf(t){return RE(t,new Set)}function RE(t,e){if(e.has(t))return!0;e.add(t);for(const n of Cr(t))if(Vr(n)){if(!n.rule.ref||nn(n.rule.ref)&&!RE(n.rule.ref,e))return!1}else{if(Tr(n))return!1;if(hs(n))return!1}return!!t.definition}function sO(t){return kg(t.type,new Set)}function kg(t,e){if(e.has(t))return!0;if(e.add(t),_N(t))return!1;if(FN(t))return!1;if(MN(t))return t.types.every(n=>kg(n,e));if(uE(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){const n=t.typeRef.ref;return lg(n)?kg(n.type,e):!1}else return!1}else return!1}function ms(t){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e){if(nn(e))return e.name;if(oE(e)||lg(e))return e.name}}}function yu(t){var e;if(nn(t))return bf(t)?t.name:(e=ms(t))!==null&&e!==void 0?e:t.name;if(oE(t)||lg(t)||LN(t))return t.name;if(hs(t)){const n=$E(t);if(n)return n}else if(aE(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function $E(t){var e;if(t.inferredType)return t.inferredType.name;if(!((e=t.type)===null||e===void 0)&&e.ref)return yu(t.type.ref)}function aO(t){var e,n,r;return Hr(t)?(n=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:"string":bf(t)?t.name:(r=ms(t))!==null&&r!==void 0?r:t.name}function SE(t){var e,n,r;return Hr(t)?(n=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:"string":(r=ms(t))!==null&&r!==void 0?r:t.name}function wu(t){const e={s:!1,i:!1,u:!1},n=_a(t.definition,e),r=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(n,r)}const Cg=/[\s\S]/.source;function _a(t,e){if(jN(t))return oO(t);if(UN(t))return uO(t);if(zN(t))return dO(t);if(cE(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return Yr(_a(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead})}else{if(qN(t))return lO(t);if(WN(t))return cO(t);if(GN(t)){const n=t.regex.lastIndexOf("/"),r=t.regex.substring(1,n),i=t.regex.substring(n+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),Yr(r,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}else{if(HN(t))return Yr(Cg,{cardinality:t.cardinality,lookahead:t.lookahead});throw new Error(`Invalid terminal element: ${t?.$type}`)}}}function oO(t){return Yr(t.elements.map(e=>_a(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead})}function uO(t){return Yr(t.elements.map(e=>_a(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead})}function cO(t){return Yr(`${Cg}*?${_a(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead})}function lO(t){return Yr(`(?!${_a(t.terminal)})${Cg}*?`,{cardinality:t.cardinality,lookahead:t.lookahead})}function dO(t){return t.right?Yr(`[${Ag(t.left)}-${Ag(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1}):Yr(Ag(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}function Ag(t){return wf(t.value)}function Yr(t,e){var n;return(e.wrap!==!1||e.lookahead)&&(t=`(${(n=e.lookahead)!==null&&n!==void 0?n:""}${t})`),e.cardinality?`${t}${e.cardinality}`:t}const Df={__proto__:null,findAssignment:vE,findNameAssignment:Tg,findNodeForKeyword:gu,findNodeForProperty:sn,findNodesForKeyword:$g,findNodesForKeywordInternal:Sg,findNodesForProperty:Ca,getActionAtElement:DE,getActionType:$E,getAllReachableRules:Dg,getCrossReferenceTerminal:Eg,getEntryRule:vf,getExplicitRuleType:ms,getHiddenRules:gE,getRuleType:SE,getRuleTypeName:aO,getTypeName:yu,isArrayCardinality:EE,isArrayOperator:iO,isCommentTerminal:wE,isDataType:sO,isDataTypeRule:bf,isOptionalCardinality:Aa,terminalRegex:wu};function fO(t){const e=[],n=t.Grammar;for(const r of n.rules)Hr(r)&&wE(r)&&ZN(wu(r))&&e.push(r.name);return{multilineCommentRules:e,nameRegexp:ng}}var TE=typeof global=="object"&&global&&global.Object===Object&&global,pO=typeof self=="object"&&self&&self.Object===Object&&self,Ar=TE||pO||Function("return this")(),Hn=Ar.Symbol,kE=Object.prototype,hO=kE.hasOwnProperty,mO=kE.toString,vu=Hn?Hn.toStringTag:void 0;function gO(t){var e=hO.call(t,vu),n=t[vu];try{t[vu]=void 0;var r=!0}catch{}var i=mO.call(t);return r&&(e?t[vu]=n:delete t[vu]),i}var yO=Object.prototype,wO=yO.toString;function vO(t){return wO.call(t)}var bO="[object Null]",DO="[object Undefined]",CE=Hn?Hn.toStringTag:void 0;function Ai(t){return t==null?t===void 0?DO:bO:CE&&CE in Object(t)?gO(t):vO(t)}function ar(t){return t!=null&&typeof t=="object"}var EO="[object Symbol]";function bu(t){return typeof t=="symbol"||ar(t)&&Ai(t)==EO}function Ef(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var Ve=Array.isArray,AE=Hn?Hn.prototype:void 0,_E=AE?AE.toString:void 0;function PE(t){if(typeof t=="string")return t;if(Ve(t))return Ef(t,PE)+"";if(bu(t))return _E?_E.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var RO=/\s/;function $O(t){for(var e=t.length;e--&&RO.test(t.charAt(e)););return e}var SO=/^\s+/;function TO(t){return t&&t.slice(0,$O(t)+1).replace(SO,"")}function Vn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var xE=NaN,kO=/^[-+]0x[0-9a-f]+$/i,CO=/^0b[01]+$/i,AO=/^0o[0-7]+$/i,_O=parseInt;function PO(t){if(typeof t=="number")return t;if(bu(t))return xE;if(Vn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Vn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=TO(t);var n=CO.test(t);return n||AO.test(t)?_O(t.slice(2),n?2:8):kO.test(t)?xE:+t}var xO=1/0,IO=17976931348623157e292;function NO(t){if(!t)return t===0?t:0;if(t=PO(t),t===xO||t===-1/0){var e=t<0?-1:1;return e*IO}return t===t?t:0}function Rf(t){var e=NO(t),n=e%1;return e===e?n?e-n:e:0}function gs(t){return t}var OO="[object AsyncFunction]",FO="[object Function]",LO="[object GeneratorFunction]",MO="[object Proxy]";function Xr(t){if(!Vn(t))return!1;var e=Ai(t);return e==FO||e==LO||e==OO||e==MO}var _g=Ar["__core-js_shared__"],IE=function(){var t=/[^.]+$/.exec(_g&&_g.keys&&_g.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function zO(t){return!!IE&&IE in t}var BO=Function.prototype,qO=BO.toString;function ys(t){if(t!=null){try{return qO.call(t)}catch{}try{return t+""}catch{}}return""}var GO=/[\\^$.*+?()[\]{}|]/g,jO=/^\[object .+?Constructor\]$/,UO=Function.prototype,WO=Object.prototype,HO=UO.toString,VO=WO.hasOwnProperty,KO=RegExp("^"+HO.call(VO).replace(GO,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function YO(t){if(!Vn(t)||zO(t))return!1;var e=Xr(t)?KO:jO;return e.test(ys(t))}function XO(t,e){return t?.[e]}function ws(t,e){var n=XO(t,e);return YO(n)?n:void 0}var Pg=ws(Ar,"WeakMap"),NE=Object.create,JO=function(){function t(){}return function(e){if(!Vn(e))return{};if(NE)return NE(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function QO(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Lt(){}function ZO(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var eF=800,tF=16,nF=Date.now;function rF(t){var e=0,n=0;return function(){var r=nF(),i=tF-(r-n);if(n=r,i>0){if(++e>=eF)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function iF(t){return function(){return t}}var $f=function(){try{var t=ws(Object,"defineProperty");return t({},"",{}),t}catch{}}(),sF=$f?function(t,e){return $f(t,"toString",{configurable:!0,enumerable:!1,value:iF(e),writable:!0})}:gs,aF=rF(sF);function OE(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function FE(t,e,n,r){for(var i=t.length,s=n+-1;++s<i;)if(e(t[s],s,t))return s;return-1}function oF(t){return t!==t}function uF(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function xg(t,e,n){return e===e?uF(t,e,n):FE(t,oF,n)}function LE(t,e){var n=t==null?0:t.length;return!!n&&xg(t,e,0)>-1}var cF=9007199254740991,lF=/^(?:0|[1-9]\d*)$/;function Sf(t,e){var n=typeof t;return e=e??cF,!!e&&(n=="number"||n!="symbol"&&lF.test(t))&&t>-1&&t%1==0&&t<e}function Ig(t,e,n){e=="__proto__"&&$f?$f(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Du(t,e){return t===e||t!==t&&e!==e}var dF=Object.prototype,fF=dF.hasOwnProperty;function Tf(t,e,n){var r=t[e];(!(fF.call(t,e)&&Du(r,n))||n===void 0&&!(e in t))&&Ig(t,e,n)}function Eu(t,e,n,r){var i=!n;n||(n={});for(var s=-1,a=e.length;++s<a;){var o=e[s],u=void 0;u===void 0&&(u=t[o]),i?Ig(n,o,u):Tf(n,o,u)}return n}var ME=Math.max;function pF(t,e,n){return e=ME(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=ME(r.length-e,0),a=Array(s);++i<s;)a[i]=r[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=r[i];return o[e]=n(a),QO(t,this,o)}}function Ng(t,e){return aF(pF(t,e,gs),t+"")}var hF=9007199254740991;function Og(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=hF}function _r(t){return t!=null&&Og(t.length)&&!Xr(t)}function zE(t,e,n){if(!Vn(n))return!1;var r=typeof e;return(r=="number"?_r(n)&&Sf(e,n.length):r=="string"&&e in n)?Du(n[e],t):!1}function mF(t){return Ng(function(e,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(s=t.length>3&&typeof s=="function"?(i--,s):void 0,a&&zE(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var o=n[r];o&&t(e,o,r,s)}return e})}var gF=Object.prototype;function Ru(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||gF;return t===n}function yF(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var wF="[object Arguments]";function BE(t){return ar(t)&&Ai(t)==wF}var qE=Object.prototype,vF=qE.hasOwnProperty,bF=qE.propertyIsEnumerable,kf=BE(function(){return arguments}())?BE:function(t){return ar(t)&&vF.call(t,"callee")&&!bF.call(t,"callee")};function DF(){return!1}var GE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jE=GE&&typeof module=="object"&&module&&!module.nodeType&&module,EF=jE&&jE.exports===GE,UE=EF?Ar.Buffer:void 0,RF=UE?UE.isBuffer:void 0,$u=RF||DF,$F="[object Arguments]",SF="[object Array]",TF="[object Boolean]",kF="[object Date]",CF="[object Error]",AF="[object Function]",_F="[object Map]",PF="[object Number]",xF="[object Object]",IF="[object RegExp]",NF="[object Set]",OF="[object String]",FF="[object WeakMap]",LF="[object ArrayBuffer]",MF="[object DataView]",zF="[object Float32Array]",BF="[object Float64Array]",qF="[object Int8Array]",GF="[object Int16Array]",jF="[object Int32Array]",UF="[object Uint8Array]",WF="[object Uint8ClampedArray]",HF="[object Uint16Array]",VF="[object Uint32Array]",mt={};mt[zF]=mt[BF]=mt[qF]=mt[GF]=mt[jF]=mt[UF]=mt[WF]=mt[HF]=mt[VF]=!0,mt[$F]=mt[SF]=mt[LF]=mt[TF]=mt[MF]=mt[kF]=mt[CF]=mt[AF]=mt[_F]=mt[PF]=mt[xF]=mt[IF]=mt[NF]=mt[OF]=mt[FF]=!1;function KF(t){return ar(t)&&Og(t.length)&&!!mt[Ai(t)]}function Cf(t){return function(e){return t(e)}}var WE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Su=WE&&typeof module=="object"&&module&&!module.nodeType&&module,YF=Su&&Su.exports===WE,Fg=YF&&TE.process,_i=function(){try{var t=Su&&Su.require&&Su.require("util").types;return t||Fg&&Fg.binding&&Fg.binding("util")}catch{}}(),HE=_i&&_i.isTypedArray,Lg=HE?Cf(HE):KF,XF=Object.prototype,JF=XF.hasOwnProperty;function VE(t,e){var n=Ve(t),r=!n&&kf(t),i=!n&&!r&&$u(t),s=!n&&!r&&!i&&Lg(t),a=n||r||i||s,o=a?yF(t.length,String):[],u=o.length;for(var c in t)(e||JF.call(t,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Sf(c,u)))&&o.push(c);return o}function KE(t,e){return function(n){return t(e(n))}}var QF=KE(Object.keys,Object),ZF=Object.prototype,eL=ZF.hasOwnProperty;function YE(t){if(!Ru(t))return QF(t);var e=[];for(var n in Object(t))eL.call(t,n)&&n!="constructor"&&e.push(n);return e}function Kn(t){return _r(t)?VE(t):YE(t)}var tL=Object.prototype,nL=tL.hasOwnProperty,In=mF(function(t,e){if(Ru(e)||_r(e)){Eu(e,Kn(e),t);return}for(var n in e)nL.call(e,n)&&Tf(t,n,e[n])});function rL(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var iL=Object.prototype,sL=iL.hasOwnProperty;function aL(t){if(!Vn(t))return rL(t);var e=Ru(t),n=[];for(var r in t)r=="constructor"&&(e||!sL.call(t,r))||n.push(r);return n}function Mg(t){return _r(t)?VE(t,!0):aL(t)}var oL=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uL=/^\w*$/;function zg(t,e){if(Ve(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||bu(t)?!0:uL.test(t)||!oL.test(t)||e!=null&&t in Object(e)}var Tu=ws(Object,"create");function cL(){this.__data__=Tu?Tu(null):{},this.size=0}function lL(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var dL="__lodash_hash_undefined__",fL=Object.prototype,pL=fL.hasOwnProperty;function hL(t){var e=this.__data__;if(Tu){var n=e[t];return n===dL?void 0:n}return pL.call(e,t)?e[t]:void 0}var mL=Object.prototype,gL=mL.hasOwnProperty;function yL(t){var e=this.__data__;return Tu?e[t]!==void 0:gL.call(e,t)}var wL="__lodash_hash_undefined__";function vL(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Tu&&e===void 0?wL:e,this}function vs(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}vs.prototype.clear=cL,vs.prototype.delete=lL,vs.prototype.get=hL,vs.prototype.has=yL,vs.prototype.set=vL;function bL(){this.__data__=[],this.size=0}function Af(t,e){for(var n=t.length;n--;)if(Du(t[n][0],e))return n;return-1}var DL=Array.prototype,EL=DL.splice;function RL(t){var e=this.__data__,n=Af(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():EL.call(e,n,1),--this.size,!0}function $L(t){var e=this.__data__,n=Af(e,t);return n<0?void 0:e[n][1]}function SL(t){return Af(this.__data__,t)>-1}function TL(t,e){var n=this.__data__,r=Af(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Jr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Jr.prototype.clear=bL,Jr.prototype.delete=RL,Jr.prototype.get=$L,Jr.prototype.has=SL,Jr.prototype.set=TL;var ku=ws(Ar,"Map");function kL(){this.size=0,this.__data__={hash:new vs,map:new(ku||Jr),string:new vs}}function CL(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function _f(t,e){var n=t.__data__;return CL(e)?n[typeof e=="string"?"string":"hash"]:n.map}function AL(t){var e=_f(this,t).delete(t);return this.size-=e?1:0,e}function _L(t){return _f(this,t).get(t)}function PL(t){return _f(this,t).has(t)}function xL(t,e){var n=_f(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function Qr(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Qr.prototype.clear=kL,Qr.prototype.delete=AL,Qr.prototype.get=_L,Qr.prototype.has=PL,Qr.prototype.set=xL;var IL="Expected a function";function Bg(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(IL);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var a=t.apply(this,r);return n.cache=s.set(i,a)||s,a};return n.cache=new(Bg.Cache||Qr),n}Bg.Cache=Qr;var NL=500;function OL(t){var e=Bg(t,function(r){return n.size===NL&&n.clear(),r}),n=e.cache;return e}var FL=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,LL=/\\(\\)?/g,ML=OL(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(FL,function(n,r,i,s){e.push(i?s.replace(LL,"$1"):r||n)}),e});function zL(t){return t==null?"":PE(t)}function Pf(t,e){return Ve(t)?t:zg(t,e)?[t]:ML(zL(t))}function Cu(t){if(typeof t=="string"||bu(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function qg(t,e){e=Pf(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[Cu(e[n++])];return n&&n==r?t:void 0}function BL(t,e,n){var r=t==null?void 0:qg(t,e);return r===void 0?n:r}function Gg(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var XE=Hn?Hn.isConcatSpreadable:void 0;function qL(t){return Ve(t)||kf(t)||!!(XE&&t&&t[XE])}function jg(t,e,n,r,i){var s=-1,a=t.length;for(n||(n=qL),i||(i=[]);++s<a;){var o=t[s];n(o)?Gg(i,o):r||(i[i.length]=o)}return i}function Yn(t){var e=t==null?0:t.length;return e?jg(t):[]}var JE=KE(Object.getPrototypeOf,Object);function QE(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}function GL(t,e,n,r){var i=-1,s=t==null?0:t.length;for(r&&s&&(n=t[++i]);++i<s;)n=e(n,t[i],i,t);return n}function jL(){this.__data__=new Jr,this.size=0}function UL(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function WL(t){return this.__data__.get(t)}function HL(t){return this.__data__.has(t)}var VL=200;function KL(t,e){var n=this.__data__;if(n instanceof Jr){var r=n.__data__;if(!ku||r.length<VL-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Qr(r)}return n.set(t,e),this.size=n.size,this}function Pr(t){var e=this.__data__=new Jr(t);this.size=e.size}Pr.prototype.clear=jL,Pr.prototype.delete=UL,Pr.prototype.get=WL,Pr.prototype.has=HL,Pr.prototype.set=KL;function YL(t,e){return t&&Eu(e,Kn(e),t)}function XL(t,e){return t&&Eu(e,Mg(e),t)}var ZE=typeof exports=="object"&&exports&&!exports.nodeType&&exports,eR=ZE&&typeof module=="object"&&module&&!module.nodeType&&module,JL=eR&&eR.exports===ZE,tR=JL?Ar.Buffer:void 0,nR=tR?tR.allocUnsafe:void 0;function QL(t,e){var n=t.length,r=nR?nR(n):new t.constructor(n);return t.copy(r),r}function Ug(t,e){for(var n=-1,r=t==null?0:t.length,i=0,s=[];++n<r;){var a=t[n];e(a,n,t)&&(s[i++]=a)}return s}function rR(){return[]}var ZL=Object.prototype,eM=ZL.propertyIsEnumerable,iR=Object.getOwnPropertySymbols,Wg=iR?function(t){return t==null?[]:(t=Object(t),Ug(iR(t),function(e){return eM.call(t,e)}))}:rR;function tM(t,e){return Eu(t,Wg(t),e)}var nM=Object.getOwnPropertySymbols,sR=nM?function(t){for(var e=[];t;)Gg(e,Wg(t)),t=JE(t);return e}:rR;function rM(t,e){return Eu(t,sR(t),e)}function aR(t,e,n){var r=e(t);return Ve(t)?r:Gg(r,n(t))}function Hg(t){return aR(t,Kn,Wg)}function iM(t){return aR(t,Mg,sR)}var Vg=ws(Ar,"DataView"),Kg=ws(Ar,"Promise"),Pa=ws(Ar,"Set"),oR="[object Map]",sM="[object Object]",uR="[object Promise]",cR="[object Set]",lR="[object WeakMap]",dR="[object DataView]",aM=ys(Vg),oM=ys(ku),uM=ys(Kg),cM=ys(Pa),lM=ys(Pg),Xn=Ai;(Vg&&Xn(new Vg(new ArrayBuffer(1)))!=dR||ku&&Xn(new ku)!=oR||Kg&&Xn(Kg.resolve())!=uR||Pa&&Xn(new Pa)!=cR||Pg&&Xn(new Pg)!=lR)&&(Xn=function(t){var e=Ai(t),n=e==sM?t.constructor:void 0,r=n?ys(n):"";if(r)switch(r){case aM:return dR;case oM:return oR;case uM:return uR;case cM:return cR;case lM:return lR}return e});var dM=Object.prototype,fM=dM.hasOwnProperty;function pM(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&fM.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var xf=Ar.Uint8Array;function hM(t){var e=new t.constructor(t.byteLength);return new xf(e).set(new xf(t)),e}function mM(t,e){var n=t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var gM=/\w*$/;function yM(t){var e=new t.constructor(t.source,gM.exec(t));return e.lastIndex=t.lastIndex,e}var fR=Hn?Hn.prototype:void 0,pR=fR?fR.valueOf:void 0;function wM(t){return pR?Object(pR.call(t)):{}}function vM(t,e){var n=t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var bM="[object Boolean]",DM="[object Date]",EM="[object Map]",RM="[object Number]",$M="[object RegExp]",SM="[object Set]",TM="[object String]",kM="[object Symbol]",CM="[object ArrayBuffer]",AM="[object DataView]",_M="[object Float32Array]",PM="[object Float64Array]",xM="[object Int8Array]",IM="[object Int16Array]",NM="[object Int32Array]",OM="[object Uint8Array]",FM="[object Uint8ClampedArray]",LM="[object Uint16Array]",MM="[object Uint32Array]";function zM(t,e,n){var r=t.constructor;switch(e){case CM:return hM(t);case bM:case DM:return new r(+t);case AM:return mM(t);case _M:case PM:case xM:case IM:case NM:case OM:case FM:case LM:case MM:return vM(t);case EM:return new r;case RM:case TM:return new r(t);case $M:return yM(t);case SM:return new r;case kM:return wM(t)}}function BM(t){return typeof t.constructor=="function"&&!Ru(t)?JO(JE(t)):{}}var qM="[object Map]";function GM(t){return ar(t)&&Xn(t)==qM}var hR=_i&&_i.isMap,jM=hR?Cf(hR):GM,UM="[object Set]";function WM(t){return ar(t)&&Xn(t)==UM}var mR=_i&&_i.isSet,HM=mR?Cf(mR):WM,VM=2,gR="[object Arguments]",KM="[object Array]",YM="[object Boolean]",XM="[object Date]",JM="[object Error]",yR="[object Function]",QM="[object GeneratorFunction]",ZM="[object Map]",e2="[object Number]",wR="[object Object]",t2="[object RegExp]",n2="[object Set]",r2="[object String]",i2="[object Symbol]",s2="[object WeakMap]",a2="[object ArrayBuffer]",o2="[object DataView]",u2="[object Float32Array]",c2="[object Float64Array]",l2="[object Int8Array]",d2="[object Int16Array]",f2="[object Int32Array]",p2="[object Uint8Array]",h2="[object Uint8ClampedArray]",m2="[object Uint16Array]",g2="[object Uint32Array]",dt={};dt[gR]=dt[KM]=dt[a2]=dt[o2]=dt[YM]=dt[XM]=dt[u2]=dt[c2]=dt[l2]=dt[d2]=dt[f2]=dt[ZM]=dt[e2]=dt[wR]=dt[t2]=dt[n2]=dt[r2]=dt[i2]=dt[p2]=dt[h2]=dt[m2]=dt[g2]=!0,dt[JM]=dt[yR]=dt[s2]=!1;function If(t,e,n,r,i,s){var a,o=e&VM;if(a!==void 0)return a;if(!Vn(t))return t;var u=Ve(t);if(u)return a=pM(t),ZO(t,a);var c=Xn(t),l=c==yR||c==QM;if($u(t))return QL(t);if(c==wR||c==gR||l&&!i)return a=l?{}:BM(t),o?rM(t,XL(a,t)):tM(t,YL(a,t));if(!dt[c])return i?t:{};a=zM(t,c),s||(s=new Pr);var d=s.get(t);if(d)return d;s.set(t,a),HM(t)?t.forEach(function(h){a.add(If(h,e,n,h,t,s))}):jM(t)&&t.forEach(function(h,y){a.set(y,If(h,e,n,y,t,s))});var f=Hg,p=u?void 0:f(t);return OE(p||t,function(h,y){p&&(y=h,h=t[y]),Tf(a,y,If(h,e,n,y,t,s))}),a}var y2=4;function Vt(t){return If(t,y2)}function Au(t){for(var e=-1,n=t==null?0:t.length,r=0,i=[];++e<n;){var s=t[e];s&&(i[r++]=s)}return i}var w2="__lodash_hash_undefined__";function v2(t){return this.__data__.set(t,w2),this}function b2(t){return this.__data__.has(t)}function xa(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Qr;++e<n;)this.add(t[e])}xa.prototype.add=xa.prototype.push=v2,xa.prototype.has=b2;function vR(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function Yg(t,e){return t.has(e)}var D2=1,E2=2;function bR(t,e,n,r,i,s){var a=n&D2,o=t.length,u=e.length;if(o!=u&&!(a&&u>o))return!1;var c=s.get(t),l=s.get(e);if(c&&l)return c==e&&l==t;var d=-1,f=!0,p=n&E2?new xa:void 0;for(s.set(t,e),s.set(e,t);++d<o;){var h=t[d],y=e[d];if(r)var b=a?r(y,h,d,e,t,s):r(h,y,d,t,e,s);if(b!==void 0){if(b)continue;f=!1;break}if(p){if(!vR(e,function(w,E){if(!Yg(p,E)&&(h===w||i(h,w,n,r,s)))return p.push(E)})){f=!1;break}}else if(!(h===y||i(h,y,n,r,s))){f=!1;break}}return s.delete(t),s.delete(e),f}function R2(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function Xg(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var $2=1,S2=2,T2="[object Boolean]",k2="[object Date]",C2="[object Error]",A2="[object Map]",_2="[object Number]",P2="[object RegExp]",x2="[object Set]",I2="[object String]",N2="[object Symbol]",O2="[object ArrayBuffer]",F2="[object DataView]",DR=Hn?Hn.prototype:void 0,Jg=DR?DR.valueOf:void 0;function L2(t,e,n,r,i,s,a){switch(n){case F2:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case O2:return!(t.byteLength!=e.byteLength||!s(new xf(t),new xf(e)));case T2:case k2:case _2:return Du(+t,+e);case C2:return t.name==e.name&&t.message==e.message;case P2:case I2:return t==e+"";case A2:var o=R2;case x2:var u=r&$2;if(o||(o=Xg),t.size!=e.size&&!u)return!1;var c=a.get(t);if(c)return c==e;r|=S2,a.set(t,e);var l=bR(o(t),o(e),r,i,s,a);return a.delete(t),l;case N2:if(Jg)return Jg.call(t)==Jg.call(e)}return!1}var M2=1,z2=Object.prototype,B2=z2.hasOwnProperty;function q2(t,e,n,r,i,s){var a=n&M2,o=Hg(t),u=o.length,c=Hg(e),l=c.length;if(u!=l&&!a)return!1;for(var d=u;d--;){var f=o[d];if(!(a?f in e:B2.call(e,f)))return!1}var p=s.get(t),h=s.get(e);if(p&&h)return p==e&&h==t;var y=!0;s.set(t,e),s.set(e,t);for(var b=a;++d<u;){f=o[d];var w=t[f],E=e[f];if(r)var $=a?r(E,w,f,e,t,s):r(w,E,f,t,e,s);if(!($===void 0?w===E||i(w,E,n,r,s):$)){y=!1;break}b||(b=f=="constructor")}if(y&&!b){var k=t.constructor,A=e.constructor;k!=A&&"constructor"in t&&"constructor"in e&&!(typeof k=="function"&&k instanceof k&&typeof A=="function"&&A instanceof A)&&(y=!1)}return s.delete(t),s.delete(e),y}var G2=1,ER="[object Arguments]",RR="[object Array]",Nf="[object Object]",j2=Object.prototype,$R=j2.hasOwnProperty;function U2(t,e,n,r,i,s){var a=Ve(t),o=Ve(e),u=a?RR:Xn(t),c=o?RR:Xn(e);u=u==ER?Nf:u,c=c==ER?Nf:c;var l=u==Nf,d=c==Nf,f=u==c;if(f&&$u(t)){if(!$u(e))return!1;a=!0,l=!1}if(f&&!l)return s||(s=new Pr),a||Lg(t)?bR(t,e,n,r,i,s):L2(t,e,u,n,r,i,s);if(!(n&G2)){var p=l&&$R.call(t,"__wrapped__"),h=d&&$R.call(e,"__wrapped__");if(p||h){var y=p?t.value():t,b=h?e.value():e;return s||(s=new Pr),i(y,b,n,r,s)}}return f?(s||(s=new Pr),q2(t,e,n,r,i,s)):!1}function Qg(t,e,n,r,i){return t===e?!0:t==null||e==null||!ar(t)&&!ar(e)?t!==t&&e!==e:U2(t,e,n,r,Qg,i)}var W2=1,H2=2;function V2(t,e,n,r){var i=n.length,s=i;if(t==null)return!s;for(t=Object(t);i--;){var a=n[i];if(a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<s;){a=n[i];var o=a[0],u=t[o],c=a[1];if(a[2]){if(u===void 0&&!(o in t))return!1}else{var l=new Pr,d;if(!(d===void 0?Qg(c,u,W2|H2,r,l):d))return!1}}return!0}function SR(t){return t===t&&!Vn(t)}function K2(t){for(var e=Kn(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,SR(i)]}return e}function TR(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function Y2(t){var e=K2(t);return e.length==1&&e[0][2]?TR(e[0][0],e[0][1]):function(n){return n===t||V2(n,t,e)}}function X2(t,e){return t!=null&&e in Object(t)}function kR(t,e,n){e=Pf(e,t);for(var r=-1,i=e.length,s=!1;++r<i;){var a=Cu(e[r]);if(!(s=t!=null&&n(t,a)))break;t=t[a]}return s||++r!=i?s:(i=t==null?0:t.length,!!i&&Og(i)&&Sf(a,i)&&(Ve(t)||kf(t)))}function J2(t,e){return t!=null&&kR(t,e,X2)}var Q2=1,Z2=2;function ez(t,e){return zg(t)&&SR(e)?TR(Cu(t),e):function(n){var r=BL(n,t);return r===void 0&&r===e?J2(n,t):Qg(e,r,Q2|Z2)}}function tz(t){return function(e){return e?.[t]}}function nz(t){return function(e){return qg(e,t)}}function rz(t){return zg(t)?tz(Cu(t)):nz(t)}function or(t){return typeof t=="function"?t:t==null?gs:typeof t=="object"?Ve(t)?ez(t[0],t[1]):Y2(t):rz(t)}function iz(t,e,n,r){for(var i=-1,s=t==null?0:t.length;++i<s;){var a=t[i];e(r,a,n(a),t)}return r}function sz(t){return function(e,n,r){for(var i=-1,s=Object(e),a=r(e),o=a.length;o--;){var u=a[++i];if(n(s[u],u,s)===!1)break}return e}}var az=sz();function oz(t,e){return t&&az(t,e,Kn)}function uz(t,e){return function(n,r){if(n==null)return n;if(!_r(n))return t(n,r);for(var i=n.length,s=-1,a=Object(n);++s<i&&r(a[s],s,a)!==!1;);return n}}var bs=uz(oz);function cz(t,e,n,r){return bs(t,function(i,s,a){e(r,i,n(i),a)}),r}function lz(t,e){return function(n,r){var i=Ve(n)?iz:cz,s=e?e():{};return i(n,t,or(r),s)}}var CR=Object.prototype,dz=CR.hasOwnProperty,Zg=Ng(function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&zE(e[0],e[1],i)&&(r=1);++n<r;)for(var s=e[n],a=Mg(s),o=-1,u=a.length;++o<u;){var c=a[o],l=t[c];(l===void 0||Du(l,CR[c])&&!dz.call(t,c))&&(t[c]=s[c])}return t});function AR(t){return ar(t)&&_r(t)}var fz=200;function pz(t,e,n,r){var i=-1,s=LE,a=!0,o=t.length,u=[],c=e.length;if(!o)return u;e.length>=fz&&(s=Yg,a=!1,e=new xa(e));e:for(;++i<o;){var l=t[i],d=l;if(l=l!==0?l:0,a&&d===d){for(var f=c;f--;)if(e[f]===d)continue e;u.push(l)}else s(e,d,r)||u.push(l)}return u}var Of=Ng(function(t,e){return AR(t)?pz(t,jg(e,1,AR,!0)):[]});function Ia(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function Kt(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:Rf(e),QE(t,e<0?0:e,r)):[]}function _u(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:Rf(e),e=r-e,QE(t,0,e<0?0:e)):[]}function hz(t){return typeof t=="function"?t:gs}function Re(t,e){var n=Ve(t)?OE:bs;return n(t,hz(e))}function mz(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function gz(t,e){var n=!0;return bs(t,function(r,i,s){return n=!!e(r,i,s),n}),n}function ur(t,e,n){var r=Ve(t)?mz:gz;return r(t,or(e))}function _R(t,e){var n=[];return bs(t,function(r,i,s){e(r,i,s)&&n.push(r)}),n}function Nn(t,e){var n=Ve(t)?Ug:_R;return n(t,or(e))}function yz(t){return function(e,n,r){var i=Object(e);if(!_r(e)){var s=or(n);e=Kn(e),n=function(o){return s(i[o],o,i)}}var a=t(e,n,r);return a>-1?i[s?e[a]:a]:void 0}}var wz=Math.max;function vz(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:Rf(n);return i<0&&(i=wz(r+i,0)),FE(t,or(e),i)}var Na=yz(vz);function cr(t){return t&&t.length?t[0]:void 0}function bz(t,e){var n=-1,r=_r(t)?Array(t.length):[];return bs(t,function(i,s,a){r[++n]=e(i,s,a)}),r}function he(t,e){var n=Ve(t)?Ef:bz;return n(t,or(e))}function On(t,e){return jg(he(t,e))}var Dz=Object.prototype,Ez=Dz.hasOwnProperty,Rz=lz(function(t,e,n){Ez.call(t,n)?t[n].push(e):Ig(t,n,[e])}),$z=Object.prototype,Sz=$z.hasOwnProperty;function Tz(t,e){return t!=null&&Sz.call(t,e)}function $e(t,e){return t!=null&&kR(t,e,Tz)}var kz="[object String]";function Tn(t){return typeof t=="string"||!Ve(t)&&ar(t)&&Ai(t)==kz}function Cz(t,e){return Ef(e,function(n){return t[n]})}function Mt(t){return t==null?[]:Cz(t,Kn(t))}var Az=Math.max;function hn(t,e,n,r){t=_r(t)?t:Mt(t),n=n?Rf(n):0;var i=t.length;return n<0&&(n=Az(i+n,0)),Tn(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&xg(t,e,n)>-1}function PR(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=0;return xg(t,e,i)}var _z="[object Map]",Pz="[object Set]",xz=Object.prototype,Iz=xz.hasOwnProperty;function ut(t){if(t==null)return!0;if(_r(t)&&(Ve(t)||typeof t=="string"||typeof t.splice=="function"||$u(t)||Lg(t)||kf(t)))return!t.length;var e=Xn(t);if(e==_z||e==Pz)return!t.size;if(Ru(t))return!YE(t).length;for(var n in t)if(Iz.call(t,n))return!1;return!0}var Nz="[object RegExp]";function Oz(t){return ar(t)&&Ai(t)==Nz}var xR=_i&&_i.isRegExp,Zr=xR?Cf(xR):Oz;function ei(t){return t===void 0}function Fz(t,e){return t<e}function Lz(t,e,n){for(var r=-1,i=t.length;++r<i;){var s=t[r],a=e(s);if(a!=null&&(o===void 0?a===a&&!bu(a):n(a,o)))var o=a,u=s}return u}function Mz(t){return t&&t.length?Lz(t,gs,Fz):void 0}var zz="Expected a function";function Bz(t){if(typeof t!="function")throw new TypeError(zz);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function qz(t,e,n,r){if(!Vn(t))return t;e=Pf(e,t);for(var i=-1,s=e.length,a=s-1,o=t;o!=null&&++i<s;){var u=Cu(e[i]),c=n;if(u==="__proto__"||u==="constructor"||u==="prototype")return t;if(i!=a){var l=o[u];c=void 0,c===void 0&&(c=Vn(l)?l:Sf(e[i+1])?[]:{})}Tf(o,u,c),o=o[u]}return t}function Gz(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var a=e[r],o=qg(t,a);n(o,a)&&qz(s,Pf(a,t),o)}return s}function lr(t,e){if(t==null)return{};var n=Ef(iM(t),function(r){return[r]});return e=or(e),Gz(t,n,function(r,i){return e(r,i[0])})}function jz(t,e,n,r,i){return i(t,function(s,a,o){n=r?(r=!1,s):e(n,s,a,o)}),n}function mn(t,e,n){var r=Ve(t)?GL:jz,i=arguments.length<3;return r(t,or(e),n,i,bs)}function Ff(t,e){var n=Ve(t)?Ug:_R;return n(t,Bz(or(e)))}function Uz(t,e){var n;return bs(t,function(r,i,s){return n=e(r,i,s),!n}),!!n}function IR(t,e,n){var r=Ve(t)?vR:Uz;return r(t,or(e))}var Wz=1/0,Hz=Pa&&1/Xg(new Pa([,-0]))[1]==Wz?function(t){return new Pa(t)}:Lt,Vz=200;function NR(t,e,n){var r=-1,i=LE,s=t.length,a=!0,o=[],u=o;if(s>=Vz){var c=e?null:Hz(t);if(c)return Xg(c);a=!1,i=Yg,u=new xa}else u=e?[]:o;e:for(;++r<s;){var l=t[r],d=e?e(l):l;if(l=l!==0?l:0,a&&d===d){for(var f=u.length;f--;)if(u[f]===d)continue e;e&&u.push(d),o.push(l)}else i(u,d,n)||(u!==o&&u.push(d),o.push(l))}return o}function ey(t){return t&&t.length?NR(t):[]}function Kz(t,e){return t&&t.length?NR(t,or(e)):[]}function ty(t){console&&console.error&&console.error(`Error: ${t}`)}function OR(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function FR(t){const e=new Date().getTime(),n=t();return{time:new Date().getTime()-e,value:n}}function LR(t){function e(){}e.prototype=t;const n=new e;function r(){return typeof n.bar}return r(),r(),t}function Yz(t){return Xz(t)?t.LABEL:t.name}function Xz(t){return Tn(t.LABEL)&&t.LABEL!==""}class xr{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),Re(this.definition,n=>{n.accept(e)})}}class gn extends xr{constructor(e){super([]),this.idx=1,In(this,lr(e,n=>n!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class Oa extends xr{constructor(e){super(e.definition),this.orgText="",In(this,lr(e,n=>n!==void 0))}}class kn extends xr{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,In(this,lr(e,n=>n!==void 0))}}class Yt extends xr{constructor(e){super(e.definition),this.idx=1,In(this,lr(e,n=>n!==void 0))}}class Fn extends xr{constructor(e){super(e.definition),this.idx=1,In(this,lr(e,n=>n!==void 0))}}class Ln extends xr{constructor(e){super(e.definition),this.idx=1,In(this,lr(e,n=>n!==void 0))}}class St extends xr{constructor(e){super(e.definition),this.idx=1,In(this,lr(e,n=>n!==void 0))}}class Cn extends xr{constructor(e){super(e.definition),this.idx=1,In(this,lr(e,n=>n!==void 0))}}class An extends xr{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,In(this,lr(e,n=>n!==void 0))}}class gt{constructor(e){this.idx=1,In(this,lr(e,n=>n!==void 0))}accept(e){e.visit(this)}}function Jz(t){return he(t,Lf)}function Lf(t){function e(n){return he(n,Lf)}if(t instanceof gn){const n={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return Tn(t.label)&&(n.label=t.label),n}else{if(t instanceof kn)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Yt)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Fn)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof Ln)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Lf(new gt({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Cn)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Lf(new gt({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof St)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof An)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof gt){const n={type:"Terminal",name:t.terminalType.name,label:Yz(t.terminalType),idx:t.idx};Tn(t.label)&&(n.terminalLabel=t.label);const r=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(n.pattern=Zr(r)?r.source:r),n}else{if(t instanceof Oa)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}class Fa{visit(e){const n=e;switch(n.constructor){case gn:return this.visitNonTerminal(n);case kn:return this.visitAlternative(n);case Yt:return this.visitOption(n);case Fn:return this.visitRepetitionMandatory(n);case Ln:return this.visitRepetitionMandatoryWithSeparator(n);case Cn:return this.visitRepetitionWithSeparator(n);case St:return this.visitRepetition(n);case An:return this.visitAlternation(n);case gt:return this.visitTerminal(n);case Oa:return this.visitRule(n);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function Qz(t){return t instanceof kn||t instanceof Yt||t instanceof St||t instanceof Fn||t instanceof Ln||t instanceof Cn||t instanceof gt||t instanceof Oa}function Mf(t,e=[]){return t instanceof Yt||t instanceof St||t instanceof Cn?!0:t instanceof An?IR(t.definition,r=>Mf(r,e)):t instanceof gn&&hn(e,t)?!1:t instanceof xr?(t instanceof gn&&e.push(t),ur(t.definition,r=>Mf(r,e))):!1}function Zz(t){return t instanceof An}function Ir(t){if(t instanceof gn)return"SUBRULE";if(t instanceof Yt)return"OPTION";if(t instanceof An)return"OR";if(t instanceof Fn)return"AT_LEAST_ONE";if(t instanceof Ln)return"AT_LEAST_ONE_SEP";if(t instanceof Cn)return"MANY_SEP";if(t instanceof St)return"MANY";if(t instanceof gt)return"CONSUME";throw Error("non exhaustive match")}class zf{walk(e,n=[]){Re(e.definition,(r,i)=>{const s=Kt(e.definition,i+1);if(r instanceof gn)this.walkProdRef(r,s,n);else if(r instanceof gt)this.walkTerminal(r,s,n);else if(r instanceof kn)this.walkFlat(r,s,n);else if(r instanceof Yt)this.walkOption(r,s,n);else if(r instanceof Fn)this.walkAtLeastOne(r,s,n);else if(r instanceof Ln)this.walkAtLeastOneSep(r,s,n);else if(r instanceof Cn)this.walkManySep(r,s,n);else if(r instanceof St)this.walkMany(r,s,n);else if(r instanceof An)this.walkOr(r,s,n);else throw Error("non exhaustive match")})}walkTerminal(e,n,r){}walkProdRef(e,n,r){}walkFlat(e,n,r){const i=n.concat(r);this.walk(e,i)}walkOption(e,n,r){const i=n.concat(r);this.walk(e,i)}walkAtLeastOne(e,n,r){const i=[new Yt({definition:e.definition})].concat(n,r);this.walk(e,i)}walkAtLeastOneSep(e,n,r){const i=MR(e,n,r);this.walk(e,i)}walkMany(e,n,r){const i=[new Yt({definition:e.definition})].concat(n,r);this.walk(e,i)}walkManySep(e,n,r){const i=MR(e,n,r);this.walk(e,i)}walkOr(e,n,r){const i=n.concat(r);Re(e.definition,s=>{const a=new kn({definition:[s]});this.walk(a,i)})}}function MR(t,e,n){return[new Yt({definition:[new gt({terminalType:t.separator})].concat(t.definition)})].concat(e,n)}function Pu(t){if(t instanceof gn)return Pu(t.referencedRule);if(t instanceof gt)return nB(t);if(Qz(t))return eB(t);if(Zz(t))return tB(t);throw Error("non exhaustive match")}function eB(t){let e=[];const n=t.definition;let r=0,i=n.length>r,s,a=!0;for(;i&&a;)s=n[r],a=Mf(s),e=e.concat(Pu(s)),r=r+1,i=n.length>r;return ey(e)}function tB(t){const e=he(t.definition,n=>Pu(n));return ey(Yn(e))}function nB(t){return[t.terminalType]}const zR="_~IN~_";class rB extends zf{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,n,r){}walkProdRef(e,n,r){const i=sB(e.referencedRule,e.idx)+this.topProd.name,s=n.concat(r),a=new kn({definition:s}),o=Pu(a);this.follows[i]=o}}function iB(t){const e={};return Re(t,n=>{const r=new rB(n).startWalking();In(e,r)}),e}function sB(t,e){return t.name+e+zR}let Bf={};const aB=new hE;function qf(t){const e=t.toString();if(Bf.hasOwnProperty(e))return Bf[e];{const n=aB.pattern(e);return Bf[e]=n,n}}function oB(){Bf={}}const BR="Complement Sets are not supported for first char optimization",Gf=`Unable to use "first char" lexer optimizations:
13
+ `;function uB(t,e=!1){try{const n=qf(t);return ny(n.value,{},n.flags.ignoreCase)}catch(n){if(n.message===BR)e&&OR(`${Gf} Unable to optimize: < ${t.toString()} >
14
+ Complement Sets cannot be automatically optimized.
15
+ This will disable the lexer's first char optimizations.
16
+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let r="";e&&(r=`
17
+ This will disable the lexer's first char optimizations.
18
+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),ty(`${Gf}
19
+ Failed parsing: < ${t.toString()} >
20
+ Using the @chevrotain/regexp-to-ast library
21
+ Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+r)}}return[]}function ny(t,e,n){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)ny(t.value[i],e,n);break;case"Alternative":const r=t.value;for(let i=0;i<r.length;i++){const s=r[i];switch(s.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const a=s;switch(a.type){case"Character":jf(a.value,e,n);break;case"Set":if(a.complement===!0)throw Error(BR);Re(a.value,u=>{if(typeof u=="number")jf(u,e,n);else{const c=u;if(n===!0)for(let l=c.from;l<=c.to;l++)jf(l,e,n);else{for(let l=c.from;l<=c.to&&l<Iu;l++)jf(l,e,n);if(c.to>=Iu){const l=c.from>=Iu?c.from:Iu,d=c.to,f=Pi(l),p=Pi(d);for(let h=f;h<=p;h++)e[h]=h}}}});break;case"Group":ny(a.value,e,n);break;default:throw Error("Non Exhaustive Match")}const o=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type==="Group"&&ry(a)===!1||a.type!=="Group"&&o===!1)break}break;default:throw Error("non exhaustive match!")}return Mt(e)}function jf(t,e,n){const r=Pi(t);e[r]=r,n===!0&&cB(t,e)}function cB(t,e){const n=String.fromCharCode(t),r=n.toUpperCase();if(r!==n){const i=Pi(r.charCodeAt(0));e[i]=i}else{const i=n.toLowerCase();if(i!==n){const s=Pi(i.charCodeAt(0));e[s]=s}}}function qR(t,e){return Na(t.value,n=>{if(typeof n=="number")return hn(e,n);{const r=n;return Na(e,i=>r.from<=i&&i<=r.to)!==void 0}})}function ry(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Ve(t.value)?ur(t.value,ry):ry(t.value):!1}class lB extends yf{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return}super.visitChildren(e)}}visitCharacter(e){hn(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?qR(e,this.targetCharCodes)===void 0&&(this.found=!0):qR(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function iy(t,e){if(e instanceof RegExp){const n=qf(e),r=new lB(t);return r.visit(n),r.found}else return Na(e,n=>hn(t,n.charCodeAt(0)))!==void 0}const Ds="PATTERN",xu="defaultMode",Uf="modes";let GR=typeof new RegExp("(?:)").sticky=="boolean";function dB(t,e){e=Zg(e,{useSticky:GR,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
22
+ `],tracer:(E,$)=>$()});const n=e.tracer;n("initCharCodeToOptimizedIndexMap",()=>{NB()});let r;n("Reject Lexer.NA",()=>{r=Ff(t,E=>E[Ds]===_n.NA)});let i=!1,s;n("Transform Patterns",()=>{i=!1,s=he(r,E=>{const $=E[Ds];if(Zr($)){const k=$.source;return k.length===1&&k!=="^"&&k!=="$"&&k!=="."&&!$.ignoreCase?k:k.length===2&&k[0]==="\\"&&!hn(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],k[1])?k[1]:e.useSticky?UR($):jR($)}else{if(Xr($))return i=!0,{exec:$};if(typeof $=="object")return i=!0,$;if(typeof $=="string"){if($.length===1)return $;{const k=$.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),A=new RegExp(k);return e.useSticky?UR(A):jR(A)}}else throw Error("non exhaustive match")}})});let a,o,u,c,l;n("misc mapping",()=>{a=he(r,E=>E.tokenTypeIdx),o=he(r,E=>{const $=E.GROUP;if($!==_n.SKIPPED){if(Tn($))return $;if(ei($))return!1;throw Error("non exhaustive match")}}),u=he(r,E=>{const $=E.LONGER_ALT;if($)return Ve($)?he($,A=>PR(r,A)):[PR(r,$)]}),c=he(r,E=>E.PUSH_MODE),l=he(r,E=>$e(E,"POP_MODE"))});let d;n("Line Terminator Handling",()=>{const E=VR(e.lineTerminatorCharacters);d=he(r,$=>!1),e.positionTracking!=="onlyOffset"&&(d=he(r,$=>$e($,"LINE_BREAKS")?!!$.LINE_BREAKS:HR($,E)===!1&&iy(E,$.PATTERN)))});let f,p,h,y;n("Misc Mapping #2",()=>{f=he(r,WR),p=he(s,PB),h=mn(r,(E,$)=>{const k=$.GROUP;return Tn(k)&&k!==_n.SKIPPED&&(E[k]=[]),E},{}),y=he(s,(E,$)=>({pattern:s[$],longerAlt:u[$],canLineTerminator:d[$],isCustom:f[$],short:p[$],group:o[$],push:c[$],pop:l[$],tokenTypeIdx:a[$],tokenType:r[$]}))});let b=!0,w=[];return e.safeMode||n("First Char Optimization",()=>{w=mn(r,(E,$,k)=>{if(typeof $.PATTERN=="string"){const A=$.PATTERN.charCodeAt(0),I=Pi(A);sy(E,I,y[k])}else if(Ve($.START_CHARS_HINT)){let A;Re($.START_CHARS_HINT,I=>{const M=typeof I=="string"?I.charCodeAt(0):I,Y=Pi(M);A!==Y&&(A=Y,sy(E,Y,y[k]))})}else if(Zr($.PATTERN))if($.PATTERN.unicode)b=!1,e.ensureOptimizations&&ty(`${Gf} Unable to analyze < ${$.PATTERN.toString()} > pattern.
23
+ The regexp unicode flag is not currently supported by the regexp-to-ast library.
24
+ This will disable the lexer's first char optimizations.
25
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const A=uB($.PATTERN,e.ensureOptimizations);ut(A)&&(b=!1),Re(A,I=>{sy(E,I,y[k])})}else e.ensureOptimizations&&ty(`${Gf} TokenType: <${$.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
26
+ This will disable the lexer's first char optimizations.
27
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),b=!1;return E},[])}),{emptyGroups:h,patternIdxToConfig:y,charCodeToPatternIdxToConfig:w,hasCustom:i,canBeOptimized:b}}function fB(t,e){let n=[];const r=hB(t);n=n.concat(r.errors);const i=mB(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(pB(s)),n=n.concat(RB(s)),n=n.concat($B(s,e)),n=n.concat(SB(s)),n}function pB(t){let e=[];const n=Nn(t,r=>Zr(r[Ds]));return e=e.concat(yB(n)),e=e.concat(bB(n)),e=e.concat(DB(n)),e=e.concat(EB(n)),e=e.concat(wB(n)),e}function hB(t){const e=Nn(t,i=>!$e(i,Ds)),n=he(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:Tt.MISSING_PATTERN,tokenTypes:[i]})),r=Of(t,e);return{errors:n,valid:r}}function mB(t){const e=Nn(t,i=>{const s=i[Ds];return!Zr(s)&&!Xr(s)&&!$e(s,"exec")&&!Tn(s)}),n=he(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:Tt.INVALID_PATTERN,tokenTypes:[i]})),r=Of(t,e);return{errors:n,valid:r}}const gB=/[^\\][$]/;function yB(t){class e extends yf{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}const n=Nn(t,i=>{const s=i.PATTERN;try{const a=qf(s),o=new e;return o.visit(a),o.found}catch{return gB.test(s.source)}});return he(n,i=>({message:`Unexpected RegExp Anchor Error:
28
+ Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
29
+ See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Tt.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function wB(t){const e=Nn(t,r=>r.PATTERN.test(""));return he(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:Tt.EMPTY_MATCH_PATTERN,tokenTypes:[r]}))}const vB=/[^\\[][\^]|^\^/;function bB(t){class e extends yf{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}const n=Nn(t,i=>{const s=i.PATTERN;try{const a=qf(s),o=new e;return o.visit(a),o.found}catch{return vB.test(s.source)}});return he(n,i=>({message:`Unexpected RegExp Anchor Error:
30
+ Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
31
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:Tt.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function DB(t){const e=Nn(t,r=>{const i=r[Ds];return i instanceof RegExp&&(i.multiline||i.global)});return he(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:Tt.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}))}function EB(t){const e=[];let n=he(t,s=>mn(t,(a,o)=>(s.PATTERN.source===o.PATTERN.source&&!hn(e,o)&&o.PATTERN!==_n.NA&&(e.push(o),a.push(o)),a),[]));n=Au(n);const r=Nn(n,s=>s.length>1);return he(r,s=>{const a=he(s,u=>u.name);return{message:`The same RegExp pattern ->${cr(s).PATTERN}<-has been used in all of the following Token Types: ${a.join(", ")} <-`,type:Tt.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}function RB(t){const e=Nn(t,r=>{if(!$e(r,"GROUP"))return!1;const i=r.GROUP;return i!==_n.SKIPPED&&i!==_n.NA&&!Tn(i)});return he(e,r=>({message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:Tt.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}))}function $B(t,e){const n=Nn(t,i=>i.PUSH_MODE!==void 0&&!hn(e,i.PUSH_MODE));return he(n,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:Tt.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function SB(t){const e=[],n=mn(t,(r,i,s)=>{const a=i.PATTERN;return a===_n.NA||(Tn(a)?r.push({str:a,idx:s,tokenType:i}):Zr(a)&&kB(a)&&r.push({str:a.source,idx:s,tokenType:i})),r},[]);return Re(t,(r,i)=>{Re(n,({str:s,idx:a,tokenType:o})=>{if(i<a&&TB(s,r.PATTERN)){const u=`Token: ->${o.name}<- can never be matched.
32
+ Because it appears AFTER the Token Type ->${r.name}<-in the lexer's definition.
33
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:u,type:Tt.UNREACHABLE_PATTERN,tokenTypes:[r,o]})}})}),e}function TB(t,e){if(Zr(e)){const n=e.exec(t);return n!==null&&n.index===0}else{if(Xr(e))return e(t,0,[],{});if($e(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function kB(t){return Na([".","\\","[","]","|","^","$","(",")","?","*","+","{"],n=>t.source.indexOf(n)!==-1)===void 0}function jR(t){const e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function UR(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function CB(t,e,n){const r=[];return $e(t,xu)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+xu+`> property in its definition
34
+ `,type:Tt.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),$e(t,Uf)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+Uf+`> property in its definition
35
+ `,type:Tt.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),$e(t,Uf)&&$e(t,xu)&&!$e(t.modes,t.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${xu}: <${t.defaultMode}>which does not exist
36
+ `,type:Tt.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),$e(t,Uf)&&Re(t.modes,(i,s)=>{Re(i,(a,o)=>{if(ei(a))r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${o}>
37
+ `,type:Tt.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if($e(a,"LONGER_ALT")){const u=Ve(a.LONGER_ALT)?a.LONGER_ALT:[a.LONGER_ALT];Re(u,c=>{!ei(c)&&!hn(i,c)&&r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${c.name}> on token <${a.name}> outside of mode <${s}>
38
+ `,type:Tt.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),r}function AB(t,e,n){const r=[];let i=!1;const s=Au(Yn(Mt(t.modes))),a=Ff(s,u=>u[Ds]===_n.NA),o=VR(n);return e&&Re(a,u=>{const c=HR(u,o);if(c!==!1){const d={message:IB(u,c),type:c.issue,tokenType:u};r.push(d)}else $e(u,"LINE_BREAKS")?u.LINE_BREAKS===!0&&(i=!0):iy(o,u.PATTERN)&&(i=!0)}),e&&!i&&r.push({message:`Warning: No LINE_BREAKS Found.
39
+ This Lexer has been defined to track line and column information,
40
+ But none of the Token Types can be identified as matching a line terminator.
41
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
42
+ for details.`,type:Tt.NO_LINE_BREAKS_FLAGS}),r}function _B(t){const e={},n=Kn(t);return Re(n,r=>{const i=t[r];if(Ve(i))e[r]=[];else throw Error("non exhaustive match")}),e}function WR(t){const e=t.PATTERN;if(Zr(e))return!1;if(Xr(e))return!0;if($e(e,"exec"))return!0;if(Tn(e))return!1;throw Error("non exhaustive match")}function PB(t){return Tn(t)&&t.length===1?t.charCodeAt(0):!1}const xB={test:function(t){const e=t.length;for(let n=this.lastIndex;n<e;n++){const r=t.charCodeAt(n);if(r===10)return this.lastIndex=n+1,!0;if(r===13)return t.charCodeAt(n+1)===10?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0};function HR(t,e){if($e(t,"LINE_BREAKS"))return!1;if(Zr(t.PATTERN)){try{iy(e,t.PATTERN)}catch(n){return{issue:Tt.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}else{if(Tn(t.PATTERN))return!1;if(WR(t))return{issue:Tt.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function IB(t,e){if(e.issue===Tt.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
43
+ The problem is in the <${t.name}> Token Type
44
+ Root cause: ${e.errMsg}.
45
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===Tt.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
46
+ The problem is in the <${t.name}> Token Type
47
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function VR(t){return he(t,n=>Tn(n)?n.charCodeAt(0):n)}function sy(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}const Iu=256;let Wf=[];function Pi(t){return t<Iu?t:Wf[t]}function NB(){if(ut(Wf)){Wf=new Array(65536);for(let t=0;t<65536;t++)Wf[t]=t>255?255+~~(t/255):t}}function Nu(t,e){const n=t.tokenTypeIdx;return n===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[n]===!0}function Hf(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let KR=1;const YR={};function Ou(t){const e=OB(t);FB(e),MB(e),LB(e),Re(e,n=>{n.isParent=n.categoryMatches.length>0})}function OB(t){let e=Vt(t),n=t,r=!0;for(;r;){n=Au(Yn(he(n,s=>s.CATEGORIES)));const i=Of(n,e);e=e.concat(i),ut(i)?r=!1:n=i}return e}function FB(t){Re(t,e=>{JR(e)||(YR[KR]=e,e.tokenTypeIdx=KR++),QR(e)&&!Ve(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),QR(e)||(e.CATEGORIES=[]),zB(e)||(e.categoryMatches=[]),BB(e)||(e.categoryMatchesMap={})})}function LB(t){Re(t,e=>{e.categoryMatches=[],Re(e.categoryMatchesMap,(n,r)=>{e.categoryMatches.push(YR[r].tokenTypeIdx)})})}function MB(t){Re(t,e=>{XR([],e)})}function XR(t,e){Re(t,n=>{e.categoryMatchesMap[n.tokenTypeIdx]=!0}),Re(e.CATEGORIES,n=>{const r=t.concat(e);hn(r,n)||XR(r,n)})}function JR(t){return $e(t,"tokenTypeIdx")}function QR(t){return $e(t,"CATEGORIES")}function zB(t){return $e(t,"categoryMatches")}function BB(t){return $e(t,"categoryMatchesMap")}function qB(t){return $e(t,"tokenTypeIdx")}const ay={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,n,r,i){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${n} characters.`}};var Tt;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(Tt||(Tt={}));const Fu={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
48
+ `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:ay,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Fu);class _n{constructor(e,n=Fu){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,s)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const a=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${a}--> <${i}>`);const{time:o,value:u}=FR(s),c=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&c(`${a}<-- <${i}> time: ${o}ms`),this.traceInitIndent--,u}else return s()},typeof n=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
49
+ a boolean 2nd argument is no longer supported`);this.config=In({},Fu,n);const r=this.config.traceInitPerf;r===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof r=="number"&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,s=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Fu.lineTerminatorsPattern)this.config.lineTerminatorsPattern=xB;else if(this.config.lineTerminatorCharacters===Fu.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
50
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(n.safeMode&&n.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Ve(e)?i={modes:{defaultMode:Vt(e)},defaultMode:xu}:(s=!1,i=Vt(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(CB(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(AB(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},Re(i.modes,(o,u)=>{i.modes[u]=Ff(o,c=>ei(c))});const a=Kn(i.modes);if(Re(i.modes,(o,u)=>{this.TRACE_INIT(`Mode: <${u}> processing`,()=>{if(this.modes.push(u),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(fB(o,a))}),ut(this.lexerDefinitionErrors)){Ou(o);let c;this.TRACE_INIT("analyzeTokenTypes",()=>{c=dB(o,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:n.positionTracking,ensureOptimizations:n.ensureOptimizations,safeMode:n.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[u]=c.patternIdxToConfig,this.charCodeToPatternIdxToConfig[u]=c.charCodeToPatternIdxToConfig,this.emptyGroups=In({},this.emptyGroups,c.emptyGroups),this.hasCustom=c.hasCustom||this.hasCustom,this.canModeBeOptimized[u]=c.canBeOptimized}})}),this.defaultMode=i.defaultMode,!ut(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const u=he(this.lexerDefinitionErrors,c=>c.message).join(`-----------------------
51
+ `);throw new Error(`Errors detected in definition of Lexer:
52
+ `+u)}Re(this.lexerDefinitionWarning,o=>{OR(o.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(GR?(this.chopInput=gs,this.match=this.matchWithTest):(this.updateLastIndex=Lt,this.match=this.matchWithExec),s&&(this.handleModes=Lt),this.trackStartLines===!1&&(this.computeNewColumn=gs),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Lt),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const o=mn(this.canModeBeOptimized,(u,c,l)=>(c===!1&&u.push(l),u),[]);if(n.ensureOptimizations&&!ut(o))throw Error(`Lexer Modes: < ${o.join(", ")} > cannot be optimized.
53
+ Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
54
+ Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{oB()}),this.TRACE_INIT("toFastProperties",()=>{LR(this)})})}tokenize(e,n=this.defaultMode){if(!ut(this.lexerDefinitionErrors)){const i=he(this.lexerDefinitionErrors,s=>s.message).join(`-----------------------
55
+ `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
56
+ `+i)}return this.tokenizeInternal(e,n)}tokenizeInternal(e,n){let r,i,s,a,o,u,c,l,d,f,p,h,y,b,w;const E=e,$=E.length;let k=0,A=0;const I=this.hasCustom?0:Math.floor(e.length/10),M=new Array(I),Y=[];let Q=this.trackStartLines?1:void 0,ae=this.trackStartLines?1:void 0;const O=_B(this.emptyGroups),T=this.trackStartLines,R=this.config.lineTerminatorsPattern;let F=0,V=[],W=[];const H=[],Ee=[];Object.freeze(Ee);let te;function C(){return V}function me(Fe){const ue=Pi(Fe),be=W[ue];return be===void 0?Ee:be}const ke=Fe=>{if(H.length===1&&Fe.tokenType.PUSH_MODE===void 0){const ue=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(Fe);Y.push({offset:Fe.startOffset,line:Fe.startLine,column:Fe.startColumn,length:Fe.image.length,message:ue})}else{H.pop();const ue=Ia(H);V=this.patternIdxToConfig[ue],W=this.charCodeToPatternIdxToConfig[ue],F=V.length;const be=this.canModeBeOptimized[ue]&&this.config.safeMode===!1;W&&be?te=me:te=C}};function at(Fe){H.push(Fe),W=this.charCodeToPatternIdxToConfig[Fe],V=this.patternIdxToConfig[Fe],F=V.length,F=V.length;const ue=this.canModeBeOptimized[Fe]&&this.config.safeMode===!1;W&&ue?te=me:te=C}at.call(this,n);let j;const K=this.config.recoveryEnabled;for(;k<$;){u=null;const Fe=E.charCodeAt(k),ue=te(Fe),be=ue.length;for(r=0;r<be;r++){j=ue[r];const Ce=j.pattern;c=null;const ce=j.short;if(ce!==!1?Fe===ce&&(u=Ce):j.isCustom===!0?(w=Ce.exec(E,k,M,O),w!==null?(u=w[0],w.payload!==void 0&&(c=w.payload)):u=null):(this.updateLastIndex(Ce,k),u=this.match(Ce,e,k)),u!==null){if(o=j.longerAlt,o!==void 0){const x=o.length;for(s=0;s<x;s++){const B=V[o[s]],de=B.pattern;if(l=null,B.isCustom===!0?(w=de.exec(E,k,M,O),w!==null?(a=w[0],w.payload!==void 0&&(l=w.payload)):a=null):(this.updateLastIndex(de,k),a=this.match(de,e,k)),a&&a.length>u.length){u=a,c=l,j=B;break}}}break}}if(u!==null){if(d=u.length,f=j.group,f!==void 0&&(p=j.tokenTypeIdx,h=this.createTokenInstance(u,k,p,j.tokenType,Q,ae,d),this.handlePayload(h,c),f===!1?A=this.addToken(M,A,h):O[f].push(h)),e=this.chopInput(e,d),k=k+d,ae=this.computeNewColumn(ae,d),T===!0&&j.canLineTerminator===!0){let Ce=0,ce,x;R.lastIndex=0;do ce=R.test(u),ce===!0&&(x=R.lastIndex-1,Ce++);while(ce===!0);Ce!==0&&(Q=Q+Ce,ae=d-x,this.updateTokenEndLineColumnLocation(h,f,x,Ce,Q,ae,d))}this.handleModes(j,ke,at,h)}else{const Ce=k,ce=Q,x=ae;let B=K===!1;for(;B===!1&&k<$;)for(e=this.chopInput(e,1),k++,i=0;i<F;i++){const de=V[i],q=de.pattern,le=de.short;if(le!==!1?E.charCodeAt(k)===le&&(B=!0):de.isCustom===!0?B=q.exec(E,k,M,O)!==null:(this.updateLastIndex(q,k),B=q.exec(e)!==null),B===!0)break}if(y=k-Ce,ae=this.computeNewColumn(ae,y),b=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(E,Ce,y,ce,x),Y.push({offset:Ce,line:ce,column:x,length:y,message:b}),K===!1)break}}return this.hasCustom||(M.length=A),{tokens:M,groups:O,errors:Y}}handleModes(e,n,r,i){if(e.pop===!0){const s=e.push;n(i),s!==void 0&&r.call(this,s)}else e.push!==void 0&&r.call(this,e.push)}chopInput(e,n){return e.substring(n)}updateLastIndex(e,n){e.lastIndex=n}updateTokenEndLineColumnLocation(e,n,r,i,s,a,o){let u,c;n!==void 0&&(u=r===o-1,c=u?-1:0,i===1&&u===!0||(e.endLine=s+c,e.endColumn=a-1+-c))}computeNewColumn(e,n){return e+n}createOffsetOnlyToken(e,n,r,i){return{image:e,startOffset:n,tokenTypeIdx:r,tokenType:i}}createStartOnlyToken(e,n,r,i,s,a){return{image:e,startOffset:n,startLine:s,startColumn:a,tokenTypeIdx:r,tokenType:i}}createFullToken(e,n,r,i,s,a,o){return{image:e,startOffset:n,endOffset:n+o-1,startLine:s,endLine:s,startColumn:a,endColumn:a+o-1,tokenTypeIdx:r,tokenType:i}}addTokenUsingPush(e,n,r){return e.push(r),n}addTokenUsingMemberAccess(e,n,r){return e[n]=r,n++,n}handlePayloadNoCustom(e,n){}handlePayloadWithCustom(e,n){n!==null&&(e.payload=n)}matchWithTest(e,n,r){return e.test(n)===!0?n.substring(r,e.lastIndex):null}matchWithExec(e,n){const r=e.exec(n);return r!==null?r[0]:null}}_n.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",_n.NA=/NOT_APPLICABLE/;function La(t){return ZR(t)?t.LABEL:t.name}function ZR(t){return Tn(t.LABEL)&&t.LABEL!==""}const GB="parent",e$="categories",t$="label",n$="group",r$="push_mode",i$="pop_mode",s$="longer_alt",a$="line_breaks",o$="start_chars_hint";function u$(t){return jB(t)}function jB(t){const e=t.pattern,n={};if(n.name=t.name,ei(e)||(n.PATTERN=e),$e(t,GB))throw`The parent property is no longer supported.
57
+ See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return $e(t,e$)&&(n.CATEGORIES=t[e$]),Ou([n]),$e(t,t$)&&(n.LABEL=t[t$]),$e(t,n$)&&(n.GROUP=t[n$]),$e(t,i$)&&(n.POP_MODE=t[i$]),$e(t,r$)&&(n.PUSH_MODE=t[r$]),$e(t,s$)&&(n.LONGER_ALT=t[s$]),$e(t,a$)&&(n.LINE_BREAKS=t[a$]),$e(t,o$)&&(n.START_CHARS_HINT=t[o$]),n}const xi=u$({name:"EOF",pattern:_n.NA});Ou([xi]);function oy(t,e,n,r,i,s,a,o){return{image:e,startOffset:n,endOffset:r,startLine:i,endLine:s,startColumn:a,endColumn:o,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function c$(t,e){return Nu(t,e)}const Ma={buildMismatchTokenMessage({expected:t,actual:e,previous:n,ruleName:r}){return`Expecting ${ZR(t)?`--> ${La(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",o=`
58
+ but found: '`+cr(e).image+"'";if(r)return s+r+o;{const u=mn(t,(f,p)=>f.concat(p),[]),c=he(u,f=>`[${he(f,p=>La(p)).join(", ")}]`),d=`one of these possible Token sequences:
59
+ ${he(c,(f,p)=>` ${p+1}. ${f}`).join(`
60
+ `)}`;return s+d+o}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:n,ruleName:r}){const i="Expecting: ",a=`
61
+ but found: '`+cr(e).image+"'";if(n)return i+n+a;{const u=`expecting at least one iteration which starts with one of these possible Token sequences::
62
+ <${he(t,c=>`[${he(c,l=>La(l)).join(",")}]`).join(" ,")}>`;return i+u+a}}};Object.freeze(Ma);const UB={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
63
+ inside top level rule: ->`+t.name+"<-"}},Es={buildDuplicateFoundError(t,e){function n(l){return l instanceof gt?l.terminalType.name:l instanceof gn?l.nonTerminalName:""}const r=t.name,i=cr(e),s=i.idx,a=Ir(i),o=n(i),u=s>0;let c=`->${a}${u?s:""}<- ${o?`with argument: ->${o}<-`:""}
64
+ appears more than once (${e.length} times) in the top level rule: ->${r}<-.
65
+ For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
66
+ `;return c=c.replace(/[ \t]+/g," "),c=c.replace(/\s\s+/g,`
67
+ `),c},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.
68
+ The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
69
+ To resolve this make sure each Terminal and Non-Terminal names are unique
70
+ This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
71
+ and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=he(t.prefixPath,i=>La(i)).join(", "),n=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
72
+ in <OR${n}> inside <${t.topLevelRule.name}> Rule,
73
+ <${e}> may appears as a prefix path in all these alternatives.
74
+ See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
75
+ For Further details.`},buildAlternationAmbiguityError(t){const e=he(t.prefixPath,i=>La(i)).join(", "),n=t.alternation.idx===0?"":t.alternation.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${n}> inside <${t.topLevelRule.name}> Rule,
76
+ <${e}> may appears as a prefix path in all these alternatives.
77
+ `;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
78
+ For Further details.`,r},buildEmptyRepetitionError(t){let e=Ir(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
79
+ This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
80
+ Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
81
+ <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
82
+ has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,n=he(t.leftRecursionPath,s=>s.name),r=`${e} --> ${n.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
83
+ rule: <${e}> can be invoked from itself (directly or indirectly)
84
+ without consuming any Tokens. The grammar path that causes this is:
85
+ ${r}
86
+ To fix this refactor your grammar to remove the left recursion.
87
+ see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Oa?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function WB(t,e){const n=new HB(t,e);return n.resolveRefs(),n.errors}class HB extends Fa{constructor(e,n){super(),this.nameToTopRule=e,this.errMsgProvider=n,this.errors=[]}resolveRefs(){Re(Mt(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const n=this.nameToTopRule[e.nonTerminalName];if(n)e.referencedRule=n;else{const r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:yn.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class VB extends zf{constructor(e,n){super(),this.topProd=e,this.path=n,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=Vt(this.path.ruleStack).reverse(),this.occurrenceStack=Vt(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,n=[]){this.found||super.walk(e,n)}walkProdRef(e,n,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=n.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){ut(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class KB extends VB{constructor(e,n){super(e,n),this.path=n,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,n,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=n.concat(r),s=new kn({definition:i});this.possibleTokTypes=Pu(s),this.found=!0}}}class Vf extends zf{constructor(e,n){super(),this.topRule=e,this.occurrence=n,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class YB extends Vf{walkMany(e,n,r){if(e.idx===this.occurrence){const i=cr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof gt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,n,r)}}class l$ extends Vf{walkManySep(e,n,r){if(e.idx===this.occurrence){const i=cr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof gt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,n,r)}}class XB extends Vf{walkAtLeastOne(e,n,r){if(e.idx===this.occurrence){const i=cr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof gt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,n,r)}}class d$ extends Vf{walkAtLeastOneSep(e,n,r){if(e.idx===this.occurrence){const i=cr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof gt&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,n,r)}}function uy(t,e,n=[]){n=Vt(n);let r=[],i=0;function s(o){return o.concat(Kt(t,i+1))}function a(o){const u=uy(s(o),e,n);return r.concat(u)}for(;n.length<e&&i<t.length;){const o=t[i];if(o instanceof kn)return a(o.definition);if(o instanceof gn)return a(o.definition);if(o instanceof Yt)r=a(o.definition);else if(o instanceof Fn){const u=o.definition.concat([new St({definition:o.definition})]);return a(u)}else if(o instanceof Ln){const u=[new kn({definition:o.definition}),new St({definition:[new gt({terminalType:o.separator})].concat(o.definition)})];return a(u)}else if(o instanceof Cn){const u=o.definition.concat([new St({definition:[new gt({terminalType:o.separator})].concat(o.definition)})]);r=a(u)}else if(o instanceof St){const u=o.definition.concat([new St({definition:o.definition})]);r=a(u)}else{if(o instanceof An)return Re(o.definition,u=>{ut(u.definition)===!1&&(r=a(u.definition))}),r;if(o instanceof gt)n.push(o.terminalType);else throw Error("non exhaustive match")}i++}return r.push({partialPath:n,suffixDef:Kt(t,i)}),r}function f$(t,e,n,r){const i="EXIT_NONE_TERMINAL",s=[i],a="EXIT_ALTERNATIVE";let o=!1;const u=e.length,c=u-r-1,l=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!ut(d);){const f=d.pop();if(f===a){o&&Ia(d).idx<=c&&d.pop();continue}const p=f.def,h=f.idx,y=f.ruleStack,b=f.occurrenceStack;if(ut(p))continue;const w=p[0];if(w===i){const E={idx:h,def:Kt(p),ruleStack:_u(y),occurrenceStack:_u(b)};d.push(E)}else if(w instanceof gt)if(h<u-1){const E=h+1,$=e[E];if(n($,w.terminalType)){const k={idx:E,def:Kt(p),ruleStack:y,occurrenceStack:b};d.push(k)}}else if(h===u-1)l.push({nextTokenType:w.terminalType,nextTokenOccurrence:w.idx,ruleStack:y,occurrenceStack:b}),o=!0;else throw Error("non exhaustive match");else if(w instanceof gn){const E=Vt(y);E.push(w.nonTerminalName);const $=Vt(b);$.push(w.idx);const k={idx:h,def:w.definition.concat(s,Kt(p)),ruleStack:E,occurrenceStack:$};d.push(k)}else if(w instanceof Yt){const E={idx:h,def:Kt(p),ruleStack:y,occurrenceStack:b};d.push(E),d.push(a);const $={idx:h,def:w.definition.concat(Kt(p)),ruleStack:y,occurrenceStack:b};d.push($)}else if(w instanceof Fn){const E=new St({definition:w.definition,idx:w.idx}),$=w.definition.concat([E],Kt(p)),k={idx:h,def:$,ruleStack:y,occurrenceStack:b};d.push(k)}else if(w instanceof Ln){const E=new gt({terminalType:w.separator}),$=new St({definition:[E].concat(w.definition),idx:w.idx}),k=w.definition.concat([$],Kt(p)),A={idx:h,def:k,ruleStack:y,occurrenceStack:b};d.push(A)}else if(w instanceof Cn){const E={idx:h,def:Kt(p),ruleStack:y,occurrenceStack:b};d.push(E),d.push(a);const $=new gt({terminalType:w.separator}),k=new St({definition:[$].concat(w.definition),idx:w.idx}),A=w.definition.concat([k],Kt(p)),I={idx:h,def:A,ruleStack:y,occurrenceStack:b};d.push(I)}else if(w instanceof St){const E={idx:h,def:Kt(p),ruleStack:y,occurrenceStack:b};d.push(E),d.push(a);const $=new St({definition:w.definition,idx:w.idx}),k=w.definition.concat([$],Kt(p)),A={idx:h,def:k,ruleStack:y,occurrenceStack:b};d.push(A)}else if(w instanceof An)for(let E=w.definition.length-1;E>=0;E--){const $=w.definition[E],k={idx:h,def:$.definition.concat(Kt(p)),ruleStack:y,occurrenceStack:b};d.push(k),d.push(a)}else if(w instanceof kn)d.push({idx:h,def:w.definition.concat(Kt(p)),ruleStack:y,occurrenceStack:b});else if(w instanceof Oa)d.push(JB(w,h,y,b));else throw Error("non exhaustive match")}return l}function JB(t,e,n,r){const i=Vt(n);i.push(t.name);const s=Vt(r);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}var bt;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(bt||(bt={}));function cy(t){if(t instanceof Yt||t==="Option")return bt.OPTION;if(t instanceof St||t==="Repetition")return bt.REPETITION;if(t instanceof Fn||t==="RepetitionMandatory")return bt.REPETITION_MANDATORY;if(t instanceof Ln||t==="RepetitionMandatoryWithSeparator")return bt.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof Cn||t==="RepetitionWithSeparator")return bt.REPETITION_WITH_SEPARATOR;if(t instanceof An||t==="Alternation")return bt.ALTERNATION;throw Error("non exhaustive match")}function p$(t){const{occurrence:e,rule:n,prodType:r,maxLookahead:i}=t,s=cy(r);return s===bt.ALTERNATION?Kf(e,n,i):Yf(e,n,s,i)}function QB(t,e,n,r,i,s){const a=Kf(t,e,n),o=y$(a)?Hf:Nu;return s(a,r,o,i)}function ZB(t,e,n,r,i,s){const a=Yf(t,e,i,n),o=y$(a)?Hf:Nu;return s(a[0],o,r)}function e3(t,e,n,r){const i=t.length,s=ur(t,a=>ur(a,o=>o.length===1));if(e)return function(a){const o=he(a,u=>u.GATE);for(let u=0;u<i;u++){const c=t[u],l=c.length,d=o[u];if(!(d!==void 0&&d.call(this)===!1))e:for(let f=0;f<l;f++){const p=c[f],h=p.length;for(let y=0;y<h;y++){const b=this.LA(y+1);if(n(b,p[y])===!1)continue e}return u}}};if(s&&!r){const a=he(t,u=>Yn(u)),o=mn(a,(u,c,l)=>(Re(c,d=>{$e(u,d.tokenTypeIdx)||(u[d.tokenTypeIdx]=l),Re(d.categoryMatches,f=>{$e(u,f)||(u[f]=l)})}),u),{});return function(){const u=this.LA(1);return o[u.tokenTypeIdx]}}else return function(){for(let a=0;a<i;a++){const o=t[a],u=o.length;e:for(let c=0;c<u;c++){const l=o[c],d=l.length;for(let f=0;f<d;f++){const p=this.LA(f+1);if(n(p,l[f])===!1)continue e}return a}}}}function t3(t,e,n){const r=ur(t,s=>s.length===1),i=t.length;if(r&&!n){const s=Yn(t);if(s.length===1&&ut(s[0].categoryMatches)){const o=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===o}}else{const a=mn(s,(o,u,c)=>(o[u.tokenTypeIdx]=!0,Re(u.categoryMatches,l=>{o[l]=!0}),o),[]);return function(){const o=this.LA(1);return a[o.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;s<i;s++){const a=t[s],o=a.length;for(let u=0;u<o;u++){const c=this.LA(u+1);if(e(c,a[u])===!1)continue e}return!0}return!1}}class n3 extends zf{constructor(e,n,r){super(),this.topProd=e,this.targetOccurrence=n,this.targetProdType=r}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,n,r,i){return e.idx===this.targetOccurrence&&this.targetProdType===n?(this.restDef=r.concat(i),!0):!1}walkOption(e,n,r){this.checkIsTarget(e,bt.OPTION,n,r)||super.walkOption(e,n,r)}walkAtLeastOne(e,n,r){this.checkIsTarget(e,bt.REPETITION_MANDATORY,n,r)||super.walkOption(e,n,r)}walkAtLeastOneSep(e,n,r){this.checkIsTarget(e,bt.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}walkMany(e,n,r){this.checkIsTarget(e,bt.REPETITION,n,r)||super.walkOption(e,n,r)}walkManySep(e,n,r){this.checkIsTarget(e,bt.REPETITION_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}}class h$ extends Fa{constructor(e,n,r){super(),this.targetOccurrence=e,this.targetProdType=n,this.targetRef=r,this.result=[]}checkIsTarget(e,n){e.idx===this.targetOccurrence&&this.targetProdType===n&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,bt.OPTION)}visitRepetition(e){this.checkIsTarget(e,bt.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,bt.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,bt.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,bt.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,bt.ALTERNATION)}}function m$(t){const e=new Array(t);for(let n=0;n<t;n++)e[n]=[];return e}function ly(t){let e=[""];for(let n=0;n<t.length;n++){const r=t[n],i=[];for(let s=0;s<e.length;s++){const a=e[s];i.push(a+"_"+r.tokenTypeIdx);for(let o=0;o<r.categoryMatches.length;o++){const u="_"+r.categoryMatches[o];i.push(a+u)}}e=i}return e}function r3(t,e,n){for(let r=0;r<t.length;r++){if(r===n)continue;const i=t[r];for(let s=0;s<e.length;s++){const a=e[s];if(i[a]===!0)return!1}}return!0}function g$(t,e){const n=he(t,a=>uy([a],1)),r=m$(n.length),i=he(n,a=>{const o={};return Re(a,u=>{const c=ly(u.partialPath);Re(c,l=>{o[l]=!0})}),o});let s=n;for(let a=1;a<=e;a++){const o=s;s=m$(o.length);for(let u=0;u<o.length;u++){const c=o[u];for(let l=0;l<c.length;l++){const d=c[l].partialPath,f=c[l].suffixDef,p=ly(d);if(r3(i,p,u)||ut(f)||d.length===e){const y=r[u];if(dy(y,d)===!1){y.push(d);for(let b=0;b<p.length;b++){const w=p[b];i[u][w]=!0}}}else{const y=uy(f,a+1,d);s[u]=s[u].concat(y),Re(y,b=>{const w=ly(b.partialPath);Re(w,E=>{i[u][E]=!0})})}}}}return r}function Kf(t,e,n,r){const i=new h$(t,bt.ALTERNATION,r);return e.accept(i),g$(i.result,n)}function Yf(t,e,n,r){const i=new h$(t,n);e.accept(i);const s=i.result,o=new n3(e,t,n).startWalking(),u=new kn({definition:s}),c=new kn({definition:o});return g$([u,c],r)}function dy(t,e){e:for(let n=0;n<t.length;n++){const r=t[n];if(r.length===e.length){for(let i=0;i<r.length;i++){const s=e[i],a=r[i];if((s===a||a.categoryMatchesMap[s.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function i3(t,e){return t.length<e.length&&ur(t,(n,r)=>{const i=e[r];return n===i||i.categoryMatchesMap[n.tokenTypeIdx]})}function y$(t){return ur(t,e=>ur(e,n=>ur(n,r=>ut(r.categoryMatches))))}function s3(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return he(e,n=>Object.assign({type:yn.CUSTOM_LOOKAHEAD_VALIDATION},n))}function a3(t,e,n,r){const i=On(t,u=>o3(u,n)),s=v3(t,e,n),a=On(t,u=>m3(u,n)),o=On(t,u=>l3(u,t,r,n));return i.concat(s,a,o)}function o3(t,e){const n=new c3;t.accept(n);const r=n.allProductions,i=Rz(r,u3),s=lr(i,o=>o.length>1);return he(Mt(s),o=>{const u=cr(o),c=e.buildDuplicateFoundError(t,o),l=Ir(u),d={message:c,type:yn.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:l,occurrence:u.idx},f=w$(u);return f&&(d.parameter=f),d})}function u3(t){return`${Ir(t)}_#_${t.idx}_#_${w$(t)}`}function w$(t){return t instanceof gt?t.terminalType.name:t instanceof gn?t.nonTerminalName:""}class c3 extends Fa{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function l3(t,e,n,r){const i=[];if(mn(e,(a,o)=>o.name===t.name?a+1:a,0)>1){const a=r.buildDuplicateRuleNameError({topLevelRule:t,grammarName:n});i.push({message:a,type:yn.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function d3(t,e,n){const r=[];let i;return hn(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:yn.INVALID_RULE_OVERRIDE,ruleName:t})),r}function v$(t,e,n,r=[]){const i=[],s=Xf(e.definition);if(ut(s))return[];{const a=t.name;hn(s,t)&&i.push({message:n.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:r}),type:yn.LEFT_RECURSION,ruleName:a});const u=Of(s,r.concat([t])),c=On(u,l=>{const d=Vt(r);return d.push(l),v$(t,l,n,d)});return i.concat(c)}}function Xf(t){let e=[];if(ut(t))return e;const n=cr(t);if(n instanceof gn)e.push(n.referencedRule);else if(n instanceof kn||n instanceof Yt||n instanceof Fn||n instanceof Ln||n instanceof Cn||n instanceof St)e=e.concat(Xf(n.definition));else if(n instanceof An)e=Yn(he(n.definition,s=>Xf(s.definition)));else if(!(n instanceof gt))throw Error("non exhaustive match");const r=Mf(n),i=t.length>1;if(r&&i){const s=Kt(t);return e.concat(Xf(s))}else return e}class fy extends Fa{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function f3(t,e){const n=new fy;t.accept(n);const r=n.alternations;return On(r,s=>{const a=_u(s.definition);return On(a,(o,u)=>{const c=f$([o],[],Nu,1);return ut(c)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:u}),type:yn.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:u+1}]:[]})})}function p3(t,e,n){const r=new fy;t.accept(r);let i=r.alternations;return i=Ff(i,a=>a.ignoreAmbiguities===!0),On(i,a=>{const o=a.idx,u=a.maxLookahead||e,c=Kf(o,t,u,a),l=y3(c,a,t,n),d=w3(c,a,t,n);return l.concat(d)})}class h3 extends Fa{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}function m3(t,e){const n=new fy;t.accept(n);const r=n.alternations;return On(r,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:yn.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}function g3(t,e,n){const r=[];return Re(t,i=>{const s=new h3;i.accept(s);const a=s.allProductions;Re(a,o=>{const u=cy(o),c=o.maxLookahead||e,l=o.idx,f=Yf(l,i,u,c)[0];if(ut(Yn(f))){const p=n.buildEmptyRepetitionError({topLevelRule:i,repetition:o});r.push({message:p,type:yn.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),r}function y3(t,e,n,r){const i=[],s=mn(t,(o,u,c)=>(e.definition[c].ignoreAmbiguities===!0||Re(u,l=>{const d=[c];Re(t,(f,p)=>{c!==p&&dy(f,l)&&e.definition[p].ignoreAmbiguities!==!0&&d.push(p)}),d.length>1&&!dy(i,l)&&(i.push(l),o.push({alts:d,path:l}))}),o),[]);return he(s,o=>{const u=he(o.alts,l=>l+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:u,prefixPath:o.path}),type:yn.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:e.idx,alternatives:o.alts}})}function w3(t,e,n,r){const i=mn(t,(a,o,u)=>{const c=he(o,l=>({idx:u,path:l}));return a.concat(c)},[]);return Au(On(i,a=>{if(e.definition[a.idx].ignoreAmbiguities===!0)return[];const u=a.idx,c=a.path,l=Nn(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx<u&&i3(f.path,c));return he(l,f=>{const p=[f.idx+1,u+1],h=e.idx===0?"":e.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:p,prefixPath:f.path}),type:yn.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:h,alternatives:p}})}))}function v3(t,e,n){const r=[],i=he(e,s=>s.name);return Re(t,s=>{const a=s.name;if(hn(i,a)){const o=n.buildNamespaceConflictError(s);r.push({message:o,type:yn.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:a})}}),r}function b3(t){const e=Zg(t,{errMsgProvider:UB}),n={};return Re(t.rules,r=>{n[r.name]=r}),WB(n,e.errMsgProvider)}function D3(t){return t=Zg(t,{errMsgProvider:Es}),a3(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}const b$="MismatchedTokenException",D$="NoViableAltException",E$="EarlyExitException",R$="NotAllInputParsedException",$$=[b$,D$,E$,R$];Object.freeze($$);function Jf(t){return hn($$,t.name)}class Qf extends Error{constructor(e,n){super(e),this.token=n,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class S$ extends Qf{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=b$}}class E3 extends Qf{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=D$}}class R3 extends Qf{constructor(e,n){super(e,n),this.name=R$}}class $3 extends Qf{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=E$}}const py={},T$="InRuleRecoveryException";class S3 extends Error{constructor(e){super(e),this.name=T$}}class T3{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=$e(e,"recoveryEnabled")?e.recoveryEnabled:ti.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=k3)}getTokenToInsert(e){const n=oy(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return n.isInsertedInRecovery=!0,n}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,n,r,i){const s=this.findReSyncTokenType(),a=this.exportLexerState(),o=[];let u=!1;const c=this.LA(1);let l=this.LA(1);const d=()=>{const f=this.LA(0),p=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:c,previous:f,ruleName:this.getCurrRuleFullName()}),h=new S$(p,c,this.LA(0));h.resyncedTokens=_u(o),this.SAVE_ERROR(h)};for(;!u;)if(this.tokenMatcher(l,i)){d();return}else if(r.call(this)){d(),e.apply(this,n);return}else this.tokenMatcher(l,s)?u=!0:(l=this.SKIP_TOKEN(),this.addToResyncTokens(l,o));this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,n,r){return!(r===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,n)))}getFollowsForInRuleRecovery(e,n){const r=this.getCurrentGrammarPath(e,n);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(e,n){if(this.canRecoverWithSingleTokenInsertion(e,n))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new S3("sad sad panda")}canPerformInRuleRecovery(e,n){return this.canRecoverWithSingleTokenInsertion(e,n)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,n){if(!this.canTokenTypeBeInsertedInRecovery(e)||ut(n))return!1;const r=this.LA(1);return Na(n,s=>this.tokenMatcher(r,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const n=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(n);return hn(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let n=this.LA(1),r=2;for(;;){const i=Na(e,s=>c$(n,s));if(i!==void 0)return i;n=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return py;const e=this.getLastExplicitRuleShortName(),n=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:n,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK;return he(e,(r,i)=>i===0?py:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:n[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=he(this.buildFullFollowKeyStack(),n=>this.getFollowSetFromFollowKey(n));return Yn(e)}getFollowSetFromFollowKey(e){if(e===py)return[xi];const n=e.ruleName+e.idxInCallingRule+zR+e.inRule;return this.resyncFollows[n]}addToResyncTokens(e,n){return this.tokenMatcher(e,xi)||n.push(e),n}reSyncTo(e){const n=[];let r=this.LA(1);for(;this.tokenMatcher(r,e)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,n);return _u(n)}attemptInRepetitionRecovery(e,n,r,i,s,a,o){}getCurrentGrammarPath(e,n){const r=this.getHumanReadableRuleStack(),i=Vt(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:i,lastTok:e,lastTokOccurrence:n}}getHumanReadableRuleStack(){return he(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function k3(t,e,n,r,i,s,a){const o=this.getKeyForAutomaticLookahead(r,i);let u=this.firstAfterRepMap[o];if(u===void 0){const f=this.getCurrRuleFullName(),p=this.getGAstProductions()[f];u=new s(p,i).startWalking(),this.firstAfterRepMap[o]=u}let c=u.token,l=u.occurrence;const d=u.isEndOfRule;this.RULE_STACK.length===1&&d&&c===void 0&&(c=xi,l=1),!(c===void 0||l===void 0)&&this.shouldInRepetitionRecoveryBeTried(c,l,a)&&this.tryInRepetitionRecovery(t,e,n,c)}const C3=4,Ii=8,k$=1<<Ii,C$=2<<Ii,hy=3<<Ii,my=4<<Ii,gy=5<<Ii,Zf=6<<Ii;function yy(t,e,n){return n|e|t}class wy{constructor(e){var n;this.maxLookahead=(n=e?.maxLookahead)!==null&&n!==void 0?n:ti.maxLookahead}validate(e){const n=this.validateNoLeftRecursion(e.rules);if(ut(n)){const r=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),s=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...n,...r,...i,...s]}return n}validateNoLeftRecursion(e){return On(e,n=>v$(n,n,Es))}validateEmptyOrAlternatives(e){return On(e,n=>f3(n,Es))}validateAmbiguousAlternationAlternatives(e,n){return On(e,r=>p3(r,n,Es))}validateSomeNonEmptyLookaheadPath(e,n){return g3(e,n,Es)}buildLookaheadForAlternation(e){return QB(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,e3)}buildLookaheadForOptional(e){return ZB(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,cy(e.prodType),t3)}}class A3{initLooksAhead(e){this.dynamicTokensEnabled=$e(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:ti.dynamicTokensEnabled,this.maxLookahead=$e(e,"maxLookahead")?e.maxLookahead:ti.maxLookahead,this.lookaheadStrategy=$e(e,"lookaheadStrategy")?e.lookaheadStrategy:new wy({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){Re(e,n=>{this.TRACE_INIT(`${n.name} Rule Lookahead`,()=>{const{alternation:r,repetition:i,option:s,repetitionMandatory:a,repetitionMandatoryWithSeparator:o,repetitionWithSeparator:u}=P3(n);Re(r,c=>{const l=c.idx===0?"":c.idx;this.TRACE_INIT(`${Ir(c)}${l}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:c.idx,rule:n,maxLookahead:c.maxLookahead||this.maxLookahead,hasPredicates:c.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=yy(this.fullRuleNameToShort[n.name],k$,c.idx);this.setLaFuncCache(f,d)})}),Re(i,c=>{this.computeLookaheadFunc(n,c.idx,hy,"Repetition",c.maxLookahead,Ir(c))}),Re(s,c=>{this.computeLookaheadFunc(n,c.idx,C$,"Option",c.maxLookahead,Ir(c))}),Re(a,c=>{this.computeLookaheadFunc(n,c.idx,my,"RepetitionMandatory",c.maxLookahead,Ir(c))}),Re(o,c=>{this.computeLookaheadFunc(n,c.idx,Zf,"RepetitionMandatoryWithSeparator",c.maxLookahead,Ir(c))}),Re(u,c=>{this.computeLookaheadFunc(n,c.idx,gy,"RepetitionWithSeparator",c.maxLookahead,Ir(c))})})})}computeLookaheadFunc(e,n,r,i,s,a){this.TRACE_INIT(`${a}${n===0?"":n}`,()=>{const o=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:n,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),u=yy(this.fullRuleNameToShort[e.name],r,n);this.setLaFuncCache(u,o)})}getKeyForAutomaticLookahead(e,n){const r=this.getLastExplicitRuleShortName();return yy(r,e,n)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,n){this.lookAheadFuncsCache.set(e,n)}}class _3 extends Fa{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}}const ep=new _3;function P3(t){ep.reset(),t.accept(ep);const e=ep.dslMethods;return ep.reset(),e}function A$(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function _$(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function x3(t,e,n){t.children[n]===void 0?t.children[n]=[e]:t.children[n].push(e)}function I3(t,e,n){t.children[e]===void 0?t.children[e]=[n]:t.children[e].push(n)}const N3="name";function P$(t,e){Object.defineProperty(t,N3,{enumerable:!1,configurable:!0,writable:!1,value:e})}function O3(t,e){const n=Kn(t),r=n.length;for(let i=0;i<r;i++){const s=n[i],a=t[s],o=a.length;for(let u=0;u<o;u++){const c=a[u];c.tokenTypeIdx===void 0&&this[c.name](c.children,e)}}}function F3(t,e){const n=function(){};P$(n,t+"BaseSemantics");const r={visit:function(i,s){if(Ve(i)&&(i=i[0]),!ei(i))return this[i.name](i.children,s)},validateVisitor:function(){const i=M3(this,e);if(!ut(i)){const s=he(i,a=>a.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
88
+ ${s.join(`
89
+
90
+ `).replace(/\n/g,`
91
+ `)}`)}}};return n.prototype=r,n.prototype.constructor=n,n._RULE_NAMES=e,n}function L3(t,e,n){const r=function(){};P$(r,t+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return Re(e,s=>{i[s]=O3}),r.prototype=i,r.prototype.constructor=r,r}var vy;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(vy||(vy={}));function M3(t,e){return z3(t,e)}function z3(t,e){const n=Nn(e,i=>Xr(t[i])===!1),r=he(n,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:vy.MISSING_METHOD,methodName:i}));return Au(r)}class B3{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=$e(e,"nodeLocationTracking")?e.nodeLocationTracking:ti.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Lt,this.cstFinallyStateUpdate=Lt,this.cstPostTerminal=Lt,this.cstPostNonTerminal=Lt,this.cstPostRule=Lt;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=_$,this.setNodeLocationFromNode=_$,this.cstPostRule=Lt,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Lt,this.setNodeLocationFromNode=Lt,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=A$,this.setNodeLocationFromNode=A$,this.cstPostRule=Lt,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Lt,this.setNodeLocationFromNode=Lt,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Lt,this.setNodeLocationFromNode=Lt,this.cstPostRule=Lt,this.setInitialNodeLocation=Lt;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const n=this.LA(1);e.location={startOffset:n.startOffset,startLine:n.startLine,startColumn:n.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const n={name:e,children:Object.create(null)};this.setInitialNodeLocation(n),this.CST_STACK.push(n)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const n=this.LA(0),r=e.location;r.startOffset<=n.startOffset?(r.endOffset=n.endOffset,r.endLine=n.endLine,r.endColumn=n.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)}cstPostRuleOnlyOffset(e){const n=this.LA(0),r=e.location;r.startOffset<=n.startOffset?r.endOffset=n.endOffset:r.startOffset=NaN}cstPostTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];x3(r,n,e),this.setNodeLocationFromToken(r.location,n)}cstPostNonTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];I3(r,n,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(ei(this.baseCstVisitorConstructor)){const e=F3(this.className,Kn(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(ei(this.baseCstVisitorWithDefaultsConstructor)){const e=L3(this.className,Kn(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}}class q3{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):rp}LA(e){const n=this.currIdx+e;return n<0||this.tokVectorLength<=n?rp:this.tokVector[n]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}}class G3{ACTION(e){return e.call(this)}consume(e,n,r){return this.consumeInternal(n,e,r)}subrule(e,n,r){return this.subruleInternal(n,e,r)}option(e,n){return this.optionInternal(n,e)}or(e,n){return this.orInternal(n,e)}many(e,n){return this.manyInternal(e,n)}atLeastOne(e,n){return this.atLeastOneInternal(e,n)}CONSUME(e,n){return this.consumeInternal(e,0,n)}CONSUME1(e,n){return this.consumeInternal(e,1,n)}CONSUME2(e,n){return this.consumeInternal(e,2,n)}CONSUME3(e,n){return this.consumeInternal(e,3,n)}CONSUME4(e,n){return this.consumeInternal(e,4,n)}CONSUME5(e,n){return this.consumeInternal(e,5,n)}CONSUME6(e,n){return this.consumeInternal(e,6,n)}CONSUME7(e,n){return this.consumeInternal(e,7,n)}CONSUME8(e,n){return this.consumeInternal(e,8,n)}CONSUME9(e,n){return this.consumeInternal(e,9,n)}SUBRULE(e,n){return this.subruleInternal(e,0,n)}SUBRULE1(e,n){return this.subruleInternal(e,1,n)}SUBRULE2(e,n){return this.subruleInternal(e,2,n)}SUBRULE3(e,n){return this.subruleInternal(e,3,n)}SUBRULE4(e,n){return this.subruleInternal(e,4,n)}SUBRULE5(e,n){return this.subruleInternal(e,5,n)}SUBRULE6(e,n){return this.subruleInternal(e,6,n)}SUBRULE7(e,n){return this.subruleInternal(e,7,n)}SUBRULE8(e,n){return this.subruleInternal(e,8,n)}SUBRULE9(e,n){return this.subruleInternal(e,9,n)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,n,r=ip){if(hn(this.definedRulesNames,e)){const a={message:Es.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:yn.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(a)}this.definedRulesNames.push(e);const i=this.defineRule(e,n,r);return this[e]=i,i}OVERRIDE_RULE(e,n,r=ip){const i=d3(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const s=this.defineRule(e,n,r);return this[e]=s,s}BACKTRACK(e,n){return function(){this.isBackTrackingStack.push(1);const r=this.saveRecogState();try{return e.apply(this,n),!0}catch(i){if(Jf(i))return!1;throw i}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Jz(Mt(this.gastProductionsCache))}}class j3{initRecognizerEngine(e,n){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Hf,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},$e(n,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
92
+ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
93
+ For Further details.`);if(Ve(e)){if(ut(e))throw Error(`A Token Vocabulary cannot be empty.
94
+ Note that the first argument for the parser constructor
95
+ is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
96
+ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
97
+ For Further details.`)}if(Ve(e))this.tokensMap=mn(e,(s,a)=>(s[a.name]=a,s),{});else if($e(e,"modes")&&ur(Yn(Mt(e.modes)),qB)){const s=Yn(Mt(e.modes)),a=ey(s);this.tokensMap=mn(a,(o,u)=>(o[u.name]=u,o),{})}else if(Vn(e))this.tokensMap=Vt(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=xi;const r=$e(e,"modes")?Yn(Mt(e.modes)):Mt(e),i=ur(r,s=>ut(s.categoryMatches));this.tokenMatcher=i?Hf:Nu,Ou(Mt(this.tokensMap))}defineRule(e,n,r){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
98
+ Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=$e(r,"resyncEnabled")?r.resyncEnabled:ip.resyncEnabled,s=$e(r,"recoveryValueFunc")?r.recoveryValueFunc:ip.recoveryValueFunc,a=this.ruleShortNameIdx<<C3+Ii;this.ruleShortNameIdx++,this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a;let o;return this.outputCst===!0?o=function(...l){try{this.ruleInvocationStateUpdate(a,e,this.subruleIdx),n.apply(this,l);const d=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(d),d}catch(d){return this.invokeRuleCatch(d,i,s)}finally{this.ruleFinallyStateUpdate()}}:o=function(...l){try{return this.ruleInvocationStateUpdate(a,e,this.subruleIdx),n.apply(this,l)}catch(d){return this.invokeRuleCatch(d,i,s)}finally{this.ruleFinallyStateUpdate()}},Object.assign(o,{ruleName:e,originalGrammarAction:n})}invokeRuleCatch(e,n,r){const i=this.RULE_STACK.length===1,s=n&&!this.isBackTracking()&&this.recoveryEnabled;if(Jf(e)){const a=e;if(s){const o=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(o))if(a.resyncedTokens=this.reSyncTo(o),this.outputCst){const u=this.CST_STACK[this.CST_STACK.length-1];return u.recoveredNode=!0,u}else return r(e);else{if(this.outputCst){const u=this.CST_STACK[this.CST_STACK.length-1];u.recoveredNode=!0,a.partialCstResult=u}throw a}}else{if(i)return this.moveToTerminatedState(),r(e);throw a}}else throw e}optionInternal(e,n){const r=this.getKeyForAutomaticLookahead(C$,n);return this.optionInternalLogic(e,n,r)}optionInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof e!="function"){s=e.DEF;const a=e.GATE;if(a!==void 0){const o=i;i=()=>a.call(this)&&o.call(this)}}else s=e;if(i.call(this)===!0)return s.call(this)}atLeastOneInternal(e,n){const r=this.getKeyForAutomaticLookahead(my,e);return this.atLeastOneInternalLogic(e,n,r)}atLeastOneInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="function"){s=n.DEF;const a=n.GATE;if(a!==void 0){const o=i;i=()=>a.call(this)&&o.call(this)}}else s=n;if(i.call(this)===!0){let a=this.doSingleRepetition(s);for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s)}else throw this.raiseEarlyExitException(e,bt.REPETITION_MANDATORY,n.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,n],i,my,e,XB)}atLeastOneSepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(Zf,e);this.atLeastOneSepFirstInternalLogic(e,n,r)}atLeastOneSepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){i.call(this);const o=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,o,i,d$],o,Zf,e,d$)}else throw this.raiseEarlyExitException(e,bt.REPETITION_MANDATORY_WITH_SEPARATOR,n.ERR_MSG)}manyInternal(e,n){const r=this.getKeyForAutomaticLookahead(hy,e);return this.manyInternalLogic(e,n,r)}manyInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="function"){s=n.DEF;const o=n.GATE;if(o!==void 0){const u=i;i=()=>o.call(this)&&u.call(this)}}else s=n;let a=!0;for(;i.call(this)===!0&&a===!0;)a=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[e,n],i,hy,e,YB,a)}manySepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(gy,e);this.manySepFirstInternalLogic(e,n,r)}manySepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){i.call(this);const o=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,o,i,l$],o,gy,e,l$)}}repetitionSepSecondInternal(e,n,r,i,s){for(;r();)this.CONSUME(n),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,n,r,i,s],r,Zf,e,s)}doSingleRepetition(e){const n=this.getLexerPosition();return e.call(this),this.getLexerPosition()>n}orInternal(e,n){const r=this.getKeyForAutomaticLookahead(k$,n),i=Ve(e)?e:e.DEF,a=this.getLaFuncFromCache(r).call(this,i);if(a!==void 0)return i[a].ALT.call(this);this.raiseNoAltException(n,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),n=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new R3(n,e))}}subruleInternal(e,n,r){let i;try{const s=r!==void 0?r.ARGS:void 0;return this.subruleIdx=n,i=e.apply(this,s),this.cstPostNonTerminal(i,r!==void 0&&r.LABEL!==void 0?r.LABEL:e.ruleName),i}catch(s){throw this.subruleInternalError(s,r,e.ruleName)}}subruleInternalError(e,n,r){throw Jf(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,n!==void 0&&n.LABEL!==void 0?n.LABEL:r),delete e.partialCstResult),e}consumeInternal(e,n,r){let i;try{const s=this.LA(1);this.tokenMatcher(s,e)===!0?(this.consumeToken(),i=s):this.consumeInternalError(e,s,r)}catch(s){i=this.consumeInternalRecovery(e,n,s)}return this.cstPostTerminal(r!==void 0&&r.LABEL!==void 0?r.LABEL:e.name,i),i}consumeInternalError(e,n,r){let i;const s=this.LA(0);throw r!==void 0&&r.ERR_MSG?i=r.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:n,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new S$(i,n,s))}consumeInternalRecovery(e,n,r){if(this.recoveryEnabled&&r.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,n);try{return this.tryInRuleRecovery(e,i)}catch(s){throw s.name===T$?r:s}}else throw r}saveRecogState(){const e=this.errors,n=Vt(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:n,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,n,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(n)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),xi)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}class U3{initErrorHandler(e){this._errors=[],this.errorMessageProvider=$e(e,"errorMessageProvider")?e.errorMessageProvider:ti.errorMessageProvider}SAVE_ERROR(e){if(Jf(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Vt(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return Vt(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,n,r){const i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],o=Yf(e,s,n,this.maxLookahead)[0],u=[];for(let l=1;l<=this.maxLookahead;l++)u.push(this.LA(l));const c=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:o,actual:u,previous:this.LA(0),customUserDescription:r,ruleName:i});throw this.SAVE_ERROR(new $3(c,this.LA(1),this.LA(0)))}raiseNoAltException(e,n){const r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],s=Kf(e,i,this.maxLookahead),a=[];for(let c=1;c<=this.maxLookahead;c++)a.push(this.LA(c));const o=this.LA(0),u=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:a,previous:o,customUserDescription:n,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new E3(u,this.LA(1),o))}}class W3{initContentAssist(){}computeContentAssist(e,n){const r=this.gastProductionsCache[e];if(ei(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return f$([r],n,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const n=cr(e.ruleStack),i=this.getGAstProductions()[n];return new KB(i,e).startWalking()}}const tp={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(tp);const x$=!0,I$=Math.pow(2,Ii)-1,N$=u$({name:"RECORDING_PHASE_TOKEN",pattern:_n.NA});Ou([N$]);const O$=oy(N$,`This IToken indicates the Parser is in Recording Phase
99
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(O$);const H3={name:`This CSTNode indicates the Parser is in Recording Phase
100
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};class V3{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const n=e>0?e:"";this[`CONSUME${n}`]=function(r,i){return this.consumeInternalRecord(r,e,i)},this[`SUBRULE${n}`]=function(r,i){return this.subruleInternalRecord(r,e,i)},this[`OPTION${n}`]=function(r){return this.optionInternalRecord(r,e)},this[`OR${n}`]=function(r){return this.orInternalRecord(r,e)},this[`MANY${n}`]=function(r){this.manyInternalRecord(e,r)},this[`MANY_SEP${n}`]=function(r){this.manySepFirstInternalRecord(e,r)},this[`AT_LEAST_ONE${n}`]=function(r){this.atLeastOneInternalRecord(e,r)},this[`AT_LEAST_ONE_SEP${n}`]=function(r){this.atLeastOneSepFirstInternalRecord(e,r)}}this.consume=function(e,n,r){return this.consumeInternalRecord(n,e,r)},this.subrule=function(e,n,r){return this.subruleInternalRecord(n,e,r)},this.option=function(e,n){return this.optionInternalRecord(n,e)},this.or=function(e,n){return this.orInternalRecord(n,e)},this.many=function(e,n){this.manyInternalRecord(e,n)},this.atLeastOne=function(e,n){this.atLeastOneInternalRecord(e,n)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let n=0;n<10;n++){const r=n>0?n:"";delete e[`CONSUME${r}`],delete e[`SUBRULE${r}`],delete e[`OPTION${r}`],delete e[`OR${r}`],delete e[`MANY${r}`],delete e[`MANY_SEP${r}`],delete e[`AT_LEAST_ONE${r}`],delete e[`AT_LEAST_ONE_SEP${r}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,n){return()=>!0}LA_RECORD(e){return rp}topLevelRuleRecord(e,n){try{const r=new Oa({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),n.call(this),this.recordingProdStack.pop(),r}catch(r){if(r.KNOWN_RECORDER_ERROR!==!0)try{r.message=r.message+`
101
+ This error was thrown during the "grammar recording phase" For more info see:
102
+ https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw r}throw r}}optionInternalRecord(e,n){return Lu.call(this,Yt,e,n)}atLeastOneInternalRecord(e,n){Lu.call(this,Fn,n,e)}atLeastOneSepFirstInternalRecord(e,n){Lu.call(this,Ln,n,e,x$)}manyInternalRecord(e,n){Lu.call(this,St,n,e)}manySepFirstInternalRecord(e,n){Lu.call(this,Cn,n,e,x$)}orInternalRecord(e,n){return K3.call(this,e,n)}subruleInternalRecord(e,n,r){if(np(n),!e||$e(e,"ruleName")===!1){const o=new Error(`<SUBRULE${F$(n)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
103
+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=Ia(this.recordingProdStack),s=e.ruleName,a=new gn({idx:n,nonTerminalName:s,label:r?.LABEL,referencedRule:void 0});return i.definition.push(a),this.outputCst?H3:tp}consumeInternalRecord(e,n,r){if(np(n),!JR(e)){const a=new Error(`<CONSUME${F$(n)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
104
+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}const i=Ia(this.recordingProdStack),s=new gt({idx:n,terminalType:e,label:r?.LABEL});return i.definition.push(s),O$}}function Lu(t,e,n,r=!1){np(n);const i=Ia(this.recordingProdStack),s=Xr(e)?e:e.DEF,a=new t({definition:[],idx:n});return r&&(a.separator=e.SEP),$e(e,"MAX_LOOKAHEAD")&&(a.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(a),s.call(this),i.definition.push(a),this.recordingProdStack.pop(),tp}function K3(t,e){np(e);const n=Ia(this.recordingProdStack),r=Ve(t)===!1,i=r===!1?t:t.DEF,s=new An({definition:[],idx:e,ignoreAmbiguities:r&&t.IGNORE_AMBIGUITIES===!0});$e(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD);const a=IR(i,o=>Xr(o.GATE));return s.hasPredicates=a,n.definition.push(s),Re(i,o=>{const u=new kn({definition:[]});s.definition.push(u),$e(o,"IGNORE_AMBIGUITIES")?u.ignoreAmbiguities=o.IGNORE_AMBIGUITIES:$e(o,"GATE")&&(u.ignoreAmbiguities=!0),this.recordingProdStack.push(u),o.ALT.call(this),this.recordingProdStack.pop()}),tp}function F$(t){return t===0?"":`${t}`}function np(t){if(t<0||t>I$){const e=new Error(`Invalid DSL Method idx value: <${t}>
105
+ Idx value must be a none negative value smaller than ${I$+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class Y3{initPerformanceTracer(e){if($e(e,"traceInitPerf")){const n=e.traceInitPerf,r=typeof n=="number";this.traceInitMaxIdent=r?n:1/0,this.traceInitPerf=r?n>0:n}else this.traceInitMaxIdent=0,this.traceInitPerf=ti.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,n){if(this.traceInitPerf===!0){this.traceInitIndent++;const r=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${r}--> <${e}>`);const{time:i,value:s}=FR(n),a=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${r}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,s}else return n()}}function X3(t,e){e.forEach(n=>{const r=n.prototype;Object.getOwnPropertyNames(r).forEach(i=>{if(i==="constructor")return;const s=Object.getOwnPropertyDescriptor(r,i);s&&(s.get||s.set)?Object.defineProperty(t.prototype,i,s):t.prototype[i]=n.prototype[i]})})}const rp=oy(xi,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(rp);const ti=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Ma,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),ip=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var yn;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(yn||(yn={}));function L$(t=void 0){return function(){return t}}class jd{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const n=this.className;this.TRACE_INIT("toFastProps",()=>{LR(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),Re(this.definedRulesNames,i=>{const a=this[i].originalGrammarAction;let o;this.TRACE_INIT(`${i} Rule`,()=>{o=this.topLevelRuleRecord(i,a)}),this.gastProductionsCache[i]=o})}finally{this.disableRecording()}});let r=[];if(this.TRACE_INIT("Grammar Resolving",()=>{r=b3({rules:Mt(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)}),this.TRACE_INIT("Grammar Validations",()=>{if(ut(r)&&this.skipValidations===!1){const i=D3({rules:Mt(this.gastProductionsCache),tokenTypes:Mt(this.tokensMap),errMsgProvider:Es,grammarName:n}),s=s3({lookaheadStrategy:this.lookaheadStrategy,rules:Mt(this.gastProductionsCache),tokenTypes:Mt(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(i,s)}}),ut(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=iB(Mt(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,s;(s=(i=this.lookaheadStrategy).initialize)===null||s===void 0||s.call(i,{rules:Mt(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Mt(this.gastProductionsCache))})),!jd.DEFER_DEFINITION_ERRORS_HANDLING&&!ut(this.definitionErrors))throw e=he(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
106
+ ${e.join(`
107
+ -------------------------------
108
+ `)}`)})}constructor(e,n){this.definitionErrors=[],this.selfAnalysisDone=!1;const r=this;if(r.initErrorHandler(n),r.initLexerAdapter(),r.initLooksAhead(n),r.initRecognizerEngine(e,n),r.initRecoverable(n),r.initTreeBuilder(n),r.initContentAssist(),r.initGastRecorder(n),r.initPerformanceTracer(n),$e(n,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
109
+ Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
110
+ See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
111
+ For further details.`);this.skipValidations=$e(n,"skipValidations")?n.skipValidations:ti.skipValidations}}jd.DEFER_DEFINITION_ERRORS_HANDLING=!1,X3(jd,[T3,A3,B3,q3,j3,G3,U3,W3,V3,Y3]);class J3 extends jd{constructor(e,n=ti){const r=Vt(n);r.outputCst=!1,super(e,r)}}function za(t,e,n){return`${t.name}_${e}_${n}`}const Ni=1,Q3=2,M$=4,z$=5,Mu=7,Z3=8,eq=9,tq=10,nq=11,B$=12;class by{constructor(e){this.target=e}isEpsilon(){return!1}}class Dy extends by{constructor(e,n){super(e),this.tokenType=n}}class q$ extends by{constructor(e){super(e)}isEpsilon(){return!0}}class Ey extends by{constructor(e,n,r){super(e),this.rule=n,this.followState=r}isEpsilon(){return!0}}function rq(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};iq(e,t);const n=t.length;for(let r=0;r<n;r++){const i=t[r],s=Rs(e,i,i);s!==void 0&&mq(e,i,s)}return e}function iq(t,e){const n=e.length;for(let r=0;r<n;r++){const i=e[r],s=Ut(t,i,void 0,{type:Q3}),a=Ut(t,i,void 0,{type:Mu});s.stop=a,t.ruleToStartState.set(i,s),t.ruleToStopState.set(i,a)}}function G$(t,e,n){return n instanceof gt?Ry(t,e,n.terminalType,n):n instanceof gn?hq(t,e,n):n instanceof An?cq(t,e,n):n instanceof Yt?lq(t,e,n):n instanceof St?sq(t,e,n):n instanceof Cn?aq(t,e,n):n instanceof Fn?oq(t,e,n):n instanceof Ln?uq(t,e,n):Rs(t,e,n)}function sq(t,e,n){const r=Ut(t,e,n,{type:z$});Oi(t,r);const i=Ba(t,e,r,n,Rs(t,e,n));return U$(t,e,n,i)}function aq(t,e,n){const r=Ut(t,e,n,{type:z$});Oi(t,r);const i=Ba(t,e,r,n,Rs(t,e,n)),s=Ry(t,e,n.separator,n);return U$(t,e,n,i,s)}function oq(t,e,n){const r=Ut(t,e,n,{type:M$});Oi(t,r);const i=Ba(t,e,r,n,Rs(t,e,n));return j$(t,e,n,i)}function uq(t,e,n){const r=Ut(t,e,n,{type:M$});Oi(t,r);const i=Ba(t,e,r,n,Rs(t,e,n)),s=Ry(t,e,n.separator,n);return j$(t,e,n,i,s)}function cq(t,e,n){const r=Ut(t,e,n,{type:Ni});Oi(t,r);const i=he(n.definition,a=>G$(t,e,a));return Ba(t,e,r,n,...i)}function lq(t,e,n){const r=Ut(t,e,n,{type:Ni});Oi(t,r);const i=Ba(t,e,r,n,Rs(t,e,n));return dq(t,e,n,i)}function Rs(t,e,n){const r=Nn(he(n.definition,i=>G$(t,e,i)),i=>i!==void 0);return r.length===1?r[0]:r.length===0?void 0:pq(t,r)}function j$(t,e,n,r,i){const s=r.left,a=r.right,o=Ut(t,e,n,{type:nq});Oi(t,o);const u=Ut(t,e,n,{type:B$});return s.loopback=o,u.loopback=o,t.decisionMap[za(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",n.idx)]=o,Pt(a,o),i===void 0?(Pt(o,s),Pt(o,u)):(Pt(o,u),Pt(o,i.left),Pt(i.right,s)),{left:s,right:u}}function U$(t,e,n,r,i){const s=r.left,a=r.right,o=Ut(t,e,n,{type:tq});Oi(t,o);const u=Ut(t,e,n,{type:B$}),c=Ut(t,e,n,{type:eq});return o.loopback=c,u.loopback=c,Pt(o,s),Pt(o,u),Pt(a,c),i!==void 0?(Pt(c,u),Pt(c,i.left),Pt(i.right,s)):Pt(c,o),t.decisionMap[za(e,i?"RepetitionWithSeparator":"Repetition",n.idx)]=o,{left:o,right:u}}function dq(t,e,n,r){const i=r.left,s=r.right;return Pt(i,s),t.decisionMap[za(e,"Option",n.idx)]=i,r}function Oi(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function Ba(t,e,n,r,...i){const s=Ut(t,e,r,{type:Z3,start:n});n.end=s;for(const o of i)o!==void 0?(Pt(n,o.left),Pt(o.right,s)):Pt(n,s);const a={left:n,right:s};return t.decisionMap[za(e,fq(r),r.idx)]=n,a}function fq(t){if(t instanceof An)return"Alternation";if(t instanceof Yt)return"Option";if(t instanceof St)return"Repetition";if(t instanceof Cn)return"RepetitionWithSeparator";if(t instanceof Fn)return"RepetitionMandatory";if(t instanceof Ln)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function pq(t,e){const n=e.length;for(let s=0;s<n-1;s++){const a=e[s];let o;a.left.transitions.length===1&&(o=a.left.transitions[0]);const u=o instanceof Ey,c=o,l=e[s+1].left;a.left.type===Ni&&a.right.type===Ni&&o!==void 0&&(u&&c.followState===a.right||o.target===a.right)?(u?c.followState=l:o.target=l,gq(t,a.right)):Pt(a.right,l)}const r=e[0],i=e[n-1];return{left:r.left,right:i.right}}function Ry(t,e,n,r){const i=Ut(t,e,r,{type:Ni}),s=Ut(t,e,r,{type:Ni});return $y(i,new Dy(s,n)),{left:i,right:s}}function hq(t,e,n){const r=n.referencedRule,i=t.ruleToStartState.get(r),s=Ut(t,e,n,{type:Ni}),a=Ut(t,e,n,{type:Ni}),o=new Ey(i,r,a);return $y(s,o),{left:s,right:a}}function mq(t,e,n){const r=t.ruleToStartState.get(e);Pt(r,n.left);const i=t.ruleToStopState.get(e);return Pt(n.right,i),{left:r,right:i}}function Pt(t,e){const n=new q$(e);$y(t,n)}function Ut(t,e,n,r){const i=Object.assign({atn:t,production:n,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},r);return t.states.push(i),i}function $y(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function gq(t,e){t.states.splice(t.states.indexOf(e),1)}const sp={};class Sy{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const n=W$(e);n in this.map||(this.map[n]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return he(this.configs,e=>e.alt)}get key(){let e="";for(const n in this.map)e+=n+":";return e}}function W$(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(n=>n.stateNumber.toString()).join("_")}`}function yq(t,e){const n={};return r=>{const i=r.toString();let s=n[i];return s!==void 0||(s={atnStartState:t,decision:e,states:{}},n[i]=s),s}}class H${constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,n){this.predicates[e]=n}toString(){let e="";const n=this.predicates.length;for(let r=0;r<n;r++)e+=this.predicates[r]===!0?"1":"0";return e}}const V$=new H$;class wq extends wy{constructor(e){var n;super(),this.logging=(n=e?.logging)!==null&&n!==void 0?n:r=>console.log(r)}initialize(e){this.atn=rq(e.rules),this.dfas=vq(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:n,rule:r,hasPredicates:i,dynamicTokensEnabled:s}=e,a=this.dfas,o=this.logging,u=za(r,"Alternation",n),l=this.atn.decisionMap[u].decision,d=he(p$({maxLookahead:1,occurrence:n,prodType:"Alternation",rule:r}),f=>he(f,p=>p[0]));if(K$(d,!1)&&!s){const f=mn(d,(p,h,y)=>(Re(h,b=>{b&&(p[b.tokenTypeIdx]=y,Re(b.categoryMatches,w=>{p[w]=y}))}),p),{});return i?function(p){var h;const y=this.LA(1),b=f[y.tokenTypeIdx];if(p!==void 0&&b!==void 0){const w=(h=p[b])===null||h===void 0?void 0:h.GATE;if(w!==void 0&&w.call(this)===!1)return}return b}:function(){const p=this.LA(1);return f[p.tokenTypeIdx]}}else return i?function(f){const p=new H$,h=f===void 0?0:f.length;for(let b=0;b<h;b++){const w=f?.[b].GATE;p.set(b,w===void 0||w.call(this))}const y=Ty.call(this,a,l,p,o);return typeof y=="number"?y:void 0}:function(){const f=Ty.call(this,a,l,V$,o);return typeof f=="number"?f:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:n,rule:r,prodType:i,dynamicTokensEnabled:s}=e,a=this.dfas,o=this.logging,u=za(r,i,n),l=this.atn.decisionMap[u].decision,d=he(p$({maxLookahead:1,occurrence:n,prodType:i,rule:r}),f=>he(f,p=>p[0]));if(K$(d)&&d[0][0]&&!s){const f=d[0],p=Yn(f);if(p.length===1&&ut(p[0].categoryMatches)){const y=p[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===y}}else{const h=mn(p,(y,b)=>(b!==void 0&&(y[b.tokenTypeIdx]=!0,Re(b.categoryMatches,w=>{y[w]=!0})),y),{});return function(){const y=this.LA(1);return h[y.tokenTypeIdx]===!0}}}return function(){const f=Ty.call(this,a,l,V$,o);return typeof f=="object"?!1:f===0}}}function K$(t,e=!0){const n=new Set;for(const r of t){const i=new Set;for(const s of r){if(s===void 0){if(e)break;return!1}const a=[s.tokenTypeIdx].concat(s.categoryMatches);for(const o of a)if(n.has(o)){if(!i.has(o))return!1}else n.add(o),i.add(o)}}return!0}function vq(t){const e=t.decisionStates.length,n=Array(e);for(let r=0;r<e;r++)n[r]=yq(t.decisionStates[r],r);return n}function Ty(t,e,n,r){const i=t[e](n);let s=i.start;if(s===void 0){const o=_q(i.atnStartState);s=J$(i,Y$(o)),i.start=s}return bq.apply(this,[i,s,n,r])}function bq(t,e,n,r){let i=e,s=1;const a=[];let o=this.LA(s++);for(;;){let u=Tq(i,o);if(u===void 0&&(u=Dq.apply(this,[t,i,o,s,n,r])),u===sp)return Sq(a,i,o);if(u.isAcceptState===!0)return u.prediction;i=u,a.push(o),o=this.LA(s++)}}function Dq(t,e,n,r,i,s){const a=kq(e.configs,n,i);if(a.size===0)return X$(t,e,n,sp),sp;let o=Y$(a);const u=Aq(a,i);if(u!==void 0)o.isAcceptState=!0,o.prediction=u,o.configs.uniqueAlt=u;else if(Nq(a)){const c=Mz(a.alts);o.isAcceptState=!0,o.prediction=c,o.configs.uniqueAlt=c,Eq.apply(this,[t,r,a.alts,s])}return o=X$(t,e,n,o),o}function Eq(t,e,n,r){const i=[];for(let c=1;c<=e;c++)i.push(this.LA(c).tokenType);const s=t.atnStartState,a=s.rule,o=s.production,u=Rq({topLevelRule:a,ambiguityIndices:n,production:o,prefixPath:i});r(u)}function Rq(t){const e=he(t.prefixPath,i=>La(i)).join(", "),n=t.production.idx===0?"":t.production.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${$q(t.production)}${n}> inside <${t.topLevelRule.name}> Rule,
112
+ <${e}> may appears as a prefix path in all these alternatives.
113
+ `;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
114
+ For Further details.`,r}function $q(t){if(t instanceof gn)return"SUBRULE";if(t instanceof Yt)return"OPTION";if(t instanceof An)return"OR";if(t instanceof Fn)return"AT_LEAST_ONE";if(t instanceof Ln)return"AT_LEAST_ONE_SEP";if(t instanceof Cn)return"MANY_SEP";if(t instanceof St)return"MANY";if(t instanceof gt)return"CONSUME";throw Error("non exhaustive match")}function Sq(t,e,n){const r=On(e.configs.elements,s=>s.state.transitions),i=Kz(r.filter(s=>s instanceof Dy).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:n,possibleTokenTypes:i,tokenPath:t}}function Tq(t,e){return t.edges[e.tokenTypeIdx]}function kq(t,e,n){const r=new Sy,i=[];for(const a of t.elements){if(n.is(a.alt)===!1)continue;if(a.state.type===Mu){i.push(a);continue}const o=a.state.transitions.length;for(let u=0;u<o;u++){const c=a.state.transitions[u],l=Cq(c,e);l!==void 0&&r.add({state:l,alt:a.alt,stack:a.stack})}}let s;if(i.length===0&&r.size===1&&(s=r),s===void 0){s=new Sy;for(const a of r.elements)ap(a,s)}if(i.length>0&&!xq(s))for(const a of i)s.add(a);return s}function Cq(t,e){if(t instanceof Dy&&c$(e,t.tokenType))return t.target}function Aq(t,e){let n;for(const r of t.elements)if(e.is(r.alt)===!0){if(n===void 0)n=r.alt;else if(n!==r.alt)return}return n}function Y$(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function X$(t,e,n,r){return r=J$(t,r),e.edges[n.tokenTypeIdx]=r,r}function J$(t,e){if(e===sp)return e;const n=e.configs.key,r=t.states[n];return r!==void 0?r:(e.configs.finalize(),t.states[n]=e,e)}function _q(t){const e=new Sy,n=t.transitions.length;for(let r=0;r<n;r++){const s={state:t.transitions[r].target,alt:r,stack:[]};ap(s,e)}return e}function ap(t,e){const n=t.state;if(n.type===Mu){if(t.stack.length>0){const i=[...t.stack],a={state:i.pop(),alt:t.alt,stack:i};ap(a,e)}else e.add(t);return}n.epsilonOnlyTransitions||e.add(t);const r=n.transitions.length;for(let i=0;i<r;i++){const s=n.transitions[i],a=Pq(t,s);a!==void 0&&ap(a,e)}}function Pq(t,e){if(e instanceof q$)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof Ey){const n=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:n}}}function xq(t){for(const e of t.elements)if(e.state.type===Mu)return!0;return!1}function Iq(t){for(const e of t.elements)if(e.state.type!==Mu)return!1;return!0}function Nq(t){if(Iq(t))return!0;const e=Oq(t.elements);return Fq(e)&&!Lq(e)}function Oq(t){const e=new Map;for(const n of t){const r=W$(n,!1);let i=e.get(r);i===void 0&&(i={},e.set(r,i)),i[n.alt]=!0}return e}function Fq(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function Lq(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var Q$;(function(t){function e(n){return typeof n=="string"}t.is=e})(Q$||(Q$={}));var ky;(function(t){function e(n){return typeof n=="string"}t.is=e})(ky||(ky={}));var Z$;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(Z$||(Z$={}));var op;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(op||(op={}));var tt;(function(t){function e(r,i){return r===Number.MAX_VALUE&&(r=op.MAX_VALUE),i===Number.MAX_VALUE&&(i=op.MAX_VALUE),{line:r,character:i}}t.create=e;function n(r){let i=r;return z.objectLiteral(i)&&z.uinteger(i.line)&&z.uinteger(i.character)}t.is=n})(tt||(tt={}));var Ue;(function(t){function e(r,i,s,a){if(z.uinteger(r)&&z.uinteger(i)&&z.uinteger(s)&&z.uinteger(a))return{start:tt.create(r,i),end:tt.create(s,a)};if(tt.is(r)&&tt.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${s}, ${a}]`)}t.create=e;function n(r){let i=r;return z.objectLiteral(i)&&tt.is(i.start)&&tt.is(i.end)}t.is=n})(Ue||(Ue={}));var up;(function(t){function e(r,i){return{uri:r,range:i}}t.create=e;function n(r){let i=r;return z.objectLiteral(i)&&Ue.is(i.range)&&(z.string(i.uri)||z.undefined(i.uri))}t.is=n})(up||(up={}));var eS;(function(t){function e(r,i,s,a){return{targetUri:r,targetRange:i,targetSelectionRange:s,originSelectionRange:a}}t.create=e;function n(r){let i=r;return z.objectLiteral(i)&&Ue.is(i.targetRange)&&z.string(i.targetUri)&&Ue.is(i.targetSelectionRange)&&(Ue.is(i.originSelectionRange)||z.undefined(i.originSelectionRange))}t.is=n})(eS||(eS={}));var Cy;(function(t){function e(r,i,s,a){return{red:r,green:i,blue:s,alpha:a}}t.create=e;function n(r){const i=r;return z.objectLiteral(i)&&z.numberRange(i.red,0,1)&&z.numberRange(i.green,0,1)&&z.numberRange(i.blue,0,1)&&z.numberRange(i.alpha,0,1)}t.is=n})(Cy||(Cy={}));var tS;(function(t){function e(r,i){return{range:r,color:i}}t.create=e;function n(r){const i=r;return z.objectLiteral(i)&&Ue.is(i.range)&&Cy.is(i.color)}t.is=n})(tS||(tS={}));var nS;(function(t){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}t.create=e;function n(r){const i=r;return z.objectLiteral(i)&&z.string(i.label)&&(z.undefined(i.textEdit)||Pn.is(i))&&(z.undefined(i.additionalTextEdits)||z.typedArray(i.additionalTextEdits,Pn.is))}t.is=n})(nS||(nS={}));var rS;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(rS||(rS={}));var iS;(function(t){function e(r,i,s,a,o,u){const c={startLine:r,endLine:i};return z.defined(s)&&(c.startCharacter=s),z.defined(a)&&(c.endCharacter=a),z.defined(o)&&(c.kind=o),z.defined(u)&&(c.collapsedText=u),c}t.create=e;function n(r){const i=r;return z.objectLiteral(i)&&z.uinteger(i.startLine)&&z.uinteger(i.startLine)&&(z.undefined(i.startCharacter)||z.uinteger(i.startCharacter))&&(z.undefined(i.endCharacter)||z.uinteger(i.endCharacter))&&(z.undefined(i.kind)||z.string(i.kind))}t.is=n})(iS||(iS={}));var Ay;(function(t){function e(r,i){return{location:r,message:i}}t.create=e;function n(r){let i=r;return z.defined(i)&&up.is(i.location)&&z.string(i.message)}t.is=n})(Ay||(Ay={}));var zu;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(zu||(zu={}));var sS;(function(t){t.Unnecessary=1,t.Deprecated=2})(sS||(sS={}));var aS;(function(t){function e(n){const r=n;return z.objectLiteral(r)&&z.string(r.href)}t.is=e})(aS||(aS={}));var cp;(function(t){function e(r,i,s,a,o,u){let c={range:r,message:i};return z.defined(s)&&(c.severity=s),z.defined(a)&&(c.code=a),z.defined(o)&&(c.source=o),z.defined(u)&&(c.relatedInformation=u),c}t.create=e;function n(r){var i;let s=r;return z.defined(s)&&Ue.is(s.range)&&z.string(s.message)&&(z.number(s.severity)||z.undefined(s.severity))&&(z.integer(s.code)||z.string(s.code)||z.undefined(s.code))&&(z.undefined(s.codeDescription)||z.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(z.string(s.source)||z.undefined(s.source))&&(z.undefined(s.relatedInformation)||z.typedArray(s.relatedInformation,Ay.is))}t.is=n})(cp||(cp={}));var qa;(function(t){function e(r,i,...s){let a={title:r,command:i};return z.defined(s)&&s.length>0&&(a.arguments=s),a}t.create=e;function n(r){let i=r;return z.defined(i)&&z.string(i.title)&&z.string(i.command)}t.is=n})(qa||(qa={}));var Pn;(function(t){function e(s,a){return{range:s,newText:a}}t.replace=e;function n(s,a){return{range:{start:s,end:s},newText:a}}t.insert=n;function r(s){return{range:s,newText:""}}t.del=r;function i(s){const a=s;return z.objectLiteral(a)&&z.string(a.newText)&&Ue.is(a.range)}t.is=i})(Pn||(Pn={}));var _y;(function(t){function e(r,i,s){const a={label:r};return i!==void 0&&(a.needsConfirmation=i),s!==void 0&&(a.description=s),a}t.create=e;function n(r){const i=r;return z.objectLiteral(i)&&z.string(i.label)&&(z.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(z.string(i.description)||i.description===void 0)}t.is=n})(_y||(_y={}));var Ga;(function(t){function e(n){const r=n;return z.string(r)}t.is=e})(Ga||(Ga={}));var oS;(function(t){function e(s,a,o){return{range:s,newText:a,annotationId:o}}t.replace=e;function n(s,a,o){return{range:{start:s,end:s},newText:a,annotationId:o}}t.insert=n;function r(s,a){return{range:s,newText:"",annotationId:a}}t.del=r;function i(s){const a=s;return Pn.is(a)&&(_y.is(a.annotationId)||Ga.is(a.annotationId))}t.is=i})(oS||(oS={}));var Py;(function(t){function e(r,i){return{textDocument:r,edits:i}}t.create=e;function n(r){let i=r;return z.defined(i)&&Fy.is(i.textDocument)&&Array.isArray(i.edits)}t.is=n})(Py||(Py={}));var xy;(function(t){function e(r,i,s){let a={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(a.options=i),s!==void 0&&(a.annotationId=s),a}t.create=e;function n(r){let i=r;return i&&i.kind==="create"&&z.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||z.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||z.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Ga.is(i.annotationId))}t.is=n})(xy||(xy={}));var Iy;(function(t){function e(r,i,s,a){let o={kind:"rename",oldUri:r,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(o.options=s),a!==void 0&&(o.annotationId=a),o}t.create=e;function n(r){let i=r;return i&&i.kind==="rename"&&z.string(i.oldUri)&&z.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||z.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||z.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||Ga.is(i.annotationId))}t.is=n})(Iy||(Iy={}));var Ny;(function(t){function e(r,i,s){let a={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(a.options=i),s!==void 0&&(a.annotationId=s),a}t.create=e;function n(r){let i=r;return i&&i.kind==="delete"&&z.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||z.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||z.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||Ga.is(i.annotationId))}t.is=n})(Ny||(Ny={}));var Oy;(function(t){function e(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>z.string(i.kind)?xy.is(i)||Iy.is(i)||Ny.is(i):Py.is(i)))}t.is=e})(Oy||(Oy={}));var uS;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let i=r;return z.defined(i)&&z.string(i.uri)}t.is=n})(uS||(uS={}));var cS;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return z.defined(i)&&z.string(i.uri)&&z.integer(i.version)}t.is=n})(cS||(cS={}));var Fy;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return z.defined(i)&&z.string(i.uri)&&(i.version===null||z.integer(i.version))}t.is=n})(Fy||(Fy={}));var lS;(function(t){function e(r,i,s,a){return{uri:r,languageId:i,version:s,text:a}}t.create=e;function n(r){let i=r;return z.defined(i)&&z.string(i.uri)&&z.string(i.languageId)&&z.integer(i.version)&&z.string(i.text)}t.is=n})(lS||(lS={}));var Ly;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){const r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(Ly||(Ly={}));var Bu;(function(t){function e(n){const r=n;return z.objectLiteral(n)&&Ly.is(r.kind)&&z.string(r.value)}t.is=e})(Bu||(Bu={}));var xt;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(xt||(xt={}));var Jn;(function(t){t.PlainText=1,t.Snippet=2})(Jn||(Jn={}));var dS;(function(t){t.Deprecated=1})(dS||(dS={}));var fS;(function(t){function e(r,i,s){return{newText:r,insert:i,replace:s}}t.create=e;function n(r){const i=r;return i&&z.string(i.newText)&&Ue.is(i.insert)&&Ue.is(i.replace)}t.is=n})(fS||(fS={}));var pS;(function(t){t.asIs=1,t.adjustIndentation=2})(pS||(pS={}));var hS;(function(t){function e(n){const r=n;return r&&(z.string(r.detail)||r.detail===void 0)&&(z.string(r.description)||r.description===void 0)}t.is=e})(hS||(hS={}));var mS;(function(t){function e(n){return{label:n}}t.create=e})(mS||(mS={}));var gS;(function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(gS||(gS={}));var lp;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){const i=r;return z.string(i)||z.objectLiteral(i)&&z.string(i.language)&&z.string(i.value)}t.is=n})(lp||(lp={}));var yS;(function(t){function e(n){let r=n;return!!r&&z.objectLiteral(r)&&(Bu.is(r.contents)||lp.is(r.contents)||z.typedArray(r.contents,lp.is))&&(n.range===void 0||Ue.is(n.range))}t.is=e})(yS||(yS={}));var wS;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})(wS||(wS={}));var vS;(function(t){function e(n,r,...i){let s={label:n};return z.defined(r)&&(s.documentation=r),z.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(vS||(vS={}));var bS;(function(t){t.Text=1,t.Read=2,t.Write=3})(bS||(bS={}));var DS;(function(t){function e(n,r){let i={range:n};return z.number(r)&&(i.kind=r),i}t.create=e})(DS||(DS={}));var dr;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(dr||(dr={}));var ES;(function(t){t.Deprecated=1})(ES||(ES={}));var RS;(function(t){function e(n,r,i,s,a){let o={name:n,kind:r,location:{uri:s,range:i}};return a&&(o.containerName=a),o}t.create=e})(RS||(RS={}));var $S;(function(t){function e(n,r,i,s){return s!==void 0?{name:n,kind:r,location:{uri:i,range:s}}:{name:n,kind:r,location:{uri:i}}}t.create=e})($S||($S={}));var SS;(function(t){function e(r,i,s,a,o,u){let c={name:r,detail:i,kind:s,range:a,selectionRange:o};return u!==void 0&&(c.children=u),c}t.create=e;function n(r){let i=r;return i&&z.string(i.name)&&z.number(i.kind)&&Ue.is(i.range)&&Ue.is(i.selectionRange)&&(i.detail===void 0||z.string(i.detail))&&(i.deprecated===void 0||z.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=n})(SS||(SS={}));var TS;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(TS||(TS={}));var dp;(function(t){t.Invoked=1,t.Automatic=2})(dp||(dp={}));var kS;(function(t){function e(r,i,s){let a={diagnostics:r};return i!=null&&(a.only=i),s!=null&&(a.triggerKind=s),a}t.create=e;function n(r){let i=r;return z.defined(i)&&z.typedArray(i.diagnostics,cp.is)&&(i.only===void 0||z.typedArray(i.only,z.string))&&(i.triggerKind===void 0||i.triggerKind===dp.Invoked||i.triggerKind===dp.Automatic)}t.is=n})(kS||(kS={}));var CS;(function(t){function e(r,i,s){let a={title:r},o=!0;return typeof i=="string"?(o=!1,a.kind=i):qa.is(i)?a.command=i:a.edit=i,o&&s!==void 0&&(a.kind=s),a}t.create=e;function n(r){let i=r;return i&&z.string(i.title)&&(i.diagnostics===void 0||z.typedArray(i.diagnostics,cp.is))&&(i.kind===void 0||z.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||qa.is(i.command))&&(i.isPreferred===void 0||z.boolean(i.isPreferred))&&(i.edit===void 0||Oy.is(i.edit))}t.is=n})(CS||(CS={}));var AS;(function(t){function e(r,i){let s={range:r};return z.defined(i)&&(s.data=i),s}t.create=e;function n(r){let i=r;return z.defined(i)&&Ue.is(i.range)&&(z.undefined(i.command)||qa.is(i.command))}t.is=n})(AS||(AS={}));var _S;(function(t){function e(r,i){return{tabSize:r,insertSpaces:i}}t.create=e;function n(r){let i=r;return z.defined(i)&&z.uinteger(i.tabSize)&&z.boolean(i.insertSpaces)}t.is=n})(_S||(_S={}));var PS;(function(t){function e(r,i,s){return{range:r,target:i,data:s}}t.create=e;function n(r){let i=r;return z.defined(i)&&Ue.is(i.range)&&(z.undefined(i.target)||z.string(i.target))}t.is=n})(PS||(PS={}));var xS;(function(t){function e(r,i){return{range:r,parent:i}}t.create=e;function n(r){let i=r;return z.objectLiteral(i)&&Ue.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=n})(xS||(xS={}));var Ne;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(Ne||(Ne={}));var qe;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(qe||(qe={}));var IS;(function(t){function e(n){const r=n;return z.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}t.is=e})(IS||(IS={}));var NS;(function(t){function e(r,i){return{range:r,text:i}}t.create=e;function n(r){const i=r;return i!=null&&Ue.is(i.range)&&z.string(i.text)}t.is=n})(NS||(NS={}));var OS;(function(t){function e(r,i,s){return{range:r,variableName:i,caseSensitiveLookup:s}}t.create=e;function n(r){const i=r;return i!=null&&Ue.is(i.range)&&z.boolean(i.caseSensitiveLookup)&&(z.string(i.variableName)||i.variableName===void 0)}t.is=n})(OS||(OS={}));var FS;(function(t){function e(r,i){return{range:r,expression:i}}t.create=e;function n(r){const i=r;return i!=null&&Ue.is(i.range)&&(z.string(i.expression)||i.expression===void 0)}t.is=n})(FS||(FS={}));var LS;(function(t){function e(r,i){return{frameId:r,stoppedLocation:i}}t.create=e;function n(r){const i=r;return z.defined(i)&&Ue.is(r.stoppedLocation)}t.is=n})(LS||(LS={}));var My;(function(t){t.Type=1,t.Parameter=2;function e(n){return n===1||n===2}t.is=e})(My||(My={}));var zy;(function(t){function e(r){return{value:r}}t.create=e;function n(r){const i=r;return z.objectLiteral(i)&&(i.tooltip===void 0||z.string(i.tooltip)||Bu.is(i.tooltip))&&(i.location===void 0||up.is(i.location))&&(i.command===void 0||qa.is(i.command))}t.is=n})(zy||(zy={}));var MS;(function(t){function e(r,i,s){const a={position:r,label:i};return s!==void 0&&(a.kind=s),a}t.create=e;function n(r){const i=r;return z.objectLiteral(i)&&tt.is(i.position)&&(z.string(i.label)||z.typedArray(i.label,zy.is))&&(i.kind===void 0||My.is(i.kind))&&i.textEdits===void 0||z.typedArray(i.textEdits,Pn.is)&&(i.tooltip===void 0||z.string(i.tooltip)||Bu.is(i.tooltip))&&(i.paddingLeft===void 0||z.boolean(i.paddingLeft))&&(i.paddingRight===void 0||z.boolean(i.paddingRight))}t.is=n})(MS||(MS={}));var zS;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})(zS||(zS={}));var BS;(function(t){function e(n,r,i,s){return{insertText:n,filterText:r,range:i,command:s}}t.create=e})(BS||(BS={}));var qS;(function(t){function e(n){return{items:n}}t.create=e})(qS||(qS={}));var GS;(function(t){t.Invoked=0,t.Automatic=1})(GS||(GS={}));var jS;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(jS||(jS={}));var US;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})(US||(US={}));var WS;(function(t){function e(n){const r=n;return z.objectLiteral(r)&&ky.is(r.uri)&&z.string(r.name)}t.is=e})(WS||(WS={}));var HS;(function(t){function e(s,a,o,u){return new Mq(s,a,o,u)}t.create=e;function n(s){let a=s;return!!(z.defined(a)&&z.string(a.uri)&&(z.undefined(a.languageId)||z.string(a.languageId))&&z.uinteger(a.lineCount)&&z.func(a.getText)&&z.func(a.positionAt)&&z.func(a.offsetAt))}t.is=n;function r(s,a){let o=s.getText(),u=i(a,(l,d)=>{let f=l.range.start.line-d.range.start.line;return f===0?l.range.start.character-d.range.start.character:f}),c=o.length;for(let l=u.length-1;l>=0;l--){let d=u[l],f=s.offsetAt(d.range.start),p=s.offsetAt(d.range.end);if(p<=c)o=o.substring(0,f)+d.newText+o.substring(p,o.length);else throw new Error("Overlapping edit");c=f}return o}t.applyEdits=r;function i(s,a){if(s.length<=1)return s;const o=s.length/2|0,u=s.slice(0,o),c=s.slice(o);i(u,a),i(c,a);let l=0,d=0,f=0;for(;l<u.length&&d<c.length;)a(u[l],c[d])<=0?s[f++]=u[l++]:s[f++]=c[d++];for(;l<u.length;)s[f++]=u[l++];for(;d<c.length;)s[f++]=c[d++];return s}})(HS||(HS={}));let Mq=class{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){this._content=e.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],n=this._content,r=!0;for(let i=0;i<n.length;i++){r&&(e.push(i),r=!1);let s=n.charAt(i);r=s==="\r"||s===`
115
+ `,s==="\r"&&i+1<n.length&&n.charAt(i+1)===`
116
+ `&&i++}r&&n.length>0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return tt.create(0,e);for(;r<i;){let a=Math.floor((r+i)/2);n[a]>e?i=a:r=a+1}let s=r-1;return tt.create(s,e-n[s])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}};var z;(function(t){const e=Object.prototype.toString;function n(p){return typeof p<"u"}t.defined=n;function r(p){return typeof p>"u"}t.undefined=r;function i(p){return p===!0||p===!1}t.boolean=i;function s(p){return e.call(p)==="[object String]"}t.string=s;function a(p){return e.call(p)==="[object Number]"}t.number=a;function o(p,h,y){return e.call(p)==="[object Number]"&&h<=p&&p<=y}t.numberRange=o;function u(p){return e.call(p)==="[object Number]"&&-2147483648<=p&&p<=2147483647}t.integer=u;function c(p){return e.call(p)==="[object Number]"&&0<=p&&p<=2147483647}t.uinteger=c;function l(p){return e.call(p)==="[object Function]"}t.func=l;function d(p){return p!==null&&typeof p=="object"}t.objectLiteral=d;function f(p,h){return Array.isArray(p)&&p.every(h)}t.typedArray=f})(z||(z={}));class zq{constructor(){this.nodeStack=[]}get current(){var e;return(e=this.nodeStack[this.nodeStack.length-1])!==null&&e!==void 0?e:this.rootNode}buildRootNode(e){return this.rootNode=new KS(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const n=new qy;return n.grammarSource=e,n.root=this.rootNode,this.current.content.push(n),this.nodeStack.push(n),n}buildLeafNode(e,n){const r=new By(e.startOffset,e.image.length,ef(e),e.tokenType,!n);return r.grammarSource=n,r.root=this.rootNode,this.current.content.push(r),r}removeNode(e){const n=e.container;if(n){const r=n.content.indexOf(e);r>=0&&n.content.splice(r,1)}}addHiddenNodes(e){const n=[];for(const s of e){const a=new By(s.startOffset,s.image.length,ef(s),s.tokenType,!0);a.root=this.rootNode,n.push(a)}let r=this.current,i=!1;if(r.content.length>0){r.content.push(...n);return}for(;r.container;){const s=r.container.content.indexOf(r);if(s>0){r.container.content.splice(s,0,...n),i=!0;break}r=r.container}i||this.rootNode.content.unshift(...n)}construct(e){const n=this.current;typeof e.$type=="string"&&(this.current.astNode=e),e.$cstNode=n;const r=this.nodeStack.pop();r?.content.length===0&&this.removeNode(r)}}class VS{get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var e,n;const r=typeof((e=this._astNode)===null||e===void 0?void 0:e.$type)=="string"?this._astNode:(n=this.container)===null||n===void 0?void 0:n.astNode;if(!r)throw new Error("This node has no associated AST element");return r}set astNode(e){this._astNode=e}get element(){return this.astNode}get text(){return this.root.fullText.substring(this.offset,this.end)}}class By extends VS{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,n,r,i,s=!1){super(),this._hidden=s,this._offset=e,this._tokenType=i,this._length=n,this._range=r}}class qy extends VS{constructor(){super(...arguments),this.content=new ED(this)}get children(){return this.content}get offset(){var e,n;return(n=(e=this.firstNonHiddenNode)===null||e===void 0?void 0:e.offset)!==null&&n!==void 0?n:0}get length(){return this.end-this.offset}get end(){var e,n;return(n=(e=this.lastNonHiddenNode)===null||e===void 0?void 0:e.end)!==null&&n!==void 0?n:0}get range(){const e=this.firstNonHiddenNode,n=this.lastNonHiddenNode;if(e&&n){if(this._rangeCache===void 0){const{range:r}=e,{range:i}=n;this._rangeCache={start:r.start,end:i.end.line<r.start.line?r.start:i.end}}return this._rangeCache}else return{start:tt.create(0,0),end:tt.create(0,0)}}get firstNonHiddenNode(){for(const e of this.content)if(!e.hidden)return e;return this.content[0]}get lastNonHiddenNode(){for(let e=this.content.length-1;e>=0;e--){const n=this.content[e];if(!n.hidden)return n}return this.content[this.content.length-1]}}class ED extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,ED.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,n,...r){return this.addParents(r),super.splice(e,n,...r)}addParents(e){for(const n of e)n.container=this.parent}}class KS extends qy{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const Gy=Symbol("Datatype");function jy(t){return t.$type===Gy}const YS="\u200B",XS=t=>t.endsWith(YS)?t:t+YS;class JS{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const n=this.lexer.definition,r=e.LanguageMetaData.mode==="production";this.wrapper=new Uq(n,Object.assign(Object.assign({},e.parser.ParserConfig),{skipValidations:r,errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,n){this.wrapper.wrapOr(e,n)}optional(e,n){this.wrapper.wrapOption(e,n)}many(e,n){this.wrapper.wrapMany(e,n)}atLeastOne(e,n){this.wrapper.wrapAtLeastOne(e,n)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}}class Bq extends JS{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new zq,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,n){const r=this.computeRuleType(e),i=this.wrapper.DEFINE_RULE(XS(e.name),this.startImplementation(r,n).bind(this));return this.allRules.set(e.name,i),e.entry&&(this.mainRule=i),i}computeRuleType(e){if(!e.fragment){if(bf(e))return Gy;{const n=ms(e);return n??e.name}}}parse(e,n={}){this.nodeBuilder.buildRootNode(e);const r=this.lexerResult=this.lexer.tokenize(e);this.wrapper.input=r.tokens;const i=n.rule?this.allRules.get(n.rule):this.mainRule;if(!i)throw new Error(n.rule?`No rule found with name '${n.rule}'`:"No main rule available.");const s=i.call(this.wrapper,{});return this.nodeBuilder.addHiddenNodes(r.hidden),this.unorderedGroups.clear(),this.lexerResult=void 0,{value:s,lexerErrors:r.errors,lexerReport:r.report,parserErrors:this.wrapper.errors}}startImplementation(e,n){return r=>{const i=!this.isRecording()&&e!==void 0;if(i){const a={$type:e};this.stack.push(a),e===Gy&&(a.value="")}let s;try{s=n(r)}catch{s=void 0}return s===void 0&&i&&(s=this.construct()),s}}extractHiddenTokens(e){const n=this.lexerResult.hidden;if(!n.length)return[];const r=e.startOffset;for(let i=0;i<n.length;i++)if(n[i].startOffset>r)return n.splice(0,i);return n.splice(0,n.length)}consume(e,n,r){const i=this.wrapper.wrapConsume(e,n);if(!this.isRecording()&&this.isValidToken(i)){const s=this.extractHiddenTokens(i);this.nodeBuilder.addHiddenNodes(s);const a=this.nodeBuilder.buildLeafNode(i,r),{assignment:o,isCrossRef:u}=this.getAssignment(r),c=this.current;if(o){const l=kr(r)?i.image:this.converter.convert(i.image,a);this.assign(o.operator,o.feature,l,a,u)}else if(jy(c)){let l=i.image;kr(r)||(l=this.converter.convert(l,a).toString()),c.value+=l}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,n,r,i,s){let a;!this.isRecording()&&!r&&(a=this.nodeBuilder.buildCompositeNode(i));const o=this.wrapper.wrapSubrule(e,n,s);!this.isRecording()&&a&&a.length>0&&this.performSubruleAssignment(o,i,a)}performSubruleAssignment(e,n,r){const{assignment:i,isCrossRef:s}=this.getAssignment(n);if(i)this.assign(i.operator,i.feature,e,r,s);else if(!i){const a=this.current;if(jy(a))a.value+=e.toString();else if(typeof e=="object"&&e){const u=this.assignWithoutOverride(e,a);this.stack.pop(),this.stack.push(u)}}}action(e,n){if(!this.isRecording()){let r=this.current;if(n.feature&&n.operator){r=this.construct(),this.nodeBuilder.removeNode(r.$cstNode),this.nodeBuilder.buildCompositeNode(n).content.push(r.$cstNode);const s={$type:e};this.stack.push(s),this.assign(n.operator,n.feature,r,r.$cstNode,!1)}else r.$type=e}}construct(){if(this.isRecording())return;const e=this.current;return hg(e),this.nodeBuilder.construct(e),this.stack.pop(),jy(e)?this.converter.convert(e.value,e.$cstNode):(gg(this.astReflection,e),e)}getAssignment(e){if(!this.assignmentMap.has(e)){const n=rn(e,Tr);this.assignmentMap.set(e,{assignment:n,isCrossRef:n?eu(n.terminal):!1})}return this.assignmentMap.get(e)}assign(e,n,r,i,s){const a=this.current;let o;switch(s&&typeof r=="string"?o=this.linker.buildReference(a,n,i,r):o=r,e){case"=":{a[n]=o;break}case"?=":{a[n]=!0;break}case"+=":Array.isArray(a[n])||(a[n]=[]),a[n].push(o)}}assignWithoutOverride(e,n){for(const[i,s]of Object.entries(n)){const a=e[i];a===void 0?e[i]=s:Array.isArray(a)&&Array.isArray(s)&&(s.push(...a),e[i]=s)}const r=e.$cstNode;return r&&(r.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}}class qq{buildMismatchTokenMessage(e){return Ma.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Ma.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Ma.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Ma.buildEarlyExitMessage(e)}}class QS extends qq{buildMismatchTokenMessage({expected:e,actual:n}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${n.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}}class Gq extends JS{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const n=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=n.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,n){const r=this.wrapper.DEFINE_RULE(XS(e.name),this.startImplementation(n).bind(this));return this.allRules.set(e.name,r),e.entry&&(this.mainRule=r),r}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return n=>{const r=this.keepStackSize();try{e(n)}finally{this.resetStackSize(r)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,n,r){this.wrapper.wrapConsume(e,n),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(e,n,r,i,s){this.before(i),this.wrapper.wrapSubrule(e,n,s),this.after(i)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const n=this.elementStack.lastIndexOf(e);n>=0&&this.elementStack.splice(n)}}get currIdx(){return this.wrapper.currIdx}}const jq={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new QS};class Uq extends J3{constructor(e,n){const r=n&&"maxLookahead"in n;super(e,Object.assign(Object.assign(Object.assign({},jq),{lookaheadStrategy:r?new wy({maxLookahead:n.maxLookahead}):new wq({logging:n.skipValidations?()=>{}:void 0})}),n))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,n){return this.RULE(e,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,n){return this.consume(e,n)}wrapSubrule(e,n,r){return this.subrule(e,n,{ARGS:[r]})}wrapOr(e,n){this.or(e,n)}wrapOption(e,n){this.option(e,n)}wrapMany(e,n){this.many(e,n)}wrapAtLeastOne(e,n){this.atLeastOne(e,n)}}function ZS(t,e,n){return Wq({parser:e,tokens:n,ruleNames:new Map},t),e}function Wq(t,e){const n=Dg(e,!1),r=rt(e.rules).filter(nn).filter(i=>n.has(i));for(const i of r){const s=Object.assign(Object.assign({},t),{consume:1,optional:1,subrule:1,many:1,or:1});t.parser.rule(i,$s(s,i.definition))}}function $s(t,e,n=!1){let r;if(kr(e))r=Qq(t,e);else if(hs(e))r=Hq(t,e);else if(Tr(e))r=$s(t,e.terminal);else if(eu(e))r=eT(t,e);else if(Vr(e))r=Vq(t,e);else if(fg(e))r=Yq(t,e);else if(pg(e))r=Xq(t,e);else if(ki(e))r=Jq(t,e);else if(BN(e)){const i=t.consume++;r=()=>t.parser.consume(i,xi,e)}else throw new iE(e.$cstNode,`Unexpected element type: ${e.$type}`);return tT(t,n?void 0:fp(e),r,e.cardinality)}function Hq(t,e){const n=yu(e);return()=>t.parser.action(n,e)}function Vq(t,e){const n=e.rule.ref;if(nn(n)){const r=t.subrule++,i=n.fragment,s=e.arguments.length>0?Kq(n,e.arguments):()=>({});return a=>t.parser.subrule(r,nT(t,n),i,e,s(a))}else if(Hr(n)){const r=t.consume++,i=Uy(t,n.name);return()=>t.parser.consume(r,i,e)}else if(n)No();else throw new iE(e.$cstNode,`Undefined rule: ${e.rule.$refText}`)}function Kq(t,e){const n=e.map(r=>ni(r.value));return r=>{const i={};for(let s=0;s<n.length;s++){const a=t.parameters[s],o=n[s];i[a.name]=o(r)}return i}}function ni(t){if(IN(t)){const e=ni(t.left),n=ni(t.right);return r=>e(r)||n(r)}else if(xN(t)){const e=ni(t.left),n=ni(t.right);return r=>e(r)&&n(r)}else if(NN(t)){const e=ni(t.value);return n=>!e(n)}else if(ON(t)){const e=t.parameter.ref.name;return n=>n!==void 0&&n[e]===!0}else if(PN(t)){const e=!!t.true;return()=>e}No()}function Yq(t,e){if(e.elements.length===1)return $s(t,e.elements[0]);{const n=[];for(const i of e.elements){const s={ALT:$s(t,i,!0)},a=fp(i);a&&(s.GATE=ni(a)),n.push(s)}const r=t.or++;return i=>t.parser.alternatives(r,n.map(s=>{const a={ALT:()=>s.ALT(i)},o=s.GATE;return o&&(a.GATE=()=>o(i)),a}))}}function Xq(t,e){if(e.elements.length===1)return $s(t,e.elements[0]);const n=[];for(const o of e.elements){const u={ALT:$s(t,o,!0)},c=fp(o);c&&(u.GATE=ni(c)),n.push(u)}const r=t.or++,i=(o,u)=>{const c=u.getRuleStack().join("-");return`uGroup_${o}_${c}`},s=o=>t.parser.alternatives(r,n.map((u,c)=>{const l={ALT:()=>!0},d=t.parser;l.ALT=()=>{if(u.ALT(o),!d.isRecording()){const p=i(r,d);d.unorderedGroups.get(p)||d.unorderedGroups.set(p,[]);const h=d.unorderedGroups.get(p);typeof h?.[c]>"u"&&(h[c]=!0)}};const f=u.GATE;return f?l.GATE=()=>f(o):l.GATE=()=>{const p=d.unorderedGroups.get(i(r,d));return!p?.[c]},l})),a=tT(t,fp(e),s,"*");return o=>{a(o),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(r,t.parser))}}function Jq(t,e){const n=e.elements.map(r=>$s(t,r));return r=>n.forEach(i=>i(r))}function fp(t){if(ki(t))return t.guardCondition}function eT(t,e,n=e.terminal){if(n)if(Vr(n)&&nn(n.rule.ref)){const r=n.rule.ref,i=t.subrule++;return s=>t.parser.subrule(i,nT(t,r),!1,e,s)}else if(Vr(n)&&Hr(n.rule.ref)){const r=t.consume++,i=Uy(t,n.rule.ref.name);return()=>t.parser.consume(r,i,e)}else if(kr(n)){const r=t.consume++,i=Uy(t,n.value);return()=>t.parser.consume(r,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const r=Tg(e.type.ref),i=r?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+yu(e.type.ref));return eT(t,e,i)}}function Qq(t,e){const n=t.consume++,r=t.tokens[e.value];if(!r)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(n,r,e)}function tT(t,e,n,r){const i=e&&ni(e);if(!r)if(i){const s=t.or++;return a=>t.parser.alternatives(s,[{ALT:()=>n(a),GATE:()=>i(a)},{ALT:L$(),GATE:()=>!i(a)}])}else return n;if(r==="*"){const s=t.many++;return a=>t.parser.many(s,{DEF:()=>n(a),GATE:i?()=>i(a):void 0})}else if(r==="+"){const s=t.many++;if(i){const a=t.or++;return o=>t.parser.alternatives(a,[{ALT:()=>t.parser.atLeastOne(s,{DEF:()=>n(o)}),GATE:()=>i(o)},{ALT:L$(),GATE:()=>!i(o)}])}else return a=>t.parser.atLeastOne(s,{DEF:()=>n(a)})}else if(r==="?"){const s=t.optional++;return a=>t.parser.optional(s,{DEF:()=>n(a),GATE:i?()=>i(a):void 0})}else No()}function nT(t,e){const n=Zq(t,e),r=t.parser.getRule(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function Zq(t,e){if(nn(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let n=e,r=n.$container,i=e.$type;for(;!nn(r);)(ki(r)||fg(r)||pg(r))&&(i=r.elements.indexOf(n).toString()+":"+i),n=r,r=r.$container;return i=r.name+":"+i,t.ruleNames.set(e,i),i}}function Uy(t,e){const n=t.tokens[e];if(!n)throw new Error(`Token "${e}" not found."`);return n}function eG(t){const e=t.Grammar,n=t.parser.Lexer,r=new Gq(t);return ZS(e,r,n.definition),r.finalize(),r}function tG(t){const e=nG(t);return e.finalize(),e}function nG(t){const e=t.Grammar,n=t.parser.Lexer,r=new Bq(t);return ZS(e,r,n.definition)}class rG{constructor(){this.diagnostics=[]}buildTokens(e,n){const r=rt(Dg(e,!1)),i=this.buildTerminalTokens(r),s=this.buildKeywordTokens(r,i,n);return i.forEach(a=>{const o=a.PATTERN;typeof o=="object"&&o&&"test"in o&&bg(o)?s.unshift(a):s.push(a)}),s}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(Hr).filter(n=>!n.fragment).map(n=>this.buildTerminalToken(n)).toArray()}buildTerminalToken(e){const n=wu(e),r=this.requiresCustomPattern(n)?this.regexPatternFunction(n):n,i={name:e.name,PATTERN:r};return typeof r=="function"&&(i.LINE_BREAKS=!0),e.hidden&&(i.GROUP=bg(n)?_n.SKIPPED:"hidden"),i}requiresCustomPattern(e){return e.flags.includes("u")||e.flags.includes("s")?!0:!!(e.source.includes("?<=")||e.source.includes("?<!"))}regexPatternFunction(e){const n=new RegExp(e,e.flags+"y");return(r,i)=>(n.lastIndex=i,n.exec(r))}buildKeywordTokens(e,n,r){return e.filter(nn).flatMap(i=>Cr(i).filter(kr)).distinct(i=>i.value).toArray().sort((i,s)=>s.value.length-i.value.length).map(i=>this.buildKeywordToken(i,n,!!r?.caseInsensitive))}buildKeywordToken(e,n,r){const i=this.buildKeywordPattern(e,r),s={name:e.value,PATTERN:i,LONGER_ALT:this.findLongerAlt(e,n)};return typeof i=="function"&&(s.LINE_BREAKS=!0),s}buildKeywordPattern(e,n){return n?new RegExp(tO(e.value)):e.value}findLongerAlt(e,n){return n.reduce((r,i)=>{const s=i?.PATTERN;return s?.source&&nO("^"+s.source+"$",e.value)&&r.push(i),r},[])}}class iG{convert(e,n){let r=n.grammarSource;if(eu(r)&&(r=Eg(r)),Vr(r)){const i=r.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,n)}return e}runConverter(e,n,r){var i;switch(e.name.toUpperCase()){case"INT":return ri.convertInt(n);case"STRING":return ri.convertString(n);case"ID":return ri.convertID(n)}switch((i=SE(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return ri.convertNumber(n);case"boolean":return ri.convertBoolean(n);case"bigint":return ri.convertBigint(n);case"date":return ri.convertDate(n);default:return n}}}var ri;(function(t){function e(c){let l="";for(let d=1;d<c.length-1;d++){const f=c.charAt(d);if(f==="\\"){const p=c.charAt(++d);l+=n(p)}else l+=f}return l}t.convertString=e;function n(c){switch(c){case"b":return"\b";case"f":return"\f";case"n":return`
117
+ `;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return c}}function r(c){return c.charAt(0)==="^"?c.substring(1):c}t.convertID=r;function i(c){return parseInt(c)}t.convertInt=i;function s(c){return BigInt(c)}t.convertBigint=s;function a(c){return new Date(c)}t.convertDate=a;function o(c){return Number(c)}t.convertNumber=o;function u(c){return c.toLowerCase()==="true"}t.convertBoolean=u})(ri||(ri={}));var sG=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ss(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ts={},pp={},rT;function ks(){if(rT)return pp;rT=1,Object.defineProperty(pp,"__esModule",{value:!0});let t;function e(){if(t===void 0)throw new Error("No runtime abstraction layer installed");return t}return function(n){function r(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");t=i}n.install=r}(e||(e={})),pp.default=e,pp}var Xt={},iT;function qu(){if(iT)return Xt;iT=1,Object.defineProperty(Xt,"__esModule",{value:!0}),Xt.stringArray=Xt.array=Xt.func=Xt.error=Xt.number=Xt.string=Xt.boolean=void 0;function t(o){return o===!0||o===!1}Xt.boolean=t;function e(o){return typeof o=="string"||o instanceof String}Xt.string=e;function n(o){return typeof o=="number"||o instanceof Number}Xt.number=n;function r(o){return o instanceof Error}Xt.error=r;function i(o){return typeof o=="function"}Xt.func=i;function s(o){return Array.isArray(o)}Xt.array=s;function a(o){return s(o)&&o.every(u=>e(u))}return Xt.stringArray=a,Xt}var Cs={},sT;function ja(){if(sT)return Cs;sT=1,Object.defineProperty(Cs,"__esModule",{value:!0}),Cs.Emitter=Cs.Event=void 0;const t=ks();var e;(function(i){const s={dispose(){}};i.None=function(){return s}})(e||(Cs.Event=e={}));class n{add(s,a=null,o){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(s),this._contexts.push(a),Array.isArray(o)&&o.push({dispose:()=>this.remove(s,a)})}remove(s,a=null){if(!this._callbacks)return;let o=!1;for(let u=0,c=this._callbacks.length;u<c;u++)if(this._callbacks[u]===s)if(this._contexts[u]===a){this._callbacks.splice(u,1),this._contexts.splice(u,1);return}else o=!0;if(o)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...s){if(!this._callbacks)return[];const a=[],o=this._callbacks.slice(0),u=this._contexts.slice(0);for(let c=0,l=o.length;c<l;c++)try{a.push(o[c].apply(u[c],s))}catch(d){(0,t.default)().console.error(d)}return a}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class r{constructor(s){this._options=s}get event(){return this._event||(this._event=(s,a,o)=>{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(s,a);const u={dispose:()=>{this._callbacks&&(this._callbacks.remove(s,a),u.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(o)&&o.push(u),u}),this._event}fire(s){this._callbacks&&this._callbacks.invoke.call(this._callbacks,s)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return Cs.Emitter=r,r._noop=function(){},Cs}var aT;function hp(){if(aT)return Ts;aT=1,Object.defineProperty(Ts,"__esModule",{value:!0}),Ts.CancellationTokenSource=Ts.CancellationToken=void 0;const t=ks(),e=qu(),n=ja();var r;(function(o){o.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),o.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function u(c){const l=c;return l&&(l===o.None||l===o.Cancelled||e.boolean(l.isCancellationRequested)&&!!l.onCancellationRequested)}o.is=u})(r||(Ts.CancellationToken=r={}));const i=Object.freeze(function(o,u){const c=(0,t.default)().timer.setTimeout(o.bind(u),0);return{dispose(){c.dispose()}}});class s{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?i:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class a{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=r.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=r.None}}return Ts.CancellationTokenSource=a,Ts}var ct=hp();function aG(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let mp=0,oG=10;function uG(){return mp=performance.now(),new ct.CancellationTokenSource}const gp=Symbol("OperationCancelled");function yp(t){return t===gp}async function It(t){if(t===ct.CancellationToken.None)return;const e=performance.now();if(e-mp>=oG&&(mp=e,await aG(),mp=performance.now()),t.isCancellationRequested)throw gp}class Wy{constructor(){this.promise=new Promise((e,n)=>{this.resolve=r=>(e(r),this),this.reject=r=>(n(r),this)})}}class Ud{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(let r of e)if(Ud.isIncremental(r)){const i=uT(r.range),s=this.offsetAt(i.start),a=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(a,this._content.length);const o=Math.max(i.start.line,0),u=Math.max(i.end.line,0);let c=this._lineOffsets;const l=oT(r.text,!1,s);if(u-o===l.length)for(let f=0,p=l.length;f<p;f++)c[f+o+1]=l[f];else l.length<1e4?c.splice(o+1,u-o,...l):this._lineOffsets=c=c.slice(0,o+1).concat(l,c.slice(u+1));const d=r.text.length-(a-s);if(d!==0)for(let f=o+1+l.length,p=c.length;f<p;f++)c[f]=c[f]+d}else if(Ud.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=oT(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){let a=Math.floor((r+i)/2);n[a]>e?i=a:r=a+1}let s=r-1;return{line:s,character:e-n[s]}}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}}var wp;(function(t){function e(i,s,a,o){return new Ud(i,s,a,o)}t.create=e;function n(i,s,a){if(i instanceof Ud)return i.update(s,a),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){let a=i.getText(),o=Hy(s.map(cG),(l,d)=>{let f=l.range.start.line-d.range.start.line;return f===0?l.range.start.character-d.range.start.character:f}),u=0;const c=[];for(const l of o){let d=i.offsetAt(l.range.start);if(d<u)throw new Error("Overlapping edit");d>u&&c.push(a.substring(u,d)),l.newText.length&&c.push(l.newText),u=i.offsetAt(l.range.end)}return c.push(a.substr(u)),c.join("")}t.applyEdits=r})(wp||(wp={}));function Hy(t,e){if(t.length<=1)return t;const n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);Hy(r,e),Hy(i,e);let s=0,a=0,o=0;for(;s<r.length&&a<i.length;)e(r[s],i[a])<=0?t[o++]=r[s++]:t[o++]=i[a++];for(;s<r.length;)t[o++]=r[s++];for(;a<i.length;)t[o++]=i[a++];return t}function oT(t,e,n=0){const r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);(s===13||s===10)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function uT(t){const e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function cG(t){const e=uT(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var cT;(()=>{var t={470:i=>{function s(u){if(typeof u!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(u))}function a(u,c){for(var l,d="",f=0,p=-1,h=0,y=0;y<=u.length;++y){if(y<u.length)l=u.charCodeAt(y);else{if(l===47)break;l=47}if(l===47){if(!(p===y-1||h===1))if(p!==y-1&&h===2){if(d.length<2||f!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var b=d.lastIndexOf("/");if(b!==d.length-1){b===-1?(d="",f=0):f=(d=d.slice(0,b)).length-1-d.lastIndexOf("/"),p=y,h=0;continue}}else if(d.length===2||d.length===1){d="",f=0,p=y,h=0;continue}}c&&(d.length>0?d+="/..":d="..",f=2)}else d.length>0?d+="/"+u.slice(p+1,y):d=u.slice(p+1,y),f=y-p-1;p=y,h=0}else l===46&&h!==-1?++h:h=-1}return d}var o={resolve:function(){for(var u,c="",l=!1,d=arguments.length-1;d>=-1&&!l;d--){var f;d>=0?f=arguments[d]:(u===void 0&&(u=process.cwd()),f=u),s(f),f.length!==0&&(c=f+"/"+c,l=f.charCodeAt(0)===47)}return c=a(c,!l),l?c.length>0?"/"+c:"/":c.length>0?c:"."},normalize:function(u){if(s(u),u.length===0)return".";var c=u.charCodeAt(0)===47,l=u.charCodeAt(u.length-1)===47;return(u=a(u,!c)).length!==0||c||(u="."),u.length>0&&l&&(u+="/"),c?"/"+u:u},isAbsolute:function(u){return s(u),u.length>0&&u.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var u,c=0;c<arguments.length;++c){var l=arguments[c];s(l),l.length>0&&(u===void 0?u=l:u+="/"+l)}return u===void 0?".":o.normalize(u)},relative:function(u,c){if(s(u),s(c),u===c||(u=o.resolve(u))===(c=o.resolve(c)))return"";for(var l=1;l<u.length&&u.charCodeAt(l)===47;++l);for(var d=u.length,f=d-l,p=1;p<c.length&&c.charCodeAt(p)===47;++p);for(var h=c.length-p,y=f<h?f:h,b=-1,w=0;w<=y;++w){if(w===y){if(h>y){if(c.charCodeAt(p+w)===47)return c.slice(p+w+1);if(w===0)return c.slice(p+w)}else f>y&&(u.charCodeAt(l+w)===47?b=w:w===0&&(b=0));break}var E=u.charCodeAt(l+w);if(E!==c.charCodeAt(p+w))break;E===47&&(b=w)}var $="";for(w=l+b+1;w<=d;++w)w!==d&&u.charCodeAt(w)!==47||($.length===0?$+="..":$+="/..");return $.length>0?$+c.slice(p+b):(p+=b,c.charCodeAt(p)===47&&++p,c.slice(p))},_makeLong:function(u){return u},dirname:function(u){if(s(u),u.length===0)return".";for(var c=u.charCodeAt(0),l=c===47,d=-1,f=!0,p=u.length-1;p>=1;--p)if((c=u.charCodeAt(p))===47){if(!f){d=p;break}}else f=!1;return d===-1?l?"/":".":l&&d===1?"//":u.slice(0,d)},basename:function(u,c){if(c!==void 0&&typeof c!="string")throw new TypeError('"ext" argument must be a string');s(u);var l,d=0,f=-1,p=!0;if(c!==void 0&&c.length>0&&c.length<=u.length){if(c.length===u.length&&c===u)return"";var h=c.length-1,y=-1;for(l=u.length-1;l>=0;--l){var b=u.charCodeAt(l);if(b===47){if(!p){d=l+1;break}}else y===-1&&(p=!1,y=l+1),h>=0&&(b===c.charCodeAt(h)?--h==-1&&(f=l):(h=-1,f=y))}return d===f?f=y:f===-1&&(f=u.length),u.slice(d,f)}for(l=u.length-1;l>=0;--l)if(u.charCodeAt(l)===47){if(!p){d=l+1;break}}else f===-1&&(p=!1,f=l+1);return f===-1?"":u.slice(d,f)},extname:function(u){s(u);for(var c=-1,l=0,d=-1,f=!0,p=0,h=u.length-1;h>=0;--h){var y=u.charCodeAt(h);if(y!==47)d===-1&&(f=!1,d=h+1),y===46?c===-1?c=h:p!==1&&(p=1):c!==-1&&(p=-1);else if(!f){l=h+1;break}}return c===-1||d===-1||p===0||p===1&&c===d-1&&c===l+1?"":u.slice(c,d)},format:function(u){if(u===null||typeof u!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof u);return function(c,l){var d=l.dir||l.root,f=l.base||(l.name||"")+(l.ext||"");return d?d===l.root?d+f:d+"/"+f:f}(0,u)},parse:function(u){s(u);var c={root:"",dir:"",base:"",ext:"",name:""};if(u.length===0)return c;var l,d=u.charCodeAt(0),f=d===47;f?(c.root="/",l=1):l=0;for(var p=-1,h=0,y=-1,b=!0,w=u.length-1,E=0;w>=l;--w)if((d=u.charCodeAt(w))!==47)y===-1&&(b=!1,y=w+1),d===46?p===-1?p=w:E!==1&&(E=1):p!==-1&&(E=-1);else if(!b){h=w+1;break}return p===-1||y===-1||E===0||E===1&&p===y-1&&p===h+1?y!==-1&&(c.base=c.name=h===0&&f?u.slice(1,y):u.slice(h,y)):(h===0&&f?(c.name=u.slice(1,p),c.base=u.slice(1,y)):(c.name=u.slice(h,p),c.base=u.slice(h,y)),c.ext=u.slice(p,y)),h>0?c.dir=u.slice(0,h-1):f&&(c.dir="/"),c},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,i.exports=o}},e={};function n(i){var s=e[i];if(s!==void 0)return s.exports;var a=e[i]={exports:{}};return t[i](a,a.exports,n),a.exports}n.d=(i,s)=>{for(var a in s)n.o(s,a)&&!n.o(i,a)&&Object.defineProperty(i,a,{enumerable:!0,get:s[a]})},n.o=(i,s)=>Object.prototype.hasOwnProperty.call(i,s),n.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var r={};(()=>{let i;n.r(r),n.d(r,{URI:()=>f,Utils:()=>ae}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,a=/^\//,o=/^\/\//;function u(O,T){if(!O.scheme&&T)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${O.authority}", path: "${O.path}", query: "${O.query}", fragment: "${O.fragment}"}`);if(O.scheme&&!s.test(O.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(O.path){if(O.authority){if(!a.test(O.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(o.test(O.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const c="",l="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class f{static isUri(T){return T instanceof f||!!T&&typeof T.authority=="string"&&typeof T.fragment=="string"&&typeof T.path=="string"&&typeof T.query=="string"&&typeof T.scheme=="string"&&typeof T.fsPath=="string"&&typeof T.with=="function"&&typeof T.toString=="function"}scheme;authority;path;query;fragment;constructor(T,R,F,V,W,H=!1){typeof T=="object"?(this.scheme=T.scheme||c,this.authority=T.authority||c,this.path=T.path||c,this.query=T.query||c,this.fragment=T.fragment||c):(this.scheme=function(Ee,te){return Ee||te?Ee:"file"}(T,H),this.authority=R||c,this.path=function(Ee,te){switch(Ee){case"https":case"http":case"file":te?te[0]!==l&&(te=l+te):te=l}return te}(this.scheme,F||c),this.query=V||c,this.fragment=W||c,u(this,H))}get fsPath(){return E(this)}with(T){if(!T)return this;let{scheme:R,authority:F,path:V,query:W,fragment:H}=T;return R===void 0?R=this.scheme:R===null&&(R=c),F===void 0?F=this.authority:F===null&&(F=c),V===void 0?V=this.path:V===null&&(V=c),W===void 0?W=this.query:W===null&&(W=c),H===void 0?H=this.fragment:H===null&&(H=c),R===this.scheme&&F===this.authority&&V===this.path&&W===this.query&&H===this.fragment?this:new h(R,F,V,W,H)}static parse(T,R=!1){const F=d.exec(T);return F?new h(F[2]||c,I(F[4]||c),I(F[5]||c),I(F[7]||c),I(F[9]||c),R):new h(c,c,c,c,c)}static file(T){let R=c;if(i&&(T=T.replace(/\\/g,l)),T[0]===l&&T[1]===l){const F=T.indexOf(l,2);F===-1?(R=T.substring(2),T=l):(R=T.substring(2,F),T=T.substring(F)||l)}return new h("file",R,T,c,c)}static from(T){const R=new h(T.scheme,T.authority,T.path,T.query,T.fragment);return u(R,!0),R}toString(T=!1){return $(this,T)}toJSON(){return this}static revive(T){if(T){if(T instanceof f)return T;{const R=new h(T);return R._formatted=T.external,R._fsPath=T._sep===p?T.fsPath:null,R}}return T}}const p=i?1:void 0;class h extends f{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=E(this)),this._fsPath}toString(T=!1){return T?$(this,!0):(this._formatted||(this._formatted=$(this,!1)),this._formatted)}toJSON(){const T={$mid:1};return this._fsPath&&(T.fsPath=this._fsPath,T._sep=p),this._formatted&&(T.external=this._formatted),this.path&&(T.path=this.path),this.scheme&&(T.scheme=this.scheme),this.authority&&(T.authority=this.authority),this.query&&(T.query=this.query),this.fragment&&(T.fragment=this.fragment),T}}const y={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function b(O,T,R){let F,V=-1;for(let W=0;W<O.length;W++){const H=O.charCodeAt(W);if(H>=97&&H<=122||H>=65&&H<=90||H>=48&&H<=57||H===45||H===46||H===95||H===126||T&&H===47||R&&H===91||R&&H===93||R&&H===58)V!==-1&&(F+=encodeURIComponent(O.substring(V,W)),V=-1),F!==void 0&&(F+=O.charAt(W));else{F===void 0&&(F=O.substr(0,W));const Ee=y[H];Ee!==void 0?(V!==-1&&(F+=encodeURIComponent(O.substring(V,W)),V=-1),F+=Ee):V===-1&&(V=W)}}return V!==-1&&(F+=encodeURIComponent(O.substring(V))),F!==void 0?F:O}function w(O){let T;for(let R=0;R<O.length;R++){const F=O.charCodeAt(R);F===35||F===63?(T===void 0&&(T=O.substr(0,R)),T+=y[F]):T!==void 0&&(T+=O[R])}return T!==void 0?T:O}function E(O,T){let R;return R=O.authority&&O.path.length>1&&O.scheme==="file"?`//${O.authority}${O.path}`:O.path.charCodeAt(0)===47&&(O.path.charCodeAt(1)>=65&&O.path.charCodeAt(1)<=90||O.path.charCodeAt(1)>=97&&O.path.charCodeAt(1)<=122)&&O.path.charCodeAt(2)===58?O.path[1].toLowerCase()+O.path.substr(2):O.path,i&&(R=R.replace(/\//g,"\\")),R}function $(O,T){const R=T?w:b;let F="",{scheme:V,authority:W,path:H,query:Ee,fragment:te}=O;if(V&&(F+=V,F+=":"),(W||V==="file")&&(F+=l,F+=l),W){let C=W.indexOf("@");if(C!==-1){const me=W.substr(0,C);W=W.substr(C+1),C=me.lastIndexOf(":"),C===-1?F+=R(me,!1,!1):(F+=R(me.substr(0,C),!1,!1),F+=":",F+=R(me.substr(C+1),!1,!0)),F+="@"}W=W.toLowerCase(),C=W.lastIndexOf(":"),C===-1?F+=R(W,!1,!0):(F+=R(W.substr(0,C),!1,!0),F+=W.substr(C))}if(H){if(H.length>=3&&H.charCodeAt(0)===47&&H.charCodeAt(2)===58){const C=H.charCodeAt(1);C>=65&&C<=90&&(H=`/${String.fromCharCode(C+32)}:${H.substr(3)}`)}else if(H.length>=2&&H.charCodeAt(1)===58){const C=H.charCodeAt(0);C>=65&&C<=90&&(H=`${String.fromCharCode(C+32)}:${H.substr(2)}`)}F+=R(H,!0,!1)}return Ee&&(F+="?",F+=R(Ee,!1,!1)),te&&(F+="#",F+=T?te:b(te,!1,!1)),F}function k(O){try{return decodeURIComponent(O)}catch{return O.length>3?O.substr(0,3)+k(O.substr(3)):O}}const A=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function I(O){return O.match(A)?O.replace(A,T=>k(T)):O}var M=n(470);const Y=M.posix||M,Q="/";var ae;(function(O){O.joinPath=function(T,...R){return T.with({path:Y.join(T.path,...R)})},O.resolvePath=function(T,...R){let F=T.path,V=!1;F[0]!==Q&&(F=Q+F,V=!0);let W=Y.resolve(F,...R);return V&&W[0]===Q&&!T.authority&&(W=W.substring(1)),T.with({path:W})},O.dirname=function(T){if(T.path.length===0||T.path===Q)return T;let R=Y.dirname(T.path);return R.length===1&&R.charCodeAt(0)===46&&(R=""),T.with({path:R})},O.basename=function(T){return Y.basename(T.path)},O.extname=function(T){return Y.extname(T.path)}})(ae||(ae={}))})(),cT=r})();const{URI:Jt,Utils:Gu}=cT;var kt;(function(t){t.basename=Gu.basename,t.dirname=Gu.dirname,t.extname=Gu.extname,t.joinPath=Gu.joinPath,t.resolvePath=Gu.resolvePath;function e(i,s){return i?.toString()===s?.toString()}t.equals=e;function n(i,s){const a=typeof i=="string"?i:i.path,o=typeof s=="string"?s:s.path,u=a.split("/").filter(p=>p.length>0),c=o.split("/").filter(p=>p.length>0);let l=0;for(;l<u.length&&u[l]===c[l];l++);const d="../".repeat(u.length-l),f=c.slice(l).join("/");return d+f}t.relative=n;function r(i){return Jt.parse(i.toString()).toString()}t.normalize=r})(kt||(kt={}));var We;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(We||(We={}));class lG{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,n=ct.CancellationToken.None){const r=await this.fileSystemProvider.readFile(e);return this.createAsync(e,r,n)}fromTextDocument(e,n,r){return n=n??Jt.parse(e.uri),ct.CancellationToken.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromString(e,n,r){return ct.CancellationToken.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromModel(e,n){return this.create(n,{$model:e})}create(e,n,r){if(typeof n=="string"){const i=this.parse(e,n,r);return this.createLangiumDocument(i,e,void 0,n)}else if("$model"in n){const i={value:n.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,n.getText(),r);return this.createLangiumDocument(i,e,n)}}async createAsync(e,n,r){if(typeof n=="string"){const i=await this.parseAsync(e,n,r);return this.createLangiumDocument(i,e,void 0,n)}else{const i=await this.parseAsync(e,n.getText(),r);return this.createLangiumDocument(i,e,n)}}createLangiumDocument(e,n,r,i){let s;if(r)s={parseResult:e,uri:n,state:We.Parsed,references:[],textDocument:r};else{const a=this.createTextDocumentGetter(n,i);s={parseResult:e,uri:n,state:We.Parsed,references:[],get textDocument(){return a()}}}return e.value.$document=s,s}async update(e,n){var r,i;const s=(r=e.parseResult.value.$cstNode)===null||r===void 0?void 0:r.root.fullText,a=(i=this.textDocuments)===null||i===void 0?void 0:i.get(e.uri.toString()),o=a?a.getText():await this.fileSystemProvider.readFile(e.uri);if(a)Object.defineProperty(e,"textDocument",{value:a});else{const u=this.createTextDocumentGetter(e.uri,o);Object.defineProperty(e,"textDocument",{get:u})}return s!==o&&(e.parseResult=await this.parseAsync(e.uri,o,n),e.parseResult.value.$document=e),e.state=We.Parsed,e}parse(e,n,r){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(n,r)}parseAsync(e,n,r){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(n,r)}createTextDocumentGetter(e,n){const r=this.serviceRegistry;let i;return()=>i??(i=wp.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,n??""))}}class dG{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.serviceRegistry=e.ServiceRegistry}get all(){return rt(this.documentMap.values())}addDocument(e){const n=e.uri.toString();if(this.documentMap.has(n))throw new Error(`A document with the URI '${n}' is already present.`);this.documentMap.set(n,e)}getDocument(e){const n=e.toString();return this.documentMap.get(n)}async getOrCreateDocument(e,n){let r=this.getDocument(e);return r||(r=await this.langiumDocumentFactory.fromUri(e,n),this.addDocument(r),r)}createDocument(e,n,r){if(r)return this.langiumDocumentFactory.fromString(n,e,r).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(n,e);return this.addDocument(i),i}}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){const n=e.toString(),r=this.documentMap.get(n);return r&&(this.serviceRegistry.getServices(e).references.Linker.unlink(r),r.state=We.Changed,r.precomputedScopes=void 0,r.diagnostics=void 0),r}deleteDocument(e){const n=e.toString(),r=this.documentMap.get(n);return r&&(r.state=We.Changed,this.documentMap.delete(n)),r}}const Vy=Symbol("ref_resolving");class fG{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}async link(e,n=ct.CancellationToken.None){for(const r of Kr(e.parseResult.value))await It(n),pf(r).forEach(i=>this.doLink(i,e))}doLink(e,n){var r;const i=e.reference;if(i._ref===void 0){i._ref=Vy;try{const s=this.getCandidate(e);if(Qd(s))i._ref=s;else if(i._nodeDescription=s,this.langiumDocuments().hasDocument(s.documentUri)){const a=this.loadAstNode(s);i._ref=a??this.createLinkingError(e,s)}else i._ref=void 0}catch(s){console.error(`An error occurred while resolving reference to '${i.$refText}':`,s);const a=(r=s.message)!==null&&r!==void 0?r:String(s);i._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${i.$refText}': ${a}`})}n.references.push(i)}}unlink(e){for(const n of e.references)delete n._ref,delete n._nodeDescription;e.references=[]}getCandidate(e){const r=this.scopeProvider.getScope(e).getElement(e.reference.$refText);return r??this.createLinkingError(e)}buildReference(e,n,r,i){const s=this,a={$refNode:r,$refText:i,get ref(){var o;if($t(this._ref))return this._ref;if(SN(this._nodeDescription)){const u=s.loadAstNode(this._nodeDescription);this._ref=u??s.createLinkingError({reference:a,container:e,property:n},this._nodeDescription)}else if(this._ref===void 0){this._ref=Vy;const u=ff(e).$document,c=s.getLinkedNode({reference:a,container:e,property:n});if(c.error&&u&&u.state<We.ComputedScopes)return this._ref=void 0;this._ref=(o=c.node)!==null&&o!==void 0?o:c.error,this._nodeDescription=c.descr,u?.references.push(this)}else if(this._ref===Vy)throw new Error(`Cyclic reference resolution detected: ${s.astNodeLocator.getAstNodePath(e)}/${n} (symbol '${i}')`);return $t(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return Qd(this._ref)?this._ref:void 0}};return a}getLinkedNode(e){var n;try{const r=this.getCandidate(e);if(Qd(r))return{error:r};const i=this.loadAstNode(r);return i?{node:i,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const i=(n=r.message)!==null&&n!==void 0?n:String(r);return{error:Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${e.reference.$refText}': ${i}`})}}}loadAstNode(e){if(e.node)return e.node;const n=this.langiumDocuments().getDocument(e.documentUri);if(n)return this.astNodeLocator.getAstNode(n.parseResult.value,e.path)}createLinkingError(e,n){const r=ff(e.container).$document;r&&r.state<We.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${r.uri}).`);const i=this.reflection.getReferenceType(e);return Object.assign(Object.assign({},e),{message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:n})}}function vp(t){return typeof t.name=="string"}class lT{getName(e){if(vp(e))return e.name}getNameNode(e){return sn(e.$cstNode,"name")}}class pG{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){const n=vE(e),r=e.astNode;if(n&&r){const i=r[n.feature];if(Wn(i))return i.ref;if(Array.isArray(i)){for(const s of i)if(Wn(s)&&s.$refNode&&s.$refNode.offset<=e.offset&&s.$refNode.end>=e.end)return s.ref}}if(r){const i=this.nameProvider.getNameNode(r);if(i&&(i===e||JD(e,i)))return r}}}findDeclarationNode(e){const n=this.findDeclaration(e);if(n?.$cstNode){const r=this.nameProvider.getNameNode(n);return r??n.$cstNode}}findReferences(e,n){const r=[];if(n.includeDeclaration){const s=this.getReferenceToSelf(e);s&&r.push(s)}let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return n.documentUri&&(i=i.filter(s=>kt.equals(s.sourceUri,n.documentUri))),r.push(...i),rt(r)}getReferenceToSelf(e){const n=this.nameProvider.getNameNode(e);if(n){const r=wt(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:r.uri,sourcePath:i,targetUri:r.uri,targetPath:i,segment:Io(n),local:!0}}}}class Mn{constructor(e){if(this.map=new Map,e)for(const[n,r]of e)this.add(n,r)}get size(){return eg.sum(rt(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,n){if(n===void 0)return this.map.delete(e);{const r=this.map.get(e);if(r){const i=r.indexOf(n);if(i>=0)return r.length===1?this.map.delete(e):r.splice(i,1),!0}return!1}}get(e){var n;return(n=this.map.get(e))!==null&&n!==void 0?n:[]}has(e,n){if(n===void 0)return this.map.has(e);{const r=this.map.get(e);return r?r.indexOf(n)>=0:!1}}add(e,n){return this.map.has(e)?this.map.get(e).push(n):this.map.set(e,[n]),this}addAll(e,n){return this.map.has(e)?this.map.get(e).push(...n):this.map.set(e,Array.from(n)),this}forEach(e){this.map.forEach((n,r)=>n.forEach(i=>e(i,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return rt(this.map.entries()).flatMap(([e,n])=>n.map(r=>[e,r]))}keys(){return rt(this.map.keys())}values(){return rt(this.map.values()).flat()}entriesGroupedByKey(){return rt(this.map.entries())}}class dT{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[n,r]of e)this.set(n,r)}clear(){this.map.clear(),this.inverse.clear()}set(e,n){return this.map.set(e,n),this.inverse.set(n,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const n=this.map.get(e);return n!==void 0?(this.map.delete(e),this.inverse.delete(n),!0):!1}}class fT{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,n=ct.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,n)}async computeExportsForNode(e,n,r=pu,i=ct.CancellationToken.None){const s=[];this.exportNode(e,s,n);for(const a of r(e))await It(i),this.exportNode(a,s,n);return s}exportNode(e,n,r){const i=this.nameProvider.getName(e);i&&n.push(this.descriptions.createDescription(e,i,r))}async computeLocalScopes(e,n=ct.CancellationToken.None){const r=e.parseResult.value,i=new Mn;for(const s of Cr(r))await It(n),this.processNode(s,e,i);return i}processNode(e,n,r){const i=e.$container;if(i){const s=this.nameProvider.getName(e);s&&r.add(i,this.descriptions.createDescription(e,s,n))}}}class As{constructor(e,n,r){var i;this.elements=e,this.outerScope=n,this.caseInsensitive=(i=r?.caseInsensitive)!==null&&i!==void 0?i:!1}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const n=this.caseInsensitive?this.elements.find(r=>r.name.toLowerCase()===e.toLowerCase()):this.elements.find(r=>r.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}}class pT{constructor(e,n,r){var i;this.elements=new Map,this.caseInsensitive=(i=r?.caseInsensitive)!==null&&i!==void 0?i:!1;for(const s of e){const a=this.caseInsensitive?s.name.toLowerCase():s.name;this.elements.set(a,s)}this.outerScope=n}getElement(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(n);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getAllElements(){let e=rt(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}const bp={getElement(){},getAllElements(){return $a}};class hT{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}}class hG extends hT{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,n){this.throwIfDisposed(),this.cache.set(e,n)}get(e,n){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(n){const r=n();return this.cache.set(e,r),r}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}}class mT extends hT{constructor(e){super(),this.cache=new Map,this.converter=e??(n=>n)}has(e,n){return this.throwIfDisposed(),this.cacheForContext(e).has(n)}set(e,n,r){this.throwIfDisposed(),this.cacheForContext(e).set(n,r)}get(e,n,r){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(n))return i.get(n);if(r){const s=r();return i.set(n,s),s}else return}delete(e,n){return this.throwIfDisposed(),this.cacheForContext(e).delete(n)}clear(e){if(this.throwIfDisposed(),e){const n=this.converter(e);this.cache.delete(n)}else this.cache.clear()}cacheForContext(e){const n=this.converter(e);let r=this.cache.get(n);return r||(r=new Map,this.cache.set(n,r)),r}}class gT extends mT{constructor(e,n){super(r=>r.toString()),n?(this.toDispose.push(e.workspace.DocumentBuilder.onDocumentPhase(n,r=>{this.clear(r.uri.toString())})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,i)=>{for(const s of i)this.clear(s)}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,i)=>{const s=r.concat(i);for(const a of s)this.clear(a)}))}}class yT extends hG{constructor(e,n){super(),n?(this.toDispose.push(e.workspace.DocumentBuilder.onBuildPhase(n,()=>{this.clear()})),this.toDispose.push(e.workspace.DocumentBuilder.onUpdate((r,i)=>{i.length>0&&this.clear()}))):this.toDispose.push(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}class wT{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new yT(e.shared)}getScope(e){const n=[],r=this.reflection.getReferenceType(e),i=wt(e.container).precomputedScopes;if(i){let a=e.container;do{const o=i.get(a);o.length>0&&n.push(rt(o).filter(u=>this.reflection.isSubtype(u.type,r))),a=a.$container}while(a)}let s=this.getGlobalScope(r,e);for(let a=n.length-1;a>=0;a--)s=this.createScope(n[a],s);return s}createScope(e,n,r){return new As(rt(e),n,r)}createScopeForNodes(e,n,r){const i=rt(e).map(s=>{const a=this.nameProvider.getName(s);if(a)return this.descriptions.createDescription(s,a)}).nonNullable();return new As(i,n,r)}getGlobalScope(e,n){return this.globalScopeCache.get(e,()=>new pT(this.indexManager.allElements(e)))}}function mG(t){return typeof t.$comment=="string"}function vT(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class gG{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,n){const r=n??{},i=n?.replacer,s=(o,u)=>this.replacer(o,u,r),a=i?(o,u)=>i(o,u,s):s;try{return this.currentDocument=wt(e),JSON.stringify(e,a,n?.space)}finally{this.currentDocument=void 0}}deserialize(e,n){const r=n??{},i=JSON.parse(e);return this.linkNode(i,i,r),i}replacer(e,n,{refText:r,sourceText:i,textRegions:s,comments:a,uriConverter:o}){var u,c,l,d;if(!this.ignoreProperties.has(e))if(Wn(n)){const f=n.ref,p=r?n.$refText:void 0;if(f){const h=wt(f);let y="";this.currentDocument&&this.currentDocument!==h&&(o?y=o(h.uri,n):y=h.uri.toString());const b=this.astNodeLocator.getAstNodePath(f);return{$ref:`${y}#${b}`,$refText:p}}else return{$error:(c=(u=n.error)===null||u===void 0?void 0:u.message)!==null&&c!==void 0?c:"Could not resolve reference",$refText:p}}else if($t(n)){let f;if(s&&(f=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},n)),(!e||n.$document)&&f?.$textRegion&&(f.$textRegion.documentURI=(l=this.currentDocument)===null||l===void 0?void 0:l.uri.toString())),i&&!e&&(f??(f=Object.assign({},n)),f.$sourceText=(d=n.$cstNode)===null||d===void 0?void 0:d.text),a){f??(f=Object.assign({},n));const p=this.commentProvider.getComment(n);p&&(f.$comment=p.replace(/\r/g,""))}return f??n}else return n}addAstNodeRegionWithAssignmentsTo(e){const n=r=>({offset:r.offset,end:r.end,length:r.length,range:r.range});if(e.$cstNode){const r=e.$textRegion=n(e.$cstNode),i=r.assignments={};return Object.keys(e).filter(s=>!s.startsWith("$")).forEach(s=>{const a=Ca(e.$cstNode,s).map(n);a.length!==0&&(i[s]=a)}),e}}linkNode(e,n,r,i,s,a){for(const[u,c]of Object.entries(e))if(Array.isArray(c))for(let l=0;l<c.length;l++){const d=c[l];vT(d)?c[l]=this.reviveReference(e,u,n,d,r):$t(d)&&this.linkNode(d,n,r,e,u,l)}else vT(c)?e[u]=this.reviveReference(e,u,n,c,r):$t(c)&&this.linkNode(c,n,r,e,u);const o=e;o.$container=i,o.$containerProperty=s,o.$containerIndex=a}reviveReference(e,n,r,i,s){let a=i.$refText,o=i.$error;if(i.$ref){const u=this.getRefNode(r,i.$ref,s.uriConverter);if($t(u))return a||(a=this.nameProvider.getName(u)),{$refText:a??"",ref:u};o=u}if(o){const u={$refText:a??""};return u.error={container:e,property:n,message:o,reference:u},u}else return}getRefNode(e,n,r){try{const i=n.indexOf("#");if(i===0){const u=this.astNodeLocator.getAstNode(e,n.substring(1));return u||"Could not resolve path: "+n}if(i<0){const u=r?r(n):Jt.parse(n),c=this.langiumDocuments.getDocument(u);return c?c.parseResult.value:"Could not find document for URI: "+n}const s=r?r(n.substring(0,i)):Jt.parse(n.substring(0,i)),a=this.langiumDocuments.getDocument(s);if(!a)return"Could not find document for URI: "+n;if(i===n.length-1)return a.parseResult.value;const o=this.astNodeLocator.getAstNode(a.parseResult.value,n.substring(i+1));return o||"Could not resolve URI: "+n}catch(i){return String(i)}}}class yG{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.textDocuments=e?.workspace.TextDocuments}register(e){const n=e.LanguageMetaData;for(const r of n.fileExtensions)this.fileExtensionMap.has(r)&&console.warn(`The file extension ${r} is used by multiple languages. It is now assigned to '${n.languageId}'.`),this.fileExtensionMap.set(r,e);this.languageIdMap.set(n.languageId,e),this.languageIdMap.size===1?this.singleton=e:this.singleton=void 0}getServices(e){var n,r;if(this.singleton!==void 0)return this.singleton;if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const i=(r=(n=this.textDocuments)===null||n===void 0?void 0:n.get(e))===null||r===void 0?void 0:r.languageId;if(i!==void 0){const o=this.languageIdMap.get(i);if(o)return o}const s=kt.extname(e),a=this.fileExtensionMap.get(s);if(!a)throw i?new Error(`The service registry contains no services for the extension '${s}' for language '${i}'.`):new Error(`The service registry contains no services for the extension '${s}'.`);return a}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}}function ju(t){return{code:t}}var Dp;(function(t){t.all=["fast","slow","built-in"]})(Dp||(Dp={}));class wG{constructor(e){this.entries=new Mn,this.entriesBefore=[],this.entriesAfter=[],this.reflection=e.shared.AstReflection}register(e,n=this,r="fast"){if(r==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");for(const[i,s]of Object.entries(e)){const a=s;if(Array.isArray(a))for(const o of a){const u={check:this.wrapValidationException(o,n),category:r};this.addEntry(i,u)}else if(typeof a=="function"){const o={check:this.wrapValidationException(a,n),category:r};this.addEntry(i,o)}else No()}}wrapValidationException(e,n){return async(r,i,s)=>{await this.handleException(()=>e.call(n,r,i,s),"An error occurred during validation",i,r)}}async handleException(e,n,r,i){try{await e()}catch(s){if(yp(s))throw s;console.error(`${n}:`,s),s instanceof Error&&s.stack&&console.error(s.stack);const a=s instanceof Error?s.message:String(s);r("error",`${n}: ${a}`,{node:i})}}addEntry(e,n){if(e==="AstNode"){this.entries.add("AstNode",n);return}for(const r of this.reflection.getAllSubTypes(e))this.entries.add(r,n)}getChecks(e,n){let r=rt(this.entries.get(e)).concat(this.entries.get("AstNode"));return n&&(r=r.filter(i=>n.includes(i.category))),r.map(i=>i.check)}registerBeforeDocument(e,n=this){this.entriesBefore.push(this.wrapPreparationException(e,"An error occurred during set-up of the validation",n))}registerAfterDocument(e,n=this){this.entriesAfter.push(this.wrapPreparationException(e,"An error occurred during tear-down of the validation",n))}wrapPreparationException(e,n,r){return async(i,s,a,o)=>{await this.handleException(()=>e.call(r,i,s,a,o),n,s,i)}}get checksBefore(){return this.entriesBefore}get checksAfter(){return this.entriesAfter}}class vG{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,n={},r=ct.CancellationToken.None){const i=e.parseResult,s=[];if(await It(r),(!n.categories||n.categories.includes("built-in"))&&(this.processLexingErrors(i,s,n),n.stopAfterLexingErrors&&s.some(a=>{var o;return((o=a.data)===null||o===void 0?void 0:o.code)===fr.LexingError})||(this.processParsingErrors(i,s,n),n.stopAfterParsingErrors&&s.some(a=>{var o;return((o=a.data)===null||o===void 0?void 0:o.code)===fr.ParsingError}))||(this.processLinkingErrors(e,s,n),n.stopAfterLinkingErrors&&s.some(a=>{var o;return((o=a.data)===null||o===void 0?void 0:o.code)===fr.LinkingError}))))return s;try{s.push(...await this.validateAst(i.value,n,r))}catch(a){if(yp(a))throw a;console.error("An error occurred during validation:",a)}return await It(r),s}processLexingErrors(e,n,r){var i,s,a;const o=[...e.lexerErrors,...(s=(i=e.lexerReport)===null||i===void 0?void 0:i.diagnostics)!==null&&s!==void 0?s:[]];for(const u of o){const c=(a=u.severity)!==null&&a!==void 0?a:"error",l={severity:Ky(c),range:{start:{line:u.line-1,character:u.column-1},end:{line:u.line-1,character:u.column+u.length-1}},message:u.message,data:DG(c),source:this.getSource()};n.push(l)}}processParsingErrors(e,n,r){for(const i of e.parserErrors){let s;if(isNaN(i.token.startOffset)){if("previousToken"in i){const a=i.previousToken;if(isNaN(a.startOffset)){const o={line:0,character:0};s={start:o,end:o}}else{const o={line:a.endLine-1,character:a.endColumn};s={start:o,end:o}}}}else s=ef(i.token);if(s){const a={severity:Ky("error"),range:s,message:i.message,data:ju(fr.ParsingError),source:this.getSource()};n.push(a)}}}processLinkingErrors(e,n,r){for(const i of e.references){const s=i.error;if(s){const a={node:s.container,property:s.property,index:s.index,data:{code:fr.LinkingError,containerType:s.container.$type,property:s.property,refText:s.reference.$refText}};n.push(this.toDiagnostic("error",s.message,a))}}}async validateAst(e,n,r=ct.CancellationToken.None){const i=[],s=(a,o,u)=>{i.push(this.toDiagnostic(a,o,u))};return await this.validateAstBefore(e,n,s,r),await this.validateAstNodes(e,n,s,r),await this.validateAstAfter(e,n,s,r),i}async validateAstBefore(e,n,r,i=ct.CancellationToken.None){var s;const a=this.validationRegistry.checksBefore;for(const o of a)await It(i),await o(e,r,(s=n.categories)!==null&&s!==void 0?s:[],i)}async validateAstNodes(e,n,r,i=ct.CancellationToken.None){await Promise.all(Kr(e).map(async s=>{await It(i);const a=this.validationRegistry.getChecks(s.$type,n.categories);for(const o of a)await o(s,r,i)}))}async validateAstAfter(e,n,r,i=ct.CancellationToken.None){var s;const a=this.validationRegistry.checksAfter;for(const o of a)await It(i),await o(e,r,(s=n.categories)!==null&&s!==void 0?s:[],i)}toDiagnostic(e,n,r){return{message:n,range:bG(r),severity:Ky(e),code:r.code,codeDescription:r.codeDescription,tags:r.tags,relatedInformation:r.relatedInformation,data:r.data,source:this.getSource()}}getSource(){return this.metadata.languageId}}function bG(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=sn(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=gu(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function Ky(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}function DG(t){switch(t){case"error":return ju(fr.LexingError);case"warning":return ju(fr.LexingWarning);case"info":return ju(fr.LexingInfo);case"hint":return ju(fr.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var fr;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(fr||(fr={}));class EG{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,n,r){const i=r??wt(e);n??(n=this.nameProvider.getName(e));const s=this.astNodeLocator.getAstNodePath(e);if(!n)throw new Error(`Node at path ${s} has no name.`);let a;const o=()=>{var u;return a??(a=Io((u=this.nameProvider.getNameNode(e))!==null&&u!==void 0?u:e.$cstNode))};return{node:e,name:n,get nameSegment(){return o()},selectionSegment:Io(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}}class RG{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,n=ct.CancellationToken.None){const r=[],i=e.parseResult.value;for(const s of Kr(i))await It(n),pf(s).filter(a=>!Qd(a)).forEach(a=>{const o=this.createDescription(a);o&&r.push(o)});return r}createDescription(e){const n=e.reference.$nodeDescription,r=e.reference.$refNode;if(!n||!r)return;const i=wt(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:n.documentUri,targetPath:n.path,segment:Io(r),local:kt.equals(n.documentUri,i)}}}class $G{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const n=this.getAstNodePath(e.$container),r=this.getPathSegment(e);return n+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:e,$containerIndex:n}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return n!==void 0?e+this.indexSeparator+n:e}getAstNode(e,n){return n.split(this.segmentSeparator).reduce((i,s)=>{if(!i||s.length===0)return i;const a=s.indexOf(this.indexSeparator);if(a>0){const o=s.substring(0,a),u=parseInt(s.substring(a+1)),c=i[o];return c?.[u]}return i[s]},e)}}var SG=ja();class TG{constructor(e){this._ready=new Wy,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new SG.Emitter,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var n,r;this.workspaceConfig=(r=(n=e.capabilities.workspace)===null||n===void 0?void 0:n.configuration)!==null&&r!==void 0?r:!1}async initialized(e){if(this.workspaceConfig){if(e.register){const n=this.serviceRegistry.all;e.register({section:n.map(r=>this.toSectionName(r.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const n=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),r=await e.fetchConfiguration(n);n.forEach((i,s)=>{this.updateSectionConfiguration(i.section,r[s])})}}this._ready.resolve()}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach(n=>{const r=e.settings[n];this.updateSectionConfiguration(n,r),this.onConfigurationSectionUpdateEmitter.fire({section:n,configuration:r})})}updateSectionConfiguration(e,n){this.settings[e]=n}async getConfiguration(e,n){await this.ready;const r=this.toSectionName(e);if(this.settings[r])return this.settings[r][n]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}var _s;(function(t){function e(n){return{dispose:async()=>await n()}}t.create=e})(_s||(_s={}));class kG{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new Mn,this.documentPhaseListeners=new Mn,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=We.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,n={},r=ct.CancellationToken.None){var i,s;for(const a of e){const o=a.uri.toString();if(a.state===We.Validated){if(typeof n.validation=="boolean"&&n.validation)a.state=We.IndexedReferences,a.diagnostics=void 0,this.buildState.delete(o);else if(typeof n.validation=="object"){const u=this.buildState.get(o),c=(i=u?.result)===null||i===void 0?void 0:i.validationChecks;if(c){const d=((s=n.validation.categories)!==null&&s!==void 0?s:Dp.all).filter(f=>!c.includes(f));d.length>0&&(this.buildState.set(o,{completed:!1,options:{validation:Object.assign(Object.assign({},n.validation),{categories:d})},result:u.result}),a.state=We.IndexedReferences)}}}else this.buildState.delete(o)}this.currentState=We.Changed,await this.emitUpdate(e.map(a=>a.uri),[]),await this.buildDocuments(e,n,r)}async update(e,n,r=ct.CancellationToken.None){this.currentState=We.Changed;for(const a of n)this.langiumDocuments.deleteDocument(a),this.buildState.delete(a.toString()),this.indexManager.remove(a);for(const a of e){if(!this.langiumDocuments.invalidateDocument(a)){const u=this.langiumDocumentFactory.fromModel({$type:"INVALID"},a);u.state=We.Changed,this.langiumDocuments.addDocument(u)}this.buildState.delete(a.toString())}const i=rt(e).concat(n).map(a=>a.toString()).toSet();this.langiumDocuments.all.filter(a=>!i.has(a.uri.toString())&&this.shouldRelink(a,i)).forEach(a=>{this.serviceRegistry.getServices(a.uri).references.Linker.unlink(a),a.state=Math.min(a.state,We.ComputedScopes),a.diagnostics=void 0}),await this.emitUpdate(e,n),await It(r);const s=this.sortDocuments(this.langiumDocuments.all.filter(a=>{var o;return a.state<We.Linked||!(!((o=this.buildState.get(a.uri.toString()))===null||o===void 0)&&o.completed)}).toArray());await this.buildDocuments(s,this.updateBuildOptions,r)}async emitUpdate(e,n){await Promise.all(this.updateListeners.map(r=>r(e,n)))}sortDocuments(e){let n=0,r=e.length-1;for(;n<r;){for(;n<e.length&&this.hasTextDocument(e[n]);)n++;for(;r>=0&&!this.hasTextDocument(e[r]);)r--;n<r&&([e[n],e[r]]=[e[r],e[n]])}return e}hasTextDocument(e){var n;return!!(!((n=this.textDocuments)===null||n===void 0)&&n.get(e.uri))}shouldRelink(e,n){return e.references.some(r=>r.error!==void 0)?!0:this.indexManager.isAffected(e,n)}onUpdate(e){return this.updateListeners.push(e),_s.create(()=>{const n=this.updateListeners.indexOf(e);n>=0&&this.updateListeners.splice(n,1)})}async buildDocuments(e,n,r){this.prepareBuild(e,n),await this.runCancelable(e,We.Parsed,r,s=>this.langiumDocumentFactory.update(s,r)),await this.runCancelable(e,We.IndexedContent,r,s=>this.indexManager.updateContent(s,r)),await this.runCancelable(e,We.ComputedScopes,r,async s=>{const a=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.precomputedScopes=await a.computeLocalScopes(s,r)}),await this.runCancelable(e,We.Linked,r,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,r)),await this.runCancelable(e,We.IndexedReferences,r,s=>this.indexManager.updateReferences(s,r));const i=e.filter(s=>this.shouldValidate(s));await this.runCancelable(i,We.Validated,r,s=>this.validate(s,r));for(const s of e){const a=this.buildState.get(s.uri.toString());a&&(a.completed=!0)}}prepareBuild(e,n){for(const r of e){const i=r.uri.toString(),s=this.buildState.get(i);(!s||s.completed)&&this.buildState.set(i,{completed:!1,options:n,result:s?.result})}}async runCancelable(e,n,r,i){const s=e.filter(o=>o.state<n);for(const o of s)await It(r),await i(o),o.state=n,await this.notifyDocumentPhase(o,n,r);const a=e.filter(o=>o.state===n);await this.notifyBuildPhase(a,n,r),this.currentState=n}onBuildPhase(e,n){return this.buildPhaseListeners.add(e,n),_s.create(()=>{this.buildPhaseListeners.delete(e,n)})}onDocumentPhase(e,n){return this.documentPhaseListeners.add(e,n),_s.create(()=>{this.documentPhaseListeners.delete(e,n)})}waitUntil(e,n,r){let i;if(n&&"path"in n?i=n:r=n,r??(r=ct.CancellationToken.None),i){const s=this.langiumDocuments.getDocument(i);if(s&&s.state>e)return Promise.resolve(i)}return this.currentState>=e?Promise.resolve(void 0):r.isCancellationRequested?Promise.reject(gp):new Promise((s,a)=>{const o=this.onBuildPhase(e,()=>{if(o.dispose(),u.dispose(),i){const c=this.langiumDocuments.getDocument(i);s(c?.uri)}else s(void 0)}),u=r.onCancellationRequested(()=>{o.dispose(),u.dispose(),a(gp)})})}async notifyDocumentPhase(e,n,r){const s=this.documentPhaseListeners.get(n).slice();for(const a of s)try{await a(e,r)}catch(o){if(!yp(o))throw o}}async notifyBuildPhase(e,n,r){if(e.length===0)return;const s=this.buildPhaseListeners.get(n).slice();for(const a of s)await It(r),await a(e,r)}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,n){var r,i;const s=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,a=this.getBuildOptions(e).validation,o=typeof a=="object"?a:void 0,u=await s.validateDocument(e,o,n);e.diagnostics?e.diagnostics.push(...u):e.diagnostics=u;const c=this.buildState.get(e.uri.toString());if(c){(r=c.result)!==null&&r!==void 0||(c.result={});const l=(i=o?.categories)!==null&&i!==void 0?i:Dp.all;c.result.validationChecks?c.result.validationChecks.push(...l):c.result.validationChecks=[...l]}}getBuildOptions(e){var n,r;return(r=(n=this.buildState.get(e.uri.toString()))===null||n===void 0?void 0:n.options)!==null&&r!==void 0?r:{}}}class CG{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new mT,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,n){const r=wt(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(a=>{kt.equals(a.targetUri,r)&&a.targetPath===n&&i.push(a)})}),rt(i)}allElements(e,n){let r=rt(this.symbolIndex.keys());return n&&(r=r.filter(i=>!n||n.has(i))),r.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,n){var r;return n?this.symbolByTypeIndex.get(e,n,()=>{var s;return((s=this.symbolIndex.get(e))!==null&&s!==void 0?s:[]).filter(o=>this.astReflection.isSubtype(o.type,n))}):(r=this.symbolIndex.get(e))!==null&&r!==void 0?r:[]}remove(e){const n=e.toString();this.symbolIndex.delete(n),this.symbolByTypeIndex.clear(n),this.referenceIndex.delete(n)}async updateContent(e,n=ct.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.computeExports(e,n),s=e.uri.toString();this.symbolIndex.set(s,i),this.symbolByTypeIndex.clear(s)}async updateReferences(e,n=ct.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,n);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,n){const r=this.referenceIndex.get(e.uri.toString());return r?r.some(i=>!i.local&&n.has(i.targetUri.toString())):!1}}class bT{constructor(e){this.initialBuildOptions={},this._ready=new Wy,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}get workspaceFolders(){return this.folders}initialize(e){var n;this.folders=(n=e.workspaceFolders)!==null&&n!==void 0?n:void 0}initialized(e){return this.mutex.write(n=>{var r;return this.initializeWorkspace((r=this.folders)!==null&&r!==void 0?r:[],n)})}async initializeWorkspace(e,n=ct.CancellationToken.None){const r=await this.performStartup(e);await It(n),await this.documentBuilder.build(r,this.initialBuildOptions,n)}async performStartup(e){const n=this.serviceRegistry.all.flatMap(s=>s.LanguageMetaData.fileExtensions),r=[],i=s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)};return await this.loadAdditionalDocuments(e,i),await Promise.all(e.map(s=>[s,this.getRootFolder(s)]).map(async s=>this.traverseFolder(...s,n,i))),this._ready.resolve(),r}loadAdditionalDocuments(e,n){return Promise.resolve()}getRootFolder(e){return Jt.parse(e.uri)}async traverseFolder(e,n,r,i){const s=await this.fileSystemProvider.readDirectory(n);await Promise.all(s.map(async a=>{if(this.includeEntry(e,a,r)){if(a.isDirectory)await this.traverseFolder(e,a.uri,r,i);else if(a.isFile){const o=await this.langiumDocuments.getOrCreateDocument(a.uri);i(o)}}}))}includeEntry(e,n,r){const i=kt.basename(n.uri);if(i.startsWith("."))return!1;if(n.isDirectory)return i!=="node_modules"&&i!=="out";if(n.isFile){const s=kt.extname(n.uri);return r.includes(s)}return!1}}class AG{buildUnexpectedCharactersMessage(e,n,r,i,s){return ay.buildUnexpectedCharactersMessage(e,n,r,i,s)}buildUnableToPopLexerModeMessage(e){return ay.buildUnableToPopLexerModeMessage(e)}}const _G={mode:"full"};class PG{constructor(e){this.errorMessageProvider=e.parser.LexerErrorMessageProvider,this.tokenBuilder=e.parser.TokenBuilder;const n=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(n);const r=ET(n)?Object.values(n):n,i=e.LanguageMetaData.mode==="production";this.chevrotainLexer=new _n(r,{positionTracking:"full",skipValidations:i,errorMessageProvider:this.errorMessageProvider})}get definition(){return this.tokenTypes}tokenize(e,n=_G){var r,i,s;const a=this.chevrotainLexer.tokenize(e);return{tokens:a.tokens,errors:a.errors,hidden:(r=a.groups.hidden)!==null&&r!==void 0?r:[],report:(s=(i=this.tokenBuilder).flushLexingReport)===null||s===void 0?void 0:s.call(i,e)}}toTokenTypeDictionary(e){if(ET(e))return e;const n=DT(e)?Object.values(e.modes).flat():e,r={};return n.forEach(i=>r[i.name]=i),r}}function xG(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function DT(t){return t&&"modes"in t&&"defaultMode"in t}function ET(t){return!xG(t)&&!DT(t)}function IG(t,e,n){let r,i;typeof t=="string"?(i=e,r=n):(i=t.range.start,r=e),i||(i=tt.create(0,0));const s=RT(t),a=Xy(r),o=FG({lines:s,position:i,options:a});return qG({index:0,tokens:o,position:i})}function NG(t,e){const n=Xy(e),r=RT(t);if(r.length===0)return!1;const i=r[0],s=r[r.length-1],a=n.start,o=n.end;return!!a?.exec(i)&&!!o?.exec(s)}function RT(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(mE)}const $T=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,OG=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function FG(t){var e,n,r;const i=[];let s=t.position.line,a=t.position.character;for(let o=0;o<t.lines.length;o++){const u=o===0,c=o===t.lines.length-1;let l=t.lines[o],d=0;if(u&&t.options.start){const p=(e=t.options.start)===null||e===void 0?void 0:e.exec(l);p&&(d=p.index+p[0].length)}else{const p=(n=t.options.line)===null||n===void 0?void 0:n.exec(l);p&&(d=p.index+p[0].length)}if(c){const p=(r=t.options.end)===null||r===void 0?void 0:r.exec(l);p&&(l=l.substring(0,p.index))}if(l=l.substring(0,BG(l)),Yy(l,d)>=l.length){if(i.length>0){const p=tt.create(s,a);i.push({type:"break",content:"",range:Ue.create(p,p)})}}else{$T.lastIndex=d;const p=$T.exec(l);if(p){const h=p[0],y=p[1],b=tt.create(s,a+d),w=tt.create(s,a+d+h.length);i.push({type:"tag",content:y,range:Ue.create(b,w)}),d+=h.length,d=Yy(l,d)}if(d<l.length){const h=l.substring(d),y=Array.from(h.matchAll(OG));i.push(...LG(y,h,s,a+d))}}s++,a=0}return i.length>0&&i[i.length-1].type==="break"?i.slice(0,-1):i}function LG(t,e,n,r){const i=[];if(t.length===0){const s=tt.create(n,r),a=tt.create(n,r+e.length);i.push({type:"text",content:e,range:Ue.create(s,a)})}else{let s=0;for(const o of t){const u=o.index,c=e.substring(s,u);c.length>0&&i.push({type:"text",content:e.substring(s,u),range:Ue.create(tt.create(n,s+r),tt.create(n,u+r))});let l=c.length+1;const d=o[1];if(i.push({type:"inline-tag",content:d,range:Ue.create(tt.create(n,s+l+r),tt.create(n,s+l+d.length+r))}),l+=d.length,o.length===4){l+=o[2].length;const f=o[3];i.push({type:"text",content:f,range:Ue.create(tt.create(n,s+l+r),tt.create(n,s+l+f.length+r))})}else i.push({type:"text",content:"",range:Ue.create(tt.create(n,s+l+r),tt.create(n,s+l+r))});s=u+o[0].length}const a=e.substring(s);a.length>0&&i.push({type:"text",content:a,range:Ue.create(tt.create(n,s+r),tt.create(n,s+r+a.length))})}return i}const MG=/\S/,zG=/\s*$/;function Yy(t,e){const n=t.substring(e).match(MG);return n?e+n.index:t.length}function BG(t){const e=t.match(zG);if(e&&typeof e.index=="number")return e.index}function qG(t){var e,n,r,i;const s=tt.create(t.position.line,t.position.character);if(t.tokens.length===0)return new CT([],Ue.create(s,s));const a=[];for(;t.index<t.tokens.length;){const c=GG(t,a[a.length-1]);c&&a.push(c)}const o=(n=(e=a[0])===null||e===void 0?void 0:e.range.start)!==null&&n!==void 0?n:s,u=(i=(r=a[a.length-1])===null||r===void 0?void 0:r.range.end)!==null&&i!==void 0?i:s;return new CT(a,Ue.create(o,u))}function GG(t,e){const n=t.tokens[t.index];if(n.type==="tag")return TT(t,!1);if(n.type==="text"||n.type==="inline-tag")return ST(t);jG(n,e),t.index++}function jG(t,e){if(e){const n=new AT("",t.range);"inlines"in e?e.inlines.push(n):e.content.inlines.push(n)}}function ST(t){let e=t.tokens[t.index];const n=e;let r=e;const i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(UG(t)),r=e,e=t.tokens[t.index];return new Zy(i,Ue.create(n.range.start,r.range.end))}function UG(t){return t.tokens[t.index].type==="inline-tag"?TT(t,!0):kT(t)}function TT(t,e){const n=t.tokens[t.index++],r=n.content.substring(1),i=t.tokens[t.index];if(i?.type==="text")if(e){const s=kT(t);return new Qy(r,new Zy([s],s.range),e,Ue.create(n.range.start,s.range.end))}else{const s=ST(t);return new Qy(r,s,e,Ue.create(n.range.start,s.range.end))}else{const s=n.range;return new Qy(r,new Zy([],s),e,s)}}function kT(t){const e=t.tokens[t.index++];return new AT(e.content,e.range)}function Xy(t){if(!t)return Xy({start:"/**",end:"*/",line:"*"});const{start:e,end:n,line:r}=t;return{start:Jy(e,!0),end:Jy(n,!1),line:Jy(r,!0)}}function Jy(t,e){if(typeof t=="string"||typeof t=="object"){const n=typeof t=="string"?wf(t):t.source;return e?new RegExp(`^\\s*${n}`):new RegExp(`\\s*${n}\\s*$`)}else return t}class CT{constructor(e,n){this.elements=e,this.range=n}getTag(e){return this.getAllTags().find(n=>n.name===e)}getTags(e){return this.getAllTags().filter(n=>n.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const n of this.elements)if(e.length===0)e=n.toString();else{const r=n.toString();e+=_T(e)+r}return e.trim()}toMarkdown(e){let n="";for(const r of this.elements)if(n.length===0)n=r.toMarkdown(e);else{const i=r.toMarkdown(e);n+=_T(n)+i}return n.trim()}}class Qy{constructor(e,n,r,i){this.name=e,this.content=n,this.inline=r,this.range=i}toString(){let e=`@${this.name}`;const n=this.content.toString();return this.content.inlines.length===1?e=`${e} ${n}`:this.content.inlines.length>1&&(e=`${e}
118
+ ${n}`),this.inline?`{${e}}`:e}toMarkdown(e){var n,r;return(r=(n=e?.renderTag)===null||n===void 0?void 0:n.call(e,this))!==null&&r!==void 0?r:this.toMarkdownDefault(e)}toMarkdownDefault(e){const n=this.content.toMarkdown(e);if(this.inline){const s=WG(this.name,n,e??{});if(typeof s=="string")return s}let r="";e?.tag==="italic"||e?.tag===void 0?r="*":e?.tag==="bold"?r="**":e?.tag==="bold-italic"&&(r="***");let i=`${r}@${this.name}${r}`;return this.content.inlines.length===1?i=`${i} \u2014 ${n}`:this.content.inlines.length>1&&(i=`${i}
119
+ ${n}`),this.inline?`{${i}}`:i}}function WG(t,e,n){var r,i;if(t==="linkplain"||t==="linkcode"||t==="link"){const s=e.indexOf(" ");let a=e;if(s>0){const u=Yy(e,s);a=e.substring(u),e=e.substring(0,s)}return(t==="linkcode"||t==="link"&&n.link==="code")&&(a=`\`${a}\``),(i=(r=n.renderLink)===null||r===void 0?void 0:r.call(n,e,a))!==null&&i!==void 0?i:HG(e,a)}}function HG(t,e){try{return Jt.parse(t,!0),`[${e}](${t})`}catch{return t}}class Zy{constructor(e,n){this.inlines=e,this.range=n}toString(){let e="";for(let n=0;n<this.inlines.length;n++){const r=this.inlines[n],i=this.inlines[n+1];e+=r.toString(),i&&i.range.start.line>r.range.start.line&&(e+=`
120
+ `)}return e}toMarkdown(e){let n="";for(let r=0;r<this.inlines.length;r++){const i=this.inlines[r],s=this.inlines[r+1];n+=i.toMarkdown(e),s&&s.range.start.line>i.range.start.line&&(n+=`
121
+ `)}return n}}class AT{constructor(e,n){this.text=e,this.range=n}toString(){return this.text}toMarkdown(){return this.text}}function _T(t){return t.endsWith(`
122
+ `)?`
123
+ `:`
124
+
125
+ `}class VG{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const n=this.commentProvider.getComment(e);if(n&&NG(n))return IG(n).toMarkdown({renderLink:(i,s)=>this.documentationLinkRenderer(e,i,s),renderTag:i=>this.documentationTagRenderer(e,i)})}documentationLinkRenderer(e,n,r){var i;const s=(i=this.findNameInPrecomputedScopes(e,n))!==null&&i!==void 0?i:this.findNameInGlobalScope(e,n);if(s&&s.nameSegment){const a=s.nameSegment.range.start.line+1,o=s.nameSegment.range.start.character+1,u=s.documentUri.with({fragment:`L${a},${o}`});return`[${r}](${u.toString()})`}else return}documentationTagRenderer(e,n){}findNameInPrecomputedScopes(e,n){const i=wt(e).precomputedScopes;if(!i)return;let s=e;do{const o=i.get(s).find(u=>u.name===n);if(o)return o;s=s.$container}while(s)}findNameInGlobalScope(e,n){return this.indexManager.allElements().find(i=>i.name===n)}}class KG{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var n;return mG(e)?e.$comment:(n=tf(e.$cstNode,this.grammarConfig().multilineCommentRules))===null||n===void 0?void 0:n.text}}class YG{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,n){return Promise.resolve(this.syncParser.parse(e))}}class XG{constructor(){this.previousTokenSource=new ct.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const n=uG();return this.previousTokenSource=n,this.enqueue(this.writeQueue,e,n.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,n,r=ct.CancellationToken.None){const i=new Wy,s={action:n,deferred:i,cancellationToken:r};return e.push(s),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:n,deferred:r,cancellationToken:i})=>{try{const s=await Promise.resolve().then(()=>n(i));r.resolve(s)}catch(s){yp(s)?r.resolve(void 0):r.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class JG{constructor(e){this.grammarElementIdMap=new dT,this.tokenTypeIdMap=new dT,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(n=>Object.assign(Object.assign({},n),{message:n.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const n=new Map,r=new Map;for(const i of Kr(e))n.set(i,{});if(e.$cstNode)for(const i of xo(e.$cstNode))r.set(i,{});return{astNodes:n,cstNodes:r}}dehydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(r.$cstNode=this.dehydrateCstNode(e.$cstNode,n));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const a=[];r[i]=a;for(const o of s)$t(o)?a.push(this.dehydrateAstNode(o,n)):Wn(o)?a.push(this.dehydrateReference(o,n)):a.push(o)}else $t(s)?r[i]=this.dehydrateAstNode(s,n):Wn(s)?r[i]=this.dehydrateReference(s,n):s!==void 0&&(r[i]=s);return r}dehydrateReference(e,n){const r={};return r.$refText=e.$refText,e.$refNode&&(r.$refNode=n.cstNodes.get(e.$refNode)),r}dehydrateCstNode(e,n){const r=n.cstNodes.get(e);return YD(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=n.astNodes.get(e.astNode),Si(e)?r.content=e.content.map(i=>this.dehydrateCstNode(i,n)):ps(e)&&(r.tokenType=e.tokenType.name,r.offset=e.offset,r.length=e.length,r.startLine=e.range.start.line,r.startColumn=e.range.start.character,r.endLine=e.range.end.line,r.endColumn=e.range.end.character),r}hydrate(e){const n=e.value,r=this.createHydrationContext(n);return"$cstNode"in n&&this.hydrateCstNode(n.$cstNode,r),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(n,r)}}createHydrationContext(e){const n=new Map,r=new Map;for(const s of Kr(e))n.set(s,{});let i;if(e.$cstNode)for(const s of xo(e.$cstNode)){let a;"fullText"in s?(a=new KS(s.fullText),i=a):"content"in s?a=new qy:"tokenType"in s&&(a=this.hydrateCstLeafNode(s)),a&&(r.set(s,a),a.root=i)}return{astNodes:n,cstNodes:r}}hydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode&&(r.$cstNode=n.cstNodes.get(e.$cstNode));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const a=[];r[i]=a;for(const o of s)$t(o)?a.push(this.setParent(this.hydrateAstNode(o,n),r)):Wn(o)?a.push(this.hydrateReference(o,r,i,n)):a.push(o)}else $t(s)?r[i]=this.setParent(this.hydrateAstNode(s,n),r):Wn(s)?r[i]=this.hydrateReference(s,r,i,n):s!==void 0&&(r[i]=s);return r}setParent(e,n){return e.$container=n,e}hydrateReference(e,n,r,i){return this.linker.buildReference(n,r,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,n,r=0){const i=n.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=n.astNodes.get(e.astNode),Si(i))for(const s of e.content){const a=this.hydrateCstNode(s,n,r++);i.content.push(a)}return i}hydrateCstLeafNode(e){const n=this.getTokenType(e.tokenType),r=e.offset,i=e.length,s=e.startLine,a=e.startColumn,o=e.endLine,u=e.endColumn,c=e.hidden;return new By(r,i,{start:{line:s,character:a},end:{line:o,character:u}},n,c)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){if(e)return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.getKey(e)}createGrammarElementIdMap(){let e=0;for(const n of Kr(this.grammar))og(n)&&this.grammarElementIdMap.set(n,e++)}}function PT(t){return{documentation:{CommentProvider:e=>new KG(e),DocumentationProvider:e=>new VG(e)},parser:{AsyncParser:e=>new YG(e),GrammarConfig:e=>fO(e),LangiumParser:e=>tG(e),CompletionParser:e=>eG(e),ValueConverter:()=>new iG,TokenBuilder:()=>new rG,Lexer:e=>new PG(e),ParserErrorMessageProvider:()=>new QS,LexerErrorMessageProvider:()=>new AG},workspace:{AstNodeLocator:()=>new $G,AstNodeDescriptionProvider:e=>new EG(e),ReferenceDescriptionProvider:e=>new RG(e)},references:{Linker:e=>new fG(e),NameProvider:()=>new lT,ScopeProvider:e=>new wT(e),ScopeComputation:e=>new fT(e),References:e=>new pG(e)},serializer:{Hydrator:e=>new JG(e),JsonSerializer:e=>new gG(e)},validation:{DocumentValidator:e=>new vG(e),ValidationRegistry:e=>new wG(e)},shared:()=>t.shared}}function xT(t){return{ServiceRegistry:e=>new yG(e),workspace:{LangiumDocuments:e=>new dG(e),LangiumDocumentFactory:e=>new lG(e),DocumentBuilder:e=>new kG(e),IndexManager:e=>new CG(e),WorkspaceManager:e=>new bT(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new XG,ConfigurationProvider:e=>new TG(e)}}}var Ep;(function(t){t.merge=(e,n)=>$p($p({},e),n)})(Ep||(Ep={}));function Rp(t,e,n,r,i,s,a,o,u){const c=[t,e,n,r,i,s,a,o,u].reduce($p,{});return NT(c)}const IT=Symbol("isProxy");function ew(t){if(t&&t[IT])for(const e of Object.values(t))ew(e);return t}function NT(t,e){const n=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(r,i)=>i===IT?!0:FT(r,i,t,e||n),getOwnPropertyDescriptor:(r,i)=>(FT(r,i,t,e||n),Object.getOwnPropertyDescriptor(r,i)),has:(r,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return n}const OT=Symbol();function FT(t,e,n,r){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:t[e]});if(t[e]===OT)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in n){const i=n[e];t[e]=OT;try{t[e]=typeof i=="function"?i(r):NT(i,r)}catch(s){throw t[e]=s instanceof Error?s:void 0,s}return t[e]}else return}function $p(t,e){if(e){for(const[n,r]of Object.entries(e))if(r!==void 0){const i=t[n];i!==null&&r!==null&&typeof i=="object"&&typeof r=="object"?t[n]=$p(i,r):t[n]=r}}return t}class QG{readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}}const LT={fileSystemProvider:()=>new QG},ZG={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},ej={AstReflection:()=>new lE};function tj(){const t=Rp(xT(LT),ej),e=Rp(PT({shared:t}),ZG);return t.ServiceRegistry.register(e),e}function nj(t){var e;const n=tj(),r=n.serializer.JsonSerializer.deserialize(t);return n.shared.workspace.LangiumDocumentFactory.fromModel(r,Jt.parse(`memory://${(e=r.name)!==null&&e!==void 0?e:"grammar"}.langium`)),r}var rj={done:!0,hasNext:!1},Uu={done:!1,hasNext:!1},ij=()=>rj,sj=t=>({hasNext:!0,next:t,done:!1});function Qe(t,...e){let n=t,r=e.map(s=>"lazy"in s?aj(s):void 0),i=0;for(;i<e.length;){if(r[i]===void 0||!oj(n)){let u=e[i];n=u(n),i+=1;continue}let s=[];for(let u=i;u<e.length;u++){let c=r[u];if(c===void 0||(s.push(c),c.isSingle))break}let a=[];for(let u of n)if(MT(u,a,s))break;let{isSingle:o}=s.at(-1);n=o?a[0]:a,i+=s.length}return n}function MT(t,e,n){if(n.length===0)return e.push(t),!1;let r=t,i=Uu,s=!1;for(let[a,o]of n.entries()){let{index:u,items:c}=o;if(c.push(r),i=o(r,u,c),o.index+=1,i.hasNext){if(i.hasMany??!1){for(let l of i.next)if(MT(l,e,n.slice(a+1)))return!0;return s}r=i.next}if(!i.hasNext)break;i.done&&(s=!0)}return i.hasNext&&e.push(r),s}function aj(t){let{lazy:e,lazyArgs:n}=t,r=e(...n);return Object.assign(r,{isSingle:e.single??!1,index:0,items:[]})}function oj(t){return typeof t=="string"||typeof t=="object"&&t!==null&&Symbol.iterator in t}function zT(t,e){let n=e.length-t.length;if(n===1){let[r,...i]=e;return Qe(r,{lazy:t,lazyArgs:i})}if(n===0){let r={lazy:t,lazyArgs:e};return Object.assign(i=>Qe(i,r),r)}throw new Error("Wrong number of arguments")}function uj(t,e,n){let r=i=>t(i,...e);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:e})}function it(t,e,n){let r=t.length-e.length;if(r===0)return t(...e);if(r===1)return uj(t,e,n);throw new Error("Wrong number of arguments")}function Wu(...t){return it(Object.values,t)}function Hu(...t){return zT(cj,t)}function cj(){let t=new Set;return e=>t.has(e)?Uu:(t.add(e),{done:!1,hasNext:!0,next:e})}function lj(...t){return it(dj,t,fj)}var dj=(t,e)=>e<0?[]:t.slice(0,e);function fj(t){if(t<=0)return ij;let e=t;return n=>(e-=1,{done:e<=0,hasNext:!0,next:n})}function Nr(...t){return it(pj,t)}var pj=(t,e)=>t.length>=e;function hj(...t){return it(mj,t)}function mj(t,e){return e(t),t}function BT(...t){return it(gj,t)}function gj(t,e){let n=[...t];return n.sort(e),n}function tw(...t){return it(yj,t)}var yj=(t,e,n)=>t.reduce(e,n);function qT(...t){return it(wj,t)}function wj(t){return[...t].reverse()}function Vu(...t){return it(vj,t)}var vj=(t,e)=>t[e];function bj(...t){return it(Dj,t)}function Dj(t,e){if(!Nr(e,1))return{...t};if(!Nr(e,2)){let{[e[0]]:r,...i}=t;return i}let n={...t};for(let r of e)delete n[r];return n}function Ku(...t){return it(Ej,t)}function Ej(t,e){let n={};for(let[r,i]of Object.entries(t)){let s=e(i,r,t);n[r]=s}return n}function ie(t){return!!t}function Yu(...t){return it(Rj,t)}var Rj=t=>t.at(-1);function an(...t){return it($j,t,Sj)}var $j=(t,e)=>t.map(e),Sj=t=>(e,n,r)=>({done:!1,hasNext:!0,next:t(e,n,r)});function Or(...t){return it(Tj,t)}function Tj(t,e){let n={};for(let[r,i]of t.entries()){let[s,a]=e(i,r,t);n[s]=a}return n}function Sp(t){return typeof t=="number"&&!Number.isNaN(t)}function kj(t){return t instanceof Promise}function GT(t){return typeof t=="string"}function Qn(t){return t===void 0?!0:typeof t=="string"||Array.isArray(t)?t.length===0:Object.keys(t).length===0}function Cj(t){return t instanceof Error}function on(t){return t!=null}function Dt(t){return t==null}function Aj(t){return Array.isArray(t)}function nw(t){return typeof t=="boolean"}function Qt(t){return t!==void 0}function _j(t,{triggerAt:e="end",minQuietPeriodMs:n,maxBurstDurationMs:r,minGapMs:i,reducer:s=Pj}){let a,o,u,c,l=()=>{let p=u;p!==void 0&&(u=void 0,t(p),o=setTimeout(d,i))},d=()=>{clearTimeout(o),o=void 0,a===void 0&&l()},f=()=>{clearTimeout(a),a=void 0,c=void 0,o===void 0&&l()};return{call:(...p)=>{let h=a===void 0&&o===void 0;if((e!=="start"||h)&&(u=s(u,...p)),!(a===void 0&&!h)){{clearTimeout(a);let y=Date.now();c??=y;let b=Math.min(n,r-(y-c));a=setTimeout(f,b)}e!=="end"&&h&&l()}},cancel:()=>{clearTimeout(a),a=void 0,c=void 0,clearTimeout(o),o=void 0,u=void 0},flush:()=>{f(),d()},get isIdle(){return a===void 0&&o===void 0}}}var Pj=()=>"";function Ps(...t){return it(xj,t)}var xj=(t,e)=>{let n={};for(let[r,i]of t.entries()){let s=e(i,r,t);if(s!==void 0){let{[s]:a}=n;a===void 0&&(a=[],n[s]=a),a.push(i)}}return n};function Ij(){return Nj}var Nj=t=>t;function rw(...t){return it(Oj,t)}function Oj(t,e){let n={};for(let[r,i]of t.entries()){let s=e(i,r,t);n[s]=i}return n}function Fi(...t){return it(Fj,t,Lj)}var Fj=(t,e)=>t.flatMap(e),Lj=t=>(e,n,r)=>{let i=t(e,n,r);return Array.isArray(i)?{done:!1,hasNext:!0,hasMany:!0,next:i}:{done:!1,hasNext:!0,next:i}};function Mj(...t){return it(zj,t,Bj)}function zj(t,e){return t.forEach(e),t}var Bj=t=>(e,n,r)=>(t(e,n,r),{done:!1,hasNext:!0,next:e});function Tp(...t){return it(qj,t)}function qj(t,e){for(let[n,r]of Object.entries(t))e(r,n,t);return t}function Gj(...t){return it(Object.fromEntries,t)}function kp(...t){return it(Object.entries,t)}function je(...t){return it(jj,t,Uj)}var jj=(t,e)=>t.filter(e),Uj=t=>(e,n,r)=>t(e,n,r)?{done:!1,hasNext:!0,next:e}:Uu,jT=t=>Object.assign(t,{single:!0});function UT(...t){return it(Wj,t,jT(Hj))}var Wj=(t,e)=>t.find(e),Hj=t=>(e,n,r)=>t(e,n,r)?{done:!0,hasNext:!0,next:e}:Uu;function WT(...t){return it(Vj,t)}var Vj=(t,e)=>{for(let n=t.length-1;n>=0;n--){let r=t[n];if(e(r,n,t))return r}};function Ua(...t){return it(Kj,t,jT(Yj))}var Kj=([t])=>t,Yj=()=>Xj,Xj=t=>({hasNext:!0,next:t,done:!0});function HT(...t){return it(Jj,t)}var Jj=(t,e)=>[...t,...e];function Qj(...t){return zT(Zj,t)}function Zj(t){if(t.length===0)return sj;let e=new Map;for(let n of t)e.set(n,(e.get(n)??0)+1);return n=>{let r=e.get(n);return r===void 0||r===0?{done:!1,hasNext:!0,next:n}:(e.set(n,r-1),Uu)}}function e8(...t){return it(t8,t)}var t8=(t,e)=>e.some(n=>n(t));function n8(...t){return it(r8,t)}function r8(t,e){if(e<1)throw new RangeError(`chunk: A chunk size of '${e.toString()}' would result in an infinite array`);if(t.length===0)return[];if(e>=t.length)return[[...t]];let n=Math.ceil(t.length/e),r=new Array(n);if(e===1)for(let[i,s]of t.entries())r[i]=[s];else for(let i=0;i<n;i+=1){let s=i*e;r[i]=t.slice(s,s+e)}return r}function VT(...t){return it(i8,t)}var i8=(t,{min:e,max:n})=>e!==void 0&&t<e?e:n!==void 0&&t>n?n:t,s8={reset:[0,0],bold:[1,22,"\x1B[22m\x1B[1m"],dim:[2,22,"\x1B[22m\x1B[2m"],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]},a8=Object.entries(s8);function iw(t){return String(t)}iw.open="",iw.close="";function o8(t=!1){let e=typeof process<"u"?process:void 0,n=e?.env||{},r=e?.argv||[];return!("NO_COLOR"in n||r.includes("--no-color"))&&("FORCE_COLOR"in n||r.includes("--color")||e?.platform==="win32"||t&&n.TERM!=="dumb"||"CI"in n)||typeof window<"u"&&!!window.chrome}function u8(t=!1){let e=o8(t),n=(a,o,u,c)=>{let l="",d=0;do l+=a.substring(d,c)+u,d=c+o.length,c=a.indexOf(o,d);while(~c);return l+a.substring(d)},r=(a,o,u=a)=>{let c=l=>{let d=String(l),f=d.indexOf(o,a.length);return~f?a+n(d,o,u,f)+o:a+d+o};return c.open=a,c.close=o,c},i={isColorSupported:e},s=a=>`\x1B[${a}m`;for(let[a,o]of a8)i[a]=e?r(s(o[0]),s(o[1]),o[2]):iw;return i}var c8=process.env.FORCE_TTY!==void 0||F1(1),yt=u8(c8),xs={},Ct={},KT;function sw(){if(KT)return Ct;KT=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.thenable=Ct.typedArray=Ct.stringArray=Ct.array=Ct.func=Ct.error=Ct.number=Ct.string=Ct.boolean=void 0;function t(c){return c===!0||c===!1}Ct.boolean=t;function e(c){return typeof c=="string"||c instanceof String}Ct.string=e;function n(c){return typeof c=="number"||c instanceof Number}Ct.number=n;function r(c){return c instanceof Error}Ct.error=r;function i(c){return typeof c=="function"}Ct.func=i;function s(c){return Array.isArray(c)}Ct.array=s;function a(c){return s(c)&&c.every(l=>e(l))}Ct.stringArray=a;function o(c,l){return Array.isArray(c)&&c.every(l)}Ct.typedArray=o;function u(c){return c&&i(c.then)}return Ct.thenable=u,Ct}var Ke={},Is={},Ns={},Cp={},aw={},ye={},YT;function XT(){if(YT)return ye;YT=1,Object.defineProperty(ye,"__esModule",{value:!0}),ye.Message=ye.NotificationType9=ye.NotificationType8=ye.NotificationType7=ye.NotificationType6=ye.NotificationType5=ye.NotificationType4=ye.NotificationType3=ye.NotificationType2=ye.NotificationType1=ye.NotificationType0=ye.NotificationType=ye.RequestType9=ye.RequestType8=ye.RequestType7=ye.RequestType6=ye.RequestType5=ye.RequestType4=ye.RequestType3=ye.RequestType2=ye.RequestType1=ye.RequestType=ye.RequestType0=ye.AbstractMessageSignature=ye.ParameterStructures=ye.ResponseError=ye.ErrorCodes=void 0;const t=qu();var e;(function(T){T.ParseError=-32700,T.InvalidRequest=-32600,T.MethodNotFound=-32601,T.InvalidParams=-32602,T.InternalError=-32603,T.jsonrpcReservedErrorRangeStart=-32099,T.serverErrorStart=-32099,T.MessageWriteError=-32099,T.MessageReadError=-32098,T.PendingResponseRejected=-32097,T.ConnectionInactive=-32096,T.ServerNotInitialized=-32002,T.UnknownErrorCode=-32001,T.jsonrpcReservedErrorRangeEnd=-32e3,T.serverErrorEnd=-32e3})(e||(ye.ErrorCodes=e={}));class n extends Error{constructor(R,F,V){super(F),this.code=t.number(R)?R:e.UnknownErrorCode,this.data=V,Object.setPrototypeOf(this,n.prototype)}toJson(){const R={code:this.code,message:this.message};return this.data!==void 0&&(R.data=this.data),R}}ye.ResponseError=n;class r{constructor(R){this.kind=R}static is(R){return R===r.auto||R===r.byName||R===r.byPosition}toString(){return this.kind}}ye.ParameterStructures=r,r.auto=new r("auto"),r.byPosition=new r("byPosition"),r.byName=new r("byName");class i{constructor(R,F){this.method=R,this.numberOfParams=F}get parameterStructures(){return r.auto}}ye.AbstractMessageSignature=i;class s extends i{constructor(R){super(R,0)}}ye.RequestType0=s;class a extends i{constructor(R,F=r.auto){super(R,1),this._parameterStructures=F}get parameterStructures(){return this._parameterStructures}}ye.RequestType=a;class o extends i{constructor(R,F=r.auto){super(R,1),this._parameterStructures=F}get parameterStructures(){return this._parameterStructures}}ye.RequestType1=o;class u extends i{constructor(R){super(R,2)}}ye.RequestType2=u;class c extends i{constructor(R){super(R,3)}}ye.RequestType3=c;class l extends i{constructor(R){super(R,4)}}ye.RequestType4=l;class d extends i{constructor(R){super(R,5)}}ye.RequestType5=d;class f extends i{constructor(R){super(R,6)}}ye.RequestType6=f;class p extends i{constructor(R){super(R,7)}}ye.RequestType7=p;class h extends i{constructor(R){super(R,8)}}ye.RequestType8=h;class y extends i{constructor(R){super(R,9)}}ye.RequestType9=y;class b extends i{constructor(R,F=r.auto){super(R,1),this._parameterStructures=F}get parameterStructures(){return this._parameterStructures}}ye.NotificationType=b;class w extends i{constructor(R){super(R,0)}}ye.NotificationType0=w;class E extends i{constructor(R,F=r.auto){super(R,1),this._parameterStructures=F}get parameterStructures(){return this._parameterStructures}}ye.NotificationType1=E;class $ extends i{constructor(R){super(R,2)}}ye.NotificationType2=$;class k extends i{constructor(R){super(R,3)}}ye.NotificationType3=k;class A extends i{constructor(R){super(R,4)}}ye.NotificationType4=A;class I extends i{constructor(R){super(R,5)}}ye.NotificationType5=I;class M extends i{constructor(R){super(R,6)}}ye.NotificationType6=M;class Y extends i{constructor(R){super(R,7)}}ye.NotificationType7=Y;class Q extends i{constructor(R){super(R,8)}}ye.NotificationType8=Q;class ae extends i{constructor(R){super(R,9)}}ye.NotificationType9=ae;var O;return function(T){function R(W){const H=W;return H&&t.string(H.method)&&(t.string(H.id)||t.number(H.id))}T.isRequest=R;function F(W){const H=W;return H&&t.string(H.method)&&W.id===void 0}T.isNotification=F;function V(W){const H=W;return H&&(H.result!==void 0||!!H.error)&&(t.string(H.id)||t.number(H.id)||H.id===null)}T.isResponse=V}(O||(ye.Message=O={})),ye}var ii={},JT;function QT(){if(JT)return ii;JT=1;var t;Object.defineProperty(ii,"__esModule",{value:!0}),ii.LRUCache=ii.LinkedMap=ii.Touch=void 0;var e;(function(i){i.None=0,i.First=1,i.AsOld=i.First,i.Last=2,i.AsNew=i.Last})(e||(ii.Touch=e={}));class n{constructor(){this[t]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(s){return this._map.has(s)}get(s,a=e.None){const o=this._map.get(s);if(o)return a!==e.None&&this.touch(o,a),o.value}set(s,a,o=e.None){let u=this._map.get(s);if(u)u.value=a,o!==e.None&&this.touch(u,o);else{switch(u={key:s,value:a,next:void 0,previous:void 0},o){case e.None:this.addItemLast(u);break;case e.First:this.addItemFirst(u);break;case e.Last:this.addItemLast(u);break;default:this.addItemLast(u);break}this._map.set(s,u),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){const a=this._map.get(s);if(a)return this._map.delete(s),this.removeItem(a),this._size--,a.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const s=this._head;return this._map.delete(s.key),this.removeItem(s),this._size--,s.value}forEach(s,a){const o=this._state;let u=this._head;for(;u;){if(a?s.bind(a)(u.value,u.key,this):s(u.value,u.key,this),this._state!==o)throw new Error("LinkedMap got modified during iteration.");u=u.next}}keys(){const s=this._state;let a=this._head;const o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(a){const u={value:a.key,done:!1};return a=a.next,u}else return{value:void 0,done:!0}}};return o}values(){const s=this._state;let a=this._head;const o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(a){const u={value:a.value,done:!1};return a=a.next,u}else return{value:void 0,done:!0}}};return o}entries(){const s=this._state;let a=this._head;const o={[Symbol.iterator]:()=>o,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(a){const u={value:[a.key,a.value],done:!1};return a=a.next,u}else return{value:void 0,done:!0}}};return o}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let a=this._head,o=this.size;for(;a&&o>s;)this._map.delete(a.key),a=a.next,o--;this._head=a,this._size=o,a&&(a.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw new Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw new Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw new Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw new Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{const a=s.next,o=s.previous;if(!a||!o)throw new Error("Invalid list");a.previous=o,o.next=a}s.next=void 0,s.previous=void 0,this._state++}touch(s,a){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(a!==e.First&&a!==e.Last)){if(a===e.First){if(s===this._head)return;const o=s.next,u=s.previous;s===this._tail?(u.next=void 0,this._tail=u):(o.previous=u,u.next=o),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(a===e.Last){if(s===this._tail)return;const o=s.next,u=s.previous;s===this._head?(o.previous=void 0,this._head=o):(o.previous=u,u.next=o),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){const s=[];return this.forEach((a,o)=>{s.push([o,a])}),s}fromJSON(s){this.clear();for(const[a,o]of s)this.set(a,o)}}ii.LinkedMap=n;class r extends n{constructor(s,a=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,a),1)}get limit(){return this._limit}set limit(s){this._limit=s,this.checkTrim()}get ratio(){return this._ratio}set ratio(s){this._ratio=Math.min(Math.max(0,s),1),this.checkTrim()}get(s,a=e.AsNew){return super.get(s,a)}peek(s){return super.get(s,e.None)}set(s,a){return super.set(s,a,e.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}return ii.LRUCache=r,ii}var Xu={},ZT;function l8(){if(ZT)return Xu;ZT=1,Object.defineProperty(Xu,"__esModule",{value:!0}),Xu.Disposable=void 0;var t;return function(e){function n(r){return{dispose:r}}e.create=n}(t||(Xu.Disposable=t={})),Xu}var Os={},ek;function d8(){if(ek)return Os;ek=1,Object.defineProperty(Os,"__esModule",{value:!0}),Os.SharedArrayReceiverStrategy=Os.SharedArraySenderStrategy=void 0;const t=hp();var e;(function(a){a.Continue=0,a.Cancelled=1})(e||(e={}));class n{constructor(){this.buffers=new Map}enableCancellation(o){if(o.id===null)return;const u=new SharedArrayBuffer(4),c=new Int32Array(u,0,1);c[0]=e.Continue,this.buffers.set(o.id,u),o.$cancellationData=u}async sendCancellation(o,u){const c=this.buffers.get(u);if(c===void 0)return;const l=new Int32Array(c,0,1);Atomics.store(l,0,e.Cancelled)}cleanup(o){this.buffers.delete(o)}dispose(){this.buffers.clear()}}Os.SharedArraySenderStrategy=n;class r{constructor(o){this.data=new Int32Array(o,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===e.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class i{constructor(o){this.token=new r(o)}cancel(){}dispose(){}}class s{constructor(){this.kind="request"}createCancellationTokenSource(o){const u=o.$cancellationData;return u===void 0?new t.CancellationTokenSource:new i(u)}}return Os.SharedArrayReceiverStrategy=s,Os}var si={},Ju={},tk;function nk(){if(tk)return Ju;tk=1,Object.defineProperty(Ju,"__esModule",{value:!0}),Ju.Semaphore=void 0;const t=ks();class e{constructor(r=1){if(r<=0)throw new Error("Capacity must be greater than 0");this._capacity=r,this._active=0,this._waiting=[]}lock(r){return new Promise((i,s)=>{this._waiting.push({thunk:r,resolve:i,reject:s}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const r=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const i=r.thunk();i instanceof Promise?i.then(s=>{this._active--,r.resolve(s),this.runNext()},s=>{this._active--,r.reject(s),this.runNext()}):(this._active--,r.resolve(i),this.runNext())}catch(i){this._active--,r.reject(i),this.runNext()}}}return Ju.Semaphore=e,Ju}var rk;function f8(){if(rk)return si;rk=1,Object.defineProperty(si,"__esModule",{value:!0}),si.ReadableStreamMessageReader=si.AbstractMessageReader=si.MessageReader=void 0;const t=ks(),e=qu(),n=ja(),r=nk();var i;(function(u){function c(l){let d=l;return d&&e.func(d.listen)&&e.func(d.dispose)&&e.func(d.onError)&&e.func(d.onClose)&&e.func(d.onPartialMessage)}u.is=c})(i||(si.MessageReader=i={}));class s{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(c){this.errorEmitter.fire(this.asError(c))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(c){this.partialMessageEmitter.fire(c)}asError(c){return c instanceof Error?c:new Error(`Reader received error. Reason: ${e.string(c.message)?c.message:"unknown"}`)}}si.AbstractMessageReader=s;var a;(function(u){function c(l){let d,f;const p=new Map;let h;const y=new Map;if(l===void 0||typeof l=="string")d=l??"utf-8";else{if(d=l.charset??"utf-8",l.contentDecoder!==void 0&&(f=l.contentDecoder,p.set(f.name,f)),l.contentDecoders!==void 0)for(const b of l.contentDecoders)p.set(b.name,b);if(l.contentTypeDecoder!==void 0&&(h=l.contentTypeDecoder,y.set(h.name,h)),l.contentTypeDecoders!==void 0)for(const b of l.contentTypeDecoders)y.set(b.name,b)}return h===void 0&&(h=(0,t.default)().applicationJson.decoder,y.set(h.name,h)),{charset:d,contentDecoder:f,contentDecoders:p,contentTypeDecoder:h,contentTypeDecoders:y}}u.fromOptions=c})(a||(a={}));class o extends s{constructor(c,l){super(),this.readable=c,this.options=a.fromOptions(l),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new r.Semaphore(1)}set partialMessageTimeout(c){this._partialMessageTimeout=c}get partialMessageTimeout(){return this._partialMessageTimeout}listen(c){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=c;const l=this.readable.onData(d=>{this.onData(d)});return this.readable.onError(d=>this.fireError(d)),this.readable.onClose(()=>this.fireClose()),l}onData(c){try{for(this.buffer.append(c);;){if(this.nextMessageLength===-1){const d=this.buffer.tryReadHeaders(!0);if(!d)return;const f=d.get("content-length");if(!f){this.fireError(new Error(`Header must provide a Content-Length property.
126
+ ${JSON.stringify(Object.fromEntries(d))}`));return}const p=parseInt(f);if(isNaN(p)){this.fireError(new Error(`Content-Length value must be a number. Got ${f}`));return}this.nextMessageLength=p}const l=this.buffer.tryReadBody(this.nextMessageLength);if(l===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const d=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(l):l,f=await this.options.contentTypeDecoder.decode(d,this.options);this.callback(f)}).catch(d=>{this.fireError(d)})}}catch(l){this.fireError(l)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((c,l)=>{this.partialMessageTimer=void 0,c===this.messageToken&&(this.firePartialMessage({messageToken:c,waitingTime:l}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}return si.ReadableStreamMessageReader=o,si}var ai={},ik;function p8(){if(ik)return ai;ik=1,Object.defineProperty(ai,"__esModule",{value:!0}),ai.WriteableStreamMessageWriter=ai.AbstractMessageWriter=ai.MessageWriter=void 0;const t=ks(),e=qu(),n=nk(),r=ja(),i="Content-Length: ",s=`\r
127
+ `;var a;(function(l){function d(f){let p=f;return p&&e.func(p.dispose)&&e.func(p.onClose)&&e.func(p.onError)&&e.func(p.write)}l.is=d})(a||(ai.MessageWriter=a={}));class o{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(d,f,p){this.errorEmitter.fire([this.asError(d),f,p])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(d){return d instanceof Error?d:new Error(`Writer received error. Reason: ${e.string(d.message)?d.message:"unknown"}`)}}ai.AbstractMessageWriter=o;var u;(function(l){function d(f){return f===void 0||typeof f=="string"?{charset:f??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:f.charset??"utf-8",contentEncoder:f.contentEncoder,contentTypeEncoder:f.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}l.fromOptions=d})(u||(u={}));class c extends o{constructor(d,f){super(),this.writable=d,this.options=u.fromOptions(f),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(p=>this.fireError(p)),this.writable.onClose(()=>this.fireClose())}async write(d){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(d,this.options).then(p=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(p):p).then(p=>{const h=[];return h.push(i,p.byteLength.toString(),s),h.push(s),this.doWrite(d,h,p)},p=>{throw this.fireError(p),p}))}async doWrite(d,f,p){try{return await this.writable.write(f.join(""),"ascii"),this.writable.write(p)}catch(h){return this.handleError(h,d),Promise.reject(h)}}handleError(d,f){this.errorCount++,this.fireError(d,f,this.errorCount)}end(){this.writable.end()}}return ai.WriteableStreamMessageWriter=c,ai}var Qu={},sk;function h8(){if(sk)return Qu;sk=1,Object.defineProperty(Qu,"__esModule",{value:!0}),Qu.AbstractMessageBuffer=void 0;const t=13,e=10,n=`\r
128
+ `;class r{constructor(s="utf-8"){this._encoding=s,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(s){const a=typeof s=="string"?this.fromString(s,this._encoding):s;this._chunks.push(a),this._totalLength+=a.byteLength}tryReadHeaders(s=!1){if(this._chunks.length===0)return;let a=0,o=0,u=0,c=0;e:for(;o<this._chunks.length;){const p=this._chunks[o];for(u=0;u<p.length;){switch(p[u]){case t:switch(a){case 0:a=1;break;case 2:a=3;break;default:a=0}break;case e:switch(a){case 1:a=2;break;case 3:a=4,u++;break e;default:a=0}break;default:a=0}u++}c+=p.byteLength,o++}if(a!==4)return;const l=this._read(c+u),d=new Map,f=this.toString(l,"ascii").split(n);if(f.length<2)return d;for(let p=0;p<f.length-2;p++){const h=f[p],y=h.indexOf(":");if(y===-1)throw new Error(`Message header must separate key and value using ':'
129
+ ${h}`);const b=h.substr(0,y),w=h.substr(y+1).trim();d.set(s?b.toLowerCase():b,w)}return d}tryReadBody(s){if(!(this._totalLength<s))return this._read(s)}get numberOfBytes(){return this._totalLength}_read(s){if(s===0)return this.emptyBuffer();if(s>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===s){const c=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(c)}if(this._chunks[0].byteLength>s){const c=this._chunks[0],l=this.asNative(c,s);return this._chunks[0]=c.slice(s),this._totalLength-=s,l}const a=this.allocNative(s);let o=0,u=0;for(;s>0;){const c=this._chunks[u];if(c.byteLength>s){const l=c.slice(0,s);a.set(l,o),o+=s,this._chunks[u]=c.slice(s),this._totalLength-=s,s-=s}else a.set(c,o),o+=c.byteLength,this._chunks.shift(),this._totalLength-=c.byteLength,s-=c.byteLength}return a}}return Qu.AbstractMessageBuffer=r,Qu}var ow={},ak;function m8(){return ak||(ak=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;const e=ks(),n=qu(),r=XT(),i=QT(),s=ja(),a=hp();var o;(function(R){R.type=new r.NotificationType("$/cancelRequest")})(o||(o={}));var u;(function(R){function F(V){return typeof V=="string"||typeof V=="number"}R.is=F})(u||(t.ProgressToken=u={}));var c;(function(R){R.type=new r.NotificationType("$/progress")})(c||(c={}));class l{constructor(){}}t.ProgressType=l;var d;(function(R){function F(V){return n.func(V)}R.is=F})(d||(d={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var f;(function(R){R[R.Off=0]="Off",R[R.Messages=1]="Messages",R[R.Compact=2]="Compact",R[R.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var p;(function(R){R.Off="off",R.Messages="messages",R.Compact="compact",R.Verbose="verbose"})(p||(t.TraceValues=p={})),function(R){function F(W){if(!n.string(W))return R.Off;switch(W=W.toLowerCase(),W){case"off":return R.Off;case"messages":return R.Messages;case"compact":return R.Compact;case"verbose":return R.Verbose;default:return R.Off}}R.fromString=F;function V(W){switch(W){case R.Off:return"off";case R.Messages:return"messages";case R.Compact:return"compact";case R.Verbose:return"verbose";default:return"off"}}R.toString=V}(f||(t.Trace=f={}));var h;(function(R){R.Text="text",R.JSON="json"})(h||(t.TraceFormat=h={})),function(R){function F(V){return n.string(V)?(V=V.toLowerCase(),V==="json"?R.JSON:R.Text):R.Text}R.fromString=F}(h||(t.TraceFormat=h={}));var y;(function(R){R.type=new r.NotificationType("$/setTrace")})(y||(t.SetTraceNotification=y={}));var b;(function(R){R.type=new r.NotificationType("$/logTrace")})(b||(t.LogTraceNotification=b={}));var w;(function(R){R[R.Closed=1]="Closed",R[R.Disposed=2]="Disposed",R[R.AlreadyListening=3]="AlreadyListening"})(w||(t.ConnectionErrors=w={}));class E extends Error{constructor(F,V){super(V),this.code=F,Object.setPrototypeOf(this,E.prototype)}}t.ConnectionError=E;var $;(function(R){function F(V){const W=V;return W&&n.func(W.cancelUndispatched)}R.is=F})($||(t.ConnectionStrategy=$={}));var k;(function(R){function F(V){const W=V;return W&&(W.kind===void 0||W.kind==="id")&&n.func(W.createCancellationTokenSource)&&(W.dispose===void 0||n.func(W.dispose))}R.is=F})(k||(t.IdCancellationReceiverStrategy=k={}));var A;(function(R){function F(V){const W=V;return W&&W.kind==="request"&&n.func(W.createCancellationTokenSource)&&(W.dispose===void 0||n.func(W.dispose))}R.is=F})(A||(t.RequestCancellationReceiverStrategy=A={}));var I;(function(R){R.Message=Object.freeze({createCancellationTokenSource(V){return new a.CancellationTokenSource}});function F(V){return k.is(V)||A.is(V)}R.is=F})(I||(t.CancellationReceiverStrategy=I={}));var M;(function(R){R.Message=Object.freeze({sendCancellation(V,W){return V.sendNotification(o.type,{id:W})},cleanup(V){}});function F(V){const W=V;return W&&n.func(W.sendCancellation)&&n.func(W.cleanup)}R.is=F})(M||(t.CancellationSenderStrategy=M={}));var Y;(function(R){R.Message=Object.freeze({receiver:I.Message,sender:M.Message});function F(V){const W=V;return W&&I.is(W.receiver)&&M.is(W.sender)}R.is=F})(Y||(t.CancellationStrategy=Y={}));var Q;(function(R){function F(V){const W=V;return W&&n.func(W.handleMessage)}R.is=F})(Q||(t.MessageStrategy=Q={}));var ae;(function(R){function F(V){const W=V;return W&&(Y.is(W.cancellationStrategy)||$.is(W.connectionStrategy)||Q.is(W.messageStrategy))}R.is=F})(ae||(t.ConnectionOptions=ae={}));var O;(function(R){R[R.New=1]="New",R[R.Listening=2]="Listening",R[R.Closed=3]="Closed",R[R.Disposed=4]="Disposed"})(O||(O={}));function T(R,F,V,W){const H=V!==void 0?V:t.NullLogger;let Ee=0,te=0,C=0;const me="2.0";let ke;const at=new Map;let j;const K=new Map,Fe=new Map;let ue,be=new i.LinkedMap,Ce=new Map,ce=new Set,x=new Map,B=f.Off,de=h.Text,q,le=O.New;const Ge=new s.Emitter,et=new s.Emitter,oe=new s.Emitter,xe=new s.Emitter,ne=new s.Emitter,De=W&&W.cancellationStrategy?W.cancellationStrategy:Y.Message;function ze(D){if(D===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+D.toString()}function ht(D){return D===null?"res-unknown-"+(++C).toString():"res-"+D.toString()}function Ye(){return"not-"+(++te).toString()}function qt(D,G){r.Message.isRequest(G)?D.set(ze(G.id),G):r.Message.isResponse(G)?D.set(ht(G.id),G):D.set(Ye(),G)}function Wt(D){}function dn(){return le===O.Listening}function X(){return le===O.Closed}function J(){return le===O.Disposed}function fe(){(le===O.New||le===O.Listening)&&(le=O.Closed,et.fire(void 0))}function Ht(D){Ge.fire([D,void 0,void 0])}function Gt(D){Ge.fire(D)}R.onClose(fe),R.onError(Ht),F.onClose(fe),F.onError(Gt);function Dr(){ue||be.size===0||(ue=(0,e.default)().timer.setImmediate(()=>{ue=void 0,ns()}))}function Di(D){r.Message.isRequest(D)?is(D):r.Message.isNotification(D)?Ei(D):r.Message.isResponse(D)?ss(D):Ri(D)}function ns(){if(be.size===0)return;const D=be.shift();try{const G=W?.messageStrategy;Q.is(G)?G.handleMessage(D,Di):Di(D)}finally{Dr()}}const rs=D=>{try{if(r.Message.isNotification(D)&&D.method===o.type.method){const G=D.params.id,ee=ze(G),re=be.get(ee);if(r.Message.isRequest(re)){const Le=W?.connectionStrategy,Xe=Le&&Le.cancelUndispatched?Le.cancelUndispatched(re,Wt):void 0;if(Xe&&(Xe.error!==void 0||Xe.result!==void 0)){be.delete(ee),x.delete(G),Xe.id=re.id,Er(Xe,D.method,Date.now()),F.write(Xe).catch(()=>H.error("Sending response for canceled message failed."));return}}const Be=x.get(G);if(Be!==void 0){Be.cancel(),Ur(D);return}else ce.add(G)}qt(be,D)}finally{Dr()}};function is(D){if(J())return;function G(Ie,nt,Je){const Ft={jsonrpc:me,id:D.id};Ie instanceof r.ResponseError?Ft.error=Ie.toJson():Ft.result=Ie===void 0?null:Ie,Er(Ft,nt,Je),F.write(Ft).catch(()=>H.error("Sending response failed."))}function ee(Ie,nt,Je){const Ft={jsonrpc:me,id:D.id,error:Ie.toJson()};Er(Ft,nt,Je),F.write(Ft).catch(()=>H.error("Sending response failed."))}function re(Ie,nt,Je){Ie===void 0&&(Ie=null);const Ft={jsonrpc:me,id:D.id,result:Ie};Er(Ft,nt,Je),F.write(Ft).catch(()=>H.error("Sending response failed."))}us(D);const Be=at.get(D.method);let Le,Xe;Be&&(Le=Be.type,Xe=Be.handler);const ge=Date.now();if(Xe||ke){const Ie=D.id??String(Date.now()),nt=k.is(De.receiver)?De.receiver.createCancellationTokenSource(Ie):De.receiver.createCancellationTokenSource(D);D.id!==null&&ce.has(D.id)&&nt.cancel(),D.id!==null&&x.set(Ie,nt);try{let Je;if(Xe)if(D.params===void 0){if(Le!==void 0&&Le.numberOfParams!==0){ee(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${D.method} defines ${Le.numberOfParams} params but received none.`),D.method,ge);return}Je=Xe(nt.token)}else if(Array.isArray(D.params)){if(Le!==void 0&&Le.parameterStructures===r.ParameterStructures.byName){ee(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${D.method} defines parameters by name but received parameters by position`),D.method,ge);return}Je=Xe(...D.params,nt.token)}else{if(Le!==void 0&&Le.parameterStructures===r.ParameterStructures.byPosition){ee(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${D.method} defines parameters by position but received parameters by name`),D.method,ge);return}Je=Xe(D.params,nt.token)}else ke&&(Je=ke(D.method,D.params,nt.token));const Ft=Je;Je?Ft.then?Ft.then(fn=>{x.delete(Ie),G(fn,D.method,ge)},fn=>{x.delete(Ie),fn instanceof r.ResponseError?ee(fn,D.method,ge):fn&&n.string(fn.message)?ee(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${D.method} failed with message: ${fn.message}`),D.method,ge):ee(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${D.method} failed unexpectedly without providing any details.`),D.method,ge)}):(x.delete(Ie),G(Je,D.method,ge)):(x.delete(Ie),re(Je,D.method,ge))}catch(Je){x.delete(Ie),Je instanceof r.ResponseError?G(Je,D.method,ge):Je&&n.string(Je.message)?ee(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${D.method} failed with message: ${Je.message}`),D.method,ge):ee(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${D.method} failed unexpectedly without providing any details.`),D.method,ge)}}else ee(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${D.method}`),D.method,ge)}function ss(D){if(!J())if(D.id===null)D.error?H.error(`Received response message without id: Error is:
130
+ ${JSON.stringify(D.error,void 0,4)}`):H.error("Received response message without id. No further error information provided.");else{const G=D.id,ee=Ce.get(G);if(cs(D,ee),ee!==void 0){Ce.delete(G);try{if(D.error){const re=D.error;ee.reject(new r.ResponseError(re.code,re.message,re.data))}else if(D.result!==void 0)ee.resolve(D.result);else throw new Error("Should never happen.")}catch(re){re.message?H.error(`Response handler '${ee.method}' failed with message: ${re.message}`):H.error(`Response handler '${ee.method}' failed unexpectedly.`)}}}}function Ei(D){if(J())return;let G,ee;if(D.method===o.type.method){const re=D.params.id;ce.delete(re),Ur(D);return}else{const re=K.get(D.method);re&&(ee=re.handler,G=re.type)}if(ee||j)try{if(Ur(D),ee)if(D.params===void 0)G!==void 0&&G.numberOfParams!==0&&G.parameterStructures!==r.ParameterStructures.byName&&H.error(`Notification ${D.method} defines ${G.numberOfParams} params but received none.`),ee();else if(Array.isArray(D.params)){const re=D.params;D.method===c.type.method&&re.length===2&&u.is(re[0])?ee({token:re[0],value:re[1]}):(G!==void 0&&(G.parameterStructures===r.ParameterStructures.byName&&H.error(`Notification ${D.method} defines parameters by name but received parameters by position`),G.numberOfParams!==D.params.length&&H.error(`Notification ${D.method} defines ${G.numberOfParams} params but received ${re.length} arguments`)),ee(...re))}else G!==void 0&&G.parameterStructures===r.ParameterStructures.byPosition&&H.error(`Notification ${D.method} defines parameters by position but received parameters by name`),ee(D.params);else j&&j(D.method,D.params)}catch(re){re.message?H.error(`Notification handler '${D.method}' failed with message: ${re.message}`):H.error(`Notification handler '${D.method}' failed unexpectedly.`)}else oe.fire(D)}function Ri(D){if(!D){H.error("Received empty message.");return}H.error(`Received message which is neither a response nor a notification message:
131
+ ${JSON.stringify(D,null,4)}`);const G=D;if(n.string(G.id)||n.number(G.id)){const ee=G.id,re=Ce.get(ee);re&&re.reject(new Error("The received response has neither a result nor an error property."))}}function $n(D){if(D!=null)switch(B){case f.Verbose:return JSON.stringify(D,null,4);case f.Compact:return JSON.stringify(D);default:return}}function as(D){if(!(B===f.Off||!q))if(de===h.Text){let G;(B===f.Verbose||B===f.Compact)&&D.params&&(G=`Params: ${$n(D.params)}
132
+
133
+ `),q.log(`Sending request '${D.method} - (${D.id})'.`,G)}else jn("send-request",D)}function os(D){if(!(B===f.Off||!q))if(de===h.Text){let G;(B===f.Verbose||B===f.Compact)&&(D.params?G=`Params: ${$n(D.params)}
134
+
135
+ `:G=`No parameters provided.
136
+
137
+ `),q.log(`Sending notification '${D.method}'.`,G)}else jn("send-notification",D)}function Er(D,G,ee){if(!(B===f.Off||!q))if(de===h.Text){let re;(B===f.Verbose||B===f.Compact)&&(D.error&&D.error.data?re=`Error data: ${$n(D.error.data)}
138
+
139
+ `:D.result?re=`Result: ${$n(D.result)}
140
+
141
+ `:D.error===void 0&&(re=`No result returned.
142
+
143
+ `)),q.log(`Sending response '${G} - (${D.id})'. Processing request took ${Date.now()-ee}ms`,re)}else jn("send-response",D)}function us(D){if(!(B===f.Off||!q))if(de===h.Text){let G;(B===f.Verbose||B===f.Compact)&&D.params&&(G=`Params: ${$n(D.params)}
144
+
145
+ `),q.log(`Received request '${D.method} - (${D.id})'.`,G)}else jn("receive-request",D)}function Ur(D){if(!(B===f.Off||!q||D.method===b.type.method))if(de===h.Text){let G;(B===f.Verbose||B===f.Compact)&&(D.params?G=`Params: ${$n(D.params)}
146
+
147
+ `:G=`No parameters provided.
148
+
149
+ `),q.log(`Received notification '${D.method}'.`,G)}else jn("receive-notification",D)}function cs(D,G){if(!(B===f.Off||!q))if(de===h.Text){let ee;if((B===f.Verbose||B===f.Compact)&&(D.error&&D.error.data?ee=`Error data: ${$n(D.error.data)}
150
+
151
+ `:D.result?ee=`Result: ${$n(D.result)}
152
+
153
+ `:D.error===void 0&&(ee=`No result returned.
154
+
155
+ `)),G){const re=D.error?` Request failed: ${D.error.message} (${D.error.code}).`:"";q.log(`Received response '${G.method} - (${D.id})' in ${Date.now()-G.timerStart}ms.${re}`,ee)}else q.log(`Received response ${D.id} without active response promise.`,ee)}else jn("receive-response",D)}function jn(D,G){if(!q||B===f.Off)return;const ee={isLSPMessage:!0,type:D,message:G,timestamp:Date.now()};q.log(ee)}function sr(){if(X())throw new E(w.Closed,"Connection is closed.");if(J())throw new E(w.Disposed,"Connection is disposed.")}function ba(){if(dn())throw new E(w.AlreadyListening,"Connection is already listening")}function L(){if(!dn())throw new Error("Call listen() first.")}function v(D){return D===void 0?null:D}function _(D){if(D!==null)return D}function m(D){return D!=null&&!Array.isArray(D)&&typeof D=="object"}function S(D,G){switch(D){case r.ParameterStructures.auto:return m(G)?_(G):[v(G)];case r.ParameterStructures.byName:if(!m(G))throw new Error("Received parameters by name but param is not an object literal.");return _(G);case r.ParameterStructures.byPosition:return[v(G)];default:throw new Error(`Unknown parameter structure ${D.toString()}`)}}function g(D,G){let ee;const re=D.numberOfParams;switch(re){case 0:ee=void 0;break;case 1:ee=S(D.parameterStructures,G[0]);break;default:ee=[];for(let Be=0;Be<G.length&&Be<re;Be++)ee.push(v(G[Be]));if(G.length<re)for(let Be=G.length;Be<re;Be++)ee.push(null);break}return ee}const P={sendNotification:(D,...G)=>{sr();let ee,re;if(n.string(D)){ee=D;const Le=G[0];let Xe=0,ge=r.ParameterStructures.auto;r.ParameterStructures.is(Le)&&(Xe=1,ge=Le);let Ie=G.length;const nt=Ie-Xe;switch(nt){case 0:re=void 0;break;case 1:re=S(ge,G[Xe]);break;default:if(ge===r.ParameterStructures.byName)throw new Error(`Received ${nt} parameters for 'by Name' notification parameter structure.`);re=G.slice(Xe,Ie).map(Je=>v(Je));break}}else{const Le=G;ee=D.method,re=g(D,Le)}const Be={jsonrpc:me,method:ee,params:re};return os(Be),F.write(Be).catch(Le=>{throw H.error("Sending notification failed."),Le})},onNotification:(D,G)=>{sr();let ee;return n.func(D)?j=D:G&&(n.string(D)?(ee=D,K.set(D,{type:void 0,handler:G})):(ee=D.method,K.set(D.method,{type:D,handler:G}))),{dispose:()=>{ee!==void 0?K.delete(ee):j=void 0}}},onProgress:(D,G,ee)=>{if(Fe.has(G))throw new Error(`Progress handler for token ${G} already registered`);return Fe.set(G,ee),{dispose:()=>{Fe.delete(G)}}},sendProgress:(D,G,ee)=>P.sendNotification(c.type,{token:G,value:ee}),onUnhandledProgress:xe.event,sendRequest:(D,...G)=>{sr(),L();let ee,re,Be;if(n.string(D)){ee=D;const Ie=G[0],nt=G[G.length-1];let Je=0,Ft=r.ParameterStructures.auto;r.ParameterStructures.is(Ie)&&(Je=1,Ft=Ie);let fn=G.length;a.CancellationToken.is(nt)&&(fn=fn-1,Be=nt);const Rr=fn-Je;switch(Rr){case 0:re=void 0;break;case 1:re=S(Ft,G[Je]);break;default:if(Ft===r.ParameterStructures.byName)throw new Error(`Received ${Rr} parameters for 'by Name' request parameter structure.`);re=G.slice(Je,fn).map(A1=>v(A1));break}}else{const Ie=G;ee=D.method,re=g(D,Ie);const nt=D.numberOfParams;Be=a.CancellationToken.is(Ie[nt])?Ie[nt]:void 0}const Le=Ee++;let Xe;Be&&(Xe=Be.onCancellationRequested(()=>{const Ie=De.sender.sendCancellation(P,Le);return Ie===void 0?(H.log(`Received no promise from cancellation strategy when cancelling id ${Le}`),Promise.resolve()):Ie.catch(()=>{H.log(`Sending cancellation messages for id ${Le} failed`)})}));const ge={jsonrpc:me,id:Le,method:ee,params:re};return as(ge),typeof De.sender.enableCancellation=="function"&&De.sender.enableCancellation(ge),new Promise(async(Ie,nt)=>{const Je=Rr=>{Ie(Rr),De.sender.cleanup(Le),Xe?.dispose()},Ft=Rr=>{nt(Rr),De.sender.cleanup(Le),Xe?.dispose()},fn={method:ee,timerStart:Date.now(),resolve:Je,reject:Ft};try{await F.write(ge),Ce.set(Le,fn)}catch(Rr){throw H.error("Sending request failed."),fn.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,Rr.message?Rr.message:"Unknown reason")),Rr}})},onRequest:(D,G)=>{sr();let ee=null;return d.is(D)?(ee=void 0,ke=D):n.string(D)?(ee=null,G!==void 0&&(ee=D,at.set(D,{handler:G,type:void 0}))):G!==void 0&&(ee=D.method,at.set(D.method,{type:D,handler:G})),{dispose:()=>{ee!==null&&(ee!==void 0?at.delete(ee):ke=void 0)}}},hasPendingResponse:()=>Ce.size>0,trace:async(D,G,ee)=>{let re=!1,Be=h.Text;ee!==void 0&&(n.boolean(ee)?re=ee:(re=ee.sendNotification||!1,Be=ee.traceFormat||h.Text)),B=D,de=Be,B===f.Off?q=void 0:q=G,re&&!X()&&!J()&&await P.sendNotification(y.type,{value:f.toString(D)})},onError:Ge.event,onClose:et.event,onUnhandledNotification:oe.event,onDispose:ne.event,end:()=>{F.end()},dispose:()=>{if(J())return;le=O.Disposed,ne.fire(void 0);const D=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const G of Ce.values())G.reject(D);Ce=new Map,x=new Map,ce=new Set,be=new i.LinkedMap,n.func(F.dispose)&&F.dispose(),n.func(R.dispose)&&R.dispose()},listen:()=>{sr(),ba(),le=O.Listening,R.listen(rs)},inspect:()=>{(0,e.default)().console.log("inspect")}};return P.onNotification(b.type,D=>{if(B===f.Off||!q)return;const G=B===f.Verbose||B===f.Compact;q.log(D.message,G?D.verbose:void 0)}),P.onNotification(c.type,D=>{const G=Fe.get(D.token);G?G(D.value):xe.fire(D)}),P}t.createMessageConnection=T}(ow)),ow}var ok;function uw(){return ok||(ok=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;const e=XT();Object.defineProperty(t,"Message",{enumerable:!0,get:function(){return e.Message}}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:function(){return e.RequestType}}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:function(){return e.RequestType0}}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:function(){return e.RequestType1}}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:function(){return e.RequestType2}}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:function(){return e.RequestType3}}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:function(){return e.RequestType4}}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:function(){return e.RequestType5}}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:function(){return e.RequestType6}}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:function(){return e.RequestType7}}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:function(){return e.RequestType8}}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:function(){return e.RequestType9}}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:function(){return e.ResponseError}}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:function(){return e.ErrorCodes}}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:function(){return e.NotificationType}}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:function(){return e.NotificationType0}}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:function(){return e.NotificationType1}}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:function(){return e.NotificationType2}}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:function(){return e.NotificationType3}}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:function(){return e.NotificationType4}}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:function(){return e.NotificationType5}}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:function(){return e.NotificationType6}}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:function(){return e.NotificationType7}}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:function(){return e.NotificationType8}}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:function(){return e.NotificationType9}}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:function(){return e.ParameterStructures}});const n=QT();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:function(){return n.LinkedMap}}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:function(){return n.LRUCache}}),Object.defineProperty(t,"Touch",{enumerable:!0,get:function(){return n.Touch}});const r=l8();Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=ja();Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const s=hp();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return s.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return s.CancellationToken}});const a=d8();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return a.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return a.SharedArrayReceiverStrategy}});const o=f8();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return o.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return o.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return o.ReadableStreamMessageReader}});const u=p8();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return u.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return u.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return u.WriteableStreamMessageWriter}});const c=h8();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return c.AbstractMessageBuffer}});const l=m8();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return l.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return l.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return l.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return l.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return l.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return l.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return l.Trace}}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return l.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return l.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return l.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return l.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return l.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return l.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return l.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return l.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return l.CancellationStrategy}}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:function(){return l.MessageStrategy}});const d=ks();t.RAL=d.default}(aw)),aw}var uk;function g8(){if(uk)return Cp;uk=1,Object.defineProperty(Cp,"__esModule",{value:!0});const t=G1,e=uw();class n extends e.AbstractMessageBuffer{constructor(u="utf-8"){super(u)}emptyBuffer(){return n.emptyBuffer}fromString(u,c){return Buffer.from(u,c)}toString(u,c){return u instanceof Buffer?u.toString(c):new t.TextDecoder(c).decode(u)}asNative(u,c){return c===void 0?u instanceof Buffer?u:Buffer.from(u):u instanceof Buffer?u.slice(0,c):Buffer.from(u,0,c)}allocNative(u){return Buffer.allocUnsafe(u)}}n.emptyBuffer=Buffer.allocUnsafe(0);class r{constructor(u){this.stream=u}onClose(u){return this.stream.on("close",u),e.Disposable.create(()=>this.stream.off("close",u))}onError(u){return this.stream.on("error",u),e.Disposable.create(()=>this.stream.off("error",u))}onEnd(u){return this.stream.on("end",u),e.Disposable.create(()=>this.stream.off("end",u))}onData(u){return this.stream.on("data",u),e.Disposable.create(()=>this.stream.off("data",u))}}class i{constructor(u){this.stream=u}onClose(u){return this.stream.on("close",u),e.Disposable.create(()=>this.stream.off("close",u))}onError(u){return this.stream.on("error",u),e.Disposable.create(()=>this.stream.off("error",u))}onEnd(u){return this.stream.on("end",u),e.Disposable.create(()=>this.stream.off("end",u))}write(u,c){return new Promise((l,d)=>{const f=p=>{p==null?l():d(p)};typeof u=="string"?this.stream.write(u,c,f):this.stream.write(u,f)})}end(){this.stream.end()}}const s=Object.freeze({messageBuffer:Object.freeze({create:o=>new n(o)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(o,u)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(o,void 0,0),u.charset))}catch(c){return Promise.reject(c)}}}),decoder:Object.freeze({name:"application/json",decode:(o,u)=>{try{return o instanceof Buffer?Promise.resolve(JSON.parse(o.toString(u.charset))):Promise.resolve(JSON.parse(new t.TextDecoder(u.charset).decode(o)))}catch(c){return Promise.reject(c)}}})}),stream:Object.freeze({asReadableStream:o=>new r(o),asWritableStream:o=>new i(o)}),console,timer:Object.freeze({setTimeout(o,u,...c){const l=setTimeout(o,u,...c);return{dispose:()=>clearTimeout(l)}},setImmediate(o,...u){const c=setImmediate(o,...u);return{dispose:()=>clearImmediate(c)}},setInterval(o,u,...c){const l=setInterval(o,u,...c);return{dispose:()=>clearInterval(l)}}})});function a(){return s}return function(o){function u(){e.RAL.install(s)}o.install=u}(a||(a={})),Cp.default=a,Cp}var ck;function Fs(){return ck||(ck=1,function(t){var e=Ns&&Ns.__createBinding||(Object.create?function(O,T,R,F){F===void 0&&(F=R);var V=Object.getOwnPropertyDescriptor(T,R);(!V||("get"in V?!T.__esModule:V.writable||V.configurable))&&(V={enumerable:!0,get:function(){return T[R]}}),Object.defineProperty(O,F,V)}:function(O,T,R,F){F===void 0&&(F=R),O[F]=T[R]}),n=Ns&&Ns.__exportStar||function(O,T){for(var R in O)R!=="default"&&!Object.prototype.hasOwnProperty.call(T,R)&&e(T,O,R)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.createServerSocketTransport=t.createClientSocketTransport=t.createServerPipeTransport=t.createClientPipeTransport=t.generateRandomPipeName=t.StreamMessageWriter=t.StreamMessageReader=t.SocketMessageWriter=t.SocketMessageReader=t.PortMessageWriter=t.PortMessageReader=t.IPCMessageWriter=t.IPCMessageReader=void 0;const r=g8();r.default.install();const i=$r,s=j1,a=U1,o=W1,u=uw();n(uw(),t);class c extends u.AbstractMessageReader{constructor(T){super(),this.process=T;let R=this.process;R.on("error",F=>this.fireError(F)),R.on("close",()=>this.fireClose())}listen(T){return this.process.on("message",T),u.Disposable.create(()=>this.process.off("message",T))}}t.IPCMessageReader=c;class l extends u.AbstractMessageWriter{constructor(T){super(),this.process=T,this.errorCount=0;const R=this.process;R.on("error",F=>this.fireError(F)),R.on("close",()=>this.fireClose)}write(T){try{return typeof this.process.send=="function"&&this.process.send(T,void 0,void 0,R=>{R?(this.errorCount++,this.handleError(R,T)):this.errorCount=0}),Promise.resolve()}catch(R){return this.handleError(R,T),Promise.reject(R)}}handleError(T,R){this.errorCount++,this.fireError(T,R,this.errorCount)}end(){}}t.IPCMessageWriter=l;class d extends u.AbstractMessageReader{constructor(T){super(),this.onData=new u.Emitter,T.on("close",()=>this.fireClose),T.on("error",R=>this.fireError(R)),T.on("message",R=>{this.onData.fire(R)})}listen(T){return this.onData.event(T)}}t.PortMessageReader=d;class f extends u.AbstractMessageWriter{constructor(T){super(),this.port=T,this.errorCount=0,T.on("close",()=>this.fireClose()),T.on("error",R=>this.fireError(R))}write(T){try{return this.port.postMessage(T),Promise.resolve()}catch(R){return this.handleError(R,T),Promise.reject(R)}}handleError(T,R){this.errorCount++,this.fireError(T,R,this.errorCount)}end(){}}t.PortMessageWriter=f;class p extends u.ReadableStreamMessageReader{constructor(T,R="utf-8"){super((0,r.default)().stream.asReadableStream(T),R)}}t.SocketMessageReader=p;class h extends u.WriteableStreamMessageWriter{constructor(T,R){super((0,r.default)().stream.asWritableStream(T),R),this.socket=T}dispose(){super.dispose(),this.socket.destroy()}}t.SocketMessageWriter=h;class y extends u.ReadableStreamMessageReader{constructor(T,R){super((0,r.default)().stream.asReadableStream(T),R)}}t.StreamMessageReader=y;class b extends u.WriteableStreamMessageWriter{constructor(T,R){super((0,r.default)().stream.asWritableStream(T),R)}}t.StreamMessageWriter=b;const w=process.env.XDG_RUNTIME_DIR,E=new Map([["linux",107],["darwin",103]]);function $(){const O=(0,a.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${O}-sock`;let T;w?T=i.join(w,`vscode-ipc-${O}.sock`):T=i.join(s.tmpdir(),`vscode-${O}.sock`);const R=E.get(process.platform);return R!==void 0&&T.length>R&&(0,r.default)().console.warn(`WARNING: IPC handle "${T}" is longer than ${R} characters.`),T}t.generateRandomPipeName=$;function k(O,T="utf-8"){let R;const F=new Promise((V,W)=>{R=V});return new Promise((V,W)=>{let H=(0,o.createServer)(Ee=>{H.close(),R([new p(Ee,T),new h(Ee,T)])});H.on("error",W),H.listen(O,()=>{H.removeListener("error",W),V({onConnected:()=>F})})})}t.createClientPipeTransport=k;function A(O,T="utf-8"){const R=(0,o.createConnection)(O);return[new p(R,T),new h(R,T)]}t.createServerPipeTransport=A;function I(O,T="utf-8"){let R;const F=new Promise((V,W)=>{R=V});return new Promise((V,W)=>{const H=(0,o.createServer)(Ee=>{H.close(),R([new p(Ee,T),new h(Ee,T)])});H.on("error",W),H.listen(O,"127.0.0.1",()=>{H.removeListener("error",W),V({onConnected:()=>F})})})}t.createClientSocketTransport=I;function M(O,T="utf-8"){const R=(0,o.createConnection)(O,"127.0.0.1");return[new p(R,T),new h(R,T)]}t.createServerSocketTransport=M;function Y(O){const T=O;return T.read!==void 0&&T.addListener!==void 0}function Q(O){const T=O;return T.write!==void 0&&T.addListener!==void 0}function ae(O,T,R,F){R||(R=u.NullLogger);const V=Y(O)?new y(O):O,W=Q(T)?new b(T):T;return u.ConnectionStrategy.is(F)&&(F={connectionStrategy:F}),(0,u.createMessageConnection)(V,W,R,F)}t.createMessageConnection=ae}(Ns)),Ns}var cw,lk;function dk(){return lk||(lk=1,cw=Fs()),cw}var Ls={};function y8(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ap={exports:{}},fk;function lw(){return fk||(fk=1,function(t,e){(function(n){{var r=n(y8,e);r!==void 0&&(t.exports=r)}})(function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.TextDocument=r.EOL=r.WorkspaceFolder=r.InlineCompletionContext=r.SelectedCompletionInfo=r.InlineCompletionTriggerKind=r.InlineCompletionList=r.InlineCompletionItem=r.StringValue=r.InlayHint=r.InlayHintLabelPart=r.InlayHintKind=r.InlineValueContext=r.InlineValueEvaluatableExpression=r.InlineValueVariableLookup=r.InlineValueText=r.SemanticTokens=r.SemanticTokenModifiers=r.SemanticTokenTypes=r.SelectionRange=r.DocumentLink=r.FormattingOptions=r.CodeLens=r.CodeAction=r.CodeActionContext=r.CodeActionTriggerKind=r.CodeActionKind=r.DocumentSymbol=r.WorkspaceSymbol=r.SymbolInformation=r.SymbolTag=r.SymbolKind=r.DocumentHighlight=r.DocumentHighlightKind=r.SignatureInformation=r.ParameterInformation=r.Hover=r.MarkedString=r.CompletionList=r.CompletionItem=r.CompletionItemLabelDetails=r.InsertTextMode=r.InsertReplaceEdit=r.CompletionItemTag=r.InsertTextFormat=r.CompletionItemKind=r.MarkupContent=r.MarkupKind=r.TextDocumentItem=r.OptionalVersionedTextDocumentIdentifier=r.VersionedTextDocumentIdentifier=r.TextDocumentIdentifier=r.WorkspaceChange=r.WorkspaceEdit=r.DeleteFile=r.RenameFile=r.CreateFile=r.TextDocumentEdit=r.AnnotatedTextEdit=r.ChangeAnnotationIdentifier=r.ChangeAnnotation=r.TextEdit=r.Command=r.Diagnostic=r.CodeDescription=r.DiagnosticTag=r.DiagnosticSeverity=r.DiagnosticRelatedInformation=r.FoldingRange=r.FoldingRangeKind=r.ColorPresentation=r.ColorInformation=r.Color=r.LocationLink=r.Location=r.Range=r.Position=r.uinteger=r.integer=r.URI=r.DocumentUri=void 0;var i;(function(v){function _(m){return typeof m=="string"}v.is=_})(i||(r.DocumentUri=i={}));var s;(function(v){function _(m){return typeof m=="string"}v.is=_})(s||(r.URI=s={}));var a;(function(v){v.MIN_VALUE=-2147483648,v.MAX_VALUE=2147483647;function _(m){return typeof m=="number"&&v.MIN_VALUE<=m&&m<=v.MAX_VALUE}v.is=_})(a||(r.integer=a={}));var o;(function(v){v.MIN_VALUE=0,v.MAX_VALUE=2147483647;function _(m){return typeof m=="number"&&v.MIN_VALUE<=m&&m<=v.MAX_VALUE}v.is=_})(o||(r.uinteger=o={}));var u;(function(v){function _(S,g){return S===Number.MAX_VALUE&&(S=o.MAX_VALUE),g===Number.MAX_VALUE&&(g=o.MAX_VALUE),{line:S,character:g}}v.create=_;function m(S){var g=S;return L.objectLiteral(g)&&L.uinteger(g.line)&&L.uinteger(g.character)}v.is=m})(u||(r.Position=u={}));var c;(function(v){function _(S,g,P,D){if(L.uinteger(S)&&L.uinteger(g)&&L.uinteger(P)&&L.uinteger(D))return{start:u.create(S,g),end:u.create(P,D)};if(u.is(S)&&u.is(g))return{start:S,end:g};throw new Error("Range#create called with invalid arguments[".concat(S,", ").concat(g,", ").concat(P,", ").concat(D,"]"))}v.create=_;function m(S){var g=S;return L.objectLiteral(g)&&u.is(g.start)&&u.is(g.end)}v.is=m})(c||(r.Range=c={}));var l;(function(v){function _(S,g){return{uri:S,range:g}}v.create=_;function m(S){var g=S;return L.objectLiteral(g)&&c.is(g.range)&&(L.string(g.uri)||L.undefined(g.uri))}v.is=m})(l||(r.Location=l={}));var d;(function(v){function _(S,g,P,D){return{targetUri:S,targetRange:g,targetSelectionRange:P,originSelectionRange:D}}v.create=_;function m(S){var g=S;return L.objectLiteral(g)&&c.is(g.targetRange)&&L.string(g.targetUri)&&c.is(g.targetSelectionRange)&&(c.is(g.originSelectionRange)||L.undefined(g.originSelectionRange))}v.is=m})(d||(r.LocationLink=d={}));var f;(function(v){function _(S,g,P,D){return{red:S,green:g,blue:P,alpha:D}}v.create=_;function m(S){var g=S;return L.objectLiteral(g)&&L.numberRange(g.red,0,1)&&L.numberRange(g.green,0,1)&&L.numberRange(g.blue,0,1)&&L.numberRange(g.alpha,0,1)}v.is=m})(f||(r.Color=f={}));var p;(function(v){function _(S,g){return{range:S,color:g}}v.create=_;function m(S){var g=S;return L.objectLiteral(g)&&c.is(g.range)&&f.is(g.color)}v.is=m})(p||(r.ColorInformation=p={}));var h;(function(v){function _(S,g,P){return{label:S,textEdit:g,additionalTextEdits:P}}v.create=_;function m(S){var g=S;return L.objectLiteral(g)&&L.string(g.label)&&(L.undefined(g.textEdit)||M.is(g))&&(L.undefined(g.additionalTextEdits)||L.typedArray(g.additionalTextEdits,M.is))}v.is=m})(h||(r.ColorPresentation=h={}));var y;(function(v){v.Comment="comment",v.Imports="imports",v.Region="region"})(y||(r.FoldingRangeKind=y={}));var b;(function(v){function _(S,g,P,D,G,ee){var re={startLine:S,endLine:g};return L.defined(P)&&(re.startCharacter=P),L.defined(D)&&(re.endCharacter=D),L.defined(G)&&(re.kind=G),L.defined(ee)&&(re.collapsedText=ee),re}v.create=_;function m(S){var g=S;return L.objectLiteral(g)&&L.uinteger(g.startLine)&&L.uinteger(g.startLine)&&(L.undefined(g.startCharacter)||L.uinteger(g.startCharacter))&&(L.undefined(g.endCharacter)||L.uinteger(g.endCharacter))&&(L.undefined(g.kind)||L.string(g.kind))}v.is=m})(b||(r.FoldingRange=b={}));var w;(function(v){function _(S,g){return{location:S,message:g}}v.create=_;function m(S){var g=S;return L.defined(g)&&l.is(g.location)&&L.string(g.message)}v.is=m})(w||(r.DiagnosticRelatedInformation=w={}));var E;(function(v){v.Error=1,v.Warning=2,v.Information=3,v.Hint=4})(E||(r.DiagnosticSeverity=E={}));var $;(function(v){v.Unnecessary=1,v.Deprecated=2})($||(r.DiagnosticTag=$={}));var k;(function(v){function _(m){var S=m;return L.objectLiteral(S)&&L.string(S.href)}v.is=_})(k||(r.CodeDescription=k={}));var A;(function(v){function _(S,g,P,D,G,ee){var re={range:S,message:g};return L.defined(P)&&(re.severity=P),L.defined(D)&&(re.code=D),L.defined(G)&&(re.source=G),L.defined(ee)&&(re.relatedInformation=ee),re}v.create=_;function m(S){var g,P=S;return L.defined(P)&&c.is(P.range)&&L.string(P.message)&&(L.number(P.severity)||L.undefined(P.severity))&&(L.integer(P.code)||L.string(P.code)||L.undefined(P.code))&&(L.undefined(P.codeDescription)||L.string((g=P.codeDescription)===null||g===void 0?void 0:g.href))&&(L.string(P.source)||L.undefined(P.source))&&(L.undefined(P.relatedInformation)||L.typedArray(P.relatedInformation,w.is))}v.is=m})(A||(r.Diagnostic=A={}));var I;(function(v){function _(S,g){for(var P=[],D=2;D<arguments.length;D++)P[D-2]=arguments[D];var G={title:S,command:g};return L.defined(P)&&P.length>0&&(G.arguments=P),G}v.create=_;function m(S){var g=S;return L.defined(g)&&L.string(g.title)&&L.string(g.command)}v.is=m})(I||(r.Command=I={}));var M;(function(v){function _(P,D){return{range:P,newText:D}}v.replace=_;function m(P,D){return{range:{start:P,end:P},newText:D}}v.insert=m;function S(P){return{range:P,newText:""}}v.del=S;function g(P){var D=P;return L.objectLiteral(D)&&L.string(D.newText)&&c.is(D.range)}v.is=g})(M||(r.TextEdit=M={}));var Y;(function(v){function _(S,g,P){var D={label:S};return g!==void 0&&(D.needsConfirmation=g),P!==void 0&&(D.description=P),D}v.create=_;function m(S){var g=S;return L.objectLiteral(g)&&L.string(g.label)&&(L.boolean(g.needsConfirmation)||g.needsConfirmation===void 0)&&(L.string(g.description)||g.description===void 0)}v.is=m})(Y||(r.ChangeAnnotation=Y={}));var Q;(function(v){function _(m){var S=m;return L.string(S)}v.is=_})(Q||(r.ChangeAnnotationIdentifier=Q={}));var ae;(function(v){function _(P,D,G){return{range:P,newText:D,annotationId:G}}v.replace=_;function m(P,D,G){return{range:{start:P,end:P},newText:D,annotationId:G}}v.insert=m;function S(P,D){return{range:P,newText:"",annotationId:D}}v.del=S;function g(P){var D=P;return M.is(D)&&(Y.is(D.annotationId)||Q.is(D.annotationId))}v.is=g})(ae||(r.AnnotatedTextEdit=ae={}));var O;(function(v){function _(S,g){return{textDocument:S,edits:g}}v.create=_;function m(S){var g=S;return L.defined(g)&&me.is(g.textDocument)&&Array.isArray(g.edits)}v.is=m})(O||(r.TextDocumentEdit=O={}));var T;(function(v){function _(S,g,P){var D={kind:"create",uri:S};return g!==void 0&&(g.overwrite!==void 0||g.ignoreIfExists!==void 0)&&(D.options=g),P!==void 0&&(D.annotationId=P),D}v.create=_;function m(S){var g=S;return g&&g.kind==="create"&&L.string(g.uri)&&(g.options===void 0||(g.options.overwrite===void 0||L.boolean(g.options.overwrite))&&(g.options.ignoreIfExists===void 0||L.boolean(g.options.ignoreIfExists)))&&(g.annotationId===void 0||Q.is(g.annotationId))}v.is=m})(T||(r.CreateFile=T={}));var R;(function(v){function _(S,g,P,D){var G={kind:"rename",oldUri:S,newUri:g};return P!==void 0&&(P.overwrite!==void 0||P.ignoreIfExists!==void 0)&&(G.options=P),D!==void 0&&(G.annotationId=D),G}v.create=_;function m(S){var g=S;return g&&g.kind==="rename"&&L.string(g.oldUri)&&L.string(g.newUri)&&(g.options===void 0||(g.options.overwrite===void 0||L.boolean(g.options.overwrite))&&(g.options.ignoreIfExists===void 0||L.boolean(g.options.ignoreIfExists)))&&(g.annotationId===void 0||Q.is(g.annotationId))}v.is=m})(R||(r.RenameFile=R={}));var F;(function(v){function _(S,g,P){var D={kind:"delete",uri:S};return g!==void 0&&(g.recursive!==void 0||g.ignoreIfNotExists!==void 0)&&(D.options=g),P!==void 0&&(D.annotationId=P),D}v.create=_;function m(S){var g=S;return g&&g.kind==="delete"&&L.string(g.uri)&&(g.options===void 0||(g.options.recursive===void 0||L.boolean(g.options.recursive))&&(g.options.ignoreIfNotExists===void 0||L.boolean(g.options.ignoreIfNotExists)))&&(g.annotationId===void 0||Q.is(g.annotationId))}v.is=m})(F||(r.DeleteFile=F={}));var V;(function(v){function _(m){var S=m;return S&&(S.changes!==void 0||S.documentChanges!==void 0)&&(S.documentChanges===void 0||S.documentChanges.every(function(g){return L.string(g.kind)?T.is(g)||R.is(g)||F.is(g):O.is(g)}))}v.is=_})(V||(r.WorkspaceEdit=V={}));var W=function(){function v(_,m){this.edits=_,this.changeAnnotations=m}return v.prototype.insert=function(_,m,S){var g,P;if(S===void 0?g=M.insert(_,m):Q.is(S)?(P=S,g=ae.insert(_,m,S)):(this.assertChangeAnnotations(this.changeAnnotations),P=this.changeAnnotations.manage(S),g=ae.insert(_,m,P)),this.edits.push(g),P!==void 0)return P},v.prototype.replace=function(_,m,S){var g,P;if(S===void 0?g=M.replace(_,m):Q.is(S)?(P=S,g=ae.replace(_,m,S)):(this.assertChangeAnnotations(this.changeAnnotations),P=this.changeAnnotations.manage(S),g=ae.replace(_,m,P)),this.edits.push(g),P!==void 0)return P},v.prototype.delete=function(_,m){var S,g;if(m===void 0?S=M.del(_):Q.is(m)?(g=m,S=ae.del(_,m)):(this.assertChangeAnnotations(this.changeAnnotations),g=this.changeAnnotations.manage(m),S=ae.del(_,g)),this.edits.push(S),g!==void 0)return g},v.prototype.add=function(_){this.edits.push(_)},v.prototype.all=function(){return this.edits},v.prototype.clear=function(){this.edits.splice(0,this.edits.length)},v.prototype.assertChangeAnnotations=function(_){if(_===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},v}(),H=function(){function v(_){this._annotations=_===void 0?Object.create(null):_,this._counter=0,this._size=0}return v.prototype.all=function(){return this._annotations},Object.defineProperty(v.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),v.prototype.manage=function(_,m){var S;if(Q.is(_)?S=_:(S=this.nextId(),m=_),this._annotations[S]!==void 0)throw new Error("Id ".concat(S," is already in use."));if(m===void 0)throw new Error("No annotation provided for id ".concat(S));return this._annotations[S]=m,this._size++,S},v.prototype.nextId=function(){return this._counter++,this._counter.toString()},v}(),Ee=function(){function v(_){var m=this;this._textEditChanges=Object.create(null),_!==void 0?(this._workspaceEdit=_,_.documentChanges?(this._changeAnnotations=new H(_.changeAnnotations),_.changeAnnotations=this._changeAnnotations.all(),_.documentChanges.forEach(function(S){if(O.is(S)){var g=new W(S.edits,m._changeAnnotations);m._textEditChanges[S.textDocument.uri]=g}})):_.changes&&Object.keys(_.changes).forEach(function(S){var g=new W(_.changes[S]);m._textEditChanges[S]=g})):this._workspaceEdit={}}return Object.defineProperty(v.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),v.prototype.getTextEditChange=function(_){if(me.is(_)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var m={uri:_.uri,version:_.version},S=this._textEditChanges[m.uri];if(!S){var g=[],P={textDocument:m,edits:g};this._workspaceEdit.documentChanges.push(P),S=new W(g,this._changeAnnotations),this._textEditChanges[m.uri]=S}return S}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var S=this._textEditChanges[_];if(!S){var g=[];this._workspaceEdit.changes[_]=g,S=new W(g),this._textEditChanges[_]=S}return S}},v.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new H,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},v.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},v.prototype.createFile=function(_,m,S){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var g;Y.is(m)||Q.is(m)?g=m:S=m;var P,D;if(g===void 0?P=T.create(_,S):(D=Q.is(g)?g:this._changeAnnotations.manage(g),P=T.create(_,S,D)),this._workspaceEdit.documentChanges.push(P),D!==void 0)return D},v.prototype.renameFile=function(_,m,S,g){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var P;Y.is(S)||Q.is(S)?P=S:g=S;var D,G;if(P===void 0?D=R.create(_,m,g):(G=Q.is(P)?P:this._changeAnnotations.manage(P),D=R.create(_,m,g,G)),this._workspaceEdit.documentChanges.push(D),G!==void 0)return G},v.prototype.deleteFile=function(_,m,S){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var g;Y.is(m)||Q.is(m)?g=m:S=m;var P,D;if(g===void 0?P=F.create(_,S):(D=Q.is(g)?g:this._changeAnnotations.manage(g),P=F.create(_,S,D)),this._workspaceEdit.documentChanges.push(P),D!==void 0)return D},v}();r.WorkspaceChange=Ee;var te;(function(v){function _(S){return{uri:S}}v.create=_;function m(S){var g=S;return L.defined(g)&&L.string(g.uri)}v.is=m})(te||(r.TextDocumentIdentifier=te={}));var C;(function(v){function _(S,g){return{uri:S,version:g}}v.create=_;function m(S){var g=S;return L.defined(g)&&L.string(g.uri)&&L.integer(g.version)}v.is=m})(C||(r.VersionedTextDocumentIdentifier=C={}));var me;(function(v){function _(S,g){return{uri:S,version:g}}v.create=_;function m(S){var g=S;return L.defined(g)&&L.string(g.uri)&&(g.version===null||L.integer(g.version))}v.is=m})(me||(r.OptionalVersionedTextDocumentIdentifier=me={}));var ke;(function(v){function _(S,g,P,D){return{uri:S,languageId:g,version:P,text:D}}v.create=_;function m(S){var g=S;return L.defined(g)&&L.string(g.uri)&&L.string(g.languageId)&&L.integer(g.version)&&L.string(g.text)}v.is=m})(ke||(r.TextDocumentItem=ke={}));var at;(function(v){v.PlainText="plaintext",v.Markdown="markdown";function _(m){var S=m;return S===v.PlainText||S===v.Markdown}v.is=_})(at||(r.MarkupKind=at={}));var j;(function(v){function _(m){var S=m;return L.objectLiteral(m)&&at.is(S.kind)&&L.string(S.value)}v.is=_})(j||(r.MarkupContent=j={}));var K;(function(v){v.Text=1,v.Method=2,v.Function=3,v.Constructor=4,v.Field=5,v.Variable=6,v.Class=7,v.Interface=8,v.Module=9,v.Property=10,v.Unit=11,v.Value=12,v.Enum=13,v.Keyword=14,v.Snippet=15,v.Color=16,v.File=17,v.Reference=18,v.Folder=19,v.EnumMember=20,v.Constant=21,v.Struct=22,v.Event=23,v.Operator=24,v.TypeParameter=25})(K||(r.CompletionItemKind=K={}));var Fe;(function(v){v.PlainText=1,v.Snippet=2})(Fe||(r.InsertTextFormat=Fe={}));var ue;(function(v){v.Deprecated=1})(ue||(r.CompletionItemTag=ue={}));var be;(function(v){function _(S,g,P){return{newText:S,insert:g,replace:P}}v.create=_;function m(S){var g=S;return g&&L.string(g.newText)&&c.is(g.insert)&&c.is(g.replace)}v.is=m})(be||(r.InsertReplaceEdit=be={}));var Ce;(function(v){v.asIs=1,v.adjustIndentation=2})(Ce||(r.InsertTextMode=Ce={}));var ce;(function(v){function _(m){var S=m;return S&&(L.string(S.detail)||S.detail===void 0)&&(L.string(S.description)||S.description===void 0)}v.is=_})(ce||(r.CompletionItemLabelDetails=ce={}));var x;(function(v){function _(m){return{label:m}}v.create=_})(x||(r.CompletionItem=x={}));var B;(function(v){function _(m,S){return{items:m||[],isIncomplete:!!S}}v.create=_})(B||(r.CompletionList=B={}));var de;(function(v){function _(S){return S.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}v.fromPlainText=_;function m(S){var g=S;return L.string(g)||L.objectLiteral(g)&&L.string(g.language)&&L.string(g.value)}v.is=m})(de||(r.MarkedString=de={}));var q;(function(v){function _(m){var S=m;return!!S&&L.objectLiteral(S)&&(j.is(S.contents)||de.is(S.contents)||L.typedArray(S.contents,de.is))&&(m.range===void 0||c.is(m.range))}v.is=_})(q||(r.Hover=q={}));var le;(function(v){function _(m,S){return S?{label:m,documentation:S}:{label:m}}v.create=_})(le||(r.ParameterInformation=le={}));var Ge;(function(v){function _(m,S){for(var g=[],P=2;P<arguments.length;P++)g[P-2]=arguments[P];var D={label:m};return L.defined(S)&&(D.documentation=S),L.defined(g)?D.parameters=g:D.parameters=[],D}v.create=_})(Ge||(r.SignatureInformation=Ge={}));var et;(function(v){v.Text=1,v.Read=2,v.Write=3})(et||(r.DocumentHighlightKind=et={}));var oe;(function(v){function _(m,S){var g={range:m};return L.number(S)&&(g.kind=S),g}v.create=_})(oe||(r.DocumentHighlight=oe={}));var xe;(function(v){v.File=1,v.Module=2,v.Namespace=3,v.Package=4,v.Class=5,v.Method=6,v.Property=7,v.Field=8,v.Constructor=9,v.Enum=10,v.Interface=11,v.Function=12,v.Variable=13,v.Constant=14,v.String=15,v.Number=16,v.Boolean=17,v.Array=18,v.Object=19,v.Key=20,v.Null=21,v.EnumMember=22,v.Struct=23,v.Event=24,v.Operator=25,v.TypeParameter=26})(xe||(r.SymbolKind=xe={}));var ne;(function(v){v.Deprecated=1})(ne||(r.SymbolTag=ne={}));var De;(function(v){function _(m,S,g,P,D){var G={name:m,kind:S,location:{uri:P,range:g}};return D&&(G.containerName=D),G}v.create=_})(De||(r.SymbolInformation=De={}));var ze;(function(v){function _(m,S,g,P){return P!==void 0?{name:m,kind:S,location:{uri:g,range:P}}:{name:m,kind:S,location:{uri:g}}}v.create=_})(ze||(r.WorkspaceSymbol=ze={}));var ht;(function(v){function _(S,g,P,D,G,ee){var re={name:S,detail:g,kind:P,range:D,selectionRange:G};return ee!==void 0&&(re.children=ee),re}v.create=_;function m(S){var g=S;return g&&L.string(g.name)&&L.number(g.kind)&&c.is(g.range)&&c.is(g.selectionRange)&&(g.detail===void 0||L.string(g.detail))&&(g.deprecated===void 0||L.boolean(g.deprecated))&&(g.children===void 0||Array.isArray(g.children))&&(g.tags===void 0||Array.isArray(g.tags))}v.is=m})(ht||(r.DocumentSymbol=ht={}));var Ye;(function(v){v.Empty="",v.QuickFix="quickfix",v.Refactor="refactor",v.RefactorExtract="refactor.extract",v.RefactorInline="refactor.inline",v.RefactorRewrite="refactor.rewrite",v.Source="source",v.SourceOrganizeImports="source.organizeImports",v.SourceFixAll="source.fixAll"})(Ye||(r.CodeActionKind=Ye={}));var qt;(function(v){v.Invoked=1,v.Automatic=2})(qt||(r.CodeActionTriggerKind=qt={}));var Wt;(function(v){function _(S,g,P){var D={diagnostics:S};return g!=null&&(D.only=g),P!=null&&(D.triggerKind=P),D}v.create=_;function m(S){var g=S;return L.defined(g)&&L.typedArray(g.diagnostics,A.is)&&(g.only===void 0||L.typedArray(g.only,L.string))&&(g.triggerKind===void 0||g.triggerKind===qt.Invoked||g.triggerKind===qt.Automatic)}v.is=m})(Wt||(r.CodeActionContext=Wt={}));var dn;(function(v){function _(S,g,P){var D={title:S},G=!0;return typeof g=="string"?(G=!1,D.kind=g):I.is(g)?D.command=g:D.edit=g,G&&P!==void 0&&(D.kind=P),D}v.create=_;function m(S){var g=S;return g&&L.string(g.title)&&(g.diagnostics===void 0||L.typedArray(g.diagnostics,A.is))&&(g.kind===void 0||L.string(g.kind))&&(g.edit!==void 0||g.command!==void 0)&&(g.command===void 0||I.is(g.command))&&(g.isPreferred===void 0||L.boolean(g.isPreferred))&&(g.edit===void 0||V.is(g.edit))}v.is=m})(dn||(r.CodeAction=dn={}));var X;(function(v){function _(S,g){var P={range:S};return L.defined(g)&&(P.data=g),P}v.create=_;function m(S){var g=S;return L.defined(g)&&c.is(g.range)&&(L.undefined(g.command)||I.is(g.command))}v.is=m})(X||(r.CodeLens=X={}));var J;(function(v){function _(S,g){return{tabSize:S,insertSpaces:g}}v.create=_;function m(S){var g=S;return L.defined(g)&&L.uinteger(g.tabSize)&&L.boolean(g.insertSpaces)}v.is=m})(J||(r.FormattingOptions=J={}));var fe;(function(v){function _(S,g,P){return{range:S,target:g,data:P}}v.create=_;function m(S){var g=S;return L.defined(g)&&c.is(g.range)&&(L.undefined(g.target)||L.string(g.target))}v.is=m})(fe||(r.DocumentLink=fe={}));var Ht;(function(v){function _(S,g){return{range:S,parent:g}}v.create=_;function m(S){var g=S;return L.objectLiteral(g)&&c.is(g.range)&&(g.parent===void 0||v.is(g.parent))}v.is=m})(Ht||(r.SelectionRange=Ht={}));var Gt;(function(v){v.namespace="namespace",v.type="type",v.class="class",v.enum="enum",v.interface="interface",v.struct="struct",v.typeParameter="typeParameter",v.parameter="parameter",v.variable="variable",v.property="property",v.enumMember="enumMember",v.event="event",v.function="function",v.method="method",v.macro="macro",v.keyword="keyword",v.modifier="modifier",v.comment="comment",v.string="string",v.number="number",v.regexp="regexp",v.operator="operator",v.decorator="decorator"})(Gt||(r.SemanticTokenTypes=Gt={}));var Dr;(function(v){v.declaration="declaration",v.definition="definition",v.readonly="readonly",v.static="static",v.deprecated="deprecated",v.abstract="abstract",v.async="async",v.modification="modification",v.documentation="documentation",v.defaultLibrary="defaultLibrary"})(Dr||(r.SemanticTokenModifiers=Dr={}));var Di;(function(v){function _(m){var S=m;return L.objectLiteral(S)&&(S.resultId===void 0||typeof S.resultId=="string")&&Array.isArray(S.data)&&(S.data.length===0||typeof S.data[0]=="number")}v.is=_})(Di||(r.SemanticTokens=Di={}));var ns;(function(v){function _(S,g){return{range:S,text:g}}v.create=_;function m(S){var g=S;return g!=null&&c.is(g.range)&&L.string(g.text)}v.is=m})(ns||(r.InlineValueText=ns={}));var rs;(function(v){function _(S,g,P){return{range:S,variableName:g,caseSensitiveLookup:P}}v.create=_;function m(S){var g=S;return g!=null&&c.is(g.range)&&L.boolean(g.caseSensitiveLookup)&&(L.string(g.variableName)||g.variableName===void 0)}v.is=m})(rs||(r.InlineValueVariableLookup=rs={}));var is;(function(v){function _(S,g){return{range:S,expression:g}}v.create=_;function m(S){var g=S;return g!=null&&c.is(g.range)&&(L.string(g.expression)||g.expression===void 0)}v.is=m})(is||(r.InlineValueEvaluatableExpression=is={}));var ss;(function(v){function _(S,g){return{frameId:S,stoppedLocation:g}}v.create=_;function m(S){var g=S;return L.defined(g)&&c.is(S.stoppedLocation)}v.is=m})(ss||(r.InlineValueContext=ss={}));var Ei;(function(v){v.Type=1,v.Parameter=2;function _(m){return m===1||m===2}v.is=_})(Ei||(r.InlayHintKind=Ei={}));var Ri;(function(v){function _(S){return{value:S}}v.create=_;function m(S){var g=S;return L.objectLiteral(g)&&(g.tooltip===void 0||L.string(g.tooltip)||j.is(g.tooltip))&&(g.location===void 0||l.is(g.location))&&(g.command===void 0||I.is(g.command))}v.is=m})(Ri||(r.InlayHintLabelPart=Ri={}));var $n;(function(v){function _(S,g,P){var D={position:S,label:g};return P!==void 0&&(D.kind=P),D}v.create=_;function m(S){var g=S;return L.objectLiteral(g)&&u.is(g.position)&&(L.string(g.label)||L.typedArray(g.label,Ri.is))&&(g.kind===void 0||Ei.is(g.kind))&&g.textEdits===void 0||L.typedArray(g.textEdits,M.is)&&(g.tooltip===void 0||L.string(g.tooltip)||j.is(g.tooltip))&&(g.paddingLeft===void 0||L.boolean(g.paddingLeft))&&(g.paddingRight===void 0||L.boolean(g.paddingRight))}v.is=m})($n||(r.InlayHint=$n={}));var as;(function(v){function _(m){return{kind:"snippet",value:m}}v.createSnippet=_})(as||(r.StringValue=as={}));var os;(function(v){function _(m,S,g,P){return{insertText:m,filterText:S,range:g,command:P}}v.create=_})(os||(r.InlineCompletionItem=os={}));var Er;(function(v){function _(m){return{items:m}}v.create=_})(Er||(r.InlineCompletionList=Er={}));var us;(function(v){v.Invoked=0,v.Automatic=1})(us||(r.InlineCompletionTriggerKind=us={}));var Ur;(function(v){function _(m,S){return{range:m,text:S}}v.create=_})(Ur||(r.SelectedCompletionInfo=Ur={}));var cs;(function(v){function _(m,S){return{triggerKind:m,selectedCompletionInfo:S}}v.create=_})(cs||(r.InlineCompletionContext=cs={}));var jn;(function(v){function _(m){var S=m;return L.objectLiteral(S)&&s.is(S.uri)&&L.string(S.name)}v.is=_})(jn||(r.WorkspaceFolder=jn={})),r.EOL=[`
156
+ `,`\r
157
+ `,"\r"];var sr;(function(v){function _(P,D,G,ee){return new ba(P,D,G,ee)}v.create=_;function m(P){var D=P;return!!(L.defined(D)&&L.string(D.uri)&&(L.undefined(D.languageId)||L.string(D.languageId))&&L.uinteger(D.lineCount)&&L.func(D.getText)&&L.func(D.positionAt)&&L.func(D.offsetAt))}v.is=m;function S(P,D){for(var G=P.getText(),ee=g(D,function(Ie,nt){var Je=Ie.range.start.line-nt.range.start.line;return Je===0?Ie.range.start.character-nt.range.start.character:Je}),re=G.length,Be=ee.length-1;Be>=0;Be--){var Le=ee[Be],Xe=P.offsetAt(Le.range.start),ge=P.offsetAt(Le.range.end);if(ge<=re)G=G.substring(0,Xe)+Le.newText+G.substring(ge,G.length);else throw new Error("Overlapping edit");re=Xe}return G}v.applyEdits=S;function g(P,D){if(P.length<=1)return P;var G=P.length/2|0,ee=P.slice(0,G),re=P.slice(G);g(ee,D),g(re,D);for(var Be=0,Le=0,Xe=0;Be<ee.length&&Le<re.length;){var ge=D(ee[Be],re[Le]);ge<=0?P[Xe++]=ee[Be++]:P[Xe++]=re[Le++]}for(;Be<ee.length;)P[Xe++]=ee[Be++];for(;Le<re.length;)P[Xe++]=re[Le++];return P}})(sr||(r.TextDocument=sr={}));var ba=function(){function v(_,m,S,g){this._uri=_,this._languageId=m,this._version=S,this._content=g,this._lineOffsets=void 0}return Object.defineProperty(v.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),v.prototype.getText=function(_){if(_){var m=this.offsetAt(_.start),S=this.offsetAt(_.end);return this._content.substring(m,S)}return this._content},v.prototype.update=function(_,m){this._content=_.text,this._version=m,this._lineOffsets=void 0},v.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var _=[],m=this._content,S=!0,g=0;g<m.length;g++){S&&(_.push(g),S=!1);var P=m.charAt(g);S=P==="\r"||P===`
158
+ `,P==="\r"&&g+1<m.length&&m.charAt(g+1)===`
159
+ `&&g++}S&&m.length>0&&_.push(m.length),this._lineOffsets=_}return this._lineOffsets},v.prototype.positionAt=function(_){_=Math.max(Math.min(_,this._content.length),0);var m=this.getLineOffsets(),S=0,g=m.length;if(g===0)return u.create(0,_);for(;S<g;){var P=Math.floor((S+g)/2);m[P]>_?g=P:S=P+1}var D=S-1;return u.create(D,_-m[D])},v.prototype.offsetAt=function(_){var m=this.getLineOffsets();if(_.line>=m.length)return this._content.length;if(_.line<0)return 0;var S=m[_.line],g=_.line+1<m.length?m[_.line+1]:this._content.length;return Math.max(Math.min(S+_.character,g),S)},Object.defineProperty(v.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),v}(),L;(function(v){var _=Object.prototype.toString;function m(ge){return typeof ge<"u"}v.defined=m;function S(ge){return typeof ge>"u"}v.undefined=S;function g(ge){return ge===!0||ge===!1}v.boolean=g;function P(ge){return _.call(ge)==="[object String]"}v.string=P;function D(ge){return _.call(ge)==="[object Number]"}v.number=D;function G(ge,Ie,nt){return _.call(ge)==="[object Number]"&&Ie<=ge&&ge<=nt}v.numberRange=G;function ee(ge){return _.call(ge)==="[object Number]"&&-2147483648<=ge&&ge<=2147483647}v.integer=ee;function re(ge){return _.call(ge)==="[object Number]"&&0<=ge&&ge<=2147483647}v.uinteger=re;function Be(ge){return _.call(ge)==="[object Function]"}v.func=Be;function Le(ge){return ge!==null&&typeof ge=="object"}v.objectLiteral=Le;function Xe(ge,Ie){return Array.isArray(ge)&&ge.every(Ie)}v.typedArray=Xe})(L||(L={}))})}(Ap,Ap.exports)),Ap.exports}var wn={},pk;function Et(){if(pk)return wn;pk=1,Object.defineProperty(wn,"__esModule",{value:!0}),wn.ProtocolNotificationType=wn.ProtocolNotificationType0=wn.ProtocolRequestType=wn.ProtocolRequestType0=wn.RegistrationType=wn.MessageDirection=void 0;const t=Fs();var e;(function(o){o.clientToServer="clientToServer",o.serverToClient="serverToClient",o.both="both"})(e||(wn.MessageDirection=e={}));class n{constructor(u){this.method=u}}wn.RegistrationType=n;class r extends t.RequestType0{constructor(u){super(u)}}wn.ProtocolRequestType0=r;class i extends t.RequestType{constructor(u){super(u,t.ParameterStructures.byName)}}wn.ProtocolRequestType=i;class s extends t.NotificationType0{constructor(u){super(u)}}wn.ProtocolNotificationType0=s;class a extends t.NotificationType{constructor(u){super(u,t.ParameterStructures.byName)}}return wn.ProtocolNotificationType=a,wn}var dw={},At={},hk;function fw(){if(hk)return At;hk=1,Object.defineProperty(At,"__esModule",{value:!0}),At.objectLiteral=At.typedArray=At.stringArray=At.array=At.func=At.error=At.number=At.string=At.boolean=void 0;function t(c){return c===!0||c===!1}At.boolean=t;function e(c){return typeof c=="string"||c instanceof String}At.string=e;function n(c){return typeof c=="number"||c instanceof Number}At.number=n;function r(c){return c instanceof Error}At.error=r;function i(c){return typeof c=="function"}At.func=i;function s(c){return Array.isArray(c)}At.array=s;function a(c){return s(c)&&c.every(l=>e(l))}At.stringArray=a;function o(c,l){return Array.isArray(c)&&c.every(l)}At.typedArray=o;function u(c){return c!==null&&typeof c=="object"}return At.objectLiteral=u,At}var Zu={},mk;function w8(){if(mk)return Zu;mk=1,Object.defineProperty(Zu,"__esModule",{value:!0}),Zu.ImplementationRequest=void 0;const t=Et();var e;return function(n){n.method="textDocument/implementation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(Zu.ImplementationRequest=e={})),Zu}var ec={},gk;function v8(){if(gk)return ec;gk=1,Object.defineProperty(ec,"__esModule",{value:!0}),ec.TypeDefinitionRequest=void 0;const t=Et();var e;return function(n){n.method="textDocument/typeDefinition",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(ec.TypeDefinitionRequest=e={})),ec}var Ms={},yk;function b8(){if(yk)return Ms;yk=1,Object.defineProperty(Ms,"__esModule",{value:!0}),Ms.DidChangeWorkspaceFoldersNotification=Ms.WorkspaceFoldersRequest=void 0;const t=Et();var e;(function(r){r.method="workspace/workspaceFolders",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)})(e||(Ms.WorkspaceFoldersRequest=e={}));var n;return function(r){r.method="workspace/didChangeWorkspaceFolders",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolNotificationType(r.method)}(n||(Ms.DidChangeWorkspaceFoldersNotification=n={})),Ms}var tc={},wk;function D8(){if(wk)return tc;wk=1,Object.defineProperty(tc,"__esModule",{value:!0}),tc.ConfigurationRequest=void 0;const t=Et();var e;return function(n){n.method="workspace/configuration",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(e||(tc.ConfigurationRequest=e={})),tc}var zs={},vk;function E8(){if(vk)return zs;vk=1,Object.defineProperty(zs,"__esModule",{value:!0}),zs.ColorPresentationRequest=zs.DocumentColorRequest=void 0;const t=Et();var e;(function(r){r.method="textDocument/documentColor",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(zs.DocumentColorRequest=e={}));var n;return function(r){r.method="textDocument/colorPresentation",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)}(n||(zs.ColorPresentationRequest=n={})),zs}var Bs={},bk;function R8(){if(bk)return Bs;bk=1,Object.defineProperty(Bs,"__esModule",{value:!0}),Bs.FoldingRangeRefreshRequest=Bs.FoldingRangeRequest=void 0;const t=Et();var e;(function(r){r.method="textDocument/foldingRange",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Bs.FoldingRangeRequest=e={}));var n;return function(r){r.method="workspace/foldingRange/refresh",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)}(n||(Bs.FoldingRangeRefreshRequest=n={})),Bs}var nc={},Dk;function $8(){if(Dk)return nc;Dk=1,Object.defineProperty(nc,"__esModule",{value:!0}),nc.DeclarationRequest=void 0;const t=Et();var e;return function(n){n.method="textDocument/declaration",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(nc.DeclarationRequest=e={})),nc}var rc={},Ek;function S8(){if(Ek)return rc;Ek=1,Object.defineProperty(rc,"__esModule",{value:!0}),rc.SelectionRangeRequest=void 0;const t=Et();var e;return function(n){n.method="textDocument/selectionRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(rc.SelectionRangeRequest=e={})),rc}var oi={},Rk;function T8(){if(Rk)return oi;Rk=1,Object.defineProperty(oi,"__esModule",{value:!0}),oi.WorkDoneProgressCancelNotification=oi.WorkDoneProgressCreateRequest=oi.WorkDoneProgress=void 0;const t=Fs(),e=Et();var n;(function(s){s.type=new t.ProgressType;function a(o){return o===s.type}s.is=a})(n||(oi.WorkDoneProgress=n={}));var r;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=e.MessageDirection.serverToClient,s.type=new e.ProtocolRequestType(s.method)})(r||(oi.WorkDoneProgressCreateRequest=r={}));var i;return function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolNotificationType(s.method)}(i||(oi.WorkDoneProgressCancelNotification=i={})),oi}var ui={},$k;function k8(){if($k)return ui;$k=1,Object.defineProperty(ui,"__esModule",{value:!0}),ui.CallHierarchyOutgoingCallsRequest=ui.CallHierarchyIncomingCallsRequest=ui.CallHierarchyPrepareRequest=void 0;const t=Et();var e;(function(i){i.method="textDocument/prepareCallHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(ui.CallHierarchyPrepareRequest=e={}));var n;(function(i){i.method="callHierarchy/incomingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(ui.CallHierarchyIncomingCallsRequest=n={}));var r;return function(i){i.method="callHierarchy/outgoingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(ui.CallHierarchyOutgoingCallsRequest=r={})),ui}var vn={},Sk;function C8(){if(Sk)return vn;Sk=1,Object.defineProperty(vn,"__esModule",{value:!0}),vn.SemanticTokensRefreshRequest=vn.SemanticTokensRangeRequest=vn.SemanticTokensDeltaRequest=vn.SemanticTokensRequest=vn.SemanticTokensRegistrationType=vn.TokenFormat=void 0;const t=Et();var e;(function(o){o.Relative="relative"})(e||(vn.TokenFormat=e={}));var n;(function(o){o.method="textDocument/semanticTokens",o.type=new t.RegistrationType(o.method)})(n||(vn.SemanticTokensRegistrationType=n={}));var r;(function(o){o.method="textDocument/semanticTokens/full",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),o.registrationMethod=n.method})(r||(vn.SemanticTokensRequest=r={}));var i;(function(o){o.method="textDocument/semanticTokens/full/delta",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),o.registrationMethod=n.method})(i||(vn.SemanticTokensDeltaRequest=i={}));var s;(function(o){o.method="textDocument/semanticTokens/range",o.messageDirection=t.MessageDirection.clientToServer,o.type=new t.ProtocolRequestType(o.method),o.registrationMethod=n.method})(s||(vn.SemanticTokensRangeRequest=s={}));var a;return function(o){o.method="workspace/semanticTokens/refresh",o.messageDirection=t.MessageDirection.serverToClient,o.type=new t.ProtocolRequestType0(o.method)}(a||(vn.SemanticTokensRefreshRequest=a={})),vn}var ic={},Tk;function A8(){if(Tk)return ic;Tk=1,Object.defineProperty(ic,"__esModule",{value:!0}),ic.ShowDocumentRequest=void 0;const t=Et();var e;return function(n){n.method="window/showDocument",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(e||(ic.ShowDocumentRequest=e={})),ic}var sc={},kk;function _8(){if(kk)return sc;kk=1,Object.defineProperty(sc,"__esModule",{value:!0}),sc.LinkedEditingRangeRequest=void 0;const t=Et();var e;return function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(sc.LinkedEditingRangeRequest=e={})),sc}var Zt={},Ck;function P8(){if(Ck)return Zt;Ck=1,Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.WillDeleteFilesRequest=Zt.DidDeleteFilesNotification=Zt.DidRenameFilesNotification=Zt.WillRenameFilesRequest=Zt.DidCreateFilesNotification=Zt.WillCreateFilesRequest=Zt.FileOperationPatternKind=void 0;const t=Et();var e;(function(u){u.file="file",u.folder="folder"})(e||(Zt.FileOperationPatternKind=e={}));var n;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(n||(Zt.WillCreateFilesRequest=n={}));var r;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(r||(Zt.DidCreateFilesNotification=r={}));var i;(function(u){u.method="workspace/willRenameFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)})(i||(Zt.WillRenameFilesRequest=i={}));var s;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(s||(Zt.DidRenameFilesNotification=s={}));var a;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolNotificationType(u.method)})(a||(Zt.DidDeleteFilesNotification=a={}));var o;return function(u){u.method="workspace/willDeleteFiles",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method)}(o||(Zt.WillDeleteFilesRequest=o={})),Zt}var ci={},Ak;function x8(){if(Ak)return ci;Ak=1,Object.defineProperty(ci,"__esModule",{value:!0}),ci.MonikerRequest=ci.MonikerKind=ci.UniquenessLevel=void 0;const t=Et();var e;(function(i){i.document="document",i.project="project",i.group="group",i.scheme="scheme",i.global="global"})(e||(ci.UniquenessLevel=e={}));var n;(function(i){i.$import="import",i.$export="export",i.local="local"})(n||(ci.MonikerKind=n={}));var r;return function(i){i.method="textDocument/moniker",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(ci.MonikerRequest=r={})),ci}var li={},_k;function I8(){if(_k)return li;_k=1,Object.defineProperty(li,"__esModule",{value:!0}),li.TypeHierarchySubtypesRequest=li.TypeHierarchySupertypesRequest=li.TypeHierarchyPrepareRequest=void 0;const t=Et();var e;(function(i){i.method="textDocument/prepareTypeHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(li.TypeHierarchyPrepareRequest=e={}));var n;(function(i){i.method="typeHierarchy/supertypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(li.TypeHierarchySupertypesRequest=n={}));var r;return function(i){i.method="typeHierarchy/subtypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(li.TypeHierarchySubtypesRequest=r={})),li}var qs={},Pk;function N8(){if(Pk)return qs;Pk=1,Object.defineProperty(qs,"__esModule",{value:!0}),qs.InlineValueRefreshRequest=qs.InlineValueRequest=void 0;const t=Et();var e;(function(r){r.method="textDocument/inlineValue",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(qs.InlineValueRequest=e={}));var n;return function(r){r.method="workspace/inlineValue/refresh",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)}(n||(qs.InlineValueRefreshRequest=n={})),qs}var di={},xk;function O8(){if(xk)return di;xk=1,Object.defineProperty(di,"__esModule",{value:!0}),di.InlayHintRefreshRequest=di.InlayHintResolveRequest=di.InlayHintRequest=void 0;const t=Et();var e;(function(i){i.method="textDocument/inlayHint",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(di.InlayHintRequest=e={}));var n;(function(i){i.method="inlayHint/resolve",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(di.InlayHintResolveRequest=n={}));var r;return function(i){i.method="workspace/inlayHint/refresh",i.messageDirection=t.MessageDirection.serverToClient,i.type=new t.ProtocolRequestType0(i.method)}(r||(di.InlayHintRefreshRequest=r={})),di}var zn={},Ik;function F8(){if(Ik)return zn;Ik=1,Object.defineProperty(zn,"__esModule",{value:!0}),zn.DiagnosticRefreshRequest=zn.WorkspaceDiagnosticRequest=zn.DocumentDiagnosticRequest=zn.DocumentDiagnosticReportKind=zn.DiagnosticServerCancellationData=void 0;const t=Fs(),e=fw(),n=Et();var r;(function(u){function c(l){const d=l;return d&&e.boolean(d.retriggerRequest)}u.is=c})(r||(zn.DiagnosticServerCancellationData=r={}));var i;(function(u){u.Full="full",u.Unchanged="unchanged"})(i||(zn.DocumentDiagnosticReportKind=i={}));var s;(function(u){u.method="textDocument/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new t.ProgressType})(s||(zn.DocumentDiagnosticRequest=s={}));var a;(function(u){u.method="workspace/diagnostic",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method),u.partialResult=new t.ProgressType})(a||(zn.WorkspaceDiagnosticRequest=a={}));var o;return function(u){u.method="workspace/diagnostic/refresh",u.messageDirection=n.MessageDirection.serverToClient,u.type=new n.ProtocolRequestType0(u.method)}(o||(zn.DiagnosticRefreshRequest=o={})),zn}var Rt={},Nk;function L8(){if(Nk)return Rt;Nk=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.DidCloseNotebookDocumentNotification=Rt.DidSaveNotebookDocumentNotification=Rt.DidChangeNotebookDocumentNotification=Rt.NotebookCellArrayChange=Rt.DidOpenNotebookDocumentNotification=Rt.NotebookDocumentSyncRegistrationType=Rt.NotebookDocument=Rt.NotebookCell=Rt.ExecutionSummary=Rt.NotebookCellKind=void 0;const t=lw(),e=fw(),n=Et();var r;(function(p){p.Markup=1,p.Code=2;function h(y){return y===1||y===2}p.is=h})(r||(Rt.NotebookCellKind=r={}));var i;(function(p){function h(w,E){const $={executionOrder:w};return(E===!0||E===!1)&&($.success=E),$}p.create=h;function y(w){const E=w;return e.objectLiteral(E)&&t.uinteger.is(E.executionOrder)&&(E.success===void 0||e.boolean(E.success))}p.is=y;function b(w,E){return w===E?!0:w==null||E===null||E===void 0?!1:w.executionOrder===E.executionOrder&&w.success===E.success}p.equals=b})(i||(Rt.ExecutionSummary=i={}));var s;(function(p){function h(E,$){return{kind:E,document:$}}p.create=h;function y(E){const $=E;return e.objectLiteral($)&&r.is($.kind)&&t.DocumentUri.is($.document)&&($.metadata===void 0||e.objectLiteral($.metadata))}p.is=y;function b(E,$){const k=new Set;return E.document!==$.document&&k.add("document"),E.kind!==$.kind&&k.add("kind"),E.executionSummary!==$.executionSummary&&k.add("executionSummary"),(E.metadata!==void 0||$.metadata!==void 0)&&!w(E.metadata,$.metadata)&&k.add("metadata"),(E.executionSummary!==void 0||$.executionSummary!==void 0)&&!i.equals(E.executionSummary,$.executionSummary)&&k.add("executionSummary"),k}p.diff=b;function w(E,$){if(E===$)return!0;if(E==null||$===null||$===void 0||typeof E!=typeof $||typeof E!="object")return!1;const k=Array.isArray(E),A=Array.isArray($);if(k!==A)return!1;if(k&&A){if(E.length!==$.length)return!1;for(let I=0;I<E.length;I++)if(!w(E[I],$[I]))return!1}if(e.objectLiteral(E)&&e.objectLiteral($)){const I=Object.keys(E),M=Object.keys($);if(I.length!==M.length||(I.sort(),M.sort(),!w(I,M)))return!1;for(let Y=0;Y<I.length;Y++){const Q=I[Y];if(!w(E[Q],$[Q]))return!1}}return!0}})(s||(Rt.NotebookCell=s={}));var a;(function(p){function h(b,w,E,$){return{uri:b,notebookType:w,version:E,cells:$}}p.create=h;function y(b){const w=b;return e.objectLiteral(w)&&e.string(w.uri)&&t.integer.is(w.version)&&e.typedArray(w.cells,s.is)}p.is=y})(a||(Rt.NotebookDocument=a={}));var o;(function(p){p.method="notebookDocument/sync",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.RegistrationType(p.method)})(o||(Rt.NotebookDocumentSyncRegistrationType=o={}));var u;(function(p){p.method="notebookDocument/didOpen",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=o.method})(u||(Rt.DidOpenNotebookDocumentNotification=u={}));var c;(function(p){function h(b){const w=b;return e.objectLiteral(w)&&t.uinteger.is(w.start)&&t.uinteger.is(w.deleteCount)&&(w.cells===void 0||e.typedArray(w.cells,s.is))}p.is=h;function y(b,w,E){const $={start:b,deleteCount:w};return E!==void 0&&($.cells=E),$}p.create=y})(c||(Rt.NotebookCellArrayChange=c={}));var l;(function(p){p.method="notebookDocument/didChange",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=o.method})(l||(Rt.DidChangeNotebookDocumentNotification=l={}));var d;(function(p){p.method="notebookDocument/didSave",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=o.method})(d||(Rt.DidSaveNotebookDocumentNotification=d={}));var f;return function(p){p.method="notebookDocument/didClose",p.messageDirection=n.MessageDirection.clientToServer,p.type=new n.ProtocolNotificationType(p.method),p.registrationMethod=o.method}(f||(Rt.DidCloseNotebookDocumentNotification=f={})),Rt}var ac={},Ok;function M8(){if(Ok)return ac;Ok=1,Object.defineProperty(ac,"__esModule",{value:!0}),ac.InlineCompletionRequest=void 0;const t=Et();var e;return function(n){n.method="textDocument/inlineCompletion",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(ac.InlineCompletionRequest=e={})),ac}var Fk;function z8(){return Fk||(Fk=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceSymbolRequest=t.CodeActionResolveRequest=t.CodeActionRequest=t.DocumentSymbolRequest=t.DocumentHighlightRequest=t.ReferencesRequest=t.DefinitionRequest=t.SignatureHelpRequest=t.SignatureHelpTriggerKind=t.HoverRequest=t.CompletionResolveRequest=t.CompletionRequest=t.CompletionTriggerKind=t.PublishDiagnosticsNotification=t.WatchKind=t.RelativePattern=t.FileChangeType=t.DidChangeWatchedFilesNotification=t.WillSaveTextDocumentWaitUntilRequest=t.WillSaveTextDocumentNotification=t.TextDocumentSaveReason=t.DidSaveTextDocumentNotification=t.DidCloseTextDocumentNotification=t.DidChangeTextDocumentNotification=t.TextDocumentContentChangeEvent=t.DidOpenTextDocumentNotification=t.TextDocumentSyncKind=t.TelemetryEventNotification=t.LogMessageNotification=t.ShowMessageRequest=t.ShowMessageNotification=t.MessageType=t.DidChangeConfigurationNotification=t.ExitNotification=t.ShutdownRequest=t.InitializedNotification=t.InitializeErrorCodes=t.InitializeRequest=t.WorkDoneProgressOptions=t.TextDocumentRegistrationOptions=t.StaticRegistrationOptions=t.PositionEncodingKind=t.FailureHandlingKind=t.ResourceOperationKind=t.UnregistrationRequest=t.RegistrationRequest=t.DocumentSelector=t.NotebookCellTextDocumentFilter=t.NotebookDocumentFilter=t.TextDocumentFilter=void 0,t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.WillRenameFilesRequest=t.DidRenameFilesNotification=t.WillCreateFilesRequest=t.DidCreateFilesNotification=t.FileOperationPatternKind=t.LinkedEditingRangeRequest=t.ShowDocumentRequest=t.SemanticTokensRegistrationType=t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.TokenFormat=t.CallHierarchyPrepareRequest=t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=t.SelectionRangeRequest=t.DeclarationRequest=t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=t.ColorPresentationRequest=t.DocumentColorRequest=t.ConfigurationRequest=t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=t.TypeDefinitionRequest=t.ImplementationRequest=t.ApplyWorkspaceEditRequest=t.ExecuteCommandRequest=t.PrepareRenameRequest=t.RenameRequest=t.PrepareSupportDefaultBehavior=t.DocumentOnTypeFormattingRequest=t.DocumentRangesFormattingRequest=t.DocumentRangeFormattingRequest=t.DocumentFormattingRequest=t.DocumentLinkResolveRequest=t.DocumentLinkRequest=t.CodeLensRefreshRequest=t.CodeLensResolveRequest=t.CodeLensRequest=t.WorkspaceSymbolResolveRequest=void 0,t.InlineCompletionRequest=t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=t.InlineValueRefreshRequest=t.InlineValueRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchySubtypesRequest=t.TypeHierarchyPrepareRequest=void 0;const e=Et(),n=lw(),r=fw(),i=w8();Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const s=v8();Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return s.TypeDefinitionRequest}});const a=b8();Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return a.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return a.DidChangeWorkspaceFoldersNotification}});const o=D8();Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return o.ConfigurationRequest}});const u=E8();Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return u.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return u.ColorPresentationRequest}});const c=R8();Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return c.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return c.FoldingRangeRefreshRequest}});const l=$8();Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return l.DeclarationRequest}});const d=S8();Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return d.SelectionRangeRequest}});const f=T8();Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return f.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return f.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return f.WorkDoneProgressCancelNotification}});const p=k8();Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return p.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return p.CallHierarchyPrepareRequest}});const h=C8();Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return h.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return h.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return h.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return h.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return h.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return h.SemanticTokensRegistrationType}});const y=A8();Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return y.ShowDocumentRequest}});const b=_8();Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return b.LinkedEditingRangeRequest}});const w=P8();Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return w.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return w.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return w.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return w.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return w.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return w.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return w.WillDeleteFilesRequest}});const E=x8();Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return E.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return E.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return E.MonikerRequest}});const $=I8();Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return $.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return $.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return $.TypeHierarchySupertypesRequest}});const k=N8();Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return k.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return k.InlineValueRefreshRequest}});const A=O8();Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return A.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return A.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return A.InlayHintRefreshRequest}});const I=F8();Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return I.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return I.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return I.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return I.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return I.DiagnosticRefreshRequest}});const M=L8();Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return M.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return M.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return M.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return M.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return M.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return M.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return M.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return M.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return M.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return M.DidCloseNotebookDocumentNotification}});const Y=M8();Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return Y.InlineCompletionRequest}});var Q;(function(m){function S(g){const P=g;return r.string(P)||r.string(P.language)||r.string(P.scheme)||r.string(P.pattern)}m.is=S})(Q||(t.TextDocumentFilter=Q={}));var ae;(function(m){function S(g){const P=g;return r.objectLiteral(P)&&(r.string(P.notebookType)||r.string(P.scheme)||r.string(P.pattern))}m.is=S})(ae||(t.NotebookDocumentFilter=ae={}));var O;(function(m){function S(g){const P=g;return r.objectLiteral(P)&&(r.string(P.notebook)||ae.is(P.notebook))&&(P.language===void 0||r.string(P.language))}m.is=S})(O||(t.NotebookCellTextDocumentFilter=O={}));var T;(function(m){function S(g){if(!Array.isArray(g))return!1;for(let P of g)if(!r.string(P)&&!Q.is(P)&&!O.is(P))return!1;return!0}m.is=S})(T||(t.DocumentSelector=T={}));var R;(function(m){m.method="client/registerCapability",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType(m.method)})(R||(t.RegistrationRequest=R={}));var F;(function(m){m.method="client/unregisterCapability",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType(m.method)})(F||(t.UnregistrationRequest=F={}));var V;(function(m){m.Create="create",m.Rename="rename",m.Delete="delete"})(V||(t.ResourceOperationKind=V={}));var W;(function(m){m.Abort="abort",m.Transactional="transactional",m.TextOnlyTransactional="textOnlyTransactional",m.Undo="undo"})(W||(t.FailureHandlingKind=W={}));var H;(function(m){m.UTF8="utf-8",m.UTF16="utf-16",m.UTF32="utf-32"})(H||(t.PositionEncodingKind=H={}));var Ee;(function(m){function S(g){const P=g;return P&&r.string(P.id)&&P.id.length>0}m.hasId=S})(Ee||(t.StaticRegistrationOptions=Ee={}));var te;(function(m){function S(g){const P=g;return P&&(P.documentSelector===null||T.is(P.documentSelector))}m.is=S})(te||(t.TextDocumentRegistrationOptions=te={}));var C;(function(m){function S(P){const D=P;return r.objectLiteral(D)&&(D.workDoneProgress===void 0||r.boolean(D.workDoneProgress))}m.is=S;function g(P){const D=P;return D&&r.boolean(D.workDoneProgress)}m.hasWorkDoneProgress=g})(C||(t.WorkDoneProgressOptions=C={}));var me;(function(m){m.method="initialize",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(me||(t.InitializeRequest=me={}));var ke;(function(m){m.unknownProtocolVersion=1})(ke||(t.InitializeErrorCodes=ke={}));var at;(function(m){m.method="initialized",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(at||(t.InitializedNotification=at={}));var j;(function(m){m.method="shutdown",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType0(m.method)})(j||(t.ShutdownRequest=j={}));var K;(function(m){m.method="exit",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType0(m.method)})(K||(t.ExitNotification=K={}));var Fe;(function(m){m.method="workspace/didChangeConfiguration",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(Fe||(t.DidChangeConfigurationNotification=Fe={}));var ue;(function(m){m.Error=1,m.Warning=2,m.Info=3,m.Log=4,m.Debug=5})(ue||(t.MessageType=ue={}));var be;(function(m){m.method="window/showMessage",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(be||(t.ShowMessageNotification=be={}));var Ce;(function(m){m.method="window/showMessageRequest",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType(m.method)})(Ce||(t.ShowMessageRequest=Ce={}));var ce;(function(m){m.method="window/logMessage",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(ce||(t.LogMessageNotification=ce={}));var x;(function(m){m.method="telemetry/event",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(x||(t.TelemetryEventNotification=x={}));var B;(function(m){m.None=0,m.Full=1,m.Incremental=2})(B||(t.TextDocumentSyncKind=B={}));var de;(function(m){m.method="textDocument/didOpen",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(de||(t.DidOpenTextDocumentNotification=de={}));var q;(function(m){function S(P){let D=P;return D!=null&&typeof D.text=="string"&&D.range!==void 0&&(D.rangeLength===void 0||typeof D.rangeLength=="number")}m.isIncremental=S;function g(P){let D=P;return D!=null&&typeof D.text=="string"&&D.range===void 0&&D.rangeLength===void 0}m.isFull=g})(q||(t.TextDocumentContentChangeEvent=q={}));var le;(function(m){m.method="textDocument/didChange",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(le||(t.DidChangeTextDocumentNotification=le={}));var Ge;(function(m){m.method="textDocument/didClose",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(Ge||(t.DidCloseTextDocumentNotification=Ge={}));var et;(function(m){m.method="textDocument/didSave",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(et||(t.DidSaveTextDocumentNotification=et={}));var oe;(function(m){m.Manual=1,m.AfterDelay=2,m.FocusOut=3})(oe||(t.TextDocumentSaveReason=oe={}));var xe;(function(m){m.method="textDocument/willSave",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(xe||(t.WillSaveTextDocumentNotification=xe={}));var ne;(function(m){m.method="textDocument/willSaveWaitUntil",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ne||(t.WillSaveTextDocumentWaitUntilRequest=ne={}));var De;(function(m){m.method="workspace/didChangeWatchedFiles",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolNotificationType(m.method)})(De||(t.DidChangeWatchedFilesNotification=De={}));var ze;(function(m){m.Created=1,m.Changed=2,m.Deleted=3})(ze||(t.FileChangeType=ze={}));var ht;(function(m){function S(g){const P=g;return r.objectLiteral(P)&&(n.URI.is(P.baseUri)||n.WorkspaceFolder.is(P.baseUri))&&r.string(P.pattern)}m.is=S})(ht||(t.RelativePattern=ht={}));var Ye;(function(m){m.Create=1,m.Change=2,m.Delete=4})(Ye||(t.WatchKind=Ye={}));var qt;(function(m){m.method="textDocument/publishDiagnostics",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolNotificationType(m.method)})(qt||(t.PublishDiagnosticsNotification=qt={}));var Wt;(function(m){m.Invoked=1,m.TriggerCharacter=2,m.TriggerForIncompleteCompletions=3})(Wt||(t.CompletionTriggerKind=Wt={}));var dn;(function(m){m.method="textDocument/completion",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(dn||(t.CompletionRequest=dn={}));var X;(function(m){m.method="completionItem/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(X||(t.CompletionResolveRequest=X={}));var J;(function(m){m.method="textDocument/hover",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(J||(t.HoverRequest=J={}));var fe;(function(m){m.Invoked=1,m.TriggerCharacter=2,m.ContentChange=3})(fe||(t.SignatureHelpTriggerKind=fe={}));var Ht;(function(m){m.method="textDocument/signatureHelp",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Ht||(t.SignatureHelpRequest=Ht={}));var Gt;(function(m){m.method="textDocument/definition",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Gt||(t.DefinitionRequest=Gt={}));var Dr;(function(m){m.method="textDocument/references",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Dr||(t.ReferencesRequest=Dr={}));var Di;(function(m){m.method="textDocument/documentHighlight",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Di||(t.DocumentHighlightRequest=Di={}));var ns;(function(m){m.method="textDocument/documentSymbol",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ns||(t.DocumentSymbolRequest=ns={}));var rs;(function(m){m.method="textDocument/codeAction",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(rs||(t.CodeActionRequest=rs={}));var is;(function(m){m.method="codeAction/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(is||(t.CodeActionResolveRequest=is={}));var ss;(function(m){m.method="workspace/symbol",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ss||(t.WorkspaceSymbolRequest=ss={}));var Ei;(function(m){m.method="workspaceSymbol/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Ei||(t.WorkspaceSymbolResolveRequest=Ei={}));var Ri;(function(m){m.method="textDocument/codeLens",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Ri||(t.CodeLensRequest=Ri={}));var $n;(function(m){m.method="codeLens/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})($n||(t.CodeLensResolveRequest=$n={}));var as;(function(m){m.method="workspace/codeLens/refresh",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType0(m.method)})(as||(t.CodeLensRefreshRequest=as={}));var os;(function(m){m.method="textDocument/documentLink",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(os||(t.DocumentLinkRequest=os={}));var Er;(function(m){m.method="documentLink/resolve",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Er||(t.DocumentLinkResolveRequest=Er={}));var us;(function(m){m.method="textDocument/formatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(us||(t.DocumentFormattingRequest=us={}));var Ur;(function(m){m.method="textDocument/rangeFormatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(Ur||(t.DocumentRangeFormattingRequest=Ur={}));var cs;(function(m){m.method="textDocument/rangesFormatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(cs||(t.DocumentRangesFormattingRequest=cs={}));var jn;(function(m){m.method="textDocument/onTypeFormatting",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(jn||(t.DocumentOnTypeFormattingRequest=jn={}));var sr;(function(m){m.Identifier=1})(sr||(t.PrepareSupportDefaultBehavior=sr={}));var ba;(function(m){m.method="textDocument/rename",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(ba||(t.RenameRequest=ba={}));var L;(function(m){m.method="textDocument/prepareRename",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(L||(t.PrepareRenameRequest=L={}));var v;(function(m){m.method="workspace/executeCommand",m.messageDirection=e.MessageDirection.clientToServer,m.type=new e.ProtocolRequestType(m.method)})(v||(t.ExecuteCommandRequest=v={}));var _;(function(m){m.method="workspace/applyEdit",m.messageDirection=e.MessageDirection.serverToClient,m.type=new e.ProtocolRequestType("workspace/applyEdit")})(_||(t.ApplyWorkspaceEditRequest=_={}))}(dw)),dw}var oc={},Lk;function B8(){if(Lk)return oc;Lk=1,Object.defineProperty(oc,"__esModule",{value:!0}),oc.createProtocolConnection=void 0;const t=Fs();function e(n,r,i,s){return t.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,t.createMessageConnection)(n,r,i,s)}return oc.createProtocolConnection=e,oc}var Mk;function q8(){return Mk||(Mk=1,function(t){var e=Ls&&Ls.__createBinding||(Object.create?function(s,a,o,u){u===void 0&&(u=o);var c=Object.getOwnPropertyDescriptor(a,o);(!c||("get"in c?!a.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return a[o]}}),Object.defineProperty(s,u,c)}:function(s,a,o,u){u===void 0&&(u=o),s[u]=a[o]}),n=Ls&&Ls.__exportStar||function(s,a){for(var o in s)o!=="default"&&!Object.prototype.hasOwnProperty.call(a,o)&&e(a,s,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,n(Fs(),t),n(lw(),t),n(Et(),t),n(z8(),t);var r=B8();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:function(){return r.createProtocolConnection}});var i;(function(s){s.lspReservedErrorRangeStart=-32899,s.RequestFailed=-32803,s.ServerCancelled=-32802,s.ContentModified=-32801,s.RequestCancelled=-32800,s.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}(Ls)),Ls}var zk;function _t(){return zk||(zk=1,function(t){var e=Is&&Is.__createBinding||(Object.create?function(s,a,o,u){u===void 0&&(u=o);var c=Object.getOwnPropertyDescriptor(a,o);(!c||("get"in c?!a.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return a[o]}}),Object.defineProperty(s,u,c)}:function(s,a,o,u){u===void 0&&(u=o),s[u]=a[o]}),n=Is&&Is.__exportStar||function(s,a){for(var o in s)o!=="default"&&!Object.prototype.hasOwnProperty.call(a,o)&&e(a,s,o)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const r=dk();n(dk(),t),n(q8(),t);function i(s,a,o,u){return(0,r.createMessageConnection)(s,a,o,u)}t.createProtocolConnection=i}(Is)),Is}var Bn={},Bk;function qk(){if(Bk)return Bn;Bk=1,Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.generateUuid=Bn.parse=Bn.isUUID=Bn.v4=Bn.empty=void 0;class t{constructor(u){this._value=u}asHex(){return this._value}equals(u){return this.asHex()===u.asHex()}}class e extends t{static _oneOf(u){return u[Math.floor(u.length*Math.random())]}static _randomHex(){return e._oneOf(e._chars)}constructor(){super([e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),"-",e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),"-","4",e._randomHex(),e._randomHex(),e._randomHex(),"-",e._oneOf(e._timeHighBits),e._randomHex(),e._randomHex(),e._randomHex(),"-",e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex()].join(""))}}e._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"],e._timeHighBits=["8","9","a","b"],Bn.empty=new t("00000000-0000-0000-0000-000000000000");function n(){return new e}Bn.v4=n;const r=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function i(o){return r.test(o)}Bn.isUUID=i;function s(o){if(!i(o))throw new Error("invalid uuid");return new t(o)}Bn.parse=s;function a(){return n().asHex()}return Bn.generateUuid=a,Bn}var fi={},Gk;function G8(){if(Gk)return fi;Gk=1,Object.defineProperty(fi,"__esModule",{value:!0}),fi.attachPartialResult=fi.ProgressFeature=fi.attachWorkDone=void 0;const t=_t(),e=qk();class n{constructor(f,p){this._connection=f,this._token=p,n.Instances.set(this._token,this)}begin(f,p,h,y){let b={kind:"begin",title:f,percentage:p,message:h,cancellable:y};this._connection.sendProgress(t.WorkDoneProgress.type,this._token,b)}report(f,p){let h={kind:"report"};typeof f=="number"?(h.percentage=f,p!==void 0&&(h.message=p)):h.message=f,this._connection.sendProgress(t.WorkDoneProgress.type,this._token,h)}done(){n.Instances.delete(this._token),this._connection.sendProgress(t.WorkDoneProgress.type,this._token,{kind:"end"})}}n.Instances=new Map;class r extends n{constructor(f,p){super(f,p),this._source=new t.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}}class i{constructor(){}begin(){}report(){}done(){}}class s extends i{constructor(){super(),this._source=new t.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}}function a(d,f){if(f===void 0||f.workDoneToken===void 0)return new i;const p=f.workDoneToken;return delete f.workDoneToken,new n(d,p)}fi.attachWorkDone=a;const o=d=>class extends d{constructor(){super(),this._progressSupported=!1}initialize(f){super.initialize(f),f?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(t.WorkDoneProgressCancelNotification.type,p=>{let h=n.Instances.get(p.token);(h instanceof r||h instanceof s)&&h.cancel()}))}attachWorkDoneProgress(f){return f===void 0?new i:new n(this.connection,f)}createWorkDoneProgress(){if(this._progressSupported){const f=(0,e.generateUuid)();return this.connection.sendRequest(t.WorkDoneProgressCreateRequest.type,{token:f}).then(()=>new r(this.connection,f))}else return Promise.resolve(new s)}};fi.ProgressFeature=o;var u;(function(d){d.type=new t.ProgressType})(u||(u={}));class c{constructor(f,p){this._connection=f,this._token=p}report(f){this._connection.sendProgress(u.type,this._token,f)}}function l(d,f){if(f===void 0||f.partialResultToken===void 0)return;const p=f.partialResultToken;return delete f.partialResultToken,new c(d,p)}return fi.attachPartialResult=l,fi}var uc={},jk;function j8(){if(jk)return uc;jk=1,Object.defineProperty(uc,"__esModule",{value:!0}),uc.ConfigurationFeature=void 0;const t=_t(),e=sw(),n=r=>class extends r{getConfiguration(i){return i?e.string(i)?this._getConfiguration({section:i}):this._getConfiguration(i):this._getConfiguration({})}_getConfiguration(i){let s={items:Array.isArray(i)?i:[i]};return this.connection.sendRequest(t.ConfigurationRequest.type,s).then(a=>Array.isArray(a)?Array.isArray(i)?a:a[0]:Array.isArray(i)?[]:null)}};return uc.ConfigurationFeature=n,uc}var cc={},Uk;function U8(){if(Uk)return cc;Uk=1,Object.defineProperty(cc,"__esModule",{value:!0}),cc.WorkspaceFoldersFeature=void 0;const t=_t(),e=n=>class extends n{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(r){super.initialize(r);let i=r.workspace;i&&i.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new t.Emitter,this.connection.onNotification(t.DidChangeWorkspaceFoldersNotification.type,s=>{this._onDidChangeWorkspaceFolders.fire(s.event)}))}fillServerCapabilities(r){super.fillServerCapabilities(r);const i=r.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=i===!0||typeof i=="string"}getWorkspaceFolders(){return this.connection.sendRequest(t.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(t.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};return cc.WorkspaceFoldersFeature=e,cc}var lc={},Wk;function W8(){if(Wk)return lc;Wk=1,Object.defineProperty(lc,"__esModule",{value:!0}),lc.CallHierarchyFeature=void 0;const t=_t(),e=n=>class extends n{get callHierarchy(){return{onPrepare:r=>this.connection.onRequest(t.CallHierarchyPrepareRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),void 0)),onIncomingCalls:r=>{const i=t.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(i,(s,a)=>r(s,a,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))},onOutgoingCalls:r=>{const i=t.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(i,(s,a)=>r(s,a,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return lc.CallHierarchyFeature=e,lc}var pi={},Hk;function Vk(){if(Hk)return pi;Hk=1,Object.defineProperty(pi,"__esModule",{value:!0}),pi.SemanticTokensBuilder=pi.SemanticTokensDiff=pi.SemanticTokensFeature=void 0;const t=_t(),e=i=>class extends i{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(t.SemanticTokensRefreshRequest.type),on:s=>{const a=t.SemanticTokensRequest.type;return this.connection.onRequest(a,(o,u)=>s(o,u,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(a,o)))},onDelta:s=>{const a=t.SemanticTokensDeltaRequest.type;return this.connection.onRequest(a,(o,u)=>s(o,u,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(a,o)))},onRange:s=>{const a=t.SemanticTokensRangeRequest.type;return this.connection.onRequest(a,(o,u)=>s(o,u,this.attachWorkDoneProgress(o),this.attachPartialResultProgress(a,o)))}}}};pi.SemanticTokensFeature=e;class n{constructor(s,a){this.originalSequence=s,this.modifiedSequence=a}computeDiff(){const s=this.originalSequence.length,a=this.modifiedSequence.length;let o=0;for(;o<a&&o<s&&this.originalSequence[o]===this.modifiedSequence[o];)o++;if(o<a&&o<s){let u=s-1,c=a-1;for(;u>=o&&c>=o&&this.originalSequence[u]===this.modifiedSequence[c];)u--,c--;(u<o||c<o)&&(u++,c++);const l=u-o+1,d=this.modifiedSequence.slice(o,c+1);return d.length===1&&d[0]===this.originalSequence[u]?[{start:o,deleteCount:l-1}]:[{start:o,deleteCount:l,data:d}]}else return o<a?[{start:o,deleteCount:0,data:this.modifiedSequence.slice(o)}]:o<s?[{start:o,deleteCount:s-o}]:[]}}pi.SemanticTokensDiff=n;class r{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(s,a,o,u,c){let l=s,d=a;this._dataLen>0&&(l-=this._prevLine,l===0&&(d-=this._prevChar)),this._data[this._dataLen++]=l,this._data[this._dataLen++]=d,this._data[this._dataLen++]=o,this._data[this._dataLen++]=u,this._data[this._dataLen++]=c,this._prevLine=s,this._prevChar=a}get id(){return this._id.toString()}previousResult(s){this.id===s&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new n(this._prevData,this._data).computeDiff()}:this.build()}}return pi.SemanticTokensBuilder=r,pi}var dc={},Kk;function H8(){if(Kk)return dc;Kk=1,Object.defineProperty(dc,"__esModule",{value:!0}),dc.ShowDocumentFeature=void 0;const t=_t(),e=n=>class extends n{showDocument(r){return this.connection.sendRequest(t.ShowDocumentRequest.type,r)}};return dc.ShowDocumentFeature=e,dc}var fc={},Yk;function V8(){if(Yk)return fc;Yk=1,Object.defineProperty(fc,"__esModule",{value:!0}),fc.FileOperationsFeature=void 0;const t=_t(),e=n=>class extends n{onDidCreateFiles(r){return this.connection.onNotification(t.DidCreateFilesNotification.type,i=>{r(i)})}onDidRenameFiles(r){return this.connection.onNotification(t.DidRenameFilesNotification.type,i=>{r(i)})}onDidDeleteFiles(r){return this.connection.onNotification(t.DidDeleteFilesNotification.type,i=>{r(i)})}onWillCreateFiles(r){return this.connection.onRequest(t.WillCreateFilesRequest.type,(i,s)=>r(i,s))}onWillRenameFiles(r){return this.connection.onRequest(t.WillRenameFilesRequest.type,(i,s)=>r(i,s))}onWillDeleteFiles(r){return this.connection.onRequest(t.WillDeleteFilesRequest.type,(i,s)=>r(i,s))}};return fc.FileOperationsFeature=e,fc}var pc={},Xk;function K8(){if(Xk)return pc;Xk=1,Object.defineProperty(pc,"__esModule",{value:!0}),pc.LinkedEditingRangeFeature=void 0;const t=_t(),e=n=>class extends n{onLinkedEditingRange(r){return this.connection.onRequest(t.LinkedEditingRangeRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),void 0))}};return pc.LinkedEditingRangeFeature=e,pc}var hc={},Jk;function Y8(){if(Jk)return hc;Jk=1,Object.defineProperty(hc,"__esModule",{value:!0}),hc.TypeHierarchyFeature=void 0;const t=_t(),e=n=>class extends n{get typeHierarchy(){return{onPrepare:r=>this.connection.onRequest(t.TypeHierarchyPrepareRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),void 0)),onSupertypes:r=>{const i=t.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(i,(s,a)=>r(s,a,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))},onSubtypes:r=>{const i=t.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(i,(s,a)=>r(s,a,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return hc.TypeHierarchyFeature=e,hc}var mc={},Qk;function X8(){if(Qk)return mc;Qk=1,Object.defineProperty(mc,"__esModule",{value:!0}),mc.InlineValueFeature=void 0;const t=_t(),e=n=>class extends n{get inlineValue(){return{refresh:()=>this.connection.sendRequest(t.InlineValueRefreshRequest.type),on:r=>this.connection.onRequest(t.InlineValueRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i)))}}};return mc.InlineValueFeature=e,mc}var gc={},Zk;function J8(){if(Zk)return gc;Zk=1,Object.defineProperty(gc,"__esModule",{value:!0}),gc.FoldingRangeFeature=void 0;const t=_t(),e=n=>class extends n{get foldingRange(){return{refresh:()=>this.connection.sendRequest(t.FoldingRangeRefreshRequest.type),on:r=>{const i=t.FoldingRangeRequest.type;return this.connection.onRequest(i,(s,a)=>r(s,a,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return gc.FoldingRangeFeature=e,gc}var yc={},eC;function Q8(){if(eC)return yc;eC=1,Object.defineProperty(yc,"__esModule",{value:!0}),yc.InlayHintFeature=void 0;const t=_t(),e=n=>class extends n{get inlayHint(){return{refresh:()=>this.connection.sendRequest(t.InlayHintRefreshRequest.type),on:r=>this.connection.onRequest(t.InlayHintRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i))),resolve:r=>this.connection.onRequest(t.InlayHintResolveRequest.type,(i,s)=>r(i,s))}}};return yc.InlayHintFeature=e,yc}var wc={},tC;function Z8(){if(tC)return wc;tC=1,Object.defineProperty(wc,"__esModule",{value:!0}),wc.DiagnosticFeature=void 0;const t=_t(),e=n=>class extends n{get diagnostics(){return{refresh:()=>this.connection.sendRequest(t.DiagnosticRefreshRequest.type),on:r=>this.connection.onRequest(t.DocumentDiagnosticRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t.DocumentDiagnosticRequest.partialResult,i))),onWorkspace:r=>this.connection.onRequest(t.WorkspaceDiagnosticRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t.WorkspaceDiagnosticRequest.partialResult,i)))}}};return wc.DiagnosticFeature=e,wc}var Gs={},vc={},nC;function rC(){if(nC)return vc;nC=1,Object.defineProperty(vc,"__esModule",{value:!0}),vc.TextDocuments=void 0;const t=_t();class e{constructor(r){this._configuration=r,this._syncedDocuments=new Map,this._onDidChangeContent=new t.Emitter,this._onDidOpen=new t.Emitter,this._onDidClose=new t.Emitter,this._onDidSave=new t.Emitter,this._onWillSave=new t.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(r){this._willSaveWaitUntil=r}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(r){return this._syncedDocuments.get(r)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(r){r.__textDocumentSync=t.TextDocumentSyncKind.Incremental;const i=[];return i.push(r.onDidOpenTextDocument(s=>{const a=s.textDocument,o=this._configuration.create(a.uri,a.languageId,a.version,a.text);this._syncedDocuments.set(a.uri,o);const u=Object.freeze({document:o});this._onDidOpen.fire(u),this._onDidChangeContent.fire(u)})),i.push(r.onDidChangeTextDocument(s=>{const a=s.textDocument,o=s.contentChanges;if(o.length===0)return;const{version:u}=a;if(u==null)throw new Error(`Received document change event for ${a.uri} without valid version identifier`);let c=this._syncedDocuments.get(a.uri);c!==void 0&&(c=this._configuration.update(c,o,u),this._syncedDocuments.set(a.uri,c),this._onDidChangeContent.fire(Object.freeze({document:c})))})),i.push(r.onDidCloseTextDocument(s=>{let a=this._syncedDocuments.get(s.textDocument.uri);a!==void 0&&(this._syncedDocuments.delete(s.textDocument.uri),this._onDidClose.fire(Object.freeze({document:a})))})),i.push(r.onWillSaveTextDocument(s=>{let a=this._syncedDocuments.get(s.textDocument.uri);a!==void 0&&this._onWillSave.fire(Object.freeze({document:a,reason:s.reason}))})),i.push(r.onWillSaveTextDocumentWaitUntil((s,a)=>{let o=this._syncedDocuments.get(s.textDocument.uri);return o!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:o,reason:s.reason}),a):[]})),i.push(r.onDidSaveTextDocument(s=>{let a=this._syncedDocuments.get(s.textDocument.uri);a!==void 0&&this._onDidSave.fire(Object.freeze({document:a}))})),t.Disposable.create(()=>{i.forEach(s=>s.dispose())})}}return vc.TextDocuments=e,vc}var iC;function sC(){if(iC)return Gs;iC=1,Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.NotebookDocuments=Gs.NotebookSyncFeature=void 0;const t=_t(),e=rC(),n=s=>class extends s{get synchronization(){return{onDidOpenNotebookDocument:a=>this.connection.onNotification(t.DidOpenNotebookDocumentNotification.type,o=>{a(o)}),onDidChangeNotebookDocument:a=>this.connection.onNotification(t.DidChangeNotebookDocumentNotification.type,o=>{a(o)}),onDidSaveNotebookDocument:a=>this.connection.onNotification(t.DidSaveNotebookDocumentNotification.type,o=>{a(o)}),onDidCloseNotebookDocument:a=>this.connection.onNotification(t.DidCloseNotebookDocumentNotification.type,o=>{a(o)})}}};Gs.NotebookSyncFeature=n;class r{onDidOpenTextDocument(a){return this.openHandler=a,t.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(a){this.openHandler&&this.openHandler(a)}onDidChangeTextDocument(a){return this.changeHandler=a,t.Disposable.create(()=>{this.changeHandler=a})}changeTextDocument(a){this.changeHandler&&this.changeHandler(a)}onDidCloseTextDocument(a){return this.closeHandler=a,t.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(a){this.closeHandler&&this.closeHandler(a)}onWillSaveTextDocument(){return r.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return r.NULL_DISPOSE}onDidSaveTextDocument(){return r.NULL_DISPOSE}}r.NULL_DISPOSE=Object.freeze({dispose:()=>{}});class i{constructor(a){a instanceof e.TextDocuments?this._cellTextDocuments=a:this._cellTextDocuments=new e.TextDocuments(a),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new t.Emitter,this._onDidChange=new t.Emitter,this._onDidSave=new t.Emitter,this._onDidClose=new t.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(a){return this._cellTextDocuments.get(a.document)}getNotebookDocument(a){return this.notebookDocuments.get(a)}getNotebookCell(a){const o=this.notebookCellMap.get(a);return o&&o[0]}findNotebookDocumentForCell(a){const o=typeof a=="string"?a:a.document,u=this.notebookCellMap.get(o);return u&&u[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(a){const o=new r,u=[];return u.push(this.cellTextDocuments.listen(o)),u.push(a.notebooks.synchronization.onDidOpenNotebookDocument(c=>{this.notebookDocuments.set(c.notebookDocument.uri,c.notebookDocument);for(const l of c.cellTextDocuments)o.openTextDocument({textDocument:l});this.updateCellMap(c.notebookDocument),this._onDidOpen.fire(c.notebookDocument)})),u.push(a.notebooks.synchronization.onDidChangeNotebookDocument(c=>{const l=this.notebookDocuments.get(c.notebookDocument.uri);if(l===void 0)return;l.version=c.notebookDocument.version;const d=l.metadata;let f=!1;const p=c.change;p.metadata!==void 0&&(f=!0,l.metadata=p.metadata);const h=[],y=[],b=[],w=[];if(p.cells!==void 0){const I=p.cells;if(I.structure!==void 0){const M=I.structure.array;if(l.cells.splice(M.start,M.deleteCount,...M.cells!==void 0?M.cells:[]),I.structure.didOpen!==void 0)for(const Y of I.structure.didOpen)o.openTextDocument({textDocument:Y}),h.push(Y.uri);if(I.structure.didClose)for(const Y of I.structure.didClose)o.closeTextDocument({textDocument:Y}),y.push(Y.uri)}if(I.data!==void 0){const M=new Map(I.data.map(Y=>[Y.document,Y]));for(let Y=0;Y<=l.cells.length;Y++){const Q=M.get(l.cells[Y].document);if(Q!==void 0){const ae=l.cells.splice(Y,1,Q);if(b.push({old:ae[0],new:Q}),M.delete(Q.document),M.size===0)break}}}if(I.textContent!==void 0)for(const M of I.textContent)o.changeTextDocument({textDocument:M.document,contentChanges:M.changes}),w.push(M.document.uri)}this.updateCellMap(l);const E={notebookDocument:l};f&&(E.metadata={old:d,new:l.metadata});const $=[];for(const I of h)$.push(this.getNotebookCell(I));const k=[];for(const I of y)k.push(this.getNotebookCell(I));const A=[];for(const I of w)A.push(this.getNotebookCell(I));($.length>0||k.length>0||b.length>0||A.length>0)&&(E.cells={added:$,removed:k,changed:{data:b,textContent:A}}),(E.metadata!==void 0||E.cells!==void 0)&&this._onDidChange.fire(E)})),u.push(a.notebooks.synchronization.onDidSaveNotebookDocument(c=>{const l=this.notebookDocuments.get(c.notebookDocument.uri);l!==void 0&&this._onDidSave.fire(l)})),u.push(a.notebooks.synchronization.onDidCloseNotebookDocument(c=>{const l=this.notebookDocuments.get(c.notebookDocument.uri);if(l!==void 0){this._onDidClose.fire(l);for(const d of c.cellTextDocuments)o.closeTextDocument({textDocument:d});this.notebookDocuments.delete(c.notebookDocument.uri);for(const d of l.cells)this.notebookCellMap.delete(d.document)}})),t.Disposable.create(()=>{u.forEach(c=>c.dispose())})}updateCellMap(a){for(const o of a.cells)this.notebookCellMap.set(o.document,[o,a])}}return Gs.NotebookDocuments=i,Gs}var bc={},aC;function eU(){if(aC)return bc;aC=1,Object.defineProperty(bc,"__esModule",{value:!0}),bc.MonikerFeature=void 0;const t=_t(),e=n=>class extends n{get moniker(){return{on:r=>{const i=t.MonikerRequest.type;return this.connection.onRequest(i,(s,a)=>r(s,a,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return bc.MonikerFeature=e,bc}var oC;function uC(){if(oC)return Ke;oC=1,Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.createConnection=Ke.combineFeatures=Ke.combineNotebooksFeatures=Ke.combineLanguagesFeatures=Ke.combineWorkspaceFeatures=Ke.combineWindowFeatures=Ke.combineClientFeatures=Ke.combineTracerFeatures=Ke.combineTelemetryFeatures=Ke.combineConsoleFeatures=Ke._NotebooksImpl=Ke._LanguagesImpl=Ke.BulkUnregistration=Ke.BulkRegistration=Ke.ErrorMessageTracker=void 0;const t=_t(),e=sw(),n=qk(),r=G8(),i=j8(),s=U8(),a=W8(),o=Vk(),u=H8(),c=V8(),l=K8(),d=Y8(),f=X8(),p=J8(),h=Q8(),y=Z8(),b=sC(),w=eU();function E(ce){if(ce!==null)return ce}class ${constructor(){this._messages=Object.create(null)}add(x){let B=this._messages[x];B||(B=0),B++,this._messages[x]=B}sendErrors(x){Object.keys(this._messages).forEach(B=>{x.window.showErrorMessage(B)})}}Ke.ErrorMessageTracker=$;class k{constructor(){}rawAttach(x){this._rawConnection=x}attach(x){this._connection=x}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(x){}initialize(x){}error(x){this.send(t.MessageType.Error,x)}warn(x){this.send(t.MessageType.Warning,x)}info(x){this.send(t.MessageType.Info,x)}log(x){this.send(t.MessageType.Log,x)}debug(x){this.send(t.MessageType.Debug,x)}send(x,B){this._rawConnection&&this._rawConnection.sendNotification(t.LogMessageNotification.type,{type:x,message:B}).catch(()=>{(0,t.RAL)().console.error("Sending log message failed")})}}class A{constructor(){}attach(x){this._connection=x}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(x){}fillServerCapabilities(x){}showErrorMessage(x,...B){let de={type:t.MessageType.Error,message:x,actions:B};return this.connection.sendRequest(t.ShowMessageRequest.type,de).then(E)}showWarningMessage(x,...B){let de={type:t.MessageType.Warning,message:x,actions:B};return this.connection.sendRequest(t.ShowMessageRequest.type,de).then(E)}showInformationMessage(x,...B){let de={type:t.MessageType.Info,message:x,actions:B};return this.connection.sendRequest(t.ShowMessageRequest.type,de).then(E)}}const I=(0,u.ShowDocumentFeature)((0,r.ProgressFeature)(A));var M;(function(ce){function x(){return new Y}ce.create=x})(M||(Ke.BulkRegistration=M={}));class Y{constructor(){this._registrations=[],this._registered=new Set}add(x,B){const de=e.string(x)?x:x.method;if(this._registered.has(de))throw new Error(`${de} is already added to this registration`);const q=n.generateUuid();this._registrations.push({id:q,method:de,registerOptions:B||{}}),this._registered.add(de)}asRegistrationParams(){return{registrations:this._registrations}}}var Q;(function(ce){function x(){return new ae(void 0,[])}ce.create=x})(Q||(Ke.BulkUnregistration=Q={}));class ae{constructor(x,B){this._connection=x,this._unregistrations=new Map,B.forEach(de=>{this._unregistrations.set(de.method,de)})}get isAttached(){return!!this._connection}attach(x){this._connection=x}add(x){this._unregistrations.set(x.method,x)}dispose(){let x=[];for(let de of this._unregistrations.values())x.push(de);let B={unregisterations:x};this._connection.sendRequest(t.UnregistrationRequest.type,B).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(x){const B=e.string(x)?x:x.method,de=this._unregistrations.get(B);if(!de)return!1;let q={unregisterations:[de]};return this._connection.sendRequest(t.UnregistrationRequest.type,q).then(()=>{this._unregistrations.delete(B)},le=>{this._connection.console.info(`Un-registering request handler for ${de.id} failed.`)}),!0}}class O{attach(x){this._connection=x}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(x){}fillServerCapabilities(x){}register(x,B,de){return x instanceof Y?this.registerMany(x):x instanceof ae?this.registerSingle1(x,B,de):this.registerSingle2(x,B)}registerSingle1(x,B,de){const q=e.string(B)?B:B.method,le=n.generateUuid();let Ge={registrations:[{id:le,method:q,registerOptions:de||{}}]};return x.isAttached||x.attach(this.connection),this.connection.sendRequest(t.RegistrationRequest.type,Ge).then(et=>(x.add({id:le,method:q}),x),et=>(this.connection.console.info(`Registering request handler for ${q} failed.`),Promise.reject(et)))}registerSingle2(x,B){const de=e.string(x)?x:x.method,q=n.generateUuid();let le={registrations:[{id:q,method:de,registerOptions:B||{}}]};return this.connection.sendRequest(t.RegistrationRequest.type,le).then(Ge=>t.Disposable.create(()=>{this.unregisterSingle(q,de).catch(()=>{this.connection.console.info(`Un-registering capability with id ${q} failed.`)})}),Ge=>(this.connection.console.info(`Registering request handler for ${de} failed.`),Promise.reject(Ge)))}unregisterSingle(x,B){let de={unregisterations:[{id:x,method:B}]};return this.connection.sendRequest(t.UnregistrationRequest.type,de).catch(()=>{this.connection.console.info(`Un-registering request handler for ${x} failed.`)})}registerMany(x){let B=x.asRegistrationParams();return this.connection.sendRequest(t.RegistrationRequest.type,B).then(()=>new ae(this._connection,B.registrations.map(de=>({id:de.id,method:de.method}))),de=>(this.connection.console.info("Bulk registration failed."),Promise.reject(de)))}}class T{constructor(){}attach(x){this._connection=x}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(x){}fillServerCapabilities(x){}applyEdit(x){function B(q){return q&&!!q.edit}let de=B(x)?x:{edit:x};return this.connection.sendRequest(t.ApplyWorkspaceEditRequest.type,de)}}const R=(0,c.FileOperationsFeature)((0,s.WorkspaceFoldersFeature)((0,i.ConfigurationFeature)(T)));class F{constructor(){this._trace=t.Trace.Off}attach(x){this._connection=x}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(x){}fillServerCapabilities(x){}set trace(x){this._trace=x}log(x,B){this._trace!==t.Trace.Off&&this.connection.sendNotification(t.LogTraceNotification.type,{message:x,verbose:this._trace===t.Trace.Verbose?B:void 0}).catch(()=>{})}}class V{constructor(){}attach(x){this._connection=x}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(x){}fillServerCapabilities(x){}logEvent(x){this.connection.sendNotification(t.TelemetryEventNotification.type,x).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}}class W{constructor(){}attach(x){this._connection=x}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(x){}fillServerCapabilities(x){}attachWorkDoneProgress(x){return(0,r.attachWorkDone)(this.connection,x)}attachPartialResultProgress(x,B){return(0,r.attachPartialResult)(this.connection,B)}}Ke._LanguagesImpl=W;const H=(0,p.FoldingRangeFeature)((0,w.MonikerFeature)((0,y.DiagnosticFeature)((0,h.InlayHintFeature)((0,f.InlineValueFeature)((0,d.TypeHierarchyFeature)((0,l.LinkedEditingRangeFeature)((0,o.SemanticTokensFeature)((0,a.CallHierarchyFeature)(W)))))))));class Ee{constructor(){}attach(x){this._connection=x}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(x){}fillServerCapabilities(x){}attachWorkDoneProgress(x){return(0,r.attachWorkDone)(this.connection,x)}attachPartialResultProgress(x,B){return(0,r.attachPartialResult)(this.connection,B)}}Ke._NotebooksImpl=Ee;const te=(0,b.NotebookSyncFeature)(Ee);function C(ce,x){return function(B){return x(ce(B))}}Ke.combineConsoleFeatures=C;function me(ce,x){return function(B){return x(ce(B))}}Ke.combineTelemetryFeatures=me;function ke(ce,x){return function(B){return x(ce(B))}}Ke.combineTracerFeatures=ke;function at(ce,x){return function(B){return x(ce(B))}}Ke.combineClientFeatures=at;function j(ce,x){return function(B){return x(ce(B))}}Ke.combineWindowFeatures=j;function K(ce,x){return function(B){return x(ce(B))}}Ke.combineWorkspaceFeatures=K;function Fe(ce,x){return function(B){return x(ce(B))}}Ke.combineLanguagesFeatures=Fe;function ue(ce,x){return function(B){return x(ce(B))}}Ke.combineNotebooksFeatures=ue;function be(ce,x){function B(q,le,Ge){return q&&le?Ge(q,le):q||le}return{__brand:"features",console:B(ce.console,x.console,C),tracer:B(ce.tracer,x.tracer,ke),telemetry:B(ce.telemetry,x.telemetry,me),client:B(ce.client,x.client,at),window:B(ce.window,x.window,j),workspace:B(ce.workspace,x.workspace,K),languages:B(ce.languages,x.languages,Fe),notebooks:B(ce.notebooks,x.notebooks,ue)}}Ke.combineFeatures=be;function Ce(ce,x,B){const de=B&&B.console?new(B.console(k)):new k,q=ce(de);de.rawAttach(q);const le=B&&B.tracer?new(B.tracer(F)):new F,Ge=B&&B.telemetry?new(B.telemetry(V)):new V,et=B&&B.client?new(B.client(O)):new O,oe=B&&B.window?new(B.window(I)):new I,xe=B&&B.workspace?new(B.workspace(R)):new R,ne=B&&B.languages?new(B.languages(H)):new H,De=B&&B.notebooks?new(B.notebooks(te)):new te,ze=[de,le,Ge,et,oe,xe,ne,De];function ht(X){return X instanceof Promise?X:e.thenable(X)?new Promise((J,fe)=>{X.then(Ht=>J(Ht),Ht=>fe(Ht))}):Promise.resolve(X)}let Ye,qt,Wt,dn={listen:()=>q.listen(),sendRequest:(X,...J)=>q.sendRequest(e.string(X)?X:X.method,...J),onRequest:(X,J)=>q.onRequest(X,J),sendNotification:(X,J)=>{const fe=e.string(X)?X:X.method;return q.sendNotification(fe,J)},onNotification:(X,J)=>q.onNotification(X,J),onProgress:q.onProgress,sendProgress:q.sendProgress,onInitialize:X=>(qt=X,{dispose:()=>{qt=void 0}}),onInitialized:X=>q.onNotification(t.InitializedNotification.type,X),onShutdown:X=>(Ye=X,{dispose:()=>{Ye=void 0}}),onExit:X=>(Wt=X,{dispose:()=>{Wt=void 0}}),get console(){return de},get telemetry(){return Ge},get tracer(){return le},get client(){return et},get window(){return oe},get workspace(){return xe},get languages(){return ne},get notebooks(){return De},onDidChangeConfiguration:X=>q.onNotification(t.DidChangeConfigurationNotification.type,X),onDidChangeWatchedFiles:X=>q.onNotification(t.DidChangeWatchedFilesNotification.type,X),__textDocumentSync:void 0,onDidOpenTextDocument:X=>q.onNotification(t.DidOpenTextDocumentNotification.type,X),onDidChangeTextDocument:X=>q.onNotification(t.DidChangeTextDocumentNotification.type,X),onDidCloseTextDocument:X=>q.onNotification(t.DidCloseTextDocumentNotification.type,X),onWillSaveTextDocument:X=>q.onNotification(t.WillSaveTextDocumentNotification.type,X),onWillSaveTextDocumentWaitUntil:X=>q.onRequest(t.WillSaveTextDocumentWaitUntilRequest.type,X),onDidSaveTextDocument:X=>q.onNotification(t.DidSaveTextDocumentNotification.type,X),sendDiagnostics:X=>q.sendNotification(t.PublishDiagnosticsNotification.type,X),onHover:X=>q.onRequest(t.HoverRequest.type,(J,fe)=>X(J,fe,(0,r.attachWorkDone)(q,J),void 0)),onCompletion:X=>q.onRequest(t.CompletionRequest.type,(J,fe)=>X(J,fe,(0,r.attachWorkDone)(q,J),(0,r.attachPartialResult)(q,J))),onCompletionResolve:X=>q.onRequest(t.CompletionResolveRequest.type,X),onSignatureHelp:X=>q.onRequest(t.SignatureHelpRequest.type,(J,fe)=>X(J,fe,(0,r.attachWorkDone)(q,J),void 0)),onDeclaration:X=>q.onRequest(t.DeclarationRequest.type,(J,fe)=>X(J,fe,(0,r.attachWorkDone)(q,J),(0,r.attachPartialResult)(q,J))),onDefinition:X=>q.onRequest(t.DefinitionRequest.type,(J,fe)=>X(J,fe,(0,r.attachWorkDone)(q,J),(0,r.attachPartialResult)(q,J))),onTypeDefinition:X=>q.onRequest(t.TypeDefinitionRequest.type,(J,fe)=>X(J,fe,(0,r.attachWorkDone)(q,J),(0,r.attachPartialResult)(q,J))),onImplementation:X=>q.onRequest(t.ImplementationRequest.type,(J,fe)=>X(J,fe,(0,r.attachWorkDone)(q,J),(0,r.attachPartialResult)(q,J))),onReferences:X=>q.onRequest(t.ReferencesRequest.type,(J,fe)=>X(J,fe,(0,r.attachWorkDone)(q,J),(0,r.attachPartialResult)(q,J))),onDocumentHighlight:X=>q.onRequest(t.DocumentHighlightRequest.type,(J,fe)=>X(J,fe,(0,r.attachWorkDone)(q,J),(0,r.attachPartialResult)(q,J))),onDocumentSymbol:X=>q.onRequest(t.DocumentSymbolRequest.type,(J,fe)=>X(J,fe,(0,r.attachWorkDone)(q,J),(0,r.attachPartialResult)(q,J))),onWorkspaceSymbol:X=>q.onRequest(t.WorkspaceSymbolRequest.type,(J,fe)=>X(J,fe,(0,r.attachWorkDone)(q,J),(0,r.attachPartialResult)(q,J))),onWorkspaceSymbolResolve:X=>q.onRequest(t.WorkspaceSymbolResolveRequest.type,X),onCodeAction:X=>q.onRequest(t.CodeActionRequest.type,(J,fe)=>X(J,fe,(0,r.attachWorkDone)(q,J),(0,r.attachPartialResult)(q,J))),onCodeActionResolve:X=>q.onRequest(t.CodeActionResolveRequest.type,(J,fe)=>X(J,fe)),onCodeLens:X=>q.onRequest(t.CodeLensRequest.type,(J,fe)=>X(J,fe,(0,r.attachWorkDone)(q,J),(0,r.attachPartialResult)(q,J))),onCodeLensResolve:X=>q.onRequest(t.CodeLensResolveRequest.type,(J,fe)=>X(J,fe)),onDocumentFormatting:X=>q.onRequest(t.DocumentFormattingRequest.type,(J,fe)=>X(J,fe,(0,r.attachWorkDone)(q,J),void 0)),onDocumentRangeFormatting:X=>q.onRequest(t.DocumentRangeFormattingRequest.type,(J,fe)=>X(J,fe,(0,r.attachWorkDone)(q,J),void 0)),onDocumentOnTypeFormatting:X=>q.onRequest(t.DocumentOnTypeFormattingRequest.type,(J,fe)=>X(J,fe)),onRenameRequest:X=>q.onRequest(t.RenameRequest.type,(J,fe)=>X(J,fe,(0,r.attachWorkDone)(q,J),void 0)),onPrepareRename:X=>q.onRequest(t.PrepareRenameRequest.type,(J,fe)=>X(J,fe)),onDocumentLinks:X=>q.onRequest(t.DocumentLinkRequest.type,(J,fe)=>X(J,fe,(0,r.attachWorkDone)(q,J),(0,r.attachPartialResult)(q,J))),onDocumentLinkResolve:X=>q.onRequest(t.DocumentLinkResolveRequest.type,(J,fe)=>X(J,fe)),onDocumentColor:X=>q.onRequest(t.DocumentColorRequest.type,(J,fe)=>X(J,fe,(0,r.attachWorkDone)(q,J),(0,r.attachPartialResult)(q,J))),onColorPresentation:X=>q.onRequest(t.ColorPresentationRequest.type,(J,fe)=>X(J,fe,(0,r.attachWorkDone)(q,J),(0,r.attachPartialResult)(q,J))),onFoldingRanges:X=>q.onRequest(t.FoldingRangeRequest.type,(J,fe)=>X(J,fe,(0,r.attachWorkDone)(q,J),(0,r.attachPartialResult)(q,J))),onSelectionRanges:X=>q.onRequest(t.SelectionRangeRequest.type,(J,fe)=>X(J,fe,(0,r.attachWorkDone)(q,J),(0,r.attachPartialResult)(q,J))),onExecuteCommand:X=>q.onRequest(t.ExecuteCommandRequest.type,(J,fe)=>X(J,fe,(0,r.attachWorkDone)(q,J),void 0)),dispose:()=>q.dispose()};for(let X of ze)X.attach(dn);return q.onRequest(t.InitializeRequest.type,X=>{x.initialize(X),e.string(X.trace)&&(le.trace=t.Trace.fromString(X.trace));for(let J of ze)J.initialize(X.capabilities);if(qt){let J=qt(X,new t.CancellationTokenSource().token,(0,r.attachWorkDone)(q,X),void 0);return ht(J).then(fe=>{if(fe instanceof t.ResponseError)return fe;let Ht=fe;Ht||(Ht={capabilities:{}});let Gt=Ht.capabilities;Gt||(Gt={},Ht.capabilities=Gt),Gt.textDocumentSync===void 0||Gt.textDocumentSync===null?Gt.textDocumentSync=e.number(dn.__textDocumentSync)?dn.__textDocumentSync:t.TextDocumentSyncKind.None:!e.number(Gt.textDocumentSync)&&!e.number(Gt.textDocumentSync.change)&&(Gt.textDocumentSync.change=e.number(dn.__textDocumentSync)?dn.__textDocumentSync:t.TextDocumentSyncKind.None);for(let Dr of ze)Dr.fillServerCapabilities(Gt);return Ht})}else{let J={capabilities:{textDocumentSync:t.TextDocumentSyncKind.None}};for(let fe of ze)fe.fillServerCapabilities(J.capabilities);return J}}),q.onRequest(t.ShutdownRequest.type,()=>{if(x.shutdownReceived=!0,Ye)return Ye(new t.CancellationTokenSource().token)}),q.onNotification(t.ExitNotification.type,()=>{try{Wt&&Wt()}finally{x.shutdownReceived?x.exit(0):x.exit(1)}}),q.onNotification(t.SetTraceNotification.type,X=>{le.trace=t.Trace.fromString(X.value)}),dn}return Ke.createConnection=Ce,Ke}var bn={},cC;function tU(){if(cC)return bn;cC=1,Object.defineProperty(bn,"__esModule",{value:!0}),bn.resolveModulePath=bn.FileSystem=bn.resolveGlobalYarnPath=bn.resolveGlobalNodePath=bn.resolve=bn.uriToFilePath=void 0;const t=H1,e=$r,n=Ea,r=PD;function i(d){let f=t.parse(d);if(f.protocol!=="file:"||!f.path)return;let p=f.path.split("/");for(var h=0,y=p.length;h<y;h++)p[h]=decodeURIComponent(p[h]);if(process.platform==="win32"&&p.length>1){let b=p[0],w=p[1];b.length===0&&w.length>1&&w[1]===":"&&p.shift()}return e.normalize(p.join("/"))}bn.uriToFilePath=i;function s(){return process.platform==="win32"}function a(d,f,p,h){const y="NODE_PATH",b=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((w,E)=>{let $=process.env,k=Object.create(null);Object.keys($).forEach(A=>k[A]=$[A]),f&&n.existsSync(f)&&(k[y]?k[y]=f+e.delimiter+k[y]:k[y]=f,h&&h(`NODE_PATH value is: ${k[y]}`)),k.ELECTRON_RUN_AS_NODE="1";try{let A=(0,r.fork)("",[],{cwd:p,env:k,execArgv:["-e",b]});if(A.pid===void 0){E(new Error(`Starting process to resolve node module ${d} failed`));return}A.on("error",M=>{E(M)}),A.on("message",M=>{M.c==="r"&&(A.send({c:"e"}),M.s?w(M.r):E(new Error(`Failed to resolve module: ${d}`)))});let I={c:"rs",a:d};A.send(I)}catch(A){E(A)}})}bn.resolve=a;function o(d){let f="npm";const p=Object.create(null);Object.keys(process.env).forEach(b=>p[b]=process.env[b]),p.NO_UPDATE_NOTIFIER="true";const h={encoding:"utf8",env:p};s()&&(f="npm.cmd",h.shell=!0);let y=()=>{};try{process.on("SIGPIPE",y);let b=(0,r.spawnSync)(f,["config","get","prefix"],h).stdout;if(!b){d&&d("'npm config get prefix' didn't return a value.");return}let w=b.trim();return d&&d(`'npm config get prefix' value is: ${w}`),w.length>0?s()?e.join(w,"node_modules"):e.join(w,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",y)}}bn.resolveGlobalNodePath=o;function u(d){let f="yarn",p={encoding:"utf8"};s()&&(f="yarn.cmd",p.shell=!0);let h=()=>{};try{process.on("SIGPIPE",h);let y=(0,r.spawnSync)(f,["global","dir","--json"],p),b=y.stdout;if(!b){d&&(d("'yarn global dir' didn't return a value."),y.stderr&&d(y.stderr));return}let w=b.trim().split(/\r?\n/);for(let E of w)try{let $=JSON.parse(E);if($.type==="log")return e.join($.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",h)}}bn.resolveGlobalYarnPath=u;var c;(function(d){let f;function p(){return f!==void 0||(process.platform==="win32"?f=!1:f=!n.existsSync(__filename.toUpperCase())||!n.existsSync(__filename.toLowerCase())),f}d.isCaseSensitive=p;function h(y,b){return p()?e.normalize(b).indexOf(e.normalize(y))===0:e.normalize(b).toLowerCase().indexOf(e.normalize(y).toLowerCase())===0}d.isParent=h})(c||(bn.FileSystem=c={}));function l(d,f,p,h){return p?(e.isAbsolute(p)||(p=e.join(d,p)),a(f,p,p,h).then(y=>c.isParent(p,y)?y:Promise.reject(new Error(`Failed to load ${f} from node path location.`))).then(void 0,y=>a(f,o(h),d,h))):a(f,o(h),d,h)}return bn.resolveModulePath=l,bn}var pw,lC;function dC(){return lC||(lC=1,pw=_t()),pw}var js={},Dc={},fC;function nU(){if(fC)return Dc;fC=1,Object.defineProperty(Dc,"__esModule",{value:!0}),Dc.InlineCompletionFeature=void 0;const t=_t(),e=n=>class extends n{get inlineCompletion(){return{on:r=>this.connection.onRequest(t.InlineCompletionRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i)))}}};return Dc.InlineCompletionFeature=e,Dc}var pC;function rU(){return pC||(pC=1,function(t){var e=js&&js.__createBinding||(Object.create?function(u,c,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(c,l);(!f||("get"in f?!c.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return c[l]}}),Object.defineProperty(u,d,f)}:function(u,c,l,d){d===void 0&&(d=l),u[d]=c[l]}),n=js&&js.__exportStar||function(u,c){for(var l in u)l!=="default"&&!Object.prototype.hasOwnProperty.call(c,l)&&e(c,u,l)};Object.defineProperty(t,"__esModule",{value:!0}),t.ProposedFeatures=t.NotebookDocuments=t.TextDocuments=t.SemanticTokensBuilder=void 0;const r=Vk();Object.defineProperty(t,"SemanticTokensBuilder",{enumerable:!0,get:function(){return r.SemanticTokensBuilder}});const i=nU();n(_t(),t);const s=rC();Object.defineProperty(t,"TextDocuments",{enumerable:!0,get:function(){return s.TextDocuments}});const a=sC();Object.defineProperty(t,"NotebookDocuments",{enumerable:!0,get:function(){return a.NotebookDocuments}}),n(uC(),t);var o;(function(u){u.all={__brand:"features",languages:i.InlineCompletionFeature}})(o||(t.ProposedFeatures=o={}))}(js)),js}var hC;function mC(){return hC||(hC=1,function(t){var e=xs&&xs.__createBinding||(Object.create?function(w,E,$,k){k===void 0&&(k=$);var A=Object.getOwnPropertyDescriptor(E,$);(!A||("get"in A?!E.__esModule:A.writable||A.configurable))&&(A={enumerable:!0,get:function(){return E[$]}}),Object.defineProperty(w,k,A)}:function(w,E,$,k){k===void 0&&(k=$),w[k]=E[$]}),n=xs&&xs.__exportStar||function(w,E){for(var $ in w)$!=="default"&&!Object.prototype.hasOwnProperty.call(E,$)&&e(E,w,$)};Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=t.Files=void 0;const r=L1,i=sw(),s=uC(),a=tU(),o=dC();n(dC(),t),n(rU(),t);var u;(function(w){w.uriToFilePath=a.uriToFilePath,w.resolveGlobalNodePath=a.resolveGlobalNodePath,w.resolveGlobalYarnPath=a.resolveGlobalYarnPath,w.resolve=a.resolve,w.resolveModulePath=a.resolveModulePath})(u||(t.Files=u={}));function c(){}let l=!1,d;function f(){const w="--clientProcessId";function E($){try{let k=parseInt($);isNaN(k)||(d=setInterval(()=>{try{process.kill(k,0)}catch{process.exit(l?0:1)}},3e3))}catch{}}for(let $=2;$<process.argv.length;$++){let k=process.argv[$];if(k===w&&$+1<process.argv.length){E(process.argv[$+1]);return}else{let A=k.split("=");A[0]===w&&E(A[1])}}}f();const p={initialize:w=>{const E=w.processId;i.number(E)&&d===void 0&&setInterval(()=>{try{process.kill(E,0)}catch{process.exit(l?0:1)}},3e3)},get shutdownReceived(){return l},set shutdownReceived(w){l=w},exit:w=>{process.exit(w)}};function h(w,E,$,k){let A,I,M,Y;return w!==void 0&&w.__brand==="features"&&(A=w,w=E,E=$,$=k),o.ConnectionStrategy.is(w)||o.ConnectionOptions.is(w)?Y=w:(I=w,M=E,Y=$),y(I,M,Y,A)}t.createConnection=h;function y(w,E,$,k){let A=!1;if(!w&&!E&&process.argv.length>2){let Q,ae,O=process.argv.slice(2);for(let T=0;T<O.length;T++){let R=O[T];if(R==="--node-ipc"){w=new o.IPCMessageReader(process),E=new o.IPCMessageWriter(process);break}else if(R==="--stdio"){A=!0,w=process.stdin,E=process.stdout;break}else if(R==="--socket"){Q=parseInt(O[T+1]);break}else if(R==="--pipe"){ae=O[T+1];break}else{var I=R.split("=");if(I[0]==="--socket"){Q=parseInt(I[1]);break}else if(I[0]==="--pipe"){ae=I[1];break}}}if(Q){let T=(0,o.createServerSocketTransport)(Q);w=T[0],E=T[1]}else if(ae){let T=(0,o.createServerPipeTransport)(ae);w=T[0],E=T[1]}}var M="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!w)throw new Error("Connection input stream is not set. "+M);if(!E)throw new Error("Connection output stream is not set. "+M);if(i.func(w.read)&&i.func(w.on)){let Q=w;Q.on("end",()=>{process.exit(l?0:1)}),Q.on("close",()=>{process.exit(l?0:1)})}const Y=Q=>{const ae=(0,o.createProtocolConnection)(w,E,Q,$);return A&&b(Q),ae};return(0,s.createConnection)(Y,p,k)}function b(w){function E(k){return k.map(A=>typeof A=="string"?A:(0,r.inspect)(A)).join(" ")}const $=new Map;console.assert=function(A,...I){if(!A)if(I.length===0)w.error("Assertion failed");else{const[M,...Y]=I;w.error(`Assertion failed: ${M} ${E(Y)}`)}},console.count=function(A="default"){const I=String(A);let M=$.get(I)??0;M+=1,$.set(I,M),w.log(`${I}: ${I}`)},console.countReset=function(A){A===void 0?$.clear():$.delete(String(A))},console.debug=function(...A){w.log(E(A))},console.dir=function(A,I){w.log((0,r.inspect)(A,I))},console.log=function(...A){w.log(E(A))},console.error=function(...A){w.error(E(A))},console.trace=function(...A){const I=new Error().stack.replace(/(.+\n){2}/,"");let M="Trace";A.length!==0&&(M+=`: ${E(A)}`),w.log(`${M}
160
+ ${I}`)},console.warn=function(...A){w.warn(E(A))}}}(xs)),xs}var we=mC();function gC(t,e){const n={stacks:t,tokens:e};return iU(n),n.stacks.flat().forEach(i=>{i.property=void 0}),wC(n.stacks).map(i=>i[i.length-1])}function hw(t){const{next:e,cardinalities:n,visited:r,plus:i}=t,s=[],a=e.feature;if(r.has(a))return[];ki(a)||r.add(a);let o,u=a;for(;u.$container;)if(ki(u.$container)){o=u.$container;break}else if(og(u.$container))u=u.$container;else break;if(EE(u.cardinality)){const c=Wa({next:{feature:u,type:e.type},cardinalities:n,visited:r,plus:i});for(const l of c)i.add(l.feature);s.push(...c)}if(o){const c=o.elements.indexOf(u);c!==void 0&&c<o.elements.length-1&&s.push(...yC({feature:o,type:e.type},c+1,n,r,i)),s.every(l=>Aa(l.feature.cardinality,l.feature)||Aa(n.get(l.feature))||i.has(l.feature))&&s.push(...hw({next:{feature:o,type:e.type},cardinalities:n,visited:r,plus:i}))}return s}function mw(t){return $t(t)&&(t={feature:t}),Wa({next:t,cardinalities:new Map,visited:new Set,plus:new Set})}function Wa(t){var e,n,r;const{next:i,cardinalities:s,visited:a,plus:o}=t;if(i===void 0)return[];const{feature:u,type:c}=i;if(ki(u))return a.has(u)?[]:(a.add(u),yC(i,0,s,a,o).map(l=>_p(l,u.cardinality,s)));if(fg(u)||pg(u))return u.elements.flatMap(l=>Wa({next:{feature:l,type:c,property:i.property},cardinalities:s,visited:a,plus:o})).map(l=>_p(l,u.cardinality,s));if(Tr(u)){const l={feature:u.terminal,type:c,property:(e=i.property)!==null&&e!==void 0?e:u.feature};return Wa({next:l,cardinalities:s,visited:a,plus:o}).map(d=>_p(d,u.cardinality,s))}else{if(hs(u))return hw({next:{feature:u,type:yu(u),property:(n=i.property)!==null&&n!==void 0?n:u.feature},cardinalities:s,visited:a,plus:o});if(Vr(u)&&nn(u.rule.ref)){const l=u.rule.ref,d={feature:l.definition,type:l.fragment||l.dataType?void 0:(r=ms(l))!==null&&r!==void 0?r:l.name,property:i.property};return Wa({next:d,cardinalities:s,visited:a,plus:o}).map(f=>_p(f,u.cardinality,s))}else return[i]}}function _p(t,e,n){return n.set(t.feature,e),t}function yC(t,e,n,r,i){var s;const a=[];let o;for(;e<t.feature.elements.length&&(o={feature:t.feature.elements[e++],type:t.type},a.push(...Wa({next:o,cardinalities:n,visited:r,plus:i})),!!Aa((s=o.feature.cardinality)!==null&&s!==void 0?s:n.get(o.feature),o.feature)););return a}function iU(t){for(const e of t.tokens){const n=wC(t.stacks,e);t.stacks=n}}function wC(t,e){const n=[];for(const r of t)n.push(...sU(r,e));return n}function sU(t,e){const n=new Map,r=new Set(t.map(s=>s.feature).filter(aU)),i=[];for(;t.length>0;){const s=t.pop(),a=hw({next:s,cardinalities:n,plus:r,visited:new Set}).filter(o=>e?gw(o.feature,e):!0);for(const o of a)i.push([...t,o]);if(!a.every(o=>Aa(o.feature.cardinality,o.feature)||Aa(n.get(o.feature))))break}return i}function aU(t){if(t.cardinality==="+")return!0;const e=rn(t,Tr);return!!(e&&e.cardinality==="+")}function gw(t,e){if(kr(t))return t.value===e.image;if(Vr(t))return oU(t.rule.ref,e);if(eu(t)){const n=Eg(t);if(n)return gw(n,e)}return!1}function oU(t,e){return nn(t)?mw(t.definition).some(r=>gw(r.feature,e)):Hr(t)?wu(t).test(e.image):!1}function uU(t){const e=Array.from(new Set(t.flatMap(r=>{var i;return(i=r?.triggerCharacters)!==null&&i!==void 0?i:[]}))),n=Array.from(new Set(t.flatMap(r=>{var i;return(i=r?.allCommitCharacters)!==null&&i!==void 0?i:[]})));return{triggerCharacters:e.length>0?e:void 0,allCommitCharacters:n.length>0?n:void 0}}class vC{constructor(e){this.scopeProvider=e.references.ScopeProvider,this.grammar=e.Grammar,this.completionParser=e.parser.CompletionParser,this.nameProvider=e.references.NameProvider,this.lexer=e.parser.Lexer,this.nodeKindProvider=e.shared.lsp.NodeKindProvider,this.fuzzyMatcher=e.shared.lsp.FuzzyMatcher,this.grammarConfig=e.parser.GrammarConfig,this.astReflection=e.shared.AstReflection,this.documentationProvider=e.documentation.DocumentationProvider}async getCompletion(e,n,r){const i=[],s=this.buildContexts(e,n.position),a=(c,l)=>{const d=this.fillCompletionItem(c,l);d&&i.push(d)},o=c=>kr(c.feature)?c.feature.value:c.feature,u=[];for(const c of s)if(await Promise.all(rt(c.features).distinct(o).exclude(u).map(l=>this.completionFor(c,l,a))),u.push(...c.features),!this.continueCompletion(i))break;return we.CompletionList.create(this.deduplicateItems(i),!0)}deduplicateItems(e){return rt(e).distinct(n=>`${n.kind}_${n.label}_${n.detail}`).toArray()}findFeaturesAt(e,n){const r=e.getText({start:we.Position.create(0,0),end:e.positionAt(n)}),i=this.completionParser.parse(r),s=i.tokens;if(i.tokenIndex===0){const u=vf(this.grammar),c=mw({feature:u.definition,type:ms(u)});return s.length>0?(s.shift(),gC(c.map(l=>[l]),s)):c}const a=[...s].splice(i.tokenIndex);return gC([i.elementStack.map(u=>({feature:u}))],a)}*buildContexts(e,n){var r,i;const s=e.parseResult.value.$cstNode;if(!s)return;const a=e.textDocument,o=a.getText(),u=a.offsetAt(n),c={document:e,textDocument:a,offset:u,position:n},l=this.findDataTypeRuleStart(s,u);if(l){const[E,$]=l,k=(r=nf(s,E))===null||r===void 0?void 0:r.astNode;yield Object.assign(Object.assign({},c),{node:k,tokenOffset:E,tokenEndOffset:$,features:this.findFeaturesAt(a,E)})}const{nextTokenStart:d,nextTokenEnd:f,previousTokenStart:p,previousTokenEnd:h}=this.backtrackToAnyToken(o,u);let y=d;u<=d&&p!==void 0&&(y=p);const b=(i=nf(s,y))===null||i===void 0?void 0:i.astNode;let w=!0;if(p!==void 0&&h!==void 0&&h===u&&(yield Object.assign(Object.assign({},c),{node:b,tokenOffset:p,tokenEndOffset:h,features:this.findFeaturesAt(a,p)}),w=this.performNextTokenCompletion(e,o.substring(p,h),p,h),w&&(yield Object.assign(Object.assign({},c),{node:b,tokenOffset:h,tokenEndOffset:h,features:this.findFeaturesAt(a,h)}))),b)w&&(yield Object.assign(Object.assign({},c),{node:b,tokenOffset:d,tokenEndOffset:f,features:this.findFeaturesAt(a,d)}));else{const E=vf(this.grammar);if(!E)throw new Error("Missing entry parser rule");yield Object.assign(Object.assign({},c),{tokenOffset:d,tokenEndOffset:f,features:mw(E.definition)})}}performNextTokenCompletion(e,n,r,i){return new RegExp("\\P{L}$","u").test(n)}findDataTypeRuleStart(e,n){var r,i;let s=Ti(e,n,this.grammarConfig.nameRegexp),a=!!(!((r=rn(s?.grammarSource,nn))===null||r===void 0)&&r.dataType);if(a){for(;a;)s=s?.container,a=!!(!((i=rn(s?.grammarSource,nn))===null||i===void 0)&&i.dataType);if(s)return[s.offset,s.end]}}continueCompletion(e){return e.length===0}backtrackToAnyToken(e,n){const r=this.lexer.tokenize(e).tokens;if(r.length===0)return{nextTokenStart:n,nextTokenEnd:n};let i;for(const s of r){if(s.startOffset>=n)return{nextTokenStart:n,nextTokenEnd:n,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0};if(s.endOffset>=n)return{nextTokenStart:s.startOffset,nextTokenEnd:s.endOffset+1,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0};i=s}return{nextTokenStart:n,nextTokenEnd:n,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0}}completionFor(e,n,r){if(kr(n.feature))return this.completionForKeyword(e,n.feature,r);if(eu(n.feature)&&e.node)return this.completionForCrossReference(e,n,r)}completionForCrossReference(e,n,r){const i=rn(n.feature,Tr);let s=e.node;if(i&&s){n.type&&(s={$type:n.type,$container:s,$containerProperty:n.property},gg(this.astReflection,s));const a={reference:{$refText:""},container:s,property:i.feature};try{for(const o of this.getReferenceCandidates(a,e))r(e,this.createReferenceCompletionItem(o))}catch(o){console.error(o)}}}getReferenceCandidates(e,n){return this.scopeProvider.getScope(e).getAllElements()}createReferenceCompletionItem(e){const n=this.nodeKindProvider.getCompletionItemKind(e),r=this.getReferenceDocumentation(e);return{nodeDescription:e,kind:n,documentation:r,detail:e.type,sortText:"0"}}getReferenceDocumentation(e){if(!e.node)return;const n=this.documentationProvider.getDocumentation(e.node);if(n)return{kind:"markdown",value:n}}completionForKeyword(e,n,r){this.filterKeyword(e,n)&&r(e,{label:n.value,kind:this.getKeywordCompletionItemKind(n),detail:"Keyword",sortText:"1"})}getKeywordCompletionItemKind(e){return we.CompletionItemKind.Keyword}filterKeyword(e,n){return new RegExp("\\p{L}","u").test(n.value)}fillCompletionItem(e,n){var r,i;let s;if(typeof n.label=="string")s=n.label;else if("node"in n){const c=this.nameProvider.getName(n.node);if(!c)return;s=c}else if("nodeDescription"in n)s=n.nodeDescription.name;else return;let a;typeof((r=n.textEdit)===null||r===void 0?void 0:r.newText)=="string"?a=n.textEdit.newText:typeof n.insertText=="string"?a=n.insertText:a=s;const o=(i=n.textEdit)!==null&&i!==void 0?i:this.buildCompletionTextEdit(e,s,a);return o?{additionalTextEdits:n.additionalTextEdits,command:n.command,commitCharacters:n.commitCharacters,data:n.data,detail:n.detail,documentation:n.documentation,filterText:n.filterText,insertText:n.insertText,insertTextFormat:n.insertTextFormat,insertTextMode:n.insertTextMode,kind:n.kind,labelDetails:n.labelDetails,preselect:n.preselect,sortText:n.sortText,tags:n.tags,textEditText:n.textEditText,textEdit:o,label:s}:void 0}buildCompletionTextEdit(e,n,r){const s=e.textDocument.getText().substring(e.tokenOffset,e.offset);if(this.fuzzyMatcher.match(s,n)){const a=e.textDocument.positionAt(e.tokenOffset),o=e.position;return{newText:r,range:{start:a,end:o}}}else return}}class cU{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getDefinition(e,n,r){const i=e.parseResult.value;if(i.$cstNode){const s=i.$cstNode,a=Ti(s,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(a)return this.collectLocationLinks(a,n)}}collectLocationLinks(e,n){var r;const i=this.findLink(e);if(i)return[we.LocationLink.create(i.targetDocument.textDocument.uri,((r=i.target.astNode.$cstNode)!==null&&r!==void 0?r:i.target).range,i.target.range,i.source.range)]}findLink(e){const n=this.references.findDeclarationNode(e);if(n?.astNode){const r=wt(n.astNode);if(n&&r)return{source:e,target:n,targetDocument:r}}}}class bC{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}getDocumentHighlight(e,n,r){const i=e.parseResult.value.$cstNode;if(!i)return;const s=Ti(i,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(!s)return;const a=this.references.findDeclaration(s);if(a){const o=kt.equals(wt(a).uri,e.uri),u={documentUri:e.uri,includeDeclaration:o};return this.references.findReferences(a,u).map(l=>this.createDocumentHighlight(l)).toArray()}}createDocumentHighlight(e){return we.DocumentHighlight.create(e.segment.range)}}class lU{constructor(e){this.nameProvider=e.references.NameProvider,this.nodeKindProvider=e.shared.lsp.NodeKindProvider}getSymbols(e,n,r){return this.getSymbol(e,e.parseResult.value)}getSymbol(e,n){const r=n.$cstNode,i=this.nameProvider.getNameNode(n);if(i&&r){const s=this.nameProvider.getName(n);return[{kind:this.nodeKindProvider.getSymbolKind(n),name:s||i.text,range:r.range,selectionRange:i.range,children:this.getChildSymbols(e,n)}]}else return this.getChildSymbols(e,n)||[]}getChildSymbols(e,n){const r=[];for(const i of pu(n)){const s=this.getSymbol(e,i);r.push(...s)}if(r.length>0)return r}}class dU{constructor(e){this.workspaceManager=e.workspace.WorkspaceManager,this.documentBuilder=e.workspace.DocumentBuilder,this.workspaceLock=e.workspace.WorkspaceLock,this.serviceRegistry=e.ServiceRegistry;let n=!1;e.lsp.LanguageServer.onInitialize(r=>{var i,s;n=!!(!((s=(i=r.capabilities.workspace)===null||i===void 0?void 0:i.didChangeWatchedFiles)===null||s===void 0)&&s.dynamicRegistration)}),e.lsp.LanguageServer.onInitialized(r=>{n&&this.registerFileWatcher(e)})}registerFileWatcher(e){const n=rt(e.ServiceRegistry.all).flatMap(r=>r.LanguageMetaData.fileExtensions).map(r=>r.startsWith(".")?r.substring(1):r).distinct().toArray();if(n.length>0){const r=e.lsp.Connection,i={watchers:[{globPattern:n.length===1?`**/*.${n[0]}`:`**/*.{${n.join(",")}}`}]};r?.client.register(we.DidChangeWatchedFilesNotification.type,i)}}fireDocumentUpdate(e,n){e=e.filter(r=>this.serviceRegistry.hasServices(r)),this.workspaceManager.ready.then(()=>{this.workspaceLock.write(r=>this.documentBuilder.update(e,n,r))}).catch(r=>{console.error("Workspace initialization failed. Could not perform document update.",r)})}didChangeContent(e){this.fireDocumentUpdate([Jt.parse(e.document.uri)],[])}didChangeWatchedFiles(e){const n=rt(e.changes).filter(i=>i.type!==we.FileChangeType.Deleted).distinct(i=>i.uri).map(i=>Jt.parse(i.uri)).toArray(),r=rt(e.changes).filter(i=>i.type===we.FileChangeType.Deleted).distinct(i=>i.uri).map(i=>Jt.parse(i.uri)).toArray();this.fireDocumentUpdate(n,r)}}class fU{constructor(e){this.commentNames=e.parser.GrammarConfig.multilineCommentRules}getFoldingRanges(e,n,r){const i=[],s=a=>i.push(a);return this.collectFolding(e,s),i}collectFolding(e,n){var r;const i=(r=e.parseResult)===null||r===void 0?void 0:r.value;if(i){if(this.shouldProcessContent(i)){const s=Cr(i).iterator();let a;do if(a=s.next(),!a.done){const o=a.value;this.shouldProcess(o)&&this.collectObjectFolding(e,o,n),this.shouldProcessContent(o)||s.prune()}while(!a.done)}this.collectCommentFolding(e,i,n)}}shouldProcess(e){return!0}shouldProcessContent(e){return!0}collectObjectFolding(e,n,r){const i=n.$cstNode;if(i){const s=this.toFoldingRange(e,i);s&&r(s)}}collectCommentFolding(e,n,r){const i=n.$cstNode;if(i){for(const s of XD(i))if(this.commentNames.includes(s.tokenType.name)){const a=this.toFoldingRange(e,s,we.FoldingRangeKind.Comment);a&&r(a)}}}toFoldingRange(e,n,r){const i=n.range,s=i.start;let a=i.end;if(!(a.line-s.line<2))return this.includeLastFoldingLine(n,r)||(a=e.textDocument.positionAt(e.textDocument.offsetAt({line:a.line,character:0})-1)),we.FoldingRange.create(s.line,a.line,s.character,a.character,r)}includeLastFoldingLine(e,n){if(n===we.FoldingRangeKind.Comment)return!1;const r=e.text,i=r.charAt(r.length-1);return!(i==="}"||i===")"||i==="]")}}class pU{match(e,n){if(e.length===0)return!0;let r=!1,i,s=0;const a=n.length;for(let o=0;o<a;o++){const u=n.charCodeAt(o),c=e.charCodeAt(s);if((u===c||this.toUpperCharCode(u)===this.toUpperCharCode(c))&&(r||(r=i===void 0||this.isWordTransition(i,u)),r&&s++,s===e.length))return!0;i=u}return!1}isWordTransition(e,n){return DC<=e&&e<=EC&&hU<=n&&n<=mU||e===RC&&n!==RC}toUpperCharCode(e){return DC<=e&&e<=EC?e-32:e}}const DC=97,EC=122,hU=65,mU=90,RC=95;class $C{constructor(e){this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getHoverContent(e,n){var r,i;const s=(i=(r=e.parseResult)===null||r===void 0?void 0:r.value)===null||i===void 0?void 0:i.$cstNode;if(s){const a=e.textDocument.offsetAt(n.position),o=Ti(s,a,this.grammarConfig.nameRegexp);if(o&&o.offset+o.length>a){const u=this.references.findDeclaration(o);if(u)return this.getAstNodeHoverContent(u)}}}}class gU extends $C{constructor(e){super(e),this.documentationProvider=e.documentation.DocumentationProvider}getAstNodeHoverContent(e){const n=this.documentationProvider.getDocumentation(e);if(n)return{contents:{kind:"markdown",value:n}}}}var Pp=_t();const yU={[we.SemanticTokenTypes.class]:0,[we.SemanticTokenTypes.comment]:1,[we.SemanticTokenTypes.enum]:2,[we.SemanticTokenTypes.enumMember]:3,[we.SemanticTokenTypes.event]:4,[we.SemanticTokenTypes.function]:5,[we.SemanticTokenTypes.interface]:6,[we.SemanticTokenTypes.keyword]:7,[we.SemanticTokenTypes.macro]:8,[we.SemanticTokenTypes.method]:9,[we.SemanticTokenTypes.modifier]:10,[we.SemanticTokenTypes.namespace]:11,[we.SemanticTokenTypes.number]:12,[we.SemanticTokenTypes.operator]:13,[we.SemanticTokenTypes.parameter]:14,[we.SemanticTokenTypes.property]:15,[we.SemanticTokenTypes.regexp]:16,[we.SemanticTokenTypes.string]:17,[we.SemanticTokenTypes.struct]:18,[we.SemanticTokenTypes.type]:19,[we.SemanticTokenTypes.typeParameter]:20,[we.SemanticTokenTypes.variable]:21,[we.SemanticTokenTypes.decorator]:22},wU={[we.SemanticTokenModifiers.abstract]:1,[we.SemanticTokenModifiers.async]:2,[we.SemanticTokenModifiers.declaration]:4,[we.SemanticTokenModifiers.defaultLibrary]:8,[we.SemanticTokenModifiers.definition]:16,[we.SemanticTokenModifiers.deprecated]:32,[we.SemanticTokenModifiers.documentation]:64,[we.SemanticTokenModifiers.modification]:128,[we.SemanticTokenModifiers.readonly]:256,[we.SemanticTokenModifiers.static]:512};function vU(t){const e=[],n=[];let r=!0,i=!0,s=!0;for(const a of t)a&&(a.legend.tokenTypes.forEach((o,u)=>{const c=e[u];if(c&&c!==o)throw new Error(`Cannot merge '${c}' and '${o}' token types. They use the same index ${u}.`);e[u]=o}),a.legend.tokenModifiers.forEach((o,u)=>{const c=n[u];if(c&&c!==o)throw new Error(`Cannot merge '${c}' and '${o}' token modifier. They use the same index ${u}.`);n[u]=o}),a.full?typeof a.full=="object"&&!a.full.delta&&(i=!1):r=!1,a.range||(s=!1));return{legend:{tokenTypes:e,tokenModifiers:n},full:r&&{delta:i},range:s}}class bU extends we.SemanticTokensBuilder{constructor(){super(...arguments),this._tokens=[]}push(e,n,r,i,s){this._tokens.push({line:e,char:n,length:r,tokenType:i,tokenModifiers:s})}build(){return this.applyTokens(),super.build()}buildEdits(){return this.applyTokens(),super.buildEdits()}flush(){this.previousResult(this.id)}applyTokens(){for(const e of this._tokens.sort(this.compareTokens))super.push(e.line,e.char,e.length,e.tokenType,e.tokenModifiers);this._tokens=[]}compareTokens(e,n){return e.line===n.line?e.char-n.char:e.line-n.line}}class DU{constructor(e){this.tokensBuilders=new Map,e.shared.workspace.TextDocuments.onDidClose(n=>{this.tokensBuilders.delete(n.document.uri)}),e.shared.lsp.LanguageServer.onInitialize(n=>{var r;this.initialize((r=n.capabilities.textDocument)===null||r===void 0?void 0:r.semanticTokens)})}initialize(e){this.clientCapabilities=e}get tokenTypes(){return yU}get tokenModifiers(){return wU}get semanticTokensOptions(){return{legend:{tokenTypes:Object.keys(this.tokenTypes),tokenModifiers:Object.keys(this.tokenModifiers)},full:{delta:!0},range:!0}}async semanticHighlight(e,n,r=ct.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.flush(),await this.computeHighlighting(e,this.createAcceptor(),r),this.currentTokensBuilder.build()}async semanticHighlightRange(e,n,r=ct.CancellationToken.None){return this.currentRange=n.range,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.flush(),await this.computeHighlighting(e,this.createAcceptor(),r),this.currentTokensBuilder.build()}async semanticHighlightDelta(e,n,r=ct.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.previousResult(n.previousResultId),await this.computeHighlighting(e,this.createAcceptor(),r),this.currentTokensBuilder.buildEdits()}createAcceptor(){return n=>{"line"in n?this.highlightToken({range:{start:{line:n.line,character:n.char},end:{line:n.line,character:n.char+n.length}},type:n.type,modifier:n.modifier}):"range"in n?this.highlightToken(n):"keyword"in n?this.highlightKeyword(n):"property"in n?this.highlightProperty(n):this.highlightNode({node:n.cst,type:n.type,modifier:n.modifier})}}getDocumentTokensBuilder(e){const n=this.tokensBuilders.get(e.uri.toString());if(n)return n;const r=new bU;return this.tokensBuilders.set(e.uri.toString(),r),r}async computeHighlighting(e,n,r){const i=e.parseResult.value,s=Kr(i,{range:this.currentRange}).iterator();let a;do if(a=s.next(),!a.done){await It(r);const o=a.value;this.highlightElement(o,n)==="prune"&&s.prune()}while(!a.done)}highlightToken(e){var n;const{range:r,type:i}=e;let s=e.modifier;if(this.currentRange&&!tg(r,this.currentRange)||!this.currentDocument||!this.currentTokensBuilder)return;const a=this.tokenTypes[i];let o=0;if(s!==void 0){typeof s=="string"&&(s=[s]);for(const l of s){const d=this.tokenModifiers[l];o|=d}}const u=r.start.line,c=r.end.line;if(u===c){const l=r.start.character,d=r.end.character-l;this.currentTokensBuilder.push(u,l,d,a,o)}else if(!((n=this.clientCapabilities)===null||n===void 0)&&n.multilineTokenSupport){const l=r.start.character,d=this.currentDocument.textDocument.offsetAt(r.start),f=this.currentDocument.textDocument.offsetAt(r.end);this.currentTokensBuilder.push(u,l,f-d,a,o)}else{const l=r.start;let d=this.currentDocument.textDocument.offsetAt({line:u+1,character:0});this.currentTokensBuilder.push(l.line,l.character,d-l.character-1,a,o);for(let f=u+1;f<c;f++){const p=d;d=this.currentDocument.textDocument.offsetAt({line:f+1,character:0}),this.currentTokensBuilder.push(f,0,d-p-1,a,o)}this.currentTokensBuilder.push(c,0,r.end.character,a,o)}}highlightProperty(e){const n=[];if(typeof e.index=="number"){const s=sn(e.node.$cstNode,e.property,e.index);s&&n.push(s)}else n.push(...Ca(e.node.$cstNode,e.property));const{type:r,modifier:i}=e;for(const s of n)this.highlightNode({node:s,type:r,modifier:i})}highlightKeyword(e){const{node:n,keyword:r,type:i,index:s,modifier:a}=e,o=[];if(typeof s=="number"){const u=gu(n.$cstNode,r,s);u&&o.push(u)}else o.push(...$g(n.$cstNode,r));for(const u of o)this.highlightNode({node:u,type:i,modifier:a})}highlightNode(e){const{node:n,type:r,modifier:i}=e,s=n.range;this.highlightToken({range:s,type:r,modifier:i})}}var SC;(function(t){function e(r,i,s){const a=new Map;Object.entries(i).forEach(([c,l])=>a.set(l,c));let o=0,u=0;return n(r.data,5).map(c=>{o+=c[0],c[0]!==0&&(u=0),u+=c[1];const l=c[2];return{offset:s.textDocument.offsetAt({line:o,character:u}),tokenType:a.get(c[3]),tokenModifiers:c[4],text:s.textDocument.getText({start:{line:o,character:u},end:{line:o,character:u+l}})}})}t.decode=e;function n(r,i){const s=[];for(let a=0;a<r.length;a+=i){const o=r.slice(a,a+i);s.push(o)}return s}})(SC||(SC={}));function EU(t){const e=[],n=[];t.forEach(i=>{i?.triggerCharacters&&e.push(...i.triggerCharacters),i?.retriggerCharacters&&n.push(...i.retriggerCharacters)});const r={triggerCharacters:e.length>0?Array.from(new Set(e)).sort():void 0,retriggerCharacters:n.length>0?Array.from(new Set(n)).sort():void 0};return r.triggerCharacters?r:void 0}class RU{constructor(e){this.onInitializeEmitter=new Pp.Emitter,this.onInitializedEmitter=new Pp.Emitter,this.services=e}get onInitialize(){return this.onInitializeEmitter.event}get onInitialized(){return this.onInitializedEmitter.event}async initialize(e){return this.eagerLoadServices(),this.fireInitializeOnDefaultServices(e),this.onInitializeEmitter.fire(e),this.onInitializeEmitter.dispose(),this.buildInitializeResult(e)}eagerLoadServices(){ew(this.services),this.services.ServiceRegistry.all.forEach(e=>ew(e))}hasService(e){return this.services.ServiceRegistry.all.some(r=>e(r)!==void 0)}buildInitializeResult(e){var n,r,i,s;const a=this.services.lsp.DocumentUpdateHandler,o=(n=this.services.lsp.FileOperationHandler)===null||n===void 0?void 0:n.fileOperationOptions,u=this.services.ServiceRegistry.all,c=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.Formatter}),l=u.map(te=>{var C,me;return(me=(C=te.lsp)===null||C===void 0?void 0:C.Formatter)===null||me===void 0?void 0:me.formatOnTypeOptions}).find(te=>!!te),d=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.CodeActionProvider}),f=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.SemanticTokenProvider}),p=vU(u.map(te=>{var C,me;return(me=(C=te.lsp)===null||C===void 0?void 0:C.SemanticTokenProvider)===null||me===void 0?void 0:me.semanticTokensOptions})),h=(i=(r=this.services.lsp)===null||r===void 0?void 0:r.ExecuteCommandHandler)===null||i===void 0?void 0:i.commands,y=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.DocumentLinkProvider}),b=EU(u.map(te=>{var C,me;return(me=(C=te.lsp)===null||C===void 0?void 0:C.SignatureHelp)===null||me===void 0?void 0:me.signatureHelpOptions})),w=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.TypeProvider}),E=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.ImplementationProvider}),$=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.CompletionProvider}),k=uU(u.map(te=>{var C,me;return(me=(C=te.lsp)===null||C===void 0?void 0:C.CompletionProvider)===null||me===void 0?void 0:me.completionOptions})),A=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.ReferencesProvider}),I=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.DocumentSymbolProvider}),M=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.DefinitionProvider}),Y=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.DocumentHighlightProvider}),Q=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.FoldingRangeProvider}),ae=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.HoverProvider}),O=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.RenameProvider}),T=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.CallHierarchyProvider}),R=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.TypeHierarchyProvider}),F=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.CodeLensProvider}),V=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.DeclarationProvider}),W=this.hasService(te=>{var C;return(C=te.lsp)===null||C===void 0?void 0:C.InlayHintProvider}),H=(s=this.services.lsp)===null||s===void 0?void 0:s.WorkspaceSymbolProvider;return{capabilities:{workspace:{workspaceFolders:{supported:!0},fileOperations:o},executeCommandProvider:h&&{commands:h},textDocumentSync:{change:Pp.TextDocumentSyncKind.Incremental,openClose:!0,save:!!a.didSaveDocument,willSave:!!a.willSaveDocument,willSaveWaitUntil:!!a.willSaveDocumentWaitUntil},completionProvider:$?k:void 0,referencesProvider:A,documentSymbolProvider:I,definitionProvider:M,typeDefinitionProvider:w,documentHighlightProvider:Y,codeActionProvider:d,documentFormattingProvider:c,documentRangeFormattingProvider:c,documentOnTypeFormattingProvider:l,foldingRangeProvider:Q,hoverProvider:ae,renameProvider:O?{prepareProvider:!0}:void 0,semanticTokensProvider:f?p:void 0,signatureHelpProvider:b,implementationProvider:E,callHierarchyProvider:T?{}:void 0,typeHierarchyProvider:R?{}:void 0,documentLinkProvider:y?{resolveProvider:!1}:void 0,codeLensProvider:F?{resolveProvider:!1}:void 0,declarationProvider:V,inlayHintProvider:W?{resolveProvider:!1}:void 0,workspaceSymbolProvider:H?{resolveProvider:!!H.resolveSymbol}:void 0}}}initialized(e){this.fireInitializedOnDefaultServices(e),this.onInitializedEmitter.fire(e),this.onInitializedEmitter.dispose()}fireInitializeOnDefaultServices(e){this.services.workspace.ConfigurationProvider.initialize(e),this.services.workspace.WorkspaceManager.initialize(e)}fireInitializedOnDefaultServices(e){const n=this.services.lsp.Connection,r=n?Object.assign(Object.assign({},e),{register:i=>n.client.register(Pp.DidChangeConfigurationNotification.type,i),fetchConfiguration:i=>n.workspace.getConfiguration(i)}):e;this.services.workspace.ConfigurationProvider.initialized(r).catch(i=>console.error("Error in ConfigurationProvider initialization:",i)),this.services.workspace.WorkspaceManager.initialized(e).catch(i=>console.error("Error in WorkspaceManager initialization:",i))}}class $U{getSymbolKind(e){return we.SymbolKind.Field}getCompletionItemKind(e){return we.CompletionItemKind.Reference}}class SU{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}findReferences(e,n,r){const i=e.parseResult.value.$cstNode;if(!i)return[];const s=Ti(i,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);return s?this.getReferences(s,n,e):[]}getReferences(e,n,r){const i=[],s=this.references.findDeclaration(e);if(s){const a={includeDeclaration:n.context.includeDeclaration};this.references.findReferences(s,a).forEach(o=>{i.push(we.Location.create(o.sourceUri.toString(),o.segment.range))})}return i}}class TU{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}async rename(e,n,r){const i={},s=e.parseResult.value.$cstNode;if(!s)return;const a=e.textDocument.offsetAt(n.position),o=Ti(s,a,this.grammarConfig.nameRegexp);if(!o)return;const u=this.references.findDeclaration(o);if(!u)return;const c={onlyLocal:!1,includeDeclaration:!0};return this.references.findReferences(u,c).forEach(d=>{const f=Pn.replace(d.segment.range,n.newName),p=d.sourceUri.toString();i[p]?i[p].push(f):i[p]=[f]}),{changes:i}}prepareRename(e,n,r){return this.renameNodeRange(e,n.position)}renameNodeRange(e,n){const r=e.parseResult.value.$cstNode,i=e.textDocument.offsetAt(n);if(r&&i){const s=Ti(r,i,this.grammarConfig.nameRegexp);if(!s)return;if(this.references.findDeclaration(s)||this.isNameNode(s))return s.range}}isNameNode(e){return e?.astNode&&vp(e.astNode)&&e===this.nameProvider.getNameNode(e.astNode)}}class TC{constructor(e){this.indexManager=e.workspace.IndexManager,this.nodeKindProvider=e.lsp.NodeKindProvider,this.fuzzyMatcher=e.lsp.FuzzyMatcher}async getSymbols(e,n=ct.CancellationToken.None){const r=[],i=e.query.toLowerCase();for(const s of this.indexManager.allElements())if(await It(n),this.fuzzyMatcher.match(i,s.name)){const a=this.getWorkspaceSymbol(s);a&&r.push(a)}return r}getWorkspaceSymbol(e){const n=e.nameSegment;if(n)return{kind:this.nodeKindProvider.getSymbolKind(e),name:e.name,location:{range:n.range,uri:e.documentUri.toString()}}}}class kU{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new we.Emitter,this._onDidOpen=new we.Emitter,this._onDidClose=new we.Emitter,this._onDidSave=new we.Emitter,this._onWillSave=new we.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(kt.normalize(e))}set(e){const n=kt.normalize(e.uri);let r=!0;this._syncedDocuments.has(n)&&(r=!1),this._syncedDocuments.set(n,e);const i=Object.freeze({document:e});return this._onDidOpen.fire(i),this._onDidChangeContent.fire(i),r}delete(e){const n=kt.normalize(typeof e=="object"&&"uri"in e?e.uri:e),r=this._syncedDocuments.get(n);r!==void 0&&(this._syncedDocuments.delete(n),this._onDidClose.fire(Object.freeze({document:r})))}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=we.TextDocumentSyncKind.Incremental;const n=[];return n.push(e.onDidOpenTextDocument(r=>{const i=r.textDocument,s=kt.normalize(i.uri),a=this._configuration.create(s,i.languageId,i.version,i.text);this._syncedDocuments.set(s,a);const o=Object.freeze({document:a});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o)})),n.push(e.onDidChangeTextDocument(r=>{const i=r.textDocument,s=r.contentChanges;if(s.length===0)return;const{version:a}=i;if(a==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);const o=kt.normalize(i.uri);let u=this._syncedDocuments.get(o);u!==void 0&&(u=this._configuration.update(u,s,a),this._syncedDocuments.set(o,u),this._onDidChangeContent.fire(Object.freeze({document:u})))})),n.push(e.onDidCloseTextDocument(r=>{const i=kt.normalize(r.textDocument.uri),s=this._syncedDocuments.get(i);s!==void 0&&(this._syncedDocuments.delete(i),this._onDidClose.fire(Object.freeze({document:s})))})),n.push(e.onWillSaveTextDocument(r=>{const i=this._syncedDocuments.get(kt.normalize(r.textDocument.uri));i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,i)=>{const s=this._syncedDocuments.get(kt.normalize(r.textDocument.uri));return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:r.reason}),i):[]})),n.push(e.onDidSaveTextDocument(r=>{const i=this._syncedDocuments.get(kt.normalize(r.textDocument.uri));i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),we.Disposable.create(()=>{n.forEach(r=>r.dispose())})}}function CU(t){return Ep.merge(PT(t),AU(t))}function AU(t){return{lsp:{CompletionProvider:e=>new vC(e),DocumentSymbolProvider:e=>new lU(e),HoverProvider:e=>new gU(e),FoldingRangeProvider:e=>new fU(e),ReferencesProvider:e=>new SU(e),DefinitionProvider:e=>new cU(e),DocumentHighlightProvider:e=>new bC(e),RenameProvider:e=>new TU(e)},shared:()=>t.shared}}function _U(t){return Ep.merge(xT(t),PU(t))}function PU(t){return{lsp:{Connection:()=>t.connection,LanguageServer:e=>new RU(e),DocumentUpdateHandler:e=>new dU(e),WorkspaceSymbolProvider:e=>new TC(e),NodeKindProvider:()=>new $U,FuzzyMatcher:()=>new pU},workspace:{TextDocuments:()=>new kU(wp)}}}class xU{constructor(){this.collector=()=>{}}getNodeFormatter(e){return new IU(e,this.collector)}formatDocument(e,n){const r=e.parseResult;return r.lexerErrors.length===0&&r.parserErrors.length===0?this.doDocumentFormat(e,n.options):[]}isFormatRangeErrorFree(e,n){const r=e.parseResult;return r.lexerErrors.length||r.parserErrors.length?Math.min(...r.lexerErrors.map(s=>{var a;return(a=s.line)!==null&&a!==void 0?a:Number.MAX_VALUE}),...r.parserErrors.map(s=>{var a;return(a=s.token.startLine)!==null&&a!==void 0?a:Number.MAX_VALUE}))>n.end.line:!0}formatDocumentRange(e,n){return this.isFormatRangeErrorFree(e,n.range)?this.doDocumentFormat(e,n.options,n.range):[]}formatDocumentOnType(e,n){const r={start:{character:0,line:n.position.line},end:n.position};return this.isFormatRangeErrorFree(e,r)?this.doDocumentFormat(e,n.options,r):[]}get formatOnTypeOptions(){}doDocumentFormat(e,n,r){const i=new Map,s=(o,u,c)=>{var l,d;const f=this.nodeModeToKey(o,u),p=i.get(f),h=(l=c.options.priority)!==null&&l!==void 0?l:0,y=(d=p?.options.priority)!==null&&d!==void 0?d:0;(!p||y<=h)&&i.set(f,c)};this.collector=s,this.iterateAstFormatting(e,r);const a=this.iterateCstFormatting(e,i,n,r);return this.avoidOverlappingEdits(e.textDocument,a)}avoidOverlappingEdits(e,n){const r=[];for(const i of n){let s=r[r.length-1];for(;s;){const a=e.offsetAt(i.range.start),o=e.offsetAt(s.range.end);if(a<o)r.pop(),s=r[r.length-1];else break}r.push(i)}return r.filter(i=>this.isNecessary(i,e))}iterateAstFormatting(e,n){const r=e.parseResult.value;this.format(r);const i=Cr(r).iterator();let s;do if(s=i.next(),!s.done){const a=s.value;this.insideRange(a.$cstNode.range,n)?this.format(a):i.prune()}while(!s.done)}nodeModeToKey(e,n){return`${e.offset}:${e.end}:${n}`}insideRange(e,n){return!n||e.start.line<=n.start.line&&e.end.line>=n.end.line||e.start.line>=n.start.line&&e.end.line<=n.end.line||e.start.line<=n.end.line&&e.end.line>=n.end.line}isNecessary(e,n){return e.newText!==n.getText(e.range).replace(/\r/g,"")}iterateCstFormatting(e,n,r,i){const s={indentation:0,options:r,document:e.textDocument},a=[],u=this.iterateCstTree(e,s).iterator();let c,l;do if(l=u.next(),!l.done){const d=l.value,f=ps(d),p=this.nodeModeToKey(d,"prepend"),h=n.get(p);if(n.delete(p),h){const w=this.createTextEdit(c,d,h,s);for(const E of w)E&&this.insideRange(E.range,i)&&a.push(E)}const y=this.nodeModeToKey(d,"append"),b=n.get(y);if(n.delete(y),b){const w=tE(d);if(w){const E=this.createTextEdit(d,w,b,s);for(const $ of E)$&&this.insideRange($.range,i)&&a.push($)}}if(!h&&d.hidden){const w=this.createHiddenTextEdits(c,d,void 0,s);for(const E of w)E&&this.insideRange(E.range,i)&&a.push(E)}f&&(c=d)}while(!l.done);return a}createHiddenTextEdits(e,n,r,i){var s;const a=n.range.start.line;if(e&&e.range.end.line===a)return[];const o=[],u={start:{character:0,line:a},end:n.range.start},c=i.document.getText(u),l=this.findFittingMove(u,(s=r?.moves)!==null&&s!==void 0?s:[],i),d=this.getExistingIndentationCharacterCount(c,i),p=this.getIndentationCharacterCount(i,l)-d;if(p===0)return[];let h="";p>0&&(h=(i.options.insertSpaces?" ":" ").repeat(p));const y=n.text.split(`
161
+ `);y[0]=c+y[0];for(let b=0;b<y.length;b++){const w=a+b,E={character:0,line:w};if(p>0)o.push({newText:h,range:{start:E,end:E}});else{const $=y[b];let k=0;for(;k<$.length;k++){const A=$.charAt(k);if(A!==" "&&A!==" ")break}o.push({newText:"",range:{start:E,end:{line:w,character:Math.min(k,Math.abs(p))}}})}}return o}getExistingIndentationCharacterCount(e,n){const r=" ".repeat(n.options.tabSize);return(n.options.insertSpaces?e.replaceAll(" ",r):e.replaceAll(r," ")).length}getIndentationCharacterCount(e,n){let r=e.indentation;return n&&n.tabs&&(r+=n.tabs),(e.options.insertSpaces?e.options.tabSize:1)*r}createTextEdit(e,n,r,i){var s;if(n.hidden)return this.createHiddenTextEdits(e,n,r,i);if(e&&(e.range.end.line>n.range.start.line||e.range.end.line===n.range.start.line&&e.range.end.character>n.range.start.character))return[];const a={start:(s=e?.range.end)!==null&&s!==void 0?s:{character:0,line:0},end:n.range.start},o=this.findFittingMove(a,r.moves,i);if(!o)return[];const u=o.characters,c=o.lines,l=o.tabs,d=i.indentation;i.indentation+=l??0;const f=[];return u!==void 0?e?.hidden||f.push(this.createSpaceTextEdit(a,u,r.options)):c!==void 0?f.push(this.createLineTextEdit(a,c,i,r.options)):l!==void 0&&f.push(this.createTabTextEdit(a,!!e,i)),ps(n)&&(i.indentation=d),f}createSpaceTextEdit(e,n,r){if(e.start.line===e.end.line){const s=e.end.character-e.start.character;n=this.fitIntoOptions(n,s,r)}return{newText:" ".repeat(n),range:e}}createLineTextEdit(e,n,r,i){const s=e.end.line-e.start.line;n=this.fitIntoOptions(n,s,i);const o=(r.options.insertSpaces?" ".repeat(r.options.tabSize):" ").repeat(r.indentation);return{newText:`${`
162
+ `.repeat(n)}${o}`,range:e}}createTabTextEdit(e,n,r){const s=(r.options.insertSpaces?" ".repeat(r.options.tabSize):" ").repeat(r.indentation),a=n?1:0,o=Math.max(e.end.line-e.start.line,a);return{newText:`${`
163
+ `.repeat(o)}${s}`,range:e}}fitIntoOptions(e,n,r){return r.allowMore?e=Math.max(n,e):r.allowLess&&(e=Math.min(n,e)),e}findFittingMove(e,n,r){if(n.length===0)return;if(n.length===1)return n[0];const i=e.end.line-e.start.line;for(const s of n){if(s.lines!==void 0&&i<=s.lines)return s;if(s.lines===void 0&&i===0)return s}return n[n.length-1]}iterateCstTree(e,n){const i=e.parseResult.value.$cstNode;return i?new Sa(i,s=>this.iterateCst(s,n)):$a}iterateCst(e,n){if(!Si(e))return $a;const r=n.indentation;return new Ot(()=>({index:0}),i=>i.index<e.content.length?{done:!1,value:e.content[i.index++]}:(n.indentation=r,tn))}}class IU{constructor(e,n){this.astNode=e,this.collector=n}node(e){return new br(e.$cstNode?[e.$cstNode]:[],this.collector)}nodes(...e){const n=[];for(const r of e)r.$cstNode&&n.push(r.$cstNode);return new br(n,this.collector)}property(e,n){const r=sn(this.astNode.$cstNode,e,n);return new br(r?[r]:[],this.collector)}properties(...e){const n=[];for(const r of e){const i=Ca(this.astNode.$cstNode,r);n.push(...i)}return new br(n,this.collector)}keyword(e,n){const r=gu(this.astNode.$cstNode,e,n);return new br(r?[r]:[],this.collector)}keywords(...e){const n=[];for(const r of e){const i=$g(this.astNode.$cstNode,r);n.push(...i)}return new br(n,this.collector)}cst(e){return new br([...e],this.collector)}interior(e,n){const r=e.nodes,i=n.nodes;if(r.length!==1||i.length!==1)return new br([],this.collector);let s=r[0],a=i[0];if(s.offset>a.offset){const o=s;s=a,a=o}return new br(nE(s,a),this.collector)}}class br{constructor(e,n){this.nodes=e,this.collector=n}prepend(e){for(const n of this.nodes)this.collector(n,"prepend",e);return this}append(e){for(const n of this.nodes)this.collector(n,"append",e);return this}surround(e){for(const n of this.nodes)this.collector(n,"prepend",e),this.collector(n,"append",e);return this}slice(e,n){return new br(this.nodes.slice(e,n),this.collector)}}var Li;(function(t){function e(...l){return{options:{},moves:l.flatMap(d=>d.moves).sort(c)}}t.fit=e;function n(l){return i(0,l)}t.noSpace=n;function r(l){return i(1,l)}t.oneSpace=r;function i(l,d){return{options:d??{},moves:[{characters:l}]}}t.spaces=i;function s(l){return a(1,l)}t.newLine=s;function a(l,d){return{options:d??{},moves:[{lines:l}]}}t.newLines=a;function o(l){return{options:l??{},moves:[{tabs:1,lines:1}]}}t.indent=o;function u(l){return{options:l??{},moves:[{tabs:0}]}}t.noIndent=u;function c(l,d){var f,p,h,y,b,w;const E=(f=l.lines)!==null&&f!==void 0?f:0,$=(p=d.lines)!==null&&p!==void 0?p:0,k=(h=l.tabs)!==null&&h!==void 0?h:0,A=(y=d.tabs)!==null&&y!==void 0?y:0,I=(b=l.characters)!==null&&b!==void 0?b:0,M=(w=d.characters)!==null&&w!==void 0?w:0;return E<$?-1:E>$?1:k<A?-1:k>A?1:I<M?-1:I>M?1:0}})(Li||(Li={}));var yw,kC;function NU(){return kC||(kC=1,yw=mC()),yw}NU();var Us={},Ec={},Rc={},Ws={},pr={},hi={},CC;function AC(){if(CC)return hi;CC=1,Object.defineProperty(hi,"__esModule",{value:!0}),hi.normalizePath=hi.convertSlashes=hi.cleanPath=void 0;const t=$r;function e(s){let a=(0,t.normalize)(s);return a.length>1&&a[a.length-1]===t.sep&&(a=a.substring(0,a.length-1)),a}hi.cleanPath=e;const n=/[\\/]/g;function r(s,a){return s.replace(n,a)}hi.convertSlashes=r;function i(s,a){const{resolvePaths:o,normalizePath:u,pathSeparator:c}=a,l=process.platform==="win32"&&s.includes("/")||s.startsWith(".");if(o&&(s=(0,t.resolve)(s)),(u||l)&&(s=e(s)),s===".")return"";const d=s[s.length-1]!==c;return r(d?s+c:s,c)}return hi.normalizePath=i,hi}var mi={},_C;function OU(){if(_C)return mi;_C=1,Object.defineProperty(mi,"__esModule",{value:!0}),mi.build=mi.joinDirectoryPath=mi.joinPathWithBasePath=void 0;const t=$r,e=AC();function n(o,u){return u+o}mi.joinPathWithBasePath=n;function r(o,u){return function(c,l){return l.startsWith(o)?l.replace(o,"")+c:(0,e.convertSlashes)((0,t.relative)(o,l),u.pathSeparator)+u.pathSeparator+c}}function i(o){return o}function s(o,u,c){return u+o+c}mi.joinDirectoryPath=s;function a(o,u){const{relativePaths:c,includeBasePath:l}=u;return c&&o?r(o,u):l?n:i}return mi.build=a,mi}var $c={},PC;function FU(){if(PC)return $c;PC=1,Object.defineProperty($c,"__esModule",{value:!0}),$c.build=void 0;function t(a){return function(o,u){u.push(o.substring(a.length)||".")}}function e(a){return function(o,u,c){const l=o.substring(a.length)||".";c.every(d=>d(l,!0))&&u.push(l)}}const n=(a,o)=>{o.push(a||".")},r=(a,o,u)=>{const c=a||".";u.every(l=>l(c,!0))&&o.push(c)},i=()=>{};function s(a,o){const{includeDirs:u,filters:c,relativePaths:l}=o;return u?l?c&&c.length?e(a):t(a):c&&c.length?r:n:i}return $c.build=s,$c}var Sc={},xC;function LU(){if(xC)return Sc;xC=1,Object.defineProperty(Sc,"__esModule",{value:!0}),Sc.build=void 0;const t=(a,o,u,c)=>{c.every(l=>l(a,!1))&&u.files++},e=(a,o,u,c)=>{c.every(l=>l(a,!1))&&o.push(a)},n=(a,o,u,c)=>{u.files++},r=(a,o)=>{o.push(a)},i=()=>{};function s(a){const{excludeFiles:o,filters:u,onlyCounts:c}=a;return o?i:u&&u.length?c?t:e:c?n:r}return Sc.build=s,Sc}var Tc={},IC;function MU(){if(IC)return Tc;IC=1,Object.defineProperty(Tc,"__esModule",{value:!0}),Tc.build=void 0;const t=r=>r,e=()=>[""].slice(0,0);function n(r){return r.group?e:t}return Tc.build=n,Tc}var kc={},NC;function zU(){if(NC)return kc;NC=1,Object.defineProperty(kc,"__esModule",{value:!0}),kc.build=void 0;const t=(r,i,s)=>{r.push({directory:i,files:s,dir:i})},e=()=>{};function n(r){return r.group?t:e}return kc.build=n,kc}var Hs={},OC;function BU(){if(OC)return Hs;OC=1;var t=Hs&&Hs.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(Hs,"__esModule",{value:!0}),Hs.build=void 0;const e=t(Ea),n=$r,r=function(u,c,l){const{queue:d,options:{suppressErrors:f}}=c;d.enqueue(),e.default.realpath(u,(p,h)=>{if(p)return d.dequeue(f?null:p,c);e.default.stat(h,(y,b)=>{if(y)return d.dequeue(f?null:y,c);if(b.isDirectory()&&a(u,h,c))return d.dequeue(null,c);l(b,h),d.dequeue(null,c)})})},i=function(u,c,l){const{queue:d,options:{suppressErrors:f}}=c;d.enqueue();try{const p=e.default.realpathSync(u),h=e.default.statSync(p);if(h.isDirectory()&&a(u,p,c))return;l(h,p)}catch(p){if(!f)throw p}};function s(u,c){return!u.resolveSymlinks||u.excludeSymlinks?null:c?i:r}Hs.build=s;function a(u,c,l){if(l.options.useRealPaths)return o(c,l);let d=(0,n.dirname)(u),f=1;for(;d!==l.root&&f<2;){const p=l.symlinks.get(d);!!p&&(p===c||p.startsWith(c)||c.startsWith(p))?f++:d=(0,n.dirname)(d)}return l.symlinks.set(u,c),f>1}function o(u,c){return c.visited.includes(u+c.options.pathSeparator)}return Hs}var Cc={},FC;function qU(){if(FC)return Cc;FC=1,Object.defineProperty(Cc,"__esModule",{value:!0}),Cc.build=void 0;const t=l=>l.counts,e=l=>l.groups,n=l=>l.paths,r=l=>l.paths.slice(0,l.options.maxFiles),i=(l,d,f)=>(u(d,f,l.counts,l.options.suppressErrors),null),s=(l,d,f)=>(u(d,f,l.paths,l.options.suppressErrors),null),a=(l,d,f)=>(u(d,f,l.paths.slice(0,l.options.maxFiles),l.options.suppressErrors),null),o=(l,d,f)=>(u(d,f,l.groups,l.options.suppressErrors),null);function u(l,d,f,p){d(l&&!p?l:null,f)}function c(l,d){const{onlyCounts:f,group:p,maxFiles:h}=l;return f?d?t:i:p?d?e:o:h?d?r:a:d?n:s}return Cc.build=c,Cc}var Vs={},LC;function GU(){if(LC)return Vs;LC=1;var t=Vs&&Vs.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Vs,"__esModule",{value:!0}),Vs.build=void 0;const e=t(Ea),n={withFileTypes:!0},r=(a,o,u,c,l)=>{if(c<0)return a.queue.dequeue(null,a);a.visited.push(o),a.counts.directories++,a.queue.enqueue(),e.default.readdir(o||".",n,(d,f=[])=>{l(f,u,c),a.queue.dequeue(a.options.suppressErrors?null:d,a)})},i=(a,o,u,c,l)=>{if(c<0)return;a.visited.push(o),a.counts.directories++;let d=[];try{d=e.default.readdirSync(o||".",n)}catch(f){if(!a.options.suppressErrors)throw f}l(d,u,c)};function s(a){return a?i:r}return Vs.build=s,Vs}var Ac={},MC;function jU(){if(MC)return Ac;MC=1,Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.Queue=void 0;class t{onQueueEmpty;count=0;constructor(n){this.onQueueEmpty=n}enqueue(){this.count++}dequeue(n,r){(--this.count<=0||n)&&this.onQueueEmpty(n,r)}}return Ac.Queue=t,Ac}var _c={},zC;function UU(){if(zC)return _c;zC=1,Object.defineProperty(_c,"__esModule",{value:!0}),_c.Counter=void 0;class t{_files=0;_directories=0;set files(n){this._files=n}get files(){return this._files}set directories(n){this._directories=n}get directories(){return this._directories}get dirs(){return this._directories}}return _c.Counter=t,_c}var BC;function qC(){if(BC)return pr;BC=1;var t=pr&&pr.__createBinding||(Object.create?function(b,w,E,$){$===void 0&&($=E);var k=Object.getOwnPropertyDescriptor(w,E);(!k||("get"in k?!w.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return w[E]}}),Object.defineProperty(b,$,k)}:function(b,w,E,$){$===void 0&&($=E),b[$]=w[E]}),e=pr&&pr.__setModuleDefault||(Object.create?function(b,w){Object.defineProperty(b,"default",{enumerable:!0,value:w})}:function(b,w){b.default=w}),n=pr&&pr.__importStar||function(b){if(b&&b.__esModule)return b;var w={};if(b!=null)for(var E in b)E!=="default"&&Object.prototype.hasOwnProperty.call(b,E)&&t(w,b,E);return e(w,b),w};Object.defineProperty(pr,"__esModule",{value:!0}),pr.Walker=void 0;const r=$r,i=AC(),s=n(OU()),a=n(FU()),o=n(LU()),u=n(MU()),c=n(zU()),l=n(BU()),d=n(qU()),f=n(GU()),p=jU(),h=UU();class y{root;isSynchronous;state;joinPath;pushDirectory;pushFile;getArray;groupFiles;resolveSymlink;walkDirectory;callbackInvoker;constructor(w,E,$){this.isSynchronous=!$,this.callbackInvoker=d.build(E,this.isSynchronous),this.root=(0,i.normalizePath)(w,E),this.state={root:this.root.slice(0,-1),paths:[""].slice(0,0),groups:[],counts:new h.Counter,options:E,queue:new p.Queue((k,A)=>this.callbackInvoker(A,k,$)),symlinks:new Map,visited:[""].slice(0,0)},this.joinPath=s.build(this.root,E),this.pushDirectory=a.build(this.root,E),this.pushFile=o.build(E),this.getArray=u.build(E),this.groupFiles=c.build(E),this.resolveSymlink=l.build(E,this.isSynchronous),this.walkDirectory=f.build(this.isSynchronous)}start(){return this.walkDirectory(this.state,this.root,this.root,this.state.options.maxDepth,this.walk),this.isSynchronous?this.callbackInvoker(this.state,null):null}walk=(w,E,$)=>{const{paths:k,options:{filters:A,resolveSymlinks:I,excludeSymlinks:M,exclude:Y,maxFiles:Q,signal:ae,useRealPaths:O,pathSeparator:T}}=this.state;if(ae&&ae.aborted||Q&&k.length>Q)return;this.pushDirectory(E,k,A);const R=this.getArray(this.state.paths);for(let F=0;F<w.length;++F){const V=w[F];if(V.isFile()||V.isSymbolicLink()&&!I&&!M){const W=this.joinPath(V.name,E);this.pushFile(W,R,this.state.counts,A)}else if(V.isDirectory()){let W=s.joinDirectoryPath(V.name,E,this.state.options.pathSeparator);if(Y&&Y(V.name,W))continue;this.walkDirectory(this.state,W,W,$-1,this.walk)}else if(V.isSymbolicLink()&&this.resolveSymlink){let W=s.joinPathWithBasePath(V.name,E);this.resolveSymlink(W,this.state,(H,Ee)=>{if(H.isDirectory()){if(Ee=(0,i.normalizePath)(Ee,this.state.options),Y&&Y(V.name,O?Ee:W+T))return;this.walkDirectory(this.state,Ee,O?Ee:W+T,$-1,this.walk)}else{Ee=O?Ee:W;const te=(0,r.basename)(Ee),C=(0,i.normalizePath)((0,r.dirname)(Ee),this.state.options);Ee=this.joinPath(te,C),this.pushFile(Ee,R,this.state.counts,A)}})}}this.groupFiles(this.state.groups,E,R)}}return pr.Walker=y,pr}var GC;function WU(){if(GC)return Ws;GC=1,Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.callback=Ws.promise=void 0;const t=qC();function e(r,i){return new Promise((s,a)=>{n(r,i,(o,u)=>{if(o)return a(o);s(u)})})}Ws.promise=e;function n(r,i,s){new t.Walker(r,i,s).start()}return Ws.callback=n,Ws}var Pc={},jC;function HU(){if(jC)return Pc;jC=1,Object.defineProperty(Pc,"__esModule",{value:!0}),Pc.sync=void 0;const t=qC();function e(n,r){return new t.Walker(n,r).start()}return Pc.sync=e,Pc}var UC;function VU(){if(UC)return Rc;UC=1,Object.defineProperty(Rc,"__esModule",{value:!0}),Rc.APIBuilder=void 0;const t=WU(),e=HU();class n{root;options;constructor(i,s){this.root=i,this.options=s}withPromise(){return(0,t.promise)(this.root,this.options)}withCallback(i){(0,t.callback)(this.root,this.options,i)}sync(){return(0,e.sync)(this.root,this.options)}}return Rc.APIBuilder=n,Rc}var ww={},vw,WC;function xp(){if(WC)return vw;WC=1;const t="\\\\/",e=`[^${t}]`,n="\\.",r="\\+",i="\\?",s="\\/",a="(?=.)",o="[^/]",u=`(?:${s}|$)`,c=`(?:^|${s})`,l=`${n}{1,2}${u}`,d=`(?!${n})`,f=`(?!${c}${l})`,p=`(?!${n}{0,1}${u})`,h=`(?!${l})`,y=`[^.${s}]`,b=`${o}*?`,E={DOT_LITERAL:n,PLUS_LITERAL:r,QMARK_LITERAL:i,SLASH_LITERAL:s,ONE_CHAR:a,QMARK:o,END_ANCHOR:u,DOTS_SLASH:l,NO_DOT:d,NO_DOTS:f,NO_DOT_SLASH:p,NO_DOTS_SLASH:h,QMARK_NO_DOT:y,STAR:b,START_ANCHOR:c,SEP:"/"},$={...E,SLASH_LITERAL:`[${t}]`,QMARK:e,STAR:`${e}*?`,DOTS_SLASH:`${n}{1,2}(?:[${t}]|$)`,NO_DOT:`(?!${n})`,NO_DOTS:`(?!(?:^|[${t}])${n}{1,2}(?:[${t}]|$))`,NO_DOT_SLASH:`(?!${n}{0,1}(?:[${t}]|$))`,NO_DOTS_SLASH:`(?!${n}{1,2}(?:[${t}]|$))`,QMARK_NO_DOT:`[^.${t}]`,START_ANCHOR:`(?:^|[${t}])`,END_ANCHOR:`(?:[${t}]|$)`,SEP:"\\"},k={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return vw={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:k,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(A){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${A.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(A){return A===!0?$:E}},vw}var HC;function Ip(){return HC||(HC=1,function(t){const{REGEX_BACKSLASH:e,REGEX_REMOVE_BACKSLASH:n,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:i}=xp();t.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),t.hasRegexChars=s=>r.test(s),t.isRegexChar=s=>s.length===1&&t.hasRegexChars(s),t.escapeRegex=s=>s.replace(i,"\\$1"),t.toPosixSlashes=s=>s.replace(e,"/"),t.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const s=navigator.platform.toLowerCase();return s==="win32"||s==="windows"}return typeof process<"u"&&process.platform?process.platform==="win32":!1},t.removeBackslashes=s=>s.replace(n,a=>a==="\\"?"":a),t.escapeLast=(s,a,o)=>{const u=s.lastIndexOf(a,o);return u===-1?s:s[u-1]==="\\"?t.escapeLast(s,a,u-1):`${s.slice(0,u)}\\${s.slice(u)}`},t.removePrefix=(s,a={})=>{let o=s;return o.startsWith("./")&&(o=o.slice(2),a.prefix="./"),o},t.wrapOutput=(s,a={},o={})=>{const u=o.contains?"":"^",c=o.contains?"":"$";let l=`${u}(?:${s})${c}`;return a.negated===!0&&(l=`(?:^(?!${l}).*$)`),l},t.basename=(s,{windows:a}={})=>{const o=s.split(a?/[\\/]/:"/"),u=o[o.length-1];return u===""?o[o.length-2]:u}}(ww)),ww}var bw,VC;function KU(){if(VC)return bw;VC=1;const t=Ip(),{CHAR_ASTERISK:e,CHAR_AT:n,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:i,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:a,CHAR_FORWARD_SLASH:o,CHAR_LEFT_CURLY_BRACE:u,CHAR_LEFT_PARENTHESES:c,CHAR_LEFT_SQUARE_BRACKET:l,CHAR_PLUS:d,CHAR_QUESTION_MARK:f,CHAR_RIGHT_CURLY_BRACE:p,CHAR_RIGHT_PARENTHESES:h,CHAR_RIGHT_SQUARE_BRACKET:y}=xp(),b=$=>$===o||$===r,w=$=>{$.isPrefix!==!0&&($.depth=$.isGlobstar?1/0:1)};return bw=($,k)=>{const A=k||{},I=$.length-1,M=A.parts===!0||A.scanToEnd===!0,Y=[],Q=[],ae=[];let O=$,T=-1,R=0,F=0,V=!1,W=!1,H=!1,Ee=!1,te=!1,C=!1,me=!1,ke=!1,at=!1,j=!1,K=0,Fe,ue,be={value:"",depth:0,isGlob:!1};const Ce=()=>T>=I,ce=()=>O.charCodeAt(T+1),x=()=>(Fe=ue,O.charCodeAt(++T));for(;T<I;){ue=x();let Ge;if(ue===r){me=be.backslashes=!0,ue=x(),ue===u&&(C=!0);continue}if(C===!0||ue===u){for(K++;Ce()!==!0&&(ue=x());){if(ue===r){me=be.backslashes=!0,x();continue}if(ue===u){K++;continue}if(C!==!0&&ue===s&&(ue=x())===s){if(V=be.isBrace=!0,H=be.isGlob=!0,j=!0,M===!0)continue;break}if(C!==!0&&ue===i){if(V=be.isBrace=!0,H=be.isGlob=!0,j=!0,M===!0)continue;break}if(ue===p&&(K--,K===0)){C=!1,V=be.isBrace=!0,j=!0;break}}if(M===!0)continue;break}if(ue===o){if(Y.push(T),Q.push(be),be={value:"",depth:0,isGlob:!1},j===!0)continue;if(Fe===s&&T===R+1){R+=2;continue}F=T+1;continue}if(A.noext!==!0&&(ue===d||ue===n||ue===e||ue===f||ue===a)===!0&&ce()===c){if(H=be.isGlob=!0,Ee=be.isExtglob=!0,j=!0,ue===a&&T===R&&(at=!0),M===!0){for(;Ce()!==!0&&(ue=x());){if(ue===r){me=be.backslashes=!0,ue=x();continue}if(ue===h){H=be.isGlob=!0,j=!0;break}}continue}break}if(ue===e){if(Fe===e&&(te=be.isGlobstar=!0),H=be.isGlob=!0,j=!0,M===!0)continue;break}if(ue===f){if(H=be.isGlob=!0,j=!0,M===!0)continue;break}if(ue===l){for(;Ce()!==!0&&(Ge=x());){if(Ge===r){me=be.backslashes=!0,x();continue}if(Ge===y){W=be.isBracket=!0,H=be.isGlob=!0,j=!0;break}}if(M===!0)continue;break}if(A.nonegate!==!0&&ue===a&&T===R){ke=be.negated=!0,R++;continue}if(A.noparen!==!0&&ue===c){if(H=be.isGlob=!0,M===!0){for(;Ce()!==!0&&(ue=x());){if(ue===c){me=be.backslashes=!0,ue=x();continue}if(ue===h){j=!0;break}}continue}break}if(H===!0){if(j=!0,M===!0)continue;break}}A.noext===!0&&(Ee=!1,H=!1);let B=O,de="",q="";R>0&&(de=O.slice(0,R),O=O.slice(R),F-=R),B&&H===!0&&F>0?(B=O.slice(0,F),q=O.slice(F)):H===!0?(B="",q=O):B=O,B&&B!==""&&B!=="/"&&B!==O&&b(B.charCodeAt(B.length-1))&&(B=B.slice(0,-1)),A.unescape===!0&&(q&&(q=t.removeBackslashes(q)),B&&me===!0&&(B=t.removeBackslashes(B)));const le={prefix:de,input:$,start:R,base:B,glob:q,isBrace:V,isBracket:W,isGlob:H,isExtglob:Ee,isGlobstar:te,negated:ke,negatedExtglob:at};if(A.tokens===!0&&(le.maxDepth=0,b(ue)||Q.push(be),le.tokens=Q),A.parts===!0||A.tokens===!0){let Ge;for(let et=0;et<Y.length;et++){const oe=Ge?Ge+1:R,xe=Y[et],ne=$.slice(oe,xe);A.tokens&&(et===0&&R!==0?(Q[et].isPrefix=!0,Q[et].value=de):Q[et].value=ne,w(Q[et]),le.maxDepth+=Q[et].depth),(et!==0||ne!=="")&&ae.push(ne),Ge=xe}if(Ge&&Ge+1<$.length){const et=$.slice(Ge+1);ae.push(et),A.tokens&&(Q[Q.length-1].value=et,w(Q[Q.length-1]),le.maxDepth+=Q[Q.length-1].depth)}le.slashes=Y,le.parts=ae}return le},bw}var Dw,KC;function YU(){if(KC)return Dw;KC=1;const t=xp(),e=Ip(),{MAX_LENGTH:n,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:i,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:a}=t,o=(l,d)=>{if(typeof d.expandRange=="function")return d.expandRange(...l,d);l.sort();const f=`[${l.join("-")}]`;try{new RegExp(f)}catch{return l.map(h=>e.escapeRegex(h)).join("..")}return f},u=(l,d)=>`Missing ${l}: "${d}" - use "\\\\${d}" to match literal characters`,c=(l,d)=>{if(typeof l!="string")throw new TypeError("Expected a string");l=a[l]||l;const f={...d},p=typeof f.maxLength=="number"?Math.min(n,f.maxLength):n;let h=l.length;if(h>p)throw new SyntaxError(`Input length: ${h}, exceeds maximum allowed length: ${p}`);const y={type:"bos",value:"",output:f.prepend||""},b=[y],w=f.capture?"":"?:",E=t.globChars(f.windows),$=t.extglobChars(E),{DOT_LITERAL:k,PLUS_LITERAL:A,SLASH_LITERAL:I,ONE_CHAR:M,DOTS_SLASH:Y,NO_DOT:Q,NO_DOT_SLASH:ae,NO_DOTS_SLASH:O,QMARK:T,QMARK_NO_DOT:R,STAR:F,START_ANCHOR:V}=E,W=oe=>`(${w}(?:(?!${V}${oe.dot?Y:k}).)*?)`,H=f.dot?"":Q,Ee=f.dot?T:R;let te=f.bash===!0?W(f):F;f.capture&&(te=`(${te})`),typeof f.noext=="boolean"&&(f.noextglob=f.noext);const C={input:l,index:-1,start:0,dot:f.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:b};l=e.removePrefix(l,C),h=l.length;const me=[],ke=[],at=[];let j=y,K;const Fe=()=>C.index===h-1,ue=C.peek=(oe=1)=>l[C.index+oe],be=C.advance=()=>l[++C.index]||"",Ce=()=>l.slice(C.index+1),ce=(oe="",xe=0)=>{C.consumed+=oe,C.index+=xe},x=oe=>{C.output+=oe.output!=null?oe.output:oe.value,ce(oe.value)},B=()=>{let oe=1;for(;ue()==="!"&&(ue(2)!=="("||ue(3)==="?");)be(),C.start++,oe++;return oe%2===0?!1:(C.negated=!0,C.start++,!0)},de=oe=>{C[oe]++,at.push(oe)},q=oe=>{C[oe]--,at.pop()},le=oe=>{if(j.type==="globstar"){const xe=C.braces>0&&(oe.type==="comma"||oe.type==="brace"),ne=oe.extglob===!0||me.length&&(oe.type==="pipe"||oe.type==="paren");oe.type!=="slash"&&oe.type!=="paren"&&!xe&&!ne&&(C.output=C.output.slice(0,-j.output.length),j.type="star",j.value="*",j.output=te,C.output+=j.output)}if(me.length&&oe.type!=="paren"&&(me[me.length-1].inner+=oe.value),(oe.value||oe.output)&&x(oe),j&&j.type==="text"&&oe.type==="text"){j.output=(j.output||j.value)+oe.value,j.value+=oe.value;return}oe.prev=j,b.push(oe),j=oe},Ge=(oe,xe)=>{const ne={...$[xe],conditions:1,inner:""};ne.prev=j,ne.parens=C.parens,ne.output=C.output;const De=(f.capture?"(":"")+ne.open;de("parens"),le({type:oe,value:xe,output:C.output?"":M}),le({type:"paren",extglob:!0,value:be(),output:De}),me.push(ne)},et=oe=>{let xe=oe.close+(f.capture?")":""),ne;if(oe.type==="negate"){let De=te;if(oe.inner&&oe.inner.length>1&&oe.inner.includes("/")&&(De=W(f)),(De!==te||Fe()||/^\)+$/.test(Ce()))&&(xe=oe.close=`)$))${De}`),oe.inner.includes("*")&&(ne=Ce())&&/^\.[^\\/.]+$/.test(ne)){const ze=c(ne,{...d,fastpaths:!1}).output;xe=oe.close=`)${ze})${De})`}oe.prev.type==="bos"&&(C.negatedExtglob=!0)}le({type:"paren",extglob:!0,value:K,output:xe}),q("parens")};if(f.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(l)){let oe=!1,xe=l.replace(s,(ne,De,ze,ht,Ye,qt)=>ht==="\\"?(oe=!0,ne):ht==="?"?De?De+ht+(Ye?T.repeat(Ye.length):""):qt===0?Ee+(Ye?T.repeat(Ye.length):""):T.repeat(ze.length):ht==="."?k.repeat(ze.length):ht==="*"?De?De+ht+(Ye?te:""):te:De?ne:`\\${ne}`);return oe===!0&&(f.unescape===!0?xe=xe.replace(/\\/g,""):xe=xe.replace(/\\+/g,ne=>ne.length%2===0?"\\\\":ne?"\\":"")),xe===l&&f.contains===!0?(C.output=l,C):(C.output=e.wrapOutput(xe,C,d),C)}for(;!Fe();){if(K=be(),K==="\0")continue;if(K==="\\"){const ne=ue();if(ne==="/"&&f.bash!==!0||ne==="."||ne===";")continue;if(!ne){K+="\\",le({type:"text",value:K});continue}const De=/^\\+/.exec(Ce());let ze=0;if(De&&De[0].length>2&&(ze=De[0].length,C.index+=ze,ze%2!==0&&(K+="\\")),f.unescape===!0?K=be():K+=be(),C.brackets===0){le({type:"text",value:K});continue}}if(C.brackets>0&&(K!=="]"||j.value==="["||j.value==="[^")){if(f.posix!==!1&&K===":"){const ne=j.value.slice(1);if(ne.includes("[")&&(j.posix=!0,ne.includes(":"))){const De=j.value.lastIndexOf("["),ze=j.value.slice(0,De),ht=j.value.slice(De+2),Ye=r[ht];if(Ye){j.value=ze+Ye,C.backtrack=!0,be(),!y.output&&b.indexOf(j)===1&&(y.output=M);continue}}}(K==="["&&ue()!==":"||K==="-"&&ue()==="]")&&(K=`\\${K}`),K==="]"&&(j.value==="["||j.value==="[^")&&(K=`\\${K}`),f.posix===!0&&K==="!"&&j.value==="["&&(K="^"),j.value+=K,x({value:K});continue}if(C.quotes===1&&K!=='"'){K=e.escapeRegex(K),j.value+=K,x({value:K});continue}if(K==='"'){C.quotes=C.quotes===1?0:1,f.keepQuotes===!0&&le({type:"text",value:K});continue}if(K==="("){de("parens"),le({type:"paren",value:K});continue}if(K===")"){if(C.parens===0&&f.strictBrackets===!0)throw new SyntaxError(u("opening","("));const ne=me[me.length-1];if(ne&&C.parens===ne.parens+1){et(me.pop());continue}le({type:"paren",value:K,output:C.parens?")":"\\)"}),q("parens");continue}if(K==="["){if(f.nobracket===!0||!Ce().includes("]")){if(f.nobracket!==!0&&f.strictBrackets===!0)throw new SyntaxError(u("closing","]"));K=`\\${K}`}else de("brackets");le({type:"bracket",value:K});continue}if(K==="]"){if(f.nobracket===!0||j&&j.type==="bracket"&&j.value.length===1){le({type:"text",value:K,output:`\\${K}`});continue}if(C.brackets===0){if(f.strictBrackets===!0)throw new SyntaxError(u("opening","["));le({type:"text",value:K,output:`\\${K}`});continue}q("brackets");const ne=j.value.slice(1);if(j.posix!==!0&&ne[0]==="^"&&!ne.includes("/")&&(K=`/${K}`),j.value+=K,x({value:K}),f.literalBrackets===!1||e.hasRegexChars(ne))continue;const De=e.escapeRegex(j.value);if(C.output=C.output.slice(0,-j.value.length),f.literalBrackets===!0){C.output+=De,j.value=De;continue}j.value=`(${w}${De}|${j.value})`,C.output+=j.value;continue}if(K==="{"&&f.nobrace!==!0){de("braces");const ne={type:"brace",value:K,output:"(",outputIndex:C.output.length,tokensIndex:C.tokens.length};ke.push(ne),le(ne);continue}if(K==="}"){const ne=ke[ke.length-1];if(f.nobrace===!0||!ne){le({type:"text",value:K,output:K});continue}let De=")";if(ne.dots===!0){const ze=b.slice(),ht=[];for(let Ye=ze.length-1;Ye>=0&&(b.pop(),ze[Ye].type!=="brace");Ye--)ze[Ye].type!=="dots"&&ht.unshift(ze[Ye].value);De=o(ht,f),C.backtrack=!0}if(ne.comma!==!0&&ne.dots!==!0){const ze=C.output.slice(0,ne.outputIndex),ht=C.tokens.slice(ne.tokensIndex);ne.value=ne.output="\\{",K=De="\\}",C.output=ze;for(const Ye of ht)C.output+=Ye.output||Ye.value}le({type:"brace",value:K,output:De}),q("braces"),ke.pop();continue}if(K==="|"){me.length>0&&me[me.length-1].conditions++,le({type:"text",value:K});continue}if(K===","){let ne=K;const De=ke[ke.length-1];De&&at[at.length-1]==="braces"&&(De.comma=!0,ne="|"),le({type:"comma",value:K,output:ne});continue}if(K==="/"){if(j.type==="dot"&&C.index===C.start+1){C.start=C.index+1,C.consumed="",C.output="",b.pop(),j=y;continue}le({type:"slash",value:K,output:I});continue}if(K==="."){if(C.braces>0&&j.type==="dot"){j.value==="."&&(j.output=k);const ne=ke[ke.length-1];j.type="dots",j.output+=K,j.value+=K,ne.dots=!0;continue}if(C.braces+C.parens===0&&j.type!=="bos"&&j.type!=="slash"){le({type:"text",value:K,output:k});continue}le({type:"dot",value:K,output:k});continue}if(K==="?"){if(!(j&&j.value==="(")&&f.noextglob!==!0&&ue()==="("&&ue(2)!=="?"){Ge("qmark",K);continue}if(j&&j.type==="paren"){const De=ue();let ze=K;(j.value==="("&&!/[!=<:]/.test(De)||De==="<"&&!/<([!=]|\w+>)/.test(Ce()))&&(ze=`\\${K}`),le({type:"text",value:K,output:ze});continue}if(f.dot!==!0&&(j.type==="slash"||j.type==="bos")){le({type:"qmark",value:K,output:R});continue}le({type:"qmark",value:K,output:T});continue}if(K==="!"){if(f.noextglob!==!0&&ue()==="("&&(ue(2)!=="?"||!/[!=<:]/.test(ue(3)))){Ge("negate",K);continue}if(f.nonegate!==!0&&C.index===0){B();continue}}if(K==="+"){if(f.noextglob!==!0&&ue()==="("&&ue(2)!=="?"){Ge("plus",K);continue}if(j&&j.value==="("||f.regex===!1){le({type:"plus",value:K,output:A});continue}if(j&&(j.type==="bracket"||j.type==="paren"||j.type==="brace")||C.parens>0){le({type:"plus",value:K});continue}le({type:"plus",value:A});continue}if(K==="@"){if(f.noextglob!==!0&&ue()==="("&&ue(2)!=="?"){le({type:"at",extglob:!0,value:K,output:""});continue}le({type:"text",value:K});continue}if(K!=="*"){(K==="$"||K==="^")&&(K=`\\${K}`);const ne=i.exec(Ce());ne&&(K+=ne[0],C.index+=ne[0].length),le({type:"text",value:K});continue}if(j&&(j.type==="globstar"||j.star===!0)){j.type="star",j.star=!0,j.value+=K,j.output=te,C.backtrack=!0,C.globstar=!0,ce(K);continue}let oe=Ce();if(f.noextglob!==!0&&/^\([^?]/.test(oe)){Ge("star",K);continue}if(j.type==="star"){if(f.noglobstar===!0){ce(K);continue}const ne=j.prev,De=ne.prev,ze=ne.type==="slash"||ne.type==="bos",ht=De&&(De.type==="star"||De.type==="globstar");if(f.bash===!0&&(!ze||oe[0]&&oe[0]!=="/")){le({type:"star",value:K,output:""});continue}const Ye=C.braces>0&&(ne.type==="comma"||ne.type==="brace"),qt=me.length&&(ne.type==="pipe"||ne.type==="paren");if(!ze&&ne.type!=="paren"&&!Ye&&!qt){le({type:"star",value:K,output:""});continue}for(;oe.slice(0,3)==="/**";){const Wt=l[C.index+4];if(Wt&&Wt!=="/")break;oe=oe.slice(3),ce("/**",3)}if(ne.type==="bos"&&Fe()){j.type="globstar",j.value+=K,j.output=W(f),C.output=j.output,C.globstar=!0,ce(K);continue}if(ne.type==="slash"&&ne.prev.type!=="bos"&&!ht&&Fe()){C.output=C.output.slice(0,-(ne.output+j.output).length),ne.output=`(?:${ne.output}`,j.type="globstar",j.output=W(f)+(f.strictSlashes?")":"|$)"),j.value+=K,C.globstar=!0,C.output+=ne.output+j.output,ce(K);continue}if(ne.type==="slash"&&ne.prev.type!=="bos"&&oe[0]==="/"){const Wt=oe[1]!==void 0?"|$":"";C.output=C.output.slice(0,-(ne.output+j.output).length),ne.output=`(?:${ne.output}`,j.type="globstar",j.output=`${W(f)}${I}|${I}${Wt})`,j.value+=K,C.output+=ne.output+j.output,C.globstar=!0,ce(K+be()),le({type:"slash",value:"/",output:""});continue}if(ne.type==="bos"&&oe[0]==="/"){j.type="globstar",j.value+=K,j.output=`(?:^|${I}|${W(f)}${I})`,C.output=j.output,C.globstar=!0,ce(K+be()),le({type:"slash",value:"/",output:""});continue}C.output=C.output.slice(0,-j.output.length),j.type="globstar",j.output=W(f),j.value+=K,C.output+=j.output,C.globstar=!0,ce(K);continue}const xe={type:"star",value:K,output:te};if(f.bash===!0){xe.output=".*?",(j.type==="bos"||j.type==="slash")&&(xe.output=H+xe.output),le(xe);continue}if(j&&(j.type==="bracket"||j.type==="paren")&&f.regex===!0){xe.output=K,le(xe);continue}(C.index===C.start||j.type==="slash"||j.type==="dot")&&(j.type==="dot"?(C.output+=ae,j.output+=ae):f.dot===!0?(C.output+=O,j.output+=O):(C.output+=H,j.output+=H),ue()!=="*"&&(C.output+=M,j.output+=M)),le(xe)}for(;C.brackets>0;){if(f.strictBrackets===!0)throw new SyntaxError(u("closing","]"));C.output=e.escapeLast(C.output,"["),q("brackets")}for(;C.parens>0;){if(f.strictBrackets===!0)throw new SyntaxError(u("closing",")"));C.output=e.escapeLast(C.output,"("),q("parens")}for(;C.braces>0;){if(f.strictBrackets===!0)throw new SyntaxError(u("closing","}"));C.output=e.escapeLast(C.output,"{"),q("braces")}if(f.strictSlashes!==!0&&(j.type==="star"||j.type==="bracket")&&le({type:"maybe_slash",value:"",output:`${I}?`}),C.backtrack===!0){C.output="";for(const oe of C.tokens)C.output+=oe.output!=null?oe.output:oe.value,oe.suffix&&(C.output+=oe.suffix)}return C};return c.fastpaths=(l,d)=>{const f={...d},p=typeof f.maxLength=="number"?Math.min(n,f.maxLength):n,h=l.length;if(h>p)throw new SyntaxError(`Input length: ${h}, exceeds maximum allowed length: ${p}`);l=a[l]||l;const{DOT_LITERAL:y,SLASH_LITERAL:b,ONE_CHAR:w,DOTS_SLASH:E,NO_DOT:$,NO_DOTS:k,NO_DOTS_SLASH:A,STAR:I,START_ANCHOR:M}=t.globChars(f.windows),Y=f.dot?k:$,Q=f.dot?A:$,ae=f.capture?"":"?:",O={negated:!1,prefix:""};let T=f.bash===!0?".*?":I;f.capture&&(T=`(${T})`);const R=H=>H.noglobstar===!0?T:`(${ae}(?:(?!${M}${H.dot?E:y}).)*?)`,F=H=>{switch(H){case"*":return`${Y}${w}${T}`;case".*":return`${y}${w}${T}`;case"*.*":return`${Y}${T}${y}${w}${T}`;case"*/*":return`${Y}${T}${b}${w}${Q}${T}`;case"**":return Y+R(f);case"**/*":return`(?:${Y}${R(f)}${b})?${Q}${w}${T}`;case"**/*.*":return`(?:${Y}${R(f)}${b})?${Q}${T}${y}${w}${T}`;case"**/.*":return`(?:${Y}${R(f)}${b})?${y}${w}${T}`;default:{const Ee=/^(.*?)\.(\w+)$/.exec(H);if(!Ee)return;const te=F(Ee[1]);return te?te+y+Ee[2]:void 0}}},V=e.removePrefix(l,O);let W=F(V);return W&&f.strictSlashes!==!0&&(W+=`${b}?`),W},Dw=c,Dw}var Ew,YC;function XU(){if(YC)return Ew;YC=1;const t=KU(),e=YU(),n=Ip(),r=xp(),i=a=>a&&typeof a=="object"&&!Array.isArray(a),s=(a,o,u=!1)=>{if(Array.isArray(a)){const b=a.map(E=>s(E,o,u));return E=>{for(const $ of b){const k=$(E);if(k)return k}return!1}}const c=i(a)&&a.tokens&&a.input;if(a===""||typeof a!="string"&&!c)throw new TypeError("Expected pattern to be a non-empty string");const l=o||{},d=l.windows,f=c?s.compileRe(a,o):s.makeRe(a,o,!1,!0),p=f.state;delete f.state;let h=()=>!1;if(l.ignore){const b={...o,ignore:null,onMatch:null,onResult:null};h=s(l.ignore,b,u)}const y=(b,w=!1)=>{const{isMatch:E,match:$,output:k}=s.test(b,f,o,{glob:a,posix:d}),A={glob:a,state:p,regex:f,posix:d,input:b,output:k,match:$,isMatch:E};return typeof l.onResult=="function"&&l.onResult(A),E===!1?(A.isMatch=!1,w?A:!1):h(b)?(typeof l.onIgnore=="function"&&l.onIgnore(A),A.isMatch=!1,w?A:!1):(typeof l.onMatch=="function"&&l.onMatch(A),w?A:!0)};return u&&(y.state=p),y};return s.test=(a,o,u,{glob:c,posix:l}={})=>{if(typeof a!="string")throw new TypeError("Expected input to be a string");if(a==="")return{isMatch:!1,output:""};const d=u||{},f=d.format||(l?n.toPosixSlashes:null);let p=a===c,h=p&&f?f(a):a;return p===!1&&(h=f?f(a):a,p=h===c),(p===!1||d.capture===!0)&&(d.matchBase===!0||d.basename===!0?p=s.matchBase(a,o,u,l):p=o.exec(h)),{isMatch:!!p,match:p,output:h}},s.matchBase=(a,o,u)=>(o instanceof RegExp?o:s.makeRe(o,u)).test(n.basename(a)),s.isMatch=(a,o,u)=>s(o,u)(a),s.parse=(a,o)=>Array.isArray(a)?a.map(u=>s.parse(u,o)):e(a,{...o,fastpaths:!1}),s.scan=(a,o)=>t(a,o),s.compileRe=(a,o,u=!1,c=!1)=>{if(u===!0)return a.output;const l=o||{},d=l.contains?"":"^",f=l.contains?"":"$";let p=`${d}(?:${a.output})${f}`;a&&a.negated===!0&&(p=`^(?!${p}).*$`);const h=s.toRegex(p,o);return c===!0&&(h.state=a),h},s.makeRe=(a,o={},u=!1,c=!1)=>{if(!a||typeof a!="string")throw new TypeError("Expected a non-empty string");let l={negated:!1,fastpaths:!0};return o.fastpaths!==!1&&(a[0]==="."||a[0]==="*")&&(l.output=e.fastpaths(a,o)),l.output||(l=e(a,o)),s.compileRe(l,o,u,c)},s.toRegex=(a,o)=>{try{const u=o||{};return new RegExp(a,u.flags||(u.nocase?"i":""))}catch(u){if(o&&o.debug===!0)throw u;return/$^/}},s.constants=r,Ew=s,Ew}var Rw,XC;function JU(){if(XC)return Rw;XC=1;const t=XU(),e=Ip();function n(r,i,s=!1){return i&&(i.windows===null||i.windows===void 0)&&(i={...i,windows:e.isWindows()}),t(r,i,s)}return Object.assign(n,t),Rw=n,Rw}var JC;function QU(){if(JC)return Ec;JC=1,Object.defineProperty(Ec,"__esModule",{value:!0}),Ec.Builder=void 0;const t=$r,e=VU();var n=null;try{require.resolve("picomatch"),n=JU()}catch{}class r{globCache={};options={maxDepth:1/0,suppressErrors:!0,pathSeparator:t.sep,filters:[]};globFunction;constructor(s){this.options={...this.options,...s},this.globFunction=this.options.globFunction}group(){return this.options.group=!0,this}withPathSeparator(s){return this.options.pathSeparator=s,this}withBasePath(){return this.options.includeBasePath=!0,this}withRelativePaths(){return this.options.relativePaths=!0,this}withDirs(){return this.options.includeDirs=!0,this}withMaxDepth(s){return this.options.maxDepth=s,this}withMaxFiles(s){return this.options.maxFiles=s,this}withFullPaths(){return this.options.resolvePaths=!0,this.options.includeBasePath=!0,this}withErrors(){return this.options.suppressErrors=!1,this}withSymlinks({resolvePaths:s=!0}={}){return this.options.resolveSymlinks=!0,this.options.useRealPaths=s,this.withFullPaths()}withAbortSignal(s){return this.options.signal=s,this}normalize(){return this.options.normalizePath=!0,this}filter(s){return this.options.filters.push(s),this}onlyDirs(){return this.options.excludeFiles=!0,this.options.includeDirs=!0,this}exclude(s){return this.options.exclude=s,this}onlyCounts(){return this.options.onlyCounts=!0,this}crawl(s){return new e.APIBuilder(s||".",this.options)}withGlobFunction(s){return this.globFunction=s,this}crawlWithOptions(s,a){return this.options={...this.options,...a},new e.APIBuilder(s||".",this.options)}glob(...s){return this.globFunction?this.globWithOptions(s):this.globWithOptions(s,{dot:!0})}globWithOptions(s,...a){const o=this.globFunction||n;if(!o)throw new Error("Please specify a glob function to use glob matching.");var u=this.globCache[s.join("\0")];return u||(u=o(s,...a),this.globCache[s.join("\0")]=u),this.options.filters.push(c=>u(c)),this}}return Ec.Builder=r,Ec}var $w={},QC;function ZU(){return QC||(QC=1,Object.defineProperty($w,"__esModule",{value:!0})),$w}var ZC;function e4(){return ZC||(ZC=1,function(t){var e=Us&&Us.__createBinding||(Object.create?function(i,s,a,o){o===void 0&&(o=a);var u=Object.getOwnPropertyDescriptor(s,a);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return s[a]}}),Object.defineProperty(i,o,u)}:function(i,s,a,o){o===void 0&&(o=a),i[o]=s[a]}),n=Us&&Us.__exportStar||function(i,s){for(var a in i)a!=="default"&&!Object.prototype.hasOwnProperty.call(s,a)&&e(s,i,a)};Object.defineProperty(t,"__esModule",{value:!0}),t.fdir=void 0;const r=QU();Object.defineProperty(t,"fdir",{enumerable:!0,get:function(){return r.Builder}}),n(ZU(),t)}(Us)),Us}var t4=e4();class n4{constructor(){this.encoding="utf-8"}readFile(e){return SD.promises.readFile(e.fsPath,this.encoding)}async readDirectory(e){return(await SD.promises.readdir(e.fsPath,{withFileTypes:!0})).map(r=>({dirent:r,isFile:r.isFile(),isDirectory:r.isDirectory(),uri:kt.joinPath(e,r.name)}))}}const Sw="DeploymentElement";function eA(t){return U.isInstance(t,Sw)}const Tw="DeploymentNodeOrElementKind",Np="DeploymentViewRule";function r4(t){return U.isInstance(t,Np)}const xc="DynamicViewRule";function Op(t){return U.isInstance(t,xc)}const Ic="ElementExpression";function kw(t){return U.isInstance(t,Ic)}const Fp="ElementPredicate";function i4(t){return U.isInstance(t,Fp)}const Lp="ElementPredicateOrWhere";function s4(t){return U.isInstance(t,Lp)}const Mp="ElementPredicateOrWhereV2";function a4(t){return U.isInstance(t,Mp)}const Ks="ElementProperty";function o4(t){return U.isInstance(t,Ks)}const Cw="ExpressionV2";function u4(t){return U.isInstance(t,Cw)}const Aw="ExtendElementProperty",Nc="FqnExpr";function c4(t){return U.isInstance(t,Nc)}const _w="FqnReferenceable",Ys="LikeC4View";function Pw(t){return U.isInstance(t,Ys)}const zp="MetadataProperty";function Xs(t){return U.isInstance(t,zp)}const xw="Predicate";function l4(t){return U.isInstance(t,xw)}const Oc="Referenceable",Bp="RelationExpr";function tA(t){return U.isInstance(t,Bp)}const qp="RelationExpression";function Iw(t){return U.isInstance(t,qp)}const Gp="RelationPredicate";function d4(t){return U.isInstance(t,Gp)}const jp="RelationPredicateOrWhere";function f4(t){return U.isInstance(t,jp)}const Up="RelationPredicateOrWhereV2";function p4(t){return U.isInstance(t,Up)}const Fc="RelationProperty",Wp="RelationshipStyleProperty";function nA(t){return U.isInstance(t,Wp)}const Nw="SizeProperty";function h4(t){return U.isInstance(t,Nw)}const Ha="StringProperty";function rA(t){return U.isInstance(t,Ha)}const Va="StyleProperty";function Ow(t){return U.isInstance(t,Va)}const Hp="ViewProperty";function m4(t){return U.isInstance(t,Hp)}const Lc="ViewRule";function g4(t){return U.isInstance(t,Lc)}const Vp="ViewRulePredicate";function Kp(t){return U.isInstance(t,Vp)}const Yp="ViewRuleStyleOrGlobalRef";function Fw(t){return U.isInstance(t,Yp)}const Mc="WhereElement";function iA(t){return U.isInstance(t,Mc)}const zc="WhereElementExpression";function y4(t){return U.isInstance(t,zc)}const sA="WhereExpression",Xp="WhereKindEqual";function w4(t){return U.isInstance(t,Xp)}const Bc="WhereRelation";function aA(t){return U.isInstance(t,Bc)}const qc="WhereRelationExpression";function v4(t){return U.isInstance(t,qc)}const Jp="WhereTagEqual";function b4(t){return U.isInstance(t,Jp)}const Gc="ArrowProperty";function jc(t){return U.isInstance(t,Gc)}const Uc="BorderProperty";function Qp(t){return U.isInstance(t,Uc)}const Wc="ColorProperty";function Js(t){return U.isInstance(t,Wc)}const Qs="CustomColor",Zp="CustomElementProperties";function D4(t){return U.isInstance(t,Zp)}const eh="CustomRelationProperties";function E4(t){return U.isInstance(t,eh)}const Mi="DeployedInstance";function hr(t){return U.isInstance(t,Mi)}const th="DeployedInstanceBody";function R4(t){return U.isInstance(t,th)}const zi="DeploymentNode";function Dn(t){return U.isInstance(t,zi)}const nh="DeploymentNodeBody";function $4(t){return U.isInstance(t,nh)}const Bi="DeploymentNodeKind",rh="DeploymentRelation";function qi(t){return U.isInstance(t,rh)}const ih="DeploymentRelationBody";function S4(t){return U.isInstance(t,ih)}const Hc="DeploymentView";function Lw(t){return U.isInstance(t,Hc)}const sh="DeploymentViewBody";function T4(t){return U.isInstance(t,sh)}const Vc="DeploymentViewRulePredicate";function Ka(t){return U.isInstance(t,Vc)}const ah="DeploymentViewRulePredicateExpression";function k4(t){return U.isInstance(t,ah)}const Kc="DeploymentViewRuleStyle";function oA(t){return U.isInstance(t,Kc)}const Yc="DirectedRelationExpr";function Mw(t){return U.isInstance(t,Yc)}const Xc="DirectedRelationExpression";function zw(t){return U.isInstance(t,Xc)}const Ya="DynamicView";function uA(t){return U.isInstance(t,Ya)}const oh="DynamicViewBody";function C4(t){return U.isInstance(t,oh)}const Jc="DynamicViewGlobalPredicateRef";function cA(t){return U.isInstance(t,Jc)}const Qc="DynamicViewIncludePredicate";function A4(t){return U.isInstance(t,Qc)}const uh="DynamicViewParallelSteps";function Bw(t){return U.isInstance(t,uh)}const ch="DynamicViewPredicateIterator";function lA(t){return U.isInstance(t,ch)}const qw="DynamicViewRef",lh="DynamicViewStep";function Gw(t){return U.isInstance(t,lh)}const Zn="Element";function qn(t){return U.isInstance(t,Zn)}const dh="ElementBody";function Zc(t){return U.isInstance(t,dh)}const el="ElementDescedantsExpression";function jw(t){return U.isInstance(t,el)}const fh="ElementExpressionsIterator";function _4(t){return U.isInstance(t,fh)}const gi="ElementKind";function P4(t){return U.isInstance(t,gi)}const tl="ElementKindExpression";function ph(t){return U.isInstance(t,tl)}const nl="ElementPredicateWhere";function Uw(t){return U.isInstance(t,nl)}const rl="ElementPredicateWhereV2";function x4(t){return U.isInstance(t,rl)}const il="ElementPredicateWith";function hh(t){return U.isInstance(t,il)}const sl="ElementRef";function al(t){return U.isInstance(t,sl)}const ol="ElementStringProperty";function ul(t){return U.isInstance(t,ol)}const cl="ElementStyleProperty";function Gi(t){return U.isInstance(t,cl)}const ll="ElementTagExpression";function mh(t){return U.isInstance(t,ll)}const Xa="ElementView";function gh(t){return U.isInstance(t,Xa)}const yh="ElementViewBody";function dA(t){return U.isInstance(t,yh)}const Ww="ElementViewRef",dl="ExcludePredicate";function fl(t){return U.isInstance(t,dl)}const pl="ExpandElementExpression";function fA(t){return U.isInstance(t,pl)}const Zs="ExtendElement";function Ja(t){return U.isInstance(t,Zs)}const wh="ExtendElementBody";function pA(t){return U.isInstance(t,wh)}const vh="FqnExpressions";function I4(t){return U.isInstance(t,vh)}const bh="FqnRef";function hA(t){return U.isInstance(t,bh)}const hl="FqnRefExpr";function Hw(t){return U.isInstance(t,hl)}const Qa="GlobalDynamicPredicateGroup";function ml(t){return U.isInstance(t,Qa)}const Za="GlobalPredicateGroup";function gl(t){return U.isInstance(t,Za)}const eo="Globals";function Vw(t){return U.isInstance(t,eo)}const Dh="GlobalStyle";function to(t){return U.isInstance(t,Dh)}const Eh="GlobalStyleGroup";function ea(t){return U.isInstance(t,Eh)}const yl="GlobalStyleId",wl="IconProperty";function Fr(t){return U.isInstance(t,wl)}const vl="IncludePredicate";function Rh(t){return U.isInstance(t,vl)}const bl="IncomingRelationExpr";function Kw(t){return U.isInstance(t,bl)}const Dl="IncomingRelationExpression";function mA(t){return U.isInstance(t,Dl)}const El="InOutRelationExpr";function gA(t){return U.isInstance(t,El)}const Rl="InOutRelationExpression";function Yw(t){return U.isInstance(t,Rl)}const ta="LibIcon";function N4(t){return U.isInstance(t,ta)}const $h="LikeC4Grammar";function O4(t){return U.isInstance(t,$h)}const Sh="LikeC4Lib";function yA(t){return U.isInstance(t,Sh)}const $l="LineProperty";function Sl(t){return U.isInstance(t,$l)}const Tl="LinkProperty";function Th(t){return U.isInstance(t,Tl)}const kl="MetadataAttribute";function F4(t){return U.isInstance(t,kl)}const Cl="MetadataBody";function L4(t){return U.isInstance(t,Cl)}const no="Model";function wA(t){return U.isInstance(t,no)}const ro="ModelDeployments";function vA(t){return U.isInstance(t,ro)}const io="ModelViews";function Al(t){return U.isInstance(t,io)}const _l="MultipleProperty";function Xw(t){return U.isInstance(t,_l)}const kh="NavigateToProperty";function Ch(t){return U.isInstance(t,kh)}const Pl="NotationProperty";function so(t){return U.isInstance(t,Pl)}const xl="NotesProperty";function bA(t){return U.isInstance(t,xl)}const Il="OpacityProperty";function Ah(t){return U.isInstance(t,Il)}const Nl="OutgoingRelationExpr";function Jw(t){return U.isInstance(t,Nl)}const Ol="OutgoingRelationExpression";function Qw(t){return U.isInstance(t,Ol)}const Fl="PaddingSizeProperty";function Zw(t){return U.isInstance(t,Fl)}const _h="Predicates";function DA(t){return U.isInstance(t,_h)}const Ph="Relation";function Lr(t){return U.isInstance(t,Ph)}const xh="RelationBody";function M4(t){return U.isInstance(t,xh)}const Ll="RelationNavigateToProperty";function Ml(t){return U.isInstance(t,Ll)}const zl="RelationPredicateWhere";function ev(t){return U.isInstance(t,zl)}const Bl="RelationPredicateWhereV2";function z4(t){return U.isInstance(t,Bl)}const ql="RelationPredicateWith";function tv(t){return U.isInstance(t,ql)}const ji="RelationshipKind";function B4(t){return U.isInstance(t,ji)}const Gl="RelationStringProperty";function jl(t){return U.isInstance(t,Gl)}const Ul="RelationStyleProperty";function Ih(t){return U.isInstance(t,Ul)}const Wl="ShapeProperty";function Nh(t){return U.isInstance(t,Wl)}const Hl="ShapeSizeProperty";function nv(t){return U.isInstance(t,Hl)}const Oh="SpecificationColor";function Fh(t){return U.isInstance(t,Oh)}const ao="SpecificationDeploymentNodeKind";function oo(t){return U.isInstance(t,ao)}const uo="SpecificationElementKind";function co(t){return U.isInstance(t,uo)}const Vl="SpecificationElementStringProperty";function rv(t){return U.isInstance(t,Vl)}const lo="SpecificationRelationshipKind";function fo(t){return U.isInstance(t,lo)}const Kl="SpecificationRelationshipStringProperty";function EA(t){return U.isInstance(t,Kl)}const po="SpecificationRule";function iv(t){return U.isInstance(t,po)}const ho="SpecificationTag";function Lh(t){return U.isInstance(t,ho)}const Mh="StrictFqnElementRef";function RA(t){return U.isInstance(t,Mh)}const Ui="Tag";function $A(t){return U.isInstance(t,Ui)}const zh="Tags";function sv(t){return U.isInstance(t,zh)}const Yl="TextSizeProperty";function av(t){return U.isInstance(t,Yl)}const ov="ViewRef",Xl="ViewRuleAutoLayout";function Jl(t){return U.isInstance(t,Xl)}const Ql="ViewRuleGlobalPredicateRef";function uv(t){return U.isInstance(t,Ql)}const Zl="ViewRuleGlobalStyle";function cv(t){return U.isInstance(t,Zl)}const ed="ViewRuleGroup";function Bh(t){return U.isInstance(t,ed)}const td="ViewRuleStyle";function nd(t){return U.isInstance(t,td)}const rd="ViewStringProperty";function q4(t){return U.isInstance(t,rd)}const id="WhereBinaryExpression";function G4(t){return U.isInstance(t,id)}const sd="WhereElementKind";function j4(t){return U.isInstance(t,sd)}const ad="WhereElementNegation";function SA(t){return U.isInstance(t,ad)}const od="WhereElementTag";function U4(t){return U.isInstance(t,od)}const ud="WhereRelationKind";function TA(t){return U.isInstance(t,ud)}const cd="WhereRelationNegation";function kA(t){return U.isInstance(t,cd)}const ld="WhereRelationParticipantKind";function CA(t){return U.isInstance(t,ld)}const dd="WhereRelationParticipantTag";function AA(t){return U.isInstance(t,dd)}const fd="WhereRelationTag";function W4(t){return U.isInstance(t,fd)}const pd="WildcardExpression";function na(t){return U.isInstance(t,pd)}class _A extends KD{getAllTypes(){return[Gc,Uc,Wc,Qs,Zp,eh,Mi,th,Sw,zi,nh,Bi,Tw,rh,ih,Hc,sh,Np,Vc,ah,Kc,Yc,Xc,Ya,oh,Jc,Qc,uh,ch,qw,xc,lh,Zn,dh,el,Ic,fh,gi,tl,Fp,Lp,Mp,nl,rl,il,Ks,sl,ol,cl,ll,Xa,yh,Ww,dl,pl,Cw,Zs,wh,Aw,Nc,vh,bh,hl,_w,Qa,Za,Dh,Eh,yl,eo,wl,El,Rl,vl,bl,Dl,ta,$h,Sh,Ys,$l,Tl,kl,Cl,zp,no,ro,io,_l,kh,Pl,xl,Il,Nl,Ol,Fl,xw,_h,Oc,Ph,xh,Bp,qp,Ll,Gp,jp,Up,zl,Bl,ql,Fc,Gl,Ul,ji,Wp,Wl,Hl,Nw,Oh,ao,uo,Vl,lo,Kl,po,ho,Mh,Ha,Va,Ui,zh,Yl,Hp,ov,Lc,Xl,Ql,Zl,ed,Vp,td,Yp,rd,id,Mc,zc,sd,ad,od,sA,Xp,Bc,qc,ud,cd,ld,dd,fd,Jp,pd]}computeIsSubtype(e,n){switch(e){case Gc:case $l:return this.isSubtype(Wp,n);case Uc:case _l:case Il:case Wl:return this.isSubtype(Va,n);case Wc:return this.isSubtype(Wp,n)||this.isSubtype(Va,n);case Mi:case zi:return this.isSubtype(Sw,n)||this.isSubtype(Oc,n);case Bi:case gi:return this.isSubtype(Tw,n);case Hc:case Ya:case Xa:return this.isSubtype(Ys,n);case Vc:case Kc:return this.isSubtype(Np,n);case Yc:case bl:case El:case Nl:return this.isSubtype(Bp,n);case Xc:case Dl:case Rl:case Ol:return this.isSubtype(qp,n);case Jc:case Qc:return this.isSubtype(xc,n);case Zn:return this.isSubtype(_w,n)||this.isSubtype(Oc,n);case el:case tl:case sl:case ll:case pl:return this.isSubtype(Ic,n);case Ic:case nl:return this.isSubtype(Lp,n);case Fp:case Gp:return this.isSubtype(xw,n);case Lp:case il:return this.isSubtype(Fp,n);case Mp:case Up:return this.isSubtype(Cw,n);case rl:case Nc:return this.isSubtype(Mp,n);case ol:return this.isSubtype(Ks,n)||this.isSubtype(Ha,n);case cl:return this.isSubtype(Ks,n);case dl:case vl:return this.isSubtype(Vp,n);case Zs:case Oc:return this.isSubtype(_w,n);case hl:return this.isSubtype(Nc,n);case wl:return this.isSubtype(Ks,n)||this.isSubtype(Va,n);case Tl:return this.isSubtype(Ks,n)||this.isSubtype(Aw,n)||this.isSubtype(Fc,n)||this.isSubtype(Hp,n);case kl:case Pl:case xl:case Vl:case Kl:return this.isSubtype(Ha,n);case Cl:return this.isSubtype(zp,n);case zp:return this.isSubtype(Ks,n)||this.isSubtype(Aw,n)||this.isSubtype(Fc,n);case Fl:case Hl:case Yl:return this.isSubtype(Nw,n)||this.isSubtype(Va,n);case Bp:case Bl:return this.isSubtype(Up,n);case qp:case zl:return this.isSubtype(jp,n);case Ll:case Ul:return this.isSubtype(Fc,n);case jp:case ql:return this.isSubtype(Gp,n);case Gl:return this.isSubtype(Fc,n)||this.isSubtype(Ha,n);case Xl:return this.isSubtype(Np,n)||this.isSubtype(xc,n)||this.isSubtype(Lc,n);case Ql:case ed:case Vp:return this.isSubtype(Lc,n);case Zl:case td:return this.isSubtype(Yp,n);case Yp:return this.isSubtype(xc,n)||this.isSubtype(Lc,n);case rd:return this.isSubtype(Ha,n)||this.isSubtype(Hp,n);case id:return this.isSubtype(zc,n)||this.isSubtype(qc,n);case Mc:case ad:return this.isSubtype(zc,n);case zc:case qc:return this.isSubtype(sA,n);case sd:return this.isSubtype(Mc,n)||this.isSubtype(Xp,n);case od:return this.isSubtype(Mc,n)||this.isSubtype(Jp,n);case Bc:case cd:return this.isSubtype(qc,n);case ud:case ld:return this.isSubtype(Xp,n)||this.isSubtype(Bc,n);case dd:case fd:return this.isSubtype(Bc,n)||this.isSubtype(Jp,n);case pd:return this.isSubtype(Ic,n)||this.isSubtype(Nc,n);default:return!1}}getReferenceType(e){const n=`${e.container.$type}:${e.property}`;switch(n){case"ColorProperty:customColor":return Qs;case"DeploymentNode:kind":return Bi;case"DeploymentRelation:kind":case"DynamicViewStep:kind":case"OutgoingRelationExpr:kind":case"OutgoingRelationExpression:kind":case"Relation:kind":case"WhereRelationKind:value":return ji;case"DynamicViewGlobalPredicateRef:predicate":return Qa;case"DynamicViewRef:view":return Ya;case"Element:kind":case"ElementKindExpression:kind":return gi;case"ElementRef:el":case"StrictFqnElementRef:el":return Zn;case"ElementTagExpression:tag":case"Tags:values":case"WhereElementTag:value":case"WhereRelationParticipantTag:value":case"WhereRelationTag:value":return Ui;case"ElementViewRef:view":return Xa;case"FqnRef:value":return Oc;case"IconProperty:libicon":return ta;case"ViewRef:view":return Ys;case"ViewRuleGlobalPredicateRef:predicate":return Za;case"ViewRuleGlobalStyle:style":return yl;case"WhereElementKind:value":case"WhereRelationParticipantKind:value":return Tw;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case Gc:return{name:Gc,properties:[{name:"key"},{name:"value"}]};case Uc:return{name:Uc,properties:[{name:"key"},{name:"value"}]};case Wc:return{name:Wc,properties:[{name:"customColor"},{name:"key"},{name:"themeColor"}]};case Qs:return{name:Qs,properties:[{name:"name"}]};case Zp:return{name:Zp,properties:[{name:"props",defaultValue:[]}]};case eh:return{name:eh,properties:[{name:"props",defaultValue:[]}]};case Mi:return{name:Mi,properties:[{name:"body"},{name:"element"},{name:"name"},{name:"title"}]};case th:return{name:th,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case zi:return{name:zi,properties:[{name:"body"},{name:"kind"},{name:"name"},{name:"title"}]};case nh:return{name:nh,properties:[{name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case Bi:return{name:Bi,properties:[{name:"name"}]};case rh:return{name:rh,properties:[{name:"body"},{name:"kind"},{name:"source"},{name:"tags"},{name:"target"},{name:"technology"},{name:"title"}]};case ih:return{name:ih,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case Hc:return{name:Hc,properties:[{name:"body"},{name:"name"}]};case sh:return{name:sh,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"tags"}]};case Vc:return{name:Vc,properties:[{name:"expr"},{name:"isInclude",defaultValue:!1}]};case ah:return{name:ah,properties:[{name:"prev"},{name:"value"}]};case Kc:return{name:Kc,properties:[{name:"props",defaultValue:[]},{name:"targets"}]};case Yc:return{name:Yc,properties:[{name:"source"},{name:"target"}]};case Xc:return{name:Xc,properties:[{name:"source"},{name:"target"}]};case Ya:return{name:Ya,properties:[{name:"body"},{name:"name"}]};case oh:return{name:oh,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"steps",defaultValue:[]},{name:"tags"}]};case Jc:return{name:Jc,properties:[{name:"predicate"}]};case Qc:return{name:Qc,properties:[{name:"predicates"}]};case uh:return{name:uh,properties:[{name:"steps",defaultValue:[]}]};case ch:return{name:ch,properties:[{name:"prev"},{name:"value"}]};case qw:return{name:qw,properties:[{name:"view"}]};case lh:return{name:lh,properties:[{name:"custom"},{name:"isBackward",defaultValue:!1},{name:"kind"},{name:"source"},{name:"target"},{name:"title"}]};case Zn:return{name:Zn,properties:[{name:"body"},{name:"kind"},{name:"name"},{name:"props",defaultValue:[]}]};case dh:return{name:dh,properties:[{name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case el:return{name:el,properties:[{name:"parent"},{name:"suffix"}]};case fh:return{name:fh,properties:[{name:"prev"},{name:"value"}]};case gi:return{name:gi,properties:[{name:"name"}]};case tl:return{name:tl,properties:[{name:"isEqual",defaultValue:!1},{name:"kind"}]};case nl:return{name:nl,properties:[{name:"subject"},{name:"where"}]};case rl:return{name:rl,properties:[{name:"subject"},{name:"where"}]};case il:return{name:il,properties:[{name:"custom"},{name:"subject"}]};case sl:return{name:sl,properties:[{name:"el"},{name:"parent"}]};case ol:return{name:ol,properties:[{name:"key"},{name:"value"}]};case cl:return{name:cl,properties:[{name:"key"},{name:"props",defaultValue:[]}]};case ll:return{name:ll,properties:[{name:"isEqual",defaultValue:!1},{name:"tag"}]};case Xa:return{name:Xa,properties:[{name:"body"},{name:"extends"},{name:"name"},{name:"viewOf"}]};case yh:return{name:yh,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"tags"}]};case Ww:return{name:Ww,properties:[{name:"view"}]};case dl:return{name:dl,properties:[{name:"predicates"}]};case pl:return{name:pl,properties:[{name:"expand"}]};case Zs:return{name:Zs,properties:[{name:"body"},{name:"element"}]};case wh:return{name:wh,properties:[{name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case vh:return{name:vh,properties:[{name:"prev"},{name:"value"}]};case bh:return{name:bh,properties:[{name:"parent"},{name:"value"}]};case hl:return{name:hl,properties:[{name:"ref"},{name:"selector"}]};case Qa:return{name:Qa,properties:[{name:"name"},{name:"predicates",defaultValue:[]}]};case Za:return{name:Za,properties:[{name:"name"},{name:"predicates",defaultValue:[]}]};case eo:return{name:eo,properties:[{name:"name"},{name:"predicates",defaultValue:[]},{name:"styles",defaultValue:[]}]};case Dh:return{name:Dh,properties:[{name:"id"},{name:"props",defaultValue:[]},{name:"target"}]};case Eh:return{name:Eh,properties:[{name:"id"},{name:"styles",defaultValue:[]}]};case yl:return{name:yl,properties:[{name:"name"}]};case wl:return{name:wl,properties:[{name:"key"},{name:"libicon"},{name:"value"}]};case vl:return{name:vl,properties:[{name:"predicates"}]};case bl:return{name:bl,properties:[{name:"to"}]};case Dl:return{name:Dl,properties:[{name:"to"}]};case El:return{name:El,properties:[{name:"inout"}]};case Rl:return{name:Rl,properties:[{name:"inout"}]};case ta:return{name:ta,properties:[{name:"name"}]};case $h:return{name:$h,properties:[{name:"deployments",defaultValue:[]},{name:"globals",defaultValue:[]},{name:"likec4lib",defaultValue:[]},{name:"models",defaultValue:[]},{name:"specifications",defaultValue:[]},{name:"views",defaultValue:[]}]};case Sh:return{name:Sh,properties:[{name:"icons",defaultValue:[]}]};case $l:return{name:$l,properties:[{name:"key"},{name:"value"}]};case Tl:return{name:Tl,properties:[{name:"key"},{name:"title"},{name:"value"}]};case kl:return{name:kl,properties:[{name:"key"},{name:"value"}]};case Cl:return{name:Cl,properties:[{name:"props",defaultValue:[]}]};case no:return{name:no,properties:[{name:"elements",defaultValue:[]},{name:"name"}]};case ro:return{name:ro,properties:[{name:"elements",defaultValue:[]},{name:"name"}]};case io:return{name:io,properties:[{name:"name"},{name:"styles",defaultValue:[]},{name:"views",defaultValue:[]}]};case _l:return{name:_l,properties:[{name:"key"},{name:"value"}]};case kh:return{name:kh,properties:[{name:"key"},{name:"value"}]};case Pl:return{name:Pl,properties:[{name:"key"},{name:"value"}]};case xl:return{name:xl,properties:[{name:"key"},{name:"value"}]};case Il:return{name:Il,properties:[{name:"key"},{name:"value"}]};case Nl:return{name:Nl,properties:[{name:"from"},{name:"isBidirectional",defaultValue:!1},{name:"kind"}]};case Ol:return{name:Ol,properties:[{name:"from"},{name:"isBidirectional",defaultValue:!1},{name:"kind"}]};case Fl:return{name:Fl,properties:[{name:"key"},{name:"value"}]};case _h:return{name:_h,properties:[{name:"prev"},{name:"value"}]};case Ph:return{name:Ph,properties:[{name:"body"},{name:"kind"},{name:"source"},{name:"tags"},{name:"target"},{name:"technology"},{name:"title"}]};case xh:return{name:xh,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case Ll:return{name:Ll,properties:[{name:"key"},{name:"value"}]};case zl:return{name:zl,properties:[{name:"subject"},{name:"where"}]};case Bl:return{name:Bl,properties:[{name:"subject"},{name:"where"}]};case ql:return{name:ql,properties:[{name:"custom"},{name:"subject"}]};case ji:return{name:ji,properties:[{name:"name"}]};case Gl:return{name:Gl,properties:[{name:"key"},{name:"value"}]};case Ul:return{name:Ul,properties:[{name:"key"},{name:"props",defaultValue:[]}]};case Wl:return{name:Wl,properties:[{name:"key"},{name:"value"}]};case Hl:return{name:Hl,properties:[{name:"key"},{name:"value"}]};case Oh:return{name:Oh,properties:[{name:"color"},{name:"name"}]};case ao:return{name:ao,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case uo:return{name:uo,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case Vl:return{name:Vl,properties:[{name:"key"},{name:"value"}]};case lo:return{name:lo,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case Kl:return{name:Kl,properties:[{name:"key"},{name:"value"}]};case po:return{name:po,properties:[{name:"colors",defaultValue:[]},{name:"deploymentNodes",defaultValue:[]},{name:"elements",defaultValue:[]},{name:"name"},{name:"relationships",defaultValue:[]},{name:"tags",defaultValue:[]}]};case ho:return{name:ho,properties:[{name:"tag"}]};case Mh:return{name:Mh,properties:[{name:"el"},{name:"parent"}]};case Ui:return{name:Ui,properties:[{name:"name"}]};case zh:return{name:zh,properties:[{name:"prev"},{name:"values",defaultValue:[]}]};case Yl:return{name:Yl,properties:[{name:"key"},{name:"value"}]};case ov:return{name:ov,properties:[{name:"view"}]};case Xl:return{name:Xl,properties:[{name:"direction"},{name:"nodeSep"},{name:"rankSep"}]};case Ql:return{name:Ql,properties:[{name:"predicate"}]};case Zl:return{name:Zl,properties:[{name:"style"}]};case ed:return{name:ed,properties:[{name:"groupRules",defaultValue:[]},{name:"props",defaultValue:[]},{name:"title"}]};case td:return{name:td,properties:[{name:"props",defaultValue:[]},{name:"target"}]};case rd:return{name:rd,properties:[{name:"key"},{name:"value"}]};case id:return{name:id,properties:[{name:"left"},{name:"operator"},{name:"right"}]};case sd:return{name:sd,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case ad:return{name:ad,properties:[{name:"value"}]};case od:return{name:od,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case ud:return{name:ud,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case cd:return{name:cd,properties:[{name:"value"}]};case ld:return{name:ld,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"participant"},{name:"value"}]};case dd:return{name:dd,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"participant"},{name:"value"}]};case fd:return{name:fd,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case pd:return{name:pd,properties:[{name:"isWildcard",defaultValue:!1}]};default:return{name:e,properties:[]}}}}const U=new _A;let PA;const H4=()=>PA??(PA=nj(`{"$type":"Grammar","isDeclared":true,"name":"LikeC4","rules":[{"$type":"ParserRule","entry":true,"name":"LikeC4Grammar","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"specifications","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"models","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]}},{"$type":"Assignment","feature":"views","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]}},{"$type":"Assignment","feature":"globals","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@121"},"arguments":[]}},{"$type":"Assignment","feature":"deployments","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@96"},"arguments":[]}},{"$type":"Assignment","feature":"likec4lib","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LikeC4Lib","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"likec4lib"},{"$type":"Keyword","value":"{"},{"$type":"Keyword","value":"icons"},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"icons","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LibIcon","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@151"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementKind","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Tag","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationshipKind","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomColor","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@155"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentNodeKind","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationRule","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"specification"}},{"$type":"Keyword","value":"{"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]}},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"relationships","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"colors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}},{"$type":"Assignment","feature":"deploymentNodes","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationElementKind","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"element"},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@140"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationElementStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"notation"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@174"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationDeploymentNodeKind","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"deploymentNode"},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@140"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationTag","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"tag"},{"$type":"Assignment","feature":"tag","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationColor","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"color"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"color","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@150"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationRelationshipKind","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"relationship"},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@143"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationRelationshipStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"notation"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@174"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Model","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"model"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":true},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Element","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@172"},"arguments":[]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false}}]}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@174"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@174"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@174"},"arguments":[]}},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@174"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}],"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@140"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@127"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@131"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"title"},{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"description"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@174"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExtendElement","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"extend"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExtendElementBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":true},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExtendElementProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@127"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"StrictFqnElementRef","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"StrictFqnElementRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@169"},"arguments":[]},{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementRef","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@169"},"arguments":[]},{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@17"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Tags","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"values","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@153"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Tags"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"values","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@153"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"*"}],"cardinality":"*"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Relation","parameters":[{"$type":"Parameter","name":"isExplicit"}],"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","guardCondition":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@27/parameters@0"}},"elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]}}]},{"$type":"Group","guardCondition":{"$type":"Negation","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@27/parameters@0"}}},"elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"}]}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@154"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Keyword","value":"->"}]},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@174"},"arguments":[]}},{"$type":"Assignment","feature":"technology","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@174"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"RelationBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@95"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@127"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"title"},{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"description"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@174"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationStyleProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"style"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@143"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MetadataProperty","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"metadata"},{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MetadataBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MetadataAttribute","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@175"},"arguments":[]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@174"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ModelViews","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"views"}},{"$type":"Keyword","value":"{"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"views","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]}},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LikeC4ViewRule","returnType":{"$ref":"#/types@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@104"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementView","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"view"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"extends"},{"$type":"Assignment","feature":"extends","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"of"},{"$type":"Assignment","feature":"viewOf","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]}}]}],"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicView","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"dynamic"},{"$type":"Keyword","value":"view"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRef","definition":{"$type":"Assignment","feature":"view","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@0"},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementViewRef","definition":{"$type":"Assignment","feature":"view","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@37"},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewRef","definition":{"$type":"Assignment","feature":"view","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@38"},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementViewBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]},"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"steps","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]}]}},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@127"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"title"},{"$type":"Keyword","value":"description"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@174"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewLayoutDirection","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"TopBottom"},{"$type":"Keyword","value":"LeftRight"},{"$type":"Keyword","value":"BottomTop"},{"$type":"Keyword","value":"RightLeft"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRule","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@174"},"arguments":[]},"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@134"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@129"},"arguments":[]}]},"cardinality":"*"},{"$type":"Assignment","feature":"groupRules","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewRule","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@83"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@84"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewParallelSteps","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"parallel"},{"$type":"Keyword","value":"par"}]},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"steps","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewStep","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isBackward","operator":"?=","terminal":{"$type":"Keyword","value":"<-"}},{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@154"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@174"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@93"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRulePredicate","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"IncludePredicate"}},{"$type":"Keyword","value":"include"},{"$type":"Assignment","feature":"predicates","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ExcludePredicate"}},{"$type":"Keyword","value":"exclude"},{"$type":"Assignment","feature":"predicates","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Predicates","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Predicates"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Predicate","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@68"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@56"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleGlobalPredicateRef","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"global"},{"$type":"Keyword","value":"predicate"},{"$type":"Assignment","feature":"predicate","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@122"},"deprecatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicate","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@57"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicates","inferredType":{"$type":"InferredType","name":"ElementPredicate"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementPredicateWith"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"with"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@92"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicateOrWhere","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementPredicateWhere"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"where"},{"$type":"Assignment","feature":"where","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementExpression","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementOr","inferredType":{"$type":"InferredType","name":"WhereElementExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"or"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementAnd","inferredType":{"$type":"InferredType","name":"WhereElementExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"and"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementPrimary","inferredType":{"$type":"InferredType","name":"WhereElementExpression"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},{"$type":"Keyword","value":")"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementNegation","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"not"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElement","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereElementTag"}},{"$type":"Keyword","value":"tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@157"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@153"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereElementKind"}},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@157"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@2"},"deprecatedSyntax":false},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementExpression","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@67"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementSelectorExpression","inferredType":{"$type":"InferredType","name":"ElementExpression"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WildcardExpression"}},{"$type":"Assignment","feature":"isWildcard","operator":"?=","terminal":{"$type":"Keyword","value":"*"}}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementTagExpression"}},{"$type":"Keyword","value":"element.tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@158"},"arguments":[]},{"$type":"Assignment","feature":"tag","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@153"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementKindExpression"}},{"$type":"Keyword","value":"element.kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@158"},"arguments":[]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementDescedantsExpression","inferredType":{"$type":"InferredType","name":"ElementExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ExpandElementExpression"},"feature":"expand","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementDescedantsExpression"},"feature":"parent","operator":"="},{"$type":"Assignment","feature":"suffix","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@167"},"arguments":[]}}]}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicate","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@69"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicates","inferredType":{"$type":"InferredType","name":"RelationPredicate"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@70"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"RelationPredicateWith"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"with"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@93"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicateOrWhere","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@77"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"RelationPredicateWhere"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"where"},{"$type":"Assignment","feature":"where","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@71"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationExpression","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@72"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationOr","inferredType":{"$type":"InferredType","name":"WhereRelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@73"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"or"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@73"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationAnd","inferredType":{"$type":"InferredType","name":"WhereRelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@74"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"and"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@74"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationPrimary","inferredType":{"$type":"InferredType","name":"WhereRelationExpression"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@71"},"arguments":[]},{"$type":"Keyword","value":")"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@75"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@76"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationNegation","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"not"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@71"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelation","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationTag"}},{"$type":"Keyword","value":"tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@157"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@153"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationKind"}},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@157"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationParticipantTag"}},{"$type":"Assignment","feature":"participant","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@149"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@169"},"arguments":[]},{"$type":"Keyword","value":"tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@157"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@153"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationParticipantKind"}},{"$type":"Assignment","feature":"participant","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@149"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@169"},"arguments":[]},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@157"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationExpression","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@78"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@80"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"InOutRelationExpressions","inferredType":{"$type":"InferredType","name":"RelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@79"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"InOutRelationExpression"},"feature":"inout","operator":"="},{"$type":"Keyword","value":"->"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IncomingRelationExpression","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DirectedRelationExpressions","inferredType":{"$type":"InferredType","name":"RelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@81"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DirectedRelationExpression"},"feature":"source","operator":"="},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"OutgoingRelationExpression","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isBidirectional","operator":"?=","terminal":{"$type":"Keyword","value":"<->"}},{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@154"},"arguments":[]},"deprecatedSyntax":false}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementExpressionsIterator","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementExpressionsIterator"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewIncludePredicate","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"include"},{"$type":"Assignment","feature":"predicates","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@85"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewGlobalPredicateRef","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"global"},{"$type":"Keyword","value":"predicate"},{"$type":"Assignment","feature":"predicate","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@123"},"deprecatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewPredicateIterator","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@56"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DynamicViewPredicateIterator"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@56"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@82"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@139"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@90"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleGlobalStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"global"},{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"style","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@124"},"deprecatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleStyleOrGlobalRef","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@86"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@87"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleAutoLayout","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"autoLayout"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"rankSep","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@176"},"arguments":[]}},{"$type":"Assignment","feature":"nodeSep","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@176"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NotationProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"notation"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@174"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NotesProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"notes"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@174"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomElementProperties","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@94"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@90"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@139"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomRelationProperties","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@95"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@90"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@91"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@143"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NavigateToProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"navigateTo"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationNavigateToProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"navigateTo"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ModelDeployments","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"deployment"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@97"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@102"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentNode","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@172"},"arguments":[]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]},"deprecatedSyntax":false}}]}]},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@174"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@98"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentNodeBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@99"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@102"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@97"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeployedInstance","definition":{"$type":"Group","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@172"},"arguments":[]}],"cardinality":"?"},{"$type":"Keyword","value":"instanceOf"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@174"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@100"},"arguments":[]},"cardinality":"?"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeployedInstanceBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnRef","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"FqnRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@169"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@7"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentRelation","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@101"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@154"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@101"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@174"},"arguments":[]}},{"$type":"Assignment","feature":"technology","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@174"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@103"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentRelationBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentView","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"deployment"},{"$type":"Keyword","value":"view"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@105"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@106"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewRule","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@108"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@107"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewRuleStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"targets","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@120"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@139"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@90"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewRulePredicate","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isInclude","operator":"?=","terminal":{"$type":"Keyword","value":"include"}},{"$type":"Keyword","value":"exclude"}]},{"$type":"Assignment","feature":"expr","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@109"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DeploymentViewRulePredicateExpression","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DeploymentViewRulePredicateExpression"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExpressionV2","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@112"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicateOrWhereV2","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@113"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementPredicateWhereV2"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"where"},{"$type":"Assignment","feature":"where","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicateOrWhereV2","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@115"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"RelationPredicateWhereV2"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"where"},{"$type":"Assignment","feature":"where","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@71"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnExpr","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WildcardExpression"}},{"$type":"Assignment","feature":"isWildcard","operator":"?=","terminal":{"$type":"Keyword","value":"*"}}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@114"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnRefExpr","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"ref","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@101"},"arguments":[]}},{"$type":"Assignment","feature":"selector","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@166"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@167"},"arguments":[]}]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationExpr","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@116"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@118"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"InOutRelationExpr","inferredType":{"$type":"InferredType","name":"RelationExpr"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"InOutRelationExpr"},"feature":"inout","operator":"="},{"$type":"Keyword","value":"->"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IncomingRelationExpr","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@113"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DirectedRelationExpr","inferredType":{"$type":"InferredType","name":"RelationExpr"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@119"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DirectedRelationExpr"},"feature":"source","operator":"="},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@113"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"OutgoingRelationExpr","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@113"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isBidirectional","operator":"?=","terminal":{"$type":"Keyword","value":"<->"}},{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@154"},"arguments":[]},"deprecatedSyntax":false}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnExpressions","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@113"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"FqnExpressions"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@113"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Globals","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"global"}},{"$type":"Keyword","value":"{"},{"$type":"Group","elements":[{"$type":"Assignment","feature":"predicates","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@122"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@123"},"arguments":[]}]},"cardinality":"*"},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@125"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@126"},"arguments":[]}]},"cardinality":"*"}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalPredicateGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"predicateGroup"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@175"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"predicates","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalDynamicPredicateGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"dynamicPredicateGroup"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@175"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"predicates","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@83"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalStyleId","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@175"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@124"},"arguments":[]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@82"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@139"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@90"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalStyleGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"styleGroup"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@124"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@86"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LinkProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"link"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@152"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@174"},"arguments":[]},"cardinality":"?"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ColorProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"color"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"themeColor","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]}},{"$type":"Assignment","feature":"customColor","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@6"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@155"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"OpacityProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"opacity"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@173"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MultipleProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"multiple"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@144"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IconProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"icon"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"libicon","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@151"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"none"},{"$type":"RuleCall","rule":{"$ref":"#/rules@152"},"arguments":[]}]}}]},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ShapeProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"shape"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"BorderStyleValue","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},{"$type":"Keyword","value":"none"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"BorderProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"border"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@133"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SizeValue","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"xs"},{"$type":"Keyword","value":"sm"},{"$type":"Keyword","value":"md"},{"$type":"Keyword","value":"lg"},{"$type":"Keyword","value":"xl"},{"$type":"Keyword","value":"xsmall"},{"$type":"Keyword","value":"small"},{"$type":"Keyword","value":"medium"},{"$type":"Keyword","value":"large"},{"$type":"Keyword","value":"xlarge"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ShapeSizeProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"size"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"PaddingSizeProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"padding"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TextSizeProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"textSize"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"StyleProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@132"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@134"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@129"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@131"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@130"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@136"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@137"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@138"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementStyleProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"style"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@139"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LineProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"line"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ArrowProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"head"},{"$type":"Keyword","value":"tail"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationshipStyleProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@141"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@142"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Boolean","dataType":"boolean","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"true"},{"$type":"Keyword","value":"false"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LineOptions","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"solid"},{"$type":"Keyword","value":"dashed"},{"$type":"Keyword","value":"dotted"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ArrowType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"none"},{"$type":"Keyword","value":"normal"},{"$type":"Keyword","value":"onormal"},{"$type":"Keyword","value":"dot"},{"$type":"Keyword","value":"odot"},{"$type":"Keyword","value":"diamond"},{"$type":"Keyword","value":"odiamond"},{"$type":"Keyword","value":"crow"},{"$type":"Keyword","value":"open"},{"$type":"Keyword","value":"vee"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ThemeColor","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"primary"},{"$type":"Keyword","value":"secondary"},{"$type":"Keyword","value":"muted"},{"$type":"Keyword","value":"slate"},{"$type":"Keyword","value":"blue"},{"$type":"Keyword","value":"indigo"},{"$type":"Keyword","value":"sky"},{"$type":"Keyword","value":"red"},{"$type":"Keyword","value":"gray"},{"$type":"Keyword","value":"green"},{"$type":"Keyword","value":"amber"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementShape","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rectangle"},{"$type":"Keyword","value":"person"},{"$type":"Keyword","value":"browser"},{"$type":"Keyword","value":"mobile"},{"$type":"Keyword","value":"cylinder"},{"$type":"Keyword","value":"storage"},{"$type":"Keyword","value":"queue"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Participant","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"source"},{"$type":"Keyword","value":"target"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomColorValue","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@177"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@176"},"arguments":[]}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IconId","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@163"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Uri","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@164"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@165"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TagId","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@168"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DotId","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@170"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@156"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomColorId","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@175"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},{"$type":"Keyword","value":"element"},{"$type":"Keyword","value":"model"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Id","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@175"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@148"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@147"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@146"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@145"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@149"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]},{"$type":"Keyword","value":"element"},{"$type":"Keyword","value":"model"},{"$type":"Keyword","value":"group"},{"$type":"Keyword","value":"node"},{"$type":"Keyword","value":"deployment"},{"$type":"Keyword","value":"instance"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"EqOperator","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@172"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@171"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"is"}},{"$type":"Assignment","feature":"not","operator":"?=","terminal":{"$type":"Keyword","value":"not"},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","fragment":true,"name":"IsEqual","definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isEqual","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@172"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@171"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","hidden":true,"name":"BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/[\\\\r\\\\n]+/"},"fragment":false},{"$type":"TerminalRule","name":"LIB_ICON","definition":{"$type":"RegexToken","regex":"/(aws|azure|gcp|tech):[-\\\\w]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"URI_WITH_SCHEMA","definition":{"$type":"RegexToken","regex":"/\\\\w+:\\\\/\\\\/\\\\S+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"URI_RELATIVE","definition":{"$type":"RegexToken","regex":"/\\\\.{0,2}\\\\/[^\\\\/]\\\\S+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DotUnderscore","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\._(?![_a-zA-Z])/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DotWildcard","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\.\\\\*{1,2}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Hash","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"#"}},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"StickyDot","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\./"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Dot","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"."}},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NotEqual","definition":{"$type":"RegexToken","regex":"/\\\\!\\\\={1,2}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Eq","definition":{"$type":"RegexToken","regex":"/\\\\={1,2}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Percent","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\d+%/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"String","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"IdTerminal","definition":{"$type":"RegexToken","regex":"/[_]*[a-zA-Z][-\\\\w]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Number","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/\\\\b\\\\d+\\\\b/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Hex","definition":{"$type":"RegexToken","regex":"/\\\\b[a-zA-Z0-9]+\\\\b/"},"fragment":false,"hidden":false}],"types":[{"$type":"Type","name":"LikeC4View","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@37"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@38"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@104"}}]}},{"$type":"Type","name":"StringProperty","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@20"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@45"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@30"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@34"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@10"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@15"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@90"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@91"}}]}},{"$type":"Type","name":"DeploymentNodeOrElementKind","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@3"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@7"}}]}},{"$type":"Type","name":"WhereTagEqual","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@64/definition/elements@0/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@76/definition/elements@0/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@76/definition/elements@2/elements@0/inferredType"}}]}},{"$type":"Type","name":"WhereKindEqual","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@64/definition/elements@1/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@76/definition/elements@1/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@76/definition/elements@3/elements@0/inferredType"}}]}},{"$type":"Type","name":"WhereExpression","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@59"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@71"}}]}},{"$type":"Type","name":"DeploymentElement","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@97"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@99"}}]}},{"$type":"Type","name":"Referenceable","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@97"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@99"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@17"}}]}},{"$type":"Type","name":"FqnReferenceable","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/types@7"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@17"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@21"}}]}},{"$type":"Type","name":"SizeProperty","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@136"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@137"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@138"}}]}}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"interfaces":[],"usedGrammars":[]}`)),lv={languageId:"likec4",fileExtensions:[".c4",".likec4",".like-c4"],caseInsensitive:!1,mode:"production"},V4={skipValidations:!0,recoveryEnabled:!0,nodeLocationTracking:"full"},K4={AstReflection:()=>new _A},Y4={Grammar:()=>H4(),LanguageMetaData:()=>lv,parser:{ParserConfig:()=>V4}},vt={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},xA={silent:{level:-1},fatal:{level:vt.fatal},error:{level:vt.error},warn:{level:vt.warn},log:{level:vt.log},info:{level:vt.info},success:{level:vt.success},fail:{level:vt.fail},ready:{level:vt.info},start:{level:vt.info},box:{level:vt.info},debug:{level:vt.debug},trace:{level:vt.trace},verbose:{level:vt.verbose}};function dv(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function fv(t,e,n=".",r){if(!dv(e))return fv(t,{},n);const i=Object.assign({},e);for(const s in t){if(s==="__proto__"||s==="constructor")continue;const a=t[s];a!=null&&(Array.isArray(a)&&Array.isArray(i[s])?i[s]=[...a,...i[s]]:dv(a)&&dv(i[s])?i[s]=fv(a,i[s],(n?`${n}.`:"")+s.toString()):i[s]=a)}return i}function X4(t){return(...e)=>e.reduce((n,r)=>fv(n,r,""),{})}const J4=X4();function Q4(t){return Object.prototype.toString.call(t)==="[object Object]"}function Z4(t){return!(!Q4(t)||!t.message&&!t.args||t.stack)}let pv=!1;const IA=[];let En=class C1{options;_lastLog;_mockFn;constructor(e={}){const n=e.types||xA;this.options=J4({...e,defaults:{...e.defaults},level:hv(e.level,n),reporters:[...e.reporters||[]]},{types:xA,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(const r in n){const i={type:r,...this.options.defaults,...n[r]};this[r]=this._wrapLogFn(i),this[r].raw=this._wrapLogFn(i,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(e){this.options.level=hv(e,this.options.types,this.options.level)}prompt(e,n){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(e,n)}create(e){const n=new C1({...this.options,...e});return this._mockFn&&n.mockTypes(this._mockFn),n}withDefaults(e){return this.create({...this.options,defaults:{...this.options.defaults,...e}})}withTag(e){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+e:e})}addReporter(e){return this.options.reporters.push(e),this}removeReporter(e){if(e){const n=this.options.reporters.indexOf(e);if(n!==-1)return this.options.reporters.splice(n,1)}else this.options.reporters.splice(0);return this}setReporters(e){return this.options.reporters=Array.isArray(e)?e:[e],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(const e in this.options.types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e].raw}restoreConsole(){for(const e in this.options.types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(e,n){e&&(e.__write||(e.__write=e.write),e.write=r=>{this[n].raw(String(r).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}pauseLogs(){pv=!0}resumeLogs(){pv=!1;const e=IA.splice(0);for(const n of e)n[0]._logFn(n[1],n[2])}mockTypes(e){const n=e||this.options.mockFn;if(this._mockFn=n,typeof n=="function")for(const r in this.options.types)this[r]=n(r,this.options.types[r])||this[r],this[r].raw=this[r]}_wrapLogFn(e,n){return(...r)=>{if(pv){IA.push([this,e,r,n]);return}return this._logFn(e,r,n)}}_logFn(e,n,r){if((e.level||0)>this.level)return!1;const i={date:new Date,args:[],...e,level:hv(e.level,this.options.types)};!r&&n.length===1&&Z4(n[0])?Object.assign(i,n[0]):i.args=[...n],i.message&&(i.args.unshift(i.message),delete i.message),i.additional&&(Array.isArray(i.additional)||(i.additional=i.additional.split(`
164
+ `)),i.args.push(`
165
+ `+i.additional.join(`
166
+ `)),delete i.additional),i.type=typeof i.type=="string"?i.type.toLowerCase():"log",i.tag=typeof i.tag=="string"?i.tag:"";const s=(o=!1)=>{const u=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&u>0){const c=[...this._lastLog.object.args];u>1&&c.push(`(repeated ${u} times)`),this._log({...this._lastLog.object,args:c}),this._lastLog.count=1}o&&(this._lastLog.object=i,this._log(i))};clearTimeout(this._lastLog.timeout);const a=this._lastLog.time&&i.date?i.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=i.date,a<this.options.throttle)try{const o=JSON.stringify([i.type,i.tag,i.args]),u=this._lastLog.serialized===o;if(this._lastLog.serialized=o,u&&(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin)){this._lastLog.timeout=setTimeout(s,this.options.throttle);return}}catch{}s(!0)}_log(e){for(const n of this.options.reporters)n.log(e,{options:this.options})}};function hv(t,e={},n=3){return t===void 0?n:typeof t=="number"?t:e[t]&&e[t].level!==void 0?e[t].level:n}En.prototype.add=En.prototype.addReporter,En.prototype.remove=En.prototype.removeReporter,En.prototype.clear=En.prototype.removeReporter,En.prototype.withScope=En.prototype.withTag,En.prototype.mock=En.prototype.mockTypes,En.prototype.pause=En.prototype.pauseLogs,En.prototype.resume=En.prototype.resumeLogs;function e6(t={}){return new En(t)}function NA(t){const e=process.cwd()+AD;return t.split(`
167
+ `).splice(1).map(n=>n.trim().replace("file://","").replace(e,""))}function t6(t,e){return(e.__write||e.write).call(e,t)}const mv=t=>t?`[${t}]`:"";class OA{formatStack(e,n){const r=" ".repeat((n?.errorLevel||0)+1);return r+NA(e).join(`
168
+ ${r}`)}formatError(e,n){const r=e.message??_D(n,e),i=e.stack?this.formatStack(e.stack,n):"",s=n?.errorLevel||0,a=s>0?`${" ".repeat(s)}[cause]: `:"",o=e.cause?`
169
+
170
+ `+this.formatError(e.cause,{...n,errorLevel:s+1}):"";return a+r+`
171
+ `+i+o}formatArgs(e,n){const r=e.map(i=>i&&typeof i.stack=="string"?this.formatError(i,n):i);return _D(n,...r)}formatDate(e,n){return n.date?e.toLocaleTimeString():""}filterAndJoin(e){return e.filter(Boolean).join(" ")}formatLogObj(e,n){const r=this.formatArgs(e.args,n);return e.type==="box"?`
172
+ `+[mv(e.tag),e.title&&e.title,...r.split(`
173
+ `)].filter(Boolean).map(i=>" > "+i).join(`
174
+ `)+`
175
+ `:this.filterAndJoin([mv(e.type),mv(e.tag),r])}log(e,n){const r=this.formatLogObj(e,{columns:n.options.stdout.columns||0,...n.options.formatOptions});return t6(r+`
176
+ `,e.level<2?n.options.stderr||process.stderr:n.options.stdout||process.stdout)}}const{env:Wi={},argv:FA=[],platform:n6=""}=typeof process>"u"?{}:process,r6="NO_COLOR"in Wi||FA.includes("--no-color"),i6="FORCE_COLOR"in Wi||FA.includes("--color"),s6=n6==="win32",LA=Wi.TERM==="dumb",a6=Wm&&Wm.isatty&&Wm.isatty(1)&&Wi.TERM&&!LA,o6="CI"in Wi&&("GITHUB_ACTIONS"in Wi||"GITLAB_CI"in Wi||"CIRCLECI"in Wi),u6=!r6&&(i6||s6&&!LA||a6||o6);function MA(t,e,n,r,i=e.slice(0,Math.max(0,t))+r,s=e.slice(Math.max(0,t+n.length)),a=s.indexOf(n)){return i+(a<0?s:MA(a,s,n,r))}function c6(t,e,n,r,i){return t<0?n+e+r:n+MA(t,e,r,i)+r}function l6(t,e,n=t,r=t.length+1){return i=>i||!(i===""||i===void 0)?c6((""+i).indexOf(e,r),i,t,e,n):""}function Pe(t,e,n){return l6(`\x1B[${t}m`,`\x1B[${e}m`,n)}const zA={reset:Pe(0,0),bold:Pe(1,22,"\x1B[22m\x1B[1m"),dim:Pe(2,22,"\x1B[22m\x1B[2m"),italic:Pe(3,23),underline:Pe(4,24),inverse:Pe(7,27),hidden:Pe(8,28),strikethrough:Pe(9,29),black:Pe(30,39),red:Pe(31,39),green:Pe(32,39),yellow:Pe(33,39),blue:Pe(34,39),magenta:Pe(35,39),cyan:Pe(36,39),white:Pe(37,39),gray:Pe(90,39),bgBlack:Pe(40,49),bgRed:Pe(41,49),bgGreen:Pe(42,49),bgYellow:Pe(43,49),bgBlue:Pe(44,49),bgMagenta:Pe(45,49),bgCyan:Pe(46,49),bgWhite:Pe(47,49),blackBright:Pe(90,39),redBright:Pe(91,39),greenBright:Pe(92,39),yellowBright:Pe(93,39),blueBright:Pe(94,39),magentaBright:Pe(95,39),cyanBright:Pe(96,39),whiteBright:Pe(97,39),bgBlackBright:Pe(100,49),bgRedBright:Pe(101,49),bgGreenBright:Pe(102,49),bgYellowBright:Pe(103,49),bgBlueBright:Pe(104,49),bgMagentaBright:Pe(105,49),bgCyanBright:Pe(106,49),bgWhiteBright:Pe(107,49)};function d6(t=u6){return t?zA:Object.fromEntries(Object.keys(zA).map(e=>[e,String]))}const xn=d6();function f6(t,e="reset"){return xn[t]||xn[e]}const p6=[String.raw`[\u001B\u009B][[\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\d\/#&.:=?%@~_]+)*|[a-zA-Z\d]+(?:;[-a-zA-Z\d\/#&.:=?%@~_]*)*)?\u0007)`,String.raw`(?:(?:\d{1,4}(?:;\d{0,4})*)?[\dA-PR-TZcf-nq-uy=><~]))`].join("|");function mo(t){return t.replace(new RegExp(p6,"g"),"")}const BA={solid:{tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502"},double:{tl:"\u2554",tr:"\u2557",bl:"\u255A",br:"\u255D",h:"\u2550",v:"\u2551"},doubleSingle:{tl:"\u2553",tr:"\u2556",bl:"\u2559",br:"\u255C",h:"\u2500",v:"\u2551"},doubleSingleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2551"},singleThick:{tl:"\u250F",tr:"\u2513",bl:"\u2517",br:"\u251B",h:"\u2501",v:"\u2503"},singleDouble:{tl:"\u2552",tr:"\u2555",bl:"\u2558",br:"\u255B",h:"\u2550",v:"\u2502"},singleDoubleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2550",v:"\u2502"},rounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2502"}},h6={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};function m6(t,e={}){const n={...e,style:{...h6,...e.style}},r=t.split(`
177
+ `),i=[],s=f6(n.style.borderColor),a={...typeof n.style.borderStyle=="string"?BA[n.style.borderStyle]||BA.solid:n.style.borderStyle};if(s)for(const p in a)a[p]=s(a[p]);const o=n.style.padding%2===0?n.style.padding:n.style.padding+1,u=r.length+o,c=Math.max(...r.map(p=>mo(p).length))+o,l=c+o,d=n.style.marginLeft>0?" ".repeat(n.style.marginLeft):"";if(n.style.marginTop>0&&i.push("".repeat(n.style.marginTop)),n.title){const p=s?s(n.title):n.title,h=a.h.repeat(Math.floor((c-mo(n.title).length)/2)),y=a.h.repeat(c-mo(n.title).length-mo(h).length+o);i.push(`${d}${a.tl}${h}${p}${y}${a.tr}`)}else i.push(`${d}${a.tl}${a.h.repeat(l)}${a.tr}`);const f=n.style.valign==="center"?Math.floor((u-r.length)/2):n.style.valign==="top"?u-r.length-o:u-r.length;for(let p=0;p<u;p++)if(p<f||p>=f+r.length)i.push(`${d}${a.v}${" ".repeat(l)}${a.v}`);else{const h=r[p-f],y=" ".repeat(o),b=" ".repeat(c-mo(h).length);i.push(`${d}${a.v}${y}${h}${b}${a.v}`)}return i.push(`${d}${a.bl}${a.h.repeat(l)}${a.br}`),n.style.marginBottom>0&&i.push("".repeat(n.style.marginBottom)),i.join(`
178
+ `)}const qh=Object.create(null),hd=t=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(t?qh:globalThis),Hi=new Proxy(qh,{get(t,e){return hd()[e]??qh[e]},has(t,e){const n=hd();return e in n||e in qh},set(t,e,n){const r=hd(!0);return r[e]=n,!0},deleteProperty(t,e){if(!e)return!1;const n=hd(!0);return delete n[e],!0},ownKeys(){const t=hd(!0);return Object.keys(t)}}),g6=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",y6=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function w6(){if(globalThis.process?.env)for(const t of y6){const e=t[1]||t[0];if(globalThis.process?.env[e])return{name:t[0].toLowerCase(),...t[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}const qA=w6();qA.name;function ra(t){return t?t!=="false":!1}const v6=globalThis.process?.platform||"",b6=ra(Hi.CI)||qA.ci!==!1,D6=ra(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY),E6=ra(Hi.DEBUG),GA=g6==="test"||ra(Hi.TEST);ra(Hi.MINIMAL);const R6=/^win/i.test(v6);!ra(Hi.NO_COLOR)&&(ra(Hi.FORCE_COLOR)||(D6||R6)&&Hi.TERM);const $6=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number($6?.split(".")[0]);const S6=globalThis.process||Object.create(null),jA={versions:{}};new Proxy(S6,{get(t,e){if(e==="env")return Hi;if(e in t)return t[e];if(e in jA)return jA[e]}});const T6=globalThis.process?.release?.name==="node",k6=!!globalThis.Bun||!!globalThis.process?.versions?.bun,C6=!!globalThis.Deno,A6=!!globalThis.fastly,_6=!!globalThis.Netlify,P6=!!globalThis.EdgeRuntime,x6=globalThis.navigator?.userAgent==="Cloudflare-Workers",I6=[[_6,"netlify"],[P6,"edge-light"],[x6,"workerd"],[A6,"fastly"],[C6,"deno"],[k6,"bun"],[T6,"node"]];function N6(){const t=I6.find(e=>e[0]);if(t)return{name:t[1]}}const O6=N6();O6?.name;function F6({onlyFirst:t=!1}={}){const e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}const L6=F6();function M6(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(L6,"")}function z6(t){return t===161||t===164||t===167||t===168||t===170||t===173||t===174||t>=176&&t<=180||t>=182&&t<=186||t>=188&&t<=191||t===198||t===208||t===215||t===216||t>=222&&t<=225||t===230||t>=232&&t<=234||t===236||t===237||t===240||t===242||t===243||t>=247&&t<=250||t===252||t===254||t===257||t===273||t===275||t===283||t===294||t===295||t===299||t>=305&&t<=307||t===312||t>=319&&t<=322||t===324||t>=328&&t<=331||t===333||t===338||t===339||t===358||t===359||t===363||t===462||t===464||t===466||t===468||t===470||t===472||t===474||t===476||t===593||t===609||t===708||t===711||t>=713&&t<=715||t===717||t===720||t>=728&&t<=731||t===733||t===735||t>=768&&t<=879||t>=913&&t<=929||t>=931&&t<=937||t>=945&&t<=961||t>=963&&t<=969||t===1025||t>=1040&&t<=1103||t===1105||t===8208||t>=8211&&t<=8214||t===8216||t===8217||t===8220||t===8221||t>=8224&&t<=8226||t>=8228&&t<=8231||t===8240||t===8242||t===8243||t===8245||t===8251||t===8254||t===8308||t===8319||t>=8321&&t<=8324||t===8364||t===8451||t===8453||t===8457||t===8467||t===8470||t===8481||t===8482||t===8486||t===8491||t===8531||t===8532||t>=8539&&t<=8542||t>=8544&&t<=8555||t>=8560&&t<=8569||t===8585||t>=8592&&t<=8601||t===8632||t===8633||t===8658||t===8660||t===8679||t===8704||t===8706||t===8707||t===8711||t===8712||t===8715||t===8719||t===8721||t===8725||t===8730||t>=8733&&t<=8736||t===8739||t===8741||t>=8743&&t<=8748||t===8750||t>=8756&&t<=8759||t===8764||t===8765||t===8776||t===8780||t===8786||t===8800||t===8801||t>=8804&&t<=8807||t===8810||t===8811||t===8814||t===8815||t===8834||t===8835||t===8838||t===8839||t===8853||t===8857||t===8869||t===8895||t===8978||t>=9312&&t<=9449||t>=9451&&t<=9547||t>=9552&&t<=9587||t>=9600&&t<=9615||t>=9618&&t<=9621||t===9632||t===9633||t>=9635&&t<=9641||t===9650||t===9651||t===9654||t===9655||t===9660||t===9661||t===9664||t===9665||t>=9670&&t<=9672||t===9675||t>=9678&&t<=9681||t>=9698&&t<=9701||t===9711||t===9733||t===9734||t===9737||t===9742||t===9743||t===9756||t===9758||t===9792||t===9794||t===9824||t===9825||t>=9827&&t<=9829||t>=9831&&t<=9834||t===9836||t===9837||t===9839||t===9886||t===9887||t===9919||t>=9926&&t<=9933||t>=9935&&t<=9939||t>=9941&&t<=9953||t===9955||t===9960||t===9961||t>=9963&&t<=9969||t===9972||t>=9974&&t<=9977||t===9979||t===9980||t===9982||t===9983||t===10045||t>=10102&&t<=10111||t>=11094&&t<=11097||t>=12872&&t<=12879||t>=57344&&t<=63743||t>=65024&&t<=65039||t===65533||t>=127232&&t<=127242||t>=127248&&t<=127277||t>=127280&&t<=127337||t>=127344&&t<=127373||t===127375||t===127376||t>=127387&&t<=127404||t>=917760&&t<=917999||t>=983040&&t<=1048573||t>=1048576&&t<=1114109}function B6(t){return t===12288||t>=65281&&t<=65376||t>=65504&&t<=65510}function q6(t){return t>=4352&&t<=4447||t===8986||t===8987||t===9001||t===9002||t>=9193&&t<=9196||t===9200||t===9203||t===9725||t===9726||t===9748||t===9749||t>=9776&&t<=9783||t>=9800&&t<=9811||t===9855||t>=9866&&t<=9871||t===9875||t===9889||t===9898||t===9899||t===9917||t===9918||t===9924||t===9925||t===9934||t===9940||t===9962||t===9970||t===9971||t===9973||t===9978||t===9981||t===9989||t===9994||t===9995||t===10024||t===10060||t===10062||t>=10067&&t<=10069||t===10071||t>=10133&&t<=10135||t===10160||t===10175||t===11035||t===11036||t===11088||t===11093||t>=11904&&t<=11929||t>=11931&&t<=12019||t>=12032&&t<=12245||t>=12272&&t<=12287||t>=12289&&t<=12350||t>=12353&&t<=12438||t>=12441&&t<=12543||t>=12549&&t<=12591||t>=12593&&t<=12686||t>=12688&&t<=12773||t>=12783&&t<=12830||t>=12832&&t<=12871||t>=12880&&t<=42124||t>=42128&&t<=42182||t>=43360&&t<=43388||t>=44032&&t<=55203||t>=63744&&t<=64255||t>=65040&&t<=65049||t>=65072&&t<=65106||t>=65108&&t<=65126||t>=65128&&t<=65131||t>=94176&&t<=94180||t===94192||t===94193||t>=94208&&t<=100343||t>=100352&&t<=101589||t>=101631&&t<=101640||t>=110576&&t<=110579||t>=110581&&t<=110587||t===110589||t===110590||t>=110592&&t<=110882||t===110898||t>=110928&&t<=110930||t===110933||t>=110948&&t<=110951||t>=110960&&t<=111355||t>=119552&&t<=119638||t>=119648&&t<=119670||t===126980||t===127183||t===127374||t>=127377&&t<=127386||t>=127488&&t<=127490||t>=127504&&t<=127547||t>=127552&&t<=127560||t===127568||t===127569||t>=127584&&t<=127589||t>=127744&&t<=127776||t>=127789&&t<=127797||t>=127799&&t<=127868||t>=127870&&t<=127891||t>=127904&&t<=127946||t>=127951&&t<=127955||t>=127968&&t<=127984||t===127988||t>=127992&&t<=128062||t===128064||t>=128066&&t<=128252||t>=128255&&t<=128317||t>=128331&&t<=128334||t>=128336&&t<=128359||t===128378||t===128405||t===128406||t===128420||t>=128507&&t<=128591||t>=128640&&t<=128709||t===128716||t>=128720&&t<=128722||t>=128725&&t<=128727||t>=128732&&t<=128735||t===128747||t===128748||t>=128756&&t<=128764||t>=128992&&t<=129003||t===129008||t>=129292&&t<=129338||t>=129340&&t<=129349||t>=129351&&t<=129535||t>=129648&&t<=129660||t>=129664&&t<=129673||t>=129679&&t<=129734||t>=129742&&t<=129756||t>=129759&&t<=129769||t>=129776&&t<=129784||t>=131072&&t<=196605||t>=196608&&t<=262141}function G6(t){if(!Number.isSafeInteger(t))throw new TypeError(`Expected a code point, got \`${typeof t}\`.`)}function j6(t,{ambiguousAsWide:e=!1}={}){return G6(t),B6(t)||q6(t)||e&&z6(t)?2:1}const U6=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,W6=globalThis.Intl?.Segmenter?new Intl.Segmenter:{segment:t=>t.split("")},H6=new RegExp("^\\p{Default_Ignorable_Code_Point}$","u");function V6(t,e={}){if(typeof t!="string"||t.length===0)return 0;const{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=e;if(r||(t=M6(t)),t.length===0)return 0;let i=0;const s={ambiguousAsWide:!n};for(const{segment:a}of W6.segment(t)){const o=a.codePointAt(0);if(!(o<=31||o>=127&&o<=159)&&!(o>=8203&&o<=8207||o===65279)&&!(o>=768&&o<=879||o>=6832&&o<=6911||o>=7616&&o<=7679||o>=8400&&o<=8447||o>=65056&&o<=65071)&&!(o>=55296&&o<=57343)&&!(o>=65024&&o<=65039)&&!H6.test(a)){if(U6().test(a)){i+=2;continue}i+=j6(o,s)}}return i}function K6(){const{env:t}=ot,{TERM:e,TERM_PROGRAM:n}=t;return ot.platform!=="win32"?e!=="linux":!!t.WT_SESSION||!!t.TERMINUS_SUBLIME||t.ConEmuTask==="{cmd::Cmder}"||n==="Terminus-Sublime"||n==="vscode"||e==="xterm-256color"||e==="alacritty"||e==="rxvt-unicode"||e==="rxvt-unicode-256color"||t.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const Y6={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},X6={0:"red",1:"yellow"},J6=K6(),Mr=(t,e)=>J6?t:e,UA={error:Mr("\u2716","\xD7"),fatal:Mr("\u2716","\xD7"),ready:Mr("\u2714","\u221A"),warn:Mr("\u26A0","\u203C"),info:Mr("\u2139","i"),success:Mr("\u2714","\u221A"),debug:Mr("\u2699","D"),trace:Mr("\u2192","\u2192"),fail:Mr("\u2716","\xD7"),start:Mr("\u25D0","o"),log:""};function WA(t){return typeof Intl!="object"||!Intl.Segmenter?mo(t).length:V6(t)}class Q6 extends OA{formatStack(e,n){const r=" ".repeat((n?.errorLevel||0)+1);return`
179
+ ${r}`+NA(e).map(i=>" "+i.replace(/^at +/,s=>xn.gray(s)).replace(/\((.+)\)/,(s,a)=>`(${xn.cyan(a)})`)).join(`
180
+ ${r}`)}formatType(e,n,r){const i=Y6[e.type]||X6[e.level]||"gray";if(n)return eW(i)(xn.black(` ${e.type.toUpperCase()} `));const s=typeof UA[e.type]=="string"?UA[e.type]:e.icon||e.type;return s?Z6(i)(s):""}formatLogObj(e,n){const[r,...i]=this.formatArgs(e.args,n).split(`
181
+ `);if(e.type==="box")return m6(Gh(r+(i.length>0?`
182
+ `+i.join(`
183
+ `):"")),{title:e.title?Gh(e.title):void 0,style:e.style});const s=this.formatDate(e.date,n),a=s&&xn.gray(s),o=e.badge??e.level<2,u=this.formatType(e,o,n),c=e.tag?xn.gray(e.tag):"";let l;const d=this.filterAndJoin([u,Gh(r)]),f=this.filterAndJoin(n.columns?[c,a]:[c]),p=(n.columns||0)-WA(d)-WA(f)-2;if(l=p>0&&(n.columns||0)>=80?d+" ".repeat(p)+f:(f?`${xn.gray(`[${f}]`)} `:"")+d,l+=Gh(i.length>0?`
184
+ `+i.join(`
185
+ `):""),e.type==="trace"){const h=new Error("Trace: "+e.message);l+=this.formatStack(h.stack||"")}return o?`
186
+ `+l+`
187
+ `:l}}function Gh(t){return t.replace(/`([^`]+)`/gm,(e,n)=>xn.cyan(n)).replace(/\s+_([^_]+)_\s+/gm,(e,n)=>` ${xn.underline(n)} `)}function Z6(t="white"){return xn[t]||xn.white}function eW(t="bgWhite"){return xn[`bg${t[0].toUpperCase()}${t.slice(1)}`]||xn.bgWhite}function HA(t={}){let e=tW();return process.env.CONSOLA_LEVEL&&(e=Number.parseInt(process.env.CONSOLA_LEVEL)??e),e6({level:e,defaults:{level:e},stdout:process.stdout,stderr:process.stderr,prompt:(...n)=>import("../chunks/prompt.mjs").then(r=>r.prompt(...n)),reporters:t.reporters||[t.fancy??!(b6||GA)?new Q6:new OA],...t})}function tW(){return E6?vt.debug:GA?vt.warn:vt.info}HA();const nW=t=>{gv.forEach(e=>{rW(t,e)})},gv=["name","message","stack","cause","errors"],rW=(t,e)=>{const n=yv(t,e);if(n!==void 0){if(iW(n)){yi(t,e,t[e]);return}sW(n)&&VA(t,e,n)}},yv=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?void 0:yv(r,e)},iW=({get:t,set:e})=>t!==void 0&&e===void 0,sW=({enumerable:t,writable:e})=>t||!e,yi=(t,e,n)=>{VA(t,e,{value:n})},VA=(t,e,n)=>{Object.defineProperty(t,e,{...n,..."get"in n||"set"in n?{}:{writable:!0},enumerable:!1,configurable:!0})},aW=(t,e)=>{if(Array.isArray(t.errors)){const n=t.errors.filter(oW).map(e).filter(Boolean);yi(t,"errors",n)}else uW(t)?yi(t,"errors",[]):t.errors!==void 0&&cW(t)},oW=t=>t!==void 0,uW=t=>"AggregateError"in globalThis&&(t.name==="AggregateError"||t instanceof AggregateError),cW=t=>{delete t.errors,t.errors!==void 0&&yi(t,"errors",[])},lW=(t,e)=>{if(!("cause"in t))return;const n=t.cause===void 0?t.cause:e(t.cause);n===void 0?delete t.cause:yi(t,"cause",n)},dW=t=>fW(t)||pW(t),fW=t=>{try{return t instanceof Error}catch{return!1}},pW=t=>{try{return hW.has(Object.prototype.toString.call(t))}catch{return!1}},hW=new Set(["[object Error]","[object DOMException]","[object DOMError]","[object Exception]"]);function jh(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}const mW=t=>!Object.isExtensible(t)||gv.some(e=>gW(t,e)||yW(t,e)),gW=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);return n!==void 0&&!n.configurable},yW=(t,e)=>{try{return t[e],!1}catch{return!0}},wv=t=>{const e=wW(t.message,t.name);yi(t,"stack",e)},wW=(t="",e="Error")=>{const n=vW(e),{stack:r}=new n(t);return typeof r=="string"&&r!==""?r:`${e}: ${t}`},vW=t=>{const e={value:t,enumerable:!1,writable:!0,configurable:!0},n=Object.defineProperty(class extends Error{},"name",e);return Object.defineProperty(n.prototype,"name",e),n},bW=t=>{const e={};for(const n of DW(t))try{const r=t[n],{enumerable:i,configurable:s,writable:a=!0}=yv(t,n);Object.defineProperty(e,n,{value:r,enumerable:i,configurable:s,writable:a})}catch{}return e},DW=t=>{const e=EW(t);for(const n of gv)RW(t,n)&&e.push(n);return e},EW=t=>{try{return Reflect.ownKeys(t)}catch{return[]}},RW=(t,e)=>{try{return e in t&&!Object.hasOwn(t,e)}catch{return!1}},KA=t=>{const{name:e,message:n,stack:r,cause:i,errors:s,...a}=bW(t),o=$W(n,a),u=CW(e,o);return n===o&&AW(u,a),Object.entries({name:e,stack:r,cause:i,errors:s}).forEach(([c,l])=>{_W(u,c,l)}),r===void 0&&wv(u),u},$W=(t,e)=>typeof t=="string"&&t!==""?t:kW(SW(e)),SW=t=>{try{return JSON.stringify(t)}catch{return TW(t)}},TW=t=>{try{return String(t)}catch{return"Invalid error"}},kW=t=>t.length<YA?t:`${t.slice(0,YA)}...`,YA=1e3,CW=(t,e)=>t==="AggregateError"&&"AggregateError"in globalThis?new AggregateError([],e):t in XA?new XA[t](e):new Error(e),XA={Error,ReferenceError,TypeError,SyntaxError,RangeError,URIError,EvalError},AW=(t,e)=>{for(const n in e)n in t||(t[n]=e[n])},_W=(t,e,n)=>{n!==void 0&&yi(t,e,n)},PW=t=>{try{const e=new Error(String(t));return wv(e),e}catch(e){return e}},{toString:xW}=Object.prototype,IW=t=>NW(t)?KA(t):dW(t)?OW(t)?KA(t):t:PW(t),NW=t=>{try{return jh(t)}catch{return!1}},OW=t=>FW(t)||mW(t)||LW(t),FW=t=>{try{return xW.call(t)==="[object Object]"}catch{return!0}},LW=t=>typeof t.constructor!="function"||typeof t.constructor.name!="string"||t.constructor.name===""||t.constructor.prototype!==Object.getPrototypeOf(t),Uh=(t,{shallow:e=!1}={})=>JA(t,[],e),JA=(t,e,n)=>{if(e.includes(t))return;const r=n?MW:s=>JA(s,[...e,t],n),i=IW(t);return zW(i,r),i},MW=t=>t,zW=(t,e)=>{BW(t),qW(t),GW(t),lW(t,e),aW(t,e),nW(t)},BW=t=>{if(Wh(t.name))return;const e=Object.getPrototypeOf(t).name,n=Wh(e)?e:t.constructor.name;yi(t,"name",n)},qW=t=>{Wh(t.message)||yi(t,"message","")},GW=t=>{Wh(t.stack)||wv(t)},Wh=t=>typeof t=="string"&&t!=="",jW=(t,e,n=t.name)=>{if(UW(e),typeof n!="string")throw new TypeError(`currentName must be a string: ${n}`);return n},UW=t=>{if(!WW(t))throw new TypeError(`ErrorClass must be a class: ${t}`);if(!QA(t.prototype))throw new TypeError(`ErrorClass must inherit from Error: ${t}`);if(!HW(t))throw new TypeError(`ErrorClass must be have a valid constructor: ${t}`)},WW=t=>typeof t=="function"&&typeof t.prototype=="object"&&t.prototype!==null,QA=t=>t!==null&&(t.name==="Error"||QA(Object.getPrototypeOf(t))),HW=t=>typeof t.prototype.constructor=="function",ZA=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},VW=(t,e)=>{Object.getPrototypeOf(t)!==e.prototype&&(KW(t,e),n0(t,"constructor"),YW(t,e))},KW=(t,e)=>{Object.setPrototypeOf(t,e.prototype)},YW=(t,e)=>{n0(t,"name");const n=e0(e.prototype);t.name!==n&&ZA(t,"name",n)},e0=t=>XW(t)??JW(t)??e0(Object.getPrototypeOf(t)),XW=t=>Object.hasOwn(t,"name")&&t0(t.name)?t.name:void 0,JW=t=>typeof t.constructor=="function"&&t0(t.constructor.name)?t.constructor.name:void 0,t0=t=>typeof t=="string"&&t!=="",n0=(t,e)=>{Object.hasOwn(t,e)&&delete t[e]},QW=(t,e)=>{if(!ZW(t,e))return;const n=t9(t,e);ZA(t,"stack",n)},ZW=(t,e)=>e!==t.name&&e!==""&&t.stack.includes(e)&&e9(),e9=()=>{class t extends Error{}const e={value:r0,enumerable:!1,writable:!0,configurable:!0};Object.defineProperty(t,"name",e),Object.defineProperty(t.prototype,"name",e);const{stack:n}=new t("");return typeof n=="string"&&n.includes(r0)},r0="SetErrorClassError",t9=({name:t,stack:e},n)=>{if(e.startsWith(`${n}: `))return e.replace(n,t);const r=n9(n,t),[i,s]=r.find(([a])=>e.includes(a));return e.replace(i,s)},n9=(t,e)=>[[`
188
+ ${t}: `,`
189
+ ${e}: `],[`${t}: `,`${e}: `],[`${t} `,`${e} `],[t,e]],r9=(t,e,n)=>{const r=Uh(t),i=jW(r,e,n);return VW(r,e),QW(r,i),r},i9=(t,e)=>e.configurable===!1?s9(t,e):u9(t,e),s9=(t,e)=>({...e,...a9(t,e),...o9(t,e)}),a9=(t,e)=>e.writable===!0&&t.writable===!1?{writable:!1}:{},o9=(t,e)=>t.hasValue&&"value"in e&&e.writable===!0?{value:t.value}:{},u9=(t,e)=>{const n=md(t.enumerable,e.enumerable,!0),r=md(t.writable,e.writable,!0),i=md(t.configurable,e.configurable,!0);return{...c9(t,e,r),enumerable:n,configurable:i}},c9=(t,e,n)=>t.hasValue?{value:t.value,writable:n}:!i0(t)&&!i0(e)?{value:e.value,writable:n}:{get:md(t.get,e.get),set:md(t.set,e.set)},i0=({get:t,set:e})=>t!==void 0||e!==void 0,md=(t,e,n)=>t??e??n,l9=(t,e,n)=>{if(!d9(t))throw new TypeError(`Argument must be an object: ${t}`);if(!f9(e))throw new TypeError(`Property key must be a string, a symbol or an integer: ${e}`);return p9(n)},d9=t=>typeof t=="object"&&t!==null,f9=t=>{const e=typeof t;return e==="string"||e==="symbol"||e==="number"},p9=t=>{if(!jh(t))throw new TypeError(`Descriptor must be a plain object: ${t}`);const{enumerable:e,writable:n,configurable:r,value:i,get:s,set:a,...o}=t,u="value"in t;return h9({enumerable:e,writable:n,configurable:r,get:s,set:a,unknownProps:o,hasValue:u}),{enumerable:e,writable:n,configurable:r,value:i,get:s,set:a,hasValue:u}},h9=({enumerable:t,writable:e,configurable:n,get:r,set:i,unknownProps:s,hasValue:a})=>{s0(a,r,"get"),s0(a,i,"set"),vv(t,"enumerable"),vv(e,"writable"),vv(n,"configurable"),g9(s)},s0=(t,e,n)=>{if(m9(e,n),t&&e!==void 0)throw new TypeError(`Descriptor property "value" and "${n}" must not both be defined: ${e}`)},m9=(t,e)=>{if(t!==void 0&&typeof t!="function")throw new TypeError(`Descriptor property "${e}" must be a function: ${t}`)},vv=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`Descriptor property "${e}" must be a boolean: ${t}`)},g9=t=>{const[e]=Object.keys(t);if(e!==void 0)throw new TypeError(`Unknown descriptor property "${e}": ${t[e]}`)},y9=(t,e,n)=>{const r=l9(t,e,n),i=a0(t,e),s=i9(r,i);return w9(t,e,s),t},a0=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?{}:a0(r,e)},w9=(t,e,n)=>{try{Object.defineProperty(t,e,n)}catch{}},v9=(t,e,n)=>{if(n!==void 0)return o0(t,e,n);try{delete t[e]}catch{}if(t[e]!==void 0)return o0(t,e)},o0=(t,e,n)=>{const r=b9(e);y9(t,e,{value:n,...r})},b9=t=>typeof t=="string"&&t.startsWith("_")?{enumerable:!1}:{},D9=t=>E9(t)||R9(t),E9=t=>{try{return t instanceof Error}catch{return!1}},R9=t=>{try{return $9.has(Object.prototype.toString.call(t))}catch{return!1}},$9=new Set(["[object Error]","[object DOMException]","[object DOMError]","[object Exception]"]),S9=(t,e,n={})=>{if(u0(t,"First argument"),u0(e,"Second argument"),!jh(n))throw new TypeError(`Options must be a plain object: ${n}`);const{soft:r=!1}=n;if(typeof r!="boolean")throw new TypeError(`Option "soft" must be a boolean: ${r}`);return{soft:r}},u0=(t,e)=>{if(t===void 0)throw new TypeError(`${e} is required.`);if(!T9(t))throw new TypeError(`${e} must be a plain object or an error: ${t}`)},T9=t=>jh(t)||D9(t),k9=({error:t,props:e,propName:n,soft:r})=>C9(n)||!P9.call(e,n)||r&&t[n]!==void 0,C9=t=>t in A9||_9.has(t),A9=new Error("check"),_9=new Set(["prototype","errors","cause"]),{propertyIsEnumerable:P9}=Object.prototype,x9=(t,e,n)=>{const{soft:r}=S9(t,e,n);for(const i of Reflect.ownKeys(e))I9({error:t,props:e,propName:i,soft:r});return t},I9=({error:t,props:e,propName:n,soft:r})=>{k9({error:t,props:e,propName:n,soft:r})||v9(t,n,e[n])},Hh=(t,e,n)=>{Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!1,configurable:!0})},N9=(t,e)=>{if(t.errors===void 0)return;const n=t.errors.map(r=>e(r).error).filter(Boolean);Hh(t,"errors",n)},O9=({target:t,source:e,parent:n,child:r})=>{if(!c0(t)){F9(t,e);return}c0(e)&&Hh(t,"errors",[...r.errors,...n.errors])},F9=(t,e)=>{e.errors!==void 0&&Hh(t,"errors",e.errors)},c0=t=>t.errors!==void 0&&t.errors.length!==0,L9=(t,e,n=t.message)=>{if(typeof e!="string")throw new TypeError(`newMessage must be a string: ${e}`);if(typeof n!="string")throw new TypeError(`currentMessage must be a string: ${n}`);return n},M9=({name:t,stack:e},n,r)=>r!==""&&e.includes(r)?z9({name:t,stack:e,newMessage:n,currentMessage:r}):q9(t,e,n),z9=({name:t,stack:e,newMessage:n,currentMessage:r})=>{const i=B9(t,n,r),[s,a]=i.find(([o])=>e.includes(o));return e.replace(s,a)},B9=(t,e,n)=>[[`${t}: ${n}`,`${t}: ${e}`],[`: ${n}`,`: ${e}`],[`
190
+ ${n}`,`
191
+ ${e}`],[` ${n}`,` ${e}`],[n,e]],q9=(t,e,n)=>{const r=`${t}: `,i=n.trimEnd();return e===t||e.startsWith(`${t}
192
+ `)?e.replace(t,`${r}${i}`):e.startsWith(r)?e.replace(r,`${r}${i}
193
+ `):`${r}${i}
194
+ ${e}`},G9=(t,e,n)=>{const r=Uh(t),i=L9(r,e,n);return d0(r,"message",e),j9(r,e,i),r},j9=(t,e,n)=>{if(e===n||!U9())return;const r=M9(t,e,n);d0(t,"stack",r)},U9=()=>{const{stack:t}=new Error(l0);return typeof t=="string"&&t.includes(l0)},l0="set-error-message test message",d0=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},f0=(t,e,n)=>{if(typeof e!="string")throw new TypeError(`Second argument must be a message string: ${e}`);const r=Uh(t),i=W9(e,r.message);return G9(r,i,n)},W9=(t,e)=>{const n=t.trim(),r=e.trim();return n===""?r:r===""?n:H9(n,r,t)},H9=(t,e,n)=>t.endsWith(V9)?n.endsWith(K9)?`${t}
195
+ ${e}`:`${t} ${e}`:`${e}
196
+ ${t}`,V9=":",K9=`
197
+ `,Y9=({parent:t,child:e,target:n,stackError:r})=>{const i=t.message;return n.message=e.message,f0(n,i,r.message)},X9=(t,e)=>p0(t)===e,p0=t=>typeof t=="object"&&t!==null?t.stack:void 0,J9=({wrap:t,target:e,source:n,childHasStack:r})=>t===r?e:(Hh(e,"stack",n.stack),n),Q9=t=>{const{wrap:e,name:n}=t;return typeof e!="boolean"?n==="Error":(Object.hasOwn(t,"wrap")&&delete t.wrap,e)},Z9=t=>h0(t,[]).error,h0=(t,e)=>{if(e.includes(t))return{};const n=u=>h0(u,[...e,t]),r=p0(t),i=Uh(t,{shallow:!0}),s=X9(i,r);N9(i,n);const{parent:a,childHasStack:o}=e7(i,n);return{error:a,errorHasStack:s||o}},e7=(t,e)=>{const n=Q9(t);if(t.cause===void 0)return{parent:t,childHasStack:!1};const{error:r,errorHasStack:i}=e(t.cause);return delete t.cause,{parent:t7({parent:t,child:r,childHasStack:i,wrap:n}),childHasStack:i}},t7=({parent:t,child:e,childHasStack:n,wrap:r})=>{if(e===void 0)return t;const[i,s]=r?[e,t]:[t,e],a=J9({wrap:r,target:i,source:s,childHasStack:n}),o=r9(i,i.constructor,a.name),u=Y9({parent:t,child:e,target:o,stackError:a});return O9({target:u,source:s,parent:t,child:e}),x9(u,s,{soft:!r})};function m0(t){return function(e,n){if(typeof n?.toJSON=="function"&&(n=n.toJSON()),!(n!==null&&typeof n=="object"))return n;if(t.has(n))return"[Circular]";t.add(n);const r=Array.isArray(n)?[]:{};for(const[i,s]of Object.entries(n))r[i]=m0(t)(i,s);return t.delete(n),r}}function g0(t,{indentation:e}={}){return JSON.stringify(t,m0(new WeakSet),e)}const n7=t=>t.split(`
198
+ `).map(e=>e.trim().replace("file://",""));function r7(t,e=n7){const n={message:""},r=t.args.find(s=>s instanceof Error);if(!r)return n.message=t.args.map(s=>typeof s=="string"?s:g0(s)).join("; "),typeof t.tag=="string"&&t.tag.length>0&&(n.message=`[${t.tag}] ${n.message}`),n;const i=t.args.reduce((s,a)=>{if(a===r)return s;const o=typeof a=="string"?a:g0(a);return f0(s,o)},Z9(r));if(n.message=i.message,n.error={message:i.message,name:i.name},i.stack){const s=e(i.stack);n.error.stack=s.join(`
199
+ `),n.message+=`
200
+ `+s.slice(1).map(a=>" "+a).join(`
201
+ `)}return typeof t.tag=="string"&&t.tag.length>0&&(n.message=`[${t.tag}] ${n.message}`),n}function i7(t){const e=aN()+AD;return t.split(`
202
+ `).map(n=>n.trim().replace("file://","").replace(e,""))}function s7(t){return r7(t,i7)}const y0=vt.debug,zt=HA({level:y0,defaults:{level:y0},throttle:2,throttleMin:500,formatOptions:{colors:!0,compact:!1,date:!1}}),Me=zt.withTag("lsp");function w0(t){Me.error(t)}function ve(t){Me.warn(t)}function a7(t){Me.level=vt[t]}function o7(t){const e={log:(n,r)=>{const{message:i,error:s}=s7(n);switch(n.type){case"silent":break;case"verbose":case"trace":{t.tracer.log(i);break}case"debug":{t.console.debug(i);break}case"log":{t.console.log(i);break}case"info":case"box":case"ready":case"start":case"success":{t.console.info(i);break}case"warn":{t.console.warn(i);break}case"fail":case"error":case"fatal":{t.console.error(i),s?t.telemetry.logEvent({eventName:"error",...s}):t.telemetry.logEvent({eventName:"error",message:i});break}default:Ae(n.type)}}};zt.setReporters([e]),Me.setReporters(zt.options.reporters)}const u7={fileSystemProvider:()=>new l7},c7=t=>lv.fileExtensions.some(e=>t.endsWith(e));let l7=class extends n4{async readDirectory(e){const n=[];try{const r=await new t4.fdir().withSymlinks().withFullPaths().filter(c7).crawl(e.fsPath).withPromise();for(const i of r)n.push({isFile:!0,isDirectory:!1,uri:Jt.file(i)})}catch(r){Me.error(r)}return n}};var d7=Object.getOwnPropertyNames,f7=Object.getOwnPropertySymbols,p7=Object.prototype.hasOwnProperty;function v0(t,e){return function(r,i,s){return t(r,i,s)&&e(r,i,s)}}function Vh(t){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,i);var s=i.cache,a=s.get(n),o=s.get(r);if(a&&o)return a===r&&o===n;s.set(n,r),s.set(r,n);var u=t(n,r,i);return s.delete(n),s.delete(r),u}}function b0(t){return d7(t).concat(f7(t))}var h7=Object.hasOwn||function(t,e){return p7.call(t,e)};function ia(t,e){return t===e||!t&&!e&&t!==t&&e!==e}var m7="__v",g7="__o",y7="_owner",D0=Object.getOwnPropertyDescriptor,E0=Object.keys;function w7(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function v7(t,e){return ia(t.getTime(),e.getTime())}function b7(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function D7(t,e){return t===e}function R0(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),s=t.entries(),a,o,u=0;(a=s.next())&&!a.done;){for(var c=e.entries(),l=!1,d=0;(o=c.next())&&!o.done;){if(i[d]){d++;continue}var f=a.value,p=o.value;if(n.equals(f[0],p[0],u,d,t,e,n)&&n.equals(f[1],p[1],f[0],p[0],t,e,n)){l=i[d]=!0;break}d++}if(!l)return!1;u++}return!0}var E7=ia;function R7(t,e,n){var r=E0(t),i=r.length;if(E0(e).length!==i)return!1;for(;i-- >0;)if(!S0(t,e,n,r[i]))return!1;return!0}function gd(t,e,n){var r=b0(t),i=r.length;if(b0(e).length!==i)return!1;for(var s,a,o;i-- >0;)if(s=r[i],!S0(t,e,n,s)||(a=D0(t,s),o=D0(e,s),(a||o)&&(!a||!o||a.configurable!==o.configurable||a.enumerable!==o.enumerable||a.writable!==o.writable)))return!1;return!0}function $7(t,e){return ia(t.valueOf(),e.valueOf())}function S7(t,e){return t.source===e.source&&t.flags===e.flags}function $0(t,e,n){var r=t.size;if(r!==e.size)return!1;if(!r)return!0;for(var i=new Array(r),s=t.values(),a,o;(a=s.next())&&!a.done;){for(var u=e.values(),c=!1,l=0;(o=u.next())&&!o.done;){if(!i[l]&&n.equals(a.value,o.value,a.value,o.value,t,e,n)){c=i[l]=!0;break}l++}if(!c)return!1}return!0}function T7(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}function k7(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function S0(t,e,n,r){return(r===y7||r===g7||r===m7)&&(t.$$typeof||e.$$typeof)?!0:h7(e,r)&&n.equals(t[r],e[r],r,r,t,e,n)}var C7="[object Arguments]",A7="[object Boolean]",_7="[object Date]",P7="[object Error]",x7="[object Map]",I7="[object Number]",N7="[object Object]",O7="[object RegExp]",F7="[object Set]",L7="[object String]",M7="[object URL]",z7=Array.isArray,T0=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,k0=Object.assign,B7=Object.prototype.toString.call.bind(Object.prototype.toString);function q7(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areErrorsEqual,i=t.areFunctionsEqual,s=t.areMapsEqual,a=t.areNumbersEqual,o=t.areObjectsEqual,u=t.arePrimitiveWrappersEqual,c=t.areRegExpsEqual,l=t.areSetsEqual,d=t.areTypedArraysEqual,f=t.areUrlsEqual;return function(h,y,b){if(h===y)return!0;if(h==null||y==null)return!1;var w=typeof h;if(w!==typeof y)return!1;if(w!=="object")return w==="number"?a(h,y,b):w==="function"?i(h,y,b):!1;var E=h.constructor;if(E!==y.constructor)return!1;if(E===Object)return o(h,y,b);if(z7(h))return e(h,y,b);if(T0!=null&&T0(h))return d(h,y,b);if(E===Date)return n(h,y,b);if(E===RegExp)return c(h,y,b);if(E===Map)return s(h,y,b);if(E===Set)return l(h,y,b);var $=B7(h);return $===_7?n(h,y,b):$===O7?c(h,y,b):$===x7?s(h,y,b):$===F7?l(h,y,b):$===N7?typeof h.then!="function"&&typeof y.then!="function"&&o(h,y,b):$===M7?f(h,y,b):$===P7?r(h,y,b):$===C7?o(h,y,b):$===A7||$===I7||$===L7?u(h,y,b):!1}}function G7(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?gd:w7,areDatesEqual:v7,areErrorsEqual:b7,areFunctionsEqual:D7,areMapsEqual:r?v0(R0,gd):R0,areNumbersEqual:E7,areObjectsEqual:r?gd:R7,arePrimitiveWrappersEqual:$7,areRegExpsEqual:S7,areSetsEqual:r?v0($0,gd):$0,areTypedArraysEqual:r?gd:T7,areUrlsEqual:k7};if(n&&(i=k0({},i,n(i))),e){var s=Vh(i.areArraysEqual),a=Vh(i.areMapsEqual),o=Vh(i.areObjectsEqual),u=Vh(i.areSetsEqual);i=k0({},i,{areArraysEqual:s,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:u})}return i}function j7(t){return function(e,n,r,i,s,a,o){return t(e,n,o)}}function U7(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,s=t.strict;if(r)return function(u,c){var l=r(),d=l.cache,f=d===void 0?e?new WeakMap:void 0:d,p=l.meta;return n(u,c,{cache:f,equals:i,meta:p,strict:s})};if(e)return function(u,c){return n(u,c,{cache:new WeakMap,equals:i,meta:void 0,strict:s})};var a={cache:void 0,equals:i,meta:void 0,strict:s};return function(u,c){return n(u,c,a)}}var bv=Vi();Vi({strict:!0}),Vi({circular:!0}),Vi({circular:!0,strict:!0}),Vi({createInternalComparator:function(){return ia}}),Vi({strict:!0,createInternalComparator:function(){return ia}}),Vi({circular:!0,createInternalComparator:function(){return ia}}),Vi({circular:!0,createInternalComparator:function(){return ia},strict:!0});function Vi(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,s=t.strict,a=s===void 0?!1:s,o=G7(t),u=q7(o),c=r?r(u):j7(u);return U7({circular:n,comparator:u,createState:i,equals:c,strict:a})}function C0(t,e){const n=t.nodes.map(i=>{const s=e.nodes[i.id];if(!s)return i;const{x:a,y:o,width:u,height:c}=s;return{...i,width:u,height:c,position:[a,o]}}),r=t.edges.map(i=>{const s=e.edges[i.id];return s?{...i,...s}:i});return{...t,bounds:{x:e.x,y:e.y,width:e.width,height:e.height},nodes:n,edges:r}}const A0=(t,e)=>t.width>e.width+10||t.height>e.height+10;function W7(t,e){if(t.hash===e.hash)return{diagram:C0(t,e)};if(bv(t.autoLayout,e.autoLayout)&&t.nodes.every(r=>{const i=e.nodes[r.id];return!!i&&(r.children.length>0&&i.isCompound||r.children.length===0&&!i.isCompound)&&(i.isCompound||A0(r,i)===!1)})&&t.edges.every(r=>{const i=e.edges[r.id];return!!i&&(!r.labelBBox&&!i.labelBBox||!!r.labelBBox&&!!i.labelBBox&&r.labelBBox.width<=i.labelBBox.width&&r.labelBBox.height<=i.labelBBox.height)}))return{diagram:C0(t,e)};const n=t.nodes.reduce((r,i)=>{const s=e.nodes[i.id];if(i.children.length>0||!s)return r;const a={id:i.id,center:{x:Math.round(s.x+s.width/2),y:Math.round(s.y+s.height/2)}};return s.isCompound||A0(i,s)||(a.fixedsize={width:s.width,height:s.height}),r.push(a),r},[]);return{relayout:{x:e.x,y:e.y,height:e.height,nodes:n,edges:kp(e.edges).flatMap(([r,i])=>i.dotpos?{id:r,dotpos:i.dotpos}:[])}}}function _0(t){return typeof t=="object"&&t!==null&&typeof t.id=="string"}function Dv(t){return typeof t=="object"&&t!==null&&t.$$type==="Node"&&typeof t.id=="string"}function P0(t){return Dv(t)||_0(t)}function yd(t){return typeof t=="string"||P0(t)}function H7(t){return Array.isArray(t)&&t.every(yd)}function V7(t){return["n","ne","e","se","s","sw","w","nw","c"].includes(t)}function x0(t){if(P0(t))return t;const[e,n,r]=t.split(":");return V7(r)?{id:e,port:n,compass:r}:{id:e,port:n}}function K7(t){if(t.length<2&&(yd(t[0])&&yd(t[1]))===!1)throw Error("EdgeTargets must have at least 2 elements.");return t.map(e=>x0(e))}const Kh=Object.seal({Graph:null,Digraph:null,Subgraph:null,Node:null,Edge:null});function Y7(t){return Object.assign(Object.seal(Object.assign({},Kh)),t)}function X7(...t){const[e,...n]=t;return(...r)=>n.reduce((i,s)=>s(i),e(...r))}function er(t,...e){return X7(t,...e)}const J7=t=>(...e)=>n=>t(n,...e),Q7=t=>({[Symbol.iterator]:t}),mr=J7((t,e)=>Array.from(Q7(function*(){for(const n of t)yield e(n)})));class I0{options;getLocation(){return this.options?.locationFunction?.()??null}constructor(e){this.options=e}createElement(e,n,r=[]){return{location:this.getLocation(),...n,type:e,children:r}}}const Ze=I0.prototype.createElement.bind(new I0),Z7=/\r?\n/;function gr(t){return e=>e.join(t)}function eH(t){return e=>t+e+t}function Ki(t,e){return n=>t+n+e}function Yh(t){return e=>t+e}const N0=t=>t.replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/"/g,'\\"'),Xh=t=>t.split(Z7),wd=(t,e,n)=>er(Xh,mr(Yh(t==="space"?" ".repeat(e):`
203
+ `)),gr(n)),sa=t=>{switch(t){case"crlf":return`\r
204
+ `;case"lf":return`
205
+ `}},tH={match(t){return t.type==="AttributeList"},print(t,e){if(e.children.length===0)return`${e.kind.toLocaleLowerCase()} [];`;const n=sa(t.endOfLine);return er(mr(t.print),gr(n),wd(t.indentStyle,t.indentSize,n),Ki(`${e.kind.toLocaleLowerCase()} [${n}`,`${n}];`))(e.children)}},nH={match(t){return t.type==="Attribute"},print(t,e){return`${t.print(e.key)} = ${t.print(e.value)};`}},rH={match(t){return t.type==="Comment"},print(t,e){const n=sa(t.endOfLine);switch(e.kind){case"Block":return er(Xh,mr(Yh(" * ")),gr(n),Ki(`/**${n}`,`${n} */`))(e.value);case"Macro":return er(Xh,mr(Yh("# ")),gr(n))(e.value);case"Slash":default:return er(Xh,mr(Yh("// ")),gr(n))(e.value)}}},iH={match(t){return t.type==="Dot"},print(t,e){return e.children.map(t.print).join(sa(t.endOfLine))}},sH={match(t){return t.type==="Edge"},print(t,e){const n=er(mr(t.print),gr(t.directed?" -> ":" -- "))(e.targets);if(e.children.length===0)return`${n};`;const r=sa(t.endOfLine),i=er(mr(t.print),gr(r),wd(t.indentStyle,t.indentSize,r),Ki(`[${r}`,`${r}];`))(e.children);return`${n} ${i}`}},aH={match(t){return t.type==="Graph"},print(t,e){t.directed=e.directed;const n=[];if(e.strict&&n.push("strict"),n.push(e.directed?"digraph":"graph"),e.id&&n.push(t.print(e.id)),e.children.length===0)return`${n.join(" ")} {}`;const r=sa(t.endOfLine),i=er(mr(t.print),gr(r),wd(t.indentStyle,t.indentSize,r),Ki(`{${r}`,`${r}}`))(e.children);return`${n.join(" ")} ${i}`}},oH=er(N0,eH('"')),uH=Ki("<",">"),cH={match(t){return t.type==="Literal"},print(t,e){switch(e.quoted){case"html":return uH(e.value);case!0:return oH(e.value);case!1:default:return N0(e.value)}}},lH={match(t){return t.type==="Node"},print(t,e){const n=t.print(e.id);if(e.children.length===0)return`${n};`;const r=sa(t.endOfLine),i=er(mr(t.print),gr(r),wd(t.indentStyle,t.indentSize,r),Ki(`[${r}`,`${r}];`))(e.children);return`${n} ${i}`}},dH={match(t){return t.type==="NodeRefGroup"},print(t,e){return er(mr(t.print),gr(" "),Ki("{","}"))(e.children)}},fH={match(t){return t.type==="NodeRef"},print(t,e){const n=[t.print(e.id)];return e.port&&n.push(t.print(e.port)),e.compass&&n.push(t.print(e.compass)),n.join(":")}},pH={match(t){return t.type==="Subgraph"},print(t,e){const n=["subgraph"];if(e.id&&n.push(t.print(e.id)),e.children.length===0)return`${n.join(" ")} {}`;const r=sa(t.endOfLine),i=er(mr(t.print),gr(r),wd(t.indentStyle,t.indentSize,r),Ki(`{${r}`,`${r}}`))(e.children);return`${n.join(" ")} ${i}`}},hH=[tH,nH,rH,iH,sH,aH,cH,lH,dH,fH,pH];class mH{options;#e=[...hH];constructor(e={}){this.options=e}print(e){const n=[...this.#e],{indentSize:r=2,indentStyle:i="space",endOfLine:s="lf"}=this.options,a={directed:!0,indentSize:r,indentStyle:i,endOfLine:s,print(o){for(const u of n)if(u.match(o))return u.print(a,o);throw Error()}};return a.print(e)}}function gH(t,e){const n=new mH(e).print(t);if(!n)throw new Error;return n}function Jh(t,e){if(typeof e=="string"){const n=e.trim();return/^<.+>$/ms.test(n)?Ze("Attribute",{key:Ze("Literal",{value:t,quoted:!1},[]),value:Ze("Literal",{value:n.slice(1,n.length-1),quoted:"html"},[])},[]):Ze("Attribute",{key:Ze("Literal",{value:t,quoted:!1},[]),value:Ze("Literal",{value:e,quoted:!0},[])},[])}return Ze("Attribute",{key:Ze("Literal",{value:t,quoted:!1},[]),value:Ze("Literal",{value:String(e),quoted:!1},[])},[])}function aa(t,e){return Ze("Comment",{kind:e,value:t},[])}function O0(t,e){return Array.from(function*(){for(const[n,r]of e.values)yield Jh(n,r);for(const n of Object.values(e.attributes))n.size>0&&(n.comment&&(yield aa(n.comment,t.commentKind)),yield t.convert(n));for(const n of e.nodes)n.comment&&(yield aa(n.comment,t.commentKind)),yield t.convert(n);for(const n of e.subgraphs)n.comment&&(yield aa(n.comment,t.commentKind)),yield t.convert(n);for(const n of e.edges)n.comment&&(yield aa(n.comment,t.commentKind)),yield t.convert(n)}())}const yH={match(t){return t.$$type==="AttributeList"},convert(t,e){return Ze("AttributeList",{kind:e.$$kind},e.values.map(([n,r])=>Jh(n,r)))}},wH={match(t){return t.$$type==="Edge"},convert(t,e){return Ze("Edge",{targets:e.targets.map(n=>Dv(n)?Ze("NodeRef",{id:Ze("Literal",{value:n.id,quoted:!0},[])},[]):_0(n)?Ze("NodeRef",{id:Ze("Literal",{value:n.id,quoted:!0},[]),port:n.port?Ze("Literal",{value:n.port,quoted:!0},[]):void 0,compass:n.compass?Ze("Literal",{value:n.compass,quoted:!0},[]):void 0},[]):Ze("NodeRefGroup",{},n.map(r=>Dv(r)?Ze("NodeRef",{id:Ze("Literal",{value:r.id,quoted:!0},[])},[]):Ze("NodeRef",{id:Ze("Literal",{value:r.id,quoted:!0},[]),port:r.port?Ze("Literal",{value:r.port,quoted:!0},[]):void 0,compass:r.compass?Ze("Literal",{value:r.compass,quoted:!0},[]):void 0},[]))))},[...e.attributes.comment?[aa(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([n,r])=>Jh(n,r))])}},vH={match(t){return t.$$type==="Graph"},convert(t,e){return Ze("Dot",{},[...e.comment?[aa(e.comment,t.commentKind)]:[],Ze("Graph",{directed:e.directed,strict:e.strict,id:e.id?Ze("Literal",{value:e.id,quoted:!0},[]):void 0},O0(t,e))])}},bH={match(t){return t.$$type==="Node"},convert(t,e){return Ze("Node",{id:Ze("Literal",{value:e.id,quoted:!0},[])},[...e.attributes.comment?[aa(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([n,r])=>Jh(n,r))])}},DH={match(t){return t.$$type==="Subgraph"},convert(t,e){return Ze("Subgraph",{id:e.id?Ze("Literal",{value:e.id,quoted:!0},[]):void 0},O0(t,e))}},EH=[yH,wH,bH,vH,DH];class RH{options;#e=[...EH];constructor(e={}){this.options=e}convert(e){const n=[...this.#e],{commentKind:r="Slash"}=this.options,i={commentKind:r,convert(s){for(const a of n)if(a.match(s))return a.convert(i,s);throw Error()}};return i.convert(e)}}function $H(t,e){return new RH(e).convert(t)}const N=new Proxy(Object.freeze({}),{get:(t,e)=>e});class Ev{}class Rv extends Ev{#e=new Map;constructor(e){super(),e!==void 0&&this.apply(e)}get values(){return Array.from(this.#e.entries())}get size(){return this.#e.size}get(e){return this.#e.get(e)}set(e,n){n!=null&&this.#e.set(e,n)}delete(e){this.#e.delete(e)}apply(e){const n=Array.isArray(e)?e:Object.entries(e);for(const[r,i]of n)this.set(r,i)}clear(){this.#e.clear()}}class $v extends Rv{$$kind;get $$type(){return"AttributeList"}comment;constructor(e,n){super(n),this.$$kind=e}}class F0 extends Rv{#e=Kh;id;comment;attributes=Object.freeze({graph:new $v("Graph"),edge:new $v("Edge"),node:new $v("Node")});get nodes(){return Array.from(this.#t.nodes.values())}get edges(){return Array.from(this.#t.edges.values())}get subgraphs(){return Array.from(this.#t.subgraphs.values())}#t={nodes:new Map,edges:new Set,subgraphs:new Set};with(e){this.#e=Y7(e)}addNode(e){this.#t.nodes.set(e.id,e)}addEdge(e){this.#t.edges.add(e)}addSubgraph(e){this.#t.subgraphs.add(e)}existNode(e){return this.#t.nodes.has(e)}existEdge(e){return this.#t.edges.has(e)}existSubgraph(e){return this.#t.subgraphs.has(e)}createSubgraph(...e){const n=new this.#e.Subgraph(...e);return n.with(this.#e),this.addSubgraph(n),n}removeNode(e){this.#t.nodes.delete(typeof e=="string"?e:e.id)}removeEdge(e){this.#t.edges.delete(e)}removeSubgraph(e){this.#t.subgraphs.delete(e)}createNode(e,n){const r=new this.#e.Node(e,n);return this.addNode(r),r}getSubgraph(e){return Array.from(this.#t.subgraphs.values()).find(n=>n.id===e)}getNode(e){return this.#t.nodes.get(e)}createEdge(e,n){const r=e.map(s=>H7(s)?K7(s):x0(s)),i=new this.#e.Edge(r,n);return this.addEdge(i),i}subgraph(...e){const n=e.find(a=>typeof a=="string"),r=e.find(a=>typeof a=="object"&&a!==null),i=e.find(a=>typeof a=="function"),s=n?this.getSubgraph(n)??this.createSubgraph(n):this.createSubgraph();return r!==void 0&&s.apply(r),i!==void 0&&i(s),s}node(e,...n){if(typeof e=="string"){const r=e,i=n.find(o=>typeof o=="object"&&o!==null),s=n.find(o=>typeof o=="function"),a=this.getNode(r)??this.createNode(r);return i!==void 0&&a.attributes.apply(i),s!==void 0&&s(a),a}typeof e=="object"&&e!==null&&this.attributes.node.apply(e)}edge(e,...n){if(Array.isArray(e)){const r=e,i=n.find(o=>typeof o=="object"),s=n.find(o=>typeof o=="function"),a=this.createEdge(r,i);return s!==void 0&&s(a),a}typeof e=="object"&&e!==null&&this.attributes.edge.apply(e)}graph(e){this.attributes.graph.apply(e)}}class L0 extends F0{get $$type(){return"Graph"}id;strict;constructor(...e){super(),this.id=e.find(r=>typeof r=="string"),this.strict=e.find(r=>typeof r=="boolean")??!1;const n=e.find(r=>typeof r=="object"&&r!==null);n!==void 0&&this.apply(n)}}class SH extends L0{get directed(){return!0}}let TH=class extends L0{get directed(){return!1}};class kH extends F0{get $$type(){return"Subgraph"}id;constructor(...e){super(),this.id=e.find(r=>typeof r=="string");const n=e.find(r=>typeof r=="object"&&r!==null);n!==void 0&&this.apply(n)}isSubgraphCluster(){return typeof this.id=="string"?this.id.startsWith("cluster"):!1}}class M0 extends Rv{comment}let CH=class extends Ev{id;get $$type(){return"Node"}comment;attributes;constructor(e,n){super(),this.id=e,this.attributes=new M0(n)}port(e){return typeof e=="string"?{id:this.id,port:e}:{id:this.id,...e}}};class AH extends Ev{targets;get $$type(){return"Edge"}comment;attributes;constructor(e,n){if(super(),this.targets=e,e.length<2&&(yd(e[0])&&yd(e[1]))===!1)throw Error("The element of Edge target is missing or not satisfied as Edge target.");this.attributes=new M0(n)}}Object.assign(Kh,{Graph:TH,Digraph:SH,Subgraph:kH,Node:CH,Edge:AH});function z0(t,e){return(...n)=>{const r=t?this.Digraph:this.Graph,i=n.find(u=>typeof u=="string"),s=n.find(u=>typeof u=="object"),a=n.find(u=>typeof u=="function"),o=new r(i,e,s);return o.with(this),typeof a=="function"&&a(o),o}}function B0(t,e=Kh){return Object.freeze({digraph:z0.call(e,!0,t),graph:z0.call(e,!1,t)})}const q0=B0(!1),_H=q0.digraph;q0.graph;const PH=B0(!0);function G0(t,e){const n=$H(t,e?.convert);return gH(n,e?.print)}var Sv,j0;function xH(){if(j0)return Sv;j0=1;function t(r){let i=r.length-1,s=r[i];for(;s===" "||s===" ";)s=r[--i];return r.substring(0,i+1)}function e(r){return r.split(`
206
+ `).map(a=>t(a)).join(`
207
+ `)}Sv=function(r,i){if(i=i||{},r==null)return r;var s=i.width||50,a=typeof i.indent=="string"?i.indent:" ",o=i.newline||`
208
+ `+a,u=typeof i.escape=="function"?i.escape:n,c=".{1,"+s+"}";i.cut!==!0&&(c+="([\\s\u200B]+|$)|[^\\s\u200B]+?([\\s\u200B]+|$)");var l=new RegExp(c,"g"),d=r.match(l)||[],f=a+d.map(function(p){return p.slice(-1)===`
209
+ `&&(p=p.slice(0,p.length-1)),u(p)}).join(o);return i.trim===!0&&(f=e(f)),f};function n(r){return r}return Sv}var IH=xH();const NH=Ss(IH),Qh={min:{r:0,g:0,b:0,s:0,l:0,a:0},max:{r:255,g:255,b:255,h:360,s:100,l:100,a:1},clamp:{r:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t),hsl2rgb:({h:t,s:e,l:n},r)=>{if(!e)return n*2.55;t/=360,e/=100,n/=100;const i=n<.5?n*(1+e):n+e-n*e,s=2*n-i;switch(r){case"r":return Qh.hue2rgb(s,i,t+1/3)*255;case"g":return Qh.hue2rgb(s,i,t)*255;case"b":return Qh.hue2rgb(s,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:n},r)=>{t/=255,e/=255,n/=255;const i=Math.max(t,e,n),s=Math.min(t,e,n),a=(i+s)/2;if(r==="l")return a*100;if(i===s)return 0;const o=i-s,u=a>.5?o/(2-i-s):o/(i+s);if(r==="s")return u*100;switch(i){case t:return((e-n)/o+(e<n?6:0))*60;case e:return((n-t)/o+2)*60;case n:return((t-e)/o+4)*60;default:return-1}}},OH={clamp:(t,e,n)=>e>n?Math.min(e,Math.max(n,t)):Math.min(n,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},FH={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},Oe={channel:Qh,lang:OH,unit:FH},Yi={};for(let t=0;t<=255;t++)Yi[t]=Oe.unit.dec2hex(t);const un={ALL:0,RGB:1,HSL:2};class LH{constructor(){this.type=un.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=un.ALL}is(e){return this.type===e}}class MH{constructor(e,n){this.color=n,this.changed=!1,this.data=e,this.type=new LH}set(e,n){return this.color=n,this.changed=!1,this.data=e,this.type.type=un.ALL,this}_ensureHSL(){const e=this.data,{h:n,s:r,l:i}=e;n===void 0&&(e.h=Oe.channel.rgb2hsl(e,"h")),r===void 0&&(e.s=Oe.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=Oe.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r:n,g:r,b:i}=e;n===void 0&&(e.r=Oe.channel.hsl2rgb(e,"r")),r===void 0&&(e.g=Oe.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=Oe.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,n=e.r;return!this.type.is(un.HSL)&&n!==void 0?n:(this._ensureHSL(),Oe.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,n=e.g;return!this.type.is(un.HSL)&&n!==void 0?n:(this._ensureHSL(),Oe.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,n=e.b;return!this.type.is(un.HSL)&&n!==void 0?n:(this._ensureHSL(),Oe.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,n=e.h;return!this.type.is(un.RGB)&&n!==void 0?n:(this._ensureRGB(),Oe.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,n=e.s;return!this.type.is(un.RGB)&&n!==void 0?n:(this._ensureRGB(),Oe.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,n=e.l;return!this.type.is(un.RGB)&&n!==void 0?n:(this._ensureRGB(),Oe.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(un.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(un.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(un.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(un.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(un.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(un.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const Tv=new MH({r:0,g:0,b:0,a:0},"transparent"),go={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match(go.re);if(!e)return;const n=e[1],r=parseInt(n,16),i=n.length,s=i%4===0,a=i>4,o=a?1:17,u=a?8:4,c=s?0:-1,l=a?255:15;return Tv.set({r:(r>>u*(c+3)&l)*o,g:(r>>u*(c+2)&l)*o,b:(r>>u*(c+1)&l)*o,a:s?(r&l)*o/255:1},t)},stringify:t=>{const{r:e,g:n,b:r,a:i}=t;return i<1?`#${Yi[Math.round(e)]}${Yi[Math.round(n)]}${Yi[Math.round(r)]}${Yi[Math.round(i*255)]}`:`#${Yi[Math.round(e)]}${Yi[Math.round(n)]}${Yi[Math.round(r)]}`}},oa={re:/^hsla?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(?:deg|grad|rad|turn)?)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?%)(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e-?\d+)?(%)?))?\s*?\)$/i,hueRe:/^(.+?)(deg|grad|rad|turn)$/i,_hue2deg:t=>{const e=t.match(oa.hueRe);if(e){const[,n,r]=e;switch(r){case"grad":return Oe.channel.clamp.h(parseFloat(n)*.9);case"rad":return Oe.channel.clamp.h(parseFloat(n)*180/Math.PI);case"turn":return Oe.channel.clamp.h(parseFloat(n)*360)}}return Oe.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const n=t.match(oa.re);if(!n)return;const[,r,i,s,a,o]=n;return Tv.set({h:oa._hue2deg(r),s:Oe.channel.clamp.s(parseFloat(i)),l:Oe.channel.clamp.l(parseFloat(s)),a:a?Oe.channel.clamp.a(o?parseFloat(a)/100:parseFloat(a)):1},t)},stringify:t=>{const{h:e,s:n,l:r,a:i}=t;return i<1?`hsla(${Oe.lang.round(e)}, ${Oe.lang.round(n)}%, ${Oe.lang.round(r)}%, ${i})`:`hsl(${Oe.lang.round(e)}, ${Oe.lang.round(n)}%, ${Oe.lang.round(r)}%)`}},vd={colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyanaqua:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",transparent:"#00000000",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},parse:t=>{t=t.toLowerCase();const e=vd.colors[t];if(e)return go.parse(e)},stringify:t=>{const e=go.stringify(t);for(const n in vd.colors)if(vd.colors[n]===e)return n}},bd={re:/^rgba?\(\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))\s*?(?:,|\s)\s*?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?))(?:\s*?(?:,|\/)\s*?\+?(-?(?:\d+(?:\.\d+)?|(?:\.\d+))(?:e\d+)?(%?)))?\s*?\)$/i,parse:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const n=t.match(bd.re);if(!n)return;const[,r,i,s,a,o,u,c,l]=n;return Tv.set({r:Oe.channel.clamp.r(i?parseFloat(r)*2.55:parseFloat(r)),g:Oe.channel.clamp.g(a?parseFloat(s)*2.55:parseFloat(s)),b:Oe.channel.clamp.b(u?parseFloat(o)*2.55:parseFloat(o)),a:c?Oe.channel.clamp.a(l?parseFloat(c)/100:parseFloat(c)):1},t)},stringify:t=>{const{r:e,g:n,b:r,a:i}=t;return i<1?`rgba(${Oe.lang.round(e)}, ${Oe.lang.round(n)}, ${Oe.lang.round(r)}, ${Oe.lang.round(i)})`:`rgb(${Oe.lang.round(e)}, ${Oe.lang.round(n)}, ${Oe.lang.round(r)})`}},Xi={format:{keyword:vd,hex:go,rgb:bd,rgba:bd,hsl:oa,hsla:oa},parse:t=>{if(typeof t!="string")return t;const e=go.parse(t)||bd.parse(t)||oa.parse(t)||vd.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(un.HSL)||t.data.r===void 0?oa.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?bd.stringify(t):go.stringify(t)},zH=(t,e)=>{const n=Xi.parse(t);for(const r in e)n[r]=Oe.channel.clamp[r](e[r]);return Xi.stringify(n)},U0=t=>Xi.format.hex.stringify(Xi.parse(t)),BH=(t,e,n)=>{const r=Xi.parse(t),i=r[e],s=Oe.channel.clamp[e](i+n);return i!==s&&(r[e]=s),Xi.stringify(r)},qH=(t,e)=>BH(t,"a",-.3),GH=(t,e)=>{const n=Xi.parse(t),r={};for(const i in e)e[i]&&(r[i]=n[i]+e[i]);return zH(t,r)},jH=(t,e)=>{const n=Xi.parse(t),r={},i=(s,a,o)=>a>0?(o-s)*a/100:s*a/100;for(const s in e)r[s]=i(n[s],e[s],Oe.channel.max[s]);return GH(t,r)};function Gn(t){return t.children.length>0}function cn(t){switch(t){case"open":return"vee";default:return t}}function zr(t){return Array.isArray(t)?[zr(t[0]),zr(t[1])]:(_e(isFinite(t),`Invalid not finite point value ${t}`),Math.round(t))}const W0=t=>(_e(isFinite(t),`Invalid not finite inch value ${t}`),Math.floor(t*72)),ft=t=>Math.ceil(t/72*1e3)/1e3,tr=t=>Math.ceil(t);tr(40).toString();function H0(t,e){return U0(jH(t,{l:-35-5*e,s:-15-5*e}))}function UH(t){return U0(qH(t))}function WH(t){return t.trim().replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function V0(t,{maxchars:e,maxLines:n,sanitize:r=Ij()}){let i=NH(t,{width:e,indent:"",escape:r}).split(`
210
+ `);return Qt(n)&&n>0&&i.length>n&&(i=i.slice(0,n-1)),i}function ua({text:t,maxchars:e,fontsize:n,maxLines:r,bold:i,color:s}){let a=V0(t,{maxchars:e,maxLines:r,sanitize:WH}).join("<BR/>");i&&(a=`<B>${a}</B>`);const o=s?` COLOR="${s}"`:"";return`<FONT POINT-SIZE="${tr(n)}"${o}>${a}</FONT>`}function kv(t){return jt.textSizes[t]}function HH(t){switch(t){case"xs":case"sm":return 25;case"md":return 35;case"lg":case"xl":return 45;default:Ae(t)}}function VH(t,e,n){const r=ie(t.icon),i=[ua({text:t.title,fontsize:kv(n.text),maxchars:HH(n.shape),maxLines:3})];if(n.shape!=="sm"&&n.shape!=="xs"&&(ie(t.technology?.trim())&&i.push(ua({text:t.technology,fontsize:Math.ceil(kv(n.text)*.65),maxchars:r?35:45,maxLines:1,color:e.loContrast})),ie(t.description?.trim())&&i.push(ua({text:t.description,fontsize:Math.ceil(kv(n.text)*.75),maxchars:r?35:45,maxLines:5,color:e.loContrast}))),i.length===1&&!r)return`<${i[0]}>`;const s=r?(a,o,u)=>{let c=`<TD ALIGN="TEXT" BALIGN="LEFT">${a}</TD>`;if(o===0){const l=u.length>1?` ROWSPAN="${u.length}"`:"";let d=76;["xs","sm"].includes(n.shape)&&(d=16),(t.shape==="queue"||t.shape==="mobile")&&(d+=20),c=`<TD${l} WIDTH="${d}"> </TD>${c}`,c=`${c}<TD${l} WIDTH="16"> </TD>`}return`<TR>${c}</TR>`}:a=>`<TR><TD>${a}</TD></TR>`;return`<<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="5">${i.map(s).join("")}</TABLE>>`}function KH(t,e){const n=ua({text:t.title.toUpperCase(),maxchars:50,fontsize:11,maxLines:1,bold:!0,color:e});return n.includes("<BR/>")?`<<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"><TR><TD ALIGN="TEXT" BALIGN="LEFT">${n}</TD></TR></TABLE>>`:`<${n}>`}const Zh=40,K0=5,Cv=`BGCOLOR="${jt.relationships[Co].labelBgColor}A0"`;function Y0({label:t,technology:e}){const n=[];if(ie(t?.trim())&&n.push(ua({text:t,maxchars:Zh,fontsize:14,maxLines:K0,bold:t==="[...]"})),ie(e?.trim())&&n.push(ua({text:`[ ${e} ]`,fontsize:12,maxLines:1,maxchars:Zh})),n.length===0)return null;const r=n.map(i=>`<TR><TD ALIGN="TEXT" BALIGN="LEFT">${i}</TD></TR>`).join("");return`<<TABLE BORDER="0" CELLPADDING="3" CELLSPACING="0" ${Cv}>${r}</TABLE>>`}function YH(t,e){const n=`<TABLE BORDER="0" CELLPADDING="6" ${Cv}><TR><TD WIDTH="20" HEIGHT="20"><FONT POINT-SIZE="${tr(14)}"><B>${t}</B></FONT></TD></TR></TABLE>`;return ie(e?.trim())?`<${['<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">',"<TR>",`<TD>${n}</TD>`,`<TD ${Cv} CELLPADDING="3">`,ua({text:e,maxchars:Zh,fontsize:14,maxLines:5}),"</TD>","</TR>","</TABLE>"].join("")}>`:`<${n}>`}var Av,X0;function _v(){if(X0)return Av;X0=1;function t(e){if(typeof e!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=e}return typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=function(){return this}),t.of=function(){var e=arguments,n=e.length,r=0;return new t(function(){return r>=n?{done:!0}:{done:!1,value:e[r++]}})},t.empty=function(){var e=new t(function(){return{done:!0}});return e},t.fromSequence=function(e){var n=0,r=e.length;return new t(function(){return n>=r?{done:!0}:{done:!1,value:e[n++]}})},t.is=function(e){return e instanceof t?!0:typeof e=="object"&&e!==null&&typeof e.next=="function"},Av=t,Av}var XH=_v();const nr=Ss(XH);var em={},J0;function JH(){return J0||(J0=1,em.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",em.SYMBOL_SUPPORT=typeof Symbol<"u"),em}var Pv,Q0;function Z0(){if(Q0)return Pv;Q0=1;var t=_v(),e=JH(),n=e.ARRAY_BUFFER_SUPPORT,r=e.SYMBOL_SUPPORT;function i(s){return typeof s=="string"||Array.isArray(s)||n&&ArrayBuffer.isView(s)?t.fromSequence(s):typeof s!="object"||s===null?null:r&&typeof s[Symbol.iterator]=="function"?s[Symbol.iterator]():typeof s.next=="function"?s:null}return Pv=function(a){var o=i(a);if(!o)throw new Error("obliterator: target is not iterable nor a valid iterator.");return o},Pv}var xv,e_;function QH(){if(e_)return xv;e_=1;var t=Z0();return xv=function(n,r){for(var i=arguments.length>1?r:1/0,s=i!==1/0?new Array(i):[],a,o=0,u=t(n);;){if(o===i)return s;if(a=u.next(),a.done)return o!==r&&(s.length=o),s;s[o++]=a.value}},xv}var ZH=QH();const t_=Ss(ZH);var Iv,n_;function eV(){if(n_)return Iv;n_=1;var t=_v(),e=Z0();return Iv=function(){var r=arguments,i=null,s=-1;return new t(function(){var o=null;do{if(i===null){if(s++,s>=r.length)return{done:!0};i=e(r[s])}if(o=i.next(),o.done===!0){i=null;continue}break}while(!0);return o})},Iv}var tV=eV();const wi=Ss(tV);function nV(){const t=arguments[0];for(let e=1,n=arguments.length;e<n;e++)if(arguments[e])for(const r in arguments[e])t[r]=arguments[e][r];return t}let Bt=nV;typeof Object.assign=="function"&&(Bt=Object.assign);function rr(t,e,n,r){const i=t._nodes.get(e);let s=null;return i&&(r==="mixed"?s=i.out&&i.out[n]||i.undirected&&i.undirected[n]:r==="directed"?s=i.out&&i.out[n]:s=i.undirected&&i.undirected[n]),s}function en(t){return typeof t=="object"&&t!==null}function r_(t){let e;for(e in t)return!1;return!0}function ir(t,e,n){Object.defineProperty(t,e,{enumerable:!1,configurable:!1,writable:!0,value:n})}function yr(t,e,n){const r={enumerable:!0,configurable:!0};typeof n=="function"?r.get=n:(r.value=n,r.writable=!1),Object.defineProperty(t,e,r)}function i_(t){return!(!en(t)||t.attributes&&!Array.isArray(t.attributes))}function rV(){let t=Math.floor(Math.random()*256)&255;return()=>t++}class Nv extends Error{constructor(e){super(),this.name="GraphError",this.message=e}}class pe extends Nv{constructor(e){super(e),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,pe.prototype.constructor)}}class se extends Nv{constructor(e){super(e),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,se.prototype.constructor)}}class Se extends Nv{constructor(e){super(e),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Se.prototype.constructor)}}function s_(t,e){this.key=t,this.attributes=e,this.clear()}s_.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function a_(t,e){this.key=t,this.attributes=e,this.clear()}a_.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function o_(t,e){this.key=t,this.attributes=e,this.clear()}o_.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function yo(t,e,n,r,i){this.key=e,this.attributes=i,this.undirected=t,this.source=n,this.target=r}yo.prototype.attach=function(){let t="out",e="in";this.undirected&&(t=e="undirected");const n=this.source.key,r=this.target.key;this.source[t][r]=this,!(this.undirected&&n===r)&&(this.target[e][n]=this)},yo.prototype.attachMulti=function(){let t="out",e="in";const n=this.source.key,r=this.target.key;this.undirected&&(t=e="undirected");const i=this.source[t],s=i[r];if(typeof s>"u"){i[r]=this,this.undirected&&n===r||(this.target[e][n]=this);return}s.previous=this,this.next=s,i[r]=this,this.target[e][n]=this},yo.prototype.detach=function(){const t=this.source.key,e=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),delete this.source[n][e],delete this.target[r][t]},yo.prototype.detachMulti=function(){const t=this.source.key,e=this.target.key;let n="out",r="in";this.undirected&&(n=r="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[n][e],delete this.target[r][t]):(this.next.previous=void 0,this.source[n][e]=this.next,this.target[r][t]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const u_=0,c_=1,iV=2,l_=3;function vi(t,e,n,r,i,s,a){let o,u,c,l;if(r=""+r,n===u_){if(o=t._nodes.get(r),!o)throw new se(`Graph.${e}: could not find the "${r}" node in the graph.`);c=i,l=s}else if(n===l_){if(i=""+i,u=t._edges.get(i),!u)throw new se(`Graph.${e}: could not find the "${i}" edge in the graph.`);const d=u.source.key,f=u.target.key;if(r===d)o=u.target;else if(r===f)o=u.source;else throw new se(`Graph.${e}: the "${r}" node is not attached to the "${i}" edge (${d}, ${f}).`);c=s,l=a}else{if(u=t._edges.get(r),!u)throw new se(`Graph.${e}: could not find the "${r}" edge in the graph.`);n===c_?o=u.source:o=u.target,c=i,l=s}return[o,c,l]}function sV(t,e,n){t.prototype[e]=function(r,i,s){const[a,o]=vi(this,e,n,r,i,s);return a.attributes[o]}}function aV(t,e,n){t.prototype[e]=function(r,i){const[s]=vi(this,e,n,r,i);return s.attributes}}function oV(t,e,n){t.prototype[e]=function(r,i,s){const[a,o]=vi(this,e,n,r,i,s);return a.attributes.hasOwnProperty(o)}}function uV(t,e,n){t.prototype[e]=function(r,i,s,a){const[o,u,c]=vi(this,e,n,r,i,s,a);return o.attributes[u]=c,this.emit("nodeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:u}),this}}function cV(t,e,n){t.prototype[e]=function(r,i,s,a){const[o,u,c]=vi(this,e,n,r,i,s,a);if(typeof c!="function")throw new pe(`Graph.${e}: updater should be a function.`);const l=o.attributes,d=c(l[u]);return l[u]=d,this.emit("nodeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:u}),this}}function lV(t,e,n){t.prototype[e]=function(r,i,s){const[a,o]=vi(this,e,n,r,i,s);return delete a.attributes[o],this.emit("nodeAttributesUpdated",{key:a.key,type:"remove",attributes:a.attributes,name:o}),this}}function dV(t,e,n){t.prototype[e]=function(r,i,s){const[a,o]=vi(this,e,n,r,i,s);if(!en(o))throw new pe(`Graph.${e}: provided attributes are not a plain object.`);return a.attributes=o,this.emit("nodeAttributesUpdated",{key:a.key,type:"replace",attributes:a.attributes}),this}}function fV(t,e,n){t.prototype[e]=function(r,i,s){const[a,o]=vi(this,e,n,r,i,s);if(!en(o))throw new pe(`Graph.${e}: provided attributes are not a plain object.`);return Bt(a.attributes,o),this.emit("nodeAttributesUpdated",{key:a.key,type:"merge",attributes:a.attributes,data:o}),this}}function pV(t,e,n){t.prototype[e]=function(r,i,s){const[a,o]=vi(this,e,n,r,i,s);if(typeof o!="function")throw new pe(`Graph.${e}: provided updater is not a function.`);return a.attributes=o(a.attributes),this.emit("nodeAttributesUpdated",{key:a.key,type:"update",attributes:a.attributes}),this}}const hV=[{name:t=>`get${t}Attribute`,attacher:sV},{name:t=>`get${t}Attributes`,attacher:aV},{name:t=>`has${t}Attribute`,attacher:oV},{name:t=>`set${t}Attribute`,attacher:uV},{name:t=>`update${t}Attribute`,attacher:cV},{name:t=>`remove${t}Attribute`,attacher:lV},{name:t=>`replace${t}Attributes`,attacher:dV},{name:t=>`merge${t}Attributes`,attacher:fV},{name:t=>`update${t}Attributes`,attacher:pV}];function mV(t){hV.forEach(function({name:e,attacher:n}){n(t,e("Node"),u_),n(t,e("Source"),c_),n(t,e("Target"),iV),n(t,e("Opposite"),l_)})}function gV(t,e,n){t.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Se(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Se(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,o=""+i;if(i=arguments[2],s=rr(this,a,o,n),!s)throw new se(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!=="mixed")throw new Se(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new se(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return s.attributes[i]}}function yV(t,e,n){t.prototype[e]=function(r){let i;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Se(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new Se(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+r,a=""+arguments[1];if(i=rr(this,s,a,n),!i)throw new se(`Graph.${e}: could not find an edge for the given path ("${s}" - "${a}").`)}else{if(n!=="mixed")throw new Se(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,i=this._edges.get(r),!i)throw new se(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return i.attributes}}function wV(t,e,n){t.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Se(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Se(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,o=""+i;if(i=arguments[2],s=rr(this,a,o,n),!s)throw new se(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!=="mixed")throw new Se(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new se(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return s.attributes.hasOwnProperty(i)}}function vV(t,e,n){t.prototype[e]=function(r,i,s){let a;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Se(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Se(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+r,u=""+i;if(i=arguments[2],s=arguments[3],a=rr(this,o,u,n),!a)throw new se(`Graph.${e}: could not find an edge for the given path ("${o}" - "${u}").`)}else{if(n!=="mixed")throw new Se(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,a=this._edges.get(r),!a)throw new se(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return a.attributes[i]=s,this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:i}),this}}function bV(t,e,n){t.prototype[e]=function(r,i,s){let a;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Se(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new Se(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+r,u=""+i;if(i=arguments[2],s=arguments[3],a=rr(this,o,u,n),!a)throw new se(`Graph.${e}: could not find an edge for the given path ("${o}" - "${u}").`)}else{if(n!=="mixed")throw new Se(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,a=this._edges.get(r),!a)throw new se(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(typeof s!="function")throw new pe(`Graph.${e}: updater should be a function.`);return a.attributes[i]=s(a.attributes[i]),this.emit("edgeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:i}),this}}function DV(t,e,n){t.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Se(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Se(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,o=""+i;if(i=arguments[2],s=rr(this,a,o,n),!s)throw new se(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!=="mixed")throw new Se(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new se(`Graph.${e}: could not find the "${r}" edge in the graph.`)}return delete s.attributes[i],this.emit("edgeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:i}),this}}function EV(t,e,n){t.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Se(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Se(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,o=""+i;if(i=arguments[2],s=rr(this,a,o,n),!s)throw new se(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!=="mixed")throw new Se(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new se(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(!en(i))throw new pe(`Graph.${e}: provided attributes are not a plain object.`);return s.attributes=i,this.emit("edgeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}function RV(t,e,n){t.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Se(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Se(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,o=""+i;if(i=arguments[2],s=rr(this,a,o,n),!s)throw new se(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!=="mixed")throw new Se(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new se(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(!en(i))throw new pe(`Graph.${e}: provided attributes are not a plain object.`);return Bt(s.attributes,i),this.emit("edgeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:i}),this}}function $V(t,e,n){t.prototype[e]=function(r,i){let s;if(this.type!=="mixed"&&n!=="mixed"&&n!==this.type)throw new Se(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new Se(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+r,o=""+i;if(i=arguments[2],s=rr(this,a,o,n),!s)throw new se(`Graph.${e}: could not find an edge for the given path ("${a}" - "${o}").`)}else{if(n!=="mixed")throw new Se(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(r=""+r,s=this._edges.get(r),!s)throw new se(`Graph.${e}: could not find the "${r}" edge in the graph.`)}if(typeof i!="function")throw new pe(`Graph.${e}: provided updater is not a function.`);return s.attributes=i(s.attributes),this.emit("edgeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}const SV=[{name:t=>`get${t}Attribute`,attacher:gV},{name:t=>`get${t}Attributes`,attacher:yV},{name:t=>`has${t}Attribute`,attacher:wV},{name:t=>`set${t}Attribute`,attacher:vV},{name:t=>`update${t}Attribute`,attacher:bV},{name:t=>`remove${t}Attribute`,attacher:DV},{name:t=>`replace${t}Attributes`,attacher:EV},{name:t=>`merge${t}Attributes`,attacher:RV},{name:t=>`update${t}Attributes`,attacher:$V}];function TV(t){SV.forEach(function({name:e,attacher:n}){n(t,e("Edge"),"mixed"),n(t,e("DirectedEdge"),"directed"),n(t,e("UndirectedEdge"),"undirected")})}const kV=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function CV(t,e,n,r){let i=!1;for(const s in e){if(s===r)continue;const a=e[s];if(i=n(a.key,a.attributes,a.source.key,a.target.key,a.source.attributes,a.target.attributes,a.undirected),t&&i)return a.key}}function AV(t,e,n,r){let i,s,a,o=!1;for(const u in e)if(u!==r){i=e[u];do{if(s=i.source,a=i.target,o=n(i.key,i.attributes,s.key,a.key,s.attributes,a.attributes,i.undirected),t&&o)return i.key;i=i.next}while(i!==void 0)}}function Ov(t,e){const n=Object.keys(t),r=n.length;let i,s=0;return new nr(function(){do if(i)i=i.next;else{if(s>=r)return{done:!0};const o=n[s++];if(o===e){i=void 0;continue}i=t[o]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}}})}function _V(t,e,n,r){const i=e[n];if(!i)return;const s=i.source,a=i.target;if(r(i.key,i.attributes,s.key,a.key,s.attributes,a.attributes,i.undirected)&&t)return i.key}function PV(t,e,n,r){let i=e[n];if(!i)return;let s=!1;do{if(s=r(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),t&&s)return i.key;i=i.next}while(i!==void 0)}function Fv(t,e){let n=t[e];return n.next!==void 0?new nr(function(){if(!n)return{done:!0};const r={edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected};return n=n.next,{done:!1,value:r}}):nr.of({edge:n.key,attributes:n.attributes,source:n.source.key,target:n.target.key,sourceAttributes:n.source.attributes,targetAttributes:n.target.attributes,undirected:n.undirected})}function xV(t,e){if(t.size===0)return[];if(e==="mixed"||e===t.type)return typeof Array.from=="function"?Array.from(t._edges.keys()):t_(t._edges.keys(),t._edges.size);const n=e==="undirected"?t.undirectedSize:t.directedSize,r=new Array(n),i=e==="undirected",s=t._edges.values();let a=0,o,u;for(;o=s.next(),o.done!==!0;)u=o.value,u.undirected===i&&(r[a++]=u.key);return r}function d_(t,e,n,r){if(e.size===0)return;const i=n!=="mixed"&&n!==e.type,s=n==="undirected";let a,o,u=!1;const c=e._edges.values();for(;a=c.next(),a.done!==!0;){if(o=a.value,i&&o.undirected!==s)continue;const{key:l,attributes:d,source:f,target:p}=o;if(u=r(l,d,f.key,p.key,f.attributes,p.attributes,o.undirected),t&&u)return l}}function IV(t,e){if(t.size===0)return nr.empty();const n=e!=="mixed"&&e!==t.type,r=e==="undirected",i=t._edges.values();return new nr(function(){let a,o;for(;;){if(a=i.next(),a.done)return a;if(o=a.value,!(n&&o.undirected!==r))break}return{value:{edge:o.key,attributes:o.attributes,source:o.source.key,target:o.target.key,sourceAttributes:o.source.attributes,targetAttributes:o.target.attributes,undirected:o.undirected},done:!1}})}function Lv(t,e,n,r,i,s){const a=e?AV:CV;let o;if(n!=="undirected"&&(r!=="out"&&(o=a(t,i.in,s),t&&o)||r!=="in"&&(o=a(t,i.out,s,r?void 0:i.key),t&&o))||n!=="directed"&&(o=a(t,i.undirected,s),t&&o))return o}function NV(t,e,n,r){const i=[];return Lv(!1,t,e,n,r,function(s){i.push(s)}),i}function OV(t,e,n){let r=nr.empty();return t!=="undirected"&&(e!=="out"&&typeof n.in<"u"&&(r=wi(r,Ov(n.in))),e!=="in"&&typeof n.out<"u"&&(r=wi(r,Ov(n.out,e?void 0:n.key)))),t!=="directed"&&typeof n.undirected<"u"&&(r=wi(r,Ov(n.undirected))),r}function Mv(t,e,n,r,i,s,a){const o=n?PV:_V;let u;if(e!=="undirected"&&(typeof i.in<"u"&&r!=="out"&&(u=o(t,i.in,s,a),t&&u)||typeof i.out<"u"&&r!=="in"&&(r||i.key!==s)&&(u=o(t,i.out,s,a),t&&u))||e!=="directed"&&typeof i.undirected<"u"&&(u=o(t,i.undirected,s,a),t&&u))return u}function FV(t,e,n,r,i){const s=[];return Mv(!1,t,e,n,r,i,function(a){s.push(a)}),s}function LV(t,e,n,r){let i=nr.empty();return t!=="undirected"&&(typeof n.in<"u"&&e!=="out"&&r in n.in&&(i=wi(i,Fv(n.in,r))),typeof n.out<"u"&&e!=="in"&&r in n.out&&(e||n.key!==r)&&(i=wi(i,Fv(n.out,r)))),t!=="directed"&&typeof n.undirected<"u"&&r in n.undirected&&(i=wi(i,Fv(n.undirected,r))),i}function MV(t,e){const{name:n,type:r,direction:i}=e;t.prototype[n]=function(s,a){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];if(!arguments.length)return xV(this,r);if(arguments.length===1){s=""+s;const o=this._nodes.get(s);if(typeof o>"u")throw new se(`Graph.${n}: could not find the "${s}" node in the graph.`);return NV(this.multi,r==="mixed"?this.type:r,i,o)}if(arguments.length===2){s=""+s,a=""+a;const o=this._nodes.get(s);if(!o)throw new se(`Graph.${n}: could not find the "${s}" source node in the graph.`);if(!this._nodes.has(a))throw new se(`Graph.${n}: could not find the "${a}" target node in the graph.`);return FV(r,this.multi,i,o,a)}throw new pe(`Graph.${n}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function zV(t,e){const{name:n,type:r,direction:i}=e,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[s]=function(c,l,d){if(!(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)){if(arguments.length===1)return d=c,d_(!1,this,r,d);if(arguments.length===2){c=""+c,d=l;const f=this._nodes.get(c);if(typeof f>"u")throw new se(`Graph.${s}: could not find the "${c}" node in the graph.`);return Lv(!1,this.multi,r==="mixed"?this.type:r,i,f,d)}if(arguments.length===3){c=""+c,l=""+l;const f=this._nodes.get(c);if(!f)throw new se(`Graph.${s}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(l))throw new se(`Graph.${s}: could not find the "${l}" target node in the graph.`);return Mv(!1,r,this.multi,i,f,l,d)}throw new pe(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const a="map"+n[0].toUpperCase()+n.slice(1);t.prototype[a]=function(){const c=Array.prototype.slice.call(arguments),l=c.pop();let d;if(c.length===0){let f=0;r!=="directed"&&(f+=this.undirectedSize),r!=="undirected"&&(f+=this.directedSize),d=new Array(f);let p=0;c.push((h,y,b,w,E,$,k)=>{d[p++]=l(h,y,b,w,E,$,k)})}else d=[],c.push((f,p,h,y,b,w,E)=>{d.push(l(f,p,h,y,b,w,E))});return this[s].apply(this,c),d};const o="filter"+n[0].toUpperCase()+n.slice(1);t.prototype[o]=function(){const c=Array.prototype.slice.call(arguments),l=c.pop(),d=[];return c.push((f,p,h,y,b,w,E)=>{l(f,p,h,y,b,w,E)&&d.push(f)}),this[s].apply(this,c),d};const u="reduce"+n[0].toUpperCase()+n.slice(1);t.prototype[u]=function(){let c=Array.prototype.slice.call(arguments);if(c.length<2||c.length>4)throw new pe(`Graph.${u}: invalid number of arguments (expecting 2, 3 or 4 and got ${c.length}).`);if(typeof c[c.length-1]=="function"&&typeof c[c.length-2]!="function")throw new pe(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let l,d;c.length===2?(l=c[0],d=c[1],c=[]):c.length===3?(l=c[1],d=c[2],c=[c[0]]):c.length===4&&(l=c[2],d=c[3],c=[c[0],c[1]]);let f=d;return c.push((p,h,y,b,w,E,$)=>{f=l(f,p,h,y,b,w,E,$)}),this[s].apply(this,c),f}}function BV(t,e){const{name:n,type:r,direction:i}=e,s="find"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[s]=function(u,c,l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return!1;if(arguments.length===1)return l=u,d_(!0,this,r,l);if(arguments.length===2){u=""+u,l=c;const d=this._nodes.get(u);if(typeof d>"u")throw new se(`Graph.${s}: could not find the "${u}" node in the graph.`);return Lv(!0,this.multi,r==="mixed"?this.type:r,i,d,l)}if(arguments.length===3){u=""+u,c=""+c;const d=this._nodes.get(u);if(!d)throw new se(`Graph.${s}: could not find the "${u}" source node in the graph.`);if(!this._nodes.has(c))throw new se(`Graph.${s}: could not find the "${c}" target node in the graph.`);return Mv(!0,r,this.multi,i,d,c,l)}throw new pe(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const a="some"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[a]=function(){const u=Array.prototype.slice.call(arguments),c=u.pop();return u.push((d,f,p,h,y,b,w)=>c(d,f,p,h,y,b,w)),!!this[s].apply(this,u)};const o="every"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[o]=function(){const u=Array.prototype.slice.call(arguments),c=u.pop();return u.push((d,f,p,h,y,b,w)=>!c(d,f,p,h,y,b,w)),!this[s].apply(this,u)}}function qV(t,e){const{name:n,type:r,direction:i}=e,s=n.slice(0,-1)+"Entries";t.prototype[s]=function(a,o){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return nr.empty();if(!arguments.length)return IV(this,r);if(arguments.length===1){a=""+a;const u=this._nodes.get(a);if(!u)throw new se(`Graph.${s}: could not find the "${a}" node in the graph.`);return OV(r,i,u)}if(arguments.length===2){a=""+a,o=""+o;const u=this._nodes.get(a);if(!u)throw new se(`Graph.${s}: could not find the "${a}" source node in the graph.`);if(!this._nodes.has(o))throw new se(`Graph.${s}: could not find the "${o}" target node in the graph.`);return LV(r,i,u,o)}throw new pe(`Graph.${s}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function GV(t){kV.forEach(e=>{MV(t,e),zV(t,e),BV(t,e),qV(t,e)})}const jV=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function tm(){this.A=null,this.B=null}tm.prototype.wrap=function(t){this.A===null?this.A=t:this.B===null&&(this.B=t)},tm.prototype.has=function(t){return this.A!==null&&t in this.A||this.B!==null&&t in this.B};function Dd(t,e,n,r,i){for(const s in r){const a=r[s],o=a.source,u=a.target,c=o===n?u:o;if(e&&e.has(c.key))continue;const l=i(c.key,c.attributes);if(t&&l)return c.key}}function zv(t,e,n,r,i){if(e!=="mixed"){if(e==="undirected")return Dd(t,null,r,r.undirected,i);if(typeof n=="string")return Dd(t,null,r,r[n],i)}const s=new tm;let a;if(e!=="undirected"){if(n!=="out"){if(a=Dd(t,null,r,r.in,i),t&&a)return a;s.wrap(r.in)}if(n!=="in"){if(a=Dd(t,s,r,r.out,i),t&&a)return a;s.wrap(r.out)}}if(e!=="directed"&&(a=Dd(t,s,r,r.undirected,i),t&&a))return a}function UV(t,e,n){if(t!=="mixed"){if(t==="undirected")return Object.keys(n.undirected);if(typeof e=="string")return Object.keys(n[e])}const r=[];return zv(!1,t,e,n,function(i){r.push(i)}),r}function Ed(t,e,n){const r=Object.keys(n),i=r.length;let s=0;return new nr(function(){let o=null;do{if(s>=i)return t&&t.wrap(n),{done:!0};const u=n[r[s++]],c=u.source,l=u.target;if(o=c===e?l:c,t&&t.has(o.key)){o=null;continue}}while(o===null);return{done:!1,value:{neighbor:o.key,attributes:o.attributes}}})}function WV(t,e,n){if(t!=="mixed"){if(t==="undirected")return Ed(null,n,n.undirected);if(typeof e=="string")return Ed(null,n,n[e])}let r=nr.empty();const i=new tm;return t!=="undirected"&&(e!=="out"&&(r=wi(r,Ed(i,n,n.in))),e!=="in"&&(r=wi(r,Ed(i,n,n.out)))),t!=="directed"&&(r=wi(r,Ed(i,n,n.undirected))),r}function HV(t,e){const{name:n,type:r,direction:i}=e;t.prototype[n]=function(s){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return[];s=""+s;const a=this._nodes.get(s);if(typeof a>"u")throw new se(`Graph.${n}: could not find the "${s}" node in the graph.`);return UV(r==="mixed"?this.type:r,i,a)}}function VV(t,e){const{name:n,type:r,direction:i}=e,s="forEach"+n[0].toUpperCase()+n.slice(1,-1);t.prototype[s]=function(c,l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;c=""+c;const d=this._nodes.get(c);if(typeof d>"u")throw new se(`Graph.${s}: could not find the "${c}" node in the graph.`);zv(!1,r==="mixed"?this.type:r,i,d,l)};const a="map"+n[0].toUpperCase()+n.slice(1);t.prototype[a]=function(c,l){const d=[];return this[s](c,(f,p)=>{d.push(l(f,p))}),d};const o="filter"+n[0].toUpperCase()+n.slice(1);t.prototype[o]=function(c,l){const d=[];return this[s](c,(f,p)=>{l(f,p)&&d.push(f)}),d};const u="reduce"+n[0].toUpperCase()+n.slice(1);t.prototype[u]=function(c,l,d){if(arguments.length<3)throw new pe(`Graph.${u}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let f=d;return this[s](c,(p,h)=>{f=l(f,p,h)}),f}}function KV(t,e){const{name:n,type:r,direction:i}=e,s=n[0].toUpperCase()+n.slice(1,-1),a="find"+s;t.prototype[a]=function(c,l){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return;c=""+c;const d=this._nodes.get(c);if(typeof d>"u")throw new se(`Graph.${a}: could not find the "${c}" node in the graph.`);return zv(!0,r==="mixed"?this.type:r,i,d,l)};const o="some"+s;t.prototype[o]=function(c,l){return!!this[a](c,l)};const u="every"+s;t.prototype[u]=function(c,l){return!this[a](c,(f,p)=>!l(f,p))}}function YV(t,e){const{name:n,type:r,direction:i}=e,s=n.slice(0,-1)+"Entries";t.prototype[s]=function(a){if(r!=="mixed"&&this.type!=="mixed"&&r!==this.type)return nr.empty();a=""+a;const o=this._nodes.get(a);if(typeof o>"u")throw new se(`Graph.${s}: could not find the "${a}" node in the graph.`);return WV(r==="mixed"?this.type:r,i,o)}}function XV(t){jV.forEach(e=>{HV(t,e),VV(t,e),KV(t,e),YV(t,e)})}function nm(t,e,n,r,i){const s=r._nodes.values(),a=r.type;let o,u,c,l,d,f;for(;o=s.next(),o.done!==!0;){let p=!1;if(u=o.value,a!=="undirected"){l=u.out;for(c in l){d=l[c];do f=d.target,p=!0,i(u.key,f.key,u.attributes,f.attributes,d.key,d.attributes,d.undirected),d=d.next;while(d)}}if(a!=="directed"){l=u.undirected;for(c in l)if(!(e&&u.key>c)){d=l[c];do f=d.target,f.key!==c&&(f=d.source),p=!0,i(u.key,f.key,u.attributes,f.attributes,d.key,d.attributes,d.undirected),d=d.next;while(d)}}n&&!p&&i(u.key,null,u.attributes,null,null,null,null)}}function JV(t,e){const n={key:t};return r_(e.attributes)||(n.attributes=Bt({},e.attributes)),n}function QV(t,e,n){const r={key:e,source:n.source.key,target:n.target.key};return r_(n.attributes)||(r.attributes=Bt({},n.attributes)),t==="mixed"&&n.undirected&&(r.undirected=!0),r}function ZV(t){if(!en(t))throw new pe('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in t))throw new pe("Graph.import: serialized node is missing its key.");if("attributes"in t&&(!en(t.attributes)||t.attributes===null))throw new pe("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function e5(t){if(!en(t))throw new pe('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in t))throw new pe("Graph.import: serialized edge is missing its source.");if(!("target"in t))throw new pe("Graph.import: serialized edge is missing its target.");if("attributes"in t&&(!en(t.attributes)||t.attributes===null))throw new pe("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in t&&typeof t.undirected!="boolean")throw new pe("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const t5=rV(),n5=new Set(["directed","undirected","mixed"]),f_=new Set(["domain","_events","_eventsCount","_maxListeners"]),r5=[{name:t=>`${t}Edge`,generateKey:!0},{name:t=>`${t}DirectedEdge`,generateKey:!0,type:"directed"},{name:t=>`${t}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:t=>`${t}EdgeWithKey`},{name:t=>`${t}DirectedEdgeWithKey`,type:"directed"},{name:t=>`${t}UndirectedEdgeWithKey`,type:"undirected"}],i5={allowSelfLoops:!0,multi:!1,type:"mixed"};function s5(t,e,n){if(n&&!en(n))throw new pe(`Graph.addNode: invalid attributes. Expecting an object but got "${n}"`);if(e=""+e,n=n||{},t._nodes.has(e))throw new Se(`Graph.addNode: the "${e}" node already exist in the graph.`);const r=new t.NodeDataClass(e,n);return t._nodes.set(e,r),t.emit("nodeAdded",{key:e,attributes:n}),r}function p_(t,e,n){const r=new t.NodeDataClass(e,n);return t._nodes.set(e,r),t.emit("nodeAdded",{key:e,attributes:n}),r}function h_(t,e,n,r,i,s,a,o){if(!r&&t.type==="undirected")throw new Se(`Graph.${e}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(r&&t.type==="directed")throw new Se(`Graph.${e}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(o&&!en(o))throw new pe(`Graph.${e}: invalid attributes. Expecting an object but got "${o}"`);if(s=""+s,a=""+a,o=o||{},!t.allowSelfLoops&&s===a)throw new Se(`Graph.${e}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const u=t._nodes.get(s),c=t._nodes.get(a);if(!u)throw new se(`Graph.${e}: source node "${s}" not found.`);if(!c)throw new se(`Graph.${e}: target node "${a}" not found.`);const l={key:null,undirected:r,source:s,target:a,attributes:o};if(n)i=t._edgeKeyGenerator();else if(i=""+i,t._edges.has(i))throw new Se(`Graph.${e}: the "${i}" edge already exists in the graph.`);if(!t.multi&&(r?typeof u.undirected[a]<"u":typeof u.out[a]<"u"))throw new Se(`Graph.${e}: an edge linking "${s}" to "${a}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const d=new yo(r,i,u,c,o);t._edges.set(i,d);const f=s===a;return r?(u.undirectedDegree++,c.undirectedDegree++,f&&(u.undirectedLoops++,t._undirectedSelfLoopCount++)):(u.outDegree++,c.inDegree++,f&&(u.directedLoops++,t._directedSelfLoopCount++)),t.multi?d.attachMulti():d.attach(),r?t._undirectedSize++:t._directedSize++,l.key=i,t.emit("edgeAdded",l),i}function a5(t,e,n,r,i,s,a,o,u){if(!r&&t.type==="undirected")throw new Se(`Graph.${e}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(r&&t.type==="directed")throw new Se(`Graph.${e}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(o){if(u){if(typeof o!="function")throw new pe(`Graph.${e}: invalid updater function. Expecting a function but got "${o}"`)}else if(!en(o))throw new pe(`Graph.${e}: invalid attributes. Expecting an object but got "${o}"`)}s=""+s,a=""+a;let c;if(u&&(c=o,o=void 0),!t.allowSelfLoops&&s===a)throw new Se(`Graph.${e}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let l=t._nodes.get(s),d=t._nodes.get(a),f,p;if(!n&&(f=t._edges.get(i),f)){if((f.source.key!==s||f.target.key!==a)&&(!r||f.source.key!==a||f.target.key!==s))throw new Se(`Graph.${e}: inconsistency detected when attempting to merge the "${i}" edge with "${s}" source & "${a}" target vs. ("${f.source.key}", "${f.target.key}").`);p=f}if(!p&&!t.multi&&l&&(p=r?l.undirected[a]:l.out[a]),p){const E=[p.key,!1,!1,!1];if(u?!c:!o)return E;if(u){const $=p.attributes;p.attributes=c($),t.emit("edgeAttributesUpdated",{type:"replace",key:p.key,attributes:p.attributes})}else Bt(p.attributes,o),t.emit("edgeAttributesUpdated",{type:"merge",key:p.key,attributes:p.attributes,data:o});return E}o=o||{},u&&c&&(o=c(o));const h={key:null,undirected:r,source:s,target:a,attributes:o};if(n)i=t._edgeKeyGenerator();else if(i=""+i,t._edges.has(i))throw new Se(`Graph.${e}: the "${i}" edge already exists in the graph.`);let y=!1,b=!1;l||(l=p_(t,s,{}),y=!0,s===a&&(d=l,b=!0)),d||(d=p_(t,a,{}),b=!0),f=new yo(r,i,l,d,o),t._edges.set(i,f);const w=s===a;return r?(l.undirectedDegree++,d.undirectedDegree++,w&&(l.undirectedLoops++,t._undirectedSelfLoopCount++)):(l.outDegree++,d.inDegree++,w&&(l.directedLoops++,t._directedSelfLoopCount++)),t.multi?f.attachMulti():f.attach(),r?t._undirectedSize++:t._directedSize++,h.key=i,t.emit("edgeAdded",h),[i,!0,y,b]}function wo(t,e){t._edges.delete(e.key);const{source:n,target:r,attributes:i}=e,s=e.undirected,a=n===r;s?(n.undirectedDegree--,r.undirectedDegree--,a&&(n.undirectedLoops--,t._undirectedSelfLoopCount--)):(n.outDegree--,r.inDegree--,a&&(n.directedLoops--,t._directedSelfLoopCount--)),t.multi?e.detachMulti():e.detach(),s?t._undirectedSize--:t._directedSize--,t.emit("edgeDropped",{key:e.key,attributes:i,source:n.key,target:r.key,undirected:s})}class st extends pN{constructor(e){if(super(),e=Bt({},i5,e),typeof e.multi!="boolean")throw new pe(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!n5.has(e.type))throw new pe(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!="boolean")throw new pe(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);const n=e.type==="mixed"?s_:e.type==="directed"?a_:o_;ir(this,"NodeDataClass",n);const r="geid_"+t5()+"_";let i=0;const s=()=>{let a;do a=r+i++;while(this._edges.has(a));return a};ir(this,"_attributes",{}),ir(this,"_nodes",new Map),ir(this,"_edges",new Map),ir(this,"_directedSize",0),ir(this,"_undirectedSize",0),ir(this,"_directedSelfLoopCount",0),ir(this,"_undirectedSelfLoopCount",0),ir(this,"_edgeKeyGenerator",s),ir(this,"_options",e),f_.forEach(a=>ir(this,a,this[a])),yr(this,"order",()=>this._nodes.size),yr(this,"size",()=>this._edges.size),yr(this,"directedSize",()=>this._directedSize),yr(this,"undirectedSize",()=>this._undirectedSize),yr(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),yr(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),yr(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),yr(this,"multi",this._options.multi),yr(this,"type",this._options.type),yr(this,"allowSelfLoops",this._options.allowSelfLoops),yr(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(""+e)}hasDirectedEdge(e,n){if(this.type==="undirected")return!1;if(arguments.length===1){const r=""+e,i=this._edges.get(r);return!!i&&!i.undirected}else if(arguments.length===2){e=""+e,n=""+n;const r=this._nodes.get(e);return r?r.out.hasOwnProperty(n):!1}throw new pe(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,n){if(this.type==="directed")return!1;if(arguments.length===1){const r=""+e,i=this._edges.get(r);return!!i&&i.undirected}else if(arguments.length===2){e=""+e,n=""+n;const r=this._nodes.get(e);return r?r.undirected.hasOwnProperty(n):!1}throw new pe(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,n){if(arguments.length===1){const r=""+e;return this._edges.has(r)}else if(arguments.length===2){e=""+e,n=""+n;const r=this._nodes.get(e);return r?typeof r.out<"u"&&r.out.hasOwnProperty(n)||typeof r.undirected<"u"&&r.undirected.hasOwnProperty(n):!1}throw new pe(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,n){if(this.type==="undirected")return;if(e=""+e,n=""+n,this.multi)throw new Se("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const r=this._nodes.get(e);if(!r)throw new se(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(n))throw new se(`Graph.directedEdge: could not find the "${n}" target node in the graph.`);const i=r.out&&r.out[n]||void 0;if(i)return i.key}undirectedEdge(e,n){if(this.type==="directed")return;if(e=""+e,n=""+n,this.multi)throw new Se("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const r=this._nodes.get(e);if(!r)throw new se(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(n))throw new se(`Graph.undirectedEdge: could not find the "${n}" target node in the graph.`);const i=r.undirected&&r.undirected[n]||void 0;if(i)return i.key}edge(e,n){if(this.multi)throw new Se("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e,n=""+n;const r=this._nodes.get(e);if(!r)throw new se(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(n))throw new se(`Graph.edge: could not find the "${n}" target node in the graph.`);const i=r.out&&r.out[n]||r.undirected&&r.undirected[n]||void 0;if(i)return i.key}areDirectedNeighbors(e,n){e=""+e,n=""+n;const r=this._nodes.get(e);if(!r)throw new se(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:n in r.in||n in r.out}areOutNeighbors(e,n){e=""+e,n=""+n;const r=this._nodes.get(e);if(!r)throw new se(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:n in r.out}areInNeighbors(e,n){e=""+e,n=""+n;const r=this._nodes.get(e);if(!r)throw new se(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:n in r.in}areUndirectedNeighbors(e,n){e=""+e,n=""+n;const r=this._nodes.get(e);if(!r)throw new se(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="directed"?!1:n in r.undirected}areNeighbors(e,n){e=""+e,n=""+n;const r=this._nodes.get(e);if(!r)throw new se(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&(n in r.in||n in r.out)||this.type!=="directed"&&n in r.undirected}areInboundNeighbors(e,n){e=""+e,n=""+n;const r=this._nodes.get(e);if(!r)throw new se(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&n in r.in||this.type!=="directed"&&n in r.undirected}areOutboundNeighbors(e,n){e=""+e,n=""+n;const r=this._nodes.get(e);if(!r)throw new se(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&n in r.out||this.type!=="directed"&&n in r.undirected}inDegree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new se(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:n.inDegree}outDegree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new se(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:n.outDegree}directedDegree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new se(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree}undirectedDegree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new se(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree}inboundDegree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new se(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree),r}outboundDegree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new se(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.outDegree),r}degree(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new se(`Graph.degree: could not find the "${e}" node in the graph.`);let r=0;return this.type!=="directed"&&(r+=n.undirectedDegree),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree),r}inDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new se(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:n.inDegree-n.directedLoops}outDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new se(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:n.outDegree-n.directedLoops}directedDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new se(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:n.inDegree+n.outDegree-n.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new se(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:n.undirectedDegree-n.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new se(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree,i+=n.directedLoops),r-i}outboundDegreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new se(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.outDegree,i+=n.directedLoops),r-i}degreeWithoutSelfLoops(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new se(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let r=0,i=0;return this.type!=="directed"&&(r+=n.undirectedDegree,i+=n.undirectedLoops*2),this.type!=="undirected"&&(r+=n.inDegree+n.outDegree,i+=n.directedLoops*2),r-i}source(e){e=""+e;const n=this._edges.get(e);if(!n)throw new se(`Graph.source: could not find the "${e}" edge in the graph.`);return n.source.key}target(e){e=""+e;const n=this._edges.get(e);if(!n)throw new se(`Graph.target: could not find the "${e}" edge in the graph.`);return n.target.key}extremities(e){e=""+e;const n=this._edges.get(e);if(!n)throw new se(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[n.source.key,n.target.key]}opposite(e,n){e=""+e,n=""+n;const r=this._edges.get(n);if(!r)throw new se(`Graph.opposite: could not find the "${n}" edge in the graph.`);const i=r.source.key,s=r.target.key;if(e===i)return s;if(e===s)return i;throw new se(`Graph.opposite: the "${e}" node is not attached to the "${n}" edge (${i}, ${s}).`)}hasExtremity(e,n){e=""+e,n=""+n;const r=this._edges.get(e);if(!r)throw new se(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return r.source.key===n||r.target.key===n}isUndirected(e){e=""+e;const n=this._edges.get(e);if(!n)throw new se(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return n.undirected}isDirected(e){e=""+e;const n=this._edges.get(e);if(!n)throw new se(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!n.undirected}isSelfLoop(e){e=""+e;const n=this._edges.get(e);if(!n)throw new se(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return n.source===n.target}addNode(e,n){return s5(this,e,n).key}mergeNode(e,n){if(n&&!en(n))throw new pe(`Graph.mergeNode: invalid attributes. Expecting an object but got "${n}"`);e=""+e,n=n||{};let r=this._nodes.get(e);return r?(n&&(Bt(r.attributes,n),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:r.attributes,data:n})),[e,!1]):(r=new this.NodeDataClass(e,n),this._nodes.set(e,r),this.emit("nodeAdded",{key:e,attributes:n}),[e,!0])}updateNode(e,n){if(n&&typeof n!="function")throw new pe(`Graph.updateNode: invalid updater function. Expecting a function but got "${n}"`);e=""+e;let r=this._nodes.get(e);if(r){if(n){const s=r.attributes;r.attributes=n(s),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:r.attributes})}return[e,!1]}const i=n?n({}):{};return r=new this.NodeDataClass(e,i),this._nodes.set(e,r),this.emit("nodeAdded",{key:e,attributes:i}),[e,!0]}dropNode(e){e=""+e;const n=this._nodes.get(e);if(!n)throw new se(`Graph.dropNode: could not find the "${e}" node in the graph.`);let r;if(this.type!=="undirected"){for(const i in n.out){r=n.out[i];do wo(this,r),r=r.next;while(r)}for(const i in n.in){r=n.in[i];do wo(this,r),r=r.next;while(r)}}if(this.type!=="directed")for(const i in n.undirected){r=n.undirected[i];do wo(this,r),r=r.next;while(r)}this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:n.attributes})}dropEdge(e){let n;if(arguments.length>1){const r=""+arguments[0],i=""+arguments[1];if(n=rr(this,r,i,this.type),!n)throw new se(`Graph.dropEdge: could not find the "${r}" -> "${i}" edge in the graph.`)}else if(e=""+e,n=this._edges.get(e),!n)throw new se(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return wo(this,n),this}dropDirectedEdge(e,n){if(arguments.length<2)throw new Se("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new Se("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");e=""+e,n=""+n;const r=rr(this,e,n,"directed");if(!r)throw new se(`Graph.dropDirectedEdge: could not find a "${e}" -> "${n}" edge in the graph.`);return wo(this,r),this}dropUndirectedEdge(e,n){if(arguments.length<2)throw new Se("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new Se("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const r=rr(this,e,n,"undirected");if(!r)throw new se(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${n}" edge in the graph.`);return wo(this,r),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const e=this._nodes.values();let n;for(;n=e.next(),n.done!==!0;)n.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,n){return this._attributes[e]=n,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}updateAttribute(e,n){if(typeof n!="function")throw new pe("Graph.updateAttribute: updater should be a function.");const r=this._attributes[e];return this._attributes[e]=n(r),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!en(e))throw new pe("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(e){if(!en(e))throw new pe("Graph.mergeAttributes: provided attributes are not a plain object.");return Bt(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!="function")throw new pe("Graph.updateAttributes: provided updater is not a function.");return this._attributes=e(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(e,n){if(typeof e!="function")throw new pe("Graph.updateEachNodeAttributes: expecting an updater function.");if(n&&!i_(n))throw new pe("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._nodes.values();let i,s;for(;i=r.next(),i.done!==!0;)s=i.value,s.attributes=e(s.key,s.attributes);this.emit("eachNodeAttributesUpdated",{hints:n||null})}updateEachEdgeAttributes(e,n){if(typeof e!="function")throw new pe("Graph.updateEachEdgeAttributes: expecting an updater function.");if(n&&!i_(n))throw new pe("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const r=this._edges.values();let i,s,a,o;for(;i=r.next(),i.done!==!0;)s=i.value,a=s.source,o=s.target,s.attributes=e(s.key,s.attributes,a.key,o.key,a.attributes,o.attributes,s.undirected);this.emit("eachEdgeAttributesUpdated",{hints:n||null})}forEachAdjacencyEntry(e){if(typeof e!="function")throw new pe("Graph.forEachAdjacencyEntry: expecting a callback.");nm(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new pe("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");nm(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!="function")throw new pe("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");nm(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new pe("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");nm(!1,!0,!0,this,e)}nodes(){return typeof Array.from=="function"?Array.from(this._nodes.keys()):t_(this._nodes.keys(),this._nodes.size)}forEachNode(e){if(typeof e!="function")throw new pe("Graph.forEachNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)i=r.value,e(i.key,i.attributes)}findNode(e){if(typeof e!="function")throw new pe("Graph.findNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,e(i.key,i.attributes))return i.key}mapNodes(e){if(typeof e!="function")throw new pe("Graph.mapNode: expecting a callback.");const n=this._nodes.values();let r,i;const s=new Array(this.order);let a=0;for(;r=n.next(),r.done!==!0;)i=r.value,s[a++]=e(i.key,i.attributes);return s}someNode(e){if(typeof e!="function")throw new pe("Graph.someNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,e(i.key,i.attributes))return!0;return!1}everyNode(e){if(typeof e!="function")throw new pe("Graph.everyNode: expecting a callback.");const n=this._nodes.values();let r,i;for(;r=n.next(),r.done!==!0;)if(i=r.value,!e(i.key,i.attributes))return!1;return!0}filterNodes(e){if(typeof e!="function")throw new pe("Graph.filterNodes: expecting a callback.");const n=this._nodes.values();let r,i;const s=[];for(;r=n.next(),r.done!==!0;)i=r.value,e(i.key,i.attributes)&&s.push(i.key);return s}reduceNodes(e,n){if(typeof e!="function")throw new pe("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new pe("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let r=n;const i=this._nodes.values();let s,a;for(;s=i.next(),s.done!==!0;)a=s.value,r=e(r,a.key,a.attributes);return r}nodeEntries(){const e=this._nodes.values();return new nr(()=>{const n=e.next();if(n.done)return n;const r=n.value;return{value:{node:r.key,attributes:r.attributes},done:!1}})}export(){const e=new Array(this._nodes.size);let n=0;this._nodes.forEach((i,s)=>{e[n++]=JV(s,i)});const r=new Array(this._edges.size);return n=0,this._edges.forEach((i,s)=>{r[n++]=QV(this.type,s,i)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:r}}import(e,n=!1){if(e instanceof st)return e.forEachNode((u,c)=>{n?this.mergeNode(u,c):this.addNode(u,c)}),e.forEachEdge((u,c,l,d,f,p,h)=>{n?h?this.mergeUndirectedEdgeWithKey(u,l,d,c):this.mergeDirectedEdgeWithKey(u,l,d,c):h?this.addUndirectedEdgeWithKey(u,l,d,c):this.addDirectedEdgeWithKey(u,l,d,c)}),this;if(!en(e))throw new pe("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!en(e.attributes))throw new pe("Graph.import: invalid attributes. Expecting a plain object.");n?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}let r,i,s,a,o;if(e.nodes){if(s=e.nodes,!Array.isArray(s))throw new pe("Graph.import: invalid nodes. Expecting an array.");for(r=0,i=s.length;r<i;r++){a=s[r],ZV(a);const{key:u,attributes:c}=a;n?this.mergeNode(u,c):this.addNode(u,c)}}if(e.edges){let u=!1;if(this.type==="undirected"&&(u=!0),s=e.edges,!Array.isArray(s))throw new pe("Graph.import: invalid edges. Expecting an array.");for(r=0,i=s.length;r<i;r++){o=s[r],e5(o);const{source:c,target:l,attributes:d,undirected:f=u}=o;let p;"key"in o?(p=n?f?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:f?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey,p.call(this,o.key,c,l,d)):(p=n?f?this.mergeUndirectedEdge:this.mergeDirectedEdge:f?this.addUndirectedEdge:this.addDirectedEdge,p.call(this,c,l,d))}}return this}nullCopy(e){const n=new st(Bt({},this._options,e));return n.replaceAttributes(Bt({},this.getAttributes())),n}emptyCopy(e){const n=this.nullCopy(e);return this._nodes.forEach((r,i)=>{const s=Bt({},r.attributes);r=new n.NodeDataClass(i,s),n._nodes.set(i,r)}),n}copy(e){if(e=e||{},typeof e.type=="string"&&e.type!==this.type&&e.type!=="mixed")throw new Se(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi=="boolean"&&e.multi!==this.multi&&e.multi!==!0)throw new Se("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof e.allowSelfLoops=="boolean"&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new Se("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const n=this.emptyCopy(e),r=this._edges.values();let i,s;for(;i=r.next(),i.done!==!0;)s=i.value,h_(n,"copy",!1,s.undirected,s.key,s.source.key,s.target.key,Bt({},s.attributes));return n}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const e={};this._nodes.forEach((s,a)=>{e[a]=s.attributes});const n={},r={};this._edges.forEach((s,a)=>{const o=s.undirected?"--":"->";let u="",c=s.source.key,l=s.target.key,d;s.undirected&&c>l&&(d=c,c=l,l=d);const f=`(${c})${o}(${l})`;a.startsWith("geid_")?this.multi&&(typeof r[f]>"u"?r[f]=0:r[f]++,u+=`${r[f]}. `):u+=`[${a}]: `,u+=f,n[u]=s.attributes});const i={};for(const s in this)this.hasOwnProperty(s)&&!f_.has(s)&&typeof this[s]!="function"&&typeof s!="symbol"&&(i[s]=this[s]);return i.attributes=this._attributes,i.nodes=e,i.edges=n,ir(i,"constructor",this.constructor),i}}typeof Symbol<"u"&&(st.prototype[Symbol.for("nodejs.util.inspect.custom")]=st.prototype.inspect),r5.forEach(t=>{["add","merge","update"].forEach(e=>{const n=t.name(e),r=e==="add"?h_:a5;t.generateKey?st.prototype[n]=function(i,s,a){return r(this,n,!0,(t.type||this.type)==="undirected",null,i,s,a,e==="update")}:st.prototype[n]=function(i,s,a,o){return r(this,n,!1,(t.type||this.type)==="undirected",i,s,a,o,e==="update")}})}),mV(st),TV(st),GV(st),XV(st);class m_ extends st{constructor(e){const n=Bt({type:"directed"},e);if("multi"in n&&n.multi!==!1)throw new pe("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="directed")throw new pe('DirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class g_ extends st{constructor(e){const n=Bt({type:"undirected"},e);if("multi"in n&&n.multi!==!1)throw new pe("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(n.type!=="undirected")throw new pe('UndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class y_ extends st{constructor(e){const n=Bt({multi:!0},e);if("multi"in n&&n.multi!==!0)throw new pe("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(n)}}class w_ extends st{constructor(e){const n=Bt({type:"directed",multi:!0},e);if("multi"in n&&n.multi!==!0)throw new pe("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="directed")throw new pe('MultiDirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}class v_ extends st{constructor(e){const n=Bt({type:"undirected",multi:!0},e);if("multi"in n&&n.multi!==!0)throw new pe("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(n.type!=="undirected")throw new pe('MultiUndirectedGraph.from: inconsistent "'+n.type+'" type in given options!');super(n)}}function vo(t){t.from=function(e,n){const r=Bt({},e.options,n),i=new t(r);return i.import(e),i}}vo(st),vo(m_),vo(g_),vo(y_),vo(w_),vo(v_),st.Graph=st,st.DirectedGraph=m_,st.UndirectedGraph=g_,st.MultiGraph=y_,st.MultiDirectedGraph=w_,st.MultiUndirectedGraph=v_,st.InvalidArgumentsGraphError=pe,st.NotFoundGraphError=se,st.UsageGraphError=Se;const Bv="dashed",qv=jt.font;class Gv{constructor(e){this.view=e,this.compoundIds=new Set(e.nodes.filter(Gn).map(r=>r.id)),this.edgesWithCompounds=new Set(this.compoundIds.size>0?e.edges.filter(r=>this.compoundIds.has(r.source)||this.compoundIds.has(r.target)).map(r=>r.id):[]);for(const r of e.nodes)this.graphology.addNode(r.id,{origin:r,level:r.level,depth:r.depth??0,modelRef:BD.modelRef(r),deploymentRef:BD.deploymentRef(r),maxConnectedHierarchyDistance:0});for(const r of e.edges){let i=this.graphology.getNodeAttribute(r.source,"deploymentRef"),s=this.graphology.getNodeAttribute(r.target,"deploymentRef");(i===null||s===null)&&(i=this.graphology.getNodeAttribute(r.source,"modelRef"),s=this.graphology.getNodeAttribute(r.target,"modelRef"));let a=-1;i!==null&&s!==null?a=V1(i,s):zt.warn(`Edge ${r.id} of view ${e.id} is invalid, sourceFqn: ${i}, targetFqn: ${s}`),this.graphology.addEdgeWithKey(r.id,r.source,r.target,{origin:r,hierarchyDistance:a,weight:1}),a>this.graphology.getNodeAttribute(r.source,"maxConnectedHierarchyDistance")&&this.graphology.mergeNodeAttributes(r.source,{maxConnectedHierarchyDistance:a}),a>this.graphology.getNodeAttribute(r.target,"maxConnectedHierarchyDistance")&&this.graphology.mergeNodeAttributes(r.target,{maxConnectedHierarchyDistance:a})}this.graphology.forEachEdge((r,{hierarchyDistance:i},s,a,o,u)=>{const c=Math.max(o.maxConnectedHierarchyDistance,u.maxConnectedHierarchyDistance);if(c>i)this.graphology.mergeEdgeAttributes(r,{weight:c-i+1});else{const l=this.graphology.directedDegree(s),d=this.graphology.directedDegree(a);l===1&&d===1&&i>1&&this.graphology.mergeEdgeAttributes(r,{weight:i})}});const n=this.graphvizModel=this.createGraph();this.applyNodeAttributes(n.attributes.node),this.applyEdgeAttributes(n.attributes.edge)}ids=new Set;subgraphs=new Map;nodes=new Map;edges=new Map;compoundIds;edgesWithCompounds;graphology=new st({allowSelfLoops:!0,multi:!0,type:"directed"});graphvizModel;get hasEdgesWithCompounds(){return this.edgesWithCompounds.size>0}postBuild(e){}build(e){const n=(i,s)=>{const a=this.generateGraphvizId(i),o=this.elementToSubgraph(i,s.subgraph(a));this.subgraphs.set(i.id,o);for(const u of i.children){const c=this.computedNode(u);if(Gn(c))n(c,o);else{const l=pn(this.getGraphNode(c.id),`Graphviz Node not found for ${c.id}`);o.node(l.id)}}},r=[];for(const i of this.view.nodes)if(Gn(i))Dt(i.parent)&&r.push(i);else{const s=this.generateGraphvizId(i),a=this.elementToNode(i,e.node(s));this.nodes.set(i.id,a)}for(const i of r)n(i,e);for(const i of this.view.edges){const s=this.addEdge(i,e);s&&this.edges.set(i.id,s)}}print(){const e=this.graphvizModel;return this.build(e),this.postBuild(e),G0(this.graphvizModel,{print:{indentStyle:"space",indentSize:2}})}createGraph(){const e=this.view.autoLayout,n=_H({[N.bgcolor]:"transparent",[N.layout]:"dot",[N.compound]:!0,[N.rankdir]:e.direction,[N.TBbalance]:"min",[N.splines]:"spline",[N.outputorder]:"nodesfirst",[N.nodesep]:ft(e.nodeSep??110),[N.ranksep]:ft(e.rankSep??120),[N.pad]:ft(15),[N.fontname]:qv});return n.attributes.graph.apply({[N.fontsize]:tr(15),[N.labeljust]:e.direction==="RL"?"r":"l",[N.labelloc]:e.direction==="BT"?"b":"t",[N.margin]:50.1}),n}applyNodeAttributes(e){e.apply({[N.fontname]:qv,[N.shape]:"rect",[N.fillcolor]:jt.elements[Ra].fill,[N.fontcolor]:jt.elements[Ra].hiContrast,[N.color]:jt.elements[Ra].stroke,[N.style]:"filled",[N.penwidth]:0})}applyEdgeAttributes(e){e.apply({[N.arrowsize]:.75,[N.fontname]:qv,[N.fontsize]:tr(14),[N.penwidth]:tr(2),[N.color]:jt.relationships[Co].lineColor,[N.fontcolor]:jt.relationships[Co].labelColor})}checkNodeId(e,n=!1){return n?e="cluster_"+e:e.toLowerCase().startsWith("cluster")&&(e="nd_"+e),this.ids.has(e)?null:(this.ids.add(e),e)}generateGraphvizId(e){const n=Gn(e);let r=Hd(e.id).toLowerCase(),i=this.checkNodeId(r,n);if(i!==null)return i;r=Hd(e.id).toLowerCase();let s=1;do i=this.checkNodeId(r+"_"+s++,n);while(i===null);return i}elementToSubgraph(e,n){_e(Gn(e),"node should be compound"),_e(Sp(e.depth),"node.depth should be defined");const r=this.getElementColorValues(e.color),i=UH(r.loContrast);return n.apply({[N.likec4_id]:e.id,[N.likec4_level]:e.level,[N.likec4_depth]:e.depth,[N.fillcolor]:H0(r.fill,e.depth),[N.color]:H0(r.stroke,e.depth),[N.style]:"filled",[N.margin]:tr(e.children.length>1?40:32)}),Qn(e.title.trim())||n.set(N.label,KH(e,i)),n}elementToNode(e,n){_e(!Gn(e),"node should not be compound");const r=ie(e.icon),i=this.getElementColorValues(e.color);let s=e.style.size,a=e.style.textSize;!s&&a&&(s=a),!a&&s&&(a=s),s??=dN,a??=fN;const o=e.style.padding??lN,u=jt.spacing[o];switch(n.attributes.apply({[N.likec4_id]:e.id,[N.likec4_level]:e.level,[N.label]:VH(e,i,{shape:s,text:a}),[N.margin]:`${ft(r?10:u)},${ft(u)}`}),n.attributes.set(N.width,ft(jt.sizes[s].width)),n.attributes.set(N.height,ft(jt.sizes[s].height)),e.color!==Ra&&n.attributes.apply({[N.fillcolor]:i.fill,[N.fontcolor]:i.hiContrast,[N.color]:i.stroke}),e.shape){case"cylinder":case"storage":{n.attributes.apply({[N.margin]:`${ft(r?10:u)},${ft(0)}`,[N.penwidth]:tr(2),[N.shape]:"cylinder"});break}case"browser":{n.attributes.apply({[N.margin]:`${ft(r?10:u+4)},${ft(u+6)}`});break}case"mobile":{n.attributes.apply({[N.margin]:`${ft(r?10:u+4)},${ft(u)}`});break}case"queue":{n.attributes.apply({[N.width]:ft(jt.sizes[s].width),[N.height]:ft(jt.sizes[s].height-8),[N.margin]:`${ft(r?10:u+4)},${ft(u)}`});break}}return n}leafElements(e){return e===null?this.view.nodes.filter(n=>!Gn(n)):this.computedNode(e).children.flatMap(n=>{const r=this.computedNode(n);return Gn(r)?this.leafElements(r.id):r})}descendants(e){return e===null?this.view.nodes.slice():this.computedNode(e).children.flatMap(n=>{const r=this.computedNode(n);return[r,...this.descendants(r.id)]})}computedNode(e){return pn(this.view.nodes.find(n=>n.id===e),`Node ${e} not found`)}getGraphNode(e){return this.nodes.get(e)??null}getSubgraph(e){return this.subgraphs.get(e)??null}edgeEndpoint(e,n){let r=this.computedNode(e),i=this.getGraphNode(e),s;return i||(_e(Gn(r),"endpoint node should be compound"),s=this.getSubgraph(e)?.id,_e(s,`subgraph ${e} not found`),r=pn(n(this.leafElements(e)),`leaf element in ${e} not found`),i=pn(this.getGraphNode(r.id),`source graphviz node ${r.id} not found`)),[r,i,s]}findInternalEdges(e){if(e===null)return this.view.edges.slice();const n=this.computedNode(e);return Qe(this.descendants(e),Fi(r=>HT(r.inEdges,r.outEdges)),Hu(),Qj(HT(n.inEdges,n.outEdges)),an(r=>this.view.edges.find(i=>i.id===r)),je(ie))}withoutCompoundEdges(e){return this.edgesWithCompounds.size===0?e:{...e,inEdges:e.inEdges.filter(n=>!this.edgesWithCompounds.has(n)),outEdges:e.outEdges.filter(n=>!this.edgesWithCompounds.has(n))}}assignGroups(){const e=Qe(this.view.nodes,je(Gn),an(r=>r.id),BT(K1),qT(),an(r=>{const i=this.findInternalEdges(r).filter(s=>s.source!==s.target&&!this.compoundIds.has(s.source)&&!this.compoundIds.has(s.target));return{id:r,edges:i}}),je(({edges:r})=>r.length>1&&r.length<8),lj(4)),n=new Set;for(const r of e){const i=r.edges.filter(s=>!n.has(s.source)&&!n.has(s.target));for(const s of i)try{const a=pn(this.getGraphNode(s.source),`Graphviz Node not found for ${s.source}`),o=pn(this.getGraphNode(s.target),`Graphviz Node not found for ${s.target}`);n.add(s.source),n.add(s.target),a.attributes.set(N.group,r.id),o.attributes.set(N.group,r.id)}catch(a){zt.error(a)}}}applyManualLayout({height:e,...n}){const r=n.x<0?-n.x:0,i=n.y<0?-n.y:0,s=r>0||i>0;for(const{id:a,...o}of n.nodes){const u=this.getGraphNode(a);if(!u)continue;const c=ft(o.center.x)+r,l=ft(e-o.center.y);o.fixedsize?u.attributes.apply({[N.pos]:`${c},${l}!`,[N.pin]:!0,[N.width]:ft(o.fixedsize.width),[N.height]:ft(o.fixedsize.height),[N.fixedsize]:!0}):u.attributes.set(N.pos,`${c},${l}`)}for(const[a,o]of this.edges.entries()){o.attributes.delete(N.weight),o.attributes.delete(N.minlen),o.attributes.delete(N.constraint);const u=n.edges.find(c=>c.id===a)?.dotpos;u&&!s&&o.attributes.set(N.pos,u)}return this.graphvizModel.apply({[N.layout]:"fdp",[N.overlap]:"vpsc",[N.sep]:"+50,50",[N.esep]:"+10,10",[N.start]:"random2",[N.splines]:"compound"}),this.graphvizModel.delete(N.compound),this.graphvizModel.delete(N.rankdir),this.graphvizModel.delete(N.nodesep),this.graphvizModel.delete(N.ranksep),this.graphvizModel.delete(N.pack),this.graphvizModel.delete(N.pad),this.graphvizModel.delete(N.packmode),this.graphvizModel.attributes.graph.delete(N.margin),this}getRelationshipColorValues(e){return xD(e)?jt.relationships[e]:this.view.customColorDefinitions[e]?.relationships??jt.relationships[Ra]}getElementColorValues(e){return xD(e)?jt.elements[e]:this.view.customColorDefinitions[e]?.elements??jt.elements[Ra]}}class o5 extends Gv{createGraph(){const e=super.createGraph(),n=this.view.autoLayout;return e.delete(N.TBbalance),e.apply({[N.nodesep]:ft(n.nodeSep??130),[N.ranksep]:ft(n.rankSep??130)}),e}postBuild(e){Qe(this.view.nodes,an(n=>({node:n,graphvizNode:this.getGraphNode(n.id)})),Ps(({node:n,graphvizNode:r})=>{if(r!=null)return Vd.modelRef(n)??void 0}),Wu(),je(Nr(2)),Mj(n=>{e.subgraph({[N.rank]:"same"},r=>{for(const{graphvizNode:i}of n)r.node(pn(i).id)})}),hj(()=>{e.set(N.newrank,!0),e.set(N.clusterrank,"global"),e.delete(N.pack),e.delete(N.packmode)}))}elementToSubgraph(e,n){const r=super.elementToSubgraph(e,n);return e.children.length>1&&r.set(N.margin,tr(50)),r}addEdge(e,n){const[r,i]=[e.source,e.target],[s,a,o]=this.edgeEndpoint(r,w=>Yu(w)),[u,c,l]=this.edgeEndpoint(i,Ua),d=on(l)||on(o),f=n.edge([a,c],{[N.likec4_id]:e.id,[N.style]:e.line??Bv});l&&f.attributes.set(N.lhead,l),o&&f.attributes.set(N.ltail,o);const p=this.graphology.getEdgeAttribute(e.id,"weight");p>1&&!this.graphology.hasDirectedEdge(e.target,e.source)&&f.attributes.set(N.weight,p);const h=Y0(e);if(h&&f.attributes.set(d?N.xlabel:N.label,h),e.color){const w=this.getRelationshipColorValues(e.color);f.attributes.apply({[N.color]:w.lineColor,[N.fontcolor]:w.labelColor})}let[y,b]=[e.head??ls,e.tail??"none"];return y==="none"&&b==="none"?(f.attributes.apply({[N.arrowtail]:"none",[N.arrowhead]:"none",[N.dir]:"none"}),f):e.dir==="both"?(f.attributes.apply({[N.arrowhead]:cn(y),[N.arrowtail]:cn(e.tail??y),[N.dir]:"both"}),!d&&Vd.modelRef(s)!==Vd.modelRef(u)&&f.attributes.set(N.constraint,!1),f):(y!==ls&&f.attributes.set(N.arrowhead,cn(y)),b!=="none"&&f.attributes.set(N.arrowtail,cn(b)),f)}}class RD extends Gv{static toDot(e){return new RD(e).print()}postBuild(e){e.set(N.TBbalance,"max")}addEdge(e,n){const{nodes:r}=this.view,[i,s]=e.dir==="back"?[e.target,e.source]:[e.source,e.target],[a,o,u]=this.edgeEndpoint(i,k=>Yu(k)),[c,l,d]=this.edgeEndpoint(s,Ua),f=n.edge([o,l],{[N.likec4_id]:e.id,[N.style]:e.line??Bv});if(d&&f.attributes.set(N.lhead,d),u&&f.attributes.set(N.ltail,u),e.color&&e.color!==Co){const k=this.getRelationshipColorValues(e.color);f.attributes.apply({[N.color]:k.lineColor,[N.fontcolor]:k.labelColor})}const p=[e.label?.trim(),e.technology?.trim()].filter(ie).join(`
211
+ `),h=Y1(e.id),y=YH(h,p);f.attributes.set(N.label,y);const b=this.graphology.getEdgeAttribute(e.id,"weight");e.source!==e.target&&b>1&&f.attributes.set(N.weight,b);const w=r.findIndex(k=>k.id===i);r.findIndex(k=>k.id===s)<w&&e.dir!=="back"&&f.attributes.apply({[N.constraint]:!1});let[E,$]=[e.head??ls,e.tail??"none"];return e.dir==="back"?(f.attributes.apply({[N.arrowtail]:cn(E),[N.minlen]:0,[N.dir]:"back"}),$!=="none"&&f.attributes.apply({[N.arrowhead]:cn($),[N.dir]:"both"}),f):E==="none"&&$==="none"||E!=="none"&&$!=="none"?(f.attributes.apply({[N.arrowhead]:cn(E),[N.arrowtail]:cn($),[N.dir]:"both"}),f):E==="none"?(f.attributes.delete(N.arrowhead),f.attributes.apply({[N.arrowtail]:cn($),[N.minlen]:0,[N.dir]:"back"}),f):(E!==ls&&f.attributes.set(N.arrowhead,cn(E)),f)}}class u5 extends Gv{postBuild(e){this.assignGroups();const n=new Set,r=this.view.nodes.reduce((s,a)=>(Gn(a)&&(n.add(a.id),s.push(a)),s),[]);let i=!1;for(const s of r){const a=Qe(s.children,je(l=>!this.compoundIds.has(l)),an(l=>this.computedNode(l)),je(l=>l.inEdges.length===0&&l.outEdges.length===0));if(a.length<=2)continue;let o=2;switch(!0){case a.length>11:o=4;break;case a.length>4:o=3;break}const u=pn(this.getSubgraph(s.id),`Subgraph not found for ${s.id}`);let c=null;n8(a,o).forEach(l=>{const d=l.length>1?u.createSubgraph({[N.rank]:"same"}):null;l.forEach((f,p)=>{const h=this.getGraphNode(f.id);h&&(d?.node(h.id),p===0&&(c&&u.edge([c,h],{[N.style]:"invis"}),c=h))}),i=i||!!d})}i&&(e.set(N.newrank,!0),e.set(N.clusterrank,"global"))}addEdge(e,n){const[r,i]=e.dir==="back"?[e.target,e.source]:[e.source,e.target],[s,a,o]=this.edgeEndpoint(r,$=>Yu($)),[u,c,l]=this.edgeEndpoint(i,Ua),d=e.parent,f=this.graphology.getEdgeAttributes(e.id),p=n.edge([a,c],{[N.likec4_id]:e.id,[N.style]:e.line??Bv});l&&p.attributes.set(N.lhead,l),o&&p.attributes.set(N.ltail,o);const h=on(l)||on(o);!this.graphology.hasDirectedEdge(e.target,e.source)&&f.weight>1&&p.attributes.set(N.weight,f.weight);const y=Y0(e);if(y&&p.attributes.set(h?N.xlabel:N.label,y),e.color){const $=this.getRelationshipColorValues(e.color);p.attributes.apply({[N.color]:$.lineColor,[N.fontcolor]:$.labelColor})}let[b,w]=[e.head??ls,e.tail??"none"];if(e.dir==="back")return p.attributes.apply({[N.arrowtail]:cn(b),[N.dir]:"back"}),w!=="none"&&p.attributes.apply({[N.arrowhead]:cn(w),[N.dir]:"both",[N.minlen]:0}),p;if(b==="none"&&w==="none")return p.attributes.apply({[N.arrowtail]:"none",[N.arrowhead]:"none",[N.dir]:"none",[N.minlen]:0,[N.constraint]:!1}),p;if(b!=="none"&&w!=="none")return p.attributes.apply({[N.arrowhead]:cn(b),[N.arrowtail]:cn(w),[N.dir]:"both",[N.minlen]:0}),p;if(b!==ls&&p.attributes.set(N.arrowhead,cn(b)),w!=="none"&&p.attributes.set(N.arrowtail,cn(w)),this.view.edges.length===1)return p;let E;return d===null&&s.parent==null&&u.parent==null?E=this.view.edges.filter($=>{if($.id===e.id||$.parent!==null||$.source===e.source&&$.target===e.target||$.source===e.target&&$.target===e.source)return!1;const k=this.computedNode($.source),A=this.computedNode($.target);return Gn(k)||Gn(A)?!1:k.parent==null&&A.parent==null}):E=this.findInternalEdges(d).filter($=>!($.id===e.id||$.source===e.source&&$.target===e.target||$.source===e.target&&$.target===e.source)),E.length===0&&(d===null||this.leafElements(d).length<=3)&&p.attributes.set(N.minlen,0),p}}function rm(t){const[e,n,r,i]=t?t.split(",").map(o=>zr(+o)):[0,0,0,0],s=Math.round(r-e),a=Math.round(n-i);return{x:Math.round(e),y:Math.round(i),width:s,height:a}}function c5(t){try{const[e,n]=t.split(",");return{x:zr(parseFloat(e)),y:zr(parseFloat(n))}}catch(e){throw new Error(`Failed on parsing pos: ${t}`,{cause:e})}}function b_(t){const{x:e,y:n}=c5(t.pos),r=W0(parseFloat(t.width)),i=W0(parseFloat(t.height));return{x:e-Math.round(r/2),y:n-Math.round(i/2),width:r,height:i}}function D_(t,[e,n]=[0,0]){if(!t||t.length===0)return null;let r=1/0,i=1/0,s=-1/0,a=-1/0,o=13;try{for(const c of t){if(c.op==="F"){o=zr(c.size);continue}if(c.op==="T"){let l=zr(c.pt[0])-e,d=zr(c.width);switch(c.align){case"r":l-=d;break;case"c":l-=Math.round(d/2);break}r=Math.min(r,l),s=Math.max(s,l+d);let f=zr(c.pt[1])-n;i=Math.min(i,Math.round(f-o)),a=Math.max(a,f)}}}catch(c){return zt.warn(`Failed on parsing label draw ops: ${c}
212
+ ${JSON.stringify(t,null,2)}`),null}if(r===1/0)return null;const u=2;return{x:r-u,y:i-u,width:s-r+2*u,height:a-i+2*u}}function E_({_draw_:t,likec4_id:e="???"},n="<unknown view>"){try{const r=t.filter(s=>s.op.toLowerCase()==="b");_e(Nr(r,1),`view ${n} edge ${e} should have at least one bezier draw op`),r.length>1&&zt.warn(`view ${n} edge ${e} has more than one bezier draw op, using the first one only`);const i=r[0].points.map(s=>zr(s));return _e(Nr(i,2),`view ${n} edge ${e} should have at least two points`),i}catch(r){throw new Error(`failed on parsing view ${n} edge ${e} _draw_:
213
+ ${JSON.stringify(t,null,2)}`,{cause:r})}}function l5(t,{id:e,source:n,target:r,dir:i,label:s,description:a,...o},u){const c=D_(t._ldraw_??t._tldraw_??t._hldraw_),l=t.dir==="back"||i==="back";return s=s&&c?V0(s,{maxchars:Zh,maxLines:K0}).join(`
214
+ `):null,{id:e,source:n,target:r,label:s,...ie(a)&&{description:a},...ie(t.pos)&&{dotpos:t.pos},points:E_(t,u),labelBBox:c,...l?{dir:"back"}:{},...o}}function R_(t,e){const n=JSON.parse(t),r=rm(n.bb),{nodes:i,edges:s,manualLayout:a,...o}=e,u={...o,bounds:r,nodes:[],edges:[]},c=n.objects??[];for(const d of i){const f=c.find(p=>p.likec4_id===d.id);_e(f,`View ${o.id} node ${d.id} not found in graphviz output`);try{const{x:p,y:h,width:y,height:b}="bb"in f?rm(f.bb):b_(f),w=[p,h];u.nodes.push({...d,position:w,width:y,height:b,labelBBox:D_(f._ldraw_,w)??{x:p,y:h,width:y,height:b}})}catch(p){throw new Error(`Failed on parsing node ${d.id}:
215
+ ${JSON.stringify(f,null,2)}`,{cause:p})}}const l=n.edges??[];for(const d of s){const f=l.find(p=>p.likec4_id===d.id);if(!f){zt.warn(`View ${o.id} edge ${d.id} not found in graphviz output, skipping`);continue}u.edges.push(l5(f,d,o.id))}return u}const im=t=>String(t+1).padStart(2,"0");function d5(t){const e=JSON.parse(t),n=rm(e.bb),r={nodes:[],edges:[],bounds:n},i=new Map,s=e.objects??[];for(const a of s){if(!a.likec4_type)continue;const o=im(a._gvid),u=a.likec4_path??"",c=i.get(a._gvid),{x:l,y:d,width:f,height:p}="bb"in a?rm(a.bb):b_(a),h={x:l,y:d};if(a.likec4_type==="view")_e(a.likec4_id,`View ${a} has no likec4_id`),r.nodes.push({id:o,type:"view",parentId:c?.id??null,height:p,width:f,position:h,label:a.label??"",viewId:a.likec4_id});else{const y={id:o,type:a.likec4_type,parentId:c?.id??null,height:p,width:f,position:h,path:u,label:a.label??""},b=[..."subgraphs"in a?a.subgraphs:[],..."nodes"in a?a.nodes:[]];for(const w of b)i.set(w,y);r.nodes.push(y)}}for(const a of e.edges??[])try{const o=im(a.tail),u=im(a.head);r.edges.push({id:`link${im(a._gvid)}`,source:o,target:u,points:E_(a)})}catch(o){zt.warn(o)}return r}const $_=jt.font,sm="/";class $D{static toDot(e){return new $D(e).print()}subgraphs=new Map;graphvizModel;constructor(e){const n=this.graphvizModel=PH.graph({[N.layout]:"osage",[N.pack]:tr(100),[N.packmode]:"array_ltc",[N.pad]:ft(15),[N.fontname]:$_,[N.splines]:"polyline",[N.esep]:"+20"});n.attributes.graph.apply({[N.fontsize]:tr(20),[N.labeljust]:"l",[N.labelloc]:"t"}),n.attributes.node.apply({[N.fontname]:$_,[N.shape]:"rect",[N.width]:ft(400),[N.height]:ft(300),[N.fixedsize]:!0,[N.fontsize]:10}),n.attributes.edge.apply({[N.penwidth]:tr(2)});const r=new Set(e.map(u=>u.relativePath??""));let i=0,s=[...e];const a=r.size>1;a&&s.sort((u,c)=>{const l=u.relativePath?.split(sm)??[""],d=c.relativePath?.split(sm)??[""];l.push(u.title??"Untitled"),d.push(c.title??"Untitled");const f=l.length,p=d.length;switch(i=Math.max(i,f,p),!0){case f>p:return-1;case f<p:return 1;default:{for(let h=0;h<f;h++){const y=l[h].localeCompare(d[h]);if(y!==0)return y}return 0}}});const o=new Map;s.forEach((u,c)=>{this.addView(a?u:{...u,relativePath:""},c+i);const l=u.nodes.reduce((d,f)=>(f.navigateTo&&d.add(f.navigateTo),d),new Set);l.size>0&&o.set(u.id,l)});for(const[u,c]of o)for(const l of c)n.edge([u,l])}getParentForPath(e){if(e==="")return this.graphvizModel;const n=e.toLowerCase();let r=this.subgraphs.get(n);if(!r){const i=n.endsWith(".c4")||n.endsWith(".likec4"),s=e.includes(sm)?e.slice(0,e.lastIndexOf(sm)):"";r=this.getParentForPath(s).subgraph("cluster"+String(this.subgraphs.size+1),{[N.likec4_type]:i?"file":"folder",[N.likec4_path]:e,[N.sortv]:this.subgraphs.size,[N.label]:ie(s)?e.slice(s.length+1):e}),this.subgraphs.set(n,r)}return r}addView(e,n=0){return this.getParentForPath(e.relativePath??"").node(e.id,{[N.likec4_type]:"view",[N.likec4_id]:e.id,[N.sortv]:n,[N.label]:e.title||"Untitled"})}print(){return G0(this.graphvizModel,{print:{indentStyle:"space",indentSize:2}})}}const S_=t=>{switch(!0){case Ao.isDynamic(t):return new RD(t);case Ao.isDeployment(t):return new o5(t);case Ao.isElement(t):return new u5(t);default:Ae(t)}};class T_{constructor(e){this.graphviz=e}get port(){return this.graphviz}changePort(e){this.graphviz=e}async layout(e){try{let n=await this.dot(e);const r=await this.graphviz.layoutJson(n);let i=R_(r,e);if(e.manualLayout){const s=W7(i,e.manualLayout);if(s.diagram)i=s.diagram;else{if(s.relayout.nodes.length>0){const a=S_(e);if(a.hasEdgesWithCompounds)zt.warn(`Manual layout for view ${e.id} is ignored, as edges with compounds are not supported`);else{a.applyManualLayout(s.relayout);const o=await this.graphviz.layoutJson(a.print());i=R_(o,e)}}i.hasLayoutDrift=!0}}return n=n.split(`
216
+ `).filter(s=>!(s.includes("margin")&&s.includes("50.1"))).join(`
217
+ `),{dot:n,diagram:i}}catch(n){throw new Error(`Error during layout: ${e.id}`,{cause:n})}}async svg(e){let n=await this.dot(e);return n=n.split(`
218
+ `).filter(r=>!(r.includes("margin")&&r.includes("50.1"))).join(`
219
+ `),{svg:await this.graphviz.svg(n),dot:n}}async dot(e){let n=S_(e).print();if(!Ao.isElement(e))return n;try{return await this.graphviz.unflatten(n)}catch(r){return zt.warn(`Error during unflatten: ${e.id}`,r),n}}async layoutOverviewGraph(e){if(e.length===0)return Promise.resolve({nodes:[],edges:[],bounds:{x:0,y:0,width:10,height:10}});const n=$D.toDot(e),r=await this.graphviz.layoutJson(n);return d5(r)}}class f5{value;next;constructor(e){this.value=e}}class p5{#e;#t;#n;constructor(){this.clear()}enqueue(e){const n=new f5(e);this.#e?(this.#t.next=n,this.#t=n):(this.#e=n,this.#t=n),this.#n++}dequeue(){const e=this.#e;if(e)return this.#e=this.#e.next,this.#n--,e.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#n=0}get size(){return this.#n}*[Symbol.iterator](){let e=this.#e;for(;e;)yield e.value,e=e.next}}function jv(t){k_(t);const e=new p5;let n=0;const r=()=>{n<t&&e.size>0&&(e.dequeue()(),n++)},i=()=>{n--,r()},s=async(u,c,l)=>{const d=(async()=>u(...l))();c(d);try{await d}catch{}i()},a=(u,c,l)=>{new Promise(d=>{e.enqueue(d)}).then(s.bind(void 0,u,c,l)),(async()=>(await Promise.resolve(),n<t&&r()))()},o=(u,...c)=>new Promise(l=>{a(u,l,c)});return Object.defineProperties(o,{activeCount:{get:()=>n},pendingCount:{get:()=>e.size},clearQueue:{value(){e.clear()}},concurrency:{get:()=>t,set(u){k_(u),t=u,queueMicrotask(()=>{for(;n<t&&e.size>0;)r()})}}}),o}function k_(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}const h5=jv(1);class ko{static _graphviz=null;graphviz(){return Promise.resolve().then(()=>ko._graphviz??=Vm.load())}async attempt(e,n,r){return await h5(async()=>{const i=zt.withTag("graphviz-wasm");try{return await r()}catch(s){i.error(`FAILED GraphvizWasm.${e}`,s),i.warn(`FAILED DOT:
220
+ ${n}`),Vm.unload(),ko._graphviz=null}i.warn("Retrying..."),await X1(50,300);try{return await r()}finally{Vm.unload(),ko._graphviz=null}})}async unflatten(e){return await this.attempt("unflatten",e,async()=>(await this.graphviz()).unflatten(e,1,!1,3).replaceAll(/\t\[/g," [").replaceAll(/\t/g," "))}async acyclic(e){return await this.attempt("acyclic",e,async()=>{const n=(await this.graphviz()).acyclic(e,!0);return n.acyclic&&n.outFile||e})}async layoutJson(e){return await this.attempt("layout",e,async()=>(await this.graphviz()).layout(e,"json",void 0,{yInvert:!0}))}async svg(e){return await this.attempt("svg",e,async()=>(await this.graphviz()).layout(e,"svg"))}}function Rn(t){return t.el.ref}function am(t){const e=[t.el.$refText];let n=t.parent;for(;n;)e.push(n.el.$refText),n=n.parent;return e.length===1?e[0]:e.reverse().join(".")}const Rd=Symbol.for("idattr"),om={writeId(t,e){return t[Rd]=e,t},readId(t){return t[Rd]}},$d={writeId(t,e){return Dt(e)?t[Rd]=void 0:t[Rd]=e,t},readId(t){return t[Rd]}};function Sd(t){return t.textDocument.languageId===lv.languageId}function Uv(t){return Sd(t)&&t.state>=We.IndexedContent&&!!t.c4fqnIndex}function bo(t){return Sd(t)&&t.state==We.Validated&&!!t.c4Specification&&!!t.c4Elements&&!!t.c4ExtendElements&&!!t.c4Relations&&!!t.c4Views&&!!t.c4fqnIndex&&!!t.c4Deployments&&!!t.c4DeploymentRelations}function*m5(t){const e=jm.from(t.parseResult.value.models.flatMap(i=>i.elements)),n=[];let r;for(;r=e.shift();){if(Lr(r)){n.push(r);continue}if(r.body&&r.body.elements&&r.body.elements.length>0)for(const i of r.body.elements)e.push(i);yield r}yield*n}function*g5(t){const e=jm.from(t.parseResult.value.deployments.flatMap(i=>i.elements)),n=[];let r;for(;r=e.shift();){if(qi(r)){n.push(r);continue}if(Dn(r)&&r.body&&r.body.elements.length>0)for(const i of r.body.elements)e.push(i);yield r}yield*n}function y5(t){const e=Rn(t.target);if(!e)throw new Error("RelationRefError: Invalid reference to target");if(Qt(t.source)){const n=Rn(t.source);if(!n)throw new Error("RelationRefError: Invalid reference to source");return{source:n,target:e}}if(!Zc(t.$container))throw new Error("RelationRefError: Invalid container for sourceless relation");return{source:t.$container.$container,target:e}}function C_({value:t}){const e=parseFloat(t);return isNaN(e)?100:VT(e,{min:0,max:100})}function Do({value:t}){switch(t){case"xs":case"sm":case"md":case"lg":case"xl":return t;case"xsmall":return"xs";case"small":return"sm";case"medium":return"md";case"large":return"lg";case"xlarge":return"xl";default:Ae(t)}}function Ji(t,e){const n={};if(!t||t.length===0)return n;for(const r of t)if(e(r))switch(!0){case Qp(r):{ie(r.value)&&(n.border=r.value);break}case Js(r):{const i=Td(r);ie(i)&&(n.color=i);break}case Nh(r):{ie(r.value)&&(n.shape=r.value);break}case Fr(r):{const i=r.libicon?.ref?.name??r.value;ie(i)&&(n.icon=i);break}case Ah(r):{n.opacity=C_(r);break}case Xw(r):{n.multiple=nw(r.value)?r.value:!1;break}case nv(r):{ie(r.value)&&(n.size=Do(r));break}case Zw(r):{ie(r.value)&&(n.padding=Do(r));break}case av(r):{ie(r.value)&&(n.textSize=Do(r));break}default:Ae(r)}return n}function w5(t,e){const n={};if(!t||t.length===0)return n;for(const r of t)if(e(r))switch(!0){case Js(r):{const i=Td(r);ie(i)&&(n.color=i);break}case Sl(r):{n.line=r.value;break}case jc(r):{switch(r.key){case"head":{n.head=r.value;break}case"tail":{n.tail=r.value;break}default:Ae(r)}break}default:Ae(r)}return n}function Wv(t,e){const{color:n,line:r,head:i,tail:s}=w5(t?.filter(nA),e);return{...n&&n!==Co?{color:n}:{},...r&&r!==J1?{line:r}:{},...i&&i!==ls?{head:i}:{},...s?{tail:s}:{}}}function Td(t){return t?.themeColor??t?.customColor?.$refText}function Hv(t){const e=t.rankSep,n=t.nodeSep;let r;switch(t.direction){case"TopBottom":{r="TB";break}case"BottomTop":{r="BT";break}case"LeftRight":{r="LR";break}case"RightLeft":{r="RL";break}default:Ae(t.direction)}return{direction:r,...n&&{nodeSep:n},...e&&{rankSep:e}}}function v5(t){switch(t){case"TB":return"TopBottom";case"BT":return"BottomTop";case"LR":return"LeftRight";case"RL":return"RightLeft";default:Ae(t)}}function A_(t){if(kw(t))return t;if(Uw(t))return t.subject;if(hh(t))return A_(t.subject);Ae(t)}class b5{parser;locator;constructor(e){this.parser=e.likec4.ModelParser,this.locator=e.likec4.ModelLocator}getDocumentation(e){try{if(Dn(e)){const n=wt(e),r=this.parser.forDocument(n).parseDeploymentNode(e),i=[r.id];return r.title!==e.name&&i.push(" ",`**${r.title}**`),i.join(`
221
+ `)}if(hr(e)){const n=wt(e),r=this.parser.forDocument(n).parseDeployedInstance(e),i=this.locator.getParsedElement(r.element),s=[r.id,`_instance of_ ${r.element}`];return i&&s.push(" ",`**${i.title}**`),s.join(`
222
+ `)}if(qn(e)){const n=wt(e),r=this.parser.forDocument(n).parseElement(e);return r?[r.id," ",`**${r.title}**`].join(`
223
+ `):void 0}}catch(n){ve(n)}}}function D5(t,e){return[t,e]=Vv(t,e)>0?[e,t]:[t,e],E5(t.range,e.range.start)}function Vv(t,e){const n=t.range.start.line-e.range.start.line;return n!==0?n:t.range.start.character-e.range.start.character}function E5(t,e){return!(e.line<t.start.line||e.line>t.end.line||e.line==t.start.line&&e.character<t.start.character||e.line==t.end.line&&e.character>t.end.character)}function um(t){return t.range.start.line!=t.range.end.line}const Z={newLine:Li.newLine({allowMore:!0}),oneSpace:Li.oneSpace(),noSpace:Li.noSpace(),indent:Li.indent({allowMore:!0}),noIndent:Li.noIndent()};class R5 extends xU{format(e){this.removeIndentFromTopLevelStatements(e),this.indentContentInBraces(e),this.formatSpecificationRule(e),this.formatGlobals(e),this.formatElementDeclaration(e),this.formatRelation(e),this.formatMetadataProperty(e),this.formatDeploymentNodeDeclaration(e),this.formatDeployedInstance(e),this.formatDeploymentRelation(e),this.formatView(e),this.formatViewRuleGroup(e),this.formatViewRuleGlobalStyle(e),this.formatViewRuleGlobalPredicate(e),this.formatIncludeExcludeExpressions(e),this.formatDeploymentViewRulePredicateExpressions(e),this.formatWhereExpression(e),this.formatWhereExpressionV2(e),this.formatWhereRelationExpression(e),this.formatWhereElementExpression(e),this.formatRelationExpression(e),this.formatAutolayoutProperty(e),this.formatWithPredicate(e),this.formatViewRuleStyle(e),this.formatLeafProperty(e),this.formatLinkProperty(e),this.formatNavigateToProperty(e),this.formatTags(e)}formatTags(e){this.on(e,sv,(n,r)=>{r.cst(Ca(n.$cstNode,"values").slice(1)).prepend(Z.oneSpace),r.keywords(",").prepend(Z.noSpace).append(Z.oneSpace)})}formatDeploymentRelation(e){this.on(e,qi,(n,r)=>{const i=n?.source?.$cstNode?[n?.source?.$cstNode]:[];r.cst(i).append(Z.oneSpace),r.keywords("]->").prepend(Z.noSpace),r.keywords("-[").append(Z.noSpace),r.nodes(...je([n.target,n.tags],ie)).prepend(Z.oneSpace),r.properties("title","technology").prepend(Z.oneSpace)})}formatRelation(e){this.on(e,Lr,(n,r)=>{const i=n?.source?.$cstNode?[n?.source?.$cstNode]:[];r.cst(i).append(Z.oneSpace),r.keywords("]->").prepend(Z.noSpace),r.keywords("-[").append(Z.noSpace),r.nodes(...je([n.target,n.tags],ie)).prepend(Z.oneSpace),r.properties("title","technology").prepend(Z.oneSpace)}),this.on(e,Gw,(n,r)=>{r.keywords("->","<-").surround(Z.oneSpace);const i=r.property("kind");i.nodes[0]?.text.startsWith(".")&&i.surround(Z.oneSpace),r.keywords("]->").prepend(Z.noSpace).append(Z.oneSpace),r.keywords("-[").prepend(Z.oneSpace).append(Z.noSpace),r.properties("title").prepend(Z.oneSpace)}),this.on(e,zw)?.property("target").prepend(Z.oneSpace),this.on(e,Qw,(n,r)=>{r.property("from").append(Z.oneSpace),r.keywords("]->").prepend(Z.noSpace),r.keywords("-[").append(Z.noSpace)}),this.on(e,mA)?.keywords("->").append(Z.oneSpace),this.on(e,Yw)?.keyword("->").prepend(Z.oneSpace)}removeIndentFromTopLevelStatements(e){(wA(e)||iv(e)||Al(e)||yA(e)||Vw(e)||vA(e))&&this.getNodeFormatter(e).keywords("specification","model","views","likec4lib","global","deployments").prepend(Z.noIndent)}indentContentInBraces(e){if(yA(e)||iv(e)||co(e)||fo(e)||oo(e)||Vw(e)||to(e)||ea(e)||gl(e)||ml(e)||ea(e)||wA(e)||Zc(e)||pA(e)||M4(e)||Ih(e)||L4(e)||Al(e)||dA(e)||C4(e)||T4(e)||nd(e)||Bh(e)||D4(e)||E4(e)||Gi(e)||Bw(e)||vA(e)||$4(e)||S4(e)||R4(e)){const n=this.getNodeFormatter(e),r=n.keywords("{"),i=n.keywords("}"),s=n.interior(r,i);let a=null;for(const o of s.nodes)(!a||!D5(a,o))&&n.cst([o]).prepend(Z.indent),a=o;r.prepend(Z.noIndent).prepend(Z.oneSpace),i.prepend(Z.noIndent).prepend(Li.newLine({allowMore:!0}))}}appendKeywordsWithSpace(e){this.on(e,P4)?.keywords("element").append(Z.oneSpace)}formatView(e){this.on(e,gh,(n,r)=>{(n.extends||n.viewOf||n.name)&&r.keywords("view").append(Z.oneSpace),r.keywords("of","extends").surround(Z.oneSpace)}),this.on(e,uA)?.keywords("dynamic","view").append(Z.oneSpace),this.on(e,Lw)?.keywords("deployment","view").append(Z.oneSpace)}formatLeafProperty(e){if(ul(e)||jl(e)||q4(e)||so(e)||rv(e)||EA(e)||Js(e)||Sl(e)||jc(e)||Fr(e)||Nh(e)||Qp(e)||Ah(e)||Xw(e)||nv(e)||Zw(e)||av(e)){const n=this.getNodeFormatter(e),r=n.keyword(":"),i=n.keywords("title","description","technology","notation","color","line","head","tail","icon","shape","border","opacity","multiple","size","padding","textSize");r.nodes.length===0?i.append(Z.oneSpace):r.prepend(Z.noSpace).append(Z.oneSpace),n.keyword(";").prepend(Z.noSpace).append(Z.newLine)}}formatLinkProperty(e){this.on(e,Th,(n,r)=>{r.keyword("link").append(Z.oneSpace),r.property("value").append(Z.oneSpace),r.keyword(":").prepend(Z.noSpace).append(Z.oneSpace),r.keyword(";").prepend(Z.noSpace).append(Z.newLine)})}formatNavigateToProperty(e){this.on(e,Ch)?.property("key").append(Z.oneSpace)}formatAutolayoutProperty(e){this.on(e,Jl,(n,r)=>{r.keyword("autoLayout").append(Z.oneSpace),r.property("rankSep").prepend(Z.oneSpace),r.property("nodeSep").prepend(Z.oneSpace)})}formatMetadataProperty(e){this.on(e,F4,(n,r)=>{r.property("key").append(Z.oneSpace),r.keyword(":").prepend(Z.noSpace).append(Z.oneSpace),r.keyword(";").prepend(Z.noSpace).append(Z.newLine)})}formatElementDeclaration(e){this.on(e,qn,(n,r)=>{const i=sn(n.$cstNode,"kind"),s=sn(n.$cstNode,"name");s&&i&&(Vv(s,i)>0?r.cst([i]).append(Z.oneSpace):(r.cst([s]).append(Z.oneSpace),r.cst([i]).prepend(Z.oneSpace))),r.properties("props").prepend(Z.oneSpace)})}formatGlobals(e){this.on(e,to,(n,r)=>{r.keyword("style").append(Z.oneSpace),r.property("id").append(Z.oneSpace)}),this.on(e,ea,(n,r)=>{r.keyword("styleGroup").append(Z.oneSpace)}),this.on(e,gl,(n,r)=>{r.keyword("predicateGroup").append(Z.oneSpace)}),this.on(e,ml,(n,r)=>{r.keyword("dynamicPredicateGroup").append(Z.oneSpace)})}formatSpecificationRule(e){if((co(e)||fo(e)||Lh(e)||oo(e))&&this.getNodeFormatter(e).keywords("element","relationship","tag","deploymentNode").append(Z.oneSpace),Fh(e)){const n=this.getNodeFormatter(e);n.keyword("color").append(Z.oneSpace),n.property("name").append(Z.oneSpace)}}formatWithPredicate(e){const n=this.getNodeFormatter(e);(hh(e)||tv(e))&&n.keyword("with").prepend(Z.oneSpace)}formatDeploymentNodeDeclaration(e){this.on(e,Dn,(n,r)=>{const i=sn(n.$cstNode,"kind"),s=sn(n.$cstNode,"name");s&&i&&(Vv(s,i)>0?r.cst([i]).append(Z.oneSpace):(r.cst([s]).append(Z.oneSpace),r.cst([i]).prepend(Z.oneSpace))),r.properties("title").prepend(Z.oneSpace)})}formatDeployedInstance(e){this.on(e,hr,(n,r)=>{const i=n.$cstNode?.content.find(s=>s.text==="=");i&&r.cst([i]).surround(Z.oneSpace),r.keyword("instanceOf").append(Z.oneSpace),r.property("title").prepend(Z.oneSpace)})}formatViewRuleGlobalStyle(e){this.on(e,cv,(n,r)=>{r.keywords("global","style").append(Z.oneSpace)})}formatViewRuleGlobalPredicate(e){const n=this.getNodeFormatter(e);(uv(e)||cA(e))&&n.keywords("global","predicate").append(Z.oneSpace)}formatViewRuleGroup(e){this.on(e,Bh,(n,r)=>{r.keyword("group").append(Z.oneSpace)})}formatViewRuleStyle(e){this.on(e,nd)?.keyword("style").append(Z.oneSpace),this.on(e,oA)?.keyword("style").append(Z.oneSpace),this.on(e,_4)?.keyword(",").prepend(Z.noSpace).append(Z.oneSpace),this.on(e,I4)?.keyword(",").prepend(Z.noSpace).append(Z.oneSpace)}formatWhereExpression(e){(f4(e)||s4(e))&&this.getNodeFormatter(e).keyword("where").append(Z.oneSpace)}formatWhereExpressionV2(e){(p4(e)||a4(e))&&this.getNodeFormatter(e).keyword("where").append(Z.oneSpace)}formatWhereRelationExpression(e){if(this.on(e,v4,(n,r)=>{r.property("operator").surround(Z.oneSpace)}),this.on(e,kA,(n,r)=>{r.keyword("not").append(Z.oneSpace)}),aA(e)||W4(e)||TA(e)){const n=this.getNodeFormatter(e);n.property("operator").surround(Z.oneSpace),n.property("not").surround(Z.oneSpace)}}formatWhereElementExpression(e){if(this.on(e,y4,(n,r)=>{r.property("operator").surround(Z.oneSpace)}),this.on(e,SA,(n,r)=>{r.keyword("not").append(Z.oneSpace)}),iA(e)||U4(e)||j4(e)){const n=this.getNodeFormatter(e);n.property("operator").surround(Z.oneSpace),n.property("not").surround(Z.oneSpace)}}formatIncludeExcludeExpressions(e){if(Op(e)||Rh(e)||fl(e)||Ka(e)){const n=this.getNodeFormatter(e);(!e.$cstNode||!um(e.$cstNode))&&n.keywords("include","exclude").append(Z.oneSpace)}if(lA(e)||DA(e)||DA(e)){const n=this.getNodeFormatter(e),r=this.findPredicateExpressionRoot(e),i=r?.$cstNode&&um(r?.$cstNode);i&&n.property("value").prepend(Z.indent),n.keyword(",").prepend(Z.noSpace).append(i?Z.newLine:Z.oneSpace)}}formatRelationExpression(e){this.on(e,Kw,(n,r)=>{r.keyword("->").append(Z.oneSpace)}),this.on(e,gA,(n,r)=>{r.keyword("->").prepend(Z.oneSpace)}),this.on(e,Jw,(n,r)=>{r.keywords("->","<->").prepend(Z.oneSpace),r.keywords("-[").prepend(Z.oneSpace).append(Z.noSpace),r.keywords("]->").prepend(Z.noSpace).append(Z.oneSpace);const i=r.property("kind");i.nodes[0]?.text.startsWith(".")&&i.surround(Z.oneSpace)}),this.on(e,Mw,(n,r)=>{r.property("target").prepend(Z.oneSpace)})}formatDeploymentViewRulePredicateExpressions(e){if(Op(e)||Rh(e)||fl(e)||Ka(e)){const n=this.getNodeFormatter(e);(!e.$cstNode||!um(e.$cstNode))&&n.keywords("include","exclude").append(Z.oneSpace)}if(k4(e)){const n=this.getNodeFormatter(e),r=this.findPredicateExpressionRoot(e),i=r?.$cstNode&&um(r?.$cstNode);i&&n.property("value").prepend(Z.indent),n.keyword(",").prepend(Z.noSpace).append(i?Z.newLine:Z.oneSpace)}}findPredicateExpressionRoot(e){let n=e.$container;for(;;){if(!n||Op(n)||Rh(n)||fl(n)||Ka(n))return n;n=n.$container}}on(e,n,r){const i=n(e)?this.getNodeFormatter(e):void 0;return r&&i&&r(e,i),i}}class $5{constructor(e){this.services=e}async provideCodeLens(e,n,r){return e.state!==We.Validated&&(Me.debug(`Waiting for document ${e.uri.path} to be validated`),await this.services.shared.workspace.DocumentBuilder.waitUntil(We.Validated,e.uri,r),Me.debug(`Document ${e.uri.path} is validated`)),bo(e)?e.parseResult.value.views.flatMap(i=>i.views).flatMap(i=>{const s=om.readId(i),a=i.$cstNode?.range;return!a||!s?[]:{range:{start:a.start,end:{line:a.start.line,character:a.start.character+4}},command:{command:"likec4.open-preview",arguments:[s],title:"open preview"}}}):void 0}}const Kv=["color","shape","icon","border","opacity","multiple","size"].join(",");class S5 extends vC{completionOptions={triggerCharacters:["."]};completionForKeyword(e,n,r){if(this.filterKeyword(e,n)){if(n.value==="deployment"&&Ci(e.node,Al))return r(e,{label:n.value,detail:"Insert deployment view",kind:xt.Class,insertTextFormat:Jn.Snippet,insertText:["deployment view ${1:view_${TM_FILENAME_BASE}_${CURRENT_SECOND}} {"," title '${2:Untitled}'"," "," include $0","}"].join(`
224
+ `)});if(["title","description","technology"].includes(n.value))return r(e,{label:n.value,kind:xt.Property,insertTextFormat:Jn.Snippet,insertText:`${n.value} '\${0}'`});if(["views","specification","model","deployment","with"].includes(n.value))return r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:xt.Module,insertTextFormat:Jn.Snippet,insertText:`${n.value} {
225
+ $0
226
+ }`});if(n.value==="group")return r(e,{label:n.value,detail:"Insert group block",kind:xt.Class,insertTextFormat:Jn.Snippet,insertText:["group '${1:Title}' {"," $0","}"].join(`
227
+ `)});if(n.value==="dynamic"&&Ci(e.node,Al))return r(e,{label:n.value,detail:"Insert dynamic view",kind:xt.Class,insertTextFormat:Jn.Snippet,insertText:["dynamic view ${1:view_${TM_FILENAME_BASE}_${CURRENT_SECOND}} {"," title '${2:Untitled}'"," "," $0","}"].join(`
228
+ `)});if(n.value==="style"&&e.node)return Ci(e.node,to)?r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:xt.Module,insertTextFormat:Jn.Snippet,insertText:`${n.value} \${1:name} \${2:*} {
229
+ \${3|${Kv}|} $0
230
+ }`}):Ci(e.node,e8([Al,ea]))?r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:xt.Module,insertTextFormat:Jn.Snippet,insertText:`${n.value} \${1:*} {
231
+ \${2|${Kv}|} $0
232
+ }`}):r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:xt.Module,insertTextFormat:Jn.Snippet,insertText:`${n.value} {
233
+ \${1|${Kv}|} $0
234
+ }`});if(n.value==="extend")return r(e,{label:n.value,detail:"Extend another view",kind:xt.Class,insertTextFormat:Jn.Snippet,insertText:`extend \${1:element} {
235
+ $0
236
+ }`});if(n.value==="autoLayout")return r(e,{label:n.value,kind:xt.Class,insertTextFormat:Jn.Snippet,insertText:"autoLayout ${1|TopBottom,BottomTop,LeftRight,RightLeft|}$0"});r(e,{label:n.value,kind:this.getKeywordCompletionItemKind(n),detail:"Keyword",sortText:"1"})}}}class T5 extends bC{createDocumentHighlight(e){return we.DocumentHighlight.create(e.segment.range,we.DocumentHighlightKind.Read)}}const k5=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,C5=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,A5=/^([/\\]\s*){2,}[^/\\]/;function __(t){return["./","../"].some(e=>t.startsWith(e))}function Yv(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?k5.test(t):C5.test(t)||(e.acceptRelative?A5.test(t):!1)}function _5(t="",e){return t.endsWith("/")}function P5(t="",e){return(_5(t)?t.slice(0,-1):t)||"/"}function x5(t="",e){return t.endsWith("/")?t:t+"/"}function cm(t=""){return t.startsWith("/")}function P_(t=""){return(cm(t)?t.slice(1):t)||"/"}function I5(t=""){return cm(t)?t:"/"+t}function N5(t,e){if(O5(e))return t;const n=P5(e);if(!t.startsWith(n))return t;const r=t.slice(n.length);return r[0]==="/"?r:"/"+r}function O5(t){return!t||t==="/"}function lm(t=""){const[e="",n="",r=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:n,hash:r}}class F5{constructor(e){this.services=e}getDocumentLinks(e,n){return bo(e)?Cr(e.parseResult.value).filter(Th).map(r=>{try{const i=sn(r.$cstNode,"value")?.range,s=this.resolveLink(e,r.value);if(i&&Yv(s))return{range:i,target:s}}catch(i){ve(i)}return null}).nonNullable().toArray():[]}resolveLink(e,n){if(Yv(n)||cm(n))return n;const r=__(n)?new URL(e.uri.toString(!0)):this.services.shared.workspace.WorkspaceManager.workspaceURL;return new URL(n,r).toString()}relativeLink(e,n){if(cm(n))return P_(n);if(__(n)){const r=new URL(e.uri.toString(!0)),i=new URL(n,r).toString();return P_(N5(i,this.services.shared.workspace.WorkspaceManager.workspaceURL.toString()))}return null}}class L5{constructor(e){this.services=e,this.nodeKindProvider=e.shared.lsp.NodeKindProvider,this.parser=e.likec4.ModelParser,this.locator=e.likec4.ModelLocator,this.nameProvider=e.references.NameProvider}nodeKindProvider;nameProvider;parser;locator;getSymbols({parseResult:{value:{specifications:e,models:n,deployments:r,views:i,likec4lib:s}}}){return[...s.map(a=>()=>this.getLikec4LibSymbol(a)),...e.map(a=>()=>this.getSpecSymbol(a)),...n.map(a=>()=>this.getModelSymbol(a)),...r.map(a=>()=>this.getDeploymentModelSymbol(a)),...i.map(a=>()=>this.getModelViewsSymbol(a))].flatMap(a=>{try{return a()??[]}catch(o){return ve(o),[]}})}getLikec4LibSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=e.icons.map(i=>this.getLibIconSymbol(i)).filter(ie);return r.length===0?[]:[{kind:dr.Namespace,name:"icons",range:n.range,selectionRange:gu(n,"icons")?.range??n.range,children:r}]}getSpecSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=sn(n,"name");if(!r)return[];const i=Qe([...e.elements,...e.tags,...e.relationships],an(s=>{try{if(co(s)||fo(s)||oo(s))return this.getKindSymbol(s);if(Lh(s))return this.getTagSymbol(s)}catch(a){return ve(a),null}Ae(s)}),je(ie));return i.length===0?[]:[{kind:dr.Namespace,name:e.name,range:n.range,selectionRange:r.range,children:i}]}getModelSymbol(e){const n=e.$cstNode;if(!n)return[];const r=sn(n,"name");return r?[{kind:this.symbolKind(e),name:e.name,range:n.range,selectionRange:r.range,children:e.elements.flatMap(i=>this.getElementsSymbol(i))}]:[]}getDeploymentModelSymbol(e){const n=e.$cstNode;if(!n)return[];const r=sn(n,"name");return r?[{kind:this.symbolKind(e),name:e.name,range:n.range,selectionRange:r.range,children:e.elements.flatMap(i=>this.getDeploymentElementSymbol(i))}]:[]}getElementsSymbol(e){try{if(Ja(e))return this.getExtendElementSymbol(e);if(qn(e))return this.getElementSymbol(e)}catch(n){ve(n)}return[]}getExtendElementSymbol(e){const n=e.$cstNode,r=e.element.$cstNode,i=e.body;return!n||!r?[]:[{kind:this.symbolKind(e),name:am(e.element),range:n.range,selectionRange:r.range,children:i.elements.flatMap(s=>this.getElementsSymbol(s))}]}getElementSymbol(e){const n=e.$cstNode,r=sn(n,"name");if(!r||!n)return[];const i=e.name,s=e.kind.$refText;return[{kind:this.symbolKind(e),name:i,range:n.range,selectionRange:r.range,detail:s,children:e.body?.elements.flatMap(a=>this.getElementsSymbol(a))??[]}]}getModelViewsSymbol(e){const n=e.$cstNode,r=sn(n,"name");return!r||!n?[]:[{kind:this.symbolKind(e),name:e.name,range:n.range,selectionRange:r.range,children:e.views.flatMap(i=>this.getViewSymbol(i))}]}getKindSymbol(e){return!e.$cstNode||!e.kind.$cstNode||Qn(e.kind.name)?null:{kind:this.symbolKind(e),name:e.kind.name,range:e.$cstNode.range,selectionRange:e.kind.$cstNode.range}}getTagSymbol(e){return!e.$cstNode||!e.tag.$cstNode||Qn(e.tag.name)?null:{kind:this.symbolKind(e),name:"#"+e.tag.name,range:e.$cstNode.range,selectionRange:e.tag.$cstNode.range}}getLibIconSymbol(e){return!e.$cstNode||Qn(e.name)?null:{kind:this.symbolKind(e),name:e.name,range:e.$cstNode.range,selectionRange:e.$cstNode.range}}getViewSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=e.name?sn(n,"name"):null;return r?[{kind:this.symbolKind(e),name:r.text,range:n.range,selectionRange:r.range,children:[]}]:[]}getDeploymentElementSymbol(e){try{if(Dn(e))return this.getDeploymentNodeSymbol(e);if(hr(e))return this.getDeployedInstanceSymbol(e)}catch(n){ve(n)}return[]}getDeploymentNodeSymbol(e){const n=e.$cstNode,r=this.nameProvider.getNameNode(e);if(!r||!n)return[];const i=this.nameProvider.getNameStrict(e),s=e.kind.$refText;return[{kind:this.symbolKind(e),name:i,range:n.range,selectionRange:r.range,detail:s,children:e.body?.elements.flatMap(a=>this.getDeploymentElementSymbol(a))??[]}]}getDeployedInstanceSymbol(e){const n=e.$cstNode,r=this.nameProvider.getNameNode(e);if(!r||!n)return[];const i=wt(e),s=this.parser.forDocument(i).parseDeployedInstance(e),a=this.nameProvider.getNameStrict(e),o="instance of "+s.element;return[{kind:this.symbolKind(e),name:a,range:n.range,selectionRange:r.range,detail:o,children:[]}]}symbolKind(e){return this.nodeKindProvider.getSymbolKind(e)}}var Xv,x_;function M5(){return x_||(x_=1,Xv=t=>{const e=t.match(/^[ \t]*(?=\S)/gm);return e?e.reduce((n,r)=>Math.min(n,r.length),1/0):0}),Xv}var z5=M5();const B5=Ss(z5);function Jv(t){const e=B5(t);if(e===0)return t;const n=new RegExp(`^[ \\t]{${e}}`,"gm");return t.replace(n,"")}class q5 extends $C{parser;locator;constructor(e){super(e),this.parser=e.likec4.ModelParser,this.locator=e.likec4.ModelLocator}getAstNodeHoverContent(e){if($A(e))return{contents:{kind:"markdown",value:Jv(`
237
+ tag: \`${e.name}\`
238
+ `)}};if(Dn(e)){const n=wt(e),r=this.parser.forDocument(n).parseDeploymentNode(e),i=[r.id+" "];return r.title!==e.name&&i.push(`### ${r.title}`),i.push("Deployment: `"+r.kind+"` "),{contents:{kind:"markdown",value:i.join(`
239
+ `)}}}if(hr(e)){const n=wt(e),r=this.parser.forDocument(n).parseDeployedInstance(e),i=this.locator.getParsedElement(r.element),s=[r.id+" ",`instance of \`${r.element}\``];return i&&s.push(`### ${i.title}`,"Element: `"+i.kind+"` "),{contents:{kind:"markdown",value:s.join(`
240
+ `)}}}if(qn(e)){const n=this.locator.getParsedElement(e);return n?{contents:{kind:"markdown",value:[n.id,`### ${n.title}`,"Element: `"+n.kind+"` "].join(`
241
+ `)}}:void 0}}}class G5 extends DU{highlightElement(e,n){if(qn(e)||Dn(e))return this.highlightNameAndKind(e,n);if(hr(e)){"name"in e&&n({node:e,property:"name",type:Ne.variable,modifier:[qe.definition,qe.readonly]});return}if(Pw(e))return this.highlightView(e,n);if(B4(e))return n({node:e,property:"name",type:Ne.function});if(N4(e))return n({node:e,property:"name",type:Ne.type,modifier:[qe.definition]}),"prune";if(Qw(e)&&"kind"in e){n({node:e,property:"kind",type:Ne.function});return}if(Lr(e)&&"kind"in e&&n({node:e,property:"kind",type:Ne.function}),Ch(e)||Ml(e))return n({node:e,property:"key",type:Ne.property}),n({node:e,property:"value",type:Ne.variable,modifier:[qe.definition,qe.readonly]}),"prune";if((jw(e)||na(e))&&e.$cstNode)return n({cst:e.$cstNode,type:Ne.variable,modifier:[qe.definition,qe.readonly]}),"prune";if(Hw(e)){e.selector&&n({node:e,property:"selector",type:Ne.variable,modifier:[qe.definition,qe.readonly]});return}if(TA(e)&&ie(e.value)){n({node:e,property:"value",type:Ne.function});return}if((iA(e)||aA(e))&&ie(e.value)){n({node:e,property:"value",type:Ne.type,modifier:[qe.definition,qe.readonly]});return}if((CA(e)||AA(e))&&n({node:e,property:"participant",type:Ne.keyword}),ph(e)&&ie(e.kind))return n({node:e,property:"kind",type:Ne.type,modifier:[qe.definition]}),"prune";if(ea(e)||to(e)){n({node:e,property:"id",type:Ne.variable,modifier:[qe.definition,qe.readonly]});return}if(cv(e)){n({node:e,property:"style",type:Ne.variable,modifier:[qe.definition,qe.readonly]});return}if(gl(e)||ml(e)){n({node:e,property:"name",type:Ne.variable,modifier:[qe.definition,qe.readonly]});return}if(uv(e)){n({node:e,property:"predicate",type:Ne.variable,modifier:[qe.definition,qe.readonly]});return}if(mh(e)&&ie(e.tag))return n({node:e,property:"tag",type:Ne.type,modifier:[qe.definition]}),"prune";if(hA(e))return n({node:e,property:"value",type:e.parent?Ne.property:Ne.variable,modifier:[qe.definition,qe.readonly]}),e.parent?void 0:"prune";if(al(e)||RA(e))return n({node:e,property:"el",type:e.parent?Ne.property:Ne.variable,modifier:[qe.definition,qe.readonly]}),e.parent?void 0:"prune";if(Fh(e)){n({node:e,keyword:"color",type:Ne.keyword}),n({node:e,property:"name",type:Ne.type,modifier:[qe.declaration,qe.readonly]});return}if((co(e)||fo(e)||oo(e))&&n({node:e,property:"kind",type:Ne.type,modifier:[qe.declaration,qe.readonly]}),sv(e))return n({node:e,property:"values",type:Ne.interface});if($A(e))return n({node:e,property:"name",type:Ne.type,modifier:[qe.definition]});if((Ih(e)||Gi(e)&&Zc(e.$container))&&n({node:e,property:"key",type:Ne.property}),Ah(e))return n({node:e,property:"key",type:Ne.property}),n({node:e,property:"value",type:Ne.number}),"prune";if(Th(e)||Fr(e)||rA(e))return n({node:e,property:"key",type:Ne.property}),Fr(e)&&(e.libicon||e.value==="none")?(n({node:e,property:e.libicon?"libicon":"value",type:Ne.enum,modifier:[qe.defaultLibrary]}),"prune"):("value"in e&&e.value&&n({node:e,property:"value",type:Ne.string}),"prune");if(Js(e)||Nh(e)||jc(e)||Sl(e)||Qp(e)||h4(e))return n({node:e,property:"key",type:Ne.property}),"value"in e&&n({node:e,property:"value",type:Ne.enum}),"prune"}highlightNameAndKind(e,n){n({node:e,property:"name",type:Ne.variable,modifier:[qe.declaration,qe.readonly]}),n({node:e,property:"kind",type:Ne.keyword,modifier:[]})}highlightView(e,n){e.name&&n({node:e,property:"name",type:Ne.variable,modifier:[qe.declaration,qe.readonly,"local"]})}}class j5{constructor(e){this.services=e,this.Names=e.references.NameProvider,this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.documentCache=e.DocumentCache}Names;langiumDocuments;documentCache;documents(){return this.langiumDocuments.all.filter(e=>Sd(e)&&e.state>=We.IndexedContent)}get(e){return e.state<We.IndexedContent&&ve(`Document ${e.uri.path} is not indexed`),this.documentCache.get(e.uri,"DeploymentsIndex",()=>this.createDocumentIndex(e))}nested(e){const n=this.getFqn(e);return this.documents().flatMap(r=>this.get(r).nested(n))}byFqn(e){return this.documents().flatMap(n=>this.get(n).byFqn(e))}getFqn(e){let n=$d.readId(e);if(ie(n))return n;const r=[this.Names.getNameStrict(e)];let i=e,s;for(;s=rn(i.$container,Dn);)r.push(this.Names.getNameStrict(s)),i=s;return n=r.reduceRight((a,o)=>`${a}.${o}`),$d.writeId(e,n),n}createDocumentIndex(e){const n=e.parseResult.value.deployments.flatMap(l=>l.elements);if(n.length===0)return Bm.EMPTY;const r=new Array,i=new Mn,s=new Mn,a=this.Names,o=this.services.workspace.AstNodeDescriptionProvider,u=l=>{const d={...o.createDescription(l.node,l.name,e),fqn:l.fqn};return $d.writeId(l.node,l.fqn),s.add(l.fqn,d),d},c=(l,d)=>{const f=[],p=l.body?.elements;if(!p||p.length===0)return[];const h=new Set;for(const y of p)if(!qi(y))try{const b=a.getName(y);if(ie(b)){const w=`${d}.${b}`,E=u({node:y,name:b,fqn:w});i.add(d,E),h.add(E.name),Dn(y)&&y.body&&f.push(...c(y,w))}}catch(b){ve(b)}return f.length>0&&Qe(f,Ps(Vu("name")),Tp((y,b)=>{y.length>1||h.has(b)||i.add(d,y[0])})),i.get(d)};for(const l of n)try{if(qi(l))continue;const d=a.getName(l);ie(d)&&(r.push(u({node:l,name:d,fqn:d})),c(l,d))}catch(d){ve(d)}return new Bm(r,i,s)}}class Bm{constructor(e,n,r){this._rootNodes=e,this._nested=n,this._byfqn=r}static EMPTY=new Bm([],new Mn,new Mn);rootNodes(){return this._rootNodes}byFqn(e){return this._byfqn.get(e)}nested(e){return this._nested.get(e)}unique(){const e=[];return Qe([...this._byfqn.values()],Ps(Vu("name")),Tp(n=>{n.length===1&&e.push(n[0])})),e}}const{findNodeForProperty:U5}=Df,{toDocumentSegment:I_}=AN;function W5(t,e,n){const r=U5(e.$cstNode,"name");return{documentUri:n.uri,name:e.name,...e.$cstNode&&{selectionSegment:I_(e.$cstNode)},...r&&{nameSegment:I_(r)},path:t.getAstNodePath(e),type:Zn}}function H5(t,e){const n=t.c4fqnIndex=new Mn,r=t.parseResult.value.models.flatMap(o=>o.elements);if(r.length===0)return;const i=e.workspace.AstNodeLocator,s=jm.from(r.map(o=>[o,null]));let a;for(;a=s.shift();)try{const[o,u]=a;if(Lr(o))continue;if(Ja(o)){if(Qt(o.body)&&!Qn(o.body.elements)){const c=am(o.element);for(const l of o.body.elements)Lr(l)||s.push([l,c])}continue}if(qn(o)){const c=Q1(o.name,u);if(n.add(c,{...W5(i,o,t),fqn:c}),$d.writeId(o,c),Qt(o.body)&&!Qn(o.body.elements))for(const l of o.body.elements)Lr(l)||s.push([l,c]);continue}Ae(o)}catch(o){w0(o)}}class Qv{toDispose=[];isDisposed=!1;onDispose(...e){this.toDispose.push(...e)}dispose(){this.throwIfDisposed(),this.isDisposed=!0;let e;for(;e=this.toDispose.pop();)try{e.dispose()}catch(n){w0(n)}}throwIfDisposed(){if(this.isDisposed)throw new Error("This has already been disposed")}}function kd(...t){var e=t.length>1?t.join(":::"):t[0];return Z1(e)}class V5 extends Qv{constructor(e){super(),this.services=e,this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.onDispose(e.shared.workspace.DocumentBuilder.onBuildPhase(We.IndexedContent,async(n,r)=>{for(const i of n)if(Sd(i)){delete i.c4fqnIndex,delete i.c4Elements,delete i.c4Specification,delete i.c4Relations,delete i.c4Deployments,delete i.c4DeploymentRelations,delete i.c4Globals,delete i.c4Views;try{H5(i,e)}catch(s){ve(s)}}return await Promise.resolve()})),Me.debug("[FqnIndex] Created")}langiumDocuments;get documents(){return this.langiumDocuments.all.filter(Uv)}entries(e){return this.documents.flatMap(n=>n.c4fqnIndex.keys().filter(e).flatMap(r=>n.c4fqnIndex.get(r)))}getFqn(e){return $d.readId(e)??null}byFqn(e){return this.documents.flatMap(n=>n.c4fqnIndex.get(e))}directChildrenOf(e){return rt([e]).flatMap(n=>{const r=this.entries(i=>Kd(i)===n).map(i=>[i.name,i]).toArray();return r.length===0?[]:new Mn(r).entriesGroupedByKey().flatMap(([i,s])=>s.length===1?s:[]).iterator()})}uniqueDescedants(e){return new Ot(()=>{const n=`${e}.`,r=new Set,i=[],s=new Mn;if(this.entries(a=>a.startsWith(n)).forEach(a=>{const o=Hd(a.fqn),u={...a,name:o};Kd(a.fqn)===e?(r.add(o),s.add(o,u)):i.push(u)}),s.size+i.length===0)return null;for(const a of i)r.has(a.name)||s.add(a.name,a);return s.entriesGroupedByKey().flatMap(([a,o])=>o.length===1?o:[]).iterator()},n=>n?n.next():tn)}}function K5(t){const e=new Map;for(const n of t)if(Ao.isElement(n)&&n.viewOf&&Dt(n.extends)){const r=e.get(n.viewOf)??[];r.push(n.id),e.set(n.viewOf,r)}for(const{id:n,nodes:r}of t)for(const i of r){const s=Vd.modelRef(i);if(i.navigateTo||!s)continue;const a=UT(e.get(s)??[],o=>o!==n);a&&(i.navigateTo=a)}return t}function Y5(t,e="/"){const n=Qe(t,an(u=>u.docUri),je(ie),Hu());if(n.length===0)return"";if(n.length===1){const u=lm(n[0]).pathname.split(e);return u.length<=1?e:(u.pop(),u.join(e)+e)}_e(Nr(n,2),"Expected at least 2 unique URIs");const[r,...i]=n,s=lm(r).pathname.split(e);let a=s.length;for(const u of i){if(u===r)continue;const c=lm(u).pathname.split(e);for(let l=0;l<a;l++)c[l]!==s[l]&&(a=l);if(a===0)return""}const o=s.slice(0,a).join(e);return o.endsWith(e)?o:o+e}function X5(t){const e="/",n=Y5(t,e);return t.map(r=>{if(!r.docUri)return{view:r,parts:[]};let i=lm(r.docUri).pathname;return n.length>0?(_e(i.startsWith(n),`Expect path "${i}" to start with common prefix: "${n}"`),i=i.slice(n.length)):i=i.includes(e)?i.slice(i.lastIndexOf(e)+1):i,{view:r,parts:i.split(e)}}).sort((r,i)=>{if(r.parts.length!==i.parts.length)return r.parts.length-i.parts.length;for(let s=0;s<r.parts.length;s++){const a=ID(r.parts[s],i.parts[s]);if(a!==0)return a}return ID(r.view.title??r.view.id,i.view.title??i.view.id)}).map(({parts:r,view:i})=>({...i,relativePath:r.join(e)}))}function J5(t,e){const n={tags:new Set,deployments:{},elements:{},relationships:{},colors:{}},r={predicates:{},dynamicPredicates:{},styles:{}};for(const k of e){const{c4Specification:A,c4Globals:I}=k;A.tags.forEach(M=>n.tags.add(M)),Object.assign(n.elements,A.elements),Object.assign(n.relationships,A.relationships),Object.assign(n.colors,A.colors),Object.assign(n.deployments,A.deployments),Object.assign(r.predicates,I.predicates),Object.assign(r.dynamicPredicates,I.dynamicPredicates),Object.assign(r.styles,I.styles)}function i(k,A){return an(A,I=>{try{const M=t.lsp.DocumentLinkProvider.relativeLink(k,I.url);if(M&&M!==I.url)return{...I,relative:M}}catch(M){ve(M)}return I})}const s=Ku(n.colors,k=>tN(k.color));function a(k){return({tags:A,links:I,style:{color:M,shape:Y,icon:Q,opacity:ae,border:O,size:T,multiple:R,padding:F,textSize:V},id:W,kind:H,title:Ee,description:te,technology:C,metadata:me})=>{try{const ke=n.elements[H];if(!ke)return Me.warn(`No kind '${H}' found for ${W}`),null;const at=I?i(k,I):null;return M??=ke.style.color,Y??=ke.style.shape,Q??=ke.style.icon,ae??=ke.style.opacity,O??=ke.style.border,C??=ke.technology,R??=ke.style.multiple,T??=ke.style.size,F??=ke.style.padding,V??=ke.style.textSize,{...M&&{color:M},...Y&&{shape:Y},...Q&&{icon:Q},...me&&!Qn(me)&&{metadata:me},...ke.notation&&{notation:ke.notation},style:{...O&&{border:O},...T&&{size:T},...F&&{padding:F},...V&&{textSize:V},...nw(R)&&{multiple:R},...Sp(ae)&&{opacity:ae}},links:at,tags:A??null,technology:C??null,description:te??null,title:Ee,kind:H,id:W}}catch(ke){ve(ke)}return null}}const o=new Map;function u(k){for(const A of k.c4ExtendElements){let I=A.links?i(k,A.links):null;const M=o.get(A.id);if(M){I=M.links?[...M.links,...I??[]]:I;let Y=[...M.tags??[],...A.tags??[]];Nr(Y,1)||(Y=null),o.set(A.id,{tags:Y,links:I,metadata:{...M.metadata,...A.metadata}})}else o.set(A.id,{tags:A.tags??null,links:I,metadata:{...A.metadata}})}}function c(k){const A=o.get(k.id);if(A){const I=[...k.links??[],...A.links??[]],M=Hu([...k.tags??[],...A.tags??[]]),Y={...k.metadata,...A.metadata};return{...k,tags:Nr(M,1)?M:null,links:Nr(I,1)?I:null,...!Qn(Y)&&{metadata:Y}}}return k}const l=Qe(e,Fi(k=>(u(k),an(k.c4Elements,a(k)))),je(ie),OD,tw((k,A)=>{const I=Kd(A.id);return I&&Dt(k[I])?(ve(`No parent found for ${A.id}`),k):(k[A.id]=c(A),k)},{}));function d(k){return({astPath:A,source:I,target:M,kind:Y,links:Q,id:ae,...O})=>{if(Dt(l[I])||Dt(l[M]))return Me.warn(`Invalid relation ${ae} at ${k.uri.path} ${A}, source: ${I}(${!!l[I]}), target: ${M}(${!!l[M]})`),null;const T=Q?i(k,Q):null;return on(Y)&&Y in n.relationships?{...n.relationships[Y],...O,...T&&{links:T},source:I,target:M,kind:Y,id:ae}:{...T&&{links:T},...O,source:I,target:M,id:ae}}}const f=Qe(e,Fi(k=>an(k.c4Relations,d(k))),je(ie),BT(nN),qT(),rw(Vu("id")));function p(k){return A=>{if(!rN.isDeploymentNode(A)){if(!A.links||A.links.length===0)return A;const I=i(k,A.links);return{...A,links:I}}try{const I=n.deployments[A.kind];if(!I)return Me.warn(`No kind '${A.kind}' found for ${A.id}`),null;let{technology:M=I.technology,notation:Y=I.notation,links:Q,style:ae}=A;return{...A,...Y&&{notation:Y},...M&&{technology:M},style:{border:"dashed",opacity:10,...I.style,...ae},links:Q?i(k,Q):null}}catch(I){ve(I)}return null}}const h=Qe(e,Fi(k=>an(k.c4Deployments,p(k))),je(ie),OD,tw((k,A)=>{const I=Kd(A.id);return I&&Dt(k[I])?(ve(`No parent found for deployment element ${A.id}`),k):(k[A.id]=A,k)},{}));function y(k){return({astPath:A,source:I,target:M,kind:Y,links:Q,id:ae,...O})=>{if(Dt(h[I.id])||Dt(h[M.id]))return Me.warn(`Invalid deployment relation ${ae} at ${k.uri.path} ${A}, source: ${I.id}(${!!h[I.id]}), target: ${M.id}(${!!h[M.id]})`),null;const T=Q?i(k,Q):null;return on(Y)&&Y in n.relationships?{...n.relationships[Y],...O,...T&&{links:T},source:I,target:M,kind:Y,id:ae}:{...T&&{links:T},...O,source:I,target:M,id:ae}}}const b=Qe(e,Fi(k=>an(k.c4DeploymentRelations,y(k))),je(ie),tw((k,A)=>Qt(k[A.id])?(ve(`Duplicate deployment relation ${A.id}`),k):(k[A.id]=A,k),{}));function w(k){const A=k.uri.toString();return I=>{let{id:M,title:Y,description:Q,tags:ae,links:O,astPath:T,...R}=I;I.__==="element"&&Dt(Y)&&"viewOf"in I&&(Y=l[I.viewOf]?.title??null),Dt(Y)&&M==="index"&&(Y="Landscape view");const F=O?i(k,O):null;return{...R,customColorDefinitions:s,tags:ae,links:F,docUri:A,description:Q,title:Y,id:M}}}const E=Qe(e,Fi(k=>an(k.c4Views,w(k))),X5);E.some(k=>k.id==="index")||E.unshift({__:"element",id:"index",title:"Landscape view",description:null,tags:null,links:null,customColorDefinitions:s,rules:[{include:[{wildcard:!0}]}]});const $=Qe(E,rw(Vu("id")),hN);return{specification:{tags:Array.from(n.tags),elements:n.elements,relationships:n.relationships,deployments:n.deployments},elements:l,relations:f,globals:r,views:$,deployments:{elements:h,relations:b}}}const N_="ParsedLikeC4Model",Zv="ComputedLikeC4Model";class Q5 extends Qv{constructor(e){super(),this.services=e,this.langiumDocuments=e.shared.workspace.LangiumDocuments;const n=e.likec4.ModelParser;this.onDispose(e.shared.workspace.DocumentBuilder.onUpdate((r,i)=>{i.length>0&&this.notifyListeners(i)})),this.onDispose(e.shared.workspace.DocumentBuilder.onBuildPhase(We.Validated,async(r,i)=>{let s=[];Me.debug(`[ModelBuilder] onValidated (${r.length} docs)`);for(const a of r)try{s.push(n.parse(a).uri)}catch(o){ve(o)}await It(i),s.length>0&&this.notifyListeners(s)})),Me.debug("[ModelBuilder] Created")}langiumDocuments;listeners=[];unsafeSyncBuildModel(){const e=this.documents();return e.length===0?(Me.debug("[ModelBuilder] No documents to build model from"),null):this.services.WorkspaceCache.get(N_,()=>(Me.debug(`[ModelBuilder] buildModel (${e.length} docs)`),J5(this.services,e)))}async buildModel(e){return this.services.WorkspaceCache.get(N_)||await this.services.shared.workspace.WorkspaceLock.read(async()=>(e&&await It(e),this.unsafeSyncBuildModel()))}previousViews={};unsafeSyncBuildComputedModel(e){const n=this.services.WorkspaceCache,r=this.services.WorkspaceCache;return n.get(Zv,()=>{const i=ND.makeCompute(e),s=[];for(const o of Wu(e.views)){const u=i(o);if(!u.isSuccess){ve(u.error);continue}s.push(u.view)}K5(s);const a=Or(s,o=>{const u=this.previousViews[o.id],c=u&&bv(o,u)?u:o;return r.set(O_(o.id),c),[o.id,c]});return this.previousViews={...a},{...bj(e,["views"]),views:a}})}async buildComputedModel(e){const n=this.services.WorkspaceCache;return n.has(Zv)?n.get(Zv):await this.services.shared.workspace.WorkspaceLock.read(async()=>{e&&await It(e);const r=this.unsafeSyncBuildModel();return r?this.unsafeSyncBuildComputedModel(r):null})}async computeView(e,n){const r=this.services.WorkspaceCache,i=O_(e);return r.has(i)?r.get(i):await this.services.shared.workspace.WorkspaceLock.read(async()=>(n&&await It(n),r.get(i,()=>{const s=this.unsafeSyncBuildModel(),a=s?.views[e];if(!a)return Me.warn(`[ModelBuilder] Cannot find view ${e}`),null;const o=ND.makeCompute(s)(a);if(!o.isSuccess)return ve(o.error),null;let u=o.view;const c=Qe(s.views,Wu(),je(eN),je(d=>d.id!==e),Ps(d=>d.viewOf));for(const d of u.nodes)if(!d.navigateTo){const f=c[d.id];f&&(d.navigateTo=f[0].id)}const l=this.previousViews[e];return l&&bv(u,l)?u=l:this.previousViews[e]=u,u})))}onModelParsed(e){return this.listeners.push(e),_s.create(()=>{const n=this.listeners.indexOf(e);n>=0&&this.listeners.splice(n,1)})}documents(){return this.langiumDocuments.all.filter(bo).toArray()}notifyListeners(e){for(const n of this.listeners)try{n(e)}catch(r){ve(r)}}}function O_(t){return`computed-view-${t}`}const{findNodeForKeyword:Z5,findNodeForProperty:dm}=Df,{getDocument:eK}=hu;class tK{constructor(e){this.services=e,this.fqnIndex=e.likec4.FqnIndex,this.deploymentsIndex=e.likec4.DeploymentsIndex,this.langiumDocuments=e.shared.workspace.LangiumDocuments}fqnIndex;deploymentsIndex;langiumDocuments;documents(){return this.langiumDocuments.all.filter(bo)}getParsedElement(e){if(GT(e)){const i=e,s=this.fqnIndex.byFqn(e).head();if(!s)return null;const a=this.langiumDocuments.getDocument(s.documentUri);return!a||!bo(a)?null:a.c4Elements.find(o=>o.id===i)??null}const n=this.fqnIndex.getFqn(e);if(!n)return null;const r=eK(e);return bo(r)?r.c4Elements.find(i=>i.id===n)??null:null}locateElement(e,n){const r=this.fqnIndex.byFqn(e).head(),i=r?.nameSegment??r?.selectionSegment;return!r||!i?null:{uri:r.documentUri.toString(),range:i.range}}locateDeploymentElement(e,n){const r=this.deploymentsIndex.byFqn(e).head(),i=r?.nameSegment??r?.selectionSegment;return!r||!i?null:{uri:r.documentUri.toString(),range:i.range}}locateRelation(e){for(const n of this.documents()){const r=n.c4Relations.find(a=>a.id===e)??n.c4DeploymentRelations.find(a=>a.id===e);if(!r)continue;const i=this.services.workspace.AstNodeLocator.getAstNode(n.parseResult.value,r.astPath);if(!Lr(i)&&!qi(i))continue;let s=i.title?dm(i.$cstNode,"title"):void 0;if(s??=i.kind?dm(i.$cstNode,"kind"):void 0,s??=dm(i.$cstNode,"target"),s??=i.$cstNode,!!s)return{uri:n.uri.toString(),range:s.range}}return null}locateViewAst(e){for(const n of this.documents()){const r=n.c4Views.find(s=>s.id===e);if(!r)continue;const i=this.services.workspace.AstNodeLocator.getAstNode(n.parseResult.value,r.astPath);if(Pw(i))return{doc:n,view:r,viewAst:i}}return null}locateView(e){const n=this.locateViewAst(e);if(!n)return null;const r=n.viewAst;let i=r.name?dm(r.$cstNode,"name"):void 0;return i??=Z5(r.$cstNode,"view"),i??=r.$cstNode,i?{uri:n.doc.uri.toString(),range:i.range}:null}}const ca=["this","it","self","super","likec4lib","global"];function pt(t){return async function(e,n,r){try{const i=t(e,n,r);kj(i)&&await i;return}catch(i){const s=i instanceof Error?i.message:String(i);n("error",`Validation failed: ${s}`,{node:e}),ve(i)}}}const{getDocument:nK}=hu,rK=t=>{const e=t.likec4.DeploymentsIndex,n=t.references.NameProvider;return pt((r,i)=>{const s=n.getName(r);if(!s){i("error","DeploymentNode must be named",{node:r});return}const a=pn(n.getNameNode(r),"name CstNode not found").range;ca.includes(s)&&i("error",`Reserved word: ${s}`,{node:r,range:a});const o=e.getFqn(r);e.byFqn(o).limit(2).toArray().length>1&&i("error",`Duplicate node name "${o}"`,{node:r,range:a})})},iK=t=>{const e=t.likec4.DeploymentsIndex,n=t.references.NameProvider;return pt((r,i)=>{const s=n.getName(r);if(!s){i("error","Deployed instance must be named, unique inside node",{node:r});return}const a=pn(n.getNameNode(r),"name CstNode not found").range;ca.includes(s)&&i("error",`Reserved word: ${s}`,{node:r,range:a});const o=e.getFqn(r);e.byFqn(o).limit(2).toArray().length>1&&i("error",`Duplicate instance name "${o}"`,{node:r,range:a})})},sK=t=>{const e=t.likec4.ModelParser;return pt((n,r)=>{if(!n.source?.value?.ref){let u=n.source?.$cstNode?.text??"";r("error",`DeploymentRelation source '${u}' not resolved`,{node:n,property:"source"});return}if(!n.target?.value?.ref){let u=n.target?.$cstNode?.text??"";r("error",`DeploymentRelation target '${u}' not resolved`,{node:n,property:"target"});return}const i=nK(n),s=e.forDocument(i),a=s.parseFqnRef(n.source);if(_o.isModelRef(a)){r("error","DeploymentRelation must refer deployment element",{node:n,property:"source"});return}const o=s.parseFqnRef(n.target);if(_o.isModelRef(o)){r("error","DeploymentRelation must refer deployment element",{node:n,property:"target"});return}FD(a.deployment,o.deployment)&&r("error","Invalid parent-child relationship",{node:n})})},aK=t=>pt((e,n)=>{const r=A_(e.value);switch(!0){case ph(r):case mh(r):case na(r):{n("warning","Predicate is ignored, as not supported in dynamic views",{node:e});return}}}),oK=t=>{const e=t.likec4.FqnIndex;return pt((n,r)=>{const i=Rn(n.source),s=i&&e.getFqn(i);s||r("error","Source not found (not parsed/indexed yet)",{node:n,property:"source"});const a=Rn(n.target),o=a&&e.getFqn(a);o||r("error","Target not found (not parsed/indexed yet)",{node:n,property:"target"}),s&&o&&(Um(s,o)||Um(o,s))&&r("error","Invalid parent-child relationship",{node:n})})},{getDocument:uK}=hu,cK=t=>{const e=t.likec4.FqnIndex,n=t.workspace.AstNodeLocator;return pt((r,i)=>{const s=e.getFqn(r);if(!s){i("error","Not indexed element",{node:r,property:"name"});return}ca.includes(r.name)&&i("error",`Reserved word: ${r.name}`,{node:r,property:"name"});const a=uK(r).uri,o=n.getAstNodePath(r),u=e.byFqn(s).filter(c=>c.documentUri!==a||c.path!==o).head();if(u){const c=u.documentUri!==a;i("error",`Duplicate element name ${r.name!==s?r.name+" ("+s+")":r.name}`,{node:r,property:"name",...c&&{relatedInformation:[{location:{range:u.nameSegment?.range??u.selectionSegment?.range,uri:u.documentUri.toString()},message:"conflicting element"}]}})}})},lK=t=>pt((e,n)=>{const r=parseFloat(e.value);(isNaN(r)||r<0||r>100)&&n("warning","Value ignored, must be between 0% and 100%",{node:e,property:"value"})}),dK=t=>(e,n)=>{const r=e.$container;r.props.some(i=>Fr(i)&&i!==e)&&n("error","Icon must be defined once",{node:e}),Gi(r)&&Zc(r.$container)&&r.$container.props.some(i=>Fr(i))&&n("warning","Redundant as icon defined on element",{node:e})},fK=t=>(e,n)=>{Ci(e,Gw)||n("error","Notes can be defined only inside dynamic view",{node:e})},pK=t=>{const e=t.likec4.FqnIndex;return pt((n,r)=>{const i=Rn(n.target),s=i&&e.getFqn(i);s||r("error","Target not resolved",{node:n,property:"target"});let a;if(Qt(n.source)){if(a=Rn(n.source),!a)return r("error","Source not resolved",{node:n,property:"source"})}else{if(!Zc(n.$container))return r("error","Sourceless relation must be nested",{node:n});a=n.$container.$container}const o=e.getFqn(a);o||r("error","Source not resolved",{node:n}),o&&s&&FD(o,s)&&r("error","Invalid parent-child relationship",{node:n})})},hK=t=>pt((e,n)=>{e.$container.tags?.values&&e.tags?.values&&n("error","Relation cannot have tags in both header and body",{node:e.tags})}),mK=t=>pt((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one specification per document",{node:e,property:"name"})}),gK=t=>pt((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one model per document",{node:e,property:"name"})}),yK=t=>pt((e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one global block per document",{node:e,property:"name"})}),wK=t=>{const e=t.shared.workspace.IndexManager;return pt((n,r)=>{ca.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=e.allElements(gi).filter(s=>s.name===n.name&&s.node!==n).head();if(i){const s=i.documentUri!==wt(n).uri;r("error",`Duplicate element kind '${n.name}'`,{node:n,property:"name",...s&&{relatedInformation:[{location:{range:i.nameSegment.range,uri:i.documentUri.toString()},message:"conflicting definition"}]}})}})},vK=t=>{const e=t.shared.workspace.IndexManager;return pt((n,r)=>{ca.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=e.allElements(Bi).filter(s=>s.name===n.name&&s.node!==n).head();if(i){const s=i.documentUri!==wt(n).uri;r("error",`Duplicate deploymentNode kind '${n.name}'`,{node:n,property:"name",...s&&{relatedInformation:[{location:{range:i.nameSegment.range,uri:i.documentUri.toString()},message:"conflicting definition"}]}})}})},bK=t=>{const e=t.shared.workspace.IndexManager;return pt((n,r)=>{const i="#"+n.name,s=e.allElements(Ui).filter(a=>a.name===i&&a.node!==n).head();if(s){const a=s.documentUri!==wt(n).uri;r("error",`Duplicate tag '${n.name}'`,{node:n,property:"name",...a&&{relatedInformation:[{location:{range:s.nameSegment.range,uri:s.documentUri.toString()},message:"conflicting definition"}]}})}})},DK=t=>{const e=t.shared.workspace.IndexManager;return pt((n,r)=>{ca.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"}),e.allElements(ji).filter(i=>i.name===n.name).limit(2).count()>1&&r("error",`Duplicate RelationshipKind '${n.name}'`,{node:n,property:"name"})})},F_=t=>{const e=t.shared.workspace.IndexManager;return pt((n,r)=>{const i=e.allElements(Za),s=e.allElements(Qa);i.concat(s).filter(a=>a.name===n.name).limit(2).count()>1&&r("error",`Duplicate GlobalPredicateGroup or GlobalDynamicPredicateGroup name '${n.name}'`,{node:n,property:"name"})})},EK=t=>{const e=t.shared.workspace.IndexManager;return pt((n,r)=>{e.allElements(yl).filter(i=>i.name===n.name).limit(2).count()>1&&r("error",`Duplicate GlobalStyleId name '${n.name}'`,{node:n,property:"name"})})},RK=t=>{const e=t.shared.workspace.IndexManager;return pt((n,r)=>{n.name&&(ca.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"}),e.allElements(Ys).filter(i=>i.name===n.name).limit(2).count()>1&&r("error",`Duplicate view '${n.name}'`,{node:n,property:"name"}))})},$K=t=>pt((e,n)=>{const r=rn(e,Kp);fl(r)&&n("error",'Invalid usage inside "exclude"',{node:e});const i=Uw(e.subject)?e.subject.subject:e.subject;switch(!0){case al(i):case jw(i):case fA(i):case na(i):return;case ph(i):case mh(i):n("error","Invalid target (expect reference to specific element)",{node:e,property:"subject"});return;default:Ae(i)}}),SK=t=>pt((e,n)=>{Ci(e,Iw)&&n("warning","Redundant usage, expand predicate resolves parent element only when used in relations",{node:e})}),TK=t=>{const e=t.likec4.ModelParser;return pt((n,r)=>{if(n.$container.$type!=="DeploymentViewRulePredicateExpression")return;const i=rn(n,Ka);if(!i||i.isInclude!==!0)return;const s=wt(n),a=e.forDocument(s),o="Model reference is allowed in exclude predicate only";if(Mw(n)){Po.isModelRef(a.parseFqnExpr(n.source.from))&&r("error",o,{node:n.source,property:"from"}),Po.isModelRef(a.parseFqnExpr(n.target))&&r("error",o,{node:n,property:"target"});return}let u;if(Kw(n)?u=n.to:Jw(n)?u=n.from:u=n.inout.to,Po.isModelRef(a.parseFqnExpr(u))){r("error",o,{node:n});return}})},kK=t=>{const e=t.likec4.ModelParser;return pt((n,r)=>{const i=n.ref.value.ref;if(Dt(i)){r("error","Invalid empty reference",{node:n});return}const s=wt(n),a=e.forDocument(s).parseFqnRefExpr(n);if(n.$container.$type==="DeploymentViewRulePredicateExpression"){if(Po.isModelRef(a)){r("error","Deployment view predicate must reference deployment model",{node:n});return}if(Po.isDeploymentRef(a)&&_o.isInsideInstanceRef(a.ref)){r("error","Must reference deployment nodes or instances, but not internals",{node:n});return}}!Dn(i)&&on(n.selector)&&r("warning",`Selector '${n.selector}' applies to deployment nodes only, ignored here`,{node:n,property:"selector"})})},CK=t=>pt((e,n)=>{if(na(e.to)&&!Yw(e.$container)){const r=rn(e,gh);Dt(r?.viewOf)&&n("warning","Predicate is ignored as it concerns all relationships",{node:e})}}),AK=t=>pt((e,n)=>{if(na(e.from)&&!zw(e.$container)){const r=rn(e,gh);Dt(r?.viewOf)&&n("warning","Predicate is ignored as it concerns all relationships",{node:e})}}),_K=t=>pt((e,n)=>{const r=rn(e,Kp);fl(r)&&n("error",'Invalid usage inside "exclude"',{node:e})});function PK(t){return e=>t.some(n=>n(e))}const xK=PK([Vw,gl,ml,to,ea,lA,hh,tv,kw,Iw,Bw,Gw,r4,Ka,u4,tA,Hw,m4,Ow,l4,sv,g4,Op,Pw,Fw,hr,Dn,qi,nA,Xs,Lr,o4,rA,Ch,qn,Ja,co,fo,oo,Lh,Fh,iv]),IK=t=>{let e=t;for(;e&&!O4(e);){if(xK(e))return e;e=e.$container}};function NK(t){const e=t.state>=We.Validated?t.diagnostics?.filter(r=>r.severity===zu.Error)??[]:[],n=new WeakSet;for(const{node:r}of e){if(Dt(r)||n.has(r))continue;n.add(r);const i=IK(r);i&&n.add(i)}return{isValid:r=>!n.has(r),invalidNodes:n}}function OK(t){Me.debug("registerValidationChecks"),t.validation.ValidationRegistry.register({DeployedInstance:iK(t),DeploymentNodeKind:vK(t),DeploymentNode:rK(t),DeploymentRelation:sK(t),FqnRefExpr:kK(t),RelationExpr:TK(t),NotesProperty:fK(),OpacityProperty:lK(),IconProperty:dK(),SpecificationRule:mK(),Model:gK(),Globals:yK(),GlobalPredicateGroup:F_(t),GlobalDynamicPredicateGroup:F_(t),GlobalStyleId:EK(t),DynamicViewStep:oK(t),LikeC4View:RK(t),Element:cK(t),ElementKind:wK(t),Relation:pK(t),RelationBody:hK(),Tag:bK(t),DynamicViewPredicateIterator:aK(),ElementPredicateWith:$K(),RelationPredicateWith:_K(),ExpandElementExpression:SK(),RelationshipKind:DK(t),IncomingRelationExpression:CK(),OutgoingRelationExpression:AK()});const e=t.shared.lsp.Connection;e&&t.shared.workspace.DocumentBuilder.onUpdate((n,r)=>{for(const i of r)Me.debug(`clear diagnostics for deleted ${i.path}`),e.sendDiagnostics({uri:i.toString(),diagnostics:[]})})}function Br(t){return on(t)?lt(t).split(`
242
+ `).join(" "):void 0}function lt(t){return on(t)?Jv(t).trim():void 0}class FK{constructor(e,n){this.services=e,this.doc=n,this.isValid=NK(n).isValid}isValid;resolveFqn(e){if(eA(e))return this.services.likec4.DeploymentsIndex.getFqn(e);if(Ja(e))return am(e.element);const n=this.services.likec4.FqnIndex.getFqn(e);return _e(n,`Not indexed element: ${this.getAstNodePath(e)}`),n}getAstNodePath(e){return this.services.workspace.AstNodeLocator.getAstNodePath(e)}getMetadata(e){if(!e||!this.isValid(e)||Qn(e.props))return;const n=Qe(e.props,an(r=>[r.key,lt(r.value)]),je(([r,i])=>ie(i)),Gj());return Qn(n)?void 0:n}convertTags(e){return this.parseTags(e)}parseTags(e){let n=e?.tags;if(!n)return null;let r=[];for(;n;){try{if(this.isValid(n)){const i=n.values.map(s=>s.ref?.name).filter(ie);i.length>0&&r.push(...i)}}catch{}n=n.prev}return r=Hu(r.reverse()),Un(r)?r:null}convertLinks(e){return this.parseLinks(e)}parseLinks(e){if(!(!e?.props||e.props.length===0))return Qe(e.props,je(Th),Fi(n=>{if(!this.isValid(n))return[];const r=n.value;if(ie(r)){const i=ie(n.title)?Br(n.title):void 0;return i?{url:r,title:i}:{url:r}}return[]}))}}function LK(t){return class extends t{parseDeployment(){const e=this.doc;for(const n of g5(e))try{switch(!0){case qi(n):{this.isValid(n)&&e.c4DeploymentRelations.push(this.parseDeploymentRelation(n));break}case hr(n):e.c4Deployments.push(this.parseDeployedInstance(n));break;case Dn(n):{e.c4Deployments.push(this.parseDeploymentNode(n));break}default:Ae(n)}}catch(r){ve(r)}}parseDeploymentNode(e){const n=this.isValid,r=this.resolveFqn(e),i=pn(e.kind.ref,"DeploymentKind not resolved").name,s=this.convertTags(e.body),a=e.body?.props.find(Gi)?.props,o=Ji(a,n),u=this.getMetadata(e.body?.props.find(Xs)),c=Qe(e.body?.props??[],je(n),je(ul),Or(y=>[y.key,y.value||void 0])),l=lt(e.title??c.title),d=lt(c.description),f=Br(c.technology),p=this.convertLinks(e.body),h=e.body?.props.find(Fr);if(h&&n(h)){const y=h.libicon?.ref?.name??h.value;ie(y)&&(o.icon=y)}return{id:r,kind:i,title:l??Hd(r),...u&&{metadata:u},...s&&{tags:s},...p&&Un(p)&&{links:p},...ie(f)&&{technology:f},...ie(d)&&{description:d},style:o}}parseDeployedInstance(e){const n=this.isValid,r=this.resolveFqn(e),i=this.resolveFqn(pn(Rn(e.element),"DeployedInstance element not found")),s=this.convertTags(e.body),a=e.body?.props.find(Gi)?.props,o=Ji(a,n),u=this.getMetadata(e.body?.props.find(Xs)),c=Qe(e.body?.props??[],je(n),je(ul),Or(y=>[y.key,y.value||void 0])),l=lt(e.title??c.title),d=lt(c.description),f=Br(c.technology),p=this.convertLinks(e.body),h=e.body?.props.find(Fr);if(h&&n(h)){const y=h.libicon?.ref?.name??h.value;ie(y)&&(o.icon=y)}return{id:r,element:i,...u&&{metadata:u},...l&&{title:l},...s&&{tags:s},...p&&Un(p)&&{links:p},...ie(f)&&{technology:f},...ie(d)&&{description:d},style:o}}parseDeploymentRelation(e){const n=this.isValid,r=this.getAstNodePath(e),i=_o.toDeploymentRef(this.parseFqnRef(e.source)),s=_o.toDeploymentRef(this.parseFqnRef(e.target)),a=this.convertTags(e)??this.convertTags(e.body),o=this.convertLinks(e.body),u=e.kind?.ref?.name,c=this.getMetadata(e.body?.props.find(Xs)),l=Or(e.body?.props.filter(jl)??[],b=>[b.key,b.value]),d=Qe(e.body?.props??[],je(Ml),an(b=>b.value.view.ref?.name),je(ie),Ua()),f=lt(e.title??l.title),p=lt(l.description),h=Br(e.technology)??lt(l.technology),y=e.body?.props.find(Ih);return{id:kd("deployment",r,i.id,s.id),source:i,target:s,...f&&{title:f},...c&&{metadata:c},...ie(h)&&{technology:h},...ie(p)&&{description:p},...u&&{kind:u},...a&&{tags:a},...Un(o)&&{links:o},...Wv(y?.props,n),...d&&{navigateTo:d},astPath:r}}}}function MK(t){for(var e=t.length,n=0,r=0;r<e;){var i=t.charCodeAt(r++);if(i&4294967168)if(!(i&4294965248))n+=2;else{if(i>=55296&&i<=56319&&r<e){var s=t.charCodeAt(r);(s&64512)===56320&&(++r,i=((i&1023)<<10)+(s&1023)+65536)}i&4294901760?n+=4:n+=3}else{n++;continue}}return n}function zK(t,e,n){for(var r=t.length,i=n,s=0;s<r;){var a=t.charCodeAt(s++);if(a&4294967168)if(!(a&4294965248))e[i++]=a>>6&31|192;else{if(a>=55296&&a<=56319&&s<r){var o=t.charCodeAt(s);(o&64512)===56320&&(++s,a=((a&1023)<<10)+(o&1023)+65536)}a&4294901760?(e[i++]=a>>18&7|240,e[i++]=a>>12&63|128,e[i++]=a>>6&63|128):(e[i++]=a>>12&15|224,e[i++]=a>>6&63|128)}else{e[i++]=a;continue}e[i++]=a&63|128}}var BK=new TextEncoder,qK=50;function GK(t,e,n){BK.encodeInto(t,e.subarray(n))}function jK(t,e,n){t.length>qK?GK(t,e,n):zK(t,e,n)}var UK=4096;function L_(t,e,n){for(var r=e,i=r+n,s=[],a="";r<i;){var o=t[r++];if(!(o&128))s.push(o);else if((o&224)===192){var u=t[r++]&63;s.push((o&31)<<6|u)}else if((o&240)===224){var u=t[r++]&63,c=t[r++]&63;s.push((o&31)<<12|u<<6|c)}else if((o&248)===240){var u=t[r++]&63,c=t[r++]&63,l=t[r++]&63,d=(o&7)<<18|u<<12|c<<6|l;d>65535&&(d-=65536,s.push(d>>>10&1023|55296),d=56320|d&1023),s.push(d)}else s.push(o);s.length>=UK&&(a+=String.fromCharCode.apply(String,s),s.length=0)}return s.length>0&&(a+=String.fromCharCode.apply(String,s)),a}var WK=new TextDecoder,HK=200;function VK(t,e,n){var r=t.subarray(e,e+n);return WK.decode(r)}function KK(t,e,n){return n>HK?VK(t,e,n):L_(t,e,n)}var fm=function(){function t(e,n){this.type=e,this.data=n}return t}(),YK=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),qr=function(t){YK(e,t);function e(n){var r=t.call(this,n)||this,i=Object.create(e.prototype);return Object.setPrototypeOf(r,i),Object.defineProperty(r,"name",{configurable:!0,enumerable:!1,value:e.name}),r}return e}(Error),Cd=4294967295;function XK(t,e,n){var r=n/4294967296,i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function M_(t,e,n){var r=Math.floor(n/4294967296),i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function z_(t,e){var n=t.getInt32(e),r=t.getUint32(e+4);return n*4294967296+r}function JK(t,e){var n=t.getUint32(e),r=t.getUint32(e+4);return n*4294967296+r}var QK=-1,ZK=4294967296-1,eY=17179869184-1;function tY(t){var e=t.sec,n=t.nsec;if(e>=0&&n>=0&&e<=eY)if(n===0&&e<=ZK){var r=new Uint8Array(4),i=new DataView(r.buffer);return i.setUint32(0,e),r}else{var s=e/4294967296,a=e&4294967295,r=new Uint8Array(8),i=new DataView(r.buffer);return i.setUint32(0,n<<2|s&3),i.setUint32(4,a),r}else{var r=new Uint8Array(12),i=new DataView(r.buffer);return i.setUint32(0,n),M_(i,4,e),r}}function nY(t){var e=t.getTime(),n=Math.floor(e/1e3),r=(e-n*1e3)*1e6,i=Math.floor(r/1e9);return{sec:n+i,nsec:r-i*1e9}}function rY(t){if(t instanceof Date){var e=nY(t);return tY(e)}else return null}function iY(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:{var n=e.getUint32(0),r=0;return{sec:n,nsec:r}}case 8:{var i=e.getUint32(0),s=e.getUint32(4),n=(i&3)*4294967296+s,r=i>>>2;return{sec:n,nsec:r}}case 12:{var n=z_(e,4),r=e.getUint32(0);return{sec:n,nsec:r}}default:throw new qr("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(t.length))}}function sY(t){var e=iY(t);return new Date(e.sec*1e3+e.nsec/1e6)}var aY={type:QK,encode:rY,decode:sY},B_=function(){function t(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(aY)}return t.prototype.register=function(e){var n=e.type,r=e.encode,i=e.decode;if(n>=0)this.encoders[n]=r,this.decoders[n]=i;else{var s=1+n;this.builtInEncoders[s]=r,this.builtInDecoders[s]=i}},t.prototype.tryToEncode=function(e,n){for(var r=0;r<this.builtInEncoders.length;r++){var i=this.builtInEncoders[r];if(i!=null){var s=i(e,n);if(s!=null){var a=-1-r;return new fm(a,s)}}}for(var r=0;r<this.encoders.length;r++){var i=this.encoders[r];if(i!=null){var s=i(e,n);if(s!=null){var a=r;return new fm(a,s)}}}return e instanceof fm?e:null},t.prototype.decode=function(e,n,r){var i=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return i?i(e,n,r):new fm(n,e)},t.defaultCodec=new t,t}();function oY(t){return t instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer}function pm(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):oY(t)?new Uint8Array(t):Uint8Array.from(t)}function uY(t){if(t instanceof ArrayBuffer)return new DataView(t);var e=pm(t);return new DataView(e.buffer,e.byteOffset,e.byteLength)}var cY=100,lY=2048,dY=function(){function t(e){var n,r,i,s,a,o,u,c;this.extensionCodec=(n=e?.extensionCodec)!==null&&n!==void 0?n:B_.defaultCodec,this.context=e?.context,this.useBigInt64=(r=e?.useBigInt64)!==null&&r!==void 0?r:!1,this.maxDepth=(i=e?.maxDepth)!==null&&i!==void 0?i:cY,this.initialBufferSize=(s=e?.initialBufferSize)!==null&&s!==void 0?s:lY,this.sortKeys=(a=e?.sortKeys)!==null&&a!==void 0?a:!1,this.forceFloat32=(o=e?.forceFloat32)!==null&&o!==void 0?o:!1,this.ignoreUndefined=(u=e?.ignoreUndefined)!==null&&u!==void 0?u:!1,this.forceIntegerToFloat=(c=e?.forceIntegerToFloat)!==null&&c!==void 0?c:!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}return t.prototype.reinitializeState=function(){this.pos=0},t.prototype.encodeSharedRef=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)},t.prototype.encode=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)},t.prototype.doEncode=function(e,n){if(n>this.maxDepth)throw new Error("Too deep objects in depth ".concat(n));e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,n)},t.prototype.ensureBufferSizeToWrite=function(e){var n=this.pos+e;this.view.byteLength<n&&this.resizeBuffer(n*2)},t.prototype.resizeBuffer=function(e){var n=new ArrayBuffer(e),r=new Uint8Array(n),i=new DataView(n);r.set(this.bytes),this.view=i,this.bytes=r},t.prototype.encodeNil=function(){this.writeU8(192)},t.prototype.encodeBoolean=function(e){e===!1?this.writeU8(194):this.writeU8(195)},t.prototype.encodeNumber=function(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)},t.prototype.encodeNumberAsFloat=function(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))},t.prototype.encodeBigInt64=function(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))},t.prototype.writeStringHeader=function(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error("Too long string: ".concat(e," bytes in UTF-8"))},t.prototype.encodeString=function(e){var n=5,r=MK(e);this.ensureBufferSizeToWrite(n+r),this.writeStringHeader(r),jK(e,this.bytes,this.pos),this.pos+=r},t.prototype.encodeObject=function(e,n){var r=this.extensionCodec.tryToEncode(e,this.context);if(r!=null)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,n);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,n);else throw new Error("Unrecognized object: ".concat(Object.prototype.toString.apply(e)))},t.prototype.encodeBinary=function(e){var n=e.byteLength;if(n<256)this.writeU8(196),this.writeU8(n);else if(n<65536)this.writeU8(197),this.writeU16(n);else if(n<4294967296)this.writeU8(198),this.writeU32(n);else throw new Error("Too large binary: ".concat(n));var r=pm(e);this.writeU8a(r)},t.prototype.encodeArray=function(e,n){var r=e.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<4294967296)this.writeU8(221),this.writeU32(r);else throw new Error("Too large array: ".concat(r));for(var i=0,s=e;i<s.length;i++){var a=s[i];this.doEncode(a,n+1)}},t.prototype.countWithoutUndefined=function(e,n){for(var r=0,i=0,s=n;i<s.length;i++){var a=s[i];e[a]!==void 0&&r++}return r},t.prototype.encodeMap=function(e,n){var r=Object.keys(e);this.sortKeys&&r.sort();var i=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(i<16)this.writeU8(128+i);else if(i<65536)this.writeU8(222),this.writeU16(i);else if(i<4294967296)this.writeU8(223),this.writeU32(i);else throw new Error("Too large map object: ".concat(i));for(var s=0,a=r;s<a.length;s++){var o=a[s],u=e[o];this.ignoreUndefined&&u===void 0||(this.encodeString(o),this.doEncode(u,n+1))}},t.prototype.encodeExtension=function(e){var n=e.data.length;if(n===1)this.writeU8(212);else if(n===2)this.writeU8(213);else if(n===4)this.writeU8(214);else if(n===8)this.writeU8(215);else if(n===16)this.writeU8(216);else if(n<256)this.writeU8(199),this.writeU8(n);else if(n<65536)this.writeU8(200),this.writeU16(n);else if(n<4294967296)this.writeU8(201),this.writeU32(n);else throw new Error("Too large extension object: ".concat(n));this.writeI8(e.type),this.writeU8a(e.data)},t.prototype.writeU8=function(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++},t.prototype.writeU8a=function(e){var n=e.length;this.ensureBufferSizeToWrite(n),this.bytes.set(e,this.pos),this.pos+=n},t.prototype.writeI8=function(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++},t.prototype.writeU16=function(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2},t.prototype.writeI16=function(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2},t.prototype.writeU32=function(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4},t.prototype.writeI32=function(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4},t.prototype.writeF32=function(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4},t.prototype.writeF64=function(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8},t.prototype.writeU64=function(e){this.ensureBufferSizeToWrite(8),XK(this.view,this.pos,e),this.pos+=8},t.prototype.writeI64=function(e){this.ensureBufferSizeToWrite(8),M_(this.view,this.pos,e),this.pos+=8},t.prototype.writeBigUint64=function(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8},t.prototype.writeBigInt64=function(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8},t}();function fY(t,e){var n=new dY(e);return n.encodeSharedRef(t)}function eb(t){return"".concat(t<0?"-":"","0x").concat(Math.abs(t).toString(16).padStart(2,"0"))}var pY=16,hY=16,mY=function(){function t(e,n){e===void 0&&(e=pY),n===void 0&&(n=hY),this.maxKeyLength=e,this.maxLengthPerKey=n,this.hit=0,this.miss=0,this.caches=[];for(var r=0;r<this.maxKeyLength;r++)this.caches.push([])}return t.prototype.canBeCached=function(e){return e>0&&e<=this.maxKeyLength},t.prototype.find=function(e,n,r){var i=this.caches[r-1];e:for(var s=0,a=i;s<a.length;s++){for(var o=a[s],u=o.bytes,c=0;c<r;c++)if(u[c]!==e[n+c])continue e;return o.str}return null},t.prototype.store=function(e,n){var r=this.caches[e.length-1],i={bytes:e,str:n};r.length>=this.maxLengthPerKey?r[Math.random()*r.length|0]=i:r.push(i)},t.prototype.decode=function(e,n,r){var i=this.find(e,n,r);if(i!=null)return this.hit++,i;this.miss++;var s=L_(e,n,r),a=Uint8Array.prototype.slice.call(e,n,n+r);return this.store(a,s),s},t}(),gY=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(a){a(s)})}return new(n||(n=Promise))(function(s,a){function o(l){try{c(r.next(l))}catch(d){a(d)}}function u(l){try{c(r.throw(l))}catch(d){a(d)}}function c(l){l.done?s(l.value):i(l.value).then(o,u)}c((r=r.apply(t,e||[])).next())})},tb=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=o(0),a.throw=o(1),a.return=o(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(c){return function(l){return u([c,l])}}function u(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(s=c[0]&2?i.return:c[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,c[1])).done)return s;switch(i=0,s&&(c=[c[0]&2,s.value]),c[0]){case 0:case 1:s=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){n.label=c[1];break}if(c[0]===6&&n.label<s[1]){n.label=s[1],s=c;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(c);break}s[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(l){c=[6,l],i=0}finally{r=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},q_=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=t[s]&&function(a){return new Promise(function(o,u){a=t[s](a),i(o,u,a.done,a.value)})}}function i(s,a,o,u){Promise.resolve(u).then(function(c){s({value:c,done:o})},a)}},Eo=function(t){return this instanceof Eo?(this.v=t,this):new Eo(t)},yY=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),o("next"),o("throw"),o("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(p){return function(h){return Promise.resolve(h).then(p,d)}}function o(p,h){r[p]&&(i[p]=function(y){return new Promise(function(b,w){s.push([p,y,b,w])>1||u(p,y)})},h&&(i[p]=h(i[p])))}function u(p,h){try{c(r[p](h))}catch(y){f(s[0][3],y)}}function c(p){p.value instanceof Eo?Promise.resolve(p.value.v).then(l,d):f(s[0][2],p)}function l(p){u("next",p)}function d(p){u("throw",p)}function f(p,h){p(h),s.shift(),s.length&&u(s[0][0],s[0][1])}},nb="array",Ad="map_key",G_="map_value",wY=function(t){return typeof t=="string"||typeof t=="number"},vY=function(){function t(){this.stack=[],this.stackHeadPosition=-1}return Object.defineProperty(t.prototype,"length",{get:function(){return this.stackHeadPosition+1},enumerable:!1,configurable:!0}),t.prototype.top=function(){return this.stack[this.stackHeadPosition]},t.prototype.pushArrayState=function(e){var n=this.getUninitializedStateFromPool();n.type=nb,n.position=0,n.size=e,n.array=new Array(e)},t.prototype.pushMapState=function(e){var n=this.getUninitializedStateFromPool();n.type=Ad,n.readCount=0,n.size=e,n.map={}},t.prototype.getUninitializedStateFromPool=function(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){var e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]},t.prototype.release=function(e){var n=this.stack[this.stackHeadPosition];if(n!==e)throw new Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===nb){var r=e;r.size=0,r.array=void 0,r.position=0,r.type=void 0}if(e.type===Ad||e.type===G_){var r=e;r.size=0,r.map=void 0,r.readCount=0,r.type=void 0}this.stackHeadPosition--},t.prototype.reset=function(){this.stack.length=0,this.stackHeadPosition=-1},t}(),_d=-1,rb=new DataView(new ArrayBuffer(0)),bY=new Uint8Array(rb.buffer);try{rb.getInt8(0)}catch(t){if(!(t instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var ib=RangeError,j_=new ib("Insufficient data"),DY=new mY,EY=function(){function t(e){var n,r,i,s,a,o,u,c;this.totalPos=0,this.pos=0,this.view=rb,this.bytes=bY,this.headByte=_d,this.stack=new vY,this.extensionCodec=(n=e?.extensionCodec)!==null&&n!==void 0?n:B_.defaultCodec,this.context=e?.context,this.useBigInt64=(r=e?.useBigInt64)!==null&&r!==void 0?r:!1,this.rawStrings=(i=e?.rawStrings)!==null&&i!==void 0?i:!1,this.maxStrLength=(s=e?.maxStrLength)!==null&&s!==void 0?s:Cd,this.maxBinLength=(a=e?.maxBinLength)!==null&&a!==void 0?a:Cd,this.maxArrayLength=(o=e?.maxArrayLength)!==null&&o!==void 0?o:Cd,this.maxMapLength=(u=e?.maxMapLength)!==null&&u!==void 0?u:Cd,this.maxExtLength=(c=e?.maxExtLength)!==null&&c!==void 0?c:Cd,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:DY}return t.prototype.reinitializeState=function(){this.totalPos=0,this.headByte=_d,this.stack.reset()},t.prototype.setBuffer=function(e){this.bytes=pm(e),this.view=uY(this.bytes),this.pos=0},t.prototype.appendBuffer=function(e){if(this.headByte===_d&&!this.hasRemaining(1))this.setBuffer(e);else{var n=this.bytes.subarray(this.pos),r=pm(e),i=new Uint8Array(n.length+r.length);i.set(n),i.set(r,n.length),this.setBuffer(i)}},t.prototype.hasRemaining=function(e){return this.view.byteLength-this.pos>=e},t.prototype.createExtraByteError=function(e){var n=this,r=n.view,i=n.pos;return new RangeError("Extra ".concat(r.byteLength-i," of ").concat(r.byteLength," byte(s) found at buffer[").concat(e,"]"))},t.prototype.decode=function(e){this.reinitializeState(),this.setBuffer(e);var n=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return n},t.prototype.decodeMulti=function(e){return tb(this,function(n){switch(n.label){case 0:this.reinitializeState(),this.setBuffer(e),n.label=1;case 1:return this.hasRemaining(1)?[4,this.doDecodeSync()]:[3,3];case 2:return n.sent(),[3,1];case 3:return[2]}})},t.prototype.decodeAsync=function(e){return gY(this,void 0,void 0,function(){var n,r,i,s,a,o,u,c,l,d,f,p,h,y,b;return tb(this,function(w){switch(w.label){case 0:n=!1,w.label=1;case 1:w.trys.push([1,6,7,12]),l=!0,d=q_(e),w.label=2;case 2:return[4,d.next()];case 3:if(f=w.sent(),p=f.done,!!p)return[3,5];if(b=f.value,l=!1,i=b,n)throw this.createExtraByteError(this.totalPos);this.appendBuffer(i);try{r=this.doDecodeSync(),n=!0}catch(E){if(!(E instanceof ib))throw E}this.totalPos+=this.pos,w.label=4;case 4:return l=!0,[3,2];case 5:return[3,12];case 6:return s=w.sent(),h={error:s},[3,12];case 7:return w.trys.push([7,,10,11]),!l&&!p&&(y=d.return)?[4,y.call(d)]:[3,9];case 8:w.sent(),w.label=9;case 9:return[3,11];case 10:if(h)throw h.error;return[7];case 11:return[7];case 12:if(n){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return[2,r]}throw a=this,o=a.headByte,u=a.pos,c=a.totalPos,new RangeError("Insufficient data in parsing ".concat(eb(o)," at ").concat(c," (").concat(u," in the current buffer)"))}})})},t.prototype.decodeArrayStream=function(e){return this.decodeMultiAsync(e,!0)},t.prototype.decodeStream=function(e){return this.decodeMultiAsync(e,!1)},t.prototype.decodeMultiAsync=function(e,n){return yY(this,arguments,function(){var i,s,a,o,u,c,l,d,f,p,h,y;return tb(this,function(b){switch(b.label){case 0:i=n,s=-1,b.label=1;case 1:b.trys.push([1,13,14,19]),a=!0,o=q_(e),b.label=2;case 2:return[4,Eo(o.next())];case 3:if(u=b.sent(),f=u.done,!!f)return[3,12];if(y=u.value,a=!1,c=y,n&&s===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(c),i&&(s=this.readArraySize(),i=!1,this.complete()),b.label=4;case 4:b.trys.push([4,9,,10]),b.label=5;case 5:return[4,Eo(this.doDecodeSync())];case 6:return[4,b.sent()];case 7:return b.sent(),--s===0?[3,8]:[3,5];case 8:return[3,10];case 9:if(l=b.sent(),!(l instanceof ib))throw l;return[3,10];case 10:this.totalPos+=this.pos,b.label=11;case 11:return a=!0,[3,2];case 12:return[3,19];case 13:return d=b.sent(),p={error:d},[3,19];case 14:return b.trys.push([14,,17,18]),!a&&!f&&(h=o.return)?[4,Eo(h.call(o))]:[3,16];case 15:b.sent(),b.label=16;case 16:return[3,18];case 17:if(p)throw p.error;return[7];case 18:return[7];case 19:return[2]}})})},t.prototype.doDecodeSync=function(){e:for(;;){var e=this.readHeadByte(),n=void 0;if(e>=224)n=e-256;else if(e<192)if(e<128)n=e;else if(e<144){var r=e-128;if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e<160){var r=e-144;if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else{var i=e-160;n=this.decodeString(i,0)}else if(e===192)n=null;else if(e===194)n=!1;else if(e===195)n=!0;else if(e===202)n=this.readF32();else if(e===203)n=this.readF64();else if(e===204)n=this.readU8();else if(e===205)n=this.readU16();else if(e===206)n=this.readU32();else if(e===207)this.useBigInt64?n=this.readU64AsBigInt():n=this.readU64();else if(e===208)n=this.readI8();else if(e===209)n=this.readI16();else if(e===210)n=this.readI32();else if(e===211)this.useBigInt64?n=this.readI64AsBigInt():n=this.readI64();else if(e===217){var i=this.lookU8();n=this.decodeString(i,1)}else if(e===218){var i=this.lookU16();n=this.decodeString(i,2)}else if(e===219){var i=this.lookU32();n=this.decodeString(i,4)}else if(e===220){var r=this.readU16();if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else if(e===221){var r=this.readU32();if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else if(e===222){var r=this.readU16();if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e===223){var r=this.readU32();if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e===196){var r=this.lookU8();n=this.decodeBinary(r,1)}else if(e===197){var r=this.lookU16();n=this.decodeBinary(r,2)}else if(e===198){var r=this.lookU32();n=this.decodeBinary(r,4)}else if(e===212)n=this.decodeExtension(1,0);else if(e===213)n=this.decodeExtension(2,0);else if(e===214)n=this.decodeExtension(4,0);else if(e===215)n=this.decodeExtension(8,0);else if(e===216)n=this.decodeExtension(16,0);else if(e===199){var r=this.lookU8();n=this.decodeExtension(r,1)}else if(e===200){var r=this.lookU16();n=this.decodeExtension(r,2)}else if(e===201){var r=this.lookU32();n=this.decodeExtension(r,4)}else throw new qr("Unrecognized type byte: ".concat(eb(e)));this.complete();for(var s=this.stack;s.length>0;){var a=s.top();if(a.type===nb)if(a.array[a.position]=n,a.position++,a.position===a.size)n=a.array,s.release(a);else continue e;else if(a.type===Ad){if(!wY(n))throw new qr("The type of key must be string or number but "+typeof n);if(n==="__proto__")throw new qr("The key __proto__ is not allowed");a.key=n,a.type=G_;continue e}else if(a.map[a.key]=n,a.readCount++,a.readCount===a.size)n=a.map,s.release(a);else{a.key=null,a.type=Ad;continue e}}return n}},t.prototype.readHeadByte=function(){return this.headByte===_d&&(this.headByte=this.readU8()),this.headByte},t.prototype.complete=function(){this.headByte=_d},t.prototype.readArraySize=function(){var e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new qr("Unrecognized array type byte: ".concat(eb(e)))}}},t.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new qr("Max length exceeded: map length (".concat(e,") > maxMapLengthLength (").concat(this.maxMapLength,")"));this.stack.pushMapState(e)},t.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new qr("Max length exceeded: array length (".concat(e,") > maxArrayLength (").concat(this.maxArrayLength,")"));this.stack.pushArrayState(e)},t.prototype.decodeString=function(e,n){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,n):this.decodeBinary(e,n)},t.prototype.decodeUtf8String=function(e,n){var r;if(e>this.maxStrLength)throw new qr("Max length exceeded: UTF-8 byte length (".concat(e,") > maxStrLength (").concat(this.maxStrLength,")"));if(this.bytes.byteLength<this.pos+n+e)throw j_;var i=this.pos+n,s;return this.stateIsMapKey()&&(!((r=this.keyDecoder)===null||r===void 0)&&r.canBeCached(e))?s=this.keyDecoder.decode(this.bytes,i,e):s=KK(this.bytes,i,e),this.pos+=n+e,s},t.prototype.stateIsMapKey=function(){if(this.stack.length>0){var e=this.stack.top();return e.type===Ad}return!1},t.prototype.decodeBinary=function(e,n){if(e>this.maxBinLength)throw new qr("Max length exceeded: bin length (".concat(e,") > maxBinLength (").concat(this.maxBinLength,")"));if(!this.hasRemaining(e+n))throw j_;var r=this.pos+n,i=this.bytes.subarray(r,r+e);return this.pos+=n+e,i},t.prototype.decodeExtension=function(e,n){if(e>this.maxExtLength)throw new qr("Max length exceeded: ext length (".concat(e,") > maxExtLength (").concat(this.maxExtLength,")"));var r=this.view.getInt8(this.pos+n),i=this.decodeBinary(e,n+1);return this.extensionCodec.decode(i,r,this.context)},t.prototype.lookU8=function(){return this.view.getUint8(this.pos)},t.prototype.lookU16=function(){return this.view.getUint16(this.pos)},t.prototype.lookU32=function(){return this.view.getUint32(this.pos)},t.prototype.readU8=function(){var e=this.view.getUint8(this.pos);return this.pos++,e},t.prototype.readI8=function(){var e=this.view.getInt8(this.pos);return this.pos++,e},t.prototype.readU16=function(){var e=this.view.getUint16(this.pos);return this.pos+=2,e},t.prototype.readI16=function(){var e=this.view.getInt16(this.pos);return this.pos+=2,e},t.prototype.readU32=function(){var e=this.view.getUint32(this.pos);return this.pos+=4,e},t.prototype.readI32=function(){var e=this.view.getInt32(this.pos);return this.pos+=4,e},t.prototype.readU64=function(){var e=JK(this.view,this.pos);return this.pos+=8,e},t.prototype.readI64=function(){var e=z_(this.view,this.pos);return this.pos+=8,e},t.prototype.readU64AsBigInt=function(){var e=this.view.getBigUint64(this.pos);return this.pos+=8,e},t.prototype.readI64AsBigInt=function(){var e=this.view.getBigInt64(this.pos);return this.pos+=8,e},t.prototype.readF32=function(){var e=this.view.getFloat32(this.pos);return this.pos+=4,e},t.prototype.readF64=function(){var e=this.view.getFloat64(this.pos);return this.pos+=8,e},t}();function RY(t,e){var n=new EY(e);return n.decode(t)}const $Y=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]",SY=(t,e=0,n=t.byteLength-e)=>{if(!$Y(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return Hm.from(t,e,n)},U_=(t,e)=>{if(typeof t!="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return e?Hm.from(t,e):Hm.from(t)},TY=/^[A-Za-z0-9+/]*={0,2}$/,kY=t=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!TY.exec(t))throw new TypeError("Invalid base64 string.");const e=U_(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},CY=t=>{const e=U_(t,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT)},AY=t=>{let e;if(typeof t=="string"?e=CY(t):e=t,typeof e!="object"||typeof e.byteOffset!="number"||typeof e.byteLength!="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return SY(e.buffer,e.byteOffset,e.byteLength).toString("base64")},{getDocument:_Y}=hu;function PY({nodes:t,edges:e,...n}){return{...n,nodes:Ku(t,({x:r,y:i,width:s,height:a,isCompound:o,...u})=>({...u,b:[r,i,s,a],c:o})),edges:Ku(e,({points:r,controlPoints:i,labelBBox:s,dotpos:a,...o})=>({...!!i&&{cp:i},...!!s&&{l:s},...!!a&&{dp:a},...o,p:r}))}}function xY({nodes:t,edges:e,autoLayout:n,...r}){return{...r,autoLayout:iN(n)?{direction:n}:n,nodes:Ku(t,({b:i,c:s,...a})=>({x:i[0],y:i[1],width:i[2],height:i[3],isCompound:s,...a})),edges:Ku(e,({p:i,cp:s,l:a,dp:o,...u})=>({...!!s&&{controlPoints:s},...!!a&&{labelBBox:a},...!!o&&{dotpos:o},...u,points:i}))}}const W_=500;function IY(t){const e=fY(PY(t)),n=AY(e),r=[];let i=0;for(;i<n.length;)r.push(" * "+n.slice(i,Math.min(i+W_,n.length))),i+=W_;return r.unshift("/**"," * @likec4-generated(v1)"),r.push(" */"),r.join(`
243
+ `)}function H_(t){return t.includes("@likec4-generated")}function NY(t){if(!H_(t))throw new Error(`Not a likec4-generated comment: ${t}`);const e=t.trim().split(`
244
+ `).filter(r=>!r.includes("**")&&!r.includes("@likec4-")&&!r.includes("*/")).map(r=>r.replaceAll("*","").trim()).join(""),n=kY(e);return xY(RY(n))}function sb(t){const e=tf(t.$cstNode,["BLOCK_COMMENT"]);if(!(!e||!H_(e.text)))try{return NY(e.text)}catch(n){const r=_Y(t);Me.warn(n),Me.warn(`Ignoring manual layout of "${t.name??"unnamed"}" at ${r.uri.fsPath}:${1+(e.range.start.line||0)}`);return}}function OY(t){return class extends t{parseDeploymentView(e){const n=e.body;_e(n,"DynamicElementView body is not defined");const r=n.props.filter(this.isValid),i=this.getAstNodePath(e);let s=e.name;s||(s="deployment_"+kd(this.doc.uri.toString(),i));const a=Br(r.find(d=>d.key==="title")?.value)??null,o=lt(r.find(d=>d.key==="description")?.value)??null,u=this.convertTags(n),c=this.convertLinks(n);om.writeId(e,s);const l=sb(e);return{__:"deployment",id:s,astPath:i,title:a,description:o,tags:u,links:Un(c)?c:null,rules:n.rules.flatMap(d=>{try{return this.isValid(d)?this.parseDeploymentViewRule(d):[]}catch(f){return ve(f),[]}}),...l&&{manualLayout:l}}}parseDeploymentViewRule(e){if(Ka(e))return this.parseDeploymentViewRulePredicate(e);if(Jl(e))return Hv(e);if(oA(e))return this.parseDeploymentViewRuleStyle(e);Ae(e)}parseDeploymentViewRulePredicate(e){const n=[];let r=e.expr;for(;r;){try{const i=r.value;if(on(i)&&this.isValid(i))switch(!0){case c4(i):n.unshift(this.parseFqnExpr(i));break;case x4(i):n.unshift(this.parseElementWhereExpr(i));break;case tA(i):n.unshift(this.parseRelationExpr(i));break;case z4(i):n.unshift(this.parseRelationWhereExpr(i));break;default:Ae(i)}}catch(i){ve(i)}r=r.prev}return e.isInclude?{include:n}:{exclude:n}}parseDeploymentViewRuleStyle(e){const n=e.props.filter(Ow),r=e.props.find(so),i=lt(r?.value);return{targets:this.parseFqnExpressions(e.targets),...i&&{notation:i},style:{...Ji(n,this.isValid)}}}}}function FY(t){let e;for(;e=t.value?.ref;){if(Dn(e))return null;if(hr(e))return e;if(Dt(t.parent))return null;t=t.parent}return null}const V_=({operator:t,not:e},n)=>t.startsWith("!=")?{neq:n}:t.startsWith("=")?{eq:n}:e?{neq:n}:{eq:n};function K_(t){return!CA(t)&&!AA(t)?null:t.participant}function la(t){switch(!0){case b4(t):{const e=t.value?.ref?.name,n=K_(t);_e(e,"Expected tag name");const r={tag:V_(t,e)};return n?{participant:n,operator:r}:r}case w4(t):{const e=t.value?.ref?.name,n=K_(t);_e(e,"Expected kind name");const r={kind:V_(t,e)};return n?{participant:n,operator:r}:r}case(SA(t)||kA(t)):return{not:la(t.value)};case G4(t):{const e=la(t.left),n=la(t.right),r=t.operator.toLowerCase();switch(r){case"and":{const i=[MD(e)?e.and:e,MD(n)?n.and:n].flat();return _e(Un(i),"Expected non-empty array"),{and:i}}case"or":{const i=[LD(e)?e.or:e,LD(n)?n.or:n].flat();return _e(Un(i),"Expected non-empty array"),{or:i}}default:Ae(r)}}default:Ae(t)}}function LY(t){return class extends t{parseFqnRef(e){const n=pn(e.value.ref,`FqnRef is empty ${e.$cstNode?.range.start.line}:${e.$cstNode?.range.start.character}`);if(qn(n)){const r=FY(e);if(!r)return{model:this.resolveFqn(n)};const i=this.resolveFqn(r),s=this.resolveFqn(n);return{deployment:i,element:s}}if(eA(n))return{deployment:this.resolveFqn(n)};Ae(n)}parseFqnExpr(e){if(na(e))return{wildcard:!0};if(Hw(e))return this.parseFqnRefExpr(e);Ae(e)}parseFqnRefExpr(e){const n=this.parseFqnRef(e.ref);switch(!0){case e.selector==="._":return{ref:n,selector:"expanded"};case e.selector===".**":return{ref:n,selector:"descendants"};case e.selector===".*":return{ref:n,selector:"children"};default:return{ref:n}}}parseElementWhereExpr(e){return{where:{expr:this.parseFqnExpr(e.subject),condition:e.where?la(e.where):{kind:{neq:"--always-true--"}}}}}parseFqnExpressions(e){const n=[];let r=e;for(;r;){try{on(r.value)&&this.isValid(r.value)&&n.push(this.parseFqnExpr(r.value))}catch(i){ve(i)}r=r.prev}return n.reverse()}parseRelationWhereExpr(e){return{where:{expr:this.parseRelationExpr(e.subject),condition:e.where?la(e.where):{kind:{neq:"--always-true--"}}}}}parseRelationExpr(e){if(ev(e),Mw(e))return{source:this.parseFqnExpr(e.source.from),target:this.parseFqnExpr(e.target),isBidirectional:e.source.isBidirectional};if(gA(e))return{inout:this.parseFqnExpr(e.inout.to)};if(Jw(e))return{outgoing:this.parseFqnExpr(e.from)};if(Kw(e))return{incoming:this.parseFqnExpr(e.to)};Ae(e)}}}function MY(t){return class extends t{parseGlobals(){const{parseResult:e,c4Globals:n}=this.doc,r=this.isValid,i=e.value.globals.filter(r),s=i.flatMap(o=>o.predicates.filter(r));for(const o of s)try{const u=o.name;if(!ie(u))continue;if(u in n.predicates){Me.warn(`Global predicate named "${u}" is already defined`);continue}this.parseAndStoreGlobalPredicateGroupOrDynamic(o,u,n)}catch(u){ve(u)}const a=i.flatMap(o=>o.styles.filter(r));for(const o of a)try{const u=o.id.name;if(!ie(u))continue;if(u in n.styles){Me.warn(`Global style named "${u}" is already defined`);continue}const c=this.parseGlobalStyleOrGroup(o);c.length>0&&(n.styles[u]=c)}catch(u){ve(u)}}parseAndStoreGlobalPredicateGroupOrDynamic(e,n,r){if(gl(e)){const i=this.parseGlobalPredicateGroup(e);i.length>0&&(r.predicates[n]=i);return}if(ml(e)){const i=this.parseGlobalDynamicPredicateGroup(e);i.length>0&&(r.dynamicPredicates[n]=i);return}Ae(e)}parseGlobalPredicateGroup(e){return e.predicates.map(n=>this.parseViewRulePredicate(n))}parseGlobalDynamicPredicateGroup(e){return e.predicates.map(n=>this.parseDynamicViewIncludePredicate(n))}parseGlobalStyleOrGroup(e){if(to(e))return[this.parseViewRuleStyle(e)];if(ea(e))return e.styles.map(n=>this.parseViewRuleStyle(n));Ae(e)}}}function zY(t){return class extends t{parseModel(){const e=this.doc;for(const n of m5(e))try{if(qn(n)){e.c4Elements.push(this.parseElement(n));continue}if(Lr(n)){this.isValid(n)&&e.c4Relations.push(this.parseRelation(n));continue}if(Ja(n)){const r=this.parseExtendElement(n);r&&e.c4ExtendElements.push(r);continue}Ae(n)}catch(r){ve(r)}}parseElement(e){const n=this.isValid,r=this.resolveFqn(e),i=pn(e.kind.ref,"Element kind is not resolved").name,s=this.parseTags(e.body),a=e.body?.props.find(Gi)?.props,o=Ji(a,n),u=this.getMetadata(e.body?.props.find(Xs)),c=this.getAstNodePath(e);let[l,d,f]=e.props??[];const p=Qe(e.body?.props??[],je(n),je(ul),Or(b=>[b.key,b.value||void 0]));l=lt(l??p.title),d=lt(p.description??d),f=Br(p.technology??f);const h=this.parseLinks(e.body),y=e.body?.props.find(Fr);if(y&&n(y)){const b=y.libicon?.ref?.name??y.value;ie(b)&&(o.icon=b)}return{id:r,kind:i,astPath:c,title:l??e.name,...u&&{metadata:u},...s&&{tags:s},...h&&Un(h)&&{links:h},...ie(f)&&{technology:f},...ie(d)&&{description:d},style:o}}parseExtendElement(e){this.isValid;const n=this.resolveFqn(e),r=this.parseTags(e.body),i=this.getMetadata(e.body?.props.find(Xs)),s=this.getAstNodePath(e),a=this.parseLinks(e.body)??[];return!r&&Qn(i??{})&&Qn(a)?null:{id:n,astPath:s,...i&&{metadata:i},...r&&{tags:r},...a&&Un(a)&&{links:a}}}parseRelation(e){const n=this.isValid,r=y5(e),i=this.resolveFqn(r.target),s=this.resolveFqn(r.source),a=this.parseTags(e)??this.parseTags(e.body),o=this.parseLinks(e.body),u=e.kind?.ref?.name,c=this.getMetadata(e.body?.props.find(Xs)),l=this.getAstNodePath(e),d=Or(e.body?.props.filter(jl).filter(w=>on(w.value))??[],w=>[w.key,w.value]),f=Qe(e.body?.props??[],je(Ml),an(w=>w.value.view.ref?.name),je(ie),Ua()),p=lt(e.title??d.title)??"",h=lt(d.description),y=Br(e.technology)??lt(d.technology),b=e.body?.props.find(Ih);return{id:kd(l,s,i),astPath:l,source:s,target:i,title:p,...c&&{metadata:c},...ie(y)&&{technology:y},...ie(h)&&{description:h},...u&&{kind:u},...a&&{tags:a},...Un(o)&&{links:o},...Wv(b?.props,n),...f&&{navigateTo:f}}}}}function BY(t){return class extends t{parsePredicate(e){if(i4(e))return this.parseElementPredicate(e);if(d4(e))return this.parseRelationPredicate(e);Ae(e)}parseElementPredicate(e){if(hh(e))return this.parseElementPredicateWith(e);if(Uw(e))return this.parseElementPredicateWhere(e);if(kw(e))return this.parseElementExpression(e);Ae(e)}parseElementExpressionsIterator(e){const n=[];let r=e;for(;r;){try{r.value&&n.unshift(this.parseElementExpression(r.value))}catch(i){ve(i)}r=r.prev}return n}parseElementExpression(e){if(na(e))return{wildcard:!0};if(ph(e))return _e(e.kind?.ref,"ElementKindExpr kind is not resolved: "+e.$cstNode?.text),{elementKind:e.kind.ref.name,isEqual:e.isEqual};if(mh(e)){_e(e.tag?.ref,"ElementTagExpr tag is not resolved: "+e.$cstNode?.text);let n=e.tag.$refText;return n.startsWith("#")&&(n=n.slice(1)),{elementTag:n,isEqual:e.isEqual}}if(fA(e)){const n=Rn(e.expand);return _e(n,"Element not found "+e.expand.$cstNode?.text),{expanded:this.resolveFqn(n)}}if(jw(e)){const n=Rn(e.parent);return _e(n,"Element not found "+e.parent.$cstNode?.text),{element:this.resolveFqn(n),isChildren:e.suffix===".*",isDescendants:e.suffix===".**"}}if(al(e)){const n=Rn(e);return _e(n,"Element not found "+e.$cstNode?.text),{element:this.resolveFqn(n)}}Ae(e)}parseElementPredicateWhere(e){return{where:{expr:this.parseElementExpression(e.subject),condition:e.where?la(e.where):{kind:{neq:"--always-true--"}}}}}parseElementPredicateWith(e){const n=this.parseElementPredicate(e.subject);return(e.custom?.props??[]).reduce((r,i)=>{if(!this.isValid(i))return r;if(Ch(i)){const s=i.value.view.$refText;return ie(s)&&(r.custom.navigateTo=s),r}if(ul(i))return Qt(i.value)&&(r.custom[i.key]=lt(i.value)||""),r;if(Fr(i)){const s=i.libicon?.ref?.name??i.value;return Qt(s)&&(r.custom[i.key]=s),r}if(Js(i)){const s=Td(i);return Qt(s)&&(r.custom[i.key]=s),r}if(Nh(i)||Qp(i))return Qt(i.value)&&(r.custom[i.key]=i.value),r;if(Ah(i))return Qt(i.value)&&(r.custom[i.key]=C_(i)),r;if(so(i))return ie(i.value)&&(r.custom[i.key]=lt(i.value)),r;if(Xw(i))return nw(i.value)&&(r.custom[i.key]=i.value),r;if(nv(i)||av(i)||Zw(i))return ie(i.value)&&(r.custom[i.key]=Do(i)),r;Ae(i)},{custom:{expr:n}})}parseRelationPredicate(e){if(tv(e)){let n=ev(e.subject)?this.parseRelationPredicateWhere(e.subject):this.parseRelationExpression(e.subject);return this.parseRelationPredicateWith(e,n)}if(ev(e))return this.parseRelationPredicateWhere(e);if(Iw(e))return this.parseRelationExpression(e);Ae(e)}parseRelationPredicateWhere(e){return{where:{expr:this.parseRelationExpression(e.subject),condition:e.where?la(e.where):{kind:{neq:"--always-true--"}}}}}parseRelationPredicateWith(e,n){return(e.custom?.props??[]).reduce((r,i)=>{if(jl(i)||so(i)||bA(i))return Qt(i.value)&&(r.customRelation[i.key]=lt(i.value)??""),r;if(jc(i))return ie(i.value)&&(r.customRelation[i.key]=i.value),r;if(Js(i)){const s=Td(i);return ie(s)&&(r.customRelation[i.key]=s),r}if(Sl(i))return ie(i.value)&&(r.customRelation[i.key]=i.value),r;if(Ml(i)){const s=i.value.view.ref?.name;return ie(s)&&(r.customRelation.navigateTo=s),r}Ae(i)},{customRelation:{relation:n}})}parseRelationExpression(e){if(zw(e))return{source:this.parseElementExpression(e.source.from),target:this.parseElementExpression(e.target),isBidirectional:e.source.isBidirectional};if(Yw(e))return{inout:this.parseElementExpression(e.inout.to)};if(Qw(e))return{outgoing:this.parseElementExpression(e.from)};if(mA(e))return{incoming:this.parseElementExpression(e.to)};Ae(e)}}}function qY(t){return class extends t{parseSpecification(){const{parseResult:{value:{specifications:e}},c4Specification:n}=this.doc,r=this.isValid,i=e.flatMap(c=>c.elements.filter(this.isValid));for(const{kind:c,props:l}of i)try{const d=c.name;if(!ie(d))continue;if(d in n.elements){Me.warn(`Element kind "${d}" is already defined`);continue}const f=l.find(Gi),p=Qe(l.filter(rv)??[],je(h=>this.isValid(h)&&on(h.value)),Or(h=>[h.key,lt(h.value)]));n.elements[d]={...p,style:{...Ji(f?.props,this.isValid)}}}catch(d){ve(d)}const s=e.flatMap(c=>c.relationships.filter(this.isValid));for(const{kind:c,props:l}of s)try{const d=c.name;if(!ie(d))continue;if(d in n.relationships){Me.warn(`Relationship kind "${d}" is already defined`);continue}const f=Qe(l.filter(EA)??[],je(p=>this.isValid(p)&&on(p.value)),Or(p=>[p.key,lt(p.value)]));n.relationships[d]={...f,...Wv(l,this.isValid)}}catch(d){ve(d)}const a=e.flatMap(c=>c.tags.filter(this.isValid));for(const c of a){const l=c.tag.name;ie(l)&&n.tags.add(l)}const o=e.flatMap(c=>c.deploymentNodes.filter(r));for(const c of o)try{Object.assign(n.deployments,this.parseSpecificationDeploymentNodeKind(c))}catch(l){ve(l)}const u=e.flatMap(c=>c.colors.filter(r));for(const{name:c,color:l}of u)try{const d=c.name;if(d in n.colors){Me.warn(`Custom color "${d}" is already defined`);continue}n.colors[d]={color:l}}catch(d){ve(d)}}parseSpecificationDeploymentNodeKind({kind:e,props:n}){const r=e.name;if(!ie(r))throw new Error("DeploymentNodeKind name is not resolved");const i=n.find(Gi),s=Qe(n.filter(rv)??[],je(a=>this.isValid(a)&&on(a.value)),Or(a=>[a.key,lt(a.value)]));return{[r]:{...s,style:{...Ji(i?.props,this.isValid)}}}}}}function GY(t){return class extends t{parseViews(){const e=this.isValid;for(const n of this.doc.parseResult.value.views){const r=n.styles.flatMap(i=>{try{return e(i)?this.parseViewRuleStyleOrGlobalRef(i):[]}catch(s){return ve(s),[]}});for(const i of n.views)try{if(!e(i))continue;switch(!0){case gh(i):this.doc.c4Views.push(this.parseElementView(i,r));break;case uA(i):this.doc.c4Views.push(this.parseDynamicElementView(i,r));break;case Lw(i):this.doc.c4Views.push(this.parseDeploymentView(i));break;default:Ae(i)}}catch(s){ve(s)}}}parseElementView(e,n){const r=e.body;_e(r,"ElementView body is not defined");const i=this.getAstNodePath(e);let s=null;if("viewOf"in e){const p=Rn(e.viewOf),h=p&&this.resolveFqn(p);h?s=h:Me.warn("viewOf is not resolved: "+e.$cstNode?.text)}let a=e.name;a||(a="view_"+kd(this.doc.uri.toString(),i,s??""));const o=Br(r.props.find(p=>p.key==="title")?.value)??null,u=lt(r.props.find(p=>p.key==="description")?.value)??null,c=this.convertTags(r),l=this.convertLinks(r),d=sb(e),f={__:"element",id:a,astPath:i,title:o,description:u,tags:c,links:Un(l)?l:null,rules:[...n,...r.rules.flatMap(p=>{try{return this.isValid(p)?this.parseViewRule(p):[]}catch(h){return ve(h),[]}})],...s&&{viewOf:s},...d&&{manualLayout:d}};if(om.writeId(e,f.id),"extends"in e){const p=e.extends.view.ref;return _e(p?.name,"view extends is not resolved: "+e.$cstNode?.text),Object.assign(f,{extends:p.name})}return f}parseViewRule(e){if(Kp(e))return this.parseViewRulePredicate(e);if(uv(e))return this.parseViewRuleGlobalPredicateRef(e);if(Fw(e))return this.parseViewRuleStyleOrGlobalRef(e);if(Jl(e))return Hv(e);if(Bh(e))return this.parseViewRuleGroup(e);Ae(e)}parseViewRulePredicate(e){const n=[];let r=e.predicates;for(;r;){const{value:i,prev:s}=r;try{ie(i)&&this.isValid(i)&&n.unshift(this.parsePredicate(i))}catch(a){ve(a)}if(!s)break;r=s}return Rh(e)?{include:n}:{exclude:n}}parseViewRuleGlobalPredicateRef(e){return{predicateId:e.predicate.$refText}}parseViewRuleStyleOrGlobalRef(e){if(nd(e))return this.parseViewRuleStyle(e);if(cv(e))return this.parseViewRuleGlobalStyle(e);Ae(e)}parseViewRuleGroup(e){const n=[];for(const r of e.groupRules)try{if(!this.isValid(r))continue;if(Kp(r)){n.push(this.parseViewRulePredicate(r));continue}if(Bh(r)){n.push(this.parseViewRuleGroup(r));continue}Ae(r)}catch(i){ve(i)}return{title:Br(e.title)??null,groupRules:n,...Ji(e.props,this.isValid)}}parseViewRuleStyle(e){const n=e.props.filter(Ow),r=e.target,i=e.props.find(so);return this.parseRuleStyle(n,r,i)}parseRuleStyle(e,n,r){const i=Ji(e,this.isValid),s=lt(r?.value);return{targets:this.parseElementExpressionsIterator(n),...s&&{notation:s},style:{...i}}}parseViewRuleGlobalStyle(e){return{styleId:e.style.$refText}}parseDynamicElementView(e,n){const r=e.body;_e(r,"DynamicElementView body is not defined");const i=this.isValid,s=r.props.filter(i),a=this.getAstNodePath(e);let o=e.name;o||(o="dynamic_"+kd(this.doc.uri.toString(),a));const u=Br(s.find(p=>p.key==="title")?.value)??null,c=lt(s.find(p=>p.key==="description")?.value)??null,l=this.convertTags(r),d=this.convertLinks(r);om.writeId(e,o);const f=sb(e);return{__:"dynamic",id:o,astPath:a,title:u,description:c,tags:l,links:Un(d)?d:null,rules:[...n,...r.rules.flatMap(p=>{try{return i(p)?this.parseDynamicViewRule(p):[]}catch(h){return ve(h),[]}},[])],steps:r.steps.reduce((p,h)=>{try{i(h)&&(Bw(h)?p.push(this.parseDynamicParallelSteps(h)):p.push(this.parseDynamicStep(h)))}catch(y){ve(y)}return p},[]),...f&&{manualLayout:f}}}parseDynamicViewRule(e){if(A4(e))return this.parseDynamicViewIncludePredicate(e);if(cA(e))return this.parseViewRuleGlobalPredicateRef(e);if(Fw(e))return this.parseViewRuleStyleOrGlobalRef(e);if(Jl(e))return Hv(e);Ae(e)}parseDynamicViewIncludePredicate(e){const n=[];let r=e.predicates;for(;r;){try{if(on(r.value)&&this.isValid(r.value)){const i=this.parseElementPredicate(r.value);n.unshift(i)}}catch(i){ve(i)}r=r.prev}return{include:n}}parseDynamicParallelSteps(e){return{__parallel:e.steps.map(n=>this.parseDynamicStep(n))}}parseDynamicStep(e){const n=Rn(e.source);if(!n)throw new Error("Invalid reference to source");const r=Rn(e.target);if(!r)throw new Error("Invalid reference to target");let i=this.resolveFqn(n),s=this.resolveFqn(r);const a=lt(e.title)??null;let o={source:i,target:s,title:a};if(e.isBackward&&(o={source:s,target:i,title:a,isBackward:!0}),!Aj(e.custom?.props))return o;for(const u of e.custom.props)try{switch(!0){case Ml(u):{const c=u.value.view.ref?.name;ie(c)&&(o.navigateTo=c);break}case jl(u):case so(u):case bA(u):{Qt(u.value)&&(o[u.key]=lt(u.value)??"");break}case jc(u):{Qt(u.value)&&(o[u.key]=u.value);break}case Js(u):{const c=Td(u);Qt(c)&&(o[u.key]=c);break}case Sl(u):{Qt(u.value)&&(o[u.key]=u.value);break}default:Ae(u)}}catch(c){ve(c)}return o}}}const jY=Qe(FK,LY,zY,LK,OY,BY,qY,GY,MY);class UY extends jY{}class WY{constructor(e){this.services=e,this.cachedParsers=new gT(e.shared,We.Validated)}cachedParsers;parse(e){_e(Uv(e),`Not a FqnIndexedDocument: ${e.uri.toString(!0)}`);try{e=Object.assign(e,{c4Specification:{tags:new Set,elements:{},relationships:{},colors:{},deployments:{}},c4Elements:[],c4ExtendElements:[],c4Relations:[],c4Deployments:[],c4DeploymentRelations:[],c4Globals:{predicates:{},dynamicPredicates:{},styles:{}},c4Views:[]});const n=this.forDocument(e);return n.parseSpecification(),n.parseModel(),n.parseGlobals(),n.parseDeployment(),n.parseViews(),n.doc}catch(n){throw new Error(`Error parsing document ${e.uri.toString()}`,{cause:n})}}forDocument(e){return _e(Uv(e),`Not a FqnIndexedDocument: ${e.uri.toString(!0)}`),this.cachedParsers.get(e.uri,"DocumentParser",()=>new UY(this.services,e))}}const{findNodeForKeyword:HY}=Df,VY=(t,e,n=0)=>{const r=n>0?" ".repeat(n):"";return[r+`style ${t} {`,...kp(e).map(([i,s])=>r+` ${i} ${i==="opacity"?s.toString()+"%":s}`),r+"}"]},KY=(t,e)=>n=>{if(!nd(n))return!1;const r=n.target.value;if(!r||ie(n.target.prev)||!al(r))return!1;const i=r.el.ref;return(i?e.getFqn(i):null)===t};function YY(t,{view:e,viewAst:n,targets:r,style:i}){_e(n.body,`View ${e.id} has no body`);const s=n.$cstNode;_e(s,"viewCstNode");const a=Yu(n.body.rules)?.$cstNode?.range.end??n.body.$cstNode?.range.end;_e(a,"insertPos is not defined");const o=s.range.start.character+2,u=t.likec4.FqnIndex,c=je(n.body.rules,nd),l=e.__==="element"?e.viewOf:null,d=[],f=[];r.forEach(b=>{const w=WT(c,KY(b,u)),E=l&&Um(l,b)?b.substring(l.length+1):b;w?d.push({fqn:E,rule:w}):f.push({fqn:E})});const p={start:a,end:a},h=b=>{b.start.line<=p.start.line&&(b.start.line==p.start.line?p.start.character=Math.min(b.start.character,p.start.character):p.start=b.start),b.end.line>=p.end.line&&(b.end.line==p.end.line?p.end.character=Math.max(b.end.character,p.end.character):p.end=b.end)},y=[];if(f.length>0){const b=f.flatMap(({fqn:w})=>VY(w,i,o));y.push(Pn.insert(a,`
245
+ `+b.join(`
246
+ `))),p.start={line:a.line+1,character:o},p.end={line:a.line+b.length,character:Yu(b)?.length??0}}if(d.length>0)for(const{rule:b}of d){const w=b.$cstNode;_e(w,"RuleCstNode not found");for(const[E,$]of kp(i)){const k=E==="opacity"?$.toString()+"%":$,A=b.props.find(Q=>Q.key===E);if(A&&A.$cstNode){const{range:{start:Q,end:ae}}=A.$cstNode;h({start:Q,end:ae}),y.push(Pn.replace({start:Q,end:ae},E+" "+k));continue}const I=HY(w,"{")?.range.end;_e(I,"Opening brace not found");const M=" ".repeat(2+w.range.start.character),Y=M+E+" "+k;y.push(Pn.insert(I,`
247
+ `+Y)),h({start:{line:I.line+1,character:M.length},end:{line:I.line+1,character:Y.length}})}}return{modifiedRange:p,edits:y}}const{findNodeForKeyword:XY}=Df;function JY(t,{view:e,viewAst:n,layout:r}){_e(n.body,`View ${e.id} has no body`);const i=n.$cstNode;_e(i,"viewCstNode");const s=v5(r.direction),a=WT(n.body.rules,Jl);let o=`autoLayout ${s}`;if(Sp(r.rankSep)&&(o+=` ${r.rankSep}`,Sp(r.nodeSep)&&(o+=` ${r.nodeSep}`)),a&&a.$cstNode)return Pn.replace(a.$cstNode.range,o);const u=XY(n.body.$cstNode,"}")?.range.start;_e(u,"Closing brace not found");const c=` ${o}
248
+ `;return Pn.insert(u,c)}function QY(t,e=1,n={}){const{indent:r=" ",includeEmptyLines:i=!1}=n;if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``);if(typeof e!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof e}\``);if(e<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${e}\``);if(typeof r!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r}\``);if(e===0)return t;const s=i?/^/gm:/^(?!\s*$)/gm;return t.replace(s,r.repeat(e))}function ZY(t,{viewAst:e,layout:n}){_e(e.$cstNode,"invalid view.$cstNode");const r=tf(e.$cstNode,["BLOCK_COMMENT"]);let i=IY(n);return e.$cstNode.range.start.character>0&&(i=QY(i,e.$cstNode.range.start.character)),r?Pn.replace(r.range,i.trimStart()):Pn.insert({line:e.$cstNode.range.start.line,character:0},i+`
249
+ `)}class eX{constructor(e){this.services=e,this.locator=e.likec4.ModelLocator}locator;async applyChange(e){const n=this.services.shared.lsp.Connection;_e(n,"LSP Connection not available");let r=null;try{await this.services.shared.workspace.WorkspaceLock.write(async()=>{const{doc:i,edits:s,modifiedRange:a}=this.convertToTextEdit(e),o={uri:i.textDocument.uri,version:i.textDocument.version};if(!s.length)return;const u=await n.workspace.applyEdit({label:`LikeC4 - change view ${e.viewId}`,edit:{changes:{[o.uri]:s}}});if(!u.applied){n.window.showErrorMessage(`Failed to apply changes ${u.failureReason}`);return}r={uri:o.uri,range:a}})}catch(i){zt.error(`Failed to apply change ${e.change.op} ${e.viewId}`,i)}return r}convertToTextEdit({viewId:e,change:n}){const r=this.locator.locateViewAst(e);if(!r)throw new Error(`LikeC4ModelChanges: view not found: ${e}`);switch(n.op){case"change-element-style":return{doc:r.doc,...YY(this.services,{...r,targets:n.targets,style:n.style})};case"change-autolayout":{const s=JY(this.services,{...r,layout:n.layout});return{doc:r.doc,modifiedRange:s.range,edits:[s]}}case"save-manual-layout":const i=ZY(this.services,{...r,layout:n.layout});return{doc:r.doc,modifiedRange:i.range,edits:[i]};default:Ae(n)}}}class tX extends lT{constructor(e){super(),this.services=e}getNameStrict(e){return pn(this.getName(e),`Failed getName for ${this.services.workspace.AstNodeLocator.getAstNodePath(e)}`)}getName(e){if(vp(e))return e.name;if(hr(e))return e.element.el.$refText}getNameNode(e){if(vp(e))return super.getNameNode(e);if(hr(e))return e.element.el.$refNode}}function nX(t){return Qe(t,Ps(e=>`${e.type}.${e.name}`),kp(),Fi(([e,n])=>n.length===1?n:[]))}class rX extends fT{constructor(e){super(e)}async computeExports(e,n){const r=[];try{const{specifications:i,models:s,views:a,globals:o,likec4lib:u,deployments:c}=e.parseResult.value;this.exportLibrary(u,r,e),this.exportSpecification(i,r,e),this.exportModel(s,r,e),this.exportViews(a,r,e),this.exportGlobals(o,r,e),this.exportDeployments(c,r,e)}catch(i){ve(i)}return r}exportViews(e,n,r){const i=e?.flatMap(s=>s.views);if(!(Dt(i)||i.length===0))for(const s of i)try{ie(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(a){ve(a)}}exportGlobals(e,n,r){if(!(Dt(e)||e.length===0)){for(const i of e.flatMap(s=>s.predicates))try{const s=i;ie(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(s){ve(s)}for(const i of e.flatMap(s=>s.styles))try{const s=i.id;ie(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(s){ve(s)}}}exportModel(e,n,r){if(!(Dt(e)||e.length===0))for(const i of e.flatMap(s=>s.elements))try{qn(i)&&ie(i.name)&&n.push(this.descriptions.createDescription(i,i.name,r))}catch(s){ve(s)}}exportLibrary(e,n,r){if(!Dt(e))try{for(const i of e.flatMap(s=>s.icons))n.push(this.descriptions.createDescription(i,i.name,r))}catch(i){ve(i)}}exportSpecification(e,n,r){if(!(Dt(e)||e.length===0))for(const i of e.flatMap(s=>[...s.elements,...s.relationships,...s.deploymentNodes,...s.tags,...s.colors]))try{switch(!0){case oo(i):case co(i):{ie(i.kind.name)&&n.push(this.descriptions.createDescription(i.kind,i.kind.name,r));continue}case Lh(i):{ie(i.tag.name)&&n.push(this.descriptions.createDescription(i.tag,"#"+i.tag.name,r));continue}case fo(i):{ie(i.kind.name)&&n.push(this.descriptions.createDescription(i.kind,i.kind.name,r),this.descriptions.createDescription(i.kind,"."+i.kind.name,r));continue}case Fh(i):{ie(i.name.name)&&n.push(this.descriptions.createDescription(i.name,i.name.name,r));continue}default:Ae(i)}}catch(s){ve(s)}}exportDeployments(e,n,r){const i=e?.flatMap(s=>s.elements);if(!(Dt(i)||i.length===0))for(const s of i)try{Dn(s)&&ie(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(a){ve(a)}}computeLocalScopes(e,n){return new Promise(r=>{const i=e.parseResult.value,s=[],a=new Mn;for(const o of i.models)try{s.push(...this.processContainer(o,a,e))}catch(u){ve(u)}for(const o of i.deployments)try{s.push(...this.processDeployments(o,a,e))}catch(u){ve(u)}nX(s).forEach(o=>{a.add(i,o)}),r(a)})}processContainer(e,n,r){const i=new Mn,s=[];for(const o of e.elements){if(Lr(o))continue;let u;if(qn(o)?(ie(o.name)&&i.add(o.name,this.descriptions.createDescription(o,o.name,r)),u=o.body):Ja(o)&&(u=o.body),u&&u.elements.length>0)try{s.push(...this.processContainer(u,n,r))}catch(c){ve(c)}}s.length&&Qe(s,je(o=>!i.has(o.name)),Ps(o=>o.name),Tp((o,u)=>{o.length===1&&i.add(u,o[0])}));const a=[...i.values()];return n.addAll(e,a),a}processDeployments(e,n,r){const i=new Set,s=[];for(const a of e.elements){if(qi(a))continue;let o=this.nameProvider.getName(a);if(ie(o)){const u=this.descriptions.createDescription(a,o,r);n.add(e,u),i.add(u.name)}if(Dn(a)&&a.body)try{s.push(...this.processDeployments(a.body,n,r))}catch(u){ve(u)}}return s.length>0&&Qe(s,je(a=>!i.has(a.name)),Ps(a=>a.name),Tp((a,o)=>{a.length===1&&n.add(e,a[0])})),[...n.get(e).values()]}}const{getDocument:iX}=hu;class sX extends wT{deploymentsIndex;fqnIndex;constructor(e){super(e),this.fqnIndex=e.likec4.FqnIndex,this.deploymentsIndex=e.likec4.DeploymentsIndex}directChildrenOf(e){return this.fqnIndex.directChildrenOf(e)}uniqueDescedants(e){return new Ot(()=>{const n=e(),r=n&&this.fqnIndex.getFqn(n);return r?this.fqnIndex.uniqueDescedants(r).iterator():null},n=>n?n.next():tn)}scopeElementRef(e){return this.uniqueDescedants(()=>e.el.ref)}scopeExtendElement({element:e}){return rt([e.el.$nodeDescription]).nonNullable().concat(this.uniqueDescedants(()=>Rn(e)))}scopeElementView({viewOf:e,extends:n}){return e?rt([e.el.$nodeDescription]).nonNullable().concat(this.uniqueDescedants(()=>Rn(e))):n?rt([n]).flatMap(r=>{const i=r.view.ref;return i?this.scopeElementView(i):$a}):$a}getScope(e){try{const n=this.reflection.getReferenceType(e);try{const r=e.container;if(hA(r))return this.getScopeForFqnRef(r,e);if(n!==Zn)return this.getGlobalScope(n,e);if(RA(r)&&e.property==="el"){const i=r.parent;return i?new As(this.directChildrenOf(am(i))):this.getGlobalScope(n,e)}if(al(r)&&e.property==="el"){const i=r.parent;if(i)return new As(this.scopeElementRef(i));if(e.reference.$refText==="this"||e.reference.$refText==="it"){const s=rn(r,qn);return s?new pT([this.descriptions.createDescription(s,e.reference.$refText)]):bp}}return this.computeScope(e)}catch(r){return Me.warn(r),this.getGlobalScope(n,e)}}catch(n){return Me.warn(n),bp}}getScopeForFqnRef(e,n){const r=e.parent;if(!r)return this.createScope(this.computeScope(n,zi).getAllElements(),this.createScope(this.computeScope(n,Mi).getAllElements(),Ci(e,Lw)?this.computeScope(n,Zn):bp));const i=r.value.ref;return i?Dn(i)?new As(this.deploymentsIndex.nested(i)):hr(i)?new As(this.scopeElementRef(i.element)):qn(i)?new As(this.uniqueDescedants(()=>i)):Ae(i):bp}computeScope(e,n=this.reflection.getReferenceType(e)){const r=this.reflection.isSubtype(n,Zn),i=[],s=iX(e.container).precomputedScopes;if(!s)return this.getGlobalScope(n,e);const a=u=>this.reflection.isSubtype(u.type,n);let o=e.container;for(;o;){const u=s.get(o).filter(a);u.length>0&&i.push(rt(u)),r&&pA(o)&&i.push(this.scopeExtendElement(o.$container)),r&&dA(o)&&i.push(this.scopeElementView(o.$container)),o=o.$container}return i.reduceRight((u,c)=>this.createScope(c,u),this.getGlobalScope(n,e))}}const aX=`likec4lib { icons {
250
+ aws:activate
251
+ aws:alexa-for-business
252
+ aws:amplify
253
+ aws:apache-mxnet-on-aws
254
+ aws:api-gateway
255
+ aws:app-config
256
+ aws:app-flow
257
+ aws:app-mesh
258
+ aws:app-runner
259
+ aws:app-stream
260
+ aws:app-sync
261
+ aws:application-auto-scaling
262
+ aws:application-composer
263
+ aws:application-cost-profiler
264
+ aws:application-discovery-service
265
+ aws:application-migration-service
266
+ aws:artifact
267
+ aws:athena
268
+ aws:audit-manager
269
+ aws:augmented-ai-a2i
270
+ aws:aurora
271
+ aws:auto-scaling
272
+ aws:backint-agent
273
+ aws:backup
274
+ aws:batch
275
+ aws:billing-conductor
276
+ aws:bottlerocket
277
+ aws:braket
278
+ aws:budgets
279
+ aws:certificate-manager
280
+ aws:chatbot
281
+ aws:chime
282
+ aws:chime-sdk
283
+ aws:chime-voice-connector
284
+ aws:clean-rooms
285
+ aws:client-vpn
286
+ aws:cloud-control-api
287
+ aws:cloud-development-kit
288
+ aws:cloud-directory
289
+ aws:cloud-formation
290
+ aws:cloud-front
291
+ aws:cloud-hsm
292
+ aws:cloud-map
293
+ aws:cloud-search
294
+ aws:cloud-shell
295
+ aws:cloud-trail
296
+ aws:cloud-wan
297
+ aws:cloud-watch
298
+ aws:cloud9
299
+ aws:code-artifact
300
+ aws:code-build
301
+ aws:code-catalyst
302
+ aws:code-commit
303
+ aws:code-deploy
304
+ aws:code-guru
305
+ aws:code-pipeline
306
+ aws:code-star
307
+ aws:code-whisperer
308
+ aws:cognito
309
+ aws:command-line-interface
310
+ aws:comprehend
311
+ aws:comprehend-medical
312
+ aws:compute-optimizer
313
+ aws:config
314
+ aws:connect
315
+ aws:console-mobile-application
316
+ aws:control-tower
317
+ aws:corretto
318
+ aws:cost-and-usage-report
319
+ aws:cost-explorer
320
+ aws:data-exchange
321
+ aws:data-pipeline
322
+ aws:data-sync
323
+ aws:data-zone
324
+ aws:database-migration-service
325
+ aws:deep-composer
326
+ aws:deep-learning-amis
327
+ aws:deep-learning-containers
328
+ aws:deep-lens
329
+ aws:deep-racer
330
+ aws:detective
331
+ aws:dev-ops-guru
332
+ aws:device-farm
333
+ aws:direct-connect
334
+ aws:directory-service
335
+ aws:distro-for-open-telemetry
336
+ aws:document-db
337
+ aws:dynamo-db
338
+ aws:ec2
339
+ aws:ec2-auto-scaling
340
+ aws:ec2-image-builder
341
+ aws:ecs-anywhere
342
+ aws:efs
343
+ aws:eks-anywhere
344
+ aws:eks-cloud
345
+ aws:eks-distro
346
+ aws:elasti-cache
347
+ aws:elastic-beanstalk
348
+ aws:elastic-block-store
349
+ aws:elastic-container-registry
350
+ aws:elastic-container-service
351
+ aws:elastic-disaster-recovery
352
+ aws:elastic-fabric-adapter
353
+ aws:elastic-inference
354
+ aws:elastic-kubernetes-service
355
+ aws:elastic-load-balancing
356
+ aws:elastic-transcoder
357
+ aws:elemental-appliances-software
358
+ aws:elemental-conductor
359
+ aws:elemental-delta
360
+ aws:elemental-link
361
+ aws:elemental-live
362
+ aws:elemental-media-connect
363
+ aws:elemental-media-convert
364
+ aws:elemental-media-live
365
+ aws:elemental-media-package
366
+ aws:elemental-media-store
367
+ aws:elemental-media-tailor
368
+ aws:elemental-server
369
+ aws:emr
370
+ aws:event-bridge
371
+ aws:express-workflows
372
+ aws:fargate
373
+ aws:fault-injection-simulator
374
+ aws:file-cache
375
+ aws:fin-space
376
+ aws:firewall-manager
377
+ aws:forecast
378
+ aws:fraud-detector
379
+ aws:free-rtos
380
+ aws:fsx
381
+ aws:fsx-for-lustre
382
+ aws:fsx-for-net-app-ontap
383
+ aws:fsx-for-open-zfs
384
+ aws:fsx-for-wfs
385
+ aws:game-kit
386
+ aws:game-lift
387
+ aws:game-sparks
388
+ aws:genomics-cli
389
+ aws:global-accelerator
390
+ aws:glue
391
+ aws:glue-data-brew
392
+ aws:glue-elastic-views
393
+ aws:ground-station
394
+ aws:guard-duty
395
+ aws:health-lake
396
+ aws:honeycode
397
+ aws:iam-identity-center
398
+ aws:identity-and-access-management
399
+ aws:inspector
400
+ aws:interactive-video-service
401
+ aws:io-t-1-click
402
+ aws:io-t-analytics
403
+ aws:io-t-button
404
+ aws:io-t-core
405
+ aws:io-t-device-defender
406
+ aws:io-t-device-management
407
+ aws:io-t-edu-kit
408
+ aws:io-t-events
409
+ aws:io-t-express-link
410
+ aws:io-t-fleet-wise
411
+ aws:io-t-greengrass
412
+ aws:io-t-robo-runner
413
+ aws:io-t-site-wise
414
+ aws:io-t-things-graph
415
+ aws:io-t-twin-maker
416
+ aws:iq
417
+ aws:kendra
418
+ aws:key-management-service
419
+ aws:keyspaces
420
+ aws:kinesis
421
+ aws:kinesis-data-analytics
422
+ aws:kinesis-data-streams
423
+ aws:kinesis-firehose
424
+ aws:kinesis-video-streams
425
+ aws:lake-formation
426
+ aws:lambda
427
+ aws:launch-wizard
428
+ aws:lex
429
+ aws:license-manager
430
+ aws:lightsail
431
+ aws:local-zones
432
+ aws:location-service
433
+ aws:lookout-for-equipment
434
+ aws:lookout-for-metrics
435
+ aws:lookout-for-vision
436
+ aws:lumberyard
437
+ aws:macie
438
+ aws:mainframe-modernization
439
+ aws:managed-blockchain
440
+ aws:managed-grafana
441
+ aws:managed-service-for-prometheus
442
+ aws:managed-services
443
+ aws:managed-streaming-for-apache-kafka
444
+ aws:managed-workflows-for-apache-airflow
445
+ aws:management-console
446
+ aws:marketplace-dark
447
+ aws:marketplace-light
448
+ aws:memory-db-for-redis
449
+ aws:migration-evaluator
450
+ aws:migration-hub
451
+ aws:monitron
452
+ aws:mq
453
+ aws:neptune
454
+ aws:network-firewall
455
+ aws:neuron
456
+ aws:nice-dcv
457
+ aws:nice-engin-frame
458
+ aws:nimble-studio
459
+ aws:nitro-enclaves
460
+ aws:omics
461
+ aws:open-3d-engine
462
+ aws:open-search-service
463
+ aws:ops-works
464
+ aws:organizations
465
+ aws:outposts-family
466
+ aws:outposts-rack
467
+ aws:outposts-servers
468
+ aws:panorama
469
+ aws:parallel-cluster
470
+ aws:personal-health-dashboard
471
+ aws:personalize
472
+ aws:pinpoint
473
+ aws:pinpoint-apis
474
+ aws:polly
475
+ aws:private-5g
476
+ aws:private-certificate-authority
477
+ aws:private-link
478
+ aws:professional-services
479
+ aws:proton
480
+ aws:quantum-ledger-database
481
+ aws:quick-sight
482
+ aws:rds
483
+ aws:rds-on-vmware
484
+ aws:re-post
485
+ aws:red-hat-open-shift-service-on-aws
486
+ aws:redshift
487
+ aws:rekognition
488
+ aws:reserved-instance-reporting
489
+ aws:resilience-hub
490
+ aws:resource-access-manager
491
+ aws:resource-explorer
492
+ aws:robo-maker
493
+ aws:route-53
494
+ aws:s3-on-outposts
495
+ aws:sage-maker
496
+ aws:sage-maker-ground-truth
497
+ aws:sage-maker-studio-lab
498
+ aws:savings-plans
499
+ aws:secrets-manager
500
+ aws:security-hub
501
+ aws:security-lake
502
+ aws:server-migration-service
503
+ aws:serverless-application-repository
504
+ aws:service-catalog
505
+ aws:service-management-connector
506
+ aws:shield
507
+ aws:signer
508
+ aws:sim-space-weaver
509
+ aws:simple-email-service
510
+ aws:simple-notification-service
511
+ aws:simple-queue-service
512
+ aws:simple-storage-service
513
+ aws:simple-storage-service-glacier
514
+ aws:site-to-site-vpn
515
+ aws:snowball
516
+ aws:snowball-edge
517
+ aws:snowcone
518
+ aws:snowmobile
519
+ aws:step-functions
520
+ aws:storage-gateway
521
+ aws:sumerian
522
+ aws:supply-chain
523
+ aws:support
524
+ aws:systems-manager
525
+ aws:tensor-flow-on-aws
526
+ aws:textract
527
+ aws:thinkbox-deadline
528
+ aws:thinkbox-frost
529
+ aws:thinkbox-krakatoa
530
+ aws:thinkbox-sequoia
531
+ aws:thinkbox-stoke
532
+ aws:thinkbox-xmesh
533
+ aws:timestream
534
+ aws:tools-and-sdks
535
+ aws:torch-serve
536
+ aws:training-certification
537
+ aws:transcribe
538
+ aws:transfer-family
539
+ aws:transit-gateway
540
+ aws:translate
541
+ aws:trusted-advisor
542
+ aws:verified-access
543
+ aws:verified-permissions
544
+ aws:virtual-private-cloud
545
+ aws:vmware-cloud-on-aws
546
+ aws:vpc-lattice
547
+ aws:waf
548
+ aws:wavelength
549
+ aws:well-architected-tool
550
+ aws:wickr
551
+ aws:work-docs
552
+ aws:work-docs-sdk
553
+ aws:work-link
554
+ aws:work-mail
555
+ aws:work-spaces-family
556
+ aws:x-ray
557
+ azure:abs-member
558
+ azure:active-directory-connect-health
559
+ azure:activity-log
560
+ azure:administrative-units
561
+ azure:advisor
562
+ azure:ai-studio
563
+ azure:aks-automatic
564
+ azure:aks-istio
565
+ azure:alerts
566
+ azure:all-resources
567
+ azure:analysis-services
568
+ azure:anomaly-detector
569
+ azure:api-center
570
+ azure:api-connections
571
+ azure:api-management-services
572
+ azure:api-proxy
573
+ azure:app-compliance-automation
574
+ azure:app-configuration
575
+ azure:app-registrations
576
+ azure:app-service-certificates
577
+ azure:app-service-domains
578
+ azure:app-service-environments
579
+ azure:app-service-plans
580
+ azure:app-services
581
+ azure:app-space
582
+ azure:app-space-component
583
+ azure:applens
584
+ azure:application-gateway-containers
585
+ azure:application-gateways
586
+ azure:application-group
587
+ azure:application-insights
588
+ azure:application-security-groups
589
+ azure:aquila
590
+ azure:arc-data-services
591
+ azure:arc-kubernetes
592
+ azure:arc-machines
593
+ azure:arc-sql-managed-instance
594
+ azure:arc-sql-server
595
+ azure:atm-multistack
596
+ azure:auto-scale
597
+ azure:automanaged-vm
598
+ azure:automation-accounts
599
+ azure:availability-sets
600
+ azure:avs-vm
601
+ azure:azure-a
602
+ azure:azure-ad-b2c
603
+ azure:azure-api-for-fhir
604
+ azure:azure-applied-ai-services
605
+ azure:azure-arc
606
+ azure:azure-attestation
607
+ azure:azure-backup-center
608
+ azure:azure-blockchain-service
609
+ azure:azure-center-for-sap
610
+ azure:azure-chaos-studio
611
+ azure:azure-cloud-shell
612
+ azure:azure-communication-services
613
+ azure:azure-communications-gateway
614
+ azure:azure-compute-galleries
615
+ azure:azure-cosmos-db
616
+ azure:azure-data-catalog
617
+ azure:azure-data-explorer-clusters
618
+ azure:azure-database-maria-db-server
619
+ azure:azure-database-migration-services
620
+ azure:azure-database-my-sql-server
621
+ azure:azure-database-postgre-sql-server
622
+ azure:azure-database-postgre-sql-server-group
623
+ azure:azure-databox-gateway
624
+ azure:azure-databricks
625
+ azure:azure-deployment-environments
626
+ azure:azure-dev-ops
627
+ azure:azure-dev-tunnels
628
+ azure:azure-edge-hardware-center
629
+ azure:azure-experimentation-studio
630
+ azure:azure-fileshares
631
+ azure:azure-firewall-manager
632
+ azure:azure-firewall-policy
633
+ azure:azure-hcp-cache
634
+ azure:azure-hpc-workbenches
635
+ azure:azure-hybrid-center
636
+ azure:azure-information-protection
637
+ azure:azure-io-t-operations
638
+ azure:azure-lighthouse
639
+ azure:azure-load-testing
640
+ azure:azure-managed-grafana
641
+ azure:azure-maps-accounts
642
+ azure:azure-media-service
643
+ azure:azure-migrate
644
+ azure:azure-monitor-dashboard
645
+ azure:azure-monitor-pipeline
646
+ azure:azure-monitors-for-sap-solutions
647
+ azure:azure-net-app-files
648
+ azure:azure-network-function-manager
649
+ azure:azure-network-function-manager-functions
650
+ azure:azure-object-understanding
651
+ azure:azure-open-ai
652
+ azure:azure-operator-5g-core
653
+ azure:azure-operator-insights
654
+ azure:azure-operator-nexus
655
+ azure:azure-operator-service-manager
656
+ azure:azure-orbital
657
+ azure:azure-programmable-connectivity
658
+ azure:azure-purview-accounts
659
+ azure:azure-quotas
660
+ azure:azure-red-hat-open-shift
661
+ azure:azure-sentinel
662
+ azure:azure-service-bus
663
+ azure:azure-sphere
664
+ azure:azure-spring-apps
665
+ azure:azure-sql
666
+ azure:azure-sql-edge
667
+ azure:azure-sql-server-stretch-databases
668
+ azure:azure-sql-vm
669
+ azure:azure-stack
670
+ azure:azure-stack-edge
671
+ azure:azure-stack-hci-sizer
672
+ azure:azure-storage-mover
673
+ azure:azure-support-center-blue
674
+ azure:azure-sustainability
675
+ azure:azure-synapse-analytics
676
+ azure:azure-token-service
677
+ azure:azure-video-indexer
678
+ azure:azure-virtual-desktop
679
+ azure:azure-vmware-solution
680
+ azure:azure-workbooks
681
+ azure:azurite
682
+ azure:backlog
683
+ azure:backup-vault
684
+ azure:bare-metal-infrastructure
685
+ azure:bastions
686
+ azure:batch-accounts
687
+ azure:batch-ai
688
+ azure:biz-talk
689
+ azure:blob-block
690
+ azure:blob-page
691
+ azure:blockchain-applications
692
+ azure:blueprints
693
+ azure:bonsai
694
+ azure:bot-services
695
+ azure:branch
696
+ azure:browser
697
+ azure:bug
698
+ azure:builds
699
+ azure:business-process-tracking
700
+ azure:cache
701
+ azure:cache-redis
702
+ azure:capacity
703
+ azure:capacity-reservation-groups
704
+ azure:cdn-profiles
705
+ azure:central-service-instance-for-sap
706
+ azure:ceres
707
+ azure:change-analysis
708
+ azure:client-apps
709
+ azure:cloud-services-classic
710
+ azure:cloud-services-extended-support
711
+ azure:cloud-test
712
+ azure:code
713
+ azure:code-optimization
714
+ azure:cognitive-search
715
+ azure:cognitive-services
716
+ azure:cognitive-services-decisions
717
+ azure:collaborative-service
718
+ azure:commit
719
+ azure:community-images
720
+ azure:compliance
721
+ azure:compliance-center
722
+ azure:compute-fleet
723
+ azure:computer-vision
724
+ azure:conditional-access
725
+ azure:confidential-ledgers
726
+ azure:connected-cache
727
+ azure:connected-vehicle-platform
728
+ azure:connections
729
+ azure:consortium
730
+ azure:container-apps-environments
731
+ azure:container-instances
732
+ azure:container-registries
733
+ azure:container-services-deprecated
734
+ azure:content-moderators
735
+ azure:content-safety
736
+ azure:controls
737
+ azure:controls-horizontal
738
+ azure:cost-alerts
739
+ azure:cost-analysis
740
+ azure:cost-budgets
741
+ azure:cost-export
742
+ azure:cost-management
743
+ azure:cost-management-and-billing
744
+ azure:counter
745
+ azure:cubes
746
+ azure:custom-ip-prefix
747
+ azure:custom-vision
748
+ azure:customer-lockbox-for-microsoft-azure
749
+ azure:dashboard
750
+ azure:dashboard-hub
751
+ azure:data-box
752
+ azure:data-collection-rules
753
+ azure:data-factories
754
+ azure:data-lake-analytics
755
+ azure:data-lake-storage-gen1
756
+ azure:data-lake-store-gen1
757
+ azure:data-share-invitations
758
+ azure:data-shares
759
+ azure:database-instance-for-sap
760
+ azure:ddo-s-protection-plans
761
+ azure:dedicated-hsm
762
+ azure:defender-cm-local-manager
763
+ azure:defender-dcs-controller
764
+ azure:defender-distributer-control-system
765
+ azure:defender-engineering-station
766
+ azure:defender-external-management
767
+ azure:defender-freezer-monitor
768
+ azure:defender-historian
769
+ azure:defender-hmi
770
+ azure:defender-industrial-packaging-system
771
+ azure:defender-industrial-printer
772
+ azure:defender-industrial-robot
773
+ azure:defender-industrial-scale-system
774
+ azure:defender-marquee
775
+ azure:defender-meter
776
+ azure:defender-plc
777
+ azure:defender-pneumatic-device
778
+ azure:defender-programable-board
779
+ azure:defender-relay
780
+ azure:defender-robot-controller
781
+ azure:defender-rtu
782
+ azure:defender-sensor
783
+ azure:defender-slot
784
+ azure:defender-web-guiding-system
785
+ azure:detonation
786
+ azure:dev-console
787
+ azure:dev-ops-starter
788
+ azure:dev-test-labs
789
+ azure:device-compliance
790
+ azure:device-configuration
791
+ azure:device-enrollment
792
+ azure:device-provisioning-services
793
+ azure:device-security-apple
794
+ azure:device-security-google
795
+ azure:device-security-windows
796
+ azure:device-update-io-t-hub
797
+ azure:devices
798
+ azure:diagnostics-settings
799
+ azure:digital-twins
800
+ azure:disk-encryption-sets
801
+ azure:disk-pool
802
+ azure:disks
803
+ azure:disks-classic
804
+ azure:disks-snapshots
805
+ azure:dns-multistack
806
+ azure:dns-private-resolver
807
+ azure:dns-security-policy
808
+ azure:dns-zones
809
+ azure:download
810
+ azure:e-books
811
+ azure:edge-management
812
+ azure:education
813
+ azure:elastic-job-agents
814
+ azure:elastic-san
815
+ azure:endpoint-analytics
816
+ azure:enterprise-applications
817
+ azure:entra-connect
818
+ azure:entra-connect-health
819
+ azure:entra-connect-sync
820
+ azure:entra-domain-services
821
+ azure:entra-global-secure-access
822
+ azure:entra-id-protection
823
+ azure:entra-identity-custom-roles
824
+ azure:entra-identity-licenses
825
+ azure:entra-identity-risky-signins
826
+ azure:entra-identity-risky-users
827
+ azure:entra-identity-roles-and-administrators
828
+ azure:entra-internet-access
829
+ azure:entra-managed-identities
830
+ azure:entra-private-access
831
+ azure:entra-privleged-identity-management
832
+ azure:entra-verified-id
833
+ azure:error
834
+ azure:event-grid-domains
835
+ azure:event-grid-subscriptions
836
+ azure:event-grid-topics
837
+ azure:event-hub-clusters
838
+ azure:event-hubs
839
+ azure:exchange-access
840
+ azure:exchange-on-premises-access
841
+ azure:express-route-circuits
842
+ azure:express-route-direct
843
+ azure:express-route-traffic-collector
844
+ azure:extended-security-updates
845
+ azure:extensions
846
+ azure:external-identities
847
+ azure:face-apis
848
+ azure:feature-previews
849
+ azure:fhir-service
850
+ azure:fiji
851
+ azure:file
852
+ azure:files
853
+ azure:firewalls
854
+ azure:folder-blank
855
+ azure:folder-website
856
+ azure:form-recognizers
857
+ azure:free-services
858
+ azure:front-door-and-cdn-profiles
859
+ azure:ftp
860
+ azure:function-apps
861
+ azure:gear
862
+ azure:genomics
863
+ azure:genomics-accounts
864
+ azure:globe-error
865
+ azure:globe-success
866
+ azure:globe-warning
867
+ azure:groups
868
+ azure:guide
869
+ azure:hd-insight-clusters
870
+ azure:hdi-aks-cluster
871
+ azure:heart
872
+ azure:help-and-support
873
+ azure:host-groups
874
+ azure:host-pools
875
+ azure:hosts
876
+ azure:ic-m-troubleshooting
877
+ azure:identity-governance
878
+ azure:identity-multi-factor-authentication
879
+ azure:identity-secure-score
880
+ azure:image
881
+ azure:image-definitions
882
+ azure:image-templates
883
+ azure:image-versions
884
+ azure:images
885
+ azure:immersive-readers
886
+ azure:import-export-jobs
887
+ azure:industrial-io-t
888
+ azure:information
889
+ azure:infrastructure-backup
890
+ azure:input-output
891
+ azure:instance-pools
892
+ azure:integration-accounts
893
+ azure:integration-environments
894
+ azure:integration-service-environments
895
+ azure:internet-analyzer-profiles
896
+ azure:intune
897
+ azure:intune-app-protection
898
+ azure:intune-for-education
899
+ azure:intune-trends
900
+ azure:io-t-central-applications
901
+ azure:io-t-edge
902
+ azure:io-t-hub
903
+ azure:ip-address-manager
904
+ azure:ip-groups
905
+ azure:journey-hub
906
+ azure:key-vaults
907
+ azure:keys
908
+ azure:kubernetes-fleet-manager
909
+ azure:kubernetes-services
910
+ azure:lab-accounts
911
+ azure:lab-services
912
+ azure:language
913
+ azure:language-understanding
914
+ azure:launch-portal
915
+ azure:learn
916
+ azure:load-balancer-hub
917
+ azure:load-balancers
918
+ azure:load-test
919
+ azure:load-testing
920
+ azure:local-network-gateways
921
+ azure:location
922
+ azure:log-analytics-query-pack
923
+ azure:log-analytics-workspaces
924
+ azure:log-streaming
925
+ azure:logic-apps
926
+ azure:logic-apps-custom-connector
927
+ azure:machine-learning
928
+ azure:machine-learning-studio-classic-web-services
929
+ azure:machine-learning-studio-web-service-plans
930
+ azure:machine-learning-studio-workspaces
931
+ azure:machines-azure-arc
932
+ azure:maintenance-configuration
933
+ azure:managed-applications-center
934
+ azure:managed-database
935
+ azure:managed-desktop
936
+ azure:managed-dev-ops-pools
937
+ azure:managed-file-shares
938
+ azure:managed-identities
939
+ azure:managed-instance-apache-cassandra
940
+ azure:managed-service-fabric
941
+ azure:management-groups
942
+ azure:management-portal
943
+ azure:marketplace
944
+ azure:marketplace-management
945
+ azure:med-tech-service
946
+ azure:media
947
+ azure:media-file
948
+ azure:mesh-applications
949
+ azure:metrics
950
+ azure:metrics-advisor
951
+ azure:microsoft-defender-easm
952
+ azure:microsoft-defender-for-cloud
953
+ azure:microsoft-defender-for-io-t
954
+ azure:microsoft-dev-box
955
+ azure:mindaro
956
+ azure:mission-landing-zone
957
+ azure:mobile
958
+ azure:mobile-engagement
959
+ azure:mobile-networks
960
+ azure:modular-data-center
961
+ azure:module
962
+ azure:monitor
963
+ azure:monitor-health-models
964
+ azure:multi-tenancy
965
+ azure:multifactor-authentication
966
+ azure:my-customers
967
+ azure:nat
968
+ azure:network-interfaces
969
+ azure:network-managers
970
+ azure:network-security-groups
971
+ azure:network-security-perimeters
972
+ azure:network-watcher
973
+ azure:notification-hub-namespaces
974
+ azure:notification-hubs
975
+ azure:offers
976
+ azure:on-premises-data-gateways
977
+ azure:open-supply-chain-platform
978
+ azure:operation-log-classic
979
+ azure:oracle-database
980
+ azure:os-images-classic
981
+ azure:osconfig
982
+ azure:outbound-connection
983
+ azure:partner-namespace
984
+ azure:partner-registration
985
+ azure:partner-topic
986
+ azure:peering-service
987
+ azure:peerings
988
+ azure:personalizers
989
+ azure:plans
990
+ azure:policy
991
+ azure:power
992
+ azure:power-bi-embedded
993
+ azure:power-platform
994
+ azure:power-up
995
+ azure:powershell
996
+ azure:preview-features
997
+ azure:private-endpoints
998
+ azure:private-link
999
+ azure:private-link-service
1000
+ azure:private-link-services
1001
+ azure:process-explorer
1002
+ azure:production-ready-database
1003
+ azure:proximity-placement-groups
1004
+ azure:public-ip-addresses
1005
+ azure:public-ip-addresses-classic
1006
+ azure:public-ip-prefixes
1007
+ azure:qn-a-makers
1008
+ azure:quickstart-center
1009
+ azure:recent
1010
+ azure:recovery-services-vaults
1011
+ azure:region-management
1012
+ azure:relays
1013
+ azure:remote-rendering
1014
+ azure:reservations
1015
+ azure:reserved-capacity
1016
+ azure:reserved-ip-addresses-classic
1017
+ azure:resource-explorer
1018
+ azure:resource-graph-explorer
1019
+ azure:resource-group-list
1020
+ azure:resource-groups
1021
+ azure:resource-guard
1022
+ azure:resource-linked
1023
+ azure:resource-management-private-link
1024
+ azure:resource-mover
1025
+ azure:resources-provider
1026
+ azure:restore-points
1027
+ azure:restore-points-collections
1028
+ azure:route-filters
1029
+ azure:route-tables
1030
+ azure:rtos
1031
+ azure:savings-plans
1032
+ azure:scheduler
1033
+ azure:scheduler-job-collections
1034
+ azure:scvmm-management-servers
1035
+ azure:search
1036
+ azure:search-grid
1037
+ azure:security
1038
+ azure:security-baselines
1039
+ azure:send-grid-accounts
1040
+ azure:server-farm
1041
+ azure:serverless-search
1042
+ azure:service-catalog-mad
1043
+ azure:service-endpoint-policies
1044
+ azure:service-fabric-clusters
1045
+ azure:service-health
1046
+ azure:service-providers
1047
+ azure:shared-image-galleries
1048
+ azure:signal-r
1049
+ azure:software-as-a-service
1050
+ azure:software-updates
1051
+ azure:solutions
1052
+ azure:sonic-dash
1053
+ azure:spatial-anchor-accounts
1054
+ azure:speech-services
1055
+ azure:spot-vm
1056
+ azure:spot-vmss
1057
+ azure:sql-data-warehouses
1058
+ azure:sql-database
1059
+ azure:sql-elastic-pools
1060
+ azure:sql-managed-instance
1061
+ azure:sql-server
1062
+ azure:sql-server-registries
1063
+ azure:ssd
1064
+ azure:ssh-keys
1065
+ azure:ssis-lift-and-shift-ir
1066
+ azure:stack-hci-premium
1067
+ azure:static-apps
1068
+ azure:stor-simple-data-managers
1069
+ azure:stor-simple-device-managers
1070
+ azure:storage-accounts
1071
+ azure:storage-accounts-classic
1072
+ azure:storage-actions
1073
+ azure:storage-azure-files
1074
+ azure:storage-container
1075
+ azure:storage-explorer
1076
+ azure:storage-functions
1077
+ azure:storage-queue
1078
+ azure:storage-sync-services
1079
+ azure:stream-analytics-jobs
1080
+ azure:subnet
1081
+ azure:subscriptions
1082
+ azure:system-topic
1083
+ azure:table
1084
+ azure:tag
1085
+ azure:tags
1086
+ azure:targets-management
1087
+ azure:template-specs
1088
+ azure:templates
1089
+ azure:tenant-properties
1090
+ azure:tenant-status
1091
+ azure:test-base
1092
+ azure:tfs-vc-repository
1093
+ azure:time-series-data-sets
1094
+ azure:time-series-insights-access-policies
1095
+ azure:time-series-insights-environments
1096
+ azure:time-series-insights-event-sources
1097
+ azure:toolbox
1098
+ azure:traffic-manager-profiles
1099
+ azure:translator-text
1100
+ azure:troubleshoot
1101
+ azure:universal-print
1102
+ azure:update-management-center
1103
+ azure:updates
1104
+ azure:user-privacy
1105
+ azure:user-settings
1106
+ azure:user-subscriptions
1107
+ azure:users
1108
+ azure:verifiable-credentials
1109
+ azure:verification-as-a-service
1110
+ azure:versions
1111
+ azure:video-analyzers
1112
+ azure:virtual-clusters
1113
+ azure:virtual-enclaves
1114
+ azure:virtual-instance-for-sap
1115
+ azure:virtual-machine
1116
+ azure:virtual-machines-classic
1117
+ azure:virtual-network-gateways
1118
+ azure:virtual-networks
1119
+ azure:virtual-networks-classic
1120
+ azure:virtual-router
1121
+ azure:virtual-visits-builder
1122
+ azure:virtual-wan-hub
1123
+ azure:virtual-wans
1124
+ azure:vm-app-definitions
1125
+ azure:vm-app-versions
1126
+ azure:vm-image-version
1127
+ azure:vm-images-classic
1128
+ azure:vm-scale-sets
1129
+ azure:wac
1130
+ azure:wac-installer
1131
+ azure:web-app-database
1132
+ azure:web-application-firewall-policies-waf
1133
+ azure:web-jobs
1134
+ azure:web-slots
1135
+ azure:web-test
1136
+ azure:website-power
1137
+ azure:website-staging
1138
+ azure:windows-notification-services
1139
+ azure:windows10-core-services
1140
+ azure:workbooks
1141
+ azure:worker-container-app
1142
+ azure:workflow
1143
+ azure:workspace-gateway
1144
+ azure:workspaces
1145
+ gcp:access-context-manager
1146
+ gcp:administration
1147
+ gcp:advanced-agent-modeling
1148
+ gcp:advanced-solutions-lab
1149
+ gcp:agent-assist
1150
+ gcp:ai-hub
1151
+ gcp:ai-platform
1152
+ gcp:ai-platform-unified
1153
+ gcp:analytics-hub
1154
+ gcp:anthos
1155
+ gcp:anthos-config-management
1156
+ gcp:anthos-service-mesh
1157
+ gcp:api
1158
+ gcp:api-analytics
1159
+ gcp:api-monetization
1160
+ gcp:apigee-api-platform
1161
+ gcp:apigee-sense
1162
+ gcp:app-engine
1163
+ gcp:artifact-registry
1164
+ gcp:asset-inventory
1165
+ gcp:assured-workloads
1166
+ gcp:auto-ml
1167
+ gcp:auto-ml-natural-language
1168
+ gcp:auto-ml-tables
1169
+ gcp:auto-ml-translation
1170
+ gcp:auto-ml-video-intelligence
1171
+ gcp:auto-ml-vision
1172
+ gcp:bare-metal-solutions
1173
+ gcp:batch
1174
+ gcp:beyondcorp
1175
+ gcp:big-query
1176
+ gcp:bigtable
1177
+ gcp:billing
1178
+ gcp:binary-authorization
1179
+ gcp:catalog
1180
+ gcp:certificate-authority-service
1181
+ gcp:certificate-manager
1182
+ gcp:cloud-api-gateway
1183
+ gcp:cloud-apis
1184
+ gcp:cloud-armor
1185
+ gcp:cloud-asset-inventory
1186
+ gcp:cloud-audit-logs
1187
+ gcp:cloud-build
1188
+ gcp:cloud-cdn
1189
+ gcp:cloud-code
1190
+ gcp:cloud-composer
1191
+ gcp:cloud-data-fusion
1192
+ gcp:cloud-deploy
1193
+ gcp:cloud-deployment-manager
1194
+ gcp:cloud-dns
1195
+ gcp:cloud-domains
1196
+ gcp:cloud-ekm
1197
+ gcp:cloud-endpoints
1198
+ gcp:cloud-external-ip-addresses
1199
+ gcp:cloud-firewall-rules
1200
+ gcp:cloud-for-marketing
1201
+ gcp:cloud-functions
1202
+ gcp:cloud-generic
1203
+ gcp:cloud-gpu
1204
+ gcp:cloud-healthcare-api
1205
+ gcp:cloud-healthcare-marketplace
1206
+ gcp:cloud-hsm
1207
+ gcp:cloud-ids
1208
+ gcp:cloud-inference-api
1209
+ gcp:cloud-interconnect
1210
+ gcp:cloud-jobs-api
1211
+ gcp:cloud-load-balancing
1212
+ gcp:cloud-logging
1213
+ gcp:cloud-media-edge
1214
+ gcp:cloud-monitoring
1215
+ gcp:cloud-nat
1216
+ gcp:cloud-natural-language-api
1217
+ gcp:cloud-network
1218
+ gcp:cloud-ops
1219
+ gcp:cloud-optimization-ai
1220
+ gcp:cloud-optimization-ai-fleet-routing-api
1221
+ gcp:cloud-router
1222
+ gcp:cloud-routes
1223
+ gcp:cloud-run
1224
+ gcp:cloud-run-for-anthos
1225
+ gcp:cloud-scheduler
1226
+ gcp:cloud-security-scanner
1227
+ gcp:cloud-shell
1228
+ gcp:cloud-spanner
1229
+ gcp:cloud-sql
1230
+ gcp:cloud-storage
1231
+ gcp:cloud-tasks
1232
+ gcp:cloud-test-lab
1233
+ gcp:cloud-tpu
1234
+ gcp:cloud-translation-api
1235
+ gcp:cloud-vision-api
1236
+ gcp:cloud-vpn
1237
+ gcp:compute-engine
1238
+ gcp:configuration-management
1239
+ gcp:connectivity-test
1240
+ gcp:connectors
1241
+ gcp:contact-center-ai
1242
+ gcp:container-optimized-os
1243
+ gcp:container-registry
1244
+ gcp:data-catalog
1245
+ gcp:data-labeling
1246
+ gcp:data-layers
1247
+ gcp:data-loss-prevention-api
1248
+ gcp:data-qn-a
1249
+ gcp:data-studio
1250
+ gcp:data-transfer
1251
+ gcp:database-migration-service
1252
+ gcp:dataflow
1253
+ gcp:datalab
1254
+ gcp:dataplex
1255
+ gcp:datapol
1256
+ gcp:dataprep
1257
+ gcp:dataproc
1258
+ gcp:dataproc-metastore
1259
+ gcp:datashare
1260
+ gcp:datastore
1261
+ gcp:datastream
1262
+ gcp:debugger
1263
+ gcp:developer-portal
1264
+ gcp:dialogflow
1265
+ gcp:dialogflow-cx
1266
+ gcp:dialogflow-insights
1267
+ gcp:document-ai
1268
+ gcp:early-access-center
1269
+ gcp:error-reporting
1270
+ gcp:eventarc
1271
+ gcp:filestore
1272
+ gcp:financial-services-marketplace
1273
+ gcp:firestore
1274
+ gcp:fleet-engine
1275
+ gcp:free-trial
1276
+ gcp:game-servers
1277
+ gcp:gce-systems-management
1278
+ gcp:genomics
1279
+ gcp:gke-on-prem
1280
+ gcp:google-cloud-marketplace
1281
+ gcp:google-kubernetes-engine
1282
+ gcp:google-maps-platform
1283
+ gcp:healthcare-nlp-api
1284
+ gcp:home
1285
+ gcp:identity-and-access-management
1286
+ gcp:identity-aware-proxy
1287
+ gcp:identity-platform
1288
+ gcp:iot-core
1289
+ gcp:iot-edge
1290
+ gcp:key-access-justifications
1291
+ gcp:key-management-service
1292
+ gcp:kuberun
1293
+ gcp:launcher
1294
+ gcp:local-ssd
1295
+ gcp:looker
1296
+ gcp:managed-service-for-microsoft-active-directory
1297
+ gcp:media-translation-api
1298
+ gcp:memorystore
1299
+ gcp:migrate-for-anthos
1300
+ gcp:migrate-for-compute-engine
1301
+ gcp:my-cloud
1302
+ gcp:network-connectivity-center
1303
+ gcp:network-intelligence-center
1304
+ gcp:network-security
1305
+ gcp:network-tiers
1306
+ gcp:network-topology
1307
+ gcp:onboarding
1308
+ gcp:os-configuration-management
1309
+ gcp:os-inventory-management
1310
+ gcp:os-patch-management
1311
+ gcp:partner-interconnect
1312
+ gcp:partner-portal
1313
+ gcp:performance-dashboard
1314
+ gcp:permissions
1315
+ gcp:persistent-disk
1316
+ gcp:phishing-protection
1317
+ gcp:policy-analyzer
1318
+ gcp:premium-network-tier
1319
+ gcp:private-connectivity
1320
+ gcp:private-service-connect
1321
+ gcp:producer-portal
1322
+ gcp:profiler
1323
+ gcp:project
1324
+ gcp:pub-sub
1325
+ gcp:quantum-engine
1326
+ gcp:quotas
1327
+ gcp:real-world-insights
1328
+ gcp:recommendations-ai
1329
+ gcp:release-notes
1330
+ gcp:retail-api
1331
+ gcp:risk-manager
1332
+ gcp:runtime-config
1333
+ gcp:secret-manager
1334
+ gcp:security
1335
+ gcp:security-command-center
1336
+ gcp:security-health-advisor
1337
+ gcp:security-key-enforcement
1338
+ gcp:service-discovery
1339
+ gcp:speech-to-text
1340
+ gcp:stackdriver
1341
+ gcp:standard-network-tier
1342
+ gcp:stream-suite
1343
+ gcp:support
1344
+ gcp:tensorflow-enterprise
1345
+ gcp:text-to-speech
1346
+ gcp:tools-for-powershell
1347
+ gcp:trace
1348
+ gcp:traffic-director
1349
+ gcp:transfer
1350
+ gcp:transfer-appliance
1351
+ gcp:user-preferences
1352
+ gcp:vertex-ai
1353
+ gcp:video-intelligence-api
1354
+ gcp:virtual-private-cloud
1355
+ gcp:visual-inspection
1356
+ gcp:vmware-engine
1357
+ gcp:web-risk
1358
+ gcp:web-security-scanner
1359
+ gcp:workflows
1360
+ gcp:workload-identity-pool
1361
+ tech:aarch64
1362
+ tech:adobe-illustrator
1363
+ tech:adobe-photoshop
1364
+ tech:adobe-premiere-pro
1365
+ tech:adobe-xd
1366
+ tech:adonis-js
1367
+ tech:after-effects
1368
+ tech:airflow
1369
+ tech:akka
1370
+ tech:algolia
1371
+ tech:alpine-js
1372
+ tech:amazon-web-services
1373
+ tech:anaconda
1374
+ tech:android
1375
+ tech:android-studio
1376
+ tech:angular
1377
+ tech:angular-js
1378
+ tech:ansible
1379
+ tech:ant-design
1380
+ tech:apache
1381
+ tech:apl
1382
+ tech:appcelerator
1383
+ tech:apple
1384
+ tech:apple-safari
1385
+ tech:appwrite
1386
+ tech:arch-linux
1387
+ tech:arduino
1388
+ tech:argo-cd
1389
+ tech:astro
1390
+ tech:atom
1391
+ tech:autodesk-maya
1392
+ tech:autodesk-shot-grid
1393
+ tech:awk
1394
+ tech:azios
1395
+ tech:azure
1396
+ tech:azure-devops
1397
+ tech:azure-sql-database
1398
+ tech:babel
1399
+ tech:backbone-js
1400
+ tech:ballerina
1401
+ tech:bamboo
1402
+ tech:bash
1403
+ tech:behance
1404
+ tech:bitbucket
1405
+ tech:blender
1406
+ tech:bootstrap
1407
+ tech:bower
1408
+ tech:browserstack
1409
+ tech:bulma
1410
+ tech:bun
1411
+ tech:c
1412
+ tech:cairo-graphics
1413
+ tech:cake-php
1414
+ tech:canva
1415
+ tech:capacitor
1416
+ tech:cassandra
1417
+ tech:cent-os
1418
+ tech:chrome
1419
+ tech:circle-ci
1420
+ tech:clarity
1421
+ tech:clion
1422
+ tech:clojure
1423
+ tech:clojure-script
1424
+ tech:cloudflare
1425
+ tech:cloudflare-workers
1426
+ tech:cmake
1427
+ tech:code-igniter
1428
+ tech:code-pen
1429
+ tech:codeac
1430
+ tech:codecov
1431
+ tech:coffee-script
1432
+ tech:composer
1433
+ tech:confluence
1434
+ tech:consul
1435
+ tech:contao
1436
+ tech:corejs
1437
+ tech:cosmosdb
1438
+ tech:couchdb
1439
+ tech:cplusplus
1440
+ tech:crystal
1441
+ tech:csharp
1442
+ tech:css3
1443
+ tech:cucumber
1444
+ tech:cypress
1445
+ tech:d3js
1446
+ tech:dart
1447
+ tech:data-grip
1448
+ tech:data-spell
1449
+ tech:dbeaver
1450
+ tech:debian
1451
+ tech:deno
1452
+ tech:devicon
1453
+ tech:digital-ocean
1454
+ tech:discord-js
1455
+ tech:django
1456
+ tech:django-rest
1457
+ tech:docker
1458
+ tech:doctrine
1459
+ tech:dropwizard
1460
+ tech:drupal
1461
+ tech:eclipse-ceylon
1462
+ tech:eclipse-ide
1463
+ tech:eclipse-vert-x
1464
+ tech:elasticbeats
1465
+ tech:elasticsearch
1466
+ tech:electron
1467
+ tech:eleventy-11ty
1468
+ tech:elixir
1469
+ tech:elm
1470
+ tech:embedded-c
1471
+ tech:ember-js
1472
+ tech:envoy
1473
+ tech:erlang
1474
+ tech:eslint
1475
+ tech:express
1476
+ tech:facebook
1477
+ tech:fast-api
1478
+ tech:fastify
1479
+ tech:fauna
1480
+ tech:feathers
1481
+ tech:fedora
1482
+ tech:figma
1483
+ tech:file-zilla
1484
+ tech:firebase
1485
+ tech:firefox
1486
+ tech:flask
1487
+ tech:flutter
1488
+ tech:fortran
1489
+ tech:foundation
1490
+ tech:fsharp
1491
+ tech:gatling
1492
+ tech:gatsby
1493
+ tech:gazebo
1494
+ tech:gcc
1495
+ tech:gentoo
1496
+ tech:ghost
1497
+ tech:gimp
1498
+ tech:git
1499
+ tech:gitbook
1500
+ tech:github
1501
+ tech:github-actions
1502
+ tech:github-codespaces
1503
+ tech:gitlab
1504
+ tech:gitpod
1505
+ tech:gitter
1506
+ tech:gnu-emacs
1507
+ tech:go
1508
+ tech:go-land
1509
+ tech:godot-engine
1510
+ tech:google
1511
+ tech:google-cloud
1512
+ tech:gradle
1513
+ tech:grafana
1514
+ tech:grails
1515
+ tech:graphql
1516
+ tech:groovy
1517
+ tech:grunt-js
1518
+ tech:gulp-js
1519
+ tech:hadoop
1520
+ tech:handlebars
1521
+ tech:hardhat
1522
+ tech:harvester
1523
+ tech:hashicorp-vault
1524
+ tech:haskell
1525
+ tech:haxe
1526
+ tech:helm
1527
+ tech:heroku
1528
+ tech:hibernate
1529
+ tech:homebrew
1530
+ tech:html5
1531
+ tech:hugo
1532
+ tech:ibm-spss-statistics
1533
+ tech:ie10
1534
+ tech:ifttt
1535
+ tech:influxdb
1536
+ tech:inkscape
1537
+ tech:insomnia
1538
+ tech:intellij-idea
1539
+ tech:ionic
1540
+ tech:jaeger
1541
+ tech:jamstack
1542
+ tech:jasmine
1543
+ tech:java
1544
+ tech:javascript
1545
+ tech:jeet
1546
+ tech:jekyll
1547
+ tech:jenkins
1548
+ tech:jest
1549
+ tech:jetbrains
1550
+ tech:jira
1551
+ tech:jira-align
1552
+ tech:jquery
1553
+ tech:json
1554
+ tech:jule
1555
+ tech:julia
1556
+ tech:junit
1557
+ tech:jupyter
1558
+ tech:k3os
1559
+ tech:k3s
1560
+ tech:kafka
1561
+ tech:kaggle
1562
+ tech:karate
1563
+ tech:karma
1564
+ tech:keras
1565
+ tech:kibana
1566
+ tech:knex-js
1567
+ tech:knockout
1568
+ tech:kotlin
1569
+ tech:krakenjs
1570
+ tech:ktor
1571
+ tech:kubernetes
1572
+ tech:labview
1573
+ tech:laravel
1574
+ tech:latex
1575
+ tech:less-js
1576
+ tech:linkedin
1577
+ tech:linux
1578
+ tech:liquibase
1579
+ tech:livewire
1580
+ tech:llvm
1581
+ tech:logstash
1582
+ tech:lua
1583
+ tech:lumen
1584
+ tech:magento
1585
+ tech:markdown
1586
+ tech:material-ui
1587
+ tech:materialize
1588
+ tech:matlab
1589
+ tech:matplotlib
1590
+ tech:maven
1591
+ tech:meteor-js
1592
+ tech:microsoft-sql-server
1593
+ tech:minitab
1594
+ tech:mob-x
1595
+ tech:mocha
1596
+ tech:modx
1597
+ tech:moleculer
1598
+ tech:mongodb
1599
+ tech:mongoose-js
1600
+ tech:moodle
1601
+ tech:ms-dos
1602
+ tech:mysql
1603
+ tech:nano
1604
+ tech:nerog
1605
+ tech:nestjs
1606
+ tech:net
1607
+ tech:net-core
1608
+ tech:network-x
1609
+ tech:new4j
1610
+ tech:nextjs
1611
+ tech:nginx
1612
+ tech:nhibernate
1613
+ tech:nim
1614
+ tech:nimble
1615
+ tech:nix
1616
+ tech:nodejs
1617
+ tech:nodemon
1618
+ tech:nodewebkit
1619
+ tech:npm
1620
+ tech:nuget
1621
+ tech:num-py
1622
+ tech:nuxt-js
1623
+ tech:objective-c
1624
+ tech:ocaml
1625
+ tech:oh-my-zsh
1626
+ tech:okta
1627
+ tech:open-al
1628
+ tech:open-api
1629
+ tech:open-cl
1630
+ tech:open-cv
1631
+ tech:open-gl
1632
+ tech:open-stack
1633
+ tech:open-suse
1634
+ tech:open-telemetry
1635
+ tech:opera
1636
+ tech:oracle
1637
+ tech:p5js
1638
+ tech:packer
1639
+ tech:pandas
1640
+ tech:perl
1641
+ tech:pf-sense
1642
+ tech:phalcon
1643
+ tech:phoenix-framework
1644
+ tech:photon-engine
1645
+ tech:php
1646
+ tech:php-storm
1647
+ tech:playwrite
1648
+ tech:ploty
1649
+ tech:podman
1650
+ tech:polygon
1651
+ tech:portainer
1652
+ tech:postcss
1653
+ tech:postgresql
1654
+ tech:postman
1655
+ tech:powershell
1656
+ tech:processing
1657
+ tech:prometheus
1658
+ tech:protractor
1659
+ tech:purescript
1660
+ tech:putty
1661
+ tech:pycharm
1662
+ tech:pyscript
1663
+ tech:pytest
1664
+ tech:python
1665
+ tech:python-poetry
1666
+ tech:pytorch
1667
+ tech:qodana
1668
+ tech:qt
1669
+ tech:quarkus
1670
+ tech:quasar
1671
+ tech:qwik
1672
+ tech:r
1673
+ tech:rabbitmq
1674
+ tech:rancher
1675
+ tech:raspberrypi
1676
+ tech:reach
1677
+ tech:react
1678
+ tech:react-bootstrap
1679
+ tech:realm
1680
+ tech:red-cube-s-epic-compiler-thingy-programming-re-ct
1681
+ tech:redhat
1682
+ tech:redis
1683
+ tech:redux
1684
+ tech:ren-py
1685
+ tech:rider
1686
+ tech:robot-operating-system-ros
1687
+ tech:rocksdb
1688
+ tech:rollup-js
1689
+ tech:rspec
1690
+ tech:rstudio
1691
+ tech:ruby
1692
+ tech:ruby-mine
1693
+ tech:ruby-on-rails
1694
+ tech:rust
1695
+ tech:salesforce
1696
+ tech:sanity
1697
+ tech:sass
1698
+ tech:scala
1699
+ tech:scalingo
1700
+ tech:sdl
1701
+ tech:selenium
1702
+ tech:sema-software
1703
+ tech:sequelize
1704
+ tech:shopware
1705
+ tech:sketch
1706
+ tech:slack
1707
+ tech:socket-io
1708
+ tech:solid-js
1709
+ tech:solidity
1710
+ tech:sonarqube
1711
+ tech:sourcetree
1712
+ tech:spark
1713
+ tech:splunk
1714
+ tech:spring
1715
+ tech:sql-developer
1716
+ tech:sqlalchemy
1717
+ tech:sqlite
1718
+ tech:ssh
1719
+ tech:stackoverflow
1720
+ tech:stata
1721
+ tech:storybook
1722
+ tech:streamlit
1723
+ tech:stylus
1724
+ tech:subversion
1725
+ tech:svelte
1726
+ tech:swagger
1727
+ tech:swift
1728
+ tech:symfony
1729
+ tech:tailwind-css
1730
+ tech:tauri
1731
+ tech:tensorflow
1732
+ tech:terraform
1733
+ tech:tex
1734
+ tech:the-algorithms
1735
+ tech:three-js
1736
+ tech:titanium-sdk
1737
+ tech:tomcat
1738
+ tech:tortoise-git
1739
+ tech:tower
1740
+ tech:traefik-mesh
1741
+ tech:traefik-proxy
1742
+ tech:travis-ci
1743
+ tech:trello
1744
+ tech:twitter
1745
+ tech:typescript
1746
+ tech:typo3
1747
+ tech:ubuntu
1748
+ tech:uml
1749
+ tech:unity
1750
+ tech:unix
1751
+ tech:unreal-engine
1752
+ tech:uwsgi
1753
+ tech:v8
1754
+ tech:vagrant
1755
+ tech:vala
1756
+ tech:vercel
1757
+ tech:veutify
1758
+ tech:vim
1759
+ tech:visualstudio
1760
+ tech:vite
1761
+ tech:vitejs
1762
+ tech:vscode
1763
+ tech:vsphere
1764
+ tech:vue
1765
+ tech:vue-storefront
1766
+ tech:vyper
1767
+ tech:webassembly
1768
+ tech:webflow
1769
+ tech:weblate
1770
+ tech:webpack
1771
+ tech:webstorm
1772
+ tech:windows8
1773
+ tech:windows11
1774
+ tech:woo-commerce
1775
+ tech:wordpress
1776
+ tech:xamarin
1777
+ tech:xcode
1778
+ tech:xml
1779
+ tech:yaml
1780
+ tech:yarn
1781
+ tech:yii-framework
1782
+ tech:yuno-host
1783
+ tech:zend-framework
1784
+ tech:zig
1785
+ }}`,Y_="likec4builtin",oX=`${Y_}:///likec4/lib/icons.c4`;var Qi=Fs();const uX=new Qi.NotificationType("likec4/onDidChangeModel"),cX=new Qi.RequestType0("likec4/fetchModel"),lX=new Qi.RequestType("likec4/fetchComputedModel"),dX=new Qi.RequestType("likec4/computeView"),fX=new Qi.RequestType("likec4/layout-view"),pX=new Qi.RequestType("likec4/build"),hX=new Qi.RequestType("likec4/locate"),mX=new Qi.RequestType("likec4/change-view");class gX extends Qv{constructor(e){super(),this.services=e}init(){const e=this.services.likec4.ModelBuilder,n=this.services.likec4.ModelLocator,r=this.services.likec4.ModelChanges,i=this.services.likec4.Views,s=this.services.shared.lsp.Connection;if(!s){Me.info("[ServerRpc] no connection, not initializing");return}Me.info("[ServerRpc] init");const a=this.services.shared.workspace.LangiumDocuments,o=this.services.shared.workspace.DocumentBuilder,u=_j(()=>{s.sendNotification(uX,"").catch(l=>(Me.warn(`[ServerRpc] error sending onDidChangeModel: ${l}`),Promise.resolve()))},{minQuietPeriodMs:250,maxBurstDurationMs:1e3,minGapMs:200});let c=!0;this.onDispose(e.onModelParsed(()=>u.call()),s.onRequest(lX,async({cleanCaches:l},d)=>(l&&(this.services.WorkspaceCache.clear(),this.services.DocumentCache.clear()),{model:await e.buildComputedModel(d)})),s.onRequest(cX,async l=>({model:await e.buildModel(l)})),s.onRequest(dX,async({viewId:l},d)=>({view:await e.computeView(l,d)})),s.onRequest(fX,async({viewId:l},d)=>({result:await i.layoutView(l,d)})),s.onRequest(pX,async({docs:l},d)=>{const f=l.map(y=>Jt.parse(y)),p=y=>f.every(b=>!kt.equals(b,y)),h=a.all.filter(y=>Sd(y)&&p(y.uri)&&y.uri.scheme!==Y_).map(y=>y.uri).toArray();Me.debug(`[ServerRpc] received request to build:
1786
+ changed (total ${f.length}):${l.map(y=>`
1787
+ - `+y).join("")}
1788
+ deleted (total ${h.length}):${h.map(y=>`
1789
+ - `+y.toString()).join(`
1790
+ `)}`),!c&&f.length+h.length>0&&await Promise.allSettled([...f,...h].map(async y=>{const b=y.toString();Me.debug(`clear diagnostics for ${b}`);try{await s.sendDiagnostics({uri:b,diagnostics:[]})}catch(w){Me.warn(`error clearing diagnostics for ${b}: ${w}`)}})),c=!1,await It(d),await o.update(f,h,d)}),s.onRequest(hX,l=>{switch(!0){case"element"in l:return n.locateElement(l.element,l.property??"name");case"relation"in l:return n.locateRelation(l.relation);case"view"in l:return n.locateView(l.view);case"deployment"in l:return n.locateDeploymentElement(l.deployment,l.property??"name");default:Ae(l)}}),s.onRequest(mX,async(l,d)=>await r.applyChange(l)),_s.create(()=>{u.cancel()}))}}class yX{constructor(e){this.services=e}getSymbolKind(e){const n=$t(e)?e.$type:e.type,r=(...i)=>i.some(s=>this.services.AstReflection.isSubtype(n,s));switch(!0){case r(Zn,Zs,zi,Mi):return dr.Constructor;case r(no,io,ro,eo,po):return dr.Namespace;case r(Ys):return dr.Class;case r(Ui,ta,Qs,ho):return dr.EnumMember;case r(ji,lo):return dr.Event;case r(gi,Bi,uo,ao):return dr.TypeParameter}return dr.Field}getCompletionItemKind(e){const n=$t(e)?e.$type:e.type,r=(...i)=>i.some(s=>this.services.AstReflection.isSubtype(n,s));switch(!0){case r(Qs):return xt.Color;case r(Zn,zi,Mi,Zs):return xt.Constructor;case r(no,io,ro,eo,po):return xt.Module;case r(Ys):return xt.Class;case r(Ui,ta,Qs,ho):return xt.EnumMember;case r(ji,lo):return xt.Event;case r(gi,uo,Bi,ao):return xt.TypeParameter;default:return xt.Reference}}}class wX extends bT{documentFactory;constructor(e){super(e),this.documentFactory=e.workspace.LangiumDocumentFactory}async loadAdditionalDocuments(e,n){n(this.documentFactory.fromString(aX,Jt.parse(oX))),await super.loadAdditionalDocuments(e,n)}workspace(){return this.folders&&sN(this.folders,1)?this.folders[0]:null}get workspaceUri(){const e=this.workspace();return _e(e,"Workspace not initialized"),Jt.parse(e.uri)}get workspaceURL(){const e=this.workspace();return _e(e,"Workspace not initialized"),new URL(e.uri)}}class vX extends TC{}class bX{constructor(e){this.services=e}cache=new WeakMap;viewsWithReportedErrors=new Set;get layouter(){return this.services.likec4.Layouter}async computedViews(e){const n=await this.services.likec4.ModelBuilder.buildComputedModel(e);return n?Wu(n.views):[]}async layoutAllViews(e){const n=await this.computedViews(e);if(n.length===0)return[];const r=[],i=[];for(const s of n)this.viewsWithReportedErrors.delete(s.id),i.push(this.layouter.layout(s).then(a=>(this.cache.set(s,a),a)).catch(a=>(this.cache.delete(s),ve(a),Promise.reject(a))));for(const s of await Promise.allSettled(i))s.status==="fulfilled"&&r.push(s.value);return r}async layoutView(e,n){const r=await this.services.likec4.ModelBuilder.buildComputedModel(n);if(!r)return null;const i=r.views[e];if(!i)return null;let s=this.cache.get(i);if(s)return s;try{const a=await this.layouter.layout(i);return this.viewsWithReportedErrors.delete(e),this.cache.set(i,a),a}catch(a){if(!this.viewsWithReportedErrors.has(e)){const o=a instanceof Error?a.message:""+a;this.services.shared.lsp.Connection?.window.showErrorMessage(`LikeC4: ${o}`),this.viewsWithReportedErrors.add(e)}return Me.error(a),Promise.reject(a)}}async diagrams(){return(await this.layoutAllViews()).map(e=>e.diagram)}async viewsAsGraphvizOut(){const e="All-LayoutedViews-DotWithSvg",n=this.services.WorkspaceCache;if(n.has(e))return await Promise.resolve(n.get(e));const r=(await this.computedViews()).map(async a=>{const{dot:o,svg:u}=await this.layouter.svg(a);return{id:a.id,dot:o,svg:u}}),i=[],s=await Promise.allSettled(r);for(const a of s)a.status==="fulfilled"?i.push(a.value):ve(a.reason);return n.set(e,i),i}async overviewGraph(){const e="OverviewGraph",n=this.services.WorkspaceCache;if(n.has(e))return await Promise.resolve(n.get(e));const r=await this.computedViews(),i=await this.layouter.layoutOverviewGraph(r);return n.set(e,i),i}}const DX={lsp:{NodeKindProvider:t=>new yX(t),WorkspaceSymbolProvider:t=>new vX(t)},workspace:{WorkspaceManager:t=>new wX(t)}};function Nt(t){return e=>new t(e)}const EX={documentation:{DocumentationProvider:Nt(b5)},WorkspaceCache:t=>new yT(t.shared),DocumentCache:t=>new gT(t.shared),Rpc:Nt(gX),likec4:{Layouter:t=>(Me.debug("Creating GraphvizLayouter with GraphvizWasmAdapter"),new T_(new ko)),Views:Nt(bX),DeploymentsIndex:Nt(j5),ModelChanges:Nt(eX),FqnIndex:Nt(V5),ModelParser:Nt(WY),ModelBuilder:Nt(Q5),ModelLocator:Nt(tK)},lsp:{CompletionProvider:Nt(S5),DocumentHighlightProvider:Nt(T5),DocumentSymbolProvider:Nt(L5),SemanticTokenProvider:Nt(G5),HoverProvider:Nt(q5),CodeLensProvider:Nt($5),DocumentLinkProvider:Nt(F5),Formatter:Nt(R5)},references:{NameProvider:Nt(tX),ScopeComputation:Nt(rX),ScopeProvider:Nt(sX)}};function RX(t,e,n,r){const i=$X(t),s=[CU({shared:i}),Y4,EX,e,n,r].reduce(X_,{}),a=Rp(s);return i.ServiceRegistry.register(a),OK(a),t.connection?a.Rpc.init():i.workspace.ConfigurationProvider.initialized({}),{shared:i,likec4:a}}function $X(t={}){const e={...LT,...t};return t.connection&&o7(t.connection),Rp(_U(e),K4,DX)}function X_(t,e){if(e){for(const[n,r]of Object.entries(e))if(r!==void 0){const i=t[n];i!==null&&r!==null&&typeof i=="object"&&typeof r=="object"?t[n]=X_(i,r):t[n]=r}}return t}function ln(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}const ab=(t,e)=>{const n=J_(t);if(typeof n!="string")throw new TypeError(`${e} must be a string or a file URL: ${n}.`);return n},J_=t=>t instanceof URL?Gm(t):t,Q_=(t,e=[],n={})=>{const r=ab(t,"First argument"),[i,s]=ln(e)?[[],e]:[e,n];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(u=>typeof u=="object"&&u!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);const a=i.map(String),o=a.find(u=>u.includes("\0"));if(o!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${o}`);if(!ln(s))throw new TypeError(`Last argument must be an options object: ${s}`);return[r,a,s]},{toString:Z_}=Object.prototype,SX=t=>Z_.call(t)==="[object ArrayBuffer]",wr=t=>Z_.call(t)==="[object Uint8Array]",Pd=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),TX=new TextEncoder,eP=t=>TX.encode(t),kX=new TextDecoder,tP=t=>kX.decode(t),CX=(t,e)=>AX(t,e).join(""),AX=(t,e)=>{if(e==="utf8"&&t.every(s=>typeof s=="string"))return t;const n=new GD(e),r=t.map(s=>typeof s=="string"?eP(s):s).map(s=>n.write(s)),i=n.end();return i===""?r:[...r,i]},ob=t=>t.length===1&&wr(t[0])?t[0]:nP(_X(t)),_X=t=>t.map(e=>typeof e=="string"?eP(e):e),nP=t=>{const e=new Uint8Array(PX(t));let n=0;for(const r of t)e.set(r,n),n+=r.length;return e},PX=t=>{let e=0;for(const n of t)e+=n.length;return e},xX=t=>Array.isArray(t)&&Array.isArray(t.raw),IX=(t,e)=>{let n=[];for(const[s,a]of t.entries())n=NX({templates:t,expressions:e,tokens:n,index:s,template:a});if(n.length===0)throw new TypeError("Template script must not be empty");const[r,...i]=n;return[r,i,{}]},NX=({templates:t,expressions:e,tokens:n,index:r,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[r]}`);const{nextTokens:s,leadingWhitespaces:a,trailingWhitespaces:o}=OX(i,t.raw[r]),u=iP(n,s,a);if(r===e.length)return u;const c=e[r],l=Array.isArray(c)?c.map(d=>sP(d)):[sP(c)];return iP(u,l,o)},OX=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};const n=[];let r=0;const i=rP.has(e[0]);for(let a=0,o=0;a<t.length;a+=1,o+=1){const u=e[o];if(rP.has(u))r!==a&&n.push(t.slice(r,a)),r=a+1;else if(u==="\\"){const c=e[o+1];c==="u"&&e[o+2]==="{"?o=e.indexOf("}",o+3):o+=FX[c]??1}}const s=r===t.length;return s||n.push(t.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:s}},rP=new Set([" "," ","\r",`
1791
+ `]),FX={x:3,u:5},iP=(t,e,n)=>n||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],sP=t=>{const e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(ln(t)&&("stdout"in t||"isMaxBuffer"in t))return LX(t);throw t instanceof qD||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},LX=({stdout:t})=>{if(typeof t=="string")return t;if(wr(t))return tP(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)},da=t=>ub.includes(t),ub=[ot.stdin,ot.stdout,ot.stderr],Gr=["stdin","stdout","stderr"],aP=t=>Gr[t]??`stdio[${t}]`,MX=t=>{const e={...t};for(const n of lP)e[n]=oP(t,n);return e},oP=(t,e)=>{const n=Array.from({length:zX(t)+1}),r=BX(t[e],n,e);return WX(r,e)},zX=({stdio:t})=>Array.isArray(t)?Math.max(t.length,Gr.length):Gr.length,BX=(t,e,n)=>ln(t)?qX(t,e,n):e.fill(t),qX=(t,e,n)=>{for(const r of Object.keys(t).sort(GX))for(const i of jX(r,n,e))e[i]=t[r];return e},GX=(t,e)=>uP(t)<uP(e)?1:-1,uP=t=>t==="stdout"||t==="stderr"?0:t==="all"?2:1,jX=(t,e,n)=>{if(t==="ipc")return[n.length-1];const r=cP(t);if(r===void 0||r===0)throw new TypeError(`"${e}.${t}" is invalid.
1792
+ It must be "${e}.stdout", "${e}.stderr", "${e}.all", "${e}.ipc", or "${e}.fd3", "${e}.fd4" (and so on).`);if(r>=n.length)throw new TypeError(`"${e}.${t}" is invalid: that file descriptor does not exist.
1793
+ Please set the "stdio" option to ensure that file descriptor exists.`);return r==="all"?[1,2]:[r]},cP=t=>{if(t==="all")return t;if(Gr.includes(t))return Gr.indexOf(t);const e=UX.exec(t);if(e!==null)return Number(e[1])},UX=/^fd(\d+)$/,WX=(t,e)=>t.map(n=>n===void 0?VX[e]:n),HX=M1("execa").enabled?"full":"none",VX={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:HX,stripFinalNewline:!0},lP=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],xd=(t,e)=>e==="ipc"?t.at(-1):t[e],cb=({verbose:t},e)=>db(t,e)!=="none",lb=({verbose:t},e)=>!["none","short"].includes(db(t,e)),KX=({verbose:t},e)=>{const n=db(t,e);return fb(n)?n:void 0},db=(t,e)=>e===void 0?YX(t):xd(t,e),YX=t=>t.find(e=>fb(e))??pb.findLast(e=>t.includes(e)),fb=t=>typeof t=="function",pb=["none","short","full"],XX=(t,e)=>{const n=[t,...e],r=n.join(" "),i=n.map(s=>nJ(dP(s))).join(" ");return{command:r,escapedCommand:i}},hb=t=>z1(t).split(`
1794
+ `).map(e=>dP(e)).join(`
1795
+ `),dP=t=>t.replaceAll(ZX,e=>JX(e)),JX=t=>{const e=eJ[t];if(e!==void 0)return e;const n=t.codePointAt(0),r=n.toString(16);return n<=tJ?`\\u${r.padStart(4,"0")}`:`\\U${r}`},QX=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},ZX=QX(),eJ={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},tJ=65535,nJ=t=>rJ.test(t)?t:oN==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,rJ=/^[\w./-]+$/;function iJ(){return ot.platform!=="win32"?ot.env.TERM!=="linux":!!ot.env.WT_SESSION||!!ot.env.TERMINUS_SUBLIME||ot.env.ConEmuTask==="{cmd::Cmder}"||ot.env.TERM_PROGRAM==="Terminus-Sublime"||ot.env.TERM_PROGRAM==="vscode"||ot.env.TERM==="xterm-256color"||ot.env.TERM==="alacritty"||ot.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const fP={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},sJ={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},aJ={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},oJ={...fP,...sJ},uJ={...fP,...aJ},cJ=iJ(),mb=cJ?oJ:uJ,lJ=zD.WriteStream.prototype.hasColors(),hm=(t,e)=>{if(!lJ)return i=>i;const n=`\x1B[${t}m`,r=`\x1B[${e}m`;return i=>{const s=i+"";let a=s.indexOf(r);if(a===-1)return n+s+r;let o=n,u=0;for(;a!==-1;)o+=s.slice(u,a)+n,u=a+r.length,a=s.indexOf(r,u);return o+=s.slice(u)+r,o}},dJ=hm(1,22),gb=hm(90,39),fJ=hm(91,39),pJ=hm(93,39),hJ=({type:t,message:e,timestamp:n,piped:r,commandId:i,result:{failed:s=!1}={},options:{reject:a=!0}})=>{const o=mJ(n),u=gJ[t]({failed:s,reject:a,piped:r}),c=yJ[t]({reject:a});return`${gb(`[${o}]`)} ${gb(`[${i}]`)} ${c(u)} ${c(e)}`},mJ=t=>`${mm(t.getHours(),2)}:${mm(t.getMinutes(),2)}:${mm(t.getSeconds(),2)}.${mm(t.getMilliseconds(),3)}`,mm=(t,e)=>String(t).padStart(e,"0"),pP=({failed:t,reject:e})=>t?e?mb.cross:mb.warning:mb.tick,gJ={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:pP,duration:pP},hP=t=>t,yJ={command:()=>dJ,output:()=>hP,ipc:()=>hP,error:({reject:t})=>t?fJ:pJ,duration:()=>gb},wJ=(t,e,n)=>{const r=KX(e,n);return t.map(({verboseLine:i,verboseObject:s})=>vJ(i,s,r)).filter(i=>i!==void 0).map(i=>bJ(i)).join("")},vJ=(t,e,n)=>{if(n===void 0)return t;const r=n(t,e);if(typeof r=="string")return r},bJ=t=>t.endsWith(`
1796
+ `)?t:`${t}
1797
+ `,Id=({type:t,verboseMessage:e,fdNumber:n,verboseInfo:r,result:i})=>{const s=DJ({type:t,result:i,verboseInfo:r}),a=EJ(e,s),o=wJ(a,r,n);TD($J,o)},DJ=({type:t,result:e,verboseInfo:{escapedCommand:n,commandId:r,rawOptions:{piped:i=!1,...s}}})=>({type:t,escapedCommand:n,commandId:`${r}`,timestamp:new Date,piped:i,result:e,options:s}),EJ=(t,e)=>t.split(`
1798
+ `).map(n=>RJ({...e,message:n})),RJ=t=>({verboseLine:hJ(t),verboseObject:t}),$J=2,mP=t=>{const e=typeof t=="string"?t:Wd(t);return hb(e).replaceAll(" "," ".repeat(SJ))},SJ=2,TJ=(t,e)=>{cb(e)&&Id({type:"command",verboseMessage:t,verboseInfo:e})},kJ=(t,e,n)=>{_J(t);const r=CJ(t);return{verbose:t,escapedCommand:e,commandId:r,rawOptions:n}},CJ=t=>cb({verbose:t})?AJ++:void 0;let AJ=0n;const _J=t=>{for(const e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!pb.includes(e)&&!fb(e)){const n=pb.map(r=>`'${r}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${n} or a function.`)}}},gP=()=>Yd.bigint(),yP=t=>Number(Yd.bigint()-t)/1e6,wP=(t,e,n)=>{const r=gP(),{command:i,escapedCommand:s}=XX(t,e),a=oP(n,"verbose"),o=kJ(a,s,{...n});return TJ(s,o),{command:i,escapedCommand:s,startTime:r,verboseInfo:o}};var fa={exports:{}},yb,vP;function PJ(){if(vP)return yb;vP=1,yb=r,r.sync=i;var t=Ea;function e(s,a){var o=a.pathExt!==void 0?a.pathExt:process.env.PATHEXT;if(!o||(o=o.split(";"),o.indexOf("")!==-1))return!0;for(var u=0;u<o.length;u++){var c=o[u].toLowerCase();if(c&&s.substr(-c.length).toLowerCase()===c)return!0}return!1}function n(s,a,o){return!s.isSymbolicLink()&&!s.isFile()?!1:e(a,o)}function r(s,a,o){t.stat(s,function(u,c){o(u,u?!1:n(c,s,a))})}function i(s,a){return n(t.statSync(s),s,a)}return yb}var wb,bP;function xJ(){if(bP)return wb;bP=1,wb=e,e.sync=n;var t=Ea;function e(s,a,o){t.stat(s,function(u,c){o(u,u?!1:r(c,a))})}function n(s,a){return r(t.statSync(s),a)}function r(s,a){return s.isFile()&&i(s,a)}function i(s,a){var o=s.mode,u=s.uid,c=s.gid,l=a.uid!==void 0?a.uid:process.getuid&&process.getuid(),d=a.gid!==void 0?a.gid:process.getgid&&process.getgid(),f=parseInt("100",8),p=parseInt("010",8),h=parseInt("001",8),y=f|p,b=o&h||o&p&&c===d||o&f&&u===l||o&y&&l===0;return b}return wb}var vb,DP;function IJ(){if(DP)return vb;DP=1;var t;process.platform==="win32"||sG.TESTING_WINDOWS?t=PJ():t=xJ(),vb=e,e.sync=n;function e(r,i,s){if(typeof i=="function"&&(s=i,i={}),!s){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(a,o){e(r,i||{},function(u,c){u?o(u):a(c)})})}t(r,i||{},function(a,o){a&&(a.code==="EACCES"||i&&i.ignoreErrors)&&(a=null,o=!1),s(a,o)})}function n(r,i){try{return t.sync(r,i||{})}catch(s){if(i&&i.ignoreErrors||s.code==="EACCES")return!1;throw s}}return vb}var bb,EP;function NJ(){if(EP)return bb;EP=1;const t=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",e=$r,n=t?";":":",r=IJ(),i=u=>Object.assign(new Error(`not found: ${u}`),{code:"ENOENT"}),s=(u,c)=>{const l=c.colon||n,d=u.match(/\//)||t&&u.match(/\\/)?[""]:[...t?[process.cwd()]:[],...(c.path||process.env.PATH||"").split(l)],f=t?c.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",p=t?f.split(l):[""];return t&&u.indexOf(".")!==-1&&p[0]!==""&&p.unshift(""),{pathEnv:d,pathExt:p,pathExtExe:f}},a=(u,c,l)=>{typeof c=="function"&&(l=c,c={}),c||(c={});const{pathEnv:d,pathExt:f,pathExtExe:p}=s(u,c),h=[],y=w=>new Promise((E,$)=>{if(w===d.length)return c.all&&h.length?E(h):$(i(u));const k=d[w],A=/^".*"$/.test(k)?k.slice(1,-1):k,I=e.join(A,u),M=!A&&/^\.[\\\/]/.test(u)?u.slice(0,2)+I:I;E(b(M,w,0))}),b=(w,E,$)=>new Promise((k,A)=>{if($===f.length)return k(y(E+1));const I=f[$];r(w+I,{pathExt:p},(M,Y)=>{if(!M&&Y)if(c.all)h.push(w+I);else return k(w+I);return k(b(w,E,$+1))})});return l?y(0).then(w=>l(null,w),l):y(0)},o=(u,c)=>{c=c||{};const{pathEnv:l,pathExt:d,pathExtExe:f}=s(u,c),p=[];for(let h=0;h<l.length;h++){const y=l[h],b=/^".*"$/.test(y)?y.slice(1,-1):y,w=e.join(b,u),E=!b&&/^\.[\\\/]/.test(u)?u.slice(0,2)+w:w;for(let $=0;$<d.length;$++){const k=E+d[$];try{if(r.sync(k,{pathExt:f}))if(c.all)p.push(k);else return k}catch{}}}if(c.all&&p.length)return p;if(c.nothrow)return null;throw i(u)};return bb=a,a.sync=o,bb}var gm={exports:{}},RP;function OJ(){if(RP)return gm.exports;RP=1;const t=(e={})=>{const n=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(n).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};return gm.exports=t,gm.exports.default=t,gm.exports}var Db,$P;function FJ(){if($P)return Db;$P=1;const t=$r,e=NJ(),n=OJ();function r(s,a){const o=s.options.env||process.env,u=process.cwd(),c=s.options.cwd!=null,l=c&&process.chdir!==void 0&&!process.chdir.disabled;if(l)try{process.chdir(s.options.cwd)}catch{}let d;try{d=e.sync(s.command,{path:o[n({env:o})],pathExt:a?t.delimiter:void 0})}catch{}finally{l&&process.chdir(u)}return d&&(d=t.resolve(c?s.options.cwd:"",d)),d}function i(s){return r(s)||r(s,!0)}return Db=i,Db}var ym={},SP;function LJ(){if(SP)return ym;SP=1;const t=/([()\][%!^"`<>&|;, *?])/g;function e(r){return r=r.replace(t,"^$1"),r}function n(r,i){return r=`${r}`,r=r.replace(/(\\*)"/g,'$1$1\\"'),r=r.replace(/(\\*)$/,"$1$1"),r=`"${r}"`,r=r.replace(t,"^$1"),i&&(r=r.replace(t,"^$1")),r}return ym.command=e,ym.argument=n,ym}var Eb,TP;function MJ(){return TP||(TP=1,Eb=/^#!(.*)/),Eb}var Rb,kP;function zJ(){if(kP)return Rb;kP=1;const t=MJ();return Rb=(e="")=>{const n=e.match(t);if(!n)return null;const[r,i]=n[0].replace(/#! ?/,"").split(" "),s=r.split("/").pop();return s==="env"?i:i?`${s} ${i}`:s},Rb}var $b,CP;function BJ(){if(CP)return $b;CP=1;const t=Ea,e=zJ();function n(r){const s=Buffer.alloc(150);let a;try{a=t.openSync(r,"r"),t.readSync(a,s,0,150,0),t.closeSync(a)}catch{}return e(s.toString())}return $b=n,$b}var Sb,AP;function qJ(){if(AP)return Sb;AP=1;const t=$r,e=FJ(),n=LJ(),r=BJ(),i=process.platform==="win32",s=/\.(?:com|exe)$/i,a=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function o(l){l.file=e(l);const d=l.file&&r(l.file);return d?(l.args.unshift(l.file),l.command=d,e(l)):l.file}function u(l){if(!i)return l;const d=o(l),f=!s.test(d);if(l.options.forceShell||f){const p=a.test(d);l.command=t.normalize(l.command),l.command=n.command(l.command),l.args=l.args.map(y=>n.argument(y,p));const h=[l.command].concat(l.args).join(" ");l.args=["/d","/s","/c",`"${h}"`],l.command=process.env.comspec||"cmd.exe",l.options.windowsVerbatimArguments=!0}return l}function c(l,d,f){d&&!Array.isArray(d)&&(f=d,d=null),d=d?d.slice(0):[],f=Object.assign({},f);const p={command:l,args:d,options:f,file:void 0,original:{command:l,args:d}};return f.shell?p:u(p)}return Sb=c,Sb}var Tb,_P;function GJ(){if(_P)return Tb;_P=1;const t=process.platform==="win32";function e(s,a){return Object.assign(new Error(`${a} ${s.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${a} ${s.command}`,path:s.command,spawnargs:s.args})}function n(s,a){if(!t)return;const o=s.emit;s.emit=function(u,c){if(u==="exit"){const l=r(c,a);if(l)return o.call(s,"error",l)}return o.apply(s,arguments)}}function r(s,a){return t&&s===1&&!a.file?e(a.original,"spawn"):null}function i(s,a){return t&&s===1&&!a.file?e(a.original,"spawnSync"):null}return Tb={hookChildProcess:n,verifyENOENT:r,verifyENOENTSync:i,notFoundError:e},Tb}var PP;function jJ(){if(PP)return fa.exports;PP=1;const t=PD,e=qJ(),n=GJ();function r(s,a,o){const u=e(s,a,o),c=t.spawn(u.command,u.args,u.options);return n.hookChildProcess(c,u),c}function i(s,a,o){const u=e(s,a,o),c=t.spawnSync(u.command,u.args,u.options);return c.error=c.error||n.verifyENOENTSync(c.status,u),c}return fa.exports=r,fa.exports.spawn=r,fa.exports.sync=i,fa.exports._parse=e,fa.exports._enoent=n,fa.exports}var UJ=jJ();const WJ=Ss(UJ);function xP(t={}){const{env:e=process.env,platform:n=process.platform}=t;return n!=="win32"?"PATH":Object.keys(e).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"}const HJ=({cwd:t=ot.cwd(),path:e=ot.env[xP()],preferLocal:n=!0,execPath:r=ot.execPath,addExecPath:i=!0}={})=>{const s=t instanceof URL?Gm(t):t,a=Wr.resolve(s),o=[];return n&&VJ(o,a),i&&KJ(o,r,a),[...o,e].join(Wr.delimiter)},VJ=(t,e)=>{let n;for(;n!==e;)t.push(Wr.join(e,"node_modules/.bin")),n=e,e=Wr.resolve(e,"..")},KJ=(t,e,n)=>{const r=e instanceof URL?Gm(e):e;t.push(Wr.resolve(n,r,".."))},YJ=({env:t=ot.env,...e}={})=>{t={...t};const n=xP({env:t});return e.path=t[n],t[n]=HJ(e),t},XJ=(t,e,n)=>{const r=n?Ab:Cb,i=t instanceof Nd?{}:{cause:t};return new r(e,i)};class Nd extends Error{}const IP=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,NP,{value:!0,writable:!1,enumerable:!1,configurable:!1})},JJ=t=>kb(t)&&NP in t,NP=Symbol("isExecaError"),kb=t=>Object.prototype.toString.call(t)==="[object Error]";class Cb extends Error{}IP(Cb,Cb.name);class Ab extends Error{}IP(Ab,Ab.name);const QJ=()=>{const t=FP-OP+1;return Array.from({length:t},ZJ)},ZJ=(t,e)=>({name:`SIGRT${e+1}`,number:OP+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),OP=34,FP=64,eQ=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}],LP=()=>{const t=QJ();return[...eQ,...t].map(tQ)},tQ=({name:t,number:e,description:n,action:r,forced:i=!1,standard:s})=>{const{signals:{[t]:a}}=ds,o=a!==void 0;return{name:t,number:o?a:e,description:n,supported:o,action:r,forced:i,standard:s}},nQ=()=>{const t=LP();return Object.fromEntries(t.map(rQ))},rQ=({name:t,number:e,description:n,supported:r,action:i,forced:s,standard:a})=>[t,{name:t,number:e,description:n,supported:r,action:i,forced:s,standard:a}],iQ=nQ(),sQ=()=>{const t=LP(),e=FP+1,n=Array.from({length:e},(r,i)=>aQ(i,t));return Object.assign({},...n)},aQ=(t,e)=>{const n=oQ(t,e);if(n===void 0)return{};const{name:r,description:i,supported:s,action:a,forced:o,standard:u}=n;return{[t]:{name:r,number:t,description:i,supported:s,action:a,forced:o,standard:u}}},oQ=(t,e)=>{const n=e.find(({name:r})=>ds.signals[r]===t);return n!==void 0?n:e.find(r=>r.number===t)};sQ();const uQ=t=>{const e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return MP(t,e)},cQ=t=>t===0?t:MP(t,"`subprocess.kill()`'s argument"),MP=(t,e)=>{if(Number.isInteger(t))return lQ(t,e);if(typeof t=="string")return fQ(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer.
1799
+ ${_b()}`)},lQ=(t,e)=>{if(zP.has(t))return zP.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist.
1800
+ ${_b()}`)},dQ=()=>new Map(Object.entries(ds.signals).reverse().map(([t,e])=>[e,t])),zP=dQ(),fQ=(t,e)=>{if(t in ds.signals)return t;throw t.toUpperCase()in ds.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist.
1801
+ ${_b()}`)},_b=()=>`Available signal names: ${pQ()}.
1802
+ Available signal numbers: ${hQ()}.`,pQ=()=>Object.keys(ds.signals).sort().map(t=>`'${t}'`).join(", "),hQ=()=>[...new Set(Object.values(ds.signals).sort((t,e)=>t-e))].join(", "),BP=t=>iQ[t].description,mQ=t=>{if(t===!1)return t;if(t===!0)return gQ;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},gQ=1e3*5,yQ=({kill:t,options:{forceKillAfterDelay:e,killSignal:n},onInternalError:r,context:i,controller:s},a,o)=>{const{signal:u,error:c}=wQ(a,o,n);vQ(c,r);const l=t(u);return bQ({kill:t,signal:u,forceKillAfterDelay:e,killSignal:n,killResult:l,context:i,controller:s}),l},wQ=(t,e,n)=>{const[r=n,i]=kb(t)?[void 0,t]:[t,e];if(typeof r!="string"&&!Number.isInteger(r))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(r)}`);if(i!==void 0&&!kb(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:cQ(r),error:i}},vQ=(t,e)=>{t!==void 0&&e.reject(t)},bQ=async({kill:t,signal:e,forceKillAfterDelay:n,killSignal:r,killResult:i,context:s,controller:a})=>{e===r&&i&&qP({kill:t,forceKillAfterDelay:n,context:s,controllerSignal:a.signal})},qP=async({kill:t,forceKillAfterDelay:e,context:n,controllerSignal:r})=>{if(e!==!1)try{await jD(e,void 0,{signal:r}),t("SIGKILL")&&(n.isForcefullyTerminated??=!0)}catch{}},GP=async(t,e)=>{t.aborted||await Sn(t,"abort",{signal:e})},DQ=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},EQ=({subprocess:t,cancelSignal:e,gracefulCancel:n,context:r,controller:i})=>e===void 0||n?[]:[RQ(t,e,r,i)],RQ=async(t,e,n,{signal:r})=>{throw await GP(e,r),n.terminationReason??="cancel",t.kill(),e.reason},Pb=({methodName:t,isSubprocess:e,ipc:n,isConnected:r})=>{$Q(t,e,n),jP(t,e,r)},$Q=(t,e,n)=>{if(!n)throw new Error(`${vr(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},jP=(t,e,n)=>{if(!n)throw new Error(`${vr(t,e)} cannot be used: the ${Zi(e)} has already exited or disconnected.`)},SQ=t=>{throw new Error(`${vr("getOneMessage",t)} could not complete: the ${Zi(t)} exited or disconnected.`)},TQ=t=>{throw new Error(`${vr("sendMessage",t)} failed: the ${Zi(t)} is sending a message too, instead of listening to incoming messages.
1803
+ This can be fixed by both sending a message and listening to incoming messages at the same time:
1804
+
1805
+ const [receivedMessage] = await Promise.all([
1806
+ ${vr("getOneMessage",t)},
1807
+ ${vr("sendMessage",t,"message, {strict: true}")},
1808
+ ]);`)},UP=(t,e)=>new Error(`${vr("sendMessage",e)} failed when sending an acknowledgment response to the ${Zi(e)}.`,{cause:t}),kQ=t=>{throw new Error(`${vr("sendMessage",t)} failed: the ${Zi(t)} is not listening to incoming messages.`)},CQ=t=>{throw new Error(`${vr("sendMessage",t)} failed: the ${Zi(t)} exited without listening to incoming messages.`)},AQ=()=>new Error(`\`cancelSignal\` aborted: the ${Zi(!0)} disconnected.`),_Q=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},PQ=({error:t,methodName:e,isSubprocess:n})=>{if(t.code==="EPIPE")throw new Error(`${vr(e,n)} cannot be used: the ${Zi(n)} is disconnecting.`,{cause:t})},xQ=({error:t,methodName:e,isSubprocess:n,message:r})=>{if(IQ(t))throw new Error(`${vr(e,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:t})},IQ=({code:t,message:e})=>NQ.has(t)||OQ.some(n=>e.includes(n)),NQ=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),OQ=["could not be cloned","circular structure","call stack size exceeded"],vr=(t,e,n="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${FQ(e)}${t}(${n})`,FQ=t=>t?"":"subprocess.",Zi=t=>t?"parent process":"subprocess",xb=t=>{t.connected&&t.disconnect()},Od=()=>{const t={},e=new Promise((n,r)=>{Object.assign(t,{resolve:n,reject:r})});return Object.assign(e,t)},WP=(t,e="stdin")=>{const{options:r,fileDescriptors:i}=pa.get(t),s=HP(i,e,!0),a=t.stdio[s];if(a===null)throw new TypeError(VP(s,e,r,!0));return a},Ib=(t,e="stdout")=>{const{options:r,fileDescriptors:i}=pa.get(t),s=HP(i,e,!1),a=s==="all"?t.all:t.stdio[s];if(a==null)throw new TypeError(VP(s,e,r,!1));return a},pa=new WeakMap,HP=(t,e,n)=>{const r=LQ(e,n);return MQ(r,e,n,t),r},LQ=(t,e)=>{const n=cP(t);if(n!==void 0)return n;const{validOptions:r,defaultValue:i}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${Fd(e)}" must not be "${t}".
1809
+ It must be ${r} or "fd3", "fd4" (and so on).
1810
+ It is optional and defaults to "${i}".`)},MQ=(t,e,n,r)=>{const i=r[KP(t)];if(i===void 0)throw new TypeError(`"${Fd(n)}" must not be ${e}. That file descriptor does not exist.
1811
+ Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction==="input"&&!n)throw new TypeError(`"${Fd(n)}" must not be ${e}. It must be a readable stream, not writable.`);if(i.direction!=="input"&&n)throw new TypeError(`"${Fd(n)}" must not be ${e}. It must be a writable stream, not readable.`)},VP=(t,e,n,r)=>{if(t==="all"&&!n.all)return`The "all" option must be true to use "from: 'all'".`;const{optionName:i,optionValue:s}=zQ(t,n);return`The "${i}: ${Nb(s)}" option is incompatible with using "${Fd(r)}: ${Nb(e)}".
1812
+ Please set this option with "pipe" instead.`},zQ=(t,{stdin:e,stdout:n,stderr:r,stdio:i})=>{const s=KP(t);return s===0&&e!==void 0?{optionName:"stdin",optionValue:e}:s===1&&n!==void 0?{optionName:"stdout",optionValue:n}:s===2&&r!==void 0?{optionName:"stderr",optionValue:r}:{optionName:`stdio[${s}]`,optionValue:i[s]}},KP=t=>t==="all"?1:t,Fd=t=>t?"to":"from",Nb=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream",wm=(t,e,n)=>{const r=t.getMaxListeners();r===0||r===Number.POSITIVE_INFINITY||(t.setMaxListeners(r+e),WD(n,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))},YP=(t,e)=>{e&&Ob(t)},Ob=t=>{t.refCounted()},XP=(t,e)=>{e&&Fb(t)},Fb=t=>{t.unrefCounted()},BQ=(t,e)=>{e&&(Fb(t),Fb(t))},qQ=(t,e)=>{e&&(Ob(t),Ob(t))},GQ=async({anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r},i)=>{if(YQ(i)||oZ(i))return;vm.has(t)||vm.set(t,[]);const s=vm.get(t);if(s.push(i),!(s.length>1))for(;s.length>0;){await eZ(t,r,i),await UD.yield();const a=await KQ({wrappedMessage:s[0],anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r});s.shift(),r.emit("message",a),r.emit("message:done")}},jQ=async({anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{rx();const s=vm.get(t);for(;s?.length>0;)await Sn(r,"message:done");t.removeListener("message",i),qQ(e,n),r.connected=!1,r.emit("disconnect")},vm=new WeakMap,bm=(t,e,n)=>{if(Dm.has(t))return Dm.get(t);const r=new bN;return r.connected=!0,Dm.set(t,r),UQ({ipcEmitter:r,anyProcess:t,channel:e,isSubprocess:n}),r},Dm=new WeakMap,UQ=({ipcEmitter:t,anyProcess:e,channel:n,isSubprocess:r})=>{const i=GQ.bind(void 0,{anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:t});e.on("message",i),e.once("disconnect",jQ.bind(void 0,{anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:t,boundOnMessage:i})),BQ(n,r)},JP=t=>{const e=Dm.get(t);return e===void 0?t.channel!==null:e.connected},WQ=({anyProcess:t,channel:e,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;const s=bm(t,e,n),a=Lb(t,s);return{id:HQ++,type:Rm,message:r,hasListeners:a}};let HQ=0n;const VQ=(t,e)=>{if(!(e?.type!==Rm||e.hasListeners))for(const{id:n}of t)n!==void 0&&Em[n].resolve({isDeadlock:!0,hasListeners:!1})},KQ=async({wrappedMessage:t,anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(t?.type!==Rm||!e.connected)return t;const{id:s,message:a}=t,o={id:s,type:QP,message:Lb(e,i)};try{await ZP({anyProcess:e,channel:n,isSubprocess:r,ipc:!0},o)}catch(u){i.emit("strict:error",u)}return a},YQ=t=>{if(t?.type!==QP)return!1;const{id:e,message:n}=t;return Em[e]?.resolve({isDeadlock:!1,hasListeners:n}),!0},XQ=async(t,e,n)=>{if(t?.type!==Rm)return;const r=Od();Em[t.id]=r;const i=new AbortController;try{const{isDeadlock:s,hasListeners:a}=await Promise.race([r,JQ(e,n,i)]);s&&TQ(n),a||kQ(n)}finally{i.abort(),delete Em[t.id]}},Em={},JQ=async(t,e,{signal:n})=>{wm(t,1,n),await Sn(t,"disconnect",{signal:n}),CQ(e)},Rm="execa:ipc:request",QP="execa:ipc:response",QQ=(t,e,n)=>{Ld.has(t)||Ld.set(t,new Set);const r=Ld.get(t),i=Od(),s=n?e.id:void 0,a={onMessageSent:i,id:s};return r.add(a),{outgoingMessages:r,outgoingMessage:a}},ZQ=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},eZ=async(t,e,n)=>{for(;!Lb(t,e)&&Ld.get(t)?.size>0;){const r=[...Ld.get(t)];VQ(r,n),await Promise.all(r.map(({onMessageSent:i})=>i))}},Ld=new WeakMap,Lb=(t,e)=>e.listenerCount("message")>tZ(t),tZ=t=>pa.has(t)&&!xd(pa.get(t).options.buffer,"ipc")?1:0,ZP=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},i,{strict:s=!1}={})=>{const a="sendMessage";return Pb({methodName:a,isSubprocess:n,ipc:r,isConnected:t.connected}),nZ({anyProcess:t,channel:e,methodName:a,isSubprocess:n,message:i,strict:s})},nZ=async({anyProcess:t,channel:e,methodName:n,isSubprocess:r,message:i,strict:s})=>{const a=WQ({anyProcess:t,channel:e,isSubprocess:r,message:i,strict:s}),o=QQ(t,a,s);try{await ex({anyProcess:t,methodName:n,isSubprocess:r,wrappedMessage:a,message:i})}catch(u){throw xb(t),u}finally{ZQ(o)}},ex=async({anyProcess:t,methodName:e,isSubprocess:n,wrappedMessage:r,message:i})=>{const s=rZ(t);try{await Promise.all([XQ(r,t,n),s(r)])}catch(a){throw PQ({error:a,methodName:e,isSubprocess:n}),xQ({error:a,methodName:e,isSubprocess:n,message:i}),a}},rZ=t=>{if(Mb.has(t))return Mb.get(t);const e=B1(t.send.bind(t));return Mb.set(t,e),e},Mb=new WeakMap,iZ=(t,e)=>{const n="cancelSignal";return jP(n,!1,t.connected),ex({anyProcess:t,methodName:n,isSubprocess:!1,wrappedMessage:{type:nx,message:e},message:e})},sZ=async({anyProcess:t,channel:e,isSubprocess:n,ipc:r})=>(await aZ({anyProcess:t,channel:e,isSubprocess:n,ipc:r}),zb.signal),aZ=async({anyProcess:t,channel:e,isSubprocess:n,ipc:r})=>{if(!tx){if(tx=!0,!r){_Q();return}if(e===null){rx();return}bm(t,e,n),await UD.yield()}};let tx=!1;const oZ=t=>t?.type!==nx?!1:(zb.abort(t.message),!0),nx="execa:ipc:cancel",rx=()=>{zb.abort(AQ())},zb=new AbortController,uZ=({gracefulCancel:t,cancelSignal:e,ipc:n,serialization:r})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!n)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(r==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},cZ=({subprocess:t,cancelSignal:e,gracefulCancel:n,forceKillAfterDelay:r,context:i,controller:s})=>n?[lZ({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:i,controller:s})]:[],lZ=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:r,controller:{signal:i}})=>{await GP(e,i);const s=dZ(e);throw await iZ(t,s),qP({kill:t.kill,forceKillAfterDelay:n,context:r,controllerSignal:i}),r.terminationReason??="gracefulCancel",e.reason},dZ=({reason:t})=>{if(!(t instanceof DOMException))return t;const e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:!1,configurable:!0,writable:!0}),e},fZ=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},pZ=(t,e,n,r)=>e===0||e===void 0?[]:[hZ(t,e,n,r)],hZ=async(t,e,n,{signal:r})=>{throw await jD(e,void 0,{signal:r}),n.terminationReason??="timeout",t.kill(),new Nd},mZ=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},gZ=(t,e,{node:n=!1,nodePath:r=uN,nodeOptions:i=cN.filter(u=>!u.startsWith("--inspect")),cwd:s,execPath:a,...o})=>{if(a!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');const u=ab(r,'The "nodePath" option'),c=Wr.resolve(s,u),l={...o,nodePath:c,node:n,cwd:s};if(!n)return[t,e,l];if(Wr.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[c,[...i,t,...e],{ipc:!0,...l,shell:!1}]},yZ=({ipcInput:t,ipc:e,serialization:n})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");bZ[n](t)}},wZ=t=>{try{EN(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},vZ=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},bZ={advanced:wZ,json:vZ},DZ=async(t,e)=>{e!==void 0&&await t.sendMessage(e)},EZ=({encoding:t})=>{if(Bb.has(t))return;const e=$Z(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${$m(t)}\`.
1813
+ Please rename it to ${$m(e)}.`);const n=[...Bb].map(r=>$m(r)).join(", ");throw new TypeError(`Invalid option \`encoding: ${$m(t)}\`.
1814
+ Please rename it to one of: ${n}.`)},RZ=new Set(["utf8","utf16le"]),ha=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Bb=new Set([...RZ,...ha]),$Z=t=>{if(t===null)return"buffer";if(typeof t!="string")return;const e=t.toLowerCase();if(e in ix)return ix[e];if(Bb.has(e))return e},ix={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},$m=t=>typeof t=="string"?`"${t}"`:String(t),SZ=(t=sx())=>{const e=ab(t,'The "cwd" option');return Wr.resolve(e)},sx=()=>{try{return ot.cwd()}catch(t){throw t.message=`The current directory does not exist.
1815
+ ${t.message}`,t}},TZ=(t,e)=>{if(e===sx())return t;let n;try{n=_1(e)}catch(r){return`The "cwd" option is invalid: ${e}.
1816
+ ${r.message}
1817
+ ${t}`}return n.isDirectory()?t:`The "cwd" option is not a directory: ${e}.
1818
+ ${t}`},ax=(t,e,n)=>{n.cwd=SZ(n.cwd);const[r,i,s]=gZ(t,e,n),{command:a,args:o,options:u}=WJ._parse(r,i,s),c=MX(u),l=kZ(c);return fZ(l),EZ(l),yZ(l),DQ(l),uZ(l),l.shell=J_(l.shell),l.env=CZ(l),l.killSignal=uQ(l.killSignal),l.forceKillAfterDelay=mQ(l.forceKillAfterDelay),l.lines=l.lines.map((d,f)=>d&&!ha.has(l.encoding)&&l.buffer[f]),ot.platform==="win32"&&Wr.basename(a,".exe")==="cmd"&&o.unshift("/q"),{file:a,commandArguments:o,options:l}},kZ=({extendEnv:t=!0,preferLocal:e=!1,cwd:n,localDir:r=n,encoding:i="utf8",reject:s=!0,cleanup:a=!0,all:o=!1,windowsHide:u=!0,killSignal:c="SIGTERM",forceKillAfterDelay:l=!0,gracefulCancel:d=!1,ipcInput:f,ipc:p=f!==void 0||d,serialization:h="advanced",...y})=>({...y,extendEnv:t,preferLocal:e,cwd:n,localDirectory:r,encoding:i,reject:s,cleanup:a,all:o,windowsHide:u,killSignal:c,forceKillAfterDelay:l,gracefulCancel:d,ipcInput:f,ipc:p,serialization:h}),CZ=({env:t,extendEnv:e,preferLocal:n,node:r,localDirectory:i,nodePath:s})=>{const a=e?{...ot.env,...t}:t;return n||r?YJ({env:a,cwd:i,execPath:s,preferLocal:n,addExecPath:r}):a};function qb(t){if(typeof t=="string")return AZ(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return _Z(t)}const AZ=t=>t.at(-1)===ox?t.slice(0,t.at(-2)===ux?-2:-1):t,_Z=t=>t.at(-1)===PZ?t.subarray(0,t.at(-2)===xZ?-2:-1):t,ox=`
1819
+ `,PZ=ox.codePointAt(0),ux="\r",xZ=ux.codePointAt(0);function ma(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function cx(t,{checkOpen:e=!0}={}){return ma(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function Sm(t,{checkOpen:e=!0}={}){return ma(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function lx(t,e){return cx(t,e)&&Sm(t,e)}const IZ=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);let NZ=class{#e;#t;#n=!1;#r=void 0;constructor(e,n){this.#e=e,this.#t=n}next(){const e=()=>this.#s();return this.#r=this.#r?this.#r.then(e,e):e(),this.#r}return(e){const n=()=>this.#i(e);return this.#r?this.#r.then(n,n):n()}async#s(){if(this.#n)return{done:!0,value:void 0};let e;try{e=await this.#e.read()}catch(n){throw this.#r=void 0,this.#n=!0,this.#e.releaseLock(),n}return e.done&&(this.#r=void 0,this.#n=!0,this.#e.releaseLock()),e}async#i(e){if(this.#n)return{done:!0,value:e};if(this.#n=!0,!this.#t){const n=this.#e.cancel(e);return this.#e.releaseLock(),await n,{done:!0,value:e}}return this.#e.releaseLock(),{done:!0,value:e}}};const Gb=Symbol();function dx(){return this[Gb].next()}Object.defineProperty(dx,"name",{value:"next"});function fx(t){return this[Gb].return(t)}Object.defineProperty(fx,"name",{value:"return"});const OZ=Object.create(IZ,{next:{enumerable:!0,configurable:!0,writable:!0,value:dx},return:{enumerable:!0,configurable:!0,writable:!0,value:fx}});function FZ({preventCancel:t=!1}={}){const e=this.getReader(),n=new NZ(e,t),r=Object.create(OZ);return r[Gb]=n,r}const LZ=t=>{if(Sm(t,{checkOpen:!1})&&jb.on!==void 0)return zZ(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(MZ.call(t)==="[object ReadableStream]")return FZ.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:MZ}=Object.prototype,zZ=async function*(t){const e=new AbortController,n={};BZ(t,e,n);try{for await(const[r]of jb.on(t,"data",{signal:e.signal}))yield r}catch(r){if(n.error!==void 0)throw n.error;if(!e.signal.aborted)throw r}finally{t.destroy()}},BZ=async(t,e,n)=>{try{await jb.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(r){n.error=r}finally{e.abort()}},jb={},Ub=async(t,{init:e,convertChunk:n,getSize:r,truncateChunk:i,addChunk:s,getFinalChunk:a,finalize:o},{maxBuffer:u=Number.POSITIVE_INFINITY}={})=>{const c=LZ(t),l=e();l.length=0;try{for await(const d of c){const f=GZ(d),p=n[f](d,l);px({convertedChunk:p,state:l,getSize:r,truncateChunk:i,addChunk:s,maxBuffer:u})}return qZ({state:l,convertChunk:n,getSize:r,truncateChunk:i,addChunk:s,getFinalChunk:a,maxBuffer:u}),o(l)}catch(d){const f=typeof d=="object"&&d!==null?d:new Error(d);throw f.bufferedData=o(l),f}},qZ=({state:t,getSize:e,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:s})=>{const a=i(t);a!==void 0&&px({convertedChunk:a,state:t,getSize:e,truncateChunk:n,addChunk:r,maxBuffer:s})},px=({convertedChunk:t,state:e,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:s})=>{const a=n(t),o=e.length+a;if(o<=s){hx(t,e,i,o);return}const u=r(t,s-e.length);throw u!==void 0&&hx(u,e,i,s),new Tm},hx=(t,e,n,r)=>{e.contents=n(t,e,r),e.length=r},GZ=t=>{const e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";const n=mx.call(t);return n==="[object ArrayBuffer]"?"arrayBuffer":n==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&mx.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:mx}=Object.prototype;class Tm extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const ga=t=>t,Wb=()=>{},gx=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},yx=t=>t.length;async function jZ(t,e){return Ub(t,VZ,e)}const UZ=()=>({contents:[]}),WZ=()=>1,HZ=(t,{contents:e})=>(e.push(t),e),VZ={init:UZ,convertChunk:{string:ga,buffer:ga,arrayBuffer:ga,dataView:ga,typedArray:ga,others:ga},getSize:WZ,truncateChunk:Wb,addChunk:HZ,getFinalChunk:Wb};async function KZ(t,e){return Ub(t,ree,e)}const YZ=()=>({contents:new ArrayBuffer(0)}),XZ=t=>JZ.encode(t),JZ=new TextEncoder,wx=t=>new Uint8Array(t),vx=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),QZ=(t,e)=>t.slice(0,e),ZZ=(t,{contents:e,length:n},r)=>{const i=nee()?tee(e,r):eee(e,r);return new Uint8Array(i).set(t,n),i},eee=(t,e)=>{if(e<=t.byteLength)return t;const n=new ArrayBuffer(bx(e));return new Uint8Array(n).set(new Uint8Array(t),0),n},tee=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;const n=new ArrayBuffer(e,{maxByteLength:bx(e)});return new Uint8Array(n).set(new Uint8Array(t),0),n},bx=t=>Dx**Math.ceil(Math.log(t)/Math.log(Dx)),Dx=2,nee=()=>"resize"in ArrayBuffer.prototype,ree={init:YZ,convertChunk:{string:XZ,buffer:wx,arrayBuffer:wx,dataView:vx,typedArray:vx,others:gx},getSize:yx,truncateChunk:QZ,addChunk:ZZ,getFinalChunk:Wb};async function iee(t,e){return Ub(t,cee,e)}const see=()=>({contents:"",textDecoder:new TextDecoder}),km=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),aee=(t,{contents:e})=>e+t,oee=(t,e)=>t.slice(0,e),uee=({textDecoder:t})=>{const e=t.decode();return e===""?void 0:e},cee={init:see,convertChunk:{string:ga,buffer:km,arrayBuffer:km,dataView:km,typedArray:km,others:gx},getSize:yx,truncateChunk:oee,addChunk:aee,getFinalChunk:uee},lee=({error:t,stream:e,readableObjectMode:n,lines:r,encoding:i,fdNumber:s})=>{if(!(t instanceof Tm))throw t;if(s==="all")return t;const a=dee(n,r,i);throw t.maxBufferInfo={fdNumber:s,unit:a},e.destroy(),t},dee=(t,e,n)=>t?"objects":e?"lines":n==="buffer"?"bytes":"characters",fee=(t,e,n)=>{if(e.length!==n)return;const r=new Tm;throw r.maxBufferInfo={fdNumber:"ipc"},r},pee=(t,e)=>{const{streamName:n,threshold:r,unit:i}=hee(t,e);return`Command's ${n} was larger than ${r} ${i}`},hee=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};const{maxBufferInfo:{fdNumber:n,unit:r}}=t;delete t.maxBufferInfo;const i=xd(e,n);return n==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:aP(n),threshold:i,unit:r}},mee=(t,e,n)=>t?.code==="ENOBUFS"&&e!==null&&e.some(r=>r!==null&&r.length>Hb(n)),gee=(t,e,n)=>{if(!e)return t;const r=Hb(n);return t.length>r?t.slice(0,r):t},Hb=([,t])=>t,yee=({stdio:t,all:e,ipcOutput:n,originalError:r,signal:i,signalDescription:s,exitCode:a,escapedCommand:o,timedOut:u,isCanceled:c,isGracefullyCanceled:l,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:h,maxBuffer:y,timeout:b,cwd:w})=>{const E=r?.code,$=wee({originalError:r,timedOut:u,timeout:b,isMaxBuffer:d,maxBuffer:y,errorCode:E,signal:i,signalDescription:s,exitCode:a,isCanceled:c,isGracefullyCanceled:l,isForcefullyTerminated:f,forceKillAfterDelay:p,killSignal:h}),k=bee(r,w),A=k===void 0?"":`
1820
+ ${k}`,I=`${$}: ${o}${A}`,M=e===void 0?[t[2],t[1]]:[e],Y=[I,...M,...t.slice(3),n.map(Q=>Dee(Q)).join(`
1821
+ `)].map(Q=>hb(qb(Eee(Q)))).filter(Boolean).join(`
1822
+
1823
+ `);return{originalMessage:k,shortMessage:I,message:Y}},wee=({originalError:t,timedOut:e,timeout:n,isMaxBuffer:r,maxBuffer:i,errorCode:s,signal:a,signalDescription:o,exitCode:u,isCanceled:c,isGracefullyCanceled:l,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:p})=>{const h=vee(d,f);return e?`Command timed out after ${n} milliseconds${h}`:l?a===void 0?`Command was gracefully canceled with exit code ${u}`:d?`Command was gracefully canceled${h}`:`Command was gracefully canceled with ${a} (${o})`:c?`Command was canceled${h}`:r?`${pee(t,i)}${h}`:s!==void 0?`Command failed with ${s}${h}`:d?`Command was killed with ${p} (${BP(p)})${h}`:a!==void 0?`Command was killed with ${a} (${o})`:u!==void 0?`Command failed with exit code ${u}`:"Command failed"},vee=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",bee=(t,e)=>{if(t instanceof Nd)return;const n=JJ(t)?t.originalMessage:String(t?.message??t),r=hb(TZ(n,e));return r===""?void 0:r},Dee=t=>typeof t=="string"?t:Wd(t),Eee=t=>Array.isArray(t)?t.map(e=>qb(Ex(e))).filter(Boolean).join(`
1824
+ `):Ex(t),Ex=t=>typeof t=="string"?t:wr(t)?tP(t):"",Rx=({command:t,escapedCommand:e,stdio:n,all:r,ipcOutput:i,options:{cwd:s},startTime:a})=>$x({command:t,escapedCommand:e,cwd:s,durationMs:yP(a),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:n[1],stderr:n[2],all:r,stdio:n,ipcOutput:i,pipedFrom:[]}),Vb=({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:a})=>Kb({error:t,command:e,escapedCommand:n,startTime:s,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:r.length}),ipcOutput:[],options:i,isSync:a}),Kb=({error:t,command:e,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:u,exitCode:c,signal:l,stdio:d,all:f,ipcOutput:p,options:{timeoutDuration:h,timeout:y=h,forceKillAfterDelay:b,killSignal:w,cwd:E,maxBuffer:$},isSync:k})=>{const{exitCode:A,signal:I,signalDescription:M}=$ee(c,l),{originalMessage:Y,shortMessage:Q,message:ae}=yee({stdio:d,all:f,ipcOutput:p,originalError:t,signal:I,signalDescription:M,exitCode:A,escapedCommand:n,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:u,forceKillAfterDelay:b,killSignal:w,maxBuffer:$,timeout:y,cwd:E}),O=XJ(t,ae,k);return Object.assign(O,Ree({error:O,command:e,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:u,exitCode:A,signal:I,signalDescription:M,stdio:d,all:f,ipcOutput:p,cwd:E,originalMessage:Y,shortMessage:Q})),O},Ree=({error:t,command:e,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isMaxBuffer:o,isForcefullyTerminated:u,exitCode:c,signal:l,signalDescription:d,stdio:f,all:p,ipcOutput:h,cwd:y,originalMessage:b,shortMessage:w})=>$x({shortMessage:w,originalMessage:b,command:e,escapedCommand:n,cwd:y,durationMs:yP(r),failed:!0,timedOut:i,isCanceled:s,isGracefullyCanceled:a,isTerminated:l!==void 0,isMaxBuffer:o,isForcefullyTerminated:u,exitCode:c,signal:l,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:p,stdio:f,ipcOutput:h,pipedFrom:[]}),$x=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),$ee=(t,e)=>{const n=t===null?void 0:t,r=e===null?void 0:e,i=r===void 0?void 0:BP(e);return{exitCode:n,signal:r,signalDescription:i}},Sx=t=>Number.isFinite(t)?t:0;function See(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(Sx(t*1e3)%1e3),nanoseconds:Math.trunc(Sx(t*1e6)%1e3)}}function Tee(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function kee(t){switch(typeof t){case"number":{if(Number.isFinite(t))return See(t);break}case"bigint":return Tee(t)}throw new TypeError("Expected a finite number or bigint")}const Cee=t=>t===0||t===0n,Aee=(t,e)=>e===1||e===1n?t:`${t}s`,_ee=1e-7,Pee=24n*60n*60n*1000n;function Tx(t,e){const n=typeof t=="bigint";if(!n&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};const r=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[];const s=(l,d)=>{const f=Math.floor(l*10**d+_ee);return(Math.round(f)/10**d).toFixed(d)},a=(l,d,f,p)=>{if(!((i.length===0||!e.colonNotation)&&Cee(l)&&!(e.colonNotation&&f==="m"))){if(p??=String(l),e.colonNotation){const h=p.includes(".")?p.split(".")[0].length:p.length,y=i.length>0?2:1;p="0".repeat(Math.max(0,y-h))+p}else p+=e.verbose?" "+Aee(d,l):f;i.push(p)}},o=kee(t),u=BigInt(o.days);if(e.hideYearAndDays?a(BigInt(u)*24n+BigInt(o.hours),"hour","h"):(e.hideYear?a(u,"day","d"):(a(u/365n,"year","y"),a(u%365n,"day","d")),a(Number(o.hours),"hour","h")),a(Number(o.minutes),"minute","m"),!e.hideSeconds)if(e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3){const l=Number(o.seconds),d=Number(o.milliseconds),f=Number(o.microseconds),p=Number(o.nanoseconds);if(a(l,"second","s"),e.formatSubMilliseconds)a(d,"millisecond","ms"),a(f,"microsecond","\xB5s"),a(p,"nanosecond","ns");else{const h=d+f/1e3+p/1e6,y=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,b=h>=1?Math.round(h):Math.ceil(h),w=y?h.toFixed(y):b;a(Number.parseFloat(w),"millisecond","ms",w)}}else{const l=(n?Number(t%Pee):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=s(l,d),p=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");a(Number.parseFloat(p),"second","s",p)}if(i.length===0)return r+"0"+(e.verbose?" milliseconds":"ms");const c=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),r+i.join(c)}const xee=(t,e)=>{t.failed&&Id({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})},Iee=(t,e)=>{cb(e)&&(xee(t,e),Nee(t,e))},Nee=(t,e)=>{const n=`(done in ${Tx(t.durationMs)})`;Id({type:"duration",verboseMessage:n,verboseInfo:e,result:t})},Yb=(t,e,{reject:n})=>{if(Iee(t,e),t.failed&&n)throw t;return t},Oee=(t,e)=>Ro(t)?"asyncGenerator":Px(t)?"generator":Jb(t)?"fileUrl":qee(t)?"filePath":Uee(t)?"webStream":ma(t,{checkOpen:!1})?"native":wr(t)?"uint8Array":Wee(t)?"asyncIterable":Hee(t)?"iterable":Zb(t)?kx({},e):zee(t)?Fee(t,e):"native",Fee=(t,e)=>lx(t.transform,{checkOpen:!1})?Lee(t,e):Zb(t.transform)?kx(t,e):Mee(t,e),Lee=(t,e)=>(Cx(t,e,"Duplex stream"),"duplex"),kx=(t,e)=>(Cx(t,e,"web TransformStream"),"webTransform"),Cx=({final:t,binary:e,objectMode:n},r,i)=>{Ax(t,`${r}.final`,i),Ax(e,`${r}.binary`,i),Xb(n,`${r}.objectMode`)},Ax=(t,e,n)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${n}.`)},Mee=({transform:t,final:e,binary:n,objectMode:r},i)=>{if(t!==void 0&&!_x(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(lx(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(Zb(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!_x(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return Xb(n,`${i}.binary`),Xb(r,`${i}.objectMode`),Ro(t)||Ro(e)?"asyncGenerator":"generator"},Xb=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},_x=t=>Ro(t)||Px(t),Ro=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",Px=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",zee=t=>ln(t)&&(t.transform!==void 0||t.final!==void 0),Jb=t=>Object.prototype.toString.call(t)==="[object URL]",Bee=t=>Jb(t)&&t.protocol!=="file:",qee=t=>ln(t)&&Object.keys(t).length===1&&xx(t.file),xx=t=>typeof t=="string",Gee=(t,e)=>t==="native"&&typeof e=="string"&&!jee.has(e),jee=new Set(["ipc","ignore","inherit","overlapped","pipe"]),Ix=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",Qb=t=>Object.prototype.toString.call(t)==="[object WritableStream]",Uee=t=>Ix(t)||Qb(t),Zb=t=>Ix(t?.readable)&&Qb(t?.writable),Wee=t=>Nx(t)&&typeof t[Symbol.asyncIterator]=="function",Hee=t=>Nx(t)&&typeof t[Symbol.iterator]=="function",Nx=t=>typeof t=="object"&&t!==null,ya=new Set(["generator","asyncGenerator","duplex","webTransform"]),Ox=new Set(["fileUrl","filePath","fileNumber"]),Fx=new Set(["fileUrl","filePath"]),Vee=new Set([...Fx,"webStream","nodeStream"]),Kee=new Set(["webTransform","duplex"]),Cm={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"},Lx=(t,e,n,r)=>r==="output"?Yee(t,e,n):Xee(t,e,n),Yee=(t,e,n)=>{const r=e!==0&&n[e-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:t??r}},Xee=(t,e,n)=>{const r=e===0?t===!0:n[e-1].value.readableObjectMode,i=e!==n.length-1&&(t??r);return{writableObjectMode:r,readableObjectMode:i}},Jee=(t,e)=>{const n=t.findLast(({type:r})=>ya.has(r));return n===void 0?!1:e==="input"?n.value.writableObjectMode:n.value.readableObjectMode},Qee=(t,e,n,r)=>[...t.filter(({type:i})=>!ya.has(i)),...Zee(t,e,n,r)],Zee=(t,e,n,{encoding:r})=>{const i=t.filter(({type:a})=>ya.has(a)),s=Array.from({length:i.length});for(const[a,o]of Object.entries(i))s[a]=ete({stdioItem:o,index:Number(a),newTransforms:s,optionName:e,direction:n,encoding:r});return ite(s,n)},ete=({stdioItem:t,stdioItem:{type:e},index:n,newTransforms:r,optionName:i,direction:s,encoding:a})=>e==="duplex"?tte({stdioItem:t,optionName:i}):e==="webTransform"?nte({stdioItem:t,index:n,newTransforms:r,direction:s}):rte({stdioItem:t,index:n,newTransforms:r,direction:s,encoding:a}),tte=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:n,readableObjectMode:r},objectMode:i=r}},optionName:s})=>{if(i&&!r)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&r)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:n,readableObjectMode:r}}},nte=({stdioItem:t,stdioItem:{value:e},index:n,newTransforms:r,direction:i})=>{const{transform:s,objectMode:a}=ln(e)?e:{transform:e},{writableObjectMode:o,readableObjectMode:u}=Lx(a,n,r,i);return{...t,value:{transform:s,writableObjectMode:o,readableObjectMode:u}}},rte=({stdioItem:t,stdioItem:{value:e},index:n,newTransforms:r,direction:i,encoding:s})=>{const{transform:a,final:o,binary:u=!1,preserveNewlines:c=!1,objectMode:l}=ln(e)?e:{transform:e},d=u||ha.has(s),{writableObjectMode:f,readableObjectMode:p}=Lx(l,n,r,i);return{...t,value:{transform:a,final:o,binary:d,preserveNewlines:c,writableObjectMode:f,readableObjectMode:p}}},ite=(t,e)=>e==="input"?t.reverse():t,ste=(t,e,n)=>{const r=t.map(i=>ate(i,e));if(r.includes("input")&&r.includes("output"))throw new TypeError(`The \`${n}\` option must not be an array of both readable and writable values.`);return r.find(Boolean)??cte},ate=({type:t,value:e},n)=>ote[n]??Mx[t](e),ote=["input","output","output"],$o=()=>{},eD=()=>"input",Mx={generator:$o,asyncGenerator:$o,fileUrl:$o,filePath:$o,iterable:eD,asyncIterable:eD,uint8Array:eD,webStream:t=>Qb(t)?"output":"input",nodeStream(t){return Sm(t,{checkOpen:!1})?cx(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:$o,duplex:$o,native(t){const e=ute(t);if(e!==void 0)return e;if(ma(t,{checkOpen:!1}))return Mx.nodeStream(t)}},ute=t=>{if([0,ot.stdin].includes(t))return"input";if([1,2,ot.stdout,ot.stderr].includes(t))return"output"},cte="output",lte=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t,dte=({stdio:t,ipc:e,buffer:n,...r},i,s)=>{const a=fte(t,r).map((o,u)=>zx(o,u));return s?hte(a,n,i):lte(a,e)},fte=(t,e)=>{if(t===void 0)return Gr.map(r=>e[r]);if(pte(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Gr.map(r=>`\`${r}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const n=Math.max(t.length,Gr.length);return Array.from({length:n},(r,i)=>t[i])},pte=t=>Gr.some(e=>t[e]!==void 0),zx=(t,e)=>Array.isArray(t)?t.map(n=>zx(n,e)):t??(e>=Gr.length?"ignore":"pipe"),hte=(t,e,n)=>t.map((r,i)=>!e[i]&&i!==0&&!lb(n,i)&&mte(r)?"ignore":r),mte=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe"),gte=({stdioItem:t,stdioItem:{type:e},isStdioArray:n,fdNumber:r,direction:i,isSync:s})=>!n||e!=="native"?t:s?yte({stdioItem:t,fdNumber:r,direction:i}):bte({stdioItem:t,fdNumber:r}),yte=({stdioItem:t,stdioItem:{value:e,optionName:n},fdNumber:r,direction:i})=>{const s=wte({value:e,optionName:n,fdNumber:r,direction:i});if(s!==void 0)return s;if(ma(e,{checkOpen:!1}))throw new TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},wte=({value:t,optionName:e,fdNumber:n,direction:r})=>{const i=vte(t,n);if(i!==void 0){if(r==="output")return{type:"fileNumber",value:i,optionName:e};if(zD.isatty(i))throw new TypeError(`The \`${e}: ${Nb(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Pd(qm(i)),optionName:e}}},vte=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;const n=ub.indexOf(t);if(n!==-1)return n},bte=({stdioItem:t,stdioItem:{value:e,optionName:n},fdNumber:r})=>e==="inherit"?{type:"nodeStream",value:Bx(r,e,n),optionName:n}:typeof e=="number"?{type:"nodeStream",value:Bx(e,e,n),optionName:n}:ma(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:n}:t,Bx=(t,e,n)=>{const r=ub[t];if(r===void 0)throw new TypeError(`The \`${n}: ${e}\` option is invalid: no such standard stream.`);return r},Dte=({input:t,inputFile:e},n)=>n===0?[...Ete(t),...$te(e)]:[],Ete=t=>t===void 0?[]:[{type:Rte(t),value:t,optionName:"input"}],Rte=t=>{if(Sm(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(wr(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},$te=t=>t===void 0?[]:[{...Ste(t),optionName:"inputFile"}],Ste=t=>{if(Jb(t))return{type:"fileUrl",value:t};if(xx(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")},Tte=t=>t.filter((e,n)=>t.every((r,i)=>e.value!==r.value||n>=i||e.type==="generator"||e.type==="asyncGenerator")),kte=({stdioItem:{type:t,value:e,optionName:n},direction:r,fileDescriptors:i,isSync:s})=>{const a=Cte(i,t);if(a.length!==0){if(s){Ate({otherStdioItems:a,type:t,value:e,optionName:n,direction:r});return}if(Vee.has(t))return qx({otherStdioItems:a,type:t,value:e,optionName:n,direction:r});Kee.has(t)&&Pte({otherStdioItems:a,type:t,value:e,optionName:n})}},Cte=(t,e)=>t.flatMap(({direction:n,stdioItems:r})=>r.filter(i=>i.type===e).map(i=>({...i,direction:n}))),Ate=({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})=>{Fx.has(e)&&qx({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})},qx=({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})=>{const s=t.filter(o=>_te(o,n));if(s.length===0)return;const a=s.find(o=>o.direction!==i);return Gx(a,r,e),i==="output"?s[0].stream:void 0},_te=({type:t,value:e},n)=>t==="filePath"?e.file===n.file:t==="fileUrl"?e.href===n.href:e===n,Pte=({otherStdioItems:t,type:e,value:n,optionName:r})=>{const i=t.find(({value:{transform:s}})=>s===n.transform);Gx(i,r,e)},Gx=(t,e,n)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${Cm[n]} that is the same.`)},jx=(t,e,n,r)=>{const s=dte(e,n,r).map((o,u)=>xte({stdioOption:o,fdNumber:u,options:e,isSync:r})),a=Bte({initialFileDescriptors:s,addProperties:t,options:e,isSync:r});return e.stdio=a.map(({stdioItems:o})=>jte(o)),a},xte=({stdioOption:t,fdNumber:e,options:n,isSync:r})=>{const i=aP(e),{stdioItems:s,isStdioArray:a}=Ite({stdioOption:t,fdNumber:e,options:n,optionName:i}),o=ste(s,e,i),u=s.map(d=>gte({stdioItem:d,isStdioArray:a,fdNumber:e,direction:o,isSync:r})),c=Qee(u,i,o,n),l=Jee(c,o);return zte(c,l),{direction:o,objectMode:l,stdioItems:c}},Ite=({stdioOption:t,fdNumber:e,options:n,optionName:r})=>{const s=[...(Array.isArray(t)?t:[t]).map(u=>Nte(u,r)),...Dte(n,e)],a=Tte(s),o=a.length>1;return Ote(a,o,r),Lte(a),{stdioItems:a,isStdioArray:o}},Nte=(t,e)=>({type:Oee(t,e),value:t,optionName:e}),Ote=(t,e,n)=>{if(t.length===0)throw new TypeError(`The \`${n}\` option must not be an empty array.`);if(e){for(const{value:r,optionName:i}of t)if(Fte.has(r))throw new Error(`The \`${i}\` option must not include \`${r}\`.`)}},Fte=new Set(["ignore","ipc"]),Lte=t=>{for(const e of t)Mte(e)},Mte=({type:t,value:e,optionName:n})=>{if(Bee(e))throw new TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
1825
+ For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(Gee(t,e))throw new TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},zte=(t,e)=>{if(!e)return;const n=t.find(({type:r})=>Ox.has(r));if(n!==void 0)throw new TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},Bte=({initialFileDescriptors:t,addProperties:e,options:n,isSync:r})=>{const i=[];try{for(const s of t)i.push(qte({fileDescriptor:s,fileDescriptors:i,addProperties:e,options:n,isSync:r}));return i}catch(s){throw Ux(i),s}},qte=({fileDescriptor:{direction:t,objectMode:e,stdioItems:n},fileDescriptors:r,addProperties:i,options:s,isSync:a})=>{const o=n.map(u=>Gte({stdioItem:u,addProperties:i,direction:t,options:s,fileDescriptors:r,isSync:a}));return{direction:t,objectMode:e,stdioItems:o}},Gte=({stdioItem:t,addProperties:e,direction:n,options:r,fileDescriptors:i,isSync:s})=>{const a=kte({stdioItem:t,direction:n,fileDescriptors:i,isSync:s});return a!==void 0?{...t,stream:a}:{...t,...e[n][t.type](t,r)}},Ux=t=>{for(const{stdioItems:e}of t)for(const{stream:n}of e)n!==void 0&&!da(n)&&n.destroy()},jte=t=>{if(t.length>1)return t.some(({value:r})=>r==="overlapped")?"overlapped":"pipe";const[{type:e,value:n}]=t;return e==="native"?n:"pipe"},Ute=(t,e)=>jx(Hte,t,e,!0),jr=({type:t,optionName:e})=>{Wx(e,Cm[t])},Wte=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&Wx(t,`"${e}"`),{}),Wx=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},Hx={generator(){},asyncGenerator:jr,webStream:jr,nodeStream:jr,webTransform:jr,duplex:jr,asyncIterable:jr,native:Wte},Hte={input:{...Hx,fileUrl:({value:t})=>({contents:[Pd(qm(t))]}),filePath:({value:{file:t}})=>({contents:[Pd(qm(t))]}),fileNumber:jr,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...Hx,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t}})=>({path:t}),fileNumber:({value:t})=>({path:t}),iterable:jr,string:jr,uint8Array:jr}},So=(t,{stripFinalNewline:e},n)=>Vx(e,n)&&t!==void 0&&!Array.isArray(t)?qb(t):t,Vx=(t,e)=>e==="all"?t[1]||t[2]:t[e],Kx=(t,e,n,r)=>t||n?void 0:Jx(e,r),Yx=(t,e,n)=>n?t.flatMap(r=>Xx(r,e)):Xx(t,e),Xx=(t,e)=>{const{transform:n,final:r}=Jx(e,{});return[...n(t),...r()]},Jx=(t,e)=>(e.previousChunks="",{transform:Vte.bind(void 0,e,t),final:Yte.bind(void 0,e)}),Vte=function*(t,e,n){if(typeof n!="string"){yield n;return}let{previousChunks:r}=t,i=-1;for(let s=0;s<n.length;s+=1)if(n[s]===`
1826
+ `){const a=Kte(n,s,e,t);let o=n.slice(i+1,s+1-a);r.length>0&&(o=tD(r,o),r=""),yield o,i=s}i!==n.length-1&&(r=tD(r,n.slice(i+1))),t.previousChunks=r},Kte=(t,e,n,r)=>n?0:(r.isWindowsNewline=e!==0&&t[e-1]==="\r",r.isWindowsNewline?2:1),Yte=function*({previousChunks:t}){t.length>0&&(yield t)},Xte=({binary:t,preserveNewlines:e,readableObjectMode:n,state:r})=>t||e||n?void 0:{transform:Jte.bind(void 0,r)},Jte=function*({isWindowsNewline:t=!1},e){const{unixNewline:n,windowsNewline:r,LF:i,concatBytes:s}=typeof e=="string"?Qte:ene;if(e.at(-1)===i){yield e;return}yield s(e,t?r:n)},tD=(t,e)=>`${t}${e}`,Qte={windowsNewline:`\r
1827
+ `,unixNewline:`
1828
+ `,LF:`
1829
+ `,concatBytes:tD},Zte=(t,e)=>{const n=new Uint8Array(t.length+e.length);return n.set(t,0),n.set(e,t.length),n},ene={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:Zte},tne=(t,e)=>t?void 0:nne.bind(void 0,e),nne=function*(t,e){if(typeof e!="string"&&!wr(e)&&!Xm.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},rne=(t,e)=>t?ine.bind(void 0,e):sne.bind(void 0,e),ine=function*(t,e){Qx(t,e),yield e},sne=function*(t,e){if(Qx(t,e),typeof e!="string"&&!wr(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},Qx=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
1830
+ Instead, \`yield\` should either be called with a value, or not be called at all. For example:
1831
+ if (condition) { yield value; }`)},Zx=(t,e,n)=>{if(n)return;if(t)return{transform:ane.bind(void 0,new TextEncoder)};const r=new GD(e);return{transform:one.bind(void 0,r),final:une.bind(void 0,r)}},ane=function*(t,e){Xm.isBuffer(e)?yield Pd(e):typeof e=="string"?yield t.encode(e):yield e},one=function*(t,e){yield wr(e)?t.write(e):e},une=function*(t){const e=t.end();e!==""&&(yield e)},eI=Da(async(t,e,n,r)=>{e.currentIterable=t(...n);try{for await(const i of e.currentIterable)r.push(i)}finally{delete e.currentIterable}}),nD=async function*(t,e,n){if(n===e.length){yield t;return}const{transform:r=fne}=e[n];for await(const i of r(t))yield*nD(i,e,n+1)},cne=async function*(t){for(const[e,{final:n}]of Object.entries(t))yield*lne(n,Number(e),t)},lne=async function*(t,e,n){if(t!==void 0)for await(const r of t())yield*nD(r,n,e+1)},dne=Da(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),fne=function*(t){yield t},tI=(t,e,n,r)=>{try{for(const i of t(...e))n.push(i);r()}catch(i){r(i)}},pne=(t,e)=>[...e.flatMap(n=>[...Md(n,t,0)]),...rD(t)],Md=function*(t,e,n){if(n===e.length){yield t;return}const{transform:r=mne}=e[n];for(const i of r(t))yield*Md(i,e,n+1)},rD=function*(t){for(const[e,{final:n}]of Object.entries(t))yield*hne(n,Number(e),t)},hne=function*(t,e,n){if(t!==void 0)for(const r of t())yield*Md(r,n,e+1)},mne=function*(t){yield t},nI=({value:t,value:{transform:e,final:n,writableObjectMode:r,readableObjectMode:i},optionName:s},{encoding:a})=>{const o={},u=iI(t,a,s),c=Ro(e),l=Ro(n),d=c?eI.bind(void 0,nD,o):tI.bind(void 0,Md),f=c||l?eI.bind(void 0,cne,o):tI.bind(void 0,rD),p=c||l?dne.bind(void 0,o):void 0;return{stream:new RN({writableObjectMode:r,writableHighWaterMark:Jd(r),readableObjectMode:i,readableHighWaterMark:Jd(i),transform(y,b,w){d([y,u,0],this,w)},flush(y){f([u],this,y)},destroy:p})}},rI=(t,e,n,r)=>{const i=e.filter(({type:a})=>a==="generator"),s=r?i.reverse():i;for(const{value:a,optionName:o}of s){const u=iI(a,n,o);t=pne(u,t)}return t},iI=({transform:t,final:e,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:s},a,o)=>{const u={};return[{transform:tne(r,o)},Zx(n,a,r),Kx(n,s,r,u),{transform:t,final:e},{transform:rne(i,o)},Xte({binary:n,preserveNewlines:s,readableObjectMode:i,state:u})].filter(Boolean)},gne=(t,e)=>{for(const n of yne(t))wne(t,n,e)},yne=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),wne=(t,e,n)=>{const{stdioItems:r}=t[e],i=r.filter(({contents:o})=>o!==void 0);if(i.length===0)return;if(e!==0){const[{type:o,optionName:u}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${u}\`, can be ${Cm[o]} with synchronous methods.`)}const a=i.map(({contents:o})=>o).map(o=>vne(o,r));n.input=ob(a)},vne=(t,e)=>{const n=rI(t,e,"utf8",!0);return bne(n),ob(n)},bne=t=>{const e=t.find(n=>typeof n!="string"&&!wr(n));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)},sI=({stdioItems:t,encoding:e,verboseInfo:n,fdNumber:r})=>r!=="all"&&lb(n,r)&&!ha.has(e)&&Dne(r)&&(t.some(({type:i,value:s})=>i==="native"&&Ene.has(s))||t.every(({type:i})=>ya.has(i))),Dne=t=>t===1||t===2,Ene=new Set(["pipe","overlapped"]),Rne=async(t,e,n,r)=>{for await(const i of t)Sne(e)||aI(i,n,r)},$ne=(t,e,n)=>{for(const r of t)aI(r,e,n)},Sne=t=>t._readableState.pipes.length>0,aI=(t,e,n)=>{const r=mP(t);Id({type:"output",verboseMessage:r,fdNumber:e,verboseInfo:n})},Tne=({fileDescriptors:t,syncResult:{output:e},options:n,isMaxBuffer:r,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};const s={},a=new Set([]);return{output:e.map((u,c)=>kne({result:u,fileDescriptors:t,fdNumber:c,state:s,outputFiles:a,isMaxBuffer:r,verboseInfo:i},n)),...s}},kne=({result:t,fileDescriptors:e,fdNumber:n,state:r,outputFiles:i,isMaxBuffer:s,verboseInfo:a},{buffer:o,encoding:u,lines:c,stripFinalNewline:l,maxBuffer:d})=>{if(t===null)return;const f=gee(t,s,d),p=Pd(f),{stdioItems:h,objectMode:y}=e[n],b=Cne([p],h,u,r),{serializedResult:w,finalResult:E=w}=Ane({chunks:b,objectMode:y,encoding:u,lines:c,stripFinalNewline:l,fdNumber:n});_ne({serializedResult:w,fdNumber:n,state:r,verboseInfo:a,encoding:u,stdioItems:h,objectMode:y});const $=o[n]?E:void 0;try{return r.error===void 0&&Pne(w,h,i),$}catch(k){return r.error=k,$}},Cne=(t,e,n,r)=>{try{return rI(t,e,n,!1)}catch(i){return r.error=i,t}},Ane=({chunks:t,objectMode:e,encoding:n,lines:r,stripFinalNewline:i,fdNumber:s})=>{if(e)return{serializedResult:t};if(n==="buffer")return{serializedResult:ob(t)};const a=CX(t,n);return r[s]?{serializedResult:a,finalResult:Yx(a,!i[s],e)}:{serializedResult:a}},_ne=({serializedResult:t,fdNumber:e,state:n,verboseInfo:r,encoding:i,stdioItems:s,objectMode:a})=>{if(!sI({stdioItems:s,encoding:i,verboseInfo:r,fdNumber:e}))return;const o=Yx(t,!1,a);try{$ne(o,e,r)}catch(u){n.error??=u}},Pne=(t,e,n)=>{for(const{path:r}of e.filter(({type:i})=>Ox.has(i))){const i=typeof r=="string"?r:r.toString();n.has(i)?P1(r,t):(n.add(i),TD(r,t))}},xne=([,t,e],n)=>{if(n.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,So(e,n,"all")]:Array.isArray(e)?[So(t,n,"all"),...e]:wr(t)&&wr(e)?nP([t,e]):`${t}${e}`},Ine=async(t,e)=>{const[n,r]=await Nne(t);return e.isForcefullyTerminated??=!1,[n,r]},Nne=async t=>{const[e,n]=await Promise.allSettled([Sn(t,"spawn"),Sn(t,"exit")]);return e.status==="rejected"?[]:n.status==="rejected"?oI(t):n.value},oI=async t=>{try{return await Sn(t,"exit")}catch{return oI(t)}},One=async t=>{const[e,n]=await t;if(!Fne(e,n)&&uI(e,n))throw new Nd;return[e,n]},Fne=(t,e)=>t===void 0&&e===void 0,uI=(t,e)=>t!==0||e!==null,Lne=({error:t,status:e,signal:n,output:r},{maxBuffer:i})=>{const s=Mne(t,e,n),a=s?.code==="ETIMEDOUT",o=mee(s,r,i);return{resultError:s,exitCode:e,signal:n,timedOut:a,isMaxBuffer:o}},Mne=(t,e,n)=>t!==void 0?t:uI(e,n)?new Nd:void 0,zne=(t,e,n)=>{const{file:r,commandArguments:i,command:s,escapedCommand:a,startTime:o,verboseInfo:u,options:c,fileDescriptors:l}=Bne(t,e,n),d=jne({file:r,commandArguments:i,options:c,command:s,escapedCommand:a,verboseInfo:u,fileDescriptors:l,startTime:o});return Yb(d,u,c)},Bne=(t,e,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:a}=wP(t,e,n),o=qne(n),{file:u,commandArguments:c,options:l}=ax(t,e,o);Gne(l);const d=Ute(l,a);return{file:u,commandArguments:c,command:r,escapedCommand:i,startTime:s,verboseInfo:a,options:l,fileDescriptors:d}},qne=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,Gne=({ipc:t,ipcInput:e,detached:n,cancelSignal:r})=>{e&&Am("ipcInput"),t&&Am("ipc: true"),n&&Am("detached: true"),r&&Am("cancelSignal")},Am=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},jne=({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,verboseInfo:s,fileDescriptors:a,startTime:o})=>{const u=Une({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,fileDescriptors:a,startTime:o});if(u.failed)return u;const{resultError:c,exitCode:l,signal:d,timedOut:f,isMaxBuffer:p}=Lne(u,n),{output:h,error:y=c}=Tne({fileDescriptors:a,syncResult:u,options:n,isMaxBuffer:p,verboseInfo:s}),b=h.map((E,$)=>So(E,n,$)),w=So(xne(h,n),n,"all");return Hne({error:y,exitCode:l,signal:d,timedOut:f,isMaxBuffer:p,stdio:b,all:w,options:n,command:r,escapedCommand:i,startTime:o})},Une=({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,fileDescriptors:s,startTime:a})=>{try{gne(s,n);const o=Wne(n);return gN(t,e,o)}catch(o){return Vb({error:o,command:r,escapedCommand:i,fileDescriptors:s,options:n,startTime:a,isSync:!0})}},Wne=({encoding:t,maxBuffer:e,...n})=>({...n,encoding:"buffer",maxBuffer:Hb(e)}),Hne=({error:t,exitCode:e,signal:n,timedOut:r,isMaxBuffer:i,stdio:s,all:a,options:o,command:u,escapedCommand:c,startTime:l})=>t===void 0?Rx({command:u,escapedCommand:c,stdio:s,all:a,ipcOutput:[],options:o,startTime:l}):Kb({error:t,command:u,escapedCommand:c,timedOut:r,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:n,stdio:s,all:a,ipcOutput:[],options:o,startTime:l,isSync:!0}),Vne=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},{reference:i=!0,filter:s}={})=>(Pb({methodName:"getOneMessage",isSubprocess:n,ipc:r,isConnected:JP(t)}),Kne({anyProcess:t,channel:e,isSubprocess:n,filter:s,reference:i})),Kne=async({anyProcess:t,channel:e,isSubprocess:n,filter:r,reference:i})=>{YP(e,i);const s=bm(t,e,n),a=new AbortController;try{return await Promise.race([Yne(s,r,a),Xne(s,n,a),Jne(s,n,a)])}catch(o){throw xb(t),o}finally{a.abort(),XP(e,i)}},Yne=async(t,e,{signal:n})=>{if(e===void 0){const[r]=await Sn(t,"message",{signal:n});return r}for await(const[r]of Xd(t,"message",{signal:n}))if(e(r))return r},Xne=async(t,e,{signal:n})=>{await Sn(t,"disconnect",{signal:n}),SQ(e)},Jne=async(t,e,{signal:n})=>{const[r]=await Sn(t,"strict:error",{signal:n});throw UP(r,e)},Qne=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},{reference:i=!0}={})=>cI({anyProcess:t,channel:e,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),cI=({anyProcess:t,channel:e,isSubprocess:n,ipc:r,shouldAwait:i,reference:s})=>{Pb({methodName:"getEachMessage",isSubprocess:n,ipc:r,isConnected:JP(t)}),YP(e,s);const a=bm(t,e,n),o=new AbortController,u={};return Zne(t,a,o),ere({ipcEmitter:a,isSubprocess:n,controller:o,state:u}),tre({anyProcess:t,channel:e,ipcEmitter:a,isSubprocess:n,shouldAwait:i,controller:o,state:u,reference:s})},Zne=async(t,e,n)=>{try{await Sn(e,"disconnect",{signal:n.signal}),n.abort()}catch{}},ere=async({ipcEmitter:t,isSubprocess:e,controller:n,state:r})=>{try{const[i]=await Sn(t,"strict:error",{signal:n.signal});r.error=UP(i,e),n.abort()}catch{}},tre=async function*({anyProcess:t,channel:e,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:s,state:a,reference:o}){try{for await(const[u]of Xd(n,"message",{signal:s.signal}))lI(a),yield u}catch{lI(a)}finally{s.abort(),XP(e,o),r||xb(t),i&&await t}},lI=({error:t})=>{if(t)throw t},nre=(t,{ipc:e})=>{Object.assign(t,dI(t,!1,e))},rre=()=>{const t=ot,e=!0,n=ot.channel!==void 0;return{...dI(t,e,n),getCancelSignal:sZ.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n})}},dI=(t,e,n)=>({sendMessage:ZP.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n}),getOneMessage:Vne.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n}),getEachMessage:Qne.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n})}),ire=({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,verboseInfo:a})=>{Ux(r);const o=new qD;sre(o,r),Object.assign(o,{readable:are,writable:ore,duplex:ure});const u=Vb({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:!1}),c=cre(u,a,i);return{subprocess:o,promise:c}},sre=(t,e)=>{const n=zd(),r=zd(),i=zd(),s=Array.from({length:e.length-3},zd),a=zd(),o=[n,r,i,...s];Object.assign(t,{stdin:n,stdout:r,stderr:i,all:a,stdio:o})},zd=()=>{const t=new HD;return t.end(),t},are=()=>new fs({read(){}}),ore=()=>new Ym({write(){}}),ure=()=>new Km({read(){},write(){}}),cre=async(t,e,n)=>Yb(t,e,n),lre=(t,e)=>jx(dre,t,e,!1),Bd=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${Cm[t]}.`)},fI={fileNumber:Bd,generator:nI,asyncGenerator:nI,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:n}}){const r=e||n;return{stream:Km.fromWeb(t,{objectMode:r})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},dre={input:{...fI,fileUrl:({value:t})=>({stream:CD(t)}),filePath:({value:{file:t}})=>({stream:CD(t)}),webStream:({value:t})=>({stream:fs.fromWeb(t)}),iterable:({value:t})=>({stream:fs.from(t)}),asyncIterable:({value:t})=>({stream:fs.from(t)}),string:({value:t})=>({stream:fs.from(t)}),uint8Array:({value:t})=>({stream:fs.from(Xm.from(t))})},output:{...fI,fileUrl:({value:t})=>({stream:kD(t)}),filePath:({value:{file:t}})=>({stream:kD(t)}),webStream:({value:t})=>({stream:Ym.fromWeb(t)}),iterable:Bd,asyncIterable:Bd,string:Bd,uint8Array:Bd}};function iD(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(const i of t)sD(i);const e=t.some(({readableObjectMode:i})=>i),n=fre(t,e),r=new pre({objectMode:e,writableHighWaterMark:n,readableHighWaterMark:n});for(const i of t)r.add(i);return r}const fre=(t,e)=>{if(t.length===0)return Jd(e);const n=t.filter(({readableObjectMode:r})=>r===e).map(({readableHighWaterMark:r})=>r);return Math.max(...n)};class pre extends HD{#e=new Set([]);#t=new Set([]);#n=new Set([]);#r;#s=Symbol("unpipe");#i=new WeakMap;add(e){if(sD(e),this.#e.has(e))return;this.#e.add(e),this.#r??=hre(this,this.#e,this.#s);const n=yre({passThroughStream:this,stream:e,streams:this.#e,ended:this.#t,aborted:this.#n,onFinished:this.#r,unpipeEvent:this.#s});this.#i.set(e,n),e.pipe(this,{end:!1})}async remove(e){if(sD(e),!this.#e.has(e))return!1;const n=this.#i.get(e);return n===void 0?!1:(this.#i.delete(e),e.unpipe(this),await n,!0)}}const hre=async(t,e,n)=>{_m(t,Rre);const r=new AbortController;try{await Promise.race([mre(t,r),gre(t,e,n,r)])}finally{r.abort(),_m(t,-2)}},mre=async(t,{signal:e})=>{try{await $i(t,{signal:e,cleanup:!0})}catch(n){throw pI(t,n),n}},gre=async(t,e,n,{signal:r})=>{for await(const[i]of Xd(t,"unpipe",{signal:r}))e.has(i)&&i.emit(n)},sD=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},yre=async({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,onFinished:s,unpipeEvent:a})=>{_m(t,$re);const o=new AbortController;try{await Promise.race([wre(s,e,o),vre({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,controller:o}),bre({stream:e,streams:n,ended:r,aborted:i,unpipeEvent:a,controller:o})])}finally{o.abort(),_m(t,-1)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?aD(t):Dre(t))},wre=async(t,e,{signal:n})=>{try{await t,n.aborted||aD(e)}catch(r){n.aborted||pI(e,r)}},vre=async({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,controller:{signal:s}})=>{try{await $i(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),n.has(e)&&r.add(e)}catch(a){if(s.aborted||!n.has(e))return;hI(a)?i.add(e):mI(t,a)}},bre=async({stream:t,streams:e,ended:n,aborted:r,unpipeEvent:i,controller:{signal:s}})=>{if(await Sn(t,i,{signal:s}),!t.readable)return Sn(s,"abort",{signal:s});e.delete(t),n.delete(t),r.delete(t)},Dre=t=>{t.writable&&t.end()},pI=(t,e)=>{hI(e)?aD(t):mI(t,e)},hI=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",aD=t=>{(t.readable||t.writable)&&t.destroy()},mI=(t,e)=>{t.destroyed||(t.once("error",Ere),t.destroy(e))},Ere=()=>{},_m=(t,e)=>{const n=t.getMaxListeners();n!==0&&n!==Number.POSITIVE_INFINITY&&t.setMaxListeners(n+e)},Rre=2,$re=1,Pm=(t,e)=>{t.pipe(e),Sre(t,e),Tre(t,e)},Sre=async(t,e)=>{if(!(da(t)||da(e))){try{await $i(t,{cleanup:!0,readable:!0,writable:!1})}catch{}gI(e)}},gI=t=>{t.writable&&t.end()},Tre=async(t,e)=>{if(!(da(t)||da(e))){try{await $i(e,{cleanup:!0,readable:!1,writable:!0})}catch{}yI(t)}},yI=t=>{t.readable&&t.destroy()},kre=(t,e,n)=>{const r=new Map;for(const[i,{stdioItems:s,direction:a}]of Object.entries(e)){for(const{stream:o}of s.filter(({type:u})=>ya.has(u)))Cre(t,o,a,i);for(const{stream:o}of s.filter(({type:u})=>!ya.has(u)))_re({subprocess:t,stream:o,direction:a,fdNumber:i,pipeGroups:r,controller:n})}for(const[i,s]of r.entries()){const a=s.length===1?s[0]:iD(s);Pm(a,i)}},Cre=(t,e,n,r)=>{n==="output"?Pm(t.stdio[r],e):Pm(e,t.stdio[r]);const i=Are[r];i!==void 0&&(t[i]=e),t.stdio[r]=e},Are=["stdin","stdout","stderr"],_re=({subprocess:t,stream:e,direction:n,fdNumber:r,pipeGroups:i,controller:s})=>{if(e===void 0)return;Pre(e,s);const[a,o]=n==="output"?[e,t.stdio[r]]:[t.stdio[r],e],u=i.get(a)??[];i.set(a,[...u,o])},Pre=(t,{signal:e})=>{da(t)&&wm(t,xre,e)},xre=2,To=[];To.push("SIGHUP","SIGINT","SIGTERM"),process.platform!=="win32"&&To.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&To.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const xm=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",oD=Symbol.for("signal-exit emitter"),uD=globalThis,Ire=Object.defineProperty.bind(Object);class Nre{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(uD[oD])return uD[oD];Ire(uD,oD,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,n){this.listeners[e].push(n)}removeListener(e,n){const r=this.listeners[e],i=r.indexOf(n);i!==-1&&(i===0&&r.length===1?r.length=0:r.splice(i,1))}emit(e,n,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(const s of this.listeners[e])i=s(n,r)===!0||i;return e==="exit"&&(i=this.emit("afterExit",n,r)||i),i}}class wI{}const Ore=t=>({onExit(e,n){return t.onExit(e,n)},load(){return t.load()},unload(){return t.unload()}});class Fre extends wI{onExit(){return()=>{}}load(){}unload(){}}class Lre extends wI{#e=cD.platform==="win32"?"SIGINT":"SIGHUP";#t=new Nre;#n;#r;#s;#i={};#a=!1;constructor(e){super(),this.#n=e,this.#i={};for(const n of To)this.#i[n]=()=>{const r=this.#n.listeners(n);let{count:i}=this.#t;const s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(i+=s.__signal_exit_emitter__.count),r.length===i){this.unload();const a=this.#t.emit("exit",null,n),o=n==="SIGHUP"?this.#e:n;a||e.kill(e.pid,o)}};this.#s=e.reallyExit,this.#r=e.emit}onExit(e,n){if(!xm(this.#n))return()=>{};this.#a===!1&&this.load();const r=n?.alwaysLast?"afterExit":"exit";return this.#t.on(r,e),()=>{this.#t.removeListener(r,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#a){this.#a=!0,this.#t.count+=1;for(const e of To)try{const n=this.#i[e];n&&this.#n.on(e,n)}catch{}this.#n.emit=(e,...n)=>this.#u(e,...n),this.#n.reallyExit=e=>this.#o(e)}}unload(){this.#a&&(this.#a=!1,To.forEach(e=>{const n=this.#i[e];if(!n)throw new Error("Listener not defined for signal: "+e);try{this.#n.removeListener(e,n)}catch{}}),this.#n.emit=this.#r,this.#n.reallyExit=this.#s,this.#t.count-=1)}#o(e){return xm(this.#n)?(this.#n.exitCode=e||0,this.#t.emit("exit",this.#n.exitCode,null),this.#s.call(this.#n,this.#n.exitCode)):0}#u(e,...n){const r=this.#r;if(e==="exit"&&xm(this.#n)){typeof n[0]=="number"&&(this.#n.exitCode=n[0]);const i=r.call(this.#n,e,...n);return this.#t.emit("exit",this.#n.exitCode,null),i}else return r.call(this.#n,e,...n)}}const cD=globalThis.process,{onExit:Mre}=Ore(xm(cD)?new Lre(cD):new Fre),zre=(t,{cleanup:e,detached:n},{signal:r})=>{if(!e||n)return;const i=Mre(()=>{t.kill()});WD(r,()=>{i()})},Bre=({source:t,sourcePromise:e,boundOptions:n,createNested:r},...i)=>{const s=gP(),{destination:a,destinationStream:o,destinationError:u,from:c,unpipeSignal:l}=qre(n,r,i),{sourceStream:d,sourceError:f}=jre(t,c),{options:p,fileDescriptors:h}=pa.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:p,sourceError:f,destination:a,destinationStream:o,destinationError:u,unpipeSignal:l,fileDescriptors:h,startTime:s}},qre=(t,e,n)=>{try{const{destination:r,pipeOptions:{from:i,to:s,unpipeSignal:a}={}}=Gre(t,e,...n),o=WP(r,s);return{destination:r,destinationStream:o,from:i,unpipeSignal:a}}catch(r){return{destinationError:r}}},Gre=(t,e,n,...r)=>{if(Array.isArray(n))return{destination:e(vI,t)(n,...r),pipeOptions:t};if(typeof n=="string"||n instanceof URL){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');const[i,s,a]=Q_(n,...r);return{destination:e(vI)(i,s,a),pipeOptions:a}}if(pa.has(n)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:n,pipeOptions:r[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${n}`)},vI=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),jre=(t,e)=>{try{return{sourceStream:Ib(t,e)}}catch(n){return{sourceError:n}}},Ure=({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:s,startTime:a})=>{const o=Wre({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r});if(o!==void 0)throw bI({error:o,fileDescriptors:i,sourceOptions:s,startTime:a})},Wre=({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r})=>{if(e!==void 0&&r!==void 0)return r;if(r!==void 0)return yI(t),r;if(e!==void 0)return gI(n),e},bI=({error:t,fileDescriptors:e,sourceOptions:n,startTime:r})=>Vb({error:t,command:DI,escapedCommand:DI,fileDescriptors:e,options:n,startTime:r,isSync:!1}),DI="source.pipe(destination)",Hre=async t=>{const[{status:e,reason:n,value:r=n},{status:i,reason:s,value:a=s}]=await t;if(a.pipedFrom.includes(r)||a.pipedFrom.push(r),i==="rejected")throw a;if(e==="rejected")throw r;return a},Vre=(t,e,n)=>{const r=Im.has(e)?Yre(t,e):Kre(t,e);return wm(t,Jre,n.signal),wm(e,Qre,n.signal),Xre(e),r},Kre=(t,e)=>{const n=iD([t]);return Pm(n,e),Im.set(e,n),n},Yre=(t,e)=>{const n=Im.get(e);return n.add(t),n},Xre=async t=>{try{await $i(t,{cleanup:!0,readable:!1,writable:!0})}catch{}Im.delete(t)},Im=new WeakMap,Jre=2,Qre=1,Zre=(t,e)=>t===void 0?[]:[eie(t,e)],eie=async(t,{sourceStream:e,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:s})=>{await q1(t,e),await n.remove(e);const a=new Error("Pipe canceled by `unpipeSignal` option.");throw bI({error:a,fileDescriptors:r,sourceOptions:i,startTime:s})},lD=(t,...e)=>{if(ln(e[0]))return lD.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});const{destination:n,...r}=Bre(t,...e),i=tie({...r,destination:n});return i.pipe=lD.bind(void 0,{...t,source:n,sourcePromise:i,boundOptions:{}}),i},tie=async({sourcePromise:t,sourceStream:e,sourceOptions:n,sourceError:r,destination:i,destinationStream:s,destinationError:a,unpipeSignal:o,fileDescriptors:u,startTime:c})=>{const l=nie(t,i);Ure({sourceStream:e,sourceError:r,destinationStream:s,destinationError:a,fileDescriptors:u,sourceOptions:n,startTime:c});const d=new AbortController;try{const f=Vre(e,s,d);return await Promise.race([Hre(l),...Zre(o,{sourceStream:e,mergedStream:f,sourceOptions:n,fileDescriptors:u,startTime:c})])}finally{d.abort()}},nie=(t,e)=>Promise.allSettled([t,e]),EI=({subprocessStdout:t,subprocess:e,binary:n,shouldEncode:r,encoding:i,preserveNewlines:s})=>{const a=new AbortController;return rie(e,a),$I({stream:t,controller:a,binary:n,shouldEncode:!t.readableObjectMode&&r,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},rie=async(t,e)=>{try{await t}catch{}finally{e.abort()}},RI=({stream:t,onStreamEnd:e,lines:n,encoding:r,stripFinalNewline:i,allMixed:s})=>{const a=new AbortController;iie(e,a,t);const o=t.readableObjectMode&&!s;return $I({stream:t,controller:a,binary:r==="buffer",shouldEncode:!o,encoding:r,shouldSplit:!o&&n,preserveNewlines:!i})},iie=async(t,e,n)=>{try{await t}catch{n.destroy()}finally{e.abort()}},$I=({stream:t,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a})=>{const o=Xd(t,"data",{signal:e.signal,highWaterMark:TI,highWatermark:TI});return sie({onStdoutChunk:o,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a})},SI=Jd(!0),TI=SI,sie=async function*({onStdoutChunk:t,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a}){const o=aie({binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:a});try{for await(const[u]of t)yield*Md(u,o,0)}catch(u){if(!e.signal.aborted)throw u}finally{yield*rD(o)}},aie=({binary:t,shouldEncode:e,encoding:n,shouldSplit:r,preserveNewlines:i})=>[Zx(t,n,!e),Kx(t,i,!r,{})].filter(Boolean),oie=async({stream:t,onStreamEnd:e,fdNumber:n,encoding:r,buffer:i,maxBuffer:s,lines:a,allMixed:o,stripFinalNewline:u,verboseInfo:c,streamInfo:l})=>{const d=uie({stream:t,onStreamEnd:e,fdNumber:n,encoding:r,allMixed:o,verboseInfo:c,streamInfo:l});if(!i){await Promise.all([cie(t),d]);return}const f=Vx(u,n),p=RI({stream:t,onStreamEnd:e,lines:a,encoding:r,stripFinalNewline:f,allMixed:o}),[h]=await Promise.all([lie({stream:t,iterable:p,fdNumber:n,encoding:r,maxBuffer:s,lines:a}),d]);return h},uie=async({stream:t,onStreamEnd:e,fdNumber:n,encoding:r,allMixed:i,verboseInfo:s,streamInfo:{fileDescriptors:a}})=>{if(!sI({stdioItems:a[n]?.stdioItems,encoding:r,verboseInfo:s,fdNumber:n}))return;const o=RI({stream:t,onStreamEnd:e,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i});await Rne(o,t,n,s)},cie=async t=>{await wN(),t.readableFlowing===null&&t.resume()},lie=async({stream:t,stream:{readableObjectMode:e},iterable:n,fdNumber:r,encoding:i,maxBuffer:s,lines:a})=>{try{return e||a?await jZ(n,{maxBuffer:s}):i==="buffer"?new Uint8Array(await KZ(n,{maxBuffer:s})):await iee(n,{maxBuffer:s})}catch(o){return CI(lee({error:o,stream:t,readableObjectMode:e,lines:a,encoding:i,fdNumber:r}))}},kI=async t=>{try{return await t}catch(e){return CI(e)}},CI=({bufferedData:t})=>SX(t)?new Uint8Array(t):t,dD=async(t,e,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{const s=die(t,n),a=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],$i(t,{cleanup:!0,signal:a.signal})])}catch(o){s.stdinCleanedUp||hie(o,e,n,r)}finally{a.abort()}},die=(t,{originalStreams:[e],subprocess:n})=>{const r={stdinCleanedUp:!1};return t===e&&fie(t,n,r),r},fie=(t,e,n)=>{const{_destroy:r}=t;t._destroy=(...i)=>{pie(e,n),r.call(t,...i)}},pie=({exitCode:t,signalCode:e},n)=>{(t!==null||e!==null)&&(n.stdinCleanedUp=!0)},hie=(t,e,n,r)=>{if(!mie(t,e,n,r))throw t},mie=(t,e,n,r=!0)=>n.propagating?_I(t)||fD(t):(n.propagating=!0,AI(n,e)===r?_I(t):fD(t)),AI=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",fD=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",_I=t=>t?.code==="EPIPE",gie=({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:a,streamInfo:o})=>t.stdio.map((u,c)=>PI({stream:u,fdNumber:c,encoding:e,buffer:n[c],maxBuffer:r[c],lines:i[c],allMixed:!1,stripFinalNewline:s,verboseInfo:a,streamInfo:o})),PI=async({stream:t,fdNumber:e,encoding:n,buffer:r,maxBuffer:i,lines:s,allMixed:a,stripFinalNewline:o,verboseInfo:u,streamInfo:c})=>{if(!t)return;const l=dD(t,e,c);if(AI(c,e)){await l;return}const[d]=await Promise.all([oie({stream:t,onStreamEnd:l,fdNumber:e,encoding:n,buffer:r,maxBuffer:i,lines:s,allMixed:a,stripFinalNewline:o,verboseInfo:u,streamInfo:c}),l]);return d},yie=({stdout:t,stderr:e},{all:n})=>n&&(t||e)?iD([t,e].filter(Boolean)):void 0,wie=({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:a,streamInfo:o})=>PI({...vie(t,n),fdNumber:"all",encoding:e,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:bie(t),stripFinalNewline:s,verboseInfo:a,streamInfo:o}),vie=({stdout:t,stderr:e,all:n},[,r,i])=>{const s=r||i;return s?r?i?{stream:n,buffer:s}:{stream:t,buffer:s}:{stream:e,buffer:s}:{stream:n,buffer:s}},bie=({all:t,stdout:e,stderr:n})=>t&&e&&n&&e.readableObjectMode!==n.readableObjectMode,Die=t=>lb(t,"ipc"),Eie=(t,e)=>{const n=mP(t);Id({type:"ipc",verboseMessage:n,fdNumber:"ipc",verboseInfo:e})},Rie=async({subprocess:t,buffer:e,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:s})=>{if(!r)return i;const a=Die(s),o=xd(e,"ipc"),u=xd(n,"ipc");for await(const c of cI({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))o&&(fee(t,i,u),i.push(c)),a&&Eie(c,s);return i},$ie=async(t,e)=>(await Promise.allSettled([t]),e),Sie=async({subprocess:t,options:{encoding:e,buffer:n,maxBuffer:r,lines:i,timeoutDuration:s,cancelSignal:a,gracefulCancel:o,forceKillAfterDelay:u,stripFinalNewline:c,ipc:l,ipcInput:d},context:f,verboseInfo:p,fileDescriptors:h,originalStreams:y,onInternalError:b,controller:w})=>{const E=Ine(t,f),$={originalStreams:y,fileDescriptors:h,subprocess:t,exitPromise:E,propagating:!1},k=gie({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:c,verboseInfo:p,streamInfo:$}),A=wie({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:c,verboseInfo:p,streamInfo:$}),I=[],M=Rie({subprocess:t,buffer:n,maxBuffer:r,ipc:l,ipcOutput:I,verboseInfo:p}),Y=Tie(y,t,$),Q=kie(h,$);try{return await Promise.race([Promise.all([{},One(E),Promise.all(k),A,M,DZ(t,d),...Y,...Q]),b,Cie(t,w),...pZ(t,s,f,w),...EQ({subprocess:t,cancelSignal:a,gracefulCancel:o,context:f,controller:w}),...cZ({subprocess:t,cancelSignal:a,gracefulCancel:o,forceKillAfterDelay:u,context:f,controller:w})])}catch(ae){return f.terminationReason??="other",Promise.all([{error:ae},E,Promise.all(k.map(O=>kI(O))),kI(A),$ie(M,I),Promise.allSettled(Y),Promise.allSettled(Q)])}},Tie=(t,e,n)=>t.map((r,i)=>r===e.stdio[i]?void 0:dD(r,i,n)),kie=(t,e)=>t.flatMap(({stdioItems:n},r)=>n.filter(({value:i,stream:s=i})=>ma(s,{checkOpen:!1})&&!da(s)).map(({type:i,value:s,stream:a=s})=>dD(a,r,e,{isSameDirection:ya.has(i),stopOnExit:i==="native"}))),Cie=async(t,{signal:e})=>{const[n]=await Sn(t,"error",{signal:e});throw n},Aie=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),pD=(t,e,n)=>{const r=t[n];r.has(e)||r.set(e,[]);const i=r.get(e),s=Od();return i.push(s),{resolve:s.resolve.bind(s),promises:i}},Nm=async({resolve:t,promises:e},n)=>{t();const[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...e])]);return!r},xI=async t=>{if(t!==void 0)try{await II(t)}catch{}},_ie=async t=>{if(t!==void 0)try{await NI(t)}catch{}},II=async t=>{await $i(t,{cleanup:!0,readable:!1,writable:!0})},NI=async t=>{await $i(t,{cleanup:!0,readable:!0,writable:!1})},OI=async(t,e)=>{if(await t,e)throw e},FI=(t,e,n)=>{n&&!fD(n)?t.destroy(n):e&&t.destroy()},Pie=({subprocess:t,concurrentStreams:e,encoding:n},{from:r,binary:i=!0,preserveNewlines:s=!0}={})=>{const a=i||ha.has(n),{subprocessStdout:o,waitReadableDestroy:u}=LI(t,r,e),{readableEncoding:c,readableObjectMode:l,readableHighWaterMark:d}=MI(o,a),{read:f,onStdoutDataDone:p}=zI({subprocessStdout:o,subprocess:t,binary:a,encoding:n,preserveNewlines:s}),h=new fs({read:f,destroy:Da(qI.bind(void 0,{subprocessStdout:o,subprocess:t,waitReadableDestroy:u})),highWaterMark:d,objectMode:l,encoding:c});return BI({subprocessStdout:o,onStdoutDataDone:p,readable:h,subprocess:t}),h},LI=(t,e,n)=>{const r=Ib(t,e),i=pD(n,r,"readableDestroy");return{subprocessStdout:r,waitReadableDestroy:i}},MI=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:n},r)=>r?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:n}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:SI},zI=({subprocessStdout:t,subprocess:e,binary:n,encoding:r,preserveNewlines:i})=>{const s=Od(),a=EI({subprocessStdout:t,subprocess:e,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){xie(this,a,s)},onStdoutDataDone:s}},xie=async(t,e,n)=>{try{const{value:r,done:i}=await e.next();i?n.resolve():t.push(r)}catch{}},BI=async({subprocessStdout:t,onStdoutDataDone:e,readable:n,subprocess:r,subprocessStdin:i})=>{try{await NI(t),await r,await xI(i),await e,n.readable&&n.push(null)}catch(s){await xI(i),GI(n,s)}},qI=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:n},r)=>{await Nm(n,e)&&(GI(t,r),await OI(e,r))},GI=(t,e)=>{FI(t,t.readable,e)},Iie=({subprocess:t,concurrentStreams:e},{to:n}={})=>{const{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}=jI(t,n,e),a=new Ym({...UI(r,t,i),destroy:Da(HI.bind(void 0,{subprocessStdin:r,subprocess:t,waitWritableFinal:i,waitWritableDestroy:s})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return WI(r,a),a},jI=(t,e,n)=>{const r=WP(t,e),i=pD(n,r,"writableFinal"),s=pD(n,r,"writableDestroy");return{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}},UI=(t,e,n)=>({write:Nie.bind(void 0,t),final:Da(Oie.bind(void 0,t,e,n))}),Nie=(t,e,n,r)=>{t.write(e,n)?r():t.once("drain",r)},Oie=async(t,e,n)=>{await Nm(n,e)&&(t.writable&&t.end(),await e)},WI=async(t,e,n)=>{try{await II(t),e.writable&&e.end()}catch(r){await _ie(n),VI(e,r)}},HI=async({subprocessStdin:t,subprocess:e,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await Nm(n,e),await Nm(r,e)&&(VI(t,i),await OI(e,i))},VI=(t,e)=>{FI(t,t.writable,e)},Fie=({subprocess:t,concurrentStreams:e,encoding:n},{from:r,to:i,binary:s=!0,preserveNewlines:a=!0}={})=>{const o=s||ha.has(n),{subprocessStdout:u,waitReadableDestroy:c}=LI(t,r,e),{subprocessStdin:l,waitWritableFinal:d,waitWritableDestroy:f}=jI(t,i,e),{readableEncoding:p,readableObjectMode:h,readableHighWaterMark:y}=MI(u,o),{read:b,onStdoutDataDone:w}=zI({subprocessStdout:u,subprocess:t,binary:o,encoding:n,preserveNewlines:a}),E=new Km({read:b,...UI(l,t,d),destroy:Da(Lie.bind(void 0,{subprocessStdout:u,subprocessStdin:l,subprocess:t,waitReadableDestroy:c,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:y,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:h,writableObjectMode:l.writableObjectMode,encoding:p});return BI({subprocessStdout:u,onStdoutDataDone:w,readable:E,subprocess:t,subprocessStdin:l}),WI(l,E,u),E},Lie=async({subprocessStdout:t,subprocessStdin:e,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:s},a)=>{await Promise.all([qI({subprocessStdout:t,subprocess:n,waitReadableDestroy:r},a),HI({subprocessStdin:e,subprocess:n,waitWritableFinal:i,waitWritableDestroy:s},a)])},KI=(t,e,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{const s=r||ha.has(e),a=Ib(t,n),o=EI({subprocessStdout:a,subprocess:t,binary:s,shouldEncode:!0,encoding:e,preserveNewlines:i});return Mie(o,a,t)},Mie=async function*(t,e,n){try{yield*t}finally{e.readable&&e.destroy(),await n}},zie=(t,{encoding:e})=>{const n=Aie();t.readable=Pie.bind(void 0,{subprocess:t,concurrentStreams:n,encoding:e}),t.writable=Iie.bind(void 0,{subprocess:t,concurrentStreams:n}),t.duplex=Fie.bind(void 0,{subprocess:t,concurrentStreams:n,encoding:e}),t.iterable=KI.bind(void 0,t,e),t[Symbol.asyncIterator]=KI.bind(void 0,t,e,{})},Bie=(t,e)=>{for(const[n,r]of Gie){const i=r.value.bind(e);Reflect.defineProperty(t,n,{...r,value:i})}},qie=(async()=>{})().constructor.prototype,Gie=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(qie,t)]),jie=(t,e,n,r)=>{const{file:i,commandArguments:s,command:a,escapedCommand:o,startTime:u,verboseInfo:c,options:l,fileDescriptors:d}=Uie(t,e,n),{subprocess:f,promise:p}=Hie({file:i,commandArguments:s,options:l,startTime:u,verboseInfo:c,command:a,escapedCommand:o,fileDescriptors:d});return f.pipe=lD.bind(void 0,{source:f,sourcePromise:p,boundOptions:{},createNested:r}),Bie(f,p),pa.set(f,{options:l,fileDescriptors:d}),f},Uie=(t,e,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:a}=wP(t,e,n),{file:o,commandArguments:u,options:c}=ax(t,e,n),l=Wie(c),d=lre(l,a);return{file:o,commandArguments:u,command:r,escapedCommand:i,startTime:s,verboseInfo:a,options:l,fileDescriptors:d}},Wie=({timeout:t,signal:e,...n})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...n,timeoutDuration:t}},Hie=({file:t,commandArguments:e,options:n,startTime:r,verboseInfo:i,command:s,escapedCommand:a,fileDescriptors:o})=>{let u;try{u=yN(t,e,n)}catch(h){return ire({error:h,command:s,escapedCommand:a,fileDescriptors:o,options:n,startTime:r,verboseInfo:i})}const c=new AbortController;DN(Number.POSITIVE_INFINITY,c.signal);const l=[...u.stdio];kre(u,o,c),zre(u,n,c);const d={},f=Od();u.kill=yQ.bind(void 0,{kill:u.kill.bind(u),options:n,onInternalError:f,context:d,controller:c}),u.all=yie(u,n),zie(u,n),nre(u,n);const p=Vie({subprocess:u,options:n,startTime:r,verboseInfo:i,fileDescriptors:o,originalStreams:l,command:s,escapedCommand:a,context:d,onInternalError:f,controller:c});return{subprocess:u,promise:p}},Vie=async({subprocess:t,options:e,startTime:n,verboseInfo:r,fileDescriptors:i,originalStreams:s,command:a,escapedCommand:o,context:u,onInternalError:c,controller:l})=>{const[d,[f,p],h,y,b]=await Sie({subprocess:t,options:e,context:u,verboseInfo:r,fileDescriptors:i,originalStreams:s,onInternalError:c,controller:l});l.abort(),c.resolve();const w=h.map((k,A)=>So(k,e,A)),E=So(y,e,"all"),$=Kie({errorInfo:d,exitCode:f,signal:p,stdio:w,all:E,ipcOutput:b,context:u,options:e,command:a,escapedCommand:o,startTime:n});return Yb($,r,e)},Kie=({errorInfo:t,exitCode:e,signal:n,stdio:r,all:i,ipcOutput:s,context:a,options:o,command:u,escapedCommand:c,startTime:l})=>"error"in t?Kb({error:t.error,command:u,escapedCommand:c,timedOut:a.terminationReason==="timeout",isCanceled:a.terminationReason==="cancel"||a.terminationReason==="gracefulCancel",isGracefullyCanceled:a.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof Tm,isForcefullyTerminated:a.isForcefullyTerminated,exitCode:e,signal:n,stdio:r,all:i,ipcOutput:s,options:o,startTime:l,isSync:!1}):Rx({command:u,escapedCommand:c,stdio:r,all:i,ipcOutput:s,options:o,startTime:l}),hD=(t,e)=>{const n=Object.fromEntries(Object.entries(e).map(([r,i])=>[r,Yie(r,t[r],i)]));return{...t,...n}},Yie=(t,e,n)=>Xie.has(t)&&ln(e)&&ln(n)?{...e,...n}:n,Xie=new Set(["env",...lP]),wa=(t,e,n,r)=>{const i=(a,o,u)=>wa(a,o,n,u),s=(...a)=>Jie({mapArguments:t,deepOptions:n,boundOptions:e,setBoundExeca:r,createNested:i},...a);return r!==void 0&&r(s,i,e),s},Jie=({mapArguments:t,deepOptions:e={},boundOptions:n={},setBoundExeca:r,createNested:i},s,...a)=>{if(ln(s))return i(t,hD(n,s),r);const{file:o,commandArguments:u,options:c,isSync:l}=Qie({mapArguments:t,firstArgument:s,nextArguments:a,deepOptions:e,boundOptions:n});return l?zne(o,u,c):jie(o,u,c,i)},Qie=({mapArguments:t,firstArgument:e,nextArguments:n,deepOptions:r,boundOptions:i})=>{const s=xX(e)?IX(e,n):[e,...n],[a,o,u]=Q_(...s),c=hD(hD(r,i),u),{file:l=a,commandArguments:d=o,options:f=c,isSync:p=!1}=t({file:a,commandArguments:o,options:c});return{file:l,commandArguments:d,options:f,isSync:p}},Zie=({file:t,commandArguments:e})=>YI(t,e),ese=({file:t,commandArguments:e})=>({...YI(t,e),isSync:!0}),YI=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);const[n,...r]=tse(t);return{file:n,commandArguments:r}},tse=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);const e=t.trim();if(e==="")return[];const n=[];for(const r of e.split(nse)){const i=n.at(-1);i&&i.endsWith("\\")?n[n.length-1]=`${i.slice(0,-1)} ${r}`:n.push(r)}return n},nse=/ +/g,rse=(t,e,n)=>{t.sync=e(sse,n),t.s=t.sync},ise=({options:t})=>XI(t),sse=({options:t})=>({...XI(t),isSync:!0}),XI=t=>({options:{...ase(t),...t}}),ase=({input:t,inputFile:e,stdio:n})=>t===void 0&&e===void 0&&n===void 0?{stdin:"inherit"}:{},ose={preferLocal:!0},mD=wa(()=>({}));wa(()=>({isSync:!0})),wa(Zie),wa(ese),wa(mZ),wa(ise,{},ose,rse),rre();const gD=jv(vN().length||1);class use{constructor(e="dot"){this.path=e}async unflatten(e){return await gD(async()=>{const n=zt.withTag("graphviz-binary"),r=await mD("unflatten",["-l 1","-c 3"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});return r instanceof Error&&(r.stdout?n.warn(`Command: '${r.command}' failed: ${r.stderr}
1832
+
1833
+ but returned
1834
+ ${r.stdout}`):n.error(`Command: '${r.command}' failed: ${r.stderr}
1835
+
1836
+ nothing returned, ignoring...`)),r.stdout&&(e=r.stdout.replaceAll(/\t\[/g," [").replaceAll(/\t/g," ")),e})}async layoutJson(e){return await gD(async()=>{const n=zt.withTag("graphviz-binary"),r=await mD(this.path,["-Tjson","-y"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});if(r instanceof Error){if(!r.stdout)throw n.error(`Command: '${r.command}' nothing returned and failed: "${r.stderr}"`),n.warn(`FAILED DOT:
1837
+ ${e}`),r;n.warn(`Command: '${r.command}' returned result but also failed "${r.stderr}"`)}return r.stdout})}async acyclic(e){return Promise.reject(new Error("Method not implemented."))}async svg(e){return await gD(async()=>{const n=zt.withTag("graphviz-binary"),r=await mD(this.path,["-Tsvg","-y"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});if(r instanceof Error){if(n.warn(`DOT:
1838
+ ${e}`),!r.stdout)throw n.error(`Command: '${r.command}' nothing returned and failed: ${r.stderr}`),r;n.warn(`Command: '${r.command}' returned result but also failed ${r.stderr}`)}return r.stdout})}}const JI="1.21.0",cse=t=>{yD.forEach(e=>{lse(t,e)})},yD=["name","message","stack","cause","errors"],lse=(t,e)=>{const n=wD(t,e);if(n!==void 0){if(dse(n)){bi(t,e,t[e]);return}fse(n)&&QI(t,e,n)}},wD=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?void 0:wD(r,e)},dse=({get:t,set:e})=>t!==void 0&&e===void 0,fse=({enumerable:t,writable:e})=>t||!e,bi=(t,e,n)=>{QI(t,e,{value:n})},QI=(t,e,n)=>{Object.defineProperty(t,e,{...n,..."get"in n||"set"in n?{}:{writable:!0},enumerable:!1,configurable:!0})},pse=(t,e)=>{if(Array.isArray(t.errors)){const n=t.errors.filter(hse).map(e).filter(Boolean);bi(t,"errors",n)}else mse(t)?bi(t,"errors",[]):t.errors!==void 0&&gse(t)},hse=t=>t!==void 0,mse=t=>"AggregateError"in globalThis&&(t.name==="AggregateError"||t instanceof AggregateError),gse=t=>{delete t.errors,t.errors!==void 0&&bi(t,"errors",[])},yse=(t,e)=>{if(!("cause"in t))return;const n=t.cause===void 0?t.cause:e(t.cause);n===void 0?delete t.cause:bi(t,"cause",n)},wse=t=>vse(t)||bse(t),vse=t=>{try{return t instanceof Error}catch{return!1}},bse=t=>{try{return Dse.has(Object.prototype.toString.call(t))}catch{return!1}},Dse=new Set(["[object Error]","[object DOMException]","[object DOMError]","[object Exception]"]),Ese=t=>!Object.isExtensible(t)||yD.some(e=>Rse(t,e)||$se(t,e)),Rse=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);return n!==void 0&&!n.configurable},$se=(t,e)=>{try{return t[e],!1}catch{return!0}},vD=t=>{const e=Sse(t.message,t.name);bi(t,"stack",e)},Sse=(t="",e="Error")=>{const n=Tse(e),{stack:r}=new n(t);return typeof r=="string"&&r!==""?r:`${e}: ${t}`},Tse=t=>{const e={value:t,enumerable:!1,writable:!0,configurable:!0},n=Object.defineProperty(class extends Error{},"name",e);return Object.defineProperty(n.prototype,"name",e),n},kse=t=>{const e={};for(const n of Cse(t))try{const r=t[n],{enumerable:i,configurable:s,writable:a=!0}=wD(t,n);Object.defineProperty(e,n,{value:r,enumerable:i,configurable:s,writable:a})}catch{}return e},Cse=t=>{const e=Ase(t);for(const n of yD)_se(t,n)&&e.push(n);return e},Ase=t=>{try{return Reflect.ownKeys(t)}catch{return[]}},_se=(t,e)=>{try{return e in t&&!Object.hasOwn(t,e)}catch{return!1}},ZI=t=>{const{name:e,message:n,stack:r,cause:i,errors:s,...a}=kse(t),o=Pse(n,a),u=Ose(e,o);return n===o&&Fse(u,a),Object.entries({name:e,stack:r,cause:i,errors:s}).forEach(([c,l])=>{Lse(u,c,l)}),r===void 0&&vD(u),u},Pse=(t,e)=>typeof t=="string"&&t!==""?t:Nse(xse(e)),xse=t=>{try{return JSON.stringify(t)}catch{return Ise(t)}},Ise=t=>{try{return String(t)}catch{return"Invalid error"}},Nse=t=>t.length<e1?t:`${t.slice(0,e1)}...`,e1=1e3,Ose=(t,e)=>t==="AggregateError"&&"AggregateError"in globalThis?new AggregateError([],e):t in t1?new t1[t](e):new Error(e),t1={Error,ReferenceError,TypeError,SyntaxError,RangeError,URIError,EvalError},Fse=(t,e)=>{for(const n in e)n in t||(t[n]=e[n])},Lse=(t,e,n)=>{n!==void 0&&bi(t,e,n)},Mse=t=>{try{const e=new Error(String(t));return vD(e),e}catch(e){return e}},{toString:zse}=Object.prototype,Bse=t=>qse(t)?ZI(t):wse(t)?Gse(t)?ZI(t):t:Mse(t),qse=t=>{try{return ln(t)}catch{return!1}},Gse=t=>jse(t)||Ese(t)||Use(t),jse=t=>{try{return zse.call(t)==="[object Object]"}catch{return!0}},Use=t=>typeof t.constructor!="function"||typeof t.constructor.name!="string"||t.constructor.name===""||t.constructor.prototype!==Object.getPrototypeOf(t),Om=(t,{shallow:e=!1}={})=>n1(t,[],e),n1=(t,e,n)=>{if(e.includes(t))return;const r=n?Wse:s=>n1(s,[...e,t],n),i=Bse(t);return Hse(i,r),i},Wse=t=>t,Hse=(t,e)=>{Vse(t),Kse(t),Yse(t),yse(t,e),pse(t,e),cse(t)},Vse=t=>{if(Fm(t.name))return;const e=Object.getPrototypeOf(t).name,n=Fm(e)?e:t.constructor.name;bi(t,"name",n)},Kse=t=>{Fm(t.message)||bi(t,"message","")},Yse=t=>{Fm(t.stack)||vD(t)},Fm=t=>typeof t=="string"&&t!=="",Xse=(t,e,n=t.name)=>{if(Jse(e),typeof n!="string")throw new TypeError(`currentName must be a string: ${n}`);return n},Jse=t=>{if(!Qse(t))throw new TypeError(`ErrorClass must be a class: ${t}`);if(!r1(t.prototype))throw new TypeError(`ErrorClass must inherit from Error: ${t}`);if(!Zse(t))throw new TypeError(`ErrorClass must be have a valid constructor: ${t}`)},Qse=t=>typeof t=="function"&&typeof t.prototype=="object"&&t.prototype!==null,r1=t=>t!==null&&(t.name==="Error"||r1(Object.getPrototypeOf(t))),Zse=t=>typeof t.prototype.constructor=="function",i1=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},eae=(t,e)=>{Object.getPrototypeOf(t)!==e.prototype&&(tae(t,e),o1(t,"constructor"),nae(t,e))},tae=(t,e)=>{Object.setPrototypeOf(t,e.prototype)},nae=(t,e)=>{o1(t,"name");const n=s1(e.prototype);t.name!==n&&i1(t,"name",n)},s1=t=>rae(t)??iae(t)??s1(Object.getPrototypeOf(t)),rae=t=>Object.hasOwn(t,"name")&&a1(t.name)?t.name:void 0,iae=t=>typeof t.constructor=="function"&&a1(t.constructor.name)?t.constructor.name:void 0,a1=t=>typeof t=="string"&&t!=="",o1=(t,e)=>{Object.hasOwn(t,e)&&delete t[e]},sae=(t,e)=>{if(!aae(t,e))return;const n=uae(t,e);i1(t,"stack",n)},aae=(t,e)=>e!==t.name&&e!==""&&t.stack.includes(e)&&oae(),oae=()=>{class t extends Error{}const e={value:u1,enumerable:!1,writable:!0,configurable:!0};Object.defineProperty(t,"name",e),Object.defineProperty(t.prototype,"name",e);const{stack:n}=new t("");return typeof n=="string"&&n.includes(u1)},u1="SetErrorClassError",uae=({name:t,stack:e},n)=>{if(e.startsWith(`${n}: `))return e.replace(n,t);const r=cae(n,t),[i,s]=r.find(([a])=>e.includes(a));return e.replace(i,s)},cae=(t,e)=>[[`
1839
+ ${t}: `,`
1840
+ ${e}: `],[`${t}: `,`${e}: `],[`${t} `,`${e} `],[t,e]],lae=(t,e,n)=>{const r=Om(t),i=Xse(r,e,n);return eae(r,e),sae(r,i),r},dae=(t,e)=>e.configurable===!1?fae(t,e):mae(t,e),fae=(t,e)=>({...e,...pae(t,e),...hae(t,e)}),pae=(t,e)=>e.writable===!0&&t.writable===!1?{writable:!1}:{},hae=(t,e)=>t.hasValue&&"value"in e&&e.writable===!0?{value:t.value}:{},mae=(t,e)=>{const n=qd(t.enumerable,e.enumerable,!0),r=qd(t.writable,e.writable,!0),i=qd(t.configurable,e.configurable,!0);return{...gae(t,e,r),enumerable:n,configurable:i}},gae=(t,e,n)=>t.hasValue?{value:t.value,writable:n}:!c1(t)&&!c1(e)?{value:e.value,writable:n}:{get:qd(t.get,e.get),set:qd(t.set,e.set)},c1=({get:t,set:e})=>t!==void 0||e!==void 0,qd=(t,e,n)=>t??e??n,yae=(t,e,n)=>{if(!wae(t))throw new TypeError(`Argument must be an object: ${t}`);if(!vae(e))throw new TypeError(`Property key must be a string, a symbol or an integer: ${e}`);return bae(n)},wae=t=>typeof t=="object"&&t!==null,vae=t=>{const e=typeof t;return e==="string"||e==="symbol"||e==="number"},bae=t=>{if(!ln(t))throw new TypeError(`Descriptor must be a plain object: ${t}`);const{enumerable:e,writable:n,configurable:r,value:i,get:s,set:a,...o}=t,u="value"in t;return Dae({enumerable:e,writable:n,configurable:r,get:s,set:a,unknownProps:o,hasValue:u}),{enumerable:e,writable:n,configurable:r,value:i,get:s,set:a,hasValue:u}},Dae=({enumerable:t,writable:e,configurable:n,get:r,set:i,unknownProps:s,hasValue:a})=>{l1(a,r,"get"),l1(a,i,"set"),bD(t,"enumerable"),bD(e,"writable"),bD(n,"configurable"),Rae(s)},l1=(t,e,n)=>{if(Eae(e,n),t&&e!==void 0)throw new TypeError(`Descriptor property "value" and "${n}" must not both be defined: ${e}`)},Eae=(t,e)=>{if(t!==void 0&&typeof t!="function")throw new TypeError(`Descriptor property "${e}" must be a function: ${t}`)},bD=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`Descriptor property "${e}" must be a boolean: ${t}`)},Rae=t=>{const[e]=Object.keys(t);if(e!==void 0)throw new TypeError(`Unknown descriptor property "${e}": ${t[e]}`)},$ae=(t,e,n)=>{const r=yae(t,e,n),i=d1(t,e),s=dae(r,i);return Sae(t,e,s),t},d1=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t,e);if(n!==void 0)return n;const r=Object.getPrototypeOf(t);return r===null?{}:d1(r,e)},Sae=(t,e,n)=>{try{Object.defineProperty(t,e,n)}catch{}},Tae=(t,e,n)=>{if(n!==void 0)return f1(t,e,n);try{delete t[e]}catch{}if(t[e]!==void 0)return f1(t,e)},f1=(t,e,n)=>{const r=kae(e);$ae(t,e,{value:n,...r})},kae=t=>typeof t=="string"&&t.startsWith("_")?{enumerable:!1}:{},Cae=t=>Aae(t)||_ae(t),Aae=t=>{try{return t instanceof Error}catch{return!1}},_ae=t=>{try{return Pae.has(Object.prototype.toString.call(t))}catch{return!1}},Pae=new Set(["[object Error]","[object DOMException]","[object DOMError]","[object Exception]"]),xae=(t,e,n={})=>{if(p1(t,"First argument"),p1(e,"Second argument"),!ln(n))throw new TypeError(`Options must be a plain object: ${n}`);const{soft:r=!1}=n;if(typeof r!="boolean")throw new TypeError(`Option "soft" must be a boolean: ${r}`);return{soft:r}},p1=(t,e)=>{if(t===void 0)throw new TypeError(`${e} is required.`);if(!Iae(t))throw new TypeError(`${e} must be a plain object or an error: ${t}`)},Iae=t=>ln(t)||Cae(t),Nae=({error:t,props:e,propName:n,soft:r})=>Oae(n)||!Mae.call(e,n)||r&&t[n]!==void 0,Oae=t=>t in Fae||Lae.has(t),Fae=new Error("check"),Lae=new Set(["prototype","errors","cause"]),{propertyIsEnumerable:Mae}=Object.prototype,zae=(t,e,n)=>{const{soft:r}=xae(t,e,n);for(const i of Reflect.ownKeys(e))Bae({error:t,props:e,propName:i,soft:r});return t},Bae=({error:t,props:e,propName:n,soft:r})=>{Nae({error:t,props:e,propName:n,soft:r})||Tae(t,n,e[n])},Lm=(t,e,n)=>{Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!1,configurable:!0})},qae=(t,e)=>{if(t.errors===void 0)return;const n=t.errors.map(r=>e(r).error).filter(Boolean);Lm(t,"errors",n)},Gae=({target:t,source:e,parent:n,child:r})=>{if(!h1(t)){jae(t,e);return}h1(e)&&Lm(t,"errors",[...r.errors,...n.errors])},jae=(t,e)=>{e.errors!==void 0&&Lm(t,"errors",e.errors)},h1=t=>t.errors!==void 0&&t.errors.length!==0,Uae=(t,e,n=t.message)=>{if(typeof e!="string")throw new TypeError(`newMessage must be a string: ${e}`);if(typeof n!="string")throw new TypeError(`currentMessage must be a string: ${n}`);return n},Wae=({name:t,stack:e},n,r)=>r!==""&&e.includes(r)?Hae({name:t,stack:e,newMessage:n,currentMessage:r}):Kae(t,e,n),Hae=({name:t,stack:e,newMessage:n,currentMessage:r})=>{const i=Vae(t,n,r),[s,a]=i.find(([o])=>e.includes(o));return e.replace(s,a)},Vae=(t,e,n)=>[[`${t}: ${n}`,`${t}: ${e}`],[`: ${n}`,`: ${e}`],[`
1841
+ ${n}`,`
1842
+ ${e}`],[` ${n}`,` ${e}`],[n,e]],Kae=(t,e,n)=>{const r=`${t}: `,i=n.trimEnd();return e===t||e.startsWith(`${t}
1843
+ `)?e.replace(t,`${r}${i}`):e.startsWith(r)?e.replace(r,`${r}${i}
1844
+ `):`${r}${i}
1845
+ ${e}`},Yae=(t,e,n)=>{const r=Om(t),i=Uae(r,e,n);return g1(r,"message",e),Xae(r,e,i),r},Xae=(t,e,n)=>{if(e===n||!Jae())return;const r=Wae(t,e,n);g1(t,"stack",r)},Jae=()=>{const{stack:t}=new Error(m1);return typeof t=="string"&&t.includes(m1)},m1="set-error-message test message",g1=(t,e,n)=>{Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})},Qae=(t,e,n)=>{if(typeof e!="string")throw new TypeError(`Second argument must be a message string: ${e}`);const r=Om(t),i=Zae(e,r.message);return Yae(r,i,n)},Zae=(t,e)=>{const n=t.trim(),r=e.trim();return n===""?r:r===""?n:eoe(n,r,t)},eoe=(t,e,n)=>t.endsWith(toe)?n.endsWith(noe)?`${t}
1846
+ ${e}`:`${t} ${e}`:`${e}
1847
+ ${t}`,toe=":",noe=`
1848
+ `,roe=({parent:t,child:e,target:n,stackError:r})=>{const i=t.message;return n.message=e.message,Qae(n,i,r.message)},ioe=(t,e)=>y1(t)===e,y1=t=>typeof t=="object"&&t!==null?t.stack:void 0,soe=({wrap:t,target:e,source:n,childHasStack:r})=>t===r?e:(Lm(e,"stack",n.stack),n),aoe=t=>{const{wrap:e,name:n}=t;return typeof e!="boolean"?n==="Error":(Object.hasOwn(t,"wrap")&&delete t.wrap,e)},ooe=t=>w1(t,[]).error,w1=(t,e)=>{if(e.includes(t))return{};const n=c=>w1(c,[...e,t]),r=y1(t),i=Om(t,{shallow:!0}),s=ioe(i,r);qae(i,n);const{parent:a,childHasStack:o}=uoe(i,n);return{error:a,errorHasStack:s||o}},uoe=(t,e)=>{const n=aoe(t);if(t.cause===void 0)return{parent:t,childHasStack:!1};const{error:r,errorHasStack:i}=e(t.cause);return delete t.cause,{parent:coe({parent:t,child:r,childHasStack:i,wrap:n}),childHasStack:i}},coe=({parent:t,child:e,childHasStack:n,wrap:r})=>{if(e===void 0)return t;const[i,s]=r?[e,t]:[t,e],a=soe({wrap:r,target:i,source:s,childHasStack:n}),o=lae(i,i.constructor,a.name),u=roe({parent:t,child:e,target:o,stackError:a});return Gae({target:u,source:s,parent:t,child:e}),zae(u,s,{soft:!r})},Mm=Object.create(null),Gd=t=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(t?Mm:globalThis),es=new Proxy(Mm,{get(t,e){return Gd()[e]??Mm[e]},has(t,e){const n=Gd();return e in n||e in Mm},set(t,e,n){const r=Gd(!0);return r[e]=n,!0},deleteProperty(t,e){if(!e)return!1;const n=Gd(!0);return delete n[e],!0},ownKeys(){const t=Gd(!0);return Object.keys(t)}}),loe=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",doe=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:!0}]];function foe(){if(globalThis.process?.env)for(const t of doe){const e=t[1]||t[0];if(globalThis.process?.env[e])return{name:t[0].toLowerCase(),...t[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}const v1=foe();v1.name;function va(t){return t?t!=="false":!1}const poe=globalThis.process?.platform||"",zm=va(es.CI)||v1.ci!==!1,b1=va(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY);va(es.DEBUG);const hoe=loe==="test"||va(es.TEST);va(es.MINIMAL);const moe=/^win/i.test(poe);!va(es.NO_COLOR)&&(va(es.FORCE_COLOR)||(b1||moe)&&es.TERM);const goe=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(goe?.split(".")[0]);const yoe=globalThis.process||Object.create(null),D1={versions:{}};new Proxy(yoe,{get(t,e){if(e==="env")return es;if(e in t)return t[e];if(e in D1)return D1[e]}});const woe=globalThis.process?.release?.name==="node",voe=!!globalThis.Bun||!!globalThis.process?.versions?.bun,boe=!!globalThis.Deno,Doe=!!globalThis.fastly,Eoe=!!globalThis.Netlify,Roe=!!globalThis.EdgeRuntime,$oe=globalThis.navigator?.userAgent==="Cloudflare-Workers",Soe=[[Eoe,"netlify"],[Roe,"edge-light"],[$oe,"workerd"],[Doe,"fastly"],[boe,"deno"],[voe,"bun"],[woe,"node"]];function Toe(){const t=Soe.find(e=>e[0]);if(t)return{name:t[1]}}const koe=Toe();koe?.name;const E1=yt.bold(yt.bgRed(yt.white("ERROR"))),R1=yt.bold(yt.yellow("WARN")),Coe=yt.bold(yt.green("INFO"));function $1(t){const e=mN("info",{prefix:t,allowClearScreen:!zm}),n=!zm;return{...e,info(r,i){e.info(`${Coe} ${r}`,{timestamp:n,...i})},warn(r,i){if(r instanceof Error){e.warn(`${R1} ${yt.red(r.name+" "+r.message)}
1849
+ ${Wd(r,{colors:!0})}`,{timestamp:n,...i});return}e.warn(`${R1} ${r}`,{timestamp:n,...i})},error(r,i){if(r instanceof Error){const s=ooe(r);e.error(`${E1} ${yt.red(s.message)}
1850
+ ${Wd(s,{colors:!0})}`,{timestamp:n,error:r,...i});return}e.error(`${E1} ${r}`,{timestamp:n,...i})}}}const DD=()=>{},Aoe={info:DD,warn:DD,error:DD},_oe=1e6;function S1(t){const[e,n]=Yd(t),r=e*1e3+n/_oe;return{ms:r,pretty:Tx(r)}}function Poe(t){const e=Yd();return{stopAndLog(n="done in "){n=yt.green(`${n}${S1(e).pretty}`),t?t.info(n):zt.success(n)}}}class xoe{constructor(e){this.services=e}isInitialized=!1;async initWorkspace(e){if(this.isInitialized)throw new Error("Workspace already initialized");const n=this.services.logger,r=this.services.shared.workspace.WorkspaceManager;n.info(`${yt.dim("workspace:")} ${e.uri}`),r.initialize({capabilities:{},processId:null,rootUri:null,workspaceFolders:[e]}),await r.initializeWorkspace([e])}async init(){if(this.isInitialized)throw new Error("Workspace already initialized");this.isInitialized=!0;const e=this.services.logger,n=this.services.likec4.ModelBuilder,r=this.services.shared.workspace.LangiumDocuments,i=this.services.shared.workspace.DocumentBuilder,s=r.all.toArray();if(s.length===0)throw e.error("no LikeC4 sources found"),new Error("no LikeC4 sources found");e.info(`${yt.dim("workspace:")} found ${s.length} source files`),await i.build(s,{validation:!0});const a=await n.buildComputedModel(),o=Wu(a?.views??{}).length;if(o===0){e.warn(`${yt.dim("workspace:")} no views found`);return}e.info(`${yt.dim("workspace:")} ${yt.green(`\u2713 computed ${o} views`)}`);const u=await this.services.likec4.Views.diagrams();u.length===o?e.info(`${yt.dim("workspace:")} ${yt.green("\u2713 all views layouted")}`):e.warn(`${yt.dim("workspace:")} ${yt.yellow(`\u2717 layouted ${u.length} views`)}`)}}function Ioe(t){return e=>new t(e)}const Noe={logger:()=>{throw new Error("Logger must be provided")},likec4:{Layouter:()=>{throw new Error("Layouter must be provided")}},cli:{Workspace:Ioe(xoe)}};function T1(t){const e=Zm(t,{useFileSystem:!0,logger:"default",graphviz:"wasm"});let n;switch(e.logger){case!1:n=Aoe;break;case"vite":n=$1("c4:lsp ");break;case"default":n=zt.withTag("lsp");break;default:n=e.logger}const r=e.graphviz==="binary";n.info(`${yt.dim("version")} ${JI}`),n.info(`${yt.dim("layout")} ${r?"binary":"wasm"}`);const i={logger:()=>n,likec4:{Layouter:()=>new T_(r===!0?new use:new ko)}};return a7(e.logger===!1?"silent":"info"),e.logger!==!1&&e.logger!=="default"&&Me.setReporters([{log:({level:s,...a},o)=>{const u=a.tag||"",c=a.args.map(d=>Cj(d)?d.stack??d.message:typeof d=="string"?d:String(d));u&&c.unshift(`[${u}]`);const l=c.join(" ");switch(!0){case s>=vt.debug:break;case s>=vt.info:{n.info(l);break}case s>=vt.log:{n.info(l);break}case s>=vt.warn:{n.warn(l);break}case s>=vt.fatal:{n.error(l);break}}}}]),RX(e.useFileSystem?u7:{},Noe,i).likec4}const k1=t=>new Error(`Invalid model:
1851
+ ${t.getErrors().map(e=>` ${e.sourceFsPath}:${e.line} ${e.message.slice(0,200)}`).join(`
1852
+ `)}`);class ts{constructor(e,n,r){this.workspace=e,this.langium=n,this.isPrintErrorEnabled=r,this.logger=n.logger,this.isPrintErrorEnabled&&this.printErrors()}static async fromSource(e,n){const r=T1(Zm(n,{useFileSystem:!1,logger:!1,graphviz:"wasm"})),i=Jt.from({scheme:"virtual",path:"/workspace"});await r.cli.Workspace.initWorkspace({uri:i.toString(),name:"virtual"});const s=kt.joinPath(i,"source.likec4");r.shared.workspace.LangiumDocuments.createDocument(s,e),await r.cli.Workspace.init();const a=new ts(i.path,r,n?.printErrors??!0);return n?.throwIfInvalid===!0&&a.hasErrors()?(a.dispose(),Promise.reject(k1(a))):a}static likec4Instances=new Map;static async fromWorkspace(e="",n){const r=I1(e);if(!x1(r))throw new Error(`Workspace not found: ${r}`);let i=ts.likec4Instances.get(r);if(!i){const s=T1(Zm(n,{useFileSystem:!0,logger:"default",graphviz:"wasm"}));await s.cli.Workspace.initWorkspace({uri:O1(r).toString(),name:N1(r)}),await s.cli.Workspace.init(),i=new ts(r,s,n?.printErrors??!0),ts.likec4Instances.set(r,i)}return n?.throwIfInvalid===!0&&i.hasErrors()?(i.dispose(),Promise.reject(k1(i))):i}modelComputedRef;modelLayoutedRef;logger;get viewsService(){return this.langium.likec4.Views}get LangiumDocuments(){return this.langium.shared.workspace.LangiumDocuments}async diagrams(){return await this.langium.likec4.Views.diagrams()}computedModel(){let e=this.modelComputedRef?.deref();if(!e){const n=this.langium.likec4.ModelBuilder.unsafeSyncBuildModel();if(!n)throw new Error("Failed to build model");const r=this.langium.likec4.ModelBuilder.unsafeSyncBuildComputedModel(n);e=VD.create(r),this.modelComputedRef=new WeakRef(e)}return e}async layoutedModel(){let e=this.modelLayoutedRef?.deref();if(!e){const n=await this.langium.likec4.ModelBuilder.buildComputedModel();if(!n)throw new Error("Failed to build model");const r=await this.viewsService.diagrams();e=VD.create({...n,__:"layouted",views:rw(r,Vu("id"))}),this.modelLayoutedRef=new WeakRef(e)}return e}getErrors(){return this.LangiumDocuments.all.toArray().flatMap(e=>(e.diagnostics??[]).filter(n=>n.severity===zu.Error).map(({message:n,range:r})=>({message:n,line:r.start.line,range:r,sourceFsPath:e.uri.fsPath})))}hasErrors(){return this.LangiumDocuments.all.some(e=>e.diagnostics?.some(n=>n.severity===zu.Error)??!1)}printErrors(){let e=!1;for(const n of this.LangiumDocuments.all){const r=n.diagnostics?.filter(i=>i.severity===1);if(r&&r.length>0){e=!0;const i=r.flatMap(s=>{const a=s.range.start.line,o=s.message.split(`
1853
+ `);return o.length>10&&(o.length=10,o.push("...")),o.map((u,c)=>c===0?" "+yt.dim(`Line ${a}: `)+yt.red(u):" ".repeat(10)+yt.red(u))}).join(`
1854
+ `);this.logger.error(`Invalid ${n.uri.fsPath}
1855
+ ${i}`)}}return e}async notifyUpdate({changed:e,removed:n}){this.modelLayoutedRef=void 0,this.modelComputedRef=void 0;const r=this.langium.shared.workspace.WorkspaceLock;try{let i=!1;return await r.write(async s=>{await this.langium.shared.workspace.DocumentBuilder.update(e?[Jt.file(e)]:[],n?[Jt.file(n)]:[],s),i=!s.isCancellationRequested}),i}catch(i){return this.logger.error(i),!1}}onModelUpdate(e){const n=this.langium.likec4.ModelBuilder.onModelParsed(()=>e());return()=>{n.dispose()}}dispose(){for(const[e,n]of ts.likec4Instances)n===this&&ts.likec4Instances.delete(e)}}export{Qe as C,zt as H,ts as L,mE as N,Sa as T,Ca as a,Hu as b,je as c,ie as d,Ss as e,UT as f,wt as g,$1 as h,$t as i,Yv as j,I5 as k,Or as l,Ua as m,Dt as n,VT as o,jv as p,S1 as q,Jv as r,Poe as s,GT as t,yt as u,Nr as v,x5 as w,vt as x,JI as y};