2023-01-10 11:40:39 +01:00

1 line
8.2 KiB
JavaScript

!function(r){var n={};function a(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return r[t].call(e.exports,e,e.exports,a),e.l=!0,e.exports}a.m=r,a.c=n,a.d=function(t,e,r){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(a.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(r,n,function(t){return e[t]}.bind(null,n));return r},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=3)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(9),a="undefined"==typeof window?"./a11y/sre-node.js":"../../../speech-rule-engine/lib/sre_browser.js",i="undefined"==typeof sre?n.asyncLoad(a):Promise.resolve();e.sreReady=new Promise(function(r,n){i.then(function(){var e=(new Date).getTime();!function t(){sre.Engine.isReady()?r():(new Date).getTime()-e<1e4?setTimeout(t,100):n("Timed out waiting for Speech-Rule-Engine")}()}).catch(function(t){return n(t.message||t)})})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.combineConfig=MathJax._.components.global.combineConfig,e.combineDefaults=MathJax._.components.global.combineDefaults,e.combineWithMathJax=MathJax._.components.global.combineWithMathJax,e.MathJax=MathJax._.components.global.MathJax},function(t,e,r){"use strict";var n,s=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),a=this&&this.__assign||function(){return(a=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var a in e=arguments[r])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t}).apply(this,arguments)},u=this&&this.__values||function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}},i=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,a,i=r.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(n=i.next()).done;)o.push(n.value)}catch(t){a={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o},c=this&&this.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(i(arguments[e]));return t};Object.defineProperty(e,"__esModule",{value:!0});var o=r(5),l=r(6),h=r(7),p=r(8),f=r(0),d="none";function y(t,r,n){return s(e,a=t),e.prototype.serializeMml=function(t){if("outerHTML"in t)return t.outerHTML;if("undefined"!=typeof Element&&"undefined"!=typeof window&&t instanceof Element){var e=window.document.createElement("div");return e.appendChild(t),e.innerHTML}return t.toString()},e.prototype.enrich=function(t){if(!(this.state()>=l.STATE.ENRICHED)){"undefined"!=typeof sre&&sre.Engine.isReady()||o.mathjax.retryAfter(f.sreReady),t.options.enrichSpeech!==d&&(SRE.setupEngine({speech:t.options.enrichSpeech}),d=t.options.enrichSpeech);var e=new t.options.MathItem("",r);e.math=this.serializeMml(SRE.toEnriched(n(this.root))),e.display=this.display,e.compile(t),this.root=e.root,this.inputData.originalMml=e.math,this.state(l.STATE.ENRICHED)}},e.prototype.attachSpeech=function(t){var e,r;if(!(this.state()>=l.STATE.ATTACHSPEECH)){var n=this.root.attributes.get("aria-label")||this.getSpeech(this.root);if(n){var a=t.adaptor,i=this.typesetRoot;a.setAttribute(i,"aria-label",n);try{for(var o=u(a.childNodes(i)),s=o.next();!s.done;s=o.next()){var c=s.value;a.setAttribute(c,"aria-hidden","true")}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(e)throw e.error}}}this.state(l.STATE.ATTACHSPEECH)}},e.prototype.getSpeech=function(t){var e,r,n=t.attributes;if(n){var a=n.getExplicit("data-semantic-speech");if(!n.getExplicit("data-semantic-parent")&&a)return a;try{for(var i=u(t.childNodes),o=i.next();!o.done;o=i.next()){var s=o.value,c=this.getSpeech(s);if(null!=c)return c}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}}},e;function e(){return null!==a&&a.apply(this,arguments)||this}var a}function M(t,i){var e,o;return s(r,o=t),r.prototype.attachSpeech=function(){var e,t;if(!this.processed.isSet("attach-speech")){try{for(var r=u(this.math),n=r.next();!n.done;n=r.next())n.value.attachSpeech(this)}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.processed.set("attach-speech")}return this},r.prototype.enrich=function(){var e,t;if(!this.processed.isSet("enriched")){try{for(var r=u(this.math),n=r.next();!n.done;n=r.next())n.value.enrich(this)}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.processed.set("enriched")}return this},r.prototype.state=function(t,e){return void 0===e&&(e=!1),o.prototype.state.call(this,t,e),t<l.STATE.ENRICHED&&this.processed.clear("enriched"),this},(e=r).OPTIONS=a({},t.OPTIONS,{enrichSpeech:"none",renderActions:p.expandable(a({},t.OPTIONS.renderActions,{enrich:[l.STATE.ENRICHED],attachSpeech:[l.STATE.ATTACHSPEECH]}))}),e;function r(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=o.apply(this,c(t))||this;i.setMmlFactory(r.mmlFactory);var n=r.constructor.ProcessBits;n.has("enriched")||(n.allocate("enriched"),n.allocate("attach-speech"));var a=new h.SerializedMmlVisitor(r.mmlFactory);return r.options.MathItem=y(r.options.MathItem,i,function(t){return a.visitTree(t)}),r}}l.newState("ENRICHED",30),l.newState("ATTACHSPEECH",155),e.EnrichedMathItemMixin=y,e.EnrichedMathDocumentMixin=M,e.EnrichHandler=function(t,e){return e.setAdaptor(t.adaptor),t.documentClass=M(t.documentClass,e),t}},function(t,e,r){"use strict";r(4);var n=r(1),a=r(0),i=r(2),o=r(10);MathJax.loader&&(0,n.combineDefaults)(MathJax.config.loader,"a11y/semantic-enrich",{checkReady:function(){return a.sreReady}}),MathJax.startup&&MathJax.startup.extendHandler(function(t){return(0,i.EnrichHandler)(t,new o.MathML)})},function(t,e,r){"use strict";var n=r(1),a=o(r(2)),i=o(r(0));function o(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}(0,n.combineWithMathJax)({_:{a11y:{"semantic-enrich":a,sre:i}}})},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.mathjax=MathJax._.mathjax.mathjax},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.protoItem=MathJax._.core.MathItem.protoItem,e.AbstractMathItem=MathJax._.core.MathItem.AbstractMathItem,e.STATE=MathJax._.core.MathItem.STATE,e.newState=MathJax._.core.MathItem.newState},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DATAMJX=MathJax._.core.MmlTree.SerializedMmlVisitor.DATAMJX,e.SerializedMmlVisitor=MathJax._.core.MmlTree.SerializedMmlVisitor.SerializedMmlVisitor},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.APPEND=MathJax._.util.Options.APPEND,e.REMOVE=MathJax._.util.Options.REMOVE,e.Expandable=MathJax._.util.Options.Expandable,e.expandable=MathJax._.util.Options.expandable,e.makeArray=MathJax._.util.Options.makeArray,e.keys=MathJax._.util.Options.keys,e.copy=MathJax._.util.Options.copy,e.insert=MathJax._.util.Options.insert,e.defaultOptions=MathJax._.util.Options.defaultOptions,e.userOptions=MathJax._.util.Options.userOptions,e.selectOptions=MathJax._.util.Options.selectOptions,e.selectOptionsFromKeys=MathJax._.util.Options.selectOptionsFromKeys,e.separateOptions=MathJax._.util.Options.separateOptions},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.asyncLoad=MathJax._.util.AsyncLoad.asyncLoad},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MathML=MathJax._.input.mathml_ts.MathML}]);