@coveo/atomic 3.33.8-pre.f71538d21f → 3.33.8-pre.fbe332fd49

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 (184) hide show
  1. package/dist/atomic/_atomic.esm.js +1 -1
  2. package/dist/atomic/atomic.esm.js.map +1 -1
  3. package/dist/atomic/components/_index.d.ts +0 -2
  4. package/dist/atomic/components/_index.js +0 -1
  5. package/dist/atomic/components/analytics-config.js +1 -1
  6. package/dist/atomic/components/atomic-category-facet.js +1 -1
  7. package/dist/atomic/components/atomic-facet.js +1 -1
  8. package/dist/atomic/components/atomic-format-currency.js +1 -1
  9. package/dist/atomic/components/atomic-format-number.js +1 -1
  10. package/dist/atomic/components/atomic-format-unit.js +1 -1
  11. package/dist/atomic/components/atomic-insight-pager.js +38 -2
  12. package/dist/atomic/components/atomic-insight-pager.js.map +1 -1
  13. package/dist/atomic/components/atomic-numeric-facet.js +1 -1
  14. package/dist/atomic/components/atomic-query-error.js +1 -1
  15. package/dist/atomic/components/atomic-quickview-modal2.js +1 -1
  16. package/dist/atomic/components/atomic-quickview.js +1 -1
  17. package/dist/atomic/components/atomic-refine-modal2.js +1 -1
  18. package/dist/atomic/components/atomic-refine-toggle.js +1 -1
  19. package/dist/atomic/components/atomic-relevance-inspector2.js +2 -2
  20. package/dist/atomic/components/atomic-result-children.js +1 -1
  21. package/dist/atomic/components/atomic-result-fields-list.js +1 -1
  22. package/dist/atomic/components/atomic-result-link.js +1 -1
  23. package/dist/atomic/components/atomic-result-list.js +1 -1
  24. package/dist/atomic/components/atomic-result-table-placeholder2.js +1 -1
  25. package/dist/atomic/components/atomic-search-box-query-suggestions2.js +1 -1
  26. package/dist/atomic/components/atomic-search-box-recent-queries2.js +1 -1
  27. package/dist/atomic/components/atomic-search-box.js +4 -4
  28. package/dist/atomic/components/atomic-smart-snippet-feedback-modal2.js +2 -2
  29. package/dist/atomic/components/atomic-sort-dropdown.js +2 -2
  30. package/dist/atomic/components/atomic-sort-expression.js +1 -1
  31. package/dist/atomic/components/atomic-tab-manager.js +1 -1
  32. package/dist/atomic/components/components/search/atomic-pager/atomic-pager.js +175 -0
  33. package/dist/atomic/components/components/search/index.js +1 -0
  34. package/dist/atomic/components/components/search/lazy-index.js +1 -0
  35. package/dist/atomic/components/global/environment.js +1 -1
  36. package/dist/atomic/components/index.js.map +1 -1
  37. package/dist/atomic/{p-ae060711.entry.js → p-00e5bb15.entry.js} +2 -2
  38. package/dist/atomic/{p-9a451295.js → p-031670fe.js} +2 -2
  39. package/dist/atomic/{p-330e6e7c.entry.js → p-3af5c567.entry.js} +2 -2
  40. package/dist/atomic/{p-327df077.entry.js → p-43c16eeb.entry.js} +2 -2
  41. package/dist/atomic/{p-75e00690.entry.js → p-45c4685e.entry.js} +2 -2
  42. package/dist/atomic/{p-09c4c7f2.entry.js → p-470f88ed.entry.js} +2 -2
  43. package/dist/atomic/{p-7a625c7e.entry.js → p-4915faeb.entry.js} +2 -2
  44. package/dist/atomic/{p-52ba404c.entry.js → p-4c30ca3e.entry.js} +2 -2
  45. package/dist/atomic/{p-aa2a81fd.entry.js → p-4e9d1f9e.entry.js} +2 -2
  46. package/dist/atomic/{p-31f1e44e.entry.js → p-516b8165.entry.js} +2 -2
  47. package/dist/atomic/p-593903ec.entry.js +2 -0
  48. package/dist/atomic/p-593903ec.entry.js.map +1 -0
  49. package/dist/atomic/{p-877d35b1.entry.js → p-5adbf098.entry.js} +2 -2
  50. package/dist/atomic/{p-4b3d253b.entry.js → p-65373475.entry.js} +2 -2
  51. package/dist/atomic/{p-3c8d109e.entry.js → p-6f988841.entry.js} +2 -2
  52. package/dist/atomic/{p-b28011e6.entry.js → p-71bb8125.entry.js} +2 -2
  53. package/dist/atomic/{p-de066001.entry.js → p-757de797.entry.js} +2 -2
  54. package/dist/atomic/{p-78b70622.entry.js → p-8acb1466.entry.js} +2 -2
  55. package/dist/atomic/{p-93e29b24.entry.js → p-9883415e.entry.js} +2 -2
  56. package/dist/atomic/{p-7b899b57.entry.js → p-a02b1209.entry.js} +2 -2
  57. package/dist/atomic/{p-d00a12e9.entry.js → p-b4ad3036.entry.js} +2 -2
  58. package/dist/atomic/{p-a760d9f9.entry.js → p-be1b98a6.entry.js} +2 -2
  59. package/dist/atomic/{p-7dfcd6af.entry.js → p-bf50b64d.entry.js} +2 -2
  60. package/dist/atomic/{p-c49cfa0c.entry.js → p-d11b2b24.entry.js} +2 -2
  61. package/dist/atomic/{p-f22bcb8c.entry.js → p-d2d22ab2.entry.js} +2 -2
  62. package/dist/atomic/{p-c7040496.entry.js → p-e1865f9f.entry.js} +2 -2
  63. package/dist/atomic/{p-021f01d6.entry.js → p-e8d5e852.entry.js} +2 -2
  64. package/dist/atomic/{p-7b0b9e9b.entry.js → p-f073a78d.entry.js} +2 -2
  65. package/dist/atomic/{p-c88a3d2d.entry.js → p-fb7ad34b.entry.js} +2 -2
  66. package/dist/cjs/_loader.cjs.js +1 -1
  67. package/dist/cjs/{analytics-config-82f35f78.js → analytics-config-e3890e2c.js} +2 -2
  68. package/dist/cjs/{analytics-config-82f35f78.js.map → analytics-config-e3890e2c.js.map} +1 -1
  69. package/dist/cjs/atomic-category-facet.cjs.entry.js +1 -1
  70. package/dist/cjs/atomic-facet.cjs.entry.js +1 -1
  71. package/dist/cjs/atomic-format-currency.cjs.entry.js +1 -1
  72. package/dist/cjs/atomic-format-number.cjs.entry.js +1 -1
  73. package/dist/cjs/atomic-format-unit.cjs.entry.js +1 -1
  74. package/dist/cjs/atomic-insight-interface.cjs.entry.js +1 -1
  75. package/dist/cjs/atomic-insight-pager.cjs.entry.js +41 -7
  76. package/dist/cjs/atomic-insight-pager.cjs.entry.js.map +1 -1
  77. package/dist/cjs/atomic-numeric-facet.cjs.entry.js +1 -1
  78. package/dist/cjs/atomic-query-error.cjs.entry.js +1 -1
  79. package/dist/cjs/atomic-quickview-modal.cjs.entry.js +1 -1
  80. package/dist/cjs/atomic-quickview.cjs.entry.js +1 -1
  81. package/dist/cjs/atomic-recs-interface.cjs.entry.js +1 -1
  82. package/dist/cjs/atomic-refine-modal.cjs.entry.js +1 -1
  83. package/dist/cjs/atomic-refine-toggle.cjs.entry.js +1 -1
  84. package/dist/cjs/atomic-relevance-inspector.cjs.entry.js +2 -2
  85. package/dist/cjs/atomic-result-children.cjs.entry.js +1 -1
  86. package/dist/cjs/atomic-result-fields-list.cjs.entry.js +1 -1
  87. package/dist/cjs/atomic-result-link.cjs.entry.js +1 -1
  88. package/dist/cjs/atomic-result-list.cjs.entry.js +1 -1
  89. package/dist/cjs/atomic-result-placeholder_8.cjs.entry.js +1 -1
  90. package/dist/cjs/atomic-search-box-query-suggestions_2.cjs.entry.js +2 -2
  91. package/dist/cjs/atomic-search-box.cjs.entry.js +4 -4
  92. package/dist/cjs/atomic-search-interface.cjs.entry.js +1 -1
  93. package/dist/cjs/atomic-smart-snippet-feedback-modal.cjs.entry.js +2 -2
  94. package/dist/cjs/atomic-sort-dropdown.cjs.entry.js +2 -2
  95. package/dist/cjs/atomic-sort-expression.cjs.entry.js +1 -1
  96. package/dist/cjs/atomic-tab-manager.cjs.entry.js +1 -1
  97. package/dist/cjs/atomic.cjs.js +1 -1
  98. package/dist/cjs/index-757bc886.js +0 -4
  99. package/dist/cjs/version.cjs.js +2 -2
  100. package/dist/esm/_loader.js +1 -1
  101. package/dist/esm/{analytics-config-7a822440.js → analytics-config-76f4b38f.js} +2 -2
  102. package/dist/esm/{analytics-config-7a822440.js.map → analytics-config-76f4b38f.js.map} +1 -1
  103. package/dist/esm/atomic-category-facet.entry.js +1 -1
  104. package/dist/esm/atomic-facet.entry.js +1 -1
  105. package/dist/esm/atomic-format-currency.entry.js +1 -1
  106. package/dist/esm/atomic-format-number.entry.js +1 -1
  107. package/dist/esm/atomic-format-unit.entry.js +1 -1
  108. package/dist/esm/atomic-insight-interface.entry.js +1 -1
  109. package/dist/esm/atomic-insight-pager.entry.js +38 -4
  110. package/dist/esm/atomic-insight-pager.entry.js.map +1 -1
  111. package/dist/esm/atomic-numeric-facet.entry.js +1 -1
  112. package/dist/esm/atomic-query-error.entry.js +1 -1
  113. package/dist/esm/atomic-quickview-modal.entry.js +1 -1
  114. package/dist/esm/atomic-quickview.entry.js +1 -1
  115. package/dist/esm/atomic-recs-interface.entry.js +1 -1
  116. package/dist/esm/atomic-refine-modal.entry.js +1 -1
  117. package/dist/esm/atomic-refine-toggle.entry.js +1 -1
  118. package/dist/esm/atomic-relevance-inspector.entry.js +2 -2
  119. package/dist/esm/atomic-result-children.entry.js +1 -1
  120. package/dist/esm/atomic-result-fields-list.entry.js +1 -1
  121. package/dist/esm/atomic-result-link.entry.js +1 -1
  122. package/dist/esm/atomic-result-list.entry.js +1 -1
  123. package/dist/esm/atomic-result-placeholder_8.entry.js +1 -1
  124. package/dist/esm/atomic-search-box-query-suggestions_2.entry.js +2 -2
  125. package/dist/esm/atomic-search-box.entry.js +4 -4
  126. package/dist/esm/atomic-search-interface.entry.js +1 -1
  127. package/dist/esm/atomic-smart-snippet-feedback-modal.entry.js +2 -2
  128. package/dist/esm/atomic-sort-dropdown.entry.js +2 -2
  129. package/dist/esm/atomic-sort-expression.entry.js +1 -1
  130. package/dist/esm/atomic-tab-manager.entry.js +1 -1
  131. package/dist/esm/atomic.js +1 -1
  132. package/dist/esm/index-3f35faca.js +0 -4
  133. package/dist/esm/version.js +2 -2
  134. package/dist/types/components/search/atomic-pager/atomic-pager.d.ts +26 -16
  135. package/dist/types/components/search/index.d.ts +1 -0
  136. package/dist/types/components.d.ts +0 -65
  137. package/docs/atomic-docs.json +1 -167
  138. package/package.json +3 -3
  139. package/dist/atomic/components/atomic-pager.d.ts +0 -11
  140. package/dist/atomic/components/atomic-pager.js +0 -134
  141. package/dist/atomic/components/atomic-pager.js.map +0 -1
  142. package/dist/atomic/components/stencil-pager-navigation.js +0 -42
  143. package/dist/atomic/components/stencil-pager-navigation.js.map +0 -1
  144. package/dist/atomic/p-211d7d6a.js +0 -2
  145. package/dist/atomic/p-211d7d6a.js.map +0 -1
  146. package/dist/atomic/p-fa8b7c4c.entry.js +0 -2
  147. package/dist/atomic/p-fa8b7c4c.entry.js.map +0 -1
  148. package/dist/atomic/p-fcf3f7d7.entry.js +0 -2
  149. package/dist/atomic/p-fcf3f7d7.entry.js.map +0 -1
  150. package/dist/cjs/atomic-pager.cjs.entry.js +0 -121
  151. package/dist/cjs/atomic-pager.cjs.entry.js.map +0 -1
  152. package/dist/cjs/stencil-pager-navigation-c20b8a95.js +0 -48
  153. package/dist/cjs/stencil-pager-navigation-c20b8a95.js.map +0 -1
  154. package/dist/esm/atomic-pager.entry.js +0 -117
  155. package/dist/esm/atomic-pager.entry.js.map +0 -1
  156. package/dist/esm/stencil-pager-navigation-7261a834.js +0 -42
  157. package/dist/esm/stencil-pager-navigation-7261a834.js.map +0 -1
  158. /package/dist/atomic/{p-ae060711.entry.js.map → p-00e5bb15.entry.js.map} +0 -0
  159. /package/dist/atomic/{p-9a451295.js.map → p-031670fe.js.map} +0 -0
  160. /package/dist/atomic/{p-330e6e7c.entry.js.map → p-3af5c567.entry.js.map} +0 -0
  161. /package/dist/atomic/{p-327df077.entry.js.map → p-43c16eeb.entry.js.map} +0 -0
  162. /package/dist/atomic/{p-75e00690.entry.js.map → p-45c4685e.entry.js.map} +0 -0
  163. /package/dist/atomic/{p-09c4c7f2.entry.js.map → p-470f88ed.entry.js.map} +0 -0
  164. /package/dist/atomic/{p-7a625c7e.entry.js.map → p-4915faeb.entry.js.map} +0 -0
  165. /package/dist/atomic/{p-52ba404c.entry.js.map → p-4c30ca3e.entry.js.map} +0 -0
  166. /package/dist/atomic/{p-aa2a81fd.entry.js.map → p-4e9d1f9e.entry.js.map} +0 -0
  167. /package/dist/atomic/{p-31f1e44e.entry.js.map → p-516b8165.entry.js.map} +0 -0
  168. /package/dist/atomic/{p-877d35b1.entry.js.map → p-5adbf098.entry.js.map} +0 -0
  169. /package/dist/atomic/{p-4b3d253b.entry.js.map → p-65373475.entry.js.map} +0 -0
  170. /package/dist/atomic/{p-3c8d109e.entry.js.map → p-6f988841.entry.js.map} +0 -0
  171. /package/dist/atomic/{p-b28011e6.entry.js.map → p-71bb8125.entry.js.map} +0 -0
  172. /package/dist/atomic/{p-de066001.entry.js.map → p-757de797.entry.js.map} +0 -0
  173. /package/dist/atomic/{p-78b70622.entry.js.map → p-8acb1466.entry.js.map} +0 -0
  174. /package/dist/atomic/{p-93e29b24.entry.js.map → p-9883415e.entry.js.map} +0 -0
  175. /package/dist/atomic/{p-7b899b57.entry.js.map → p-a02b1209.entry.js.map} +0 -0
  176. /package/dist/atomic/{p-d00a12e9.entry.js.map → p-b4ad3036.entry.js.map} +0 -0
  177. /package/dist/atomic/{p-a760d9f9.entry.js.map → p-be1b98a6.entry.js.map} +0 -0
  178. /package/dist/atomic/{p-7dfcd6af.entry.js.map → p-bf50b64d.entry.js.map} +0 -0
  179. /package/dist/atomic/{p-c49cfa0c.entry.js.map → p-d11b2b24.entry.js.map} +0 -0
  180. /package/dist/atomic/{p-f22bcb8c.entry.js.map → p-d2d22ab2.entry.js.map} +0 -0
  181. /package/dist/atomic/{p-c7040496.entry.js.map → p-e1865f9f.entry.js.map} +0 -0
  182. /package/dist/atomic/{p-021f01d6.entry.js.map → p-e8d5e852.entry.js.map} +0 -0
  183. /package/dist/atomic/{p-7b0b9e9b.entry.js.map → p-f073a78d.entry.js.map} +0 -0
  184. /package/dist/atomic/{p-c88a3d2d.entry.js.map → p-fb7ad34b.entry.js.map} +0 -0
@@ -289,7 +289,7 @@ const AtomicNumericFacet$1 = /*@__PURE__*/ proxyCustomElement(class AtomicNumeri
289
289
  }
290
290
  render() {
291
291
  const { searchStatusState: { firstSearchExecuted, hasError }, bindings: { i18n }, } = this;
292
- return (h(FacetGuard, { key: '481b5d0d304d6e7f6696faa14dc0dbb501f0490d', enabled: this.enabled, firstSearchExecuted: firstSearchExecuted, hasError: hasError, hasResults: this.shouldRenderFacet }, firstSearchExecuted ? (h(FacetContainer, null, h(FacetHeader, { i18n: i18n, label: this.label, onClearFilters: () => {
292
+ return (h(FacetGuard, { key: '15b03c400b65ced232766d9ef8a7a9b2fbff9c98', enabled: this.enabled, firstSearchExecuted: firstSearchExecuted, hasError: hasError, hasResults: this.shouldRenderFacet }, firstSearchExecuted ? (h(FacetContainer, null, h(FacetHeader, { i18n: i18n, label: this.label, onClearFilters: () => {
293
293
  this.focusTarget.focusAfterSearch();
294
294
  if (this.filterState?.range) {
295
295
  this.filter?.clear();
@@ -37,7 +37,7 @@ const AtomicQueryError$1 = /*@__PURE__*/ proxyCustomElement(class AtomicQueryErr
37
37
  if (hasError) {
38
38
  this.ariaMessage = getAriaMessageFromErrorType(i18n, organizationId, url, error?.type);
39
39
  }
40
- return (h(QueryErrorGuard, { key: 'ffb2ce6b51bbb932a641ca4913d9e526f83c07cb', hasError: hasError }, h(QueryErrorContainer, { key: 'c59053c9d4ef036c9875816343bbdc73845410c3' }, h(QueryErrorIcon, { key: '278d4b8216dbfa149a041fc2cc16e8799e1c0810', errorType: error?.type }), h(QueryErrorTitle, { key: '6aa2ae0ac592206ff2e29d70810f0789132e556a', errorType: error?.type, i18n: i18n, organizationId: organizationId }), h(QueryErrorDescription, { key: '0a7af988b7769aaa45d8659cd7782a3c0321aa30', i18n: i18n, organizationId: organizationId, url: url, errorType: error?.type }), h(QueryErrorShowMore, { key: 'c12b72ed1b843f60d8709fe6212d902b3c920c28', link: h(QueryErrorLink, { i18n: i18n, errorType: error?.type }), onShowMore: () => (this.showMoreInfo = !this.showMoreInfo), i18n: i18n }), h(QueryErrorDetails, { key: 'e772576f173f5c67a7a2e6d4a824bf454c2c2370', error: error, show: this.showMoreInfo }))));
40
+ return (h(QueryErrorGuard, { key: '03bbb522c2940aba7bd608dc2f8c5f3ccfcdc4bb', hasError: hasError }, h(QueryErrorContainer, { key: '527e7454327429302b58c227bdec3b48fbbe4711' }, h(QueryErrorIcon, { key: '6f64bd01c47cbca966c9f579de76a2a0037918b7', errorType: error?.type }), h(QueryErrorTitle, { key: '434d6a8521b4e5684f3d4eef383d7eb202ee3a23', errorType: error?.type, i18n: i18n, organizationId: organizationId }), h(QueryErrorDescription, { key: 'e81443b64f891b0db01403b7962ce3694fc3c4b7', i18n: i18n, organizationId: organizationId, url: url, errorType: error?.type }), h(QueryErrorShowMore, { key: '40b280ffce9d9041425f8955d9ea0b1791d300bb', link: h(QueryErrorLink, { i18n: i18n, errorType: error?.type }), onShowMore: () => (this.showMoreInfo = !this.showMoreInfo), i18n: i18n }), h(QueryErrorDetails, { key: '26091175ee3103ea36f3acbcf3cda528590a376a', error: error, show: this.showMoreInfo }))));
41
41
  }
42
42
  static get style() { return AtomicQueryErrorStyle0; }
43
43
  }, [1, "atomic-query-error", {
@@ -582,7 +582,7 @@ const AtomicQuickviewModal = /*@__PURE__*/ proxyCustomElement(class AtomicQuickv
582
582
  });
583
583
  }
584
584
  render() {
585
- return (h("atomic-modal", { key: '39961d2d82abff5de836cc62847719c3c8e42a8a', fullscreen: this.bindings.store.isMobile(), class: 'atomic-quickview-modal', isOpen: this.isOpen, close: () => this.onClose(), exportparts: ATOMIC_MODAL_EXPORT_PARTS }, this.renderHeader(), this.renderBody(), this.renderFooter()));
585
+ return (h("atomic-modal", { key: '9b31f319fb04a44adb84434f2e09bc211b7cf03a', fullscreen: this.bindings.store.isMobile(), class: 'atomic-quickview-modal', isOpen: this.isOpen, close: () => this.onClose(), exportparts: ATOMIC_MODAL_EXPORT_PARTS }, this.renderHeader(), this.renderBody(), this.renderFooter()));
586
586
  }
587
587
  static get watchers() { return {
588
588
  "highlightKeywords": ["watchHighlightKeywords"]
@@ -106,7 +106,7 @@ const AtomicQuickview$1 = /*@__PURE__*/ proxyCustomElement(class AtomicQuickview
106
106
  }
107
107
  render() {
108
108
  if (this.quickviewState.resultHasPreview) {
109
- return (h(Button, { key: 'e764a4103dfec30f0fc15ad4237aaa64a2db267c', part: "button", title: this.bindings.i18n.t('quickview'), style: "outline-primary", class: "p-2", onClick: (event) => this.onClick(event), ref: this.focusTarget.setTarget }, h("atomic-icon", { key: '5df8ef61e0138ba63512897f99364391e5c5be14', part: "icon", class: "flex w-5 justify-center", icon: QuickviewIcon })));
109
+ return (h(Button, { key: '923515932e09ccd18ec5060671a55800e5e6e83a', part: "button", title: this.bindings.i18n.t('quickview'), style: "outline-primary", class: "p-2", onClick: (event) => this.onClick(event), ref: this.focusTarget.setTarget }, h("atomic-icon", { key: '375e24610aae279d97f4efa17c6084cea5957008', part: "icon", class: "flex w-5 justify-center", icon: QuickviewIcon })));
110
110
  }
111
111
  }
112
112
  static get style() { return AtomicQuickviewStyle0; }
@@ -204,7 +204,7 @@ const AtomicRefineModal = /*@__PURE__*/ proxyCustomElement(class AtomicRefineMod
204
204
  return (h(RefineModalFiltersSection, { i18n: i18n, withFacets: hasFacetElements, withAutomaticFacets: hasAutomaticFacets }, this.breadcrumbManagerState.hasBreadcrumbs && (h(RefineModalFiltersClearButton, { i18n: i18n, onClick: () => this.breadcrumbManager.deselectAll() }))));
205
205
  }
206
206
  render() {
207
- return (h(RefineModal, { key: 'f73c3acc43f2fee8af45e90cd39c3adaedb76dd0', i18n: this.bindings.i18n, host: this.host, isOpen: this.isOpen, onClose: () => (this.isOpen = false), title: this.bindings.i18n.t('sort-and-filter'), numberOfItems: this.querySummaryState.total, openButton: this.openButton }, h(RefineModalBody, { key: 'd02d887640c8ad335300b5808a34abc40cdf598a' }, this.renderSort(), this.renderFilters())));
207
+ return (h(RefineModal, { key: 'b24978bc166205334991a7cd364924dcc33a41f6', i18n: this.bindings.i18n, host: this.host, isOpen: this.isOpen, onClose: () => (this.isOpen = false), title: this.bindings.i18n.t('sort-and-filter'), numberOfItems: this.querySummaryState.total, openButton: this.openButton }, h(RefineModalBody, { key: '5ef9af05829d5b359005abc8ee7a584cf5c955d4' }, this.renderSort(), this.renderFilters())));
208
208
  }
209
209
  componentDidLoad() {
210
210
  this.host.style.display = '';
@@ -68,7 +68,7 @@ const AtomicRefineToggle$1 = /*@__PURE__*/ proxyCustomElement(class AtomicRefine
68
68
  this.modalRef && (this.modalRef.isOpen = true);
69
69
  }
70
70
  render() {
71
- return (h(RefineToggleGuard, { key: '30146bbcdbbf8fc15c2f5b6e03f72e909b975b4c', firstRequestExecuted: this.searchStatusState.firstSearchExecuted, hasError: this.searchStatusState.hasError, hasItems: this.searchStatusState.hasResults }, h(RefineToggleButton, { key: 'df667755709ab4d7f1d4c2f3af3ea78ec89a57eb', i18n: this.bindings.i18n, onClick: () => this.enableModal(), setRef: (button) => {
71
+ return (h(RefineToggleGuard, { key: '312e1ac5b9c66596ae803bd31cc0348232b8f326', firstRequestExecuted: this.searchStatusState.firstSearchExecuted, hasError: this.searchStatusState.hasError, hasItems: this.searchStatusState.hasResults }, h(RefineToggleButton, { key: 'a9d05a44b082ccf83b6be5e84a076c0259b27a39', i18n: this.bindings.i18n, onClick: () => this.enableModal(), setRef: (button) => {
72
72
  if (!button) {
73
73
  return;
74
74
  }
@@ -16,9 +16,9 @@ const AtomicRelevanceInspector = /*@__PURE__*/ proxyCustomElement(class AtomicRe
16
16
  this.open = false;
17
17
  }
18
18
  render() {
19
- return (h("atomic-modal", { key: 'a2a06af98fa63735677cb7bd1c81208ce01ede22', exportparts: "footer", isOpen: this.open, close: () => {
19
+ return (h("atomic-modal", { key: 'e3ce0d01d697da5adb7e6028692734ce78fe88b5', exportparts: "footer", isOpen: this.open, close: () => {
20
20
  this.closeRelevanceInspector?.emit();
21
- } }, h("p", { key: 'ca288b04b48ea98d5e7e8a9e13e6768886415118', slot: "header" }, "Open the relevance inspector"), h("p", { key: '7eb8f2bb1b8a39d6ad0c900b7d4647c751b8020c', slot: "body" }, "The Relevance Inspector will open in the Coveo Administration Console."), h("div", { key: 'df1dbdcc3db3f5ba75c2f9472977f19c51a539e7', slot: "footer", class: "flex w-full items-center justify-end" }, h(Button, { key: '57808d93ac86afc8897c90c2da61f5004ee23d33', style: "outline-primary", class: "mr-2 p-2", onClick: () => this.closeRelevanceInspector?.emit() }, "Ignore"), h("a", { key: 'c2cabaacd04b5ce4de627bd8dc1351dc020342f2', class: "btn-primary p-2", target: "_blank", href: this.adminHref, onClick: () => this.closeRelevanceInspector?.emit() }, "Open"))));
21
+ } }, h("p", { key: 'a9d5de1f5c779b36843f0c4b92352707ed57f59f', slot: "header" }, "Open the relevance inspector"), h("p", { key: 'ded771ba370b30470ead89dd71dcd3d7942de20e', slot: "body" }, "The Relevance Inspector will open in the Coveo Administration Console."), h("div", { key: 'bd7f1afa7457ca17b45c1a913dc82586d72c5bb7', slot: "footer", class: "flex w-full items-center justify-end" }, h(Button, { key: 'ebe15b64f3ebcd37fac4e5d5b1d270a9611df18e', style: "outline-primary", class: "mr-2 p-2", onClick: () => this.closeRelevanceInspector?.emit() }, "Ignore"), h("a", { key: 'f774884a805fbe36c5f5529142a0becf0b200e2d', class: "btn-primary p-2", target: "_blank", href: this.adminHref, onClick: () => this.closeRelevanceInspector?.emit() }, "Open"))));
22
22
  }
23
23
  get adminHref() {
24
24
  const { organizationId, environment } = this.bindings.engine.state.configuration;
@@ -138,7 +138,7 @@ const AtomicResultChildren$1 = /*@__PURE__*/ proxyCustomElement(class AtomicResu
138
138
  return (h(ChildrenWrapper, { hasChildren: children.length > 0 }, children.map((child, i) => this.renderChild(child, i === children.length - 1))));
139
139
  }
140
140
  render() {
141
- return (h(ResultChildrenGuard, { key: '28a209dcfc87da57c297a1a5fe5a06877311eaf7', inheritTemplates: this.inheritTemplates, resultTemplateRegistered: this.resultTemplateRegistered, templateHasError: this.templateHasError }, this.collection ? this.renderCollection() : this.renderFoldedResult()));
141
+ return (h(ResultChildrenGuard, { key: '87e4eb542feb7fd2fe4adafb1a966a77653195e6', inheritTemplates: this.inheritTemplates, resultTemplateRegistered: this.resultTemplateRegistered, templateHasError: this.templateHasError }, this.collection ? this.renderCollection() : this.renderFoldedResult()));
142
142
  }
143
143
  get host() { return this; }
144
144
  static get style() { return AtomicResultChildrenStyle0; }
@@ -98,7 +98,7 @@ const AtomicResultFieldsList$1 = /*@__PURE__*/ proxyCustomElement(class AtomicRe
98
98
  }
99
99
  }
100
100
  render() {
101
- return h(Host, { key: '7206c67fd17f812fdf7a5aaf9429af162907677e' });
101
+ return h(Host, { key: 'bb78009f1c331adf546e3fb7516413cce13de162' });
102
102
  }
103
103
  get host() { return this; }
104
104
  static get style() { return AtomicResultFieldsListStyle0; }
@@ -43,7 +43,7 @@ const AtomicResultLink$1 = /*@__PURE__*/ proxyCustomElement(class AtomicResultLi
43
43
  const href = isUndefined(this.hrefTemplate)
44
44
  ? this.result.clickUri
45
45
  : buildStringTemplateFromResult(this.hrefTemplate, this.result, this.bindings);
46
- return (h(LinkWithItemAnalytics, { key: 'adbdf25dba24847402d7ba4afd254627e6ae833c', href: href, onSelect: () => this.interactiveResult.select(), onBeginDelayedSelect: () => this.interactiveResult.beginDelayedSelect(), onCancelPendingSelect: () => this.interactiveResult.cancelPendingSelect(), attributes: this.linkAttributes, stopPropagation: this.stopPropagation }, this.hasDefaultSlot ? (h("slot", null)) : (h("atomic-result-text", { field: "title", default: "no-title" }))));
46
+ return (h(LinkWithItemAnalytics, { key: '161199ea164427d67db5456e43d7c3cb2ebe9d8d', href: href, onSelect: () => this.interactiveResult.select(), onBeginDelayedSelect: () => this.interactiveResult.beginDelayedSelect(), onCancelPendingSelect: () => this.interactiveResult.cancelPendingSelect(), attributes: this.linkAttributes, stopPropagation: this.stopPropagation }, this.hasDefaultSlot ? (h("slot", null)) : (h("atomic-result-text", { field: "title", default: "no-title" }))));
47
47
  }
48
48
  get host() { return this; }
49
49
  static get style() { return AtomicResultLinkStyle0; }
@@ -194,7 +194,7 @@ const AtomicResultList$1 = /*@__PURE__*/ proxyCustomElement(class AtomicResultLi
194
194
  render() {
195
195
  this.resultListCommon.updateBreakpoints();
196
196
  const listClasses = this.computeListDisplayClasses();
197
- return (h(TabGuard, { key: '3300c868d8f38a4f7215288c091db4f60bec918b', tabsIncluded: this.tabsIncluded, tabsExcluded: this.tabsExcluded, activeTab: this.tabManagerState.activeTab }, h(ItemListGuard, { key: '76429f5c16104eed0ff58b83dd2cb94f807e2b62', hasError: this.resultListState.hasError, hasTemplate: this.resultTemplateRegistered, templateHasError: this.itemTemplateProvider.hasError, firstRequestExecuted: this.resultListState.firstSearchExecuted, hasItems: this.resultListState.hasResults }, h(DisplayWrapper, { key: 'f0944363d4bba184e1e76869f507ea03bed2951d', display: this.display, listClasses: listClasses }, h(ResultsPlaceholdersGuard, { key: 'c91a24daf9e86581e73f8ac514eca75275778376', density: this.density, display: this.display, imageSize: this.imageSize, displayPlaceholders: !this.isAppLoaded, numberOfPlaceholders: this.resultsPerPageState.numberOfResults }), h(ItemDisplayGuard, { key: '8266609ac00b5e0c3fb8eb7be5c3485b20c7b3d6', firstRequestExecuted: this.resultListState.firstSearchExecuted, hasItems: this.resultListState.hasResults }, this.display === 'table'
197
+ return (h(TabGuard, { key: '649dedc762f1c1c9dd45851b000ef76ecd07effa', tabsIncluded: this.tabsIncluded, tabsExcluded: this.tabsExcluded, activeTab: this.tabManagerState.activeTab }, h(ItemListGuard, { key: '05afb457fd344b7ccf5cb925d0baf32227f2ddba', hasError: this.resultListState.hasError, hasTemplate: this.resultTemplateRegistered, templateHasError: this.itemTemplateProvider.hasError, firstRequestExecuted: this.resultListState.firstSearchExecuted, hasItems: this.resultListState.hasResults }, h(DisplayWrapper, { key: 'a68a18d3eb5c4fad3949bbc8f11a1610db400346', display: this.display, listClasses: listClasses }, h(ResultsPlaceholdersGuard, { key: '19c2415dc2c2497abc612acd1866f1284cdf2422', density: this.density, display: this.display, imageSize: this.imageSize, displayPlaceholders: !this.isAppLoaded, numberOfPlaceholders: this.resultsPerPageState.numberOfResults }), h(ItemDisplayGuard, { key: '5eadfb9707d35affe14cc9eabfe70a436981cc80', firstRequestExecuted: this.resultListState.firstSearchExecuted, hasItems: this.resultListState.hasResults }, this.display === 'table'
198
198
  ? this.renderAsTable()
199
199
  : this.display === 'grid'
200
200
  ? this.renderAsGrid()
@@ -18,7 +18,7 @@ const AtomicResultTablePlaceholder = /*@__PURE__*/ proxyCustomElement(class Atom
18
18
  return getItemDisplayClasses('table', this.density, this.imageSize);
19
19
  }
20
20
  render() {
21
- return (h("table", { key: 'b23e982c8d8a14904231b367e5c066e14824c4b2', class: `list-root animate-pulse ${this.getClasses().join(' ')}` }, h("thead", { key: '00387bd4ff6803951c3e7609322be8472609e73f' }, h("tr", { key: 'c673c8f51db99354ea1dc361c697c96bed55ee58' }, h("th", { key: '824857b37ce0bc45ce4ae4671ee07a3eb3739781' }, h("div", { key: '2519cca4e7ebbbbff1214424e33ec230295d9a9f', class: `mt-2 h-8 ${placeholderClasses}`, style: { width: '14.5rem' } })), h("th", { key: 'd26312cc0a3a3e3d29300f65d2b53b743bb44365' }, h("div", { key: '3e9cac4825ef7a63147b19f3dab0a03dcf276596', class: `mt-2 h-8 ${placeholderClasses}`, style: { width: '9.75rem' } })), h("th", { key: '48bd51072cd57e612dd4d80ab46bebaea4bc1fe7' }, h("div", { key: '5d84e58fcdb543d1c767dbe80a013339c50567b4', class: `mt-2 h-8 ${placeholderClasses}`, style: { width: '6.5rem' } })))), h("tbody", { key: '2f0d8102e80d9fa5fa0d2e20e2541f2d1b3e2a13' }, Array.from({ length: this.rows }, () => (h("tr", null, h("td", null, h("div", { class: `mb-6 h-8 ${placeholderClasses}`, style: { width: '22.875rem' } }), h("div", { class: `mb-2 h-5 ${placeholderClasses}`, style: { width: '23.75rem' } }), h("div", { class: `h-5 ${placeholderClasses}`, style: { width: '11.5rem' } })), h("td", null, h("div", { class: `mt-1.5 h-5 ${placeholderClasses}`, style: { width: '11rem' } })), h("td", null, h("div", { class: `mt-1.5 h-5 ${placeholderClasses}`, style: { width: '4.875rem' } }))))))));
21
+ return (h("table", { key: 'b8c5b9a4cf0bd04dcb9d0cebfe081a30c6758b35', class: `list-root animate-pulse ${this.getClasses().join(' ')}` }, h("thead", { key: '7e8092ecc1348a54780de5b079d92add1c9124a5' }, h("tr", { key: '0f3411ec8bffc6707e9214acdf15d21134fb4554' }, h("th", { key: '5d84b299102a369cf4c59b6df1487cdae303fbf6' }, h("div", { key: 'c10767a6181669697474b5804e29b265f7a8083f', class: `mt-2 h-8 ${placeholderClasses}`, style: { width: '14.5rem' } })), h("th", { key: '389fed1b7f36142236761962450032ec7739a8a7' }, h("div", { key: 'a1ed8c588b5ffb64de2c2daa234b9e1a88086043', class: `mt-2 h-8 ${placeholderClasses}`, style: { width: '9.75rem' } })), h("th", { key: '36202380fc0afaf244b5e1e9772c7e17ce2b20ba' }, h("div", { key: '6691745f3a6b867056fef0828077747e1b323a80', class: `mt-2 h-8 ${placeholderClasses}`, style: { width: '6.5rem' } })))), h("tbody", { key: 'cb2b8cb0f545b97998c80f73c4ac33a2d46cdaaf' }, Array.from({ length: this.rows }, () => (h("tr", null, h("td", null, h("div", { class: `mb-6 h-8 ${placeholderClasses}`, style: { width: '22.875rem' } }), h("div", { class: `mb-2 h-5 ${placeholderClasses}`, style: { width: '23.75rem' } }), h("div", { class: `h-5 ${placeholderClasses}`, style: { width: '11.5rem' } })), h("td", null, h("div", { class: `mt-1.5 h-5 ${placeholderClasses}`, style: { width: '11rem' } })), h("td", null, h("div", { class: `mt-1.5 h-5 ${placeholderClasses}`, style: { width: '4.875rem' } }))))))));
22
22
  }
23
23
  static get style() { return AtomicResultTablePlaceholderStyle0; }
24
24
  }, [1, "atomic-result-table-placeholder", {
@@ -60,7 +60,7 @@ const AtomicSearchBoxQuerySuggestions = /*@__PURE__*/ proxyCustomElement(class A
60
60
  }
61
61
  render() {
62
62
  if (this.error) {
63
- return (h("atomic-component-error", { key: '818ed7b1734a6f2cbf721b1eb3fd03d020791e9e', element: this.host, error: this.error }));
63
+ return (h("atomic-component-error", { key: 'ee518dd01ee68d5ac1e13c37335888acf7089beb', element: this.host, error: this.error }));
64
64
  }
65
65
  }
66
66
  get host() { return this; }
@@ -154,7 +154,7 @@ const AtomicSearchBoxRecentQueries = /*@__PURE__*/ proxyCustomElement(class Atom
154
154
  }
155
155
  render() {
156
156
  if (this.error) {
157
- return (h("atomic-component-error", { key: 'a0eed6f3235cbc1ecd75fdb75608c6db10934dda', element: this.host, error: this.error }));
157
+ return (h("atomic-component-error", { key: '577129c08c073b99dbb6b86b77e2ffa7c2ff7f69', element: this.host, error: this.error }));
158
158
  }
159
159
  }
160
160
  get host() { return this; }
@@ -425,18 +425,18 @@ const AtomicSearchBox$1 = /*@__PURE__*/ proxyCustomElement(class AtomicSearchBox
425
425
  if (!this.suggestionManager.suggestions.length) {
426
426
  this.registerSearchboxSuggestionEvents();
427
427
  }
428
- return (h(Host, { key: 'e3ed5e9633d8f37158974ae3f1b21cedf5f7de01' }, this.renderAbsolutePositionSpacer(), [
429
- h(SearchBoxWrapper, { key: 'b5f0da61b7ac4f1fee156de7027945040dbbf500', disabled: isDisabled, onFocusout: (event) => {
428
+ return (h(Host, { key: 'c6057e947ead5556e40b2cedcf06781a7e9927f0' }, this.renderAbsolutePositionSpacer(), [
429
+ h(SearchBoxWrapper, { key: '628b8bcabcf9612cba7970163b8c2a2f7747de9d', disabled: isDisabled, onFocusout: (event) => {
430
430
  if (!isFocusingOut(event)) {
431
431
  return;
432
432
  }
433
433
  this.suggestionManager.clearSuggestions();
434
434
  this.isExpanded = false;
435
- } }, this.renderTextBox(searchLabel), h(SubmitButton, { key: 'c8c6083671167dac6c211c7b456dcfe87ca1cfaa', bindings: this.bindings, disabled: isDisabled, onClick: () => {
435
+ } }, this.renderTextBox(searchLabel), h(SubmitButton, { key: '82b2a7e72b27405c8ea129dee66901dc95ea7510', bindings: this.bindings, disabled: isDisabled, onClick: () => {
436
436
  this.searchBox.submit();
437
437
  this.suggestionManager.clearSuggestions();
438
438
  } }), this.renderSuggestions()),
439
- !this.suggestionManager.suggestions.length && (h("slot", { key: 'd6c0f1ff47370f794d0dc81782ced70baa04db91' }, h("atomic-search-box-recent-queries", { key: 'e599e83ae1f15386e310d1e03b8111144d452a8e' }), h("atomic-search-box-query-suggestions", { key: '6d446202f6722a66714ac067ad78afcf853a5dbe' }))),
439
+ !this.suggestionManager.suggestions.length && (h("slot", { key: '5d3bfbd30545b9d50afde0ea178121f2157618ae' }, h("atomic-search-box-recent-queries", { key: '0c04feaf3b136bc45532a1a134d0e307bc64131d' }), h("atomic-search-box-query-suggestions", { key: '65c916e94811e1e1a0fae8a6082e8122f34be471' }))),
440
440
  ]));
441
441
  }
442
442
  get host() { return this; }
@@ -43,9 +43,9 @@ const AtomicSmartSnippetFeedbackModal = /*@__PURE__*/ proxyCustomElement(class A
43
43
  }
44
44
  render() {
45
45
  updateBreakpoints(this.host);
46
- return (h("atomic-modal", { key: 'e859100c1a2aa70056f471123e6363953a8c978f', fullscreen: false, source: this.source, container: this.host, isOpen: this.isOpen, close: () => this.close(), exportparts: ATOMIC_MODAL_EXPORT_PARTS }, h(SmartSnippetFeedbackModalHeader, { key: '6f154e3e306f5fe14e724a7cc1124581c4ad50db', i18n: this.bindings.i18n }), h(SmartSnippetFeedbackModalBody, { key: '0c7aa2809a41f9725324d19d93a121e30995c322', formId: this.formId, onSubmit: (e) => this.sendFeedback(e) }, h(SmartSnippetFeebackModalOptions, { key: '7ea41f9ade73d9e28909ea5eb4d29fa277d6b762', i18n: this.bindings.i18n }, smartSnippetFeedbackOptions.map(({ id, localeKey, correspondingAnswer }) => (h(SmartSnippetFeedbackModalOption, { correspondingAnswer: correspondingAnswer, currentAnswer: this.currentAnswer, i18n: this.bindings.i18n, id: id, localeKey: localeKey, onChange: () => {
46
+ return (h("atomic-modal", { key: '9915bc71b6329068bc8a3731971a793946762f39', fullscreen: false, source: this.source, container: this.host, isOpen: this.isOpen, close: () => this.close(), exportparts: ATOMIC_MODAL_EXPORT_PARTS }, h(SmartSnippetFeedbackModalHeader, { key: '385350607264cd3a0dce273b18eec02909220384', i18n: this.bindings.i18n }), h(SmartSnippetFeedbackModalBody, { key: 'e1a01e0df35dbaf9da6891c825ad5e5e1e6bc534', formId: this.formId, onSubmit: (e) => this.sendFeedback(e) }, h(SmartSnippetFeebackModalOptions, { key: 'd92a6395c26802cfafbcbd50fb1b2cd86bb907de', i18n: this.bindings.i18n }, smartSnippetFeedbackOptions.map(({ id, localeKey, correspondingAnswer }) => (h(SmartSnippetFeedbackModalOption, { correspondingAnswer: correspondingAnswer, currentAnswer: this.currentAnswer, i18n: this.bindings.i18n, id: id, localeKey: localeKey, onChange: () => {
47
47
  this.currentAnswer = correspondingAnswer;
48
- } })))), h(SmartSnippetFeedbackModalDetails, { key: 'bb2bcce38f8b554e24df782edfc3bbfd2b997588', currentAnswer: this.currentAnswer, i18n: this.bindings.i18n, setDetailsInputRef: (ref) => (this.detailsInputRef = ref) })), h(SmartSnippetFeedbackModalFooter, { key: '2803172d081d52cda72b8c22b2a3b206d3b7cb23', formId: this.formId, i18n: this.bindings.i18n, onClick: () => this.close() })));
48
+ } })))), h(SmartSnippetFeedbackModalDetails, { key: '6dfe87c931bc44d202d78c5a800936aa733b89de', currentAnswer: this.currentAnswer, i18n: this.bindings.i18n, setDetailsInputRef: (ref) => (this.detailsInputRef = ref) })), h(SmartSnippetFeedbackModalFooter, { key: '86f51c71ade3a7e360ce5c000e45939e8744ade4', formId: this.formId, i18n: this.bindings.i18n, onClick: () => this.close() })));
49
49
  }
50
50
  close() {
51
51
  this.isOpen = false;
@@ -117,8 +117,8 @@ const AtomicSortDropdown$1 = /*@__PURE__*/ proxyCustomElement(class AtomicSortDr
117
117
  const { hasError, hasResults, firstSearchExecuted } = this.searchStatusState;
118
118
  const { bindings: { i18n }, id, } = this;
119
119
  return [
120
- h(SortGuard, { key: 'de3cefc2f8ba7dacb299dd569ca97d4d93a54249', firstSearchExecuted: firstSearchExecuted, hasError: hasError, hasResults: hasResults }, h(SortContainer, { key: '5a7296ed5a7f379509399ef260a344210c17ff34' }, h(SortLabel, { key: '1448eb9996a0b6a2df55f9ce880cd54c3312640d', i18n: i18n, id: id }), h(SortSelect, { key: '273f27873cfb73092eb7d98ef742536f3bb5fac5', i18n: i18n, id: id, onSelect: (evt) => this.select(evt) }, this.options.map(({ label, criteria, expression }) => (h(SortOption, { i18n: i18n, label: label, selected: this.sort.isSortedBy(criteria), value: expression })))))),
121
- h("slot", { key: 'd1058cd5f4e28bca8816e6987ec2f3a72b2d4825' }),
120
+ h(SortGuard, { key: '0669c3a8c7067eef9ba5c178a5f4d12752f8b085', firstSearchExecuted: firstSearchExecuted, hasError: hasError, hasResults: hasResults }, h(SortContainer, { key: '6eb9cc11bb18013dfd384b809e6e72d2177cbe60' }, h(SortLabel, { key: '4573530fcd7c614b7ed1d3dbb8f4ad5617477ee3', i18n: i18n, id: id }), h(SortSelect, { key: 'a5ee4b55058679c63fb628337c33d1db192cf481', i18n: i18n, id: id, onSelect: (evt) => this.select(evt) }, this.options.map(({ label, criteria, expression }) => (h(SortOption, { i18n: i18n, label: label, selected: this.sort.isSortedBy(criteria), value: expression })))))),
121
+ h("slot", { key: '39a0d6e53adfe877b5f677d4cf9b0ff9177f84e8' }),
122
122
  ];
123
123
  }
124
124
  get host() { return this; }
@@ -47,7 +47,7 @@ const AtomicSortExpression$1 = /*@__PURE__*/ proxyCustomElement(class AtomicSort
47
47
  const dropdownComponent = 'atomic-sort-dropdown';
48
48
  if (!this.host.closest(dropdownComponent)) {
49
49
  const error = new Error(`The "${this.host.nodeName.toLowerCase()}" component has to be used inside an ${dropdownComponent} element.`);
50
- return (h("atomic-component-error", { key: 'c0181fed2562ac8d51cba8d9a2395ab3fc431295', element: this.host, error: error }));
50
+ return (h("atomic-component-error", { key: '4e946fe770ef49fc6346f0bc247db856fd38ba68', element: this.host, error: error }));
51
51
  }
52
52
  }
53
53
  get host() { return this; }
@@ -59,7 +59,7 @@ const AtomicTabManager$1 = /*@__PURE__*/ proxyCustomElement(class AtomicTabManag
59
59
  });
60
60
  }
61
61
  render() {
62
- return (h(Host, { key: 'abd272be633c8913b9c64f3b20d529373e7ca08c' }, h("atomic-tab-bar", { key: 'd21406c4e28a1a4fecd2986d97aa292f0cfd48a9' }, h("div", { key: '6a0375f62e5a178cec1737108984ac1e497370bd', role: "list", "aria-label": "tab-area", part: "tab-area", class: "border-neutral mb-2 flex w-full flex-row border-b" }, this.tabs.map((tab) => (h("atomic-tab-button", { active: this.tabManagerState.activeTab === tab.name, label: this.bindings.i18n.t(tab.label, {
62
+ return (h(Host, { key: 'ea60f4179a268319ba97570f95d6881c379c8b18' }, h("atomic-tab-bar", { key: 'ea83347d794b2f83b70706bdfc4240286c27d71e' }, h("div", { key: '9d9e588d7a4b7012f43419f3edae786b177498cc', role: "list", "aria-label": "tab-area", part: "tab-area", class: "border-neutral mb-2 flex w-full flex-row border-b" }, this.tabs.map((tab) => (h("atomic-tab-button", { active: this.tabManagerState.activeTab === tab.name, label: this.bindings.i18n.t(tab.label, {
63
63
  defaultValue: tab.label,
64
64
  }), select: () => {
65
65
  if (!tab.tabController.state.isActive) {
@@ -0,0 +1,175 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { NumberValue, Schema } from '@coveo/bueno';
8
+ import { buildPager, buildSearchStatus, } from '@coveo/headless';
9
+ import { html, LitElement } from 'lit';
10
+ import { customElement, property, state } from 'lit/decorators.js';
11
+ import { keyed } from 'lit/directives/keyed.js';
12
+ import { when } from 'lit/directives/when.js';
13
+ import { createAppLoadedListener } from "../../common/interface/store";
14
+ import { renderPagerNavigation } from "../../common/pager/pager-navigation";
15
+ import { bindStateToController } from "../../../decorators/bind-state";
16
+ import { bindingGuard } from "../../../decorators/binding-guard";
17
+ import { bindings } from "../../../decorators/bindings";
18
+ import { errorGuard } from "../../../decorators/error-guard";
19
+ import { withTailwindStyles } from "../../../decorators/with-tailwind-styles";
20
+ import { InitializeBindingsMixin } from "../../../mixins/bindings-mixin";
21
+ import { randomID } from "../../../utils/utils";
22
+ const ArrowLeftIcon = "<svg viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m11.5 4.8-4.3 4.5c-.3.4-.3.9 0 1.3l4.3 4.6c.3.4.9.4 1.2 0s.3-.9 0-1.3l-3.7-4 3.7-3.9c.3-.4.3-.9 0-1.3-.3-.3-.9-.3-1.2.1z\"/></svg>";
23
+ const ArrowRightIcon = "<svg viewBox=\"0 0 20 20\"><path d=\"m8.5 15.2 4.3-4.6c.3-.4.3-.9 0-1.3l-4.4-4.5c-.3-.4-.9-.4-1.2 0s-.3.9 0 1.3l3.7 4-3.7 3.9c-.3.4-.3.9 0 1.3.4.3 1 .3 1.3-.1z\"/></svg>";
24
+ import { renderPageButtons, renderPagerNextButton, renderPagerPageButton, renderPagerPreviousButton, } from '../../common/pager/pager-buttons';
25
+ /**
26
+ * The `atomic-pager` provides buttons that allow the end user to navigate through the different result pages.
27
+ *
28
+ * @part buttons - The list of the next/previous buttons and page-buttons.
29
+ * @part page-buttons - The list of page buttons.
30
+ * @part page-button - The individual page buttons.
31
+ * @part active-page-button - The active page button.
32
+ * @part previous-button - The previous page button.
33
+ * @part next-button - The next page button.
34
+ * @part previous-button-icon - The icon displayed on the "previous page" button.
35
+ * @part next-button-icon - The icon displayed on the "next page" button.
36
+ *
37
+ * @event atomic/scrollToTop - Emitted when the user clicks any of the buttons rendered by the component.
38
+ */
39
+ let AtomicPager = class AtomicPager extends InitializeBindingsMixin(LitElement) {
40
+ constructor() {
41
+ super(...arguments);
42
+ this.isAppLoaded = false;
43
+ /**
44
+ * The maximum number of page buttons to display in the pager.
45
+ */
46
+ this.numberOfPages = 5;
47
+ /**
48
+ * The SVG icon to render on the "previous page" button.
49
+ *
50
+ * - Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location.
51
+ * - Use a value that starts with `assets://`, to display an icon from the Atomic package.
52
+ * - Use a stringified SVG to display it directly.
53
+ */
54
+ this.previousButtonIcon = ArrowLeftIcon;
55
+ /**
56
+ * The SVG icon to render on the "next page" button.
57
+ *
58
+ * - Use a value that starts with `http://`, `https://`, `./`, or `../`, to fetch and display an icon from a given location.
59
+ * - Use a value that starts with `assets://`, to display an icon from the Atomic package.
60
+ * - Use a stringified SVG to display it directly.
61
+ */
62
+ this.nextButtonIcon = ArrowRightIcon;
63
+ this.radioGroupName = randomID('atomic-pager-');
64
+ }
65
+ initialize() {
66
+ this.validateProps();
67
+ this.searchStatus = buildSearchStatus(this.bindings.engine);
68
+ this.pager = buildPager(this.bindings.engine, {
69
+ options: { numberOfPages: this.numberOfPages },
70
+ });
71
+ createAppLoadedListener(this.bindings.store, (isAppLoaded) => {
72
+ this.isAppLoaded = isAppLoaded;
73
+ });
74
+ }
75
+ render() {
76
+ const currentGroupName = `${this.radioGroupName}-${this.pagerState.currentPages.join('-')}`;
77
+ return html `${when(!this.searchStatusState.hasError &&
78
+ this.searchStatusState.hasResults &&
79
+ this.isAppLoaded, () => html `
80
+ ${renderPagerNavigation({
81
+ props: {
82
+ i18n: this.bindings.i18n,
83
+ },
84
+ })(html `
85
+ ${renderPagerPreviousButton({
86
+ props: {
87
+ icon: this.previousButtonIcon,
88
+ disabled: !this.pagerState.hasPreviousPage,
89
+ i18n: this.bindings.i18n,
90
+ onClick: () => {
91
+ this.pager.previousPage();
92
+ this.focusOnFirstResultAndScrollToTop();
93
+ },
94
+ },
95
+ })}
96
+ ${renderPageButtons({
97
+ props: {
98
+ i18n: this.bindings.i18n,
99
+ },
100
+ })(html `${this.pagerState.currentPages.map((pageNumber, index) => keyed(`page-${pageNumber}-${index}`, renderPagerPageButton({
101
+ props: {
102
+ isSelected: this.pager.isCurrentPage(pageNumber),
103
+ ariaLabel: this.bindings.i18n.t('page-number', {
104
+ pageNumber,
105
+ }),
106
+ onChecked: () => {
107
+ this.pager.selectPage(pageNumber);
108
+ this.focusOnFirstResultAndScrollToTop();
109
+ },
110
+ page: pageNumber,
111
+ groupName: currentGroupName,
112
+ text: pageNumber.toLocaleString(this.bindings.i18n.language),
113
+ },
114
+ })))}`)}
115
+ ${renderPagerNextButton({
116
+ props: {
117
+ icon: this.nextButtonIcon,
118
+ disabled: !this.pagerState.hasNextPage,
119
+ i18n: this.bindings.i18n,
120
+ onClick: () => {
121
+ this.pager.nextPage();
122
+ this.focusOnFirstResultAndScrollToTop();
123
+ },
124
+ },
125
+ })}
126
+ `)}`)}`;
127
+ }
128
+ validateProps() {
129
+ new Schema({
130
+ numberOfPages: new NumberValue({ min: 0 }),
131
+ }).validate({
132
+ numberOfPages: this.numberOfPages,
133
+ });
134
+ }
135
+ async focusOnFirstResultAndScrollToTop() {
136
+ await this.bindings.store.state.resultList?.focusOnFirstResultAfterNextSearch();
137
+ this.dispatchEvent(new CustomEvent('atomic/scrollToTop'));
138
+ }
139
+ };
140
+ __decorate([
141
+ state()
142
+ ], AtomicPager.prototype, "bindings", void 0);
143
+ __decorate([
144
+ state()
145
+ ], AtomicPager.prototype, "error", void 0);
146
+ __decorate([
147
+ state()
148
+ ], AtomicPager.prototype, "isAppLoaded", void 0);
149
+ __decorate([
150
+ bindStateToController('pager'),
151
+ state()
152
+ ], AtomicPager.prototype, "pagerState", void 0);
153
+ __decorate([
154
+ bindStateToController('searchStatus'),
155
+ state()
156
+ ], AtomicPager.prototype, "searchStatusState", void 0);
157
+ __decorate([
158
+ property({ reflect: true, attribute: 'number-of-pages', type: Number })
159
+ ], AtomicPager.prototype, "numberOfPages", void 0);
160
+ __decorate([
161
+ property({ reflect: true, attribute: 'previous-button-icon', type: String })
162
+ ], AtomicPager.prototype, "previousButtonIcon", void 0);
163
+ __decorate([
164
+ property({ reflect: true, attribute: 'next-button-icon', type: String })
165
+ ], AtomicPager.prototype, "nextButtonIcon", void 0);
166
+ __decorate([
167
+ bindingGuard(),
168
+ errorGuard()
169
+ ], AtomicPager.prototype, "render", null);
170
+ AtomicPager = __decorate([
171
+ customElement('atomic-pager'),
172
+ bindings(),
173
+ withTailwindStyles
174
+ ], AtomicPager);
175
+ export { AtomicPager };
@@ -1,4 +1,5 @@
1
1
  // Auto-generated file
2
+ export { AtomicPager } from './atomic-pager/atomic-pager.js';
2
3
  export { AtomicQuerySummary } from './atomic-query-summary/atomic-query-summary.js';
3
4
  export { AtomicResultsPerPage } from './atomic-results-per-page/atomic-results-per-page.js';
4
5
  export { AtomicSearchLayout } from './atomic-search-layout/atomic-search-layout.js';
@@ -1,5 +1,6 @@
1
1
  // Auto-generated file
2
2
  export default {
3
+ 'atomic-pager': async () => await import('./atomic-pager/atomic-pager.js'),
3
4
  'atomic-query-summary': async () => await import('./atomic-query-summary/atomic-query-summary.js'),
4
5
  'atomic-results-per-page': async () => await import('./atomic-results-per-page/atomic-results-per-page.js'),
5
6
  'atomic-search-layout': async () => await import('./atomic-search-layout/atomic-search-layout.js'),
@@ -3,7 +3,7 @@ function getWindow() {
3
3
  }
4
4
  export function getAtomicEnvironment(headlessVersion) {
5
5
  return {
6
- version: "3.33.8-pre.f71538d21f",
6
+ version: "3.33.8-pre.fbe332fd49",
7
7
  headlessVersion,
8
8
  };
9
9
  }
@@ -1 +1 @@
1
- {"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;;;;;;;;;;;SAYgB,cAAc,CAAoB,OAAgB;IAChE,OAAO,WAAW,CAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACnD;;MCHa,kBAAmB,SAAQ,KAAK;IAC3C,YAAY,WAAmB,EAAE,UAAkB;QACjD,KAAK,CACH,QAAQ,WAAW,sCAAsC,UAAU,YAAY,CAChF,CAAC;KACH;;;ACfH,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;SAIpC,gBAAgB,CAAI,OAAgB,EAAE,UAAkB;IACtE,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM;QACpC,MAAM,KAAK,GAAG,gBAAgB,CAC5B,oBAAoB,EACpB,CAAC,IAAO;YACN,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;SACtB,CACF,CAAC;QACF,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAE7B,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE;YACjC,MAAM,CACJ,IAAI,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,UAAU,CAAC,CACnE,CAAC;SACH;KACF,CAAC,CAAC;AACL;;ACoDA;;;;;;;;;;SAUgB,mBAAmB,CAAoB,OAAgB;IACrE,OAAO,gBAAgB,CAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACxD;;;;","names":[],"sources":["src/components/commerce/product-template-component-utils/stencil-product-template-decorators.tsx","src/components/common/item-list/context/item-context-controller.ts","src/components/common/item-list/fetch-item-context.ts","src/decorators/commerce/product-template-decorators.ts"],"sourcesContent":["import {Product} from '@coveo/headless/commerce';\nimport {itemContext} from '../../common/item-list/stencil-item-decorators';\n\n/**\n * Retrieves `Product` on a rendered `atomic-product`.\n *\n * This method is useful for building custom product template elements, see [Create a Product List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-product-template-component-example) for more information.\n *\n * You should use the method in the [connectedCallback lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).\n *\n * @param element - The element that the event is dispatched to, which must be the child of a rendered \"atomic-product\".\n * @returns A promise that resolves on initialization of the parent \"atomic-product\" element, or rejects when there is no parent \"atomic-product\" element.\n *\n * @deprecated should only be used for Stencil components. For Lit components, use `fetchProductContext` from \\@/src/decorators/commerce/product-template-decorators.ts\n */\nexport function productContext<T extends Product>(element: Element) {\n return itemContext<T>(element, 'atomic-product');\n}\n","import type {LitElement, ReactiveController, ReactiveControllerHost} from 'lit';\nimport type {InitializableComponent} from '@/src/decorators/types.js';\nimport {buildCustomEvent} from '@/src/utils/event-utils';\n\ntype LitElementWithError = Omit<\n Pick<InitializableComponent, 'error'>,\n 'error'\n> &\n LitElement & {\n error: Error | null;\n };\n\nconst itemContextEventName = 'atomic/resolveResult';\n\nexport class MissingParentError extends Error {\n constructor(elementName: string, parentName: string) {\n super(\n `The \"${elementName}\" element must be the child of an \"${parentName}\" element.`\n );\n }\n}\n\nfunction extractFolded<T = Record<string, unknown>>(\n item: Record<string, unknown>,\n returnFolded: boolean\n): T {\n if (returnFolded) {\n if ('children' in item) {\n return item as T;\n } else {\n return {children: [], result: item} as T;\n }\n }\n\n if ('children' in item && 'result' in item) {\n return item.result as T;\n }\n return item as T;\n}\n\n/**\n * A reactive controller that manages item context data from parent components.\n * Handles fetching item data via custom events and manages error states.\n */\nexport class ItemContextController<T = Record<string, unknown>>\n implements ReactiveController\n{\n private host: ReactiveControllerHost & LitElementWithError;\n private parentName: string;\n private folded: boolean;\n private _item: T | null = null;\n private _error: MissingParentError | null = null;\n\n constructor(\n host: ReactiveControllerHost & LitElementWithError,\n options: {parentName?: string; folded?: boolean} = {}\n ) {\n this.host = host;\n this.parentName = options.parentName ?? 'atomic-result';\n this.folded = options.folded ?? false;\n host.addController(this);\n }\n\n get item(): T | null {\n return this._error ? null : this._item;\n }\n\n get error(): MissingParentError | null {\n return this._error;\n }\n\n get hasError(): boolean {\n return this._error !== null;\n }\n\n hostConnected(): void {\n this._resolveItemContext();\n }\n\n private _resolveItemContext(): void {\n const event = buildCustomEvent(\n itemContextEventName,\n (item: Record<string, unknown>) => {\n this._item = extractFolded<T>(item, this.folded);\n this._error = null;\n this.host.error = null;\n this.host.requestUpdate();\n }\n );\n\n const canceled = this.host.dispatchEvent(event);\n if (canceled) {\n const elementName = (this.host as Element).nodeName.toLowerCase();\n this._error = new MissingParentError(elementName, this.parentName);\n this._item = null;\n this.host.error = this._error;\n this.host.requestUpdate();\n }\n }\n}\n\ntype ItemContextEventHandler<T> = (item: T) => void;\nexport type ItemContextEvent<T> = CustomEvent<ItemContextEventHandler<T>>;\n","import {closest} from '../../../utils/dom-utils.js';\nimport {buildCustomEvent} from '../../../utils/event-utils.js';\nimport {MissingParentError} from './context/item-context-controller.js';\n\nconst itemContextEventName = 'atomic/resolveResult';\n\ntype ItemContextEventHandler<T> = (item: T) => void;\n\nexport function fetchItemContext<T>(element: Element, parentName: string) {\n return new Promise<T>((resolve, reject) => {\n const event = buildCustomEvent<ItemContextEventHandler<T>>(\n itemContextEventName,\n (item: T) => {\n return resolve(item);\n }\n );\n element.dispatchEvent(event);\n\n if (!closest(element, parentName)) {\n reject(\n new MissingParentError(element.nodeName.toLowerCase(), parentName)\n );\n }\n });\n}\n","import type {InteractiveProduct, Product} from '@coveo/headless/commerce';\nimport type {LitElement} from 'lit';\nimport {\n InteractiveItemContextController,\n type InteractiveItemContextEvent,\n} from '@/src/components/common/item-list/context/interactive-item-context-controller';\nimport {\n ItemContextController,\n type ItemContextEvent,\n} from '@/src/components/common/item-list/context/item-context-controller';\nimport {fetchItemContext} from '@/src/components/common/item-list/fetch-item-context';\n\n/**\n * Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing product context in product template components.\n *\n * @param host - The Lit component instance\n * @param options - Configuration options\n * @returns ItemContextController instance configured for atomic-product\n *\n * @example\n * ```typescript\n * @customElement('my-product-component')\n * export class MyProductComponent extends LitElement {\n * private productController = createProductContextController(this);\n *\n * @state() product!: Product;\n *\n * render() {\n * this.product = this.productController.item;\n * return html`<div>${this.product?.ec_name}</div>`;\n * }\n * }\n * ```\n */\nexport function createProductContextController(\n host: LitElement & {error: Error | null},\n options: {folded?: boolean} = {}\n): ItemContextController<Product> {\n return new ItemContextController<Product>(host, {\n parentName: 'atomic-product',\n folded: options.folded ?? false,\n });\n}\n\n/**\n * Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing interactive product context in product template components.\n *\n * @param host - The Lit component instance\n * @returns InteractiveItemContextController instance\n *\n * @example\n * ```typescript\n * @customElement('my-interactive-product-component')\n * export class MyInteractiveProductComponent extends LitElement {\n * private interactiveProductController = createInteractiveProductContextController(this);\n *\n * @state() product!: Product;\n *\n * render() {\n * this.product = this.interactiveProductController.interactiveItem;\n * return html`<div>${this.product?.ec_name}</div>`;\n * }\n * }\n * ```\n */\nexport function createInteractiveProductContextController(\n host: LitElement & {error: Error}\n): InteractiveItemContextController<InteractiveProduct> {\n return new InteractiveItemContextController<InteractiveProduct>(host);\n}\n\nexport type ProductContextEvent<T = Product> = ItemContextEvent<T>;\nexport type InteractiveProductContextEvent<\n T extends InteractiveProduct = InteractiveProduct,\n> = InteractiveItemContextEvent<T>;\n\n/**\n * Retrieves `Product` on a rendered `atomic-product`.\n *\n * This utility function is useful for building custom product template elements, see [Create a Product List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-product-template-component-example) for more information.\n *\n * You should use the utility function in the [`connectedCallback` lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).\n *\n * @param element - The element that the event is dispatched to, which must be the child of a rendered `atomic-product`.\n * @returns A promise that resolves on initialization of the parent `atomic-product` element, or rejects when there is no parent `atomic-product` element.\n */\nexport function fetchProductContext<T extends Product>(element: Element) {\n return fetchItemContext<T>(element, 'atomic-product');\n}\n"],"version":3}
1
+ {"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA;;;;;;;;;;;;SAYgB,cAAc,CAAoB,OAAgB;IAChE,OAAO,WAAW,CAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACnD;;MCHa,kBAAmB,SAAQ,KAAK;IAC3C,YAAY,WAAmB,EAAE,UAAkB;QACjD,KAAK,CACH,QAAQ,WAAW,sCAAsC,UAAU,YAAY,CAChF,CAAC;KACH;;;ACfH,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;SAIpC,gBAAgB,CAAI,OAAgB,EAAE,UAAkB;IACtE,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM;QACpC,MAAM,KAAK,GAAG,gBAAgB,CAC5B,oBAAoB,EACpB,CAAC,IAAO;YACN,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC;SACtB,CACF,CAAC;QACF,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAE7B,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE;YACjC,MAAM,CACJ,IAAI,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,EAAE,UAAU,CAAC,CACnE,CAAC;SACH;KACF,CAAC,CAAC;AACL;;ACoDA;;;;;;;;;;SAUgB,mBAAmB,CAAoB,OAAgB;IACrE,OAAO,gBAAgB,CAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;AACxD;;;;","names":[],"sources":["src/components/commerce/product-template-component-utils/stencil-product-template-decorators.tsx","src/components/common/item-list/context/item-context-controller.ts","src/components/common/item-list/fetch-item-context.ts","src/decorators/commerce/product-template-decorators.ts"],"sourcesContent":["import {Product} from '@coveo/headless/commerce';\nimport {itemContext} from '../../common/item-list/stencil-item-decorators';\n\n/**\n * Retrieves `Product` on a rendered `atomic-product`.\n *\n * This method is useful for building custom product template elements, see [Create a Product List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-product-template-component-example) for more information.\n *\n * You should use the method in the [connectedCallback lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).\n *\n * @param element - The element that the event is dispatched to, which must be the child of a rendered \"atomic-product\".\n * @returns A promise that resolves on initialization of the parent \"atomic-product\" element, or rejects when there is no parent \"atomic-product\" element.\n *\n * @deprecated should only be used for Stencil components. For Lit components, use `fetchProductContext` from \\@/src/decorators/commerce/product-template-decorators.ts\n */\nexport function productContext<T extends Product>(element: Element) {\n return itemContext<T>(element, 'atomic-product');\n}\n","import type {LitElement, ReactiveController, ReactiveControllerHost} from 'lit';\nimport type {InitializableComponent} from '@/src/decorators/types.js';\nimport {buildCustomEvent} from '@/src/utils/event-utils';\n\ntype LitElementWithError = Omit<\n Pick<InitializableComponent, 'error'>,\n 'error'\n> &\n LitElement & {\n error: Error | null;\n };\n\nconst itemContextEventName = 'atomic/resolveResult';\n\nexport class MissingParentError extends Error {\n constructor(elementName: string, parentName: string) {\n super(\n `The \"${elementName}\" element must be the child of an \"${parentName}\" element.`\n );\n }\n}\n\nfunction extractFolded<T = Record<string, unknown>>(\n item: Record<string, unknown>,\n returnFolded: boolean\n): T {\n if (returnFolded) {\n if ('children' in item) {\n return item as T;\n } else {\n return {children: [], result: item} as T;\n }\n }\n\n if ('children' in item && 'result' in item) {\n return item.result as T;\n }\n return item as T;\n}\n\n/**\n * A reactive controller that manages item context data from parent components.\n * Handles fetching item data via custom events and manages error states.\n */\nexport class ItemContextController<T = Record<string, unknown>>\n implements ReactiveController\n{\n private host: ReactiveControllerHost & LitElementWithError;\n private parentName: string;\n private folded: boolean;\n private _item: T | null = null;\n private _error: MissingParentError | null = null;\n\n constructor(\n host: ReactiveControllerHost & LitElementWithError,\n options: {parentName?: string; folded?: boolean} = {}\n ) {\n this.host = host;\n this.parentName = options.parentName ?? 'atomic-result';\n this.folded = options.folded ?? false;\n host.addController(this);\n }\n\n get item(): T | null {\n return this._error ? null : this._item;\n }\n\n get error(): MissingParentError | null {\n return this._error;\n }\n\n get hasError(): boolean {\n return this._error !== null;\n }\n\n hostConnected(): void {\n this._resolveItemContext();\n }\n\n private _resolveItemContext(): void {\n const event = buildCustomEvent(\n itemContextEventName,\n (item: Record<string, unknown>) => {\n this._item = extractFolded<T>(item, this.folded);\n this._error = null;\n this.host.error = null;\n this.host.requestUpdate();\n }\n );\n\n const canceled = this.host.dispatchEvent(event);\n if (canceled) {\n const elementName = (this.host as Element).nodeName.toLowerCase();\n this._error = new MissingParentError(elementName, this.parentName);\n this._item = null;\n this.host.error = this._error;\n this.host.requestUpdate();\n }\n }\n}\n\ntype ItemContextEventHandler<T> = (item: T) => void;\nexport type ItemContextEvent<T> = CustomEvent<ItemContextEventHandler<T>>;\n","import {closest} from '../../../utils/dom-utils.js';\nimport {buildCustomEvent} from '../../../utils/event-utils.js';\nimport {MissingParentError} from './context/item-context-controller.js';\n\nconst itemContextEventName = 'atomic/resolveResult';\n\ntype ItemContextEventHandler<T> = (item: T) => void;\n\nexport function fetchItemContext<T>(element: Element, parentName: string) {\n return new Promise<T>((resolve, reject) => {\n const event = buildCustomEvent<ItemContextEventHandler<T>>(\n itemContextEventName,\n (item: T) => {\n return resolve(item);\n }\n );\n element.dispatchEvent(event);\n\n if (!closest(element, parentName)) {\n reject(\n new MissingParentError(element.nodeName.toLowerCase(), parentName)\n );\n }\n });\n}\n","import type {InteractiveProduct, Product} from '@coveo/headless/commerce';\nimport type {LitElement} from 'lit';\nimport {\n InteractiveItemContextController,\n type InteractiveItemContextEvent,\n} from '@/src/components/common/item-list/context/interactive-item-context-controller';\nimport {\n ItemContextController,\n type ItemContextEvent,\n} from '@/src/components/common/item-list/context/item-context-controller';\nimport {fetchItemContext} from '@/src/components/common/item-list/fetch-item-context';\n\n/**\n * Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing product context in product template components.\n *\n * @param host - The Lit component instance\n * @param options - Configuration options\n * @returns ItemContextController instance configured for atomic-product\n *\n * @example\n * ```typescript\n * @customElement('my-product-component')\n * export class MyProductComponent extends LitElement {\n * private productController = createProductContextController(this);\n *\n * @state() product!: Product;\n *\n * render() {\n * this.product = this.productController.item;\n * return html`<div>${this.product?.ec_name}</div>`;\n * }\n * }\n * ```\n */\nexport function createProductContextController(\n host: LitElement & {error: Error | null},\n options: {folded?: boolean} = {}\n): ItemContextController<Product> {\n return new ItemContextController<Product>(host, {\n parentName: 'atomic-product',\n folded: options.folded ?? false,\n });\n}\n\n/**\n * Creates a [Lit reactive controller](https://lit.dev/docs/composition/controllers/) for managing interactive product context in product template components.\n *\n * @param host - The Lit component instance\n * @returns InteractiveItemContextController instance\n *\n * @example\n * ```typescript\n * @customElement('my-interactive-product-component')\n * export class MyInteractiveProductComponent extends LitElement {\n * private interactiveProductController = createInteractiveProductContextController(this);\n *\n * @state() product!: Product;\n *\n * render() {\n * this.product = this.interactiveProductController.interactiveItem;\n * return html`<div>${this.product?.ec_name}</div>`;\n * }\n * }\n * ```\n */\nexport function createInteractiveProductContextController(\n host: LitElement & {error: Error}\n): InteractiveItemContextController<InteractiveProduct> {\n return new InteractiveItemContextController<InteractiveProduct>(host);\n}\n\nexport type ProductContextEvent<T = Product> = ItemContextEvent<T>;\nexport type InteractiveProductContextEvent<\n T extends InteractiveProduct = InteractiveProduct,\n> = InteractiveItemContextEvent<T>;\n\n/**\n * Retrieves `Product` on a rendered `atomic-product`.\n *\n * This utility function is useful for building custom product template elements, see [Create a Product List](https://docs.coveo.com/en/atomic/latest/cc-search/create-custom-components/native-components/#custom-product-template-component-example) for more information.\n *\n * You should use the utility function in the [`connectedCallback` lifecycle method](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements#using_the_lifecycle_callbacks).\n *\n * @param element - The element that the event is dispatched to, which must be the child of a rendered `atomic-product`.\n * @returns A promise that resolves on initialization of the parent `atomic-product` element, or rejects when there is no parent `atomic-product` element.\n */\nexport function fetchProductContext<T extends Product>(element: Element) {\n return fetchItemContext<T>(element, 'atomic-product');\n}\n"],"version":3}