@askdialog/dialog-vue 3.10.0 → 3.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,33 +1,33 @@
1
- var Ee = Object.defineProperty;
2
- var ye = (t, e, s) => e in t ? Ee(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
3
- var z = (t, e, s) => ye(t, typeof e != "symbol" ? e + "" : e, s);
4
- import { defineComponent as I, createElementBlock as _, openBlock as u, toDisplayString as y, unref as H, createElementVNode as l, Fragment as N, renderList as W, createVNode as T, createBlock as P, ref as R, computed as b, withDirectives as ie, withKeys as Ie, vModelText as ae, onMounted as K, watch as M, renderSlot as we, withCtx as le, withModifiers as $e, createCommentVNode as L, resolveDynamicComponent as ke, mergeProps as Te, toHandlers as Re, createTextVNode as ce, onUnmounted as de, Teleport as Ae, normalizeStyle as Le, normalizeClass as Z, shallowRef as xe } from "vue";
5
- const De = /* @__PURE__ */ new Set(["ar", "he", "iw", "fa", "ur"]), Pe = (t) => t !== void 0 && De.has(t.trim().toLowerCase().slice(0, 2)), Oe = (t) => Pe(t) ? "rtl" : "ltr";
6
- var q;
1
+ var $e = Object.defineProperty;
2
+ var ke = (t, e, s) => e in t ? $e(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
3
+ var j = (t, e, s) => ke(t, typeof e != "symbol" ? e + "" : e, s);
4
+ import { defineComponent as w, createElementBlock as p, openBlock as u, toDisplayString as E, unref as B, createElementVNode as l, Fragment as M, renderList as Y, createVNode as R, createBlock as N, ref as A, computed as f, withDirectives as ce, withKeys as Te, vModelText as ue, onMounted as z, watch as U, renderSlot as Re, withCtx as de, withModifiers as Ae, createCommentVNode as x, resolveDynamicComponent as Le, mergeProps as xe, toHandlers as De, createTextVNode as Z, onUnmounted as pe, Teleport as Pe, normalizeStyle as Oe, normalizeClass as te, shallowRef as Ne } from "vue";
5
+ const qe = /* @__PURE__ */ new Set(["ar", "he", "iw", "fa", "ur"]), Me = (t) => t !== void 0 && qe.has(t.trim().toLowerCase().slice(0, 2)), He = (t) => Me(t) ? "rtl" : "ltr";
6
+ var H;
7
7
  (function(t) {
8
8
  t.OPEN_ASSISTANT = "open_assistant", t.OPEN_WITH_SUGGESTIONS = "OPEN_WITH_SUGGESTIONS", t.CLOSE_ASSISTANT = "close_assistant", t.SEND_MESSAGE = "PRODUCT_QUESTION", t.SEND_GENERIC_QUESTION = "GENERIC_QUESTION", t.TRACK_ADD_TO_CART = "TRACK_ADD_TO_CART", t.TRACK_SUBMIT_CHECKOUT = "TRACK_SUBMIT_CHECKOUT", t.TRACK_VIEW_SEARCH_RESULTS = "TRACK_VIEW_SEARCH_RESULTS", t.TRACK_SELECT_SEARCH_RESULT = "TRACK_SELECT_SEARCH_RESULT";
9
- })(q || (q = {}));
10
- var J;
9
+ })(H || (H = {}));
10
+ var se;
11
11
  (function(t) {
12
12
  t.USER_OPENED_ASSISTANT = "userOpenedAssistant", t.USER_CLOSED_ASSISTANT = "userClosedAssistant", t.USER_SENT_MESSAGE = "userSentMessage", t.USER_CLICKED_ON_PRODUCT_CARD = "userClickedOnProductCard", t.USER_OPENED_RECOMMENDATION = "userOpenedRecommendation", t.USER_ADDED_TO_CART = "userAddedToCart", t.USER_SEND_POSITIVE_FEEDBACK = "userSendPositiveFeedback", t.USER_SEND_NEGATIVE_FEEDBACK = "userSendNegativeFeedback";
13
- })(J || (J = {}));
14
- q.TRACK_ADD_TO_CART, q.TRACK_SUBMIT_CHECKOUT, q.TRACK_VIEW_SEARCH_RESULTS, q.TRACK_SELECT_SEARCH_RESULT;
15
- class Ne extends Error {
13
+ })(se || (se = {}));
14
+ H.TRACK_ADD_TO_CART, H.TRACK_SUBMIT_CHECKOUT, H.TRACK_VIEW_SEARCH_RESULTS, H.TRACK_SELECT_SEARCH_RESULT;
15
+ class Ue extends Error {
16
16
  constructor({ status: s, code: o, message: r }) {
17
17
  super(r);
18
- z(this, "status");
19
- z(this, "code");
18
+ j(this, "status");
19
+ j(this, "code");
20
20
  this.name = "DialogSearchError", this.status = s, this.code = o;
21
21
  }
22
22
  }
23
- const X = (t, e, s) => {
23
+ const J = (t, e, s) => {
24
24
  if (!/^[a-z]{2}$/.test(e))
25
25
  throw new Error("Search language must be a lowercase ISO 639-1 code.");
26
26
  if (!/^[A-Za-z]{2}$/.test(s))
27
27
  throw new Error("Search country must be an ISO 3166-1 alpha-2 code.");
28
28
  return `${t}_${e}_${s.toLowerCase()}`;
29
- }, ee = "multiple installation methods detected:", qe = () => typeof window > "u" ? void 0 : window, ue = () => {
30
- const t = qe();
29
+ }, oe = "multiple installation methods detected:", Ve = () => typeof window > "u" ? void 0 : window, he = () => {
30
+ const t = Ve();
31
31
  if (t !== void 0)
32
32
  return t.dialog = t.dialog ?? {}, t.dialog.audit = t.dialog.audit ?? {
33
33
  methods: [],
@@ -35,101 +35,101 @@ const X = (t, e, s) => {
35
35
  capabilities: [],
36
36
  warnings: []
37
37
  }, t.dialog.audit;
38
- }, Me = (t) => {
39
- if (t.warnings = t.warnings.filter((e) => !e.startsWith(ee)), t.methods.length >= 2) {
38
+ }, Be = (t) => {
39
+ if (t.warnings = t.warnings.filter((e) => !e.startsWith(oe)), t.methods.length >= 2) {
40
40
  const e = t.methods.map((s) => s.method).join(", ");
41
- t.warnings.push(`${ee} ${e}`);
41
+ t.warnings.push(`${oe} ${e}`);
42
42
  }
43
- }, Ue = (t, e) => e === void 0 ? t : {
43
+ }, Ke = (t, e) => e === void 0 ? t : {
44
44
  version: (t == null ? void 0 : t.version) ?? e.version,
45
45
  commit: (t == null ? void 0 : t.commit) ?? e.commit
46
- }, pe = (t) => {
47
- const e = ue();
46
+ }, _e = (t) => {
47
+ const e = he();
48
48
  if (e === void 0)
49
49
  return;
50
50
  const s = e.methods.find((o) => o.method === t.method);
51
51
  if (s === void 0) {
52
- e.methods.push({ ...t, registeredAt: (/* @__PURE__ */ new Date()).toISOString() }), Me(e);
52
+ e.methods.push({ ...t, registeredAt: (/* @__PURE__ */ new Date()).toISOString() }), Be(e);
53
53
  return;
54
54
  }
55
- s.version = s.version ?? t.version, s.build = Ue(s.build, t.build), s.source = s.source ?? t.source;
56
- }, He = (t) => {
57
- const e = ue();
55
+ s.version = s.version ?? t.version, s.build = Ke(s.build, t.build), s.source = s.source ?? t.source;
56
+ }, Fe = (t) => {
57
+ const e = he();
58
58
  e !== void 0 && (e.capabilities.includes(t) || e.capabilities.push(t));
59
- }, A = {
59
+ }, D = {
60
60
  IDLE: "idle",
61
61
  LOADING: "loading",
62
62
  SUCCESS: "success",
63
63
  /** Successful request with zero hits. */
64
64
  EMPTY: "empty",
65
65
  ERROR: "error"
66
- }, Ve = 0.5, Be = 500, Ke = 1500, Fe = 100;
67
- function ze({ emit: t, visibilityThreshold: e = Ve, dwellMs: s = Be, idleFlushMs: o = Ke, maxItemsPerEvent: r = Fe }) {
66
+ }, ze = 0.5, Ge = 500, je = 1500, Qe = 100;
67
+ function We({ emit: t, visibilityThreshold: e = ze, dwellMs: s = Ge, idleFlushMs: o = je, maxItemsPerEvent: r = Qe }) {
68
68
  let n, a = [];
69
- const i = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map();
70
- let C;
71
- const d = () => {
72
- clearTimeout(C), !(n === void 0 || a.length === 0) && (t({ ...n, items: a }), a = []);
73
- }, f = (S) => {
69
+ const i = /* @__PURE__ */ new Set(), _ = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
70
+ let h;
71
+ const c = () => {
72
+ clearTimeout(h), !(n === void 0 || a.length === 0) && (t({ ...n, items: a }), a = []);
73
+ }, g = (m) => {
74
74
  if (n === void 0)
75
75
  return;
76
- const m = `${n.query_id}:${S.product_id}`;
77
- if (!i.has(m)) {
78
- if (i.add(m), a.push(S), a.length >= r) {
79
- d();
76
+ const C = `${n.query_id}:${m.product_id}`;
77
+ if (!i.has(C)) {
78
+ if (i.add(C), a.push(m), a.length >= r) {
79
+ c();
80
80
  return;
81
81
  }
82
- clearTimeout(C), C = setTimeout(d, o);
82
+ clearTimeout(h), h = setTimeout(c, o);
83
83
  }
84
- }, v = (S) => {
85
- const m = c.get(S);
86
- m !== void 0 && (clearTimeout(m), c.delete(S));
87
- }, g = new IntersectionObserver((S) => {
88
- for (const m of S) {
89
- const h = p.get(m.target);
90
- h !== void 0 && (m.intersectionRatio >= e ? c.has(m.target) || c.set(m.target, setTimeout(() => {
91
- c.delete(m.target), f(h);
92
- }, s)) : v(m.target));
84
+ }, S = (m) => {
85
+ const C = d.get(m);
86
+ C !== void 0 && (clearTimeout(C), d.delete(m));
87
+ }, v = new IntersectionObserver((m) => {
88
+ for (const C of m) {
89
+ const y = _.get(C.target);
90
+ y !== void 0 && (C.intersectionRatio >= e ? d.has(C.target) || d.set(C.target, setTimeout(() => {
91
+ d.delete(C.target), g(y);
92
+ }, s)) : S(C.target));
93
93
  }
94
- }, { threshold: e }), w = () => {
95
- g.disconnect();
96
- for (const S of c.values())
97
- clearTimeout(S);
98
- c.clear(), p.clear();
99
- }, $ = () => {
100
- d();
101
- }, k = (S) => {
102
- if (S.persisted) {
94
+ }, { threshold: e }), $ = () => {
95
+ v.disconnect();
96
+ for (const m of d.values())
97
+ clearTimeout(m);
98
+ d.clear(), _.clear();
99
+ }, k = () => {
100
+ c();
101
+ }, T = (m) => {
102
+ if (m.persisted) {
103
103
  i.clear();
104
- for (const m of p.keys())
105
- v(m), g.unobserve(m), g.observe(m);
104
+ for (const C of _.keys())
105
+ S(C), v.unobserve(C), v.observe(C);
106
106
  }
107
107
  };
108
- return window.addEventListener("pagehide", $), window.addEventListener("pageshow", k), {
109
- setContext(S) {
110
- d(), i.clear(), n = S, w();
108
+ return window.addEventListener("pagehide", k), window.addEventListener("pageshow", T), {
109
+ setContext(m) {
110
+ c(), i.clear(), n = m, $();
111
111
  },
112
- observe(S, m) {
113
- p.set(S, m), g.observe(S);
112
+ observe(m, C) {
113
+ _.set(m, C), v.observe(m);
114
114
  },
115
- forceImpression(S) {
116
- f(S), d();
115
+ forceImpression(m) {
116
+ g(m), c();
117
117
  },
118
- flush: d,
118
+ flush: c,
119
119
  disconnect() {
120
- d(), w(), window.removeEventListener("pagehide", $), window.removeEventListener("pageshow", k);
120
+ c(), $(), window.removeEventListener("pagehide", k), window.removeEventListener("pageshow", T);
121
121
  }
122
122
  };
123
123
  }
124
- const te = (t, e) => ({
124
+ const ne = (t, e) => ({
125
125
  // `objectID` is the variant id; analytics count products.
126
126
  product_id: String(t.hits[e].id),
127
127
  // One-based position across all pages.
128
128
  position: t.page * t.hitsPerPage + e + 1
129
129
  });
130
- function Ge(t) {
130
+ function Xe(t) {
131
131
  let e, s;
132
- const o = () => (e ?? (e = ze({
132
+ const o = () => (e ?? (e = We({
133
133
  emit: t.trackViewSearchResults
134
134
  })), e);
135
135
  return {
@@ -146,12 +146,12 @@ function Ge(t) {
146
146
  }, o().setContext(s), r.nbHits === 0 && t.trackViewSearchResults({ ...s, items: [] });
147
147
  },
148
148
  observeResult(r, n, a) {
149
- o().observe(r, te(n, a));
149
+ o().observe(r, ne(n, a));
150
150
  },
151
151
  select(r, n) {
152
152
  if (s === void 0)
153
153
  return;
154
- const a = te(r, n);
154
+ const a = ne(r, n);
155
155
  o().forceImpression(a), t.trackSelectSearchResult({ ...s, items: [a] });
156
156
  },
157
157
  dispose() {
@@ -159,142 +159,154 @@ function Ge(t) {
159
159
  }
160
160
  };
161
161
  }
162
- const je = 2, se = (t) => {
162
+ const Q = {
163
+ status: D.IDLE,
164
+ query: "",
165
+ page: 0,
166
+ response: void 0,
167
+ sections: void 0,
168
+ error: void 0
169
+ }, Ye = 2, re = (t) => {
163
170
  const e = t.trim();
164
- return [...e].length >= je ? e : void 0;
165
- }, Qe = (t, e, s, { indexName: o, language: r, country: n, hitsPerPage: a }) => ({
171
+ return [...e].length >= Ye ? e : void 0;
172
+ }, Ze = (t, e, s, { indexName: o, language: r, country: n, hitsPerPage: a }) => ({
166
173
  requests: [
167
174
  { indexName: o, query: t, page: e, hitsPerPage: a },
168
175
  ...s.map((i) => ({
169
- indexName: X(i.index, r, n),
176
+ indexName: J(i.index, r, n),
170
177
  query: t,
171
178
  page: 0,
172
179
  hitsPerPage: i.hitsPerPage ?? a
173
180
  }))
174
181
  ]
175
- }), We = (t, e, { indexName: s, language: o, country: r }) => {
182
+ }), Je = (t, e, { indexName: s, language: o, country: r }) => {
176
183
  const n = t.results.find((i) => i.index === s);
177
184
  if (n === void 0)
178
185
  throw new Error(`Dialog search returned no ${s} entry`);
179
186
  const a = {};
180
187
  for (const i of e) {
181
- const p = X(i.index, o, r), c = t.results.find((C) => C.index === p);
182
- c !== void 0 && (a[i.index] = c);
188
+ const _ = J(i.index, o, r), d = t.results.find((h) => h.index === _);
189
+ d !== void 0 && (a[i.index] = d);
183
190
  }
184
191
  return {
185
- // The products index answers product records only.
192
+ // Each index answers its own record type.
186
193
  response: n,
187
194
  sections: e.length === 0 ? void 0 : a
188
195
  };
189
- }, G = {
190
- status: A.IDLE,
191
- query: "",
192
- page: 0,
193
- response: void 0,
194
- sections: void 0,
195
- error: void 0
196
196
  };
197
- function Xe({ search: t, language: e, country: s, analytics: o, navigate: r, debounceMs: n = 250, hitsPerPage: a = 12, sections: i = [] }) {
198
- const p = {
199
- indexName: X("products", e, s),
197
+ function et({ search: t, language: e, country: s, analytics: o, navigate: r, buildProductUrl: n, debounceMs: a = 250, hitsPerPage: i = 12, sections: _ = [] }) {
198
+ const d = {
199
+ indexName: J("products", e, s),
200
200
  language: e,
201
201
  country: s,
202
- hitsPerPage: a
202
+ hitsPerPage: i
203
203
  };
204
- let c = G;
205
- const C = /* @__PURE__ */ new Set(), d = Ge(o);
206
- let f, v, g, w = 0, $ = !1;
207
- const k = (h) => {
208
- c = { ...c, ...h };
209
- for (const E of C)
210
- E(c);
211
- }, S = () => {
212
- clearTimeout(f), v = void 0, w += 1, g == null || g.abort(), g = void 0;
213
- }, m = async (h, E) => {
214
- S(), g = new AbortController();
215
- const O = w;
216
- k({ status: A.LOADING, query: h, page: E });
204
+ let h = Q;
205
+ const c = /* @__PURE__ */ new Set(), g = Xe(o);
206
+ let S, v, $, k = 0, T = !1;
207
+ const m = (b) => {
208
+ h = { ...h, ...b };
209
+ for (const I of c)
210
+ I(h);
211
+ }, C = (b) => b.url !== void 0 && b.url !== "" ? b.url : n == null ? void 0 : n(b), y = () => {
212
+ clearTimeout(S), v = void 0, k += 1, $ == null || $.abort(), $ = void 0;
213
+ }, L = async (b, I) => {
214
+ y(), $ = new AbortController();
215
+ const q = k;
216
+ m({ status: D.LOADING, query: b, page: I });
217
217
  try {
218
- const D = typeof i == "function" ? i() : i, Y = Qe(h, E, D, p), Ce = await t(Y, {
219
- signal: g.signal
218
+ const O = typeof _ == "function" ? _() : _, ee = Ze(b, I, O, d), we = await t(ee, {
219
+ signal: $.signal
220
220
  });
221
- if (O !== w)
221
+ if (q !== k)
222
222
  return;
223
- const F = We(Ce, D, p);
224
- d.onResponse(F.response), k({
225
- ...F,
226
- status: F.response.nbHits === 0 ? A.EMPTY : A.SUCCESS,
223
+ const G = Je(we, O, d);
224
+ g.onResponse(G.response), m({
225
+ ...G,
226
+ status: G.response.nbHits === 0 ? D.EMPTY : D.SUCCESS,
227
227
  error: void 0
228
228
  });
229
- } catch (D) {
230
- if (D instanceof DOMException && D.name === "AbortError" || O !== w)
229
+ } catch (O) {
230
+ if (O instanceof DOMException && O.name === "AbortError" || q !== k)
231
231
  return;
232
- k({
233
- status: A.ERROR,
234
- error: D,
232
+ m({
233
+ status: D.ERROR,
234
+ error: O,
235
235
  response: void 0,
236
236
  sections: void 0
237
237
  });
238
238
  }
239
239
  };
240
240
  return {
241
- setQuery(h) {
242
- if ($)
241
+ setQuery(b) {
242
+ if (T)
243
243
  return;
244
- S();
245
- const E = se(h);
246
- if (E === void 0) {
247
- k(G);
244
+ y();
245
+ const I = re(b);
246
+ if (I === void 0) {
247
+ m(Q);
248
248
  return;
249
249
  }
250
- v = E, f = setTimeout(() => void m(E, 0), n);
250
+ v = I, S = setTimeout(() => void L(I, 0), a);
251
251
  },
252
- submit(h) {
253
- if ($)
252
+ submit(b) {
253
+ if (T)
254
254
  return;
255
- S();
256
- const E = se(h);
257
- if (E === void 0) {
258
- k(G);
255
+ y();
256
+ const I = re(b);
257
+ if (I === void 0) {
258
+ m(Q);
259
259
  return;
260
260
  }
261
- m(E, 0);
261
+ L(I, 0);
262
262
  },
263
- setPage(h) {
264
- if (!$) {
263
+ setPage(b) {
264
+ if (!T) {
265
265
  if (v !== void 0) {
266
- m(v, 0);
266
+ L(v, 0);
267
267
  return;
268
268
  }
269
- c.query !== "" && m(c.query, h);
269
+ h.query !== "" && L(h.query, b);
270
270
  }
271
271
  },
272
272
  retry() {
273
- $ || c.status !== A.ERROR || m(c.query, c.page);
273
+ T || h.status !== D.ERROR || L(h.query, h.page);
274
274
  },
275
- observeResult(h, E) {
276
- c.response !== void 0 && d.observeResult(h, c.response, E);
275
+ observeResult(b, I) {
276
+ h.response !== void 0 && g.observeResult(b, h.response, I);
277
277
  },
278
- selectResult(h, E) {
279
- const O = c.response;
280
- if (O === void 0)
278
+ selectResult(b, I) {
279
+ const q = h.response;
280
+ if (q === void 0)
281
281
  return !1;
282
- d.select(O, h);
283
- const D = O.hits[h].url;
284
- return ((E == null ? void 0 : E.navigate) ?? !0) && r !== void 0 && D !== void 0 ? (r(D, O.hits[h]), !0) : !1;
282
+ g.select(q, b);
283
+ const O = C(q.hits[b]);
284
+ return ((I == null ? void 0 : I.navigate) ?? !0) && r !== void 0 && O !== void 0 ? (r(O, q.hits[b]), !0) : !1;
285
285
  },
286
- subscribe(h) {
287
- return C.add(h), () => {
288
- C.delete(h);
286
+ productUrl: C,
287
+ subscribe(b) {
288
+ return c.add(b), () => {
289
+ c.delete(b);
289
290
  };
290
291
  },
291
- getState: () => c,
292
+ getState: () => h,
292
293
  dispose() {
293
- $ = !0, S(), C.clear(), d.dispose();
294
+ T = !0, y(), c.clear(), g.dispose();
294
295
  }
295
296
  };
296
297
  }
297
- const oe = {
298
+ const ge = (t, e, s) => {
299
+ if (t === void 0 || !Number.isFinite(t))
300
+ return "";
301
+ try {
302
+ return e === void 0 ? new Intl.NumberFormat(s).format(t) : new Intl.NumberFormat(s, { style: "currency", currency: e }).format(t);
303
+ } catch {
304
+ return "";
305
+ }
306
+ }, fe = ({ variants_min_price: t, currency: e }, s) => ge(t, e, s), tt = (t, e) => {
307
+ const { variants_min_price: s, variants_compare_at_price_min: o } = t;
308
+ return s === void 0 || o === void 0 || !(o > s) || fe(t, e) === "" ? "" : ge(o, t.currency, e);
309
+ }, ie = {
298
310
  en: {
299
311
  placeholder: "Ask the AI a question",
300
312
  aiDisclosure: "You're chatting with an AI assistant. It can make mistakes, so please double-check important information",
@@ -310,11 +322,11 @@ const oe = {
310
322
  aiDisclosure: "Estás chateando con un asistente de IA. Puede cometer errores, así que verifica la información importante",
311
323
  askSomethingElse: "Pregunta otra cosa"
312
324
  }
313
- }, he = (t) => {
325
+ }, ve = (t) => {
314
326
  var s;
315
327
  const e = ((s = t == null ? void 0 : t.split("-")[0]) == null ? void 0 : s.toLowerCase()) ?? "en";
316
- return oe[e] ?? oe.en;
317
- }, Ye = ["disabled"], Ze = /* @__PURE__ */ I({
328
+ return ie[e] ?? ie.en;
329
+ }, st = ["disabled"], ot = /* @__PURE__ */ w({
318
330
  __name: "DialogAskSomethingElse",
319
331
  props: {
320
332
  client: {},
@@ -335,19 +347,19 @@ const oe = {
335
347
  }
336
348
  });
337
349
  };
338
- return (o, r) => (u(), _("button", {
350
+ return (o, r) => (u(), p("button", {
339
351
  type: "button",
340
352
  class: "dialog-ask-something-else",
341
353
  disabled: e.disabled,
342
354
  onClick: s
343
- }, y(H(he)(e.client.locale).askSomethingElse), 9, Ye));
355
+ }, E(B(ve)(e.client.locale).askSomethingElse), 9, st));
344
356
  }
345
- }), x = (t, e) => {
357
+ }), P = (t, e) => {
346
358
  const s = t.__vccOpts || t;
347
359
  for (const [o, r] of e)
348
360
  s[o] = r;
349
361
  return s;
350
- }, Je = /* @__PURE__ */ x(Ze, [["__scopeId", "data-v-d0e272a0"]]), et = { class: "dialog-block-header-container" }, tt = { class: "dialog-block-title" }, st = { class: "dialog-block-description" }, ot = /* @__PURE__ */ I({
362
+ }, nt = /* @__PURE__ */ P(ot, [["__scopeId", "data-v-d0e272a0"]]), rt = { class: "dialog-block-header-container" }, it = { class: "dialog-block-title" }, at = { class: "dialog-block-description" }, lt = /* @__PURE__ */ w({
351
363
  __name: "DialogBlockHeader",
352
364
  props: {
353
365
  title: {},
@@ -355,26 +367,26 @@ const oe = {
355
367
  },
356
368
  setup(t) {
357
369
  const e = t;
358
- return (s, o) => (u(), _("div", et, [
359
- l("div", tt, y(e.title ?? "Your expert"), 1),
360
- l("div", st, y(e.description ?? "A question about this product?"), 1)
370
+ return (s, o) => (u(), p("div", rt, [
371
+ l("div", it, E(e.title ?? "Your expert"), 1),
372
+ l("div", at, E(e.description ?? "A question about this product?"), 1)
361
373
  ]));
362
374
  }
363
- }), nt = /* @__PURE__ */ x(ot, [["__scopeId", "data-v-28e6dda7"]]), rt = {
375
+ }), ct = /* @__PURE__ */ P(lt, [["__scopeId", "data-v-28e6dda7"]]), ut = {
364
376
  width: "20",
365
377
  height: "20",
366
378
  viewBox: "0 0 20 20",
367
379
  fill: "none",
368
380
  xmlns: "http://www.w3.org/2000/svg"
369
- }, it = { "clip-path": "url(#clip0_466_934)" }, at = ["stroke"], lt = ["stroke"], ct = /* @__PURE__ */ I({
381
+ }, dt = { "clip-path": "url(#clip0_466_934)" }, pt = ["stroke"], ht = ["stroke"], _t = /* @__PURE__ */ w({
370
382
  __name: "AiStarsIcon",
371
383
  props: {
372
384
  color: {}
373
385
  },
374
386
  setup(t) {
375
387
  const e = t;
376
- return (s, o) => (u(), _("svg", rt, [
377
- l("g", it, [
388
+ return (s, o) => (u(), p("svg", ut, [
389
+ l("g", dt, [
378
390
  l("path", {
379
391
  d: `M5.41675 10.8333L6.07046 12.1408C6.2917 12.5832 6.40232 12.8045 6.55011
380
392
  12.9962C6.68124 13.1663 6.83375 13.3188 7.00388 13.45C7.19559 13.5977 7.41684
@@ -390,7 +402,7 @@ const oe = {
390
402
  "stroke-width": "1.5",
391
403
  "stroke-linecap": "round",
392
404
  "stroke-linejoin": "round"
393
- }, null, 8, at),
405
+ }, null, 8, pt),
394
406
  l("path", {
395
407
  d: `M12.5001 1.66666L13.4823 4.22034C13.7173 4.83136 13.8348 5.13688 14.0175
396
408
  5.39386C14.1795 5.62162 14.3785 5.82061 14.6062 5.98256C14.8632 6.16529 15.1687
@@ -406,7 +418,7 @@ const oe = {
406
418
  "stroke-width": "1.5",
407
419
  "stroke-linecap": "round",
408
420
  "stroke-linejoin": "round"
409
- }, null, 8, lt)
421
+ }, null, 8, ht)
410
422
  ]),
411
423
  o[0] || (o[0] = l("defs", null, [
412
424
  l("clipPath", { id: "clip0_466_934" }, [
@@ -419,7 +431,7 @@ const oe = {
419
431
  ], -1))
420
432
  ]));
421
433
  }
422
- }), dt = ["onClick"], ut = { class: "dialog-block-suggestions-item-label" }, pt = /* @__PURE__ */ I({
434
+ }), gt = ["onClick"], ft = { class: "dialog-block-suggestions-item-label" }, vt = /* @__PURE__ */ w({
423
435
  __name: "DialogBlockSuggestions",
424
436
  props: {
425
437
  client: {},
@@ -438,27 +450,27 @@ const oe = {
438
450
  fromQuestionSuggestion: !0
439
451
  });
440
452
  };
441
- return (o, r) => (u(!0), _(N, null, W(e.questions, (n) => (u(), _("button", {
453
+ return (o, r) => (u(!0), p(M, null, Y(e.questions, (n) => (u(), p("button", {
442
454
  key: n.question,
443
455
  class: "dialog-block-suggestions-item",
444
456
  onClick: (a) => s(n.question)
445
457
  }, [
446
- T(ct, {
458
+ R(_t, {
447
459
  class: "dialog-block-suggestions-item-icon",
448
460
  color: e.client.theme.primaryColor
449
461
  }, null, 8, ["color"]),
450
- l("span", ut, y(n.question), 1)
451
- ], 8, dt))), 128));
462
+ l("span", ft, E(n.question), 1)
463
+ ], 8, gt))), 128));
452
464
  }
453
- }), ht = /* @__PURE__ */ x(pt, [["__scopeId", "data-v-db34d4b4"]]), _t = {};
454
- function gt(t, e) {
455
- return u(), _(N, null, [
465
+ }), mt = /* @__PURE__ */ P(vt, [["__scopeId", "data-v-db34d4b4"]]), bt = {};
466
+ function St(t, e) {
467
+ return u(), p(M, null, [
456
468
  e[0] || (e[0] = l("div", { class: "dialog-block-suggestions-skeleton-item" }, null, -1)),
457
469
  e[1] || (e[1] = l("div", { class: "dialog-block-suggestions-skeleton-item" }, null, -1)),
458
470
  e[2] || (e[2] = l("div", { class: "dialog-block-suggestions-skeleton-item" }, null, -1))
459
471
  ], 64);
460
472
  }
461
- const ft = /* @__PURE__ */ x(_t, [["render", gt], ["__scopeId", "data-v-26a64b58"]]), vt = { class: "dialog-block-suggestions-container" }, mt = /* @__PURE__ */ I({
473
+ const Ct = /* @__PURE__ */ P(bt, [["render", St], ["__scopeId", "data-v-26a64b58"]]), Et = { class: "dialog-block-suggestions-container" }, yt = /* @__PURE__ */ w({
462
474
  __name: "DialogBlockSuggestionsContainer",
463
475
  props: {
464
476
  client: {},
@@ -470,8 +482,8 @@ const ft = /* @__PURE__ */ x(_t, [["render", gt], ["__scopeId", "data-v-26a64b58
470
482
  },
471
483
  setup(t) {
472
484
  const e = t;
473
- return (s, o) => (u(), _("div", vt, [
474
- e.isLoading || !e.questions ? (u(), P(ft, { key: 0 })) : (u(), P(ht, {
485
+ return (s, o) => (u(), p("div", Et, [
486
+ e.isLoading || !e.questions ? (u(), N(Ct, { key: 0 })) : (u(), N(mt, {
475
487
  key: 1,
476
488
  client: e.client,
477
489
  questions: e.questions,
@@ -481,33 +493,33 @@ const ft = /* @__PURE__ */ x(_t, [["render", gt], ["__scopeId", "data-v-26a64b58
481
493
  }, null, 8, ["client", "questions", "product-id", "product-title", "selected-variant-id"]))
482
494
  ]));
483
495
  }
484
- }), bt = /* @__PURE__ */ x(mt, [["__scopeId", "data-v-18c9e78b"]]), St = {
496
+ }), It = /* @__PURE__ */ P(yt, [["__scopeId", "data-v-18c9e78b"]]), wt = {
485
497
  width: "20",
486
498
  height: "20",
487
499
  viewBox: "0 0 20 20",
488
500
  fill: "none",
489
501
  xmlns: "http://www.w3.org/2000/svg"
490
- }, Ct = ["stroke"], Et = /* @__PURE__ */ I({
502
+ }, $t = ["stroke"], kt = /* @__PURE__ */ w({
491
503
  __name: "ArrowIcon",
492
504
  props: {
493
505
  color: {}
494
506
  },
495
507
  setup(t) {
496
508
  const e = t;
497
- return (s, o) => (u(), _("svg", St, [
509
+ return (s, o) => (u(), p("svg", wt, [
498
510
  l("path", {
499
511
  d: "M10 16.6667V3.33334M10 3.33334L5 8.33334M10 3.33334L15 8.33334",
500
512
  stroke: e.color || "#ffffff",
501
513
  "stroke-width": "1.5",
502
514
  "stroke-linecap": "round",
503
515
  "stroke-linejoin": "round"
504
- }, null, 8, Ct)
516
+ }, null, 8, $t)
505
517
  ]));
506
518
  }
507
- }), yt = { class: "dialog-input-container" }, It = ["placeholder"], wt = ["disabled"], $t = {
519
+ }), Tt = { class: "dialog-input-container" }, Rt = ["placeholder"], At = ["disabled"], Lt = {
508
520
  id: "dialog-input-ai-disclosure",
509
521
  class: "dialog-input-ai-disclosure"
510
- }, kt = /* @__PURE__ */ I({
522
+ }, xt = /* @__PURE__ */ w({
511
523
  __name: "DialogInput",
512
524
  props: {
513
525
  client: {},
@@ -517,7 +529,7 @@ const ft = /* @__PURE__ */ x(_t, [["render", gt], ["__scopeId", "data-v-26a64b58
517
529
  selectedVariantId: {}
518
530
  },
519
531
  setup(t) {
520
- const e = t, s = R(), o = R(""), r = b(() => he(e.client.locale)), n = () => {
532
+ const e = t, s = A(), o = A(""), r = f(() => ve(e.client.locale)), n = () => {
521
533
  var i;
522
534
  (i = s.value) == null || i.focus();
523
535
  }, a = () => {
@@ -530,22 +542,22 @@ const ft = /* @__PURE__ */ x(_t, [["render", gt], ["__scopeId", "data-v-26a64b58
530
542
  fromQuestionSuggestion: !0
531
543
  }), o.value = "");
532
544
  };
533
- return (i, p) => (u(), _("div", yt, [
545
+ return (i, _) => (u(), p("div", Tt, [
534
546
  l("div", {
535
547
  class: "dialog-input-wrapper",
536
548
  onClick: n
537
549
  }, [
538
- ie(l("input", {
550
+ ce(l("input", {
539
551
  id: "dialog-ask-anything-input-ai-input",
540
552
  ref_key: "inputRef",
541
553
  ref: s,
542
- "onUpdate:modelValue": p[0] || (p[0] = (c) => o.value = c),
554
+ "onUpdate:modelValue": _[0] || (_[0] = (d) => o.value = d),
543
555
  class: "dialog-ask-anything-input-ai-input",
544
556
  placeholder: r.value.placeholder,
545
557
  "aria-describedby": "dialog-input-ai-disclosure",
546
- onKeydown: Ie(a, ["enter"])
547
- }, null, 40, It), [
548
- [ae, o.value]
558
+ onKeydown: Te(a, ["enter"])
559
+ }, null, 40, Rt), [
560
+ [ue, o.value]
549
561
  ]),
550
562
  l("button", {
551
563
  id: "send-message-button-ai-input",
@@ -553,15 +565,15 @@ const ft = /* @__PURE__ */ x(_t, [["render", gt], ["__scopeId", "data-v-26a64b58
553
565
  disabled: !o.value.trim(),
554
566
  onClick: a
555
567
  }, [
556
- T(Et, {
568
+ R(kt, {
557
569
  color: e.client.theme.ctaTextColor
558
570
  }, null, 8, ["color"])
559
- ], 8, wt)
571
+ ], 8, At)
560
572
  ]),
561
- l("p", $t, y(r.value.aiDisclosure), 1)
573
+ l("p", Lt, E(r.value.aiDisclosure), 1)
562
574
  ]));
563
575
  }
564
- }), Tt = /* @__PURE__ */ x(kt, [["__scopeId", "data-v-87013888"]]), Rt = /* @__PURE__ */ I({
576
+ }), Dt = /* @__PURE__ */ P(xt, [["__scopeId", "data-v-87013888"]]), Pt = /* @__PURE__ */ w({
565
577
  __name: "ThemeProvider",
566
578
  props: {
567
579
  theme: {}
@@ -569,45 +581,45 @@ const ft = /* @__PURE__ */ x(_t, [["render", gt], ["__scopeId", "data-v-26a64b58
569
581
  setup(t) {
570
582
  const e = t, s = document.body, o = (n) => n.replace(/([A-Z])/g, "-$1").toLowerCase(), r = (n) => {
571
583
  n && Object.keys(n).forEach((a) => {
572
- const i = a, p = o(a);
584
+ const i = a, _ = o(a);
573
585
  if (n[i] !== void 0) {
574
586
  if (typeof n[i] == "object") {
575
- Object.keys(n[i]).forEach((c) => {
576
- var d;
577
- const C = c;
578
- if (C !== void 0) {
579
- const f = o(c), v = n[i];
587
+ Object.keys(n[i]).forEach((d) => {
588
+ var c;
589
+ const h = d;
590
+ if (h !== void 0) {
591
+ const g = o(d), S = n[i];
580
592
  s.style.setProperty(
581
- `--dialog-theme-${p}-${f}`,
582
- (d = v[C]) == null ? void 0 : d.toString()
593
+ `--dialog-theme-${_}-${g}`,
594
+ (c = S[h]) == null ? void 0 : c.toString()
583
595
  );
584
596
  }
585
597
  });
586
598
  return;
587
599
  }
588
600
  if (i === "ctaBorderType") {
589
- const c = n[i] === "rounded" ? "24px" : "0";
590
- s.style.setProperty(`--dialog-theme-${p}`, c);
601
+ const d = n[i] === "rounded" ? "24px" : "0";
602
+ s.style.setProperty(`--dialog-theme-${_}`, d);
591
603
  return;
592
604
  }
593
605
  s.style.setProperty(
594
- `--dialog-theme-${p}`,
606
+ `--dialog-theme-${_}`,
595
607
  n[i].toString()
596
608
  );
597
609
  }
598
610
  });
599
611
  };
600
- return K(() => {
612
+ return z(() => {
601
613
  e.theme && r(e.theme);
602
- }), M(
614
+ }), U(
603
615
  () => e.theme,
604
616
  (n) => {
605
617
  n && r(n);
606
618
  },
607
619
  { deep: !0 }
608
- ), (n, a) => we(n.$slots, "default");
620
+ ), (n, a) => Re(n.$slots, "default");
609
621
  }
610
- }), At = ["dir"], Lt = 2, xt = 5, Dt = /* @__PURE__ */ I({
622
+ }), Ot = ["dir"], Nt = 2, qt = 5, Mt = /* @__PURE__ */ w({
611
623
  __name: "DialogProductBlock",
612
624
  props: {
613
625
  client: {},
@@ -618,69 +630,69 @@ const ft = /* @__PURE__ */ x(_t, [["render", gt], ["__scopeId", "data-v-26a64b58
618
630
  },
619
631
  setup(t) {
620
632
  const e = t;
621
- K(() => {
622
- pe({
633
+ z(() => {
634
+ _e({
623
635
  method: "vue",
624
- version: "3.10.0"
625
- }), He("pdp-block");
636
+ version: "3.11.0"
637
+ }), Fe("pdp-block");
626
638
  });
627
- const s = R(!0), o = R(void 0), r = R(0), n = b(() => {
628
- var d;
629
- return s.value ? "" : (d = o.value) == null ? void 0 : d.assistantName;
630
- }), a = b(() => {
631
- var d;
632
- return s.value ? "" : (d = o.value) == null ? void 0 : d.description;
633
- }), i = b(
639
+ const s = A(!0), o = A(void 0), r = A(0), n = f(() => {
640
+ var c;
641
+ return s.value ? "" : (c = o.value) == null ? void 0 : c.assistantName;
642
+ }), a = f(() => {
643
+ var c;
644
+ return s.value ? "" : (c = o.value) == null ? void 0 : c.description;
645
+ }), i = f(
634
646
  () => {
635
- var d, f;
636
- return (f = (d = o.value) == null ? void 0 : d.questions) == null ? void 0 : f.slice(0, Lt);
647
+ var c, g;
648
+ return (g = (c = o.value) == null ? void 0 : c.questions) == null ? void 0 : g.slice(0, Nt);
637
649
  }
638
- ), p = b(() => {
639
- var d;
640
- return s.value ? "" : (d = o.value) == null ? void 0 : d.inputPlaceholder;
641
- }), c = b(
650
+ ), _ = f(() => {
651
+ var c;
652
+ return s.value ? "" : (c = o.value) == null ? void 0 : c.inputPlaceholder;
653
+ }), d = f(
642
654
  () => {
643
- var d;
644
- return Oe(
645
- (d = e.client.getLocalizationInformations()) == null ? void 0 : d.languageCode
655
+ var c;
656
+ return He(
657
+ (c = e.client.getLocalizationInformations()) == null ? void 0 : c.languageCode
646
658
  );
647
659
  }
648
- ), C = async () => {
649
- const d = ++r.value;
660
+ ), h = async () => {
661
+ const c = ++r.value;
650
662
  s.value = !0, o.value = void 0;
651
663
  try {
652
- const f = await e.client.getSuggestions(e.productId, {
653
- limit: xt
664
+ const g = await e.client.getSuggestions(e.productId, {
665
+ limit: qt
654
666
  });
655
- d === r.value && (o.value = f);
656
- } catch (f) {
657
- console.error("error", f);
667
+ c === r.value && (o.value = g);
668
+ } catch (g) {
669
+ console.error("error", g);
658
670
  } finally {
659
- d === r.value && (s.value = !1);
671
+ c === r.value && (s.value = !1);
660
672
  }
661
673
  };
662
- return M(
674
+ return U(
663
675
  () => [e.client, e.productId],
664
676
  () => {
665
- C();
677
+ h();
666
678
  },
667
679
  { immediate: !0 }
668
- ), (d, f) => (u(), P(Rt, {
680
+ ), (c, g) => (u(), N(Pt, {
669
681
  theme: e.client.theme
670
682
  }, {
671
- default: le(() => {
672
- var v;
683
+ default: de(() => {
684
+ var S;
673
685
  return [
674
686
  l("div", {
675
687
  id: "dialog-instant",
676
688
  class: "dialog-block-container",
677
- dir: c.value
689
+ dir: d.value
678
690
  }, [
679
- T(nt, {
691
+ R(ct, {
680
692
  title: n.value,
681
693
  description: a.value
682
694
  }, null, 8, ["title", "description"]),
683
- T(bt, {
695
+ R(It, {
684
696
  client: e.client,
685
697
  questions: i.value,
686
698
  "is-loading": s.value,
@@ -688,29 +700,29 @@ const ft = /* @__PURE__ */ x(_t, [["render", gt], ["__scopeId", "data-v-26a64b58
688
700
  "product-title": e.productTitle,
689
701
  "selected-variant-id": e == null ? void 0 : e.selectedVariantId
690
702
  }, null, 8, ["client", "questions", "is-loading", "product-id", "product-title", "selected-variant-id"]),
691
- e.enableInput ? (u(), P(Tt, {
703
+ e.enableInput ? (u(), N(Dt, {
692
704
  key: 0,
693
705
  client: e.client,
694
- placeholder: p.value,
706
+ placeholder: _.value,
695
707
  "product-id": e.productId,
696
708
  "product-title": e.productTitle,
697
709
  "selected-variant-id": e == null ? void 0 : e.selectedVariantId
698
- }, null, 8, ["client", "placeholder", "product-id", "product-title", "selected-variant-id"])) : (u(), P(Je, {
710
+ }, null, 8, ["client", "placeholder", "product-id", "product-title", "selected-variant-id"])) : (u(), N(nt, {
699
711
  key: 1,
700
712
  client: e.client,
701
- questions: (v = o.value) == null ? void 0 : v.questions,
713
+ questions: (S = o.value) == null ? void 0 : S.questions,
702
714
  disabled: s.value,
703
715
  "product-id": e.productId,
704
716
  "product-title": e.productTitle,
705
717
  "selected-variant-id": e.selectedVariantId
706
718
  }, null, 8, ["client", "questions", "disabled", "product-id", "product-title", "selected-variant-id"]))
707
- ], 8, At)
719
+ ], 8, Ot)
708
720
  ];
709
721
  }),
710
722
  _: 1
711
723
  }, 8, ["theme"]));
712
724
  }
713
- }), ao = /* @__PURE__ */ x(Dt, [["__scopeId", "data-v-0c307e5f"]]), Pt = {}, Ot = {
725
+ }), ho = /* @__PURE__ */ P(Mt, [["__scopeId", "data-v-0c307e5f"]]), Ht = {}, Ut = {
714
726
  width: "16",
715
727
  height: "16",
716
728
  viewBox: "0 0 16 16",
@@ -718,8 +730,8 @@ const ft = /* @__PURE__ */ x(_t, [["render", gt], ["__scopeId", "data-v-26a64b58
718
730
  xmlns: "http://www.w3.org/2000/svg",
719
731
  "aria-hidden": "true"
720
732
  };
721
- function Nt(t, e) {
722
- return u(), _("svg", Ot, e[0] || (e[0] = [
733
+ function Vt(t, e) {
734
+ return u(), p("svg", Ut, e[0] || (e[0] = [
723
735
  l("path", {
724
736
  d: "M8 13V3M8 3L3 8M8 3L13 8",
725
737
  stroke: "currentColor",
@@ -729,28 +741,28 @@ function Nt(t, e) {
729
741
  }, null, -1)
730
742
  ]));
731
743
  }
732
- const qt = /* @__PURE__ */ x(Pt, [["render", Nt]]), Mt = {
744
+ const Bt = /* @__PURE__ */ P(Ht, [["render", Vt]]), Kt = {
733
745
  width: "16",
734
746
  height: "16",
735
747
  viewBox: "0 0 12 12",
736
748
  fill: "none",
737
749
  xmlns: "http://www.w3.org/2000/svg",
738
750
  "aria-hidden": "true"
739
- }, Ut = ["fill"], Ht = "M5.3217 0.588255C5.63241 -0.196084 6.36759 -0.196085 6.6783 0.588254C6.98901 1.37259 7.68193 2.82807 8.42693 3.57307C9.17193 4.31807 10.6274 5.01099 11.4117 5.3217C12.1961 5.63241 12.1961 6.36759 11.4117 6.6783C10.6274 6.98901 9.17193 7.68193 8.42693 8.42693C7.68193 9.17193 6.98901 10.6274 6.6783 11.4117C6.36759 12.1961 5.63241 12.1961 5.3217 11.4117C5.01099 10.6274 4.31807 9.17193 3.57307 8.42693C2.82808 7.68193 1.37259 6.98901 0.588255 6.6783C-0.196084 6.36759 -0.196085 5.63241 0.588254 5.3217C1.37259 5.01099 2.82807 4.31807 3.57307 3.57307C4.31807 2.82808 5.01099 1.37259 5.3217 0.588255Z", Vt = /* @__PURE__ */ I({
751
+ }, Ft = ["fill"], zt = "M5.3217 0.588255C5.63241 -0.196084 6.36759 -0.196085 6.6783 0.588254C6.98901 1.37259 7.68193 2.82807 8.42693 3.57307C9.17193 4.31807 10.6274 5.01099 11.4117 5.3217C12.1961 5.63241 12.1961 6.36759 11.4117 6.6783C10.6274 6.98901 9.17193 7.68193 8.42693 8.42693C7.68193 9.17193 6.98901 10.6274 6.6783 11.4117C6.36759 12.1961 5.63241 12.1961 5.3217 11.4117C5.01099 10.6274 4.31807 9.17193 3.57307 8.42693C2.82808 7.68193 1.37259 6.98901 0.588255 6.6783C-0.196084 6.36759 -0.196085 5.63241 0.588254 5.3217C1.37259 5.01099 2.82807 4.31807 3.57307 3.57307C4.31807 2.82808 5.01099 1.37259 5.3217 0.588255Z", Gt = /* @__PURE__ */ w({
740
752
  __name: "ShurikenIcon",
741
753
  props: {
742
754
  color: {}
743
755
  },
744
756
  setup(t) {
745
757
  const e = t;
746
- return (s, o) => (u(), _("svg", Mt, [
758
+ return (s, o) => (u(), p("svg", Kt, [
747
759
  l("path", {
748
- d: Ht,
760
+ d: zt,
749
761
  fill: e.color || "currentColor"
750
- }, null, 8, Ut)
762
+ }, null, 8, Ft)
751
763
  ]));
752
764
  }
753
- }), Bt = { class: "dialog-search-bar-field" }, Kt = { class: "dialog-search-bar-icon" }, Ft = ["aria-label", "placeholder", "autofocus"], zt = ["aria-label"], lo = /* @__PURE__ */ I({
765
+ }), jt = { class: "dialog-search-bar-field" }, Qt = { class: "dialog-search-bar-icon" }, Wt = ["aria-label", "placeholder", "autofocus"], Xt = ["aria-label"], _o = /* @__PURE__ */ w({
754
766
  __name: "DialogSearchBar",
755
767
  props: {
756
768
  controller: {},
@@ -759,21 +771,21 @@ const qt = /* @__PURE__ */ x(Pt, [["render", Nt]]), Mt = {
759
771
  submitAriaLabel: { default: "Search" }
760
772
  },
761
773
  setup(t) {
762
- const e = t, s = R(""), o = () => {
774
+ const e = t, s = A(""), o = () => {
763
775
  e.controller.setQuery(s.value);
764
776
  }, r = () => {
765
777
  e.controller.submit(s.value);
766
778
  };
767
- return (n, a) => (u(), _("form", {
779
+ return (n, a) => (u(), p("form", {
768
780
  class: "dialog-search-bar",
769
781
  role: "search",
770
- onSubmit: $e(r, ["prevent"])
782
+ onSubmit: Ae(r, ["prevent"])
771
783
  }, [
772
- l("div", Bt, [
773
- l("span", Kt, [
774
- T(Vt)
784
+ l("div", jt, [
785
+ l("span", Qt, [
786
+ R(Gt)
775
787
  ]),
776
- ie(l("input", {
788
+ ce(l("input", {
777
789
  "onUpdate:modelValue": a[0] || (a[0] = (i) => s.value = i),
778
790
  type: "text",
779
791
  name: "dialog-search-query",
@@ -782,8 +794,8 @@ const qt = /* @__PURE__ */ x(Pt, [["render", Nt]]), Mt = {
782
794
  placeholder: e.placeholder,
783
795
  autofocus: e.autoFocus,
784
796
  onInput: o
785
- }, null, 40, Ft), [
786
- [ae, s.value]
797
+ }, null, 40, Wt), [
798
+ [ue, s.value]
787
799
  ])
788
800
  ]),
789
801
  l("button", {
@@ -791,17 +803,17 @@ const qt = /* @__PURE__ */ x(Pt, [["render", Nt]]), Mt = {
791
803
  class: "dialog-search-bar-submit",
792
804
  "aria-label": e.submitAriaLabel
793
805
  }, [
794
- T(qt)
795
- ], 8, zt)
806
+ R(Bt)
807
+ ], 8, Xt)
796
808
  ], 32));
797
809
  }
798
- }), Gt = (t, e) => {
810
+ }), Yt = (t, e) => {
799
811
  try {
800
812
  return new Intl.NumberFormat(e).format(t);
801
813
  } catch {
802
814
  return String(t);
803
815
  }
804
- }, ne = {
816
+ }, ae = {
805
817
  en: (t) => ({
806
818
  searching: (e) => `Searching “${e}”…`,
807
819
  noResults: "No matching products",
@@ -867,15 +879,15 @@ const qt = /* @__PURE__ */ x(Pt, [["render", Nt]]), Mt = {
867
879
  next: "Successivo",
868
880
  pageOf: (e, s) => `Pagina ${t(e)} / ${t(s)}`
869
881
  })
870
- }, _e = (t) => {
882
+ }, me = (t) => {
871
883
  var o;
872
884
  const e = ((o = t == null ? void 0 : t.split("-")[0]) == null ? void 0 : o.toLowerCase()) ?? "en";
873
- return (ne[e] ?? ne.en)((r) => Gt(r, t));
874
- }, ge = (t) => t.status !== A.LOADING && t.response !== void 0 && t.response.nbPages > 1, jt = {
885
+ return (ae[e] ?? ae.en)((r) => Yt(r, t));
886
+ }, be = (t) => t.status !== D.LOADING && t.response !== void 0 && t.response.nbPages > 1, Zt = {
875
887
  key: 0,
876
888
  "aria-label": "Search results pages",
877
889
  class: "dialog-search-pagination"
878
- }, Qt = ["disabled"], Wt = ["disabled"], Xt = /* @__PURE__ */ I({
890
+ }, Jt = ["disabled"], es = ["disabled"], ts = /* @__PURE__ */ w({
879
891
  __name: "DialogSearchPagination",
880
892
  props: {
881
893
  controller: {},
@@ -883,86 +895,80 @@ const qt = /* @__PURE__ */ x(Pt, [["render", Nt]]), Mt = {
883
895
  locale: {}
884
896
  },
885
897
  setup(t) {
886
- const e = t, s = b(() => e.state.response), o = b(() => _e(e.locale));
887
- return (r, n) => s.value !== void 0 && H(ge)(e.state) ? (u(), _("nav", jt, [
898
+ const e = t, s = f(() => e.state.response), o = f(() => me(e.locale));
899
+ return (r, n) => s.value !== void 0 && B(be)(e.state) ? (u(), p("nav", Zt, [
888
900
  l("button", {
889
901
  type: "button",
890
902
  disabled: s.value.page === 0,
891
903
  onClick: n[0] || (n[0] = (a) => e.controller.setPage(s.value.page - 1))
892
- }, y(o.value.previous), 9, Qt),
893
- l("span", null, y(o.value.pageOf(s.value.page + 1, s.value.nbPages)), 1),
904
+ }, E(o.value.previous), 9, Jt),
905
+ l("span", null, E(o.value.pageOf(s.value.page + 1, s.value.nbPages)), 1),
894
906
  l("button", {
895
907
  type: "button",
896
908
  disabled: s.value.page >= s.value.nbPages - 1,
897
909
  onClick: n[1] || (n[1] = (a) => e.controller.setPage(s.value.page + 1))
898
- }, y(o.value.next), 9, Wt)
899
- ])) : L("", !0);
910
+ }, E(o.value.next), 9, es)
911
+ ])) : x("", !0);
900
912
  }
901
- }), re = (t) => t.normalize("NFD").replace(new RegExp("\\p{M}", "gu"), "").replace(/ẞ/gu, "ß").toUpperCase().toLowerCase().replace(/ς/g, "σ"), Yt = (t, e) => {
902
- const s = { before: "", match: t, after: "" }, o = re(e.trim());
913
+ }), le = (t) => t.normalize("NFD").replace(new RegExp("\\p{M}", "gu"), "").replace(/ẞ/gu, "ß").toUpperCase().toLowerCase().replace(/ς/g, "σ"), ss = (t, e) => {
914
+ const s = { before: "", match: t, after: "" }, o = le(e.trim());
903
915
  if (o === "")
904
916
  return s;
905
917
  const r = [...t], n = [];
906
918
  let a = "";
907
- r.forEach((C, d) => {
908
- const f = re(C);
909
- for (let v = 0; v < f.length; v += 1)
910
- n.push(d);
911
- a += f;
919
+ r.forEach((h, c) => {
920
+ const g = le(h);
921
+ for (let S = 0; S < g.length; S += 1)
922
+ n.push(c);
923
+ a += g;
912
924
  });
913
925
  const i = a.indexOf(o);
914
926
  if (i === -1)
915
927
  return s;
916
- const p = n[i], c = n[i + o.length - 1] + 1;
928
+ const _ = n[i], d = n[i + o.length - 1] + 1;
917
929
  return {
918
- before: r.slice(0, p).join(""),
919
- match: r.slice(p, c).join(""),
920
- after: r.slice(c).join("")
930
+ before: r.slice(0, _).join(""),
931
+ match: r.slice(_, d).join(""),
932
+ after: r.slice(d).join("")
921
933
  };
922
- }, Zt = {
934
+ }, os = {
923
935
  key: 0,
924
936
  class: "dialog-search-muted"
925
- }, Jt = { class: "dialog-search-match" }, es = {
937
+ }, ns = { class: "dialog-search-match" }, rs = {
926
938
  key: 1,
927
939
  class: "dialog-search-muted"
928
- }, fe = /* @__PURE__ */ I({
940
+ }, Se = /* @__PURE__ */ w({
929
941
  __name: "HighlightedTitle",
930
942
  props: {
931
943
  title: {},
932
944
  query: {}
933
945
  },
934
946
  setup(t) {
935
- const e = t, s = b(() => Yt(e.title, e.query));
936
- return (o, r) => (u(), _(N, null, [
937
- s.value.before !== "" ? (u(), _("span", Zt, y(s.value.before), 1)) : L("", !0),
938
- l("span", Jt, y(s.value.match), 1),
939
- s.value.after !== "" ? (u(), _("span", es, y(s.value.after), 1)) : L("", !0)
947
+ const e = t, s = f(() => ss(e.title, e.query));
948
+ return (o, r) => (u(), p(M, null, [
949
+ s.value.before !== "" ? (u(), p("span", os, E(s.value.before), 1)) : x("", !0),
950
+ l("span", ns, E(s.value.match), 1),
951
+ s.value.after !== "" ? (u(), p("span", rs, E(s.value.after), 1)) : x("", !0)
940
952
  ], 64));
941
953
  }
942
- }), ts = ({ variants_min_price: t, currency: e }, s) => {
943
- if (t === void 0)
944
- return "";
945
- try {
946
- return e === void 0 ? new Intl.NumberFormat(s).format(t) : new Intl.NumberFormat(s, { style: "currency", currency: e }).format(
947
- t
948
- );
949
- } catch {
950
- return "";
951
- }
952
- }, ss = (t) => t.product_image || t.image || void 0, os = (t) => {
953
- try {
954
- const { protocol: e } = new URL(t, window.location.href);
955
- return e === "http:" || e === "https:" ? t : void 0;
956
- } catch {
957
- return;
958
- }
959
- }, ve = (t) => t.url === void 0 || t.url === "" ? void 0 : os(t.url), me = (t) => t.title ?? t.handle ?? t.objectID, ns = {
954
+ }), is = (t) => t.product_image || t.image || void 0, Ce = (t) => {
955
+ if (!(t === void 0 || t === ""))
956
+ try {
957
+ const { protocol: e } = new URL(t, window.location.href);
958
+ return e === "http:" || e === "https:" ? t : void 0;
959
+ } catch {
960
+ return;
961
+ }
962
+ }, as = (t) => Ce(t.url), Ee = (t) => t.title ?? t.handle ?? t.objectID, ls = {
960
963
  class: "dialog-search-product-thumb",
961
964
  "aria-hidden": "true"
962
- }, rs = ["src"], is = { class: "dialog-search-product-title" }, as = {
965
+ }, cs = ["src"], us = { class: "dialog-search-product-title" }, ds = {
963
966
  key: 0,
964
967
  class: "dialog-search-product-price"
965
- }, ls = /* @__PURE__ */ I({
968
+ }, ps = {
969
+ key: 0,
970
+ class: "dialog-search-product-compare-at"
971
+ }, hs = /* @__PURE__ */ w({
966
972
  __name: "DialogSearchProductCard",
967
973
  props: {
968
974
  controller: {},
@@ -972,53 +978,58 @@ const qt = /* @__PURE__ */ x(Pt, [["render", Nt]]), Mt = {
972
978
  query: { default: "" }
973
979
  },
974
980
  setup(t) {
975
- const e = t, s = R();
976
- M(
981
+ const e = t, s = A();
982
+ U(
977
983
  () => e.hit,
978
984
  () => {
979
985
  s.value !== void 0 && e.controller.observeResult(s.value, e.index);
980
986
  },
981
987
  { immediate: !0, flush: "post" }
982
988
  );
983
- const o = b(() => ve(e.hit)), r = b(() => ss(e.hit)), n = b(() => ts(e.hit, e.locale)), a = (p) => {
984
- const c = p.metaKey || p.ctrlKey || p.shiftKey || p.altKey;
985
- e.controller.selectResult(e.index, { navigate: !c }) && p.preventDefault();
986
- }, i = (p) => {
987
- p.button === 1 && e.controller.selectResult(e.index, { navigate: !1 });
989
+ const o = f(() => Ce(e.controller.productUrl(e.hit))), r = f(() => is(e.hit)), n = f(() => fe(e.hit, e.locale)), a = f(
990
+ () => tt(e.hit, e.locale)
991
+ ), i = (d) => {
992
+ const h = d.metaKey || d.ctrlKey || d.shiftKey || d.altKey;
993
+ e.controller.selectResult(e.index, { navigate: !h }) && d.preventDefault();
994
+ }, _ = (d) => {
995
+ d.button === 1 && e.controller.selectResult(e.index, { navigate: !1 });
988
996
  };
989
- return (p, c) => (u(), _("li", {
997
+ return (d, h) => (u(), p("li", {
990
998
  ref_key: "cardRef",
991
999
  ref: s,
992
1000
  class: "dialog-search-card"
993
1001
  }, [
994
- (u(), P(ke(o.value === void 0 ? "div" : "a"), Te({
1002
+ (u(), N(Le(o.value === void 0 ? "div" : "a"), xe({
995
1003
  class: "dialog-search-product",
996
1004
  href: o.value
997
- }, Re(
998
- o.value === void 0 ? {} : { click: a, auxclick: i }
1005
+ }, De(
1006
+ o.value === void 0 ? {} : { click: i, auxclick: _ }
999
1007
  )), {
1000
- default: le(() => [
1001
- l("span", ns, [
1002
- r.value !== void 0 ? (u(), _("img", {
1008
+ default: de(() => [
1009
+ l("span", ls, [
1010
+ r.value !== void 0 ? (u(), p("img", {
1003
1011
  key: 0,
1004
1012
  src: r.value,
1005
1013
  alt: "",
1006
1014
  loading: "lazy"
1007
- }, null, 8, rs)) : L("", !0)
1015
+ }, null, 8, cs)) : x("", !0)
1008
1016
  ]),
1009
- l("span", is, [
1010
- T(fe, {
1011
- title: H(me)(e.hit),
1017
+ l("span", us, [
1018
+ R(Se, {
1019
+ title: B(Ee)(e.hit),
1012
1020
  query: e.query
1013
1021
  }, null, 8, ["title", "query"])
1014
1022
  ]),
1015
- n.value !== "" ? (u(), _("span", as, y(n.value), 1)) : L("", !0)
1023
+ n.value !== "" ? (u(), p("span", ds, [
1024
+ a.value !== "" ? (u(), p("s", ps, E(a.value), 1)) : x("", !0),
1025
+ Z(E(n.value), 1)
1026
+ ])) : x("", !0)
1016
1027
  ]),
1017
1028
  _: 1
1018
1029
  }, 16, ["href"]))
1019
1030
  ], 512));
1020
1031
  }
1021
- }), cs = {}, ds = {
1032
+ }), _s = {}, gs = {
1022
1033
  width: "16",
1023
1034
  height: "16",
1024
1035
  viewBox: "0 0 256 256",
@@ -1026,12 +1037,12 @@ const qt = /* @__PURE__ */ x(Pt, [["render", Nt]]), Mt = {
1026
1037
  xmlns: "http://www.w3.org/2000/svg",
1027
1038
  "aria-hidden": "true"
1028
1039
  };
1029
- function us(t, e) {
1030
- return u(), _("svg", ds, e[0] || (e[0] = [
1040
+ function fs(t, e) {
1041
+ return u(), p("svg", gs, e[0] || (e[0] = [
1031
1042
  l("path", { d: "M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z" }, null, -1)
1032
1043
  ]));
1033
1044
  }
1034
- const ps = /* @__PURE__ */ x(cs, [["render", us]]), hs = {}, _s = {
1045
+ const vs = /* @__PURE__ */ P(_s, [["render", fs]]), ms = {}, bs = {
1035
1046
  width: "12",
1036
1047
  height: "12",
1037
1048
  viewBox: "0 0 256 256",
@@ -1039,21 +1050,21 @@ const ps = /* @__PURE__ */ x(cs, [["render", us]]), hs = {}, _s = {
1039
1050
  xmlns: "http://www.w3.org/2000/svg",
1040
1051
  "aria-hidden": "true"
1041
1052
  };
1042
- function gs(t, e) {
1043
- return u(), _("svg", _s, e[0] || (e[0] = [
1053
+ function Ss(t, e) {
1054
+ return u(), p("svg", bs, e[0] || (e[0] = [
1044
1055
  l("path", { d: "M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z" }, null, -1)
1045
1056
  ]));
1046
1057
  }
1047
- const fs = /* @__PURE__ */ x(hs, [["render", gs]]), be = (t) => (t ?? []).flatMap((e) => {
1048
- const s = ve(e);
1058
+ const Cs = /* @__PURE__ */ P(ms, [["render", Ss]]), ye = (t) => (t ?? []).flatMap((e) => {
1059
+ const s = as(e);
1049
1060
  return s === void 0 ? [] : [{ collection: e, href: s }];
1050
- }), vs = {
1061
+ }), Es = {
1051
1062
  key: 0,
1052
1063
  class: "dialog-search-collections"
1053
- }, ms = { class: "dialog-search-section-head" }, bs = { class: "dialog-search-label" }, Ss = { class: "dialog-search-count" }, Cs = { class: "dialog-search-collection-list" }, Es = ["href"], ys = {
1064
+ }, ys = { class: "dialog-search-section-head" }, Is = { class: "dialog-search-label" }, ws = { class: "dialog-search-count" }, $s = { class: "dialog-search-collection-list" }, ks = ["href"], Ts = {
1054
1065
  class: "dialog-search-collection-thumb",
1055
1066
  "aria-hidden": "true"
1056
- }, Is = ["src"], ws = { class: "dialog-search-collection-title" }, $s = { class: "dialog-search-caret" }, ks = /* @__PURE__ */ I({
1067
+ }, Rs = ["src"], As = { class: "dialog-search-collection-title" }, Ls = { class: "dialog-search-caret" }, xs = /* @__PURE__ */ w({
1057
1068
  __name: "DialogSearchCollections",
1058
1069
  props: {
1059
1070
  collections: {},
@@ -1061,50 +1072,50 @@ const fs = /* @__PURE__ */ x(hs, [["render", gs]]), be = (t) => (t ?? []).flatMa
1061
1072
  messages: {}
1062
1073
  },
1063
1074
  setup(t) {
1064
- const e = t, s = b(() => be(e.collections));
1065
- return (o, r) => s.value.length > 0 ? (u(), _("aside", vs, [
1066
- l("div", ms, [
1067
- l("p", bs, y(e.messages.collectionsLabel), 1),
1068
- l("span", Ss, y(e.messages.collectionsCount(s.value.length)), 1)
1075
+ const e = t, s = f(() => ye(e.collections));
1076
+ return (o, r) => s.value.length > 0 ? (u(), p("aside", Es, [
1077
+ l("div", ys, [
1078
+ l("p", Is, E(e.messages.collectionsLabel), 1),
1079
+ l("span", ws, E(e.messages.collectionsCount(s.value.length)), 1)
1069
1080
  ]),
1070
- l("ul", Cs, [
1071
- (u(!0), _(N, null, W(s.value, ({ collection: n, href: a }) => (u(), _("li", {
1081
+ l("ul", $s, [
1082
+ (u(!0), p(M, null, Y(s.value, ({ collection: n, href: a }) => (u(), p("li", {
1072
1083
  key: n.objectID
1073
1084
  }, [
1074
1085
  l("a", {
1075
1086
  class: "dialog-search-collection",
1076
1087
  href: a
1077
1088
  }, [
1078
- l("span", ys, [
1079
- n.imageUrl !== void 0 && n.imageUrl !== "" ? (u(), _("img", {
1089
+ l("span", Ts, [
1090
+ n.image ? (u(), p("img", {
1080
1091
  key: 0,
1081
- src: n.imageUrl,
1092
+ src: n.image,
1082
1093
  alt: "",
1083
1094
  loading: "lazy"
1084
- }, null, 8, Is)) : L("", !0)
1095
+ }, null, 8, Rs)) : x("", !0)
1085
1096
  ]),
1086
- l("span", ws, [
1087
- T(fe, {
1088
- title: H(me)(n),
1097
+ l("span", As, [
1098
+ R(Se, {
1099
+ title: B(Ee)(n),
1089
1100
  query: e.query
1090
1101
  }, null, 8, ["title", "query"])
1091
1102
  ]),
1092
- l("span", $s, [
1093
- T(fs)
1103
+ l("span", Ls, [
1104
+ R(Cs)
1094
1105
  ])
1095
- ], 8, Es)
1106
+ ], 8, ks)
1096
1107
  ]))), 128))
1097
1108
  ])
1098
- ])) : L("", !0);
1109
+ ])) : x("", !0);
1099
1110
  }
1100
- }), Ts = { class: "dialog-search-products" }, Rs = { class: "dialog-search-section-head" }, As = { class: "dialog-search-label" }, Ls = {
1111
+ }), Ds = { class: "dialog-search-products" }, Ps = { class: "dialog-search-section-head" }, Os = { class: "dialog-search-label" }, Ns = {
1101
1112
  key: 0,
1102
1113
  class: "dialog-search-label-count"
1103
- }, xs = { class: "dialog-search-results" }, Ds = {
1114
+ }, qs = { class: "dialog-search-results" }, Ms = {
1104
1115
  key: 0,
1105
1116
  class: "dialog-search-empty",
1106
1117
  role: "status"
1107
- }, Ps = /* @__PURE__ */ I({
1118
+ }, Hs = /* @__PURE__ */ w({
1108
1119
  __name: "DialogSearchProducts",
1109
1120
  props: {
1110
1121
  controller: {},
@@ -1114,15 +1125,15 @@ const fs = /* @__PURE__ */ x(hs, [["render", gs]]), be = (t) => (t ?? []).flatMa
1114
1125
  },
1115
1126
  setup(t) {
1116
1127
  const e = t;
1117
- return (s, o) => (u(), _("section", Ts, [
1118
- l("div", Rs, [
1119
- l("p", As, [
1120
- ce(y(e.messages.productsLabel), 1),
1121
- e.response.nbHits > 0 ? (u(), _("span", Ls, " · " + y(e.messages.resultsCount(e.response.nbHits)), 1)) : L("", !0)
1128
+ return (s, o) => (u(), p("section", Ds, [
1129
+ l("div", Ps, [
1130
+ l("p", Os, [
1131
+ Z(E(e.messages.productsLabel), 1),
1132
+ e.response.nbHits > 0 ? (u(), p("span", Ns, " · " + E(e.messages.resultsCount(e.response.nbHits)), 1)) : x("", !0)
1122
1133
  ])
1123
1134
  ]),
1124
- l("ul", xs, [
1125
- e.response.hits.length === 0 ? (u(), _("li", Ds, y(e.messages.noResults), 1)) : (u(!0), _(N, { key: 1 }, W(e.response.hits, (r, n) => (u(), P(ls, {
1135
+ l("ul", qs, [
1136
+ e.response.hits.length === 0 ? (u(), p("li", Ms, E(e.messages.noResults), 1)) : (u(!0), p(M, { key: 1 }, Y(e.response.hits, (r, n) => (u(), N(hs, {
1126
1137
  key: r.objectID,
1127
1138
  controller: e.controller,
1128
1139
  hit: r,
@@ -1133,27 +1144,27 @@ const fs = /* @__PURE__ */ x(hs, [["render", gs]]), be = (t) => (t ?? []).flatMa
1133
1144
  ])
1134
1145
  ]));
1135
1146
  }
1136
- }), V = 8, U = 16, Os = 200, Ns = 1440, qs = (t, e) => t.bottom > 0 && t.top < e, Ms = (t, e) => {
1147
+ }), K = 8, V = 16, Us = 200, Vs = 1440, Bs = (t, e) => t.bottom > 0 && t.top < e, Ks = (t, e) => {
1137
1148
  const s = Math.min(
1138
- Ns,
1139
- e - 2 * U
1149
+ Vs,
1150
+ e - 2 * V
1140
1151
  ), o = t.left + t.width / 2 - s / 2;
1141
1152
  return { left: `${Math.min(
1142
- Math.max(o, U),
1143
- e - U - s
1153
+ Math.max(o, V),
1154
+ e - V - s
1144
1155
  )}px`, width: `${s}px` };
1145
- }, Us = (t, e, s) => {
1146
- const o = s - t.bottom - V - U, r = t.top - V - U, n = Ms(t, e);
1147
- return o < Os && r > o ? {
1156
+ }, Fs = (t, e, s) => {
1157
+ const o = s - t.bottom - K - V, r = t.top - K - V, n = Ks(t, e);
1158
+ return o < Us && r > o ? {
1148
1159
  ...n,
1149
- bottom: `${s - t.top + V}px`,
1160
+ bottom: `${s - t.top + K}px`,
1150
1161
  maxHeight: `${Math.max(r, 0)}px`
1151
1162
  } : {
1152
1163
  ...n,
1153
- top: `${t.bottom + V}px`,
1164
+ top: `${t.bottom + K}px`,
1154
1165
  maxHeight: `${Math.max(o, 0)}px`
1155
1166
  };
1156
- }, Hs = (t) => {
1167
+ }, zs = (t) => {
1157
1168
  const e = t.trim().replace(/^#/, "");
1158
1169
  if (!/^(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(e))
1159
1170
  return;
@@ -1161,29 +1172,29 @@ const fs = /* @__PURE__ */ x(hs, [["render", gs]]), be = (t) => (t ?? []).flatMa
1161
1172
  return [0, 2, 4].map(
1162
1173
  (o) => Number.parseInt(s.slice(o, o + 2), 16)
1163
1174
  );
1164
- }, Vs = (t) => {
1175
+ }, Gs = (t) => {
1165
1176
  const e = /^rgba?\((\d+), (\d+), (\d+)(?:, [\d.]+)?\)$/.exec(t);
1166
1177
  if (e !== null)
1167
1178
  return [e[1], e[2], e[3]].map(Number);
1168
- }, Bs = (t) => {
1179
+ }, js = (t) => {
1169
1180
  if (typeof document > "u")
1170
1181
  return;
1171
1182
  const e = document.createElement("span");
1172
1183
  if (e.style.color = t, e.style.color === "")
1173
1184
  return;
1174
1185
  document.body.appendChild(e);
1175
- const s = Vs(getComputedStyle(e).color);
1186
+ const s = Gs(getComputedStyle(e).color);
1176
1187
  return e.remove(), s;
1177
- }, Ks = (t) => Hs(t) ?? Bs(t), Fs = (t) => {
1188
+ }, Qs = (t) => zs(t) ?? js(t), Ws = (t) => {
1178
1189
  const e = t / 255;
1179
1190
  return e <= 0.03928 ? e / 12.92 : ((e + 0.055) / 1.055) ** 2.4;
1180
- }, Se = (t) => {
1181
- const e = Ks(t);
1191
+ }, Ie = (t) => {
1192
+ const e = Qs(t);
1182
1193
  if (e === void 0)
1183
1194
  return;
1184
- const [s, o, r] = e.map(Fs);
1195
+ const [s, o, r] = e.map(Ws);
1185
1196
  return 0.2126 * s + 0.7152 * o + 0.0722 * r;
1186
- }, zs = "#181825", Gs = "#ffffff", js = "straight", j = 0.5, Q = {
1197
+ }, Xs = "#181825", Ys = "#ffffff", Zs = "straight", W = 0.5, X = {
1187
1198
  light: {
1188
1199
  panel: "#ffffff",
1189
1200
  side: "#fafbfc",
@@ -1202,7 +1213,7 @@ const fs = /* @__PURE__ */ x(hs, [["render", gs]]), be = (t) => (t ?? []).flatMa
1202
1213
  hover: "#242830",
1203
1214
  thumb: "#2b2f38"
1204
1215
  }
1205
- }, Qs = {
1216
+ }, Js = {
1206
1217
  rectangle: {
1207
1218
  "r-panel": "4px",
1208
1219
  "r-item": "4px",
@@ -1215,42 +1226,42 @@ const fs = /* @__PURE__ */ x(hs, [["render", gs]]), be = (t) => (t ?? []).flatMa
1215
1226
  "r-thumb": "8px",
1216
1227
  "r-btn": "10px"
1217
1228
  }
1218
- }, B = (t) => t === void 0 || t.trim() === "" ? void 0 : t.trim(), Ws = (t) => {
1219
- const e = t === void 0 ? void 0 : Se(t);
1220
- return e === void 0 ? "light" : e < j ? "dark" : "light";
1221
- }, Xs = (t, e) => {
1222
- const s = Se(t);
1223
- return s === void 0 ? Q[e].text : (e === "light" ? s < j : s >= j) ? t : Q[e].text;
1224
- }, Ys = (t) => {
1225
- const e = Ws(B(t == null ? void 0 : t.backgroundColor)), s = (t == null ? void 0 : t.ctaBorderType) === js ? "rectangle" : "rectangle-rounded", o = B(t == null ? void 0 : t.primaryColor) ?? zs, r = B(t == null ? void 0 : t.fontFamily), n = {
1226
- ...Q[e],
1227
- ...Qs[s],
1229
+ }, F = (t) => t === void 0 || t.trim() === "" ? void 0 : t.trim(), eo = (t) => {
1230
+ const e = t === void 0 ? void 0 : Ie(t);
1231
+ return e === void 0 ? "light" : e < W ? "dark" : "light";
1232
+ }, to = (t, e) => {
1233
+ const s = Ie(t);
1234
+ return s === void 0 ? X[e].text : (e === "light" ? s < W : s >= W) ? t : X[e].text;
1235
+ }, so = (t) => {
1236
+ const e = eo(F(t == null ? void 0 : t.backgroundColor)), s = (t == null ? void 0 : t.ctaBorderType) === Zs ? "rectangle" : "rectangle-rounded", o = F(t == null ? void 0 : t.primaryColor) ?? Xs, r = F(t == null ? void 0 : t.fontFamily), n = {
1237
+ ...X[e],
1238
+ ...Js[s],
1228
1239
  primary: o,
1229
- accent: Xs(o, e),
1230
- "cta-text": B(t == null ? void 0 : t.ctaTextColor) ?? Gs,
1240
+ accent: to(o, e),
1241
+ "cta-text": F(t == null ? void 0 : t.ctaTextColor) ?? Ys,
1231
1242
  ...r === void 0 ? {} : { font: r }
1232
1243
  };
1233
1244
  return Object.fromEntries(
1234
1245
  Object.entries(n).map(([a, i]) => [`--dso-${a}`, i])
1235
1246
  );
1236
- }, Zs = (t) => {
1237
- const e = R(), s = R(void 0), o = R({ width: 0, height: 0 });
1238
- return M(
1247
+ }, oo = (t) => {
1248
+ const e = A(), s = A(void 0), o = A({ width: 0, height: 0 });
1249
+ return U(
1239
1250
  t,
1240
1251
  (r, n, a) => {
1241
1252
  if (!r)
1242
1253
  return;
1243
1254
  const i = () => {
1244
- const p = e.value;
1245
- if (p === void 0)
1255
+ const _ = e.value;
1256
+ if (_ === void 0)
1246
1257
  return;
1247
- const c = p.previousElementSibling ?? p, { top: C, bottom: d, left: f, width: v } = c.getBoundingClientRect();
1258
+ const d = _.previousElementSibling ?? _, { top: h, bottom: c, left: g, width: S } = d.getBoundingClientRect();
1248
1259
  (o.value.width !== window.innerWidth || o.value.height !== window.innerHeight) && (o.value = {
1249
1260
  width: window.innerWidth,
1250
1261
  height: window.innerHeight
1251
1262
  });
1252
- const g = s.value;
1253
- (g === void 0 || g.top !== C || g.bottom !== d || g.left !== f || g.width !== v) && (s.value = { top: C, bottom: d, left: f, width: v });
1263
+ const v = s.value;
1264
+ (v === void 0 || v.top !== h || v.bottom !== c || v.left !== g || v.width !== S) && (s.value = { top: h, bottom: c, left: g, width: S });
1254
1265
  };
1255
1266
  i(), window.addEventListener("scroll", i, !0), window.addEventListener("resize", i), a(() => {
1256
1267
  window.removeEventListener("scroll", i, !0), window.removeEventListener("resize", i);
@@ -1258,30 +1269,30 @@ const fs = /* @__PURE__ */ x(hs, [["render", gs]]), be = (t) => (t ?? []).flatMa
1258
1269
  },
1259
1270
  { immediate: !0, flush: "post" }
1260
1271
  ), { anchorRef: e, rect: s, viewport: o };
1261
- }, Js = (t, e) => {
1262
- const s = R(!1), o = R(), r = b(
1263
- () => t.value.status !== A.IDLE && !s.value
1272
+ }, no = (t, e) => {
1273
+ const s = A(!1), o = A(), r = f(
1274
+ () => t.value.status !== D.IDLE && !s.value
1264
1275
  );
1265
- M(
1276
+ U(
1266
1277
  () => t.value.query,
1267
1278
  () => {
1268
1279
  s.value = !1;
1269
1280
  }
1270
- ), M(
1281
+ ), U(
1271
1282
  r,
1272
- (a, i, p) => {
1283
+ (a, i, _) => {
1273
1284
  if (!a)
1274
1285
  return;
1275
- const c = (C) => {
1276
- var w, $;
1277
- const d = C.target;
1278
- if (!(d instanceof Node))
1286
+ const d = (h) => {
1287
+ var $, k;
1288
+ const c = h.target;
1289
+ if (!(c instanceof Node))
1279
1290
  return;
1280
- const f = (w = e.value) == null ? void 0 : w.previousElementSibling, v = (($ = o.value) == null ? void 0 : $.contains(d)) ?? !1, g = (f == null ? void 0 : f.contains(d)) ?? !1;
1281
- !v && !g && (s.value = !0);
1291
+ const g = ($ = e.value) == null ? void 0 : $.previousElementSibling, S = ((k = o.value) == null ? void 0 : k.contains(c)) ?? !1, v = (g == null ? void 0 : g.contains(c)) ?? !1;
1292
+ !S && !v && (s.value = !0);
1282
1293
  };
1283
- document.addEventListener("pointerdown", c), p(
1284
- () => document.removeEventListener("pointerdown", c)
1294
+ document.addEventListener("pointerdown", d), _(
1295
+ () => document.removeEventListener("pointerdown", d)
1285
1296
  );
1286
1297
  },
1287
1298
  { immediate: !0 }
@@ -1289,33 +1300,33 @@ const fs = /* @__PURE__ */ x(hs, [["render", gs]]), be = (t) => (t ?? []).flatMa
1289
1300
  const n = () => {
1290
1301
  s.value = !1;
1291
1302
  };
1292
- return K(() => {
1303
+ return z(() => {
1293
1304
  var a, i;
1294
1305
  (i = (a = e.value) == null ? void 0 : a.previousElementSibling) == null || i.addEventListener(
1295
1306
  "focusin",
1296
1307
  n
1297
1308
  );
1298
- }), de(() => {
1309
+ }), pe(() => {
1299
1310
  var a, i;
1300
1311
  (i = (a = e.value) == null ? void 0 : a.previousElementSibling) == null || i.removeEventListener(
1301
1312
  "focusin",
1302
1313
  n
1303
1314
  );
1304
1315
  }), { isOpen: r, panelRef: o };
1305
- }, eo = {
1316
+ }, ro = {
1306
1317
  key: 0,
1307
1318
  class: "dialog-search-error"
1308
- }, to = {
1319
+ }, io = {
1309
1320
  role: "alert",
1310
1321
  class: "dialog-search-status dialog-search-status-error"
1311
- }, so = {
1322
+ }, ao = {
1312
1323
  key: 1,
1313
1324
  role: "status",
1314
1325
  class: "dialog-search-status"
1315
- }, oo = {
1326
+ }, lo = {
1316
1327
  key: 0,
1317
1328
  class: "dialog-search-footer"
1318
- }, no = ["href"], co = /* @__PURE__ */ I({
1329
+ }, co = ["href"], go = /* @__PURE__ */ w({
1319
1330
  __name: "DialogSearchResults",
1320
1331
  props: {
1321
1332
  controller: {},
@@ -1326,114 +1337,114 @@ const fs = /* @__PURE__ */ x(hs, [["render", gs]]), be = (t) => (t ?? []).flatMa
1326
1337
  seeAllHref: { type: Function, default: void 0 }
1327
1338
  },
1328
1339
  setup(t) {
1329
- const e = t, s = (h) => h instanceof Ne ? `Search failed (${h.status}${h.code ? ` ${h.code}` : ""}): ${h.message}` : "Search failed: network error. Check your connection and try again.", o = b(() => e.state), r = b(() => e.state.status !== A.IDLE), { anchorRef: n, rect: a, viewport: i } = Zs(r), { isOpen: p, panelRef: c } = Js(o, n), C = b(
1330
- () => p.value && a.value !== void 0 && qs(a.value, i.value.height)
1331
- ), d = b(() => Ys(e.theme)), f = b(() => ({
1332
- ...a.value === void 0 ? {} : Us(a.value, i.value.width, i.value.height),
1333
- ...d.value
1334
- })), v = b(() => _e(e.locale)), g = b(() => e.state.response), w = b(
1340
+ const e = t, s = (y) => y instanceof Ue ? `Search failed (${y.status}${y.code ? ` ${y.code}` : ""}): ${y.message}` : "Search failed: network error. Check your connection and try again.", o = f(() => e.state), r = f(() => e.state.status !== D.IDLE), { anchorRef: n, rect: a, viewport: i } = oo(r), { isOpen: _, panelRef: d } = no(o, n), h = f(
1341
+ () => _.value && a.value !== void 0 && Bs(a.value, i.value.height)
1342
+ ), c = f(() => so(e.theme)), g = f(() => ({
1343
+ ...a.value === void 0 ? {} : Fs(a.value, i.value.width, i.value.height),
1344
+ ...c.value
1345
+ })), S = f(() => me(e.locale)), v = f(() => e.state.response), $ = f(
1335
1346
  () => {
1336
- var h, E;
1337
- return ((E = (h = e.state.sections) == null ? void 0 : h.collections) == null ? void 0 : E.hits) ?? [];
1347
+ var y, L;
1348
+ return ((L = (y = e.state.sections) == null ? void 0 : y.collections) == null ? void 0 : L.hits) ?? [];
1338
1349
  }
1339
- ), $ = b(
1340
- () => be(w.value).length > 0
1341
- ), k = b(
1342
- () => e.seeAllHref !== void 0 && g.value !== void 0 && g.value.nbHits > 0
1343
- ), S = b(() => !k.value && ge(e.state)), m = b(
1350
+ ), k = f(
1351
+ () => ye($.value).length > 0
1352
+ ), T = f(
1353
+ () => e.seeAllHref !== void 0 && v.value !== void 0 && v.value.nbHits > 0
1354
+ ), m = f(() => !T.value && be(e.state)), C = f(
1344
1355
  () => {
1345
- var h;
1346
- return g.value === void 0 || (h = e.seeAllHref) == null ? void 0 : h.call(e, g.value.query);
1356
+ var y;
1357
+ return v.value === void 0 || (y = e.seeAllHref) == null ? void 0 : y.call(e, v.value.query);
1347
1358
  }
1348
1359
  );
1349
- return (h, E) => (u(), _(N, null, [
1360
+ return (y, L) => (u(), p(M, null, [
1350
1361
  l("div", {
1351
1362
  ref_key: "anchorRef",
1352
1363
  ref: n
1353
1364
  }, null, 512),
1354
- C.value ? (u(), P(Ae, {
1365
+ h.value ? (u(), N(Pe, {
1355
1366
  key: 0,
1356
1367
  to: "body"
1357
1368
  }, [
1358
1369
  l("div", {
1359
1370
  ref_key: "panelRef",
1360
- ref: c,
1361
- class: Z(["dialog-search-panel", `dialog-search-panel--${e.layout}`]),
1362
- style: Le(f.value)
1371
+ ref: d,
1372
+ class: te(["dialog-search-panel", `dialog-search-panel--${e.layout}`]),
1373
+ style: Oe(g.value)
1363
1374
  }, [
1364
- e.state.status === H(A).ERROR ? (u(), _("div", eo, [
1365
- l("p", to, y(s(e.state.error)), 1),
1375
+ e.state.status === B(D).ERROR ? (u(), p("div", ro, [
1376
+ l("p", io, E(s(e.state.error)), 1),
1366
1377
  l("button", {
1367
1378
  type: "button",
1368
1379
  class: "dialog-search-retry",
1369
- onClick: E[0] || (E[0] = (O) => e.controller.retry())
1370
- }, y(v.value.retry), 1)
1371
- ])) : g.value === void 0 ? (u(), _("p", so, y(v.value.searching(e.state.query)), 1)) : (u(), _(N, { key: 2 }, [
1380
+ onClick: L[0] || (L[0] = (b) => e.controller.retry())
1381
+ }, E(S.value.retry), 1)
1382
+ ])) : v.value === void 0 ? (u(), p("p", ao, E(S.value.searching(e.state.query)), 1)) : (u(), p(M, { key: 2 }, [
1372
1383
  l("div", {
1373
- class: Z([
1384
+ class: te([
1374
1385
  "dialog-search-body",
1375
- { "dialog-search-body--no-collections": !$.value }
1386
+ { "dialog-search-body--no-collections": !k.value }
1376
1387
  ])
1377
1388
  }, [
1378
- T(ks, {
1379
- collections: w.value,
1380
- query: g.value.query,
1381
- messages: v.value
1389
+ R(xs, {
1390
+ collections: $.value,
1391
+ query: v.value.query,
1392
+ messages: S.value
1382
1393
  }, null, 8, ["collections", "query", "messages"]),
1383
- T(Ps, {
1394
+ R(Hs, {
1384
1395
  controller: e.controller,
1385
- response: g.value,
1396
+ response: v.value,
1386
1397
  locale: e.locale,
1387
- messages: v.value
1398
+ messages: S.value
1388
1399
  }, null, 8, ["controller", "response", "locale", "messages"])
1389
1400
  ], 2),
1390
- k.value || S.value ? (u(), _("div", oo, [
1391
- k.value ? (u(), _("a", {
1401
+ T.value || m.value ? (u(), p("div", lo, [
1402
+ T.value ? (u(), p("a", {
1392
1403
  key: 0,
1393
1404
  class: "dialog-search-cta",
1394
- href: m.value
1405
+ href: C.value
1395
1406
  }, [
1396
- ce(y(v.value.seeAllLabel(g.value.nbHits)) + " ", 1),
1397
- T(ps)
1398
- ], 8, no)) : (u(), P(Xt, {
1407
+ Z(E(S.value.seeAllLabel(v.value.nbHits)) + " ", 1),
1408
+ R(vs)
1409
+ ], 8, co)) : (u(), N(ts, {
1399
1410
  key: 1,
1400
1411
  controller: e.controller,
1401
1412
  state: e.state,
1402
1413
  locale: e.locale
1403
1414
  }, null, 8, ["controller", "state", "locale"]))
1404
- ])) : L("", !0)
1415
+ ])) : x("", !0)
1405
1416
  ], 64))
1406
1417
  ], 6)
1407
- ])) : L("", !0)
1418
+ ])) : x("", !0)
1408
1419
  ], 64));
1409
1420
  }
1410
- }), uo = (t) => {
1411
- const { client: e, surface: s = "search_page", ...o } = t, r = Xe({
1412
- search: (i, p) => e.search(i, p),
1421
+ }), fo = (t) => {
1422
+ const { client: e, surface: s = "search_page", ...o } = t, r = et({
1423
+ search: (i, _) => e.search(i, _),
1413
1424
  analytics: {
1414
1425
  surface: s,
1415
1426
  trackViewSearchResults: (i) => e.trackViewSearchResults(i),
1416
1427
  trackSelectSearchResult: (i) => e.trackSelectSearchResult(i)
1417
1428
  },
1418
1429
  ...o
1419
- }), n = xe(r.getState()), a = r.subscribe(() => {
1430
+ }), n = Ne(r.getState()), a = r.subscribe(() => {
1420
1431
  n.value = r.getState();
1421
1432
  });
1422
- return K(() => {
1423
- pe({
1433
+ return z(() => {
1434
+ _e({
1424
1435
  method: "vue",
1425
- version: "3.10.0"
1436
+ version: "3.11.0"
1426
1437
  });
1427
- }), de(() => {
1438
+ }), pe(() => {
1428
1439
  a(), r.dispose();
1429
1440
  }), { controller: r, state: n, theme: e.theme };
1430
1441
  };
1431
1442
  export {
1432
- Tt as DialogInput,
1433
- ao as DialogProductBlock,
1434
- lo as DialogSearchBar,
1435
- Xt as DialogSearchPagination,
1436
- ls as DialogSearchProductCard,
1437
- co as DialogSearchResults,
1438
- uo as useDialogSearch
1443
+ Dt as DialogInput,
1444
+ ho as DialogProductBlock,
1445
+ _o as DialogSearchBar,
1446
+ ts as DialogSearchPagination,
1447
+ hs as DialogSearchProductCard,
1448
+ go as DialogSearchResults,
1449
+ fo as useDialogSearch
1439
1450
  };