@bkm016/basalt 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/{chunk-tgfbtehh.js → chunk-654cny9a.js} +82 -82
- package/{chunk-hksqjts3.js → chunk-sjjtxpg2.js} +174 -173
- package/compiled.js +1 -1
- package/package.json +1 -1
- package/ui-test-worker.js +1 -1
- package/web/{chunk-zsxw5fj7.js → chunk-079091ar.js} +1 -1
- package/web/{chunk-t74r2n8h.js → chunk-083r4f80.js} +1 -1
- package/web/{chunk-fp48zz2e.js → chunk-0cng7r2x.js} +1 -1
- package/web/chunk-0k0ande6.js +1 -0
- package/web/{chunk-ya3ghn3n.js → chunk-14deqqhr.js} +1 -1
- package/web/{chunk-5v44qv67.js → chunk-1s53190z.js} +2 -2
- package/web/{chunk-fx0n2g22.js → chunk-2b63adsj.js} +1 -1
- package/web/{chunk-cktmyc13.js → chunk-2cem4sv7.js} +2 -2
- package/web/{chunk-m2prjwk3.js → chunk-3baypnwn.js} +3 -3
- package/web/{chunk-m9bzz9m0.js → chunk-4067nwjp.js} +2 -2
- package/web/{chunk-96v2avmw.js → chunk-4fm55fgb.js} +1 -1
- package/web/{chunk-nyn9tghz.js → chunk-4q7wf0wd.js} +1 -1
- package/web/{chunk-ck8rr0sr.js → chunk-4sve9xrj.js} +1 -1
- package/web/{chunk-03dmzvaq.js → chunk-4vjnrz87.js} +1 -1
- package/web/{chunk-7hs57qdr.js → chunk-5k8sv4f5.js} +1 -1
- package/web/{chunk-cm92fyr3.js → chunk-5vjhvw1m.js} +1 -1
- package/web/{chunk-xc2sq3t5.js → chunk-5wbnjjhg.js} +1 -1
- package/web/chunk-6ft5pz3c.js +1 -0
- package/web/chunk-7c8rwqtx.js +1 -0
- package/web/chunk-7qzz025k.js +1 -0
- package/web/chunk-7xbaqqd7.css +1 -0
- package/web/chunk-80eyv2mk.js +1 -0
- package/web/{chunk-5wdk97mk.js → chunk-89paytbk.js} +1 -1
- package/web/chunk-8ceej2g7.js +1 -0
- package/web/chunk-8nyhy122.js +1 -0
- package/web/{chunk-718mr5gc.js → chunk-989jq2h8.js} +1 -1
- package/web/{chunk-fxs4nb93.js → chunk-aangfjqc.js} +1 -1
- package/web/{chunk-prvh9syp.js → chunk-bdydzbqk.js} +1 -1
- package/web/{chunk-2wqxhqr9.js → chunk-cpwtt6ny.js} +1 -1
- package/web/{chunk-9c1yt2ex.js → chunk-czjk218p.js} +1 -1
- package/web/{chunk-dwajwrpk.js → chunk-dg3p8db5.js} +1 -1
- package/web/chunk-dsw5t58p.js +1 -0
- package/web/{chunk-bz2v64xe.js → chunk-dv72fat3.js} +1 -1
- package/web/{chunk-0fgaepwm.js → chunk-dvvs1jjq.js} +1 -1
- package/web/{chunk-cb2rxtq9.js → chunk-e131rg6p.js} +1 -1
- package/web/{chunk-s2920f21.js → chunk-e8yj05t1.js} +1 -1
- package/web/chunk-ekw54h1q.js +1 -0
- package/web/{chunk-d6tbw8br.js → chunk-femhej5w.js} +1 -1
- package/web/{chunk-a7gtb4kg.js → chunk-geh05ghh.js} +1 -1
- package/web/{chunk-x5s7zr5f.js → chunk-gksf7cek.js} +1 -1
- package/web/{chunk-ht1dzftc.js → chunk-ht4mx2dt.js} +1 -1
- package/web/chunk-hwsvhst3.js +1 -0
- package/web/{chunk-q9ekgjh6.js → chunk-k02b36g1.js} +1 -1
- package/web/{chunk-rf9dt6bg.js → chunk-kjacapzd.js} +1 -1
- package/web/{chunk-gsh80797.js → chunk-kkfrs7d1.js} +1 -1
- package/web/{chunk-7kp237t3.js → chunk-kkyn8yhj.js} +1 -1
- package/web/chunk-mh4rx5cf.js +1 -0
- package/web/{chunk-9an6wcnr.js → chunk-n448vaba.js} +1 -1
- package/web/{chunk-vw1pbv1x.js → chunk-n754s8xd.js} +1 -1
- package/web/chunk-n8j88qxy.js +1 -0
- package/web/{chunk-kyawkpv2.js → chunk-nfvqjzz5.js} +1 -1
- package/web/{chunk-4r1n98zx.js → chunk-nmpbsvwb.js} +2 -2
- package/web/chunk-nws1s56b.js +1 -0
- package/web/{chunk-3zebd9fq.js → chunk-p7126wwy.js} +2 -2
- package/web/chunk-phnqnhj9.js +1 -0
- package/web/{chunk-g81h1e6n.js → chunk-pjz30xcp.js} +1 -1
- package/web/{chunk-0gg00f86.js → chunk-q3jevm51.js} +1 -1
- package/web/{chunk-v4yqrx5y.js → chunk-q97hn4j5.js} +1 -1
- package/web/chunk-qg31p6cn.js +1 -0
- package/web/{chunk-2bmq1whf.js → chunk-qhm3cfq9.js} +1 -1
- package/web/chunk-qsd595b9.js +1 -0
- package/web/{chunk-f5txt81n.js → chunk-r7frwjqx.js} +1 -1
- package/web/{chunk-j6a4z530.js → chunk-rddft5ce.js} +83 -83
- package/web/{chunk-296hgy6k.js → chunk-rgbdf2m9.js} +1 -1
- package/web/{chunk-64rafq66.js → chunk-rsbkbg6x.js} +1 -1
- package/web/{chunk-b985y17w.js → chunk-s2bs5vxh.js} +1 -1
- package/web/{chunk-g6k9z8zt.js → chunk-sgwccs54.js} +1 -1
- package/web/{chunk-mqsyzzgt.js → chunk-sjh8gtm9.js} +1 -1
- package/web/{chunk-hy4m34qp.js → chunk-sn3tkwme.js} +1 -1
- package/web/{chunk-t851gdjh.js → chunk-svh4n157.js} +1 -1
- package/web/{chunk-kegv14sg.js → chunk-t3658ehb.js} +1 -1
- package/web/{chunk-jve1zc80.js → chunk-t6sq85s6.js} +1 -1
- package/web/{chunk-vf4vkcf9.js → chunk-t81p4wqc.js} +1 -1
- package/web/{chunk-d4z2rgpx.js → chunk-tewmsd7t.js} +1 -1
- package/web/chunk-tf57s7ry.js +1 -0
- package/web/{chunk-12xxh71x.js → chunk-tfn0rqg9.js} +1 -1
- package/web/{chunk-3de552rg.js → chunk-tmndcktk.js} +1 -1
- package/web/chunk-tqr80b5w.js +2 -0
- package/web/{chunk-xvcfp1zh.js → chunk-tz4twwmw.js} +1 -1
- package/web/{chunk-sc0ghp25.js → chunk-v282r683.js} +1 -1
- package/web/chunk-v4vjjtn7.js +1 -0
- package/web/chunk-vbwdwcdp.js +1 -0
- package/web/{chunk-vtxw9rmr.js → chunk-vjngfh0q.js} +1 -1
- package/web/{chunk-30zfw7zg.js → chunk-wbgkwxrc.js} +1 -1
- package/web/{chunk-nywdeb4m.js → chunk-wjbk50hn.js} +1 -1
- package/web/chunk-wjy848e2.js +1 -0
- package/web/{chunk-3nbzj48p.js → chunk-wqsczy57.js} +1 -1
- package/web/chunk-wvfmmw1v.js +8 -0
- package/web/chunk-x1jm4zsg.js +1 -0
- package/web/{chunk-n1jpg57t.js → chunk-xbpc6x9m.js} +1 -1
- package/web/{chunk-zp3qrrkb.js → chunk-xckxtfp8.js} +1 -1
- package/web/{chunk-6kkw9ptc.js → chunk-xmsb2g71.js} +1 -1
- package/web/{chunk-czq1yz51.js → chunk-y99ed8rd.js} +1 -1
- package/web/index.html +1 -1
- package/web/chunk-0pecj6d7.js +0 -1
- package/web/chunk-0wt1dgny.js +0 -1
- package/web/chunk-1ves7sq5.js +0 -1
- package/web/chunk-1yj79b48.js +0 -1
- package/web/chunk-39ng8zwx.css +0 -1
- package/web/chunk-86p42kym.js +0 -1
- package/web/chunk-8n79cqyd.js +0 -1
- package/web/chunk-cwtn2kdm.js +0 -1
- package/web/chunk-dpkyygej.js +0 -1
- package/web/chunk-et5ess72.js +0 -1
- package/web/chunk-ez8b6neq.js +0 -1
- package/web/chunk-fd1kqwe3.js +0 -1
- package/web/chunk-hs5x78fb.js +0 -1
- package/web/chunk-hyd5hzpa.js +0 -1
- package/web/chunk-hyt1nkaw.js +0 -1
- package/web/chunk-kw9emsqw.js +0 -1
- package/web/chunk-pxkhm40r.js +0 -2
- package/web/chunk-r3mj50zs.js +0 -1
- package/web/chunk-t9mvsgt9.js +0 -1
- package/web/chunk-x19v2sxv.js +0 -1
- package/web/chunk-y21zy3eh.js +0 -1
- package/web/chunk-yd74yxzt.js +0 -8
- package/web/chunk-z4ha8181.js +0 -1
- package/web/chunk-z8rarqe6.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e,a,D,b,O,C,S,E,T,A,R,L,l,p,M,ni,ue,oe,se,gt,ge,ye}from"./chunk-
|
|
1
|
+
import{e,a,D,b,O,C,S,E,T,A,R,L,l,p,M,ni,ue,oe,se,gt,ge,ye}from"./chunk-1s53190z.js";import{he}from"./chunk-r7frwjqx.js";import{le}from"./chunk-989jq2h8.js";function tt(t){if(console&&console.error)console.error(`Error: ${t}`)}function Tt(t){if(console&&console.warn)console.warn(`Warning: ${t}`)}function At(t){let s=new Date().getTime(),n=t();return{time:new Date().getTime()-s,value:n}}function St(t){function s(){}s.prototype=t;let n=new s;function i(){return typeof n.bar}return i(),i(),t;(0,eval)(t)}function Gr(t){if(Wr(t))return t.LABEL;else return t.name}function Wr(t){return typeof t.LABEL==="string"&&t.LABEL!==""}class Ne{get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){this._definition=t}accept(t){t.visit(this),this.definition.forEach((s)=>{s.accept(t)})}}class W extends Ne{constructor(t){super([]);this.idx=1,Object.assign(this,xe(t))}set definition(t){}get definition(){if(this.referencedRule!==void 0)return this.referencedRule.definition;return[]}accept(t){t.visit(this)}}class Te extends Ne{constructor(t){super(t.definition);this.orgText="",Object.assign(this,xe(t))}}class j extends Ne{constructor(t){super(t.definition);this.ignoreAmbiguities=!1,Object.assign(this,xe(t))}}class K extends Ne{constructor(t){super(t.definition);this.idx=1,Object.assign(this,xe(t))}}class Z extends Ne{constructor(t){super(t.definition);this.idx=1,Object.assign(this,xe(t))}}class Q extends Ne{constructor(t){super(t.definition);this.idx=1,Object.assign(this,xe(t))}}class G extends Ne{constructor(t){super(t.definition);this.idx=1,Object.assign(this,xe(t))}}class q extends Ne{constructor(t){super(t.definition);this.idx=1,Object.assign(this,xe(t))}}class J extends Ne{get definition(){return this._definition}set definition(t){this._definition=t}constructor(t){super(t.definition);this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,xe(t))}}class F{constructor(t){this.idx=1,Object.assign(this,xe(t))}accept(t){t.visit(this)}}function Wt(t){return t.map(st)}function st(t){function s(n){return n.map(st)}if(t instanceof W){let n={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};if(typeof t.label==="string")n.label=t.label;return n}else if(t instanceof j)return{type:"Alternative",definition:s(t.definition)};else if(t instanceof K)return{type:"Option",idx:t.idx,definition:s(t.definition)};else if(t instanceof Z)return{type:"RepetitionMandatory",idx:t.idx,definition:s(t.definition)};else if(t instanceof Q)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:st(new F({terminalType:t.separator})),definition:s(t.definition)};else if(t instanceof q)return{type:"RepetitionWithSeparator",idx:t.idx,separator:st(new F({terminalType:t.separator})),definition:s(t.definition)};else if(t instanceof G)return{type:"Repetition",idx:t.idx,definition:s(t.definition)};else if(t instanceof J)return{type:"Alternation",idx:t.idx,definition:s(t.definition)};else if(t instanceof F){let n={type:"Terminal",name:t.terminalType.name,label:Gr(t.terminalType),idx:t.idx};if(typeof t.label==="string")n.terminalLabel=t.label;let i=t.terminalType.PATTERN;if(t.terminalType.PATTERN)n.pattern=i instanceof RegExp?i.source:i;return n}else if(t instanceof Te)return{type:"Rule",name:t.name,orgText:t.orgText,definition:s(t.definition)};else throw Error("non exhaustive match")}function xe(t){return Object.fromEntries(Object.entries(t).filter(([,s])=>s!==void 0))}class Ae{visit(t){let s=t;switch(s.constructor){case W:return this.visitNonTerminal(s);case j:return this.visitAlternative(s);case K:return this.visitOption(s);case Z:return this.visitRepetitionMandatory(s);case Q:return this.visitRepetitionMandatoryWithSeparator(s);case q:return this.visitRepetitionWithSeparator(s);case G:return this.visitRepetition(s);case J:return this.visitAlternation(s);case F:return this.visitTerminal(s);case Te:return this.visitRule(s);default:throw Error("non exhaustive match")}}visitNonTerminal(t){}visitAlternative(t){}visitOption(t){}visitRepetition(t){}visitRepetitionMandatory(t){}visitRepetitionMandatoryWithSeparator(t){}visitRepetitionWithSeparator(t){}visitAlternation(t){}visitTerminal(t){}visitRule(t){}}function vs(t){return t instanceof j||t instanceof K||t instanceof G||t instanceof Z||t instanceof Q||t instanceof q||t instanceof F||t instanceof Te}function je(t,s=[]){if(t instanceof K||t instanceof G||t instanceof q)return!0;if(t instanceof J)return t.definition.some((i)=>je(i,s));else if(t instanceof W&&s.includes(t))return!1;else if(t instanceof Ne){if(t instanceof W)s.push(t);return t.definition.every((i)=>je(i,s))}else return!1}function Ms(t){return t instanceof J}function Se(t){if(t instanceof W)return"SUBRULE";else if(t instanceof K)return"OPTION";else if(t instanceof J)return"OR";else if(t instanceof Z)return"AT_LEAST_ONE";else if(t instanceof Q)return"AT_LEAST_ONE_SEP";else if(t instanceof q)return"MANY_SEP";else if(t instanceof G)return"MANY";else if(t instanceof F)return"CONSUME";else throw Error("non exhaustive match")}class $e{walk(t,s=[]){t.definition.forEach((n,i)=>{let r=t.definition.slice(i+1);if(n instanceof W)this.walkProdRef(n,r,s);else if(n instanceof F)this.walkTerminal(n,r,s);else if(n instanceof j)this.walkFlat(n,r,s);else if(n instanceof K)this.walkOption(n,r,s);else if(n instanceof Z)this.walkAtLeastOne(n,r,s);else if(n instanceof Q)this.walkAtLeastOneSep(n,r,s);else if(n instanceof q)this.walkManySep(n,r,s);else if(n instanceof G)this.walkMany(n,r,s);else if(n instanceof J)this.walkOr(n,r,s);else throw Error("non exhaustive match")})}walkTerminal(t,s,n){}walkProdRef(t,s,n){}walkFlat(t,s,n){let i=s.concat(n);this.walk(t,i)}walkOption(t,s,n){let i=s.concat(n);this.walk(t,i)}walkAtLeastOne(t,s,n){let i=[new K({definition:t.definition})].concat(s,n);this.walk(t,i)}walkAtLeastOneSep(t,s,n){let i=Nn(t,s,n);this.walk(t,i)}walkMany(t,s,n){let i=[new K({definition:t.definition})].concat(s,n);this.walk(t,i)}walkManySep(t,s,n){let i=Nn(t,s,n);this.walk(t,i)}walkOr(t,s,n){let i=s.concat(n);t.definition.forEach((r)=>{let o=new j({definition:[r]});this.walk(o,i)})}}function Nn(t,s,n){return[new K({definition:[new F({terminalType:t.separator})].concat(t.definition)})].concat(s,n)}function Ke(t){if(t instanceof W)return Ke(t.referencedRule);else if(t instanceof F)return Vr(t);else if(vs(t))return jr(t);else if(Ms(t))return Kr(t);else throw Error("non exhaustive match")}function jr(t){let s=[],n=t.definition,i=0,r=n.length>i,o,h=!0;while(r&&h)o=n[i],h=je(o),s=s.concat(Ke(o)),i=i+1,r=n.length>i;return[...new Set(s)]}function Kr(t){let s=t.definition.map((n)=>Ke(n));return[...new Set(s.flat())]}function Vr(t){return[t.terminalType]}var jt="_~IN~_";class In extends $e{constructor(t){super();this.topProd=t,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(t,s,n){}walkProdRef(t,s,n){let i=zr(t.referencedRule,t.idx)+this.topProd.name,r=s.concat(n),o=new j({definition:r}),h=Ke(o);this.follows[i]=h}}function kn(t){let s={};return t.forEach((n)=>{let i=new In(n).startWalking();Object.assign(s,i)}),s}function zr(t,s){return t.name+s+jt}function x(t){return t.charCodeAt(0)}function Kt(t,s){if(Array.isArray(t))t.forEach(function(n){s.push(n)});else s.push(t)}function nt(t,s){if(t[s]===!0)throw"duplicate flag "+s;let n=t[s];t[s]=!0}function Ve(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function Rt(){throw Error("Internal Error - Should never get here!")}function ws(t){return t.type==="Character"}var yt=[];for(let t=x("0");t<=x("9");t++)yt.push(t);var Ot=[x("_")].concat(yt);for(let t=x("a");t<=x("z");t++)Ot.push(t);for(let t=x("A");t<=x("Z");t++)Ot.push(t);var Us=[x(" "),x("\f"),x(`
|
|
2
2
|
`),x("\r"),x("\t"),x("\v"),x("\t"),x(" "),x(" "),x(" "),x(" "),x(" "),x(" "),x(" "),x(" "),x(" "),x(" "),x(" "),x(" "),x(" "),x("\u2028"),x("\u2029"),x(" "),x(" "),x(" "),x("\uFEFF")];var Hr=/[0-9a-fA-F]/,Vt=/[0-9]/,Xr=/[1-9]/;class zt{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(t){this.idx=t.idx,this.input=t.input,this.groupIdx=t.groupIdx}pattern(t){this.idx=0,this.input=t,this.groupIdx=0,this.consumeChar("/");let s=this.disjunction();this.consumeChar("/");let n={type:"Flags",loc:{begin:this.idx,end:t.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};while(this.isRegExpFlag())switch(this.popChar()){case"g":nt(n,"global");break;case"i":nt(n,"ignoreCase");break;case"m":nt(n,"multiLine");break;case"u":nt(n,"unicode");break;case"y":nt(n,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:s,loc:this.loc(0)}}disjunction(){let t=[],s=this.idx;t.push(this.alternative());while(this.peekChar()==="|")this.consumeChar("|"),t.push(this.alternative());return{type:"Disjunction",value:t,loc:this.loc(s)}}alternative(){let t=[],s=this.idx;while(this.isTerm())t.push(this.term());return{type:"Alternative",value:t,loc:this.loc(s)}}term(){if(this.isAssertion())return this.assertion();else return this.atom()}assertion(){let t=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(t)};case"$":return{type:"EndAnchor",loc:this.loc(t)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(t)};case"B":return{type:"NonWordBoundary",loc:this.loc(t)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let s;switch(this.popChar()){case"=":s="Lookahead";break;case"!":s="NegativeLookahead";break;case"<":{switch(this.popChar()){case"=":s="Lookbehind";break;case"!":s="NegativeLookbehind"}break}}Ve(s);let n=this.disjunction();return this.consumeChar(")"),{type:s,value:n,loc:this.loc(t)}}return Rt()}quantifier(t=!1){let s=void 0,n=this.idx;switch(this.popChar()){case"*":s={atLeast:0,atMost:1/0};break;case"+":s={atLeast:1,atMost:1/0};break;case"?":s={atLeast:0,atMost:1};break;case"{":let i=this.integerIncludingZero();switch(this.popChar()){case"}":s={atLeast:i,atMost:i};break;case",":let r;if(this.isDigit())r=this.integerIncludingZero(),s={atLeast:i,atMost:r};else s={atLeast:i,atMost:1/0};this.consumeChar("}");break}if(t===!0&&s===void 0)return;Ve(s);break}if(t===!0&&s===void 0)return;if(Ve(s)){if(this.peekChar(0)==="?")this.consumeChar("?"),s.greedy=!1;else s.greedy=!0;return s.type="Quantifier",s.loc=this.loc(n),s}}atom(){let t,s=this.idx;switch(this.peekChar()){case".":t=this.dotAll();break;case"\\":t=this.atomEscape();break;case"[":t=this.characterClass();break;case"(":t=this.group();break}if(t===void 0&&this.isPatternCharacter())t=this.patternCharacter();if(Ve(t)){if(t.loc=this.loc(s),this.isQuantifier())t.quantifier=this.quantifier();return t}return Rt()}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[x(`
|
|
3
3
|
`),x("\r"),x("\u2028"),x("\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 t,s=!1;switch(this.popChar()){case"d":t=yt;break;case"D":t=yt,s=!0;break;case"s":t=Us;break;case"S":t=Us,s=!0;break;case"w":t=Ot;break;case"W":t=Ot,s=!0;break}if(Ve(t))return{type:"Set",value:t,complement:s};return Rt()}controlEscapeAtom(){let t;switch(this.popChar()){case"f":t=x("\f");break;case"n":t=x(`
|
|
4
4
|
`);break;case"r":t=x("\r");break;case"t":t=x("\t");break;case"v":t=x("\v");break}if(Ve(t))return{type:"Character",value:t};return Rt()}controlLetterEscapeAtom(){this.consumeChar("c");let t=this.popChar();if(/[a-zA-Z]/.test(t)===!1)throw Error("Invalid ");return{type:"Character",value:t.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:x("\x00")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){let t=this.popChar();return{type:"Character",value:x(t)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{G}from"./chunk-
|
|
1
|
+
import{G}from"./chunk-14deqqhr.js";import{e,a,ke,b,B,C,S,E,T,A,R,L,l,V,U}from"./chunk-1s53190z.js";import{X}from"./chunk-2cem4sv7.js";var ot=e((r,i)=>{let n=r<=1?r*100:r;if(n<0||n>100)throw Error(`${i} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${r}`);return n},"toPercent"),j=e((r,i,n)=>({x:ot(i,`${n} evolution`),y:ot(r,`${n} visibility`)}),"toCoordinates"),pt=e((r)=>{if(!r)return;if(r==="+<>")return"bidirectional";if(r==="+<")return"backward";if(r==="+>")return"forward";return},"getFlowFromPort"),Bt=e((r)=>{if(!r?.startsWith("+"))return{};let n=/^\+'([^']*)'/.exec(r)?.[1];if(r.includes("<>"))return{flow:"bidirectional",label:n};if(r.includes("<"))return{flow:"backward",label:n};if(r.includes(">"))return{flow:"forward",label:n};return{label:n}},"extractFlowFromArrow"),Ft=e((r,i)=>{if(G(r,i),r.size)i.setSize(r.size.width,r.size.height);if(r.evolution){let n=r.evolution.stages.map((o)=>{if(o.secondName)return`${o.name.trim()} / ${o.secondName.trim()}`;return o.name.trim()}),y=r.evolution.stages.filter((o)=>o.boundary!==void 0).map((o)=>o.boundary);i.updateAxes({stages:n,stageBoundaries:y})}if(r.anchors.forEach((n)=>{let y=j(n.visibility,n.evolution,`Anchor "${n.name}"`);i.addNode(n.name,n.name,y.x,y.y,"anchor")}),r.components.forEach((n)=>{let y=j(n.visibility,n.evolution,`Component "${n.name}"`),o=n.label?(n.label.negX?-1:1)*n.label.offsetX:void 0,p=n.label?(n.label.negY?-1:1)*n.label.offsetY:void 0,k=n.decorator?.strategy;i.addNode(n.name,n.name,y.x,y.y,"component",o,p,n.inertia,k)}),r.notes.forEach((n)=>{let y=j(n.visibility,n.evolution,`Note "${n.text}"`);i.addNote(n.text,y.x,y.y)}),r.pipelines.forEach((n)=>{let y=i.getNode(n.parent);if(!y||typeof y.y!=="number")throw Error(`Pipeline "${n.parent}" must reference an existing component with coordinates.`);let o=y.y;i.startPipeline(n.parent),n.components.forEach((p)=>{let k=`${n.parent}_${p.name}`,H=p.label?(p.label.negX?-1:1)*p.label.offsetX:void 0,w=p.label?(p.label.negY?-1:1)*p.label.offsetY:void 0,tt=ot(p.evolution,`Pipeline component "${p.name}" evolution`);i.addNode(k,p.name,tt,o,"pipeline-component",H,w),i.addPipelineComponent(n.parent,k)})}),r.links.forEach((n)=>{let y=!!n.arrow&&(n.arrow.includes("-.->")||n.arrow.includes(".-.")),o=pt(n.fromPort)??pt(n.toPort),{flow:p,label:k}=Bt(n.arrow);if(!o&&p)o=p;let H=n.linkLabel,w=k??H;i.addLink(i.resolveNodeId(n.from),i.resolveNodeId(n.to),y,w,o)}),r.evolves.forEach((n)=>{let y=i.getNode(n.component);if(y?.y!==void 0){let o=ot(n.target,`Evolve target for "${n.component}"`);i.addTrend(n.component,o,y.y)}}),r.annotations.length>0){let n=r.annotations[0],y=j(n.x,n.y,"Annotations box");i.setAnnotationsBox(y.x,y.y)}r.annotation.forEach((n)=>{let y=j(n.x,n.y,`Annotation ${n.number}`);i.addAnnotation(n.number,[{x:y.x,y:y.y}],n.text)}),r.accelerators.forEach((n)=>{let y=j(n.x,n.y,`Accelerator "${n.name}"`);i.addAccelerator(n.name,y.x,y.y)}),r.deaccelerators.forEach((n)=>{let y=j(n.x,n.y,`Deaccelerator "${n.name}"`);i.addDeaccelerator(n.name,y.x,y.y)})},"populateDb"),ht={parser:{yy:void 0},parse:e(async(r)=>{let i=await X("wardley",r);a.debug(i);let n=ht.parser?.yy;if(!n||typeof n.addNode!=="function")throw Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Ft(i,n)},"parse")},Rt=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}static{e(this,"WardleyBuilder")}addNode(r){let i=this.nodes.get(r.id)??{id:r.id,label:r.label},n={...i,...r,className:r.className??i.className,labelOffsetX:r.labelOffsetX??i.labelOffsetX,labelOffsetY:r.labelOffsetY??i.labelOffsetY};this.nodes.set(r.id,n)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});let i=this.nodes.get(r);if(i)i.isPipelineParent=!0}addPipelineComponent(r,i){let n=this.pipelines.get(r);if(n)n.componentIds.push(i);let y=this.nodes.get(i);if(y)y.inPipeline=!0}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,i){this.annotationsBox={x:r,y:i}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,i){this.size={width:r,height:i}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(let[i,n]of this.nodes)if(n.label===r)return i;return r}build(){let r=[];for(let i of this.nodes.values()){if(typeof i.x!=="number"||typeof i.y!=="number")throw Error(`Node "${i.label}" is missing coordinates`);r.push(i)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},P=new Rt;function ft(){return l()["wardley-beta"]}e(ft,"getConfig");function xt(r,i,n,y,o,p,k,H,w){P.addNode({id:r,label:i,x:n,y,className:o,labelOffsetX:p,labelOffsetY:k,inertia:H,sourceStrategy:w})}e(xt,"addNode");function gt(r,i,n=!1,y,o){P.addLink({source:r,target:i,dashed:n,label:y,flow:o})}e(gt,"addLink");function yt(r,i,n){P.addTrend({nodeId:r,targetX:i,targetY:n})}e(yt,"addTrend");function ut(r,i,n){P.addAnnotation({number:r,coordinates:i,text:n})}e(ut,"addAnnotation");function wt(r,i,n){P.addNote({text:r,x:i,y:n})}e(wt,"addNote");function mt(r,i,n){P.addAccelerator({name:r,x:i,y:n})}e(mt,"addAccelerator");function kt(r,i,n){P.addDeaccelerator({name:r,x:i,y:n})}e(kt,"addDeaccelerator");function bt(r,i){P.setAnnotationsBox(r,i)}e(bt,"setAnnotationsBox");function $t(r,i){P.setSize(r,i)}e($t,"setSize");function vt(r){P.startPipeline(r)}e(vt,"startPipeline");function Pt(r,i){P.addPipelineComponent(r,i)}e(Pt,"addPipelineComponent");function Ct(r){P.setAxes(r)}e(Ct,"updateAxes");function St(r){return P.getNode(r)}e(St,"getNode");function Mt(r){return P.resolveNodeId(r)}e(Mt,"resolveNodeId");function Nt(){return P.build()}e(Nt,"getWardleyData");function zt(){P.clear(),C()}e(zt,"clear");var Ot={getConfig:ft,addNode:xt,addLink:gt,addTrend:yt,addAnnotation:ut,addNote:wt,addAccelerator:mt,addDeaccelerator:kt,setAnnotationsBox:bt,setSize:$t,startPipeline:vt,addPipelineComponent:Pt,updateAxes:Ct,getNode:St,resolveNodeId:Mt,getWardleyData:Nt,clear:zt,setAccTitle:S,getAccTitle:E,setDiagramTitle:R,getDiagramTitle:L,getAccDescription:A,setAccDescription:T},Dt=["Genesis","Custom Built","Product","Commodity"],Gt=e(()=>{let{themeVariables:r}=l();return{backgroundColor:r.wardley?.backgroundColor??r.background??"#fff",axisColor:r.wardley?.axisColor??"#000",axisTextColor:r.wardley?.axisTextColor??r.primaryTextColor??"#222",gridColor:r.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:r.wardley?.componentFill??"#fff",componentStroke:r.wardley?.componentStroke??"#000",componentLabelColor:r.wardley?.componentLabelColor??r.primaryTextColor??"#222",linkStroke:r.wardley?.linkStroke??"#000",evolutionStroke:r.wardley?.evolutionStroke??"#dc3545",annotationStroke:r.wardley?.annotationStroke??"#000",annotationTextColor:r.wardley?.annotationTextColor??r.primaryTextColor??"#222",annotationFill:r.wardley?.annotationFill??r.background??"#fff"}},"getTheme"),qt=e(()=>{let r=l()["wardley-beta"];return{width:r?.width??900,height:r?.height??600,padding:r?.padding??48,nodeRadius:r?.nodeRadius??6,nodeLabelOffset:r?.nodeLabelOffset??8,axisFontSize:r?.axisFontSize??12,labelFontSize:r?.labelFontSize??10,showGrid:r?.showGrid??!1,useMaxWidth:r?.useMaxWidth??!0}},"getConfigValues"),jt=e((r,i,n,y)=>{a.debug(`Rendering Wardley map
|
|
2
2
|
`+r);let o=qt(),p=Gt(),k=o.nodeRadius*1.6,H=y.db,w=H.getWardleyData(),tt=H.getDiagramTitle(),Y=w.size?.width??o.width,M=w.size?.height??o.height,Z=V(i);Z.selectAll("*").remove(),B(Z,M,Y,o.useMaxWidth),Z.attr("viewBox",`0 0 ${Y} ${M}`);let z=Z.append("g").attr("class","wardley-map"),nt=Z.append("defs");nt.append("marker").attr("id",`arrow-${i}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",p.evolutionStroke).attr("stroke","none"),nt.append("marker").attr("id",`link-arrow-end-${i}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",p.linkStroke).attr("stroke","none"),nt.append("marker").attr("id",`link-arrow-start-${i}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",p.linkStroke).attr("stroke","none"),z.append("rect").attr("class","wardley-background").attr("width",Y).attr("height",M).attr("fill",p.backgroundColor);let J=Y-o.padding*2,K=M-o.padding*2;if(tt)z.append("text").attr("class","wardley-title").attr("x",Y/2).attr("y",o.padding/2).attr("fill",p.axisTextColor).attr("font-size",o.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(tt);let O=e((t)=>o.padding+t/100*J,"projectX"),D=e((t)=>M-o.padding-t/100*K,"projectY"),et=z.append("g").attr("class","wardley-axes");et.append("line").attr("x1",o.padding).attr("x2",Y-o.padding).attr("y1",M-o.padding).attr("y2",M-o.padding).attr("stroke",p.axisColor).attr("stroke-width",1),et.append("line").attr("x1",o.padding).attr("x2",o.padding).attr("y1",o.padding).attr("y2",M-o.padding).attr("stroke",p.axisColor).attr("stroke-width",1);let Lt=w.axes.xLabel??"Evolution",Tt=w.axes.yLabel??"Visibility";et.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",o.padding+J/2).attr("y",M-o.padding/4).attr("fill",p.axisTextColor).attr("font-size",o.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(Lt),et.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",o.padding/3).attr("y",o.padding+K/2).attr("fill",p.axisTextColor).attr("font-size",o.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${o.padding/3} ${o.padding+K/2})`).text(Tt);let Q=w.axes.stages&&w.axes.stages.length>0?w.axes.stages:Dt;if(Q.length>0){let t=z.append("g").attr("class","wardley-stages"),d=w.axes.stageBoundaries,s=[];if(d&&d.length===Q.length){let c=0;d.forEach((f)=>{s.push({start:c,end:f}),c=f})}else{let c=1/Q.length;Q.forEach((f,x)=>{s.push({start:x*c,end:(x+1)*c})})}Q.forEach((c,f)=>{let x=s[f],u=o.padding+x.start*J,g=o.padding+x.end*J,m=(u+g)/2;if(f>0)t.append("line").attr("x1",u).attr("x2",u).attr("y1",o.padding).attr("y2",M-o.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",0.8);t.append("text").attr("class","wardley-stage-label").attr("x",m).attr("y",M-o.padding/1.5).attr("fill",p.axisTextColor).attr("font-size",o.axisFontSize-2).attr("text-anchor","middle").text(c)})}if(o.showGrid){let t=z.append("g").attr("class","wardley-grid");for(let d=1;d<4;d++){let s=d/4,c=o.padding+J*s;t.append("line").attr("x1",c).attr("x2",c).attr("y1",o.padding).attr("y2",M-o.padding).attr("stroke",p.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",o.padding).attr("x2",Y-o.padding).attr("y1",M-o.padding-K*s).attr("y2",M-o.padding-K*s).attr("stroke",p.gridColor).attr("stroke-dasharray","2 6")}}let h=new Map;if(w.nodes.forEach((t)=>{h.set(t.id,{x:O(t.x),y:D(t.y),node:t})}),w.pipelines.length>0){let t=z.append("g").attr("class","wardley-pipelines"),d=z.append("g").attr("class","wardley-pipeline-links");w.pipelines.forEach((s)=>{if(s.componentIds.length===0)return;let c=s.componentIds.map((g)=>({id:g,pos:h.get(g),node:w.nodes.find((m)=>m.id===g)})).filter((g)=>g.pos&&g.node).sort((g,m)=>g.node.x-m.node.x);for(let g=0;g<c.length-1;g++){let m=c[g],v=c[g+1];d.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",m.pos.x).attr("y1",m.pos.y).attr("x2",v.pos.x).attr("y2",v.pos.y).attr("stroke",p.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let f=1/0,x=-1/0,u=0;if(s.componentIds.forEach((g)=>{let m=h.get(g);if(m)f=Math.min(f,m.x),x=Math.max(x,m.x),u=m.y}),f!==1/0&&x!==-1/0){let m=o.nodeRadius*4,v=u-m/2,W=h.get(s.nodeId);if(W){let F=(f+x)/2;W.x=F,W.y=v-k/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",f-15).attr("y",v).attr("width",x-f+30).attr("height",m).attr("fill","none").attr("stroke",p.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}let dt=z.append("g").attr("class","wardley-links"),lt=new Map;w.pipelines.forEach((t)=>{lt.set(t.nodeId,new Set(t.componentIds))});let ct=w.links.filter((t)=>{if(!h.has(t.source)||!h.has(t.target))return!1;if(lt.get(t.target)?.has(t.source))return!1;return!0});dt.selectAll("line").data(ct).enter().append("line").attr("class",(t)=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",(t)=>{let d=h.get(t.source),s=h.get(t.target),f=w.nodes.find((m)=>m.id===t.source).isPipelineParent?k/Math.sqrt(2):o.nodeRadius,x=s.x-d.x,u=s.y-d.y,g=Math.sqrt(x*x+u*u);return d.x+x/g*f}).attr("y1",(t)=>{let d=h.get(t.source),s=h.get(t.target),f=w.nodes.find((m)=>m.id===t.source).isPipelineParent?k/Math.sqrt(2):o.nodeRadius,x=s.x-d.x,u=s.y-d.y,g=Math.sqrt(x*x+u*u);return d.y+u/g*f}).attr("x2",(t)=>{let d=h.get(t.source),s=h.get(t.target),f=w.nodes.find((m)=>m.id===t.target).isPipelineParent?k/Math.sqrt(2):o.nodeRadius,x=d.x-s.x,u=d.y-s.y,g=Math.sqrt(x*x+u*u);return s.x+x/g*f}).attr("y2",(t)=>{let d=h.get(t.source),s=h.get(t.target),f=w.nodes.find((m)=>m.id===t.target).isPipelineParent?k/Math.sqrt(2):o.nodeRadius,x=d.x-s.x,u=d.y-s.y,g=Math.sqrt(x*x+u*u);return s.y+u/g*f}).attr("stroke",p.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",(t)=>t.dashed?"6 6":null).attr("marker-end",(t)=>{if(t.flow==="forward"||t.flow==="bidirectional")return`url(#link-arrow-end-${i})`;return null}).attr("marker-start",(t)=>{if(t.flow==="backward"||t.flow==="bidirectional")return`url(#link-arrow-start-${i})`;return null}),dt.selectAll("text").data(ct.filter((t)=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",(t)=>{let d=h.get(t.source),s=h.get(t.target),c=(d.x+s.x)/2,f=s.y-d.y,x=s.x-d.x,u=Math.sqrt(x*x+f*f),g=8,m=f/u;return c+m*8}).attr("y",(t)=>{let d=h.get(t.source),s=h.get(t.target),c=(d.y+s.y)/2,f=s.x-d.x,x=s.y-d.y,u=Math.sqrt(f*f+x*x),g=8,m=-f/u;return c+m*8}).attr("fill",p.axisTextColor).attr("font-size",o.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",(t)=>{let d=h.get(t.source),s=h.get(t.target),c=(d.x+s.x)/2,f=(d.y+s.y)/2,x=s.x-d.x,u=s.y-d.y,g=Math.sqrt(x*x+u*u),m=8,v=u/g,W=-x/g,F=c+v*8,at=f+W*8,_=Math.atan2(u,x)*180/Math.PI;if(_>90||_<-90)_+=180;return`rotate(${_} ${F} ${at})`}).text((t)=>t.label);let Wt=z.append("g").attr("class","wardley-trends"),At=w.trends.map((t)=>{let d=h.get(t.nodeId);if(!d)return null;let s=O(t.targetX),c=D(t.targetY),f=s-d.x,x=c-d.y,u=Math.sqrt(f*f+x*x),g=o.nodeRadius+2,m=u>g?s-f/u*g:s,v=u>g?c-x/u*g:c;return{origin:d,targetX:s,targetY:c,adjustedX2:m,adjustedY2:v}}).filter((t)=>t!==null);Wt.selectAll("line").data(At).enter().append("line").attr("class","wardley-trend").attr("x1",(t)=>t.origin.x).attr("y1",(t)=>t.origin.y).attr("x2",(t)=>t.adjustedX2).attr("y2",(t)=>t.adjustedY2).attr("stroke",p.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${i})`);let I=z.append("g").attr("class","wardley-nodes").selectAll("g").data(w.nodes).enter().append("g").attr("class",(t)=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));I.filter((t)=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",(t)=>h.get(t.id).x).attr("cy",(t)=>h.get(t.id).y).attr("r",o.nodeRadius*2).attr("fill","#666").attr("stroke",p.componentStroke).attr("stroke-width",1),I.filter((t)=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",(t)=>h.get(t.id).x).attr("cy",(t)=>h.get(t.id).y).attr("r",o.nodeRadius*2).attr("fill","#ccc").attr("stroke",p.componentStroke).attr("stroke-width",1),I.filter((t)=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",(t)=>h.get(t.id).x).attr("cy",(t)=>h.get(t.id).y).attr("r",o.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);let q=I.filter((t)=>t.sourceStrategy==="market");q.append("circle").attr("class","wardley-market-overlay").attr("cx",(t)=>h.get(t.id).x).attr("cy",(t)=>h.get(t.id).y).attr("r",o.nodeRadius*2).attr("fill","white").attr("stroke",p.componentStroke).attr("stroke-width",1),I.filter((t)=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",(t)=>h.get(t.id).x).attr("cy",(t)=>h.get(t.id).y).attr("r",o.nodeRadius).attr("fill",p.componentFill).attr("stroke",p.componentStroke).attr("stroke-width",1);let st=o.nodeRadius*0.7,N=o.nodeRadius*1.2;if(q.append("line").attr("class","wardley-market-line").attr("x1",(t)=>h.get(t.id).x).attr("y1",(t)=>h.get(t.id).y-N).attr("x2",(t)=>h.get(t.id).x-N*Math.cos(Math.PI/6)).attr("y2",(t)=>h.get(t.id).y+N*Math.sin(Math.PI/6)).attr("stroke",p.componentStroke).attr("stroke-width",1),q.append("line").attr("class","wardley-market-line").attr("x1",(t)=>h.get(t.id).x-N*Math.cos(Math.PI/6)).attr("y1",(t)=>h.get(t.id).y+N*Math.sin(Math.PI/6)).attr("x2",(t)=>h.get(t.id).x+N*Math.cos(Math.PI/6)).attr("y2",(t)=>h.get(t.id).y+N*Math.sin(Math.PI/6)).attr("stroke",p.componentStroke).attr("stroke-width",1),q.append("line").attr("class","wardley-market-line").attr("x1",(t)=>h.get(t.id).x+N*Math.cos(Math.PI/6)).attr("y1",(t)=>h.get(t.id).y+N*Math.sin(Math.PI/6)).attr("x2",(t)=>h.get(t.id).x).attr("y2",(t)=>h.get(t.id).y-N).attr("stroke",p.componentStroke).attr("stroke-width",1),q.append("circle").attr("class","wardley-market-dot").attr("cx",(t)=>h.get(t.id).x).attr("cy",(t)=>h.get(t.id).y-N).attr("r",st).attr("fill","white").attr("stroke",p.componentStroke).attr("stroke-width",2),q.append("circle").attr("class","wardley-market-dot").attr("cx",(t)=>h.get(t.id).x-N*Math.cos(Math.PI/6)).attr("cy",(t)=>h.get(t.id).y+N*Math.sin(Math.PI/6)).attr("r",st).attr("fill","white").attr("stroke",p.componentStroke).attr("stroke-width",2),q.append("circle").attr("class","wardley-market-dot").attr("cx",(t)=>h.get(t.id).x+N*Math.cos(Math.PI/6)).attr("cy",(t)=>h.get(t.id).y+N*Math.sin(Math.PI/6)).attr("r",st).attr("fill","white").attr("stroke",p.componentStroke).attr("stroke-width",2),I.filter((t)=>t.isPipelineParent===!0).append("rect").attr("x",(t)=>h.get(t.id).x-k/2).attr("y",(t)=>h.get(t.id).y-k/2).attr("width",k).attr("height",k).attr("fill",p.componentFill).attr("stroke",p.componentStroke).attr("stroke-width",1),I.filter((t)=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",(t)=>{let d=h.get(t.id),s=t.isPipelineParent?k/2+15:o.nodeRadius+15;if(t.sourceStrategy)s+=o.nodeRadius+10;return d.x+s}).attr("y1",(t)=>{let d=h.get(t.id),s=t.isPipelineParent?k:o.nodeRadius*2;return d.y-s/2}).attr("x2",(t)=>{let d=h.get(t.id),s=t.isPipelineParent?k/2+15:o.nodeRadius+15;if(t.sourceStrategy)s+=o.nodeRadius+10;return d.x+s}).attr("y2",(t)=>{let d=h.get(t.id),s=t.isPipelineParent?k:o.nodeRadius*2;return d.y+s/2}).attr("stroke",p.componentStroke).attr("stroke-width",6),I.append("text").attr("x",(t)=>{let d=h.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?d.x+t.labelOffsetX:d.x;let s=o.nodeLabelOffset;if(t.sourceStrategy&&t.labelOffsetX===void 0)s+=10;let c=t.labelOffsetX??s;return d.x+c}).attr("y",(t)=>{let d=h.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?d.y+t.labelOffsetY:d.y-3;let s=-o.nodeLabelOffset;if(t.sourceStrategy&&t.labelOffsetY===void 0)s-=10;let c=t.labelOffsetY??s;return d.y+c}).attr("class","wardley-node-label").attr("fill",(t)=>{if(t.className==="evolved")return p.evolutionStroke;if(t.className==="anchor")return"#000";return p.componentLabelColor}).attr("font-size",o.labelFontSize).attr("font-weight",(t)=>t.className==="anchor"?"bold":"normal").attr("text-anchor",(t)=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",(t)=>t.className==="anchor"?"middle":"auto").text((t)=>t.label),w.annotations.length>0){let t=z.append("g").attr("class","wardley-annotations");if(w.annotations.forEach((d)=>{let s=d.coordinates.map((c)=>({x:O(c.x),y:D(c.y)}));if(s.length>1)for(let c=0;c<s.length-1;c++)t.append("line").attr("class","wardley-annotation-line").attr("x1",s[c].x).attr("y1",s[c].y).attr("x2",s[c+1].x).attr("y2",s[c+1].y).attr("stroke",p.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");s.forEach((c)=>{let f=t.append("g").attr("class","wardley-annotation");f.append("circle").attr("cx",c.x).attr("cy",c.y).attr("r",10).attr("fill","white").attr("stroke",p.axisColor).attr("stroke-width",1.5),f.append("text").attr("x",c.x).attr("y",c.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",p.axisTextColor).attr("font-weight","bold").text(d.number)})}),w.annotationsBox){let d=O(w.annotationsBox.x),s=D(w.annotationsBox.y),c=10,f=16,x=11,u=t.append("g").attr("class","wardley-annotations-box"),g=[...w.annotations].filter((v)=>v.text).sort((v,W)=>v.number-W.number),m=[];if(g.forEach((v,W)=>{let F=u.append("text").attr("x",d+c).attr("y",s+c+(W+1)*f).attr("font-size",x).attr("fill",p.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${v.number}. ${v.text}`);m.push(F)}),m.length>0){let v=0,W=0;m.forEach((it)=>{let rt=it.node(),Yt=rt.getComputedTextLength();v=Math.max(v,Yt);let It=rt.getBBox();W=Math.max(W,It.height)});let F=v+c*2+105,at=g.length*f+c*2+W/2,_=o.padding,Xt=Y-o.padding-F,Et=o.padding,Ht=M-o.padding-at;d=Math.max(_,Math.min(d,Xt)),s=Math.max(Et,Math.min(s,Ht)),m.forEach((it,rt)=>{it.attr("x",d+c).attr("y",s+c+(rt+1)*f)}),u.insert("rect","text").attr("x",d).attr("y",s).attr("width",F).attr("height",at).attr("fill","white").attr("stroke",p.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(w.notes.length>0){let t=z.append("g").attr("class","wardley-notes");w.notes.forEach((d)=>{let s=O(d.x),c=D(d.y);t.append("text").attr("x",s).attr("y",c).attr("text-anchor","start").attr("font-size",11).attr("fill",p.axisTextColor).attr("font-weight","bold").text(d.text)})}if(w.accelerators.length>0){let t=z.append("g").attr("class","wardley-accelerators");w.accelerators.forEach((d)=>{let s=O(d.x),c=D(d.y),f=60,x=30,u=20,g=`
|
|
3
3
|
M ${s} ${c-15}
|
|
4
4
|
L ${s+60-20} ${c-15}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{e,a,b,l,M,P,Tt,Et,yo,yt,tn,vo,Yn,Pe,bo,Wi,At,Gi,nn,Xn}from"./chunk-
|
|
1
|
+
import{e,a,b,l,M,P,Tt,Et,yo,yt,tn,vo,Yn,Pe,bo,Wi,At,Gi,nn,Xn}from"./chunk-1s53190z.js";import{te}from"./chunk-tz4twwmw.js";import{x}from"./chunk-rddft5ce.js";function la(t,{edgePathsClass:r="edges edgePaths"}={}){let n=t.insert("g").attr("class","root"),i=n.insert("g").attr("class","clusters"),s=n.insert("g").attr("class",r),o=n.insert("g").attr("class","edgeLabels"),u=n.insert("g").attr("class","nodes");return{clusters:i,edgePaths:s,edgeLabels:o,nodes:u,rootGroups:n}}e(la,"createLayoutElementGroups");async function D(t,r,n){if(r.label){let{shapeSvg:i,bbox:s}=await P(t,n===void 0?r:{...r,width:n});r.labelBBox={width:s.width,height:s.height},i.remove()}else r.labelBBox={width:0,height:0}}e(D,"measureGroupLabel");async function ca(t,r,n){let i=await Et(t,r,n),s=i.node()?.getBBox()??{width:0,height:0};return r.width=s.width,r.height=s.height,i}e(ca,"insertMeasuredNode");function S(t,r,n){let i=t,s=new Set;while(i){if(i.dir)return i.dir;if(!i.parentId||s.has(i.parentId))break;s.add(i.parentId),i=r.get(i.parentId)}return n}e(S,"resolveNodeDir");async function k(t,r,n={}){let i=new te({multigraph:!0,compound:!0}),s=[...r.edges],o=l(),u=la(t),{edgeLabels:d,nodes:c}=u,g=new Map,h=new Map(r.nodes.map((f)=>[f.id,f])),C=r.direction,w=t.node()!=null;await Promise.all(r.nodes.map(async(f)=>{if(f.isGroup){if(w){let p=n.unwrapGroupLabels&&f.labelType!=="markdown";await D(c,f,p?Number.POSITIVE_INFINITY:void 0)}i.setNode(f.id,{...f})}else{if(w){let p=await ca(c,f,{config:o,dir:S(f,h,C)});g.set(f.id,p)}i.setNode(f.id,{...f})}}));for(let f of s){if(w&&Wi(f))await At(d,f);if(i.setEdge(f.start,f.end,{...f},f.id),!r.edges.some((E)=>E.id===f.id))r.edges.push(f)}if(globalThis.mermaidCaptureSizes){let{captureNodeSizes:f}=await (x("tewmsd7t"),import("./chunk-tewmsd7t.js"));f(t,r)}return{graph:i,groups:u,nodeElements:g}}e(k,"createGraphWithElements");var W=new Map,m=new Map,R=new Map,U=e(()=>{m.clear(),R.clear(),W.clear()},"clear"),v=e((t,r)=>{let n=m.get(r)||[];return a.trace("In isDescendant",r," ",t," = ",n.includes(t)),n.includes(t)},"isDescendant"),Z=e((t,r)=>{let n=m.get(r)||[];if(a.info("Descendants of ",r," is ",n),a.info("Edge is ",t),t.v===r||t.w===r)return!1;if(!n)return a.debug("Tilt, ",r,",not in descendants"),!1;return n.includes(t.v)||v(t.v,r)||v(t.w,r)||n.includes(t.w)},"edgeInCluster"),T=e((t,r,n,i)=>{a.debug("Copying children of ",t,"root",i,"data",r.node(t),i);let s=r.children(t)||[];if(t!==i)s.push(t);a.debug("Copying (nodes) clusterId",t,"nodes",s),s.forEach((o)=>{if(r.children(o).length>0)T(o,r,n,i);else{let u=r.node(o);if(a.info("cp ",o," to ",i," with parent ",t),n.setNode(o,u),i!==r.parent(o))a.debug("Setting parent",o,r.parent(o)),n.setParent(o,r.parent(o));if(t!==i&&o!==t)a.debug("Setting parent",o,t),n.setParent(o,t);else a.info("In copy ",t,"root",i,"data",r.node(t),i),a.debug("Not Setting parent for node=",o,"cluster!==rootId",t!==i,"node!==clusterId",o!==t);let d=r.edges(o);a.debug("Copying Edges",d),d.forEach((c)=>{a.info("Edge",c);let g=r.edge(c.v,c.w,c.name);a.info("Edge data",g,i);try{if(Z(c,i))a.info("Copying as ",c.v,c.w,g,c.name),n.setEdge(c.v,c.w,g,c.name),a.info("newGraph edges ",n.edges(),n.edge(n.edges()[0]));else a.info("Skipping copy of edge ",c.v,"-->",c.w," rootId: ",i," clusterId:",t)}catch(h){a.error(h)}})}a.debug("Removing node",o),r.removeNode(o)})},"copy"),B=e((t,r)=>{let n=r.children(t),i=[...n];for(let s of n)R.set(s,t),i=[...i,...B(s,r)];return i},"extractDescendants"),I=e((t,r,n)=>{let i=t.edges().filter((c)=>c.v===r||c.w===r),s=t.edges().filter((c)=>c.v===n||c.w===n),o=i.map((c)=>({v:c.v===r?n:c.v,w:c.w===r?r:c.w})),u=s.map((c)=>({v:c.v,w:c.w}));return o.filter((c)=>u.some((g)=>c.v===g.v&&c.w===g.w))},"findCommonEdges"),Fn=e((t,r,n)=>{let i=r.children(t);if(a.trace("Searching children of id ",t,i),i.length<1)return t;let s;for(let o of i){let u=Fn(o,r,n),d=I(r,n,u);if(u)if(d.length>0)s=u;else return u}return s},"findNonClusterChild"),L=e((t)=>{if(!W.has(t))return t;if(!W.get(t).externalConnections)return t;if(W.has(t))return W.get(t).id;return t},"getAnchorId"),to=e((t,r)=>{if(!t||r>10){a.debug("Opting out, no graph ");return}else a.debug("Opting in, graph ");t.nodes().forEach(function(n){if(t.children(n).length>0)a.debug("Cluster identified",n," Replacement id in edges: ",Fn(n,t,n)),m.set(n,B(n,t)),W.set(n,{id:Fn(n,t,n),clusterData:t.node(n)})}),t.nodes().forEach(function(n){let i=t.children(n),s=t.edges();if(i.length>0)a.debug("Cluster identified",n,m),s.forEach((o)=>{let u=v(o.v,n),d=v(o.w,n);if(u^d)a.debug("Edge: ",o," leaves cluster ",n),a.debug("Descendants of XXX ",n,": ",m.get(n)),W.get(n).externalConnections=!0});else a.debug("Not a cluster ",n,m)});for(let n of W.keys()){let i=W.get(n).id,s=t.parent(i);if(s!==n&&W.has(s)&&!W.get(s).externalConnections)W.get(n).id=s;let o=t.edges().some((u)=>u.v===n);if(i&&W.get(n)?.externalConnections&&o&&_(t,i,n)){let u=ee(t,n,t.parent(i));if(u)W.get(n).id=u}}t.edges().forEach(function(n){let i=t.edge(n);a.debug("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(n)),a.debug("Edge "+n.v+" -> "+n.w+": "+JSON.stringify(t.edge(n)));let{v:s,w:o}=n;if(a.debug("Fix XXX",W,"ids:",n.v,n.w,"Translating: ",W.get(n.v)," --- ",W.get(n.w)),W.get(n.v)||W.get(n.w)){if(a.debug("Fixing and trying - removing XXX",n.v,n.w,n.name),s=L(n.v),o=L(n.w),t.removeEdge(n.v,n.w,n.name),s!==n.v){let u=t.parent(s);W.get(u).externalConnections=!0,i.fromCluster=n.v}if(o!==n.w){let u=t.parent(o);W.get(u).externalConnections=!0,i.toCluster=n.w}a.debug("Fix Replacing with XXX",s,o,n.name),t.setEdge(s,o,i,n.name)}}),A(t,0),a.trace(W)},"adjustClustersAndEdges"),A=e((t,r)=>{if(r>10){a.error("Bailing out");return}let n=t.nodes(),i=!1;for(let s of n){let o=t.children(s);i=i||o.length>0}if(!i){a.debug("Done, no node has children",t.nodes());return}a.debug("Nodes = ",n,r);for(let s of n)if(a.debug("Extracting node",s,W,W.has(s)&&!W.get(s).externalConnections,!t.parent(s),t.node(s),t.children("D")," Depth ",r),!W.has(s))a.debug("Not a cluster",s,r);else if(!W.get(s).externalConnections&&t.children(s)&&t.children(s).length>0){a.debug("Cluster without external connections, without a parent and with children",s,r);let u=t.graph().rankdir==="TB"?"LR":"TB";if(W.get(s)?.clusterData?.dir)u=W.get(s).clusterData.dir,a.debug("Fixing dir",W.get(s).clusterData.dir,u);let d=new te({multigraph:!0,compound:!0}).setGraph({rankdir:u,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});T(s,t,d,s),t.setNode(s,{clusterNode:!0,id:s,clusterData:W.get(s).clusterData,label:W.get(s).label,graph:d})}else a.debug("Cluster ** ",s," **not meeting the criteria !externalConnections:",!W.get(s).externalConnections," no parent: ",!t.parent(s)," children ",t.children(s)&&t.children(s).length>0,t.children("D"),r),a.debug(W);n=t.nodes(),a.debug("New list of nodes",n);for(let s of n){let o=t.node(s);if(a.debug(" Now next level",s,o),o?.clusterNode)A(o.graph,r+1)}},"extractor"),X=e((t,r)=>{if(r.length===0)return[];let n=Object.assign([],r);return r.forEach((i)=>{let s=t.children(i),o=X(t,s);n=[...n,...o]}),n},"sorter"),ua=e((t)=>X(t,t.children()),"sortNodesByHierarchy"),_=e((t,r,n)=>{let i=t.parent(r);while(i&&i!==n){let s=W.get(i);if(s&&!s.externalConnections)return!0;i=t.parent(i)}return!1},"isNodeInExtractableCluster"),ee=e((t,r,n)=>{let i=t.children(r)??[];for(let s of i){if(s===n||v(s,n))continue;let o=Fn(s,t,r);if(!o)continue;if(!_(t,o,r))return o}return null},"findSafeAnchorNode");function cr({prepareLayout:t,measureLayout:r,runLayoutCore:n,paintLayout:i,afterPaint:s,paintOptions:o}){let u=r??O;return e(async function(c,g,h,C){let w=g.select("g");(h?.insertMarkers??Xn)(w,c.markers,c.type,c.diagramId),G();let f={element:w,helpers:h,options:C};f.preparedLayout=await t?.(c,f);let p=await u(c,f),E=await n(c,f),N={...f,measure:p};if(i)await i(c,N,E);else await F(c,N,o);await s?.(c,N,E)},"render")}e(cr,"createCommonLayoutRenderer");function G(){yo(),bo(),vo(),U()}e(G,"clearLayoutRenderState");async function O(t,{element:r},n){return await k(r,t,n)}e(O,"defaultMeasureLayout");async function F(t,r,n={}){let{measure:i}=r,{groups:s}=i;for(let u of n.getNodes?.(t,r)??t.nodes){if(n.skipNode?.(u,r))continue;await j(s,u,r,n)}let o=z(t.nodes);for(let u of t.edges){if(J(u,n))continue;await V(s,u,o,t,n,r)}}e(F,"paintLayoutData");async function j(t,r,n,i){if(r.clusterNode)yt(r);else if(H(r,n,i))await tn(t.clusters,r);else yt(r)}e(j,"paintLayoutNode");function H(t,r,n){return t.isGroup===!0&&(n.isCluster?.(t,r)??!0)}e(H,"shouldPaintAsCluster");function z(t){let r=new Map;for(let n of t)if(n?.id)r.set(n.id,n);return r}e(z,"buildNodeLookup");function J(t,r){return t.isLayoutOnly||Boolean(r.skipEdge?.(t))}e(J,"shouldSkipPaintEdge");async function V(t,r,n,i,s,o){let u=nn(t.edgePaths,{...r},s.clusterDb??new Map,i.type,y(r.start,r,n,o,s),y(r.end,r,n,o,s),i.diagramId,Y(r,s),i.layoutAlgorithm);if(Wi(r)){if(!Yn.has(r.id))await At(t.edgeLabels,r);q(r,u)}}e(V,"paintLayoutEdge");function y(t,r,n,i,s){return s.getEdgeNode?.(t,r,i)??(t?n.get(t)??{}:{})}e(y,"getRenderedNode");function Y(t,r){return typeof r.skipIntersect==="function"?r.skipIntersect(t):r.skipIntersect??!1}e(Y,"shouldSkipIntersect");function q(t,r){let n=r?.updatedPath??r?.originalPath,i=b(),{subGraphTitleTotalMargin:s}=Tt({flowchart:i.flowchart??{}});if(t.label){let o=Yn.get(t.id),{x:u,y:d}=Gi(t,r);o.attr("transform",`translate(${u}, ${d+s/2})`)}for(let[o,u]of[["startLeft",t.startLabelLeft],["startRight",t.startLabelRight],["endLeft",t.endLabelLeft],["endRight",t.endLabelRight]])if(u){let{x:d,y:c}=K(t,o,n);Pe.get(t.id)[o].attr("transform",`translate(${d}, ${c})`)}}e(q,"positionRenderedEdgeLabel");var ne={startLeft:"start_left",startRight:"start_right",endLeft:"end_left",endRight:"end_right"};function K(t,r,n){let i=t.terminalLabelCenters?.[r];if(i)return{...i};if(!n)return{x:t.x,y:t.y};let s=r.startsWith("start")?t.arrowTypeStart:t.arrowTypeEnd;return M.calcTerminalLabelPosition(s?10:0,ne[r],n)}e(K,"terminalLabelTranslate");
|
|
2
2
|
export{la,ca,W,Fn,to,ua,cr};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e,a}from"./chunk-
|
|
1
|
+
import{e,a}from"./chunk-1s53190z.js";import{K,Dt,Mt}from"./chunk-2b63adsj.js";import{G}from"./chunk-14deqqhr.js";import{sr,kt}from"./chunk-2cem4sv7.js";var i=sr().RailroadPeg.parser.LangiumParser,s=e((r)=>{let t=r.alternatives.map(l);if(t.length===1)return t[0];return{type:"choice",alternatives:t}},"transformOrderedChoice"),l=e((r)=>{let t=r.elements.map(m);if(t.length===1)return t[0];return{type:"sequence",elements:t}},"transformSequence"),m=e((r)=>{let t=p(r.suffix);if(!r.operator)return t;return{type:"special",text:r.operator==="&"?`&${o(t)}`:`!${o(t)}`}},"transformPrefix"),o=e((r)=>{switch(r.type){case"terminal":return`"${r.value}"`;case"nonterminal":return r.name;case"special":return r.text;default:return"(...)"}},"nodeToLabel"),p=e((r)=>{let t=u(r.primary);if(!r.operator)return t;switch(r.operator){case"?":return{type:"optional",element:t};case"*":return{type:"repetition",element:t,min:0,max:1/0};case"+":return{type:"repetition",element:t,min:1,max:1/0};default:throw Error(`Unsupported PEG suffix operator: ${r.operator}`)}},"transformSuffix"),u=e((r)=>{switch(r.$type){case"PegLiteral":return{type:"terminal",value:r.value};case"PegIdentifier":return{type:"nonterminal",name:r.name};case"PegGroup":return s(r.element);case"PegAny":return{type:"special",text:r.dot};default:throw Error(`Unsupported PEG primary node: ${r.$type}`)}},"transformPrimary"),c=e((r)=>({name:r.name,definition:s(r.definition)}),"transformRule"),f=e((r)=>{if(G(r,K),r.title)K.setTitle(r.title);r.rules.map((t)=>K.addRule(c(t)))},"populateDb"),d={parse:e((r)=>{K.clear(),a.debug("[PEG Parser] Starting Langium parse");let t=i.parse(r);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new kt(t);let n=t.value;a.debug("[PEG Parser] Parsed rules:",n.rules.length),f(n),a.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:K}},w={parser:d,db:K,renderer:Mt,styles:Dt};export{w as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{yn}from"./chunk-
|
|
1
|
+
import{yn}from"./chunk-wjbk50hn.js";import{G}from"./chunk-14deqqhr.js";import{e,a,D,b,O,B,C,S,E,T,A,R,L,V,Dn,nt,U}from"./chunk-1s53190z.js";import{X}from"./chunk-2cem4sv7.js";var P=/[─━│┃└┗├┣]/,F=/[└┗├┣]/,ee=/[─━]/,H=/^[\s│┃]+$/,W=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,z=/^\s*%%/,te=" ";function Z(n){return n.some((r)=>P.test(r))}e(Z,"isBoxDrawingFormat");function q(n){for(let r of n){let t=F.exec(r);if(t?.index&&t.index>0)return t.index}return 4}e(q,"inferSegmentWidth");function j(n,r){return n.replace(/\bline\s+(\d+)\b/gi,(t,i)=>{let c=parseInt(i,10),o=r.get(c);return o?`line ${o}`:t})}e(j,"remapErrorLines");function J(n){let r=n.split(`
|
|
2
2
|
`),t=new Map,i=-1;for(let[g,d]of r.entries())if(d.trim()==="treeView-beta"){i=g;break}if(i===-1)return{text:n,lineMap:t};let c=[];for(let g=i+1;g<r.length;g++){let d=r[g];if(d.trim()===""||z.test(d)||W.test(d))continue;if(H.test(d))continue;c.push(d.replace(/\t/g," "))}if(!Z(c))return{text:n,lineMap:t};let o=q(c),s=[],l=0;for(let g=0;g<=i;g++)s.push(r[g]),l++,t.set(l,g+1);for(let g=i+1;g<r.length;g++){let d=r[g],p=d.trim(),f=g+1;if(p===""){s.push(d),l++,t.set(l,f);continue}if(z.test(d)){s.push(d),l++,t.set(l,f);continue}if(W.test(d)){s.push(d),l++,t.set(l,f);continue}if(H.test(d))continue;let h=d.replace(/\t/g," "),w=F.exec(h);if(w?.index!==void 0){let u=w.index,x=Math.round(u/o)+1,m=u+1;while(m<h.length&&ee.test(h[m]))m++;while(m<h.length&&h[m]===" ")m++;let I=h.slice(m).trimEnd();if(!I)throw Error(`Line ${f}: Empty node — expected a filename or directory name after the box-drawing prefix`);let Q=te.repeat(x);s.push(Q+I),l++,t.set(l,f)}else if(/^[\s─━│┃└┗├┣]+$/.test(h))continue;else if(P.test(h))s.push(d),l++,t.set(l,f);else if(/^\s+/.test(h))throw Error(`Line ${f}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);else s.push(d),l++,t.set(l,f)}return{text:s.join(`
|
|
3
3
|
`),lineMap:t}}e(J,"preprocessBoxDrawing");var v=new yn(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),re=e(()=>{v.reset(),C()},"clear"),ne=e(()=>v.records.stack[0],"getRoot"),ie=e(()=>v.records.cnt,"getCount"),oe=D.treeView,se=e(()=>U(oe,b().treeView),"getConfig"),ae=e((n,r,t,i,c,o)=>{while(n<=v.records.stack[v.records.stack.length-1].level)v.records.stack.pop();let s={id:v.records.cnt++,level:n,name:r,nodeType:t,icon:c,cssClass:i,description:o,children:[]};v.records.stack[v.records.stack.length-1].children.push(s),v.records.stack.push(s)},"addNode"),ce={clear:re,addNode:ae,getRoot:ne,getCount:ie,getConfig:se,getAccTitle:E,getAccDescription:A,getDiagramTitle:L,setAccDescription:T,setAccTitle:S,setDiagramTitle:R},k=ce,le=e((n)=>{G(n,k);for(let r of n.nodes){let t=typeof r.indent==="number"?r.indent:0,i=r.name,c=i.endsWith("/");if(c)i=i.slice(0,-1);let o=c?"directory":"file",s=r.classAnnotation||void 0,l=r.iconAnnotation,g=l!==void 0?l||"none":void 0,d=r.descAnnotation||void 0,p=d?O(d,b()):void 0;k.addNode(t,i,o,s,g,p)}},"populate"),de={parse:e(async(n)=>{let{text:r,lineMap:t}=J(n);try{let i=await X("treeView",r);a.debug(i),le(i)}catch(i){if(t.size>0&&i instanceof Error)i.message=j(i.message,t);throw i}},"parse")},y={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function K(n,r){let t=r?.filenameIcons?.[n];if(t)return t;let i=n.lastIndexOf(".");if(i>0){let c=n.substring(i).toLowerCase(),o=r?.extensionIcons;return o?.[c]??o?.[c.slice(1)]}return}e(K,"detectIcon");function N(n,r){if(n.includes(":"))return n;if(n in y.icons||!r)return`${y.prefix}:${n}`;return`${r}:${n}`}e(N,"qualifyIcon");function M(n,r){if(n.icon==="none")return;if(n.icon)return N(n.icon,r.defaultIconPack);if(!r.showIcons)return;if(n.nodeType==="file"){let t=K(n.name,r);if(t==="none")return;if(t)return N(t,r.defaultIconPack)}return`${y.prefix}:${n.nodeType==="directory"?"folder":"file"}`}e(M,"getNodeIcon");Dn([{name:y.prefix,icons:y}]);var _=14,he=4,pe=16,fe=e(async(n,r)=>{let t=[],i=e((o)=>{let s=M(o,r);if(s)t.push({icon:s,node:o});o.children.forEach(i)},"collect");i(n);let c=await Promise.all(t.map(async({icon:o,node:s})=>({id:s.id,svg:await nt(o,{height:_,width:_})})));return new Map(c.map(({id:o,svg:s})=>[o,s]))},"resolveNodeIcons"),ge=e((n,r,t,i,c,o)=>{let s=i.append("g"),l="treeView-node-label";if(t.nodeType==="directory")l+=" treeView-node-dir";if(t.cssClass)l+=` ${t.cssClass}`;let g=_+he,d=M(t,c),p=d!==void 0;if(d)s.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${n+c.paddingX}, ${r+c.paddingY})`).html(o.get(t.id)??"");let f=s.append("text").text(t.name).attr("dominant-baseline","middle").attr("class",l),{height:h,width:w}=f.node().getBBox(),u=h+c.paddingY*2,x=n+c.paddingX+(p?g:0);f.attr("x",x),f.attr("y",r+u/2);let m=x+w,I=w+c.paddingX*2+(p?g:0);if(t.BBox={x:n,y:r,width:I,height:u},t.cssClass?.split(/\s+/).includes("highlight"))s.insert("rect",":first-child").attr("x",n).attr("y",r+1).attr("width",0).attr("height",u-2).attr("rx",3).attr("class","treeView-highlight-bg");return{node:t,nodeGroup:s,labelRightEdge:m,centerY:r+u/2}},"positionLabel"),Y=e((n,r,t,i,c,o)=>n.append("line").attr("x1",r).attr("y1",t).attr("x2",i).attr("y2",c).attr("stroke-width",o).attr("class","treeView-node-line"),"positionLine"),ue=e((n,r,t,i)=>{let c=0,o=0,s=[],l=e((p,f,h,w)=>{let u=w*(h.rowIndent+h.paddingX),x=ge(u,c,f,p,h,i);s.push(x);let{height:m,width:I}=f.BBox;Y(p,u-h.rowIndent,c+m/2,u,c+m/2,h.lineThickness),o=Math.max(o,u+I),c+=m},"drawNode"),g=e((p,f=0)=>{l(n,p,t,f),p.children.forEach((x)=>{g(x,f+1)});let{x:h,y:w,height:u}=p.BBox;if(p.children.length){let{y:x,height:m}=p.children[p.children.length-1].BBox;Y(n,h+t.paddingX,w+u,h+t.paddingX,x+m/2+t.lineThickness/2,t.lineThickness)}},"processNode");g(r);let d=s.filter((p)=>p.node.description);if(d.length>0){let f=Math.max(...s.map((h)=>h.labelRightEdge))+pe;for(let h of d){let u=h.nodeGroup.append("text").text(h.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",f).attr("y",h.centerY).node().getBBox();o=Math.max(o,f+u.width+t.paddingX)}}for(let p of s)if(p.node.cssClass?.split(/\s+/).includes("highlight")){let f=p.nodeGroup.select(".treeView-highlight-bg");if(!f.empty()){let h=o-p.node.BBox.x+8;f.attr("width",h),o=Math.max(o,p.node.BBox.x+h+2)}}return{totalHeight:c,totalWidth:o}},"drawTree"),me=e(async(n,r,t,i)=>{a.debug(`Rendering treeView diagram
|
|
4
4
|
`+n);let c=i.db,o=c.getRoot(),s=c.getConfig(),l=V(r),g=l.append("g");g.attr("class","tree-view");let d=await fe(o,s),{totalHeight:p,totalWidth:f}=ue(g,o,s,d);l.attr("viewBox",`-${s.lineThickness/2} 0 ${f} ${p}`),B(l,p,f,s.useMaxWidth)},"draw"),we={draw:me},xe=we,ve={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},be=e(({treeView:n})=>{let{labelFontSize:r,labelColor:t,lineColor:i,iconColor:c,descriptionColor:o,highlightBg:s,highlightStroke:l}=U(ve,n);return`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e,B,C,S,E,T,A,R,L,l,p}from"./chunk-
|
|
1
|
+
import{e,B,C,S,E,T,A,R,L,l,p}from"./chunk-1s53190z.js";import{on,Fr,Ki,Ke}from"./chunk-5vjhvw1m.js";import{_t}from"./chunk-5wbnjjhg.js";import{je}from"./chunk-dg3p8db5.js";var nt=function(){var t=e(function(u,n,s,o){for(s=s||{},o=u.length;o--;s[u[o]]=n);return s},"o"),r=[6,8,10,11,12,14,16,17,18],a=[1,9],g=[1,10],i=[1,11],y=[1,12],m=[1,13],c=[1,14],x={trace:e(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:e(function(n,s,o,d,f,h,w){var _=h.length-1;switch(f){case 1:return h[_-1];case 2:this.$=[];break;case 3:h[_-1].push(h[_]),this.$=h[_-1];break;case 4:case 5:this.$=h[_];break;case 6:case 7:this.$=[];break;case 8:d.setDiagramTitle(h[_].substr(6)),this.$=h[_].substr(6);break;case 9:this.$=h[_].trim(),d.setAccTitle(this.$);break;case 10:case 11:this.$=h[_].trim(),d.setAccDescription(this.$);break;case 12:d.addSection(h[_].substr(8)),this.$=h[_].substr(8);break;case 13:d.addTask(h[_-1],h[_]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(r,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:g,14:i,16:y,17:m,18:c},t(r,[2,7],{1:[2,1]}),t(r,[2,3]),{9:15,11:a,12:g,14:i,16:y,17:m,18:c},t(r,[2,5]),t(r,[2,6]),t(r,[2,8]),{13:[1,16]},{15:[1,17]},t(r,[2,11]),t(r,[2,12]),{19:[1,18]},t(r,[2,4]),t(r,[2,9]),t(r,[2,10]),t(r,[2,13])],defaultActions:{},parseError:e(function(n,s){if(s.recoverable)this.trace(n);else{var o=Error(n);throw o.hash=s,o}},"parseError"),parse:e(function(n){var s=this,o=[0],d=[],f=[null],h=[],w=this.table,_="",z=0,ot=0,ct=0,vt=2,ht=1,wt=h.slice.call(arguments,1),v=Object.create(this.lexer),O={yy:{}};for(var Q in this.yy)if(Object.prototype.hasOwnProperty.call(this.yy,Q))O.yy[Q]=this.yy[Q];if(v.setInput(n,O.yy),O.yy.lexer=v,O.yy.parser=this,typeof v.yylloc>"u")v.yylloc={};var D=v.yylloc;h.push(D);var Tt=v.options&&v.options.ranges;if(typeof O.yy.parseError==="function")this.parseError=O.yy.parseError;else this.parseError=Object.getPrototypeOf(this).parseError;function St(I){o.length=o.length-2*I,f.length=f.length-I,h.length=h.length-I}e(St,"popStack");function ut(){var I=d.pop()||v.lex()||ht;if(typeof I!=="number"){if(I instanceof Array)d=I,I=d.pop();I=s.symbols_[I]||I}return I}e(ut,"lex");var M,tt,Y,P,Gt,et,q={},Z,j,yt,J;while(!0){if(Y=o[o.length-1],this.defaultActions[Y])P=this.defaultActions[Y];else{if(M===null||typeof M>"u")M=ut();P=w[Y]&&w[Y][M]}if(typeof P>"u"||!P.length||!P[0]){var rt="";J=[];for(Z in w[Y])if(this.terminals_[Z]&&Z>vt)J.push("'"+this.terminals_[Z]+"'");if(v.showPosition)rt="Parse error on line "+(z+1)+`:
|
|
2
2
|
`+v.showPosition()+`
|
|
3
3
|
Expecting `+J.join(", ")+", got '"+(this.terminals_[M]||M)+"'";else rt="Parse error on line "+(z+1)+": Unexpected "+(M==ht?"end of input":"'"+(this.terminals_[M]||M)+"'");this.parseError(rt,{text:v.match,token:this.terminals_[M]||M,line:v.yylineno,loc:D,expected:J})}if(P[0]instanceof Array&&P.length>1)throw Error("Parse Error: multiple actions possible at state: "+Y+", token: "+M);switch(P[0]){case 1:if(o.push(M),f.push(v.yytext),h.push(v.yylloc),o.push(P[1]),M=null,!tt){if(ot=v.yyleng,_=v.yytext,z=v.yylineno,D=v.yylloc,ct>0)ct--}else M=tt,tt=null;break;case 2:if(j=this.productions_[P[1]][1],q.$=f[f.length-j],q._$={first_line:h[h.length-(j||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(j||1)].first_column,last_column:h[h.length-1].last_column},Tt)q._$.range=[h[h.length-(j||1)].range[0],h[h.length-1].range[1]];if(et=this.performAction.apply(q,[_,ot,z,O.yy,P[1],f,h].concat(wt)),typeof et<"u")return et;if(j)o=o.slice(0,-1*j*2),f=f.slice(0,-1*j),h=h.slice(0,-1*j);o.push(this.productions_[P[1]][0]),f.push(q.$),h.push(q._$),yt=w[o[o.length-2]][o[o.length-1]],o.push(yt);break;case 3:return!0}}return!0},"parse")},k=function(){var u={EOF:1,parseError:e(function(s,o){if(this.yy.parser)this.yy.parser.parseError(s,o);else throw Error(s)},"parseError"),setInput:e(function(n,s){if(this.yy=s||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},"setInput"),input:e(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var s=n.match(/(?:\r\n?|\n).*/g);if(s)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),n},"input"),unput:e(function(n){var s=n.length,o=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var d=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1)this.yylineno-=o.length-1;var f=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:o?(o.length===d.length?this.yylloc.first_column:0)+d[d.length-o.length].length-o[0].length:this.yylloc.first_column-s},this.options.ranges)this.yylloc.range=[f[0],f[0]+this.yyleng-s];return this.yyleng=this.yytext.length,this},"unput"),more:e(function(){return this._more=!0,this},"more"),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:e(function(n){this.unput(this.match.slice(n))},"less"),pastInput:e(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:e(function(){var n=this.match;if(n.length<20)n+=this._input.substr(0,20-n.length);return(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:e(function(){var n=this.pastInput(),s=Array(n.length+1).join("-");return n+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Jr,oi,On,Nr,si,li,fn}from"./chunk-j6a4z530.js";var S=class extends Error{constructor(t){super(t);this.name="ShikiError"}};function tn(t){return Ne(t)}function Ne(t){if(Array.isArray(t))return nn(t);if(t instanceof RegExp)return t;if(typeof t==="object")return rn(t);return t}function nn(t){let e=[];for(let n=0,r=t.length;n<r;n++)e[n]=Ne(t[n]);return e}function rn(t){let e={};for(let n in t)e[n]=Ne(t[n]);return e}function Ve(t,...e){return e.forEach((n)=>{for(let r in n)t[r]=n[r]}),t}function Ye(t){let e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");if(e===0)return t;else if(~e===t.length-1)return Ye(t.substring(0,t.length-1));else return t.substr(~e+1)}var ye=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,J=class{static hasCaptures(t){if(t===null)return!1;return ye.lastIndex=0,ye.test(t)}static replaceCaptures(t,e,n){return t.replace(ye,(r,s,i,o)=>{let a=n[parseInt(s||i,10)];if(a){let c=e.substring(a.start,a.end);while(c[0]===".")c=c.substring(1);switch(o){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return r})}};function Je(t,e){if(t<e)return-1;if(t>e)return 1;return 0}function Qe(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,r=e.length;if(n===r){for(let s=0;s<n;s++){let i=Je(t[s],e[s]);if(i!==0)return i}return 0}return n-r}function Fe(t){if(/^#[0-9a-f]{6}$/i.test(t))return!0;if(/^#[0-9a-f]{8}$/i.test(t))return!0;if(/^#[0-9a-f]{3}$/i.test(t))return!0;if(/^#[0-9a-f]{4}$/i.test(t))return!0;return!1}function Xe(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Ze=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);let e=this.fn(t);return this.cache.set(t,e),e}},M=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(an(t),e)}static createFromParsedTheme(t,e){return ln(t,e)}_cachedMatchRoot=new Ze((t)=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;let e=t.scopeName,r=this._cachedMatchRoot.get(e).find((s)=>sn(t.parent,s.parentScopes));if(!r)return null;return new et(r.fontStyle,r.foreground,r.background)}},be=class t{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(let r of n)e=new t(e,r);return e}static from(...e){let n=null;for(let r=0;r<e.length;r++)n=new t(n,e[r]);return n}push(e){return new t(this,e)}getSegments(){let e=this,n=[];while(e)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){if(this===e)return!0;if(this.parent===null)return!1;return this.parent.extends(e)}getExtensionIfDefined(e){let n=[],r=this;while(r&&r!==e)n.push(r.scopeName),r=r.parent;return r===e?n.reverse():void 0}};function sn(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let r=e[n],s=!1;if(r===">"){if(n===e.length-1)return!1;r=e[++n],s=!0}while(t){if(on(t.scopeName,r))break;if(s)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function on(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var et=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function an(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],r=0;for(let s=0,i=e.length;s<i;s++){let o=e[s];if(!o.settings)continue;let a;if(typeof o.scope==="string"){let h=o.scope;h=h.replace(/^[,]+/,""),h=h.replace(/[,]+$/,""),a=h.split(",")}else if(Array.isArray(o.scope))a=o.scope;else a=[""];let c=-1;if(typeof o.settings.fontStyle==="string"){c=0;let h=o.settings.fontStyle.split(" ");for(let d=0,f=h.length;d<f;d++)switch(h[d]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let l=null;if(typeof o.settings.foreground==="string"&&Fe(o.settings.foreground))l=o.settings.foreground;let u=null;if(typeof o.settings.background==="string"&&Fe(o.settings.background))u=o.settings.background;for(let h=0,d=a.length;h<d;h++){let m=a[h].trim().split(" "),y=m[m.length-1],_=null;if(m.length>1)_=m.slice(0,m.length-1),_.reverse();n[r++]=new cn(y,_,s,c,l,u)}}return n}var cn=class{constructor(t,e,n,r,s,i){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=r,this.foreground=s,this.background=i}},k=((t)=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(k||{});function ln(t,e){t.sort((c,l)=>{let u=Je(c.scope,l.scope);if(u!==0)return u;if(u=Qe(c.parentScopes,l.parentScopes),u!==0)return u;return c.index-l.index});let n=0,r="#000000",s="#ffffff";while(t.length>=1&&t[0].scope===""){let c=t.shift();if(c.fontStyle!==-1)n=c.fontStyle;if(c.foreground!==null)r=c.foreground;if(c.background!==null)s=c.background}let i=new un(e),o=new et(n,i.getId(r),i.getId(s)),a=new dn(new we(0,null,-1,0,0),[]);for(let c=0,l=t.length;c<l;c++){let u=t[c];a.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new M(i,o,a)}var un=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},hn=Object.freeze([]),we=class t{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,r,s,i){this.scopeDepth=e,this.parentScopes=n||hn,this.fontStyle=r,this.foreground=s,this.background=i}clone(){return new t(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let r=0,s=e.length;r<s;r++)n[r]=e[r].clone();return n}acceptOverwrite(e,n,r,s){if(this.scopeDepth>e)console.log("how did this happen?");else this.scopeDepth=e;if(n!==-1)this.fontStyle=n;if(r!==0)this.foreground=r;if(s!==0)this.background=s}},dn=class t{constructor(e,n=[],r={}){this._mainRule=e,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let r=0,s=0;while(!0){if(e.parentScopes[r]===">")r++;if(n.parentScopes[s]===">")s++;if(r>=e.parentScopes.length||s>=n.parentScopes.length)break;let i=n.parentScopes[s].length-e.parentScopes[r].length;if(i!==0)return i;r++,s++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),s,i;if(r===-1)s=e,i="";else s=e.substring(0,r),i=e.substring(r+1);if(this._children.hasOwnProperty(s))return this._children[s].match(i)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(t._cmpBySpecificity),n}insert(e,n,r,s,i,o){if(n===""){this._doInsertHere(e,r,s,i,o);return}let a=n.indexOf("."),c,l;if(a===-1)c=n,l="";else c=n.substring(0,a),l=n.substring(a+1);let u;if(this._children.hasOwnProperty(c))u=this._children[c];else u=new t(this._mainRule.clone(),we.cloneArr(this._rulesWithParentScopes)),this._children[c]=u;u.insert(e+1,l,r,s,i,o)}_doInsertHere(e,n,r,s,i){if(n===null){this._mainRule.acceptOverwrite(e,r,s,i);return}for(let o=0,a=this._rulesWithParentScopes.length;o<a;o++){let c=this._rulesWithParentScopes[o];if(Qe(c.parentScopes,n)===0){c.acceptOverwrite(e,r,s,i);return}}if(r===-1)r=this._mainRule.fontStyle;if(s===0)s=this._mainRule.foreground;if(i===0)i=this._mainRule.background;this._rulesWithParentScopes.push(new we(e,n,r,s,i))}},x=class t{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){let n=t.getLanguageId(e),r=t.getTokenType(e),s=t.getFontStyle(e),i=t.getForeground(e),o=t.getBackground(e);console.log({languageId:n,tokenType:r,fontStyle:s,foreground:i,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,r,s,i,o,a){let c=t.getLanguageId(e),l=t.getTokenType(e),u=t.containsBalancedBrackets(e)?1:0,h=t.getFontStyle(e),d=t.getForeground(e),f=t.getBackground(e);if(n!==0)c=n;if(r!==8)l=gn(r);if(s!==null)u=s?1:0;if(i!==-1)h=i;if(o!==0)d=o;if(a!==0)f=a;return(c<<0|l<<8|u<<10|h<<11|d<<15|f<<24)>>>0}};function mn(t){return t}function gn(t){return t}function X(t,e){let n=[],r=pn(t),s=r.next();while(s!==null){let c=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let l=o();if(n.push({matcher:l,priority:c}),s!==",")break;s=r.next()}return n;function i(){if(s==="-"){s=r.next();let c=i();return(l)=>!!c&&!c(l)}if(s==="("){s=r.next();let c=a();if(s===")")s=r.next();return c}if(De(s)){let c=[];do c.push(s),s=r.next();while(De(s));return(l)=>e(c,l)}return null}function o(){let c=[],l=i();while(l)c.push(l),l=i();return(u)=>c.every((h)=>h(u))}function a(){let c=[],l=o();while(l){if(c.push(l),s==="|"||s===",")do s=r.next();while(s==="|"||s===",");else break;l=o()}return(u)=>c.some((h)=>h(u))}}function De(t){return!!t&&!!t.match(/[\w\.:]+/)}function pn(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;let r=n[0];return n=e.exec(t),r}}}function tt(t){if(typeof t.dispose==="function")t.dispose()}var j=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},_n=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},yn=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){let e=t.toKey();if(this._seenReferenceKeys.has(e))return;this._seenReferenceKeys.add(e),this._references.push(t)}},bn=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new j(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let t=this.Q;this.Q=[];let e=new yn;for(let n of t)Sn(n,this.initialScopeName,this.repo,e);for(let n of e.references)if(n instanceof j){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName))continue;if(this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Sn(t,e,n,r){let s=n.lookup(t.scopeName);if(!s){if(t.scopeName===e)throw Error(`No grammar provided for <${e}>`);return}let i=n.lookup(e);if(t instanceof j)Q({baseGrammar:i,selfGrammar:s},r);else Ce(t.ruleName,{baseGrammar:i,selfGrammar:s,repository:s.repository},r);let o=n.injections(t.scopeName);if(o)for(let a of o)r.add(new j(a))}function Ce(t,e,n){if(e.repository&&e.repository[t]){let r=e.repository[t];Z([r],e,n)}}function Q(t,e){if(t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns))Z(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e);if(t.selfGrammar.injections)Z(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function Z(t,e,n){for(let r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let s=r.repository?Ve({},e.repository,r.repository):e.repository;if(Array.isArray(r.patterns))Z(r.patterns,{...e,repository:s},n);let i=r.include;if(!i)continue;let o=nt(i);switch(o.kind){case 0:Q({...e,selfGrammar:e.baseGrammar},n);break;case 1:Q(e,n);break;case 2:Ce(o.ruleName,{...e,repository:s},n);break;case 3:case 4:let a=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(a){let c={baseGrammar:e.baseGrammar,selfGrammar:a,repository:s};if(o.kind===4)Ce(o.ruleName,c,n);else Q(c,n)}else if(o.kind===4)n.add(new _n(o.scopeName,o.ruleName));else n.add(new j(o.scopeName));break}}}var wn=class{kind=0},Cn=class{kind=1},kn=class{constructor(t){this.ruleName=t}kind=2},Rn=class{constructor(t){this.scopeName=t}kind=3},Nn=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function nt(t){if(t==="$base")return new wn;else if(t==="$self")return new Cn;let e=t.indexOf("#");if(e===-1)return new Rn(t);else if(e===0)return new kn(t.substring(1));else{let n=t.substring(0,e),r=t.substring(e+1);return new Nn(n,r)}}var Tn=/\\(\d+)/,We=/\\(\d+)/g,ws=Symbol("RuleId"),vn=-1,rt=-2;function st(t){return t}function it(t){return t}var W=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,r){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=J.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=J.hasCaptures(this._contentName)}get debugName(){let t=this.$location?`${Ye(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){if(!this._nameIsCapturing||this._name===null||t===null||e===null)return this._name;return J.replaceCaptures(this._name,t,e)}getContentName(t,e){if(!this._contentNameIsCapturing||this._contentName===null)return this._contentName;return J.replaceCaptures(this._contentName,t,e)}},An=class extends W{retokenizeCapturedWithRuleId;constructor(t,e,n,r,s){super(t,e,n,r);this.retokenizeCapturedWithRuleId=s}dispose(){}collectPatterns(t,e){throw Error("Not supported!")}compile(t,e){throw Error("Not supported!")}compileAG(t,e,n,r){throw Error("Not supported!")}},En=class extends W{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,r,s){super(t,e,n,null);this._match=new F(r,this.id),this.captures=s,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns)this._cachedCompiledPatterns=new D,this.collectPatterns(t,this._cachedCompiledPatterns);return this._cachedCompiledPatterns}},He=class extends W{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,s){super(t,e,n,r);this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}collectPatterns(t,e){for(let n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns)this._cachedCompiledPatterns=new D,this.collectPatterns(t,this._cachedCompiledPatterns);return this._cachedCompiledPatterns}},ke=class extends W{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,s,i,o,a,c,l){super(t,e,n,r);this._begin=new F(s,this.id),this.beginCaptures=i,this._end=new F(o?o:"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,r)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new D;for(let n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);if(this.applyEndPatternLast)this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end);else this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}if(this._end.hasBackReferences)if(this.applyEndPatternLast)this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e);else this._cachedCompiledPatterns.setSource(0,e);return this._cachedCompiledPatterns}},ee=class extends W{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,r,s,i,o,a,c){super(t,e,n,r);this._begin=new F(s,this.id),this.beginCaptures=i,this.whileCaptures=a,this._while=new F(o,rt),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null;if(this._cachedCompiledWhilePatterns)this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new D;for(let e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,r){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,r)}_getCachedCompiledWhilePatterns(t,e){if(!this._cachedCompiledWhilePatterns)this._cachedCompiledWhilePatterns=new D,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while);if(this._while.hasBackReferences)this._cachedCompiledWhilePatterns.setSource(0,e?e:"");return this._cachedCompiledWhilePatterns}},ot=class t{static createCaptureRule(e,n,r,s,i){return e.registerRule((o)=>new An(n,o,r,s,i))}static getCompiledRuleId(e,n,r){if(!e.id)n.registerRule((s)=>{if(e.id=s,e.match)return new En(e.$vscodeTextmateLocation,e.id,e.name,e.match,t._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){if(e.repository)r=Ve({},r,e.repository);let i=e.patterns;if(typeof i>"u"&&e.include)i=[{include:e.include}];return new He(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,t._compilePatterns(i,n,r))}if(e.while)return new ee(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,t._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,t._compileCaptures(e.whileCaptures||e.captures,n,r),t._compilePatterns(e.patterns,n,r));return new ke(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,t._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,t._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,t._compilePatterns(e.patterns,n,r))});return e.id}static _compileCaptures(e,n,r){let s=[];if(e){let i=0;for(let o in e){if(o==="$vscodeTextmateLocation")continue;let a=parseInt(o,10);if(a>i)i=a}for(let o=0;o<=i;o++)s[o]=null;for(let o in e){if(o==="$vscodeTextmateLocation")continue;let a=parseInt(o,10),c=0;if(e[o].patterns)c=t.getCompiledRuleId(e[o],n,r);s[a]=t.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,c)}}return s}static _compilePatterns(e,n,r){let s=[];if(e)for(let i=0,o=e.length;i<o;i++){let a=e[i],c=-1;if(a.include){let l=nt(a.include);switch(l.kind){case 0:case 1:c=t.getCompiledRuleId(r[a.include],n,r);break;case 2:let u=r[l.ruleName];if(u)c=t.getCompiledRuleId(u,n,r);break;case 3:case 4:let h=l.scopeName,d=l.kind===4?l.ruleName:null,f=n.getExternalGrammar(h,r);if(f)if(d){let m=f.repository[d];if(m)c=t.getCompiledRuleId(m,n,f.repository)}else c=t.getCompiledRuleId(f.repository.$self,n,f.repository);break}}else c=t.getCompiledRuleId(a,n,r);if(c!==-1){let l=n.getRule(c),u=!1;if(l instanceof He||l instanceof ke||l instanceof ee){if(l.hasMissingPatterns&&l.patterns.length===0)u=!0}if(u)continue;s.push(c)}}return{patterns:s,hasMissingPatterns:(e?e.length:0)!==s.length}}},F=class t{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e==="string"){let r=e.length,s=0,i=[],o=!1;for(let a=0;a<r;a++)if(e.charAt(a)==="\\"){if(a+1<r){let l=e.charAt(a+1);if(l==="z")i.push(e.substring(s,a)),i.push("$(?!\\n)(?<!\\n)"),s=a+2;else if(l==="A"||l==="G")o=!0;a++}}if(this.hasAnchor=o,s===0)this.source=e;else i.push(e.substring(s,r)),this.source=i.join("")}else this.hasAnchor=!1,this.source=e;if(this.hasAnchor)this._anchorCache=this._buildAnchorCache();else this._anchorCache=null;if(this.ruleId=n,typeof this.source==="string")this.hasBackReferences=Tn.test(this.source);else this.hasBackReferences=!1}clone(){return new t(this.source,this.ruleId)}setSource(e){if(this.source===e)return;if(this.source=e,this.hasAnchor)this._anchorCache=this._buildAnchorCache()}resolveBackReferences(e,n){if(typeof this.source!=="string")throw Error("This method should only be called if the source is a string");let r=n.map((s)=>e.substring(s.start,s.end));return We.lastIndex=0,this.source.replace(We,(s,i)=>Xe(r[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!=="string")throw Error("This method should only be called if the source is a string");let e=[],n=[],r=[],s=[],i,o,a,c;for(i=0,o=this.source.length;i<o;i++)if(a=this.source.charAt(i),e[i]=a,n[i]=a,r[i]=a,s[i]=a,a==="\\"){if(i+1<o){if(c=this.source.charAt(i+1),c==="A")e[i+1]="",n[i+1]="",r[i+1]="A",s[i+1]="A";else if(c==="G")e[i+1]="",n[i+1]="G",r[i+1]="",s[i+1]="G";else e[i+1]=c,n[i+1]=c,r[i+1]=c,s[i+1]=c;i++}}return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:s.join("")}}resolveAnchors(e,n){if(!this.hasAnchor||!this._anchorCache||typeof this.source!=="string")return this.source;if(e)if(n)return this._anchorCache.A1_G1;else return this._anchorCache.A1_G0;else if(n)return this._anchorCache.A0_G1;else return this._anchorCache.A0_G0}},D=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){if(this._cached)this._cached.dispose(),this._cached=null;if(this._anchorCache.A0_G0)this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null;if(this._anchorCache.A0_G1)this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null;if(this._anchorCache.A1_G0)this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null;if(this._anchorCache.A1_G1)this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){if(this._items[t].source!==e)this._disposeCaches(),this._items[t].setSource(e)}compile(t){if(!this._cached){let e=this._items.map((n)=>n.source);this._cached=new qe(t,e,this._items.map((n)=>n.ruleId))}return this._cached}compileAG(t,e,n){if(!this._hasAnchors)return this.compile(t);else if(e)if(n){if(!this._anchorCache.A1_G1)this._anchorCache.A1_G1=this._resolveAnchors(t,e,n);return this._anchorCache.A1_G1}else{if(!this._anchorCache.A1_G0)this._anchorCache.A1_G0=this._resolveAnchors(t,e,n);return this._anchorCache.A1_G0}else if(n){if(!this._anchorCache.A0_G1)this._anchorCache.A0_G1=this._resolveAnchors(t,e,n);return this._anchorCache.A0_G1}else{if(!this._anchorCache.A0_G0)this._anchorCache.A0_G0=this._resolveAnchors(t,e,n);return this._anchorCache.A0_G0}}_resolveAnchors(t,e,n){let r=this._items.map((s)=>s.resolveAnchors(e,n));return new qe(t,r,this._items.map((s)=>s.ruleId))}},qe=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}scanner;dispose(){if(typeof this.scanner.dispose==="function")this.scanner.dispose()}toString(){let t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
|
|
1
|
+
import{Jr,oi,On,Nr,si,li,fn}from"./chunk-rddft5ce.js";var S=class extends Error{constructor(t){super(t);this.name="ShikiError"}};function tn(t){return Ne(t)}function Ne(t){if(Array.isArray(t))return nn(t);if(t instanceof RegExp)return t;if(typeof t==="object")return rn(t);return t}function nn(t){let e=[];for(let n=0,r=t.length;n<r;n++)e[n]=Ne(t[n]);return e}function rn(t){let e={};for(let n in t)e[n]=Ne(t[n]);return e}function Ve(t,...e){return e.forEach((n)=>{for(let r in n)t[r]=n[r]}),t}function Ye(t){let e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");if(e===0)return t;else if(~e===t.length-1)return Ye(t.substring(0,t.length-1));else return t.substr(~e+1)}var ye=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,J=class{static hasCaptures(t){if(t===null)return!1;return ye.lastIndex=0,ye.test(t)}static replaceCaptures(t,e,n){return t.replace(ye,(r,s,i,o)=>{let a=n[parseInt(s||i,10)];if(a){let c=e.substring(a.start,a.end);while(c[0]===".")c=c.substring(1);switch(o){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return r})}};function Je(t,e){if(t<e)return-1;if(t>e)return 1;return 0}function Qe(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,r=e.length;if(n===r){for(let s=0;s<n;s++){let i=Je(t[s],e[s]);if(i!==0)return i}return 0}return n-r}function Fe(t){if(/^#[0-9a-f]{6}$/i.test(t))return!0;if(/^#[0-9a-f]{8}$/i.test(t))return!0;if(/^#[0-9a-f]{3}$/i.test(t))return!0;if(/^#[0-9a-f]{4}$/i.test(t))return!0;return!1}function Xe(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Ze=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);let e=this.fn(t);return this.cache.set(t,e),e}},M=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(an(t),e)}static createFromParsedTheme(t,e){return ln(t,e)}_cachedMatchRoot=new Ze((t)=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;let e=t.scopeName,r=this._cachedMatchRoot.get(e).find((s)=>sn(t.parent,s.parentScopes));if(!r)return null;return new et(r.fontStyle,r.foreground,r.background)}},be=class t{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(let r of n)e=new t(e,r);return e}static from(...e){let n=null;for(let r=0;r<e.length;r++)n=new t(n,e[r]);return n}push(e){return new t(this,e)}getSegments(){let e=this,n=[];while(e)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){if(this===e)return!0;if(this.parent===null)return!1;return this.parent.extends(e)}getExtensionIfDefined(e){let n=[],r=this;while(r&&r!==e)n.push(r.scopeName),r=r.parent;return r===e?n.reverse():void 0}};function sn(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let r=e[n],s=!1;if(r===">"){if(n===e.length-1)return!1;r=e[++n],s=!0}while(t){if(on(t.scopeName,r))break;if(s)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function on(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var et=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function an(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],r=0;for(let s=0,i=e.length;s<i;s++){let o=e[s];if(!o.settings)continue;let a;if(typeof o.scope==="string"){let h=o.scope;h=h.replace(/^[,]+/,""),h=h.replace(/[,]+$/,""),a=h.split(",")}else if(Array.isArray(o.scope))a=o.scope;else a=[""];let c=-1;if(typeof o.settings.fontStyle==="string"){c=0;let h=o.settings.fontStyle.split(" ");for(let d=0,f=h.length;d<f;d++)switch(h[d]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let l=null;if(typeof o.settings.foreground==="string"&&Fe(o.settings.foreground))l=o.settings.foreground;let u=null;if(typeof o.settings.background==="string"&&Fe(o.settings.background))u=o.settings.background;for(let h=0,d=a.length;h<d;h++){let m=a[h].trim().split(" "),y=m[m.length-1],_=null;if(m.length>1)_=m.slice(0,m.length-1),_.reverse();n[r++]=new cn(y,_,s,c,l,u)}}return n}var cn=class{constructor(t,e,n,r,s,i){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=r,this.foreground=s,this.background=i}},k=((t)=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(k||{});function ln(t,e){t.sort((c,l)=>{let u=Je(c.scope,l.scope);if(u!==0)return u;if(u=Qe(c.parentScopes,l.parentScopes),u!==0)return u;return c.index-l.index});let n=0,r="#000000",s="#ffffff";while(t.length>=1&&t[0].scope===""){let c=t.shift();if(c.fontStyle!==-1)n=c.fontStyle;if(c.foreground!==null)r=c.foreground;if(c.background!==null)s=c.background}let i=new un(e),o=new et(n,i.getId(r),i.getId(s)),a=new dn(new we(0,null,-1,0,0),[]);for(let c=0,l=t.length;c<l;c++){let u=t[c];a.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new M(i,o,a)}var un=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},hn=Object.freeze([]),we=class t{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,r,s,i){this.scopeDepth=e,this.parentScopes=n||hn,this.fontStyle=r,this.foreground=s,this.background=i}clone(){return new t(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let r=0,s=e.length;r<s;r++)n[r]=e[r].clone();return n}acceptOverwrite(e,n,r,s){if(this.scopeDepth>e)console.log("how did this happen?");else this.scopeDepth=e;if(n!==-1)this.fontStyle=n;if(r!==0)this.foreground=r;if(s!==0)this.background=s}},dn=class t{constructor(e,n=[],r={}){this._mainRule=e,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let r=0,s=0;while(!0){if(e.parentScopes[r]===">")r++;if(n.parentScopes[s]===">")s++;if(r>=e.parentScopes.length||s>=n.parentScopes.length)break;let i=n.parentScopes[s].length-e.parentScopes[r].length;if(i!==0)return i;r++,s++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),s,i;if(r===-1)s=e,i="";else s=e.substring(0,r),i=e.substring(r+1);if(this._children.hasOwnProperty(s))return this._children[s].match(i)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(t._cmpBySpecificity),n}insert(e,n,r,s,i,o){if(n===""){this._doInsertHere(e,r,s,i,o);return}let a=n.indexOf("."),c,l;if(a===-1)c=n,l="";else c=n.substring(0,a),l=n.substring(a+1);let u;if(this._children.hasOwnProperty(c))u=this._children[c];else u=new t(this._mainRule.clone(),we.cloneArr(this._rulesWithParentScopes)),this._children[c]=u;u.insert(e+1,l,r,s,i,o)}_doInsertHere(e,n,r,s,i){if(n===null){this._mainRule.acceptOverwrite(e,r,s,i);return}for(let o=0,a=this._rulesWithParentScopes.length;o<a;o++){let c=this._rulesWithParentScopes[o];if(Qe(c.parentScopes,n)===0){c.acceptOverwrite(e,r,s,i);return}}if(r===-1)r=this._mainRule.fontStyle;if(s===0)s=this._mainRule.foreground;if(i===0)i=this._mainRule.background;this._rulesWithParentScopes.push(new we(e,n,r,s,i))}},x=class t{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){let n=t.getLanguageId(e),r=t.getTokenType(e),s=t.getFontStyle(e),i=t.getForeground(e),o=t.getBackground(e);console.log({languageId:n,tokenType:r,fontStyle:s,foreground:i,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,r,s,i,o,a){let c=t.getLanguageId(e),l=t.getTokenType(e),u=t.containsBalancedBrackets(e)?1:0,h=t.getFontStyle(e),d=t.getForeground(e),f=t.getBackground(e);if(n!==0)c=n;if(r!==8)l=gn(r);if(s!==null)u=s?1:0;if(i!==-1)h=i;if(o!==0)d=o;if(a!==0)f=a;return(c<<0|l<<8|u<<10|h<<11|d<<15|f<<24)>>>0}};function mn(t){return t}function gn(t){return t}function X(t,e){let n=[],r=pn(t),s=r.next();while(s!==null){let c=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let l=o();if(n.push({matcher:l,priority:c}),s!==",")break;s=r.next()}return n;function i(){if(s==="-"){s=r.next();let c=i();return(l)=>!!c&&!c(l)}if(s==="("){s=r.next();let c=a();if(s===")")s=r.next();return c}if(De(s)){let c=[];do c.push(s),s=r.next();while(De(s));return(l)=>e(c,l)}return null}function o(){let c=[],l=i();while(l)c.push(l),l=i();return(u)=>c.every((h)=>h(u))}function a(){let c=[],l=o();while(l){if(c.push(l),s==="|"||s===",")do s=r.next();while(s==="|"||s===",");else break;l=o()}return(u)=>c.some((h)=>h(u))}}function De(t){return!!t&&!!t.match(/[\w\.:]+/)}function pn(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;let r=n[0];return n=e.exec(t),r}}}function tt(t){if(typeof t.dispose==="function")t.dispose()}var j=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},_n=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},yn=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){let e=t.toKey();if(this._seenReferenceKeys.has(e))return;this._seenReferenceKeys.add(e),this._references.push(t)}},bn=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new j(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let t=this.Q;this.Q=[];let e=new yn;for(let n of t)Sn(n,this.initialScopeName,this.repo,e);for(let n of e.references)if(n instanceof j){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName))continue;if(this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Sn(t,e,n,r){let s=n.lookup(t.scopeName);if(!s){if(t.scopeName===e)throw Error(`No grammar provided for <${e}>`);return}let i=n.lookup(e);if(t instanceof j)Q({baseGrammar:i,selfGrammar:s},r);else Ce(t.ruleName,{baseGrammar:i,selfGrammar:s,repository:s.repository},r);let o=n.injections(t.scopeName);if(o)for(let a of o)r.add(new j(a))}function Ce(t,e,n){if(e.repository&&e.repository[t]){let r=e.repository[t];Z([r],e,n)}}function Q(t,e){if(t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns))Z(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e);if(t.selfGrammar.injections)Z(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function Z(t,e,n){for(let r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let s=r.repository?Ve({},e.repository,r.repository):e.repository;if(Array.isArray(r.patterns))Z(r.patterns,{...e,repository:s},n);let i=r.include;if(!i)continue;let o=nt(i);switch(o.kind){case 0:Q({...e,selfGrammar:e.baseGrammar},n);break;case 1:Q(e,n);break;case 2:Ce(o.ruleName,{...e,repository:s},n);break;case 3:case 4:let a=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(a){let c={baseGrammar:e.baseGrammar,selfGrammar:a,repository:s};if(o.kind===4)Ce(o.ruleName,c,n);else Q(c,n)}else if(o.kind===4)n.add(new _n(o.scopeName,o.ruleName));else n.add(new j(o.scopeName));break}}}var wn=class{kind=0},Cn=class{kind=1},kn=class{constructor(t){this.ruleName=t}kind=2},Rn=class{constructor(t){this.scopeName=t}kind=3},Nn=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function nt(t){if(t==="$base")return new wn;else if(t==="$self")return new Cn;let e=t.indexOf("#");if(e===-1)return new Rn(t);else if(e===0)return new kn(t.substring(1));else{let n=t.substring(0,e),r=t.substring(e+1);return new Nn(n,r)}}var Tn=/\\(\d+)/,We=/\\(\d+)/g,ws=Symbol("RuleId"),vn=-1,rt=-2;function st(t){return t}function it(t){return t}var W=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,r){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=J.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=J.hasCaptures(this._contentName)}get debugName(){let t=this.$location?`${Ye(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){if(!this._nameIsCapturing||this._name===null||t===null||e===null)return this._name;return J.replaceCaptures(this._name,t,e)}getContentName(t,e){if(!this._contentNameIsCapturing||this._contentName===null)return this._contentName;return J.replaceCaptures(this._contentName,t,e)}},An=class extends W{retokenizeCapturedWithRuleId;constructor(t,e,n,r,s){super(t,e,n,r);this.retokenizeCapturedWithRuleId=s}dispose(){}collectPatterns(t,e){throw Error("Not supported!")}compile(t,e){throw Error("Not supported!")}compileAG(t,e,n,r){throw Error("Not supported!")}},En=class extends W{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,r,s){super(t,e,n,null);this._match=new F(r,this.id),this.captures=s,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns)this._cachedCompiledPatterns=new D,this.collectPatterns(t,this._cachedCompiledPatterns);return this._cachedCompiledPatterns}},He=class extends W{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,s){super(t,e,n,r);this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}collectPatterns(t,e){for(let n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns)this._cachedCompiledPatterns=new D,this.collectPatterns(t,this._cachedCompiledPatterns);return this._cachedCompiledPatterns}},ke=class extends W{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,s,i,o,a,c,l){super(t,e,n,r);this._begin=new F(s,this.id),this.beginCaptures=i,this._end=new F(o?o:"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=a,this.applyEndPatternLast=c||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,r)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new D;for(let n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);if(this.applyEndPatternLast)this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end);else this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}if(this._end.hasBackReferences)if(this.applyEndPatternLast)this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e);else this._cachedCompiledPatterns.setSource(0,e);return this._cachedCompiledPatterns}},ee=class extends W{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,r,s,i,o,a,c){super(t,e,n,r);this._begin=new F(s,this.id),this.beginCaptures=i,this.whileCaptures=a,this._while=new F(o,rt),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){if(this._cachedCompiledPatterns)this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null;if(this._cachedCompiledWhilePatterns)this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new D;for(let e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,r){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,r)}_getCachedCompiledWhilePatterns(t,e){if(!this._cachedCompiledWhilePatterns)this._cachedCompiledWhilePatterns=new D,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while);if(this._while.hasBackReferences)this._cachedCompiledWhilePatterns.setSource(0,e?e:"");return this._cachedCompiledWhilePatterns}},ot=class t{static createCaptureRule(e,n,r,s,i){return e.registerRule((o)=>new An(n,o,r,s,i))}static getCompiledRuleId(e,n,r){if(!e.id)n.registerRule((s)=>{if(e.id=s,e.match)return new En(e.$vscodeTextmateLocation,e.id,e.name,e.match,t._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){if(e.repository)r=Ve({},r,e.repository);let i=e.patterns;if(typeof i>"u"&&e.include)i=[{include:e.include}];return new He(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,t._compilePatterns(i,n,r))}if(e.while)return new ee(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,t._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,t._compileCaptures(e.whileCaptures||e.captures,n,r),t._compilePatterns(e.patterns,n,r));return new ke(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,t._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,t._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,t._compilePatterns(e.patterns,n,r))});return e.id}static _compileCaptures(e,n,r){let s=[];if(e){let i=0;for(let o in e){if(o==="$vscodeTextmateLocation")continue;let a=parseInt(o,10);if(a>i)i=a}for(let o=0;o<=i;o++)s[o]=null;for(let o in e){if(o==="$vscodeTextmateLocation")continue;let a=parseInt(o,10),c=0;if(e[o].patterns)c=t.getCompiledRuleId(e[o],n,r);s[a]=t.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,c)}}return s}static _compilePatterns(e,n,r){let s=[];if(e)for(let i=0,o=e.length;i<o;i++){let a=e[i],c=-1;if(a.include){let l=nt(a.include);switch(l.kind){case 0:case 1:c=t.getCompiledRuleId(r[a.include],n,r);break;case 2:let u=r[l.ruleName];if(u)c=t.getCompiledRuleId(u,n,r);break;case 3:case 4:let h=l.scopeName,d=l.kind===4?l.ruleName:null,f=n.getExternalGrammar(h,r);if(f)if(d){let m=f.repository[d];if(m)c=t.getCompiledRuleId(m,n,f.repository)}else c=t.getCompiledRuleId(f.repository.$self,n,f.repository);break}}else c=t.getCompiledRuleId(a,n,r);if(c!==-1){let l=n.getRule(c),u=!1;if(l instanceof He||l instanceof ke||l instanceof ee){if(l.hasMissingPatterns&&l.patterns.length===0)u=!0}if(u)continue;s.push(c)}}return{patterns:s,hasMissingPatterns:(e?e.length:0)!==s.length}}},F=class t{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e==="string"){let r=e.length,s=0,i=[],o=!1;for(let a=0;a<r;a++)if(e.charAt(a)==="\\"){if(a+1<r){let l=e.charAt(a+1);if(l==="z")i.push(e.substring(s,a)),i.push("$(?!\\n)(?<!\\n)"),s=a+2;else if(l==="A"||l==="G")o=!0;a++}}if(this.hasAnchor=o,s===0)this.source=e;else i.push(e.substring(s,r)),this.source=i.join("")}else this.hasAnchor=!1,this.source=e;if(this.hasAnchor)this._anchorCache=this._buildAnchorCache();else this._anchorCache=null;if(this.ruleId=n,typeof this.source==="string")this.hasBackReferences=Tn.test(this.source);else this.hasBackReferences=!1}clone(){return new t(this.source,this.ruleId)}setSource(e){if(this.source===e)return;if(this.source=e,this.hasAnchor)this._anchorCache=this._buildAnchorCache()}resolveBackReferences(e,n){if(typeof this.source!=="string")throw Error("This method should only be called if the source is a string");let r=n.map((s)=>e.substring(s.start,s.end));return We.lastIndex=0,this.source.replace(We,(s,i)=>Xe(r[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!=="string")throw Error("This method should only be called if the source is a string");let e=[],n=[],r=[],s=[],i,o,a,c;for(i=0,o=this.source.length;i<o;i++)if(a=this.source.charAt(i),e[i]=a,n[i]=a,r[i]=a,s[i]=a,a==="\\"){if(i+1<o){if(c=this.source.charAt(i+1),c==="A")e[i+1]="",n[i+1]="",r[i+1]="A",s[i+1]="A";else if(c==="G")e[i+1]="",n[i+1]="G",r[i+1]="",s[i+1]="G";else e[i+1]=c,n[i+1]=c,r[i+1]=c,s[i+1]=c;i++}}return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:s.join("")}}resolveAnchors(e,n){if(!this.hasAnchor||!this._anchorCache||typeof this.source!=="string")return this.source;if(e)if(n)return this._anchorCache.A1_G1;else return this._anchorCache.A1_G0;else if(n)return this._anchorCache.A0_G1;else return this._anchorCache.A0_G0}},D=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){if(this._cached)this._cached.dispose(),this._cached=null;if(this._anchorCache.A0_G0)this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null;if(this._anchorCache.A0_G1)this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null;if(this._anchorCache.A1_G0)this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null;if(this._anchorCache.A1_G1)this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){if(this._items[t].source!==e)this._disposeCaches(),this._items[t].setSource(e)}compile(t){if(!this._cached){let e=this._items.map((n)=>n.source);this._cached=new qe(t,e,this._items.map((n)=>n.ruleId))}return this._cached}compileAG(t,e,n){if(!this._hasAnchors)return this.compile(t);else if(e)if(n){if(!this._anchorCache.A1_G1)this._anchorCache.A1_G1=this._resolveAnchors(t,e,n);return this._anchorCache.A1_G1}else{if(!this._anchorCache.A1_G0)this._anchorCache.A1_G0=this._resolveAnchors(t,e,n);return this._anchorCache.A1_G0}else if(n){if(!this._anchorCache.A0_G1)this._anchorCache.A0_G1=this._resolveAnchors(t,e,n);return this._anchorCache.A0_G1}else{if(!this._anchorCache.A0_G0)this._anchorCache.A0_G0=this._resolveAnchors(t,e,n);return this._anchorCache.A0_G0}}_resolveAnchors(t,e,n){let r=this._items.map((s)=>s.resolveAnchors(e,n));return new qe(t,r,this._items.map((s)=>s.ruleId))}},qe=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}scanner;dispose(){if(typeof this.scanner.dispose==="function")this.scanner.dispose()}toString(){let t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
|
|
2
2
|
`)}findNextMatchSync(t,e,n){let r=this.scanner.findNextMatchSync(t,e,n);if(!r)return null;return{ruleId:this.rules[r.index],captureIndices:r.captureIndices}}},Se=class{constructor(t,e){this.languageId=t,this.tokenType=e}},xn=class t{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,n){this._defaultAttributes=new Se(e,8),this._embeddedLanguagesMatcher=new In(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){if(e===null)return t._NULL_SCOPE_METADATA;return this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new Se(0,0);_getBasicScopeAttributes=new Ze((e)=>{let n=this._scopeToLanguage(e),r=this._toStandardTokenType(e);return new Se(n,r)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){let n=e.match(t.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},In=class{values;scopesRegExp;constructor(t){if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);let e=t.map(([n,r])=>Xe(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;let e=t.match(this.scopesRegExp);if(!e)return;return this.values.get(e[1])}},Cs={InDebugMode:typeof process<"u"&&!!process.env.VSCODE_TEXTMATE_DEBUG},at=!1,ze=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function ct(t,e,n,r,s,i,o,a){let c=e.content.length,l=!1,u=-1;if(o){let f=Ln(t,e,n,r,s,i);s=f.stack,r=f.linePos,n=f.isFirstLine,u=f.anchorPosition}let h=Date.now();while(!l){if(a!==0){if(Date.now()-h>a)return new ze(s,!0)}d()}return new ze(s,!1);function d(){let f=Pn(t,e,n,r,s,u);if(!f){i.produce(s,c),l=!0;return}let{captureIndices:m,matchedRuleId:y}=f,_=m&&m.length>0?m[0].end>r:!1;if(y===vn){let p=s.getRule(t);i.produce(s,m[0].start),s=s.withContentNameScopesList(s.nameScopesList),B(t,e,n,s,i,p.endCaptures,m),i.produce(s,m[0].end);let g=s;if(s=s.parent,u=g.getAnchorPos(),!_&&g.getEnterPos()===r){s=g,i.produce(s,c),l=!0;return}}else{let p=t.getRule(y);i.produce(s,m[0].start);let g=s,b=p.getName(e.content,m),C=s.contentNameScopesList.pushAttributed(b,t);if(s=s.push(y,r,u,m[0].end===c,null,C,C),p instanceof ke){let R=p;B(t,e,n,s,i,R.beginCaptures,m),i.produce(s,m[0].end),u=m[0].end;let N=R.getContentName(e.content,m),E=C.pushAttributed(N,t);if(s=s.withContentNameScopesList(E),R.endHasBackReferences)s=s.withEndRule(R.getEndWithResolvedBackReferences(e.content,m));if(!_&&g.hasSameRuleAs(s)){s=s.pop(),i.produce(s,c),l=!0;return}}else if(p instanceof ee){let R=p;B(t,e,n,s,i,R.beginCaptures,m),i.produce(s,m[0].end),u=m[0].end;let N=R.getContentName(e.content,m),E=C.pushAttributed(N,t);if(s=s.withContentNameScopesList(E),R.whileHasBackReferences)s=s.withEndRule(R.getWhileWithResolvedBackReferences(e.content,m));if(!_&&g.hasSameRuleAs(s)){s=s.pop(),i.produce(s,c),l=!0;return}}else if(B(t,e,n,s,i,p.captures,m),i.produce(s,m[0].end),s=s.pop(),!_){s=s.safePop(),i.produce(s,c),l=!0;return}}if(m[0].end>r)r=m[0].end,n=!1}}function Ln(t,e,n,r,s,i){let o=s.beginRuleCapturedEOL?0:-1,a=[];for(let c=s;c;c=c.pop()){let l=c.getRule(t);if(l instanceof ee)a.push({rule:l,stack:c})}for(let c=a.pop();c;c=a.pop()){let{ruleScanner:l,findOptions:u}=$n(c.rule,t,c.stack.endRule,n,r===o),h=l.findNextMatchSync(e,r,u);if(h){if(h.ruleId!==rt){s=c.stack.pop();break}if(h.captureIndices&&h.captureIndices.length){if(i.produce(c.stack,h.captureIndices[0].start),B(t,e,n,c.stack,i,c.rule.whileCaptures,h.captureIndices),i.produce(c.stack,h.captureIndices[0].end),o=h.captureIndices[0].end,h.captureIndices[0].end>r)r=h.captureIndices[0].end,n=!1}}else{s=c.stack.pop();break}}return{stack:s,linePos:r,anchorPosition:o,isFirstLine:n}}function Pn(t,e,n,r,s,i){let o=Gn(t,e,n,r,s,i),a=t.getInjections();if(a.length===0)return o;let c=Bn(a,t,e,n,r,s,i);if(!c)return o;if(!o)return c;let l=o.captureIndices[0].start,u=c.captureIndices[0].start;if(u<l||c.priorityMatch&&u===l)return c;return o}function Gn(t,e,n,r,s,i){let o=s.getRule(t),{ruleScanner:a,findOptions:c}=lt(o,t,s.endRule,n,r===i),l=a.findNextMatchSync(e,r,c);if(l)return{captureIndices:l.captureIndices,matchedRuleId:l.ruleId};return null}function Bn(t,e,n,r,s,i,o){let a=Number.MAX_VALUE,c=null,l,u=0,h=i.contentNameScopesList.getScopeNames();for(let d=0,f=t.length;d<f;d++){let m=t[d];if(!m.matcher(h))continue;let y=e.getRule(m.ruleId),{ruleScanner:_,findOptions:p}=lt(y,e,null,r,s===o),g=_.findNextMatchSync(n,s,p);if(!g)continue;let b=g.captureIndices[0].start;if(b>=a)continue;if(a=b,c=g.captureIndices,l=g.ruleId,u=m.priority,a===s)break}if(c)return{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l};return null}function lt(t,e,n,r,s){if(at){let o=t.compile(e,n),a=ut(r,s);return{ruleScanner:o,findOptions:a}}return{ruleScanner:t.compileAG(e,n,r,s),findOptions:0}}function $n(t,e,n,r,s){if(at){let o=t.compileWhile(e,n),a=ut(r,s);return{ruleScanner:o,findOptions:a}}return{ruleScanner:t.compileWhileAG(e,n,r,s),findOptions:0}}function ut(t,e){let n=0;if(!t)n|=1;if(!e)n|=4;return n}function B(t,e,n,r,s,i,o){if(i.length===0)return;let a=e.content,c=Math.min(i.length,o.length),l=[],u=o[0].end;for(let h=0;h<c;h++){let d=i[h];if(d===null)continue;let f=o[h];if(f.length===0)continue;if(f.start>u)break;while(l.length>0&&l[l.length-1].endPos<=f.start)s.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0)s.produceFromScopes(l[l.length-1].scopes,f.start);else s.produce(r,f.start);if(d.retokenizeCapturedWithRuleId){let y=d.getName(a,o),_=r.contentNameScopesList.pushAttributed(y,t),p=d.getContentName(a,o),g=_.pushAttributed(p,t),b=r.push(d.retokenizeCapturedWithRuleId,f.start,-1,!1,null,_,g),C=t.createOnigString(a.substring(0,f.end));ct(t,C,n&&f.start===0,f.start,b,s,!1,0),tt(C);continue}let m=d.getName(a,o);if(m!==null){let _=(l.length>0?l[l.length-1].scopes:r.contentNameScopesList).pushAttributed(m,t);l.push(new Mn(_,f.end))}}while(l.length>0)s.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var Mn=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function jn(t,e,n,r,s,i,o,a){return new Dn(t,e,n,r,s,i,o,a)}function Ue(t,e,n,r,s){let i=X(e,te),o=ot.getCompiledRuleId(n,r,s.repository);for(let a of i)t.push({debugSelector:e,matcher:a.matcher,ruleId:o,grammar:s,priority:a.priority})}function te(t,e){if(e.length<t.length)return!1;let n=0;return t.every((r)=>{for(let s=n;s<e.length;s++)if(Fn(e[s],r))return n=s+1,!0;return!1})}function Fn(t,e){if(!t)return!1;if(t===e)return!0;let n=e.length;return t.length>n&&t.substr(0,n)===e&&t[n]==="."}var Dn=class{constructor(t,e,n,r,s,i,o,a){if(this._rootScopeName=t,this.balancedBracketSelectors=i,this._onigLib=a,this._basicScopeAttributesProvider=new xn(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Ke(e,null),this._injections=null,this._tokenTypeMatchers=[],s)for(let c of Object.keys(s)){let l=X(c,te);for(let u of l)this._tokenTypeMatchers.push({matcher:u.matcher,type:s[c]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let t of this._ruleId2desc)if(t)t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){let t={lookup:(s)=>{if(s===this._rootScopeName)return this._grammar;return this.getExternalGrammar(s)},injections:(s)=>this._grammarRepository.injections(s)},e=[],n=this._rootScopeName,r=t.lookup(n);if(r){let s=r.injections;if(s)for(let o in s)Ue(e,o,s[o],this,r);let i=this._grammarRepository.injections(n);if(i)i.forEach((o)=>{let a=this.getExternalGrammar(o);if(a){let c=a.injectionSelector;if(c)Ue(e,c,a,this,a)}})}return e.sort((s,i)=>s.priority-i.priority),e}getInjections(){if(this._injections===null)this._injections=this._collectInjections();return this._injections}registerRule(t){let e=++this._lastRuleId,n=t(st(e));return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[it(t)]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];else if(this._grammarRepository){let n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=Ke(n,e&&e.$base),this._includedGrammars[t]}return}tokenizeLine(t,e,n=0){let r=this._tokenize(t,e,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(t,e,n=0){let r=this._tokenize(t,e,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(t,e,n,r){if(this._rootId===-1)this._rootId=ot.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections();let s;if(!e||e===Re.NULL){s=!0;let l=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),h=x.set(0,l.languageId,l.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),d=this.getRule(this._rootId).getName(null,null),f;if(d)f=O.createRootAndLookUpScopeName(d,h,this);else f=O.createRoot("unknown",h);e=new Re(null,this._rootId,-1,-1,!1,null,f,f)}else s=!1,e.reset();t=t+`
|
|
3
3
|
`;let i=this.createOnigString(t),o=i.content.length,a=new Hn(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),c=ct(this,i,s,0,e,a,!0,r);return tt(i),{lineLength:o,lineTokens:a,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Ke(t,e){return t=tn(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var O=class t{constructor(e,n,r){this.parent=e,this.scopePath=n,this.tokenAttributes=r}static fromExtension(e,n){let r=e,s=e?.scopePath??null;for(let i of n)s=be.push(s,i.scopeNames),r=new t(r,s,i.encodedTokenAttributes);return r}static createRoot(e,n){return new t(null,new be(null,e),n)}static createRootAndLookUpScopeName(e,n,r){let s=r.getMetadataForScope(e),i=new be(null,e),o=r.themeProvider.themeMatch(i),a=t.mergeAttributes(n,s,o);return new t(null,i,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return t.equals(this,e)}static equals(e,n){do{if(e===n)return!0;if(!e&&!n)return!0;if(!e||!n)return!1;if(e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}while(!0)}static mergeAttributes(e,n,r){let s=-1,i=0,o=0;if(r!==null)s=r.fontStyle,i=r.foregroundId,o=r.backgroundId;return x.set(e,n.languageId,n.tokenType,null,s,i,o)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return t._pushAttributed(this,e,n);let r=e.split(/ /g),s=this;for(let i of r)s=t._pushAttributed(s,i,n);return s}static _pushAttributed(e,n,r){let s=r.getMetadataForScope(n),i=e.scopePath.push(n),o=r.themeProvider.themeMatch(i),a=t.mergeAttributes(e.tokenAttributes,s,o);return new t(e,i,a)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){let n=[],r=this;while(r&&r!==e)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===e?n.reverse():void 0}},Re=class t{constructor(e,n,r,s,i,o,a,c){this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=o,this.nameScopesList=a,this.contentNameScopesList=c,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=s}_stackElementBrand=void 0;static NULL=new t(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){if(e===null)return!1;return t._equals(this,e)}static _equals(e,n){if(e===n)return!0;if(!this._structuralEquals(e,n))return!1;return O.equals(e.contentNameScopesList,n.contentNameScopesList)}static _structuralEquals(e,n){do{if(e===n)return!0;if(!e&&!n)return!0;if(!e||!n)return!1;if(e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){while(e)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){t._reset(this)}pop(){return this.parent}safePop(){if(this.parent)return this.parent;return this}push(e,n,r,s,i,o,a){return new t(this,e,n,r,s,i,o,a)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){let e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,n){if(this.parent)n=this.parent._writeString(e,n);return e[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(e){if(this.contentNameScopesList===e)return this;return this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){if(this.endRule===e)return this;return new t(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;while(n&&n._enterPos===e._enterPos){if(n.ruleId===e.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:it(this.ruleId),beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(e,n){let r=O.fromExtension(e?.nameScopesList??null,n.nameScopesList);return new t(e,st(n.ruleId),n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,O.fromExtension(r,n.contentNameScopesList))}},Wn=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap((n)=>{if(n==="*")return this.allowAny=!0,[];return X(n,te).map((r)=>r.matcher)}),this.unbalancedBracketScopes=e.flatMap((n)=>X(n,te).map((r)=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(let e of this.unbalancedBracketScopes)if(e(t))return!1;for(let e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},Hn=class{constructor(t,e,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let r=t?.tokenAttributes??0,s=!1;if(this.balancedBracketSelectors?.matchesAlways)s=!0;if(this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let i=t?.getScopeNames()??[];for(let o of this._tokenTypeOverrides)if(o.matcher(i))r=x.set(r,0,mn(o.type),null,-1,0,0);if(this.balancedBracketSelectors)s=this.balancedBracketSelectors.match(i)}if(s)r=x.set(r,0,8,s,-1,0,0);if(this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=e;return}let n=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){if(this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1)this._tokens.pop();if(this._tokens.length===0)this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0;return this._tokens}getBinaryResult(t,e){if(this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1)this._binaryTokens.pop(),this._binaryTokens.pop();if(this._binaryTokens.length===0)this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0;let n=new Uint32Array(this._binaryTokens.length);for(let r=0,s=this._binaryTokens.length;r<s;r++)n[r]=this._binaryTokens[r];return n}},qn=class{constructor(t,e){this._onigLib=e,this._theme=t}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){if(this._rawGrammars.set(t.scopeName,t),e)this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,n,r,s){if(!this._grammars.has(t)){let i=this._rawGrammars.get(t);if(!i)return null;this._grammars.set(t,jn(t,i,e,n,r,s,this,this._onigLib))}return this._grammars.get(t)}},ht=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new qn(M.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,e){this._syncRegistry.setTheme(M.createFromRawTheme(t,e))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,e,n){return this.loadGrammarWithConfiguration(t,e,{embeddedLanguages:n})}loadGrammarWithConfiguration(t,e,n){return this._loadGrammar(t,e,n.embeddedLanguages,n.tokenTypes,new Wn(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,e,n,r,s){let i=new bn(this._syncRegistry,t);while(i.Q.length>0)i.Q.map((o)=>this._loadSingleGrammar(o.scopeName)),i.processQueue();return this._grammarForScopeName(t,e,n,r,s)}_loadSingleGrammar(t){if(!this._ensureGrammarCache.has(t))this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0)}_doLoadSingleGrammar(t){let e=this._options.loadGrammar(t);if(e){let n=typeof this._options.getInjections==="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(e,n)}}addGrammar(t,e=[],n=0,r=null){return this._syncRegistry.addGrammar(t,e),this._grammarForScopeName(t.scopeName,n,r)}_grammarForScopeName(t,e=0,n=null,r=null,s=null){return this._syncRegistry.grammarForScopeName(t,e,n,r,s)}},ne=Re.NULL;function q(t,e){let n=typeof t==="string"?{}:{...t.colorReplacements},r=typeof t==="string"?t:t.name;for(let[s,i]of Object.entries(e?.colorReplacements||{}))if(typeof i==="string")n[s]=i;else if(s===r)Object.assign(n,i);return n}function v(t,e){if(!t)return t;return e?.[t?.toLowerCase()]||t}function pt(t){return Array.isArray(t)?t:[t]}async function Te(t){return Promise.resolve(typeof t==="function"?t():t).then((e)=>e.default||e)}function z(t){return!t||["plaintext","txt","text","plain"].includes(t)}function _t(t){return t==="ansi"||z(t)}function U(t){return t==="none"}function yt(t){return U(t)}var zn=/(\r?\n)/g;function P(t,e=!1){if(t.length===0)return[["",0]];let n=t.split(zn),r=0,s=[];for(let i=0;i<n.length;i+=2){let o=e?n[i]+(n[i+1]||""):n[i];s.push([o,r]),r+=n[i].length,r+=n[i+1]?.length||0}return s}var ft={light:"#333333",dark:"#bbbbbb"},dt={light:"#fffffe",dark:"#1e1e1e"},mt="__shiki_resolved";function re(t){if(t?.[mt])return t;let e={...t};if(e.tokenColors&&!e.settings)e.settings=e.tokenColors,delete e.tokenColors;e.type||="dark",e.colorReplacements={...e.colorReplacements},e.settings||=[];let{bg:n,fg:r}=e;if(!n||!r){let a=e.settings?e.settings.find((c)=>!c.name&&!c.scope):void 0;if(a?.settings?.foreground)r=a.settings.foreground;if(a?.settings?.background)n=a.settings.background;if(!r&&e?.colors?.["editor.foreground"])r=e.colors["editor.foreground"];if(!n&&e?.colors?.["editor.background"])n=e.colors["editor.background"];if(!r)r=e.type==="light"?ft.light:ft.dark;if(!n)n=e.type==="light"?dt.light:dt.dark;e.fg=r,e.bg=n}if(!(e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope))e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let s=0,i=new Map;function o(a){if(i.has(a))return i.get(a);s+=1;let c=`#${s.toString(16).padStart(8,"0").toLowerCase()}`;if(e.colorReplacements?.[`#${c}`])return o(a);return i.set(a,c),c}e.settings=e.settings.map((a)=>{let c=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),l=a.settings?.background&&!a.settings.background.startsWith("#");if(!c&&!l)return a;let u={...a,settings:{...a.settings}};if(c){let h=o(a.settings.foreground);e.colorReplacements[h]=a.settings.foreground,u.settings.foreground=h}if(l){let h=o(a.settings.background);e.colorReplacements[h]=a.settings.background,u.settings.background=h}return u});for(let a of Object.keys(e.colors||{}))if(a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi")){if(!e.colors[a]?.startsWith("#")){let c=o(e.colors[a]);e.colorReplacements[c]=e.colors[a],e.colors[a]=c}}return Object.defineProperty(e,mt,{enumerable:!1,writable:!1,value:!0}),e}async function bt(t){return[...new Set((await Promise.all(t.filter((e)=>!_t(e)).map(async(e)=>await Te(e).then((n)=>Array.isArray(n)?n:[n])))).flat())]}async function St(t){return(await Promise.all(t.map(async(e)=>yt(e)?null:re(await Te(e))))).filter((e)=>!!e)}function wt(t,e){if(!e)return t;if(e[t]){let n=new Set([t]);while(e[t]){if(t=e[t],n.has(t))throw new S(`Circular alias \`${[...n].join(" -> ")} -> ${t}\``);n.add(t)}}return t}var Un=class extends ht{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(t,e,n,r={}){super(t);this._resolver=t,this._themes=e,this._langs=n,this._alias=r,this._themes.map((s)=>this.loadTheme(s)),this.loadLanguages(this._langs)}getTheme(t){if(typeof t==="string")return this._resolvedThemes.get(t);else return this.loadTheme(t)}loadTheme(t){let e=re(t);if(e.name)this._resolvedThemes.set(e.name,e),this._loadedThemesCache=null;return e}getLoadedThemes(){if(!this._loadedThemesCache)this._loadedThemesCache=[...this._resolvedThemes.keys()];return this._loadedThemesCache}setTheme(t){let e=this._textmateThemeCache.get(t);if(!e)e=M.createFromRawTheme(t),this._textmateThemeCache.set(t,e);this._syncRegistry.setTheme(e)}getGrammar(t){return t=wt(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;let e=new Set([...this._langMap.values()].filter((s)=>s.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);let n={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);let r=this.loadGrammarWithConfiguration(t.scopeName,1,n);if(r.name=t.name,this._resolvedGrammars.set(t.name,r),t.aliases)t.aliases.forEach((s)=>{this._alias[s]=t.name});if(this._loadedLanguagesCache=null,e.size)for(let s of e)this._resolvedGrammars.delete(s.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(s.scopeName),this._syncRegistry?._grammars?.delete(s.scopeName),this.loadLanguage(this._langMap.get(s.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(let r of t)this.resolveEmbeddedLanguages(r);let e=[...this._langGraph.entries()],n=e.filter(([r,s])=>!s);if(n.length){let r=e.filter(([s,i])=>{if(!i)return!1;return(i.embeddedLanguages||i.embeddedLangs)?.some((o)=>n.map(([a])=>a).includes(o))}).filter((s)=>!n.includes(s));throw new S(`Missing languages ${n.map(([s])=>`\`${s}\``).join(", ")}, required by ${r.map(([s])=>`\`${s}\``).join(", ")}`)}for(let[r,s]of e)this._resolver.addLanguage(s);for(let[r,s]of e)this.loadLanguage(s)}getLoadedLanguages(){if(!this._loadedLanguagesCache)this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])];return this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);let e=t.embeddedLanguages??t.embeddedLangs;if(e)for(let n of e)this._langGraph.set(n,this._langMap.get(n))}},Kn=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,e){this._onigLib={createOnigScanner:(n)=>t.createScanner(n),createOnigString:(n)=>t.createString(n)},e.forEach((n)=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){if(this._langs.set(t.name,t),t.aliases)t.aliases.forEach((e)=>{this._langs.set(e,t)});if(this._scopeToLang.set(t.scopeName,t),t.injectTo)t.injectTo.forEach((e)=>{if(!this._injections.get(e))this._injections.set(e,[]);this._injections.get(e).push(t.scopeName)})}getInjections(t){let e=t.split("."),n=[];for(let r=1;r<=e.length;r++){let s=e.slice(0,r).join(".");n=[...n,...this._injections.get(s)||[]]}return n}},H=0;function ve(t){if(H+=1,t.warnings!==!1&&H>=10&&H%10===0)console.warn(`[Shiki] ${H} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let e=!1;if(!t.engine)throw new S("`engine` option is required for synchronous mode");let n=(t.langs||[]).flat(1),r=(t.themes||[]).flat(1).map(re),s=new Un(new Kn(t.engine,n),r,n,t.langAlias),i;function o(g){return wt(g,t.langAlias)}function a(g){_();let b=s.getGrammar(typeof g==="string"?g:g.name);if(!b)throw new S(`Language \`${g}\` not found, you may need to load it first`);return b}function c(g){if(g==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};_();let b=s.getTheme(g);if(!b)throw new S(`Theme \`${g}\` not found, you may need to load it first`);return b}function l(g){_();let b=c(g);if(i!==g)s.setTheme(b),i=g;return{theme:b,colorMap:s.getColorMap()}}function u(){return _(),s.getLoadedThemes()}function h(){return _(),s.getLoadedLanguages()}function d(...g){_(),s.loadLanguages(g.flat(1))}async function f(...g){return d(await bt(g))}function m(...g){_();for(let b of g.flat(1))s.loadTheme(b)}async function y(...g){return _(),m(await St(g))}function _(){if(e)throw new S("Shiki instance has been disposed")}function p(){if(e)return;e=!0,s.dispose(),H-=1}return{setTheme:l,getTheme:c,getLanguage:a,getLoadedThemes:u,getLoadedLanguages:h,resolveLangAlias:o,loadLanguage:f,loadLanguageSync:d,loadTheme:y,loadThemeSync:m,dispose:p,[Symbol.dispose]:p}}async function Ae(t){if(!t.engine)console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[e,n,r]=await Promise.all([St(t.themes||[]),bt(t.langs||[]),t.engine]);return ve({...t,themes:e,langs:n,engine:r})}var Ct=new WeakMap;function K(t,e){Ct.set(t,e)}function G(t){return Ct.get(t)}var se=class t{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,n){return new t(Object.fromEntries(pt(n).map((r)=>[r,ne])),e)}constructor(...e){if(e.length===2){let[n,r]=e;this.lang=r,this._stacks=n}else{let[n,r,s]=e;this.lang=r,this._stacks={[s]:n}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Vn(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Vn(t){let e=[],n=new Set;function r(s){if(n.has(s))return;n.add(s);let i=s?.nameScopesList?.scopeName;if(i)e.push(i);if(s.parent)r(s.parent)}return r(t),e}function Yn(t,e){if(!(t instanceof se))throw new S("Invalid grammar state");return t.getInternalStack(e)}var Jn=/,/,Qn=/ /;function Ee(t,e,n={}){let{theme:r=t.getLoadedThemes()[0]}=n;if(z(t.resolveLangAlias(n.lang||"text"))||U(r))return P(e).map((a)=>[{content:a[0],offset:a[1]}]);let{theme:s,colorMap:i}=t.setTheme(r),o=t.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==o.name)throw new S(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(s.name))throw new S(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return Rt(e,o,s,i,n)}function kt(...t){if(t.length===2)return G(t[1]);let[e,n,r={}]=t,{lang:s="text",theme:i=e.getLoadedThemes()[0]}=r;if(z(s)||U(i))throw new S("Plain language does not have grammar state");if(s==="ansi")throw new S("ANSI language does not have grammar state");let{theme:o,colorMap:a}=e.setTheme(i),c=e.getLanguage(s);return new se(xe(n,c,o,a,r).stateStack,c.name,o.name)}function Rt(t,e,n,r,s){let i=xe(t,e,n,r,s),o=new se(i.stateStack,e.name,n.name);return K(i.tokens,o),i.tokens}function xe(t,e,n,r,s){let i=q(n,s),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500,includeExplanation:c=!1}=s,l=P(t),u=s.grammarState?Yn(s.grammarState,n.name)??ne:s.grammarContextCode!=null?xe(s.grammarContextCode,e,n,r,{...s,grammarState:void 0,grammarContextCode:void 0}).stateStack:ne,h=[],d=[];for(let f=0,m=l.length;f<m;f++){let[y,_]=l[f];if(y===""){h=[],d.push([]);continue}if(o>0&&y.length>=o){h=[],d.push([{content:y,offset:_,color:"",fontStyle:0}]);continue}let p,g,b;if(c&&c!=="tokenType")p=e.tokenizeLine(y,u,a),g=p.tokens,b=0;let C=e.tokenizeLine2(y,u,a),R=C.tokens.length/2;for(let N=0;N<R;N++){let E=C.tokens[2*N],ge=N+1<R?C.tokens[2*N+2]:y.length;if(E===ge)continue;let pe=C.tokens[2*N+1],Zt=v(r[x.getForeground(pe)],i),en=x.getFontStyle(pe),Y={content:y.substring(E,ge),offset:_+E,color:Zt,fontStyle:en};if(c==="tokenType")Y.type=x.getTokenType(pe);else if(c){let Me=[];if(c!=="scopeName")for(let T of n.settings){let L;switch(typeof T.scope){case"string":L=T.scope.split(Jn).map((_e)=>_e.trim());break;case"object":L=T.scope;break;default:continue}Me.push({settings:T,selectors:L.map((_e)=>_e.split(Qn))})}Y.explanation=[];let je=0;while(E+je<ge){let T=g[b],L=y.substring(T.startIndex,T.endIndex);je+=L.length,Y.explanation.push({content:L,scopes:c==="scopeName"?Xn(T.scopes):Zn(Me,T.scopes)}),b+=1}}h.push(Y)}d.push(h),h=[],u=C.ruleStack}return{tokens:d,stateStack:u}}function Xn(t){return t.map((e)=>({scopeName:e}))}function Zn(t,e){let n=[];for(let r=0,s=e.length;r<s;r++){let i=e[r];n[r]={scopeName:i,themeMatches:tr(t,i,e.slice(0,r))}}return n}function gt(t,e){return t===e||e.substring(0,t.length)===t&&e[t.length]==="."}function er(t,e,n){if(!gt(t.at(-1),e))return!1;let r=t.length-2,s=n.length-1;while(r>=0&&s>=0){if(gt(t[r],n[s]))r-=1;s-=1}if(r===-1)return!0;return!1}function tr(t,e,n){let r=[];for(let{selectors:s,settings:i}of t)for(let o of s)if(er(o,e,n)){r.push(i);break}return r}function ie(t,e,n,r=Ee){let s=Object.entries(n.themes).filter((l)=>l[1]).map((l)=>({color:l[0],theme:l[1]})),i=s.map((l)=>{let u=r(t,e,{...n,theme:l.theme});return{tokens:u,state:G(u),theme:typeof l.theme==="string"?l.theme:l.theme.name}}),o=nr(...i.map((l)=>l.tokens)),a=o[0].map((l,u)=>l.map((h,d)=>{let f={content:h.content,variants:{},offset:h.offset};if("includeExplanation"in n&&n.includeExplanation)f.explanation=h.explanation;return o.forEach((m,y)=>{let{content:_,explanation:p,offset:g,...b}=m[u][d];f.variants[s[y].color]=b}),f})),c=i[0].state?new se(Object.fromEntries(i.map((l)=>[l.theme,l.state?.getInternalStack(l.theme)])),i[0].state.lang):void 0;if(c)K(a,c);return a}function nr(...t){let e=t.map(()=>[]),n=t.length;for(let r=0;r<t[0].length;r++){let s=t.map((c)=>c[r]),i=e.map(()=>[]);e.forEach((c,l)=>c.push(i[l]));let o=s.map(()=>0),a=s.map((c)=>c[0]);while(a.every((c)=>c)){let c=Math.min(...a.map((l)=>l.content.length));for(let l=0;l<n;l++){let u=a[l];if(u.content.length===c)i[l].push(u),o[l]+=1,a[l]=s[l][o[l]];else i[l].push({...u,content:u.content.slice(0,c)}),a[l]={...u,content:u.content.slice(c),offset:u.offset+c}}}}return e}var Nt=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];var Tt={}.hasOwnProperty;function vt(t,e){let n=e||{};function r(s,...i){let{invalid:o,handlers:a}=r;if(s&&Tt.call(s,t)){let c=String(s[t]);o=Tt.call(a,c)?a[c]:r.unknown}if(o)return o.call(this,s,...i)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var rr=/["&'<>`]/g,sr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ir=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,or=/[|\\{}()[\]^$+*?.]/g,At=new WeakMap;function Et(t,e){if(t=t.replace(e.subset?ar(e.subset):rr,r),e.subset||e.escapeOnly)return t;return t.replace(sr,n).replace(ir,r);function n(s,i,o){return e.format((s.charCodeAt(0)-55296)*1024+s.charCodeAt(1)-56320+65536,o.charCodeAt(i+2),e)}function r(s,i,o){return e.format(s.charCodeAt(0),o.charCodeAt(i+1),e)}}function ar(t){let e=At.get(t);if(!e)e=cr(t),At.set(t,e);return e}function cr(t){let e=[],n=-1;while(++n<t.length)e.push(t[n].replace(or,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}var lr=/[\dA-Fa-f]/;function xt(t,e,n){let r="&#x"+t.toString(16).toUpperCase();return n&&e&&!lr.test(String.fromCharCode(e))?r:r+";"}var ur=/\d/;function It(t,e,n){let r="&#"+String(t);return n&&e&&!ur.test(String.fromCharCode(e))?r:r+";"}var Lt=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"];var oe={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"};var Pt=["cent","copy","divide","gt","lt","not","para","times"];var Gt={}.hasOwnProperty,Ie={},ae;for(ae in oe)if(Gt.call(oe,ae))Ie[oe[ae]]=ae;var hr=/[^\dA-Za-z]/;function Bt(t,e,n,r){let s=String.fromCharCode(t);if(Gt.call(Ie,s)){let i=Ie[s],o="&"+i;if(n&&Lt.includes(i)&&!Pt.includes(i)&&(!r||e&&e!==61&&hr.test(String.fromCharCode(e))))return o;return o+";"}return""}function Ot(t,e,n){let r=xt(t,e,n.omitOptionalSemicolons),s;if(n.useNamedReferences||n.useShortestReferences)s=Bt(t,e,n.omitOptionalSemicolons,n.attribute);if((n.useShortestReferences||!s)&&n.useShortestReferences){let i=It(t,e,n.omitOptionalSemicolons);if(i.length<r.length)r=i}return s&&(!n.useShortestReferences||s.length<r.length)?s:r}function A(t,e){return Et(t,Object.assign({format:Ot},e))}var fr=/^>|^->|<!--|-->|--!>|<!-$/g,dr=[">"],mr=["<",">"];function $t(t,e,n,r){return r.settings.bogusComments?"<?"+A(t.value,Object.assign({},r.settings.characterReferences,{subset:dr}))+">":"<!--"+t.value.replace(fr,s)+"-->";function s(i){return A(i,Object.assign({},r.settings.characterReferences,{subset:mr}))}}function Mt(t,e,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}var w=jt(1),Le=jt(-1),gr=[];function jt(t){return e;function e(n,r,s){let i=n?n.children:gr,o=(r||0)+t,a=i[o];if(!s)while(a&&fn(a))o+=t,a=i[o];return a}}var pr={}.hasOwnProperty;function ce(t){return e;function e(n,r,s){return pr.call(t,n.tagName)&&t[n.tagName](n,r,s)}}var V=ce({body:yr,caption:Pe,colgroup:Pe,dd:Cr,dt:wr,head:Pe,html:_r,li:Sr,optgroup:kr,option:Rr,p:br,rp:Ft,rt:Ft,tbody:vr,td:Dt,tfoot:Ar,th:Dt,thead:Tr,tr:Er});function Pe(t,e,n){let r=w(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&fn(r.value.charAt(0)))}function _r(t,e,n){let r=w(n,e);return!r||r.type!=="comment"}function yr(t,e,n){let r=w(n,e);return!r||r.type!=="comment"}function br(t,e,n){let r=w(n,e);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function Sr(t,e,n){let r=w(n,e);return!r||r.type==="element"&&r.tagName==="li"}function wr(t,e,n){let r=w(n,e);return Boolean(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Cr(t,e,n){let r=w(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function Ft(t,e,n){let r=w(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function kr(t,e,n){let r=w(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function Rr(t,e,n){let r=w(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Tr(t,e,n){let r=w(n,e);return Boolean(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function vr(t,e,n){let r=w(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Ar(t,e,n){return!w(n,e)}function Er(t,e,n){let r=w(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function Dt(t,e,n){let r=w(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}var Wt=ce({body:Lr,colgroup:Pr,head:Ir,html:xr,tbody:Gr});function xr(t){let e=w(t,-1);return!e||e.type!=="comment"}function Ir(t){let e=new Set;for(let r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}let n=t.children[0];return!n||n.type==="element"}function Lr(t){let e=w(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&fn(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function Pr(t,e,n){let r=Le(n,e),s=w(t,-1,!0);if(n&&r&&r.type==="element"&&r.tagName==="colgroup"&&V(r,n.children.indexOf(r),n))return!1;return Boolean(s&&s.type==="element"&&s.tagName==="col")}function Gr(t,e,n){let r=Le(n,e),s=w(t,-1);if(n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&V(r,n.children.indexOf(r),n))return!1;return Boolean(s&&s.type==="element"&&s.tagName==="tr")}var le={name:[[`
|
|
4
4
|
\f\r &/=>`.split(""),`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s}from"./chunk-
|
|
1
|
+
import{s}from"./chunk-rddft5ce.js";var c=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],vn=s("circle-check",c);
|
|
2
2
|
export{vn};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Nt,gn,Pt,aa}from"./chunk-5nda24gv.js";import{Ot}from"./chunk-h0c42zy3.js";import{zt,Sr,Un,Be,Tr}from"./chunk-
|
|
1
|
+
import{Nt,gn,Pt,aa}from"./chunk-5nda24gv.js";import{Ot}from"./chunk-h0c42zy3.js";import{zt,Sr,Un,Be,Tr}from"./chunk-1s53190z.js";function s(r,n){return r==null||n==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function x(r,n){return r==null||n==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function rr(r){let n,e,t;if(r.length!==2)n=s,e=(f,c)=>s(r(f),c),t=(f,c)=>r(f)-c;else n=r===s||r===x?r:O,e=r,t=r;function o(f,c,i=0,p=f.length){if(i<p){if(n(c,c)!==0)return p;do{let l=i+p>>>1;if(e(f[l],c)<0)i=l+1;else p=l}while(i<p)}return i}function a(f,c,i=0,p=f.length){if(i<p){if(n(c,c)!==0)return p;do{let l=i+p>>>1;if(e(f[l],c)<=0)i=l+1;else p=l}while(i<p)}return i}function u(f,c,i=0,p=f.length){let l=o(f,c,i,p-1);return l>i&&t(f[l-1],c)>-t(f[l],c)?l-1:l}return{left:o,center:u,right:a}}function O(){return 0}function y(r){return r===null?NaN:+r}var V=rr(s),{right:T,left:or}=V,ur=rr(y).center,z=T;var E=Math.sqrt(50),G=Math.sqrt(10),H=Math.sqrt(2);function g(r,n,e){let t=(n-r)/Math.max(0,e),o=Math.floor(Math.log10(t)),a=t/Math.pow(10,o),u=a>=E?10:a>=G?5:a>=H?2:1,f,c,i;if(o<0){if(i=Math.pow(10,-o)/u,f=Math.round(r*i),c=Math.round(n*i),f/i<r)++f;if(c/i>n)--c;i=-i}else{if(i=Math.pow(10,o)*u,f=Math.round(r/i),c=Math.round(n/i),f*i<r)++f;if(c*i>n)--c}if(c<f&&0.5<=e&&e<2)return g(r,n,e*2);return[f,c,i]}function v(r,n,e){if(n=+n,r=+r,e=+e,!(e>0))return[];if(r===n)return[r];let t=n<r,[o,a,u]=t?g(n,r,e):g(r,n,e);if(!(a>=o))return[];let f=a-o+1,c=Array(f);if(t)if(u<0)for(let i=0;i<f;++i)c[i]=(a-i)/-u;else for(let i=0;i<f;++i)c[i]=(a-i)*u;else if(u<0)for(let i=0;i<f;++i)c[i]=(o+i)/-u;else for(let i=0;i<f;++i)c[i]=(o+i)*u;return c}function M(r,n,e){return n=+n,r=+r,e=+e,g(r,n,e)[2]}function Or(r,n,e){n=+n,r=+r,e=+e;let t=n<r,o=t?M(n,r,e):M(r,n,e);return(t?-1:1)*(o<0?1/-o:o)}function N(r,n){if(!n)n=[];var e=r?Math.min(n.length,r.length):0,t=n.slice(),o;return function(a){for(o=0;o<e;++o)t[o]=r[o]*(1-a)+n[o]*a;return t}}function B(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function P(r,n){var e=n?n.length:0,t=r?Math.min(e,r.length):0,o=Array(t),a=Array(e),u;for(u=0;u<t;++u)o[u]=h(r[u],n[u]);for(;u<e;++u)a[u]=n[u];return function(f){for(u=0;u<t;++u)a[u]=o[u](f);return a}}function w(r,n){var e=new Date;return r=+r,n=+n,function(t){return e.setTime(r*(1-t)+n*t),e}}function k(r,n){var e={},t={},o;if(r===null||typeof r!=="object")r={};if(n===null||typeof n!=="object")n={};for(o in n)if(o in r)e[o]=h(r[o],n[o]);else t[o]=n[o];return function(a){for(o in e)t[o]=e[o](a);return t}}function h(r,n){var e=typeof n,t;return n==null||e==="boolean"?Sr(n):(e==="number"?Be:e==="string"?(t=zt(n))?(n=t,Un):Tr:n instanceof zt?Un:n instanceof Date?w:B(n)?N:Array.isArray(n)?P:typeof n.valueOf!=="function"&&typeof n.toString!=="function"||isNaN(n)?k:Be)(r,n)}function A(r,n){return r=+r,n=+n,function(e){return Math.round(r*(1-e)+n*e)}}function R(r){return Math.max(0,-Nt(Math.abs(r)))}function S(r,n){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Nt(n)/3)))*3-Nt(Math.abs(r)))}function j(r,n){return r=Math.abs(r),n=Math.abs(n)-r,Math.max(0,Nt(n)-Nt(r))+1}function F(r){return function(){return r}}function q(r){return+r}var C=[0,1];function d(r){return r}function D(r,n){return(n-=r=+r)?function(e){return(e-r)/n}:F(isNaN(n)?NaN:0.5)}function J(r,n){var e;if(r>n)e=r,r=n,n=e;return function(t){return Math.max(r,Math.min(n,t))}}function K(r,n,e){var t=r[0],o=r[1],a=n[0],u=n[1];if(o<t)t=D(o,t),a=e(u,a);else t=D(t,o),a=e(a,u);return function(f){return a(t(f))}}function Q(r,n,e){var t=Math.min(r.length,n.length)-1,o=Array(t),a=Array(t),u=-1;if(r[t]<r[0])r=r.slice().reverse(),n=n.slice().reverse();while(++u<t)o[u]=D(r[u],r[u+1]),a[u]=e(n[u],n[u+1]);return function(f){var c=z(r,f,1,t)-1;return a[c](o[c](f))}}function ra(r,n){return n.domain(r.domain()).range(r.range()).interpolate(r.interpolate()).clamp(r.clamp()).unknown(r.unknown())}function U(){var r=C,n=C,e=h,t,o,a,u=d,f,c,i;function p(){var m=Math.min(r.length,n.length);if(u!==d)u=J(r[0],r[m-1]);return f=m>2?Q:K,c=i=null,l}function l(m){return m==null||isNaN(m=+m)?a:(c||(c=f(r.map(t),n,e)))(t(u(m)))}return l.invert=function(m){return u(o((i||(i=f(n,r.map(t),Be)))(m)))},l.domain=function(m){return arguments.length?(r=Array.from(m,q),p()):r.slice()},l.range=function(m){return arguments.length?(n=Array.from(m),p()):n.slice()},l.rangeRound=function(m){return n=Array.from(m),e=A,p()},l.clamp=function(m){return arguments.length?(u=m?!0:d,p()):u!==d},l.interpolate=function(m){return arguments.length?(e=m,p()):e},l.unknown=function(m){return arguments.length?(a=m,l):a},function(m,L){return t=m,o=L,p()}}function $r(){return U()(d,d)}function I(r,n,e,t){var o=Or(r,n,e),a;switch(t=gn(t==null?",f":t),t.type){case"s":{var u=Math.max(Math.abs(r),Math.abs(n));if(t.precision==null&&!isNaN(a=S(o,u)))t.precision=a;return aa(t,u)}case"":case"e":case"g":case"p":case"r":{if(t.precision==null&&!isNaN(a=j(o,Math.max(Math.abs(r),Math.abs(n)))))t.precision=a-(t.type==="e");break}case"f":case"%":{if(t.precision==null&&!isNaN(a=R(o)))t.precision=a-(t.type==="%")*2;break}}return Pt(t)}function W(r){var n=r.domain;return r.ticks=function(e){var t=n();return v(t[0],t[t.length-1],e==null?10:e)},r.tickFormat=function(e,t){var o=n();return I(o[0],o[o.length-1],e==null?10:e,t)},r.nice=function(e){if(e==null)e=10;var t=n(),o=0,a=t.length-1,u=t[o],f=t[a],c,i,p=10;if(f<u)i=u,u=f,f=i,i=o,o=a,a=i;while(p-- >0){if(i=M(u,f,e),i===c)return t[o]=u,t[a]=f,n(t);else if(i>0)u=Math.floor(u/i)*i,f=Math.ceil(f/i)*i;else if(i<0)u=Math.ceil(u*i)/i,f=Math.floor(f*i)/i;else break;c=i}return r},r}function wt(){var r=$r();return r.copy=function(){return ra(r,wt())},Ot.apply(r,arguments),W(r)}
|
|
2
2
|
export{rr,Or,ra,$r,wt};
|