@colabcommerce/elements 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,652 @@
1
+ import { jsx as r, jsxs as d, Fragment as Me } from "react/jsx-runtime";
2
+ import * as E from "react";
3
+ import $, { useState as C, useLayoutEffect as Ie, useEffect as H, useMemo as ne, useRef as ce, useCallback as $e, Suspense as Ce } from "react";
4
+ import { a as x, b as xe, c as n, d as U, j as A, k as T, T as Ee, l as He, t as Te, E as ie, m as je, n as De, o as We, C as V, R as oe, I as ke, i as Be, h as Re } from "./globals-D3YPIcjZ.js";
5
+ import { C as Pe, u as j, L as Ae, d as ze, l as Fe, a as Le, S as Ue, b as Ge, c as Qe, e as Je, f as Ke } from "./index-BComOHrk.js";
6
+ import { S as Ze } from "./index-Dv5Y39GK.js";
7
+ import { A as Ve, d as Xe, u as Ye, a as qe, B as et, F as tt, b as rt, g as st, M as at } from "./index-Ot1CirR6.js";
8
+ const nt = "-E4vU", ct = "Y9kow", it = "x0-tL", ot = "XBGE-", lt = "oUgyZ", dt = "_5xvIm", mt = "yR8v8", pt = "-FfTB", ut = "mPv4I", ht = "DizAj", ft = "pL7JB", gt = "uUoP0", v = {
9
+ wrapper: nt,
10
+ title: ct,
11
+ hours: it,
12
+ open: ot,
13
+ closed: lt,
14
+ soon: dt,
15
+ subHoursWrapper: mt,
16
+ subHours: pt,
17
+ today: ut,
18
+ toggle: ht,
19
+ shown: ft,
20
+ shownHours: gt
21
+ }, vt = ({ i: e, hour: t }) => {
22
+ const { t: s, locale: a } = x(), i = /* @__PURE__ */ new Date();
23
+ i.setUTCHours(t.open_at_hour - t.utc_offset_minute / 60, t.open_at_minute, 0, 0);
24
+ const c = /* @__PURE__ */ new Date();
25
+ c.setUTCHours(t.close_at_hour - t.utc_offset_minute / 60, t.close_at_minute, 0, 0);
26
+ const p = i.getUTCMinutes() === 0 ? new Intl.DateTimeFormat(a, { hour: "numeric" }) : new Intl.DateTimeFormat(a, { hour: "numeric", minute: "2-digit" }), l = c.getUTCMinutes() === 0 ? new Intl.DateTimeFormat(a, { hour: "numeric" }) : new Intl.DateTimeFormat(a, { hour: "numeric", minute: "2-digit" });
27
+ return /* @__PURE__ */ d("div", { className: `${v.subHours} ${t.day === (/* @__PURE__ */ new Date()).getDay() ? v.today : ""}`, children: [
28
+ /* @__PURE__ */ r("div", { children: s(`store.days.${t.day}`) }),
29
+ /* @__PURE__ */ d("div", { children: [
30
+ p.format(i),
31
+ " - ",
32
+ l.format(c)
33
+ ] })
34
+ ] }, t.day);
35
+ }, wt = ({ hours: e, defaultOpen: t = !1 }) => {
36
+ const { t: s, locale: a } = x(), { isOpen: i, openingSoon: c, closingSoon: p, openAt: l, closeAt: o, openFormatter: m, closeAtFormatter: h } = xe(e), [g, N] = C(t), y = (/* @__PURE__ */ new Date()).getDay();
37
+ if (!(e == null ? void 0 : e.find((b) => b.day === y))) return null;
38
+ const D = i, W = e.sort((b, M) => b.day - M.day);
39
+ let O = null, S = null;
40
+ return D ? p ? (S = n(v.hours, v.soon), O = /* @__PURE__ */ r("span", { children: s("store.closingSoon") })) : (S = n(v.hours, v.open), O = /* @__PURE__ */ r("span", { children: s("store.openNow") })) : c ? (S = n(v.hours, v.soon), O = /* @__PURE__ */ r("span", { children: s("store.openingSoon") })) : (S = n(v.hours, v.closed), O = /* @__PURE__ */ r("span", { children: s("store.closedNow") })), /* @__PURE__ */ d("div", { className: g ? n(v.wrapper, v.shown) : n(v.wrapper), children: [
41
+ /* @__PURE__ */ d("div", { className: n(v.title), onClick: () => N(!g), children: [
42
+ /* @__PURE__ */ d("span", { className: S, children: [
43
+ /* @__PURE__ */ r("i", { className: "lpe-icons", children: "clock" }),
44
+ O
45
+ ] }),
46
+ /* @__PURE__ */ d("span", { className: v.shownHours, children: [
47
+ m.format(l),
48
+ " - ",
49
+ h.format(o)
50
+ ] }),
51
+ /* @__PURE__ */ r("i", { className: n("lpe-icons", v.toggle), children: "arrow" })
52
+ ] }),
53
+ /* @__PURE__ */ r(Pe, { in: g, children: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r("div", { className: n(v.subHoursWrapper), children: W.map((b, M) => /* @__PURE__ */ r(vt, { i: M, hour: b }, b.day)) }) }) })
54
+ ] });
55
+ };
56
+ var le = {
57
+ color: void 0,
58
+ size: void 0,
59
+ className: void 0,
60
+ style: void 0,
61
+ attr: void 0
62
+ }, ee = $.createContext && /* @__PURE__ */ $.createContext(le), Nt = ["attr", "size", "title"];
63
+ function yt(e, t) {
64
+ if (e == null) return {};
65
+ var s = bt(e, t), a, i;
66
+ if (Object.getOwnPropertySymbols) {
67
+ var c = Object.getOwnPropertySymbols(e);
68
+ for (i = 0; i < c.length; i++)
69
+ a = c[i], !(t.indexOf(a) >= 0) && Object.prototype.propertyIsEnumerable.call(e, a) && (s[a] = e[a]);
70
+ }
71
+ return s;
72
+ }
73
+ function bt(e, t) {
74
+ if (e == null) return {};
75
+ var s = {};
76
+ for (var a in e)
77
+ if (Object.prototype.hasOwnProperty.call(e, a)) {
78
+ if (t.indexOf(a) >= 0) continue;
79
+ s[a] = e[a];
80
+ }
81
+ return s;
82
+ }
83
+ function F() {
84
+ return F = Object.assign ? Object.assign.bind() : function(e) {
85
+ for (var t = 1; t < arguments.length; t++) {
86
+ var s = arguments[t];
87
+ for (var a in s)
88
+ Object.prototype.hasOwnProperty.call(s, a) && (e[a] = s[a]);
89
+ }
90
+ return e;
91
+ }, F.apply(this, arguments);
92
+ }
93
+ function te(e, t) {
94
+ var s = Object.keys(e);
95
+ if (Object.getOwnPropertySymbols) {
96
+ var a = Object.getOwnPropertySymbols(e);
97
+ t && (a = a.filter(function(i) {
98
+ return Object.getOwnPropertyDescriptor(e, i).enumerable;
99
+ })), s.push.apply(s, a);
100
+ }
101
+ return s;
102
+ }
103
+ function L(e) {
104
+ for (var t = 1; t < arguments.length; t++) {
105
+ var s = arguments[t] != null ? arguments[t] : {};
106
+ t % 2 ? te(Object(s), !0).forEach(function(a) {
107
+ _t(e, a, s[a]);
108
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(s)) : te(Object(s)).forEach(function(a) {
109
+ Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(s, a));
110
+ });
111
+ }
112
+ return e;
113
+ }
114
+ function _t(e, t, s) {
115
+ return t = Ot(t), t in e ? Object.defineProperty(e, t, { value: s, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = s, e;
116
+ }
117
+ function Ot(e) {
118
+ var t = St(e, "string");
119
+ return typeof t == "symbol" ? t : t + "";
120
+ }
121
+ function St(e, t) {
122
+ if (typeof e != "object" || !e) return e;
123
+ var s = e[Symbol.toPrimitive];
124
+ if (s !== void 0) {
125
+ var a = s.call(e, t);
126
+ if (typeof a != "object") return a;
127
+ throw new TypeError("@@toPrimitive must return a primitive value.");
128
+ }
129
+ return (t === "string" ? String : Number)(e);
130
+ }
131
+ function de(e) {
132
+ return e && e.map((t, s) => /* @__PURE__ */ $.createElement(t.tag, L({
133
+ key: s
134
+ }, t.attr), de(t.child)));
135
+ }
136
+ function Mt(e) {
137
+ return (t) => /* @__PURE__ */ $.createElement(It, F({
138
+ attr: L({}, e.attr)
139
+ }, t), de(e.child));
140
+ }
141
+ function It(e) {
142
+ var t = (s) => {
143
+ var {
144
+ attr: a,
145
+ size: i,
146
+ title: c
147
+ } = e, p = yt(e, Nt), l = i || s.size || "1em", o;
148
+ return s.className && (o = s.className), e.className && (o = (o ? o + " " : "") + e.className), /* @__PURE__ */ $.createElement("svg", F({
149
+ stroke: "currentColor",
150
+ fill: "currentColor",
151
+ strokeWidth: "0"
152
+ }, s.attr, a, p, {
153
+ className: o,
154
+ style: L(L({
155
+ color: e.color || s.color
156
+ }, s.style), e.style),
157
+ height: l,
158
+ width: l,
159
+ xmlns: "http://www.w3.org/2000/svg"
160
+ }), c && /* @__PURE__ */ $.createElement("title", null, c), e.children);
161
+ };
162
+ return ee !== void 0 ? /* @__PURE__ */ $.createElement(ee.Consumer, null, (s) => t(s)) : t(le);
163
+ }
164
+ function $t(e) {
165
+ return Mt({ attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M20 2H4c-1.1 0-1.99.9-1.99 2L2 22l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-2 12H6v-2h12v2zm0-3H6V9h12v2zm0-3H6V6h12v2z" }, child: [] }] })(e);
166
+ }
167
+ /**
168
+ * @license lucide-react v0.542.0 - ISC
169
+ *
170
+ * This source code is licensed under the ISC license.
171
+ * See the LICENSE file in the root directory of this source tree.
172
+ */
173
+ const Ct = [
174
+ ["path", { d: "m15 14 5-5-5-5", key: "12vg1m" }],
175
+ ["path", { d: "M4 20v-7a4 4 0 0 1 4-4h12", key: "1lu4f8" }]
176
+ ], xt = U("corner-up-right", Ct);
177
+ /**
178
+ * @license lucide-react v0.542.0 - ISC
179
+ *
180
+ * This source code is licensed under the ISC license.
181
+ * See the LICENSE file in the root directory of this source tree.
182
+ */
183
+ const Et = [
184
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
185
+ ["path", { d: "M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20", key: "13o1zl" }],
186
+ ["path", { d: "M2 12h20", key: "9i4pu4" }]
187
+ ], Ht = U("globe", Et);
188
+ /**
189
+ * @license lucide-react v0.542.0 - ISC
190
+ *
191
+ * This source code is licensed under the ISC license.
192
+ * See the LICENSE file in the root directory of this source tree.
193
+ */
194
+ const Tt = [
195
+ [
196
+ "path",
197
+ {
198
+ d: "M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",
199
+ key: "18887p"
200
+ }
201
+ ],
202
+ ["path", { d: "M7 11h10", key: "1twpyw" }],
203
+ ["path", { d: "M7 15h6", key: "d9of3u" }],
204
+ ["path", { d: "M7 7h8", key: "af5zfr" }]
205
+ ], jt = U("message-square-text", Tt);
206
+ /**
207
+ * @license lucide-react v0.542.0 - ISC
208
+ *
209
+ * This source code is licensed under the ISC license.
210
+ * See the LICENSE file in the root directory of this source tree.
211
+ */
212
+ const Dt = [
213
+ [
214
+ "path",
215
+ {
216
+ d: "M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",
217
+ key: "9njp5v"
218
+ }
219
+ ]
220
+ ], Wt = U("phone", Dt), kt = typeof global < "u" && // @ts-ignore
221
+ global.navigator && // @ts-ignore
222
+ global.navigator.product === "ReactNative", Bt = typeof document < "u", Rt = Bt || kt ? Ie : H, Z = /* @__PURE__ */ new WeakMap(), re = (e, t) => {
223
+ if (!e || !t) return;
224
+ const s = Z.get(t) || /* @__PURE__ */ new Map();
225
+ Z.set(t, s);
226
+ let a = s.get(e);
227
+ return a || (a = t.matchMedia(e), a.refCount = 0, s.set(a.media, a)), a;
228
+ };
229
+ function Pt(e, t = typeof window > "u" ? void 0 : window) {
230
+ const s = re(e, t), [a, i] = C(() => s ? s.matches : !1);
231
+ return Rt(() => {
232
+ let c = re(e, t);
233
+ if (!c)
234
+ return i(!1);
235
+ let p = Z.get(t);
236
+ const l = () => {
237
+ i(c.matches);
238
+ };
239
+ return c.refCount++, c.addListener(l), l(), () => {
240
+ c.removeListener(l), c.refCount--, c.refCount <= 0 && (p == null || p.delete(c.media)), c = void 0;
241
+ };
242
+ }, [e]), a;
243
+ }
244
+ function At(e) {
245
+ const t = Object.keys(e);
246
+ function s(l, o) {
247
+ return l === o ? o : l ? `${l} and ${o}` : o;
248
+ }
249
+ function a(l) {
250
+ return t[Math.min(t.indexOf(l) + 1, t.length - 1)];
251
+ }
252
+ function i(l) {
253
+ const o = a(l);
254
+ let m = e[o];
255
+ return typeof m == "number" ? m = `${m - 0.2}px` : m = `calc(${m} - 0.2px)`, `(max-width: ${m})`;
256
+ }
257
+ function c(l) {
258
+ let o = e[l];
259
+ return typeof o == "number" && (o = `${o}px`), `(min-width: ${o})`;
260
+ }
261
+ function p(l, o, m) {
262
+ let h;
263
+ typeof l == "object" ? (h = l, m = o, o = !0) : (o = o || !0, h = {
264
+ [l]: o
265
+ });
266
+ let g = ne(() => Object.entries(h).reduce((N, [w, y]) => ((y === "up" || y === !0) && (N = s(N, c(w))), (y === "down" || y === !0) && (N = s(N, i(w))), N), ""), [JSON.stringify(h)]);
267
+ return Pt(g, m);
268
+ }
269
+ return p;
270
+ }
271
+ const zt = At({
272
+ xs: 0,
273
+ sm: 576,
274
+ md: 768,
275
+ lg: 992,
276
+ xl: 1200,
277
+ xxl: 1400
278
+ }), me = /* @__PURE__ */ E.forwardRef(({
279
+ className: e,
280
+ bsPrefix: t,
281
+ as: s = "div",
282
+ ...a
283
+ }, i) => (t = A(t, "offcanvas-body"), /* @__PURE__ */ r(s, {
284
+ ref: i,
285
+ className: T(e, t),
286
+ ...a
287
+ })));
288
+ me.displayName = "OffcanvasBody";
289
+ const Ft = {
290
+ [ie]: "show",
291
+ [De]: "show"
292
+ }, pe = /* @__PURE__ */ E.forwardRef(({
293
+ bsPrefix: e,
294
+ className: t,
295
+ children: s,
296
+ in: a = !1,
297
+ mountOnEnter: i = !1,
298
+ unmountOnExit: c = !1,
299
+ appear: p = !1,
300
+ ...l
301
+ }, o) => (e = A(e, "offcanvas"), /* @__PURE__ */ r(Ee, {
302
+ ref: o,
303
+ addEndListener: Te,
304
+ in: a,
305
+ mountOnEnter: i,
306
+ unmountOnExit: c,
307
+ appear: p,
308
+ ...l,
309
+ childRef: He(s),
310
+ children: (m, h) => /* @__PURE__ */ E.cloneElement(s, {
311
+ ...h,
312
+ className: T(t, s.props.className, (m === ie || m === je) && `${e}-toggling`, Ft[m])
313
+ })
314
+ })));
315
+ pe.displayName = "OffcanvasToggling";
316
+ const ue = /* @__PURE__ */ E.forwardRef(({
317
+ bsPrefix: e,
318
+ className: t,
319
+ closeLabel: s = "Close",
320
+ closeButton: a = !1,
321
+ ...i
322
+ }, c) => (e = A(e, "offcanvas-header"), /* @__PURE__ */ r(Ve, {
323
+ ref: c,
324
+ ...i,
325
+ className: T(t, e),
326
+ closeLabel: s,
327
+ closeButton: a
328
+ })));
329
+ ue.displayName = "OffcanvasHeader";
330
+ const Lt = Xe("h5"), he = /* @__PURE__ */ E.forwardRef(({
331
+ className: e,
332
+ bsPrefix: t,
333
+ as: s = Lt,
334
+ ...a
335
+ }, i) => (t = A(t, "offcanvas-title"), /* @__PURE__ */ r(s, {
336
+ ref: i,
337
+ className: T(e, t),
338
+ ...a
339
+ })));
340
+ he.displayName = "OffcanvasTitle";
341
+ function Ut(e) {
342
+ return /* @__PURE__ */ r(pe, {
343
+ ...e
344
+ });
345
+ }
346
+ function Gt(e) {
347
+ return /* @__PURE__ */ r(tt, {
348
+ ...e
349
+ });
350
+ }
351
+ const fe = /* @__PURE__ */ E.forwardRef(({
352
+ bsPrefix: e,
353
+ className: t,
354
+ children: s,
355
+ "aria-labelledby": a,
356
+ placement: i = "start",
357
+ responsive: c,
358
+ /* BaseModal props */
359
+ show: p = !1,
360
+ backdrop: l = !0,
361
+ keyboard: o = !0,
362
+ scroll: m = !1,
363
+ onEscapeKeyDown: h,
364
+ onShow: g,
365
+ onHide: N,
366
+ container: w,
367
+ autoFocus: y = !0,
368
+ enforceFocus: G = !0,
369
+ restoreFocus: D = !0,
370
+ restoreFocusOptions: W,
371
+ onEntered: O,
372
+ onExit: S,
373
+ onExiting: b,
374
+ onEnter: M,
375
+ onEntering: z,
376
+ onExited: k,
377
+ backdropClassName: B,
378
+ manager: I,
379
+ renderStaticNode: ge = !1,
380
+ ...ve
381
+ }, we) => {
382
+ const Q = ce();
383
+ e = A(e, "offcanvas");
384
+ const [X, Ne] = C(!1), J = Ye(N), Y = zt(c || "xs", "up");
385
+ H(() => {
386
+ Ne(c ? p && !Y : p);
387
+ }, [p, c, Y]);
388
+ const ye = ne(() => ({
389
+ onHide: J
390
+ }), [J]);
391
+ function be() {
392
+ return I || (m ? (Q.current || (Q.current = new rt({
393
+ handleContainerOverflow: !1
394
+ })), Q.current) : st());
395
+ }
396
+ const _e = (_, ...K) => {
397
+ _ && (_.style.visibility = "visible"), M == null || M(_, ...K);
398
+ }, Oe = (_, ...K) => {
399
+ _ && (_.style.visibility = ""), k == null || k(...K);
400
+ }, Se = $e((_) => /* @__PURE__ */ r("div", {
401
+ ..._,
402
+ className: T(`${e}-backdrop`, B)
403
+ }), [B, e]), q = (_) => /* @__PURE__ */ r("div", {
404
+ ..._,
405
+ ...ve,
406
+ className: T(t, c ? `${e}-${c}` : e, `${e}-${i}`),
407
+ "aria-labelledby": a,
408
+ children: s
409
+ });
410
+ return /* @__PURE__ */ d(Me, {
411
+ children: [!X && (c || ge) && q({}), /* @__PURE__ */ r(qe.Provider, {
412
+ value: ye,
413
+ children: /* @__PURE__ */ r(et, {
414
+ show: X,
415
+ ref: we,
416
+ backdrop: l,
417
+ container: w,
418
+ keyboard: o,
419
+ autoFocus: y,
420
+ enforceFocus: G && !m,
421
+ restoreFocus: D,
422
+ restoreFocusOptions: W,
423
+ onEscapeKeyDown: h,
424
+ onShow: g,
425
+ onHide: J,
426
+ onEnter: _e,
427
+ onEntering: z,
428
+ onEntered: O,
429
+ onExit: S,
430
+ onExiting: b,
431
+ onExited: Oe,
432
+ manager: be(),
433
+ transition: Ut,
434
+ backdropTransition: Gt,
435
+ renderBackdrop: Se,
436
+ renderDialog: q
437
+ })
438
+ })]
439
+ });
440
+ });
441
+ fe.displayName = "Offcanvas";
442
+ const se = Object.assign(fe, {
443
+ Body: me,
444
+ Header: ue,
445
+ Title: he
446
+ }), Qt = () => {
447
+ const { t: e } = x(), { locationName: t, setLocationName: s, setSearchCenter: a, setMapCenter: i, setShowFilters: c, setLoadingGeo: p, getPosition: l } = j(), o = ce(null), [m, h] = C(null), g = We("places");
448
+ return H(() => {
449
+ if (!g || !o.current) return;
450
+ const w = {
451
+ fields: ["geometry", "name", "formatted_address"]
452
+ };
453
+ h(new g.Autocomplete(o.current, w));
454
+ }, [g]), H(() => {
455
+ m && m.addListener("place_changed", () => {
456
+ const w = m.getPlace();
457
+ if (!w.geometry) {
458
+ console.log("Returned place contains no geometry");
459
+ return;
460
+ }
461
+ const y = { lat: w.geometry.location.lat(), lng: w.geometry.location.lng() };
462
+ i(y), a(y), s(w.formatted_address);
463
+ });
464
+ }, [m, s]), /* @__PURE__ */ r(Ae, { locationName: t, setLocationName: s, setSearchCenter: a, setMapCenter: i, handleLocate: () => {
465
+ p(!0), l();
466
+ } });
467
+ }, Jt = "_0KWD0", Kt = "g3FBG", Zt = "CLUyb", Vt = "BIswH", Xt = "-m7UC", Yt = "-q7GQ", qt = "YbQl1", er = "N8xLz", tr = "I-G0P", rr = "OuZOS", sr = "WA4AC", f = {
468
+ wrapper: Jt,
469
+ selected: Kt,
470
+ nameWrapper: Zt,
471
+ distance: Vt,
472
+ name: Xt,
473
+ address: Yt,
474
+ interactWrapper: qt,
475
+ interactItem: er,
476
+ interactIcon: tr,
477
+ interactText: rr,
478
+ addressWrapper: sr
479
+ }, ar = ({ id: e, location: t, dismissable: s }) => {
480
+ var b, M, z, k, B;
481
+ const { selectedLocation: a, searchCenter: i, showDetails: c, setShowDetails: p, setMessageModalOpen: l, setSelectedLocationId: o } = j(), { t: m, i18n: h } = x(), g = h == null ? void 0 : h.language;
482
+ console.log("locale:", g);
483
+ const [N, w] = C(!1), [y, G] = C(!1), D = () => {
484
+ l(!0);
485
+ }, W = () => {
486
+ o(e);
487
+ const I = new URLSearchParams(window.location.search);
488
+ I.set("location", e), window.history.replaceState({}, "", `?${I.toString()}`);
489
+ }, O = (I) => {
490
+ N || (I.preventDefault(), w(!0));
491
+ }, S = Math.round(ze({ lat: (b = t == null ? void 0 : t.address) == null ? void 0 : b.latitude, lng: (M = t == null ? void 0 : t.address) == null ? void 0 : M.longitude }, i) * 10) / 10;
492
+ return /* @__PURE__ */ d("div", { onClick: W, className: `${f.wrapper} ${e === (a == null ? void 0 : a.id) ? n(f.selected) : ""}`, children: [
493
+ /* @__PURE__ */ d("section", { className: n(f.nameWrapper), children: [
494
+ /* @__PURE__ */ d("div", { className: n(f.name), children: [
495
+ t == null ? void 0 : t.retailer_name,
496
+ /* @__PURE__ */ d("div", { className: `text-muted fw-normal mt-1 ${f.distance}`, children: [
497
+ Math.round(Le(S, g) * 10) / 10,
498
+ " ",
499
+ Fe(g),
500
+ " away"
501
+ ] })
502
+ ] }),
503
+ /* @__PURE__ */ r("div", { className: "text-end d-flex align-items-center justify-content-end", children: /* @__PURE__ */ r(Ue, { type: t == null ? void 0 : t.store_type }) })
504
+ ] }),
505
+ /* @__PURE__ */ r("section", { className: `${f.hoursWrapper} d-flex justify-content-between align-items-center pe-3`, children: /* @__PURE__ */ r(Ge, { hours: t == null ? void 0 : t.retailer_location_hours }) }),
506
+ /* @__PURE__ */ r("section", { className: n(f.addressWrapper), children: /* @__PURE__ */ d("div", { className: n(f.address), children: [
507
+ /* @__PURE__ */ r("div", { children: t == null ? void 0 : t.address.street_line_one }),
508
+ /* @__PURE__ */ r("div", { children: t == null ? void 0 : t.address.street_line_two }),
509
+ /* @__PURE__ */ d("div", { children: [
510
+ t == null ? void 0 : t.address.city,
511
+ ", ",
512
+ t == null ? void 0 : t.address.province,
513
+ " ",
514
+ t == null ? void 0 : t.address.postal_code
515
+ ] }),
516
+ /* @__PURE__ */ r("div", { className: "d-none", children: t == null ? void 0 : t.address.country })
517
+ ] }) }),
518
+ /* @__PURE__ */ d("section", { className: n(f.interactWrapper), children: [
519
+ (t == null ? void 0 : t.phone_number) && /* @__PURE__ */ d("a", { href: `tel:${(z = t == null ? void 0 : t.phone_number) == null ? void 0 : z.phone_number}`, className: n(f.interactItem), onClick: O, children: [
520
+ /* @__PURE__ */ r("div", { className: n(f.interactIcon), children: /* @__PURE__ */ r(Wt, {}) }),
521
+ /* @__PURE__ */ r("div", { className: n(f.interactText), children: N ? (k = t == null ? void 0 : t.phone_number) == null ? void 0 : k.formatted : m("general.phone") })
522
+ ] }),
523
+ /* @__PURE__ */ d("a", { href: `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent((B = t == null ? void 0 : t.address) == null ? void 0 : B.string)}=&destination_place_id=${t == null ? void 0 : t.place_id}`, target: "new", className: n(f.interactItem), children: [
524
+ /* @__PURE__ */ r("div", { className: n(f.interactIcon), children: /* @__PURE__ */ r(xt, {}) }),
525
+ /* @__PURE__ */ r("div", { className: n(f.interactText), children: m("general.directions") })
526
+ ] }),
527
+ /* @__PURE__ */ d("button", { className: n(f.interactItem), onClick: D, children: [
528
+ /* @__PURE__ */ r("div", { className: n(f.interactIcon), children: /* @__PURE__ */ r(jt, {}) }),
529
+ /* @__PURE__ */ r("div", { className: n(f.interactText), children: m("general.message") })
530
+ ] }),
531
+ (t == null ? void 0 : t.website) && /* @__PURE__ */ d("a", { href: t == null ? void 0 : t.website, target: "_blank", className: n(f.interactItem), children: [
532
+ /* @__PURE__ */ r("div", { className: n(f.interactIcon), children: /* @__PURE__ */ r(Ht, {}) }),
533
+ /* @__PURE__ */ r("div", { className: n(f.interactText), children: m("general.website") })
534
+ ] })
535
+ ] })
536
+ ] });
537
+ }, nr = "pCNHg", cr = "frwR4", ir = "sUqpG", or = "xVDe4", lr = "DZ-Z2", R = {
538
+ loading: nr,
539
+ itemWrapper: cr,
540
+ wrapper: ir,
541
+ hasSelected: or,
542
+ selected: lr
543
+ }, dr = () => {
544
+ const { t: e } = x(), { locations: t, isLoading: s, selectedLocationId: a } = j();
545
+ function i(c, p) {
546
+ if (!c || !p) return;
547
+ const l = c.getBoundingClientRect(), m = p.getBoundingClientRect().top - l.top + c.scrollTop;
548
+ c.scrollTo({
549
+ top: m,
550
+ behavior: "smooth"
551
+ });
552
+ }
553
+ return H(() => {
554
+ const c = document.getElementById(`location-${a}`);
555
+ if (c) {
556
+ const p = document.getElementById("llw");
557
+ i(p, c);
558
+ }
559
+ }, [a]), s ? /* @__PURE__ */ r("div", { className: n(R.loading), children: /* @__PURE__ */ r("img", { src: "https://images.sofasandsectionals.com/cc/pal-loader.svg", width: "50", height: "50", alt: e("store_locator.loading") }) }) : /* @__PURE__ */ r("div", { id: "location-list", className: `${R.wrapper} ${a ? R.hasSelected : ""}`, children: t.map((c) => /* @__PURE__ */ r("div", { id: `location-${c.id}`, className: `${R.itemWrapper} ${a === c.id ? R.selected : ""}`, children: /* @__PURE__ */ r(ar, { id: c.id, location: c }) }, c.id)) });
560
+ }, mr = "N2FHA", pr = "BSoIL", ur = "xMDdB", hr = "-zMng", fr = "gz4We", P = {
561
+ wrapper: mr,
562
+ top: pr,
563
+ searchWrapper: ur,
564
+ listWrapper: hr,
565
+ hasSelected: fr
566
+ }, gr = () => {
567
+ const { showMap: e, showFilters: t, setShowFilters: s, locale: a, selectedLocationId: i } = j();
568
+ return /* @__PURE__ */ d(V, { xs: { order: 1 }, lg: { order: 0, span: 4 }, xxl: { order: 0, span: 3 }, className: n(P.wrapper), children: [
569
+ /* @__PURE__ */ r("div", { className: n(P.top), children: /* @__PURE__ */ r("div", { className: n(P.searchWrapper), children: /* @__PURE__ */ r("div", { className: "mb-3", children: /* @__PURE__ */ r(Qt, {}) }) }) }),
570
+ /* @__PURE__ */ r("div", { className: `${P.listWrapper} ${i ? P.hasSelected : ""}`, id: "llw", children: /* @__PURE__ */ r(dr, {}) })
571
+ ] });
572
+ }, u = {}, vr = () => {
573
+ var l, o, m;
574
+ const { selectedLocation: e, showDetails: t, setShowDetails: s, setMessageModalOpen: a } = j(), { t: i } = x(), c = () => {
575
+ s(!1);
576
+ }, p = () => {
577
+ a(!0);
578
+ };
579
+ return /* @__PURE__ */ r(se, { show: t, onHide: c, backdrop: !1, placement: "start", className: n(u.wrapper), scroll: !0, children: /* @__PURE__ */ d(se.Body, { className: "px-0", children: [
580
+ /* @__PURE__ */ d("section", { className: n(u.nameWrapper), children: [
581
+ /* @__PURE__ */ d("div", { className: n(u.close), onClick: c, children: [
582
+ /* @__PURE__ */ r("i", { className: "lpe-icons", children: "back" }),
583
+ " ",
584
+ i("general.viewAll")
585
+ ] }),
586
+ /* @__PURE__ */ r("div", { className: n(u.name), children: e == null ? void 0 : e.retailer_name })
587
+ ] }),
588
+ /* @__PURE__ */ d("section", { className: n(u.interactWrapper), children: [
589
+ /* @__PURE__ */ d("a", { href: `tel:${(l = e == null ? void 0 : e.phone_number) == null ? void 0 : l.phone_number}`, className: n(u.interactItem), children: [
590
+ /* @__PURE__ */ r("div", { className: n(u.interactIcon), children: /* @__PURE__ */ r("i", { className: "lpe-icons", children: "phone" }) }),
591
+ /* @__PURE__ */ r("div", { className: n(u.interactText), children: i("general.phone") })
592
+ ] }),
593
+ /* @__PURE__ */ d("a", { href: `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent((o = e == null ? void 0 : e.address) == null ? void 0 : o.string)}=&destination_place_id=${e == null ? void 0 : e.place_id}`, target: "new", className: n(u.interactItem), children: [
594
+ /* @__PURE__ */ r("div", { className: n(u.interactIcon), children: /* @__PURE__ */ r("i", { className: "lpe-icons", children: "direction" }) }),
595
+ /* @__PURE__ */ r("div", { className: n(u.interactText), children: i("general.directions") })
596
+ ] }),
597
+ /* @__PURE__ */ d("a", { className: n(u.interactItem), onClick: p, children: [
598
+ /* @__PURE__ */ r("div", { className: n(u.interactIcon), children: /* @__PURE__ */ r($t, {}) }),
599
+ /* @__PURE__ */ r("div", { className: n(u.interactText), children: i("general.message") })
600
+ ] }),
601
+ /* @__PURE__ */ d("a", { href: e == null ? void 0 : e.website, target: "_blank", className: n(u.interactItem), children: [
602
+ /* @__PURE__ */ r("div", { className: n(u.interactIcon), children: /* @__PURE__ */ r("i", { className: "lpe-icons", children: "world" }) }),
603
+ /* @__PURE__ */ r("div", { className: n(u.interactText), children: i("general.website") })
604
+ ] })
605
+ ] }),
606
+ /* @__PURE__ */ d("section", { className: n(u.addressWrapper), children: [
607
+ /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r("i", { className: "lpe-icons", children: "marker" }) }),
608
+ /* @__PURE__ */ d("div", { className: n(u.address), children: [
609
+ /* @__PURE__ */ r("div", { children: e == null ? void 0 : e.address.street_line_one }),
610
+ /* @__PURE__ */ r("div", { children: e == null ? void 0 : e.address.street_line_two }),
611
+ /* @__PURE__ */ d("div", { children: [
612
+ e == null ? void 0 : e.address.city,
613
+ ", ",
614
+ e == null ? void 0 : e.address.province,
615
+ " ",
616
+ e == null ? void 0 : e.address.postal_code
617
+ ] }),
618
+ /* @__PURE__ */ r("div", { children: e == null ? void 0 : e.address.country })
619
+ ] })
620
+ ] }),
621
+ /* @__PURE__ */ r("section", { className: n(u.hoursWrapper), children: /* @__PURE__ */ r(wt, { hours: e == null ? void 0 : e.retailer_location_hours }) }),
622
+ /* @__PURE__ */ d("section", { className: "container", children: [
623
+ /* @__PURE__ */ r("h5", { className: n(u.productTitle), children: i("store_locator.products") }),
624
+ /* @__PURE__ */ r(oe, { children: (m = e == null ? void 0 : e.retailer_location_products) == null ? void 0 : m.map((h, g) => /* @__PURE__ */ r(V, { xs: 6, className: "mb-3", children: /* @__PURE__ */ d("div", { className: n(u.product), children: [
625
+ /* @__PURE__ */ r("img", { src: h.image_url || `https://placehold.co/400x400?text=${h.name}`, alt: h.name, className: n(u.productImage) }),
626
+ /* @__PURE__ */ r("div", { className: n(u.productName), children: h.name }),
627
+ /* @__PURE__ */ r("div", { className: n(u.productPrice), children: h.price })
628
+ ] }) }, g)) })
629
+ ] })
630
+ ] }) });
631
+ }, ae = {}, wr = ({ id: e, locale: t, baseUrl: s = "/retailers" }) => {
632
+ const { showMap: a, setShowMap: i, searchLocation: c } = j(), { t: p, i18n: l } = x("default"), [o, m] = C({ lat: -47, lng: 100 });
633
+ return H(() => {
634
+ l.changeLanguage(t);
635
+ }, [t]), /* @__PURE__ */ d("div", { className: "cc", children: [
636
+ /* @__PURE__ */ d(oe, { children: [
637
+ /* @__PURE__ */ r(gr, {}),
638
+ /* @__PURE__ */ r(V, { xs: { order: 0 }, lg: { order: 1 }, className: a ? n(ae.map) : n(ae.noMap, "p-3", "position-relative"), children: /* @__PURE__ */ d("div", { className: "position-relative", children: [
639
+ /* @__PURE__ */ r(Ke, { mapCenter: o }),
640
+ /* @__PURE__ */ r(Ze, { mapCenter: o, setMapCenter: m })
641
+ ] }) })
642
+ ] }),
643
+ /* @__PURE__ */ r(vr, {}),
644
+ /* @__PURE__ */ r(at, {})
645
+ ] });
646
+ }, Mr = ({ id: e, locale: t }) => /* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ r(ke, { i18n: Be, children: /* @__PURE__ */ d(Re, { apiKey: "AIzaSyAnJmWEU1r63DiRWHkjczxzHyIEq3dhj4M", libraries: ["places"], children: [
647
+ /* @__PURE__ */ r("script", { src: "https://maps.googleapis.com/maps/api/js?key=AIzaSyAnJmWEU1r63DiRWHkjczxzHyIEq3dhj4M&libraries=places" }),
648
+ /* @__PURE__ */ r(Qe, { id: e, children: /* @__PURE__ */ r(Je, { lngLocale: t, autolocate: !0, children: /* @__PURE__ */ r(wr, { id: e, locale: t }) }) })
649
+ ] }) }) });
650
+ export {
651
+ Mr as default
652
+ };