@asteby/storefront-react 0.11.1 → 0.13.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.
- package/README.md +58 -0
- package/dist/account-server.cjs +152 -0
- package/dist/account-server.cjs.map +1 -0
- package/dist/account-server.d.cts +72 -0
- package/dist/account-server.d.ts +72 -0
- package/dist/account-server.js +147 -0
- package/dist/account-server.js.map +1 -0
- package/dist/account.cjs +432 -0
- package/dist/account.cjs.map +1 -0
- package/dist/account.css +40 -0
- package/dist/account.d.cts +66 -0
- package/dist/account.d.ts +66 -0
- package/dist/account.js +211 -0
- package/dist/account.js.map +1 -0
- package/dist/checkout.cjs +681 -51
- package/dist/checkout.cjs.map +1 -1
- package/dist/checkout.css +230 -0
- package/dist/checkout.d.cts +228 -4
- package/dist/checkout.d.ts +228 -4
- package/dist/checkout.js +436 -45
- package/dist/checkout.js.map +1 -1
- package/dist/{chunk-ODIQR6TG.js → chunk-5WERSSU5.js} +13 -4
- package/dist/chunk-5WERSSU5.js.map +1 -0
- package/dist/chunk-DFGLCIEG.js +226 -0
- package/dist/chunk-DFGLCIEG.js.map +1 -0
- package/dist/fields-vnMUi2HB.d.cts +101 -0
- package/dist/fields-vnMUi2HB.d.ts +101 -0
- package/dist/payments.cjs +173 -39
- package/dist/payments.cjs.map +1 -1
- package/dist/payments.css +6 -1
- package/dist/payments.d.cts +37 -1
- package/dist/payments.d.ts +37 -1
- package/dist/payments.js +164 -40
- package/dist/payments.js.map +1 -1
- package/dist/types-HcEUd9hW.d.cts +34 -0
- package/dist/types-HcEUd9hW.d.ts +34 -0
- package/package.json +23 -2
- package/dist/chunk-ODIQR6TG.js.map +0 -1
package/dist/checkout.cjs
CHANGED
|
@@ -1,9 +1,504 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
3
|
var react = require('react');
|
|
4
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var storefront = require('@asteby/storefront');
|
|
6
6
|
|
|
7
|
+
// src/checkout/address-fields.tsx
|
|
8
|
+
var ES = {
|
|
9
|
+
valueMissing: "Completa este campo.",
|
|
10
|
+
choiceMissing: "Elige una opci\xF3n.",
|
|
11
|
+
email: "Escribe un correo v\xE1lido, por ejemplo nombre@correo.com.",
|
|
12
|
+
tel: "Escribe un tel\xE9fono v\xE1lido.",
|
|
13
|
+
pattern: "Revisa el formato.",
|
|
14
|
+
tooShort: "Escribe al menos {n} caracteres.",
|
|
15
|
+
server: "Revisa este campo.",
|
|
16
|
+
summaryOne: "Revisa 1 campo para continuar",
|
|
17
|
+
summaryMany: "Revisa {n} campos para continuar",
|
|
18
|
+
optional: "(opcional)"
|
|
19
|
+
};
|
|
20
|
+
var EN = {
|
|
21
|
+
valueMissing: "Fill in this field.",
|
|
22
|
+
choiceMissing: "Choose an option.",
|
|
23
|
+
email: "Enter a valid email, like name@example.com.",
|
|
24
|
+
tel: "Enter a valid phone number.",
|
|
25
|
+
pattern: "Check the format.",
|
|
26
|
+
tooShort: "Enter at least {n} characters.",
|
|
27
|
+
server: "Check this field.",
|
|
28
|
+
summaryOne: "Check 1 field to continue",
|
|
29
|
+
summaryMany: "Check {n} fields to continue",
|
|
30
|
+
optional: "(optional)"
|
|
31
|
+
};
|
|
32
|
+
function fieldMessages(locale, overrides) {
|
|
33
|
+
const base = (locale ?? "es-MX").toLowerCase().startsWith("en") ? EN : ES;
|
|
34
|
+
return overrides ? { ...base, ...overrides } : base;
|
|
35
|
+
}
|
|
36
|
+
var isControl = (el) => !!el && typeof el.tagName === "string" && ["INPUT", "SELECT", "TEXTAREA"].includes(el.tagName) && !!el.name;
|
|
37
|
+
function validationMessage(el, m = ES) {
|
|
38
|
+
const v = el.validity;
|
|
39
|
+
if (!v || v.valid) return null;
|
|
40
|
+
const own = el.getAttribute("data-sf-error");
|
|
41
|
+
if (own) return own;
|
|
42
|
+
if (v.valueMissing) return el instanceof HTMLInputElement && (el.type === "radio" || el.type === "checkbox") ? m.choiceMissing : m.valueMissing;
|
|
43
|
+
if (v.typeMismatch && el instanceof HTMLInputElement) return el.type === "email" ? m.email : el.type === "tel" ? m.tel : m.pattern;
|
|
44
|
+
if (v.patternMismatch) return el.getAttribute("title") || (el instanceof HTMLInputElement && el.type === "tel" ? m.tel : m.pattern);
|
|
45
|
+
if (v.tooShort && el instanceof HTMLInputElement) return m.tooShort.replace("{n}", String(el.minLength));
|
|
46
|
+
return el.validationMessage || m.pattern;
|
|
47
|
+
}
|
|
48
|
+
function labelOf(el) {
|
|
49
|
+
if (el instanceof HTMLInputElement && el.type === "radio") {
|
|
50
|
+
const legend = el.closest("fieldset")?.querySelector("legend");
|
|
51
|
+
if (legend?.textContent) return legend.textContent.trim();
|
|
52
|
+
}
|
|
53
|
+
const text = el.labels?.[0]?.getAttribute("data-sf-label") ?? el.labels?.[0]?.textContent ?? el.getAttribute("aria-label") ?? el.name;
|
|
54
|
+
return text.trim();
|
|
55
|
+
}
|
|
56
|
+
function useFieldErrors(formRef, options = {}) {
|
|
57
|
+
const m = fieldMessages(options.locale, options.messages);
|
|
58
|
+
const live = react.useRef(m);
|
|
59
|
+
live.current = m;
|
|
60
|
+
const server = [...options.serverFields ?? []];
|
|
61
|
+
const serverKey = server.join("|");
|
|
62
|
+
const [errors, setErrors] = react.useState(() => Object.fromEntries(server.map((n) => [n, options.serverMessages?.[n] ?? m.server])));
|
|
63
|
+
const [summary, setSummary] = react.useState(null);
|
|
64
|
+
const [summaryKey, setSummaryKey] = react.useState(0);
|
|
65
|
+
react.useEffect(() => {
|
|
66
|
+
if (!server.length) return;
|
|
67
|
+
const form = formRef.current;
|
|
68
|
+
const items = [];
|
|
69
|
+
const next = {};
|
|
70
|
+
for (const name of server) {
|
|
71
|
+
const msg = options.serverMessages?.[name] ?? live.current.server;
|
|
72
|
+
next[name] = msg;
|
|
73
|
+
const el = form?.elements.namedItem(name);
|
|
74
|
+
const ctl = el && "length" in el && !(el instanceof HTMLSelectElement) ? el[0] : el;
|
|
75
|
+
if (ctl) items.push({ name, id: ctl.id || name, label: labelOf(ctl), message: msg });
|
|
76
|
+
}
|
|
77
|
+
setErrors((e) => ({ ...e, ...next }));
|
|
78
|
+
if (items.length) {
|
|
79
|
+
setSummary(items);
|
|
80
|
+
setSummaryKey((k) => k + 1);
|
|
81
|
+
}
|
|
82
|
+
}, [serverKey]);
|
|
83
|
+
react.useEffect(() => {
|
|
84
|
+
const form = formRef.current;
|
|
85
|
+
if (!form) return;
|
|
86
|
+
let batch = null;
|
|
87
|
+
const set = (name, msg) => setErrors((e) => {
|
|
88
|
+
if (msg === null) {
|
|
89
|
+
if (!(name in e)) return e;
|
|
90
|
+
const { [name]: _gone, ...rest } = e;
|
|
91
|
+
return rest;
|
|
92
|
+
}
|
|
93
|
+
return e[name] === msg ? e : { ...e, [name]: msg };
|
|
94
|
+
});
|
|
95
|
+
const onBlur = (ev) => {
|
|
96
|
+
const el = ev.target;
|
|
97
|
+
if (!isControl(el) || el instanceof HTMLInputElement && (el.type === "radio" || el.type === "checkbox" || el.type === "hidden")) return;
|
|
98
|
+
if (!el.value) return;
|
|
99
|
+
set(el.name, validationMessage(el, live.current));
|
|
100
|
+
};
|
|
101
|
+
const onInput = (ev) => {
|
|
102
|
+
const el = ev.target;
|
|
103
|
+
if (!isControl(el)) return;
|
|
104
|
+
setErrors((e) => {
|
|
105
|
+
if (!(el.name in e)) return e;
|
|
106
|
+
const msg = el.validity.valid ? null : validationMessage(el, live.current);
|
|
107
|
+
if (msg !== null) return e;
|
|
108
|
+
const { [el.name]: _gone, ...rest } = e;
|
|
109
|
+
return rest;
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
const onInvalid = (ev) => {
|
|
113
|
+
const el = ev.target;
|
|
114
|
+
if (!isControl(el)) return;
|
|
115
|
+
ev.preventDefault();
|
|
116
|
+
if (!batch) {
|
|
117
|
+
batch = [];
|
|
118
|
+
queueMicrotask(() => {
|
|
119
|
+
const list = batch ?? [];
|
|
120
|
+
batch = null;
|
|
121
|
+
const seen = /* @__PURE__ */ new Set();
|
|
122
|
+
const items = [];
|
|
123
|
+
const next = {};
|
|
124
|
+
for (const c of list) {
|
|
125
|
+
if (seen.has(c.name)) continue;
|
|
126
|
+
seen.add(c.name);
|
|
127
|
+
const msg = validationMessage(c, live.current) ?? live.current.valueMissing;
|
|
128
|
+
next[c.name] = msg;
|
|
129
|
+
items.push({ name: c.name, id: c.id || c.name, label: labelOf(c), message: msg });
|
|
130
|
+
}
|
|
131
|
+
setErrors((e) => ({ ...e, ...next }));
|
|
132
|
+
setSummary(items);
|
|
133
|
+
setSummaryKey((k) => k + 1);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
batch.push(el);
|
|
137
|
+
};
|
|
138
|
+
form.addEventListener("focusout", onBlur);
|
|
139
|
+
form.addEventListener("input", onInput);
|
|
140
|
+
form.addEventListener("change", onInput);
|
|
141
|
+
form.addEventListener("invalid", onInvalid, true);
|
|
142
|
+
return () => {
|
|
143
|
+
form.removeEventListener("focusout", onBlur);
|
|
144
|
+
form.removeEventListener("input", onInput);
|
|
145
|
+
form.removeEventListener("change", onInput);
|
|
146
|
+
form.removeEventListener("invalid", onInvalid, true);
|
|
147
|
+
};
|
|
148
|
+
}, [formRef]);
|
|
149
|
+
const shown = summary ? summary.filter((s) => s.name in errors).map((s) => ({ ...s, message: errors[s.name] })) : null;
|
|
150
|
+
return {
|
|
151
|
+
errors,
|
|
152
|
+
summary: shown && shown.length ? shown : null,
|
|
153
|
+
summaryKey,
|
|
154
|
+
clear: () => {
|
|
155
|
+
setErrors({});
|
|
156
|
+
setSummary(null);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
function ErrorSummary({ items, focusKey, locale, messages, title, className, classNames: cx = {} }) {
|
|
161
|
+
const ref = react.useRef(null);
|
|
162
|
+
const m = fieldMessages(locale, messages);
|
|
163
|
+
const has = !!items && items.length > 0;
|
|
164
|
+
react.useEffect(() => {
|
|
165
|
+
if (has) ref.current?.focus();
|
|
166
|
+
}, [focusKey]);
|
|
167
|
+
if (!has) return null;
|
|
168
|
+
const n = items.length;
|
|
169
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, role: "alert", tabIndex: -1, className, "data-sf-error-summary": true, "aria-labelledby": "sf-error-summary-title", children: [
|
|
170
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { id: "sf-error-summary-title", className: cx.title, "data-sf-error-summary-title": true, children: title ?? (n === 1 ? m.summaryOne : m.summaryMany.replace("{n}", String(n))) }),
|
|
171
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: cx.list, children: items.map((it) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
172
|
+
"a",
|
|
173
|
+
{
|
|
174
|
+
href: `#${it.id}`,
|
|
175
|
+
className: cx.link,
|
|
176
|
+
onClick: (e) => {
|
|
177
|
+
const el = document.getElementById(it.id);
|
|
178
|
+
if (!el) return;
|
|
179
|
+
e.preventDefault();
|
|
180
|
+
el.focus();
|
|
181
|
+
el.scrollIntoView?.({ block: "center" });
|
|
182
|
+
},
|
|
183
|
+
children: [
|
|
184
|
+
it.label,
|
|
185
|
+
": ",
|
|
186
|
+
it.message
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
) }, it.name)) })
|
|
190
|
+
] });
|
|
191
|
+
}
|
|
192
|
+
function CheckoutField(props) {
|
|
193
|
+
const { name, label, id = name, error, hint, optional = false, classNames: cx = {}, locale, messages, ...rest } = props;
|
|
194
|
+
const m = fieldMessages(locale, messages);
|
|
195
|
+
const hintId = hint ? `${id}-hint` : void 0;
|
|
196
|
+
const errorId = `${id}-error`;
|
|
197
|
+
const describedBy = [hintId, error ? errorId : void 0].filter(Boolean).join(" ") || void 0;
|
|
198
|
+
const common = {
|
|
199
|
+
id,
|
|
200
|
+
name,
|
|
201
|
+
required: !optional,
|
|
202
|
+
"aria-invalid": error ? true : void 0,
|
|
203
|
+
"aria-describedby": describedBy,
|
|
204
|
+
className: cx.input,
|
|
205
|
+
"data-sf-field-control": ""
|
|
206
|
+
};
|
|
207
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx.root, "data-sf-field": true, "data-invalid": error ? "" : void 0, children: [
|
|
208
|
+
/* @__PURE__ */ jsxRuntime.jsxs("label", { htmlFor: id, className: cx.label, "data-sf-label": label, children: [
|
|
209
|
+
label,
|
|
210
|
+
optional ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cx.optional, "data-sf-field-optional": true, children: [
|
|
211
|
+
" ",
|
|
212
|
+
m.optional
|
|
213
|
+
] }) : null
|
|
214
|
+
] }),
|
|
215
|
+
hint ? /* @__PURE__ */ jsxRuntime.jsx("p", { id: hintId, className: cx.hint, "data-sf-field-hint": true, children: hint }) : null,
|
|
216
|
+
rest.as === "select" ? (() => {
|
|
217
|
+
const { as: _as, children, ...select } = rest;
|
|
218
|
+
return /* @__PURE__ */ jsxRuntime.jsx("select", { ...select, ...common, children });
|
|
219
|
+
})() : (() => {
|
|
220
|
+
const { as: _as, ...input } = rest;
|
|
221
|
+
return /* @__PURE__ */ jsxRuntime.jsx("input", { ...input, ...common });
|
|
222
|
+
})(),
|
|
223
|
+
error ? /* @__PURE__ */ jsxRuntime.jsx("p", { id: errorId, className: cx.error, "data-sf-field-error": true, children: error }) : null
|
|
224
|
+
] });
|
|
225
|
+
}
|
|
226
|
+
var ES2 = {
|
|
227
|
+
email: "Correo",
|
|
228
|
+
phone: "Tel\xE9fono",
|
|
229
|
+
first_name: "Nombre",
|
|
230
|
+
last_name: "Apellidos",
|
|
231
|
+
zip: "C\xF3digo postal",
|
|
232
|
+
province: "Estado",
|
|
233
|
+
city: "Ciudad o municipio",
|
|
234
|
+
neighborhood: "Colonia",
|
|
235
|
+
address1: "Calle y n\xFAmero",
|
|
236
|
+
address2: "N\xFAmero interior o departamento",
|
|
237
|
+
reference: "Referencias para la entrega",
|
|
238
|
+
provincePlaceholder: "Elige tu estado",
|
|
239
|
+
address1Hint: "Por ejemplo: Av. Insurgentes Sur 1234",
|
|
240
|
+
referenceHint: "Entre qu\xE9 calles, color de la fachada\u2026",
|
|
241
|
+
emailHint: "Te enviamos aqu\xED la confirmaci\xF3n y el seguimiento.",
|
|
242
|
+
phoneHint: "Solo para la paqueter\xEDa, por si necesita contactarte.",
|
|
243
|
+
lookupFilled: "Completamos estado y ciudad con tu c\xF3digo postal."
|
|
244
|
+
};
|
|
245
|
+
var EN2 = {
|
|
246
|
+
email: "Email",
|
|
247
|
+
phone: "Phone",
|
|
248
|
+
first_name: "First name",
|
|
249
|
+
last_name: "Last name",
|
|
250
|
+
zip: "Postal code",
|
|
251
|
+
province: "State",
|
|
252
|
+
city: "City",
|
|
253
|
+
neighborhood: "Neighborhood",
|
|
254
|
+
address1: "Street and number",
|
|
255
|
+
address2: "Apartment, suite",
|
|
256
|
+
reference: "Delivery notes",
|
|
257
|
+
provincePlaceholder: "Choose your state",
|
|
258
|
+
address1Hint: "For example: 1234 Main St",
|
|
259
|
+
referenceHint: "Cross streets, building color\u2026",
|
|
260
|
+
emailHint: "We send the confirmation and tracking here.",
|
|
261
|
+
phoneHint: "Only for the carrier, in case they need to reach you.",
|
|
262
|
+
lookupFilled: "We filled in state and city from your postal code."
|
|
263
|
+
};
|
|
264
|
+
function addressFieldsMessages(locale, overrides) {
|
|
265
|
+
const base = (locale ?? "es-MX").toLowerCase().startsWith("en") ? EN2 : ES2;
|
|
266
|
+
return overrides ? { ...base, ...overrides } : base;
|
|
267
|
+
}
|
|
268
|
+
var join = (...c) => c.filter(Boolean).join(" ") || void 0;
|
|
269
|
+
var field = (cx, span) => ({ ...cx, root: join(cx.root, cx[span]) });
|
|
270
|
+
function ContactFields({ defaults = {}, names = {}, errors = {}, phone, hints = true, locale, messages, fieldMessages: fm, classNames: cx = {} }) {
|
|
271
|
+
const m = addressFieldsMessages(locale, messages);
|
|
272
|
+
const n = (k) => names[k] ?? k;
|
|
273
|
+
const common = { ...locale ? { locale } : {}, ...fm ? { messages: fm } : {} };
|
|
274
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
275
|
+
/* @__PURE__ */ jsxRuntime.jsx(CheckoutField, { ...common, name: n("email"), label: m.email, type: "email", autoComplete: "email", inputMode: "email", autoCapitalize: "none", spellCheck: false, defaultValue: defaults.email ?? "", error: errors[n("email")] ?? null, hint: hints ? m.emailHint : void 0, classNames: field(cx, "wide") }),
|
|
276
|
+
/* @__PURE__ */ jsxRuntime.jsx(CheckoutField, { ...common, name: n("phone"), label: m.phone, type: "tel", autoComplete: "tel", inputMode: "tel", defaultValue: defaults.phone ?? "", error: errors[n("phone")] ?? null, hint: hints ? m.phoneHint : void 0, classNames: field(cx, "wide"), ...phone?.pattern ? { pattern: phone.pattern } : {}, ...phone?.title ? { title: phone.title } : {}, ...phone?.minLength ? { minLength: phone.minLength } : {} }),
|
|
277
|
+
/* @__PURE__ */ jsxRuntime.jsx(CheckoutField, { ...common, name: n("first_name"), label: m.first_name, autoComplete: "given-name", defaultValue: defaults.first_name ?? "", error: errors[n("first_name")] ?? null, classNames: field(cx, "half") }),
|
|
278
|
+
/* @__PURE__ */ jsxRuntime.jsx(CheckoutField, { ...common, name: n("last_name"), label: m.last_name, autoComplete: "family-name", defaultValue: defaults.last_name ?? "", error: errors[n("last_name")] ?? null, classNames: field(cx, "half") })
|
|
279
|
+
] });
|
|
280
|
+
}
|
|
281
|
+
function AddressFields(props) {
|
|
282
|
+
const { defaults, names = {}, errors = {}, countryCode, provinces, postalCode, lookupPostalCode, locale, messages, fieldMessages: fm, classNames: cx = {}, children } = props;
|
|
283
|
+
const showNeighborhood = props.neighborhood ?? true;
|
|
284
|
+
const showReference = props.reference ?? true;
|
|
285
|
+
const m = addressFieldsMessages(locale, messages);
|
|
286
|
+
const n = (k) => names[k] ?? k;
|
|
287
|
+
const common = { ...locale ? { locale } : {}, ...fm ? { messages: fm } : {} };
|
|
288
|
+
const listId = react.useId();
|
|
289
|
+
const [colonias, setColonias] = react.useState([]);
|
|
290
|
+
const [filled, setFilled] = react.useState(false);
|
|
291
|
+
const lastZip = react.useRef(null);
|
|
292
|
+
const zipRef = react.useRef(null);
|
|
293
|
+
const lookupRef = react.useRef(lookupPostalCode);
|
|
294
|
+
lookupRef.current = lookupPostalCode;
|
|
295
|
+
const runLookup = (zip) => {
|
|
296
|
+
const lookup = lookupRef.current;
|
|
297
|
+
if (!lookup || !zip || zip === lastZip.current) return;
|
|
298
|
+
if (postalCode?.pattern && !new RegExp(`^(?:${postalCode.pattern})$`).test(zip)) return;
|
|
299
|
+
lastZip.current = zip;
|
|
300
|
+
const form = zipRef.current?.closest("form");
|
|
301
|
+
void lookup(zip).then(
|
|
302
|
+
(info) => {
|
|
303
|
+
if (!info || lastZip.current !== zip) return;
|
|
304
|
+
const fill2 = (name, value) => {
|
|
305
|
+
const el = form?.elements.namedItem(name);
|
|
306
|
+
if (!el || !value || "length" in el && !(el instanceof HTMLSelectElement)) return false;
|
|
307
|
+
if (el.value && el.dataset.sfAutofilled !== "1") return false;
|
|
308
|
+
if (el instanceof HTMLSelectElement && ![...el.options].some((o) => o.value === value)) return false;
|
|
309
|
+
el.value = value;
|
|
310
|
+
el.dataset.sfAutofilled = "1";
|
|
311
|
+
el.dispatchEvent(new Event("input", { bubbles: true }));
|
|
312
|
+
return true;
|
|
313
|
+
};
|
|
314
|
+
const a = fill2(n("province"), info.province);
|
|
315
|
+
const b = fill2(n("city"), info.city);
|
|
316
|
+
setColonias(info.neighborhoods ?? []);
|
|
317
|
+
setFilled(a || b);
|
|
318
|
+
},
|
|
319
|
+
() => {
|
|
320
|
+
}
|
|
321
|
+
);
|
|
322
|
+
};
|
|
323
|
+
react.useEffect(() => {
|
|
324
|
+
const zip = defaults?.zip;
|
|
325
|
+
if (zip) runLookup(zip);
|
|
326
|
+
}, []);
|
|
327
|
+
const numericZip = postalCode?.inputMode === "numeric";
|
|
328
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
329
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: zipRef, className: join(cx.half), "data-sf-zip": true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
330
|
+
CheckoutField,
|
|
331
|
+
{
|
|
332
|
+
...common,
|
|
333
|
+
name: n("zip"),
|
|
334
|
+
label: m.zip,
|
|
335
|
+
autoComplete: "postal-code",
|
|
336
|
+
inputMode: postalCode?.inputMode ?? "text",
|
|
337
|
+
...postalCode?.pattern ? { pattern: postalCode.pattern } : {},
|
|
338
|
+
...postalCode?.maxLength ? { maxLength: postalCode.maxLength } : {},
|
|
339
|
+
...postalCode?.title ? { title: postalCode.title } : {},
|
|
340
|
+
...numericZip ? { autoCapitalize: "none" } : {},
|
|
341
|
+
defaultValue: defaults?.zip ?? "",
|
|
342
|
+
error: errors[n("zip")] ?? null,
|
|
343
|
+
classNames: { ...cx, root: cx.root },
|
|
344
|
+
onInput: (e) => {
|
|
345
|
+
const v = e.currentTarget.value.trim();
|
|
346
|
+
if (postalCode?.maxLength && v.length === postalCode.maxLength) runLookup(v);
|
|
347
|
+
},
|
|
348
|
+
onBlur: (e) => runLookup(e.currentTarget.value.trim())
|
|
349
|
+
}
|
|
350
|
+
) }),
|
|
351
|
+
provinces && provinces.length ? /* @__PURE__ */ jsxRuntime.jsxs(CheckoutField, { ...common, as: "select", name: n("province"), label: m.province, autoComplete: "address-level1", defaultValue: defaults?.province ?? "", error: errors[n("province")] ?? null, classNames: field(cx, "half"), children: [
|
|
352
|
+
/* @__PURE__ */ jsxRuntime.jsx("option", { value: "", disabled: true, children: m.provincePlaceholder }),
|
|
353
|
+
provinces.map((p) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: p.name, children: p.name }, p.code ?? p.name))
|
|
354
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx(CheckoutField, { ...common, name: n("province"), label: m.province, autoComplete: "address-level1", defaultValue: defaults?.province ?? "", error: errors[n("province")] ?? null, classNames: field(cx, "half") }),
|
|
355
|
+
/* @__PURE__ */ jsxRuntime.jsx(CheckoutField, { ...common, name: n("city"), label: m.city, autoComplete: "address-level2", defaultValue: defaults?.city ?? "", error: errors[n("city")] ?? null, classNames: field(cx, "half") }),
|
|
356
|
+
showNeighborhood ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
357
|
+
CheckoutField,
|
|
358
|
+
{
|
|
359
|
+
...common,
|
|
360
|
+
name: n("neighborhood"),
|
|
361
|
+
label: m.neighborhood,
|
|
362
|
+
autoComplete: "address-level3",
|
|
363
|
+
optional: showNeighborhood !== "required",
|
|
364
|
+
defaultValue: defaults?.neighborhood ?? "",
|
|
365
|
+
error: errors[n("neighborhood")] ?? null,
|
|
366
|
+
classNames: field(cx, "half"),
|
|
367
|
+
...colonias.length ? { list: listId } : {}
|
|
368
|
+
}
|
|
369
|
+
) : null,
|
|
370
|
+
colonias.length ? /* @__PURE__ */ jsxRuntime.jsx("datalist", { id: listId, children: colonias.map((c) => /* @__PURE__ */ jsxRuntime.jsx("option", { value: c }, c)) }) : null,
|
|
371
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { role: "status", "aria-live": "polite", "data-sf-zip-status": true, style: filled ? void 0 : { position: "absolute", width: 1, height: 1, overflow: "hidden", clip: "rect(0 0 0 0)", whiteSpace: "nowrap" }, className: filled ? join(cx.hint, cx.wide) : void 0, children: filled ? m.lookupFilled : "" }),
|
|
372
|
+
/* @__PURE__ */ jsxRuntime.jsx(CheckoutField, { ...common, name: n("address1"), label: m.address1, autoComplete: "address-line1", defaultValue: defaults?.address1 ?? "", error: errors[n("address1")] ?? null, hint: m.address1Hint, classNames: field(cx, "wide") }),
|
|
373
|
+
/* @__PURE__ */ jsxRuntime.jsx(CheckoutField, { ...common, name: n("address2"), label: m.address2, autoComplete: "address-line2", optional: true, defaultValue: defaults?.address2 ?? "", error: errors[n("address2")] ?? null, classNames: field(cx, "half") }),
|
|
374
|
+
showReference ? /* @__PURE__ */ jsxRuntime.jsx(CheckoutField, { ...common, name: n("reference"), label: m.reference, optional: true, defaultValue: defaults?.reference ?? "", error: errors[n("reference")] ?? null, hint: m.referenceHint, classNames: field(cx, "wide"), maxLength: 200 }) : null,
|
|
375
|
+
/* @__PURE__ */ jsxRuntime.jsx("input", { type: "hidden", name: "country_code", value: countryCode }),
|
|
376
|
+
children
|
|
377
|
+
] });
|
|
378
|
+
}
|
|
379
|
+
var StorefrontContext = react.createContext(null);
|
|
380
|
+
function useOptionalStorefront() {
|
|
381
|
+
return react.useContext(StorefrontContext);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
// src/locale.ts
|
|
385
|
+
function useResolvedLocale(locale) {
|
|
386
|
+
const sf = useOptionalStorefront();
|
|
387
|
+
return locale ?? sf?.locale ?? "es-MX";
|
|
388
|
+
}
|
|
389
|
+
var ES3 = {
|
|
390
|
+
title: "Tu pedido",
|
|
391
|
+
subtotal: "Subtotal",
|
|
392
|
+
discount: "Descuento",
|
|
393
|
+
shipping: "Env\xEDo",
|
|
394
|
+
shippingPending: "Al elegir la entrega",
|
|
395
|
+
updating: "Actualizando\u2026",
|
|
396
|
+
free: "Gratis",
|
|
397
|
+
taxes: "Impuestos",
|
|
398
|
+
taxesIncluded: "Incluye {amount} de impuestos",
|
|
399
|
+
total: "Total",
|
|
400
|
+
quantity: "Cantidad: {n}",
|
|
401
|
+
show: "Ver resumen del pedido",
|
|
402
|
+
hide: "Ocultar resumen del pedido"
|
|
403
|
+
};
|
|
404
|
+
var EN3 = {
|
|
405
|
+
title: "Your order",
|
|
406
|
+
subtotal: "Subtotal",
|
|
407
|
+
discount: "Discount",
|
|
408
|
+
shipping: "Shipping",
|
|
409
|
+
shippingPending: "Calculated at delivery",
|
|
410
|
+
updating: "Updating\u2026",
|
|
411
|
+
free: "Free",
|
|
412
|
+
taxes: "Taxes",
|
|
413
|
+
taxesIncluded: "Includes {amount} in taxes",
|
|
414
|
+
total: "Total",
|
|
415
|
+
quantity: "Quantity: {n}",
|
|
416
|
+
show: "Show order summary",
|
|
417
|
+
hide: "Hide order summary"
|
|
418
|
+
};
|
|
419
|
+
function orderSummaryMessages(locale, overrides) {
|
|
420
|
+
const base = (locale ?? "es-MX").toLowerCase().startsWith("en") ? EN3 : ES3;
|
|
421
|
+
return overrides ? { ...base, ...overrides } : base;
|
|
422
|
+
}
|
|
423
|
+
var isZero = (m) => !!m && Number(m.amount) === 0;
|
|
424
|
+
var positive = (m) => !!m && Number(m.amount) > 0;
|
|
425
|
+
function OrderSummary(props) {
|
|
426
|
+
const { lines, cost, updating = false, renderLineMedia, renderAmount, title, headingLevel = 2, classNames: cx = {}, children } = props;
|
|
427
|
+
const locale = useResolvedLocale(props.locale);
|
|
428
|
+
const m = orderSummaryMessages(locale, props.messages);
|
|
429
|
+
const money = (v) => renderAmount ? renderAmount(v) : storefront.formatMoney(v, locale);
|
|
430
|
+
const H = headingLevel === 3 ? "h3" : "h2";
|
|
431
|
+
const discounts = cost.discounts?.filter((d) => positive(d.amount)) ?? [];
|
|
432
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx.root, "data-sf-summary": true, children: [
|
|
433
|
+
title === false ? null : /* @__PURE__ */ jsxRuntime.jsx(H, { className: cx.title, "data-sf-summary-title": true, children: title ?? m.title }),
|
|
434
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: cx.lines, "data-sf-summary-lines": true, children: lines.map((l) => {
|
|
435
|
+
const variant = l.merchandise.title && !/^default( title)?$/i.test(l.merchandise.title) ? l.merchandise.title : null;
|
|
436
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: cx.line, "data-sf-summary-line": true, children: [
|
|
437
|
+
renderLineMedia ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cx.media, "data-sf-summary-media": true, children: [
|
|
438
|
+
renderLineMedia(l),
|
|
439
|
+
l.quantity > 1 ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx.qty, "data-sf-summary-qty": true, "aria-hidden": "true", children: l.quantity }) : null
|
|
440
|
+
] }) : null,
|
|
441
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { "data-sf-summary-line-body": true, children: [
|
|
442
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: cx.lineTitle, "data-sf-summary-line-title": true, children: [
|
|
443
|
+
!renderLineMedia && l.quantity > 1 ? `${l.quantity} \xD7 ` : null,
|
|
444
|
+
l.merchandise.product.title
|
|
445
|
+
] }),
|
|
446
|
+
variant ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx.variant, "data-sf-summary-variant": true, children: variant }) : null,
|
|
447
|
+
renderLineMedia || l.quantity > 1 ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: { position: "absolute", width: 1, height: 1, overflow: "hidden", clip: "rect(0 0 0 0)", whiteSpace: "nowrap" }, children: m.quantity.replace("{n}", String(l.quantity)) }) : null
|
|
448
|
+
] }),
|
|
449
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx.linePrice, "data-sf-summary-line-price": true, children: money(l.cost.total) })
|
|
450
|
+
] }, l.id);
|
|
451
|
+
}) }),
|
|
452
|
+
children,
|
|
453
|
+
/* @__PURE__ */ jsxRuntime.jsxs("dl", { className: cx.totals, "data-sf-summary-totals": true, "aria-busy": updating || void 0, children: [
|
|
454
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx.row, "data-sf-summary-row": "subtotal", children: [
|
|
455
|
+
/* @__PURE__ */ jsxRuntime.jsx("dt", { children: m.subtotal }),
|
|
456
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { children: money(cost.subtotal) })
|
|
457
|
+
] }),
|
|
458
|
+
discounts.length ? discounts.map((d) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx.row ? `${cx.row} ${cx.discount ?? ""}`.trim() : cx.discount, "data-sf-summary-row": "discount", children: [
|
|
459
|
+
/* @__PURE__ */ jsxRuntime.jsx("dt", { children: d.code ? `${m.discount} (${d.code})` : d.title || m.discount }),
|
|
460
|
+
/* @__PURE__ */ jsxRuntime.jsxs("dd", { children: [
|
|
461
|
+
"\u2212",
|
|
462
|
+
money(d.amount)
|
|
463
|
+
] })
|
|
464
|
+
] }, d.id)) : positive(cost.discount) ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx.row ? `${cx.row} ${cx.discount ?? ""}`.trim() : cx.discount, "data-sf-summary-row": "discount", children: [
|
|
465
|
+
/* @__PURE__ */ jsxRuntime.jsx("dt", { children: m.discount }),
|
|
466
|
+
/* @__PURE__ */ jsxRuntime.jsxs("dd", { children: [
|
|
467
|
+
"\u2212",
|
|
468
|
+
money(cost.discount)
|
|
469
|
+
] })
|
|
470
|
+
] }) : null,
|
|
471
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx.row, "data-sf-summary-row": "shipping", children: [
|
|
472
|
+
/* @__PURE__ */ jsxRuntime.jsx("dt", { children: m.shipping }),
|
|
473
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { className: updating || !cost.shipping ? cx.muted : void 0, children: updating ? m.updating : !cost.shipping ? m.shippingPending : isZero(cost.shipping) ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx.free, children: m.free }) : money(cost.shipping) })
|
|
474
|
+
] }),
|
|
475
|
+
positive(cost.tax) && !cost.tax_included ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx.row, "data-sf-summary-row": "tax", children: [
|
|
476
|
+
/* @__PURE__ */ jsxRuntime.jsx("dt", { children: m.taxes }),
|
|
477
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { children: money(cost.tax) })
|
|
478
|
+
] }) : null,
|
|
479
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx.total, "data-sf-summary-row": "total", children: [
|
|
480
|
+
/* @__PURE__ */ jsxRuntime.jsx("dt", { children: m.total }),
|
|
481
|
+
/* @__PURE__ */ jsxRuntime.jsx("dd", { "aria-live": "polite", "data-updating": updating || void 0, children: money(cost.total) })
|
|
482
|
+
] })
|
|
483
|
+
] }),
|
|
484
|
+
positive(cost.tax) && cost.tax_included ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: cx.note, "data-sf-summary-tax-note": true, children: m.taxesIncluded.split("{amount}").flatMap((part, i) => i === 0 ? [part] : [/* @__PURE__ */ jsxRuntime.jsx("span", { children: money(cost.tax) }, i), part]) }) : null
|
|
485
|
+
] });
|
|
486
|
+
}
|
|
487
|
+
function OrderSummaryDisclosure({ total, updating, renderAmount, locale: loc, messages, defaultOpen = false, className, classNames: cx = {}, children }) {
|
|
488
|
+
const locale = useResolvedLocale(loc);
|
|
489
|
+
const m = orderSummaryMessages(locale, messages);
|
|
490
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("details", { className, "data-sf-summary-disclosure": true, ...defaultOpen ? { open: true } : {}, children: [
|
|
491
|
+
/* @__PURE__ */ jsxRuntime.jsxs("summary", { className: cx.summary, "data-sf-summary-toggle": true, children: [
|
|
492
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: cx.label, "data-sf-summary-toggle-label": true, children: [
|
|
493
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-sf-summary-show": true, children: m.show }),
|
|
494
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-sf-summary-hide": true, children: m.hide })
|
|
495
|
+
] }),
|
|
496
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx.total, "data-sf-summary-toggle-total": true, "data-updating": updating || void 0, children: renderAmount ? renderAmount(total) : storefront.formatMoney(total, locale) })
|
|
497
|
+
] }),
|
|
498
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cx.panel, "data-sf-summary-panel": true, children })
|
|
499
|
+
] });
|
|
500
|
+
}
|
|
501
|
+
|
|
7
502
|
// src/checkout/brands/logos.generated.ts
|
|
8
503
|
var LOGOS = {
|
|
9
504
|
"7eleven": { src: "data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 xmlns:xlink=%22http://www.w3.org/1999/xlink%22 xml:space=%22preserve%22 viewBox=%220 0 45 59.89%22%3E%3Cdefs%3E%3Cpath id=%22a%22 d=%22M0 0h45v59.9H0z%22/%3E%3C/defs%3E%3CclipPath id=%22b%22%3E%3Cuse xlink:href=%22%23a%22 style=%22overflow:visible%22/%3E%3C/clipPath%3E%3Cpath d=%22M34.2 45c.9 0 1.7.8 1.7 1.7s-.7 1.7-1.7 1.7c-.9 0-1.6-.8-1.6-1.7s.7-1.7 1.6-1.7m0 3c.7 0 1.3-.6 1.3-1.3 0-.8-.6-1.3-1.3-1.3s-1.3.6-1.3 1.3c0 .8.6 1.3 1.3 1.3m-.2-.4h-.3v-1.8h.6q.6 0 .6.6c0 .3-.2.5-.4.5l.4.7h-.4l-.4-.7H34zm.2-1q.3 0 .3-.3t-.3-.3H34v.5h.2zm8-14.3c-.9 0-1.5.4-2.1.9l-.4.6-.1-.1.5-.8v-.5h-3.2V43h2.9v-6.7c0-1.1.7-1.4 1.2-1.5s1.1.2 1.1.8V43H45v-7.3c0-2.3-1-3.4-2.8-3.4M9.9 40.6h3v2.3H7V32.3h2.9zM0 42.9h5.9v-2.1h-3v-2.3h3v-2h-3v-2h3v-2.2H0zm13.9 0h6v-2.1h-3.1v-2.3h3.1v-2h-3.1v-2h3.1v-2.2h-6zm16 0h6v-2.1h-3.1v-2.3h3.1v-2h-3.1v-2h3.1v-2.2h-6zm-3.8-10.6L25 39l-.1 1.2v.1h-.1v-.1l-.1-1.2-1.1-6.7h-2.9l2.4 10.6h3.6l2.4-10.6z%22 style=%22clip-path:url(%23b);fill:%23147350%22/%3E%3Cpath d=%22M37.7 0H0v15h19.9C24.4 8.5 30.5 3.3 37.7 0%22 style=%22clip-path:url(%23b);fill:%23ff6c00%22/%3E%3Cpath d=%22M15 59.9h15v-15H15zM45 15V0a40.7 40.7 0 0 0-28.9 30h15.3A25.8 25.8 0 0 1 45 15%22 style=%22clip-path:url(%23b);fill:%23eb0f2a%22/%3E%3C/svg%3E", ar: 0.751, mono: false },
|
|
@@ -26,6 +521,7 @@ var LOGOS = {
|
|
|
26
521
|
"mastercard": { src: "data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 1000 618%22%3E%3Cpath fill=%22%23EB001B%22 d=%22M308 0a309 309 0 1 0 2 0z%22/%3E%3Cpath fill=%22%23F79E1B%22 d=%22M690 0a309 309 0 1 0 2 0z%22/%3E%3Cpath fill=%22%23FF5F00%22 d=%22M500 66a309 309 0 0 0 0 486 309 309 0 0 0 0-486%22/%3E%3C/svg%3E", ar: 1.618, mono: false },
|
|
27
522
|
"mercadopago": { src: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAARwAAABKCAMAAABeihuMAAAAdVBMVEVMaXEJAIAJAIAHAIEJAH8JAH8JAIALAIMJAH8JAH8JAH8KAIAKAH8JAH8JAH8JAH8KAID///8AvP8PEIomKZdESafp6PQIJZkGP6sBnOoCh9x/gMEFVrvW1ev29vsAtfthZbUDdtC+u96WlcypqNQEZ8YBq/T2IV9RAAAAEHRSTlMAPcQdoLJNDnWO1Cz44u5ezseTAgAAAAlwSFlzAAALEgAACxIB0t1+/AAADNNJREFUeJztXNeSozoQJZlom/YCTjin///EW1J3C0kI7Amerbm152XKjMDoqLNa9rx/+Ic3I0nCMCwQYRgmiferERbFd8wg8cssmEEf8yBK49D7jYjnAOB/8SFJnOVERbVar3e73e5+3+126/WqouuzqPx1BIVT+Co5RYrErNb37eb4p4fH9rxbIUHZV1fhZ5HKt/78O4coMqvd1kGLjs15LYRoHv0ifrIvkRNPhCKtnxGjCJISlKfJ/5+cJBXmd719jRjFTwUwzcL/NzlJOgdYnV+UGR3b9Ufo8bPJZMK2qkijySSLTclL4jSKoqxv78Myy6KSPhRlFkVZat6bxFkkHm/eW6TicYlNTphGQZ4HLziWcgaw+pjQaOIj6HlJuWJ2grnveeGEg4NUm18mXYrAxFjjMpAXM3wOfjBHJZnw1IiASfR8GjpNDXIK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sWcsbNli3WmQea17nXXb57Mvpd1PiBpjcyyaEeFLYydFyDEqpctdKkLrbfx86Y8BzPuzvuKTw2rgOxiMf6WRGBv2qW+j6dbBCKg7ELlikoo1IyPc1iP+aKhgj21KGFJPEpQX9DgNx75RGReAFkvEfkxnXYRdLASXmp9rRjR92GyOmfgpm/9QRld1rr0/Q85LEHXMfhoAPJmdsT4/MaCtRuYQxkcnotJVwEexe0E3Prz5zW25AdfmYcyXfP7fNxVnw86b8W5lyYQ5nsvJsb7aylMLxDh6menMaSGD+LRjEMHyeCoHAUlvOudhXS9XmpgkD7bSc/cSqZ7aPEylWhcavTma2wxJNTjCp9iLNJoA4ICxRZkM9msyBKzR2bkI71JqYH52O9XOd4N3iVCKvd8GlFFhl1sKa3QTAAK7f6AMqR0PJHwCeMFUQbiVuExPEqkxitzex7yAkjAT5wlr+rWPw6tLPaHVar9e5+P5+32+35fL7rv4OiYfbKofIPSY5WQ6adKmcy+4Pwu666j6A74P595HCncJTySfq/qFWEhCuVL2OevWpFkJxXjaj9Hn9bcBBFd8j4KT70AzrZh4J9s3N2+FT8jyPpfnhphJiPutI0CCYfyKDpRDXJzduDvQ8h8dPI+ZNdP/ajXfiTNVJsxn+J468hScRPvckDX74vf/DtJ3VfNO34/o9+5T94Y/gPvUlwdceZIU0AAAAASUVORK5CYII=", ar: 3.838, mono: false },
|
|
28
523
|
"oxxo": { src: "data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 version=%221.0%22 viewBox=%2235.43 35.45 885.83 448.9%22%3E%3Cpath d=%22M-792.46-878.05c0-29.6 23.78-53.62 53.13-53.62H40.12c29.33 0 53.13 24.02 53.13 53.62v339.17c0 29.6-23.8 53.6-53.13 53.6h-779.45c-29.35 0-53.13-24-53.13-53.6z%22 style=%22fill:%23fff;fill-opacity:1;fill-rule:nonzero;stroke:none%22 transform=%22translate(827.89 968.22)%22/%3E%3Cpath d=%22M-791.84-883.46c0-27.22 21.88-49.3 48.86-49.3h787.5c26.99 0 48.85 22.08 48.85 49.3v1.57h-885.21zM93.37-534.4v1.22c0 27.23-21.86 49.31-48.84 49.31h-787.5c-26.99 0-48.87-22.08-48.87-49.3v-1.23z%22 style=%22fill:%23fbb110;fill-opacity:1;fill-rule:nonzero;stroke:none%22 transform=%22translate(827.89 968.22)%22/%3E%3Cpath d=%22M-179.2-708.84c0 68.92 55.35 124.79 123.66 124.79 68.29 0 123.67-55.87 123.67-124.8s-55.38-124.8-123.67-124.8c-68.3 0-123.66 55.87-123.66 124.82m-589.6 0c0 68.92 55.37 124.79 123.68 124.79 68.29 0 123.67-55.87 123.67-124.8s-55.38-124.81-123.67-124.81c-68.3 0-123.69 55.87-123.69 124.82m862.17 150.8h-609.75c10.99-7.78 21.22-18.43 32.39-32.8l62.11-80 27.13 34.6 30.19-40.52-26.4-33.9 63.22-81.44c20.07-25.83-18.31-56.19-38.4-30.36L-422-750.47l-56.8-72.93c-20.1-25.76-58.42 4.67-38.32 30.46l64.2 82.3-69.46 89.44c-24.68 31.78-49.31 60.92-98.2 63.17h-171.26v-300.24h606.54c-10.43 7.7-20.27 18-30.94 31.76l-62.1 79.96-27.15-34.57-30.16 40.52 26.4 33.89-63.25 81.43c-20.05 25.83 18.34 56.19 38.4 30.36l55.89-71.96 56.8 72.91c20.1 25.78 58.42-4.65 38.32-30.43l-64.2-82.34 69.46-89.41c22.67-29.23 45.32-56.22 86.8-62.12h184.4zm-222.94-150.81c0-41.28 33.15-74.73 74.03-74.73s74.02 33.45 74.02 74.73c0 41.25-33.13 74.7-74.02 74.7s-74.03-33.45-74.03-74.7m-589.58 0c0-41.28 33.15-74.73 74.03-74.73 40.87 0 74.02 33.45 74.02 74.73 0 41.25-33.15 74.7-74.02 74.7-40.88 0-74.03-33.45-74.03-74.7%22 style=%22fill:%23e70020;fill-opacity:1;fill-rule:nonzero;stroke:none%22 transform=%22translate(827.89 968.22)%22/%3E%3C/svg%3E", ar: 1.973, mono: false },
|
|
524
|
+
"paquetexpress": { src: "data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8c.1 0 .2-.1.2-.1V45v-.2c-.1-.1-.1-.1-.2-.1-.1-.1-.2-.1-.4-.1h-.4v.7zm-.5 1.5v-2.6h1.1c.2 0 .4 0 .6.1.1 0 .2.1.3.2 0 .1.1.3.1.4 0 .2-.1.4-.2.5-.1.2-.3.2-.5.3.1 0 .2.1.3.2 0 .1.1.2.3.4l.3.5h-.6l-.4-.5c-.1-.2-.2-.4-.3-.4 0-.1-.1-.1-.1-.1-.1-.1-.2-.1-.3-.1h-.1v1.1h-.5zM170.2 46.8h.4v-.5h-.4z%22%3E%3C/path%3E%3C/g%3E%3C/svg%3E", ar: 4.559, mono: false },
|
|
29
525
|
"paypal": { src: "data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 1310 439.6%22%3E%3Cpath d=%22M1310 0v328.3h-74.7V0zm-102.2 110.8v218.1h-66.4v-18.8c-8.4 8.2-18 14.4-28.6 18.8a87 87 0 0 1-34.7 7c-15.6 0-30.1-2.9-43.4-8.7-13.3-6.1-24.9-14.4-34.7-24.8-9.9-10.5-17.7-22.7-23.5-36.6-5.5-14.2-8.2-29.5-8.2-45.8s2.7-31.4 8.2-45.3c5.8-14.2 13.6-26.6 23.5-37.1a104.5 104.5 0 0 1 34.7-24.4c13.3-6.1 27.8-9.2 43.4-9.2 12.4 0 24 2.3 34.7 7a88 88 0 0 1 28.6 18.8V111h66.4zm-117.7 158.7c13.6 0 24.7-4.6 33.4-14q13.5-13.95 13.5-35.7c0-21.75-4.5-26.5-13.5-35.7-8.7-9.3-19.9-14-33.4-14s-24.9 4.6-33.9 14c-8.7 9.3-13 21.2-13 35.7s4.4 26.5 13 35.7c9 9.3 20.3 14 33.9 14M861.7 0c19.7 0 36.5 2.8 50.4 8.3s25.6 13.2 35.2 23.1c9.8 10.2 17.5 21.8 23 34.9s8.2 27.2 8.2 42.3-2.7 29.2-8.2 42.3a112 112 0 0 1-23 34.9c-9.5 9.9-21.3 17.6-35.2 23.1s-30.7 8.3-50.4 8.3h-36v111.6h-76V0zm-10.9 149.6c10.2 0 17.9-1 23.5-3.1 5.8-2.3 10.6-5.3 14.3-8.7 7.8-7.3 11.7-17 11.7-29.2s-3.9-21.9-11.7-29.2c-3.8-3.5-8.5-6.3-14.3-8.3-5.5-2.3-13.3-3.5-23.5-3.5h-25.2v82zm-381.1-38.8h82.5l56 104.6h.9L659 110.8h76.4L571.7 439.6h-76l74.7-150.4zm-14.7 0v218.1h-66.4v-18.8c-8.4 8.2-18 14.4-28.6 18.8a87 87 0 0 1-34.7 7c-15.6 0-30.1-2.9-43.4-8.7-13.3-6.1-24.9-14.4-34.7-24.8-9.8-10.5-17.7-22.7-23.5-36.6-5.5-14.2-8.2-29.5-8.2-45.8s2.7-31.4 8.2-45.3c5.8-14.2 13.6-26.6 23.5-37.1a103.5 103.5 0 0 1 34.7-24.4c13.3-6.1 27.8-9.2 43.4-9.2 12.4 0 24 2.3 34.7 7a88 88 0 0 1 28.6 18.8V111H455zM337.3 269.5c13.6 0 24.7-4.6 33.5-14q13.5-13.95 13.5-35.7c0-21.75-4.5-26.5-13.5-35.7-8.7-9.3-19.9-14-33.5-14s-24.9 4.6-33.9 14c-8.7 9.3-13 21.2-13 35.7s4.4 26.5 13 35.7c9 9.3 20.3 14 33.9 14M112 0c19.7 0 36.5 2.8 50.4 8.3s25.6 13.2 35.2 23.1c9.8 10.2 17.5 21.8 23 34.9s8.2 27.2 8.2 42.3-2.7 29.2-8.2 42.3a112 112 0 0 1-23 34.9c-9.5 9.9-21.3 17.6-35.2 23.1s-30.7 8.3-50.4 8.3H76v111.6H0V0zm-10.8 149.6c10.2 0 17.9-1 23.5-3.1 5.8-2.3 10.6-5.3 14.3-8.7 7.8-7.3 11.7-17 11.7-29.2s-3.9-21.9-11.7-29.2c-3.8-3.5-8.5-6.3-14.3-8.3-5.5-2.3-13.3-3.5-23.5-3.5H76v82z%22/%3E%3C/svg%3E", ar: 2.98, mono: true },
|
|
30
526
|
"santander": { src: "data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 version=%221.0%22 viewBox=%224 3.75 391.5 79%22%3E%3Cpath d=%22M-137.26 287.82a17.5 17.5 0 0 0 .55 7.23c.95 2.87 2.27 4.94 7.12 11.25 5.12 6.66 6.76 9.08 7.98 12.53 1 2.83 1.02 4.46.59 7.02 4.49.86 11.84 3.24 16.77 6.2 4.57 2.81 7.9 6.46 9.11 10 .72 2.09.7 5.33-.07 7.36a16 16 0 0 1-3.22 5.2c-5.9 6.46-17.6 11.1-31.67 12.59-3.11.32-10.74.56-13.36.4-18.8-1.1-33.92-7.59-38.22-16.42-1.8-3.67-1.75-6.83.14-10.46 1.55-3 5.82-6.7 10.83-9.4a85 85 0 0 1 14.2-5.43c.24 3.17 6.4 10.74 8.45 13.42 4.46 5.84 6.22 8.62 7.48 10.85.76 1.33 1.18 2.19.97 4.74 0 0 1.72-1.56 2.36-2.87.84-1.71 1.14-3.44.98-5.67-.2-2.68-.65-4.32-1.93-6.94-1.25-2.55-3.03-5.13-6.43-9.3-4.79-5.88-6.56-9.1-7.3-13.3-.8-4.66.5-9.6 3.18-12.02a10 10 0 0 1 1.53-1.04s-.08 1.2-.08 2.57c0 2.88.33 4.38 1.43 6.58 1.38 2.73 3.28 5.28 9.11 12.22 5.16 6.14 6.76 9.26 6.76 13.16v1.88s1.37-1.04 2-2c2-3.01 2.32-7.72.8-11.9-1.05-2.86-2.74-5.46-7.74-11.75-5.1-6.4-7.23-11.53-7.23-15.8s.92-8.35 4.91-10.9%22 style=%22fill:%23fe001e;fill-opacity:1;display:inline%22 transform=%22translate(184.65 -280.17)scale(.98661)%22/%3E%3Cg style=%22fill:%23fe001e;fill-opacity:1%22%3E%3Cpath d=%22M-41.6 350.75c.12-1.43.02-2.84-.14-3.59-.61-2.94-2.79-5.9-5.93-8.08a64 64 0 0 0-6.79-3.51c-5.94-2.75-7.6-3.74-9.09-5.4a7.2 7.2 0 0 1-2-5.38c0-1.55.08-2.01.58-3.1 1.62-3.52 5.65-5.4 10.35-4.8 2.76.35 4.21.97 5.84 2.5 1.7 1.59 2.57 3.43 3.04 6.46l.14 1.71h2.57l-.22-11.75-.85-.21c-.65-.16-4.9-.97-7.16-1.26-3.37-.42-4.73-.47-6.71-.24-3.84.44-7.01 1.9-9.4 4.31a12.2 12.2 0 0 0-3.81 8.4c-.2 3.42.9 6.25 3.34 8.67 2.04 2.03 2.92 2.56 9.24 5.57 8.1 3.85 9.93 4.99 11.16 7.88 1.06 2.51 1.14 5.33.04 7.59-2.82 5.76-11.7 7.26-17.22 2.92a11.4 11.4 0 0 1-4.06-6.61l-.26-1.34h-2.19l.39 11.26s4.2 1.13 6.17 1.33c1.48.16 2.95.45 4.44.45 3 0 4.38.39 7.48-.64 3.2-1.07 10.26-3.2 11.06-13.14m19.71-18.49c3.42 0 6.4 1.5 7.83 3.7a8.6 8.6 0 0 1 1.36 5.06v16.24c0 1.93 1.39 2.55 3.4 1.87l1.51-.58v2.13l-7.48 3.27c-.87.39-1.46-.5-1.88-2.13l-.47-1.57-1.24.98a11.7 11.7 0 0 1-7.52 2.66c-3.23.01-5.34-.43-7.44-3.78a8 8 0 0 1-.26-6.4c.96-2.18 2.86-3.3 10.85-6.39l5.4-2.02v-1.5c0-5.55-1.5-7.26-3.42-8.33-1.55-.86-3.6-.64-5.56.64-1.61 1.06-2.1 2.84-1.27 4.67.64 1.41.42.97.42 1.02l-4.39 2.31s-.76-1.3-.97-2c-1.01-3.3.28-5.17 5.24-7.9 2.59-1.42 4.11-1.95 5.89-1.95m4.06 15.39s-7.03 2.97-8.38 3.65c-1.08.55-2.32 1.53-2.73 2.33a5 5 0 0 0 .21 4.06 5.4 5.4 0 0 0 2.35 2.35c.35.15 1.53.42 2.35.43q2.52.02 5.22-2.18l.98-.81zm22.01-15.39v5.75l1.46-1.39c3.19-3 6.23-4.36 8.58-4.36 5.34 0 10.25 4.7 10.04 11.33v15.38c0 1.71.43 2.78 2.14 2.78h2.77v2.14H14.44v-2.14h2.14c1.7 0 2.35-1.07 2.35-2.78V343.6c0-3.2-1.18-4.8-2.14-5.77-1.28-1.28-2.84-1.64-5.13-1.5-1.77.12-3.6 1.06-5.68 2.75l-1.37 1.1v19.87c0 1.07.43 1.71 1.5 1.71h2.78v2.14H-5.64v-2.14h1.92c1.7 0 3-1.07 3-2.78v-16.45c0-4.27-1.3-5.55-4.92-3.63v-2.29c2.35-.7 6.62-2.84 8.97-4.34zm41.23 31.63c1.93 0 2.38-.22 4.17-1.73l3.52-2.97-.85-1.5-1.57.84c-2.35 1.25-4.2 1.51-6.55.44-2-.9-3.2-4.06-3.2-5.77v-17.3h9.82l1.07-3h-10.9v-9.82h-1.06c-2.57 4.7-6.41 9.18-11.11 11.96v.86h6.83v17.3c0 4.06 1.5 7.05 3.85 8.76a8.6 8.6 0 0 0 5.98 1.93m22.65-31.63c3.42 0 6.41 1.5 7.83 3.7a8.6 8.6 0 0 1 1.36 5.06v16.24c0 1.93 1.4 2.55 3.4 1.87l1.51-.58v2.13l-7.48 3.27c-.87.39-1.46-.5-1.87-2.13l-.48-1.57-1.24.98a11.7 11.7 0 0 1-7.52 2.66c-3.22.01-5.34-.43-7.44-3.78a8 8 0 0 1-.26-6.4c.96-2.18 2.87-3.3 10.85-6.39l5.4-2.02v-1.5c0-5.55-1.5-7.26-3.42-8.33-1.54-.86-3.6-.64-5.55.64-1.62 1.06-2.11 2.84-1.28 4.67.64 1.41.42.97.42 1.02l-4.39 2.31s-.75-1.3-.97-2c-1-3.3.28-5.17 5.24-7.9 2.6-1.42 4.11-1.95 5.9-1.95m4.06 15.39s-7.03 2.97-8.38 3.65c-1.08.55-2.32 1.53-2.73 2.33a5 5 0 0 0 .21 4.06 5.4 5.4 0 0 0 2.35 2.35c.36.15 1.53.42 2.35.43q2.52.02 5.22-2.18l.98-.81zm22-15.39v5.75l1.47-1.39c3.18-3 6.22-4.36 8.57-4.36 5.34 0 10.26 4.7 10.04 11.33v15.38c0 1.71.43 2.78 2.14 2.78h2.78v2.14h-14.75v-2.14h2.14c1.7 0 2.35-1.07 2.35-2.78V343.6c0-3.2-1.18-4.8-2.14-5.77-1.28-1.28-2.84-1.64-5.12-1.5-1.78.12-3.6 1.06-5.7 2.75l-1.36 1.1v19.87c0 1.07.43 1.71 1.5 1.71h2.78v2.14H84.3v-2.14h1.92c1.71 0 3-1.07 3-2.78v-16.45c0-4.27-1.29-5.55-4.92-3.63v-2.29c2.35-.7 6.62-2.84 8.97-4.34zm63.46 27.99v-2.13c-2.35 1.07-3.42 1.07-4.23.52-1.15-.78-1.12-2.23-1.12-2.23v-47h-.64a49 49 0 0 1-10.04 4.9v2.36c1.71-.64 2.99-.98 4.06-.43.7.39 1.07.85 1.07 1.92v15.98l-1.26-.5c-2.51-1.03-3.81-1.26-6.86-1.26-2.55 0-3.08.08-4.6.58-7.02 2.35-11.52 9.21-11.15 17.03.21 4.47 1.5 7.98 4.43 10.48 2.99 2.56 5.55 3.42 8.54 3.42 4.06 0 6.41-.81 9.36-2.81.9-.61 1.75-1.25 1.75-1.25a8.7 8.7 0 0 0 1.5 4.48zm-22.15-.38c-4-1.42-6.9-6.35-7.27-12.33-.47-7.48 3.67-12.71 10.06-12.71 2.69 0 4.75.73 7.23 2.58l1.23.91-.1 19.2-1.38.83a10.4 10.4 0 0 1-6.21 1.83c-2 .07-2.67.01-3.56-.3m45.11 3.69a26 26 0 0 0 6.95-3.1v-2.14c-2.35 1.71-6.08 2.77-9.4 2.78q-5.43 0-8.34-3.2c-2.83-3.16-3.63-5.77-4.12-12.18h22.5s0-3.21-1.28-6.2c-.88-2.05-1.71-3.63-4.06-5.13-2.2-1.4-5.17-2-7.7-2-2.62-.03-3.02.02-4.45.54-6.65 2.43-11.17 9.32-10.62 16.17.54 6.63 4.4 11.94 10.25 14.07 2.59.95 7.47 1.13 10.27.39m-12.28-26.4c1.5-1.49 3.2-2.34 5.98-2.34 2.56 0 4.27.64 5.98 2.35 1.29 1.28 1.93 2.35 2.2 5.98h-16.78c.27-2.56 1.12-4.49 2.62-5.98m32.48-4.92v7.06a23 23 0 0 1 4.05-5.13 7 7 0 0 1 4.92-1.93c1.07 0 3.84.86 3.84.86v6.4h-1.06c-.43-1.7-1.93-2.55-4.06-2.55-2.78 0-4.6 1.12-5.72 2.8s-1.55 2.54-1.55 6.17v14.1c0 1.07.43 1.71 1.5 1.71h2.78v2.14h-14.53v-2.14h1.92c1.7 0 3-1.07 3-2.78v-16.45c0-4.7-1.72-4.49-4.71-3.2v-2.14c2.78-1.07 6.2-2.57 8.76-4.92z%22 style=%22fill:%23fe001e;fill-opacity:1;display:inline%22 transform=%22translate(184.65 -280.17)scale(.98661)%22/%3E%3C/g%3E%3C/svg%3E", ar: 4.956, mono: false },
|
|
31
527
|
"scotiabank": { src: "data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220.14 0.09 71.91 10.28%22%3E%3Cpath d=%22M6.73 8.37q.24-.6.23-1.25c.02-.63-.2-1.24-.6-1.72a5 5 0 0 0-2.31-1.23q-.3-.09-.6-.22-.27-.13-.46-.33a.8.8 0 0 1-.2-.55c.01-.3.18-.57.44-.7a2 2 0 0 1 1.68 0q.36.12.69.32l.9-1.8A5 5 0 0 0 3.77.13q-.7 0-1.36.23A3 3 0 0 0 .7 2.06q-.24.6-.23 1.25c.02.68.31 1.32.8 1.8q.7.6 1.6.9l.8.27q.3.12.57.3a1 1 0 0 1 .31.36q.1.2.07.43a1 1 0 0 1-.3.58q-.44.31-.98.27-.61 0-1.18-.28a9 9 0 0 1-.95-.53L.13 9.27a4.8 4.8 0 0 0 4.62.84q.66-.23 1.21-.68.5-.46.77-1.06m5.82-.58a1.57 1.57 0 1 1 0-1.96l1.4-1.41a3.5 3.5 0 0 0-2.62-1.17c-1.96 0-3.65 1.4-3.65 3.55 0 2.16 1.7 3.56 3.66 3.56 1 0 1.96-.42 2.63-1.16zm0 0%22 style=%22fill:%23eb0f19;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:.352778%22/%3E%3Cpath d=%22M17.6 3.25a3.56 3.56 0 1 0-.01 7.11 3.56 3.56 0 0 0 0-7.11m0 5.12a1.57 1.57 0 1 1 .02-3.14 1.57 1.57 0 0 1-.02 3.14m8.09-4.95h-.97v-2.1h-2.13v2.1h-.97v1.92h.97v4.85h2.13V5.34h.97zM27.72.13a1.19 1.19 0 1 0 0 2.38 1.19 1.19 0 0 0 0-2.38m-1.06 3.29h2.12v6.77h-2.12zM37.1 10.2V3.42h-2.08v.71l-.2-.16a2.6 2.6 0 0 0-1.79-.72c-1.83 0-3.37 1.63-3.37 3.55 0 1.93 1.55 3.56 3.37 3.56.67 0 1.31-.25 1.8-.72l.2-.17v.72Zm-3.72-1.8a1.6 1.6 0 1 1 .02-3.2 1.6 1.6 0 0 1-.02 3.2m6.88 1.8v-.72l.2.17a2.6 2.6 0 0 0 1.8.72c1.82 0 3.37-1.63 3.37-3.56s-1.55-3.56-3.38-3.56c-.67 0-1.31.26-1.8.72l-.19.17V.3H38.2v9.9Zm.05-3.39a1.6 1.6 0 1 1 1.6 1.6 1.6 1.6 0 0 1-1.6-1.6m13.47 3.39V3.42h-2.07v.71l-.2-.16a2.6 2.6 0 0 0-1.79-.72c-1.83 0-3.37 1.63-3.37 3.55 0 1.93 1.55 3.56 3.37 3.56.67 0 1.32-.25 1.8-.72l.2-.17v.72Zm-3.7-1.8a1.6 1.6 0 1 1 0-3.2 1.6 1.6 0 0 1 0 3.2m8.12-3.16c.69 0 1.26.57 1.26 1.27v3.7h2.12V6.24c0-1.8-1.04-2.97-2.68-2.97-.68 0-1.39.3-1.97 1.24V3.44H54.8v6.76h2.11V6.5a1.27 1.27 0 0 1 1.28-1.26m11.13 4.96-2.6-3.4 2.42-3.38h-2.48L64.7 6.16V.3h-2.13v9.9h2.13V7.4l2.14 2.8zm1.5-2.37a1.19 1.19 0 1 0-.01 2.37 1.19 1.19 0 0 0 .01-2.37m0 2.13a.95.95 0 1 1 0-1.9.95.95 0 0 1 0 1.9m0 0%22 style=%22fill:%23eb0f19;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:.352778%22/%3E%3Cpath d=%22M70.82 9.2h-.19v.46h-.23v-1.3h.5c.23 0 .42.2.42.43q-.02.27-.24.38l.27.49h-.28Zm-.19-.2h.27q.18-.02.2-.2a.2.2 0 0 0-.2-.2h-.27zm0 0%22 style=%22fill:%23eb0f19;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:.352778%22/%3E%3C/svg%3E", ar: 6.995, mono: false },
|
|
@@ -78,8 +574,8 @@ var LIST = [
|
|
|
78
574
|
B("googlepay", "Google Pay", "wallet", "#FFFFFF", "#3C4043", "G Pay"),
|
|
79
575
|
// Cash points and transfers (Mexico).
|
|
80
576
|
B("oxxo", "OXXO", "cash", "#E21E26", "#FFE600"),
|
|
81
|
-
B("spei", "SPEI", "bank", "#14365F", "#FFFFFF"),
|
|
82
|
-
B("stp", "STP", "bank", "#14365F", "#FFFFFF", "SPEI"),
|
|
577
|
+
B("spei", "SPEI", "bank", "#14365F", "#FFFFFF", void 0, "transfer"),
|
|
578
|
+
B("stp", "STP", "bank", "#14365F", "#FFFFFF", "SPEI", "transfer"),
|
|
83
579
|
B("7eleven", "7-Eleven", "cash", "#00704A", "#FFFFFF", "7-11"),
|
|
84
580
|
B("circlek", "Circle K", "cash", "#DA291C", "#FFFFFF", "K"),
|
|
85
581
|
B("soriana", "Soriana", "cash", "#C8102E", "#FFFFFF"),
|
|
@@ -243,6 +739,14 @@ function BrandMark({ brand, logoUrl, size = 24, title, className }) {
|
|
|
243
739
|
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M24 8.52a9 9 0 0 1 0 14.96a9 9 0 0 1 0-14.96z", fill: "#FF5F00" })
|
|
244
740
|
] });
|
|
245
741
|
}
|
|
742
|
+
if (found?.shape === "transfer") {
|
|
743
|
+
const label = (found.mark ?? found.name).split("\n")[0];
|
|
744
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 48 32", width, height, className, style, "data-sf-brand-mark": key, "data-sf-brand-source": "badge", focusable: "false", ...a11y, children: [
|
|
745
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "0.5", y: "0.5", width: "47", height: "31", rx: "5", fill: found.bg, stroke: ring }),
|
|
746
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M6 12h11m0 0-3-3m3 3-3 3M17 20H6m0 0 3-3m-3 3 3 3", fill: "none", stroke: found.fg, strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
747
|
+
/* @__PURE__ */ jsxRuntime.jsx("text", { x: "33", y: "16.5", dominantBaseline: "central", textAnchor: "middle", fill: found.fg, fontFamily: "system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif", fontWeight: 800, fontSize: 11, textLength: 22, lengthAdjust: "spacingAndGlyphs", children: label })
|
|
748
|
+
] });
|
|
749
|
+
}
|
|
246
750
|
const text = found ? found.mark ?? found.name : monogram(brand ?? "");
|
|
247
751
|
const bg = found?.bg ?? "var(--sf-brand-mark-bg, #E7E9EE)";
|
|
248
752
|
const fg = found?.fg ?? "var(--sf-brand-mark-fg, #2B2F38)";
|
|
@@ -264,19 +768,83 @@ function BrandMark({ brand, logoUrl, size = 24, title, className }) {
|
|
|
264
768
|
lines.length > 1 ? lines.slice(0, 2).map((l, i) => /* @__PURE__ */ jsxRuntime.jsx("text", { x: "24", y: i === 0 ? 15 : 25.5, ...common, ...fit(l), children: l }, i)) : /* @__PURE__ */ jsxRuntime.jsx("text", { x: "24", y: "16", dominantBaseline: "central", letterSpacing: longest <= 4 ? 0.3 : 0, ...common, ...fit(text), children: text })
|
|
265
769
|
] });
|
|
266
770
|
}
|
|
267
|
-
var StorefrontContext = react.createContext(null);
|
|
268
|
-
function useOptionalStorefront() {
|
|
269
|
-
return react.useContext(StorefrontContext);
|
|
270
|
-
}
|
|
271
771
|
|
|
272
|
-
// src/
|
|
273
|
-
|
|
274
|
-
const
|
|
275
|
-
return
|
|
772
|
+
// src/checkout/recommend.ts
|
|
773
|
+
var costOf = (r) => {
|
|
774
|
+
const n = Number(r.cost.amount);
|
|
775
|
+
return Number.isFinite(n) ? n : null;
|
|
776
|
+
};
|
|
777
|
+
var daysOf = (r) => r.eta_days_max ?? r.eta_days_min ?? null;
|
|
778
|
+
var norm = (s) => (s ?? "").trim().toLowerCase();
|
|
779
|
+
var carrierKey = (r) => r.carrier ? brandKey(r.carrier) : r.provider ? brandKey(r.provider) : "";
|
|
780
|
+
function dedupeRates(rates) {
|
|
781
|
+
const best = /* @__PURE__ */ new Map();
|
|
782
|
+
const keyOf = (r) => `${carrierKey(r)}|${norm(r.service_code) || norm(r.title)}|${daysOf(r) ?? ""}|${r.cost.currency_code}`;
|
|
783
|
+
for (const r of rates) {
|
|
784
|
+
const k = keyOf(r);
|
|
785
|
+
const prev = best.get(k);
|
|
786
|
+
const c = costOf(r);
|
|
787
|
+
if (!prev || c !== null && (costOf(prev) === null || c < costOf(prev))) best.set(k, r);
|
|
788
|
+
}
|
|
789
|
+
const keep = new Set(best.values());
|
|
790
|
+
return rates.filter((r) => keep.has(r));
|
|
791
|
+
}
|
|
792
|
+
function recommendRates(input, options = {}) {
|
|
793
|
+
const count = Math.max(1, options.count ?? 3);
|
|
794
|
+
const rates = options.dedupe === false ? [...input] : dedupeRates(input);
|
|
795
|
+
const collapseAfter = options.collapseAfter ?? count + 1;
|
|
796
|
+
const sameCurrency = new Set(rates.map((r) => r.cost.currency_code)).size <= 1;
|
|
797
|
+
const byCost = (a, b) => (costOf(a) ?? Infinity) - (costOf(b) ?? Infinity);
|
|
798
|
+
const byDays = (a, b) => (daysOf(a) ?? Infinity) - (daysOf(b) ?? Infinity);
|
|
799
|
+
const tags = /* @__PURE__ */ new Map();
|
|
800
|
+
const tag = (r, t) => tags.set(r, [...tags.get(r) ?? [], t]);
|
|
801
|
+
const cheapest = sameCurrency && rates.length > 1 ? [...rates].sort((a, b) => byCost(a, b) || byDays(a, b))[0] : void 0;
|
|
802
|
+
if (cheapest && costOf(cheapest) !== null) tag(cheapest, "cheapest");
|
|
803
|
+
const fastest = rates.length > 1 ? [...rates].sort((a, b) => byDays(a, b) || byCost(a, b))[0] : void 0;
|
|
804
|
+
if (fastest && daysOf(fastest) !== null && (!cheapest || fastest === cheapest || (daysOf(cheapest) ?? Infinity) > daysOf(fastest))) tag(fastest, "fastest");
|
|
805
|
+
const chosen = [];
|
|
806
|
+
for (const r of [cheapest, fastest]) if (r && tags.has(r) && !chosen.includes(r)) chosen.push(r);
|
|
807
|
+
if (rates.length > collapseAfter) {
|
|
808
|
+
const rank = (sorted, val) => {
|
|
809
|
+
const out = /* @__PURE__ */ new Map();
|
|
810
|
+
let pos = 0;
|
|
811
|
+
let last;
|
|
812
|
+
sorted.forEach((r, i) => {
|
|
813
|
+
const v = val(r);
|
|
814
|
+
if (v !== last) pos = i;
|
|
815
|
+
last = v;
|
|
816
|
+
out.set(r, v === null ? sorted.length : pos);
|
|
817
|
+
});
|
|
818
|
+
return out;
|
|
819
|
+
};
|
|
820
|
+
const priceRank = rank([...rates].sort(byCost), costOf);
|
|
821
|
+
const timeRank = rank([...rates].sort(byDays), daysOf);
|
|
822
|
+
const rest = rates.filter((r) => !chosen.includes(r)).sort((a, b) => priceRank.get(a) + timeRank.get(a) - (priceRank.get(b) + timeRank.get(b)) || byCost(a, b));
|
|
823
|
+
let first = true;
|
|
824
|
+
for (const r of rest) {
|
|
825
|
+
if (chosen.length >= count) break;
|
|
826
|
+
chosen.push(r);
|
|
827
|
+
if (first) tag(r, "best_value");
|
|
828
|
+
first = false;
|
|
829
|
+
}
|
|
830
|
+
} else {
|
|
831
|
+
for (const r of rates) if (!chosen.includes(r)) chosen.push(r);
|
|
832
|
+
}
|
|
833
|
+
const recommended = chosen.sort(byCost).map((rate) => ({ rate, tags: tags.get(rate) ?? [] }));
|
|
834
|
+
const groups = /* @__PURE__ */ new Map();
|
|
835
|
+
for (const r of [...rates].sort(byCost)) {
|
|
836
|
+
if (chosen.includes(r)) continue;
|
|
837
|
+
const key = carrierKey(r);
|
|
838
|
+
const g = groups.get(key) ?? { key, carrier: r.carrier ?? r.provider ?? null, rates: [] };
|
|
839
|
+
g.rates.push(r);
|
|
840
|
+
groups.set(key, g);
|
|
841
|
+
}
|
|
842
|
+
const more = [...groups.values()];
|
|
843
|
+
return { recommended, more, moreCount: more.reduce((n, g) => n + g.rates.length, 0) };
|
|
276
844
|
}
|
|
277
845
|
|
|
278
846
|
// src/checkout/delivery.ts
|
|
279
|
-
var
|
|
847
|
+
var ES4 = {
|
|
280
848
|
etaOne: "Llega en 1 d\xEDa h\xE1bil",
|
|
281
849
|
etaMany: "Llega en {n} d\xEDas h\xE1biles",
|
|
282
850
|
etaRange: "Llega en {min} a {max} d\xEDas h\xE1biles",
|
|
@@ -290,11 +858,16 @@ var ES = {
|
|
|
290
858
|
quoteTomorrow: "Precios de env\xEDo vigentes hasta ma\xF1ana a las {time}.",
|
|
291
859
|
quoteLater: "Precios de env\xEDo vigentes hasta el {date}.",
|
|
292
860
|
quoteSoon: "Los precios de env\xEDo vencen pronto ({time}).",
|
|
293
|
-
partial: "
|
|
861
|
+
partial: "Algunas paqueter\xEDas no respondieron a tiempo; estas son las opciones disponibles.",
|
|
294
862
|
loading: "Buscando opciones de env\xEDo\u2026",
|
|
295
|
-
requoted: "Las tarifas de env\xEDo cambiaron y ya est\xE1n actualizadas. Revisa tu env\xEDo antes de pagar."
|
|
863
|
+
requoted: "Las tarifas de env\xEDo cambiaron y ya est\xE1n actualizadas. Revisa tu env\xEDo antes de pagar.",
|
|
864
|
+
bestValue: "Recomendado",
|
|
865
|
+
moreOptions: "Ver m\xE1s opciones ({n})",
|
|
866
|
+
otherCarriers: "Otras opciones",
|
|
867
|
+
error: "No pudimos consultar las opciones de env\xEDo en este momento.",
|
|
868
|
+
retry: "Intentar de nuevo"
|
|
296
869
|
};
|
|
297
|
-
var
|
|
870
|
+
var EN4 = {
|
|
298
871
|
etaOne: "Arrives in 1 business day",
|
|
299
872
|
etaMany: "Arrives in {n} business days",
|
|
300
873
|
etaRange: "Arrives in {min} to {max} business days",
|
|
@@ -310,10 +883,15 @@ var EN = {
|
|
|
310
883
|
quoteSoon: "Shipping prices expire soon ({time}).",
|
|
311
884
|
partial: "We couldn't reach every carrier. These are the options available now.",
|
|
312
885
|
loading: "Looking for delivery options\u2026",
|
|
313
|
-
requoted: "Shipping rates changed and are now up to date. Check your delivery before paying."
|
|
886
|
+
requoted: "Shipping rates changed and are now up to date. Check your delivery before paying.",
|
|
887
|
+
bestValue: "Recommended",
|
|
888
|
+
moreOptions: "Show more options ({n})",
|
|
889
|
+
otherCarriers: "Other options",
|
|
890
|
+
error: "We couldn't get delivery options right now.",
|
|
891
|
+
retry: "Try again"
|
|
314
892
|
};
|
|
315
893
|
function deliveryMessages(locale, overrides) {
|
|
316
|
-
const base = (locale ?? "es-MX").toLowerCase().startsWith("en") ?
|
|
894
|
+
const base = (locale ?? "es-MX").toLowerCase().startsWith("en") ? EN4 : ES4;
|
|
317
895
|
return overrides ? { ...base, ...overrides } : base;
|
|
318
896
|
}
|
|
319
897
|
var fill = (tpl, vars) => tpl.replace(/\{(\w+)\}/g, (_, k) => String(vars[k] ?? "")).replace(/\.\.$/, ".");
|
|
@@ -333,7 +911,7 @@ function rateService(rate) {
|
|
|
333
911
|
}
|
|
334
912
|
return title;
|
|
335
913
|
}
|
|
336
|
-
function rateEta(rate, messages =
|
|
914
|
+
function rateEta(rate, messages = ES4) {
|
|
337
915
|
const { eta_days_min: min, eta_days_max: max } = rate;
|
|
338
916
|
if (typeof min === "number" && typeof max === "number") {
|
|
339
917
|
if (min === max) return min === 1 ? messages.etaOne : fill(messages.etaMany, { n: min });
|
|
@@ -343,11 +921,11 @@ function rateEta(rate, messages = ES) {
|
|
|
343
921
|
if (typeof min === "number") return min === 1 ? messages.etaOne : fill(messages.etaFrom, { min });
|
|
344
922
|
return rate.eta ?? null;
|
|
345
923
|
}
|
|
346
|
-
var
|
|
924
|
+
var costOf2 = (r) => {
|
|
347
925
|
const n = Number(r.cost.amount);
|
|
348
926
|
return Number.isFinite(n) ? n : null;
|
|
349
927
|
};
|
|
350
|
-
var
|
|
928
|
+
var daysOf2 = (r) => r.eta_days_max ?? r.eta_days_min ?? null;
|
|
351
929
|
function rateBadges(rates) {
|
|
352
930
|
const out = /* @__PURE__ */ new Map();
|
|
353
931
|
if (rates.length < 2) return out;
|
|
@@ -361,10 +939,10 @@ function rateBadges(rates) {
|
|
|
361
939
|
};
|
|
362
940
|
const currencies = new Set(rates.map((r) => r.cost.currency_code));
|
|
363
941
|
if (currencies.size === 1) {
|
|
364
|
-
const id = unique(rates.map((r) => [r.id,
|
|
942
|
+
const id = unique(rates.map((r) => [r.id, costOf2(r)]));
|
|
365
943
|
if (id) add(id, "cheapest");
|
|
366
944
|
}
|
|
367
|
-
const fast = unique(rates.map((r) => [r.id,
|
|
945
|
+
const fast = unique(rates.map((r) => [r.id, daysOf2(r)]));
|
|
368
946
|
if (fast) add(fast, "fastest");
|
|
369
947
|
return out;
|
|
370
948
|
}
|
|
@@ -383,7 +961,7 @@ function quoteNote(deadline, opts = {}) {
|
|
|
383
961
|
const now = opts.now ?? /* @__PURE__ */ new Date();
|
|
384
962
|
const left = deadline.getTime() - now.getTime();
|
|
385
963
|
if (left <= 0) return null;
|
|
386
|
-
const m = opts.messages ??
|
|
964
|
+
const m = opts.messages ?? ES4;
|
|
387
965
|
const locale = opts.locale ?? "es-MX";
|
|
388
966
|
const tz = opts.timeZone ? { timeZone: opts.timeZone } : {};
|
|
389
967
|
const time = new Intl.DateTimeFormat(locale, { hour: "numeric", minute: "2-digit", ...tz }).format(deadline);
|
|
@@ -403,13 +981,13 @@ function isQuoteChange(err) {
|
|
|
403
981
|
}
|
|
404
982
|
function matchRate(previous, rates) {
|
|
405
983
|
if (!previous) return null;
|
|
406
|
-
const
|
|
407
|
-
const sameCarrier = (r) =>
|
|
984
|
+
const norm2 = (s) => (s ?? "").trim().toLowerCase();
|
|
985
|
+
const sameCarrier = (r) => norm2(r.carrier) === norm2(previous.carrier);
|
|
408
986
|
if (previous.service_code) {
|
|
409
|
-
const hit = rates.find((r) => sameCarrier(r) &&
|
|
987
|
+
const hit = rates.find((r) => sameCarrier(r) && norm2(r.service_code) === norm2(previous.service_code));
|
|
410
988
|
if (hit) return hit;
|
|
411
989
|
}
|
|
412
|
-
return rates.find((r) => sameCarrier(r) &&
|
|
990
|
+
return rates.find((r) => sameCarrier(r) && norm2(r.title) === norm2(previous.title)) ?? null;
|
|
413
991
|
}
|
|
414
992
|
var SR_ONLY = { position: "absolute", width: 1, height: 1, overflow: "hidden", clip: "rect(0 0 0 0)", whiteSpace: "nowrap" };
|
|
415
993
|
var useHydrated = () => react.useSyncExternalStore(
|
|
@@ -443,7 +1021,10 @@ function DeliveryOptions(props) {
|
|
|
443
1021
|
renderAmount,
|
|
444
1022
|
classNames: cx = {},
|
|
445
1023
|
testId,
|
|
446
|
-
children
|
|
1024
|
+
children,
|
|
1025
|
+
layout = "list",
|
|
1026
|
+
error,
|
|
1027
|
+
onRetry
|
|
447
1028
|
} = props;
|
|
448
1029
|
const locale = useResolvedLocale(props.locale);
|
|
449
1030
|
const m = react.useMemo(() => deliveryMessages(locale, props.messages), [locale, props.messages]);
|
|
@@ -456,7 +1037,13 @@ function DeliveryOptions(props) {
|
|
|
456
1037
|
const deadline = mode === "never" ? null : quoteDeadline(rates);
|
|
457
1038
|
const note = hydrated && deadline ? quoteNote(deadline, { locale, messages: m, ...timeZone ? { timeZone } : {} }) : null;
|
|
458
1039
|
const shownNote = note && (mode === "always" || note.soon) ? note : null;
|
|
459
|
-
const
|
|
1040
|
+
const current = value ?? defaultValue ?? null;
|
|
1041
|
+
const plan = react.useMemo(
|
|
1042
|
+
() => layout === "recommended" ? recommendRates(rates, { count: props.recommendedCount ?? 3 }) : null,
|
|
1043
|
+
[layout, rates, props.recommendedCount]
|
|
1044
|
+
);
|
|
1045
|
+
const inMore = plan ? plan.more.some((g) => g.rates.some((r) => rateValue(r) === current)) : false;
|
|
1046
|
+
const radio = (v, describedBy) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
460
1047
|
"input",
|
|
461
1048
|
{
|
|
462
1049
|
type: "radio",
|
|
@@ -464,36 +1051,66 @@ function DeliveryOptions(props) {
|
|
|
464
1051
|
value: v,
|
|
465
1052
|
required,
|
|
466
1053
|
className: cx.radio,
|
|
1054
|
+
...{},
|
|
467
1055
|
...value !== void 0 ? { checked: value === v, onChange: () => onValueChange?.(v) } : { defaultChecked: v === defaultValue, ...onValueChange ? { onChange: () => onValueChange(v) } : {} },
|
|
468
1056
|
...testId ? { "data-testid": testId } : {}
|
|
469
1057
|
}
|
|
470
1058
|
);
|
|
471
|
-
|
|
472
|
-
|
|
1059
|
+
const tagText = (t) => t === "cheapest" ? m.cheapest : t === "fastest" ? m.fastest : m.bestValue;
|
|
1060
|
+
const rateRow = (rate, opts) => {
|
|
1061
|
+
const carrier = rateCarrier(rate);
|
|
1062
|
+
const service = rateService(rate);
|
|
1063
|
+
const eta = rateEta(rate, m);
|
|
1064
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: cx.option, "data-sf-delivery-option": true, "data-loading": loading || void 0, "data-grouped": opts.grouped || void 0, children: [
|
|
1065
|
+
radio(rateValue(rate)),
|
|
1066
|
+
marks && !opts.grouped ? (
|
|
1067
|
+
// Fixed slot: logos of different widths do not push the text column out of line.
|
|
1068
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { "data-sf-delivery-mark": true, "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(BrandMark, { brand: rate.carrier ?? rate.provider ?? rate.title, size: 28, ...cx.mark ? { className: cx.mark } : {} }) })
|
|
1069
|
+
) : null,
|
|
1070
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: cx.body, "data-sf-delivery-body": true, children: [
|
|
1071
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx.title, "data-sf-delivery-title": true, children: carrier ? opts.grouped ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1072
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { style: SR_ONLY, children: [
|
|
1073
|
+
carrier,
|
|
1074
|
+
" "
|
|
1075
|
+
] }),
|
|
1076
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx.carrier, "data-sf-delivery-carrier": true, "data-sf-delivery-service-only": true, children: service })
|
|
1077
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1078
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx.carrier, "data-sf-delivery-carrier": true, children: carrier }),
|
|
1079
|
+
" ",
|
|
1080
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx.service, "data-sf-delivery-service": true, children: service })
|
|
1081
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx.carrier, "data-sf-delivery-carrier": true, children: service }) }),
|
|
1082
|
+
eta ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx.eta, "data-sf-delivery-eta": true, children: eta }) : null,
|
|
1083
|
+
opts.tags.length ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx.badges, "data-sf-delivery-badges": true, children: opts.tags.map((b) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx.badge, "data-sf-delivery-badge": b, children: tagText(b) }, b)) }) : null
|
|
1084
|
+
] }),
|
|
1085
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx.price, "data-sf-delivery-price": true, children: amount(rate.cost) })
|
|
1086
|
+
] }, rate.id);
|
|
1087
|
+
};
|
|
1088
|
+
const errorText = error ? typeof error === "string" ? error : m.error : null;
|
|
1089
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx.root, "data-sf-delivery": true, "data-layout": layout, "aria-busy": loading || void 0, children: [
|
|
1090
|
+
partial && !errorText ? /* @__PURE__ */ jsxRuntime.jsx("p", { role: "status", className: cx.partial, "data-sf-delivery-partial": true, children: m.partial }) : null,
|
|
473
1091
|
requoted ? /* @__PURE__ */ jsxRuntime.jsx("p", { role: "status", className: cx.partial, "data-sf-delivery-requoted": true, children: m.requoted }) : null,
|
|
474
1092
|
loading ? /* @__PURE__ */ jsxRuntime.jsx("span", { style: SR_ONLY, role: "status", "data-sf-delivery-loading": true, children: m.loading }) : null,
|
|
1093
|
+
errorText && rates.length === 0 && !loading ? /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "alert", className: cx.error, "data-sf-delivery-error": true, children: [
|
|
1094
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { children: errorText }),
|
|
1095
|
+
onRetry ? /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: cx.retry, onClick: onRetry, "data-sf-delivery-retry": true, children: m.retry }) : null
|
|
1096
|
+
] }) : null,
|
|
475
1097
|
children,
|
|
476
1098
|
loading && rates.length === 0 ? [0, 1, 2].map((i) => /* @__PURE__ */ jsxRuntime.jsx("div", { className: cx.skeleton, "data-sf-delivery-skeleton": true, "aria-hidden": "true" }, i)) : null,
|
|
477
|
-
rates.map((rate) => {
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
own.length ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx.badges, "data-sf-delivery-badges": true, children: own.map((b) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx.badge, "data-sf-delivery-badge": b, children: b === "cheapest" ? m.cheapest : m.fastest }, b)) }) : null
|
|
493
|
-
] }),
|
|
494
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cx.price, "data-sf-delivery-price": true, children: amount(rate.cost) })
|
|
495
|
-
] }, rate.id);
|
|
496
|
-
}),
|
|
1099
|
+
plan ? plan.recommended.map(({ rate, tags }) => rateRow(rate, { tags: showBadges ? tags : [] })) : rates.map((rate) => rateRow(rate, { tags: badges.get(rate.id) ?? [] })),
|
|
1100
|
+
plan && plan.moreCount > 0 ? /* @__PURE__ */ jsxRuntime.jsxs("details", { className: cx.more, "data-sf-delivery-more": true, ...inMore ? { open: true } : {}, children: [
|
|
1101
|
+
/* @__PURE__ */ jsxRuntime.jsx("summary", { className: cx.moreSummary, "data-sf-delivery-more-summary": true, children: m.moreOptions.replace("{n}", String(plan.moreCount)) }),
|
|
1102
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { "data-sf-delivery-groups": true, children: plan.more.map((g) => {
|
|
1103
|
+
const carrierName = g.carrier ? rateCarrier({ carrier: g.carrier }) : null;
|
|
1104
|
+
const id = `${name}-group-${g.key || "other"}`;
|
|
1105
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { role: "group", "aria-labelledby": id, className: cx.group, "data-sf-delivery-group": g.key || "other", children: [
|
|
1106
|
+
/* @__PURE__ */ jsxRuntime.jsxs("p", { id, className: cx.groupTitle, "data-sf-delivery-group-title": true, children: [
|
|
1107
|
+
marks && g.carrier ? /* @__PURE__ */ jsxRuntime.jsx(BrandMark, { brand: g.carrier, size: 22 }) : null,
|
|
1108
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: carrierName ?? m.otherCarriers })
|
|
1109
|
+
] }),
|
|
1110
|
+
g.rates.map((rate) => rateRow(rate, { tags: [], grouped: Boolean(carrierName) }))
|
|
1111
|
+
] }, g.key || "other");
|
|
1112
|
+
}) })
|
|
1113
|
+
] }) : null,
|
|
497
1114
|
pickup.map((b) => /* @__PURE__ */ jsxRuntime.jsxs("label", { className: cx.option, "data-sf-delivery-option": true, "data-sf-delivery-pickup": true, children: [
|
|
498
1115
|
radio(pickupValue(b)),
|
|
499
1116
|
marks ? /* @__PURE__ */ jsxRuntime.jsx(PickupGlyph, { size: 28 }) : null,
|
|
@@ -507,21 +1124,34 @@ function DeliveryOptions(props) {
|
|
|
507
1124
|
] });
|
|
508
1125
|
}
|
|
509
1126
|
|
|
1127
|
+
exports.AddressFields = AddressFields;
|
|
510
1128
|
exports.BrandMark = BrandMark;
|
|
1129
|
+
exports.CheckoutField = CheckoutField;
|
|
1130
|
+
exports.ContactFields = ContactFields;
|
|
511
1131
|
exports.DeliveryOptions = DeliveryOptions;
|
|
1132
|
+
exports.ErrorSummary = ErrorSummary;
|
|
1133
|
+
exports.OrderSummary = OrderSummary;
|
|
1134
|
+
exports.OrderSummaryDisclosure = OrderSummaryDisclosure;
|
|
1135
|
+
exports.addressFieldsMessages = addressFieldsMessages;
|
|
512
1136
|
exports.brandKey = brandKey;
|
|
513
1137
|
exports.brandLogo = brandLogo;
|
|
514
1138
|
exports.brandName = brandName;
|
|
1139
|
+
exports.dedupeRates = dedupeRates;
|
|
515
1140
|
exports.deliveryMessages = deliveryMessages;
|
|
1141
|
+
exports.fieldMessages = fieldMessages;
|
|
516
1142
|
exports.findBrand = findBrand;
|
|
517
1143
|
exports.isQuoteChange = isQuoteChange;
|
|
518
1144
|
exports.listBrands = listBrands;
|
|
519
1145
|
exports.matchRate = matchRate;
|
|
1146
|
+
exports.orderSummaryMessages = orderSummaryMessages;
|
|
520
1147
|
exports.quoteDeadline = quoteDeadline;
|
|
521
1148
|
exports.quoteNote = quoteNote;
|
|
522
1149
|
exports.rateBadges = rateBadges;
|
|
523
1150
|
exports.rateCarrier = rateCarrier;
|
|
524
1151
|
exports.rateEta = rateEta;
|
|
525
1152
|
exports.rateService = rateService;
|
|
1153
|
+
exports.recommendRates = recommendRates;
|
|
1154
|
+
exports.useFieldErrors = useFieldErrors;
|
|
1155
|
+
exports.validationMessage = validationMessage;
|
|
526
1156
|
//# sourceMappingURL=checkout.cjs.map
|
|
527
1157
|
//# sourceMappingURL=checkout.cjs.map
|