import { c as createCommonjsModule, g as getCjsExportFromNamespace, a as commonjsGlobal, u as unwrapExports } from './style-inject.es-7ed2769c.js'; import 'react'; import './test-4091af6f.js'; export { C as ConsumeListView, P as PayPlatformOptions, a as PriceOptions, W as WaitPayInfoView } from './index-8e31d90e.js'; import 'antd/es/input/style'; import 'antd/es/input'; import 'antd/es/button/style'; import 'antd/es/button'; /* Copyright (c) 2014, Yahoo! Inc. All rights reserved. Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. */ var extend_1 = extend; var hop = Object.prototype.hasOwnProperty; function extend(obj) { var sources = Array.prototype.slice.call(arguments, 1), i, len, source, key; for (i = 0, len = sources.length; i < len; i += 1) { source = sources[i]; if (!source) { continue; } for (key in source) { if (hop.call(source, key)) { obj[key] = source[key]; } } } return obj; } var hop_1 = hop; var utils = { extend: extend_1, hop: hop_1 }; var es5 = createCommonjsModule(function (module, exports) { // Purposely using the same implementation as the Intl.js `Intl` polyfill. // Copyright 2013 Andy Earnshaw, MIT License var realDefineProp = (function () { try { return !!Object.defineProperty({}, 'a', {}); } catch (e) { return false; } })(); var defineProperty = realDefineProp ? Object.defineProperty : function (obj, name, desc) { if ('get' in desc && obj.__defineGetter__) { obj.__defineGetter__(name, desc.get); } else if (!utils.hop.call(obj, name) || 'value' in desc) { obj[name] = desc.value; } }; var objCreate = Object.create || function (proto, props) { var obj, k; function F() {} F.prototype = proto; obj = new F(); for (k in props) { if (utils.hop.call(props, k)) { defineProperty(obj, k, props[k]); } } return obj; }; exports.defineProperty = defineProperty, exports.objCreate = objCreate; }); var es5_1 = es5.defineProperty; var es5_2 = es5.objCreate; var compiler = createCommonjsModule(function (module, exports) { exports["default"] = Compiler; function Compiler(locales, formats, pluralFn) { this.locales = locales; this.formats = formats; this.pluralFn = pluralFn; } Compiler.prototype.compile = function (ast) { this.pluralStack = []; this.currentPlural = null; this.pluralNumberFormat = null; return this.compileMessage(ast); }; Compiler.prototype.compileMessage = function (ast) { if (!(ast && ast.type === 'messageFormatPattern')) { throw new Error('Message AST is not of type: "messageFormatPattern"'); } var elements = ast.elements, pattern = []; var i, len, element; for (i = 0, len = elements.length; i < len; i += 1) { element = elements[i]; switch (element.type) { case 'messageTextElement': pattern.push(this.compileMessageText(element)); break; case 'argumentElement': pattern.push(this.compileArgument(element)); break; default: throw new Error('Message element does not have a valid type'); } } return pattern; }; Compiler.prototype.compileMessageText = function (element) { // When this `element` is part of plural sub-pattern and its value contains // an unescaped '#', use a `PluralOffsetString` helper to properly output // the number with the correct offset in the string. if (this.currentPlural && /(^|[^\\])#/g.test(element.value)) { // Create a cache a NumberFormat instance that can be reused for any // PluralOffsetString instance in this message. if (!this.pluralNumberFormat) { this.pluralNumberFormat = new Intl.NumberFormat(this.locales); } return new PluralOffsetString( this.currentPlural.id, this.currentPlural.format.offset, this.pluralNumberFormat, element.value); } // Unescape the escaped '#'s in the message text. return element.value.replace(/\\#/g, '#'); }; Compiler.prototype.compileArgument = function (element) { var format = element.format; if (!format) { return new StringFormat(element.id); } var formats = this.formats, locales = this.locales, pluralFn = this.pluralFn, options; switch (format.type) { case 'numberFormat': options = formats.number[format.style]; return { id : element.id, format: new Intl.NumberFormat(locales, options).format }; case 'dateFormat': options = formats.date[format.style]; return { id : element.id, format: new Intl.DateTimeFormat(locales, options).format }; case 'timeFormat': options = formats.time[format.style]; return { id : element.id, format: new Intl.DateTimeFormat(locales, options).format }; case 'pluralFormat': options = this.compileOptions(element); return new PluralFormat( element.id, format.ordinal, format.offset, options, pluralFn ); case 'selectFormat': options = this.compileOptions(element); return new SelectFormat(element.id, options); default: throw new Error('Message element does not have a valid format type'); } }; Compiler.prototype.compileOptions = function (element) { var format = element.format, options = format.options, optionsHash = {}; // Save the current plural element, if any, then set it to a new value when // compiling the options sub-patterns. This conforms the spec's algorithm // for handling `"#"` syntax in message text. this.pluralStack.push(this.currentPlural); this.currentPlural = format.type === 'pluralFormat' ? element : null; var i, len, option; for (i = 0, len = options.length; i < len; i += 1) { option = options[i]; // Compile the sub-pattern and save it under the options's selector. optionsHash[option.selector] = this.compileMessage(option.value); } // Pop the plural stack to put back the original current plural value. this.currentPlural = this.pluralStack.pop(); return optionsHash; }; // -- Compiler Helper Classes -------------------------------------------------- function StringFormat(id) { this.id = id; } StringFormat.prototype.format = function (value) { if (!value && typeof value !== 'number') { return ''; } return typeof value === 'string' ? value : String(value); }; function PluralFormat(id, useOrdinal, offset, options, pluralFn) { this.id = id; this.useOrdinal = useOrdinal; this.offset = offset; this.options = options; this.pluralFn = pluralFn; } PluralFormat.prototype.getOption = function (value) { var options = this.options; var option = options['=' + value] || options[this.pluralFn(value - this.offset, this.useOrdinal)]; return option || options.other; }; function PluralOffsetString(id, offset, numberFormat, string) { this.id = id; this.offset = offset; this.numberFormat = numberFormat; this.string = string; } PluralOffsetString.prototype.format = function (value) { var number = this.numberFormat.format(value - this.offset); return this.string .replace(/(^|[^\\])#/g, '$1' + number) .replace(/\\#/g, '#'); }; function SelectFormat(id, options) { this.id = id; this.options = options; } SelectFormat.prototype.getOption = function (value) { var options = this.options; return options[value] || options.other; }; }); var parser = createCommonjsModule(function (module, exports) { exports["default"] = (function() { /* * Generated by PEG.js 0.9.0. * * http://pegjs.org/ */ function peg$subclass(child, parent) { function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); } function peg$SyntaxError(message, expected, found, location) { this.message = message; this.expected = expected; this.found = found; this.location = location; this.name = "SyntaxError"; if (typeof Error.captureStackTrace === "function") { Error.captureStackTrace(this, peg$SyntaxError); } } peg$subclass(peg$SyntaxError, Error); function peg$parse(input) { var options = arguments.length > 1 ? arguments[1] : {}, peg$FAILED = {}, peg$startRuleFunctions = { start: peg$parsestart }, peg$startRuleFunction = peg$parsestart, peg$c0 = function(elements) { return { type : 'messageFormatPattern', elements: elements, location: location() }; }, peg$c1 = function(text) { var string = '', i, j, outerLen, inner, innerLen; for (i = 0, outerLen = text.length; i < outerLen; i += 1) { inner = text[i]; for (j = 0, innerLen = inner.length; j < innerLen; j += 1) { string += inner[j]; } } return string; }, peg$c2 = function(messageText) { return { type : 'messageTextElement', value: messageText, location: location() }; }, peg$c3 = /^[^ \t\n\r,.+={}#]/, peg$c4 = { type: "class", value: "[^ \\t\\n\\r,.+={}#]", description: "[^ \\t\\n\\r,.+={}#]" }, peg$c5 = "{", peg$c6 = { type: "literal", value: "{", description: "\"{\"" }, peg$c7 = ",", peg$c8 = { type: "literal", value: ",", description: "\",\"" }, peg$c9 = "}", peg$c10 = { type: "literal", value: "}", description: "\"}\"" }, peg$c11 = function(id, format) { return { type : 'argumentElement', id : id, format: format && format[2], location: location() }; }, peg$c12 = "number", peg$c13 = { type: "literal", value: "number", description: "\"number\"" }, peg$c14 = "date", peg$c15 = { type: "literal", value: "date", description: "\"date\"" }, peg$c16 = "time", peg$c17 = { type: "literal", value: "time", description: "\"time\"" }, peg$c18 = function(type, style) { return { type : type + 'Format', style: style && style[2], location: location() }; }, peg$c19 = "plural", peg$c20 = { type: "literal", value: "plural", description: "\"plural\"" }, peg$c21 = function(pluralStyle) { return { type : pluralStyle.type, ordinal: false, offset : pluralStyle.offset || 0, options: pluralStyle.options, location: location() }; }, peg$c22 = "selectordinal", peg$c23 = { type: "literal", value: "selectordinal", description: "\"selectordinal\"" }, peg$c24 = function(pluralStyle) { return { type : pluralStyle.type, ordinal: true, offset : pluralStyle.offset || 0, options: pluralStyle.options, location: location() } }, peg$c25 = "select", peg$c26 = { type: "literal", value: "select", description: "\"select\"" }, peg$c27 = function(options) { return { type : 'selectFormat', options: options, location: location() }; }, peg$c28 = "=", peg$c29 = { type: "literal", value: "=", description: "\"=\"" }, peg$c30 = function(selector, pattern) { return { type : 'optionalFormatPattern', selector: selector, value : pattern, location: location() }; }, peg$c31 = "offset:", peg$c32 = { type: "literal", value: "offset:", description: "\"offset:\"" }, peg$c33 = function(number) { return number; }, peg$c34 = function(offset, options) { return { type : 'pluralFormat', offset : offset, options: options, location: location() }; }, peg$c35 = { type: "other", description: "whitespace" }, peg$c36 = /^[ \t\n\r]/, peg$c37 = { type: "class", value: "[ \\t\\n\\r]", description: "[ \\t\\n\\r]" }, peg$c38 = { type: "other", description: "optionalWhitespace" }, peg$c39 = /^[0-9]/, peg$c40 = { type: "class", value: "[0-9]", description: "[0-9]" }, peg$c41 = /^[0-9a-f]/i, peg$c42 = { type: "class", value: "[0-9a-f]i", description: "[0-9a-f]i" }, peg$c43 = "0", peg$c44 = { type: "literal", value: "0", description: "\"0\"" }, peg$c45 = /^[1-9]/, peg$c46 = { type: "class", value: "[1-9]", description: "[1-9]" }, peg$c47 = function(digits) { return parseInt(digits, 10); }, peg$c48 = /^[^{}\\\0-\x1F \t\n\r]/, peg$c49 = { type: "class", value: "[^{}\\\\\\0-\\x1F\\x7f \\t\\n\\r]", description: "[^{}\\\\\\0-\\x1F\\x7f \\t\\n\\r]" }, peg$c50 = "\\\\", peg$c51 = { type: "literal", value: "\\\\", description: "\"\\\\\\\\\"" }, peg$c52 = function() { return '\\'; }, peg$c53 = "\\#", peg$c54 = { type: "literal", value: "\\#", description: "\"\\\\#\"" }, peg$c55 = function() { return '\\#'; }, peg$c56 = "\\{", peg$c57 = { type: "literal", value: "\\{", description: "\"\\\\{\"" }, peg$c58 = function() { return '\u007B'; }, peg$c59 = "\\}", peg$c60 = { type: "literal", value: "\\}", description: "\"\\\\}\"" }, peg$c61 = function() { return '\u007D'; }, peg$c62 = "\\u", peg$c63 = { type: "literal", value: "\\u", description: "\"\\\\u\"" }, peg$c64 = function(digits) { return String.fromCharCode(parseInt(digits, 16)); }, peg$c65 = function(chars) { return chars.join(''); }, peg$currPos = 0, peg$savedPos = 0, peg$posDetailsCache = [{ line: 1, column: 1, seenCR: false }], peg$maxFailPos = 0, peg$maxFailExpected = [], peg$silentFails = 0, peg$result; if ("startRule" in options) { if (!(options.startRule in peg$startRuleFunctions)) { throw new Error("Can't start parsing from rule \"" + options.startRule + "\"."); } peg$startRuleFunction = peg$startRuleFunctions[options.startRule]; } function location() { return peg$computeLocation(peg$savedPos, peg$currPos); } function peg$computePosDetails(pos) { var details = peg$posDetailsCache[pos], p, ch; if (details) { return details; } else { p = pos - 1; while (!peg$posDetailsCache[p]) { p--; } details = peg$posDetailsCache[p]; details = { line: details.line, column: details.column, seenCR: details.seenCR }; while (p < pos) { ch = input.charAt(p); if (ch === "\n") { if (!details.seenCR) { details.line++; } details.column = 1; details.seenCR = false; } else if (ch === "\r" || ch === "\u2028" || ch === "\u2029") { details.line++; details.column = 1; details.seenCR = true; } else { details.column++; details.seenCR = false; } p++; } peg$posDetailsCache[pos] = details; return details; } } function peg$computeLocation(startPos, endPos) { var startPosDetails = peg$computePosDetails(startPos), endPosDetails = peg$computePosDetails(endPos); return { start: { offset: startPos, line: startPosDetails.line, column: startPosDetails.column }, end: { offset: endPos, line: endPosDetails.line, column: endPosDetails.column } }; } function peg$fail(expected) { if (peg$currPos < peg$maxFailPos) { return; } if (peg$currPos > peg$maxFailPos) { peg$maxFailPos = peg$currPos; peg$maxFailExpected = []; } peg$maxFailExpected.push(expected); } function peg$buildException(message, expected, found, location) { function cleanupExpected(expected) { var i = 1; expected.sort(function(a, b) { if (a.description < b.description) { return -1; } else if (a.description > b.description) { return 1; } else { return 0; } }); while (i < expected.length) { if (expected[i - 1] === expected[i]) { expected.splice(i, 1); } else { i++; } } } function buildMessage(expected, found) { function stringEscape(s) { function hex(ch) { return ch.charCodeAt(0).toString(16).toUpperCase(); } return s .replace(/\\/g, '\\\\') .replace(/"/g, '\\"') .replace(/\x08/g, '\\b') .replace(/\t/g, '\\t') .replace(/\n/g, '\\n') .replace(/\f/g, '\\f') .replace(/\r/g, '\\r') .replace(/[\x00-\x07\x0B\x0E\x0F]/g, function(ch) { return '\\x0' + hex(ch); }) .replace(/[\x10-\x1F\x80-\xFF]/g, function(ch) { return '\\x' + hex(ch); }) .replace(/[\u0100-\u0FFF]/g, function(ch) { return '\\u0' + hex(ch); }) .replace(/[\u1000-\uFFFF]/g, function(ch) { return '\\u' + hex(ch); }); } var expectedDescs = new Array(expected.length), expectedDesc, foundDesc, i; for (i = 0; i < expected.length; i++) { expectedDescs[i] = expected[i].description; } expectedDesc = expected.length > 1 ? expectedDescs.slice(0, -1).join(", ") + " or " + expectedDescs[expected.length - 1] : expectedDescs[0]; foundDesc = found ? "\"" + stringEscape(found) + "\"" : "end of input"; return "Expected " + expectedDesc + " but " + foundDesc + " found."; } if (expected !== null) { cleanupExpected(expected); } return new peg$SyntaxError( message !== null ? message : buildMessage(expected, found), expected, found, location ); } function peg$parsestart() { var s0; s0 = peg$parsemessageFormatPattern(); return s0; } function peg$parsemessageFormatPattern() { var s0, s1, s2; s0 = peg$currPos; s1 = []; s2 = peg$parsemessageFormatElement(); while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parsemessageFormatElement(); } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c0(s1); } s0 = s1; return s0; } function peg$parsemessageFormatElement() { var s0; s0 = peg$parsemessageTextElement(); if (s0 === peg$FAILED) { s0 = peg$parseargumentElement(); } return s0; } function peg$parsemessageText() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; s1 = []; s2 = peg$currPos; s3 = peg$parse_(); if (s3 !== peg$FAILED) { s4 = peg$parsechars(); if (s4 !== peg$FAILED) { s5 = peg$parse_(); if (s5 !== peg$FAILED) { s3 = [s3, s4, s5]; s2 = s3; } else { peg$currPos = s2; s2 = peg$FAILED; } } else { peg$currPos = s2; s2 = peg$FAILED; } } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$currPos; s3 = peg$parse_(); if (s3 !== peg$FAILED) { s4 = peg$parsechars(); if (s4 !== peg$FAILED) { s5 = peg$parse_(); if (s5 !== peg$FAILED) { s3 = [s3, s4, s5]; s2 = s3; } else { peg$currPos = s2; s2 = peg$FAILED; } } else { peg$currPos = s2; s2 = peg$FAILED; } } else { peg$currPos = s2; s2 = peg$FAILED; } } } else { s1 = peg$FAILED; } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c1(s1); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = peg$parsews(); if (s1 !== peg$FAILED) { s0 = input.substring(s0, peg$currPos); } else { s0 = s1; } } return s0; } function peg$parsemessageTextElement() { var s0, s1; s0 = peg$currPos; s1 = peg$parsemessageText(); if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c2(s1); } s0 = s1; return s0; } function peg$parseargument() { var s0, s1, s2; s0 = peg$parsenumber(); if (s0 === peg$FAILED) { s0 = peg$currPos; s1 = []; if (peg$c3.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c4); } } if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); if (peg$c3.test(input.charAt(peg$currPos))) { s2 = input.charAt(peg$currPos); peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c4); } } } } else { s1 = peg$FAILED; } if (s1 !== peg$FAILED) { s0 = input.substring(s0, peg$currPos); } else { s0 = s1; } } return s0; } function peg$parseargumentElement() { var s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 123) { s1 = peg$c5; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c6); } } if (s1 !== peg$FAILED) { s2 = peg$parse_(); if (s2 !== peg$FAILED) { s3 = peg$parseargument(); if (s3 !== peg$FAILED) { s4 = peg$parse_(); if (s4 !== peg$FAILED) { s5 = peg$currPos; if (input.charCodeAt(peg$currPos) === 44) { s6 = peg$c7; peg$currPos++; } else { s6 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c8); } } if (s6 !== peg$FAILED) { s7 = peg$parse_(); if (s7 !== peg$FAILED) { s8 = peg$parseelementFormat(); if (s8 !== peg$FAILED) { s6 = [s6, s7, s8]; s5 = s6; } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } } else { peg$currPos = s5; s5 = peg$FAILED; } if (s5 === peg$FAILED) { s5 = null; } if (s5 !== peg$FAILED) { s6 = peg$parse_(); if (s6 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s7 = peg$c9; peg$currPos++; } else { s7 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c10); } } if (s7 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c11(s3, s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseelementFormat() { var s0; s0 = peg$parsesimpleFormat(); if (s0 === peg$FAILED) { s0 = peg$parsepluralFormat(); if (s0 === peg$FAILED) { s0 = peg$parseselectOrdinalFormat(); if (s0 === peg$FAILED) { s0 = peg$parseselectFormat(); } } } return s0; } function peg$parsesimpleFormat() { var s0, s1, s2, s3, s4, s5, s6; s0 = peg$currPos; if (input.substr(peg$currPos, 6) === peg$c12) { s1 = peg$c12; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c13); } } if (s1 === peg$FAILED) { if (input.substr(peg$currPos, 4) === peg$c14) { s1 = peg$c14; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c15); } } if (s1 === peg$FAILED) { if (input.substr(peg$currPos, 4) === peg$c16) { s1 = peg$c16; peg$currPos += 4; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c17); } } } } if (s1 !== peg$FAILED) { s2 = peg$parse_(); if (s2 !== peg$FAILED) { s3 = peg$currPos; if (input.charCodeAt(peg$currPos) === 44) { s4 = peg$c7; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c8); } } if (s4 !== peg$FAILED) { s5 = peg$parse_(); if (s5 !== peg$FAILED) { s6 = peg$parsechars(); if (s6 !== peg$FAILED) { s4 = [s4, s5, s6]; s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } if (s3 === peg$FAILED) { s3 = null; } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c18(s1, s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsepluralFormat() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.substr(peg$currPos, 6) === peg$c19) { s1 = peg$c19; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c20); } } if (s1 !== peg$FAILED) { s2 = peg$parse_(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s3 = peg$c7; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c8); } } if (s3 !== peg$FAILED) { s4 = peg$parse_(); if (s4 !== peg$FAILED) { s5 = peg$parsepluralStyle(); if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c21(s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseselectOrdinalFormat() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.substr(peg$currPos, 13) === peg$c22) { s1 = peg$c22; peg$currPos += 13; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c23); } } if (s1 !== peg$FAILED) { s2 = peg$parse_(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s3 = peg$c7; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c8); } } if (s3 !== peg$FAILED) { s4 = peg$parse_(); if (s4 !== peg$FAILED) { s5 = peg$parsepluralStyle(); if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c24(s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseselectFormat() { var s0, s1, s2, s3, s4, s5, s6; s0 = peg$currPos; if (input.substr(peg$currPos, 6) === peg$c25) { s1 = peg$c25; peg$currPos += 6; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c26); } } if (s1 !== peg$FAILED) { s2 = peg$parse_(); if (s2 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 44) { s3 = peg$c7; peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c8); } } if (s3 !== peg$FAILED) { s4 = peg$parse_(); if (s4 !== peg$FAILED) { s5 = []; s6 = peg$parseoptionalFormatPattern(); if (s6 !== peg$FAILED) { while (s6 !== peg$FAILED) { s5.push(s6); s6 = peg$parseoptionalFormatPattern(); } } else { s5 = peg$FAILED; } if (s5 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c27(s5); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseselector() { var s0, s1, s2, s3; s0 = peg$currPos; s1 = peg$currPos; if (input.charCodeAt(peg$currPos) === 61) { s2 = peg$c28; peg$currPos++; } else { s2 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c29); } } if (s2 !== peg$FAILED) { s3 = peg$parsenumber(); if (s3 !== peg$FAILED) { s2 = [s2, s3]; s1 = s2; } else { peg$currPos = s1; s1 = peg$FAILED; } } else { peg$currPos = s1; s1 = peg$FAILED; } if (s1 !== peg$FAILED) { s0 = input.substring(s0, peg$currPos); } else { s0 = s1; } if (s0 === peg$FAILED) { s0 = peg$parsechars(); } return s0; } function peg$parseoptionalFormatPattern() { var s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; s1 = peg$parse_(); if (s1 !== peg$FAILED) { s2 = peg$parseselector(); if (s2 !== peg$FAILED) { s3 = peg$parse_(); if (s3 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 123) { s4 = peg$c5; peg$currPos++; } else { s4 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c6); } } if (s4 !== peg$FAILED) { s5 = peg$parse_(); if (s5 !== peg$FAILED) { s6 = peg$parsemessageFormatPattern(); if (s6 !== peg$FAILED) { s7 = peg$parse_(); if (s7 !== peg$FAILED) { if (input.charCodeAt(peg$currPos) === 125) { s8 = peg$c9; peg$currPos++; } else { s8 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c10); } } if (s8 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c30(s2, s6); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parseoffset() { var s0, s1, s2, s3; s0 = peg$currPos; if (input.substr(peg$currPos, 7) === peg$c31) { s1 = peg$c31; peg$currPos += 7; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c32); } } if (s1 !== peg$FAILED) { s2 = peg$parse_(); if (s2 !== peg$FAILED) { s3 = peg$parsenumber(); if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c33(s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsepluralStyle() { var s0, s1, s2, s3, s4; s0 = peg$currPos; s1 = peg$parseoffset(); if (s1 === peg$FAILED) { s1 = null; } if (s1 !== peg$FAILED) { s2 = peg$parse_(); if (s2 !== peg$FAILED) { s3 = []; s4 = peg$parseoptionalFormatPattern(); if (s4 !== peg$FAILED) { while (s4 !== peg$FAILED) { s3.push(s4); s4 = peg$parseoptionalFormatPattern(); } } else { s3 = peg$FAILED; } if (s3 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c34(s1, s3); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } return s0; } function peg$parsews() { var s0, s1; peg$silentFails++; s0 = []; if (peg$c36.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c37); } } if (s1 !== peg$FAILED) { while (s1 !== peg$FAILED) { s0.push(s1); if (peg$c36.test(input.charAt(peg$currPos))) { s1 = input.charAt(peg$currPos); peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c37); } } } } else { s0 = peg$FAILED; } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c35); } } return s0; } function peg$parse_() { var s0, s1, s2; peg$silentFails++; s0 = peg$currPos; s1 = []; s2 = peg$parsews(); while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parsews(); } if (s1 !== peg$FAILED) { s0 = input.substring(s0, peg$currPos); } else { s0 = s1; } peg$silentFails--; if (s0 === peg$FAILED) { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c38); } } return s0; } function peg$parsedigit() { var s0; if (peg$c39.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c40); } } return s0; } function peg$parsehexDigit() { var s0; if (peg$c41.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c42); } } return s0; } function peg$parsenumber() { var s0, s1, s2, s3, s4, s5; s0 = peg$currPos; if (input.charCodeAt(peg$currPos) === 48) { s1 = peg$c43; peg$currPos++; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c44); } } if (s1 === peg$FAILED) { s1 = peg$currPos; s2 = peg$currPos; if (peg$c45.test(input.charAt(peg$currPos))) { s3 = input.charAt(peg$currPos); peg$currPos++; } else { s3 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c46); } } if (s3 !== peg$FAILED) { s4 = []; s5 = peg$parsedigit(); while (s5 !== peg$FAILED) { s4.push(s5); s5 = peg$parsedigit(); } if (s4 !== peg$FAILED) { s3 = [s3, s4]; s2 = s3; } else { peg$currPos = s2; s2 = peg$FAILED; } } else { peg$currPos = s2; s2 = peg$FAILED; } if (s2 !== peg$FAILED) { s1 = input.substring(s1, peg$currPos); } else { s1 = s2; } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c47(s1); } s0 = s1; return s0; } function peg$parsechar() { var s0, s1, s2, s3, s4, s5, s6, s7; if (peg$c48.test(input.charAt(peg$currPos))) { s0 = input.charAt(peg$currPos); peg$currPos++; } else { s0 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c49); } } if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c50) { s1 = peg$c50; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c51); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c52(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c53) { s1 = peg$c53; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c54); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c55(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c56) { s1 = peg$c56; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c57); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c58(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c59) { s1 = peg$c59; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c60); } } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c61(); } s0 = s1; if (s0 === peg$FAILED) { s0 = peg$currPos; if (input.substr(peg$currPos, 2) === peg$c62) { s1 = peg$c62; peg$currPos += 2; } else { s1 = peg$FAILED; if (peg$silentFails === 0) { peg$fail(peg$c63); } } if (s1 !== peg$FAILED) { s2 = peg$currPos; s3 = peg$currPos; s4 = peg$parsehexDigit(); if (s4 !== peg$FAILED) { s5 = peg$parsehexDigit(); if (s5 !== peg$FAILED) { s6 = peg$parsehexDigit(); if (s6 !== peg$FAILED) { s7 = peg$parsehexDigit(); if (s7 !== peg$FAILED) { s4 = [s4, s5, s6, s7]; s3 = s4; } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } } else { peg$currPos = s3; s3 = peg$FAILED; } if (s3 !== peg$FAILED) { s2 = input.substring(s2, peg$currPos); } else { s2 = s3; } if (s2 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c64(s2); s0 = s1; } else { peg$currPos = s0; s0 = peg$FAILED; } } else { peg$currPos = s0; s0 = peg$FAILED; } } } } } } return s0; } function peg$parsechars() { var s0, s1, s2; s0 = peg$currPos; s1 = []; s2 = peg$parsechar(); if (s2 !== peg$FAILED) { while (s2 !== peg$FAILED) { s1.push(s2); s2 = peg$parsechar(); } } else { s1 = peg$FAILED; } if (s1 !== peg$FAILED) { peg$savedPos = s0; s1 = peg$c65(s1); } s0 = s1; return s0; } peg$result = peg$startRuleFunction(); if (peg$result !== peg$FAILED && peg$currPos === input.length) { return peg$result; } else { if (peg$result !== peg$FAILED && peg$currPos < input.length) { peg$fail({ type: "end", description: "end of input" }); } throw peg$buildException( null, peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos) ); } } return { SyntaxError: peg$SyntaxError, parse: peg$parse }; })(); }); var intlMessageformatParser = createCommonjsModule(function (module, exports) { exports = module.exports = parser['default']; exports['default'] = exports; }); var core = createCommonjsModule(function (module, exports) { exports["default"] = MessageFormat; // -- MessageFormat -------------------------------------------------------- function MessageFormat(message, locales, formats) { // Parse string messages into an AST. var ast = typeof message === 'string' ? MessageFormat.__parse(message) : message; if (!(ast && ast.type === 'messageFormatPattern')) { throw new TypeError('A message must be provided as a String or AST.'); } // Creates a new object with the specified `formats` merged with the default // formats. formats = this._mergeFormats(MessageFormat.formats, formats); // Defined first because it's used to build the format pattern. es5.defineProperty(this, '_locale', {value: this._resolveLocale(locales)}); // Compile the `ast` to a pattern that is highly optimized for repeated // `format()` invocations. **Note:** This passes the `locales` set provided // to the constructor instead of just the resolved locale. var pluralFn = this._findPluralRuleFunction(this._locale); var pattern = this._compilePattern(ast, locales, formats, pluralFn); // "Bind" `format()` method to `this` so it can be passed by reference like // the other `Intl` APIs. var messageFormat = this; this.format = function (values) { try { return messageFormat._format(pattern, values); } catch (e) { if (e.variableId) { throw new Error( 'The intl string context variable \'' + e.variableId + '\'' + ' was not provided to the string \'' + message + '\'' ); } else { throw e; } } }; } // Default format options used as the prototype of the `formats` provided to the // constructor. These are used when constructing the internal Intl.NumberFormat // and Intl.DateTimeFormat instances. es5.defineProperty(MessageFormat, 'formats', { enumerable: true, value: { number: { 'currency': { style: 'currency' }, 'percent': { style: 'percent' } }, date: { 'short': { month: 'numeric', day : 'numeric', year : '2-digit' }, 'medium': { month: 'short', day : 'numeric', year : 'numeric' }, 'long': { month: 'long', day : 'numeric', year : 'numeric' }, 'full': { weekday: 'long', month : 'long', day : 'numeric', year : 'numeric' } }, time: { 'short': { hour : 'numeric', minute: 'numeric' }, 'medium': { hour : 'numeric', minute: 'numeric', second: 'numeric' }, 'long': { hour : 'numeric', minute : 'numeric', second : 'numeric', timeZoneName: 'short' }, 'full': { hour : 'numeric', minute : 'numeric', second : 'numeric', timeZoneName: 'short' } } } }); // Define internal private properties for dealing with locale data. es5.defineProperty(MessageFormat, '__localeData__', {value: es5.objCreate(null)}); es5.defineProperty(MessageFormat, '__addLocaleData', {value: function (data) { if (!(data && data.locale)) { throw new Error( 'Locale data provided to IntlMessageFormat is missing a ' + '`locale` property' ); } MessageFormat.__localeData__[data.locale.toLowerCase()] = data; }}); // Defines `__parse()` static method as an exposed private. es5.defineProperty(MessageFormat, '__parse', {value: intlMessageformatParser["default"].parse}); // Define public `defaultLocale` property which defaults to English, but can be // set by the developer. es5.defineProperty(MessageFormat, 'defaultLocale', { enumerable: true, writable : true, value : undefined }); MessageFormat.prototype.resolvedOptions = function () { // TODO: Provide anything else? return { locale: this._locale }; }; MessageFormat.prototype._compilePattern = function (ast, locales, formats, pluralFn) { var compiler$1 = new compiler["default"](locales, formats, pluralFn); return compiler$1.compile(ast); }; MessageFormat.prototype._findPluralRuleFunction = function (locale) { var localeData = MessageFormat.__localeData__; var data = localeData[locale.toLowerCase()]; // The locale data is de-duplicated, so we have to traverse the locale's // hierarchy until we find a `pluralRuleFunction` to return. while (data) { if (data.pluralRuleFunction) { return data.pluralRuleFunction; } data = data.parentLocale && localeData[data.parentLocale.toLowerCase()]; } throw new Error( 'Locale data added to IntlMessageFormat is missing a ' + '`pluralRuleFunction` for :' + locale ); }; MessageFormat.prototype._format = function (pattern, values) { var result = '', i, len, part, id, value, err; for (i = 0, len = pattern.length; i < len; i += 1) { part = pattern[i]; // Exist early for string parts. if (typeof part === 'string') { result += part; continue; } id = part.id; // Enforce that all required values are provided by the caller. if (!(values && utils.hop.call(values, id))) { err = new Error('A value must be provided for: ' + id); err.variableId = id; throw err; } value = values[id]; // Recursively format plural and select parts' option — which can be a // nested pattern structure. The choosing of the option to use is // abstracted-by and delegated-to the part helper object. if (part.options) { result += this._format(part.getOption(value), values); } else { result += part.format(value); } } return result; }; MessageFormat.prototype._mergeFormats = function (defaults, formats) { var mergedFormats = {}, type, mergedType; for (type in defaults) { if (!utils.hop.call(defaults, type)) { continue; } mergedFormats[type] = mergedType = es5.objCreate(defaults[type]); if (formats && utils.hop.call(formats, type)) { utils.extend(mergedType, formats[type]); } } return mergedFormats; }; MessageFormat.prototype._resolveLocale = function (locales) { if (typeof locales === 'string') { locales = [locales]; } // Create a copy of the array so we can push on the default locale. locales = (locales || []).concat(MessageFormat.defaultLocale); var localeData = MessageFormat.__localeData__; var i, len, localeParts, data; // Using the set of locales + the default locale, we look for the first one // which that has been registered. When data does not exist for a locale, we // traverse its ancestors to find something that's been registered within // its hierarchy of locales. Since we lack the proper `parentLocale` data // here, we must take a naive approach to traversal. for (i = 0, len = locales.length; i < len; i += 1) { localeParts = locales[i].toLowerCase().split('-'); while (localeParts.length) { data = localeData[localeParts.join('-')]; if (data) { // Return the normalized locale string; e.g., we return "en-US", // instead of "en-us". return data.locale; } localeParts.pop(); } } var defaultLocale = locales.pop(); throw new Error( 'No locale data has been added to IntlMessageFormat for: ' + locales.join(', ') + ', or the default locale: ' + defaultLocale ); }; }); var en = createCommonjsModule(function (module, exports) { exports["default"] = {"locale":"en","pluralRuleFunction":function (n,ord){var s=String(n).split("."),v0=!s[1],t0=Number(s[0])==n,n10=t0&&s[0].slice(-1),n100=t0&&s[0].slice(-2);if(ord)return n10==1&&n100!=11?"one":n10==2&&n100!=12?"two":n10==3&&n100!=13?"few":"other";return n==1&&v0?"one":"other"}}; }); var main = createCommonjsModule(function (module, exports) { core["default"].__addLocaleData(en["default"]); core["default"].defaultLocale = 'en'; exports["default"] = core["default"]; }); var _nodeResolve_empty = {}; var _nodeResolve_empty$1 = /*#__PURE__*/Object.freeze({ __proto__: null, 'default': _nodeResolve_empty }); getCjsExportFromNamespace(_nodeResolve_empty$1); var intlMessageformat = createCommonjsModule(function (module, exports) { var IntlMessageFormat = main['default']; // Add all locale data to `IntlMessageFormat`. This module will be ignored when // bundling for the browser with Browserify/Webpack. // Re-export `IntlMessageFormat` as the CommonJS default exports with all the // locale data registered, and with English set as the default locale. Define // the `default` prop for use with other compiled ES6 Modules. exports = module.exports = IntlMessageFormat; exports['default'] = exports; }); /** * lodash (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; /** `Object#toString` result references. */ var funcTag = '[object Function]', genTag = '[object GeneratorFunction]', symbolTag = '[object Symbol]'; /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, reLeadingDot = /^\./, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = freeGlobal || freeSelf || Function('return this')(); /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } /** * Checks if `value` is a host object in IE < 9. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a host object, else `false`. */ function isHostObject(value) { // Many host objects are `Object` objects that can coerce to strings // despite having improperly defined `toString` methods. var result = false; if (value != null && typeof value.toString != 'function') { try { result = !!(value + ''); } catch (e) {} } return result; } /** Used for built-in method references. */ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype; /** Used to detect overreaching core-js shims. */ var coreJsData = root['__core-js_shared__']; /** Used to detect methods masquerading as native. */ var maskSrcKey = (function() { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); return uid ? ('Symbol(src)_1.' + uid) : ''; }()); /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' ); /** Built-in value references. */ var Symbol = root.Symbol, splice = arrayProto.splice; /* Built-in method references that are verified to be native. */ var Map = getNative(root, 'Map'), nativeCreate = getNative(Object, 'create'); /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, symbolToString = symbolProto ? symbolProto.toString : undefined; /** * Creates a hash object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Hash(entries) { var index = -1, length = entries ? entries.length : 0; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the hash. * * @private * @name clear * @memberOf Hash */ function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; } /** * Removes `key` and its value from the hash. * * @private * @name delete * @memberOf Hash * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { return this.has(key) && delete this.__data__[key]; } /** * Gets the hash value for `key`. * * @private * @name get * @memberOf Hash * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function hashGet(key) { var data = this.__data__; if (nativeCreate) { var result = data[key]; return result === HASH_UNDEFINED ? undefined : result; } return hasOwnProperty.call(data, key) ? data[key] : undefined; } /** * Checks if a hash value for `key` exists. * * @private * @name has * @memberOf Hash * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function hashHas(key) { var data = this.__data__; return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); } /** * Sets the hash `key` to `value`. * * @private * @name set * @memberOf Hash * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the hash instance. */ function hashSet(key, value) { var data = this.__data__; data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; return this; } // Add methods to `Hash`. Hash.prototype.clear = hashClear; Hash.prototype['delete'] = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; /** * Creates an list cache object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function ListCache(entries) { var index = -1, length = entries ? entries.length : 0; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the list cache. * * @private * @name clear * @memberOf ListCache */ function listCacheClear() { this.__data__ = []; } /** * Removes `key` and its value from the list cache. * * @private * @name delete * @memberOf ListCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function listCacheDelete(key) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } return true; } /** * Gets the list cache value for `key`. * * @private * @name get * @memberOf ListCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function listCacheGet(key) { var data = this.__data__, index = assocIndexOf(data, key); return index < 0 ? undefined : data[index][1]; } /** * Checks if a list cache value for `key` exists. * * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */ function listCacheSet(key, value) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { data.push([key, value]); } else { data[index][1] = value; } return this; } // Add methods to `ListCache`. ListCache.prototype.clear = listCacheClear; ListCache.prototype['delete'] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; /** * Creates a map cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function MapCache(entries) { var index = -1, length = entries ? entries.length : 0; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the map. * * @private * @name clear * @memberOf MapCache */ function mapCacheClear() { this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), 'string': new Hash }; } /** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { return getMapData(this, key)['delete'](key); } /** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function mapCacheGet(key) { return getMapData(this, key).get(key); } /** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function mapCacheHas(key) { return getMapData(this, key).has(key); } /** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { getMapData(this, key).set(key, value); return this; } // Add methods to `MapCache`. MapCache.prototype.clear = mapCacheClear; MapCache.prototype['delete'] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } /** * The base implementation of `_.get` without support for default values. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @returns {*} Returns the resolved value. */ function baseGet(object, path) { path = isKey(path, object) ? [path] : castPath(path); var index = 0, length = path.length; while (object != null && index < length) { object = object[toKey(path[index++])]; } return (index && index == length) ? object : undefined; } /** * The base implementation of `_.isNative` without bad shim checks. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. */ function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } /** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */ function baseToString(value) { // Exit early for strings to avoid a performance hit in some environments. if (typeof value == 'string') { return value; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** * Casts `value` to a path array if it's not one. * * @private * @param {*} value The value to inspect. * @returns {Array} Returns the cast property path array. */ function castPath(value) { return isArray(value) ? value : stringToPath(value); } /** * Gets the data for `map`. * * @private * @param {Object} map The map to query. * @param {string} key The reference key. * @returns {*} Returns the map data. */ function getMapData(map, key) { var data = map.__data__; return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; } /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : undefined; } /** * Checks if `value` is a property name and not a property path. * * @private * @param {*} value The value to check. * @param {Object} [object] The object to query keys on. * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ function isKey(value, object) { if (isArray(value)) { return false; } var type = typeof value; if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || (object != null && value in Object(object)); } /** * Checks if `value` is suitable for use as unique object key. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ function isKeyable(value) { var type = typeof value; return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') ? (value !== '__proto__') : (value === null); } /** * Checks if `func` has its source masked. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ function isMasked(func) { return !!maskSrcKey && (maskSrcKey in func); } /** * Converts `string` to a property path array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ var stringToPath = memoize(function(string) { string = toString(string); var result = []; if (reLeadingDot.test(string)) { result.push(''); } string.replace(rePropName, function(match, number, quote, string) { result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); }); return result; }); /** * Converts `value` to a string key if it's not a string or symbol. * * @private * @param {*} value The value to inspect. * @returns {string|symbol} Returns the key. */ function toKey(value) { if (typeof value == 'string' || isSymbol(value)) { return value; } var result = (value + ''); return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; } /** * Converts `func` to its source code. * * @private * @param {Function} func The function to process. * @returns {string} Returns the source code. */ function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) {} try { return (func + ''); } catch (e) {} } return ''; } /** * Creates a function that memoizes the result of `func`. If `resolver` is * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. * * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) * method interface of `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. * @returns {Function} Returns the new memoized function. * @example * * var object = { 'a': 1, 'b': 2 }; * var other = { 'c': 3, 'd': 4 }; * * var values = _.memoize(_.values); * values(object); * // => [1, 2] * * values(other); * // => [3, 4] * * object.a = 2; * values(object); * // => [1, 2] * * // Modify the result cache. * values.cache.set(object, ['a', 'b']); * values(object); * // => ['a', 'b'] * * // Replace `_.memoize.Cache`. * _.memoize.Cache = WeakMap; */ function memoize(func, resolver) { if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { throw new TypeError(FUNC_ERROR_TEXT); } var memoized = function() { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key)) { return cache.get(key); } var result = func.apply(this, args); memoized.cache = cache.set(key, result); return result; }; memoized.cache = new (memoize.Cache || MapCache); return memoized; } // Assign cache to `_.memoize`. memoize.Cache = MapCache; /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || (value !== value && other !== other); } /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 8-9 which returns 'object' for typed array and other constructors. var tag = isObject(value) ? objectToString.call(value) : ''; return tag == funcTag || tag == genTag; } /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return !!value && (type == 'object' || type == 'function'); } /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return !!value && typeof value == 'object'; } /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function isSymbol(value) { return typeof value == 'symbol' || (isObjectLike(value) && objectToString.call(value) == symbolTag); } /** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {string} Returns the string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */ function toString(value) { return value == null ? '' : baseToString(value); } /** * Gets the value at `path` of `object`. If the resolved value is * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.get(object, 'a[0].b.c'); * // => 3 * * _.get(object, ['a', '0', 'b', 'c']); * // => 3 * * _.get(object, 'a.b.c', 'default'); * // => 'default' */ function get(object, path, defaultValue) { var result = object == null ? undefined : baseGet(object, path); return result === undefined ? defaultValue : result; } var lodash_get = get; var Observer_1 = createCommonjsModule(function (module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); var Observer = function (obj) { Object.keys(obj.__data__ || obj).forEach(function (key) { defineReactive(obj, key); }); return obj; }; var observe = function (value) { if (!value || typeof value !== 'object') { return; } Observer(value); }; var defineReactive = function (obj, key) { var childObj = observe(obj[key]); Object.defineProperty(obj, key, { get: function () { if (obj.__data__[key]) { return obj.__data__[key]; } else if (obj.__metas__['zh-CN'][key]) { return obj.__metas__['zh-CN'][key]; } }, set: function (newVal) { if (obj[key] === newVal) { return; } obj[key] = newVal; var cb = obj.callback[key]; cb.call(obj); childObj = observe(newVal); } }); }; exports.default = Observer; }); unwrapExports(Observer_1); var src = createCommonjsModule(function (module, exports) { var __assign = (commonjsGlobal && commonjsGlobal.__assign) || Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; Object.defineProperty(exports, "__esModule", { value: true }); var I18N = (function () { function I18N(lang, metas) { this.__lang__ = lang; this.__metas__ = metas; this.__data__ = metas[lang]; } I18N.prototype.setLang = function (lang) { this.__lang__ = lang; this.__data__ = this.__metas__[lang]; }; I18N.prototype.getProp = function (obj, is, value) { if (typeof is === 'string') { is = is.split('.'); } if (is.length === 1 && value !== undefined) { return (obj[is[0]] = value); } else if (is.length === 0) { return obj; } else { var prop = is.shift(); if (value !== undefined && obj[prop] === undefined) { obj[prop] = {}; } return this.getProp(obj[prop], is, value); } }; I18N.prototype.template = function (str, args) { var _this = this; if (!str) { return ''; } return str.replace(/\{(.+?)\}/g, function (match, p1) { return _this.getProp(__assign({}, _this.__data__, args), p1); }); }; I18N.prototype.get = function (str, args) { var msg = lodash_get(this.__data__, str); if (!msg) { msg = lodash_get(this.__metas__['zh-CN'], str, str); } if (args) { try { msg = new intlMessageformat.default(msg, this.__lang__); msg = msg.format(args); return msg; } catch (err) { console.warn("kiwi-intl format message failed for key='" + str + "'", err); return ''; } } else { return msg; } }; return I18N; }()); var IntlFormat = { init: function (lang, metas) { var i18n = new I18N(lang, metas); return Observer_1.default(i18n); } }; exports.IntlFormat = IntlFormat; exports.default = IntlFormat; }); var KiwiIntl = unwrapExports(src); var src_1 = src.IntlFormat; var priceOptions = { "index": { "others": "Others" } }; var payplatformoption = { "platform": "支付平台" }; var enUsLangs = Object.assign({}, { priceOptions: priceOptions, payplatformoption: payplatformoption }); var priceOptions$1 = { index: { others: '其他金额' } }; var payplatformoption$1 = { platform: '支付平台' }; var zhCNLangs = Object.assign({}, { priceOptions: priceOptions$1, payplatformoption: payplatformoption$1 }); // type TransmitImgTxtData = { // user_id?: string|number; // anonymity?: boolean; // avatar?: string; // nickname?: string; // is_long?: boolean; // } // interface TransmitCardProps { // type: TransmitType; // data: TransmitImgTxtData; // } // export class TransmitCard extends React.PureComponent { // renderVideo() { // return Video; // } // renderImgTxt() { // const { data } = this.props; // const { // user_id, // anonymity, // avatar, // nickname, // is_long, // } = data; // return ( // // // // // // // // {nickname} // // // // {is_long // ? intl.get('bilingually.imgtxt.article') // : intl.get('bilingually.imgtxt')} // // // // ); // } // render() { // const { type } = this.props; // if (type === 'imgTxt') { // this.renderImgTxt(); // } // if (type === 'shortVideo' || type === 'microVideo') { // this.renderVideo(); // } // return null; // } // } var Test = "TestComponent"; var langs = { 'en_US': enUsLangs, 'zh_CN': zhCNLangs }; var kiwiIntl = KiwiIntl.init('en_US', langs); export { Test, kiwiIntl }; //# sourceMappingURL=index.js.map