fumapress 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/cli/index.mjs +2 -2
- package/dist/waku/public/assets/{Combination-CZgu7LLo.js → Combination-DrcqRtGA.js} +1 -1
- package/dist/waku/public/assets/{_root-Cggak6CV.js → _root-UvrU8GwY.js} +2 -2
- package/dist/waku/public/assets/{algolia-BNaRObL_.js → algolia-C1zJb8Qk.js} +1 -1
- package/dist/waku/public/assets/check-BbfQleye.js +1 -0
- package/dist/waku/public/assets/{chevron-right-DJJuSbM1.js → chevron-right-DeeB6Siw.js} +1 -1
- package/dist/waku/public/assets/clerk-B6YS10Vt.js +1 -0
- package/dist/waku/public/assets/{client-Bo71EBGO.js → client-BSiZmHUR.js} +1 -1
- package/dist/waku/public/assets/{client-DQjBKg0B.js → client-DZrkaM4Z.js} +1 -1
- package/dist/waku/public/assets/{collapsible-CF1Cu_jt.js → collapsible-B44znGcA.js} +1 -1
- package/dist/waku/public/assets/{core-Cv3l1Zqy.js → core-Dj5ux1GM.js} +3 -3
- package/dist/waku/public/assets/{i18n-BolcaqTL.js → i18n-C-Z_Hjir.js} +1 -1
- package/dist/waku/public/assets/{i18n-DjlEdu4y.js → i18n-PxnJFz3u.js} +1 -1
- package/dist/waku/public/assets/{index-Bu4rAUmg.js → index-BHSCznho.js} +1 -1
- package/dist/waku/public/assets/{index-DX0XjS82.js → index-BJW5cYpx.js} +2 -2
- package/dist/waku/public/assets/{index-BkvRqZBU.js → index-BLK6p4I7.js} +1 -1
- package/dist/waku/public/assets/{index-CB9kk_3y.js → index-BNzds__a.js} +1 -1
- package/dist/waku/public/assets/{index-gGAeHuu7.js → index-BVWEvTtH.js} +1 -1
- package/dist/waku/public/assets/{index-gSxAaOnX.js → index-BWUz1Wzh.js} +1 -1
- package/dist/waku/public/assets/{index-Bfb33TOe.js → index-CKhdfY24.js} +1 -1
- package/dist/waku/public/assets/{index-04w9Knlq.js → index-CLyIGTiM.js} +15 -15
- package/dist/waku/public/assets/{index-DyrOoaEv.js → index-CU8t-3_R.js} +1 -1
- package/dist/waku/public/assets/index-Ckpsnspt.js +1 -0
- package/dist/waku/public/assets/index-Cq_2xCEj.js +1 -0
- package/dist/waku/public/assets/{index-CocCloJv.js → index-DhlSbsoh.js} +1 -1
- package/dist/waku/public/assets/{index-CiusCfWJ.js → index-DwAEwgq3.js} +2 -2
- package/dist/waku/public/assets/{index-BfvL1FIA.js → index-fYADC7x8.js} +1 -1
- package/dist/waku/public/assets/{index-v53j2ip6.js → index-wmToF8D3.js} +1 -1
- package/dist/waku/public/assets/{merge-refs-nGdaa77n.js → merge-refs-DdSaIw4w.js} +1 -1
- package/dist/waku/public/assets/{orama-cloud-Cb4vFuas.js → orama-cloud-B7ExjOsf.js} +1 -1
- package/dist/waku/public/assets/{orama-cloud-legacy-Ccbnfx92.js → orama-cloud-legacy-BYWQ8iUS.js} +1 -1
- package/dist/waku/public/assets/{orama-static-BFOJ0-9A.js → orama-static-BFn8xSUZ.js} +1 -1
- package/dist/waku/public/assets/{popover-b1EinR7C.js → popover-D1yTQ4pA.js} +1 -1
- package/dist/waku/public/assets/{proxy-CyO3tGnV.js → proxy-1YR77jQp.js} +1 -1
- package/dist/waku/public/assets/{scroll-area-GQGCCFVL.js → scroll-area-CHp-1KMj.js} +1 -1
- package/dist/waku/public/assets/{search-BkUFU0uD.js → search-BvoJUzZe.js} +1 -1
- package/dist/waku/public/assets/{search-default-ChkD4wjB.js → search-default-Cskx3A9x.js} +3 -3
- package/dist/waku/public/assets/{text-align-start-Bml65biG.js → text-align-start-77tc0bgj.js} +1 -1
- package/dist/waku/public/assets/{tree-CLDcGuhY.js → tree-DMBvckeu.js} +1 -1
- package/dist/waku/public/assets/{use-copy-button-BT9SM7ic.js → use-copy-button-BVfD1u7Q.js} +1 -1
- package/dist/waku/public/assets/{use-footer-items-kC7cCS_J.js → use-footer-items-DN1xdOWG.js} +1 -1
- package/dist/waku/public/assets/{x-B4zTGm-y.js → x-Bcn3Z-A2.js} +1 -1
- package/dist/waku/server/__vite_rsc_assets_manifest.js +214 -221
- package/dist/waku/server/assets/{_...slugs_-U66nFPoO.js → _...slugs_-G8fPO_O-.js} +11 -11
- package/dist/waku/server/assets/{_root-C-ADmyW4.js → _root-mEnnxZFG.js} +1 -1
- package/dist/waku/server/assets/{ai-oQoNuSGL.js → ai-Ciluqauj.js} +2 -2
- package/dist/waku/server/assets/{chat-DQKVfTcK.js → chat-DW_HKHrw.js} +4 -4
- package/dist/waku/server/assets/{image.webp-Dv0pfVuD.js → image.webp-DyPxyLsu.js} +1 -1
- package/dist/waku/server/assets/{img-B3_JeTtw.js → img-Ceur8Vbn.js} +1 -1
- package/dist/waku/server/assets/{index-C_0mV3uH.js → index-BG_LvuXY.js} +1 -1
- package/dist/waku/server/assets/{index-ZhQmL1Nf.js → index-BTS71z0Q.js} +6 -6
- package/dist/waku/server/assets/{index-Bcdbsymv.js → index-BhDWYJPg.js} +6 -6
- package/dist/waku/server/assets/{index-3ZfxoYob.js → index-BzelN9xZ.js} +1 -1
- package/dist/waku/server/assets/{index-gONfmTRy.js → index-Cid1T3pA.js} +1 -1
- package/dist/waku/server/assets/{index-WF3F0CwD.js → index-DHi_Q3em.js} +5 -5
- package/dist/waku/server/assets/{index-DnfZyte4.js → index-Dtz4Dikx.js} +1 -1
- package/dist/waku/server/assets/{index-Crq9hZR6.js → index-b51DeFey.js} +1 -1
- package/dist/waku/server/assets/{page-actions-BdnHpIXv.js → page-actions-CYA46ppC.js} +1 -1
- package/dist/waku/server/assets/{search-BY6tyCyl.js → search-Cyknzh3D.js} +2 -2
- package/dist/waku/server/assets/{server-entry-inner-DaRGKsnO.js → server-entry-inner-K3MndDA0.js} +7 -7
- package/dist/waku/server/assets/{token-Bs8f7pab.js → token-CITAv0Sw.js} +3 -3
- package/dist/waku/server/assets/{token-util-G_W-F6oG.js → token-util-BwI11_iA.js} +1 -1
- package/dist/waku/server/assets/{token-util-g3eKEgMS.js → token-util-D0330Bsl.js} +2 -2
- package/dist/waku/server/build.js +1 -1
- package/dist/waku/server/index.js +1 -1
- package/dist/waku/server/ssr/__vite_rsc_assets_manifest.js +214 -221
- package/dist/waku/server/ssr/assets/{clerk-CLtHkX25.js → clerk-CqspAh3n.js} +18 -8
- package/dist/waku/server/ssr/assets/{client-BEsotYsU.js → client-DEc-0Lxy.js} +1 -1
- package/dist/waku/server/ssr/assets/{collapsible-C-va3rUd.js → collapsible-DHCUbEAk.js} +2 -2
- package/dist/waku/server/ssr/assets/{core-Dqhuz4Gl.js → core-priwaMKI.js} +3 -4
- package/dist/waku/server/ssr/assets/{index-CXa1FGoE.js → index-1slu4Pvb.js} +2 -2
- package/dist/waku/server/ssr/assets/{index-DTxluAXt.js → index-B8vKMOfY.js} +3 -3
- package/dist/waku/server/ssr/assets/{index-Cndg6sEB.js → index-BX4HUXJp.js} +24 -20
- package/dist/waku/server/ssr/assets/{index-Dv1oyWqG.js → index-BaR9O1BS.js} +2 -2
- package/dist/waku/server/ssr/assets/{index-DsLtdhXt.js → index-J_nonhZE.js} +23 -19
- package/dist/waku/server/ssr/assets/{index-D1J6J-w6.js → index-Yktv2M6f.js} +3 -4
- package/dist/waku/server/ssr/assets/{index-DLec5OYs.js → index-tYLs9cMo.js} +1 -1
- package/dist/waku/server/ssr/assets/{scroll-area-dXxDy9uz.js → scroll-area-H0rLnYpQ.js} +1 -1
- package/dist/waku/server/ssr/index.js +10 -10
- package/package.json +3 -3
- package/dist/waku/public/assets/check-CO9o5HX9.js +0 -1
- package/dist/waku/public/assets/clerk-C-WekJQE.js +0 -1
- package/dist/waku/public/assets/index-DCb2T_K0.js +0 -1
- package/dist/waku/public/assets/index-DDaubXfQ.js +0 -1
- package/dist/waku/public/assets/link-BuR3Z_Xa.js +0 -1
- package/dist/waku/server/ssr/assets/link-Bito8baZ.js +0 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as Bt}from"./index-CkdplsNl.js";import{J as Ie,s as nt,f as Mt,c as jt,d as Dt,z as Wt,h as Ft}from"./index-CB9kk_3y.js";import{c as Me}from"./index-04w9Knlq.js";import"./index-DX0XjS82.js";import"./index-Bu4rAUmg.js";import"./merge-refs-nGdaa77n.js";import"./index-CocCloJv.js";import"./index-gGAeHuu7.js";import"./schemas-BzqjMV9-.js";import"./use-copy-button-BT9SM7ic.js";import"./index-BfvL1FIA.js";import"./check-CO9o5HX9.js";import"./link-BuR3Z_Xa.js";import"./x-B4zTGm-y.js";import"./search-BkUFU0uD.js";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 st(t,...e){return e.forEach(n=>{for(let s in n)t[s]=n[s]}),t}function rt(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?rt(t.substring(0,t.length-1)):t.substr(~e+1)}var de=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,H=class{static hasCaptures(t){return t===null?!1:(de.lastIndex=0,de.test(t))}static replaceCaptures(t,e,n){return t.replace(de,(s,r,i,o)=>{let a=n[parseInt(r||i,10)];if(a){let c=e.substring(a.start,a.end);for(;c[0]===".";)c=c.substring(1);switch(o){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return s})}};function it(t,e){return t<e?-1:t>e?1:0}function ot(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=it(t[r],e[r]);if(i!==0)return i}return 0}return n-s}function je(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 at(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var ct=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}},V=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(Yt(t),e)}static createFromParsedTheme(t,e){return Vt(t,e)}_cachedMatchRoot=new ct(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 lt(s.fontStyle,s.foreground,s.background):null}},ge=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 lt=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function Yt(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 a;if(typeof o.scope=="string"){let h=o.scope;h=h.replace(/^[,]+/,""),h=h.replace(/[,]+$/,""),a=h.split(",")}else Array.isArray(o.scope)?a=o.scope:a=[""];let c=-1;if(typeof o.settings.fontStyle=="string"){c=0;let h=o.settings.fontStyle.split(" ");for(let f=0,d=h.length;f<d;f++)switch(h[f]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let l=null;typeof o.settings.foreground=="string"&&je(o.settings.foreground)&&(l=o.settings.foreground);let u=null;typeof o.settings.background=="string"&&je(o.settings.background)&&(u=o.settings.background);for(let h=0,f=a.length;h<f;h++){let g=a[h].trim().split(" "),b=g[g.length-1],_=null;g.length>1&&(_=g.slice(0,g.length-1),_.reverse()),n[s++]=new Jt(b,_,r,c,l,u)}}return n}var Jt=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 Vt(t,e){t.sort((c,l)=>{let u=it(c.scope,l.scope);return u!==0||(u=ot(c.parentScopes,l.parentScopes),u!==0)?u:c.index-l.index});let n=0,s="#000000",r="#ffffff";for(;t.length>=1&&t[0].scope==="";){let c=t.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(s=c.foreground),c.background!==null&&(r=c.background)}let i=new Qt(e),o=new lt(n,i.getId(s),i.getId(r)),a=new Zt(new be(0,null,-1,0,0),[]);for(let c=0,l=t.length;c<l;c++){let u=t[c];a.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new V(i,o,a)}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([]),be=class ut{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 ut(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 Se{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(Se._cmpBySpecificity),n}insert(e,n,s,r,i,o){if(n===""){this._doInsertHere(e,s,r,i,o);return}let a=n.indexOf("."),c,l;a===-1?(c=n,l=""):(c=n.substring(0,a),l=n.substring(a+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new Se(this._mainRule.clone(),be.cloneArr(this._rulesWithParentScopes)),this._children[c]=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,a=this._rulesWithParentScopes.length;o<a;o++){let c=this._rulesWithParentScopes[o];if(ot(c.parentScopes,n)===0){c.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 be(e,n,s,r,i))}},$=class A{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=A.getLanguageId(e),s=A.getTokenType(e),r=A.getFontStyle(e),i=A.getForeground(e),o=A.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,a){let c=A.getLanguageId(e),l=A.getTokenType(e),u=A.containsBalancedBrackets(e)?1:0,h=A.getFontStyle(e),f=A.getForeground(e),d=A.getBackground(e);return n!==0&&(c=n),s!==8&&(l=s),r!==null&&(u=r?1:0),i!==-1&&(h=i),o!==0&&(f=o),a!==0&&(d=a),(c<<0|l<<8|u<<10|h<<11|f<<15|d<<24)>>>0}};function Q(t,e){const n=[],s=en(t);let r=s.next();for(;r!==null;){let c=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=s.next()}let l=o();if(n.push({matcher:l,priority:c}),r!==",")break;r=s.next()}return n;function i(){if(r==="-"){r=s.next();const c=i();return l=>!!c&&!c(l)}if(r==="("){r=s.next();const c=a();return r===")"&&(r=s.next()),c}if(De(r)){const c=[];do c.push(r),r=s.next();while(De(r));return l=>e(c,l)}return null}function o(){const c=[];let l=i();for(;l;)c.push(l),l=i();return u=>c.every(h=>h(u))}function a(){const c=[];let l=o();for(;l&&(c.push(l),r==="|"||r===",");){do r=s.next();while(r==="|"||r===",");l=o()}return u=>c.some(h=>h(u))}}function De(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 ht(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):Ce(t.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},s);const o=n.injections(t.scopeName);if(o)for(const a of o)s.add(new D(a))}function Ce(t,e,n){if(e.repository&&e.repository[t]){const s=e.repository[t];X([s],e,n)}}function J(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&X(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&X(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function X(t,e,n){for(const s of t){if(n.visitedRule.has(s))continue;n.visitedRule.add(s);const r=s.repository?st({},e.repository,s.repository):e.repository;Array.isArray(s.patterns)&&X(s.patterns,{...e,repository:r},n);const i=s.include;if(!i)continue;const o=ft(i);switch(o.kind){case 0:J({...e,selfGrammar:e.baseGrammar},n);break;case 1:J(e,n);break;case 2:Ce(o.ruleName,{...e,repository:r},n);break;case 3:case 4:const a=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(a){const c={baseGrammar:e.baseGrammar,selfGrammar:a,repository:r};o.kind===4?Ce(o.ruleName,c,n):J(c,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 ft(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+)/,We=/\\(\d+)/g,fn=-1,dt=-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=H.hasCaptures(this._name),this._contentName=s||null,this._contentNameIsCapturing=H.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${rt(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:H.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:H.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!")}},gn=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}},Fe=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}},we=class extends z{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,s,r,i,o,a,c,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=a,this.applyEndPatternLast=c||!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}},Z=class extends z{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,s,r,i,o,a,c){super(t,e,n,s),this._begin=new W(r,this.id),this.beginCaptures=i,this.whileCaptures=a,this._while=new W(o,dt),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.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}},gt=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 gn(e.$vscodeTextmateLocation,e.id,e.name,e.match,N._compileCaptures(e.captures,n,s));if(typeof e.begin>"u"){e.repository&&(s=st({},s,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new Fe(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,N._compilePatterns(i,n,s))}return e.while?new Z(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 we(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 a=parseInt(o,10);a>i&&(i=a)}for(let o=0;o<=i;o++)r[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);let c=0;e[o].patterns&&(c=N.getCompiledRuleId(e[o],n,s)),r[a]=N.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,c)}}return r}static _compilePatterns(e,n,s){let r=[];if(e)for(let i=0,o=e.length;i<o;i++){const a=e[i];let c=-1;if(a.include){const l=ft(a.include);switch(l.kind){case 0:case 1:c=N.getCompiledRuleId(s[a.include],n,s);break;case 2:let u=s[l.ruleName];u&&(c=N.getCompiledRuleId(u,n,s));break;case 3:case 4:const h=l.scopeName,f=l.kind===4?l.ruleName:null,d=n.getExternalGrammar(h,s);if(d)if(f){let g=d.repository[f];g&&(c=N.getCompiledRuleId(g,n,d.repository))}else c=N.getCompiledRuleId(d.repository.$self,n,d.repository);break}}else c=N.getCompiledRuleId(a,n,s);if(c!==-1){const l=n.getRule(c);let u=!1;if((l instanceof Fe||l instanceof we||l instanceof Z)&&l.hasMissingPatterns&&l.patterns.length===0&&(u=!0),u)continue;r.push(c)}}return{patterns:r,hasMissingPatterns:(e?e.length:0)!==r.length}}},W=class mt{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 a=0;a<s;a++)if(e.charAt(a)==="\\"&&a+1<s){const l=e.charAt(a+1);l==="z"?(i.push(e.substring(r,a)),i.push("$(?!\\n)(?<!\\n)"),r=a+2):(l==="A"||l==="G")&&(o=!0),a++}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 mt(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 We.lastIndex=0,this.source.replace(We,(r,i)=>at(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,a,c;for(i=0,o=this.source.length;i<o;i++)a=this.source.charAt(i),e[i]=a,n[i]=a,s[i]=a,r[i]=a,a==="\\"&&i+1<o&&(c=this.source.charAt(i+1),c==="A"?(e[i+1]="",n[i+1]="",s[i+1]="A",r[i+1]="A"):c==="G"?(e[i+1]="",n[i+1]="G",s[i+1]="",r[i+1]="G"):(e[i+1]=c,n[i+1]=c,s[i+1]=c,r[i+1]=c),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 qe(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 qe(t,s,this._items.map(r=>r.ruleId))}},qe=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{h as Bt}from"./index-CkdplsNl.js";import{J as Ie,s as nt,f as Mt,c as jt,d as Dt,z as Wt,h as Ft}from"./index-BNzds__a.js";import{c as Me}from"./index-CLyIGTiM.js";import"./index-BJW5cYpx.js";import"./index-BHSCznho.js";import"./merge-refs-DdSaIw4w.js";import"./index-DhlSbsoh.js";import"./index-BVWEvTtH.js";import"./schemas-BzqjMV9-.js";import"./use-copy-button-BVfD1u7Q.js";import"./index-fYADC7x8.js";import"./check-BbfQleye.js";import"./x-Bcn3Z-A2.js";import"./search-BvoJUzZe.js";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 st(t,...e){return e.forEach(n=>{for(let s in n)t[s]=n[s]}),t}function rt(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?rt(t.substring(0,t.length-1)):t.substr(~e+1)}var de=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,H=class{static hasCaptures(t){return t===null?!1:(de.lastIndex=0,de.test(t))}static replaceCaptures(t,e,n){return t.replace(de,(s,r,i,o)=>{let a=n[parseInt(r||i,10)];if(a){let c=e.substring(a.start,a.end);for(;c[0]===".";)c=c.substring(1);switch(o){case"downcase":return c.toLowerCase();case"upcase":return c.toUpperCase();default:return c}}else return s})}};function it(t,e){return t<e?-1:t>e?1:0}function ot(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=it(t[r],e[r]);if(i!==0)return i}return 0}return n-s}function je(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 at(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var ct=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}},V=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(Yt(t),e)}static createFromParsedTheme(t,e){return Vt(t,e)}_cachedMatchRoot=new ct(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 lt(s.fontStyle,s.foreground,s.background):null}},ge=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 lt=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function Yt(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 a;if(typeof o.scope=="string"){let h=o.scope;h=h.replace(/^[,]+/,""),h=h.replace(/[,]+$/,""),a=h.split(",")}else Array.isArray(o.scope)?a=o.scope:a=[""];let c=-1;if(typeof o.settings.fontStyle=="string"){c=0;let h=o.settings.fontStyle.split(" ");for(let f=0,d=h.length;f<d;f++)switch(h[f]){case"italic":c=c|1;break;case"bold":c=c|2;break;case"underline":c=c|4;break;case"strikethrough":c=c|8;break}}let l=null;typeof o.settings.foreground=="string"&&je(o.settings.foreground)&&(l=o.settings.foreground);let u=null;typeof o.settings.background=="string"&&je(o.settings.background)&&(u=o.settings.background);for(let h=0,f=a.length;h<f;h++){let g=a[h].trim().split(" "),b=g[g.length-1],_=null;g.length>1&&(_=g.slice(0,g.length-1),_.reverse()),n[s++]=new Jt(b,_,r,c,l,u)}}return n}var Jt=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 Vt(t,e){t.sort((c,l)=>{let u=it(c.scope,l.scope);return u!==0||(u=ot(c.parentScopes,l.parentScopes),u!==0)?u:c.index-l.index});let n=0,s="#000000",r="#ffffff";for(;t.length>=1&&t[0].scope==="";){let c=t.shift();c.fontStyle!==-1&&(n=c.fontStyle),c.foreground!==null&&(s=c.foreground),c.background!==null&&(r=c.background)}let i=new Qt(e),o=new lt(n,i.getId(s),i.getId(r)),a=new Zt(new be(0,null,-1,0,0),[]);for(let c=0,l=t.length;c<l;c++){let u=t[c];a.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new V(i,o,a)}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([]),be=class ut{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 ut(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 Se{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(Se._cmpBySpecificity),n}insert(e,n,s,r,i,o){if(n===""){this._doInsertHere(e,s,r,i,o);return}let a=n.indexOf("."),c,l;a===-1?(c=n,l=""):(c=n.substring(0,a),l=n.substring(a+1));let u;this._children.hasOwnProperty(c)?u=this._children[c]:(u=new Se(this._mainRule.clone(),be.cloneArr(this._rulesWithParentScopes)),this._children[c]=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,a=this._rulesWithParentScopes.length;o<a;o++){let c=this._rulesWithParentScopes[o];if(ot(c.parentScopes,n)===0){c.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 be(e,n,s,r,i))}},$=class A{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=A.getLanguageId(e),s=A.getTokenType(e),r=A.getFontStyle(e),i=A.getForeground(e),o=A.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,a){let c=A.getLanguageId(e),l=A.getTokenType(e),u=A.containsBalancedBrackets(e)?1:0,h=A.getFontStyle(e),f=A.getForeground(e),d=A.getBackground(e);return n!==0&&(c=n),s!==8&&(l=s),r!==null&&(u=r?1:0),i!==-1&&(h=i),o!==0&&(f=o),a!==0&&(d=a),(c<<0|l<<8|u<<10|h<<11|f<<15|d<<24)>>>0}};function Q(t,e){const n=[],s=en(t);let r=s.next();for(;r!==null;){let c=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":c=1;break;case"L":c=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=s.next()}let l=o();if(n.push({matcher:l,priority:c}),r!==",")break;r=s.next()}return n;function i(){if(r==="-"){r=s.next();const c=i();return l=>!!c&&!c(l)}if(r==="("){r=s.next();const c=a();return r===")"&&(r=s.next()),c}if(De(r)){const c=[];do c.push(r),r=s.next();while(De(r));return l=>e(c,l)}return null}function o(){const c=[];let l=i();for(;l;)c.push(l),l=i();return u=>c.every(h=>h(u))}function a(){const c=[];let l=o();for(;l&&(c.push(l),r==="|"||r===",");){do r=s.next();while(r==="|"||r===",");l=o()}return u=>c.some(h=>h(u))}}function De(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 ht(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):Ce(t.ruleName,{baseGrammar:i,selfGrammar:r,repository:r.repository},s);const o=n.injections(t.scopeName);if(o)for(const a of o)s.add(new D(a))}function Ce(t,e,n){if(e.repository&&e.repository[t]){const s=e.repository[t];X([s],e,n)}}function J(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&X(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&X(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function X(t,e,n){for(const s of t){if(n.visitedRule.has(s))continue;n.visitedRule.add(s);const r=s.repository?st({},e.repository,s.repository):e.repository;Array.isArray(s.patterns)&&X(s.patterns,{...e,repository:r},n);const i=s.include;if(!i)continue;const o=ft(i);switch(o.kind){case 0:J({...e,selfGrammar:e.baseGrammar},n);break;case 1:J(e,n);break;case 2:Ce(o.ruleName,{...e,repository:r},n);break;case 3:case 4:const a=o.scopeName===e.selfGrammar.scopeName?e.selfGrammar:o.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(a){const c={baseGrammar:e.baseGrammar,selfGrammar:a,repository:r};o.kind===4?Ce(o.ruleName,c,n):J(c,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 ft(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+)/,We=/\\(\d+)/g,fn=-1,dt=-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=H.hasCaptures(this._name),this._contentName=s||null,this._contentNameIsCapturing=H.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${rt(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:H.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:H.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!")}},gn=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}},Fe=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}},we=class extends z{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,s,r,i,o,a,c,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=a,this.applyEndPatternLast=c||!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}},Z=class extends z{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,s,r,i,o,a,c){super(t,e,n,s),this._begin=new W(r,this.id),this.beginCaptures=i,this.whileCaptures=a,this._while=new W(o,dt),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.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}},gt=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 gn(e.$vscodeTextmateLocation,e.id,e.name,e.match,N._compileCaptures(e.captures,n,s));if(typeof e.begin>"u"){e.repository&&(s=st({},s,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new Fe(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,N._compilePatterns(i,n,s))}return e.while?new Z(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 we(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 a=parseInt(o,10);a>i&&(i=a)}for(let o=0;o<=i;o++)r[o]=null;for(const o in e){if(o==="$vscodeTextmateLocation")continue;const a=parseInt(o,10);let c=0;e[o].patterns&&(c=N.getCompiledRuleId(e[o],n,s)),r[a]=N.createCaptureRule(n,e[o].$vscodeTextmateLocation,e[o].name,e[o].contentName,c)}}return r}static _compilePatterns(e,n,s){let r=[];if(e)for(let i=0,o=e.length;i<o;i++){const a=e[i];let c=-1;if(a.include){const l=ft(a.include);switch(l.kind){case 0:case 1:c=N.getCompiledRuleId(s[a.include],n,s);break;case 2:let u=s[l.ruleName];u&&(c=N.getCompiledRuleId(u,n,s));break;case 3:case 4:const h=l.scopeName,f=l.kind===4?l.ruleName:null,d=n.getExternalGrammar(h,s);if(d)if(f){let g=d.repository[f];g&&(c=N.getCompiledRuleId(g,n,d.repository))}else c=N.getCompiledRuleId(d.repository.$self,n,d.repository);break}}else c=N.getCompiledRuleId(a,n,s);if(c!==-1){const l=n.getRule(c);let u=!1;if((l instanceof Fe||l instanceof we||l instanceof Z)&&l.hasMissingPatterns&&l.patterns.length===0&&(u=!0),u)continue;r.push(c)}}return{patterns:r,hasMissingPatterns:(e?e.length:0)!==r.length}}},W=class mt{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 a=0;a<s;a++)if(e.charAt(a)==="\\"&&a+1<s){const l=e.charAt(a+1);l==="z"?(i.push(e.substring(r,a)),i.push("$(?!\\n)(?<!\\n)"),r=a+2):(l==="A"||l==="G")&&(o=!0),a++}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 mt(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 We.lastIndex=0,this.source.replace(We,(r,i)=>at(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,a,c;for(i=0,o=this.source.length;i<o;i++)a=this.source.charAt(i),e[i]=a,n[i]=a,s[i]=a,r[i]=a,a==="\\"&&i+1<o&&(c=this.source.charAt(i+1),c==="A"?(e[i+1]="",n[i+1]="",s[i+1]="A",r[i+1]="A"):c==="G"?(e[i+1]="",n[i+1]="G",s[i+1]="",r[i+1]="G"):(e[i+1]=c,n[i+1]=c,s[i+1]=c,r[i+1]=c),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 qe(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 qe(t,s,this._items.map(r=>r.ruleId))}},qe=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}},me=class{constructor(t,e){this.languageId=t,this.tokenType=e}},mn=class Re{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,n){this._defaultAttributes=new me(e,8),this._embeddedLanguagesMatcher=new pn(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?Re._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new me(0,0);_getBasicScopeAttributes=new ct(e=>{const n=this._scopeToLanguage(e),s=this._toStandardTokenType(e);return new me(n,s)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(Re.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/},pn=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])=>at(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])}},ze=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function pt(t,e,n,s,r,i,o,a){const c=e.content.length;let l=!1,u=-1;if(o){const d=_n(t,e,n,s,r,i);r=d.stack,s=d.linePos,n=d.isFirstLine,u=d.anchorPosition}const h=Date.now();for(;!l;){if(a!==0&&Date.now()-h>a)return new ze(r,!0);f()}return new ze(r,!1);function f(){const d=yn(t,e,n,s,r,u);if(!d){i.produce(r,c),l=!0;return}const g=d.captureIndices,b=d.matchedRuleId,_=g&&g.length>0?g[0].end>s:!1;if(b===fn){const p=r.getRule(t);i.produce(r,g[0].start),r=r.withContentNameScopesList(r.nameScopesList),M(t,e,n,r,i,p.endCaptures,g),i.produce(r,g[0].end);const m=r;if(r=r.parent,u=m.getAnchorPos(),!_&&m.getEnterPos()===s){r=m,i.produce(r,c),l=!0;return}}else{const p=t.getRule(b);i.produce(r,g[0].start);const m=r,y=p.getName(e.content,g),R=r.contentNameScopesList.pushAttributed(y,t);if(r=r.push(b,s,u,g[0].end===c,null,R,R),p instanceof we){const C=p;M(t,e,n,r,i,C.beginCaptures,g),i.produce(r,g[0].end),u=g[0].end;const v=C.getContentName(e.content,g),x=R.pushAttributed(v,t);if(r=r.withContentNameScopesList(x),C.endHasBackReferences&&(r=r.withEndRule(C.getEndWithResolvedBackReferences(e.content,g))),!_&&m.hasSameRuleAs(r)){r=r.pop(),i.produce(r,c),l=!0;return}}else if(p instanceof Z){const C=p;M(t,e,n,r,i,C.beginCaptures,g),i.produce(r,g[0].end),u=g[0].end;const v=C.getContentName(e.content,g),x=R.pushAttributed(v,t);if(r=r.withContentNameScopesList(x),C.whileHasBackReferences&&(r=r.withEndRule(C.getWhileWithResolvedBackReferences(e.content,g))),!_&&m.hasSameRuleAs(r)){r=r.pop(),i.produce(r,c),l=!0;return}}else if(M(t,e,n,r,i,p.captures,g),i.produce(r,g[0].end),r=r.pop(),!_){r=r.safePop(),i.produce(r,c),l=!0;return}}g[0].end>s&&(s=g[0].end,n=!1)}}function _n(t,e,n,s,r,i){let o=r.beginRuleCapturedEOL?0:-1;const a=[];for(let c=r;c;c=c.pop()){const l=c.getRule(t);l instanceof Z&&a.push({rule:l,stack:c})}for(let c=a.pop();c;c=a.pop()){const{ruleScanner:l,findOptions:u}=Cn(c.rule,t,c.stack.endRule,n,s===o),h=l.findNextMatchSync(e,s,u);if(h){if(h.ruleId!==dt){r=c.stack.pop();break}h.captureIndices&&h.captureIndices.length&&(i.produce(c.stack,h.captureIndices[0].start),M(t,e,n,c.stack,i,c.rule.whileCaptures,h.captureIndices),i.produce(c.stack,h.captureIndices[0].end),o=h.captureIndices[0].end,h.captureIndices[0].end>s&&(s=h.captureIndices[0].end,n=!1))}else{r=c.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),a=t.getInjections();if(a.length===0)return o;const c=Sn(a,t,e,n,s,r,i);if(!c)return o;if(!o)return c;const l=o.captureIndices[0].start,u=c.captureIndices[0].start;return u<l||c.priorityMatch&&u===l?c:o}function bn(t,e,n,s,r,i){const o=r.getRule(t),{ruleScanner:a,findOptions:c}=_t(o,t,r.endRule,n,s===i),l=a.findNextMatchSync(e,s,c);return l?{captureIndices:l.captureIndices,matchedRuleId:l.ruleId}:null}function Sn(t,e,n,s,r,i,o){let a=Number.MAX_VALUE,c=null,l,u=0;const h=i.contentNameScopesList.getScopeNames();for(let f=0,d=t.length;f<d;f++){const g=t[f];if(!g.matcher(h))continue;const b=e.getRule(g.ruleId),{ruleScanner:_,findOptions:p}=_t(b,e,null,s,r===o),m=_.findNextMatchSync(n,r,p);if(!m)continue;const y=m.captureIndices[0].start;if(!(y>=a)&&(a=y,c=m.captureIndices,l=m.ruleId,u=g.priority,a===r))break}return c?{priorityMatch:u===-1,captureIndices:c,matchedRuleId:l}:null}function _t(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 a=e.content,c=Math.min(i.length,o.length),l=[],u=o[0].end;for(let h=0;h<c;h++){const f=i[h];if(f===null)continue;const d=o[h];if(d.length===0)continue;if(d.start>u)break;for(;l.length>0&&l[l.length-1].endPos<=d.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,d.start):r.produce(s,d.start),f.retokenizeCapturedWithRuleId){const b=f.getName(a,o),_=s.contentNameScopesList.pushAttributed(b,t),p=f.getContentName(a,o),m=_.pushAttributed(p,t),y=s.push(f.retokenizeCapturedWithRuleId,d.start,-1,!1,null,_,m),R=t.createOnigString(a.substring(0,d.end));pt(t,R,n&&d.start===0,d.start,y,r,!1,0),ht(R);continue}const g=f.getName(a,o);if(g!==null){const _=(l.length>0?l[l.length-1].scopes:s.contentNameScopesList).pushAttributed(g,t);l.push(new wn(_,d.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,a){return new kn(t,e,n,s,r,i,o,a)}function He(t,e,n,s,r){const i=Q(e,ee),o=gt.getCompiledRuleId(n,s,r.repository);for(const a of i)t.push({debugSelector:e,matcher:a.matcher,ruleId:o,grammar:r,priority:a.priority})}function ee(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,a){if(this._rootScopeName=t,this.balancedBracketSelectors=i,this._onigLib=a,this._basicScopeAttributesProvider=new mn(n,s),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=Ue(e,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const c of Object.keys(r)){const l=Q(c,ee);for(const u of l)this._tokenTypeMatchers.push({matcher:u.matcher,type:r[c]})}}_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)He(e,o,r[o],this,s);const i=this._grammarRepository.injections(n);i&&i.forEach(o=>{const a=this.getExternalGrammar(o);if(a){const c=a.injectionSelector;c&&He(e,c,a,this,a)}})}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]=Ue(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=gt.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let r;if(!e||e===Ne.NULL){r=!0;const l=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),h=$.set(0,l.languageId,l.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),f=this.getRule(this._rootId).getName(null,null);let d;f?d=j.createRootAndLookUpScopeName(f,h,this):d=j.createRoot("unknown",h),e=new Ne(null,this._rootId,-1,-1,!1,null,d,d)}else r=!1,e.reset();t=t+`
|
|
3
3
|
`;const i=this.createOnigString(t),o=i.content.length,a=new vn(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),c=pt(this,i,r,0,e,a,!0,s);return ht(i),{lineLength:o,lineTokens:a,ruleStack:c.stack,stoppedEarly:c.stoppedEarly}}};function Ue(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 T{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=ge.push(r,i.scopeNames),s=new T(s,r,i.encodedTokenAttributes);return s}static createRoot(e,n){return new T(null,new ge(null,e),n)}static createRootAndLookUpScopeName(e,n,s){const r=s.getMetadataForScope(e),i=new ge(null,e),o=s.themeProvider.themeMatch(i),a=T.mergeAttributes(n,r,o);return new T(null,i,a)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return T.equals(this,e)}static equals(e,n){do{if(e===n||!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),$.set(e,n.languageId,n.tokenType,null,r,i,o)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return T._pushAttributed(this,e,n);const s=e.split(/ /g);let r=this;for(const i of s)r=T._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),a=T.mergeAttributes(e.tokenAttributes,r,o);return new T(e,i,a)}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}},Ne=class E{constructor(e,n,s,r,i,o,a,c){this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=o,this.nameScopesList=a,this.contentNameScopesList=c,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=s,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new E(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e===null?!1:E._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(){E._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,s,r,i,o,a){return new E(this,e,n,s,r,i,o,a)}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 E(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 E(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,[]):Q(n,ee).map(s=>s.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>Q(n,ee).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=$.set(s,0,o.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(i))}if(r&&(s=$.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}},Tn=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)}},In=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Tn(V.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,n){this._syncRegistry.setTheme(V.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(a=>this._loadSingleGrammar(a.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)}},ke=Ne.NULL;function te(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 L(t,e){return t&&(e?.[t?.toLowerCase()]||t)}function Ln(t){return Array.isArray(t)?t:[t]}async function yt(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function oe(t){return!t||["plaintext","txt","text","plain"].includes(t)}function bt(t){return t==="ansi"||oe(t)}function ae(t){return t==="none"}function St(t){return ae(t)}function ce(t,e=!1){if(t.length===0)return[["",0]];const n=t.split(/(\r?\n)/g);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 Ke={light:"#333333",dark:"#bbbbbb"},Ye={light:"#fffffe",dark:"#1e1e1e"},Je="__shiki_resolved";function xe(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 a=e.settings?e.settings.find(c=>!c.name&&!c.scope):void 0;a?.settings?.foreground&&(s=a.settings.foreground),a?.settings?.background&&(n=a.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"?Ke.light:Ke.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(a){if(i.has(a))return i.get(a);r+=1;const c=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return e.colorReplacements?.[`#${c}`]?o(a):(i.set(a,c),c)}e.settings=e.settings.map(a=>{const c=a.settings?.foreground&&!a.settings.foreground.startsWith("#"),l=a.settings?.background&&!a.settings.background.startsWith("#");if(!c&&!l)return a;const u={...a,settings:{...a.settings}};if(c){const h=o(a.settings.foreground);e.colorReplacements[h]=a.settings.foreground,u.settings.foreground=h}if(l){const h=o(a.settings.background);e.colorReplacements[h]=a.settings.background,u.settings.background=h}return u});for(const a of Object.keys(e.colors||{}))if((a==="editor.foreground"||a==="editor.background"||a.startsWith("terminal.ansi"))&&!e.colors[a]?.startsWith("#")){const c=o(e.colors[a]);e.colorReplacements[c]=e.colors[a],e.colors[a]=c}return Object.defineProperty(e,Je,{enumerable:!1,writable:!1,value:!0}),e}async function Ct(t){return Array.from(new Set((await Promise.all(t.filter(e=>!bt(e)).map(async e=>await yt(e).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function wt(t){return(await Promise.all(t.map(async e=>St(e)?null:xe(await yt(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 \`${Array.from(n).join(" -> ")} -> ${t}\``);n.add(t)}}return t}var xn=class extends In{_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=xe(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=V.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=Array.from(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(([a])=>a).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))}},En=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 Pn(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(xe),r=new xn(new En(t.engine,n),s,n,t.langAlias);let i;function o(m){return Rt(m,t.langAlias)}function a(m){_();const y=r.getGrammar(typeof m=="string"?m:m.name);if(!y)throw new S(`Language \`${m}\` not found, you may need to load it first`);return y}function c(m){if(m==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};_();const y=r.getTheme(m);if(!y)throw new S(`Theme \`${m}\` not found, you may need to load it first`);return y}function l(m){_();const y=c(m);return i!==m&&(r.setTheme(y),i=m),{theme:y,colorMap:r.getColorMap()}}function u(){return _(),r.getLoadedThemes()}function h(){return _(),r.getLoadedLanguages()}function f(...m){_(),r.loadLanguages(m.flat(1))}async function d(...m){return f(await Ct(m))}function g(...m){_();for(const y of m.flat(1))r.loadTheme(y)}async function b(...m){return _(),g(await wt(m))}function _(){if(e)throw new S("Shiki instance has been disposed")}function p(){e||(e=!0,r.dispose(),B-=1)}return{setTheme:l,getTheme:c,getLanguage:a,getLoadedThemes:u,getLoadedLanguages:h,resolveLangAlias:o,loadLanguage:d,loadLanguageSync:f,loadTheme:b,loadThemeSync:g,dispose:p,[Symbol.dispose]:p}}async function Gn(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 Pn({...t,themes:e,langs:n,engine:s})}const Nt=new WeakMap;function le(t,e){Nt.set(t,e)}function q(t){return Nt.get(t)}var ue=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(Ln(n).map(s=>[s,ke])),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 On(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function On(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 $n(t,e){if(!(t instanceof ue))throw new S("Invalid grammar state");return t.getInternalStack(e)}function At(t,e,n={}){const{theme:s=t.getLoadedThemes()[0]}=n;if(oe(t.resolveLangAlias(n.lang||"text"))||ae(s))return ce(e).map(a=>[{content:a[0],offset:a[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 Mn(e,o,r,i,n)}function Bn(...t){if(t.length===2)return q(t[1]);const[e,n,s={}]=t,{lang:r="text",theme:i=e.getLoadedThemes()[0]}=s;if(oe(r)||ae(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:a}=e.setTheme(i),c=e.getLanguage(r);return new ue(Ee(n,c,o,a,s).stateStack,c.name,o.name)}function Mn(t,e,n,s,r){const i=Ee(t,e,n,s,r),o=new ue(i.stateStack,e.name,n.name);return le(i.tokens,o),i.tokens}function Ee(t,e,n,s,r){const i=te(n,r),{tokenizeMaxLineLength:o=0,tokenizeTimeLimit:a=500}=r,c=ce(t);let l=r.grammarState?$n(r.grammarState,n.name)??ke:r.grammarContextCode!=null?Ee(r.grammarContextCode,e,n,s,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:ke,u=[];const h=[];for(let f=0,d=c.length;f<d;f++){const[g,b]=c[f];if(g===""){u=[],h.push([]);continue}if(o>0&&g.length>=o){u=[],h.push([{content:g,offset:b,color:"",fontStyle:0}]);continue}let _,p,m;r.includeExplanation&&(_=e.tokenizeLine(g,l,a),p=_.tokens,m=0);const y=e.tokenizeLine2(g,l,a),R=y.tokens.length/2;for(let C=0;C<R;C++){const v=y.tokens[2*C],x=C+1<R?y.tokens[2*C+2]:g.length;if(v===x)continue;const Oe=y.tokens[2*C+1],Ot=L(s[$.getForeground(Oe)],i),$t=$.getFontStyle(Oe),he={content:g.substring(v,x),offset:b+v,color:Ot,fontStyle:$t};if(r.includeExplanation){const $e=[];if(r.includeExplanation!=="scopeName")for(const I of n.settings){let G;switch(typeof I.scope){case"string":G=I.scope.split(/,/).map(fe=>fe.trim());break;case"object":G=I.scope;break;default:continue}$e.push({settings:I,selectors:G.map(fe=>fe.split(/ /))})}he.explanation=[];let Be=0;for(;v+Be<x;){const I=p[m],G=g.substring(I.startIndex,I.endIndex);Be+=G.length,he.explanation.push({content:G,scopes:r.includeExplanation==="scopeName"?jn(I.scopes):Dn($e,I.scopes)}),m+=1}}u.push(he)}h.push(u),u=[],l=y.ruleStack}return{tokens:h,stateStack:l}}function jn(t){return t.map(e=>({scopeName:e}))}function Dn(t,e){const n=[];for(let s=0,r=e.length;s<r;s++){const i=e[s];n[s]={scopeName:i,themeMatches:Fn(t,i,e.slice(0,s))}}return n}function Ve(t,e){return t===e||e.substring(0,t.length)===t&&e[t.length]==="."}function Wn(t,e,n){if(!Ve(t[t.length-1],e))return!1;let s=t.length-2,r=n.length-1;for(;s>=0&&r>=0;)Ve(t[s],n[r])&&(s-=1),r-=1;return s===-1}function Fn(t,e,n){const s=[];for(const{selectors:r,settings:i}of t)for(const o of r)if(Wn(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=qn(...i.map(l=>l.tokens)),a=o[0].map((l,u)=>l.map((h,f)=>{const d={content:h.content,variants:{},offset:h.offset};return"includeExplanation"in n&&n.includeExplanation&&(d.explanation=h.explanation),o.forEach((g,b)=>{const{content:_,explanation:p,offset:m,...y}=g[u][f];d.variants[r[b].color]=y}),d})),c=i[0].state?new ue(Object.fromEntries(i.map(l=>[l.theme,l.state?.getInternalStack(l.theme)])),i[0].state.lang):void 0;return c&&le(a,c),a}function qn(...t){const e=t.map(()=>[]),n=t.length;for(let s=0;s<t[0].length;s++){const r=t.map(c=>c[s]),i=e.map(()=>[]);e.forEach((c,l)=>c.push(i[l]));const o=r.map(()=>0),a=r.map(c=>c[0]);for(;a.every(c=>c);){const c=Math.min(...a.map(l=>l.content.length));for(let l=0;l<n;l++){const u=a[l];u.content.length===c?(i[l].push(u),o[l]+=1,a[l]=r[l][o[l]]):(i[l].push({...u,content:u.content.slice(0,c)}),a[l]={...u,content:u.content.slice(c),offset:u.offset+c})}}}return e}const zn=/["&'<>`]/g,Hn=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Un=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Kn=/[|\\{}()[\]^$+*?.]/g,Qe=new WeakMap;function Yn(t,e){if(t=t.replace(e.subset?Jn(e.subset):zn,s),e.subset||e.escapeOnly)return t;return t.replace(Hn,n).replace(Un,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 Jn(t){let e=Qe.get(t);return e||(e=Vn(t),Qe.set(t,e)),e}function Vn(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(Kn,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const Qn=/[\dA-Fa-f]/;function Xn(t,e,n){const s="&#x"+t.toString(16).toUpperCase();return n&&e&&!Qn.test(String.fromCharCode(e))?s:s+";"}const Zn=/\d/;function es(t,e,n){const s="&#"+String(t);return n&&e&&!Zn.test(String.fromCharCode(e))?s:s+";"}const ts=["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"],pe={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:"€"},ns=["cent","copy","divide","gt","lt","not","para","times"],Tt={}.hasOwnProperty,Ae={};let U;for(U in pe)Tt.call(pe,U)&&(Ae[pe[U]]=U);const ss=/[^\dA-Za-z]/;function rs(t,e,n,s){const r=String.fromCharCode(t);if(Tt.call(Ae,r)){const i=Ae[r],o="&"+i;return n&&ts.includes(i)&&!ns.includes(i)&&(!s||e&&e!==61&&ss.test(String.fromCharCode(e)))?o:o+";"}return""}function is(t,e,n){let s=Xn(t,e,n.omitOptionalSemicolons),r;if((n.useNamedReferences||n.useShortestReferences)&&(r=rs(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const i=es(t,e,n.omitOptionalSemicolons);i.length<s.length&&(s=i)}return r&&(!n.useShortestReferences||r.length<s.length)?r:s}function O(t,e){return Yn(t,Object.assign({format:is},e))}const os=/^>|^->|<!--|-->|--!>|<!-$/g,as=[">"],cs=["<",">"];function ls(t,e,n,s){return s.settings.bogusComments?"<?"+O(t.value,Object.assign({},s.settings.characterReferences,{subset:as}))+">":"<!--"+t.value.replace(os,r)+"-->";function r(i){return O(i,Object.assign({},s.settings.characterReferences,{subset:cs}))}}function us(t,e,n,s){return"<!"+(s.settings.upperDoctype?"DOCTYPE":"doctype")+(s.settings.tightDoctype?"":" ")+"html>"}const w=Lt(1),It=Lt(-1),hs=[];function Lt(t){return e;function e(n,s,r){const i=n?n.children:hs;let o=(s||0)+t,a=i[o];if(!r)for(;a&&Ie(a);)o+=t,a=i[o];return a}}const fs={}.hasOwnProperty;function xt(t){return e;function e(n,s,r){return fs.call(t,n.tagName)&&t[n.tagName](n,s,r)}}const Pe=xt({body:gs,caption:_e,colgroup:_e,dd:ys,dt:_s,head:_e,html:ds,li:ps,optgroup:bs,option:Ss,p:ms,rp:Xe,rt:Xe,tbody:ws,td:Ze,tfoot:Rs,th:Ze,thead:Cs,tr:Ns});function _e(t,e,n){const s=w(n,e,!0);return!s||s.type!=="comment"&&!(s.type==="text"&&Ie(s.value.charAt(0)))}function ds(t,e,n){const s=w(n,e);return!s||s.type!=="comment"}function gs(t,e,n){const s=w(n,e);return!s||s.type!=="comment"}function ms(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 ps(t,e,n){const s=w(n,e);return!s||s.type==="element"&&s.tagName==="li"}function _s(t,e,n){const s=w(n,e);return!!(s&&s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd"))}function ys(t,e,n){const s=w(n,e);return!s||s.type==="element"&&(s.tagName==="dt"||s.tagName==="dd")}function Xe(t,e,n){const s=w(n,e);return!s||s.type==="element"&&(s.tagName==="rp"||s.tagName==="rt")}function bs(t,e,n){const s=w(n,e);return!s||s.type==="element"&&s.tagName==="optgroup"}function Ss(t,e,n){const s=w(n,e);return!s||s.type==="element"&&(s.tagName==="option"||s.tagName==="optgroup")}function Cs(t,e,n){const s=w(n,e);return!!(s&&s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot"))}function ws(t,e,n){const s=w(n,e);return!s||s.type==="element"&&(s.tagName==="tbody"||s.tagName==="tfoot")}function Rs(t,e,n){return!w(n,e)}function Ns(t,e,n){const s=w(n,e);return!s||s.type==="element"&&s.tagName==="tr"}function Ze(t,e,n){const s=w(n,e);return!s||s.type==="element"&&(s.tagName==="td"||s.tagName==="th")}const ks=xt({body:Ts,colgroup:Is,head:vs,html:As,tbody:Ls});function As(t){const e=w(t,-1);return!e||e.type!=="comment"}function vs(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 Ts(t){const e=w(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&Ie(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function Is(t,e,n){const s=It(n,e),r=w(t,-1,!0);return n&&s&&s.type==="element"&&s.tagName==="colgroup"&&Pe(s,n.children.indexOf(s),n)?!1:!!(r&&r.type==="element"&&r.tagName==="col")}function Ls(t,e,n){const s=It(n,e),r=w(t,-1);return n&&s&&s.type==="element"&&(s.tagName==="thead"||s.tagName==="tbody")&&Pe(s,n.children.indexOf(s),n)?!1:!!(r&&r.type==="element"&&r.tagName==="tr")}const K={name:[[`
|
|
4
4
|
\f\r &/=>`.split(""),`
|
|
@@ -8,5 +8,5 @@ import{h as Bt}from"./index-CkdplsNl.js";import{J as Ie,s as nt,f as Mt,c as jt,
|
|
|
8
8
|
\f\r &>`.split(""),`\0
|
|
9
9
|
\f\r "&'<=>\``.split("")],[`\0
|
|
10
10
|
\f\r "&'<=>\``.split(""),`\0
|
|
11
|
-
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function xs(t,e,n,s){const r=s.schema,i=r.space==="svg"?!1:s.settings.omitOptionalTags;let o=r.space==="svg"?s.settings.closeEmptyElements:s.settings.voids.includes(t.tagName.toLowerCase());const a=[];let c;r.space==="html"&&t.tagName==="svg"&&(s.schema=nt);const l=Es(s,t.properties),u=s.all(r.space==="html"&&t.tagName==="template"?t.content:t);return s.schema=r,u&&(o=!1),(l||!i||!ks(t,e,n))&&(a.push("<",t.tagName,l?" "+l:""),o&&(r.space==="svg"||s.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!s.settings.tightSelfClosing||c==="/"||c&&c!=='"'&&c!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(u),!o&&(!i||!Pe(t,e,n))&&a.push("</"+t.tagName+">"),a.join("")}function Es(t,e){const n=[];let s=-1,r;if(e){for(r in e)if(e[r]!==null&&e[r]!==void 0){const i=Ps(t,r,e[r]);i&&n.push(i)}}for(;++s<n.length;){const i=t.settings.tightAttributes?n[s].charAt(n[s].length-1):void 0;s!==n.length-1&&i!=='"'&&i!=="'"&&(n[s]+=" ")}return n.join("")}function Ps(t,e,n){const s=Mt(t.schema,e),r=t.settings.allowParseErrors&&t.schema.space==="html"?0:1,i=t.settings.allowDangerousCharacters?0:1;let o=t.quote,a;if(s.overloadedBoolean&&(n===s.attribute||n==="")?n=!0:(s.boolean||s.overloadedBoolean)&&(typeof n!="string"||n===s.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const c=O(s.attribute,Object.assign({},t.settings.characterReferences,{subset:K.name[r][i]}));return n===!0||(n=Array.isArray(n)?(s.commaSeparated?jt:Dt)(n,{padLeft:!t.settings.tightCommaSeparatedLists}):String(n),t.settings.collapseEmptyAttributes&&!n)?c:(t.settings.preferUnquoted&&(a=O(n,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:K.unquoted[r][i]}))),a!==n&&(t.settings.quoteSmart&&Me(n,o)>Me(n,t.alternative)&&(o=t.alternative),a=o+O(n,Object.assign({},t.settings.characterReferences,{subset:(o==="'"?K.single:K.double)[r][i],attribute:!0}))+o),c+(a&&"="+a))}const Gs=["<","&"];function Et(t,e,n,s){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:O(t.value,Object.assign({},s.settings.characterReferences,{subset:Gs}))}function Os(t,e,n,s){return s.settings.allowDangerousHtml?t.value:Et(t,e,n,s)}function $s(t,e,n,s){return s.all(t)}const Bs=Wt("type",{invalid:Ms,unknown:js,handlers:{comment:ls,doctype:us,element:xs,raw:Os,root:$s,text:Et}});function Ms(t){throw new Error("Expected node, not `"+t+"`")}function js(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const Ds={},Ws={},Fs=[];function qs(t,e){const n=e||Ds,s=n.quote||'"',r=s==='"'?"'":'"';if(s!=='"'&&s!=="'")throw new Error("Invalid quote `"+s+"`, expected `'` or `\"`");return{one:zs,all:Hs,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Bt,characterReferences:n.characterReferences||Ws,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?nt:Ft,quote:s,alternative:r}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function zs(t,e,n){return Bs(t,e,n,this)}function Hs(t){const e=[],n=t&&t.children||Fs;let s=-1;for(;++s<n.length;)e[s]=this.one(n[s],s,t);return e.join("")}function Pt(t,e){if(!e)return t;t.properties||={},t.properties.class||=[],typeof t.properties.class=="string"&&(t.properties.class=t.properties.class.split(/\s+/g)),Array.isArray(t.properties.class)||(t.properties.class=[]);const n=Array.isArray(e)?e:e.split(/\s+/g);for(const s of n)s&&!t.properties.class.includes(s)&&t.properties.class.push(s);return t}function Us(t){const e=ce(t,!0).map(([r])=>r);function n(r){if(r===t.length)return{line:e.length-1,character:e[e.length-1].length};let i=r,o=0;for(const a of e){if(i<a.length)break;i-=a.length,o++}return{line:o,character:i}}function s(r,i){let o=0;for(let a=0;a<r;a++)o+=e[a].length;return o+=i,o}return{lines:e,indexToPos:n,posToIndex:s}}function Pr(t,e,n){const s=new Set;for(const i of t.matchAll(/:?lang=["']([^"']+)["']/g)){const o=i[1].toLowerCase().trim();o&&s.add(o)}for(const i of t.matchAll(/(?:```|~~~)([\w-]+)/g)){const o=i[1].toLowerCase().trim();o&&s.add(o)}for(const i of t.matchAll(/\\begin\{([\w-]+)\}/g)){const o=i[1].toLowerCase().trim();o&&s.add(o)}for(const i of t.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){const o=i[1].toLowerCase().trim(),a=o.includes("/")?o.split("/").pop():o;a&&s.add(a)}if(!n)return Array.from(s);const r=n.getBundledLanguages();return Array.from(s).filter(i=>i&&r[i])}const Ge="light-dark()",Ks=["color","background-color"];function Ys(t,e){let n=0;const s=[];for(const r of e)r>n&&s.push({...t,content:t.content.slice(n,r),offset:t.offset+n}),n=r;return n<t.content.length&&s.push({...t,content:t.content.slice(n),offset:t.offset+n}),s}function Js(t,e){const n=Array.from(e instanceof Set?e:new Set(e)).sort((s,r)=>s-r);return n.length?t.map(s=>s.flatMap(r=>{const i=n.filter(o=>r.offset<o&&o<r.offset+r.content.length).map(o=>o-r.offset).sort((o,a)=>o-a);return i.length?Ys(r,i):r})):t}function Vs(t,e,n,s,r="css-vars"){const i={content:t.content,explanation:t.explanation,offset:t.offset},o=e.map(u=>ne(t.variants[u])),a=new Set(o.flatMap(u=>Object.keys(u))),c={},l=(u,h)=>{const f=h==="color"?"":h==="background-color"?"-bg":`-${h}`;return n+e[u]+(h==="color"?"":f)};return o.forEach((u,h)=>{for(const f of a){const d=u[f]||"inherit";if(h===0&&s&&Ks.includes(f))if(s===Ge&&o.length>1){const g=e.findIndex(_=>_==="light"),b=e.findIndex(_=>_==="dark");if(g===-1||b===-1)throw new S('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');c[f]=`light-dark(${o[g][f]||"inherit"}, ${o[b][f]||"inherit"})`,r==="css-vars"&&(c[l(h,f)]=d)}else c[f]=d;else r==="css-vars"&&(c[l(h,f)]=d)}}),i.htmlStyle=c,i}function ne(t){const e={};if(t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle){t.fontStyle&k.Italic&&(e["font-style"]="italic"),t.fontStyle&k.Bold&&(e["font-weight"]="bold");const n=[];t.fontStyle&k.Underline&&n.push("underline"),t.fontStyle&k.Strikethrough&&n.push("line-through"),n.length&&(e["text-decoration"]=n.join(" "))}return e}function ve(t){return typeof t=="string"?t:Object.entries(t).map(([e,n])=>`${e}:${n}`).join(";")}function Qs(){const t=new WeakMap;function e(n){if(!t.has(n.meta)){let r=function(o){if(typeof o=="number"){if(o<0||o>n.source.length)throw new S(`Invalid decoration offset: ${o}. Code length: ${n.source.length}`);return{...s.indexToPos(o),offset:o}}else{const a=s.lines[o.line];if(a===void 0)throw new S(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${s.lines.length}`);let c=o.character;if(c<0&&(c=a.length+c),c<0||c>a.length)throw new S(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${a.length}`);return{...o,character:c,offset:s.posToIndex(o.line,c)}}};const s=Us(n.source),i=(n.options.decorations||[]).map(o=>({...o,start:r(o.start),end:r(o.end)}));Xs(i),t.set(n.meta,{decorations:i,converter:s,source:n.source})}return t.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(this.options.decorations?.length)return Js(n,e(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]))},code(n){if(!this.options.decorations?.length)return;const s=e(this),r=Array.from(n.children).filter(u=>u.type==="element"&&u.tagName==="span");if(r.length!==s.converter.lines.length)throw new S(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${s.converter.lines.length}). Failed to apply decorations.`);function i(u,h,f,d){const g=r[u];let b="",_=-1,p=-1;if(h===0&&(_=0),f===0&&(p=0),f===Number.POSITIVE_INFINITY&&(p=g.children.length),_===-1||p===-1)for(let y=0;y<g.children.length;y++)b+=Gt(g.children[y]),_===-1&&b.length===h&&(_=y+1),p===-1&&b.length===f&&(p=y+1);if(_===-1)throw new S(`Failed to find start index for decoration ${JSON.stringify(d.start)}`);if(p===-1)throw new S(`Failed to find end index for decoration ${JSON.stringify(d.end)}`);const m=g.children.slice(_,p);if(!d.alwaysWrap&&m.length===g.children.length)a(g,d,"line");else if(!d.alwaysWrap&&m.length===1&&m[0].type==="element")a(m[0],d,"token");else{const y={type:"element",tagName:"span",properties:{},children:m};a(y,d,"wrapper"),g.children.splice(_,m.length,y)}}function o(u,h){r[u]=a(r[u],h,"line")}function a(u,h,f){const d=h.properties||{},g=h.transform||(b=>b);return u.tagName=h.tagName||"span",u.properties={...u.properties,...d,class:u.properties.class},h.properties?.class&&Pt(u,h.properties.class),u=g(u,f)||u,u}const c=[],l=s.decorations.sort((u,h)=>h.start.offset-u.start.offset||u.end.offset-h.end.offset);for(const u of l){const{start:h,end:f}=u;if(h.line===f.line)i(h.line,h.character,f.character,u);else if(h.line<f.line){i(h.line,h.character,Number.POSITIVE_INFINITY,u);for(let d=h.line+1;d<f.line;d++)c.unshift(()=>o(d,u));i(f.line,0,f.character,u)}}c.forEach(u=>u())}}}function Xs(t){for(let e=0;e<t.length;e++){const n=t[e];if(n.start.offset>n.end.offset)throw new S(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let s=e+1;s<t.length;s++){const r=t[s],i=n.start.offset<=r.start.offset&&r.start.offset<n.end.offset,o=n.start.offset<r.end.offset&&r.end.offset<=n.end.offset,a=r.start.offset<=n.start.offset&&n.start.offset<r.end.offset,c=r.start.offset<n.end.offset&&n.end.offset<=r.end.offset;if(i||o||a||c){if(i&&o||a&&c||a&&n.start.offset===n.end.offset||o&&r.start.offset===r.end.offset)continue;throw new S(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(r.start)} intersect.`)}}}}function Gt(t){return t.type==="text"?t.value:t.type==="element"?t.children.map(Gt).join(""):""}const Zs=[Qs()];function se(t){const e=er(t.transformers||[]);return[...e.pre,...e.normal,...e.post,...Zs]}function er(t){const e=[],n=[],s=[];for(const r of t)switch(r.enforce){case"pre":e.push(r);break;case"post":n.push(r);break;default:s.push(r)}return{pre:e,post:n,normal:s}}var P=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],ye={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function tr(t,e){const n=t.indexOf("\x1B",e);if(n!==-1&&t[n+1]==="["){const s=t.indexOf("m",n);if(s!==-1)return{sequence:t.substring(n+2,s).split(";"),startPosition:n,position:s+1}}return{position:t.length}}function et(t){const e=t.shift();if(e==="2"){const n=t.splice(0,3).map(s=>Number.parseInt(s));return n.length!==3||n.some(s=>Number.isNaN(s))?void 0:{type:"rgb",rgb:n}}else if(e==="5"){const n=t.shift();if(n)return{type:"table",index:Number(n)}}}function nr(t){const e=[];for(;t.length>0;){const n=t.shift();if(!n)continue;const s=Number.parseInt(n);if(!Number.isNaN(s))if(s===0)e.push({type:"resetAll"});else if(s<=9)ye[s]&&e.push({type:"setDecoration",value:ye[s]});else if(s<=29){const r=ye[s-20];r&&(e.push({type:"resetDecoration",value:r}),r==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(s<=37)e.push({type:"setForegroundColor",value:{type:"named",name:P[s-30]}});else if(s===38){const r=et(t);r&&e.push({type:"setForegroundColor",value:r})}else if(s===39)e.push({type:"resetForegroundColor"});else if(s<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:P[s-40]}});else if(s===48){const r=et(t);r&&e.push({type:"setBackgroundColor",value:r})}else s===49?e.push({type:"resetBackgroundColor"}):s===53?e.push({type:"setDecoration",value:"overline"}):s===55?e.push({type:"resetDecoration",value:"overline"}):s>=90&&s<=97?e.push({type:"setForegroundColor",value:{type:"named",name:P[s-90+8]}}):s>=100&&s<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:P[s-100+8]}})}return e}function sr(){let t=null,e=null,n=new Set;return{parse(s){const r=[];let i=0;do{const o=tr(s,i),a=o.sequence?s.substring(i,o.startPosition):s.substring(i);if(a.length>0&&r.push({value:a,foreground:t,background:e,decorations:new Set(n)}),o.sequence){const c=nr(o.sequence);for(const l of c)l.type==="resetAll"?(t=null,e=null,n.clear()):l.type==="resetForegroundColor"?t=null:l.type==="resetBackgroundColor"?e=null:l.type==="resetDecoration"&&n.delete(l.value);for(const l of c)l.type==="setForegroundColor"?t=l.value:l.type==="setBackgroundColor"?e=l.value:l.type==="setDecoration"&&n.add(l.value)}i=o.position}while(i<s.length);return r}}}var rr={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function ir(t=rr){function e(a){return t[a]}function n(a){return`#${a.map(c=>Math.max(0,Math.min(c,255)).toString(16).padStart(2,"0")).join("")}`}let s;function r(){if(s)return s;s=[];for(let l=0;l<P.length;l++)s.push(e(P[l]));let a=[0,95,135,175,215,255];for(let l=0;l<6;l++)for(let u=0;u<6;u++)for(let h=0;h<6;h++)s.push(n([a[l],a[u],a[h]]));let c=8;for(let l=0;l<24;l++,c+=10)s.push(n([c,c,c]));return s}function i(a){return r()[a]}function o(a){switch(a.type){case"named":return e(a.name);case"rgb":return n(a.rgb);case"table":return i(a.index)}}return{value:o}}const or={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function ar(t,e,n){const s=te(t,n),r=ce(e),i=ir(Object.fromEntries(P.map(a=>{const c=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`;return[a,t.colors?.[c]||or[a]]}))),o=sr();return r.map(a=>o.parse(a[0]).map(c=>{let l,u;c.decorations.has("reverse")?(l=c.background?i.value(c.background):t.bg,u=c.foreground?i.value(c.foreground):t.fg):(l=c.foreground?i.value(c.foreground):t.fg,u=c.background?i.value(c.background):void 0),l=L(l,s),u=L(u,s),c.decorations.has("dim")&&(l=cr(l));let h=k.None;return c.decorations.has("bold")&&(h|=k.Bold),c.decorations.has("italic")&&(h|=k.Italic),c.decorations.has("underline")&&(h|=k.Underline),c.decorations.has("strikethrough")&&(h|=k.Strikethrough),{content:c.value,offset:a[1],color:l,bgColor:u,fontStyle:h}}))}function cr(t){const e=t.match(/#([0-9a-f]{3,8})/i);if(e){const s=e[1];if(s.length===8){const r=Math.round(Number.parseInt(s.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${s.slice(0,6)}${r}`}else{if(s.length===6)return`#${s}80`;if(s.length===4){const r=s[0],i=s[1],o=s[2],a=s[3];return`#${r}${r}${i}${i}${o}${o}${Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0")}`}else if(s.length===3){const r=s[0],i=s[1],o=s[2];return`#${r}${r}${i}${i}${o}${o}80`}}}const n=t.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:t}function Te(t,e,n={}){const s=t.resolveLangAlias(n.lang||"text"),{theme:r=t.getLoadedThemes()[0]}=n;if(!oe(s)&&!ae(r)&&s==="ansi"){const{theme:i}=t.setTheme(r);return ar(i,e,n)}return At(t,e,n)}function re(t,e,n){let s,r,i,o,a,c;if("themes"in n){const{defaultColor:l="light",cssVariablePrefix:u="--shiki-",colorsRendering:h="css-vars"}=n,f=Object.entries(n.themes).filter(p=>p[1]).map(p=>({color:p[0],theme:p[1]})).sort((p,m)=>p.color===l?-1:m.color===l?1:0);if(f.length===0)throw new S("`themes` option must not be empty");const d=vt(t,e,n,Te);if(c=q(d),l&&Ge!==l&&!f.find(p=>p.color===l))throw new S(`\`themes\` option must contain the defaultColor key \`${l}\``);const g=f.map(p=>t.getTheme(p.theme)),b=f.map(p=>p.color);i=d.map(p=>p.map(m=>Vs(m,b,u,l,h))),c&&le(i,c);const _=f.map(p=>te(p.theme,n));r=tt(f,g,_,u,l,"fg",h),s=tt(f,g,_,u,l,"bg",h),o=`shiki-themes ${g.map(p=>p.name).join(" ")}`,a=l?void 0:[r,s].join(";")}else if("theme"in n){const l=te(n.theme,n);i=Te(t,e,n);const u=t.getTheme(n.theme);s=L(u.bg,l),r=L(u.fg,l),o=u.name,c=q(i)}else throw new S("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:r,bg:s,themeName:o,rootStyle:a,grammarState:c}}function tt(t,e,n,s,r,i,o){return t.map((a,c)=>{const l=L(e[c][i],n[c])||"inherit",u=`${s+a.color}${i==="bg"?"-bg":""}:${l}`;if(c===0&&r){if(r===Ge&&t.length>1){const h=t.findIndex(d=>d.color==="light"),f=t.findIndex(d=>d.color==="dark");if(h===-1||f===-1)throw new S('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${L(e[h][i],n[h])||"inherit"}, ${L(e[f][i],n[f])||"inherit"});${u}`}return l}return o==="css-vars"?u:null}).filter(a=>!!a).join(";")}function ie(t,e,n,s={meta:{},options:n,codeToHast:(r,i)=>ie(t,r,i),codeToTokens:(r,i)=>re(t,r,i)}){let r=e;for(const g of se(n))r=g.preprocess?.call(s,r,n)||r;let{tokens:i,fg:o,bg:a,themeName:c,rootStyle:l,grammarState:u}=re(t,r,n);const{mergeWhitespaces:h=!0,mergeSameStyleTokens:f=!1}=n;h===!0?i=ur(i):h==="never"&&(i=hr(i)),f&&(i=fr(i));const d={...s,get source(){return r}};for(const g of se(n))i=g.tokens?.call(d,i)||i;return lr(i,{...n,fg:o,bg:a,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},d,u)}function lr(t,e,n,s=q(t)){const r=se(e),i=[],o={type:"root",children:[]},{structure:a="classic",tabindex:c="0"}=e,l={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?l.style=e.rootStyle:l.style=`background-color:${e.bg};color:${e.fg}`),c!==!1&&c!=null&&(l.tabindex=c.toString());for(const[b,_]of Object.entries(e.meta||{}))b.startsWith("_")||(l[b]=_);let u={type:"element",tagName:"pre",properties:l,children:[],data:e.data},h={type:"element",tagName:"code",properties:{},children:i};const f=[],d={...n,structure:a,addClassToHast:Pt,get source(){return n.source},get tokens(){return t},get options(){return e},get root(){return o},get pre(){return u},get code(){return h},get lines(){return f}};if(t.forEach((b,_)=>{_&&(a==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&i.push({type:"text",value:`
|
|
12
|
-
`}));let p={type:"element",tagName:"span",properties:{class:"line"},children:[]},m=0;for(const y of b){let R={type:"element",tagName:"span",properties:{...y.htmlAttrs},children:[{type:"text",value:y.content}]};const C=ve(y.htmlStyle||ne(y));C&&(R.properties.style=C);for(const v of r)R=v?.span?.call(d,R,_+1,m,p,y)||R;a==="inline"?o.children.push(R):a==="classic"&&p.children.push(R),m+=y.content.length}if(a==="classic"){for(const y of r)p=y?.line?.call(d,p,_+1)||p;f.push(p),i.push(p)}else a==="inline"&&f.push(p)}),a==="classic"){for(const b of r)h=b?.code?.call(d,h)||h;u.children.push(h);for(const b of r)u=b?.pre?.call(d,u)||u;o.children.push(u)}else if(a==="inline"){const b=[];let _={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const m of o.children)m.type==="element"&&m.tagName==="br"?(b.push(_),_={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(m.type==="element"||m.type==="text")&&_.children.push(m);b.push(_);let p={type:"element",tagName:"code",properties:{},children:b};for(const m of r)p=m?.code?.call(d,p)||p;o.children=[];for(let m=0;m<p.children.length;m++){m>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const y=p.children[m];y.type==="element"&&o.children.push(...y.children)}}let g=o;for(const b of r)g=b?.root?.call(d,g)||g;return s&&le(g,s),g}function ur(t){return t.map(e=>{const n=[];let s="",r;return e.forEach((i,o)=>{const a=!(i.fontStyle&&(i.fontStyle&k.Underline||i.fontStyle&k.Strikethrough));a&&i.content.match(/^\s+$/)&&e[o+1]?(r===void 0&&(r=i.offset),s+=i.content):s?(a?n.push({...i,offset:r,content:s+i.content}):n.push({content:s,offset:r},i),r=void 0,s=""):n.push(i)}),n})}function hr(t){return t.map(e=>e.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const s=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!s)return n;const[,r,i,o]=s;if(!r&&!o)return n;const a=[{...n,offset:n.offset+r.length,content:i}];return r&&a.unshift({content:r,offset:n.offset}),o&&a.push({content:o,offset:n.offset+r.length+i.length}),a}))}function fr(t){return t.map(e=>{const n=[];for(const s of e){if(n.length===0){n.push({...s});continue}const r=n[n.length-1],i=ve(r.htmlStyle||ne(r)),o=ve(s.htmlStyle||ne(s)),a=r.fontStyle&&(r.fontStyle&k.Underline||r.fontStyle&k.Strikethrough),c=s.fontStyle&&(s.fontStyle&k.Underline||s.fontStyle&k.Strikethrough);!a&&!c&&i===o?r.content+=s.content:n.push({...s})}return n})}const dr=qs;function gr(t,e,n){const s={meta:{},options:n,codeToHast:(i,o)=>ie(t,i,o),codeToTokens:(i,o)=>re(t,i,o)};let r=dr(ie(t,e,n,s));for(const i of se(n))r=i.postprocess?.call(s,r,n)||r;return r}async function mr(t){const e=await Gn(t);return{getLastGrammarState:(...n)=>Bn(e,...n),codeToTokensBase:(n,s)=>Te(e,n,s),codeToTokensWithThemes:(n,s)=>vt(e,n,s),codeToTokens:(n,s)=>re(e,n,s),codeToHast:(n,s)=>ie(e,n,s),codeToHtml:(n,s)=>gr(e,n,s),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function
|
|
11
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function xs(t,e,n,s){const r=s.schema,i=r.space==="svg"?!1:s.settings.omitOptionalTags;let o=r.space==="svg"?s.settings.closeEmptyElements:s.settings.voids.includes(t.tagName.toLowerCase());const a=[];let c;r.space==="html"&&t.tagName==="svg"&&(s.schema=nt);const l=Es(s,t.properties),u=s.all(r.space==="html"&&t.tagName==="template"?t.content:t);return s.schema=r,u&&(o=!1),(l||!i||!ks(t,e,n))&&(a.push("<",t.tagName,l?" "+l:""),o&&(r.space==="svg"||s.settings.closeSelfClosing)&&(c=l.charAt(l.length-1),(!s.settings.tightSelfClosing||c==="/"||c&&c!=='"'&&c!=="'")&&a.push(" "),a.push("/")),a.push(">")),a.push(u),!o&&(!i||!Pe(t,e,n))&&a.push("</"+t.tagName+">"),a.join("")}function Es(t,e){const n=[];let s=-1,r;if(e){for(r in e)if(e[r]!==null&&e[r]!==void 0){const i=Ps(t,r,e[r]);i&&n.push(i)}}for(;++s<n.length;){const i=t.settings.tightAttributes?n[s].charAt(n[s].length-1):void 0;s!==n.length-1&&i!=='"'&&i!=="'"&&(n[s]+=" ")}return n.join("")}function Ps(t,e,n){const s=Mt(t.schema,e),r=t.settings.allowParseErrors&&t.schema.space==="html"?0:1,i=t.settings.allowDangerousCharacters?0:1;let o=t.quote,a;if(s.overloadedBoolean&&(n===s.attribute||n==="")?n=!0:(s.boolean||s.overloadedBoolean)&&(typeof n!="string"||n===s.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const c=O(s.attribute,Object.assign({},t.settings.characterReferences,{subset:K.name[r][i]}));return n===!0||(n=Array.isArray(n)?(s.commaSeparated?jt:Dt)(n,{padLeft:!t.settings.tightCommaSeparatedLists}):String(n),t.settings.collapseEmptyAttributes&&!n)?c:(t.settings.preferUnquoted&&(a=O(n,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:K.unquoted[r][i]}))),a!==n&&(t.settings.quoteSmart&&Me(n,o)>Me(n,t.alternative)&&(o=t.alternative),a=o+O(n,Object.assign({},t.settings.characterReferences,{subset:(o==="'"?K.single:K.double)[r][i],attribute:!0}))+o),c+(a&&"="+a))}const Gs=["<","&"];function Et(t,e,n,s){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:O(t.value,Object.assign({},s.settings.characterReferences,{subset:Gs}))}function Os(t,e,n,s){return s.settings.allowDangerousHtml?t.value:Et(t,e,n,s)}function $s(t,e,n,s){return s.all(t)}const Bs=Wt("type",{invalid:Ms,unknown:js,handlers:{comment:ls,doctype:us,element:xs,raw:Os,root:$s,text:Et}});function Ms(t){throw new Error("Expected node, not `"+t+"`")}function js(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const Ds={},Ws={},Fs=[];function qs(t,e){const n=e||Ds,s=n.quote||'"',r=s==='"'?"'":'"';if(s!=='"'&&s!=="'")throw new Error("Invalid quote `"+s+"`, expected `'` or `\"`");return{one:zs,all:Hs,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Bt,characterReferences:n.characterReferences||Ws,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?nt:Ft,quote:s,alternative:r}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function zs(t,e,n){return Bs(t,e,n,this)}function Hs(t){const e=[],n=t&&t.children||Fs;let s=-1;for(;++s<n.length;)e[s]=this.one(n[s],s,t);return e.join("")}function Pt(t,e){if(!e)return t;t.properties||={},t.properties.class||=[],typeof t.properties.class=="string"&&(t.properties.class=t.properties.class.split(/\s+/g)),Array.isArray(t.properties.class)||(t.properties.class=[]);const n=Array.isArray(e)?e:e.split(/\s+/g);for(const s of n)s&&!t.properties.class.includes(s)&&t.properties.class.push(s);return t}function Us(t){const e=ce(t,!0).map(([r])=>r);function n(r){if(r===t.length)return{line:e.length-1,character:e[e.length-1].length};let i=r,o=0;for(const a of e){if(i<a.length)break;i-=a.length,o++}return{line:o,character:i}}function s(r,i){let o=0;for(let a=0;a<r;a++)o+=e[a].length;return o+=i,o}return{lines:e,indexToPos:n,posToIndex:s}}function Er(t,e,n){const s=new Set;for(const i of t.matchAll(/:?lang=["']([^"']+)["']/g)){const o=i[1].toLowerCase().trim();o&&s.add(o)}for(const i of t.matchAll(/(?:```|~~~)([\w-]+)/g)){const o=i[1].toLowerCase().trim();o&&s.add(o)}for(const i of t.matchAll(/\\begin\{([\w-]+)\}/g)){const o=i[1].toLowerCase().trim();o&&s.add(o)}for(const i of t.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){const o=i[1].toLowerCase().trim(),a=o.includes("/")?o.split("/").pop():o;a&&s.add(a)}if(!n)return Array.from(s);const r=n.getBundledLanguages();return Array.from(s).filter(i=>i&&r[i])}const Ge="light-dark()",Ks=["color","background-color"];function Ys(t,e){let n=0;const s=[];for(const r of e)r>n&&s.push({...t,content:t.content.slice(n,r),offset:t.offset+n}),n=r;return n<t.content.length&&s.push({...t,content:t.content.slice(n),offset:t.offset+n}),s}function Js(t,e){const n=Array.from(e instanceof Set?e:new Set(e)).sort((s,r)=>s-r);return n.length?t.map(s=>s.flatMap(r=>{const i=n.filter(o=>r.offset<o&&o<r.offset+r.content.length).map(o=>o-r.offset).sort((o,a)=>o-a);return i.length?Ys(r,i):r})):t}function Vs(t,e,n,s,r="css-vars"){const i={content:t.content,explanation:t.explanation,offset:t.offset},o=e.map(u=>ne(t.variants[u])),a=new Set(o.flatMap(u=>Object.keys(u))),c={},l=(u,h)=>{const f=h==="color"?"":h==="background-color"?"-bg":`-${h}`;return n+e[u]+(h==="color"?"":f)};return o.forEach((u,h)=>{for(const f of a){const d=u[f]||"inherit";if(h===0&&s&&Ks.includes(f))if(s===Ge&&o.length>1){const g=e.findIndex(_=>_==="light"),b=e.findIndex(_=>_==="dark");if(g===-1||b===-1)throw new S('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');c[f]=`light-dark(${o[g][f]||"inherit"}, ${o[b][f]||"inherit"})`,r==="css-vars"&&(c[l(h,f)]=d)}else c[f]=d;else r==="css-vars"&&(c[l(h,f)]=d)}}),i.htmlStyle=c,i}function ne(t){const e={};if(t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle){t.fontStyle&k.Italic&&(e["font-style"]="italic"),t.fontStyle&k.Bold&&(e["font-weight"]="bold");const n=[];t.fontStyle&k.Underline&&n.push("underline"),t.fontStyle&k.Strikethrough&&n.push("line-through"),n.length&&(e["text-decoration"]=n.join(" "))}return e}function ve(t){return typeof t=="string"?t:Object.entries(t).map(([e,n])=>`${e}:${n}`).join(";")}function Qs(){const t=new WeakMap;function e(n){if(!t.has(n.meta)){let r=function(o){if(typeof o=="number"){if(o<0||o>n.source.length)throw new S(`Invalid decoration offset: ${o}. Code length: ${n.source.length}`);return{...s.indexToPos(o),offset:o}}else{const a=s.lines[o.line];if(a===void 0)throw new S(`Invalid decoration position ${JSON.stringify(o)}. Lines length: ${s.lines.length}`);let c=o.character;if(c<0&&(c=a.length+c),c<0||c>a.length)throw new S(`Invalid decoration position ${JSON.stringify(o)}. Line ${o.line} length: ${a.length}`);return{...o,character:c,offset:s.posToIndex(o.line,c)}}};const s=Us(n.source),i=(n.options.decorations||[]).map(o=>({...o,start:r(o.start),end:r(o.end)}));Xs(i),t.set(n.meta,{decorations:i,converter:s,source:n.source})}return t.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(this.options.decorations?.length)return Js(n,e(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]))},code(n){if(!this.options.decorations?.length)return;const s=e(this),r=Array.from(n.children).filter(u=>u.type==="element"&&u.tagName==="span");if(r.length!==s.converter.lines.length)throw new S(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${s.converter.lines.length}). Failed to apply decorations.`);function i(u,h,f,d){const g=r[u];let b="",_=-1,p=-1;if(h===0&&(_=0),f===0&&(p=0),f===Number.POSITIVE_INFINITY&&(p=g.children.length),_===-1||p===-1)for(let y=0;y<g.children.length;y++)b+=Gt(g.children[y]),_===-1&&b.length===h&&(_=y+1),p===-1&&b.length===f&&(p=y+1);if(_===-1)throw new S(`Failed to find start index for decoration ${JSON.stringify(d.start)}`);if(p===-1)throw new S(`Failed to find end index for decoration ${JSON.stringify(d.end)}`);const m=g.children.slice(_,p);if(!d.alwaysWrap&&m.length===g.children.length)a(g,d,"line");else if(!d.alwaysWrap&&m.length===1&&m[0].type==="element")a(m[0],d,"token");else{const y={type:"element",tagName:"span",properties:{},children:m};a(y,d,"wrapper"),g.children.splice(_,m.length,y)}}function o(u,h){r[u]=a(r[u],h,"line")}function a(u,h,f){const d=h.properties||{},g=h.transform||(b=>b);return u.tagName=h.tagName||"span",u.properties={...u.properties,...d,class:u.properties.class},h.properties?.class&&Pt(u,h.properties.class),u=g(u,f)||u,u}const c=[],l=s.decorations.sort((u,h)=>h.start.offset-u.start.offset||u.end.offset-h.end.offset);for(const u of l){const{start:h,end:f}=u;if(h.line===f.line)i(h.line,h.character,f.character,u);else if(h.line<f.line){i(h.line,h.character,Number.POSITIVE_INFINITY,u);for(let d=h.line+1;d<f.line;d++)c.unshift(()=>o(d,u));i(f.line,0,f.character,u)}}c.forEach(u=>u())}}}function Xs(t){for(let e=0;e<t.length;e++){const n=t[e];if(n.start.offset>n.end.offset)throw new S(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let s=e+1;s<t.length;s++){const r=t[s],i=n.start.offset<=r.start.offset&&r.start.offset<n.end.offset,o=n.start.offset<r.end.offset&&r.end.offset<=n.end.offset,a=r.start.offset<=n.start.offset&&n.start.offset<r.end.offset,c=r.start.offset<n.end.offset&&n.end.offset<=r.end.offset;if(i||o||a||c){if(i&&o||a&&c||a&&n.start.offset===n.end.offset||o&&r.start.offset===r.end.offset)continue;throw new S(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(r.start)} intersect.`)}}}}function Gt(t){return t.type==="text"?t.value:t.type==="element"?t.children.map(Gt).join(""):""}const Zs=[Qs()];function se(t){const e=er(t.transformers||[]);return[...e.pre,...e.normal,...e.post,...Zs]}function er(t){const e=[],n=[],s=[];for(const r of t)switch(r.enforce){case"pre":e.push(r);break;case"post":n.push(r);break;default:s.push(r)}return{pre:e,post:n,normal:s}}var P=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],ye={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function tr(t,e){const n=t.indexOf("\x1B",e);if(n!==-1&&t[n+1]==="["){const s=t.indexOf("m",n);if(s!==-1)return{sequence:t.substring(n+2,s).split(";"),startPosition:n,position:s+1}}return{position:t.length}}function et(t){const e=t.shift();if(e==="2"){const n=t.splice(0,3).map(s=>Number.parseInt(s));return n.length!==3||n.some(s=>Number.isNaN(s))?void 0:{type:"rgb",rgb:n}}else if(e==="5"){const n=t.shift();if(n)return{type:"table",index:Number(n)}}}function nr(t){const e=[];for(;t.length>0;){const n=t.shift();if(!n)continue;const s=Number.parseInt(n);if(!Number.isNaN(s))if(s===0)e.push({type:"resetAll"});else if(s<=9)ye[s]&&e.push({type:"setDecoration",value:ye[s]});else if(s<=29){const r=ye[s-20];r&&(e.push({type:"resetDecoration",value:r}),r==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(s<=37)e.push({type:"setForegroundColor",value:{type:"named",name:P[s-30]}});else if(s===38){const r=et(t);r&&e.push({type:"setForegroundColor",value:r})}else if(s===39)e.push({type:"resetForegroundColor"});else if(s<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:P[s-40]}});else if(s===48){const r=et(t);r&&e.push({type:"setBackgroundColor",value:r})}else s===49?e.push({type:"resetBackgroundColor"}):s===53?e.push({type:"setDecoration",value:"overline"}):s===55?e.push({type:"resetDecoration",value:"overline"}):s>=90&&s<=97?e.push({type:"setForegroundColor",value:{type:"named",name:P[s-90+8]}}):s>=100&&s<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:P[s-100+8]}})}return e}function sr(){let t=null,e=null,n=new Set;return{parse(s){const r=[];let i=0;do{const o=tr(s,i),a=o.sequence?s.substring(i,o.startPosition):s.substring(i);if(a.length>0&&r.push({value:a,foreground:t,background:e,decorations:new Set(n)}),o.sequence){const c=nr(o.sequence);for(const l of c)l.type==="resetAll"?(t=null,e=null,n.clear()):l.type==="resetForegroundColor"?t=null:l.type==="resetBackgroundColor"?e=null:l.type==="resetDecoration"&&n.delete(l.value);for(const l of c)l.type==="setForegroundColor"?t=l.value:l.type==="setBackgroundColor"?e=l.value:l.type==="setDecoration"&&n.add(l.value)}i=o.position}while(i<s.length);return r}}}var rr={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function ir(t=rr){function e(a){return t[a]}function n(a){return`#${a.map(c=>Math.max(0,Math.min(c,255)).toString(16).padStart(2,"0")).join("")}`}let s;function r(){if(s)return s;s=[];for(let l=0;l<P.length;l++)s.push(e(P[l]));let a=[0,95,135,175,215,255];for(let l=0;l<6;l++)for(let u=0;u<6;u++)for(let h=0;h<6;h++)s.push(n([a[l],a[u],a[h]]));let c=8;for(let l=0;l<24;l++,c+=10)s.push(n([c,c,c]));return s}function i(a){return r()[a]}function o(a){switch(a.type){case"named":return e(a.name);case"rgb":return n(a.rgb);case"table":return i(a.index)}}return{value:o}}const or={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function ar(t,e,n){const s=te(t,n),r=ce(e),i=ir(Object.fromEntries(P.map(a=>{const c=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`;return[a,t.colors?.[c]||or[a]]}))),o=sr();return r.map(a=>o.parse(a[0]).map(c=>{let l,u;c.decorations.has("reverse")?(l=c.background?i.value(c.background):t.bg,u=c.foreground?i.value(c.foreground):t.fg):(l=c.foreground?i.value(c.foreground):t.fg,u=c.background?i.value(c.background):void 0),l=L(l,s),u=L(u,s),c.decorations.has("dim")&&(l=cr(l));let h=k.None;return c.decorations.has("bold")&&(h|=k.Bold),c.decorations.has("italic")&&(h|=k.Italic),c.decorations.has("underline")&&(h|=k.Underline),c.decorations.has("strikethrough")&&(h|=k.Strikethrough),{content:c.value,offset:a[1],color:l,bgColor:u,fontStyle:h}}))}function cr(t){const e=t.match(/#([0-9a-f]{3,8})/i);if(e){const s=e[1];if(s.length===8){const r=Math.round(Number.parseInt(s.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${s.slice(0,6)}${r}`}else{if(s.length===6)return`#${s}80`;if(s.length===4){const r=s[0],i=s[1],o=s[2],a=s[3];return`#${r}${r}${i}${i}${o}${o}${Math.round(Number.parseInt(`${a}${a}`,16)/2).toString(16).padStart(2,"0")}`}else if(s.length===3){const r=s[0],i=s[1],o=s[2];return`#${r}${r}${i}${i}${o}${o}80`}}}const n=t.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:t}function Te(t,e,n={}){const s=t.resolveLangAlias(n.lang||"text"),{theme:r=t.getLoadedThemes()[0]}=n;if(!oe(s)&&!ae(r)&&s==="ansi"){const{theme:i}=t.setTheme(r);return ar(i,e,n)}return At(t,e,n)}function re(t,e,n){let s,r,i,o,a,c;if("themes"in n){const{defaultColor:l="light",cssVariablePrefix:u="--shiki-",colorsRendering:h="css-vars"}=n,f=Object.entries(n.themes).filter(p=>p[1]).map(p=>({color:p[0],theme:p[1]})).sort((p,m)=>p.color===l?-1:m.color===l?1:0);if(f.length===0)throw new S("`themes` option must not be empty");const d=vt(t,e,n,Te);if(c=q(d),l&&Ge!==l&&!f.find(p=>p.color===l))throw new S(`\`themes\` option must contain the defaultColor key \`${l}\``);const g=f.map(p=>t.getTheme(p.theme)),b=f.map(p=>p.color);i=d.map(p=>p.map(m=>Vs(m,b,u,l,h))),c&&le(i,c);const _=f.map(p=>te(p.theme,n));r=tt(f,g,_,u,l,"fg",h),s=tt(f,g,_,u,l,"bg",h),o=`shiki-themes ${g.map(p=>p.name).join(" ")}`,a=l?void 0:[r,s].join(";")}else if("theme"in n){const l=te(n.theme,n);i=Te(t,e,n);const u=t.getTheme(n.theme);s=L(u.bg,l),r=L(u.fg,l),o=u.name,c=q(i)}else throw new S("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:r,bg:s,themeName:o,rootStyle:a,grammarState:c}}function tt(t,e,n,s,r,i,o){return t.map((a,c)=>{const l=L(e[c][i],n[c])||"inherit",u=`${s+a.color}${i==="bg"?"-bg":""}:${l}`;if(c===0&&r){if(r===Ge&&t.length>1){const h=t.findIndex(d=>d.color==="light"),f=t.findIndex(d=>d.color==="dark");if(h===-1||f===-1)throw new S('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${L(e[h][i],n[h])||"inherit"}, ${L(e[f][i],n[f])||"inherit"});${u}`}return l}return o==="css-vars"?u:null}).filter(a=>!!a).join(";")}function ie(t,e,n,s={meta:{},options:n,codeToHast:(r,i)=>ie(t,r,i),codeToTokens:(r,i)=>re(t,r,i)}){let r=e;for(const g of se(n))r=g.preprocess?.call(s,r,n)||r;let{tokens:i,fg:o,bg:a,themeName:c,rootStyle:l,grammarState:u}=re(t,r,n);const{mergeWhitespaces:h=!0,mergeSameStyleTokens:f=!1}=n;h===!0?i=ur(i):h==="never"&&(i=hr(i)),f&&(i=fr(i));const d={...s,get source(){return r}};for(const g of se(n))i=g.tokens?.call(d,i)||i;return lr(i,{...n,fg:o,bg:a,themeName:c,rootStyle:n.rootStyle===!1?!1:n.rootStyle??l},d,u)}function lr(t,e,n,s=q(t)){const r=se(e),i=[],o={type:"root",children:[]},{structure:a="classic",tabindex:c="0"}=e,l={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?l.style=e.rootStyle:l.style=`background-color:${e.bg};color:${e.fg}`),c!==!1&&c!=null&&(l.tabindex=c.toString());for(const[b,_]of Object.entries(e.meta||{}))b.startsWith("_")||(l[b]=_);let u={type:"element",tagName:"pre",properties:l,children:[],data:e.data},h={type:"element",tagName:"code",properties:{},children:i};const f=[],d={...n,structure:a,addClassToHast:Pt,get source(){return n.source},get tokens(){return t},get options(){return e},get root(){return o},get pre(){return u},get code(){return h},get lines(){return f}};if(t.forEach((b,_)=>{_&&(a==="inline"?o.children.push({type:"element",tagName:"br",properties:{},children:[]}):a==="classic"&&i.push({type:"text",value:`
|
|
12
|
+
`}));let p={type:"element",tagName:"span",properties:{class:"line"},children:[]},m=0;for(const y of b){let R={type:"element",tagName:"span",properties:{...y.htmlAttrs},children:[{type:"text",value:y.content}]};const C=ve(y.htmlStyle||ne(y));C&&(R.properties.style=C);for(const v of r)R=v?.span?.call(d,R,_+1,m,p,y)||R;a==="inline"?o.children.push(R):a==="classic"&&p.children.push(R),m+=y.content.length}if(a==="classic"){for(const y of r)p=y?.line?.call(d,p,_+1)||p;f.push(p),i.push(p)}else a==="inline"&&f.push(p)}),a==="classic"){for(const b of r)h=b?.code?.call(d,h)||h;u.children.push(h);for(const b of r)u=b?.pre?.call(d,u)||u;o.children.push(u)}else if(a==="inline"){const b=[];let _={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const m of o.children)m.type==="element"&&m.tagName==="br"?(b.push(_),_={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(m.type==="element"||m.type==="text")&&_.children.push(m);b.push(_);let p={type:"element",tagName:"code",properties:{},children:b};for(const m of r)p=m?.code?.call(d,p)||p;o.children=[];for(let m=0;m<p.children.length;m++){m>0&&o.children.push({type:"element",tagName:"br",properties:{},children:[]});const y=p.children[m];y.type==="element"&&o.children.push(...y.children)}}let g=o;for(const b of r)g=b?.root?.call(d,g)||g;return s&&le(g,s),g}function ur(t){return t.map(e=>{const n=[];let s="",r;return e.forEach((i,o)=>{const a=!(i.fontStyle&&(i.fontStyle&k.Underline||i.fontStyle&k.Strikethrough));a&&i.content.match(/^\s+$/)&&e[o+1]?(r===void 0&&(r=i.offset),s+=i.content):s?(a?n.push({...i,offset:r,content:s+i.content}):n.push({content:s,offset:r},i),r=void 0,s=""):n.push(i)}),n})}function hr(t){return t.map(e=>e.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const s=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!s)return n;const[,r,i,o]=s;if(!r&&!o)return n;const a=[{...n,offset:n.offset+r.length,content:i}];return r&&a.unshift({content:r,offset:n.offset}),o&&a.push({content:o,offset:n.offset+r.length+i.length}),a}))}function fr(t){return t.map(e=>{const n=[];for(const s of e){if(n.length===0){n.push({...s});continue}const r=n[n.length-1],i=ve(r.htmlStyle||ne(r)),o=ve(s.htmlStyle||ne(s)),a=r.fontStyle&&(r.fontStyle&k.Underline||r.fontStyle&k.Strikethrough),c=s.fontStyle&&(s.fontStyle&k.Underline||s.fontStyle&k.Strikethrough);!a&&!c&&i===o?r.content+=s.content:n.push({...s})}return n})}const dr=qs;function gr(t,e,n){const s={meta:{},options:n,codeToHast:(i,o)=>ie(t,i,o),codeToTokens:(i,o)=>re(t,i,o)};let r=dr(ie(t,e,n,s));for(const i of se(n))r=i.postprocess?.call(s,r,n)||r;return r}async function mr(t){const e=await Gn(t);return{getLastGrammarState:(...n)=>Bn(e,...n),codeToTokensBase:(n,s)=>Te(e,n,s),codeToTokensWithThemes:(n,s)=>vt(e,n,s),codeToTokens:(n,s)=>re(e,n,s),codeToHast:(n,s)=>ie(e,n,s),codeToHtml:(n,s)=>gr(e,n,s),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function Pr(t){const e=t.langs,n=t.themes,s=t.engine;async function r(i){function o(h){if(typeof h=="string"){if(h=i.langAlias?.[h]||h,bt(h))return[];const f=e[h];if(!f)throw new S(`Language \`${h}\` is not included in this bundle. You may want to load it from external source.`);return f}return h}function a(h){if(St(h))return"none";if(typeof h=="string"){const f=n[h];if(!f)throw new S(`Theme \`${h}\` is not included in this bundle. You may want to load it from external source.`);return f}return h}const c=(i.themes??[]).map(h=>a(h)),l=(i.langs??[]).map(h=>o(h)),u=await mr({engine:i.engine??s(),...i,themes:c,langs:l});return{...u,loadLanguage(...h){return u.loadLanguage(...h.map(o))},loadTheme(...h){return u.loadTheme(...h.map(a))},getBundledLanguages(){return e},getBundledThemes(){return n}}}return r}function pr(t){let e;async function n(s={}){if(e){const r=await e;return await Promise.all([r.loadTheme(...s.themes||[]),r.loadLanguage(...s.langs||[])]),r}else{e=t({...s,themes:[],langs:[]});const r=await e;return await Promise.all([r.loadTheme(...s.themes||[]),r.loadLanguage(...s.langs||[])]),r}}return n}function Gr(t,e){const n=pr(t);async function s(r,i){const o=await n({langs:[i.lang],themes:"theme"in i?[i.theme]:Object.values(i.themes)}),a=await e?.guessEmbeddedLanguages?.(r,i.lang,o);return a&&await o.loadLanguage(...a),o}return{getSingletonHighlighter(r){return n(r)},async codeToHtml(r,i){return(await s(r,i)).codeToHtml(r,i)},async codeToHast(r,i){return(await s(r,i)).codeToHast(r,i)},async codeToTokens(r,i){return(await s(r,i)).codeToTokens(r,i)},async codeToTokensBase(r,i){return(await s(r,i)).codeToTokensBase(r,i)},async codeToTokensWithThemes(r,i){return(await s(r,i)).codeToTokensWithThemes(r,i)},async getLastGrammarState(r,i){return(await n({langs:[i.lang],themes:[i.theme]})).getLastGrammarState(r,i)}}}export{S as ShikiError,Pt as addClassToHast,L as applyColorReplacements,ie as codeToHast,gr as codeToHtml,re as codeToTokens,Te as codeToTokensBase,vt as codeToTokensWithThemes,Pr as createBundledHighlighter,mr as createHighlighterCore,Us as createPositionConverter,Pn as createShikiPrimitive,Gn as createShikiPrimitiveAsync,Gr as createSingletonShorthands,Vs as flatTokenVariants,Bn as getLastGrammarState,ne as getTokenStyleObject,Er as guessEmbeddedLanguages,dr as hastToHtml,ae as isNoneTheme,oe as isPlainLang,bt as isSpecialLang,St as isSpecialTheme,pr as makeSingletonHighlighter,yt as normalizeGetter,xe as normalizeTheme,te as resolveColorReplacements,ce as splitLines,Ys as splitToken,Js as splitTokens,ve as stringifyTokenStyle,Ln as toArray,ar as tokenizeAnsiWithTheme,Mn as tokenizeWithTheme,lr as tokensToHast,Qs as transformerDecorations};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,j as m}from"./index-
|
|
1
|
+
import{r as s,j as m}from"./index-BJW5cYpx.js";import{u as d,a as P}from"./index-BHSCznho.js";const c={search:"Search",searchNoResult:"No results found",toc:"On this page",tocNoHeadings:"No Headings",lastUpdate:"Last updated on",chooseLanguage:"Choose a language",nextPage:"Next Page",previousPage:"Previous Page",chooseTheme:"Theme",editOnGithub:"Edit on GitHub"},h=s.createContext({text:{...c}});function R(t){return C().text[t.label]}function C(){return s.useContext(h)}function b({locales:t=[],locale:o,onLocaleChange:a,children:g,translations:r}){const f=d(),x=P(),u=e=>{if(a)return a(e);const n=x.split("/").filter(p=>p.length>0);n[0]!==o?n.unshift(e):n[0]=e,f.push(`/${n.join("/")}`)},i=s.useRef(u);return i.current=u,m.jsx(h,{value:s.useMemo(()=>({locale:o,locales:t,text:{...c,...r},onChange:e=>i.current(e)}),[o,t,r]),children:g})}export{R as I,b as a,C as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as p,I as x}from"./i18n-
|
|
1
|
+
import{u as p,I as x}from"./i18n-C-Z_Hjir.js";import{C as m,a as f,u as w}from"./tree-DMBvckeu.js";import{c as g,t as d}from"./index-DhlSbsoh.js";import{u as j}from"./use-copy-button-BVfD1u7Q.js";import{b as h}from"./index-BVWEvTtH.js";import{P as v,a as k,b as L,E as M}from"./popover-D1yTQ4pA.js";import{r as C,j as e}from"./index-BJW5cYpx.js";import{a as y}from"./index-BHSCznho.js";import{T as b}from"./text-align-start-77tc0bgj.js";import{C as z}from"./check-BbfQleye.js";import{u as P}from"./use-footer-items-DN1xdOWG.js";import"./Combination-DrcqRtGA.js";const I=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],N=g("copy",I),l=new Map;function V({markdownUrl:r,...o}){const[n,s]=C.useState(!1),[a,t]=j(async()=>{const i=l.get(r);if(i)return navigator.clipboard.writeText(await i);s(!0);try{const c=fetch(r).then(u=>u.text());l.set(r,c),await navigator.clipboard.write([new ClipboardItem({"text/plain":c})])}finally{s(!1)}});return e.jsxs("button",{disabled:n,onClick:t,...o,className:d(h({color:"secondary",size:"sm",className:"gap-2 [&_svg]:size-3.5 [&_svg]:text-fd-muted-foreground"}),o.className),children:[a?e.jsx(z,{}):e.jsx(N,{}),o.children??"Copy Markdown"]})}function Z({markdownUrl:r,githubUrl:o,...n}){const s=y(),a=C.useMemo(()=>{const t=`Read ${typeof window>"u"?s:new URL(s,window.location.origin)}, I want to ask questions about it.`;return[{title:"Open in GitHub",href:o,icon:e.jsxs("svg",{fill:"currentColor",role:"img",viewBox:"0 0 24 24",children:[e.jsx("title",{children:"GitHub"}),e.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})]})},{title:"View as Markdown",href:r,icon:e.jsx(b,{})},{title:"Open in Scira AI",href:`https://scira.ai/?${new URLSearchParams({q:t})}`,icon:e.jsxs("svg",{width:"910",height:"934",viewBox:"0 0 910 934",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("title",{children:"Scira AI"}),e.jsx("path",{d:"M647.664 197.775C569.13 189.049 525.5 145.419 516.774 66.8849C508.048 145.419 464.418 189.049 385.884 197.775C464.418 206.501 508.048 250.131 516.774 328.665C525.5 250.131 569.13 206.501 647.664 197.775Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"8",strokeLinejoin:"round"}),e.jsx("path",{d:"M516.774 304.217C510.299 275.491 498.208 252.087 480.335 234.214C462.462 216.341 439.058 204.251 410.333 197.775C439.059 191.3 462.462 179.209 480.335 161.336C498.208 143.463 510.299 120.06 516.774 91.334C523.25 120.059 535.34 143.463 553.213 161.336C571.086 179.209 594.49 191.3 623.216 197.775C594.49 204.251 571.086 216.341 553.213 234.214C535.34 252.087 523.25 275.491 516.774 304.217Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"8",strokeLinejoin:"round"}),e.jsx("path",{d:"M857.5 508.116C763.259 497.644 710.903 445.288 700.432 351.047C689.961 445.288 637.605 497.644 543.364 508.116C637.605 518.587 689.961 570.943 700.432 665.184C710.903 570.943 763.259 518.587 857.5 508.116Z",stroke:"currentColor",strokeWidth:"20",strokeLinejoin:"round"}),e.jsx("path",{d:"M700.432 615.957C691.848 589.05 678.575 566.357 660.383 548.165C642.191 529.973 619.499 516.7 592.593 508.116C619.499 499.533 642.191 486.258 660.383 468.066C678.575 449.874 691.848 427.181 700.432 400.274C709.015 427.181 722.289 449.874 740.481 468.066C758.673 486.258 781.365 499.533 808.271 508.116C781.365 516.7 758.673 529.973 740.481 548.165C722.289 566.357 709.015 589.05 700.432 615.957Z",stroke:"currentColor",strokeWidth:"20",strokeLinejoin:"round"}),e.jsx("path",{d:"M889.949 121.237C831.049 114.692 798.326 81.9698 791.782 23.0692C785.237 81.9698 752.515 114.692 693.614 121.237C752.515 127.781 785.237 160.504 791.782 219.404C798.326 160.504 831.049 127.781 889.949 121.237Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"8",strokeLinejoin:"round"}),e.jsx("path",{d:"M791.782 196.795C786.697 176.937 777.869 160.567 765.16 147.858C752.452 135.15 736.082 126.322 716.226 121.237C736.082 116.152 752.452 107.324 765.16 94.6152C777.869 81.9065 786.697 65.5368 791.782 45.6797C796.867 65.5367 805.695 81.9066 818.403 94.6152C831.112 107.324 847.481 116.152 867.338 121.237C847.481 126.322 831.112 135.15 818.403 147.858C805.694 160.567 796.867 176.937 791.782 196.795Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"8",strokeLinejoin:"round"}),e.jsx("path",{d:"M760.632 764.337C720.719 814.616 669.835 855.1 611.872 882.692C553.91 910.285 490.404 924.255 426.213 923.533C362.022 922.812 298.846 907.419 241.518 878.531C184.19 849.643 134.228 808.026 95.4548 756.863C56.6815 705.7 30.1238 646.346 17.8129 583.343C5.50207 520.339 7.76433 455.354 24.4266 393.359C41.089 331.364 71.7099 274.001 113.947 225.658C156.184 177.315 208.919 139.273 268.117 114.442",stroke:"currentColor",strokeWidth:"30",strokeLinecap:"round",strokeLinejoin:"round"})]})},{title:"Open in ChatGPT",href:`https://chatgpt.com/?${new URLSearchParams({hints:"search",q:t})}`,icon:e.jsxs("svg",{role:"img",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("title",{children:"OpenAI"}),e.jsx("path",{d:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"})]})},{title:"Open in Claude",href:`https://claude.ai/new?${new URLSearchParams({q:t})}`,icon:e.jsxs("svg",{fill:"currentColor",role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("title",{children:"Anthropic"}),e.jsx("path",{d:"M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z"})]})},{title:"Open in Cursor",icon:e.jsxs("svg",{fill:"currentColor",role:"img",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("title",{children:"Cursor"}),e.jsx("path",{d:"M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23"})]}),href:`https://cursor.com/link/prompt?${new URLSearchParams({text:t})}`}]},[o,r,s]);return e.jsxs(v,{children:[e.jsxs(k,{...n,className:d(h({color:"secondary",size:"sm"}),"gap-2 data-[state=open]:bg-fd-accent data-[state=open]:text-fd-accent-foreground",n.className),children:[n.children??"Open",e.jsx(m,{className:"size-3.5 text-fd-muted-foreground"})]}),e.jsx(L,{className:"flex flex-col",children:a.map(t=>e.jsxs("a",{href:t.href,rel:"noreferrer noopener",target:"_blank",className:"text-sm p-2 rounded-lg inline-flex items-center gap-2 hover:text-fd-accent-foreground hover:bg-fd-accent [&_svg]:size-4",children:[t.icon,t.title,e.jsx(M,{className:"text-fd-muted-foreground size-3.5 ms-auto"})]},t.href))})]})}const q={I18nLabel:x,useI18n:p},F={useTreeContext:w,useTreePath:f},D={MarkdownCopyButton:V,ViewOptionsPopover:Z},U={useFooterItems:P};export{F as export_272438578e17,U as export_2d06654f175c,D as export_d18ee319449f,q as export_d80c2fd60bf5};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,j as u}from"./index-
|
|
1
|
+
import{r as o,j as u}from"./index-BJW5cYpx.js";const c=()=>{throw new Error("You need to wrap your application inside `FrameworkProvider`.")},a=o.createContext({useParams:c,useRouter:c,usePathname:c});function f({Link:e,useRouter:r,useParams:t,usePathname:s,Image:n,children:i}){return u.jsx(a,{value:o.useMemo(()=>({usePathname:s,useRouter:r,Link:e,Image:n,useParams:t}),[e,s,r,t,n]),children:i})}function x(){return o.use(a).usePathname()}function h(){return o.use(a).useRouter()}function j(e){const{Image:r}=o.use(a);if(!r){const{src:t,alt:s,priority:n,...i}=e;return u.jsx("img",{alt:s,src:t,fetchPriority:n?"high":"auto",...i})}return u.jsx(r,{...e})}function p(e){const{Link:r}=o.use(a);if(!r){const{href:t,prefetch:s,...n}=e;return u.jsx("a",{href:t,...n})}return u.jsx(r,{...e})}export{f as F,j as I,p as L,x as a,h as u};
|