@colabcommerce/elements 0.0.1 → 0.0.2

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,113 +1,111 @@
1
- import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
- import { useEffect as P, useState as R, Suspense as D } from "react";
3
- import { u as B, L as H, g as E, d as z, S as O, b as U, k as Q, f as J, A as K, w as V, c as G, e as X } from "./index-BComOHrk.js";
4
- import { L as Y, F as Z, a as ee, b as te, Q as ae } from "./addressComponentsToAddress-CHYXse0U.js";
5
- import { a as W, c as w, G as ne, J as N, K as oe, B as j, L as d, R as se, C as _, N as b, i as A, I as re, h as ie } from "./globals-D3YPIcjZ.js";
6
- import { S as le } from "./index-Dv5Y39GK.js";
1
+ import { jsx as e, jsxs as s } from "react/jsx-runtime";
2
+ import { useEffect as j, useState as E, Suspense as z } from "react";
3
+ import { u as F, L as H, g as $, d as D, S as Q, b as U, k as J, f as V, A as K, c as G, w as X, h as Y, e as Z } from "./addressComponentsToAddress-f0L6qfjZ.js";
4
+ import { L as ee, F as te, Q as ae } from "./index-BkhS8Nlh.js";
5
+ import { a as M, c as k, e as oe, h as b, i as ne, B as R, F as d, R as se, C as _, O as y, l as W, I as re, m as ie } from "./globals-C3lGVSJ0.js";
6
+ import { S as le } from "./index-GbXQ8qje.js";
7
7
  const ce = () => {
8
- const { locationName: u, setLocationName: l, setSearchCenter: h, setMapCenter: t, setLoadingGeo: p, getPosition: s } = B();
8
+ const { locationName: m, setLocationName: l, setSearchCenter: c, setMapCenter: t, setLoadingGeo: f, getPosition: n } = F();
9
9
  return /* @__PURE__ */ e(
10
10
  H,
11
11
  {
12
- locationName: u,
12
+ locationName: m,
13
13
  setLocationName: l,
14
- setSearchCenter: h,
14
+ setSearchCenter: c,
15
15
  setMapCenter: t,
16
16
  handleLocate: () => {
17
- p(!0), s();
17
+ f(!0), n();
18
18
  }
19
19
  }
20
20
  );
21
- }, de = "_5BvSp", me = "NnCF-", ue = "OxA-3", he = "fIWeh", y = {
21
+ }, de = "_5BvSp", me = "NnCF-", ue = "OxA-3", he = "fIWeh", C = {
22
22
  loading: de,
23
23
  itemWrapper: me,
24
24
  selected: ue,
25
25
  wrapper: he
26
26
  }, pe = () => {
27
- const { t: u } = W(), { locations: l, isLoading: h, focusedLocationId: t } = B();
28
- function p(s, m) {
29
- if (!s || !m) return;
30
- const v = s.getBoundingClientRect(), a = m.getBoundingClientRect().top - v.top + s.scrollTop;
31
- s.scrollTo({
32
- top: a,
27
+ const { t: m } = M(), { locations: l, isLoading: c, focusedLocationId: t } = F();
28
+ function f(n, u) {
29
+ if (!n || !u) return;
30
+ const h = n.getBoundingClientRect(), i = u.getBoundingClientRect().top - h.top + n.scrollTop;
31
+ n.scrollTo({
32
+ top: i,
33
33
  behavior: "smooth"
34
34
  });
35
35
  }
36
- return P(() => {
37
- const s = document.getElementById(`location-${t}`);
38
- if (s) {
39
- const m = document.getElementById("llw");
40
- p(m, s);
36
+ return j(() => {
37
+ const n = document.getElementById(`location-${t}`);
38
+ if (n) {
39
+ const u = document.getElementById("llw");
40
+ f(u, n);
41
41
  }
42
- }, [t]), h ? /* @__PURE__ */ e("div", { className: w(y.loading), children: /* @__PURE__ */ e("img", { src: "https://images.sofasandsectionals.com/cc/pal-loader.svg", width: "50", height: "50", alt: u("store_locator.loading") }) }) : /* @__PURE__ */ e("div", { className: w(y.wrapper), id: "llw", children: l.map((s) => /* @__PURE__ */ e("div", { className: t === s.id ? w(y.itemWrapper, y.selected) : w(y.itemWrapper), id: `location-${s.id}`, children: /* @__PURE__ */ e(Y, { id: s.id, location: s }) }, s.id)) });
43
- }, fe = "NQ6-h", _e = "_4wmyC", ge = "_9dVCP", F = {
42
+ }, [t]), c ? /* @__PURE__ */ e("div", { className: k(C.loading), children: /* @__PURE__ */ e("img", { src: "https://images.sofasandsectionals.com/cc/pal-loader.svg", width: "50", height: "50", alt: m("store_locator.loading") }) }) : /* @__PURE__ */ e("div", { className: k(C.wrapper), id: "llw", children: l.map((n) => /* @__PURE__ */ e("div", { className: t === n.id ? k(C.itemWrapper, C.selected) : k(C.itemWrapper), id: `location-${n.id}`, children: /* @__PURE__ */ e(ee, { id: n.id, location: n }) }, n.id)) });
43
+ }, fe = "NQ6-h", _e = "_4wmyC", ge = "_9dVCP", P = {
44
44
  wrapper: fe,
45
45
  name: _e,
46
46
  address: ge
47
47
  }, ve = () => {
48
- var C, I, S, L, n, x, c;
49
- const { cc_company_retailer_location_id: u } = E(), { distanceUnit: l, searchCenter: h, selectedLocation: t, setSelectedLocationId: p, selectedLocationId: s, setMessageModalOpen: m, setShowMap: v, setShowDetails: i } = B(), a = z({ lat: (C = t == null ? void 0 : t.address) == null ? void 0 : C.latitude, lng: (I = t == null ? void 0 : t.address) == null ? void 0 : I.longitude }, h), g = l === "km" ? a : Q(a), q = Math.round(g * 10) / 10, k = (S = t == null ? void 0 : t.store_type) != null && S.includes("Studio") ? "studio" : "retailer";
50
- return !t || t.location_id === u ? null : /* @__PURE__ */ e("div", { children: /* @__PURE__ */ o("div", { className: F.wrapper, children: [
51
- /* @__PURE__ */ o("div", { className: "d-flex align-items-center justify-content-between", children: [
52
- /* @__PURE__ */ e("h3", { className: F.name, children: t == null ? void 0 : t.retailer_name }),
53
- /* @__PURE__ */ e("div", { className: "text-end", children: /* @__PURE__ */ e(O, { type: k }) })
48
+ var I, q, x, w, L, a, B;
49
+ const { cc_company_retailer_location_id: m } = $(), { distanceUnit: l, searchCenter: c, selectedLocation: t, setSelectedLocationId: f, selectedLocationId: n, setMessageModalOpen: u, setShowMap: h, setShowDetails: v } = F(), i = D({ lat: (I = t == null ? void 0 : t.address) == null ? void 0 : I.latitude, lng: (q = t == null ? void 0 : t.address) == null ? void 0 : q.longitude }, c), o = l === "km" ? i : J(i), N = Math.round(o * 10) / 10, S = (x = t == null ? void 0 : t.store_type) != null && x.includes("Studio") ? "studio" : "retailer";
50
+ return !t || t.location_id === m ? null : /* @__PURE__ */ e("div", { children: /* @__PURE__ */ s("div", { className: P.wrapper, children: [
51
+ /* @__PURE__ */ s("div", { className: "d-flex align-items-center justify-content-between", children: [
52
+ /* @__PURE__ */ e("h3", { className: P.name, children: t == null ? void 0 : t.retailer_name }),
53
+ /* @__PURE__ */ e("div", { className: "text-end", children: /* @__PURE__ */ e(Q, { type: S }) })
54
54
  ] }),
55
- /* @__PURE__ */ o("div", { className: "text-muted fs-6 fw-normal mt-1", children: [
56
- q,
55
+ /* @__PURE__ */ s("div", { className: "text-muted fs-6 fw-normal mt-1", children: [
56
+ N,
57
57
  " ",
58
58
  l
59
59
  ] }),
60
60
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(U, { hours: t == null ? void 0 : t.retailer_location_hours }) }),
61
- /* @__PURE__ */ o("address", { className: F.address, children: [
62
- /* @__PURE__ */ e("div", { children: (L = t == null ? void 0 : t.address) == null ? void 0 : L.street_line_one }),
63
- /* @__PURE__ */ o("div", { children: [
64
- (n = t == null ? void 0 : t.address) == null ? void 0 : n.city,
61
+ /* @__PURE__ */ s("address", { className: P.address, children: [
62
+ /* @__PURE__ */ e("div", { children: (w = t == null ? void 0 : t.address) == null ? void 0 : w.street_line_one }),
63
+ /* @__PURE__ */ s("div", { children: [
64
+ (L = t == null ? void 0 : t.address) == null ? void 0 : L.city,
65
65
  ", ",
66
- (x = t == null ? void 0 : t.address) == null ? void 0 : x.province,
66
+ (a = t == null ? void 0 : t.address) == null ? void 0 : a.province,
67
67
  " ",
68
- (c = t == null ? void 0 : t.address) == null ? void 0 : c.postal_code
68
+ (B = t == null ? void 0 : t.address) == null ? void 0 : B.postal_code
69
69
  ] })
70
70
  ] })
71
71
  ] }) });
72
- }, Ne = "pdHgU", be = "FLRF-", ye = "KsfpB", qe = "t-v-7", Ce = "UFm9T", Ie = "c3v8k", f = {
73
- storeDisclaimer: Ne,
74
- inquiryTitle: be,
75
- changeLocationBtn: ye,
76
- submitButton: qe,
77
- successContainer: Ce,
78
- successBtn: Ie
79
- }, Se = ({ id: u, product: l = null, onSuccess: h, onCancel: t, onClose: p }) => {
80
- l || console.warn("ProductForm: No product provided");
81
- const { cc_company_retailer_location_id: s } = E(), { selectedLocationId: m, setSelectedLocationId: v, searchCenter: i } = B(), { t: a } = W("default"), [g, q] = R(!1), [k, C] = R(!1), I = {
72
+ }, Ne = "KsfpB", be = "t-v-7", ye = "UFm9T", Ce = "c3v8k", g = {
73
+ changeLocationBtn: Ne,
74
+ submitButton: be,
75
+ successContainer: ye,
76
+ successBtn: Ce
77
+ }, Se = ({ id: m, product: l = null, onSuccess: c, onCancel: t, onClose: f, optInText: n }) => {
78
+ l || console.warn("Colab Commerce: No product(s) provided to the ProductForm component.");
79
+ const { cc_company_retailer_location_id: u } = $(), { selectedLocationId: h, setSelectedLocationId: v, searchCenter: i } = F(), { t: o } = M("default"), [N, S] = E(!1), [I, q] = E(!1), x = {
82
80
  firstName: "",
83
81
  lastName: "",
84
82
  email: "",
85
83
  phone: "",
86
84
  notes: ""
87
- }, S = ne().shape({
88
- firstName: N().required(a("quote_form.first_name_required")),
89
- lastName: N().required(a("quote_form.last_name_required")),
90
- email: N().email(a("quote_form.invalid_email")).required(a("quote_form.email_required")),
91
- phone: N().required(a("quote_form.phone_required")),
92
- notes: N()
93
- }), n = oe({
94
- initialValues: I,
95
- validationSchema: S,
96
- onSubmit: async (c) => {
97
- V("AIzaSyAnJmWEU1r63DiRWHkjczxzHyIEq3dhj4M");
98
- const $ = await K(i == null ? void 0 : i.lat, i == null ? void 0 : i.lng), r = ee($.results[0].address_components), T = await fetch("https://api.colabcommerce.com/widget_api/leads", {
85
+ }, w = oe().shape({
86
+ firstName: b().required(o("quote_form.first_name_required")),
87
+ lastName: b().required(o("quote_form.last_name_required")),
88
+ email: b().email(o("quote_form.invalid_email")).required(o("quote_form.email_required")),
89
+ phone: b().required(o("quote_form.phone_required")),
90
+ notes: b()
91
+ }), a = ne({
92
+ initialValues: x,
93
+ validationSchema: w,
94
+ onSubmit: async (p) => {
95
+ X("AIzaSyAnJmWEU1r63DiRWHkjczxzHyIEq3dhj4M");
96
+ const T = await K(i == null ? void 0 : i.lat, i == null ? void 0 : i.lng), r = G(T.results[0].address_components), A = await fetch("http://localhost:4000/widget_api/leads", {
99
97
  method: "POST",
100
98
  headers: {
101
99
  "Content-Type": "application/json"
102
100
  },
103
101
  body: JSON.stringify({
104
- id: u,
102
+ id: m,
105
103
  lead: {
106
- name: `${c.firstName} ${c.lastName}`,
107
- emails_attributes: [{ email: c.email }],
108
- phone_numbers_attributes: [{ phone_number: c.phone, country_code: "US" }],
109
- message: c.message,
110
- opt_in: c.optIn,
104
+ name: `${p.firstName} ${p.lastName}`,
105
+ emails_attributes: [{ email: p.email }],
106
+ phone_numbers_attributes: [{ phone_number: p.phone, country_code: "US" }],
107
+ message: p.message,
108
+ opt_in: p.optIn,
111
109
  location_attributes: {
112
110
  street_line_one: r == null ? void 0 : r.addressLine1,
113
111
  street_line_two: r == null ? void 0 : r.addressLine2,
@@ -118,65 +116,63 @@ const ce = () => {
118
116
  latitude: (i == null ? void 0 : i.lat) || null,
119
117
  longitude: (i == null ? void 0 : i.lng) || null
120
118
  },
121
- assignee_id: m || null,
119
+ assignee_id: h || null,
122
120
  assignee_type: "CompanyRetailerLocation",
123
121
  lead_activities_attributes: [{
124
122
  type: "LeadActivity::QuoteRequest",
125
123
  products: [l],
126
- notes: c.notes,
124
+ notes: p.notes,
127
125
  source_type: "Company",
128
- source_id: u
126
+ source_id: m
129
127
  }]
130
128
  }
131
129
  })
132
130
  });
133
- if (!T.ok) {
134
- C(!0);
131
+ if (!A.ok) {
132
+ q(!0);
135
133
  return;
136
134
  }
137
- const M = await T.json();
138
- q(!0), h && h(M);
135
+ const O = await A.json();
136
+ S(!0), c && c(O);
139
137
  }
140
138
  });
141
- P(() => {
142
- const c = document.getElementById("cc-accordion-anchor");
143
- c && c.scrollIntoView({ behavior: "instant" });
144
- }, [m]);
145
- const x = () => {
146
- q(!1), v(null), p && p();
139
+ j(() => {
140
+ const p = document.getElementById("cc-accordion-anchor");
141
+ p && p.scrollIntoView({ behavior: "instant" });
142
+ }, [h]);
143
+ const B = () => {
144
+ S(!1), v(null), f && f();
147
145
  };
148
- return /* @__PURE__ */ o("div", { className: "cc", children: [
149
- g && /* @__PURE__ */ e("div", { className: f.successContainer, children: /* @__PURE__ */ o("div", { className: "text-center", children: [
150
- /* @__PURE__ */ e("h2", { className: "fw-bold fs-2", style: { marginBottom: "3.2rem" }, children: a("cart_form.success_title") }),
151
- /* @__PURE__ */ e("div", { className: "fs-6", style: { fontWeight: 600, marginBottom: "3.2rem" }, children: a("cart_form.success_message") }),
152
- /* @__PURE__ */ e(j, { variant: "dark", className: f.successBtn, onClick: x, children: a("cart_form.success_button") })
146
+ return /* @__PURE__ */ s("div", { className: "cc", children: [
147
+ N && /* @__PURE__ */ e("div", { className: g.successContainer, children: /* @__PURE__ */ s("div", { className: "text-center", children: [
148
+ /* @__PURE__ */ e("h2", { className: "fw-bold fs-2", style: { marginBottom: "3.2rem" }, children: o("cart_form.success_title") }),
149
+ /* @__PURE__ */ e("div", { className: "fs-6", style: { fontWeight: 600, marginBottom: "3.2rem" }, children: o("cart_form.success_message") }),
150
+ /* @__PURE__ */ e(R, { variant: "dark", className: g.successBtn, onClick: B, children: o("cart_form.success_button") })
153
151
  ] }) }),
154
- !g && /* @__PURE__ */ o("div", { id: "cc-accordion-anchor", children: [
155
- !m && /* @__PURE__ */ o("div", { children: [
152
+ !N && /* @__PURE__ */ s("div", { id: "cc-accordion-anchor", children: [
153
+ !h && /* @__PURE__ */ s("div", { children: [
156
154
  /* @__PURE__ */ e("div", { className: "mb-3", children: /* @__PURE__ */ e(ce, {}) }),
157
- /* @__PURE__ */ o("div", { className: "position-relative", children: [
158
- /* @__PURE__ */ e(J, {}),
155
+ /* @__PURE__ */ s("div", { className: "position-relative", children: [
156
+ /* @__PURE__ */ e(V, {}),
159
157
  /* @__PURE__ */ e(le, {})
160
158
  ] }),
161
- /* @__PURE__ */ e(Z, {}),
159
+ /* @__PURE__ */ e(te, {}),
162
160
  /* @__PURE__ */ e(pe, {})
163
161
  ] }),
164
- m && /* @__PURE__ */ o("div", { children: [
165
- /* @__PURE__ */ e("div", { className: f.inquiryTitle, children: a("quote.inquiryTitle") }),
166
- /* @__PURE__ */ e("p", { className: f.storeDisclaimer, children: a("product_availability.disclaimer") }),
167
- /* @__PURE__ */ o("div", { children: [
168
- /* @__PURE__ */ o("div", { className: "d-flex align-items-center justify-content-between px-3 mb-2 fs-6", children: [
169
- /* @__PURE__ */ e("span", { className: "fw-bold", children: s === m ? "" : a("quote.selected_location") }),
170
- /* @__PURE__ */ e("button", { onClick: () => v(null), className: f.changeLocationBtn, children: a("quote.change_location") })
162
+ h && /* @__PURE__ */ s("div", { children: [
163
+ /* @__PURE__ */ s("div", { children: [
164
+ /* @__PURE__ */ s("div", { className: "d-flex align-items-center justify-content-between px-3 mb-2 fs-6", children: [
165
+ /* @__PURE__ */ e("span", { className: "fw-bold", children: u === h ? "" : o("quote.selected_location.title") }),
166
+ /* @__PURE__ */ e("button", { onClick: () => v(null), className: g.changeLocationBtn, children: o("quote.change_location") })
171
167
  ] }),
172
- /* @__PURE__ */ e("div", { className: f.selectedLocation, children: /* @__PURE__ */ e(ve, {}) })
168
+ /* @__PURE__ */ e("div", { className: g.selectedLocation, children: /* @__PURE__ */ e(ve, {}) })
173
169
  ] }),
174
- /* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ e(d, { onSubmit: n.handleSubmit, className: f.form, children: /* @__PURE__ */ o(se, { children: [
175
- /* @__PURE__ */ e(_, { xs: 12, md: 6, children: /* @__PURE__ */ o(
176
- b,
170
+ /* @__PURE__ */ e("div", { className: "p-3", children: /* @__PURE__ */ e(d, { onSubmit: a.handleSubmit, className: g.form, children: /* @__PURE__ */ s(se, { children: [
171
+ /* @__PURE__ */ e(_, { xs: 12, md: 12, children: /* @__PURE__ */ s(
172
+ y,
177
173
  {
178
174
  controlId: "floatingInput",
179
- label: a("quote_form.first_name"),
175
+ label: o("quote_form.first_name"),
180
176
  className: "mb-3",
181
177
  children: [
182
178
  /* @__PURE__ */ e(
@@ -184,22 +180,22 @@ const ce = () => {
184
180
  {
185
181
  type: "text",
186
182
  name: "firstName",
187
- placeholder: a("quote_form.first_name_placeholder"),
188
- onChange: n.handleChange,
189
- value: n.values.firstName,
183
+ placeholder: o("quote_form.first_name_placeholder"),
184
+ onChange: a.handleChange,
185
+ value: a.values.firstName,
190
186
  className: "rounded-0",
191
- isInvalid: !!n.errors.firstName
187
+ isInvalid: !!a.errors.firstName
192
188
  }
193
189
  ),
194
- /* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children: n.errors.firstName })
190
+ /* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children: a.errors.firstName })
195
191
  ]
196
192
  }
197
193
  ) }),
198
- /* @__PURE__ */ e(_, { xs: 12, md: 6, children: /* @__PURE__ */ o(
199
- b,
194
+ /* @__PURE__ */ e(_, { xs: 12, md: 12, children: /* @__PURE__ */ s(
195
+ y,
200
196
  {
201
197
  controlId: "floatingInput",
202
- label: a("quote_form.last_name"),
198
+ label: o("quote_form.last_name"),
203
199
  className: "mb-3",
204
200
  children: [
205
201
  /* @__PURE__ */ e(
@@ -208,21 +204,21 @@ const ce = () => {
208
204
  type: "text",
209
205
  name: "lastName",
210
206
  className: "rounded-0",
211
- placeholder: a("quote_form.last_name_placeholder"),
212
- onChange: n.handleChange,
213
- value: n.values.lastName,
214
- isInvalid: !!n.errors.lastName
207
+ placeholder: o("quote_form.last_name_placeholder"),
208
+ onChange: a.handleChange,
209
+ value: a.values.lastName,
210
+ isInvalid: !!a.errors.lastName
215
211
  }
216
212
  ),
217
- /* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children: n.errors.lastName })
213
+ /* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children: a.errors.lastName })
218
214
  ]
219
215
  }
220
216
  ) }),
221
- /* @__PURE__ */ e(_, { xs: 12, md: 6, children: /* @__PURE__ */ o(
222
- b,
217
+ /* @__PURE__ */ e(_, { xs: 12, md: 12, children: /* @__PURE__ */ s(
218
+ y,
223
219
  {
224
220
  controlId: "floatingInput",
225
- label: a("quote_form.email"),
221
+ label: o("quote_form.email"),
226
222
  className: "mb-3",
227
223
  children: [
228
224
  /* @__PURE__ */ e(
@@ -231,21 +227,21 @@ const ce = () => {
231
227
  type: "email",
232
228
  name: "email",
233
229
  className: "rounded-0",
234
- placeholder: a("quote_form.email_placeholder"),
235
- onChange: n.handleChange,
236
- value: n.values.email,
237
- isInvalid: !!n.errors.email
230
+ placeholder: o("quote_form.email_placeholder"),
231
+ onChange: a.handleChange,
232
+ value: a.values.email,
233
+ isInvalid: !!a.errors.email
238
234
  }
239
235
  ),
240
- /* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children: n.errors.email })
236
+ /* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children: a.errors.email })
241
237
  ]
242
238
  }
243
239
  ) }),
244
- /* @__PURE__ */ e(_, { xs: 12, md: 6, children: /* @__PURE__ */ o(
245
- b,
240
+ /* @__PURE__ */ e(_, { xs: 12, md: 12, children: /* @__PURE__ */ s(
241
+ y,
246
242
  {
247
243
  controlId: "floatingInput",
248
- label: a("quote_form.phone"),
244
+ label: o("quote_form.phone"),
249
245
  className: "mb-3",
250
246
  children: [
251
247
  /* @__PURE__ */ e(
@@ -254,22 +250,22 @@ const ce = () => {
254
250
  type: "text",
255
251
  name: "phone",
256
252
  className: "rounded-0",
257
- placeholder: a("quote_form.phone_placeholder"),
258
- onChange: n.handleChange,
259
- value: n.values.phone,
260
- isInvalid: !!n.errors.phone
253
+ placeholder: o("quote_form.phone_placeholder"),
254
+ onChange: a.handleChange,
255
+ value: a.values.phone,
256
+ isInvalid: !!a.errors.phone
261
257
  }
262
258
  ),
263
- /* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children: n.errors.phone })
259
+ /* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children: a.errors.phone })
264
260
  ]
265
261
  }
266
262
  ) }),
267
- /* @__PURE__ */ e(_, { xs: 12, children: /* @__PURE__ */ o(
268
- b,
263
+ /* @__PURE__ */ e(_, { xs: 12, children: /* @__PURE__ */ s(
264
+ y,
269
265
  {
270
266
  controlId: "floatingTextarea",
271
- label: a("quote_form.notes"),
272
- className: ["mb-3", f.textarea].join(" "),
267
+ label: o("quote_form.notes"),
268
+ className: ["mb-3", g.textarea].join(" "),
273
269
  children: [
274
270
  /* @__PURE__ */ e(
275
271
  d.Control,
@@ -277,51 +273,76 @@ const ce = () => {
277
273
  as: "textarea",
278
274
  name: "notes",
279
275
  className: "rounded-0",
280
- placeholder: a("quote_form.notes_placeholder"),
281
- onChange: n.handleChange,
282
- value: n.values.notes,
283
- isInvalid: !!n.errors.notes,
276
+ placeholder: o("quote_form.notes_placeholder"),
277
+ onChange: a.handleChange,
278
+ value: a.values.notes,
279
+ isInvalid: !!a.errors.notes,
284
280
  style: { height: "100px" }
285
281
  }
286
282
  ),
287
- /* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children: n.errors.notes })
283
+ /* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children: a.errors.notes })
288
284
  ]
289
285
  }
290
286
  ) }),
291
- /* @__PURE__ */ o(_, { xs: 12, children: [
287
+ n && /* @__PURE__ */ s(_, { xs: 12, children: [
292
288
  /* @__PURE__ */ e(
293
289
  d.Check,
294
290
  {
295
291
  name: "optIn",
296
292
  type: "checkbox",
297
- label: a("quote_form.optIn"),
293
+ label: n,
298
294
  className: "mb-3 fs-6",
299
- onChange: n.handleChange,
300
- isInvalid: !!n.errors.optIn
295
+ onChange: a.handleChange,
296
+ isInvalid: !!a.errors.optIn
301
297
  }
302
298
  ),
303
- /* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children: n.errors.optIn })
299
+ /* @__PURE__ */ e(d.Control.Feedback, { type: "invalid", children: a.errors.optIn })
304
300
  ] }),
305
- /* @__PURE__ */ o(_, { xs: 12, className: "text-start d-flex align-items-center", children: [
306
- /* @__PURE__ */ e(j, { type: "submit", variant: "dark", className: f.submitButton, disabled: g, children: n.isSubmitting ? a("quote.submitting") : a("quote_form.submit") }),
307
- k && /* @__PURE__ */ e("div", { className: "text-danger ms-2", children: a("quote_form.error") }),
308
- g && /* @__PURE__ */ e("div", { className: "text-success ms-2", children: a("quote_form.success") })
301
+ /* @__PURE__ */ s(_, { xs: 12, className: "text-start d-flex align-items-center", children: [
302
+ /* @__PURE__ */ e(R, { type: "submit", variant: "dark", className: g.submitButton, disabled: N, children: a.isSubmitting ? o("quote.submitting") : o("quote_form.submit") }),
303
+ I && /* @__PURE__ */ e("div", { className: "text-danger ms-2", children: o("quote_form.error") }),
304
+ N && /* @__PURE__ */ e("div", { className: "text-success ms-2", children: o("quote_form.success") })
309
305
  ] })
310
306
  ] }) }) })
311
307
  ] })
312
308
  ] })
313
309
  ] });
314
- }, Pe = ({ id: u, locale: l, product: h, onCancel: t, onClose: p, onSuccess: s }) => (P(() => {
315
- A.changeLanguage(l);
316
- }, [l]), /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(re, { i18n: A, children: /* @__PURE__ */ e(ie, { apiKey: "AIzaSyAnJmWEU1r63DiRWHkjczxzHyIEq3dhj4M", libraries: ["places"], children: /* @__PURE__ */ e(G, { id: u, children: /* @__PURE__ */ e(te, { children: /* @__PURE__ */ e(
317
- X,
310
+ }, Fe = ({
311
+ id: m,
312
+ // The entity ID for the Store Locator.
313
+ locale: l,
314
+ product: c,
315
+ filterRetailerByStockedProduct: t = !1,
316
+ filterRetailerByAvailableProduct: f = !1,
317
+ optInText: n = null,
318
+ onCancel: u,
319
+ onClose: h,
320
+ onSuccess: v
321
+ }) => (j(() => {
322
+ W.changeLanguage(l);
323
+ }, [l]), c || (console.warn("Colab Commerce: No product(s) provided to the ProductForm component."), c = []), /* @__PURE__ */ e(z, { children: /* @__PURE__ */ e(re, { i18n: W, children: /* @__PURE__ */ e(ie, { apiKey: "AIzaSyAnJmWEU1r63DiRWHkjczxzHyIEq3dhj4M", libraries: ["places"], children: /* @__PURE__ */ e(Y, { id: m, children: /* @__PURE__ */ e(
324
+ Z,
318
325
  {
326
+ id: m,
319
327
  locale: l,
320
- autoLocate: !1,
321
- products: [h],
322
- children: /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(Se, { id: u, product: h, onSuccess: s, onCancel: t, onClose: p }) })
328
+ filterRetailerByStockedProduct: t,
329
+ filterRetailerByAvailableProduct: f,
330
+ optInText: n,
331
+ autoLocate: !0,
332
+ products: [c],
333
+ children: /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(
334
+ Se,
335
+ {
336
+ id: m,
337
+ product: c,
338
+ onSuccess: v,
339
+ optInText: n,
340
+ onCancel: u,
341
+ onClose: h
342
+ }
343
+ ) })
323
344
  }
324
- ) }) }) }) }) }));
345
+ ) }) }) }) }));
325
346
  export {
326
- Pe as default
347
+ Fe as default
327
348
  };