@redacto.io/consent-sdk-js 2.0.1 → 2.1.0-beta.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.
Files changed (60) hide show
  1. package/dist/montserrat.generated-75WXFSY6.mjs +22 -0
  2. package/dist/poweredByRedacto-VYZHZOZ5.mjs +5 -0
  3. package/dist/privacy-center/images/poweredByRedacto.svg +9 -0
  4. package/dist/privacy-center/images/sentImg.svg +9 -0
  5. package/dist/privacy-center/locales/as.js +1 -0
  6. package/dist/privacy-center/locales/bn.js +1 -0
  7. package/dist/privacy-center/locales/brx.js +1 -0
  8. package/dist/privacy-center/locales/doi.js +1 -0
  9. package/dist/privacy-center/locales/gom.js +1 -0
  10. package/dist/privacy-center/locales/gu.js +1 -0
  11. package/dist/privacy-center/locales/hi.js +1 -0
  12. package/dist/privacy-center/locales/kn.js +1 -0
  13. package/dist/privacy-center/locales/ks.js +1 -0
  14. package/dist/privacy-center/locales/mai.js +1 -0
  15. package/dist/privacy-center/locales/ml.js +1 -0
  16. package/dist/privacy-center/locales/mni-Mtei.js +1 -0
  17. package/dist/privacy-center/locales/mr.js +1 -0
  18. package/dist/privacy-center/locales/ne.js +1 -0
  19. package/dist/privacy-center/locales/or.js +1 -0
  20. package/dist/privacy-center/locales/pa.js +1 -0
  21. package/dist/privacy-center/locales/sa.js +1 -0
  22. package/dist/privacy-center/locales/sat.js +1 -0
  23. package/dist/privacy-center/locales/sd.js +1 -0
  24. package/dist/privacy-center/locales/ta.js +1 -0
  25. package/dist/privacy-center/locales/te.js +1 -0
  26. package/dist/privacy-center/locales/ur.js +1 -0
  27. package/dist/redacto-privacy-center.d.mts +230 -0
  28. package/dist/redacto-privacy-center.d.ts +230 -0
  29. package/dist/redacto-privacy-center.global.js +3852 -0
  30. package/dist/redacto-privacy-center.global.js.map +1 -0
  31. package/dist/redacto-privacy-center.js +39562 -0
  32. package/dist/redacto-privacy-center.mjs +31831 -0
  33. package/dist/redacto.global.js +107 -107
  34. package/dist/redacto.global.js.map +1 -1
  35. package/dist/redacto.js +337 -92
  36. package/dist/redacto.mjs +337 -92
  37. package/dist/sentImg-RN2XSS4V.mjs +5 -0
  38. package/dist/translation-3IAUHBQO.mjs +1020 -0
  39. package/dist/translation-3TCIC57D.mjs +1020 -0
  40. package/dist/translation-4VNBLMFS.mjs +1020 -0
  41. package/dist/translation-54VF5MY3.mjs +1020 -0
  42. package/dist/translation-5O732WWG.mjs +1020 -0
  43. package/dist/translation-62B5PCBT.mjs +1020 -0
  44. package/dist/translation-7MGWGIAV.mjs +1020 -0
  45. package/dist/translation-BEC2RYFD.mjs +1020 -0
  46. package/dist/translation-BQABMEQU.mjs +1020 -0
  47. package/dist/translation-BX3FJA6E.mjs +1020 -0
  48. package/dist/translation-C4EA7NR6.mjs +1020 -0
  49. package/dist/translation-DBJE52UX.mjs +1020 -0
  50. package/dist/translation-DRTKVWFD.mjs +1020 -0
  51. package/dist/translation-FNXKSX4V.mjs +1020 -0
  52. package/dist/translation-GTONCNVZ.mjs +1029 -0
  53. package/dist/translation-HUUSKQB5.mjs +1020 -0
  54. package/dist/translation-ITVO7LSO.mjs +1020 -0
  55. package/dist/translation-MBGE7KYU.mjs +1020 -0
  56. package/dist/translation-NAWDRQYM.mjs +1020 -0
  57. package/dist/translation-TP6K4SC4.mjs +1020 -0
  58. package/dist/translation-W6HTCTKZ.mjs +1020 -0
  59. package/dist/translation-WFBFKNV5.mjs +1020 -0
  60. package/package.json +6 -1
package/dist/redacto.mjs CHANGED
@@ -297,7 +297,7 @@ function toLanguageCode(lang) {
297
297
  function resolveDisplayLanguage(requested, defaultLanguage, translations) {
298
298
  const fallback = defaultLanguage || "en";
299
299
  const requestedCode = toLanguageCode(requested);
300
- if (!requestedCode) {
300
+ if (!requestedCode || requestedCode === "en") {
301
301
  return fallback;
302
302
  }
303
303
  for (const key of Object.keys(translations || {})) {
@@ -307,6 +307,13 @@ function resolveDisplayLanguage(requested, defaultLanguage, translations) {
307
307
  }
308
308
  return fallback;
309
309
  }
310
+ function noticeLanguageOptions(defaultLanguage, translations) {
311
+ const first = defaultLanguage || "English";
312
+ const rest = Object.keys(translations || {}).filter(
313
+ (language) => language !== first && toLanguageCode(language) !== "en"
314
+ );
315
+ return toLanguageCode(first) === "en" ? [first, ...rest] : ["English", first, ...rest];
316
+ }
310
317
 
311
318
  // src/api/submit-payload.ts
312
319
  var toSubmitPurposes = (purposes) => purposes.map((purpose) => {
@@ -1586,6 +1593,7 @@ var NOTICE_DESKTOP_POSITIONS = [
1586
1593
  ];
1587
1594
  var NOTICE_BACKDROPS = ["dim", "none"];
1588
1595
  var NOTICE_PHONE_FOOTERS = ["stacked", "paired"];
1596
+ var PURPOSE_DESCRIPTION_PLACEMENTS = ["always", "expanded", "hidden"];
1589
1597
  var NOTICE_TEXT_SCALES = ["sm", "md", "lg"];
1590
1598
  var DEFAULT_TEXT_SCALE = "md";
1591
1599
  var DEFAULT_DESKTOP_POSITION = "center";
@@ -1636,6 +1644,46 @@ var THEMED_CONTROL_OFF = `var(${NOTICE_THEME_VARS.controlOff}, #d0d5dd)`;
1636
1644
  var THEMED_TTS_BACKGROUND = `var(${NOTICE_THEME_VARS.ttsBackground}, ${DEFAULT_TTS_HIGHLIGHT_BG})`;
1637
1645
  var TTS_TEXT_ATTRIBUTE = "data-redacto-tts-text";
1638
1646
 
1647
+ // src/shared/appearance/noticeChrome.ts
1648
+ var DEFAULT_NOTICE_CHROME = {
1649
+ showsProductSection: true,
1650
+ showsDataElements: true,
1651
+ descriptionPlacement: "always",
1652
+ showsPurposeSectionHeading: true,
1653
+ controlPosition: "right",
1654
+ headerAlign: "left",
1655
+ showsTitle: true,
1656
+ showsAudioButton: true,
1657
+ showsLogo: true,
1658
+ inlinesPolicyLink: false,
1659
+ privacyCenterAsText: false,
1660
+ showsRequiredHint: true
1661
+ };
1662
+ var noticeChromeOptions = (served) => {
1663
+ if (!served) return DEFAULT_NOTICE_CHROME;
1664
+ const placement = PURPOSE_DESCRIPTION_PLACEMENTS.find(
1665
+ (value) => value === served.purpose_description
1666
+ );
1667
+ return {
1668
+ showsProductSection: served.show_product_section !== false,
1669
+ showsDataElements: served.show_data_elements !== false,
1670
+ descriptionPlacement: placement != null ? placement : DEFAULT_NOTICE_CHROME.descriptionPlacement,
1671
+ showsPurposeSectionHeading: served.show_purpose_section_heading !== false,
1672
+ controlPosition: served.control_position === "left" ? "left" : "right",
1673
+ headerAlign: served.header_align === "center" ? "center" : "left",
1674
+ showsTitle: served.show_title !== false,
1675
+ showsAudioButton: served.show_audio_button !== false,
1676
+ showsLogo: served.show_logo !== false,
1677
+ inlinesPolicyLink: served.privacy_policy_inline === true,
1678
+ privacyCenterAsText: served.privacy_center_as_text === true,
1679
+ showsRequiredHint: served.show_required_hint !== false
1680
+ };
1681
+ };
1682
+ var leadsWithControl = (chrome) => chrome.controlPosition === "left";
1683
+ var centresHeader = (chrome) => chrome.headerAlign === "center";
1684
+ var headerHoldsOnlyControls = (chrome, hasLogo) => !chrome.showsTitle && !(chrome.showsLogo && hasLogo);
1685
+ var showsPrivacyCenter = (chrome, url, anchorText) => chrome.privacyCenterAsText ? Boolean(anchorText == null ? void 0 : anchorText.trim()) : Boolean(url);
1686
+
1639
1687
  // src/shared/appearance/ttsCssVariables.ts
1640
1688
  var buildTtsCssVariables = (colors) => Object.fromEntries(
1641
1689
  [
@@ -2197,6 +2245,18 @@ var injectCheckboxStyles = (root) => {
2197
2245
  };
2198
2246
 
2199
2247
  // src/styles/modal.ts
2248
+ var visuallyHidden = {
2249
+ position: "absolute",
2250
+ width: "1px",
2251
+ height: "1px",
2252
+ margin: "-1px",
2253
+ padding: 0,
2254
+ overflow: "hidden",
2255
+ clip: "rect(0 0 0 0)",
2256
+ clipPath: "inset(50%)",
2257
+ whiteSpace: "nowrap",
2258
+ border: 0
2259
+ };
2200
2260
  var styles = {
2201
2261
  overlay: {
2202
2262
  position: "fixed",
@@ -2303,6 +2363,37 @@ var styles = {
2303
2363
  padding: 0,
2304
2364
  boxSizing: "border-box"
2305
2365
  },
2366
+ // With no logo and no title the header holds nothing but the controls, and
2367
+ // the padding sized for a masthead reads as dead space above the notice text.
2368
+ headerStackControlsOnly: {
2369
+ paddingBottom: 0
2370
+ },
2371
+ // A hidden title leaves the flex row, so without this the controls it used
2372
+ // to push along would collapse to the leading edge.
2373
+ headerRowTrailing: {
2374
+ justifyContent: "flex-end"
2375
+ },
2376
+ // The centred title owns its row: the controls that normally share it would
2377
+ // pull it off centre, so they move below the notice text.
2378
+ headerRowCentred: {
2379
+ display: "flex",
2380
+ alignItems: "center",
2381
+ justifyContent: "center",
2382
+ gap: "10px",
2383
+ width: "100%",
2384
+ margin: 0,
2385
+ padding: 0,
2386
+ boxSizing: "border-box"
2387
+ },
2388
+ headerControlsRow: {
2389
+ display: "flex",
2390
+ alignItems: "center",
2391
+ justifyContent: "flex-end",
2392
+ width: "100%",
2393
+ margin: 0,
2394
+ padding: 0,
2395
+ boxSizing: "border-box"
2396
+ },
2306
2397
  logo: {
2307
2398
  height: "32px",
2308
2399
  width: "auto",
@@ -2313,6 +2404,13 @@ var styles = {
2313
2404
  padding: 0,
2314
2405
  display: "block"
2315
2406
  },
2407
+ titleCentred: {
2408
+ textAlign: "center",
2409
+ width: "100%"
2410
+ },
2411
+ // Hidden from sight, kept for the screen reader: the dialog is named by this
2412
+ // heading through aria-labelledby, and focus enters the notice on it.
2413
+ titleHidden: visuallyHidden,
2316
2414
  title: {
2317
2415
  fontSize: "18px",
2318
2416
  fontWeight: 700,
@@ -2370,6 +2468,9 @@ var styles = {
2370
2468
  padding: 0,
2371
2469
  textAlign: "left"
2372
2470
  },
2471
+ privacyTextCentred: {
2472
+ textAlign: "center"
2473
+ },
2373
2474
  link: {
2374
2475
  color: "#4f87ff",
2375
2476
  textDecoration: "none",
@@ -2403,6 +2504,11 @@ var styles = {
2403
2504
  padding: 0,
2404
2505
  boxSizing: "border-box"
2405
2506
  },
2507
+ // The row is space-between with the text block growing, so a leading tick
2508
+ // would otherwise sit flush against the label.
2509
+ optionItemLeading: {
2510
+ gap: "12px"
2511
+ },
2406
2512
  optionLeft: {
2407
2513
  display: "flex",
2408
2514
  gap: "12px",
@@ -2482,6 +2588,11 @@ var styles = {
2482
2588
  boxSizing: "border-box",
2483
2589
  minHeight: "24px"
2484
2590
  },
2591
+ // The tick leads, so the label follows it instead of being pushed to the
2592
+ // opposite edge by the row's space-between.
2593
+ dataElementItemLeading: {
2594
+ justifyContent: "flex-start"
2595
+ },
2485
2596
  // Applied only where the control is taller than a checkbox: a yes/no pair,
2486
2597
  // a dropdown or a switch. Unconditionally these leave the checkbox rows
2487
2598
  // loose.
@@ -2761,7 +2872,10 @@ var styles = {
2761
2872
  margin: 0,
2762
2873
  paddingTop: "12px",
2763
2874
  boxSizing: "border-box"
2764
- }
2875
+ },
2876
+ // The required-purposes hint the console switched off: it still describes
2877
+ // the held Accept selected button.
2878
+ confirmHintHidden: visuallyHidden
2765
2879
  };
2766
2880
 
2767
2881
  // src/core/required-marker.ts
@@ -3250,7 +3364,8 @@ var CLASSIC_PURPOSE_LOOK = {
3250
3364
  textColor: DEFAULT_TEXT_COLOR,
3251
3365
  selectionControl: DEFAULT_SELECTION_CONTROL,
3252
3366
  roomyControls: false,
3253
- drawsSwitches: false
3367
+ drawsSwitches: false,
3368
+ chrome: DEFAULT_NOTICE_CHROME
3254
3369
  };
3255
3370
  var settledMark = (consented, label) => consented ? createGreenCheckmark(16, label) : el("div", {
3256
3371
  role: "img",
@@ -3286,6 +3401,8 @@ function renderModalPurposes(purposes, options) {
3286
3401
  onDataElementToggle
3287
3402
  } = options;
3288
3403
  const { styles: styles2, responsive, headingColor, textColor } = look;
3404
+ const chrome = look.chrome;
3405
+ const controlLeads = leadsWithControl(chrome);
3289
3406
  const elementControls = /* @__PURE__ */ new Map();
3290
3407
  const purposeControls = /* @__PURE__ */ new Map();
3291
3408
  const collapseButtons = /* @__PURE__ */ new Map();
@@ -3300,7 +3417,15 @@ function renderModalPurposes(purposes, options) {
3300
3417
  const stateKey = productPurposeKey(productUuid, purpose.uuid);
3301
3418
  const locked = isRowLocked ? isRowLocked(purpose.uuid) : isAlreadyConsented;
3302
3419
  const purposeName = getTranslatedText("purposes.name", purpose.name, purpose.uuid);
3303
- const chevron = svg(
3420
+ const descriptionText = getTranslatedText(
3421
+ "purposes.description",
3422
+ purpose.description,
3423
+ purpose.uuid
3424
+ );
3425
+ const hasDataElements = chrome.showsDataElements && ((_d = (_c = purpose.data_elements) == null ? void 0 : _c.length) != null ? _d : 0) > 0;
3426
+ const disclosesDescription = chrome.descriptionPlacement === "expanded" && descriptionText.trim() !== "";
3427
+ const hasDisclosure = hasDataElements || disclosesDescription;
3428
+ const chevron = hasDisclosure ? svg(
3304
3429
  "svg",
3305
3430
  {
3306
3431
  width: "7",
@@ -3319,13 +3444,13 @@ function renderModalPurposes(purposes, options) {
3319
3444
  "aria-hidden": "true"
3320
3445
  },
3321
3446
  svg("path", { d: "M1 1L6 6L1 11" })
3322
- );
3323
- chevrons.set(stateKey, chevron);
3324
- const chevronContainer = el(
3447
+ ) : null;
3448
+ if (chevron) chevrons.set(stateKey, chevron);
3449
+ const chevronContainer = chevron ? el(
3325
3450
  "div",
3326
3451
  { style: { display: "flex", alignItems: "center", justifyContent: "center", marginLeft: "5px" } },
3327
3452
  chevron
3328
- );
3453
+ ) : null;
3329
3454
  const titleEl = el("h2", {
3330
3455
  id: `purpose-name-${stateKey}`,
3331
3456
  ...part("purpose-title"),
@@ -3340,33 +3465,48 @@ function renderModalPurposes(purposes, options) {
3340
3465
  titleEl.appendChild(createRequiredMarker());
3341
3466
  }
3342
3467
  titleElements.set(stateKey, titleEl);
3343
- const descEl = el("h3", {
3468
+ const descEl = chrome.descriptionPlacement === "hidden" ? null : el("h3", {
3344
3469
  id: `purpose-description-${stateKey}`,
3345
3470
  style: {
3346
3471
  ...styles2.optionDescription,
3347
3472
  ...responsive.optionDescription,
3348
- color: (_c = look.mutedTextColor) != null ? _c : textColor
3473
+ color: (_e = look.mutedTextColor) != null ? _e : textColor
3349
3474
  }
3350
3475
  });
3351
- descEl.textContent = getTranslatedText("purposes.description", purpose.description, purpose.uuid);
3352
- descriptionElements.set(stateKey, descEl);
3353
- const textContainer = el("div", { style: styles2.optionTextContainer }, titleEl, descEl);
3354
- const collapseBtn = el("div", {
3355
- style: styles2.optionLeft,
3356
- role: "button",
3357
- tabIndex: "0",
3358
- "aria-expanded": String(!collapsedPurposes[stateKey]),
3359
- "aria-controls": `purpose-${stateKey}`,
3360
- "aria-label": `${collapsedPurposes[stateKey] ? "Expand" : "Collapse"} ${purposeName} details`,
3361
- onClick: () => onPurposeCollapse(purpose.uuid, productUuid),
3362
- onKeydown: (e) => {
3363
- if (e.key === "Enter" || e.key === " ") {
3364
- e.preventDefault();
3365
- onPurposeCollapse(purpose.uuid, productUuid);
3366
- }
3367
- }
3368
- }, chevronContainer, textContainer);
3369
- collapseButtons.set(stateKey, collapseBtn);
3476
+ if (descEl) {
3477
+ descEl.textContent = descriptionText;
3478
+ descriptionElements.set(stateKey, descEl);
3479
+ }
3480
+ const textContainer = el(
3481
+ "div",
3482
+ { style: styles2.optionTextContainer },
3483
+ titleEl,
3484
+ chrome.descriptionPlacement === "always" ? descEl : null
3485
+ );
3486
+ const collapseBtn = el(
3487
+ "div",
3488
+ {
3489
+ style: styles2.optionLeft,
3490
+ ...hasDisclosure ? {
3491
+ role: "button",
3492
+ tabIndex: "0",
3493
+ "aria-expanded": String(!collapsedPurposes[stateKey]),
3494
+ "aria-controls": `purpose-${stateKey}`,
3495
+ "aria-label": `${collapsedPurposes[stateKey] ? "Expand" : "Collapse"} ${purposeName} details`,
3496
+ onClick: () => onPurposeCollapse(purpose.uuid, productUuid),
3497
+ onKeydown: (e) => {
3498
+ if (e.key === "Enter" || e.key === " ") {
3499
+ e.preventDefault();
3500
+ onPurposeCollapse(purpose.uuid, productUuid);
3501
+ }
3502
+ }
3503
+ } : {}
3504
+ },
3505
+ controlLeads ? null : chevronContainer,
3506
+ textContainer,
3507
+ controlLeads ? chevronContainer : null
3508
+ );
3509
+ if (hasDisclosure) collapseButtons.set(stateKey, collapseBtn);
3370
3510
  const purposeControl = renderSelectionControl({
3371
3511
  control: look.selectionControl,
3372
3512
  checked: selectedPurposes[stateKey] || false,
@@ -3385,9 +3525,16 @@ function renderModalPurposes(purposes, options) {
3385
3525
  }
3386
3526
  const optionRow = el(
3387
3527
  "div",
3388
- { ...part("purpose"), style: styles2.optionItem },
3528
+ {
3529
+ ...part("purpose"),
3530
+ style: {
3531
+ ...styles2.optionItem,
3532
+ ...controlLeads ? styles2.optionItemLeading : {}
3533
+ }
3534
+ },
3535
+ controlLeads ? purposeControl.element : null,
3389
3536
  collapseBtn,
3390
- purposeControl.element
3537
+ controlLeads ? null : purposeControl.element
3391
3538
  );
3392
3539
  const deContainer = el("div", {
3393
3540
  id: `purpose-${stateKey}`,
@@ -3396,7 +3543,10 @@ function renderModalPurposes(purposes, options) {
3396
3543
  ...look.roomyControls ? styles2.dataElementsContainerRoomy : {}
3397
3544
  }
3398
3545
  });
3399
- if (((_d = purpose.data_elements) == null ? void 0 : _d.length) > 0) {
3546
+ if (disclosesDescription && descEl) {
3547
+ deContainer.appendChild(descEl);
3548
+ }
3549
+ if (hasDataElements) {
3400
3550
  for (const dataElement of purpose.data_elements) {
3401
3551
  const combinedId = `${stateKey}-${dataElement.uuid}`;
3402
3552
  const elementName = getTranslatedText("data_elements.name", dataElement.name, dataElement.uuid);
@@ -3441,19 +3591,25 @@ function renderModalPurposes(purposes, options) {
3441
3591
  ...part("data-element"),
3442
3592
  style: {
3443
3593
  ...styles2.dataElementItem,
3444
- ...look.roomyControls ? styles2.dataElementItemRoomy : {}
3594
+ ...look.roomyControls ? styles2.dataElementItemRoomy : {},
3595
+ // space-between would push a leading tick's label to the far
3596
+ // edge, leaving the two at opposite ends of an empty row.
3597
+ ...controlLeads ? styles2.dataElementItemLeading : {}
3445
3598
  }
3446
3599
  },
3600
+ controlLeads ? deRightElement : null,
3447
3601
  labelSpan,
3448
- deRightElement
3602
+ controlLeads ? null : deRightElement
3449
3603
  );
3450
3604
  deContainer.appendChild(deRow);
3451
3605
  }
3452
3606
  }
3453
- dataElementContainers.set(stateKey, deContainer);
3454
- deContainer.style.display = !collapsedPurposes[stateKey] && ((_e = purpose.data_elements) == null ? void 0 : _e.length) > 0 ? "flex" : "none";
3455
3607
  purposeWrapper.appendChild(optionRow);
3456
- purposeWrapper.appendChild(deContainer);
3608
+ if (hasDisclosure) {
3609
+ dataElementContainers.set(stateKey, deContainer);
3610
+ deContainer.style.display = collapsedPurposes[stateKey] ? "none" : "flex";
3611
+ purposeWrapper.appendChild(deContainer);
3612
+ }
3457
3613
  container.appendChild(purposeWrapper);
3458
3614
  }
3459
3615
  return {
@@ -3856,7 +4012,7 @@ var TTSManager = class {
3856
4012
  workspaceUuid: params.workspaceUuid
3857
4013
  });
3858
4014
  this.audioUrls = response.detail;
3859
- this.buildSequences(params.content, params.purposes);
4015
+ this.buildSequences(params.content, params.purposes, params.chrome);
3860
4016
  this._isAvailable = this.audioSequence.length > 0;
3861
4017
  this.onStateChange();
3862
4018
  } catch (error) {
@@ -3869,7 +4025,7 @@ var TTSManager = class {
3869
4025
  }
3870
4026
  }
3871
4027
  }
3872
- buildSequences(content, ordered) {
4028
+ buildSequences(content, ordered, chrome = DEFAULT_NOTICE_CHROME) {
3873
4029
  var _a, _b;
3874
4030
  if (!this.audioUrls) return;
3875
4031
  const urls = this.audioUrls;
@@ -3885,7 +4041,9 @@ var TTSManager = class {
3885
4041
  push(urls.notice_text_audio_url, "privacy-notice-text");
3886
4042
  push(urls.privacy_policy_prefix_text_audio_url, "privacy-policy-text");
3887
4043
  push(urls.privacy_policy_anchor_text_audio_url, "privacy-policy-link");
3888
- push(urls.purpose_section_heading_audio_url, "purpose-section-heading");
4044
+ if (chrome.showsPurposeSectionHeading) {
4045
+ push(urls.purpose_section_heading_audio_url, "purpose-section-heading");
4046
+ }
3889
4047
  const purposes = ordered != null ? ordered : purposesInRenderOrder(
3890
4048
  content.products,
3891
4049
  content.purposes,
@@ -3895,8 +4053,14 @@ var TTSManager = class {
3895
4053
  const purposeAudio = (_a = urls.purposes_audio) == null ? void 0 : _a[purpose.uuid];
3896
4054
  if (purposeAudio) {
3897
4055
  push(purposeAudio.name_audio_url, `purpose-name-${purpose.uuid}`);
3898
- push(purposeAudio.description_audio_url, `purpose-description-${purpose.uuid}`);
4056
+ if (chrome.descriptionPlacement !== "hidden") {
4057
+ push(
4058
+ purposeAudio.description_audio_url,
4059
+ chrome.descriptionPlacement === "always" ? `purpose-description-${purpose.uuid}` : ""
4060
+ );
4061
+ }
3899
4062
  }
4063
+ if (!chrome.showsDataElements) continue;
3900
4064
  for (const de of purpose.data_elements) {
3901
4065
  const deAudio = (_b = urls.data_elements_audio) == null ? void 0 : _b[de.uuid];
3902
4066
  if (deAudio) {
@@ -3907,7 +4071,7 @@ var TTSManager = class {
3907
4071
  if (content.additional_text) {
3908
4072
  push(urls.additional_text_audio_url, "additional-text");
3909
4073
  }
3910
- if (content.privacy_center_url) {
4074
+ if (showsPrivacyCenter(chrome, content.privacy_center_url, content.privacy_center_anchor_text)) {
3911
4075
  push(urls.privacy_center_anchor_text_audio_url, "privacy-center-link");
3912
4076
  }
3913
4077
  if (urls.dpo_info_audio) {
@@ -5022,6 +5186,11 @@ var confirmHint = (verdict, products, productName, copy = CONFIRM_HINT_COPY) =>
5022
5186
  });
5023
5187
  return copy.productsIncomplete(names);
5024
5188
  };
5189
+ var REQUIRED_HINT_REASONS = /* @__PURE__ */ new Set([
5190
+ "required-outstanding",
5191
+ "product-incomplete"
5192
+ ]);
5193
+ var drawsConfirmHint = (verdict, showsRequiredHint) => showsRequiredHint || !REQUIRED_HINT_REASONS.has(verdict.reason);
5025
5194
  var submissionPurposes = (rows, selection) => rows.map(({ purpose, productUuid }) => {
5026
5195
  const key = productPurposeKey(productUuid, purpose.uuid);
5027
5196
  return {
@@ -5112,6 +5281,7 @@ function renderProductSection(options) {
5112
5281
  } = options;
5113
5282
  const look = (_a = options.look) != null ? _a : CLASSIC_PURPOSE_LOOK;
5114
5283
  const styles2 = look.styles;
5284
+ const controlLeads = leadsWithControl(look.chrome);
5115
5285
  const name = getTranslatedText("products.name", product.name, product.uuid);
5116
5286
  const headingColor = look.headingColor;
5117
5287
  const boxPurposes = productBoxPurposes(purposes);
@@ -5188,9 +5358,22 @@ function renderProductSection(options) {
5188
5358
  );
5189
5359
  const header = el(
5190
5360
  "div",
5191
- { ...part("product"), style: styles2.sectionHeader },
5192
- el("div", { style: styles2.optionLeft }, collapseButton, heading),
5193
- selection.element
5361
+ {
5362
+ ...part("product"),
5363
+ style: {
5364
+ ...styles2.sectionHeader,
5365
+ ...controlLeads ? styles2.optionItemLeading : {}
5366
+ }
5367
+ },
5368
+ controlLeads ? selection.element : null,
5369
+ el(
5370
+ "div",
5371
+ { style: styles2.optionLeft },
5372
+ controlLeads ? null : collapseButton,
5373
+ heading,
5374
+ controlLeads ? collapseButton : null
5375
+ ),
5376
+ controlLeads ? null : selection.element
5194
5377
  );
5195
5378
  const body = el("div", { id: `product-${product.uuid}`, style: styles2.sectionBody });
5196
5379
  body.hidden = collapsed;
@@ -5279,14 +5462,23 @@ function mergePurposeRefs(container, parts) {
5279
5462
  function renderConfirmHint(style) {
5280
5463
  return el("p", { id: CONFIRM_HINT_ID, role: "status", style: style != null ? style : styles.confirmHint });
5281
5464
  }
5282
- function updateConfirmHint(hintEl, anchor, describedButton, text) {
5465
+ function updateConfirmHint(hintEl, anchor, describedButton, text, style, drawn = true) {
5283
5466
  var _a;
5284
5467
  if (!text) {
5285
5468
  hintEl.remove();
5286
5469
  describedButton == null ? void 0 : describedButton.removeAttribute("aria-describedby");
5287
5470
  return;
5288
5471
  }
5289
- hintEl.textContent = text;
5472
+ if (style) {
5473
+ hintEl.removeAttribute("style");
5474
+ applyStyles(hintEl, style);
5475
+ }
5476
+ if (drawn) {
5477
+ hintEl.setAttribute("role", "status");
5478
+ } else {
5479
+ hintEl.removeAttribute("role");
5480
+ }
5481
+ if (hintEl.textContent !== text) hintEl.textContent = text;
5290
5482
  if (hintEl.nextSibling !== anchor) {
5291
5483
  (_a = anchor.parentNode) == null ? void 0 : _a.insertBefore(hintEl, anchor);
5292
5484
  }
@@ -6958,6 +7150,7 @@ var buildModalLook = ({
6958
7150
  settings,
6959
7151
  prefersDark
6960
7152
  );
7153
+ const chrome = noticeChromeOptions(content ? content.appearance : cachedAppearance);
6961
7154
  const style = appearance.style;
6962
7155
  const colors = appearance.colors;
6963
7156
  const layout = resolveNoticeLayout(appearance);
@@ -7062,6 +7255,7 @@ var buildModalLook = ({
7062
7255
  return {
7063
7256
  appearance,
7064
7257
  layout,
7258
+ chrome,
7065
7259
  skin,
7066
7260
  styles: styles2,
7067
7261
  responsive: scaleFontSizes(responsive, textScale),
@@ -8026,7 +8220,8 @@ var ModalController = class {
8026
8220
  controlSkin: look.controlSkin,
8027
8221
  rowClassName: (_a = look.skin) == null ? void 0 : _a.parts.rowClassName,
8028
8222
  roomyControls: look.roomyControls,
8029
- drawsSwitches: look.drawsSwitches
8223
+ drawsSwitches: look.drawsSwitches,
8224
+ chrome: look.chrome
8030
8225
  };
8031
8226
  }
8032
8227
  disposeSections() {
@@ -8116,7 +8311,7 @@ var ModalController = class {
8116
8311
  this.store.setState({ collapsedPurposes });
8117
8312
  }
8118
8313
  rebuildUI() {
8119
- var _a, _b, _c, _d, _e, _f;
8314
+ var _a, _b, _c, _d, _e, _f, _g;
8120
8315
  const state = this.store.getState();
8121
8316
  if (!state.content || !this.modalEl) return;
8122
8317
  const activeConfig = state.content.detail.active_config;
@@ -8210,18 +8405,20 @@ var ModalController = class {
8210
8405
  this.modalEl.setAttribute("aria-labelledby", "privacy-notice-title");
8211
8406
  this.modalEl.setAttribute("aria-describedby", "privacy-notice-description");
8212
8407
  const { styles: styles2, responsive, sheetParts, parts, headingColor, textColor } = look;
8408
+ const chromeOptions = look.chrome;
8213
8409
  const chrome = noticeChromeCopy(state.selectedLanguage);
8214
8410
  const purposeLook = this.purposeLook(look, state.selectedLanguage);
8215
8411
  const linkStyle = { ...styles2.link, color: look.linkColor };
8216
8412
  const textStyle2 = {
8217
8413
  ...styles2.privacyText,
8218
8414
  ...responsive.privacyText,
8219
- color: textColor
8415
+ color: textColor,
8416
+ ...centresHeader(chromeOptions) ? styles2.privacyTextCentred : {}
8220
8417
  };
8221
8418
  if (look.docked && isMobile) {
8222
8419
  this.modalEl.appendChild(el("div", { style: parts.grabber, "aria-hidden": "true" }));
8223
8420
  }
8224
- const logoImg = activeConfig.logo_url ? el("img", {
8421
+ const logoImg = chromeOptions.showsLogo && activeConfig.logo_url ? el("img", {
8225
8422
  ...part("logo"),
8226
8423
  src: activeConfig.logo_url,
8227
8424
  style: { ...styles2.logo, ...responsive.logo },
@@ -8230,7 +8427,14 @@ var ModalController = class {
8230
8427
  this.noticeTitleEl = el("h2", {
8231
8428
  id: "privacy-notice-title",
8232
8429
  ...part("title"),
8233
- style: { ...styles2.title, ...responsive.title, color: headingColor }
8430
+ tabIndex: "-1",
8431
+ style: {
8432
+ ...styles2.title,
8433
+ ...responsive.title,
8434
+ color: headingColor,
8435
+ ...centresHeader(chromeOptions) ? styles2.titleCentred : {},
8436
+ ...chromeOptions.showsTitle ? {} : styles2.titleHidden
8437
+ }
8234
8438
  });
8235
8439
  this.noticeTitleEl.textContent = this.getTranslatedText(
8236
8440
  "notice_banner_heading",
@@ -8240,11 +8444,10 @@ var ModalController = class {
8240
8444
  this.langSelectorRefs.close();
8241
8445
  this.shadowRoot.removeChild(this.langSelectorRefs.dropdown);
8242
8446
  }
8243
- const supportedLangs = Object.keys(activeConfig.supported_languages_and_translations || {});
8244
- const allLanguages = [
8245
- activeConfig.default_language || "English",
8246
- ...supportedLangs.filter((l) => l !== activeConfig.default_language)
8247
- ];
8447
+ const allLanguages = noticeLanguageOptions(
8448
+ activeConfig.default_language,
8449
+ activeConfig.supported_languages_and_translations
8450
+ );
8248
8451
  this.langSelectorRefs = renderLanguageSelector({
8249
8452
  languages: allLanguages,
8250
8453
  selectedLanguage: state.selectedLanguage,
@@ -8259,7 +8462,7 @@ var ModalController = class {
8259
8462
  onSelect: (lang) => this.handleLanguageSelect(lang),
8260
8463
  dropdownContainer: this.shadowRoot
8261
8464
  });
8262
- this.ttsButton = el("button", {
8465
+ this.ttsButton = chromeOptions.showsAudioButton ? el("button", {
8263
8466
  style: {
8264
8467
  ...styles2.topRight,
8265
8468
  ...responsive.topRight,
@@ -8276,9 +8479,9 @@ var ModalController = class {
8276
8479
  var _a2;
8277
8480
  return (_a2 = this.ttsManager) == null ? void 0 : _a2.toggle();
8278
8481
  }
8279
- });
8280
- this.ttsButton.appendChild(this.speakerIcon(false));
8281
- (_e = this.ttsManager) == null ? void 0 : _e.fetchAudioUrls({
8482
+ }) : null;
8483
+ (_e = this.ttsButton) == null ? void 0 : _e.appendChild(this.speakerIcon(false));
8484
+ (_f = this.ttsManager) == null ? void 0 : _f.fetchAudioUrls({
8282
8485
  accessToken: this.options.accessToken,
8283
8486
  baseUrl: this.endpoints.baseUrl,
8284
8487
  ledgerBaseUrl: this.endpoints.ledgerBaseUrl,
@@ -8287,6 +8490,7 @@ var ModalController = class {
8287
8490
  language: this.getLanguageCode(state.selectedLanguage),
8288
8491
  content: activeConfig,
8289
8492
  purposes: this.talkbackPurposes(state),
8493
+ chrome: chromeOptions,
8290
8494
  ...this.sandboxParams()
8291
8495
  });
8292
8496
  const topRight = el("div", {
@@ -8303,7 +8507,19 @@ var ModalController = class {
8303
8507
  )
8304
8508
  );
8305
8509
  }
8306
- headerRows.push(el("div", { style: styles2.headerRow }, this.noticeTitleEl, topRight));
8510
+ headerRows.push(
8511
+ centresHeader(chromeOptions) ? el("div", { style: styles2.headerRowCentred }, this.noticeTitleEl) : el(
8512
+ "div",
8513
+ {
8514
+ style: {
8515
+ ...styles2.headerRow,
8516
+ ...chromeOptions.showsTitle ? {} : styles2.headerRowTrailing
8517
+ }
8518
+ },
8519
+ this.noticeTitleEl,
8520
+ topRight
8521
+ )
8522
+ );
8307
8523
  const topSection = el(
8308
8524
  "div",
8309
8525
  {
@@ -8311,6 +8527,7 @@ var ModalController = class {
8311
8527
  style: {
8312
8528
  ...styles2.headerStack,
8313
8529
  ...responsive.headerStack,
8530
+ ...headerHoldsOnlyControls(chromeOptions, Boolean(activeConfig.logo_url)) ? styles2.headerStackControlsOnly : {},
8314
8531
  ...sheetParts == null ? void 0 : sheetParts.sheetHeader,
8315
8532
  color: textColor
8316
8533
  }
@@ -8362,7 +8579,7 @@ var ModalController = class {
8362
8579
  "p",
8363
8580
  { ...part("notice-text"), style: textStyle2 },
8364
8581
  noticeTextSpan,
8365
- showNoticePolicyLink && el("br"),
8582
+ showNoticePolicyLink && (chromeOptions.inlinesPolicyLink ? " " : el("br")),
8366
8583
  showNoticePolicyLink && policySpan
8367
8584
  );
8368
8585
  const dpoPreview = activeConfig.dpo_info ? this.getTranslatedDpoText("grievance_text", activeConfig.dpo_info.grievance_text || "") : activeConfig.additional_text ? this.getTranslatedText("additional_text", activeConfig.additional_text) : "";
@@ -8374,15 +8591,22 @@ var ModalController = class {
8374
8591
  fallback: activeConfig.privacy_policy_anchor_text ? policyAnchorText : ""
8375
8592
  })
8376
8593
  );
8377
- this.purposeHeadingEl = el("h2", {
8594
+ if (centresHeader(chromeOptions)) {
8595
+ this.middleSection.appendChild(
8596
+ el("div", { style: styles2.headerControlsRow }, topRight)
8597
+ );
8598
+ }
8599
+ this.purposeHeadingEl = chromeOptions.showsPurposeSectionHeading ? el("h2", {
8378
8600
  id: "purpose-section-heading",
8379
8601
  style: { ...styles2.subTitle, ...responsive.subTitle, color: headingColor }
8380
- });
8381
- this.purposeHeadingEl.textContent = this.getTranslatedText(
8382
- "purpose_section_heading",
8383
- activeConfig.purpose_section_heading || DEFAULT_PURPOSE_SECTION_HEADING
8384
- );
8385
- this.middleSection.appendChild(this.purposeHeadingEl);
8602
+ }) : null;
8603
+ if (this.purposeHeadingEl) {
8604
+ this.purposeHeadingEl.textContent = this.getTranslatedText(
8605
+ "purpose_section_heading",
8606
+ activeConfig.purpose_section_heading || DEFAULT_PURPOSE_SECTION_HEADING
8607
+ );
8608
+ this.middleSection.appendChild(this.purposeHeadingEl);
8609
+ }
8386
8610
  const purposesGroup = el("div", {
8387
8611
  ...part("purposes"),
8388
8612
  style: sheetParts || look.layout.collapsibleSections ? parts.sheetGroup : null
@@ -8456,7 +8680,11 @@ var ModalController = class {
8456
8680
  this.mountOtpGate();
8457
8681
  const dpoBlock = this.renderDpoBlock(look, productPolicyLinks, chrome.productPoliciesLabel);
8458
8682
  if (dpoBlock) {
8459
- const centerTitle = activeConfig.privacy_center_url && activeConfig.privacy_center_anchor_text ? this.getTranslatedText(
8683
+ const centerTitle = showsPrivacyCenter(
8684
+ look.chrome,
8685
+ activeConfig.privacy_center_url,
8686
+ activeConfig.privacy_center_anchor_text
8687
+ ) && activeConfig.privacy_center_anchor_text ? this.getTranslatedText(
8460
8688
  "privacy_center_anchor_text",
8461
8689
  activeConfig.privacy_center_anchor_text
8462
8690
  ) : "";
@@ -8502,7 +8730,7 @@ var ModalController = class {
8502
8730
  this.confirmHintEl = renderConfirmHint(styles2.confirmHint);
8503
8731
  this.updateAcceptButtonState(state);
8504
8732
  this.updateErrorMessage(state);
8505
- (_f = this.keyboardCleanup) == null ? void 0 : _f.call(this);
8733
+ (_g = this.keyboardCleanup) == null ? void 0 : _g.call(this);
8506
8734
  this.keyboardCleanup = setupKeyboardTrap(this.modalEl, () => this.handleDecline());
8507
8735
  }
8508
8736
  /** The purposes in the order talkback reads them: as the notice shows them. */
@@ -8523,9 +8751,12 @@ var ModalController = class {
8523
8751
  var _a;
8524
8752
  const activeConfig = (_a = this.store.getState().content) == null ? void 0 : _a.detail.active_config;
8525
8753
  if (!activeConfig) return null;
8526
- const hasPrivacyCenterLine = Boolean(
8527
- activeConfig.privacy_center_url || activeConfig.additional_text
8754
+ const showsCenter = showsPrivacyCenter(
8755
+ look.chrome,
8756
+ activeConfig.privacy_center_url,
8757
+ activeConfig.privacy_center_anchor_text
8528
8758
  );
8759
+ const hasPrivacyCenterLine = Boolean(showsCenter || activeConfig.additional_text);
8529
8760
  if (!hasPrivacyCenterLine && !activeConfig.dpo_info && productPolicyLinks.length === 0) {
8530
8761
  return null;
8531
8762
  }
@@ -8556,21 +8787,25 @@ var ModalController = class {
8556
8787
  addlSpan.textContent = this.getTranslatedText("additional_text", activeConfig.additional_text);
8557
8788
  footerP.appendChild(addlSpan);
8558
8789
  }
8559
- if (activeConfig.privacy_center_url) {
8790
+ if (showsCenter) {
8560
8791
  if (activeConfig.additional_text) footerP.appendChild(document.createTextNode(" "));
8561
8792
  const pcAnchorText = this.getTranslatedText(
8562
8793
  "privacy_center_anchor_text",
8563
8794
  activeConfig.privacy_center_anchor_text || "Privacy Center"
8564
8795
  );
8565
- this.privacyCenterLinkEl = el("a", {
8566
- id: "privacy-center-link",
8567
- href: activeConfig.privacy_center_url,
8568
- target: "_blank",
8569
- rel: "noopener noreferrer",
8570
- style: linkStyle
8571
- });
8572
- this.privacyCenterLinkEl.textContent = pcAnchorText;
8573
- footerP.appendChild(this.privacyCenterLinkEl);
8796
+ if (look.chrome.privacyCenterAsText) {
8797
+ footerP.appendChild(el("span", { id: "privacy-center-link" }, pcAnchorText));
8798
+ } else {
8799
+ this.privacyCenterLinkEl = el("a", {
8800
+ id: "privacy-center-link",
8801
+ href: activeConfig.privacy_center_url,
8802
+ target: "_blank",
8803
+ rel: "noopener noreferrer",
8804
+ style: linkStyle
8805
+ });
8806
+ this.privacyCenterLinkEl.textContent = pcAnchorText;
8807
+ footerP.appendChild(this.privacyCenterLinkEl);
8808
+ }
8574
8809
  footerP.appendChild(document.createTextNode("."));
8575
8810
  }
8576
8811
  }
@@ -8951,6 +9186,7 @@ var ModalController = class {
8951
9186
  const content = (_a = state.content) == null ? void 0 : _a.detail.active_config;
8952
9187
  const products = content == null ? void 0 : content.products;
8953
9188
  if (!content || !products || products.length !== 1) return null;
9189
+ if (!look.chrome.showsProductSection) return null;
8954
9190
  const product = products[0];
8955
9191
  const section = renderProductSection({
8956
9192
  product,
@@ -9116,7 +9352,10 @@ var ModalController = class {
9116
9352
  "required-outstanding": chrome.hintRequiredOutstanding
9117
9353
  }
9118
9354
  );
9119
- updateConfirmHint(this.confirmHintEl, this.bottomSectionEl, this.acceptBtn, text);
9355
+ const look = this.look;
9356
+ const drawn = !look || drawsConfirmHint(verdict, look.chrome.showsRequiredHint);
9357
+ const style = look ? { ...look.styles.confirmHint, ...drawn ? {} : look.styles.confirmHintHidden } : void 0;
9358
+ updateConfirmHint(this.confirmHintEl, this.bottomSectionEl, this.acceptBtn, text, style, drawn);
9120
9359
  }
9121
9360
  updateAcceptButtonState(state) {
9122
9361
  if (!this.acceptBtn || state.isFullyConsentedReviewMode) return;
@@ -12535,7 +12774,13 @@ var renderPurposes = (ctx, locked) => {
12535
12774
  var renderDpoFooter = (ctx) => {
12536
12775
  const { content, t, tDpo, styles: styles2, responsive, productPolicyLinks } = ctx;
12537
12776
  const dpo = content.dpo_info;
12538
- const hasPrivacyCenterLine = Boolean(content.privacy_center_url || content.additional_text);
12777
+ const chrome = noticeChromeOptions(content.appearance);
12778
+ const showsCenter = showsPrivacyCenter(
12779
+ chrome,
12780
+ content.privacy_center_url,
12781
+ content.privacy_center_anchor_text
12782
+ );
12783
+ const hasPrivacyCenterLine = Boolean(showsCenter || content.additional_text);
12539
12784
  if (!hasPrivacyCenterLine && !dpo && productPolicyLinks.length === 0) return null;
12540
12785
  const paragraph = el("p", { style: { margin: 0, opacity: "0.6" } });
12541
12786
  const linkStyle = { ...styles2.link, color: ctx.linkColor };
@@ -12547,14 +12792,14 @@ var renderDpoFooter = (ctx) => {
12547
12792
  t("additional_text", content.additional_text || "Manage or withdraw consent anytime at")
12548
12793
  )
12549
12794
  );
12550
- if (content.privacy_center_url) {
12795
+ if (showsCenter) {
12796
+ const centerText = t(
12797
+ "privacy_center_anchor_text",
12798
+ content.privacy_center_anchor_text || "Privacy Center"
12799
+ );
12551
12800
  paragraph.appendChild(document.createTextNode(" "));
12552
12801
  paragraph.appendChild(
12553
- el(
12554
- "a",
12555
- linkAttrs(ctx, "privacy-center-link", content.privacy_center_url),
12556
- t("privacy_center_anchor_text", content.privacy_center_anchor_text || "Privacy Center")
12557
- )
12802
+ chrome.privacyCenterAsText ? el("span", { id: "privacy-center-link" }, centerText) : el("a", linkAttrs(ctx, "privacy-center-link", content.privacy_center_url), centerText)
12558
12803
  );
12559
12804
  paragraph.appendChild(document.createTextNode("."));
12560
12805
  }