element containing node, or null if not found.
77 |
78 | function closestKatex(node) {
79 | // If node is a Text Node, for example, go up to containing Element,
80 | // where we can apply the `closest` method.
81 | const element = node instanceof Element ? node : node.parentElement;
82 | return element && element.closest('.katex');
83 | } // Global copy handler to modify behavior on/within .katex elements.
84 |
85 |
86 | document.addEventListener('copy', function (event) {
87 | const selection = window.getSelection();
88 |
89 | if (selection.isCollapsed || !event.clipboardData) {
90 | return; // default action OK if selection is empty or unchangeable
91 | }
92 |
93 | const clipboardData = event.clipboardData;
94 | const range = selection.getRangeAt(0); // When start point is within a formula, expand to entire formula.
95 |
96 | const startKatex = closestKatex(range.startContainer);
97 |
98 | if (startKatex) {
99 | range.setStartBefore(startKatex);
100 | } // Similarly, when end point is within a formula, expand to entire formula.
101 |
102 |
103 | const endKatex = closestKatex(range.endContainer);
104 |
105 | if (endKatex) {
106 | range.setEndAfter(endKatex);
107 | }
108 |
109 | const fragment = range.cloneContents();
110 |
111 | if (!fragment.querySelector('.katex-mathml')) {
112 | return; // default action OK if no .katex-mathml elements
113 | }
114 |
115 | const htmlContents = Array.prototype.map.call(fragment.childNodes, el => el instanceof Text ? el.textContent : el.outerHTML).join(''); // Preserve usual HTML copy/paste behavior.
116 |
117 | clipboardData.setData('text/html', htmlContents); // Rewrite plain-text version.
118 |
119 | clipboardData.setData('text/plain', katex2tex(fragment).textContent); // Prevent normal copy handling.
120 |
121 | event.preventDefault();
122 | });
123 | __webpack_exports__ = __webpack_exports__["default"];
124 | /******/ return __webpack_exports__;
125 | /******/ })()
126 | ;
127 | });
--------------------------------------------------------------------------------
/assets/fontawesome/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 | > Version 5 – the iconic SVG, font, and CSS framework
4 |
5 | The internet's most popular icon toolkit has been redesigned and built from
6 | scratch. On top of this, features like icon font ligatures, an SVG framework,
7 | official NPM packages for popular frontend libraries like React, and access to
8 | a new CDN.
9 |
10 | Not familiar with Font Awesome 5? [Learn
11 | more](https://www.kickstarter.com/projects/232193852/font-awesome-5) about our
12 | successful Kickstarter and plan. You can also **[order Font Awesome
13 | Pro](https://fontawesome.com/pro)** which includes tons more icons directly
14 | from [fontawesome.com](https://fontawesome.com).
15 |
16 | ## Documentation
17 |
18 | Learn how to get started with Font Awesome and then dive deeper into other and advanced topics:
19 |
20 | ### Using Font Awesome on the Web
21 |
22 | * [With SVG with JavaScript](https://fontawesome.com/how-to-use/on-the-web/setup/getting-started?using=svg-with-js)
23 | * [With web fonts with CSS](https://fontawesome.com/how-to-use/on-the-web/setup/getting-started?using=web-fonts-with-css)
24 | * [Upgrading from version 4](https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4)
25 | * [Installing Font Awesome with a package manager](https://fontawesome.com/how-to-use/on-the-web/setup/using-package-managers)
26 | * [Downloading + hosting Font Awesome yourself](https://fontawesome.com/how-to-use/on-the-web/setup/hosting-font-awesome-yourself)
27 | * [Performance and security](https://fontawesome.com/how-to-use/performance-and-security)
28 | * [Accessibility](https://fontawesome.com/how-to-use/on-the-web/other-topics/accessibility)
29 | * [Troubleshooting](https://fontawesome.com/how-to-use/on-the-web/other-topics/troubleshooting)
30 |
31 | #### Advanced Options & Techniques
32 |
33 | * [Using CSS pseudo-elements](https://fontawesome.com/how-to-use/on-the-web/advanced/css-pseudo-elements)
34 | * [SVG sprites](https://fontawesome.com/how-to-use/svg-sprites)
35 | * [The Font Awesome API](https://fontawesome.com/how-to-use/font-awesome-api)
36 | * [SVG symbols](https://fontawesome.com/how-to-use/on-the-web/advanced/svg-symbols)
37 | * [SVG JavaScript Core](https://fontawesome.com/how-to-use/on-the-web/advanced/svg-javascript-core)
38 | * [Server side rendering](https://fontawesome.com/how-to-use/server-side-rendering)
39 |
40 | ### Using Font Awesome on the Desktop
41 |
42 | * [Getting started](https://fontawesome.com/how-to-use/on-the-desktop/setup/getting-started)
43 | * [Upgrading from version 4](https://fontawesome.com/how-to-use/on-the-desktop/setup/upgrading-from-version-4)
44 | * [Using ligatures](https://fontawesome.com/how-to-use/on-the-desktop/referencing-icons/using-ligatures)
45 | * [Using glyphs](https://fontawesome.com/how-to-use/on-the-desktop/referencing-icons/using-glyphs)
46 | * [Troubleshooting](https://fontawesome.com/how-to-use/on-the-desktop/other-topics/troubleshooting)
47 |
48 | ### Where did Font Awesome 4 (or 3) go?
49 |
50 | Now that Font Awesome 5 has been released we are marking version 4 as
51 | end-of-life. We don't plan on releasing any further versions of the 4.x or 3.x.
52 |
53 | Documentation is still available but it's moved to
54 | [https://fontawesome.com/v4.7.0](https://fontawesome.com/v4.7.0) and
55 | [https://fontawesome.com/v3.2.1](https://fontawesome.com/v3.2.1).
56 |
57 | The Git repository for
58 | [v4.7.0](https://github.com/FortAwesome/Font-Awesome/releases/tag/v4.7.0) and
59 | [v3.2.1](https://github.com/FortAwesome/Font-Awesome/releases/tag/v3.2.1) can
60 | be found in our GitHub releases.
61 |
62 | ## Change log
63 |
64 | We'll keep track of each release in the [CHANGELOG.md](./CHANGELOG.md)
65 |
66 | Looking for older versions of Font Awesome? Check the [releases](https://github.com/FortAwesome/Font-Awesome/releases).
67 |
68 | ## Upgrading
69 |
70 | From time-to-time we'll have special upgrading instructions from one version to the next.
71 |
72 | Check out the [UPGRADING.md](./UPGRADING.md) guide when you upgrade your dependencies.
73 |
74 | ## Code of conduct
75 |
76 | We will behave ourselves if you behave yourselves. For more details see our
77 | [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md).
78 |
79 | ## Contributing
80 |
81 | Please read through our [contributing guidelines](./CONTRIBUTING.md). Included
82 | are directions for opening issues.
83 |
84 | ## Versioning
85 |
86 | Font Awesome will be maintained under the Semantic Versioning guidelines as much as possible. Releases will be numbered
87 | with the following format:
88 |
89 | `
..`
90 |
91 | For more information on SemVer, please visit http://semver.org.
92 |
93 | **The major version "5" is part of an umbrella release. It includes many different types of files and technologies. Therefore
94 | we deviate from normal SemVer in the following ways:**
95 |
96 | * Any release may update the design, look-and-feel, or branding of an existing
97 | icon
98 | * We will never intentionally release a `patch` version update that breaks
99 | backward compatibility
100 | * A `minor` release **may include backward-incompatible changes** but we will
101 | write clear upgrading instructions in UPGRADING.md
102 | * A `minor` or `patch` release will never remove icons
103 | * Bug fixes will be addressed as `patch` releases unless they include backward
104 | incompatibility then they will be `minor` releases
105 |
106 | ## License
107 |
108 | Font Awesome Free is free, open source, and GPL friendly. You can use it for
109 | commercial projects, open source projects, or really almost whatever you want.
110 |
111 | - Icons — CC BY 4.0 License
112 | - In the Font Awesome Free download, the CC BY 4.0 license applies to all icons packaged as .svg and .js files types.
113 | - Fonts — SIL OFL 1.1 License
114 | - In the Font Awesome Free download, the SIL OLF license applies to all icons packaged as web and desktop font files.
115 | - Code — MIT License
116 | - In the Font Awesome Free download, the MIT license applies to all non-font and non-icon files.
117 |
118 | Attribution is required by MIT, SIL OLF, and CC BY licenses. Downloaded Font
119 | Awesome Free files already contain embedded comments with sufficient
120 | attribution, so you shouldn't need to do anything additional when using these
121 | files normally.
122 |
123 | We've kept attribution comments terse, so we ask that you do not actively work
124 | to remove them from files, especially code. They're a great way for folks to
125 | learn about Font Awesome.
126 |
127 | ## Team
128 | * [Dave Gandy](https://github.com/davegandy)
129 | * [Travis Chase](https://github.com/supercodepoet)
130 | * [Rob Madole](https://github.com/robmadole)
131 | * [Brian Talbot](https://github.com/talbs)
132 | * [Jory Raphael](https://github.com/sensibleworld)
133 | * [Mike Wilkerson](https://github.com/mlwilkerson)
134 | * [Frances Botsford](https://github.com/frrrances)
135 | * [Trevor Chase](https://github.com/trevorchase)
136 | * [Jason Lundien](https://github.com/jasonlundien)
137 | * [Jason Otero](https://github.com/deathnfudge)
138 | * [Edward Emanuel](https://github.com/ej2)
139 | * [Kelsey Jackson](https://github.com/kelseythejackson)
140 | * [Geremia Taglialatela](https://github.com/tagliala)
141 |
--------------------------------------------------------------------------------
/assets/katex/README.md:
--------------------------------------------------------------------------------
1 |
7 |
8 | [](https://www.npmjs.com/package/katex)
9 | [](https://github.com/semantic-release/semantic-release)
10 | [](https://github.com/KaTeX/KaTeX/actions?query=workflow%3ACI)
11 | [](https://codecov.io/gh/KaTeX/KaTeX)
12 | [](https://github.com/KaTeX/KaTeX/discussions)
13 | [](https://www.jsdelivr.com/package/npm/katex)
14 | 
15 | [](https://gitpod.io/#https://github.com/KaTeX/KaTeX)
16 | [](https://opencollective.com/katex)
17 |
18 | KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web.
19 |
20 | * **Fast:** KaTeX renders its math synchronously and doesn't need to reflow the page. See how it compares to a competitor in [this speed test](https://www.intmath.com/cg5/katex-mathjax-comparison.php).
21 | * **Print quality:** KaTeX's layout is based on Donald Knuth's TeX, the gold standard for math typesetting.
22 | * **Self contained:** KaTeX has no dependencies and can easily be bundled with your website resources.
23 | * **Server side rendering:** KaTeX produces the same output regardless of browser or environment, so you can pre-render expressions using Node.js and send them as plain HTML.
24 |
25 | KaTeX is compatible with all major browsers, including Chrome, Safari, Firefox, Opera, Edge, and IE 11.
26 |
27 | KaTeX supports much (but not all) of LaTeX and many LaTeX packages. See the [list of supported functions](https://katex.org/docs/supported.html).
28 |
29 | Try out KaTeX [on the demo page](https://katex.org/#demo)!
30 |
31 | ## Getting started
32 |
33 | ### Starter template
34 |
35 | ```html
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
48 |
49 | ...
50 |
51 | ```
52 |
53 | You can also [download KaTeX](https://github.com/KaTeX/KaTeX/releases) and host it yourself.
54 |
55 | For details on how to configure auto-render extension, refer to [the documentation](https://katex.org/docs/autorender.html).
56 |
57 | ### API
58 |
59 | Call `katex.render` to render a TeX expression directly into a DOM element.
60 | For example:
61 |
62 | ```js
63 | katex.render("c = \\pm\\sqrt{a^2 + b^2}", element, {
64 | throwOnError: false
65 | });
66 | ```
67 |
68 | Call `katex.renderToString` to generate an HTML string of the rendered math,
69 | e.g., for server-side rendering. For example:
70 |
71 | ```js
72 | var html = katex.renderToString("c = \\pm\\sqrt{a^2 + b^2}", {
73 | throwOnError: false
74 | });
75 | // '... '
76 | ```
77 |
78 | Make sure to include the CSS and font files in both cases.
79 | If you are doing all rendering on the server, there is no need to include the
80 | JavaScript on the client.
81 |
82 | The examples above use the `throwOnError: false` option, which renders invalid
83 | inputs as the TeX source code in red (by default), with the error message as
84 | hover text. For other available options, see the
85 | [API documentation](https://katex.org/docs/api.html),
86 | [options documentation](https://katex.org/docs/options.html), and
87 | [handling errors documentation](https://katex.org/docs/error.html).
88 |
89 | ## Demo and Documentation
90 |
91 | Learn more about using KaTeX [on the website](https://katex.org)!
92 |
93 | ## Contributors
94 |
95 | ### Code Contributors
96 |
97 | This project exists thanks to all the people who contribute code. If you'd like to help, see [our guide to contributing code](CONTRIBUTING.md).
98 |
99 |
100 | ### Financial Contributors
101 |
102 | Become a financial contributor and help us sustain our community.
103 |
104 | #### Individuals
105 |
106 |
107 |
108 | #### Organizations
109 |
110 | Support this project with your organization. Your logo will show up here with a link to your website.
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 | ## License
124 |
125 | KaTeX is licensed under the [MIT License](https://opensource.org/licenses/MIT).
126 |
--------------------------------------------------------------------------------
/assets/katex/contrib/auto-render.mjs:
--------------------------------------------------------------------------------
1 | import katex from '../katex.mjs';
2 |
3 | /* eslint no-constant-condition:0 */
4 | var findEndOfMath = function findEndOfMath(delimiter, text, startIndex) {
5 | // Adapted from
6 | // https://github.com/Khan/perseus/blob/master/src/perseus-markdown.jsx
7 | var index = startIndex;
8 | var braceLevel = 0;
9 | var delimLength = delimiter.length;
10 |
11 | while (index < text.length) {
12 | var character = text[index];
13 |
14 | if (braceLevel <= 0 && text.slice(index, index + delimLength) === delimiter) {
15 | return index;
16 | } else if (character === "\\") {
17 | index++;
18 | } else if (character === "{") {
19 | braceLevel++;
20 | } else if (character === "}") {
21 | braceLevel--;
22 | }
23 |
24 | index++;
25 | }
26 |
27 | return -1;
28 | };
29 |
30 | var escapeRegex = function escapeRegex(string) {
31 | return string.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
32 | };
33 |
34 | var amsRegex = /^\\begin{/;
35 |
36 | var splitAtDelimiters = function splitAtDelimiters(text, delimiters) {
37 | var index;
38 | var data = [];
39 | var regexLeft = new RegExp("(" + delimiters.map(x => escapeRegex(x.left)).join("|") + ")");
40 |
41 | while (true) {
42 | index = text.search(regexLeft);
43 |
44 | if (index === -1) {
45 | break;
46 | }
47 |
48 | if (index > 0) {
49 | data.push({
50 | type: "text",
51 | data: text.slice(0, index)
52 | });
53 | text = text.slice(index); // now text starts with delimiter
54 | } // ... so this always succeeds:
55 |
56 |
57 | var i = delimiters.findIndex(delim => text.startsWith(delim.left));
58 | index = findEndOfMath(delimiters[i].right, text, delimiters[i].left.length);
59 |
60 | if (index === -1) {
61 | break;
62 | }
63 |
64 | var rawData = text.slice(0, index + delimiters[i].right.length);
65 | var math = amsRegex.test(rawData) ? rawData : text.slice(delimiters[i].left.length, index);
66 | data.push({
67 | type: "math",
68 | data: math,
69 | rawData,
70 | display: delimiters[i].display
71 | });
72 | text = text.slice(index + delimiters[i].right.length);
73 | }
74 |
75 | if (text !== "") {
76 | data.push({
77 | type: "text",
78 | data: text
79 | });
80 | }
81 |
82 | return data;
83 | };
84 |
85 | /* eslint no-console:0 */
86 | /* Note: optionsCopy is mutated by this method. If it is ever exposed in the
87 | * API, we should copy it before mutating.
88 | */
89 |
90 | var renderMathInText = function renderMathInText(text, optionsCopy) {
91 | var data = splitAtDelimiters(text, optionsCopy.delimiters);
92 |
93 | if (data.length === 1 && data[0].type === 'text') {
94 | // There is no formula in the text.
95 | // Let's return null which means there is no need to replace
96 | // the current text node with a new one.
97 | return null;
98 | }
99 |
100 | var fragment = document.createDocumentFragment();
101 |
102 | for (var i = 0; i < data.length; i++) {
103 | if (data[i].type === "text") {
104 | fragment.appendChild(document.createTextNode(data[i].data));
105 | } else {
106 | var span = document.createElement("span");
107 | var math = data[i].data; // Override any display mode defined in the settings with that
108 | // defined by the text itself
109 |
110 | optionsCopy.displayMode = data[i].display;
111 |
112 | try {
113 | if (optionsCopy.preProcess) {
114 | math = optionsCopy.preProcess(math);
115 | }
116 |
117 | katex.render(math, span, optionsCopy);
118 | } catch (e) {
119 | if (!(e instanceof katex.ParseError)) {
120 | throw e;
121 | }
122 |
123 | optionsCopy.errorCallback("KaTeX auto-render: Failed to parse `" + data[i].data + "` with ", e);
124 | fragment.appendChild(document.createTextNode(data[i].rawData));
125 | continue;
126 | }
127 |
128 | fragment.appendChild(span);
129 | }
130 | }
131 |
132 | return fragment;
133 | };
134 |
135 | var renderElem = function renderElem(elem, optionsCopy) {
136 | for (var i = 0; i < elem.childNodes.length; i++) {
137 | var childNode = elem.childNodes[i];
138 |
139 | if (childNode.nodeType === 3) {
140 | // Text node
141 | // Concatenate all sibling text nodes.
142 | // Webkit browsers split very large text nodes into smaller ones,
143 | // so the delimiters may be split across different nodes.
144 | var textContentConcat = childNode.textContent;
145 | var sibling = childNode.nextSibling;
146 | var nSiblings = 0;
147 |
148 | while (sibling && sibling.nodeType === Node.TEXT_NODE) {
149 | textContentConcat += sibling.textContent;
150 | sibling = sibling.nextSibling;
151 | nSiblings++;
152 | }
153 |
154 | var frag = renderMathInText(textContentConcat, optionsCopy);
155 |
156 | if (frag) {
157 | // Remove extra text nodes
158 | for (var j = 0; j < nSiblings; j++) {
159 | childNode.nextSibling.remove();
160 | }
161 |
162 | i += frag.childNodes.length - 1;
163 | elem.replaceChild(frag, childNode);
164 | } else {
165 | // If the concatenated text does not contain math
166 | // the siblings will not either
167 | i += nSiblings;
168 | }
169 | } else if (childNode.nodeType === 1) {
170 | (function () {
171 | // Element node
172 | var className = ' ' + childNode.className + ' ';
173 | var shouldRender = optionsCopy.ignoredTags.indexOf(childNode.nodeName.toLowerCase()) === -1 && optionsCopy.ignoredClasses.every(x => className.indexOf(' ' + x + ' ') === -1);
174 |
175 | if (shouldRender) {
176 | renderElem(childNode, optionsCopy);
177 | }
178 | })();
179 | } // Otherwise, it's something else, and ignore it.
180 |
181 | }
182 | };
183 |
184 | var renderMathInElement = function renderMathInElement(elem, options) {
185 | if (!elem) {
186 | throw new Error("No element provided to render");
187 | }
188 |
189 | var optionsCopy = {}; // Object.assign(optionsCopy, option)
190 |
191 | for (var option in options) {
192 | if (options.hasOwnProperty(option)) {
193 | optionsCopy[option] = options[option];
194 | }
195 | } // default options
196 |
197 |
198 | optionsCopy.delimiters = optionsCopy.delimiters || [{
199 | left: "$$",
200 | right: "$$",
201 | display: true
202 | }, {
203 | left: "\\(",
204 | right: "\\)",
205 | display: false
206 | }, // LaTeX uses $…$, but it ruins the display of normal `$` in text:
207 | // {left: "$", right: "$", display: false},
208 | // $ must come after $$
209 | // Render AMS environments even if outside $$…$$ delimiters.
210 | {
211 | left: "\\begin{equation}",
212 | right: "\\end{equation}",
213 | display: true
214 | }, {
215 | left: "\\begin{align}",
216 | right: "\\end{align}",
217 | display: true
218 | }, {
219 | left: "\\begin{alignat}",
220 | right: "\\end{alignat}",
221 | display: true
222 | }, {
223 | left: "\\begin{gather}",
224 | right: "\\end{gather}",
225 | display: true
226 | }, {
227 | left: "\\begin{CD}",
228 | right: "\\end{CD}",
229 | display: true
230 | }, {
231 | left: "\\[",
232 | right: "\\]",
233 | display: true
234 | }];
235 | optionsCopy.ignoredTags = optionsCopy.ignoredTags || ["script", "noscript", "style", "textarea", "pre", "code", "option"];
236 | optionsCopy.ignoredClasses = optionsCopy.ignoredClasses || [];
237 | optionsCopy.errorCallback = optionsCopy.errorCallback || console.error; // Enable sharing of global macros defined via `\gdef` between different
238 | // math elements within a single call to `renderMathInElement`.
239 |
240 | optionsCopy.macros = optionsCopy.macros || {};
241 | renderElem(elem, optionsCopy);
242 | };
243 |
244 | export { renderMathInElement as default };
245 |
--------------------------------------------------------------------------------
/assets/katex/contrib/render-a11y-string.min.js:
--------------------------------------------------------------------------------
1 | !function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],r);else{var t="object"==typeof exports?r(require("katex")):r(e.katex);for(var a in t)("object"==typeof exports?exports:e)[a]=t[a]}}("undefined"!=typeof self?self:this,(function(e){return function(){"use strict";var r={757:function(r){r.exports=e}},t={};function a(e){var o=t[e];if(void 0!==o)return o.exports;var n=t[e]={exports:{}};return r[e](n,n.exports,a),n.exports}a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,{a:r}),r},a.d=function(e,r){for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)};var o={},n=a(757),s=a.n(n);const l={"(":"left parenthesis",")":"right parenthesis","[":"open bracket","]":"close bracket","\\{":"left brace","\\}":"right brace","\\lvert":"open vertical bar","\\rvert":"close vertical bar","|":"vertical bar","\\uparrow":"up arrow","\\Uparrow":"up arrow","\\downarrow":"down arrow","\\Downarrow":"down arrow","\\updownarrow":"up down arrow","\\leftarrow":"left arrow","\\Leftarrow":"left arrow","\\rightarrow":"right arrow","\\Rightarrow":"right arrow","\\langle":"open angle","\\rangle":"close angle","\\lfloor":"open floor","\\rfloor":"close floor","\\int":"integral","\\intop":"integral","\\lim":"limit","\\ln":"natural log","\\log":"log","\\sin":"sine","\\cos":"cosine","\\tan":"tangent","\\cot":"cotangent","\\sum":"sum","/":"slash",",":"comma",".":"point","-":"negative","+":"plus","~":"tilde",":":"colon","?":"question mark","'":"apostrophe","\\%":"percent"," ":"space","\\ ":"space","\\$":"dollar sign","\\angle":"angle","\\degree":"degree","\\circ":"circle","\\vec":"vector","\\triangle":"triangle","\\pi":"pi","\\prime":"prime","\\infty":"infinity","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\omega":"omega","\\theta":"theta","\\sigma":"sigma","\\lambda":"lambda","\\tau":"tau","\\Delta":"delta","\\delta":"delta","\\mu":"mu","\\rho":"rho","\\nabla":"del","\\ell":"ell","\\ldots":"dots","\\hat":"hat","\\acute":"acute"},i={prime:"prime",degree:"degrees",circle:"degrees",2:"squared",3:"cubed"},c={"|":"open vertical bar",".":""},p={"|":"close vertical bar",".":""},u={"+":"plus","-":"minus","\\pm":"plus minus","\\cdot":"dot","*":"times","/":"divided by","\\times":"times","\\div":"divided by","\\circ":"circle","\\bullet":"bullet"},d={"=":"equals","\\approx":"approximately equals","\u2260":"does not equal","\\geq":"is greater than or equal to","\\ge":"is greater than or equal to","\\leq":"is less than or equal to","\\le":"is less than or equal to",">":"is greater than","<":"is less than","\\leftarrow":"left arrow","\\Leftarrow":"left arrow","\\rightarrow":"right arrow","\\Rightarrow":"right arrow",":":"colon"},h={"\\underleftarrow":"left arrow","\\underrightarrow":"right arrow","\\underleftrightarrow":"left-right arrow","\\undergroup":"group","\\underlinesegment":"line segment","\\utilde":"tilde"},b=(e,r,t)=>{if(!e)return;let a;a="open"===r?e in c?c[e]:l[e]||e:"close"===r?e in p?p[e]:l[e]||e:"bin"===r?u[e]||e:"rel"===r?d[e]||e:l[e]||e,/^\d+$/.test(a)&&t.length>0&&/^\d+$/.test(t[t.length-1])?t[t.length-1]+=a:a&&t.push(a)},m=(e,r)=>{const t=[];e.push(t),r(t)},f=function(e,r,t){if(void 0===r&&(r=[]),e instanceof Array)for(let a=0;a{switch(e.type){case"accent":m(r,(r=>{f(e.base,r,t),r.push("with"),b(e.label,"normal",r),r.push("on top")}));break;case"accentUnder":m(r,(r=>{f(e.base,r,t),r.push("with"),b(h[e.label],"normal",r),r.push("underneath")}));break;case"accent-token":case"color-token":case"kern":case"leftright-right":case"size":case"infix":case"internal":break;case"atom":{const{text:t}=e;switch(e.family){case"bin":b(t,"bin",r);break;case"close":b(t,"close",r);break;case"inner":b(e.text,"inner",r);break;case"open":b(t,"open",r);break;case"punct":b(t,"punct",r);break;case"rel":b(t,"rel",r);break;default:throw e.family,new Error('"'+e.family+'" is not a valid atom type')}break}case"color":{const a=e.color.replace(/katex-/,"");m(r,(r=>{r.push("start color "+a),f(e.body,r,t),r.push("end color "+a)}));break}case"delimsizing":e.delim&&"."!==e.delim&&b(e.delim,"normal",r);break;case"genfrac":m(r,(r=>{const{leftDelim:a,rightDelim:o}=e;e.hasBarLine?(r.push("start fraction"),a&&b(a,"open",r),f(e.numer,r,t),r.push("divided by"),f(e.denom,r,t),o&&b(o,"close",r),r.push("end fraction")):(r.push("start binomial"),a&&b(a,"open",r),f(e.numer,r,t),r.push("over"),f(e.denom,r,t),o&&b(o,"close",r),r.push("end binomial"))}));break;case"hbox":case"lap":case"ordgroup":case"raisebox":case"sizing":case"styling":case"smash":case"vcenter":case"operatorname":case"font":case"html":f(e.body,r,t);break;case"leftright":m(r,(r=>{b(e.left,"open",r),f(e.body,r,t),b(e.right,"close",r)}));break;case"mathord":b(e.text,"normal",r);break;case"op":{const{body:a,name:o}=e;a?f(a,r,t):o&&b(o,"normal",r);break}case"op-token":case"textord":b(e.text,t,r);break;case"overline":m(r,(function(r){r.push("start overline"),f(e.body,r,t),r.push("end overline")}));break;case"pmb":r.push("bold");break;case"phantom":r.push("empty space");break;case"rule":r.push("rectangle");break;case"spacing":r.push("space");break;case"sqrt":m(r,(r=>{const{body:a,index:o}=e;if(o)return"3"===w(f(o,[],t)).join(",")?(r.push("cube root of"),f(a,r,t),void r.push("end cube root")):(r.push("root"),r.push("start index"),f(o,r,t),void r.push("end index"));r.push("square root of"),f(a,r,t),r.push("end square root")}));break;case"supsub":{const{base:a,sub:o,sup:n}=e;let s=!1;if(a&&(f(a,r,t),s="op"===a.type&&"\\log"===a.name),o){const e=s?"base":"subscript";m(r,(function(r){r.push("start "+e),f(o,r,t),r.push("end "+e)}))}n&&m(r,(function(e){const r=w(f(n,[],t)).join(",");r in i?e.push(i[r]):(e.push("start superscript"),f(n,e,t),e.push("end superscript"))}));break}case"text":if("\\textbf"===e.font){m(r,(function(r){r.push("start bold text"),f(e.body,r,t),r.push("end bold text")}));break}m(r,(function(r){r.push("start text"),f(e.body,r,t),r.push("end text")}));break;case"enclose":if(/cancel/.test(e.label)){m(r,(function(r){r.push("start cancel"),f(e.body,r,t),r.push("end cancel")}));break}if(/box/.test(e.label)){m(r,(function(r){r.push("start box"),f(e.body,r,t),r.push("end box")}));break}if(/sout/.test(e.label)){m(r,(function(r){r.push("start strikeout"),f(e.body,r,t),r.push("end strikeout")}));break}if(/phase/.test(e.label)){m(r,(function(r){r.push("start phase angle"),f(e.body,r,t),r.push("end phase angle")}));break}throw new Error("KaTeX-a11y: enclose node with "+e.label+" not supported yet");case"vphantom":throw new Error("KaTeX-a11y: vphantom not implemented yet");case"hphantom":throw new Error("KaTeX-a11y: hphantom not implemented yet");case"array":throw new Error("KaTeX-a11y: array not implemented yet");case"raw":throw new Error("KaTeX-a11y: raw not implemented yet");case"url":throw new Error("KaTeX-a11y: url not implemented yet");case"tag":throw new Error("KaTeX-a11y: tag not implemented yet");case"verb":b("start verbatim","normal",r),b(e.body,"normal",r),b("end verbatim","normal",r);break;case"environment":throw new Error("KaTeX-a11y: environment not implemented yet");case"horizBrace":b("start "+e.label.slice(1),"normal",r),f(e.base,r,t),b("end "+e.label.slice(1),"normal",r);break;case"includegraphics":throw new Error("KaTeX-a11y: includegraphics not implemented yet");case"href":throw new Error("KaTeX-a11y: href not implemented yet");case"cr":throw new Error("KaTeX-a11y: cr not implemented yet");case"underline":m(r,(function(r){r.push("start underline"),f(e.body,r,t),r.push("end underline")}));break;case"xArrow":throw new Error("KaTeX-a11y: xArrow not implemented yet");case"cdlabel":throw new Error("KaTeX-a11y: cdlabel not implemented yet");case"cdlabelparent":throw new Error("KaTeX-a11y: cdlabelparent not implemented yet");case"mclass":{const t=e.mclass.slice(1);f(e.body,r,t);break}case"mathchoice":f(e.text,r,t);break;case"htmlmathml":f(e.mathml,r,t);break;case"middle":b(e.delim,t,r);break;default:throw e.type,new Error("KaTeX a11y un-recognized type: "+e.type)}})(e,r,t);return r},w=function(e){let r=[];return e.forEach((function(e){e instanceof Array?r=r.concat(w(e)):r.push(e)})),r};return o.default=function(e,r){const t=s().__parse(e,r),a=f(t,[],"normal");return w(a).join(", ")},o=o.default}()}));
--------------------------------------------------------------------------------
/assets/katex/contrib/auto-render.js:
--------------------------------------------------------------------------------
1 | (function webpackUniversalModuleDefinition(root, factory) {
2 | if(typeof exports === 'object' && typeof module === 'object')
3 | module.exports = factory(require("katex"));
4 | else if(typeof define === 'function' && define.amd)
5 | define(["katex"], factory);
6 | else if(typeof exports === 'object')
7 | exports["renderMathInElement"] = factory(require("katex"));
8 | else
9 | root["renderMathInElement"] = factory(root["katex"]);
10 | })((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__757__) {
11 | return /******/ (function() { // webpackBootstrap
12 | /******/ "use strict";
13 | /******/ var __webpack_modules__ = ({
14 |
15 | /***/ 757:
16 | /***/ (function(module) {
17 |
18 | module.exports = __WEBPACK_EXTERNAL_MODULE__757__;
19 |
20 | /***/ })
21 |
22 | /******/ });
23 | /************************************************************************/
24 | /******/ // The module cache
25 | /******/ var __webpack_module_cache__ = {};
26 | /******/
27 | /******/ // The require function
28 | /******/ function __webpack_require__(moduleId) {
29 | /******/ // Check if module is in cache
30 | /******/ var cachedModule = __webpack_module_cache__[moduleId];
31 | /******/ if (cachedModule !== undefined) {
32 | /******/ return cachedModule.exports;
33 | /******/ }
34 | /******/ // Create a new module (and put it into the cache)
35 | /******/ var module = __webpack_module_cache__[moduleId] = {
36 | /******/ // no module.id needed
37 | /******/ // no module.loaded needed
38 | /******/ exports: {}
39 | /******/ };
40 | /******/
41 | /******/ // Execute the module function
42 | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
43 | /******/
44 | /******/ // Return the exports of the module
45 | /******/ return module.exports;
46 | /******/ }
47 | /******/
48 | /************************************************************************/
49 | /******/ /* webpack/runtime/compat get default export */
50 | /******/ !function() {
51 | /******/ // getDefaultExport function for compatibility with non-harmony modules
52 | /******/ __webpack_require__.n = function(module) {
53 | /******/ var getter = module && module.__esModule ?
54 | /******/ function() { return module['default']; } :
55 | /******/ function() { return module; };
56 | /******/ __webpack_require__.d(getter, { a: getter });
57 | /******/ return getter;
58 | /******/ };
59 | /******/ }();
60 | /******/
61 | /******/ /* webpack/runtime/define property getters */
62 | /******/ !function() {
63 | /******/ // define getter functions for harmony exports
64 | /******/ __webpack_require__.d = function(exports, definition) {
65 | /******/ for(var key in definition) {
66 | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
67 | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
68 | /******/ }
69 | /******/ }
70 | /******/ };
71 | /******/ }();
72 | /******/
73 | /******/ /* webpack/runtime/hasOwnProperty shorthand */
74 | /******/ !function() {
75 | /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
76 | /******/ }();
77 | /******/
78 | /************************************************************************/
79 | var __webpack_exports__ = {};
80 |
81 | // EXPORTS
82 | __webpack_require__.d(__webpack_exports__, {
83 | "default": function() { return /* binding */ auto_render; }
84 | });
85 |
86 | // EXTERNAL MODULE: external "katex"
87 | var external_katex_ = __webpack_require__(757);
88 | var external_katex_default = /*#__PURE__*/__webpack_require__.n(external_katex_);
89 | ;// CONCATENATED MODULE: ./contrib/auto-render/splitAtDelimiters.js
90 | /* eslint no-constant-condition:0 */
91 | const findEndOfMath = function (delimiter, text, startIndex) {
92 | // Adapted from
93 | // https://github.com/Khan/perseus/blob/master/src/perseus-markdown.jsx
94 | let index = startIndex;
95 | let braceLevel = 0;
96 | const delimLength = delimiter.length;
97 |
98 | while (index < text.length) {
99 | const character = text[index];
100 |
101 | if (braceLevel <= 0 && text.slice(index, index + delimLength) === delimiter) {
102 | return index;
103 | } else if (character === "\\") {
104 | index++;
105 | } else if (character === "{") {
106 | braceLevel++;
107 | } else if (character === "}") {
108 | braceLevel--;
109 | }
110 |
111 | index++;
112 | }
113 |
114 | return -1;
115 | };
116 |
117 | const escapeRegex = function (string) {
118 | return string.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
119 | };
120 |
121 | const amsRegex = /^\\begin{/;
122 |
123 | const splitAtDelimiters = function (text, delimiters) {
124 | let index;
125 | const data = [];
126 | const regexLeft = new RegExp("(" + delimiters.map(x => escapeRegex(x.left)).join("|") + ")");
127 |
128 | while (true) {
129 | index = text.search(regexLeft);
130 |
131 | if (index === -1) {
132 | break;
133 | }
134 |
135 | if (index > 0) {
136 | data.push({
137 | type: "text",
138 | data: text.slice(0, index)
139 | });
140 | text = text.slice(index); // now text starts with delimiter
141 | } // ... so this always succeeds:
142 |
143 |
144 | const i = delimiters.findIndex(delim => text.startsWith(delim.left));
145 | index = findEndOfMath(delimiters[i].right, text, delimiters[i].left.length);
146 |
147 | if (index === -1) {
148 | break;
149 | }
150 |
151 | const rawData = text.slice(0, index + delimiters[i].right.length);
152 | const math = amsRegex.test(rawData) ? rawData : text.slice(delimiters[i].left.length, index);
153 | data.push({
154 | type: "math",
155 | data: math,
156 | rawData,
157 | display: delimiters[i].display
158 | });
159 | text = text.slice(index + delimiters[i].right.length);
160 | }
161 |
162 | if (text !== "") {
163 | data.push({
164 | type: "text",
165 | data: text
166 | });
167 | }
168 |
169 | return data;
170 | };
171 |
172 | /* harmony default export */ var auto_render_splitAtDelimiters = (splitAtDelimiters);
173 | ;// CONCATENATED MODULE: ./contrib/auto-render/auto-render.js
174 | /* eslint no-console:0 */
175 |
176 |
177 | /* Note: optionsCopy is mutated by this method. If it is ever exposed in the
178 | * API, we should copy it before mutating.
179 | */
180 |
181 | const renderMathInText = function (text, optionsCopy) {
182 | const data = auto_render_splitAtDelimiters(text, optionsCopy.delimiters);
183 |
184 | if (data.length === 1 && data[0].type === 'text') {
185 | // There is no formula in the text.
186 | // Let's return null which means there is no need to replace
187 | // the current text node with a new one.
188 | return null;
189 | }
190 |
191 | const fragment = document.createDocumentFragment();
192 |
193 | for (let i = 0; i < data.length; i++) {
194 | if (data[i].type === "text") {
195 | fragment.appendChild(document.createTextNode(data[i].data));
196 | } else {
197 | const span = document.createElement("span");
198 | let math = data[i].data; // Override any display mode defined in the settings with that
199 | // defined by the text itself
200 |
201 | optionsCopy.displayMode = data[i].display;
202 |
203 | try {
204 | if (optionsCopy.preProcess) {
205 | math = optionsCopy.preProcess(math);
206 | }
207 |
208 | external_katex_default().render(math, span, optionsCopy);
209 | } catch (e) {
210 | if (!(e instanceof (external_katex_default()).ParseError)) {
211 | throw e;
212 | }
213 |
214 | optionsCopy.errorCallback("KaTeX auto-render: Failed to parse `" + data[i].data + "` with ", e);
215 | fragment.appendChild(document.createTextNode(data[i].rawData));
216 | continue;
217 | }
218 |
219 | fragment.appendChild(span);
220 | }
221 | }
222 |
223 | return fragment;
224 | };
225 |
226 | const renderElem = function (elem, optionsCopy) {
227 | for (let i = 0; i < elem.childNodes.length; i++) {
228 | const childNode = elem.childNodes[i];
229 |
230 | if (childNode.nodeType === 3) {
231 | // Text node
232 | // Concatenate all sibling text nodes.
233 | // Webkit browsers split very large text nodes into smaller ones,
234 | // so the delimiters may be split across different nodes.
235 | let textContentConcat = childNode.textContent;
236 | let sibling = childNode.nextSibling;
237 | let nSiblings = 0;
238 |
239 | while (sibling && sibling.nodeType === Node.TEXT_NODE) {
240 | textContentConcat += sibling.textContent;
241 | sibling = sibling.nextSibling;
242 | nSiblings++;
243 | }
244 |
245 | const frag = renderMathInText(textContentConcat, optionsCopy);
246 |
247 | if (frag) {
248 | // Remove extra text nodes
249 | for (let j = 0; j < nSiblings; j++) {
250 | childNode.nextSibling.remove();
251 | }
252 |
253 | i += frag.childNodes.length - 1;
254 | elem.replaceChild(frag, childNode);
255 | } else {
256 | // If the concatenated text does not contain math
257 | // the siblings will not either
258 | i += nSiblings;
259 | }
260 | } else if (childNode.nodeType === 1) {
261 | // Element node
262 | const className = ' ' + childNode.className + ' ';
263 | const shouldRender = optionsCopy.ignoredTags.indexOf(childNode.nodeName.toLowerCase()) === -1 && optionsCopy.ignoredClasses.every(x => className.indexOf(' ' + x + ' ') === -1);
264 |
265 | if (shouldRender) {
266 | renderElem(childNode, optionsCopy);
267 | }
268 | } // Otherwise, it's something else, and ignore it.
269 |
270 | }
271 | };
272 |
273 | const renderMathInElement = function (elem, options) {
274 | if (!elem) {
275 | throw new Error("No element provided to render");
276 | }
277 |
278 | const optionsCopy = {}; // Object.assign(optionsCopy, option)
279 |
280 | for (const option in options) {
281 | if (options.hasOwnProperty(option)) {
282 | optionsCopy[option] = options[option];
283 | }
284 | } // default options
285 |
286 |
287 | optionsCopy.delimiters = optionsCopy.delimiters || [{
288 | left: "$$",
289 | right: "$$",
290 | display: true
291 | }, {
292 | left: "\\(",
293 | right: "\\)",
294 | display: false
295 | }, // LaTeX uses $…$, but it ruins the display of normal `$` in text:
296 | // {left: "$", right: "$", display: false},
297 | // $ must come after $$
298 | // Render AMS environments even if outside $$…$$ delimiters.
299 | {
300 | left: "\\begin{equation}",
301 | right: "\\end{equation}",
302 | display: true
303 | }, {
304 | left: "\\begin{align}",
305 | right: "\\end{align}",
306 | display: true
307 | }, {
308 | left: "\\begin{alignat}",
309 | right: "\\end{alignat}",
310 | display: true
311 | }, {
312 | left: "\\begin{gather}",
313 | right: "\\end{gather}",
314 | display: true
315 | }, {
316 | left: "\\begin{CD}",
317 | right: "\\end{CD}",
318 | display: true
319 | }, {
320 | left: "\\[",
321 | right: "\\]",
322 | display: true
323 | }];
324 | optionsCopy.ignoredTags = optionsCopy.ignoredTags || ["script", "noscript", "style", "textarea", "pre", "code", "option"];
325 | optionsCopy.ignoredClasses = optionsCopy.ignoredClasses || [];
326 | optionsCopy.errorCallback = optionsCopy.errorCallback || console.error; // Enable sharing of global macros defined via `\gdef` between different
327 | // math elements within a single call to `renderMathInElement`.
328 |
329 | optionsCopy.macros = optionsCopy.macros || {};
330 | renderElem(elem, optionsCopy);
331 | };
332 |
333 | /* harmony default export */ var auto_render = (renderMathInElement);
334 | __webpack_exports__ = __webpack_exports__["default"];
335 | /******/ return __webpack_exports__;
336 | /******/ })()
337 | ;
338 | });
--------------------------------------------------------------------------------
/assets/katex/katex.min.css:
--------------------------------------------------------------------------------
1 | @font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(fonts/KaTeX_AMS-Regular.woff2) format("woff2"),url(fonts/KaTeX_AMS-Regular.woff) format("woff"),url(fonts/KaTeX_AMS-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Bold.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Regular.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Bold.woff) format("woff"),url(fonts/KaTeX_Fraktur-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Regular.woff) format("woff"),url(fonts/KaTeX_Fraktur-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Main-Bold.woff2) format("woff2"),url(fonts/KaTeX_Main-Bold.woff) format("woff"),url(fonts/KaTeX_Main-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Main-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Main-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Main-Italic.woff2) format("woff2"),url(fonts/KaTeX_Main-Italic.woff) format("woff"),url(fonts/KaTeX_Main-Italic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(fonts/KaTeX_Main-Regular.woff) format("woff"),url(fonts/KaTeX_Main-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Math-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Math-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(fonts/KaTeX_Math-Italic.woff) format("woff"),url(fonts/KaTeX_Math-Italic.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Bold.woff) format("woff"),url(fonts/KaTeX_SansSerif-Bold.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Italic.woff) format("woff"),url(fonts/KaTeX_SansSerif-Italic.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Regular.woff) format("woff"),url(fonts/KaTeX_SansSerif-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Script-Regular.woff2) format("woff2"),url(fonts/KaTeX_Script-Regular.woff) format("woff"),url(fonts/KaTeX_Script-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size1-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size1-Regular.woff) format("woff"),url(fonts/KaTeX_Size1-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size2-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size2-Regular.woff) format("woff"),url(fonts/KaTeX_Size2-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size3-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size3-Regular.woff) format("woff"),url(fonts/KaTeX_Size3-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size4-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size4-Regular.woff) format("woff"),url(fonts/KaTeX_Size4-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"),url(fonts/KaTeX_Typewriter-Regular.woff) format("woff"),url(fonts/KaTeX_Typewriter-Regular.ttf) format("truetype")}.katex{font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.21"}.katex .katex-mathml{clip:rect(1px,1px,1px,1px);border:0;height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}
2 |
--------------------------------------------------------------------------------
/assets/katex/contrib/render-a11y-string.mjs:
--------------------------------------------------------------------------------
1 | import katex from '../katex.mjs';
2 |
3 | /**
4 | * renderA11yString returns a readable string.
5 | *
6 | * In some cases the string will have the proper semantic math
7 | * meaning,:
8 | * renderA11yString("\\frac{1}{2}"")
9 | * -> "start fraction, 1, divided by, 2, end fraction"
10 | *
11 | * However, other cases do not:
12 | * renderA11yString("f(x) = x^2")
13 | * -> "f, left parenthesis, x, right parenthesis, equals, x, squared"
14 | *
15 | * The commas in the string aim to increase ease of understanding
16 | * when read by a screenreader.
17 | */
18 | var stringMap = {
19 | "(": "left parenthesis",
20 | ")": "right parenthesis",
21 | "[": "open bracket",
22 | "]": "close bracket",
23 | "\\{": "left brace",
24 | "\\}": "right brace",
25 | "\\lvert": "open vertical bar",
26 | "\\rvert": "close vertical bar",
27 | "|": "vertical bar",
28 | "\\uparrow": "up arrow",
29 | "\\Uparrow": "up arrow",
30 | "\\downarrow": "down arrow",
31 | "\\Downarrow": "down arrow",
32 | "\\updownarrow": "up down arrow",
33 | "\\leftarrow": "left arrow",
34 | "\\Leftarrow": "left arrow",
35 | "\\rightarrow": "right arrow",
36 | "\\Rightarrow": "right arrow",
37 | "\\langle": "open angle",
38 | "\\rangle": "close angle",
39 | "\\lfloor": "open floor",
40 | "\\rfloor": "close floor",
41 | "\\int": "integral",
42 | "\\intop": "integral",
43 | "\\lim": "limit",
44 | "\\ln": "natural log",
45 | "\\log": "log",
46 | "\\sin": "sine",
47 | "\\cos": "cosine",
48 | "\\tan": "tangent",
49 | "\\cot": "cotangent",
50 | "\\sum": "sum",
51 | "/": "slash",
52 | ",": "comma",
53 | ".": "point",
54 | "-": "negative",
55 | "+": "plus",
56 | "~": "tilde",
57 | ":": "colon",
58 | "?": "question mark",
59 | "'": "apostrophe",
60 | "\\%": "percent",
61 | " ": "space",
62 | "\\ ": "space",
63 | "\\$": "dollar sign",
64 | "\\angle": "angle",
65 | "\\degree": "degree",
66 | "\\circ": "circle",
67 | "\\vec": "vector",
68 | "\\triangle": "triangle",
69 | "\\pi": "pi",
70 | "\\prime": "prime",
71 | "\\infty": "infinity",
72 | "\\alpha": "alpha",
73 | "\\beta": "beta",
74 | "\\gamma": "gamma",
75 | "\\omega": "omega",
76 | "\\theta": "theta",
77 | "\\sigma": "sigma",
78 | "\\lambda": "lambda",
79 | "\\tau": "tau",
80 | "\\Delta": "delta",
81 | "\\delta": "delta",
82 | "\\mu": "mu",
83 | "\\rho": "rho",
84 | "\\nabla": "del",
85 | "\\ell": "ell",
86 | "\\ldots": "dots",
87 | // TODO: add entries for all accents
88 | "\\hat": "hat",
89 | "\\acute": "acute"
90 | };
91 | var powerMap = {
92 | "prime": "prime",
93 | "degree": "degrees",
94 | "circle": "degrees",
95 | "2": "squared",
96 | "3": "cubed"
97 | };
98 | var openMap = {
99 | "|": "open vertical bar",
100 | ".": ""
101 | };
102 | var closeMap = {
103 | "|": "close vertical bar",
104 | ".": ""
105 | };
106 | var binMap = {
107 | "+": "plus",
108 | "-": "minus",
109 | "\\pm": "plus minus",
110 | "\\cdot": "dot",
111 | "*": "times",
112 | "/": "divided by",
113 | "\\times": "times",
114 | "\\div": "divided by",
115 | "\\circ": "circle",
116 | "\\bullet": "bullet"
117 | };
118 | var relMap = {
119 | "=": "equals",
120 | "\\approx": "approximately equals",
121 | "≠": "does not equal",
122 | "\\geq": "is greater than or equal to",
123 | "\\ge": "is greater than or equal to",
124 | "\\leq": "is less than or equal to",
125 | "\\le": "is less than or equal to",
126 | ">": "is greater than",
127 | "<": "is less than",
128 | "\\leftarrow": "left arrow",
129 | "\\Leftarrow": "left arrow",
130 | "\\rightarrow": "right arrow",
131 | "\\Rightarrow": "right arrow",
132 | ":": "colon"
133 | };
134 | var accentUnderMap = {
135 | "\\underleftarrow": "left arrow",
136 | "\\underrightarrow": "right arrow",
137 | "\\underleftrightarrow": "left-right arrow",
138 | "\\undergroup": "group",
139 | "\\underlinesegment": "line segment",
140 | "\\utilde": "tilde"
141 | };
142 |
143 | var buildString = (str, type, a11yStrings) => {
144 | if (!str) {
145 | return;
146 | }
147 |
148 | var ret;
149 |
150 | if (type === "open") {
151 | ret = str in openMap ? openMap[str] : stringMap[str] || str;
152 | } else if (type === "close") {
153 | ret = str in closeMap ? closeMap[str] : stringMap[str] || str;
154 | } else if (type === "bin") {
155 | ret = binMap[str] || str;
156 | } else if (type === "rel") {
157 | ret = relMap[str] || str;
158 | } else {
159 | ret = stringMap[str] || str;
160 | } // If the text to add is a number and there is already a string
161 | // in the list and the last string is a number then we should
162 | // combine them into a single number
163 |
164 |
165 | if (/^\d+$/.test(ret) && a11yStrings.length > 0 && // TODO(kevinb): check that the last item in a11yStrings is a string
166 | // I think we might be able to drop the nested arrays, which would make
167 | // this easier to type
168 | // $FlowFixMe
169 | /^\d+$/.test(a11yStrings[a11yStrings.length - 1])) {
170 | a11yStrings[a11yStrings.length - 1] += ret;
171 | } else if (ret) {
172 | a11yStrings.push(ret);
173 | }
174 | };
175 |
176 | var buildRegion = (a11yStrings, callback) => {
177 | var regionStrings = [];
178 | a11yStrings.push(regionStrings);
179 | callback(regionStrings);
180 | };
181 |
182 | var handleObject = (tree, a11yStrings, atomType) => {
183 | // Everything else is assumed to be an object...
184 | switch (tree.type) {
185 | case "accent":
186 | {
187 | buildRegion(a11yStrings, a11yStrings => {
188 | buildA11yStrings(tree.base, a11yStrings, atomType);
189 | a11yStrings.push("with");
190 | buildString(tree.label, "normal", a11yStrings);
191 | a11yStrings.push("on top");
192 | });
193 | break;
194 | }
195 |
196 | case "accentUnder":
197 | {
198 | buildRegion(a11yStrings, a11yStrings => {
199 | buildA11yStrings(tree.base, a11yStrings, atomType);
200 | a11yStrings.push("with");
201 | buildString(accentUnderMap[tree.label], "normal", a11yStrings);
202 | a11yStrings.push("underneath");
203 | });
204 | break;
205 | }
206 |
207 | case "accent-token":
208 | {
209 | // Used internally by accent symbols.
210 | break;
211 | }
212 |
213 | case "atom":
214 | {
215 | var {
216 | text
217 | } = tree;
218 |
219 | switch (tree.family) {
220 | case "bin":
221 | {
222 | buildString(text, "bin", a11yStrings);
223 | break;
224 | }
225 |
226 | case "close":
227 | {
228 | buildString(text, "close", a11yStrings);
229 | break;
230 | }
231 | // TODO(kevinb): figure out what should be done for inner
232 |
233 | case "inner":
234 | {
235 | buildString(tree.text, "inner", a11yStrings);
236 | break;
237 | }
238 |
239 | case "open":
240 | {
241 | buildString(text, "open", a11yStrings);
242 | break;
243 | }
244 |
245 | case "punct":
246 | {
247 | buildString(text, "punct", a11yStrings);
248 | break;
249 | }
250 |
251 | case "rel":
252 | {
253 | buildString(text, "rel", a11yStrings);
254 | break;
255 | }
256 |
257 | default:
258 | {
259 | tree.family;
260 | throw new Error("\"" + tree.family + "\" is not a valid atom type");
261 | }
262 | }
263 |
264 | break;
265 | }
266 |
267 | case "color":
268 | {
269 | var color = tree.color.replace(/katex-/, "");
270 | buildRegion(a11yStrings, regionStrings => {
271 | regionStrings.push("start color " + color);
272 | buildA11yStrings(tree.body, regionStrings, atomType);
273 | regionStrings.push("end color " + color);
274 | });
275 | break;
276 | }
277 |
278 | case "color-token":
279 | {
280 | // Used by \color, \colorbox, and \fcolorbox but not directly rendered.
281 | // It's a leaf node and has no children so just break.
282 | break;
283 | }
284 |
285 | case "delimsizing":
286 | {
287 | if (tree.delim && tree.delim !== ".") {
288 | buildString(tree.delim, "normal", a11yStrings);
289 | }
290 |
291 | break;
292 | }
293 |
294 | case "genfrac":
295 | {
296 | buildRegion(a11yStrings, regionStrings => {
297 | // genfrac can have unbalanced delimiters
298 | var {
299 | leftDelim,
300 | rightDelim
301 | } = tree; // NOTE: Not sure if this is a safe assumption
302 | // hasBarLine true -> fraction, false -> binomial
303 |
304 | if (tree.hasBarLine) {
305 | regionStrings.push("start fraction");
306 | leftDelim && buildString(leftDelim, "open", regionStrings);
307 | buildA11yStrings(tree.numer, regionStrings, atomType);
308 | regionStrings.push("divided by");
309 | buildA11yStrings(tree.denom, regionStrings, atomType);
310 | rightDelim && buildString(rightDelim, "close", regionStrings);
311 | regionStrings.push("end fraction");
312 | } else {
313 | regionStrings.push("start binomial");
314 | leftDelim && buildString(leftDelim, "open", regionStrings);
315 | buildA11yStrings(tree.numer, regionStrings, atomType);
316 | regionStrings.push("over");
317 | buildA11yStrings(tree.denom, regionStrings, atomType);
318 | rightDelim && buildString(rightDelim, "close", regionStrings);
319 | regionStrings.push("end binomial");
320 | }
321 | });
322 | break;
323 | }
324 |
325 | case "hbox":
326 | {
327 | buildA11yStrings(tree.body, a11yStrings, atomType);
328 | break;
329 | }
330 |
331 | case "kern":
332 | {
333 | // No op: we don't attempt to present kerning information
334 | // to the screen reader.
335 | break;
336 | }
337 |
338 | case "leftright":
339 | {
340 | buildRegion(a11yStrings, regionStrings => {
341 | buildString(tree.left, "open", regionStrings);
342 | buildA11yStrings(tree.body, regionStrings, atomType);
343 | buildString(tree.right, "close", regionStrings);
344 | });
345 | break;
346 | }
347 |
348 | case "leftright-right":
349 | {
350 | // TODO: double check that this is a no-op
351 | break;
352 | }
353 |
354 | case "lap":
355 | {
356 | buildA11yStrings(tree.body, a11yStrings, atomType);
357 | break;
358 | }
359 |
360 | case "mathord":
361 | {
362 | buildString(tree.text, "normal", a11yStrings);
363 | break;
364 | }
365 |
366 | case "op":
367 | {
368 | var {
369 | body,
370 | name
371 | } = tree;
372 |
373 | if (body) {
374 | buildA11yStrings(body, a11yStrings, atomType);
375 | } else if (name) {
376 | buildString(name, "normal", a11yStrings);
377 | }
378 |
379 | break;
380 | }
381 |
382 | case "op-token":
383 | {
384 | // Used internally by operator symbols.
385 | buildString(tree.text, atomType, a11yStrings);
386 | break;
387 | }
388 |
389 | case "ordgroup":
390 | {
391 | buildA11yStrings(tree.body, a11yStrings, atomType);
392 | break;
393 | }
394 |
395 | case "overline":
396 | {
397 | buildRegion(a11yStrings, function (a11yStrings) {
398 | a11yStrings.push("start overline");
399 | buildA11yStrings(tree.body, a11yStrings, atomType);
400 | a11yStrings.push("end overline");
401 | });
402 | break;
403 | }
404 |
405 | case "pmb":
406 | {
407 | a11yStrings.push("bold");
408 | break;
409 | }
410 |
411 | case "phantom":
412 | {
413 | a11yStrings.push("empty space");
414 | break;
415 | }
416 |
417 | case "raisebox":
418 | {
419 | buildA11yStrings(tree.body, a11yStrings, atomType);
420 | break;
421 | }
422 |
423 | case "rule":
424 | {
425 | a11yStrings.push("rectangle");
426 | break;
427 | }
428 |
429 | case "sizing":
430 | {
431 | buildA11yStrings(tree.body, a11yStrings, atomType);
432 | break;
433 | }
434 |
435 | case "spacing":
436 | {
437 | a11yStrings.push("space");
438 | break;
439 | }
440 |
441 | case "styling":
442 | {
443 | // We ignore the styling and just pass through the contents
444 | buildA11yStrings(tree.body, a11yStrings, atomType);
445 | break;
446 | }
447 |
448 | case "sqrt":
449 | {
450 | buildRegion(a11yStrings, regionStrings => {
451 | var {
452 | body,
453 | index
454 | } = tree;
455 |
456 | if (index) {
457 | var indexString = flatten(buildA11yStrings(index, [], atomType)).join(",");
458 |
459 | if (indexString === "3") {
460 | regionStrings.push("cube root of");
461 | buildA11yStrings(body, regionStrings, atomType);
462 | regionStrings.push("end cube root");
463 | return;
464 | }
465 |
466 | regionStrings.push("root");
467 | regionStrings.push("start index");
468 | buildA11yStrings(index, regionStrings, atomType);
469 | regionStrings.push("end index");
470 | return;
471 | }
472 |
473 | regionStrings.push("square root of");
474 | buildA11yStrings(body, regionStrings, atomType);
475 | regionStrings.push("end square root");
476 | });
477 | break;
478 | }
479 |
480 | case "supsub":
481 | {
482 | var {
483 | base,
484 | sub,
485 | sup
486 | } = tree;
487 | var isLog = false;
488 |
489 | if (base) {
490 | buildA11yStrings(base, a11yStrings, atomType);
491 | isLog = base.type === "op" && base.name === "\\log";
492 | }
493 |
494 | if (sub) {
495 | var regionName = isLog ? "base" : "subscript";
496 | buildRegion(a11yStrings, function (regionStrings) {
497 | regionStrings.push("start " + regionName);
498 | buildA11yStrings(sub, regionStrings, atomType);
499 | regionStrings.push("end " + regionName);
500 | });
501 | }
502 |
503 | if (sup) {
504 | buildRegion(a11yStrings, function (regionStrings) {
505 | var supString = flatten(buildA11yStrings(sup, [], atomType)).join(",");
506 |
507 | if (supString in powerMap) {
508 | regionStrings.push(powerMap[supString]);
509 | return;
510 | }
511 |
512 | regionStrings.push("start superscript");
513 | buildA11yStrings(sup, regionStrings, atomType);
514 | regionStrings.push("end superscript");
515 | });
516 | }
517 |
518 | break;
519 | }
520 |
521 | case "text":
522 | {
523 | // TODO: handle other fonts
524 | if (tree.font === "\\textbf") {
525 | buildRegion(a11yStrings, function (regionStrings) {
526 | regionStrings.push("start bold text");
527 | buildA11yStrings(tree.body, regionStrings, atomType);
528 | regionStrings.push("end bold text");
529 | });
530 | break;
531 | }
532 |
533 | buildRegion(a11yStrings, function (regionStrings) {
534 | regionStrings.push("start text");
535 | buildA11yStrings(tree.body, regionStrings, atomType);
536 | regionStrings.push("end text");
537 | });
538 | break;
539 | }
540 |
541 | case "textord":
542 | {
543 | buildString(tree.text, atomType, a11yStrings);
544 | break;
545 | }
546 |
547 | case "smash":
548 | {
549 | buildA11yStrings(tree.body, a11yStrings, atomType);
550 | break;
551 | }
552 |
553 | case "enclose":
554 | {
555 | // TODO: create a map for these.
556 | // TODO: differentiate between a body with a single atom, e.g.
557 | // "cancel a" instead of "start cancel, a, end cancel"
558 | if (/cancel/.test(tree.label)) {
559 | buildRegion(a11yStrings, function (regionStrings) {
560 | regionStrings.push("start cancel");
561 | buildA11yStrings(tree.body, regionStrings, atomType);
562 | regionStrings.push("end cancel");
563 | });
564 | break;
565 | } else if (/box/.test(tree.label)) {
566 | buildRegion(a11yStrings, function (regionStrings) {
567 | regionStrings.push("start box");
568 | buildA11yStrings(tree.body, regionStrings, atomType);
569 | regionStrings.push("end box");
570 | });
571 | break;
572 | } else if (/sout/.test(tree.label)) {
573 | buildRegion(a11yStrings, function (regionStrings) {
574 | regionStrings.push("start strikeout");
575 | buildA11yStrings(tree.body, regionStrings, atomType);
576 | regionStrings.push("end strikeout");
577 | });
578 | break;
579 | } else if (/phase/.test(tree.label)) {
580 | buildRegion(a11yStrings, function (regionStrings) {
581 | regionStrings.push("start phase angle");
582 | buildA11yStrings(tree.body, regionStrings, atomType);
583 | regionStrings.push("end phase angle");
584 | });
585 | break;
586 | }
587 |
588 | throw new Error("KaTeX-a11y: enclose node with " + tree.label + " not supported yet");
589 | }
590 |
591 | case "vcenter":
592 | {
593 | buildA11yStrings(tree.body, a11yStrings, atomType);
594 | break;
595 | }
596 |
597 | case "vphantom":
598 | {
599 | throw new Error("KaTeX-a11y: vphantom not implemented yet");
600 | }
601 |
602 | case "hphantom":
603 | {
604 | throw new Error("KaTeX-a11y: hphantom not implemented yet");
605 | }
606 |
607 | case "operatorname":
608 | {
609 | buildA11yStrings(tree.body, a11yStrings, atomType);
610 | break;
611 | }
612 |
613 | case "array":
614 | {
615 | throw new Error("KaTeX-a11y: array not implemented yet");
616 | }
617 |
618 | case "raw":
619 | {
620 | throw new Error("KaTeX-a11y: raw not implemented yet");
621 | }
622 |
623 | case "size":
624 | {
625 | // Although there are nodes of type "size" in the parse tree, they have
626 | // no semantic meaning and should be ignored.
627 | break;
628 | }
629 |
630 | case "url":
631 | {
632 | throw new Error("KaTeX-a11y: url not implemented yet");
633 | }
634 |
635 | case "tag":
636 | {
637 | throw new Error("KaTeX-a11y: tag not implemented yet");
638 | }
639 |
640 | case "verb":
641 | {
642 | buildString("start verbatim", "normal", a11yStrings);
643 | buildString(tree.body, "normal", a11yStrings);
644 | buildString("end verbatim", "normal", a11yStrings);
645 | break;
646 | }
647 |
648 | case "environment":
649 | {
650 | throw new Error("KaTeX-a11y: environment not implemented yet");
651 | }
652 |
653 | case "horizBrace":
654 | {
655 | buildString("start " + tree.label.slice(1), "normal", a11yStrings);
656 | buildA11yStrings(tree.base, a11yStrings, atomType);
657 | buildString("end " + tree.label.slice(1), "normal", a11yStrings);
658 | break;
659 | }
660 |
661 | case "infix":
662 | {
663 | // All infix nodes are replace with other nodes.
664 | break;
665 | }
666 |
667 | case "includegraphics":
668 | {
669 | throw new Error("KaTeX-a11y: includegraphics not implemented yet");
670 | }
671 |
672 | case "font":
673 | {
674 | // TODO: callout the start/end of specific fonts
675 | // TODO: map \BBb{N} to "the naturals" or something like that
676 | buildA11yStrings(tree.body, a11yStrings, atomType);
677 | break;
678 | }
679 |
680 | case "href":
681 | {
682 | throw new Error("KaTeX-a11y: href not implemented yet");
683 | }
684 |
685 | case "cr":
686 | {
687 | // This is used by environments.
688 | throw new Error("KaTeX-a11y: cr not implemented yet");
689 | }
690 |
691 | case "underline":
692 | {
693 | buildRegion(a11yStrings, function (a11yStrings) {
694 | a11yStrings.push("start underline");
695 | buildA11yStrings(tree.body, a11yStrings, atomType);
696 | a11yStrings.push("end underline");
697 | });
698 | break;
699 | }
700 |
701 | case "xArrow":
702 | {
703 | throw new Error("KaTeX-a11y: xArrow not implemented yet");
704 | }
705 |
706 | case "cdlabel":
707 | {
708 | throw new Error("KaTeX-a11y: cdlabel not implemented yet");
709 | }
710 |
711 | case "cdlabelparent":
712 | {
713 | throw new Error("KaTeX-a11y: cdlabelparent not implemented yet");
714 | }
715 |
716 | case "mclass":
717 | {
718 | // \neq and \ne are macros so we let "htmlmathml" render the mathmal
719 | // side of things and extract the text from that.
720 | var _atomType = tree.mclass.slice(1); // $FlowFixMe: drop the leading "m" from the values in mclass
721 |
722 |
723 | buildA11yStrings(tree.body, a11yStrings, _atomType);
724 | break;
725 | }
726 |
727 | case "mathchoice":
728 | {
729 | // TODO: track which style we're using, e.g. display, text, etc.
730 | // default to text style if even that may not be the correct style
731 | buildA11yStrings(tree.text, a11yStrings, atomType);
732 | break;
733 | }
734 |
735 | case "htmlmathml":
736 | {
737 | buildA11yStrings(tree.mathml, a11yStrings, atomType);
738 | break;
739 | }
740 |
741 | case "middle":
742 | {
743 | buildString(tree.delim, atomType, a11yStrings);
744 | break;
745 | }
746 |
747 | case "internal":
748 | {
749 | // internal nodes are never included in the parse tree
750 | break;
751 | }
752 |
753 | case "html":
754 | {
755 | buildA11yStrings(tree.body, a11yStrings, atomType);
756 | break;
757 | }
758 |
759 | default:
760 | tree.type;
761 | throw new Error("KaTeX a11y un-recognized type: " + tree.type);
762 | }
763 | };
764 |
765 | var buildA11yStrings = function buildA11yStrings(tree, a11yStrings, atomType) {
766 | if (a11yStrings === void 0) {
767 | a11yStrings = [];
768 | }
769 |
770 | if (tree instanceof Array) {
771 | for (var i = 0; i < tree.length; i++) {
772 | buildA11yStrings(tree[i], a11yStrings, atomType);
773 | }
774 | } else {
775 | handleObject(tree, a11yStrings, atomType);
776 | }
777 |
778 | return a11yStrings;
779 | };
780 |
781 | var flatten = function flatten(array) {
782 | var result = [];
783 | array.forEach(function (item) {
784 | if (item instanceof Array) {
785 | result = result.concat(flatten(item));
786 | } else {
787 | result.push(item);
788 | }
789 | });
790 | return result;
791 | };
792 |
793 | var renderA11yString = function renderA11yString(text, settings) {
794 | var tree = katex.__parse(text, settings);
795 |
796 | var a11yStrings = buildA11yStrings(tree, [], "normal");
797 | return flatten(a11yStrings).join(", ");
798 | };
799 |
800 | export { renderA11yString as default };
801 |
--------------------------------------------------------------------------------
/assets/katex/contrib/render-a11y-string.js:
--------------------------------------------------------------------------------
1 | (function webpackUniversalModuleDefinition(root, factory) {
2 | if(typeof exports === 'object' && typeof module === 'object')
3 | module.exports = factory(require("katex"));
4 | else if(typeof define === 'function' && define.amd)
5 | define(["katex"], factory);
6 | else {
7 | var a = typeof exports === 'object' ? factory(require("katex")) : factory(root["katex"]);
8 | for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
9 | }
10 | })((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__757__) {
11 | return /******/ (function() { // webpackBootstrap
12 | /******/ "use strict";
13 | /******/ var __webpack_modules__ = ({
14 |
15 | /***/ 757:
16 | /***/ (function(module) {
17 |
18 | module.exports = __WEBPACK_EXTERNAL_MODULE__757__;
19 |
20 | /***/ })
21 |
22 | /******/ });
23 | /************************************************************************/
24 | /******/ // The module cache
25 | /******/ var __webpack_module_cache__ = {};
26 | /******/
27 | /******/ // The require function
28 | /******/ function __webpack_require__(moduleId) {
29 | /******/ // Check if module is in cache
30 | /******/ var cachedModule = __webpack_module_cache__[moduleId];
31 | /******/ if (cachedModule !== undefined) {
32 | /******/ return cachedModule.exports;
33 | /******/ }
34 | /******/ // Create a new module (and put it into the cache)
35 | /******/ var module = __webpack_module_cache__[moduleId] = {
36 | /******/ // no module.id needed
37 | /******/ // no module.loaded needed
38 | /******/ exports: {}
39 | /******/ };
40 | /******/
41 | /******/ // Execute the module function
42 | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
43 | /******/
44 | /******/ // Return the exports of the module
45 | /******/ return module.exports;
46 | /******/ }
47 | /******/
48 | /************************************************************************/
49 | /******/ /* webpack/runtime/compat get default export */
50 | /******/ !function() {
51 | /******/ // getDefaultExport function for compatibility with non-harmony modules
52 | /******/ __webpack_require__.n = function(module) {
53 | /******/ var getter = module && module.__esModule ?
54 | /******/ function() { return module['default']; } :
55 | /******/ function() { return module; };
56 | /******/ __webpack_require__.d(getter, { a: getter });
57 | /******/ return getter;
58 | /******/ };
59 | /******/ }();
60 | /******/
61 | /******/ /* webpack/runtime/define property getters */
62 | /******/ !function() {
63 | /******/ // define getter functions for harmony exports
64 | /******/ __webpack_require__.d = function(exports, definition) {
65 | /******/ for(var key in definition) {
66 | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
67 | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
68 | /******/ }
69 | /******/ }
70 | /******/ };
71 | /******/ }();
72 | /******/
73 | /******/ /* webpack/runtime/hasOwnProperty shorthand */
74 | /******/ !function() {
75 | /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
76 | /******/ }();
77 | /******/
78 | /************************************************************************/
79 | var __webpack_exports__ = {};
80 | /* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(757);
81 | /* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(katex__WEBPACK_IMPORTED_MODULE_0__);
82 | /**
83 | * renderA11yString returns a readable string.
84 | *
85 | * In some cases the string will have the proper semantic math
86 | * meaning,:
87 | * renderA11yString("\\frac{1}{2}"")
88 | * -> "start fraction, 1, divided by, 2, end fraction"
89 | *
90 | * However, other cases do not:
91 | * renderA11yString("f(x) = x^2")
92 | * -> "f, left parenthesis, x, right parenthesis, equals, x, squared"
93 | *
94 | * The commas in the string aim to increase ease of understanding
95 | * when read by a screenreader.
96 | */
97 | // NOTE: since we're importing types here these files won't actually be
98 | // included in the build.
99 | // $FlowIgnore: we import the types directly anyways
100 |
101 | const stringMap = {
102 | "(": "left parenthesis",
103 | ")": "right parenthesis",
104 | "[": "open bracket",
105 | "]": "close bracket",
106 | "\\{": "left brace",
107 | "\\}": "right brace",
108 | "\\lvert": "open vertical bar",
109 | "\\rvert": "close vertical bar",
110 | "|": "vertical bar",
111 | "\\uparrow": "up arrow",
112 | "\\Uparrow": "up arrow",
113 | "\\downarrow": "down arrow",
114 | "\\Downarrow": "down arrow",
115 | "\\updownarrow": "up down arrow",
116 | "\\leftarrow": "left arrow",
117 | "\\Leftarrow": "left arrow",
118 | "\\rightarrow": "right arrow",
119 | "\\Rightarrow": "right arrow",
120 | "\\langle": "open angle",
121 | "\\rangle": "close angle",
122 | "\\lfloor": "open floor",
123 | "\\rfloor": "close floor",
124 | "\\int": "integral",
125 | "\\intop": "integral",
126 | "\\lim": "limit",
127 | "\\ln": "natural log",
128 | "\\log": "log",
129 | "\\sin": "sine",
130 | "\\cos": "cosine",
131 | "\\tan": "tangent",
132 | "\\cot": "cotangent",
133 | "\\sum": "sum",
134 | "/": "slash",
135 | ",": "comma",
136 | ".": "point",
137 | "-": "negative",
138 | "+": "plus",
139 | "~": "tilde",
140 | ":": "colon",
141 | "?": "question mark",
142 | "'": "apostrophe",
143 | "\\%": "percent",
144 | " ": "space",
145 | "\\ ": "space",
146 | "\\$": "dollar sign",
147 | "\\angle": "angle",
148 | "\\degree": "degree",
149 | "\\circ": "circle",
150 | "\\vec": "vector",
151 | "\\triangle": "triangle",
152 | "\\pi": "pi",
153 | "\\prime": "prime",
154 | "\\infty": "infinity",
155 | "\\alpha": "alpha",
156 | "\\beta": "beta",
157 | "\\gamma": "gamma",
158 | "\\omega": "omega",
159 | "\\theta": "theta",
160 | "\\sigma": "sigma",
161 | "\\lambda": "lambda",
162 | "\\tau": "tau",
163 | "\\Delta": "delta",
164 | "\\delta": "delta",
165 | "\\mu": "mu",
166 | "\\rho": "rho",
167 | "\\nabla": "del",
168 | "\\ell": "ell",
169 | "\\ldots": "dots",
170 | // TODO: add entries for all accents
171 | "\\hat": "hat",
172 | "\\acute": "acute"
173 | };
174 | const powerMap = {
175 | "prime": "prime",
176 | "degree": "degrees",
177 | "circle": "degrees",
178 | "2": "squared",
179 | "3": "cubed"
180 | };
181 | const openMap = {
182 | "|": "open vertical bar",
183 | ".": ""
184 | };
185 | const closeMap = {
186 | "|": "close vertical bar",
187 | ".": ""
188 | };
189 | const binMap = {
190 | "+": "plus",
191 | "-": "minus",
192 | "\\pm": "plus minus",
193 | "\\cdot": "dot",
194 | "*": "times",
195 | "/": "divided by",
196 | "\\times": "times",
197 | "\\div": "divided by",
198 | "\\circ": "circle",
199 | "\\bullet": "bullet"
200 | };
201 | const relMap = {
202 | "=": "equals",
203 | "\\approx": "approximately equals",
204 | "≠": "does not equal",
205 | "\\geq": "is greater than or equal to",
206 | "\\ge": "is greater than or equal to",
207 | "\\leq": "is less than or equal to",
208 | "\\le": "is less than or equal to",
209 | ">": "is greater than",
210 | "<": "is less than",
211 | "\\leftarrow": "left arrow",
212 | "\\Leftarrow": "left arrow",
213 | "\\rightarrow": "right arrow",
214 | "\\Rightarrow": "right arrow",
215 | ":": "colon"
216 | };
217 | const accentUnderMap = {
218 | "\\underleftarrow": "left arrow",
219 | "\\underrightarrow": "right arrow",
220 | "\\underleftrightarrow": "left-right arrow",
221 | "\\undergroup": "group",
222 | "\\underlinesegment": "line segment",
223 | "\\utilde": "tilde"
224 | };
225 |
226 | const buildString = (str, type, a11yStrings) => {
227 | if (!str) {
228 | return;
229 | }
230 |
231 | let ret;
232 |
233 | if (type === "open") {
234 | ret = str in openMap ? openMap[str] : stringMap[str] || str;
235 | } else if (type === "close") {
236 | ret = str in closeMap ? closeMap[str] : stringMap[str] || str;
237 | } else if (type === "bin") {
238 | ret = binMap[str] || str;
239 | } else if (type === "rel") {
240 | ret = relMap[str] || str;
241 | } else {
242 | ret = stringMap[str] || str;
243 | } // If the text to add is a number and there is already a string
244 | // in the list and the last string is a number then we should
245 | // combine them into a single number
246 |
247 |
248 | if (/^\d+$/.test(ret) && a11yStrings.length > 0 && // TODO(kevinb): check that the last item in a11yStrings is a string
249 | // I think we might be able to drop the nested arrays, which would make
250 | // this easier to type
251 | // $FlowFixMe
252 | /^\d+$/.test(a11yStrings[a11yStrings.length - 1])) {
253 | a11yStrings[a11yStrings.length - 1] += ret;
254 | } else if (ret) {
255 | a11yStrings.push(ret);
256 | }
257 | };
258 |
259 | const buildRegion = (a11yStrings, callback) => {
260 | const regionStrings = [];
261 | a11yStrings.push(regionStrings);
262 | callback(regionStrings);
263 | };
264 |
265 | const handleObject = (tree, a11yStrings, atomType) => {
266 | // Everything else is assumed to be an object...
267 | switch (tree.type) {
268 | case "accent":
269 | {
270 | buildRegion(a11yStrings, a11yStrings => {
271 | buildA11yStrings(tree.base, a11yStrings, atomType);
272 | a11yStrings.push("with");
273 | buildString(tree.label, "normal", a11yStrings);
274 | a11yStrings.push("on top");
275 | });
276 | break;
277 | }
278 |
279 | case "accentUnder":
280 | {
281 | buildRegion(a11yStrings, a11yStrings => {
282 | buildA11yStrings(tree.base, a11yStrings, atomType);
283 | a11yStrings.push("with");
284 | buildString(accentUnderMap[tree.label], "normal", a11yStrings);
285 | a11yStrings.push("underneath");
286 | });
287 | break;
288 | }
289 |
290 | case "accent-token":
291 | {
292 | // Used internally by accent symbols.
293 | break;
294 | }
295 |
296 | case "atom":
297 | {
298 | const {
299 | text
300 | } = tree;
301 |
302 | switch (tree.family) {
303 | case "bin":
304 | {
305 | buildString(text, "bin", a11yStrings);
306 | break;
307 | }
308 |
309 | case "close":
310 | {
311 | buildString(text, "close", a11yStrings);
312 | break;
313 | }
314 | // TODO(kevinb): figure out what should be done for inner
315 |
316 | case "inner":
317 | {
318 | buildString(tree.text, "inner", a11yStrings);
319 | break;
320 | }
321 |
322 | case "open":
323 | {
324 | buildString(text, "open", a11yStrings);
325 | break;
326 | }
327 |
328 | case "punct":
329 | {
330 | buildString(text, "punct", a11yStrings);
331 | break;
332 | }
333 |
334 | case "rel":
335 | {
336 | buildString(text, "rel", a11yStrings);
337 | break;
338 | }
339 |
340 | default:
341 | {
342 | tree.family;
343 | throw new Error("\"" + tree.family + "\" is not a valid atom type");
344 | }
345 | }
346 |
347 | break;
348 | }
349 |
350 | case "color":
351 | {
352 | const color = tree.color.replace(/katex-/, "");
353 | buildRegion(a11yStrings, regionStrings => {
354 | regionStrings.push("start color " + color);
355 | buildA11yStrings(tree.body, regionStrings, atomType);
356 | regionStrings.push("end color " + color);
357 | });
358 | break;
359 | }
360 |
361 | case "color-token":
362 | {
363 | // Used by \color, \colorbox, and \fcolorbox but not directly rendered.
364 | // It's a leaf node and has no children so just break.
365 | break;
366 | }
367 |
368 | case "delimsizing":
369 | {
370 | if (tree.delim && tree.delim !== ".") {
371 | buildString(tree.delim, "normal", a11yStrings);
372 | }
373 |
374 | break;
375 | }
376 |
377 | case "genfrac":
378 | {
379 | buildRegion(a11yStrings, regionStrings => {
380 | // genfrac can have unbalanced delimiters
381 | const {
382 | leftDelim,
383 | rightDelim
384 | } = tree; // NOTE: Not sure if this is a safe assumption
385 | // hasBarLine true -> fraction, false -> binomial
386 |
387 | if (tree.hasBarLine) {
388 | regionStrings.push("start fraction");
389 | leftDelim && buildString(leftDelim, "open", regionStrings);
390 | buildA11yStrings(tree.numer, regionStrings, atomType);
391 | regionStrings.push("divided by");
392 | buildA11yStrings(tree.denom, regionStrings, atomType);
393 | rightDelim && buildString(rightDelim, "close", regionStrings);
394 | regionStrings.push("end fraction");
395 | } else {
396 | regionStrings.push("start binomial");
397 | leftDelim && buildString(leftDelim, "open", regionStrings);
398 | buildA11yStrings(tree.numer, regionStrings, atomType);
399 | regionStrings.push("over");
400 | buildA11yStrings(tree.denom, regionStrings, atomType);
401 | rightDelim && buildString(rightDelim, "close", regionStrings);
402 | regionStrings.push("end binomial");
403 | }
404 | });
405 | break;
406 | }
407 |
408 | case "hbox":
409 | {
410 | buildA11yStrings(tree.body, a11yStrings, atomType);
411 | break;
412 | }
413 |
414 | case "kern":
415 | {
416 | // No op: we don't attempt to present kerning information
417 | // to the screen reader.
418 | break;
419 | }
420 |
421 | case "leftright":
422 | {
423 | buildRegion(a11yStrings, regionStrings => {
424 | buildString(tree.left, "open", regionStrings);
425 | buildA11yStrings(tree.body, regionStrings, atomType);
426 | buildString(tree.right, "close", regionStrings);
427 | });
428 | break;
429 | }
430 |
431 | case "leftright-right":
432 | {
433 | // TODO: double check that this is a no-op
434 | break;
435 | }
436 |
437 | case "lap":
438 | {
439 | buildA11yStrings(tree.body, a11yStrings, atomType);
440 | break;
441 | }
442 |
443 | case "mathord":
444 | {
445 | buildString(tree.text, "normal", a11yStrings);
446 | break;
447 | }
448 |
449 | case "op":
450 | {
451 | const {
452 | body,
453 | name
454 | } = tree;
455 |
456 | if (body) {
457 | buildA11yStrings(body, a11yStrings, atomType);
458 | } else if (name) {
459 | buildString(name, "normal", a11yStrings);
460 | }
461 |
462 | break;
463 | }
464 |
465 | case "op-token":
466 | {
467 | // Used internally by operator symbols.
468 | buildString(tree.text, atomType, a11yStrings);
469 | break;
470 | }
471 |
472 | case "ordgroup":
473 | {
474 | buildA11yStrings(tree.body, a11yStrings, atomType);
475 | break;
476 | }
477 |
478 | case "overline":
479 | {
480 | buildRegion(a11yStrings, function (a11yStrings) {
481 | a11yStrings.push("start overline");
482 | buildA11yStrings(tree.body, a11yStrings, atomType);
483 | a11yStrings.push("end overline");
484 | });
485 | break;
486 | }
487 |
488 | case "pmb":
489 | {
490 | a11yStrings.push("bold");
491 | break;
492 | }
493 |
494 | case "phantom":
495 | {
496 | a11yStrings.push("empty space");
497 | break;
498 | }
499 |
500 | case "raisebox":
501 | {
502 | buildA11yStrings(tree.body, a11yStrings, atomType);
503 | break;
504 | }
505 |
506 | case "rule":
507 | {
508 | a11yStrings.push("rectangle");
509 | break;
510 | }
511 |
512 | case "sizing":
513 | {
514 | buildA11yStrings(tree.body, a11yStrings, atomType);
515 | break;
516 | }
517 |
518 | case "spacing":
519 | {
520 | a11yStrings.push("space");
521 | break;
522 | }
523 |
524 | case "styling":
525 | {
526 | // We ignore the styling and just pass through the contents
527 | buildA11yStrings(tree.body, a11yStrings, atomType);
528 | break;
529 | }
530 |
531 | case "sqrt":
532 | {
533 | buildRegion(a11yStrings, regionStrings => {
534 | const {
535 | body,
536 | index
537 | } = tree;
538 |
539 | if (index) {
540 | const indexString = flatten(buildA11yStrings(index, [], atomType)).join(",");
541 |
542 | if (indexString === "3") {
543 | regionStrings.push("cube root of");
544 | buildA11yStrings(body, regionStrings, atomType);
545 | regionStrings.push("end cube root");
546 | return;
547 | }
548 |
549 | regionStrings.push("root");
550 | regionStrings.push("start index");
551 | buildA11yStrings(index, regionStrings, atomType);
552 | regionStrings.push("end index");
553 | return;
554 | }
555 |
556 | regionStrings.push("square root of");
557 | buildA11yStrings(body, regionStrings, atomType);
558 | regionStrings.push("end square root");
559 | });
560 | break;
561 | }
562 |
563 | case "supsub":
564 | {
565 | const {
566 | base,
567 | sub,
568 | sup
569 | } = tree;
570 | let isLog = false;
571 |
572 | if (base) {
573 | buildA11yStrings(base, a11yStrings, atomType);
574 | isLog = base.type === "op" && base.name === "\\log";
575 | }
576 |
577 | if (sub) {
578 | const regionName = isLog ? "base" : "subscript";
579 | buildRegion(a11yStrings, function (regionStrings) {
580 | regionStrings.push("start " + regionName);
581 | buildA11yStrings(sub, regionStrings, atomType);
582 | regionStrings.push("end " + regionName);
583 | });
584 | }
585 |
586 | if (sup) {
587 | buildRegion(a11yStrings, function (regionStrings) {
588 | const supString = flatten(buildA11yStrings(sup, [], atomType)).join(",");
589 |
590 | if (supString in powerMap) {
591 | regionStrings.push(powerMap[supString]);
592 | return;
593 | }
594 |
595 | regionStrings.push("start superscript");
596 | buildA11yStrings(sup, regionStrings, atomType);
597 | regionStrings.push("end superscript");
598 | });
599 | }
600 |
601 | break;
602 | }
603 |
604 | case "text":
605 | {
606 | // TODO: handle other fonts
607 | if (tree.font === "\\textbf") {
608 | buildRegion(a11yStrings, function (regionStrings) {
609 | regionStrings.push("start bold text");
610 | buildA11yStrings(tree.body, regionStrings, atomType);
611 | regionStrings.push("end bold text");
612 | });
613 | break;
614 | }
615 |
616 | buildRegion(a11yStrings, function (regionStrings) {
617 | regionStrings.push("start text");
618 | buildA11yStrings(tree.body, regionStrings, atomType);
619 | regionStrings.push("end text");
620 | });
621 | break;
622 | }
623 |
624 | case "textord":
625 | {
626 | buildString(tree.text, atomType, a11yStrings);
627 | break;
628 | }
629 |
630 | case "smash":
631 | {
632 | buildA11yStrings(tree.body, a11yStrings, atomType);
633 | break;
634 | }
635 |
636 | case "enclose":
637 | {
638 | // TODO: create a map for these.
639 | // TODO: differentiate between a body with a single atom, e.g.
640 | // "cancel a" instead of "start cancel, a, end cancel"
641 | if (/cancel/.test(tree.label)) {
642 | buildRegion(a11yStrings, function (regionStrings) {
643 | regionStrings.push("start cancel");
644 | buildA11yStrings(tree.body, regionStrings, atomType);
645 | regionStrings.push("end cancel");
646 | });
647 | break;
648 | } else if (/box/.test(tree.label)) {
649 | buildRegion(a11yStrings, function (regionStrings) {
650 | regionStrings.push("start box");
651 | buildA11yStrings(tree.body, regionStrings, atomType);
652 | regionStrings.push("end box");
653 | });
654 | break;
655 | } else if (/sout/.test(tree.label)) {
656 | buildRegion(a11yStrings, function (regionStrings) {
657 | regionStrings.push("start strikeout");
658 | buildA11yStrings(tree.body, regionStrings, atomType);
659 | regionStrings.push("end strikeout");
660 | });
661 | break;
662 | } else if (/phase/.test(tree.label)) {
663 | buildRegion(a11yStrings, function (regionStrings) {
664 | regionStrings.push("start phase angle");
665 | buildA11yStrings(tree.body, regionStrings, atomType);
666 | regionStrings.push("end phase angle");
667 | });
668 | break;
669 | }
670 |
671 | throw new Error("KaTeX-a11y: enclose node with " + tree.label + " not supported yet");
672 | }
673 |
674 | case "vcenter":
675 | {
676 | buildA11yStrings(tree.body, a11yStrings, atomType);
677 | break;
678 | }
679 |
680 | case "vphantom":
681 | {
682 | throw new Error("KaTeX-a11y: vphantom not implemented yet");
683 | }
684 |
685 | case "hphantom":
686 | {
687 | throw new Error("KaTeX-a11y: hphantom not implemented yet");
688 | }
689 |
690 | case "operatorname":
691 | {
692 | buildA11yStrings(tree.body, a11yStrings, atomType);
693 | break;
694 | }
695 |
696 | case "array":
697 | {
698 | throw new Error("KaTeX-a11y: array not implemented yet");
699 | }
700 |
701 | case "raw":
702 | {
703 | throw new Error("KaTeX-a11y: raw not implemented yet");
704 | }
705 |
706 | case "size":
707 | {
708 | // Although there are nodes of type "size" in the parse tree, they have
709 | // no semantic meaning and should be ignored.
710 | break;
711 | }
712 |
713 | case "url":
714 | {
715 | throw new Error("KaTeX-a11y: url not implemented yet");
716 | }
717 |
718 | case "tag":
719 | {
720 | throw new Error("KaTeX-a11y: tag not implemented yet");
721 | }
722 |
723 | case "verb":
724 | {
725 | buildString("start verbatim", "normal", a11yStrings);
726 | buildString(tree.body, "normal", a11yStrings);
727 | buildString("end verbatim", "normal", a11yStrings);
728 | break;
729 | }
730 |
731 | case "environment":
732 | {
733 | throw new Error("KaTeX-a11y: environment not implemented yet");
734 | }
735 |
736 | case "horizBrace":
737 | {
738 | buildString("start " + tree.label.slice(1), "normal", a11yStrings);
739 | buildA11yStrings(tree.base, a11yStrings, atomType);
740 | buildString("end " + tree.label.slice(1), "normal", a11yStrings);
741 | break;
742 | }
743 |
744 | case "infix":
745 | {
746 | // All infix nodes are replace with other nodes.
747 | break;
748 | }
749 |
750 | case "includegraphics":
751 | {
752 | throw new Error("KaTeX-a11y: includegraphics not implemented yet");
753 | }
754 |
755 | case "font":
756 | {
757 | // TODO: callout the start/end of specific fonts
758 | // TODO: map \BBb{N} to "the naturals" or something like that
759 | buildA11yStrings(tree.body, a11yStrings, atomType);
760 | break;
761 | }
762 |
763 | case "href":
764 | {
765 | throw new Error("KaTeX-a11y: href not implemented yet");
766 | }
767 |
768 | case "cr":
769 | {
770 | // This is used by environments.
771 | throw new Error("KaTeX-a11y: cr not implemented yet");
772 | }
773 |
774 | case "underline":
775 | {
776 | buildRegion(a11yStrings, function (a11yStrings) {
777 | a11yStrings.push("start underline");
778 | buildA11yStrings(tree.body, a11yStrings, atomType);
779 | a11yStrings.push("end underline");
780 | });
781 | break;
782 | }
783 |
784 | case "xArrow":
785 | {
786 | throw new Error("KaTeX-a11y: xArrow not implemented yet");
787 | }
788 |
789 | case "cdlabel":
790 | {
791 | throw new Error("KaTeX-a11y: cdlabel not implemented yet");
792 | }
793 |
794 | case "cdlabelparent":
795 | {
796 | throw new Error("KaTeX-a11y: cdlabelparent not implemented yet");
797 | }
798 |
799 | case "mclass":
800 | {
801 | // \neq and \ne are macros so we let "htmlmathml" render the mathmal
802 | // side of things and extract the text from that.
803 | const atomType = tree.mclass.slice(1); // $FlowFixMe: drop the leading "m" from the values in mclass
804 |
805 | buildA11yStrings(tree.body, a11yStrings, atomType);
806 | break;
807 | }
808 |
809 | case "mathchoice":
810 | {
811 | // TODO: track which style we're using, e.g. display, text, etc.
812 | // default to text style if even that may not be the correct style
813 | buildA11yStrings(tree.text, a11yStrings, atomType);
814 | break;
815 | }
816 |
817 | case "htmlmathml":
818 | {
819 | buildA11yStrings(tree.mathml, a11yStrings, atomType);
820 | break;
821 | }
822 |
823 | case "middle":
824 | {
825 | buildString(tree.delim, atomType, a11yStrings);
826 | break;
827 | }
828 |
829 | case "internal":
830 | {
831 | // internal nodes are never included in the parse tree
832 | break;
833 | }
834 |
835 | case "html":
836 | {
837 | buildA11yStrings(tree.body, a11yStrings, atomType);
838 | break;
839 | }
840 |
841 | default:
842 | tree.type;
843 | throw new Error("KaTeX a11y un-recognized type: " + tree.type);
844 | }
845 | };
846 |
847 | const buildA11yStrings = function (tree, a11yStrings, atomType) {
848 | if (a11yStrings === void 0) {
849 | a11yStrings = [];
850 | }
851 |
852 | if (tree instanceof Array) {
853 | for (let i = 0; i < tree.length; i++) {
854 | buildA11yStrings(tree[i], a11yStrings, atomType);
855 | }
856 | } else {
857 | handleObject(tree, a11yStrings, atomType);
858 | }
859 |
860 | return a11yStrings;
861 | };
862 |
863 | const flatten = function (array) {
864 | let result = [];
865 | array.forEach(function (item) {
866 | if (item instanceof Array) {
867 | result = result.concat(flatten(item));
868 | } else {
869 | result.push(item);
870 | }
871 | });
872 | return result;
873 | };
874 |
875 | const renderA11yString = function (text, settings) {
876 | const tree = katex__WEBPACK_IMPORTED_MODULE_0___default().__parse(text, settings);
877 |
878 | const a11yStrings = buildA11yStrings(tree, [], "normal");
879 | return flatten(a11yStrings).join(", ");
880 | };
881 |
882 | /* harmony default export */ __webpack_exports__["default"] = (renderA11yString);
883 | __webpack_exports__ = __webpack_exports__["default"];
884 | /******/ return __webpack_exports__;
885 | /******/ })()
886 | ;
887 | });
--------------------------------------------------------------------------------
/assets/katex/contrib/mhchem.min.js:
--------------------------------------------------------------------------------
1 | !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],e);else{var n="object"==typeof exports?e(require("katex")):e(t.katex);for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}("undefined"!=typeof self?self:this,(function(t){return function(){"use strict";var e={757:function(e){e.exports=t}},n={};function o(t){var a=n[t];if(void 0!==a)return a.exports;var r=n[t]={exports:{}};return e[t](r,r.exports,o),r.exports}o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,{a:e}),e},o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var a={},r=o(757),i=o.n(r);i().__defineMacro("\\ce",(function(t){return c(t.consumeArgs(1)[0],"ce")})),i().__defineMacro("\\pu",(function(t){return c(t.consumeArgs(1)[0],"pu")})),i().__defineMacro("\\tripledash","{\\vphantom{-}\\raisebox{2.56mu}{$\\mkern2mu\\tiny\\text{-}\\mkern1mu\\text{-}\\mkern1mu\\text{-}\\mkern2mu$}}");var c=function(t,e){for(var n="",o=t.length&&t[t.length-1].loc.start,a=t.length-1;a>=0;a--)t[a].loc.start>o&&(n+=" ",o=t[a].loc.start),n+=t[a].text,o+=t[a].text.length;return p.go(u.go(n,e))},u={go:function(t,e){if(!t)return[];void 0===e&&(e="ce");var n,o="0",a={};a.parenthesisLevel=0,t=(t=(t=t.replace(/\n/g," ")).replace(/[\u2212\u2013\u2014\u2010]/g,"-")).replace(/[\u2026]/g,"...");for(var r=10,i=[];;){n!==t?(r=10,n=t):r--;var c=u.stateMachines[e],p=c.transitions[o]||c.transitions["*"];t:for(var s=0;s0))return i;if(d.revisit||(t=_.remainder),!d.toContinue)break t}}if(r<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(t,e){if(e)if(Array.isArray(e))for(var n=0;n":/^[=<>]/,"#":/^[#\u2261]/,"+":/^\+/,"-$":/^-(?=[\s_},;\]/]|$|\([a-z]+\))/,"-9":/^-(?=[0-9])/,"- orbital overlap":/^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,"-":/^-/,"pm-operator":/^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,operator:/^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,arrowUpDown:/^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,"\\bond{(...)}":function(t){return u.patterns.findObserveGroups(t,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(t){return u.patterns.findObserveGroups(t,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(t){return u.patterns.findObserveGroups(t,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(t){return u.patterns.findObserveGroups(t,"",/^\\[a-zA-Z]+\{/,"}","")},"\\ca":/^\\ca(?:\s+|(?![a-zA-Z]))/,"\\x":/^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,orbital:/^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,others:/^[\/~|]/,"\\frac{(...)}":function(t){return u.patterns.findObserveGroups(t,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(t){return u.patterns.findObserveGroups(t,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(t){return u.patterns.findObserveGroups(t,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(t){return u.patterns.findObserveGroups(t,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(t){return u.patterns.findObserveGroups(t,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(t){return u.patterns.findObserveGroups(t,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(t){return u.patterns.findObserveGroups(t,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(t){return u.patterns.findObserveGroups(t,"\\ce{","","","}")},oxidation$:/^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"d-oxidation$":/^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"roman numeral":/^[IVX]+/,"1/2$":/^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,amount:function(t){var e;if(e=t.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/))return{match_:e[0],remainder:t.substr(e[0].length)};var n=u.patterns.findObserveGroups(t,"","$","$","");return n&&(e=n.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/))?{match_:e[0],remainder:t.substr(e[0].length)}:null},amount2:function(t){return this.amount(t)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(t){if(t.match(/^\([a-z]+\)$/))return null;var e=t.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return e?{match_:e[0],remainder:t.substr(e[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(t,e,n,o,a,r,i,c,u,p){var s=function(t,e){if("string"==typeof e)return 0!==t.indexOf(e)?null:e;var n=t.match(e);return n?n[0]:null},_=s(t,e);if(null===_)return null;if(t=t.substr(_.length),null===(_=s(t,n)))return null;var d=function(t,e,n){for(var o=0;e":{"0|1|2|3":{action_:"r=",nextState:"r"},"a|as":{action_:["output","r="],nextState:"r"},"*":{action_:["output","r="],nextState:"r"}},"+":{o:{action_:"d= kv",nextState:"d"},"d|D":{action_:"d=",nextState:"d"},q:{action_:"d=",nextState:"qd"},"qd|qD":{action_:"d=",nextState:"qd"},dq:{action_:["output","d="],nextState:"d"},3:{action_:["sb=false","output","operator"],nextState:"0"}},amount:{"0|2":{action_:"a=",nextState:"a"}},"pm-operator":{"0|1|2|a|as":{action_:["sb=false","output",{type_:"operator",option:"\\pm"}],nextState:"0"}},operator:{"0|1|2|a|as":{action_:["sb=false","output","operator"],nextState:"0"}},"-$":{"o|q":{action_:["charge or bond","output"],nextState:"qd"},d:{action_:"d=",nextState:"d"},D:{action_:["output",{type_:"bond",option:"-"}],nextState:"3"},q:{action_:"d=",nextState:"qd"},qd:{action_:"d=",nextState:"qd"},"qD|dq":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},"-9":{"3|o":{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"3"}},"- orbital overlap":{o:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},d:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"}},"-":{"0|1|2":{action_:[{type_:"output",option:1},"beginsWithBond=true",{type_:"bond",option:"-"}],nextState:"3"},3:{action_:{type_:"bond",option:"-"}},a:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},as:{action_:[{type_:"output",option:2},{type_:"bond",option:"-"}],nextState:"3"},b:{action_:"b="},o:{action_:{type_:"- after o/d",option:!1},nextState:"2"},q:{action_:{type_:"- after o/d",option:!1},nextState:"2"},"d|qd|dq":{action_:{type_:"- after o/d",option:!0},nextState:"2"},"D|qD|p":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},amount2:{"1|3":{action_:"a=",nextState:"a"}},letters:{"0|1|2|3|a|as|b|p|bp|o":{action_:"o=",nextState:"o"},"q|dq":{action_:["output","o="],nextState:"o"},"d|D|qd|qD":{action_:"o after d",nextState:"o"}},digits:{o:{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},q:{action_:["output","o="],nextState:"o"},a:{action_:"o=",nextState:"o"}},"space A":{"b|p|bp":{}},space:{a:{nextState:"as"},0:{action_:"sb=false"},"1|2":{action_:"sb=true"},"r|rt|rd|rdt|rdq":{action_:"output",nextState:"0"},"*":{action_:["output","sb=true"],nextState:"1"}},"1st-level escape":{"1|2":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}]},"*":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}],nextState:"0"}},"[(...)]":{"r|rt":{action_:"rd=",nextState:"rd"},"rd|rdt":{action_:"rq=",nextState:"rdq"}},"...":{"o|d|D|dq|qd|qD":{action_:["output",{type_:"bond",option:"..."}],nextState:"3"},"*":{action_:[{type_:"output",option:1},{type_:"insert",option:"ellipsis"}],nextState:"1"}},". |* ":{"*":{action_:["output",{type_:"insert",option:"addition compound"}],nextState:"1"}},"state of aggregation $":{"*":{action_:["output","state of aggregation"],nextState:"1"}},"{[(":{"a|as|o":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"0|1|2|3":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"*":{action_:["output","o=","output","parenthesisLevel++"],nextState:"2"}},")]}":{"0|1|2|3|b|p|bp|o":{action_:["o=","parenthesisLevel--"],nextState:"o"},"a|as|d|D|q|qd|qD|dq":{action_:["output","o=","parenthesisLevel--"],nextState:"o"}},", ":{"*":{action_:["output","comma"],nextState:"0"}},"^_":{"*":{}},"^{(...)}|^($...$)":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"D"},q:{action_:"d=",nextState:"qD"},"d|D|qd|qD|dq":{action_:["output","d="],nextState:"D"}},"^a|^\\x{}{}|^\\x{}|^\\x|'":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"d"},q:{action_:"d=",nextState:"qd"},"d|qd|D|qD":{action_:"d="},dq:{action_:["output","d="],nextState:"d"}},"_{(state of aggregation)}$":{"d|D|q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x":{"0|1|2|as":{action_:"p=",nextState:"p"},b:{action_:"p=",nextState:"bp"},"3|o":{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},"q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"=<>":{"0|1|2|3|a|as|o|q|d|D|qd|qD|dq":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"#":{"0|1|2|3|a|as|o":{action_:[{type_:"output",option:2},{type_:"bond",option:"#"}],nextState:"3"}},"{}":{"*":{action_:{type_:"output",option:1},nextState:"1"}},"{...}":{"0|1|2|3|a|as|b|p|bp":{action_:"o=",nextState:"o"},"o|d|D|q|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"$...$":{a:{action_:"a="},"0|1|2|3|as|b|p|bp|o":{action_:"o=",nextState:"o"},"as|o":{action_:"o="},"q|d|D|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"\\bond{(...)}":{"*":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"\\frac{(...)}":{"*":{action_:[{type_:"output",option:1},"frac-output"],nextState:"3"}},"\\overset{(...)}":{"*":{action_:[{type_:"output",option:2},"overset-output"],nextState:"3"}},"\\underset{(...)}":{"*":{action_:[{type_:"output",option:2},"underset-output"],nextState:"3"}},"\\underbrace{(...)}":{"*":{action_:[{type_:"output",option:2},"underbrace-output"],nextState:"3"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:[{type_:"output",option:2},"color-output"],nextState:"3"}},"\\color{(...)}0":{"*":{action_:[{type_:"output",option:2},"color0-output"]}},"\\ce{(...)}":{"*":{action_:[{type_:"output",option:2},"ce"],nextState:"3"}},"\\,":{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"1"}},"\\x{}{}|\\x{}|\\x":{"0|1|2|3|a|as|b|p|bp|o|c0":{action_:["o=","output"],nextState:"3"},"*":{action_:["output","o=","output"],nextState:"3"}},others:{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"3"}},else2:{a:{action_:"a to o",nextState:"o",revisit:!0},as:{action_:["output","sb=true"],nextState:"1",revisit:!0},"r|rt|rd|rdt|rdq":{action_:["output"],nextState:"0",revisit:!0},"*":{action_:["output","copy"],nextState:"3"}}}),actions:{"o after d":function(t,e){var n;if((t.d||"").match(/^[0-9]+$/)){var o=t.d;t.d=void 0,n=this.output(t),t.b=o}else n=this.output(t);return u.actions["o="](t,e),n},"d= kv":function(t,e){t.d=e,t.dType="kv"},"charge or bond":function(t,e){if(t.beginsWithBond){var n=[];return u.concatArray(n,this.output(t)),u.concatArray(n,u.actions.bond(t,e,"-")),n}t.d=e},"- after o/d":function(t,e,n){var o=u.patterns.match_("orbital",t.o||""),a=u.patterns.match_("one lowercase greek letter $",t.o||""),r=u.patterns.match_("one lowercase latin letter $",t.o||""),i=u.patterns.match_("$one lowercase latin letter$ $",t.o||""),c="-"===e&&(o&&""===o.remainder||a||r||i);!c||t.a||t.b||t.p||t.d||t.q||o||!r||(t.o="$"+t.o+"$");var p=[];return c?(u.concatArray(p,this.output(t)),p.push({type_:"hyphen"})):(o=u.patterns.match_("digits",t.d||""),n&&o&&""===o.remainder?(u.concatArray(p,u.actions["d="](t,e)),u.concatArray(p,this.output(t))):(u.concatArray(p,this.output(t)),u.concatArray(p,u.actions.bond(t,e,"-")))),p},"a to o":function(t){t.o=t.a,t.a=void 0},"sb=true":function(t){t.sb=!0},"sb=false":function(t){t.sb=!1},"beginsWithBond=true":function(t){t.beginsWithBond=!0},"beginsWithBond=false":function(t){t.beginsWithBond=!1},"parenthesisLevel++":function(t){t.parenthesisLevel++},"parenthesisLevel--":function(t){t.parenthesisLevel--},"state of aggregation":function(t,e){return{type_:"state of aggregation",p1:u.go(e,"o")}},comma:function(t,e){var n=e.replace(/\s*$/,"");return n!==e&&0===t.parenthesisLevel?{type_:"comma enumeration L",p1:n}:{type_:"comma enumeration M",p1:n}},output:function(t,e,n){var o,a,r;t.r?(a="M"===t.rdt?u.go(t.rd,"tex-math"):"T"===t.rdt?[{type_:"text",p1:t.rd||""}]:u.go(t.rd),r="M"===t.rqt?u.go(t.rq,"tex-math"):"T"===t.rqt?[{type_:"text",p1:t.rq||""}]:u.go(t.rq),o={type_:"arrow",r:t.r,rd:a,rq:r}):(o=[],(t.a||t.b||t.p||t.o||t.q||t.d||n)&&(t.sb&&o.push({type_:"entitySkip"}),t.o||t.q||t.d||t.b||t.p||2===n?t.o||t.q||t.d||!t.b&&!t.p?t.o&&"kv"===t.dType&&u.patterns.match_("d-oxidation$",t.d||"")?t.dType="oxidation":t.o&&"kv"===t.dType&&!t.q&&(t.dType=void 0):(t.o=t.a,t.d=t.b,t.q=t.p,t.a=t.b=t.p=void 0):(t.o=t.a,t.a=void 0),o.push({type_:"chemfive",a:u.go(t.a,"a"),b:u.go(t.b,"bd"),p:u.go(t.p,"pq"),o:u.go(t.o,"o"),q:u.go(t.q,"pq"),d:u.go(t.d,"oxidation"===t.dType?"oxidation":"bd"),dType:t.dType})));for(var i in t)"parenthesisLevel"!==i&&"beginsWithBond"!==i&&delete t[i];return o},"oxidation-output":function(t,e){var n=["{"];return u.concatArray(n,u.go(e,"oxidation")),n.push("}"),n},"frac-output":function(t,e){return{type_:"frac-ce",p1:u.go(e[0]),p2:u.go(e[1])}},"overset-output":function(t,e){return{type_:"overset",p1:u.go(e[0]),p2:u.go(e[1])}},"underset-output":function(t,e){return{type_:"underset",p1:u.go(e[0]),p2:u.go(e[1])}},"underbrace-output":function(t,e){return{type_:"underbrace",p1:u.go(e[0]),p2:u.go(e[1])}},"color-output":function(t,e){return{type_:"color",color1:e[0],color2:u.go(e[1])}},"r=":function(t,e){t.r=e},"rdt=":function(t,e){t.rdt=e},"rd=":function(t,e){t.rd=e},"rqt=":function(t,e){t.rqt=e},"rq=":function(t,e){t.rq=e},operator:function(t,e,n){return{type_:"operator",kind_:n||e}}}},a:{transitions:u.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},"$(...)$":{"*":{action_:"tex-math tight",nextState:"1"}},",":{"*":{action_:{type_:"insert",option:"commaDecimal"}}},else2:{"*":{action_:"copy"}}}),actions:{}},o:{transitions:u.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},letters:{"*":{action_:"rm"}},"\\ca":{"*":{action_:{type_:"insert",option:"circa"}}},"\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"{text}"}},else2:{"*":{action_:"copy"}}}),actions:{}},text:{transitions:u.createTransitions({empty:{"*":{action_:"output"}},"{...}":{"*":{action_:"text="}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"\\greek":{"*":{action_:["output","rm"]}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:["output","copy"]}},else:{"*":{action_:"text="}}}),actions:{output:function(t){if(t.text_){var e={type_:"text",p1:t.text_};for(var n in t)delete t[n];return e}}}},pq:{transitions:u.createTransitions({empty:{"*":{}},"state of aggregation $":{"*":{action_:"state of aggregation"}},i$:{0:{nextState:"!f",revisit:!0}},"(KV letters),":{0:{action_:"rm",nextState:"0"}},formula$:{0:{nextState:"f",revisit:!0}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"!f",revisit:!0}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"a-z":{f:{action_:"tex-math"}},letters:{"*":{action_:"rm"}},"-9.,9":{"*":{action_:"9,9"}},",":{"*":{action_:{type_:"insert+p1",option:"comma enumeration S"}}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"state of aggregation":function(t,e){return{type_:"state of aggregation subscript",p1:u.go(e,"o")}},"color-output":function(t,e){return{type_:"color",color1:e[0],color2:u.go(e[1],"pq")}}}},bd:{transitions:u.createTransitions({empty:{"*":{}},x$:{0:{nextState:"!f",revisit:!0}},formula$:{0:{nextState:"f",revisit:!0}},else:{0:{nextState:"!f",revisit:!0}},"-9.,9 no missing 0":{"*":{action_:"9,9"}},".":{"*":{action_:{type_:"insert",option:"electron dot"}}},"a-z":{f:{action_:"tex-math"}},x:{"*":{action_:{type_:"insert",option:"KV x"}}},letters:{"*":{action_:"rm"}},"'":{"*":{action_:{type_:"insert",option:"prime"}}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"color-output":function(t,e){return{type_:"color",color1:e[0],color2:u.go(e[1],"bd")}}}},oxidation:{transitions:u.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(t,e){return{type_:"roman numeral",p1:e||""}}}},"tex-math":{transitions:u.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(t){if(t.o){var e={type_:"tex-math",p1:t.o};for(var n in t)delete t[n];return e}}}},"tex-math tight":{transitions:u.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(t,e){t.o=(t.o||"")+"{"+e+"}"},output:function(t){if(t.o){var e={type_:"tex-math",p1:t.o};for(var n in t)delete t[n];return e}}}},"9,9":{transitions:u.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:u.createTransitions({empty:{"*":{action_:"output"}},space$:{"*":{action_:["output","space"]}},"{[(|)]}":{"0|a":{action_:"copy"}},"(-)(9)^(-9)":{0:{action_:"number^",nextState:"a"}},"(-)(9.,9)(e)(99)":{0:{action_:"enumber",nextState:"a"}},space:{"0|a":{}},"pm-operator":{"0|a":{action_:{type_:"operator",option:"\\pm"},nextState:"0"}},operator:{"0|a":{action_:"copy",nextState:"0"}},"//":{d:{action_:"o=",nextState:"/"}},"/":{d:{action_:"o=",nextState:"/"}},"{...}|else":{"0|d":{action_:"d=",nextState:"d"},a:{action_:["space","d="],nextState:"d"},"/|q":{action_:"q=",nextState:"q"}}}),actions:{enumber:function(t,e){var n=[];return"+-"===e[0]||"+/-"===e[0]?n.push("\\pm "):e[0]&&n.push(e[0]),e[1]&&(u.concatArray(n,u.go(e[1],"pu-9,9")),e[2]&&(e[2].match(/[,.]/)?u.concatArray(n,u.go(e[2],"pu-9,9")):n.push(e[2])),e[3]=e[4]||e[3],e[3]&&(e[3]=e[3].trim(),"e"===e[3]||"*"===e[3].substr(0,1)?n.push({type_:"cdot"}):n.push({type_:"times"}))),e[3]&&n.push("10^{"+e[5]+"}"),n},"number^":function(t,e){var n=[];return"+-"===e[0]||"+/-"===e[0]?n.push("\\pm "):e[0]&&n.push(e[0]),u.concatArray(n,u.go(e[1],"pu-9,9")),n.push("^{"+e[2]+"}"),n},operator:function(t,e,n){return{type_:"operator",kind_:n||e}},space:function(){return{type_:"pu-space-1"}},output:function(t){var e,n=u.patterns.match_("{(...)}",t.d||"");n&&""===n.remainder&&(t.d=n.match_);var o=u.patterns.match_("{(...)}",t.q||"");if(o&&""===o.remainder&&(t.q=o.match_),t.d&&(t.d=t.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),t.d=t.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),t.q){t.q=t.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),t.q=t.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F");var a={d:u.go(t.d,"pu"),q:u.go(t.q,"pu")};"//"===t.o?e={type_:"pu-frac",p1:a.d,p2:a.q}:(e=a.d,a.d.length>1||a.q.length>1?e.push({type_:" / "}):e.push({type_:"/"}),u.concatArray(e,a.q))}else e=u.go(t.d,"pu-2");for(var r in t)delete t[r];return e}}},"pu-2":{transitions:u.createTransitions({empty:{"*":{action_:"output"}},"*":{"*":{action_:["output","cdot"],nextState:"0"}},"\\x":{"*":{action_:"rm="}},space:{"*":{action_:["output","space"],nextState:"0"}},"^{(...)}|^(-1)":{1:{action_:"^(-1)"}},"-9.,9":{0:{action_:"rm=",nextState:"0"},1:{action_:"^(-1)",nextState:"0"}},"{...}|else":{"*":{action_:"rm=",nextState:"1"}}}),actions:{cdot:function(){return{type_:"tight cdot"}},"^(-1)":function(t,e){t.rm+="^{"+e+"}"},space:function(){return{type_:"pu-space-2"}},output:function(t){var e=[];if(t.rm){var n=u.patterns.match_("{(...)}",t.rm||"");e=n&&""===n.remainder?u.go(n.match_,"pu"):{type_:"rm",p1:t.rm}}for(var o in t)delete t[o];return e}}},"pu-9,9":{transitions:u.createTransitions({empty:{0:{action_:"output-0"},o:{action_:"output-o"}},",":{0:{action_:["output-0","comma"],nextState:"o"}},".":{0:{action_:["output-0","copy"],nextState:"o"}},else:{"*":{action_:"text="}}}),actions:{comma:function(){return{type_:"commaDecimal"}},"output-0":function(t){var e=[];if(t.text_=t.text_||"",t.text_.length>4){var n=t.text_.length%3;0===n&&(n=3);for(var o=t.text_.length-3;o>0;o-=3)e.push(t.text_.substr(o,3)),e.push({type_:"1000 separator"});e.push(t.text_.substr(0,n)),e.reverse()}else e.push(t.text_);for(var a in t)delete t[a];return e},"output-o":function(t){var e=[];if(t.text_=t.text_||"",t.text_.length>4){for(var n=t.text_.length-3,o=0;o":case"\u2192":case"\u27f6":return"rightarrow";case"<-":return"leftarrow";case"<->":return"leftrightarrow";case"<--\x3e":return"rightleftarrows";case"<=>":case"\u21cc":return"rightleftharpoons";case"<=>>":return"rightequilibrium";case"<<=>":return"leftequilibrium";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getBond:function(t){switch(t){case"-":case"1":return"{-}";case"=":case"2":return"{=}";case"#":case"3":return"{\\equiv}";case"~":return"{\\tripledash}";case"~-":return"{\\mathrlap{\\raisebox{-.1em}{$-$}}\\raisebox{.1em}{$\\tripledash$}}";case"~=":case"~--":return"{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$\\tripledash$}}-}";case"-~-":return"{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$-$}}\\tripledash}";case"...":return"{{\\cdot}{\\cdot}{\\cdot}}";case"....":return"{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";case"->":return"{\\rightarrow}";case"<-":return"{\\leftarrow}";case"<":return"{<}";case">":return"{>}";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getOperator:function(t){switch(t){case"+":return" {}+{} ";case"-":return" {}-{} ";case"=":return" {}={} ";case"<":return" {}<{} ";case">":return" {}>{} ";case"<<":return" {}\\ll{} ";case">>":return" {}\\gg{} ";case"\\pm":return" {}\\pm{} ";case"\\approx":case"$\\approx$":return" {}\\approx{} ";case"v":case"(v)":return" \\downarrow{} ";case"^":case"(^)":return" \\uparrow{} ";default:throw["MhchemBugT","mhchem bug T. Please report."]}}};return a=a.default}()}));
--------------------------------------------------------------------------------