(function(){try{var l=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},d=new Error().stack;d&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[d]="eb41ac19-1507-4804-9a15-ba058ef4aa75",l._sentryDebugIdIdentifier="sentry-dbid-eb41ac19-1507-4804-9a15-ba058ef4aa75")}catch{}})();function s(l){function d(t,e){t.cmdState.push(e)}function g(t){return t.cmdState.length>0?t.cmdState[t.cmdState.length-1]:null}function k(t){var e=t.cmdState.pop();e&&e.closeBracket()}function p(t){for(var e=t.cmdState,n=e.length-1;n>=0;n--){var a=e[n];if(a.name!="DEFAULT")return a}return{styleIdentifier:function(){return null}}}function i(t,e,n){return function(){this.name=t,this.bracketNo=0,this.style=e,this.styles=n,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var r={};r.importmodule=i("importmodule","tag",["string","builtin"]),r.documentclass=i("documentclass","tag",["","atom"]),r.usepackage=i("usepackage","tag",["atom"]),r.begin=i("begin","tag",["atom"]),r.end=i("end","tag",["atom"]),r.label=i("label","tag",["atom"]),r.ref=i("ref","tag",["atom"]),r.eqref=i("eqref","tag",["atom"]),r.cite=i("cite","tag",["atom"]),r.bibitem=i("bibitem","tag",["atom"]),r.Bibitem=i("Bibitem","tag",["atom"]),r.RBibitem=i("RBibitem","tag",["atom"]),r.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function f(t,e){t.f=e}function o(t,e){var n;if(t.match(/^\\[a-zA-Z@\xc0-\u1fff\u2060-\uffff]+/)){var a=t.current().slice(1);return n=r.hasOwnProperty(a)?r[a]:r.DEFAULT,n=new n,d(e,n),f(e,b),n.style}if(t.match(/^\\[$&%#{}_]/)||t.match(/^\\[,;!\/\\]/))return"tag";if(t.match("\\["))return f(e,function(c,m){return h(c,m,"\\]")}),"keyword";if(t.match("\\("))return f(e,function(c,m){return h(c,m,"\\)")}),"keyword";if(t.match("$$"))return f(e,function(c,m){return h(c,m,"$$")}),"keyword";if(t.match("$"))return f(e,function(c,m){return h(c,m,"$")}),"keyword";var u=t.next();if(u=="%")return t.skipToEnd(),"comment";if(u=="}"||u=="]"){if(n=g(e),n)n.closeBracket(u),f(e,b);else return"error";return"bracket"}else return u=="{"||u=="["?(n=r.DEFAULT,n=new n,d(e,n),"bracket"):/\d/.test(u)?(t.eatWhile(/[\w.%]/),"atom"):(t.eatWhile(/[\w\-_]/),n=p(e),n.name=="begin"&&(n.argument=t.current()),n.styleIdentifier())}function h(t,e,n){if(t.eatSpace())return null;if(n&&t.match(n))return f(e,o),"keyword";if(t.match(/^\\[a-zA-Z@]+/))return"tag";if(t.match(/^[a-zA-Z]+/))return"variableName.special";if(t.match(/^\\[$&%#{}_]/)||t.match(/^\\[,;!\/]/)||t.match(/^[\^_&]/))return"tag";if(t.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(t.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var a=t.next();return a=="{"||a=="}"||a=="["||a=="]"||a=="("||a==")"?"bracket":a=="%"?(t.skipToEnd(),"comment"):"error"}function b(t,e){var n=t.peek(),a;return n=="{"||n=="["?(a=g(e),a.openBracket(n),t.eat(n),f(e,o),"bracket"):/[ \t\r]/.test(n)?(t.eat(n),null):(f(e,o),k(e),o(t,e))}return{name:"stex",startState:function(){var t=l?function(e,n){return h(e,n)}:o;return{cmdState:[],f:t}},copyState:function(t){return{cmdState:t.cmdState.slice(),f:t.f}},token:function(t,e){return e.f(t,e)},blankLine:function(t){t.f=o,t.cmdState.length=0},languageData:{commentTokens:{line:"%"}}}}const y=s(!1),w=s(!0);export{y as stex,w as stexMath};
//# sourceMappingURL=stex-YN-t31LR.js.map
