1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-12 03:00:28 +00:00
TiddlyWiki5/plugins/tiddlywiki/katex/files/katex.min.js

2 lines
231 KiB
JavaScript
Raw Normal View History

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.katex=t():e.katex=t()}("undefined"!=typeof self?self:this,function(){return function(r){var n={};function i(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}return i.m=r,i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(r,n,function(e){return t[e]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=2)}([function(e,t,r){},,function(e,t,r){"use strict";r.r(t);r(0);var p=function(){function r(e,t,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=r}return r.prototype.getSource=function(){return this.lexer.input.slice(this.start,this.end)},r.range=function(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new r(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc},r}(),a=function(){function r(e,t){this.text=void 0,this.loc=void 0,this.text=e,this.loc=t}return r.prototype.range=function(e,t){return new r(t,p.range(this,e))},r}(),n=function e(t,r){this.position=void 0;var n,i="KaTeX parse error: "+t,a=r&&r.loc;if(a&&a.start<=a.end){var o=a.lexer.input;n=a.start;var s=a.end;n===o.length?i+=" at end of input: ":i+=" at position "+(n+1)+": ";var l=o.slice(n,s).replace(/[^]/g,"$&\u0332");i+=(15<n?"\u2026"+o.slice(n-15,n):o.slice(0,n))+l+(s+15<o.length?o.slice(s,s+15)+"\u2026":o.slice(s))}var h=new Error(i);return h.name="ParseError",h.__proto__=e.prototype,h.position=n,h};n.prototype.__proto__=Error.prototype;var X=n,i=/([A-Z])/g,o={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},s=/[&><"']/g;var l=function e(t){return"ordgroup"===t.type?1===t.body.length?e(t.body[0]):t:"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},T=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},Y={contains:function(e,t){return-1!==e.indexOf(t)},deflt:function(e,t){return void 0===e?t:e},escape:function(e){return String(e).replace(s,function(e){return o[e]})},hyphenate:function(e){return e.replace(i,"-$1").toLowerCase()},getBaseElem:l,isCharacterBox:function(e){var t=l(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type}},h=function(){function e(e){this.displayMode=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.allowedProtocols=void 0,e=e||{},this.displayMode=Y.deflt(e.displayMode,!1),this.throwOnError=Y.deflt(e.throwOnError,!0),this.errorColor=Y.deflt(e.errorColor,"#cc0000"),this.macros=e.macros||{},this.colorIsTextColor=Y.deflt(e.colorIsTextColor,!1),this.strict=Y.deflt(e.strict,"warn"),this.maxSize=Math.max(0,Y.deflt(e.maxSize,1/0)),this.maxExpand=Math.max(0,Y.deflt(e.maxExpand,1e3)),this.allowedProtocols=Y.deflt(e.allowedProtocols,["http","https","mailto","_relative"])}var t=e.prototype;return t.reportNonstrict=function(e,t,r){var n=this.strict;if("function"==typeof n&&(n=n(e,t,r)),n&&"ignore"!==n){if(!0===n||"error"===n)throw new X("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",r);"warn"===n?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+n+"': "+t+" ["+e+