"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var R=0,S={},v={util:{type:function(l){return Object.prototype.toString.call(l).slice(8,-1)},objId:function(l){return l.__id||Object.defineProperty(l,"__id",{value:++R}),l.__id},clone:function l(n,a){a=a||{};var r,i;switch(v.util.type(n)){case"Object":if(i=v.util.objId(n),a[i])return a[i];r={},a[i]=r;for(var u in n)n.hasOwnProperty(u)&&(r[u]=l(n[u],a));return r;case"Array":return i=v.util.objId(n),a[i]?a[i]:(r=[],a[i]=r,n.forEach(function(e,f){r[f]=l(e,a)}),r);default:return n}}},languages:{plain:S,plaintext:S,text:S,txt:S,extend:function(l,n){var a=v.util.clone(v.languages[l]);for(var r in n)a[r]=n[r];return a},insertBefore:function(l,n,a,r){r=r||v.languages;var i=r[l],u={};for(var e in i)if(i.hasOwnProperty(e)){if(e==n)for(var f in a)a.hasOwnProperty(f)&&(u[f]=a[f]);a.hasOwnProperty(e)||(u[e]=i[e])}var x=r[l];return r[l]=u,v.languages.DFS(v.languages,function(h,P){P===x&&h!=l&&(this[h]=u)}),u},DFS:function l(n,a,r,i){i=i||{};var u=v.util.objId;for(var e in n)if(n.hasOwnProperty(e)){a.call(n,e,n[e],r||e);var f=n[e],x=v.util.type(f);x==="Object"&&!i[u(f)]?(i[u(f)]=!0,l(f,a,null,i)):x==="Array"&&!i[u(f)]&&(i[u(f)]=!0,l(f,a,e,i))}}},plugins:{},highlight:function(l,n,a){var r={code:l,grammar:n,language:a};if(v.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=v.tokenize(r.code,r.grammar),v.hooks.run("after-tokenize",r),y.stringify(v.util.encode(r.tokens),r.language)},tokenize:function(l,n){var a=n.rest;if(a){for(var r in a)n[r]=a[r];delete n.rest}var i=new U;return D(i,i.head,l),F(l,i,n,i.head,0),W(i)},hooks:{all:{},add:function(l,n){var a=v.hooks.all;a[l]=a[l]||[],a[l].push(n)},run:function(l,n){var a=v.hooks.all[l];if(!(!a||!a.length))for(var r=0,i;i=a[r++];)i(n)}},Token:y};function y(l,n,a,r){this.type=l,this.content=n,this.alias=a,this.length=(r||"").length|0}function $(l,n,a,r){l.lastIndex=n;var i=l.exec(a);if(i&&r&&i[1]){var u=i[1].length;i.index+=u,i[0]=i[0].slice(u)}return i}function F(l,n,a,r,i,u){for(var e in a)if(!(!a.hasOwnProperty(e)||!a[e])){var f=a[e];f=Array.isArray(f)?f:[f];for(var x=0;x<f.length;++x){if(u&&u.cause==e+","+x)return;var h=f[x],P=h.inside,T=!!h.lookbehind,q=!!h.greedy,H=h.alias;if(q&&!h.pattern.global){var J=h.pattern.toString().match(/[imsuy]*$/)[0];h.pattern=RegExp(h.pattern.source,J+"g")}for(var B=h.pattern||h,g=r.next,c=i;g!==n.tail&&!(u&&c>=u.reach);c+=g.value.length,g=g.next){var w=g.value;if(n.length>l.length)return;if(!(w instanceof y)){var I=1,t;if(q){if(t=$(B,c,l,T),!t||t.index>=l.length)break;var _=t.index,K=t.index+t[0].length,s=c;for(s+=g.value.length;_>=s;)g=g.next,s+=g.value.length;if(s-=g.value.length,c=s,g.value instanceof y)continue;for(var o=g;o!==n.tail&&(s<K||typeof o.value=="string");o=o.next)I++,s+=o.value.length;I--,w=l.slice(c,s),t.index-=c}else if(t=$(B,0,w,T),!t)continue;var _=t.index,A=t[0],E=w.slice(0,_),M=w.slice(_+A.length),G=c+w.length;u&&G>u.reach&&(u.reach=G);var z=g.prev;E&&(z=D(n,z,E),c+=E.length),V(n,z,I);var Q=new y(e,P?v.tokenize(A,P):A,H,A);if(g=D(n,z,Q),M&&D(n,g,M),I>1){var O={cause:e+","+x,reach:G};F(l,n,a,g.prev,c,O),u&&O.reach>u.reach&&(u.reach=O.reach)}}}}}}function U(){var l={value:null,prev:null,next:null},n={value:null,prev:l,next:null};l.next=n,this.head=l,this.tail=n,this.length=0}function D(l,n,a){var r=n.next,i={value:a,prev:n,next:r};return n.next=i,r.prev=i,l.length++,i}function V(l,n,a){for(var r=n.next,i=0;i<a&&r!==l.tail;i++)r=r.next;n.next=r,r.prev=n,l.length-=i}function W(l){for(var n=[],a=l.head.next;a!==l.tail;)n.push(a.value),a=a.next;return n}const X=v;exports.Prism=X;
//# sourceMappingURL=prism-core.cjs.js.map
