1import { l as e, o as t } from "./commerce.indexBu0Q3kxk.js"; 2import { a as n, i as r, n as i, o as a, p as o, r as s, u as c } from "./decoratorsDgvFPsqQ.js"; 3import { t as l } from "./whenDHlaxSuD.js"; 4import { t as u } from "./buttonCbp3zP8q.js"; 5import { t as d } from "./bind-stateHBIU0rdL.js"; 6import { t as f } from "./binding-guardBYpyFCsg.js"; 7import { t as p } from "./bindingsC1qzP6-H.js"; 8import { t as m } from "./with-tailwind-stylesCLrXF-GP.js"; 9import { t as h } from "./error-guardDZkUaSL0.js"; 10import "./atomic-iconCiY76ZLO.js"; 11import { t as g } from "./watchCHHkNWKb.js"; 12import { t as _ } from "./boolean-converterCVisy--O.js"; 13import { t as v } from "./localized-stringCyKvkQd-.js"; 14import "./atomic-modalC-sf6u3l.js"; 15import { n as y, t as b } from "./optionCfniy3o7.js"; 16//#region node_modules/@coveo/atomic/dist/atomic/components/components/common/refine-modal/body.js 17var x = () => (e) => c` 18 <aside 19 part="content" 20 slot="body" 21 class="flex w-full flex-col" 22 > 23 ${e} 24 </aside> 25 `, S = ({ props: e }) => (t) => c` 26 <div part="filter-section" class="mt-8 mb-3 flex w-full justify-between"> 27 <h2 28 part="section-title section-filters-title" 29 class="truncate text-2xl font-bold" 30 > 31 ${e.i18n.t("filters")} 32 </h2> 33 ${t} 34 </div> 35 ${l(e.withFacets, () => c`<slot name="facets"></slot>`)} 36 ${l(e.withAutomaticFacets, () => c`<slot name="automatic-facets"></slot>`)} 37 `, C = ({ props: e }) => c`${u({ props: { 38 onClick: e.onClick, 39 style: "text-primary", 40 text: e.i18n.t("clear"), 41 class: "px-2 py-1", 42 part: "filter-clear-all" 43} })(a)}`, w = "backdrop,container,header-wrapper,header,header-ruler,body-wrapper,body,footer-wrapper,footer", T = "<svg viewBox=\"0 0 22 22\"><g transform=\"matrix(.7071 -.7071 .7071 .7071 -3.142 11)\"><path d=\"m9-3.4h2v26.9h-2z\"/><path d=\"m-3.4 9h26.9v2h-26.9z\"/></g></svg>", E = ({ props: e }) => (t) => { 44 let n = () => { 45 e.host.querySelector("div[slot=\"facets\"]")?.remove(); 46 }; 47 return c` 48 <atomic-modal 49 .fullscreen=${!0} 50 .isOpen=${e.isOpen} 51 .source=${e.openButton} 52 .container=${e.host} 53 .close=${e.onClose} 54 .onAnimationEnded=${() => { 55 e.isOpen || n(); 56 }} 57 exportparts=${w} 58 .boundary=${e.boundary ?? "page"} 59 .scope=${e.scope} 60 > 61 ${c` 62 <div slot="header" class="contents"> 63 <h1 part="title" class="truncate">${e.title}</h1> 64 ${u({ props: { 65 style: "text-transparent", 66 class: "grid place-items-center", 67 part: "close-button", 68 onClick: e.onClose, 69 ariaLabel: e.i18n.t("close") 70 } })(c`<atomic-icon 71 part="close-icon" 72 class="h-5 w-5" 73 icon=${T} 74 ></atomic-icon>`)} 75 </div> 76 `} ${t} ${c` 77 <div part="footer-content" slot="footer"> 78 ${u({ props: { 79 style: "primary", 80 part: "footer-button", 81 class: "flex w-full justify-center p-3 text-lg", 82 onClick: e.onClose 83 } })(c` 84 <span part="footer-button-text" class="mr-1 truncate"> 85 ${e.i18n.t(e.i18nFooterButtonTextKey)} 86 </span> 87 <span part="footer-button-count"> 88 ${v({ 89 i18n: e.i18n, 90 key: "between-parentheses", 91 params: { text: e.numberOfItems.toLocaleString(e.i18n.language) } 92 })} 93 </span> 94 `)} 95 </div> 96 `} 97 </atomic-modal> 98 `; 99}, D = "<svg viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M7.5 6L7.5 17\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M11 14L7.5 18L4 14\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M16.5 18L16.5 6\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M13 10L16.5 6L20 10\" stroke=\"currentColor\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n</svg>", O = ({ props: e }) => (t) => c` 100 <h2 101 part="section-title section-sort-title" 102 class="mb-3 truncate text-2xl font-bold" 103 > 104 ${e.i18n.t("sort")} 105 </h2> 106 <div part="select-wrapper" class="relative"> 107 <select 108 class="btn-outline-neutral peer w-full grow cursor-pointer appearance-none rounded-lg px-6 py-5 text-lg font-bold" 109 part="select" 110 aria-label=${e.i18n.t("sort-by")} 111 @change=${e.onSelect} 112 > 113 ${t} 114 </select> 115 <div 116 part="select-icon-wrapper" 117 class="peer-hover:text-primary-light peer-focus-within:text-primary-light pointer-events-none absolute top-0 right-0 bottom-0 flex items-center justify-center pr-6" 118 > 119 <atomic-icon 120 part="select-icon" 121 icon=${D} 122 class="h-6 w-6" 123 ></atomic-icon> 124 </div> 125 </div> 126 `, k = function(e, t, n, r) { 127 var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o; 128 if (typeof Reflect == "object" && typeof Reflect.decorate == "function") a = Reflect.decorate(e, t, n, r); 129 else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a); 130 return i > 3 && a && Object.defineProperty(t, n, a), a; 131}, A = class extends n { 132 constructor() { 133 super(...arguments), this.isOpen = !1, this.collapseFacetsAfter = 0, this.onSelectSortOption = (e) => { 134 let t = e.composedPath()[0]; 135 this.sort.sortBy(b(t.value, this.sortState.availableSorts)); 136 }; 137 } 138 initialize() { 139 let n = this.bindings.interfaceElement.type === "search" ? t(this.bindings.engine) : e(this.bindings.engine); 140 this.summary = n.summary(), this.sort = n.sort(), this.facetGenerator = n.facetGenerator(), this.breadcrumbManager = n.breadcrumbManager(), this.watchEnabled(); 141 } 142 watchEnabled() { 143 if (this.isOpen) { 144 if (this.querySelector("div[slot=\"facets\"]")) return; 145 this.appendChild(this.createFacetSlot()); 146 } 147 } 148 createFacetSlot() { 149 let e = document.createElement("div"); 150 e.setAttribute("slot", "facets"); 151 let t = document.createElement("atomic-commerce-facets"); 152 return t.style.display = "flex", t.style.flexDirection = "column", t.style.gap = "var(--atomic-refine-modal-facet-margin, 20px)", t.collapseFacetsAfter = this.collapseFacetsAfter, e.append(t), e; 153 }
154 renderSort() { 155 return O({ props: { 156 i18n: this.bindings.i18n, 157 onSelect: this.onSelectSortOption 158 } })(c`${this.sortState.availableSorts.map((e) => y({ props: { 159 i18n: this.bindings.i18n, 160 selected: this.sort.isSortedBy(e), 161 sort: e 162 } }))}`); 163 } 164 renderFilters() { 165 if (this.facetGeneratorState.length === 0) return; 166 let { i18n: e } = this.bindings; 167 return S({ props: { 168 i18n: e, 169 withFacets: !0, 170 withAutomaticFacets: !1 171 } })(this.breadcrumbManagerState.hasBreadcrumbs ? C({ props: { 172 i18n: e, 173 onClick: () => this.breadcrumbManager.deselectAll() 174 } }) : a); 175 } 176 render() { 177 return c`${E({ props: { 178 i18n: this.bindings.i18n, 179 i18nFooterButtonTextKey: "view-products", 180 host: this, 181 isOpen: this.isOpen, 182 onClose: () => { 183 this.isOpen = !1; 184 }, 185 title: this.bindings.i18n.t("sort-and-filter"), 186 numberOfItems: this.summaryState.totalNumberOfProducts, 187 openButton: this.openButton 188 } })(x()(c` 189 ${this.renderSort()} ${this.renderFilters()} 190 `))}`; 191 } 192}; 193A.styles = [o`:host{position:absolute}`], k([i()], A.prototype, "bindings", void 0), k([i()], A.prototype, "error", void 0), k([s({ 194 attribute: "open-button", 195 type: Object 196})], A.prototype, "openButton", void 0), k([s({ 197 type: Boolean, 198 converter: _, 199 reflect: !0, 200 attribute: "is-open" 201})], A.prototype, "isOpen", void 0), k([s({ 202 type: Number, 203 reflect: !0, 204 attribute: "collapse-facets-after" 205})], A.prototype, "collapseFacetsAfter", void 0), k([d("summary"), i()], A.prototype, "summaryState", void 0), k([d("sort"), i()], A.prototype, "sortState", void 0), k([d("facetGenerator"), i()], A.prototype, "facetGeneratorState", void 0), k([d("breadcrumbManager"), i()], A.prototype, "breadcrumbManagerState", void 0), k([g("isOpen")], A.prototype, "watchEnabled", null), k([f(), h()], A.prototype, "render", null), A = k([ 206 r("atomic-commerce-refine-modal"), 207 p(), 208 m 209], A); 210//#endregion 211export { A as AtomicCommerceRefineModal };
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.