@warp-ds/elements 2.1.0 → 2.1.1-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -723,9 +723,9 @@ var require_moo = __commonJS({
723
723
  }
724
724
  });
725
725
 
726
- // node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/lexer.js
726
+ // node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/lexer.js
727
727
  var require_lexer = __commonJS({
728
- "node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/lexer.js"(exports) {
728
+ "node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/lexer.js"(exports) {
729
729
  "use strict";
730
730
  var __importDefault = exports && exports.__importDefault || function(mod) {
731
731
  return mod && mod.__esModule ? mod : { "default": mod };
@@ -738,7 +738,7 @@ var require_lexer = __commonJS({
738
738
  doubleapos: { match: "''", value: () => "'" },
739
739
  quoted: {
740
740
  lineBreaks: true,
741
- match: /'[{}#](?:[^]*?[^'])?'(?!')/u,
741
+ match: /'[{}#](?:[^']|'')*'(?!')/u,
742
742
  value: (src) => src.slice(1, -1).replace(/''/g, "'")
743
743
  },
744
744
  argument: {
@@ -790,12 +790,13 @@ var require_lexer = __commonJS({
790
790
  }
791
791
  });
792
792
 
793
- // node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/parser.js
793
+ // node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/parser.js
794
794
  var require_parser = __commonJS({
795
- "node_modules/.pnpm/@messageformat+parser@5.1.0/node_modules/@messageformat/parser/lib/parser.js"(exports) {
795
+ "node_modules/.pnpm/@messageformat+parser@5.1.1/node_modules/@messageformat/parser/lib/parser.js"(exports) {
796
796
  "use strict";
797
797
  Object.defineProperty(exports, "__esModule", { value: true });
798
- exports.parse = exports.ParseError = void 0;
798
+ exports.ParseError = void 0;
799
+ exports.parse = parse2;
799
800
  var lexer_js_1 = require_lexer();
800
801
  var getContext = (lt) => ({
801
802
  offset: lt.offset,
@@ -861,8 +862,9 @@ var require_parser = __commonJS({
861
862
  }
862
863
  checkSelectKey(lt, type, key) {
863
864
  if (key[0] === "=") {
864
- if (type === "select")
865
+ if (type === "select") {
865
866
  throw new ParseError(lt, `The case ${key} is not valid with select`);
867
+ }
866
868
  } else if (type !== "select") {
867
869
  const keys = type === "plural" ? this.cardinalKeys : this.ordinalKeys;
868
870
  if (this.strictPluralKeys && keys.length > 0 && !keys.includes(key)) {
@@ -880,10 +882,12 @@ var require_parser = __commonJS({
880
882
  for (const lt of this.lexer) {
881
883
  switch (lt.type) {
882
884
  case "offset":
883
- if (type === "select")
885
+ if (type === "select") {
884
886
  throw new ParseError(lt, "Unexpected plural offset for select");
885
- if (sel.cases.length > 0)
887
+ }
888
+ if (sel.cases.length > 0) {
886
889
  throw new ParseError(lt, "Plural offset must be set before cases");
890
+ }
887
891
  sel.pluralOffset = Number(lt.value);
888
892
  ctx.text += lt.text;
889
893
  ctx.lineBreaks += lt.lineBreaks;
@@ -923,11 +927,13 @@ var require_parser = __commonJS({
923
927
  const end = this.lexer.next();
924
928
  if (!end)
925
929
  throw new ParseError(null, "Unexpected message end");
926
- if (end.type !== "end")
930
+ if (end.type !== "end") {
927
931
  throw new ParseError(end, `Unexpected lexer token: ${end.type}`);
932
+ }
928
933
  ctx.text += end.text;
929
- if (isSelectType(argType.value.toLowerCase()))
934
+ if (isSelectType(argType.value.toLowerCase())) {
930
935
  throw new ParseError(argType, `Invalid type identifier: ${argType.value}`);
936
+ }
931
937
  return {
932
938
  type: "function",
933
939
  arg: lt.value,
@@ -941,8 +947,9 @@ var require_parser = __commonJS({
941
947
  throw new ParseError(argType, msg);
942
948
  }
943
949
  let param = this.parseBody(this.strict ? false : inPlural);
944
- if (this.strict && param.length > 0)
950
+ if (this.strict && param.length > 0) {
945
951
  param = strictArgStyleParam(lt, param);
952
+ }
946
953
  return {
947
954
  type: "function",
948
955
  arg: lt.value,
@@ -952,10 +959,11 @@ var require_parser = __commonJS({
952
959
  };
953
960
  }
954
961
  case "select":
955
- if (isSelectType(argType.value))
962
+ if (isSelectType(argType.value)) {
956
963
  return this.parseSelect(lt, inPlural, ctx, argType.value);
957
- else
964
+ } else {
958
965
  throw new ParseError(argType, `Unexpected select type ${argType.value}`);
966
+ }
959
967
  default:
960
968
  throw new ParseError(argType, `Unexpected lexer token: ${argType.type}`);
961
969
  }
@@ -1002,7 +1010,6 @@ var require_parser = __commonJS({
1002
1010
  const parser = new Parser(src, options);
1003
1011
  return parser.parse();
1004
1012
  }
1005
- exports.parse = parse2;
1006
1013
  }
1007
1014
  });
1008
1015
 
@@ -1019,7 +1026,7 @@ var r = function() {
1019
1026
  }, []).join(" ");
1020
1027
  };
1021
1028
 
1022
- // node_modules/.pnpm/@warp-ds+css@2.0.0_@warp-ds+uno@2.0.0_unocss@0.62.0_postcss@8.4.41_rollup@4.20.0_vite@5.3.3_@_vyiy5vwpqfzwy5hpmfkwp3zmle/node_modules/@warp-ds/css/component-classes/index.js
1029
+ // node_modules/.pnpm/@warp-ds+css@2.1.1_@warp-ds+uno@2.1.0_unocss@0.62.0_postcss@8.5.1_rollup@4.32.1_vite@5.3.3_@t_sgrraibu65gdmqpe655kfrpl6a/node_modules/@warp-ds/css/component-classes/index.js
1023
1030
  var buttonDefaultStyling = "font-bold focusable justify-center transition-colors ease-in-out";
1024
1031
  var buttonColors = {
1025
1032
  primary: "s-text-inverted bg-[--w-color-button-primary-background] hover:bg-[--w-color-button-primary-background-hover] active:bg-[--w-color-button-primary-background-active]",
@@ -1252,18 +1259,276 @@ var attention = {
1252
1259
  import WarpElement from "@warp-ds/elements-core";
1253
1260
  import { ifDefined } from "lit/directives/if-defined.js";
1254
1261
 
1255
- // node_modules/.pnpm/@warp-ds+icons@2.4.0/node_modules/@warp-ds/icons/dist/elements/search-16.js
1262
+ // node_modules/.pnpm/@warp-ds+icons@2.5.0_@lingui+core@5.2.0_@lingui+babel-plugin-lingui-macro@5.2.0_babel-plugin-_hyhbgchrkasknlbocfng7geeci/node_modules/@warp-ds/icons/dist/elements/search-16.js
1256
1263
  import { LitElement } from "lit";
1257
1264
  import { unsafeStatic, html } from "lit/static-html.js";
1258
1265
 
1259
- // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1266
+ // node_modules/.pnpm/@lingui+core@5.2.0_@lingui+babel-plugin-lingui-macro@5.2.0_babel-plugin-macros@3.1.0_typescri_qfhfd5z2jpd4amxt2golzdalsi/node_modules/@lingui/core/dist/index.mjs
1260
1267
  var import_unraw = __toESM(require_dist(), 1);
1261
1268
 
1262
- // node_modules/.pnpm/@lingui+message-utils@4.11.2/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1269
+ // node_modules/.pnpm/@lingui+message-utils@5.2.0/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1263
1270
  var import_parser = __toESM(require_parser(), 1);
1271
+ var DateFormatError = class extends Error {
1272
+ /** @internal */
1273
+ constructor(msg, token, type) {
1274
+ super(msg);
1275
+ this.token = token;
1276
+ this.type = type || "error";
1277
+ }
1278
+ };
1279
+ var alpha = (width) => width < 4 ? "short" : width === 4 ? "long" : "narrow";
1280
+ var numeric = (width) => width % 2 === 0 ? "2-digit" : "numeric";
1281
+ function yearOptions(token, onError) {
1282
+ switch (token.char) {
1283
+ case "y":
1284
+ return { year: numeric(token.width) };
1285
+ case "r":
1286
+ return { calendar: "gregory", year: "numeric" };
1287
+ case "u":
1288
+ case "U":
1289
+ case "Y":
1290
+ default:
1291
+ onError(`${token.desc} is not supported; falling back to year:numeric`, DateFormatError.WARNING);
1292
+ return { year: "numeric" };
1293
+ }
1294
+ }
1295
+ function monthStyle(token, onError) {
1296
+ switch (token.width) {
1297
+ case 1:
1298
+ return "numeric";
1299
+ case 2:
1300
+ return "2-digit";
1301
+ case 3:
1302
+ return "short";
1303
+ case 4:
1304
+ return "long";
1305
+ case 5:
1306
+ return "narrow";
1307
+ default:
1308
+ onError(`${token.desc} is not supported with width ${token.width}`);
1309
+ return void 0;
1310
+ }
1311
+ }
1312
+ function dayStyle(token, onError) {
1313
+ const { char, desc, width } = token;
1314
+ if (char === "d") {
1315
+ return numeric(width);
1316
+ } else {
1317
+ onError(`${desc} is not supported`);
1318
+ return void 0;
1319
+ }
1320
+ }
1321
+ function weekdayStyle(token, onError) {
1322
+ const { char, desc, width } = token;
1323
+ if ((char === "c" || char === "e") && width < 3) {
1324
+ const msg = `Numeric value is not supported for ${desc}; falling back to weekday:short`;
1325
+ onError(msg, DateFormatError.WARNING);
1326
+ }
1327
+ return alpha(width);
1328
+ }
1329
+ function hourOptions(token) {
1330
+ const hour = numeric(token.width);
1331
+ let hourCycle;
1332
+ switch (token.char) {
1333
+ case "h":
1334
+ hourCycle = "h12";
1335
+ break;
1336
+ case "H":
1337
+ hourCycle = "h23";
1338
+ break;
1339
+ case "k":
1340
+ hourCycle = "h24";
1341
+ break;
1342
+ case "K":
1343
+ hourCycle = "h11";
1344
+ break;
1345
+ }
1346
+ return hourCycle ? { hour, hourCycle } : { hour };
1347
+ }
1348
+ function timeZoneNameStyle(token, onError) {
1349
+ const { char, desc, width } = token;
1350
+ switch (char) {
1351
+ case "v":
1352
+ case "z":
1353
+ return width === 4 ? "long" : "short";
1354
+ case "V":
1355
+ if (width === 4)
1356
+ return "long";
1357
+ onError(`${desc} is not supported with width ${width}`);
1358
+ return void 0;
1359
+ case "X":
1360
+ onError(`${desc} is not supported`);
1361
+ return void 0;
1362
+ }
1363
+ return "short";
1364
+ }
1365
+ function compileOptions(token, onError) {
1366
+ switch (token.field) {
1367
+ case "era":
1368
+ return { era: alpha(token.width) };
1369
+ case "year":
1370
+ return yearOptions(token, onError);
1371
+ case "month":
1372
+ return { month: monthStyle(token, onError) };
1373
+ case "day":
1374
+ return { day: dayStyle(token, onError) };
1375
+ case "weekday":
1376
+ return { weekday: weekdayStyle(token, onError) };
1377
+ case "period":
1378
+ return void 0;
1379
+ case "hour":
1380
+ return hourOptions(token);
1381
+ case "min":
1382
+ return { minute: numeric(token.width) };
1383
+ case "sec":
1384
+ return { second: numeric(token.width) };
1385
+ case "tz":
1386
+ return { timeZoneName: timeZoneNameStyle(token, onError) };
1387
+ case "quarter":
1388
+ case "week":
1389
+ case "sec-frac":
1390
+ case "ms":
1391
+ onError(`${token.desc} is not supported`);
1392
+ }
1393
+ return void 0;
1394
+ }
1395
+ function getDateFormatOptions(tokens, timeZone, onError = (error) => {
1396
+ throw error;
1397
+ }) {
1398
+ const options = {
1399
+ timeZone
1400
+ };
1401
+ const fields2 = [];
1402
+ for (const token of tokens) {
1403
+ const { error, field, str } = token;
1404
+ if (error) {
1405
+ const dte = new DateFormatError(error.message, token);
1406
+ dte.stack = error.stack;
1407
+ onError(dte);
1408
+ }
1409
+ if (str) {
1410
+ const msg = `Ignoring string part: ${str}`;
1411
+ onError(new DateFormatError(msg, token, DateFormatError.WARNING));
1412
+ }
1413
+ if (field) {
1414
+ if (fields2.indexOf(field) === -1)
1415
+ fields2.push(field);
1416
+ else
1417
+ onError(new DateFormatError(`Duplicate ${field} token`, token));
1418
+ }
1419
+ const opt = compileOptions(token, (msg, isWarning) => onError(new DateFormatError(msg, token, isWarning)));
1420
+ if (opt)
1421
+ Object.assign(options, opt);
1422
+ }
1423
+ return options;
1424
+ }
1425
+ var fields = {
1426
+ G: { field: "era", desc: "Era" },
1427
+ y: { field: "year", desc: "Year" },
1428
+ Y: { field: "year", desc: 'Year of "Week of Year"' },
1429
+ u: { field: "year", desc: "Extended year" },
1430
+ U: { field: "year", desc: "Cyclic year name" },
1431
+ r: { field: "year", desc: "Related Gregorian year" },
1432
+ Q: { field: "quarter", desc: "Quarter" },
1433
+ q: { field: "quarter", desc: "Stand-alone quarter" },
1434
+ M: { field: "month", desc: "Month in year" },
1435
+ L: { field: "month", desc: "Stand-alone month in year" },
1436
+ w: { field: "week", desc: "Week of year" },
1437
+ W: { field: "week", desc: "Week of month" },
1438
+ d: { field: "day", desc: "Day in month" },
1439
+ D: { field: "day", desc: "Day of year" },
1440
+ F: { field: "day", desc: "Day of week in month" },
1441
+ g: { field: "day", desc: "Modified julian day" },
1442
+ E: { field: "weekday", desc: "Day of week" },
1443
+ e: { field: "weekday", desc: "Local day of week" },
1444
+ c: { field: "weekday", desc: "Stand-alone local day of week" },
1445
+ a: { field: "period", desc: "AM/PM marker" },
1446
+ b: { field: "period", desc: "AM/PM/noon/midnight marker" },
1447
+ B: { field: "period", desc: "Flexible day period" },
1448
+ h: { field: "hour", desc: "Hour in AM/PM (1~12)" },
1449
+ H: { field: "hour", desc: "Hour in day (0~23)" },
1450
+ k: { field: "hour", desc: "Hour in day (1~24)" },
1451
+ K: { field: "hour", desc: "Hour in AM/PM (0~11)" },
1452
+ j: { field: "hour", desc: "Hour in preferred cycle" },
1453
+ J: { field: "hour", desc: "Hour in preferred cycle without marker" },
1454
+ C: { field: "hour", desc: "Hour in preferred cycle with flexible marker" },
1455
+ m: { field: "min", desc: "Minute in hour" },
1456
+ s: { field: "sec", desc: "Second in minute" },
1457
+ S: { field: "sec-frac", desc: "Fractional second" },
1458
+ A: { field: "ms", desc: "Milliseconds in day" },
1459
+ z: { field: "tz", desc: "Time Zone: specific non-location" },
1460
+ Z: { field: "tz", desc: "Time Zone" },
1461
+ O: { field: "tz", desc: "Time Zone: localized" },
1462
+ v: { field: "tz", desc: "Time Zone: generic non-location" },
1463
+ V: { field: "tz", desc: "Time Zone: ID" },
1464
+ X: { field: "tz", desc: "Time Zone: ISO8601 with Z" },
1465
+ x: { field: "tz", desc: "Time Zone: ISO8601" }
1466
+ };
1467
+ var isLetter = (char) => char >= "A" && char <= "Z" || char >= "a" && char <= "z";
1468
+ function readFieldToken(src, pos) {
1469
+ const char = src[pos];
1470
+ let width = 1;
1471
+ while (src[++pos] === char)
1472
+ ++width;
1473
+ const field = fields[char];
1474
+ if (!field) {
1475
+ const msg = `The letter ${char} is not a valid field identifier`;
1476
+ return { char, error: new Error(msg), width };
1477
+ }
1478
+ return { char, field: field.field, desc: field.desc, width };
1479
+ }
1480
+ function readQuotedToken(src, pos) {
1481
+ let str = src[++pos];
1482
+ let width = 2;
1483
+ if (str === "'")
1484
+ return { char: "'", str, width };
1485
+ while (true) {
1486
+ const next = src[++pos];
1487
+ ++width;
1488
+ if (next === void 0) {
1489
+ const msg = `Unterminated quoted literal in pattern: ${str || src}`;
1490
+ return { char: "'", error: new Error(msg), str, width };
1491
+ } else if (next === "'") {
1492
+ if (src[++pos] !== "'")
1493
+ return { char: "'", str, width };
1494
+ else
1495
+ ++width;
1496
+ }
1497
+ str += next;
1498
+ }
1499
+ }
1500
+ function readToken(src, pos) {
1501
+ const char = src[pos];
1502
+ if (!char)
1503
+ return null;
1504
+ if (isLetter(char))
1505
+ return readFieldToken(src, pos);
1506
+ if (char === "'")
1507
+ return readQuotedToken(src, pos);
1508
+ let str = char;
1509
+ let width = 1;
1510
+ while (true) {
1511
+ const next = src[++pos];
1512
+ if (!next || isLetter(next) || next === "'")
1513
+ return { char, str, width };
1514
+ str += next;
1515
+ width += 1;
1516
+ }
1517
+ }
1518
+ function parseDateTokens(src) {
1519
+ const tokens = [];
1520
+ let pos = 0;
1521
+ while (true) {
1522
+ const token = readToken(src, pos);
1523
+ if (!token)
1524
+ return tokens;
1525
+ tokens.push(token);
1526
+ pos += token.width;
1527
+ }
1528
+ }
1264
1529
  function processTokens(tokens, mapText) {
1265
1530
  if (!tokens.filter((token) => token.type !== "content").length) {
1266
- return tokens.map((token) => mapText(token.value)).join("");
1531
+ return tokens.map((token) => mapText(token.value));
1267
1532
  }
1268
1533
  return tokens.map((token) => {
1269
1534
  var _a;
@@ -1275,6 +1540,12 @@ function processTokens(tokens, mapText) {
1275
1540
  return [token.arg];
1276
1541
  } else if (token.type === "function") {
1277
1542
  const _param = (_a = token == null ? void 0 : token.param) == null ? void 0 : _a[0];
1543
+ if (token.key === "date" && _param) {
1544
+ const opts = compileDateExpression(_param.value.trim(), (e) => {
1545
+ throw new Error(`Unable to compile date expression: ${e.message}`);
1546
+ });
1547
+ return [token.arg, token.key, opts];
1548
+ }
1278
1549
  if (_param) {
1279
1550
  return [token.arg, token.key, _param.value.trim()];
1280
1551
  } else {
@@ -1296,6 +1567,13 @@ function processTokens(tokens, mapText) {
1296
1567
  ];
1297
1568
  });
1298
1569
  }
1570
+ function compileDateExpression(format, onError) {
1571
+ if (/^::/.test(format)) {
1572
+ const tokens = parseDateTokens(format.substring(2));
1573
+ return getDateFormatOptions(tokens, void 0, onError);
1574
+ }
1575
+ return format;
1576
+ }
1299
1577
  function compileMessage(message, mapText = (v) => v) {
1300
1578
  try {
1301
1579
  return processTokens((0, import_parser.parse)(message), mapText);
@@ -1303,11 +1581,11 @@ function compileMessage(message, mapText = (v) => v) {
1303
1581
  console.error(`${e.message}
1304
1582
 
1305
1583
  Message: ${message}`);
1306
- return message;
1584
+ return [message];
1307
1585
  }
1308
1586
  }
1309
1587
 
1310
- // node_modules/.pnpm/@lingui+core@4.11.2/node_modules/@lingui/core/dist/index.mjs
1588
+ // node_modules/.pnpm/@lingui+core@5.2.0_@lingui+babel-plugin-lingui-macro@5.2.0_babel-plugin-macros@3.1.0_typescri_qfhfd5z2jpd4amxt2golzdalsi/node_modules/@lingui/core/dist/index.mjs
1311
1589
  var isString = (s) => typeof s === "string";
1312
1590
  var isFunction = (f) => typeof f === "function";
1313
1591
  var cache = /* @__PURE__ */ new Map();
@@ -1318,12 +1596,59 @@ function normalizeLocales(locales) {
1318
1596
  }
1319
1597
  function date(locales, value, format) {
1320
1598
  const _locales = normalizeLocales(locales);
1599
+ if (!format) {
1600
+ format = "default";
1601
+ }
1602
+ let o;
1603
+ if (typeof format === "string") {
1604
+ o = {
1605
+ day: "numeric",
1606
+ month: "short",
1607
+ year: "numeric"
1608
+ };
1609
+ switch (format) {
1610
+ case "full":
1611
+ o.weekday = "long";
1612
+ case "long":
1613
+ o.month = "long";
1614
+ break;
1615
+ case "short":
1616
+ o.month = "numeric";
1617
+ break;
1618
+ }
1619
+ } else {
1620
+ o = format;
1621
+ }
1321
1622
  const formatter = getMemoized(
1322
1623
  () => cacheKey("date", _locales, format),
1323
- () => new Intl.DateTimeFormat(_locales, format)
1624
+ () => new Intl.DateTimeFormat(_locales, o)
1324
1625
  );
1325
1626
  return formatter.format(isString(value) ? new Date(value) : value);
1326
1627
  }
1628
+ function time(locales, value, format) {
1629
+ let o;
1630
+ if (!format) {
1631
+ format = "default";
1632
+ }
1633
+ if (typeof format === "string") {
1634
+ o = {
1635
+ second: "numeric",
1636
+ minute: "numeric",
1637
+ hour: "numeric"
1638
+ };
1639
+ switch (format) {
1640
+ case "full":
1641
+ case "long":
1642
+ o.timeZoneName = "short";
1643
+ break;
1644
+ case "short":
1645
+ delete o.second;
1646
+ }
1647
+ } else {
1648
+ o = format;
1649
+ }
1650
+ return date(locales, value, o);
1651
+ }
1327
1652
  function number(locales, value, format) {
1328
1653
  const _locales = normalizeLocales(locales);
1329
1654
  const formatter = getMemoized(
@@ -1358,12 +1683,14 @@ function cacheKey(type, locales, options) {
1358
1683
  const localeKey = locales.join("-");
1359
1684
  return `${type}-${localeKey}-${JSON.stringify(options)}`;
1360
1685
  }
1361
- var UNICODE_REGEX = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;
1686
+ var UNICODE_REGEX = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/;
1362
1687
  var OCTOTHORPE_PH = "%__lingui_octothorpe__%";
1363
1688
  var getDefaultFormats = (locale, passedLocales, formats = {}) => {
1364
1689
  const locales = passedLocales || locale;
1365
1690
  const style = (format) => {
1366
- return typeof format === "object" ? format : formats[format] || { style: format };
1691
+ if (typeof format === "object")
1692
+ return format;
1693
+ return formats[format];
1367
1694
  };
1368
1695
  const replaceOctothorpe = (value, message) => {
1369
1696
  const numberFormat = Object.keys(formats).length ? style("number") : void 0;
@@ -1382,8 +1709,13 @@ var getDefaultFormats = (locale, passedLocales, formats = {}) => {
1382
1709
  return replaceOctothorpe(value - offset, message);
1383
1710
  },
1384
1711
  select: selectFormatter,
1385
- number: (value, format) => number(locales, value, style(format)),
1386
- date: (value, format) => date(locales, value, style(format))
1712
+ number: (value, format) => number(
1713
+ locales,
1714
+ value,
1715
+ style(format) || { style: format }
1716
+ ),
1717
+ date: (value, format) => date(locales, value, style(format) || format),
1718
+ time: (value, format) => time(locales, value, style(format) || format)
1387
1719
  };
1388
1720
  };
1389
1721
  var selectFormatter = (value, rules) => {
@@ -1432,10 +1764,10 @@ function interpolate(translation, locale, locales) {
1432
1764
  };
1433
1765
  const result = formatMessage(translation);
1434
1766
  if (isString(result) && UNICODE_REGEX.test(result)) {
1435
- return (0, import_unraw.unraw)(result.trim());
1767
+ return (0, import_unraw.unraw)(result);
1436
1768
  }
1437
1769
  if (isString(result))
1438
- return result.trim();
1770
+ return result;
1439
1771
  return result ? String(result) : "";
1440
1772
  };
1441
1773
  }
@@ -1490,7 +1822,11 @@ var I18n = class extends EventEmitter {
1490
1822
  __publicField2(this, "_localeData", {});
1491
1823
  __publicField2(this, "_messages", {});
1492
1824
  __publicField2(this, "_missing");
1825
+ __publicField2(this, "_messageCompiler");
1493
1826
  __publicField2(this, "t", this._.bind(this));
1827
+ if (true) {
1828
+ this.setMessagesCompiler(compileMessage);
1829
+ }
1494
1830
  if (params.missing != null)
1495
1831
  this._missing = params.missing;
1496
1832
  if (params.messages != null)
@@ -1526,12 +1862,30 @@ var I18n = class extends EventEmitter {
1526
1862
  Object.assign(maybeLocaleData, localeData);
1527
1863
  }
1528
1864
  }
1865
+ /**
1866
+ * Registers a `MessageCompiler` to enable the use of uncompiled catalogs at runtime.
1867
+ *
1868
+ * In production builds, the `MessageCompiler` is typically excluded to reduce bundle size.
1869
+ * By default, message catalogs should be precompiled during the build process. However,
1870
+ * if you need to compile catalogs at runtime, you can use this method to set a message compiler.
1871
+ *
1872
+ * Example usage:
1873
+ *
1874
+ * ```ts
1875
+ * import { compileMessage } from "@lingui/message-utils/compileMessage";
1876
+ *
1877
+ * i18n.setMessagesCompiler(compileMessage);
1878
+ * ```
1879
+ */
1880
+ setMessagesCompiler(compiler) {
1881
+ this._messageCompiler = compiler;
1882
+ return this;
1883
+ }
1529
1884
  /**
1530
1885
  * @deprecated Plurals automatically used from Intl.PluralRules you can safely remove this call. Deprecated in v4
1531
1886
  */
1532
- // @ts-ignore deprecated, so ignore the reported error
1533
1887
  loadLocaleData(localeOrAllData, localeData) {
1534
- if (localeData != null) {
1888
+ if (typeof localeOrAllData === "string") {
1535
1889
  this._loadLocaleData(localeOrAllData, localeData);
1536
1890
  } else {
1537
1891
  Object.keys(localeOrAllData).forEach(
@@ -1578,6 +1932,11 @@ var I18n = class extends EventEmitter {
1578
1932
  this.emit("change");
1579
1933
  }
1580
1934
  _(id, values, options) {
1935
+ if (!this.locale) {
1936
+ throw new Error(
1937
+ "Lingui: Attempted to call a translation function without setting a locale.\nMake sure to call `i18n.activate(locale)` before using Lingui functions.\nThis issue may also occur due to a race condition in your initialization logic."
1938
+ );
1939
+ }
1581
1940
  let message = options == null ? void 0 : options.message;
1582
1941
  if (!id) {
1583
1942
  id = "";
@@ -1597,8 +1956,20 @@ var I18n = class extends EventEmitter {
1597
1956
  this.emit("missing", { id, locale: this._locale });
1598
1957
  }
1599
1958
  let translation = messageForId || message || id;
1600
- if (true) {
1601
- translation = isString(translation) ? compileMessage(translation) : translation;
1959
+ if (isString(translation)) {
1960
+ if (this._messageCompiler) {
1961
+ translation = this._messageCompiler(translation);
1962
+ } else {
1963
+ console.warn(`Uncompiled message detected! Message:
1964
+
1965
+ > ${translation}
1966
+
1967
+ That means you use raw catalog or your catalog doesn't have a translation for the message and fallback was used.
1968
+ ICU features such as interpolation and plurals will not work properly for that message.
1969
+
1970
+ Please compile your catalog first.
1971
+ `);
1972
+ }
1602
1973
  }
1603
1974
  if (isString(translation) && UNICODE_REGEX.test(translation))
1604
1975
  return JSON.parse(`"${translation}"`);
@@ -1622,12 +1993,12 @@ function setupI18n(params = {}) {
1622
1993
  }
1623
1994
  var i18n = setupI18n();
1624
1995
 
1625
- // node_modules/.pnpm/@warp-ds+icons@2.4.0/node_modules/@warp-ds/icons/dist/elements/search-16.js
1626
- var messages = JSON.parse('{"icon.title.search":"Forst\xF8rrelsesglass"}');
1627
- var messages2 = JSON.parse('{"icon.title.search":"Magnifying glass"}');
1628
- var messages3 = JSON.parse('{"icon.title.search":"Suurennuslasi"}');
1629
- var messages4 = JSON.parse('{"icon.title.search":"Forst\xF8rrelsesglas"}');
1630
- var messages5 = JSON.parse('{"icon.title.search":"F\xF6rstoringsglas"}');
1996
+ // node_modules/.pnpm/@warp-ds+icons@2.5.0_@lingui+core@5.2.0_@lingui+babel-plugin-lingui-macro@5.2.0_babel-plugin-_hyhbgchrkasknlbocfng7geeci/node_modules/@warp-ds/icons/dist/elements/search-16.js
1997
+ var messages = JSON.parse('{"icon.title.search":["Forst\xF8rrelsesglass"]}');
1998
+ var messages2 = JSON.parse('{"icon.title.search":["Magnifying glass"]}');
1999
+ var messages3 = JSON.parse('{"icon.title.search":["Suurennuslasi"]}');
2000
+ var messages4 = JSON.parse('{"icon.title.search":["Forst\xF8rrelsesglas"]}');
2001
+ var messages5 = JSON.parse('{"icon.title.search":["F\xF6rstoringsglas"]}');
1631
2002
  var supportedLocales = ["en", "nb", "fi", "da", "sv"];
1632
2003
  var defaultLocale2 = "en";
1633
2004
  var detectByBrand = () => {
@@ -1714,14 +2085,14 @@ if (!customElements.get("w-icon-search-16")) {
1714
2085
  customElements.define("w-icon-search-16", IconSearch16);
1715
2086
  }
1716
2087
 
1717
- // node_modules/.pnpm/@warp-ds+icons@2.4.0/node_modules/@warp-ds/icons/dist/elements/close-16.js
2088
+ // node_modules/.pnpm/@warp-ds+icons@2.5.0_@lingui+core@5.2.0_@lingui+babel-plugin-lingui-macro@5.2.0_babel-plugin-_hyhbgchrkasknlbocfng7geeci/node_modules/@warp-ds/icons/dist/elements/close-16.js
1718
2089
  import { LitElement as LitElement2 } from "lit";
1719
2090
  import { unsafeStatic as unsafeStatic2, html as html2 } from "lit/static-html.js";
1720
- var messages6 = JSON.parse('{"icon.title.close":"Kryss"}');
1721
- var messages22 = JSON.parse('{"icon.title.close":"Cross"}');
1722
- var messages32 = JSON.parse('{"icon.title.close":"Rasti"}');
1723
- var messages42 = JSON.parse('{"icon.title.close":"Kryds"}');
1724
- var messages52 = JSON.parse('{"icon.title.close":"Kryss"}');
2091
+ var messages6 = JSON.parse('{"icon.title.close":["Kryss"]}');
2092
+ var messages22 = JSON.parse('{"icon.title.close":["Cross"]}');
2093
+ var messages32 = JSON.parse('{"icon.title.close":["Rasti"]}');
2094
+ var messages42 = JSON.parse('{"icon.title.close":["Kryds"]}');
2095
+ var messages52 = JSON.parse('{"icon.title.close":["Kryss"]}');
1725
2096
  var supportedLocales2 = ["en", "nb", "fi", "da", "sv"];
1726
2097
  var defaultLocale3 = "en";
1727
2098
  var detectByBrand2 = () => {