/*!
Copyright (c) 2026 Lenovo SSG BASD. All rights reserved.
@license Proprietary

This software is the confidential and proprietary property of Lenovo SSG BASD.
You shall not disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement.

--- Build Info ---
Version: 1.1.1
Build Time: 2026/2/26 17:21:00
Build Commit: 81e556ed827e2f043668506dae6fae8dbb9ef395
*/
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../common/dist/index.js");let e=0;class a{constructor(t,a,i,r){this.name=t,this.set=a,this.base=i,this.modified=r,this.id=e++}toString(){let{name:t}=this;for(let e of this.modified)e.name&&(t=`${e.name}(${t})`);return t}static define(t,e){let i="string"==typeof t?t:"?";if(t instanceof a&&(e=t),null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");let r=new a(i,[],null,[]);if(r.set.push(r),e)for(let a of e.set)r.set.push(a);return r}static defineModifier(t){let e=new r(t);return t=>t.modified.indexOf(e)>-1?t:r.get(t.base||t,t.modified.concat(e).sort((t,e)=>t.id-e.id))}}let i=0;class r{constructor(t){this.name=t,this.instances=[],this.id=i++}static get(t,e){if(!e.length)return t;let i=e[0].instances.find(a=>{return a.base==t&&(i=e,r=a.modified,i.length==r.length&&i.every((t,e)=>t==r[e]));var i,r});if(i)return i;let o=[],s=new a(t.name,o,t,e);for(let a of e)a.instances.push(s);let n=function(t){let e=[[]];for(let a=0;a<t.length;a++)for(let i=0,r=e.length;i<r;i++)e.push(e[i].concat(t[a]));return e.sort((t,e)=>e.length-t.length)}(e);for(let a of t.set)if(!a.modified.length)for(let t of n)o.push(r.get(a,t));return s}}const o=new t.NodeProp({combine(t,e){let a,i,r;for(;t||e;){if(!t||e&&t.depth>=e.depth?(r=e,e=e.next):(r=t,t=t.next),a&&a.mode==r.mode&&!r.context&&!a.context)continue;let o=new s(r.tags,r.mode,r.context);a?a.next=o:i=o,a=o}return i}});class s{constructor(t,e,a,i){this.tags=t,this.mode=e,this.context=a,this.next=i}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}}function n(t,e){let a=Object.create(null);for(let o of t)if(Array.isArray(o.tag))for(let t of o.tag)a[t.id]=o.class;else a[o.tag.id]=o.class;let{scope:i,all:r=null}=e||{};return{style:t=>{let e=r;for(let i of t)for(let t of i.set){let i=a[t.id];if(i){e=e?e+" "+i:i;break}}return e},scope:i}}s.empty=new s([],2,null);class l{constructor(t,e,a){this.at=t,this.highlighters=e,this.span=a,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(e,a,i,r,o){let{type:n,from:l,to:h}=e;if(l>=i||h<=a)return;n.isTop&&(o=this.highlighters.filter(t=>!t.scope||t.scope(n)));let g=r,d=c(e)||s.empty,f=function(t,e){let a=null;for(let i of t){let t=i.style(e);t&&(a=a?a+" "+t:t)}return a}(o,d.tags);if(f&&(g&&(g+=" "),g+=f,1==d.mode&&(r+=(r?" ":"")+f)),this.startSpan(Math.max(a,l),g),d.opaque)return;let m=e.tree&&e.tree.prop(t.NodeProp.mounted);if(m&&m.overlay){let t=e.node.enter(m.overlay[0].from+l,1),s=this.highlighters.filter(t=>!t.scope||t.scope(m.tree.type)),n=e.firstChild();for(let c=0,d=l;;c++){let f=c<m.overlay.length?m.overlay[c]:null,p=f?f.from+l:h,u=Math.max(a,d),k=Math.min(i,p);if(u<k&&n)for(;e.from<k&&(this.highlightRange(e,u,k,r,o),this.startSpan(Math.min(k,e.to),g),!(e.to>=p)&&e.nextSibling()););if(!f||p>i)break;d=f.to+l,d>a&&(this.highlightRange(t.cursor(),Math.max(a,f.from+l),Math.min(i,d),"",s),this.startSpan(Math.min(i,d),g))}n&&e.parent()}else if(e.firstChild()){m&&(r="");do{if(!(e.to<=a)){if(e.from>=i)break;this.highlightRange(e,a,i,r,o),this.startSpan(Math.min(i,e.to),g)}}while(e.nextSibling());e.parent()}}}function c(t){let e=t.type.prop(o);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const h=a.define,g=h(),d=h(),f=h(d),m=h(d),p=h(),u=h(p),k=h(p),b=h(),y=h(b),x=h(),N=h(),w=h(),v=h(w),M=h(),O={comment:g,lineComment:h(g),blockComment:h(g),docComment:h(g),name:d,variableName:h(d),typeName:f,tagName:h(f),propertyName:m,attributeName:h(m),className:h(d),labelName:h(d),namespace:h(d),macroName:h(d),literal:p,string:u,docString:h(u),character:h(u),attributeValue:h(u),number:k,integer:h(k),float:h(k),bool:h(p),regexp:h(p),escape:h(p),color:h(p),url:h(p),keyword:x,self:h(x),null:h(x),atom:h(x),unit:h(x),modifier:h(x),operatorKeyword:h(x),controlKeyword:h(x),definitionKeyword:h(x),moduleKeyword:h(x),operator:N,derefOperator:h(N),arithmeticOperator:h(N),logicOperator:h(N),bitwiseOperator:h(N),compareOperator:h(N),updateOperator:h(N),definitionOperator:h(N),typeOperator:h(N),controlOperator:h(N),punctuation:w,separator:h(w),bracket:v,angleBracket:h(v),squareBracket:h(v),paren:h(v),brace:h(v),content:b,heading:y,heading1:h(y),heading2:h(y),heading3:h(y),heading4:h(y),heading5:h(y),heading6:h(y),contentSeparator:h(b),list:h(b),quote:h(b),emphasis:h(b),strong:h(b),link:h(b),monospace:h(b),strikethrough:h(b),inserted:h(),deleted:h(),changed:h(),invalid:h(),meta:M,documentMeta:h(M),annotation:h(M),processingInstruction:h(M),definition:a.defineModifier("definition"),constant:a.defineModifier("constant"),function:a.defineModifier("function"),standard:a.defineModifier("standard"),local:a.defineModifier("local"),special:a.defineModifier("special")};for(let S in O){let t=O[S];t instanceof a&&(t.name=S)}n([{tag:O.link,class:"tok-link"},{tag:O.heading,class:"tok-heading"},{tag:O.emphasis,class:"tok-emphasis"},{tag:O.strong,class:"tok-strong"},{tag:O.keyword,class:"tok-keyword"},{tag:O.atom,class:"tok-atom"},{tag:O.bool,class:"tok-bool"},{tag:O.url,class:"tok-url"},{tag:O.labelName,class:"tok-labelName"},{tag:O.inserted,class:"tok-inserted"},{tag:O.deleted,class:"tok-deleted"},{tag:O.literal,class:"tok-literal"},{tag:O.string,class:"tok-string"},{tag:O.number,class:"tok-number"},{tag:[O.regexp,O.escape,O.special(O.string)],class:"tok-string2"},{tag:O.variableName,class:"tok-variableName"},{tag:O.local(O.variableName),class:"tok-variableName tok-local"},{tag:O.definition(O.variableName),class:"tok-variableName tok-definition"},{tag:O.special(O.variableName),class:"tok-variableName2"},{tag:O.definition(O.propertyName),class:"tok-propertyName tok-definition"},{tag:O.typeName,class:"tok-typeName"},{tag:O.namespace,class:"tok-namespace"},{tag:O.className,class:"tok-className"},{tag:O.macroName,class:"tok-macroName"},{tag:O.propertyName,class:"tok-propertyName"},{tag:O.operator,class:"tok-operator"},{tag:O.comment,class:"tok-comment"},{tag:O.meta,class:"tok-meta"},{tag:O.invalid,class:"tok-invalid"},{tag:O.punctuation,class:"tok-punctuation"}]),exports.Tag=a,exports.getStyleTags=c,exports.highlightTree=function(t,e,a,i=0,r=t.length){let o=new l(i,Array.isArray(e)?e:[e],a);o.highlightRange(t.cursor(),i,r,"",o.highlighters),o.flush(r)},exports.styleTags=function(t){let e=Object.create(null);for(let a in t){let i=t[a];Array.isArray(i)||(i=[i]);for(let t of a.split(" "))if(t){let a=[],r=2,o=t;for(let e=0;;){if("..."==o&&e>0&&e+3==t.length){r=1;break}let i=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!i)throw new RangeError("Invalid path: "+t);if(a.push("*"==i[0]?"":'"'==i[0][0]?JSON.parse(i[0]):i[0]),e+=i[0].length,e==t.length)break;let s=t[e++];if(e==t.length&&"!"==s){r=0;break}if("/"!=s)throw new RangeError("Invalid path: "+t);o=t.slice(e)}let n=a.length-1,l=a[n];if(!l)throw new RangeError("Invalid path: "+t);let c=new s(i,r,n>0?a.slice(0,n):null);e[l]=c.sort(e[l])}}return o.add(e)},exports.tagHighlighter=n,exports.tags=O;