diff --git a/dist/markdown-it-math.js b/dist/markdown-it-math.js index 8d86f76..0ba7e92 100644 --- a/dist/markdown-it-math.js +++ b/dist/markdown-it-math.js @@ -1,5 +1,5 @@ -/*! markdown-it-math 4.1.0 https://github.com/runarberg/markdown-it-math @license MIT */ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.markdownitMath = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o element"); } + if (options.display && options.display.toLowerCase() !== "inline") { throw new Error("Can't display block without root element."); } + if (options.dir && options.dir.toLowerCase() !== "ltr") { throw new Error("Can't have right-to-left direction without root element."); } } - var parse = (0, _libParser2["default"])(options); - var out = undefined; - + var parse = (0, _parser.default)(options); + var out; var math = options.bare ? function (expr) { return expr; } : function (expr) { - return "" + expr + ""; + return "").concat(expr, ""); }; if (options.annotate) { // Make sure the all presentational part is the first element var parsed = parse(asciimath.trim(), ""), - mathml = parsed === _libParser2["default"].getlastel(parsed) ? parsed : "" + parsed + ""; - + mathml = parsed === _parser.default.getlastel(parsed) ? parsed : "".concat(parsed, ""); out = math("" + mathml + '' + asciimath + "" + ""); } else { out = math(parse(asciimath.trim(), "")); @@ -125,35 +124,38 @@ function ascii2mathml(asciimath, options) { return out; } -exports["default"] = ascii2mathml; -module.exports = exports["default"]; - -},{"./lib/parser":4,"babel/polyfill":8}],3:[function(require,module,exports){ -// Numbers -// ======= +var _default = ascii2mathml; +exports.default = _default; +},{"./lib/parser":4}],3:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.accents = exports.fonts = exports.groupings = exports.operators = exports.identifiers = exports.numbers = void 0; // Numbers +// ======= + var numbers = {}; -var digitRange = "[0-9²³¹¼-¾" + "٠-٩۰-۹߀-߉" + "०-९০-৯৴-৹" + "੦-੯૦-૯୦-୯୲-୷௦-௲" + "౦-౯౸-౾೦-೯൦-൵๐-๙" + "໐-໙༠-༳၀-၉႐-႙፩-፼" + "ᛮ-ᛰ០-៩៰-៹᠐-᠙" + "᥆-᥏᧐-᧚᪀-᪉᪐-᪙" + "᭐-᭙᮰-᮹᱀-᱉᱐-᱙" + "⁰⁴-⁹₀-₉⅐-ↂↅ-↋" + "①-⒛⓪-⓿❶-➓⳽" + "〇〡-〩〸-〺㆒-㆕" + "㈠-㈩㉈-㉏㉑-㉟㊀-㊉㊱-㊿" + "零一二三四五六七八九十百千万億兆京垓𥝱秭穣溝澗正載割分厘毛糸忽微繊沙塵埃" + "꘠-꘩ꛦ-ꛯ꠰-꠵" + "꣐-꣙꤀-꤉꧐-꧙" + "꩐-꩙꯰-꯹0-9]"; +exports.numbers = numbers; +var digitRange = "[\u0030-\u0039\u00B2\u00B3\u00B9\u00BC-\u00BE" + "\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9" + "\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9" + "\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2" + "\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D66-\u0D75\u0E50-\u0E59" + "\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C" + "\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819" + "\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99" + "\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59" + "\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u218B" + "\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD" + "\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195" + "\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF" + "零一二三四五六七八九十百千万億兆京垓𥝱秭穣溝澗正載割分厘毛糸忽微繊沙塵埃" + "\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835" + "\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9" + "\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]"; var digitRE = new RegExp(digitRange); - Object.defineProperties(numbers, { - digitRange: { value: digitRange }, - digitRE: { value: digitRE }, - isdigit: { value: function value(char) { + digitRange: { + value: digitRange + }, + digitRE: { + value: digitRE + }, + isdigit: { + value: function value(char) { return char.match(digitRE); - } } -}); - -// Identifiers + } + } +}); // Identifiers // =========== var funs = ["sin", "cos", "tan", "csc", "sec", "cot", "sinh", "cosh", "tanh", "log", "ln", "det", "dim", "lim", "mod", "gcd", "lcm", "min", "max"]; - var identifiers = { // Greek uppercase Gamma: "Γ", @@ -166,7 +168,6 @@ var identifiers = { Phi: "Φ", Psi: "Ψ", Omega: "Ω", - // Greek lowercase alpha: "α", beta: "β", @@ -191,11 +192,9 @@ var identifiers = { chi: "χ", psi: "ψ", omega: "ω", - // Special symbols "oo": "∞", "O/": "∅", - // Blackboard CC: "ℂ", NN: "ℕ", @@ -203,28 +202,23 @@ var identifiers = { RR: "ℝ", ZZ: "ℤ" }; - +exports.identifiers = identifiers; funs.forEach(function (fun) { identifiers[fun] = fun; }); - Object.defineProperty(identifiers, "contains", { value: function value(char) { return typeof identifiers[char] !== "undefined"; } }); - Object.defineProperty(identifiers, "funs", { value: funs }); - Object.defineProperty(identifiers, "isfun", { value: function value(str) { return funs.indexOf(str) >= 0; } -}); - -// Operators +}); // Operators // ========= var operators = { @@ -241,6 +235,9 @@ var operators = { "''''": "⁗", "xx": "×", "-:": "÷", + "|><": "⋉", + "><|": "⋊", + "|><|": "⋈", "@": "∘", "o+": "⊕", "ox": "⊗", @@ -256,7 +253,6 @@ var operators = { "nnn": "⋂", "uu": "∪", "uuu": "⋃", - // Miscellaneous "int": "∫", "oint": "∮", @@ -272,7 +268,6 @@ var operators = { "__|": "⌋", "|~": "⌈", "~|": "⌉", - // Relational "=": "=", "!=": "≠", @@ -281,7 +276,9 @@ var operators = { "<=": "≤", ">=": "≥", "-<": "≺", + "-<=": "⪯", ">-": "≻", + ">-=": "⪰", "in": "∈", "!in": "∉", "sub": "⊂", @@ -290,15 +287,18 @@ var operators = { "supe": "⊇", "-=": "≡", "==": "≡", + "~=": "≅", "~~": "≈", "prop": "∝", - // Arrows "<-": "←", "->": "→", "=>": "⇒", "<=>": "⇔", "|->": "↦", + ">->": "↣", + "->>": "↠", + ">->>": "⤖", "uarr": "↑", "darr": "↓", "larr": "←", @@ -308,7 +308,6 @@ var operators = { "rArr": "⇒", "hArr": "⇔", "iff": "⇔", - // Punctuations ",": ",", ":.": "∴", @@ -316,7 +315,6 @@ var operators = { "cdots": "⋯", "ddots": "⋱", "vdots": "⋮", - // Logical "if": "if", "otherwise": "otherwise", @@ -330,63 +328,89 @@ var operators = { "|--": "⊢", "|==": "⊨" }; - +exports.operators = operators; Object.defineProperty(operators, "contains", { value: function value(char) { return typeof operators[char] !== "undefined"; } }); - Object.defineProperty(operators, "get", { value: function value(char) { return operators[char] || char; } }); - Object.defineProperty(operators, "regexp", { value: new RegExp("(" + Object.keys(operators).sort(function (a, b) { return b.length - a.length; - }).map(regexpEscape).join("|") + "|[+-<=>|~¬±×÷ϐϑϒϕϰϱϴϵ϶؆؇؈‖′″‴⁀⁄⁒⁡-⁤" + "⁺-⁾₊-₎★☆♠♡♢♣♭♮♯﬩。-ィ" + "+<=>\^|~¬←↑→↓" + "∀-⋿⨀-⫿⟀-⟥⦀-⦂" + "⦙-⧿⌁-⏿■-◿⬀-⯿" + "←-⇿⟰-⟿⤀-⥿⃐-⃯]" + ")") + }).map(regexpEscape).join("|") + "|[+\-<=>|~¬±×÷ϐϑϒϕϰϱϴϵ϶؆؇؈‖′″‴⁀⁄⁒\u2061-\u2064" + "\u207A-\u207E\u208A-\u208E★☆♠♡♢♣♭♮♯﬩\uFF61-\uFF68" + "+<=>\^|~¬←↑→↓" + "\u2200-\u22FF\u2A00-\u2AFF\u27C0-\u27E5\u2980-\u2982" + "\u2999-\u29FF\u2301-\u23FF\u25A0-\u25FF\u2B00-\u2BFF" + "\u2190-\u21FF\u27F0-\u27FF\u2900-\u297F\u20D0-\u20EF]" + ")") }); function regexpEscape(str) { return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); -} - -// Groupings +} // Groupings // ========= + var groupings = { - open: { "(:": "⟨", "{:": "" }, - close: { ":)": "⟩", ":}": "" } + open: { + "(:": "⟨", + "{:": "" + }, + close: { + ":)": "⟩", + ":}": "" + }, + complex: { + abs: { + open: "|", + close: "|" + }, + floor: { + open: "⌊", + close: "⌋" + }, + ceil: { + open: "⌈", + close: "⌉" + }, + norm: { + open: "∥", + close: "∥" + } + } }; - +exports.groupings = groupings; Object.defineProperty(groupings.open, "regexp", { value: /([[⟦⟨⟪⟬⟮⦃⦅⦇⦉⦋⦍⦏⦑⦓⦕⦗]|[({]:?)/ }); - Object.defineProperty(groupings.close, "regexp", { value: /([\]⟧⟩⟫⟭⟯⦄⦆⦈⦊⦌⦎⦐⦒⦔⦖⦘]|:?[)}])/ }); - Object.defineProperty(groupings.open, "get", { value: function value(str) { var match = groupings.open[str]; return typeof match === "string" ? match : str; } }); - Object.defineProperty(groupings.close, "get", { value: function value(str) { var match = groupings.close[str]; return typeof match === "string" ? match : str; } }); - +Object.defineProperty(groupings.complex, "contains", { + value: function value(str) { + return Object.keys(groupings.complex).indexOf(str) >= 0; + } +}); +Object.defineProperty(groupings.complex, "get", { + value: function value(str) { + return groupings.complex[str]; + } +}); Object.freeze(groupings.open); Object.freeze(groupings.close); - -// Font +Object.freeze(groupings.complex); // Font // ==== var fonts = { @@ -399,95 +423,123 @@ var fonts = { fr: "fraktur", sf: "sans-serif" }; - +exports.fonts = fonts; Object.defineProperty(fonts, "get", { value: function value(str) { return fonts[str]; } }); - Object.defineProperty(fonts, "regexp", { value: new RegExp("(" + Object.keys(fonts).join("|") + ")") -}); - -// Accents +}); // Accents // ======= var accents = { - hat: "^", - bar: "‾", - ul: "_", - vec: "→", - dot: "⋅", - ddot: "⋅⋅", - tilde: "˜" + hat: { + type: "over", + accent: "^" + }, + bar: { + type: "over", + accent: "‾" + }, + ul: { + type: "under", + accent: "_" + }, + vec: { + type: "over", + accent: "→" + }, + dot: { + type: "over", + accent: "⋅" + }, + ddot: { + type: "over", + accent: "⋅⋅" + }, + tilde: { + type: "over", + accent: "˜" + }, + cancel: { + type: "enclose", + attrs: { + notation: "updiagonalstrike" + } + } }; - +exports.accents = accents; Object.defineProperty(accents, "contains", { value: function value(str) { return Object.keys(accents).indexOf(str) >= 0; } }); - Object.defineProperty(accents, "get", { value: function value(str) { return accents[str]; } }); - Object.defineProperty(accents, "regexp", { value: new RegExp("(" + Object.keys(accents).join("|") + ")") }); -exports.numbers = numbers; -exports.identifiers = identifiers; -exports.operators = operators; -exports.groupings = groupings; -exports.fonts = fonts; -exports.accents = accents; - },{}],4:[function(require,module,exports){ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = void 0; -var _slicedToArray = (function () { - function sliceIterator(arr, i) { - var _arr = [];var _n = true;var _d = false;var _e = undefined;try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value);if (i && _arr.length === i) break; - } - } catch (err) { - _d = true;_e = err; - } finally { - try { - if (!_n && _i["return"]) _i["return"](); - } finally { - if (_d) throw _e; - } - }return _arr; - }return function (arr, i) { - if (Array.isArray(arr)) { - return arr; - } else if (Symbol.iterator in Object(arr)) { - return sliceIterator(arr, i); - } else { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); - } - }; -})(); +var _syntax = _interopRequireDefault(require("./syntax")); + +var _lexicon = require("./lexicon"); function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { "default": obj }; + return obj && obj.__esModule ? obj : { + default: obj + }; } -var _syntax = require("./syntax"); +function _slicedToArray(arr, i) { + return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); +} -var _syntax2 = _interopRequireDefault(_syntax); +function _nonIterableRest() { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); +} -var _lexicon = require("./lexicon"); +function _iterableToArrayLimit(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"] != null) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; +} + +function _arrayWithHoles(arr) { + if (Array.isArray(arr)) return arr; +} function tag(tagname) { return function fn(content, attr) { @@ -499,14 +551,12 @@ function tag(tagname) { } if (typeof attr !== "object") { - return "<" + tagname + ">" + content + ""; + return "<".concat(tagname, ">").concat(content, ""); } else { - var attrstr = Object.keys(attr).map(function (key) { - return key + "=\"" + attr[key] + "\""; + return "".concat(key, "=\"").concat(attr[key], "\""); }).join(" "); - - return "<" + tagname + " " + attrstr + ">" + content + ""; + return "<".concat(tagname, " ").concat(attrstr, ">").concat(content, ""); } }; } @@ -521,6 +571,7 @@ var mi = tag("mi"), munder = tag("munder"), mover = tag("mover"), munderover = tag("munderover"), + menclose = tag("menclose"), mrow = tag("mrow"), msqrt = tag("msqrt"), mroot = tag("mroot"), @@ -530,9 +581,8 @@ var mi = tag("mi"), mtd = tag("mtd"); function parser(options) { - var decimalMarkRE = options.decimalMark === "." ? "\\." : options.decimalMark, - numberRegexp = new RegExp("^" + _lexicon.numbers.digitRange + "+(" + decimalMarkRE + _lexicon.numbers.digitRange + "+)?"), + numberRegexp = new RegExp("^".concat(_lexicon.numbers.digitRange, "+(").concat(decimalMarkRE).concat(_lexicon.numbers.digitRange, "+)?")), colsplit = splitby(options.colSep), rowsplit = splitby(options.rowSep), newlinesplit = splitby("\n"); @@ -546,6 +596,7 @@ function parser(options) { for (var i = 0; i < str.length; i += 1) { var rest = str.slice(i), char = str[i]; + if (rest.startsWith(sep) && !str.slice(0, i).match(/\\(\\{2})*$/)) { if (inners === 0) { split.push(str.slice(index, i)); @@ -559,88 +610,52 @@ function parser(options) { } split.push(str.slice(index)); - return split; }; } - var parse = function parse(_x, _x2, _x3, _x4) { - var _again = true; - - _function: while (_again) { - var ascii = _x, - mathml = _x2, - space = _x3, - grouped = _x4; - spaces = spacecount = spaceel = _parseone = _parseone2 = el = rest = _splitNextFraction = _splitNextFraction2 = undefined; - _again = false; - - if (!ascii) { - return mathml; - } - - if (ascii.match(/^\s/)) { - // Dont include the space it if there is a binary infix becoming - // a prefix - if (ascii.match(/^\s+(\/[^\/]|^[^\^]|_[^_|])/)) { - _x = ascii.trim(); - _x2 = mathml; - _x3 = true; - _x4 = undefined; - _again = true; - continue _function; - } + var parse = function parse(ascii, mathml, space, grouped) { + if (!ascii) { + return mathml; + } - // Count the number of leading spaces - var spaces = ascii.match(/^ +/), - spacecount = spaces ? spaces[0].length : 0; + if (ascii.match(/^\s/)) { + // Dont include the space it if there is a binary infix becoming + // a prefix + if (ascii.match(/^\s+(\/[^\/]|^[^\^]|_[^_|])/)) { + return parse(ascii.trim(), mathml, true); + } // Count the number of leading spaces - if (spacecount > 1) { - // spacewidth is a linear function of spacecount - var spaceel = ""; - _x = ascii.trim(); - _x2 = mathml + spaceel; - _x3 = true; - _x4 = undefined; - _again = true; - continue _function; - } + var spaces = ascii.match(/^ +/), + spacecount = spaces ? spaces[0].length : 0; - _x = ascii.trim(); - _x2 = mathml; - _x3 = true; - _x4 = undefined; - _again = true; - continue _function; + if (spacecount > 1) { + // spacewidth is a linear function of spacecount + var spaceel = ""); + return parse(ascii.trim(), mathml + spaceel, true); } - var _parseone = parseone(ascii, grouped); - - var _parseone2 = _slicedToArray(_parseone, 2); - - var el = _parseone2[0]; - var rest = _parseone2[1]; + return parse(ascii.trim(), mathml, true); + } - // ## Binary infixes ## + var _parseone = parseone(ascii, grouped), + _parseone2 = _slicedToArray(_parseone, 2), + el = _parseone2[0], + rest = _parseone2[1]; // ## Binary infixes ## + // ### Fraction ### - // ### Fraction ### - if ((rest && rest.trimLeft().startsWith("/") || rest.trimLeft().startsWith("./")) && !rest.trimLeft().match(/^\.?\/\//)) { - var _splitNextFraction = splitNextFraction(el, rest); - var _splitNextFraction2 = _slicedToArray(_splitNextFraction, 2); + if ((rest && rest.trimLeft().startsWith("/") || rest.trimLeft().startsWith("./")) && !rest.trimLeft().match(/^\.?\/\//)) { + var _splitNextFraction = splitNextFraction(el, rest); - el = _splitNextFraction2[0]; - rest = _splitNextFraction2[1]; - } + var _splitNextFraction2 = _slicedToArray(_splitNextFraction, 2); - _x = rest; - _x2 = mathml + el; - _x3 = false; - _x4 = undefined; - _again = true; - continue _function; + el = _splitNextFraction2[0]; + rest = _splitNextFraction2[1]; } + + return parse(rest, mathml + el, false); }; function parsegroup(ascii) { @@ -648,8 +663,8 @@ function parser(options) { if (ascii.trim().length === 0) { return ""; } - var mathml = parse(ascii, "", false, true); + var mathml = parse(ascii, "", false, true); return mathml === getlastel(mathml) ? mathml : mrow(mathml); } @@ -658,224 +673,234 @@ function parser(options) { Return a split of the first element parsed to MathML and the rest of the string unparsed. */ - // TODO: split this up into smaller more readable code - if (!ascii) { return ["", ""]; } - var el = undefined, - rest = undefined; - + var el, rest; var head = ascii[0], tail = ascii.slice(1), nextsymbol = head + (tail.match(/^[A-Za-z]+/) || ""); if (ascii.startsWith("sqrt")) { // ## Roots ## - var split = parseone(ascii.slice(4).trim(), grouped); - el = msqrt(split[0] ? removeSurroundingBrackets(split[0]) : mrow("")); rest = split[1]; } else if (ascii.startsWith("root")) { - var one = parseone(ascii.slice(4).trimLeft(), grouped), index = one[0] ? removeSurroundingBrackets(one[0]) : mrow(""), two = parseone(one[1].trimLeft(), grouped), base = two[0] ? removeSurroundingBrackets(two[0]) : mrow(""); - el = mroot(base + index); rest = two[1]; } else if (head === "\\" && ascii.length > 1) { // ## Forced opperator ## - if (ascii[1].match(/[(\[]/)) { - var _stop = findmatching(tail); - el = mo(ascii.slice(2, _stop)); - rest = ascii.slice(_stop + 1); + var stop = findmatching(tail); + el = mo(ascii.slice(2, stop)); + rest = ascii.slice(stop + 1); } else { el = mo(ascii[1]); rest = ascii.slice(2); } } else if (_lexicon.accents.contains(nextsymbol)) { - // ## Accents ## - var accent = _lexicon.accents.get(nextsymbol), next = ascii.slice(nextsymbol.length).trimLeft(), - under = accent === "_", - ijmatch = next.match(/^\s*\(?([ij])\)?/); - - if (!under && ijmatch) { - // use non-dotted gyphs as to not clutter - var letter = ijmatch[1]; - - el = mover(mi(letter === "i" ? "ı" : "ȷ") + mo(accent, { accent: true })); - rest = next.slice(ijmatch[0].length); - } else { - var split = parseone(next), - tagfun = under ? munder : mover; - - el = tagfun(removeSurroundingBrackets(split[0]) + mo(accent, !under && { accent: true })); - rest = split[1]; - } - } else if (_syntax2["default"].isfontCommand(ascii)) { - - // ## Font Commands ## - - var split = _syntax2["default"].splitfont(ascii); - - el = tag(split.tagname)(split.text, split.font && { mathvariant: split.font }); - rest = split.rest; - } else if (_syntax2["default"].isgroupStart(ascii) || _syntax2["default"].isvertGroupStart(ascii)) { - (function () { - - // ## Groupings ## - - var _ref = _syntax2["default"].isgroupStart(ascii) ? _syntax2["default"].splitNextGroup(ascii) : _syntax2["default"].splitNextVert(ascii); - - var _ref2 = _slicedToArray(_ref, 5); - - var open = _ref2[1]; - var group = _ref2[2]; - var close = _ref2[3]; - var after = _ref2[4]; - - rest = _lexicon.groupings.open.get(after); - var rows = (function () { - var lines = newlinesplit(group); - return lines.length > 1 ? lines : rowsplit(group); - })(); - - if (_syntax2["default"].ismatrixInterior(group.trim(), options.colSep)) { - - // ### Matrix ## - - if (group.trim().endsWith(options.colSep)) { - // trailing row break - group = group.trimRight().slice(0, -1); + ijmatch = next.match(/^\s*\(?([ij])\)?/), + _split = parseone(next); + + switch (accent.type) { + // ## Accents on top ## + case "over": + if (ijmatch) { + // use non-dotted i and j glyphs as to not clutter + el = mover(mi(ijmatch[1] === "i" ? "ı" : "ȷ") + mo(accent.accent, { + accent: true + })); + rest = next.slice(ijmatch[0].length); + } else { + el = mover(removeSurroundingBrackets(_split[0]) + mo(accent.accent, { + accent: true + })); + rest = _split[1]; } - var cases = open === "{" && close === "", - table = parsetable(group, cases && { columnalign: "center left" }); - - el = mfenced(table, { open: open, close: close }); - } else if (rows.length > 1) { - - // ### Column vector ### - - if (rows.length === 2 && open === "(" && close === ")") { - - // #### Binomial Coefficient #### - - // Experimenting with the binomial coefficient - // Perhaps I'll remove this later - var binom = mfrac(rows.map(parsegroup).join(""), { - linethickness: 0 - }); - - el = mfenced(binom, { open: open, close: close }); - } else { + break; + // ## Accents below ## - // #### Single column vector #### + case "under": + el = munder(removeSurroundingBrackets(_split[0]) + mo(accent.accent)); + rest = _split[1]; + break; + // ## Enclosings - var vector = rows.map(colsplit); + case "enclose": + el = menclose(removeSurroundingBrackets(_split[0]), accent.attrs); + rest = _split[1]; + break; - if (last(vector).length === 1 && last(vector)[0].match(/^\s*$/)) { - // A trailing rowbreak - vector = vector.slice(0, -1); - } + default: + throw new Error("Invalid config for accent " + nextsymbol); + } + } else if (_syntax.default.isfontCommand(ascii)) { + // ## Font Commands ## + var _split2 = _syntax.default.splitfont(ascii); - var matrix = vector.map(function (row) { - return mtr(row.map(compose(mtd, parsegroup)).join("")); - }).join(""); + el = tag(_split2.tagname)(_split2.text, _split2.font && { + mathvariant: _split2.font + }); + rest = _split2.rest; + } else if (_lexicon.groupings.complex.contains(nextsymbol)) { + // ## Complex groupings ## + var grouping = _lexicon.groupings.complex.get(nextsymbol), + _next = ascii.slice(nextsymbol.length).trimLeft(), + _split3 = parseone(_next); + + el = mfenced(removeSurroundingBrackets(_split3[0]), grouping); + rest = _split3[1]; + } else if (_syntax.default.isgroupStart(ascii) || _syntax.default.isvertGroupStart(ascii)) { + // ## Groupings ## + var _ref = _syntax.default.isgroupStart(ascii) ? _syntax.default.splitNextGroup(ascii) : _syntax.default.splitNextVert(ascii), + _ref2 = _slicedToArray(_ref, 5), + open = _ref2[1], + group = _ref2[2], + close = _ref2[3], + after = _ref2[4]; + + rest = _lexicon.groupings.open.get(after); + + var rows = function () { + var lines = newlinesplit(group); + return lines.length > 1 ? lines : rowsplit(group); + }(); + + if (_syntax.default.ismatrixInterior(group.trim(), options.colSep, options.rowSep)) { + // ### Matrix ## + if (group.trim().endsWith(options.colSep)) { + // trailing row break + group = group.trimRight().slice(0, -1); + } - el = mfenced(mtable(matrix), { open: open, close: close }); - } + var cases = open === "{" && close === "", + table = parsetable(group, cases && { + columnalign: "center left" + }); + el = mfenced(table, { + open: open, + close: close + }); + } else if (rows.length > 1) { + // ### Column vector ### + if (rows.length === 2 && open === "(" && close === ")") { + // #### Binomial Coefficient #### + // Experimenting with the binomial coefficient + // Perhaps I'll remove this later + var binom = mfrac(rows.map(parsegroup).join(""), { + linethickness: 0 + }); + el = mfenced(binom, { + open: open, + close: close + }); } else { + // #### Single column vector #### + var vector = rows.map(colsplit); - // ### A fenced group ### + if (last(vector).length === 1 && last(vector)[0].match(/^\s*$/)) { + // A trailing rowbreak + vector = vector.slice(0, -1); + } - var cols = colsplit(group), - els = cols.map(parsegroup).join(""), - attrs = { open: open, close: close }; + var matrix = vector.map(function (row) { + return mtr(row.map(compose(mtd, parsegroup)).join("")); + }).join(""); + el = mfenced(mtable(matrix), { + open: open, + close: close + }); + } + } else { + // ### A fenced group ### + var cols = colsplit(group), + els = cols.map(parsegroup).join(""), + attrs = { + open: open, + close: close + }; - if (options.colSep !== ",") { - attrs.separators = options.colSep; - } - el = mfenced(els, attrs); + if (options.colSep !== ",") { + attrs.separators = options.colSep; } - })(); - } else if (!grouped && _syntax2["default"].isgroupable(ascii, options)) { + el = mfenced(els, attrs); + } + } else if (!grouped && _syntax.default.isgroupable(ascii, options)) { // ## Whitespace ## - // treat whitespace separated subexpressions as a group - var split = splitNextWhitespace(ascii); + var _split4 = splitNextWhitespace(ascii); - el = parsegroup(split[0]); - rest = split[1]; + el = parsegroup(_split4[0]); + rest = _split4[1]; } else if (_lexicon.numbers.isdigit(head)) { - // ## Number ## - var number = ascii.match(numberRegexp)[0]; - el = mn(number); rest = tail.slice(number.length - 1); } else if (ascii.match(/^#`[^`]+`/)) { - // ## Forced number ## - - var number = ascii.match(/^#`([^`]+)`/)[1]; - el = mn(number); - rest = ascii.slice(number.length + 3); + var _number = ascii.match(/^#`([^`]+)`/)[1]; + el = mn(_number); + rest = ascii.slice(_number.length + 3); } else if (ascii.match(new RegExp("^" + _lexicon.operators.regexp.source)) && !_lexicon.identifiers.contains(nextsymbol)) { - // ## Operators ## + var _syntax$splitNextOper = _syntax.default.splitNextOperator(ascii), + _syntax$splitNextOper2 = _slicedToArray(_syntax$splitNextOper, 2), + op = _syntax$splitNextOper2[0], + _next2 = _syntax$splitNextOper2[1], + derivative = ascii.startsWith("'"), + prefix = contains(["∂", "∇"], op), + stretchy = contains(["|"], op), + mid = ascii.startsWith("| "), + attr = {}; - var _syntax$splitNextOperator = _syntax2["default"].splitNextOperator(ascii); - - var _syntax$splitNextOperator2 = _slicedToArray(_syntax$splitNextOperator, 2); - - var op = _syntax$splitNextOperator2[0]; - var next = _syntax$splitNextOperator2[1]; - var derivative = ascii.startsWith("'"); - var prefix = contains(["∂", "∇"], op); - var stretchy = contains(["|"], op); - var mid = ascii.startsWith("| "); - var attr = {}; if (derivative) { - attr.lspace = 0;attr.rspace = 0; + attr.lspace = 0; + attr.rspace = 0; } + if (prefix) { attr.rspace = 0; } + if (stretchy) { attr.stretchy = true; } + if (mid) { attr.lspace = "veryverythickmathspace"; attr.rspace = "veryverythickmathspace"; } el = mo(op, !isempty(attr) && attr); - rest = next; + rest = _next2; } else if (_lexicon.identifiers.contains(nextsymbol)) { - // Perhaps a special identifier character - var ident = _lexicon.identifiers[nextsymbol]; + var ident = _lexicon.identifiers[nextsymbol]; // Uppercase greeks are roman font variant - // Uppercase greeks are roman font variant var uppercase = ident.match(/[\u0391-\u03A9\u2100-\u214F\u2200-\u22FF]/); - el = uppercase ? mi(ident, { mathvariant: "normal" }) : mi(ident); + el = uppercase ? mi(ident, { + mathvariant: "normal" + }) : mi(ident); rest = tail.slice(nextsymbol.length - 1); } else if (head === "O" && tail[0] === "/") { // The special case of the empty set. I suppose there is no // dividing by the latin capital letter O - el = mi(_lexicon.identifiers["O/"], { mathvariant: "normal" }); + el = mi(_lexicon.identifiers["O/"], { + mathvariant: "normal" + }); rest = tail.slice(1); } else { el = mi(head); @@ -883,38 +908,33 @@ function parser(options) { } if (rest && rest.trimLeft().match(/\.?[\^_]/)) { - if ((lastel ? !lastel.match(/m(sup|over)/) : true) && rest.trim().startsWith("_") && (rest.trim().length <= 1 || !rest.trim()[1].match(/[|_]/))) { - var _splitNextSubscript = splitNextSubscript(el, rest); - // ### Subscript ### + var _splitNextSubscript = splitNextSubscript(el, rest); var _splitNextSubscript2 = _slicedToArray(_splitNextSubscript, 2); el = _splitNextSubscript2[0]; rest = _splitNextSubscript2[1]; } else if (lastel !== "mover" && rest.trim().startsWith("._") && (rest.trim().length <= 2 || !rest.trim()[2].match(/[|_]/))) { - var _splitNextUnderscript = splitNextUnderscript(el, rest); - // ### Underscript ### + var _splitNextUnderscript = splitNextUnderscript(el, rest); var _splitNextUnderscript2 = _slicedToArray(_splitNextUnderscript, 2); el = _splitNextUnderscript2[0]; rest = _splitNextUnderscript2[1]; } else if ((lastel ? !lastel.match(/m(sub|under)/) : true) && rest.trim().startsWith("^") && (rest.trim().length <= 1 || rest.trim()[1] !== "^")) { - var _splitNextSuperscript = splitNextSuperscript(el, rest); - // ### Superscript ### + var _splitNextSuperscript = splitNextSuperscript(el, rest); var _splitNextSuperscript2 = _slicedToArray(_splitNextSuperscript, 2); el = _splitNextSuperscript2[0]; rest = _splitNextSuperscript2[1]; } else if (lastel !== "munder" && rest.trim().startsWith(".^") && (rest.trim().length <= 2 || rest.trim()[2] !== "^")) { - var _splitNextOverscript = splitNextOverscript(el, rest); - // ### Overscript ### + var _splitNextOverscript = splitNextOverscript(el, rest); var _splitNextOverscript2 = _slicedToArray(_splitNextOverscript, 2); @@ -929,19 +949,19 @@ function parser(options) { function splitNextSubscript(el, rest) { var next = parseone(rest.trim().slice(1).trim(), true, "msub"), sub = next[0] ? removeSurroundingBrackets(next[0]) : mrow(""); - var ml = undefined, - ascii = next[1]; + var ml, + ascii = next[1]; // ### Supersubscript ### - // ### Supersubscript ### if (ascii && ascii.trim().startsWith("^") && (ascii.trim().length <= 1 || !ascii.trim()[1] !== "^")) { var next2 = parseone(ascii.trim().slice(1).trim(), true), sup = next2[0] ? removeSurroundingBrackets(next2[0]) : mrow(""), - tagfun = _syntax2["default"].shouldGoUnder(el) ? munderover : msubsup; + tagfun = _syntax.default.shouldGoUnder(el) ? munderover : msubsup; ml = tagfun(el + sub + sup); ascii = next2[1]; } else { - var tagfun = _syntax2["default"].shouldGoUnder(el) ? munder : msub; - ml = tagfun(el + sub); + var _tagfun = _syntax.default.shouldGoUnder(el) ? munder : msub; + + ml = _tagfun(el + sub); } return [ml, ascii]; @@ -950,19 +970,19 @@ function parser(options) { function splitNextSuperscript(el, rest) { var next = parseone(rest.trim().slice(1).trim(), true, "msup"), sup = next[0] ? removeSurroundingBrackets(next[0]) : mrow(""); - var ml = undefined, - ascii = next[1]; + var ml, + ascii = next[1]; // ### Super- subscript ### - // ### Super- subscript ### if (ascii.trim().startsWith("_") && (ascii.trim().length <= 1 || !ascii.trim()[1].match(/[|_]/))) { var next2 = parseone(ascii.trim().slice(1).trim(), true), sub = next2[0] ? removeSurroundingBrackets(next2[0]) : mrow(""), - tagfun = _syntax2["default"].shouldGoUnder(el) ? munderover : msubsup; + tagfun = _syntax.default.shouldGoUnder(el) ? munderover : msubsup; ml = tagfun(el + sub + sup); ascii = next2[1]; } else { - var tagfun = _syntax2["default"].shouldGoUnder(el) ? mover : msup; - ml = tagfun(el + sup); + var _tagfun2 = _syntax.default.shouldGoUnder(el) ? mover : msup; + + ml = _tagfun2(el + sup); } return [ml, ascii]; @@ -971,11 +991,11 @@ function parser(options) { function splitNextUnderscript(el, rest) { var next = parseone(rest.trim().slice(2).trim(), true, "munder"), under = next[0] ? removeSurroundingBrackets(next[0]) : mrow(""); - var ml = undefined, - ascii = next[1]; + var ml, + ascii = next[1]; // ### Under- overscript ### - // ### Under- overscript ### var overmatch = ascii.match(/^(\.?\^)[^\^]/); + if (overmatch) { var next2 = parseone(ascii.trim().slice(overmatch[1].length).trim(), true), over = next2[0] ? removeSurroundingBrackets(next2[0]) : mrow(""); @@ -991,11 +1011,11 @@ function parser(options) { function splitNextOverscript(el, rest) { var next = parseone(rest.trim().slice(2).trim(), true, "mover"), over = next[0] ? removeSurroundingBrackets(next[0]) : mrow(""); - var ml = undefined, - ascii = next[1]; + var ml, + ascii = next[1]; // ### Under- overscript ### - // ### Under- overscript ### var undermatch = ascii.match(/^(\.?_)[^_|]/); + if (undermatch) { var next2 = parseone(ascii.trim().slice(undermatch[1].length).trim(), true), under = next2[0] ? removeSurroundingBrackets(next2[0]) : mrow(""); @@ -1008,56 +1028,46 @@ function parser(options) { return [ml, ascii]; } - function splitNextFraction(_x5, _x6) { - var _again2 = true; - - _function2: while (_again2) { - var el = _x5, - rest = _x6; - bevelled = rem = next = ml = ascii = split = _parseone3 = _parseone32 = undefined; - _again2 = false; - - var bevelled = rest.trim().startsWith("./"), - rem = rest.trim().slice(bevelled ? 2 : 1); - var next = undefined, - ml = undefined, - ascii = undefined; - if (rem.startsWith(" ")) { - var split = rem.trim().split(" "); - next = parsegroup(split[0]); - ascii = rem.trimLeft().slice(split[0].length + 1); - } else { - var _parseone3 = parseone(rem); + function splitNextFraction(el, rest) { + var bevelled = rest.trim().startsWith("./"), + rem = rest.trim().slice(bevelled ? 2 : 1); + var next, ml, ascii; - var _parseone32 = _slicedToArray(_parseone3, 2); + if (rem.startsWith(" ")) { + var split = rem.trim().split(" "); + next = parsegroup(split[0]); + ascii = rem.trimLeft().slice(split[0].length + 1); + } else { + var _parseone3 = parseone(rem); - next = _parseone32[0]; - ascii = _parseone32[1]; - } - next = next || mrow(""); - ml = mfrac(removeSurroundingBrackets(el) + removeSurroundingBrackets(next), bevelled && { bevelled: true }); - - if (ascii && ascii.trim().startsWith("/") || ascii.trim().startsWith("./")) { - _x5 = ml; - _x6 = ascii; - _again2 = true; - continue _function2; - } - return [ml, ascii]; + var _parseone4 = _slicedToArray(_parseone3, 2); + + next = _parseone4[0]; + ascii = _parseone4[1]; + } + + next = next || mrow(""); + ml = mfrac(removeSurroundingBrackets(el) + removeSurroundingBrackets(next), bevelled && { + bevelled: true + }); + + if (ascii && ascii.trim().startsWith("/") || ascii.trim().startsWith("./")) { + return splitNextFraction(ml, ascii); } + + return [ml, ascii]; } function splitNextWhitespace(str) { - var re = new RegExp("(\\s|" + options.colSep + "|" + options.rowSep + "|$)"); + var re = new RegExp("(\\s|".concat(options.colSep, "|").concat(options.rowSep, "|$)")); var match = str.match(re), head = str.slice(0, match.index), sep = match[0], tail = str.slice(match.index + 1); - var next = head, rest = sep + tail; - if (!_syntax2["default"].isgroupStart(tail.trim()) && _syntax2["default"].endsInFunc(head)) { + if (!_syntax.default.isgroupStart(tail.trim()) && _syntax.default.endsInFunc(head)) { var newsplit = splitNextWhitespace(tail); next += sep + newsplit[0]; rest = newsplit[1]; @@ -1067,74 +1077,51 @@ function parser(options) { next += sep + split1[0] + " " + split2[0]; rest = sep + split2[1]; } + return [next, rest]; } function parsetable(matrix, attrs) { - var rows = (function () { + var rows = function () { var lines = colsplit(matrix); return lines.length > 1 ? lines : newlinesplit(matrix); - })().map(function (el) { + }().map(function (el) { return el.trim().slice(1, -1); }); return mtable(rows.map(parserow).join(""), attrs); } - function parserow(_x7, _x8) { - var _again3 = true; - - _function3: while (_again3) { - var row = _x7, - acc = _x8; - _parsecell = _parsecell2 = mathml = rest = undefined; - _again3 = false; - - acc = typeof acc === "string" ? acc : ""; - if (!row || row.length === 0) { - return mtr(acc); - } - - var _parsecell = parsecell(row.trim(), ""); - - var _parsecell2 = _slicedToArray(_parsecell, 2); + function parserow(row, acc) { + acc = typeof acc === "string" ? acc : ""; - var mathml = _parsecell2[0]; - var rest = _parsecell2[1]; - _x7 = rest.trim(); - _x8 = acc + mathml; - _again3 = true; - continue _function3; + if (!row || row.length === 0) { + return mtr(acc); } - } - function parsecell(_x9, _x10) { - var _again4 = true; + var _parsecell = parsecell(row.trim(), ""), + _parsecell2 = _slicedToArray(_parsecell, 2), + mathml = _parsecell2[0], + rest = _parsecell2[1]; - _function4: while (_again4) { - var cell = _x9, - acc = _x10; - _parseone4 = _parseone42 = mathml = rest = undefined; - _again4 = false; + return parserow(rest.trim(), acc + mathml); + } - if (!cell || cell.length === 0) { - return [mtd(acc), ""]; - } - if (cell[0] === options.colSep) { - return [mtd(acc), cell.slice(1).trim()]; - } + function parsecell(cell, acc) { + if (!cell || cell.length === 0) { + return [mtd(acc), ""]; + } - var _parseone4 = parseone(cell); + if (cell[0] === options.colSep) { + return [mtd(acc), cell.slice(1).trim()]; + } - var _parseone42 = _slicedToArray(_parseone4, 2); + var _parseone5 = parseone(cell), + _parseone6 = _slicedToArray(_parseone5, 2), + mathml = _parseone6[0], + rest = _parseone6[1]; - var mathml = _parseone42[0]; - var rest = _parseone42[1]; - _x9 = rest.trim(); - _x10 = acc + mathml; - _again4 = true; - continue _function4; - } + return parsecell(rest.trim(), acc + mathml); } return parse; @@ -1146,12 +1133,12 @@ function splitlast(mathml) { */ var lastel = getlastel(mathml), prewels = mathml.slice(0, mathml.lastIndexOf(lastel)); - return [prewels, lastel]; } function removeSurroundingBrackets(mathml) { var inside = mathml.replace(/^]*>/, "").replace(/<\/mfenced>$/, ""); + if (splitlast(inside)[1] === inside) { return inside; } else { @@ -1163,28 +1150,32 @@ function getlastel(xmlstr) { // This breaks the linearity of the implimentation // optimation possible, perhaps an XML parser var tagmatch = xmlstr.match(/<\/(m[a-z]+)>$/); + if (!tagmatch) { var spacematch = xmlstr.match(//); + if (spacematch) { - var _i = spacematch.match[0].length; - return xmlstr.slice(_i); + var _i2 = spacematch.match[0].length; + return xmlstr.slice(_i2); } else { return ""; } } var tagname = tagmatch[1]; - var i = xmlstr.length - (tagname.length + 3), inners = 0; + for (i; i >= 0; i -= 1) { - if (xmlstr.slice(i).startsWith("<" + tagname)) { + if (xmlstr.slice(i).startsWith("<".concat(tagname))) { if (inners === 0) { break; } + inners -= 1; } - if (xmlstr.slice(i - 2).startsWith("= 0; -} - -function last(arr) { - return arr.slice(-1)[0]; -} - -function compose(f, g) { - return function (x) { - return f(g(x)); - }; -} - -parser.getlastel = getlastel; - -exports["default"] = parser; -module.exports = exports["default"]; - -},{"./lexicon":3,"./syntax":5}],5:[function(require,module,exports){ -"use strict"; - -Object.defineProperty(exports, "__esModule", { - value: true -}); - -var _lexicon = require("./lexicon"); - -function splitNextOperator(str) { - var re = new RegExp("^" + _lexicon.operators.regexp.source), - match = re.exec(str), - op = match[0]; - - return [_lexicon.operators.get(op), str.slice(op.length)]; -} - -function isgroupStart(str) { - var re = new RegExp("^" + _lexicon.groupings.open.regexp.source); - return str.match(re); -} - -function isgroupable(str, options) { - var re = new RegExp("^[0-9A-Za-z+\\-!]{2,}(\\s|" + options.colSep + "|" + options.rowSep + ")"); - return str.match(re); -} - -function ismatrixInterior(str, colSep) { - return isgroupStart(str) && (function () { - var rest = splitNextGroup(str)[4]; - return rest.trim().startsWith(colSep) || rest.match(/^\s*\n/) && isgroupStart(rest.trim()); - })(); -} - -var funcEndingRe = new RegExp("(" + _lexicon.identifiers.funs.concat(Object.keys(_lexicon.accents)).concat(["sqrt"]).sort(function (a, b) { - return a.length - b.length; -}).join("|") + ")$"); - -function endsInFunc(str) { - return str.match(funcEndingRe); -} - -function splitNextGroup(str) { - /** Split the string into `[before, open, group, close, after]` */ - - var openRE = new RegExp("^" + _lexicon.groupings.open.regexp.source), - closeRE = new RegExp("^" + _lexicon.groupings.close.regexp.source); - - var start = undefined, - stop = undefined, - open = undefined, - close = undefined, - inners = 0, - i = 0; - - while (i < str.length) { - var rest = str.slice(i), - openMatch = rest.match(openRE), - closeMatch = rest.match(closeRE); - - if (openMatch) { - if (typeof start !== "number") { - start = i; - open = openMatch[0]; - } - inners += 1; - i += openMatch[0].length; - } else if (closeMatch) { - inners -= 1; - if (inners === 0) { - close = closeMatch[0]; - stop = i + (close.length - 1); - break; - } - i += closeMatch[0].length; - } else { - i += 1; - } - } - - if (!open) { - return null; - } - - return [start === 0 ? "" : str.slice(0, start), _lexicon.groupings.open.get(open), str.slice(start + open.length, close ? stop - (close.length - 1) : str.length), close ? _lexicon.groupings.close.get(close) : "", stop ? str.slice(stop + 1) : ""]; -} - -function isvertGroupStart(str) { - if (!str.startsWith("|")) { - return false; - } - var split = splitNextVert(str); - - return split && split[0] === ""; -} - -function splitNextVert(str) { - function retval(start, stop, double) { - return [start === 0 ? "" : str.slice(0, start), double ? "‖" : "|", str.slice(start + (double ? 2 : 1), stop), double ? "‖" : "|", str.slice(stop + (double ? 2 : 1))]; - } - - var start = str.indexOf("|"), - stop = start + 1, - rest = str.slice(start + 1), - double = rest.startsWith("|"), - re = double ? /\|\|/ : /\|/; - - if (double) { - rest = rest.slice(1); - stop += 1; - } - - if (rest.indexOf("|") === -1) { - return null; - } - if (rest.match(/^\.?[_\^]/)) { - return null; - } - - while (rest.length > 0) { - var split = splitNextGroup(rest), - head = split ? split[0] : rest, - tail = split ? split[4] : "", - match = re.exec(head); - - if (match) { - return retval(start, stop + match.index, double); - } - - stop += split.slice(0, -1).map(dot("length")).reduce(plus); - // adjust for slim brackets - if (split[1] === "") { - stop += 2; - } else if (split[1] === "〈") { - stop += 1; - } - if (split[3] === "") { - stop += 2; - } else if (split[3] === "〉") { - stop += 1; - } - - rest = tail; - } - - return null; -} - -function dot(attr) { - return function (obj) { - return obj[attr]; - }; -} - -function plus(a, b) { - return a + b; -} - -// Fonts -// ===== - -function isforcedEl(reEnd) { - var re = new RegExp("^" + _lexicon.fonts.regexp.source + "?" + reEnd); - return function (str) { - return re.exec(str); - }; -} - -var isforcedIdentifier = isforcedEl("(`)\\w+`"); -var isforcedText = isforcedEl('(")'); - -function isfontCommand(str) { - return isforcedIdentifier(str) || isforcedText(str); -} - -function splitfont(ascii) { - var typematch = isforcedIdentifier(ascii) || isforcedText(ascii), - type = typematch && typematch[2], - tagname = type === '"' ? "mtext" : type === "`" ? "mi" : ""; - - var start = ascii.indexOf(type), - stop = start + 1 + ascii.slice(start + 1).indexOf(type), - font = start > 0 ? _lexicon.fonts.get(ascii.slice(0, start)) : ""; - - return { - tagname: tagname, - text: ascii.slice(start + 1, stop), - font: font, - rest: ascii.slice(stop + 1) - }; -} - -var underEls = ["lim", "", ""]; -function shouldGoUnder(el) { - return underEls.indexOf(el) >= 0; -} - -var syntax = { - endsInFunc: endsInFunc, - isgroupStart: isgroupStart, - isgroupable: isgroupable, - isvertGroupStart: isvertGroupStart, - splitNextGroup: splitNextGroup, - splitNextVert: splitNextVert, - splitNextOperator: splitNextOperator, - ismatrixInterior: ismatrixInterior, - isfontCommand: isfontCommand, - splitfont: splitfont, - shouldGoUnder: shouldGoUnder -}; - -exports["default"] = syntax; -module.exports = exports["default"]; - -},{"./lexicon":3}],6:[function(require,module,exports){ -(function (global){ -"use strict"; - -require("core-js/shim"); - -require("regenerator/runtime"); - -if (global._babelPolyfill) { - throw new Error("only one instance of babel/polyfill is allowed"); -} -global._babelPolyfill = true; -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"core-js/shim":195,"regenerator/runtime":197}],7:[function(require,module,exports){ -module.exports = require("./lib/polyfill"); - -},{"./lib/polyfill":6}],8:[function(require,module,exports){ -module.exports = require("babel-core/polyfill"); - -},{"babel-core/polyfill":7}],9:[function(require,module,exports){ -module.exports = function(it){ - if(typeof it != 'function')throw TypeError(it + ' is not a function!'); - return it; -}; -},{}],10:[function(require,module,exports){ -// 22.1.3.31 Array.prototype[@@unscopables] -var UNSCOPABLES = require('./$.wks')('unscopables') - , ArrayProto = Array.prototype; -if(ArrayProto[UNSCOPABLES] == undefined)require('./$.hide')(ArrayProto, UNSCOPABLES, {}); -module.exports = function(key){ - ArrayProto[UNSCOPABLES][key] = true; -}; -},{"./$.hide":38,"./$.wks":90}],11:[function(require,module,exports){ -var isObject = require('./$.is-object'); -module.exports = function(it){ - if(!isObject(it))throw TypeError(it + ' is not an object!'); - return it; -}; -},{"./$.is-object":45}],12:[function(require,module,exports){ -// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) -'use strict'; -var toObject = require('./$.to-object') - , toIndex = require('./$.to-index') - , toLength = require('./$.to-length'); - -module.exports = [].copyWithin || function copyWithin(target/*= 0*/, start/*= 0, end = @length*/){ - var O = toObject(this) - , len = toLength(O.length) - , to = toIndex(target, len) - , from = toIndex(start, len) - , $$ = arguments - , end = $$.length > 2 ? $$[2] : undefined - , count = Math.min((end === undefined ? len : toIndex(end, len)) - from, len - to) - , inc = 1; - if(from < to && to < from + count){ - inc = -1; - from += count - 1; - to += count - 1; - } - while(count-- > 0){ - if(from in O)O[to] = O[from]; - else delete O[to]; - to += inc; - from += inc; - } return O; -}; -},{"./$.to-index":83,"./$.to-length":86,"./$.to-object":87}],13:[function(require,module,exports){ -// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) -'use strict'; -var toObject = require('./$.to-object') - , toIndex = require('./$.to-index') - , toLength = require('./$.to-length'); -module.exports = [].fill || function fill(value /*, start = 0, end = @length */){ - var O = toObject(this) - , length = toLength(O.length) - , $$ = arguments - , $$len = $$.length - , index = toIndex($$len > 1 ? $$[1] : undefined, length) - , end = $$len > 2 ? $$[2] : undefined - , endPos = end === undefined ? length : toIndex(end, length); - while(endPos > index)O[index++] = value; - return O; -}; -},{"./$.to-index":83,"./$.to-length":86,"./$.to-object":87}],14:[function(require,module,exports){ -// false -> Array#indexOf -// true -> Array#includes -var toIObject = require('./$.to-iobject') - , toLength = require('./$.to-length') - , toIndex = require('./$.to-index'); -module.exports = function(IS_INCLUDES){ - return function($this, el, fromIndex){ - var O = toIObject($this) - , length = toLength(O.length) - , index = toIndex(fromIndex, length) - , value; - // Array#includes uses SameValueZero equality algorithm - if(IS_INCLUDES && el != el)while(length > index){ - value = O[index++]; - if(value != value)return true; - // Array#toIndex ignores holes, Array#includes - not - } else for(;length > index; index++)if(IS_INCLUDES || index in O){ - if(O[index] === el)return IS_INCLUDES || index; - } return !IS_INCLUDES && -1; - }; -}; -},{"./$.to-index":83,"./$.to-iobject":85,"./$.to-length":86}],15:[function(require,module,exports){ -// 0 -> Array#forEach -// 1 -> Array#map -// 2 -> Array#filter -// 3 -> Array#some -// 4 -> Array#every -// 5 -> Array#find -// 6 -> Array#findIndex -var ctx = require('./$.ctx') - , IObject = require('./$.iobject') - , toObject = require('./$.to-object') - , toLength = require('./$.to-length') - , asc = require('./$.array-species-create'); -module.exports = function(TYPE){ - var IS_MAP = TYPE == 1 - , IS_FILTER = TYPE == 2 - , IS_SOME = TYPE == 3 - , IS_EVERY = TYPE == 4 - , IS_FIND_INDEX = TYPE == 6 - , NO_HOLES = TYPE == 5 || IS_FIND_INDEX; - return function($this, callbackfn, that){ - var O = toObject($this) - , self = IObject(O) - , f = ctx(callbackfn, that, 3) - , length = toLength(self.length) - , index = 0 - , result = IS_MAP ? asc($this, length) : IS_FILTER ? asc($this, 0) : undefined - , val, res; - for(;length > index; index++)if(NO_HOLES || index in self){ - val = self[index]; - res = f(val, index, O); - if(TYPE){ - if(IS_MAP)result[index] = res; // map - else if(res)switch(TYPE){ - case 3: return true; // some - case 5: return val; // find - case 6: return index; // findIndex - case 2: result.push(val); // filter - } else if(IS_EVERY)return false; // every - } - } - return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; - }; -}; -},{"./$.array-species-create":16,"./$.ctx":24,"./$.iobject":41,"./$.to-length":86,"./$.to-object":87}],16:[function(require,module,exports){ -// 9.4.2.3 ArraySpeciesCreate(originalArray, length) -var isObject = require('./$.is-object') - , isArray = require('./$.is-array') - , SPECIES = require('./$.wks')('species'); -module.exports = function(original, length){ - var C; - if(isArray(original)){ - C = original.constructor; - // cross-realm fallback - if(typeof C == 'function' && (C === Array || isArray(C.prototype)))C = undefined; - if(isObject(C)){ - C = C[SPECIES]; - if(C === null)C = undefined; - } - } return new (C === undefined ? Array : C)(length); -}; -},{"./$.is-array":43,"./$.is-object":45,"./$.wks":90}],17:[function(require,module,exports){ -// getting tag from 19.1.3.6 Object.prototype.toString() -var cof = require('./$.cof') - , TAG = require('./$.wks')('toStringTag') - // ES3 wrong here - , ARG = cof(function(){ return arguments; }()) == 'Arguments'; - -module.exports = function(it){ - var O, T, B; - return it === undefined ? 'Undefined' : it === null ? 'Null' - // @@toStringTag case - : typeof (T = (O = Object(it))[TAG]) == 'string' ? T - // builtinTag case - : ARG ? cof(O) - // ES3 arguments fallback - : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; -}; -},{"./$.cof":18,"./$.wks":90}],18:[function(require,module,exports){ -var toString = {}.toString; - -module.exports = function(it){ - return toString.call(it).slice(8, -1); -}; -},{}],19:[function(require,module,exports){ -'use strict'; -var $ = require('./$') - , hide = require('./$.hide') - , redefineAll = require('./$.redefine-all') - , ctx = require('./$.ctx') - , strictNew = require('./$.strict-new') - , defined = require('./$.defined') - , forOf = require('./$.for-of') - , $iterDefine = require('./$.iter-define') - , step = require('./$.iter-step') - , ID = require('./$.uid')('id') - , $has = require('./$.has') - , isObject = require('./$.is-object') - , setSpecies = require('./$.set-species') - , DESCRIPTORS = require('./$.descriptors') - , isExtensible = Object.isExtensible || isObject - , SIZE = DESCRIPTORS ? '_s' : 'size' - , id = 0; - -var fastKey = function(it, create){ - // return primitive with prefix - if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; - if(!$has(it, ID)){ - // can't set id to frozen object - if(!isExtensible(it))return 'F'; - // not necessary to add id - if(!create)return 'E'; - // add missing object id - hide(it, ID, ++id); - // return object id with prefix - } return 'O' + it[ID]; -}; - -var getEntry = function(that, key){ - // fast case - var index = fastKey(key), entry; - if(index !== 'F')return that._i[index]; - // frozen object case - for(entry = that._f; entry; entry = entry.n){ - if(entry.k == key)return entry; - } -}; - -module.exports = { - getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ - var C = wrapper(function(that, iterable){ - strictNew(that, C, NAME); - that._i = $.create(null); // index - that._f = undefined; // first entry - that._l = undefined; // last entry - that[SIZE] = 0; // size - if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); - }); - redefineAll(C.prototype, { - // 23.1.3.1 Map.prototype.clear() - // 23.2.3.2 Set.prototype.clear() - clear: function clear(){ - for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){ - entry.r = true; - if(entry.p)entry.p = entry.p.n = undefined; - delete data[entry.i]; - } - that._f = that._l = undefined; - that[SIZE] = 0; - }, - // 23.1.3.3 Map.prototype.delete(key) - // 23.2.3.4 Set.prototype.delete(value) - 'delete': function(key){ - var that = this - , entry = getEntry(that, key); - if(entry){ - var next = entry.n - , prev = entry.p; - delete that._i[entry.i]; - entry.r = true; - if(prev)prev.n = next; - if(next)next.p = prev; - if(that._f == entry)that._f = next; - if(that._l == entry)that._l = prev; - that[SIZE]--; - } return !!entry; - }, - // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) - // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) - forEach: function forEach(callbackfn /*, that = undefined */){ - var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3) - , entry; - while(entry = entry ? entry.n : this._f){ - f(entry.v, entry.k, this); - // revert to the last existing entry - while(entry && entry.r)entry = entry.p; - } - }, - // 23.1.3.7 Map.prototype.has(key) - // 23.2.3.7 Set.prototype.has(value) - has: function has(key){ - return !!getEntry(this, key); - } - }); - if(DESCRIPTORS)$.setDesc(C.prototype, 'size', { - get: function(){ - return defined(this[SIZE]); - } - }); - return C; - }, - def: function(that, key, value){ - var entry = getEntry(that, key) - , prev, index; - // change existing entry - if(entry){ - entry.v = value; - // create new entry - } else { - that._l = entry = { - i: index = fastKey(key, true), // <- index - k: key, // <- key - v: value, // <- value - p: prev = that._l, // <- previous entry - n: undefined, // <- next entry - r: false // <- removed - }; - if(!that._f)that._f = entry; - if(prev)prev.n = entry; - that[SIZE]++; - // add to index - if(index !== 'F')that._i[index] = entry; - } return that; - }, - getEntry: getEntry, - setStrong: function(C, NAME, IS_MAP){ - // add .keys, .values, .entries, [@@iterator] - // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 - $iterDefine(C, NAME, function(iterated, kind){ - this._t = iterated; // target - this._k = kind; // kind - this._l = undefined; // previous - }, function(){ - var that = this - , kind = that._k - , entry = that._l; - // revert to the last existing entry - while(entry && entry.r)entry = entry.p; - // get next entry - if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){ - // or finish the iteration - that._t = undefined; - return step(1); - } - // return step by kind - if(kind == 'keys' )return step(0, entry.k); - if(kind == 'values')return step(0, entry.v); - return step(0, [entry.k, entry.v]); - }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true); - - // add [@@species], 23.1.2.2, 23.2.2.2 - setSpecies(NAME); - } -}; -},{"./$":53,"./$.ctx":24,"./$.defined":25,"./$.descriptors":26,"./$.for-of":34,"./$.has":37,"./$.hide":38,"./$.is-object":45,"./$.iter-define":49,"./$.iter-step":51,"./$.redefine-all":67,"./$.set-species":72,"./$.strict-new":76,"./$.uid":89}],20:[function(require,module,exports){ -// https://github.com/DavidBruant/Map-Set.prototype.toJSON -var forOf = require('./$.for-of') - , classof = require('./$.classof'); -module.exports = function(NAME){ - return function toJSON(){ - if(classof(this) != NAME)throw TypeError(NAME + "#toJSON isn't generic"); - var arr = []; - forOf(this, false, arr.push, arr); - return arr; - }; -}; -},{"./$.classof":17,"./$.for-of":34}],21:[function(require,module,exports){ -'use strict'; -var hide = require('./$.hide') - , redefineAll = require('./$.redefine-all') - , anObject = require('./$.an-object') - , isObject = require('./$.is-object') - , strictNew = require('./$.strict-new') - , forOf = require('./$.for-of') - , createArrayMethod = require('./$.array-methods') - , $has = require('./$.has') - , WEAK = require('./$.uid')('weak') - , isExtensible = Object.isExtensible || isObject - , arrayFind = createArrayMethod(5) - , arrayFindIndex = createArrayMethod(6) - , id = 0; - -// fallback for frozen keys -var frozenStore = function(that){ - return that._l || (that._l = new FrozenStore); -}; -var FrozenStore = function(){ - this.a = []; -}; -var findFrozen = function(store, key){ - return arrayFind(store.a, function(it){ - return it[0] === key; - }); -}; -FrozenStore.prototype = { - get: function(key){ - var entry = findFrozen(this, key); - if(entry)return entry[1]; - }, - has: function(key){ - return !!findFrozen(this, key); - }, - set: function(key, value){ - var entry = findFrozen(this, key); - if(entry)entry[1] = value; - else this.a.push([key, value]); - }, - 'delete': function(key){ - var index = arrayFindIndex(this.a, function(it){ - return it[0] === key; - }); - if(~index)this.a.splice(index, 1); - return !!~index; - } -}; - -module.exports = { - getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ - var C = wrapper(function(that, iterable){ - strictNew(that, C, NAME); - that._i = id++; // collection id - that._l = undefined; // leak store for frozen objects - if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); - }); - redefineAll(C.prototype, { - // 23.3.3.2 WeakMap.prototype.delete(key) - // 23.4.3.3 WeakSet.prototype.delete(value) - 'delete': function(key){ - if(!isObject(key))return false; - if(!isExtensible(key))return frozenStore(this)['delete'](key); - return $has(key, WEAK) && $has(key[WEAK], this._i) && delete key[WEAK][this._i]; - }, - // 23.3.3.4 WeakMap.prototype.has(key) - // 23.4.3.4 WeakSet.prototype.has(value) - has: function has(key){ - if(!isObject(key))return false; - if(!isExtensible(key))return frozenStore(this).has(key); - return $has(key, WEAK) && $has(key[WEAK], this._i); - } - }); - return C; - }, - def: function(that, key, value){ - if(!isExtensible(anObject(key))){ - frozenStore(that).set(key, value); - } else { - $has(key, WEAK) || hide(key, WEAK, {}); - key[WEAK][that._i] = value; - } return that; - }, - frozenStore: frozenStore, - WEAK: WEAK -}; -},{"./$.an-object":11,"./$.array-methods":15,"./$.for-of":34,"./$.has":37,"./$.hide":38,"./$.is-object":45,"./$.redefine-all":67,"./$.strict-new":76,"./$.uid":89}],22:[function(require,module,exports){ -'use strict'; -var global = require('./$.global') - , $export = require('./$.export') - , redefine = require('./$.redefine') - , redefineAll = require('./$.redefine-all') - , forOf = require('./$.for-of') - , strictNew = require('./$.strict-new') - , isObject = require('./$.is-object') - , fails = require('./$.fails') - , $iterDetect = require('./$.iter-detect') - , setToStringTag = require('./$.set-to-string-tag'); - -module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){ - var Base = global[NAME] - , C = Base - , ADDER = IS_MAP ? 'set' : 'add' - , proto = C && C.prototype - , O = {}; - var fixMethod = function(KEY){ - var fn = proto[KEY]; - redefine(proto, KEY, - KEY == 'delete' ? function(a){ - return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); - } : KEY == 'has' ? function has(a){ - return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); - } : KEY == 'get' ? function get(a){ - return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); - } : KEY == 'add' ? function add(a){ fn.call(this, a === 0 ? 0 : a); return this; } - : function set(a, b){ fn.call(this, a === 0 ? 0 : a, b); return this; } - ); - }; - if(typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){ - new C().entries().next(); - }))){ - // create collection constructor - C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); - redefineAll(C.prototype, methods); - } else { - var instance = new C - // early implementations not supports chaining - , HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance - // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false - , THROWS_ON_PRIMITIVES = fails(function(){ instance.has(1); }) - // most early implementations doesn't supports iterables, most modern - not close it correctly - , ACCEPT_ITERABLES = $iterDetect(function(iter){ new C(iter); }) // eslint-disable-line no-new - // for early implementations -0 and +0 not the same - , BUGGY_ZERO; - if(!ACCEPT_ITERABLES){ - C = wrapper(function(target, iterable){ - strictNew(target, C, NAME); - var that = new Base; - if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); - return that; - }); - C.prototype = proto; - proto.constructor = C; - } - IS_WEAK || instance.forEach(function(val, key){ - BUGGY_ZERO = 1 / key === -Infinity; - }); - if(THROWS_ON_PRIMITIVES || BUGGY_ZERO){ - fixMethod('delete'); - fixMethod('has'); - IS_MAP && fixMethod('get'); - } - if(BUGGY_ZERO || HASNT_CHAINING)fixMethod(ADDER); - // weak collections should not contains .clear method - if(IS_WEAK && proto.clear)delete proto.clear; - } - - setToStringTag(C, NAME); - - O[NAME] = C; - $export($export.G + $export.W + $export.F * (C != Base), O); - - if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP); - - return C; -}; -},{"./$.export":29,"./$.fails":31,"./$.for-of":34,"./$.global":36,"./$.is-object":45,"./$.iter-detect":50,"./$.redefine":68,"./$.redefine-all":67,"./$.set-to-string-tag":73,"./$.strict-new":76}],23:[function(require,module,exports){ -var core = module.exports = {version: '1.2.6'}; -if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef -},{}],24:[function(require,module,exports){ -// optional / simple context binding -var aFunction = require('./$.a-function'); -module.exports = function(fn, that, length){ - aFunction(fn); - if(that === undefined)return fn; - switch(length){ - case 1: return function(a){ - return fn.call(that, a); - }; - case 2: return function(a, b){ - return fn.call(that, a, b); - }; - case 3: return function(a, b, c){ - return fn.call(that, a, b, c); - }; - } - return function(/* ...args */){ - return fn.apply(that, arguments); - }; -}; -},{"./$.a-function":9}],25:[function(require,module,exports){ -// 7.2.1 RequireObjectCoercible(argument) -module.exports = function(it){ - if(it == undefined)throw TypeError("Can't call method on " + it); - return it; -}; -},{}],26:[function(require,module,exports){ -// Thank's IE8 for his funny defineProperty -module.exports = !require('./$.fails')(function(){ - return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; -}); -},{"./$.fails":31}],27:[function(require,module,exports){ -var isObject = require('./$.is-object') - , document = require('./$.global').document - // in old IE typeof document.createElement is 'object' - , is = isObject(document) && isObject(document.createElement); -module.exports = function(it){ - return is ? document.createElement(it) : {}; -}; -},{"./$.global":36,"./$.is-object":45}],28:[function(require,module,exports){ -// all enumerable object keys, includes symbols -var $ = require('./$'); -module.exports = function(it){ - var keys = $.getKeys(it) - , getSymbols = $.getSymbols; - if(getSymbols){ - var symbols = getSymbols(it) - , isEnum = $.isEnum - , i = 0 - , key; - while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))keys.push(key); - } - return keys; -}; -},{"./$":53}],29:[function(require,module,exports){ -var global = require('./$.global') - , core = require('./$.core') - , hide = require('./$.hide') - , redefine = require('./$.redefine') - , ctx = require('./$.ctx') - , PROTOTYPE = 'prototype'; - -var $export = function(type, name, source){ - var IS_FORCED = type & $export.F - , IS_GLOBAL = type & $export.G - , IS_STATIC = type & $export.S - , IS_PROTO = type & $export.P - , IS_BIND = type & $export.B - , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE] - , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) - , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}) - , key, own, out, exp; - if(IS_GLOBAL)source = name; - for(key in source){ - // contains in native - own = !IS_FORCED && target && key in target; - // export native or passed - out = (own ? target : source)[key]; - // bind timers to global for call from export context - exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; - // extend global - if(target && !own)redefine(target, key, out); - // export - if(exports[key] != out)hide(exports, key, exp); - if(IS_PROTO && expProto[key] != out)expProto[key] = out; - } -}; -global.core = core; -// type bitmap -$export.F = 1; // forced -$export.G = 2; // global -$export.S = 4; // static -$export.P = 8; // proto -$export.B = 16; // bind -$export.W = 32; // wrap -module.exports = $export; -},{"./$.core":23,"./$.ctx":24,"./$.global":36,"./$.hide":38,"./$.redefine":68}],30:[function(require,module,exports){ -var MATCH = require('./$.wks')('match'); -module.exports = function(KEY){ - var re = /./; - try { - '/./'[KEY](re); - } catch(e){ - try { - re[MATCH] = false; - return !'/./'[KEY](re); - } catch(f){ /* empty */ } - } return true; -}; -},{"./$.wks":90}],31:[function(require,module,exports){ -module.exports = function(exec){ - try { - return !!exec(); - } catch(e){ - return true; - } -}; -},{}],32:[function(require,module,exports){ -'use strict'; -var hide = require('./$.hide') - , redefine = require('./$.redefine') - , fails = require('./$.fails') - , defined = require('./$.defined') - , wks = require('./$.wks'); - -module.exports = function(KEY, length, exec){ - var SYMBOL = wks(KEY) - , original = ''[KEY]; - if(fails(function(){ - var O = {}; - O[SYMBOL] = function(){ return 7; }; - return ''[KEY](O) != 7; - })){ - redefine(String.prototype, KEY, exec(defined, SYMBOL, original)); - hide(RegExp.prototype, SYMBOL, length == 2 - // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) - // 21.2.5.11 RegExp.prototype[@@split](string, limit) - ? function(string, arg){ return original.call(string, this, arg); } - // 21.2.5.6 RegExp.prototype[@@match](string) - // 21.2.5.9 RegExp.prototype[@@search](string) - : function(string){ return original.call(string, this); } - ); - } -}; -},{"./$.defined":25,"./$.fails":31,"./$.hide":38,"./$.redefine":68,"./$.wks":90}],33:[function(require,module,exports){ -'use strict'; -// 21.2.5.3 get RegExp.prototype.flags -var anObject = require('./$.an-object'); -module.exports = function(){ - var that = anObject(this) - , result = ''; - if(that.global) result += 'g'; - if(that.ignoreCase) result += 'i'; - if(that.multiline) result += 'm'; - if(that.unicode) result += 'u'; - if(that.sticky) result += 'y'; - return result; -}; -},{"./$.an-object":11}],34:[function(require,module,exports){ -var ctx = require('./$.ctx') - , call = require('./$.iter-call') - , isArrayIter = require('./$.is-array-iter') - , anObject = require('./$.an-object') - , toLength = require('./$.to-length') - , getIterFn = require('./core.get-iterator-method'); -module.exports = function(iterable, entries, fn, that){ - var iterFn = getIterFn(iterable) - , f = ctx(fn, that, entries ? 2 : 1) - , index = 0 - , length, step, iterator; - if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!'); - // fast case for arrays with default iterator - if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){ - entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); - } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){ - call(iterator, f, step.value, entries); - } -}; -},{"./$.an-object":11,"./$.ctx":24,"./$.is-array-iter":42,"./$.iter-call":47,"./$.to-length":86,"./core.get-iterator-method":91}],35:[function(require,module,exports){ -// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window -var toIObject = require('./$.to-iobject') - , getNames = require('./$').getNames - , toString = {}.toString; - -var windowNames = typeof window == 'object' && Object.getOwnPropertyNames - ? Object.getOwnPropertyNames(window) : []; - -var getWindowNames = function(it){ - try { - return getNames(it); - } catch(e){ - return windowNames.slice(); - } -}; - -module.exports.get = function getOwnPropertyNames(it){ - if(windowNames && toString.call(it) == '[object Window]')return getWindowNames(it); - return getNames(toIObject(it)); -}; -},{"./$":53,"./$.to-iobject":85}],36:[function(require,module,exports){ -// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 -var global = module.exports = typeof window != 'undefined' && window.Math == Math - ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); -if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef -},{}],37:[function(require,module,exports){ -var hasOwnProperty = {}.hasOwnProperty; -module.exports = function(it, key){ - return hasOwnProperty.call(it, key); -}; -},{}],38:[function(require,module,exports){ -var $ = require('./$') - , createDesc = require('./$.property-desc'); -module.exports = require('./$.descriptors') ? function(object, key, value){ - return $.setDesc(object, key, createDesc(1, value)); -} : function(object, key, value){ - object[key] = value; - return object; -}; -},{"./$":53,"./$.descriptors":26,"./$.property-desc":66}],39:[function(require,module,exports){ -module.exports = require('./$.global').document && document.documentElement; -},{"./$.global":36}],40:[function(require,module,exports){ -// fast apply, http://jsperf.lnkit.com/fast-apply/5 -module.exports = function(fn, args, that){ - var un = that === undefined; - switch(args.length){ - case 0: return un ? fn() - : fn.call(that); - case 1: return un ? fn(args[0]) - : fn.call(that, args[0]); - case 2: return un ? fn(args[0], args[1]) - : fn.call(that, args[0], args[1]); - case 3: return un ? fn(args[0], args[1], args[2]) - : fn.call(that, args[0], args[1], args[2]); - case 4: return un ? fn(args[0], args[1], args[2], args[3]) - : fn.call(that, args[0], args[1], args[2], args[3]); - } return fn.apply(that, args); -}; -},{}],41:[function(require,module,exports){ -// fallback for non-array-like ES3 and non-enumerable old V8 strings -var cof = require('./$.cof'); -module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ - return cof(it) == 'String' ? it.split('') : Object(it); -}; -},{"./$.cof":18}],42:[function(require,module,exports){ -// check on default Array iterator -var Iterators = require('./$.iterators') - , ITERATOR = require('./$.wks')('iterator') - , ArrayProto = Array.prototype; - -module.exports = function(it){ - return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); -}; -},{"./$.iterators":52,"./$.wks":90}],43:[function(require,module,exports){ -// 7.2.2 IsArray(argument) -var cof = require('./$.cof'); -module.exports = Array.isArray || function(arg){ - return cof(arg) == 'Array'; -}; -},{"./$.cof":18}],44:[function(require,module,exports){ -// 20.1.2.3 Number.isInteger(number) -var isObject = require('./$.is-object') - , floor = Math.floor; -module.exports = function isInteger(it){ - return !isObject(it) && isFinite(it) && floor(it) === it; -}; -},{"./$.is-object":45}],45:[function(require,module,exports){ -module.exports = function(it){ - return typeof it === 'object' ? it !== null : typeof it === 'function'; -}; -},{}],46:[function(require,module,exports){ -// 7.2.8 IsRegExp(argument) -var isObject = require('./$.is-object') - , cof = require('./$.cof') - , MATCH = require('./$.wks')('match'); -module.exports = function(it){ - var isRegExp; - return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); -}; -},{"./$.cof":18,"./$.is-object":45,"./$.wks":90}],47:[function(require,module,exports){ -// call something on iterator step with safe closing on error -var anObject = require('./$.an-object'); -module.exports = function(iterator, fn, value, entries){ - try { - return entries ? fn(anObject(value)[0], value[1]) : fn(value); - // 7.4.6 IteratorClose(iterator, completion) - } catch(e){ - var ret = iterator['return']; - if(ret !== undefined)anObject(ret.call(iterator)); - throw e; - } -}; -},{"./$.an-object":11}],48:[function(require,module,exports){ -'use strict'; -var $ = require('./$') - , descriptor = require('./$.property-desc') - , setToStringTag = require('./$.set-to-string-tag') - , IteratorPrototype = {}; - -// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() -require('./$.hide')(IteratorPrototype, require('./$.wks')('iterator'), function(){ return this; }); - -module.exports = function(Constructor, NAME, next){ - Constructor.prototype = $.create(IteratorPrototype, {next: descriptor(1, next)}); - setToStringTag(Constructor, NAME + ' Iterator'); -}; -},{"./$":53,"./$.hide":38,"./$.property-desc":66,"./$.set-to-string-tag":73,"./$.wks":90}],49:[function(require,module,exports){ -'use strict'; -var LIBRARY = require('./$.library') - , $export = require('./$.export') - , redefine = require('./$.redefine') - , hide = require('./$.hide') - , has = require('./$.has') - , Iterators = require('./$.iterators') - , $iterCreate = require('./$.iter-create') - , setToStringTag = require('./$.set-to-string-tag') - , getProto = require('./$').getProto - , ITERATOR = require('./$.wks')('iterator') - , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` - , FF_ITERATOR = '@@iterator' - , KEYS = 'keys' - , VALUES = 'values'; - -var returnThis = function(){ return this; }; - -module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){ - $iterCreate(Constructor, NAME, next); - var getMethod = function(kind){ - if(!BUGGY && kind in proto)return proto[kind]; - switch(kind){ - case KEYS: return function keys(){ return new Constructor(this, kind); }; - case VALUES: return function values(){ return new Constructor(this, kind); }; - } return function entries(){ return new Constructor(this, kind); }; - }; - var TAG = NAME + ' Iterator' - , DEF_VALUES = DEFAULT == VALUES - , VALUES_BUG = false - , proto = Base.prototype - , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] - , $default = $native || getMethod(DEFAULT) - , methods, key; - // Fix native - if($native){ - var IteratorPrototype = getProto($default.call(new Base)); - // Set @@toStringTag to native iterators - setToStringTag(IteratorPrototype, TAG, true); - // FF fix - if(!LIBRARY && has(proto, FF_ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis); - // fix Array#{values, @@iterator}.name in V8 / FF - if(DEF_VALUES && $native.name !== VALUES){ - VALUES_BUG = true; - $default = function values(){ return $native.call(this); }; - } - } - // Define iterator - if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){ - hide(proto, ITERATOR, $default); - } - // Plug for library - Iterators[NAME] = $default; - Iterators[TAG] = returnThis; - if(DEFAULT){ - methods = { - values: DEF_VALUES ? $default : getMethod(VALUES), - keys: IS_SET ? $default : getMethod(KEYS), - entries: !DEF_VALUES ? $default : getMethod('entries') - }; - if(FORCED)for(key in methods){ - if(!(key in proto))redefine(proto, key, methods[key]); - } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); - } - return methods; -}; -},{"./$":53,"./$.export":29,"./$.has":37,"./$.hide":38,"./$.iter-create":48,"./$.iterators":52,"./$.library":55,"./$.redefine":68,"./$.set-to-string-tag":73,"./$.wks":90}],50:[function(require,module,exports){ -var ITERATOR = require('./$.wks')('iterator') - , SAFE_CLOSING = false; - -try { - var riter = [7][ITERATOR](); - riter['return'] = function(){ SAFE_CLOSING = true; }; - Array.from(riter, function(){ throw 2; }); -} catch(e){ /* empty */ } - -module.exports = function(exec, skipClosing){ - if(!skipClosing && !SAFE_CLOSING)return false; - var safe = false; - try { - var arr = [7] - , iter = arr[ITERATOR](); - iter.next = function(){ return {done: safe = true}; }; - arr[ITERATOR] = function(){ return iter; }; - exec(arr); - } catch(e){ /* empty */ } - return safe; -}; -},{"./$.wks":90}],51:[function(require,module,exports){ -module.exports = function(done, value){ - return {value: value, done: !!done}; -}; -},{}],52:[function(require,module,exports){ -module.exports = {}; -},{}],53:[function(require,module,exports){ -var $Object = Object; -module.exports = { - create: $Object.create, - getProto: $Object.getPrototypeOf, - isEnum: {}.propertyIsEnumerable, - getDesc: $Object.getOwnPropertyDescriptor, - setDesc: $Object.defineProperty, - setDescs: $Object.defineProperties, - getKeys: $Object.keys, - getNames: $Object.getOwnPropertyNames, - getSymbols: $Object.getOwnPropertySymbols, - each: [].forEach -}; -},{}],54:[function(require,module,exports){ -var $ = require('./$') - , toIObject = require('./$.to-iobject'); -module.exports = function(object, el){ - var O = toIObject(object) - , keys = $.getKeys(O) - , length = keys.length - , index = 0 - , key; - while(length > index)if(O[key = keys[index++]] === el)return key; -}; -},{"./$":53,"./$.to-iobject":85}],55:[function(require,module,exports){ -module.exports = false; -},{}],56:[function(require,module,exports){ -// 20.2.2.14 Math.expm1(x) -module.exports = Math.expm1 || function expm1(x){ - return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; -}; -},{}],57:[function(require,module,exports){ -// 20.2.2.20 Math.log1p(x) -module.exports = Math.log1p || function log1p(x){ - return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); -}; -},{}],58:[function(require,module,exports){ -// 20.2.2.28 Math.sign(x) -module.exports = Math.sign || function sign(x){ - return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; -}; -},{}],59:[function(require,module,exports){ -var global = require('./$.global') - , macrotask = require('./$.task').set - , Observer = global.MutationObserver || global.WebKitMutationObserver - , process = global.process - , Promise = global.Promise - , isNode = require('./$.cof')(process) == 'process' - , head, last, notify; - -var flush = function(){ - var parent, domain, fn; - if(isNode && (parent = process.domain)){ - process.domain = null; - parent.exit(); - } - while(head){ - domain = head.domain; - fn = head.fn; - if(domain)domain.enter(); - fn(); // <- currently we use it only for Promise - try / catch not required - if(domain)domain.exit(); - head = head.next; - } last = undefined; - if(parent)parent.enter(); -}; - -// Node.js -if(isNode){ - notify = function(){ - process.nextTick(flush); - }; -// browsers with MutationObserver -} else if(Observer){ - var toggle = 1 - , node = document.createTextNode(''); - new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new - notify = function(){ - node.data = toggle = -toggle; - }; -// environments with maybe non-completely correct, but existent Promise -} else if(Promise && Promise.resolve){ - notify = function(){ - Promise.resolve().then(flush); - }; -// for other environments - macrotask based on: -// - setImmediate -// - MessageChannel -// - window.postMessag -// - onreadystatechange -// - setTimeout -} else { - notify = function(){ - // strange IE + webpack dev server bug - use .call(global) - macrotask.call(global, flush); - }; -} - -module.exports = function asap(fn){ - var task = {fn: fn, next: undefined, domain: isNode && process.domain}; - if(last)last.next = task; - if(!head){ - head = task; - notify(); - } last = task; -}; -},{"./$.cof":18,"./$.global":36,"./$.task":82}],60:[function(require,module,exports){ -// 19.1.2.1 Object.assign(target, source, ...) -var $ = require('./$') - , toObject = require('./$.to-object') - , IObject = require('./$.iobject'); - -// should work with symbols and should have deterministic property order (V8 bug) -module.exports = require('./$.fails')(function(){ - var a = Object.assign - , A = {} - , B = {} - , S = Symbol() - , K = 'abcdefghijklmnopqrst'; - A[S] = 7; - K.split('').forEach(function(k){ B[k] = k; }); - return a({}, A)[S] != 7 || Object.keys(a({}, B)).join('') != K; -}) ? function assign(target, source){ // eslint-disable-line no-unused-vars - var T = toObject(target) - , $$ = arguments - , $$len = $$.length - , index = 1 - , getKeys = $.getKeys - , getSymbols = $.getSymbols - , isEnum = $.isEnum; - while($$len > index){ - var S = IObject($$[index++]) - , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S) - , length = keys.length - , j = 0 - , key; - while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key]; - } - return T; -} : Object.assign; -},{"./$":53,"./$.fails":31,"./$.iobject":41,"./$.to-object":87}],61:[function(require,module,exports){ -// most Object methods by ES6 should accept primitives -var $export = require('./$.export') - , core = require('./$.core') - , fails = require('./$.fails'); -module.exports = function(KEY, exec){ - var fn = (core.Object || {})[KEY] || Object[KEY] - , exp = {}; - exp[KEY] = exec(fn); - $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp); -}; -},{"./$.core":23,"./$.export":29,"./$.fails":31}],62:[function(require,module,exports){ -var $ = require('./$') - , toIObject = require('./$.to-iobject') - , isEnum = $.isEnum; -module.exports = function(isEntries){ - return function(it){ - var O = toIObject(it) - , keys = $.getKeys(O) - , length = keys.length - , i = 0 - , result = [] - , key; - while(length > i)if(isEnum.call(O, key = keys[i++])){ - result.push(isEntries ? [key, O[key]] : O[key]); - } return result; - }; -}; -},{"./$":53,"./$.to-iobject":85}],63:[function(require,module,exports){ -// all object keys, includes non-enumerable and symbols -var $ = require('./$') - , anObject = require('./$.an-object') - , Reflect = require('./$.global').Reflect; -module.exports = Reflect && Reflect.ownKeys || function ownKeys(it){ - var keys = $.getNames(anObject(it)) - , getSymbols = $.getSymbols; - return getSymbols ? keys.concat(getSymbols(it)) : keys; -}; -},{"./$":53,"./$.an-object":11,"./$.global":36}],64:[function(require,module,exports){ -'use strict'; -var path = require('./$.path') - , invoke = require('./$.invoke') - , aFunction = require('./$.a-function'); -module.exports = function(/* ...pargs */){ - var fn = aFunction(this) - , length = arguments.length - , pargs = Array(length) - , i = 0 - , _ = path._ - , holder = false; - while(length > i)if((pargs[i] = arguments[i++]) === _)holder = true; - return function(/* ...args */){ - var that = this - , $$ = arguments - , $$len = $$.length - , j = 0, k = 0, args; - if(!holder && !$$len)return invoke(fn, pargs, that); - args = pargs.slice(); - if(holder)for(;length > j; j++)if(args[j] === _)args[j] = $$[k++]; - while($$len > k)args.push($$[k++]); - return invoke(fn, args, that); - }; -}; -},{"./$.a-function":9,"./$.invoke":40,"./$.path":65}],65:[function(require,module,exports){ -module.exports = require('./$.global'); -},{"./$.global":36}],66:[function(require,module,exports){ -module.exports = function(bitmap, value){ - return { - enumerable : !(bitmap & 1), - configurable: !(bitmap & 2), - writable : !(bitmap & 4), - value : value - }; -}; -},{}],67:[function(require,module,exports){ -var redefine = require('./$.redefine'); -module.exports = function(target, src){ - for(var key in src)redefine(target, key, src[key]); - return target; -}; -},{"./$.redefine":68}],68:[function(require,module,exports){ -// add fake Function#toString -// for correct work wrapped methods / constructors with methods like LoDash isNative -var global = require('./$.global') - , hide = require('./$.hide') - , SRC = require('./$.uid')('src') - , TO_STRING = 'toString' - , $toString = Function[TO_STRING] - , TPL = ('' + $toString).split(TO_STRING); - -require('./$.core').inspectSource = function(it){ - return $toString.call(it); -}; - -(module.exports = function(O, key, val, safe){ - if(typeof val == 'function'){ - val.hasOwnProperty(SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); - val.hasOwnProperty('name') || hide(val, 'name', key); - } - if(O === global){ - O[key] = val; - } else { - if(!safe)delete O[key]; - hide(O, key, val); - } -})(Function.prototype, TO_STRING, function toString(){ - return typeof this == 'function' && this[SRC] || $toString.call(this); -}); -},{"./$.core":23,"./$.global":36,"./$.hide":38,"./$.uid":89}],69:[function(require,module,exports){ -module.exports = function(regExp, replace){ - var replacer = replace === Object(replace) ? function(part){ - return replace[part]; - } : replace; - return function(it){ - return String(it).replace(regExp, replacer); - }; -}; -},{}],70:[function(require,module,exports){ -// 7.2.9 SameValue(x, y) -module.exports = Object.is || function is(x, y){ - return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; -}; -},{}],71:[function(require,module,exports){ -// Works with __proto__ only. Old v8 can't work with null proto objects. -/* eslint-disable no-proto */ -var getDesc = require('./$').getDesc - , isObject = require('./$.is-object') - , anObject = require('./$.an-object'); -var check = function(O, proto){ - anObject(O); - if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!"); -}; -module.exports = { - set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line - function(test, buggy, set){ - try { - set = require('./$.ctx')(Function.call, getDesc(Object.prototype, '__proto__').set, 2); - set(test, []); - buggy = !(test instanceof Array); - } catch(e){ buggy = true; } - return function setPrototypeOf(O, proto){ - check(O, proto); - if(buggy)O.__proto__ = proto; - else set(O, proto); - return O; - }; - }({}, false) : undefined), - check: check -}; -},{"./$":53,"./$.an-object":11,"./$.ctx":24,"./$.is-object":45}],72:[function(require,module,exports){ -'use strict'; -var global = require('./$.global') - , $ = require('./$') - , DESCRIPTORS = require('./$.descriptors') - , SPECIES = require('./$.wks')('species'); - -module.exports = function(KEY){ - var C = global[KEY]; - if(DESCRIPTORS && C && !C[SPECIES])$.setDesc(C, SPECIES, { - configurable: true, - get: function(){ return this; } - }); -}; -},{"./$":53,"./$.descriptors":26,"./$.global":36,"./$.wks":90}],73:[function(require,module,exports){ -var def = require('./$').setDesc - , has = require('./$.has') - , TAG = require('./$.wks')('toStringTag'); - -module.exports = function(it, tag, stat){ - if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); -}; -},{"./$":53,"./$.has":37,"./$.wks":90}],74:[function(require,module,exports){ -var global = require('./$.global') - , SHARED = '__core-js_shared__' - , store = global[SHARED] || (global[SHARED] = {}); -module.exports = function(key){ - return store[key] || (store[key] = {}); -}; -},{"./$.global":36}],75:[function(require,module,exports){ -// 7.3.20 SpeciesConstructor(O, defaultConstructor) -var anObject = require('./$.an-object') - , aFunction = require('./$.a-function') - , SPECIES = require('./$.wks')('species'); -module.exports = function(O, D){ - var C = anObject(O).constructor, S; - return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); -}; -},{"./$.a-function":9,"./$.an-object":11,"./$.wks":90}],76:[function(require,module,exports){ -module.exports = function(it, Constructor, name){ - if(!(it instanceof Constructor))throw TypeError(name + ": use the 'new' operator!"); - return it; -}; -},{}],77:[function(require,module,exports){ -var toInteger = require('./$.to-integer') - , defined = require('./$.defined'); -// true -> String#at -// false -> String#codePointAt -module.exports = function(TO_STRING){ - return function(that, pos){ - var s = String(defined(that)) - , i = toInteger(pos) - , l = s.length - , a, b; - if(i < 0 || i >= l)return TO_STRING ? '' : undefined; - a = s.charCodeAt(i); - return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff - ? TO_STRING ? s.charAt(i) : a - : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; - }; -}; -},{"./$.defined":25,"./$.to-integer":84}],78:[function(require,module,exports){ -// helper for String#{startsWith, endsWith, includes} -var isRegExp = require('./$.is-regexp') - , defined = require('./$.defined'); - -module.exports = function(that, searchString, NAME){ - if(isRegExp(searchString))throw TypeError('String#' + NAME + " doesn't accept regex!"); - return String(defined(that)); -}; -},{"./$.defined":25,"./$.is-regexp":46}],79:[function(require,module,exports){ -// https://github.com/ljharb/proposal-string-pad-left-right -var toLength = require('./$.to-length') - , repeat = require('./$.string-repeat') - , defined = require('./$.defined'); - -module.exports = function(that, maxLength, fillString, left){ - var S = String(defined(that)) - , stringLength = S.length - , fillStr = fillString === undefined ? ' ' : String(fillString) - , intMaxLength = toLength(maxLength); - if(intMaxLength <= stringLength)return S; - if(fillStr == '')fillStr = ' '; - var fillLen = intMaxLength - stringLength - , stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); - if(stringFiller.length > fillLen)stringFiller = stringFiller.slice(0, fillLen); - return left ? stringFiller + S : S + stringFiller; -}; -},{"./$.defined":25,"./$.string-repeat":80,"./$.to-length":86}],80:[function(require,module,exports){ -'use strict'; -var toInteger = require('./$.to-integer') - , defined = require('./$.defined'); - -module.exports = function repeat(count){ - var str = String(defined(this)) - , res = '' - , n = toInteger(count); - if(n < 0 || n == Infinity)throw RangeError("Count can't be negative"); - for(;n > 0; (n >>>= 1) && (str += str))if(n & 1)res += str; - return res; -}; -},{"./$.defined":25,"./$.to-integer":84}],81:[function(require,module,exports){ -var $export = require('./$.export') - , defined = require('./$.defined') - , fails = require('./$.fails') - , spaces = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + - '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF' - , space = '[' + spaces + ']' - , non = '\u200b\u0085' - , ltrim = RegExp('^' + space + space + '*') - , rtrim = RegExp(space + space + '*$'); - -var exporter = function(KEY, exec){ - var exp = {}; - exp[KEY] = exec(trim); - $export($export.P + $export.F * fails(function(){ - return !!spaces[KEY]() || non[KEY]() != non; - }), 'String', exp); -}; - -// 1 -> String#trimLeft -// 2 -> String#trimRight -// 3 -> String#trim -var trim = exporter.trim = function(string, TYPE){ - string = String(defined(string)); - if(TYPE & 1)string = string.replace(ltrim, ''); - if(TYPE & 2)string = string.replace(rtrim, ''); - return string; -}; - -module.exports = exporter; -},{"./$.defined":25,"./$.export":29,"./$.fails":31}],82:[function(require,module,exports){ -var ctx = require('./$.ctx') - , invoke = require('./$.invoke') - , html = require('./$.html') - , cel = require('./$.dom-create') - , global = require('./$.global') - , process = global.process - , setTask = global.setImmediate - , clearTask = global.clearImmediate - , MessageChannel = global.MessageChannel - , counter = 0 - , queue = {} - , ONREADYSTATECHANGE = 'onreadystatechange' - , defer, channel, port; -var run = function(){ - var id = +this; - if(queue.hasOwnProperty(id)){ - var fn = queue[id]; - delete queue[id]; - fn(); - } -}; -var listner = function(event){ - run.call(event.data); -}; -// Node.js 0.9+ & IE10+ has setImmediate, otherwise: -if(!setTask || !clearTask){ - setTask = function setImmediate(fn){ - var args = [], i = 1; - while(arguments.length > i)args.push(arguments[i++]); - queue[++counter] = function(){ - invoke(typeof fn == 'function' ? fn : Function(fn), args); - }; - defer(counter); - return counter; - }; - clearTask = function clearImmediate(id){ - delete queue[id]; - }; - // Node.js 0.8- - if(require('./$.cof')(process) == 'process'){ - defer = function(id){ - process.nextTick(ctx(run, id, 1)); - }; - // Browsers with MessageChannel, includes WebWorkers - } else if(MessageChannel){ - channel = new MessageChannel; - port = channel.port2; - channel.port1.onmessage = listner; - defer = ctx(port.postMessage, port, 1); - // Browsers with postMessage, skip WebWorkers - // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' - } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){ - defer = function(id){ - global.postMessage(id + '', '*'); - }; - global.addEventListener('message', listner, false); - // IE8- - } else if(ONREADYSTATECHANGE in cel('script')){ - defer = function(id){ - html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){ - html.removeChild(this); - run.call(id); - }; - }; - // Rest old browsers - } else { - defer = function(id){ - setTimeout(ctx(run, id, 1), 0); - }; - } -} -module.exports = { - set: setTask, - clear: clearTask -}; -},{"./$.cof":18,"./$.ctx":24,"./$.dom-create":27,"./$.global":36,"./$.html":39,"./$.invoke":40}],83:[function(require,module,exports){ -var toInteger = require('./$.to-integer') - , max = Math.max - , min = Math.min; -module.exports = function(index, length){ - index = toInteger(index); - return index < 0 ? max(index + length, 0) : min(index, length); -}; -},{"./$.to-integer":84}],84:[function(require,module,exports){ -// 7.1.4 ToInteger -var ceil = Math.ceil - , floor = Math.floor; -module.exports = function(it){ - return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); -}; -},{}],85:[function(require,module,exports){ -// to indexed object, toObject with fallback for non-array-like ES3 strings -var IObject = require('./$.iobject') - , defined = require('./$.defined'); -module.exports = function(it){ - return IObject(defined(it)); -}; -},{"./$.defined":25,"./$.iobject":41}],86:[function(require,module,exports){ -// 7.1.15 ToLength -var toInteger = require('./$.to-integer') - , min = Math.min; -module.exports = function(it){ - return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 -}; -},{"./$.to-integer":84}],87:[function(require,module,exports){ -// 7.1.13 ToObject(argument) -var defined = require('./$.defined'); -module.exports = function(it){ - return Object(defined(it)); -}; -},{"./$.defined":25}],88:[function(require,module,exports){ -// 7.1.1 ToPrimitive(input [, PreferredType]) -var isObject = require('./$.is-object'); -// instead of the ES6 spec version, we didn't implement @@toPrimitive case -// and the second argument - flag - preferred type is a string -module.exports = function(it, S){ - if(!isObject(it))return it; - var fn, val; - if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; - if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val; - if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; - throw TypeError("Can't convert object to primitive value"); -}; -},{"./$.is-object":45}],89:[function(require,module,exports){ -var id = 0 - , px = Math.random(); -module.exports = function(key){ - return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); -}; -},{}],90:[function(require,module,exports){ -var store = require('./$.shared')('wks') - , uid = require('./$.uid') - , Symbol = require('./$.global').Symbol; -module.exports = function(name){ - return store[name] || (store[name] = - Symbol && Symbol[name] || (Symbol || uid)('Symbol.' + name)); -}; -},{"./$.global":36,"./$.shared":74,"./$.uid":89}],91:[function(require,module,exports){ -var classof = require('./$.classof') - , ITERATOR = require('./$.wks')('iterator') - , Iterators = require('./$.iterators'); -module.exports = require('./$.core').getIteratorMethod = function(it){ - if(it != undefined)return it[ITERATOR] - || it['@@iterator'] - || Iterators[classof(it)]; -}; -},{"./$.classof":17,"./$.core":23,"./$.iterators":52,"./$.wks":90}],92:[function(require,module,exports){ -'use strict'; -var $ = require('./$') - , $export = require('./$.export') - , DESCRIPTORS = require('./$.descriptors') - , createDesc = require('./$.property-desc') - , html = require('./$.html') - , cel = require('./$.dom-create') - , has = require('./$.has') - , cof = require('./$.cof') - , invoke = require('./$.invoke') - , fails = require('./$.fails') - , anObject = require('./$.an-object') - , aFunction = require('./$.a-function') - , isObject = require('./$.is-object') - , toObject = require('./$.to-object') - , toIObject = require('./$.to-iobject') - , toInteger = require('./$.to-integer') - , toIndex = require('./$.to-index') - , toLength = require('./$.to-length') - , IObject = require('./$.iobject') - , IE_PROTO = require('./$.uid')('__proto__') - , createArrayMethod = require('./$.array-methods') - , arrayIndexOf = require('./$.array-includes')(false) - , ObjectProto = Object.prototype - , ArrayProto = Array.prototype - , arraySlice = ArrayProto.slice - , arrayJoin = ArrayProto.join - , defineProperty = $.setDesc - , getOwnDescriptor = $.getDesc - , defineProperties = $.setDescs - , factories = {} - , IE8_DOM_DEFINE; - -if(!DESCRIPTORS){ - IE8_DOM_DEFINE = !fails(function(){ - return defineProperty(cel('div'), 'a', {get: function(){ return 7; }}).a != 7; - }); - $.setDesc = function(O, P, Attributes){ - if(IE8_DOM_DEFINE)try { - return defineProperty(O, P, Attributes); - } catch(e){ /* empty */ } - if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); - if('value' in Attributes)anObject(O)[P] = Attributes.value; - return O; - }; - $.getDesc = function(O, P){ - if(IE8_DOM_DEFINE)try { - return getOwnDescriptor(O, P); - } catch(e){ /* empty */ } - if(has(O, P))return createDesc(!ObjectProto.propertyIsEnumerable.call(O, P), O[P]); - }; - $.setDescs = defineProperties = function(O, Properties){ - anObject(O); - var keys = $.getKeys(Properties) - , length = keys.length - , i = 0 - , P; - while(length > i)$.setDesc(O, P = keys[i++], Properties[P]); - return O; - }; -} -$export($export.S + $export.F * !DESCRIPTORS, 'Object', { - // 19.1.2.6 / 15.2.3.3 Object.getOwnPropertyDescriptor(O, P) - getOwnPropertyDescriptor: $.getDesc, - // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) - defineProperty: $.setDesc, - // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) - defineProperties: defineProperties -}); - - // IE 8- don't enum bug keys -var keys1 = ('constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,' + - 'toLocaleString,toString,valueOf').split(',') - // Additional keys for getOwnPropertyNames - , keys2 = keys1.concat('length', 'prototype') - , keysLen1 = keys1.length; - -// Create object with `null` prototype: use iframe Object with cleared prototype -var createDict = function(){ - // Thrash, waste and sodomy: IE GC bug - var iframe = cel('iframe') - , i = keysLen1 - , gt = '>' - , iframeDocument; - iframe.style.display = 'none'; - html.appendChild(iframe); - iframe.src = 'javascript:'; // eslint-disable-line no-script-url - // createDict = iframe.contentWindow.Object; - // html.removeChild(iframe); - iframeDocument = iframe.contentWindow.document; - iframeDocument.open(); - iframeDocument.write('