@warp-ds/elements 1.4.0 → 1.4.1-next.1

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.
@@ -1029,334 +1029,383 @@ var require_parser = __commonJS({
1029
1029
 
1030
1030
  // packages/attention/index.js
1031
1031
  import { css, html as html2, nothing } from "lit";
1032
- import WarpElement from "@warp-ds/elements-core";
1033
- import { ifDefined } from "lit/directives/if-defined.js";
1034
1032
 
1035
- // packages/utils/index.js
1036
- import { classMap } from "lit/directives/class-map.js";
1037
- var camelCaseToKebabCase = (str) => str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
1038
- function kebabCaseAttributes(constructor) {
1039
- return class extends constructor {
1040
- static createProperty(name, options) {
1041
- let customOptions = options;
1042
- if (typeof (options == null ? void 0 : options.attribute) === "undefined" || (options == null ? void 0 : options.attribute) === true) {
1043
- customOptions = Object.assign({}, options, {
1044
- attribute: camelCaseToKebabCase(name.toString())
1045
- });
1033
+ // node_modules/.pnpm/@lingui+core@4.7.1/node_modules/@lingui/core/dist/index.mjs
1034
+ var import_unraw = __toESM(require_dist(), 1);
1035
+
1036
+ // node_modules/.pnpm/@lingui+message-utils@4.7.1/node_modules/@lingui/message-utils/dist/compileMessage.mjs
1037
+ var import_parser = __toESM(require_parser(), 1);
1038
+ function processTokens(tokens, mapText) {
1039
+ if (!tokens.filter((token) => token.type !== "content").length) {
1040
+ return tokens.map((token) => mapText(token.value)).join("");
1041
+ }
1042
+ return tokens.map((token) => {
1043
+ var _a;
1044
+ if (token.type === "content") {
1045
+ return mapText(token.value);
1046
+ } else if (token.type === "octothorpe") {
1047
+ return "#";
1048
+ } else if (token.type === "argument") {
1049
+ return [token.arg];
1050
+ } else if (token.type === "function") {
1051
+ const _param = (_a = token == null ? void 0 : token.param) == null ? void 0 : _a[0];
1052
+ if (_param) {
1053
+ return [token.arg, token.key, _param.value.trim()];
1054
+ } else {
1055
+ return [token.arg, token.key];
1046
1056
  }
1047
- super.createProperty(name, customOptions);
1048
1057
  }
1049
- };
1058
+ const offset2 = token.pluralOffset;
1059
+ const formatProps = {};
1060
+ token.cases.forEach((item) => {
1061
+ formatProps[item.key.replace(/^=(.)+/, "$1")] = processTokens(
1062
+ item.tokens,
1063
+ mapText
1064
+ );
1065
+ });
1066
+ return [
1067
+ token.arg,
1068
+ token.type,
1069
+ __spreadValues({
1070
+ offset: offset2
1071
+ }, formatProps)
1072
+ ];
1073
+ });
1050
1074
  }
1051
- function classes(defn) {
1052
- const classes2 = [];
1053
- for (const [key, value] of Object.entries(defn)) {
1054
- if (value)
1055
- classes2.push(key);
1075
+ function compileMessage(message, mapText = (v) => v) {
1076
+ try {
1077
+ return processTokens((0, import_parser.parse)(message), mapText);
1078
+ } catch (e) {
1079
+ console.error(`${e.message}
1080
+
1081
+ Message: ${message}`);
1082
+ return message;
1056
1083
  }
1057
- return classes2.join(" ");
1058
- }
1059
- function generateRandomId() {
1060
- return `m${Math.random().toString(36).slice(2)}`;
1061
1084
  }
1062
1085
 
1063
- // node_modules/.pnpm/@warp-ds+css@1.9.6/node_modules/@warp-ds/css/component-classes/index.js
1064
- var box = {
1065
- box: "group block relative break-words last-child:mb-0 p-16 rounded-8",
1066
- // Relative here enables w-clickable
1067
- bleed: "-mx-16 sm:mx-0 rounded-l-0 rounded-r-0 sm:rounded-8",
1068
- // We target L and R to override the default rounded-8
1069
- info: "s-bg-info-subtle",
1070
- neutral: "s-surface-sunken",
1071
- bordered: "border-2 s-border s-bg",
1072
- infoClickable: "hover:s-bg-info-subtle-hover active:s-bg-info-subtle-active",
1073
- // Deprecated - Remove in v2 (after removing Clickable prop in the Box components)
1074
- neutralClickable: "hover:s-bg-hover active:s-bg-active",
1075
- // Deprecated - Remove in v2 (after removing Clickable prop in the Box components)
1076
- borderedClickable: "hover:s-bg-hover active:s-bg-active hover:s-border-hover active:s-border-active"
1077
- // Deprecated - Remove in v2 (after removing Clickable prop in the Box components)
1086
+ // node_modules/.pnpm/@lingui+core@4.7.1/node_modules/@lingui/core/dist/index.mjs
1087
+ var isString = (s) => typeof s === "string";
1088
+ var isFunction = (f) => typeof f === "function";
1089
+ var cache = /* @__PURE__ */ new Map();
1090
+ var defaultLocale = "en";
1091
+ function normalizeLocales(locales) {
1092
+ const out = Array.isArray(locales) ? locales : [locales];
1093
+ return [...out, defaultLocale];
1094
+ }
1095
+ function date(locales, value, format) {
1096
+ const _locales = normalizeLocales(locales);
1097
+ const formatter = getMemoized(
1098
+ () => cacheKey("date", _locales, format),
1099
+ () => new Intl.DateTimeFormat(_locales, format)
1100
+ );
1101
+ return formatter.format(isString(value) ? new Date(value) : value);
1102
+ }
1103
+ function number(locales, value, format) {
1104
+ const _locales = normalizeLocales(locales);
1105
+ const formatter = getMemoized(
1106
+ () => cacheKey("number", _locales, format),
1107
+ () => new Intl.NumberFormat(_locales, format)
1108
+ );
1109
+ return formatter.format(value);
1110
+ }
1111
+ function plural(locales, ordinal, value, _a) {
1112
+ var _b = _a, { offset: offset2 = 0 } = _b, rules = __objRest(_b, ["offset"]);
1113
+ var _a2, _b2;
1114
+ const _locales = normalizeLocales(locales);
1115
+ const plurals = ordinal ? getMemoized(
1116
+ () => cacheKey("plural-ordinal", _locales),
1117
+ () => new Intl.PluralRules(_locales, { type: "ordinal" })
1118
+ ) : getMemoized(
1119
+ () => cacheKey("plural-cardinal", _locales),
1120
+ () => new Intl.PluralRules(_locales, { type: "cardinal" })
1121
+ );
1122
+ return (_b2 = (_a2 = rules[value]) != null ? _a2 : rules[plurals.select(value - offset2)]) != null ? _b2 : rules.other;
1123
+ }
1124
+ function getMemoized(getKey, construct) {
1125
+ const key = getKey();
1126
+ let formatter = cache.get(key);
1127
+ if (!formatter) {
1128
+ formatter = construct();
1129
+ cache.set(key, formatter);
1130
+ }
1131
+ return formatter;
1132
+ }
1133
+ function cacheKey(type, locales, options) {
1134
+ const localeKey = locales.join("-");
1135
+ return `${type}-${localeKey}-${JSON.stringify(options)}`;
1136
+ }
1137
+ var UNICODE_REGEX = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;
1138
+ var OCTOTHORPE_PH = "%__lingui_octothorpe__%";
1139
+ var getDefaultFormats = (locale, passedLocales, formats = {}) => {
1140
+ const locales = passedLocales || locale;
1141
+ const style = (format) => {
1142
+ return typeof format === "object" ? format : formats[format] || { style: format };
1143
+ };
1144
+ const replaceOctothorpe = (value, message) => {
1145
+ const numberFormat = Object.keys(formats).length ? style("number") : void 0;
1146
+ const valueStr = number(locales, value, numberFormat);
1147
+ return message.replace(new RegExp(OCTOTHORPE_PH, "g"), valueStr);
1148
+ };
1149
+ return {
1150
+ plural: (value, cases) => {
1151
+ const { offset: offset2 = 0 } = cases;
1152
+ const message = plural(locales, false, value, cases);
1153
+ return replaceOctothorpe(value - offset2, message);
1154
+ },
1155
+ selectordinal: (value, cases) => {
1156
+ const { offset: offset2 = 0 } = cases;
1157
+ const message = plural(locales, true, value, cases);
1158
+ return replaceOctothorpe(value - offset2, message);
1159
+ },
1160
+ select: selectFormatter,
1161
+ number: (value, format) => number(locales, value, style(format)),
1162
+ date: (value, format) => date(locales, value, style(format))
1163
+ };
1078
1164
  };
1079
- var buttonReset = "focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 p-0 inline-block";
1080
- var expandable = {
1081
- expandable: "will-change-height",
1082
- expandableTitle: "font-bold s-text",
1083
- expandableBox: "s-surface-sunken hover:s-bg-hover active:s-bg-active py-0 px-0 " + box.box,
1084
- expandableInfo: "s-bg-info-subtle! hover:s-bg-info-subtle-hover!",
1085
- expandableBleed: box.bleed,
1086
- chevron: "inline-block align-middle s-icon",
1087
- chevronNonBox: "ml-8",
1088
- chevronBox: "",
1089
- chevronTransform: "transform transition-transform transform-gpu ease-in-out",
1090
- chevronExpand: "-rotate-180",
1091
- chevronCollapse: "rotate-180",
1092
- elementsTransformChevronDownPart: "part-[w-icon-chevron-down-16-part]:transform part-[w-icon-chevron-down-16-part]:transition-transform part-[w-icon-chevron-down-16-part]:transform-gpu part-[w-icon-chevron-down-16-part]:ease-in-out",
1093
- elementsChevronDownExpandPart: "part-[w-icon-chevron-down-16-part]:-rotate-180",
1094
- elementsTransformChevronUpPart: "part-[w-icon-chevron-up-16-part]:transform part-[w-icon-chevron-up-16-part]:transition-transform part-[w-icon-chevron-up-16-part]:transform-gpu part-[w-icon-chevron-up-16-part]:ease-in-out",
1095
- elementsChevronUpCollapsePart: "part-[w-icon-chevron-up-16-part]:rotate-180",
1096
- expansion: "overflow-hidden",
1097
- expansionNotExpanded: "h-0 invisible",
1098
- button: buttonReset + " hover:underline focus-visible:underline",
1099
- buttonBox: "w-full text-left relative inline-flex items-center justify-between " + box.box,
1100
- paddingTop: "pt-0",
1101
- title: "flex w-full justify-between items-center",
1102
- titleType: "h4"
1165
+ var selectFormatter = (value, rules) => {
1166
+ var _a;
1167
+ return (_a = rules[value]) != null ? _a : rules.other;
1103
1168
  };
1104
- var buttonDefaultStyling = "font-bold focusable justify-center transition-colors ease-in-out";
1105
- var buttonColors = {
1106
- 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]",
1107
- secondary: "s-text-link s-border s-bg hover:s-bg-hover hover:s-border-hover active:s-bg-active",
1108
- utility: "s-text s-bg hover:s-bg-hover active:s-bg-active s-border hover:s-border-hover active:s-border-active",
1109
- destructive: "s-bg-negative s-text-inverted hover:s-bg-negative-hover active:s-bg-negative-active",
1110
- pill: "s-icon hover:s-icon-hover active:s-icon-active bg-transparent hover:bg-[--w-color-button-pill-background-hover] active:bg-[--w-color-button-pill-background-active]",
1111
- disabled: "s-text-inverted s-bg-disabled",
1112
- quiet: "bg-transparent s-text-link hover:s-bg-hover active:s-bg-active",
1113
- utilityQuiet: "s-text bg-transparent hover:s-bg-hover active:s-bg-active",
1114
- negativeQuiet: "bg-transparent s-text-negative hover:s-bg-negative-subtle-hover active:s-bg-negative-subtle-active",
1115
- loading: "s-text s-bg-subtle",
1116
- link: "s-text-link"
1169
+ function interpolate(translation, locale, locales) {
1170
+ return (values = {}, formats) => {
1171
+ const formatters = getDefaultFormats(locale, locales, formats);
1172
+ const formatMessage = (tokens) => {
1173
+ if (!Array.isArray(tokens))
1174
+ return tokens;
1175
+ return tokens.reduce((message, token) => {
1176
+ if (token === "#") {
1177
+ return message + OCTOTHORPE_PH;
1178
+ }
1179
+ if (isString(token)) {
1180
+ return message + token;
1181
+ }
1182
+ const [name, type, format] = token;
1183
+ let interpolatedFormat = {};
1184
+ if (type === "plural" || type === "selectordinal" || type === "select") {
1185
+ Object.entries(format).forEach(
1186
+ ([key, value2]) => {
1187
+ interpolatedFormat[key] = formatMessage(value2);
1188
+ }
1189
+ );
1190
+ } else {
1191
+ interpolatedFormat = format;
1192
+ }
1193
+ let value;
1194
+ if (type) {
1195
+ const formatter = formatters[type];
1196
+ value = formatter(values[name], interpolatedFormat);
1197
+ } else {
1198
+ value = values[name];
1199
+ }
1200
+ if (value == null) {
1201
+ return message;
1202
+ }
1203
+ return message + value;
1204
+ }, "");
1205
+ };
1206
+ const result = formatMessage(translation);
1207
+ if (isString(result) && UNICODE_REGEX.test(result)) {
1208
+ return (0, import_unraw.unraw)(result.trim());
1209
+ }
1210
+ if (isString(result))
1211
+ return result.trim();
1212
+ return result ? String(result) : "";
1213
+ };
1214
+ }
1215
+ var __defProp$1 = Object.defineProperty;
1216
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1217
+ var __publicField$1 = (obj, key, value) => {
1218
+ __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
1219
+ return value;
1117
1220
  };
1118
- var buttonTypes = {
1119
- primary: `border-0 rounded-8 ${buttonDefaultStyling}`,
1120
- secondary: `border-2 rounded-8 ${buttonDefaultStyling}`,
1121
- utility: `border rounded-4 ${buttonDefaultStyling}`,
1122
- negative: `border-0 rounded-8 ${buttonDefaultStyling}`,
1123
- pill: `p-4 rounded-full border-0 inline-flex items-center justify-center hover:bg-clip-padding ${buttonDefaultStyling}`,
1124
- link: `bg-transparent focusable ease-in-out inline active:underline hover:underline focus:underline ${buttonColors.link}`
1221
+ var EventEmitter = class {
1222
+ constructor() {
1223
+ __publicField$1(this, "_events", {});
1224
+ }
1225
+ on(event, listener) {
1226
+ var _a2;
1227
+ var _a;
1228
+ (_a2 = (_a = this._events)[event]) != null ? _a2 : _a[event] = [];
1229
+ this._events[event].push(listener);
1230
+ return () => this.removeListener(event, listener);
1231
+ }
1232
+ removeListener(event, listener) {
1233
+ const maybeListeners = this._getListeners(event);
1234
+ if (!maybeListeners)
1235
+ return;
1236
+ const index = maybeListeners.indexOf(listener);
1237
+ if (~index)
1238
+ maybeListeners.splice(index, 1);
1239
+ }
1240
+ emit(event, ...args) {
1241
+ const maybeListeners = this._getListeners(event);
1242
+ if (!maybeListeners)
1243
+ return;
1244
+ maybeListeners.map((listener) => listener.apply(this, args));
1245
+ }
1246
+ _getListeners(event) {
1247
+ const maybeListeners = this._events[event];
1248
+ return Array.isArray(maybeListeners) ? maybeListeners : false;
1249
+ }
1125
1250
  };
1126
- var buttonSizes = {
1127
- xsmall: "py-6 px-16",
1128
- small: "py-8 px-16",
1129
- medium: "py-10 px-14",
1130
- large: "py-12 px-16",
1131
- utility: "py-[11px] px-[15px]",
1132
- smallUtility: "py-[7px] px-[15px]",
1133
- pill: "min-h-[44px] min-w-[44px]",
1134
- pillSmall: "min-h-32 min-w-32",
1135
- link: "p-0"
1251
+ var __defProp2 = Object.defineProperty;
1252
+ var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
1253
+ var __publicField2 = (obj, key, value) => {
1254
+ __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
1255
+ return value;
1136
1256
  };
1137
- var buttonTextSizes = {
1138
- medium: "text-m leading-[24]",
1139
- xsmall: "text-xs"
1257
+ var I18n = class extends EventEmitter {
1258
+ constructor(params) {
1259
+ var _a;
1260
+ super();
1261
+ __publicField2(this, "_locale", "");
1262
+ __publicField2(this, "_locales");
1263
+ __publicField2(this, "_localeData", {});
1264
+ __publicField2(this, "_messages", {});
1265
+ __publicField2(this, "_missing");
1266
+ __publicField2(this, "t", this._.bind(this));
1267
+ if (params.missing != null)
1268
+ this._missing = params.missing;
1269
+ if (params.messages != null)
1270
+ this.load(params.messages);
1271
+ if (params.localeData != null)
1272
+ this.loadLocaleData(params.localeData);
1273
+ if (typeof params.locale === "string" || params.locales) {
1274
+ this.activate((_a = params.locale) != null ? _a : defaultLocale, params.locales);
1275
+ }
1276
+ }
1277
+ get locale() {
1278
+ return this._locale;
1279
+ }
1280
+ get locales() {
1281
+ return this._locales;
1282
+ }
1283
+ get messages() {
1284
+ var _a;
1285
+ return (_a = this._messages[this._locale]) != null ? _a : {};
1286
+ }
1287
+ /**
1288
+ * @deprecated this has no effect. Please remove this from the code. Deprecated in v4
1289
+ */
1290
+ get localeData() {
1291
+ var _a;
1292
+ return (_a = this._localeData[this._locale]) != null ? _a : {};
1293
+ }
1294
+ _loadLocaleData(locale, localeData) {
1295
+ const maybeLocaleData = this._localeData[locale];
1296
+ if (!maybeLocaleData) {
1297
+ this._localeData[locale] = localeData;
1298
+ } else {
1299
+ Object.assign(maybeLocaleData, localeData);
1300
+ }
1301
+ }
1302
+ /**
1303
+ * @deprecated Plurals automatically used from Intl.PluralRules you can safely remove this call. Deprecated in v4
1304
+ */
1305
+ // @ts-ignore deprecated, so ignore the reported error
1306
+ loadLocaleData(localeOrAllData, localeData) {
1307
+ if (localeData != null) {
1308
+ this._loadLocaleData(localeOrAllData, localeData);
1309
+ } else {
1310
+ Object.keys(localeOrAllData).forEach(
1311
+ (locale) => this._loadLocaleData(locale, localeOrAllData[locale])
1312
+ );
1313
+ }
1314
+ this.emit("change");
1315
+ }
1316
+ _load(locale, messages5) {
1317
+ const maybeMessages = this._messages[locale];
1318
+ if (!maybeMessages) {
1319
+ this._messages[locale] = messages5;
1320
+ } else {
1321
+ Object.assign(maybeMessages, messages5);
1322
+ }
1323
+ }
1324
+ load(localeOrMessages, messages5) {
1325
+ if (typeof localeOrMessages == "string" && typeof messages5 === "object") {
1326
+ this._load(localeOrMessages, messages5);
1327
+ } else {
1328
+ Object.entries(localeOrMessages).forEach(
1329
+ ([locale, messages23]) => this._load(locale, messages23)
1330
+ );
1331
+ }
1332
+ this.emit("change");
1333
+ }
1334
+ /**
1335
+ * @param options {@link LoadAndActivateOptions}
1336
+ */
1337
+ loadAndActivate({ locale, locales, messages: messages5 }) {
1338
+ this._locale = locale;
1339
+ this._locales = locales || void 0;
1340
+ this._messages[this._locale] = messages5;
1341
+ this.emit("change");
1342
+ }
1343
+ activate(locale, locales) {
1344
+ if (true) {
1345
+ if (!this._messages[locale]) {
1346
+ console.warn(`Messages for locale "${locale}" not loaded.`);
1347
+ }
1348
+ }
1349
+ this._locale = locale;
1350
+ this._locales = locales;
1351
+ this.emit("change");
1352
+ }
1353
+ _(id, values, options) {
1354
+ let message = options == null ? void 0 : options.message;
1355
+ if (!isString(id)) {
1356
+ values = id.values || values;
1357
+ message = id.message;
1358
+ id = id.id;
1359
+ }
1360
+ const messageForId = this.messages[id];
1361
+ const messageMissing = messageForId === void 0;
1362
+ const missing = this._missing;
1363
+ if (missing && messageMissing) {
1364
+ return isFunction(missing) ? missing(this._locale, id) : missing;
1365
+ }
1366
+ if (messageMissing) {
1367
+ this.emit("missing", { id, locale: this._locale });
1368
+ }
1369
+ let translation = messageForId || message || id;
1370
+ if (true) {
1371
+ translation = isString(translation) ? compileMessage(translation) : translation;
1372
+ }
1373
+ if (isString(translation) && UNICODE_REGEX.test(translation))
1374
+ return JSON.parse(`"${translation}"`);
1375
+ if (isString(translation))
1376
+ return translation;
1377
+ return interpolate(
1378
+ translation,
1379
+ this._locale,
1380
+ this._locales
1381
+ )(values, options == null ? void 0 : options.formats);
1382
+ }
1383
+ date(value, format) {
1384
+ return date(this._locales || this._locale, value, format);
1385
+ }
1386
+ number(value, format) {
1387
+ return number(this._locales || this._locale, value, format);
1388
+ }
1140
1389
  };
1141
- var buttonVariants = {
1142
- inProgress: `border-transparent animate-inprogress pointer-events-none ${buttonColors.loading}`,
1143
- // .button--in-progress, a.button--in-progress:visited
1144
- quiet: `border-0 rounded-8 ${buttonDefaultStyling}`,
1145
- utilityQuiet: `border-0 rounded-4 ${buttonDefaultStyling}`,
1146
- negativeQuiet: `border-0 rounded-8 ${buttonDefaultStyling}`,
1147
- isDisabled: `font-bold justify-center transition-colors ease-in-out cursor-default pointer-events-none ${buttonColors.disabled}`
1148
- // .button:disabled, .button--is-disabled
1149
- };
1150
- var button = {
1151
- // Buttontypes
1152
- secondary: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonColors.secondary}`,
1153
- // .button--secondary, .button--default, .button
1154
- secondaryHref: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonColors.secondary}`,
1155
- secondaryDisabled: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonVariants.isDisabled}`,
1156
- secondarySmall: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonTypes.secondary} ${buttonColors.secondary}`,
1157
- secondarySmallDisabled: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonTypes.secondary} ${buttonVariants.isDisabled}`,
1158
- secondaryQuiet: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonColors.quiet}`,
1159
- secondaryQuietDisabled: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
1160
- secondarySmallQuiet: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonVariants.quiet} ${buttonColors.quiet}`,
1161
- secondarySmallQuietDisabled: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
1162
- secondaryLoading: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonVariants.inProgress}`,
1163
- secondarySmallLoading: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonTypes.secondary} ${buttonVariants.inProgress}`,
1164
- secondarySmallQuietLoading: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.inProgress}`,
1165
- secondaryQuietLoading: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.inProgress}`,
1166
- primary: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.primary} ${buttonColors.primary}`,
1167
- // .button--primary, .button--cta
1168
- primaryDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.isDisabled} ${buttonTypes.primary}`,
1169
- primarySmall: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonTypes.primary} ${buttonColors.primary}`,
1170
- primarySmallDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.isDisabled} ${buttonTypes.primary} `,
1171
- primaryQuiet: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonColors.quiet}`,
1172
- primaryQuietDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
1173
- primarySmallQuiet: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.quiet} ${buttonColors.quiet}`,
1174
- primarySmallQuietDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
1175
- primaryLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.inProgress} ${buttonTypes.primary}`,
1176
- primarySmallLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.inProgress} ${buttonTypes.primary}`,
1177
- primarySmallQuietLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.inProgress} ${buttonTypes.primary}`,
1178
- primaryQuietLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.inProgress}`,
1179
- utility: `${buttonSizes.utility} ${buttonTextSizes.medium} ${buttonTypes.utility} ${buttonColors.utility}`,
1180
- // .button--utility
1181
- utilityDisabled: `${buttonSizes.utility} ${buttonTextSizes.medium} ${buttonTypes.utility} ${buttonVariants.isDisabled}`,
1182
- utilityQuiet: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.utilityQuiet} ${buttonColors.utilityQuiet}`,
1183
- // .button--utility-flat
1184
- utilityQuietDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.utilityQuiet} ${buttonVariants.isDisabled}`,
1185
- utilitySmall: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonTypes.utility} ${buttonColors.utility}`,
1186
- utilitySmallDisabled: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonTypes.utility} ${buttonVariants.isDisabled}`,
1187
- utilitySmallQuiet: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonVariants.utilityQuiet} ${buttonColors.utilityQuiet}`,
1188
- utilitySmallQuietDisabled: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonVariants.utilityQuiet} ${buttonVariants.isDisabled}`,
1189
- utilityLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.utility} ${buttonVariants.inProgress}`,
1190
- utilitySmallLoading: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonTypes.utility} ${buttonVariants.inProgress}`,
1191
- utilityQuietLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.inProgress} ${buttonVariants.utilityQuiet}`,
1192
- utilitySmallQuietLoading: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonVariants.inProgress} ${buttonVariants.utilityQuiet}`,
1193
- negative: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.negative} ${buttonColors.destructive}`,
1194
- // .button--destructive
1195
- negativeDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.negative} ${buttonVariants.isDisabled}`,
1196
- negativeQuiet: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.negativeQuiet} ${buttonColors.negativeQuiet}`,
1197
- // .button--destructive-flat
1198
- negativeQuietDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.negativeQuiet}${buttonVariants.isDisabled}`,
1199
- negativeSmall: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonTypes.negative} ${buttonColors.destructive}`,
1200
- negativeSmallDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonTypes.negative} ${buttonVariants.isDisabled}`,
1201
- negativeSmallQuiet: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.negativeQuiet} ${buttonColors.negativeQuiet}`,
1202
- negativeSmallQuietDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.negativeQuiet} ${buttonVariants.isDisabled}`,
1203
- negativeLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.negative} ${buttonVariants.inProgress}`,
1204
- negativeSmallLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.inProgress} ${buttonTypes.negative}`,
1205
- negativeQuietLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.negativeQuiet} ${buttonTypes.negative} ${buttonVariants.inProgress}`,
1206
- negativeSmallQuietLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.negativeQuiet} ${buttonVariants.inProgress}`,
1207
- pill: `${buttonSizes.pill} ${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonColors.pill}`,
1208
- // .button--pill
1209
- pillSmall: `${buttonSizes.pillSmall} ${buttonTextSizes.xsmall} ${buttonTypes.pill} ${buttonColors.pill}`,
1210
- pillLoading: `${buttonSizes.pill} ${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonVariants.inProgress}`,
1211
- pillSmallLoading: `${buttonSizes.pillSmall} ${buttonTextSizes.xsmall} ${buttonTypes.pill} ${buttonVariants.inProgress}`,
1212
- link: `${buttonSizes.link} ${buttonTextSizes.medium} ${buttonTypes.link}`,
1213
- linkSmall: `${buttonSizes.link} ${buttonTextSizes.xsmall} ${buttonTypes.link}`,
1214
- linkAsButton: "inline-block active:no-underline hover:no-underline focus:no-underline text-center",
1215
- a11y: "sr-only",
1216
- fullWidth: "w-full max-w-full",
1217
- contentWidth: "max-w-max"
1218
- };
1219
- var modal = {
1220
- transparentBg: "",
1221
- //TODO: Remove in v2 - previously used for opacity before changing to a rgba background in backdrop
1222
- backdrop: "fixed inset-0 flex sm:place-content-center sm:place-items-center items-end z-30 [--w-modal-max-height:80%] [--w-modal-width:640px] bg-[--w-black/25]",
1223
- modal: "pb-safe-[32] shadow-m max-h-[--w-modal-max-height] min-h-[--w-modal-min-height] w-[--w-modal-width] h-[--w-modal-height] relative transition-300 ease-in-out backface-hidden will-change-height rounded-8 mx-0 sm:mx-16 bg-[--w-s-color-surface-elevated-100] flex flex-col overflow-hidden outline-none space-y-16 pt-8 sm:pt-32 sm:pb-32 rounded-b-0 sm:rounded-b-8",
1224
- content: "block overflow-y-auto overflow-x-hidden last-child:mb-0 grow shrink px-16 sm:px-32 relative",
1225
- footer: "flex justify-end shrink-0 px-16 sm:px-32",
1226
- transitionTitle: "transition-all duration-300",
1227
- transitionTitleCenter: "justify-self-center self-center",
1228
- transitionTitleColSpan: "col-span-2",
1229
- title: "py-8 sm:py-0 -mt-4 sm:-mt-8 min-h-40 sm:min-h-48 grid gap-8 sm:gap-16 grid-cols-[auto_1fr_auto] items-start px-16 sm:px-32 border-b sm:border-b-0 shrink-0",
1230
- titleText: "mb-0 h4 sm:h3",
1231
- titleButton: `${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonColors.pill} sm:min-h-[44px] sm:min-w-[44px] min-h-[32px] min-w-[32px]`,
1232
- titleButtonLeft: "-ml-8 sm:-ml-12 justify-self-start",
1233
- titleButtonRight: "-mr-8 sm:-mr-12 justify-self-end",
1234
- titleButtonIcon: "h-16 w-16 sm:h-24 sm:w-24",
1235
- titleButtonIconRotated: "transform rotate-90"
1236
- };
1237
- var label = {
1238
- label: "antialiased block relative text-s font-bold pb-4 cursor-pointer s-text",
1239
- optional: "pl-8 font-normal text-s s-text-subtle",
1240
- labelInvalid: "s-text-negative"
1241
- // TODO: Remove in v2 - kept for backwards compatibility
1242
- };
1243
- var prefixSuffixWrapperBase = "absolute top-0 bottom-0 flex justify-center items-center focusable rounded-4 focus:[--w-outline-offset:-2px] bg-transparent ";
1244
- var suffix = {
1245
- wrapper: prefixSuffixWrapperBase + "right-0",
1246
- wrapperWithLabel: "w-max pr-12",
1247
- wrapperWithIcon: "w-40",
1248
- label: "antialiased block relative cursor-default pb-0 font-bold text-xs s-text"
1249
- };
1250
- var prefix = {
1251
- wrapper: prefixSuffixWrapperBase + "left-0",
1252
- wrapperWithLabel: "w-max pl-12",
1253
- wrapperWithIcon: "w-40",
1254
- label: "antialiased block relative cursor-default pb-0 font-bold text-xs s-text"
1255
- };
1256
- var toggle = {
1257
- // wrapper classes
1258
- field: "relative text-m",
1259
- // true
1260
- wrapper: "relative py-1",
1261
- // true
1262
- wrapperRadioButtons: "inline-flex font-bold rounded-8 focus-within:focusable",
1263
- // isRadioButton && !isEqualWidth
1264
- wrapperRadioButtonsJustified: "flex font-bold rounded-8 focus-within:focusable",
1265
- // isRadioButton && isEqualWidth,
1266
- // group classes
1267
- radioButtonsGroup: "group",
1268
- // isRadioButton
1269
- radioButtonsGroupJustified: "grow-1 shrink-0 basis-auto",
1270
- // isRadioButton && isEqualWidth
1271
- // input classes
1272
- input: "peer",
1273
- a11y: "sr-only",
1274
- // label classes
1275
- label: "peer-focus:focusable cursor-pointer text-m s-text s-border py-2 pl-28 select-none relative block before:border before:absolute before:transition-all before:left-0 before:w-20 before:h-20 before:top-2",
1276
- // !isRadioButton
1277
- labelBefore: 'before:content-[""] before:block',
1278
- // !isRadioButton && !isIndeterminate
1279
- checkbox: "before:s-bg before:rounded-2 hover:before:s-border-primary hover:before:s-bg-hover peer-checked:before:bg-center peer-checked:before:bg-[url(var(--w-form-check-mark))] peer-checked:before:s-border-primary peer-checked:before:s-bg-primary peer-checked:peer-hover:before:s-border-primary-hover peer-checked:peer-hover:before:s-bg-primary-hover",
1280
- // isCheckbox && !isIndeterminate && !isInvalid && !isDisabled
1281
- checkboxInvalid: "before:s-bg before:s-border-negative before:rounded-2 hover:before:s-bg-negative-subtle-hover hover:before:s-border-negative-hover peer-checked:before:bg-center peer-checked:before:bg-[url(var(--w-form-check-mark))] peer-checked:before:s-bg-negative peer-checked:before:s-border-negative peer-checked:peer-hover:before:s-bg-negative-hover peer-checked:peer-hover:before:s-border-negative-hover",
1282
- // isCheckbox && !isIndeterminate && isInvalid && !isDisabled
1283
- checkboxDisabled: "before:s-bg-disabled-subtle before:s-border-disabled pointer-events-none before:rounded-2 peer-checked:before:bg-center peer-checked:before:bg-[url(var(--w-form-check-mark))] peer-checked:before:s-border-disabled peer-checked:before:s-bg-disabled",
1284
- // isCheckbox && !isIndeterminate && !isInvalid && isDisabled
1285
- indeterminate: 'before:content-["\u2013"] before:rounded-2 before:leading-xs before:text-center before:font-bold before:s-icon-inverted peer-indeterminate:before:s-border-primary peer-indeterminate:before:s-bg-primary peer-indeterminate:hover:before:s-border-primary-hover peer-indeterminate:hover:before:s-bg-primary-hover',
1286
- // isCheckbox && isIndeterminate && !isInvalid && !isDisabled
1287
- indeterminateInvalid: 'before:content-["\u2013"] before:rounded-2 before:leading-xs before:text-center before:font-bold before:s-icon-inverted peer-indeterminate:before:s-border-negative peer-indeterminate:before:s-bg-negative peer-indeterminate:hover:before:s-border-negative-hover peer-indeterminate:hover:before:s-bg-negative-hover',
1288
- // isCheckbox && isIndeterminate && isInvalid && !isDisabled
1289
- indeterminateDisabled: 'before:content-["\u2013"] before:rounded-2 before:leading-xs before:text-center before:font-bold pointer-events-none before:s-icon-inverted peer-indeterminate:before:s-border-disabled peer-indeterminate:before:s-bg-disabled',
1290
- // isCheckbox && isIndeterminate && !isInvalid && isDisabled
1291
- radio: "before:s-bg before:rounded-full peer-checked:before:border-[6] peer-checked:before:s-border-selected peer-checked:peer-hover:before:s-border-selected-hover peer-hover:before:s-border-primary peer-hover:before:s-bg-hover",
1292
- // isRadio && !isDisabled && !isInvalid
1293
- radioInvalid: "before:s-bg before:s-border-negative before:rounded-full peer-checked:before:border-[6] peer-hover:before:s-bg-negative-subtle peer-hover:before:s-border-negative-hover peer-checked:before:s-border-negative peer-checked:peer-hover:before:s-border-negative-hover",
1294
- // isRadio && isInvalid && !isDisabled
1295
- radioDisabled: "before:s-bg-disabled-subtle before:s-border-disabled pointer-events-none before:rounded-full peer-checked:before:border-[6]",
1296
- // isRadio && !isInvalid && isDisabled
1297
- radioButtonsLabel: "peer-hover:peer-not-checked:s-bg-hover peer-checked:s-text-inverted peer-checked:s-bg-primary peer-checked:s-border-primary block relative font-bold cursor-pointer s-text-link text-center s-bg border-2 s-border group-first-of-type:rounded-tl-8 group-first-of-type:rounded-bl-8 group-last-of-type:rounded-tr-8 group-last-of-type:rounded-br-8 group-not-last-of-type:border-r-0 peer-checked:z-10 group-not-first:-ml-2",
1298
- // isRadioButtons
1299
- radioButtonsRegular: "text-s py-8 pl-12 pr-14",
1300
- // isRadioButtons && !isSmall
1301
- radioButtonsSmall: "text-xs py-[5px] px-[8px]"
1302
- // isRadioButtons && isSmall
1303
- };
1304
- var deadToggle = {
1305
- wrapper: `${toggle.wrapper} h-20 w-20 pointer-events-none`,
1306
- input: `${toggle.input} hidden`,
1307
- inputVue: "hidden",
1308
- labelRadio: `${toggle.label} ${toggle.labelBefore} ${toggle.radio}`,
1309
- labelCheckbox: `${toggle.label} ${toggle.labelBefore} ${toggle.checkbox}`,
1310
- labelVue: "-mt-2"
1311
- };
1312
- var clickable = {
1313
- toggle: "absolute inset-0 h-full w-full appearance-none cursor-pointer focusable focusable-inset",
1314
- label: `px-12 ${label.label} py-8! cursor-pointer focusable focusable-inset`,
1315
- buttonOrLink: "bg-transparent focusable",
1316
- buttonOrLinkStretch: "inset-0 absolute"
1317
- };
1318
- var attention = {
1319
- base: "border-2 relative flex items-start",
1320
- tooltip: "s-bg-inverted border-[--w-s-color-background-inverted] shadow-m s-text-inverted-static rounded-4 py-6 px-8",
1321
- callout: "bg-[--w-color-callout-background] border-[--w-color-callout-border] s-text py-8 px-16 rounded-8",
1322
- highlight: "bg-[--w-color-callout-background] border-[--w-color-callout-border] s-text py-8 px-16 rounded-8 drop-shadow-m translate-z-0",
1323
- popover: "bg-[--w-s-color-surface-elevated-300] border-[--w-s-color-surface-elevated-300] s-text rounded-8 p-16 drop-shadow-m translate-z-0",
1324
- arrowBase: "absolute h-[14px] w-[14px] border-2 border-b-0 border-r-0 rounded-tl-4 transform",
1325
- arrowDirectionLeftStart: "-left-[8px]",
1326
- arrowDirectionLeft: "-left-[8px]",
1327
- arrowDirectionLeftEnd: "-left-[8px]",
1328
- arrowDirectionRightStart: "-right-[8px]",
1329
- arrowDirectionRight: "-right-[8px]",
1330
- arrowDirectionRightEnd: "-right-[8px]",
1331
- arrowDirectionBottomStart: "-bottom-[8px]",
1332
- arrowDirectionBottom: "-bottom-[8px]",
1333
- arrowDirectionBottomEnd: "-bottom-[8px]",
1334
- arrowDirectionTopStart: "-top-[8px]",
1335
- arrowDirectionTop: "-top-[8px]",
1336
- arrowDirectionTopEnd: "-top-[8px]",
1337
- arrowTooltip: "s-bg-inverted border-[--w-s-color-background-inverted]",
1338
- arrowCallout: "bg-[--w-color-callout-background] border-[--w-color-callout-border]",
1339
- arrowPopover: "bg-[--w-s-color-surface-elevated-300] border-[--w-s-color-surface-elevated-300]",
1340
- arrowHighlight: "bg-[--w-color-callout-background] border-[--w-color-callout-border]",
1341
- content: "last-child:mb-0",
1342
- notCallout: "absolute z-50",
1343
- closeBtn: `${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonColors.pill} justify-self-end -mr-8 ml-8`
1344
- };
1345
-
1346
- // node_modules/.pnpm/@floating-ui+utils@0.2.1/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
1347
- var sides = ["top", "right", "bottom", "left"];
1348
- var min = Math.min;
1349
- var max = Math.max;
1350
- var round = Math.round;
1351
- var createCoords = (v) => ({
1352
- x: v,
1353
- y: v
1354
- });
1355
- var oppositeSideMap = {
1356
- left: "right",
1357
- right: "left",
1358
- bottom: "top",
1359
- top: "bottom"
1390
+ function setupI18n(params = {}) {
1391
+ return new I18n(params);
1392
+ }
1393
+ var i18n = setupI18n();
1394
+
1395
+ // node_modules/.pnpm/@floating-ui+utils@0.2.1/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
1396
+ var sides = ["top", "right", "bottom", "left"];
1397
+ var min = Math.min;
1398
+ var max = Math.max;
1399
+ var round = Math.round;
1400
+ var createCoords = (v) => ({
1401
+ x: v,
1402
+ y: v
1403
+ });
1404
+ var oppositeSideMap = {
1405
+ left: "right",
1406
+ right: "left",
1407
+ bottom: "top",
1408
+ top: "bottom"
1360
1409
  };
1361
1410
  var oppositeAlignmentMap = {
1362
1411
  start: "end",
@@ -2633,376 +2682,292 @@ async function useRecompute(state) {
2633
2682
  return state;
2634
2683
  }
2635
2684
 
2636
- // node_modules/.pnpm/@lingui+core@4.7.1/node_modules/@lingui/core/dist/index.mjs
2637
- var import_unraw = __toESM(require_dist(), 1);
2638
-
2639
- // node_modules/.pnpm/@lingui+message-utils@4.7.1/node_modules/@lingui/message-utils/dist/compileMessage.mjs
2640
- var import_parser = __toESM(require_parser(), 1);
2641
- function processTokens(tokens, mapText) {
2642
- if (!tokens.filter((token) => token.type !== "content").length) {
2643
- return tokens.map((token) => mapText(token.value)).join("");
2644
- }
2645
- return tokens.map((token) => {
2646
- var _a;
2647
- if (token.type === "content") {
2648
- return mapText(token.value);
2649
- } else if (token.type === "octothorpe") {
2650
- return "#";
2651
- } else if (token.type === "argument") {
2652
- return [token.arg];
2653
- } else if (token.type === "function") {
2654
- const _param = (_a = token == null ? void 0 : token.param) == null ? void 0 : _a[0];
2655
- if (_param) {
2656
- return [token.arg, token.key, _param.value.trim()];
2657
- } else {
2658
- return [token.arg, token.key];
2659
- }
2660
- }
2661
- const offset2 = token.pluralOffset;
2662
- const formatProps = {};
2663
- token.cases.forEach((item) => {
2664
- formatProps[item.key.replace(/^=(.)+/, "$1")] = processTokens(
2665
- item.tokens,
2666
- mapText
2667
- );
2668
- });
2669
- return [
2670
- token.arg,
2671
- token.type,
2672
- __spreadValues({
2673
- offset: offset2
2674
- }, formatProps)
2675
- ];
2676
- });
2677
- }
2678
- function compileMessage(message, mapText = (v) => v) {
2679
- try {
2680
- return processTokens((0, import_parser.parse)(message), mapText);
2681
- } catch (e) {
2682
- console.error(`${e.message}
2683
-
2684
- Message: ${message}`);
2685
- return message;
2686
- }
2687
- }
2688
-
2689
- // node_modules/.pnpm/@lingui+core@4.7.1/node_modules/@lingui/core/dist/index.mjs
2690
- var isString = (s) => typeof s === "string";
2691
- var isFunction = (f) => typeof f === "function";
2692
- var cache = /* @__PURE__ */ new Map();
2693
- var defaultLocale = "en";
2694
- function normalizeLocales(locales) {
2695
- const out = Array.isArray(locales) ? locales : [locales];
2696
- return [...out, defaultLocale];
2697
- }
2698
- function date(locales, value, format) {
2699
- const _locales = normalizeLocales(locales);
2700
- const formatter = getMemoized(
2701
- () => cacheKey("date", _locales, format),
2702
- () => new Intl.DateTimeFormat(_locales, format)
2703
- );
2704
- return formatter.format(isString(value) ? new Date(value) : value);
2705
- }
2706
- function number(locales, value, format) {
2707
- const _locales = normalizeLocales(locales);
2708
- const formatter = getMemoized(
2709
- () => cacheKey("number", _locales, format),
2710
- () => new Intl.NumberFormat(_locales, format)
2711
- );
2712
- return formatter.format(value);
2713
- }
2714
- function plural(locales, ordinal, value, _a) {
2715
- var _b = _a, { offset: offset2 = 0 } = _b, rules = __objRest(_b, ["offset"]);
2716
- var _a2, _b2;
2717
- const _locales = normalizeLocales(locales);
2718
- const plurals = ordinal ? getMemoized(
2719
- () => cacheKey("plural-ordinal", _locales),
2720
- () => new Intl.PluralRules(_locales, { type: "ordinal" })
2721
- ) : getMemoized(
2722
- () => cacheKey("plural-cardinal", _locales),
2723
- () => new Intl.PluralRules(_locales, { type: "cardinal" })
2724
- );
2725
- return (_b2 = (_a2 = rules[value]) != null ? _a2 : rules[plurals.select(value - offset2)]) != null ? _b2 : rules.other;
2726
- }
2727
- function getMemoized(getKey, construct) {
2728
- const key = getKey();
2729
- let formatter = cache.get(key);
2730
- if (!formatter) {
2731
- formatter = construct();
2732
- cache.set(key, formatter);
2733
- }
2734
- return formatter;
2735
- }
2736
- function cacheKey(type, locales, options) {
2737
- const localeKey = locales.join("-");
2738
- return `${type}-${localeKey}-${JSON.stringify(options)}`;
2739
- }
2740
- var UNICODE_REGEX = /\\u[a-fA-F0-9]{4}|\\x[a-fA-F0-9]{2}/g;
2741
- var OCTOTHORPE_PH = "%__lingui_octothorpe__%";
2742
- var getDefaultFormats = (locale, passedLocales, formats = {}) => {
2743
- const locales = passedLocales || locale;
2744
- const style = (format) => {
2745
- return typeof format === "object" ? format : formats[format] || { style: format };
2746
- };
2747
- const replaceOctothorpe = (value, message) => {
2748
- const numberFormat = Object.keys(formats).length ? style("number") : void 0;
2749
- const valueStr = number(locales, value, numberFormat);
2750
- return message.replace(new RegExp(OCTOTHORPE_PH, "g"), valueStr);
2751
- };
2752
- return {
2753
- plural: (value, cases) => {
2754
- const { offset: offset2 = 0 } = cases;
2755
- const message = plural(locales, false, value, cases);
2756
- return replaceOctothorpe(value - offset2, message);
2757
- },
2758
- selectordinal: (value, cases) => {
2759
- const { offset: offset2 = 0 } = cases;
2760
- const message = plural(locales, true, value, cases);
2761
- return replaceOctothorpe(value - offset2, message);
2762
- },
2763
- select: selectFormatter,
2764
- number: (value, format) => number(locales, value, style(format)),
2765
- date: (value, format) => date(locales, value, style(format))
2766
- };
2685
+ // node_modules/.pnpm/@warp-ds+css@1.9.6/node_modules/@warp-ds/css/component-classes/index.js
2686
+ var box = {
2687
+ box: "group block relative break-words last-child:mb-0 p-16 rounded-8",
2688
+ // Relative here enables w-clickable
2689
+ bleed: "-mx-16 sm:mx-0 rounded-l-0 rounded-r-0 sm:rounded-8",
2690
+ // We target L and R to override the default rounded-8
2691
+ info: "s-bg-info-subtle",
2692
+ neutral: "s-surface-sunken",
2693
+ bordered: "border-2 s-border s-bg",
2694
+ infoClickable: "hover:s-bg-info-subtle-hover active:s-bg-info-subtle-active",
2695
+ // Deprecated - Remove in v2 (after removing Clickable prop in the Box components)
2696
+ neutralClickable: "hover:s-bg-hover active:s-bg-active",
2697
+ // Deprecated - Remove in v2 (after removing Clickable prop in the Box components)
2698
+ borderedClickable: "hover:s-bg-hover active:s-bg-active hover:s-border-hover active:s-border-active"
2699
+ // Deprecated - Remove in v2 (after removing Clickable prop in the Box components)
2767
2700
  };
2768
- var selectFormatter = (value, rules) => {
2769
- var _a;
2770
- return (_a = rules[value]) != null ? _a : rules.other;
2701
+ var buttonReset = "focus:outline-none appearance-none cursor-pointer bg-transparent border-0 m-0 p-0 inline-block";
2702
+ var expandable = {
2703
+ expandable: "will-change-height",
2704
+ expandableTitle: "font-bold s-text",
2705
+ expandableBox: "s-surface-sunken hover:s-bg-hover active:s-bg-active py-0 px-0 " + box.box,
2706
+ expandableInfo: "s-bg-info-subtle! hover:s-bg-info-subtle-hover!",
2707
+ expandableBleed: box.bleed,
2708
+ chevron: "inline-block align-middle s-icon",
2709
+ chevronNonBox: "ml-8",
2710
+ chevronBox: "",
2711
+ chevronTransform: "transform transition-transform transform-gpu ease-in-out",
2712
+ chevronExpand: "-rotate-180",
2713
+ chevronCollapse: "rotate-180",
2714
+ elementsTransformChevronDownPart: "part-[w-icon-chevron-down-16-part]:transform part-[w-icon-chevron-down-16-part]:transition-transform part-[w-icon-chevron-down-16-part]:transform-gpu part-[w-icon-chevron-down-16-part]:ease-in-out",
2715
+ elementsChevronDownExpandPart: "part-[w-icon-chevron-down-16-part]:-rotate-180",
2716
+ elementsTransformChevronUpPart: "part-[w-icon-chevron-up-16-part]:transform part-[w-icon-chevron-up-16-part]:transition-transform part-[w-icon-chevron-up-16-part]:transform-gpu part-[w-icon-chevron-up-16-part]:ease-in-out",
2717
+ elementsChevronUpCollapsePart: "part-[w-icon-chevron-up-16-part]:rotate-180",
2718
+ expansion: "overflow-hidden",
2719
+ expansionNotExpanded: "h-0 invisible",
2720
+ button: buttonReset + " hover:underline focus-visible:underline",
2721
+ buttonBox: "w-full text-left relative inline-flex items-center justify-between " + box.box,
2722
+ paddingTop: "pt-0",
2723
+ title: "flex w-full justify-between items-center",
2724
+ titleType: "h4"
2771
2725
  };
2772
- function interpolate(translation, locale, locales) {
2773
- return (values = {}, formats) => {
2774
- const formatters = getDefaultFormats(locale, locales, formats);
2775
- const formatMessage = (tokens) => {
2776
- if (!Array.isArray(tokens))
2777
- return tokens;
2778
- return tokens.reduce((message, token) => {
2779
- if (token === "#") {
2780
- return message + OCTOTHORPE_PH;
2781
- }
2782
- if (isString(token)) {
2783
- return message + token;
2784
- }
2785
- const [name, type, format] = token;
2786
- let interpolatedFormat = {};
2787
- if (type === "plural" || type === "selectordinal" || type === "select") {
2788
- Object.entries(format).forEach(
2789
- ([key, value2]) => {
2790
- interpolatedFormat[key] = formatMessage(value2);
2791
- }
2792
- );
2793
- } else {
2794
- interpolatedFormat = format;
2795
- }
2796
- let value;
2797
- if (type) {
2798
- const formatter = formatters[type];
2799
- value = formatter(values[name], interpolatedFormat);
2800
- } else {
2801
- value = values[name];
2802
- }
2803
- if (value == null) {
2804
- return message;
2805
- }
2806
- return message + value;
2807
- }, "");
2808
- };
2809
- const result = formatMessage(translation);
2810
- if (isString(result) && UNICODE_REGEX.test(result)) {
2811
- return (0, import_unraw.unraw)(result.trim());
2812
- }
2813
- if (isString(result))
2814
- return result.trim();
2815
- return result ? String(result) : "";
2816
- };
2817
- }
2818
- var __defProp$1 = Object.defineProperty;
2819
- var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2820
- var __publicField$1 = (obj, key, value) => {
2821
- __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
2822
- return value;
2726
+ var buttonDefaultStyling = "font-bold focusable justify-center transition-colors ease-in-out";
2727
+ var buttonColors = {
2728
+ 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]",
2729
+ secondary: "s-text-link s-border s-bg hover:s-bg-hover hover:s-border-hover active:s-bg-active",
2730
+ utility: "s-text s-bg hover:s-bg-hover active:s-bg-active s-border hover:s-border-hover active:s-border-active",
2731
+ destructive: "s-bg-negative s-text-inverted hover:s-bg-negative-hover active:s-bg-negative-active",
2732
+ pill: "s-icon hover:s-icon-hover active:s-icon-active bg-transparent hover:bg-[--w-color-button-pill-background-hover] active:bg-[--w-color-button-pill-background-active]",
2733
+ disabled: "s-text-inverted s-bg-disabled",
2734
+ quiet: "bg-transparent s-text-link hover:s-bg-hover active:s-bg-active",
2735
+ utilityQuiet: "s-text bg-transparent hover:s-bg-hover active:s-bg-active",
2736
+ negativeQuiet: "bg-transparent s-text-negative hover:s-bg-negative-subtle-hover active:s-bg-negative-subtle-active",
2737
+ loading: "s-text s-bg-subtle",
2738
+ link: "s-text-link"
2739
+ };
2740
+ var buttonTypes = {
2741
+ primary: `border-0 rounded-8 ${buttonDefaultStyling}`,
2742
+ secondary: `border-2 rounded-8 ${buttonDefaultStyling}`,
2743
+ utility: `border rounded-4 ${buttonDefaultStyling}`,
2744
+ negative: `border-0 rounded-8 ${buttonDefaultStyling}`,
2745
+ pill: `p-4 rounded-full border-0 inline-flex items-center justify-center hover:bg-clip-padding ${buttonDefaultStyling}`,
2746
+ link: `bg-transparent focusable ease-in-out inline active:underline hover:underline focus:underline ${buttonColors.link}`
2747
+ };
2748
+ var buttonSizes = {
2749
+ xsmall: "py-6 px-16",
2750
+ small: "py-8 px-16",
2751
+ medium: "py-10 px-14",
2752
+ large: "py-12 px-16",
2753
+ utility: "py-[11px] px-[15px]",
2754
+ smallUtility: "py-[7px] px-[15px]",
2755
+ pill: "min-h-[44px] min-w-[44px]",
2756
+ pillSmall: "min-h-32 min-w-32",
2757
+ link: "p-0"
2758
+ };
2759
+ var buttonTextSizes = {
2760
+ medium: "text-m leading-[24]",
2761
+ xsmall: "text-xs"
2762
+ };
2763
+ var buttonVariants = {
2764
+ inProgress: `border-transparent animate-inprogress pointer-events-none ${buttonColors.loading}`,
2765
+ // .button--in-progress, a.button--in-progress:visited
2766
+ quiet: `border-0 rounded-8 ${buttonDefaultStyling}`,
2767
+ utilityQuiet: `border-0 rounded-4 ${buttonDefaultStyling}`,
2768
+ negativeQuiet: `border-0 rounded-8 ${buttonDefaultStyling}`,
2769
+ isDisabled: `font-bold justify-center transition-colors ease-in-out cursor-default pointer-events-none ${buttonColors.disabled}`
2770
+ // .button:disabled, .button--is-disabled
2771
+ };
2772
+ var button = {
2773
+ // Buttontypes
2774
+ secondary: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonColors.secondary}`,
2775
+ // .button--secondary, .button--default, .button
2776
+ secondaryHref: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonColors.secondary}`,
2777
+ secondaryDisabled: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonVariants.isDisabled}`,
2778
+ secondarySmall: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonTypes.secondary} ${buttonColors.secondary}`,
2779
+ secondarySmallDisabled: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonTypes.secondary} ${buttonVariants.isDisabled}`,
2780
+ secondaryQuiet: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonColors.quiet}`,
2781
+ secondaryQuietDisabled: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
2782
+ secondarySmallQuiet: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonVariants.quiet} ${buttonColors.quiet}`,
2783
+ secondarySmallQuietDisabled: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
2784
+ secondaryLoading: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonTypes.secondary} ${buttonVariants.inProgress}`,
2785
+ secondarySmallLoading: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonTypes.secondary} ${buttonVariants.inProgress}`,
2786
+ secondarySmallQuietLoading: `${buttonTextSizes.xsmall} ${buttonSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.inProgress}`,
2787
+ secondaryQuietLoading: `${buttonSizes.medium} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.inProgress}`,
2788
+ primary: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.primary} ${buttonColors.primary}`,
2789
+ // .button--primary, .button--cta
2790
+ primaryDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.isDisabled} ${buttonTypes.primary}`,
2791
+ primarySmall: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonTypes.primary} ${buttonColors.primary}`,
2792
+ primarySmallDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.isDisabled} ${buttonTypes.primary} `,
2793
+ primaryQuiet: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonColors.quiet}`,
2794
+ primaryQuietDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
2795
+ primarySmallQuiet: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.quiet} ${buttonColors.quiet}`,
2796
+ primarySmallQuietDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.isDisabled}`,
2797
+ primaryLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.inProgress} ${buttonTypes.primary}`,
2798
+ primarySmallLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.inProgress} ${buttonTypes.primary}`,
2799
+ primarySmallQuietLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.quiet} ${buttonVariants.inProgress} ${buttonTypes.primary}`,
2800
+ primaryQuietLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.quiet} ${buttonVariants.inProgress}`,
2801
+ utility: `${buttonSizes.utility} ${buttonTextSizes.medium} ${buttonTypes.utility} ${buttonColors.utility}`,
2802
+ // .button--utility
2803
+ utilityDisabled: `${buttonSizes.utility} ${buttonTextSizes.medium} ${buttonTypes.utility} ${buttonVariants.isDisabled}`,
2804
+ utilityQuiet: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.utilityQuiet} ${buttonColors.utilityQuiet}`,
2805
+ // .button--utility-flat
2806
+ utilityQuietDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.utilityQuiet} ${buttonVariants.isDisabled}`,
2807
+ utilitySmall: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonTypes.utility} ${buttonColors.utility}`,
2808
+ utilitySmallDisabled: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonTypes.utility} ${buttonVariants.isDisabled}`,
2809
+ utilitySmallQuiet: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonVariants.utilityQuiet} ${buttonColors.utilityQuiet}`,
2810
+ utilitySmallQuietDisabled: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonVariants.utilityQuiet} ${buttonVariants.isDisabled}`,
2811
+ utilityLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.utility} ${buttonVariants.inProgress}`,
2812
+ utilitySmallLoading: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonTypes.utility} ${buttonVariants.inProgress}`,
2813
+ utilityQuietLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.inProgress} ${buttonVariants.utilityQuiet}`,
2814
+ utilitySmallQuietLoading: `${buttonSizes.smallUtility} ${buttonTextSizes.xsmall} ${buttonVariants.inProgress} ${buttonVariants.utilityQuiet}`,
2815
+ negative: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.negative} ${buttonColors.destructive}`,
2816
+ // .button--destructive
2817
+ negativeDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.negative} ${buttonVariants.isDisabled}`,
2818
+ negativeQuiet: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.negativeQuiet} ${buttonColors.negativeQuiet}`,
2819
+ // .button--destructive-flat
2820
+ negativeQuietDisabled: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.negativeQuiet}${buttonVariants.isDisabled}`,
2821
+ negativeSmall: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonTypes.negative} ${buttonColors.destructive}`,
2822
+ negativeSmallDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonTypes.negative} ${buttonVariants.isDisabled}`,
2823
+ negativeSmallQuiet: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.negativeQuiet} ${buttonColors.negativeQuiet}`,
2824
+ negativeSmallQuietDisabled: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.negativeQuiet} ${buttonVariants.isDisabled}`,
2825
+ negativeLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonTypes.negative} ${buttonVariants.inProgress}`,
2826
+ negativeSmallLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.inProgress} ${buttonTypes.negative}`,
2827
+ negativeQuietLoading: `${buttonSizes.large} ${buttonTextSizes.medium} ${buttonVariants.negativeQuiet} ${buttonTypes.negative} ${buttonVariants.inProgress}`,
2828
+ negativeSmallQuietLoading: `${buttonSizes.small} ${buttonTextSizes.xsmall} ${buttonVariants.negativeQuiet} ${buttonVariants.inProgress}`,
2829
+ pill: `${buttonSizes.pill} ${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonColors.pill}`,
2830
+ // .button--pill
2831
+ pillSmall: `${buttonSizes.pillSmall} ${buttonTextSizes.xsmall} ${buttonTypes.pill} ${buttonColors.pill}`,
2832
+ pillLoading: `${buttonSizes.pill} ${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonVariants.inProgress}`,
2833
+ pillSmallLoading: `${buttonSizes.pillSmall} ${buttonTextSizes.xsmall} ${buttonTypes.pill} ${buttonVariants.inProgress}`,
2834
+ link: `${buttonSizes.link} ${buttonTextSizes.medium} ${buttonTypes.link}`,
2835
+ linkSmall: `${buttonSizes.link} ${buttonTextSizes.xsmall} ${buttonTypes.link}`,
2836
+ linkAsButton: "inline-block active:no-underline hover:no-underline focus:no-underline text-center",
2837
+ a11y: "sr-only",
2838
+ fullWidth: "w-full max-w-full",
2839
+ contentWidth: "max-w-max"
2840
+ };
2841
+ var modal = {
2842
+ transparentBg: "",
2843
+ //TODO: Remove in v2 - previously used for opacity before changing to a rgba background in backdrop
2844
+ backdrop: "fixed inset-0 flex sm:place-content-center sm:place-items-center items-end z-30 [--w-modal-max-height:80%] [--w-modal-width:640px] bg-[--w-black/25]",
2845
+ modal: "pb-safe-[32] shadow-m max-h-[--w-modal-max-height] min-h-[--w-modal-min-height] w-[--w-modal-width] h-[--w-modal-height] relative transition-300 ease-in-out backface-hidden will-change-height rounded-8 mx-0 sm:mx-16 bg-[--w-s-color-surface-elevated-100] flex flex-col overflow-hidden outline-none space-y-16 pt-8 sm:pt-32 sm:pb-32 rounded-b-0 sm:rounded-b-8",
2846
+ content: "block overflow-y-auto overflow-x-hidden last-child:mb-0 grow shrink px-16 sm:px-32 relative",
2847
+ footer: "flex justify-end shrink-0 px-16 sm:px-32",
2848
+ transitionTitle: "transition-all duration-300",
2849
+ transitionTitleCenter: "justify-self-center self-center",
2850
+ transitionTitleColSpan: "col-span-2",
2851
+ title: "py-8 sm:py-0 -mt-4 sm:-mt-8 min-h-40 sm:min-h-48 grid gap-8 sm:gap-16 grid-cols-[auto_1fr_auto] items-start px-16 sm:px-32 border-b sm:border-b-0 shrink-0",
2852
+ titleText: "mb-0 h4 sm:h3",
2853
+ titleButton: `${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonColors.pill} sm:min-h-[44px] sm:min-w-[44px] min-h-[32px] min-w-[32px]`,
2854
+ titleButtonLeft: "-ml-8 sm:-ml-12 justify-self-start",
2855
+ titleButtonRight: "-mr-8 sm:-mr-12 justify-self-end",
2856
+ titleButtonIcon: "h-16 w-16 sm:h-24 sm:w-24",
2857
+ titleButtonIconRotated: "transform rotate-90"
2858
+ };
2859
+ var label = {
2860
+ label: "antialiased block relative text-s font-bold pb-4 cursor-pointer s-text",
2861
+ optional: "pl-8 font-normal text-s s-text-subtle",
2862
+ labelInvalid: "s-text-negative"
2863
+ // TODO: Remove in v2 - kept for backwards compatibility
2864
+ };
2865
+ var prefixSuffixWrapperBase = "absolute top-0 bottom-0 flex justify-center items-center focusable rounded-4 focus:[--w-outline-offset:-2px] bg-transparent ";
2866
+ var suffix = {
2867
+ wrapper: prefixSuffixWrapperBase + "right-0",
2868
+ wrapperWithLabel: "w-max pr-12",
2869
+ wrapperWithIcon: "w-40",
2870
+ label: "antialiased block relative cursor-default pb-0 font-bold text-xs s-text"
2871
+ };
2872
+ var prefix = {
2873
+ wrapper: prefixSuffixWrapperBase + "left-0",
2874
+ wrapperWithLabel: "w-max pl-12",
2875
+ wrapperWithIcon: "w-40",
2876
+ label: "antialiased block relative cursor-default pb-0 font-bold text-xs s-text"
2877
+ };
2878
+ var toggle = {
2879
+ // wrapper classes
2880
+ field: "relative text-m",
2881
+ // true
2882
+ wrapper: "relative py-1",
2883
+ // true
2884
+ wrapperRadioButtons: "inline-flex font-bold rounded-8 focus-within:focusable",
2885
+ // isRadioButton && !isEqualWidth
2886
+ wrapperRadioButtonsJustified: "flex font-bold rounded-8 focus-within:focusable",
2887
+ // isRadioButton && isEqualWidth,
2888
+ // group classes
2889
+ radioButtonsGroup: "group",
2890
+ // isRadioButton
2891
+ radioButtonsGroupJustified: "grow-1 shrink-0 basis-auto",
2892
+ // isRadioButton && isEqualWidth
2893
+ // input classes
2894
+ input: "peer",
2895
+ a11y: "sr-only",
2896
+ // label classes
2897
+ label: "peer-focus:focusable cursor-pointer text-m s-text s-border py-2 pl-28 select-none relative block before:border before:absolute before:transition-all before:left-0 before:w-20 before:h-20 before:top-2",
2898
+ // !isRadioButton
2899
+ labelBefore: 'before:content-[""] before:block',
2900
+ // !isRadioButton && !isIndeterminate
2901
+ checkbox: "before:s-bg before:rounded-2 hover:before:s-border-primary hover:before:s-bg-hover peer-checked:before:bg-center peer-checked:before:bg-[url(var(--w-form-check-mark))] peer-checked:before:s-border-primary peer-checked:before:s-bg-primary peer-checked:peer-hover:before:s-border-primary-hover peer-checked:peer-hover:before:s-bg-primary-hover",
2902
+ // isCheckbox && !isIndeterminate && !isInvalid && !isDisabled
2903
+ checkboxInvalid: "before:s-bg before:s-border-negative before:rounded-2 hover:before:s-bg-negative-subtle-hover hover:before:s-border-negative-hover peer-checked:before:bg-center peer-checked:before:bg-[url(var(--w-form-check-mark))] peer-checked:before:s-bg-negative peer-checked:before:s-border-negative peer-checked:peer-hover:before:s-bg-negative-hover peer-checked:peer-hover:before:s-border-negative-hover",
2904
+ // isCheckbox && !isIndeterminate && isInvalid && !isDisabled
2905
+ checkboxDisabled: "before:s-bg-disabled-subtle before:s-border-disabled pointer-events-none before:rounded-2 peer-checked:before:bg-center peer-checked:before:bg-[url(var(--w-form-check-mark))] peer-checked:before:s-border-disabled peer-checked:before:s-bg-disabled",
2906
+ // isCheckbox && !isIndeterminate && !isInvalid && isDisabled
2907
+ indeterminate: 'before:content-["\u2013"] before:rounded-2 before:leading-xs before:text-center before:font-bold before:s-icon-inverted peer-indeterminate:before:s-border-primary peer-indeterminate:before:s-bg-primary peer-indeterminate:hover:before:s-border-primary-hover peer-indeterminate:hover:before:s-bg-primary-hover',
2908
+ // isCheckbox && isIndeterminate && !isInvalid && !isDisabled
2909
+ indeterminateInvalid: 'before:content-["\u2013"] before:rounded-2 before:leading-xs before:text-center before:font-bold before:s-icon-inverted peer-indeterminate:before:s-border-negative peer-indeterminate:before:s-bg-negative peer-indeterminate:hover:before:s-border-negative-hover peer-indeterminate:hover:before:s-bg-negative-hover',
2910
+ // isCheckbox && isIndeterminate && isInvalid && !isDisabled
2911
+ indeterminateDisabled: 'before:content-["\u2013"] before:rounded-2 before:leading-xs before:text-center before:font-bold pointer-events-none before:s-icon-inverted peer-indeterminate:before:s-border-disabled peer-indeterminate:before:s-bg-disabled',
2912
+ // isCheckbox && isIndeterminate && !isInvalid && isDisabled
2913
+ radio: "before:s-bg before:rounded-full peer-checked:before:border-[6] peer-checked:before:s-border-selected peer-checked:peer-hover:before:s-border-selected-hover peer-hover:before:s-border-primary peer-hover:before:s-bg-hover",
2914
+ // isRadio && !isDisabled && !isInvalid
2915
+ radioInvalid: "before:s-bg before:s-border-negative before:rounded-full peer-checked:before:border-[6] peer-hover:before:s-bg-negative-subtle peer-hover:before:s-border-negative-hover peer-checked:before:s-border-negative peer-checked:peer-hover:before:s-border-negative-hover",
2916
+ // isRadio && isInvalid && !isDisabled
2917
+ radioDisabled: "before:s-bg-disabled-subtle before:s-border-disabled pointer-events-none before:rounded-full peer-checked:before:border-[6]",
2918
+ // isRadio && !isInvalid && isDisabled
2919
+ radioButtonsLabel: "peer-hover:peer-not-checked:s-bg-hover peer-checked:s-text-inverted peer-checked:s-bg-primary peer-checked:s-border-primary block relative font-bold cursor-pointer s-text-link text-center s-bg border-2 s-border group-first-of-type:rounded-tl-8 group-first-of-type:rounded-bl-8 group-last-of-type:rounded-tr-8 group-last-of-type:rounded-br-8 group-not-last-of-type:border-r-0 peer-checked:z-10 group-not-first:-ml-2",
2920
+ // isRadioButtons
2921
+ radioButtonsRegular: "text-s py-8 pl-12 pr-14",
2922
+ // isRadioButtons && !isSmall
2923
+ radioButtonsSmall: "text-xs py-[5px] px-[8px]"
2924
+ // isRadioButtons && isSmall
2823
2925
  };
2824
- var EventEmitter = class {
2825
- constructor() {
2826
- __publicField$1(this, "_events", {});
2827
- }
2828
- on(event, listener) {
2829
- var _a2;
2830
- var _a;
2831
- (_a2 = (_a = this._events)[event]) != null ? _a2 : _a[event] = [];
2832
- this._events[event].push(listener);
2833
- return () => this.removeListener(event, listener);
2834
- }
2835
- removeListener(event, listener) {
2836
- const maybeListeners = this._getListeners(event);
2837
- if (!maybeListeners)
2838
- return;
2839
- const index = maybeListeners.indexOf(listener);
2840
- if (~index)
2841
- maybeListeners.splice(index, 1);
2842
- }
2843
- emit(event, ...args) {
2844
- const maybeListeners = this._getListeners(event);
2845
- if (!maybeListeners)
2846
- return;
2847
- maybeListeners.map((listener) => listener.apply(this, args));
2848
- }
2849
- _getListeners(event) {
2850
- const maybeListeners = this._events[event];
2851
- return Array.isArray(maybeListeners) ? maybeListeners : false;
2852
- }
2926
+ var deadToggle = {
2927
+ wrapper: `${toggle.wrapper} h-20 w-20 pointer-events-none`,
2928
+ input: `${toggle.input} hidden`,
2929
+ inputVue: "hidden",
2930
+ labelRadio: `${toggle.label} ${toggle.labelBefore} ${toggle.radio}`,
2931
+ labelCheckbox: `${toggle.label} ${toggle.labelBefore} ${toggle.checkbox}`,
2932
+ labelVue: "-mt-2"
2853
2933
  };
2854
- var __defProp2 = Object.defineProperty;
2855
- var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2856
- var __publicField2 = (obj, key, value) => {
2857
- __defNormalProp2(obj, typeof key !== "symbol" ? key + "" : key, value);
2858
- return value;
2934
+ var clickable = {
2935
+ toggle: "absolute inset-0 h-full w-full appearance-none cursor-pointer focusable focusable-inset",
2936
+ label: `px-12 ${label.label} py-8! cursor-pointer focusable focusable-inset`,
2937
+ buttonOrLink: "bg-transparent focusable",
2938
+ buttonOrLinkStretch: "inset-0 absolute"
2859
2939
  };
2860
- var I18n = class extends EventEmitter {
2861
- constructor(params) {
2862
- var _a;
2863
- super();
2864
- __publicField2(this, "_locale", "");
2865
- __publicField2(this, "_locales");
2866
- __publicField2(this, "_localeData", {});
2867
- __publicField2(this, "_messages", {});
2868
- __publicField2(this, "_missing");
2869
- __publicField2(this, "t", this._.bind(this));
2870
- if (params.missing != null)
2871
- this._missing = params.missing;
2872
- if (params.messages != null)
2873
- this.load(params.messages);
2874
- if (params.localeData != null)
2875
- this.loadLocaleData(params.localeData);
2876
- if (typeof params.locale === "string" || params.locales) {
2877
- this.activate((_a = params.locale) != null ? _a : defaultLocale, params.locales);
2878
- }
2879
- }
2880
- get locale() {
2881
- return this._locale;
2882
- }
2883
- get locales() {
2884
- return this._locales;
2885
- }
2886
- get messages() {
2887
- var _a;
2888
- return (_a = this._messages[this._locale]) != null ? _a : {};
2889
- }
2890
- /**
2891
- * @deprecated this has no effect. Please remove this from the code. Deprecated in v4
2892
- */
2893
- get localeData() {
2894
- var _a;
2895
- return (_a = this._localeData[this._locale]) != null ? _a : {};
2896
- }
2897
- _loadLocaleData(locale, localeData) {
2898
- const maybeLocaleData = this._localeData[locale];
2899
- if (!maybeLocaleData) {
2900
- this._localeData[locale] = localeData;
2901
- } else {
2902
- Object.assign(maybeLocaleData, localeData);
2903
- }
2904
- }
2905
- /**
2906
- * @deprecated Plurals automatically used from Intl.PluralRules you can safely remove this call. Deprecated in v4
2907
- */
2908
- // @ts-ignore deprecated, so ignore the reported error
2909
- loadLocaleData(localeOrAllData, localeData) {
2910
- if (localeData != null) {
2911
- this._loadLocaleData(localeOrAllData, localeData);
2912
- } else {
2913
- Object.keys(localeOrAllData).forEach(
2914
- (locale) => this._loadLocaleData(locale, localeOrAllData[locale])
2915
- );
2916
- }
2917
- this.emit("change");
2918
- }
2919
- _load(locale, messages5) {
2920
- const maybeMessages = this._messages[locale];
2921
- if (!maybeMessages) {
2922
- this._messages[locale] = messages5;
2923
- } else {
2924
- Object.assign(maybeMessages, messages5);
2925
- }
2926
- }
2927
- load(localeOrMessages, messages5) {
2928
- if (typeof localeOrMessages == "string" && typeof messages5 === "object") {
2929
- this._load(localeOrMessages, messages5);
2930
- } else {
2931
- Object.entries(localeOrMessages).forEach(
2932
- ([locale, messages23]) => this._load(locale, messages23)
2933
- );
2934
- }
2935
- this.emit("change");
2936
- }
2937
- /**
2938
- * @param options {@link LoadAndActivateOptions}
2939
- */
2940
- loadAndActivate({ locale, locales, messages: messages5 }) {
2941
- this._locale = locale;
2942
- this._locales = locales || void 0;
2943
- this._messages[this._locale] = messages5;
2944
- this.emit("change");
2945
- }
2946
- activate(locale, locales) {
2947
- if (true) {
2948
- if (!this._messages[locale]) {
2949
- console.warn(`Messages for locale "${locale}" not loaded.`);
2950
- }
2951
- }
2952
- this._locale = locale;
2953
- this._locales = locales;
2954
- this.emit("change");
2955
- }
2956
- _(id, values, options) {
2957
- let message = options == null ? void 0 : options.message;
2958
- if (!isString(id)) {
2959
- values = id.values || values;
2960
- message = id.message;
2961
- id = id.id;
2962
- }
2963
- const messageForId = this.messages[id];
2964
- const messageMissing = messageForId === void 0;
2965
- const missing = this._missing;
2966
- if (missing && messageMissing) {
2967
- return isFunction(missing) ? missing(this._locale, id) : missing;
2968
- }
2969
- if (messageMissing) {
2970
- this.emit("missing", { id, locale: this._locale });
2971
- }
2972
- let translation = messageForId || message || id;
2973
- if (true) {
2974
- translation = isString(translation) ? compileMessage(translation) : translation;
2975
- }
2976
- if (isString(translation) && UNICODE_REGEX.test(translation))
2977
- return JSON.parse(`"${translation}"`);
2978
- if (isString(translation))
2979
- return translation;
2980
- return interpolate(
2981
- translation,
2982
- this._locale,
2983
- this._locales
2984
- )(values, options == null ? void 0 : options.formats);
2985
- }
2986
- date(value, format) {
2987
- return date(this._locales || this._locale, value, format);
2988
- }
2989
- number(value, format) {
2990
- return number(this._locales || this._locale, value, format);
2991
- }
2940
+ var attention = {
2941
+ base: "border-2 relative flex items-start",
2942
+ tooltip: "s-bg-inverted border-[--w-s-color-background-inverted] shadow-m s-text-inverted-static rounded-4 py-6 px-8",
2943
+ callout: "bg-[--w-color-callout-background] border-[--w-color-callout-border] s-text py-8 px-16 rounded-8",
2944
+ highlight: "bg-[--w-color-callout-background] border-[--w-color-callout-border] s-text py-8 px-16 rounded-8 drop-shadow-m translate-z-0",
2945
+ popover: "bg-[--w-s-color-surface-elevated-300] border-[--w-s-color-surface-elevated-300] s-text rounded-8 p-16 drop-shadow-m translate-z-0",
2946
+ arrowBase: "absolute h-[14px] w-[14px] border-2 border-b-0 border-r-0 rounded-tl-4 transform",
2947
+ arrowDirectionLeftStart: "-left-[8px]",
2948
+ arrowDirectionLeft: "-left-[8px]",
2949
+ arrowDirectionLeftEnd: "-left-[8px]",
2950
+ arrowDirectionRightStart: "-right-[8px]",
2951
+ arrowDirectionRight: "-right-[8px]",
2952
+ arrowDirectionRightEnd: "-right-[8px]",
2953
+ arrowDirectionBottomStart: "-bottom-[8px]",
2954
+ arrowDirectionBottom: "-bottom-[8px]",
2955
+ arrowDirectionBottomEnd: "-bottom-[8px]",
2956
+ arrowDirectionTopStart: "-top-[8px]",
2957
+ arrowDirectionTop: "-top-[8px]",
2958
+ arrowDirectionTopEnd: "-top-[8px]",
2959
+ arrowTooltip: "s-bg-inverted border-[--w-s-color-background-inverted]",
2960
+ arrowCallout: "bg-[--w-color-callout-background] border-[--w-color-callout-border]",
2961
+ arrowPopover: "bg-[--w-s-color-surface-elevated-300] border-[--w-s-color-surface-elevated-300]",
2962
+ arrowHighlight: "bg-[--w-color-callout-background] border-[--w-color-callout-border]",
2963
+ content: "last-child:mb-0",
2964
+ notCallout: "absolute z-50",
2965
+ closeBtn: `${buttonTextSizes.medium} ${buttonTypes.pill} ${buttonColors.pill} justify-self-end -mr-8 ml-8`
2992
2966
  };
2993
- function setupI18n(params = {}) {
2994
- return new I18n(params);
2995
- }
2996
- var i18n = setupI18n();
2997
-
2998
- // packages/attention/locales/en/messages.mjs
2999
- var messages = JSON.parse('{"attention.aria.callout":"callout speech bubble","attention.aria.close":"Close","attention.aria.highlight":"highlighted speech bubble","attention.aria.pointingDown":"pointing down","attention.aria.pointingLeft":"pointing left","attention.aria.pointingRight":"pointing right","attention.aria.pointingUp":"pointing up","attention.aria.popover":"popover speech bubble","attention.aria.tooltip":"tooltip"}');
3000
-
3001
- // packages/attention/locales/nb/messages.mjs
3002
- var messages2 = JSON.parse('{"attention.aria.callout":"callout speech bubble","attention.aria.close":"Lukk","attention.aria.highlight":"highlighted speech bubble","attention.aria.pointingDown":"pointing down","attention.aria.pointingLeft":"pointing left","attention.aria.pointingRight":"pointing right","attention.aria.pointingUp":"pointing up","attention.aria.popover":"popover speech bubble","attention.aria.tooltip":"tooltip"}');
3003
2967
 
3004
- // packages/attention/locales/fi/messages.mjs
3005
- var messages3 = JSON.parse('{"attention.aria.callout":"callout speech bubble","attention.aria.close":"Sulje","attention.aria.highlight":"highlighted speech bubble","attention.aria.pointingDown":"pointing down","attention.aria.pointingLeft":"pointing left","attention.aria.pointingRight":"pointing right","attention.aria.pointingUp":"pointing up","attention.aria.popover":"popover speech bubble","attention.aria.tooltip":"tooltip"}');
2968
+ // packages/attention/index.js
2969
+ import WarpElement from "@warp-ds/elements-core";
2970
+ import { ifDefined } from "lit/directives/if-defined.js";
3006
2971
 
3007
2972
  // packages/i18n.ts
3008
2973
  var supportedLocales = ["en", "nb", "fi"];
@@ -3039,6 +3004,43 @@ var activateI18n = (enMessages, nbMessages, fiMessages) => {
3039
3004
  i18n.activate(locale);
3040
3005
  };
3041
3006
 
3007
+ // packages/utils/index.js
3008
+ import { classMap } from "lit/directives/class-map.js";
3009
+ var camelCaseToKebabCase = (str) => str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
3010
+ function kebabCaseAttributes(constructor) {
3011
+ return class extends constructor {
3012
+ static createProperty(name, options) {
3013
+ let customOptions = options;
3014
+ if (typeof (options == null ? void 0 : options.attribute) === "undefined" || (options == null ? void 0 : options.attribute) === true) {
3015
+ customOptions = Object.assign({}, options, {
3016
+ attribute: camelCaseToKebabCase(name.toString())
3017
+ });
3018
+ }
3019
+ super.createProperty(name, customOptions);
3020
+ }
3021
+ };
3022
+ }
3023
+ function classes(defn) {
3024
+ const classes2 = [];
3025
+ for (const [key, value] of Object.entries(defn)) {
3026
+ if (value)
3027
+ classes2.push(key);
3028
+ }
3029
+ return classes2.join(" ");
3030
+ }
3031
+ function generateRandomId() {
3032
+ return `m${Math.random().toString(36).slice(2)}`;
3033
+ }
3034
+
3035
+ // packages/attention/locales/en/messages.mjs
3036
+ var messages = JSON.parse('{"attention.aria.callout":"callout speech bubble","attention.aria.close":"Close","attention.aria.highlight":"highlighted speech bubble","attention.aria.pointingDown":"pointing down","attention.aria.pointingLeft":"pointing left","attention.aria.pointingRight":"pointing right","attention.aria.pointingUp":"pointing up","attention.aria.popover":"popover speech bubble","attention.aria.tooltip":"tooltip"}');
3037
+
3038
+ // packages/attention/locales/fi/messages.mjs
3039
+ var messages2 = JSON.parse('{"attention.aria.callout":"callout speech bubble","attention.aria.close":"Sulje","attention.aria.highlight":"highlighted speech bubble","attention.aria.pointingDown":"pointing down","attention.aria.pointingLeft":"pointing left","attention.aria.pointingRight":"pointing right","attention.aria.pointingUp":"pointing up","attention.aria.popover":"popover speech bubble","attention.aria.tooltip":"tooltip"}');
3040
+
3041
+ // packages/attention/locales/nb/messages.mjs
3042
+ var messages3 = JSON.parse('{"attention.aria.callout":"callout speech bubble","attention.aria.close":"Lukk","attention.aria.highlight":"highlighted speech bubble","attention.aria.pointingDown":"pointing down","attention.aria.pointingLeft":"pointing left","attention.aria.pointingRight":"pointing right","attention.aria.pointingUp":"pointing up","attention.aria.popover":"popover speech bubble","attention.aria.tooltip":"tooltip"}');
3043
+
3042
3044
  // node_modules/.pnpm/@warp-ds+icons@2.0.0/node_modules/@warp-ds/icons/dist/elements/close-16.js
3043
3045
  import { LitElement } from "lit";
3044
3046
  import { unsafeStatic, html } from "lit/static-html.js";
@@ -3134,7 +3136,7 @@ if (!customElements.get("w-icon-close-16")) {
3134
3136
  var WarpAttention = class extends kebabCaseAttributes(WarpElement) {
3135
3137
  constructor() {
3136
3138
  super();
3137
- activateI18n(messages, messages2, messages3);
3139
+ activateI18n(messages, messages3, messages2);
3138
3140
  this.handleDone = this.handleDone.bind(this);
3139
3141
  this.show = false;
3140
3142
  this.placement = "bottom";
@@ -3158,8 +3160,10 @@ var WarpAttention = class extends kebabCaseAttributes(WarpElement) {
3158
3160
  ${JSON.stringify(Object.keys(opposites))}`);
3159
3161
  }
3160
3162
  if (this.fallbackPlacements && !this.fallbackPlacements.every((fallbackPlacement) => directions.includes(fallbackPlacement))) {
3161
- throw new Error(`Invalid "fallbackPlacements" attribute. Set its value to an array with one or more of the following:
3162
- ${JSON.stringify(directions)}`);
3163
+ throw new Error(
3164
+ `Invalid "fallbackPlacements" attribute. Set its value to an array with one or more of the following:
3165
+ ${JSON.stringify(directions)}`
3166
+ );
3163
3167
  }
3164
3168
  setTimeout(() => this.requestUpdate(), 0);
3165
3169
  if (!this.callout) {
@@ -3213,7 +3217,7 @@ ${JSON.stringify(directions)}`);
3213
3217
  });
3214
3218
  }
3215
3219
  get _arrowHtml() {
3216
- return this.noArrow ? "" : html2`<div id="arrow" role="img" class="${this._arrowClasses}" />`;
3220
+ return this.noArrow ? "" : html2`<div id="arrow" role="img" class="${this._arrowClasses}"></div>`;
3217
3221
  }
3218
3222
  get _activeVariantClasses() {
3219
3223
  const variantProps = {
@@ -3256,7 +3260,7 @@ ${JSON.stringify(directions)}`);
3256
3260
  get _closeBtnHtml() {
3257
3261
  return html2`
3258
3262
  <button aria-label="${this._ariaClose}" @click="${this.close}" @keydown=${this.keypressed} class="${attention.closeBtn}">
3259
- <w-icon-close-16 />
3263
+ <w-icon-close-16></w-icon-close-16>
3260
3264
  </button>
3261
3265
  `;
3262
3266
  }
@@ -3391,7 +3395,11 @@ ${JSON.stringify(directions)}`);
3391
3395
  ${this.placement === "right-start" || this.placement === "right" || this.placement === "right-end" || this.placement === "bottom-start" || this.placement === "bottom" || this.placement === "bottom-end" ? html2`
3392
3396
  <slot name="target"></slot>
3393
3397
 
3394
- <div id="attention" role="${this.tooltip ? "tooltip" : "img"}" aria-label="${this.defaultAriaLabel()}" class="${this._wrapperClasses}">
3398
+ <div
3399
+ id="attention"
3400
+ role="${this.tooltip ? "tooltip" : "img"}"
3401
+ aria-label="${this.defaultAriaLabel()}"
3402
+ class="${this._wrapperClasses}">
3395
3403
  ${this._arrowHtml}
3396
3404
  <slot name="message"></slot>
3397
3405
  ${this.canClose ? this._closeBtnHtml : nothing}