mathjax
Version:
Beautiful and accessible math in all browsers. MathJax is an open-source JavaScript display engine for LaTeX, MathML, and AsciiMath notation that works in all browsers. This package includes the packaged components (install mathjax-full to get the source
1 lines • 337 kB
JavaScript
(function(){"use strict";var __webpack_modules__={706:function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=new Map;t.default=n},8905:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},s=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}},c=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.sreReady=t.Sre=void 0;var l,u=o(n(9037)),d=o(n(907)),h=o(n(7317)),p=o(n(4998)),f=c(n(4886)),m=n(3955),g=o(n(9009)),S=n(4513),b=c(n(706));!function(e){e.locales=S.Variables.LOCALES,e.sreReady=u.engineReady,e.setupEngine=u.setupEngine,e.engineSetup=u.engineSetup,e.toEnriched=u.toEnriched,e.toSpeech=u.toSpeech,e.clearspeakPreferences=m.ClearspeakPreferences,e.getHighlighter=g.highlighter,e.getSpeechGenerator=h.generator,e.getWalker=d.walker,e.clearspeakStyle=function(){return p.DOMAIN_TO_STYLES.clearspeak},e.preloadLocales=function(e){return s(this,void 0,void 0,(function(){var t;return a(this,(function(n){return[2,(t=b.default.get(e))?new Promise((function(e,n){return e(JSON.stringify(t))})):u.localeLoader()(e)]}))}))}}(l=t.Sre||(t.Sre={})),t.sreReady=l.sreReady,f.default.getInstance().delay=!0,t.default=l},7306:function(e,t){t.q=void 0,t.q="3.2.2"},8723:function(e,t){MathJax._.components.global.isObject,MathJax._.components.global.combineConfig,MathJax._.components.global.combineDefaults,t.r8=MathJax._.components.global.combineWithMathJax,MathJax._.components.global.MathJax},1993:function(e,t){MathJax._.components.package.PackageError,t.GL=MathJax._.components.package.Package},7086:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractAudioRenderer=void 0;const r=n(4886);t.AbstractAudioRenderer=class{constructor(){this.separator_=" "}setSeparator(e){this.separator_=e}getSeparator(){return"braille"===r.default.getInstance().modality?"":this.separator_}error(e){return null}merge(e){let t="";const n=e.length-1;for(let r,i=0;r=e[i];i++)if(t+=r.speech,i<n){const e=r.attributes.separator;t+=void 0!==e?e:this.getSeparator()}return t}finalize(e){return e}pauseValue(e){let t;switch(e){case"long":t=750;break;case"medium":t=500;break;case"short":t=250;break;default:t=parseInt(e,10)}return Math.floor(t*r.default.getInstance().getRate()/100)}}},9202:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.AcssRenderer=void 0;const r=n(4998),i=n(6988),o=n(2599),s=n(9610);class a extends s.MarkupRenderer{markup(e){this.setScaleFunction(-2,2,0,10,0);const t=o.personalityMarkup(e),n=[],r={open:[]};let i=null,s=!1;for(let e,a=0;e=t[a];a++){if(o.isMarkupElement(e)){o.mergeMarkup(r,e);continue}if(o.isPauseElement(e)){s&&(i=o.mergePause(i,e,Math.max));continue}const t='"'+this.merge(e.span)+'"';s=!0,i&&(n.push(this.pause(i)),i=null);const a=this.prosody_(r);n.push(a?"(text ("+a+") "+t+")":t)}return"(exp "+n.join(" ")+")"}error(e){return'(error "'+i.Move.get(e)+'")'}prosodyElement(e,t){switch(t=this.applyScaleFunction(t),e){case r.personalityProps.RATE:return"(richness . "+t+")";case r.personalityProps.PITCH:return"(average-pitch . "+t+")";case r.personalityProps.VOLUME:return"(stress . "+t+")"}return"(value . "+t+")"}pause(e){return"(pause . "+this.pauseValue(e[r.personalityProps.PAUSE])+")"}prosody_(e){const t=e.open,n=[];for(let r,i=0;r=t[i];i++)n.push(this.prosodyElement(r,e[r]));return n.join(" ")}}t.AcssRenderer=a},2599:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.isSpanElement=t.isPauseElement=t.isMarkupElement=t.personalityMarkup=t.sortClose=t.mergeMarkup=t.mergePause=void 0;const r=n(1426),i=n(4998),o=n(1930);function s(e,t,n){return(n||function(n,r){return"number"==typeof n&&"number"==typeof r?n+r:"number"==typeof n?r:"number"==typeof r?n:[e,t].sort()[0]}).call(null,e,t)}t.mergePause=function(e,t,n){return e?{pause:s(e.pause,t.pause,n)}:t},t.mergeMarkup=function(e,t){delete e.open,t.close.forEach((t=>delete e[t])),t.open.forEach((n=>e[n]=t[n]));const n=Object.keys(e);e.open=n},t.sortClose=function(e,t){if(e.length<=1)return e;const n=[];for(let r,i=0;r=t[i],e.length;i++)r.close&&r.close.length&&r.close.forEach((function(t){const r=e.indexOf(t);-1!==r&&(n.unshift(t),e.splice(r,1))}));return n};let a={},c=[];function l(e,t){const n=e[e.length-1];if(n){if(p(t)&&p(n)){if(void 0===n.join)return void(n.span=n.span.concat(t.span));const e=n.span.pop(),r=t.span.shift();return n.span.push(e+n.join+r),n.span=n.span.concat(t.span),void(n.join=t.join)}h(t)&&h(n)?n.pause=s(n.pause,t.pause):e.push(t)}else e.push(t)}function u(e,t){e.rate&&(t.rate=e.rate),e.pitch&&(t.pitch=e.pitch),e.volume&&(t.volume=e.volume)}function d(e){return"object"==typeof e&&e.open}function h(e){return"object"==typeof e&&1===Object.keys(e).length&&Object.keys(e)[0]===i.personalityProps.PAUSE}function p(e){const t=Object.keys(e);return"object"==typeof e&&(1===t.length&&"span"===t[0]||2===t.length&&("span"===t[0]&&"join"===t[1]||"span"===t[1]&&"join"===t[0]))}function f(e,t,n,r,a,c=!1){if(c){const c=e[e.length-1];let l;if(c&&(l=c[i.personalityProps.JOIN]),c&&!t.speech&&a&&h(c)){const e=i.personalityProps.PAUSE;c[e]=s(c[e],a[e]),a=null}if(c&&t.speech&&0===Object.keys(n).length&&p(c)){if(void 0!==l){const e=c.span.pop();t=new o.Span(e.speech+l+t.speech,e.attributes)}c.span.push(t),t=new o.Span("",{}),c[i.personalityProps.JOIN]=r}}0!==Object.keys(n).length&&e.push(n),t.speech&&e.push({span:[t],join:r}),a&&e.push(a)}function m(e,t){if(!t)return e;const n={};for(const r of i.personalityPropList){const i=e[r],o=t[r];if(!i&&!o||i&&o&&i===o)continue;const s=i||0;d(n)||(n.open=[],n.close=[]),i||n.close.push(r),o||n.open.push(r),o&&i&&(n.close.push(r),n.open.push(r)),t[r]=s,n[r]=s,a[r]?a[r].push(s):a[r]=[s]}if(d(n)){let e=n.close.slice();for(;e.length>0;){let i=c.pop();const o=(0,r.setdifference)(i,e);if(e=(0,r.setdifference)(e,i),i=o,0!==e.length){if(0!==i.length){n.close=n.close.concat(i),n.open=n.open.concat(i);for(let e,r=0;e=i[r];r++)n[e]=t[e]}}else 0!==i.length&&c.push(i)}c.push(n.open)}return n}t.personalityMarkup=function(e){a={},c=[];let t=[];const n={};for(let r,o=0;r=e[o];o++){let e=null;const o=r.descriptionSpan(),s=r.personality,a=s[i.personalityProps.JOIN];delete s[i.personalityProps.JOIN],void 0!==s[i.personalityProps.PAUSE]&&(e={[i.personalityProps.PAUSE]:s[i.personalityProps.PAUSE]},delete s[i.personalityProps.PAUSE]);f(t,o,m(s,n),a,e,!0)}return t=t.concat(function(){const e=[];for(let t=c.length-1;t>=0;t--){const n=c[t];if(n.length){const t={open:[],close:[]};for(let e=0;e<n.length;e++){const r=n[e];t.close.push(r),t[r]=0}e.push(t)}}return e}()),t=function(e){const t={},n=[];for(let r,i=0;r=e[i];i++){if(!d(r)){l(n,r);continue}if(!r.close||1!==r.close.length||r.open.length){u(r,t),n.push(r);continue}let o=e[i+1];if(!o||p(o)){u(r,t),n.push(r);continue}const s=h(o)?o:null;s&&(o=e[i+2]),o&&d(o)&&o.open[0]===r.close[0]&&!o.close.length&&o[o.open[0]]===t[o.open[0]]?s?(l(n,s),i+=2):i+=1:(u(r,t),n.push(r))}return n}(t),t},t.isMarkupElement=d,t.isPauseElement=h,t.isSpanElement=p},4148:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.AuditoryDescription=void 0;const r=n(1058),i=n(1930);class o{constructor({context:e,text:t,userValue:n,annotation:r,attributes:i,personality:o,layout:s}){this.context=e||"",this.text=t||"",this.userValue=n||"",this.annotation=r||"",this.attributes=i||{},this.personality=o||{},this.layout=s||""}static create(e,t={}){return e.text=r.Grammar.getInstance().apply(e.text,t),new o(e)}isEmpty(){return 0===this.context.length&&0===this.text.length&&0===this.userValue.length&&0===this.annotation.length}clone(){let e,t;if(this.personality){e={};for(const t in this.personality)e[t]=this.personality[t]}if(this.attributes){t={};for(const e in this.attributes)t[e]=this.attributes[e]}return new o({context:this.context,text:this.text,userValue:this.userValue,annotation:this.annotation,personality:e,attributes:t,layout:this.layout})}toString(){return'AuditoryDescription(context="'+this.context+'" text="'+this.text+'" userValue="'+this.userValue+'" annotation="'+this.annotation+'")'}descriptionString(){return this.context&&this.text?this.context+" "+this.text:this.context||this.text}descriptionSpan(){return new i.Span(this.descriptionString(),this.attributes)}equals(e){return this.context===e.context&&this.text===e.text&&this.userValue===e.userValue&&this.annotation===e.annotation}}t.AuditoryDescription=o},4253:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.isXml=t.registerRenderer=t.error=t.finalize=t.merge=t.markup=t.getSeparator=t.setSeparator=void 0;const r=n(4886),i=n(4998),o=n(9202),s=n(1292),a=n(1674),c=n(8078),l=n(1930),u=n(4115),d=n(6123),h=n(8244),p=n(4708),f=new u.SsmlRenderer,m=new Map([[i.Markup.NONE,new h.StringRenderer],[i.Markup.PUNCTUATION,new a.PunctuationRenderer],[i.Markup.LAYOUT,new s.LayoutRenderer],[i.Markup.ACSS,new o.AcssRenderer],[i.Markup.SABLE,new c.SableRenderer],[i.Markup.VOICEXML,f],[i.Markup.SSML,f],[i.Markup.SSML_STEP,new d.SsmlStepRenderer]]);t.setSeparator=function(e){const t=m.get(r.default.getInstance().markup);t&&t.setSeparator(e)},t.getSeparator=function(){const e=m.get(r.default.getInstance().markup);return e?e.getSeparator():""},t.markup=function(e){const t=m.get(r.default.getInstance().markup);return t?t.markup(e):""},t.merge=function(e){const t=e.map((e=>"string"==typeof e?new l.Span(e,{}):e)),n=m.get(r.default.getInstance().markup);return n?n.merge(t):e.join()},t.finalize=function(e){const t=m.get(r.default.getInstance().markup);return t?t.finalize(e):e},t.error=function(e){const t=m.get(r.default.getInstance().markup);return t?t.error(e):""},t.registerRenderer=function(e,t){m.set(e,t)},t.isXml=function(){return m.get(r.default.getInstance().markup)instanceof p.XmlRenderer}},1292:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.LayoutRenderer=void 0;const r=n(1984),i=n(6671),o=n(4998),s=n(2599),a=n(4708);class c extends a.XmlRenderer{finalize(e){return function(e){l="";const t=i.parseInput(`<all>${e}</all>`);return r.Debugger.getInstance().output(i.formatXml(t.toString())),l=p(t),l}(e)}pause(e){return""}prosodyElement(e,t){return e===o.personalityProps.LAYOUT?`<${t}>`:""}closeTag(e){return`</${e}>`}markup(e){const t=[];let n=[];for(const r of e){if(!r.layout){n.push(r);continue}t.push(this.processContent(n)),n=[];const e=r.layout;e.match(/^begin/)?t.push("<"+e.replace(/^begin/,"")+">"):e.match(/^end/)?t.push("</"+e.replace(/^end/,"")+">"):console.warn("Something went wrong with layout markup: "+e)}return t.push(this.processContent(n)),t.join("")}processContent(e){const t=[],n=s.personalityMarkup(e);for(let e,r=0;e=n[r];r++)e.span?t.push(this.merge(e.span)):s.isPauseElement(e);return t.join("")}}t.LayoutRenderer=c;let l="";const u={TABLE:function(e){let t=S(e);t.forEach((e=>{e.cells=e.cells.slice(1).slice(0,-1),e.width=e.width.slice(1).slice(0,-1)}));const[n,r]=b(t);return t=N(t,r),E(t,n)},CASES:function(e){let t=S(e);t.forEach((e=>{e.cells=e.cells.slice(0,-1),e.width=e.width.slice(0,-1)}));const[n,r]=b(t);return t=N(t,r),E(t,n)},CAYLEY:function(e){let t=S(e);t.forEach((e=>{e.cells=e.cells.slice(1).slice(0,-1),e.width=e.width.slice(1).slice(0,-1),e.sep=e.sep+e.sep}));const[n,r]=b(t),i={lfence:"",rfence:"",cells:r.map((e=>"\u2810"+new Array(e).join("\u2812"))),width:r,height:1,sep:t[0].sep};return t.splice(1,0,i),t=N(t,r),E(t,n)},MATRIX:function(e){let t=S(e);const[n,r]=b(t);return t=N(t,r),E(t,n)},CELL:p,FENCE:p,ROW:p,FRACTION:function(e){const[t,n,,r,i]=Array.from(e.childNodes),o=d(n),s=d(r),a=m(o),c=m(s);let l=Math.max(a,c);const u=t+new Array(l+1).join("\u2812")+i;return l=u.length,`${C(o,l)}\n${u}\n${C(s,l)}`},NUMERATOR:T,DENOMINATOR:T};function d(e){const t=i.tagName(e),n=u[t];return n?n(e):e.textContent}function h(e,t){if(!e||!t)return e+t;const n=f(e),r=f(t),i=n-r;e=i<0?g(e,r,m(e)):e,t=i>0?g(t,n,m(t)):t;const o=e.split(/\r\n|\r|\n/),s=t.split(/\r\n|\r|\n/),a=[];for(let e=0;e<o.length;e++)a.push(o[e]+s[e]);return a.join("\n")}function p(e){let t="";for(const n of Array.from(e.childNodes))t=n.nodeType!==i.NodeType.TEXT_NODE?h(t,d(n)):h(t,n.textContent);return t}function f(e){return e.split(/\r\n|\r|\n/).length}function m(e){return e.split(/\r\n|\r|\n/).reduce(((e,t)=>Math.max(t.length,e)),0)}function g(e,t,n){return e=function(e,t){const n=t-f(e);return e+(n>0?new Array(n+1).join("\n"):"")}(e,t),function(e,t){const n=e.split(/\r\n|\r|\n/),r=[];for(const e of n){const n=t-e.length;r.push(e+(n>0?new Array(n+1).join("\u2800"):""))}return r.join("\n")}(e,n)}function S(e){const t=Array.from(e.childNodes),n=[];for(const e of t)e.nodeType===i.NodeType.ELEMENT_NODE&&n.push(_(e));return n}function b(e){const t=e.reduce(((e,t)=>Math.max(t.height,e)),0),n=[];for(let t=0;t<e[0].width.length;t++)n.push(e.map((e=>e.width[t])).reduce(((e,t)=>Math.max(e,t)),0));return[t,n]}function N(e,t){const n=[];for(const r of e){if(0===r.height)continue;const e=[];for(let n=0;n<r.cells.length;n++)e.push(g(r.cells[n],r.height,t[n]));r.cells=e,n.push(r)}return n}function E(e,t){if(1===t)return e.map((e=>e.lfence+e.cells.join(e.sep)+e.rfence)).join("\n");const n=[];for(const t of e){const e=y(t.sep,t.height);let r=t.cells.shift();for(;t.cells.length;)r=h(r,e),r=h(r,t.cells.shift());r=h(y(t.lfence,t.height),r),r=h(r,y(t.rfence,t.height)),n.push(r),n.push(t.lfence+new Array(m(r)-3).join(t.sep)+t.rfence)}return n.slice(0,-1).join("\n")}function y(e,t){let n="";for(;t;)n+=e+"\n",t--;return n.slice(0,-1)}function A(e){return e.nodeType===i.NodeType.ELEMENT_NODE&&"FENCE"===i.tagName(e)?d(e):""}function _(e){const t=Array.from(e.childNodes),n=A(t[0]),r=A(t[t.length-1]);n&&t.shift(),r&&t.pop();let o="";const s=[];for(const e of t){if(e.nodeType===i.NodeType.TEXT_NODE){o=e.textContent;continue}const t=d(e);s.push(t)}return{lfence:n,rfence:r,sep:o,cells:s,height:s.reduce(((e,t)=>Math.max(f(t),e)),0),width:s.map(m)}}function C(e,t){const n=(t-m(e))/2,[r,i]=Math.floor(n)===n?[n,n]:[Math.floor(n),Math.ceil(n)],o=e.split(/\r\n|\r|\n/),s=[],[a,c]=[new Array(r+1).join("\u2800"),new Array(i+1).join("\u2800")];for(const e of o)s.push(a+e+c);return s.join("\n")}function T(e){const t=e.firstChild,n=p(e);if(t&&t.nodeType===i.NodeType.ELEMENT_NODE){if("ENGLISH"===i.tagName(t))return"\u2830"+n;if("NUMBER"===i.tagName(t))return"\u283c"+n}return n}},9610:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.MarkupRenderer=void 0;const r=n(4998),i=n(7086);class o extends i.AbstractAudioRenderer{constructor(){super(...arguments),this.ignoreElements=[r.personalityProps.LAYOUT],this.scaleFunction=null}setScaleFunction(e,t,n,r,i=0){this.scaleFunction=o=>{const s=(o-e)/(t-e),a=n*(1-s)+r*s;return+(Math.round(a+"e+"+i)+"e-"+i)}}applyScaleFunction(e){return this.scaleFunction?this.scaleFunction(e):e}ignoreElement(e){return-1!==this.ignoreElements.indexOf(e)}}t.MarkupRenderer=o},1674:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.PunctuationRenderer=void 0;const r=n(4998),i=n(7086),o=n(2599);class s extends i.AbstractAudioRenderer{markup(e){const t=o.personalityMarkup(e);let n="",i=null,s=!1;for(let e,a=0;e=t[a];a++)o.isMarkupElement(e)||(o.isPauseElement(e)?s&&(i=o.mergePause(i,e,Math.max)):(i&&(n+=this.pause(i[r.personalityProps.PAUSE]),i=null),n+=(s?this.getSeparator():"")+this.merge(e.span),s=!0));return n}pause(e){let t;return t="number"==typeof e?e<=250?"short":e<=500?"medium":"long":e,s.PAUSE_PUNCTUATION.get(t)||""}}t.PunctuationRenderer=s,s.PAUSE_PUNCTUATION=new Map([["short",","],["medium",";"],["long","."]])},8078:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.SableRenderer=void 0;const r=n(4998),i=n(4708);class o extends i.XmlRenderer{finalize(e){return'<?xml version="1.0"?><!DOCTYPE SABLE PUBLIC "-//SABLE//DTD SABLE speech mark up//EN" "Sable.v0_2.dtd" []><SABLE>'+this.getSeparator()+e+this.getSeparator()+"</SABLE>"}pause(e){return'<BREAK MSEC="'+this.pauseValue(e[r.personalityProps.PAUSE])+'"/>'}prosodyElement(e,t){switch(t=this.applyScaleFunction(t),e){case r.personalityProps.PITCH:return'<PITCH RANGE="'+t+'%">';case r.personalityProps.RATE:return'<RATE SPEED="'+t+'%">';case r.personalityProps.VOLUME:return'<VOLUME LEVEL="'+t+'%">';default:return"<"+e.toUpperCase()+' VALUE="'+t+'">'}}closeTag(e){return"</"+e.toUpperCase()+">"}}t.SableRenderer=o},1930:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Span=void 0;t.Span=class{constructor(e,t){this.speech=e,this.attributes=t}}},4115:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.SsmlRenderer=void 0;const r=n(4886),i=n(4998),o=n(4708);class s extends o.XmlRenderer{finalize(e){return'<?xml version="1.0"?><speak version="1.1" xmlns="http://www.w3.org/2001/10/synthesis"><prosody rate="'+r.default.getInstance().getRate()+'%">'+this.getSeparator()+e+this.getSeparator()+"</prosody></speak>"}pause(e){return'<break time="'+this.pauseValue(e[i.personalityProps.PAUSE])+'ms"/>'}prosodyElement(e,t){const n=(t=Math.floor(this.applyScaleFunction(t)))<0?t.toString():"+"+t.toString();return"<prosody "+e.toLowerCase()+'="'+n+(e===i.personalityProps.VOLUME?">":'%">')}closeTag(e){return"</prosody>"}}t.SsmlRenderer=s},6123:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.SsmlStepRenderer=void 0;const r=n(4115);class i extends r.SsmlRenderer{markup(e){return i.MARKS={},super.markup(e)}merge(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n],o=r.attributes.extid;o&&!i.MARKS[o]&&(t.push('<mark name="'+o+'"/>'),i.MARKS[o]=!0),1===r.speech.length&&r.speech.match(/[a-zA-Z]/)?t.push('<say-as interpret-as="'+i.CHARACTER_ATTR+'">'+r.speech+"</say-as>"):t.push(r.speech)}return t.join(this.getSeparator())}}t.SsmlStepRenderer=i,i.CHARACTER_ATTR="character",i.MARKS={}},8244:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.StringRenderer=void 0;const r=n(7086),i=n(2599);class o extends r.AbstractAudioRenderer{markup(e){let t="";const n=(0,i.personalityMarkup)(e).filter((e=>e.span));if(!n.length)return t;const r=n.length-1;for(let e,i=0;e=n[i];i++){if(e.span&&(t+=this.merge(e.span)),i>=r)continue;const n=e.join;t+=void 0===n?this.getSeparator():n}return t}}t.StringRenderer=o},4708:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.XmlRenderer=void 0;const r=n(4886),i=n(2599),o=n(9610);class s extends o.MarkupRenderer{markup(e){this.setScaleFunction(-2,2,-100,100,2);const t=i.personalityMarkup(e),n=[],o=[];for(let e,s=0;e=t[s];s++)if(e.span)n.push(this.merge(e.span));else if(i.isPauseElement(e))n.push(this.pause(e));else{if(e.close.length)for(let t=0;t<e.close.length;t++){const t=o.pop();if(-1===e.close.indexOf(t))throw new r.SREError("Unknown closing markup element: "+t);n.push(this.closeTag(t))}if(e.open.length){i.sortClose(e.open.slice(),t.slice(s+1)).forEach((t=>{n.push(this.prosodyElement(t,e[t])),o.push(t)}))}}return n.join(" ")}}t.XmlRenderer=s},1426:function(e,t){function n(e,t){return e?t?e.filter((e=>t.indexOf(e)<0)):e:[]}Object.defineProperty(t,"__esModule",{value:!0}),t.union=t.setdifference=t.interleaveLists=t.removeEmpty=void 0,t.removeEmpty=function(e){return e.filter((e=>e))},t.interleaveLists=function(e,t){const n=[];for(;e.length||t.length;)e.length&&n.push(e.shift()),t.length&&n.push(t.shift());return n},t.setdifference=n,t.union=function(e,t){return e&&t?e.concat(n(t,e)):e||t||[]}},9501:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.loadScript=t.loadMapsForIE_=t.installWGXpath_=t.loadWGXpath_=t.mapsForIE=t.detectEdge=t.detectIE=void 0;const r=n(4755),i=n(5024);function o(e){c(r.default.WGXpath),s(e)}function s(e,t){let n=t||1;"undefined"==typeof wgxpath&&n<10?setTimeout((function(){s(e,n++)}),200):n>=10||(r.default.wgxpath=wgxpath,e?r.default.wgxpath.install({document:document}):r.default.wgxpath.install(),i.xpath.evaluate=document.evaluate,i.xpath.result=XPathResult,i.xpath.createNSResolver=document.createNSResolver)}function a(){c(r.default.mathmapsIePath)}function c(e){const t=r.default.document.createElement("script");t.type="text/javascript",t.src=e,r.default.document.head?r.default.document.head.appendChild(t):r.default.document.body.appendChild(t)}t.detectIE=function(){return"undefined"!=typeof window&&"ActiveXObject"in window&&"clipboardData"in window&&(a(),o(),!0)},t.detectEdge=function(){var e;return"undefined"!=typeof window&&"MSGestureEvent"in window&&null===(null===(e=window.chrome)||void 0===e?void 0:e.loadTimes)&&(document.evaluate=null,o(!0),!0)},t.mapsForIE=null,t.loadWGXpath_=o,t.installWGXpath_=s,t.loadMapsForIE_=a,t.loadScript=c},1984:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.Debugger=void 0;const r=n(4755);class i{constructor(){this.isActive_=!1,this.outputFunction_=console.info,this.stream_=null}static getInstance(){return i.instance=i.instance||new i,i.instance}init(e){e&&this.startDebugFile_(e),this.isActive_=!0}output(...e){this.isActive_&&this.output_(e)}generateOutput(e){this.isActive_&&this.output_(e.apply(e,[]))}exit(e=(()=>{})){this.isActive_&&this.stream_&&this.stream_.end("","",e)}startDebugFile_(e){this.stream_=r.default.fs.createWriteStream(e),this.outputFunction_=function(...e){this.stream_.write(e.join(" ")),this.stream_.write("\n")}.bind(this),this.stream_.on("error",function(e){console.info("Invalid log file. Debug information sent to console."),this.outputFunction_=console.info}.bind(this)),this.stream_.on("finish",(function(){console.info("Finalizing debug file.")}))}output_(e){this.outputFunction_.apply(console.info===this.outputFunction_?console:this.outputFunction_,["Speech Rule Engine Debugger:"].concat(e))}}t.Debugger=i},6671:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeXml=t.cloneNode=t.tagName=t.querySelectorAll=t.querySelectorAllByAttrValue=t.querySelectorAllByAttr=t.formatXml=t.createTextNode=t.createElementNS=t.createElement=t.replaceNode=t.NodeType=t.parseInput=t.XML_ENTITIES=t.trimInput_=t.toArray=void 0;const r=n(4886),i=n(4998),o=n(4755),s=n(5024);function a(e){const t=[];for(let n=0,r=e.length;n<r;n++)t.push(e[n]);return t}function c(e){return(e=e.replace(/ /g,"\xa0")).replace(/>[ \f\n\r\t\v\u200b]+</g,"><").trim()}function l(e,t){if(!t)return[!1,""];const n=e.match(/^<([^> ]+).*>/),r=t.match(/^<\/([^>]+)>(.*)/);return n&&r&&n[1]===r[1]?[!0,r[2]]:[!1,""]}t.toArray=a,t.trimInput_=c,t.XML_ENTITIES={"<":!0,">":!0,"&":!0,""":!0,"'":!0},t.parseInput=function(e){const t=new o.default.xmldom.DOMParser,n=c(e),a=!!n.match(/&(?!lt|gt|amp|quot|apos)\w+;/g);if(!n)throw new Error("Empty input!");try{const e=t.parseFromString(n,a?"text/html":"text/xml");return r.default.getInstance().mode===i.Mode.HTTP?(s.xpath.currentDocument=e,a?e.body.childNodes[0]:e.documentElement):e.documentElement}catch(e){throw new r.SREError("Illegal input: "+e.message)}},function(e){e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",e[e.NOTATION_NODE=12]="NOTATION_NODE"}(t.NodeType||(t.NodeType={})),t.replaceNode=function(e,t){e.parentNode&&(e.parentNode.insertBefore(t,e),e.parentNode.removeChild(e))},t.createElement=function(e){return o.default.document.createElement(e)},t.createElementNS=function(e,t){return o.default.document.createElementNS(e,t)},t.createTextNode=function(e){return o.default.document.createTextNode(e)},t.formatXml=function(e){let t="",n=/(>)(<)(\/*)/g,r=0,i=(e=e.replace(n,"$1\r\n$2$3")).split("\r\n");for(n=/(\.)*(<)(\/*)/g,i=i.map((e=>e.replace(n,"$1\r\n$2$3").split("\r\n"))).reduce(((e,t)=>e.concat(t)),[]);i.length;){let e=i.shift();if(!e)continue;let n=0;if(e.match(/^<\w[^>/]*>[^>]+$/)){const t=l(e,i[0]);t[0]?t[1]?(e+=i.shift().slice(0,-t[1].length),t[1].trim()&&i.unshift(t[1])):e+=i.shift():n=1}else if(e.match(/^<\/\w/))0!==r&&(r-=1);else if(e.match(/^<\w[^>]*[^/]>.*$/))n=1;else if(e.match(/^<\w[^>]*\/>.+$/)){const t=e.indexOf(">")+1;e.slice(t).trim()&&i.unshift(),e=e.slice(0,t)}else n=0;t+=new Array(r+1).join(" ")+e+"\r\n",r+=n}return t},t.querySelectorAllByAttr=function(e,t){return e.querySelectorAll?a(e.querySelectorAll(`[${t}]`)):s.evalXPath(`.//*[@${t}]`,e)},t.querySelectorAllByAttrValue=function(e,t,n){return e.querySelectorAll?a(e.querySelectorAll(`[${t}="${n}"]`)):s.evalXPath(`.//*[@${t}="${n}"]`,e)},t.querySelectorAll=function(e,t){return e.querySelectorAll?a(e.querySelectorAll(t)):s.evalXPath(`.//${t}`,e)},t.tagName=function(e){return e.tagName.toUpperCase()},t.cloneNode=function(e){return e.cloneNode(!0)},t.serializeXml=function(e){return(new o.default.xmldom.XMLSerializer).serializeToString(e)}},4886:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.EnginePromise=t.SREError=void 0;const r=n(8310),i=n(4998),o=n(1984),s=n(4513);class a extends Error{constructor(e=""){super(),this.message=e,this.name="SRE Error"}}t.SREError=a;class c{constructor(){this.customLoader=null,this.parsers={},this.comparator=null,this.mode=i.Mode.SYNC,this.init=!0,this.delay=!1,this.comparators={},this.domain="mathspeak",this.style=r.DynamicCstr.DEFAULT_VALUES[r.Axis.STYLE],this._defaultLocale=r.DynamicCstr.DEFAULT_VALUES[r.Axis.LOCALE],this.locale=this.defaultLocale,this.subiso="",this.modality=r.DynamicCstr.DEFAULT_VALUES[r.Axis.MODALITY],this.speech=i.Speech.NONE,this.markup=i.Markup.NONE,this.walker="Table",this.structure=!1,this.ruleSets=[],this.strict=!1,this.isIE=!1,this.isEdge=!1,this.rate="100",this.pprint=!1,this.config=!1,this.rules="",this.prune="",this.evaluator=c.defaultEvaluator,this.defaultParser=new r.DynamicCstrParser(r.DynamicCstr.DEFAULT_ORDER),this.parser=this.defaultParser,this.dynamicCstr=r.DynamicCstr.defaultCstr()}set defaultLocale(e){this._defaultLocale=s.Variables.ensureLocale(e,this._defaultLocale)}get defaultLocale(){return this._defaultLocale}static getInstance(){return c.instance=c.instance||new c,c.instance}static defaultEvaluator(e,t){return e}static evaluateNode(e){return c.nodeEvaluator(e)}getRate(){const e=parseInt(this.rate,10);return isNaN(e)?100:e}setDynamicCstr(e){if(this.defaultLocale&&(r.DynamicCstr.DEFAULT_VALUES[r.Axis.LOCALE]=this.defaultLocale),e){const t=Object.keys(e);for(let n=0;n<t.length;n++){const i=t[n];if(-1!==r.DynamicCstr.DEFAULT_ORDER.indexOf(i)){const t=e[i];this[i]=t}}}i.DOMAIN_TO_STYLES[this.domain]=this.style;const t=[this.locale,this.modality,this.domain,this.style].join("."),n=r.DynamicProperties.createProp([r.DynamicCstr.DEFAULT_VALUES[r.Axis.LOCALE]],[r.DynamicCstr.DEFAULT_VALUES[r.Axis.MODALITY]],[r.DynamicCstr.DEFAULT_VALUES[r.Axis.DOMAIN]],[r.DynamicCstr.DEFAULT_VALUES[r.Axis.STYLE]]),o=this.comparators[this.domain],s=this.parsers[this.domain];this.parser=s||this.defaultParser,this.dynamicCstr=this.parser.parse(t),this.dynamicCstr.updateProperties(n.getProperties()),this.comparator=o?o():new r.DefaultComparator(this.dynamicCstr)}configurate(e){this.mode!==i.Mode.HTTP||this.config||(!function(e){const t=document.documentElement.querySelectorAll('script[type="text/x-sre-config"]');for(let n=0,r=t.length;n<r;n++){let r;try{r=t[n].innerHTML;const i=JSON.parse(r);for(const t in i)e[t]=i[t]}catch(e){o.Debugger.getInstance().output("Illegal configuration ",r)}}}(e),this.config=!0),function(e){if("undefined"!=typeof SREfeature)for(const[t,n]of Object.entries(SREfeature))e[t]=n}(e)}setCustomLoader(e){e&&(this.customLoader=e)}}t.default=c,c.BINARY_FEATURES=["strict","structure","pprint"],c.STRING_FEATURES=["markup","style","domain","speech","walker","defaultLocale","locale","delay","modality","rate","rules","subiso","prune"],c.nodeEvaluator=function(e){return[]};class l{static get(e=c.getInstance().locale){return l.promises[e]||Promise.resolve("")}static getall(){return Promise.all(Object.values(l.promises))}}t.EnginePromise=l,l.loaded={},l.promises={}},4998:function(e,t){var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DOMAIN_TO_STYLES=t.Markup=t.Speech=t.personalityPropList=t.personalityProps=t.Mode=void 0,function(e){e.SYNC="sync",e.ASYNC="async",e.HTTP="http"}(t.Mode||(t.Mode={})),function(e){e.PITCH="pitch",e.RATE="rate",e.VOLUME="volume",e.PAUSE="pause",e.JOIN="join",e.LAYOUT="layout"}(n=t.personalityProps||(t.personalityProps={})),t.personalityPropList=[n.PITCH,n.RATE,n.VOLUME,n.PAUSE,n.JOIN],function(e){e.NONE="none",e.SHALLOW="shallow",e.DEEP="deep"}(t.Speech||(t.Speech={})),function(e){e.NONE="none",e.LAYOUT="layout",e.PUNCTUATION="punctuation",e.SSML="ssml",e.SSML_STEP="ssml_step",e.ACSS="acss",e.SABLE="sable",e.VOICEXML="voicexml"}(t.Markup||(t.Markup={})),t.DOMAIN_TO_STYLES={mathspeak:"default",clearspeak:"default"}},985:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.setup=void 0;const i=n(2371),o=n(5659),s=n(9501),a=n(4886),c=n(7129),l=n(4755);t.setup=function(e){return r(this,void 0,void 0,(function*(){const t=a.default.getInstance();"default"!==e.domain||"speech"!==e.modality&&e.modality&&"speech"!==t.modality||(e.domain="mathspeak");const n=n=>{void 0!==e[n]&&(t[n]=e[n])};return n("mode"),t.configurate(e),a.default.BINARY_FEATURES.forEach((n=>{void 0!==e[n]&&(t[n]=!!e[n])})),a.default.STRING_FEATURES.forEach(n),e.json&&(l.default.jsonPath=c.makePath(e.json)),e.xpath&&(l.default.WGXpath=e.xpath),t.setCustomLoader(e.custom),function(e){e.isIE=s.detectIE(),e.isEdge=s.detectEdge()}(t),i.setLocale(),t.setDynamicCstr(),t.init?(a.EnginePromise.promises.init=new Promise(((e,t)=>{setTimeout((()=>{e("init")}),10)})),t.init=!1,a.EnginePromise.get()):t.delay?(t.delay=!1,a.EnginePromise.get()):o.loadLocale()}))}},6988:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Event=t.EventType=t.Move=t.KeyCode=void 0,function(e){e[e.ENTER=13]="ENTER",e[e.ESC=27]="ESC",e[e.SPACE=32]="SPACE",e[e.PAGE_UP=33]="PAGE_UP",e[e.PAGE_DOWN=34]="PAGE_DOWN",e[e.END=35]="END",e[e.HOME=36]="HOME",e[e.LEFT=37]="LEFT",e[e.UP=38]="UP",e[e.RIGHT=39]="RIGHT",e[e.DOWN=40]="DOWN",e[e.TAB=9]="TAB",e[e.LESS=188]="LESS",e[e.GREATER=190]="GREATER",e[e.DASH=189]="DASH",e[e.ZERO=48]="ZERO",e[e.ONE=49]="ONE",e[e.TWO=50]="TWO",e[e.THREE=51]="THREE",e[e.FOUR=52]="FOUR",e[e.FIVE=53]="FIVE",e[e.SIX=54]="SIX",e[e.SEVEN=55]="SEVEN",e[e.EIGHT=56]="EIGHT",e[e.NINE=57]="NINE",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z"}(t.KeyCode||(t.KeyCode={})),t.Move=new Map([[13,"ENTER"],[27,"ESC"],[32,"SPACE"],[33,"PAGE_UP"],[34,"PAGE_DOWN"],[35,"END"],[36,"HOME"],[37,"LEFT"],[38,"UP"],[39,"RIGHT"],[40,"DOWN"],[9,"TAB"],[188,"LESS"],[190,"GREATER"],[189,"DASH"],[48,"ZERO"],[49,"ONE"],[50,"TWO"],[51,"THREE"],[52,"FOUR"],[53,"FIVE"],[54,"SIX"],[55,"SEVEN"],[56,"EIGHT"],[57,"NINE"],[65,"A"],[66,"B"],[67,"C"],[68,"D"],[69,"E"],[70,"F"],[71,"G"],[72,"H"],[73,"I"],[74,"J"],[75,"K"],[76,"L"],[77,"M"],[78,"N"],[79,"O"],[80,"P"],[81,"Q"],[82,"R"],[83,"S"],[84,"T"],[85,"U"],[86,"V"],[87,"W"],[88,"X"],[89,"Y"],[90,"Z"]]),function(e){e.CLICK="click",e.DBLCLICK="dblclick",e.MOUSEDOWN="mousedown",e.MOUSEUP="mouseup",e.MOUSEOVER="mouseover",e.MOUSEOUT="mouseout",e.MOUSEMOVE="mousemove",e.SELECTSTART="selectstart",e.KEYPRESS="keypress",e.KEYDOWN="keydown",e.KEYUP="keyup",e.TOUCHSTART="touchstart",e.TOUCHMOVE="touchmove",e.TOUCHEND="touchend",e.TOUCHCANCEL="touchcancel"}(t.EventType||(t.EventType={}));t.Event=class{constructor(e,t,n){this.src=e,this.type=t,this.callback=n}add(){this.src.addEventListener(this.type,this.callback)}remove(){this.src.removeEventListener(this.type,this.callback)}}},7129:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.localePath=t.makePath=void 0;const r=n(4755);function i(e){return e.match("/$")?e:e+"/"}t.makePath=i,t.localePath=function(e,t="json"){return i(r.default.jsonPath)+e+(t.match(/^\./)?t:"."+t)}},3539:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.KeyProcessor=t.Processor=void 0;const r=n(6988);class i{constructor(e,t){this.name=e,this.process=t.processor,this.postprocess=t.postprocessor||((e,t)=>e),this.processor=this.postprocess?function(e){return this.postprocess(this.process(e),e)}:this.process,this.print=t.print||i.stringify_,this.pprint=t.pprint||this.print}static stringify_(e){return e?e.toString():e}}t.Processor=i,i.LocalState={walker:null,speechGenerator:null,highlighter:null};class o extends i{constructor(e,t){super(e,t),this.key=t.key||o.getKey_}static getKey_(e){return"string"==typeof e?r.KeyCode[e.toUpperCase()]:e}}t.KeyProcessor=o},9615:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.keypress=t.output=t.print=t.process=t.set=void 0;const r=n(4253),i=n(7450),o=n(9009),s=n(4524),a=n(1939),c=n(7317),l=n(144),u=n(907),d=n(8835),h=n(6671),p=n(4886),f=n(4998),m=n(3539),g=n(5024),S=new Map;function b(e){S.set(e.name,e)}function N(e){const t=S.get(e);if(!t)throw new p.SREError("Unknown processor "+e);return t}function E(e,t){const n=N(e);try{return n.processor(t)}catch(e){throw new p.SREError("Processing error for expression "+t)}}function y(e,t){const n=N(e);return p.default.getInstance().pprint?n.pprint(t):n.print(t)}t.set=b,t.process=E,t.print=y,t.output=function(e,t){const n=N(e);try{const e=n.processor(t);return p.default.getInstance().pprint?n.pprint(e):n.print(e)}catch(e){throw new p.SREError("Processing error for expression "+t)}},t.keypress=function(e,t){const n=N(e),r=n instanceof m.KeyProcessor?n.key(t):t,i=n.processor(r);return p.default.getInstance().pprint?n.pprint(i):n.print(i)},b(new m.Processor("semantic",{processor:function(e){const t=h.parseInput(e);return a.xmlTree(t)},postprocessor:function(e,t){const n=p.default.getInstance().speech;if(n===f.Speech.NONE)return e;const i=h.cloneNode(e);let o=l.computeMarkup(i);if(n===f.Speech.SHALLOW)return e.setAttribute("speech",r.finalize(o)),e;const s=g.evalXPath(".//*[@id]",e),a=g.evalXPath(".//*[@id]",i);for(let e,t,n=0;e=s[n],t=a[n];n++)o=l.computeMarkup(t),e.setAttribute("speech",r.finalize(o));return e},pprint:function(e){return h.formatXml(e.toString())}})),b(new m.Processor("speech",{processor:function(e){const t=h.parseInput(e),n=a.xmlTree(t),i=l.computeSpeech(n);return r.finalize(r.markup(i))},pprint:function(e){const t=e.toString();return r.isXml()?h.formatXml(t):t}})),b(new m.Processor("json",{processor:function(e){const t=h.parseInput(e);return a.getTree(t).toJson()},postprocessor:function(e,t){const n=p.default.getInstance().speech;if(n===f.Speech.NONE)return e;const i=h.parseInput(t),o=a.xmlTree(i),s=l.computeMarkup(o);if(n===f.Speech.SHALLOW)return e.stree.speech=r.finalize(s),e;const c=e=>{const t=g.evalXPath(`.//*[@id=${e.id}]`,o)[0],n=l.computeMarkup(t);e.speech=r.finalize(n),e.children&&e.children.forEach(c)};return c(e.stree),e},print:function(e){return JSON.stringify(e)},pprint:function(e){return JSON.stringify(e,null,2)}})),b(new m.Processor("description",{processor:function(e){const t=h.parseInput(e),n=a.xmlTree(t);return l.computeSpeech(n)},print:function(e){return JSON.stringify(e)},pprint:function(e){return JSON.stringify(e,null,2)}})),b(new m.Processor("enriched",{processor:function(e){return i.semanticMathmlSync(e)},postprocessor:function(e,t){const n=d.getSemanticRoot(e);let r;switch(p.default.getInstance().speech){case f.Speech.NONE:break;case f.Speech.SHALLOW:r=c.generator("Adhoc"),r.getSpeech(n,e);break;case f.Speech.DEEP:r=c.generator("Tree"),r.getSpeech(e,e)}return e},pprint:function(e){return h.formatXml(e.toString())}})),b(new m.Processor("walker",{processor:function(e){const t=c.generator("Node");m.Processor.LocalState.speechGenerator=t,t.setOptions({modality:p.default.getInstance().modality,locale:p.default.getInstance().locale,domain:p.default.getInstance().domain,style:p.default.getInstance().style}),m.Processor.LocalState.highlighter=o.highlighter({color:"black"},{color:"white"},{renderer:"NativeMML"});const n=E("enriched",e),r=y("enriched",n);return m.Processor.LocalState.walker=u.walker(p.default.getInstance().walker,n,t,m.Processor.LocalState.highlighter,r),m.Processor.LocalState.walker},print:function(e){return m.Processor.LocalState.walker.speech()}})),b(new m.KeyProcessor("move",{processor:function(e){if(!m.Processor.LocalState.walker)return null;return!1===m.Processor.LocalState.walker.move(e)?r.error(e):m.Processor.LocalState.walker.speech()}})),b(new m.Processor("number",{processor:function(e){const t=parseInt(e,10);return isNaN(t)?"":s.LOCALE.NUMBERS.numberToWords(t)}})),b(new m.Processor("ordinal",{processor:function(e){const t=parseInt(e,10);return isNaN(t)?"":s.LOCALE.NUMBERS.wordOrdinal(t)}})),b(new m.Processor("numericOrdinal",{processor:function(e){const t=parseInt(e,10);return isNaN(t)?"":s.LOCALE.NUMBERS.numericOrdinal(t)}})),b(new m.Processor("vulgar",{processor:function(e){const[t,n]=e.split("/").map((e=>parseInt(e,10)));return isNaN(t)||isNaN(n)?"":E("speech",`<mfrac><mn>${t}</mn><mn>${n}</mn></mfrac>`)}}))},9037:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.localePath=t.exit=t.move=t.walk=t.processFile=t.file=t.vulgar=t.numericOrdinal=t.ordinal=t.number=t.toEnriched=t.toDescription=t.toJson=t.toSemantic=t.toSpeech=t.localeLoader=t.engineReady=t.engineSetup=t.setupEngine=t.version=void 0;const i=n(4886),o=n(985),s=n(4998),a=n(7129),c=n(9615),l=n(4755),u=n(4513),d=n(5659);function h(e){return r(this,void 0,void 0,(function*(){return(0,o.setup)(e)}))}function p(e,t){return c.process(e,t)}function f(e,t,n){switch(i.default.getInstance().mode){case s.Mode.ASYNC:return function(e,t,n){return r(this,void 0,void 0,(function*(){const r=yield l.default.fs.promises.readFile(t,{encoding:"utf8"}),o=c.output(e,r);if(n)try{l.default.fs.promises.writeFile(n,o)}catch(e){throw new i.SREError("Can not write to file: "+n)}return o}))}(e,t,n);case s.Mode.SYNC:return function(e,t,n){const r=function(e){let t;try{t=l.default.fs.readFileSync(e,{encoding:"utf8"})}catch(t){throw new i.SREError("Can not open file: "+e)}return t}(t),o=c.output(e,r);if(n)try{l.default.fs.writeFileSync(n,o)}catch(e){throw new i.SREError("Can not write to file: "+n)}return o}(e,t,n);default:throw new i.SREError(`Can process files in ${i.default.getInstance().mode} mode`)}}t.version=u.Variables.VERSION,t.setupEngine=h,t.engineSetup=function(){const e=["mode"].concat(i.default.STRING_FEATURES,i.default.BINARY_FEATURES),t=i.default.getInstance(),n={};return e.forEach((function(e){n[e]=t[e]})),n.json=l.default.jsonPath,n.xpath=l.default.WGXpath,n.rules=t.ruleSets.slice(),n},t.engineReady=function(){return r(this,void 0,void 0,(function*(){return h({}).then((()=>i.EnginePromise.getall()))}))},t.localeLoader=d.standardLoader,t.toSpeech=function(e){return p("speech",e)},t.toSemantic=function(e){return p("semantic",e)},t.toJson=function(e){return p("json",e)},t.toDescription=function(e){return p("description",e)},t.toEnriched=function(e){return p("enriched",e)},t.number=function(e){return p("number",e)},t.ordinal=function(e){return p("ordinal",e)},t.numericOrdinal=function(e){return p("numericOrdinal",e)},t.vulgar=function(e){return p("vulgar",e)},t.file={},t.file.toSpeech=function(e,t){return f("speech",e,t)},t.file.toSemantic=function(e,t){return f("semantic",e,t)},t.file.toJson=function(e,t){return f("json",e,t)},t.file.toDescription=function(e,t){return f("description",e,t)},t.file.toEnriched=function(e,t){return f("enriched",e,t)},t.processFile=f,t.walk=function(e){return c.output("walker",e)},t.move=function(e){return c.keypress("move",e)},t.exit=function(e){const t=e||0;i.EnginePromise.getall().then((()=>process.exit(t)))},t.localePath=a.localePath,l.default.documentSupported?h({mode:s.Mode.HTTP}).then((()=>h({}))):h({mode:s.Mode.SYNC}).then((()=>h({mode:s.Mode.ASYNC})))},4755:function(__unused_webpack_module,exports,__webpack_require__){var __dirname="/";Object.defineProperty(exports,"__esModule",{value:!0});const variables_1=__webpack_require__(4513);class SystemExternal{static extRequire(library){if("undefined"!=typeof process){const nodeRequire=eval("require");return nodeRequire(library)}return null}}exports.default=SystemExternal,SystemExternal.windowSupported=!("undefined"==typeof window),SystemExternal.documentSupported=SystemExternal.windowSupported&&!(void 0===window.document),SystemExternal.xmldom=SystemExternal.documentSupported?window:SystemExternal.extRequire("xmldom-sre"),SystemExternal.document=SystemExternal.documentSupported?window.document:(new SystemExternal.xmldom.DOMImplementation).createDocument("","",0),SystemExternal.xpath=SystemExternal.documentSupported?document:function(){const e={document:{},XPathResult:{}};return SystemExternal.extRequire("wicked-good-xpath").install(e),e.document.XPathResult=e.XPathResult,e.document}(),SystemExternal.mathmapsIePath="https://cdn.jsdelivr.net/npm/sre-mathmaps-ie@"+variables_1.Variables.VERSION+"mathmaps_ie.js",SystemExternal.commander=SystemExternal.documentSupported?null:SystemExternal.extRequire("commander"),SystemExternal.fs=SystemExternal.documentSupported?null:SystemExternal.extRequire("fs"),SystemExternal.url=variables_1.Variables.url,SystemExternal.jsonPath=(SystemExternal.documentSupported?SystemExternal.url:process.env.SRE_JSON_PATH||__webpack_require__.g.SRE_JSON_PATH||__dirname+"/mathmaps")+"/",SystemExternal.WGXpath=variables_1.Variables.WGXpath,SystemExternal.wgxpath=null},4513:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Variables=void 0;class n{static ensureLocale(e,t){return n.LOCALES.get(e)?e:(console.error(`Locale ${e} does not exist! Using ${n.LOCALES.get(t)} instead.`),t)}}t.Variables=n,n.VERSION="4.0.6",n.LOCALES=new Map([["ca","Catalan"],["da","Danish"],["de","German"],["en","English"],["es","Spanish"],["fr","French"],["hi","Hindi"],["it","Italian"],["nb","Bokm\xe5l"],["nn","Nynorsk"],["sv","Swedish"],["nemeth","Nemeth"]]),n.mathjaxVersion="3.2.1",n.url="https://cdn.jsdelivr.net/npm/speech-rule-engine@"+n.VERSION+"/lib/mathmaps",n.WGXpath="https://cdn.jsdelivr.net/npm/wicked-good-xpath@1.3.0/dist/wgxpath.install.js"},5024:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.updateEvaluator=t.evaluateString=t.evaluateBoolean=t.getLeafNodes=t.evalXPath=t.resolveNameSpace=t.xpath=void 0;const r=n(4886),i=n(4998),o=n(4755);function s(){return"undefined"!=typeof XPathResult}t.xpath={currentDocument:null,evaluate:s()?document.evaluate:o.default.xpath.evaluate,result:s()?XPathResult:o.default.xpath.XPathResult,createNSResolver:s()?document.createNSResolver:o.default.xpath.createNSResolver};const a={xhtml:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",mml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function c(e){return a[e]||null}t.resolveNameSpace=c;class l{constructor(){this.lookupNamespaceURI=c}}function u(e,n,o){return r.default.getInstance().mode!==i.Mode.HTTP||r.default.getInstance().isIE||r.default.getInstance().isEdge?t.xpath.evaluate(e,n,new l,o,null):t.xpath.currentDocument.evaluate(e,n,c,o,null)}function d(e,n){let r;try{r=u(e,n,t.xpath.result.ORDERED_NODE_ITERATOR_TYPE)}catch(e){return[]}const i=[];for(let e=r.iterateNext();e;e=r.iterateNext())i.push(e);return i}t.evalXPath=d,t.getLeafNodes=function(e){return d(".//*[count(*)=0]",e)},t.evaluateBoolean=function(e,n){let r;try{r=u(e,n,t.xpath.result.BOOLEAN_TYPE)}catch(e){return!1}return r.booleanValue},t.evaluateString=function(e,n){let r;try{r=u(e,n,t.xpath.result.STRING_TYPE)}catch(e){return""}return r.stringValue},t.updateEvaluator=function(e){if(r.default.getInstance().mode!==i.Mode.HTTP)return;let n=e;for(;n&&!n.evaluate;)n=n.parentNode;n&&n.evaluate?t.xpath.currentDocument=n:e.ownerDocument&&(t.xpath.currentDocument=e.ownerDocument)}},9341:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractEnrichCase=void 0;t.AbstractEnrichCase=class{constructor(e){this.semantic=e}}},4306:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.CaseBinomial=void 0;const r=n(6671),i=n(9341),o=n(8672),s=n(8171);class a extends i.AbstractEnrichCase{constructor(e){super(e),this.mml=e.mathmlTree}static test(e){return!e.mathmlTree&&"line"===e.type&&"binomial"===e.role}getMathml(){if(!this.semantic.childNodes.length)return this.mml;const e=this.semantic.childNodes[0];if(this.mml=(0,o.walkTree)(e),this.mml.hasAttribute(s.Attribute.TYPE)){const e=r.createElement("mrow");e.setAttribute(s.Attribute.ADDED,"true"),r.replaceNode(this.mml,e),e.appendChild(this.mml),this.mml=e}return(0,s.setAttributes)(this.mml,this.semantic),this.mml}}t.CaseBinomial=a},8871:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.CaseDoubleScript=void 0;const r=n(6671),i=n(9341),o=n(8672),s=n(8171);class a extends i.AbstractEnrichCase{constructor(e){super(e),this.mml=e.mathmlTree}static test(e){if(!e.mathmlTree||!e.childNodes.length)return!1;const t=r.tagName(e.mathmlTree),n=e.childNodes[0].role;return"MSUBSUP"===t&&"subsup"===n||"MUNDEROVER"===t&&"underover"===n}getMathml(){const e=this.semantic.childNodes[0],t=e.childNodes[0],n=this.semantic.childNodes[1],r=e.childNodes[1],i=o.walkTree(n),a=o.walkTree(t),c=o.walkTree(r);return(0,s.setAttributes)(this.mml,this.semantic),this.mml.setAttribute(s.Attribute.CHILDREN,(0,s.makeIdList)([t,r,n])),[a,c,i].forEach((e=>o.getInnerNode(e).setAttribute(s.Attribute.PARENT,this.mml.getAttribute(s.Attribute.ID)))),this.mml.setAttribute(s.Attribute.TYPE,e.role),o.addCollapsedAttribute(this.mml,[this.semantic.id,[e.id,t.id,r.id],n.id]),this.mml}}t.CaseDoubleScript=a},928:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.CaseEmbellished=void 0;const r=n(6671),i=n(9444),o=n(9341),s=n(8871),a=n(4308),c=n(439),l=n(8672),u=n(8171);class d extends o.AbstractEnrichCase{constructor(e){super(e),this.fenced=null,this.fencedMml=null,this.fencedMmlNodes=[],this.ofence=null,this.ofenceMml=null,this.ofenceMap={},this.cfence=null,this.cfenceMml=null,this.cfenceMap={},this.parentCleanup=[]}static test(e){return!(!e.mathmlTree||!e.fencePointer||e.mathmlTree.getAttribute("data-semantic-type"))}static makeEmptyNode_(e){const t=r.createElement("mrow"),n=new i.SemanticNode(e);return n.type="empty",n.mathmlTree=t,n}static fencedMap_(e,t){t[e.id]=e.mathmlTree,e.embellished&&d.fencedMap_(e.childNodes[0],t)}getMathml(){this.getFenced_(),this.fencedMml=l.walkTree(this.fenced),this.getFencesMml_(),"empty"!==this.fenced.type||this.fencedMml.parentNode||(this.fencedMml.setAttribute(u.Attribute.ADDED,"true"),this.cfenceMml.parentNode.insertBefore(this.fencedMml,this.cfenceMml)),this.getFencedMml_();return this.rewrite_()}fencedElement(e){return"fenced"===e.type||"matrix"===e.type||"vector"===e.type}getFenced_(){let e=this.semantic;for(;!this.fencedElement(e);)e=e.childNodes[0];this.fenced=e.childNodes[0],this.ofence=e.contentNodes[0],this.cfence=e.contentNodes[1],d.fencedMap_(this.ofence,this.ofenceMap),d.fencedMap_(this.cfence,this.cfenceMap)}getFencedMml_(){let e=this.ofenceMml.nextSibling;for(e=e===this.fencedMml?e:this.fencedMml;e&&e!==this.cfenceMml;)this.fencedMmlNodes.push(e),e=e.nextSibling}getFencesMml_(){let e=this.sem