{"version":3,"sources":["webpack:///./node_modules/@intlify/message-resolver/dist/message-resolver.esm-bundler.js","webpack:///./node_modules/@intlify/runtime/dist/runtime.esm-bundler.js","webpack:///./node_modules/@intlify/devtools-if/dist/devtools-if.esm-bundler.js","webpack:///./node_modules/@intlify/core-base/dist/core-base.esm-bundler.js","webpack:///./node_modules/@intlify/vue-devtools/dist/vue-devtools.esm-bundler.js","webpack:///./node_modules/@intlify/shared/dist/shared.esm-bundler.js","webpack:///./node_modules/@intlify/message-compiler/dist/message-compiler.esm-bundler.js"],"names":["hasOwnProperty","Object","prototype","hasOwn","obj","key","call","isObject","val","pathStateMachine","literalValueRE","isLiteral","exp","test","stripQuotes","str","a","charCodeAt","b","length","slice","getPathCharType","ch","undefined","code","formatSubPath","path","trimmed","trim","charAt","isNaN","parseInt","parse","keys","c","newChar","type","transition","action","typeMap","index","mode","subPathDepth","actions","maybeUnescapeQuote","nextChar","push","cache","Map","resolveValue","hit","get","set","len","last","i","handleFlatJson","includes","subKeys","split","lastIndex","currentObj","DEFAULT_MODIFIER","DEFAULT_MESSAGE","ctx","DEFAULT_MESSAGE_DATA_TYPE","DEFAULT_NORMALIZE","values","join","DEFAULT_INTERPOLATE","pluralDefault","choice","choicesLength","Math","abs","min","getPluralIndex","options","pluralIndex","named","count","n","normalizeNamed","props","createMessageContext","locale","pluralRule","pluralRules","orgPluralRule","plural","messages","_list","list","_named","message","msg","parent","_modifier","name","modifiers","normalize","processor","interpolate","modifier","IntlifyDevToolsHooks","I18nInit","FunctionTranslate","devtools","setDevToolsHook","hook","initI18nDevTools","i18n","version","meta","emit","timestamp","Date","now","translateDevTools","createDevToolsHook","payloads","VERSION","NOT_REOSLVED","MISSING_RESOLVE_VALUE","getDefaultLinkedModifiers","upper","toUpperCase","lower","toLowerCase","capitalize","toLocaleUpperCase","substr","_compiler","registerMessageCompiler","compiler","_additionalMeta","setAdditionalMeta","getAdditionalMeta","_cid","createCoreContext","fallbackLocale","datetimeFormats","numberFormats","missing","missingWarn","fallbackWarn","fallbackFormat","unresolving","postTranslation","warnHtmlMessage","escapeParameter","messageCompiler","onWarn","internalOptions","__datetimeFormatters","__numberFormatters","__meta","context","cid","__INTLIFY_PROD_DEVTOOLS__","handleMissing","ret","getLocaleChain","fallback","start","__localeChainCache","chain","block","appendBlockToChain","defaults","blocks","follow","appendLocaleToChain","tokens","target","appendItemToChain","splice","replace","updateFallbackLocale","defaultOnCacheKey","source","compileCache","create","compileToFunction","onCacheKey","cached","occurred","onError","err","Function","createCoreError","NOOP_MESSAGE_FUNCTION","isMessageFunction","translate","args","parseTranslateArgs","resolvedMessage","defaultMsgOrKey","default","enableDefaultMsg","escapeParams","format","targetLocale","resolveMessageFormat","cacheBaseKey","errorDetector","compileMessageFormat","ctxOptions","getMessageContextOptions","msgContext","messaged","evaluateMessage","map","item","forEach","locales","from","to","missingRet","getCompileOptions","msgCtx","arg1","arg2","arg3","String","resolveMessage","intlDefined","Intl","DateTimeFormat","NumberFormat","datetime","value","overrides","parseDateTimeArgs","part","datetimeFormat","id","JSON","stringify","formatter","formatToParts","arg4","toISOString","e","getTime","clearDateTimeFormat","has","delete","number","parseNumberArgs","numberFormat","clearNumberFormat","VueDevToolsLabels","VueDevToolsPlaceholders","VueDevToolsTimelineColors","RE_ARGS","match","identifier","hasSymbol","Symbol","toStringTag","makeSymbol","generateFormatCacheKey","friendlyJSONstringify","l","k","s","json","isNumber","isFinite","isDate","toTypeString","isRegExp","isEmptyObject","isPlainObject","warn","console","stack","assign","_globalThis","getGlobalThis","globalThis","self","window","global","escapeHtml","rawText","isArray","Array","isFunction","isString","isBoolean","objectToString","toString","toDisplayString","createEmitter","events","emitter","event","handler","handlers","added","indexOf","payload","createCompileError","loc","domain","error","SyntaxError","location","defaultOnError","createPosition","line","column","offset","createLocation","end","CHAR_SP","CHAR_CR","CHAR_LF","CHAR_LS","fromCharCode","CHAR_PS","createScanner","_buf","_index","_line","_column","_peekOffset","isCRLF","isLF","isPS","isLS","isLineEnd","peekOffset","currentChar","currentPeek","next","peek","reset","resetPeek","skipToPeek","EOF","LITERAL_DELIMITER","ERROR_DOMAIN$1","createTokenizer","_scnr","currentOffset","currentPosition","_initLoc","_initOffset","_context","currentType","startLoc","endLoc","lastType","lastOffset","lastStartLoc","lastEndLoc","braceNest","inLinked","text","emitError","pos","getToken","token","getEndToken","eat","scnr","peekSpaces","buf","skipSpaces","isIdentifierStart","cc","isNumberStart","isNamedIdentifierStart","isListIdentifierStart","isLiteralStart","isLinkedDotStart","isLinkedModifierStart","isLinkedDelimiterStart","isLinkedReferStart","fn","isPluralStart","isTextStart","hasSpace","prev","detectModulo","takeChar","takeIdentifierChar","closure","takeDigit","takeHexDigit","getDigits","num","readText","readNamedIdentifier","readListIdentifier","readLiteral","literal","x","readEscapeSequence","current","readUnicodeEscapeSequence","unicode","digits","sequence","readInvalidIdentifier","identifiers","readLinkedModifier","readLinkedRefer","detect","readPlural","readTokenInPlaceholder","readTokenInLinked","validNamedIdentifier","validListIdentifier","validLiteral","readToken","nextToken","ERROR_DOMAIN","KNOWN_ESCAPES","fromEscapeSequence","codePoint4","codePoint6","codePoint","fromCodePoint","createParser","tokenzer","startNode","node","endNode","parseText","tokenizer","parseList","parseNamed","parseLiteral","parseLinkedModifier","nextConsumeToken","getTokenCaption","parseLinkedKey","parseLinked","linkedNode","parsed","nextContext","emptyLinkedKeyNode","parseMessage","startOffset","items","endOffset","parsePlural","msgNode","hasEmptyMessage","cases","parseResource","body","createTransformer","ast","helpers","Set","helper","add","traverseNodes","nodes","transformer","traverseNode","linked","transform","createCodeGenerator","sourceMap","filename","breakLineCode","needIndent","_needIndent","indentLevel","_newline","withBreakLine","_breakLineCode","repeat","indent","withNewLine","level","deindent","newline","generateLinkedNode","generator","generateNode","generateMessageNode","generatePluralNode","generateResource","generate","toJSON","baseCompile","assignedOptions","parser"],"mappings":"+GAAA,oEAUA,MAAMA,EAAiBC,OAAOC,UAAUF,eACxC,SAASG,EAAOC,EAAKC,GACjB,OAAOL,EAAe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,CAACjC,EAAK5X,EAAU,MAE7B,MAAMpC,EAAO,eAASoC,EAAQpC,MAAQoC,EAAQpC,KAAO,SAC/C6a,EAAW,eAASzY,EAAQyY,UAC5BzY,EAAQyY,SACR,eACAD,IAAcxY,EAAQwY,UAEtBE,EAAyC,MAAzB1Y,EAAQ0Y,cACxB1Y,EAAQ0Y,cACC,UAAT9a,EACI,IACA,KACJ+a,EAAa3Y,EAAQ2Y,WAAa3Y,EAAQ2Y,WAAsB,UAAT/a,EACvDia,EAAUD,EAAIC,SAAW,GACzB2B,EAAYjB,EAAoBX,EAAK,CACvCha,OACA6a,WACAD,YACAE,gBACAC,eAEJa,EAAUvb,KAAc,WAATL,EAAoB,2BAA6B,cAChE4b,EAAUN,OAAOP,GACbd,EAAQvb,OAAS,IACjBkd,EAAUvb,KAAK,WAAW4Z,EAAQtP,IAAIsD,GAAK,GAAGA,OAAOA,KAAKtM,KAAK,iBAC/Dia,EAAUF,WAEdE,EAAUvb,KAAK,WACfwb,EAAaD,EAAW5B,GACxB4B,EAAUH,SAASV,GACnBa,EAAUvb,KAAK,KACf,MAAM,KAAEtB,EAAI,IAAE4L,GAAQiR,EAAUxU,UAChC,MAAO,CACH4S,MACAjb,OACA4L,IAAKA,EAAMA,EAAIuR,cAAWpd,IAIlC,SAASqd,EAAYxT,EAAQvG,EAAU,IACnC,MAAMga,EAAkB,eAAO,GAAIha,GAE7Bia,EAASnE,EAAakE,GACtBpC,EAAMqC,EAAO9c,MAAMoJ,GAIzB,OAFA+R,EAAUV,EAAKoC,GAERH,EAASjC,EAAKoC","file":"js/npm.intlify.f8bc50fc.js","sourcesContent":["/*!\n * @intlify/message-resolver v9.1.9\n * (c) 2021 kazuya kawaguchi\n * Released under the MIT License.\n */\n/**\r\n * Original Utilities\r\n * written by kazuya kawaguchi\r\n */\r\nif ((process.env.NODE_ENV !== 'production')) ;\r\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\r\nfunction hasOwn(obj, key) {\r\n return hasOwnProperty.call(obj, key);\r\n}\r\nconst isObject = (val) => // eslint-disable-line\r\n val !== null && typeof val === 'object';\n\nconst pathStateMachine = [];\r\npathStateMachine[0 /* BEFORE_PATH */] = {\r\n [\"w\" /* WORKSPACE */]: [0 /* BEFORE_PATH */],\r\n [\"i\" /* IDENT */]: [3 /* IN_IDENT */, 0 /* APPEND */],\r\n [\"[\" /* LEFT_BRACKET */]: [4 /* IN_SUB_PATH */],\r\n [\"o\" /* END_OF_FAIL */]: [7 /* AFTER_PATH */]\r\n};\r\npathStateMachine[1 /* IN_PATH */] = {\r\n [\"w\" /* WORKSPACE */]: [1 /* IN_PATH */],\r\n [\".\" /* DOT */]: [2 /* BEFORE_IDENT */],\r\n [\"[\" /* LEFT_BRACKET */]: [4 /* IN_SUB_PATH */],\r\n [\"o\" /* END_OF_FAIL */]: [7 /* AFTER_PATH */]\r\n};\r\npathStateMachine[2 /* BEFORE_IDENT */] = {\r\n [\"w\" /* WORKSPACE */]: [2 /* BEFORE_IDENT */],\r\n [\"i\" /* IDENT */]: [3 /* IN_IDENT */, 0 /* APPEND */],\r\n [\"0\" /* ZERO */]: [3 /* IN_IDENT */, 0 /* APPEND */]\r\n};\r\npathStateMachine[3 /* IN_IDENT */] = {\r\n [\"i\" /* IDENT */]: [3 /* IN_IDENT */, 0 /* APPEND */],\r\n [\"0\" /* ZERO */]: [3 /* IN_IDENT */, 0 /* APPEND */],\r\n [\"w\" /* WORKSPACE */]: [1 /* IN_PATH */, 1 /* PUSH */],\r\n [\".\" /* DOT */]: [2 /* BEFORE_IDENT */, 1 /* PUSH */],\r\n [\"[\" /* LEFT_BRACKET */]: [4 /* IN_SUB_PATH */, 1 /* PUSH */],\r\n [\"o\" /* END_OF_FAIL */]: [7 /* AFTER_PATH */, 1 /* PUSH */]\r\n};\r\npathStateMachine[4 /* IN_SUB_PATH */] = {\r\n [\"'\" /* SINGLE_QUOTE */]: [5 /* IN_SINGLE_QUOTE */, 0 /* APPEND */],\r\n [\"\\\"\" /* DOUBLE_QUOTE */]: [6 /* IN_DOUBLE_QUOTE */, 0 /* APPEND */],\r\n [\"[\" /* LEFT_BRACKET */]: [\r\n 4 /* IN_SUB_PATH */,\r\n 2 /* INC_SUB_PATH_DEPTH */\r\n ],\r\n [\"]\" /* RIGHT_BRACKET */]: [1 /* IN_PATH */, 3 /* PUSH_SUB_PATH */],\r\n [\"o\" /* END_OF_FAIL */]: 8 /* ERROR */,\r\n [\"l\" /* ELSE */]: [4 /* IN_SUB_PATH */, 0 /* APPEND */]\r\n};\r\npathStateMachine[5 /* IN_SINGLE_QUOTE */] = {\r\n [\"'\" /* SINGLE_QUOTE */]: [4 /* IN_SUB_PATH */, 0 /* APPEND */],\r\n [\"o\" /* END_OF_FAIL */]: 8 /* ERROR */,\r\n [\"l\" /* ELSE */]: [5 /* IN_SINGLE_QUOTE */, 0 /* APPEND */]\r\n};\r\npathStateMachine[6 /* IN_DOUBLE_QUOTE */] = {\r\n [\"\\\"\" /* DOUBLE_QUOTE */]: [4 /* IN_SUB_PATH */, 0 /* APPEND */],\r\n [\"o\" /* END_OF_FAIL */]: 8 /* ERROR */,\r\n [\"l\" /* ELSE */]: [6 /* IN_DOUBLE_QUOTE */, 0 /* APPEND */]\r\n};\r\n/**\r\n * Check if an expression is a literal value.\r\n */\r\nconst literalValueRE = /^\\s?(?:true|false|-?[\\d.]+|'[^']*'|\"[^\"]*\")\\s?$/;\r\nfunction isLiteral(exp) {\r\n return literalValueRE.test(exp);\r\n}\r\n/**\r\n * Strip quotes from a string\r\n */\r\nfunction stripQuotes(str) {\r\n const a = str.charCodeAt(0);\r\n const b = str.charCodeAt(str.length - 1);\r\n return a === b && (a === 0x22 || a === 0x27) ? str.slice(1, -1) : str;\r\n}\r\n/**\r\n * Determine the type of a character in a keypath.\r\n */\r\nfunction getPathCharType(ch) {\r\n if (ch === undefined || ch === null) {\r\n return \"o\" /* END_OF_FAIL */;\r\n }\r\n const code = ch.charCodeAt(0);\r\n switch (code) {\r\n case 0x5b: // [\r\n case 0x5d: // ]\r\n case 0x2e: // .\r\n case 0x22: // \"\r\n case 0x27: // '\r\n return ch;\r\n case 0x5f: // _\r\n case 0x24: // $\r\n case 0x2d: // -\r\n return \"i\" /* IDENT */;\r\n case 0x09: // Tab (HT)\r\n case 0x0a: // Newline (LF)\r\n case 0x0d: // Return (CR)\r\n case 0xa0: // No-break space (NBSP)\r\n case 0xfeff: // Byte Order Mark (BOM)\r\n case 0x2028: // Line Separator (LS)\r\n case 0x2029: // Paragraph Separator (PS)\r\n return \"w\" /* WORKSPACE */;\r\n }\r\n return \"i\" /* IDENT */;\r\n}\r\n/**\r\n * Format a subPath, return its plain form if it is\r\n * a literal string or number. Otherwise prepend the\r\n * dynamic indicator (*).\r\n */\r\nfunction formatSubPath(path) {\r\n const trimmed = path.trim();\r\n // invalid leading 0\r\n if (path.charAt(0) === '0' && isNaN(parseInt(path))) {\r\n return false;\r\n }\r\n return isLiteral(trimmed)\r\n ? stripQuotes(trimmed)\r\n : \"*\" /* ASTARISK */ + trimmed;\r\n}\r\n/**\r\n * Parse a string path into an array of segments\r\n */\r\nfunction parse(path) {\r\n const keys = [];\r\n let index = -1;\r\n let mode = 0 /* BEFORE_PATH */;\r\n let subPathDepth = 0;\r\n let c;\r\n let key; // eslint-disable-line\r\n let newChar;\r\n let type;\r\n let transition;\r\n let action;\r\n let typeMap;\r\n const actions = [];\r\n actions[0 /* APPEND */] = () => {\r\n if (key === undefined) {\r\n key = newChar;\r\n }\r\n else {\r\n key += newChar;\r\n }\r\n };\r\n actions[1 /* PUSH */] = () => {\r\n if (key !== undefined) {\r\n keys.push(key);\r\n key = undefined;\r\n }\r\n };\r\n actions[2 /* INC_SUB_PATH_DEPTH */] = () => {\r\n actions[0 /* APPEND */]();\r\n subPathDepth++;\r\n };\r\n actions[3 /* PUSH_SUB_PATH */] = () => {\r\n if (subPathDepth > 0) {\r\n subPathDepth--;\r\n mode = 4 /* IN_SUB_PATH */;\r\n actions[0 /* APPEND */]();\r\n }\r\n else {\r\n subPathDepth = 0;\r\n if (key === undefined) {\r\n return false;\r\n }\r\n key = formatSubPath(key);\r\n if (key === false) {\r\n return false;\r\n }\r\n else {\r\n actions[1 /* PUSH */]();\r\n }\r\n }\r\n };\r\n function maybeUnescapeQuote() {\r\n const nextChar = path[index + 1];\r\n if ((mode === 5 /* IN_SINGLE_QUOTE */ &&\r\n nextChar === \"'\" /* SINGLE_QUOTE */) ||\r\n (mode === 6 /* IN_DOUBLE_QUOTE */ &&\r\n nextChar === \"\\\"\" /* DOUBLE_QUOTE */)) {\r\n index++;\r\n newChar = '\\\\' + nextChar;\r\n actions[0 /* APPEND */]();\r\n return true;\r\n }\r\n }\r\n while (mode !== null) {\r\n index++;\r\n c = path[index];\r\n if (c === '\\\\' && maybeUnescapeQuote()) {\r\n continue;\r\n }\r\n type = getPathCharType(c);\r\n typeMap = pathStateMachine[mode];\r\n transition = typeMap[type] || typeMap[\"l\" /* ELSE */] || 8 /* ERROR */;\r\n // check parse error\r\n if (transition === 8 /* ERROR */) {\r\n return;\r\n }\r\n mode = transition[0];\r\n if (transition[1] !== undefined) {\r\n action = actions[transition[1]];\r\n if (action) {\r\n newChar = c;\r\n if (action() === false) {\r\n return;\r\n }\r\n }\r\n }\r\n // check parse finish\r\n if (mode === 7 /* AFTER_PATH */) {\r\n return keys;\r\n }\r\n }\r\n}\r\n// path token cache\r\nconst cache = new Map();\r\nfunction resolveValue(obj, path) {\r\n // check object\r\n if (!isObject(obj)) {\r\n return null;\r\n }\r\n // parse path\r\n let hit = cache.get(path);\r\n if (!hit) {\r\n hit = parse(path);\r\n if (hit) {\r\n cache.set(path, hit);\r\n }\r\n }\r\n // check hit\r\n if (!hit) {\r\n return null;\r\n }\r\n // resolve path value\r\n const len = hit.length;\r\n let last = obj;\r\n let i = 0;\r\n while (i < len) {\r\n const val = last[hit[i]];\r\n if (val === undefined) {\r\n return null;\r\n }\r\n last = val;\r\n i++;\r\n }\r\n return last;\r\n}\r\n/**\r\n * Transform flat json in obj to normal json in obj\r\n */\r\nfunction handleFlatJson(obj) {\r\n // check obj\r\n if (!isObject(obj)) {\r\n return obj;\r\n }\r\n for (const key in obj) {\r\n // check key\r\n if (!hasOwn(obj, key)) {\r\n continue;\r\n }\r\n // handle for normal json\r\n if (!key.includes(\".\" /* DOT */)) {\r\n // recursive process value if value is also a object\r\n if (isObject(obj[key])) {\r\n handleFlatJson(obj[key]);\r\n }\r\n }\r\n // handle for flat json, transform to normal json\r\n else {\r\n // go to the last object\r\n const subKeys = key.split(\".\" /* DOT */);\r\n const lastIndex = subKeys.length - 1;\r\n let currentObj = obj;\r\n for (let i = 0; i < lastIndex; i++) {\r\n if (!(subKeys[i] in currentObj)) {\r\n currentObj[subKeys[i]] = {};\r\n }\r\n currentObj = currentObj[subKeys[i]];\r\n }\r\n // update last object value, delete old property\r\n currentObj[subKeys[lastIndex]] = obj[key];\r\n delete obj[key];\r\n // recursive process value if value is also a object\r\n if (isObject(currentObj[subKeys[lastIndex]])) {\r\n handleFlatJson(currentObj[subKeys[lastIndex]]);\r\n }\r\n }\r\n }\r\n return obj;\r\n}\n\nexport { handleFlatJson, parse, resolveValue };\n","/*!\n * @intlify/runtime v9.1.9\n * (c) 2021 kazuya kawaguchi\n * Released under the MIT License.\n */\nimport { isNumber, isObject, isString, isFunction, isPlainObject, toDisplayString } from '@intlify/shared';\n\nconst DEFAULT_MODIFIER = (str) => str;\r\nconst DEFAULT_MESSAGE = (ctx) => ''; // eslint-disable-line\r\nconst DEFAULT_MESSAGE_DATA_TYPE = 'text';\r\nconst DEFAULT_NORMALIZE = (values) => values.length === 0 ? '' : values.join('');\r\nconst DEFAULT_INTERPOLATE = toDisplayString;\r\nfunction pluralDefault(choice, choicesLength) {\r\n choice = Math.abs(choice);\r\n if (choicesLength === 2) {\r\n // prettier-ignore\r\n return choice\r\n ? choice > 1\r\n ? 1\r\n : 0\r\n : 1;\r\n }\r\n return choice ? Math.min(choice, 2) : 0;\r\n}\r\nfunction getPluralIndex(options) {\r\n // prettier-ignore\r\n const index = isNumber(options.pluralIndex)\r\n ? options.pluralIndex\r\n : -1;\r\n // prettier-ignore\r\n return options.named && (isNumber(options.named.count) || isNumber(options.named.n))\r\n ? isNumber(options.named.count)\r\n ? options.named.count\r\n : isNumber(options.named.n)\r\n ? options.named.n\r\n : index\r\n : index;\r\n}\r\nfunction normalizeNamed(pluralIndex, props) {\r\n if (!props.count) {\r\n props.count = pluralIndex;\r\n }\r\n if (!props.n) {\r\n props.n = pluralIndex;\r\n }\r\n}\r\nfunction createMessageContext(options = {}) {\r\n const locale = options.locale;\r\n const pluralIndex = getPluralIndex(options);\r\n const pluralRule = isObject(options.pluralRules) &&\r\n isString(locale) &&\r\n isFunction(options.pluralRules[locale])\r\n ? options.pluralRules[locale]\r\n : pluralDefault;\r\n const orgPluralRule = isObject(options.pluralRules) &&\r\n isString(locale) &&\r\n isFunction(options.pluralRules[locale])\r\n ? pluralDefault\r\n : undefined;\r\n const plural = (messages) => messages[pluralRule(pluralIndex, messages.length, orgPluralRule)];\r\n const _list = options.list || [];\r\n const list = (index) => _list[index];\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n const _named = options.named || {};\r\n isNumber(options.pluralIndex) && normalizeNamed(pluralIndex, _named);\r\n const named = (key) => _named[key];\r\n // TODO: need to design resolve message function?\r\n function message(key) {\r\n // prettier-ignore\r\n const msg = isFunction(options.messages)\r\n ? options.messages(key)\r\n : isObject(options.messages)\r\n ? options.messages[key]\r\n : false;\r\n return !msg\r\n ? options.parent\r\n ? options.parent.message(key) // resolve from parent messages\r\n : DEFAULT_MESSAGE\r\n : msg;\r\n }\r\n const _modifier = (name) => options.modifiers\r\n ? options.modifiers[name]\r\n : DEFAULT_MODIFIER;\r\n const normalize = isPlainObject(options.processor) && isFunction(options.processor.normalize)\r\n ? options.processor.normalize\r\n : DEFAULT_NORMALIZE;\r\n const interpolate = isPlainObject(options.processor) &&\r\n isFunction(options.processor.interpolate)\r\n ? options.processor.interpolate\r\n : DEFAULT_INTERPOLATE;\r\n const type = isPlainObject(options.processor) && isString(options.processor.type)\r\n ? options.processor.type\r\n : DEFAULT_MESSAGE_DATA_TYPE;\r\n const ctx = {\r\n [\"list\" /* LIST */]: list,\r\n [\"named\" /* NAMED */]: named,\r\n [\"plural\" /* PLURAL */]: plural,\r\n [\"linked\" /* LINKED */]: (key, modifier) => {\r\n // TODO: should check `key`\r\n const msg = message(key)(ctx);\r\n return isString(modifier) ? _modifier(modifier)(msg) : msg;\r\n },\r\n [\"message\" /* MESSAGE */]: message,\r\n [\"type\" /* TYPE */]: type,\r\n [\"interpolate\" /* INTERPOLATE */]: interpolate,\r\n [\"normalize\" /* NORMALIZE */]: normalize\r\n };\r\n return ctx;\r\n}\n\nexport { DEFAULT_MESSAGE_DATA_TYPE, createMessageContext };\n","/*!\n * @intlify/devtools-if v9.1.9\n * (c) 2021 kazuya kawaguchi\n * Released under the MIT License.\n */\nconst IntlifyDevToolsHooks = {\r\n I18nInit: 'i18n:init',\r\n FunctionTranslate: 'function:translate'\r\n};\n\nexport { IntlifyDevToolsHooks };\n","/*!\n * @intlify/core-base v9.1.9\n * (c) 2021 kazuya kawaguchi\n * Released under the MIT License.\n */\nimport { format, isString, isArray, isPlainObject, assign, isFunction, isBoolean, isRegExp, warn, isObject, escapeHtml, inBrowser, mark, measure, generateCodeFrame, generateFormatCacheKey, isNumber, isEmptyObject, isDate, getGlobalThis } from '@intlify/shared';\nimport { resolveValue } from '@intlify/message-resolver';\nexport * from '@intlify/message-resolver';\nimport { createMessageContext } from '@intlify/runtime';\nexport * from '@intlify/runtime';\nimport { defaultOnError, baseCompile, createCompileError } from '@intlify/message-compiler';\nexport { createCompileError } from '@intlify/message-compiler';\nimport { IntlifyDevToolsHooks } from '@intlify/devtools-if';\n\nlet devtools = null;\r\nfunction setDevToolsHook(hook) {\r\n devtools = hook;\r\n}\r\nfunction getDevToolsHook() {\r\n return devtools;\r\n}\r\nfunction initI18nDevTools(i18n, version, meta) {\r\n // TODO: queue if devtools is undefined\r\n devtools &&\r\n devtools.emit(IntlifyDevToolsHooks.I18nInit, {\r\n timestamp: Date.now(),\r\n i18n,\r\n version,\r\n meta\r\n });\r\n}\r\nconst translateDevTools = /* #__PURE__*/ createDevToolsHook(IntlifyDevToolsHooks.FunctionTranslate);\r\nfunction createDevToolsHook(hook) {\r\n return (payloads) => devtools && devtools.emit(hook, payloads);\r\n}\n\n/** @internal */\r\nconst warnMessages = {\r\n [0 /* NOT_FOUND_KEY */]: `Not found '{key}' key in '{locale}' locale messages.`,\r\n [1 /* FALLBACK_TO_TRANSLATE */]: `Fall back to translate '{key}' key with '{target}' locale.`,\r\n [2 /* CANNOT_FORMAT_NUMBER */]: `Cannot format a number value due to not supported Intl.NumberFormat.`,\r\n [3 /* FALLBACK_TO_NUMBER_FORMAT */]: `Fall back to number format '{key}' key with '{target}' locale.`,\r\n [4 /* CANNOT_FORMAT_DATE */]: `Cannot format a date value due to not supported Intl.DateTimeFormat.`,\r\n [5 /* FALLBACK_TO_DATE_FORMAT */]: `Fall back to datetime format '{key}' key with '{target}' locale.`\r\n};\r\nfunction getWarnMessage(code, ...args) {\r\n return format(warnMessages[code], ...args);\r\n}\n\n/**\r\n * Intlify core-base version\r\n * @internal\r\n */\r\nconst VERSION = '9.1.9';\r\nconst NOT_REOSLVED = -1;\r\nconst MISSING_RESOLVE_VALUE = '';\r\nfunction getDefaultLinkedModifiers() {\r\n return {\r\n upper: (val) => (isString(val) ? val.toUpperCase() : val),\r\n lower: (val) => (isString(val) ? val.toLowerCase() : val),\r\n // prettier-ignore\r\n capitalize: (val) => (isString(val)\r\n ? `${val.charAt(0).toLocaleUpperCase()}${val.substr(1)}`\r\n : val)\r\n };\r\n}\r\nlet _compiler;\r\nfunction registerMessageCompiler(compiler) {\r\n _compiler = compiler;\r\n}\r\n// Additional Meta for Intlify DevTools\r\nlet _additionalMeta = null;\r\nconst setAdditionalMeta = /* #__PURE__*/ (meta) => {\r\n _additionalMeta = meta;\r\n};\r\nconst getAdditionalMeta = /* #__PURE__*/ () => _additionalMeta;\r\n// ID for CoreContext\r\nlet _cid = 0;\r\nfunction createCoreContext(options = {}) {\r\n // setup options\r\n const version = isString(options.version) ? options.version : VERSION;\r\n const locale = isString(options.locale) ? options.locale : 'en-US';\r\n const fallbackLocale = isArray(options.fallbackLocale) ||\r\n isPlainObject(options.fallbackLocale) ||\r\n isString(options.fallbackLocale) ||\r\n options.fallbackLocale === false\r\n ? options.fallbackLocale\r\n : locale;\r\n const messages = isPlainObject(options.messages)\r\n ? options.messages\r\n : { [locale]: {} };\r\n const datetimeFormats = isPlainObject(options.datetimeFormats)\r\n ? options.datetimeFormats\r\n : { [locale]: {} };\r\n const numberFormats = isPlainObject(options.numberFormats)\r\n ? options.numberFormats\r\n : { [locale]: {} };\r\n const modifiers = assign({}, options.modifiers || {}, getDefaultLinkedModifiers());\r\n const pluralRules = options.pluralRules || {};\r\n const missing = isFunction(options.missing) ? options.missing : null;\r\n const missingWarn = isBoolean(options.missingWarn) || isRegExp(options.missingWarn)\r\n ? options.missingWarn\r\n : true;\r\n const fallbackWarn = isBoolean(options.fallbackWarn) || isRegExp(options.fallbackWarn)\r\n ? options.fallbackWarn\r\n : true;\r\n const fallbackFormat = !!options.fallbackFormat;\r\n const unresolving = !!options.unresolving;\r\n const postTranslation = isFunction(options.postTranslation)\r\n ? options.postTranslation\r\n : null;\r\n const processor = isPlainObject(options.processor) ? options.processor : null;\r\n const warnHtmlMessage = isBoolean(options.warnHtmlMessage)\r\n ? options.warnHtmlMessage\r\n : true;\r\n const escapeParameter = !!options.escapeParameter;\r\n const messageCompiler = isFunction(options.messageCompiler)\r\n ? options.messageCompiler\r\n : _compiler;\r\n const onWarn = isFunction(options.onWarn) ? options.onWarn : warn;\r\n // setup internal options\r\n const internalOptions = options;\r\n const __datetimeFormatters = isObject(internalOptions.__datetimeFormatters)\r\n ? internalOptions.__datetimeFormatters\r\n : new Map();\r\n const __numberFormatters = isObject(internalOptions.__numberFormatters)\r\n ? internalOptions.__numberFormatters\r\n : new Map();\r\n const __meta = isObject(internalOptions.__meta) ? internalOptions.__meta : {};\r\n _cid++;\r\n const context = {\r\n version,\r\n cid: _cid,\r\n locale,\r\n fallbackLocale,\r\n messages,\r\n datetimeFormats,\r\n numberFormats,\r\n modifiers,\r\n pluralRules,\r\n missing,\r\n missingWarn,\r\n fallbackWarn,\r\n fallbackFormat,\r\n unresolving,\r\n postTranslation,\r\n processor,\r\n warnHtmlMessage,\r\n escapeParameter,\r\n messageCompiler,\r\n onWarn,\r\n __datetimeFormatters,\r\n __numberFormatters,\r\n __meta\r\n };\r\n // for vue-devtools timeline event\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n context.__v_emitter =\r\n internalOptions.__v_emitter != null\r\n ? internalOptions.__v_emitter\r\n : undefined;\r\n }\r\n // NOTE: experimental !!\r\n if ((process.env.NODE_ENV !== 'production') || __INTLIFY_PROD_DEVTOOLS__) {\r\n initI18nDevTools(context, version, __meta);\r\n }\r\n return context;\r\n}\r\n/** @internal */\r\nfunction isTranslateFallbackWarn(fallback, key) {\r\n return fallback instanceof RegExp ? fallback.test(key) : fallback;\r\n}\r\n/** @internal */\r\nfunction isTranslateMissingWarn(missing, key) {\r\n return missing instanceof RegExp ? missing.test(key) : missing;\r\n}\r\n/** @internal */\r\nfunction handleMissing(context, key, locale, missingWarn, type) {\r\n const { missing, onWarn } = context;\r\n // for vue-devtools timeline event\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n const emitter = context.__v_emitter;\r\n if (emitter) {\r\n emitter.emit(\"missing\" /* MISSING */, {\r\n locale,\r\n key,\r\n type,\r\n groupId: `${type}:${key}`\r\n });\r\n }\r\n }\r\n if (missing !== null) {\r\n const ret = missing(context, locale, key, type);\r\n return isString(ret) ? ret : key;\r\n }\r\n else {\r\n if ((process.env.NODE_ENV !== 'production') && isTranslateMissingWarn(missingWarn, key)) {\r\n onWarn(getWarnMessage(0 /* NOT_FOUND_KEY */, { key, locale }));\r\n }\r\n return key;\r\n }\r\n}\r\n/** @internal */\r\nfunction getLocaleChain(ctx, fallback, start) {\r\n const context = ctx;\r\n if (!context.__localeChainCache) {\r\n context.__localeChainCache = new Map();\r\n }\r\n let chain = context.__localeChainCache.get(start);\r\n if (!chain) {\r\n chain = [];\r\n // first block defined by start\r\n let block = [start];\r\n // while any intervening block found\r\n while (isArray(block)) {\r\n block = appendBlockToChain(chain, block, fallback);\r\n }\r\n // prettier-ignore\r\n // last block defined by default\r\n const defaults = isArray(fallback)\r\n ? fallback\r\n : isPlainObject(fallback)\r\n ? fallback['default']\r\n ? fallback['default']\r\n : null\r\n : fallback;\r\n // convert defaults to array\r\n block = isString(defaults) ? [defaults] : defaults;\r\n if (isArray(block)) {\r\n appendBlockToChain(chain, block, false);\r\n }\r\n context.__localeChainCache.set(start, chain);\r\n }\r\n return chain;\r\n}\r\nfunction appendBlockToChain(chain, block, blocks) {\r\n let follow = true;\r\n for (let i = 0; i < block.length && isBoolean(follow); i++) {\r\n const locale = block[i];\r\n if (isString(locale)) {\r\n follow = appendLocaleToChain(chain, block[i], blocks);\r\n }\r\n }\r\n return follow;\r\n}\r\nfunction appendLocaleToChain(chain, locale, blocks) {\r\n let follow;\r\n const tokens = locale.split('-');\r\n do {\r\n const target = tokens.join('-');\r\n follow = appendItemToChain(chain, target, blocks);\r\n tokens.splice(-1, 1);\r\n } while (tokens.length && follow === true);\r\n return follow;\r\n}\r\nfunction appendItemToChain(chain, target, blocks) {\r\n let follow = false;\r\n if (!chain.includes(target)) {\r\n follow = true;\r\n if (target) {\r\n follow = target[target.length - 1] !== '!';\r\n const locale = target.replace(/!/g, '');\r\n chain.push(locale);\r\n if ((isArray(blocks) || isPlainObject(blocks)) &&\r\n blocks[locale] // eslint-disable-line @typescript-eslint/no-explicit-any\r\n ) {\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n follow = blocks[locale];\r\n }\r\n }\r\n }\r\n return follow;\r\n}\r\n/** @internal */\r\nfunction updateFallbackLocale(ctx, locale, fallback) {\r\n const context = ctx;\r\n context.__localeChainCache = new Map();\r\n getLocaleChain(ctx, fallback, locale);\r\n}\n\nconst RE_HTML_TAG = /<\\/?[\\w\\s=\"/.':;#-\\/]+>/;\r\nconst WARN_MESSAGE = `Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.`;\r\nfunction checkHtmlMessage(source, options) {\r\n const warnHtmlMessage = isBoolean(options.warnHtmlMessage)\r\n ? options.warnHtmlMessage\r\n : true;\r\n if (warnHtmlMessage && RE_HTML_TAG.test(source)) {\r\n warn(format(WARN_MESSAGE, { source }));\r\n }\r\n}\r\nconst defaultOnCacheKey = (source) => source;\r\nlet compileCache = Object.create(null);\r\nfunction clearCompileCache() {\r\n compileCache = Object.create(null);\r\n}\r\nfunction compileToFunction(source, options = {}) {\r\n {\r\n // check HTML message\r\n (process.env.NODE_ENV !== 'production') && checkHtmlMessage(source, options);\r\n // check caches\r\n const onCacheKey = options.onCacheKey || defaultOnCacheKey;\r\n const key = onCacheKey(source);\r\n const cached = compileCache[key];\r\n if (cached) {\r\n return cached;\r\n }\r\n // compile error detecting\r\n let occurred = false;\r\n const onError = options.onError || defaultOnError;\r\n options.onError = (err) => {\r\n occurred = true;\r\n onError(err);\r\n };\r\n // compile\r\n const { code } = baseCompile(source, options);\r\n // evaluate function\r\n const msg = new Function(`return ${code}`)();\r\n // if occurred compile error, don't cache\r\n return !occurred ? (compileCache[key] = msg) : msg;\r\n }\r\n}\n\nfunction createCoreError(code) {\r\n return createCompileError(code, null, (process.env.NODE_ENV !== 'production') ? { messages: errorMessages } : undefined);\r\n}\r\n/** @internal */\r\nconst errorMessages = {\r\n [14 /* INVALID_ARGUMENT */]: 'Invalid arguments',\r\n [15 /* INVALID_DATE_ARGUMENT */]: 'The date provided is an invalid Date object.' +\r\n 'Make sure your Date represents a valid date.',\r\n [16 /* INVALID_ISO_DATE_ARGUMENT */]: 'The argument provided is not a valid ISO date string'\r\n};\n\nconst NOOP_MESSAGE_FUNCTION = () => '';\r\nconst isMessageFunction = (val) => isFunction(val);\r\n// implementation of `translate` function\r\nfunction translate(context, ...args) {\r\n const { fallbackFormat, postTranslation, unresolving, fallbackLocale, messages } = context;\r\n const [key, options] = parseTranslateArgs(...args);\r\n const missingWarn = isBoolean(options.missingWarn)\r\n ? options.missingWarn\r\n : context.missingWarn;\r\n const fallbackWarn = isBoolean(options.fallbackWarn)\r\n ? options.fallbackWarn\r\n : context.fallbackWarn;\r\n const escapeParameter = isBoolean(options.escapeParameter)\r\n ? options.escapeParameter\r\n : context.escapeParameter;\r\n const resolvedMessage = !!options.resolvedMessage;\r\n // prettier-ignore\r\n const defaultMsgOrKey = isString(options.default) || isBoolean(options.default) // default by function option\r\n ? !isBoolean(options.default)\r\n ? options.default\r\n : key\r\n : fallbackFormat // default by `fallbackFormat` option\r\n ? key\r\n : '';\r\n const enableDefaultMsg = fallbackFormat || defaultMsgOrKey !== '';\r\n const locale = isString(options.locale) ? options.locale : context.locale;\r\n // escape params\r\n escapeParameter && escapeParams(options);\r\n // resolve message format\r\n // eslint-disable-next-line prefer-const\r\n let [format, targetLocale, message] = !resolvedMessage\r\n ? resolveMessageFormat(context, key, locale, fallbackLocale, fallbackWarn, missingWarn)\r\n : [\r\n key,\r\n locale,\r\n messages[locale] || {}\r\n ];\r\n // if you use default message, set it as message format!\r\n let cacheBaseKey = key;\r\n if (!resolvedMessage &&\r\n !(isString(format) || isMessageFunction(format))) {\r\n if (enableDefaultMsg) {\r\n format = defaultMsgOrKey;\r\n cacheBaseKey = format;\r\n }\r\n }\r\n // checking message format and target locale\r\n if (!resolvedMessage &&\r\n (!(isString(format) || isMessageFunction(format)) ||\r\n !isString(targetLocale))) {\r\n return unresolving ? NOT_REOSLVED : key;\r\n }\r\n if ((process.env.NODE_ENV !== 'production') && isString(format) && context.messageCompiler == null) {\r\n warn(`The message format compilation is not supported in this build. ` +\r\n `Because message compiler isn't included. ` +\r\n `You need to pre-compilation all message format. ` +\r\n `So translate function return '${key}'.`);\r\n return key;\r\n }\r\n // setup compile error detecting\r\n let occurred = false;\r\n const errorDetector = () => {\r\n occurred = true;\r\n };\r\n // compile message format\r\n const msg = !isMessageFunction(format)\r\n ? compileMessageFormat(context, key, targetLocale, format, cacheBaseKey, errorDetector)\r\n : format;\r\n // if occurred compile error, return the message format\r\n if (occurred) {\r\n return format;\r\n }\r\n // evaluate message with context\r\n const ctxOptions = getMessageContextOptions(context, targetLocale, message, options);\r\n const msgContext = createMessageContext(ctxOptions);\r\n const messaged = evaluateMessage(context, msg, msgContext);\r\n // if use post translation option, proceed it with handler\r\n const ret = postTranslation ? postTranslation(messaged) : messaged;\r\n // NOTE: experimental !!\r\n if ((process.env.NODE_ENV !== 'production') || __INTLIFY_PROD_DEVTOOLS__) {\r\n // prettier-ignore\r\n const payloads = {\r\n timestamp: Date.now(),\r\n key: isString(key)\r\n ? key\r\n : isMessageFunction(format)\r\n ? format.key\r\n : '',\r\n locale: targetLocale || (isMessageFunction(format)\r\n ? format.locale\r\n : ''),\r\n format: isString(format)\r\n ? format\r\n : isMessageFunction(format)\r\n ? format.source\r\n : '',\r\n message: ret\r\n };\r\n payloads.meta = assign({}, context.__meta, getAdditionalMeta() || {});\r\n translateDevTools(payloads);\r\n }\r\n return ret;\r\n}\r\nfunction escapeParams(options) {\r\n if (isArray(options.list)) {\r\n options.list = options.list.map(item => isString(item) ? escapeHtml(item) : item);\r\n }\r\n else if (isObject(options.named)) {\r\n Object.keys(options.named).forEach(key => {\r\n if (isString(options.named[key])) {\r\n options.named[key] = escapeHtml(options.named[key]);\r\n }\r\n });\r\n }\r\n}\r\nfunction resolveMessageFormat(context, key, locale, fallbackLocale, fallbackWarn, missingWarn) {\r\n const { messages, onWarn } = context;\r\n const locales = getLocaleChain(context, fallbackLocale, locale);\r\n let message = {};\r\n let targetLocale;\r\n let format = null;\r\n let from = locale;\r\n let to = null;\r\n const type = 'translate';\r\n for (let i = 0; i < locales.length; i++) {\r\n targetLocale = to = locales[i];\r\n if ((process.env.NODE_ENV !== 'production') &&\r\n locale !== targetLocale &&\r\n isTranslateFallbackWarn(fallbackWarn, key)) {\r\n onWarn(getWarnMessage(1 /* FALLBACK_TO_TRANSLATE */, {\r\n key,\r\n target: targetLocale\r\n }));\r\n }\r\n // for vue-devtools timeline event\r\n if ((process.env.NODE_ENV !== 'production') && locale !== targetLocale) {\r\n const emitter = context.__v_emitter;\r\n if (emitter) {\r\n emitter.emit(\"fallback\" /* FALBACK */, {\r\n type,\r\n key,\r\n from,\r\n to,\r\n groupId: `${type}:${key}`\r\n });\r\n }\r\n }\r\n message =\r\n messages[targetLocale] || {};\r\n // for vue-devtools timeline event\r\n let start = null;\r\n let startTag;\r\n let endTag;\r\n if ((process.env.NODE_ENV !== 'production') && inBrowser) {\r\n start = window.performance.now();\r\n startTag = 'intlify-message-resolve-start';\r\n endTag = 'intlify-message-resolve-end';\r\n mark && mark(startTag);\r\n }\r\n if ((format = resolveValue(message, key)) === null) {\r\n // if null, resolve with object key path\r\n format = message[key]; // eslint-disable-line @typescript-eslint/no-explicit-any\r\n }\r\n // for vue-devtools timeline event\r\n if ((process.env.NODE_ENV !== 'production') && inBrowser) {\r\n const end = window.performance.now();\r\n const emitter = context.__v_emitter;\r\n if (emitter && start && format) {\r\n emitter.emit(\"message-resolve\" /* MESSAGE_RESOLVE */, {\r\n type: \"message-resolve\" /* MESSAGE_RESOLVE */,\r\n key,\r\n message: format,\r\n time: end - start,\r\n groupId: `${type}:${key}`\r\n });\r\n }\r\n if (startTag && endTag && mark && measure) {\r\n mark(endTag);\r\n measure('intlify message resolve', startTag, endTag);\r\n }\r\n }\r\n if (isString(format) || isFunction(format))\r\n break;\r\n const missingRet = handleMissing(context, key, targetLocale, missingWarn, type);\r\n if (missingRet !== key) {\r\n format = missingRet;\r\n }\r\n from = to;\r\n }\r\n return [format, targetLocale, message];\r\n}\r\nfunction compileMessageFormat(context, key, targetLocale, format, cacheBaseKey, errorDetector) {\r\n const { messageCompiler, warnHtmlMessage } = context;\r\n if (isMessageFunction(format)) {\r\n const msg = format;\r\n msg.locale = msg.locale || targetLocale;\r\n msg.key = msg.key || key;\r\n return msg;\r\n }\r\n // for vue-devtools timeline event\r\n let start = null;\r\n let startTag;\r\n let endTag;\r\n if ((process.env.NODE_ENV !== 'production') && inBrowser) {\r\n start = window.performance.now();\r\n startTag = 'intlify-message-compilation-start';\r\n endTag = 'intlify-message-compilation-end';\r\n mark && mark(startTag);\r\n }\r\n const msg = messageCompiler(format, getCompileOptions(context, targetLocale, cacheBaseKey, format, warnHtmlMessage, errorDetector));\r\n // for vue-devtools timeline event\r\n if ((process.env.NODE_ENV !== 'production') && inBrowser) {\r\n const end = window.performance.now();\r\n const emitter = context.__v_emitter;\r\n if (emitter && start) {\r\n emitter.emit(\"message-compilation\" /* MESSAGE_COMPILATION */, {\r\n type: \"message-compilation\" /* MESSAGE_COMPILATION */,\r\n message: format,\r\n time: end - start,\r\n groupId: `${'translate'}:${key}`\r\n });\r\n }\r\n if (startTag && endTag && mark && measure) {\r\n mark(endTag);\r\n measure('intlify message compilation', startTag, endTag);\r\n }\r\n }\r\n msg.locale = targetLocale;\r\n msg.key = key;\r\n msg.source = format;\r\n return msg;\r\n}\r\nfunction evaluateMessage(context, msg, msgCtx) {\r\n // for vue-devtools timeline event\r\n let start = null;\r\n let startTag;\r\n let endTag;\r\n if ((process.env.NODE_ENV !== 'production') && inBrowser) {\r\n start = window.performance.now();\r\n startTag = 'intlify-message-evaluation-start';\r\n endTag = 'intlify-message-evaluation-end';\r\n mark && mark(startTag);\r\n }\r\n const messaged = msg(msgCtx);\r\n // for vue-devtools timeline event\r\n if ((process.env.NODE_ENV !== 'production') && inBrowser) {\r\n const end = window.performance.now();\r\n const emitter = context.__v_emitter;\r\n if (emitter && start) {\r\n emitter.emit(\"message-evaluation\" /* MESSAGE_EVALUATION */, {\r\n type: \"message-evaluation\" /* MESSAGE_EVALUATION */,\r\n value: messaged,\r\n time: end - start,\r\n groupId: `${'translate'}:${msg.key}`\r\n });\r\n }\r\n if (startTag && endTag && mark && measure) {\r\n mark(endTag);\r\n measure('intlify message evaluation', startTag, endTag);\r\n }\r\n }\r\n return messaged;\r\n}\r\n/** @internal */\r\nfunction parseTranslateArgs(...args) {\r\n const [arg1, arg2, arg3] = args;\r\n const options = {};\r\n if (!isString(arg1) && !isNumber(arg1) && !isMessageFunction(arg1)) {\r\n throw createCoreError(14 /* INVALID_ARGUMENT */);\r\n }\r\n // prettier-ignore\r\n const key = isNumber(arg1)\r\n ? String(arg1)\r\n : isMessageFunction(arg1)\r\n ? arg1\r\n : arg1;\r\n if (isNumber(arg2)) {\r\n options.plural = arg2;\r\n }\r\n else if (isString(arg2)) {\r\n options.default = arg2;\r\n }\r\n else if (isPlainObject(arg2) && !isEmptyObject(arg2)) {\r\n options.named = arg2;\r\n }\r\n else if (isArray(arg2)) {\r\n options.list = arg2;\r\n }\r\n if (isNumber(arg3)) {\r\n options.plural = arg3;\r\n }\r\n else if (isString(arg3)) {\r\n options.default = arg3;\r\n }\r\n else if (isPlainObject(arg3)) {\r\n assign(options, arg3);\r\n }\r\n return [key, options];\r\n}\r\nfunction getCompileOptions(context, locale, key, source, warnHtmlMessage, errorDetector) {\r\n return {\r\n warnHtmlMessage,\r\n onError: (err) => {\r\n errorDetector && errorDetector(err);\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n const message = `Message compilation error: ${err.message}`;\r\n const codeFrame = err.location &&\r\n generateCodeFrame(source, err.location.start.offset, err.location.end.offset);\r\n const emitter = context\r\n .__v_emitter;\r\n if (emitter) {\r\n emitter.emit(\"compile-error\" /* COMPILE_ERROR */, {\r\n message: source,\r\n error: err.message,\r\n start: err.location && err.location.start.offset,\r\n end: err.location && err.location.end.offset,\r\n groupId: `${'translate'}:${key}`\r\n });\r\n }\r\n console.error(codeFrame ? `${message}\\n${codeFrame}` : message);\r\n }\r\n else {\r\n throw err;\r\n }\r\n },\r\n onCacheKey: (source) => generateFormatCacheKey(locale, key, source)\r\n };\r\n}\r\nfunction getMessageContextOptions(context, locale, message, options) {\r\n const { modifiers, pluralRules } = context;\r\n const resolveMessage = (key) => {\r\n const val = resolveValue(message, key);\r\n if (isString(val)) {\r\n let occurred = false;\r\n const errorDetector = () => {\r\n occurred = true;\r\n };\r\n const msg = compileMessageFormat(context, key, locale, val, key, errorDetector);\r\n return !occurred\r\n ? msg\r\n : NOOP_MESSAGE_FUNCTION;\r\n }\r\n else if (isMessageFunction(val)) {\r\n return val;\r\n }\r\n else {\r\n // TODO: should be implemented warning message\r\n return NOOP_MESSAGE_FUNCTION;\r\n }\r\n };\r\n const ctxOptions = {\r\n locale,\r\n modifiers,\r\n pluralRules,\r\n messages: resolveMessage\r\n };\r\n if (context.processor) {\r\n ctxOptions.processor = context.processor;\r\n }\r\n if (options.list) {\r\n ctxOptions.list = options.list;\r\n }\r\n if (options.named) {\r\n ctxOptions.named = options.named;\r\n }\r\n if (isNumber(options.plural)) {\r\n ctxOptions.pluralIndex = options.plural;\r\n }\r\n return ctxOptions;\r\n}\n\nconst intlDefined = typeof Intl !== 'undefined';\r\nconst Availabilities = {\r\n dateTimeFormat: intlDefined && typeof Intl.DateTimeFormat !== 'undefined',\r\n numberFormat: intlDefined && typeof Intl.NumberFormat !== 'undefined'\r\n};\n\n// implementation of `datetime` function\r\nfunction datetime(context, ...args) {\r\n const { datetimeFormats, unresolving, fallbackLocale, onWarn } = context;\r\n const { __datetimeFormatters } = context;\r\n if ((process.env.NODE_ENV !== 'production') && !Availabilities.dateTimeFormat) {\r\n onWarn(getWarnMessage(4 /* CANNOT_FORMAT_DATE */));\r\n return MISSING_RESOLVE_VALUE;\r\n }\r\n const [key, value, options, overrides] = parseDateTimeArgs(...args);\r\n const missingWarn = isBoolean(options.missingWarn)\r\n ? options.missingWarn\r\n : context.missingWarn;\r\n const fallbackWarn = isBoolean(options.fallbackWarn)\r\n ? options.fallbackWarn\r\n : context.fallbackWarn;\r\n const part = !!options.part;\r\n const locale = isString(options.locale) ? options.locale : context.locale;\r\n const locales = getLocaleChain(context, fallbackLocale, locale);\r\n if (!isString(key) || key === '') {\r\n return new Intl.DateTimeFormat(locale).format(value);\r\n }\r\n // resolve format\r\n let datetimeFormat = {};\r\n let targetLocale;\r\n let format = null;\r\n let from = locale;\r\n let to = null;\r\n const type = 'datetime format';\r\n for (let i = 0; i < locales.length; i++) {\r\n targetLocale = to = locales[i];\r\n if ((process.env.NODE_ENV !== 'production') &&\r\n locale !== targetLocale &&\r\n isTranslateFallbackWarn(fallbackWarn, key)) {\r\n onWarn(getWarnMessage(5 /* FALLBACK_TO_DATE_FORMAT */, {\r\n key,\r\n target: targetLocale\r\n }));\r\n }\r\n // for vue-devtools timeline event\r\n if ((process.env.NODE_ENV !== 'production') && locale !== targetLocale) {\r\n const emitter = context.__v_emitter;\r\n if (emitter) {\r\n emitter.emit(\"fallback\" /* FALBACK */, {\r\n type,\r\n key,\r\n from,\r\n to,\r\n groupId: `${type}:${key}`\r\n });\r\n }\r\n }\r\n datetimeFormat =\r\n datetimeFormats[targetLocale] || {};\r\n format = datetimeFormat[key];\r\n if (isPlainObject(format))\r\n break;\r\n handleMissing(context, key, targetLocale, missingWarn, type);\r\n from = to;\r\n }\r\n // checking format and target locale\r\n if (!isPlainObject(format) || !isString(targetLocale)) {\r\n return unresolving ? NOT_REOSLVED : key;\r\n }\r\n let id = `${targetLocale}__${key}`;\r\n if (!isEmptyObject(overrides)) {\r\n id = `${id}__${JSON.stringify(overrides)}`;\r\n }\r\n let formatter = __datetimeFormatters.get(id);\r\n if (!formatter) {\r\n formatter = new Intl.DateTimeFormat(targetLocale, assign({}, format, overrides));\r\n __datetimeFormatters.set(id, formatter);\r\n }\r\n return !part ? formatter.format(value) : formatter.formatToParts(value);\r\n}\r\n/** @internal */\r\nfunction parseDateTimeArgs(...args) {\r\n const [arg1, arg2, arg3, arg4] = args;\r\n let options = {};\r\n let overrides = {};\r\n let value;\r\n if (isString(arg1)) {\r\n // Only allow ISO strings - other date formats are often supported,\r\n // but may cause different results in different browsers.\r\n if (!/\\d{4}-\\d{2}-\\d{2}(T.*)?/.test(arg1)) {\r\n throw createCoreError(16 /* INVALID_ISO_DATE_ARGUMENT */);\r\n }\r\n value = new Date(arg1);\r\n try {\r\n // This will fail if the date is not valid\r\n value.toISOString();\r\n }\r\n catch (e) {\r\n throw createCoreError(16 /* INVALID_ISO_DATE_ARGUMENT */);\r\n }\r\n }\r\n else if (isDate(arg1)) {\r\n if (isNaN(arg1.getTime())) {\r\n throw createCoreError(15 /* INVALID_DATE_ARGUMENT */);\r\n }\r\n value = arg1;\r\n }\r\n else if (isNumber(arg1)) {\r\n value = arg1;\r\n }\r\n else {\r\n throw createCoreError(14 /* INVALID_ARGUMENT */);\r\n }\r\n if (isString(arg2)) {\r\n options.key = arg2;\r\n }\r\n else if (isPlainObject(arg2)) {\r\n options = arg2;\r\n }\r\n if (isString(arg3)) {\r\n options.locale = arg3;\r\n }\r\n else if (isPlainObject(arg3)) {\r\n overrides = arg3;\r\n }\r\n if (isPlainObject(arg4)) {\r\n overrides = arg4;\r\n }\r\n return [options.key || '', value, options, overrides];\r\n}\r\n/** @internal */\r\nfunction clearDateTimeFormat(ctx, locale, format) {\r\n const context = ctx;\r\n for (const key in format) {\r\n const id = `${locale}__${key}`;\r\n if (!context.__datetimeFormatters.has(id)) {\r\n continue;\r\n }\r\n context.__datetimeFormatters.delete(id);\r\n }\r\n}\n\n// implementation of `number` function\r\nfunction number(context, ...args) {\r\n const { numberFormats, unresolving, fallbackLocale, onWarn } = context;\r\n const { __numberFormatters } = context;\r\n if ((process.env.NODE_ENV !== 'production') && !Availabilities.numberFormat) {\r\n onWarn(getWarnMessage(2 /* CANNOT_FORMAT_NUMBER */));\r\n return MISSING_RESOLVE_VALUE;\r\n }\r\n const [key, value, options, overrides] = parseNumberArgs(...args);\r\n const missingWarn = isBoolean(options.missingWarn)\r\n ? options.missingWarn\r\n : context.missingWarn;\r\n const fallbackWarn = isBoolean(options.fallbackWarn)\r\n ? options.fallbackWarn\r\n : context.fallbackWarn;\r\n const part = !!options.part;\r\n const locale = isString(options.locale) ? options.locale : context.locale;\r\n const locales = getLocaleChain(context, fallbackLocale, locale);\r\n if (!isString(key) || key === '') {\r\n return new Intl.NumberFormat(locale).format(value);\r\n }\r\n // resolve format\r\n let numberFormat = {};\r\n let targetLocale;\r\n let format = null;\r\n let from = locale;\r\n let to = null;\r\n const type = 'number format';\r\n for (let i = 0; i < locales.length; i++) {\r\n targetLocale = to = locales[i];\r\n if ((process.env.NODE_ENV !== 'production') &&\r\n locale !== targetLocale &&\r\n isTranslateFallbackWarn(fallbackWarn, key)) {\r\n onWarn(getWarnMessage(3 /* FALLBACK_TO_NUMBER_FORMAT */, {\r\n key,\r\n target: targetLocale\r\n }));\r\n }\r\n // for vue-devtools timeline event\r\n if ((process.env.NODE_ENV !== 'production') && locale !== targetLocale) {\r\n const emitter = context.__v_emitter;\r\n if (emitter) {\r\n emitter.emit(\"fallback\" /* FALBACK */, {\r\n type,\r\n key,\r\n from,\r\n to,\r\n groupId: `${type}:${key}`\r\n });\r\n }\r\n }\r\n numberFormat =\r\n numberFormats[targetLocale] || {};\r\n format = numberFormat[key];\r\n if (isPlainObject(format))\r\n break;\r\n handleMissing(context, key, targetLocale, missingWarn, type);\r\n from = to;\r\n }\r\n // checking format and target locale\r\n if (!isPlainObject(format) || !isString(targetLocale)) {\r\n return unresolving ? NOT_REOSLVED : key;\r\n }\r\n let id = `${targetLocale}__${key}`;\r\n if (!isEmptyObject(overrides)) {\r\n id = `${id}__${JSON.stringify(overrides)}`;\r\n }\r\n let formatter = __numberFormatters.get(id);\r\n if (!formatter) {\r\n formatter = new Intl.NumberFormat(targetLocale, assign({}, format, overrides));\r\n __numberFormatters.set(id, formatter);\r\n }\r\n return !part ? formatter.format(value) : formatter.formatToParts(value);\r\n}\r\n/** @internal */\r\nfunction parseNumberArgs(...args) {\r\n const [arg1, arg2, arg3, arg4] = args;\r\n let options = {};\r\n let overrides = {};\r\n if (!isNumber(arg1)) {\r\n throw createCoreError(14 /* INVALID_ARGUMENT */);\r\n }\r\n const value = arg1;\r\n if (isString(arg2)) {\r\n options.key = arg2;\r\n }\r\n else if (isPlainObject(arg2)) {\r\n options = arg2;\r\n }\r\n if (isString(arg3)) {\r\n options.locale = arg3;\r\n }\r\n else if (isPlainObject(arg3)) {\r\n overrides = arg3;\r\n }\r\n if (isPlainObject(arg4)) {\r\n overrides = arg4;\r\n }\r\n return [options.key || '', value, options, overrides];\r\n}\r\n/** @internal */\r\nfunction clearNumberFormat(ctx, locale, format) {\r\n const context = ctx;\r\n for (const key in format) {\r\n const id = `${locale}__${key}`;\r\n if (!context.__numberFormatters.has(id)) {\r\n continue;\r\n }\r\n context.__numberFormatters.delete(id);\r\n }\r\n}\n\n{\r\n if (typeof __INTLIFY_PROD_DEVTOOLS__ !== 'boolean') {\r\n getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false;\r\n }\r\n}\n\nexport { MISSING_RESOLVE_VALUE, NOT_REOSLVED, VERSION, clearCompileCache, clearDateTimeFormat, clearNumberFormat, compileToFunction, createCoreContext, createCoreError, datetime, getAdditionalMeta, getDevToolsHook, getLocaleChain, getWarnMessage, handleMissing, initI18nDevTools, isMessageFunction, isTranslateFallbackWarn, isTranslateMissingWarn, number, parseDateTimeArgs, parseNumberArgs, parseTranslateArgs, registerMessageCompiler, setAdditionalMeta, setDevToolsHook, translate, translateDevTools, updateFallbackLocale };\n","/*!\n * @intlify/vue-devtools v9.1.9\n * (c) 2021 kazuya kawaguchi\n * Released under the MIT License.\n */\nconst VueDevToolsLabels = {\r\n [\"vue-devtools-plugin-vue-i18n\" /* PLUGIN */]: 'Vue I18n devtools',\r\n [\"vue-i18n-resource-inspector\" /* CUSTOM_INSPECTOR */]: 'I18n Resources',\r\n [\"vue-i18n-timeline\" /* TIMELINE */]: 'Vue I18n'\r\n};\r\nconst VueDevToolsPlaceholders = {\r\n [\"vue-i18n-resource-inspector\" /* CUSTOM_INSPECTOR */]: 'Search for scopes ...'\r\n};\r\nconst VueDevToolsTimelineColors = {\r\n [\"vue-i18n-timeline\" /* TIMELINE */]: 0xffcd19\r\n};\n\nexport { VueDevToolsLabels, VueDevToolsPlaceholders, VueDevToolsTimelineColors };\n","/*!\n * @intlify/shared v9.1.9\n * (c) 2021 kazuya kawaguchi\n * Released under the MIT License.\n */\n/**\r\n * Original Utilities\r\n * written by kazuya kawaguchi\r\n */\r\nconst inBrowser = typeof window !== 'undefined';\r\nlet mark;\r\nlet measure;\r\nif ((process.env.NODE_ENV !== 'production')) {\r\n const perf = inBrowser && window.performance;\r\n if (perf &&\r\n perf.mark &&\r\n perf.measure &&\r\n perf.clearMarks &&\r\n perf.clearMeasures) {\r\n mark = (tag) => perf.mark(tag);\r\n measure = (name, startTag, endTag) => {\r\n perf.measure(name, startTag, endTag);\r\n perf.clearMarks(startTag);\r\n perf.clearMarks(endTag);\r\n };\r\n }\r\n}\r\nconst RE_ARGS = /\\{([0-9a-zA-Z]+)\\}/g;\r\n/* eslint-disable */\r\nfunction format(message, ...args) {\r\n if (args.length === 1 && isObject(args[0])) {\r\n args = args[0];\r\n }\r\n if (!args || !args.hasOwnProperty) {\r\n args = {};\r\n }\r\n return message.replace(RE_ARGS, (match, identifier) => {\r\n return args.hasOwnProperty(identifier) ? args[identifier] : '';\r\n });\r\n}\r\nconst hasSymbol = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';\r\nconst makeSymbol = (name) => hasSymbol ? Symbol(name) : name;\r\nconst generateFormatCacheKey = (locale, key, source) => friendlyJSONstringify({ l: locale, k: key, s: source });\r\nconst friendlyJSONstringify = (json) => JSON.stringify(json)\r\n .replace(/\\u2028/g, '\\\\u2028')\r\n .replace(/\\u2029/g, '\\\\u2029')\r\n .replace(/\\u0027/g, '\\\\u0027');\r\nconst isNumber = (val) => typeof val === 'number' && isFinite(val);\r\nconst isDate = (val) => toTypeString(val) === '[object Date]';\r\nconst isRegExp = (val) => toTypeString(val) === '[object RegExp]';\r\nconst isEmptyObject = (val) => isPlainObject(val) && Object.keys(val).length === 0;\r\nfunction warn(msg, err) {\r\n if (typeof console !== 'undefined') {\r\n console.warn(`[intlify] ` + msg);\r\n /* istanbul ignore if */\r\n if (err) {\r\n console.warn(err.stack);\r\n }\r\n }\r\n}\r\nconst assign = Object.assign;\r\nlet _globalThis;\r\nconst getGlobalThis = () => {\r\n // prettier-ignore\r\n return (_globalThis ||\r\n (_globalThis =\r\n typeof globalThis !== 'undefined'\r\n ? globalThis\r\n : typeof self !== 'undefined'\r\n ? self\r\n : typeof window !== 'undefined'\r\n ? window\r\n : typeof global !== 'undefined'\r\n ? global\r\n : {}));\r\n};\r\nfunction escapeHtml(rawText) {\r\n return rawText\r\n .replace(//g, '>')\r\n .replace(/\"/g, '"')\r\n .replace(/'/g, ''');\r\n}\r\nconst hasOwnProperty = Object.prototype.hasOwnProperty;\r\nfunction hasOwn(obj, key) {\r\n return hasOwnProperty.call(obj, key);\r\n}\r\n/* eslint-enable */\r\n/**\r\n * Useful Utilities By Evan you\r\n * Modified by kazuya kawaguchi\r\n * MIT License\r\n * https://github.com/vuejs/vue-next/blob/master/packages/shared/src/index.ts\r\n * https://github.com/vuejs/vue-next/blob/master/packages/shared/src/codeframe.ts\r\n */\r\nconst isArray = Array.isArray;\r\nconst isFunction = (val) => typeof val === 'function';\r\nconst isString = (val) => typeof val === 'string';\r\nconst isBoolean = (val) => typeof val === 'boolean';\r\nconst isSymbol = (val) => typeof val === 'symbol';\r\nconst isObject = (val) => // eslint-disable-line\r\n val !== null && typeof val === 'object';\r\nconst isPromise = (val) => {\r\n return isObject(val) && isFunction(val.then) && isFunction(val.catch);\r\n};\r\nconst objectToString = Object.prototype.toString;\r\nconst toTypeString = (value) => objectToString.call(value);\r\nconst isPlainObject = (val) => toTypeString(val) === '[object Object]';\r\n// for converting list and named values to displayed strings.\r\nconst toDisplayString = (val) => {\r\n return val == null\r\n ? ''\r\n : isArray(val) || (isPlainObject(val) && val.toString === objectToString)\r\n ? JSON.stringify(val, null, 2)\r\n : String(val);\r\n};\r\nconst RANGE = 2;\r\nfunction generateCodeFrame(source, start = 0, end = source.length) {\r\n const lines = source.split(/\\r?\\n/);\r\n let count = 0;\r\n const res = [];\r\n for (let i = 0; i < lines.length; i++) {\r\n count += lines[i].length + 1;\r\n if (count >= start) {\r\n for (let j = i - RANGE; j <= i + RANGE || end > count; j++) {\r\n if (j < 0 || j >= lines.length)\r\n continue;\r\n const line = j + 1;\r\n res.push(`${line}${' '.repeat(3 - String(line).length)}| ${lines[j]}`);\r\n const lineLength = lines[j].length;\r\n if (j === i) {\r\n // push underline\r\n const pad = start - (count - lineLength) + 1;\r\n const length = Math.max(1, end > count ? lineLength - pad : end - start);\r\n res.push(` | ` + ' '.repeat(pad) + '^'.repeat(length));\r\n }\r\n else if (j > i) {\r\n if (end > count) {\r\n const length = Math.max(Math.min(end - count, lineLength), 1);\r\n res.push(` | ` + '^'.repeat(length));\r\n }\r\n count += lineLength + 1;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n return res.join('\\n');\r\n}\n\n/**\r\n * Event emitter, forked from the below:\r\n * - original repository url: https://github.com/developit/mitt\r\n * - code url: https://github.com/developit/mitt/blob/master/src/index.ts\r\n * - author: Jason Miller (https://github.com/developit)\r\n * - license: MIT\r\n */\r\n/**\r\n * Create a event emitter\r\n *\r\n * @returns An event emitter\r\n */\r\nfunction createEmitter() {\r\n const events = new Map();\r\n const emitter = {\r\n events,\r\n on(event, handler) {\r\n const handlers = events.get(event);\r\n const added = handlers && handlers.push(handler);\r\n if (!added) {\r\n events.set(event, [handler]);\r\n }\r\n },\r\n off(event, handler) {\r\n const handlers = events.get(event);\r\n if (handlers) {\r\n handlers.splice(handlers.indexOf(handler) >>> 0, 1);\r\n }\r\n },\r\n emit(event, payload) {\r\n (events.get(event) || [])\r\n .slice()\r\n .map(handler => handler(payload));\r\n (events.get('*') || [])\r\n .slice()\r\n .map(handler => handler(event, payload));\r\n }\r\n };\r\n return emitter;\r\n}\n\nexport { assign, createEmitter, escapeHtml, format, friendlyJSONstringify, generateCodeFrame, generateFormatCacheKey, getGlobalThis, hasOwn, inBrowser, isArray, isBoolean, isDate, isEmptyObject, isFunction, isNumber, isObject, isPlainObject, isPromise, isRegExp, isString, isSymbol, makeSymbol, mark, measure, objectToString, toDisplayString, toTypeString, warn };\n","/*!\n * @intlify/message-compiler v9.1.9\n * (c) 2021 kazuya kawaguchi\n * Released under the MIT License.\n */\nimport { format, assign, isString } from '@intlify/shared';\n\n/** @internal */\r\nconst errorMessages = {\r\n // tokenizer error messages\r\n [0 /* EXPECTED_TOKEN */]: `Expected token: '{0}'`,\r\n [1 /* INVALID_TOKEN_IN_PLACEHOLDER */]: `Invalid token in placeholder: '{0}'`,\r\n [2 /* UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER */]: `Unterminated single quote in placeholder`,\r\n [3 /* UNKNOWN_ESCAPE_SEQUENCE */]: `Unknown escape sequence: \\\\{0}`,\r\n [4 /* INVALID_UNICODE_ESCAPE_SEQUENCE */]: `Invalid unicode escape sequence: {0}`,\r\n [5 /* UNBALANCED_CLOSING_BRACE */]: `Unbalanced closing brace`,\r\n [6 /* UNTERMINATED_CLOSING_BRACE */]: `Unterminated closing brace`,\r\n [7 /* EMPTY_PLACEHOLDER */]: `Empty placeholder`,\r\n [8 /* NOT_ALLOW_NEST_PLACEHOLDER */]: `Not allowed nest placeholder`,\r\n [9 /* INVALID_LINKED_FORMAT */]: `Invalid linked format`,\r\n // parser error messages\r\n [10 /* MUST_HAVE_MESSAGES_IN_PLURAL */]: `Plural must have messages`,\r\n [11 /* UNEXPECTED_EMPTY_LINKED_MODIFIER */]: `Unexpected empty linked modifier`,\r\n [12 /* UNEXPECTED_EMPTY_LINKED_KEY */]: `Unexpected empty linked key`,\r\n [13 /* UNEXPECTED_LEXICAL_ANALYSIS */]: `Unexpected lexical analysis in token: '{0}'`\r\n};\r\nfunction createCompileError(code, loc, options = {}) {\r\n const { domain, messages, args } = options;\r\n const msg = (process.env.NODE_ENV !== 'production')\r\n ? format((messages || errorMessages)[code] || '', ...(args || []))\r\n : code;\r\n const error = new SyntaxError(String(msg));\r\n error.code = code;\r\n if (loc) {\r\n error.location = loc;\r\n }\r\n error.domain = domain;\r\n return error;\r\n}\r\n/** @internal */\r\nfunction defaultOnError(error) {\r\n throw error;\r\n}\n\nconst LocationStub = {\r\n start: { line: 1, column: 1, offset: 0 },\r\n end: { line: 1, column: 1, offset: 0 }\r\n};\r\nfunction createPosition(line, column, offset) {\r\n return { line, column, offset };\r\n}\r\nfunction createLocation(start, end, source) {\r\n const loc = { start, end };\r\n if (source != null) {\r\n loc.source = source;\r\n }\r\n return loc;\r\n}\n\nconst CHAR_SP = ' ';\r\nconst CHAR_CR = '\\r';\r\nconst CHAR_LF = '\\n';\r\nconst CHAR_LS = String.fromCharCode(0x2028);\r\nconst CHAR_PS = String.fromCharCode(0x2029);\r\nfunction createScanner(str) {\r\n const _buf = str;\r\n let _index = 0;\r\n let _line = 1;\r\n let _column = 1;\r\n let _peekOffset = 0;\r\n const isCRLF = (index) => _buf[index] === CHAR_CR && _buf[index + 1] === CHAR_LF;\r\n const isLF = (index) => _buf[index] === CHAR_LF;\r\n const isPS = (index) => _buf[index] === CHAR_PS;\r\n const isLS = (index) => _buf[index] === CHAR_LS;\r\n const isLineEnd = (index) => isCRLF(index) || isLF(index) || isPS(index) || isLS(index);\r\n const index = () => _index;\r\n const line = () => _line;\r\n const column = () => _column;\r\n const peekOffset = () => _peekOffset;\r\n const charAt = (offset) => isCRLF(offset) || isPS(offset) || isLS(offset) ? CHAR_LF : _buf[offset];\r\n const currentChar = () => charAt(_index);\r\n const currentPeek = () => charAt(_index + _peekOffset);\r\n function next() {\r\n _peekOffset = 0;\r\n if (isLineEnd(_index)) {\r\n _line++;\r\n _column = 0;\r\n }\r\n if (isCRLF(_index)) {\r\n _index++;\r\n }\r\n _index++;\r\n _column++;\r\n return _buf[_index];\r\n }\r\n function peek() {\r\n if (isCRLF(_index + _peekOffset)) {\r\n _peekOffset++;\r\n }\r\n _peekOffset++;\r\n return _buf[_index + _peekOffset];\r\n }\r\n function reset() {\r\n _index = 0;\r\n _line = 1;\r\n _column = 1;\r\n _peekOffset = 0;\r\n }\r\n function resetPeek(offset = 0) {\r\n _peekOffset = offset;\r\n }\r\n function skipToPeek() {\r\n const target = _index + _peekOffset;\r\n // eslint-disable-next-line no-unmodified-loop-condition\r\n while (target !== _index) {\r\n next();\r\n }\r\n _peekOffset = 0;\r\n }\r\n return {\r\n index,\r\n line,\r\n column,\r\n peekOffset,\r\n charAt,\r\n currentChar,\r\n currentPeek,\r\n next,\r\n peek,\r\n reset,\r\n resetPeek,\r\n skipToPeek\r\n };\r\n}\n\nconst EOF = undefined;\r\nconst LITERAL_DELIMITER = \"'\";\r\nconst ERROR_DOMAIN$1 = 'tokenizer';\r\nfunction createTokenizer(source, options = {}) {\r\n const location = options.location !== false;\r\n const _scnr = createScanner(source);\r\n const currentOffset = () => _scnr.index();\r\n const currentPosition = () => createPosition(_scnr.line(), _scnr.column(), _scnr.index());\r\n const _initLoc = currentPosition();\r\n const _initOffset = currentOffset();\r\n const _context = {\r\n currentType: 14 /* EOF */,\r\n offset: _initOffset,\r\n startLoc: _initLoc,\r\n endLoc: _initLoc,\r\n lastType: 14 /* EOF */,\r\n lastOffset: _initOffset,\r\n lastStartLoc: _initLoc,\r\n lastEndLoc: _initLoc,\r\n braceNest: 0,\r\n inLinked: false,\r\n text: ''\r\n };\r\n const context = () => _context;\r\n const { onError } = options;\r\n function emitError(code, pos, offset, ...args) {\r\n const ctx = context();\r\n pos.column += offset;\r\n pos.offset += offset;\r\n if (onError) {\r\n const loc = createLocation(ctx.startLoc, pos);\r\n const err = createCompileError(code, loc, {\r\n domain: ERROR_DOMAIN$1,\r\n args\r\n });\r\n onError(err);\r\n }\r\n }\r\n function getToken(context, type, value) {\r\n context.endLoc = currentPosition();\r\n context.currentType = type;\r\n const token = { type };\r\n if (location) {\r\n token.loc = createLocation(context.startLoc, context.endLoc);\r\n }\r\n if (value != null) {\r\n token.value = value;\r\n }\r\n return token;\r\n }\r\n const getEndToken = (context) => getToken(context, 14 /* EOF */);\r\n function eat(scnr, ch) {\r\n if (scnr.currentChar() === ch) {\r\n scnr.next();\r\n return ch;\r\n }\r\n else {\r\n emitError(0 /* EXPECTED_TOKEN */, currentPosition(), 0, ch);\r\n return '';\r\n }\r\n }\r\n function peekSpaces(scnr) {\r\n let buf = '';\r\n while (scnr.currentPeek() === CHAR_SP || scnr.currentPeek() === CHAR_LF) {\r\n buf += scnr.currentPeek();\r\n scnr.peek();\r\n }\r\n return buf;\r\n }\r\n function skipSpaces(scnr) {\r\n const buf = peekSpaces(scnr);\r\n scnr.skipToPeek();\r\n return buf;\r\n }\r\n function isIdentifierStart(ch) {\r\n if (ch === EOF) {\r\n return false;\r\n }\r\n const cc = ch.charCodeAt(0);\r\n return ((cc >= 97 && cc <= 122) || // a-z\r\n (cc >= 65 && cc <= 90) || // A-Z\r\n cc === 95 // _\r\n );\r\n }\r\n function isNumberStart(ch) {\r\n if (ch === EOF) {\r\n return false;\r\n }\r\n const cc = ch.charCodeAt(0);\r\n return cc >= 48 && cc <= 57; // 0-9\r\n }\r\n function isNamedIdentifierStart(scnr, context) {\r\n const { currentType } = context;\r\n if (currentType !== 2 /* BraceLeft */) {\r\n return false;\r\n }\r\n peekSpaces(scnr);\r\n const ret = isIdentifierStart(scnr.currentPeek());\r\n scnr.resetPeek();\r\n return ret;\r\n }\r\n function isListIdentifierStart(scnr, context) {\r\n const { currentType } = context;\r\n if (currentType !== 2 /* BraceLeft */) {\r\n return false;\r\n }\r\n peekSpaces(scnr);\r\n const ch = scnr.currentPeek() === '-' ? scnr.peek() : scnr.currentPeek();\r\n const ret = isNumberStart(ch);\r\n scnr.resetPeek();\r\n return ret;\r\n }\r\n function isLiteralStart(scnr, context) {\r\n const { currentType } = context;\r\n if (currentType !== 2 /* BraceLeft */) {\r\n return false;\r\n }\r\n peekSpaces(scnr);\r\n const ret = scnr.currentPeek() === LITERAL_DELIMITER;\r\n scnr.resetPeek();\r\n return ret;\r\n }\r\n function isLinkedDotStart(scnr, context) {\r\n const { currentType } = context;\r\n if (currentType !== 8 /* LinkedAlias */) {\r\n return false;\r\n }\r\n peekSpaces(scnr);\r\n const ret = scnr.currentPeek() === \".\" /* LinkedDot */;\r\n scnr.resetPeek();\r\n return ret;\r\n }\r\n function isLinkedModifierStart(scnr, context) {\r\n const { currentType } = context;\r\n if (currentType !== 9 /* LinkedDot */) {\r\n return false;\r\n }\r\n peekSpaces(scnr);\r\n const ret = isIdentifierStart(scnr.currentPeek());\r\n scnr.resetPeek();\r\n return ret;\r\n }\r\n function isLinkedDelimiterStart(scnr, context) {\r\n const { currentType } = context;\r\n if (!(currentType === 8 /* LinkedAlias */ ||\r\n currentType === 12 /* LinkedModifier */)) {\r\n return false;\r\n }\r\n peekSpaces(scnr);\r\n const ret = scnr.currentPeek() === \":\" /* LinkedDelimiter */;\r\n scnr.resetPeek();\r\n return ret;\r\n }\r\n function isLinkedReferStart(scnr, context) {\r\n const { currentType } = context;\r\n if (currentType !== 10 /* LinkedDelimiter */) {\r\n return false;\r\n }\r\n const fn = () => {\r\n const ch = scnr.currentPeek();\r\n if (ch === \"{\" /* BraceLeft */) {\r\n return isIdentifierStart(scnr.peek());\r\n }\r\n else if (ch === \"@\" /* LinkedAlias */ ||\r\n ch === \"%\" /* Modulo */ ||\r\n ch === \"|\" /* Pipe */ ||\r\n ch === \":\" /* LinkedDelimiter */ ||\r\n ch === \".\" /* LinkedDot */ ||\r\n ch === CHAR_SP ||\r\n !ch) {\r\n return false;\r\n }\r\n else if (ch === CHAR_LF) {\r\n scnr.peek();\r\n return fn();\r\n }\r\n else {\r\n // other characters\r\n return isIdentifierStart(ch);\r\n }\r\n };\r\n const ret = fn();\r\n scnr.resetPeek();\r\n return ret;\r\n }\r\n function isPluralStart(scnr) {\r\n peekSpaces(scnr);\r\n const ret = scnr.currentPeek() === \"|\" /* Pipe */;\r\n scnr.resetPeek();\r\n return ret;\r\n }\r\n function isTextStart(scnr, reset = true) {\r\n const fn = (hasSpace = false, prev = '', detectModulo = false) => {\r\n const ch = scnr.currentPeek();\r\n if (ch === \"{\" /* BraceLeft */) {\r\n return prev === \"%\" /* Modulo */ ? false : hasSpace;\r\n }\r\n else if (ch === \"@\" /* LinkedAlias */ || !ch) {\r\n return prev === \"%\" /* Modulo */ ? true : hasSpace;\r\n }\r\n else if (ch === \"%\" /* Modulo */) {\r\n scnr.peek();\r\n return fn(hasSpace, \"%\" /* Modulo */, true);\r\n }\r\n else if (ch === \"|\" /* Pipe */) {\r\n return prev === \"%\" /* Modulo */ || detectModulo\r\n ? true\r\n : !(prev === CHAR_SP || prev === CHAR_LF);\r\n }\r\n else if (ch === CHAR_SP) {\r\n scnr.peek();\r\n return fn(true, CHAR_SP, detectModulo);\r\n }\r\n else if (ch === CHAR_LF) {\r\n scnr.peek();\r\n return fn(true, CHAR_LF, detectModulo);\r\n }\r\n else {\r\n return true;\r\n }\r\n };\r\n const ret = fn();\r\n reset && scnr.resetPeek();\r\n return ret;\r\n }\r\n function takeChar(scnr, fn) {\r\n const ch = scnr.currentChar();\r\n if (ch === EOF) {\r\n return EOF;\r\n }\r\n if (fn(ch)) {\r\n scnr.next();\r\n return ch;\r\n }\r\n return null;\r\n }\r\n function takeIdentifierChar(scnr) {\r\n const closure = (ch) => {\r\n const cc = ch.charCodeAt(0);\r\n return ((cc >= 97 && cc <= 122) || // a-z\r\n (cc >= 65 && cc <= 90) || // A-Z\r\n (cc >= 48 && cc <= 57) || // 0-9\r\n cc === 95 || // _\r\n cc === 36 // $\r\n );\r\n };\r\n return takeChar(scnr, closure);\r\n }\r\n function takeDigit(scnr) {\r\n const closure = (ch) => {\r\n const cc = ch.charCodeAt(0);\r\n return cc >= 48 && cc <= 57; // 0-9\r\n };\r\n return takeChar(scnr, closure);\r\n }\r\n function takeHexDigit(scnr) {\r\n const closure = (ch) => {\r\n const cc = ch.charCodeAt(0);\r\n return ((cc >= 48 && cc <= 57) || // 0-9\r\n (cc >= 65 && cc <= 70) || // A-F\r\n (cc >= 97 && cc <= 102)); // a-f\r\n };\r\n return takeChar(scnr, closure);\r\n }\r\n function getDigits(scnr) {\r\n let ch = '';\r\n let num = '';\r\n while ((ch = takeDigit(scnr))) {\r\n num += ch;\r\n }\r\n return num;\r\n }\r\n function readText(scnr) {\r\n let buf = '';\r\n while (true) {\r\n const ch = scnr.currentChar();\r\n if (ch === \"{\" /* BraceLeft */ ||\r\n ch === \"}\" /* BraceRight */ ||\r\n ch === \"@\" /* LinkedAlias */ ||\r\n ch === \"|\" /* Pipe */ ||\r\n !ch) {\r\n break;\r\n }\r\n else if (ch === \"%\" /* Modulo */) {\r\n if (isTextStart(scnr)) {\r\n buf += ch;\r\n scnr.next();\r\n }\r\n else {\r\n break;\r\n }\r\n }\r\n else if (ch === CHAR_SP || ch === CHAR_LF) {\r\n if (isTextStart(scnr)) {\r\n buf += ch;\r\n scnr.next();\r\n }\r\n else if (isPluralStart(scnr)) {\r\n break;\r\n }\r\n else {\r\n buf += ch;\r\n scnr.next();\r\n }\r\n }\r\n else {\r\n buf += ch;\r\n scnr.next();\r\n }\r\n }\r\n return buf;\r\n }\r\n function readNamedIdentifier(scnr) {\r\n skipSpaces(scnr);\r\n let ch = '';\r\n let name = '';\r\n while ((ch = takeIdentifierChar(scnr))) {\r\n name += ch;\r\n }\r\n if (scnr.currentChar() === EOF) {\r\n emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);\r\n }\r\n return name;\r\n }\r\n function readListIdentifier(scnr) {\r\n skipSpaces(scnr);\r\n let value = '';\r\n if (scnr.currentChar() === '-') {\r\n scnr.next();\r\n value += `-${getDigits(scnr)}`;\r\n }\r\n else {\r\n value += getDigits(scnr);\r\n }\r\n if (scnr.currentChar() === EOF) {\r\n emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);\r\n }\r\n return value;\r\n }\r\n function readLiteral(scnr) {\r\n skipSpaces(scnr);\r\n eat(scnr, `\\'`);\r\n let ch = '';\r\n let literal = '';\r\n const fn = (x) => x !== LITERAL_DELIMITER && x !== CHAR_LF;\r\n while ((ch = takeChar(scnr, fn))) {\r\n if (ch === '\\\\') {\r\n literal += readEscapeSequence(scnr);\r\n }\r\n else {\r\n literal += ch;\r\n }\r\n }\r\n const current = scnr.currentChar();\r\n if (current === CHAR_LF || current === EOF) {\r\n emitError(2 /* UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER */, currentPosition(), 0);\r\n // TODO: Is it correct really?\r\n if (current === CHAR_LF) {\r\n scnr.next();\r\n eat(scnr, `\\'`);\r\n }\r\n return literal;\r\n }\r\n eat(scnr, `\\'`);\r\n return literal;\r\n }\r\n function readEscapeSequence(scnr) {\r\n const ch = scnr.currentChar();\r\n switch (ch) {\r\n case '\\\\':\r\n case `\\'`:\r\n scnr.next();\r\n return `\\\\${ch}`;\r\n case 'u':\r\n return readUnicodeEscapeSequence(scnr, ch, 4);\r\n case 'U':\r\n return readUnicodeEscapeSequence(scnr, ch, 6);\r\n default:\r\n emitError(3 /* UNKNOWN_ESCAPE_SEQUENCE */, currentPosition(), 0, ch);\r\n return '';\r\n }\r\n }\r\n function readUnicodeEscapeSequence(scnr, unicode, digits) {\r\n eat(scnr, unicode);\r\n let sequence = '';\r\n for (let i = 0; i < digits; i++) {\r\n const ch = takeHexDigit(scnr);\r\n if (!ch) {\r\n emitError(4 /* INVALID_UNICODE_ESCAPE_SEQUENCE */, currentPosition(), 0, `\\\\${unicode}${sequence}${scnr.currentChar()}`);\r\n break;\r\n }\r\n sequence += ch;\r\n }\r\n return `\\\\${unicode}${sequence}`;\r\n }\r\n function readInvalidIdentifier(scnr) {\r\n skipSpaces(scnr);\r\n let ch = '';\r\n let identifiers = '';\r\n const closure = (ch) => ch !== \"{\" /* BraceLeft */ &&\r\n ch !== \"}\" /* BraceRight */ &&\r\n ch !== CHAR_SP &&\r\n ch !== CHAR_LF;\r\n while ((ch = takeChar(scnr, closure))) {\r\n identifiers += ch;\r\n }\r\n return identifiers;\r\n }\r\n function readLinkedModifier(scnr) {\r\n let ch = '';\r\n let name = '';\r\n while ((ch = takeIdentifierChar(scnr))) {\r\n name += ch;\r\n }\r\n return name;\r\n }\r\n function readLinkedRefer(scnr) {\r\n const fn = (detect = false, buf) => {\r\n const ch = scnr.currentChar();\r\n if (ch === \"{\" /* BraceLeft */ ||\r\n ch === \"%\" /* Modulo */ ||\r\n ch === \"@\" /* LinkedAlias */ ||\r\n ch === \"|\" /* Pipe */ ||\r\n !ch) {\r\n return buf;\r\n }\r\n else if (ch === CHAR_SP) {\r\n return buf;\r\n }\r\n else if (ch === CHAR_LF) {\r\n buf += ch;\r\n scnr.next();\r\n return fn(detect, buf);\r\n }\r\n else {\r\n buf += ch;\r\n scnr.next();\r\n return fn(true, buf);\r\n }\r\n };\r\n return fn(false, '');\r\n }\r\n function readPlural(scnr) {\r\n skipSpaces(scnr);\r\n const plural = eat(scnr, \"|\" /* Pipe */);\r\n skipSpaces(scnr);\r\n return plural;\r\n }\r\n // TODO: We need refactoring of token parsing ...\r\n function readTokenInPlaceholder(scnr, context) {\r\n let token = null;\r\n const ch = scnr.currentChar();\r\n switch (ch) {\r\n case \"{\" /* BraceLeft */:\r\n if (context.braceNest >= 1) {\r\n emitError(8 /* NOT_ALLOW_NEST_PLACEHOLDER */, currentPosition(), 0);\r\n }\r\n scnr.next();\r\n token = getToken(context, 2 /* BraceLeft */, \"{\" /* BraceLeft */);\r\n skipSpaces(scnr);\r\n context.braceNest++;\r\n return token;\r\n case \"}\" /* BraceRight */:\r\n if (context.braceNest > 0 &&\r\n context.currentType === 2 /* BraceLeft */) {\r\n emitError(7 /* EMPTY_PLACEHOLDER */, currentPosition(), 0);\r\n }\r\n scnr.next();\r\n token = getToken(context, 3 /* BraceRight */, \"}\" /* BraceRight */);\r\n context.braceNest--;\r\n context.braceNest > 0 && skipSpaces(scnr);\r\n if (context.inLinked && context.braceNest === 0) {\r\n context.inLinked = false;\r\n }\r\n return token;\r\n case \"@\" /* LinkedAlias */:\r\n if (context.braceNest > 0) {\r\n emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);\r\n }\r\n token = readTokenInLinked(scnr, context) || getEndToken(context);\r\n context.braceNest = 0;\r\n return token;\r\n default:\r\n let validNamedIdentifier = true;\r\n let validListIdentifier = true;\r\n let validLiteral = true;\r\n if (isPluralStart(scnr)) {\r\n if (context.braceNest > 0) {\r\n emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);\r\n }\r\n token = getToken(context, 1 /* Pipe */, readPlural(scnr));\r\n // reset\r\n context.braceNest = 0;\r\n context.inLinked = false;\r\n return token;\r\n }\r\n if (context.braceNest > 0 &&\r\n (context.currentType === 5 /* Named */ ||\r\n context.currentType === 6 /* List */ ||\r\n context.currentType === 7 /* Literal */)) {\r\n emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);\r\n context.braceNest = 0;\r\n return readToken(scnr, context);\r\n }\r\n if ((validNamedIdentifier = isNamedIdentifierStart(scnr, context))) {\r\n token = getToken(context, 5 /* Named */, readNamedIdentifier(scnr));\r\n skipSpaces(scnr);\r\n return token;\r\n }\r\n if ((validListIdentifier = isListIdentifierStart(scnr, context))) {\r\n token = getToken(context, 6 /* List */, readListIdentifier(scnr));\r\n skipSpaces(scnr);\r\n return token;\r\n }\r\n if ((validLiteral = isLiteralStart(scnr, context))) {\r\n token = getToken(context, 7 /* Literal */, readLiteral(scnr));\r\n skipSpaces(scnr);\r\n return token;\r\n }\r\n if (!validNamedIdentifier && !validListIdentifier && !validLiteral) {\r\n // TODO: we should be re-designed invalid cases, when we will extend message syntax near the future ...\r\n token = getToken(context, 13 /* InvalidPlace */, readInvalidIdentifier(scnr));\r\n emitError(1 /* INVALID_TOKEN_IN_PLACEHOLDER */, currentPosition(), 0, token.value);\r\n skipSpaces(scnr);\r\n return token;\r\n }\r\n break;\r\n }\r\n return token;\r\n }\r\n // TODO: We need refactoring of token parsing ...\r\n function readTokenInLinked(scnr, context) {\r\n const { currentType } = context;\r\n let token = null;\r\n const ch = scnr.currentChar();\r\n if ((currentType === 8 /* LinkedAlias */ ||\r\n currentType === 9 /* LinkedDot */ ||\r\n currentType === 12 /* LinkedModifier */ ||\r\n currentType === 10 /* LinkedDelimiter */) &&\r\n (ch === CHAR_LF || ch === CHAR_SP)) {\r\n emitError(9 /* INVALID_LINKED_FORMAT */, currentPosition(), 0);\r\n }\r\n switch (ch) {\r\n case \"@\" /* LinkedAlias */:\r\n scnr.next();\r\n token = getToken(context, 8 /* LinkedAlias */, \"@\" /* LinkedAlias */);\r\n context.inLinked = true;\r\n return token;\r\n case \".\" /* LinkedDot */:\r\n skipSpaces(scnr);\r\n scnr.next();\r\n return getToken(context, 9 /* LinkedDot */, \".\" /* LinkedDot */);\r\n case \":\" /* LinkedDelimiter */:\r\n skipSpaces(scnr);\r\n scnr.next();\r\n return getToken(context, 10 /* LinkedDelimiter */, \":\" /* LinkedDelimiter */);\r\n default:\r\n if (isPluralStart(scnr)) {\r\n token = getToken(context, 1 /* Pipe */, readPlural(scnr));\r\n // reset\r\n context.braceNest = 0;\r\n context.inLinked = false;\r\n return token;\r\n }\r\n if (isLinkedDotStart(scnr, context) ||\r\n isLinkedDelimiterStart(scnr, context)) {\r\n skipSpaces(scnr);\r\n return readTokenInLinked(scnr, context);\r\n }\r\n if (isLinkedModifierStart(scnr, context)) {\r\n skipSpaces(scnr);\r\n return getToken(context, 12 /* LinkedModifier */, readLinkedModifier(scnr));\r\n }\r\n if (isLinkedReferStart(scnr, context)) {\r\n skipSpaces(scnr);\r\n if (ch === \"{\" /* BraceLeft */) {\r\n // scan the placeholder\r\n return readTokenInPlaceholder(scnr, context) || token;\r\n }\r\n else {\r\n return getToken(context, 11 /* LinkedKey */, readLinkedRefer(scnr));\r\n }\r\n }\r\n if (currentType === 8 /* LinkedAlias */) {\r\n emitError(9 /* INVALID_LINKED_FORMAT */, currentPosition(), 0);\r\n }\r\n context.braceNest = 0;\r\n context.inLinked = false;\r\n return readToken(scnr, context);\r\n }\r\n }\r\n // TODO: We need refactoring of token parsing ...\r\n function readToken(scnr, context) {\r\n let token = { type: 14 /* EOF */ };\r\n if (context.braceNest > 0) {\r\n return readTokenInPlaceholder(scnr, context) || getEndToken(context);\r\n }\r\n if (context.inLinked) {\r\n return readTokenInLinked(scnr, context) || getEndToken(context);\r\n }\r\n const ch = scnr.currentChar();\r\n switch (ch) {\r\n case \"{\" /* BraceLeft */:\r\n return readTokenInPlaceholder(scnr, context) || getEndToken(context);\r\n case \"}\" /* BraceRight */:\r\n emitError(5 /* UNBALANCED_CLOSING_BRACE */, currentPosition(), 0);\r\n scnr.next();\r\n return getToken(context, 3 /* BraceRight */, \"}\" /* BraceRight */);\r\n case \"@\" /* LinkedAlias */:\r\n return readTokenInLinked(scnr, context) || getEndToken(context);\r\n default:\r\n if (isPluralStart(scnr)) {\r\n token = getToken(context, 1 /* Pipe */, readPlural(scnr));\r\n // reset\r\n context.braceNest = 0;\r\n context.inLinked = false;\r\n return token;\r\n }\r\n if (isTextStart(scnr)) {\r\n return getToken(context, 0 /* Text */, readText(scnr));\r\n }\r\n if (ch === \"%\" /* Modulo */) {\r\n scnr.next();\r\n return getToken(context, 4 /* Modulo */, \"%\" /* Modulo */);\r\n }\r\n break;\r\n }\r\n return token;\r\n }\r\n function nextToken() {\r\n const { currentType, offset, startLoc, endLoc } = _context;\r\n _context.lastType = currentType;\r\n _context.lastOffset = offset;\r\n _context.lastStartLoc = startLoc;\r\n _context.lastEndLoc = endLoc;\r\n _context.offset = currentOffset();\r\n _context.startLoc = currentPosition();\r\n if (_scnr.currentChar() === EOF) {\r\n return getToken(_context, 14 /* EOF */);\r\n }\r\n return readToken(_scnr, _context);\r\n }\r\n return {\r\n nextToken,\r\n currentOffset,\r\n currentPosition,\r\n context\r\n };\r\n}\n\nconst ERROR_DOMAIN = 'parser';\r\n// Backslash backslash, backslash quote, uHHHH, UHHHHHH.\r\nconst KNOWN_ESCAPES = /(?:\\\\\\\\|\\\\'|\\\\u([0-9a-fA-F]{4})|\\\\U([0-9a-fA-F]{6}))/g;\r\nfunction fromEscapeSequence(match, codePoint4, codePoint6) {\r\n switch (match) {\r\n case `\\\\\\\\`:\r\n return `\\\\`;\r\n case `\\\\\\'`:\r\n return `\\'`;\r\n default: {\r\n const codePoint = parseInt(codePoint4 || codePoint6, 16);\r\n if (codePoint <= 0xd7ff || codePoint >= 0xe000) {\r\n return String.fromCodePoint(codePoint);\r\n }\r\n // invalid ...\r\n // Replace them with U+FFFD REPLACEMENT CHARACTER.\r\n return '�';\r\n }\r\n }\r\n}\r\nfunction createParser(options = {}) {\r\n const location = options.location !== false;\r\n const { onError } = options;\r\n function emitError(tokenzer, code, start, offset, ...args) {\r\n const end = tokenzer.currentPosition();\r\n end.offset += offset;\r\n end.column += offset;\r\n if (onError) {\r\n const loc = createLocation(start, end);\r\n const err = createCompileError(code, loc, {\r\n domain: ERROR_DOMAIN,\r\n args\r\n });\r\n onError(err);\r\n }\r\n }\r\n function startNode(type, offset, loc) {\r\n const node = {\r\n type,\r\n start: offset,\r\n end: offset\r\n };\r\n if (location) {\r\n node.loc = { start: loc, end: loc };\r\n }\r\n return node;\r\n }\r\n function endNode(node, offset, pos, type) {\r\n node.end = offset;\r\n if (type) {\r\n node.type = type;\r\n }\r\n if (location && node.loc) {\r\n node.loc.end = pos;\r\n }\r\n }\r\n function parseText(tokenizer, value) {\r\n const context = tokenizer.context();\r\n const node = startNode(3 /* Text */, context.offset, context.startLoc);\r\n node.value = value;\r\n endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());\r\n return node;\r\n }\r\n function parseList(tokenizer, index) {\r\n const context = tokenizer.context();\r\n const { lastOffset: offset, lastStartLoc: loc } = context; // get brace left loc\r\n const node = startNode(5 /* List */, offset, loc);\r\n node.index = parseInt(index, 10);\r\n tokenizer.nextToken(); // skip brach right\r\n endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());\r\n return node;\r\n }\r\n function parseNamed(tokenizer, key) {\r\n const context = tokenizer.context();\r\n const { lastOffset: offset, lastStartLoc: loc } = context; // get brace left loc\r\n const node = startNode(4 /* Named */, offset, loc);\r\n node.key = key;\r\n tokenizer.nextToken(); // skip brach right\r\n endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());\r\n return node;\r\n }\r\n function parseLiteral(tokenizer, value) {\r\n const context = tokenizer.context();\r\n const { lastOffset: offset, lastStartLoc: loc } = context; // get brace left loc\r\n const node = startNode(9 /* Literal */, offset, loc);\r\n node.value = value.replace(KNOWN_ESCAPES, fromEscapeSequence);\r\n tokenizer.nextToken(); // skip brach right\r\n endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());\r\n return node;\r\n }\r\n function parseLinkedModifier(tokenizer) {\r\n const token = tokenizer.nextToken();\r\n const context = tokenizer.context();\r\n const { lastOffset: offset, lastStartLoc: loc } = context; // get linked dot loc\r\n const node = startNode(8 /* LinkedModifier */, offset, loc);\r\n if (token.type !== 12 /* LinkedModifier */) {\r\n // empty modifier\r\n emitError(tokenizer, 11 /* UNEXPECTED_EMPTY_LINKED_MODIFIER */, context.lastStartLoc, 0);\r\n node.value = '';\r\n endNode(node, offset, loc);\r\n return {\r\n nextConsumeToken: token,\r\n node\r\n };\r\n }\r\n // check token\r\n if (token.value == null) {\r\n emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));\r\n }\r\n node.value = token.value || '';\r\n endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());\r\n return {\r\n node\r\n };\r\n }\r\n function parseLinkedKey(tokenizer, value) {\r\n const context = tokenizer.context();\r\n const node = startNode(7 /* LinkedKey */, context.offset, context.startLoc);\r\n node.value = value;\r\n endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());\r\n return node;\r\n }\r\n function parseLinked(tokenizer) {\r\n const context = tokenizer.context();\r\n const linkedNode = startNode(6 /* Linked */, context.offset, context.startLoc);\r\n let token = tokenizer.nextToken();\r\n if (token.type === 9 /* LinkedDot */) {\r\n const parsed = parseLinkedModifier(tokenizer);\r\n linkedNode.modifier = parsed.node;\r\n token = parsed.nextConsumeToken || tokenizer.nextToken();\r\n }\r\n // asset check token\r\n if (token.type !== 10 /* LinkedDelimiter */) {\r\n emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));\r\n }\r\n token = tokenizer.nextToken();\r\n // skip brace left\r\n if (token.type === 2 /* BraceLeft */) {\r\n token = tokenizer.nextToken();\r\n }\r\n switch (token.type) {\r\n case 11 /* LinkedKey */:\r\n if (token.value == null) {\r\n emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));\r\n }\r\n linkedNode.key = parseLinkedKey(tokenizer, token.value || '');\r\n break;\r\n case 5 /* Named */:\r\n if (token.value == null) {\r\n emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));\r\n }\r\n linkedNode.key = parseNamed(tokenizer, token.value || '');\r\n break;\r\n case 6 /* List */:\r\n if (token.value == null) {\r\n emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));\r\n }\r\n linkedNode.key = parseList(tokenizer, token.value || '');\r\n break;\r\n case 7 /* Literal */:\r\n if (token.value == null) {\r\n emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));\r\n }\r\n linkedNode.key = parseLiteral(tokenizer, token.value || '');\r\n break;\r\n default:\r\n // empty key\r\n emitError(tokenizer, 12 /* UNEXPECTED_EMPTY_LINKED_KEY */, context.lastStartLoc, 0);\r\n const nextContext = tokenizer.context();\r\n const emptyLinkedKeyNode = startNode(7 /* LinkedKey */, nextContext.offset, nextContext.startLoc);\r\n emptyLinkedKeyNode.value = '';\r\n endNode(emptyLinkedKeyNode, nextContext.offset, nextContext.startLoc);\r\n linkedNode.key = emptyLinkedKeyNode;\r\n endNode(linkedNode, nextContext.offset, nextContext.startLoc);\r\n return {\r\n nextConsumeToken: token,\r\n node: linkedNode\r\n };\r\n }\r\n endNode(linkedNode, tokenizer.currentOffset(), tokenizer.currentPosition());\r\n return {\r\n node: linkedNode\r\n };\r\n }\r\n function parseMessage(tokenizer) {\r\n const context = tokenizer.context();\r\n const startOffset = context.currentType === 1 /* Pipe */\r\n ? tokenizer.currentOffset()\r\n : context.offset;\r\n const startLoc = context.currentType === 1 /* Pipe */\r\n ? context.endLoc\r\n : context.startLoc;\r\n const node = startNode(2 /* Message */, startOffset, startLoc);\r\n node.items = [];\r\n let nextToken = null;\r\n do {\r\n const token = nextToken || tokenizer.nextToken();\r\n nextToken = null;\r\n switch (token.type) {\r\n case 0 /* Text */:\r\n if (token.value == null) {\r\n emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));\r\n }\r\n node.items.push(parseText(tokenizer, token.value || ''));\r\n break;\r\n case 6 /* List */:\r\n if (token.value == null) {\r\n emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));\r\n }\r\n node.items.push(parseList(tokenizer, token.value || ''));\r\n break;\r\n case 5 /* Named */:\r\n if (token.value == null) {\r\n emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));\r\n }\r\n node.items.push(parseNamed(tokenizer, token.value || ''));\r\n break;\r\n case 7 /* Literal */:\r\n if (token.value == null) {\r\n emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));\r\n }\r\n node.items.push(parseLiteral(tokenizer, token.value || ''));\r\n break;\r\n case 8 /* LinkedAlias */:\r\n const parsed = parseLinked(tokenizer);\r\n node.items.push(parsed.node);\r\n nextToken = parsed.nextConsumeToken || null;\r\n break;\r\n }\r\n } while (context.currentType !== 14 /* EOF */ &&\r\n context.currentType !== 1 /* Pipe */);\r\n // adjust message node loc\r\n const endOffset = context.currentType === 1 /* Pipe */\r\n ? context.lastOffset\r\n : tokenizer.currentOffset();\r\n const endLoc = context.currentType === 1 /* Pipe */\r\n ? context.lastEndLoc\r\n : tokenizer.currentPosition();\r\n endNode(node, endOffset, endLoc);\r\n return node;\r\n }\r\n function parsePlural(tokenizer, offset, loc, msgNode) {\r\n const context = tokenizer.context();\r\n let hasEmptyMessage = msgNode.items.length === 0;\r\n const node = startNode(1 /* Plural */, offset, loc);\r\n node.cases = [];\r\n node.cases.push(msgNode);\r\n do {\r\n const msg = parseMessage(tokenizer);\r\n if (!hasEmptyMessage) {\r\n hasEmptyMessage = msg.items.length === 0;\r\n }\r\n node.cases.push(msg);\r\n } while (context.currentType !== 14 /* EOF */);\r\n if (hasEmptyMessage) {\r\n emitError(tokenizer, 10 /* MUST_HAVE_MESSAGES_IN_PLURAL */, loc, 0);\r\n }\r\n endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());\r\n return node;\r\n }\r\n function parseResource(tokenizer) {\r\n const context = tokenizer.context();\r\n const { offset, startLoc } = context;\r\n const msgNode = parseMessage(tokenizer);\r\n if (context.currentType === 14 /* EOF */) {\r\n return msgNode;\r\n }\r\n else {\r\n return parsePlural(tokenizer, offset, startLoc, msgNode);\r\n }\r\n }\r\n function parse(source) {\r\n const tokenizer = createTokenizer(source, assign({}, options));\r\n const context = tokenizer.context();\r\n const node = startNode(0 /* Resource */, context.offset, context.startLoc);\r\n if (location && node.loc) {\r\n node.loc.source = source;\r\n }\r\n node.body = parseResource(tokenizer);\r\n // assert whether achieved to EOF\r\n if (context.currentType !== 14 /* EOF */) {\r\n emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, source[context.offset] || '');\r\n }\r\n endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());\r\n return node;\r\n }\r\n return { parse };\r\n}\r\nfunction getTokenCaption(token) {\r\n if (token.type === 14 /* EOF */) {\r\n return 'EOF';\r\n }\r\n const name = (token.value || '').replace(/\\r?\\n/gu, '\\\\n');\r\n return name.length > 10 ? name.slice(0, 9) + '…' : name;\r\n}\n\nfunction createTransformer(ast, options = {} // eslint-disable-line\r\n) {\r\n const _context = {\r\n ast,\r\n helpers: new Set()\r\n };\r\n const context = () => _context;\r\n const helper = (name) => {\r\n _context.helpers.add(name);\r\n return name;\r\n };\r\n return { context, helper };\r\n}\r\nfunction traverseNodes(nodes, transformer) {\r\n for (let i = 0; i < nodes.length; i++) {\r\n traverseNode(nodes[i], transformer);\r\n }\r\n}\r\nfunction traverseNode(node, transformer) {\r\n // TODO: if we need pre-hook of transform, should be implemented to here\r\n switch (node.type) {\r\n case 1 /* Plural */:\r\n traverseNodes(node.cases, transformer);\r\n transformer.helper(\"plural\" /* PLURAL */);\r\n break;\r\n case 2 /* Message */:\r\n traverseNodes(node.items, transformer);\r\n break;\r\n case 6 /* Linked */:\r\n const linked = node;\r\n traverseNode(linked.key, transformer);\r\n transformer.helper(\"linked\" /* LINKED */);\r\n break;\r\n case 5 /* List */:\r\n transformer.helper(\"interpolate\" /* INTERPOLATE */);\r\n transformer.helper(\"list\" /* LIST */);\r\n break;\r\n case 4 /* Named */:\r\n transformer.helper(\"interpolate\" /* INTERPOLATE */);\r\n transformer.helper(\"named\" /* NAMED */);\r\n break;\r\n }\r\n // TODO: if we need post-hook of transform, should be implemented to here\r\n}\r\n// transform AST\r\nfunction transform(ast, options = {} // eslint-disable-line\r\n) {\r\n const transformer = createTransformer(ast);\r\n transformer.helper(\"normalize\" /* NORMALIZE */);\r\n // traverse\r\n ast.body && traverseNode(ast.body, transformer);\r\n // set meta information\r\n const context = transformer.context();\r\n ast.helpers = Array.from(context.helpers);\r\n}\n\nfunction createCodeGenerator(ast, options) {\r\n const { sourceMap, filename, breakLineCode, needIndent: _needIndent } = options;\r\n const _context = {\r\n source: ast.loc.source,\r\n filename,\r\n code: '',\r\n column: 1,\r\n line: 1,\r\n offset: 0,\r\n map: undefined,\r\n breakLineCode,\r\n needIndent: _needIndent,\r\n indentLevel: 0\r\n };\r\n const context = () => _context;\r\n function push(code, node) {\r\n _context.code += code;\r\n }\r\n function _newline(n, withBreakLine = true) {\r\n const _breakLineCode = withBreakLine ? breakLineCode : '';\r\n push(_needIndent ? _breakLineCode + ` `.repeat(n) : _breakLineCode);\r\n }\r\n function indent(withNewLine = true) {\r\n const level = ++_context.indentLevel;\r\n withNewLine && _newline(level);\r\n }\r\n function deindent(withNewLine = true) {\r\n const level = --_context.indentLevel;\r\n withNewLine && _newline(level);\r\n }\r\n function newline() {\r\n _newline(_context.indentLevel);\r\n }\r\n const helper = (key) => `_${key}`;\r\n const needIndent = () => _context.needIndent;\r\n return {\r\n context,\r\n push,\r\n indent,\r\n deindent,\r\n newline,\r\n helper,\r\n needIndent\r\n };\r\n}\r\nfunction generateLinkedNode(generator, node) {\r\n const { helper } = generator;\r\n generator.push(`${helper(\"linked\" /* LINKED */)}(`);\r\n generateNode(generator, node.key);\r\n if (node.modifier) {\r\n generator.push(`, `);\r\n generateNode(generator, node.modifier);\r\n }\r\n generator.push(`)`);\r\n}\r\nfunction generateMessageNode(generator, node) {\r\n const { helper, needIndent } = generator;\r\n generator.push(`${helper(\"normalize\" /* NORMALIZE */)}([`);\r\n generator.indent(needIndent());\r\n const length = node.items.length;\r\n for (let i = 0; i < length; i++) {\r\n generateNode(generator, node.items[i]);\r\n if (i === length - 1) {\r\n break;\r\n }\r\n generator.push(', ');\r\n }\r\n generator.deindent(needIndent());\r\n generator.push('])');\r\n}\r\nfunction generatePluralNode(generator, node) {\r\n const { helper, needIndent } = generator;\r\n if (node.cases.length > 1) {\r\n generator.push(`${helper(\"plural\" /* PLURAL */)}([`);\r\n generator.indent(needIndent());\r\n const length = node.cases.length;\r\n for (let i = 0; i < length; i++) {\r\n generateNode(generator, node.cases[i]);\r\n if (i === length - 1) {\r\n break;\r\n }\r\n generator.push(', ');\r\n }\r\n generator.deindent(needIndent());\r\n generator.push(`])`);\r\n }\r\n}\r\nfunction generateResource(generator, node) {\r\n if (node.body) {\r\n generateNode(generator, node.body);\r\n }\r\n else {\r\n generator.push('null');\r\n }\r\n}\r\nfunction generateNode(generator, node) {\r\n const { helper } = generator;\r\n switch (node.type) {\r\n case 0 /* Resource */:\r\n generateResource(generator, node);\r\n break;\r\n case 1 /* Plural */:\r\n generatePluralNode(generator, node);\r\n break;\r\n case 2 /* Message */:\r\n generateMessageNode(generator, node);\r\n break;\r\n case 6 /* Linked */:\r\n generateLinkedNode(generator, node);\r\n break;\r\n case 8 /* LinkedModifier */:\r\n generator.push(JSON.stringify(node.value), node);\r\n break;\r\n case 7 /* LinkedKey */:\r\n generator.push(JSON.stringify(node.value), node);\r\n break;\r\n case 5 /* List */:\r\n generator.push(`${helper(\"interpolate\" /* INTERPOLATE */)}(${helper(\"list\" /* LIST */)}(${node.index}))`, node);\r\n break;\r\n case 4 /* Named */:\r\n generator.push(`${helper(\"interpolate\" /* INTERPOLATE */)}(${helper(\"named\" /* NAMED */)}(${JSON.stringify(node.key)}))`, node);\r\n break;\r\n case 9 /* Literal */:\r\n generator.push(JSON.stringify(node.value), node);\r\n break;\r\n case 3 /* Text */:\r\n generator.push(JSON.stringify(node.value), node);\r\n break;\r\n default:\r\n if ((process.env.NODE_ENV !== 'production')) {\r\n throw new Error(`unhandled codegen node type: ${node.type}`);\r\n }\r\n }\r\n}\r\n// generate code from AST\r\nconst generate = (ast, options = {} // eslint-disable-line\r\n) => {\r\n const mode = isString(options.mode) ? options.mode : 'normal';\r\n const filename = isString(options.filename)\r\n ? options.filename\r\n : 'message.intl';\r\n const sourceMap = !!options.sourceMap;\r\n // prettier-ignore\r\n const breakLineCode = options.breakLineCode != null\r\n ? options.breakLineCode\r\n : mode === 'arrow'\r\n ? ';'\r\n : '\\n';\r\n const needIndent = options.needIndent ? options.needIndent : mode !== 'arrow';\r\n const helpers = ast.helpers || [];\r\n const generator = createCodeGenerator(ast, {\r\n mode,\r\n filename,\r\n sourceMap,\r\n breakLineCode,\r\n needIndent\r\n });\r\n generator.push(mode === 'normal' ? `function __msg__ (ctx) {` : `(ctx) => {`);\r\n generator.indent(needIndent);\r\n if (helpers.length > 0) {\r\n generator.push(`const { ${helpers.map(s => `${s}: _${s}`).join(', ')} } = ctx`);\r\n generator.newline();\r\n }\r\n generator.push(`return `);\r\n generateNode(generator, ast);\r\n generator.deindent(needIndent);\r\n generator.push(`}`);\r\n const { code, map } = generator.context();\r\n return {\r\n ast,\r\n code,\r\n map: map ? map.toJSON() : undefined // eslint-disable-line @typescript-eslint/no-explicit-any\r\n };\r\n};\n\nfunction baseCompile(source, options = {}) {\r\n const assignedOptions = assign({}, options);\r\n // parse source codes\r\n const parser = createParser(assignedOptions);\r\n const ast = parser.parse(source);\r\n // transform ASTs\r\n transform(ast, assignedOptions);\r\n // generate javascript codes\r\n return generate(ast, assignedOptions);\r\n}\n\nexport { ERROR_DOMAIN, LocationStub, baseCompile, createCompileError, createLocation, createParser, createPosition, defaultOnError, errorMessages };\n"],"sourceRoot":""}