Socket
Socket
Sign inDemoInstall

@intlify/message-compiler

Package Overview
Dependencies
Maintainers
2
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@intlify/message-compiler - npm Package Compare versions

Comparing version 9.1.6 to 9.2.0-alpha.1

111

dist/message-compiler.cjs.js
/*!
* @intlify/message-compiler v9.1.6
* @intlify/message-compiler v9.2.0-alpha.1
* (c) 2021 kazuya kawaguchi

@@ -13,20 +13,42 @@ * Released under the MIT License.

const CompileErrorCodes = {
// tokenizer error codes
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,
// parser error codes
MUST_HAVE_MESSAGES_IN_PLURAL: 11,
UNEXPECTED_EMPTY_LINKED_MODIFIER: 12,
UNEXPECTED_EMPTY_LINKED_KEY: 13,
UNEXPECTED_LEXICAL_ANALYSIS: 14,
// Special value for higher-order compilers to pick up the last code
// to avoid collision of error codes. This should always be kept as the last
// item.
__EXTEND_POINT__: 15
};
/** @internal */
const errorMessages = {
// tokenizer error messages
[0 /* EXPECTED_TOKEN */]: `Expected token: '{0}'`,
[1 /* INVALID_TOKEN_IN_PLACEHOLDER */]: `Invalid token in placeholder: '{0}'`,
[2 /* UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER */]: `Unterminated single quote in placeholder`,
[3 /* UNKNOWN_ESCAPE_SEQUENCE */]: `Unknown escape sequence: \\{0}`,
[4 /* INVALID_UNICODE_ESCAPE_SEQUENCE */]: `Invalid unicode escape sequence: {0}`,
[5 /* UNBALANCED_CLOSING_BRACE */]: `Unbalanced closing brace`,
[6 /* UNTERMINATED_CLOSING_BRACE */]: `Unterminated closing brace`,
[7 /* EMPTY_PLACEHOLDER */]: `Empty placeholder`,
[8 /* NOT_ALLOW_NEST_PLACEHOLDER */]: `Not allowed nest placeholder`,
[9 /* INVALID_LINKED_FORMAT */]: `Invalid linked format`,
[CompileErrorCodes.EXPECTED_TOKEN]: `Expected token: '{0}'`,
[CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER]: `Invalid token in placeholder: '{0}'`,
[CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]: `Unterminated single quote in placeholder`,
[CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE]: `Unknown escape sequence: \\{0}`,
[CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE]: `Invalid unicode escape sequence: {0}`,
[CompileErrorCodes.UNBALANCED_CLOSING_BRACE]: `Unbalanced closing brace`,
[CompileErrorCodes.UNTERMINATED_CLOSING_BRACE]: `Unterminated closing brace`,
[CompileErrorCodes.EMPTY_PLACEHOLDER]: `Empty placeholder`,
[CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER]: `Not allowed nest placeholder`,
[CompileErrorCodes.INVALID_LINKED_FORMAT]: `Invalid linked format`,
// parser error messages
[10 /* MUST_HAVE_MESSAGES_IN_PLURAL */]: `Plural must have messages`,
[11 /* UNEXPECTED_EMPTY_LINKED_MODIFIER */]: `Unexpected empty linked modifier`,
[12 /* UNEXPECTED_EMPTY_LINKED_KEY */]: `Unexpected empty linked key`,
[13 /* UNEXPECTED_LEXICAL_ANALYSIS */]: `Unexpected lexical analysis in token: '{0}'`
[CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL]: `Plural must have messages`,
[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER]: `Unexpected empty linked modifier`,
[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY]: `Unexpected empty linked key`,
[CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS]: `Unexpected lexical analysis in token: '{0}'`
};

@@ -198,3 +220,3 @@ function createCompileError(code, loc, options = {}) {

else {
emitError(0 /* EXPECTED_TOKEN */, currentPosition(), 0, ch);
emitError(CompileErrorCodes.EXPECTED_TOKEN, currentPosition(), 0, ch);
return '';

@@ -467,3 +489,3 @@ }

if (scnr.currentChar() === EOF) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
}

@@ -483,3 +505,3 @@ return name;

if (scnr.currentChar() === EOF) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
}

@@ -504,3 +526,3 @@ return value;

if (current === CHAR_LF || current === EOF) {
emitError(2 /* UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, currentPosition(), 0);
// TODO: Is it correct really?

@@ -528,3 +550,3 @@ if (current === CHAR_LF) {

default:
emitError(3 /* UNKNOWN_ESCAPE_SEQUENCE */, currentPosition(), 0, ch);
emitError(CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE, currentPosition(), 0, ch);
return '';

@@ -539,3 +561,3 @@ }

if (!ch) {
emitError(4 /* INVALID_UNICODE_ESCAPE_SEQUENCE */, currentPosition(), 0, `\\${unicode}${sequence}${scnr.currentChar()}`);
emitError(CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE, currentPosition(), 0, `\\${unicode}${sequence}${scnr.currentChar()}`);
break;

@@ -607,3 +629,3 @@ }

if (context.braceNest >= 1) {
emitError(8 /* NOT_ALLOW_NEST_PLACEHOLDER */, currentPosition(), 0);
emitError(CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER, currentPosition(), 0);
}

@@ -618,3 +640,3 @@ scnr.next();

context.currentType === 2 /* BraceLeft */) {
emitError(7 /* EMPTY_PLACEHOLDER */, currentPosition(), 0);
emitError(CompileErrorCodes.EMPTY_PLACEHOLDER, currentPosition(), 0);
}

@@ -631,3 +653,3 @@ scnr.next();

if (context.braceNest > 0) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
}

@@ -643,3 +665,3 @@ token = readTokenInLinked(scnr, context) || getEndToken(context);

if (context.braceNest > 0) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
}

@@ -656,3 +678,3 @@ token = getToken(context, 1 /* Pipe */, readPlural(scnr));

context.currentType === 7 /* Literal */)) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
context.braceNest = 0;

@@ -679,3 +701,3 @@ return readToken(scnr, context);

token = getToken(context, 13 /* InvalidPlace */, readInvalidIdentifier(scnr));
emitError(1 /* INVALID_TOKEN_IN_PLACEHOLDER */, currentPosition(), 0, token.value);
emitError(CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER, currentPosition(), 0, token.value);
skipSpaces(scnr);

@@ -698,3 +720,3 @@ return token;

(ch === CHAR_LF || ch === CHAR_SP)) {
emitError(9 /* INVALID_LINKED_FORMAT */, currentPosition(), 0);
emitError(CompileErrorCodes.INVALID_LINKED_FORMAT, currentPosition(), 0);
}

@@ -743,3 +765,3 @@ switch (ch) {

if (currentType === 8 /* LinkedAlias */) {
emitError(9 /* INVALID_LINKED_FORMAT */, currentPosition(), 0);
emitError(CompileErrorCodes.INVALID_LINKED_FORMAT, currentPosition(), 0);
}

@@ -765,3 +787,3 @@ context.braceNest = 0;

case "}" /* BraceRight */:
emitError(5 /* UNBALANCED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNBALANCED_CLOSING_BRACE, currentPosition(), 0);
scnr.next();

@@ -908,3 +930,3 @@ return getToken(context, 3 /* BraceRight */, "}" /* BraceRight */);

// empty modifier
emitError(tokenizer, 11 /* UNEXPECTED_EMPTY_LINKED_MODIFIER */, context.lastStartLoc, 0);
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER, context.lastStartLoc, 0);
node.value = '';

@@ -919,3 +941,3 @@ endNode(node, offset, loc);

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -946,3 +968,3 @@ node.value = token.value || '';

if (token.type !== 10 /* LinkedDelimiter */) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -957,3 +979,3 @@ token = tokenizer.nextToken();

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -964,3 +986,3 @@ linkedNode.key = parseLinkedKey(tokenizer, token.value || '');

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -971,3 +993,3 @@ linkedNode.key = parseNamed(tokenizer, token.value || '');

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -978,3 +1000,3 @@ linkedNode.key = parseList(tokenizer, token.value || '');

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -985,3 +1007,3 @@ linkedNode.key = parseLiteral(tokenizer, token.value || '');

// empty key
emitError(tokenizer, 12 /* UNEXPECTED_EMPTY_LINKED_KEY */, context.lastStartLoc, 0);
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY, context.lastStartLoc, 0);
const nextContext = tokenizer.context();

@@ -1020,3 +1042,3 @@ const emptyLinkedKeyNode = startNode(7 /* LinkedKey */, nextContext.offset, nextContext.startLoc);

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -1027,3 +1049,3 @@ node.items.push(parseText(tokenizer, token.value || ''));

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -1034,3 +1056,3 @@ node.items.push(parseList(tokenizer, token.value || ''));

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -1041,3 +1063,3 @@ node.items.push(parseNamed(tokenizer, token.value || ''));

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -1078,3 +1100,3 @@ node.items.push(parseLiteral(tokenizer, token.value || ''));

if (hasEmptyMessage) {
emitError(tokenizer, 10 /* MUST_HAVE_MESSAGES_IN_PLURAL */, loc, 0);
emitError(tokenizer, CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL, loc, 0);
}

@@ -1105,3 +1127,3 @@ endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());

if (context.currentType !== 14 /* EOF */) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, source[context.offset] || '');
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, source[context.offset] || '');
}

@@ -1422,2 +1444,3 @@ endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());

exports.CompileErrorCodes = CompileErrorCodes;
exports.ERROR_DOMAIN = ERROR_DOMAIN;

@@ -1424,0 +1447,0 @@ exports.LocationStub = LocationStub;

/*!
* @intlify/message-compiler v9.1.6
* @intlify/message-compiler v9.2.0-alpha.1
* (c) 2021 kazuya kawaguchi

@@ -13,20 +13,42 @@ * Released under the MIT License.

const CompileErrorCodes = {
// tokenizer error codes
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,
// parser error codes
MUST_HAVE_MESSAGES_IN_PLURAL: 11,
UNEXPECTED_EMPTY_LINKED_MODIFIER: 12,
UNEXPECTED_EMPTY_LINKED_KEY: 13,
UNEXPECTED_LEXICAL_ANALYSIS: 14,
// Special value for higher-order compilers to pick up the last code
// to avoid collision of error codes. This should always be kept as the last
// item.
__EXTEND_POINT__: 15
};
/** @internal */
const errorMessages = {
// tokenizer error messages
[0 /* EXPECTED_TOKEN */]: `Expected token: '{0}'`,
[1 /* INVALID_TOKEN_IN_PLACEHOLDER */]: `Invalid token in placeholder: '{0}'`,
[2 /* UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER */]: `Unterminated single quote in placeholder`,
[3 /* UNKNOWN_ESCAPE_SEQUENCE */]: `Unknown escape sequence: \\{0}`,
[4 /* INVALID_UNICODE_ESCAPE_SEQUENCE */]: `Invalid unicode escape sequence: {0}`,
[5 /* UNBALANCED_CLOSING_BRACE */]: `Unbalanced closing brace`,
[6 /* UNTERMINATED_CLOSING_BRACE */]: `Unterminated closing brace`,
[7 /* EMPTY_PLACEHOLDER */]: `Empty placeholder`,
[8 /* NOT_ALLOW_NEST_PLACEHOLDER */]: `Not allowed nest placeholder`,
[9 /* INVALID_LINKED_FORMAT */]: `Invalid linked format`,
[CompileErrorCodes.EXPECTED_TOKEN]: `Expected token: '{0}'`,
[CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER]: `Invalid token in placeholder: '{0}'`,
[CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]: `Unterminated single quote in placeholder`,
[CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE]: `Unknown escape sequence: \\{0}`,
[CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE]: `Invalid unicode escape sequence: {0}`,
[CompileErrorCodes.UNBALANCED_CLOSING_BRACE]: `Unbalanced closing brace`,
[CompileErrorCodes.UNTERMINATED_CLOSING_BRACE]: `Unterminated closing brace`,
[CompileErrorCodes.EMPTY_PLACEHOLDER]: `Empty placeholder`,
[CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER]: `Not allowed nest placeholder`,
[CompileErrorCodes.INVALID_LINKED_FORMAT]: `Invalid linked format`,
// parser error messages
[10 /* MUST_HAVE_MESSAGES_IN_PLURAL */]: `Plural must have messages`,
[11 /* UNEXPECTED_EMPTY_LINKED_MODIFIER */]: `Unexpected empty linked modifier`,
[12 /* UNEXPECTED_EMPTY_LINKED_KEY */]: `Unexpected empty linked key`,
[13 /* UNEXPECTED_LEXICAL_ANALYSIS */]: `Unexpected lexical analysis in token: '{0}'`
[CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL]: `Plural must have messages`,
[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER]: `Unexpected empty linked modifier`,
[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY]: `Unexpected empty linked key`,
[CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS]: `Unexpected lexical analysis in token: '{0}'`
};

@@ -197,3 +219,3 @@ function createCompileError(code, loc, options = {}) {

else {
emitError(0 /* EXPECTED_TOKEN */, currentPosition(), 0, ch);
emitError(CompileErrorCodes.EXPECTED_TOKEN, currentPosition(), 0, ch);
return '';

@@ -466,3 +488,3 @@ }

if (scnr.currentChar() === EOF) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
}

@@ -482,3 +504,3 @@ return name;

if (scnr.currentChar() === EOF) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
}

@@ -503,3 +525,3 @@ return value;

if (current === CHAR_LF || current === EOF) {
emitError(2 /* UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, currentPosition(), 0);
// TODO: Is it correct really?

@@ -527,3 +549,3 @@ if (current === CHAR_LF) {

default:
emitError(3 /* UNKNOWN_ESCAPE_SEQUENCE */, currentPosition(), 0, ch);
emitError(CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE, currentPosition(), 0, ch);
return '';

@@ -538,3 +560,3 @@ }

if (!ch) {
emitError(4 /* INVALID_UNICODE_ESCAPE_SEQUENCE */, currentPosition(), 0, `\\${unicode}${sequence}${scnr.currentChar()}`);
emitError(CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE, currentPosition(), 0, `\\${unicode}${sequence}${scnr.currentChar()}`);
break;

@@ -606,3 +628,3 @@ }

if (context.braceNest >= 1) {
emitError(8 /* NOT_ALLOW_NEST_PLACEHOLDER */, currentPosition(), 0);
emitError(CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER, currentPosition(), 0);
}

@@ -617,3 +639,3 @@ scnr.next();

context.currentType === 2 /* BraceLeft */) {
emitError(7 /* EMPTY_PLACEHOLDER */, currentPosition(), 0);
emitError(CompileErrorCodes.EMPTY_PLACEHOLDER, currentPosition(), 0);
}

@@ -630,3 +652,3 @@ scnr.next();

if (context.braceNest > 0) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
}

@@ -642,3 +664,3 @@ token = readTokenInLinked(scnr, context) || getEndToken(context);

if (context.braceNest > 0) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
}

@@ -655,3 +677,3 @@ token = getToken(context, 1 /* Pipe */, readPlural(scnr));

context.currentType === 7 /* Literal */)) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
context.braceNest = 0;

@@ -678,3 +700,3 @@ return readToken(scnr, context);

token = getToken(context, 13 /* InvalidPlace */, readInvalidIdentifier(scnr));
emitError(1 /* INVALID_TOKEN_IN_PLACEHOLDER */, currentPosition(), 0, token.value);
emitError(CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER, currentPosition(), 0, token.value);
skipSpaces(scnr);

@@ -697,3 +719,3 @@ return token;

(ch === CHAR_LF || ch === CHAR_SP)) {
emitError(9 /* INVALID_LINKED_FORMAT */, currentPosition(), 0);
emitError(CompileErrorCodes.INVALID_LINKED_FORMAT, currentPosition(), 0);
}

@@ -742,3 +764,3 @@ switch (ch) {

if (currentType === 8 /* LinkedAlias */) {
emitError(9 /* INVALID_LINKED_FORMAT */, currentPosition(), 0);
emitError(CompileErrorCodes.INVALID_LINKED_FORMAT, currentPosition(), 0);
}

@@ -764,3 +786,3 @@ context.braceNest = 0;

case "}" /* BraceRight */:
emitError(5 /* UNBALANCED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNBALANCED_CLOSING_BRACE, currentPosition(), 0);
scnr.next();

@@ -907,3 +929,3 @@ return getToken(context, 3 /* BraceRight */, "}" /* BraceRight */);

// empty modifier
emitError(tokenizer, 11 /* UNEXPECTED_EMPTY_LINKED_MODIFIER */, context.lastStartLoc, 0);
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER, context.lastStartLoc, 0);
node.value = '';

@@ -918,3 +940,3 @@ endNode(node, offset, loc);

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -945,3 +967,3 @@ node.value = token.value || '';

if (token.type !== 10 /* LinkedDelimiter */) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -956,3 +978,3 @@ token = tokenizer.nextToken();

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -963,3 +985,3 @@ linkedNode.key = parseLinkedKey(tokenizer, token.value || '');

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -970,3 +992,3 @@ linkedNode.key = parseNamed(tokenizer, token.value || '');

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -977,3 +999,3 @@ linkedNode.key = parseList(tokenizer, token.value || '');

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -984,3 +1006,3 @@ linkedNode.key = parseLiteral(tokenizer, token.value || '');

// empty key
emitError(tokenizer, 12 /* UNEXPECTED_EMPTY_LINKED_KEY */, context.lastStartLoc, 0);
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY, context.lastStartLoc, 0);
const nextContext = tokenizer.context();

@@ -1019,3 +1041,3 @@ const emptyLinkedKeyNode = startNode(7 /* LinkedKey */, nextContext.offset, nextContext.startLoc);

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -1026,3 +1048,3 @@ node.items.push(parseText(tokenizer, token.value || ''));

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -1033,3 +1055,3 @@ node.items.push(parseList(tokenizer, token.value || ''));

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -1040,3 +1062,3 @@ node.items.push(parseNamed(tokenizer, token.value || ''));

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -1077,3 +1099,3 @@ node.items.push(parseLiteral(tokenizer, token.value || ''));

if (hasEmptyMessage) {
emitError(tokenizer, 10 /* MUST_HAVE_MESSAGES_IN_PLURAL */, loc, 0);
emitError(tokenizer, CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL, loc, 0);
}

@@ -1104,3 +1126,3 @@ endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());

if (context.currentType !== 14 /* EOF */) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, source[context.offset] || '');
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, source[context.offset] || '');
}

@@ -1417,2 +1439,3 @@ endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());

exports.CompileErrorCodes = CompileErrorCodes;
exports.ERROR_DOMAIN = ERROR_DOMAIN;

@@ -1419,0 +1442,0 @@ exports.LocationStub = LocationStub;

@@ -30,20 +30,22 @@ import { RawSourceMap } from 'source-map';

export declare const enum CompileErrorCodes {
EXPECTED_TOKEN = 0,
INVALID_TOKEN_IN_PLACEHOLDER = 1,
UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER = 2,
UNKNOWN_ESCAPE_SEQUENCE = 3,
INVALID_UNICODE_ESCAPE_SEQUENCE = 4,
UNBALANCED_CLOSING_BRACE = 5,
UNTERMINATED_CLOSING_BRACE = 6,
EMPTY_PLACEHOLDER = 7,
NOT_ALLOW_NEST_PLACEHOLDER = 8,
INVALID_LINKED_FORMAT = 9,
MUST_HAVE_MESSAGES_IN_PLURAL = 10,
UNEXPECTED_EMPTY_LINKED_MODIFIER = 11,
UNEXPECTED_EMPTY_LINKED_KEY = 12,
UNEXPECTED_LEXICAL_ANALYSIS = 13,
__EXTEND_POINT__ = 14
}
export declare const CompileErrorCodes: {
readonly EXPECTED_TOKEN: 1;
readonly INVALID_TOKEN_IN_PLACEHOLDER: 2;
readonly UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER: 3;
readonly UNKNOWN_ESCAPE_SEQUENCE: 4;
readonly INVALID_UNICODE_ESCAPE_SEQUENCE: 5;
readonly UNBALANCED_CLOSING_BRACE: 6;
readonly UNTERMINATED_CLOSING_BRACE: 7;
readonly EMPTY_PLACEHOLDER: 8;
readonly NOT_ALLOW_NEST_PLACEHOLDER: 9;
readonly INVALID_LINKED_FORMAT: 10;
readonly MUST_HAVE_MESSAGES_IN_PLURAL: 11;
readonly UNEXPECTED_EMPTY_LINKED_MODIFIER: 12;
readonly UNEXPECTED_EMPTY_LINKED_KEY: 13;
readonly UNEXPECTED_LEXICAL_ANALYSIS: 14;
readonly __EXTEND_POINT__: 15;
};
export declare type CompileErrorCodes = typeof CompileErrorCodes[keyof typeof CompileErrorCodes];
export declare type CompileErrorHandler = (error: CompileError) => void;

@@ -50,0 +52,0 @@

/*!
* @intlify/message-compiler v9.1.6
* @intlify/message-compiler v9.2.0-alpha.1
* (c) 2021 kazuya kawaguchi

@@ -28,20 +28,42 @@ * Released under the MIT License.

const CompileErrorCodes = {
// tokenizer error codes
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,
// parser error codes
MUST_HAVE_MESSAGES_IN_PLURAL: 11,
UNEXPECTED_EMPTY_LINKED_MODIFIER: 12,
UNEXPECTED_EMPTY_LINKED_KEY: 13,
UNEXPECTED_LEXICAL_ANALYSIS: 14,
// Special value for higher-order compilers to pick up the last code
// to avoid collision of error codes. This should always be kept as the last
// item.
__EXTEND_POINT__: 15
};
/** @internal */
const errorMessages = {
// tokenizer error messages
[0 /* EXPECTED_TOKEN */]: `Expected token: '{0}'`,
[1 /* INVALID_TOKEN_IN_PLACEHOLDER */]: `Invalid token in placeholder: '{0}'`,
[2 /* UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER */]: `Unterminated single quote in placeholder`,
[3 /* UNKNOWN_ESCAPE_SEQUENCE */]: `Unknown escape sequence: \\{0}`,
[4 /* INVALID_UNICODE_ESCAPE_SEQUENCE */]: `Invalid unicode escape sequence: {0}`,
[5 /* UNBALANCED_CLOSING_BRACE */]: `Unbalanced closing brace`,
[6 /* UNTERMINATED_CLOSING_BRACE */]: `Unterminated closing brace`,
[7 /* EMPTY_PLACEHOLDER */]: `Empty placeholder`,
[8 /* NOT_ALLOW_NEST_PLACEHOLDER */]: `Not allowed nest placeholder`,
[9 /* INVALID_LINKED_FORMAT */]: `Invalid linked format`,
[CompileErrorCodes.EXPECTED_TOKEN]: `Expected token: '{0}'`,
[CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER]: `Invalid token in placeholder: '{0}'`,
[CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]: `Unterminated single quote in placeholder`,
[CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE]: `Unknown escape sequence: \\{0}`,
[CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE]: `Invalid unicode escape sequence: {0}`,
[CompileErrorCodes.UNBALANCED_CLOSING_BRACE]: `Unbalanced closing brace`,
[CompileErrorCodes.UNTERMINATED_CLOSING_BRACE]: `Unterminated closing brace`,
[CompileErrorCodes.EMPTY_PLACEHOLDER]: `Empty placeholder`,
[CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER]: `Not allowed nest placeholder`,
[CompileErrorCodes.INVALID_LINKED_FORMAT]: `Invalid linked format`,
// parser error messages
[10 /* MUST_HAVE_MESSAGES_IN_PLURAL */]: `Plural must have messages`,
[11 /* UNEXPECTED_EMPTY_LINKED_MODIFIER */]: `Unexpected empty linked modifier`,
[12 /* UNEXPECTED_EMPTY_LINKED_KEY */]: `Unexpected empty linked key`,
[13 /* UNEXPECTED_LEXICAL_ANALYSIS */]: `Unexpected lexical analysis in token: '{0}'`
[CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL]: `Plural must have messages`,
[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER]: `Unexpected empty linked modifier`,
[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY]: `Unexpected empty linked key`,
[CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS]: `Unexpected lexical analysis in token: '{0}'`
};

@@ -213,3 +235,3 @@ function createCompileError(code, loc, options = {}) {

else {
emitError(0 /* EXPECTED_TOKEN */, currentPosition(), 0, ch);
emitError(CompileErrorCodes.EXPECTED_TOKEN, currentPosition(), 0, ch);
return '';

@@ -482,3 +504,3 @@ }

if (scnr.currentChar() === EOF) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
}

@@ -498,3 +520,3 @@ return name;

if (scnr.currentChar() === EOF) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
}

@@ -519,3 +541,3 @@ return value;

if (current === CHAR_LF || current === EOF) {
emitError(2 /* UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, currentPosition(), 0);
// TODO: Is it correct really?

@@ -543,3 +565,3 @@ if (current === CHAR_LF) {

default:
emitError(3 /* UNKNOWN_ESCAPE_SEQUENCE */, currentPosition(), 0, ch);
emitError(CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE, currentPosition(), 0, ch);
return '';

@@ -554,3 +576,3 @@ }

if (!ch) {
emitError(4 /* INVALID_UNICODE_ESCAPE_SEQUENCE */, currentPosition(), 0, `\\${unicode}${sequence}${scnr.currentChar()}`);
emitError(CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE, currentPosition(), 0, `\\${unicode}${sequence}${scnr.currentChar()}`);
break;

@@ -622,3 +644,3 @@ }

if (context.braceNest >= 1) {
emitError(8 /* NOT_ALLOW_NEST_PLACEHOLDER */, currentPosition(), 0);
emitError(CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER, currentPosition(), 0);
}

@@ -633,3 +655,3 @@ scnr.next();

context.currentType === 2 /* BraceLeft */) {
emitError(7 /* EMPTY_PLACEHOLDER */, currentPosition(), 0);
emitError(CompileErrorCodes.EMPTY_PLACEHOLDER, currentPosition(), 0);
}

@@ -646,3 +668,3 @@ scnr.next();

if (context.braceNest > 0) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
}

@@ -658,3 +680,3 @@ token = readTokenInLinked(scnr, context) || getEndToken(context);

if (context.braceNest > 0) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
}

@@ -671,3 +693,3 @@ token = getToken(context, 1 /* Pipe */, readPlural(scnr));

context.currentType === 7 /* Literal */)) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
context.braceNest = 0;

@@ -694,3 +716,3 @@ return readToken(scnr, context);

token = getToken(context, 13 /* InvalidPlace */, readInvalidIdentifier(scnr));
emitError(1 /* INVALID_TOKEN_IN_PLACEHOLDER */, currentPosition(), 0, token.value);
emitError(CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER, currentPosition(), 0, token.value);
skipSpaces(scnr);

@@ -713,3 +735,3 @@ return token;

(ch === CHAR_LF || ch === CHAR_SP)) {
emitError(9 /* INVALID_LINKED_FORMAT */, currentPosition(), 0);
emitError(CompileErrorCodes.INVALID_LINKED_FORMAT, currentPosition(), 0);
}

@@ -758,3 +780,3 @@ switch (ch) {

if (currentType === 8 /* LinkedAlias */) {
emitError(9 /* INVALID_LINKED_FORMAT */, currentPosition(), 0);
emitError(CompileErrorCodes.INVALID_LINKED_FORMAT, currentPosition(), 0);
}

@@ -780,3 +802,3 @@ context.braceNest = 0;

case "}" /* BraceRight */:
emitError(5 /* UNBALANCED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNBALANCED_CLOSING_BRACE, currentPosition(), 0);
scnr.next();

@@ -923,3 +945,3 @@ return getToken(context, 3 /* BraceRight */, "}" /* BraceRight */);

// empty modifier
emitError(tokenizer, 11 /* UNEXPECTED_EMPTY_LINKED_MODIFIER */, context.lastStartLoc, 0);
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER, context.lastStartLoc, 0);
node.value = '';

@@ -934,3 +956,3 @@ endNode(node, offset, loc);

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -961,3 +983,3 @@ node.value = token.value || '';

if (token.type !== 10 /* LinkedDelimiter */) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -972,3 +994,3 @@ token = tokenizer.nextToken();

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -979,3 +1001,3 @@ linkedNode.key = parseLinkedKey(tokenizer, token.value || '');

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -986,3 +1008,3 @@ linkedNode.key = parseNamed(tokenizer, token.value || '');

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -993,3 +1015,3 @@ linkedNode.key = parseList(tokenizer, token.value || '');

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -1000,3 +1022,3 @@ linkedNode.key = parseLiteral(tokenizer, token.value || '');

// empty key
emitError(tokenizer, 12 /* UNEXPECTED_EMPTY_LINKED_KEY */, context.lastStartLoc, 0);
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY, context.lastStartLoc, 0);
const nextContext = tokenizer.context();

@@ -1035,3 +1057,3 @@ const emptyLinkedKeyNode = startNode(7 /* LinkedKey */, nextContext.offset, nextContext.startLoc);

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -1042,3 +1064,3 @@ node.items.push(parseText(tokenizer, token.value || ''));

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -1049,3 +1071,3 @@ node.items.push(parseList(tokenizer, token.value || ''));

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -1056,3 +1078,3 @@ node.items.push(parseNamed(tokenizer, token.value || ''));

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -1093,3 +1115,3 @@ node.items.push(parseLiteral(tokenizer, token.value || ''));

if (hasEmptyMessage) {
emitError(tokenizer, 10 /* MUST_HAVE_MESSAGES_IN_PLURAL */, loc, 0);
emitError(tokenizer, CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL, loc, 0);
}

@@ -1120,3 +1142,3 @@ endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());

if (context.currentType !== 14 /* EOF */) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, source[context.offset] || '');
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, source[context.offset] || '');
}

@@ -1378,2 +1400,2 @@ endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());

export { ERROR_DOMAIN, LocationStub, baseCompile, createCompileError, createLocation, createParser, createPosition, defaultOnError, errorMessages };
export { CompileErrorCodes, ERROR_DOMAIN, LocationStub, baseCompile, createCompileError, createLocation, createParser, createPosition, defaultOnError, errorMessages };
/*!
* @intlify/message-compiler v9.1.6
* @intlify/message-compiler v9.2.0-alpha.1
* (c) 2021 kazuya kawaguchi
* Released under the MIT License.
*/
const e=Object.assign,n=e=>"string"==typeof e,t={0:"Expected token: '{0}'",1:"Invalid token in placeholder: '{0}'",2:"Unterminated single quote in placeholder",3:"Unknown escape sequence: \\{0}",4:"Invalid unicode escape sequence: {0}",5:"Unbalanced closing brace",6:"Unterminated closing brace",7:"Empty placeholder",8:"Not allowed nest placeholder",9:"Invalid linked format",10:"Plural must have messages",11:"Unexpected empty linked modifier",12:"Unexpected empty linked key",13:"Unexpected lexical analysis in token: '{0}'"};function r(e,n,t={}){const{domain:r}=t,c=new SyntaxError(String(e));return c.code=e,n&&(c.location=n),c.domain=r,c}function c(e){throw e}const o={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0}};function u(e,n,t){return{line:e,column:n,offset:t}}function s(e,n,t){const r={start:e,end:n};return null!=t&&(r.source=t),r}const i=String.fromCharCode(8232),a=String.fromCharCode(8233);function l(e){const n=e;let t=0,r=1,c=1,o=0;const u=e=>"\r"===n[e]&&"\n"===n[e+1],s=e=>n[e]===a,l=e=>n[e]===i,f=e=>u(e)||(e=>"\n"===n[e])(e)||s(e)||l(e),d=e=>u(e)||s(e)||l(e)?"\n":n[e];function p(){return o=0,f(t)&&(r++,c=0),u(t)&&t++,t++,c++,n[t]}return{index:()=>t,line:()=>r,column:()=>c,peekOffset:()=>o,charAt:d,currentChar:()=>d(t),currentPeek:()=>d(t+o),next:p,peek:function(){return u(t+o)&&o++,o++,n[t+o]},reset:function(){t=0,r=1,c=1,o=0},resetPeek:function(e=0){o=e},skipToPeek:function(){const e=t+o;for(;e!==t;)p();o=0}}}const f=void 0;function d(e,n={}){const t=!1!==n.location,r=l(e),c=()=>r.index(),o=()=>u(r.line(),r.column(),r.index()),i=o(),a=c(),d={currentType:14,offset:a,startLoc:i,endLoc:i,lastType:14,lastOffset:a,lastStartLoc:i,lastEndLoc:i,braceNest:0,inLinked:!1,text:""},p=()=>d,{onError:k}=n;function h(e,n,r){e.endLoc=o(),e.currentType=n;const c={type:n};return t&&(c.loc=s(e.startLoc,e.endLoc)),null!=r&&(c.value=r),c}const x=e=>h(e,14);function y(e,n){return e.currentChar()===n?(e.next(),n):(o(),"")}function m(e){let n="";for(;" "===e.currentPeek()||"\n"===e.currentPeek();)n+=e.currentPeek(),e.peek();return n}function b(e){const n=m(e);return e.skipToPeek(),n}function L(e){if(e===f)return!1;const n=e.charCodeAt(0);return n>=97&&n<=122||n>=65&&n<=90||95===n}function T(e,n){const{currentType:t}=n;if(2!==t)return!1;m(e);const r=function(e){if(e===f)return!1;const n=e.charCodeAt(0);return n>=48&&n<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),r}function v(e){m(e);const n="|"===e.currentPeek();return e.resetPeek(),n}function P(e,n=!0){const t=(n=!1,r="",c=!1)=>{const o=e.currentPeek();return"{"===o?"%"!==r&&n:"@"!==o&&o?"%"===o?(e.peek(),t(n,"%",!0)):"|"===o?!("%"!==r&&!c)||!(" "===r||"\n"===r):" "===o?(e.peek(),t(!0," ",c)):"\n"!==o||(e.peek(),t(!0,"\n",c)):"%"===r||n},r=t();return n&&e.resetPeek(),r}function C(e,n){const t=e.currentChar();return t===f?f:n(t)?(e.next(),t):null}function O(e){return C(e,(e=>{const n=e.charCodeAt(0);return n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57||95===n||36===n}))}function g(e){return C(e,(e=>{const n=e.charCodeAt(0);return n>=48&&n<=57}))}function N(e){return C(e,(e=>{const n=e.charCodeAt(0);return n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102}))}function w(e){let n="",t="";for(;n=g(e);)t+=n;return t}function $(e){const n=e.currentChar();switch(n){case"\\":case"'":return e.next(),`\\${n}`;case"u":return S(e,n,4);case"U":return S(e,n,6);default:return o(),""}}function S(e,n,t){y(e,n);let r="";for(let n=0;n<t;n++){const n=N(e);if(!n){o(),e.currentChar();break}r+=n}return`\\${n}${r}`}function I(e){b(e);const n=y(e,"|");return b(e),n}function A(e,n){let t=null;switch(e.currentChar()){case"{":return n.braceNest>=1&&o(),e.next(),t=h(n,2,"{"),b(e),n.braceNest++,t;case"}":return n.braceNest>0&&2===n.currentType&&o(),e.next(),t=h(n,3,"}"),n.braceNest--,n.braceNest>0&&b(e),n.inLinked&&0===n.braceNest&&(n.inLinked=!1),t;case"@":return n.braceNest>0&&o(),t=E(e,n)||x(n),n.braceNest=0,t;default:let r=!0,c=!0,u=!0;if(v(e))return n.braceNest>0&&o(),t=h(n,1,I(e)),n.braceNest=0,n.inLinked=!1,t;if(n.braceNest>0&&(5===n.currentType||6===n.currentType||7===n.currentType))return o(),n.braceNest=0,U(e,n);if(r=function(e,n){const{currentType:t}=n;if(2!==t)return!1;m(e);const r=L(e.currentPeek());return e.resetPeek(),r}(e,n))return t=h(n,5,function(e){b(e);let n="",t="";for(;n=O(e);)t+=n;return e.currentChar()===f&&o(),t}(e)),b(e),t;if(c=T(e,n))return t=h(n,6,function(e){b(e);let n="";return"-"===e.currentChar()?(e.next(),n+=`-${w(e)}`):n+=w(e),e.currentChar()===f&&o(),n}(e)),b(e),t;if(u=function(e,n){const{currentType:t}=n;if(2!==t)return!1;m(e);const r="'"===e.currentPeek();return e.resetPeek(),r}(e,n))return t=h(n,7,function(e){b(e),y(e,"'");let n="",t="";const r=e=>"'"!==e&&"\n"!==e;for(;n=C(e,r);)t+="\\"===n?$(e):n;const c=e.currentChar();return"\n"===c||c===f?(o(),"\n"===c&&(e.next(),y(e,"'")),t):(y(e,"'"),t)}(e)),b(e),t;if(!r&&!c&&!u)return t=h(n,13,function(e){b(e);let n="",t="";const r=e=>"{"!==e&&"}"!==e&&" "!==e&&"\n"!==e;for(;n=C(e,r);)t+=n;return t}(e)),o(),b(e),t}return t}function E(e,n){const{currentType:t}=n;let r=null;const c=e.currentChar();switch(8!==t&&9!==t&&12!==t&&10!==t||"\n"!==c&&" "!==c||o(),c){case"@":return e.next(),r=h(n,8,"@"),n.inLinked=!0,r;case".":return b(e),e.next(),h(n,9,".");case":":return b(e),e.next(),h(n,10,":");default:return v(e)?(r=h(n,1,I(e)),n.braceNest=0,n.inLinked=!1,r):function(e,n){const{currentType:t}=n;if(8!==t)return!1;m(e);const r="."===e.currentPeek();return e.resetPeek(),r}(e,n)||function(e,n){const{currentType:t}=n;if(8!==t&&12!==t)return!1;m(e);const r=":"===e.currentPeek();return e.resetPeek(),r}(e,n)?(b(e),E(e,n)):function(e,n){const{currentType:t}=n;if(9!==t)return!1;m(e);const r=L(e.currentPeek());return e.resetPeek(),r}(e,n)?(b(e),h(n,12,function(e){let n="",t="";for(;n=O(e);)t+=n;return t}(e))):function(e,n){const{currentType:t}=n;if(10!==t)return!1;const r=()=>{const n=e.currentPeek();return"{"===n?L(e.peek()):!("@"===n||"%"===n||"|"===n||":"===n||"."===n||" "===n||!n)&&("\n"===n?(e.peek(),r()):L(n))},c=r();return e.resetPeek(),c}(e,n)?(b(e),"{"===c?A(e,n)||r:h(n,11,function(e){const n=(t=!1,r)=>{const c=e.currentChar();return"{"!==c&&"%"!==c&&"@"!==c&&"|"!==c&&c?" "===c?r:"\n"===c?(r+=c,e.next(),n(t,r)):(r+=c,e.next(),n(!0,r)):r};return n(!1,"")}(e))):(8===t&&o(),n.braceNest=0,n.inLinked=!1,U(e,n))}}function U(e,n){let t={type:14};if(n.braceNest>0)return A(e,n)||x(n);if(n.inLinked)return E(e,n)||x(n);const r=e.currentChar();switch(r){case"{":return A(e,n)||x(n);case"}":return o(),e.next(),h(n,3,"}");case"@":return E(e,n)||x(n);default:if(v(e))return t=h(n,1,I(e)),n.braceNest=0,n.inLinked=!1,t;if(P(e))return h(n,0,function(e){const n=t=>{const r=e.currentChar();return"{"!==r&&"}"!==r&&"@"!==r&&r?"%"===r?P(e)?(t+=r,e.next(),n(t)):t:"|"===r?t:" "===r||"\n"===r?P(e)?(t+=r,e.next(),n(t)):v(e)?t:(t+=r,e.next(),n(t)):(t+=r,e.next(),n(t)):t};return n("")}(e));if("%"===r)return e.next(),h(n,4,"%")}return t}return{nextToken:function(){const{currentType:e,offset:n,startLoc:t,endLoc:u}=d;return d.lastType=e,d.lastOffset=n,d.lastStartLoc=t,d.lastEndLoc=u,d.offset=c(),d.startLoc=o(),r.currentChar()===f?h(d,14):U(r,d)},currentOffset:c,currentPosition:o,context:p}}const p="parser",k=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function h(e,n,t){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const e=parseInt(n||t,16);return e<=55295||e>=57344?String.fromCodePoint(e):"�"}}}function x(n={}){const t=!1!==n.location,{onError:r}=n;function c(e,n,r){const c={type:e,start:n,end:n};return t&&(c.loc={start:r,end:r}),c}function o(e,n,r,c){e.end=n,c&&(e.type=c),t&&e.loc&&(e.loc.end=r)}function u(e,n){const t=e.context(),r=c(3,t.offset,t.startLoc);return r.value=n,o(r,e.currentOffset(),e.currentPosition()),r}function s(e,n){const t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(5,r,u);return s.index=parseInt(n,10),e.nextToken(),o(s,e.currentOffset(),e.currentPosition()),s}function i(e,n){const t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(4,r,u);return s.key=n,e.nextToken(),o(s,e.currentOffset(),e.currentPosition()),s}function a(e,n){const t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(9,r,u);return s.value=n.replace(k,h),e.nextToken(),o(s,e.currentOffset(),e.currentPosition()),s}function l(e){const n=e.context(),t=c(6,n.offset,n.startLoc);let r=e.nextToken();if(9===r.type){const n=function(e){const n=e.nextToken(),t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(8,r,u);return 12!==n.type?(s.value="",o(s,r,u),{nextConsumeToken:n,node:s}):(null==n.value&&y(n),s.value=n.value||"",o(s,e.currentOffset(),e.currentPosition()),{node:s})}(e);t.modifier=n.node,r=n.nextConsumeToken||e.nextToken()}switch(10!==r.type&&y(r),r=e.nextToken(),2===r.type&&(r=e.nextToken()),r.type){case 11:null==r.value&&y(r),t.key=function(e,n){const t=e.context(),r=c(7,t.offset,t.startLoc);return r.value=n,o(r,e.currentOffset(),e.currentPosition()),r}(e,r.value||"");break;case 5:null==r.value&&y(r),t.key=i(e,r.value||"");break;case 6:null==r.value&&y(r),t.key=s(e,r.value||"");break;case 7:null==r.value&&y(r),t.key=a(e,r.value||"");break;default:const n=e.context(),u=c(7,n.offset,n.startLoc);return u.value="",o(u,n.offset,n.startLoc),t.key=u,o(t,n.offset,n.startLoc),{nextConsumeToken:r,node:t}}return o(t,e.currentOffset(),e.currentPosition()),{node:t}}function f(e){const n=e.context(),t=c(2,1===n.currentType?e.currentOffset():n.offset,1===n.currentType?n.endLoc:n.startLoc);t.items=[];let r=null;do{const n=r||e.nextToken();switch(r=null,n.type){case 0:null==n.value&&y(n),t.items.push(u(e,n.value||""));break;case 6:null==n.value&&y(n),t.items.push(s(e,n.value||""));break;case 5:null==n.value&&y(n),t.items.push(i(e,n.value||""));break;case 7:null==n.value&&y(n),t.items.push(a(e,n.value||""));break;case 8:const c=l(e);t.items.push(c.node),r=c.nextConsumeToken||null}}while(14!==n.currentType&&1!==n.currentType);return o(t,1===n.currentType?n.lastOffset:e.currentOffset(),1===n.currentType?n.lastEndLoc:e.currentPosition()),t}function p(e){const n=e.context(),{offset:t,startLoc:r}=n,u=f(e);return 14===n.currentType?u:function(e,n,t,r){const u=e.context();let s=0===r.items.length;const i=c(1,n,t);i.cases=[],i.cases.push(r);do{const n=f(e);s||(s=0===n.items.length),i.cases.push(n)}while(14!==u.currentType);return o(i,e.currentOffset(),e.currentPosition()),i}(e,t,r,u)}return{parse:function(r){const u=d(r,e({},n)),s=u.context(),i=c(0,s.offset,s.startLoc);return t&&i.loc&&(i.loc.source=r),i.body=p(u),o(i,u.currentOffset(),u.currentPosition()),i}}}function y(e){if(14===e.type)return"EOF";const n=(e.value||"").replace(/\r?\n/gu,"\\n");return n.length>10?n.slice(0,9)+"…":n}function m(e,n){for(let t=0;t<e.length;t++)b(e[t],n)}function b(e,n){switch(e.type){case 1:m(e.cases,n),n.helper("plural");break;case 2:m(e.items,n);break;case 6:b(e.key,n),n.helper("linked");break;case 5:n.helper("interpolate"),n.helper("list");break;case 4:n.helper("interpolate"),n.helper("named")}}function L(e,n={}){const t=function(e,n={}){const t={ast:e,helpers:new Set};return{context:()=>t,helper:e=>(t.helpers.add(e),e)}}(e);t.helper("normalize"),e.body&&b(e.body,t);const r=t.context();e.helpers=Array.from(r.helpers)}function T(e,n){const{helper:t}=e;switch(n.type){case 0:!function(e,n){n.body?T(e,n.body):e.push("null")}(e,n);break;case 1:!function(e,n){const{helper:t,needIndent:r}=e;if(n.cases.length>1){e.push(`${t("plural")}([`),e.indent(r());const c=n.cases.length;for(let t=0;t<c&&(T(e,n.cases[t]),t!==c-1);t++)e.push(", ");e.deindent(r()),e.push("])")}}(e,n);break;case 2:!function(e,n){const{helper:t,needIndent:r}=e;e.push(`${t("normalize")}([`),e.indent(r());const c=n.items.length;for(let t=0;t<c&&(T(e,n.items[t]),t!==c-1);t++)e.push(", ");e.deindent(r()),e.push("])")}(e,n);break;case 6:!function(e,n){const{helper:t}=e;e.push(`${t("linked")}(`),T(e,n.key),n.modifier&&(e.push(", "),T(e,n.modifier)),e.push(")")}(e,n);break;case 8:case 7:e.push(JSON.stringify(n.value),n);break;case 5:e.push(`${t("interpolate")}(${t("list")}(${n.index}))`,n);break;case 4:e.push(`${t("interpolate")}(${t("named")}(${JSON.stringify(n.key)}))`,n);break;case 9:case 3:e.push(JSON.stringify(n.value),n)}}function v(t,r={}){const c=e({},r),o=x(c).parse(t);return L(o,c),((e,t={})=>{const r=n(t.mode)?t.mode:"normal",c=n(t.filename)?t.filename:"message.intl",o=t.needIndent?t.needIndent:"arrow"!==r,u=e.helpers||[],s=function(e,n){const{filename:t,breakLineCode:r,needIndent:c}=n,o={source:e.loc.source,filename:t,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:c,indentLevel:0};function u(e,n){o.code+=e}function s(e,n=!0){const t=n?r:"";u(c?t+" ".repeat(e):t)}return{context:()=>o,push:u,indent:function(e=!0){const n=++o.indentLevel;e&&s(n)},deindent:function(e=!0){const n=--o.indentLevel;e&&s(n)},newline:function(){s(o.indentLevel)},helper:e=>`_${e}`,needIndent:()=>o.needIndent}}(e,{mode:r,filename:c,sourceMap:!!t.sourceMap,breakLineCode:null!=t.breakLineCode?t.breakLineCode:"arrow"===r?";":"\n",needIndent:o});s.push("normal"===r?"function __msg__ (ctx) {":"(ctx) => {"),s.indent(o),u.length>0&&(s.push(`const { ${u.map((e=>`${e}: _${e}`)).join(", ")} } = ctx`),s.newline()),s.push("return "),T(s,e),s.deindent(o),s.push("}");const{code:i,map:a}=s.context();return{ast:e,code:i,map:a?a.toJSON():void 0}})(o,c)}export{p as ERROR_DOMAIN,o as LocationStub,v as baseCompile,r as createCompileError,s as createLocation,x as createParser,u as createPosition,c as defaultOnError,t as errorMessages};
const e=Object.assign,n=e=>"string"==typeof e,t={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},r={[t.EXPECTED_TOKEN]:"Expected token: '{0}'",[t.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[t.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[t.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[t.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[t.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[t.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[t.EMPTY_PLACEHOLDER]:"Empty placeholder",[t.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[t.INVALID_LINKED_FORMAT]:"Invalid linked format",[t.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[t.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[t.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[t.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'"};function c(e,n,t={}){const{domain:r}=t,c=new SyntaxError(String(e));return c.code=e,n&&(c.location=n),c.domain=r,c}function o(e){throw e}const u={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0}};function s(e,n,t){return{line:e,column:n,offset:t}}function i(e,n,t){const r={start:e,end:n};return null!=t&&(r.source=t),r}const a=String.fromCharCode(8232),l=String.fromCharCode(8233);function f(e){const n=e;let t=0,r=1,c=1,o=0;const u=e=>"\r"===n[e]&&"\n"===n[e+1],s=e=>n[e]===l,i=e=>n[e]===a,f=e=>u(e)||(e=>"\n"===n[e])(e)||s(e)||i(e),d=e=>u(e)||s(e)||i(e)?"\n":n[e];function p(){return o=0,f(t)&&(r++,c=0),u(t)&&t++,t++,c++,n[t]}return{index:()=>t,line:()=>r,column:()=>c,peekOffset:()=>o,charAt:d,currentChar:()=>d(t),currentPeek:()=>d(t+o),next:p,peek:function(){return u(t+o)&&o++,o++,n[t+o]},reset:function(){t=0,r=1,c=1,o=0},resetPeek:function(e=0){o=e},skipToPeek:function(){const e=t+o;for(;e!==t;)p();o=0}}}const d=void 0;function p(e,n={}){const t=!1!==n.location,r=f(e),c=()=>r.index(),o=()=>s(r.line(),r.column(),r.index()),u=o(),a=c(),l={currentType:14,offset:a,startLoc:u,endLoc:u,lastType:14,lastOffset:a,lastStartLoc:u,lastEndLoc:u,braceNest:0,inLinked:!1,text:""},p=()=>l,{onError:E}=n;function k(e,n,r){e.endLoc=o(),e.currentType=n;const c={type:n};return t&&(c.loc=i(e.startLoc,e.endLoc)),null!=r&&(c.value=r),c}const L=e=>k(e,14);function h(e,n){return e.currentChar()===n?(e.next(),n):(o(),"")}function N(e){let n="";for(;" "===e.currentPeek()||"\n"===e.currentPeek();)n+=e.currentPeek(),e.peek();return n}function _(e){const n=N(e);return e.skipToPeek(),n}function T(e){if(e===d)return!1;const n=e.charCodeAt(0);return n>=97&&n<=122||n>=65&&n<=90||95===n}function C(e,n){const{currentType:t}=n;if(2!==t)return!1;N(e);const r=function(e){if(e===d)return!1;const n=e.charCodeAt(0);return n>=48&&n<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),r}function P(e){N(e);const n="|"===e.currentPeek();return e.resetPeek(),n}function x(e,n=!0){const t=(n=!1,r="",c=!1)=>{const o=e.currentPeek();return"{"===o?"%"!==r&&n:"@"!==o&&o?"%"===o?(e.peek(),t(n,"%",!0)):"|"===o?!("%"!==r&&!c)||!(" "===r||"\n"===r):" "===o?(e.peek(),t(!0," ",c)):"\n"!==o||(e.peek(),t(!0,"\n",c)):"%"===r||n},r=t();return n&&e.resetPeek(),r}function y(e,n){const t=e.currentChar();return t===d?d:n(t)?(e.next(),t):null}function m(e){return y(e,(e=>{const n=e.charCodeAt(0);return n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57||95===n||36===n}))}function I(e){return y(e,(e=>{const n=e.charCodeAt(0);return n>=48&&n<=57}))}function O(e){return y(e,(e=>{const n=e.charCodeAt(0);return n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102}))}function A(e){let n="",t="";for(;n=I(e);)t+=n;return t}function b(e){const n=e.currentChar();switch(n){case"\\":case"'":return e.next(),`\\${n}`;case"u":return S(e,n,4);case"U":return S(e,n,6);default:return o(),""}}function S(e,n,t){h(e,n);let r="";for(let n=0;n<t;n++){const n=O(e);if(!n){o(),e.currentChar();break}r+=n}return`\\${n}${r}`}function v(e){_(e);const n=h(e,"|");return _(e),n}function D(e,n){let t=null;switch(e.currentChar()){case"{":return n.braceNest>=1&&o(),e.next(),t=k(n,2,"{"),_(e),n.braceNest++,t;case"}":return n.braceNest>0&&2===n.currentType&&o(),e.next(),t=k(n,3,"}"),n.braceNest--,n.braceNest>0&&_(e),n.inLinked&&0===n.braceNest&&(n.inLinked=!1),t;case"@":return n.braceNest>0&&o(),t=U(e,n)||L(n),n.braceNest=0,t;default:let r=!0,c=!0,u=!0;if(P(e))return n.braceNest>0&&o(),t=k(n,1,v(e)),n.braceNest=0,n.inLinked=!1,t;if(n.braceNest>0&&(5===n.currentType||6===n.currentType||7===n.currentType))return o(),n.braceNest=0,g(e,n);if(r=function(e,n){const{currentType:t}=n;if(2!==t)return!1;N(e);const r=T(e.currentPeek());return e.resetPeek(),r}(e,n))return t=k(n,5,function(e){_(e);let n="",t="";for(;n=m(e);)t+=n;return e.currentChar()===d&&o(),t}(e)),_(e),t;if(c=C(e,n))return t=k(n,6,function(e){_(e);let n="";return"-"===e.currentChar()?(e.next(),n+=`-${A(e)}`):n+=A(e),e.currentChar()===d&&o(),n}(e)),_(e),t;if(u=function(e,n){const{currentType:t}=n;if(2!==t)return!1;N(e);const r="'"===e.currentPeek();return e.resetPeek(),r}(e,n))return t=k(n,7,function(e){_(e),h(e,"'");let n="",t="";const r=e=>"'"!==e&&"\n"!==e;for(;n=y(e,r);)t+="\\"===n?b(e):n;const c=e.currentChar();return"\n"===c||c===d?(o(),"\n"===c&&(e.next(),h(e,"'")),t):(h(e,"'"),t)}(e)),_(e),t;if(!r&&!c&&!u)return t=k(n,13,function(e){_(e);let n="",t="";const r=e=>"{"!==e&&"}"!==e&&" "!==e&&"\n"!==e;for(;n=y(e,r);)t+=n;return t}(e)),o(),_(e),t}return t}function U(e,n){const{currentType:t}=n;let r=null;const c=e.currentChar();switch(8!==t&&9!==t&&12!==t&&10!==t||"\n"!==c&&" "!==c||o(),c){case"@":return e.next(),r=k(n,8,"@"),n.inLinked=!0,r;case".":return _(e),e.next(),k(n,9,".");case":":return _(e),e.next(),k(n,10,":");default:return P(e)?(r=k(n,1,v(e)),n.braceNest=0,n.inLinked=!1,r):function(e,n){const{currentType:t}=n;if(8!==t)return!1;N(e);const r="."===e.currentPeek();return e.resetPeek(),r}(e,n)||function(e,n){const{currentType:t}=n;if(8!==t&&12!==t)return!1;N(e);const r=":"===e.currentPeek();return e.resetPeek(),r}(e,n)?(_(e),U(e,n)):function(e,n){const{currentType:t}=n;if(9!==t)return!1;N(e);const r=T(e.currentPeek());return e.resetPeek(),r}(e,n)?(_(e),k(n,12,function(e){let n="",t="";for(;n=m(e);)t+=n;return t}(e))):function(e,n){const{currentType:t}=n;if(10!==t)return!1;const r=()=>{const n=e.currentPeek();return"{"===n?T(e.peek()):!("@"===n||"%"===n||"|"===n||":"===n||"."===n||" "===n||!n)&&("\n"===n?(e.peek(),r()):T(n))},c=r();return e.resetPeek(),c}(e,n)?(_(e),"{"===c?D(e,n)||r:k(n,11,function(e){const n=(t=!1,r)=>{const c=e.currentChar();return"{"!==c&&"%"!==c&&"@"!==c&&"|"!==c&&c?" "===c?r:"\n"===c?(r+=c,e.next(),n(t,r)):(r+=c,e.next(),n(!0,r)):r};return n(!1,"")}(e))):(8===t&&o(),n.braceNest=0,n.inLinked=!1,g(e,n))}}function g(e,n){let t={type:14};if(n.braceNest>0)return D(e,n)||L(n);if(n.inLinked)return U(e,n)||L(n);const r=e.currentChar();switch(r){case"{":return D(e,n)||L(n);case"}":return o(),e.next(),k(n,3,"}");case"@":return U(e,n)||L(n);default:if(P(e))return t=k(n,1,v(e)),n.braceNest=0,n.inLinked=!1,t;if(x(e))return k(n,0,function(e){const n=t=>{const r=e.currentChar();return"{"!==r&&"}"!==r&&"@"!==r&&r?"%"===r?x(e)?(t+=r,e.next(),n(t)):t:"|"===r?t:" "===r||"\n"===r?x(e)?(t+=r,e.next(),n(t)):P(e)?t:(t+=r,e.next(),n(t)):(t+=r,e.next(),n(t)):t};return n("")}(e));if("%"===r)return e.next(),k(n,4,"%")}return t}return{nextToken:function(){const{currentType:e,offset:n,startLoc:t,endLoc:u}=l;return l.lastType=e,l.lastOffset=n,l.lastStartLoc=t,l.lastEndLoc=u,l.offset=c(),l.startLoc=o(),r.currentChar()===d?k(l,14):g(r,l)},currentOffset:c,currentPosition:o,context:p}}const E="parser",k=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function L(e,n,t){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const e=parseInt(n||t,16);return e<=55295||e>=57344?String.fromCodePoint(e):"�"}}}function h(n={}){const t=!1!==n.location,{onError:r}=n;function c(e,n,r){const c={type:e,start:n,end:n};return t&&(c.loc={start:r,end:r}),c}function o(e,n,r,c){e.end=n,c&&(e.type=c),t&&e.loc&&(e.loc.end=r)}function u(e,n){const t=e.context(),r=c(3,t.offset,t.startLoc);return r.value=n,o(r,e.currentOffset(),e.currentPosition()),r}function s(e,n){const t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(5,r,u);return s.index=parseInt(n,10),e.nextToken(),o(s,e.currentOffset(),e.currentPosition()),s}function i(e,n){const t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(4,r,u);return s.key=n,e.nextToken(),o(s,e.currentOffset(),e.currentPosition()),s}function a(e,n){const t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(9,r,u);return s.value=n.replace(k,L),e.nextToken(),o(s,e.currentOffset(),e.currentPosition()),s}function l(e){const n=e.context(),t=c(6,n.offset,n.startLoc);let r=e.nextToken();if(9===r.type){const n=function(e){const n=e.nextToken(),t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(8,r,u);return 12!==n.type?(s.value="",o(s,r,u),{nextConsumeToken:n,node:s}):(null==n.value&&N(n),s.value=n.value||"",o(s,e.currentOffset(),e.currentPosition()),{node:s})}(e);t.modifier=n.node,r=n.nextConsumeToken||e.nextToken()}switch(10!==r.type&&N(r),r=e.nextToken(),2===r.type&&(r=e.nextToken()),r.type){case 11:null==r.value&&N(r),t.key=function(e,n){const t=e.context(),r=c(7,t.offset,t.startLoc);return r.value=n,o(r,e.currentOffset(),e.currentPosition()),r}(e,r.value||"");break;case 5:null==r.value&&N(r),t.key=i(e,r.value||"");break;case 6:null==r.value&&N(r),t.key=s(e,r.value||"");break;case 7:null==r.value&&N(r),t.key=a(e,r.value||"");break;default:const n=e.context(),u=c(7,n.offset,n.startLoc);return u.value="",o(u,n.offset,n.startLoc),t.key=u,o(t,n.offset,n.startLoc),{nextConsumeToken:r,node:t}}return o(t,e.currentOffset(),e.currentPosition()),{node:t}}function f(e){const n=e.context(),t=c(2,1===n.currentType?e.currentOffset():n.offset,1===n.currentType?n.endLoc:n.startLoc);t.items=[];let r=null;do{const n=r||e.nextToken();switch(r=null,n.type){case 0:null==n.value&&N(n),t.items.push(u(e,n.value||""));break;case 6:null==n.value&&N(n),t.items.push(s(e,n.value||""));break;case 5:null==n.value&&N(n),t.items.push(i(e,n.value||""));break;case 7:null==n.value&&N(n),t.items.push(a(e,n.value||""));break;case 8:const c=l(e);t.items.push(c.node),r=c.nextConsumeToken||null}}while(14!==n.currentType&&1!==n.currentType);return o(t,1===n.currentType?n.lastOffset:e.currentOffset(),1===n.currentType?n.lastEndLoc:e.currentPosition()),t}function d(e){const n=e.context(),{offset:t,startLoc:r}=n,u=f(e);return 14===n.currentType?u:function(e,n,t,r){const u=e.context();let s=0===r.items.length;const i=c(1,n,t);i.cases=[],i.cases.push(r);do{const n=f(e);s||(s=0===n.items.length),i.cases.push(n)}while(14!==u.currentType);return o(i,e.currentOffset(),e.currentPosition()),i}(e,t,r,u)}return{parse:function(r){const u=p(r,e({},n)),s=u.context(),i=c(0,s.offset,s.startLoc);return t&&i.loc&&(i.loc.source=r),i.body=d(u),o(i,u.currentOffset(),u.currentPosition()),i}}}function N(e){if(14===e.type)return"EOF";const n=(e.value||"").replace(/\r?\n/gu,"\\n");return n.length>10?n.slice(0,9)+"…":n}function _(e,n){for(let t=0;t<e.length;t++)T(e[t],n)}function T(e,n){switch(e.type){case 1:_(e.cases,n),n.helper("plural");break;case 2:_(e.items,n);break;case 6:T(e.key,n),n.helper("linked");break;case 5:n.helper("interpolate"),n.helper("list");break;case 4:n.helper("interpolate"),n.helper("named")}}function C(e,n={}){const t=function(e,n={}){const t={ast:e,helpers:new Set};return{context:()=>t,helper:e=>(t.helpers.add(e),e)}}(e);t.helper("normalize"),e.body&&T(e.body,t);const r=t.context();e.helpers=Array.from(r.helpers)}function P(e,n){const{helper:t}=e;switch(n.type){case 0:!function(e,n){n.body?P(e,n.body):e.push("null")}(e,n);break;case 1:!function(e,n){const{helper:t,needIndent:r}=e;if(n.cases.length>1){e.push(`${t("plural")}([`),e.indent(r());const c=n.cases.length;for(let t=0;t<c&&(P(e,n.cases[t]),t!==c-1);t++)e.push(", ");e.deindent(r()),e.push("])")}}(e,n);break;case 2:!function(e,n){const{helper:t,needIndent:r}=e;e.push(`${t("normalize")}([`),e.indent(r());const c=n.items.length;for(let t=0;t<c&&(P(e,n.items[t]),t!==c-1);t++)e.push(", ");e.deindent(r()),e.push("])")}(e,n);break;case 6:!function(e,n){const{helper:t}=e;e.push(`${t("linked")}(`),P(e,n.key),n.modifier&&(e.push(", "),P(e,n.modifier)),e.push(")")}(e,n);break;case 8:case 7:e.push(JSON.stringify(n.value),n);break;case 5:e.push(`${t("interpolate")}(${t("list")}(${n.index}))`,n);break;case 4:e.push(`${t("interpolate")}(${t("named")}(${JSON.stringify(n.key)}))`,n);break;case 9:case 3:e.push(JSON.stringify(n.value),n)}}function x(t,r={}){const c=e({},r),o=h(c).parse(t);return C(o,c),((e,t={})=>{const r=n(t.mode)?t.mode:"normal",c=n(t.filename)?t.filename:"message.intl",o=t.needIndent?t.needIndent:"arrow"!==r,u=e.helpers||[],s=function(e,n){const{filename:t,breakLineCode:r,needIndent:c}=n,o={source:e.loc.source,filename:t,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:c,indentLevel:0};function u(e,n){o.code+=e}function s(e,n=!0){const t=n?r:"";u(c?t+" ".repeat(e):t)}return{context:()=>o,push:u,indent:function(e=!0){const n=++o.indentLevel;e&&s(n)},deindent:function(e=!0){const n=--o.indentLevel;e&&s(n)},newline:function(){s(o.indentLevel)},helper:e=>`_${e}`,needIndent:()=>o.needIndent}}(e,{mode:r,filename:c,sourceMap:!!t.sourceMap,breakLineCode:null!=t.breakLineCode?t.breakLineCode:"arrow"===r?";":"\n",needIndent:o});s.push("normal"===r?"function __msg__ (ctx) {":"(ctx) => {"),s.indent(o),u.length>0&&(s.push(`const { ${u.map((e=>`${e}: _${e}`)).join(", ")} } = ctx`),s.newline()),s.push("return "),P(s,e),s.deindent(o),s.push("}");const{code:i,map:a}=s.context();return{ast:e,code:i,map:a?a.toJSON():void 0}})(o,c)}export{t as CompileErrorCodes,E as ERROR_DOMAIN,u as LocationStub,x as baseCompile,c as createCompileError,i as createLocation,h as createParser,s as createPosition,o as defaultOnError,r as errorMessages};
/*!
* @intlify/message-compiler v9.1.6
* @intlify/message-compiler v9.2.0-alpha.1
* (c) 2021 kazuya kawaguchi

@@ -8,20 +8,42 @@ * Released under the MIT License.

const CompileErrorCodes = {
// tokenizer error codes
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,
// parser error codes
MUST_HAVE_MESSAGES_IN_PLURAL: 11,
UNEXPECTED_EMPTY_LINKED_MODIFIER: 12,
UNEXPECTED_EMPTY_LINKED_KEY: 13,
UNEXPECTED_LEXICAL_ANALYSIS: 14,
// Special value for higher-order compilers to pick up the last code
// to avoid collision of error codes. This should always be kept as the last
// item.
__EXTEND_POINT__: 15
};
/** @internal */
const errorMessages = {
// tokenizer error messages
[0 /* EXPECTED_TOKEN */]: `Expected token: '{0}'`,
[1 /* INVALID_TOKEN_IN_PLACEHOLDER */]: `Invalid token in placeholder: '{0}'`,
[2 /* UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER */]: `Unterminated single quote in placeholder`,
[3 /* UNKNOWN_ESCAPE_SEQUENCE */]: `Unknown escape sequence: \\{0}`,
[4 /* INVALID_UNICODE_ESCAPE_SEQUENCE */]: `Invalid unicode escape sequence: {0}`,
[5 /* UNBALANCED_CLOSING_BRACE */]: `Unbalanced closing brace`,
[6 /* UNTERMINATED_CLOSING_BRACE */]: `Unterminated closing brace`,
[7 /* EMPTY_PLACEHOLDER */]: `Empty placeholder`,
[8 /* NOT_ALLOW_NEST_PLACEHOLDER */]: `Not allowed nest placeholder`,
[9 /* INVALID_LINKED_FORMAT */]: `Invalid linked format`,
[CompileErrorCodes.EXPECTED_TOKEN]: `Expected token: '{0}'`,
[CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER]: `Invalid token in placeholder: '{0}'`,
[CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]: `Unterminated single quote in placeholder`,
[CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE]: `Unknown escape sequence: \\{0}`,
[CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE]: `Invalid unicode escape sequence: {0}`,
[CompileErrorCodes.UNBALANCED_CLOSING_BRACE]: `Unbalanced closing brace`,
[CompileErrorCodes.UNTERMINATED_CLOSING_BRACE]: `Unterminated closing brace`,
[CompileErrorCodes.EMPTY_PLACEHOLDER]: `Empty placeholder`,
[CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER]: `Not allowed nest placeholder`,
[CompileErrorCodes.INVALID_LINKED_FORMAT]: `Invalid linked format`,
// parser error messages
[10 /* MUST_HAVE_MESSAGES_IN_PLURAL */]: `Plural must have messages`,
[11 /* UNEXPECTED_EMPTY_LINKED_MODIFIER */]: `Unexpected empty linked modifier`,
[12 /* UNEXPECTED_EMPTY_LINKED_KEY */]: `Unexpected empty linked key`,
[13 /* UNEXPECTED_LEXICAL_ANALYSIS */]: `Unexpected lexical analysis in token: '{0}'`
[CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL]: `Plural must have messages`,
[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER]: `Unexpected empty linked modifier`,
[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY]: `Unexpected empty linked key`,
[CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS]: `Unexpected lexical analysis in token: '{0}'`
};

@@ -194,3 +216,3 @@ function createCompileError(code, loc, options = {}) {

else {
emitError(0 /* EXPECTED_TOKEN */, currentPosition(), 0, ch);
emitError(CompileErrorCodes.EXPECTED_TOKEN, currentPosition(), 0, ch);
return '';

@@ -463,3 +485,3 @@ }

if (scnr.currentChar() === EOF) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
}

@@ -479,3 +501,3 @@ return name;

if (scnr.currentChar() === EOF) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
}

@@ -500,3 +522,3 @@ return value;

if (current === CHAR_LF || current === EOF) {
emitError(2 /* UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, currentPosition(), 0);
// TODO: Is it correct really?

@@ -524,3 +546,3 @@ if (current === CHAR_LF) {

default:
emitError(3 /* UNKNOWN_ESCAPE_SEQUENCE */, currentPosition(), 0, ch);
emitError(CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE, currentPosition(), 0, ch);
return '';

@@ -535,3 +557,3 @@ }

if (!ch) {
emitError(4 /* INVALID_UNICODE_ESCAPE_SEQUENCE */, currentPosition(), 0, `\\${unicode}${sequence}${scnr.currentChar()}`);
emitError(CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE, currentPosition(), 0, `\\${unicode}${sequence}${scnr.currentChar()}`);
break;

@@ -603,3 +625,3 @@ }

if (context.braceNest >= 1) {
emitError(8 /* NOT_ALLOW_NEST_PLACEHOLDER */, currentPosition(), 0);
emitError(CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER, currentPosition(), 0);
}

@@ -614,3 +636,3 @@ scnr.next();

context.currentType === 2 /* BraceLeft */) {
emitError(7 /* EMPTY_PLACEHOLDER */, currentPosition(), 0);
emitError(CompileErrorCodes.EMPTY_PLACEHOLDER, currentPosition(), 0);
}

@@ -627,3 +649,3 @@ scnr.next();

if (context.braceNest > 0) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
}

@@ -639,3 +661,3 @@ token = readTokenInLinked(scnr, context) || getEndToken(context);

if (context.braceNest > 0) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
}

@@ -652,3 +674,3 @@ token = getToken(context, 1 /* Pipe */, readPlural(scnr));

context.currentType === 7 /* Literal */)) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
context.braceNest = 0;

@@ -675,3 +697,3 @@ return readToken(scnr, context);

token = getToken(context, 13 /* InvalidPlace */, readInvalidIdentifier(scnr));
emitError(1 /* INVALID_TOKEN_IN_PLACEHOLDER */, currentPosition(), 0, token.value);
emitError(CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER, currentPosition(), 0, token.value);
skipSpaces(scnr);

@@ -694,3 +716,3 @@ return token;

(ch === CHAR_LF || ch === CHAR_SP)) {
emitError(9 /* INVALID_LINKED_FORMAT */, currentPosition(), 0);
emitError(CompileErrorCodes.INVALID_LINKED_FORMAT, currentPosition(), 0);
}

@@ -739,3 +761,3 @@ switch (ch) {

if (currentType === 8 /* LinkedAlias */) {
emitError(9 /* INVALID_LINKED_FORMAT */, currentPosition(), 0);
emitError(CompileErrorCodes.INVALID_LINKED_FORMAT, currentPosition(), 0);
}

@@ -761,3 +783,3 @@ context.braceNest = 0;

case "}" /* BraceRight */:
emitError(5 /* UNBALANCED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNBALANCED_CLOSING_BRACE, currentPosition(), 0);
scnr.next();

@@ -904,3 +926,3 @@ return getToken(context, 3 /* BraceRight */, "}" /* BraceRight */);

// empty modifier
emitError(tokenizer, 11 /* UNEXPECTED_EMPTY_LINKED_MODIFIER */, context.lastStartLoc, 0);
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER, context.lastStartLoc, 0);
node.value = '';

@@ -915,3 +937,3 @@ endNode(node, offset, loc);

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -942,3 +964,3 @@ node.value = token.value || '';

if (token.type !== 10 /* LinkedDelimiter */) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -953,3 +975,3 @@ token = tokenizer.nextToken();

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -960,3 +982,3 @@ linkedNode.key = parseLinkedKey(tokenizer, token.value || '');

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -967,3 +989,3 @@ linkedNode.key = parseNamed(tokenizer, token.value || '');

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -974,3 +996,3 @@ linkedNode.key = parseList(tokenizer, token.value || '');

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -981,3 +1003,3 @@ linkedNode.key = parseLiteral(tokenizer, token.value || '');

// empty key
emitError(tokenizer, 12 /* UNEXPECTED_EMPTY_LINKED_KEY */, context.lastStartLoc, 0);
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY, context.lastStartLoc, 0);
const nextContext = tokenizer.context();

@@ -1016,3 +1038,3 @@ const emptyLinkedKeyNode = startNode(7 /* LinkedKey */, nextContext.offset, nextContext.startLoc);

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -1023,3 +1045,3 @@ node.items.push(parseText(tokenizer, token.value || ''));

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -1030,3 +1052,3 @@ node.items.push(parseList(tokenizer, token.value || ''));

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -1037,3 +1059,3 @@ node.items.push(parseNamed(tokenizer, token.value || ''));

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -1074,3 +1096,3 @@ node.items.push(parseLiteral(tokenizer, token.value || ''));

if (hasEmptyMessage) {
emitError(tokenizer, 10 /* MUST_HAVE_MESSAGES_IN_PLURAL */, loc, 0);
emitError(tokenizer, CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL, loc, 0);
}

@@ -1101,3 +1123,3 @@ endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());

if (context.currentType !== 14 /* EOF */) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, source[context.offset] || '');
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, source[context.offset] || '');
}

@@ -1359,2 +1381,2 @@ endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());

export { ERROR_DOMAIN, LocationStub, baseCompile, createCompileError, createLocation, createParser, createPosition, defaultOnError, errorMessages };
export { CompileErrorCodes, ERROR_DOMAIN, LocationStub, baseCompile, createCompileError, createLocation, createParser, createPosition, defaultOnError, errorMessages };
/*!
* @intlify/message-compiler v9.1.6
* @intlify/message-compiler v9.2.0-alpha.1
* (c) 2021 kazuya kawaguchi

@@ -31,20 +31,42 @@ * Released under the MIT License.

const CompileErrorCodes = {
// tokenizer error codes
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,
// parser error codes
MUST_HAVE_MESSAGES_IN_PLURAL: 11,
UNEXPECTED_EMPTY_LINKED_MODIFIER: 12,
UNEXPECTED_EMPTY_LINKED_KEY: 13,
UNEXPECTED_LEXICAL_ANALYSIS: 14,
// Special value for higher-order compilers to pick up the last code
// to avoid collision of error codes. This should always be kept as the last
// item.
__EXTEND_POINT__: 15
};
/** @internal */
const errorMessages = {
// tokenizer error messages
[0 /* EXPECTED_TOKEN */]: `Expected token: '{0}'`,
[1 /* INVALID_TOKEN_IN_PLACEHOLDER */]: `Invalid token in placeholder: '{0}'`,
[2 /* UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER */]: `Unterminated single quote in placeholder`,
[3 /* UNKNOWN_ESCAPE_SEQUENCE */]: `Unknown escape sequence: \\{0}`,
[4 /* INVALID_UNICODE_ESCAPE_SEQUENCE */]: `Invalid unicode escape sequence: {0}`,
[5 /* UNBALANCED_CLOSING_BRACE */]: `Unbalanced closing brace`,
[6 /* UNTERMINATED_CLOSING_BRACE */]: `Unterminated closing brace`,
[7 /* EMPTY_PLACEHOLDER */]: `Empty placeholder`,
[8 /* NOT_ALLOW_NEST_PLACEHOLDER */]: `Not allowed nest placeholder`,
[9 /* INVALID_LINKED_FORMAT */]: `Invalid linked format`,
[CompileErrorCodes.EXPECTED_TOKEN]: `Expected token: '{0}'`,
[CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER]: `Invalid token in placeholder: '{0}'`,
[CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]: `Unterminated single quote in placeholder`,
[CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE]: `Unknown escape sequence: \\{0}`,
[CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE]: `Invalid unicode escape sequence: {0}`,
[CompileErrorCodes.UNBALANCED_CLOSING_BRACE]: `Unbalanced closing brace`,
[CompileErrorCodes.UNTERMINATED_CLOSING_BRACE]: `Unterminated closing brace`,
[CompileErrorCodes.EMPTY_PLACEHOLDER]: `Empty placeholder`,
[CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER]: `Not allowed nest placeholder`,
[CompileErrorCodes.INVALID_LINKED_FORMAT]: `Invalid linked format`,
// parser error messages
[10 /* MUST_HAVE_MESSAGES_IN_PLURAL */]: `Plural must have messages`,
[11 /* UNEXPECTED_EMPTY_LINKED_MODIFIER */]: `Unexpected empty linked modifier`,
[12 /* UNEXPECTED_EMPTY_LINKED_KEY */]: `Unexpected empty linked key`,
[13 /* UNEXPECTED_LEXICAL_ANALYSIS */]: `Unexpected lexical analysis in token: '{0}'`
[CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL]: `Plural must have messages`,
[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER]: `Unexpected empty linked modifier`,
[CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY]: `Unexpected empty linked key`,
[CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS]: `Unexpected lexical analysis in token: '{0}'`
};

@@ -216,3 +238,3 @@ function createCompileError(code, loc, options = {}) {

else {
emitError(0 /* EXPECTED_TOKEN */, currentPosition(), 0, ch);
emitError(CompileErrorCodes.EXPECTED_TOKEN, currentPosition(), 0, ch);
return '';

@@ -485,3 +507,3 @@ }

if (scnr.currentChar() === EOF) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
}

@@ -501,3 +523,3 @@ return name;

if (scnr.currentChar() === EOF) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
}

@@ -522,3 +544,3 @@ return value;

if (current === CHAR_LF || current === EOF) {
emitError(2 /* UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, currentPosition(), 0);
// TODO: Is it correct really?

@@ -546,3 +568,3 @@ if (current === CHAR_LF) {

default:
emitError(3 /* UNKNOWN_ESCAPE_SEQUENCE */, currentPosition(), 0, ch);
emitError(CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE, currentPosition(), 0, ch);
return '';

@@ -557,3 +579,3 @@ }

if (!ch) {
emitError(4 /* INVALID_UNICODE_ESCAPE_SEQUENCE */, currentPosition(), 0, `\\${unicode}${sequence}${scnr.currentChar()}`);
emitError(CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE, currentPosition(), 0, `\\${unicode}${sequence}${scnr.currentChar()}`);
break;

@@ -625,3 +647,3 @@ }

if (context.braceNest >= 1) {
emitError(8 /* NOT_ALLOW_NEST_PLACEHOLDER */, currentPosition(), 0);
emitError(CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER, currentPosition(), 0);
}

@@ -636,3 +658,3 @@ scnr.next();

context.currentType === 2 /* BraceLeft */) {
emitError(7 /* EMPTY_PLACEHOLDER */, currentPosition(), 0);
emitError(CompileErrorCodes.EMPTY_PLACEHOLDER, currentPosition(), 0);
}

@@ -649,3 +671,3 @@ scnr.next();

if (context.braceNest > 0) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
}

@@ -661,3 +683,3 @@ token = readTokenInLinked(scnr, context) || getEndToken(context);

if (context.braceNest > 0) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
}

@@ -674,3 +696,3 @@ token = getToken(context, 1 /* Pipe */, readPlural(scnr));

context.currentType === 7 /* Literal */)) {
emitError(6 /* UNTERMINATED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0);
context.braceNest = 0;

@@ -697,3 +719,3 @@ return readToken(scnr, context);

token = getToken(context, 13 /* InvalidPlace */, readInvalidIdentifier(scnr));
emitError(1 /* INVALID_TOKEN_IN_PLACEHOLDER */, currentPosition(), 0, token.value);
emitError(CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER, currentPosition(), 0, token.value);
skipSpaces(scnr);

@@ -716,3 +738,3 @@ return token;

(ch === CHAR_LF || ch === CHAR_SP)) {
emitError(9 /* INVALID_LINKED_FORMAT */, currentPosition(), 0);
emitError(CompileErrorCodes.INVALID_LINKED_FORMAT, currentPosition(), 0);
}

@@ -761,3 +783,3 @@ switch (ch) {

if (currentType === 8 /* LinkedAlias */) {
emitError(9 /* INVALID_LINKED_FORMAT */, currentPosition(), 0);
emitError(CompileErrorCodes.INVALID_LINKED_FORMAT, currentPosition(), 0);
}

@@ -783,3 +805,3 @@ context.braceNest = 0;

case "}" /* BraceRight */:
emitError(5 /* UNBALANCED_CLOSING_BRACE */, currentPosition(), 0);
emitError(CompileErrorCodes.UNBALANCED_CLOSING_BRACE, currentPosition(), 0);
scnr.next();

@@ -926,3 +948,3 @@ return getToken(context, 3 /* BraceRight */, "}" /* BraceRight */);

// empty modifier
emitError(tokenizer, 11 /* UNEXPECTED_EMPTY_LINKED_MODIFIER */, context.lastStartLoc, 0);
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER, context.lastStartLoc, 0);
node.value = '';

@@ -937,3 +959,3 @@ endNode(node, offset, loc);

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -964,3 +986,3 @@ node.value = token.value || '';

if (token.type !== 10 /* LinkedDelimiter */) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -975,3 +997,3 @@ token = tokenizer.nextToken();

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -982,3 +1004,3 @@ linkedNode.key = parseLinkedKey(tokenizer, token.value || '');

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -989,3 +1011,3 @@ linkedNode.key = parseNamed(tokenizer, token.value || '');

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -996,3 +1018,3 @@ linkedNode.key = parseList(tokenizer, token.value || '');

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -1003,3 +1025,3 @@ linkedNode.key = parseLiteral(tokenizer, token.value || '');

// empty key
emitError(tokenizer, 12 /* UNEXPECTED_EMPTY_LINKED_KEY */, context.lastStartLoc, 0);
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY, context.lastStartLoc, 0);
const nextContext = tokenizer.context();

@@ -1038,3 +1060,3 @@ const emptyLinkedKeyNode = startNode(7 /* LinkedKey */, nextContext.offset, nextContext.startLoc);

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -1045,3 +1067,3 @@ node.items.push(parseText(tokenizer, token.value || ''));

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -1052,3 +1074,3 @@ node.items.push(parseList(tokenizer, token.value || ''));

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -1059,3 +1081,3 @@ node.items.push(parseNamed(tokenizer, token.value || ''));

if (token.value == null) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, getTokenCaption(token));
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token));
}

@@ -1096,3 +1118,3 @@ node.items.push(parseLiteral(tokenizer, token.value || ''));

if (hasEmptyMessage) {
emitError(tokenizer, 10 /* MUST_HAVE_MESSAGES_IN_PLURAL */, loc, 0);
emitError(tokenizer, CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL, loc, 0);
}

@@ -1123,3 +1145,3 @@ endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());

if (context.currentType !== 14 /* EOF */) {
emitError(tokenizer, 13 /* UNEXPECTED_LEXICAL_ANALYSIS */, context.lastStartLoc, 0, source[context.offset] || '');
emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, source[context.offset] || '');
}

@@ -1381,2 +1403,3 @@ endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());

exports.CompileErrorCodes = CompileErrorCodes;
exports.ERROR_DOMAIN = ERROR_DOMAIN;

@@ -1383,0 +1406,0 @@ exports.LocationStub = LocationStub;

/*!
* @intlify/message-compiler v9.1.6
* @intlify/message-compiler v9.2.0-alpha.1
* (c) 2021 kazuya kawaguchi
* Released under the MIT License.
*/
var IntlifyMessageCompiler=function(e){"use strict";const n=Object.assign,t=e=>"string"==typeof e,r={0:"Expected token: '{0}'",1:"Invalid token in placeholder: '{0}'",2:"Unterminated single quote in placeholder",3:"Unknown escape sequence: \\{0}",4:"Invalid unicode escape sequence: {0}",5:"Unbalanced closing brace",6:"Unterminated closing brace",7:"Empty placeholder",8:"Not allowed nest placeholder",9:"Invalid linked format",10:"Plural must have messages",11:"Unexpected empty linked modifier",12:"Unexpected empty linked key",13:"Unexpected lexical analysis in token: '{0}'"};function c(e,n,t={}){const{domain:r}=t,c=new SyntaxError(String(e));return c.code=e,n&&(c.location=n),c.domain=r,c}function o(e,n,t){return{line:e,column:n,offset:t}}function u(e,n,t){const r={start:e,end:n};return null!=t&&(r.source=t),r}const s=" ",i="\n",a=String.fromCharCode(8232),l=String.fromCharCode(8233);function f(e){const n=e;let t=0,r=1,c=1,o=0;const u=e=>"\r"===n[e]&&n[e+1]===i,s=e=>n[e]===l,f=e=>n[e]===a,d=e=>u(e)||(e=>n[e]===i)(e)||s(e)||f(e),p=e=>u(e)||s(e)||f(e)?i:n[e];function k(){return o=0,d(t)&&(r++,c=0),u(t)&&t++,t++,c++,n[t]}return{index:()=>t,line:()=>r,column:()=>c,peekOffset:()=>o,charAt:p,currentChar:()=>p(t),currentPeek:()=>p(t+o),next:k,peek:function(){return u(t+o)&&o++,o++,n[t+o]},reset:function(){t=0,r=1,c=1,o=0},resetPeek:function(e=0){o=e},skipToPeek:function(){const e=t+o;for(;e!==t;)k();o=0}}}const d=void 0;function p(e,n={}){const t=!1!==n.location,r=f(e),c=()=>r.index(),a=()=>o(r.line(),r.column(),r.index()),l=a(),p=c(),k={currentType:14,offset:p,startLoc:l,endLoc:l,lastType:14,lastOffset:p,lastStartLoc:l,lastEndLoc:l,braceNest:0,inLinked:!1,text:""},h=()=>k,{onError:x}=n;function y(e,n,r){e.endLoc=a(),e.currentType=n;const c={type:n};return t&&(c.loc=u(e.startLoc,e.endLoc)),null!=r&&(c.value=r),c}const m=e=>y(e,14);function b(e,n){return e.currentChar()===n?(e.next(),n):(a(),"")}function L(e){let n="";for(;e.currentPeek()===s||e.currentPeek()===i;)n+=e.currentPeek(),e.peek();return n}function P(e){const n=L(e);return e.skipToPeek(),n}function v(e){if(e===d)return!1;const n=e.charCodeAt(0);return n>=97&&n<=122||n>=65&&n<=90||95===n}function T(e,n){const{currentType:t}=n;if(2!==t)return!1;L(e);const r=function(e){if(e===d)return!1;const n=e.charCodeAt(0);return n>=48&&n<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),r}function C(e){L(e);const n="|"===e.currentPeek();return e.resetPeek(),n}function O(e,n=!0){const t=(n=!1,r="",c=!1)=>{const o=e.currentPeek();return"{"===o?"%"!==r&&n:"@"!==o&&o?"%"===o?(e.peek(),t(n,"%",!0)):"|"===o?!("%"!==r&&!c)||!(r===s||r===i):o===s?(e.peek(),t(!0,s,c)):o!==i||(e.peek(),t(!0,i,c)):"%"===r||n},r=t();return n&&e.resetPeek(),r}function g(e,n){const t=e.currentChar();return t===d?d:n(t)?(e.next(),t):null}function N(e){return g(e,(e=>{const n=e.charCodeAt(0);return n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57||95===n||36===n}))}function w(e){return g(e,(e=>{const n=e.charCodeAt(0);return n>=48&&n<=57}))}function S(e){return g(e,(e=>{const n=e.charCodeAt(0);return n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102}))}function $(e){let n="",t="";for(;n=w(e);)t+=n;return t}function I(e){const n=e.currentChar();switch(n){case"\\":case"'":return e.next(),`\\${n}`;case"u":return E(e,n,4);case"U":return E(e,n,6);default:return a(),""}}function E(e,n,t){b(e,n);let r="";for(let n=0;n<t;n++){const n=S(e);if(!n){a(),e.currentChar();break}r+=n}return`\\${n}${r}`}function A(e){P(e);const n=b(e,"|");return P(e),n}function U(e,n){let t=null;switch(e.currentChar()){case"{":return n.braceNest>=1&&a(),e.next(),t=y(n,2,"{"),P(e),n.braceNest++,t;case"}":return n.braceNest>0&&2===n.currentType&&a(),e.next(),t=y(n,3,"}"),n.braceNest--,n.braceNest>0&&P(e),n.inLinked&&0===n.braceNest&&(n.inLinked=!1),t;case"@":return n.braceNest>0&&a(),t=_(e,n)||m(n),n.braceNest=0,t;default:let r=!0,c=!0,o=!0;if(C(e))return n.braceNest>0&&a(),t=y(n,1,A(e)),n.braceNest=0,n.inLinked=!1,t;if(n.braceNest>0&&(5===n.currentType||6===n.currentType||7===n.currentType))return a(),n.braceNest=0,M(e,n);if(r=function(e,n){const{currentType:t}=n;if(2!==t)return!1;L(e);const r=v(e.currentPeek());return e.resetPeek(),r}(e,n))return t=y(n,5,function(e){P(e);let n="",t="";for(;n=N(e);)t+=n;return e.currentChar()===d&&a(),t}(e)),P(e),t;if(c=T(e,n))return t=y(n,6,function(e){P(e);let n="";return"-"===e.currentChar()?(e.next(),n+=`-${$(e)}`):n+=$(e),e.currentChar()===d&&a(),n}(e)),P(e),t;if(o=function(e,n){const{currentType:t}=n;if(2!==t)return!1;L(e);const r="'"===e.currentPeek();return e.resetPeek(),r}(e,n))return t=y(n,7,function(e){P(e),b(e,"'");let n="",t="";const r=e=>"'"!==e&&e!==i;for(;n=g(e,r);)t+="\\"===n?I(e):n;const c=e.currentChar();return c===i||c===d?(a(),c===i&&(e.next(),b(e,"'")),t):(b(e,"'"),t)}(e)),P(e),t;if(!r&&!c&&!o)return t=y(n,13,function(e){P(e);let n="",t="";const r=e=>"{"!==e&&"}"!==e&&e!==s&&e!==i;for(;n=g(e,r);)t+=n;return t}(e)),a(),P(e),t}return t}function _(e,n){const{currentType:t}=n;let r=null;const c=e.currentChar();switch(8!==t&&9!==t&&12!==t&&10!==t||c!==i&&c!==s||a(),c){case"@":return e.next(),r=y(n,8,"@"),n.inLinked=!0,r;case".":return P(e),e.next(),y(n,9,".");case":":return P(e),e.next(),y(n,10,":");default:return C(e)?(r=y(n,1,A(e)),n.braceNest=0,n.inLinked=!1,r):function(e,n){const{currentType:t}=n;if(8!==t)return!1;L(e);const r="."===e.currentPeek();return e.resetPeek(),r}(e,n)||function(e,n){const{currentType:t}=n;if(8!==t&&12!==t)return!1;L(e);const r=":"===e.currentPeek();return e.resetPeek(),r}(e,n)?(P(e),_(e,n)):function(e,n){const{currentType:t}=n;if(9!==t)return!1;L(e);const r=v(e.currentPeek());return e.resetPeek(),r}(e,n)?(P(e),y(n,12,function(e){let n="",t="";for(;n=N(e);)t+=n;return t}(e))):function(e,n){const{currentType:t}=n;if(10!==t)return!1;const r=()=>{const n=e.currentPeek();return"{"===n?v(e.peek()):!("@"===n||"%"===n||"|"===n||":"===n||"."===n||n===s||!n)&&(n===i?(e.peek(),r()):v(n))},c=r();return e.resetPeek(),c}(e,n)?(P(e),"{"===c?U(e,n)||r:y(n,11,function(e){const n=(t=!1,r)=>{const c=e.currentChar();return"{"!==c&&"%"!==c&&"@"!==c&&"|"!==c&&c?c===s?r:c===i?(r+=c,e.next(),n(t,r)):(r+=c,e.next(),n(!0,r)):r};return n(!1,"")}(e))):(8===t&&a(),n.braceNest=0,n.inLinked=!1,M(e,n))}}function M(e,n){let t={type:14};if(n.braceNest>0)return U(e,n)||m(n);if(n.inLinked)return _(e,n)||m(n);const r=e.currentChar();switch(r){case"{":return U(e,n)||m(n);case"}":return a(),e.next(),y(n,3,"}");case"@":return _(e,n)||m(n);default:if(C(e))return t=y(n,1,A(e)),n.braceNest=0,n.inLinked=!1,t;if(O(e))return y(n,0,function(e){const n=t=>{const r=e.currentChar();return"{"!==r&&"}"!==r&&"@"!==r&&r?"%"===r?O(e)?(t+=r,e.next(),n(t)):t:"|"===r?t:r===s||r===i?O(e)?(t+=r,e.next(),n(t)):C(e)?t:(t+=r,e.next(),n(t)):(t+=r,e.next(),n(t)):t};return n("")}(e));if("%"===r)return e.next(),y(n,4,"%")}return t}return{nextToken:function(){const{currentType:e,offset:n,startLoc:t,endLoc:o}=k;return k.lastType=e,k.lastOffset=n,k.lastStartLoc=t,k.lastEndLoc=o,k.offset=c(),k.startLoc=a(),r.currentChar()===d?y(k,14):M(r,k)},currentOffset:c,currentPosition:a,context:h}}const k="parser",h=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function x(e,n,t){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const e=parseInt(n||t,16);return e<=55295||e>=57344?String.fromCodePoint(e):"�"}}}function y(e={}){const t=!1!==e.location,{onError:r}=e;function c(e,n,r){const c={type:e,start:n,end:n};return t&&(c.loc={start:r,end:r}),c}function o(e,n,r,c){e.end=n,c&&(e.type=c),t&&e.loc&&(e.loc.end=r)}function u(e,n){const t=e.context(),r=c(3,t.offset,t.startLoc);return r.value=n,o(r,e.currentOffset(),e.currentPosition()),r}function s(e,n){const t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(5,r,u);return s.index=parseInt(n,10),e.nextToken(),o(s,e.currentOffset(),e.currentPosition()),s}function i(e,n){const t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(4,r,u);return s.key=n,e.nextToken(),o(s,e.currentOffset(),e.currentPosition()),s}function a(e,n){const t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(9,r,u);return s.value=n.replace(h,x),e.nextToken(),o(s,e.currentOffset(),e.currentPosition()),s}function l(e){const n=e.context(),t=c(6,n.offset,n.startLoc);let r=e.nextToken();if(9===r.type){const n=function(e){const n=e.nextToken(),t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(8,r,u);return 12!==n.type?(s.value="",o(s,r,u),{nextConsumeToken:n,node:s}):(null==n.value&&m(n),s.value=n.value||"",o(s,e.currentOffset(),e.currentPosition()),{node:s})}(e);t.modifier=n.node,r=n.nextConsumeToken||e.nextToken()}switch(10!==r.type&&m(r),r=e.nextToken(),2===r.type&&(r=e.nextToken()),r.type){case 11:null==r.value&&m(r),t.key=function(e,n){const t=e.context(),r=c(7,t.offset,t.startLoc);return r.value=n,o(r,e.currentOffset(),e.currentPosition()),r}(e,r.value||"");break;case 5:null==r.value&&m(r),t.key=i(e,r.value||"");break;case 6:null==r.value&&m(r),t.key=s(e,r.value||"");break;case 7:null==r.value&&m(r),t.key=a(e,r.value||"");break;default:const n=e.context(),u=c(7,n.offset,n.startLoc);return u.value="",o(u,n.offset,n.startLoc),t.key=u,o(t,n.offset,n.startLoc),{nextConsumeToken:r,node:t}}return o(t,e.currentOffset(),e.currentPosition()),{node:t}}function f(e){const n=e.context(),t=c(2,1===n.currentType?e.currentOffset():n.offset,1===n.currentType?n.endLoc:n.startLoc);t.items=[];let r=null;do{const n=r||e.nextToken();switch(r=null,n.type){case 0:null==n.value&&m(n),t.items.push(u(e,n.value||""));break;case 6:null==n.value&&m(n),t.items.push(s(e,n.value||""));break;case 5:null==n.value&&m(n),t.items.push(i(e,n.value||""));break;case 7:null==n.value&&m(n),t.items.push(a(e,n.value||""));break;case 8:const c=l(e);t.items.push(c.node),r=c.nextConsumeToken||null}}while(14!==n.currentType&&1!==n.currentType);return o(t,1===n.currentType?n.lastOffset:e.currentOffset(),1===n.currentType?n.lastEndLoc:e.currentPosition()),t}function d(e){const n=e.context(),{offset:t,startLoc:r}=n,u=f(e);return 14===n.currentType?u:function(e,n,t,r){const u=e.context();let s=0===r.items.length;const i=c(1,n,t);i.cases=[],i.cases.push(r);do{const n=f(e);s||(s=0===n.items.length),i.cases.push(n)}while(14!==u.currentType);return o(i,e.currentOffset(),e.currentPosition()),i}(e,t,r,u)}return{parse:function(r){const u=p(r,n({},e)),s=u.context(),i=c(0,s.offset,s.startLoc);return t&&i.loc&&(i.loc.source=r),i.body=d(u),o(i,u.currentOffset(),u.currentPosition()),i}}}function m(e){if(14===e.type)return"EOF";const n=(e.value||"").replace(/\r?\n/gu,"\\n");return n.length>10?n.slice(0,9)+"…":n}function b(e,n){for(let t=0;t<e.length;t++)L(e[t],n)}function L(e,n){switch(e.type){case 1:b(e.cases,n),n.helper("plural");break;case 2:b(e.items,n);break;case 6:L(e.key,n),n.helper("linked");break;case 5:n.helper("interpolate"),n.helper("list");break;case 4:n.helper("interpolate"),n.helper("named")}}function P(e,n={}){const t=function(e,n={}){const t={ast:e,helpers:new Set};return{context:()=>t,helper:e=>(t.helpers.add(e),e)}}(e);t.helper("normalize"),e.body&&L(e.body,t);const r=t.context();e.helpers=Array.from(r.helpers)}function v(e,n){const{helper:t}=e;switch(n.type){case 0:!function(e,n){n.body?v(e,n.body):e.push("null")}(e,n);break;case 1:!function(e,n){const{helper:t,needIndent:r}=e;if(n.cases.length>1){e.push(`${t("plural")}([`),e.indent(r());const c=n.cases.length;for(let t=0;t<c&&(v(e,n.cases[t]),t!==c-1);t++)e.push(", ");e.deindent(r()),e.push("])")}}(e,n);break;case 2:!function(e,n){const{helper:t,needIndent:r}=e;e.push(`${t("normalize")}([`),e.indent(r());const c=n.items.length;for(let t=0;t<c&&(v(e,n.items[t]),t!==c-1);t++)e.push(", ");e.deindent(r()),e.push("])")}(e,n);break;case 6:!function(e,n){const{helper:t}=e;e.push(`${t("linked")}(`),v(e,n.key),n.modifier&&(e.push(", "),v(e,n.modifier)),e.push(")")}(e,n);break;case 8:case 7:e.push(JSON.stringify(n.value),n);break;case 5:e.push(`${t("interpolate")}(${t("list")}(${n.index}))`,n);break;case 4:e.push(`${t("interpolate")}(${t("named")}(${JSON.stringify(n.key)}))`,n);break;case 9:case 3:e.push(JSON.stringify(n.value),n)}}return e.ERROR_DOMAIN=k,e.LocationStub={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0}},e.baseCompile=function(e,r={}){const c=n({},r),o=y(c).parse(e);return P(o,c),((e,n={})=>{const r=t(n.mode)?n.mode:"normal",c=t(n.filename)?n.filename:"message.intl",o=n.needIndent?n.needIndent:"arrow"!==r,u=e.helpers||[],s=function(e,n){const{filename:t,breakLineCode:r,needIndent:c}=n,o={source:e.loc.source,filename:t,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:c,indentLevel:0};function u(e,n){o.code+=e}function s(e,n=!0){const t=n?r:"";u(c?t+" ".repeat(e):t)}return{context:()=>o,push:u,indent:function(e=!0){const n=++o.indentLevel;e&&s(n)},deindent:function(e=!0){const n=--o.indentLevel;e&&s(n)},newline:function(){s(o.indentLevel)},helper:e=>`_${e}`,needIndent:()=>o.needIndent}}(e,{mode:r,filename:c,sourceMap:!!n.sourceMap,breakLineCode:null!=n.breakLineCode?n.breakLineCode:"arrow"===r?";":"\n",needIndent:o});s.push("normal"===r?"function __msg__ (ctx) {":"(ctx) => {"),s.indent(o),u.length>0&&(s.push(`const { ${u.map((e=>`${e}: _${e}`)).join(", ")} } = ctx`),s.newline()),s.push("return "),v(s,e),s.deindent(o),s.push("}");const{code:i,map:a}=s.context();return{ast:e,code:i,map:a?a.toJSON():void 0}})(o,c)},e.createCompileError=c,e.createLocation=u,e.createParser=y,e.createPosition=o,e.defaultOnError=function(e){throw e},e.errorMessages=r,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
var IntlifyMessageCompiler=function(e){"use strict";const n=Object.assign,t=e=>"string"==typeof e,r={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},c={[r.EXPECTED_TOKEN]:"Expected token: '{0}'",[r.INVALID_TOKEN_IN_PLACEHOLDER]:"Invalid token in placeholder: '{0}'",[r.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]:"Unterminated single quote in placeholder",[r.UNKNOWN_ESCAPE_SEQUENCE]:"Unknown escape sequence: \\{0}",[r.INVALID_UNICODE_ESCAPE_SEQUENCE]:"Invalid unicode escape sequence: {0}",[r.UNBALANCED_CLOSING_BRACE]:"Unbalanced closing brace",[r.UNTERMINATED_CLOSING_BRACE]:"Unterminated closing brace",[r.EMPTY_PLACEHOLDER]:"Empty placeholder",[r.NOT_ALLOW_NEST_PLACEHOLDER]:"Not allowed nest placeholder",[r.INVALID_LINKED_FORMAT]:"Invalid linked format",[r.MUST_HAVE_MESSAGES_IN_PLURAL]:"Plural must have messages",[r.UNEXPECTED_EMPTY_LINKED_MODIFIER]:"Unexpected empty linked modifier",[r.UNEXPECTED_EMPTY_LINKED_KEY]:"Unexpected empty linked key",[r.UNEXPECTED_LEXICAL_ANALYSIS]:"Unexpected lexical analysis in token: '{0}'"};function o(e,n,t={}){const{domain:r}=t,c=new SyntaxError(String(e));return c.code=e,n&&(c.location=n),c.domain=r,c}function u(e,n,t){return{line:e,column:n,offset:t}}function s(e,n,t){const r={start:e,end:n};return null!=t&&(r.source=t),r}const i=" ",a="\n",l=String.fromCharCode(8232),f=String.fromCharCode(8233);function d(e){const n=e;let t=0,r=1,c=1,o=0;const u=e=>"\r"===n[e]&&n[e+1]===a,s=e=>n[e]===f,i=e=>n[e]===l,d=e=>u(e)||(e=>n[e]===a)(e)||s(e)||i(e),p=e=>u(e)||s(e)||i(e)?a:n[e];function E(){return o=0,d(t)&&(r++,c=0),u(t)&&t++,t++,c++,n[t]}return{index:()=>t,line:()=>r,column:()=>c,peekOffset:()=>o,charAt:p,currentChar:()=>p(t),currentPeek:()=>p(t+o),next:E,peek:function(){return u(t+o)&&o++,o++,n[t+o]},reset:function(){t=0,r=1,c=1,o=0},resetPeek:function(e=0){o=e},skipToPeek:function(){const e=t+o;for(;e!==t;)E();o=0}}}const p=void 0;function E(e,n={}){const t=!1!==n.location,r=d(e),c=()=>r.index(),o=()=>u(r.line(),r.column(),r.index()),l=o(),f=c(),E={currentType:14,offset:f,startLoc:l,endLoc:l,lastType:14,lastOffset:f,lastStartLoc:l,lastEndLoc:l,braceNest:0,inLinked:!1,text:""},k=()=>E,{onError:L}=n;function h(e,n,r){e.endLoc=o(),e.currentType=n;const c={type:n};return t&&(c.loc=s(e.startLoc,e.endLoc)),null!=r&&(c.value=r),c}const N=e=>h(e,14);function _(e,n){return e.currentChar()===n?(e.next(),n):(o(),"")}function T(e){let n="";for(;e.currentPeek()===i||e.currentPeek()===a;)n+=e.currentPeek(),e.peek();return n}function C(e){const n=T(e);return e.skipToPeek(),n}function P(e){if(e===p)return!1;const n=e.charCodeAt(0);return n>=97&&n<=122||n>=65&&n<=90||95===n}function x(e,n){const{currentType:t}=n;if(2!==t)return!1;T(e);const r=function(e){if(e===p)return!1;const n=e.charCodeAt(0);return n>=48&&n<=57}("-"===e.currentPeek()?e.peek():e.currentPeek());return e.resetPeek(),r}function y(e){T(e);const n="|"===e.currentPeek();return e.resetPeek(),n}function m(e,n=!0){const t=(n=!1,r="",c=!1)=>{const o=e.currentPeek();return"{"===o?"%"!==r&&n:"@"!==o&&o?"%"===o?(e.peek(),t(n,"%",!0)):"|"===o?!("%"!==r&&!c)||!(r===i||r===a):o===i?(e.peek(),t(!0,i,c)):o!==a||(e.peek(),t(!0,a,c)):"%"===r||n},r=t();return n&&e.resetPeek(),r}function I(e,n){const t=e.currentChar();return t===p?p:n(t)?(e.next(),t):null}function O(e){return I(e,(e=>{const n=e.charCodeAt(0);return n>=97&&n<=122||n>=65&&n<=90||n>=48&&n<=57||95===n||36===n}))}function A(e){return I(e,(e=>{const n=e.charCodeAt(0);return n>=48&&n<=57}))}function b(e){return I(e,(e=>{const n=e.charCodeAt(0);return n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102}))}function S(e){let n="",t="";for(;n=A(e);)t+=n;return t}function v(e){const n=e.currentChar();switch(n){case"\\":case"'":return e.next(),`\\${n}`;case"u":return D(e,n,4);case"U":return D(e,n,6);default:return o(),""}}function D(e,n,t){_(e,n);let r="";for(let n=0;n<t;n++){const n=b(e);if(!n){o(),e.currentChar();break}r+=n}return`\\${n}${r}`}function U(e){C(e);const n=_(e,"|");return C(e),n}function g(e,n){let t=null;switch(e.currentChar()){case"{":return n.braceNest>=1&&o(),e.next(),t=h(n,2,"{"),C(e),n.braceNest++,t;case"}":return n.braceNest>0&&2===n.currentType&&o(),e.next(),t=h(n,3,"}"),n.braceNest--,n.braceNest>0&&C(e),n.inLinked&&0===n.braceNest&&(n.inLinked=!1),t;case"@":return n.braceNest>0&&o(),t=R(e,n)||N(n),n.braceNest=0,t;default:let r=!0,c=!0,u=!0;if(y(e))return n.braceNest>0&&o(),t=h(n,1,U(e)),n.braceNest=0,n.inLinked=!1,t;if(n.braceNest>0&&(5===n.currentType||6===n.currentType||7===n.currentType))return o(),n.braceNest=0,M(e,n);if(r=function(e,n){const{currentType:t}=n;if(2!==t)return!1;T(e);const r=P(e.currentPeek());return e.resetPeek(),r}(e,n))return t=h(n,5,function(e){C(e);let n="",t="";for(;n=O(e);)t+=n;return e.currentChar()===p&&o(),t}(e)),C(e),t;if(c=x(e,n))return t=h(n,6,function(e){C(e);let n="";return"-"===e.currentChar()?(e.next(),n+=`-${S(e)}`):n+=S(e),e.currentChar()===p&&o(),n}(e)),C(e),t;if(u=function(e,n){const{currentType:t}=n;if(2!==t)return!1;T(e);const r="'"===e.currentPeek();return e.resetPeek(),r}(e,n))return t=h(n,7,function(e){C(e),_(e,"'");let n="",t="";const r=e=>"'"!==e&&e!==a;for(;n=I(e,r);)t+="\\"===n?v(e):n;const c=e.currentChar();return c===a||c===p?(o(),c===a&&(e.next(),_(e,"'")),t):(_(e,"'"),t)}(e)),C(e),t;if(!r&&!c&&!u)return t=h(n,13,function(e){C(e);let n="",t="";const r=e=>"{"!==e&&"}"!==e&&e!==i&&e!==a;for(;n=I(e,r);)t+=n;return t}(e)),o(),C(e),t}return t}function R(e,n){const{currentType:t}=n;let r=null;const c=e.currentChar();switch(8!==t&&9!==t&&12!==t&&10!==t||c!==a&&c!==i||o(),c){case"@":return e.next(),r=h(n,8,"@"),n.inLinked=!0,r;case".":return C(e),e.next(),h(n,9,".");case":":return C(e),e.next(),h(n,10,":");default:return y(e)?(r=h(n,1,U(e)),n.braceNest=0,n.inLinked=!1,r):function(e,n){const{currentType:t}=n;if(8!==t)return!1;T(e);const r="."===e.currentPeek();return e.resetPeek(),r}(e,n)||function(e,n){const{currentType:t}=n;if(8!==t&&12!==t)return!1;T(e);const r=":"===e.currentPeek();return e.resetPeek(),r}(e,n)?(C(e),R(e,n)):function(e,n){const{currentType:t}=n;if(9!==t)return!1;T(e);const r=P(e.currentPeek());return e.resetPeek(),r}(e,n)?(C(e),h(n,12,function(e){let n="",t="";for(;n=O(e);)t+=n;return t}(e))):function(e,n){const{currentType:t}=n;if(10!==t)return!1;const r=()=>{const n=e.currentPeek();return"{"===n?P(e.peek()):!("@"===n||"%"===n||"|"===n||":"===n||"."===n||n===i||!n)&&(n===a?(e.peek(),r()):P(n))},c=r();return e.resetPeek(),c}(e,n)?(C(e),"{"===c?g(e,n)||r:h(n,11,function(e){const n=(t=!1,r)=>{const c=e.currentChar();return"{"!==c&&"%"!==c&&"@"!==c&&"|"!==c&&c?c===i?r:c===a?(r+=c,e.next(),n(t,r)):(r+=c,e.next(),n(!0,r)):r};return n(!1,"")}(e))):(8===t&&o(),n.braceNest=0,n.inLinked=!1,M(e,n))}}function M(e,n){let t={type:14};if(n.braceNest>0)return g(e,n)||N(n);if(n.inLinked)return R(e,n)||N(n);const r=e.currentChar();switch(r){case"{":return g(e,n)||N(n);case"}":return o(),e.next(),h(n,3,"}");case"@":return R(e,n)||N(n);default:if(y(e))return t=h(n,1,U(e)),n.braceNest=0,n.inLinked=!1,t;if(m(e))return h(n,0,function(e){const n=t=>{const r=e.currentChar();return"{"!==r&&"}"!==r&&"@"!==r&&r?"%"===r?m(e)?(t+=r,e.next(),n(t)):t:"|"===r?t:r===i||r===a?m(e)?(t+=r,e.next(),n(t)):y(e)?t:(t+=r,e.next(),n(t)):(t+=r,e.next(),n(t)):t};return n("")}(e));if("%"===r)return e.next(),h(n,4,"%")}return t}return{nextToken:function(){const{currentType:e,offset:n,startLoc:t,endLoc:u}=E;return E.lastType=e,E.lastOffset=n,E.lastStartLoc=t,E.lastEndLoc=u,E.offset=c(),E.startLoc=o(),r.currentChar()===p?h(E,14):M(r,E)},currentOffset:c,currentPosition:o,context:k}}const k="parser",L=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function h(e,n,t){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const e=parseInt(n||t,16);return e<=55295||e>=57344?String.fromCodePoint(e):"�"}}}function N(e={}){const t=!1!==e.location,{onError:r}=e;function c(e,n,r){const c={type:e,start:n,end:n};return t&&(c.loc={start:r,end:r}),c}function o(e,n,r,c){e.end=n,c&&(e.type=c),t&&e.loc&&(e.loc.end=r)}function u(e,n){const t=e.context(),r=c(3,t.offset,t.startLoc);return r.value=n,o(r,e.currentOffset(),e.currentPosition()),r}function s(e,n){const t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(5,r,u);return s.index=parseInt(n,10),e.nextToken(),o(s,e.currentOffset(),e.currentPosition()),s}function i(e,n){const t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(4,r,u);return s.key=n,e.nextToken(),o(s,e.currentOffset(),e.currentPosition()),s}function a(e,n){const t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(9,r,u);return s.value=n.replace(L,h),e.nextToken(),o(s,e.currentOffset(),e.currentPosition()),s}function l(e){const n=e.context(),t=c(6,n.offset,n.startLoc);let r=e.nextToken();if(9===r.type){const n=function(e){const n=e.nextToken(),t=e.context(),{lastOffset:r,lastStartLoc:u}=t,s=c(8,r,u);return 12!==n.type?(s.value="",o(s,r,u),{nextConsumeToken:n,node:s}):(null==n.value&&_(n),s.value=n.value||"",o(s,e.currentOffset(),e.currentPosition()),{node:s})}(e);t.modifier=n.node,r=n.nextConsumeToken||e.nextToken()}switch(10!==r.type&&_(r),r=e.nextToken(),2===r.type&&(r=e.nextToken()),r.type){case 11:null==r.value&&_(r),t.key=function(e,n){const t=e.context(),r=c(7,t.offset,t.startLoc);return r.value=n,o(r,e.currentOffset(),e.currentPosition()),r}(e,r.value||"");break;case 5:null==r.value&&_(r),t.key=i(e,r.value||"");break;case 6:null==r.value&&_(r),t.key=s(e,r.value||"");break;case 7:null==r.value&&_(r),t.key=a(e,r.value||"");break;default:const n=e.context(),u=c(7,n.offset,n.startLoc);return u.value="",o(u,n.offset,n.startLoc),t.key=u,o(t,n.offset,n.startLoc),{nextConsumeToken:r,node:t}}return o(t,e.currentOffset(),e.currentPosition()),{node:t}}function f(e){const n=e.context(),t=c(2,1===n.currentType?e.currentOffset():n.offset,1===n.currentType?n.endLoc:n.startLoc);t.items=[];let r=null;do{const n=r||e.nextToken();switch(r=null,n.type){case 0:null==n.value&&_(n),t.items.push(u(e,n.value||""));break;case 6:null==n.value&&_(n),t.items.push(s(e,n.value||""));break;case 5:null==n.value&&_(n),t.items.push(i(e,n.value||""));break;case 7:null==n.value&&_(n),t.items.push(a(e,n.value||""));break;case 8:const c=l(e);t.items.push(c.node),r=c.nextConsumeToken||null}}while(14!==n.currentType&&1!==n.currentType);return o(t,1===n.currentType?n.lastOffset:e.currentOffset(),1===n.currentType?n.lastEndLoc:e.currentPosition()),t}function d(e){const n=e.context(),{offset:t,startLoc:r}=n,u=f(e);return 14===n.currentType?u:function(e,n,t,r){const u=e.context();let s=0===r.items.length;const i=c(1,n,t);i.cases=[],i.cases.push(r);do{const n=f(e);s||(s=0===n.items.length),i.cases.push(n)}while(14!==u.currentType);return o(i,e.currentOffset(),e.currentPosition()),i}(e,t,r,u)}return{parse:function(r){const u=E(r,n({},e)),s=u.context(),i=c(0,s.offset,s.startLoc);return t&&i.loc&&(i.loc.source=r),i.body=d(u),o(i,u.currentOffset(),u.currentPosition()),i}}}function _(e){if(14===e.type)return"EOF";const n=(e.value||"").replace(/\r?\n/gu,"\\n");return n.length>10?n.slice(0,9)+"…":n}function T(e,n){for(let t=0;t<e.length;t++)C(e[t],n)}function C(e,n){switch(e.type){case 1:T(e.cases,n),n.helper("plural");break;case 2:T(e.items,n);break;case 6:C(e.key,n),n.helper("linked");break;case 5:n.helper("interpolate"),n.helper("list");break;case 4:n.helper("interpolate"),n.helper("named")}}function P(e,n={}){const t=function(e,n={}){const t={ast:e,helpers:new Set};return{context:()=>t,helper:e=>(t.helpers.add(e),e)}}(e);t.helper("normalize"),e.body&&C(e.body,t);const r=t.context();e.helpers=Array.from(r.helpers)}function x(e,n){const{helper:t}=e;switch(n.type){case 0:!function(e,n){n.body?x(e,n.body):e.push("null")}(e,n);break;case 1:!function(e,n){const{helper:t,needIndent:r}=e;if(n.cases.length>1){e.push(`${t("plural")}([`),e.indent(r());const c=n.cases.length;for(let t=0;t<c&&(x(e,n.cases[t]),t!==c-1);t++)e.push(", ");e.deindent(r()),e.push("])")}}(e,n);break;case 2:!function(e,n){const{helper:t,needIndent:r}=e;e.push(`${t("normalize")}([`),e.indent(r());const c=n.items.length;for(let t=0;t<c&&(x(e,n.items[t]),t!==c-1);t++)e.push(", ");e.deindent(r()),e.push("])")}(e,n);break;case 6:!function(e,n){const{helper:t}=e;e.push(`${t("linked")}(`),x(e,n.key),n.modifier&&(e.push(", "),x(e,n.modifier)),e.push(")")}(e,n);break;case 8:case 7:e.push(JSON.stringify(n.value),n);break;case 5:e.push(`${t("interpolate")}(${t("list")}(${n.index}))`,n);break;case 4:e.push(`${t("interpolate")}(${t("named")}(${JSON.stringify(n.key)}))`,n);break;case 9:case 3:e.push(JSON.stringify(n.value),n)}}return e.CompileErrorCodes=r,e.ERROR_DOMAIN=k,e.LocationStub={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0}},e.baseCompile=function(e,r={}){const c=n({},r),o=N(c).parse(e);return P(o,c),((e,n={})=>{const r=t(n.mode)?n.mode:"normal",c=t(n.filename)?n.filename:"message.intl",o=n.needIndent?n.needIndent:"arrow"!==r,u=e.helpers||[],s=function(e,n){const{filename:t,breakLineCode:r,needIndent:c}=n,o={source:e.loc.source,filename:t,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:c,indentLevel:0};function u(e,n){o.code+=e}function s(e,n=!0){const t=n?r:"";u(c?t+" ".repeat(e):t)}return{context:()=>o,push:u,indent:function(e=!0){const n=++o.indentLevel;e&&s(n)},deindent:function(e=!0){const n=--o.indentLevel;e&&s(n)},newline:function(){s(o.indentLevel)},helper:e=>`_${e}`,needIndent:()=>o.needIndent}}(e,{mode:r,filename:c,sourceMap:!!n.sourceMap,breakLineCode:null!=n.breakLineCode?n.breakLineCode:"arrow"===r?";":"\n",needIndent:o});s.push("normal"===r?"function __msg__ (ctx) {":"(ctx) => {"),s.indent(o),u.length>0&&(s.push(`const { ${u.map((e=>`${e}: _${e}`)).join(", ")} } = ctx`),s.newline()),s.push("return "),x(s,e),s.deindent(o),s.push("}");const{code:i,map:a}=s.context();return{ast:e,code:i,map:a?a.toJSON():void 0}})(o,c)},e.createCompileError=o,e.createLocation=s,e.createParser=N,e.createPosition=u,e.defaultOnError=function(e){throw e},e.errorMessages=c,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
{
"name": "@intlify/message-compiler",
"version": "9.1.6",
"version": "9.2.0-alpha.1",
"description": "@intlify/message-compiler",

@@ -36,4 +36,4 @@ "keywords": [

"dependencies": {
"@intlify/message-resolver": "9.1.6",
"@intlify/shared": "9.1.6",
"@intlify/message-resolver": "9.2.0-alpha.1",
"@intlify/shared": "9.2.0-alpha.1",
"source-map": "0.6.1"

@@ -40,0 +40,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc