PageSourceSearch

https://magicheidi.ch/_nuxt/rkJqIDNM.js

js magicheidi.ch collected 2026-09-24 18:44:44 UTC 105,280 bytes, 12 lines download raw bytes

1let T=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Ue(t){return Array.isArray(t)?(function(e){let n=[];for(let r=0,s=e.length;r<s;r++)n[r]=Ue(e[r]);return n})(t):t instanceof RegExp?t:typeof t=="object"?(function(e){let n={};for(let r in e)n[r]=Ue(e[r]);return n})(t):t}function Gt(t,...e){return e.forEach(n=>{for(let r in n)t[r]=n[r]}),t}function Bt(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?Bt(t.substring(0,t.length-1)):t.substr(1+~e)}var Me=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,ge=class{static hasCaptures(t){return t!==null&&(Me.lastIndex=0,Me.test(t))}static replaceCaptures(t,e,n){return t.replace(Me,(r,s,o,a)=>{let i=n[parseInt(s||o,10)];if(!i)return r;{let l=e.substring(i.start,i.end);for(;l[0]===".";)l=l.substring(1);switch(a){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}})}};function Dt(t,e){return t<e?-1:t>e?1:0}function $t(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 o=Dt(t[s],e[s]);if(o!==0)return o}return 0}return n-r}function pt(t){return!!/^#[0-9a-f]{6}$/i.test(t)||!!/^#[0-9a-f]{8}$/i.test(t)||!!/^#[0-9a-f]{3}$/i.test(t)||!!/^#[0-9a-f]{4}$/i.test(t)}function jt(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Ft=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},_e=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme((function(n){if(!n)return[];if(!n.settings||!Array.isArray(n.settings))return[];let r=n.settings,s=[],o=0;for(let a=0,i=r.length;a<i;a++){let l,u=r[a];if(!u.settings)continue;if(typeof u.scope=="string"){let p=u.scope;p=p.replace(/^[,]+/,""),p=p.replace(/[,]+$/,""),l=p.split(",")}else l=Array.isArray(u.scope)?u.scope:[""];let c=-1;if(typeof u.settings.fontStyle=="string"){c=0;let p=u.settings.fontStyle.split(" ");for(let m=0,b=p.length;m<b;m++)switch(p[m]){case"italic":c|=1;break;case"bold":c|=2;break;case"underline":c|=4;break;case"strikethrough":c|=8}}let d=null;typeof u.settings.foreground=="string"&&pt(u.settings.foreground)&&(d=u.settings.foreground);let h=null;typeof u.settings.background=="string"&&pt(u.settings.background)&&(h=u.settings.background);for(let p=0,m=l.length;p<m;p++){let b=l[p].trim().split(" "),f=b[b.length-1],g=null;b.length>1&&(g=b.slice(0,b.length-1),g.reverse()),s[o++]=new kn(f,g,a,c,d,h)}}return s})(t),e)}static createFromParsedTheme(t,e){return(function(n,r){n.sort((c,d)=>{let h=Dt(c.scope,d.scope);return h!==0?h:(h=$t(c.parentScopes,d.parentScopes),h!==0?h:c.index-d.index)});let s=0,o="#000000",a="#ffffff";for(;n.length>=1&&n[0].scope==="";){let c=n.shift();c.fontStyle!==-1&&(s=c.fontStyle),c.foreground!==null&&(o=c.foreground),c.background!==null&&(a=c.background)}let i=new Sn(r),l=new dt(s,i.getId(o),i.getId(a)),u=new vn(new We(0,null,-1,0,0),[]);for(let c=0,d=n.length;c<d;c++){let h=n[c];u.insert(0,h.scope,h.parentScopes,h.fontStyle,i.getId(h.foreground),i.getId(h.background))}return new _e(i,l,u)})(t,e)}_cachedMatchRoot=new Ft(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,n=this._cachedMatchRoot.get(e).find(r=>(function(s,o){if(o.length===0)return!0;for(let a=0;a<o.length;a++){let i=o[a],l=!1;if(i===">"){if(a===o.length-1)return!1;i=o[++a],l=!0}for(;s&&!_n(s.scopeName,i);){if(l)return!1;s=s.parent}if(!s)return!1;s=s.parent}return!0})(t.parent,r.parentScopes));return n?new dt(n.fontStyle,n.foreground,n.background):null}},Ge=class ye{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const r of n)e=new ye(e,r);return e}static from(...e){let n=null;for(let r=0;r<e.length;r++)n=new ye(n,e[r]);return n}push(e){return new ye(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}
1toString(){return this.getSegments().join(" ")}extends(e){return this===e||this.parent!==null&&this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let r=this;for(;r&&r!==e;)n.push(r.scopeName),r=r.parent;return r===e?n.reverse():void 0}};function _n(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var dt=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}},kn=class{constructor(t,e,n,r,s,o){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=r,this.foreground=s,this.background=o}},I=(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))(I||{}),Sn=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 new 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)}},Cn=Object.freeze([]),We=class Ut{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,r,s,o){this.scopeDepth=e,this.parentScopes=n||Cn,this.fontStyle=r,this.foreground=s,this.background=o}clone(){return new Ut(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){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),s!==0&&(this.background=s)}},vn=class ze{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;for(;e.parentScopes[r]===">"&&r++,n.parentScopes[s]===">"&&s++,!(r>=e.parentScopes.length||s>=n.parentScopes.length);){const o=n.parentScopes[s].length-e.parentScopes[r].length;if(o!==0)return o;r++,s++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r,s,o=e.indexOf(".");if(o===-1?(r=e,s=""):(r=e.substring(0,o),s=e.substring(o+1)),this._children.hasOwnProperty(r))return this._children[r].match(s)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(ze._cmpBySpecificity),n}insert(e,n,r,s,o,a){if(n==="")return void this._doInsertHere(e,r,s,o,a);let i,l,u,c=n.indexOf(".");c===-1?(i=n,l=""):(i=n.substring(0,c),l=n.substring(c+1)),this._children.hasOwnProperty(i)?u=this._children[i]:(u=new ze(this._mainRule.clone(),We.cloneArr(this._rulesWithParentScopes)),this._children[i]=u),u.insert(e+1,l,r,s,o,a)}_doInsertHere(e,n,r,s,o){if(n!==null){for(let a=0,i=this._rulesWithParentScopes.length;a<i;a++){let l=this._rulesWithParentScopes[a];if($t(l.parentScopes,n)===0)return void l.acceptOverwrite(e,r,s,o)}r===-1&&(r=this._mainRule.fontStyle),s===0&&(s=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new We(e,n,r,s,o))}else this._mainRule.acceptOverwrite(e,r,s,o)}},Q=class G{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=G.getLanguageId(e),r=G.getTokenType(e),s=G.getFontStyle(e),o=G.getForeground(e),a=G.getBackground(e);console.log({languageId:n,tokenType:r,fontStyle:s,foreground:o,background:a})}static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(768&e)>>>8}static containsBalancedBrackets(e){return!!(1024&e)}static getFontStyle(e){return(30720&e)>>>11}static getForeground(e){return(16744448&e)>>>15}static getBackground(e){return(4278190080&e)>>>24}static set(e,n,r,s,o,a,i){let l=G.getLanguageId(e),u=G.getTokenType(e),c=G.containsBalancedBrackets(e)?1:0,d=G.getFontStyle(e),h=G.getForeground(e),p=G.getBackground(e);return n!==0&&(l=n),r!==8&&(u=r),s!==null&&(c=s?1:0),o!==-1&&(d=o),a!==0&&(h=a),i!==0&&(p=i),(l|u<<8|c<<10|d<<11|h<<15|p<<24)>>>0}};function ke(t,e){const n=[],r=(function(i){let l=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,u=l.exec(i);return{next:()=>{if(!u)return null;const c=u[0];return u=l.exec(i),c}}})(t);let s=r.next();for(;s!==null;){let i=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":i=1;break;case"L":i=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let l=a();if(n.push({matcher:l,priority:i}),s!==",")break;s=r.next()}return n;function o(){if(s==="-"){s=r.next();const i=o();return l=>!!i&&!i(l)}if(s==="("){s=r.next();const i=(function(){const l=[];let u=a();for(;u&&(l.push(u),s==="|"||s===",");){do s=r.next();while(s==="|"||s===",");u=a()}return c=>l.some(d=>d(c))})();return s===")"&&(s=r.next()),i}if(gt(s)){const i=[];do i.push(s),s=r.next();while(gt(s));return l=>e(i,l)}return null}function a(){const i=[];let l=o();for(;l;)i.push(l),l=o();return u=>i.every(c=>c(u))}}function gt(t){return!!t&&!!t.match(/[\w\.:]+/)}
1function Wt(t){typeof t.dispose=="function"&&t.dispose()}var ae=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},wn=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},Nn=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},An=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new ae(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new Nn;for(const n of t)Pn(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof ae){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Pn(t,e,n,r){const s=n.lookup(t.scopeName);if(!s){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const o=n.lookup(e);t instanceof ae?be({baseGrammar:o,selfGrammar:s},r):qe(t.ruleName,{baseGrammar:o,selfGrammar:s,repository:s.repository},r);const a=n.injections(t.scopeName);if(a)for(const i of a)r.add(new ae(i))}function qe(t,e,n){e.repository&&e.repository[t]&&Se([e.repository[t]],e,n)}function be(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&Se(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&Se(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function Se(t,e,n){for(const r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const s=r.repository?Gt({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&Se(r.patterns,{...e,repository:s},n);const o=r.include;if(!o)continue;const a=zt(o);switch(a.kind){case 0:be({...e,selfGrammar:e.baseGrammar},n);break;case 1:be(e,n);break;case 2:qe(a.ruleName,{...e,repository:s},n);break;case 3:case 4:const i=a.scopeName===e.selfGrammar.scopeName?e.selfGrammar:a.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(i){const l={baseGrammar:e.baseGrammar,selfGrammar:i,repository:s};
1a.kind===4?qe(a.ruleName,l,n):be(l,n)}else a.kind===4?n.add(new wn(a.scopeName,a.ruleName)):n.add(new ae(a.scopeName))}}}var xn=class{kind=0},Rn=class{kind=1},Tn=class{constructor(t){this.ruleName=t}kind=2},Ln=class{constructor(t){this.scopeName=t}kind=3},In=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function zt(t){if(t==="$base")return new xn;if(t==="$self")return new Rn;const e=t.indexOf("#");if(e===-1)return new Ln(t);if(e===0)return new Tn(t.substring(1));{const n=t.substring(0,e),r=t.substring(e+1);return new In(n,r)}}var En=/\\(\d+)/,mt=/\\(\d+)/g,ue=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,r){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=ge.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=ge.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${Bt(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return this._nameIsCapturing&&this._name!==null&&t!==null&&e!==null?ge.replaceCaptures(this._name,t,e):this._name}getContentName(t,e){return this._contentNameIsCapturing&&this._contentName!==null?ge.replaceCaptures(this._contentName,t,e):this._contentName}},On=class extends ue{retokenizeCapturedWithRuleId;constructor(t,e,n,r,s){super(t,e,n,r),this.retokenizeCapturedWithRuleId=s}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,r){throw new Error("Not supported!")}},Mn=class extends ue{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,r,s){super(t,e,n,null),this._match=new le(r,this.id),this.captures=s,this._cachedCompiledPatterns=null}dispose(){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){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ie,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ft=class extends ue{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(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const 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){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ie,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},He=class extends ue{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,s,o,a,i,l,u){super(t,e,n,r),this._begin=new le(s,this.id),this.beginCaptures=o,this._end=new le(a||"ï¿¿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=i,this.applyEndPatternLast=l||!1,this.patterns=u.patterns,this.hasMissingPatterns=u.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){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 ie;
1for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},Ce=class extends ue{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,r,s,o,a,i,l){super(t,e,n,r),this._begin=new le(s,this.id),this.beginCaptures=o,this.whileCaptures=i,this._while=new le(a,-2),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),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 ie;for(const 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){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new ie,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||"ï¿¿"),this._cachedCompiledWhilePatterns}
1},qt=class L{static createCaptureRule(e,n,r,s,o){return e.registerRule(a=>new On(n,a,r,s,o))}static getCompiledRuleId(e,n,r){return e.id||n.registerRule(s=>{if(e.id=s,e.match)return new Mn(e.$vscodeTextmateLocation,e.id,e.name,e.match,L._compileCaptures(e.captures,n,r));if(e.begin===void 0){e.repository&&(r=Gt({},r,e.repository));let o=e.patterns;return o===void 0&&e.include&&(o=[{include:e.include}]),new ft(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,L._compilePatterns(o,n,r))}return e.while?new Ce(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,L._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,L._compileCaptures(e.whileCaptures||e.captures,n,r),L._compilePatterns(e.patterns,n,r)):new He(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,L._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,L._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,L._compilePatterns(e.patterns,n,r))}),e.id}static _compileCaptures(e,n,r){let s=[];if(e){let o=0;for(const a in e){if(a==="$vscodeTextmateLocation")continue;const i=parseInt(a,10);i>o&&(o=i)}for(let a=0;a<=o;a++)s[a]=null;for(const a in e){if(a==="$vscodeTextmateLocation")continue;const i=parseInt(a,10);let l=0;e[a].patterns&&(l=L.getCompiledRuleId(e[a],n,r)),s[i]=L.createCaptureRule(n,e[a].$vscodeTextmateLocation,e[a].name,e[a].contentName,l)}}return s}static _compilePatterns(e,n,r){let s=[];if(e)for(let o=0,a=e.length;o<a;o++){const i=e[o];let l=-1;if(i.include){const u=zt(i.include);switch(u.kind){case 0:case 1:l=L.getCompiledRuleId(r[i.include],n,r);break;case 2:let c=r[u.ruleName];c&&(l=L.getCompiledRuleId(c,n,r));break;case 3:case 4:const d=u.scopeName,h=u.kind===4?u.ruleName:null,p=n.getExternalGrammar(d,r);if(p)if(h){let m=p.repository[h];m&&(l=L.getCompiledRuleId(m,n,p.repository))}else l=L.getCompiledRuleId(p.repository.$self,n,p.repository)}}else l=L.getCompiledRuleId(i,n,r);if(l!==-1){const u=n.getRule(l);let c=!1;if((u instanceof ft||u instanceof He||u instanceof Ce)&&u.hasMissingPatterns&&u.patterns.length===0&&(c=!0),c)continue;s.push(l)}}return{patterns:s,hasMissingPatterns:(e?e.length:0)!==s.length}}},le=class Ht{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e=="string"){const r=e.length;let s=0,o=[],a=!1;for(let i=0;i<r;i++)if(e.charAt(i)==="\\"&&i+1<r){const l=e.charAt(i+1);l==="z"?(o.push(e.substring(s,i)),o.push("$(?!\\n)(?<!\\n)"),s=i+2):l!=="A"&&l!=="G"||(a=!0),i++}this.hasAnchor=a,s===0?this.source=e:(o.push(e.substring(s,r)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=En.test(this.source):this.hasBackReferences=!1}clone(){return new Ht(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){if(typeof this.source!="string")throw new 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 mt.lastIndex=0,this.source.replace(mt,(s,o)=>jt(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e,n,r,s,o=[],a=[],i=[],l=[];for(e=0,n=this.source.length;e<n;e++)r=this.source.charAt(e),o[e]=r,a[e]=r,i[e]=r,l[e]=r,r==="\\"&&e+1<n&&(s=this.source.charAt(e+1),s==="A"?(o[e+1]="ï¿¿",a[e+1]="ï¿¿",i[e+1]="A",l[e+1]="A"):s==="G"?(o[e+1]="ï¿¿",a[e+1]="G",i[e+1]="ï¿¿",l[e+1]="G"):(o[e+1]=s,a[e+1]=s,i[e+1]=s,l[e+1]=s),e++);return{A0_G0:o.join(""),A0_G1:a.join(""),A1_G0:i.join(""),A1_G1:l.join("")}}resolveAnchors(e,n){return this.hasAnchor&&this._anchorCache&&typeof this.source=="string"?e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0:this.source}},ie=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(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}
1push(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){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 yt(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let r=this._items.map(s=>s.resolveAnchors(e,n));return new yt(t,r,this._items.map(s=>s.ruleId))}},yt=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push("   - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
2`)}findNextMatchSync(t,e,n){const r=this.scanner.findNextMatchSync(t,e,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Be=class{constructor(t,e){this.languageId=t,this.tokenType=e}},Gn=class Ke{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,n){this._defaultAttributes=new Be(e,8),this._embeddedLanguagesMatcher=new Bn(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?Ke._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new Be(0,0);_getBasicScopeAttributes=new Ft(e=>{const n=this._scopeToLanguage(e),r=this._toStandardTokenType(e);return new Be(n,r)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(Ke.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 new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Bn=class{values;scopesRegExp;constructor(t){if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([n,r])=>jt(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);return e?this.values.get(e[1]):void 0}},bt=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function Kt(t,e,n,r,s,o,a,i){const l=e.content.length;let u=!1,c=-1;if(a){const p=(function(m,b,f,g,_,k){let v=_.beginRuleCapturedEOL?0:-1;const C=[];for(let w=_;w;w=w.pop()){const x=w.getRule(m);x instanceof Ce&&C.push({rule:x,stack:w})}for(let w=C.pop();w;w=C.pop()){const{ruleScanner:x,findOptions:U}=Dn(w.rule,m,w.stack.endRule,f,g===v),R=x.findNextMatchSync(b,g,U);if(!R){_=w.stack.pop();break}if(R.ruleId!==-2){_=w.stack.pop();break}R.captureIndices&&R.captureIndices.length&&(k.produce(w.stack,R.captureIndices[0].start),ne(m,b,f,w.stack,k,w.rule.whileCaptures,R.captureIndices),k.produce(w.stack,R.captureIndices[0].end),v=R.captureIndices[0].end,R.captureIndices[0].end>g&&(g=R.captureIndices[0].end,f=!1))}return{stack:_,linePos:g,anchorPosition:v,isFirstLine:f}})(t,e,n,r,s,o);s=p.stack,r=p.linePos,n=p.isFirstLine,c=p.anchorPosition}const d=Date.now();for(;!u;){if(i!==0&&Date.now()-d>i)return new bt(s,!0);h()}return new bt(s,!1);function h(){const p=(function(g,_,k,v,C,w){const x=(function(j,W,O,B,D,Le){const Ie=D.getRule(j),{ruleScanner:pe,findOptions:te}=_t(Ie,j,D.endRule,O,B===Le),z=pe.findNextMatchSync(W,B,te);return z?{captureIndices:z.captureIndices,matchedRuleId:z.ruleId}:null})(g,_,k,v,C,w),U=g.getInjections();if(U.length===0)return x;const R=(function(j,W,O,B,D,Le,Ie){let pe,te=Number.MAX_VALUE,z=null,ut=0;const gn=Le.contentNameScopesList.getScopeNames();for(let Ee=0,mn=j.length;Ee<mn;Ee++){const Oe=j[Ee];
2if(!Oe.matcher(gn))continue;const fn=W.getRule(Oe.ruleId),{ruleScanner:yn,findOptions:bn}=_t(fn,W,null,B,D===Ie),de=yn.findNextMatchSync(O,D,bn);if(!de)continue;const ht=de.captureIndices[0].start;if(!(ht>=te)&&(te=ht,z=de.captureIndices,pe=de.ruleId,ut=Oe.priority,te===D))break}return z?{priorityMatch:ut===-1,captureIndices:z,matchedRuleId:pe}:null})(U,g,_,k,v,C,w);if(!R)return x;if(!x)return R;const he=x.captureIndices[0].start,V=R.captureIndices[0].start;return V<he||R.priorityMatch&&V===he?R:x})(t,e,n,r,s,c);if(!p)return o.produce(s,l),void(u=!0);const m=p.captureIndices,b=p.matchedRuleId,f=!!(m&&m.length>0)&&m[0].end>r;if(b===-1){const g=s.getRule(t);o.produce(s,m[0].start),s=s.withContentNameScopesList(s.nameScopesList),ne(t,e,n,s,o,g.endCaptures,m),o.produce(s,m[0].end);const _=s;if(s=s.parent,c=_.getAnchorPos(),!f&&_.getEnterPos()===r)return s=_,o.produce(s,l),void(u=!0)}else{const g=t.getRule(b);o.produce(s,m[0].start);const _=s,k=g.getName(e.content,m),v=s.contentNameScopesList.pushAttributed(k,t);if(s=s.push(b,r,c,m[0].end===l,null,v,v),g instanceof He){const C=g;ne(t,e,n,s,o,C.beginCaptures,m),o.produce(s,m[0].end),c=m[0].end;const w=C.getContentName(e.content,m),x=v.pushAttributed(w,t);if(s=s.withContentNameScopesList(x),C.endHasBackReferences&&(s=s.withEndRule(C.getEndWithResolvedBackReferences(e.content,m))),!f&&_.hasSameRuleAs(s))return s=s.pop(),o.produce(s,l),void(u=!0)}else if(g instanceof Ce){const C=g;ne(t,e,n,s,o,C.beginCaptures,m),o.produce(s,m[0].end),c=m[0].end;const w=C.getContentName(e.content,m),x=v.pushAttributed(w,t);if(s=s.withContentNameScopesList(x),C.whileHasBackReferences&&(s=s.withEndRule(C.getWhileWithResolvedBackReferences(e.content,m))),!f&&_.hasSameRuleAs(s))return s=s.pop(),o.produce(s,l),void(u=!0)}else if(ne(t,e,n,s,o,g.captures,m),o.produce(s,m[0].end),s=s.pop(),!f)return s=s.safePop(),o.produce(s,l),void(u=!0)}m[0].end>r&&(r=m[0].end,n=!1)}}function _t(t,e,n,r,s){return{ruleScanner:t.compileAG(e,n,r,s),findOptions:0}}function Dn(t,e,n,r,s){return{ruleScanner:t.compileWhileAG(e,n,r,s),findOptions:0}}function ne(t,e,n,r,s,o,a){if(o.length===0)return;const i=e.content,l=Math.min(o.length,a.length),u=[],c=a[0].end;for(let d=0;d<l;d++){const h=o[d];if(h===null)continue;const p=a[d];if(p.length===0)continue;if(p.start>c)break;for(;u.length>0&&u[u.length-1].endPos<=p.start;)s.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?s.produceFromScopes(u[u.length-1].scopes,p.start):s.produce(r,p.start),h.retokenizeCapturedWithRuleId){const b=h.getName(i,a),f=r.contentNameScopesList.pushAttributed(b,t),g=h.getContentName(i,a),_=f.pushAttributed(g,t),k=r.push(h.retokenizeCapturedWithRuleId,p.start,-1,!1,null,f,_),v=t.createOnigString(i.substring(0,p.end));Kt(t,v,n&&p.start===0,p.start,k,s,!1,0),Wt(v);continue}const m=h.getName(i,a);if(m!==null){const b=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).pushAttributed(m,t);u.push(new $n(b,p.end))}}for(;u.length>0;)s.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop()}var $n=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function kt(t,e,n,r,s){const o=ke(e,ve),a=qt.getCompiledRuleId(n,r,s.repository);for(const i of o)t.push({debugSelector:e,matcher:i.matcher,ruleId:a,grammar:s,priority:i.priority})}function ve(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(jn(e[s],r))return n=s+1,!0;return!1})}function jn(t,e){if(!t)return!1;if(t===e)return!0;const n=e.length;return t.length>n&&t.substr(0,n)===e&&t[n]==="."}var Fn=class{constructor(t,e,n,r,s,o,a,i){if(this._rootScopeName=t,this.balancedBracketSelectors=o,this._onigLib=i,this._basicScopeAttributesProvider=new Gn(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=a,this._grammar=St(e,null),this._injections=null,this._tokenTypeMatchers=[],s)for(const l of Object.keys(s)){const u=ke(l,ve);for(const c of u)this._tokenTypeMatchers.push({matcher:c.matcher,type:s[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}
2dispose(){for(const t of this._ruleId2desc)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(){const t=s=>s===this._rootScopeName?this._grammar:this.getExternalGrammar(s),e=[],n=this._rootScopeName,r=t(n);if(r){const s=r.injections;if(s)for(let a in s)kt(e,a,s[a],this,r);const o=this._grammarRepository.injections(n);o&&o.forEach(a=>{const i=this.getExternalGrammar(a);if(i){const l=i.injectionSelector;l&&kt(e,l,i,this,i)}})}return e.sort((s,o)=>s.priority-o.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,n=t(e);return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=St(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){const 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){const 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){let s;if(this._rootId===-1&&(this._rootId=qt.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections()),e&&e!==Ve.NULL)s=!1,e.reset();else{s=!0;const u=this._basicScopeAttributesProvider.getDefaultAttributes(),c=this.themeProvider.getDefaults(),d=Q.set(0,u.languageId,u.tokenType,null,c.fontStyle,c.foregroundId,c.backgroundId),h=this.getRule(this._rootId).getName(null,null);let p;p=h?se.createRootAndLookUpScopeName(h,d,this):se.createRoot("unknown",d),e=new Ve(null,this._rootId,-1,-1,!1,null,p,p)}t+=`
3`;const o=this.createOnigString(t),a=o.content.length,i=new Wn(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),l=Kt(this,o,s,0,e,i,!0,r);return Wt(o),{lineLength:a,lineTokens:i,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function St(t,e){return(t=Ue(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 se=class ${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(const o of n)s=Ge.push(s,o.scopeNames),r=new $(r,s,o.encodedTokenAttributes);return r}static createRoot(e,n){return new $(null,new Ge(null,e),n)}static createRootAndLookUpScopeName(e,n,r){const s=r.getMetadataForScope(e),o=new Ge(null,e),a=r.themeProvider.themeMatch(o),i=$.mergeAttributes(n,s,a);return new $(null,o,i)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return $.equals(this,e)}static equals(e,n){for(;;){if(e===n||!e&&!n)return!0;if(!e||!n||e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}}static mergeAttributes(e,n,r){let s=-1,o=0,a=0;return r!==null&&(s=r.fontStyle,o=r.foregroundId,a=r.backgroundId),Q.set(e,n.languageId,n.tokenType,null,s,o,a)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return $._pushAttributed(this,e,n);const r=e.split(/ /g);let s=this;for(const o of r)s=$._pushAttributed(s,o,n);return s}static _pushAttributed(e,n,r){const s=r.getMetadataForScope(n),o=e.scopePath.push(n),a=r.themeProvider.themeMatch(o),i=$.mergeAttributes(e.tokenAttributes,s,a);return new $(e,o,i)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const n=[];let r=this;for(;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}},Ve=class q{constructor(e,n,r,s,o,a,i,l){this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=o,this.endRule=a,this.nameScopesList=i,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=s}_stackElementBrand=void 0;static NULL=new q(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e!==null&&q._equals(this,e)}static _equals(e,n){return e===n||!!this._structuralEquals(e,n)&&se.equals(e.contentNameScopesList,n.contentNameScopesList)}static _structuralEquals(e,n){for(;;){if(e===n||!e&&!n)return!0;
3if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){q._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,r,s,o,a,i){return new q(this,e,n,r,s,o,a,i)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,n){return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new q(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;for(;n&&n._enterPos===e._enterPos;){if(n.ruleId===e.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId: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){const r=se.fromExtension(e?.nameScopesList??null,n.nameScopesList);return new q(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,se.fromExtension(r,n.contentNameScopesList))}},Un=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):ke(n,ve).map(r=>r.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>ke(n,ve).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(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},Wn=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),this._tokenTypeOverrides.length>
30||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=t?.getScopeNames()??[];for(const a of this._tokenTypeOverrides)a.matcher(o)&&(r=Q.set(r,0,a.type,null,-1,0,0));this.balancedBracketSelectors&&(s=this.balancedBracketSelectors.match(o))}return s&&(r=Q.set(r,0,8,s,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r?void(this._lastTokenEndIndex=e):(this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),void(this._lastTokenEndIndex=e))}const n=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,s=this._binaryTokens.length;r<s;r++)n[r]=this._binaryTokens[r];return n}},zn=class{constructor(t,e){this._onigLib=e,this._theme=t}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){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 o=this._rawGrammars.get(t);if(!o)return null;this._grammars.set(t,(function(a,i,l,u,c,d,h,p){return new Fn(a,i,l,u,c,d,h,p)})(t,o,e,n,r,s,this,this._onigLib))}return this._grammars.get(t)}},qn=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new zn(_e.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,e){this._syncRegistry.setTheme(_e.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 Un(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,e,n,r,s){const o=new An(this._syncRegistry,t);for(;o.Q.length>0;)o.Q.map(a=>this._loadSingleGrammar(a.scopeName)),o.processQueue();return this._grammarForScopeName(t,e,n,r,s)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const e=this._options.loadGrammar(t);if(e){const 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)}},Ye=Ve.NULL;const Hn=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class oe{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}function Vt(t,e){const n={},r={};for(const s of t)Object.assign(n,s.property),Object.assign(r,s.normal);return new oe(n,r,e)}function Xe(t){return t.toLowerCase()}oe.prototype.normal={},oe.prototype.property={},oe.prototype.space=void 0;class E{constructor(e,n){this.attribute=n,this.property=e}}E.prototype.attribute="",E.prototype.booleanish=!1,E.prototype.boolean=!1,E.prototype.commaOrSpaceSeparated=!1,E.prototype.commaSeparated=!1,E.prototype.defined=!1,E.prototype.mustUseProperty=!1,E.prototype.number=!1,E.prototype.overloadedBoolean=!1,E.prototype.property="",E.prototype.spaceSeparated=!1,E.prototype.space=void 0;let Kn=0;const S=K(),A=K(),Je=K(),y=K(),N=K(),X=K(),M=K();function K(){return 2**++Kn}const Qe=Object.freeze(Object.defineProperty({__proto__:null,boolean:S,booleanish:A,commaOrSpaceSeparated:M,commaSeparated:X,number:y,overloadedBoolean:Je,spaceSeparated:N},Symbol.toStringTag,{value:"Module"})),De=Object.keys(Qe);
vendor: 4,224 bytes, line 3
3class nt extends E{constructor(e,n,r,s){let o=-1;if(super(e,n),Ct(this,"space",s),typeof r=="number")for(;++o<De.length;){const a=De[o];Ct(this,De[o],(r&Qe[a])===Qe[a])}}}function Ct(t,e,n){n&&(t[e]=n)}function Z(t){const e={},n={};for(const[r,s]of Object.entries(t.properties)){const o=new nt(r,t.transform(t.attributes||{},r),s,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),e[r]=o,n[Xe(r)]=r,n[Xe(o.attribute)]=r}return new oe(e,n,t.space)}nt.prototype.defined=!0;const Yt=Z({properties:{ariaActiveDescendant:null,ariaAtomic:A,ariaAutoComplete:null,ariaBusy:A,ariaChecked:A,ariaColCount:y,ariaColIndex:y,ariaColSpan:y,ariaControls:N,ariaCurrent:null,ariaDescribedBy:N,ariaDetails:null,ariaDisabled:A,ariaDropEffect:N,ariaErrorMessage:null,ariaExpanded:A,ariaFlowTo:N,ariaGrabbed:A,ariaHasPopup:null,ariaHidden:A,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:N,ariaLevel:y,ariaLive:null,ariaModal:A,ariaMultiLine:A,ariaMultiSelectable:A,ariaOrientation:null,ariaOwns:N,ariaPlaceholder:null,ariaPosInSet:y,ariaPressed:A,ariaReadOnly:A,ariaRelevant:null,ariaRequired:A,ariaRoleDescription:N,ariaRowCount:y,ariaRowIndex:y,ariaRowSpan:y,ariaSelected:A,ariaSetSize:y,ariaSort:null,ariaValueMax:y,ariaValueMin:y,ariaValueNow:y,ariaValueText:null,role:null},transform:(t,e)=>e==="role"?e:"aria-"+e.slice(4).toLowerCase()});function Xt(t,e){return e in t?t[e]:e}function Jt(t,e){return Xt(t,e.toLowerCase())}const Vn=Z({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:X,acceptCharset:N,accessKey:N,action:null,allow:null,allowFullScreen:S,allowPaymentRequest:S,allowUserMedia:S,alt:null,as:null,async:S,autoCapitalize:null,autoComplete:N,autoFocus:S,autoPlay:S,blocking:N,capture:null,charSet:null,checked:S,cite:null,className:N,cols:y,colSpan:null,content:null,contentEditable:A,controls:S,controlsList:N,coords:y|X,crossOrigin:null,data:null,dateTime:null,decoding:null,default:S,defer:S,dir:null,dirName:null,disabled:S,download:Je,draggable:A,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:S,formTarget:null,headers:N,height:y,hidden:Je,high:y,href:null,hrefLang:null,htmlFor:N,httpEquiv:N,id:null,imageSizes:null,imageSrcSet:null,inert:S,inputMode:null,integrity:null,is:null,isMap:S,itemId:null,itemProp:N,itemRef:N,itemScope:S,itemType:N,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:S,low:y,manifest:null,max:null,maxLength:y,media:null,method:null,min:null,minLength:y,multiple:S,muted:S,name:null,nonce:null,noModule:S,noValidate:S,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:S,optimum:y,pattern:null,ping:N,placeholder:null,playsInl
3ine:S,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:S,referrerPolicy:null,rel:N,required:S,reversed:S,rows:y,rowSpan:y,sandbox:N,scope:null,scoped:S,seamless:S,selected:S,shadowRootClonable:S,shadowRootDelegatesFocus:S,shadowRootMode:null,shape:null,size:y,sizes:null,slot:null,span:y,spellCheck:A,src:null,srcDoc:null,srcLang:null,srcSet:null,start:y,step:null,style:null,tabIndex:y,target:null,title:null,translate:null,type:null,typeMustMatch:S,useMap:null,value:A,width:y,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:N,axis:null,background:null,bgColor:null,border:y,borderColor:null,bottomMargin:y,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:S,declare:S,event:null,face:null,frame:null,frameBorder:null,hSpace:y,leftMargin:y,link:null,longDesc:null,lowSrc:null,marginHeight:y,marginWidth:y,noResize:S,noHref:S,noShade:S,noWrap:S,object:null,profile:null,prompt:null,rev:null,rightMargin:y,rules:null,scheme:null,scrolling:A,standby:null,summary:null,text:null,topMargin:y,valueType:null,version:null,vAlign:null,vLink:null,vSpace:y,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:S,disableRemotePlayback:S,prefix:null,property:null,results:y,security:null,unselectable:null},space:"html",transform:Jt}),Yn=Z({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav
3-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:M,accentHeight:y,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:y,amplitude:y,arabicForm:null,ascent:y,attributeName:null,attributeType:null,azimuth:y,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:y,by:null,calcMode:null,capHeight:y,className:N,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:y,diffuseConstant:y,direction:null,display:null,dur:null,divisor:y,dominantBaseline:null,download:S,dx:null,dy:null,edgeMode:null,editable:null,elevation:y,enableBackground:null,end:null,event:null,exponent:y,externalResourcesRequired:null,fill:null,fillOpacity:y,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:X,g2
3:X,glyphName:X,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:y,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:y,horizOriginX:y,horizOriginY:y,id:null,ideographic:y,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:y,k:y,k1:y,k2:y,k3:y,k4:y,kernelMatrix:M,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:y,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:y,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:y,overlineThickness:y,paintOrder:null,panose1:null,path:null,pathLength:y,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:N,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:y,pointsAtY:y,pointsAtZ:y,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:M,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:M,rev:M,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:M,requiredFeatures:M,requiredFonts:M,requiredFormats:M,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:y,specularExponent:y,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:y,strikethroughThickness:y,string:null,stroke:null,strokeDashArray:M,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:y,strokeOpacity:y,strokeWidth:null,style:null,surfaceScale:y,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:M,tabIndex:y,tableValues:null,target:null,targetX:y,targetY:y,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:M,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:y,underlineThickness:y,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:y,values:null,vAlphabetic:y,vMathematical:y,vectorEffect:null,vHanging:y,vIdeographic:y,version:null,vertAdvY:y,vertOriginX:y,vertOriginY:y,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:y,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Xt}),Qt=Z({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform:(t,e)=>"xlink:"+e.slice(5).toLowerCase()}),Zt=Z({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Jt}),en=Z({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform:(t,e)=>"xml:"+e.slice(3).toLowerCase()}),Xn=/[A-Z]/g,vt=/-[a-z]/g,Jn=/^data[-\w.:]+$/i;function Qn(t){return"-"+t.toLowerCase()}function Zn(t){return t.charAt(1).toUpperCase()}const er=Vt([Yt,Vn,Qt,Zt,en],"html"),tn=Vt([Yt,Yn,Qt,Zt,en],"svg"),wt={}.hasOwnProperty,tr=/["&'<>`]/g,nr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,rr=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,sr=/[|\\{}()[\]^$+*?.]/g,Nt=new WeakMap;function or(t,e){return t=t.replace(e.subset?(function(r){let s=Nt.get(r);return s||(s=(function(o){const a=[];let i=-1;for(;++i<o.length;)a.push(o[i].replace(sr,"\\$&"));return new RegExp("(?:"+a.join("|")+")","g")})(r),Nt.set(r,s)),s})(e.subset):tr,n),e.subset||e.escapeOnly?t:t.replace(nr,function(r,s,o){return e.format(1024*(r.charCodeAt(0)-55296)+r.charCodeAt(1)-56320+65536,o.charCodeAt(s+2),e)}).replace(rr,n);function n(r,s,o){return e.format(r.charCodeAt(0),o.charCodeAt(s+1),e)}}const ar=/[\dA-Fa-f]/,lr=/\d/,ir=["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","oslas
3h","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],$e={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
3:"⊄",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:"€"},cr=["cent","copy","divide","gt","lt","not","para","times"],nn={}.hasOwnProperty,Ze={};let me;for(me in $e)nn.call($e,me)&&(Ze[$e[me]]=me);const ur=/[^\dA-Za-z]/;function hr(t,e,n){let r,s=(function(o,a,i){const l="&#x"+o.toString(16).toUpperCase();return i&&a&&!ar.test(String.fromCharCode(a))?l:l+";"})(t,e,n.omitOptionalSemicolons);if((n.useNamedReferences||n.useShortestReferences)&&(r=(function(o,a,i,l){const u=String.fromCharCode(o);if(nn.call(Ze,u)){const c=Ze[u],d="&"+c;return i&&ir.includes(c)&&!cr.includes(c)&&(!l||a&&a!==61&&ur.test(String.fromCharCode(a)))?d:d+";"}return""})(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const o=(function(a,i,l){const u="&#"+String(a);return l&&i&&!lr.test(String.fromCharCode(i))?u:u+";"})(t,e,n.omitOptionalSemicolons);o.length<s.length&&(s=o)}return r&&(!n.useShortestReferences||r.length<s.length)?r:s}function J(t,e){return or(t,Object.assign({format:hr},e))}const pr=/^>|^->|<!--|-->|--!>|<!-$/g,dr=[">"],gr=["<",">"];function At(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(e);for(;s!==-1;)r++,s=n.indexOf(e,s+e.length);return r}function mr(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function fr(t){return t.join(" ").trim()}const yr=/[ \t\n\f\r]/g;function rt(t){return typeof t=="object"?t.type==="text"&&Pt(t.value):Pt(t)}function Pt(t){return t.replace(yr,"")===""}const P=rn(1),xt=rn(-1),br=[];function rn(t){return function(e,n,r){const s=e?e.children:br;let o=(n||0)+t,a=s[o];if(!r)for(;a&&rt(a);)o+=t,a=s[o];return a}}const _r={}.hasOwnProperty;function sn(t){return function(e,n,r){return _r.call(t,e.tagName)&&t[e.tagName](e,n,r)}}const et=sn({body:function(t,e,n){const r=P(n,e);return!r||r.type!=="comment"},caption:je,colgroup:je,dd:function(t,e,n){const r=P(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")},dt:function(t,e,n){const r=P(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))},head:je,html:function(t,e,n){const r=P(n,e);return!r||r.type!=="comment"},li:function(t,e,n){const r=P(n,e);return!r||r.type==="element"&&r.tagName==="li"},optgroup:function(t,e,n){const r=P(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"},option:function(t,e,n){const r=P(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")},p:function(t,e,n){const r=P(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"))},rp:Rt,rt:Rt,tbody:function(t,e,n){const r=P(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")},td:Tt,tfoot:function(t,e,n){return!P(n,e)},th:Tt,thead:function(t,e,n){const r=P(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))},tr:function(t,e,n){const r=P(n,e);return!r||r.type==="element"&&r.tagName==="tr"}});function je(t,e,n){const r=P(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&rt(r.value.charAt(0)))}function Rt(t,e,n){const r=P(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Tt(t,e,n){const r=P(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const kr=sn({body:function(t){const e=P(t,-1,!0);return!(e&&(e.type==="comment"||e.type==="text"&&rt(e.value.charAt(0))||e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template")))},colgroup:function(t,e,n){const r=xt(n,e),s=P(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&et(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="col")},head:function(t){const e=new Set;for(const 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)}const n=t.children[0];return!n||n.type==="element"},html:function(t){const e=P(t,-1);return!e||e.type!=="comment"},tbody:function(t,e,n){const r=xt(n,e),s=P(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&et(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="tr")}}),fe={name:[[`	
4\f\r &/=>`.split(""),`	
5\f\r "&'/=>
5\``.split("")],[`\0	
6\f\r "&'/<=>`.split(""),`\0	
7\f\r "&'/<=>\``.split("")]],unquoted:[[`	
8\f\r &>`.split(""),`\0	
9\f\r "&'<=>\``.split("")],[`\0	
10\f\r "&'<=>\``.split(""),`\0	
11\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function Sr(t,e,n){const r=(function(u,c){const d=Xe(c);let h=c,p=E;if(d in u.normal)return u.property[u.normal[d]];if(d.length>4&&d.slice(0,4)==="data"&&Jn.test(c)){if(c.charAt(4)==="-"){const m=c.slice(5).replace(vt,Zn);h="data"+m.charAt(0).toUpperCase()+m.slice(1)}else{const m=c.slice(4);if(!vt.test(m)){let b=m.replace(Xn,Qn);b.charAt(0)!=="-"&&(b="-"+b),c="data"+b}}p=nt}return new p(h,c)})(t.schema,e),s=t.settings.allowParseErrors&&t.schema.space==="html"?0:1,o=t.settings.allowDangerousCharacters?0:1;let a,i=t.quote;if(!r.overloadedBoolean||n!==r.attribute&&n!==""?!r.boolean&&!r.overloadedBoolean||typeof n=="string"&&n!==r.attribute&&n!==""||(n=!!n):n=!0,n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const l=J(r.attribute,Object.assign({},t.settings.characterReferences,{subset:fe.name[s][o]}));return n===!0?l:(n=Array.isArray(n)?(r.commaSeparated?mr:fr)(n,{padLeft:!t.settings.tightCommaSeparatedLists}):String(n),t.settings.collapseEmptyAttributes&&!n?l:(t.settings.preferUnquoted&&(a=J(n,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:fe.unquoted[s][o]}))),a!==n&&(t.settings.quoteSmart&&At(n,i)>At(n,t.alternative)&&(i=t.alternative),a=i+J(n,Object.assign({},t.settings.characterReferences,{subset:(i==="'"?fe.single:fe.double)[s][o],attribute:!0}))+i),l+(a&&"="+a)))}const Cr=["<","&"];function Lt(t,e,n,r){return!n||n.type!=="element"||n.tagName!=="script"&&n.tagName!=="style"?J(t.value,Object.assign({},r.settings.characterReferences,{subset:Cr})):t.value}const vr=(function(t,e){const n=e||{};function r(s,...o){let a=r.invalid;const i=r.handlers;if(s&&wt.call(s,t)){const l=String(s[t]);a=wt.call(i,l)?i[l]:r.unknown}if(a)return a.call(this,s,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r})("type",{invalid:function(t){throw new Error("Expected node, not `"+t+"`")},unknown:function(t){throw new Error("Cannot compile unknown node `"+t.type+"`")},handlers:{comment:function(t,e,n,r){return r.settings.bogusComments?"<?"+J(t.value,Object.assign({},r.settings.characterReferences,{subset:dr}))+">":"<!--"+t.value.replace(pr,function(s){return J(s,Object.assign({},r.settings.characterReferences,{subset:gr}))})+"-->"},doctype:function(t,e,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"},element:function(t,e,n,r){const s=r.schema,o=s.space!=="svg"&&r.settings.omitOptionalTags;let a=s.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const i=[];let l;s.space==="html"&&t.tagName==="svg"&&(r.schema=tn);const u=(function(d,h){const p=[];let m,b=-1;if(h){for(m in h)if(h[m]!==null&&h[m]!==void 0){const f=Sr(d,m,h[m]);f&&p.push(f)}}for(;++b<p.length;){const f=d.settings.tightAttributes?p[b].charAt(p[b].length-1):void 0;b!==p.length-1&&f!=='"'&&f!=="'"&&(p[b]+=" ")}return p.join("")})(r,t.properties),c=r.all(s.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=s,c&&(a=!1),!u&&o&&kr(t,e,n)||(i.push("<",t.tagName,u?" "+u:""),a&&(s.space==="svg"||r.settings.closeSelfClosing)&&(l=u.charAt(u.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&i.push(" "),i.push("/")),i.push(">")),i.push(c),a||o&&et(t,e,n)||i.push("</"+t.tagName+">"),i.join("")},raw:function(t,e,n,r){return r.settings.allowDangerousHtml?t.value:Lt(t,0,n,r)},root:function(t,e,n,r){return r.all(t)},text:Lt}}),wr={},Nr={},Ar=[];function Pr(t,e,n){return vr(t,e,n,this)}function xr(t){const e=[],n=t&&t.children||Ar;let r=-1;for(;++r<n.length;)e[r]=this.one(n[r],r,t);return e.join("")}function we(t,e){const n=typeof t=="string"?{}:{...t.colorReplacements},r=typeof t=="string"?t:t.name;for(const[s,o]of Object.entries(e?.colorReplacements||{}
11))typeof o=="string"?n[s]=o:s===r&&Object.assign(n,o);return n}function F(t,e){return t&&e?.[t?.toLowerCase()]||t}function Rr(t){return Array.isArray(t)?t:[t]}async function on(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function st(t){return!t||["plaintext","txt","text","plain"].includes(t)}function Tr(t){return t==="ansi"||st(t)}function ot(t){return t==="none"}function Lr(t){return ot(t)}function an(t,e){if(!e)return t;t.properties||={},t.properties.class||=[],typeof t.properties.class=="string"&&(t.properties.class=t.properties.class.split(/\s+/g)),Array.isArray(t.properties.class)||(t.properties.class=[]);const n=Array.isArray(e)?e:e.split(/\s+/g);for(const r of n)r&&!t.properties.class.includes(r)&&t.properties.class.push(r);return t}function Re(t,e=!1){if(t.length===0)return[["",0]];const n=t.split(/(\r?\n)/g);let r=0;const s=[];for(let o=0;o<n.length;o+=2){const a=e?n[o]+(n[o+1]||""):n[o];s.push([a,r]),r+=n[o].length,r+=n[o+1]?.length||0}return s}function Ir(t){const e=Re(t,!0).map(([n])=>n);return{lines:e,indexToPos:function(n){if(n===t.length)return{line:e.length-1,character:e[e.length-1].length};let r=n,s=0;for(const o of e){if(r<o.length)break;r-=o.length,s++}return{line:s,character:r}},posToIndex:function(n,r){let s=0;for(let o=0;o<n;o++)s+=e[o].length;return s+=r,s}}}const at="light-dark()",Er=["color","background-color"];function Or(t,e){let n=0;const r=[];for(const s of e)s>n&&r.push({...t,content:t.content.slice(n,s),offset:t.offset+n}),n=s;return n<t.content.length&&r.push({...t,content:t.content.slice(n),offset:t.offset+n}),r}function Mr(t,e){const n=Array.from(e instanceof Set?e:new Set(e)).sort((r,s)=>r-s);return n.length?t.map(r=>r.flatMap(s=>{const o=n.filter(a=>s.offset<a&&a<s.offset+s.content.length).map(a=>a-s.offset).sort((a,i)=>a-i);return o.length?Or(s,o):s})):t}function Gr(t,e,n,r,s="css-vars"){const o={content:t.content,explanation:t.explanation,offset:t.offset},a=e.map(c=>Ne(t.variants[c])),i=new Set(a.flatMap(c=>Object.keys(c))),l={},u=(c,d)=>{const h=d==="color"?"":d==="background-color"?"-bg":`-${d}`;return n+e[c]+(d==="color"?"":h)};return a.forEach((c,d)=>{for(const h of i){const p=c[h]||"inherit";if(d===0&&r&&Er.includes(h))if(r===at&&a.length>1){const m=e.findIndex(_=>_==="light"),b=e.findIndex(_=>_==="dark");if(m===-1||b===-1)throw new T('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const f=a[m][h]||"inherit",g=a[b][h]||"inherit";l[h]=`light-dark(${f}, ${g})`,s==="css-vars"&&(l[u(d,h)]=p)}else l[h]=p;else s==="css-vars"&&(l[u(d,h)]=p)}}),o.htmlStyle=l,o}function Ne(t){const e={};if(t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle){t.fontStyle&I.Italic&&(e["font-style"]="italic"),t.fontStyle&I.Bold&&(e["font-weight"]="bold");const n=[];t.fontStyle&I.Underline&&n.push("underline"),t.fontStyle&I.Strikethrough&&n.push("line-through"),n.length&&(e["text-decoration"]=n.join(" "))}return e}function tt(t){return typeof t=="string"?t:Object.entries(t).map(([e,n])=>`${e}:${n}`).join(";")}const ln=new WeakMap;function Te(t,e){ln.set(t,e)}function ce(t){return ln.get(t)}class ee{_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 ee(Object.fromEntries(Rr(n).map(r=>[r,Ye])),e)}constructor(...e){if(e.length===2){const[n,r]=e;this.lang=r,this._stacks=n}else{const[n,r,s]=e;this.lang=r,this._stacks={[s]:n}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return(function(n){const r=[],s=new Set;function o(a){if(s.has(a))return;s.add(a);const i=a?.nameScopesList?.scopeName;i&&r.push(i),a.parent&&o(a.parent)}return o(n),r})(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function Br(){const t=new WeakMap;function e(n){if(!t.has(n.meta)){let r=function(a){if(typeof a=="number"){if(a<0||a>n.source.length)throw new T(`Invalid decoration offset: ${a}. Code length: ${n.source.length}`);return{...s.indexToPos(a),offset:a}}{const i=s.lines[a.line];if(i===void 0)throw new T(`Invalid decoration position ${JSON.stringify(a)}. Lines length: ${s.lines.length}`);let l=a.character;if(l<0&&(l=i.length+l),l<0||l>i.length)throw new T(`Invalid decoration position ${JSON.stringify(a)}. Line ${a.line} length: ${i.length}`);return{...a,character:l,offset:s.posToIndex(a.line,l)}}};const s=Ir(n.source),o=(n.options.decorations||[]).map(a=>({...a,start:r(a.start),end:r(a.end)}));(function(a){for(let i=0;i<a.length;i++){const l=a[i];if(l.start.offset>l.end.offset)throw new T(`Invalid decoration range: ${JSON.stringify(l.start)} - ${JSON.stringify(l.end)}`);for(let u=i+1;u<a.length;u++){const c=a[u],d=l.start.offset<=c.start.offset&&c.start.offset<l.end.offset,h=l.start.offset<c.end.offset&&c.end.offset<=l.end.offset,p=c.start.offset<=l.start.offset&&l.start.offset<c.end.offset,m=c.start.offset<l.end.offset&&l.end.offset<=c.end.offset;if(d||h||p||m){if(d&&h||p&&m||p&&l.start.offset===l.end.offset||h&&c.start.offset===c.end.offset)continue;throw new T(`Decorations ${JSON.stringify(l.start)} and ${JSON.stringify(c.start)} intersect.`)}}}})(o),t.set(n.meta,{decorations:o,converter:s,source:n.source})}return t.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(this.options.decorations?.length)return Mr(n,e(this).decorations.flatMap(r=>[r.start.offset,r.end.offset]))},code(n){if(!this.options.decorations?.length)return;const r=e(this),s=Array.from(n.children).filter(c=>c.type==="element"&&c.tagName==="span");if(s.length!==r.converter.lines.length)throw new T(`Number of lines in code element (${s.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function o(c,d,h,p){const m=s[c];let b="",f=-1,g=-1;if(d===0&&(f=0),h===0&&(g=0),h===Number.POSITIVE_INFINITY&&(g=m.children.length),f===-1||g===-1)for(let k=0;k<m.children.length;k++)b+=cn(m.children[k]),f===-1&&b.length===d&&(f=k+1),g===-1&&b.length===
11h&&(g=k+1);if(f===-1)throw new T(`Failed to find start index for decoration ${JSON.stringify(p.start)}`);if(g===-1)throw new T(`Failed to find end index for decoration ${JSON.stringify(p.end)}`);const _=m.children.slice(f,g);if(p.alwaysWrap||_.length!==m.children.length)if(p.alwaysWrap||_.length!==1||_[0].type!=="element"){const k={type:"element",tagName:"span",properties:{},children:_};i(k,p,"wrapper"),m.children.splice(f,_.length,k)}else i(_[0],p,"token");else i(m,p,"line")}function a(c,d){s[c]=i(s[c],d,"line")}function i(c,d,h){const p=d.properties||{},m=d.transform||(b=>b);return c.tagName=d.tagName||"span",c.properties={...c.properties,...p,class:c.properties.class},d.properties?.class&&an(c,d.properties.class),c=m(c,h)||c}const l=[],u=r.decorations.sort((c,d)=>d.start.offset-c.start.offset||c.end.offset-d.end.offset);for(const c of u){const{start:d,end:h}=c;if(d.line===h.line)o(d.line,d.character,h.character,c);else if(d.line<h.line){o(d.line,d.character,Number.POSITIVE_INFINITY,c);for(let p=d.line+1;p<h.line;p++)l.unshift(()=>a(p,c));o(h.line,0,h.character,c)}}l.forEach(c=>c())}}}function cn(t){return t.type==="text"?t.value:t.type==="element"?t.children.map(cn).join(""):""}const Dr=[Br()];function Ae(t){const e=(function(n){const r=[],s=[],o=[];for(const a of n)switch(a.enforce){case"pre":r.push(a);break;case"post":s.push(a);break;default:o.push(a)}return{pre:r,post:s,normal:o}})(t.transformers||[]);return[...e.pre,...e.normal,...e.post,...Dr]}var H=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Fe={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function $r(t,e){const n=t.indexOf("\x1B",e);if(n!==-1&&t[n+1]==="["){const r=t.indexOf("m",n);if(r!==-1)return{sequence:t.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:t.length}}function It(t){const e=t.shift();if(e==="2"){const n=t.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}if(e==="5"){const n=t.shift();if(n)return{type:"table",index:Number(n)}}}function jr(t){const e=[];for(;t.length>0;){const n=t.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)e.push({type:"resetAll"});else if(r<=9)Fe[r]&&e.push({type:"setDecoration",value:Fe[r]});else if(r<=29){const s=Fe[r-20];s&&(e.push({type:"resetDecoration",value:s}),s==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)e.push({type:"setForegroundColor",value:{type:"named",name:H[r-30]}});else if(r===38){const s=It(t);s&&e.push({type:"setForegroundColor",value:s})}else if(r===39)e.push({type:"resetForegroundColor"});else if(r<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:H[r-40]}});else if(r===48){const s=It(t);s&&e.push({type:"setBackgroundColor",value:s})}else r===49?e.push({type:"resetBackgroundColor"}):r===53?e.push({type:"setDecoration",value:"overline"}):r===55?e.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?e.push({type:"setForegroundColor",value:{type:"named",name:H[r-90+8]}}):r>=100&&r<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:H[r-100+8]}})}return e}var Fr={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function Ur(t=Fr){function e(o){return t[o]}function n(o){return`#${o.map(a=>Math.max(0,Math.min(a,255)).toString(16).padStart(2,"0")).join("")}`}let r;function s(o){return(function(){if(r)return r;r=[];for(let l=0;l<H.length;l++)r.push(e(H[l]));let a=[0,95,135,175,215,255];for(let l=0;l<6;l++)for(let u=0;u<6;u++)for(let c=0;c<6;c++)r.push(n([a[l],a[u],a[c]]));let i=8;for(let l=0;l<24;l++,i+=10)r.push(n([i,i,i]));return r})()[o]}return{value:function(o){switch(o.type){case"named":return e(o.name);case"rgb":return n(o.rgb);case"table":return s(o.index)}}}}const Wr={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",
11white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function zr(t,e,n){const r=we(t,n),s=Re(e),o=Ur(Object.fromEntries(H.map(i=>{const l=`terminal.ansi${i[0].toUpperCase()}${i.substring(1)}`,u=t.colors?.[l];return[i,u||Wr[i]]}))),a=(function(){let i=null,l=null,u=new Set;return{parse(c){const d=[];let h=0;do{const p=$r(c,h),m=p.sequence?c.substring(h,p.startPosition):c.substring(h);if(m.length>0&&d.push({value:m,foreground:i,background:l,decorations:new Set(u)}),p.sequence){const b=jr(p.sequence);for(const f of b)f.type==="resetAll"?(i=null,l=null,u.clear()):f.type==="resetForegroundColor"?i=null:f.type==="resetBackgroundColor"?l=null:f.type==="resetDecoration"&&u.delete(f.value);for(const f of b)f.type==="setForegroundColor"?i=f.value:f.type==="setBackgroundColor"?l=f.value:f.type==="setDecoration"&&u.add(f.value)}h=p.position}while(h<c.length);return d}}})();return s.map(i=>a.parse(i[0]).map(l=>{let u,c;l.decorations.has("reverse")?(u=l.background?o.value(l.background):t.bg,c=l.foreground?o.value(l.foreground):t.fg):(u=l.foreground?o.value(l.foreground):t.fg,c=l.background?o.value(l.background):void 0),u=F(u,r),c=F(c,r),l.decorations.has("dim")&&(u=(function(h){const p=h.match(/#([0-9a-f]{3,8})/i);if(p){const b=p[1];if(b.length===8){const f=Math.round(Number.parseInt(b.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${b.slice(0,6)}${f}`}if(b.length===6)return`#${b}80`;if(b.length===4){const f=b[0],g=b[1],_=b[2],k=b[3];return`#${f}${f}${g}${g}${_}${_}${Math.round(Number.parseInt(`${k}${k}`,16)/2).toString(16).padStart(2,"0")}`}if(b.length===3){const f=b[0],g=b[1],_=b[2];return`#${f}${f}${g}${g}${_}${_}80`}}const m=h.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return m?`var(${m[1]}-dim)`:h})(u));let d=I.None;return l.decorations.has("bold")&&(d|=I.Bold),l.decorations.has("italic")&&(d|=I.Italic),l.decorations.has("underline")&&(d|=I.Underline),l.decorations.has("strikethrough")&&(d|=I.Strikethrough),{content:l.value,offset:i[1],color:u,bgColor:c,fontStyle:d}}))}function lt(t,e,n={}){const{theme:r=t.getLoadedThemes()[0]}=n,s=t.resolveLangAlias(n.lang||"text");if(st(s)||ot(r))return Re(e).map(l=>[{content:l[0],offset:l[1]}]);const{theme:o,colorMap:a}=t.setTheme(r);if(s==="ansi")return zr(o,e,n);const i=t.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==i.name)throw new T(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${i.name}"`);if(!n.grammarState.themes.includes(o.name))throw new T(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${o.name}"`)}return qr(e,i,o,a,n)}function qr(t,e,n,r,s){const o=it(t,e,n,r,s),a=new ee(o.stateStack,e.name,n.name);return Te(o.tokens,a),o.tokens}function it(t,e,n,r,s){const o=we(n,s),{tokenizeMaxLineLength:a=0,tokenizeTimeLimit:i=500}=s,l=Re(t);let u=s.grammarState?(function(h,p){if(!(h instanceof ee))throw new T("Invalid grammar state");return h.getInternalStack(p)})(s.grammarState,n.name)??Ye:s.grammarContextCode!=null?it(s.grammarContextCode,e,n,r,{...s,grammarState:void 0,grammarContextCode:void 0}).stateStack:Ye,c=[];const d=[];for(let h=0,p=l.length;h<p;h++){const[m,b]=l[h];if(m===""){c=[],d.push([]);continue}if(a>0&&m.length>=a){c=[],d.push([{content:m,offset:b,color:"",fontStyle:0}]);continue}let f,g,_;s.includeExplanation&&(f=e.tokenizeLine(m,u,i),g=f.tokens,_=0);const k=e.tokenizeLine2(m,u,i),v=k.tokens.length/2;for(let C=0;C<v;C++){const w=k.tokens[2*C],x=C+1<v?k.tokens[2*C+2]:m.length;if(w===x)continue;const U=k.tokens[2*C+1],R=F(r[Q.getForeground(U)],o),he=Q.getFontStyle(U),V={content:m.substring(w,x),offset:b+w,color:R,fontStyle:he};if(s.includeExplanation){const j=[];if(s.includeExplanation!=="scopeName")for(const O of n.settings){let B;switch(typeof O.scope){case"string":B=O.scope.split(/,/).map(D=>D.trim());break;case"object":B=O.scope;break;default:continue}j.push({settings:O,selectors:B.map(D=>D.split(/ /))})}V.explanation=[];let W=0;for(;w+W<x;){const O=g[_],B=m.substring(O.startIndex,O.endIndex);W+=B.length,V.explanation.push({content:B,scopes:s.includeExplanation==="scopeName"?Hr(O.scopes):Kr(j,O.scopes)}),_+=1}}c.push(V)}d.push(c),c=[],u=k.ruleStack}return{tokens:d,stateStack:u}}function Hr(t){return t.map(e=>({scopeName:e}))}function Kr(t,e){const n=[];for(let r=0,s=e.length;r<s;r++){const o=e[r];n[r]={scopeName:o,themeMatches:Yr(t,o,e.slice(0,r))}}return n}function Et(t,e){return t===e||e.substring(0,t.length)===t&&e[t.length]==="."}function Vr(t,e,n){if(!Et(t[t.length-1],e))return!1;let r=t.length-2,s=n.length-1;for(;r>=0&&s>=0;)Et(t[r],n[s])&&(r-=1),s-=1;return r===-1}function Yr(t,e,n){const r=[];for(const{selectors:s,settings:o}of t)for(const a of s)if(Vr(a,e,n)){r.push(o);break}return r}function un(t,e,n){const r=Object.entries(n.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),s=r.map(l=>{const u=lt(t,e,{...n,theme:l.theme});return{tokens:u,state:ce(u),theme:typeof l.theme=="string"?l.theme:l.theme.name}}),o=(function(...l){const u=l.map(()=>[]),c=l.length;for(let d=0;d<l[0].length;d++){const h=l.map(f=>f[d]),p=u.map(()=>[]);u.forEach((f,g)=>f.push(p[g]));const m=h.map(()=>0),b=h.map(f=>f[0]);for(;b.every(f=>f);){const f=Math.min(...b.map(g=>g.content.length));for(let g=0;g<c;g++){const _=b[g];_.content.length===f?(p[g].push(_),m[g]+=1,b[g]=h[g][m[g]]):(p[g].push({..._,content:_.content.slice(0,f)}),b[g]={..._,content:_.content.slice(f),offset:_.offset+f})}}}return u})(...s.map(l=>l.tokens)),a=o[0].map((l,u)=>l.map((c,d)=>{const h={content:c.content,variants:{},offset:c.offset};return"includeExplanation"in n&&n.includeExplanation&&(h.explanation=c.explanation),o.forEach((p,m)=>{const{content:b,explanation:f,offset:g,..._}=p[u][d];h.variants[r[m].color]=_}),h})),i=s[0].state?new ee(Object.fromEntries(s.map(l=>[l.theme,l.state?.getInternalStack(l.theme)])),s[0].state.lang):void 0;return i&&Te(a,i),a}function Pe(t,e,n){let r,s,o,a,i,l;if("themes"in n){const{defaultColor:u="light",cssVariablePrefix:c="--shiki-",colorsRendering:d="css-vars"}=n,h=Object.entries(n.themes).filter(g=>g[1]).map(g=>({color:g[0],theme:g[1]})).sort((g,_)=>g.color===u?-1:_.color===u?1:0);if(h.length===0)throw new T("`themes` option must not be empty");const p=un(t,e,n);if(l=ce(p),u&&at!==u&&!h.find(g=>g.color===u))throw new T(`\`themes\` option must contain the defaultColor key \`${u}\``);const m=h.map(g=>t.getTheme(g.theme)),b=h.map(g=>g.color);o=p.map(g=>g.map(_=>Gr(_,b,c,u,d))),l&&Te(o,l);const f=h.map(g=>we(g.theme,n));s=Ot(h,m,f,c,u,"fg",d),r=Ot(h,m,f,c,u,"bg",d),a=`shiki-themes ${m.map(g=>g.name).join(" ")}`,i=u?void 0:[s,r].join(";")}else{if(!("theme"in n))throw new T("Invalid options, either `theme` or `themes` must be provided");{const u=we(n.theme,n);o=lt(t,e,n);const c=t.getTheme(n.theme);r=F(c.bg,u),s=F(c.fg,u),a=c.name,l=ce(o)}}return{tokens:o,fg:s,bg:r,themeName:a,rootStyle:i,grammarState:l}}function Ot(t,e,n,r,s,o,a){return t.map((i,l)=>{const u=F(e[l][o],n[l])||"inherit",c=`${r+i.color}${o==="bg"?"-bg":""}:${u}`;
11if(l===0&&s){if(s===at&&t.length>1){const d=t.findIndex(p=>p.color==="light"),h=t.findIndex(p=>p.color==="dark");if(d===-1||h===-1)throw new T('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${F(e[d][o],n[d])||"inherit"}, ${F(e[h][o],n[h])||"inherit"});${c}`}return u}return a==="css-vars"?c:null}).filter(i=>!!i).join(";")}function xe(t,e,n,r={meta:{},options:n,codeToHast:(s,o)=>xe(t,s,o),codeToTokens:(s,o)=>Pe(t,s,o)}){let s=e;for(const m of Ae(n))s=m.preprocess?.call(r,s,n)||s;let{tokens:o,fg:a,bg:i,themeName:l,rootStyle:u,grammarState:c}=Pe(t,s,n);const{mergeWhitespaces:d=!0,mergeSameStyleTokens:h=!1}=n;d===!0?o=(function(m){return m.map(b=>{const f=[];let g,_="";return b.forEach((k,v)=>{const C=!(k.fontStyle&&(k.fontStyle&I.Underline||k.fontStyle&I.Strikethrough));C&&k.content.match(/^\s+$/)&&b[v+1]?(g===void 0&&(g=k.offset),_+=k.content):_?(C?f.push({...k,offset:g,content:_+k.content}):f.push({content:_,offset:g},k),g=void 0,_=""):f.push(k)}),f})})(o):d==="never"&&(o=(function(m){return m.map(b=>b.flatMap(f=>{if(f.content.match(/^\s+$/))return f;const g=f.content.match(/^(\s*)(.*?)(\s*)$/);if(!g)return f;const[,_,k,v]=g;if(!_&&!v)return f;const C=[{...f,offset:f.offset+_.length,content:k}];return _&&C.unshift({content:_,offset:f.offset}),v&&C.push({content:v,offset:f.offset+_.length+k.length}),C}))})(o)),h&&(o=(function(m){return m.map(b=>{const f=[];for(const g of b){if(f.length===0){f.push({...g});continue}const _=f[f.length-1],k=tt(_.htmlStyle||Ne(_)),v=tt(g.htmlStyle||Ne(g)),C=_.fontStyle&&(_.fontStyle&I.Underline||_.fontStyle&I.Strikethrough),w=g.fontStyle&&(g.fontStyle&I.Underline||g.fontStyle&I.Strikethrough);C||w||k!==v?f.push({...g}):_.content+=g.content}return f})})(o));const p={...r,get source(){return s}};for(const m of Ae(n))o=m.tokens?.call(p,o)||o;return Xr(o,{...n,fg:a,bg:i,themeName:l,rootStyle:n.rootStyle!==!1&&(n.rootStyle??u)},p,c)}function Xr(t,e,n,r=ce(t)){const s=Ae(e),o=[],a={type:"root",children:[]},{structure:i="classic",tabindex:l="0"}=e,u={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?u.style=e.rootStyle:u.style=`background-color:${e.bg};color:${e.fg}`),l!==!1&&l!=null&&(u.tabindex=l.toString());for(const[b,f]of Object.entries(e.meta||{}))b.startsWith("_")||(u[b]=f);let c={type:"element",tagName:"pre",properties:u,children:[],data:e.data},d={type:"element",tagName:"code",properties:{},children:o};const h=[],p={...n,structure:i,addClassToHast:an,get source(){return n.source},get tokens(){return t},get options(){return e},get root(){return a},get pre(){return c},get code(){return d},get lines(){return h}};if(t.forEach((b,f)=>{f&&(i==="inline"?a.children.push({type:"element",tagName:"br",properties:{},children:[]}):i==="classic"&&o.push({type:"text",value:`
12`}));let g={type:"element",tagName:"span",properties:{class:"line"},children:[]},_=0;for(const k of b){let v={type:"element",tagName:"span",properties:{...k.htmlAttrs},children:[{type:"text",value:k.content}]};const C=tt(k.htmlStyle||Ne(k));C&&(v.properties.style=C);for(const w of s)v=w?.span?.call(p,v,f+1,_,g,k)||v;i==="inline"?a.children.push(v):i==="classic"&&g.children.push(v),_+=k.content.length}if(i==="classic"){for(const k of s)g=k?.line?.call(p,g,f+1)||g;h.push(g),o.push(g)}else i==="inline"&&h.push(g)}),i==="classic"){for(const b of s)d=b?.code?.call(p,d)||d;c.children.push(d);for(const b of s)c=b?.pre?.call(p,c)||c;a.children.push(c)}else if(i==="inline"){const b=[];let f={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const _ of a.children)_.type==="element"&&_.tagName==="br"?(b.push(f),f={type:"element",tagName:"span",properties:{class:"line"},children:[]}):_.type!=="element"&&_.type!=="text"||f.children.push(_);b.push(f);let g={type:"element",tagName:"code",properties:{},children:b};for(const _ of s)g=_?.code?.call(p,g)||g;a.children=[];for(let _=0;_<g.children.length;_++){_>0&&a.children.push({type:"element",tagName:"br",properties:{},children:[]});const k=g.children[_];k.type==="element"&&a.children.push(...k.children)}}let m=a;for(const b of s)m=b?.root?.call(p,m)||m;return r&&Te(m,r),m}const Jr=function(t,e){const n=wr,r=n.quote||'"',s=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Pr,all:xr,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Hn,characterReferences:n.characterReferences||Nr,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?tn:er,quote:r,alternative:s}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)};function Qr(t,e,n){const r={meta:{},options:n,codeToHast:(o,a)=>xe(t,o,a),codeToTokens:(o,a)=>Pe(t,o,a)};let s=Jr(xe(t,e,n,r));for(const o of Ae(n))s=o.postprocess?.call(r,s,n)||s;return s}const Zr="#333333",es="#bbbbbb",ts="#fffffe",ns="#1e1e1e",Mt="__shiki_resolved";function ct(t){if(t?.[Mt])return t;const e={...t};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){const i=e.settings?e.settings.find(l=>!l.name&&!l.scope):void 0;i?.settings?.foreground&&(r=i.settings.foreground),i?.settings?.background&&(n=i.settings.background),!r&&e?.colors?.["editor.foreground"]&&(r=e.colors["editor.foreground"]),!n&&e?.colors?.["editor.background"]&&(n=e.colors["editor.background"]),r||(r=e.type==="light"?Zr:es),n||(n=e.type==="light"?ts:ns),e.fg=r,e.bg=n}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let s=0;const o=new Map;function a(i){if(o.has(i))return o.get(i);s+=1;const l=`#${s.toString(16).padStart(8,"0").toLowerCase()}`;return e.colorReplacements?.[`#${l}`]?a(i):(o.set(i,l),l)}e.settings=e.settings.map(i=>{const l=i.settings?.foreground&&!i.settings.foreground.startsWith("#"),u=i.settings?.background&&!i.settings.background.startsWith("#");if(!l&&!u)return i;const c={...i,settings:{...i.settings}};if(l){const d=a(i.settings.foreground);e.colorReplacements[d]=i.settings.foreground,c.settings.foreground=d}if(u){const d=a(i.settings.background);e.colorReplacements[d]=i.settings.background,c.settings.background=d}return c});for(const i of Object.keys(e.colors||{}))if((i==="editor.foreground"||i==="editor.background"||i.startsWith("terminal.ansi"))&&!e.colors[i]?.startsWith("#")){const l=a(e.colors[i]);e.colorReplacements[l]=e.colors[i],e.colors[i]=l}return Object.defineProperty(e,Mt,{enumerable:!1,writable:!1,value:!0}),e}async function hn(t){return Array.from(new Set((await Promise.all(t.filter(e=>!Tr(e)).map(async e=>await on(e).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function pn(t){return(await Promise.all(t.map(async e=>Lr(e)?null:ct(await on(e))))).filter(e=>!!e)}function rs(t,e=3){e>3||console.trace(`[SHIKI DEPRECATE]: ${t}`)}
12class Y extends Error{constructor(e){super(e),this.name="ShikiError"}}function dn(t,e){if(!e)return t;if(e[t]){const n=new Set([t]);for(;e[t];){if(t=e[t],n.has(t))throw new Y(`Circular alias \`${Array.from(n).join(" -> ")} -> ${t}\``);n.add(t)}}return t}class ss extends qn{constructor(e,n,r,s={}){super(e),this._resolver=e,this._themes=n,this._langs=r,this._alias=s,this._themes.map(o=>this.loadTheme(o)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const n=ct(e);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let n=this._textmateThemeCache.get(e);n||(n=_e.createFromRawTheme(e),this._textmateThemeCache.set(e,n)),this._syncRegistry.setTheme(n)}getGrammar(e){return e=dn(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const n=new Set([...this._langMap.values()].filter(o=>o.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const r={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const s=this.loadGrammarWithConfiguration(e.scopeName,1,r);if(s.name=e.name,this._resolvedGrammars.set(e.name,s),e.aliases&&e.aliases.forEach(o=>{this._alias[o]=e.name}),this._loadedLanguagesCache=null,n.size)for(const o of n)this._resolvedGrammars.delete(o.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(o.scopeName),this._syncRegistry?._grammars?.delete(o.scopeName),this.loadLanguage(this._langMap.get(o.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const s of e)this.resolveEmbeddedLanguages(s);const n=Array.from(this._langGraph.entries()),r=n.filter(([s,o])=>!o);if(r.length){const s=n.filter(([o,a])=>a?(a.embeddedLanguages||a.embeddedLangs)?.some(l=>r.map(([u])=>u).includes(l)):!1).filter(o=>!r.includes(o));throw new Y(`Missing languages ${r.map(([o])=>`\`${o}\``).join(", ")}, required by ${s.map(([o])=>`\`${o}\``).join(", ")}`)}for(const[s,o]of n)this._resolver.addLanguage(o);for(const[s,o]of n)this.loadLanguage(o)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const n=e.embeddedLanguages??e.embeddedLangs;if(n)for(const r of n)this._langGraph.set(r,this._langMap.get(r))}}class os{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,n){this._onigLib={createOnigScanner:r=>e.createScanner(r),createOnigString:r=>e.createString(r)},n.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(n=>{this._langs.set(n,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(e.scopeName)})}getInjections(e){const n=e.split(".");let r=[];for(let s=1;s<=n.length;s++){const o=n.slice(0,s).join(".");r=[...r,...this._injections.get(o)||[]]}return r}}let re=0;function as(t){re+=1,t.warnings!==!1&&re>=10&&re%10==0&&console.warn(`[Shiki] ${re} 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 Y("`engine` option is required for synchronous mode");const n=(t.langs||[]).flat(1),r=(t.themes||[]).flat(1).map(ct),s=new os(t.engine,n),o=new ss(s,r,n,t.langAlias);let a;function i(h){if(h==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};c();const p=o.getTheme(h);if(!p)throw new Y(`Theme \`${h}
12\` not found, you may need to load it first`);return p}function l(...h){c(),o.loadLanguages(h.flat(1))}function u(...h){c();for(const p of h.flat(1))o.loadTheme(p)}function c(){if(e)throw new Y("Shiki instance has been disposed")}function d(){e||(e=!0,o.dispose(),re-=1)}return{setTheme:function(h){c();const p=i(h);return a!==h&&(o.setTheme(p),a=h),{theme:p,colorMap:o.getColorMap()}},getTheme:i,getLanguage:function(h){c();const p=o.getGrammar(typeof h=="string"?h:h.name);if(!p)throw new Y(`Language \`${h}\` not found, you may need to load it first`);return p},getLoadedThemes:function(){return c(),o.getLoadedThemes()},getLoadedLanguages:function(){return c(),o.getLoadedLanguages()},resolveLangAlias:function(h){return dn(h,t.langAlias)},loadLanguage:async function(...h){return l(await hn(h))},loadLanguageSync:l,loadTheme:async function(...h){return c(),u(await pn(h))},loadThemeSync:u,dispose:d,[Symbol.dispose]:d}}async function ls(t){t.engine||rs("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,n,r]=await Promise.all([pn(t.themes||[]),hn(t.langs||[]),t.engine]);return as({...t,themes:e,langs:n,engine:r})}async function is(t){const e=await ls(t);return{getLastGrammarState:(...n)=>(function(...r){if(r.length===2)return ce(r[1]);const[s,o,a={}
12]=r,{lang:i="text",theme:l=s.getLoadedThemes()[0]}=a;if(st(i)||ot(l))throw new T("Plain language does not have grammar state");if(i==="ansi")throw new T("ANSI language does not have grammar state");const{theme:u,colorMap:c}=s.setTheme(l),d=s.getLanguage(i);return new ee(it(o,d,u,c,a).stateStack,d.name,u.name)})(e,...n),codeToTokensBase:(n,r)=>lt(e,n,r),codeToTokensWithThemes:(n,r)=>un(e,n,r),codeToTokens:(n,r)=>Pe(e,n,r),codeToHast:(n,r)=>xe(e,n,r),codeToHtml:(n,r)=>Qr(e,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}export{T as ShikiError,an as addClassToHast,F as applyColorReplacements,xe as codeToHast,Qr as codeToHtml,Pe as codeToTokens,lt as codeToTokensBase,un as codeToTokensWithThemes,is as createHighlighterCore,Ir as createPositionConverter,ls as createShikiInternal,as as createShikiInternalSync,Gr as flatTokenVariants,Ne as getTokenStyleObject,Jr as hastToHtml,ot as isNoneTheme,st as isPlainLang,Tr as isSpecialLang,Lr as isSpecialTheme,on as normalizeGetter,ct as normalizeTheme,we as resolveColorReplacements,Re as splitLines,Or as splitToken,Mr as splitTokens,tt as stringifyTokenStyle,Rr as toArray,zr as tokenizeAnsiWithTheme,qr as tokenizeWithTheme,Xr as tokensToHast,Br as transformerDecorations,rs as warnDeprecated};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.