openmausbot 0.1.99 → 0.1.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/assets/{ActivityPanel-CgUgtumZ.js → ActivityPanel-CA9zfl3_.js} +1 -1
  2. package/dist/assets/{BotSettingsDialog-lJj6oiir.js → BotSettingsDialog-3i_izROu.js} +1 -1
  3. package/dist/assets/{CloudBackendPicker-C5-_arUz.js → CloudBackendPicker-BR42-xBg.js} +1 -1
  4. package/dist/assets/{ComputerPanel-euJ2CSlH.js → ComputerPanel-CvThnFmt.js} +1 -1
  5. package/dist/assets/{DesktopViewer-XCln1Pn_.js → DesktopViewer-CqovWUic.js} +1 -1
  6. package/dist/assets/{InspectorPanel-DKYyQZlo.js → InspectorPanel-Cbjm86gt.js} +1 -1
  7. package/dist/assets/{KeyboardShortcutsModal-DkkZWZRI.js → KeyboardShortcutsModal-X13pVrkh.js} +1 -1
  8. package/dist/assets/{LocalVmWorkspace-Cwt3_XSx.js → LocalVmWorkspace-BGD3Tvd3.js} +1 -1
  9. package/dist/assets/{MacLocalControl-B28RbdCS.js → MacLocalControl-ExdXHVUv.js} +1 -1
  10. package/dist/assets/{NewBotDialog-dMWDs5xm.js → NewBotDialog-ftDBMjWR.js} +1 -1
  11. package/dist/assets/{RemoteAgentSettingsPanel-B5KWXnqH.js → RemoteAgentSettingsPanel-BUHLV_vC.js} +1 -1
  12. package/dist/assets/{RoutinesPage-DOosRYDK.js → RoutinesPage-Buk5-r3o.js} +1 -1
  13. package/dist/assets/{RoutinesSection-uOfOTfkB.js → RoutinesSection-NyReOXr8.js} +1 -1
  14. package/dist/assets/{SettingsModal-BTGkFbj1.js → SettingsModal-DkkhdxKM.js} +1 -1
  15. package/dist/assets/{TeamMapPage-DqNdJn96.js → TeamMapPage-BIxeHoy3.js} +1 -1
  16. package/dist/assets/{TriggersPanel-c6xkG9mi.js → TriggersPanel-m5iqc43H.js} +1 -1
  17. package/dist/assets/{VisibilitySection-DD4ffIR5.js → VisibilitySection-y8Adk-c4.js} +1 -1
  18. package/dist/assets/{WebhooksPanel-Cz17K-_O.js → WebhooksPanel-G_NWjHOP.js} +1 -1
  19. package/dist/assets/{abnfDiagram-O67JEVCF-CX6tDpkg.js → abnfDiagram-O67JEVCF-D56ZgyPf.js} +1 -1
  20. package/dist/assets/{activity-BAVWO0Zj.js → activity-D_puBfZo.js} +1 -1
  21. package/dist/assets/{arc-h45-9NFk.js → arc-DzduGHbq.js} +1 -1
  22. package/dist/assets/{architectureDiagram-NJMV4G6O-CgLFXbg6.js → architectureDiagram-NJMV4G6O-C4NS6DQF.js} +1 -1
  23. package/dist/assets/{blockDiagram-BEXU5L5S-DGDFFc9M.js → blockDiagram-BEXU5L5S-BNvsskiE.js} +1 -1
  24. package/dist/assets/{brain-CeCdoTb2.js → brain-oq48IgWl.js} +1 -1
  25. package/dist/assets/{c4Diagram-YGBWAQC7-B9aklAUj.js → c4Diagram-YGBWAQC7-ch3B7xZy.js} +1 -1
  26. package/dist/assets/channel-CmFDMHrN.js +1 -0
  27. package/dist/assets/{chunk-2Q5K7J3B-BC0KmWsM.js → chunk-2Q5K7J3B-D9dL9ZS7.js} +1 -1
  28. package/dist/assets/{chunk-3FUC2YCW-BbDFHsJ1.js → chunk-3FUC2YCW-DmLUUuNr.js} +2 -2
  29. package/dist/assets/{chunk-5VM5RSS4-DtGbsjOM.js → chunk-5VM5RSS4-B90ODeo2.js} +1 -1
  30. package/dist/assets/{chunk-GTNCS2PH-VMghMcEl.js → chunk-GTNCS2PH-BtlGIG3W.js} +1 -1
  31. package/dist/assets/{chunk-GWA4HPMP-BP_JyGWQ.js → chunk-GWA4HPMP-CurBwFFG.js} +1 -1
  32. package/dist/assets/{chunk-JWPE2WC7-CYFyzgAU.js → chunk-JWPE2WC7-DTjNNXcd.js} +1 -1
  33. package/dist/assets/{chunk-NETBCI7D-DBNa_kqm.js → chunk-NETBCI7D-xS7hOqBJ.js} +1 -1
  34. package/dist/assets/{chunk-WEXAMYUT-BKEeM7CJ.js → chunk-WEXAMYUT-DJZBSyA9.js} +1 -1
  35. package/dist/assets/{chunk-XXDRQBXY-C__m3ZXl.js → chunk-XXDRQBXY-CbiNRzjt.js} +1 -1
  36. package/dist/assets/{classDiagram-v2-NBCMYWYE-CBUrTSAX.js → classDiagram-v2-NBCMYWYE-DyON9tUb.js} +1 -1
  37. package/dist/assets/{core-6lvx-ypA.js → core-CRkAXD3N.js} +1 -1
  38. package/dist/assets/{cose-bilkent-JH36ORCC-GRfL-1Vb.js → cose-bilkent-JH36ORCC-C7UwNnp8.js} +1 -1
  39. package/dist/assets/{cynefin-OW5HDTMX-LopwGUjm.js → cynefin-OW5HDTMX-Dv1GTekc.js} +1 -1
  40. package/dist/assets/{cynefinDiagram-VND7K2PF-DSB8ZRNS.js → cynefinDiagram-VND7K2PF-CKgpyZxo.js} +1 -1
  41. package/dist/assets/{dagre-6A5THRUB-DL3Kgdfk.js → dagre-6A5THRUB-BY3cYc8R.js} +1 -1
  42. package/dist/assets/{diagram-22UHCM2B-DIxN34BM.js → diagram-22UHCM2B-D71jBFCO.js} +1 -1
  43. package/dist/assets/{diagram-3UASUU5V-CJnSvXaI.js → diagram-3UASUU5V-Bc3i6JGD.js} +1 -1
  44. package/dist/assets/{diagram-ATOU4E4O-C-XF-lO8.js → diagram-ATOU4E4O-BPDSHISG.js} +1 -1
  45. package/dist/assets/{diagram-CDSNMT55-Df2yZPi_.js → diagram-CDSNMT55-xuCT1v32.js} +1 -1
  46. package/dist/assets/{diagram-MLGK6HIB-BBs9oZFs.js → diagram-MLGK6HIB-LEDTXDPg.js} +1 -1
  47. package/dist/assets/{diagram-MPIPVDR6-CEbK11mM.js → diagram-MPIPVDR6-B0kfscRD.js} +1 -1
  48. package/dist/assets/{ebnfDiagram-ZINNZB2B-BNq6Yv3C.js → ebnfDiagram-ZINNZB2B-B-Z0HLzJ.js} +1 -1
  49. package/dist/assets/{elk-276RUBZZ-CFbQ2bGm.js → elk-276RUBZZ-Bzypn7lU.js} +1 -1
  50. package/dist/assets/{erDiagram-OPXOYQCR-Bz8vmjN4.js → erDiagram-OPXOYQCR-vl1xKmbS.js} +1 -1
  51. package/dist/assets/{flowDiagram-KWPJA3E3-cQUfEYrx.js → flowDiagram-KWPJA3E3-DQXCXm7z.js} +1 -1
  52. package/dist/assets/{ganttDiagram-FUAMR5RP-BY8n9tbI.js → ganttDiagram-FUAMR5RP-B0wwnP2j.js} +1 -1
  53. package/dist/assets/{gitGraphDiagram-X574FWY7-KduSOMDN.js → gitGraphDiagram-X574FWY7-HfEVZRuR.js} +1 -1
  54. package/dist/assets/{image-plus-DNIWU160.js → image-plus-D9o3v9bi.js} +1 -1
  55. package/dist/assets/{index-C8xb62XS.js → index-CyM91z0J.js} +111 -111
  56. package/dist/assets/{infoDiagram-VRGFBTTK-xBKgUkpL.js → infoDiagram-VRGFBTTK-BcCklxlu.js} +1 -1
  57. package/dist/assets/{ishikawaDiagram-OU5B5YK6-_ei09tAJ.js → ishikawaDiagram-OU5B5YK6-Bw7Fp8yZ.js} +1 -1
  58. package/dist/assets/{journeyDiagram-ZHPQQLJL-Fp49MkSp.js → journeyDiagram-ZHPQQLJL-BqFaTPiB.js} +1 -1
  59. package/dist/assets/{kanban-definition-PNTS6WVX-CY9lLm7V.js → kanban-definition-PNTS6WVX-BdGyimUh.js} +1 -1
  60. package/dist/assets/{linear-D2ai4eM2.js → linear-DezKjgv7.js} +1 -1
  61. package/dist/assets/{mermaid.core-DP6qPqu1.js → mermaid.core-97L7xtx0.js} +5 -5
  62. package/dist/assets/{mindmap-definition-NLK3R4M7-g1ynEw_d.js → mindmap-definition-NLK3R4M7-DP6qz87C.js} +1 -1
  63. package/dist/assets/{page-visible-BZn8304W.js → page-visible-BehtKJDm.js} +1 -1
  64. package/dist/assets/{pegDiagram-GJSIUBJH-Bt4ObsZj.js → pegDiagram-GJSIUBJH-CsYSloVz.js} +1 -1
  65. package/dist/assets/{pieDiagram-5QR66LMP-CeLld8bY.js → pieDiagram-5QR66LMP-CFI2Dcix.js} +1 -1
  66. package/dist/assets/{quadrantDiagram-O4NWA36T-D4WWZw3x.js → quadrantDiagram-O4NWA36T-DqTdAE5z.js} +1 -1
  67. package/dist/assets/{railroadDiagram-XR7U4H2S-D95P5NqU.js → railroadDiagram-XR7U4H2S-t_rszRIF.js} +1 -1
  68. package/dist/assets/{remote-desktop-panel-DOIMmT4T.js → remote-desktop-panel-WTaz_HI9.js} +1 -1
  69. package/dist/assets/{requirementDiagram-PLB6GJNP-D12p3RhR.js → requirementDiagram-PLB6GJNP-1MU-l7p8.js} +1 -1
  70. package/dist/assets/{sankeyDiagram-IPEJSGJF-Co26Dwcs.js → sankeyDiagram-IPEJSGJF-CtkrwAvo.js} +1 -1
  71. package/dist/assets/{sequenceDiagram-PO4LG4MO-y5YxaDKt.js → sequenceDiagram-PO4LG4MO-CJOwBubv.js} +1 -1
  72. package/dist/assets/{sizeCapture-INFHLROL-D49hZ8U5.js → sizeCapture-INFHLROL-DhQVhKCc.js} +1 -1
  73. package/dist/assets/{stateDiagram-v2-GCMORJYK-C0sylr-r.js → stateDiagram-v2-GCMORJYK-CaQK9yA9.js} +1 -1
  74. package/dist/assets/{swimlanes-2SLR337P-DmRWsDIs.js → swimlanes-2SLR337P-Ct8cqf01.js} +1 -1
  75. package/dist/assets/swimlanesDiagram-TC7HE7FX-BBUcFKOA.js +8 -0
  76. package/dist/assets/{timeline-definition-EJHVYXUP-DVmHYs3w.js → timeline-definition-EJHVYXUP-qim2Km3q.js} +1 -1
  77. package/dist/assets/{usecaseDiagram-POWQR4AR-BQ1q0VV6.js → usecaseDiagram-POWQR4AR-BIzcxmgX.js} +1 -1
  78. package/dist/assets/{user-B9lohN4n.js → user-EQ8rI0f4.js} +1 -1
  79. package/dist/assets/{vennDiagram-UO4OBE2U-C_cnfST0.js → vennDiagram-UO4OBE2U-BFEuz8Ba.js} +1 -1
  80. package/dist/assets/{wardleyDiagram-VNRHLVJA-Bb3BSu12.js → wardleyDiagram-VNRHLVJA-JRkAN01c.js} +1 -1
  81. package/dist/assets/{xychartDiagram-PMCCYNJV-CcwEuuEi.js → xychartDiagram-PMCCYNJV-WBsvmu0R.js} +1 -1
  82. package/dist/index.html +1 -1
  83. package/dist-server/index.js +9 -6
  84. package/dist-server/server/mcp-probe.js +18 -10
  85. package/package.json +1 -1
  86. package/dist/assets/channel-TsOXCiPg.js +0 -1
  87. package/dist/assets/swimlanesDiagram-TC7HE7FX-DzhbBHtd.js +0 -8
@@ -1,4 +1,4 @@
1
- import{cc as xe,cd as rt,ce as Mt,cf as jt,cg as Dt,ch as Me,ci as Wt}from"./index-C8xb62XS.js";const je={}.hasOwnProperty;function Ft(t,e){const n=e||{};function s(r,...i){let o=s.invalid;const c=s.handlers;if(r&&je.call(r,t)){const a=String(r[t]);o=je.call(c,a)?c[a]:s.unknown}if(o)return o.call(this,r,...i)}return s.handlers=n.handlers||{},s.invalid=n.invalid,s.unknown=n.unknown,s}var S=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function qt(t){return Le(t)}function Le(t){return Array.isArray(t)?zt(t):t instanceof RegExp?t:typeof t=="object"?Ht(t):t}function zt(t){let e=[];for(let n=0,s=t.length;n<s;n++)e[n]=Le(t[n]);return e}function Ht(t){let e={};for(let n in t)e[n]=Le(t[n]);return e}function it(t,...e){return e.forEach(n=>{for(let s in n)t[s]=n[s]}),t}function ot(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?ot(t.substring(0,t.length-1)):t.substr(~e+1)}var ge=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,U=class{static hasCaptures(t){return t===null?!1:(ge.lastIndex=0,ge.test(t))}static replaceCaptures(t,e,n){return t.replace(ge,(s,r,i,o)=>{let c=n[parseInt(r||i,10)];if(c){let a=e.substring(c.start,c.end);for(;a[0]===".";)a=a.substring(1);switch(o){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return s})}};function at(t,e){return t<e?-1:t>e?1:0}function ct(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,s=e.length;if(n===s){for(let r=0;r<n;r++){let i=at(t[r],e[r]);if(i!==0)return i}return 0}return n-s}function De(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 lt(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var ut=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}},Q=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(Vt(t),e)}static createFromParsedTheme(t,e){return Jt(t,e)}_cachedMatchRoot=new ut(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,s=this._cachedMatchRoot.get(e).find(r=>Ut(t.parent,r.parentScopes));return s?new ht(s.fontStyle,s.foreground,s.background):null}},me=class Y{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const s of n)e=new Y(e,s);return e}static from(...e){let n=null;for(let s=0;s<e.length;s++)n=new Y(n,e[s]);return n}push(e){return new Y(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let s=this;for(;s&&s!==e;)n.push(s.scopeName),s=s.parent;return s===e?n.reverse():void 0}};function Ut(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let s=e[n],r=!1;if(s===">"){if(n===e.length-1)return!1;s=e[++n],r=!0}for(;t&&!Kt(t.scopeName,s);){if(r)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Kt(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var ht=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function Vt(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],s=0;for(let r=0,i=e.length;r<i;r++){let o=e[r];if(!o.settings)continue;let c;if(typeof o.scope=="string"){let h=o.scope;h=h.replace(/^[,]+/,""),h=h.replace(/[,]+$/,""),c=h.split(",")}else Array.isArray(o.scope)?c=o.scope:c=[""];let a=-1;if(typeof o.settings.fontStyle=="string"){a=0;let h=o.settings.fontStyle.split(" ");for(let d=0,f=h.length;d<f;d++)switch(h[d]){case"italic":a=a|1;break;case"bold":a=a|2;break;case"underline":a=a|4;break;case"strikethrough":a=a|8;break}}let l=null;typeof o.settings.foreground=="string"&&De(o.settings.foreground)&&(l=o.settings.foreground);let u=null;typeof o.settings.background=="string"&&De(o.settings.background)&&(u=o.settings.background);for(let h=0,d=c.length;h<d;h++){let p=c[h].trim().split(" "),y=p[p.length-1],_=null;p.length>1&&(_=p.slice(0,p.length-1),_.reverse()),n[s++]=new Yt(y,_,r,a,l,u)}}return n}var Yt=class{constructor(t,e,n,s,r,i){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=s,this.foreground=r,this.background=i}},k=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(k||{});function Jt(t,e){t.sort((a,l)=>{let u=at(a.scope,l.scope);return u!==0||(u=ct(a.parentScopes,l.parentScopes),u!==0)?u:a.index-l.index});let n=0,s="#000000",r="#ffffff";for(;t.length>=1&&t[0].scope==="";){let a=t.shift();a.fontStyle!==-1&&(n=a.fontStyle),a.foreground!==null&&(s=a.foreground),a.background!==null&&(r=a.background)}let i=new Qt(e),o=new ht(n,i.getId(s),i.getId(r)),c=new Zt(new Ce(0,null,-1,0,0),[]);for(let a=0,l=t.length;a<l;a++){let u=t[a];c.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new Q(i,o,c)}var Qt=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)}},Xt=Object.freeze([]),Ce=class ft{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,s,r,i){this.scopeDepth=e,this.parentScopes=n||Xt,this.fontStyle=s,this.foreground=r,this.background=i}clone(){return new ft(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let s=0,r=e.length;s<r;s++)n[s]=e[s].clone();return n}acceptOverwrite(e,n,s,r){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),s!==0&&(this.foreground=s),r!==0&&(this.background=r)}},Zt=class we{constructor(e,n=[],s={}){this._mainRule=e,this._children=s,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let s=0,r=0;for(;e.parentScopes[s]===">"&&s++,n.parentScopes[r]===">"&&r++,!(s>=e.parentScopes.length||r>=n.parentScopes.length);){const i=n.parentScopes[r].length-e.parentScopes[s].length;if(i!==0)return i;s++,r++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let s=e.indexOf("."),r,i;if(s===-1?(r=e,i=""):(r=e.substring(0,s),i=e.substring(s+1)),this._children.hasOwnProperty(r))return this._children[r].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(we._cmpBySpecificity),n}insert(e,n,s,r,i,o){if(n===""){this._doInsertHere(e,s,r,i,o);return}let c=n.indexOf("."),a,l;c===-1?(a=n,l=""):(a=n.substring(0,c),l=n.substring(c+1));let u;this._children.hasOwnProperty(a)?u=this._children[a]:(u=new we(this._mainRule.clone(),Ce.cloneArr(this._rulesWithParentScopes)),this._children[a]=u),u.insert(e+1,l,s,r,i,o)}_doInsertHere(e,n,s,r,i){if(n===null){this._mainRule.acceptOverwrite(e,s,r,i);return}for(let o=0,c=this._rulesWithParentScopes.length;o<c;o++){let a=this._rulesWithParentScopes[o];if(ct(a.parentScopes,n)===0){a.acceptOverwrite(e,s,r,i);return}}s===-1&&(s=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Ce(e,n,s,r,i))}},G=class v{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=v.getLanguageId(e),s=v.getTokenType(e),r=v.getFontStyle(e),i=v.getForeground(e),o=v.getBackground(e);console.log({languageId:n,tokenType:s,fontStyle:r,foreground:i,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,s,r,i,o,c){let a=v.getLanguageId(e),l=v.getTokenType(e),u=v.containsBalancedBrackets(e)?1:0,h=v.getFontStyle(e),d=v.getForeground(e),f=v.getBackground(e);return n!==0&&(a=n),s!==8&&(l=s),r!==null&&(u=r?1:0),i!==-1&&(h=i),o!==0&&(d=o),c!==0&&(f=c),(a<<0|l<<8|u<<10|h<<11|d<<15|f<<24)>>>0}};function X(t,e){const n=[],s=en(t);let r=s.next();for(;r!==null;){let a=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=s.next()}let l=o();if(n.push({matcher:l,priority:a}),r!==",")break;r=s.next()}return n;function i(){if(r==="-"){r=s.next();const a=i();return l=>!!a&&!a(l)}if(r==="("){r=s.next();const a=c();return r===")"&&(r=s.next()),a}if(We(r)){const a=[];do a.push(r),r=s.next();while(We(r));return l=>e(a,l)}return null}function o(){const a=[];let l=i();for(;l;)a.push(l),l=i();return u=>a.every(h=>h(u))}function c(){const a=[];let l=o();for(;l&&(a.push(l),r==="|"||r===",");){do r=s.next();while(r==="|"||r===",");l=o()}return u=>a.some(h=>h(u))}}function We(t){return!!t&&!!t.match(/[\w\.:]+/)}function en(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const s=n[0];return n=e.exec(t),s}}}function dt(t){typeof t.dispose=="function"&&t.dispose()}var D=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},tn=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))}},sn=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new D(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)rn(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof D){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 rn(t,e,n,s){const r=n.lookup(t.scopeName);if(!r){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const i=n.lookup(e);t instanceof D?J({baseGrammar:i,selfGrammar:r},s):Re(t.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},s);const o=n.injections(t.scopeName);if(o)for(const c of o)s.add(new D(c))}function Re(t,e,n){if(e.repository&&e.repository[t]){const s=e.repository[t];Z([s],e,n)}}function J(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&Z(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&Z(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function Z(t,e,n){for(const s of t){if(n.visitedRule.has(s))continue;n.visitedRule.add(s);const r=s.repository?it({},e.repository,s.repository):e.repository;Array.isArray(s.patterns)&&Z(s.patterns,{...e,repository:r},n);const i=s.include;if(!i)continue;const o=pt(i);switch(o.kind){case 0:J({...e,selfGrammar:e.baseGrammar},n);break;case 1:J(e,n);break;case 2:Re(o.ruleName,{...e,repository:r},n);break;case 3:case 4:const c=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(c){const a={baseGrammar:e.baseGrammar,selfGrammar:c,repository:r};o.kind===4?Re(o.ruleName,a,n):J(a,n)}else o.kind===4?n.add(new tn(o.scopeName,o.ruleName)):n.add(new D(o.scopeName));break}}}var on=class{kind=0},an=class{kind=1},cn=class{constructor(t){this.ruleName=t}kind=2},ln=class{constructor(t){this.scopeName=t}kind=3},un=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function pt(t){if(t==="$base")return new on;if(t==="$self")return new an;const e=t.indexOf("#");if(e===-1)return new ln(t);if(e===0)return new cn(t.substring(1));{const n=t.substring(0,e),s=t.substring(e+1);return new un(n,s)}}var hn=/\\(\d+)/,Fe=/\\(\d+)/g,fn=-1,gt=-2;var z=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,s){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=U.hasCaptures(this._name),this._contentName=s||null,this._contentNameIsCapturing=U.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${ot(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?this._name:U.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:U.replaceCaptures(this._contentName,t,e)}},dn=class extends z{retokenizeCapturedWithRuleId;constructor(t,e,n,s,r){super(t,e,n,s),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,s){throw new Error("Not supported!")}},pn=class extends z{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,s,r){super(t,e,n,null),this._match=new W(s,this.id),this.captures=r,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,s){return this._getCachedCompiledPatterns(t).compileAG(t,n,s)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new F,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},qe=class extends z{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,s,r){super(t,e,n,s),this.patterns=r.patterns,this.hasMissingPatterns=r.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,s){return this._getCachedCompiledPatterns(t).compileAG(t,n,s)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new F,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ne=class extends z{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,s,r,i,o,c,a,l){super(t,e,n,s),this._begin=new W(r,this.id),this.beginCaptures=i,this._end=new W(o||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=c,this.applyEndPatternLast=a||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.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,s){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,s)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new F;for(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}},ee=class extends z{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,s,r,i,o,c,a){super(t,e,n,s),this._begin=new W(r,this.id),this.beginCaptures=i,this.whileCaptures=c,this._while=new W(o,gt),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=a.patterns,this.hasMissingPatterns=a.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,s){return this._getCachedCompiledPatterns(t).compileAG(t,n,s)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new F;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,s){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,s)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new F,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||"￿"),this._cachedCompiledWhilePatterns}},mt=class N{static createCaptureRule(e,n,s,r,i){return e.registerRule(o=>new dn(n,o,s,r,i))}static getCompiledRuleId(e,n,s){return e.id||n.registerRule(r=>{if(e.id=r,e.match)return new pn(e.$vscodeTextmateLocation,e.id,e.name,e.match,N._compileCaptures(e.captures,n,s));if(typeof e.begin>"u"){e.repository&&(s=it({},s,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new qe(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,N._compilePatterns(i,n,s))}return e.while?new ee(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,N._compileCaptures(e.beginCaptures||e.captures,n,s),e.while,N._compileCaptures(e.whileCaptures||e.captures,n,s),N._compilePatterns(e.patterns,n,s)):new Ne(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,N._compileCaptures(e.beginCaptures||e.captures,n,s),e.end,N._compileCaptures(e.endCaptures||e.captures,n,s),e.applyEndPatternLast,N._compilePatterns(e.patterns,n,s))}),e.id}static _compileCaptures(e,n,s){let r=[];if(e){let i=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const c=parseInt(o,10);c>i&&(i=c)}for(let o=0;o<=i;o++)r[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const c=parseInt(o,10);let a=0;e[o].patterns&&(a=N.getCompiledRuleId(e[o],n,s)),r[c]=N.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,a)}}return r}static _compilePatterns(e,n,s){let r=[];if(e)for(let i=0,o=e.length;i<o;i++){const c=e[i];let a=-1;if(c.include){const l=pt(c.include);switch(l.kind){case 0:case 1:a=N.getCompiledRuleId(s[c.include],n,s);break;case 2:let u=s[l.ruleName];u&&(a=N.getCompiledRuleId(u,n,s));break;case 3:case 4:const h=l.scopeName,d=l.kind===4?l.ruleName:null,f=n.getExternalGrammar(h,s);if(f)if(d){let p=f.repository[d];p&&(a=N.getCompiledRuleId(p,n,f.repository))}else a=N.getCompiledRuleId(f.repository.$self,n,f.repository);break}}else a=N.getCompiledRuleId(c,n,s);if(a!==-1){const l=n.getRule(a);let u=!1;if((l instanceof qe||l instanceof Ne||l instanceof ee)&&l.hasMissingPatterns&&l.patterns.length===0&&(u=!0),u)continue;r.push(a)}}return{patterns:r,hasMissingPatterns:(e?e.length:0)!==r.length}}},W=class _t{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e=="string"){const s=e.length;let r=0,i=[],o=!1;for(let c=0;c<s;c++)if(e.charAt(c)==="\\"&&c+1<s){const l=e.charAt(c+1);l==="z"?(i.push(e.substring(r,c)),i.push("$(?!\\n)(?<!\\n)"),r=c+2):(l==="A"||l==="G")&&(o=!0),c++}this.hasAnchor=o,r===0?this.source=e:(i.push(e.substring(r,s)),this.source=i.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=hn.test(this.source):this.hasBackReferences=!1}clone(){return new _t(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 s=n.map(r=>e.substring(r.start,r.end));return Fe.lastIndex=0,this.source.replace(Fe,(r,i)=>lt(s[parseInt(i,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=[],s=[],r=[],i,o,c,a;for(i=0,o=this.source.length;i<o;i++)c=this.source.charAt(i),e[i]=c,n[i]=c,s[i]=c,r[i]=c,c==="\\"&&i+1<o&&(a=this.source.charAt(i+1),a==="A"?(e[i+1]="￿",n[i+1]="￿",s[i+1]="A",r[i+1]="A"):a==="G"?(e[i+1]="￿",n[i+1]="G",s[i+1]="￿",r[i+1]="G"):(e[i+1]=a,n[i+1]=a,s[i+1]=a,r[i+1]=a),i++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:s.join(""),A1_G1:r.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},F=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)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){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 ze(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 s=this._items.map(r=>r.resolveAnchors(e,n));return new ze(t,s,this._items.map(r=>r.ruleId))}},ze=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(`
1
+ import{cc as xe,cd as rt,ce as Mt,cf as jt,cg as Dt,ch as Me,ci as Wt}from"./index-CyM91z0J.js";const je={}.hasOwnProperty;function Ft(t,e){const n=e||{};function s(r,...i){let o=s.invalid;const c=s.handlers;if(r&&je.call(r,t)){const a=String(r[t]);o=je.call(c,a)?c[a]:s.unknown}if(o)return o.call(this,r,...i)}return s.handlers=n.handlers||{},s.invalid=n.invalid,s.unknown=n.unknown,s}var S=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function qt(t){return Le(t)}function Le(t){return Array.isArray(t)?zt(t):t instanceof RegExp?t:typeof t=="object"?Ht(t):t}function zt(t){let e=[];for(let n=0,s=t.length;n<s;n++)e[n]=Le(t[n]);return e}function Ht(t){let e={};for(let n in t)e[n]=Le(t[n]);return e}function it(t,...e){return e.forEach(n=>{for(let s in n)t[s]=n[s]}),t}function ot(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?ot(t.substring(0,t.length-1)):t.substr(~e+1)}var ge=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,U=class{static hasCaptures(t){return t===null?!1:(ge.lastIndex=0,ge.test(t))}static replaceCaptures(t,e,n){return t.replace(ge,(s,r,i,o)=>{let c=n[parseInt(r||i,10)];if(c){let a=e.substring(c.start,c.end);for(;a[0]===".";)a=a.substring(1);switch(o){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return s})}};function at(t,e){return t<e?-1:t>e?1:0}function ct(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,s=e.length;if(n===s){for(let r=0;r<n;r++){let i=at(t[r],e[r]);if(i!==0)return i}return 0}return n-s}function De(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 lt(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var ut=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}},Q=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(Vt(t),e)}static createFromParsedTheme(t,e){return Jt(t,e)}_cachedMatchRoot=new ut(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,s=this._cachedMatchRoot.get(e).find(r=>Ut(t.parent,r.parentScopes));return s?new ht(s.fontStyle,s.foreground,s.background):null}},me=class Y{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const s of n)e=new Y(e,s);return e}static from(...e){let n=null;for(let s=0;s<e.length;s++)n=new Y(n,e[s]);return n}push(e){return new Y(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let s=this;for(;s&&s!==e;)n.push(s.scopeName),s=s.parent;return s===e?n.reverse():void 0}};function Ut(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let s=e[n],r=!1;if(s===">"){if(n===e.length-1)return!1;s=e[++n],r=!0}for(;t&&!Kt(t.scopeName,s);){if(r)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Kt(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var ht=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function Vt(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],s=0;for(let r=0,i=e.length;r<i;r++){let o=e[r];if(!o.settings)continue;let c;if(typeof o.scope=="string"){let h=o.scope;h=h.replace(/^[,]+/,""),h=h.replace(/[,]+$/,""),c=h.split(",")}else Array.isArray(o.scope)?c=o.scope:c=[""];let a=-1;if(typeof o.settings.fontStyle=="string"){a=0;let h=o.settings.fontStyle.split(" ");for(let d=0,f=h.length;d<f;d++)switch(h[d]){case"italic":a=a|1;break;case"bold":a=a|2;break;case"underline":a=a|4;break;case"strikethrough":a=a|8;break}}let l=null;typeof o.settings.foreground=="string"&&De(o.settings.foreground)&&(l=o.settings.foreground);let u=null;typeof o.settings.background=="string"&&De(o.settings.background)&&(u=o.settings.background);for(let h=0,d=c.length;h<d;h++){let p=c[h].trim().split(" "),y=p[p.length-1],_=null;p.length>1&&(_=p.slice(0,p.length-1),_.reverse()),n[s++]=new Yt(y,_,r,a,l,u)}}return n}var Yt=class{constructor(t,e,n,s,r,i){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=s,this.foreground=r,this.background=i}},k=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(k||{});function Jt(t,e){t.sort((a,l)=>{let u=at(a.scope,l.scope);return u!==0||(u=ct(a.parentScopes,l.parentScopes),u!==0)?u:a.index-l.index});let n=0,s="#000000",r="#ffffff";for(;t.length>=1&&t[0].scope==="";){let a=t.shift();a.fontStyle!==-1&&(n=a.fontStyle),a.foreground!==null&&(s=a.foreground),a.background!==null&&(r=a.background)}let i=new Qt(e),o=new ht(n,i.getId(s),i.getId(r)),c=new Zt(new Ce(0,null,-1,0,0),[]);for(let a=0,l=t.length;a<l;a++){let u=t[a];c.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new Q(i,o,c)}var Qt=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)}},Xt=Object.freeze([]),Ce=class ft{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,s,r,i){this.scopeDepth=e,this.parentScopes=n||Xt,this.fontStyle=s,this.foreground=r,this.background=i}clone(){return new ft(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let s=0,r=e.length;s<r;s++)n[s]=e[s].clone();return n}acceptOverwrite(e,n,s,r){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),s!==0&&(this.foreground=s),r!==0&&(this.background=r)}},Zt=class we{constructor(e,n=[],s={}){this._mainRule=e,this._children=s,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let s=0,r=0;for(;e.parentScopes[s]===">"&&s++,n.parentScopes[r]===">"&&r++,!(s>=e.parentScopes.length||r>=n.parentScopes.length);){const i=n.parentScopes[r].length-e.parentScopes[s].length;if(i!==0)return i;s++,r++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let s=e.indexOf("."),r,i;if(s===-1?(r=e,i=""):(r=e.substring(0,s),i=e.substring(s+1)),this._children.hasOwnProperty(r))return this._children[r].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(we._cmpBySpecificity),n}insert(e,n,s,r,i,o){if(n===""){this._doInsertHere(e,s,r,i,o);return}let c=n.indexOf("."),a,l;c===-1?(a=n,l=""):(a=n.substring(0,c),l=n.substring(c+1));let u;this._children.hasOwnProperty(a)?u=this._children[a]:(u=new we(this._mainRule.clone(),Ce.cloneArr(this._rulesWithParentScopes)),this._children[a]=u),u.insert(e+1,l,s,r,i,o)}_doInsertHere(e,n,s,r,i){if(n===null){this._mainRule.acceptOverwrite(e,s,r,i);return}for(let o=0,c=this._rulesWithParentScopes.length;o<c;o++){let a=this._rulesWithParentScopes[o];if(ct(a.parentScopes,n)===0){a.acceptOverwrite(e,s,r,i);return}}s===-1&&(s=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new Ce(e,n,s,r,i))}},G=class v{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=v.getLanguageId(e),s=v.getTokenType(e),r=v.getFontStyle(e),i=v.getForeground(e),o=v.getBackground(e);console.log({languageId:n,tokenType:s,fontStyle:r,foreground:i,background:o})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,s,r,i,o,c){let a=v.getLanguageId(e),l=v.getTokenType(e),u=v.containsBalancedBrackets(e)?1:0,h=v.getFontStyle(e),d=v.getForeground(e),f=v.getBackground(e);return n!==0&&(a=n),s!==8&&(l=s),r!==null&&(u=r?1:0),i!==-1&&(h=i),o!==0&&(d=o),c!==0&&(f=c),(a<<0|l<<8|u<<10|h<<11|d<<15|f<<24)>>>0}};function X(t,e){const n=[],s=en(t);let r=s.next();for(;r!==null;){let a=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=s.next()}let l=o();if(n.push({matcher:l,priority:a}),r!==",")break;r=s.next()}return n;function i(){if(r==="-"){r=s.next();const a=i();return l=>!!a&&!a(l)}if(r==="("){r=s.next();const a=c();return r===")"&&(r=s.next()),a}if(We(r)){const a=[];do a.push(r),r=s.next();while(We(r));return l=>e(a,l)}return null}function o(){const a=[];let l=i();for(;l;)a.push(l),l=i();return u=>a.every(h=>h(u))}function c(){const a=[];let l=o();for(;l&&(a.push(l),r==="|"||r===",");){do r=s.next();while(r==="|"||r===",");l=o()}return u=>a.some(h=>h(u))}}function We(t){return!!t&&!!t.match(/[\w\.:]+/)}function en(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const s=n[0];return n=e.exec(t),s}}}function dt(t){typeof t.dispose=="function"&&t.dispose()}var D=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},tn=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))}},sn=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new D(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)rn(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof D){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 rn(t,e,n,s){const r=n.lookup(t.scopeName);if(!r){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const i=n.lookup(e);t instanceof D?J({baseGrammar:i,selfGrammar:r},s):Re(t.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},s);const o=n.injections(t.scopeName);if(o)for(const c of o)s.add(new D(c))}function Re(t,e,n){if(e.repository&&e.repository[t]){const s=e.repository[t];Z([s],e,n)}}function J(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&Z(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&Z(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function Z(t,e,n){for(const s of t){if(n.visitedRule.has(s))continue;n.visitedRule.add(s);const r=s.repository?it({},e.repository,s.repository):e.repository;Array.isArray(s.patterns)&&Z(s.patterns,{...e,repository:r},n);const i=s.include;if(!i)continue;const o=pt(i);switch(o.kind){case 0:J({...e,selfGrammar:e.baseGrammar},n);break;case 1:J(e,n);break;case 2:Re(o.ruleName,{...e,repository:r},n);break;case 3:case 4:const c=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(c){const a={baseGrammar:e.baseGrammar,selfGrammar:c,repository:r};o.kind===4?Re(o.ruleName,a,n):J(a,n)}else o.kind===4?n.add(new tn(o.scopeName,o.ruleName)):n.add(new D(o.scopeName));break}}}var on=class{kind=0},an=class{kind=1},cn=class{constructor(t){this.ruleName=t}kind=2},ln=class{constructor(t){this.scopeName=t}kind=3},un=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function pt(t){if(t==="$base")return new on;if(t==="$self")return new an;const e=t.indexOf("#");if(e===-1)return new ln(t);if(e===0)return new cn(t.substring(1));{const n=t.substring(0,e),s=t.substring(e+1);return new un(n,s)}}var hn=/\\(\d+)/,Fe=/\\(\d+)/g,fn=-1,gt=-2;var z=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,s){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=U.hasCaptures(this._name),this._contentName=s||null,this._contentNameIsCapturing=U.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${ot(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?this._name:U.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:U.replaceCaptures(this._contentName,t,e)}},dn=class extends z{retokenizeCapturedWithRuleId;constructor(t,e,n,s,r){super(t,e,n,s),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,s){throw new Error("Not supported!")}},pn=class extends z{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,s,r){super(t,e,n,null),this._match=new W(s,this.id),this.captures=r,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,s){return this._getCachedCompiledPatterns(t).compileAG(t,n,s)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new F,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},qe=class extends z{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,s,r){super(t,e,n,s),this.patterns=r.patterns,this.hasMissingPatterns=r.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,s){return this._getCachedCompiledPatterns(t).compileAG(t,n,s)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new F,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ne=class extends z{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,s,r,i,o,c,a,l){super(t,e,n,s),this._begin=new W(r,this.id),this.beginCaptures=i,this._end=new W(o||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=c,this.applyEndPatternLast=a||!1,this.patterns=l.patterns,this.hasMissingPatterns=l.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,s){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,s)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new F;for(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}},ee=class extends z{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,s,r,i,o,c,a){super(t,e,n,s),this._begin=new W(r,this.id),this.beginCaptures=i,this.whileCaptures=c,this._while=new W(o,gt),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=a.patterns,this.hasMissingPatterns=a.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,s){return this._getCachedCompiledPatterns(t).compileAG(t,n,s)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new F;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,s){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,s)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new F,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||"￿"),this._cachedCompiledWhilePatterns}},mt=class N{static createCaptureRule(e,n,s,r,i){return e.registerRule(o=>new dn(n,o,s,r,i))}static getCompiledRuleId(e,n,s){return e.id||n.registerRule(r=>{if(e.id=r,e.match)return new pn(e.$vscodeTextmateLocation,e.id,e.name,e.match,N._compileCaptures(e.captures,n,s));if(typeof e.begin>"u"){e.repository&&(s=it({},s,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new qe(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,N._compilePatterns(i,n,s))}return e.while?new ee(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,N._compileCaptures(e.beginCaptures||e.captures,n,s),e.while,N._compileCaptures(e.whileCaptures||e.captures,n,s),N._compilePatterns(e.patterns,n,s)):new Ne(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,N._compileCaptures(e.beginCaptures||e.captures,n,s),e.end,N._compileCaptures(e.endCaptures||e.captures,n,s),e.applyEndPatternLast,N._compilePatterns(e.patterns,n,s))}),e.id}static _compileCaptures(e,n,s){let r=[];if(e){let i=0;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const c=parseInt(o,10);c>i&&(i=c)}for(let o=0;o<=i;o++)r[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const c=parseInt(o,10);let a=0;e[o].patterns&&(a=N.getCompiledRuleId(e[o],n,s)),r[c]=N.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,a)}}return r}static _compilePatterns(e,n,s){let r=[];if(e)for(let i=0,o=e.length;i<o;i++){const c=e[i];let a=-1;if(c.include){const l=pt(c.include);switch(l.kind){case 0:case 1:a=N.getCompiledRuleId(s[c.include],n,s);break;case 2:let u=s[l.ruleName];u&&(a=N.getCompiledRuleId(u,n,s));break;case 3:case 4:const h=l.scopeName,d=l.kind===4?l.ruleName:null,f=n.getExternalGrammar(h,s);if(f)if(d){let p=f.repository[d];p&&(a=N.getCompiledRuleId(p,n,f.repository))}else a=N.getCompiledRuleId(f.repository.$self,n,f.repository);break}}else a=N.getCompiledRuleId(c,n,s);if(a!==-1){const l=n.getRule(a);let u=!1;if((l instanceof qe||l instanceof Ne||l instanceof ee)&&l.hasMissingPatterns&&l.patterns.length===0&&(u=!0),u)continue;r.push(a)}}return{patterns:r,hasMissingPatterns:(e?e.length:0)!==r.length}}},W=class _t{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e=="string"){const s=e.length;let r=0,i=[],o=!1;for(let c=0;c<s;c++)if(e.charAt(c)==="\\"&&c+1<s){const l=e.charAt(c+1);l==="z"?(i.push(e.substring(r,c)),i.push("$(?!\\n)(?<!\\n)"),r=c+2):(l==="A"||l==="G")&&(o=!0),c++}this.hasAnchor=o,r===0?this.source=e:(i.push(e.substring(r,s)),this.source=i.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=hn.test(this.source):this.hasBackReferences=!1}clone(){return new _t(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 s=n.map(r=>e.substring(r.start,r.end));return Fe.lastIndex=0,this.source.replace(Fe,(r,i)=>lt(s[parseInt(i,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=[],s=[],r=[],i,o,c,a;for(i=0,o=this.source.length;i<o;i++)c=this.source.charAt(i),e[i]=c,n[i]=c,s[i]=c,r[i]=c,c==="\\"&&i+1<o&&(a=this.source.charAt(i+1),a==="A"?(e[i+1]="￿",n[i+1]="￿",s[i+1]="A",r[i+1]="A"):a==="G"?(e[i+1]="￿",n[i+1]="G",s[i+1]="￿",r[i+1]="G"):(e[i+1]=a,n[i+1]=a,s[i+1]=a,r[i+1]=a),i++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:s.join(""),A1_G1:r.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},F=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)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){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 ze(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 s=this._items.map(r=>r.resolveAnchors(e,n));return new ze(t,s,this._items.map(r=>r.ruleId))}},ze=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
2
  `)}findNextMatchSync(t,e,n){const s=this.scanner.findNextMatchSync(t,e,n);return s?{ruleId:this.rules[s.index],captureIndices:s.captureIndices}:null}},_e=class{constructor(t,e){this.languageId=t,this.tokenType=e}},gn=class ke{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,n){this._defaultAttributes=new _e(e,8),this._embeddedLanguagesMatcher=new mn(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 _e(0,0);_getBasicScopeAttributes=new ut(e=>{const n=this._scopeToLanguage(e),s=this._toStandardTokenType(e);return new _e(n,s)});_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/},mn=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,s])=>lt(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},He=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function yt(t,e,n,s,r,i,o,c){const a=e.content.length;let l=!1,u=-1;if(o){const f=_n(t,e,n,s,r,i);r=f.stack,s=f.linePos,n=f.isFirstLine,u=f.anchorPosition}const h=Date.now();for(;!l;){if(c!==0&&Date.now()-h>c)return new He(r,!0);d()}return new He(r,!1);function d(){const f=yn(t,e,n,s,r,u);if(!f){i.produce(r,a),l=!0;return}const p=f.captureIndices,y=f.matchedRuleId,_=p&&p.length>0?p[0].end>s:!1;if(y===fn){const m=r.getRule(t);i.produce(r,p[0].start),r=r.withContentNameScopesList(r.nameScopesList),M(t,e,n,r,i,m.endCaptures,p),i.produce(r,p[0].end);const g=r;if(r=r.parent,u=g.getAnchorPos(),!_&&g.getEnterPos()===s){r=g,i.produce(r,a),l=!0;return}}else{const m=t.getRule(y);i.produce(r,p[0].start);const g=r,b=m.getName(e.content,p),C=r.contentNameScopesList.pushAttributed(b,t);if(r=r.push(y,s,u,p[0].end===a,null,C,C),m instanceof Ne){const R=m;M(t,e,n,r,i,R.beginCaptures,p),i.produce(r,p[0].end),u=p[0].end;const A=R.getContentName(e.content,p),E=C.pushAttributed(A,t);if(r=r.withContentNameScopesList(E),R.endHasBackReferences&&(r=r.withEndRule(R.getEndWithResolvedBackReferences(e.content,p))),!_&&g.hasSameRuleAs(r)){r=r.pop(),i.produce(r,a),l=!0;return}}else if(m instanceof ee){const R=m;M(t,e,n,r,i,R.beginCaptures,p),i.produce(r,p[0].end),u=p[0].end;const A=R.getContentName(e.content,p),E=C.pushAttributed(A,t);if(r=r.withContentNameScopesList(E),R.whileHasBackReferences&&(r=r.withEndRule(R.getWhileWithResolvedBackReferences(e.content,p))),!_&&g.hasSameRuleAs(r)){r=r.pop(),i.produce(r,a),l=!0;return}}else if(M(t,e,n,r,i,m.captures,p),i.produce(r,p[0].end),r=r.pop(),!_){r=r.safePop(),i.produce(r,a),l=!0;return}}p[0].end>s&&(s=p[0].end,n=!1)}}function _n(t,e,n,s,r,i){let o=r.beginRuleCapturedEOL?0:-1;const c=[];for(let a=r;a;a=a.pop()){const l=a.getRule(t);l instanceof ee&&c.push({rule:l,stack:a})}for(let a=c.pop();a;a=c.pop()){const{ruleScanner:l,findOptions:u}=Cn(a.rule,t,a.stack.endRule,n,s===o),h=l.findNextMatchSync(e,s,u);if(h){if(h.ruleId!==gt){r=a.stack.pop();break}h.captureIndices&&h.captureIndices.length&&(i.produce(a.stack,h.captureIndices[0].start),M(t,e,n,a.stack,i,a.rule.whileCaptures,h.captureIndices),i.produce(a.stack,h.captureIndices[0].end),o=h.captureIndices[0].end,h.captureIndices[0].end>s&&(s=h.captureIndices[0].end,n=!1))}else{r=a.stack.pop();break}}return{stack:r,linePos:s,anchorPosition:o,isFirstLine:n}}function yn(t,e,n,s,r,i){const o=bn(t,e,n,s,r,i),c=t.getInjections();if(c.length===0)return o;const a=Sn(c,t,e,n,s,r,i);if(!a)return o;if(!o)return a;const l=o.captureIndices[0].start,u=a.captureIndices[0].start;return u<l||a.priorityMatch&&u===l?a:o}function bn(t,e,n,s,r,i){const o=r.getRule(t),{ruleScanner:c,findOptions:a}=bt(o,t,r.endRule,n,s===i),l=c.findNextMatchSync(e,s,a);return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}function Sn(t,e,n,s,r,i,o){let c=Number.MAX_VALUE,a=null,l,u=0;const h=i.contentNameScopesList.getScopeNames();for(let d=0,f=t.length;d<f;d++){const p=t[d];if(!p.matcher(h))continue;const y=e.getRule(p.ruleId),{ruleScanner:_,findOptions:m}=bt(y,e,null,s,r===o),g=_.findNextMatchSync(n,r,m);if(!g)continue;const b=g.captureIndices[0].start;if(!(b>=c)&&(c=b,a=g.captureIndices,l=g.ruleId,u=p.priority,c===r))break}return a?{priorityMatch:u===-1,captureIndices:a,matchedRuleId:l}:null}function bt(t,e,n,s,r){return{ruleScanner:t.compileAG(e,n,s,r),findOptions:0}}function Cn(t,e,n,s,r){return{ruleScanner:t.compileWhileAG(e,n,s,r),findOptions:0}}function M(t,e,n,s,r,i,o){if(i.length===0)return;const c=e.content,a=Math.min(i.length,o.length),l=[],u=o[0].end;for(let h=0;h<a;h++){const d=i[h];if(d===null)continue;const f=o[h];if(f.length===0)continue;if(f.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=f.start;)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop();if(l.length>0?r.produceFromScopes(l[l.length-1].scopes,f.start):r.produce(s,f.start),d.retokenizeCapturedWithRuleId){const y=d.getName(c,o),_=s.contentNameScopesList.pushAttributed(y,t),m=d.getContentName(c,o),g=_.pushAttributed(m,t),b=s.push(d.retokenizeCapturedWithRuleId,f.start,-1,!1,null,_,g),C=t.createOnigString(c.substring(0,f.end));yt(t,C,n&&f.start===0,f.start,b,r,!1,0),dt(C);continue}const p=d.getName(c,o);if(p!==null){const _=(l.length>0?l[l.length-1].scopes:s.contentNameScopesList).pushAttributed(p,t);l.push(new wn(_,f.end))}}for(;l.length>0;)r.produceFromScopes(l[l.length-1].scopes,l[l.length-1].endPos),l.pop()}var wn=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function Rn(t,e,n,s,r,i,o,c){return new kn(t,e,n,s,r,i,o,c)}function Ue(t,e,n,s,r){const i=X(e,te),o=mt.getCompiledRuleId(n,s,r.repository);for(const c of i)t.push({debugSelector:e,matcher:c.matcher,ruleId:o,grammar:r,priority:c.priority})}function te(t,e){if(e.length<t.length)return!1;let n=0;return t.every(s=>{for(let r=n;r<e.length;r++)if(Nn(e[r],s))return n=r+1,!0;return!1})}function Nn(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 kn=class{constructor(t,e,n,s,r,i,o,c){if(this._rootScopeName=t,this.balancedBracketSelectors=i,this._onigLib=c,this._basicScopeAttributesProvider=new gn(n,s),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Ke(e,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const a of Object.keys(r)){const l=X(a,te);for(const u of l)this._tokenTypeMatchers.push({matcher:u.matcher,type:r[a]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){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={lookup:r=>r===this._rootScopeName?this._grammar:this.getExternalGrammar(r),injections:r=>this._grammarRepository.injections(r)},e=[],n=this._rootScopeName,s=t.lookup(n);if(s){const r=s.injections;if(r)for(let o in r)Ue(e,o,r[o],this,s);const i=this._grammarRepository.injections(n);i&&i.forEach(o=>{const c=this.getExternalGrammar(o);if(c){const a=c.injectionSelector;a&&Ue(e,a,c,this,c)}})}return e.sort((r,i)=>r.priority-i.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]=Ke(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){const s=this._tokenize(t,e,!1,n);return{tokens:s.lineTokens.getResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}tokenizeLine2(t,e,n=0){const s=this._tokenize(t,e,!0,n);return{tokens:s.lineTokens.getBinaryResult(s.ruleStack,s.lineLength),ruleStack:s.ruleStack,stoppedEarly:s.stoppedEarly}}_tokenize(t,e,n,s){this._rootId===-1&&(this._rootId=mt.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let r;if(!e||e===Ae.NULL){r=!0;const l=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),h=G.set(0,l.languageId,l.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),d=this.getRule(this._rootId).getName(null,null);let f;d?f=j.createRootAndLookUpScopeName(d,h,this):f=j.createRoot("unknown",h),e=new Ae(null,this._rootId,-1,-1,!1,null,f,f)}else r=!1,e.reset();t=t+`
3
3
  `;const i=this.createOnigString(t),o=i.content.length,c=new vn(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),a=yt(this,i,r,0,e,c,!0,s);return dt(i),{lineLength:o,lineTokens:c,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}};function Ke(t,e){return t=qt(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var j=class I{constructor(e,n,s){this.parent=e,this.scopePath=n,this.tokenAttributes=s}static fromExtension(e,n){let s=e,r=e?.scopePath??null;for(const i of n)r=me.push(r,i.scopeNames),s=new I(s,r,i.encodedTokenAttributes);return s}static createRoot(e,n){return new I(null,new me(null,e),n)}static createRootAndLookUpScopeName(e,n,s){const r=s.getMetadataForScope(e),i=new me(null,e),o=s.themeProvider.themeMatch(i),c=I.mergeAttributes(n,r,o);return new I(null,i,c)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return I.equals(this,e)}static equals(e,n){do{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}while(!0)}static mergeAttributes(e,n,s){let r=-1,i=0,o=0;return s!==null&&(r=s.fontStyle,i=s.foregroundId,o=s.backgroundId),G.set(e,n.languageId,n.tokenType,null,r,i,o)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return I._pushAttributed(this,e,n);const s=e.split(/ /g);let r=this;for(const i of s)r=I._pushAttributed(r,i,n);return r}static _pushAttributed(e,n,s){const r=s.getMetadataForScope(n),i=e.scopePath.push(n),o=s.themeProvider.themeMatch(i),c=I.mergeAttributes(e.tokenAttributes,r,o);return new I(e,i,c)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const n=[];let s=this;for(;s&&s!==e;)n.push({encodedTokenAttributes:s.tokenAttributes,scopeNames:s.scopePath.getExtensionIfDefined(s.parent?.scopePath??null)}),s=s.parent;return s===e?n.reverse():void 0}},Ae=class L{constructor(e,n,s,r,i,o,c,a){this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=o,this.nameScopesList=c,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=s,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new L(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e===null?!1:L._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?j.equals(e.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){L._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,s,r,i,o,c){return new L(this,e,n,s,r,i,o,c)}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 L(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 s=j.fromExtension(e?.nameScopesList??null,n.nameScopesList);return new L(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,s,j.fromExtension(s,n.contentNameScopesList))}},An=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):X(n,te).map(s=>s.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>X(n,te).map(s=>s.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}},vn=class{constructor(t,e,n,s){this.balancedBracketSelectors=s,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 s=t?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const i=t?.getScopeNames()??[];for(const o of this._tokenTypeOverrides)o.matcher(i)&&(s=G.set(s,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(i))}if(r&&(s=G.set(s,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===s){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(s),this._lastTokenEndIndex=e;return}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 s=0,r=this._binaryTokens.length;s<r;s++)n[s]=this._binaryTokens[s];return n}},In=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,s,r){if(!this._grammars.has(t)){let i=this._rawGrammars.get(t);if(!i)return null;this._grammars.set(t,Rn(t,i,e,n,s,r,this,this._onigLib))}return this._grammars.get(t)}},Tn=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new In(Q.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,n){this._syncRegistry.setTheme(Q.createFromRawTheme(e,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,n,s){return this.loadGrammarWithConfiguration(e,n,{embeddedLanguages:s})}loadGrammarWithConfiguration(e,n,s){return this._loadGrammar(e,n,s.embeddedLanguages,s.tokenTypes,new An(s.balancedBracketSelectors||[],s.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,n,s,r,i){const o=new sn(this._syncRegistry,e);for(;o.Q.length>0;)o.Q.map(c=>this._loadSingleGrammar(c.scopeName)),o.processQueue();return this._grammarForScopeName(e,n,s,r,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const n=this._options.loadGrammar(e);if(n){const s=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,s)}}addGrammar(e,n=[],s=0,r=null){return this._syncRegistry.addGrammar(e,n),this._grammarForScopeName(e.scopeName,s,r)}_grammarForScopeName(e,n=0,s=null,r=null,i=null){return this._syncRegistry.grammarForScopeName(e,n,s,r,i)}},ve=Ae.NULL;function ne(t,e){const n=typeof t=="string"?{}:{...t.colorReplacements},s=typeof t=="string"?t:t.name;for(const[r,i]of Object.entries(e?.colorReplacements||{}))typeof i=="string"?n[r]=i:r===s&&Object.assign(n,i);return n}function x(t,e){return t&&(e?.[t?.toLowerCase()]||t)}function En(t){return Array.isArray(t)?t:[t]}async function St(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function ae(t){return!t||["plaintext","txt","text","plain"].includes(t)}function xn(t){return t==="ansi"||ae(t)}function ce(t){return t==="none"}function Ln(t){return ce(t)}const Pn=/(\r?\n)/g;function le(t,e=!1){if(t.length===0)return[["",0]];const n=t.split(Pn);let s=0;const r=[];for(let i=0;i<n.length;i+=2){const o=e?n[i]+(n[i+1]||""):n[i];r.push([o,s]),s+=n[i].length,s+=n[i+1]?.length||0}return r}const Ve={light:"#333333",dark:"#bbbbbb"},Ye={light:"#fffffe",dark:"#1e1e1e"},Je="__shiki_resolved";function Pe(t){if(t?.[Je])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:s}=e;if(!n||!s){const c=e.settings?e.settings.find(a=>!a.name&&!a.scope):void 0;c?.settings?.foreground&&(s=c.settings.foreground),c?.settings?.background&&(n=c.settings.background),!s&&e?.colors?.["editor.foreground"]&&(s=e.colors["editor.foreground"]),!n&&e?.colors?.["editor.background"]&&(n=e.colors["editor.background"]),s||(s=e.type==="light"?Ve.light:Ve.dark),n||(n=e.type==="light"?Ye.light:Ye.dark),e.fg=s,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 r=0;const i=new Map;function o(c){if(i.has(c))return i.get(c);r+=1;const a=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return e.colorReplacements?.[`#${a}`]?o(c):(i.set(c,a),a)}e.settings=e.settings.map(c=>{const a=c.settings?.foreground&&!c.settings.foreground.startsWith("#"),l=c.settings?.background&&!c.settings.background.startsWith("#");if(!a&&!l)return c;const u={...c,settings:{...c.settings}};if(a){const h=o(c.settings.foreground);e.colorReplacements[h]=c.settings.foreground,u.settings.foreground=h}if(l){const h=o(c.settings.background);e.colorReplacements[h]=c.settings.background,u.settings.background=h}return u});for(const c of Object.keys(e.colors||{}))if((c==="editor.foreground"||c==="editor.background"||c.startsWith("terminal.ansi"))&&!e.colors[c]?.startsWith("#")){const a=o(e.colors[c]);e.colorReplacements[a]=e.colors[c],e.colors[c]=a}return Object.defineProperty(e,Je,{enumerable:!1,writable:!1,value:!0}),e}async function Ct(t){return[...new Set((await Promise.all(t.filter(e=>!xn(e)).map(async e=>await St(e).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function wt(t){return(await Promise.all(t.map(async e=>Ln(e)?null:Pe(await St(e))))).filter(e=>!!e)}function Rt(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 S(`Circular alias \`${[...n].join(" -> ")} -> ${t}\``);n.add(t)}}return t}var Gn=class extends Tn{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(t,e,n,s={}){super(t),this._resolver=t,this._themes=e,this._langs=n,this._alias=s,this._themes.map(r=>this.loadTheme(r)),this.loadLanguages(this._langs)}getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const e=Pe(t);return e.name&&(this._resolvedThemes.set(e.name,e),this._loadedThemesCache=null),e}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let e=this._textmateThemeCache.get(t);e||(e=Q.createFromRawTheme(t),this._textmateThemeCache.set(t,e)),this._syncRegistry.setTheme(e)}getGrammar(t){return t=Rt(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){if(this.getGrammar(t.name))return;const e=new Set([...this._langMap.values()].filter(r=>r.embeddedLangsLazy?.includes(t.name)));this._resolver.addLanguage(t);const n={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const s=this.loadGrammarWithConfiguration(t.scopeName,1,n);if(s.name=t.name,this._resolvedGrammars.set(t.name,s),t.aliases&&t.aliases.forEach(r=>{this._alias[r]=t.name}),this._loadedLanguagesCache=null,e.size)for(const r of e)this._resolvedGrammars.delete(r.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(r.scopeName),this._syncRegistry?._grammars?.delete(r.scopeName),this.loadLanguage(this._langMap.get(r.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const s of t)this.resolveEmbeddedLanguages(s);const e=[...this._langGraph.entries()],n=e.filter(([s,r])=>!r);if(n.length){const s=e.filter(([r,i])=>i?(i.embeddedLanguages||i.embeddedLangs)?.some(o=>n.map(([c])=>c).includes(o)):!1).filter(r=>!n.includes(r));throw new S(`Missing languages ${n.map(([r])=>`\`${r}\``).join(", ")}, required by ${s.map(([r])=>`\`${r}\``).join(", ")}`)}for(const[s,r]of e)this._resolver.addLanguage(r);for(const[s,r]of e)this.loadLanguage(r)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const e=t.embeddedLanguages??t.embeddedLangs;if(e)for(const n of e)this._langGraph.set(n,this._langMap.get(n))}},On=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(t,e){this._onigLib={createOnigScanner:n=>t.createScanner(n),createOnigString:n=>t.createString(n)},e.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(t){return this._langs.get(t)}loadGrammar(t){return this._scopeToLang.get(t)}addLanguage(t){this._langs.set(t.name,t),t.aliases&&t.aliases.forEach(e=>{this._langs.set(e,t)}),this._scopeToLang.set(t.scopeName,t),t.injectTo&&t.injectTo.forEach(e=>{this._injections.get(e)||this._injections.set(e,[]),this._injections.get(e).push(t.scopeName)})}getInjections(t){const e=t.split(".");let n=[];for(let s=1;s<=e.length;s++){const r=e.slice(0,s).join(".");n=[...n,...this._injections.get(r)||[]]}return n}};let B=0;function $n(t){B+=1,t.warnings!==!1&&B>=10&&B%10===0&&console.warn(`[Shiki] ${B} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let e=!1;if(!t.engine)throw new S("`engine` option is required for synchronous mode");const n=(t.langs||[]).flat(1),s=(t.themes||[]).flat(1).map(Pe),r=new Gn(new On(t.engine,n),s,n,t.langAlias);let i;function o(g){return Rt(g,t.langAlias)}function c(g){_();const b=r.getGrammar(typeof g=="string"?g:g.name);if(!b)throw new S(`Language \`${g}\` not found, you may need to load it first`);return b}function a(g){if(g==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};_();const b=r.getTheme(g);if(!b)throw new S(`Theme \`${g}\` not found, you may need to load it first`);return b}function l(g){_();const b=a(g);return i!==g&&(r.setTheme(b),i=g),{theme:b,colorMap:r.getColorMap()}}function u(){return _(),r.getLoadedThemes()}function h(){return _(),r.getLoadedLanguages()}function d(...g){_(),r.loadLanguages(g.flat(1))}async function f(...g){return d(await Ct(g))}function p(...g){_();for(const b of g.flat(1))r.loadTheme(b)}async function y(...g){return _(),p(await wt(g))}function _(){if(e)throw new S("Shiki instance has been disposed")}function m(){e||(e=!0,r.dispose(),B-=1)}return{setTheme:l,getTheme:a,getLanguage:c,getLoadedThemes:u,getLoadedLanguages:h,resolveLangAlias:o,loadLanguage:f,loadLanguageSync:d,loadTheme:y,loadThemeSync:p,dispose:m,[Symbol.dispose]:m}}async function Bn(t){t.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,n,s]=await Promise.all([wt(t.themes||[]),Ct(t.langs||[]),t.engine]);return $n({...t,themes:e,langs:n,engine:s})}const Nt=new WeakMap;function ue(t,e){Nt.set(t,e)}function q(t){return Nt.get(t)}var he=class kt{_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 kt(Object.fromEntries(En(n).map(s=>[s,ve])),e)}constructor(...e){if(e.length===2){const[n,s]=e;this.lang=s,this._stacks=n}else{const[n,s,r]=e;this.lang=s,this._stacks={[r]:n}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Mn(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Mn(t){const e=[],n=new Set;function s(r){if(n.has(r))return;n.add(r);const i=r?.nameScopesList?.scopeName;i&&e.push(i),r.parent&&s(r.parent)}return s(t),e}function jn(t,e){if(!(t instanceof he))throw new S("Invalid grammar state");return t.getInternalStack(e)}const Dn=/,/,Wn=/ /;function At(t,e,n={}){const{theme:s=t.getLoadedThemes()[0]}=n;if(ae(t.resolveLangAlias(n.lang||"text"))||ce(s))return le(e).map(c=>[{content:c[0],offset:c[1]}]);const{theme:r,colorMap:i}=t.setTheme(s),o=t.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==o.name)throw new S(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);if(!n.grammarState.themes.includes(r.name))throw new S(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${r.name}"`)}return qn(e,o,r,i,n)}function Fn(...t){if(t.length===2)return q(t[1]);const[e,n,s={}]=t,{lang:r="text",theme:i=e.getLoadedThemes()[0]}=s;if(ae(r)||ce(i))throw new S("Plain language does not have grammar state");if(r==="ansi")throw new S("ANSI language does not have grammar state");const{theme:o,colorMap:c}=e.setTheme(i),a=e.getLanguage(r);return new he(Ge(n,a,o,c,s).stateStack,a.name,o.name)}function qn(t,e,n,s,r){const i=Ge(t,e,n,s,r),o=new he(i.stateStack,e.name,n.name);return ue(i.tokens,o),i.tokens}function Ge(t,e,n,s,r){const i=ne(n,r),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:c=500,includeExplanation:a=!1}=r,l=le(t);let u=r.grammarState?jn(r.grammarState,n.name)??ve:r.grammarContextCode!=null?Ge(r.grammarContextCode,e,n,s,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:ve,h=[];const d=[];for(let f=0,p=l.length;f<p;f++){const[y,_]=l[f];if(y===""){h=[],d.push([]);continue}if(o>0&&y.length>=o){h=[],d.push([{content:y,offset:_,color:"",fontStyle:0}]);continue}let m,g,b;a&&a!=="tokenType"&&(m=e.tokenizeLine(y,u,c),g=m.tokens,b=0);const C=e.tokenizeLine2(y,u,c),R=C.tokens.length/2;for(let A=0;A<R;A++){const E=C.tokens[2*A],fe=A+1<R?C.tokens[2*A+2]:y.length;if(E===fe)continue;const de=C.tokens[2*A+1],$t=x(s[G.getForeground(de)],i),Bt=G.getFontStyle(de),H={content:y.substring(E,fe),offset:_+E,color:$t,fontStyle:Bt};if(a==="tokenType")H.type=G.getTokenType(de);else if(a){const $e=[];if(a!=="scopeName")for(const T of n.settings){let O;switch(typeof T.scope){case"string":O=T.scope.split(Dn).map(pe=>pe.trim());break;case"object":O=T.scope;break;default:continue}$e.push({settings:T,selectors:O.map(pe=>pe.split(Wn))})}H.explanation=[];let Be=0;for(;E+Be<fe;){const T=g[b],O=y.substring(T.startIndex,T.endIndex);Be+=O.length,H.explanation.push({content:O,scopes:a==="scopeName"?zn(T.scopes):Hn($e,T.scopes)}),b+=1}}h.push(H)}d.push(h),h=[],u=C.ruleStack}return{tokens:d,stateStack:u}}function zn(t){return t.map(e=>({scopeName:e}))}function Hn(t,e){const n=[];for(let s=0,r=e.length;s<r;s++){const i=e[s];n[s]={scopeName:i,themeMatches:Kn(t,i,e.slice(0,s))}}return n}function Qe(t,e){return t===e||e.substring(0,t.length)===t&&e[t.length]==="."}function Un(t,e,n){if(!Qe(t.at(-1),e))return!1;let s=t.length-2,r=n.length-1;for(;s>=0&&r>=0;)Qe(t[s],n[r])&&(s-=1),r-=1;return s===-1}function Kn(t,e,n){const s=[];for(const{selectors:r,settings:i}of t)for(const o of r)if(Un(o,e,n)){s.push(i);break}return s}function vt(t,e,n,s=At){const r=Object.entries(n.themes).filter(l=>l[1]).map(l=>({color:l[0],theme:l[1]})),i=r.map(l=>{const u=s(t,e,{...n,theme:l.theme});return{tokens:u,state:q(u),theme:typeof l.theme=="string"?l.theme:l.theme.name}}),o=Vn(...i.map(l=>l.tokens)),c=o[0].map((l,u)=>l.map((h,d)=>{const f={content:h.content,variants:{},offset:h.offset};return"includeExplanation"in n&&n.includeExplanation&&(f.explanation=h.explanation),o.forEach((p,y)=>{const{content:_,explanation:m,offset:g,...b}=p[u][d];f.variants[r[y].color]=b}),f})),a=i[0].state?new he(Object.fromEntries(i.map(l=>[l.theme,l.state?.getInternalStack(l.theme)])),i[0].state.lang):void 0;return a&&ue(c,a),c}function Vn(...t){const e=t.map(()=>[]),n=t.length;for(let s=0;s<t[0].length;s++){const r=t.map(a=>a[s]),i=e.map(()=>[]);e.forEach((a,l)=>a.push(i[l]));const o=r.map(()=>0),c=r.map(a=>a[0]);for(;c.every(a=>a);){const a=Math.min(...c.map(l=>l.content.length));for(let l=0;l<n;l++){const u=c[l];u.content.length===a?(i[l].push(u),o[l]+=1,c[l]=r[l][o[l]]):(i[l].push({...u,content:u.content.slice(0,a)}),c[l]={...u,content:u.content.slice(a),offset:u.offset+a})}}}return e}const Yn=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],Jn=/["&'<>`]/g,Qn=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Xn=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Zn=/[|\\{}()[\]^$+*?.]/g,Xe=new WeakMap;function es(t,e){if(t=t.replace(e.subset?ts(e.subset):Jn,s),e.subset||e.escapeOnly)return t;return t.replace(Qn,n).replace(Xn,s);function n(r,i,o){return e.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,o.charCodeAt(i+2),e)}function s(r,i,o){return e.format(r.charCodeAt(0),o.charCodeAt(i+1),e)}}function ts(t){let e=Xe.get(t);return e||(e=ns(t),Xe.set(t,e)),e}function ns(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(Zn,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const ss=/[\dA-Fa-f]/;function rs(t,e,n){const s="&#x"+t.toString(16).toUpperCase();return n&&e&&!ss.test(String.fromCharCode(e))?s:s+";"}const is=/\d/;function os(t,e,n){const s="&#"+String(t);return n&&e&&!is.test(String.fromCharCode(e))?s:s+";"}const as=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],ye={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},cs=["cent","copy","divide","gt","lt","not","para","times"],It={}.hasOwnProperty,Ie={};let K;for(K in ye)It.call(ye,K)&&(Ie[ye[K]]=K);const ls=/[^\dA-Za-z]/;function us(t,e,n,s){const r=String.fromCharCode(t);if(It.call(Ie,r)){const i=Ie[r],o="&"+i;return n&&as.includes(i)&&!cs.includes(i)&&(!s||e&&e!==61&&ls.test(String.fromCharCode(e)))?o:o+";"}return""}function hs(t,e,n){let s=rs(t,e,n.omitOptionalSemicolons),r;if((n.useNamedReferences||n.useShortestReferences)&&(r=us(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const i=os(t,e,n.omitOptionalSemicolons);i.length<s.length&&(s=i)}return r&&(!n.useShortestReferences||r.length<s.length)?r:s}function $(t,e){return es(t,Object.assign({format:hs},e))}const fs=/^>|^->|<!--|-->|--!>|<!-$/g,ds=[">"],ps=["<",">"];function gs(t,e,n,s){return s.settings.bogusComments?"<?"+$(t.value,Object.assign({},s.settings.characterReferences,{subset:ds}))+">":"<!--"+t.value.replace(fs,r)+"-->";function r(i){return $(i,Object.assign({},s.settings.characterReferences,{subset:ps}))}}function ms(t,e,n,s){return"<!"+(s.settings.upperDoctype?"DOCTYPE":"doctype")+(s.settings.tightDoctype?"":" ")+"html>"}const w=Et(1),Tt=Et(-1),_s=[];function Et(t){return e;function e(n,s,r){const i=n?n.children:_s;let o=(s||0)+t,c=i[o];if(!r)for(;c&&xe(c);)o+=t,c=i[o];return c}}const ys={}.hasOwnProperty;function xt(t){return e;function e(n,s,r){return ys.call(t,n.tagName)&&t[n.tagName](n,s,r)}}const Oe=xt({body:Ss,caption:be,colgroup:be,dd:Ns,dt:Rs,head:be,html:bs,li:ws,optgroup:ks,option:As,p:Cs,rp:Ze,rt:Ze,tbody:Is,td:et,tfoot:Ts,th:et,thead:vs,tr:Es});function be(t,e,n){const s=w(n,e,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&xe(s.value.charAt(0)))}function bs(t,e,n){const s=w(n,e);return!s||s.type!=="comment"}function Ss(t,e,n){const s=w(n,e);return!s||s.type!=="comment"}function Cs(t,e,n){const s=w(n,e);return s?s.type==="element"&&(s.tagName==="address"||s.tagName==="article"||s.tagName==="aside"||s.tagName==="blockquote"||s.tagName==="details"||s.tagName==="div"||s.tagName==="dl"||s.tagName==="fieldset"||s.tagName==="figcaption"||s.tagName==="figure"||s.tagName==="footer"||s.tagName==="form"||s.tagName==="h1"||s.tagName==="h2"||s.tagName==="h3"||s.tagName==="h4"||s.tagName==="h5"||s.tagName==="h6"||s.tagName==="header"||s.tagName==="hgroup"||s.tagName==="hr"||s.tagName==="main"||s.tagName==="menu"||s.tagName==="nav"||s.tagName==="ol"||s.tagName==="p"||s.tagName==="pre"||s.tagName==="section"||s.tagName==="table"||s.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function ws(t,e,n){const s=w(n,e);return!s||s.type==="element"&&s.tagName==="li"}function Rs(t,e,n){const s=w(n,e);return!!(s&&s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd"))}function Ns(t,e,n){const s=w(n,e);return!s||s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd")}function Ze(t,e,n){const s=w(n,e);return!s||s.type==="element"&&(s.tagName==="rp"||s.tagName==="rt")}function ks(t,e,n){const s=w(n,e);return!s||s.type==="element"&&s.tagName==="optgroup"}function As(t,e,n){const s=w(n,e);return!s||s.type==="element"&&(s.tagName==="option"||s.tagName==="optgroup")}function vs(t,e,n){const s=w(n,e);return!!(s&&s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot"))}function Is(t,e,n){const s=w(n,e);return!s||s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot")}function Ts(t,e,n){return!w(n,e)}function Es(t,e,n){const s=w(n,e);return!s||s.type==="element"&&s.tagName==="tr"}function et(t,e,n){const s=w(n,e);return!s||s.type==="element"&&(s.tagName==="td"||s.tagName==="th")}const xs=xt({body:Gs,colgroup:Os,head:Ps,html:Ls,tbody:$s});function Ls(t){const e=w(t,-1);return!e||e.type!=="comment"}function Ps(t){const e=new Set;for(const s of t.children)if(s.type==="element"&&(s.tagName==="base"||s.tagName==="title")){if(e.has(s.tagName))return!1;e.add(s.tagName)}const n=t.children[0];return!n||n.type==="element"}function Gs(t){const e=w(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&xe(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function Os(t,e,n){const s=Tt(n,e),r=w(t,-1,!0);return n&&s&&s.type==="element"&&s.tagName==="colgroup"&&Oe(s,n.children.indexOf(s),n)?!1:!!(r&&r.type==="element"&&r.tagName==="col")}function $s(t,e,n){const s=Tt(n,e),r=w(t,-1);return n&&s&&s.type==="element"&&(s.tagName==="thead"||s.tagName==="tbody")&&Oe(s,n.children.indexOf(s),n)?!1:!!(r&&r.type==="element"&&r.tagName==="tr")}const V={name:[[`
4
4
  \f\r &/=>`.split(""),`