diff --git a/.gitattributes b/.gitattributes index fe07df655..e5c4c1ca0 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,5 @@ d2layouts/d2dagrelayout/dagre.js linguist-vendored d2layouts/d2elklayout/elk.js linguist-vendored d2renderers/d2svg/github-markdown.css linguist-vendored +d2renderers/d2latex/mathjax.js linguist-vendored +d2renderers/d2latex/polyfills.js linguist-vendored diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index 10ba72b57..e669b635f 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -1,5 +1,7 @@ #### Features 🚀 +- Latex is now supported. See [docs](https://d2lang.com/tour/text) for more. + [#229](https://github.com/terrastruct/d2/pull/229) - Arrowhead labels are now supported. [#182](https://github.com/terrastruct/d2/pull/182) - `stroke-dash` on shapes is now supported. [#188](https://github.com/terrastruct/d2/issues/188) - `font-color` is now supported on shapes and connections. [#215](https://github.com/terrastruct/d2/pull/215) diff --git a/d2compiler/compile.go b/d2compiler/compile.go index 0db0d62d4..4e1face77 100644 --- a/d2compiler/compile.go +++ b/d2compiler/compile.go @@ -377,7 +377,7 @@ func (c *compiler) applyScalar(attrs *d2graph.Attributes, reserved string, box d if ok { attrs.Language = fullTag } - if attrs.Language == "markdown" { + if attrs.Language == "markdown" || attrs.Language == "latex" { attrs.Shape.Value = d2target.ShapeText } else { attrs.Shape.Value = d2target.ShapeCode @@ -548,12 +548,13 @@ func (c *compiler) compileFlatKey(k *d2ast.KeyPath) ([]string, string, bool) { // TODO add more, e.g. C, bash var ShortToFullLanguageAliases = map[string]string{ - "md": "markdown", - "js": "javascript", - "go": "golang", - "py": "python", - "rb": "ruby", - "ts": "typescript", + "md": "markdown", + "tex": "latex", + "js": "javascript", + "go": "golang", + "py": "python", + "rb": "ruby", + "ts": "typescript", } var FullToShortLanguageAliases map[string]string diff --git a/d2graph/d2graph.go b/d2graph/d2graph.go index 5687608f1..1fe88fba4 100644 --- a/d2graph/d2graph.go +++ b/d2graph/d2graph.go @@ -11,6 +11,7 @@ import ( "oss.terrastruct.com/d2/d2format" "oss.terrastruct.com/d2/d2parser" "oss.terrastruct.com/d2/d2renderers/d2fonts" + "oss.terrastruct.com/d2/d2renderers/d2latex" "oss.terrastruct.com/d2/d2renderers/textmeasure" "oss.terrastruct.com/d2/d2target" "oss.terrastruct.com/d2/d2themes" @@ -833,10 +834,18 @@ func (g *Graph) SetDimensions(mtexts []*d2target.MText, ruler *textmeasure.Ruler var dims *d2target.TextDimensions var innerLabelPadding = 5 if obj.Attributes.Shape.Value == d2target.ShapeText { - var err error - dims, err = getMarkdownDimensions(mtexts, ruler, obj.Text()) - if err != nil { - return err + if obj.Attributes.Language == "latex" { + width, height, err := d2latex.Measure(obj.Text().Text) + if err != nil { + return err + } + dims = d2target.NewTextDimensions(width, height) + } else { + var err error + dims, err = getMarkdownDimensions(mtexts, ruler, obj.Text()) + if err != nil { + return err + } } innerLabelPadding = 0 } else { diff --git a/d2renderers/d2latex/latex.go b/d2renderers/d2latex/latex.go new file mode 100644 index 000000000..d9a68b51b --- /dev/null +++ b/d2renderers/d2latex/latex.go @@ -0,0 +1,83 @@ +//go:build cgo + +package d2latex + +import ( + _ "embed" + "fmt" + "math" + "regexp" + "strconv" + + "oss.terrastruct.com/xdefer" + v8 "rogchap.com/v8go" +) + +var pxPerEx = 8 + +//go:embed polyfills.js +var polyfillsJS string + +//go:embed setup.js +var setupJS string + +//go:embed mathjax.js +var mathjaxJS string + +// Matches this +// MathJax v'+a.mathjax.version,(function(){var t=[];return t.push("Input Jax: "+r.document.inputJax.map((function(t){return t.name})).join(", ")),t.push("Output Jax: "+r.document.outputJax.name),t.push("Document Type: "+r.document.kind),t.join("
")}),'www.mathjax.org'),this.help=new f.Info("MathJax Help",(function(){return["

MathJax is a JavaScript library that allows page"," authors to include mathematics within their web pages."," As a reader, you don't need to do anything to make that happen.

","

Browsers: MathJax works with all modern browsers including"," Edge, Firefox, Chrome, Safari, Opera, and most mobile browsers.

","

Math Menu: MathJax adds a contextual menu to equations."," Right-click or CTRL-click on any mathematics to access the menu.

",'
',"

Show Math As: These options allow you to view the formula's"," source markup (as MathML or in its original format).

","

Copy to Clipboard: These options copy the formula's source markup,"," as MathML or in its original format, to the clipboard"," (in browsers that support that).

","

Math Settings: These give you control over features of MathJax,"," such the size of the mathematics, and the mechanism used"," to display equations.

","

Accessibility: MathJax can work with screen"," readers to make mathematics accessible to the visually impaired."," Turn on the explorer to enable generation of speech strings"," and the ability to investigate expressions interactively.

","

Language: This menu lets you select the language used by MathJax"," for its menus and warning messages. (Not yet implemented in version 3.)

","
","

Math Zoom: If you are having difficulty reading an"," equation, MathJax can enlarge it to help you see it better, or"," you can scall all the math on the page to make it larger."," Turn these features on in the Math Settings menu.

","

Preferences: MathJax uses your browser's localStorage database"," to save the preferences set via this menu locally in your browser. These"," are not used to track you, and are not transferred or used remotely by"," MathJax in any way.

"].join("\n")}),'www.mathjax.org'),this.mathmlCode=new l.SelectableInfo("MathJax MathML Expression",(function(){if(!r.menu.mathItem)return"";var t=r.toMML(r.menu.mathItem);return"
"+r.formatSource(t)+"
"}),""),this.originalText=new l.SelectableInfo("MathJax Original Source",(function(){if(!r.menu.mathItem)return"";var t=r.menu.mathItem.math;return'
'+r.formatSource(t)+"
"}),""),this.annotationText=new l.SelectableInfo("MathJax Annotation Text",(function(){if(!r.menu.mathItem)return"";var t=r.menu.annotation;return'
'+r.formatSource(t)+"
"}),""),this.zoomBox=new f.Info("MathJax Zoomed Expression",(function(){if(!r.menu.mathItem)return"";var t=r.menu.mathItem.typesetRoot.cloneNode(!0);return t.style.margin="0",'
'+t.outerHTML+"
"}),""),this.document=t,this.options=(0,s.userOptions)((0,s.defaultOptions)({},this.constructor.OPTIONS),e),this.initSettings(),this.mergeUserSettings(),this.initMenu(),this.applySettings()}return Object.defineProperty(t.prototype,"isLoading",{get:function(){return t.loading>0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loadingPromise",{get:function(){return this.isLoading?(t._loadingPromise||(t._loadingPromise=new Promise((function(e,r){t._loadingOK=e,t._loadingFailed=r}))),t._loadingPromise):Promise.resolve()},enumerable:!1,configurable:!0}),t.prototype.initSettings=function(){this.settings=this.options.settings,this.jax=this.options.jax;var t=this.document.outputJax;this.jax[t.name]=t,this.settings.renderer=t.name,m._.a11y&&m._.a11y.explorer&&Object.assign(this.settings,this.document.options.a11y),this.settings.scale=t.options.scale,this.defaultSettings=Object.assign({},this.settings)},t.prototype.initMenu=function(){var t=this,e=new p.Parser([["contextMenu",u.MJContextMenu.fromJson.bind(u.MJContextMenu)]]);this.menu=e.parse({type:"contextMenu",id:"MathJax_Menu",pool:[this.variable("texHints"),this.variable("semantics"),this.variable("zoom"),this.variable("zscale"),this.variable("renderer",(function(e){return t.setRenderer(e)})),this.variable("alt"),this.variable("cmd"),this.variable("ctrl"),this.variable("shift"),this.variable("scale",(function(e){return t.setScale(e)})),this.variable("explorer",(function(e){return t.setExplorer(e)})),this.a11yVar("highlight"),this.a11yVar("backgroundColor"),this.a11yVar("backgroundOpacity"),this.a11yVar("foregroundColor"),this.a11yVar("foregroundOpacity"),this.a11yVar("speech"),this.a11yVar("subtitles"),this.a11yVar("braille"),this.a11yVar("viewBraille"),this.a11yVar("locale",(function(t){return y.default.setupEngine({locale:t})})),this.a11yVar("speechRules",(function(e){var r=n(e.split("-"),2),o=r[0],i=r[1];t.document.options.sre.domain=o,t.document.options.sre.style=i})),this.a11yVar("magnification"),this.a11yVar("magnify"),this.a11yVar("treeColoring"),this.a11yVar("infoType"),this.a11yVar("infoRole"),this.a11yVar("infoPrefix"),this.variable("autocollapse"),this.variable("collapsible",(function(e){return t.setCollapsible(e)})),this.variable("inTabOrder",(function(e){return t.setTabOrder(e)})),this.variable("assistiveMml",(function(e){return t.setAssistiveMml(e)}))],items:[this.submenu("Show","Show Math As",[this.command("MathMLcode","MathML Code",(function(){return t.mathmlCode.post()})),this.command("Original","Original Form",(function(){return t.originalText.post()})),this.submenu("Annotation","Annotation")]),this.submenu("Copy","Copy to Clipboard",[this.command("MathMLcode","MathML Code",(function(){return t.copyMathML()})),this.command("Original","Original Form",(function(){return t.copyOriginal()})),this.submenu("Annotation","Annotation")]),this.rule(),this.submenu("Settings","Math Settings",[this.submenu("Renderer","Math Renderer",this.radioGroup("renderer",[["CHTML"],["SVG"]])),this.rule(),this.submenu("ZoomTrigger","Zoom Trigger",[this.command("ZoomNow","Zoom Once Now",(function(){return t.zoom(null,"",t.menu.mathItem)})),this.rule(),this.radioGroup("zoom",[["Click"],["DoubleClick","Double-Click"],["NoZoom","No Zoom"]]),this.rule(),this.label("TriggerRequires","Trigger Requires:"),this.checkbox(L?"Option":"Alt",L?"Option":"Alt","alt"),this.checkbox("Command","Command","cmd",{hidden:!L}),this.checkbox("Control","Control","ctrl",{hiddne:L}),this.checkbox("Shift","Shift","shift")]),this.submenu("ZoomFactor","Zoom Factor",this.radioGroup("zscale",[["150%"],["175%"],["200%"],["250%"],["300%"],["400%"]])),this.rule(),this.command("Scale","Scale All Math...",(function(){return t.scaleAllMath()})),this.rule(),this.checkbox("texHints","Add TeX hints to MathML","texHints"),this.checkbox("semantics","Add original as annotation","semantics"),this.rule(),this.command("Reset","Reset to defaults",(function(){return t.resetDefaults()}))]),this.submenu("Accessibility","Accessibility",[this.checkbox("Activate","Activate","explorer"),this.submenu("Speech","Speech",[this.checkbox("Speech","Speech Output","speech"),this.checkbox("Subtitles","Speech Subtitles","subtitles"),this.checkbox("Braille","Braille Output","braille"),this.checkbox("View Braille","Braille Subtitles","viewBraille"),this.rule(),this.submenu("A11yLanguage","Language"),this.rule(),this.submenu("Mathspeak","Mathspeak Rules",this.radioGroup("speechRules",[["mathspeak-default","Verbose"],["mathspeak-brief","Brief"],["mathspeak-sbrief","Superbrief"]])),this.submenu("Clearspeak","Clearspeak Rules",this.radioGroup("speechRules",[["clearspeak-default","Auto"]])),this.submenu("ChromeVox","ChromeVox Rules",this.radioGroup("speechRules",[["chromevox-default","Standard"],["chromevox-alternative","Alternative"]]))]),this.submenu("Highlight","Highlight",[this.submenu("Background","Background",this.radioGroup("backgroundColor",[["Blue"],["Red"],["Green"],["Yellow"],["Cyan"],["Magenta"],["White"],["Black"]])),{type:"slider",variable:"backgroundOpacity",content:" "},this.submenu("Foreground","Foreground",this.radioGroup("foregroundColor",[["Black"],["White"],["Magenta"],["Cyan"],["Yellow"],["Green"],["Red"],["Blue"]])),{type:"slider",variable:"foregroundOpacity",content:" "},this.rule(),this.radioGroup("highlight",[["None"],["Hover"],["Flame"]]),this.rule(),this.checkbox("TreeColoring","Tree Coloring","treeColoring")]),this.submenu("Magnification","Magnification",[this.radioGroup("magnification",[["None"],["Keyboard"],["Mouse"]]),this.rule(),this.radioGroup("magnify",[["200%"],["300%"],["400%"],["500%"]])]),this.submenu("Semantic Info","Semantic Info",[this.checkbox("Type","Type","infoType"),this.checkbox("Role","Role","infoRole"),this.checkbox("Prefix","Prefix","infoPrefix")],!0),this.rule(),this.checkbox("Collapsible","Collapsible Math","collapsible"),this.checkbox("AutoCollapse","Auto Collapse","autocollapse",{disabled:!0}),this.rule(),this.checkbox("InTabOrder","Include in Tab Order","inTabOrder"),this.checkbox("AssistiveMml","Include Hidden MathML","assistiveMml")]),this.submenu("Language","Language"),this.rule(),this.command("About","About MathJax",(function(){return t.about.post()})),this.command("Help","MathJax Help",(function(){return t.help.post()}))]});var r=this.menu;this.about.attachMenu(r),this.help.attachMenu(r),this.originalText.attachMenu(r),this.annotationText.attachMenu(r),this.mathmlCode.attachMenu(r),this.zoomBox.attachMenu(r),this.checkLoadableItems(),this.enableExplorerItems(this.settings.explorer),r.showAnnotation=this.annotationText,r.copyAnnotation=this.copyAnnotation.bind(this),r.annotationTypes=this.options.annotationTypes,d.CssStyles.addInfoStyles(this.document.document),d.CssStyles.addMenuStyles(this.document.document)},t.prototype.checkLoadableItems=function(){var t,e;if(m&&m._&&m.loader&&m.startup)!this.settings.collapsible||m._.a11y&&m._.a11y.complexity||this.loadA11y("complexity"),!this.settings.explorer||m._.a11y&&m._.a11y.explorer||this.loadA11y("explorer"),!this.settings.assistiveMml||m._.a11y&&m._.a11y["assistive-mml"]||this.loadA11y("assistive-mml");else{var r=this.menu;try{for(var n=o(Object.keys(this.jax)),i=n.next();!i.done;i=n.next()){var a=i.value;this.jax[a]||r.findID("Settings","Renderer",a).disable()}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}r.findID("Accessibility","Activate").disable(),r.findID("Accessibility","AutoCollapse").disable(),r.findID("Accessibility","Collapsible").disable()}},t.prototype.enableExplorerItems=function(t){var e,r,n=this.menu.findID("Accessibility","Activate").menu;try{for(var i=o(n.items.slice(1)),a=i.next();!a.done;a=i.next()){var Q=a.value;if(Q instanceof h.Rule)break;t?Q.enable():Q.disable()}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}},t.prototype.mergeUserSettings=function(){try{var e=localStorage.getItem(t.MENU_STORAGE);if(!e)return;Object.assign(this.settings,JSON.parse(e)),this.setA11y(this.settings)}catch(t){console.log("MathJax localStorage error: "+t.message)}},t.prototype.saveUserSettings=function(){var e,r,n={};try{for(var i=o(Object.keys(this.settings)),a=i.next();!a.done;a=i.next()){var Q=a.value;this.settings[Q]!==this.defaultSettings[Q]&&(n[Q]=this.settings[Q])}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}try{Object.keys(n).length?localStorage.setItem(t.MENU_STORAGE,JSON.stringify(n)):localStorage.removeItem(t.MENU_STORAGE)}catch(t){console.log("MathJax localStorage error: "+t.message)}},t.prototype.setA11y=function(t){m._.a11y&&m._.a11y.explorer&&m._.a11y.explorer_ts.setA11yOptions(this.document,t)},t.prototype.getA11y=function(t){if(m._.a11y&&m._.a11y.explorer)return void 0!==this.document.options.a11y[t]?this.document.options.a11y[t]:this.document.options.sre[t]},t.prototype.applySettings=function(){this.setTabOrder(this.settings.inTabOrder),this.document.options.enableAssistiveMml=this.settings.assistiveMml,this.document.outputJax.options.scale=parseFloat(this.settings.scale),this.settings.renderer!==this.defaultSettings.renderer&&this.setRenderer(this.settings.renderer)},t.prototype.setScale=function(t){this.document.outputJax.options.scale=parseFloat(t),this.document.rerender()},t.prototype.setRenderer=function(t){var e=this;if(this.jax[t])this.setOutputJax(t);else{var r=t.toLowerCase();this.loadComponent("output/"+r,(function(){var n=m.startup;r in n.constructors&&(n.useOutput(r,!0),n.output=n.getOutputJax(),e.jax[t]=n.output,e.setOutputJax(t))}))}},t.prototype.setOutputJax=function(t){this.jax[t].setAdaptor(this.document.adaptor),this.document.outputJax=this.jax[t],this.rerender()},t.prototype.setTabOrder=function(t){this.menu.store.inTaborder(t)},t.prototype.setAssistiveMml=function(t){this.document.options.enableAssistiveMml=t,!t||m._.a11y&&m._.a11y["assistive-mml"]?this.rerender():this.loadA11y("assistive-mml")},t.prototype.setExplorer=function(t){this.enableExplorerItems(t),this.document.options.enableExplorer=t,!t||m._.a11y&&m._.a11y.explorer?this.rerender(this.settings.collapsible?Q.STATE.RERENDER:Q.STATE.COMPILED):this.loadA11y("explorer")},t.prototype.setCollapsible=function(t){this.document.options.enableComplexity=t,!t||m._.a11y&&m._.a11y.complexity?this.rerender(Q.STATE.COMPILED):this.loadA11y("complexity")},t.prototype.scaleAllMath=function(){var t=(100*parseFloat(this.settings.scale)).toFixed(1).replace(/.0$/,""),e=prompt("Scale all mathematics (compared to surrounding text) by",t+"%");if(e)if(e.match(/^\s*\d+(\.\d*)?\s*%?\s*$/)){var r=parseFloat(e)/100;r?this.menu.pool.lookup("scale").setValue(String(r)):alert("The scale should not be zero")}else alert("The scale should be a percentage (e.g., 120%)")},t.prototype.resetDefaults=function(){var e,r;t.loading++;var n=this.menu.pool,i=this.defaultSettings;try{for(var a=o(Object.keys(this.settings)),T=a.next();!T.done;T=a.next()){var s=T.value,u=n.lookup(s);if(u){u.setValue(i[s]);var c=u.items[0];c&&c.executeCallbacks_()}else this.settings[s]=i[s]}}catch(t){e={error:t}}finally{try{T&&!T.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}t.loading--,this.rerender(Q.STATE.COMPILED)},t.prototype.checkComponent=function(e){var r=t.loadingPromises.get(e);r&&a.mathjax.retryAfter(r)},t.prototype.loadComponent=function(e,r){if(!t.loadingPromises.has(e)){var n=m.loader;if(n){t.loading++;var o=n.load(e).then((function(){t.loading--,t.loadingPromises.delete(e),r(),0===t.loading&&t._loadingPromise&&(t._loadingPromise=null,t._loadingOK())})).catch((function(e){t._loadingPromise?(t._loadingPromise=null,t._loadingFailed(e)):console.log(e)}));t.loadingPromises.set(e,o)}}},t.prototype.loadA11y=function(e){var r=this,n=!Q.STATE.ENRICHED;this.loadComponent("a11y/"+e,(function(){var o=m.startup;a.mathjax.handlers.unregister(o.handler),o.handler=o.getHandler(),a.mathjax.handlers.register(o.handler);var i=r.document;r.document=o.document=o.getDocument(),r.document.menu=r,r.document.outputJax.reset(),r.transferMathList(i),r.document.processed=i.processed,t._loadingPromise||(r.document.outputJax.reset(),r.rerender("complexity"===e||n?Q.STATE.COMPILED:Q.STATE.TYPESET))}))},t.prototype.transferMathList=function(t){var e,r,n=this.document.options.MathItem;try{for(var i=o(t.math),a=i.next();!a.done;a=i.next()){var Q=a.value,T=new n;Object.assign(T,Q),this.document.math.push(T)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}},t.prototype.formatSource=function(t){return t.trim().replace(/&/g,"&").replace(//g,">")},t.prototype.toMML=function(t){return this.MmlVisitor.visitTree(t.root,t,{texHints:this.settings.texHints,semantics:this.settings.semantics&&"MathML"!==t.inputJax.name})},t.prototype.zoom=function(t,e,r){t&&!this.isZoomEvent(t,e)||(this.menu.mathItem=r,t&&this.menu.post(t),this.zoomBox.post())},t.prototype.isZoomEvent=function(t,e){return this.settings.zoom===e&&(!this.settings.alt||t.altKey)&&(!this.settings.ctrl||t.ctrlKey)&&(!this.settings.cmd||t.metaKey)&&(!this.settings.shift||t.shiftKey)},t.prototype.rerender=function(e){void 0===e&&(e=Q.STATE.TYPESET),this.rerenderStart=Math.min(e,this.rerenderStart),t.loading||(this.rerenderStart<=Q.STATE.COMPILED&&this.document.reset({inputJax:[]}),this.document.rerender(this.rerenderStart),this.rerenderStart=Q.STATE.LAST)},t.prototype.copyMathML=function(){this.copyToClipboard(this.toMML(this.menu.mathItem))},t.prototype.copyOriginal=function(){this.copyToClipboard(this.menu.mathItem.math.trim())},t.prototype.copyAnnotation=function(){this.copyToClipboard(this.menu.annotation.trim())},t.prototype.copyToClipboard=function(t){var e=document.createElement("textarea");e.value=t,e.setAttribute("readonly",""),e.style.cssText="height: 1px; width: 1px; padding: 1px; position: absolute; left: -10px",document.body.appendChild(e),e.select();try{document.execCommand("copy")}catch(t){alert("Can't copy to clipboard: "+t.message)}document.body.removeChild(e)},t.prototype.addMenu=function(t){var e=this,r=t.typesetRoot;r.addEventListener("contextmenu",(function(){return e.menu.mathItem=t}),!0),r.addEventListener("keydown",(function(){return e.menu.mathItem=t}),!0),r.addEventListener("click",(function(r){return e.zoom(r,"Click",t)}),!0),r.addEventListener("dblclick",(function(r){return e.zoom(r,"DoubleClick",t)}),!0),this.menu.store.insert(r)},t.prototype.clear=function(){this.menu.store.clear()},t.prototype.variable=function(t,e){var r=this;return{name:t,getter:function(){return r.settings[t]},setter:function(n){r.settings[t]=n,e&&e(n),r.saveUserSettings()}}},t.prototype.a11yVar=function(t,e){var r=this;return{name:t,getter:function(){return r.getA11y(t)},setter:function(n){r.settings[t]=n;var o={};o[t]=n,r.setA11y(o),e&&e(n),r.saveUserSettings()}}},t.prototype.submenu=function(t,e,r,n){var i,a;void 0===r&&(r=[]),void 0===n&&(n=!1);var Q=[];try{for(var T=o(r),s=T.next();!s.done;s=T.next()){var u=s.value;Array.isArray(u)?Q=Q.concat(u):Q.push(u)}}catch(t){i={error:t}}finally{try{s&&!s.done&&(a=T.return)&&a.call(T)}finally{if(i)throw i.error}}return{type:"submenu",id:t,content:e,menu:{items:Q},disabled:0===Q.length||n}},t.prototype.command=function(t,e,r,n){return void 0===n&&(n={}),Object.assign({type:"command",id:t,content:e,action:r},n)},t.prototype.checkbox=function(t,e,r,n){return void 0===n&&(n={}),Object.assign({type:"checkbox",id:t,content:e,variable:r},n)},t.prototype.radioGroup=function(t,e){var r=this;return e.map((function(e){return r.radio(e[0],e[1]||e[0],t)}))},t.prototype.radio=function(t,e,r,n){return void 0===n&&(n={}),Object.assign({type:"radio",id:t,content:e,variable:r},n)},t.prototype.label=function(t,e){return{type:"label",id:t,content:e}},t.prototype.rule=function(){return{type:"rule"}},t.MENU_STORAGE="MathJax-Menu-Settings",t.OPTIONS={settings:{texHints:!0,semantics:!1,zoom:"NoZoom",zscale:"200%",renderer:"CHTML",alt:!1,cmd:!1,ctrl:!1,shift:!1,scale:1,autocollapse:!1,collapsible:!1,inTabOrder:!0,assistiveMml:!0,explorer:!1},jax:{CHTML:null,SVG:null},annotationTypes:(0,s.expandable)({TeX:["TeX","LaTeX","application/x-tex"],StarMath:["StarMath 5.0"],Maple:["Maple"],ContentMathML:["MathML-Content","application/mathml-content+xml"],OpenMath:["OpenMath"]})},t.loading=0,t.loadingPromises=new Map,t._loadingPromise=null,t._loadingOK=null,t._loadingFailed=null,t}();e.Menu=v},1224:function(t,e,r){"use strict";var n,o=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)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__assign||function(){return i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},Q=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.MenuHandler=e.MenuMathDocumentMixin=e.MenuMathItemMixin=void 0;var s=r(1639),u=r(6245),c=r(546),l=r(3864);function f(t){return function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.addMenu=function(t,e){void 0===e&&(e=!1),this.state()>=u.STATE.CONTEXT_MENU||(this.isEscaped||!t.options.enableMenu&&!e||t.menu.addMenu(this),this.state(u.STATE.CONTEXT_MENU))},e.prototype.checkLoading=function(t){t.checkLoading()},e}(t)}function p(t){var e;return e=function(t){function e(){for(var e=[],r=0;r\n"+this.childNodeMml(e,r+" ","\n")+r+""},e.prototype.visitMathNode=function(e,r){if(!this.options.semantics||"TeX"!==this.mathItem.inputJax.name)return t.prototype.visitDefault.call(this,e,r);var n=e.childNodes.length&&e.childNodes[0].childNodes.length>1;return r+"\n"+r+" \n"+(n?r+" \n":"")+this.childNodeMml(e,r+(n?" ":" "),"\n")+(n?r+" \n":"")+r+' '+this.mathItem.math+"\n"+r+" \n"+r+""},e}(i.SerializedMmlVisitor);e.MmlVisitor=Q},6178:function(t,e,r){"use strict";var n,o=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)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.SelectableInfo=void 0;var i=r(7558),a=r(5375),Q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.addEvents=function(t){var e=this;t.addEventListener("keypress",(function(t){"a"===t.key&&(t.ctrlKey||t.metaKey)&&(e.selectAll(),e.stop(t))}))},e.prototype.selectAll=function(){document.getSelection().selectAllChildren(this.html.querySelector("pre"))},e.prototype.copyToClipboard=function(){this.selectAll();try{document.execCommand("copy")}catch(t){alert("Can't copy to clipboard: "+t.message)}document.getSelection().removeAllRanges()},e.prototype.generateHtml=function(){var e=this;t.prototype.generateHtml.call(this);var r=this.html.querySelector("span."+a.HtmlClasses.INFOSIGNATURE).appendChild(document.createElement("input"));r.type="button",r.value="Copy to Clipboard",r.addEventListener("click",(function(t){return e.copyToClipboard()}))},e}(i.Info);e.SelectableInfo=Q},8132:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.asyncLoad=void 0;var n=r(1639);e.asyncLoad=function(t){return n.mathjax.asyncLoad?new Promise((function(e,r){var o=n.mathjax.asyncLoad(t);o instanceof Promise?o.then((function(t){return e(t)})).catch((function(t){return r(t)})):e(o)})):Promise.reject("Can't load '".concat(t,"': No asyncLoad method specified"))}},8266:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BBox=void 0;var n=r(5966),o=function(){function t(t){void 0===t&&(t={w:0,h:-n.BIGDIMEN,d:-n.BIGDIMEN}),this.w=t.w||0,this.h="h"in t?t.h:-n.BIGDIMEN,this.d="d"in t?t.d:-n.BIGDIMEN,this.L=this.R=this.ic=this.sk=this.dx=0,this.scale=this.rscale=1,this.pwidth=""}return t.zero=function(){return new t({h:0,d:0,w:0})},t.empty=function(){return new t},t.prototype.empty=function(){return this.w=0,this.h=this.d=-n.BIGDIMEN,this},t.prototype.clean=function(){this.w===-n.BIGDIMEN&&(this.w=0),this.h===-n.BIGDIMEN&&(this.h=0),this.d===-n.BIGDIMEN&&(this.d=0)},t.prototype.rescale=function(t){this.w*=t,this.h*=t,this.d*=t},t.prototype.combine=function(t,e,r){void 0===e&&(e=0),void 0===r&&(r=0);var n=t.rscale,o=e+n*(t.w+t.L+t.R),i=r+n*t.h,a=n*t.d-r;o>this.w&&(this.w=o),i>this.h&&(this.h=i),a>this.d&&(this.d=a)},t.prototype.append=function(t){var e=t.rscale;this.w+=e*(t.w+t.L+t.R),e*t.h>this.h&&(this.h=e*t.h),e*t.d>this.d&&(this.d=e*t.d)},t.prototype.updateFrom=function(t){this.h=t.h,this.d=t.d,this.w=t.w,t.pwidth&&(this.pwidth=t.pwidth)},t.fullWidth="100%",t.StyleAdjust=[["borderTopWidth","h"],["borderRightWidth","w"],["borderBottomWidth","d"],["borderLeftWidth","w",0],["paddingTop","h"],["paddingRight","w"],["paddingBottom","d"],["paddingLeft","w",0]],t}();e.BBox=o},4204:function(t,e){"use strict";var r,n=this&&this.__extends||(r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},r(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),o=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},i=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},a=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o",gtdot:"\u22d7",harrw:"\u21ad",hbar:"\u210f",hellip:"\u2026",hookleftarrow:"\u21a9",hookrightarrow:"\u21aa",imath:"\u0131",infin:"\u221e",intcal:"\u22ba",iota:"\u03b9",jmath:"\u0237",kappa:"\u03ba",kappav:"\u03f0",lEg:"\u2a8b",lambda:"\u03bb",lap:"\u2a85",larrlp:"\u21ab",larrtl:"\u21a2",lbrace:"{",lbrack:"[",le:"\u2264",leftleftarrows:"\u21c7",leftthreetimes:"\u22cb",lessdot:"\u22d6",lmoust:"\u23b0",lnE:"\u2268",lnap:"\u2a89",lne:"\u2a87",lnsim:"\u22e6",longmapsto:"\u27fc",looparrowright:"\u21ac",lowast:"\u2217",loz:"\u25ca",lt:"<",ltimes:"\u22c9",ltri:"\u25c3",macr:"\xaf",malt:"\u2720",mho:"\u2127",mu:"\u03bc",multimap:"\u22b8",nLeftarrow:"\u21cd",nLeftrightarrow:"\u21ce",nRightarrow:"\u21cf",nVDash:"\u22af",nVdash:"\u22ae",natur:"\u266e",nearr:"\u2197",nharr:"\u21ae",nlarr:"\u219a",not:"\xac",nrarr:"\u219b",nu:"\u03bd",nvDash:"\u22ad",nvdash:"\u22ac",nwarr:"\u2196",omega:"\u03c9",omicron:"\u03bf",or:"\u2228",osol:"\u2298",period:".",phi:"\u03c6",phiv:"\u03d5",pi:"\u03c0",piv:"\u03d6",prap:"\u2ab7",precnapprox:"\u2ab9",precneqq:"\u2ab5",precnsim:"\u22e8",prime:"\u2032",psi:"\u03c8",quot:'"',rarrtl:"\u21a3",rbrace:"}",rbrack:"]",rho:"\u03c1",rhov:"\u03f1",rightrightarrows:"\u21c9",rightthreetimes:"\u22cc",ring:"\u02da",rmoust:"\u23b1",rtimes:"\u22ca",rtri:"\u25b9",scap:"\u2ab8",scnE:"\u2ab6",scnap:"\u2aba",scnsim:"\u22e9",sdot:"\u22c5",searr:"\u2198",sect:"\xa7",sharp:"\u266f",sigma:"\u03c3",sigmav:"\u03c2",simne:"\u2246",smile:"\u2323",spades:"\u2660",sub:"\u2282",subE:"\u2ac5",subnE:"\u2acb",subne:"\u228a",supE:"\u2ac6",supnE:"\u2acc",supne:"\u228b",swarr:"\u2199",tau:"\u03c4",theta:"\u03b8",thetav:"\u03d1",tilde:"\u02dc",times:"\xd7",triangle:"\u25b5",triangleq:"\u225c",upsi:"\u03c5",upuparrows:"\u21c8",veebar:"\u22bb",vellip:"\u22ee",weierp:"\u2118",xi:"\u03be",yen:"\xa5",zeta:"\u03b6",zigrarr:"\u21dd",nbsp:"\xa0",rsquo:"\u2019",lsquo:"\u2018"};var i={};function a(t,r){if("#"===r.charAt(0))return Q(r.slice(1));if(e.entities[r])return e.entities[r];if(e.options.loadMissingEntities){var a=r.match(/^[a-zA-Z](fr|scr|opf)$/)?RegExp.$1:r.charAt(0).toLowerCase();i[a]||(i[a]=!0,(0,n.retryAfter)((0,o.asyncLoad)("./util/entities/"+a+".js")))}return t}function Q(t){var e="x"===t.charAt(0)?parseInt(t.slice(1),16):parseInt(t);return String.fromCodePoint(e)}e.add=function(t,r){Object.assign(e.entities,t),i[r]=!0},e.remove=function(t){delete e.entities[t]},e.translate=function(t){return t.replace(/&([a-z][a-z0-9]*|#(?:[0-9]+|x[0-9a-f]+));/gi,a)},e.numeric=Q},7301:function(t,e,r){"use strict";var n,o=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)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},n(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},Q=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.LinkedList=e.ListItem=e.END=void 0,e.END=Symbol();var a=function(t){void 0===t&&(t=null),this.next=null,this.prev=null,this.data=t};e.ListItem=a;var Q=function(){function t(){for(var t=[],r=0;r1;){var s=o.shift(),u=o.shift();s.merge(u,e),o.push(s)}return o.length&&(this.list=o[0].list),this},t.prototype.merge=function(t,r){var o,i,a,Q,T;void 0===r&&(r=null),null===r&&(r=this.isBefore.bind(this));for(var s=this.list.next,u=t.list.next;s.data!==e.END&&u.data!==e.END;)r(u.data,s.data)?(o=n([s,u],2),u.prev.next=o[0],s.prev.next=o[1],i=n([s.prev,u.prev],2),u.prev=i[0],s.prev=i[1],a=n([t.list,this.list],2),this.list.prev.next=a[0],t.list.prev.next=a[1],Q=n([t.list.prev,this.list.prev],2),this.list.prev=Q[0],t.list.prev=Q[1],s=(T=n([u.next,s],2))[0],u=T[1]):s=s.next;return u.data!==e.END&&(this.list.prev.next=t.list.next,t.list.next.prev=this.list.prev,t.list.prev.next=this.list,this.list.prev=t.list.prev,t.list.next=t.list.prev=t.list),this},t}();e.LinkedList=Q},546:function(t,e){"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}var n=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},o=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},i=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;oe.length}}}},t.prototype.add=function(e,r){void 0===r&&(r=t.DEFAULTPRIORITY);var n=this.items.length;do{n--}while(n>=0&&r=0&&this.items[e].item!==t);e>=0&&this.items.splice(e,1)},t.DEFAULTPRIORITY=5,t}();e.PrioritizedList=r},5178:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.retryAfter=e.handleRetriesFor=void 0,e.handleRetriesFor=function(t){return new Promise((function e(r,n){try{r(t())}catch(t){t.retry&&t.retry instanceof Promise?t.retry.then((function(){return e(r,n)})).catch((function(t){return n(t)})):t.restart&&t.restart.isCallback?MathJax.Callback.After((function(){return e(r,n)}),t.restart):n(t)}}))},e.retryAfter=function(t){var e=new Error("MathJax retry");throw e.retry=t,e}},5169:function(t,e){"use strict";var r=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.CssStyles=void 0;var n=function(){function t(t){void 0===t&&(t=null),this.styles={},this.addStyles(t)}return Object.defineProperty(t.prototype,"cssText",{get:function(){return this.getStyleString()},enumerable:!1,configurable:!0}),t.prototype.addStyles=function(t){var e,n;if(t)try{for(var o=r(Object.keys(t)),i=o.next();!i.done;i=o.next()){var a=i.value;this.styles[a]||(this.styles[a]={}),Object.assign(this.styles[a],t[a])}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}},t.prototype.removeStyles=function(){for(var t,e,n=[],o=0;o=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},n=this&&this.__read||function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},o=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o1;)e.shift(),r.push(e.shift());return r}function T(t){var e,n,o=Q(this.styles[t]);0===o.length&&o.push(""),1===o.length&&o.push(o[0]),2===o.length&&o.push(o[0]),3===o.length&&o.push(o[1]);try{for(var i=r(L.connect[t].children),a=i.next();!a.done;a=i.next()){var T=a.value;this.setStyle(this.childName(t,T),o.shift())}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}}function s(t){var e,n,o=L.connect[t].children,i=[];try{for(var a=r(o),Q=a.next();!Q.done;Q=a.next()){var T=Q.value,s=this.styles[t+"-"+T];if(!s)return void delete this.styles[t];i.push(s)}}catch(t){e={error:t}}finally{try{Q&&!Q.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}i[3]===i[1]&&(i.pop(),i[2]===i[0]&&(i.pop(),i[1]===i[0]&&i.pop())),this.styles[t]=i.join(" ")}function u(t){var e,n;try{for(var o=r(L.connect[t].children),i=o.next();!i.done;i=o.next()){var a=i.value;this.setStyle(this.childName(t,a),this.styles[t])}}catch(t){e={error:t}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}function c(t){var e,i,a=o([],n(L.connect[t].children),!1),Q=this.styles[this.childName(t,a.shift())];try{for(var T=r(a),s=T.next();!s.done;s=T.next()){var u=s.value;if(this.styles[this.childName(t,u)]!==Q)return void delete this.styles[t]}}catch(t){e={error:t}}finally{try{s&&!s.done&&(i=T.return)&&i.call(T)}finally{if(e)throw e.error}}this.styles[t]=Q}var l=/^(?:[\d.]+(?:[a-z]+)|thin|medium|thick|inherit|initial|unset)$/,f=/^(?:none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset|inherit|initial|unset)$/;function p(t){var e,n,o,i,a={width:"",style:"",color:""};try{for(var T=r(Q(this.styles[t])),s=T.next();!s.done;s=T.next()){var u=s.value;u.match(l)&&""===a.width?a.width=u:u.match(f)&&""===a.style?a.style=u:a.color=u}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=T.return)&&n.call(T)}finally{if(e)throw e.error}}try{for(var c=r(L.connect[t].children),p=c.next();!p.done;p=c.next()){var h=p.value;this.setStyle(this.childName(t,h),a[h])}}catch(t){o={error:t}}finally{try{p&&!p.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}}function h(t){var e,n,o=[];try{for(var i=r(L.connect[t].children),a=i.next();!a.done;a=i.next()){var Q=a.value,T=this.styles[this.childName(t,Q)];T&&o.push(T)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}o.length?this.styles[t]=o.join(" "):delete this.styles[t]}var d={style:/^(?:normal|italic|oblique|inherit|initial|unset)$/,variant:new RegExp("^(?:"+["normal|none","inherit|initial|unset","common-ligatures|no-common-ligatures","discretionary-ligatures|no-discretionary-ligatures","historical-ligatures|no-historical-ligatures","contextual|no-contextual","(?:stylistic|character-variant|swash|ornaments|annotation)\\([^)]*\\)","small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps","lining-nums|oldstyle-nums|proportional-nums|tabular-nums","diagonal-fractions|stacked-fractions","ordinal|slashed-zero","jis78|jis83|jis90|jis04|simplified|traditional","full-width|proportional-width","ruby"].join("|")+")$"),weight:/^(?:normal|bold|bolder|lighter|[1-9]00|inherit|initial|unset)$/,stretch:new RegExp("^(?:"+["normal","(?:(?:ultra|extra|semi)-)?condensed","(?:(?:semi|extra|ulta)-)?expanded","inherit|initial|unset"].join("|")+")$"),size:new RegExp("^(?:"+["xx-small|x-small|small|medium|large|x-large|xx-large|larger|smaller","[d.]+%|[d.]+[a-z]+","inherit|initial|unset"].join("|")+")(?:/(?:normal|[d.+](?:%|[a-z]+)?))?$")};function y(t){var e,o,i,a,T=Q(this.styles[t]),s={style:"",variant:[],weight:"",stretch:"",size:"",family:"","line-height":""};try{for(var u=r(T),c=u.next();!c.done;c=u.next()){var l=c.value;s.family=l;try{for(var f=(i=void 0,r(Object.keys(d))),p=f.next();!p.done;p=f.next()){var h=p.value;if((Array.isArray(s[h])||""===s[h])&&l.match(d[h]))if("size"===h){var y=n(l.split(/\//),2),m=y[0],v=y[1];s[h]=m,v&&(s["line-height"]=v)}else""===s.size&&(Array.isArray(s[h])?s[h].push(l):s[h]=l)}}catch(t){i={error:t}}finally{try{p&&!p.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(o=u.return)&&o.call(u)}finally{if(e)throw e.error}}!function(t,e){var n,o;try{for(var i=r(L.connect[t].children),a=i.next();!a.done;a=i.next()){var Q=a.value,T=this.childName(t,Q);if(Array.isArray(e[Q])){var s=e[Q];s.length&&(this.styles[T]=s.join(" "))}else""!==e[Q]&&(this.styles[T]=e[Q])}}catch(t){n={error:t}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}}(t,s),delete this.styles[t]}function m(t){}var L=function(){function t(t){void 0===t&&(t=""),this.parse(t)}return Object.defineProperty(t.prototype,"cssText",{get:function(){var t,e,n=[];try{for(var o=r(Object.keys(this.styles)),i=o.next();!i.done;i=o.next()){var a=i.value,Q=this.parentName(a);this.styles[Q]||n.push(a+": "+this.styles[a]+";")}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return n.join(" ")},enumerable:!1,configurable:!0}),t.prototype.set=function(e,r){for(e=this.normalizeName(e),this.setStyle(e,r),t.connect[e]&&!t.connect[e].combine&&(this.combineChildren(e),delete this.styles[e]);e.match(/-/)&&(e=this.parentName(e),t.connect[e]);)t.connect[e].combine.call(this,e)},t.prototype.get=function(t){return t=this.normalizeName(t),this.styles.hasOwnProperty(t)?this.styles[t]:""},t.prototype.setStyle=function(e,r){this.styles[e]=r,t.connect[e]&&t.connect[e].children&&t.connect[e].split.call(this,e),""===r&&delete this.styles[e]},t.prototype.combineChildren=function(e){var n,o,i=this.parentName(e);try{for(var a=r(t.connect[e].children),Q=a.next();!Q.done;Q=a.next()){var T=Q.value,s=this.childName(i,T);t.connect[s].combine.call(this,s)}}catch(t){n={error:t}}finally{try{Q&&!Q.done&&(o=a.return)&&o.call(a)}finally{if(n)throw n.error}}},t.prototype.parentName=function(t){var e=t.replace(/-[^-]*$/,"");return t===e?"":e},t.prototype.childName=function(e,r){return r.match(/-/)?r:(t.connect[e]&&!t.connect[e].combine&&(r+=e.replace(/.*-/,"-"),e=this.parentName(e)),e+"-"+r)},t.prototype.normalizeName=function(t){return t.replace(/[A-Z]/g,(function(t){return"-"+t.toLowerCase()}))},t.prototype.parse=function(t){void 0===t&&(t="");var e=this.constructor.pattern;this.styles={};for(var r=t.replace(e.comment,"").split(e.style);r.length>1;){var o=n(r.splice(0,3),3),i=o[0],a=o[1],Q=o[2];if(i.match(/[^\s\n]/))return;this.set(a,Q)}},t.pattern={style:/([-a-z]+)[\s\n]*:[\s\n]*((?:'[^']*'|"[^"]*"|\n|.)*?)[\s\n]*(?:;|$)/g,comment:/\/\*[^]*?\*\//g},t.connect={padding:{children:i,split:T,combine:s},border:{children:i,split:u,combine:c},"border-top":{children:a,split:p,combine:h},"border-right":{children:a,split:p,combine:h},"border-bottom":{children:a,split:p,combine:h},"border-left":{children:a,split:p,combine:h},"border-width":{children:i,split:T,combine:null},"border-style":{children:i,split:T,combine:null},"border-color":{children:i,split:T,combine:null},font:{children:["style","variant","weight","stretch","line-height","size","family"],split:y,combine:m}},t}();e.Styles=L},5966:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.px=e.emRounded=e.em=e.percent=e.length2em=e.MATHSPACE=e.RELUNITS=e.UNITS=e.BIGDIMEN=void 0,e.BIGDIMEN=1e6,e.UNITS={px:1,in:96,cm:96/2.54,mm:96/25.4},e.RELUNITS={em:1,ex:.431,pt:.1,pc:1.2,mu:1/18},e.MATHSPACE={veryverythinmathspace:1/18,verythinmathspace:2/18,thinmathspace:3/18,mediummathspace:4/18,thickmathspace:5/18,verythickmathspace:6/18,veryverythickmathspace:7/18,negativeveryverythinmathspace:-1/18,negativeverythinmathspace:-2/18,negativethinmathspace:-3/18,negativemediummathspace:-4/18,negativethickmathspace:-5/18,negativeverythickmathspace:-6/18,negativeveryverythickmathspace:-7/18,thin:.04,medium:.06,thick:.1,normal:1,big:2,small:1/Math.sqrt(2),infinity:e.BIGDIMEN},e.length2em=function(t,r,n,o){if(void 0===r&&(r=0),void 0===n&&(n=1),void 0===o&&(o=16),"string"!=typeof t&&(t=String(t)),""===t||null==t)return r;if(e.MATHSPACE[t])return e.MATHSPACE[t];var i=t.match(/^\s*([-+]?(?:\.\d+|\d+(?:\.\d*)?))?(pt|em|ex|mu|px|pc|in|mm|cm|%)?/);if(!i)return r;var a=parseFloat(i[1]||"1"),Q=i[2];return e.UNITS.hasOwnProperty(Q)?a*e.UNITS[Q]/o/n:e.RELUNITS.hasOwnProperty(Q)?a*e.RELUNITS[Q]:"%"===Q?a/100*r:a*r},e.percent=function(t){return(100*t).toFixed(1).replace(/\.?0+$/,"")+"%"},e.em=function(t){return Math.abs(t)<.001?"0":t.toFixed(3).replace(/\.?0+$/,"")+"em"},e.emRounded=function(t,e){return void 0===e&&(e=16),t=(Math.round(t*e)+.05)/e,Math.abs(t)<.001?"0em":t.toFixed(3).replace(/\.?0+$/,"")+"em"},e.px=function(t,r,n){return void 0===r&&(r=-e.BIGDIMEN),void 0===n&&(n=16),t*=n,r&&t0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},n=this&&this.__spreadArray||function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractItem=void 0;var a=r(4929),Q=r(4257),T=r(5375),s=function(t){function e(e,r,n,o){var i=t.call(this,e,r)||this;return i._content=n,i.disabled=!1,i.callbacks=[],i._id=o||n,i}return o(e,t),Object.defineProperty(e.prototype,"content",{get:function(){return this._content},set:function(t){this._content=t,this.generateHtml(),this.menu&&this.menu.generateHtml()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),e.prototype.press=function(){this.disabled||(this.executeAction(),this.executeCallbacks_())},e.prototype.executeAction=function(){},e.prototype.registerCallback=function(t){-1===this.callbacks.indexOf(t)&&this.callbacks.push(t)},e.prototype.unregisterCallback=function(t){var e=this.callbacks.indexOf(t);-1!==e&&this.callbacks.splice(e,1)},e.prototype.mousedown=function(t){this.press(),this.stop(t)},e.prototype.mouseover=function(t){this.focus(),this.stop(t)},e.prototype.mouseout=function(t){this.deactivate(),this.stop(t)},e.prototype.generateHtml=function(){t.prototype.generateHtml.call(this);var e=this.html;e.setAttribute("aria-disabled","false"),e.textContent=this.content},e.prototype.activate=function(){this.disabled||this.html.classList.add(T.HtmlClasses.MENUACTIVE)},e.prototype.deactivate=function(){this.html.classList.remove(T.HtmlClasses.MENUACTIVE)},e.prototype.focus=function(){this.menu.focused=this,t.prototype.focus.call(this),this.activate()},e.prototype.unfocus=function(){this.deactivate(),t.prototype.unfocus.call(this)},e.prototype.escape=function(t){Q.MenuUtil.close(this)},e.prototype.up=function(t){this.menu.up(t)},e.prototype.down=function(t){this.menu.down(t)},e.prototype.left=function(t){this.menu.left(t)},e.prototype.right=function(t){this.menu.right(t)},e.prototype.space=function(t){this.press()},e.prototype.disable=function(){this.disabled=!0;var t=this.html;t.classList.add(T.HtmlClasses.MENUDISABLED),t.setAttribute("aria-disabled","true")},e.prototype.enable=function(){this.disabled=!1;var t=this.html;t.classList.remove(T.HtmlClasses.MENUDISABLED),t.removeAttribute("aria-disabled")},e.prototype.executeCallbacks_=function(){var t,e;try{for(var r=i(this.callbacks),n=r.next();!n.done;n=r.next()){var o=n.value;try{o(this)}catch(t){Q.MenuUtil.error(t,"Callback for menu entry "+this.id+" failed.")}}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},e}(a.AbstractEntry);e.AbstractItem=s},7553:function(t,e,r){"use strict";var n,o=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])},n(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)}),i=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractMenu=void 0;var a=r(6062),Q=r(8192),T=r(5375),s=r(5791),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.className=T.HtmlClasses.CONTEXTMENU,e.role="menu",e._items=[],e._baseMenu=null,e}return o(e,t),Object.defineProperty(e.prototype,"baseMenu",{get:function(){return this._baseMenu},set:function(t){this._baseMenu=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},set:function(t){this._items=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pool",{get:function(){return this.variablePool},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"focused",{get:function(){return this._focused},set:function(t){if(this._focused!==t){this._focused||this.unfocus();var e=this._focused;this._focused=t,e&&e.unfocus()}},enumerable:!1,configurable:!0}),e.prototype.up=function(t){var e=this.items.filter((function(t){return t instanceof Q.AbstractItem&&!t.isHidden()}));if(0!==e.length)if(this.focused){var r=e.indexOf(this.focused);-1!==r&&e[r=r?--r:e.length-1].focus()}else e[e.length-1].focus()},e.prototype.down=function(t){var e=this.items.filter((function(t){return t instanceof Q.AbstractItem&&!t.isHidden()}));if(0!==e.length)if(this.focused){var r=e.indexOf(this.focused);-1!==r&&e[r=++r===e.length?0:r].focus()}else e[0].focus()},e.prototype.generateHtml=function(){t.prototype.generateHtml.call(this),this.generateMenu()},e.prototype.generateMenu=function(){var t,e,r=this.html;r.classList.add(T.HtmlClasses.MENU);try{for(var n=i(this.items),o=n.next();!o.done;o=n.next()){var a=o.value;if(a.isHidden()){var Q=a.html;Q.parentNode&&Q.parentNode.removeChild(Q)}else r.appendChild(a.html)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},e.prototype.post=function(e,r){this.variablePool.update(),t.prototype.post.call(this,e,r)},e.prototype.unpostSubmenus=function(){var t,e,r=this.items.filter((function(t){return t instanceof s.Submenu}));try{for(var n=i(r),o=n.next();!o.done;o=n.next()){var a=o.value;a.submenu.unpost(),a!==this.focused&&a.unfocus()}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}},e.prototype.unpost=function(){t.prototype.unpost.call(this),this.unpostSubmenus(),this.focused=null},e.prototype.find=function(t){var e,r;try{for(var n=i(this.items),o=n.next();!o.done;o=n.next()){var a=o.value;if("rule"!==a.type){if(a.id===t)return a;if("submenu"===a.type){var Q=a.submenu.find(t);if(Q)return Q}}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}return null},e}(a.AbstractPostable);e.AbstractMenu=u},8118:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractNavigatable=void 0;var n=r(9869),o=r(7620),i=function(){function t(){this.bubble=!1}return t.prototype.bubbleKey=function(){this.bubble=!0},t.prototype.keydown=function(t){switch(t.keyCode){case n.KEY.ESCAPE:this.escape(t);break;case n.KEY.RIGHT:this.right(t);break;case n.KEY.LEFT:this.left(t);break;case n.KEY.UP:this.up(t);break;case n.KEY.DOWN:this.down(t);break;case n.KEY.RETURN:case n.KEY.SPACE:this.space(t);break;default:return}this.bubble?this.bubble=!1:this.stop(t)},t.prototype.escape=function(t){},t.prototype.space=function(t){},t.prototype.left=function(t){},t.prototype.right=function(t){},t.prototype.up=function(t){},t.prototype.down=function(t){},t.prototype.stop=function(t){t&&(t.stopPropagation(),t.preventDefault(),t.cancelBubble=!0)},t.prototype.mousedown=function(t){return this.stop(t)},t.prototype.mouseup=function(t){return this.stop(t)},t.prototype.mouseover=function(t){return this.stop(t)},t.prototype.mouseout=function(t){return this.stop(t)},t.prototype.click=function(t){return this.stop(t)},t.prototype.addEvents=function(t){t.addEventListener(o.MOUSE.DOWN,this.mousedown.bind(this)),t.addEventListener(o.MOUSE.UP,this.mouseup.bind(this)),t.addEventListener(o.MOUSE.OVER,this.mouseover.bind(this)),t.addEventListener(o.MOUSE.OUT,this.mouseout.bind(this)),t.addEventListener(o.MOUSE.CLICK,this.click.bind(this)),t.addEventListener("keydown",this.keydown.bind(this)),t.addEventListener("dragstart",this.stop.bind(this)),t.addEventListener(o.MOUSE.SELECTSTART,this.stop.bind(this)),t.addEventListener("contextmenu",this.stop.bind(this)),t.addEventListener(o.MOUSE.DBLCLICK,this.stop.bind(this))},t}();e.AbstractNavigatable=i},6062:function(t,e,r){"use strict";var n,o=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])},n(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)});Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractPostable=void 0;var i=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.posted=!1,e}return o(e,t),e.prototype.isPosted=function(){return this.posted},e.prototype.post=function(t,e){this.posted||(void 0!==t&&void 0!==e&&this.html.setAttribute("style","left: "+t+"px; top: "+e+"px;"),this.display(),this.posted=!0)},e.prototype.unpost=function(){if(this.posted){var t=this.html;t.parentNode&&t.parentNode.removeChild(t),this.posted=!1}},e}(r(9458).MenuElement);e.AbstractPostable=i},4589:function(t,e,r){"use strict";var n,o=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])},n(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)});Object.defineProperty(e,"__esModule",{value:!0}),e.AbstractVariableItem=void 0;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.generateHtml=function(){t.prototype.generateHtml.call(this);var e=this.html;this.span||this.generateSpan(),e.appendChild(this.span),this.update()},e.prototype.register=function(){this.variable.register(this)},e.prototype.unregister=function(){this.variable.unregister(this)},e.prototype.update=function(){this.updateAria(),this.span&&this.updateSpan()},e}(r(8192).AbstractItem);e.AbstractVariableItem=i},4324:function(t,e,r){"use strict";var n,o=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])},n(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)});Object.defineProperty(e,"__esModule",{value:!0}),e.CloseButton=void 0;var i=r(6062),a=r(5375),Q=function(t){function e(e){var r=t.call(this)||this;return r.element=e,r.className=a.HtmlClasses.MENUCLOSE,r.role="button",r}return o(e,t),e.prototype.generateHtml=function(){var t=document.createElement("span");t.classList.add(this.className),t.setAttribute("role",this.role),t.setAttribute("tabindex","0");var e=document.createElement("span");e.textContent="\xd7",t.appendChild(e),this.html=t},e.prototype.display=function(){},e.prototype.unpost=function(){t.prototype.unpost.call(this),this.element.unpost()},e.prototype.keydown=function(e){this.bubbleKey(),t.prototype.keydown.call(this,e)},e.prototype.space=function(t){this.unpost(),this.stop(t)},e.prototype.mousedown=function(t){this.unpost(),this.stop(t)},e}(i.AbstractPostable);e.CloseButton=Q},3710:function(t,e,r){"use strict";var n,o=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])},n(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)});Object.defineProperty(e,"__esModule",{value:!0}),e.ContextMenu=void 0;var i=r(7553),a=r(5375),Q=r(6845),T=r(9182),s=function(t){function e(e){var r=t.call(this)||this;return r.factory=e,r.id="",r.moving=!1,r._store=new Q.MenuStore(r),r.widgets=[],r.variablePool=new T.VariablePool,r}return o(e,t),e.fromJson=function(t,e){var r=e.pool,n=e.items,o=e.id,i=void 0===o?"":o,a=new this(t);a.id=i;var Q=t.get("variable");r.forEach((function(e){return Q(t,e,a.pool)}));var T=t.get("items")(t,n,a);return a.items=T,a},e.prototype.generateHtml=function(){this.isPosted()&&this.unpost(),t.prototype.generateHtml.call(this),this._frame=document.createElement("div"),this._frame.classList.add(a.HtmlClasses.MENUFRAME);var e="left: 0px; top: 0px; z-index: 200; width: 100%; height: 100%; border: 0px; padding: 0px; margin: 0px;";this._frame.setAttribute("style","position: absolute; "+e);var r=document.createElement("div");r.setAttribute("style","position: fixed; "+e),this._frame.appendChild(r),r.addEventListener("mousedown",function(t){this.unpost(),this.unpostWidgets(),this.stop(t)}.bind(this))},e.prototype.display=function(){document.body.appendChild(this.frame),this.frame.appendChild(this.html),this.focus()},e.prototype.escape=function(t){this.unpost(),this.unpostWidgets()},e.prototype.unpost=function(){if(t.prototype.unpost.call(this),!(this.widgets.length>0)){this.frame.parentNode.removeChild(this.frame);var e=this.store;this.moving||e.insertTaborder(),e.active.focus()}},e.prototype.left=function(t){this.move_(this.store.previous())},e.prototype.right=function(t){this.move_(this.store.next())},Object.defineProperty(e.prototype,"frame",{get:function(){return this._frame},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"store",{get:function(){return this._store},enumerable:!1,configurable:!0}),e.prototype.post=function(e,r){if(void 0!==r)return this.moving||this.store.removeTaborder(),void t.prototype.post.call(this,e,r);var n,o,i,a=e;if(a instanceof Event?(n=a.target,this.stop(a)):n=a,a instanceof MouseEvent&&(o=a.pageX,i=a.pageY,o||i||!a.clientX||(o=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,i=a.clientY+document.body.scrollTop+document.documentElement.scrollTop)),!o&&!i&&n){var Q=window.pageXOffset||document.documentElement.scrollLeft,T=window.pageYOffset||document.documentElement.scrollTop,s=n.getBoundingClientRect();o=(s.right+s.left)/2+Q,i=(s.bottom+s.top)/2+T}this.store.active=n,this.anchor=this.store.active;var u=this.html;o+u.offsetWidth>document.body.offsetWidth-5&&(o=document.body.offsetWidth-u.offsetWidth-5),this.post(o,i)},e.prototype.registerWidget=function(t){this.widgets.push(t)},e.prototype.unregisterWidget=function(t){var e=this.widgets.indexOf(t);e>-1&&this.widgets.splice(e,1),0===this.widgets.length&&this.unpost()},e.prototype.unpostWidgets=function(){this.widgets.forEach((function(t){return t.unpost()}))},e.prototype.toJson=function(){return{type:""}},e.prototype.move_=function(t){this.anchor&&t!==this.anchor&&(this.moving=!0,this.unpost(),this.post(t),this.moving=!1)},e}(i.AbstractMenu);e.ContextMenu=s},6014:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CssStyles=void 0;var n=r(5375);!function(t){function e(t){return"."+(n.HtmlClasses[t]||t)}var r={};r[e("INFOCLOSE")]="{ top:.2em; right:.2em;}",r[e("INFOCONTENT")]="{ overflow:auto; text-align:left; font-size:80%; padding:.4em .6em; border:1px inset; margin:1em 0px; max-height:20em; max-width:30em; background-color:#EEEEEE; white-space:normal;}",r[e("INFO")+e("MOUSEPOST")]="{outline:none;}",r[e("INFO")]='{ position:fixed; left:50%; width:auto; text-align:center; border:3px outset; padding:1em 2em; background-color:#DDDDDD; color:black; cursor:default; font-family:message-box; font-size:120%; font-style:normal; text-indent:0; text-transform:none; line-height:normal; letter-spacing:normal; word-spacing:normal; word-wrap:normal; white-space:nowrap; float:none; z-index:201; border-radius: 15px; /* Opera 10.5 and IE9 */ -webkit-border-radius:15px; /* Safari and Chrome */ -moz-border-radius:15px; /* Firefox */ -khtml-border-radius:15px; /* Konqueror */ box-shadow:0px 10px 20px #808080; /* Opera 10.5 and IE9 */ -webkit-box-shadow:0px 10px 20px #808080; /* Safari 3 & Chrome */ -moz-box-shadow:0px 10px 20px #808080; /* Forefox 3.5 */ -khtml-box-shadow:0px 10px 20px #808080; /* Konqueror */ filter:progid:DXImageTransform.Microsoft.dropshadow(OffX=2, OffY=2, Color="gray", Positive="true"); /* IE */}';var o={};o[e("MENU")]="{ position:absolute; background-color:white; color:black; width:auto; padding:5px 0px; border:1px solid #CCCCCC; margin:0; cursor:default; font: menu; text-align:left; text-indent:0; text-transform:none; line-height:normal; letter-spacing:normal; word-spacing:normal; word-wrap:normal; white-space:nowrap; float:none; z-index:201; border-radius: 5px; /* Opera 10.5 and IE9 */ -webkit-border-radius: 5px; /* Safari and Chrome */ -moz-border-radius: 5px; /* Firefox */ -khtml-border-radius: 5px; /* Konqueror */ box-shadow:0px 10px 20px #808080; /* Opera 10.5 and IE9 */ -webkit-box-shadow:0px 10px 20px #808080; /* Safari 3 & Chrome */ -moz-box-shadow:0px 10px 20px #808080; /* Forefox 3.5 */ -khtml-box-shadow:0px 10px 20px #808080; /* Konqueror */}",o[e("MENUITEM")]="{ padding: 1px 2em; background:transparent;}",o[e("MENUARROW")]="{ position:absolute; right:.5em; padding-top:.25em; color:#666666; font-family: null; font-size: .75em}",o[e("MENUACTIVE")+" "+e("MENUARROW")]="{color:white}",o[e("MENUARROW")+e("RTL")]="{left:.5em; right:auto}",o[e("MENUCHECK")]="{ position:absolute; left:.7em; font-family: null}",o[e("MENUCHECK")+e("RTL")]="{ right:.7em; left:auto }",o[e("MENURADIOCHECK")]="{ position:absolute; left: .7em;}",o[e("MENURADIOCHECK")+e("RTL")]="{ right: .7em; left:auto}",o[e("MENUINPUTBOX")]="{ padding-left: 1em; right:.5em; color:#666666; font-family: null;}",o[e("MENUINPUTBOX")+e("RTL")]="{ left: .1em;}",o[e("MENUCOMBOBOX")]="{ left:.1em; padding-bottom:.5em;}",o[e("MENUSLIDER")]="{ left: .1em;}",o[e("SLIDERVALUE")]="{ position:absolute; right:.1em; padding-top:.25em; color:#333333; font-size: .75em}",o[e("SLIDERBAR")]="{ outline: none; background: #d3d3d3}",o[e("MENULABEL")]="{ padding: 1px 2em 3px 1.33em; font-style:italic}",o[e("MENURULE")]="{ border-top: 1px solid #DDDDDD; margin: 4px 3px;}",o[e("MENUDISABLED")]="{ color:GrayText}",o[e("MENUACTIVE")]="{ background-color: #606872; color: white;}",o[e("MENUDISABLED")+":focus"]="{ background-color: #E8E8E8}",o[e("MENULABEL")+":focus"]="{ background-color: #E8E8E8}",o[e("CONTEXTMENU")+":focus"]="{ outline:none}",o[e("CONTEXTMENU")+" "+e("MENUITEM")+":focus"]="{ outline:none}",o[e("SELECTIONMENU")]="{ position:relative; float:left; border-bottom: none; -webkit-box-shadow:none; -webkit-border-radius:0px; }",o[e("SELECTIONITEM")]="{ padding-right: 1em;}",o[e("SELECTION")]="{ right: 40%; width:50%; }",o[e("SELECTIONBOX")]="{ padding: 0em; max-height:20em; max-width: none; background-color:#FFFFFF;}",o[e("SELECTIONDIVIDER")]="{ clear: both; border-top: 2px solid #000000;}",o[e("MENU")+" "+e("MENUCLOSE")]="{ top:-10px; left:-10px}";var i={};i[e("MENUCLOSE")]='{ position:absolute; cursor:pointer; display:inline-block; border:2px solid #AAA; border-radius:18px; -webkit-border-radius: 18px; /* Safari and Chrome */ -moz-border-radius: 18px; /* Firefox */ -khtml-border-radius: 18px; /* Konqueror */ font-family: "Courier New", Courier; font-size:24px; color:#F0F0F0}',i[e("MENUCLOSE")+" span"]="{ display:block; background-color:#AAA; border:1.5px solid; border-radius:18px; -webkit-border-radius: 18px; /* Safari and Chrome */ -moz-border-radius: 18px; /* Firefox */ -khtml-border-radius: 18px; /* Konqueror */ line-height:0; padding:8px 0 6px /* may need to be browser-specific */}",i[e("MENUCLOSE")+":hover"]="{ color:white!important; border:2px solid #CCC!important}",i[e("MENUCLOSE")+":hover span"]="{ background-color:#CCC!important}",i[e("MENUCLOSE")+":hover:focus"]="{ outline:none}";var a=!1,Q=!1,T=!1;function s(t){T||(u(i,t),T=!0)}function u(t,e){var r=e||document,n=r.createElement("style");n.type="text/css";var o="";for(var i in t)o+=i,o+=" ",o+=t[i],o+="\n";n.innerHTML=o,r.head.appendChild(n)}t.addMenuStyles=function(t){Q||(u(o,t),Q=!0,s(t))},t.addInfoStyles=function(t){a||(u(r,t),a=!0,s(t))}}(e.CssStyles||(e.CssStyles={}))},5375:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.HtmlAttrs=e.HtmlClasses=void 0;function r(t){return"CtxtMenu_"+t}function n(t){return r(t)}function o(t){return r(t)}e.HtmlClasses={ATTACHED:n("Attached"),CONTEXTMENU:n("ContextMenu"),MENU:n("Menu"),MENUARROW:n("MenuArrow"),MENUACTIVE:n("MenuActive"),MENUCHECK:n("MenuCheck"),MENUCLOSE:n("MenuClose"),MENUCOMBOBOX:n("MenuComboBox"),MENUDISABLED:n("MenuDisabled"),MENUFRAME:n("MenuFrame"),MENUITEM:n("MenuItem"),MENULABEL:n("MenuLabel"),MENURADIOCHECK:n("MenuRadioCheck"),MENUINPUTBOX:n("MenuInputBox"),MENURULE:n("MenuRule"),MENUSLIDER:n("MenuSlider"),MOUSEPOST:n("MousePost"),RTL:n("RTL"),INFO:n("Info"),INFOCLOSE:n("InfoClose"),INFOCONTENT:n("InfoContent"),INFOSIGNATURE:n("InfoSignature"),INFOTITLE:n("InfoTitle"),SLIDERVALUE:n("SliderValue"),SLIDERBAR:n("SliderBar"),SELECTION:n("Selection"),SELECTIONBOX:n("SelectionBox"),SELECTIONMENU:n("SelectionMenu"),SELECTIONDIVIDER:n("SelectionDivider"),SELECTIONITEM:n("SelectionItem")},e.HtmlAttrs={COUNTER:o("Counter"),KEYDOWNFUNC:o("keydownFunc"),CONTEXTMENUFUNC:o("contextmenuFunc"),OLDTAB:o("Oldtabindex"),TOUCHFUNC:o("TouchFunc")}},7558:function(t,e,r){"use strict";var n,o=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])},n(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)});Object.defineProperty(e,"__esModule",{value:!0}),e.Info=void 0;var i=r(4324),a=r(5375),Q=function(t){function e(e,r,n){var o=t.call(this)||this;return o.title=e,o.signature=n,o.className=a.HtmlClasses.INFO,o.role="dialog",o.contentDiv=o.generateContent(),o.close=o.generateClose(),o.content=r||function(){return""},o}return o(e,t),e.prototype.attachMenu=function(t){this.menu=t},e.prototype.generateHtml=function(){t.prototype.generateHtml.call(this);var e=this.html;e.appendChild(this.generateTitle()),e.appendChild(this.contentDiv),e.appendChild(this.generateSignature()),e.appendChild(this.close.html),e.setAttribute("tabindex","0")},e.prototype.post=function(){t.prototype.post.call(this);var e=document.documentElement,r=this.html,n=window.innerHeight||e.clientHeight||e.scrollHeight||0,o=Math.floor(-r.offsetWidth/2),i=Math.floor((n-r.offsetHeight)/3);r.setAttribute("style","margin-left: "+o+"px; top: "+i+"px;"),window.event instanceof MouseEvent&&r.classList.add(a.HtmlClasses.MOUSEPOST),r.focus()},e.prototype.display=function(){this.menu.registerWidget(this),this.contentDiv.innerHTML=this.content();var t=this.menu.html;t.parentNode&&t.parentNode.removeChild(t),this.menu.frame.appendChild(this.html)},e.prototype.click=function(t){},e.prototype.keydown=function(e){this.bubbleKey(),t.prototype.keydown.call(this,e)},e.prototype.escape=function(t){this.unpost()},e.prototype.unpost=function(){t.prototype.unpost.call(this),this.html.classList.remove(a.HtmlClasses.MOUSEPOST),this.menu.unregisterWidget(this)},e.prototype.generateClose=function(){var t=new i.CloseButton(this),e=t.html;return e.classList.add(a.HtmlClasses.INFOCLOSE),e.setAttribute("aria-label","Close Dialog Box"),t},e.prototype.generateTitle=function(){var t=document.createElement("span");return t.innerHTML=this.title,t.classList.add(a.HtmlClasses.INFOTITLE),t},e.prototype.generateContent=function(){var t=document.createElement("div");return t.classList.add(a.HtmlClasses.INFOCONTENT),t.setAttribute("tabindex","0"),t},e.prototype.generateSignature=function(){var t=document.createElement("span");return t.innerHTML=this.signature,t.classList.add(a.HtmlClasses.INFOSIGNATURE),t},e.prototype.toJson=function(){return{type:""}},e}(r(6062).AbstractPostable);e.Info=Q},1053:function(t,e,r){"use strict";var n,o=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])},n(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)});Object.defineProperty(e,"__esModule",{value:!0}),e.Checkbox=void 0;var i=r(4589),a=r(4257),Q=r(5375),T=function(t){function e(e,r,n,o){var i=t.call(this,e,"checkbox",r,o)||this;return i.role="menuitemcheckbox",i.variable=e.pool.lookup(n),i.register(),i}return o(e,t),e.fromJson=function(t,e,r){return new this(r,e.content,e.variable,e.id)},e.prototype.executeAction=function(){this.variable.setValue(!this.variable.getValue()),a.MenuUtil.close(this)},e.prototype.generateSpan=function(){this.span=document.createElement("span"),this.span.textContent="\u2713",this.span.classList.add(Q.HtmlClasses.MENUCHECK)},e.prototype.updateAria=function(){this.html.setAttribute("aria-checked",this.variable.getValue()?"true":"false")},e.prototype.updateSpan=function(){this.span.style.display=this.variable.getValue()?"":"none"},e.prototype.toJson=function(){return{type:""}},e}(i.AbstractVariableItem);e.Checkbox=T},3415:function(t,e,r){"use strict";var n,o=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])},n(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)});Object.defineProperty(e,"__esModule",{value:!0}),e.Combo=void 0;var i=r(4589),a=r(4257),Q=r(5375),T=r(9869),s=function(t){function e(e,r,n,o){var i=t.call(this,e,"combobox",r,o)||this;return i.role="combobox",i.inputEvent=!1,i.variable=e.pool.lookup(n),i.register(),i}return o(e,t),e.fromJson=function(t,e,r){return new this(r,e.content,e.variable,e.id)},e.prototype.executeAction=function(){this.variable.setValue(this.input.value,a.MenuUtil.getActiveElement(this))},e.prototype.space=function(e){t.prototype.space.call(this,e),a.MenuUtil.close(this)},e.prototype.focus=function(){t.prototype.focus.call(this),this.input.focus()},e.prototype.unfocus=function(){t.prototype.unfocus.call(this),this.updateSpan()},e.prototype.generateHtml=function(){t.prototype.generateHtml.call(this),this.html.classList.add(Q.HtmlClasses.MENUCOMBOBOX)},e.prototype.generateSpan=function(){this.span=document.createElement("span"),this.span.classList.add(Q.HtmlClasses.MENUINPUTBOX),this.input=document.createElement("input"),this.input.addEventListener("keydown",this.inputKey.bind(this)),this.input.setAttribute("size","10em"),this.input.setAttribute("type","text"),this.input.setAttribute("tabindex","-1"),this.span.appendChild(this.input)},e.prototype.inputKey=function(t){this.bubbleKey(),this.inputEvent=!0},e.prototype.keydown=function(e){if(this.inputEvent&&e.keyCode!==T.KEY.ESCAPE&&e.keyCode!==T.KEY.RETURN)return this.inputEvent=!1,void e.stopPropagation();t.prototype.keydown.call(this,e),e.stopPropagation()},e.prototype.updateAria=function(){},e.prototype.updateSpan=function(){var t;try{t=this.variable.getValue(a.MenuUtil.getActiveElement(this))}catch(e){t=""}this.input.value=t},e.prototype.toJson=function(){return{type:""}},e}(i.AbstractVariableItem);e.Combo=s},1869:function(t,e,r){"use strict";var n,o=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])},n(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)});Object.defineProperty(e,"__esModule",{value:!0}),e.Command=void 0;var i=r(8192),a=r(4257),Q=function(t){function e(e,r,n,o){var i=t.call(this,e,"command",r,o)||this;return i.command=n,i}return o(e,t),e.fromJson=function(t,e,r){return new this(r,e.content,e.action,e.id)},e.prototype.executeAction=function(){try{this.command(a.MenuUtil.getActiveElement(this))}catch(t){a.MenuUtil.error(t,"Illegal command callback.")}a.MenuUtil.close(this)},e.prototype.toJson=function(){return{type:""}},e}(i.AbstractItem);e.Command=Q},2995:function(t,e,r){"use strict";var n,o=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])},n(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)});Object.defineProperty(e,"__esModule",{value:!0}),e.Label=void 0;var i=r(8192),a=r(5375),Q=function(t){function e(e,r,n){return t.call(this,e,"label",r,n)||this}return o(e,t),e.fromJson=function(t,e,r){return new this(r,e.content,e.id)},e.prototype.generateHtml=function(){t.prototype.generateHtml.call(this),this.html.classList.add(a.HtmlClasses.MENULABEL)},e.prototype.toJson=function(){return{type:""}},e}(i.AbstractItem);e.Label=Q},1075:function(t,e,r){"use strict";var n,o=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])},n(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)});Object.defineProperty(e,"__esModule",{value:!0}),e.Radio=void 0;var i=r(4589),a=r(4257),Q=r(5375),T=function(t){function e(e,r,n,o){var i=t.call(this,e,"radio",r,o)||this;return i.role="menuitemradio",i.variable=e.pool.lookup(n),i.register(),i}return o(e,t),e.fromJson=function(t,e,r){return new this(r,e.content,e.variable,e.id)},e.prototype.executeAction=function(){this.variable.setValue(this.id),a.MenuUtil.close(this)},e.prototype.generateSpan=function(){this.span=document.createElement("span"),this.span.textContent="\u2713",this.span.classList.add(Q.HtmlClasses.MENURADIOCHECK)},e.prototype.updateAria=function(){this.html.setAttribute("aria-checked",this.variable.getValue()===this.id?"true":"false")},e.prototype.updateSpan=function(){this.span.style.display=this.variable.getValue()===this.id?"":"none"},e.prototype.toJson=function(){return{type:""}},e}(i.AbstractVariableItem);e.Radio=T},8838:function(t,e,r){"use strict";var n,o=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])},n(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)});Object.defineProperty(e,"__esModule",{value:!0}),e.Rule=void 0;var i=r(4929),a=r(5375),Q=function(t){function e(e){var r=t.call(this,e,"rule")||this;return r.className=a.HtmlClasses.MENUITEM,r.role="separator",r}return o(e,t),e.fromJson=function(t,e,r){return new this(r)},e.prototype.generateHtml=function(){t.prototype.generateHtml.call(this);var e=this.html;e.classList.add(a.HtmlClasses.MENURULE),e.setAttribute("aria-orientation","vertical")},e.prototype.addEvents=function(t){},e.prototype.toJson=function(){return{type:"rule"}},e}(i.AbstractEntry);e.Rule=Q},7944:function(t,e,r){"use strict";var n,o=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])},n(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)});Object.defineProperty(e,"__esModule",{value:!0}),e.Slider=void 0;var i=r(4589),a=r(4257),Q=r(5375),T=r(9869),s=function(t){function e(e,r,n,o){var i=t.call(this,e,"slider",r,o)||this;return i.role="slider",i.labelId="ctx_slideLabel"+a.MenuUtil.counter(),i.valueId="ctx_slideValue"+a.MenuUtil.counter(),i.inputEvent=!1,i.variable=e.pool.lookup(n),i.register(),i}return o(e,t),e.fromJson=function(t,e,r){return new this(r,e.content,e.variable,e.id)},e.prototype.executeAction=function(){this.variable.setValue(this.input.value,a.MenuUtil.getActiveElement(this)),this.update()},e.prototype.space=function(e){t.prototype.space.call(this,e),a.MenuUtil.close(this)},e.prototype.focus=function(){t.prototype.focus.call(this),this.input.focus()},e.prototype.unfocus=function(){t.prototype.unfocus.call(this),this.updateSpan()},e.prototype.generateHtml=function(){t.prototype.generateHtml.call(this),this.html.classList.add(Q.HtmlClasses.MENUSLIDER),this.valueSpan=document.createElement("span"),this.valueSpan.setAttribute("id",this.valueId),this.valueSpan.classList.add(Q.HtmlClasses.SLIDERVALUE),this.html.appendChild(this.valueSpan)},e.prototype.generateSpan=function(){this.span=document.createElement("span"),this.labelSpan=document.createElement("span"),this.labelSpan.setAttribute("id",this.labelId),this.labelSpan.appendChild(this.html.childNodes[0]),this.html.appendChild(this.labelSpan),this.input=document.createElement("input"),this.input.setAttribute("type","range"),this.input.setAttribute("min","0"),this.input.setAttribute("max","100"),this.input.setAttribute("aria-valuemin","0"),this.input.setAttribute("aria-valuemax","100"),this.input.setAttribute("aria-labelledby",this.labelId),this.input.addEventListener("keydown",this.inputKey.bind(this)),this.input.addEventListener("input",this.executeAction.bind(this)),this.input.classList.add(Q.HtmlClasses.SLIDERBAR),this.span.appendChild(this.input)},e.prototype.inputKey=function(t){this.inputEvent=!0},e.prototype.mousedown=function(t){t.stopPropagation()},e.prototype.mouseup=function(t){event.stopPropagation()},e.prototype.keydown=function(e){var r=e.keyCode;return r===T.KEY.UP||r===T.KEY.DOWN?(e.preventDefault(),void t.prototype.keydown.call(this,e)):this.inputEvent&&r!==T.KEY.ESCAPE&&r!==T.KEY.RETURN?(this.inputEvent=!1,void e.stopPropagation()):(t.prototype.keydown.call(this,e),void e.stopPropagation())},e.prototype.updateAria=function(){var t=this.variable.getValue();t&&this.input&&(this.input.setAttribute("aria-valuenow",t),this.input.setAttribute("aria-valuetext",t+"%"))},e.prototype.updateSpan=function(){var t;try{t=this.variable.getValue(a.MenuUtil.getActiveElement(this)),this.valueSpan.innerHTML=t+"%"}catch(e){t=""}this.input.value=t},e.prototype.toJson=function(){return{type:""}},e}(i.AbstractVariableItem);e.Slider=s},5791:function(t,e,r){"use strict";var n,o=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])},n(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)});Object.defineProperty(e,"__esModule",{value:!0}),e.Submenu=void 0;var i=r(8192),a=r(5375),Q=function(t){function e(e,r,n){var o=t.call(this,e,"submenu",r,n)||this;return o._submenu=null,o}return o(e,t),e.fromJson=function(t,e,r){var n=e.content,o=e.menu,i=new this(r,n,e.id),a=t.get("subMenu")(t,o,i);return i.submenu=a,i},Object.defineProperty(e.prototype,"submenu",{get:function(){return this._submenu},set:function(t){this._submenu=t},enumerable:!1,configurable:!0}),e.prototype.mouseover=function(t){this.focus(),this.stop(t)},e.prototype.mouseout=function(t){this.stop(t)},e.prototype.unfocus=function(){if(this.submenu.isPosted()){if(this.menu.focused!==this)return t.prototype.unfocus.call(this),void this.menu.unpostSubmenus();this.html.setAttribute("tabindex","-1"),this.html.blur()}else t.prototype.unfocus.call(this)},e.prototype.focus=function(){t.prototype.focus.call(this),this.submenu.isPosted()||this.disabled||this.submenu.post()},e.prototype.executeAction=function(){this.submenu.isPosted()?this.submenu.unpost():this.submenu.post()},e.prototype.generateHtml=function(){t.prototype.generateHtml.call(this);var e=this.html;this.span=document.createElement("span"),this.span.textContent="\u25ba",this.span.classList.add(a.HtmlClasses.MENUARROW),e.appendChild(this.span),e.setAttribute("aria-haspopup","true")},e.prototype.left=function(e){this.submenu.isPosted()?this.submenu.unpost():t.prototype.left.call(this,e)},e.prototype.right=function(t){this.submenu.isPosted()?this.submenu.down(t):this.submenu.post()},e.prototype.toJson=function(){return{type:""}},e}(i.AbstractItem);e.Submenu=Q},9869:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KEY=void 0,function(t){t[t.RETURN=13]="RETURN",t[t.ESCAPE=27]="ESCAPE",t[t.SPACE=32]="SPACE",t[t.LEFT=37]="LEFT",t[t.UP=38]="UP",t[t.RIGHT=39]="RIGHT",t[t.DOWN=40]="DOWN"}(e.KEY||(e.KEY={}))},9458:function(t,e,r){"use strict";var n,o=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])},n(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)});Object.defineProperty(e,"__esModule",{value:!0}),e.MenuElement=void 0;var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.addAttributes=function(t){for(var e in t)this.html.setAttribute(e,t[e])},Object.defineProperty(e.prototype,"html",{get:function(){return this._html||this.generateHtml(),this._html},set:function(t){this._html=t,this.addEvents(t)},enumerable:!1,configurable:!0}),e.prototype.generateHtml=function(){var t=document.createElement("div");t.classList.add(this.className),t.setAttribute("role",this.role),this.html=t},e.prototype.focus=function(){var t=this.html;t.setAttribute("tabindex","0"),t.focus()},e.prototype.unfocus=function(){var t=this.html;t.hasAttribute("tabindex")&&t.setAttribute("tabindex","-1");try{t.blur()}catch(t){}t.blur()},e}(r(8118).AbstractNavigatable);e.MenuElement=i},6845:function(t,e,r){"use strict";var n=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:!0}),e.MenuStore=void 0;var o=r(4257),i=r(5375),a=r(9869),Q=function(){function t(t){this.menu=t,this.store=[],this._active=null,this.counter=0,this.attachedClass=i.HtmlClasses.ATTACHED+"_"+o.MenuUtil.counter(),this.taborder=!0,this.attrMap={}}return Object.defineProperty(t.prototype,"active",{get:function(){return this._active},set:function(t){do{if(-1!==this.store.indexOf(t)){this._active=t;break}t=t.parentNode}while(t)},enumerable:!1,configurable:!0}),t.prototype.next=function(){var t=this.store.length;if(0===t)return this.active=null,null;var e=this.store.indexOf(this.active);return e=-1===e?0:e0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},i=this&&this.__values||function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__spread||function(){for(var t=[],e=0;e0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a};Object.defineProperty(e,"__esModule",{value:!0}),e.SelectionBox=e.SelectionMenu=void 0;var a=r(4257),Q=r(5375),T=r(7553),s=r(7558),u=function(t){function e(e){var r=t.call(this)||this;return r.anchor=e,r.className=Q.HtmlClasses.SELECTIONMENU,r.variablePool=r.anchor.menu.pool,r.baseMenu=r.anchor.menu,r}return o(e,t),e.fromJson=function(t,e,r){var n=e.title,o=e.values,i=e.variable,a=new this(r),Q=t.get("label")(t,{content:n||"",id:n||"id"},a),T=t.get("rule")(t,{},a),s=o.map((function(e){return t.get("radio")(t,{content:e,variable:i,id:e},a)})),u=[Q,T].concat(s);return a.items=u,a},e.prototype.generateHtml=function(){t.prototype.generateHtml.call(this),this.items.forEach((function(t){return t.html.classList.add(Q.HtmlClasses.SELECTIONITEM)}))},e.prototype.display=function(){},e.prototype.right=function(t){this.anchor.right(t)},e.prototype.left=function(t){this.anchor.left(t)},e}(T.AbstractMenu);e.SelectionMenu=u;var c=function(t){function e(e,r,n,o){void 0===n&&(n="none"),void 0===o&&(o="vertical");var i=t.call(this,e,null,r)||this;return i.style=n,i.grid=o,i._selections=[],i.prefix="ctxt-selection",i._balanced=!0,i}return o(e,t),e.fromJson=function(t,e,r){var n=e.title,o=e.signature,i=e.selections,a=new this(n,o,e.order,e.grid);a.attachMenu(r);var Q=i.map((function(e){return t.get("selectionMenu")(t,e,a)}));return a.selections=Q,a},e.prototype.attachMenu=function(t){this.menu=t},Object.defineProperty(e.prototype,"selections",{get:function(){return this._selections},set:function(t){var e=this;this._selections=[],t.forEach((function(t){return e.addSelection(t)}))},enumerable:!1,configurable:!0}),e.prototype.addSelection=function(t){t.anchor=this,this._selections.push(t)},e.prototype.rowDiv=function(t){var e=this,r=document.createElement("div");this.contentDiv.appendChild(r);var n=t.map((function(t){return r.appendChild(t.html),t.html.id||(t.html.id=e.prefix+a.MenuUtil.counter()),t.html.getBoundingClientRect()})),o=n.map((function(t){return t.width})),i=o.reduce((function(t,e){return t+e}),0),T=n.reduce((function(t,e){return Math.max(t,e.height)}),0);return r.classList.add(Q.HtmlClasses.SELECTIONDIVIDER),r.setAttribute("style","height: "+T+"px;"),[r,i,T,o]},e.prototype.display=function(){if(t.prototype.display.call(this),this.order(),this.selections.length){for(var e=[],r=0,n=[],o=this.getChunkSize(this.selections.length),a=function(t){var a=Q.selections.slice(t,t+o),T=i(Q.rowDiv(a),4),s=T[0],u=T[1],c=T[2],l=T[3];e.push(s),r=Math.max(r,u),a.forEach((function(t){return t.html.style.height=c+"px"})),n=Q.combineColumn(n,l)},Q=this,T=0;Tdocument.body.offsetWidth-5&&(i=Math.max(5,i-o-r.offsetWidth+6)),t.prototype.post.call(this,i,a)}},e.prototype.display=function(){this.baseMenu.frame.appendChild(this.html)},e.prototype.setBaseMenu=function(){var t=this;do{t=t.anchor.menu}while(t instanceof e);this.baseMenu=t},e.prototype.left=function(t){this.focused=null,this.anchor.focus()},e.prototype.toJson=function(){return{type:""}},e}(r(7553).AbstractMenu);e.SubMenu=i},2210:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Variable=void 0;var n=r(4257),o=function(){function t(t,e,r){this._name=t,this.getter=e,this.setter=r,this.items=[]}return t.fromJson=function(t,e,r){var n=new this(e.name,e.getter,e.setter);r.insert(n)},Object.defineProperty(t.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),t.prototype.getValue=function(t){try{return this.getter(t)}catch(t){return n.MenuUtil.error(t,"Command of variable "+this.name+" failed."),null}},t.prototype.setValue=function(t,e){try{this.setter(t,e)}catch(t){n.MenuUtil.error(t,"Command of variable "+this.name+" failed.")}this.update()},t.prototype.register=function(t){-1===this.items.indexOf(t)&&this.items.push(t)},t.prototype.unregister=function(t){var e=this.items.indexOf(t);-1!==e&&this.items.splice(e,1)},t.prototype.update=function(){this.items.forEach((function(t){return t.update()}))},t.prototype.registerCallback=function(t){this.items.forEach((function(e){return e.registerCallback(t)}))},t.prototype.unregisterCallback=function(t){this.items.forEach((function(e){return e.unregisterCallback(t)}))},t.prototype.toJson=function(){return{type:"variable",name:this.name,getter:this.getter.toString(),setter:this.setter.toString()}},t}();e.Variable=o},9182:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VariablePool=void 0;var r=function(){function t(){this.pool={}}return t.prototype.insert=function(t){this.pool[t.name]=t},t.prototype.lookup=function(t){return this.pool[t]},t.prototype.remove=function(t){delete this.pool[t]},t.prototype.update=function(){for(var t in this.pool)this.pool[t].update()},t}();e.VariablePool=r},5579:function(t,e,r){"use strict";function n(t,e){for(var r=0;r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,Q=!0,T=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return Q=t.done,t},e:function(t){T=!0,a=t},f:function(){try{Q||null==r.return||r.return()}finally{if(T)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r5&&void 0!==arguments[5]&&arguments[5];if(i){var a,u=t[t.length-1];if(u&&(a=u[Q.personalityProps.JOIN]),u&&!e.speech&&o&&h(u)){var c=Q.personalityProps.PAUSE;u[c]=s(u[c],o[c]),o=null}if(u&&e.speech&&0===Object.keys(r).length&&d(u)){if(void 0!==a){var l=u.span.pop();e=new T.Span(l.speech+a+e.speech,l.attributes)}u.span.push(e),e=new T.Span("",{}),u[Q.personalityProps.JOIN]=n}}0!==Object.keys(r).length&&t.push(r),e.speech&&t.push({span:[e],join:n}),o&&t.push(o)}function m(t,e){if(!e)return t;var r,o={},i=n(Q.personalityPropList);try{for(i.s();!(r=i.n()).done;){var T=r.value,s=t[T],l=e[T];if(!(!s&&!l||s&&l&&s===l)){var f=s||0;p(o)||(o.open=[],o.close=[]),s||o.close.push(T),l||o.open.push(T),l&&s&&(o.close.push(T),o.open.push(T)),e[T]=f,o[T]=f,u[T]?u[T].push(f):u[T]=[f]}}}catch(t){i.e(t)}finally{i.f()}if(p(o)){for(var h=o.close.slice();h.length>0;){var d=c.pop(),y=(0,a.setdifference)(d,h);if(h=(0,a.setdifference)(h,d),d=y,0!==h.length){if(0!==d.length){o.close=o.close.concat(d),o.open=o.open.concat(d);for(var m,L=0;m=d[L];L++)o[m]=e[m]}}else 0!==d.length&&c.push(d)}c.push(o.open)}return o}e.personalityMarkup=function(t){u={},c=[];for(var e,r,n,o,i=[],a={},T=0;e=t[T];T++){var s=null,L=e.descriptionSpan(),v=e.personality,b=v[Q.personalityProps.JOIN];delete v[Q.personalityProps.JOIN],void 0!==v[Q.personalityProps.PAUSE]&&(r={},n=Q.personalityProps.PAUSE,o=v[Q.personalityProps.PAUSE],n in r?Object.defineProperty(r,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[n]=o,s=r,delete v[Q.personalityProps.PAUSE]),y(i,L,m(v,a),b,s,!0)}return i=i.concat(function(){for(var t=[],e=c.length-1;e>=0;e--){var r=c[e];if(r.length){for(var n={open:[],close:[]},o=0;o1&&void 0!==arguments[1]?arguments[1]:{};return e.text=o.Grammar.getInstance().apply(e.text,r),new t(e)}}],(r=[{key:"isEmpty",value:function(){return 0===this.context.length&&0===this.text.length&&0===this.userValue.length&&0===this.annotation.length}},{key:"clone",value:function(){var e,r;if(this.personality)for(var n in e={},this.personality)e[n]=this.personality[n];if(this.attributes)for(var o in r={},this.attributes)r[o]=this.attributes[o];return new t({context:this.context,text:this.text,userValue:this.userValue,annotation:this.annotation,personality:e,attributes:r,layout:this.layout})}},{key:"toString",value:function(){return'AuditoryDescription(context="'+this.context+'" text="'+this.text+'" userValue="'+this.userValue+'" annotation="'+this.annotation+'")'}},{key:"descriptionString",value:function(){return this.context&&this.text?this.context+" "+this.text:this.context||this.text}},{key:"descriptionSpan",value:function(){return new i.Span(this.descriptionString(),this.attributes)}},{key:"equals",value:function(t){return this.context===t.context&&this.text===t.text&&this.userValue===t.userValue&&this.annotation===t.annotation}}])&&n(e.prototype,r),a&&n(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.AuditoryDescription=a},3122:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.isXml=e.registerRenderer=e.error=e.finalize=e.merge=e.markup=e.getSeparator=e.setSeparator=void 0;var n=r(6617),o=r(6548),i=r(927),a=r(7320),Q=r(8154),T=r(2752),s=r(4098),u=r(2922),c=r(8474),l=r(6863),f=r(2731),p=new u.SsmlRenderer,h=new Map([[o.Markup.NONE,new l.StringRenderer],[o.Markup.PUNCTUATION,new Q.PunctuationRenderer],[o.Markup.LAYOUT,new a.LayoutRenderer],[o.Markup.ACSS,new i.AcssRenderer],[o.Markup.SABLE,new T.SableRenderer],[o.Markup.VOICEXML,p],[o.Markup.SSML,p],[o.Markup.SSML_STEP,new c.SsmlStepRenderer]]);e.setSeparator=function(t){var e=h.get(n.default.getInstance().markup);e&&e.setSeparator(t)},e.getSeparator=function(){var t=h.get(n.default.getInstance().markup);return t?t.getSeparator():""},e.markup=function(t){var e=h.get(n.default.getInstance().markup);return e?e.markup(t):""},e.merge=function(t){var e=t.map((function(t){return"string"==typeof t?new s.Span(t,{}):t})),r=h.get(n.default.getInstance().markup);return r?r.merge(e):t.join()},e.finalize=function(t){var e=h.get(n.default.getInstance().markup);return e?e.finalize(t):t},e.error=function(t){var e=h.get(n.default.getInstance().markup);return e?e.error(t):""},e.registerRenderer=function(t,e){h.set(t,e)},e.isXml=function(){return h.get(n.default.getInstance().markup)instanceof f.XmlRenderer}},7320:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,Q=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){Q=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(Q)throw o}}return i}(t,e)||a(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=a(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,Q=!0,T=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return Q=t.done,t},e:function(t){T=!0,i=t},f:function(){try{Q||null==r.return||r.return()}finally{if(T)throw i}}}}function a(t,e){if(t){if("string"==typeof t)return Q(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Q(t,e):void 0}}function Q(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r".concat(t,""));return p.Debugger.getInstance().output(h.formatXml(e.toString())),g(e)}(t)}},{key:"pause",value:function(t){return""}},{key:"prosodyElement",value:function(t,e){return t===d.personalityProps.LAYOUT?"<".concat(e,">"):""}},{key:"closeTag",value:function(t){return"")}},{key:"markup",value:function(t){var e,r=[],n=[],o=i(t);try{for(o.s();!(e=o.n()).done;){var a=e.value;if(a.layout){r.push(this.processContent(n)),n=[];var Q=a.layout;Q.match(/^begin/)?r.push("<"+Q.replace(/^begin/,"")+">"):Q.match(/^end/)?r.push(""):console.warn("Something went wrong with layout markup: "+Q)}else n.push(a)}}catch(t){o.e(t)}finally{o.f()}return r.push(this.processContent(n)),r.join("")}},{key:"processContent",value:function(t){for(var e,r=[],n=y.personalityMarkup(t),o=0;e=n[o];o++)e.span?r.push(this.merge(e.span)):y.isPauseElement(e);return r.join("")}}])&&s(e.prototype,r),n&&s(e,n),Object.defineProperty(e,"prototype",{writable:!1}),a}(r(2731).XmlRenderer);e.LayoutRenderer=m;var L={TABLE:function(t){var e=S(t);e.forEach((function(t){t.cells=t.cells.slice(1).slice(0,-1),t.width=t.width.slice(1).slice(0,-1)}));var r=o(V(e),2),n=r[0],i=r[1];return _(e=E(e,i),n)},CASES:function(t){var e=S(t);e.forEach((function(t){t.cells=t.cells.slice(0,-1),t.width=t.width.slice(0,-1)}));var r=o(V(e),2),n=r[0],i=r[1];return _(e=E(e,i),n)},CAYLEY:function(t){var e=S(t);e.forEach((function(t){t.cells=t.cells.slice(1).slice(0,-1),t.width=t.width.slice(1).slice(0,-1),t.sep=t.sep+t.sep}));var r=o(V(e),2),n=r[0],i=r[1],a={lfence:"",rfence:"",cells:i.map((function(t){return"\u2810"+new Array(t).join("\u2812")})),width:i,height:1,sep:e[0].sep};return e.splice(1,0,a),_(e=E(e,i),n)},MATRIX:function(t){var e=S(t),r=o(V(e),2),n=r[0],i=r[1];return _(e=E(e,i),n)},CELL:g,FENCE:g,ROW:g,FRACTION:function(t){var e=o(Array.from(t.childNodes),5),r=e[0],n=e[1],i=e[3],a=e[4],Q=v(n),T=v(i),s=O(Q),u=O(T),c=Math.max(s,u),l=r+new Array(c+1).join("\u2812")+a;return"".concat(C(Q,c=l.length),"\n").concat(l,"\n")+"".concat(C(T,c))},NUMERATOR:N,DENOMINATOR:N};function v(t){var e=h.tagName(t),r=L[e];return r?r(t):t.textContent}function b(t,e){if(!t||!e)return t+e;var r=H(t),n=H(e),o=r-n;t=o<0?M(t,n,O(t)):t,e=o>0?M(e,r,O(e)):e;for(var i=t.split(/\r\n|\r|\n/),a=e.split(/\r\n|\r|\n/),Q=[],T=0;T0?new Array(r+1).join("\n"):"")}(t,e),function(t,e){var r,n=[],o=i(t.split(/\r\n|\r|\n/));try{for(o.s();!(r=o.n()).done;){var a=r.value,Q=e-a.length;n.push(a+(Q>0?new Array(Q+1).join("\u2800"):""))}}catch(t){o.e(t)}finally{o.f()}return n.join("\n")}(t,r)}function S(t){for(var e=[],r=0,n=Array.from(t.childNodes);r4&&void 0!==arguments[4]?arguments[4]:0;this.scaleFunction=function(i){var a=(i-t)/(e-t),Q=r*(1-a)+n*a;return+(Math.round(Q+"e+"+o)+"e-"+o)}}},{key:"applyScaleFunction",value:function(t){return this.scaleFunction?this.scaleFunction(t):t}},{key:"ignoreElement",value:function(t){return-1!==this.ignoreElements.indexOf(t)}}],r&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(r(5579).AbstractAudioRenderer);e.MarkupRenderer=c},8154:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r=0;r'+this.getSeparator()+t+this.getSeparator()+""}},{key:"pause",value:function(t){return''}},{key:"prosodyElement",value:function(t,e){switch(e=this.applyScaleFunction(e),t){case u.personalityProps.PITCH:return'';case u.personalityProps.RATE:return'';case u.personalityProps.VOLUME:return'';default:return"<"+t.toUpperCase()+' VALUE="'+e+'">'}}},{key:"closeTag",value:function(t){return""}}])&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(r(2731).XmlRenderer);e.SableRenderer=c},4098:function(t,e){"use strict";function r(t,e){for(var r=0;r'+this.getSeparator()+t+this.getSeparator()+""}},{key:"pause",value:function(t){return''}},{key:"prosodyElement",value:function(t,e){var r=(e=Math.floor(this.applyScaleFunction(e)))<0?e.toString():"+"+e.toString();return"":'%">')}},{key:"closeTag",value:function(t){return""}}])&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(r(2731).XmlRenderer);e.SsmlRenderer=l},8474:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r=0;r'),u.MARKS[o]=!0),1===n.speech.length&&n.speech.match(/[a-zA-Z]/)?e.push(''+n.speech+""):e.push(n.speech)}return e.join(this.getSeparator())}}])&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),u}(r(2922).SsmlRenderer);e.SsmlStepRenderer=l,l.CHARACTER_ATTR="character",l.MARKS={}},6863:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r=0;r=i)){var Q=o.join;e+=void 0===Q?this.getSeparator():Q}return e}}])&&i(e.prototype,r),n&&i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(u.AbstractAudioRenderer);e.StringRenderer=l},2731:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r=0;r=10||(n.default.wgxpath=wgxpath,t?wgxpath.install({document:document}):wgxpath.install(),o.xpath.evaluate=document.evaluate,o.xpath.result=XPathResult,o.xpath.createNSResolver=document.createNSResolver)}function Q(){T(n.default.mathmapsIePath)}function T(t){var e=n.default.document.createElement("script");e.type="text/javascript",e.src=t,n.default.document.head?n.default.document.head.appendChild(e):n.default.document.body.appendChild(e)}e.detectIE=function(){return"undefined"!=typeof window&&"ActiveXObject"in window&&"clipboardData"in window&&(Q(),i(),!0)},e.detectEdge=function(){var t;return"undefined"!=typeof window&&"MSGestureEvent"in window&&null===(null===(t=window.chrome)||void 0===t?void 0:t.loadTimes)&&(document.evaluate=null,i(!0),!0)},e.mapsForIE=null,e.loadWGXpath_=i,e.installWGXpath_=a,e.loadMapsForIE_=Q,e.loadScript=T},2868:function(t,e,r){"use strict";function n(t,e){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:function(){};this.fileHandle.then((function(){t.isActive_&&t.stream_&&t.stream_.end("","",e)}))}},{key:"startDebugFile_",value:function(t){var e=this;this.fileHandle=o.default.fs.promises.open(t,"w"),this.fileHandle=this.fileHandle.then((function(r){e.stream_=r.createWriteStream(t),e.outputFunction_=function(){for(var t=arguments.length,e=new Array(t),r=0;r[ \f\n\r\t\v\u200b]+<").trim()}function s(t,e){if(!e)return[!1,""];var r=t.match(/^<([^> ]+).*>/),n=e.match(/^<\/([^>]+)>(.*)/);return r&&n&&r[1]===n[1]?[!0,n[2]]:[!1,""]}e.toArray=Q,e.trimInput_=T,e.XML_ENTITIES={"<":!0,">":!0,"&":!0,""":!0,"'":!0},e.parseInput=function(t){var e=new i.default.xmldom.DOMParser,r=T(t),Q=!!r.match(/&(?!lt|gt|amp|quot|apos)\w+;/g);if(!r)throw new Error("Empty input!");try{var s=e.parseFromString(r,Q?"text/html":"text/xml");return n.default.getInstance().mode===o.Mode.HTTP?(a.xpath.currentDocument=s,Q?s.body.childNodes[0]:s.documentElement):s.documentElement}catch(t){throw new n.SREError("Illegal input: "+t.message)}},function(t){t[t.ELEMENT_NODE=1]="ELEMENT_NODE",t[t.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",t[t.TEXT_NODE=3]="TEXT_NODE",t[t.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",t[t.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",t[t.ENTITY_NODE=6]="ENTITY_NODE",t[t.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",t[t.COMMENT_NODE=8]="COMMENT_NODE",t[t.DOCUMENT_NODE=9]="DOCUMENT_NODE",t[t.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",t[t.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",t[t.NOTATION_NODE=12]="NOTATION_NODE"}(e.NodeType||(e.NodeType={})),e.replaceNode=function(t,e){t.parentNode&&(t.parentNode.insertBefore(e,t),t.parentNode.removeChild(t))},e.createElement=function(t){return i.default.document.createElement(t)},e.createElementNS=function(t,e){return i.default.document.createElementNS(t,e)},e.createTextNode=function(t){return i.default.document.createTextNode(t)},e.formatXml=function(t){var e="",r=/(>)(<)(\/*)/g,n=0,o=(t=t.replace(r,"$1\r\n$2$3")).split("\r\n");for(r=/(\.)*(<)(\/*)/g,o=o.map((function(t){return t.replace(r,"$1\r\n$2$3").split("\r\n")})).reduce((function(t,e){return t.concat(e)}),[]);o.length;){var i=o.shift();if(i){var a=0;if(i.match(/^<\w[^>/]*>[^>]+$/)){var Q=s(i,o[0]);Q[0]?Q[1]?(i+=o.shift().slice(0,-Q[1].length),Q[1].trim()&&o.unshift(Q[1])):i+=o.shift():a=1}else if(i.match(/^<\/\w/))0!==n&&(n-=1);else if(i.match(/^<\w[^>]*[^/]>.*$/))a=1;else if(i.match(/^<\w[^>]*\/>.+$/)){var T=i.indexOf(">")+1;i.slice(T).trim()&&o.unshift(),i=i.slice(0,T)}else a=0;e+=new Array(n+1).join(" ")+i+"\r\n",n+=a}}return e},e.querySelectorAllByAttr=function(t,e){return t.querySelectorAll?Q(t.querySelectorAll("[".concat(e,"]"))):a.evalXPath(".//*[@".concat(e,"]"),t)},e.querySelectorAllByAttrValue=function(t,e,r){return t.querySelectorAll?Q(t.querySelectorAll("[".concat(e,'="').concat(r,'"]'))):a.evalXPath(".//*[@".concat(e,'="').concat(r,'"]'),t)},e.querySelectorAll=function(t,e){return t.querySelectorAll?Q(t.querySelectorAll(e)):a.evalXPath(".//".concat(e),t)},e.tagName=function(t){return t.tagName.toUpperCase()},e.cloneNode=function(t){return t.cloneNode(!0)},e.serializeXml=function(t){return(new i.default.xmldom.XMLSerializer).serializeToString(t)}},6617:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,Q=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){Q=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(Q)throw o}}return i}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:"";return T(this,o),(t=n.call(this)).message=e,t.name="SRE Error",t}return Q(o)}(u(Error));e.SREError=L;var v=function(){function t(){T(this,t),this.customLoader=null,this.parsers={},this.comparator=null,this.mode=d.Mode.SYNC,this.init=!0,this.delay=!1,this.comparators={},this.domain="mathspeak",this.style=h.DynamicCstr.DEFAULT_VALUES[h.Axis.STYLE],this._defaultLocale=h.DynamicCstr.DEFAULT_VALUES[h.Axis.LOCALE],this.locale=this.defaultLocale,this.subiso="",this.modality=h.DynamicCstr.DEFAULT_VALUES[h.Axis.MODALITY],this.speech=d.Speech.NONE,this.markup=d.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=t.defaultEvaluator,this.defaultParser=new h.DynamicCstrParser(h.DynamicCstr.DEFAULT_ORDER),this.parser=this.defaultParser,this.dynamicCstr=h.DynamicCstr.defaultCstr()}return Q(t,[{key:"defaultLocale",get:function(){return this._defaultLocale},set:function(t){this._defaultLocale=m.Variables.ensureLocale(t,this._defaultLocale)}},{key:"getRate",value:function(){var t=parseInt(this.rate,10);return isNaN(t)?100:t}},{key:"setDynamicCstr",value:function(t){if(this.defaultLocale&&(h.DynamicCstr.DEFAULT_VALUES[h.Axis.LOCALE]=this.defaultLocale),t)for(var e=Object.keys(t),r=0;r0&&void 0!==arguments[0]?arguments[0]:v.getInstance().locale;return t.promises[e]||Promise.resolve("")}},{key:"getall",value:function(){return Promise.all(Object.values(t.promises))}}]),t}();e.EnginePromise=b,b.loaded={},b.promises={}},6548:function(t,e){"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.DOMAIN_TO_STYLES=e.Markup=e.Speech=e.personalityPropList=e.personalityProps=e.Mode=void 0,function(t){t.SYNC="sync",t.ASYNC="async",t.HTTP="http"}(e.Mode||(e.Mode={})),function(t){t.PITCH="pitch",t.RATE="rate",t.VOLUME="volume",t.PAUSE="pause",t.JOIN="join",t.LAYOUT="layout"}(r=e.personalityProps||(e.personalityProps={})),e.personalityPropList=[r.PITCH,r.RATE,r.VOLUME,r.PAUSE,r.JOIN],function(t){t.NONE="none",t.SHALLOW="shallow",t.DEEP="deep"}(e.Speech||(e.Speech={})),function(t){t.NONE="none",t.LAYOUT="layout",t.PUNCTUATION="punctuation",t.SSML="ssml",t.SSML_STEP="ssml_step",t.ACSS="acss",t.SABLE="sable",t.VOICEXML="voicexml"}(e.Markup||(e.Markup={})),e.DOMAIN_TO_STYLES={mathspeak:"default",clearspeak:"default"}},263:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},Q=a.iterator||"@@iterator",T=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),Q=new V(n||[]);return i(a,"_invoke",{value:H(t,r,Q)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function p(){}function h(){}function d(){}var y={};u(y,Q,(function(){return this}));var m=Object.getPrototypeOf,L=m&&m(m(E([])));L&&L!==e&&r.call(L,Q)&&(y=L);var v=d.prototype=p.prototype=Object.create(y);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){function o(i,a,Q,T){var s=l(t[i],t,a);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==n(c)&&r.call(c,"__await")?e.resolve(c.__await).then((function(t){o("next",t,Q,T)}),(function(t){o("throw",t,Q,T)})):e.resolve(c).then((function(t){u.value=t,Q(u)}),(function(t){return o("throw",t,Q,T)}))}T(s.arg)}var a;i(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return a=a?a.then(n,n):n()}})}function H(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return _()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var Q=O(a,r);if(Q){if(Q===f)continue;return Q}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var T=l(t,e,r);if("normal"===T.type){if(n=r.done?"completed":"suspendedYield",T.arg===f)continue;return{value:T.arg,done:r.done}}"throw"===T.type&&(n="completed",r.method="throw",r.arg=T.arg)}}}function O(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,O(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=l(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function M(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function V(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function E(t){if(t){var e=t[Q];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var Q=r.call(i,"catchLoc"),T=r.call(i,"finallyLoc");if(Q&&T){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}var i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{T(n.next(t))}catch(t){i(t)}}function Q(t){try{T(n.throw(t))}catch(t){i(t)}}function T(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,Q)}T((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.setup=void 0;var a=r(1985),Q=r(4017),T=r(1085),s=r(2868),u=r(6617),c=r(5124),l=r(7586);function f(t){t.isIE=T.detectIE(),t.isEdge=T.detectEdge()}e.setup=function(t){return i(this,void 0,void 0,o().mark((function e(){var r,n,i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=u.default.getInstance(),"default"!==t.domain||"speech"!==t.modality&&t.modality&&"speech"!==r.modality||(t.domain="mathspeak"),n=function(e){void 0!==t[e]&&(r[e]=!!t[e])},(i=function(e){void 0!==t[e]&&(r[e]=t[e])})("mode"),r.configurate(t),u.default.BINARY_FEATURES.forEach(n),u.default.STRING_FEATURES.forEach(i),t.debug&&s.Debugger.getInstance().init(),t.json&&(l.default.jsonPath=c.makePath(t.json)),t.xpath&&(l.default.WGXpath=t.xpath),r.setCustomLoader(t.custom),f(r),a.setLocale(),r.setDynamicCstr(),!r.init){e.next=19;break}return u.EnginePromise.promises.init=new Promise((function(t,e){setTimeout((function(){t("init")}),10)})),r.init=!1,e.abrupt("return",u.EnginePromise.get());case 19:if(!r.delay){e.next=22;break}return r.delay=!1,e.abrupt("return",u.EnginePromise.get());case 22:return e.abrupt("return",Q.loadLocale());case 23:case"end":return e.stop()}}),e)})))}},7943:function(t,e){"use strict";function r(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:"json";return o(n.default.jsonPath)+t+(e.match(/^\./)?e:"."+e)}},6214:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function i(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Q(t);if(e){var o=Q(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Q(t){return Q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Q(t)}function T(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r".concat(r,"").concat(o,""))}}))},9530:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},Q=a.iterator||"@@iterator",T=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),Q=new V(n||[]);return i(a,"_invoke",{value:H(t,r,Q)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function p(){}function h(){}function d(){}var y={};u(y,Q,(function(){return this}));var m=Object.getPrototypeOf,L=m&&m(m(E([])));L&&L!==e&&r.call(L,Q)&&(y=L);var v=d.prototype=p.prototype=Object.create(y);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){function o(i,a,Q,T){var s=l(t[i],t,a);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==n(c)&&r.call(c,"__await")?e.resolve(c.__await).then((function(t){o("next",t,Q,T)}),(function(t){o("throw",t,Q,T)})):e.resolve(c).then((function(t){u.value=t,Q(u)}),(function(t){return o("throw",t,Q,T)}))}T(s.arg)}var a;i(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return a=a?a.then(n,n):n()}})}function H(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return _()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var Q=O(a,r);if(Q){if(Q===f)continue;return Q}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var T=l(t,e,r);if("normal"===T.type){if(n=r.done?"completed":"suspendedYield",T.arg===f)continue;return{value:T.arg,done:r.done}}"throw"===T.type&&(n="completed",r.method="throw",r.arg=T.arg)}}}function O(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,O(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=l(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function M(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function V(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function E(t){if(t){var e=t[Q];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var Q=r.call(i,"catchLoc"),T=r.call(i,"finallyLoc");if(Q&&T){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}var i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{T(n.next(t))}catch(t){i(t)}}function Q(t){try{T(n.throw(t))}catch(t){i(t)}}function T(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,Q)}T((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.localePath=e.exit=e.move=e.walk=e.processFile=e.file=e.vulgar=e.numericOrdinal=e.ordinal=e.number=e.toEnriched=e.toDescription=e.toJson=e.toSemantic=e.toSpeech=e.localeLoader=e.engineReady=e.engineSetup=e.setupEngine=e.version=void 0;var a=r(6617),Q=r(263),T=r(6548),s=r(5124),u=r(2218),c=r(7586),l=r(4896),f=r(4017);function p(t){return i(this,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,Q.setup)(t));case 1:case"end":return e.stop()}}),e)})))}function h(t,e){return u.process(t,e)}function d(t,e,r){switch(a.default.getInstance().mode){case T.Mode.ASYNC:return function(t,e,r){return i(this,void 0,void 0,o().mark((function n(){var i,Q;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,c.default.fs.promises.readFile(e,{encoding:"utf8"});case 2:if(i=n.sent,Q=u.output(t,i),!r){n.next=12;break}n.prev=5,c.default.fs.promises.writeFile(r,Q),n.next=12;break;case 9:throw n.prev=9,n.t0=n.catch(5),new a.SREError("Can not write to file: "+r);case 12:return n.abrupt("return",Q);case 13:case"end":return n.stop()}}),n,null,[[5,9]])})))}(t,e,r);case T.Mode.SYNC:return function(t,e,r){var n=function(t){var e;try{e=c.default.fs.readFileSync(t,{encoding:"utf8"})}catch(e){throw new a.SREError("Can not open file: "+t)}return e}(e),o=u.output(t,n);if(r)try{c.default.fs.writeFileSync(r,o)}catch(t){throw new a.SREError("Can not write to file: "+r)}return o}(t,e,r);default:throw new a.SREError("Can process files in ".concat(a.default.getInstance().mode," mode"))}}e.version=l.Variables.VERSION,e.setupEngine=p,e.engineSetup=function(){var t=["mode"].concat(a.default.STRING_FEATURES,a.default.BINARY_FEATURES),e=a.default.getInstance(),r={};return t.forEach((function(t){r[t]=e[t]})),r.json=c.default.jsonPath,r.xpath=c.default.WGXpath,r.rules=e.ruleSets.slice(),r},e.engineReady=function(){return i(this,void 0,void 0,o().mark((function t(){return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",p({}).then((function(){return a.EnginePromise.getall()})));case 1:case"end":return t.stop()}}),t)})))},e.localeLoader=f.standardLoader,e.toSpeech=function(t){return h("speech",t)},e.toSemantic=function(t){return h("semantic",t)},e.toJson=function(t){return h("json",t)},e.toDescription=function(t){return h("description",t)},e.toEnriched=function(t){return h("enriched",t)},e.number=function(t){return h("number",t)},e.ordinal=function(t){return h("ordinal",t)},e.numericOrdinal=function(t){return h("numericOrdinal",t)},e.vulgar=function(t){return h("vulgar",t)},e.file={},e.file.toSpeech=function(t,e){return d("speech",t,e)},e.file.toSemantic=function(t,e){return d("semantic",t,e)},e.file.toJson=function(t,e){return d("json",t,e)},e.file.toDescription=function(t,e){return d("description",t,e)},e.file.toEnriched=function(t,e){return d("enriched",t,e)},e.processFile=d,e.walk=function(t){return u.output("walker",t)},e.move=function(t){return u.keypress("move",t)},e.exit=function(t){var e=t||0;a.EnginePromise.getall().then((function(){return process.exit(e)}))},e.localePath=s.localePath,c.default.documentSupported?p({mode:T.Mode.HTTP}).then((function(){return p({})})):p({mode:T.Mode.SYNC}).then((function(){return p({mode:T.Mode.ASYNC})}))},7586:function(__unused_webpack_module,exports,__webpack_require__){"use strict";var __dirname="/";function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var r=0;r0;)n.appendChild(r.childNodes[0]);r.appendChild(n),r=n}return r}},{key:"fullFence",value:function(t){for(var e=this.fencedMml.parentNode,r=t;r.parentNode&&r.parentNode!==e;)r=r.parentNode;return r}},{key:"cleanupParents_",value:function(){this.parentCleanup.forEach((function(t){var e=t.childNodes[1].getAttribute(d.Attribute.PARENT);t.childNodes[0].setAttribute(d.Attribute.PARENT,e)}))}}])&&o(e.prototype,r),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),T}(c.AbstractEnrichCase);e.CaseEmbellished=y},4051:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r=3&&(this.mml=c.introduceNewLayer([this.mml],this.semantic)),(0,l.setAttributes)(this.mml,this.semantic),t[0].mathmlTree||(t[0].mathmlTree=this.semantic.mathmlTree),t.forEach(T.walkTree_),this.mml}}])&&o(e.prototype,r),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),T}(u.AbstractEnrichCase);e.CaseLimit=f},3874:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r$/)||(t+=""),t}r(9790),e.semanticMathmlNode=T,e.semanticMathmlSync=s,e.semanticMathml=function(t,e){i.EnginePromise.getall().then((function(){var r=o.parseInput(t);e(T(r))}))},e.testTranslation=function(t){n.Debugger.getInstance().init();var e=s(u(t));return n.Debugger.getInstance().exit(),e},e.prepareMmlString=u},8418:function(t,e){"use strict";var r;function n(t){return t.map((function(t){return t.id})).join(",")}function o(t,e){var n=[];"mglyph"===e.role&&n.push("image"),e.attributes.href&&n.push("link"),n.length&&t.setAttribute(r.POSTFIX,n.join(" "))}Object.defineProperty(e,"__esModule",{value:!0}),e.addPrefix=e.removeAttributePrefix=e.setPostfix=e.setAttributes=e.makeIdList=e.EnrichAttributes=e.Attribute=e.Prefix=void 0,e.Prefix="data-semantic-",function(t){t.ADDED="data-semantic-added",t.ALTERNATIVE="data-semantic-alternative",t.CHILDREN="data-semantic-children",t.COLLAPSED="data-semantic-collapsed",t.CONTENT="data-semantic-content",t.EMBELLISHED="data-semantic-embellished",t.FENCEPOINTER="data-semantic-fencepointer",t.FONT="data-semantic-font",t.ID="data-semantic-id",t.ANNOTATION="data-semantic-annotation",t.ATTRIBUTES="data-semantic-attributes",t.OPERATOR="data-semantic-operator",t.OWNS="data-semantic-owns",t.PARENT="data-semantic-parent",t.POSTFIX="data-semantic-postfix",t.PREFIX="data-semantic-prefix",t.ROLE="data-semantic-role",t.SPEECH="data-semantic-speech",t.STRUCTURE="data-semantic-structure",t.TYPE="data-semantic-type"}(r=e.Attribute||(e.Attribute={})),e.EnrichAttributes=[r.ADDED,r.ALTERNATIVE,r.CHILDREN,r.COLLAPSED,r.CONTENT,r.EMBELLISHED,r.FENCEPOINTER,r.FONT,r.ID,r.ANNOTATION,r.ATTRIBUTES,r.OPERATOR,r.OWNS,r.PARENT,r.POSTFIX,r.PREFIX,r.ROLE,r.SPEECH,r.STRUCTURE,r.TYPE],e.makeIdList=n,e.setAttributes=function(t,i){t.setAttribute(r.TYPE,i.type);for(var a,Q=i.allAttributes(),T=0;a=Q[T];T++)t.setAttribute(e.Prefix+a[0].toLowerCase(),a[1]);i.childNodes.length&&t.setAttribute(r.CHILDREN,n(i.childNodes)),i.contentNodes.length&&t.setAttribute(r.CONTENT,n(i.contentNodes)),i.parent&&t.setAttribute(r.PARENT,i.parent.id.toString());var s=i.attributesXml();s&&t.setAttribute(r.ATTRIBUTES,s),o(t,i)},e.setPostfix=o,e.removeAttributePrefix=function(t){return t.toString().replace(new RegExp(e.Prefix,"g"),"")},e.addPrefix=function(t){return e.Prefix+t}},7566:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.factory=e.getCase=void 0,e.getCase=function(t){for(var r,n=0;r=e.factory[n];n++)if(r.test(t))return r.constr(t);return null},e.factory=[]},9790:function(t,e,r){"use strict";var n;Object.defineProperty(e,"__esModule",{value:!0});var o=r(7447),i=r(1640),a=r(134),Q=r(4051),T=r(3874),s=r(643),u=r(3686),c=r(7633),l=r(8719),f=r(1822);(n=r(7566).factory).push.apply(n,[{test:Q.CaseLimit.test,constr:function(t){return new Q.CaseLimit(t)}},{test:a.CaseEmbellished.test,constr:function(t){return new a.CaseEmbellished(t)}},{test:i.CaseDoubleScript.test,constr:function(t){return new i.CaseDoubleScript(t)}},{test:l.CaseTensor.test,constr:function(t){return new l.CaseTensor(t)}},{test:s.CaseMultiscripts.test,constr:function(t){return new s.CaseMultiscripts(t)}},{test:T.CaseLine.test,constr:function(t){return new T.CaseLine(t)}},{test:o.CaseBinomial.test,constr:function(t){return new o.CaseBinomial(t)}},{test:u.CaseProof.test,constr:function(t){return new u.CaseProof(t)}},{test:c.CaseTable.test,constr:function(t){return new c.CaseTable(t)}},{test:f.CaseText.test,constr:function(t){return new f.CaseText(t)}}])},8327:function(t,e,r){"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,Q=!0,T=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return Q=t.done,t},e:function(t){T=!0,a=t},f:function(){try{Q||null==r.return||r.return()}finally{if(T)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r2&&void 0!==arguments[2]&&arguments[2],n=f.removeAttributePrefix(Q.formatXml(t.toString()));return r?e+":\n```html\n"+n+"\n```\n":n}e.SETTINGS={collapsed:!0,implicit:!0,wiki:!0},e.enrich=function(t,r){var n=Q.cloneNode(t);return h(r.root),T.default.getInstance().structure&&t.setAttribute(f.Attribute.STRUCTURE,c.SemanticSkeleton.fromStructure(t,r).toString()),a.Debugger.getInstance().generateOutput((function(){return[B(n,"Original MathML",e.SETTINGS.wiki),B(r,"Semantic Tree",e.SETTINGS.wiki),B(t,"Semantically enriched MathML",e.SETTINGS.wiki)]})),t},e.walkTree=h,e.introduceNewLayer=d,e.introduceLayerAboveLca=y,e.moveSemanticAttributes_=m,e.childrenSubset_=L,e.collateChildNodes_=v,e.collectChildNodes_=b,e.mergeChildren_=g,e.insertNewChild_=H,e.isDescendant_=O,e.functionApplication_=M,function(t){t.VALID="valid",t.INVALID="invalid",t.PRUNED="pruned"}(i=e.lcaType||(e.lcaType={})),e.mathmlLca_=S,e.prunePath_=V,e.attachedElement_=E,e.pathToRoot_=_,e.validLca_=x,e.ascendNewNode=w,e.descendNode_=A,e.unitChild_=C,e.isIgnorable_=N,e.parentNode_=P,e.addCollapsedAttribute=function(t,e){var r=new c.SemanticSkeleton(e);t.setAttribute(f.Attribute.COLLAPSED,r.toString())},e.cloneContentNode=k,e.rewriteMfenced=R,e.createInvisibleOperator_=I,e.setOperatorAttribute_=j,e.getInnerNode=D,e.collapsePunctuated=function(t,e){var r=!!e,n=e||[],o=t.parent,i=t.contentNodes.map((function(t){return t.id}));i.unshift("c");for(var a,Q=[t.id,i],T=0;a=t.childNodes[T];T++){var s=h(a);n.push(s);var u=D(s);o&&!r&&u.setAttribute(f.Attribute.PARENT,o.id.toString()),Q.push(a.id)}return Q},e.printNodeList__=function(t,e){console.info(t),Q.toArray(e).forEach((function(t){console.info(t.toString())})),console.info("<<<<<<<<<<<<<<<<<")}},473:function(t,e,r){"use strict";function n(t,e){for(var r=0;r0;)this.unhighlight()}},{key:"setColor",value:function(t){this.color=t}},{key:"colorString",value:function(){return this.color.rgba()}},{key:"addEvents",value:function(t,e){for(var r,n=this.getMactionNodes(t),o=0;r=n[o];o++)for(var i in e)r.addEventListener(i,e[i])}},{key:"getMactionNodes",value:function(t){return Array.from(t.getElementsByClassName(this.mactionName))}},{key:"isMactionNode",value:function(t){var e=t.className||t.getAttribute("class");return!!e&&!!e.match(new RegExp(this.mactionName))}},{key:"isHighlighted",value:function(e){return e.hasAttribute(t.ATTR)}},{key:"setHighlighted",value:function(e){e.setAttribute(t.ATTR,"true")}},{key:"unsetHighlighted",value:function(e){e.removeAttribute(t.ATTR)}},{key:"colorizeAll",value:function(t){var e=this;o.evalXPath(".//*[@".concat(i.Attribute.ID,"]"),t).forEach((function(t){return e.colorize(t)}))}},{key:"uncolorizeAll",value:function(t){var e=this;o.evalXPath(".//*[@".concat(i.Attribute.ID,"]"),t).forEach((function(t){return e.uncolorize(t)}))}},{key:"colorize",value:function(t){var e=(0,i.addPrefix)("foreground");t.hasAttribute(e)&&(t.setAttribute(e+"-old",t.style.color),t.style.color=t.getAttribute(e))}},{key:"uncolorize",value:function(t){var e=(0,i.addPrefix)("foreground")+"-old";t.hasAttribute(e)&&(t.style.color=t.getAttribute(e))}}])&&n(e.prototype,r),a&&n(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.AbstractHighlighter=a,a.ATTR="sre-highlight"},9781:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r1?e/100:e,r=r>1?r/100:r;var n=(1-Math.abs(2*r-1))*e,o=n*(1-Math.abs(t/60%2-1)),i=r-n/2,a=0,Q=0,T=0;return 0<=t&&t<60?(a=n,Q=o,T=0):60<=t&&t<120?(a=o,Q=n,T=0):120<=t&&t<180?(a=0,Q=n,T=o):180<=t&&t<240?(a=0,Q=o,T=n):240<=t&&t<300?(a=o,Q=0,T=n):300<=t&&t<360&&(a=n,Q=0,T=o),{red:a+i,green:Q+i,blue:T+i}}(this.hue,this.sat,this.light),"rgb("+(t={red:Math.round(255*e.red),green:Math.round(255*e.green),blue:Math.round(255*e.blue)}).red+","+t.green+","+t.blue+")";var t,e}},{key:"increment",value:function(){this.hue=(this.hue+this.incr)%360}}]),t}();e.ContrastPicker=T},7388:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r "+this.getRule().action:this.constraint}}]),r}(f);e.StaticTrieNode=p},4865:function(t,e,r){"use strict";function n(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r":function(t,e){return t>e},"<=":function(t,e){return t<=e},">=":function(t,e){return t>=e}};function O(t){if(t.match(/^self::\*$/))return function(t){return!0};if(t.match(/^self::\w+$/)){var e=t.slice(6).toUpperCase();return function(t){return t.tagName&&p.tagName(t)===e}}if(t.match(/^self::\w+:\w+$/)){var r=t.split(":"),n=h.resolveNameSpace(r[2]);if(!n)return null;var i=r[3].toUpperCase();return function(t){return t.localName&&t.localName.toUpperCase()===i&&t.namespaceURI===n}}if(t.match(/^@\w+$/)){var a=t.slice(1);return function(t){return t.hasAttribute&&t.hasAttribute(a)}}if(t.match(/^@\w+="[\w\d ]+"$/)){var Q=t.split("="),T=Q[0].slice(1),s=Q[1].slice(1,-1);return function(t){return t.hasAttribute&&t.hasAttribute(T)&&t.getAttribute(T)===s}}if(t.match(/^@\w+!="[\w\d ]+"$/)){var u=t.split("!="),c=u[0].slice(1),l=u[1].slice(1,-1);return function(t){return!t.hasAttribute||!t.hasAttribute(c)||t.getAttribute(c)!==l}}if(t.match(/^contains\(\s*@grammar\s*,\s*"[\w\d ]+"\s*\)$/)){var f=t.split('"')[1];return function(t){return!!d.Grammar.getInstance().getParameter(f)}}if(t.match(/^not\(\s*contains\(\s*@grammar\s*,\s*"[\w\d ]+"\s*\)\s*\)$/)){var m=t.split('"')[1];return function(t){return!d.Grammar.getInstance().getParameter(m)}}if(t.match(/^name\(\.\.\/\.\.\)="\w+"$/)){var L=t.split('"')[1].toUpperCase();return function(t){var e,r;return(null===(r=null===(e=t.parentNode)||void 0===e?void 0:e.parentNode)||void 0===r?void 0:r.tagName)&&p.tagName(t.parentNode.parentNode)===L}}if(t.match(/^count\(preceding-sibling::\*\)=\d+$/)){var v=t.split("="),b=parseInt(v[1],10);return function(t){var e;return(null===(e=t.parentNode)||void 0===e?void 0:e.childNodes[b])===t}}if(t.match(/^.+\[@category!?=".+"\]$/)){var g=o(t.match(/^(.+)\[@category(!?=)"(.+)"\]$/),4),O=g[1],M=g[2],S=g[3],V=S.match(/^unit:(.+)$/),E="";return V&&(S=V[1],E=":unit"),function(t){var e=h.evalXPath(O,t)[0];if(e){var r=y.lookupCategory(e.textContent+E);return"="===M?r===S:r!==S}return!1}}if(t.match(/^string-length\(.+\)\W+\d+/)){var _=o(t.match(/^string-length\((.+)\)(\W+)(\d+)/),4),x=_[1],w=_[2],A=_[3],C=H[w]||H["="],N=parseInt(A,10);return function(t){var e=h.evalXPath(x,t)[0];return!!e&&C(Array.from(e.textContent).length,N)}}return null}e.constraintTest_=O;var M=function(t){s(r,t);var e=c(r);function r(t,n){var o;return T(this,r),(o=e.call(this,t,O(t))).context=n,o.kind=v.TrieNodeKind.QUERY,o}return Q(r,[{key:"applyTest",value:function(t){return this.test?this.test(t):this.context.applyQuery(t,this.constraint)===t}}]),r}(L.StaticTrieNode);e.QueryTrieNode=M;var S=function(t){s(r,t);var e=c(r);function r(t,n){var o;return T(this,r),(o=e.call(this,t,O(t))).context=n,o.kind=v.TrieNodeKind.BOOLEAN,o}return Q(r,[{key:"applyTest",value:function(t){return this.test?this.test(t):this.context.applyConstraint(t,this.constraint)}}]),r}(L.StaticTrieNode);e.BooleanTrieNode=S},1985:function(t,e,r){"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,Q=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){Q=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(Q)throw o}}return i}(t,e)||o(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,Q=!0,T=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return Q=t.done,t},e:function(t){T=!0,a=t},f:function(){try{Q||null==r.return||r.return()}finally{if(T)throw a}}}}(Object.getOwnPropertyNames(t));try{for(r.s();!(e=r.n()).done;){var i=e.value;b.LOCALE[i]=t[i]}}catch(t){r.e(t)}finally{r.f()}for(var Q=0,s=Object.entries(t.CORRECTIONS);Q1?t.NUMBERS.numberToWords(e)+"fach":""},t.FUNCTIONS.combineRootIndex=function(t,e){var r=e?e+"wurzel":"";return t.replace("Wurzel",r)},t.FUNCTIONS.combineNestedRadical=function(t,e,r){var n=(e?e+" ":"")+(t=r.match(/exponent$/)?t+"r":t);return r.match(/ /)?r.replace(/ /," "+n+" "):n+" "+r},t.FUNCTIONS.fontRegexp=function(t){return t=t.split(" ").map((function(t){return t.replace(/s$/,"(|s)")})).join(" "),new RegExp("((^"+t+" )|( "+t+"$))")},t.CORRECTIONS.correctOne=function(t){return t.replace(/^eins$/,"ein")},t.CORRECTIONS.localFontNumber=function(t){return(0,o.localFont)(t).split(" ").map((function(t){return t.replace(/s$/,"")})).join(" ")},t.CORRECTIONS.lowercase=function(t){return t.toLowerCase()},t.CORRECTIONS.article=function(t){var e=n.Grammar.getInstance().getParameter("case"),r=n.Grammar.getInstance().getParameter("plural");return"dative"===e?{der:"dem",die:r?"den":"der",das:"dem"}[t]:t},t.CORRECTIONS.masculine=function(t){return"dative"===n.Grammar.getInstance().getParameter("case")?t+"n":t},s=t),s}},8852:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.en=void 0;var n=r(3966),o=r(3200),i=r(7552),a=r(3802),Q=r(1531),T=null;e.en=function(){var t;return T||((t=(0,o.createLocale)()).NUMBERS=a.default,t.FUNCTIONS.radicalNestDepth=i.nestingToString,t.FUNCTIONS.plural=function(t){return/.*s$/.test(t)?t:t+"s"},t.ALPHABETS.combiner=Q.Combiners.prefixCombiner,t.ALPHABETS.digitTrans.default=a.default.numberToWords,t.CORRECTIONS.article=function(t){return n.Grammar.getInstance().getParameter("noArticle")?"":t},T=t),T}},5268:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.es=void 0;var n=r(3200),o=r(7552),i=r(207),a=r(1531),Q=function(t,e,r){return t="sans serif "+(r?r+" "+t:t),e?t+" "+e:t},T=null;e.es=function(){var t;return T||((t=(0,n.createLocale)()).NUMBERS=i.default,t.COMBINERS.sansserif=Q,t.FUNCTIONS.fracNestDepth=function(t){return!1},t.FUNCTIONS.combineRootIndex=o.combinePostfixIndex,t.FUNCTIONS.combineNestedRadical=function(t,e,r){return t+r},t.FUNCTIONS.fontRegexp=function(t){return RegExp("^"+t+" ")},t.FUNCTIONS.plural=function(t){return/.*(a|e|i|o|u)$/.test(t)?t+"s":/.*z$/.test(t)?t.slice(0,-1)+"ces":/.*c$/.test(t)?t.slice(0,-1)+"ques":/.*g$/.test(t)?t+"ues":/.*\u00f3n$/.test(t)?t.slice(0,-2)+"ones":t+"es"},t.FUNCTIONS.si=function(t,e){return e.match(/^metro/)&&(t=t.replace(/a$/,"\xe1").replace(/o$/,"\xf3").replace(/i$/,"\xed")),t+e},t.ALPHABETS.combiner=a.Combiners.prefixCombiner,T=t),T}},797:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fr=void 0;var n=r(3966),o=r(3200),i=r(7552),a=r(2814),Q=r(1531),T=null;e.fr=function(){var t;return T||((t=(0,o.createLocale)()).NUMBERS=a.default,t.FUNCTIONS.radicalNestDepth=i.nestingToString,t.FUNCTIONS.combineRootIndex=i.combinePostfixIndex,t.FUNCTIONS.combineNestedFraction=function(t,e,r){return r.replace(/ $/g,"")+e+t},t.FUNCTIONS.combineNestedRadical=function(t,e,r){return r+" "+t},t.FUNCTIONS.fontRegexp=function(t){return RegExp(" (en |)"+t+"$")},t.FUNCTIONS.plural=function(t){return/.*s$/.test(t)?t:t+"s"},t.CORRECTIONS.article=function(t){return n.Grammar.getInstance().getParameter("noArticle")?"":t},t.ALPHABETS.combiner=Q.Combiners.romanceCombiner,t.SUBISO={default:"fr",current:"fr",all:["fr","be","ch"]},T=t),T}},5571:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hi=void 0;var n=r(3200),o=r(7645),i=r(1531),a=r(7552),Q=null;e.hi=function(){var t;return Q||((t=(0,n.createLocale)()).NUMBERS=o.default,t.ALPHABETS.combiner=i.Combiners.prefixCombiner,t.FUNCTIONS.radicalNestDepth=a.nestingToString,Q=t),Q}},3626:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.it=void 0;var n=r(7552),o=r(3200),i=r(8634),a=r(1531),Q=function(t,e,r){return t.match(/^[a-zA-Z]$/)&&(e=e.replace("cerchiato","cerchiata")),t=r?t+" "+r:t,e?t+" "+e:t},T=null;e.it=function(){var t;return T||((t=(0,o.createLocale)()).NUMBERS=i.default,t.COMBINERS.italianPostfix=Q,t.FUNCTIONS.radicalNestDepth=n.nestingToString,t.FUNCTIONS.combineRootIndex=n.combinePostfixIndex,t.FUNCTIONS.combineNestedFraction=function(t,e,r){return r.replace(/ $/g,"")+e+t},t.FUNCTIONS.combineNestedRadical=function(t,e,r){return r+" "+t},t.FUNCTIONS.fontRegexp=function(t){return RegExp(" (en |)"+t+"$")},t.ALPHABETS.combiner=a.Combiners.romanceCombiner,T=t),T}},469:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.nb=void 0;var n=r(3200),o=r(7552),i=r(1717),a=r(1531),Q=null;e.nb=function(){var t;return Q||((t=(0,n.createLocale)()).NUMBERS=i.default,t.ALPHABETS.combiner=a.Combiners.prefixCombiner,t.ALPHABETS.digitTrans.default=i.default.numberToWords,t.FUNCTIONS.radicalNestDepth=o.nestingToString,Q=t),Q}},6849:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.nemeth=void 0;var n=r(3200),o=r(3203),i=r(1531),a=function(t){return t.match(RegExp("^"+l.ALPHABETS.languagePrefix.english))?t.slice(1):t},Q=function(t,e,r){return t=a(t),e?t+e:t},T=function(t,e,r){return e+a(t)},s=function(t,e,r){return e+(r||"")+(t=a(t))+"\u283b"},u=function(t,e,r){return e+(r||"")+(t=a(t))+"\u283b\u283b"},c=function(t,e,r){return e+(t=a(t))+"\u283e"},l=null;e.nemeth=function(){var t;return l||((t=(0,n.createLocale)()).NUMBERS=o.default,t.COMBINERS={postfixCombiner:Q,germanCombiner:T,embellishCombiner:s,doubleEmbellishCombiner:u,parensCombiner:c},t.FUNCTIONS.fracNestDepth=function(t){return!1},t.FUNCTIONS.fontRegexp=function(t){return RegExp("^"+t)},t.FUNCTIONS.si=i.identityTransformer,t.ALPHABETS.combiner=function(t,e,r){return e?e+r+t:a(t)},t.ALPHABETS.digitTrans={default:o.default.numberToWords},l=t),l}},7322:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.nn=void 0;var n=r(3200),o=r(7552),i=r(1717),a=r(1531),Q=null;e.nn=function(){var t;return Q||((t=(0,n.createLocale)()).NUMBERS=i.default,t.ALPHABETS.combiner=a.Combiners.prefixCombiner,t.ALPHABETS.digitTrans.default=i.default.numberToWords,t.FUNCTIONS.radicalNestDepth=o.nestingToString,t.SUBISO={default:"",current:"",all:["","alt"]},Q=t),Q}},4699:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sv=void 0;var n=r(3200),o=r(7552),i=r(5205),a=r(1531),Q=null;e.sv=function(){var t;return Q||((t=(0,n.createLocale)()).NUMBERS=i.default,t.FUNCTIONS.radicalNestDepth=o.nestingToString,t.FUNCTIONS.fontRegexp=function(t){return new RegExp("((^"+t+" )|( "+t+"$))")},t.ALPHABETS.combiner=a.Combiners.prefixCombiner,t.ALPHABETS.digitTrans.default=i.default.numberToWords,t.CORRECTIONS.correctOne=function(t){return t.replace(/^ett$/,"en")},Q=t),Q}},7869:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SUBISO=e.FUNCTIONS=e.ALPHABETS=e.NUMBERS=e.MESSAGES=void 0;var n=r(1531);e.MESSAGES=function(){return{MS:{},MSroots:{},font:{},embellish:{},role:{},enclose:{},navigate:{},regexp:{},unitTimes:""}},e.NUMBERS=function(){return{zero:"zero",ones:[],tens:[],large:[],special:{},wordOrdinal:n.identityTransformer,numericOrdinal:n.identityTransformer,numberToWords:n.identityTransformer,numberToOrdinal:n.pluralCase,vulgarSep:" ",numSep:" "}},e.ALPHABETS=function(){return{latinSmall:[],latinCap:[],greekSmall:[],greekCap:[],capPrefix:{default:""},smallPrefix:{default:""},digitPrefix:{default:""},languagePrefix:{},digitTrans:{default:n.identityTransformer,mathspeak:n.identityTransformer,clearspeak:n.identityTransformer},letterTrans:{default:n.identityTransformer},combiner:function(t,e,r){return t}}},e.FUNCTIONS=function(){return{fracNestDepth:function(t){return n.vulgarFractionSmall(t,10,100)},radicalNestDepth:function(t){return""},combineRootIndex:function(t,e){return t},combineNestedFraction:n.Combiners.identityCombiner,combineNestedRadical:n.Combiners.identityCombiner,fontRegexp:function(t){return new RegExp("^"+t.split(/ |-/).join("( |-)")+"( |-)")},si:n.siCombiner,plural:n.identityTransformer}},e.SUBISO=function(){return{default:"",current:"",all:[]}}},5627:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3966);function o(t){var e=t%1e3,r=Math.floor(e/100),n=r?1===r?"cent":Q.ones[r]+"-cents":"",o=function(t){var e=t%100;if(e<20)return Q.ones[e];var r=Math.floor(e/10),n=Q.tens[r],o=Q.ones[e%10];return n&&o?n+(2===r?"-i-":"-")+o:n||o}(e%100);return n&&o?n+Q.numSep+o:n||o}function i(t){if(0===t)return Q.zero;if(t>=Math.pow(10,36))return t.toString();for(var e=0,r="";t>0;){var n=t%(e>1?1e6:1e3);if(n){var a=Q.large[e];if(e)if(1===e)r=(1===n?"":o(n)+Q.numSep)+a+(r?Q.numSep+r:"");else{var T=i(n);a=1===n?a:a.replace(/\u00f3$/,"ons"),r=T+Q.numSep+a+(r?Q.numSep+r:"")}else r=o(n)}t=Math.floor(t/(e>1?1e6:1e3)),e++}return r}function a(t){var e=n.Grammar.getInstance().getParameter("gender");return t.toString()+("f"===e?"a":"n")}var Q=(0,r(7869).NUMBERS)();Q.numericOrdinal=a,Q.numberToWords=i,Q.numberToOrdinal=function(t,e){if(t>1999)return a(t);if(t<=10)return Q.special.onesOrdinals[t-1];var r=i(t);return r.match(/mil$/)?r.replace(/mil$/,"mil\xb7l\xe8sima"):r.match(/u$/)?r.replace(/u$/,"vena"):r.match(/a$/)?r.replace(/a$/,"ena"):r+(r.match(/e$/)?"na":"ena")},e.default=Q},3054:function(t,e,r){"use strict";function n(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t===Q.ones[1]?e?"et":"en":t}function o(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t%1e3,o="",i=Q.ones[Math.floor(r/100)];if(o+=i?n(i,!0)+" hundrede":"",r%=100)if(o+=o?" og ":"",i=e?Q.special.smallOrdinals[r]:Q.ones[r])o+=i;else{var a=e?Q.special.tensOrdinals[Math.floor(r/10)]:Q.tens[Math.floor(r/10)];o+=(i=Q.ones[r%10])?n(i)+"og"+a:a}return o}function i(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(0===t)return Q.zero;if(t>=Math.pow(10,36))return t.toString();for(var r=0,i="";t>0;){var a=t%1e3;if(a){var T=o(a,e&&!r);if(r){var s=Q.large[r],u=a>1?"er":"";i=n(T,r<=1)+" "+s+u+(i?" og ":"")+i}else i=n(T)+i}t=Math.floor(t/1e3),r++}return i}function a(t){if(t%100)return i(t,!0);var e=i(t);return e.match(/e$/)?e:e+"e"}Object.defineProperty(e,"__esModule",{value:!0});var Q=(0,r(7869).NUMBERS)();Q.wordOrdinal=a,Q.numericOrdinal=function(t){return t.toString()+"."},Q.numberToWords=i,Q.numberToOrdinal=function(t,e){return 1===t?e?"hel":"hele":2===t?e?"halv":"halve":a(t)+(e?"dele":"del")},e.default=Q},2818:function(t,e,r){"use strict";function n(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t===Q.ones[1]?e?"eine":"ein":t}function o(t){var e=t%1e3,r="",o=Q.ones[Math.floor(e/100)];if(r+=o?n(o)+"hundert":"",e%=100)if(r+=r?Q.numSep:"",o=Q.ones[e])r+=o;else{var i=Q.tens[Math.floor(e/10)];r+=(o=Q.ones[e%10])?n(o)+"und"+i:i}return r}function i(t){if(0===t)return Q.zero;if(t>=Math.pow(10,36))return t.toString();for(var e=0,r="";t>0;){var i=t%1e3;if(i){var a=o(t%1e3);if(e){var T=Q.large[e],s=e>1&&i>1?T.match(/e$/)?"n":"en":"";r=n(a,e>1)+T+s+r}else r=n(a,e>1)+r}t=Math.floor(t/1e3),e++}return r.replace(/ein$/,"eins")}function a(t){return 1===t?"erste":3===t?"dritte":7===t?"siebte":8===t?"achte":i(t)+(t<19?"te":"ste")}Object.defineProperty(e,"__esModule",{value:!0});var Q=(0,r(7869).NUMBERS)();Q.wordOrdinal=a,Q.numericOrdinal=function(t){return t.toString()+"."},Q.numberToWords=i,Q.numberToOrdinal=function(t,e){return 1===t?"eintel":2===t?e?"halbe":"halb":a(t)+"l"},e.default=Q},3802:function(t,e,r){"use strict";function n(t){var e=t%1e3,r="";return r+=a.ones[Math.floor(e/100)]?a.ones[Math.floor(e/100)]+a.numSep+"hundred":"",(e%=100)&&(r+=r?a.numSep:"",r+=a.ones[e]||a.tens[Math.floor(e/10)]+(e%10?a.numSep+a.ones[e%10]:"")),r}function o(t){if(0===t)return a.zero;if(t>=Math.pow(10,36))return t.toString();for(var e=0,r="";t>0;){t%1e3&&(r=n(t%1e3)+(e?"-"+a.large[e]+"-":"")+r),t=Math.floor(t/1e3),e++}return r.replace(/-$/,"")}function i(t){var e=o(t);return e.match(/one$/)?e=e.slice(0,-3)+"first":e.match(/two$/)?e=e.slice(0,-3)+"second":e.match(/three$/)?e=e.slice(0,-5)+"third":e.match(/five$/)?e=e.slice(0,-4)+"fifth":e.match(/eight$/)?e=e.slice(0,-5)+"eighth":e.match(/nine$/)?e=e.slice(0,-4)+"ninth":e.match(/twelve$/)?e=e.slice(0,-6)+"twelfth":e.match(/ty$/)?e=e.slice(0,-2)+"tieth":e+="th",e}Object.defineProperty(e,"__esModule",{value:!0});var a=(0,r(7869).NUMBERS)();a.wordOrdinal=i,a.numericOrdinal=function(t){var e=t%100,r=t.toString();if(e>10&&e<20)return r+"th";switch(t%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd";default:return r+"th"}},a.numberToWords=o,a.numberToOrdinal=function(t,e){if(1===t)return e?"oneths":"oneth";if(2===t)return e?"halves":"half";var r=i(t);return e?r+"s":r},e.default=a},207:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3966);function o(t){var e=t%1e3,r=Math.floor(e/100),n=i.special.hundreds[r],o=function(t){var e=t%100;if(e<30)return i.ones[e];var r=i.tens[Math.floor(e/10)],n=i.ones[e%10];return r&&n?r+" y "+n:r||n}(e%100);return 1===r?o?n+"to "+o:n:n&&o?n+" "+o:n||o}var i=(0,r(7869).NUMBERS)();i.numericOrdinal=function(t){var e=n.Grammar.getInstance().getParameter("gender");return t.toString()+("f"===e?"a":"o")},i.numberToWords=function(t){if(0===t)return i.zero;if(t>=Math.pow(10,36))return t.toString();for(var e=0,r="";t>0;){var n=t%1e3;if(n){var a=i.large[e],Q=o(n);e?1===n?r=(a=a.match("/^mil( |$)/")?a:"un "+a)+(r?" "+r:""):(a=a.replace(/\u00f3n$/,"ones"),r=o(n)+" "+a+(r?" "+r:"")):r=Q}t=Math.floor(t/1e3),e++}return r},i.numberToOrdinal=function(t,e){if(t>1999)return t.toString()+"a";if(t<=12)return i.special.onesOrdinals[t-1];var r=[];if(t>=1e3&&(t-=1e3,r.push("mil\xe9sima")),!t)return r.join(" ");var n=0;return(n=Math.floor(t/100))>0&&(r.push(i.special.hundredsOrdinals[n-1]),t%=100),t<=12?r.push(i.special.onesOrdinals[t-1]):((n=Math.floor(t/10))>0&&(r.push(i.special.tensOrdinals[n-1]),t%=10),t>0&&r.push(i.special.onesOrdinals[t-1])),r.join(" ")},e.default=i},2814:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(6617),o=r(3966),i=r(7869);function a(t){var e=t%1e3,r="";if(r+=u.ones[Math.floor(e/100)]?u.ones[Math.floor(e/100)]+"-cent":"",e%=100){r+=r?"-":"";var n=u.ones[e];if(n)r+=n;else{var o=u.tens[Math.floor(e/10)];o.match(/-dix$/)?(n=u.ones[e%10+10],r+=o.replace(/-dix$/,"")+"-"+n):r+=o+(e%10?"-"+u.ones[e%10]:"")}}var i=r.match(/s-\w+$/);return i?r.replace(/s-\w+$/,i[0].slice(1)):r.replace(/-un$/,"-et-un")}function Q(t){if(0===t)return u.zero;if(t>=Math.pow(10,36))return t.toString();u.special["tens-"+n.default.getInstance().subiso]&&(u.tens=u.special["tens-"+n.default.getInstance().subiso]);for(var e=0,r="";t>0;){var o=t%1e3;if(o){var i=u.large[e],Q=a(o);if(i&&i.match(/^mille /)){var T=i.replace(/^mille /,"");r=r.match(RegExp(T))?Q+(e?"-mille-":"")+r:r.match(RegExp(T.replace(/s$/,"")))?Q+(e?"-mille-":"")+r.replace(T.replace(/s$/,""),T):Q+(e?"-"+i+"-":"")+r}else i=1===o&&i?i.replace(/s$/,""):i,r=Q+(e?"-"+i+"-":"")+r}t=Math.floor(t/1e3),e++}return r.replace(/-$/,"")}var T={1:"uni\xe8me",2:"demi",3:"tiers",4:"quart"};function s(t){if(1===t)return"premi\xe8re";var e=Q(t);return e.match(/^neuf$/)?e=e.slice(0,-1)+"v":e.match(/cinq$/)?e+="u":e.match(/trois$/)?e+="":(e.match(/e$/)||e.match(/s$/))&&(e=e.slice(0,-1)),e+="i\xe8me"}var u=(0,i.NUMBERS)();u.wordOrdinal=s,u.numericOrdinal=function(t){var e=o.Grammar.getInstance().getParameter("gender");return 1===t?t.toString()+("m"===e?"er":"re"):t.toString()+"e"},u.numberToWords=Q,u.numberToOrdinal=function(t,e){var r=T[t]||s(t);return 3===t?r:e?r+"s":r},e.default=u},7645:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3966);function o(t){if(0===t)return a.zero;if(t>=Math.pow(10,32))return t.toString();var e=0,r="",n=function(t){var e=t%1e3,r="";return r+=a.ones[Math.floor(e/100)]?a.ones[Math.floor(e/100)]+a.numSep+a.special.hundred:"",(e%=100)&&(r+=r?a.numSep:"",r+=a.ones[e]),r}(t%1e3);if(!(t=Math.floor(t/1e3)))return n;for(;t>0;){var o=t%100;o&&(r=a.ones[o]+a.numSep+a.large[e]+(r?a.numSep+r:"")),t=Math.floor(t/100),e++}return n?r+a.numSep+n:r}function i(t){var e=n.Grammar.getInstance().getParameter("gender");return t<=0?t.toString():t<10?"f"===e?a.special.ordinalsFeminine[t]:a.special.ordinalsMasculine[t]:o(t)+("f"===e?"\u0935\u0940\u0902":"\u0935\u093e\u0901")}var a=(0,r(7869).NUMBERS)();a.wordOrdinal=i,a.numericOrdinal=function(t){var e=n.Grammar.getInstance().getParameter("gender");return t>0&&t<10?"f"===e?a.special.simpleSmallOrdinalsFeminine[t]:a.special.simpleSmallOrdinalsMasculine[t]:t.toString().split("").map((function(t){var e=parseInt(t,10);return isNaN(e)?"":a.special.simpleNumbers[e]})).join("")+("f"===e?"\u0935\u0940\u0902":"\u0935\u093e\u0901")},a.numberToWords=o,a.numberToOrdinal=function(t,e){return t<=10?a.special.smallDenominators[t]:i(t)+" \u0905\u0902\u0936"},e.default=a},8634:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3966);function o(t){var e=t%1e3,r="";if(r+=Q.ones[Math.floor(e/100)]?Q.ones[Math.floor(e/100)]+Q.numSep+"cento":"",e%=100){r+=r?Q.numSep:"";var n=Q.ones[e];if(n)r+=n;else{var o=Q.tens[Math.floor(e/10)],i=e%10;1!==i&&8!==i||(o=o.slice(0,-1)),r+=o,r+=i?Q.numSep+Q.ones[e%10]:""}}return r}function i(t){if(0===t)return Q.zero;if(t>=Math.pow(10,36))return t.toString();if(1===t&&n.Grammar.getInstance().getParameter("fraction"))return"un";for(var e=0,r="";t>0;){t%1e3&&(r=o(t%1e3)+(e?"-"+Q.large[e]+"-":"")+r),t=Math.floor(t/1e3),e++}return r.replace(/-$/,"")}function a(t){var e="m"===n.Grammar.getInstance().getParameter("gender")?"o":"a",r=Q.special.onesOrdinals[t];return r?r.slice(0,-1)+e:(r=i(t)).slice(0,-1)+"esim"+e}var Q=(0,r(7869).NUMBERS)();Q.wordOrdinal=a,Q.numericOrdinal=function(t){var e=n.Grammar.getInstance().getParameter("gender");return t.toString()+("m"===e?"o":"a")},Q.numberToWords=i,Q.numberToOrdinal=function(t,e){if(2===t)return e?"mezzi":"mezzo";var r=a(t);if(!e)return r;var n=r.match(/o$/)?"i":"e";return r.slice(0,-1)+n},e.default=Q},3203:function(t,e,r){"use strict";function n(t){return t.toString().split("").map((function(t){return o.ones[parseInt(t,10)]})).join("")}Object.defineProperty(e,"__esModule",{value:!0});var o=(0,r(7869).NUMBERS)();o.numberToWords=n,o.numberToOrdinal=n,e.default=o},1717:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(6617);function o(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t%1e3,n="",o=Math.floor(r/100),i=T.ones[o];if(n+=i?(1===o?"":i)+"hundre":"",r%=100){if(n+=n?"og":"",e){var Q=T.special.smallOrdinals[r];if(Q)return n+Q;if(r%10)return n+T.tens[Math.floor(r/10)]+T.special.smallOrdinals[r%10]}n+=T.ones[r]||T.tens[Math.floor(r/10)]+(r%10?T.ones[r%10]:"")}return e?a(n):n}function i(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(0===t)return e?T.special.smallOrdinals[0]:T.zero;if(t>=Math.pow(10,36))return t.toString();for(var r=0,n="";t>0;){var i=t%1e3;if(i){var a=o(t%1e3,!r&&e);!r&&e&&(e=!e),n=a+(r?" "+T.large[r]+(r>1&&i>1?"er":"")+(n?" ":""):"")+n}t=Math.floor(t/1e3),r++}return e?n+(n.match(/tusen$/)?"de":"te"):n}function a(t){var e=T.special.endOrdinal[0];return"a"===e&&t.match(/en$/)?t.slice(0,-2)+T.special.endOrdinal:t.match(/(d|n)$/)||t.match(/hundre$/)?t+"de":t.match(/i$/)?t+T.special.endOrdinal:"a"===e&&t.match(/e$/)?t.slice(0,-1)+T.special.endOrdinal:(t.match(/e$/),t+"nde")}function Q(t){return l(t,!0)}var T=(0,r(7869).NUMBERS)();function s(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=T.ones[1];return t===r?"ein"===t?"eitt ":e?"et":"ett":t}function u(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t%1e3,n="",o=T.ones[Math.floor(r/100)];if(n+=o?s(o)+"hundre":"",r%=100){if(n+=n?"og":"",e){var i=T.special.smallOrdinals[r];if(i)return n+i}if(o=T.ones[r])n+=o;else{var Q=T.tens[Math.floor(r/10)];n+=(o=T.ones[r%10])?o+"og"+Q:Q}}return e?a(n):n}function c(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(0===t)return e?T.special.smallOrdinals[0]:T.zero;if(t>=Math.pow(10,36))return t.toString();for(var r=0,n="";t>0;){var o=t%1e3;if(o){var i=u(t%1e3,!r&&e);!r&&e&&(e=!e),n=(1===r?s(i,!0):i)+(r>1?T.numSep:"")+(r?T.large[r]+(r>1&&o>1?"er":""):"")+(r>1&&n?T.numSep:"")+n}t=Math.floor(t/1e3),r++}return e?n+(n.match(/tusen$/)?"de":"te"):n}function l(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="alt"===n.default.getInstance().subiso?c(t,e):i(t,e);return r}T.wordOrdinal=Q,T.numericOrdinal=function(t){return t.toString()+"."},T.numberToWords=l,T.numberToOrdinal=function(t,e){return Q(t)},e.default=T},5205:function(t,e,r){"use strict";function n(t){var e=t%1e3,r="",n=Math.floor(e/100);return r+=a.ones[n]?(1===n?"":a.ones[n]+a.numSep)+"hundra":"",(e%=100)&&(r+=r?a.numSep:"",r+=a.ones[e]||a.tens[Math.floor(e/10)]+(e%10?a.numSep+a.ones[e%10]:"")),r}function o(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(0===t)return a.zero;if(t>=Math.pow(10,36))return t.toString();for(var r=0,o="";t>0;){var i=t%1e3;if(i){var Q=a.large[r],T=i>1&&r>1&&!e?"er":"";o=(1===r&&1===i?"":(r>1&&1===i?"en":n(t%1e3))+(r>1?" ":""))+(r?Q+T+(r>1?" ":""):"")+o}t=Math.floor(t/1e3),r++}return o.replace(/ $/,"")}function i(t){var e=o(t,!0);return e.match(/^noll$/)?e="nollte":e.match(/ett$/)?e=e.replace(/ett$/,"f\xf6rsta"):e.match(/tv\xe5$/)?e=e.replace(/tv\xe5$/,"andra"):e.match(/tre$/)?e=e.replace(/tre$/,"tredje"):e.match(/fyra$/)?e=e.replace(/fyra$/,"fj\xe4rde"):e.match(/fem$/)?e=e.replace(/fem$/,"femte"):e.match(/sex$/)?e=e.replace(/sex$/,"sj\xe4tte"):e.match(/sju$/)?e=e.replace(/sju$/,"sjunde"):e.match(/\xe5tta$/)?e=e.replace(/\xe5tta$/,"\xe5ttonde"):e.match(/nio$/)?e=e.replace(/nio$/,"nionde"):e.match(/tio$/)?e=e.replace(/tio$/,"tionde"):e.match(/elva$/)?e=e.replace(/elva$/,"elfte"):e.match(/tolv$/)?e=e.replace(/tolv$/,"tolfte"):e.match(/tusen$/)?e=e.replace(/tusen$/,"tusonde"):e.match(/jard$/)||e.match(/jon$/)?e+="te":e+="de",e}Object.defineProperty(e,"__esModule",{value:!0});var a=(0,r(7869).NUMBERS)();a.wordOrdinal=i,a.numericOrdinal=function(t){var e=t.toString();return e.match(/11$|12$/)?e+":e":e+(e.match(/1$|2$/)?":a":":e")},a.numberToWords=o,a.numberToOrdinal=function(t,e){if(1===t)return"hel";if(2===t)return e?"halva":"halv";var r=i(t);return(r=r.match(/de$/)?r.replace(/de$/,""):r)+(e?"delar":"del")},e.default=a},1531:function(t,e){"use strict";function r(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!t.childNodes||!t.childNodes[0]||!t.childNodes[0].childNodes||t.childNodes[0].childNodes.length<2||"number"!==t.childNodes[0].childNodes[0].tagName||"integer"!==t.childNodes[0].childNodes[0].getAttribute("role")||"number"!==t.childNodes[0].childNodes[1].tagName||"integer"!==t.childNodes[0].childNodes[1].getAttribute("role"))return{convertible:!1,content:t.textContent};var r=t.childNodes[0].childNodes[1].textContent,n=t.childNodes[0].childNodes[0].textContent,o=Number(r),i=Number(n);return isNaN(o)||isNaN(i)?{convertible:!1,content:"".concat(n," ").concat(e," ").concat(r)}:{convertible:!0,enumerator:i,denominator:o}}Object.defineProperty(e,"__esModule",{value:!0}),e.vulgarFractionSmall=e.convertVulgarFraction=e.Combiners=e.siCombiner=e.identityTransformer=e.pluralCase=void 0,e.pluralCase=function(t,e){return t.toString()},e.identityTransformer=function(t){return t.toString()},e.siCombiner=function(t,e){return t+e.toLowerCase()},e.Combiners={},e.Combiners.identityCombiner=function(t,e,r){return t+e+r},e.Combiners.prefixCombiner=function(t,e,r){return t=r?r+" "+t:t,e?e+" "+t:t},e.Combiners.postfixCombiner=function(t,e,r){return t=r?r+" "+t:t,e?t+" "+e:t},e.Combiners.romanceCombiner=function(t,e,r){return t=r?t+" "+r:t,e?t+" "+e:t},e.convertVulgarFraction=r,e.vulgarFractionSmall=function(t,e,n){var o=r(t);if(o.convertible){var i=o.enumerator,a=o.denominator;return i>0&&i0&&a=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,Q=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){Q=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(Q)throw i}}}}function s(t,e){if(t){if("string"==typeof t)return u(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r4?i-4:0),Q=4;Q3?n-3:0),i=3;i1?r-1:0),o=1;ot.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&void 0!==arguments[1]?arguments[1]:Object.keys(e);p(this,t),this.properties=e,this.order=r}return d(t,[{key:"getProperties",value:function(){return this.properties}},{key:"getOrder",value:function(){return this.order}},{key:"getAxes",value:function(){return this.order}},{key:"getProperty",value:function(t){return this.properties[t]}},{key:"updateProperties",value:function(t){this.properties=t}},{key:"allProperties",value:function(){var t=this,e=[];return this.order.forEach((function(r){return e.push(t.getProperty(r).slice())})),e}},{key:"toString",value:function(){var t=this,e=[];return this.order.forEach((function(r){return e.push(r+": "+t.getProperty(r).toString())})),e.join("\n")}}],[{key:"createProp",value:function(){for(var e=m.DEFAULT_ORDER,r={},n=0,o=arguments.length,i=e.length;nthis.order.length)throw new Error("Invalid dynamic constraint: "+r);for(var n,o=0,i=0;n=this.order[i],e.length;i++,o++){var a=e.shift();r[n]=a}return new m(r,this.order.slice(0,o))}}]),t}();e.DynamicCstrParser=L;var v=function(){function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new y(e.getProperties(),e.getOrder());p(this,t),this.reference=e,this.fallback=r,this.order=this.reference.getOrder()}return d(t,[{key:"getReference",value:function(){return this.reference}},{key:"setReference",value:function(t,e){this.reference=t,this.fallback=e||new y(t.getProperties(),t.getOrder()),this.order=this.reference.getOrder()}},{key:"match",value:function(t){var e=this,r=t.getAxes();return r.length===this.reference.getAxes().length&&r.every((function(r){var n=t.getValue(r);return n===e.reference.getValue(r)||-1!==e.fallback.getProperty(r).indexOf(n)}))}},{key:"compare",value:function(t,e){for(var r,n=!1,o=0;r=this.order[o];o++){var i=t.getValue(r),a=e.getValue(r);if(!n){var Q=this.reference.getValue(r);if(Q===i&&Q!==a)return-1;if(Q===a&&Q!==i)return 1;if(Q===i&&Q===a)continue;Q!==i&&Q!==a&&(n=!0)}var T=this.fallback.getProperty(r),s=T.indexOf(i),u=T.indexOf(a);if(s=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,Q=!0,T=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return Q=t.done,t},e:function(t){T=!0,a=t},f:function(){try{Q||null==r.return||r.return()}finally{if(T)throw a}}}}function i(t,e){if(t){if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]?arguments[0]:{},e=0,r=Object.values(h);e2?r-2:0),o=2;o2?n-2:0),i=2;it.length)&&(e=t.length);for(var r=0,n=new Array(e);r "+this.action.toString()}}]),t}();function y(t){switch(t){case"[n]":return f.NODE;case"[m]":return f.MULTI;case"[t]":return f.TEXT;case"[p]":return f.PERSONALITY;default:throw"Parse error: "+t}}e.SpeechRule=d,function(t){t.NODE="NODE",t.MULTI="MULTI",t.TEXT="TEXT",t.PERSONALITY="PERSONALITY"}(f=e.ActionType||(e.ActionType={}));var m=function(){function t(e){var r=e.type,n=e.content,o=e.attributes,i=e.grammar;u(this,t),this.type=r,this.content=n,this.attributes=o,this.grammar=i}return l(t,[{key:"toString",value:function(){var t="";t+=function(t){switch(t){case f.NODE:return"[n]";case f.MULTI:return"[m]";case f.TEXT:return"[t]";case f.PERSONALITY:return"[p]";default:throw"Unknown type error: "+t}}(this.type),t+=this.content?" "+this.content:"";var e=this.attributesToString();return t+=e?" "+e:""}},{key:"grammarToString",value:function(){return this.getGrammar().join(":")}},{key:"getGrammar",value:function(){var t=[];for(var e in this.grammar)!0===this.grammar[e]?t.push(e):!1===this.grammar[e]?t.push("!"+e):t.push(e+"="+this.grammar[e]);return t}},{key:"attributesToString",value:function(){var t=this.getAttributes(),e=this.grammarToString();return e&&t.push("grammar:"+e),t.length>0?"("+t.join(", ")+")":""}},{key:"getAttributes",value:function(){var t=[];for(var e in this.attributes){var r=this.attributes[e];"true"===r?t.push(e):t.push(e+":"+r)}return t}}],[{key:"grammarFromString",value:function(t){return h.Grammar.parseInput(t)}},{key:"fromString",value:function(e){var r={type:y(e.substring(0,3))},n=e.slice(3).trim();if(!n)throw new b("Missing content.");switch(r.type){case f.TEXT:if('"'===n[0]){var o=g(n,"\\(")[0].trim();if('"'!==o.slice(-1))throw new b("Invalid string syntax.");r.content=o,-1===(n=n.slice(o.length).trim()).indexOf("(")&&(n="");break}case f.NODE:case f.MULTI:var i=n.indexOf(" (");if(-1===i){r.content=n.trim(),n="";break}r.content=n.substring(0,i).trim(),n=n.slice(i).trim()}if(n){var a=t.attributesFromString(n);a.grammar&&(r.grammar=a.grammar,delete a.grammar),Object.keys(a).length&&(r.attributes=a)}return new t(r)}},{key:"attributesFromString",value:function(e){if("("!==e[0]||")"!==e.slice(-1))throw new b("Invalid attribute expression: "+e);for(var r={},n=g(e.slice(1,-1),","),o=0,i=n.length;o1?r-1:0),o=1;o0?r[0]:null}},{key:"applyConstraint",value:function(t,e){return!!this.applyQuery(t,e)||o.evaluateBoolean(e,t)}},{key:"constructString",value:function(t,e){if(!e)return"";if('"'===e.charAt(0))return e.slice(1,-1);var r=this.customStrings.lookup(e);return r?r(t):o.evaluateString(e,t)}},{key:"parse",value:function(t){for(var e,r=Array.isArray(t)?t:Object.entries(t),n=0;e=r[n];n++)switch(e[0].slice(0,3)){case"CQF":this.customQueries.add(e[0],e[1]);break;case"CSF":this.customStrings.add(e[0],e[1]);break;case"CTF":this.contextFunctions.add(e[0],e[1]);break;case"CGF":this.customGenerators.add(e[0],e[1]);break;default:console.error("FunctionError: Invalid function name "+e[0])}}}])&&n(e.prototype,r),a&&n(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.SpeechRuleContext=a},9834:function(t,e,r){"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,Q=!0,T=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return Q=t.done,t},e:function(t){T=!0,a=t},f:function(){try{Q||null==r.return||r.return()}finally{if(T)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&(f=this.evaluateNodeList_(o,g,h.sepFunc,o.constructString(t,h.separator),h.ctxtFunc,o.constructString(t,h.context)));break;case m.ActionType.TEXT:var H=h.span,O={};if(H){var M=(0,c.evalXPath)(H,t);M.length&&(O.extid=M[0].getAttribute("extid"))}var S=o.constructString(t,p);(S||""===S)&&(f=Array.isArray(S)?S.map((function(t){return a.AuditoryDescription.create({text:t.speech,attributes:t.attributes},{adjust:!0})})):[a.AuditoryDescription.create({text:S,attributes:O},{adjust:!0})]);break;case m.ActionType.PERSONALITY:default:f=[a.AuditoryDescription.create({text:p})]}f[0]&&!y&&(h.context&&(f[0].context=o.constructString(t,h.context)+(f[0].context||"")),h.annotation&&(f[0].annotation=h.annotation)),this.addLayout(f,h,y),T.grammar&&d.Grammar.getInstance().popState(),e=e.concat(this.addPersonality_(f,h,y,t)),L&&s.default.getInstance().setDynamicCstr(L)}return e}},{key:"evaluateNodeList_",value:function(t,e,r,n,o,i){if(!e.length)return[];for(var Q,T=n||"",s=i||"",u=t.contextFunctions.lookup(o),c=u?u(e,s):function(){return s},l=t.contextFunctions.lookup(r),f=l?l(e,T):function(){return[a.AuditoryDescription.create({text:T},{translate:!0})]},p=[],h=0;Q=e[h];h++){var d=this.evaluateTree_(Q);if(d.length>0&&(d[0].context=c()+(d[0].context||""),p=p.concat(d),h=0;n--){var o=r[n].name;!t.attributes[o]&&o.match(/^ext/)&&(t.attributes[o]=r[n].value)}}},{key:"addRelativePersonality_",value:function(t,e){if(!t.personality)return t.personality=e,t;var r=t.personality;for(var n in e)r[n]&&"number"==typeof r[n]&&"number"==typeof e[n]?r[n]=r[n]+e[n]:r[n]||(r[n]=e[n]);return t}},{key:"updateConstraint_",value:function(){var t=s.default.getInstance().dynamicCstr,e=s.default.getInstance().strict,r=this.trie,n={},o=t.getValue(h.Axis.LOCALE),i=t.getValue(h.Axis.MODALITY),a=t.getValue(h.Axis.DOMAIN);r.hasSubtrie([o,i,a])||(a=h.DynamicCstr.DEFAULT_VALUES[h.Axis.DOMAIN],r.hasSubtrie([o,i,a])||(i=h.DynamicCstr.DEFAULT_VALUES[h.Axis.MODALITY],r.hasSubtrie([o,i,a])||(o=h.DynamicCstr.DEFAULT_VALUES[h.Axis.LOCALE]))),n[h.Axis.LOCALE]=[o],n[h.Axis.MODALITY]=["summary"!==i?i:h.DynamicCstr.DEFAULT_VALUES[h.Axis.MODALITY]],n[h.Axis.DOMAIN]=["speech"!==i?h.DynamicCstr.DEFAULT_VALUES[h.Axis.DOMAIN]:a];for(var Q,T=t.getOrder(),u=0;Q=T[u];u++)if(!n[Q]){var c=t.getValue(Q),l=this.makeSet_(c,t.preference),f=h.DynamicCstr.DEFAULT_VALUES[Q];e||c===f||l.push(f),n[Q]=l}t.updateProperties(n)}},{key:"makeSet_",value:function(t,e){return e&&Object.keys(e).length?t.split(":"):[t]}},{key:"lookupRule",value:function(t,e){if(!t||t.nodeType!==T.NodeType.ELEMENT_NODE&&t.nodeType!==T.NodeType.TEXT_NODE)return null;var r=this.lookupRules(t,e);return r.length>0?this.pickMostConstraint_(e,r):null}},{key:"lookupRules",value:function(t,e){return this.trie.lookupRules(t,e.allProperties())}},{key:"pickMostConstraint_",value:function(t,e){var r=s.default.getInstance().comparator;return e.sort((function(t,e){return r.compare(t.dynamicCstr,e.dynamicCstr)||e.precondition.priority-t.precondition.priority||e.precondition.constraints.length-t.precondition.constraints.length||e.precondition.rank-t.precondition.rank})),Q.Debugger.getInstance().generateOutput(function(){return e.map((function(t){return t.name+"("+t.dynamicCstr.toString()+")"}))}.bind(this)),e[0]}}])&&i(e.prototype,r),o&&i(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.SpeechRuleEngine=v;var b=new Map;function g(t){var e="".concat(t.locale,".").concat(t.modality,".").concat(t.domain);if("actions"===t.kind){var r=b.get(e);return r.parse(t),r}f.init(),t&&!t.functions&&(t.functions=l.getStore(t.locale,t.modality,t.domain));var n="braille"===t.modality?new p.BrailleStore:new y.MathStore;return b.set(e,n),t.inherits&&(n.inherits=b.get("".concat(t.inherits,".").concat(t.modality,".").concat(t.domain))),n.parse(t),n.initialize(),n}e.storeFactory=g,s.default.nodeEvaluator=v.getInstance().evaluateNode.bind(v.getInstance())},6778:function(t,e){"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function i(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Q(t);if(e){var o=Q(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Q(t){return Q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Q(t)}function T(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){for(var r=0;r0?o.evalXPath("../../content/*",t[0]):[],function(){var t=r.shift(),o=e?[n.AuditoryDescription.create({text:e},{translate:!0})]:[];if(!t)return o;var a=i.default.evaluateNode(t);return o.concat(a)}}},3967:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getTreeFromString=e.getTree=e.xmlTree=void 0;var n=r(6687),o=r(1007);function i(t){return new o.SemanticTree(t)}e.xmlTree=function(t){return i(t).xml()},e.getTree=i,e.getTreeFromString=function(t){return i(n.parseInput(t))}},1991:function(t,e,r){"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,Q=!0,T=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return Q=t.done,t},e:function(t){T=!0,a=t},f:function(){try{Q||null==r.return||r.return()}finally{if(T)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r3&&void 0!==arguments[3]?arguments[3]:{};r(this,t),this.domain=e,this.name=n,this.func=o,this.def=i,this.active=!1}return o(t,[{key:"visit",value:function(t,e){var r=this.func(t,e);t.addAnnotation(this.domain,r[0]);for(var n,o=0;n=t.childNodes[o];o++)r=this.visit(n,r[1]);return r}}]),t}();e.SemanticVisitor=a},1034:function(t,e){"use strict";function r(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return n(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var o=0,i=function(){};return{s:i,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,Q=!0,T=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return Q=t.done,t},e:function(t){T=!0,a=t},f:function(){try{Q||null==r.return||r.return()}finally{if(T)throw a}}}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r","\u2241","\u2242","\u2244","\u2246","\u2247","\u2249","\u224f","\u2250","\u2260","\u2262","\u2264","\u2265","\u2266","\u2267","\u2268","\u2269","\u226a","\u226b","\u226c","\u226d","\u226e","\u226f","\u2270","\u2271","\u2272","\u2273","\u2274","\u2275","\u2276","\u2277","\u2278","\u2279","\u227a","\u227b","\u227c","\u227d","\u227e","\u227f","\u2280","\u2281","\u22d6","\u22d7","\u22d8","\u22d9","\u22da","\u22db","\u22dc","\u22dd","\u22de","\u22df","\u22e0","\u22e1","\u22e6","\u22e7","\u22e8","\u22e9","\u2a79","\u2a7a","\u2a7b","\u2a7c","\u2a7d","\u2a7e","\u2a7f","\u2a80","\u2a81","\u2a82","\u2a83","\u2a84","\u2a85","\u2a86","\u2a87","\u2a88","\u2a89","\u2a8a","\u2a8b","\u2a8c","\u2a8d","\u2a8e","\u2a8f","\u2a90","\u2a91","\u2a92","\u2a93","\u2a94","\u2a95","\u2a96","\u2a97","\u2a98","\u2a99","\u2a9a","\u2a9b","\u2a9c","\u2a9d","\u2a9e","\u2a9f","\u2aa0","\u2aa1","\u2aa2","\u2aa3","\u2aa4","\u2aa5","\u2aa6","\u2aa7","\u2aa8","\u2aa9","\u2aaa","\u2aab","\u2aac","\u2aad","\u2aae","\u2aaf","\u2ab0","\u2ab1","\u2ab2","\u2ab3","\u2ab4","\u2ab5","\u2ab6","\u2ab7","\u2ab8","\u2ab9","\u2aba","\u2abb","\u2abc","\u2af7","\u2af8","\u2af9","\u2afa","\u29c0","\u29c1","\ufe64","\ufe65","\uff1c","\uff1e"],type:"relation",role:"inequality"},{set:["\u22e2","\u22e3","\u22e4","\u22e5","\u2282","\u2283","\u2284","\u2285","\u2286","\u2287","\u2288","\u2289","\u228a","\u228b","\u228f","\u2290","\u2291","\u2292","\u2abd","\u2abe","\u2abf","\u2ac0","\u2ac1","\u2ac2","\u2ac3","\u2ac4","\u2ac5","\u2ac6","\u2ac7","\u2ac8","\u2ac9","\u2aca","\u2acb","\u2acc","\u2acd","\u2ace","\u2acf","\u2ad0","\u2ad1","\u2ad2","\u2ad3","\u2ad4","\u2ad5","\u2ad6","\u2ad7","\u2ad8","\u22d0","\u22d1","\u22ea","\u22eb","\u22ec","\u22ed","\u22b2","\u22b3","\u22b4","\u22b5"],type:"relation",role:"set"},{set:["\u22a2","\u22a3","\u22a6","\u22a7","\u22a8","\u22a9","\u22aa","\u22ab","\u22ac","\u22ad","\u22ae","\u22af","\u2ade","\u2adf","\u2ae0","\u2ae1","\u2ae2","\u2ae3","\u2ae4","\u2ae5","\u2ae6","\u2ae7","\u2ae8","\u2ae9","\u2aea","\u2aeb","\u2aec","\u2aed"],type:"relation",role:"unknown"},{set:["\u2190","\u2191","\u2192","\u2193","\u2194","\u2195","\u2196","\u2197","\u2198","\u2199","\u219a","\u219b","\u219c","\u219d","\u219e","\u219f","\u21a0","\u21a1","\u21a2","\u21a3","\u21a4","\u21a5","\u21a6","\u21a7","\u21a8","\u21a9","\u21aa","\u21ab","\u21ac","\u21ad","\u21ae","\u21af","\u21b0","\u21b1","\u21b2","\u21b3","\u21b4","\u21b5","\u21b6","\u21b7","\u21b8","\u21b9","\u21ba","\u21bb","\u21c4","\u21c5","\u21c6","\u21c7","\u21c8","\u21c9","\u21ca","\u21cd","\u21ce","\u21cf","\u21d0","\u21d1","\u21d2","\u21d3","\u21d4","\u21d5","\u21d6","\u21d7","\u21d8","\u21d9","\u21da","\u21db","\u21dc","\u21dd","\u21de","\u21df","\u21e0","\u21e1","\u21e2","\u21e3","\u21e4","\u21e5","\u21e6","\u21e7","\u21e8","\u21e9","\u21ea","\u21eb","\u21ec","\u21ed","\u21ee","\u21ef","\u21f0","\u21f1","\u21f2","\u21f3","\u21f4","\u21f5","\u21f6","\u21f7","\u21f8","\u21f9","\u21fa","\u21fb","\u21fc","\u21fd","\u21fe","\u21ff","\u2301","\u2303","\u2304","\u2324","\u238b","\u2794","\u2798","\u2799","\u279a","\u279b","\u279c","\u279d","\u279e","\u279f","\u27a0","\u27a1","\u27a2","\u27a3","\u27a4","\u27a5","\u27a6","\u27a7","\u27a8","\u27a9","\u27aa","\u27ab","\u27ac","\u27ad","\u27ae","\u27af","\u27b1","\u27b2","\u27b3","\u27b4","\u27b5","\u27b6","\u27b7","\u27b8","\u27b9","\u27ba","\u27bb","\u27bc","\u27bd","\u27be","\u27f0","\u27f1","\u27f2","\u27f3","\u27f4","\u27f5","\u27f6","\u27f7","\u27f8","\u27f9","\u27fa","\u27fb","\u27fc","\u27fd","\u27fe","\u27ff","\u2900","\u2901","\u2902","\u2903","\u2904","\u2905","\u2906","\u2907","\u2908","\u2909","\u290a","\u290b","\u290c","\u290d","\u290e","\u290f","\u2910","\u2911","\u2912","\u2913","\u2914","\u2915","\u2916","\u2917","\u2918","\u2919","\u291a","\u291b","\u291c","\u291d","\u291e","\u291f","\u2920","\u2921","\u2922","\u2923","\u2924","\u2925","\u2926","\u2927","\u2928","\u2929","\u292a","\u292d","\u292e","\u292f","\u2930","\u2931","\u2932","\u2933","\u2934","\u2935","\u2936","\u2937","\u2938","\u2939","\u293a","\u293b","\u293c","\u293d","\u293e","\u293f","\u2940","\u2941","\u2942","\u2943","\u2944","\u2945","\u2946","\u2947","\u2948","\u2949","\u2970","\u2971","\u2972","\u2973","\u2974","\u2975","\u2976","\u2977","\u2978","\u2979","\u297a","\u297b","\u29b3","\u29b4","\u29bd","\u29ea","\u29ec","\u29ed","\u2a17","\u2b00","\u2b01","\u2b02","\u2b03","\u2b04","\u2b05","\u2b06","\u2b07","\u2b08","\u2b09","\u2b0a","\u2b0b","\u2b0c","\u2b0d","\u2b0e","\u2b0f","\u2b10","\u2b11","\u2b30","\u2b31","\u2b32","\u2b33","\u2b34","\u2b35","\u2b36","\u2b37","\u2b38","\u2b39","\u2b3a","\u2b3b","\u2b3c","\u2b3d","\u2b3e","\u2b3f","\u2b40","\u2b41","\u2b42","\u2b43","\u2b44","\u2b45","\u2b46","\u2b47","\u2b48","\u2b49","\u2b4a","\u2b4b","\u2b4c","\uffe9","\uffea","\uffeb","\uffec","\u21bc","\u21bd","\u21be","\u21bf","\u21c0","\u21c1","\u21c2","\u21c3","\u21cb","\u21cc","\u294a","\u294b","\u294c","\u294d","\u294e","\u294f","\u2950","\u2951","\u2952","\u2953","\u2954","\u2955","\u2956","\u2957","\u2958","\u2959","\u295a","\u295b","\u295c","\u295d","\u295e","\u295f","\u2960","\u2961","\u2962","\u2963","\u2964","\u2965","\u2966","\u2967","\u2968","\u2969","\u296a","\u296b","\u296c","\u296d","\u296e","\u296f","\u297c","\u297d","\u297e","\u297f"],type:"relation",role:"arrow"},{set:["\u2208","\u220a","\u22f2","\u22f3","\u22f4","\u22f5","\u22f6","\u22f7","\u22f8","\u22f9","\u22ff"],type:"operator",role:"element"},{set:["\u2209"],type:"operator",role:"nonelement"},{set:["\u220b","\u220d","\u22fa","\u22fb","\u22fc","\u22fd","\u22fe"],type:"operator",role:"reelement"},{set:["\u220c"],type:"operator",role:"renonelement"},{set:["\u2140","\u220f","\u2210","\u2211","\u22c0","\u22c1","\u22c2","\u22c3","\u2a00","\u2a01","\u2a02","\u2a03","\u2a04","\u2a05","\u2a06","\u2a07","\u2a08","\u2a09","\u2a0a","\u2a0b","\u2afc","\u2aff"],type:"largeop",role:"sum"},{set:["\u222b","\u222c","\u222d","\u222e","\u222f","\u2230","\u2231","\u2232","\u2233","\u2a0c","\u2a0d","\u2a0e","\u2a0f","\u2a10","\u2a11","\u2a12","\u2a13","\u2a14","\u2a15","\u2a16","\u2a17","\u2a18","\u2a19","\u2a1a","\u2a1b","\u2a1c"],type:"largeop",role:"integral"},{set:["\u221f","\u2220","\u2221","\u2222","\u22be","\u22bf","\u25b3","\u25b7","\u25bd","\u25c1"],type:"operator",role:"geometry"},{set:["inf","lim","liminf","limsup","max","min","sup","injlim","projlim","inj lim","proj lim"],type:"function",role:"limit function"},{set:Lt,type:"function",role:"prefix function"},{set:["mod","rem"],type:"operator",role:"prefix function"}],bt=function(){for(var t,e={},r=function(t,r){r.set.forEach((function(t){e[t]={role:r.role||"unknown",type:r.type||"unknown",font:r.font||"unknown"}}))},n=0;t=vt[n];n++)r(0,t);return e}();e.equal=function(t,e){return t.type===e.type&&t.role===e.role&&t.font===e.font},e.lookupType=function(t){var e;return(null===(e=bt[t])||void 0===e?void 0:e.type)||"unknown"},e.lookupRole=function(t){var e;return(null===(e=bt[t])||void 0===e?void 0:e.role)||"unknown"},e.lookupMeaning=function(t){return bt[t]||{role:"unknown",type:"unknown",font:"unknown"}},e.invisibleTimes=function(){return ht},e.invisiblePlus=function(){return ft},e.invisibleComma=function(){return o},e.functionApplication=function(){return dt},e.isMatchingFence=function(t,e){return-1!==p.indexOf(t)||-1!==h.indexOf(t)?t===e:T[t]===e||s[t]===e},e.isEmbellishedType=function(t){return"operator"===t||"relation"===t||"fence"===t||"punctuation"===t};var gt=new Map;function Ht(t,e){return"".concat(t," ").concat(e)}function Ot(t,e){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=r(e);try{for(i.s();!(n=i.n()).done;){var a=n.value;gt.set(Ht(t,a),o||t)}}catch(t){i.e(t)}finally{i.f()}}Ot("d",["d","\u2146","\uff44","\ud835\udc1d","\ud835\udc51","\ud835\udcb9","\ud835\udced","\ud835\udd21","\ud835\udd55","\ud835\udd89","\ud835\uddbd","\ud835\uddf1","\ud835\ude25","\ud835\ude8d"]),Ot("bar",a),Ot("tilde",Q),e.lookupSecondary=function(t,e){return gt.get(Ht(t,e))}},1557:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){return o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=i(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},o.apply(this,arguments)}function i(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=u(t)););return t}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Q(t,e)}function Q(t,e){return Q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Q(t,e)}function T(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=u(t);if(e){var o=u(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return s(this,r)}}function s(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){return u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},u(t)}function c(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){for(var r=0;r1)return!0;return!1}},{key:"isEmpty",value:function(){return!Object.keys(this.map).length}}]),t}(),m=function(t){a(r,t);var e=T(r);function r(){return c(this,r),e.apply(this,arguments)}return f(r,[{key:"copyCollator",value:function(){return new r}},{key:"add",value:function(t,e){var n=d.key(t,e.font);o(u(r.prototype),"add",this).call(this,n,e)}},{key:"addNode",value:function(t){this.add(t.textContent,t)}},{key:"toString",value:function(){var t=[];for(var e in this.map){for(var r,n=Array(e.length+3).join(" "),o=this.map[e],i=[],a=0;r=o[a];a++)i.push(r.toString());t.push(e+": "+i.join("\n"+n))}return t.join("\n")}},{key:"collateMeaning",value:function(){var t=new L;for(var e in this.map)t.map[e]=this.map[e].map((function(t){return t.meaning()}));return t}}]),r}(y);e.SemanticNodeCollator=m;var L=function(t){a(r,t);var e=T(r);function r(){return c(this,r),e.apply(this,arguments)}return f(r,[{key:"copyCollator",value:function(){return new r}},{key:"add",value:function(t,e){var n=this.retrieve(t,e.font);if(!n||!n.find((function(t){return p.equal(t,e)}))){var i=d.key(t,e.font);o(u(r.prototype),"add",this).call(this,i,e)}}},{key:"addNode",value:function(t){this.add(t.textContent,t.meaning())}},{key:"toString",value:function(){var t=[];for(var e in this.map){for(var r,n=Array(e.length+3).join(" "),o=this.map[e],i=[],a=0;r=o[a];a++)i.push("{type: "+r.type+", role: "+r.role+", font: "+r.font+"}");t.push(e+": "+i.join("\n"+n))}return t.join("\n")}},{key:"reduce",value:function(){for(var t in this.map)1!==this.map[t].length&&(this.map[t]=(0,h.reduce)(this.map[t]))}},{key:"default",value:function(){var t=new d;for(var e in this.map)1===this.map[e].length&&(t.map[e]=this.map[e][0]);return t}},{key:"newDefault",value:function(){var t=this.default();this.reduce();var e=this.default();return t.size()!==e.size()?e:null}}]),r}(y);e.SemanticMeaningCollator=L},6333:function(t,e){"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}function o(t,e){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},o(t,e)}function i(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=Q(t);if(e){var o=Q(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return a(this,r)}}function a(t,e){if(e&&("object"===r(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Q(t){return Q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Q(t)}function T(t,e){for(var r=0;r2&&void 0!==arguments[2]?arguments[2]:function(t){return!1};u(this,t),this.name=e,this.apply=r,this.applicable=n}));e.SemanticAbstractHeuristic=c;var l=function(t){n(r,t);var e=i(r);function r(){return u(this,r),e.apply(this,arguments)}return s(r)}(c);e.SemanticTreeHeuristic=l;var f=function(t){n(r,t);var e=i(r);function r(){return u(this,r),e.apply(this,arguments)}return s(r)}(c);e.SemanticMultiHeuristic=f},8391:function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.lookup=e.run=e.add=e.blacklist=e.flags=e.updateFactory=e.factory=void 0,e.factory=null,e.updateFactory=function(t){e.factory=t};var r=new Map;function n(t){return r.get(t)}e.flags={combine_juxtaposition:!0,convert_juxtaposition:!0,multioperator:!0},e.blacklist={},e.add=function(t){var n=t.name;r.set(n,t),e.flags[n]||(e.flags[n]=!1)},e.run=function(t,r,o){var i=n(t);return i&&!e.blacklist[t]&&(e.flags[t]||i.applicable(r))?i.apply(r):o?o(r):r},e.lookup=n},6897:function(t,e,r){"use strict";function n(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&!t.textContent[0].match(/[A-Z]/)&&(t.role="prefix function"),t}),(function(t){return"braille"===a.default.getInstance().modality&&"identifier"===t.type}))),T.add(new s.SemanticTreeHeuristic("detect_cycle",(function(t){t.type="matrix",t.role="cycle";var e=t.childNodes[0];return e.type="row",e.role="cycle",e.textContent="",e.contentNodes=[],t}),(function(t){return"fenced"===t.type&&"infixop"===t.childNodes[0].type&&"implicit"===t.childNodes[0].role&&t.childNodes[0].childNodes.every((function(t){return"number"===t.type}))&&t.childNodes[0].contentNodes.every((function(t){return"space"===t.role}))})))},189:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){for(var r=0;r1?this.parse(e[1]):this.getFactory().makeUnprocessed(t)}},{key:"dummy_",value:function(t,e){var r=this.getFactory().makeUnprocessed(t);return r.role=t.tagName,r.textContent=t.textContent,r}},{key:"leaf_",value:function(t,e){if(1===e.length&&e[0].nodeType!==u.NodeType.TEXT_NODE){var r=this.getFactory().makeUnprocessed(t);return r.role=e[0].tagName,p.addAttributes(r,e[0]),r}return this.getFactory().makeLeafNode(t.textContent,f.default.getInstance().font(t.getAttribute("mathvariant")))}}])&&o(e.prototype,r),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(c.SemanticAbstractParser);e.SemanticMathml=h},1529:function(t,e,r){"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,Q=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){Q=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(Q)throw o}}return i}(t,e)||o(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&n.appendChild(r("content",this.contentNodes)),this.childNodes.length>0&&n.appendChild(r("children",this.childNodes)),n}},{key:"toString",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=Q.parseInput("");return Q.serializeXml(this.xml(e.ownerDocument,t))}},{key:"allAttributes",value:function(){var t=[];return t.push(["role",this.role]),"unknown"!==this.font&&t.push(["font",this.font]),Object.keys(this.annotation).length&&t.push(["annotation",this.annotationXml()]),this.embellished&&t.push(["embellished",this.embellished]),this.fencePointer&&t.push(["fencepointer",this.fencePointer]),t.push(["id",this.id.toString()]),t}},{key:"annotationXml",value:function(){var t=this,e=[],r=function(r){t.annotation[r].forEach((function(t){e.push(r+":"+t)}))};for(var n in this.annotation)r(n);return e.join(";")}},{key:"attributesXml",value:function(){for(var t=[],e=0,r=Object.entries(this.attributes);e=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,Q=!0,T=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return Q=t.done,t},e:function(t){T=!0,a=t},f:function(){try{Q||null==r.return||r.return()}finally{if(T)throw a}}}}(Q.toArray(r.childNodes));try{for(i.s();!(n=i.n()).done;){var a=n.value;if(a.nodeType!==Q.NodeType.TEXT_NODE){var T=Q.toArray(a.childNodes).map(t.fromXml);T.forEach((function(t){return t.parent=e})),"CONTENT"===Q.tagName(a)?e.contentNodes=T:e.childNodes=T}else e.textContent=a.textContent}}catch(t){i.e(t)}finally{i.f()}}}],r&&a(e.prototype,r),i&&a(e,i),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.SemanticNode=u},2640:function(t,e,r){"use strict";function n(t,e){for(var r=0;r1&&void 0!==arguments[1]?arguments[1]:null;r(this,t),this.comparator=e,this.type=n,i(this)}var e,o,a;return e=t,(o=[{key:"compare",value:function(t,e){return this.type&&this.type===t.type&&this.type===e.type?this.comparator(t,e):0}}])&&n(e.prototype,o),a&&n(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.SemanticComparator=T,new T((function(t,e){return"simple function"===t.role?1:"simple function"===e.role?-1:0}),"identifier")},174:function(t,e,r){"use strict";function n(t,e){for(var r=0;r1)return!1;var r=e[0];if("infixop"===r.type){if("implicit"!==r.role)return!1;if(r.childNodes.some((function(t){return i(t,"infixop")})))return!1}return!0},e.isPrefixFunctionBoundary=function(t){return s(t)&&!Q(t,"division")||i(t,"appl")||T(t)},e.isBigOpBoundary=function(t){return s(t)||T(t)},e.isIntegralDxBoundary=function(t,e){return!!e&&i(e,"identifier")&&n.lookupSecondary("d",t.textContent)},e.isIntegralDxBoundarySingle=function(t){if(i(t,"identifier")){var e=t.textContent[0];return e&&t.textContent[1]&&n.lookupSecondary("d",e)}return!1},e.isGeneralFunctionBoundary=T,e.isEmbellished=function(t){return t.embellished?t.embellished:n.isEmbellishedType(t.type)?t.type:null},e.isOperator=s,e.isRelation=u,e.isPunctuation=c,e.isFence=l,e.isElligibleEmbellishedFence=function(t){return!(!t||!l(t))&&(!t.embellished||f(t))},e.isTableOrMultiline=p,e.tableIsMatrixOrVector=function(t){return!!t&&h(t)&&p(t.childNodes[0])},e.isFencedElement=h,e.tableIsCases=function(t,e){return e.length>0&&Q(e[e.length-1],"openfence")},e.tableIsMultiline=function(t){return t.childNodes.every((function(t){return t.childNodes.length<=1}))},e.lineIsLabelled=function(t){return i(t,"line")&&t.contentNodes.length&&Q(t.contentNodes[0],"label")},e.isBinomial=function(t){return 2===t.childNodes.length},e.isLimitBase=function t(e){return i(e,"largeop")||i(e,"limboth")||i(e,"limlower")||i(e,"limupper")||i(e,"function")&&Q(e,"limit function")||(i(e,"overscore")||i(e,"underscore"))&&t(e.childNodes[0])},e.isSimpleFunctionHead=function(t){return"identifier"===t.type||"latinletter"===t.role||"greekletter"===t.role||"otherletter"===t.role},e.singlePunctAtPosition=function(t,e,r){return 1===e.length&&("punctuation"===t[r].type||"punctuation"===t[r].embellished)&&t[r]===e[0]},e.isSimpleFunction=function(t){return i(t,"identifier")&&Q(t,"simple function")},e.isLeftBrace=d,e.isRightBrace=y,e.isSetNode=function(t){return d(t.contentNodes[0])&&y(t.contentNodes[1])},e.illegalSingleton_=["punctuation","punctuated","relseq","multirel","table","multiline","cases","inference"],e.scriptedElement_=["limupper","limlower","limboth","subscript","superscript","underscore","overscore","tensor"],e.isSingletonSetContent=function t(r){var n=r.type;return-1===e.illegalSingleton_.indexOf(n)&&("infixop"!==n||"implicit"===r.role)&&("fenced"===n?"leftright"!==r.role||t(r.childNodes[0]):-1===e.scriptedElement_.indexOf(n)||t(r.childNodes[0]))},e.isNumber=m,e.isUnitCounter=function(t){return m(t)||"vulgar"===t.role||"mixed"===t.role},e.isPureUnit=function(t){var e=t.childNodes;return"unit"===t.role&&(!e.length||"unit"===e[0].role)},e.isImplicit=function(t){return"implicit"===t.role||"unit"===t.role&&!!t.contentNodes.length&&t.contentNodes[0].textContent===n.invisibleTimes()},e.isImplicitOp=function(t){return"infixop"===t.type&&"implicit"===t.role},e.isNeutralFence=L,e.compareNeutralFences=function(t,e){return L(t)&&L(e)&&(0,o.getEmbellishedInner)(t).textContent===(0,o.getEmbellishedInner)(e).textContent},e.elligibleLeftNeutral=function(t){return!!L(t)&&(!t.embellished||"superscript"!==t.type&&"subscript"!==t.type&&("tensor"!==t.type||"empty"===t.childNodes[3].type&&"empty"===t.childNodes[4].type))},e.elligibleRightNeutral=function(t){return!!L(t)&&(!t.embellished||("tensor"!==t.type||"empty"===t.childNodes[1].type&&"empty"===t.childNodes[2].type))},e.isMembership=function(t){return["element","nonelement","reelement","renonelement"].includes(t.role)}},2552:function(t,e,r){"use strict";var n,o;function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a(t,e){return T(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,Q=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){Q=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(Q)throw o}}return i}(t,e)||c(t,e)||Q()}function Q(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function T(t){if(Array.isArray(t))return t}function s(t){return function(t){if(Array.isArray(t))return l(t)}(t)||u(t)||c(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function c(t,e){if(t){if("string"==typeof t)return l(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(t,e):void 0}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0){var i=t.nextSeparatorFunction_(n),a=[o.shift()];o.forEach((function(e){a.push(t.getInstance().factory_.makeContentNode(i())),a.push(e)})),o=a}return e&&r?t.getInstance().horizontalFencedNode_(t.getInstance().factory_.makeContentNode(e),t.getInstance().factory_.makeContentNode(r),o):(e&&o.unshift(t.getInstance().factory_.makeContentNode(e)),r&&o.push(t.getInstance().factory_.makeContentNode(r)),t.getInstance().row(o))}},{key:"fractionLikeNode",value:function(e,r,n,o){var i;if(!o&&L.isZeroLength(n)){var a=t.getInstance().factory_.makeBranchNode("line",[e],[]),Q=t.getInstance().factory_.makeBranchNode("line",[r],[]);return i=t.getInstance().factory_.makeBranchNode("multiline",[a,Q],[]),t.binomialForm_(i),t.classifyMultiline(i),i}return i=t.getInstance().fractionNode_(e,r),o&&i.addAnnotation("general","bevelled"),i}},{key:"tensor",value:function(e,r,n,o,i){var a=t.getInstance().factory_.makeBranchNode("tensor",[e,t.getInstance().scriptNode_(r,"leftsub"),t.getInstance().scriptNode_(n,"leftsuper"),t.getInstance().scriptNode_(o,"rightsub"),t.getInstance().scriptNode_(i,"rightsuper")],[]);return a.role=e.role,a.embellished=m.isEmbellished(e),a}},{key:"pseudoTensor",value:function(e,r,n){var o=function(t){return!m.isType(t,"empty")},i=r.filter(o).length,a=n.filter(o).length;if(!i&&!a)return e;var Q=i?a?"MSUBSUP":"MSUB":"MSUP",T=[e];return i&&T.push(t.getInstance().scriptNode_(r,"rightsub",!0)),a&&T.push(t.getInstance().scriptNode_(n,"rightsuper",!0)),t.getInstance().limitNode(Q,T)}},{key:"font",value:function(e){var r=t.MATHJAX_FONTS[e];return r||e}},{key:"proof",value:function(e,r,n){if(r.inference||r.axiom||console.log("Noise"),r.axiom){var o=t.getInstance().cleanInference(e.childNodes),i=o.length?t.getInstance().factory_.makeBranchNode("inference",n(o),[]):t.getInstance().factory_.makeEmptyNode();return i.role="axiom",i.mathmlTree=e,i}var a=t.getInstance().inference(e,r,n);return r.proof&&(a.role="proof",a.childNodes[0].role="final"),a}},{key:"inference",value:function(e,r,n){if(r.inferenceRule){var o=t.getInstance().getFormulas(e,[],n);return t.getInstance().factory_.makeBranchNode("inference",[o.conclusion,o.premises],[])}var i=r.labelledRule,a=p.toArray(e.childNodes),Q=[];"left"!==i&&"both"!==i||Q.push(t.getInstance().getLabel(e,a,n,"left")),"right"!==i&&"both"!==i||Q.push(t.getInstance().getLabel(e,a,n,"right"));var T=t.getInstance().getFormulas(e,a,n),s=t.getInstance().factory_.makeBranchNode("inference",[T.conclusion,T.premises],Q);return s.mathmlTree=e,s}},{key:"getLabel",value:function(e,r,n,o){var i=t.getInstance().findNestedRow(r,"prooflabel",o),a=t.getInstance().factory_.makeBranchNode("rulelabel",n(p.toArray(i.childNodes)),[]);return a.role=o,a.mathmlTree=i,a}},{key:"getFormulas",value:function(e,r,n){var o,i=r.length?t.getInstance().findNestedRow(r,"inferenceRule"):e,a="up"===t.getSemantics(i).inferenceRule,Q=a?i.childNodes[1]:i.childNodes[0],T=a?i.childNodes[0]:i.childNodes[1],s=Q.childNodes[0].childNodes[0],u=[],l=1,f=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=c(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,Q=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){Q=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(Q)throw i}}}}(p.toArray(s.childNodes[0].childNodes));try{for(f.s();!(o=f.n()).done;){var h=o.value;l%2&&u.push(h.childNodes[0]),l++}}catch(t){f.e(t)}finally{f.f()}var d=n(u),y=n(p.toArray(T.childNodes[0].childNodes))[0],m=t.getInstance().factory_.makeBranchNode("premises",d,[]);m.mathmlTree=s;var L=t.getInstance().factory_.makeBranchNode("conclusion",[y],[]);return L.mathmlTree=T.childNodes[0].childNodes[0],{conclusion:L,premises:m}}},{key:"findNestedRow",value:function(e,r,n){return t.getInstance().findNestedRow_(e,r,0,n)}},{key:"cleanInference",value:function(t){return p.toArray(t).filter((function(t){return"MSPACE"!==p.tagName(t)}))}},{key:"operatorNode",value:function(t){return"unknown"===t.type&&(t.type="operator"),d.run("multioperator",t)}},{key:"implicitNode_",value:function(e){var r=t.getInstance().factory_.makeMultipleContentNodes(e.length-1,h.invisibleTimes());t.matchSpaces_(e,r);var n=t.getInstance().infixNode_(e,r[0]);return n.role="implicit",r.forEach((function(t){t.parent=n})),n.contentNodes=r,n}},{key:"infixNode_",value:function(e,r){var n=t.getInstance().factory_.makeBranchNode("infixop",e,[r],L.getEmbellishedInner(r).textContent);return n.role=r.role,d.run("propagateSimpleFunction",n)}},{key:"explicitMixed_",value:function(e){var r=L.partitionNodes(e,(function(t){return t.textContent===h.invisiblePlus()}));if(!r.rel.length)return e;for(var n,o=[],i=0;n=r.rel[i];i++){var a=r.comp[i],Q=r.comp[i+1],T=a.length-1;if(a[T]&&Q[0]&&m.isType(a[T],"number")&&!m.isRole(a[T],"mixed")&&m.isType(Q[0],"fraction")){var s=t.getInstance().factory_.makeBranchNode("number",[a[T],Q[0]],[]);s.role="mixed",(o=o.concat(a.slice(0,T))).push(s),Q.shift()}else(o=o.concat(a)).push(n)}return o.concat(r.comp[r.comp.length-1])}},{key:"concatNode_",value:function(e,r,n){if(0===r.length)return e;var o=r.map((function(t){return L.getEmbellishedInner(t).textContent})).join(" "),i=t.getInstance().factory_.makeBranchNode(n,[e],r,o);return r.length>1&&(i.role="multiop"),i}},{key:"prefixNode_",value:function(e,r){var n=L.partitionNodes(r,(function(t){return m.isRole(t,"subtraction")})),o=t.getInstance().concatNode_(e,n.comp.pop(),"prefixop");for(1===o.contentNodes.length&&"addition"===o.contentNodes[0].role&&"+"===o.contentNodes[0].textContent&&(o.role="positive");n.rel.length>0;)(o=t.getInstance().concatNode_(o,[n.rel.pop()],"prefixop")).role="negative",o=t.getInstance().concatNode_(o,n.comp.pop(),"prefixop");return o}},{key:"postfixNode_",value:function(e,r){return r.length?t.getInstance().concatNode_(e,r,"postfixop"):e}},{key:"combineUnits_",value:function(e){var r=L.partitionNodes(e,(function(t){return!m.isRole(t,"unit")}));if(e.length===r.rel.length)return r.rel;var n,o,i=[];do{var a=r.comp.shift();n=r.rel.shift();var Q=null;(o=i.pop())&&(a.length&&m.isUnitCounter(o)?a.unshift(o):i.push(o)),1===a.length&&(Q=a.pop()),a.length>1&&((Q=t.getInstance().implicitNode_(a)).role="unit"),Q&&i.push(Q),n&&i.push(n)}while(n);return i}},{key:"getMixedNumbers_",value:function(e){var r=L.partitionNodes(e,(function(t){return m.isType(t,"fraction")&&m.isRole(t,"vulgar")}));if(!r.rel.length)return e;for(var n,o=[],i=0;n=r.rel[i];i++){var a=r.comp[i],Q=a.length-1;if(a[Q]&&m.isType(a[Q],"number")&&(m.isRole(a[Q],"integer")||m.isRole(a[Q],"float"))){var T=t.getInstance().factory_.makeBranchNode("number",[a[Q],n],[]);T.role="mixed",(o=o.concat(a.slice(0,Q))).push(T)}else(o=o.concat(a)).push(n)}return o.concat(r.comp[r.comp.length-1])}},{key:"getTextInRow_",value:function(e){if(e.length<=1)return e;var r=L.partitionNodes(e,(function(t){return m.isType(t,"text")}));if(0===r.rel.length)return e;var n=[],o=r.comp[0];o.length>0&&n.push(t.getInstance().row(o));for(var i,a=0;i=r.rel[a];a++)n.push(i),(o=r.comp[a+1]).length>0&&n.push(t.getInstance().row(o));return[t.getInstance().dummyNode_(n)]}},{key:"relationsInRow_",value:function(e){var r=L.partitionNodes(e,m.isRelation),n=r.rel[0];if(!n)return t.getInstance().operationsInRow_(e);if(1===e.length)return e[0];var o,i=r.comp.map(t.getInstance().operationsInRow_);return r.rel.some((function(t){return!t.equals(n)}))?(o=t.getInstance().factory_.makeBranchNode("multirel",i,r.rel),r.rel.every((function(t){return t.role===n.role}))&&(o.role=n.role),o):((o=t.getInstance().factory_.makeBranchNode("relseq",i,r.rel,L.getEmbellishedInner(n).textContent)).role=n.role,o)}},{key:"operationsInRow_",value:function(e){if(0===e.length)return t.getInstance().factory_.makeEmptyNode();if(1===(e=t.getInstance().explicitMixed_(e)).length)return e[0];for(var r=[];e.length>0&&m.isOperator(e[0]);)r.push(e.shift());if(0===e.length)return t.getInstance().prefixNode_(r.pop(),r);if(1===e.length)return t.getInstance().prefixNode_(e[0],r);e=d.run("convert_juxtaposition",e);var n=L.sliceNodes(e,m.isOperator),o=t.getInstance().prefixNode_(t.getInstance().implicitNode(n.head),r);return n.div?t.getInstance().operationsTree_(n.tail,o,n.div):o}},{key:"operationsTree_",value:function(e,r,n,o){var i=o||[];if(0===e.length){if(i.unshift(n),"infixop"===r.type){var a=t.getInstance().postfixNode_(r.childNodes.pop(),i);return r.appendChild(a),r}return t.getInstance().postfixNode_(r,i)}var Q=L.sliceNodes(e,m.isOperator);if(0===Q.head.length)return i.push(Q.div),t.getInstance().operationsTree_(Q.tail,r,n,i);var T=t.getInstance().prefixNode_(t.getInstance().implicitNode(Q.head),i),s=t.getInstance().appendOperand_(r,n,T);return Q.div?t.getInstance().operationsTree_(Q.tail,s,Q.div,[]):s}},{key:"appendOperand_",value:function(e,r,n){if("infixop"!==e.type)return t.getInstance().infixNode_([e,n],r);var o=t.getInstance().appendDivisionOp_(e,r,n);return o||(t.getInstance().appendExistingOperator_(e,r,n)?e:"multiplication"===r.role?t.getInstance().appendMultiplicativeOp_(e,r,n):t.getInstance().appendAdditiveOp_(e,r,n))}},{key:"appendDivisionOp_",value:function(e,r,n){return"division"===r.role?m.isImplicit(e)?t.getInstance().infixNode_([e,n],r):t.getInstance().appendLastOperand_(e,r,n):"division"===e.role?t.getInstance().infixNode_([e,n],r):null}},{key:"appendLastOperand_",value:function(e,r,n){for(var o=e,i=e.childNodes[e.childNodes.length-1];i&&"infixop"===i.type&&!m.isImplicit(i);)i=(o=i).childNodes[e.childNodes.length-1];var a=t.getInstance().infixNode_([o.childNodes.pop(),n],r);return o.appendChild(a),e}},{key:"appendMultiplicativeOp_",value:function(e,r,n){if(m.isImplicit(e))return t.getInstance().infixNode_([e,n],r);for(var o=e,i=e.childNodes[e.childNodes.length-1];i&&"infixop"===i.type&&!m.isImplicit(i);)i=(o=i).childNodes[e.childNodes.length-1];var a=t.getInstance().infixNode_([o.childNodes.pop(),n],r);return o.appendChild(a),e}},{key:"appendAdditiveOp_",value:function(e,r,n){return t.getInstance().infixNode_([e,n],r)}},{key:"appendExistingOperator_",value:function(e,r,n){return!(!e||"infixop"!==e.type||m.isImplicit(e))&&(e.contentNodes[0].equals(r)?(e.appendContentNode(r),e.appendChild(n),!0):t.getInstance().appendExistingOperator_(e.childNodes[e.childNodes.length-1],r,n))}},{key:"getFencesInRow_",value:function(e){var r=L.partitionNodes(e,m.isFence),n=(r=t.purgeFences_(r)).comp.shift();return t.getInstance().fences_(r.rel,r.comp,[],[n])}},{key:"fences_",value:function(e,r,n,o){if(0===e.length&&0===n.length)return o[0];var i=function(t){return m.isRole(t,"open")};if(0===e.length){for(var a=o.shift();n.length>0;){if(i(n[0])){var Q=n.shift();t.fenceToPunct_(Q),a.push(Q)}else{var T=L.sliceNodes(n,i),u=T.head.length-1,c=t.getInstance().neutralFences_(T.head,o.slice(0,u));o=o.slice(u),a.push.apply(a,s(c)),T.div&&T.tail.unshift(T.div),n=T.tail}a.push.apply(a,s(o.shift()))}return a}var l=n[n.length-1],f=e[0].role;if("open"===f||m.isNeutralFence(e[0])&&(!l||!m.compareNeutralFences(e[0],l))){n.push(e.shift());var p=r.shift();return p&&o.push(p),t.getInstance().fences_(e,r,n,o)}if(l&&"close"===f&&"open"===l.role){var h=t.getInstance().horizontalFencedNode_(n.pop(),e.shift(),o.pop());return o.push(o.pop().concat([h],r.shift())),t.getInstance().fences_(e,r,n,o)}if(l&&m.compareNeutralFences(e[0],l)){if(!m.elligibleLeftNeutral(l)||!m.elligibleRightNeutral(e[0])){n.push(e.shift());var d=r.shift();return d&&o.push(d),t.getInstance().fences_(e,r,n,o)}var y=t.getInstance().horizontalFencedNode_(n.pop(),e.shift(),o.pop());return o.push(o.pop().concat([y],r.shift())),t.getInstance().fences_(e,r,n,o)}if(l&&"close"===f&&m.isNeutralFence(l)&&n.some(i)){var v=L.sliceNodes(n,i,!0),b=o.pop(),g=o.length-v.tail.length+1,H=t.getInstance().neutralFences_(v.tail,o.slice(g));o=o.slice(0,g);var O=t.getInstance().horizontalFencedNode_(v.div,e.shift(),o.pop().concat(H,b));return o.push(o.pop().concat([O],r.shift())),t.getInstance().fences_(e,r,v.head,o)}var M=e.shift();return t.fenceToPunct_(M),o.push(o.pop().concat([M],r.shift())),t.getInstance().fences_(e,r,n,o)}},{key:"neutralFences_",value:function(e,r){if(0===e.length)return e;if(1===e.length)return t.fenceToPunct_(e[0]),e;var n=e.shift();if(!m.elligibleLeftNeutral(n)){t.fenceToPunct_(n);var o=r.shift();return o.unshift(n),o.concat(t.getInstance().neutralFences_(e,r))}var i=L.sliceNodes(e,(function(t){return m.compareNeutralFences(t,n)}));if(!i.div){t.fenceToPunct_(n);var a=r.shift();return a.unshift(n),a.concat(t.getInstance().neutralFences_(e,r))}if(!m.elligibleRightNeutral(i.div))return t.fenceToPunct_(i.div),e.unshift(n),t.getInstance().neutralFences_(e,r);var Q=t.getInstance().combineFencedContent_(n,i.div,i.head,r);if(i.tail.length>0){var T=Q.shift(),s=t.getInstance().neutralFences_(i.tail,Q);return T.concat(s)}return Q[0]}},{key:"combineFencedContent_",value:function(e,r,n,o){if(0===n.length){var i=t.getInstance().horizontalFencedNode_(e,r,o.shift());return o.length>0?o[0].unshift(i):o=[[i]],o}var a=o.shift(),Q=n.length-1,T=o.slice(0,Q),u=(o=o.slice(Q)).shift(),c=t.getInstance().neutralFences_(n,T);a.push.apply(a,s(c)),a.push.apply(a,s(u));var l=t.getInstance().horizontalFencedNode_(e,r,a);return o.length>0?o[0].unshift(l):o=[[l]],o}},{key:"horizontalFencedNode_",value:function(e,r,n){var o=t.getInstance().row(n),i=t.getInstance().factory_.makeBranchNode("fenced",[o],[e,r]);return"open"===e.role?(t.getInstance().classifyHorizontalFence_(i),i=d.run("propagateComposedFunction",i)):i.role=e.role,i=d.run("detect_cycle",i),t.rewriteFencedNode_(i)}},{key:"classifyHorizontalFence_",value:function(e){e.role="leftright";var r=e.childNodes;if(m.isSetNode(e)&&!(r.length>1))if(0!==r.length&&"empty"!==r[0].type){var n=r[0].type;if(1===r.length&&m.isSingletonSetContent(r[0]))e.role="set singleton";else{var o=r[0].role;if("punctuated"===n&&"sequence"===o){if("comma"!==r[0].contentNodes[0].role)return 1!==r[0].contentNodes.length||"vbar"!==r[0].contentNodes[0].role&&"colon"!==r[0].contentNodes[0].role?void 0:(e.role="set extended",void t.getInstance().setExtension_(e));e.role="set collection"}}}else e.role="set empty"}},{key:"setExtension_",value:function(t){var e=t.childNodes[0].childNodes[0];e&&"infixop"===e.type&&1===e.contentNodes.length&&m.isMembership(e.contentNodes[0])&&(e.addAnnotation("set","intensional"),e.contentNodes[0].addAnnotation("set","intensional"))}},{key:"getPunctuationInRow_",value:function(e){if(e.length<=1)return e;var r=function(t){var e=t.type;return"punctuation"===e||"text"===e||"operator"===e||"relation"===e},n=L.partitionNodes(e,(function(t){if(!m.isPunctuation(t))return!1;if(m.isPunctuation(t)&&!m.isRole(t,"ellipsis"))return!0;var n=e.indexOf(t);if(0===n)return!e[1]||!r(e[1]);var o=e[n-1];if(n===e.length-1)return!r(o);var i=e[n+1];return!r(o)||!r(i)}));if(0===n.rel.length)return e;var o=[],i=n.comp.shift();i.length>0&&o.push(t.getInstance().row(i));for(var a=0;n.comp.length>0;)o.push(n.rel[a++]),(i=n.comp.shift()).length>0&&o.push(t.getInstance().row(i));return[t.getInstance().punctuatedNode_(o,n.rel)]}},{key:"punctuatedNode_",value:function(e,r){var n=t.getInstance().factory_.makeBranchNode("punctuated",e,r);if(r.length===e.length){var o=r[0].role;if("unknown"!==o&&r.every((function(t){return t.role===o})))return n.role=o,n}return m.singlePunctAtPosition(e,r,0)?n.role="startpunct":m.singlePunctAtPosition(e,r,e.length-1)?n.role="endpunct":r.every((function(t){return m.isRole(t,"dummy")}))?n.role="text":r.every((function(t){return m.isRole(t,"space")}))?n.role="space":n.role="sequence",n}},{key:"dummyNode_",value:function(e){var r=t.getInstance().factory_.makeMultipleContentNodes(e.length-1,h.invisibleComma());return r.forEach((function(t){t.role="dummy"})),t.getInstance().punctuatedNode_(e,r)}},{key:"accentRole_",value:function(t,e){if(!m.isAccent(t))return!1;var r=t.textContent,n=h.lookupSecondary("bar",r)||h.lookupSecondary("tilde",r)||t.role;return t.role="underscore"===e?"underaccent":"overaccent",t.addAnnotation("accent",n),!0}},{key:"accentNode_",value:function(e,r,n,o,i){var a,Q=(r=r.slice(0,o+1))[1],T=r[2];if(!i&&T&&((a=t.getInstance().factory_.makeBranchNode("subscript",[e,Q],[])).role="subsup",r=[a,T],n="superscript"),i){var s=t.getInstance().accentRole_(Q,n);T&&(t.getInstance().accentRole_(T,"overscore")&&!s?(r=[a=t.getInstance().factory_.makeBranchNode("overscore",[e,T],[]),Q],n="underscore"):(r=[a=t.getInstance().factory_.makeBranchNode("underscore",[e,Q],[]),T],n="overscore"),a.role="underover")}return t.getInstance().makeLimitNode_(e,r,a,n)}},{key:"makeLimitNode_",value:function(e,r,n,o){if("limupper"===o&&"limlower"===e.type)return e.childNodes.push(r[1]),r[1].parent=e,e.type="limboth",e;if("limlower"===o&&"limupper"===e.type)return e.childNodes.splice(1,-1,r[1]),r[1].parent=e,e.type="limboth",e;var i=t.getInstance().factory_.makeBranchNode(o,r,[]),a=m.isEmbellished(e);return n&&(n.embellished=a),i.embellished=a,i.role=e.role,i}},{key:"getFunctionsInRow_",value:function(e,r){var n=r||[];if(0===e.length)return n;var o=e.shift(),i=t.classifyFunction_(o,e);if(!i)return n.push(o),t.getInstance().getFunctionsInRow_(e,n);var a=t.getInstance().getFunctionsInRow_(e,[]),Q=t.getInstance().getFunctionArgs_(o,a,i);return n.concat(Q)}},{key:"getFunctionArgs_",value:function(e,r,n){var o,i,a;switch(n){case"integral":var Q=t.getInstance().getIntegralArgs_(r);if(!Q.intvar&&!Q.integrand.length)return Q.rest.unshift(e),Q.rest;var T=t.getInstance().row(Q.integrand);return a=t.getInstance().integralNode_(e,T,Q.intvar),Q.rest.unshift(a),Q.rest;case"prefix":if(r[0]&&"fenced"===r[0].type){var s=r.shift();return m.isNeutralFence(s)||(s.role="leftright"),a=t.getInstance().functionNode_(e,s),r.unshift(a),r}if((o=L.sliceNodes(r,m.isPrefixFunctionBoundary)).head.length)i=t.getInstance().row(o.head),o.div&&o.tail.unshift(o.div);else{if(!o.div||!m.isType(o.div,"appl"))return r.unshift(e),r;i=o.div}return a=t.getInstance().functionNode_(e,i),o.tail.unshift(a),o.tail;case"bigop":return(o=L.sliceNodes(r,m.isBigOpBoundary)).head.length?(i=t.getInstance().row(o.head),a=t.getInstance().bigOpNode_(e,i),o.div&&o.tail.unshift(o.div),o.tail.unshift(a),o.tail):(r.unshift(e),r);default:if(0===r.length)return[e];var u=r[0];return"fenced"===u.type&&!m.isNeutralFence(u)&&m.isSimpleFunctionScope(u)?(u.role="leftright",t.propagateFunctionRole_(e,"simple function"),a=t.getInstance().functionNode_(e,r.shift()),r.unshift(a),r):(r.unshift(e),r)}}},{key:"getIntegralArgs_",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(0===e.length)return{integrand:r,intvar:null,rest:e};var n=e[0];if(m.isGeneralFunctionBoundary(n))return{integrand:r,intvar:null,rest:e};if(m.isIntegralDxBoundarySingle(n))return n.role="integral",{integrand:r,intvar:n,rest:e.slice(1)};if(e[1]&&m.isIntegralDxBoundary(n,e[1])){var o=t.getInstance().prefixNode_(e[1],[n]);return o.role="integral",{integrand:r,intvar:o,rest:e.slice(2)}}return r.push(e.shift()),t.getInstance().getIntegralArgs_(e,r)}},{key:"functionNode_",value:function(e,r){var n=t.getInstance().factory_.makeContentNode(h.functionApplication()),o=t.getInstance().funcAppls[e.id];o&&(n.mathmlTree=o.mathmlTree,n.mathml=o.mathml,n.annotation=o.annotation,n.attributes=o.attributes,delete t.getInstance().funcAppls[e.id]),n.type="punctuation",n.role="application";var i=t.getFunctionOp_(e,(function(t){return m.isType(t,"function")||m.isType(t,"identifier")&&m.isRole(t,"simple function")}));return t.getInstance().functionalNode_("appl",[e,r],i,[n])}},{key:"bigOpNode_",value:function(e,r){var n=t.getFunctionOp_(e,(function(t){return m.isType(t,"largeop")}));return t.getInstance().functionalNode_("bigop",[e,r],n,[])}},{key:"integralNode_",value:function(e,r,n){r=r||t.getInstance().factory_.makeEmptyNode(),n=n||t.getInstance().factory_.makeEmptyNode();var o=t.getFunctionOp_(e,(function(t){return m.isType(t,"largeop")}));return t.getInstance().functionalNode_("integral",[e,r,n],o,[])}},{key:"functionalNode_",value:function(e,r,n,o){var i,a=r[0];n&&(i=n.parent,o.push(n));var Q=t.getInstance().factory_.makeBranchNode(e,r,o);return Q.role=a.role,i&&(n.parent=i),Q}},{key:"fractionNode_",value:function(e,r){var n=t.getInstance().factory_.makeBranchNode("fraction",[e,r],[]);return n.role=n.childNodes.every((function(t){return m.isType(t,"number")&&m.isRole(t,"integer")}))?"vulgar":n.childNodes.every(m.isPureUnit)?"unit":"division",d.run("propagateSimpleFunction",n)}},{key:"scriptNode_",value:function(e,r,n){var o;switch(e.length){case 0:o=t.getInstance().factory_.makeEmptyNode();break;case 1:if(o=e[0],n)return o;break;default:o=t.getInstance().dummyNode_(e)}return o.role=r,o}},{key:"findNestedRow_",value:function(e,r,n,o){if(n>3)return null;for(var i,a=0;i=e[a];a++){var Q=p.tagName(i);if("MSPACE"!==Q){if("MROW"===Q)return t.getInstance().findNestedRow_(p.toArray(i.childNodes),r,n+1,o);if(t.findSemantics(i,r,o))return i}}return null}}],n=[{key:"getInstance",value:function(){return t.instance=t.instance||new t,t.instance}},{key:"tableToMultiline",value:function(e){if(m.tableIsMultiline(e)){e.type="multiline";for(var r,n=0;r=e.childNodes[n];n++)t.rowToLine_(r,"multiline");1===e.childNodes.length&&!m.lineIsLabelled(e.childNodes[0])&&m.isFencedElement(e.childNodes[0].childNodes[0])&&t.tableToMatrixOrVector_(t.rewriteFencedLine_(e)),t.binomialForm_(e),t.classifyMultiline(e)}else t.classifyTable(e)}},{key:"number",value:function(e){"unknown"!==e.type&&"identifier"!==e.type||(e.type="number"),t.numberRole_(e),t.exprFont_(e)}},{key:"classifyMultiline",value:function(t){for(var e,r=0,n=t.childNodes.length;r=n)){var o=e.childNodes[0].role;"unknown"!==o&&t.childNodes.every((function(t){var e=t.childNodes[0];return!e||e.role===o&&(m.isType(e,"relation")||m.isType(e,"relseq"))}))&&(t.role=o)}}},{key:"classifyTable",value:function(e){var r=t.computeColumns_(e);t.classifyByColumns_(e,r,"equality")||t.classifyByColumns_(e,r,"inequality",["equality"])||t.classifyByColumns_(e,r,"arrow")||t.detectCaleyTable(e)}},{key:"detectCaleyTable",value:function(e){if(!e.mathmlTree)return!1;var r=e.mathmlTree,n=r.getAttribute("columnlines"),o=r.getAttribute("rowlines");return!(!n||!o||!t.cayleySpacing(n)||!t.cayleySpacing(o)||(e.role="cayley",0))}},{key:"cayleySpacing",value:function(t){var e=t.split(" ");return("solid"===e[0]||"dashed"===e[0])&&e.slice(1).every((function(t){return"none"===t}))}},{key:"proof",value:function(e,r,n){var o=t.separateSemantics(r);return t.getInstance().proof(e,o,n)}},{key:"findSemantics",value:function(e,r,n){var o=null==n?null:n,i=t.getSemantics(e);return!(!i||!i[r]||null!=o&&i[r]!==o)}},{key:"getSemantics",value:function(e){var r=e.getAttribute("semantics");return r?t.separateSemantics(r):null}},{key:"removePrefix",value:function(t){var e,r=t.split("_");return(T(e=r)||u(e)||c(e)||Q()).slice(1).join("_")}},{key:"separateSemantics",value:function(e){var r={};return e.split(";").forEach((function(e){var n=a(e.split(":"),2),o=n[0],i=n[1];r[t.removePrefix(o)]=i})),r}},{key:"matchSpaces_",value:function(e,r){for(var n,o=0;n=r[o];o++){var i=e[o].mathmlTree,a=e[o+1].mathmlTree;if(i&&a){var Q=i.nextSibling;if(Q&&Q!==a){var T=t.getSpacer_(Q);T&&(n.mathml.push(T),n.mathmlTree=T,n.role="space")}}}}},{key:"getSpacer_",value:function(t){if("MSPACE"===p.tagName(t))return t;for(;L.hasEmptyTag(t)&&1===t.childNodes.length;)if(t=t.childNodes[0],"MSPACE"===p.tagName(t))return t;return null}},{key:"fenceToPunct_",value:function(e){var r=t.FENCE_TO_PUNCT_[e.role];if(r){for(;e.embellished;)e.embellished="punctuation",m.isRole(e,"subsup")||m.isRole(e,"underover")||(e.role=r),e=e.childNodes[0];e.type="punctuation",e.role=r}}},{key:"classifyFunction_",value:function(e,r){if("appl"===e.type||"bigop"===e.type||"integral"===e.type)return"";if(r[0]&&r[0].textContent===h.functionApplication()){t.getInstance().funcAppls[e.id]=r.shift();var n="simple function";return d.run("simple2prefix",e),"prefix function"!==e.role&&"limit function"!==e.role||(n=e.role),t.propagateFunctionRole_(e,n),"prefix"}var o=t.CLASSIFY_FUNCTION_[e.role];return o||(m.isSimpleFunctionHead(e)?"simple":"")}},{key:"propagateFunctionRole_",value:function(e,r){if(e){if("infixop"===e.type)return;m.isRole(e,"subsup")||m.isRole(e,"underover")||(e.role=r),t.propagateFunctionRole_(e.childNodes[0],r)}}},{key:"getFunctionOp_",value:function(e,r){if(r(e))return e;for(var n,o=0;n=e.childNodes[o];o++){var i=t.getFunctionOp_(n,r);if(i)return i}return null}},{key:"tableToMatrixOrVector_",value:function(e){var r=e.childNodes[0];m.isType(r,"multiline")?t.tableToVector_(e):t.tableToMatrix_(e),e.contentNodes.forEach(r.appendContentNode.bind(r));for(var n,o=0;n=r.childNodes[o];o++)t.assignRoleToRow_(n,t.getComponentRoles_(r));return r.parent=null,r}},{key:"tableToVector_",value:function(e){var r=e.childNodes[0];r.type="vector",1!==r.childNodes.length?t.binomialForm_(r):t.tableToSquare_(e)}},{key:"binomialForm_",value:function(t){m.isBinomial(t)&&(t.role="binomial",t.childNodes[0].role="binomial",t.childNodes[1].role="binomial")}},{key:"tableToMatrix_",value:function(e){var r=e.childNodes[0];r.type="matrix",r.childNodes&&r.childNodes.length>0&&r.childNodes[0].childNodes&&r.childNodes.length===r.childNodes[0].childNodes.length?t.tableToSquare_(e):r.childNodes&&1===r.childNodes.length&&(r.role="rowvector")}},{key:"tableToSquare_",value:function(t){var e=t.childNodes[0];m.isNeutralFence(t)?e.role="determinant":e.role="squarematrix"}},{key:"getComponentRoles_",value:function(t){var e=t.role;return e&&"unknown"!==e?e:t.type.toLowerCase()||"unknown"}},{key:"tableToCases_",value:function(e,r){for(var n,o=0;n=e.childNodes[o];o++)t.assignRoleToRow_(n,"cases");return e.type="cases",e.appendContentNode(r),m.tableIsMultiline(e)&&t.binomialForm_(e),e}},{key:"rewriteFencedLine_",value:function(t){var e=t.childNodes[0],r=t.childNodes[0].childNodes[0],n=t.childNodes[0].childNodes[0].childNodes[0];return r.parent=t.parent,t.parent=r,n.parent=e,r.childNodes=[t],e.childNodes=[n],r}},{key:"rowToLine_",value:function(t,e){var r=e||"unknown";m.isType(t,"row")&&(t.type="line",t.role=r,1===t.childNodes.length&&m.isType(t.childNodes[0],"cell")&&(t.childNodes=t.childNodes[0].childNodes,t.childNodes.forEach((function(e){e.parent=t}))))}},{key:"assignRoleToRow_",value:function(t,e){m.isType(t,"line")?t.role=e:m.isType(t,"row")&&(t.role=e,t.childNodes.forEach((function(t){m.isType(t,"cell")&&(t.role=e)})))}},{key:"nextSeparatorFunction_",value:function(t){var e;if(t){if(t.match(/^\s+$/))return null;e=t.replace(/\s/g,"").split("").filter((function(t){return t}))}else e=[","];return function(){return e.length>1?e.shift():e[0]}}},{key:"numberRole_",value:function(t){if("unknown"===t.role){var e=s(t.textContent).filter((function(t){return t.match(/[^\s]/)})),r=e.map(h.lookupMeaning);if(r.every((function(t){return"number"===t.type&&"integer"===t.role||"punctuation"===t.type&&"comma"===t.role})))return t.role="integer",void("0"===e[0]&&t.addAnnotation("general","basenumber"));r.every((function(t){return"number"===t.type&&"integer"===t.role||"punctuation"===t.type}))?t.role="float":t.role="othernumber"}}},{key:"exprFont_",value:function(t){if("unknown"===t.font){var e=s(t.textContent).map(h.lookupMeaning).reduce((function(t,e){return t&&e.font&&"unknown"!==e.font&&e.font!==t?"unknown"===t?e.font:null:t}),"unknown");e&&(t.font=e)}}},{key:"purgeFences_",value:function(e){for(var r=e.rel,n=e.comp,o=[],i=[];r.length>0;){var a=r.shift(),Q=n.shift();m.isElligibleEmbellishedFence(a)?(o.push(a),i.push(Q)):(t.fenceToPunct_(a),Q.push(a),Q=Q.concat(n.shift()),n.unshift(Q))}return i.push(n.shift()),{rel:o,comp:i}}},{key:"rewriteFencedNode_",value:function(e){var r=e.contentNodes[0],n=e.contentNodes[1],o=t.rewriteFence_(e,r);return e.contentNodes[0]=o.fence,o=t.rewriteFence_(o.node,n),e.contentNodes[1]=o.fence,e.contentNodes[0].parent=e,e.contentNodes[1].parent=e,o.node.parent=null,o.node}},{key:"rewriteFence_",value:function(e,r){if(!r.embellished)return{node:e,fence:r};var n=r.childNodes[0],o=t.rewriteFence_(e,n);return m.isType(r,"superscript")||m.isType(r,"subscript")||m.isType(r,"tensor")?(m.isRole(r,"subsup")||(r.role=e.role),n!==o.node&&(r.replaceChild(n,o.node),n.parent=e),t.propagateFencePointer_(r,n),{node:r,fence:o.fence}):(r.replaceChild(n,o.fence),r.mathmlTree&&-1===r.mathml.indexOf(r.mathmlTree)&&r.mathml.push(r.mathmlTree),{node:o.node,fence:r})}},{key:"propagateFencePointer_",value:function(t,e){t.fencePointer=e.fencePointer||e.id.toString(),t.embellished=null}},{key:"classifyByColumns_",value:function(e,r,n,o){return!!(3===r.length&&t.testColumns_(r,1,(function(e){return t.isPureRelation_(e,n)}))||2===r.length&&(t.testColumns_(r,1,(function(e){return t.isEndRelation_(e,n)||t.isPureRelation_(e,n)}))||t.testColumns_(r,0,(function(e){return t.isEndRelation_(e,n,!0)||t.isPureRelation_(e,n)}))))&&(e.role=n,!0)}},{key:"isEndRelation_",value:function(t,e,r){var n=r?t.childNodes.length-1:0;return m.isType(t,"relseq")&&m.isRole(t,e)&&m.isType(t.childNodes[n],"empty")}},{key:"isPureRelation_",value:function(t,e){return m.isType(t,"relation")&&m.isRole(t,e)}},{key:"computeColumns_",value:function(t){for(var e,r=[],n=0;e=t.childNodes[n];n++)for(var o,i=0;o=e.childNodes[i];i++)r[i]?r[i].push(o):r[i]=[o];return r}},{key:"testColumns_",value:function(t,e,r){var n=t[e];return!!n&&n.some((function(t){return t.childNodes.length&&r(t.childNodes[0])}))&&n.every((function(t){return!t.childNodes.length||r(t.childNodes[0])}))}}],r&&f(e.prototype,r),n&&f(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.default=v,v.FENCE_TO_PUNCT_=(i(n={},"metric","metric"),i(n,"neutral","vbar"),i(n,"open","openfence"),i(n,"close","closefence"),n),v.MML_TO_LIMIT_={MSUB:{type:"limlower",length:1},MUNDER:{type:"limlower",length:1},MSUP:{type:"limupper",length:1},MOVER:{type:"limupper",length:1},MSUBSUP:{type:"limboth",length:2},MUNDEROVER:{type:"limboth",length:2}},v.MML_TO_BOUNDS_={MSUB:{type:"subscript",length:1,accent:!1},MSUP:{type:"superscript",length:1,accent:!1},MSUBSUP:{type:"subscript",length:2,accent:!1},MUNDER:{type:"underscore",length:1,accent:!0},MOVER:{type:"overscore",length:1,accent:!0},MUNDEROVER:{type:"underscore",length:2,accent:!0}},v.CLASSIFY_FUNCTION_=(i(o={},"integral","integral"),i(o,"sum","bigop"),i(o,"prefix function","prefix"),i(o,"limit function","prefix"),i(o,"simple function","prefix"),i(o,"composed function","prefix"),o),v.MATHJAX_FONTS={"-tex-caligraphic":"caligraphic","-tex-caligraphic-bold":"caligraphic-bold","-tex-calligraphic":"caligraphic","-tex-calligraphic-bold":"caligraphic-bold","-tex-oldstyle":"oldstyle","-tex-oldstyle-bold":"oldstyle-bold","-tex-mathit":"italic"}},6120:function(t,e,r){"use strict";function n(t,e){for(var r=0;r"),r=new t(e);return r.mathml=e,r}},{key:"fromNode",value:function(e,r){var n=t.empty();return n.root=e,r&&(n.mathml=r),n}},{key:"fromRoot",value:function(e,r){for(var n=e;n.parent;)n=n.parent;var o=t.fromNode(n);return r&&(o.mathml=r),o}},{key:"fromXml",value:function(e){var r=t.empty();return e.childNodes[0]&&(r.root=T.SemanticNode.fromXml(e.childNodes[0])),r}}],(r=[{key:"xml",value:function(t){var e=o.parseInput(""),r=this.root.xml(e.ownerDocument,t);return e.appendChild(r),e}},{key:"toString",value:function(t){return o.serializeXml(this.xml(t))}},{key:"formatXml",value:function(t){var e=this.toString(t);return o.formatXml(e)}},{key:"displayTree",value:function(){this.root.displayTree()}},{key:"replaceNode",value:function(t,e){var r=t.parent;r?r.replaceChild(t,e):this.root=e}},{key:"toJson",value:function(){var t={};return t.stree=this.root.toJson(),t}}])&&n(e.prototype,r),a&&n(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.SemanticTree=u;var c=new a.SemanticVisitor("general","unit",(function(t,e){if("infixop"===t.type&&("multiplication"===t.role||"implicit"===t.role)){var r=t.childNodes;r.length&&(s.isPureUnit(r[0])||s.isUnitCounter(r[0]))&&t.childNodes.slice(1).every(s.isPureUnit)&&(t.role="unit")}return!1}))},9810:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.partitionNodes=e.sliceNodes=e.getEmbellishedInner=e.addAttributes=e.isZeroLength=e.purgeNodes=e.isOrphanedGlyph=e.hasDisplayTag=e.hasEmptyTag=e.hasIgnoreTag=e.hasLeafTag=e.hasMathTag=e.directSpeechKeys=e.DISPLAYTAGS=e.EMPTYTAGS=e.IGNORETAGS=e.LEAFTAGS=void 0;var n=r(6687);function o(t){return!!t&&-1!==e.LEAFTAGS.indexOf(n.tagName(t))}function i(t,e,r){r&&t.reverse();for(var n,o=[],i=0;n=t[i];i++){if(e(n))return r?{head:t.slice(i+1).reverse(),div:n,tail:o.reverse()}:{head:o,div:n,tail:t.slice(i+1)};o.push(n)}return r?{head:[],div:null,tail:o.reverse()}:{head:o,div:null,tail:[]}}e.LEAFTAGS=["MO","MI","MN","MTEXT","MS","MSPACE"],e.IGNORETAGS=["MERROR","MPHANTOM","MALIGNGROUP","MALIGNMARK","MPRESCRIPTS","ANNOTATION","ANNOTATION-XML"],e.EMPTYTAGS=["MATH","MROW","MPADDED","MACTION","NONE","MSTYLE","SEMANTICS"],e.DISPLAYTAGS=["MROOT","MSQRT"],e.directSpeechKeys=["aria-label","exact-speech","alt"],e.hasMathTag=function(t){return!!t&&"MATH"===n.tagName(t)},e.hasLeafTag=o,e.hasIgnoreTag=function(t){return!!t&&-1!==e.IGNORETAGS.indexOf(n.tagName(t))},e.hasEmptyTag=function(t){return!!t&&-1!==e.EMPTYTAGS.indexOf(n.tagName(t))},e.hasDisplayTag=function(t){return!!t&&-1!==e.DISPLAYTAGS.indexOf(n.tagName(t))},e.isOrphanedGlyph=function(t){return!!t&&"MGLYPH"===n.tagName(t)&&!o(t.parentNode)},e.purgeNodes=function(t){for(var r,o=[],i=0;r=t[i];i++)if(r.nodeType===n.NodeType.ELEMENT_NODE){var a=n.tagName(r);-1===e.IGNORETAGS.indexOf(a)&&(-1!==e.EMPTYTAGS.indexOf(a)&&0===r.childNodes.length||o.push(r))}return o},e.isZeroLength=function(t){if(!t)return!1;if(-1!==["negativeveryverythinmathspace","negativeverythinmathspace","negativethinmathspace","negativemediummathspace","negativethickmathspace","negativeverythickmathspace","negativeveryverythickmathspace"].indexOf(t))return!0;var e=t.match(/[0-9.]+/);return!!e&&0===parseFloat(e[0])},e.addAttributes=function(t,r){if(r.hasAttributes())for(var n=r.attributes,o=n.length-1;o>=0;o--){var i=n[o].name;i.match(/^ext/)&&(t.attributes[i]=n[o].value,t.nobreaking=!0),-1!==e.directSpeechKeys.indexOf(i)&&(t.attributes["ext-speech"]=n[o].value,t.nobreaking=!0),i.match(/texclass$/)&&(t.attributes.texclass=n[o].value),"href"===i&&(t.attributes.href=n[o].value,t.nobreaking=!0)}},e.getEmbellishedInner=function t(e){return e&&e.embellished&&e.childNodes.length>0?t(e.childNodes[0]):e},e.sliceNodes=i,e.partitionNodes=function(t,e){var r=t,n=[],o=[],a=null;do{a=i(r,e),o.push(a.head),n.push(a.div),r=a.tail}while(a.div);return n.pop(),{rel:n,comp:o}}},3116:function(t,e,r){"use strict";function n(t,e){for(var r=0;r=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,Q=!0,T=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return Q=t.done,t},e:function(t){T=!0,a=t},f:function(){try{Q||null==r.return||r.return()}finally{if(T)throw a}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&(n=h(t,r)||n),n?Q.SpeechRuleEngine.getInstance().runInSetting({modality:"prefix",domain:"default",style:"default",strict:!0,speech:!0},(function(){return Q.SpeechRuleEngine.getInstance().evaluateNode(n)})):[]}function h(t,e){var r=e[0];if(!t.parent)return r;for(var n=[];t;)n.push(t.id),t=t.parent;for(var o,i=function(t,e){for(;e.length&&e.shift().toString()===t.getAttribute("id")&&t.parentNode&&t.parentNode.parentNode;)t=t.parentNode.parentNode;return!e.length},a=0;o=e[a];a++)if(i(o,n.slice()))return o;return r}function d(t){return t?Q.SpeechRuleEngine.getInstance().runInSetting({modality:"summary",strict:!1,speech:!0},(function(){return Q.SpeechRuleEngine.getInstance().evaluateNode(t)})):[]}e.computeSpeech=u,e.recomputeSpeech=c,e.computeMarkup=function(t){var e=u(t);return n.markup(e)},e.recomputeMarkup=l,e.addSpeech=function(t,e,r){var i=o.querySelectorAllByAttrValue(r,"id",e.id.toString())[0],Q=i?n.markup(u(i)):l(e);t.setAttribute(a.Attribute.SPEECH,Q)},e.addModality=function(t,e,r){var n=l(e);t.setAttribute(r,n)},e.addPrefix=function(t,e){var r=f(e);r&&t.setAttribute(a.Attribute.PREFIX,r)},e.retrievePrefix=f,e.computePrefix_=p,e.nodeAtPosition_=h,e.connectMactions=function(t,e,r){for(var n,i=o.querySelectorAll(e,"maction"),Q=0;n=i[Q];Q++){var T=n.getAttribute("id"),u=o.querySelectorAllByAttrValue(t,"id",T)[0];if(u){var c=n.childNodes[1],l=c.getAttribute(a.Attribute.ID),f=s.getBySemanticId(t,l);if(!(f&&"dummy"!==f.getAttribute(a.Attribute.TYPE)||(f=u.childNodes[0]).getAttribute("sre-highlighter-added"))){var p=c.getAttribute(a.Attribute.PARENT);p&&f.setAttribute(a.Attribute.PARENT,p),f.setAttribute(a.Attribute.TYPE,"dummy"),f.setAttribute(a.Attribute.ID,l),o.querySelectorAllByAttrValue(r,"id",l)[0].setAttribute("alternative",l)}}}},e.connectAllMactions=function(t,e){for(var r,n=o.querySelectorAll(t,"maction"),i=0;r=n[i];i++){var Q=r.childNodes[1].getAttribute(a.Attribute.ID);o.querySelectorAllByAttrValue(e,"id",Q)[0].setAttribute("alternative",Q)}},e.retrieveSummary=function(t){var e=d(t);return n.markup(e)},e.computeSummary_=d},6271:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r3?r:("000"+r).slice(-4));!1!==e[c]&&(c=e[c]||c,s.push(c))}return s}function h(t){var e="normal"===t||"fullwidth"===t?"":u.LOCALE.MESSAGES.font[t]||u.LOCALE.MESSAGES.embellish[t]||"";return(0,c.localeFontCombiner)(e)}function d(t,r,n,o,i,a){for(var Q,T,s,c=h(o),l=0;Q=t[l],T=r[l],s=n[l];l++){var f=a?u.LOCALE.ALPHABETS.capPrefix:u.LOCALE.ALPHABETS.smallPrefix,p=a?e.Domains_.capital:e.Domains_.small;m(c.combiner,Q,T,s,c.font,f,i,u.LOCALE.ALPHABETS.letterTrans,p)}}function y(t,r,n,o,i){for(var a,Q,T=h(n),s=0;a=t[s],Q=r[s];s++){var c=u.LOCALE.ALPHABETS.digitPrefix,l=s+i;m(T.combiner,a,Q,l,T.font,c,o,u.LOCALE.ALPHABETS.digitTrans,e.Domains_.digit)}}function m(t,e,r,n,o,i,a,Q,T){for(var s,u=0;s=T[u];u++){var c=s in Q?Q[s]:Q.default,f=s in i?i[s]:i.default;l.defineRule(e.toString(),s,"default",a,r,t(c(n),o,f))}}!function(t){t.BOLD="bold",t.BOLDFRAKTUR="bold-fraktur",t.BOLDITALIC="bold-italic",t.BOLDSCRIPT="bold-script",t.DOUBLESTRUCK="double-struck",t.FULLWIDTH="fullwidth",t.FRAKTUR="fraktur",t.ITALIC="italic",t.MONOSPACE="monospace",t.NORMAL="normal",t.SCRIPT="script",t.SANSSERIF="sans-serif",t.SANSSERIFITALIC="sans-serif-italic",t.SANSSERIFBOLD="sans-serif-bold",t.SANSSERIFBOLDITALIC="sans-serif-bold-italic"}(i=e.Font||(e.Font={})),function(t){t.SUPER="super",t.SUB="sub",t.CIRCLED="circled",t.PARENTHESIZED="parenthesized",t.PERIOD="period",t.NEGATIVECIRCLED="negative-circled",t.DOUBLECIRCLED="double-circled",t.CIRCLEDSANSSERIF="circled-sans-serif",t.NEGATIVECIRCLEDSANSSERIF="negative-circled-sans-serif",t.COMMA="comma",t.SQUARED="squared",t.NEGATIVESQUARED="negative-squared"}(a=e.Embellish||(e.Embellish={})),function(t){t.LATINCAP="latinCap",t.LATINSMALL="latinSmall",t.GREEKCAP="greekCap",t.GREEKSMALL="greekSmall",t.DIGIT="digit"}(Q=e.Base||(e.Base={})),e.Domains_={small:["default"],capital:["default"],digit:["default"]},e.makeDomains_=f,e.generate=function(t){var r=T.default.getInstance().locale;T.default.getInstance().locale=t,s.setLocale(),l.addSymbolRules({locale:t}),f();for(var n,o=e.INTERVALS,i=0;n=o[i];i++){var a=p(n.interval,n.subst),Q=a.map((function(t){return String.fromCodePoint(parseInt(t,16))}));if("offset"in n)y(a,Q,n.font,n.category,n.offset||0);else d(a,Q,u.LOCALE.ALPHABETS[n.base],n.font,n.category,!!n.capital)}T.default.getInstance().locale=r,s.setLocale()},e.makeInterval=p,e.getFont=h,e.alphabetRules=d,e.numberRules=y,e.makeLetter=m,e.INTERVALS=[{interval:["1D400","1D419"],base:Q.LATINCAP,subst:{},capital:!0,category:"Lu",font:i.BOLD},{interval:["1D41A","1D433"],base:Q.LATINSMALL,subst:{},capital:!1,category:"Ll",font:i.BOLD},{interval:["1D56C","1D585"],base:Q.LATINCAP,subst:{},capital:!0,category:"Lu",font:i.BOLDFRAKTUR},{interval:["1D586","1D59F"],base:Q.LATINSMALL,subst:{},capital:!1,category:"Ll",font:i.BOLDFRAKTUR},{interval:["1D468","1D481"],base:Q.LATINCAP,subst:{},capital:!0,category:"Lu",font:i.BOLDITALIC},{interval:["1D482","1D49B"],base:Q.LATINSMALL,subst:{},capital:!1,category:"Ll",font:i.BOLDITALIC},{interval:["1D4D0","1D4E9"],base:Q.LATINCAP,subst:{},capital:!0,category:"Lu",font:i.BOLDSCRIPT},{interval:["1D4EA","1D503"],base:Q.LATINSMALL,subst:{},capital:!1,category:"Ll",font:i.BOLDSCRIPT},{interval:["1D538","1D551"],base:Q.LATINCAP,subst:{"1D53A":"2102","1D53F":"210D","1D545":"2115","1D547":"2119","1D548":"211A","1D549":"211D","1D551":"2124"},capital:!0,category:"Lu",font:i.DOUBLESTRUCK},{interval:["1D552","1D56B"],base:Q.LATINSMALL,subst:{},capital:!1,category:"Ll",font:i.DOUBLESTRUCK},{interval:["1D504","1D51D"],base:Q.LATINCAP,subst:{"1D506":"212D","1D50B":"210C","1D50C":"2111","1D515":"211C","1D51D":"2128"},capital:!0,category:"Lu",font:i.FRAKTUR},{interval:["1D51E","1D537"],base:Q.LATINSMALL,subst:{},capital:!1,category:"Ll",font:i.FRAKTUR},{interval:["FF21","FF3A"],base:Q.LATINCAP,subst:{},capital:!0,category:"Lu",font:i.FULLWIDTH},{interval:["FF41","FF5A"],base:Q.LATINSMALL,subst:{},capital:!1,category:"Ll",font:i.FULLWIDTH},{interval:["1D434","1D44D"],base:Q.LATINCAP,subst:{},capital:!0,category:"Lu",font:i.ITALIC},{interval:["1D44E","1D467"],base:Q.LATINSMALL,subst:{"1D455":"210E"},capital:!1,category:"Ll",font:i.ITALIC},{interval:["1D670","1D689"],base:Q.LATINCAP,subst:{},capital:!0,category:"Lu",font:i.MONOSPACE},{interval:["1D68A","1D6A3"],base:Q.LATINSMALL,subst:{},capital:!1,category:"Ll",font:i.MONOSPACE},{interval:["0041","005A"],base:Q.LATINCAP,subst:{},capital:!0,category:"Lu",font:i.NORMAL},{interval:["0061","007A"],base:Q.LATINSMALL,subst:{},capital:!1,category:"Ll",font:i.NORMAL},{interval:["1D49C","1D4B5"],base:Q.LATINCAP,subst:{"1D49D":"212C","1D4A0":"2130","1D4A1":"2131","1D4A3":"210B","1D4A4":"2110","1D4A7":"2112","1D4A8":"2133","1D4AD":"211B"},capital:!0,category:"Lu",font:i.SCRIPT},{interval:["1D4B6","1D4CF"],base:Q.LATINSMALL,subst:{"1D4BA":"212F","1D4BC":"210A","1D4C4":"2134"},capital:!1,category:"Ll",font:i.SCRIPT},{interval:["1D5A0","1D5B9"],base:Q.LATINCAP,subst:{},capital:!0,category:"Lu",font:i.SANSSERIF},{interval:["1D5BA","1D5D3"],base:Q.LATINSMALL,subst:{},capital:!1,category:"Ll",font:i.SANSSERIF},{interval:["1D608","1D621"],base:Q.LATINCAP,subst:{},capital:!0,category:"Lu",font:i.SANSSERIFITALIC},{interval:["1D622","1D63B"],base:Q.LATINSMALL,subst:{},capital:!1,category:"Ll",font:i.SANSSERIFITALIC},{interval:["1D5D4","1D5ED"],base:Q.LATINCAP,subst:{},capital:!0,category:"Lu",font:i.SANSSERIFBOLD},{interval:["1D5EE","1D607"],base:Q.LATINSMALL,subst:{},capital:!1,category:"Ll",font:i.SANSSERIFBOLD},{interval:["1D63C","1D655"],base:Q.LATINCAP,subst:{},capital:!0,category:"Lu",font:i.SANSSERIFBOLDITALIC},{interval:["1D656","1D66F"],base:Q.LATINSMALL,subst:{},capital:!1,category:"Ll",font:i.SANSSERIFBOLDITALIC},{interval:["0391","03A9"],base:Q.GREEKCAP,subst:{"03A2":"03F4"},capital:!0,category:"Lu",font:i.NORMAL},{interval:["03B0","03D0"],base:Q.GREEKSMALL,subst:{"03B0":"2207","03CA":"2202","03CB":"03F5","03CC":"03D1","03CD":"03F0","03CE":"03D5","03CF":"03F1","03D0":"03D6"},capital:!1,category:"Ll",font:i.NORMAL},{interval:["1D6A8","1D6C0"],base:Q.GREEKCAP,subst:{},capital:!0,category:"Lu",font:i.BOLD},{interval:["1D6C1","1D6E1"],base:Q.GREEKSMALL,subst:{},capital:!1,category:"Ll",font:i.BOLD},{interval:["1D6E2","1D6FA"],base:Q.GREEKCAP,subst:{},capital:!0,category:"Lu",font:i.ITALIC},{interval:["1D6FB","1D71B"],base:Q.GREEKSMALL,subst:{},capital:!1,category:"Ll",font:i.ITALIC},{interval:["1D71C","1D734"],base:Q.GREEKCAP,subst:{},capital:!0,category:"Lu",font:i.BOLDITALIC},{interval:["1D735","1D755"],base:Q.GREEKSMALL,subst:{},capital:!1,category:"Ll",font:i.BOLDITALIC},{interval:["1D756","1D76E"],base:Q.GREEKCAP,subst:{},capital:!0,category:"Lu",font:i.SANSSERIFBOLD},{interval:["1D76F","1D78F"],base:Q.GREEKSMALL,subst:{},capital:!1,category:"Ll",font:i.SANSSERIFBOLD},{interval:["1D790","1D7A8"],base:Q.GREEKCAP,subst:{},capital:!0,category:"Lu",font:i.SANSSERIFBOLDITALIC},{interval:["1D7A9","1D7C9"],base:Q.GREEKSMALL,subst:{},capital:!1,category:"Ll",font:i.SANSSERIFBOLDITALIC},{interval:["0030","0039"],base:Q.DIGIT,subst:{},offset:0,category:"Nd",font:i.NORMAL},{interval:["2070","2079"],base:Q.DIGIT,subst:{2071:"00B9",2072:"00B2",2073:"00B3"},offset:0,category:"No",font:a.SUPER},{interval:["2080","2089"],base:Q.DIGIT,subst:{},offset:0,category:"No",font:a.SUB},{interval:["245F","2473"],base:Q.DIGIT,subst:{"245F":"24EA"},offset:0,category:"No",font:a.CIRCLED},{interval:["3251","325F"],base:Q.DIGIT,subst:{},offset:21,category:"No",font:a.CIRCLED},{interval:["32B1","32BF"],base:Q.DIGIT,subst:{},offset:36,category:"No",font:a.CIRCLED},{interval:["2474","2487"],base:Q.DIGIT,subst:{},offset:1,category:"No",font:a.PARENTHESIZED},{interval:["2487","249B"],base:Q.DIGIT,subst:{2487:"1F100"},offset:0,category:"No",font:a.PERIOD},{interval:["2775","277F"],base:Q.DIGIT,subst:{2775:"24FF"},offset:0,category:"No",font:a.NEGATIVECIRCLED},{interval:["24EB","24F4"],base:Q.DIGIT,subst:{},offset:11,category:"No",font:a.NEGATIVECIRCLED},{interval:["24F5","24FE"],base:Q.DIGIT,subst:{},offset:1,category:"No",font:a.DOUBLECIRCLED},{interval:["277F","2789"],base:Q.DIGIT,subst:{"277F":"1F10B"},offset:0,category:"No",font:a.CIRCLEDSANSSERIF},{interval:["2789","2793"],base:Q.DIGIT,subst:{2789:"1F10C"},offset:0,category:"No",font:a.NEGATIVECIRCLEDSANSSERIF},{interval:["FF10","FF19"],base:Q.DIGIT,subst:{},offset:0,category:"Nd",font:i.FULLWIDTH},{interval:["1D7CE","1D7D7"],base:Q.DIGIT,subst:{},offset:0,category:"Nd",font:i.BOLD},{interval:["1D7D8","1D7E1"],base:Q.DIGIT,subst:{},offset:0,category:"Nd",font:i.DOUBLESTRUCK},{interval:["1D7E2","1D7EB"],base:Q.DIGIT,subst:{},offset:0,category:"Nd",font:i.SANSSERIF},{interval:["1D7EC","1D7F5"],base:Q.DIGIT,subst:{},offset:0,category:"Nd",font:i.SANSSERIFBOLD},{interval:["1D7F6","1D7FF"],base:Q.DIGIT,subst:{},offset:0,category:"Nd",font:i.MONOSPACE},{interval:["1F101","1F10A"],base:Q.DIGIT,subst:{},offset:0,category:"No",font:a.COMMA},{interval:["24B6","24CF"],base:Q.LATINCAP,subst:{},capital:!0,category:"So",font:a.CIRCLED},{interval:["24D0","24E9"],base:Q.LATINSMALL,subst:{},capital:!1,category:"So",font:a.CIRCLED},{interval:["1F110","1F129"],base:Q.LATINCAP,subst:{},capital:!0,category:"So",font:a.PARENTHESIZED},{interval:["249C","24B5"],base:Q.LATINSMALL,subst:{},capital:!1,category:"So",font:a.PARENTHESIZED},{interval:["1F130","1F149"],base:Q.LATINCAP,subst:{},capital:!0,category:"So",font:a.SQUARED},{interval:["1F170","1F189"],base:Q.LATINCAP,subst:{},capital:!0,category:"So",font:a.NEGATIVESQUARED},{interval:["1F150","1F169"],base:Q.LATINCAP,subst:{},capital:!0,category:"So",font:a.NEGATIVECIRCLED}]},1320:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,Q=!0,T=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return Q=t.done,t},e:function(t){T=!0,a=t},f:function(){try{Q||null==r.return||r.return()}finally{if(T)throw a}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rQ?-1:a0&&e<20&&r>0&&r<11}function H(t){return o.default.getInstance().style===t}function O(t){if(!t.hasAttribute("annotation"))return!1;var e=t.getAttribute("annotation");return!!/clearspeak:simple$|clearspeak:simple;/.exec(e)}function M(t){if(O(t))return!0;if("subscript"!==t.tagName)return!1;var e=t.childNodes[0].childNodes,r=e[1];return"identifier"===e[0].tagName&&(S(r)||"infixop"===r.tagName&&r.hasAttribute("role")&&"implicit"===r.getAttribute("role")&&V(r))}function S(t){return"number"===t.tagName&&t.hasAttribute("role")&&"integer"===t.getAttribute("role")}function V(t){return i.evalXPath("children/*",t).every((function(t){return S(t)||"identifier"===t.tagName}))}function E(t){return"text"===t.type||"punctuated"===t.type&&"text"===t.role&&v(t.childNodes[0])&&_(t.childNodes.slice(1))||"identifier"===t.type&&"unit"===t.role||"infixop"===t.type&&("implicit"===t.role||"unit"===t.role)}function _(t){for(var e=0;e10?a.LOCALE.NUMBERS.numericOrdinal(e):a.LOCALE.NUMBERS.wordOrdinal(e)},e.NESTING_DEPTH=null,e.nestingDepth=function(t){for(var r=0,n=t.textContent,o="open"===t.getAttribute("role")?0:1,i=t.parentNode;i;)"fenced"===i.tagName&&i.childNodes[0].childNodes[o].textContent===n&&r++,i=i.parentNode;return e.NESTING_DEPTH=r>1?a.LOCALE.NUMBERS.wordOrdinal(r):"",e.NESTING_DEPTH},e.matchingFences=function(t){var e,r,n=t.previousSibling;return n?(e=n,r=t):(e=t,r=t.nextSibling),r&&(0,l.isMatchingFence)(e.textContent,r.textContent)?[t]:[]},e.insertNesting=x,T.Grammar.getInstance().setCorrection("insertNesting",x),e.fencedArguments=function(t){var e=n.toArray(t.parentNode.childNodes),r=i.evalXPath("../../children/*",t),o=e.indexOf(t);return A(r[o])||A(r[o+1])?[t]:[]},e.simpleArguments=function(t){var e=n.toArray(t.parentNode.childNodes),r=i.evalXPath("../../children/*",t),o=e.indexOf(t);return w(r[o])&&r[o+1]&&(w(r[o+1])||"root"===r[o+1].tagName||"sqrt"===r[o+1].tagName||"superscript"===r[o+1].tagName&&r[o+1].childNodes[0].childNodes[0]&&("number"===r[o+1].childNodes[0].childNodes[0].tagName||"identifier"===r[o+1].childNodes[0].childNodes[0].tagName)&&("2"===r[o+1].childNodes[0].childNodes[1].textContent||"3"===r[o+1].childNodes[0].childNodes[1].textContent))?[t]:[]},e.simpleFactor_=w,e.fencedFactor_=A,e.layoutFactor_=C,e.wordOrdinal=function(t){return a.LOCALE.NUMBERS.wordOrdinal(parseInt(t.textContent,10))}},4017:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */o=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},Q=a.iterator||"@@iterator",T=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var o=e&&e.prototype instanceof p?e:p,a=Object.create(o.prototype),Q=new V(n||[]);return i(a,"_invoke",{value:H(t,r,Q)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function p(){}function h(){}function d(){}var y={};u(y,Q,(function(){return this}));var m=Object.getPrototypeOf,L=m&&m(m(E([])));L&&L!==e&&r.call(L,Q)&&(y=L);var v=d.prototype=p.prototype=Object.create(y);function b(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function g(t,e){function o(i,a,Q,T){var s=l(t[i],t,a);if("throw"!==s.type){var u=s.arg,c=u.value;return c&&"object"==n(c)&&r.call(c,"__await")?e.resolve(c.__await).then((function(t){o("next",t,Q,T)}),(function(t){o("throw",t,Q,T)})):e.resolve(c).then((function(t){u.value=t,Q(u)}),(function(t){return o("throw",t,Q,T)}))}T(s.arg)}var a;i(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return a=a?a.then(n,n):n()}})}function H(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return _()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var Q=O(a,r);if(Q){if(Q===f)continue;return Q}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var T=l(t,e,r);if("normal"===T.type){if(n=r.done?"completed":"suspendedYield",T.arg===f)continue;return{value:T.arg,done:r.done}}"throw"===T.type&&(n="completed",r.method="throw",r.arg=T.arg)}}}function O(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,O(t,e),"throw"===e.method))return f;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=l(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,f;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function M(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function V(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function E(t){if(t){var e=t[Q];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var Q=r.call(i,"catchLoc"),T=r.call(i,"finallyLoc");if(Q&&T){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:E(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}var i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{T(n.next(t))}catch(t){i(t)}}function Q(t){try{T(n.throw(t))}catch(t){i(t)}}function T(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,Q)}T((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.loadAjax=e.loadFileSync=e.loadFile=e.parseMaps=e.retrieveFiles=e.standardLoader=e.loadLocale=e.store=void 0;var a=r(1085),Q=r(6617),T=r(6548),s=r(5124),u=r(7586),c=r(111),l=r(7949),f=r(9834),p=r(1985),h=r(9567);e.store=l;var d={functions:l.addFunctionRules,symbols:l.addSymbolRules,units:l.addUnitRules,si:l.setSiPrefixes},y=!1;function m(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Q.default.getInstance().locale;Q.EnginePromise.loaded[t]||(Q.EnginePromise.loaded[t]=[!1,!1],H(t))}function L(){switch(Q.default.getInstance().mode){case T.Mode.ASYNC:return M;case T.Mode.HTTP:return V;case T.Mode.SYNC:default:return S}}function v(t){var e=Q.default.getInstance().customLoader?Q.default.getInstance().customLoader:L(),r=new Promise((function(r){e(t).then((function(e){b(e),Q.EnginePromise.loaded[t]=[!0,!0],r(t)}),(function(e){Q.EnginePromise.loaded[t]=[!0,!1],console.error("Unable to load locale: ".concat(t)),Q.default.getInstance().locale=Q.default.getInstance().defaultLocale,r(t)}))}));Q.EnginePromise.promises[t]=r}function b(t){g(JSON.parse(t))}function g(t,e){for(var r,n=!0,o=0;r=Object.keys(t)[o];o++){var i=r.split("/");e&&e!==i[0]||("rules"===i[1]?f.SpeechRuleEngine.getInstance().addStore(t[r]):"messages"===i[1]?(0,p.completeLocale)(t[r]):(n&&(h.generate(i[0]),n=!1),t[r].forEach(d[i[1]])))}}function H(t){Q.default.getInstance().isIE&&Q.default.getInstance().mode===T.Mode.HTTP?O(t):v(t)}function O(t,e){var r=e||1;a.mapsForIE?g(a.mapsForIE,t):r<=5&&setTimeout(function(){return O(t,r++)}.bind(this),300)}function M(t){var e=s.localePath(t);return new Promise((function(t,r){u.default.fs.readFile(e,"utf8",(function(e,n){if(e)return r(e);t(n)}))}))}function S(t){var e=s.localePath(t);return new Promise((function(t,r){var n="{}";try{n=u.default.fs.readFileSync(e,"utf8")}catch(t){return r(t)}t(n)}))}function V(t){var e=s.localePath(t),r=new XMLHttpRequest;return new Promise((function(t,n){r.onreadystatechange=function(){if(4===r.readyState){var e=r.status;0===e||e>=200&&e<400?t(r.responseText):n(e)}},r.open("GET",e,!0),r.send()}))}e.loadLocale=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Q.default.getInstance().locale;return i(this,void 0,void 0,o().mark((function e(){var r=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return y||(m(c.DynamicCstr.BASE_LOCALE),y=!0),e.abrupt("return",Q.EnginePromise.promises[c.DynamicCstr.BASE_LOCALE].then((function(){return i(r,void 0,void 0,o().mark((function e(){var r,n=this;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=Q.default.getInstance().defaultLocale)){e.next=4;break}return m(r),e.abrupt("return",Q.EnginePromise.promises[r].then((function(){return i(n,void 0,void 0,o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return m(t),e.abrupt("return",Q.EnginePromise.promises[t]);case 2:case"end":return e.stop()}}),e)})))})));case 4:return m(t),e.abrupt("return",Q.EnginePromise.promises[t]);case 6:case"end":return e.stop()}}),e)})))})));case 2:case"end":return e.stop()}}),e)})))},e.standardLoader=L,e.retrieveFiles=v,e.parseMaps=b,e.loadFile=M,e.loadFileSync=S,e.loadAjax=V},5194:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.leftSubscriptBrief=e.leftSuperscriptBrief=e.leftSubscriptVerbose=e.leftSuperscriptVerbose=e.baselineBrief=e.baselineVerbose=void 0;var n=r(7095);e.baselineVerbose=function(t){return n.baselineVerbose(t).replace(/-$/,"")},e.baselineBrief=function(t){return n.baselineBrief(t).replace(/-$/,"")},e.leftSuperscriptVerbose=function(t){return n.superscriptVerbose(t).replace(/^exposant/,"exposant gauche")},e.leftSubscriptVerbose=function(t){return n.subscriptVerbose(t).replace(/^indice/,"indice gauche")},e.leftSuperscriptBrief=function(t){return n.superscriptBrief(t).replace(/^sup/,"sup gauche")},e.leftSubscriptBrief=function(t){return n.subscriptBrief(t).replace(/^sub/,"sub gauche")}},6456:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MathspeakRules=void 0;var n=r(111),o=r(1727),i=r(5194),a=r(7095),Q=r(5668),T=r(2399),s=r(9268);e.MathspeakRules=function(){T.addStore(n.DynamicCstr.BASE_LOCALE+".speech.mathspeak","",{CQFspaceoutNumber:a.spaceoutNumber,CQFspaceoutIdentifier:a.spaceoutIdentifier,CSFspaceoutText:a.spaceoutText,CSFopenFracVerbose:a.openingFractionVerbose,CSFcloseFracVerbose:a.closingFractionVerbose,CSFoverFracVerbose:a.overFractionVerbose,CSFopenFracBrief:a.openingFractionBrief,CSFcloseFracBrief:a.closingFractionBrief,CSFopenFracSbrief:a.openingFractionSbrief,CSFcloseFracSbrief:a.closingFractionSbrief,CSFoverFracSbrief:a.overFractionSbrief,CSFvulgarFraction:Q.vulgarFraction,CQFvulgarFractionSmall:a.isSmallVulgarFraction,CSFopenRadicalVerbose:a.openingRadicalVerbose,CSFcloseRadicalVerbose:a.closingRadicalVerbose,CSFindexRadicalVerbose:a.indexRadicalVerbose,CSFopenRadicalBrief:a.openingRadicalBrief,CSFcloseRadicalBrief:a.closingRadicalBrief,CSFindexRadicalBrief:a.indexRadicalBrief,CSFopenRadicalSbrief:a.openingRadicalSbrief,CSFindexRadicalSbrief:a.indexRadicalSbrief,CQFisSmallRoot:a.smallRoot,CSFsuperscriptVerbose:a.superscriptVerbose,CSFsuperscriptBrief:a.superscriptBrief,CSFsubscriptVerbose:a.subscriptVerbose,CSFsubscriptBrief:a.subscriptBrief,CSFbaselineVerbose:a.baselineVerbose,CSFbaselineBrief:a.baselineBrief,CSFleftsuperscriptVerbose:a.superscriptVerbose,CSFleftsubscriptVerbose:a.subscriptVerbose,CSFrightsuperscriptVerbose:a.superscriptVerbose,CSFrightsubscriptVerbose:a.subscriptVerbose,CSFleftsuperscriptBrief:a.superscriptBrief,CSFleftsubscriptBrief:a.subscriptBrief,CSFrightsuperscriptBrief:a.superscriptBrief,CSFrightsubscriptBrief:a.subscriptBrief,CSFunderscript:a.nestedUnderscript,CSFoverscript:a.nestedOverscript,CSFendscripts:a.endscripts,CTFordinalCounter:Q.ordinalCounter,CTFwordCounter:Q.wordCounter,CTFcontentIterator:o.contentIterator,CQFdetIsSimple:a.determinantIsSimple,CSFRemoveParens:a.removeParens,CQFresetNesting:a.resetNestingDepth,CGFbaselineConstraint:a.generateBaselineConstraint,CGFtensorRules:a.generateTensorRules}),T.addStore("es.speech.mathspeak",n.DynamicCstr.BASE_LOCALE+".speech.mathspeak",{CTFunitMultipliers:s.unitMultipliers,CQFoneLeft:s.oneLeft}),T.addStore("fr.speech.mathspeak",n.DynamicCstr.BASE_LOCALE+".speech.mathspeak",{CSFbaselineVerbose:i.baselineVerbose,CSFbaselineBrief:i.baselineBrief,CSFleftsuperscriptVerbose:i.leftSuperscriptVerbose,CSFleftsubscriptVerbose:i.leftSubscriptVerbose,CSFleftsuperscriptBrief:i.leftSuperscriptBrief,CSFleftsubscriptBrief:i.leftSubscriptBrief})}},7095:function(t,e,r){"use strict";function n(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||i(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==r)return;var n,o,i=[],a=!0,Q=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(i.push(n.value),!e||i.length!==e);a=!0);}catch(t){Q=!0,o=t}finally{try{a||null==r.return||r.return()}finally{if(Q)throw o}}return i}(t,e)||i(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){if(t){if("string"==typeof t)return a(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r-1||h(t,n))return i;if(e.indexOf(t.tagName)>-1&&i++,!t.childNodes||0===t.childNodes.length)return i;var a=T.toArray(t.childNodes);return Math.max.apply(null,a.map((function(t){return d(t,e,r,n,o,i)})))}function y(t){return p("fraction",t,["fraction"],e.nestingBarriers,{},u.LOCALE.FUNCTIONS.fracNestDepth)}function m(t,e,r){var n=y(t),o=Array(n).fill(e);return r&&o.push(r),o.join(u.LOCALE.MESSAGES.regexp.JOINER_FRAC)}function L(t,e,r){for(;t.parentNode;){var n=t.parentNode,o=n.parentNode;if(!o)break;var i=t.getAttribute&&t.getAttribute("role");("subscript"===o.tagName&&t===n.childNodes[1]||"tensor"===o.tagName&&i&&("leftsub"===i||"rightsub"===i))&&(e=r.sub+u.LOCALE.MESSAGES.regexp.JOINER_SUBSUPER+e),("superscript"===o.tagName&&t===n.childNodes[1]||"tensor"===o.tagName&&i&&("leftsuper"===i||"rightsuper"===i))&&(e=r.sup+u.LOCALE.MESSAGES.regexp.JOINER_SUBSUPER+e),t=o}return e.trim()}function v(t){return p("radical",t,["sqrt","root"],e.nestingBarriers,{})}function b(t,e,r){var n=v(t),o=g(t);return r=o?u.LOCALE.FUNCTIONS.combineRootIndex(r,o):r,1===n?r:u.LOCALE.FUNCTIONS.combineNestedRadical(e,u.LOCALE.FUNCTIONS.radicalNestDepth(n-1),r)}function g(t){var e="sqrt"===t.tagName?"2":s.evalXPath("children/*[1]",t)[0].textContent.trim();return u.LOCALE.MESSAGES.MSroots[e]||""}function H(t){return p("underscore",t,["underscore"],e.nestingBarriers,{},(function(t){return t.tagName&&"underscore"===t.tagName&&"underaccent"===t.childNodes[0].childNodes[1].getAttribute("role")}))}function O(t){return p("overscore",t,["overscore"],e.nestingBarriers,{},(function(t){return t.tagName&&"overscore"===t.tagName&&"overaccent"===t.childNodes[0].childNodes[1].getAttribute("role")}))}e.spaceoutText=function(t){return Array.from(t.textContent).join(" ")},e.spaceoutNodes=f,e.spaceoutNumber=function(t){return f(t,(function(t){t.textContent.match(/\W/)||(t.type="number")}))},e.spaceoutIdentifier=function(t){return f(t,(function(t){t.font="unknown",t.type="identifier"}))},e.nestingBarriers=["cases","cell","integral","line","matrix","multiline","overscore","root","row","sqrt","subscript","superscript","table","underscore","vector"],e.resetNestingDepth=function(t){return l={},[t]},e.getNestingDepth=p,e.containsAttr=h,e.computeNestingDepth_=d,e.fractionNestingDepth=y,e.nestedFraction=m,e.openingFractionVerbose=function(t){return m(t,u.LOCALE.MESSAGES.MS.START,u.LOCALE.MESSAGES.MS.FRAC_V)},e.closingFractionVerbose=function(t){return m(t,u.LOCALE.MESSAGES.MS.END,u.LOCALE.MESSAGES.MS.FRAC_V)},e.overFractionVerbose=function(t){return m(t,u.LOCALE.MESSAGES.MS.FRAC_OVER)},e.openingFractionBrief=function(t){return m(t,u.LOCALE.MESSAGES.MS.START,u.LOCALE.MESSAGES.MS.FRAC_B)},e.closingFractionBrief=function(t){return m(t,u.LOCALE.MESSAGES.MS.END,u.LOCALE.MESSAGES.MS.FRAC_B)},e.openingFractionSbrief=function(t){var e=y(t);return 1===e?u.LOCALE.MESSAGES.MS.FRAC_S:u.LOCALE.FUNCTIONS.combineNestedFraction(u.LOCALE.MESSAGES.MS.NEST_FRAC,u.LOCALE.FUNCTIONS.radicalNestDepth(e-1),u.LOCALE.MESSAGES.MS.FRAC_S)},e.closingFractionSbrief=function(t){var e=y(t);return 1===e?u.LOCALE.MESSAGES.MS.ENDFRAC:u.LOCALE.FUNCTIONS.combineNestedFraction(u.LOCALE.MESSAGES.MS.NEST_FRAC,u.LOCALE.FUNCTIONS.radicalNestDepth(e-1),u.LOCALE.MESSAGES.MS.ENDFRAC)},e.overFractionSbrief=function(t){var e=y(t);return 1===e?u.LOCALE.MESSAGES.MS.FRAC_OVER:u.LOCALE.FUNCTIONS.combineNestedFraction(u.LOCALE.MESSAGES.MS.NEST_FRAC,u.LOCALE.FUNCTIONS.radicalNestDepth(e-1),u.LOCALE.MESSAGES.MS.FRAC_OVER)},e.isSmallVulgarFraction=function(t){return u.LOCALE.FUNCTIONS.fracNestDepth(t)?[t]:[]},e.nestedSubSuper=L,e.subscriptVerbose=function(t){return L(t,u.LOCALE.MESSAGES.MS.SUBSCRIPT,{sup:u.LOCALE.MESSAGES.MS.SUPER,sub:u.LOCALE.MESSAGES.MS.SUB})},e.subscriptBrief=function(t){return L(t,u.LOCALE.MESSAGES.MS.SUB,{sup:u.LOCALE.MESSAGES.MS.SUP,sub:u.LOCALE.MESSAGES.MS.SUB})},e.superscriptVerbose=function(t){return L(t,u.LOCALE.MESSAGES.MS.SUPERSCRIPT,{sup:u.LOCALE.MESSAGES.MS.SUPER,sub:u.LOCALE.MESSAGES.MS.SUB})},e.superscriptBrief=function(t){return L(t,u.LOCALE.MESSAGES.MS.SUP,{sup:u.LOCALE.MESSAGES.MS.SUP,sub:u.LOCALE.MESSAGES.MS.SUB})},e.baselineVerbose=function(t){var e=L(t,"",{sup:u.LOCALE.MESSAGES.MS.SUPER,sub:u.LOCALE.MESSAGES.MS.SUB});return e?e.replace(new RegExp(u.LOCALE.MESSAGES.MS.SUB+"$"),u.LOCALE.MESSAGES.MS.SUBSCRIPT).replace(new RegExp(u.LOCALE.MESSAGES.MS.SUPER+"$"),u.LOCALE.MESSAGES.MS.SUPERSCRIPT):u.LOCALE.MESSAGES.MS.BASELINE},e.baselineBrief=function(t){return L(t,"",{sup:u.LOCALE.MESSAGES.MS.SUP,sub:u.LOCALE.MESSAGES.MS.SUB})||u.LOCALE.MESSAGES.MS.BASE},e.radicalNestingDepth=v,e.nestedRadical=b,e.getRootIndex=g,e.openingRadicalVerbose=function(t){return b(t,u.LOCALE.MESSAGES.MS.NESTED,u.LOCALE.MESSAGES.MS.STARTROOT)},e.closingRadicalVerbose=function(t){return b(t,u.LOCALE.MESSAGES.MS.NESTED,u.LOCALE.MESSAGES.MS.ENDROOT)},e.indexRadicalVerbose=function(t){return b(t,u.LOCALE.MESSAGES.MS.NESTED,u.LOCALE.MESSAGES.MS.ROOTINDEX)},e.openingRadicalBrief=function(t){return b(t,u.LOCALE.MESSAGES.MS.NEST_ROOT,u.LOCALE.MESSAGES.MS.STARTROOT)},e.closingRadicalBrief=function(t){return b(t,u.LOCALE.MESSAGES.MS.NEST_ROOT,u.LOCALE.MESSAGES.MS.ENDROOT)},e.indexRadicalBrief=function(t){return b(t,u.LOCALE.MESSAGES.MS.NEST_ROOT,u.LOCALE.MESSAGES.MS.ROOTINDEX)},e.openingRadicalSbrief=function(t){return b(t,u.LOCALE.MESSAGES.MS.NEST_ROOT,u.LOCALE.MESSAGES.MS.ROOT)},e.indexRadicalSbrief=function(t){return b(t,u.LOCALE.MESSAGES.MS.NEST_ROOT,u.LOCALE.MESSAGES.MS.INDEX)},e.underscoreNestingDepth=H,e.nestedUnderscript=function(t){var e=H(t);return Array(e).join(u.LOCALE.MESSAGES.MS.UNDER)+u.LOCALE.MESSAGES.MS.UNDERSCRIPT},e.overscoreNestingDepth=O,e.endscripts=function(t){return u.LOCALE.MESSAGES.MS.ENDSCRIPTS},e.nestedOverscript=function(t){var e=O(t);return Array(e).join(u.LOCALE.MESSAGES.MS.OVER)+u.LOCALE.MESSAGES.MS.OVERSCRIPT},e.determinantIsSimple=function(t){if("matrix"!==t.tagName||"determinant"!==t.getAttribute("role"))return[];for(var e,r=s.evalXPath("children/row/children/cell/children/*",t),n=0;e=r[n];n++)if("number"!==e.tagName){if("identifier"===e.tagName){var o=e.getAttribute("role");if("latinletter"===o||"greekletter"===o||"otherletter"===o)continue}return[]}return[t]},e.generateBaselineConstraint=function(){for(var t,e=function(t){return t.map((function(t){return"ancestor::"+t}))},r=function(t){return"not("+t+")"},n=r(e(["subscript","superscript","tensor"]).join(" or ")),o=e(["relseq","multrel"]),i=e(["fraction","punctuation","fenced","sqrt","root"]),a=[],Q=function(t,e){a=a.concat(o.map((function(t){return e+"/"+t})))},T=0;t=i[T];T++)Q(0,t);return[["ancestor::*/following-sibling::*",n,r(a.join(" | "))].join(" and ")]},e.removeParens=function(t){if(!t.childNodes.length||!t.childNodes[0].childNodes.length||!t.childNodes[0].childNodes[0].childNodes.length)return"";var e=t.childNodes[0].childNodes[0].childNodes[0].textContent;return e.match(/^\(.+\)$/)?e.slice(1,-1):e};var M=new Map([[3,"CSFleftsuperscript"],[4,"CSFleftsubscript"],[2,"CSFbaseline"],[1,"CSFrightsubscript"],[0,"CSFrightsuperscript"]]),S=new Map([[4,2],[3,3],[2,1],[1,4],[0,5]]);function V(t){for(var e=[],r="",n="",o=parseInt(t,2),i=0;i<5;i++){var a="children/*["+S.get(i)+"]";if(1&o){var Q=M.get(i%5);r="[t] "+Q+"Verbose; [n] "+a+";"+r,n="[t] "+Q+"Brief; [n] "+a+";"+n}else e.unshift("name("+a+')="empty"');o>>=1}return[e,r,n]}e.generateTensorRules=function(t){for(var e,r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=["11111","11110","11101","11100","10111","10110","10101","10100","01111","01110","01101","01100"],a=0;e=i[a];a++){var Q="tensor"+e,T=V(e),s=o(T,3),u=s[0],c=s[1],l=s[2];t.defineRule.apply(t,[Q,"default",c,"self::tensor"].concat(n(u))),r&&(t.defineRule.apply(t,[Q,"brief",l,"self::tensor"].concat(n(u))),t.defineRule.apply(t,[Q,"sbrief",l,"self::tensor"].concat(n(u))));var f=M.get(2);c+="; [t]"+f+"Verbose",l+="; [t]"+f+"Brief",Q+="-baseline";var p="((.//*[not(*)])[last()]/@id)!=(((.//ancestor::fraction|ancestor::root|ancestor::sqrt|ancestor::cell|ancestor::line|ancestor::stree)[1]//*[not(*)])[last()]/@id)";t.defineRule.apply(t,[Q,"default",c,"self::tensor",p].concat(n(u))),r&&(t.defineRule.apply(t,[Q,"brief",l,"self::tensor",p].concat(n(u))),t.defineRule.apply(t,[Q,"sbrief",l,"self::tensor",p].concat(n(u))))}},e.smallRoot=function(t){var e=Object.keys(u.LOCALE.MESSAGES.MSroots).length;if(!e)return[];if(e++,!t.childNodes||0===t.childNodes.length||!t.childNodes[0].childNodes)return[];var r=t.childNodes[0].childNodes[0].textContent;if(!/^\d+$/.test(r))return[];var n=parseInt(r,10);return n>1&&n<=e?[t]:[]}},3963:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.implicitIterator=e.relationIterator=e.propagateNumber=e.checkParent_=e.NUMBER_INHIBITORS_=e.NUMBER_PROPAGATORS_=e.enlargeFence=e.indexRadical=e.closingRadical=e.openingRadical=e.radicalNestingDepth=e.nestedRadical=e.hyperFractionBoundary=e.overBevelledFraction=e.overFraction=e.closingFraction=e.openingFraction=void 0;var n=r(8274),o=r(6687),i=r(5142),a=r(3966),Q=r(6617),T=r(1991),s=r(2133),u=r(3200),c=r(7095);function l(t,e){var r=f(t);return 1===r?e:new Array(r).join(u.LOCALE.MESSAGES.MS.NESTED)+e}function f(t,e){var r=e||0;return t.parentNode?f(t.parentNode,"root"===t.tagName||"sqrt"===t.tagName?r+1:r):r}function p(t){var e="\u2820";if(1===t.length)return e+t;var r=t.split("");return r.every((function(t){return"\u2833"===t}))?e+r.join(e):t.slice(0,-1)+e+t.slice(-1)}function h(t,r){var n=t.parent;if(!n)return!1;var o=n.type;return-1!==e.NUMBER_PROPAGATORS_.indexOf(o)||"prefixop"===o&&"negative"===n.role&&!r.script||"prefixop"===o&&"geometry"===n.role||!("punctuated"!==o||r.enclosed&&"text"!==n.role)}function d(t,r){return t.childNodes.length?(-1!==e.NUMBER_INHIBITORS_.indexOf(t.type)&&(r.script=!0),"fenced"===t.type?(r.number=!1,r.enclosed=!0,["",r]):(h(t,r)&&(r.number=!0,r.enclosed=!1),["",r])):(h(t,r)&&(r.number=!0,r.script=!1,r.enclosed=!1),[r.number?"number":"",{number:!1,enclosed:r.enclosed,script:r.script}])}e.openingFraction=function(t){var e=c.fractionNestingDepth(t);return new Array(e).join(u.LOCALE.MESSAGES.MS.FRACTION_REPEAT)+u.LOCALE.MESSAGES.MS.FRACTION_START},e.closingFraction=function(t){var e=c.fractionNestingDepth(t);return new Array(e).join(u.LOCALE.MESSAGES.MS.FRACTION_REPEAT)+u.LOCALE.MESSAGES.MS.FRACTION_END},e.overFraction=function(t){var e=c.fractionNestingDepth(t);return new Array(e).join(u.LOCALE.MESSAGES.MS.FRACTION_REPEAT)+u.LOCALE.MESSAGES.MS.FRACTION_OVER},e.overBevelledFraction=function(t){var e=c.fractionNestingDepth(t);return new Array(e).join(u.LOCALE.MESSAGES.MS.FRACTION_REPEAT)+"\u2838"+u.LOCALE.MESSAGES.MS.FRACTION_OVER},e.hyperFractionBoundary=function(t){return u.LOCALE.MESSAGES.regexp.HYPER===c.fractionNestingDepth(t).toString()?[t]:[]},e.nestedRadical=l,e.radicalNestingDepth=f,e.openingRadical=function(t){return l(t,u.LOCALE.MESSAGES.MS.STARTROOT)},e.closingRadical=function(t){return l(t,u.LOCALE.MESSAGES.MS.ENDROOT)},e.indexRadical=function(t){return l(t,u.LOCALE.MESSAGES.MS.ROOTINDEX)},e.enlargeFence=p,a.Grammar.getInstance().setCorrection("enlargeFence",p),e.NUMBER_PROPAGATORS_=["multirel","relseq","appl","row","line"],e.NUMBER_INHIBITORS_=["subscript","superscript","overscore","underscore"],e.checkParent_=h,e.propagateNumber=d,(0,T.register)(new s.SemanticVisitor("nemeth","number",d,{number:!0})),e.relationIterator=function(t,e){var r,a=t.slice(0),T=!0;return r=t.length>0?i.evalXPath("../../content/*",t[0]):[],function(){var t=r.shift(),i=a.shift(),s=a[0],l=e?[n.AuditoryDescription.create({text:e},{translate:!0})]:[];if(!t)return l;var f=i?c.nestedSubSuper(i,"",{sup:u.LOCALE.MESSAGES.MS.SUPER,sub:u.LOCALE.MESSAGES.MS.SUB}):"",p=i&&"EMPTY"!==o.tagName(i)||T&&t.parentNode.parentNode&&t.parentNode.parentNode.previousSibling?[n.AuditoryDescription.create({text:u.LOCALE.MESSAGES.regexp.SPACE+f},{})]:[],h=s&&"EMPTY"!==o.tagName(s)||!r.length&&t.parentNode.parentNode&&t.parentNode.parentNode.nextSibling?[n.AuditoryDescription.create({text:u.LOCALE.MESSAGES.regexp.SPACE},{})]:[],d=Q.default.evaluateNode(t);return T=!1,l.concat(p,d,h)}},e.implicitIterator=function(t,e){var r,a=t.slice(0);return r=t.length>0?i.evalXPath("../../content/*",t[0]):[],function(){var t=a.shift(),i=a[0],Q=r.shift(),T=e?[n.AuditoryDescription.create({text:e},{translate:!0})]:[];if(!Q)return T;var s=t&&"NUMBER"===o.tagName(t),c=i&&"NUMBER"===o.tagName(i);return T.concat(s&&c&&"space"===Q.getAttribute("role")?[n.AuditoryDescription.create({text:u.LOCALE.MESSAGES.regexp.SPACE},{})]:[])}}},5668:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ordinalPosition=e.vulgarFraction=e.wordCounter=e.ordinalCounter=void 0;var n=r(4098),o=r(6687),i=r(3200),a=r(1531);e.ordinalCounter=function(t,e){var r=0;return function(){return i.LOCALE.NUMBERS.numericOrdinal(++r)+" "+e}},e.wordCounter=function(t,e){var r=0;return function(){return i.LOCALE.NUMBERS.numberToOrdinal(++r,!1)+" "+e}},e.vulgarFraction=function(t){var e=(0,a.convertVulgarFraction)(t,i.LOCALE.MESSAGES.MS.FRAC_OVER);return e.convertible&&e.enumerator&&e.denominator?[new n.Span(i.LOCALE.NUMBERS.numberToWords(e.enumerator),{extid:t.childNodes[0].childNodes[0].getAttribute("extid"),separator:""}),new n.Span(i.LOCALE.NUMBERS.vulgarSep,{separator:""}),new n.Span(i.LOCALE.NUMBERS.numberToOrdinal(e.denominator,1!==e.enumerator),{extid:t.childNodes[0].childNodes[1].getAttribute("extid")})]:[new n.Span(e.content||"",{extid:t.getAttribute("extid")})]},e.ordinalPosition=function(t){var e=o.toArray(t.parentNode.childNodes);return i.LOCALE.NUMBERS.numericOrdinal(e.indexOf(t)+1).toString()}},7349:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BrailleRules=e.OtherRules=e.PrefixRules=void 0;var n=r(111),o=r(1727),i=r(7095),a=r(3963),Q=r(5668),T=r(2399);e.PrefixRules=function(){T.addStore("en.prefix.default","",{CSFordinalPosition:Q.ordinalPosition})},e.OtherRules=function(){T.addStore("en.speech.chromevox","",{CTFnodeCounter:o.nodeCounter,CTFcontentIterator:o.contentIterator}),T.addStore("en.speech.emacspeak","en.speech.chromevox",{CQFvulgarFractionSmall:i.isSmallVulgarFraction,CSFvulgarFraction:Q.vulgarFraction})},e.BrailleRules=function(){T.addStore("nemeth.braille.default",n.DynamicCstr.BASE_LOCALE+".speech.mathspeak",{CSFopenFraction:a.openingFraction,CSFcloseFraction:a.closingFraction,CSFoverFraction:a.overFraction,CSFoverBevFraction:a.overBevelledFraction,CQFhyperFraction:a.hyperFractionBoundary,CSFopenRadical:a.openingRadical,CSFcloseRadical:a.closingRadical,CSFindexRadical:a.indexRadical,CSFsubscript:i.subscriptVerbose,CSFsuperscript:i.superscriptVerbose,CSFbaseline:i.baselineVerbose,CGFtensorRules:function(t){return i.generateTensorRules(t,!1)},CTFrelationIterator:a.relationIterator,CTFimplicitIterator:a.implicitIterator})}},1898:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.init=e.INIT_=void 0;var n=r(3973),o=r(6456),i=r(7349);e.INIT_=!1,e.init=function(){e.INIT_||((0,o.MathspeakRules)(),(0,n.ClearspeakRules)(),(0,i.PrefixRules)(),(0,i.OtherRules)(),(0,i.BrailleRules)(),e.INIT_=!0)}},2399:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getStore=e.addStore=e.funcStore=void 0;var n=r(111);e.funcStore=new Map,e.addStore=function(t,r,n){var o={};if(r){var i=e.funcStore.get(r)||{};Object.assign(o,i)}e.funcStore.set(t,Object.assign(o,n))},e.getStore=function(t,r,o){return e.funcStore.get([t,r,o].join("."))||e.funcStore.get([n.DynamicCstr.DEFAULT_VALUES[n.Axis.LOCALE],r,o].join("."))||e.funcStore.get([n.DynamicCstr.BASE_LOCALE,r,o].join("."))||{}}},9268:function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.oneLeft=e.leftMostUnit=e.rightMostUnit=e.unitMultipliers=void 0;var n=r(8274),o=r(5142),i=r(3200);e.unitMultipliers=function(t,e){var r=t,o=0;return function(){var t=n.AuditoryDescription.create({text:Q(r[o])&&T(r[o+1])?i.LOCALE.MESSAGES.unitTimes:""},{});return o++,[t]}};var a=["superscript","subscript","overscore","underscore"];function Q(t){for(;t;){if("unit"===t.getAttribute("role"))return!0;var e=t.tagName,r=o.evalXPath("children/*",t);t=-1!==a.indexOf(e)?r[0]:r[r.length-1]}return!1}function T(t){for(;t;){if("unit"===t.getAttribute("role"))return!0;t=o.evalXPath("children/*",t)[0]}return!1}e.rightMostUnit=Q,e.leftMostUnit=T,e.oneLeft=function(t){for(;t;){if("number"===t.tagName&&"1"===t.textContent)return[t];if("infixop"!==t.tagName||"multiplication"!==t.getAttribute("role")&&"implicit"!==t.getAttribute("role"))return[];t=o.evalXPath("children/*",t)[0]}return[]}},5250:function(t,e,r){"use strict";function n(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,Q=!0,T=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return Q=t.done,t},e:function(t){T=!0,a=t},f:function(){try{Q||null==r.return||r.return()}finally{if(T)throw a}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&void 0!==arguments[0]&&arguments[0];return this.focus_||(this.focus_=this.singletonFocus(this.rootId)),t&&this.updateFocus(),this.focus_}},{key:"setFocus",value:function(t){this.focus_=t}},{key:"getDepth",value:function(){return this.levels.depth()-1}},{key:"isSpeech",value:function(){return this.generator.modality===l.Attribute.SPEECH}},{key:"focusDomNodes",value:function(){return this.getFocus().getDomNodes()}},{key:"focusSemanticNodes",value:function(){return this.getFocus().getSemanticNodes()}},{key:"speech",value:function(){var t=this.focusDomNodes();if(!t.length)return"";var e=this.specialMove();if(null!==e)return e;switch(this.moved){case b.WalkerMoves.DEPTH:return this.depth_();case b.WalkerMoves.SUMMARY:return this.summary_();case b.WalkerMoves.DETAIL:return this.detail_();default:for(var r=[],n=this.focusSemanticNodes(),o=0,i=t.length;o0}},{key:"restoreState",value:function(){if(this.highlighter){var t=b.WalkerState.getState(this.id);if(t){for(var e=this.getRebuilt().nodeDict[t],r=[];e;)r.push(e.id),e=e.parent;for(r.pop();r.length>0;){this.down();var n=r.pop(),o=this.findFocusOnLevel(n);if(!o)break;this.setFocus(o)}this.moved=b.WalkerMoves.ENTER}}}},{key:"updateFocus",value:function(){this.setFocus(L.Focus.factory(this.getFocus().getSemanticPrimary().id.toString(),this.getFocus().getSemanticNodes().map((function(t){return t.id.toString()})),this.getRebuilt(),this.node))}},{key:"rebuildStree",value:function(){this.rebuilt_=new v.RebuildStree(this.getXml()),this.rootId=this.rebuilt_.stree.root.id.toString(),this.generator.setRebuilt(this.rebuilt_),this.skeleton=h.SemanticSkeleton.fromTree(this.rebuilt_.stree),this.skeleton.populate(),this.focus_=this.singletonFocus(this.rootId),this.levels=this.initLevels(),y.connectMactions(this.node,this.getXml(),this.rebuilt_.xml)}},{key:"previousLevel",value:function(){var t=this.getFocus().getDomPrimary();return t?g.getAttribute(t,l.Attribute.PARENT):this.getFocus().getSemanticPrimary().parent.id.toString()}},{key:"nextLevel",value:function(){var t,e,r=this.getFocus().getDomPrimary();if(r){t=g.splitAttribute(g.getAttribute(r,l.Attribute.CHILDREN)),e=g.splitAttribute(g.getAttribute(r,l.Attribute.CONTENT));var n=g.getAttribute(r,l.Attribute.TYPE),o=g.getAttribute(r,l.Attribute.ROLE);return this.combineContentChildren(n,o,e,t)}var i=function(t){return t.id.toString()},a=this.getRebuilt().nodeDict[this.primaryId()];return t=a.childNodes.map(i),e=a.contentNodes.map(i),0===t.length?[]:this.combineContentChildren(a.type,a.role,e,t)}},{key:"singletonFocus",value:function(t){this.getRebuilt();var e=this.retrieveVisuals(t);return this.focusFromId(t,e)}},{key:"retrieveVisuals",value:function(t){if(!this.skeleton)return[t];var e=parseInt(t,10),r=this.skeleton.subtreeNodes(e);if(!r.length)return[t];r.unshift(e);var o={},i=[];H.updateEvaluator(this.getXml());var a,Q=n(r);try{for(Q.s();!(a=Q.n()).done;){var T=a.value;o[T]||(i.push(T.toString()),o[T]=!0,this.subtreeIds(T,o))}}catch(t){Q.e(t)}finally{Q.f()}return i}},{key:"subtreeIds",value:function(t,e){var r=H.evalXPath('//*[@data-semantic-id="'.concat(t,'"]'),this.getXml());H.evalXPath("*//@data-semantic-id",r[0]).forEach((function(t){return e[parseInt(t.textContent,10)]=!0}))}},{key:"focusFromId",value:function(t,e){return L.Focus.factory(t,e,this.getRebuilt(),this.node)}},{key:"summary",value:function(){return this.moved=this.isSpeech()?b.WalkerMoves.SUMMARY:b.WalkerMoves.REPEAT,this.getFocus().clone()}},{key:"detail",value:function(){return this.moved=this.isSpeech()?b.WalkerMoves.DETAIL:b.WalkerMoves.REPEAT,this.getFocus().clone()}},{key:"specialMove",value:function(){return null}},{key:"virtualize",value:function(t){return this.cursors.push({focus:this.getFocus(),levels:this.levels,undo:t||!this.cursors.length}),this.levels=this.levels.clone(),this.getFocus().clone()}},{key:"previous",value:function(){var t=this.cursors.pop();return t?(this.levels=t.levels,t.focus):this.getFocus()}},{key:"undo",value:function(){var t;do{t=this.cursors.pop()}while(t&&!t.undo);return t?(this.levels=t.levels,t.focus):this.getFocus()}},{key:"update",value:function(t){var e=this;this.generator.setOptions(t),(0,u.setup)(t).then((function(){return d.generator("Tree").getSpeech(e.node,e.getXml())}))}},{key:"nextRules",value:function(){var t=this.generator.getOptions();return"speech"!==t.modality?this.getFocus():(s.DOMAIN_TO_STYLES[t.domain]=t.style,t.domain="mathspeak"===t.domain?"clearspeak":"mathspeak",t.style=s.DOMAIN_TO_STYLES[t.domain],this.update(t),this.moved=b.WalkerMoves.REPEAT,this.getFocus().clone())}},{key:"nextStyle",value:function(t,e){if("mathspeak"===t){var r=["default","brief","sbrief"],n=r.indexOf(e);return-1===n?e:n>=r.length-1?r[0]:r[n+1]}if("clearspeak"===t){var o=m.ClearspeakPreferences.getLocalePreferences().en;if(!o)return"default";var i=m.ClearspeakPreferences.relevantPreferences(this.getFocus().getSemanticPrimary()),a=m.ClearspeakPreferences.findPreference(e,i),Q=o[i].map((function(t){return t.split("_")[1]})),T=Q.indexOf(a);if(-1===T)return e;var s=T>=Q.length-1?Q[0]:Q[T+1];return m.ClearspeakPreferences.addPreference(e,i,s)}return e}},{key:"previousRules",value:function(){var t=this.generator.getOptions();return"speech"!==t.modality?this.getFocus():(t.style=this.nextStyle(t.domain,t.style),this.update(t),this.moved=b.WalkerMoves.REPEAT,this.getFocus().clone())}},{key:"refocus",value:function(){for(var t,e=this.getFocus();!e.getNodes().length;){t=this.levels.peek();var r=this.up();if(!r)break;this.setFocus(r),e=this.getFocus(!0)}this.levels.push(t),this.setFocus(e)}},{key:"toggleActive_",value:function(){this.active_=!this.active_}},{key:"mergePrefix_",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=this.isSpeech()?this.prefix_():"";r&&t.unshift(r);var n=this.isSpeech()?this.postfix_():"";return n&&t.push(n),Q.finalize(Q.merge(e.concat(t)))}},{key:"prefix_",value:function(){var t=this.getFocus().getDomNodes(),e=this.getFocus().getSemanticNodes();return t[0]?g.getAttribute(t[0],l.Attribute.PREFIX):y.retrievePrefix(e[0])}},{key:"postfix_",value:function(){var t=this.getFocus().getDomNodes();return t[0]?g.getAttribute(t[0],l.Attribute.POSTFIX):""}},{key:"depth_",value:function(){var t=p.Grammar.getInstance().getParameter("depth");p.Grammar.getInstance().setParameter("depth",!0);var e=this.getFocus().getDomPrimary(),r=this.expandable(e)?f.LOCALE.MESSAGES.navigate.EXPANDABLE:this.collapsible(e)?f.LOCALE.MESSAGES.navigate.COLLAPSIBLE:"",n=f.LOCALE.MESSAGES.navigate.LEVEL+" "+this.getDepth(),o=this.getFocus().getSemanticNodes(),i=y.retrievePrefix(o[0]),T=[new a.AuditoryDescription({text:n,personality:{}}),new a.AuditoryDescription({text:i,personality:{}}),new a.AuditoryDescription({text:r,personality:{}})];return p.Grammar.getInstance().setParameter("depth",t),Q.finalize(Q.markup(T))}},{key:"actionable_",value:function(t){var e=null==t?void 0:t.parentNode;return e&&this.highlighter.isMactionNode(e)?e:null}},{key:"summary_",value:function(){var t=this.getFocus().getSemanticPrimary().id.toString(),e=this.getRebuilt().xml.getAttribute("id")===t?this.getRebuilt().xml:T.querySelectorAllByAttrValue(this.getRebuilt().xml,"id",t)[0],r=y.retrieveSummary(e);return this.mergePrefix_([r])}},{key:"detail_",value:function(){var t=this.getFocus().getSemanticPrimary().id.toString(),e=this.getRebuilt().xml.getAttribute("id")===t?this.getRebuilt().xml:T.querySelectorAllByAttrValue(this.getRebuilt().xml,"id",t)[0],r=e.getAttribute("alternative");e.removeAttribute("alternative");var n=y.computeMarkup(e),o=this.mergePrefix_([n]);return e.setAttribute("alternative",r),o}}],r&&i(e.prototype,r),o&&i(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.AbstractWalker=O,O.ID_COUNTER=0,O.SRE_ID_ATTR="sre-explorer-id"},1090:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var r=0;r=e.length?null:e[t]}},{key:"depth",value:function(){return this.level_.length}},{key:"clone",value:function(){var e=new t;return e.level_=this.level_.slice(0),e}},{key:"toString",value:function(){for(var t,e="",r=0;t=this.level_[r];r++)e+="\n"+t.map((function(t){return t.toString()}));return e}}])&&r(e.prototype,n),o&&r(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.Levels=n},8036:function(t,e,r){"use strict";function n(t,e){for(var r=0;r1&&(t.textContent=n[1])}else t.textContent=e.textContent}},{key:"isPunctuated",value:function(t){return!T.SemanticSkeleton.simpleCollapseStructure(t)&&t[1]&&T.SemanticSkeleton.contentCollapseStructure(t[1])}}],(r=[{key:"getTree",value:function(){return this.stree}},{key:"assembleTree",value:function(e){var r=this,n=this.makeNode(e),i=u.splitAttribute(u.getAttribute(e,o.Attribute.CHILDREN)),a=u.splitAttribute(u.getAttribute(e,o.Attribute.CONTENT));if(0===a.length&&0===i.length)return t.textContent(n,e),n;if(a.length>0){var Q=u.getBySemanticId(this.mathml,a[0]);Q&&t.textContent(n,Q,!0)}n.contentNodes=a.map((function(t){return r.setParent(t,n)})),n.childNodes=i.map((function(t){return r.setParent(t,n)}));var T=u.getAttribute(e,o.Attribute.COLLAPSED);return T?this.postProcess(n,T):n}},{key:"makeNode",value:function(t){var e=u.getAttribute(t,o.Attribute.TYPE),r=u.getAttribute(t,o.Attribute.ROLE),n=u.getAttribute(t,o.Attribute.FONT),i=u.getAttribute(t,o.Attribute.ANNOTATION)||"",a=u.getAttribute(t,o.Attribute.ATTRIBUTES)||"",Q=u.getAttribute(t,o.Attribute.ID),T=u.getAttribute(t,o.Attribute.EMBELLISHED),s=u.getAttribute(t,o.Attribute.FENCEPOINTER),c=this.createNode(parseInt(Q,10));return c.type=e,c.role=r,c.font=n||"unknown",c.parseAnnotation(i),c.parseAttributes(a),s&&(c.fencePointer=s),T&&(c.embellished=T),c}},{key:"makePunctuation",value:function(t){var e=this.createNode(t);return e.updateContent((0,i.invisibleComma)()),e.role="dummy",e}},{key:"makePunctuated",value:function(t,e,r){var n=this.createNode(e[0]);n.type="punctuated",n.embellished=t.embellished,n.fencePointer=t.fencePointer,n.role=r;var o=e.splice(1,1)[0].slice(1);n.contentNodes=o.map(this.makePunctuation.bind(this)),this.collapsedChildren_(e)}},{key:"makeEmpty",value:function(t,e,r){var n=this.createNode(e);n.type="empty",n.embellished=t.embellished,n.fencePointer=t.fencePointer,n.role=r}},{key:"makeIndex",value:function(e,r,n){if(t.isPunctuated(r))return this.makePunctuated(e,r,n),void(r=r[0]);T.SemanticSkeleton.simpleCollapseStructure(r)&&!this.nodeDict[r.toString()]&&this.makeEmpty(e,r,n)}},{key:"postProcess",value:function(e,r){var n=T.SemanticSkeleton.fromString(r).array;if("subsup"===e.type){var o=this.createNode(n[1][0]);return o.type="subscript",o.role="subsup",e.type="superscript",o.embellished=e.embellished,o.fencePointer=e.fencePointer,this.makeIndex(e,n[1][2],"rightsub"),this.makeIndex(e,n[2],"rightsuper"),this.collapsedChildren_(n),e}if("subscript"===e.type)return this.makeIndex(e,n[2],"rightsub"),this.collapsedChildren_(n),e;if("superscript"===e.type)return this.makeIndex(e,n[2],"rightsuper"),this.collapsedChildren_(n),e;if("tensor"===e.type)return this.makeIndex(e,n[2],"leftsub"),this.makeIndex(e,n[3],"leftsuper"),this.makeIndex(e,n[4],"rightsub"),this.makeIndex(e,n[5],"rightsuper"),this.collapsedChildren_(n),e;if("punctuated"===e.type){if(t.isPunctuated(n)){var i=n.splice(1,1)[0].slice(1);e.contentNodes=i.map(this.makePunctuation.bind(this))}return e}if("underover"===e.type){var a=this.createNode(n[1][0]);return"overaccent"===e.childNodes[1].role?(a.type="overscore",e.type="underscore"):(a.type="underscore",e.type="overscore"),a.role="underover",a.embellished=e.embellished,a.fencePointer=e.fencePointer,this.collapsedChildren_(n),e}return e}},{key:"createNode",value:function(t){var e=this.factory.makeNode(t);return this.nodeDict[t.toString()]=e,e}},{key:"collapsedChildren_",value:function(t){var e=this;!function t(r){var n=e.nodeDict[r[0]];n.childNodes=[];for(var o=1,i=r.length;othis.currentTable_.childNodes.length?this.getFocus():(this.row_=e,this.moved=h.WalkerMoves.ROW,this.getFocus().clone())}},{key:"undo",value:function(){var t=i(c(s.prototype),"undo",this).call(this);return t===this.firstJump&&(this.firstJump=null),t}},{key:"eligibleCell_",value:function(){var t=this.getFocus().getSemanticPrimary();return this.modifier&&"cell"===t.type&&-1!==s.ELIGIBLE_CELL_ROLES.indexOf(t.role)}},{key:"verticalMove_",value:function(t){var e=this.previousLevel();if(!e)return null;var r=this.getFocus(),n=this.levels.indexOf(this.primaryId()),o=this.levels.pop(),i=this.levels.indexOf(e),a=this.levels.get(t?i+1:i-1);if(!a)return this.levels.push(o),null;this.setFocus(this.singletonFocus(a));var Q=this.nextLevel();return Q[n]?(this.levels.push(Q),this.singletonFocus(Q[n])):(this.setFocus(r),this.levels.push(o),null)}},{key:"jumpCell_",value:function(t,e){this.firstJump?this.virtualize(!1):(this.firstJump=this.getFocus(),this.virtualize(!0));var r,n=this.currentTable_.id.toString();do{r=this.levels.pop()}while(-1===r.indexOf(n));this.levels.push(r),this.setFocus(this.singletonFocus(n)),this.levels.push(this.nextLevel());var o=this.currentTable_.childNodes[t-1];return this.setFocus(this.singletonFocus(o.id.toString())),this.levels.push(this.nextLevel()),this.singletonFocus(o.childNodes[e-1].id.toString())}},{key:"isLegalJump_",value:function(t,e){var r=l.querySelectorAllByAttrValue(this.getRebuilt().xml,"id",this.currentTable_.id.toString())[0];if(!r||r.hasAttribute("alternative"))return!1;var n=this.currentTable_.childNodes[t-1];if(!n)return!1;var o=l.querySelectorAllByAttrValue(r,"id",n.id.toString())[0];return!(!o||o.hasAttribute("alternative")||!n||!n.childNodes[e-1])}},{key:"isInTable_",value:function(){for(var t=this.getFocus().getSemanticPrimary();t;){if(-1!==s.ELIGIBLE_TABLE_TYPES.indexOf(t.type))return this.currentTable_=t,!0;t=t.parent}return!1}}])&&o(e.prototype,r),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),s}(p.SyntaxWalker);e.TableWalker=d,d.ELIGIBLE_CELL_ROLES=["determinant","rowvector","binomial","squarematrix","multiline","matrix","vector","cases","table"],d.ELIGIBLE_TABLE_TYPES=["multiline","matrix","vector","cases","table"]},6552:function(t,e){"use strict";function r(t,e){for(var r=0;r"==e&&">")||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function _visitNode(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(_visitNode(e,t))return!0}while(e=e.nextSibling)}function Document(){this.ownerDocument=this}function _onAddAttribute(e,t,n){e&&e._inc++,n.namespaceURI===NAMESPACE.XMLNS&&(t._nsMap[n.prefix?n.localName:""]=n.value)}function _onRemoveAttribute(e,t,n,r){e&&e._inc++,n.namespaceURI===NAMESPACE.XMLNS&&delete t._nsMap[n.prefix?n.localName:""]}function _onUpdateChild(e,t,n){if(e&&e._inc){e._inc++;var r=t.childNodes;if(n)r[r.length++]=n;else{for(var o=t.firstChild,i=0;o;)o=(r[i++]=o).nextSibling;r.length=i,delete r[r.length]}}}function _removeChild(e,t){var n=t.previousSibling,r=t.nextSibling;return n?n.nextSibling=r:e.firstChild=r,r?r.previousSibling=n:e.lastChild=n,t.parentNode=null,t.previousSibling=null,t.nextSibling=null,_onUpdateChild(e.ownerDocument,e),t}function hasValidParentNodeType(e){return e&&(e.nodeType===Node.DOCUMENT_NODE||e.nodeType===Node.DOCUMENT_FRAGMENT_NODE||e.nodeType===Node.ELEMENT_NODE)}function hasInsertableNodeType(e){return e&&(isElementNode(e)||isTextNode(e)||isDocTypeNode(e)||e.nodeType===Node.DOCUMENT_FRAGMENT_NODE||e.nodeType===Node.COMMENT_NODE||e.nodeType===Node.PROCESSING_INSTRUCTION_NODE)}function isDocTypeNode(e){return e&&e.nodeType===Node.DOCUMENT_TYPE_NODE}function isElementNode(e){return e&&e.nodeType===Node.ELEMENT_NODE}function isTextNode(e){return e&&e.nodeType===Node.TEXT_NODE}function isElementInsertionPossible(e,t){var n=e.childNodes||[];if(find(n,isElementNode)||isDocTypeNode(t))return!1;e=find(n,isDocTypeNode);return!(t&&e&&n.indexOf(e)>n.indexOf(t))}function isElementReplacementPossible(e,t){var n=e.childNodes||[];if(find(n,function(e){return isElementNode(e)&&e!==t}))return!1;e=find(n,isDocTypeNode);return!(t&&e&&n.indexOf(e)>n.indexOf(t))}function assertPreInsertionValidity1to5(e,t,n){if(!hasValidParentNodeType(e))throw new DOMException(HIERARCHY_REQUEST_ERR,"Unexpected parent node type "+e.nodeType);if(n&&n.parentNode!==e)throw new DOMException(NOT_FOUND_ERR,"child not in parent");if(!hasInsertableNodeType(t)||isDocTypeNode(t)&&e.nodeType!==Node.DOCUMENT_NODE)throw new DOMException(HIERARCHY_REQUEST_ERR,"Unexpected node type "+t.nodeType+" for parent node type "+e.nodeType)}function assertPreInsertionValidityInDocument(e,t,n){var r=e.childNodes||[],o=t.childNodes||[];if(t.nodeType===Node.DOCUMENT_FRAGMENT_NODE){var i=o.filter(isElementNode);if(1"),n&&/^script$/i.test(c))for(;s;)s.data?t.push(s.data):serializeToString(s,t,n,r,o.slice()),s=s.nextSibling;else for(;s;)serializeToString(s,t,n,r,o.slice()),s=s.nextSibling;t.push("")}else t.push("/>");return;case DOCUMENT_NODE:case DOCUMENT_FRAGMENT_NODE:for(s=e.firstChild;s;)serializeToString(s,t,n,r,o.slice()),s=s.nextSibling;return;case ATTRIBUTE_NODE:return addSerializedAttribute(t,e.name,e.value);case TEXT_NODE:return t.push(e.data.replace(/[<&>]/g,_xmlEncoder));case CDATA_SECTION_NODE:return t.push("");case COMMENT_NODE:return t.push("\x3c!--",e.data,"--\x3e");case DOCUMENT_TYPE_NODE:var T=e.publicId,_=e.systemId;return t.push("")):_&&"."!=_?t.push(" SYSTEM ",_,">"):((_=e.internalSubset)&&t.push(" [",_,"]"),t.push(">")));case PROCESSING_INSTRUCTION_NODE:return t.push("");case ENTITY_REFERENCE_NODE:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function importNode(e,t,n){var r;switch(t.nodeType){case ELEMENT_NODE:(r=t.cloneNode(!1)).ownerDocument=e;case DOCUMENT_FRAGMENT_NODE:break;case ATTRIBUTE_NODE:n=!0}if((r=r||t.cloneNode(!1)).ownerDocument=e,r.parentNode=null,n)for(var o=t.firstChild;o;)r.appendChild(importNode(e,o,n)),o=o.nextSibling;return r}function cloneNode(e,t,n){var r,o,i=new t.constructor;for(r in t)!Object.prototype.hasOwnProperty.call(t,r)||"object"!=typeof(o=t[r])&&o!=i[r]&&(i[r]=o);switch(t.childNodes&&(i.childNodes=new NodeList),i.ownerDocument=e,i.nodeType){case ELEMENT_NODE:var a=t.attributes,s=i.attributes=new NamedNodeMap,c=a.length;s._ownerElement=i;for(var u=0;u",lt:"<",quot:'"'}),HTML_ENTITIES=freeze({lt:"<",gt:">",amp:"&",quot:'"',apos:"'",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",times:"×",divide:"÷",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",euro:"€",trade:"™",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"});var nameStartChar=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,nameChar=new RegExp("[\\-\\.0-9"+nameStartChar.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),tagNamePattern=new RegExp("^"+nameStartChar.source+nameChar.source+"*(?::"+nameStartChar.source+nameChar.source+"*)?$"),S_TAG=0,S_ATTR=1,S_ATTR_SPACE=2,S_EQ=3,S_ATTR_NOQUOT_VALUE=4,S_ATTR_END=5,S_TAG_SPACE=6,S_TAG_CLOSE=7;function ParseError(e,t){this.message=e,this.locator=t,Error.captureStackTrace&&Error.captureStackTrace(this,ParseError)}function XMLReader(){}function parse(n,e,r,o,i){function a(e){var t=e.slice(1,-1);return Object.hasOwnProperty.call(r,t)?r[t]:"#"===t.charAt(0)?function(e){if(65535>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}(parseInt(t.substr(1).replace("x","0x"))):(i.error("entity not found:"+e),e)}function t(e){var t;N",h+3),_=n.substring(h+2,T).replace(/[ \t\n\r]+$/g,""),g=p.pop();T<0?(_=n.substring(h+2).replace(/[\s<].*/,""),i.error("end tag name: "+_+" is not complete:"+g.tagName),T=h+1+_.length):_.match(/\s":switch(u){case S_TAG:r.setTagName(e.slice(t,c));case S_ATTR_END:case S_TAG_SPACE:case S_TAG_CLOSE:break;case S_ATTR_NOQUOT_VALUE:case S_ATTR:"/"===(d=e.slice(t,c)).slice(-1)&&(r.closed=!0,d=d.slice(0,-1));case S_ATTR_SPACE:u===S_ATTR_SPACE&&(d=s),u==S_ATTR_NOQUOT_VALUE?(i.warning('attribute "'+d+'" missed quot(")!'),a(s,d,t)):(NAMESPACE.isHTML(n[""])&&d.match(/^(?:disabled|checked|selected)$/i)||i.warning('attribute "'+d+'" missed value!! "'+d+'" instead!!'),a(d,d,t));break;case S_EQ:throw new Error("attribute value missed!!")}return c;case"€":l=" ";default:if(l<=" ")switch(u){case S_TAG:r.setTagName(e.slice(t,c)),u=S_TAG_SPACE;break;case S_ATTR:s=e.slice(t,c),u=S_ATTR_SPACE;break;case S_ATTR_NOQUOT_VALUE:var d=e.slice(t,c);i.warning('attribute "'+d+'" missed quot(")!!'),a(s,d,t);case S_ATTR_END:u=S_TAG_SPACE}else switch(u){case S_ATTR_SPACE:r.tagName;NAMESPACE.isHTML(n[""])&&s.match(/^(?:disabled|checked|selected)$/i)||i.warning('attribute "'+s+'" missed value!! "'+s+'" instead2!!'),a(s,s,t),t=c,u=S_ATTR;break;case S_ATTR_END:i.warning('attribute space is required"'+s+'"!!');case S_TAG_SPACE:u=S_ATTR,t=c;break;case S_EQ:u=S_ATTR_NOQUOT_VALUE,t=c;break;case S_TAG_CLOSE:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function appendElement(e,t,n){for(var r=e.tagName,o=null,i=e.length;i--;){var a=e[i],s=a.qName,c=a.value,s=0<(l=s.indexOf(":"))?(u=a.prefix=s.slice(0,l),d=s.slice(l+1),"xmlns"===u&&d):(u=null,"xmlns"===(d=s)&&"");a.localName=d,!1!==s&&(null==o&&(o={},_copy(n,n={})),n[s]=o[s]=c,a.uri=NAMESPACE.XMLNS,t.startPrefixMapping(s,c))}for(var u,i=e.length;i--;)(u=(a=e[i]).prefix)&&("xml"===u&&(a.uri=NAMESPACE.XML),"xmlns"!==u&&(a.uri=n[u||""]));var l,d=0<(l=r.indexOf(":"))?(u=e.prefix=r.slice(0,l),e.localName=r.slice(l+1)):(u=null,e.localName=r),p=e.uri=n[u||""];if(t.startElement(p,d,r,e),!e.closed)return e.currentNSMap=n,e.localNSMap=o,!0;if(t.endElement(p,d,r),o)for(u in o)Object.prototype.hasOwnProperty.call(o,u)&&t.endPrefixMapping(u)}function parseHtmlSpecialContent(e,t,n,r,o){if(/^(?:script|textarea)$/i.test(n)){var i=e.indexOf("",t),e=e.substring(t+1,i);if(/[&<]/.test(e))return/^script$/i.test(n)||(e=e.replace(/&#?\w+;/g,r)),o.characters(e,0,e.length),i}return t+1}function fixSelfClosed(e,t,n,r){var o=r[n];return null==o&&((o=e.lastIndexOf(""))",t+9);return n.startCDATA(),n.characters(e,t+9,i-t-9),n.endCDATA(),i+3}o=split(e,t),r=o.length;if(1",t);if(r){t=e.substring(t,r).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(t){t[0].length;return n.processingInstruction(t[1],t[2]),r+2}return-1}return-1}function ElementAttributes(){this.attributeNames={}}function split(e,t){var n,r=[],o=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(o.lastIndex=t,o.exec(e);n=o.exec(e);)if(r.push(n),n[1])return r}function normalizeLineEndings(e){return e.replace(/\r[\n\u0085]/g,"\n").replace(/[\r\u0085\u2028]/g,"\n")}function DOMParser(e){this.options=e||{locator:{}}}function buildErrorHandler(r,e,o){if(!r){if(e instanceof DOMHandler)return e;r=e}var i={},a=r instanceof Function;function t(t){var n=r[t];!n&&a&&(n=2==r.length?function(e){r(t,e)}:r),i[t]=n?function(e){n("[xmldom "+t+"]\t"+e+_locator(o))}:function(){}}return o=o||{},t("warning"),t("error"),t("fatalError"),i}function DOMHandler(){this.cdata=!1}function position(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function _locator(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function _toString(e,t,n){return"string"==typeof e?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+"":e}function appendElement(e,t){(e.currentElement||e.doc).appendChild(t)}ParseError.prototype=new Error,ParseError.prototype.name=ParseError.name,XMLReader.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),_copy(t,t={}),parse(e,t,n,r,this.errorHandler),r.endDocument()}},ElementAttributes.prototype={setTagName:function(e){if(!tagNamePattern.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},addValue:function(e,t,n){if(!tagNamePattern.test(e))throw new Error("invalid attribute:"+e);this.attributeNames[e]=this.length,this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},DOMParser.prototype.parseFromString=function(e,t){var n=this.options,r=new XMLReader,o=n.domBuilder||new DOMHandler,i=n.errorHandler,a=n.locator,s=n.xmlns||{},c=/\/x?html?$/.test(t),t=c?entities.HTML_ENTITIES:entities.XML_ENTITIES;a&&o.setDocumentLocator(a),r.errorHandler=buildErrorHandler(i,o,a),r.domBuilder=n.domBuilder||o,c&&(s[""]=NAMESPACE.HTML),s.xml=s.xml||NAMESPACE.XML;n=n.normalizeLineEndings||normalizeLineEndings;return e&&"string"==typeof e?r.parse(n(e),s,t):r.errorHandler.error("invalid doc source"),o.doc},DOMHandler.prototype={startDocument:function(){this.doc=(new DOMImplementation).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,r){var o=this.doc,i=o.createElementNS(e,n||t),a=r.length;appendElement(this,i),this.currentElement=i,this.locator&&position(this.locator,i);for(var s=0;sb?1:0};var ha=Array.prototype.indexOf?function(a,b,c){return Array.prototype.indexOf.call(a,b,c)}:function(a,b,c){c=null==c?0:0>c?Math.max(0,a.length+c):c;if(l(a))return l(b)&&1==b.length?a.indexOf(b,c):-1;for(;cc?null:l(a)?a.charAt(c):a[c]}function la(a){return Array.prototype.concat.apply(Array.prototype,arguments)}function ma(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)};var u;a:{var na=k.navigator;if(na){var oa=na.userAgent;if(oa){u=oa;break a}}u=""};var pa=q(u,"Opera")||q(u,"OPR"),v=q(u,"Trident")||q(u,"MSIE"),qa=q(u,"Edge"),ra=q(u,"Gecko")&&!(q(u.toLowerCase(),"webkit")&&!q(u,"Edge"))&&!(q(u,"Trident")||q(u,"MSIE"))&&!q(u,"Edge"),sa=q(u.toLowerCase(),"webkit")&&!q(u,"Edge");function ta(){var a=k.document;return a?a.documentMode:void 0}var ua; +a:{var va="",wa=function(){var a=u;if(ra)return/rv\:([^\);]+)(\)|;)/.exec(a);if(qa)return/Edge\/([\d\.]+)/.exec(a);if(v)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(sa)return/WebKit\/(\S+)/.exec(a);if(pa)return/(?:Version)[ \/]?(\S+)/.exec(a)}();wa&&(va=wa?wa[1]:"");if(v){var xa=ta();if(null!=xa&&xa>parseFloat(va)){ua=String(xa);break a}}ua=va}var ya={}; +function za(a){if(!ya[a]){for(var b=0,c=fa(String(ua)).split("."),d=fa(String(a)).split("."),e=Math.max(c.length,d.length),f=0;0==b&&f",4,2,function(a,b,c){return O(function(a,b){return a>b},a,b,c)});P("<=",4,2,function(a,b,c){return O(function(a,b){return a<=b},a,b,c)});P(">=",4,2,function(a,b,c){return O(function(a,b){return a>=b},a,b,c)});var Wa=P("=",3,2,function(a,b,c){return O(function(a,b){return a==b},a,b,c,!0)});P("!=",3,2,function(a,b,c){return O(function(a,b){return a!=b},a,b,c,!0)});P("and",2,2,function(a,b,c){return M(a,c)&&M(b,c)});P("or",1,2,function(a,b,c){return M(a,c)||M(b,c)});function Q(a,b,c){this.a=a;this.b=b||1;this.f=c||1};function Za(a,b){if(b.a.length&&4!=a.i)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");n.call(this,a.i);this.c=a;this.h=b;this.g=a.g;this.b=a.b}m(Za);Za.prototype.a=function(a){a=this.c.a(a);return $a(this.h,a)};Za.prototype.toString=function(){var a;a="Filter:"+J(this.c);return a+=J(this.h)};function ab(a,b){if(b.lengtha.v)throw Error("Function "+a.j+" expects at most "+a.v+" arguments, "+b.length+" given");a.B&&r(b,function(b,d){if(4!=b.i)throw Error("Argument "+d+" to function "+a.j+" is not of type Nodeset: "+b);});n.call(this,a.i);this.h=a;this.c=b;Ua(this,a.g||ja(b,function(a){return a.g}));Va(this,a.D&&!b.length||a.C&&!!b.length||ja(b,function(a){return a.b}))}m(ab); +ab.prototype.a=function(a){return this.h.m.apply(null,la(a,this.c))};ab.prototype.toString=function(){var a="Function: "+this.h;if(this.c.length)var b=t(this.c,function(a,b){return a+J(b)},"Arguments:"),a=a+J(b);return a};function bb(a,b,c,d,e,f,g,h,p){this.j=a;this.i=b;this.g=c;this.D=d;this.C=e;this.m=f;this.A=g;this.v=void 0!==h?h:g;this.B=!!p}bb.prototype.toString=function(){return this.j};var cb={}; +function R(a,b,c,d,e,f,g,h){if(cb.hasOwnProperty(a))throw Error("Function already created: "+a+".");cb[a]=new bb(a,b,c,d,!1,e,f,g,h)}R("boolean",2,!1,!1,function(a,b){return M(b,a)},1);R("ceiling",1,!1,!1,function(a,b){return Math.ceil(K(b,a))},1);R("concat",3,!1,!1,function(a,b){return t(ma(arguments,1),function(b,d){return b+L(d,a)},"")},2,null);R("contains",2,!1,!1,function(a,b,c){return q(L(b,a),L(c,a))},2);R("count",1,!1,!1,function(a,b){return b.a(a).l},1,1,!0); +R("false",2,!1,!1,function(){return!1},0);R("floor",1,!1,!1,function(a,b){return Math.floor(K(b,a))},1);R("id",4,!1,!1,function(a,b){function c(a){if(w){var b=e.all[a];if(b){if(b.nodeType&&a==b.id)return b;if(b.length)return ka(b,function(b){return a==b.id})}return null}return e.getElementById(a)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument,d=L(b,a).split(/\s+/),f=[];r(d,function(a){a=c(a);!a||0<=ha(f,a)||f.push(a)});f.sort(La);var g=new C;r(f,function(a){F(g,a)});return g},1); +R("lang",2,!1,!1,function(){return!1},1);R("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0);R("local-name",3,!1,!0,function(a,b){var c=b?Ra(b.a(a)):a.a;return c?c.localName||c.nodeName.toLowerCase():""},0,1,!0);R("name",3,!1,!0,function(a,b){var c=b?Ra(b.a(a)):a.a;return c?c.nodeName.toLowerCase():""},0,1,!0);R("namespace-uri",3,!0,!1,function(){return""},0,1,!0); +R("normalize-space",3,!1,!0,function(a,b){return(b?L(b,a):z(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);R("not",2,!1,!1,function(a,b){return!M(b,a)},1);R("number",1,!1,!0,function(a,b){return b?K(b,a):+z(a.a)},0,1);R("position",1,!0,!1,function(a){return a.b},0);R("round",1,!1,!1,function(a,b){return Math.round(K(b,a))},1);R("starts-with",2,!1,!1,function(a,b,c){b=L(b,a);a=L(c,a);return 0==b.lastIndexOf(a,0)},2);R("string",3,!1,!0,function(a,b){return b?L(b,a):z(a.a)},0,1); +R("string-length",1,!1,!0,function(a,b){return(b?L(b,a):z(a.a)).length},0,1);R("substring",3,!1,!1,function(a,b,c,d){c=K(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?K(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=L(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);R("substring-after",3,!1,!1,function(a,b,c){b=L(b,a);a=L(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2); +R("substring-before",3,!1,!1,function(a,b,c){b=L(b,a);a=L(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);R("sum",1,!1,!1,function(a,b){for(var c=H(b.a(a)),d=0,e=I(c);e;e=I(c))d+=+z(e);return d},1,1,!0);R("translate",3,!1,!1,function(a,b,c,d){b=L(b,a);c=L(c,a);var e=L(d,a);a={};for(d=0;d]=|\s+|./g,hb=/^\s/;function S(a,b){return a.b[a.a+(b||0)]}function T(a){return a.b[a.a++]}function ib(a){return a.b.length<=a.a};function jb(a){n.call(this,3);this.c=a.substring(1,a.length-1)}m(jb);jb.prototype.a=function(){return this.c};jb.prototype.toString=function(){return"Literal: "+this.c};function E(a,b){this.j=a.toLowerCase();var c;c="*"==this.j?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():c}E.prototype.a=function(a){var b=a.nodeType;if(1!=b&&2!=b)return!1;b=void 0!==a.localName?a.localName:a.nodeName;return"*"!=this.j&&this.j!=b.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};E.prototype.f=function(){return this.j}; +E.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.j};function kb(a,b){n.call(this,a.i);this.h=a;this.c=b;this.g=a.g;this.b=a.b;if(1==this.c.length){var c=this.c[0];c.u||c.c!=lb||(c=c.o,"*"!=c.f()&&(this.f={name:c.f(),s:null}))}}m(kb);function mb(){n.call(this,4)}m(mb);mb.prototype.a=function(a){var b=new C;a=a.a;9==a.nodeType?F(b,a):F(b,a.ownerDocument);return b};mb.prototype.toString=function(){return"Root Helper Expression"};function nb(){n.call(this,4)}m(nb);nb.prototype.a=function(a){var b=new C;F(b,a.a);return b};nb.prototype.toString=function(){return"Context Helper Expression"}; +function ob(a){return"/"==a||"//"==a}kb.prototype.a=function(a){var b=this.h.a(a);if(!(b instanceof C))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;ca.length)throw Error("Unclosed literal string");return new jb(a)} +function Hb(a){var b,c=[],d;if(ob(S(a.a))){b=T(a.a);d=S(a.a);if("/"==b&&(ib(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new mb;d=new mb;W(a,"Missing next location step.");b=Ib(a,b);c.push(b)}else{a:{b=S(a.a);d=b.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":T(a.a);b=Cb(a);W(a,'unclosed "("');Eb(a,")");break;case '"':case "'":b=Gb(a);break;default:if(isNaN(+b))if(!db(b)&&/(?![0-9])[\w]/.test(d)&&"("==S(a.a,1)){b=T(a.a); +b=cb[b]||null;T(a.a);for(d=[];")"!=S(a.a);){W(a,"Missing function argument list.");d.push(Cb(a));if(","!=S(a.a))break;T(a.a)}W(a,"Unclosed function argument list.");Fb(a);b=new ab(b,d)}else{b=null;break a}else b=new Ab(+T(a.a))}"["==S(a.a)&&(d=new sb(Jb(a)),b=new Za(b,d))}if(b)if(ob(S(a.a)))d=b;else return b;else b=Ib(a,"/"),d=new nb,c.push(b)}for(;ob(S(a.a));)b=T(a.a),W(a,"Missing next location step."),b=Ib(a,b),c.push(b);return new kb(d,c)} +function Ib(a,b){var c,d,e;if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==S(a.a))return d=new U(yb,new G("node")),T(a.a),d;if(".."==S(a.a))return d=new U(xb,new G("node")),T(a.a),d;var f;if("@"==S(a.a))f=lb,T(a.a),W(a,"Missing attribute name");else if("::"==S(a.a,1)){if(!/(?![0-9])[\w]/.test(S(a.a).charAt(0)))throw Error("Bad token: "+T(a.a));c=T(a.a);f=wb[c]||null;if(!f)throw Error("No axis with name: "+c);T(a.a);W(a,"Missing node name")}else f=tb;c=S(a.a);if(/(?![0-9])[\w\*]/.test(c.charAt(0)))if("("== +S(a.a,1)){if(!db(c))throw Error("Invalid node type: "+c);c=T(a.a);if(!db(c))throw Error("Invalid type name: "+c);Eb(a,"(");W(a,"Bad nodetype");e=S(a.a).charAt(0);var g=null;if('"'==e||"'"==e)g=Gb(a);W(a,"Bad nodetype");Fb(a);c=new G(c,g)}else if(c=T(a.a),e=c.indexOf(":"),-1==e)c=new E(c);else{var g=c.substring(0,e),h;if("*"==g)h="*";else if(h=a.b(g),!h)throw Error("Namespace prefix not declared: "+g);c=c.substr(e+1);c=new E(c,h)}else throw Error("Bad token: "+T(a.a));e=new sb(Jb(a),f.a);return d|| +new U(f,c,e,"//"==b)}function Jb(a){for(var b=[];"["==S(a.a);){T(a.a);W(a,"Missing predicate expression.");var c=Cb(a);b.push(c);W(a,"Unclosed predicate expression.");Eb(a,"]")}return b}function Db(a){if("-"==S(a.a))return T(a.a),new zb(Db(a));var b=Hb(a);if("|"!=S(a.a))a=b;else{for(b=[b];"|"==T(a.a);)W(a,"Missing next union location path."),b.push(Hb(a));a.a.a--;a=new rb(b)}return a};function Kb(a){switch(a.nodeType){case 1:return ea(Lb,a);case 9:return Kb(a.documentElement);case 11:case 10:case 6:case 12:return Mb;default:return a.parentNode?Kb(a.parentNode):Mb}}function Mb(){return null}function Lb(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?Lb(a.parentNode,b):null};function Nb(a,b){if(!a.length)throw Error("Empty XPath expression.");var c=fb(a);if(ib(c))throw Error("Invalid XPath expression.");b?"function"==aa(b)||(b=da(b.lookupNamespaceURI,b)):b=function(){return null};var d=Cb(new Bb(c,b));if(!ib(c))throw Error("Bad token: "+T(c));this.evaluate=function(a,b){var c=d.a(new Q(a));return new Y(c,b)}} +function Y(a,b){if(0==b)if(a instanceof C)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof C))throw Error("value could not be converted to the specified type");this.resultType=b;var c;switch(b){case 2:this.stringValue=a instanceof C?Sa(a):""+a;break;case 1:this.numberValue=a instanceof C?+Sa(a):+a;break;case 3:this.booleanValue=a instanceof C?0=c.length?null:c[f++]};this.snapshotItem=function(a){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return a>=c.length|| +0>a?null:c[a]}}Y.ANY_TYPE=0;Y.NUMBER_TYPE=1;Y.STRING_TYPE=2;Y.BOOLEAN_TYPE=3;Y.UNORDERED_NODE_ITERATOR_TYPE=4;Y.ORDERED_NODE_ITERATOR_TYPE=5;Y.UNORDERED_NODE_SNAPSHOT_TYPE=6;Y.ORDERED_NODE_SNAPSHOT_TYPE=7;Y.ANY_UNORDERED_NODE_TYPE=8;Y.FIRST_ORDERED_NODE_TYPE=9;function Ob(a){this.lookupNamespaceURI=Kb(a)} +function Pb(a,b){var c=a||k,d=c.Document&&c.Document.prototype||c.document;if(!d.evaluate||b)c.XPathResult=Y,d.evaluate=function(a,b,c,d){return(new Nb(a,c)).evaluate(b,d)},d.createExpression=function(a,b){return new Nb(a,b)},d.createNSResolver=function(a){return new Ob(a)}}var Qb=["wgxpath","install"],Z=k;Qb[0]in Z||!Z.execScript||Z.execScript("var "+Qb[0]);for(var Rb;Qb.length&&(Rb=Qb.shift());)Qb.length||void 0===Pb?Z[Rb]?Z=Z[Rb]:Z=Z[Rb]={}:Z[Rb]=Pb;}).call(this) diff --git a/d2renderers/d2latex/setup.js b/d2renderers/d2latex/setup.js new file mode 100644 index 000000000..76caddc3d --- /dev/null +++ b/d2renderers/d2latex/setup.js @@ -0,0 +1,6 @@ +const adaptor = MathJax._.adaptors.liteAdaptor.liteAdaptor(); +MathJax._.handlers.html_ts.RegisterHTMLHandler(adaptor) +const html = MathJax._.mathjax.mathjax.document('', { + InputJax: new MathJax._.input.tex_ts.TeX(), + OutputJax: new MathJax._.output.svg_ts.SVG(), +}); diff --git a/d2renderers/d2svg/d2svg.go b/d2renderers/d2svg/d2svg.go index 1349183fa..89ee90444 100644 --- a/d2renderers/d2svg/d2svg.go +++ b/d2renderers/d2svg/d2svg.go @@ -20,6 +20,7 @@ import ( "github.com/alecthomas/chroma/styles" "oss.terrastruct.com/d2/d2renderers/d2fonts" + "oss.terrastruct.com/d2/d2renderers/d2latex" "oss.terrastruct.com/d2/d2renderers/textmeasure" "oss.terrastruct.com/d2/d2target" "oss.terrastruct.com/d2/lib/color" @@ -701,17 +702,27 @@ func drawShape(writer io.Writer, targetShape d2target.Shape) error { } fmt.Fprintf(writer, "") case d2target.ShapeText: - render, err := textmeasure.RenderMarkdown(targetShape.Label) - if err != nil { - return err + if targetShape.Language == "latex" { + render, err := d2latex.Render(targetShape.Label) + if err != nil { + return err + } + fmt.Fprintf(writer, ``, box.TopLeft.X, box.TopLeft.Y, targetShape.Opacity) + fmt.Fprintf(writer, render) + fmt.Fprintf(writer, "") + } else { + render, err := textmeasure.RenderMarkdown(targetShape.Label) + if err != nil { + return err + } + fmt.Fprintf(writer, ``, + box.TopLeft.X, box.TopLeft.Y, targetShape.Width, targetShape.Height, + ) + // we need the self closing form in this svg/xhtml context + render = strings.ReplaceAll(render, "
", "
") + fmt.Fprintf(writer, `
%v
`, render) + fmt.Fprint(writer, `
`) } - fmt.Fprintf(writer, ``, - box.TopLeft.X, box.TopLeft.Y, targetShape.Width, targetShape.Height, - ) - // we need the self closing form in this svg/xhtml context - render = strings.ReplaceAll(render, "
", "
") - fmt.Fprintf(writer, `
%v
`, render) - fmt.Fprint(writer, `
`) default: fontColor := "black" if targetShape.Color != "" { diff --git a/e2etests/stable_test.go b/e2etests/stable_test.go index 3c109f416..b319561cd 100644 --- a/e2etests/stable_test.go +++ b/e2etests/stable_test.go @@ -961,6 +961,31 @@ beta: { alpha -> beta: gamma { style.font-color: green } +`, + }, + { + name: "latex", + script: `a: |latex +\\Huge{\\frac{\\alpha g^2}{\\omega^5} e^{[ -0.74\\bigl\\{\\frac{\\omega U_\\omega 19.5}{g}\\bigr\\}^{\\!-4}\\,]}} +| + +b: |latex +e = mc^2 +| + +z: |latex +gibberish\\; math:\\sum_{i=0}^\\infty i^2 +| + +z -> a +z -> b + +a -> c +b -> c +sugar -> c +c: mixed together + +c -> solution: we get `, }, } diff --git a/e2etests/testdata/stable/latex/dagre/board.exp.json b/e2etests/testdata/stable/latex/dagre/board.exp.json new file mode 100644 index 000000000..50277d20d --- /dev/null +++ b/e2etests/testdata/stable/latex/dagre/board.exp.json @@ -0,0 +1,514 @@ +{ + "name": "", + "shapes": [ + { + "id": "a", + "type": "text", + "pos": { + "x": 0, + "y": 164 + }, + "width": 382, + "height": 101, + "level": 1, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#FFFFFF", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "\\\\Huge{\\\\frac{\\\\alpha g^2}{\\\\omega^5} e^{[ -0.74\\\\bigl\\\\{\\\\frac{\\\\omega U_\\\\omega 19.5}{g}\\\\bigr\\\\}^{\\\\!-4}\\\\,]}}", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "latex", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 382, + "labelHeight": 101 + }, + { + "id": "b", + "type": "text", + "pos": { + "x": 442, + "y": 205 + }, + "width": 65, + "height": 18, + "level": 1, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#FFFFFF", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "e = mc^2", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "latex", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 65, + "labelHeight": 18 + }, + { + "id": "z", + "type": "text", + "pos": { + "x": 243, + "y": 0 + }, + "width": 179, + "height": 51, + "level": 1, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#FFFFFF", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "gibberish\\\\; math:\\\\sum_{i=0}^\\\\infty i^2", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "latex", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 179, + "labelHeight": 51 + }, + { + "id": "c", + "type": "", + "pos": { + "x": 368, + "y": 377 + }, + "width": 214, + "height": 126, + "level": 1, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "mixed together", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 114, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "sugar", + "type": "", + "pos": { + "x": 567, + "y": 151 + }, + "width": 146, + "height": 126, + "level": 1, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "sugar", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 46, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "solution", + "type": "", + "pos": { + "x": 393, + "y": 603 + }, + "width": 164, + "height": 126, + "level": 1, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "solution", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 64, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + } + ], + "connections": [ + { + "id": "(z -> a)[0]", + "src": "z", + "srcArrow": "none", + "srcLabel": "", + "dst": "a", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 284.87417218543044, + "y": 51 + }, + { + "x": 209.7748344370861, + "y": 91 + }, + { + "x": 191, + "y": 113.5 + }, + { + "x": 191, + "y": 163.5 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "(z -> b)[0]", + "src": "z", + "srcArrow": "none", + "srcLabel": "", + "dst": "b", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 380.62582781456956, + "y": 51 + }, + { + "x": 455.7251655629139, + "y": 91 + }, + { + "x": 474.5, + "y": 121.8 + }, + { + "x": 474.5, + "y": 205 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "(a -> c)[0]", + "src": "a", + "srcArrow": "none", + "srcLabel": "", + "dst": "c", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 191, + "y": 265.5 + }, + { + "x": 191, + "y": 314.7 + }, + { + "x": 226.3, + "y": 341.0701940035273 + }, + { + "x": 367.5, + "y": 397.35097001763666 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "(b -> c)[0]", + "src": "b", + "srcArrow": "none", + "srcLabel": "", + "dst": "c", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 474.5, + "y": 223 + }, + { + "x": 474.5, + "y": 306.2 + }, + { + "x": 474.5, + "y": 337 + }, + { + "x": 474.5, + "y": 377 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "(sugar -> c)[0]", + "src": "sugar", + "srcArrow": "none", + "srcLabel": "", + "dst": "c", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 640, + "y": 277 + }, + { + "x": 640, + "y": 317 + }, + { + "x": 625.4, + "y": 337 + }, + { + "x": 567, + "y": 377 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "(c -> solution)[0]", + "src": "c", + "srcArrow": "none", + "srcLabel": "", + "dst": "solution", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "we get", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 44, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 474.5, + "y": 503 + }, + { + "x": 474.5, + "y": 543 + }, + { + "x": 474.5, + "y": 563 + }, + { + "x": 474.5, + "y": 603 + } + ], + "isCurve": true, + "animated": false, + "tooltip": "", + "icon": null + } + ] +} diff --git a/e2etests/testdata/stable/latex/dagre/sketch.exp.svg b/e2etests/testdata/stable/latex/dagre/sketch.exp.svg new file mode 100644 index 000000000..7c95a679b --- /dev/null +++ b/e2etests/testdata/stable/latex/dagre/sketch.exp.svg @@ -0,0 +1,790 @@ + +mixed togethersugarsolution + + +we get \ No newline at end of file diff --git a/e2etests/testdata/stable/latex/elk/board.exp.json b/e2etests/testdata/stable/latex/elk/board.exp.json new file mode 100644 index 000000000..e97a6e2ab --- /dev/null +++ b/e2etests/testdata/stable/latex/elk/board.exp.json @@ -0,0 +1,484 @@ +{ + "name": "", + "shapes": [ + { + "id": "a", + "type": "text", + "pos": { + "x": 291, + "y": 196 + }, + "width": 382, + "height": 101, + "level": 1, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#FFFFFF", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "\\\\Huge{\\\\frac{\\\\alpha g^2}{\\\\omega^5} e^{[ -0.74\\\\bigl\\\\{\\\\frac{\\\\omega U_\\\\omega 19.5}{g}\\\\bigr\\\\}^{\\\\!-4}\\\\,]}}", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "latex", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 382, + "labelHeight": 101 + }, + { + "id": "b", + "type": "text", + "pos": { + "x": 450, + "y": 158 + }, + "width": 65, + "height": 18, + "level": 1, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#FFFFFF", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "e = mc^2", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "latex", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 65, + "labelHeight": 18 + }, + { + "id": "z", + "type": "text", + "pos": { + "x": 12, + "y": 150 + }, + "width": 179, + "height": 51, + "level": 1, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#FFFFFF", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "gibberish\\\\; math:\\\\sum_{i=0}^\\\\infty i^2", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "latex", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 179, + "labelHeight": 51 + }, + { + "id": "c", + "type": "", + "pos": { + "x": 773, + "y": 104 + }, + "width": 214, + "height": 126, + "level": 1, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "mixed together", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 114, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "sugar", + "type": "", + "pos": { + "x": 527, + "y": 12 + }, + "width": 146, + "height": 126, + "level": 1, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "sugar", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 46, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "solution", + "type": "", + "pos": { + "x": 1231, + "y": 104 + }, + "width": 164, + "height": 126, + "level": 1, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "solution", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 64, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + } + ], + "connections": [ + { + "id": "(z -> a)[0]", + "src": "z", + "srcArrow": "none", + "srcLabel": "", + "dst": "a", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 191, + "y": 184 + }, + { + "x": 241, + "y": 184 + }, + { + "x": 241, + "y": 246.5 + }, + { + "x": 291, + "y": 246.5 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "(z -> b)[0]", + "src": "z", + "srcArrow": "none", + "srcLabel": "", + "dst": "b", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 191, + "y": 167 + }, + { + "x": 449.5, + "y": 167 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "(a -> c)[0]", + "src": "a", + "srcArrow": "none", + "srcLabel": "", + "dst": "c", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 673, + "y": 246.5 + }, + { + "x": 723, + "y": 246.5 + }, + { + "x": 723, + "y": 198.5 + }, + { + "x": 773, + "y": 198.5 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "(b -> c)[0]", + "src": "b", + "srcArrow": "none", + "srcLabel": "", + "dst": "c", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 514.5, + "y": 167 + }, + { + "x": 773, + "y": 167 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "(sugar -> c)[0]", + "src": "sugar", + "srcArrow": "none", + "srcLabel": "", + "dst": "c", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 673, + "y": 75 + }, + { + "x": 723, + "y": 75 + }, + { + "x": 723, + "y": 135.5 + }, + { + "x": 773, + "y": 135.5 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "(c -> solution)[0]", + "src": "c", + "srcArrow": "none", + "srcLabel": "", + "dst": "solution", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "we get", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 44, + "labelHeight": 21, + "labelPosition": "INSIDE_MIDDLE_CENTER", + "labelPercentage": 0, + "route": [ + { + "x": 987, + "y": 167 + }, + { + "x": 1231, + "y": 167 + } + ], + "animated": false, + "tooltip": "", + "icon": null + } + ] +} diff --git a/e2etests/testdata/stable/latex/elk/sketch.exp.svg b/e2etests/testdata/stable/latex/elk/sketch.exp.svg new file mode 100644 index 000000000..4bc0231e8 --- /dev/null +++ b/e2etests/testdata/stable/latex/elk/sketch.exp.svg @@ -0,0 +1,790 @@ + +mixed togethersugarsolution + + +we get \ No newline at end of file