@intlify/core-base
Advanced tools
Comparing version 9.3.0-beta.14-77e850b to 9.3.0
@@ -0,1 +1,2 @@ | ||
import type { BaseError } from '@intlify/shared'; | ||
import { CompileError } from '@intlify/message-compiler'; | ||
@@ -8,2 +9,3 @@ import { CompileErrorCodes } from '@intlify/message-compiler'; | ||
import { IntlifyDevToolsHooks } from '@intlify/devtools-if'; | ||
import { ResourceNode } from '@intlify/message-compiler'; | ||
import type { VueDevToolsEmitter } from '@intlify/vue-devtools'; | ||
@@ -20,6 +22,8 @@ | ||
/* Excluded from this release type: clearNumberFormat */ | ||
export declare function compile<Message = string, MessageSource = string | ResourceNode>(message: MessageSource, context: MessageCompilerContext): MessageFunction<Message>; | ||
export { CompileError } | ||
export { CompileErrorCodes } | ||
export declare function compileToFunction<T = string>(source: string, options?: CompileOptions): MessageFunction<T>; | ||
export declare function compileToFunction<Message = string, MessageSource = string | ResourceNode>(message: MessageSource, context: MessageCompilerContext): MessageFunction<Message>; | ||
@@ -50,14 +54,14 @@ export declare interface CoreCommonContext<Message = string, Locales = 'en-US'> { | ||
export declare interface CoreError extends CompileError { | ||
code: CoreErrorCodes; | ||
export declare interface CoreError extends BaseError { | ||
} | ||
export declare const CoreErrorCodes: { | ||
readonly INVALID_ARGUMENT: 15; | ||
readonly INVALID_ARGUMENT: 17; | ||
readonly INVALID_DATE_ARGUMENT: number; | ||
readonly INVALID_ISO_DATE_ARGUMENT: number; | ||
readonly NOT_SUPPORT_NON_STRING_MESSAGE: number; | ||
readonly __EXTEND_POINT__: number; | ||
}; | ||
export declare type CoreErrorCodes = typeof CoreErrorCodes[keyof typeof CoreErrorCodes]; | ||
export declare type CoreErrorCodes = (typeof CoreErrorCodes)[keyof typeof CoreErrorCodes]; | ||
@@ -137,3 +141,3 @@ export declare interface CoreInternalContext { | ||
escapeParameter?: boolean; | ||
messageCompiler?: MessageCompiler<Message>; | ||
messageCompiler?: MessageCompiler<Message, string | ResourceNode>; | ||
messageResolver?: MessageResolver; | ||
@@ -155,3 +159,3 @@ localeFallbacker?: LocaleFallbacker; | ||
escapeParameter: boolean; | ||
messageCompiler: MessageCompiler<Message> | null; | ||
messageCompiler: MessageCompiler<Message, string | ResourceNode> | null; | ||
messageResolver: MessageResolver; | ||
@@ -167,11 +171,12 @@ } | ||
readonly FALLBACK_TO_DATE_FORMAT: 6; | ||
readonly __EXTEND_POINT__: 7; | ||
readonly EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER: 7; | ||
readonly __EXTEND_POINT__: 8; | ||
}; | ||
export declare type CoreWarnCodes = typeof CoreWarnCodes[keyof typeof CoreWarnCodes]; | ||
export declare type CoreWarnCodes = (typeof CoreWarnCodes)[keyof typeof CoreWarnCodes]; | ||
export { createCompileError } | ||
export declare function createCoreContext<Message = string, Options extends CoreOptions<Message> = CoreOptions<Message>, Messages = Options['messages'] extends object ? Options['messages'] : {}, DateTimeFormats = Options['datetimeFormats'] extends object ? Options['datetimeFormats'] : {}, NumberFormats = Options['numberFormats'] extends object ? Options['numberFormats'] : {}>(options: Options): CoreContext<Message, Messages, DateTimeFormats, NumberFormats>; | ||
export declare function createCoreContext<Message = string, Options extends CoreOptions<Message> = CoreOptions<Message>, Messages extends Record<string, any> = Options['messages'] extends Record<string, any> ? Options['messages'] : {}, DateTimeFormats extends Record<string, any> = Options['datetimeFormats'] extends Record<string, any> ? Options['datetimeFormats'] : {}, NumberFormats extends Record<string, any> = Options['numberFormats'] extends Record<string, any> ? Options['numberFormats'] : {}>(options: Options): CoreContext<Message, Messages, DateTimeFormats, NumberFormats>; | ||
export declare function createCoreContext<Schema = LocaleMessage, Locales = 'en-US', Message = string, Options extends CoreOptions<Message, SchemaParams<Schema, Message>, LocaleParams<Locales>> = CoreOptions<Message, SchemaParams<Schema, Message>, LocaleParams<Locales>>, Messages = Options['messages'] extends object ? Options['messages'] : {}, DateTimeFormats = Options['datetimeFormats'] extends object ? Options['datetimeFormats'] : {}, NumberFormats = Options['numberFormats'] extends object ? Options['numberFormats'] : {}>(options: Options): CoreContext<Message, Messages, DateTimeFormats, NumberFormats>; | ||
export declare function createCoreContext<Schema = LocaleMessage, Locales = 'en-US', Message = string, Options extends CoreOptions<Message, SchemaParams<Schema, Message>, LocaleParams<Locales>> = CoreOptions<Message, SchemaParams<Schema, Message>, LocaleParams<Locales>>, Messages extends Record<string, any> = NonNullable<Options['messages']> extends Record<string, any> ? NonNullable<Options['messages']> : {}, DateTimeFormats extends Record<string, any> = NonNullable<Options['datetimeFormats']> extends Record<string, any> ? NonNullable<Options['datetimeFormats']> : {}, NumberFormats extends Record<string, any> = NonNullable<Options['numberFormats']> extends Record<string, any> ? NonNullable<Options['numberFormats']> : {}>(options: Options): CoreContext<Message, Messages, DateTimeFormats, NumberFormats>; | ||
@@ -378,2 +383,4 @@ export declare function createCoreError(code: CoreErrorCodes): CoreError; | ||
export declare const isMessageAST: (val: unknown) => val is ResourceNode; | ||
export declare const isMessageFunction: <T>(val: unknown) => val is MessageFunction<T>; | ||
@@ -399,3 +406,9 @@ | ||
export declare interface LinkedOptions { | ||
/** | ||
* The message type of linked message | ||
*/ | ||
type?: string; | ||
/** | ||
* The modifier of linked message | ||
*/ | ||
modifier?: string; | ||
@@ -463,15 +476,156 @@ } | ||
export declare type MessageCompiler<Message = string> = (source: string, options?: CompileOptions) => MessageFunction<Message>; | ||
/** | ||
* The message compiler | ||
* | ||
* @param message - A resolved message that ususally will be passed the string. if you can transform to it with bundler, will be passed the AST. | ||
* @param context - A message context {@link MessageCompilerContext} | ||
* | ||
* @returns A {@link MessageFunction} | ||
* | ||
* @VueI18nGeneral | ||
*/ | ||
export declare type MessageCompiler<Message = string, MessageSource = string | ResourceNode> = (message: MessageSource, context: MessageCompilerContext) => MessageFunction<Message>; | ||
/** | ||
* The context that will pass the message compiler. | ||
* | ||
* @VueI18nGeneral | ||
*/ | ||
export declare type MessageCompilerContext = Pick<CompileOptions, 'onError' | 'onCacheKey'> & { | ||
/** | ||
* Whether to allow the use locale messages of HTML formatting. | ||
*/ | ||
warnHtmlMessage?: boolean; | ||
/** | ||
* The resolved locale message key | ||
*/ | ||
key: string; | ||
/** | ||
* The locale | ||
*/ | ||
locale: Locale; | ||
}; | ||
/** | ||
* The message context. | ||
* | ||
* @VueI18nGeneral | ||
*/ | ||
export declare interface MessageContext<T = string> { | ||
/** | ||
* Resolve message value from list. | ||
* | ||
* @param index - An index of message values. | ||
* | ||
* @returns A resolved message value. | ||
* | ||
* @example | ||
* ```js | ||
* const messages = { | ||
* en: { | ||
* greeting: ({ list }) => `hello, ${list(0)}!` | ||
* } | ||
* } | ||
* ``` | ||
*/ | ||
list(index: number): unknown; | ||
/** | ||
* Resolve message value from named. | ||
* | ||
* @param key - A key of message value. | ||
* | ||
* @returns A resolved message value. | ||
* | ||
* @example | ||
* ```js | ||
* const messages = { | ||
* en: { | ||
* greeting: ({ named }) => `hello, ${named('name')}!` | ||
* } | ||
* } | ||
* ``` | ||
*/ | ||
named(key: string): unknown; | ||
/** | ||
* Resolve message with plural index. | ||
* | ||
* @remarks | ||
* That's resolved with plural index with translation function. | ||
* | ||
* @param messages - the messages, that is resolved with plural index with translation function. | ||
* | ||
* @returns A resolved message. | ||
* | ||
* @example | ||
* ```js | ||
* const messages = { | ||
* en: { | ||
* car: ({ plural }) => plural(['car', 'cars']), | ||
* apple: ({ plural, named }) => | ||
* plural([ | ||
* 'no apples', | ||
* 'one apple', | ||
* `${named('count')} apples` | ||
* ]) | ||
* } | ||
* } | ||
* ``` | ||
*/ | ||
plural(messages: T[]): T; | ||
/** | ||
* Resolve linked message. | ||
* | ||
* @param key - A message key | ||
* @param modifier - A modifier | ||
* | ||
* @returns A resolve message. | ||
*/ | ||
linked(key: Path, modifier?: string): MessageType<T>; | ||
/** | ||
* Overloaded `linked` | ||
* | ||
* @param key - A message key | ||
* @param modifier - A modifier | ||
* @param type - A message type | ||
* | ||
* @returns A resolve message. | ||
*/ | ||
linked(key: Path, modifier?: string, type?: string): MessageType<T>; | ||
/** | ||
* Overloaded `linked` | ||
* | ||
* @param key - A message key | ||
* @param optoins - An {@link LinkedOptions | linked options} | ||
* | ||
* @returns A resolve message. | ||
*/ | ||
linked(key: Path, optoins?: LinkedOptions): MessageType<T>; | ||
message(key: Path): MessageFunction<T>; | ||
/* Excluded from this release type: message */ | ||
/** | ||
* The message type to be handled by the message function. | ||
* | ||
* @remarks | ||
* Usually `text`, you need to return **string** in message function. | ||
*/ | ||
type: string; | ||
interpolate: MessageInterpolate<T>; | ||
normalize: MessageNormalize<T>; | ||
/* Excluded from this release type: interpolate */ | ||
/* Excluded from this release type: normalize */ | ||
/** | ||
* The message values. | ||
* | ||
* @remarks | ||
* The message values are the argument values passed from translation fucntion, such as `$t`, `t`, or `translate`. | ||
* | ||
* @example | ||
* vue-i18n `$t` (or `t`) case: | ||
* ```html | ||
* <p>{{ $t('greeting', { name: 'DIO' }) }}</p> <!-- `{ name: 'DIO' }` is message vlaues --> | ||
* ``` | ||
* | ||
* `@intlify/core` (`@intlify/core-base`) `translate` case: | ||
* ```js | ||
* translate(context, 'foo.bar', ['dio']) // `['dio']` is message values | ||
* ``` | ||
*/ | ||
values: Record<string, unknown>; | ||
} | ||
@@ -491,13 +645,20 @@ | ||
/** | ||
* The Message Function. | ||
* | ||
* @param ctx - A {@link MessageContext} | ||
* | ||
* @return A resolved format message, that is string type basically. | ||
* | ||
* @VueI18nGeneral | ||
*/ | ||
export declare type MessageFunction<T = string> = MessageFunctionCallable | MessageFunctionInternal<T>; | ||
export declare type MessageFunctionCallable = <T = string>(ctx: MessageContext<T>) => MessageType<T>; | ||
export declare type MessageFunctionCallable = <T = string>(ctx: MessageContext<T>) => MessageFunctionReturn<T>; | ||
export declare type MessageFunctionInternal<T = string> = { | ||
(ctx: MessageContext<T>): MessageType<T>; | ||
key?: string; | ||
locale?: string; | ||
source?: string; | ||
}; | ||
/* Excluded from this release type: MessageFunctionInternal */ | ||
/** @VueI18nGeneral */ | ||
export declare type MessageFunctionReturn<T = string> = T extends string ? MessageType<T> : MessageType<T>[]; | ||
export declare type MessageFunctions<T = string> = Record<string, MessageFunction<T>>; | ||
@@ -507,3 +668,3 @@ | ||
export declare type MessageNormalize<T = string> = (values: MessageType<string | T>[]) => MessageType<T | T[]>; | ||
export declare type MessageNormalize<T = string> = (values: MessageType<T>[]) => MessageFunctionReturn<T>; | ||
@@ -679,3 +840,3 @@ export declare interface MessageProcessor<T = string> { | ||
/** @VueI18nGeneral */ | ||
export declare type PostTranslationHandler<Message = string> = (translated: MessageType<Message>, key: string) => MessageType<Message>; | ||
export declare type PostTranslationHandler<Message = string> = (translated: MessageFunctionReturn<Message>, key: string) => MessageFunctionReturn<Message>; | ||
@@ -691,3 +852,3 @@ /** | ||
export declare function registerMessageCompiler<Message>(compiler: MessageCompiler<Message>): void; | ||
export declare function registerMessageCompiler<Message>(compiler: MessageCompiler<Message, string | ResourceNode>): void; | ||
@@ -740,2 +901,3 @@ /** | ||
declare type _ResourceFormatPath<T> = __ResourceFormatPath<T, keyof T> | keyof T; | ||
export { ResourceNode } | ||
@@ -799,27 +961,27 @@ export declare type ResourcePath<T> = _ResourcePath<T> extends string | keyof T ? _ResourcePath<T> : keyof T; | ||
*/ | ||
export declare function translate<Context extends CoreContext<Message>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>): MessageType<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>): MessageFunctionReturn<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, plural: number): MessageType<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, plural: number): MessageFunctionReturn<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, plural: number, options: TranslateOptions<Context['locale']>): MessageType<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, plural: number, options: TranslateOptions<Context['locale']>): MessageFunctionReturn<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, defaultMsg: string): MessageType<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, defaultMsg: string): MessageFunctionReturn<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, defaultMsg: string, options: TranslateOptions<Context['locale']>): MessageType<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, defaultMsg: string, options: TranslateOptions<Context['locale']>): MessageFunctionReturn<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, list: unknown[]): MessageType<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, list: unknown[]): MessageFunctionReturn<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, list: unknown[], plural: number): MessageType<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, list: unknown[], plural: number): MessageFunctionReturn<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, list: unknown[], defaultMsg: string): MessageType<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, list: unknown[], defaultMsg: string): MessageFunctionReturn<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, list: unknown[], options: TranslateOptions<Context['locale']>): MessageType<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, list: unknown[], options: TranslateOptions<Context['locale']>): MessageFunctionReturn<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, named: NamedValue): MessageType<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, named: NamedValue): MessageFunctionReturn<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, named: NamedValue, plural: number): MessageType<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, named: NamedValue, plural: number): MessageFunctionReturn<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, named: NamedValue, defaultMsg: string): MessageType<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, named: NamedValue, defaultMsg: string): MessageFunctionReturn<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, named: NamedValue, options: TranslateOptions<Context['locale']>): MessageType<Message> | number; | ||
export declare function translate<Context extends CoreContext<Message, {}, {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, named: NamedValue, options: TranslateOptions<Context['locale']>): MessageFunctionReturn<Message> | number; | ||
@@ -826,0 +988,0 @@ export declare const translateDevTools: (payloads: IntlifyDevToolsHookPayloads[IntlifyDevToolsHooks]) => void | null; |
/*! | ||
* core-base v9.3.0-beta.14 | ||
* core-base v9.3.0 | ||
* (c) 2023 kazuya kawaguchi | ||
* Released under the MIT License. | ||
*/ | ||
const RE_ARGS=/\{([0-9a-zA-Z]+)\}/g;function format(e,...t){return 1===t.length&&isObject(t[0])&&(t=t[0]),t&&t.hasOwnProperty||(t={}),e.replace(RE_ARGS,((e,n)=>t.hasOwnProperty(n)?t[n]:""))}const generateFormatCacheKey=(e,t,n)=>friendlyJSONstringify({l:e,k:t,s:n}),friendlyJSONstringify=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),isNumber=e=>"number"==typeof e&&isFinite(e),isDate=e=>"[object Date]"===toTypeString(e),isRegExp=e=>"[object RegExp]"===toTypeString(e),isEmptyObject=e=>isPlainObject(e)&&0===Object.keys(e).length;function warn(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const assign=Object.assign;function escapeHtml(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const isArray=Array.isArray,isFunction=e=>"function"==typeof e,isString=e=>"string"==typeof e,isBoolean=e=>"boolean"==typeof e,isObject=e=>null!==e&&"object"==typeof e,objectToString=Object.prototype.toString,toTypeString=e=>objectToString.call(e),isPlainObject=e=>"[object Object]"===toTypeString(e),toDisplayString=e=>null==e?"":isArray(e)||isPlainObject(e)&&e.toString===objectToString?JSON.stringify(e,null,2):String(e),CompileErrorCodes={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,__EXTEND_POINT__:15};function createCompileError(e,t,n={}){const{domain:r,messages:o,args:a}=n,s=new SyntaxError(String(e));return s.code=e,t&&(s.location=t),s.domain=r,s}function defaultOnError(e){throw e}function createPosition(e,t,n){return{line:e,column:t,offset:n}}function createLocation(e,t,n){const r={start:e,end:t};return null!=n&&(r.source=n),r}const CHAR_SP=" ",CHAR_CR="\r",CHAR_LF="\n",CHAR_LS=String.fromCharCode(8232),CHAR_PS=String.fromCharCode(8233);function createScanner(e){const t=e;let n=0,r=1,o=1,a=0;const s=e=>"\r"===t[e]&&"\n"===t[e+1],i=e=>t[e]===CHAR_PS,c=e=>t[e]===CHAR_LS,l=e=>s(e)||(e=>"\n"===t[e])(e)||i(e)||c(e),u=e=>s(e)||i(e)||c(e)?"\n":t[e];function f(){return a=0,l(n)&&(r++,o=0),s(n)&&n++,n++,o++,t[n]}return{index:()=>n,line:()=>r,column:()=>o,peekOffset:()=>a,charAt:u,currentChar:()=>u(n),currentPeek:()=>u(n+a),next:f,peek:function(){return s(n+a)&&a++,a++,t[n+a]},reset:function(){n=0,r=1,o=1,a=0},resetPeek:function(e=0){a=e},skipToPeek:function(){const e=n+a;for(;e!==n;)f();a=0}}}const EOF=void 0,LITERAL_DELIMITER="'",ERROR_DOMAIN$1="tokenizer";function createTokenizer(e,t={}){const n=!1!==t.location,r=createScanner(e),o=()=>r.index(),a=()=>createPosition(r.line(),r.column(),r.index()),s=a(),i=o(),c={currentType:14,offset:i,startLoc:s,endLoc:s,lastType:14,lastOffset:i,lastStartLoc:s,lastEndLoc:s,braceNest:0,inLinked:!1,text:""},l=()=>c,{onError:u}=t;function f(e,t,r){e.endLoc=a(),e.currentType=t;const o={type:t};return n&&(o.loc=createLocation(e.startLoc,e.endLoc)),null!=r&&(o.value=r),o}const p=e=>f(e,14);function m(e,t){return e.currentChar()===t?(e.next(),t):(a(),"")}function d(e){let t="";for(;" "===e.currentPeek()||"\n"===e.currentPeek();)t+=e.currentPeek(),e.peek();return t}function g(e){const t=d(e);return e.skipToPeek(),t}function _(e){if(e===EOF)return!1;const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||95===t}function T(e,t){const{currentType:n}=t;if(2!==n)return!1;d(e);const r=function(e){if(e===EOF)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),r}function E(e){d(e);const t="|"===e.currentPeek();return e.resetPeek(),t}function b(e,t=!0){const n=(t=!1,r="",o=!1)=>{const a=e.currentPeek();return"{"===a?"%"!==r&&t:"@"!==a&&a?"%"===a?(e.peek(),n(t,"%",!0)):"|"===a?!("%"!==r&&!o)||!(" "===r||"\n"===r):" "===a?(e.peek(),n(!0," ",o)):"\n"!==a||(e.peek(),n(!0,"\n",o)):"%"===r||t},r=n();return t&&e.resetPeek(),r}function h(e,t){const n=e.currentChar();return n===EOF?EOF:t(n)?(e.next(),n):null}function k(e){return h(e,(e=>{const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||95===t||36===t}))}function C(e){return h(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57}))}function O(e){return h(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}))}function N(e){let t="",n="";for(;t=C(e);)n+=t;return n}function S(e){let t="";for(;;){const n=e.currentChar();if("{"===n||"}"===n||"@"===n||"|"===n||!n)break;if("%"===n){if(!b(e))break;t+=n,e.next()}else if(" "===n||"\n"===n)if(b(e))t+=n,e.next();else{if(E(e))break;t+=n,e.next()}else t+=n,e.next()}return t}function A(e){const t=e.currentChar();switch(t){case"\\":case"'":return e.next(),`\\${t}`;case"u":return L(e,t,4);case"U":return L(e,t,6);default:return a(),""}}function L(e,t,n){m(e,t);let r="";for(let t=0;t<n;t++){const t=O(e);if(!t){a(),e.currentChar();break}r+=t}return`\\${t}${r}`}function y(e){g(e);const t=m(e,"|");return g(e),t}function F(e,t){let n=null;switch(e.currentChar()){case"{":return t.braceNest>=1&&a(),e.next(),n=f(t,2,"{"),g(e),t.braceNest++,n;case"}":return t.braceNest>0&&2===t.currentType&&a(),e.next(),n=f(t,3,"}"),t.braceNest--,t.braceNest>0&&g(e),t.inLinked&&0===t.braceNest&&(t.inLinked=!1),n;case"@":return t.braceNest>0&&a(),n=M(e,t)||p(t),t.braceNest=0,n;default:let r=!0,o=!0,s=!0;if(E(e))return t.braceNest>0&&a(),n=f(t,1,y(e)),t.braceNest=0,t.inLinked=!1,n;if(t.braceNest>0&&(5===t.currentType||6===t.currentType||7===t.currentType))return a(),t.braceNest=0,P(e,t);if(r=function(e,t){const{currentType:n}=t;if(2!==n)return!1;d(e);const r=_(e.currentPeek());return e.resetPeek(),r}(e,t))return n=f(t,5,function(e){g(e);let t="",n="";for(;t=k(e);)n+=t;return e.currentChar()===EOF&&a(),n}(e)),g(e),n;if(o=T(e,t))return n=f(t,6,function(e){g(e);let t="";return"-"===e.currentChar()?(e.next(),t+=`-${N(e)}`):t+=N(e),e.currentChar()===EOF&&a(),t}(e)),g(e),n;if(s=function(e,t){const{currentType:n}=t;if(2!==n)return!1;d(e);const r="'"===e.currentPeek();return e.resetPeek(),r}(e,t))return n=f(t,7,function(e){g(e),m(e,"'");let t="",n="";const r=e=>"'"!==e&&"\n"!==e;for(;t=h(e,r);)n+="\\"===t?A(e):t;const o=e.currentChar();return"\n"===o||o===EOF?(a(),"\n"===o&&(e.next(),m(e,"'")),n):(m(e,"'"),n)}(e)),g(e),n;if(!r&&!o&&!s)return n=f(t,13,function(e){g(e);let t="",n="";const r=e=>"{"!==e&&"}"!==e&&" "!==e&&"\n"!==e;for(;t=h(e,r);)n+=t;return n}(e)),a(),n.value,g(e),n}return n}function M(e,t){const{currentType:n}=t;let r=null;const o=e.currentChar();switch(8!==n&&9!==n&&12!==n&&10!==n||"\n"!==o&&" "!==o||a(),o){case"@":return e.next(),r=f(t,8,"@"),t.inLinked=!0,r;case".":return g(e),e.next(),f(t,9,".");case":":return g(e),e.next(),f(t,10,":");default:return E(e)?(r=f(t,1,y(e)),t.braceNest=0,t.inLinked=!1,r):function(e,t){const{currentType:n}=t;if(8!==n)return!1;d(e);const r="."===e.currentPeek();return e.resetPeek(),r}(e,t)||function(e,t){const{currentType:n}=t;if(8!==n&&12!==n)return!1;d(e);const r=":"===e.currentPeek();return e.resetPeek(),r}(e,t)?(g(e),M(e,t)):function(e,t){const{currentType:n}=t;if(9!==n)return!1;d(e);const r=_(e.currentPeek());return e.resetPeek(),r}(e,t)?(g(e),f(t,12,function(e){let t="",n="";for(;t=k(e);)n+=t;return n}(e))):function(e,t){const{currentType:n}=t;if(10!==n)return!1;const r=()=>{const t=e.currentPeek();return"{"===t?_(e.peek()):!("@"===t||"%"===t||"|"===t||":"===t||"."===t||" "===t||!t)&&("\n"===t?(e.peek(),r()):_(t))},o=r();return e.resetPeek(),o}(e,t)?(g(e),"{"===o?F(e,t)||r:f(t,11,function(e){const t=(n=!1,r)=>{const o=e.currentChar();return"{"!==o&&"%"!==o&&"@"!==o&&"|"!==o&&o?" "===o?r:"\n"===o?(r+=o,e.next(),t(n,r)):(r+=o,e.next(),t(!0,r)):r};return t(!1,"")}(e))):(8===n&&a(),t.braceNest=0,t.inLinked=!1,P(e,t))}}function P(e,t){let n={type:14};if(t.braceNest>0)return F(e,t)||p(t);if(t.inLinked)return M(e,t)||p(t);switch(e.currentChar()){case"{":return F(e,t)||p(t);case"}":return a(),e.next(),f(t,3,"}");case"@":return M(e,t)||p(t);default:if(E(e))return n=f(t,1,y(e)),t.braceNest=0,t.inLinked=!1,n;const{isModulo:r,hasSpace:o}=function(e){const t=d(e),n="%"===e.currentPeek()&&"{"===e.peek();return e.resetPeek(),{isModulo:n,hasSpace:t.length>0}}(e);if(r)return o?f(t,0,S(e)):f(t,4,function(e){g(e);return"%"!==e.currentChar()&&a(),e.next(),"%"}(e));if(b(e))return f(t,0,S(e))}return n}return{nextToken:function(){const{currentType:e,offset:t,startLoc:n,endLoc:s}=c;return c.lastType=e,c.lastOffset=t,c.lastStartLoc=n,c.lastEndLoc=s,c.offset=o(),c.startLoc=a(),r.currentChar()===EOF?f(c,14):P(r,c)},currentOffset:o,currentPosition:a,context:l}}const ERROR_DOMAIN="parser",KNOWN_ESCAPES=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function fromEscapeSequence(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const e=parseInt(t||n,16);return e<=55295||e>=57344?String.fromCodePoint(e):"�"}}}function createParser(e={}){const t=!1!==e.location,{onError:n}=e;function r(e,n,r){const o={type:e,start:n,end:n};return t&&(o.loc={start:r,end:r}),o}function o(e,n,r,o){e.end=n,o&&(e.type=o),t&&e.loc&&(e.loc.end=r)}function a(e,t){const n=e.context(),a=r(3,n.offset,n.startLoc);return a.value=t,o(a,e.currentOffset(),e.currentPosition()),a}function s(e,t){const n=e.context(),{lastOffset:a,lastStartLoc:s}=n,i=r(5,a,s);return i.index=parseInt(t,10),e.nextToken(),o(i,e.currentOffset(),e.currentPosition()),i}function i(e,t){const n=e.context(),{lastOffset:a,lastStartLoc:s}=n,i=r(4,a,s);return i.key=t,e.nextToken(),o(i,e.currentOffset(),e.currentPosition()),i}function c(e,t){const n=e.context(),{lastOffset:a,lastStartLoc:s}=n,i=r(9,a,s);return i.value=t.replace(KNOWN_ESCAPES,fromEscapeSequence),e.nextToken(),o(i,e.currentOffset(),e.currentPosition()),i}function l(e){const t=e.context(),n=r(6,t.offset,t.startLoc);let a=e.nextToken();if(9===a.type){const t=function(e){const t=e.nextToken(),n=e.context(),{lastOffset:a,lastStartLoc:s}=n,i=r(8,a,s);return 12!==t.type?(n.lastStartLoc,i.value="",o(i,a,s),{nextConsumeToken:t,node:i}):(null==t.value&&(n.lastStartLoc,getTokenCaption(t)),i.value=t.value||"",o(i,e.currentOffset(),e.currentPosition()),{node:i})}(e);n.modifier=t.node,a=t.nextConsumeToken||e.nextToken()}switch(10!==a.type&&(t.lastStartLoc,getTokenCaption(a)),a=e.nextToken(),2===a.type&&(a=e.nextToken()),a.type){case 11:null==a.value&&(t.lastStartLoc,getTokenCaption(a)),n.key=function(e,t){const n=e.context(),a=r(7,n.offset,n.startLoc);return a.value=t,o(a,e.currentOffset(),e.currentPosition()),a}(e,a.value||"");break;case 5:null==a.value&&(t.lastStartLoc,getTokenCaption(a)),n.key=i(e,a.value||"");break;case 6:null==a.value&&(t.lastStartLoc,getTokenCaption(a)),n.key=s(e,a.value||"");break;case 7:null==a.value&&(t.lastStartLoc,getTokenCaption(a)),n.key=c(e,a.value||"");break;default:t.lastStartLoc;const l=e.context(),u=r(7,l.offset,l.startLoc);return u.value="",o(u,l.offset,l.startLoc),n.key=u,o(n,l.offset,l.startLoc),{nextConsumeToken:a,node:n}}return o(n,e.currentOffset(),e.currentPosition()),{node:n}}function u(e){const t=e.context(),n=r(2,1===t.currentType?e.currentOffset():t.offset,1===t.currentType?t.endLoc:t.startLoc);n.items=[];let u=null;do{const r=u||e.nextToken();switch(u=null,r.type){case 0:null==r.value&&(t.lastStartLoc,getTokenCaption(r)),n.items.push(a(e,r.value||""));break;case 6:null==r.value&&(t.lastStartLoc,getTokenCaption(r)),n.items.push(s(e,r.value||""));break;case 5:null==r.value&&(t.lastStartLoc,getTokenCaption(r)),n.items.push(i(e,r.value||""));break;case 7:null==r.value&&(t.lastStartLoc,getTokenCaption(r)),n.items.push(c(e,r.value||""));break;case 8:const o=l(e);n.items.push(o.node),u=o.nextConsumeToken||null}}while(14!==t.currentType&&1!==t.currentType);return o(n,1===t.currentType?t.lastOffset:e.currentOffset(),1===t.currentType?t.lastEndLoc:e.currentPosition()),n}function f(e){const t=e.context(),{offset:n,startLoc:a}=t,s=u(e);return 14===t.currentType?s:function(e,t,n,a){const s=e.context();let i=0===a.items.length;const c=r(1,t,n);c.cases=[],c.cases.push(a);do{const t=u(e);i||(i=0===t.items.length),c.cases.push(t)}while(14!==s.currentType);return o(c,e.currentOffset(),e.currentPosition()),c}(e,n,a,s)}return{parse:function(n){const a=createTokenizer(n,assign({},e)),s=a.context(),i=r(0,s.offset,s.startLoc);return t&&i.loc&&(i.loc.source=n),i.body=f(a),14!==s.currentType&&(s.lastStartLoc,n[s.offset]),o(i,a.currentOffset(),a.currentPosition()),i}}}function getTokenCaption(e){if(14===e.type)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function createTransformer(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:e=>(n.helpers.add(e),e)}}function traverseNodes(e,t){for(let n=0;n<e.length;n++)traverseNode(e[n],t)}function traverseNode(e,t){switch(e.type){case 1:traverseNodes(e.cases,t),t.helper("plural");break;case 2:traverseNodes(e.items,t);break;case 6:traverseNode(e.key,t),t.helper("linked"),t.helper("type");break;case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named")}}function transform(e,t={}){const n=createTransformer(e);n.helper("normalize"),e.body&&traverseNode(e.body,n);const r=n.context();e.helpers=Array.from(r.helpers)}function createCodeGenerator(e,t){const{sourceMap:n,filename:r,breakLineCode:o,needIndent:a}=t,s={source:e.loc.source,filename:r,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:a,indentLevel:0};function i(e,t){s.code+=e}function c(e,t=!0){const n=t?o:"";i(a?n+" ".repeat(e):n)}return{context:()=>s,push:i,indent:function(e=!0){const t=++s.indentLevel;e&&c(t)},deindent:function(e=!0){const t=--s.indentLevel;e&&c(t)},newline:function(){c(s.indentLevel)},helper:e=>`_${e}`,needIndent:()=>s.needIndent}}function generateLinkedNode(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),generateNode(e,t.key),t.modifier?(e.push(", "),generateNode(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function generateMessageNode(e,t){const{helper:n,needIndent:r}=e;e.push(`${n("normalize")}([`),e.indent(r());const o=t.items.length;for(let n=0;n<o&&(generateNode(e,t.items[n]),n!==o-1);n++)e.push(", ");e.deindent(r()),e.push("])")}function generatePluralNode(e,t){const{helper:n,needIndent:r}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(r());const o=t.cases.length;for(let n=0;n<o&&(generateNode(e,t.cases[n]),n!==o-1);n++)e.push(", ");e.deindent(r()),e.push("])")}}function generateResource(e,t){t.body?generateNode(e,t.body):e.push("null")}function generateNode(e,t){const{helper:n}=e;switch(t.type){case 0:generateResource(e,t);break;case 1:generatePluralNode(e,t);break;case 2:generateMessageNode(e,t);break;case 6:generateLinkedNode(e,t);break;case 8:case 7:case 9:case 3:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t)}}const generate=(e,t={})=>{const n=isString(t.mode)?t.mode:"normal",r=isString(t.filename)?t.filename:"message.intl",o=!!t.sourceMap,a=null!=t.breakLineCode?t.breakLineCode:"arrow"===n?";":"\n",s=t.needIndent?t.needIndent:"arrow"!==n,i=e.helpers||[],c=createCodeGenerator(e,{mode:n,filename:r,sourceMap:o,breakLineCode:a,needIndent:s});c.push("normal"===n?"function __msg__ (ctx) {":"(ctx) => {"),c.indent(s),i.length>0&&(c.push(`const { ${i.map((e=>`${e}: _${e}`)).join(", ")} } = ctx`),c.newline()),c.push("return "),generateNode(c,e),c.deindent(s),c.push("}");const{code:l,map:u}=c.context();return{ast:e,code:l,map:u?u.toJSON():void 0}};function baseCompile(e,t={}){const n=assign({},t),r=createParser(n).parse(e);return transform(r,n),generate(r,n)}const pathStateMachine=[];pathStateMachine[0]={w:[0],i:[3,0],"[":[4],o:[7]},pathStateMachine[1]={w:[1],".":[2],"[":[4],o:[7]},pathStateMachine[2]={w:[2],i:[3,0],0:[3,0]},pathStateMachine[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},pathStateMachine[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},pathStateMachine[5]={"'":[4,0],o:8,l:[5,0]},pathStateMachine[6]={'"':[4,0],o:8,l:[6,0]};const literalValueRE=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function isLiteral(e){return literalValueRE.test(e)}function stripQuotes(e){const t=e.charCodeAt(0);return t!==e.charCodeAt(e.length-1)||34!==t&&39!==t?e:e.slice(1,-1)}function getPathCharType(e){if(null==e)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function formatSubPath(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(isLiteral(t)?stripQuotes(t):"*"+t)}function parse(e){const t=[];let n,r,o,a,s,i,c,l=-1,u=0,f=0;const p=[];function m(){const t=e[l+1];if(5===u&&"'"===t||6===u&&'"'===t)return l++,o="\\"+t,p[0](),!0}for(p[0]=()=>{void 0===r?r=o:r+=o},p[1]=()=>{void 0!==r&&(t.push(r),r=void 0)},p[2]=()=>{p[0](),f++},p[3]=()=>{if(f>0)f--,u=4,p[0]();else{if(f=0,void 0===r)return!1;if(r=formatSubPath(r),!1===r)return!1;p[1]()}};null!==u;)if(l++,n=e[l],"\\"!==n||!m()){if(a=getPathCharType(n),c=pathStateMachine[u],s=c[a]||c.l||8,8===s)return;if(u=s[0],void 0!==s[1]&&(i=p[s[1]],i&&(o=n,!1===i())))return;if(7===u)return t}}const cache=new Map;function resolveWithKeyValue(e,t){return isObject(e)?e[t]:null}function resolveValue(e,t){if(!isObject(e))return null;let n=cache.get(t);if(n||(n=parse(t),n&&cache.set(t,n)),!n)return null;const r=n.length;let o=e,a=0;for(;a<r;){const e=o[n[a]];if(void 0===e)return null;o=e,a++}return o}const DEFAULT_MODIFIER=e=>e,DEFAULT_MESSAGE=e=>"",DEFAULT_MESSAGE_DATA_TYPE="text",DEFAULT_NORMALIZE=e=>0===e.length?"":e.join(""),DEFAULT_INTERPOLATE=toDisplayString;function pluralDefault(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function getPluralIndex(e){const t=isNumber(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(isNumber(e.named.count)||isNumber(e.named.n))?isNumber(e.named.count)?e.named.count:isNumber(e.named.n)?e.named.n:t:t}function normalizeNamed(e,t){t.count||(t.count=e),t.n||(t.n=e)}function createMessageContext(e={}){const t=e.locale,n=getPluralIndex(e),r=isObject(e.pluralRules)&&isString(t)&&isFunction(e.pluralRules[t])?e.pluralRules[t]:pluralDefault,o=isObject(e.pluralRules)&&isString(t)&&isFunction(e.pluralRules[t])?pluralDefault:void 0,a=e.list||[],s=e.named||{};isNumber(e.pluralIndex)&&normalizeNamed(n,s);function i(t){const n=isFunction(e.messages)?e.messages(t):!!isObject(e.messages)&&e.messages[t];return n||(e.parent?e.parent.message(t):DEFAULT_MESSAGE)}const c=isPlainObject(e.processor)&&isFunction(e.processor.normalize)?e.processor.normalize:DEFAULT_NORMALIZE,l=isPlainObject(e.processor)&&isFunction(e.processor.interpolate)?e.processor.interpolate:DEFAULT_INTERPOLATE,u={list:e=>a[e],named:e=>s[e],plural:e=>e[r(n,e.length,o)],linked:(t,...n)=>{const[r,o]=n;let a="text",s="";1===n.length?isObject(r)?(s=r.modifier||s,a=r.type||a):isString(r)&&(s=r||s):2===n.length&&(isString(r)&&(s=r||s),isString(o)&&(a=o||a));let c=i(t)(u);return"vnode"===a&&isArray(c)&&s&&(c=c[0]),s?(l=s,e.modifiers?e.modifiers[l]:DEFAULT_MODIFIER)(c,a):c;var l},message:i,type:isPlainObject(e.processor)&&isString(e.processor.type)?e.processor.type:"text",interpolate:l,normalize:c};return u}const IntlifyDevToolsHooks={I18nInit:"i18n:init",FunctionTranslate:"function:translate"};let devtools=null;function setDevToolsHook(e){devtools=e}function getDevToolsHook(){return devtools}function initI18nDevTools(e,t,n){devtools&&devtools.emit(IntlifyDevToolsHooks.I18nInit,{timestamp:Date.now(),i18n:e,version:t,meta:n})}const translateDevTools=createDevToolsHook(IntlifyDevToolsHooks.FunctionTranslate);function createDevToolsHook(e){return t=>devtools&&devtools.emit(e,t)}const CoreWarnCodes={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,__EXTEND_POINT__:7},warnMessages={[CoreWarnCodes.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[CoreWarnCodes.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[CoreWarnCodes.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[CoreWarnCodes.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[CoreWarnCodes.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[CoreWarnCodes.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale."};function getWarnMessage(e,...t){return format(warnMessages[e],...t)}function fallbackWithSimple(e,t,n){return[...new Set([n,...isArray(t)?t:isObject(t)?Object.keys(t):isString(t)?[t]:[n]])]}function fallbackWithLocaleChain(e,t,n){const r=isString(n)?n:DEFAULT_LOCALE,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let a=o.__localeChainCache.get(r);if(!a){a=[];let e=[n];for(;isArray(e);)e=appendBlockToChain(a,e,t);const s=isArray(t)||!isPlainObject(t)?t:t.default?t.default:null;e=isString(s)?[s]:s,isArray(e)&&appendBlockToChain(a,e,!1),o.__localeChainCache.set(r,a)}return a}function appendBlockToChain(e,t,n){let r=!0;for(let o=0;o<t.length&&isBoolean(r);o++){const a=t[o];isString(a)&&(r=appendLocaleToChain(e,t[o],n))}return r}function appendLocaleToChain(e,t,n){let r;const o=t.split("-");do{r=appendItemToChain(e,o.join("-"),n),o.splice(-1,1)}while(o.length&&!0===r);return r}function appendItemToChain(e,t,n){let r=!1;if(!e.includes(t)&&(r=!0,t)){r="!"!==t[t.length-1];const o=t.replace(/!/g,"");e.push(o),(isArray(n)||isPlainObject(n))&&n[o]&&(r=n[o])}return r}const VERSION="9.3.0-beta.14",NOT_REOSLVED=-1,DEFAULT_LOCALE="en-US",MISSING_RESOLVE_VALUE="",capitalize=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function getDefaultLinkedModifiers(){return{upper:(e,t)=>"text"===t&&isString(e)?e.toUpperCase():"vnode"===t&&isObject(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>"text"===t&&isString(e)?e.toLowerCase():"vnode"===t&&isObject(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>"text"===t&&isString(e)?capitalize(e):"vnode"===t&&isObject(e)&&"__v_isVNode"in e?capitalize(e.children):e}}let _compiler,_resolver,_fallbacker;function registerMessageCompiler(e){_compiler=e}function registerMessageResolver(e){_resolver=e}function registerLocaleFallbacker(e){_fallbacker=e}let _additionalMeta=null;const setAdditionalMeta=e=>{_additionalMeta=e},getAdditionalMeta=()=>_additionalMeta;let _fallbackContext=null;const setFallbackContext=e=>{_fallbackContext=e},getFallbackContext=()=>_fallbackContext;let _cid=0;function createCoreContext(e={}){const t=isString(e.version)?e.version:VERSION,n=isString(e.locale)?e.locale:DEFAULT_LOCALE,r=isArray(e.fallbackLocale)||isPlainObject(e.fallbackLocale)||isString(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:n,o=isPlainObject(e.messages)?e.messages:{[n]:{}},a=isPlainObject(e.datetimeFormats)?e.datetimeFormats:{[n]:{}},s=isPlainObject(e.numberFormats)?e.numberFormats:{[n]:{}},i=assign({},e.modifiers||{},getDefaultLinkedModifiers()),c=e.pluralRules||{},l=isFunction(e.missing)?e.missing:null,u=!isBoolean(e.missingWarn)&&!isRegExp(e.missingWarn)||e.missingWarn,f=!isBoolean(e.fallbackWarn)&&!isRegExp(e.fallbackWarn)||e.fallbackWarn,p=!!e.fallbackFormat,m=!!e.unresolving,d=isFunction(e.postTranslation)?e.postTranslation:null,g=isPlainObject(e.processor)?e.processor:null,_=!isBoolean(e.warnHtmlMessage)||e.warnHtmlMessage,T=!!e.escapeParameter,E=isFunction(e.messageCompiler)?e.messageCompiler:_compiler,b=isFunction(e.messageResolver)?e.messageResolver:_resolver||resolveWithKeyValue,h=isFunction(e.localeFallbacker)?e.localeFallbacker:_fallbacker||fallbackWithSimple,k=isObject(e.fallbackContext)?e.fallbackContext:void 0,C=isFunction(e.onWarn)?e.onWarn:warn,O=e,N=isObject(O.__datetimeFormatters)?O.__datetimeFormatters:new Map,S=isObject(O.__numberFormatters)?O.__numberFormatters:new Map,A=isObject(O.__meta)?O.__meta:{};_cid++;const L={version:t,cid:_cid,locale:n,fallbackLocale:r,messages:o,modifiers:i,pluralRules:c,missing:l,missingWarn:u,fallbackWarn:f,fallbackFormat:p,unresolving:m,postTranslation:d,processor:g,warnHtmlMessage:_,escapeParameter:T,messageCompiler:E,messageResolver:b,localeFallbacker:h,fallbackContext:k,onWarn:C,__meta:A};return L.datetimeFormats=a,L.numberFormats=s,L.__datetimeFormatters=N,L.__numberFormatters=S,L}function isTranslateFallbackWarn(e,t){return e instanceof RegExp?e.test(t):e}function isTranslateMissingWarn(e,t){return e instanceof RegExp?e.test(t):e}function handleMissing(e,t,n,r,o){const{missing:a,onWarn:s}=e;if(null!==a){const r=a(e,n,t,o);return isString(r)?r:t}return t}function updateFallbackLocale(e,t,n){e.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}const defaultOnCacheKey=e=>e;let compileCache=Object.create(null);function clearCompileCache(){compileCache=Object.create(null)}function compileToFunction(e,t={}){{const n=(t.onCacheKey||defaultOnCacheKey)(e),r=compileCache[n];if(r)return r;let o=!1;const a=t.onError||defaultOnError;t.onError=e=>{o=!0,a(e)};const{code:s}=baseCompile(e,t),i=new Function(`return ${s}`)();return o?i:compileCache[n]=i}}let code=CompileErrorCodes.__EXTEND_POINT__;const inc=()=>++code,CoreErrorCodes={INVALID_ARGUMENT:code,INVALID_DATE_ARGUMENT:inc(),INVALID_ISO_DATE_ARGUMENT:inc(),__EXTEND_POINT__:inc()};function createCoreError(e){return createCompileError(e,null,void 0)}const NOOP_MESSAGE_FUNCTION=()=>"",isMessageFunction=e=>isFunction(e);function translate(e,...t){const{fallbackFormat:n,postTranslation:r,unresolving:o,messageCompiler:a,fallbackLocale:s,messages:i}=e,[c,l]=parseTranslateArgs(...t),u=isBoolean(l.missingWarn)?l.missingWarn:e.missingWarn,f=isBoolean(l.fallbackWarn)?l.fallbackWarn:e.fallbackWarn,p=isBoolean(l.escapeParameter)?l.escapeParameter:e.escapeParameter,m=!!l.resolvedMessage,d=isString(l.default)||isBoolean(l.default)?isBoolean(l.default)?a?c:()=>c:l.default:n?a?c:()=>c:"",g=n||""!==d,_=isString(l.locale)?l.locale:e.locale;p&&escapeParams(l);let[T,E,b]=m?[c,_,i[_]||{}]:resolveMessageFormat(e,c,_,s,f,u),h=T,k=c;if(m||isString(h)||isMessageFunction(h)||g&&(h=d,k=h),!(m||(isString(h)||isMessageFunction(h))&&isString(E)))return o?-1:c;let C=!1;const O=isMessageFunction(h)?h:compileMessageFormat(e,c,E,h,k,(()=>{C=!0}));if(C)return h;const N=evaluateMessage(e,O,createMessageContext(getMessageContextOptions(e,E,b,l)));return r?r(N,c):N}function escapeParams(e){isArray(e.list)?e.list=e.list.map((e=>isString(e)?escapeHtml(e):e)):isObject(e.named)&&Object.keys(e.named).forEach((t=>{isString(e.named[t])&&(e.named[t]=escapeHtml(e.named[t]))}))}function resolveMessageFormat(e,t,n,r,o,a){const{messages:s,onWarn:i,messageResolver:c,localeFallbacker:l}=e,u=l(e,r,n);let f,p={},m=null;for(let n=0;n<u.length&&(f=u[n],p=s[f]||{},null===(m=c(p,t))&&(m=p[t]),!isString(m)&&!isFunction(m));n++){const n=handleMissing(e,t,f,a,"translate");n!==t&&(m=n)}return[m,f,p]}function compileMessageFormat(e,t,n,r,o,a){const{messageCompiler:s,warnHtmlMessage:i}=e;if(isMessageFunction(r)){const e=r;return e.locale=e.locale||n,e.key=e.key||t,e}if(null==s){const e=()=>r;return e.locale=n,e.key=t,e}const c=s(r,getCompileOptions(e,n,o,r,i,a));return c.locale=n,c.key=t,c.source=r,c}function evaluateMessage(e,t,n){return t(n)}function parseTranslateArgs(...e){const[t,n,r]=e,o={};if(!isString(t)&&!isNumber(t)&&!isMessageFunction(t))throw Error(CoreErrorCodes.INVALID_ARGUMENT);const a=isNumber(t)?String(t):(isMessageFunction(t),t);return isNumber(n)?o.plural=n:isString(n)?o.default=n:isPlainObject(n)&&!isEmptyObject(n)?o.named=n:isArray(n)&&(o.list=n),isNumber(r)?o.plural=r:isString(r)?o.default=r:isPlainObject(r)&&assign(o,r),[a,o]}function getCompileOptions(e,t,n,r,o,a){return{warnHtmlMessage:o,onError:e=>{throw a&&a(e),e},onCacheKey:e=>generateFormatCacheKey(t,n,e)}}function getMessageContextOptions(e,t,n,r){const{modifiers:o,pluralRules:a,messageResolver:s,fallbackLocale:i,fallbackWarn:c,missingWarn:l,fallbackContext:u}=e,f={locale:t,modifiers:o,pluralRules:a,messages:r=>{let o=s(n,r);if(null==o&&u){const[,,e]=resolveMessageFormat(u,r,t,i,c,l);o=s(e,r)}if(isString(o)){let n=!1;const a=compileMessageFormat(e,r,t,o,r,(()=>{n=!0}));return n?NOOP_MESSAGE_FUNCTION:a}return isMessageFunction(o)?o:NOOP_MESSAGE_FUNCTION}};return e.processor&&(f.processor=e.processor),r.list&&(f.list=r.list),r.named&&(f.named=r.named),isNumber(r.plural)&&(f.pluralIndex=r.plural),f}function datetime(e,...t){const{datetimeFormats:n,unresolving:r,fallbackLocale:o,onWarn:a,localeFallbacker:s}=e,{__datetimeFormatters:i}=e,[c,l,u,f]=parseDateTimeArgs(...t),p=isBoolean(u.missingWarn)?u.missingWarn:e.missingWarn;isBoolean(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const m=!!u.part,d=isString(u.locale)?u.locale:e.locale,g=s(e,o,d);if(!isString(c)||""===c)return new Intl.DateTimeFormat(d,f).format(l);let _,T={},E=null;for(let t=0;t<g.length&&(_=g[t],T=n[_]||{},E=T[c],!isPlainObject(E));t++)handleMissing(e,c,_,p,"datetime format");if(!isPlainObject(E)||!isString(_))return r?-1:c;let b=`${_}__${c}`;isEmptyObject(f)||(b=`${b}__${JSON.stringify(f)}`);let h=i.get(b);return h||(h=new Intl.DateTimeFormat(_,assign({},E,f)),i.set(b,h)),m?h.formatToParts(l):h.format(l)}const DATETIME_FORMAT_OPTIONS_KEYS=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function parseDateTimeArgs(...e){const[t,n,r,o]=e,a={};let s,i={};if(isString(t)){const e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Error(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT);const n=e[3]?e[3].trim().startsWith("T")?`${e[1].trim()}${e[3].trim()}`:`${e[1].trim()}T${e[3].trim()}`:e[1].trim();s=new Date(n);try{s.toISOString()}catch(e){throw Error(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT)}}else if("[object Date]"===toTypeString(t)){if(isNaN(t.getTime()))throw Error(CoreErrorCodes.INVALID_DATE_ARGUMENT);s=t}else{if(!isNumber(t))throw Error(CoreErrorCodes.INVALID_ARGUMENT);s=t}return isString(n)?a.key=n:isPlainObject(n)&&Object.keys(n).forEach((e=>{DATETIME_FORMAT_OPTIONS_KEYS.includes(e)?i[e]=n[e]:a[e]=n[e]})),isString(r)?a.locale=r:isPlainObject(r)&&(i=r),isPlainObject(o)&&(i=o),[a.key||"",s,a,i]}function clearDateTimeFormat(e,t,n){const r=e;for(const e in n){const n=`${t}__${e}`;r.__datetimeFormatters.has(n)&&r.__datetimeFormatters.delete(n)}}function number(e,...t){const{numberFormats:n,unresolving:r,fallbackLocale:o,onWarn:a,localeFallbacker:s}=e,{__numberFormatters:i}=e,[c,l,u,f]=parseNumberArgs(...t),p=isBoolean(u.missingWarn)?u.missingWarn:e.missingWarn;isBoolean(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const m=!!u.part,d=isString(u.locale)?u.locale:e.locale,g=s(e,o,d);if(!isString(c)||""===c)return new Intl.NumberFormat(d,f).format(l);let _,T={},E=null;for(let t=0;t<g.length&&(_=g[t],T=n[_]||{},E=T[c],!isPlainObject(E));t++)handleMissing(e,c,_,p,"number format");if(!isPlainObject(E)||!isString(_))return r?-1:c;let b=`${_}__${c}`;isEmptyObject(f)||(b=`${b}__${JSON.stringify(f)}`);let h=i.get(b);return h||(h=new Intl.NumberFormat(_,assign({},E,f)),i.set(b,h)),m?h.formatToParts(l):h.format(l)}const NUMBER_FORMAT_OPTIONS_KEYS=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function parseNumberArgs(...e){const[t,n,r,o]=e,a={};let s={};if(!isNumber(t))throw Error(CoreErrorCodes.INVALID_ARGUMENT);const i=t;return isString(n)?a.key=n:isPlainObject(n)&&Object.keys(n).forEach((e=>{NUMBER_FORMAT_OPTIONS_KEYS.includes(e)?s[e]=n[e]:a[e]=n[e]})),isString(r)?a.locale=r:isPlainObject(r)&&(s=r),isPlainObject(o)&&(s=o),[a.key||"",i,a,s]}function clearNumberFormat(e,t,n){const r=e;for(const e in n){const n=`${t}__${e}`;r.__numberFormatters.has(n)&&r.__numberFormatters.delete(n)}}export{CompileErrorCodes,CoreErrorCodes,CoreWarnCodes,DATETIME_FORMAT_OPTIONS_KEYS,DEFAULT_LOCALE,DEFAULT_MESSAGE_DATA_TYPE,MISSING_RESOLVE_VALUE,NOT_REOSLVED,NUMBER_FORMAT_OPTIONS_KEYS,VERSION,clearCompileCache,clearDateTimeFormat,clearNumberFormat,compileToFunction,createCompileError,createCoreContext,createCoreError,createMessageContext,datetime,fallbackWithLocaleChain,fallbackWithSimple,getAdditionalMeta,getDevToolsHook,getFallbackContext,getWarnMessage,handleMissing,initI18nDevTools,isMessageFunction,isTranslateFallbackWarn,isTranslateMissingWarn,number,parse,parseDateTimeArgs,parseNumberArgs,parseTranslateArgs,registerLocaleFallbacker,registerMessageCompiler,registerMessageResolver,resolveValue,resolveWithKeyValue,setAdditionalMeta,setDevToolsHook,setFallbackContext,translate,translateDevTools,updateFallbackLocale}; | ||
const RE_ARGS=/\{([0-9a-zA-Z]+)\}/g;function format$1(e,...t){return 1===t.length&&isObject(t[0])&&(t=t[0]),t&&t.hasOwnProperty||(t={}),e.replace(RE_ARGS,((e,r)=>t.hasOwnProperty(r)?t[r]:""))}const generateFormatCacheKey=(e,t,r)=>friendlyJSONstringify({l:e,k:t,s:r}),friendlyJSONstringify=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),isNumber=e=>"number"==typeof e&&isFinite(e),isDate=e=>"[object Date]"===toTypeString(e),isRegExp=e=>"[object RegExp]"===toTypeString(e),isEmptyObject=e=>isPlainObject(e)&&0===Object.keys(e).length,assign=Object.assign;function escapeHtml(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const isArray=Array.isArray,isFunction=e=>"function"==typeof e,isString=e=>"string"==typeof e,isBoolean=e=>"boolean"==typeof e,isObject=e=>null!==e&&"object"==typeof e,objectToString=Object.prototype.toString,toTypeString=e=>objectToString.call(e),isPlainObject=e=>{if(!isObject(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t.constructor===Object},toDisplayString=e=>null==e?"":isArray(e)||isPlainObject(e)&&e.toString===objectToString?JSON.stringify(e,null,2):String(e);function join(e,t=""){return e.reduce(((e,r,n)=>0===n?e+r:e+t+r),"")}function incrementer(e){let t=e;return()=>++t}function warn(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}function createPosition(e,t,r){return{line:e,column:t,offset:r}}function createLocation(e,t,r){const n={start:e,end:t};return null!=r&&(n.source=r),n}const CompileErrorCodes={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16,__EXTEND_POINT__:17};function createCompileError(e,t,r={}){const{domain:n,messages:o,args:s}=r,a=new SyntaxError(String(e));return a.code=e,t&&(a.location=t),a.domain=n,a}function defaultOnError(e){throw e}CompileErrorCodes.EXPECTED_TOKEN,CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER,CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE,CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE,CompileErrorCodes.UNBALANCED_CLOSING_BRACE,CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,CompileErrorCodes.EMPTY_PLACEHOLDER,CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER,CompileErrorCodes.INVALID_LINKED_FORMAT,CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL,CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER,CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY,CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,CompileErrorCodes.UNHANDLED_CODEGEN_NODE_TYPE,CompileErrorCodes.UNHANDLED_MINIFIER_NODE_TYPE;const CHAR_SP=" ",CHAR_CR="\r",CHAR_LF="\n",CHAR_LS=String.fromCharCode(8232),CHAR_PS=String.fromCharCode(8233);function createScanner(e){const t=e;let r=0,n=1,o=1,s=0;const a=e=>t[e]===CHAR_CR&&t[e+1]===CHAR_LF,i=e=>t[e]===CHAR_PS,c=e=>t[e]===CHAR_LS,l=e=>a(e)||(e=>t[e]===CHAR_LF)(e)||i(e)||c(e),u=e=>a(e)||i(e)||c(e)?CHAR_LF:t[e];function E(){return s=0,l(r)&&(n++,o=0),a(r)&&r++,r++,o++,t[r]}return{index:()=>r,line:()=>n,column:()=>o,peekOffset:()=>s,charAt:u,currentChar:()=>u(r),currentPeek:()=>u(r+s),next:E,peek:function(){return a(r+s)&&s++,s++,t[r+s]},reset:function(){r=0,n=1,o=1,s=0},resetPeek:function(e=0){s=e},skipToPeek:function(){const e=r+s;for(;e!==r;)E();s=0}}}const EOF=void 0,DOT=".",LITERAL_DELIMITER="'",ERROR_DOMAIN$1="tokenizer";function createTokenizer(e,t={}){const r=!1!==t.location,n=createScanner(e),o=()=>n.index(),s=()=>createPosition(n.line(),n.column(),n.index()),a=s(),i=o(),c={currentType:14,offset:i,startLoc:a,endLoc:a,lastType:14,lastOffset:i,lastStartLoc:a,lastEndLoc:a,braceNest:0,inLinked:!1,text:""},l=()=>c,{onError:u}=t;function E(e,t,n){e.endLoc=s(),e.currentType=t;const o={type:t};return r&&(o.loc=createLocation(e.startLoc,e.endLoc)),null!=n&&(o.value=n),o}const f=e=>E(e,14);function m(e,t){return e.currentChar()===t?(e.next(),t):(CompileErrorCodes.EXPECTED_TOKEN,s(),"")}function p(e){let t="";for(;e.currentPeek()===CHAR_SP||e.currentPeek()===CHAR_LF;)t+=e.currentPeek(),e.peek();return t}function C(e){const t=p(e);return e.skipToPeek(),t}function d(e){if(e===EOF)return!1;const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||95===t}function _(e,t){const{currentType:r}=t;if(2!==r)return!1;p(e);const n=function(e){if(e===EOF)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),n}function g(e){p(e);const t="|"===e.currentPeek();return e.resetPeek(),t}function N(e,t=!0){const r=(t=!1,n="",o=!1)=>{const s=e.currentPeek();return"{"===s?"%"!==n&&t:"@"!==s&&s?"%"===s?(e.peek(),r(t,"%",!0)):"|"===s?!("%"!==n&&!o)||!(n===CHAR_SP||n===CHAR_LF):s===CHAR_SP?(e.peek(),r(!0,CHAR_SP,o)):s!==CHAR_LF||(e.peek(),r(!0,CHAR_LF,o)):"%"===n||t},n=r();return t&&e.resetPeek(),n}function T(e,t){const r=e.currentChar();return r===EOF?EOF:t(r)?(e.next(),r):null}function A(e){return T(e,(e=>{const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||95===t||36===t}))}function L(e){return T(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57}))}function S(e){return T(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}))}function O(e){let t="",r="";for(;t=L(e);)r+=t;return r}function h(e){let t="";for(;;){const r=e.currentChar();if("{"===r||"}"===r||"@"===r||"|"===r||!r)break;if("%"===r){if(!N(e))break;t+=r,e.next()}else if(r===CHAR_SP||r===CHAR_LF)if(N(e))t+=r,e.next();else{if(g(e))break;t+=r,e.next()}else t+=r,e.next()}return t}function b(e){const t=e.currentChar();switch(t){case"\\":case"'":return e.next(),`\\${t}`;case"u":return k(e,t,4);case"U":return k(e,t,6);default:return CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE,s(),""}}function k(e,t,r){m(e,t);let n="";for(let o=0;o<r;o++){const t=S(e);if(!t){CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE,s(),e.currentChar();break}n+=t}return`\\${t}${n}`}function I(e){C(e);const t=m(e,"|");return C(e),t}function y(e,t){let r=null;switch(e.currentChar()){case"{":return t.braceNest>=1&&(CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER,s()),e.next(),r=E(t,2,"{"),C(e),t.braceNest++,r;case"}":return t.braceNest>0&&2===t.currentType&&(CompileErrorCodes.EMPTY_PLACEHOLDER,s()),e.next(),r=E(t,3,"}"),t.braceNest--,t.braceNest>0&&C(e),t.inLinked&&0===t.braceNest&&(t.inLinked=!1),r;case"@":return t.braceNest>0&&(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s()),r=M(e,t)||f(t),t.braceNest=0,r;default:let n=!0,o=!0,a=!0;if(g(e))return t.braceNest>0&&(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s()),r=E(t,1,I(e)),t.braceNest=0,t.inLinked=!1,r;if(t.braceNest>0&&(5===t.currentType||6===t.currentType||7===t.currentType))return CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s(),t.braceNest=0,P(e,t);if(n=function(e,t){const{currentType:r}=t;if(2!==r)return!1;p(e);const n=d(e.currentPeek());return e.resetPeek(),n}(e,t))return r=E(t,5,function(e){C(e);let t="",r="";for(;t=A(e);)r+=t;return e.currentChar()===EOF&&(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s()),r}(e)),C(e),r;if(o=_(e,t))return r=E(t,6,function(e){C(e);let t="";return"-"===e.currentChar()?(e.next(),t+=`-${O(e)}`):t+=O(e),e.currentChar()===EOF&&(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE,s()),t}(e)),C(e),r;if(a=function(e,t){const{currentType:r}=t;if(2!==r)return!1;p(e);const n=e.currentPeek()===LITERAL_DELIMITER;return e.resetPeek(),n}(e,t))return r=E(t,7,function(e){C(e),m(e,"'");let t="",r="";const n=e=>e!==LITERAL_DELIMITER&&e!==CHAR_LF;for(;t=T(e,n);)r+="\\"===t?b(e):t;const o=e.currentChar();return o===CHAR_LF||o===EOF?(CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),o===CHAR_LF&&(e.next(),m(e,"'")),r):(m(e,"'"),r)}(e)),C(e),r;if(!n&&!o&&!a)return r=E(t,13,function(e){C(e);let t="",r="";const n=e=>"{"!==e&&"}"!==e&&e!==CHAR_SP&&e!==CHAR_LF;for(;t=T(e,n);)r+=t;return r}(e)),CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER,s(),r.value,C(e),r}return r}function M(e,t){const{currentType:r}=t;let n=null;const o=e.currentChar();switch(8!==r&&9!==r&&12!==r&&10!==r||o!==CHAR_LF&&o!==CHAR_SP||(CompileErrorCodes.INVALID_LINKED_FORMAT,s()),o){case"@":return e.next(),n=E(t,8,"@"),t.inLinked=!0,n;case".":return C(e),e.next(),E(t,9,".");case":":return C(e),e.next(),E(t,10,":");default:return g(e)?(n=E(t,1,I(e)),t.braceNest=0,t.inLinked=!1,n):function(e,t){const{currentType:r}=t;if(8!==r)return!1;p(e);const n="."===e.currentPeek();return e.resetPeek(),n}(e,t)||function(e,t){const{currentType:r}=t;if(8!==r&&12!==r)return!1;p(e);const n=":"===e.currentPeek();return e.resetPeek(),n}(e,t)?(C(e),M(e,t)):function(e,t){const{currentType:r}=t;if(9!==r)return!1;p(e);const n=d(e.currentPeek());return e.resetPeek(),n}(e,t)?(C(e),E(t,12,function(e){let t="",r="";for(;t=A(e);)r+=t;return r}(e))):function(e,t){const{currentType:r}=t;if(10!==r)return!1;const n=()=>{const t=e.currentPeek();return"{"===t?d(e.peek()):!("@"===t||"%"===t||"|"===t||":"===t||"."===t||t===CHAR_SP||!t)&&(t===CHAR_LF?(e.peek(),n()):d(t))},o=n();return e.resetPeek(),o}(e,t)?(C(e),"{"===o?y(e,t)||n:E(t,11,function(e){const t=(r=!1,n)=>{const o=e.currentChar();return"{"!==o&&"%"!==o&&"@"!==o&&"|"!==o&&o?o===CHAR_SP?n:o===CHAR_LF||o===DOT?(n+=o,e.next(),t(r,n)):d(o)?(n+=o,e.next(),t(!0,n)):n:n};return t(!1,"")}(e))):(8===r&&(CompileErrorCodes.INVALID_LINKED_FORMAT,s()),t.braceNest=0,t.inLinked=!1,P(e,t))}}function P(e,t){let r={type:14};if(t.braceNest>0)return y(e,t)||f(t);if(t.inLinked)return M(e,t)||f(t);switch(e.currentChar()){case"{":return y(e,t)||f(t);case"}":return CompileErrorCodes.UNBALANCED_CLOSING_BRACE,s(),e.next(),E(t,3,"}");case"@":return M(e,t)||f(t);default:if(g(e))return r=E(t,1,I(e)),t.braceNest=0,t.inLinked=!1,r;const{isModulo:n,hasSpace:o}=function(e){const t=p(e),r="%"===e.currentPeek()&&"{"===e.peek();return e.resetPeek(),{isModulo:r,hasSpace:t.length>0}}(e);if(n)return o?E(t,0,h(e)):E(t,4,function(e){C(e);const t=e.currentChar();return"%"!==t&&(CompileErrorCodes.EXPECTED_TOKEN,s()),e.next(),"%"}(e));if(N(e))return E(t,0,h(e))}return r}return{nextToken:function(){const{currentType:e,offset:t,startLoc:r,endLoc:a}=c;return c.lastType=e,c.lastOffset=t,c.lastStartLoc=r,c.lastEndLoc=a,c.offset=o(),c.startLoc=s(),n.currentChar()===EOF?E(c,14):P(n,c)},currentOffset:o,currentPosition:s,context:l}}const ERROR_DOMAIN="parser",KNOWN_ESCAPES=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function fromEscapeSequence(e,t,r){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const e=parseInt(t||r,16);return e<=55295||e>=57344?String.fromCodePoint(e):"�"}}}function createParser(e={}){const t=!1!==e.location,{onError:r}=e;function n(e,r,n){const o={type:e};return t&&(o.start=r,o.end=r,o.loc={start:n,end:n}),o}function o(e,r,n,o){o&&(e.type=o),t&&(e.end=r,e.loc&&(e.loc.end=n))}function s(e,t){const r=e.context(),s=n(3,r.offset,r.startLoc);return s.value=t,o(s,e.currentOffset(),e.currentPosition()),s}function a(e,t){const r=e.context(),{lastOffset:s,lastStartLoc:a}=r,i=n(5,s,a);return i.index=parseInt(t,10),e.nextToken(),o(i,e.currentOffset(),e.currentPosition()),i}function i(e,t){const r=e.context(),{lastOffset:s,lastStartLoc:a}=r,i=n(4,s,a);return i.key=t,e.nextToken(),o(i,e.currentOffset(),e.currentPosition()),i}function c(e,t){const r=e.context(),{lastOffset:s,lastStartLoc:a}=r,i=n(9,s,a);return i.value=t.replace(KNOWN_ESCAPES,fromEscapeSequence),e.nextToken(),o(i,e.currentOffset(),e.currentPosition()),i}function l(e){const t=e.context(),r=n(6,t.offset,t.startLoc);let s=e.nextToken();if(9===s.type){const t=function(e){const t=e.nextToken(),r=e.context(),{lastOffset:s,lastStartLoc:a}=r,i=n(8,s,a);return 12!==t.type?(CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER,r.lastStartLoc,i.value="",o(i,s,a),{nextConsumeToken:t,node:i}):(null==t.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,r.lastStartLoc,getTokenCaption(t)),i.value=t.value||"",o(i,e.currentOffset(),e.currentPosition()),{node:i})}(e);r.modifier=t.node,s=t.nextConsumeToken||e.nextToken()}switch(10!==s.type&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),s=e.nextToken(),2===s.type&&(s=e.nextToken()),s.type){case 11:null==s.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),r.key=function(e,t){const r=e.context(),s=n(7,r.offset,r.startLoc);return s.value=t,o(s,e.currentOffset(),e.currentPosition()),s}(e,s.value||"");break;case 5:null==s.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),r.key=i(e,s.value||"");break;case 6:null==s.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),r.key=a(e,s.value||"");break;case 7:null==s.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(s)),r.key=c(e,s.value||"");break;default:CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY,t.lastStartLoc;const l=e.context(),u=n(7,l.offset,l.startLoc);return u.value="",o(u,l.offset,l.startLoc),r.key=u,o(r,l.offset,l.startLoc),{nextConsumeToken:s,node:r}}return o(r,e.currentOffset(),e.currentPosition()),{node:r}}function u(e){const t=e.context(),r=n(2,1===t.currentType?e.currentOffset():t.offset,1===t.currentType?t.endLoc:t.startLoc);r.items=[];let u=null;do{const n=u||e.nextToken();switch(u=null,n.type){case 0:null==n.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(n)),r.items.push(s(e,n.value||""));break;case 6:null==n.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(n)),r.items.push(a(e,n.value||""));break;case 5:null==n.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(n)),r.items.push(i(e,n.value||""));break;case 7:null==n.value&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,getTokenCaption(n)),r.items.push(c(e,n.value||""));break;case 8:const o=l(e);r.items.push(o.node),u=o.nextConsumeToken||null}}while(14!==t.currentType&&1!==t.currentType);return o(r,1===t.currentType?t.lastOffset:e.currentOffset(),1===t.currentType?t.lastEndLoc:e.currentPosition()),r}function E(e){const t=e.context(),{offset:r,startLoc:s}=t,a=u(e);return 14===t.currentType?a:function(e,t,r,s){const a=e.context();let i=0===s.items.length;const c=n(1,t,r);c.cases=[],c.cases.push(s);do{const t=u(e);i||(i=0===t.items.length),c.cases.push(t)}while(14!==a.currentType);return i&&CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL,o(c,e.currentOffset(),e.currentPosition()),c}(e,r,s,a)}return{parse:function(r){const s=createTokenizer(r,assign({},e)),a=s.context(),i=n(0,a.offset,a.startLoc);return t&&i.loc&&(i.loc.source=r),i.body=E(s),e.onCacheKey&&(i.cacheKey=e.onCacheKey(r)),14!==a.currentType&&(CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS,a.lastStartLoc,r[a.offset]),o(i,s.currentOffset(),s.currentPosition()),i}}}function getTokenCaption(e){if(14===e.type)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function createTransformer(e,t={}){const r={ast:e,helpers:new Set};return{context:()=>r,helper:e=>(r.helpers.add(e),e)}}function traverseNodes(e,t){for(let r=0;r<e.length;r++)traverseNode(e[r],t)}function traverseNode(e,t){switch(e.type){case 1:traverseNodes(e.cases,t),t.helper("plural");break;case 2:traverseNodes(e.items,t);break;case 6:traverseNode(e.key,t),t.helper("linked"),t.helper("type");break;case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named")}}function transform(e,t={}){const r=createTransformer(e);r.helper("normalize"),e.body&&traverseNode(e.body,r);const n=r.context();e.helpers=Array.from(n.helpers)}function optimize(e){const t=e.body;return 2===t.type?optimizeMessageNode(t):t.cases.forEach((e=>optimizeMessageNode(e))),e}function optimizeMessageNode(e){if(1===e.items.length){const t=e.items[0];3!==t.type&&9!==t.type||(e.static=t.value,delete t.value)}else{const t=[];for(let r=0;r<e.items.length;r++){const n=e.items[r];if(3!==n.type&&9!==n.type)break;if(null==n.value)break;t.push(n.value)}if(t.length===e.items.length){e.static=join(t);for(let t=0;t<e.items.length;t++){const r=e.items[t];3!==r.type&&9!==r.type||delete r.value}}}}function minify(e){switch(e.t=e.type,e.type){case 0:const t=e;minify(t.body),t.b=t.body,delete t.body;break;case 1:const r=e,n=r.cases;for(let e=0;e<n.length;e++)minify(n[e]);r.c=n,delete r.cases;break;case 2:const o=e,s=o.items;for(let e=0;e<s.length;e++)minify(s[e]);o.i=s,delete o.items,o.static&&(o.s=o.static,delete o.static);break;case 3:case 9:case 8:case 7:const a=e;a.value&&(a.v=a.value,delete a.value);break;case 6:const i=e;minify(i.key),i.k=i.key,delete i.key,i.modifier&&(minify(i.modifier),i.m=i.modifier,delete i.modifier);break;case 5:const c=e;c.i=c.index,delete c.index;break;case 4:const l=e;l.k=l.key,delete l.key}delete e.type}function createCodeGenerator(e,t){const{sourceMap:r,filename:n,breakLineCode:o,needIndent:s}=t,a=!1!==t.location,i={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:s,indentLevel:0};a&&e.loc&&(i.source=e.loc.source);function c(e,t){i.code+=e}function l(e,t=!0){const r=t?o:"";c(s?r+" ".repeat(e):r)}return{context:()=>i,push:c,indent:function(e=!0){const t=++i.indentLevel;e&&l(t)},deindent:function(e=!0){const t=--i.indentLevel;e&&l(t)},newline:function(){l(i.indentLevel)},helper:e=>`_${e}`,needIndent:()=>i.needIndent}}function generateLinkedNode(e,t){const{helper:r}=e;e.push(`${r("linked")}(`),generateNode(e,t.key),t.modifier?(e.push(", "),generateNode(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function generateMessageNode(e,t){const{helper:r,needIndent:n}=e;e.push(`${r("normalize")}([`),e.indent(n());const o=t.items.length;for(let s=0;s<o&&(generateNode(e,t.items[s]),s!==o-1);s++)e.push(", ");e.deindent(n()),e.push("])")}function generatePluralNode(e,t){const{helper:r,needIndent:n}=e;if(t.cases.length>1){e.push(`${r("plural")}([`),e.indent(n());const o=t.cases.length;for(let r=0;r<o&&(generateNode(e,t.cases[r]),r!==o-1);r++)e.push(", ");e.deindent(n()),e.push("])")}}function generateResource(e,t){t.body?generateNode(e,t.body):e.push("null")}function generateNode(e,t){const{helper:r}=e;switch(t.type){case 0:generateResource(e,t);break;case 1:generatePluralNode(e,t);break;case 2:generateMessageNode(e,t);break;case 6:generateLinkedNode(e,t);break;case 8:case 7:case 9:case 3:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${r("interpolate")}(${r("list")}(${t.index}))`,t);break;case 4:e.push(`${r("interpolate")}(${r("named")}(${JSON.stringify(t.key)}))`,t)}}const generate=(e,t={})=>{const r=isString(t.mode)?t.mode:"normal",n=isString(t.filename)?t.filename:"message.intl",o=!!t.sourceMap,s=null!=t.breakLineCode?t.breakLineCode:"arrow"===r?";":"\n",a=t.needIndent?t.needIndent:"arrow"!==r,i=e.helpers||[],c=createCodeGenerator(e,{mode:r,filename:n,sourceMap:o,breakLineCode:s,needIndent:a});c.push("normal"===r?"function __msg__ (ctx) {":"(ctx) => {"),c.indent(a),i.length>0&&(c.push(`const { ${join(i.map((e=>`${e}: _${e}`)),", ")} } = ctx`),c.newline()),c.push("return "),generateNode(c,e),c.deindent(a),c.push("}"),delete e.helpers;const{code:l,map:u}=c.context();return{ast:e,code:l,map:u?u.toJSON():void 0}};function baseCompile$1(e,t={}){const r=assign({},t),n=!!r.jit,o=!!r.minify,s=null==r.optimize||r.optimize,a=createParser(r).parse(e);return n?(s&&optimize(a),o&&minify(a),{ast:a,code:""}):(transform(a,r),generate(a,r))}const pathStateMachine=[];pathStateMachine[0]={w:[0],i:[3,0],"[":[4],o:[7]},pathStateMachine[1]={w:[1],".":[2],"[":[4],o:[7]},pathStateMachine[2]={w:[2],i:[3,0],0:[3,0]},pathStateMachine[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},pathStateMachine[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},pathStateMachine[5]={"'":[4,0],o:8,l:[5,0]},pathStateMachine[6]={'"':[4,0],o:8,l:[6,0]};const literalValueRE=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function isLiteral(e){return literalValueRE.test(e)}function stripQuotes(e){const t=e.charCodeAt(0);return t!==e.charCodeAt(e.length-1)||34!==t&&39!==t?e:e.slice(1,-1)}function getPathCharType(e){if(null==e)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function formatSubPath(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(isLiteral(t)?stripQuotes(t):"*"+t)}function parse(e){const t=[];let r,n,o,s,a,i,c,l=-1,u=0,E=0;const f=[];function m(){const t=e[l+1];if(5===u&&"'"===t||6===u&&'"'===t)return l++,o="\\"+t,f[0](),!0}for(f[0]=()=>{void 0===n?n=o:n+=o},f[1]=()=>{void 0!==n&&(t.push(n),n=void 0)},f[2]=()=>{f[0](),E++},f[3]=()=>{if(E>0)E--,u=4,f[0]();else{if(E=0,void 0===n)return!1;if(n=formatSubPath(n),!1===n)return!1;f[1]()}};null!==u;)if(l++,r=e[l],"\\"!==r||!m()){if(s=getPathCharType(r),c=pathStateMachine[u],a=c[s]||c.l||8,8===a)return;if(u=a[0],void 0!==a[1]&&(i=f[a[1]],i&&(o=r,!1===i())))return;if(7===u)return t}}const cache=new Map;function resolveWithKeyValue(e,t){return isObject(e)?e[t]:null}function resolveValue(e,t){if(!isObject(e))return null;let r=cache.get(t);if(r||(r=parse(t),r&&cache.set(t,r)),!r)return null;const n=r.length;let o=e,s=0;for(;s<n;){const e=o[r[s]];if(void 0===e)return null;o=e,s++}return o}const DEFAULT_MODIFIER=e=>e,DEFAULT_MESSAGE=e=>"",DEFAULT_MESSAGE_DATA_TYPE="text",DEFAULT_NORMALIZE=e=>0===e.length?"":join(e),DEFAULT_INTERPOLATE=toDisplayString;function pluralDefault(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function getPluralIndex(e){const t=isNumber(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(isNumber(e.named.count)||isNumber(e.named.n))?isNumber(e.named.count)?e.named.count:isNumber(e.named.n)?e.named.n:t:t}function normalizeNamed(e,t){t.count||(t.count=e),t.n||(t.n=e)}function createMessageContext(e={}){const t=e.locale,r=getPluralIndex(e),n=isObject(e.pluralRules)&&isString(t)&&isFunction(e.pluralRules[t])?e.pluralRules[t]:pluralDefault,o=isObject(e.pluralRules)&&isString(t)&&isFunction(e.pluralRules[t])?pluralDefault:void 0,s=e.list||[],a=e.named||{};isNumber(e.pluralIndex)&&normalizeNamed(r,a);function i(t){const r=isFunction(e.messages)?e.messages(t):!!isObject(e.messages)&&e.messages[t];return r||(e.parent?e.parent.message(t):DEFAULT_MESSAGE)}const c=isPlainObject(e.processor)&&isFunction(e.processor.normalize)?e.processor.normalize:DEFAULT_NORMALIZE,l=isPlainObject(e.processor)&&isFunction(e.processor.interpolate)?e.processor.interpolate:DEFAULT_INTERPOLATE,u={list:e=>s[e],named:e=>a[e],plural:e=>e[n(r,e.length,o)],linked:(t,...r)=>{const[n,o]=r;let s="text",a="";1===r.length?isObject(n)?(a=n.modifier||a,s=n.type||s):isString(n)&&(a=n||a):2===r.length&&(isString(n)&&(a=n||a),isString(o)&&(s=o||s));const c=i(t)(u),l="vnode"===s&&isArray(c)&&a?c[0]:c;return a?(E=a,e.modifiers?e.modifiers[E]:DEFAULT_MODIFIER)(l,s):l;var E},message:i,type:isPlainObject(e.processor)&&isString(e.processor.type)?e.processor.type:DEFAULT_MESSAGE_DATA_TYPE,interpolate:l,normalize:c,values:assign({},s,a)};return u}const IntlifyDevToolsHooks={I18nInit:"i18n:init",FunctionTranslate:"function:translate"};let devtools=null;function setDevToolsHook(e){devtools=e}function getDevToolsHook(){return devtools}function initI18nDevTools(e,t,r){devtools&&devtools.emit(IntlifyDevToolsHooks.I18nInit,{timestamp:Date.now(),i18n:e,version:t,meta:r})}const translateDevTools=createDevToolsHook(IntlifyDevToolsHooks.FunctionTranslate);function createDevToolsHook(e){return t=>devtools&&devtools.emit(e,t)}const CoreWarnCodes={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7,__EXTEND_POINT__:8},warnMessages={[CoreWarnCodes.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[CoreWarnCodes.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[CoreWarnCodes.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[CoreWarnCodes.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[CoreWarnCodes.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[CoreWarnCodes.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[CoreWarnCodes.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};function getWarnMessage(e,...t){return format$1(warnMessages[e],...t)}function fallbackWithSimple(e,t,r){return[...new Set([r,...isArray(t)?t:isObject(t)?Object.keys(t):isString(t)?[t]:[r]])]}function fallbackWithLocaleChain(e,t,r){const n=isString(r)?r:DEFAULT_LOCALE,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let s=o.__localeChainCache.get(n);if(!s){s=[];let e=[r];for(;isArray(e);)e=appendBlockToChain(s,e,t);const a=isArray(t)||!isPlainObject(t)?t:t.default?t.default:null;e=isString(a)?[a]:a,isArray(e)&&appendBlockToChain(s,e,!1),o.__localeChainCache.set(n,s)}return s}function appendBlockToChain(e,t,r){let n=!0;for(let o=0;o<t.length&&isBoolean(n);o++){const s=t[o];isString(s)&&(n=appendLocaleToChain(e,t[o],r))}return n}function appendLocaleToChain(e,t,r){let n;const o=t.split("-");do{n=appendItemToChain(e,o.join("-"),r),o.splice(-1,1)}while(o.length&&!0===n);return n}function appendItemToChain(e,t,r){let n=!1;if(!e.includes(t)&&(n=!0,t)){n="!"!==t[t.length-1];const o=t.replace(/!/g,"");e.push(o),(isArray(r)||isPlainObject(r))&&r[o]&&(n=r[o])}return n}const VERSION="9.3.0",NOT_REOSLVED=-1,DEFAULT_LOCALE="en-US",MISSING_RESOLVE_VALUE="",capitalize=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function getDefaultLinkedModifiers(){return{upper:(e,t)=>"text"===t&&isString(e)?e.toUpperCase():"vnode"===t&&isObject(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>"text"===t&&isString(e)?e.toLowerCase():"vnode"===t&&isObject(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>"text"===t&&isString(e)?capitalize(e):"vnode"===t&&isObject(e)&&"__v_isVNode"in e?capitalize(e.children):e}}let _compiler,_resolver,_fallbacker;function registerMessageCompiler(e){_compiler=e}function registerMessageResolver(e){_resolver=e}function registerLocaleFallbacker(e){_fallbacker=e}let _additionalMeta=null;const setAdditionalMeta=e=>{_additionalMeta=e},getAdditionalMeta=()=>_additionalMeta;let _fallbackContext=null;const setFallbackContext=e=>{_fallbackContext=e},getFallbackContext=()=>_fallbackContext;let _cid=0;function createCoreContext(e={}){const t=isFunction(e.onWarn)?e.onWarn:warn,r=isString(e.version)?e.version:"9.3.0",n=isString(e.locale)?e.locale:DEFAULT_LOCALE,o=isArray(e.fallbackLocale)||isPlainObject(e.fallbackLocale)||isString(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:n,s=isPlainObject(e.messages)?e.messages:{[n]:{}},a=isPlainObject(e.datetimeFormats)?e.datetimeFormats:{[n]:{}},i=isPlainObject(e.numberFormats)?e.numberFormats:{[n]:{}},c=assign({},e.modifiers||{},getDefaultLinkedModifiers()),l=e.pluralRules||{},u=isFunction(e.missing)?e.missing:null,E=!isBoolean(e.missingWarn)&&!isRegExp(e.missingWarn)||e.missingWarn,f=!isBoolean(e.fallbackWarn)&&!isRegExp(e.fallbackWarn)||e.fallbackWarn,m=!!e.fallbackFormat,p=!!e.unresolving,C=isFunction(e.postTranslation)?e.postTranslation:null,d=isPlainObject(e.processor)?e.processor:null,_=!isBoolean(e.warnHtmlMessage)||e.warnHtmlMessage,g=!!e.escapeParameter,N=isFunction(e.messageCompiler)?e.messageCompiler:_compiler,T=isFunction(e.messageResolver)?e.messageResolver:_resolver||resolveWithKeyValue,A=isFunction(e.localeFallbacker)?e.localeFallbacker:_fallbacker||fallbackWithSimple,L=isObject(e.fallbackContext)?e.fallbackContext:void 0,S=e,O=isObject(S.__datetimeFormatters)?S.__datetimeFormatters:new Map,h=isObject(S.__numberFormatters)?S.__numberFormatters:new Map,b=isObject(S.__meta)?S.__meta:{};_cid++;const k={version:r,cid:_cid,locale:n,fallbackLocale:o,messages:s,modifiers:c,pluralRules:l,missing:u,missingWarn:E,fallbackWarn:f,fallbackFormat:m,unresolving:p,postTranslation:C,processor:d,warnHtmlMessage:_,escapeParameter:g,messageCompiler:N,messageResolver:T,localeFallbacker:A,fallbackContext:L,onWarn:t,__meta:b};return k.datetimeFormats=a,k.numberFormats=i,k.__datetimeFormatters=O,k.__numberFormatters=h,k}function isTranslateFallbackWarn(e,t){return e instanceof RegExp?e.test(t):e}function isTranslateMissingWarn(e,t){return e instanceof RegExp?e.test(t):e}function handleMissing(e,t,r,n,o){const{missing:s,onWarn:a}=e;if(null!==s){const n=s(e,r,t,o);return isString(n)?n:t}return t}function updateFallbackLocale(e,t,r){e.__localeChainCache=new Map,e.localeFallbacker(e,r,t)}function format(e){return t=>formatParts(t,e)}function formatParts(e,t){const r=t.b||t.body;if(1===(r.t||r.type)){const t=r,n=t.c||t.cases;return e.plural(n.reduce(((t,r)=>[...t,formatMessageParts(e,r)]),[]))}return formatMessageParts(e,r)}function formatMessageParts(e,t){const r=t.s||t.static;if(r)return"text"===e.type?r:e.normalize([r]);{const r=(t.i||t.items).reduce(((t,r)=>[...t,formatMessagePart(e,r)]),[]);return e.normalize(r)}}function formatMessagePart(e,t){const r=t.t||t.type;switch(r){case 3:const n=t;return n.v||n.value;case 9:const o=t;return o.v||o.value;case 4:const s=t;return e.interpolate(e.named(s.k||s.key));case 5:const a=t;return e.interpolate(e.list(a.i||a.index));case 6:const i=t,c=i.m||i.modifier;return e.linked(formatMessagePart(e,i.k||i.key),c?formatMessagePart(e,c):void 0,e.type);case 7:const l=t;return l.v||l.value;case 8:const u=t;return u.v||u.value;default:throw new Error(`unhandled node type on format message part: ${r}`)}}const code=CompileErrorCodes.__EXTEND_POINT__,inc=incrementer(code),CoreErrorCodes={INVALID_ARGUMENT:code,INVALID_DATE_ARGUMENT:inc(),INVALID_ISO_DATE_ARGUMENT:inc(),NOT_SUPPORT_NON_STRING_MESSAGE:inc(),__EXTEND_POINT__:inc()};function createCoreError(e){return createCompileError(e,null,void 0)}CoreErrorCodes.INVALID_ARGUMENT,CoreErrorCodes.INVALID_DATE_ARGUMENT,CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT,CoreErrorCodes.NOT_SUPPORT_NON_STRING_MESSAGE;const defaultOnCacheKey=e=>e;let compileCache=Object.create(null);function clearCompileCache(){compileCache=Object.create(null)}const isMessageAST=e=>isObject(e)&&(0===e.t||0===e.type)&&("b"in e||"body"in e);function baseCompile(e,t={}){let r=!1;const n=t.onError||defaultOnError;return t.onError=e=>{r=!0,n(e)},{...baseCompile$1(e,t),detectError:r}}function compileToFunction(e,t){if(!isString(e))throw Error(CoreErrorCodes.NOT_SUPPORT_NON_STRING_MESSAGE);{!isBoolean(t.warnHtmlMessage)||t.warnHtmlMessage;const r=(t.onCacheKey||defaultOnCacheKey)(e),n=compileCache[r];if(n)return n;const{code:o,detectError:s}=baseCompile(e,t),a=new Function(`return ${o}`)();return s?a:compileCache[r]=a}}function compile(e,t){{const t=e.cacheKey;if(t){const r=compileCache[t];return r||(compileCache[t]=format(e))}return format(e)}}const NOOP_MESSAGE_FUNCTION=()=>"",isMessageFunction=e=>isFunction(e);function translate(e,...t){const{fallbackFormat:r,postTranslation:n,unresolving:o,messageCompiler:s,fallbackLocale:a,messages:i}=e,[c,l]=parseTranslateArgs(...t),u=isBoolean(l.missingWarn)?l.missingWarn:e.missingWarn,E=isBoolean(l.fallbackWarn)?l.fallbackWarn:e.fallbackWarn,f=isBoolean(l.escapeParameter)?l.escapeParameter:e.escapeParameter,m=!!l.resolvedMessage,p=isString(l.default)||isBoolean(l.default)?isBoolean(l.default)?s?c:()=>c:l.default:r?s?c:()=>c:"",C=r||""!==p,d=isString(l.locale)?l.locale:e.locale;f&&escapeParams(l);let[_,g,N]=m?[c,d,i[d]||{}]:resolveMessageFormat(e,c,d,a,E,u),T=_,A=c;if(m||isString(T)||isMessageAST(T)||isMessageFunction(T)||C&&(T=p,A=T),!(m||(isString(T)||isMessageAST(T)||isMessageFunction(T))&&isString(g)))return o?-1:c;let L=!1;const S=isMessageFunction(T)?T:compileMessageFormat(e,c,g,T,A,(()=>{L=!0}));if(L)return T;const O=evaluateMessage(e,S,createMessageContext(getMessageContextOptions(e,g,N,l)));return n?n(O,c):O}function escapeParams(e){isArray(e.list)?e.list=e.list.map((e=>isString(e)?escapeHtml(e):e)):isObject(e.named)&&Object.keys(e.named).forEach((t=>{isString(e.named[t])&&(e.named[t]=escapeHtml(e.named[t]))}))}function resolveMessageFormat(e,t,r,n,o,s){const{messages:a,onWarn:i,messageResolver:c,localeFallbacker:l}=e,u=l(e,n,r);let E,f={},m=null;for(let p=0;p<u.length&&(E=u[p],f=a[E]||{},null===(m=c(f,t))&&(m=f[t]),!(isString(m)||isMessageAST(m)||isMessageFunction(m)));p++){const r=handleMissing(e,t,E,s,"translate");r!==t&&(m=r)}return[m,E,f]}function compileMessageFormat(e,t,r,n,o,s){const{messageCompiler:a,warnHtmlMessage:i}=e;if(isMessageFunction(n)){const e=n;return e.locale=e.locale||r,e.key=e.key||t,e}if(null==a){const e=()=>n;return e.locale=r,e.key=t,e}const c=a(n,getCompileContext(e,r,o,n,i,s));return c.locale=r,c.key=t,c.source=n,c}function evaluateMessage(e,t,r){return t(r)}function parseTranslateArgs(...e){const[t,r,n]=e,o={};if(!(isString(t)||isNumber(t)||isMessageFunction(t)||isMessageAST(t)))throw Error(CoreErrorCodes.INVALID_ARGUMENT);const s=isNumber(t)?String(t):(isMessageFunction(t),t);return isNumber(r)?o.plural=r:isString(r)?o.default=r:isPlainObject(r)&&!isEmptyObject(r)?o.named=r:isArray(r)&&(o.list=r),isNumber(n)?o.plural=n:isString(n)?o.default=n:isPlainObject(n)&&assign(o,n),[s,o]}function getCompileContext(e,t,r,n,o,s){return{locale:t,key:r,warnHtmlMessage:o,onError:e=>{throw s&&s(e),e},onCacheKey:e=>generateFormatCacheKey(t,r,e)}}function getMessageContextOptions(e,t,r,n){const{modifiers:o,pluralRules:s,messageResolver:a,fallbackLocale:i,fallbackWarn:c,missingWarn:l,fallbackContext:u}=e,E={locale:t,modifiers:o,pluralRules:s,messages:n=>{let o=a(r,n);if(null==o&&u){const[,,e]=resolveMessageFormat(u,n,t,i,c,l);o=a(e,n)}if(isString(o)||isMessageAST(o)){let r=!1;const s=compileMessageFormat(e,n,t,o,n,(()=>{r=!0}));return r?NOOP_MESSAGE_FUNCTION:s}return isMessageFunction(o)?o:NOOP_MESSAGE_FUNCTION}};return e.processor&&(E.processor=e.processor),n.list&&(E.list=n.list),n.named&&(E.named=n.named),isNumber(n.plural)&&(E.pluralIndex=n.plural),E}function datetime(e,...t){const{datetimeFormats:r,unresolving:n,fallbackLocale:o,onWarn:s,localeFallbacker:a}=e,{__datetimeFormatters:i}=e,[c,l,u,E]=parseDateTimeArgs(...t),f=isBoolean(u.missingWarn)?u.missingWarn:e.missingWarn;isBoolean(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const m=!!u.part,p=isString(u.locale)?u.locale:e.locale,C=a(e,o,p);if(!isString(c)||""===c)return new Intl.DateTimeFormat(p,E).format(l);let d,_={},g=null;for(let A=0;A<C.length&&(d=C[A],_=r[d]||{},g=_[c],!isPlainObject(g));A++)handleMissing(e,c,d,f,"datetime format");if(!isPlainObject(g)||!isString(d))return n?-1:c;let N=`${d}__${c}`;isEmptyObject(E)||(N=`${N}__${JSON.stringify(E)}`);let T=i.get(N);return T||(T=new Intl.DateTimeFormat(d,assign({},g,E)),i.set(N,T)),m?T.formatToParts(l):T.format(l)}const DATETIME_FORMAT_OPTIONS_KEYS=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function parseDateTimeArgs(...e){const[t,r,n,o]=e,s={};let a,i={};if(isString(t)){const e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Error(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT);const r=e[3]?e[3].trim().startsWith("T")?`${e[1].trim()}${e[3].trim()}`:`${e[1].trim()}T${e[3].trim()}`:e[1].trim();a=new Date(r);try{a.toISOString()}catch(c){throw Error(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT)}}else if(isDate(t)){if(isNaN(t.getTime()))throw Error(CoreErrorCodes.INVALID_DATE_ARGUMENT);a=t}else{if(!isNumber(t))throw Error(CoreErrorCodes.INVALID_ARGUMENT);a=t}return isString(r)?s.key=r:isPlainObject(r)&&Object.keys(r).forEach((e=>{DATETIME_FORMAT_OPTIONS_KEYS.includes(e)?i[e]=r[e]:s[e]=r[e]})),isString(n)?s.locale=n:isPlainObject(n)&&(i=n),isPlainObject(o)&&(i=o),[s.key||"",a,s,i]}function clearDateTimeFormat(e,t,r){const n=e;for(const o in r){const e=`${t}__${o}`;n.__datetimeFormatters.has(e)&&n.__datetimeFormatters.delete(e)}}function number(e,...t){const{numberFormats:r,unresolving:n,fallbackLocale:o,onWarn:s,localeFallbacker:a}=e,{__numberFormatters:i}=e,[c,l,u,E]=parseNumberArgs(...t),f=isBoolean(u.missingWarn)?u.missingWarn:e.missingWarn;isBoolean(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn;const m=!!u.part,p=isString(u.locale)?u.locale:e.locale,C=a(e,o,p);if(!isString(c)||""===c)return new Intl.NumberFormat(p,E).format(l);let d,_={},g=null;for(let A=0;A<C.length&&(d=C[A],_=r[d]||{},g=_[c],!isPlainObject(g));A++)handleMissing(e,c,d,f,"number format");if(!isPlainObject(g)||!isString(d))return n?-1:c;let N=`${d}__${c}`;isEmptyObject(E)||(N=`${N}__${JSON.stringify(E)}`);let T=i.get(N);return T||(T=new Intl.NumberFormat(d,assign({},g,E)),i.set(N,T)),m?T.formatToParts(l):T.format(l)}const NUMBER_FORMAT_OPTIONS_KEYS=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function parseNumberArgs(...e){const[t,r,n,o]=e,s={};let a={};if(!isNumber(t))throw Error(CoreErrorCodes.INVALID_ARGUMENT);const i=t;return isString(r)?s.key=r:isPlainObject(r)&&Object.keys(r).forEach((e=>{NUMBER_FORMAT_OPTIONS_KEYS.includes(e)?a[e]=r[e]:s[e]=r[e]})),isString(n)?s.locale=n:isPlainObject(n)&&(a=n),isPlainObject(o)&&(a=o),[s.key||"",i,s,a]}function clearNumberFormat(e,t,r){const n=e;for(const o in r){const e=`${t}__${o}`;n.__numberFormatters.has(e)&&n.__numberFormatters.delete(e)}}export{CompileErrorCodes,CoreErrorCodes,CoreWarnCodes,DATETIME_FORMAT_OPTIONS_KEYS,DEFAULT_LOCALE,DEFAULT_MESSAGE_DATA_TYPE,MISSING_RESOLVE_VALUE,NOT_REOSLVED,NUMBER_FORMAT_OPTIONS_KEYS,VERSION,clearCompileCache,clearDateTimeFormat,clearNumberFormat,compile,compileToFunction,createCompileError,createCoreContext,createCoreError,createMessageContext,datetime,fallbackWithLocaleChain,fallbackWithSimple,getAdditionalMeta,getDevToolsHook,getFallbackContext,getWarnMessage,handleMissing,initI18nDevTools,isMessageAST,isMessageFunction,isTranslateFallbackWarn,isTranslateMissingWarn,number,parse,parseDateTimeArgs,parseNumberArgs,parseTranslateArgs,registerLocaleFallbacker,registerMessageCompiler,registerMessageResolver,resolveValue,resolveWithKeyValue,setAdditionalMeta,setDevToolsHook,setFallbackContext,translate,translateDevTools,updateFallbackLocale}; |
/*! | ||
* core-base v9.3.0-beta.14 | ||
* core-base v9.3.0 | ||
* (c) 2023 kazuya kawaguchi | ||
* Released under the MIT License. | ||
*/ | ||
var IntlifyCoreBase=function(e){"use strict";const t=/\{([0-9a-zA-Z]+)\}/g;const n=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),r=e=>"number"==typeof e&&isFinite(e),o=e=>"[object RegExp]"===_(e),a=e=>k(e)&&0===Object.keys(e).length;function s(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const c=Object.assign;function l(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const u=Array.isArray,i=e=>"function"==typeof e,f=e=>"string"==typeof e,m=e=>"boolean"==typeof e,p=e=>null!==e&&"object"==typeof e,d=Object.prototype.toString,_=e=>d.call(e),k=e=>"[object Object]"===_(e),h={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,__EXTEND_POINT__:15};function g(e,t,n={}){const{domain:r,messages:o,args:a}=n,s=new SyntaxError(String(e));return s.code=e,t&&(s.location=t),s.domain=r,s}function T(e){throw e}function b(e,t,n){const r={start:e,end:t};return null!=n&&(r.source=n),r}const E=" ",L="\n",y=String.fromCharCode(8232),N=String.fromCharCode(8233);function C(e){const t=e;let n=0,r=1,o=1,a=0;const s=e=>"\r"===t[e]&&t[e+1]===L,c=e=>t[e]===N,l=e=>t[e]===y,u=e=>s(e)||(e=>t[e]===L)(e)||c(e)||l(e),i=e=>s(e)||c(e)||l(e)?L:t[e];function f(){return a=0,u(n)&&(r++,o=0),s(n)&&n++,n++,o++,t[n]}return{index:()=>n,line:()=>r,column:()=>o,peekOffset:()=>a,charAt:i,currentChar:()=>i(n),currentPeek:()=>i(n+a),next:f,peek:function(){return s(n+a)&&a++,a++,t[n+a]},reset:function(){n=0,r=1,o=1,a=0},resetPeek:function(e=0){a=e},skipToPeek:function(){const e=n+a;for(;e!==n;)f();a=0}}}const A=void 0;function O(e,t={}){const n=!1!==t.location,r=C(e),o=()=>r.index(),a=()=>{return e=r.line(),t=r.column(),n=r.index(),{line:e,column:t,offset:n};var e,t,n},s=a(),c=o(),l={currentType:14,offset:c,startLoc:s,endLoc:s,lastType:14,lastOffset:c,lastStartLoc:s,lastEndLoc:s,braceNest:0,inLinked:!1,text:""},u=()=>l,{onError:i}=t;function f(e,t,r){e.endLoc=a(),e.currentType=t;const o={type:t};return n&&(o.loc=b(e.startLoc,e.endLoc)),null!=r&&(o.value=r),o}const m=e=>f(e,14);function p(e,t){return e.currentChar()===t?(e.next(),t):(a(),"")}function d(e){let t="";for(;e.currentPeek()===E||e.currentPeek()===L;)t+=e.currentPeek(),e.peek();return t}function _(e){const t=d(e);return e.skipToPeek(),t}function k(e){if(e===A)return!1;const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||95===t}function h(e,t){const{currentType:n}=t;if(2!==n)return!1;d(e);const r=function(e){if(e===A)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),r}function g(e){d(e);const t="|"===e.currentPeek();return e.resetPeek(),t}function T(e,t=!0){const n=(t=!1,r="",o=!1)=>{const a=e.currentPeek();return"{"===a?"%"!==r&&t:"@"!==a&&a?"%"===a?(e.peek(),n(t,"%",!0)):"|"===a?!("%"!==r&&!o)||!(r===E||r===L):a===E?(e.peek(),n(!0,E,o)):a!==L||(e.peek(),n(!0,L,o)):"%"===r||t},r=n();return t&&e.resetPeek(),r}function y(e,t){const n=e.currentChar();return n===A?A:t(n)?(e.next(),n):null}function N(e){return y(e,(e=>{const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||95===t||36===t}))}function O(e){return y(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57}))}function x(e){return y(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}))}function v(e){let t="",n="";for(;t=O(e);)n+=t;return n}function I(e){let t="";for(;;){const n=e.currentChar();if("{"===n||"}"===n||"@"===n||"|"===n||!n)break;if("%"===n){if(!T(e))break;t+=n,e.next()}else if(n===E||n===L)if(T(e))t+=n,e.next();else{if(g(e))break;t+=n,e.next()}else t+=n,e.next()}return t}function S(e){const t=e.currentChar();switch(t){case"\\":case"'":return e.next(),`\\${t}`;case"u":return F(e,t,4);case"U":return F(e,t,6);default:return a(),""}}function F(e,t,n){p(e,t);let r="";for(let t=0;t<n;t++){const t=x(e);if(!t){a(),e.currentChar();break}r+=t}return`\\${t}${r}`}function P(e){_(e);const t=p(e,"|");return _(e),t}function D(e,t){let n=null;switch(e.currentChar()){case"{":return t.braceNest>=1&&a(),e.next(),n=f(t,2,"{"),_(e),t.braceNest++,n;case"}":return t.braceNest>0&&2===t.currentType&&a(),e.next(),n=f(t,3,"}"),t.braceNest--,t.braceNest>0&&_(e),t.inLinked&&0===t.braceNest&&(t.inLinked=!1),n;case"@":return t.braceNest>0&&a(),n=M(e,t)||m(t),t.braceNest=0,n;default:let r=!0,o=!0,s=!0;if(g(e))return t.braceNest>0&&a(),n=f(t,1,P(e)),t.braceNest=0,t.inLinked=!1,n;if(t.braceNest>0&&(5===t.currentType||6===t.currentType||7===t.currentType))return a(),t.braceNest=0,w(e,t);if(r=function(e,t){const{currentType:n}=t;if(2!==n)return!1;d(e);const r=k(e.currentPeek());return e.resetPeek(),r}(e,t))return n=f(t,5,function(e){_(e);let t="",n="";for(;t=N(e);)n+=t;return e.currentChar()===A&&a(),n}(e)),_(e),n;if(o=h(e,t))return n=f(t,6,function(e){_(e);let t="";return"-"===e.currentChar()?(e.next(),t+=`-${v(e)}`):t+=v(e),e.currentChar()===A&&a(),t}(e)),_(e),n;if(s=function(e,t){const{currentType:n}=t;if(2!==n)return!1;d(e);const r="'"===e.currentPeek();return e.resetPeek(),r}(e,t))return n=f(t,7,function(e){_(e),p(e,"'");let t="",n="";const r=e=>"'"!==e&&e!==L;for(;t=y(e,r);)n+="\\"===t?S(e):t;const o=e.currentChar();return o===L||o===A?(a(),o===L&&(e.next(),p(e,"'")),n):(p(e,"'"),n)}(e)),_(e),n;if(!r&&!o&&!s)return n=f(t,13,function(e){_(e);let t="",n="";const r=e=>"{"!==e&&"}"!==e&&e!==E&&e!==L;for(;t=y(e,r);)n+=t;return n}(e)),a(),n.value,_(e),n}return n}function M(e,t){const{currentType:n}=t;let r=null;const o=e.currentChar();switch(8!==n&&9!==n&&12!==n&&10!==n||o!==L&&o!==E||a(),o){case"@":return e.next(),r=f(t,8,"@"),t.inLinked=!0,r;case".":return _(e),e.next(),f(t,9,".");case":":return _(e),e.next(),f(t,10,":");default:return g(e)?(r=f(t,1,P(e)),t.braceNest=0,t.inLinked=!1,r):function(e,t){const{currentType:n}=t;if(8!==n)return!1;d(e);const r="."===e.currentPeek();return e.resetPeek(),r}(e,t)||function(e,t){const{currentType:n}=t;if(8!==n&&12!==n)return!1;d(e);const r=":"===e.currentPeek();return e.resetPeek(),r}(e,t)?(_(e),M(e,t)):function(e,t){const{currentType:n}=t;if(9!==n)return!1;d(e);const r=k(e.currentPeek());return e.resetPeek(),r}(e,t)?(_(e),f(t,12,function(e){let t="",n="";for(;t=N(e);)n+=t;return n}(e))):function(e,t){const{currentType:n}=t;if(10!==n)return!1;const r=()=>{const t=e.currentPeek();return"{"===t?k(e.peek()):!("@"===t||"%"===t||"|"===t||":"===t||"."===t||t===E||!t)&&(t===L?(e.peek(),r()):k(t))},o=r();return e.resetPeek(),o}(e,t)?(_(e),"{"===o?D(e,t)||r:f(t,11,function(e){const t=(n=!1,r)=>{const o=e.currentChar();return"{"!==o&&"%"!==o&&"@"!==o&&"|"!==o&&o?o===E?r:o===L?(r+=o,e.next(),t(n,r)):(r+=o,e.next(),t(!0,r)):r};return t(!1,"")}(e))):(8===n&&a(),t.braceNest=0,t.inLinked=!1,w(e,t))}}function w(e,t){let n={type:14};if(t.braceNest>0)return D(e,t)||m(t);if(t.inLinked)return M(e,t)||m(t);switch(e.currentChar()){case"{":return D(e,t)||m(t);case"}":return a(),e.next(),f(t,3,"}");case"@":return M(e,t)||m(t);default:if(g(e))return n=f(t,1,P(e)),t.braceNest=0,t.inLinked=!1,n;const{isModulo:r,hasSpace:o}=function(e){const t=d(e),n="%"===e.currentPeek()&&"{"===e.peek();return e.resetPeek(),{isModulo:n,hasSpace:t.length>0}}(e);if(r)return o?f(t,0,I(e)):f(t,4,function(e){_(e);return"%"!==e.currentChar()&&a(),e.next(),"%"}(e));if(T(e))return f(t,0,I(e))}return n}return{nextToken:function(){const{currentType:e,offset:t,startLoc:n,endLoc:s}=l;return l.lastType=e,l.lastOffset=t,l.lastStartLoc=n,l.lastEndLoc=s,l.offset=o(),l.startLoc=a(),r.currentChar()===A?f(l,14):w(r,l)},currentOffset:o,currentPosition:a,context:u}}const x=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function v(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const e=parseInt(t||n,16);return e<=55295||e>=57344?String.fromCodePoint(e):"�"}}}function I(e={}){const t=!1!==e.location,{onError:n}=e;function r(e,n,r){const o={type:e,start:n,end:n};return t&&(o.loc={start:r,end:r}),o}function o(e,n,r,o){e.end=n,o&&(e.type=o),t&&e.loc&&(e.loc.end=r)}function a(e,t){const n=e.context(),a=r(3,n.offset,n.startLoc);return a.value=t,o(a,e.currentOffset(),e.currentPosition()),a}function s(e,t){const n=e.context(),{lastOffset:a,lastStartLoc:s}=n,c=r(5,a,s);return c.index=parseInt(t,10),e.nextToken(),o(c,e.currentOffset(),e.currentPosition()),c}function l(e,t){const n=e.context(),{lastOffset:a,lastStartLoc:s}=n,c=r(4,a,s);return c.key=t,e.nextToken(),o(c,e.currentOffset(),e.currentPosition()),c}function u(e,t){const n=e.context(),{lastOffset:a,lastStartLoc:s}=n,c=r(9,a,s);return c.value=t.replace(x,v),e.nextToken(),o(c,e.currentOffset(),e.currentPosition()),c}function i(e){const t=e.context(),n=r(6,t.offset,t.startLoc);let a=e.nextToken();if(9===a.type){const t=function(e){const t=e.nextToken(),n=e.context(),{lastOffset:a,lastStartLoc:s}=n,c=r(8,a,s);return 12!==t.type?(n.lastStartLoc,c.value="",o(c,a,s),{nextConsumeToken:t,node:c}):(null==t.value&&(n.lastStartLoc,S(t)),c.value=t.value||"",o(c,e.currentOffset(),e.currentPosition()),{node:c})}(e);n.modifier=t.node,a=t.nextConsumeToken||e.nextToken()}switch(10!==a.type&&(t.lastStartLoc,S(a)),a=e.nextToken(),2===a.type&&(a=e.nextToken()),a.type){case 11:null==a.value&&(t.lastStartLoc,S(a)),n.key=function(e,t){const n=e.context(),a=r(7,n.offset,n.startLoc);return a.value=t,o(a,e.currentOffset(),e.currentPosition()),a}(e,a.value||"");break;case 5:null==a.value&&(t.lastStartLoc,S(a)),n.key=l(e,a.value||"");break;case 6:null==a.value&&(t.lastStartLoc,S(a)),n.key=s(e,a.value||"");break;case 7:null==a.value&&(t.lastStartLoc,S(a)),n.key=u(e,a.value||"");break;default:t.lastStartLoc;const c=e.context(),i=r(7,c.offset,c.startLoc);return i.value="",o(i,c.offset,c.startLoc),n.key=i,o(n,c.offset,c.startLoc),{nextConsumeToken:a,node:n}}return o(n,e.currentOffset(),e.currentPosition()),{node:n}}function f(e){const t=e.context(),n=r(2,1===t.currentType?e.currentOffset():t.offset,1===t.currentType?t.endLoc:t.startLoc);n.items=[];let c=null;do{const r=c||e.nextToken();switch(c=null,r.type){case 0:null==r.value&&(t.lastStartLoc,S(r)),n.items.push(a(e,r.value||""));break;case 6:null==r.value&&(t.lastStartLoc,S(r)),n.items.push(s(e,r.value||""));break;case 5:null==r.value&&(t.lastStartLoc,S(r)),n.items.push(l(e,r.value||""));break;case 7:null==r.value&&(t.lastStartLoc,S(r)),n.items.push(u(e,r.value||""));break;case 8:const o=i(e);n.items.push(o.node),c=o.nextConsumeToken||null}}while(14!==t.currentType&&1!==t.currentType);return o(n,1===t.currentType?t.lastOffset:e.currentOffset(),1===t.currentType?t.lastEndLoc:e.currentPosition()),n}function m(e){const t=e.context(),{offset:n,startLoc:a}=t,s=f(e);return 14===t.currentType?s:function(e,t,n,a){const s=e.context();let c=0===a.items.length;const l=r(1,t,n);l.cases=[],l.cases.push(a);do{const t=f(e);c||(c=0===t.items.length),l.cases.push(t)}while(14!==s.currentType);return o(l,e.currentOffset(),e.currentPosition()),l}(e,n,a,s)}return{parse:function(n){const a=O(n,c({},e)),s=a.context(),l=r(0,s.offset,s.startLoc);return t&&l.loc&&(l.loc.source=n),l.body=m(a),14!==s.currentType&&(s.lastStartLoc,n[s.offset]),o(l,a.currentOffset(),a.currentPosition()),l}}}function S(e){if(14===e.type)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function F(e,t){for(let n=0;n<e.length;n++)P(e[n],t)}function P(e,t){switch(e.type){case 1:F(e.cases,t),t.helper("plural");break;case 2:F(e.items,t);break;case 6:P(e.key,t),t.helper("linked"),t.helper("type");break;case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named")}}function D(e,t={}){const n=function(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:e=>(n.helpers.add(e),e)}}(e);n.helper("normalize"),e.body&&P(e.body,n);const r=n.context();e.helpers=Array.from(r.helpers)}function M(e,t){const{helper:n}=e;switch(t.type){case 0:!function(e,t){t.body?M(e,t.body):e.push("null")}(e,t);break;case 1:!function(e,t){const{helper:n,needIndent:r}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(r());const o=t.cases.length;for(let n=0;n<o&&(M(e,t.cases[n]),n!==o-1);n++)e.push(", ");e.deindent(r()),e.push("])")}}(e,t);break;case 2:!function(e,t){const{helper:n,needIndent:r}=e;e.push(`${n("normalize")}([`),e.indent(r());const o=t.items.length;for(let n=0;n<o&&(M(e,t.items[n]),n!==o-1);n++)e.push(", ");e.deindent(r()),e.push("])")}(e,t);break;case 6:!function(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),M(e,t.key),t.modifier?(e.push(", "),M(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}(e,t);break;case 8:case 7:case 9:case 3:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t)}}function w(e,t={}){const n=c({},t),r=I(n).parse(e);return D(r,n),((e,t={})=>{const n=f(t.mode)?t.mode:"normal",r=f(t.filename)?t.filename:"message.intl",o=!!t.sourceMap,a=null!=t.breakLineCode?t.breakLineCode:"arrow"===n?";":"\n",s=t.needIndent?t.needIndent:"arrow"!==n,c=e.helpers||[],l=function(e,t){const{sourceMap:n,filename:r,breakLineCode:o,needIndent:a}=t,s={source:e.loc.source,filename:r,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:a,indentLevel:0};function c(e,t){s.code+=e}function l(e,t=!0){const n=t?o:"";c(a?n+" ".repeat(e):n)}return{context:()=>s,push:c,indent:function(e=!0){const t=++s.indentLevel;e&&l(t)},deindent:function(e=!0){const t=--s.indentLevel;e&&l(t)},newline:function(){l(s.indentLevel)},helper:e=>`_${e}`,needIndent:()=>s.needIndent}}(e,{mode:n,filename:r,sourceMap:o,breakLineCode:a,needIndent:s});l.push("normal"===n?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(s),c.length>0&&(l.push(`const { ${c.map((e=>`${e}: _${e}`)).join(", ")} } = ctx`),l.newline()),l.push("return "),M(l,e),l.deindent(s),l.push("}");const{code:u,map:i}=l.context();return{ast:e,code:u,map:i?i.toJSON():void 0}})(r,n)}const R=[];R[0]={w:[0],i:[3,0],"[":[4],o:[7]},R[1]={w:[1],".":[2],"[":[4],o:[7]},R[2]={w:[2],i:[3,0],0:[3,0]},R[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},R[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},R[5]={"'":[4,0],o:8,l:[5,0]},R[6]={'"':[4,0],o:8,l:[6,0]};const W=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function U(e){if(null==e)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function $(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(n=t,W.test(n)?function(e){const t=e.charCodeAt(0);return t!==e.charCodeAt(e.length-1)||34!==t&&39!==t?e:e.slice(1,-1)}(t):"*"+t);var n}function V(e){const t=[];let n,r,o,a,s,c,l,u=-1,i=0,f=0;const m=[];function p(){const t=e[u+1];if(5===i&&"'"===t||6===i&&'"'===t)return u++,o="\\"+t,m[0](),!0}for(m[0]=()=>{void 0===r?r=o:r+=o},m[1]=()=>{void 0!==r&&(t.push(r),r=void 0)},m[2]=()=>{m[0](),f++},m[3]=()=>{if(f>0)f--,i=4,m[0]();else{if(f=0,void 0===r)return!1;if(r=$(r),!1===r)return!1;m[1]()}};null!==i;)if(u++,n=e[u],"\\"!==n||!p()){if(a=U(n),l=R[i],s=l[a]||l.l||8,8===s)return;if(i=s[0],void 0!==s[1]&&(c=m[s[1]],c&&(o=n,!1===c())))return;if(7===i)return t}}const K=new Map;function j(e,t){return p(e)?e[t]:null}const G=e=>e,B=e=>"",H="text",Y=e=>0===e.length?"":e.join(""),X=e=>null==e?"":u(e)||k(e)&&e.toString===d?JSON.stringify(e,null,2):String(e);function z(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function J(e={}){const t=e.locale,n=function(e){const t=r(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(r(e.named.count)||r(e.named.n))?r(e.named.count)?e.named.count:r(e.named.n)?e.named.n:t:t}(e),o=p(e.pluralRules)&&f(t)&&i(e.pluralRules[t])?e.pluralRules[t]:z,a=p(e.pluralRules)&&f(t)&&i(e.pluralRules[t])?z:void 0,s=e.list||[],c=e.named||{};r(e.pluralIndex)&&function(e,t){t.count||(t.count=e),t.n||(t.n=e)}(n,c);function l(t){const n=i(e.messages)?e.messages(t):!!p(e.messages)&&e.messages[t];return n||(e.parent?e.parent.message(t):B)}const m=k(e.processor)&&i(e.processor.normalize)?e.processor.normalize:Y,d=k(e.processor)&&i(e.processor.interpolate)?e.processor.interpolate:X,_={list:e=>s[e],named:e=>c[e],plural:e=>e[o(n,e.length,a)],linked:(t,...n)=>{const[r,o]=n;let a="text",s="";1===n.length?p(r)?(s=r.modifier||s,a=r.type||a):f(r)&&(s=r||s):2===n.length&&(f(r)&&(s=r||s),f(o)&&(a=o||a));let c=l(t)(_);return"vnode"===a&&u(c)&&s&&(c=c[0]),s?(i=s,e.modifiers?e.modifiers[i]:G)(c,a):c;var i},message:l,type:k(e.processor)&&f(e.processor.type)?e.processor.type:H,interpolate:d,normalize:m};return _}const Z="i18n:init";let Q=null;const q=ee("function:translate");function ee(e){return t=>Q&&Q.emit(e,t)}const te={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,__EXTEND_POINT__:7},ne={[te.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[te.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[te.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[te.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[te.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[te.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale."};function re(e,t,n){return[...new Set([n,...u(t)?t:p(t)?Object.keys(t):f(t)?[t]:[n]])]}function oe(e,t,n){let r=!0;for(let o=0;o<t.length&&m(r);o++){const a=t[o];f(a)&&(r=ae(e,t[o],n))}return r}function ae(e,t,n){let r;const o=t.split("-");do{r=se(e,o.join("-"),n),o.splice(-1,1)}while(o.length&&!0===r);return r}function se(e,t,n){let r=!1;if(!e.includes(t)&&(r=!0,t)){r="!"!==t[t.length-1];const o=t.replace(/!/g,"");e.push(o),(u(n)||k(n))&&n[o]&&(r=n[o])}return r}const ce="9.3.0-beta.14",le="en-US",ue=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;let ie,fe,me;let pe=null;let de=null;let _e=0;function ke(e,t,n,r,o){const{missing:a,onWarn:s}=e;if(null!==a){const r=a(e,n,t,o);return f(r)?r:t}return t}const he=e=>e;let ge=Object.create(null);let Te=h.__EXTEND_POINT__;const be=()=>++Te,Ee={INVALID_ARGUMENT:Te,INVALID_DATE_ARGUMENT:be(),INVALID_ISO_DATE_ARGUMENT:be(),__EXTEND_POINT__:be()};const Le=()=>"",ye=e=>i(e);function Ne(e,t,n,r,o,a){const{messages:s,onWarn:c,messageResolver:l,localeFallbacker:u}=e,m=u(e,r,n);let p,d={},_=null;for(let n=0;n<m.length&&(p=m[n],d=s[p]||{},null===(_=l(d,t))&&(_=d[t]),!f(_)&&!i(_));n++){const n=ke(e,t,p,0,"translate");n!==t&&(_=n)}return[_,p,d]}function Ce(e,t,r,o,a,s){const{messageCompiler:c,warnHtmlMessage:l}=e;if(ye(o)){const e=o;return e.locale=e.locale||r,e.key=e.key||t,e}if(null==c){const e=()=>o;return e.locale=r,e.key=t,e}const u=c(o,function(e,t,r,o,a,s){return{warnHtmlMessage:a,onError:e=>{throw s&&s(e),e},onCacheKey:e=>((e,t,r)=>n({l:e,k:t,s:r}))(t,r,e)}}(0,r,a,0,l,s));return u.locale=r,u.key=t,u.source=o,u}function Ae(...e){const[t,n,o]=e,s={};if(!f(t)&&!r(t)&&!ye(t))throw Error(Ee.INVALID_ARGUMENT);const l=r(t)?String(t):(ye(t),t);return r(n)?s.plural=n:f(n)?s.default=n:k(n)&&!a(n)?s.named=n:u(n)&&(s.list=n),r(o)?s.plural=o:f(o)?s.default=o:k(o)&&c(s,o),[l,s]}const Oe=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function xe(...e){const[t,n,o,a]=e,s={};let c,l={};if(f(t)){const e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Error(Ee.INVALID_ISO_DATE_ARGUMENT);const n=e[3]?e[3].trim().startsWith("T")?`${e[1].trim()}${e[3].trim()}`:`${e[1].trim()}T${e[3].trim()}`:e[1].trim();c=new Date(n);try{c.toISOString()}catch(e){throw Error(Ee.INVALID_ISO_DATE_ARGUMENT)}}else if("[object Date]"===_(t)){if(isNaN(t.getTime()))throw Error(Ee.INVALID_DATE_ARGUMENT);c=t}else{if(!r(t))throw Error(Ee.INVALID_ARGUMENT);c=t}return f(n)?s.key=n:k(n)&&Object.keys(n).forEach((e=>{Oe.includes(e)?l[e]=n[e]:s[e]=n[e]})),f(o)?s.locale=o:k(o)&&(l=o),k(a)&&(l=a),[s.key||"",c,s,l]}const ve=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function Ie(...e){const[t,n,o,a]=e,s={};let c={};if(!r(t))throw Error(Ee.INVALID_ARGUMENT);const l=t;return f(n)?s.key=n:k(n)&&Object.keys(n).forEach((e=>{ve.includes(e)?c[e]=n[e]:s[e]=n[e]})),f(o)?s.locale=o:k(o)&&(c=o),k(a)&&(c=a),[s.key||"",l,s,c]}return e.CompileErrorCodes=h,e.CoreErrorCodes=Ee,e.CoreWarnCodes=te,e.DATETIME_FORMAT_OPTIONS_KEYS=Oe,e.DEFAULT_LOCALE=le,e.DEFAULT_MESSAGE_DATA_TYPE=H,e.MISSING_RESOLVE_VALUE="",e.NOT_REOSLVED=-1,e.NUMBER_FORMAT_OPTIONS_KEYS=ve,e.VERSION=ce,e.clearCompileCache=function(){ge=Object.create(null)},e.clearDateTimeFormat=function(e,t,n){const r=e;for(const e in n){const n=`${t}__${e}`;r.__datetimeFormatters.has(n)&&r.__datetimeFormatters.delete(n)}},e.clearNumberFormat=function(e,t,n){const r=e;for(const e in n){const n=`${t}__${e}`;r.__numberFormatters.has(n)&&r.__numberFormatters.delete(n)}},e.compileToFunction=function(e,t={}){{const n=(t.onCacheKey||he)(e),r=ge[n];if(r)return r;let o=!1;const a=t.onError||T;t.onError=e=>{o=!0,a(e)};const{code:s}=w(e,t),c=new Function(`return ${s}`)();return o?c:ge[n]=c}},e.createCompileError=g,e.createCoreContext=function(e={}){const t=f(e.version)?e.version:ce,n=f(e.locale)?e.locale:le,r=u(e.fallbackLocale)||k(e.fallbackLocale)||f(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:n,a=k(e.messages)?e.messages:{[n]:{}},l=k(e.datetimeFormats)?e.datetimeFormats:{[n]:{}},d=k(e.numberFormats)?e.numberFormats:{[n]:{}},_=c({},e.modifiers||{},{upper:(e,t)=>"text"===t&&f(e)?e.toUpperCase():"vnode"===t&&p(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>"text"===t&&f(e)?e.toLowerCase():"vnode"===t&&p(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>"text"===t&&f(e)?ue(e):"vnode"===t&&p(e)&&"__v_isVNode"in e?ue(e.children):e}),h=e.pluralRules||{},g=i(e.missing)?e.missing:null,T=!m(e.missingWarn)&&!o(e.missingWarn)||e.missingWarn,b=!m(e.fallbackWarn)&&!o(e.fallbackWarn)||e.fallbackWarn,E=!!e.fallbackFormat,L=!!e.unresolving,y=i(e.postTranslation)?e.postTranslation:null,N=k(e.processor)?e.processor:null,C=!m(e.warnHtmlMessage)||e.warnHtmlMessage,A=!!e.escapeParameter,O=i(e.messageCompiler)?e.messageCompiler:ie,x=i(e.messageResolver)?e.messageResolver:fe||j,v=i(e.localeFallbacker)?e.localeFallbacker:me||re,I=p(e.fallbackContext)?e.fallbackContext:void 0,S=i(e.onWarn)?e.onWarn:s,F=e,P=p(F.__datetimeFormatters)?F.__datetimeFormatters:new Map,D=p(F.__numberFormatters)?F.__numberFormatters:new Map,M=p(F.__meta)?F.__meta:{};_e++;const w={version:t,cid:_e,locale:n,fallbackLocale:r,messages:a,modifiers:_,pluralRules:h,missing:g,missingWarn:T,fallbackWarn:b,fallbackFormat:E,unresolving:L,postTranslation:y,processor:N,warnHtmlMessage:C,escapeParameter:A,messageCompiler:O,messageResolver:x,localeFallbacker:v,fallbackContext:I,onWarn:S,__meta:M};return w.datetimeFormats=l,w.numberFormats=d,w.__datetimeFormatters=P,w.__numberFormatters=D,w},e.createCoreError=function(e){return g(e,null,void 0)},e.createMessageContext=J,e.datetime=function(e,...t){const{datetimeFormats:n,unresolving:r,fallbackLocale:o,onWarn:s,localeFallbacker:l}=e,{__datetimeFormatters:u}=e,[i,p,d,_]=xe(...t);m(d.missingWarn)?d.missingWarn:e.missingWarn,m(d.fallbackWarn)?d.fallbackWarn:e.fallbackWarn;const h=!!d.part,g=f(d.locale)?d.locale:e.locale,T=l(e,o,g);if(!f(i)||""===i)return new Intl.DateTimeFormat(g,_).format(p);let b,E={},L=null;for(let t=0;t<T.length&&(b=T[t],E=n[b]||{},L=E[i],!k(L));t++)ke(e,i,b,0,"datetime format");if(!k(L)||!f(b))return r?-1:i;let y=`${b}__${i}`;a(_)||(y=`${y}__${JSON.stringify(_)}`);let N=u.get(y);return N||(N=new Intl.DateTimeFormat(b,c({},L,_)),u.set(y,N)),h?N.formatToParts(p):N.format(p)},e.fallbackWithLocaleChain=function(e,t,n){const r=f(n)?n:le,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let a=o.__localeChainCache.get(r);if(!a){a=[];let e=[n];for(;u(e);)e=oe(a,e,t);const s=u(t)||!k(t)?t:t.default?t.default:null;e=f(s)?[s]:s,u(e)&&oe(a,e,!1),o.__localeChainCache.set(r,a)}return a},e.fallbackWithSimple=re,e.getAdditionalMeta=()=>pe,e.getDevToolsHook=function(){return Q},e.getFallbackContext=()=>de,e.getWarnMessage=function(e,...n){return function(e,...n){return 1===n.length&&p(n[0])&&(n=n[0]),n&&n.hasOwnProperty||(n={}),e.replace(t,((e,t)=>n.hasOwnProperty(t)?n[t]:""))}(ne[e],...n)},e.handleMissing=ke,e.initI18nDevTools=function(e,t,n){Q&&Q.emit(Z,{timestamp:Date.now(),i18n:e,version:t,meta:n})},e.isMessageFunction=ye,e.isTranslateFallbackWarn=function(e,t){return e instanceof RegExp?e.test(t):e},e.isTranslateMissingWarn=function(e,t){return e instanceof RegExp?e.test(t):e},e.number=function(e,...t){const{numberFormats:n,unresolving:r,fallbackLocale:o,onWarn:s,localeFallbacker:l}=e,{__numberFormatters:u}=e,[i,p,d,_]=Ie(...t);m(d.missingWarn)?d.missingWarn:e.missingWarn,m(d.fallbackWarn)?d.fallbackWarn:e.fallbackWarn;const h=!!d.part,g=f(d.locale)?d.locale:e.locale,T=l(e,o,g);if(!f(i)||""===i)return new Intl.NumberFormat(g,_).format(p);let b,E={},L=null;for(let t=0;t<T.length&&(b=T[t],E=n[b]||{},L=E[i],!k(L));t++)ke(e,i,b,0,"number format");if(!k(L)||!f(b))return r?-1:i;let y=`${b}__${i}`;a(_)||(y=`${y}__${JSON.stringify(_)}`);let N=u.get(y);return N||(N=new Intl.NumberFormat(b,c({},L,_)),u.set(y,N)),h?N.formatToParts(p):N.format(p)},e.parse=V,e.parseDateTimeArgs=xe,e.parseNumberArgs=Ie,e.parseTranslateArgs=Ae,e.registerLocaleFallbacker=function(e){me=e},e.registerMessageCompiler=function(e){ie=e},e.registerMessageResolver=function(e){fe=e},e.resolveValue=function(e,t){if(!p(e))return null;let n=K.get(t);if(n||(n=V(t),n&&K.set(t,n)),!n)return null;const r=n.length;let o=e,a=0;for(;a<r;){const e=o[n[a]];if(void 0===e)return null;o=e,a++}return o},e.resolveWithKeyValue=j,e.setAdditionalMeta=e=>{pe=e},e.setDevToolsHook=function(e){Q=e},e.setFallbackContext=e=>{de=e},e.translate=function(e,...t){const{fallbackFormat:n,postTranslation:o,unresolving:a,messageCompiler:s,fallbackLocale:c,messages:i}=e,[d,_]=Ae(...t),k=m(_.missingWarn)?_.missingWarn:e.missingWarn,h=m(_.fallbackWarn)?_.fallbackWarn:e.fallbackWarn,g=m(_.escapeParameter)?_.escapeParameter:e.escapeParameter,T=!!_.resolvedMessage,b=f(_.default)||m(_.default)?m(_.default)?s?d:()=>d:_.default:n?s?d:()=>d:"",E=n||""!==b,L=f(_.locale)?_.locale:e.locale;g&&function(e){u(e.list)?e.list=e.list.map((e=>f(e)?l(e):e)):p(e.named)&&Object.keys(e.named).forEach((t=>{f(e.named[t])&&(e.named[t]=l(e.named[t]))}))}(_);let[y,N,C]=T?[d,L,i[L]||{}]:Ne(e,d,L,c,h,k),A=y,O=d;if(T||f(A)||ye(A)||E&&(A=b,O=A),!(T||(f(A)||ye(A))&&f(N)))return a?-1:d;let x=!1;const v=ye(A)?A:Ce(e,d,N,A,O,(()=>{x=!0}));if(x)return A;const I=function(e,t,n,o){const{modifiers:a,pluralRules:s,messageResolver:c,fallbackLocale:l,fallbackWarn:u,missingWarn:i,fallbackContext:m}=e,p=r=>{let o=c(n,r);if(null==o&&m){const[,,e]=Ne(m,r,t,l,u,i);o=c(e,r)}if(f(o)){let n=!1;const a=Ce(e,r,t,o,r,(()=>{n=!0}));return n?Le:a}return ye(o)?o:Le},d={locale:t,modifiers:a,pluralRules:s,messages:p};e.processor&&(d.processor=e.processor);o.list&&(d.list=o.list);o.named&&(d.named=o.named);r(o.plural)&&(d.pluralIndex=o.plural);return d}(e,N,C,_),S=function(e,t,n){return t(n)}(0,v,J(I));return o?o(S,d):S},e.translateDevTools=q,e.updateFallbackLocale=function(e,t,n){e.__localeChainCache=new Map,e.localeFallbacker(e,n,t)},Object.defineProperty(e,"__esModule",{value:!0}),e}({}); | ||
var IntlifyCoreBase=function(e){"use strict";const t=/\{([0-9a-zA-Z]+)\}/g;const n=(e,t,n)=>r({l:e,k:t,s:n}),r=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),o=e=>"number"==typeof e&&isFinite(e),a=e=>"[object Date]"===p(e),s=e=>"[object RegExp]"===p(e),c=e=>N(e)&&0===Object.keys(e).length,l=Object.assign;function i(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}const u=Array.isArray,f=e=>"function"==typeof e,E=e=>"string"==typeof e,_=e=>"boolean"==typeof e,m=e=>null!==e&&"object"==typeof e,d=Object.prototype.toString,p=e=>d.call(e),N=e=>{if(!m(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t.constructor===Object};function L(e,t=""){return e.reduce(((e,n,r)=>0===r?e+n:e+t+n),"")}function T(e,t){"undefined"!=typeof console&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}function A(e,t,n){const r={start:e,end:t};return null!=n&&(r.source=n),r}const k={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14,UNHANDLED_CODEGEN_NODE_TYPE:15,UNHANDLED_MINIFIER_NODE_TYPE:16,__EXTEND_POINT__:17};function C(e,t,n={}){const{domain:r,messages:o,args:a}=n,s=new SyntaxError(String(e));return s.code=e,t&&(s.location=t),s.domain=r,s}function h(e){throw e}k.EXPECTED_TOKEN,k.INVALID_TOKEN_IN_PLACEHOLDER,k.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,k.UNKNOWN_ESCAPE_SEQUENCE,k.INVALID_UNICODE_ESCAPE_SEQUENCE,k.UNBALANCED_CLOSING_BRACE,k.UNTERMINATED_CLOSING_BRACE,k.EMPTY_PLACEHOLDER,k.NOT_ALLOW_NEST_PLACEHOLDER,k.INVALID_LINKED_FORMAT,k.MUST_HAVE_MESSAGES_IN_PLURAL,k.UNEXPECTED_EMPTY_LINKED_MODIFIER,k.UNEXPECTED_EMPTY_LINKED_KEY,k.UNEXPECTED_LEXICAL_ANALYSIS,k.UNHANDLED_CODEGEN_NODE_TYPE,k.UNHANDLED_MINIFIER_NODE_TYPE;const I=" ",g="\r",y="\n",b=String.fromCharCode(8232),O=String.fromCharCode(8233);function S(e){const t=e;let n=0,r=1,o=1,a=0;const s=e=>t[e]===g&&t[e+1]===y,c=e=>t[e]===O,l=e=>t[e]===b,i=e=>s(e)||(e=>t[e]===y)(e)||c(e)||l(e),u=e=>s(e)||c(e)||l(e)?y:t[e];function f(){return a=0,i(n)&&(r++,o=0),s(n)&&n++,n++,o++,t[n]}return{index:()=>n,line:()=>r,column:()=>o,peekOffset:()=>a,charAt:u,currentChar:()=>u(n),currentPeek:()=>u(n+a),next:f,peek:function(){return s(n+a)&&a++,a++,t[n+a]},reset:function(){n=0,r=1,o=1,a=0},resetPeek:function(e=0){a=e},skipToPeek:function(){const e=n+a;for(;e!==n;)f();a=0}}}const D=void 0,P=".",M="'";function R(e,t={}){const n=!1!==t.location,r=S(e),o=()=>r.index(),a=()=>{return e=r.line(),t=r.column(),n=r.index(),{line:e,column:t,offset:n};var e,t,n},s=a(),c=o(),l={currentType:14,offset:c,startLoc:s,endLoc:s,lastType:14,lastOffset:c,lastStartLoc:s,lastEndLoc:s,braceNest:0,inLinked:!1,text:""},i=()=>l,{onError:u}=t;function f(e,t,r){e.endLoc=a(),e.currentType=t;const o={type:t};return n&&(o.loc=A(e.startLoc,e.endLoc)),null!=r&&(o.value=r),o}const E=e=>f(e,14);function _(e,t){return e.currentChar()===t?(e.next(),t):(k.EXPECTED_TOKEN,a(),"")}function m(e){let t="";for(;e.currentPeek()===I||e.currentPeek()===y;)t+=e.currentPeek(),e.peek();return t}function d(e){const t=m(e);return e.skipToPeek(),t}function p(e){if(e===D)return!1;const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||95===t}function N(e,t){const{currentType:n}=t;if(2!==n)return!1;m(e);const r=function(e){if(e===D)return!1;const t=e.charCodeAt(0);return t>=48&&t<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),r}function L(e){m(e);const t="|"===e.currentPeek();return e.resetPeek(),t}function T(e,t=!0){const n=(t=!1,r="",o=!1)=>{const a=e.currentPeek();return"{"===a?"%"!==r&&t:"@"!==a&&a?"%"===a?(e.peek(),n(t,"%",!0)):"|"===a?!("%"!==r&&!o)||!(r===I||r===y):a===I?(e.peek(),n(!0,I,o)):a!==y||(e.peek(),n(!0,y,o)):"%"===r||t},r=n();return t&&e.resetPeek(),r}function C(e,t){const n=e.currentChar();return n===D?D:t(n)?(e.next(),n):null}function h(e){return C(e,(e=>{const t=e.charCodeAt(0);return t>=97&&t<=122||t>=65&&t<=90||t>=48&&t<=57||95===t||36===t}))}function g(e){return C(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57}))}function b(e){return C(e,(e=>{const t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102}))}function O(e){let t="",n="";for(;t=g(e);)n+=t;return n}function R(e){let t="";for(;;){const n=e.currentChar();if("{"===n||"}"===n||"@"===n||"|"===n||!n)break;if("%"===n){if(!T(e))break;t+=n,e.next()}else if(n===I||n===y)if(T(e))t+=n,e.next();else{if(L(e))break;t+=n,e.next()}else t+=n,e.next()}return t}function v(e){const t=e.currentChar();switch(t){case"\\":case"'":return e.next(),`\\${t}`;case"u":return U(e,t,4);case"U":return U(e,t,6);default:return k.UNKNOWN_ESCAPE_SEQUENCE,a(),""}}function U(e,t,n){_(e,t);let r="";for(let o=0;o<n;o++){const t=b(e);if(!t){k.INVALID_UNICODE_ESCAPE_SEQUENCE,a(),e.currentChar();break}r+=t}return`\\${t}${r}`}function x(e){d(e);const t=_(e,"|");return d(e),t}function F(e,t){let n=null;switch(e.currentChar()){case"{":return t.braceNest>=1&&(k.NOT_ALLOW_NEST_PLACEHOLDER,a()),e.next(),n=f(t,2,"{"),d(e),t.braceNest++,n;case"}":return t.braceNest>0&&2===t.currentType&&(k.EMPTY_PLACEHOLDER,a()),e.next(),n=f(t,3,"}"),t.braceNest--,t.braceNest>0&&d(e),t.inLinked&&0===t.braceNest&&(t.inLinked=!1),n;case"@":return t.braceNest>0&&(k.UNTERMINATED_CLOSING_BRACE,a()),n=w(e,t)||E(t),t.braceNest=0,n;default:let r=!0,o=!0,s=!0;if(L(e))return t.braceNest>0&&(k.UNTERMINATED_CLOSING_BRACE,a()),n=f(t,1,x(e)),t.braceNest=0,t.inLinked=!1,n;if(t.braceNest>0&&(5===t.currentType||6===t.currentType||7===t.currentType))return k.UNTERMINATED_CLOSING_BRACE,a(),t.braceNest=0,W(e,t);if(r=function(e,t){const{currentType:n}=t;if(2!==n)return!1;m(e);const r=p(e.currentPeek());return e.resetPeek(),r}(e,t))return n=f(t,5,function(e){d(e);let t="",n="";for(;t=h(e);)n+=t;return e.currentChar()===D&&(k.UNTERMINATED_CLOSING_BRACE,a()),n}(e)),d(e),n;if(o=N(e,t))return n=f(t,6,function(e){d(e);let t="";return"-"===e.currentChar()?(e.next(),t+=`-${O(e)}`):t+=O(e),e.currentChar()===D&&(k.UNTERMINATED_CLOSING_BRACE,a()),t}(e)),d(e),n;if(s=function(e,t){const{currentType:n}=t;if(2!==n)return!1;m(e);const r=e.currentPeek()===M;return e.resetPeek(),r}(e,t))return n=f(t,7,function(e){d(e),_(e,"'");let t="",n="";const r=e=>e!==M&&e!==y;for(;t=C(e,r);)n+="\\"===t?v(e):t;const o=e.currentChar();return o===y||o===D?(k.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,a(),o===y&&(e.next(),_(e,"'")),n):(_(e,"'"),n)}(e)),d(e),n;if(!r&&!o&&!s)return n=f(t,13,function(e){d(e);let t="",n="";const r=e=>"{"!==e&&"}"!==e&&e!==I&&e!==y;for(;t=C(e,r);)n+=t;return n}(e)),k.INVALID_TOKEN_IN_PLACEHOLDER,a(),n.value,d(e),n}return n}function w(e,t){const{currentType:n}=t;let r=null;const o=e.currentChar();switch(8!==n&&9!==n&&12!==n&&10!==n||o!==y&&o!==I||(k.INVALID_LINKED_FORMAT,a()),o){case"@":return e.next(),r=f(t,8,"@"),t.inLinked=!0,r;case".":return d(e),e.next(),f(t,9,".");case":":return d(e),e.next(),f(t,10,":");default:return L(e)?(r=f(t,1,x(e)),t.braceNest=0,t.inLinked=!1,r):function(e,t){const{currentType:n}=t;if(8!==n)return!1;m(e);const r="."===e.currentPeek();return e.resetPeek(),r}(e,t)||function(e,t){const{currentType:n}=t;if(8!==n&&12!==n)return!1;m(e);const r=":"===e.currentPeek();return e.resetPeek(),r}(e,t)?(d(e),w(e,t)):function(e,t){const{currentType:n}=t;if(9!==n)return!1;m(e);const r=p(e.currentPeek());return e.resetPeek(),r}(e,t)?(d(e),f(t,12,function(e){let t="",n="";for(;t=h(e);)n+=t;return n}(e))):function(e,t){const{currentType:n}=t;if(10!==n)return!1;const r=()=>{const t=e.currentPeek();return"{"===t?p(e.peek()):!("@"===t||"%"===t||"|"===t||":"===t||"."===t||t===I||!t)&&(t===y?(e.peek(),r()):p(t))},o=r();return e.resetPeek(),o}(e,t)?(d(e),"{"===o?F(e,t)||r:f(t,11,function(e){const t=(n=!1,r)=>{const o=e.currentChar();return"{"!==o&&"%"!==o&&"@"!==o&&"|"!==o&&o?o===I?r:o===y||o===P?(r+=o,e.next(),t(n,r)):p(o)?(r+=o,e.next(),t(!0,r)):r:r};return t(!1,"")}(e))):(8===n&&(k.INVALID_LINKED_FORMAT,a()),t.braceNest=0,t.inLinked=!1,W(e,t))}}function W(e,t){let n={type:14};if(t.braceNest>0)return F(e,t)||E(t);if(t.inLinked)return w(e,t)||E(t);switch(e.currentChar()){case"{":return F(e,t)||E(t);case"}":return k.UNBALANCED_CLOSING_BRACE,a(),e.next(),f(t,3,"}");case"@":return w(e,t)||E(t);default:if(L(e))return n=f(t,1,x(e)),t.braceNest=0,t.inLinked=!1,n;const{isModulo:r,hasSpace:o}=function(e){const t=m(e),n="%"===e.currentPeek()&&"{"===e.peek();return e.resetPeek(),{isModulo:n,hasSpace:t.length>0}}(e);if(r)return o?f(t,0,R(e)):f(t,4,function(e){d(e);const t=e.currentChar();return"%"!==t&&(k.EXPECTED_TOKEN,a()),e.next(),"%"}(e));if(T(e))return f(t,0,R(e))}return n}return{nextToken:function(){const{currentType:e,offset:t,startLoc:n,endLoc:s}=l;return l.lastType=e,l.lastOffset=t,l.lastStartLoc=n,l.lastEndLoc=s,l.offset=o(),l.startLoc=a(),r.currentChar()===D?f(l,14):W(r,l)},currentOffset:o,currentPosition:a,context:i}}const v=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function U(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const e=parseInt(t||n,16);return e<=55295||e>=57344?String.fromCodePoint(e):"�"}}}function x(e={}){const t=!1!==e.location,{onError:n}=e;function r(e,n,r){const o={type:e};return t&&(o.start=n,o.end=n,o.loc={start:r,end:r}),o}function o(e,n,r,o){o&&(e.type=o),t&&(e.end=n,e.loc&&(e.loc.end=r))}function a(e,t){const n=e.context(),a=r(3,n.offset,n.startLoc);return a.value=t,o(a,e.currentOffset(),e.currentPosition()),a}function s(e,t){const n=e.context(),{lastOffset:a,lastStartLoc:s}=n,c=r(5,a,s);return c.index=parseInt(t,10),e.nextToken(),o(c,e.currentOffset(),e.currentPosition()),c}function c(e,t){const n=e.context(),{lastOffset:a,lastStartLoc:s}=n,c=r(4,a,s);return c.key=t,e.nextToken(),o(c,e.currentOffset(),e.currentPosition()),c}function i(e,t){const n=e.context(),{lastOffset:a,lastStartLoc:s}=n,c=r(9,a,s);return c.value=t.replace(v,U),e.nextToken(),o(c,e.currentOffset(),e.currentPosition()),c}function u(e){const t=e.context(),n=r(6,t.offset,t.startLoc);let a=e.nextToken();if(9===a.type){const t=function(e){const t=e.nextToken(),n=e.context(),{lastOffset:a,lastStartLoc:s}=n,c=r(8,a,s);return 12!==t.type?(k.UNEXPECTED_EMPTY_LINKED_MODIFIER,n.lastStartLoc,c.value="",o(c,a,s),{nextConsumeToken:t,node:c}):(null==t.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,n.lastStartLoc,F(t)),c.value=t.value||"",o(c,e.currentOffset(),e.currentPosition()),{node:c})}(e);n.modifier=t.node,a=t.nextConsumeToken||e.nextToken()}switch(10!==a.type&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,F(a)),a=e.nextToken(),2===a.type&&(a=e.nextToken()),a.type){case 11:null==a.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,F(a)),n.key=function(e,t){const n=e.context(),a=r(7,n.offset,n.startLoc);return a.value=t,o(a,e.currentOffset(),e.currentPosition()),a}(e,a.value||"");break;case 5:null==a.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,F(a)),n.key=c(e,a.value||"");break;case 6:null==a.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,F(a)),n.key=s(e,a.value||"");break;case 7:null==a.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,F(a)),n.key=i(e,a.value||"");break;default:k.UNEXPECTED_EMPTY_LINKED_KEY,t.lastStartLoc;const l=e.context(),u=r(7,l.offset,l.startLoc);return u.value="",o(u,l.offset,l.startLoc),n.key=u,o(n,l.offset,l.startLoc),{nextConsumeToken:a,node:n}}return o(n,e.currentOffset(),e.currentPosition()),{node:n}}function f(e){const t=e.context(),n=r(2,1===t.currentType?e.currentOffset():t.offset,1===t.currentType?t.endLoc:t.startLoc);n.items=[];let l=null;do{const r=l||e.nextToken();switch(l=null,r.type){case 0:null==r.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,F(r)),n.items.push(a(e,r.value||""));break;case 6:null==r.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,F(r)),n.items.push(s(e,r.value||""));break;case 5:null==r.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,F(r)),n.items.push(c(e,r.value||""));break;case 7:null==r.value&&(k.UNEXPECTED_LEXICAL_ANALYSIS,t.lastStartLoc,F(r)),n.items.push(i(e,r.value||""));break;case 8:const o=u(e);n.items.push(o.node),l=o.nextConsumeToken||null}}while(14!==t.currentType&&1!==t.currentType);return o(n,1===t.currentType?t.lastOffset:e.currentOffset(),1===t.currentType?t.lastEndLoc:e.currentPosition()),n}function E(e){const t=e.context(),{offset:n,startLoc:a}=t,s=f(e);return 14===t.currentType?s:function(e,t,n,a){const s=e.context();let c=0===a.items.length;const l=r(1,t,n);l.cases=[],l.cases.push(a);do{const t=f(e);c||(c=0===t.items.length),l.cases.push(t)}while(14!==s.currentType);return c&&k.MUST_HAVE_MESSAGES_IN_PLURAL,o(l,e.currentOffset(),e.currentPosition()),l}(e,n,a,s)}return{parse:function(n){const a=R(n,l({},e)),s=a.context(),c=r(0,s.offset,s.startLoc);return t&&c.loc&&(c.loc.source=n),c.body=E(a),e.onCacheKey&&(c.cacheKey=e.onCacheKey(n)),14!==s.currentType&&(k.UNEXPECTED_LEXICAL_ANALYSIS,s.lastStartLoc,n[s.offset]),o(c,a.currentOffset(),a.currentPosition()),c}}}function F(e){if(14===e.type)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function w(e,t){for(let n=0;n<e.length;n++)W(e[n],t)}function W(e,t){switch(e.type){case 1:w(e.cases,t),t.helper("plural");break;case 2:w(e.items,t);break;case 6:W(e.key,t),t.helper("linked"),t.helper("type");break;case 5:t.helper("interpolate"),t.helper("list");break;case 4:t.helper("interpolate"),t.helper("named")}}function X(e,t={}){const n=function(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:e=>(n.helpers.add(e),e)}}(e);n.helper("normalize"),e.body&&W(e.body,n);const r=n.context();e.helpers=Array.from(r.helpers)}function G(e){if(1===e.items.length){const t=e.items[0];3!==t.type&&9!==t.type||(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;n<e.items.length;n++){const r=e.items[n];if(3!==r.type&&9!==r.type)break;if(null==r.value)break;t.push(r.value)}if(t.length===e.items.length){e.static=L(t);for(let t=0;t<e.items.length;t++){const n=e.items[t];3!==n.type&&9!==n.type||delete n.value}}}}function K(e){switch(e.t=e.type,e.type){case 0:const t=e;K(t.body),t.b=t.body,delete t.body;break;case 1:const n=e,r=n.cases;for(let e=0;e<r.length;e++)K(r[e]);n.c=r,delete n.cases;break;case 2:const o=e,a=o.items;for(let e=0;e<a.length;e++)K(a[e]);o.i=a,delete o.items,o.static&&(o.s=o.static,delete o.static);break;case 3:case 9:case 8:case 7:const s=e;s.value&&(s.v=s.value,delete s.value);break;case 6:const c=e;K(c.key),c.k=c.key,delete c.key,c.modifier&&(K(c.modifier),c.m=c.modifier,delete c.modifier);break;case 5:const l=e;l.i=l.index,delete l.index;break;case 4:const i=e;i.k=i.key,delete i.key}delete e.type}function $(e,t){const{helper:n}=e;switch(t.type){case 0:!function(e,t){t.body?$(e,t.body):e.push("null")}(e,t);break;case 1:!function(e,t){const{helper:n,needIndent:r}=e;if(t.cases.length>1){e.push(`${n("plural")}([`),e.indent(r());const o=t.cases.length;for(let n=0;n<o&&($(e,t.cases[n]),n!==o-1);n++)e.push(", ");e.deindent(r()),e.push("])")}}(e,t);break;case 2:!function(e,t){const{helper:n,needIndent:r}=e;e.push(`${n("normalize")}([`),e.indent(r());const o=t.items.length;for(let a=0;a<o&&($(e,t.items[a]),a!==o-1);a++)e.push(", ");e.deindent(r()),e.push("])")}(e,t);break;case 6:!function(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),$(e,t.key),t.modifier?(e.push(", "),$(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}(e,t);break;case 8:case 7:case 9:case 3:e.push(JSON.stringify(t.value),t);break;case 5:e.push(`${n("interpolate")}(${n("list")}(${t.index}))`,t);break;case 4:e.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(t.key)}))`,t)}}const V=(e,t={})=>{const n=E(t.mode)?t.mode:"normal",r=E(t.filename)?t.filename:"message.intl",o=!!t.sourceMap,a=null!=t.breakLineCode?t.breakLineCode:"arrow"===n?";":"\n",s=t.needIndent?t.needIndent:"arrow"!==n,c=e.helpers||[],l=function(e,t){const{sourceMap:n,filename:r,breakLineCode:o,needIndent:a}=t,s=!1!==t.location,c={filename:r,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:o,needIndent:a,indentLevel:0};function l(e,t){c.code+=e}function i(e,t=!0){const n=t?o:"";l(a?n+" ".repeat(e):n)}return s&&e.loc&&(c.source=e.loc.source),{context:()=>c,push:l,indent:function(e=!0){const t=++c.indentLevel;e&&i(t)},deindent:function(e=!0){const t=--c.indentLevel;e&&i(t)},newline:function(){i(c.indentLevel)},helper:e=>`_${e}`,needIndent:()=>c.needIndent}}(e,{mode:n,filename:r,sourceMap:o,breakLineCode:a,needIndent:s});l.push("normal"===n?"function __msg__ (ctx) {":"(ctx) => {"),l.indent(s),c.length>0&&(l.push(`const { ${L(c.map((e=>`${e}: _${e}`)),", ")} } = ctx`),l.newline()),l.push("return "),$(l,e),l.deindent(s),l.push("}"),delete e.helpers;const{code:i,map:u}=l.context();return{ast:e,code:i,map:u?u.toJSON():void 0}};function Y(e,t={}){const n=l({},t),r=!!n.jit,o=!!n.minify,a=null==n.optimize||n.optimize,s=x(n).parse(e);return r?(a&&function(e){const t=e.body;2===t.type?G(t):t.cases.forEach((e=>G(e)))}(s),o&&K(s),{ast:s,code:""}):(X(s,n),V(s,n))}const H=[];H[0]={w:[0],i:[3,0],"[":[4],o:[7]},H[1]={w:[1],".":[2],"[":[4],o:[7]},H[2]={w:[2],i:[3,0],0:[3,0]},H[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]},H[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]},H[5]={"'":[4,0],o:8,l:[5,0]},H[6]={'"':[4,0],o:8,l:[6,0]};const B=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function j(e){if(null==e)return"o";switch(e.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return e;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function z(e){const t=e.trim();return("0"!==e.charAt(0)||!isNaN(parseInt(e)))&&(n=t,B.test(n)?function(e){const t=e.charCodeAt(0);return t!==e.charCodeAt(e.length-1)||34!==t&&39!==t?e:e.slice(1,-1)}(t):"*"+t);var n}function Q(e){const t=[];let n,r,o,a,s,c,l,i=-1,u=0,f=0;const E=[];function _(){const t=e[i+1];if(5===u&&"'"===t||6===u&&'"'===t)return i++,o="\\"+t,E[0](),!0}for(E[0]=()=>{void 0===r?r=o:r+=o},E[1]=()=>{void 0!==r&&(t.push(r),r=void 0)},E[2]=()=>{E[0](),f++},E[3]=()=>{if(f>0)f--,u=4,E[0]();else{if(f=0,void 0===r)return!1;if(r=z(r),!1===r)return!1;E[1]()}};null!==u;)if(i++,n=e[i],"\\"!==n||!_()){if(a=j(n),l=H[u],s=l[a]||l.l||8,8===s)return;if(u=s[0],void 0!==s[1]&&(c=E[s[1]],c&&(o=n,!1===c())))return;if(7===u)return t}}const J=new Map;function Z(e,t){return m(e)?e[t]:null}const q=e=>e,ee=e=>"",te="text",ne=e=>0===e.length?"":L(e),re=e=>null==e?"":u(e)||N(e)&&e.toString===d?JSON.stringify(e,null,2):String(e);function oe(e,t){return e=Math.abs(e),2===t?e?e>1?1:0:1:e?Math.min(e,2):0}function ae(e={}){const t=e.locale,n=function(e){const t=o(e.pluralIndex)?e.pluralIndex:-1;return e.named&&(o(e.named.count)||o(e.named.n))?o(e.named.count)?e.named.count:o(e.named.n)?e.named.n:t:t}(e),r=m(e.pluralRules)&&E(t)&&f(e.pluralRules[t])?e.pluralRules[t]:oe,a=m(e.pluralRules)&&E(t)&&f(e.pluralRules[t])?oe:void 0,s=e.list||[],c=e.named||{};o(e.pluralIndex)&&function(e,t){t.count||(t.count=e),t.n||(t.n=e)}(n,c);function i(t){const n=f(e.messages)?e.messages(t):!!m(e.messages)&&e.messages[t];return n||(e.parent?e.parent.message(t):ee)}const _=N(e.processor)&&f(e.processor.normalize)?e.processor.normalize:ne,d=N(e.processor)&&f(e.processor.interpolate)?e.processor.interpolate:re,p={list:e=>s[e],named:e=>c[e],plural:e=>e[r(n,e.length,a)],linked:(t,...n)=>{const[r,o]=n;let a="text",s="";1===n.length?m(r)?(s=r.modifier||s,a=r.type||a):E(r)&&(s=r||s):2===n.length&&(E(r)&&(s=r||s),E(o)&&(a=o||a));const c=i(t)(p),l="vnode"===a&&u(c)&&s?c[0]:c;return s?(f=s,e.modifiers?e.modifiers[f]:q)(l,a):l;var f},message:i,type:N(e.processor)&&E(e.processor.type)?e.processor.type:te,interpolate:d,normalize:_,values:l({},s,c)};return p}const se="i18n:init";let ce=null;const le=ie("function:translate");function ie(e){return t=>ce&&ce.emit(e,t)}const ue={NOT_FOUND_KEY:1,FALLBACK_TO_TRANSLATE:2,CANNOT_FORMAT_NUMBER:3,FALLBACK_TO_NUMBER_FORMAT:4,CANNOT_FORMAT_DATE:5,FALLBACK_TO_DATE_FORMAT:6,EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER:7,__EXTEND_POINT__:8},fe={[ue.NOT_FOUND_KEY]:"Not found '{key}' key in '{locale}' locale messages.",[ue.FALLBACK_TO_TRANSLATE]:"Fall back to translate '{key}' key with '{target}' locale.",[ue.CANNOT_FORMAT_NUMBER]:"Cannot format a number value due to not supported Intl.NumberFormat.",[ue.FALLBACK_TO_NUMBER_FORMAT]:"Fall back to number format '{key}' key with '{target}' locale.",[ue.CANNOT_FORMAT_DATE]:"Cannot format a date value due to not supported Intl.DateTimeFormat.",[ue.FALLBACK_TO_DATE_FORMAT]:"Fall back to datetime format '{key}' key with '{target}' locale.",[ue.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]:"This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future."};function Ee(e,t,n){return[...new Set([n,...u(t)?t:m(t)?Object.keys(t):E(t)?[t]:[n]])]}function _e(e,t,n){let r=!0;for(let o=0;o<t.length&&_(r);o++){const a=t[o];E(a)&&(r=me(e,t[o],n))}return r}function me(e,t,n){let r;const o=t.split("-");do{r=de(e,o.join("-"),n),o.splice(-1,1)}while(o.length&&!0===r);return r}function de(e,t,n){let r=!1;if(!e.includes(t)&&(r=!0,t)){r="!"!==t[t.length-1];const o=t.replace(/!/g,"");e.push(o),(u(n)||N(n))&&n[o]&&(r=n[o])}return r}const pe="9.3.0",Ne="en-US",Le=e=>`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;let Te,Ae,ke;let Ce=null;let he=null;let Ie=0;function ge(e,t,n,r,o){const{missing:a,onWarn:s}=e;if(null!==a){const r=a(e,n,t,o);return E(r)?r:t}return t}function ye(e){return t=>function(e,t){const n=t.b||t.body;if(1===(n.t||n.type)){const t=n,r=t.c||t.cases;return e.plural(r.reduce(((t,n)=>[...t,be(e,n)]),[]))}return be(e,n)}(t,e)}function be(e,t){const n=t.s||t.static;if(n)return"text"===e.type?n:e.normalize([n]);{const n=(t.i||t.items).reduce(((t,n)=>[...t,Oe(e,n)]),[]);return e.normalize(n)}}function Oe(e,t){const n=t.t||t.type;switch(n){case 3:const r=t;return r.v||r.value;case 9:const o=t;return o.v||o.value;case 4:const a=t;return e.interpolate(e.named(a.k||a.key));case 5:const s=t;return e.interpolate(e.list(s.i||s.index));case 6:const c=t,l=c.m||c.modifier;return e.linked(Oe(e,c.k||c.key),l?Oe(e,l):void 0,e.type);case 7:const i=t;return i.v||i.value;case 8:const u=t;return u.v||u.value;default:throw new Error(`unhandled node type on format message part: ${n}`)}}const Se=k.__EXTEND_POINT__,De=function(e){let t=e;return()=>++t}(Se),Pe={INVALID_ARGUMENT:Se,INVALID_DATE_ARGUMENT:De(),INVALID_ISO_DATE_ARGUMENT:De(),NOT_SUPPORT_NON_STRING_MESSAGE:De(),__EXTEND_POINT__:De()};Pe.INVALID_ARGUMENT,Pe.INVALID_DATE_ARGUMENT,Pe.INVALID_ISO_DATE_ARGUMENT,Pe.NOT_SUPPORT_NON_STRING_MESSAGE;const Me=e=>e;let Re=Object.create(null);const ve=e=>m(e)&&(0===e.t||0===e.type)&&("b"in e||"body"in e);const Ue=()=>"",xe=e=>f(e);function Fe(e,t,n,r,o,a){const{messages:s,onWarn:c,messageResolver:l,localeFallbacker:i}=e,u=i(e,r,n);let f,_={},m=null;for(let d=0;d<u.length&&(f=u[d],_=s[f]||{},null===(m=l(_,t))&&(m=_[t]),!(E(m)||ve(m)||xe(m)));d++){const n=ge(e,t,f,0,"translate");n!==t&&(m=n)}return[m,f,_]}function we(e,t,r,o,a,s){const{messageCompiler:c,warnHtmlMessage:l}=e;if(xe(o)){const e=o;return e.locale=e.locale||r,e.key=e.key||t,e}if(null==c){const e=()=>o;return e.locale=r,e.key=t,e}const i=c(o,function(e,t,r,o,a,s){return{locale:t,key:r,warnHtmlMessage:a,onError:e=>{throw s&&s(e),e},onCacheKey:e=>n(t,r,e)}}(0,r,a,0,l,s));return i.locale=r,i.key=t,i.source=o,i}function We(...e){const[t,n,r]=e,a={};if(!(E(t)||o(t)||xe(t)||ve(t)))throw Error(Pe.INVALID_ARGUMENT);const s=o(t)?String(t):(xe(t),t);return o(n)?a.plural=n:E(n)?a.default=n:N(n)&&!c(n)?a.named=n:u(n)&&(a.list=n),o(r)?a.plural=r:E(r)?a.default=r:N(r)&&l(a,r),[s,a]}const Xe=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function Ge(...e){const[t,n,r,s]=e,c={};let l,i={};if(E(t)){const e=t.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!e)throw Error(Pe.INVALID_ISO_DATE_ARGUMENT);const n=e[3]?e[3].trim().startsWith("T")?`${e[1].trim()}${e[3].trim()}`:`${e[1].trim()}T${e[3].trim()}`:e[1].trim();l=new Date(n);try{l.toISOString()}catch(u){throw Error(Pe.INVALID_ISO_DATE_ARGUMENT)}}else if(a(t)){if(isNaN(t.getTime()))throw Error(Pe.INVALID_DATE_ARGUMENT);l=t}else{if(!o(t))throw Error(Pe.INVALID_ARGUMENT);l=t}return E(n)?c.key=n:N(n)&&Object.keys(n).forEach((e=>{Xe.includes(e)?i[e]=n[e]:c[e]=n[e]})),E(r)?c.locale=r:N(r)&&(i=r),N(s)&&(i=s),[c.key||"",l,c,i]}const Ke=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function $e(...e){const[t,n,r,a]=e,s={};let c={};if(!o(t))throw Error(Pe.INVALID_ARGUMENT);const l=t;return E(n)?s.key=n:N(n)&&Object.keys(n).forEach((e=>{Ke.includes(e)?c[e]=n[e]:s[e]=n[e]})),E(r)?s.locale=r:N(r)&&(c=r),N(a)&&(c=a),[s.key||"",l,s,c]}return e.CompileErrorCodes=k,e.CoreErrorCodes=Pe,e.CoreWarnCodes=ue,e.DATETIME_FORMAT_OPTIONS_KEYS=Xe,e.DEFAULT_LOCALE=Ne,e.DEFAULT_MESSAGE_DATA_TYPE=te,e.MISSING_RESOLVE_VALUE="",e.NOT_REOSLVED=-1,e.NUMBER_FORMAT_OPTIONS_KEYS=Ke,e.VERSION=pe,e.clearCompileCache=function(){Re=Object.create(null)},e.clearDateTimeFormat=function(e,t,n){const r=e;for(const o in n){const e=`${t}__${o}`;r.__datetimeFormatters.has(e)&&r.__datetimeFormatters.delete(e)}},e.clearNumberFormat=function(e,t,n){const r=e;for(const o in n){const e=`${t}__${o}`;r.__numberFormatters.has(e)&&r.__numberFormatters.delete(e)}},e.compile=function(e,t){{const t=e.cacheKey;if(t){const n=Re[t];return n||(Re[t]=ye(e))}return ye(e)}},e.compileToFunction=function(e,t){if(!E(e))throw Error(Pe.NOT_SUPPORT_NON_STRING_MESSAGE);{!_(t.warnHtmlMessage)||t.warnHtmlMessage;const n=(t.onCacheKey||Me)(e),r=Re[n];if(r)return r;const{code:o,detectError:a}=function(e,t={}){let n=!1;const r=t.onError||h;return t.onError=e=>{n=!0,r(e)},{...Y(e,t),detectError:n}}(e,t),s=new Function(`return ${o}`)();return a?s:Re[n]=s}},e.createCompileError=C,e.createCoreContext=function(e={}){const t=f(e.onWarn)?e.onWarn:T,n=E(e.version)?e.version:pe,r=E(e.locale)?e.locale:Ne,o=u(e.fallbackLocale)||N(e.fallbackLocale)||E(e.fallbackLocale)||!1===e.fallbackLocale?e.fallbackLocale:r,a=N(e.messages)?e.messages:{[r]:{}},c=N(e.datetimeFormats)?e.datetimeFormats:{[r]:{}},i=N(e.numberFormats)?e.numberFormats:{[r]:{}},d=l({},e.modifiers||{},{upper:(e,t)=>"text"===t&&E(e)?e.toUpperCase():"vnode"===t&&m(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>"text"===t&&E(e)?e.toLowerCase():"vnode"===t&&m(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>"text"===t&&E(e)?Le(e):"vnode"===t&&m(e)&&"__v_isVNode"in e?Le(e.children):e}),p=e.pluralRules||{},L=f(e.missing)?e.missing:null,A=!_(e.missingWarn)&&!s(e.missingWarn)||e.missingWarn,k=!_(e.fallbackWarn)&&!s(e.fallbackWarn)||e.fallbackWarn,C=!!e.fallbackFormat,h=!!e.unresolving,I=f(e.postTranslation)?e.postTranslation:null,g=N(e.processor)?e.processor:null,y=!_(e.warnHtmlMessage)||e.warnHtmlMessage,b=!!e.escapeParameter,O=f(e.messageCompiler)?e.messageCompiler:Te,S=f(e.messageResolver)?e.messageResolver:Ae||Z,D=f(e.localeFallbacker)?e.localeFallbacker:ke||Ee,P=m(e.fallbackContext)?e.fallbackContext:void 0,M=e,R=m(M.__datetimeFormatters)?M.__datetimeFormatters:new Map,v=m(M.__numberFormatters)?M.__numberFormatters:new Map,U=m(M.__meta)?M.__meta:{};Ie++;const x={version:n,cid:Ie,locale:r,fallbackLocale:o,messages:a,modifiers:d,pluralRules:p,missing:L,missingWarn:A,fallbackWarn:k,fallbackFormat:C,unresolving:h,postTranslation:I,processor:g,warnHtmlMessage:y,escapeParameter:b,messageCompiler:O,messageResolver:S,localeFallbacker:D,fallbackContext:P,onWarn:t,__meta:U};return x.datetimeFormats=c,x.numberFormats=i,x.__datetimeFormatters=R,x.__numberFormatters=v,x},e.createCoreError=function(e){return C(e,null,void 0)},e.createMessageContext=ae,e.datetime=function(e,...t){const{datetimeFormats:n,unresolving:r,fallbackLocale:o,onWarn:a,localeFallbacker:s}=e,{__datetimeFormatters:i}=e,[u,f,m,d]=Ge(...t);_(m.missingWarn)?m.missingWarn:e.missingWarn,_(m.fallbackWarn)?m.fallbackWarn:e.fallbackWarn;const p=!!m.part,L=E(m.locale)?m.locale:e.locale,T=s(e,o,L);if(!E(u)||""===u)return new Intl.DateTimeFormat(L,d).format(f);let A,k={},C=null;for(let c=0;c<T.length&&(A=T[c],k=n[A]||{},C=k[u],!N(C));c++)ge(e,u,A,0,"datetime format");if(!N(C)||!E(A))return r?-1:u;let h=`${A}__${u}`;c(d)||(h=`${h}__${JSON.stringify(d)}`);let I=i.get(h);return I||(I=new Intl.DateTimeFormat(A,l({},C,d)),i.set(h,I)),p?I.formatToParts(f):I.format(f)},e.fallbackWithLocaleChain=function(e,t,n){const r=E(n)?n:Ne,o=e;o.__localeChainCache||(o.__localeChainCache=new Map);let a=o.__localeChainCache.get(r);if(!a){a=[];let e=[n];for(;u(e);)e=_e(a,e,t);const s=u(t)||!N(t)?t:t.default?t.default:null;e=E(s)?[s]:s,u(e)&&_e(a,e,!1),o.__localeChainCache.set(r,a)}return a},e.fallbackWithSimple=Ee,e.getAdditionalMeta=()=>Ce,e.getDevToolsHook=function(){return ce},e.getFallbackContext=()=>he,e.getWarnMessage=function(e,...n){return function(e,...n){return 1===n.length&&m(n[0])&&(n=n[0]),n&&n.hasOwnProperty||(n={}),e.replace(t,((e,t)=>n.hasOwnProperty(t)?n[t]:""))}(fe[e],...n)},e.handleMissing=ge,e.initI18nDevTools=function(e,t,n){ce&&ce.emit(se,{timestamp:Date.now(),i18n:e,version:t,meta:n})},e.isMessageAST=ve,e.isMessageFunction=xe,e.isTranslateFallbackWarn=function(e,t){return e instanceof RegExp?e.test(t):e},e.isTranslateMissingWarn=function(e,t){return e instanceof RegExp?e.test(t):e},e.number=function(e,...t){const{numberFormats:n,unresolving:r,fallbackLocale:o,onWarn:a,localeFallbacker:s}=e,{__numberFormatters:i}=e,[u,f,m,d]=$e(...t);_(m.missingWarn)?m.missingWarn:e.missingWarn,_(m.fallbackWarn)?m.fallbackWarn:e.fallbackWarn;const p=!!m.part,L=E(m.locale)?m.locale:e.locale,T=s(e,o,L);if(!E(u)||""===u)return new Intl.NumberFormat(L,d).format(f);let A,k={},C=null;for(let c=0;c<T.length&&(A=T[c],k=n[A]||{},C=k[u],!N(C));c++)ge(e,u,A,0,"number format");if(!N(C)||!E(A))return r?-1:u;let h=`${A}__${u}`;c(d)||(h=`${h}__${JSON.stringify(d)}`);let I=i.get(h);return I||(I=new Intl.NumberFormat(A,l({},C,d)),i.set(h,I)),p?I.formatToParts(f):I.format(f)},e.parse=Q,e.parseDateTimeArgs=Ge,e.parseNumberArgs=$e,e.parseTranslateArgs=We,e.registerLocaleFallbacker=function(e){ke=e},e.registerMessageCompiler=function(e){Te=e},e.registerMessageResolver=function(e){Ae=e},e.resolveValue=function(e,t){if(!m(e))return null;let n=J.get(t);if(n||(n=Q(t),n&&J.set(t,n)),!n)return null;const r=n.length;let o=e,a=0;for(;a<r;){const e=o[n[a]];if(void 0===e)return null;o=e,a++}return o},e.resolveWithKeyValue=Z,e.setAdditionalMeta=e=>{Ce=e},e.setDevToolsHook=function(e){ce=e},e.setFallbackContext=e=>{he=e},e.translate=function(e,...t){const{fallbackFormat:n,postTranslation:r,unresolving:a,messageCompiler:s,fallbackLocale:c,messages:l}=e,[f,d]=We(...t),p=_(d.missingWarn)?d.missingWarn:e.missingWarn,N=_(d.fallbackWarn)?d.fallbackWarn:e.fallbackWarn,L=_(d.escapeParameter)?d.escapeParameter:e.escapeParameter,T=!!d.resolvedMessage,A=E(d.default)||_(d.default)?_(d.default)?s?f:()=>f:d.default:n?s?f:()=>f:"",k=n||""!==A,C=E(d.locale)?d.locale:e.locale;L&&function(e){u(e.list)?e.list=e.list.map((e=>E(e)?i(e):e)):m(e.named)&&Object.keys(e.named).forEach((t=>{E(e.named[t])&&(e.named[t]=i(e.named[t]))}))}(d);let[h,I,g]=T?[f,C,l[C]||{}]:Fe(e,f,C,c,N,p),y=h,b=f;if(T||E(y)||ve(y)||xe(y)||k&&(y=A,b=y),!(T||(E(y)||ve(y)||xe(y))&&E(I)))return a?-1:f;let O=!1;const S=xe(y)?y:we(e,f,I,y,b,(()=>{O=!0}));if(O)return y;const D=function(e,t,n,r){const{modifiers:a,pluralRules:s,messageResolver:c,fallbackLocale:l,fallbackWarn:i,missingWarn:u,fallbackContext:f}=e,_=r=>{let o=c(n,r);if(null==o&&f){const[,,e]=Fe(f,r,t,l,i,u);o=c(e,r)}if(E(o)||ve(o)){let n=!1;const a=we(e,r,t,o,r,(()=>{n=!0}));return n?Ue:a}return xe(o)?o:Ue},m={locale:t,modifiers:a,pluralRules:s,messages:_};e.processor&&(m.processor=e.processor);r.list&&(m.list=r.list);r.named&&(m.named=r.named);o(r.plural)&&(m.pluralIndex=r.plural);return m}(e,I,g,d),P=function(e,t,n){const r=t(n);return r}(0,S,ae(D));return r?r(P,f):P},e.translateDevTools=le,e.updateFallbackLocale=function(e,t,n){e.__localeChainCache=new Map,e.localeFallbacker(e,n,t)},e}({}); |
{ | ||
"name": "@intlify/core-base", | ||
"version": "9.3.0-beta.14-77e850b", | ||
"version": "9.3.0", | ||
"description": "@intlify/core-base", | ||
@@ -36,9 +36,9 @@ "keywords": [ | ||
"dependencies": { | ||
"@intlify/devtools-if": "9.3.0-beta.14-77e850b", | ||
"@intlify/message-compiler": "9.3.0-beta.14-77e850b", | ||
"@intlify/shared": "9.3.0-beta.14-77e850b", | ||
"@intlify/vue-devtools": "9.3.0-beta.14-77e850b" | ||
"@intlify/message-compiler": "9.3.0", | ||
"@intlify/shared": "9.3.0", | ||
"@intlify/vue-devtools": "9.3.0", | ||
"@intlify/devtools-if": "9.3.0" | ||
}, | ||
"engines": { | ||
"node": ">= 14" | ||
"node": ">= 16" | ||
}, | ||
@@ -45,0 +45,0 @@ "buildOptions": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
543125
12814
0
5
28
+ Added@intlify/devtools-if@9.3.0(transitive)
+ Added@intlify/message-compiler@9.3.0(transitive)
+ Added@intlify/shared@9.3.0(transitive)
+ Added@intlify/vue-devtools@9.3.0(transitive)
+ Addedsource-map-js@1.2.1(transitive)
- Removed@intlify/devtools-if@9.3.0-beta.14-77e850b(transitive)
- Removed@intlify/message-compiler@9.3.0-beta.14-77e850b(transitive)
- Removed@intlify/shared@9.3.0-beta.14-77e850b(transitive)
- Removed@intlify/vue-devtools@9.3.0-beta.14-77e850b(transitive)
- Removedsource-map@0.6.1(transitive)
Updated@intlify/devtools-if@9.3.0
Updated@intlify/shared@9.3.0
Updated@intlify/vue-devtools@9.3.0