1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="d9b894a6-a2d8-ccc2-3828-a686c6862d1a")}catch(e){}}(); 2(globalThis["TURBOPACK"] || (globalThis["TURBOPACK"] = [])).push([typeof document === "object" ? document.currentScript : undefined, 3130860, ((__turbopack_context__, module, exports) => { 4"use strict"; 5 6var isMergeableObject = function isMergeableObject(value) { 7 return isNonNullObject(value) && !isSpecial(value); 8}; 9function isNonNullObject(value) { 10 return !!value && typeof value === 'object'; 11} 12function isSpecial(value) { 13 var stringValue = Object.prototype.toString.call(value); 14 return stringValue === '[object RegExp]' || stringValue === '[object Date]' || isReactElement(value); 15} 16// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25 17var canUseSymbol = typeof Symbol === 'function' && Symbol.for; 18var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7; 19function isReactElement(value) { 20 return value.$$typeof === REACT_ELEMENT_TYPE; 21} 22function emptyTarget(val) { 23 return Array.isArray(val) ? [] : {}; 24} 25function cloneUnlessOtherwiseSpecified(value, options) { 26 return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value; 27} 28function defaultArrayMerge(target, source, options) { 29 return target.concat(source).map(function(element) { 30 return cloneUnlessOtherwiseSpecified(element, options); 31 }); 32} 33function getMergeFunction(key, options) { 34 if (!options.customMerge) { 35 return deepmerge; 36 } 37 var customMerge = options.customMerge(key); 38 return typeof customMerge === 'function' ? customMerge : deepmerge; 39} 40function getEnumerableOwnPropertySymbols(target) { 41 return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) { 42 return Object.propertyIsEnumerable.call(target, symbol); 43 }) : []; 44} 45function getKeys(target) { 46 return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target)); 47} 48function propertyIsOnObject(object, property) { 49 try { 50 return property in object; 51 } catch (_) { 52 return false; 53 } 54} 55// Protects from prototype poisoning and unexpected merging up the prototype chain. 56function propertyIsUnsafe(target, key) { 57 return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet, 58 && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain, 59 && Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable. 60 ; 61} 62function mergeObject(target, source, options) { 63 var destination = {}; 64 if (options.isMergeableObject(target)) { 65 getKeys(target).forEach(function(key) { 66 destination[key] = cloneUnlessOtherwiseSpecified(target[key], options); 67 }); 68 } 69 getKeys(source).forEach(function(key) { 70 if (propertyIsUnsafe(target, key)) { 71 return; 72 } 73 if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) { 74 destination[key] = getMergeFunction(key, options)(target[key], source[key], options); 75 } else { 76 destination[key] = cloneUnlessOtherwiseSpecified(source[key], options); 77 } 78 }); 79 return destination; 80} 81function deepmerge(target, source, options) { 82 options = options || {}; 83 options.arrayMerge = options.arrayMerge || defaultArrayMerge; 84 options.isMergeableObject = options.isMergeableObject || isMergeableObject; 85 // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge() 86 // implementations can use it. The caller may not replace it. 87 options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; 88 var sourceIsArray = Array.isArray(source); 89 var targetIsArray = Array.isArray(target); 90 var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; 91 if (!sourceAndTargetTypesMatch) { 92 return cloneUnlessOtherwiseSpecified(source, options); 93 } else if (sourceIsArray) { 94 return options.arrayMerge(target, source, options); 95 } else { 96 return mergeObject(target, source, options); 97 } 98} 99deepmerge.all = function deepmergeAll(array, options) { 100 if (!Array.isArray(array)) { 101 throw new Error('first argument should be an array'); 102 } 103 return array.reduce(function(prev, next) { 104 return deepmerge(prev, next, options); 105 }, {}); 106}; 107var deepmerge_1 = deepmerge; 108module.exports = deepmerge_1; 109}), 110861745, ((__turbopack_context__) => { 111"use strict"; 112 113// MERGED MODULE: [project]/node_modules/use-intl/dist/esm/production/react.js [a
113pp-client] (ecmascript) 114; 115var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645); 116// MERGED MODULE: [project]/node_modules/use-intl/dist/esm/production/formatters-CJcico0N.js [app-client] (ecmascript) 117; 118// MERGED MODULE: [project]/node_modules/@formatjs/fast-memoize/index.js [app-client] (ecmascript) 119; 120//#region packages/fast-memoize/index.ts 121function memoize(fn, options) { 122 const cache = options && options.cache ? options.cache : cacheDefault; 123 const serializer = options && options.serializer ? options.serializer : serializerDefault; 124 return (options && options.strategy ? options.strategy : strategyDefault)(fn, { 125 cache, 126 serializer 127 }); 128} 129function isPrimitive(value) { 130 return value == null || typeof value === "number" || typeof value === "boolean"; 131} 132function monadic(fn, cache, serializer, arg) { 133 const cacheKey = isPrimitive(arg) ? arg : serializer(arg); 134 let computedValue = cache.get(cacheKey); 135 if (typeof computedValue === "undefined") { 136 computedValue = fn.call(this, arg); 137 cache.set(cacheKey, computedValue); 138 } 139 return computedValue; 140} 141function variadic(fn, cache, serializer) { 142 const args = Array.prototype.slice.call(arguments, 3); 143 const cacheKey = serializer(args); 144 let computedValue = cache.get(cacheKey); 145 if (typeof computedValue === "undefined") { 146 computedValue = fn.apply(this, args); 147 cache.set(cacheKey, computedValue); 148 } 149 return computedValue; 150} 151function assemble(fn, context, strategy, cache, serialize) { 152 return strategy.bind(context, fn, cache, serialize); 153} 154function strategyDefault(fn, options) { 155 const strategy = fn.length === 1 ? monadic : variadic; 156 return assemble(fn, this, strategy, options.cache.create(), options.serializer); 157} 158function strategyVariadic(fn, options) { 159 return assemble(fn, this, variadic, options.cache.create(), options.serializer); 160} 161function strategyMonadic(fn, options) { 162 return assemble(fn, this, monadic, options.cache.create(), options.serializer); 163} 164const serializerDefault = function() { 165 return JSON.stringify(arguments); 166}; 167var ObjectWithoutPrototypeCache = class { 168 get(key) { 169 return this.cache[key]; 170 } 171 set(key, value) { 172 this.cache[key] = value; 173 } 174 constructor(){ 175 this.cache = Object.create(null); 176 } 177}; 178const cacheDefault = { 179 create: function create() { 180 return new ObjectWithoutPrototypeCache(); 181 } 182}; 183const strategies = { 184 variadic: strategyVariadic, 185 monadic: strategyMonadic 186}; 187; 188; 189class a extends Error { 190 constructor(e, t){ 191 let a = e; 192 t && (a += ": " + t), super(a), this.code = e, t && (this.originalMessage = t); 193 } 194} 195var r = function(e) { 196 return e.MISSING_MESSAGE = "MISSING_MESSAGE", e.MISSING_FORMAT = "MISSING_FORMAT", e.ENVIRONMENT_FALLBACK = "ENVIRONMENT_FALLBACK", e.INSUFFICIENT_PATH = "INSUFFICIENT_PATH", e.INVALID_MESSAGE = "INVALID_MESSAGE", e.INVALID_KEY = "INVALID_KEY", e.FORMATTING_ERROR = "FORMATTING_ERROR", e; 197}(r || {}); 198function s() { 199 return { 200 dateTime: {}, 201 number: {}, 202 message: {}, 203 relativeTime: {}, 204 pluralRules: {}, 205 list: {}, 206 displayNames: {} 207 }; 208} 209function i(a, r) { 210 return memoize(a, { 211 cache: (s = r, { 212 create: ()=>({ 213 get: (e)=>s[e], 214 set (e, t) { 215 s[e] = t; 216 } 217 }) 218 }), 219 strategy: strategies.variadic 220 }); 221 //TURBOPACK unreachable 222 ; 223 var s; 224} 225function I(e, t) { 226 return i(function() { 227 for(var _len = arguments.length, t = new Array(_len), _key = 0; _key < _len; _key++){ 228 t[_key] = arguments[_key]; 229 } 230 return new e(...t); 231 }, t); 232} 233function l(e) { 234 return { 235 getDateTimeFormat: I(Intl.DateTimeFormat, e.dateTime), 236 getNumberFormat: I(Intl.NumberFormat, e.number), 237 getPluralRules: I(Intl.PluralRules, e.pluralRules), 238 getRelativeTimeFormat: I(Intl.RelativeTimeFormat, e.relativeTime), 239 getListFormat: I(Intl.ListFormat, e.list), 240 getDisplayNames: I(Intl.DisplayNames, e.displayNames) 241 }; 242} 243; 244// MERGED MODULE: [project]/node_modules/use-intl/dist/esm/production/initializeConfig-CHgjheii.js [app-client] (ecmascript) 245; 246var __TURBOPACK__imported__module__271645__1 = __TURBOPACK__imported__module__271645__; 247// MERGED MODULE: [project]/node_modules/use-intl/dist/esm/production/format-message/index.js [app-client] (ecmascript) 248; 249// MERGED MODULE: [project]/node_modules/intl-messageformat/index.js [app-client] (ecmascript) 250; 251// MERGED MODULE: [project]/node_modules/@formatjs/icu-messageformat-parser/index.js [app-client] (ecmascript) 252; 253// MERGED MODULE: [project]/node_modules/@formatjs/icu-skeleton-parser/index.js [app-client] (ecmascript) 254; 255//#region packages/icu-skeleton-parser/date-time.ts 256/** 257* https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table 258* Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js 259* with some tweaks 260*/ const DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g; 261/** 262* Parse Date time skeleton into Intl.DateTimeFormatOptions 263* Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table 264* @public
265* @param skeleton skeleton string 266*/ function parseDateTimeSkeleton(skeleton) { 267 const result = {}; 268 skeleton.replace(DATE_TIME_REGEX, (match)=>{ 269 const len = match.length; 270 switch(match[0]){ 271 case "G": 272 result.era = len === 4 ? "long" : len === 5 ? "narrow" : "short"; 273 break; 274 case "y": 275 result.year = len === 2 ? "2-digit" : "numeric"; 276 break; 277 case "Y": 278 case "u": 279 case "U": 280 case "r": 281 throw new RangeError("`Y/u/U/r` (year) patterns are not supported, use `y` instead"); 282 case "q": 283 case "Q": 284 throw new RangeError("`q/Q` (quarter) patterns are not supported"); 285 case "M": 286 case "L": 287 result.month = [ 288 "numeric", 289 "2-digit", 290 "short", 291 "long", 292 "narrow" 293 ][len - 1]; 294 break; 295 case "w": 296 case "W": 297 throw new RangeError("`w/W` (week) patterns are not supported"); 298 case "d": 299 result.day = [ 300 "numeric", 301 "2-digit" 302 ][len - 1]; 303 break; 304 case "D": 305 case "F": 306 case "g": 307 throw new RangeError("`D/F/g` (day) patterns are not supported, use `d` instead"); 308 case "E": 309 result.weekday = len === 4 ? "long" : len === 5 ? "narrow" : "short"; 310 break; 311 case "e": 312 if (len < 4) throw new RangeError("`e..eee` (weekday) patterns are not supported"); 313 result.weekday = [ 314 "short", 315 "long", 316 "narrow", 317 "short" 318 ][len - 3]; 319 break; 320 case "c": 321 if (len < 4) throw new RangeError("`c..ccc` (weekday) patterns are not supported"); 322 result.weekday = [ 323 "short", 324 "long", 325 "narrow", 326 "short" 327 ][len - 3]; 328 break; 329 case "a": 330 result.hour12 = true; 331 break; 332 case "b": 333 case "B": 334 throw new RangeError("`b/B` (period) patterns are not supported, use `a` instead"); 335 case "h": 336 result.hourCycle = "h12"; 337 result.hour = [ 338 "numeric", 339 "2-digit" 340 ][len - 1]; 341 break; 342 case "H": 343 result.hourCycle = "h23"; 344 result.hour = [ 345 "numeric", 346 "2-digit" 347 ][len - 1]; 348 break; 349 case "K": 350 result.hourCycle = "h11"; 351 result.hour = [ 352 "numeric", 353 "2-digit" 354 ][len - 1]; 355 break; 356 case "k": 357 result.hourCycle = "h24"; 358 result.hour = [ 359 "numeric", 360 "2-digit" 361 ][len - 1]; 362 break; 363 case "j": 364 case "J": 365 case "C": 366 throw new RangeError("`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead"); 367 case "m": 368 result.minute = [ 369 "numeric", 370 "2-digit" 371 ][len - 1]; 372 break; 373 case "s": 374 result.second = [ 375 "numeric", 376 "2-digit" 377 ][len - 1]; 378 break; 379 case "S": 380 case "A": 381 throw new RangeError("`S/A` (second) patterns are not supported, use `s` instead"); 382 case "z": 383 result.timeZoneName = len < 4 ? "short" : "long"; 384 break; 385 case "Z": 386 case "O": 387 case "v": 388 case "V": 389 case "X": 390 case "x": 391 throw new RangeError("`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead"); 392 } 393 return ""; 394 }); 395 return result; 396} 397//#endregion 398//#region node_modules/.aspect_rules_js/@[email protected]/node_modules/@formatjs_generated/unicode/icu-skeleton-parser-regex.js 399const WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/i; 400//#endregion 401//#region packages/icu-skeleton-parser/number.ts 402function parseNumberSkeletonFromString(skeleton) { 403 if (skeleton.length === 0) throw new Error("Number skeleton cannot be empty"); 404 const stringTokens = skeleton.split(WHITE_SPACE_REGEX).filter((x)=>x.length > 0); 405 const tokens = []; 406 for (const stringToken of stringTokens){ 407 let stemAndOptions = stringToken.split("/"); 408 if (stemAndOptions.length === 0) throw new Error("Invalid number skeleton"); 409 const [stem, ...options] = stemAndOptions; 410 for (const option of options)if (option.length === 0) throw new Error("Invalid number skeleton"); 411 tokens.push({ 412 stem, 413 options 414 }); 415 } 416 return tokens; 417} 418function icuUnitToEcma(unit) { 419 return unit.replace(/^(.*?)-/, ""); 420} 421const FRACTION_PRECISION_REGEX = /^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g; 422const SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\+|#+)?[rs]?$/g; 423const INTEGER_WIDTH_REGEX = /(\*)(0+)|(#+)(0+)|(0+)/g; 424const CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/; 425function parseSignificantPrecision(str) { 426 const result = {}; 427 if (str[str.length - 1] === "r") result.roundingPriority = "morePrecision"; 428 else if (str[str.length - 1] === "s") result.roundingPriority = "lessPrecision"; 429 str.replace(SIGNIFICANT_PRECISION_REGEX, function(_, g1, g2) { 430 if (typeof g2 !== "string") { 431 result.minimumSignificantDigits = g1.length; 432 result.maximumSignificantDigits = g1.length; 433 } else if (g2 === "+") result.minimumSignificantDigits = g1.length; 434 else if (g1[0] === "#") result.maximumSignificantDigits = g1.length; 435 else { 436 result.minimumSignificantDigits = g1.length; 437 result.maximumSignificantDigits = g1.length + (typeof g2 === "string" ? g2.length : 0); 438 } 439 return ""; 440 }); 441 return result; 442} 443function parseSign(str) { 444 switch(str){ 445 case "sign-auto": 446 return { 447 signDisplay: "auto" 448 }; 449 case "sign-accounting": 450 case "()": 451 return { 452 currencySign: "accounting" 453 }; 454 case "sign-always": 455 case "+!": 456 return { 457 signDisplay: "always" 458 }; 459 case "sign-accounting-always": 460 case "()!": 461 return { 462 signDisplay: "always", 463 currencySign: "accounting" 464 }; 465 case "sign-except-zero": 466 case "+?": 467 return { 468 signDisplay: "exceptZero" 469 }; 470 case "sign-accounting-except-zero": 471 case "()?": 472 return { 473 signDisplay: "exceptZero", 474 currencySign: "accounting" 475 }; 476 case "sign-never": 477 case "+_": 478 return { 479 signDisplay: "never" 480 }; 481 } 482} 483function parseConciseScientificAndEngineeringStem(stem) { 484 let result; 485 if (stem[0] === "E" && stem[1] === "E") { 486 result = { 487 notation: "engineering" 488 }; 489 stem = stem.slice(2); 490 } else if (stem[0] === "E") { 491 result = { 492 notation: "scientific" 493 }; 494 stem = stem.slice(1); 495 } 496 if (result) { 497 const signDisplay = stem.slice(0, 2); 498 if (signDisplay === "+!") { 499 result.signDisplay = "always"; 500 stem = stem.slice(2); 501 } else if (signDisplay === "+?") { 502 result.signDisplay = "exceptZero"; 503 stem = stem.slice(2); 504 } 505 if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) throw new Error("Malformed concise eng/scientific notation"); 506 result.minimumIntegerDigits = stem.length; 507 } 508 return result; 509} 510function parseNotationOptions(opt) { 511 const result = {}; 512 const signOpts = parseSign(opt); 513 if (signOpts) return signOpts; 514 return result; 515} 516/** 517* https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options 518*/ function parseNumberSkeleton(tokens) { 519 let result = {}; 520 for (const token of tokens){ 521 switch(token.stem){ 522 case "percent": 523 case "%": 524 result.style = "percent"; 525 continue; 526 case "%x100": 527 result.style = "percent"; 528 result.scale = 100; 529 continue; 530 case "currency": 531 result.style = "currency"; 532 result.currency = token.options[0]; 533 continue; 534 case "group-off": 535 case ",_": 536 result.useGrouping = false;
537 continue; 538 case "precision-integer": 539 case ".": 540 result.maximumFractionDigits = 0; 541 continue; 542 case "measure-unit": 543 case "unit": 544 result.style = "unit"; 545 result.unit = icuUnitToEcma(token.options[0]); 546 continue; 547 case "compact-short": 548 case "K": 549 result.notation = "compact"; 550 result.compactDisplay = "short"; 551 continue; 552 case "compact-long": 553 case "KK": 554 result.notation = "compact"; 555 result.compactDisplay = "long"; 556 continue; 557 case "scientific": 558 result = { 559 ...result, 560 notation: "scientific", 561 ...token.options.reduce((all, opt)=>({ 562 ...all, 563 ...parseNotationOptions(opt) 564 }), {}) 565 }; 566 continue; 567 case "engineering": 568 result = { 569 ...result, 570 notation: "engineering", 571 ...token.options.reduce((all, opt)=>({ 572 ...all, 573 ...parseNotationOptions(opt) 574 }), {}) 575 }; 576 continue; 577 case "notation-simple": 578 result.notation = "standard"; 579 continue; 580 case "unit-width-narrow": 581 result.currencyDisplay = "narrowSymbol"; 582 result.unitDisplay = "narrow"; 583 continue; 584 case "unit-width-short": 585 result.currencyDisplay = "code"; 586 result.unitDisplay = "short"; 587 continue; 588 case "unit-width-full-name": 589 result.currencyDisplay = "name"; 590 result.unitDisplay = "long"; 591 continue; 592 case "unit-width-iso-code": 593 result.currencyDisplay = "symbol"; 594 continue; 595 case "scale": 596 result.scale = parseFloat(token.options[0]); 597 continue; 598 case "rounding-mode-floor": 599 result.roundingMode = "floor"; 600 continue; 601 case "rounding-mode-ceiling": 602 result.roundingMode = "ceil"; 603 continue; 604 case "rounding-mode-down": 605 result.roundingMode = "trunc"; 606 continue; 607 case "rounding-mode-up": 608 result.roundingMode = "expand"; 609 continue; 610 case "rounding-mode-half-even": 611 result.roundingMode = "halfEven"; 612 continue; 613 case "rounding-mode-half-down": 614 result.roundingMode = "halfTrunc"; 615 continue; 616 case "rounding-mode-half-up": 617 result.roundingMode = "halfExpand"; 618 continue; 619 case "integer-width": 620 if (token.options.length > 1) throw new RangeError("integer-width stems only accept a single optional option"); 621 token.options[0].replace(INTEGER_WIDTH_REGEX, function(_, g1, g2, g3, g4, g5) { 622 if (g1) result.minimumIntegerDigits = g2.length; 623 else if (g3 && g4) throw new Error("We currently do not support maximum integer digits"); 624 else if (g5) throw new Error("We currently do not support exact integer digits"); 625 return ""; 626 }); 627 continue; 628 } 629 if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) { 630 result.minimumIntegerDigits = token.stem.length; 631 continue; 632 } 633 if (FRACTION_PRECISION_REGEX.test(token.stem)) { 634 if (token.options.length > 1) throw new RangeError("Fraction-precision stems only accept a single optional option"); 635 token.stem.replace(FRACTION_PRECISION_REGEX, function(_, g1, g2, g3, g4, g5) { 636 if (g2 === "*") result.minimumFractionDigits = g1.length; 637 else if (g3 && g3[0] === "#") result.maximumFractionDigits = g3.length; 638 else if (g4 && g5) { 639 result.minimumFractionDigits = g4.length; 640 result.maximumFractionDigits = g4.length + g5.length; 641 } else { 642 result.minimumFractionDigits = g1.length; 643 result.maximumFractionDigits = g1.length; 644 } 645 return ""; 646 }); 647 const opt = token.options[0]; 648 if (opt === "w") result = { 649 ...result, 650 trailingZeroDisplay: "stripIfInteger" 651 }; 652 else if (opt) result = { 653 ...result, 654 ...parseSignificantPrecision(opt) 655 }; 656 continue; 657 } 658 if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) { 659 result = { 660 ...result, 661 ...parseSignificantPrecision(token.stem) 662 }; 663 continue; 664 } 665 const signOpts = parseSign(token.stem); 666 if (signOpts) result = { 667 ...result, 668 ...signOpts 669 }; 670 const conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem); 671 if (conciseScientificAndEngineeringOpts) result = { 672 ...result, 673 ...conciseScientificAndEngineeringOpts 674 }; 675 } 676 return result; 677} 678; 679; 680//#region packages/icu-messageformat-parser/error.ts 681let ErrorKind = /* @__PURE__ */ function(ErrorKind) { 682 /** Argument is unclosed (e.g. `{0`) */ ErrorKind[ErrorKind["EXPECT_ARGUMENT_CLOSING_BRACE"] = 1] = "EXPECT_ARGUMENT_CLOSING_BRACE"; 683 /** Argument is empty (e.g. `{}`). */ ErrorKind[ErrorKind["EMPTY_ARGUMENT"] = 2] = "EMPTY_ARGUMENT"; 684 /** Argument is malformed (e.g. `{foo!}``) */ ErrorKind[ErrorKind["MALFORMED_ARGUMENT"] = 3] = "MALFORMED_ARGUMENT"; 685 /** Expect an argument type (e.g. `{foo,}
685`) */ ErrorKind[ErrorKind["EXPECT_ARGUMENT_TYPE"] = 4] = "EXPECT_ARGUMENT_TYPE"; 686 /** Unsupported argument type (e.g. `{foo,foo}`) */ ErrorKind[ErrorKind["INVALID_ARGUMENT_TYPE"] = 5] = "INVALID_ARGUMENT_TYPE"; 687 /** Expect an argument style (e.g. `{foo, number, }`) */ ErrorKind[ErrorKind["EXPECT_ARGUMENT_STYLE"] = 6] = "EXPECT_ARGUMENT_STYLE"; 688 /** The number skeleton is invalid. */ ErrorKind[ErrorKind["INVALID_NUMBER_SKELETON"] = 7] = "INVALID_NUMBER_SKELETON"; 689 /** The date time skeleton is invalid. */ ErrorKind[ErrorKind["INVALID_DATE_TIME_SKELETON"] = 8] = "INVALID_DATE_TIME_SKELETON"; 690 /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */ ErrorKind[ErrorKind["EXPECT_NUMBER_SKELETON"] = 9] = "EXPECT_NUMBER_SKELETON"; 691 /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */ ErrorKind[ErrorKind["EXPECT_DATE_TIME_SKELETON"] = 10] = "EXPECT_DATE_TIME_SKELETON"; 692 /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */ ErrorKind[ErrorKind["UNCLOSED_QUOTE_IN_ARGUMENT_STYLE"] = 11] = "UNCLOSED_QUOTE_IN_ARGUMENT_STYLE"; 693 /** Missing select argument options (e.g. `{foo, select}`) */ ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_OPTIONS"] = 12] = "EXPECT_SELECT_ARGUMENT_OPTIONS"; 694 /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */ ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE"] = 13] = "EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE"; 695 /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */ ErrorKind[ErrorKind["INVALID_PLURAL_ARGUMENT_OFFSET_VALUE"] = 14] = "INVALID_PLURAL_ARGUMENT_OFFSET_VALUE"; 696 /** Expecting a selector in `select` argument (e.g `{foo, select}`) */ ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_SELECTOR"] = 15] = "EXPECT_SELECT_ARGUMENT_SELECTOR"; 697 /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */ ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_SELECTOR"] = 16] = "EXPECT_PLURAL_ARGUMENT_SELECTOR"; 698 /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */ ErrorKind[ErrorKind["EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT"] = 17] = "EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT"; 699 /** 700 * Expecting a message fragment after the `plural` or `selectordinal` selector 701 * (e.g. `{foo, plural, one}`) 702 */ ErrorKind[ErrorKind["EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT"] = 18] = "EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT"; 703 /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */ ErrorKind[ErrorKind["INVALID_PLURAL_ARGUMENT_SELECTOR"] = 19] = "INVALID_PLURAL_ARGUMENT_SELECTOR"; 704 /** 705 * Duplicate selectors in `plural` or `selectordinal` argument. 706 * (e.g. {foo, plural, one {#} one {#}}) 707 */ ErrorKind[ErrorKind["DUPLICATE_PLURAL_ARGUMENT_SELECTOR"] = 20] = "DUPLICATE_PLURAL_ARGUMENT_SELECTOR"; 708 /** Duplicate selectors in `select` argument. 709 * (e.g. {foo, select, apple {apple} apple {apple}}) 710 */ ErrorKind[ErrorKind["DUPLICATE_SELECT_ARGUMENT_SELECTOR"] = 21] = "DUPLICATE_SELECT_ARGUMENT_SELECTOR"; 711 /** Plural or select argument option must have `other` clause. */ ErrorKind[ErrorKind["MISSING_OTHER_CLAUSE"] = 22] = "MISSING_OTHER_CLAUSE"; 712 /** The tag is malformed. (e.g. `<bold!>foo</bold!>) */ ErrorKind[ErrorKind["INVALID_TAG"] = 23] = "INVALID_TAG"; 713 /** The tag name is invalid. (e.g. `<123>foo</123>`) */ ErrorKind[ErrorKind["INVALID_TAG_NAME"] = 25] = "INVALID_TAG_NAME"; 714 /** The closing tag does not match the opening tag. (e.g. `<bold>foo</italic>`) */ ErrorKind[ErrorKind["UNMATCHED_CLOSING_TAG"] = 26] = "UNMATCHED_CLOSING_TAG"; 715 /** The opening tag has unmatched closing tag. (e.g. `<bold>foo`) */ ErrorKind[ErrorKind["UNCLOSED_TAG"] = 27] = "UNCLOSED_TAG"; 716 return ErrorKind; 717}({}); 718//#endregion 719//#region packages/icu-messageformat-parser/types.ts 720let TYPE = /* @__PURE__ */ function(TYPE) { 721 /** 722 * Raw text 723 */ TYPE[TYPE["literal"] = 0] = "literal"; 724 /** 725 * Variable w/o any format, e.g `var` in `this is a {var}` 726 */ TYPE[TYPE["argument"] = 1] = "argument"; 727 /** 728 * Variable w/ number format 729 */ TYPE[TYPE["number"] = 2] = "number"; 730 /** 731 * Variable w/ date format 732 */ TYPE[TYPE["date"] = 3] = "date"; 733 /** 734 * Variable w/ time format 735 */ TYPE[TYPE["time"] = 4] = "time"; 736 /** 737 * Variable w/ select format 738 */ TYPE[TYPE["select"] = 5] = "select"; 739 /** 740 * Variable w/ plural format 741 */ TYPE[TYPE["plural"] = 6] = "plural"; 742 /** 743 * Only possible within plural argument. 744 * This is the `#` symbol that will be substituted with the count. 745 */ TYPE[TYPE["pound"] = 7] = "pound"; 746 /** 747 * XML-like tag 748 */ TYPE[TYPE["tag"] = 8] = "tag"; 749 return TYPE; 750}({}); 751let SKELETON_TYPE = /* @__PURE__ */ function(SKELETON_TYPE) { 752 SKELETON_TYPE[SKELETON_TYPE["number"] = 0] = "number"; 753 SKELETON_TYPE[SKELETON_TYPE["dateTime"] = 1] = "dateTime"; 754 return SKELETON_TYPE; 755}({}); 756/** 757* Type Guards 758*/ function isLiteralElement(el) { 759 return el.type === 0; 760} 761function isArgumentElement(el) { 762 return el.type === 1; 763} 764function isNumberElement(el) { 765 return el.type === 2; 766} 767function isDateElement(el) { 768 return el.type === 3; 769} 770function isTimeElement(el) { 771 return el.type === 4; 772} 773function isSelectElement(el) { 774 return el.type === 5; 775} 776function isPluralElement(el) { 777 return el.type === 6; 778} 779function isPoundElement(el) { 780 return el.type === 7; 781} 782function isTagElement(el) { 783 return el.type === 8; 784} 785function isNumberSkeleton(el) { 786 return !!(el && typeof el === "object" && el.type === 0); 787} 788function isDateTimeSkeleton(el) { 789 return !!(el && typeof el === "object" && el.type === 1); 790} 791function createLiteralElement(value) { 792 return { 793 type: 0, 794 value 795 }; 796} 797function createNumberElement(value, style) { 798 return { 799 type: 2, 800 value, 801 style 802 }; 803} 804//#endregion 805//#region node_modules/.aspect_rules_js/@[email protected]/node_modules/@formatjs_generated/unicode/icu-messageformat-parser-regex.js 806const SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/; 807//#endregion 808//#region node_modules/.aspect_rules_js/@[email protected]/node_modules/@formatjs_generated/cldr.core/time-data.js 809const timeData = { 810 "001": [ 811 "H", 812 "h" 813 ], 814 "419": [ 815 "h", 816 "H", 817 "hB", 818 "hb" 819 ], 820 "AC": [ 821 "H", 822 "h", 823 "hb", 824 "hB" 825 ], 826 "AD": [ 827 "H", 828 "hB" 829 ], 830 "AE": [ 831 "h", 832 "hB", 833 "hb", 834 "H" 835 ], 836 "AF": [ 837 "H", 838 "hb", 839 "hB", 840 "h" 841 ], 842 "AG": [ 843 "h", 844 "hb", 845 "H", 846 "hB" 847 ], 848 "AI": [ 849 "H", 850 "h", 851 "hb", 852 "hB" 853 ], 854 "AL": [ 855 "h", 856 "H", 857 "hB" 858 ], 859 "AM": [ 860 "H", 861 "hB" 862 ], 863 "AO": [ 864 "H", 865 "hB" 866 ], 867 "AR": [ 868 "h", 869 "H", 870 "hB", 871 "hb" 872 ], 873 "AS": [ 874 "h", 875 "H" 876 ], 877 "AT": [ 878 "H", 879 "hB" 880 ], 881 "AU": [ 882 "h", 883 "hb", 884 "H", 885 "hB" 886 ], 887 "AW": [ 888 "H", 889 "hB" 890 ], 891 "AX": [ 892 "H" 893 ], 894 "AZ": [ 895 "H", 896 "hB", 897 "h" 898 ], 899 "BA": [ 900 "H", 901 "hB", 902 "h" 903 ], 904 "BB": [ 905 "h", 906 "hb", 907 "H", 908 "hB" 909 ], 910 "BD": [ 911 "h", 912 "hB", 913 "H" 914 ], 915 "BE": [ 916 "H", 917 "hB" 918 ], 919 "BF": [ 920 "H", 921 "hB" 922 ], 923 "BG": [ 924 "H", 925 "hB", 926 "h" 927 ], 928 "BH": [ 929 "h", 930 "hB", 931 "hb", 932 "H" 933 ], 934 "BI": [ 935 "H", 936 "h" 937 ], 938 "BJ": [ 939 "H", 940 "hB" 941 ], 942 "BL": [ 943 "H", 944 "hB" 945 ], 946 "BM": [ 947 "h", 948 "hb", 949 "H", 950 "hB" 951 ], 952 "BN": [ 953 "hb", 954 "hB", 955 "h", 956 "H" 957 ], 958 "BO": [ 959 "h", 960 "H", 961 "hB", 962 "hb" 963 ], 964 "BQ": [ 965 "H" 966 ], 967 "BR": [ 968 "H", 969 "hB" 970 ], 971 "BS": [ 972 "h", 973 "hb", 974 "H", 975 "hB" 976 ], 977 "BT": [ 978 "h", 979 "H" 980 ], 981 "BW": [ 982 "H", 983 "h", 984 "hb", 985 "hB" 986 ], 987 "BY": [ 988 "H", 989 "h" 990 ], 991 "BZ": [ 992 "H", 993 "h", 994 "hb", 995 "hB" 996 ], 997 "CA": [ 998 "h", 999 "hb", 1000 "H", 1001 "hB" 1002 ], 1003 "CC": [ 1004 "H", 1005 "h", 1006 "hb", 1007 "hB" 1008 ], 1009 "CD": [ 1010 "hB", 1011 "H" 1012 ], 1013 "CF": [ 1014 "H", 1015 "h", 1016 "hB" 1017 ], 1018 "CG": [ 1019 "H", 1020 "hB" 1021 ], 1022 "CH": [ 1023 "H", 1024 "hB", 1025 "h" 1026 ], 1027 "CI": [ 1028 "H", 1029 "hB" 1030 ], 1031 "CK": [ 1032 "H", 1033 "h", 1034 "hb", 1035 "hB" 1036 ], 1037 "CL": [ 1038 "h", 1039 "H", 1040 "hB", 1041 "hb" 1042 ], 1043 "CM": [ 1044 "H", 1045 "h", 1046 "hB" 1047 ], 1048 "CN": [ 1049 "H", 1050 "hB", 1051 "hb", 1052 "h" 1053 ], 1054 "CO": [ 1055 "h", 1056 "H", 1057 "hB", 1058 "hb" 1059 ], 1060 "CP": [ 1061 "H" 1062 ], 1063 "CR": [ 1064 "h", 1065 "H", 1066 "hB", 1067 "hb" 1068 ], 1069 "CU": [ 1070 "h", 1071 "H", 1072 "hB", 1073 "hb" 1074 ], 1075 "CV": [ 1076 "H", 1077 "hB" 1078 ], 1079 "CW": [ 1080 "H", 1081 "hB" 1082 ], 1083 "CX": [ 1084 "H", 1085 "h", 1086 "hb", 1087 "hB" 1088 ], 1089 "CY": [ 1090 "h", 1091 "H", 1092 "hb", 1093 "hB" 1094 ], 1095 "CZ": [ 1096 "H" 1097 ], 1098 "DE": [ 1099 "H", 1100 "hB" 1101 ], 1102 "DG": [ 1103 "H", 1104 "h", 1105 "hb", 1106 "hB" 1107 ], 1108 "DJ": [ 1109 "h", 1110 "H" 1111 ], 1112 "DK": [ 1113 "H" 1114 ], 1115 "DM": [ 1116 "h", 1117 "hb", 1118 "H", 1119 "hB" 1120 ], 1121 "DO": [ 1122 "h", 1123 "H", 1124 "hB", 1125 "hb" 1126 ], 1127 "DZ": [ 1128 "h", 1129 "hB", 1130 "hb", 1131 "H" 1132 ], 1133 "EA": [ 1134 "H", 1135 "h", 1136 "hB", 1137 "hb" 1138 ], 1139 "EC": [ 1140 "h", 1141 "H", 1142 "hB", 1143 "hb" 1144 ], 1145 "EE": [ 1146 "H", 1147 "hB" 1148 ], 1149 "EG": [ 1150 "h", 1151 "hB", 1152 "hb", 1153 "H" 1154 ], 1155 "EH": [ 1156 "h", 1157 "hB", 1158 "hb", 1159 "H" 1160 ], 1161 "ER": [ 1162 "h", 1163 "H" 1164 ], 1165 "ES": [ 1166 "H", 1167 "hB", 1168 "h", 1169 "hb" 1170 ], 1171 "ET": [ 1172 "hB", 1173 "hb", 1174 "h", 1175 "H" 1176 ], 1177 "FI": [ 1178 "H" 1179 ], 1180 "FJ": [ 1181 "h", 1182 "hb", 1183 "H", 1184 "hB" 1185 ], 1186 "FK": [ 1187 "H", 1188 "h", 1189 "hb", 1190 "hB" 1191 ], 1192 "FM": [ 1193 "h", 1194 "hb", 1195 "H", 1196 "hB" 1197 ], 1198 "FO": [ 1199 "H", 1200 "h" 1201 ], 1202 "FR": [ 1203 "H", 1204 "hB" 1205 ], 1206 "GA": [ 1207 "H", 1208 "hB" 1209 ], 1210 "GB": [ 1211 "H", 1212 "h", 1213 "hb", 1214 "hB" 1215 ], 1216 "GD": [ 1217 "h", 1218 "hb", 1219 "H", 1220 "hB" 1221 ], 1222 "GE": [ 1223 "H", 1224 "hB", 1225 "h" 1226 ], 1227 "GF": [ 1228 "H", 1229 "hB" 1230 ], 1231 "GG": [ 1232 "H", 1233 "h", 1234 "hb", 1235 "hB" 1236 ], 1237 "GH": [ 1238 "h", 1239 "H" 1240 ], 1241 "GI": [ 1242 "H", 1243 "h", 1244 "hb", 1245 "hB" 1246 ], 1247 "GL": [ 1248 "H", 1249 "h" 1250 ], 1251 "GM": [ 1252 "h", 1253 "hb", 1254 "H", 1255 "hB" 1256 ], 1257 "GN": [ 1258 "H", 1259 "hB" 1260 ], 1261 "GP": [ 1262 "H", 1263 "hB" 1264 ], 1265 "GQ": [ 1266 "H", 1267 "hB", 1268 "h", 1269 "hb" 1270 ], 1271 "GR": [ 1272 "h", 1273 "H", 1274 "hb", 1275 "hB" 1276 ], 1277 "GS": [ 1278 "H", 1279 "h", 1280 "hb", 1281 "hB" 1282 ], 1283 "GT": [ 1284 "h", 1285 "H", 1286 "hB", 1287 "hb" 1288 ], 1289 "GU": [ 1290 "h", 1291 "hb", 1292 "H", 1293 "hB" 1294 ],
1295 "GW": [ 1296 "H", 1297 "hB" 1298 ], 1299 "GY": [ 1300 "h", 1301 "hb", 1302 "H", 1303 "hB" 1304 ], 1305 "HK": [ 1306 "h", 1307 "hB", 1308 "hb", 1309 "H" 1310 ], 1311 "HN": [ 1312 "h", 1313 "H", 1314 "hB", 1315 "hb" 1316 ], 1317 "HR": [ 1318 "H", 1319 "hB" 1320 ], 1321 "HU": [ 1322 "H", 1323 "h" 1324 ], 1325 "IC": [ 1326 "H", 1327 "h", 1328 "hB", 1329 "hb" 1330 ], 1331 "ID": [ 1332 "H" 1333 ], 1334 "IE": [ 1335 "H", 1336 "h", 1337 "hb", 1338 "hB" 1339 ], 1340 "IL": [ 1341 "H", 1342 "hB" 1343 ], 1344 "IM": [ 1345 "H", 1346 "h", 1347 "hb", 1348 "hB" 1349 ], 1350 "IN": [ 1351 "h", 1352 "H" 1353 ], 1354 "IO": [ 1355 "H", 1356 "h", 1357 "hb", 1358 "hB" 1359 ], 1360 "IQ": [ 1361 "h", 1362 "hB", 1363 "hb", 1364 "H" 1365 ], 1366 "IR": [ 1367 "hB", 1368 "H" 1369 ], 1370 "IS": [ 1371 "H" 1372 ], 1373 "IT": [ 1374 "H", 1375 "hB" 1376 ], 1377 "JE": [ 1378 "H", 1379 "h", 1380 "hb", 1381 "hB" 1382 ], 1383 "JM": [ 1384 "h", 1385 "hb", 1386 "H", 1387 "hB" 1388 ], 1389 "JO": [ 1390 "h", 1391 "hB", 1392 "hb", 1393 "H" 1394 ], 1395 "JP": [ 1396 "H", 1397 "K", 1398 "h" 1399 ], 1400 "KE": [ 1401 "hB", 1402 "hb", 1403 "H", 1404 "h" 1405 ], 1406 "KG": [ 1407 "H", 1408 "h", 1409 "hB", 1410 "hb" 1411 ], 1412 "KH": [ 1413 "hB", 1414 "h", 1415 "H", 1416 "hb" 1417 ], 1418 "KI": [ 1419 "h", 1420 "hb", 1421 "H", 1422 "hB" 1423 ], 1424 "KM": [ 1425 "H", 1426 "h", 1427 "hB", 1428 "hb" 1429 ], 1430 "KN": [ 1431 "h", 1432 "hb", 1433 "H", 1434 "hB" 1435 ], 1436 "KP": [ 1437 "h", 1438 "H", 1439 "hB", 1440 "hb" 1441 ], 1442 "KR": [ 1443 "h", 1444 "H", 1445 "hB", 1446 "hb" 1447 ], 1448 "KW": [ 1449 "h", 1450 "hB", 1451 "hb", 1452 "H" 1453 ], 1454 "KY": [ 1455 "h", 1456 "hb", 1457 "H", 1458 "hB" 1459 ], 1460 "KZ": [ 1461 "H", 1462 "hB" 1463 ], 1464 "LA": [ 1465 "H", 1466 "hb", 1467 "hB", 1468 "h" 1469 ], 1470 "LB": [ 1471 "h", 1472 "hB", 1473 "hb", 1474 "H" 1475 ], 1476 "LC": [ 1477 "h", 1478 "hb", 1479 "H", 1480 "hB" 1481 ], 1482 "LI": [ 1483 "H", 1484 "hB", 1485 "h" 1486 ], 1487 "LK": [ 1488 "H", 1489 "h", 1490 "hB", 1491 "hb" 1492 ], 1493 "LR": [ 1494 "h", 1495 "hb", 1496 "H", 1497 "hB" 1498 ], 1499 "LS": [ 1500 "h", 1501 "H" 1502 ], 1503 "LT": [ 1504 "H", 1505 "h", 1506 "hb", 1507 "hB" 1508 ], 1509 "LU": [ 1510 "H", 1511 "h", 1512 "hB" 1513 ], 1514 "LV": [ 1515 "H", 1516 "hB", 1517 "hb", 1518 "h" 1519 ], 1520 "LY": [ 1521 "h", 1522 "hB", 1523 "hb", 1524 "H" 1525 ], 1526 "MA": [ 1527 "H", 1528 "h", 1529 "hB", 1530 "hb" 1531 ], 1532 "MC": [ 1533 "H", 1534 "hB" 1535 ], 1536 "MD": [ 1537 "H", 1538 "hB" 1539 ], 1540 "ME": [ 1541 "H", 1542 "hB", 1543 "h" 1544 ], 1545 "MF": [ 1546 "H", 1547 "hB" 1548 ], 1549 "MG": [ 1550 "H", 1551 "h" 1552 ], 1553 "MH": [ 1554 "h", 1555 "hb", 1556 "H", 1557 "hB" 1558 ], 1559 "MK": [ 1560 "H", 1561 "h", 1562 "hb", 1563 "hB" 1564 ], 1565 "ML": [ 1566 "H" 1567 ], 1568 "MM": [ 1569 "hB", 1570 "hb", 1571 "H", 1572 "h" 1573 ], 1574 "MN": [ 1575 "H", 1576 "h", 1577 "hb", 1578 "hB" 1579 ], 1580 "MO": [ 1581 "h", 1582 "hB", 1583 "hb", 1584 "H" 1585 ], 1586 "MP": [ 1587 "h", 1588 "hb", 1589 "H", 1590 "hB" 1591 ], 1592 "MQ": [ 1593 "H", 1594 "hB" 1595 ], 1596 "MR": [ 1597 "h", 1598 "hB", 1599 "hb", 1600 "H" 1601 ], 1602 "MS": [ 1603 "H", 1604 "h", 1605 "hb", 1606 "hB" 1607 ], 1608 "MT": [ 1609 "H", 1610 "h" 1611 ], 1612 "MU": [ 1613 "H", 1614 "h" 1615 ], 1616 "MV": [ 1617 "H", 1618 "h" 1619 ], 1620 "MW": [ 1621 "h", 1622 "hb", 1623 "H", 1624 "hB" 1625 ], 1626 "MX": [ 1627 "h", 1628 "H", 1629 "hB", 1630 "hb" 1631 ], 1632 "MY": [ 1633 "hb", 1634 "hB", 1635 "h", 1636 "H" 1637 ], 1638 "MZ": [ 1639 "H", 1640 "hB" 1641 ], 1642 "NA": [ 1643 "h", 1644 "H", 1645 "hB", 1646 "hb" 1647 ], 1648 "NC": [ 1649 "H", 1650 "hB" 1651 ], 1652 "NE": [ 1653 "H" 1654 ], 1655 "NF": [ 1656 "H", 1657 "h", 1658 "hb", 1659 "hB" 1660 ], 1661 "NG": [ 1662 "H", 1663 "h", 1664 "hb", 1665 "hB" 1666 ], 1667 "NI": [ 1668 "h", 1669 "H", 1670 "hB", 1671 "hb" 1672 ], 1673 "NL": [ 1674 "H", 1675 "hB" 1676 ], 1677 "NO": [ 1678 "H", 1679 "h" 1680 ], 1681 "NP": [ 1682 "H", 1683 "h", 1684 "hB" 1685 ], 1686 "NR": [ 1687 "H", 1688 "h", 1689 "hb", 1690 "hB" 1691 ], 1692 "NU": [ 1693 "H", 1694 "h", 1695 "hb", 1696 "hB" 1697 ], 1698 "NZ": [ 1699 "h", 1700 "hb", 1701 "H", 1702 "hB" 1703 ], 1704 "OM": [ 1705 "h", 1706 "hB", 1707 "hb", 1708 "H" 1709 ], 1710 "PA": [ 1711 "h", 1712 "H", 1713 "hB", 1714 "hb" 1715 ], 1716 "PE": [ 1717 "h", 1718 "H", 1719 "hB", 1720 "hb" 1721 ], 1722 "PF": [ 1723 "H", 1724 "h", 1725 "hB" 1726 ], 1727 "PG": [ 1728 "h", 1729 "H" 1730 ], 1731 "PH": [ 1732 "h", 1733 "hB", 1734 "hb", 1735 "H" 1736 ], 1737 "PK": [ 1738 "h", 1739 "hB", 1740 "H" 1741 ], 1742 "PL": [ 1743 "H", 1744 "h" 1745 ], 1746 "PM": [ 1747 "H", 1748 "hB" 1749 ], 1750 "PN": [ 1751 "H", 1752 "h", 1753 "hb", 1754 "hB" 1755 ], 1756 "PR": [ 1757 "h", 1758 "H", 1759 "hB", 1760 "hb" 1761 ], 1762 "PS": [ 1763 "h", 1764 "hB", 1765 "hb", 1766 "H" 1767 ], 1768 "PT": [ 1769 "H", 1770 "hB" 1771 ], 1772 "PW": [ 1773 "h", 1774 "H" 1775 ], 1776 "PY": [ 1777 "h", 1778 "H", 1779 "hB", 1780 "hb" 1781 ], 1782 "QA": [ 1783 "h", 1784 "hB", 1785 "hb", 1786 "H" 1787 ], 1788 "RE": [ 1789 "H", 1790 "hB" 1791 ], 1792 "RO": [ 1793 "H", 1794 "hB" 1795 ], 1796 "RS": [ 1797 "H", 1798 "hB", 1799 "h" 1800 ], 1801 "RU": [ 1802 "H" 1803 ], 1804 "RW": [ 1805 "H", 1806 "h" 1807 ], 1808 "SA": [ 1809 "h", 1810 "hB", 1811 "hb", 1812 "H" 1813 ], 1814 "SB": [ 1815 "h", 1816 "hb", 1817 "H", 1818 "hB" 1819 ], 1820 "SC": [ 1821 "H", 1822 "h", 1823 "hB" 1824 ], 1825 "SD": [ 1826 "h", 1827 "hB", 1828 "hb", 1829 "H" 1830 ], 1831 "SE": [ 1832 "H" 1833 ], 1834 "SG": [ 1835 "h", 1836 "hb", 1837 "H", 1838 "hB" 1839 ], 1840 "SH": [ 1841 "H", 1842 "h", 1843 "hb", 1844 "hB" 1845 ], 1846 "SI": [ 1847 "H", 1848 "hB" 1849 ], 1850 "SJ": [ 1851 "H" 1852 ], 1853 "SK": [ 1854 "H" 1855 ], 1856 "SL": [ 1857 "h", 1858 "hb", 1859 "H", 1860 "hB" 1861 ], 1862 "SM": [ 1863 "H", 1864 "h", 1865 "hB" 1866 ], 1867 "SN": [ 1868 "H", 1869 "h", 1870 "hB" 1871 ], 1872 "SO": [ 1873 "h", 1874 "H" 1875 ], 1876 "SR": [ 1877 "H", 1878 "hB" 1879 ], 1880 "SS": [ 1881 "h", 1882 "hb", 1883 "H", 1884 "hB" 1885 ], 1886 "ST": [ 1887 "H", 1888 "hB" 1889 ], 1890 "SV": [ 1891 "h", 1892 "H", 1893 "hB", 1894 "hb" 1895 ], 1896 "SX": [ 1897 "H", 1898 "h", 1899 "hb", 1900 "hB" 1901 ], 1902 "SY": [ 1903 "h", 1904 "hB", 1905 "hb", 1906 "H" 1907 ], 1908 "SZ": [ 1909 "h", 1910 "hb", 1911 "H", 1912 "hB" 1913 ], 1914 "TA": [ 1915 "H", 1916 "h", 1917 "hb", 1918 "hB" 1919 ], 1920 "TC": [ 1921 "h", 1922 "hb", 1923 "H", 1924 "hB" 1925 ], 1926 "TD": [ 1927 "h", 1928 "H", 1929 "hB" 1930 ], 1931 "TF": [ 1932 "H", 1933 "h", 1934 "hB" 1935 ], 1936 "TG": [ 1937 "H", 1938 "hB" 1939 ], 1940 "TH": [ 1941 "H", 1942 "h" 1943 ], 1944 "TJ": [ 1945 "H", 1946 "h" 1947 ], 1948 "TL": [ 1949 "H", 1950 "hB", 1951 "hb", 1952 "h" 1953 ], 1954 "TM": [ 1955 "H", 1956 "h" 1957 ], 1958 "TN": [ 1959 "h", 1960 "hB", 1961 "hb", 1962 "H" 1963 ], 1964 "TO": [ 1965 "h", 1966 "H" 1967 ], 1968 "TR": [ 1969 "H", 1970 "hB" 1971 ], 1972 "TT": [ 1973 "h", 1974 "hb", 1975 "H", 1976 "hB" 1977 ], 1978 "TW": [ 1979 "hB", 1980 "hb", 1981 "h", 1982 "H" 1983 ], 1984 "TZ": [ 1985 "hB", 1986 "hb", 1987 "H", 1988 "h" 1989 ], 1990 "UA": [ 1991 "H", 1992 "hB", 1993 "h" 1994 ], 1995 "UG": [ 1996 "hB", 1997 "hb", 1998 "H", 1999 "h" 2000 ], 2001 "UM": [ 2002 "h", 2003 "hb", 2004 "H", 2005 "hB" 2006 ], 2007 "US": [ 2008 "h", 2009 "hb", 2010 "H", 2011 "hB" 2012 ], 2013 "UY": [ 2014 "h", 2015 "H", 2016 "hB", 2017 "hb" 2018 ], 2019 "UZ": [ 2020 "H", 2021 "hB", 2022 "h" 2023 ], 2024 "VA": [ 2025 "H", 2026 "h", 2027 "hB" 2028 ], 2029 "VC": [ 2030 "h", 2031 "hb", 2032 "H", 2033 "hB" 2034 ], 2035 "VE": [ 2036 "h", 2037 "H", 2038 "hB", 2039 "hb" 2040 ], 2041 "VG": [ 2042 "h", 2043 "hb", 2044 "H", 2045 "hB" 2046 ], 2047 "VI": [ 2048 "h", 2049 "hb", 2050 "H", 2051 "hB" 2052 ], 2053 "VN": [ 2054 "H", 2055 "h" 2056 ], 2057 "VU": [ 2058 "h", 2059 "H" 2060 ], 2061 "WF": [ 2062 "H", 2063 "hB" 2064 ], 2065 "WS": [ 2066 "h", 2067 "H" 2068 ], 2069 "XK": [ 2070 "H", 2071 "hB", 2072 "h" 2073 ], 2074 "YE": [ 2075 "h", 2076 "hB", 2077 "hb", 2078 "H" 2079 ], 2080 "YT": [ 2081 "H", 2082 "hB" 2083 ], 2084 "ZA": [ 2085 "H", 2086 "h", 2087 "hb", 2088 "hB" 2089 ], 2090 "ZM": [ 2091 "h", 2092 "hb", 2093 "H", 2094 "hB" 2095 ], 2096 "ZW": [ 2097 "H", 2098 "h" 2099 ], 2100 "af-ZA": [ 2101 "H", 2102 "h", 2103 "hB", 2104 "hb" 2105 ], 2106 "ar-001": [ 2107 "h", 2108 "hB", 2109 "hb", 2110 "H" 2111 ], 2112 "ca-ES": [ 2113 "H", 2114 "h", 2115 "hB" 2116 ], 2117 "en-001": [ 2118 "h", 2119 "hb", 2120 "H", 2121 "hB" 2122 ], 2123 "en-HK": [ 2124 "h", 2125 "hb", 2126 "H", 2127 "hB" 2128 ], 2129 "en-IL": [ 2130 "H", 2131 "h", 2132 "hb", 2133 "hB" 2134 ], 2135 "en-MY": [ 2136 "h", 2137 "hb", 2138 "H", 2139 "hB" 2140 ], 2141 "es-BR": [ 2142 "H", 2143 "h", 2144 "hB", 2145 "hb" 2146 ], 2147 "es-ES": [ 2148 "H", 2149 "h", 2150 "hB", 2151 "hb" 2152 ], 2153 "es-GQ": [ 2154 "H", 2155 "h", 2156 "hB", 2157 "hb" 2158 ], 2159 "fr-CA": [ 2160 "H", 2161 "h", 2162 "hB" 2163 ], 2164 "gl-ES": [ 2165 "H", 2166 "h", 2167 "hB" 2168 ], 2169 "gu-IN": [ 2170 "hB", 2171 "hb", 2172 "h", 2173 "H" 2174 ], 2175 "hi-IN": [ 2176 "hB", 2177 "h", 2178 "H" 2179 ], 2180 "it-CH": [ 2181 "H", 2182 "h", 2183 "hB" 2184 ], 2185 "it-IT": [ 2186 "H", 2187 "h", 2188 "hB" 2189 ], 2190 "kn-IN": [ 2191 "hB", 2192 "h", 2193 "H" 2194 ], 2195 "ku-SY": [ 2196 "H", 2197 "hB" 2198 ], 2199 "ml-IN": [ 2200 "hB", 2201 "h", 2202 "H" 2203 ], 2204 "mr-IN": [ 2205 "hB", 2206 "hb", 2207 "h", 2208 "H" 2209 ], 2210 "pa-IN": [ 2211 "hB", 2212 "hb", 2213 "h", 2214 "H" 2215 ], 2216 "ta-IN": [ 2217 "hB", 2218 "h", 2219 "hb", 2220 "H" 2221 ], 2222 "te-IN": [ 2223 "hB", 2224 "h", 2225 "H" 2226 ], 2227 "zu-ZA": [ 2228 "H", 2229 "hB", 2230 "hb", 2231 "h" 2232 ] 2233}; 2234//#endregion 2235//#region packages/icu-messageformat-parser/date-time-pattern-generator.ts 2236/** 2237* Returns the best matching date time pattern if a date time skeleton 2238* pattern is provided with a locale. Follows the Unicode specification: 2239* https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns 2240* @param skeleton date time skeleton pattern that possibly includes j, J or C 2241* @param locale 2242*/ function getBestPattern(skeleton, locale) { 2243 let skeletonCopy = ""; 2244 for(let patternPos = 0; patternPos < skeleton.length; patternPos++){ 2245 const patternChar = skeleton.charAt(patternPos); 2246 if (patternChar === "j") { 2247 let extraLength = 0; 2248 while(patternPos + 1 < skeleton.length && skeleton.charAt(patternPos + 1) === patternChar){ 2249 extraLength++; 2250 patternPos++; 2251 } 2252 let hourLen = 1 + (extraLength & 1); 2253 let dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1); 2254 let dayPeriodChar = "a"; 2255 let hourChar = getDefaultHourSymbolFromLocale(locale); 2256 if (hourChar == "H" || hourChar == "k") dayPeriodLen = 0; 2257 while(dayPeriodLen-- > 0)skeletonCopy += dayPeriodChar; 2258 while(hourLen-- > 0)skeletonCopy = hourChar + skeletonCopy; 2259 } else if (patternChar === "J") skeletonCopy += "H"; 2260 else skeletonCopy += patternChar; 2261 } 2262 return skeletonCopy; 2263} 2264/** 2265* Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle) 2266* of the given `locale` to the corresponding time pattern. 2267* @param locale 2268*/ function getDefaultHourSymbolFromLocale(locale) { 2269 let hourCycle = locale.hourCycle; 2270 if (hourCycle === void 0) { 2271 var _ref; 2272 var _localeWithHourCycles_getHourCycles, _localeWithHourCycles_hourCycles; 2273 const localeWithHourCycles = locale; 2274 hourCycle = (_ref = (_localeWithHourCycles_getHourCycles = localeWithHourCycles.getHourCycles) === null || _localeWithHourCycles_getHourCycles === void 0 ? void 0 : _localeWithHourCycles_getHourCycles.call(localeWithHourCycles)[0]) !== null && _ref !== void 0 ? _ref : (_localeWithHourCycles_hourCycles = localeWithHourCycles.hourCycles) === null || _localeWithHourCycles_hourCycles === void 0 ? void 0 : _localeWithHourCycles_hourCycles[0]; 2275 } 2276 if (hourCycle) switch(hourCycle){ 2277 case "h24": 2278 return "k"; 2279 case "h23": 2280 return "H"; 2281 case "h12": 2282 return "h"; 2283 case "h11": 2284 return "K"; 2285 default: 2286 throw new Error("Invalid hourCycle"); 2287 } 2288 const languageTag = locale.language; 2289 let regionTag; 2290 if (languageTag !== "root") regionTag = locale.maximize().region; 2291 return (timeData["".concat(languageTag, "-").concat(regionTag)] || timeData[regionTag || ""] || timeData[languageTag || ""] || timeData["".concat(languageTag, "-001")] || timeData["001"])[0].charAt(0); 2292} 2293//#endregion 2294//#region packages/icu-messageformat-parser/parser.ts 2295const SPACE_SEPARATOR_START_REGEX = new RegExp("^".concat(SPACE_SEPARATOR_REGEX.source, "*")); 2296const SPACE_SEPARATOR_END_REGEX = new RegExp("".concat(SPACE_SEPARATOR_REGEX.source, "*$")); 2297function createLocation(start, end) { 2298 return { 2299 start, 2300 end 2301 }; 2302} 2303const hasNativeFromEntries = !!Object.fromEntries; 2304const hasTrimStart = !!String.prototype.trimStart; 2305const hasTrimEnd = !!String.prototype.trimEnd; 2306const fromEntries = hasNativeFromEntries ? Object.fromEntries : function from
2306Entries(entries) { 2307 const obj = {}; 2308 for (const [k, v] of entries)obj[k] = v; 2309 return obj; 2310}; 2311const trimStart = hasTrimStart ? function trimStart(s) { 2312 return s.trimStart(); 2313} : function trimStart(s) { 2314 return s.replace(SPACE_SEPARATOR_START_REGEX, ""); 2315}; 2316const trimEnd = hasTrimEnd ? function trimEnd(s) { 2317 return s.trimEnd(); 2318} : function trimEnd(s) { 2319 return s.replace(SPACE_SEPARATOR_END_REGEX, ""); 2320}; 2321const IDENTIFIER_PREFIX_RE = new RegExp("([^\\p{White_Space}\\p{Pattern_Syntax}]*)", "yu"); 2322function matchIdentifierAtIndex(s, index) { 2323 var _IDENTIFIER_PREFIX_RE_exec_; 2324 IDENTIFIER_PREFIX_RE.lastIndex = index; 2325 return (_IDENTIFIER_PREFIX_RE_exec_ = IDENTIFIER_PREFIX_RE.exec(s)[1]) !== null && _IDENTIFIER_PREFIX_RE_exec_ !== void 0 ? _IDENTIFIER_PREFIX_RE_exec_ : ""; 2326} 2327function plainTopLevelEndPosition(message) { 2328 if (message.length === 0) return null; 2329 let line = 1; 2330 let column = 1; 2331 for(let offset = 0; offset < message.length;){ 2332 const code = message.charCodeAt(offset); 2333 switch(code){ 2334 case 35: 2335 case 39: 2336 case 60: 2337 case 123: 2338 case 125: 2339 return null; 2340 } 2341 if (code === 10) { 2342 line++; 2343 column = 1; 2344 offset++; 2345 } else { 2346 column++; 2347 if (code >= 55296 && code <= 56319 && offset + 1 < message.length) { 2348 const next = message.charCodeAt(offset + 1); 2349 offset += next >= 56320 && next <= 57343 ? 2 : 1; 2350 } else offset++; 2351 } 2352 } 2353 return { 2354 offset: message.length, 2355 line, 2356 column 2357 }; 2358} 2359var Parser = class { 2360 parse() { 2361 if (this.offset() !== 0) throw Error("parser can only be used once"); 2362 if (this.message.length > 0) { 2363 const firstCode = this.message.charCodeAt(0); 2364 if (firstCode !== 35 && firstCode !== 39 && firstCode !== 60 && firstCode !== 123 && firstCode !== 125) { 2365 const plainEndPosition = plainTopLevelEndPosition(this.message); 2366 if (plainEndPosition) { 2367 const start = this.clonePosition(); 2368 this.position = plainEndPosition; 2369 return { 2370 val: [ 2371 { 2372 type: 0, 2373 value: this.message, 2374 location: createLocation(start, this.clonePosition()) 2375 } 2376 ], 2377 err: null 2378 }; 2379 } 2380 } 2381 } 2382 return this.parseMessage(0, "", false); 2383 } 2384 parseMessage(nestingLevel, parentArgType, expectingCloseTag) { 2385 let elements = []; 2386 while(!this.isEOF()){ 2387 const char = this.char(); 2388 if (char === 123) { 2389 const result = this.parseArgument(nestingLevel, expectingCloseTag); 2390 if (result.err) return result; 2391 elements.push(result.val); 2392 } else if (char === 125 && nestingLevel > 0) break; 2393 else if (char === 35 && (parentArgType === "plural" || parentArgType === "selectordinal")) { 2394 const position = this.clonePosition(); 2395 this.bump(); 2396 elements.push({ 2397 type: 7, 2398 location: createLocation(position, this.clonePosition()) 2399 }); 2400 } else if (char === 60 && !this.ignoreTag && this.peek() === 47) { 2401 if (expectingCloseTag) break; 2402 else return this.error(26, createLocation(this.clonePosition(), this.clonePosition())); 2403 } else if (char === 60 && !this.ignoreTag && _isAlpha(this.peek() || 0)) { 2404 const result = this.parseTag(nestingLevel, parentArgType); 2405 if (result.err) return result; 2406 elements.push(result.val); 2407 } else { 2408 const result = this.parseLiteral(nestingLevel, parentArgType); 2409 if (result.err) return result; 2410 elements.push(result.val); 2411 } 2412 } 2413 return { 2414 val: elements, 2415 err: null 2416 }; 2417 } 2418 /** 2419 * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the 2420 * [custom element name][] except that a dash is NOT always mandatory and uppercase letters 2421 * are accepted: 2422 * 2423 * ``` 2424 * tag ::= "<" tagName (whitespace)* "/>" | "<" tagName (whitespace)* ">" message "</" tagName (whitespace)* ">" 2425 * tagName ::= [a-z] (PENChar)* 2426 * PENChar ::= 2427 * "-" | "." | [0-9] | "_" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6
2427] | [#xD8-#xF6] | [#xF8-#x37D] | 2428 * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] | 2429 * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF] 2430 * ``` 2431 * 2432 * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name 2433 * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do 2434 * since other tag-based engines like React allow it 2435 */ parseTag(nestingLevel, parentArgType) { 2436 const startPosition = this.clonePosition(); 2437 this.bump(); 2438 const tagName = this.parseTagName(); 2439 this.bumpSpace(); 2440 if (this.bumpIf("/>")) return { 2441 val: { 2442 type: 0, 2443 value: "<".concat(tagName, "/>"), 2444 location: createLocation(startPosition, this.clonePosition()) 2445 }, 2446 err: null 2447 }; 2448 else if (this.bumpIf(">")) { 2449 const childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true); 2450 if (childrenResult.err) return childrenResult; 2451 const children = childrenResult.val; 2452 const endTagStartPosition = this.clonePosition(); 2453 if (this.bumpIf("</")) { 2454 if (this.isEOF() || !_isAlpha(this.char())) return this.error(23, createLocation(endTagStartPosition, this.clonePosition())); 2455 const closingTagNameStartPosition = this.clonePosition(); 2456 if (tagName !== this.parseTagName()) return this.error(26, createLocation(closingTagNameStartPosition, this.clonePosition())); 2457 this.bumpSpace(); 2458 if (!this.bumpIf(">")) return this.error(23, createLocation(endTagStartPosition, this.clonePosition())); 2459 return { 2460 val: { 2461 type: 8, 2462 value: tagName, 2463 children, 2464 location: createLocation(startPosition, this.clonePosition()) 2465 }, 2466 err: null 2467 }; 2468 } else return this.error(27, createLocation(startPosition, this.clonePosition())); 2469 } else return this.error(23, createLocation(startPosition, this.clonePosition())); 2470 } 2471 /** 2472 * This method assumes that the caller has peeked ahead for the first tag character. 2473 */ parseTagName() { 2474 const startOffset = this.offset(); 2475 this.bump(); 2476 while(!this.isEOF() && _isPotentialElementNameChar(this.char()))this.bump(); 2477 return this.message.slice(startOffset, this.offset()); 2478 } 2479 parseLiteral(nestingLevel, parentArgType) { 2480 const start = this.clonePosition(); 2481 let value = ""; 2482 while(true){ 2483 const parseQuoteResult = this.tryParseQuote(parentArgType); 2484 if (parseQuoteResult) { 2485 value += parseQuoteResult; 2486 continue; 2487 } 2488 const parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType); 2489 if (parseUnquotedResult) { 2490 value += parseUnquotedResult; 2491 continue; 2492 } 2493 const parseLeftAngleResult = this.tryParseLeftAngleBracket(); 2494 if (parseLeftAngleResult) { 2495 value += parseLeftAngleResult; 2496 continue; 2497 } 2498 break; 2499 } 2500 const location = createLocation(start, this.clonePosition()); 2501 return { 2502 val: { 2503 type: 0, 2504 value, 2505 location 2506 }, 2507 err: null 2508 }; 2509 } 2510 tryParseLeftAngleBracket() { 2511 if (!this.isEOF() && this.char() === 60 && (this.ignoreTag || !_isAlphaOrSlash(this.peek() || 0))) { 2512 this.bump(); 2513 return "<"; 2514 } 2515 return null; 2516 } 2517 /** 2518 * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes 2519 * a character that requires quoting (that is, "only where needed"), and works the same in 2520 * nested messages as on the top level of the pattern. The new behavior is otherwise compatible. 2521 */ tryParseQuote(parentArgType) { 2522 if (this.isEOF() || this.char() !== 39) return null; 2523 switch(this.peek()){ 2524 case 39: 2525 this.bump(); 2526 this.bump(); 2527 return "'"; 2528 case 123: 2529 case 60: 2530 case 62: 2531 case 125: 2532 break; 2533 case 35: 2534 if (parentArgType === "plural" || parentArgType === "selectordinal") break; 2535 return null; 2536 default: 2537 return null; 2538 } 2539 this.bump(); 2540 const codePoints = [ 2541 this.char() 2542 ]; 2543 this.bump(); 2544 while(!this.isEOF()){ 2545 const ch = this.char(); 2546 if (ch === 39) { 2547 if (this.peek() === 39) { 2548 codePoints.push(39); 2549 this.bump(); 2550 } else { 2551 this.bump(); 2552 break; 2553 } 2554 } else codePoints.push(ch); 2555 this.bump(); 2556 } 2557 return String.fromCodePoint(...codePoints); 2558 } 2559 tryParseUnquoted(nestingLevel, parentArgType) { 2560 if (this.isEOF()) return null; 2561 const ch = this.char(); 2562 if (ch === 60 || ch === 123 || ch === 35 && (parentArgType === "plural" || parentArgType === "selectordinal") || ch === 125 && nestingLevel > 0) return null; 2563 else { 2564 this.bump(); 2565 return String.fromCodePoint(ch); 2566 } 2567 } 2568 parseArgument(nestingLevel, expectingCloseTag) { 2569 const openingBracePosition = this.clonePosition(); 2570 this.bump(); 2571 this.bumpSpace(); 2572 if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition())); 2573 if (this.char() === 125) { 2574 this.bump(); 2575 return this.error(2, createLocation(openingBracePosition, this.clonePosition())); 2576 } 2577 let value = this.parseIdentifierIfPossible().value; 2578 if (!value) return this.error(3, createLocation(openingBracePosition, this.clonePosition())); 2579 this.bumpSpace(); 2580 if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition())); 2581 switch(this.char()){ 2582 case 125: 2583 this.bump(); 2584 return { 2585 val: { 2586 type: 1, 2587 value, 2588 location: createLocation(openingBracePosition, this.clonePosition()) 2589 }, 2590 err: null 2591 }; 2592 case 44: 2593 this.bump(); 2594 this.bumpSpace(); 2595 if (this.isEOF()) return this.error(1, createLocation(openingBracePosition, this.clonePosition())); 2596 return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition); 2597 default: 2598 return this.error(3, createLocation(openingBracePosition, this.clonePosition())); 2599 } 2600 } 2601 /** 2602 * Advance the parser until the end of the identifier, if it is currently on 2603 * an identifier character. Return an empty string otherwise. 2604 */ parseIdentifierIfPossible() { 2605 const startingPosition = this.clonePosition(); 2606 const startOffset = this.offset();
2607 const value = matchIdentifierAtIndex(this.message, startOffset); 2608 const endOffset = startOffset + value.length; 2609 this.bumpTo(endOffset); 2610 return { 2611 value, 2612 location: createLocation(startingPosition, this.clonePosition()) 2613 }; 2614 } 2615 parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition) { 2616 let typeStartPosition = this.clonePosition(); 2617 let argType = this.parseIdentifierIfPossible().value; 2618 let typeEndPosition = this.clonePosition(); 2619 switch(argType){ 2620 case "": 2621 return this.error(4, createLocation(typeStartPosition, typeEndPosition)); 2622 case "number": 2623 case "date": 2624 case "time": 2625 { 2626 var _ref; 2627 this.bumpSpace(); 2628 let styleAndLocation = null; 2629 if (this.bumpIf(",")) { 2630 this.bumpSpace(); 2631 const styleStartPosition = this.clonePosition(); 2632 const result = this.parseSimpleArgStyleIfPossible(); 2633 if (result.err) return result; 2634 const style = trimEnd(result.val); 2635 if (style.length === 0) return this.error(6, createLocation(this.clonePosition(), this.clonePosition())); 2636 styleAndLocation = { 2637 style, 2638 styleLocation: createLocation(styleStartPosition, this.clonePosition()) 2639 }; 2640 } 2641 const argCloseResult = this.tryParseArgumentClose(openingBracePosition); 2642 if (argCloseResult.err) return argCloseResult; 2643 const location = createLocation(openingBracePosition, this.clonePosition()); 2644 if (styleAndLocation && styleAndLocation.style.startsWith("::")) { 2645 let skeleton = trimStart(styleAndLocation.style.slice(2)); 2646 if (argType === "number") { 2647 const result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation); 2648 if (result.err) return result; 2649 return { 2650 val: { 2651 type: 2, 2652 value, 2653 location, 2654 style: result.val 2655 }, 2656 err: null 2657 }; 2658 } else { 2659 if (skeleton.length === 0) return this.error(10, location); 2660 let dateTimePattern = skeleton; 2661 if (this.locale) dateTimePattern = getBestPattern(skeleton, this.locale); 2662 const style = { 2663 type: 1, 2664 pattern: dateTimePattern, 2665 location: styleAndLocation.styleLocation, 2666 parsedOptions: this.shouldParseSkeletons ? parseDateTimeSkeleton(dateTimePattern) : {} 2667 }; 2668 return { 2669 val: { 2670 type: argType === "date" ? 3 : 4, 2671 value, 2672 location, 2673 style 2674 }, 2675 err: null 2676 }; 2677 } 2678 } 2679 return { 2680 val: { 2681 type: argType === "number" ? 2 : argType === "date" ? 3 : 4, 2682 value, 2683 location, 2684 style: (_ref = styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style) !== null && _ref !== void 0 ? _ref : null 2685 }, 2686 err: null 2687 }; 2688 }
2689 case "plural": 2690 case "selectordinal": 2691 case "select": 2692 { 2693 const typeEndPosition = this.clonePosition(); 2694 this.bumpSpace(); 2695 if (!this.bumpIf(",")) return this.error(12, createLocation(typeEndPosition, { 2696 ...typeEndPosition 2697 })); 2698 this.bumpSpace(); 2699 let identifierAndLocation = this.parseIdentifierIfPossible(); 2700 let pluralOffset = 0; 2701 if (argType !== "select" && identifierAndLocation.value === "offset") { 2702 if (!this.bumpIf(":")) return this.error(13, createLocation(this.clonePosition(), this.clonePosition())); 2703 this.bumpSpace(); 2704 const result = this.tryParseDecimalInteger(13, 14); 2705 if (result.err) return result; 2706 this.bumpSpace(); 2707 identifierAndLocation = this.parseIdentifierIfPossible(); 2708 pluralOffset = result.val; 2709 } 2710 const optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation); 2711 if (optionsResult.err) return optionsResult; 2712 const argCloseResult = this.tryParseArgumentClose(openingBracePosition); 2713 if (argCloseResult.err) return argCloseResult; 2714 const location = createLocation(openingBracePosition, this.clonePosition()); 2715 if (argType === "select") return { 2716 val: { 2717 type: 5, 2718 value, 2719 options: fromEntries(optionsResult.val), 2720 location 2721 }, 2722 err: null 2723 }; 2724 else return { 2725 val: { 2726 type: 6, 2727 value, 2728 options: fromEntries(optionsResult.val), 2729 offset: pluralOffset, 2730 pluralType: argType === "plural" ? "cardinal" : "ordinal", 2731 location 2732 }, 2733 err: null 2734 }; 2735 } 2736 default: 2737 return this.error(5, createLocation(typeStartPosition, typeEndPosition)); 2738 } 2739 } 2740 tryParseArgumentClose(openingBracePosition) { 2741 if (this.isEOF() || this.char() !== 125) return this.error(1, createLocation(openingBracePosition, this.clonePosition())); 2742 this.bump(); 2743 return { 2744 val: true, 2745 err: null 2746 }; 2747 } 2748 /** 2749 * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659 2750 */ parseSimpleArgStyleIfPossible() { 2751 let nestedBraces = 0; 2752 const startPosition = this.clonePosition(); 2753 while(!this.isEOF())switch(this.char()){ 2754 case 39: 2755 { 2756 this.bump(); 2757 let apostrophePosition = this.clonePosition(); 2758 if (!this.bumpUntil("'")) return this.error(11, createLocation(apostrophePosition, this.clonePosition())); 2759 this.bump(); 2760 break; 2761 } 2762 case 123: 2763 nestedBraces += 1; 2764 this.bump(); 2765 break; 2766 case 125: 2767 if (nestedBraces > 0) nestedBraces -= 1; 2768 else return { 2769 val: this.message.slice(startPosition.offset, this.offset()), 2770 err: null 2771 }; 2772 break; 2773 default: 2774 this.bump(); 2775 } 2776 return { 2777 val: this.message.slice(startPosition.offset, this.offset()), 2778 err: null 2779 }; 2780 } 2781 parseNumberSkeletonFromString(skeleton, location) { 2782 let tokens = []; 2783 try { 2784 tokens = parseNumberSkeletonFromString(skeleton); 2785 } catch (unused) { 2786 return this.error(7, location); 2787 } 2788 return { 2789 val: { 2790 type: 0, 2791 tokens, 2792 location, 2793 parsedOptions: this.shouldParseSkeletons ? parseNumberSkeleton(tokens) : {} 2794 }, 2795 err: null 2796 }; 2797 } 2798 /** 2799 * @param nesting_level The current nesting level of messages. 2800 * This can be positive when parsing message fragment in select or plural argument options. 2801 * @param parent_arg_type The parent argument's type. 2802 * @param parsed_first_identifier If provided, this is the first identifier-like selector of 2803 * the argument. It is a by-product of a previous parsing attempt. 2804 * @param expecting_close_tag If true, this message is directly or indirectly nested inside 2805 * between a pair of opening and closing tags. The nested message will not parse beyond 2806 * the closing tag boundary. 2807 */ tryParsePluralOrSelectOptions(nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) { 2808 let hasOtherClause = false;
2809 const options = []; 2810 const parsedSelectors = /* @__PURE__ */ new Set(); 2811 let { value: selector, location: selectorLocation } = parsedFirstIdentifier; 2812 while(true){ 2813 if (selector.length === 0) { 2814 const startPosition = this.clonePosition(); 2815 if (parentArgType !== "select" && this.bumpIf("=")) { 2816 const result = this.tryParseDecimalInteger(16, 19); 2817 if (result.err) return result; 2818 selectorLocation = createLocation(startPosition, this.clonePosition()); 2819 selector = this.message.slice(startPosition.offset, this.offset()); 2820 } else break; 2821 } 2822 if (parsedSelectors.has(selector)) return this.error(parentArgType === "select" ? 21 : 20, selectorLocation); 2823 if (selector === "other") hasOtherClause = true; 2824 this.bumpSpace(); 2825 const openingBracePosition = this.clonePosition(); 2826 if (!this.bumpIf("{")) return this.error(parentArgType === "select" ? 17 : 18, createLocation(this.clonePosition(), this.clonePosition())); 2827 const fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag); 2828 if (fragmentResult.err) return fragmentResult; 2829 const argCloseResult = this.tryParseArgumentClose(openingBracePosition); 2830 if (argCloseResult.err) return argCloseResult; 2831 options.push([ 2832 selector, 2833 { 2834 value: fragmentResult.val, 2835 location: createLocation(openingBracePosition, this.clonePosition()) 2836 } 2837 ]); 2838 parsedSelectors.add(selector); 2839 this.bumpSpace(); 2840 ({ value: selector, location: selectorLocation } = this.parseIdentifierIfPossible()); 2841 } 2842 if (options.length === 0) return this.error(parentArgType === "select" ? 15 : 16, createLocation(this.clonePosition(), this.clonePosition())); 2843 if (this.requiresOtherClause && !hasOtherClause) return this.error(22, createLocation(this.clonePosition(), this.clonePosition())); 2844 return { 2845 val: options, 2846 err: null 2847 }; 2848 } 2849 tryParseDecimalInteger(expectNumberError, invalidNumberError) { 2850 let sign = 1; 2851 const startingPosition = this.clonePosition(); 2852 if (this.bumpIf("+")) {} else if (this.bumpIf("-")) sign = -1; 2853 let hasDigits = false; 2854 let decimal = 0; 2855 while(!this.isEOF()){ 2856 const ch = this.char(); 2857 if (ch >= 48 && ch <= 57) { 2858 hasDigits = true; 2859 decimal = decimal * 10 + (ch - 48); 2860 this.bump(); 2861 } else break; 2862 } 2863 const location = createLocation(startingPosition, this.clonePosition()); 2864 if (!hasDigits) return this.error(expectNumberError, location); 2865 decimal *= sign; 2866 if (!Number.isSafeInteger(decimal)) return this.error(invalidNumberError, location); 2867 return { 2868 val: decimal, 2869 err: null 2870 }; 2871 } 2872 offset() { 2873 return this.position.offset; 2874 } 2875 isEOF() { 2876 return this.offset() === this.message.length; 2877 } 2878 clonePosition() { 2879 return { 2880 offset: this.position.offset, 2881 line: this.position.line, 2882 column: this.position.column 2883 }; 2884 } 2885 /** 2886 * Return the code point at the current position of the parser. 2887 * Throws if the index is out of bound. 2888 */ char() { 2889 const offset = this.position.offset; 2890 if (offset >= this.message.length) throw Error("out of bound"); 2891 const code = this.message.codePointAt(offset); 2892 if (code === void 0) throw Error("Offset ".concat(offset, " is at invalid UTF-16 code unit boundary")); 2893 return code; 2894 } 2895 error(kind, location) { 2896 return { 2897 val: null, 2898 err: { 2899 kind, 2900 message: this.message, 2901 location 2902 } 2903 }; 2904 } 2905 /** Bump the parser to the next UTF-16 code unit. */ bump() { 2906 if (this.isEOF()) return; 2907 const code = this.char(); 2908 if (code === 10) { 2909 this.position.line += 1; 2910 this.position.column = 1; 2911 this.position.offset += 1; 2912 } else { 2913 this.position.column += 1;
2914 this.position.offset += code < 65536 ? 1 : 2; 2915 } 2916 } 2917 /** 2918 * If the substring starting at the current position of the parser has 2919 * the given prefix, then bump the parser to the character immediately 2920 * following the prefix and return true. Otherwise, don't bump the parser 2921 * and return false. 2922 */ bumpIf(prefix) { 2923 if (this.message.startsWith(prefix, this.offset())) { 2924 for(let i = 0; i < prefix.length; i++)this.bump(); 2925 return true; 2926 } 2927 return false; 2928 } 2929 /** 2930 * Bump the parser until the pattern character is found and return `true`. 2931 * Otherwise bump to the end of the file and return `false`. 2932 */ bumpUntil(pattern) { 2933 const currentOffset = this.offset(); 2934 const index = this.message.indexOf(pattern, currentOffset); 2935 if (index >= 0) { 2936 this.bumpTo(index); 2937 return true; 2938 } else { 2939 this.bumpTo(this.message.length); 2940 return false; 2941 } 2942 } 2943 /** 2944 * Bump the parser to the target offset. 2945 * If target offset is beyond the end of the input, bump the parser to the end of the input. 2946 */ bumpTo(targetOffset) { 2947 if (this.offset() > targetOffset) throw Error("targetOffset ".concat(targetOffset, " must be greater than or equal to the current offset ").concat(this.offset())); 2948 targetOffset = Math.min(targetOffset, this.message.length); 2949 while(true){ 2950 const offset = this.offset(); 2951 if (offset === targetOffset) break; 2952 if (offset > targetOffset) throw Error("targetOffset ".concat(targetOffset, " is at invalid UTF-16 code unit boundary")); 2953 this.bump(); 2954 if (this.isEOF()) break; 2955 } 2956 } 2957 /** advance the parser through all whitespace to the next non-whitespace code unit. */ bumpSpace() { 2958 while(!this.isEOF() && _isWhiteSpace(this.char()))this.bump(); 2959 } 2960 /** 2961 * Peek at the *next* Unicode codepoint in the input without advancing the parser. 2962 * If the input has been exhausted, then this returns null. 2963 */ peek() { 2964 var _this_message_charCodeAt; 2965 if (this.isEOF()) return null; 2966 const code = this.char(); 2967 const offset = this.offset(); 2968 return (_this_message_charCodeAt = this.message.charCodeAt(offset + (code >= 65536 ? 2 : 1))) !== null && _this_message_charCodeAt !== void 0 ? _this_message_charCodeAt : null; 2969 } 2970 constructor(message, options = {}){ 2971 this.message = message; 2972 this.position = { 2973 offset: 0, 2974 line: 1, 2975 column: 1 2976 }; 2977 this.ignoreTag = !!options.ignoreTag; 2978 this.locale = options.locale; 2979 this.requiresOtherClause = !!options.requiresOtherClause; 2980 this.shouldParseSkeletons = !!options.shouldParseSkeletons; 2981 } 2982}; 2983/** 2984* This check if codepoint is alphabet (lower & uppercase) 2985* @param codepoint 2986* @returns 2987*/ function _isAlpha(codepoint) { 2988 return codepoint >= 97 && codepoint <= 122 || codepoint >= 65 && codepoint <= 90; 2989} 2990function _isAlphaOrSlash(codepoint) { 2991 return _isAlpha(codepoint) || codepoint === 47; 2992} 2993/** See `parseTag` function docs. */ function _isPotentialElementNameChar(c) { 2994 return c === 45 || c === 46 || c >= 48 && c <= 57 || c === 95 || c >= 97 && c <= 122 || c >= 65 && c <= 90 || c == 183 || c >= 192 && c <= 214 || c >= 216 && c <= 246 || c >= 248 && c <= 893 || c >= 895 && c <= 8191 || c >= 8204 && c <= 8205 || c >= 8255 && c <= 8256 || c >= 8304 && c <= 8591 || c >= 11264 && c <= 12271 || c >= 12289 && c <= 55295 || c >= 63744 && c <= 64975 || c >= 65008 && c <= 65533 || c >= 65536 && c <= 983039; 2995} 2996/** 2997* Code point equivalent of regex `\p{White_Space}`. 2998* From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt 2999*/ function _isWhiteSpace(c) { 3000 return c >= 9 && c <= 13 || c === 32 || c === 133 || c >= 8206 && c <= 8207 || c === 8232 || c === 8233; 3001} 3002//#endregion 3003//#region packages/icu-messageformat-parser/manipulator.ts 3004/** 3005* Collect all variables in an AST to Record<string, TYPE> 3006* @param ast AST to collect variables from 3007* @param vars Record of variable name to variable type 3008*/ function collectVariables(ast) { 3009 let vars = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : /* @__PURE__ */ new Map(); 3010 ast.forEach((el)=>{ 3011 if (isArgumentElement(el) || isDateElement(el) || isTimeElement(el) || isNumberElement(el)) { 3012 if (vars.has(el.value)) { 3013 const existingType = vars.get(el.value); 3014 if (existingType !== el.type && existingType !== 6 && existingType !== 5) throw new Error("Variable ".concat(el.value, " has conflicting types")); 3015 } else vars.set(el.value, el.type); 3016 } 3017 if (isPluralElement(el) || isSelectElement(el)) { 3018 vars.set(el.value, el.type);
3019 Object.keys(el.options).forEach((k)=>{ 3020 collectVariables(el.options[k].value, vars); 3021 }); 3022 } 3023 if (isTagElement(el)) { 3024 vars.set(el.value, el.type); 3025 collectVariables(el.children, vars); 3026 } 3027 }); 3028} 3029/** 3030* Check if 2 ASTs are structurally the same. This primarily means that 3031* they have the same variables with the same type 3032* @param a 3033* @param b 3034* @returns 3035*/ function isStructurallySame(a, b) { 3036 const aVars = /* @__PURE__ */ new Map(); 3037 const bVars = /* @__PURE__ */ new Map(); 3038 collectVariables(a, aVars); 3039 collectVariables(b, bVars); 3040 if (aVars.size !== bVars.size) return { 3041 success: false, 3042 error: /* @__PURE__ */ new Error("Different number of variables: [".concat(Array.from(aVars.keys()).join(", "), "] vs [").concat(Array.from(bVars.keys()).join(", "), "]")) 3043 }; 3044 return Array.from(aVars.entries()).reduce((result, param)=>{ 3045 let [key, type] = param; 3046 if (!result.success) return result; 3047 const bType = bVars.get(key); 3048 if (bType == null) return { 3049 success: false, 3050 error: /* @__PURE__ */ new Error("Missing variable ".concat(key, " in message")) 3051 }; 3052 if (bType !== type) return { 3053 success: false, 3054 error: /* @__PURE__ */ new Error("Variable ".concat(key, " has conflicting types: ").concat(TYPE[type], " vs ").concat(TYPE[bType])) 3055 }; 3056 return result; 3057 }, { 3058 success: true 3059 }); 3060} 3061//#endregion 3062//#region packages/icu-messageformat-parser/index.ts 3063function pruneLocation(els) { 3064 els.forEach((el)=>{ 3065 delete el.location; 3066 if (isSelectElement(el) || isPluralElement(el)) for(const k in el.options){ 3067 delete el.options[k].location; 3068 pruneLocation(el.options[k].value); 3069 } 3070 else if (isNumberElement(el) && isNumberSkeleton(el.style)) delete el.style.location; 3071 else if ((isDateElement(el) || isTimeElement(el)) && isDateTimeSkeleton(el.style)) delete el.style.location; 3072 else if (isTagElement(el)) pruneLocation(el.children); 3073 }); 3074} 3075function parse(message) { 3076 let opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; 3077 opts = { 3078 shouldParseSkeletons: true, 3079 requiresOtherClause: true, 3080 ...opts 3081 }; 3082 const result = new Parser(message, opts).parse(); 3083 if (result.err) { 3084 const error = SyntaxError(ErrorKind[result.err.kind]); 3085 error.location = result.err.location; 3086 error.originalMessage = result.err.message; 3087 throw error; 3088 } 3089 if (!(opts === null || opts === void 0 ? void 0 : opts.captureLocation)) pruneLocation(result.val); 3090 return result.val; 3091} 3092const _Parser = Parser; 3093; 3094var _IntlMessageFormat; 3095; 3096; 3097//#region packages/intl-messageformat/error.ts 3098let ErrorCode = /* @__PURE__ */ function(ErrorCode) { 3099 ErrorCode["MISSING_VALUE"] = "MISSING_VALUE"; 3100 ErrorCode["INVALID_VALUE"] = "INVALID_VALUE"; 3101 ErrorCode["MISSING_INTL_API"] = "MISSING_INTL_API"; 3102 return ErrorCode; 3103}({}); 3104var FormatError = class extends Error { 3105 toString() { 3106 return "[formatjs Error: ".concat(this.code, "] ").concat(this.message); 3107 } 3108 constructor(msg, code, originalMessage){ 3109 super(msg); 3110 this.code = code; 3111 this.originalMessage = originalMessage; 3112 } 3113}; 3114var InvalidValueError = class extends FormatError { 3115 constructor(variableId, value, options, originalMessage){ 3116 super('Invalid values for "'.concat(variableId, '": "').concat(value, '". Options are "').concat(Object.keys(options).join("\", \""), '"'), "INVALID_VALUE", originalMessage); 3117 } 3118}; 3119var InvalidValueTypeError = class extends FormatError { 3120 constructor(value, type, originalMessage){ 3121 super('Value for "'.concat(value, '" must be of type ').concat(type), "INVALID_VALUE", originalMessage); 3122 } 3123}; 3124var MissingValueError = class extends FormatError { 3125 constructor(variableId, originalMessage){ 3126 super('The intl string context variable "'.concat(variableId, '" was not provided to the string "').concat(originalMessage, '"'), "MISSING_VALUE", originalMessage); 3127 } 3128}; 3129//#endregion 3130//#region packages/intl-messageformat/formatters.ts 3131let PART_TYPE = /* @__PURE__ */ function(PART_TYPE) { 3132 PART_TYPE[PART_TYPE["literal"] = 0] = "literal"; 3133 PART_TYPE[PART_TYPE["object"] = 1] = "object"; 3134 return PART_TYPE; 3135}({}); 3136function mergeLiteral(parts) { 3137 if (parts.length < 2) return parts; 3138 return parts.reduce((all, part)=>{ 3139 const lastPart = all[all.length - 1]; 3140 if (!lastPart || lastPart.type !== 0 || part.type !== 0) all.push(part); 3141 else lastPart.value += part.value; 3142 return all; 3143 }, []); 3144} 3145function isFormatXMLElementFn(el) { 3146 return typeof el === "function"; 3147} 3148function formatToParts(els, locales, formatters, formats, values, currentPluralValue, originalMessage) { 3149 if (els.length === 1 && isLiteralElement(els[0])) return [ 3150 { 3151 type: 0, 3152 value: els[0].value 3153 } 3154 ]; 3155 const result = []; 3156 for (const el of els){ 3157 if (isLiteralElement(el)) { 3158 result.push({ 3159 type: 0, 3160 value: el.value 3161 }); 3162 continue; 3163 } 3164 if (isPoundElement(el)) { 3165 if (typeof currentPluralValue === "number") result.push({ 3166 type: 0, 3167 value: formatters.getNumberFormat(locales).format(currentPluralValue) 3168 }); 3169 continue; 3170 } 3171 const { value: varName } = el; 3172 if (!(values && varName in values)) throw new MissingValueError(varName, originalMessage); 3173 let value = values[varName]; 3174 if (isArgumentElement(el)) { 3175 if (!value || typeof value === "string" || typeof value === "number" || typeof value === "bigint") value = typeof value === "string" || typeof value === "number" || typeof value === "bigint" ? String(value) : ""; 3176 result.push({ 3177 type: typeof value === "string" ? 0 : 1, 3178 value 3179 }); 3180 continue; 3181 } 3182 if (isDateElement(el)) { 3183 const style = typeof el.style === "string" ? formats.date[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : void 0; 3184 result.push({ 3185 type: 0, 3186 value: formatters.getDateTimeFormat(locales, style).format(value) 3187 }); 3188 continue; 3189 } 3190 if (isTimeElement(el)) { 3191 const style = typeof el.style === "string" ? formats.time[el.style] : isDateTimeSkeleton(el.style) ? el.style.parsedOptions : formats.time.medium; 3192 result.push({ 3193 type: 0, 3194 value: formatters.getDateTimeFormat(locales, style).format(value) 3195 }); 3196 continue; 3197 } 3198 if (isNumberElement(el)) { 3199 const style = typeof el.style === "string" ? formats.number[el.style] : isNumberSkeleton(el.style) ? el.style.parsedOptions : void 0; 3200 if (style && style.scale) { 3201 const scale = style.scale || 1; 3202 if (typeof value === "bigint") { 3203 if (!Number.isInteger(scale)) throw new TypeError("Cannot apply fractional scale ".concat(scale, " to bigint value. Scale must be an integer when formatting bigint.")); 3204 value = value * BigInt(scale); 3205 } else value = value * scale; 3206 } 3207 result.push({ 3208 type: 0, 3209 value: formatters.getNumberFormat(locales, style).format(value) 3210 }); 3211 continue; 3212 } 3213 if (isTagElement(el)) { 3214 const { children, value } = el;
3215 const formatFn = values[value]; 3216 if (!isFormatXMLElementFn(formatFn)) throw new InvalidValueTypeError(value, "function", originalMessage); 3217 let chunks = formatFn(formatToParts(children, locales, formatters, formats, values, currentPluralValue).map((p)=>p.value)); 3218 if (!Array.isArray(chunks)) chunks = [ 3219 chunks 3220 ]; 3221 result.push(...chunks.map((c)=>{ 3222 return { 3223 type: typeof c === "string" ? 0 : 1, 3224 value: c 3225 }; 3226 })); 3227 } 3228 if (isSelectElement(el)) { 3229 const key = value; 3230 const opt = (Object.prototype.hasOwnProperty.call(el.options, key) ? el.options[key] : void 0) || el.options.other; 3231 if (!opt) throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage); 3232 result.push(...formatToParts(opt.value, locales, formatters, formats, values)); 3233 continue; 3234 } 3235 if (isPluralElement(el)) { 3236 const exactKey = "=".concat(value); 3237 let opt = Object.prototype.hasOwnProperty.call(el.options, exactKey) ? el.options[exactKey] : void 0; 3238 if (!opt) { 3239 if (!Intl.PluralRules) throw new FormatError('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n', "MISSING_INTL_API", originalMessage); 3240 const numericValue = typeof value === "bigint" ? Number(value) : value; 3241 const rule = formatters.getPluralRules(locales, { 3242 type: el.pluralType 3243 }).select(numericValue - (el.offset || 0)); 3244 opt = (Object.prototype.hasOwnProperty.call(el.options, rule) ? el.options[rule] : void 0) || el.options.other; 3245 } 3246 if (!opt) throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage); 3247 const numericValue = typeof value === "bigint" ? Number(value) : value; 3248 result.push(...formatToParts(opt.value, locales, formatters, formats, values, numericValue - (el.offset || 0))); 3249 continue; 3250 } 3251 } 3252 return mergeLiteral(result); 3253} 3254//#endregion 3255//#region packages/intl-messageformat/core.ts 3256function mergeConfig(c1, c2) { 3257 if (!c2) return c1; 3258 return { 3259 ...c1, 3260 ...c2, 3261 ...Object.keys(c1).reduce((all, k)=>{ 3262 all[k] = { 3263 ...c1[k], 3264 ...c2[k] 3265 }; 3266 return all; 3267 }, {}) 3268 }; 3269} 3270function mergeConfigs(defaultConfig, configs) { 3271 if (!configs) return defaultConfig; 3272 return Object.keys(defaultConfig).reduce((all, k)=>{ 3273 all[k] = mergeConfig(defaultConfig[k], configs[k]); 3274 return all; 3275 }, { 3276 ...defaultConfig 3277 }); 3278} 3279function createFastMemoizeCache(store) { 3280 return { 3281 create () { 3282 return { 3283 get (key) { 3284 return store[key]; 3285 }, 3286 set (key, value) { 3287 store[key] = value; 3288 } 3289 }; 3290 } 3291 }; 3292} 3293function createDefaultFormatters() {
3294 let cache = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { 3295 number: {}, 3296 dateTime: {}, 3297 pluralRules: {} 3298 }; 3299 return { 3300 getNumberFormat: memoize(function() { 3301 for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ 3302 args[_key] = arguments[_key]; 3303 } 3304 return new Intl.NumberFormat(...args); 3305 }, { 3306 cache: createFastMemoizeCache(cache.number), 3307 strategy: strategies.variadic 3308 }), 3309 getDateTimeFormat: memoize(function() { 3310 for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ 3311 args[_key] = arguments[_key]; 3312 } 3313 return new Intl.DateTimeFormat(...args); 3314 }, { 3315 cache: createFastMemoizeCache(cache.dateTime), 3316 strategy: strategies.variadic 3317 }), 3318 getPluralRules: memoize(function() { 3319 for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){ 3320 args[_key] = arguments[_key]; 3321 } 3322 return new Intl.PluralRules(...args); 3323 }, { 3324 cache: createFastMemoizeCache(cache.pluralRules), 3325 strategy: strategies.variadic 3326 }) 3327 }; 3328} 3329var IntlMessageFormat = (_IntlMessageFormat = class IntlMessageFormat { 3330 static get defaultLocale() { 3331 if (!IntlMessageFormat.memoizedDefaultLocale) IntlMessageFormat.memoizedDefaultLocale = new Intl.NumberFormat().resolvedOptions().locale; 3332 return IntlMessageFormat.memoizedDefaultLocale; 3333 } 3334 constructor(message, locales = IntlMessageFormat.defaultLocale, overrideFormats, opts){ 3335 this.formatterCache = { 3336 number: {}, 3337 dateTime: {}, 3338 pluralRules: {} 3339 }; 3340 this.format = (values)=>{ 3341 const parts = this.formatToParts(values); 3342 if (parts.length === 1) return parts[0].value; 3343 const result = parts.reduce((all, part)=>{ 3344 if (!all.length || part.type !== 0 || typeof all[all.length - 1] !== "string") all.push(part.value); 3345 else all[all.length - 1] += part.value; 3346 return all; 3347 }, []); 3348 if (result.length <= 1) return result[0] || ""; 3349 return result; 3350 }; 3351 this.formatToParts = (values)=>formatToParts(this.ast, this.locales, this.formatters, this.formats, values, void 0, this.message); 3352 this.resolvedOptions = ()=>{ 3353 var _this_resolvedLocale; 3354 return { 3355 locale: ((_this_resolvedLocale = this.resolvedLocale) === null || _this_resolvedLocale === void 0 ? void 0 : _this_resolvedLocale.toString()) || Intl.NumberFormat.supportedLocalesOf(this.locales)[0] 3356 }; 3357 }; 3358 this.getAst = ()=>this.ast; 3359 this.locales = locales; 3360 this.resolvedLocale = IntlMessageFormat.resolveLocale(locales); 3361 if (typeof message === "string") { 3362 this.message = message; 3363 if (!IntlMessageFormat.__parse) throw new TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`"); 3364 const { ...parseOpts } = opts || {}; 3365 this.ast = IntlMessageFormat.__parse(message, { 3366 ...parseOpts, 3367 locale: this.resolvedLocale 3368 }); 3369 } else this.ast = message; 3370 if (!Array.isArray(this.ast)) throw new TypeError("A message must be provided as a String or AST."); 3371 this.formats = mergeConfigs(IntlMessageFormat.formats, overrideFormats); 3372 this.formatters = opts && opts.formatters || createDefaultFormatters(this.formatterCache); 3373 } 3374}, _IntlMessageFormat.memoizedDefaultLocale = null, _IntlMessageFormat.resolveLocale = (locales)=>{ 3375 if (typeof Intl.Locale === "undefined") return; 3376 const supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales); 3377 if (supportedLocales.length > 0) return new Intl.Locale(supportedLocales[0]); 3378 return new Intl.Locale(typeof locales === "string" ? locales : locales[0]); 3379}, _IntlMessageFormat.__parse = parse, _IntlMessageFormat.formats = { 3380 number: { 3381 integer: { 3382 maximumFractionDigits: 0 3383 }, 3384 currency: { 3385 style: "currency" 3386 }, 3387 percent: { 3388 style: "percent" 3389 } 3390 }, 3391 date: { 3392 short: { 3393 month: "numeric", 3394 day: "numeric", 3395 year: "2-digit" 3396 }, 3397 medium: { 3398 month: "short", 3399 day: "numeric", 3400 year: "numeric" 3401 }, 3402 long: { 3403 month: "long", 3404 day: "numeric", 3405 year: "numeric" 3406 }, 3407 full: { 3408 weekday: "long", 3409 month: "long", 3410 day: "numeric", 3411 year: "numeric" 3412 } 3413 }, 3414 time: { 3415 short: { 3416 hour: "numeric", 3417 minute: "numeric" 3418 }, 3419 medium: { 3420 hour: "numeric", 3421 minute: "numeric", 3422 second: "numeric" 3423 }, 3424 long: { 3425 hour: "numeric", 3426 minute: "numeric", 3427 second: "numeric", 3428 timeZoneName: "short" 3429 }, 3430 full: { 3431 hour: "numeric", 3432 minute: "numeric", 3433 second: "numeric", 3434 timeZoneName: "short" 3435 } 3436 } 3437}, _IntlMessageFormat); 3438//#endregion 3439//#region packages/intl-messageformat/index.ts 3440var intl_messageformat_default = IntlMessageFormat; 3441; 3442var __TURBOPACK__imported__module__271645__2 = __TURBOPACK__imported__module__271645__; 3443; 3444; 3445; 3446function m() { 3447 for(var _len = arguments.length, _tmp = new Array(_len), _key = 0; _key < _len; _key++){ 3448 _tmp[_key] = arguments[_key]; 3449 } 3450 let [m1, s, i1, n] = _tmp; 3451 if (Array.isArray(s)) throw new a(r.INVALID_MESSAGE, void 0); 3452 if ("object" == typeof s) throw new a(r.INSUFFICIENT_PATH, void 0); 3453 if ("string" == typeof s) { 3454 const t = function(t, e) { 3455 return e || /'[{}<#|']/.test(t) ? void 0 : t; 3456 }(s, i1); 3457 if (t) return t; 3458 } 3459 const { cache: f, formats: c, formatters: g, globalFormats: u, locale: d, timeZone: A } = n; 3460 let p; 3461 g.getMessageFormat || (g.getMessageFormat = function(e, r) { 3462 return i(function() { 3463 for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ 3464 e[_key] = arguments[_key]; 3465 } 3466 return new IntlMessageFormat(e[0], e[1], e[2], { 3467 formatters: r, 3468 ...e[3] 3469 }); 3470 }, e.message); 3471 }(f, g)); 3472 try { 3473 p = g.getMessageFormat(s, d, function(e, r, o) { 3474 const a1 = IntlMessageFormat.formats.date, m1 = IntlMessageFormat.formats.time, s = { 3475 ...e === null || e === void 0 ? void 0 : e.dateTime, 3476 ...r === null || r === void 0 ? void 0 : r.dateTime
3477 }, i = { 3478 date: { 3479 ...a1, 3480 ...s 3481 }, 3482 time: { 3483 ...m1, 3484 ...s 3485 }, 3486 number: { 3487 ...e === null || e === void 0 ? void 0 : e.number, 3488 ...r === null || r === void 0 ? void 0 : r.number 3489 } 3490 }; 3491 return o && [ 3492 "date", 3493 "time" 3494 ].forEach((t)=>{ 3495 const e = i[t]; 3496 for (const [t, r] of Object.entries(e))e[t] = { 3497 timeZone: o, 3498 ...r 3499 }; 3500 }), i; 3501 }(u, c, A), { 3502 formatters: { 3503 ...g, 3504 getDateTimeFormat: (t, e)=>{ 3505 var _ref; 3506 return g.getDateTimeFormat(t, { 3507 ...e, 3508 timeZone: (_ref = e === null || e === void 0 ? void 0 : e.timeZone) !== null && _ref !== void 0 ? _ref : A 3509 }); 3510 } 3511 } 3512 }); 3513 } catch (t) { 3514 throw new a(r.INVALID_MESSAGE, void 0); 3515 } 3516 const w = p.format(i1); 3517 return (0, __TURBOPACK__imported__module__271645__2["isValidElement"])(w) || Array.isArray(w) || "string" == typeof w ? w : String(w); 3518} 3519m.raw = !0; 3520; 3521; 3522; 3523; 3524function c1() { 3525 for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){ 3526 e[_key] = arguments[_key]; 3527 } 3528 return e.filter(Boolean).join("."); 3529} 3530function i1(e) { 3531 return c1(e.namespace, e.key); 3532} 3533function u(e) { 3534 console.error(e); 3535} 3536function m1(e, t, r, n) { 3537 const o = c1(n, r); 3538 if (!t) throw new Error(o); 3539 let a1 = t; 3540 return r.split(".").forEach((t)=>{ 3541 const r = a1[t]; 3542 if (null == t || null == r) throw new Error(o + " (".concat(e, ")")); 3543 a1 = r; 3544 }), a1; 3545} 3546function f(a1) { 3547 const s = function(e, t, r1) { 3548 try { 3549 if (!t) throw new Error(void 0); 3550 const n = r1 ? m1(e, t, r1) : t; 3551 if (!n) throw new Error(r1); 3552 return n; 3553 } catch (e) { 3554 return new a(r.MISSING_MESSAGE, e.message); 3555 } 3556 }(a1.locale, a1.messages, a1.namespace); 3557 return function(param) { 3558 let { cache: a1, formats: s, formatters: u, getMessageFallback: f = i1, locale: l, messagesOrError: g, namespace: y, onError: h, timeZone: w } = param; 3559 const E = g instanceof a; 3560 function d(e, t, r, o) { 3561 const a1 = new a(t, r); 3562 return h(a1), o !== null && o !== void 0 ? o : f({ 3563 error: a1, 3564 key: e, 3565 namespace: y 3566 }); 3567 } 3568 function p(i, p, S, M) { 3569 const T = M; 3570 let N; 3571 if (E) { 3572 if (!T) return h(g), f({ 3573 error: g, 3574 key: i, 3575 namespace: y 3576 }); 3577 N = T; 3578 } else { 3579 const e = g; 3580 try { 3581 N = m1(l, e, i, y); 3582 } catch (e) { 3583 if (!T) return d(i, r.MISSING_MESSAGE, e.message, T); 3584 N = T; 3585 } 3586 } 3587 try { 3588 const n = c1(y, i); 3589 return m(n, N, p ? function(r) { 3590 const n = {}; 3591 return Object.keys(r).forEach((o)=>{ 3592 let a1 = 0; 3593 const s = r[o]; 3594 let c1; 3595 c1 = "function" == typeof s ? (r)=>{ 3596 const n = s(r); 3597 return (0, __TURBOPACK__imported__module__271645__1["isValidElement"])(n) ? (0, __TURBOPACK__imported__module__271645__1["cloneElement"])(n, { 3598 key: o + a1++ 3599 }) : n; 3600 } : s, n[o] = c1; 3601 }), n; 3602 }(p) : p, { 3603 cache: a1, 3604 formatters: u, 3605 globalFormats: s, 3606 formats: S, 3607 locale: l, 3608 timeZone: w 3609 }); 3610 } catch (e) { 3611 let t, r1; 3612 return e instanceof a ? (t = e.code, r1 = e.originalMessage) : (t = r.FORMATTING_ERROR, r1 = e.message), d(i, t, r1, T); 3613 } 3614 } 3615 function S(e, t, r1, n) { 3616 const a1 = p(e, t, r1, n); 3617 return "string" != typeof a1 ? d(e, r.INVALID_MESSAGE, void 0) : a1; 3618 } 3619 return S.rich = p, S.markup = (e, t, r, n)=>
3619p(e, t, r, n), S.raw = (e)=>{ 3620 if (E) return h(g), f({ 3621 error: g, 3622 key: e, 3623 namespace: y 3624 }); 3625 const t = g; 3626 try { 3627 return m1(l, t, e, y); 3628 } catch (t) { 3629 return d(e, r.MISSING_MESSAGE, t.message); 3630 } 3631 }, S.has = (e)=>{ 3632 if (E) return !1; 3633 try { 3634 return m1(l, g, e, y), !0; 3635 } catch (unused) { 3636 return !1; 3637 } 3638 }, S; 3639 }({ 3640 ...a1, 3641 messagesOrError: s 3642 }); 3643} 3644function l1(e, t) { 3645 return e === t ? void 0 : e.slice((t + ".").length); 3646} 3647const g = 3600, y = 86400, h = 7 * y, w = 2628e3, E = 7884e3, d = 365 * y, p = { 3648 second: 1, 3649 seconds: 1, 3650 minute: 60, 3651 minutes: 60, 3652 hour: g, 3653 hours: g, 3654 day: y, 3655 days: y, 3656 week: h, 3657 weeks: h, 3658 month: w, 3659 months: w, 3660 quarter: E, 3661 quarters: E, 3662 year: d, 3663 years: d 3664}; 3665function S(e) { 3666 const { _cache: t = s(), _formatters: r1 = l(t), formats: c1, locale: i, onError: m = u, timeZone: f } = e; 3667 function l1(e) { 3668 return (e === null || e === void 0 ? void 0 : e.timeZone) || (f ? e = { 3669 ...e, 3670 timeZone: f 3671 } : m(new a(r.ENVIRONMENT_FALLBACK, void 0))), e; 3672 } 3673 function E(e, t, r1, a1, s) { 3674 let c1; 3675 try { 3676 c1 = function(e, t, r1) { 3677 let a1; 3678 if ("string" == typeof t) { 3679 const r1 = t; 3680 if (a1 = e === null || e === void 0 ? void 0 : e[r1], !a1) { 3681 const e = new a(r.MISSING_FORMAT, void 0); 3682 throw m(e), e; 3683 } 3684 } else a1 = t; 3685 return r1 && (a1 = { 3686 ...a1, 3687 ...r1 3688 }), a1; 3689 }(r1, e, t); 3690 } catch (unused) { 3691 return s(); 3692 } 3693 try { 3694 return a1(c1); 3695 } catch (e) { 3696 return m(new a(r.FORMATTING_ERROR, e.message)), s(); 3697 } 3698 } 3699 function S(e, t, n) { 3700 return E(t, n, c1 === null || c1 === void 0 ? void 0 : c1.dateTime, (t)=>(t = l1(t), r1.getDateTimeFormat(i, t).format(e)), ()=>String(e)); 3701 } 3702 function M() { 3703 return e.now ? e.now : (m(new a(r.ENVIRONMENT_FALLBACK, void 0)), new Date); 3704 } 3705 return { 3706 dateTime: S, 3707 number: function(e, t, n) { 3708 return E(t, n, c1 === null || c1 === void 0 ? void 0 : c1.number, (t)=>r1.getNumberFormat(i, t).format(e), ()=>String(e)); 3709 }, 3710 relativeTime: function(e, t) { 3711 try { 3712 let n, o; 3713 const a1 = {}; 3714 t instanceof Date || "number" == typeof t ? n = new Date(t) : t && (n = null != t.now ? new Date(t.now) : M(), o = t.unit, a1.style = t.style, a1.numberingSystem = t.numberingSystem), n || (n = M()); 3715 const s = (new Date(e).getTime() - n.getTime()) / 1e3; 3716 o || (o = function(e) { 3717 const t = Math.abs(e); 3718 return t < 60 ? "second" : t < g ? "minute" : t < y ? "hour" : t < h ? "day" : t < w ? "week" : t < d ? "month" : "year"; 3719 }(s)), a1.numeric = "second" === o ? "auto" : "always"; 3720 const c1 = function(e, t) { 3721 return Math.round(e / p[t]); 3722 }(s, o); 3723 return r1.getRelativeTimeFormat(i, a1).format(c1, o); 3724 } catch (t) { 3725 return m(new a(r.FORMATTING_ERROR, t.message)), String(e); 3726 } 3727 }, 3728 list: function(e, t, n) { 3729 const o = [], a1 = new Map; 3730 let s = 0; 3731 for (const t of e){ 3732 let e; 3733 "object" == typeof t ? (e = String(s), a1.set(e, t)) : e = String(t), o.push(e), s++; 3734 } 3735 return E(t, n, c1 === null || c1 === void 0 ? void 0 : c1.list, (e)=>{ 3736 const t = r1.getListFormat(i, e).formatToParts(o).map((e)=>"literal" === e.type ? e.value : a1.get(e.value) || e.value); 3737 return a1.size > 0 ? t : t.join(""); 3738 }, ()=>String(e)); 3739 }, 3740 dateTimeRange: function(e, t, n, o) { 3741 return E(n, o, c1 === null || c1 === void 0 ? void 0 : c1.dateTime, (n)=>(n = l1(n), r1.getDateTimeFormat(i, n).formatRange(e, t)), ()=>[ 3742 S(e), 3743 S(t) 3744 ].join("âââ")); 3745 }, 3746 displayName: function(e, t, n) { 3747 return E(t, n, c1 === null || c1 === void 0 ? void 0 : c1.displayName, (t)=>r1.getDisplayNames(i, t).of(e), ()=>e); 3748 } 3749 }; 3750} 3751function M(param) { 3752 let { formats: e, getMessageFallback: t, messages: r, onError: n, ...o } = param; 3753 return { 3754 ...o, 3755 formats: e || void 0, 3756 messages: r || void 0, 3757 onError: n || u, 3758 getMessageFallback: t || i1 3759 }; 3760} 3761; 3762var __TURBOPACK__imported__module__843476__ = __turbopack_context__.i(843476); 3763; 3764; 3765; 3766; 3767const g1 = (0, __TURBOPACK__imported__module__271645__["createContext"])(void 0); 3768function w1(param) { 3769 let { children: e, formats: o, getMessageFallback: a1, locale: c1, messages: i1, now: l1, onError: f, timeZone: u } = param; 3770 const w = (0, __TURBOPACK__imported__module__271645__["useContext"])(g1), p = (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>
3770(w === null || w === void 0 ? void 0 : w.cache) || s(), [ 3771 c1, 3772 w === null || w === void 0 ? void 0 : w.cache 3773 ]), E = (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>(w === null || w === void 0 ? void 0 : w.formatters) || l(p), [ 3774 p, 3775 w === null || w === void 0 ? void 0 : w.formatters 3776 ]), h = (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>({ 3777 ...M({ 3778 locale: c1, 3779 formats: void 0 === o ? w === null || w === void 0 ? void 0 : w.formats : o, 3780 getMessageFallback: a1 || (w === null || w === void 0 ? void 0 : w.getMessageFallback), 3781 messages: void 0 === i1 ? w === null || w === void 0 ? void 0 : w.messages : i1, 3782 now: l1 || (w === null || w === void 0 ? void 0 : w.now), 3783 onError: f || (w === null || w === void 0 ? void 0 : w.onError), 3784 timeZone: u || (w === null || w === void 0 ? void 0 : w.timeZone) 3785 }), 3786 formatters: E, 3787 cache: p 3788 }), [ 3789 p, 3790 o, 3791 E, 3792 a1, 3793 c1, 3794 i1, 3795 l1, 3796 f, 3797 w, 3798 u 3799 ]); 3800 return (0, __TURBOPACK__imported__module__843476__["jsx"])(g1.Provider, { 3801 value: h, 3802 children: e 3803 }); 3804} 3805function p1() { 3806 const e = (0, __TURBOPACK__imported__module__271645__["useContext"])(g1); 3807 if (!e) throw new Error(void 0); 3808 return e; 3809} 3810let E1 = !1; 3811const h1 = "undefined" == typeof window; 3812function v(e) { 3813 return function(e, r1, o) { 3814 const { cache: a1, formats: n, formatters: s, getMessageFallback: m, locale: u, onError: d, timeZone: g } = p1(), w = e[o], v = l1(r1, o); 3815 return g || E1 || !h1 || (E1 = !0, d(new a(r.ENVIRONMENT_FALLBACK, void 0))), (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>f({ 3816 cache: a1, 3817 formatters: s, 3818 getMessageFallback: m, 3819 messages: w, 3820 namespace: v, 3821 onError: d, 3822 formats: n, 3823 locale: u, 3824 timeZone: g 3825 }), [ 3826 a1, 3827 s, 3828 m, 3829 w, 3830 v, 3831 d, 3832 n, 3833 u, 3834 g 3835 ]); 3836 }({ 3837 "!": p1().messages 3838 }, e ? "!.".concat(e) : "!", "!"); 3839} 3840function Z() { 3841 return p1().locale; 3842} 3843function k() { 3844 return new Date; 3845} 3846function b(e) { 3847 const r1 = e === null || e === void 0 ? void 0 : e.updateInterval, { now: t } = p1(), [n, s] = (0, __TURBOPACK__imported__module__271645__["useState"])(t || k()); 3848 return (0, __TURBOPACK__imported__module__271645__["useEffect"])(()=>{ 3849 if (!r1) return; 3850 const e = setInterval(()=>{ 3851 s(k()); 3852 }, r1); 3853 return ()=>{ 3854 clearInterval(e); 3855 }; 3856 }, [ 3857 t, 3858 r1 3859 ]), null == r1 && t ? t : n; 3860} 3861function x() { 3862 return p1().timeZone; 3863} 3864function F() { 3865 const e = p1(); 3866 if (!e.messages) throw new Error(void 0); 3867 return e.messages; 3868} 3869function I1() { 3870 const { formats: e, formatters: r1, locale: o, now: a1, onError: n, timeZone: s } = p1(); 3871 return (0, __TURBOPACK__imported__module__271645__["useMemo"])(()=>S({ 3872 formats: e, 3873 locale: o, 3874 now: a1, 3875 onError: n, 3876 timeZone: s, 3877 _formatters: r1 3878 }), [ 3879 e, 3880 r1, 3881 a1, 3882 o, 3883 n, 3884 s 3885 ]); 3886} 3887function M1(e) { 3888 throw v(e), new Error("[next-intl] `useExtracted` was called in production without compilation. Include modules that call `useExtracted` in `srcPath` and use `transpilePackages` for 3rd-party packages."); 3889} 3890; 3891__turbopack_context__.s([ 3892 "IntlProvider", 3893 0, 3894 w1, 3895 "useFormatter", 3896 0, 3897 I1, 3898 "useLocale", 3899 0, 3900 Z, 3901 "useMessages", 3902 0, 3903 F, 3904 "useNow", 3905 0, 3906 b, 3907 "useTimeZone", 3908 0, 3909 x, 3910 "useTranslations", 3911 0, 3912 v 3913], 861745); 3914}), 3915564843, ((__turbopack_context__) => { 3916"use strict"; 3917 3918var __TURBOPACK__imported__module__843476__ = __turbopack_context__.i(843476); 3919var __TURBOPACK__imported__module__271645__ = __turbopack_context__.i(271645); 3920var __TURBOPACK__imported__module__130860__ = __turbopack_context__.i(130860); 3921var __TURBOPACK__imported__module__861745__ = __turbopack_context__.i(861745); 3922"use client"; 3923; 3924; 3925; 3926; 3927; 3928function IntlProvider(param) { 3929 let { children, ...localProps } = param; 3930 var _props_messages, _props_formats; 3931 const context = (0, __TURBOPACK__imported__module__271645__["useContext"])(InternalIntlContext); 3932 const props = context ? (0, __TURBOPACK__imported__module__130860__["default"])(context, localProps) : localProps; 3933 const locale = props.locale; 3934 if (!locale) { 3935 throw new Error("No locale provided to root IntlProvider"); 3936 } 3937 return /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(InternalIntlContext.Provider, { 3938 value: props, 3939 children: /*#__PURE__*/ (0, __TURBOPACK__imported__module__843476__["jsx"])(__TURBOPACK__imported__module__861745__["IntlProvider"], { 3940 ...props, 3941 locale: locale, 3942 messages: (_props_messages = props.messages) !== null && _props_messages !== void 0 ? _props_messages : null, 3943 formats: (_props_formats = props.formats) !== null && _props_formats !== void 0 ? _props_formats : null, 3944 children: children 3945 }) 3946 }); 3947} 3948const InternalIntlContext = /*#__PURE__*/ (0, __TURBOPACK__imported__module__271645__["createContext"])(null); 3949__turbopack_context__.s([ 3950 "default", 3951 0, 3952 IntlProvider 3953]); 3954}), 3955]); 3956 3957//# debugId=d9b894a6-a2d8-ccc2-3828-a686c6862d1a
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.