@bison-lab/payload-core 5.1.0 → 5.2.0

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.
package/README.md CHANGED
@@ -925,6 +925,17 @@ failure sits on `translation-state` and clears on success.
925
925
  `TranslationStatusBar` is added to `admin.components.header` and asks
926
926
  `/api/translation/summary` (grant holders only).
927
927
 
928
+ ### Interface text (#298)
929
+
930
+ `translate/interface-text.ts`: the `interface-text` Global (drafts, one
931
+ `ui_messages` row per message: a non-localized `key` and a localized
932
+ `value`), added by `applyTranslation` and hooked like any localized Global.
933
+ `importMessages` moves `messages/*.json` in (dotted keys via
934
+ `flattenMessages`, publishes, never overwrites filled text, writes with
935
+ `autoTranslate: false`); `getMessages(payload, locale)` rebuilds nested
936
+ messages (`unflattenMessages`) with a per-process cache cleared by the
937
+ Global's own save.
938
+
928
939
  ## No generated types
929
940
 
930
941
  The package cannot import a site's `payload-types`, so the shapes it reads
@@ -1,5 +1,5 @@
1
1
  import { c as estimateCost, f as verifyAnthropicKey, i as ECONOMY_TRANSLATE_MODEL, n as translateStrings, o as anthropicTranslator, r as DEFAULT_TRANSLATE_MODEL, s as containsWord, t as isTranslatorConfigured } from "./strings-Fd7kUCT7.mjs";
2
- import { APIError } from "payload";
2
+ import { APIError, Forbidden } from "payload";
3
3
  import { createCipheriv, createDecipheriv, createHash, createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
4
4
  //#region src/features/types.ts
5
5
  const FEATURES_SLUG = "features";
@@ -1100,14 +1100,14 @@ function withLibraryLocales(localization) {
1100
1100
  }
1101
1101
  /** How long `activeLocales` reuses one read. A save of Settings → Translation in the same process clears it at once. */
1102
1102
  const ACTIVE_LOCALES_CACHE_MS = 6e4;
1103
- const cache$1 = /* @__PURE__ */ new WeakMap();
1103
+ const cache$2 = /* @__PURE__ */ new WeakMap();
1104
1104
  /** The last answer read from the database, kept for when a later read fails. */
1105
1105
  const lastGood = /* @__PURE__ */ new WeakMap();
1106
1106
  /** After a failed read, how soon to try the database again. */
1107
1107
  const ACTIVE_LOCALES_RETRY_MS = 5e3;
1108
1108
  /** Drops the cached answer, so the next `activeLocales` reads again. */
1109
1109
  function invalidateActiveLocales(payload) {
1110
- cache$1.delete(payload);
1110
+ cache$2.delete(payload);
1111
1111
  }
1112
1112
  /**
1113
1113
  * The ticked target languages, as the Translation screen stores them.
@@ -1131,7 +1131,7 @@ function resolveActiveTargets(stored, targets, defaults) {
1131
1131
  */
1132
1132
  function activeLocales(payload, options = {}) {
1133
1133
  const ttl = options.ttlMs ?? 6e4;
1134
- const hit = cache$1.get(payload);
1134
+ const hit = cache$2.get(payload);
1135
1135
  if (hit && Date.now() - hit.at < (hit.ttl ?? ttl)) return hit.value;
1136
1136
  const entry = {
1137
1137
  at: Date.now(),
@@ -1145,7 +1145,7 @@ function activeLocales(payload, options = {}) {
1145
1145
  entry.ttl = ACTIVE_LOCALES_RETRY_MS;
1146
1146
  return lastGood.get(payload) ?? read.value;
1147
1147
  });
1148
- cache$1.set(payload, entry);
1148
+ cache$2.set(payload, entry);
1149
1149
  return entry.value;
1150
1150
  }
1151
1151
  /** The slug `activeLocales` reads; the Translation screen's. */
@@ -1501,10 +1501,10 @@ function siteFromInstructions(instructions) {
1501
1501
  };
1502
1502
  return Object.keys(site).length > 0 ? site : void 0;
1503
1503
  }
1504
- const cache = /* @__PURE__ */ new WeakMap();
1504
+ const cache$1 = /* @__PURE__ */ new WeakMap();
1505
1505
  /** Drops the cached read, so the next one sees a save at once. */
1506
1506
  function invalidateTranslationSettings(payload) {
1507
- cache.delete(payload);
1507
+ cache$1.delete(payload);
1508
1508
  }
1509
1509
  async function readGlobal(payload, slug) {
1510
1510
  try {
@@ -1523,7 +1523,7 @@ async function readGlobal(payload, slug) {
1523
1523
  * migrated yet) reads as "off".
1524
1524
  */
1525
1525
  function readTranslationSettings(payload, codeSite) {
1526
- const hit = cache.get(payload);
1526
+ const hit = cache$1.get(payload);
1527
1527
  if (hit && Date.now() - hit.at < 5e3) return hit.value;
1528
1528
  const value = (async () => {
1529
1529
  const [doc, state] = await Promise.all([readGlobal(payload, TRANSLATION_SETTINGS_SLUG), readGlobal(payload, TRANSLATION_STATE_SLUG)]);
@@ -1543,11 +1543,11 @@ function readTranslationSettings(payload, codeSite) {
1543
1543
  state
1544
1544
  };
1545
1545
  })();
1546
- cache.set(payload, {
1546
+ cache$1.set(payload, {
1547
1547
  at: Date.now(),
1548
1548
  value
1549
1549
  });
1550
- value.catch(() => cache.delete(payload));
1550
+ value.catch(() => cache$1.delete(payload));
1551
1551
  return value;
1552
1552
  }
1553
1553
  /** The key a translation would use right now, from the stored key and the environment. */
@@ -1728,6 +1728,7 @@ function instructionFields(options) {
1728
1728
  name: "dialects",
1729
1729
  type: "array",
1730
1730
  dbName: "tr_dialects",
1731
+ admin: { initCollapsed: false },
1731
1732
  label: "Dialect per language",
1732
1733
  labels: {
1733
1734
  singular: "Dialect",
@@ -1765,7 +1766,10 @@ function instructionFields(options) {
1765
1766
  plural: "Frozen words"
1766
1767
  },
1767
1768
  defaultValue: (site?.keepVerbatim ?? []).map((word) => ({ word })),
1768
- admin: { description: FROZEN_WORDS_DESCRIPTION },
1769
+ admin: {
1770
+ description: FROZEN_WORDS_DESCRIPTION,
1771
+ initCollapsed: false
1772
+ },
1769
1773
  fields: [{
1770
1774
  name: "word",
1771
1775
  type: "text",
@@ -3611,6 +3615,273 @@ function translationSettingsEndpoints(options = {}) {
3611
3615
  ];
3612
3616
  }
3613
3617
  //#endregion
3618
+ //#region src/translate/interface-text.ts
3619
+ /**
3620
+ * A site's interface text (the strings `next-intl` reads from
3621
+ * `messages/<locale>.json`) as a localized CMS document, so the same
3622
+ * translation (switch, key, instructions, fill-on-save, hand corrections
3623
+ * kept) covers it. One row per message: a stable dotted key (`nav.plans`,
3624
+ * `faq.items.0.question`) and its localized text.
3625
+ */
3626
+ const INTERFACE_TEXT_SLUG = "interface-text";
3627
+ /** `{ nav: { plans: "Plans" }, list: ["a"] }` → `{ "nav.plans": "Plans", "list.0": "a" }`. Non-string leaves are skipped. */
3628
+ function flattenMessages(messages, prefix = "") {
3629
+ const out = {};
3630
+ const walk = (value, path) => {
3631
+ if (typeof value === "string") out[path] = value;
3632
+ else if (Array.isArray(value)) value.forEach((item, index) => walk(item, path ? `${path}.${index}` : String(index)));
3633
+ else if (value && typeof value === "object") for (const [key, item] of Object.entries(value)) walk(item, path ? `${path}.${key}` : key);
3634
+ };
3635
+ walk(messages, prefix);
3636
+ return out;
3637
+ }
3638
+ /** The reverse of `flattenMessages`: a level whose keys are 0..n-1 becomes an array. */
3639
+ function unflattenMessages(flat) {
3640
+ const root = {};
3641
+ for (const [path, value] of Object.entries(flat)) {
3642
+ const parts = path.split(".");
3643
+ let node = root;
3644
+ parts.forEach((part, index) => {
3645
+ if (index === parts.length - 1) {
3646
+ node[part] = value;
3647
+ return;
3648
+ }
3649
+ if (!node[part] || typeof node[part] !== "object") node[part] = {};
3650
+ node = node[part];
3651
+ });
3652
+ }
3653
+ const arrays = (value) => {
3654
+ if (!value || typeof value !== "object") return value;
3655
+ const entries = Object.entries(value).map(([key, item]) => [key, arrays(item)]);
3656
+ const keys = entries.map(([key]) => key);
3657
+ if (keys.length > 0 && keys.every((key, index) => /^\d+$/.test(key)) && [...keys].map(Number).sort((a, b) => a - b).every((n, index) => n === index)) return [...entries].sort((a, b) => Number(a[0]) - Number(b[0])).map(([, item]) => item);
3658
+ return Object.fromEntries(entries);
3659
+ };
3660
+ return arrays(root);
3661
+ }
3662
+ /** How long `getMessages` reuses one read per locale. A save in the same process clears it at once. */
3663
+ const MESSAGES_CACHE_MS = 6e4;
3664
+ const cache = /* @__PURE__ */ new WeakMap();
3665
+ function invalidateMessages(payload) {
3666
+ cache.delete(payload);
3667
+ }
3668
+ /**
3669
+ * The interface text for `locale` as `next-intl` messages (nested JSON).
3670
+ * An empty translation reads as the default locale's text (Payload's
3671
+ * fallback), so a page never shows a blank. Cached per process for
3672
+ * `ttlMs` (60s by default): a request reads memory, and the database is
3673
+ * read only when the cache refreshes or after a save in the same process.
3674
+ *
3675
+ * ```ts
3676
+ * // src/i18n/request.ts
3677
+ * export default getRequestConfig(async ({ requestLocale }) => {
3678
+ * const locale = (await requestLocale) ?? "en";
3679
+ * return { locale, messages: await getMessages(await getPayload({ config }), locale) };
3680
+ * });
3681
+ * ```
3682
+ */
3683
+ function getMessages(payload, locale, options = {}) {
3684
+ const ttl = options.ttlMs ?? 6e4;
3685
+ const byLocale = cache.get(payload) ?? /* @__PURE__ */ new Map();
3686
+ cache.set(payload, byLocale);
3687
+ const hit = byLocale.get(locale);
3688
+ if (hit && Date.now() - hit.at < ttl) return hit.value;
3689
+ const value = (async () => {
3690
+ const doc = await payload.findGlobal({
3691
+ slug: INTERFACE_TEXT_SLUG,
3692
+ locale,
3693
+ depth: 0,
3694
+ overrideAccess: true
3695
+ });
3696
+ const flat = {};
3697
+ for (const row of doc.messages ?? []) if (row.key && typeof row.value === "string") flat[row.key] = row.value;
3698
+ return unflattenMessages(flat);
3699
+ })();
3700
+ byLocale.set(locale, {
3701
+ at: Date.now(),
3702
+ value
3703
+ });
3704
+ value.catch(() => byLocale.delete(locale));
3705
+ return value;
3706
+ }
3707
+ /** Publishing needs the Publish grant, as on Pages and the Header; Content alone saves drafts. */
3708
+ const refusePublishWithoutGrant = async ({ data, req }) => {
3709
+ if (data?._status !== "published" || !req.user) return data;
3710
+ if (await Promise.resolve(canPublish({ req }))) return data;
3711
+ throw new Forbidden();
3712
+ };
3713
+ const clearMessages = ({ doc, req }) => {
3714
+ invalidateMessages(req.payload);
3715
+ return doc;
3716
+ };
3717
+ /**
3718
+ * The Interface text Global: one row per message, key shared by every
3719
+ * locale, text localized. Drafts on, so a publish is what re-translates
3720
+ * changed English (the usual rules). The Content grant saves drafts; the
3721
+ * Publish grant publishes, as on Pages and the Header.
3722
+ */
3723
+ function interfaceTextGlobal() {
3724
+ return {
3725
+ slug: INTERFACE_TEXT_SLUG,
3726
+ label: "Interface text",
3727
+ admin: {
3728
+ group: "Content",
3729
+ description: "The words around the content: navigation, buttons, form labels and messages. Each row's key is what the site's code asks for; only the text is translated."
3730
+ },
3731
+ access: {
3732
+ read: ({ req }) => isAuthenticated(req.user),
3733
+ update: (args) => canUseFeature("content")(args)
3734
+ },
3735
+ versions: {
3736
+ drafts: true,
3737
+ max: 50
3738
+ },
3739
+ hooks: {
3740
+ beforeChange: [refusePublishWithoutGrant],
3741
+ afterChange: [clearMessages]
3742
+ },
3743
+ fields: [{
3744
+ name: "messages",
3745
+ type: "array",
3746
+ label: "Messages",
3747
+ labels: {
3748
+ singular: "Message",
3749
+ plural: "Messages"
3750
+ },
3751
+ dbName: "ui_messages",
3752
+ admin: { initCollapsed: true },
3753
+ validate: (value) => {
3754
+ const keys = (Array.isArray(value) ? value : []).map((row) => row?.key);
3755
+ const duplicate = keys.find((key, index) => key && keys.indexOf(key) !== index);
3756
+ return duplicate ? `The key "${duplicate}" is used twice.` : true;
3757
+ },
3758
+ fields: [{
3759
+ name: "key",
3760
+ type: "text",
3761
+ label: "Key",
3762
+ required: true,
3763
+ admin: { description: "What the code asks for, e.g. nav.plans. Do not change it unless the code changes." }
3764
+ }, {
3765
+ name: "value",
3766
+ type: "textarea",
3767
+ label: "Text",
3768
+ localized: true
3769
+ }]
3770
+ }]
3771
+ };
3772
+ }
3773
+ /**
3774
+ * The migration path from `messages/<locale>.json`: the source locale's
3775
+ * file sets the keys and fills blank English, every other file fills blank
3776
+ * text in its locale. Anything already in the CMS is kept, so running it
3777
+ * again (after an editor changed a string) overwrites nothing. It
3778
+ * publishes what it writes, so it refuses while the Global has an
3779
+ * unpublished draft: publishing on top would put that draft live. Writes with
3780
+ * `context: { autoTranslate: false }`, so importing translates nothing;
3781
+ * blank strings left over fill on the next publish or backfill.
3782
+ *
3783
+ * ```ts
3784
+ * import en from "../src/messages/en.json";
3785
+ * import es from "../src/messages/es.json";
3786
+ * await importMessages(payload, { en, es });
3787
+ * ```
3788
+ */
3789
+ async function importMessages(payload, files, options = {}) {
3790
+ const localization = payload.config.localization;
3791
+ const source = options.sourceLocale ?? (localization ? localization.defaultLocale : "en");
3792
+ const sourceFile = files[source];
3793
+ if (!sourceFile) throw new Error(`importMessages: no messages for the source locale "${source}"`);
3794
+ const result = {
3795
+ added: 0,
3796
+ filled: {},
3797
+ kept: {}
3798
+ };
3799
+ const read = async (locale) => (await payload.findGlobal({
3800
+ slug: "interface-text",
3801
+ locale,
3802
+ fallbackLocale: false,
3803
+ depth: 0,
3804
+ overrideAccess: true,
3805
+ draft: true
3806
+ })).messages ?? [];
3807
+ const write = async (locale, rows) => {
3808
+ await payload.updateGlobal({
3809
+ slug: INTERFACE_TEXT_SLUG,
3810
+ locale,
3811
+ data: {
3812
+ messages: rows,
3813
+ _status: "published"
3814
+ },
3815
+ depth: 0,
3816
+ overrideAccess: true,
3817
+ context: { autoTranslate: false }
3818
+ });
3819
+ };
3820
+ const blank = (value) => typeof value !== "string" || value.trim() === "";
3821
+ if ((await payload.findGlobal({
3822
+ slug: "interface-text",
3823
+ depth: 0,
3824
+ overrideAccess: true,
3825
+ draft: true
3826
+ }))?._status === "draft") throw new Error("importMessages: Interface text has an unpublished draft. Publish or discard it in the admin, then import again, so the import does not put that draft live.");
3827
+ const flatSource = flattenMessages(sourceFile);
3828
+ const rows = (await read(source)).map((row) => ({ ...row }));
3829
+ const byKey = new Map(rows.map((row) => [row.key, row]));
3830
+ result.filled[source] = 0;
3831
+ result.kept[source] = 0;
3832
+ for (const [key, value] of Object.entries(flatSource)) {
3833
+ const row = byKey.get(key);
3834
+ if (!row) {
3835
+ const added = {
3836
+ key,
3837
+ value
3838
+ };
3839
+ rows.push(added);
3840
+ byKey.set(key, added);
3841
+ result.added += 1;
3842
+ result.filled[source] += 1;
3843
+ } else if (blank(row.value)) {
3844
+ row.value = value;
3845
+ result.filled[source] += 1;
3846
+ } else result.kept[source] += 1;
3847
+ }
3848
+ await write(source, rows);
3849
+ const saved = await read(source);
3850
+ for (const [locale, file] of Object.entries(files)) {
3851
+ if (locale === source || !file) continue;
3852
+ const flat = flattenMessages(file);
3853
+ const current = new Map((await read(locale)).map((row) => [row.id, row.value]));
3854
+ result.filled[locale] = 0;
3855
+ result.kept[locale] = 0;
3856
+ await write(locale, saved.map((row) => {
3857
+ const existing = current.get(row.id);
3858
+ const incoming = row.key ? flat[row.key] : void 0;
3859
+ if (!blank(existing)) {
3860
+ if (incoming !== void 0) result.kept[locale] += 1;
3861
+ return {
3862
+ id: row.id,
3863
+ key: row.key,
3864
+ value: existing
3865
+ };
3866
+ }
3867
+ if (incoming !== void 0 && !blank(incoming)) {
3868
+ result.filled[locale] += 1;
3869
+ return {
3870
+ id: row.id,
3871
+ key: row.key,
3872
+ value: incoming
3873
+ };
3874
+ }
3875
+ return {
3876
+ id: row.id,
3877
+ key: row.key,
3878
+ value: existing ?? null
3879
+ };
3880
+ }));
3881
+ }
3882
+ return result;
3883
+ }
3884
+ //#endregion
3614
3885
  //#region src/translate/capability.ts
3615
3886
  /** True when any field, at any depth, is localized: the entity has copy to translate. */
3616
3887
  function hasLocalizedFields(fields, blocks = []) {
@@ -3732,7 +4003,8 @@ function applyTranslation(config, options = {}) {
3732
4003
  targetLocales,
3733
4004
  defaultActive
3734
4005
  }))],
3735
- ...hasGlobal("translation-state") ? [] : [translationStateGlobal()]
4006
+ ...hasGlobal("translation-state") ? [] : [translationStateGlobal()],
4007
+ ...hasGlobal("interface-text") ? [] : [interfaceTextGlobal()]
3736
4008
  ].map((global) => {
3737
4009
  const hint = entityHint(global, options.hints);
3738
4010
  if (global.slug in state.globals) {
@@ -3824,6 +4096,6 @@ function withJobsOnSwitch(global) {
3824
4096
  };
3825
4097
  }
3826
4098
  //#endregion
3827
- export { decryptApiKey as $, validateFeaturesMatrix as $t, TRANSLATION_SETTINGS_SLUG as A, DUPLICATE_ROLE_SLUG_MESSAGE as At, monthKey as B, normalizeStoredRoles as Bt, translateDocument as C, isDeveloper as Ct, TRANSLATION_ACTIVITY_PANEL as D, DEFAULT_ROLE_MATRIX as Dt, withTranslator as E, storedRoles as Et, resolveModel as F, ROLES_GLOBAL_DESCRIPTION as Ft, LIBRARY_DEFAULT_LOCALE as G, seedRoleRows as Gt, usageHistory as H, resetRolesMatrix as Ht, siteFromInstructions as I, ROLES_SLUG as It, activeAlternates as J, defaultFeaturesFieldValue as Jt, LIBRARY_LOCALES as K, validateRolesMatrix as Kt, FAILURE_ADVICE as L, applyRoleSlugsFromNames as Lt, TRANSLATION_STATUS_BAR as M, LAST_USERS_TICK_MESSAGE as Mt, invalidateTranslationSettings as N, MISSING_SEED_ROLES_MESSAGE as Nt, TRANSLATION_GRANT as O, DEVELOPER_DESCRIPTION as Ot, readTranslationSettings as P, ROLES_FIELD_DESCRIPTION as Pt, withLibraryLocales as Q, stampFeatureCatalogue as Qt, RATE_LIMIT_STREAK as R, defaultRolesFieldValue as Rt, TRANSLATE_NOW as S, isAuthenticated as St, readTranslateState as T, isPrivilegedRole as Tt, usageThisMonth as U, roleDescription as Ut, recordUsage as V, parseRolesMatrix as Vt, ACTIVE_LOCALES_CACHE_MS as W, roleSelectOptions as Wt, inactiveLocaleRedirect as X, featureGroupLabel as Xt, activeLocales as Y, featureCatalogue as Yt, invalidateActiveLocales as Z, parseFeaturesMatrix as Zt, localizedCopyUnchanged as _, isFeatureGroupId as _n, hasGrant as _t, LEASE_MS as a, THEME_FEATURE_SLUGS as an, allowedFeaturesForUser as at, TRANSACTION_TIMEOUT_MS as b, isPackageFeatureSlug as bn, isAdmin as bt, estimateJob as c, isRoleSlug as cn, hasFeature as ct, resumeStaleJobs as d, slugifyRoleName as dn, canManageBrand as dt, CAPABILITIES as en, encryptApiKey as et, runJobSlice as f, FEATURES_SLUG as fn, canManageContent as ft, draftedTranslationDecision as g, PACKAGE_FEATURE_SLUGS as gn, hasCapability as gt, isAutosave as h, PACKAGE_FEATURES as hn, getRolesMatrix as ht, translationSettingsEndpoints as i, ROLE_LABELS as in, translationJob as it, TRANSLATION_STATE_SLUG as j, INVALID_ROLE_NAME_MESSAGE as jt, TRANSLATION_KEY_PANEL as k, DUPLICATE_ROLE_NAME_MESSAGE as kt, frozenWordForce as l, roleLabel as ln, hideUnlessFeature as lt, startJob as m, FEATURE_GROUP_LABELS as mn, developerOnlyAccess as mt, hasLocalizedFields as n, DEFAULT_ROLE_GRANTS as nn, collectLocalizedStrings as nt, TRANSLATION_JOBS_SLUG as o, isRole as on, canUseFeature as ot, startBackfill as p, FEATURE_GROUPS as pn, canPublish as pt, LIBRARY_LOCALE_CODES as q, MISSING_PACKAGE_FEATURES_MESSAGE as qt, translation as r, ROLES as rn, sameRow as rt, claimJob as s, isRoleName as sn, getFeaturesMatrix as st, applyTranslation as t, CAPABILITY_FEATURES as tn, resolveApiKey as tt, jobView as u, sanitizeRoleNameInput as un, authenticatedOrPublished as ut, shouldSkipDraftedTranslation as v, isFeatureSlug as vn, hasRole as vt, BISON_TRANSLATION_CONTEXT as w, isDeveloperTab as wt, runAfterCommit as x, isAdminOrSelf as xt, shouldSkipUndraftedTranslation as y, isLockedFeature as yn, hideUnlessDeveloper as yt, TRANSLATION_USAGE_SLUG as z, grantsFromStoredRole as zt };
4099
+ export { LIBRARY_DEFAULT_LOCALE as $, seedRoleRows as $t, TRANSLATE_NOW as A, isAuthenticated as At, TRANSLATION_STATUS_BAR as B, LAST_USERS_TICK_MESSAGE as Bt, isAutosave as C, PACKAGE_FEATURES as Cn, getRolesMatrix as Ct, shouldSkipUndraftedTranslation as D, isLockedFeature as Dn, hideUnlessDeveloper as Dt, shouldSkipDraftedTranslation as E, isFeatureSlug as En, hasRole as Et, TRANSLATION_ACTIVITY_PANEL as F, DEFAULT_ROLE_MATRIX as Ft, FAILURE_ADVICE as G, applyRoleSlugsFromNames as Gt, readTranslationSettings as H, ROLES_FIELD_DESCRIPTION as Ht, TRANSLATION_GRANT as I, DEVELOPER_DESCRIPTION as It, monthKey as J, normalizeStoredRoles as Jt, RATE_LIMIT_STREAK as K, defaultRolesFieldValue as Kt, TRANSLATION_KEY_PANEL as L, DUPLICATE_ROLE_NAME_MESSAGE as Lt, BISON_TRANSLATION_CONTEXT as M, isDeveloperTab as Mt, readTranslateState as N, isPrivilegedRole as Nt, TRANSACTION_TIMEOUT_MS as O, isPackageFeatureSlug as On, isAdmin as Ot, withTranslator as P, storedRoles as Pt, ACTIVE_LOCALES_CACHE_MS as Q, roleSelectOptions as Qt, TRANSLATION_SETTINGS_SLUG as R, DUPLICATE_ROLE_SLUG_MESSAGE as Rt, startJob as S, FEATURE_GROUP_LABELS as Sn, developerOnlyAccess as St, localizedCopyUnchanged as T, isFeatureGroupId as Tn, hasGrant as Tt, resolveModel as U, ROLES_GLOBAL_DESCRIPTION as Ut, invalidateTranslationSettings as V, MISSING_SEED_ROLES_MESSAGE as Vt, siteFromInstructions as W, ROLES_SLUG as Wt, usageHistory as X, resetRolesMatrix as Xt, recordUsage as Y, parseRolesMatrix as Yt, usageThisMonth as Z, roleDescription as Zt, frozenWordForce as _, roleLabel as _n, hideUnlessFeature as _t, MESSAGES_CACHE_MS as a, parseFeaturesMatrix as an, invalidateActiveLocales as at, runJobSlice as b, FEATURES_SLUG as bn, canManageContent as bt, importMessages as c, CAPABILITIES as cn, encryptApiKey as ct, unflattenMessages as d, ROLES as dn, sameRow as dt, validateRolesMatrix as en, LIBRARY_LOCALES as et, translationSettingsEndpoints as f, ROLE_LABELS as fn, translationJob as ft, estimateJob as g, isRoleSlug as gn, hasFeature as gt, claimJob as h, isRoleName as hn, getFeaturesMatrix as ht, INTERFACE_TEXT_SLUG as i, featureGroupLabel as in, inactiveLocaleRedirect as it, translateDocument as j, isDeveloper as jt, runAfterCommit as k, isAdminOrSelf as kt, interfaceTextGlobal as l, CAPABILITY_FEATURES as ln, resolveApiKey as lt, TRANSLATION_JOBS_SLUG as m, isRole as mn, canUseFeature as mt, hasLocalizedFields as n, defaultFeaturesFieldValue as nn, activeAlternates as nt, flattenMessages as o, stampFeatureCatalogue as on, withLibraryLocales as ot, LEASE_MS as p, THEME_FEATURE_SLUGS as pn, allowedFeaturesForUser as pt, TRANSLATION_USAGE_SLUG as q, grantsFromStoredRole as qt, translation as r, featureCatalogue as rn, activeLocales as rt, getMessages as s, validateFeaturesMatrix as sn, decryptApiKey as st, applyTranslation as t, MISSING_PACKAGE_FEATURES_MESSAGE as tn, LIBRARY_LOCALE_CODES as tt, invalidateMessages as u, DEFAULT_ROLE_GRANTS as un, collectLocalizedStrings as ut, jobView as v, sanitizeRoleNameInput as vn, authenticatedOrPublished as vt, draftedTranslationDecision as w, PACKAGE_FEATURE_SLUGS as wn, hasCapability as wt, startBackfill as x, FEATURE_GROUPS as xn, canPublish as xt, resumeStaleJobs as y, slugifyRoleName as yn, canManageBrand as yt, TRANSLATION_STATE_SLUG as z, INVALID_ROLE_NAME_MESSAGE as zt };
3828
4100
 
3829
- //# sourceMappingURL=capability-Cb62lWQo.mjs.map
4101
+ //# sourceMappingURL=capability-CAXtTcSU.mjs.map