mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-14 07:38:42 +00:00
1 line
28 KiB
JavaScript
1 line
28 KiB
JavaScript
|
(function(){"use strict";var __webpack_modules__={667:function(e,t){t.q=void 0,t.q="3.2.2"},63:function(__unused_webpack_module,exports){function createTransform(){var nodeRequire=eval("require"),dirname=eval("__dirname");try{nodeRequire.resolve("saxon-js")}catch(e){throw Error("Saxon-js not found. Run the command:\n npm install saxon-js\nand try again.")}var Saxon=nodeRequire("saxon-js"),path=nodeRequire("path"),fs=nodeRequire("fs"),xsltFile=path.resolve(dirname,"mml3.sef.json"),xslt=JSON.parse(fs.readFileSync(xsltFile));return function(e,t){var l,s=t.adaptor,n=s.outerHTML(e);n.match(/ xmlns[=:]/)||(n=n.replace(/<(?:(\w+)(:))?math/,'<$1$2math xmlns$2$1="http://www.w3.org/1998/Math/MathML"'));try{l=s.firstChild(s.body(s.parse(Saxon.transform({stylesheetInternal:xslt,sourceText:n,destination:"serialized"}).principalResult)))}catch(t){l=e}return l}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.createTransform=void 0,exports.createTransform=createTransform},514:function(e,t,l){var s,n=this&&this.__extends||(s=function(e,t){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l])},s(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function l(){this.constructor=e}s(e,t),e.prototype=null===t?Object.create(t):(l.prototype=t.prototype,new l)}),m=this&&this.__assign||function(){return m=Object.assign||function(e){for(var t,l=1,s=arguments.length;l<s;l++)for(var n in t=arguments[l])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},m.apply(this,arguments)},o=this&&this.__read||function(e,t){var l="function"==typeof Symbol&&e[Symbol.iterator];if(!l)return e;var s,n,m=l.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(s=m.next()).done;)o.push(s.value)}catch(e){n={error:e}}finally{try{s&&!s.done&&(l=m.return)&&l.call(m)}finally{if(n)throw n.error}}return o},a=this&&this.__spreadArray||function(e,t,l){if(l||2===arguments.length)for(var s,n=0,m=t.length;n<m;n++)!s&&n in t||(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))},r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,l=t&&e[t],s=0;if(l)return l.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&s>=e.length&&(e=void 0),{value:e&&e[s++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.Mml3Handler=t.Mml3=void 0;var c=l(63),i=function(){function e(t){if("undefined"==typeof XSLTProcessor)this.transform=(0,c.createTransform)();else{var l=new XSLTProcessor,s=t.adaptor.parse(e.XSLT,"text/xml");l.importStylesheet(s),this.transform=function(e){var s=t.adaptor,n=s.node("div",{},[s.clone(e)]),m=l.transformToDocument(n);return s.tags(m,"math")[0]}}}return e.prototype.mmlFilter=function(e){e.document.options.enableMml3&&(e.data=this.transform(e.data,e.document))},e}();t.Mml3=i,t.Mml3Handler=function(e){var t;return e.documentClass=(t=function(e){function t(){for(var t,l,s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];var m=e.apply(this,a([],o(s),!1))||this;try{for(var c=r(m.inputJax||[]),p=c.next();!p.done;p=c.next()){var x=p.value;if("MathML"===x.name){if(!x.options._mml3){var d=new i(m);x.mmlFilters.add(d.mmlFilter.bind(d)),x.options._mml3=!0}break}}}catch(e){t={error:e}}finally{try{p&&!p.done&&(l=c.return)&&l.call(c)}finally{if(t)throw t.error}}return m}return n(t,e),t}(e.documentClass),t.OPTIONS=m(m({},e.documentClass.OPTIONS),{enableMml3:!0}),t),e},i.XSLT='\n<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"\n\t\txmlns:m="http://www.w3.org/1998/Math/MathML"\n\t\txmlns:c="http://exslt.org/common"\n\t\texclude-result-prefixes="m c">\n<xsl:output indent="yes" omit-xml-declaration="yes"/>\n<xsl:output indent="yes" omit-xml-declaration="yes"/>\n<xsl:template match="*">\n <xsl:copy>\n <xsl:copy-of select="@*"/>\n <xsl:app
|