@coveo/atomic-react 3.11.43 → 3.11.45

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 (55) hide show
  1. package/dist/assets/ai.svg +1 -1
  2. package/dist/assets/ai_model_generative.svg +1 -0
  3. package/dist/assets/attachment.svg +1 -1
  4. package/dist/assets/audio.svg +1 -1
  5. package/dist/assets/box_notes.svg +1 -1
  6. package/dist/assets/css.svg +1 -1
  7. package/dist/assets/csv.svg +1 -1
  8. package/dist/assets/eps.svg +1 -1
  9. package/dist/assets/excel.svg +1 -1
  10. package/dist/assets/exe.svg +1 -1
  11. package/dist/assets/flash.svg +1 -1
  12. package/dist/assets/gdoc.svg +1 -1
  13. package/dist/assets/gdocs.svg +1 -1
  14. package/dist/assets/gform.svg +1 -1
  15. package/dist/assets/gpres.svg +1 -1
  16. package/dist/assets/gsheet.svg +1 -1
  17. package/dist/assets/html.svg +1 -1
  18. package/dist/assets/image.svg +1 -1
  19. package/dist/assets/in_queue_experience.svg +1 -0
  20. package/dist/assets/initiate_external_transfer.svg +1 -0
  21. package/dist/assets/keynote.svg +1 -1
  22. package/dist/assets/mp4.svg +1 -1
  23. package/dist/assets/outbound_call.svg +1 -0
  24. package/dist/assets/overlay.svg +1 -1
  25. package/dist/assets/pack.svg +1 -1
  26. package/dist/assets/pages.svg +1 -1
  27. package/dist/assets/pdf.svg +1 -1
  28. package/dist/assets/ppt.svg +1 -1
  29. package/dist/assets/psd.svg +1 -1
  30. package/dist/assets/quip_doc.svg +1 -1
  31. package/dist/assets/quip_slide.svg +1 -1
  32. package/dist/assets/rfp_record.svg +1 -0
  33. package/dist/assets/rtf.svg +1 -1
  34. package/dist/assets/slack_canvas.svg +1 -1
  35. package/dist/assets/slack_list_item.svg +1 -1
  36. package/dist/assets/slack_lists.svg +1 -1
  37. package/dist/assets/slide.svg +1 -1
  38. package/dist/assets/stypi.svg +1 -1
  39. package/dist/assets/suggested_for_you.svg +1 -0
  40. package/dist/assets/txt.svg +1 -1
  41. package/dist/assets/unknown.svg +1 -1
  42. package/dist/assets/vcf.svg +1 -0
  43. package/dist/assets/visio.svg +1 -1
  44. package/dist/assets/voicemail_drop.svg +1 -0
  45. package/dist/assets/webex.svg +1 -1
  46. package/dist/assets/word.svg +1 -1
  47. package/dist/assets/xml.svg +1 -1
  48. package/dist/assets/zip.svg +1 -1
  49. package/dist/cjs/atomic-react.cjs +183 -37
  50. package/dist/cjs/atomic-react.cjs.map +1 -1
  51. package/dist/cjs/commerce/atomic-react.cjs +95 -25
  52. package/dist/cjs/commerce/atomic-react.cjs.map +1 -1
  53. package/dist/cjs/recommendation/atomic-react.cjs +183 -37
  54. package/dist/cjs/recommendation/atomic-react.cjs.map +1 -1
  55. package/package.json +5 -5
@@ -605,7 +605,7 @@ const renderBreadcrumbContainer = ({ props })=>(children)=>{
605
605
  </div>`;
606
606
  };
607
607
 
608
- /*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */
608
+ /*! @license DOMPurify 3.4.15 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.15/LICENSE */
609
609
 
610
610
  function _arrayLikeToArray(r, a) {
611
611
  (null == a || a > r.length) && (a = r.length);
@@ -1077,7 +1077,7 @@ const _resolveObjectOption = function _resolveObjectOption(cfg, key, makeFallbac
1077
1077
  function createDOMPurify() {
1078
1078
  let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
1079
1079
  const DOMPurify = root => createDOMPurify(root);
1080
- DOMPurify.version = '3.4.14';
1080
+ DOMPurify.version = '3.4.15';
1081
1081
  DOMPurify.removed = [];
1082
1082
  if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
1083
1083
  // Not running in a browser, provide a factory function
@@ -1101,6 +1101,12 @@ function createDOMPurify() {
1101
1101
  const ElementPrototype = Element.prototype;
1102
1102
  const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
1103
1103
  const remove = lookupGetter(ElementPrototype, 'remove');
1104
+ // Clobber-safe Attr-node removal. On an HTMLFormElement a descendant named
1105
+ // "removeAttributeNode" shadows the prototype method via
1106
+ // [LegacyOverrideBuiltIns], so element.removeAttributeNode(attr) throws.
1107
+ // Calling the cached Element.prototype method with the element as the
1108
+ // receiver removes the exact live Attr node regardless of the shadowing.
1109
+ const removeAttributeNode = lookupGetter(ElementPrototype, 'removeAttributeNode');
1104
1110
  const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
1105
1111
  const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
1106
1112
  const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
@@ -1765,7 +1771,7 @@ function createDOMPurify() {
1765
1771
  */
1766
1772
  const _stripAttributeNode = function _stripAttributeNode(element, attribute, name) {
1767
1773
  try {
1768
- element.removeAttributeNode(attribute);
1774
+ removeAttributeNode(element, attribute);
1769
1775
  } catch (_) {
1770
1776
  try {
1771
1777
  element.removeAttribute(name);
@@ -1853,13 +1859,18 @@ function createDOMPurify() {
1853
1859
  });
1854
1860
  try {
1855
1861
  if (attr) {
1856
- element.removeAttributeNode(attr);
1862
+ removeAttributeNode(element, attr);
1857
1863
  } else {
1858
1864
  element.removeAttribute(name);
1859
1865
  }
1860
1866
  } catch (_) {
1861
1867
  /* Clobbered or already-detached node - best-effort fall back to a
1862
- name-based removal so the "is" handling below still runs. */
1868
+ name-based removal so the "is" handling below still runs. Note this
1869
+ fallback ASCII-lowercases its lookup key in an HTML document and so
1870
+ cannot reach a case-preserved attribute name; the cached
1871
+ removeAttributeNode() above is what removes those, and a clobbered
1872
+ form is already removed wholesale by _isClobbered() before reaching
1873
+ here. */
1863
1874
  try {
1864
1875
  element.removeAttribute(name);
1865
1876
  } catch (_) {}
@@ -2195,7 +2206,17 @@ function createDOMPurify() {
2195
2206
  // makes the direct read diverge from the cached read; a clean form
2196
2207
  // (same-realm OR foreign-realm) has both reads pointing at the same
2197
2208
  // canonical NamedNodeMap.
2198
- element.attributes !== getAttributes(element) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function' ||
2209
+ element.attributes !== getAttributes(element) || typeof element.removeAttribute !== 'function' ||
2210
+ // A form descendant named "removeAttributeNode" or "getAttributeNode"
2211
+ // shadows these Attr-node methods via [LegacyOverrideBuiltIns].
2212
+ // _removeAttribute() / _stripAttributeNode() reach for
2213
+ // element.removeAttributeNode(attr) first; when it is shadowed the call
2214
+ // throws and the name-based fallback element.removeAttribute(name)
2215
+ // ASCII-lowercases its lookup key in an HTML document, silently missing
2216
+ // a case-preserved event-handler attribute (e.g. an ONANIMATIONSTART
2217
+ // that reached the sanitizer through an XML/XHTML parse). Flag the form
2218
+ // so it is removed wholesale, exactly as for the other shadowed methods.
2219
+ typeof element.removeAttributeNode !== 'function' || typeof element.getAttributeNode !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function' ||
2199
2220
  // NodeType clobbering probe. Cached Node.prototype.nodeType getter
2200
2221
  // returns the integer 1 for any Element regardless of realm; direct
2201
2222
  // read on a clobbered form (e.g. <input name="nodeType">) returns
@@ -2686,15 +2707,25 @@ function createDOMPurify() {
2686
2707
  /**
2687
2708
  * Write a modified attribute value back onto the element. On
2688
2709
  * success, re-probe for clobbering introduced by the new value and
2689
- * remove the element when found; otherwise pop the removal entry
2690
- * recorded by the earlier _removeAttribute (long-standing pairing
2691
- * with the SANITIZE_NAMED_PROPS path - do not "fix" casually). On
2710
+ * remove the element when found; otherwise, when this writeback is the
2711
+ * recreate half of the SANITIZE_NAMED_PROPS remove-and-recreate, pop the
2712
+ * removal entry that path recorded so it does not show as removed. On
2692
2713
  * failure, remove the attribute instead.
2693
2714
  *
2715
+ * Returns true only on a clean write (the value was set and the new value
2716
+ * introduced no clobbering). The caller uses that, together with its own
2717
+ * knowledge of whether this attribute pushed a DOMPurify.removed record, to
2718
+ * decide whether to pop that record. The pop must happen ONLY for the
2719
+ * named-prop remove-and-recreate; popping on any other value change (trim,
2720
+ * template scrubbing, Trusted Types) would consume an unrelated _forceRemove
2721
+ * subtree-cleanup record and let that detached subtree keep a live event
2722
+ * handler through the IN_PLACE neutralization pass (SO-001).
2723
+ *
2694
2724
  * @param currentNode the element carrying the attribute
2695
2725
  * @param name the attribute name as present on the element
2696
2726
  * @param namespaceURI the attribute's namespace, if any
2697
2727
  * @param value the new attribute value
2728
+ * @return true if the value was written without introducing clobbering
2698
2729
  */
2699
2730
  const _setAttributeValue = function _setAttributeValue(currentNode, name, namespaceURI, value) {
2700
2731
  try {
@@ -2706,11 +2737,12 @@ function createDOMPurify() {
2706
2737
  }
2707
2738
  if (_isClobbered(currentNode)) {
2708
2739
  _forceRemove(currentNode);
2709
- } else {
2710
- arrayPop(DOMPurify.removed);
2740
+ return false;
2711
2741
  }
2742
+ return true;
2712
2743
  } catch (_) {
2713
2744
  _removeAttribute(name, currentNode);
2745
+ return false;
2714
2746
  }
2715
2747
  };
2716
2748
  /**
@@ -2723,6 +2755,7 @@ function createDOMPurify() {
2723
2755
  *
2724
2756
  * @param currentNode to sanitize
2725
2757
  */
2758
+ // eslint-disable-next-line complexity
2726
2759
  const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
2727
2760
  /* Execute a hook if present */
2728
2761
  _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
@@ -2752,6 +2785,15 @@ function createDOMPurify() {
2752
2785
  const lcName = transformCaseFunc(name);
2753
2786
  const initValue = attrValue;
2754
2787
  let value = name === 'value' ? initValue : stringTrim(initValue);
2788
+ /* Tracks whether this specific attribute pushed a DOMPurify.removed
2789
+ record that a later _setAttributeValue() writeback is expected to pop
2790
+ back off (the SANITIZE_NAMED_PROPS remove-and-recreate below is the
2791
+ only path that does). A value that merely changed via trim, template
2792
+ scrubbing, or Trusted Types pushes no such record, so its writeback
2793
+ must NOT pop — otherwise it consumes an unrelated _forceRemove subtree
2794
+ record and that detached subtree escapes the IN_PLACE handler-
2795
+ neutralization pass (SO-001). */
2796
+ let recreatedNamedProp = false;
2755
2797
  /* Execute a hook if present */
2756
2798
  hookEvent.attrName = lcName;
2757
2799
  hookEvent.attrValue = value;
@@ -2767,6 +2809,9 @@ function createDOMPurify() {
2767
2809
  _removeAttribute(name, currentNode, attr);
2768
2810
  // Prefix the value and later re-create the attribute with the sanitized value
2769
2811
  value = SANITIZE_NAMED_PROPS_PREFIX + value;
2812
+ // This attribute owns the record just pushed; its recreate writeback
2813
+ // is the one allowed to pop it back off.
2814
+ recreatedNamedProp = true;
2770
2815
  }
2771
2816
  // Else: already prefixed, leave the attribute alone — the prefix is
2772
2817
  // itself the clobbering protection, and re-applying it is incorrect.
@@ -2807,7 +2852,14 @@ function createDOMPurify() {
2807
2852
  value = _applyTrustedTypesToAttribute(lcTag, lcName, namespaceURI, value);
2808
2853
  /* Handle invalid data-* attribute set by try-catching it */
2809
2854
  if (value !== initValue) {
2810
- _setAttributeValue(currentNode, name, namespaceURI, value);
2855
+ const cleanWrite = _setAttributeValue(currentNode, name, namespaceURI, value);
2856
+ /* Only the named-prop remove-and-recreate owns a DOMPurify.removed
2857
+ record to pop; a plain trim/template/Trusted-Types writeback owns
2858
+ none, so popping here would drop an unrelated subtree's cleanup
2859
+ record (SO-001). */
2860
+ if (cleanWrite && recreatedNamedProp) {
2861
+ arrayPop(DOMPurify.removed);
2862
+ }
2811
2863
  }
2812
2864
  }
2813
2865
  /* Execute a hook if present */
@@ -3083,8 +3135,15 @@ function createDOMPurify() {
3083
3135
  them before the main iterator runs, since the iterator does not
3084
3136
  descend into shadow trees. The walk routes every read through a
3085
3137
  cached prototype getter so clobbering descendants on a form root
3086
- cannot hide a shadow host from this pass. */
3087
- _sanitizeAttachedShadowRoots(importedNode);
3138
+ cannot hide a shadow host from this pass.
3139
+ Traverse from `body`, not `importedNode`: when importedNode is a
3140
+ DocumentFragment, the appendChild() above moves its children into
3141
+ `body` and leaves the fragment empty, so walking importedNode would
3142
+ scan nothing and miss every attached shadow host now under `body`
3143
+ (SO-003). In the BODY/HTML branches `body === importedNode`, so this
3144
+ is equivalent there; in the element branch `body` contains the
3145
+ appended element and its descendants. `body` covers all three. */
3146
+ _sanitizeAttachedShadowRoots(body);
3088
3147
  } else {
3089
3148
  /* Exit directly if we have nothing to do */
3090
3149
  if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
@@ -7252,7 +7311,7 @@ class Interpolator {
7252
7311
  interpolationkey: match[1].trim()
7253
7312
  }), value.trim());
7254
7313
  }
7255
- str = str.replace(match[0], value);
7314
+ str = str.replace(match[0], regexSafe(makeString(value)));
7256
7315
  this.regexp.lastIndex = 0;
7257
7316
  }
7258
7317
  return str;
@@ -8302,7 +8361,7 @@ function getWindow$1() {
8302
8361
  }
8303
8362
  function getAtomicEnvironment(headlessVersion) {
8304
8363
  return {
8305
- version: "3.61.3",
8364
+ version: "3.61.5",
8306
8365
  headlessVersion
8307
8366
  };
8308
8367
  }
@@ -8529,7 +8588,7 @@ function isSafeUrlSegmentBase(v) {
8529
8588
  if (UNSAFE_KEYS$1.indexOf(v) > -1) return false;
8530
8589
  if (v.indexOf("..") > -1) return false;
8531
8590
  if (v.indexOf("\\") > -1) return false;
8532
- if (/[?#%\s]/.test(v)) return false;
8591
+ if (/[?#%:\s]/.test(v)) return false;
8533
8592
  if (/[\x00-\x1F\x7F]/.test(v)) return false;
8534
8593
  return true;
8535
8594
  }
@@ -8539,7 +8598,9 @@ function isSafeLangUrlSegment(v) {
8539
8598
  return true;
8540
8599
  }
8541
8600
  function isSafeNsUrlSegment(v) {
8542
- return isSafeUrlSegmentBase(v);
8601
+ if (!isSafeUrlSegmentBase(v)) return false;
8602
+ if (v.indexOf("//") > -1) return false;
8603
+ return true;
8543
8604
  }
8544
8605
  const SAFETY_CHECK_BY_KEY = {
8545
8606
  lng: isSafeLangUrlSegment,
@@ -12617,7 +12678,7 @@ var attachStyles = (hostRef) => {
12617
12678
  const cmpMeta = hostRef.$cmpMeta$;
12618
12679
  const elm = hostRef.$hostElement$;
12619
12680
  const flags = cmpMeta.$flags$;
12620
- createTime("attachStyles", cmpMeta.$tagName$);
12681
+ const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
12621
12682
  const scopeId2 = addStyle(
12622
12683
  elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
12623
12684
  cmpMeta,
@@ -12630,6 +12691,7 @@ var attachStyles = (hostRef) => {
12630
12691
  elm.classList.add(scopeId2 + "-s");
12631
12692
  }
12632
12693
  }
12694
+ endAttachStyles();
12633
12695
  };
12634
12696
  var getScopeId = (cmp, mode) => "sc-" + (mode && cmp.$flags$ & 32 /* hasMode */ ? cmp.$tagName$ + "-" + mode : cmp.$tagName$);
12635
12697
  var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
@@ -13311,7 +13373,7 @@ var scheduleUpdate = (hostRef, isInitialLoad) => {
13311
13373
  };
13312
13374
  var dispatchHooks = (hostRef, isInitialLoad) => {
13313
13375
  const elm = hostRef.$hostElement$;
13314
- createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
13376
+ const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
13315
13377
  const instance = elm;
13316
13378
  if (!instance) {
13317
13379
  throw new Error(
@@ -13331,6 +13393,7 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
13331
13393
  {
13332
13394
  maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender"));
13333
13395
  }
13396
+ endSchedule();
13334
13397
  return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
13335
13398
  };
13336
13399
  var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => {
@@ -13340,15 +13403,17 @@ var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then
13340
13403
  var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function";
13341
13404
  var updateComponent = async (hostRef, instance, isInitialLoad) => {
13342
13405
  const elm = hostRef.$hostElement$;
13343
- createTime("update", hostRef.$cmpMeta$.$tagName$);
13406
+ const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
13344
13407
  elm["s-rc"];
13345
13408
  if (isInitialLoad) {
13346
13409
  attachStyles(hostRef);
13347
13410
  }
13348
- createTime("render", hostRef.$cmpMeta$.$tagName$);
13411
+ const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
13349
13412
  {
13350
13413
  callRender(hostRef, instance, elm, isInitialLoad);
13351
13414
  }
13415
+ endRender();
13416
+ endUpdate();
13352
13417
  {
13353
13418
  postUpdateComponent(hostRef);
13354
13419
  }
@@ -13382,8 +13447,9 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
13382
13447
  return null;
13383
13448
  };
13384
13449
  var postUpdateComponent = (hostRef) => {
13385
- hostRef.$cmpMeta$.$tagName$;
13450
+ const tagName = hostRef.$cmpMeta$.$tagName$;
13386
13451
  const elm = hostRef.$hostElement$;
13452
+ const endPostUpdate = createTime("postUpdate", tagName);
13387
13453
  const instance = elm;
13388
13454
  hostRef.$ancestorComponent$;
13389
13455
  {
@@ -13394,10 +13460,12 @@ var postUpdateComponent = (hostRef) => {
13394
13460
  {
13395
13461
  safeCall(instance, "componentDidLoad");
13396
13462
  }
13463
+ endPostUpdate();
13397
13464
  } else {
13398
13465
  {
13399
13466
  safeCall(instance, "componentDidUpdate");
13400
13467
  }
13468
+ endPostUpdate();
13401
13469
  }
13402
13470
  };
13403
13471
  var safeCall = (instance, method, arg) => {
@@ -13544,8 +13612,9 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
13544
13612
  }
13545
13613
  const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
13546
13614
  if (!styles$h.has(scopeId2)) {
13547
- createTime("registerStyles", cmpMeta.$tagName$);
13615
+ const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
13548
13616
  registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
13617
+ endRegisterStyles();
13549
13618
  }
13550
13619
  }
13551
13620
  }
@@ -13563,7 +13632,7 @@ var connectedCallback = (elm) => {
13563
13632
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
13564
13633
  const hostRef = getHostRef(elm);
13565
13634
  const cmpMeta = hostRef.$cmpMeta$;
13566
- createTime("connectedCallback", cmpMeta.$tagName$);
13635
+ const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
13567
13636
  if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
13568
13637
  hostRef.$flags$ |= 1 /* hasConnected */;
13569
13638
  {
@@ -13592,6 +13661,7 @@ var connectedCallback = (elm) => {
13592
13661
  hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
13593
13662
  }
13594
13663
  }
13664
+ endConnected();
13595
13665
  }
13596
13666
  };
13597
13667
  var setContentReference = (elm) => {
@@ -18555,8 +18625,7 @@ const customRenderer = {
18555
18625
  return `<em part="answer-emphasis">${text}</em>`;
18556
18626
  },
18557
18627
  heading (text, level) {
18558
- const plainText = toInlinePlainText(text);
18559
- return `<div part="answer-heading-${level}" aria-label="${plainText}">${text}</div>`;
18628
+ return `<div part="answer-heading-${level}" role="heading" aria-level="${level}">${text}</div>`;
18560
18629
  },
18561
18630
  html (text) {
18562
18631
  return escapeHtml(text);
@@ -19215,6 +19284,37 @@ const generated_answer_tw_css = [
19215
19284
 
19216
19285
  const atomic_generated_answer_tw_css = generated_answer_tw_css;
19217
19286
 
19287
+ const SILENT = {
19288
+ message: '',
19289
+ assertive: false
19290
+ };
19291
+ const getAnswerAnnouncement = (answer, i18n)=>{
19292
+ if (!answer) return SILENT;
19293
+ if (answer.error) {
19294
+ const errorMessageKey = answer.error.isSseTurnLimitReachedError?.() ? 'generated-answer-error-turn-limit-reached' : 'generated-answer-error-generic';
19295
+ return {
19296
+ message: i18n.t(errorMessageKey),
19297
+ assertive: true
19298
+ };
19299
+ }
19300
+ if (answer.cannotAnswer) return {
19301
+ message: i18n.t('generated-answer-cannot-generate-answer'),
19302
+ assertive: true
19303
+ };
19304
+ if (answer.isStreaming || answer.isLoading) return {
19305
+ message: i18n.t('generating-answer'),
19306
+ assertive: false
19307
+ };
19308
+ if (answer.answer?.trim()) return {
19309
+ message: i18n.t('answer-generated', {
19310
+ answer: markdownToPlainText(answer.answer)
19311
+ }),
19312
+ assertive: false
19313
+ };
19314
+ return SILENT;
19315
+ };
19316
+ const isSettledAnswer = (answer)=>Boolean(answer && !answer.isStreaming && !answer.isLoading && !answer.error && !answer.cannotAnswer && answer.answer?.trim());
19317
+
19218
19318
  const styles$8 = lit.css`/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */:host{display:inline}a{color:var(--atomic-primary);text-decoration-line:none}a [part=answer-link-text]{text-decoration-line:underline}.icon-wrapper{vertical-align:text-bottom;width:1em;height:1em;display:inline-block}`;
19219
19319
  const atomic_generated_answer_inline_link_tw_css = styles$8;
19220
19320
 
@@ -19353,7 +19453,11 @@ const renderGeneratedTextContent = ({ props })=>lit.html`
19353
19453
  `;
19354
19454
 
19355
19455
  const renderGeneratedContentContainer = ({ props })=>(children)=>lit.html`
19356
- <div part="generated-container">
19456
+ <div
19457
+ part="generated-container"
19458
+ id=${ifDefined_js.ifDefined(props.id)}
19459
+ aria-busy=${props.isStreaming ? 'true' : 'false'}
19460
+ >
19357
19461
  ${'text/markdown' === props.answerContentFormat ? renderGeneratedMarkdownContent({
19358
19462
  props: {
19359
19463
  answer: props.answer,
@@ -19381,6 +19485,7 @@ const renderCopyButton = ({ props })=>{
19381
19485
  return renderButton({
19382
19486
  props: {
19383
19487
  title: props.title,
19488
+ ariaLabel: props.title,
19384
19489
  part: 'copy-button',
19385
19490
  style: 'text-transparent',
19386
19491
  class: classes.join(' '),
@@ -19388,7 +19493,7 @@ const renderCopyButton = ({ props })=>{
19388
19493
  }
19389
19494
  })(lit.html`
19390
19495
  <div class="icon-container text-neutral-dark">
19391
- <atomic-icon class="w-5" .icon=${copy}></atomic-icon>
19496
+ <atomic-icon class="w-5" .icon=${copy} aria-hidden="true"></atomic-icon>
19392
19497
  </div>
19393
19498
  `);
19394
19499
  };
@@ -19417,6 +19522,7 @@ const renderFeedbackButton = ({ props })=>{
19417
19522
  return lit.html`<button
19418
19523
  type="button"
19419
19524
  title=${props.title}
19525
+ aria-label=${props.title}
19420
19526
  part="feedback-button"
19421
19527
  class=${classNames}
19422
19528
  aria-pressed=${props.active ? 'true' : 'false'}
@@ -19425,7 +19531,7 @@ const renderFeedbackButton = ({ props })=>{
19425
19531
  })}
19426
19532
  @click=${props.onClick}
19427
19533
  >
19428
- <atomic-icon class=${iconClassNames} .icon=${thumbs}></atomic-icon>
19534
+ <atomic-icon class=${iconClassNames} .icon=${thumbs} aria-hidden="true"></atomic-icon>
19429
19535
  </button>`;
19430
19536
  };
19431
19537
 
@@ -19539,6 +19645,24 @@ class AtomicGeneratedAnswerContent extends lit.LitElement {
19539
19645
  </div>
19540
19646
  `;
19541
19647
  }
19648
+ updated() {
19649
+ this.announceAnswerStatus();
19650
+ }
19651
+ announceAnswerStatus() {
19652
+ if (!this.i18n || !this.generatedAnswer) return;
19653
+ const { message, assertive } = getAnswerAnnouncement(this.generatedAnswer, this.i18n);
19654
+ if (!this.hasObservedAnswer) {
19655
+ this.hasObservedAnswer = true;
19656
+ if (isSettledAnswer(this.generatedAnswer)) {
19657
+ this.lastAnnouncedMessage = message;
19658
+ return;
19659
+ }
19660
+ }
19661
+ if (message === this.lastAnnouncedMessage) return;
19662
+ this.lastAnnouncedMessage = message;
19663
+ if (assertive) this.ariaErrorMessage.message = message;
19664
+ else this.ariaMessage.message = message;
19665
+ }
19542
19666
  renderFeedbackAndCopyButtons(answerId) {
19543
19667
  return lit.html`
19544
19668
  <div class="mt-4" part="feedback-and-copy-buttons">
@@ -19569,9 +19693,11 @@ class AtomicGeneratedAnswerContent extends lit.LitElement {
19569
19693
  try {
19570
19694
  await navigator.clipboard.writeText(answer);
19571
19695
  this.copyState = 'success';
19696
+ this.ariaCopyMessage.message = this.i18n.t('generated-answer-copied');
19572
19697
  this.onCopyToClipboard(answerId);
19573
19698
  } catch (error) {
19574
19699
  this.copyState = 'error';
19700
+ this.ariaCopyMessage.message = this.i18n.t('failed-to-copy-generated-answer');
19575
19701
  console.error(`Failed to copy to clipboard: ${error}`);
19576
19702
  }
19577
19703
  this.scheduleCopyReset();
@@ -19608,7 +19734,7 @@ class AtomicGeneratedAnswerContent extends lit.LitElement {
19608
19734
  `;
19609
19735
  }
19610
19736
  constructor(...args){
19611
- super(...args), this.answerId = '', this.renderCitations = ()=>lit.html``, this.onClickLike = ()=>{}, this.onClickDislike = ()=>{}, this.onCopyToClipboard = ()=>{}, this.copyState = 'idle';
19737
+ super(...args), this.answerId = '', this.renderCitations = ()=>lit.html``, this.onClickLike = ()=>{}, this.onClickDislike = ()=>{}, this.onCopyToClipboard = ()=>{}, this.copyState = 'idle', this.ariaMessage = new AriaLiveRegionController(this, 'generated-answer', false, true), this.ariaErrorMessage = new AriaLiveRegionController(this, 'generated-answer-error', true), this.ariaCopyMessage = new AriaLiveRegionController(this, 'generated-answer-copy', true), this.hasObservedAnswer = false;
19612
19738
  }
19613
19739
  }
19614
19740
  AtomicGeneratedAnswerContent.styles = [
@@ -20207,7 +20333,7 @@ class AtomicGeneratedAnswerThreadItem extends lit.LitElement {
20207
20333
  const timelineConnectorClasses = "relative h-full w-px bg-neutral transition-colors duration-150 group-hover:bg-neutral-dark before:absolute before:left-0 before:top-[-8px] before:h-[8px] before:w-px before:bg-neutral before:transition-colors before:duration-150 group-hover:before:bg-neutral-dark before:content-[''] after:absolute after:bottom-[-8px] after:left-0 after:h-[8px] after:w-px after:bg-neutral after:transition-colors after:duration-150 group-hover:after:bg-neutral-dark after:content-['']";
20208
20334
  return lit.html`
20209
20335
  <div class="group/title grid min-w-0 grid-cols-[10px_1fr] gap-x-3">
20210
- <div class="row-span-2 flex flex-col items-center">
20336
+ <div class="row-span-2 flex flex-col items-center" aria-hidden="true">
20211
20337
  <div class=${timelineDotToggleClasses}>
20212
20338
  ${when_js.when(this.showTimelineDot, ()=>lit.html`
20213
20339
  <span
@@ -20241,8 +20367,9 @@ class AtomicGeneratedAnswerThreadItem extends lit.LitElement {
20241
20367
  >${this.title}</span
20242
20368
  >`)}
20243
20369
  </div>
20244
- <div id=${this.contentId} class="min-w-0 pl-2 py-1.5">
20370
+ <div class="min-w-0 pl-2 py-1.5">
20245
20371
  <div
20372
+ id=${this.contentId}
20246
20373
  class="mb-2"
20247
20374
  ?hidden=${!this.isExpanded}
20248
20375
  aria-hidden=${this.isExpanded ? 'false' : 'true'}
@@ -20403,7 +20530,7 @@ class AtomicGeneratedAnswerThread extends lit.LitElement {
20403
20530
  `;
20404
20531
  return lit.html`
20405
20532
  <li class="group/title grid min-w-0 grid-cols-[10px_1fr] gap-x-3">
20406
- <div class="row-span-2 flex flex-col items-center">
20533
+ <div class="row-span-2 flex flex-col items-center" aria-hidden="true">
20407
20534
  <div class="flex justify-center items-center text-base h-[1lh] my-1.5">
20408
20535
  <span class=${timelineDotClasses}></span>
20409
20536
  </div>
@@ -22049,6 +22176,7 @@ const renderShowButton = ({ props })=>lit.html`${renderButton({
22049
22176
  part: 'answer-show-button',
22050
22177
  class: 'hidden items-center hover:bg-transparent',
22051
22178
  ariaExpanded: props.isCollapsed ? 'false' : 'true',
22179
+ ariaControls: props.controlsId,
22052
22180
  onClick: props.onClick
22053
22181
  }
22054
22182
  })(lit.html`
@@ -22079,6 +22207,7 @@ const renderGeneratingAnswerLabel = ({ props })=>{
22079
22207
  `)}`;
22080
22208
  };
22081
22209
 
22210
+ const GENERATED_CONTENT_ID = 'generated-answer-content';
22082
22211
  const renderAnswerContent = ({ props })=>{
22083
22212
  const { i18n, generatedAnswer, collapsible, renderFeedbackAndCopyButtonsSlot, renderCitationsSlot, onRetry, onClickShowButton } = props;
22084
22213
  const { answer, isStreaming, citations, answerContentFormat, expanded, error } = generatedAnswer;
@@ -22096,7 +22225,8 @@ const renderAnswerContent = ({ props })=>{
22096
22225
  props: {
22097
22226
  answer,
22098
22227
  answerContentFormat,
22099
- isStreaming: !!isStreaming
22228
+ isStreaming: !!isStreaming,
22229
+ id: collapsible ? GENERATED_CONTENT_ID : void 0
22100
22230
  }
22101
22231
  })(lit.html`
22102
22232
  ${renderSourceCitations({
@@ -22124,7 +22254,8 @@ const renderAnswerContent = ({ props })=>{
22124
22254
  props: {
22125
22255
  i18n,
22126
22256
  onClick: onClickShowButton,
22127
- isCollapsed: !expanded
22257
+ isCollapsed: !expanded,
22258
+ controlsId: GENERATED_CONTENT_ID
22128
22259
  }
22129
22260
  }) : lit.nothing}
22130
22261
  </div>
@@ -28532,6 +28663,7 @@ let AtomicGeneratedAnswer$1 = class AtomicGeneratedAnswer extends lit.LitElement
28532
28663
  'generated-answer-content-background': this.areFollowUpsEnabled,
28533
28664
  'agent-scrollable': this.areFollowUpsEnabled
28534
28665
  })}
28666
+ tabindex=${this.areFollowUpsEnabled ? '0' : lit.nothing}
28535
28667
  >
28536
28668
  <article>${this.renderAnswerContent()}</article>
28537
28669
  </div>
@@ -28556,6 +28688,9 @@ let AtomicGeneratedAnswer$1 = class AtomicGeneratedAnswer extends lit.LitElement
28556
28688
  </div>
28557
28689
  `;
28558
28690
  }
28691
+ get shouldAnnounceAnswerStatus() {
28692
+ return !this.areFollowUpsEnabled;
28693
+ }
28559
28694
  get hasNoAnswerGenerated() {
28560
28695
  return this.controller.hasNoAnswerGenerated;
28561
28696
  }
@@ -28580,11 +28715,13 @@ let AtomicGeneratedAnswer$1 = class AtomicGeneratedAnswer extends lit.LitElement
28580
28715
  async copyToClipboard(answer) {
28581
28716
  await this.controller.copyToClipboard(answer, ()=>{
28582
28717
  this.copied = true;
28718
+ this.ariaCopyMessage.message = this.bindings.i18n.t('generated-answer-copied');
28583
28719
  setTimeout(()=>{
28584
28720
  this.copied = false;
28585
28721
  }, 2000);
28586
28722
  }, ()=>{
28587
28723
  this.copyError = true;
28724
+ this.ariaCopyMessage.message = this.bindings.i18n.t('failed-to-copy-generated-answer');
28588
28725
  setTimeout(()=>{
28589
28726
  this.copyError = false;
28590
28727
  }, 2000);
@@ -28779,7 +28916,7 @@ let AtomicGeneratedAnswer$1 = class AtomicGeneratedAnswer extends lit.LitElement
28779
28916
  constructor(){
28780
28917
  super(), this.DEFAULT_COLLAPSED_HEIGHT = 16, this.MAX_COLLAPSED_HEIGHT = 32, this.MIN_COLLAPSED_HEIGHT = 9, this.REQUIRED_FIELDS_TO_INCLUDE_IN_CITATIONS = [
28781
28918
  'filetype'
28782
- ], this.withToggle = false, this.collapsible = false, this.maxCollapsedHeight = this.DEFAULT_COLLAPSED_HEIGHT, this.disableCitationAnchoring = false, this.tabsIncluded = [], this.tabsExcluded = [], this.copied = false, this.copyError = false, this.ariaMessage = new AriaLiveRegionController(this, 'generated-answer', false, true), this.ariaErrorMessage = new AriaLiveRegionController(this, 'generated-answer-error', true), this.onGeneratedAnswerStateUpdate = ()=>{
28919
+ ], this.withToggle = false, this.collapsible = false, this.maxCollapsedHeight = this.DEFAULT_COLLAPSED_HEIGHT, this.disableCitationAnchoring = false, this.tabsIncluded = [], this.tabsExcluded = [], this.copied = false, this.copyError = false, this.ariaMessage = new AriaLiveRegionController(this, 'generated-answer', false, true), this.ariaErrorMessage = new AriaLiveRegionController(this, 'generated-answer-error', true), this.ariaCopyMessage = new AriaLiveRegionController(this, 'generated-answer-copy', true), this.onGeneratedAnswerStateUpdate = ()=>{
28783
28920
  if (this.generatedAnswerState.isVisible !== this.controller.data.isVisible) {
28784
28921
  this.controller.data = {
28785
28922
  ...this.controller.data,
@@ -28787,6 +28924,7 @@ let AtomicGeneratedAnswer$1 = class AtomicGeneratedAnswer extends lit.LitElement
28787
28924
  };
28788
28925
  this.controller.writeStoredData(this.controller.data);
28789
28926
  }
28927
+ if (!this.shouldAnnounceAnswerStatus) return;
28790
28928
  const status = this.controller.getGeneratedAnswerStatus();
28791
28929
  if (this.controller.isStatusAssertive()) {
28792
28930
  this.ariaMessage.message = '';
@@ -32587,6 +32725,7 @@ function requireBgStandard_common () {
32587
32725
  pastChat: "rgb(255, 93, 45)",
32588
32726
  cryptoTransactionEnvelopeChangeLog: "rgb(8, 73, 104)",
32589
32727
  feedback: "rgb(27, 150, 255)",
32728
+ voicemailDrop: "rgb(3, 45, 96)",
32590
32729
  actionListComponent: "rgb(16, 124, 173)",
32591
32730
  opportunitySplits: "rgb(255, 93, 45)",
32592
32731
  locationPermit: "rgb(6, 165, 154)",
@@ -32737,7 +32876,9 @@ function requireBgStandard_common () {
32737
32876
  sendLog: "rgb(147, 147, 147)",
32738
32877
  dxPipeline: "rgb(255, 93, 45)",
32739
32878
  account: "rgb(88, 103, 232)",
32879
+ suggestedForYou: "rgb(144, 80, 233)",
32740
32880
  programStatus: "rgb(144, 80, 233)",
32881
+ outboundCall: "rgb(3, 45, 96)",
32741
32882
  studyCandidate: "rgb(47, 44, 183)",
32742
32883
  couponCodes: "rgb(57, 101, 71)",
32743
32884
  adverseEvent: "rgb(182, 5, 84)",
@@ -32830,6 +32971,7 @@ function requireBgStandard_common () {
32830
32971
  contract: "rgb(57, 101, 71)",
32831
32972
  policy: "rgb(6, 165, 154)",
32832
32973
  sobject: "rgb(147, 147, 147)",
32974
+ inQueueExperience: "rgb(3, 45, 96)",
32833
32975
  adEventEffect: "rgb(182, 5, 84)",
32834
32976
  whatsapp: "rgb(59, 167, 85)",
32835
32977
  salesCadenceTarget: "rgb(16, 124, 173)",
@@ -32862,6 +33004,7 @@ function requireBgStandard_common () {
32862
33004
  taxRate: "rgb(57, 101, 71)",
32863
33005
  report: "rgb(6, 165, 154)",
32864
33006
  customerWorkspace: "rgb(57, 101, 71)",
33007
+ rfpRecord: "rgb(59, 167, 85)",
32865
33008
  groups: "rgb(27, 150, 255)",
32866
33009
  diseaseOutbreak: "rgb(255, 83, 138)",
32867
33010
  dataModel: "rgb(255, 83, 138)",
@@ -32875,6 +33018,7 @@ function requireBgStandard_common () {
32875
33018
  priceBooks: "rgb(57, 101, 71)",
32876
33019
  entityMilestone: "rgb(255, 93, 45)",
32877
33020
  contractLineOutcome: "rgb(57, 101, 71)",
33021
+ aiModelGenerative: "rgb(27, 150, 255)",
32878
33022
  wealthManagement: "rgb(6, 165, 154)",
32879
33023
  customers: "rgb(6, 165, 154)",
32880
33024
  disclosureAndCompliance: "rgb(6, 165, 154)",
@@ -32953,6 +33097,7 @@ function requireBgStandard_common () {
32953
33097
  avatar: "rgb(27, 150, 255)",
32954
33098
  recordDelete: "rgb(255, 83, 138)",
32955
33099
  solution: "rgb(59, 167, 85)",
33100
+ initiateExternalTransfer: "rgb(3, 45, 96)",
32956
33101
  editForm: "rgb(147, 147, 147)",
32957
33102
  nftStudio: "rgb(88, 103, 232)",
32958
33103
  manualDiscounts: "rgb(16, 124, 173)",
@@ -37416,6 +37561,7 @@ let AtomicSortDropdown$1 = class AtomicSortDropdown extends lit.LitElement {
37416
37561
  })))}`);
37417
37562
  }
37418
37563
  render() {
37564
+ if (!this.options.length) return lit.html`<slot></slot>`;
37419
37565
  const { hasError, hasResults, firstSearchExecuted, isLoading } = this.searchStatusState;
37420
37566
  return lit.html`
37421
37567
  ${sortGuard({