@ecomiq/storefront 3.1.1 → 3.2.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.
Files changed (78) hide show
  1. package/dist/{account-CZZ-ku6L.js → account-CLF4iS_r.js} +25 -8
  2. package/dist/account.d.ts +1 -0
  3. package/dist/{address-defaults-BqjRhS82.js → address-defaults-Bj8j8noq.js} +2 -1
  4. package/dist/address-defaults.d.ts +1 -0
  5. package/dist/analytics/{config-DN5B1GOG.js → config-CtHbJ58z.js} +1 -1
  6. package/dist/{bank-accounts-MpKIxHaX.js → bank-accounts-CktJ_34-.js} +1 -1
  7. package/dist/buyer-rules-DBhUoaZX.js +20 -0
  8. package/dist/buyer-rules.d.ts +13 -0
  9. package/dist/{captcha-CZkpghTO.js → captcha-BgiQrAfa.js} +1 -1
  10. package/dist/{cart-actions-IKRYGqfj.js → cart-actions-DaGyBu9g.js} +1 -1
  11. package/dist/{catalog-hooks-DjmpXROv.js → catalog-hooks-Dk_58L_I.js} +1 -1
  12. package/dist/{checkout-DsI1MY14.js → checkout-Dyq58gRY.js} +29 -14
  13. package/dist/{complaint-book-aAQfGBvo.js → complaint-book-C_6Z1-f1.js} +11 -6
  14. package/dist/{culqi-authentication-DHxjPJRE.js → culqi-authentication-CThvkZYc.js} +1 -1
  15. package/dist/{customer-document-fields-BzLdztjM.js → customer-document-fields-CkydNlq2.js} +2 -2
  16. package/dist/{customer-login-form-k_q7_7FX.js → customer-login-form-CnXH_JcT.js} +2 -2
  17. package/dist/{customer-registration-form-PrBqUuI9.js → customer-registration-form-CwwytTsq.js} +10 -2
  18. package/dist/{documents-T1mzc_j8.js → documents-Ka-EL9m0.js} +29 -1
  19. package/dist/entries/account.js +5 -5
  20. package/dist/entries/analytics.js +1 -1
  21. package/dist/entries/cart.js +2 -2
  22. package/dist/entries/checkout.d.ts +4 -1
  23. package/dist/entries/checkout.js +11 -8
  24. package/dist/entries/order.js +7 -7
  25. package/dist/index.d.ts +2 -1
  26. package/dist/index.js +31 -30
  27. package/dist/{invoice-fields-BzDfV1nR.js → invoice-fields-BPRnSo_s.js} +3 -3
  28. package/dist/{mercadopago-dialog-CpGlgKBl.js → mercadopago-dialog-C8pRoGAB.js} +2 -2
  29. package/dist/{order-display-CUXVESaF.js → order-display-CK-5wCsa.js} +1 -1
  30. package/dist/{order-draft-D8sqUUNp.js → order-draft-DfEHthuU.js} +1 -1
  31. package/dist/{order-payment-continuation-CS6omD7E.js → order-payment-continuation-DEGeYVyv.js} +3 -3
  32. package/dist/{order-payment-in-review-D5Y8bjGA.js → order-payment-in-review-D81gcAOe.js} +1 -1
  33. package/dist/{order-status-QsmEO-89.js → order-status-Bow-z55_.js} +2 -2
  34. package/dist/{page-seo-BKG-Ta6t.js → page-seo-DFFDxVA7.js} +3 -3
  35. package/dist/{pages-DyItxkdE.js → pages-CPxkyi9N.js} +3 -3
  36. package/dist/{payment-dialog-frame-xtidt_eM.js → payment-dialog-frame-C2n--N7s.js} +1 -1
  37. package/dist/{personalization-fields-CwBR8oGr.js → personalization-fields-BtNqpVpB.js} +1 -1
  38. package/dist/phone-B350moyr.js +13 -0
  39. package/dist/phone-field-D4io3zeV.js +141 -0
  40. package/dist/phone-field.d.ts +44 -0
  41. package/dist/phone.d.ts +2 -0
  42. package/dist/{preview-JWdMO6kX.js → preview-GypCcfup.js} +2 -2
  43. package/dist/{preview-address-bvieGEKb.js → preview-address-BobkvMlP.js} +1 -1
  44. package/dist/{preview-cart-COIP3Vfh.js → preview-cart-CRSPTs6g.js} +1 -1
  45. package/dist/{public-pages-Byh01h-6.js → public-pages-ax-EBPYN.js} +2 -2
  46. package/dist/{registration-h_00PAhj.js → registration-DuOEfjVt.js} +9 -4
  47. package/dist/registration.d.ts +1 -0
  48. package/dist/{route-text-B6pWdevi.js → route-text-CkupKB1b.js} +1 -1
  49. package/dist/{section-preview-BiYfeE-d.js → section-preview-D-c1PIuT.js} +2 -2
  50. package/dist/sections/account-addresses.js +20 -9
  51. package/dist/sections/account-order.js +4 -4
  52. package/dist/sections/account-orders.js +3 -3
  53. package/dist/sections/account-profile.d.ts +1 -0
  54. package/dist/sections/account-profile.js +21 -11
  55. package/dist/sections/checkout.js +62 -25
  56. package/dist/sections/complaint-book.js +39 -18
  57. package/dist/sections/design-system.js +1 -1
  58. package/dist/sections/draft-invoice.js +2 -2
  59. package/dist/{sections-CgpjubkB.js → sections-Cdsudggy.js} +1 -1
  60. package/dist/{seo-D9UdUMg9.js → seo-Tfib2qCv.js} +2 -2
  61. package/dist/{session-DR_9-bcf.js → session-BKu8g6ZJ.js} +6 -6
  62. package/dist/{store-uU2gWdMY.js → store-BrR5-uon.js} +2 -2
  63. package/dist/{storefront-language-Bnt-TU2F.js → storefront-language-20hJejSi.js} +5 -2
  64. package/dist/{storefront-text-Co7iUnLM.js → storefront-text-ClFfYMVk.js} +2 -2
  65. package/dist/{storefront-text-en-DzYmdOuY.js → storefront-text-en-DTTFnk6W.js} +8 -0
  66. package/dist/{storefront-text-pt-CizClH0I.js → storefront-text-pt-DuXQ0rti.js} +8 -0
  67. package/dist/{stripe-dialog-D88qfkUS.js → stripe-dialog-vlflY1WI.js} +2 -2
  68. package/dist/{templates-AgGupnPA.js → templates-Bq8joT_y.js} +2 -2
  69. package/dist/{urls-D4uinJVd.js → urls-DNwJJ6-F.js} +1 -1
  70. package/dist/{use-checkout-Jdk8P12A.js → use-checkout-BElBkhVE.js} +1 -1
  71. package/dist/{use-checkout-payment-BGX-BE6D.js → use-checkout-payment-C2t511ck.js} +1 -1
  72. package/dist/{voucher-payment-B3o9ybg6.js → voucher-payment-Cbq4DRiL.js} +1 -1
  73. package/dist/{worker-cbXmLvfR.js → worker-DWh0nPh3.js} +2 -2
  74. package/package.json +3 -1
  75. package/src/sections/account-addresses.tsx +11 -7
  76. package/src/sections/account-profile.tsx +12 -7
  77. package/src/sections/checkout.tsx +45 -9
  78. package/src/sections/complaint-book.tsx +15 -4
@@ -1,10 +1,11 @@
1
1
  import { optional, text } from "./form-BtQcbXlJ.js";
2
- import { identityDocumentError, isIdentityDocumentType } from "./documents-T1mzc_j8.js";
2
+ import { identityDocumentError, isIdentityDocumentType } from "./documents-Ka-EL9m0.js";
3
+ import { PHONE_ERROR, phoneError } from "./phone-B350moyr.js";
3
4
  import { ADDRESS_INTENTS, ORDER_REQUEST_INTENTS, isIntent } from "./form-contracts-0R112spH.js";
4
5
  import { readPlace } from "./place-CmW4hBWY.js";
5
- import { customerHeaders, requireCustomer, requireCustomerWith } from "./session-DR_9-bcf.js";
6
- import { found, readCountries, readDocumentCountries, store } from "./store-uU2gWdMY.js";
7
- import { requestUrl } from "./urls-D4uinJVd.js";
6
+ import { customerHeaders, requireCustomer, requireCustomerWith } from "./session-BKu8g6ZJ.js";
7
+ import { found, readCountries, readDocumentCountries, store } from "./store-BrR5-uon.js";
8
+ import { requestUrl } from "./urls-DNwJJ6-F.js";
8
9
  import { data } from "react-router";
9
10
  import { ApiError } from "@ecomiq/core";
10
11
  // src/account.ts
@@ -185,21 +186,28 @@ async function addressAction(request, context) {
185
186
  if (requestedCountry !== "" && requestedCountry !== settings.countryCode) return data({ error: "La dirección debe ser dentro del país de la tienda." }, { status: 400 });
186
187
  const input = readCustomerAddress(form, settings.countryCode);
187
188
  if (!input.addressLine || !input.district || !input.cellPhone) return data({ error: "Completa la dirección, el distrito y el celular." }, { status: 400 });
189
+ if (phoneError(input.cellPhone, settings.countryCode) !== null) return data({ error: PHONE_ERROR }, { status: 400 });
188
190
  const id = text(form, "id");
189
191
  if (id) await client.updateCustomerAddress(id, input, headers);
190
192
  else await client.createCustomerAddress(input, headers);
191
193
  return { error: null };
192
194
  } catch (error) {
195
+ if (error instanceof ApiError && error.code === "Customers.InvalidPhone") return data({ error: PHONE_ERROR }, { status: 400 });
193
196
  if (error instanceof ApiError && error.status < 500) return data({ error: "Revisa los datos de la dirección." }, { status: 400 });
194
197
  return data({ error: "No pudimos guardar la dirección." }, { status: 400 });
195
198
  }
196
199
  }
197
200
  async function loadProfile(request, context) {
198
201
  const client = store(context);
199
- const [me, countries] = await requireCustomerWith(request, context, (headers) => Promise.all([client.getCustomerMe(headers), readDocumentCountries(client)]));
202
+ const [me, countries, { store: settings }] = await requireCustomerWith(request, context, (headers) => Promise.all([
203
+ client.getCustomerMe(headers),
204
+ readDocumentCountries(client),
205
+ client.getSettings()
206
+ ]));
200
207
  return {
201
208
  me,
202
- countries
209
+ countries,
210
+ countryCode: settings.countryCode
203
211
  };
204
212
  }
205
213
  async function profileAction(request, context) {
@@ -212,6 +220,11 @@ async function profileAction(request, context) {
212
220
  try {
213
221
  const me = await client.getCustomerMe(headers);
214
222
  const { store: settings } = await client.getSettings();
223
+ const phone = text(form, "phone");
224
+ if (phone !== (me.phone ?? "") && phoneError(phone, settings.countryCode) !== null) return data({
225
+ saved: false,
226
+ error: PHONE_ERROR
227
+ }, { status: 400 });
215
228
  const number = text(form, "document");
216
229
  const type = text(form, "identificationType");
217
230
  const country = text(form, "identificationCountryCode");
@@ -231,7 +244,7 @@ async function profileAction(request, context) {
231
244
  await client.patchCustomer({
232
245
  firstName,
233
246
  lastName,
234
- phone: text(form, "phone"),
247
+ phone,
235
248
  identificationNumber: number || null,
236
249
  identificationType: number ? type : null,
237
250
  identificationCountryCode: number || me.entityIdentificationNumber ? country : null,
@@ -248,7 +261,11 @@ async function profileAction(request, context) {
248
261
  saved: true,
249
262
  error: null
250
263
  };
251
- } catch {
264
+ } catch (error) {
265
+ if (error instanceof ApiError && error.code === "Customers.InvalidPhone") return data({
266
+ saved: false,
267
+ error: PHONE_ERROR
268
+ }, { status: 400 });
252
269
  return data({
253
270
  saved: false,
254
271
  error: "No pudimos guardar tus datos."
package/dist/account.d.ts CHANGED
@@ -242,6 +242,7 @@ export declare function loadProfile(request: Request, context: Readonly<RouterCo
242
242
  code: string;
243
243
  name: string;
244
244
  }[];
245
+ countryCode: string;
245
246
  }>;
246
247
  export declare function profileAction(request: Request, context: Readonly<RouterContextProvider>): Promise<import("react-router").UNSAFE_DataWithResponseInit<ProfileActionData> | {
247
248
  saved: true;
@@ -8,7 +8,8 @@ function addressDefaults(address) {
8
8
  district: address.district,
9
9
  line: address.addressLine,
10
10
  reference: address.reference,
11
- phone: address.cellPhone ?? address.phone
11
+ phone: address.cellPhone ?? address.phone,
12
+ postalCode: address.postalCode
12
13
  };
13
14
  }
14
15
  export { addressDefaults };
@@ -7,5 +7,6 @@ export type AddressDefaults = {
7
7
  line?: string | null;
8
8
  reference?: string | null;
9
9
  phone?: string | null;
10
+ postalCode?: string | null;
10
11
  };
11
12
  export declare function addressDefaults(address: CustomerAddress | null | undefined): AddressDefaults;
@@ -1,4 +1,4 @@
1
- import { worker } from "../worker-cbXmLvfR.js";
1
+ import { worker } from "../worker-DWh0nPh3.js";
2
2
  import { readConsent } from "./cookies-CWsi-zSd.js";
3
3
  import { cartItem } from "./events-CWmKY7oX.js";
4
4
  // src/analytics/config.ts
@@ -1,4 +1,4 @@
1
- import { useStorefrontText } from "./storefront-language-Bnt-TU2F.js";
1
+ import { useStorefrontText } from "./storefront-language-20hJejSi.js";
2
2
  import { useState } from "react";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  // src/bank-accounts.tsx
@@ -0,0 +1,20 @@
1
+ // src/buyer-rules.ts
2
+ const EMAIL_PATTERN = "[^@\\s]+@[^@\\s.]+(\\.[^@\\s.]+)+";
3
+ const EMAIL_MAX_LENGTH = 200;
4
+ const PERSON_NAME_MAX_LENGTH = 100;
5
+ const ADDRESS_LINE_MIN_LENGTH = 3;
6
+ const ADDRESS_LINE_MAX_LENGTH = 200;
7
+ const ADDRESS_REFERENCE_MAX_LENGTH = 500;
8
+ const PLACE_NAME_MAX_LENGTH = 200;
9
+ const POSTAL_CODE_MAX_LENGTH = 20;
10
+ const EMAIL_ERROR = "Revisa tu correo: debe verse como nombre@dominio.com.";
11
+ const PERSON_NAME_ERROR = "Revisa tu nombre y apellidos.";
12
+ const ADDRESS_LINE_ERROR = "Escribe la dirección completa, con calle y número.";
13
+ const EMAIL = new RegExp(`^${EMAIL_PATTERN}$`);
14
+ function isPublicEmail(value) {
15
+ return value.length <= 200 && EMAIL.test(value);
16
+ }
17
+ function isPersonName(value) {
18
+ return value.length <= 100 && /\p{L}/u.test(value) && !/\p{Cc}/u.test(value);
19
+ }
20
+ export { ADDRESS_LINE_ERROR, ADDRESS_LINE_MAX_LENGTH, ADDRESS_LINE_MIN_LENGTH, ADDRESS_REFERENCE_MAX_LENGTH, EMAIL_ERROR, EMAIL_MAX_LENGTH, EMAIL_PATTERN, PERSON_NAME_ERROR, PERSON_NAME_MAX_LENGTH, PLACE_NAME_MAX_LENGTH, POSTAL_CODE_MAX_LENGTH, isPersonName, isPublicEmail };
@@ -0,0 +1,13 @@
1
+ export declare const EMAIL_PATTERN = "[^@\\s]+@[^@\\s.]+(\\.[^@\\s.]+)+";
2
+ export declare const EMAIL_MAX_LENGTH = 200;
3
+ export declare const PERSON_NAME_MAX_LENGTH = 100;
4
+ export declare const ADDRESS_LINE_MIN_LENGTH = 3;
5
+ export declare const ADDRESS_LINE_MAX_LENGTH = 200;
6
+ export declare const ADDRESS_REFERENCE_MAX_LENGTH = 500;
7
+ export declare const PLACE_NAME_MAX_LENGTH = 200;
8
+ export declare const POSTAL_CODE_MAX_LENGTH = 20;
9
+ export declare const EMAIL_ERROR = "Revisa tu correo: debe verse como nombre@dominio.com.";
10
+ export declare const PERSON_NAME_ERROR = "Revisa tu nombre y apellidos.";
11
+ export declare const ADDRESS_LINE_ERROR = "Escribe la dirección completa, con calle y número.";
12
+ export declare function isPublicEmail(value: string): boolean;
13
+ export declare function isPersonName(value: string): boolean;
@@ -1,4 +1,4 @@
1
- import { useStorefrontText } from "./storefront-language-Bnt-TU2F.js";
1
+ import { useStorefrontText } from "./storefront-language-20hJejSi.js";
2
2
  import { text } from "./form-BtQcbXlJ.js";
3
3
  import { useEffect, useRef, useState } from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
@@ -2,7 +2,7 @@ import { cartCookie, cartToken, readCart } from "./cart-D7DxZ2lD.js";
2
2
  import { text } from "./form-BtQcbXlJ.js";
3
3
  import { CART_INTENTS, isIntent } from "./form-contracts-0R112spH.js";
4
4
  import { readPersonalization } from "./personalization-BSVlktZP.js";
5
- import { store } from "./store-uU2gWdMY.js";
5
+ import { store } from "./store-BrR5-uon.js";
6
6
  import { data, redirect } from "react-router";
7
7
  import { ApiError, CartItemModifierSchema } from "@ecomiq/core";
8
8
  import { z } from "zod";
@@ -1,4 +1,4 @@
1
- import { useStorefrontText } from "./storefront-language-Bnt-TU2F.js";
1
+ import { useStorefrontText } from "./storefront-language-20hJejSi.js";
2
2
  import { useFetcher, useLocation, useNavigation, useSearchParams, useSubmit } from "react-router";
3
3
  import { useEffect, useRef, useState } from "react";
4
4
  // src/catalog-hooks.ts
@@ -1,14 +1,16 @@
1
- import { addressDefaults } from "./address-defaults-BqjRhS82.js";
2
- import { trackingConsented } from "./analytics/config-DN5B1GOG.js";
1
+ import { addressDefaults } from "./address-defaults-Bj8j8noq.js";
2
+ import { trackingConsented } from "./analytics/config-CtHbJ58z.js";
3
3
  import { purchaseCookie } from "./analytics/cookies-CWsi-zSd.js";
4
4
  import { checkoutAnalytics } from "./analytics/events-CWmKY7oX.js";
5
5
  import { cartCookie, cartToken } from "./cart-D7DxZ2lD.js";
6
6
  import { optional, text } from "./form-BtQcbXlJ.js";
7
- import { identityDocumentError, isIdentityDocumentType } from "./documents-T1mzc_j8.js";
7
+ import { ADDRESS_LINE_ERROR, EMAIL_ERROR, PERSON_NAME_ERROR, isPersonName, isPublicEmail } from "./buyer-rules-DBhUoaZX.js";
8
+ import { buyerDocumentError, isIdentityDocumentType } from "./documents-Ka-EL9m0.js";
8
9
  import { CHECKOUT_INTENTS, isIntent } from "./form-contracts-0R112spH.js";
10
+ import { PHONE_ERROR, phoneError } from "./phone-B350moyr.js";
9
11
  import { readPlace } from "./place-CmW4hBWY.js";
10
- import { customer, customerHeaders, requireCustomerRegistration } from "./session-DR_9-bcf.js";
11
- import { readCountries, readDocumentCountries, store } from "./store-uU2gWdMY.js";
12
+ import { customer, customerHeaders, requireCustomerRegistration } from "./session-BKu8g6ZJ.js";
13
+ import { readCountries, readDocumentCountries, store } from "./store-BrR5-uon.js";
12
14
  import { data, redirect, replace } from "react-router";
13
15
  import { ApiError, OrderPaymentStartSchema, StorefrontInvoiceTypeSchema } from "@ecomiq/core";
14
16
  import { z } from "zod";
@@ -54,12 +56,13 @@ function checkoutAddressDefaults(cart, address, countryCode) {
54
56
  const saved = cart.shippingAddress;
55
57
  if (saved) return {
56
58
  country: countryCode,
57
- department: saved.department,
59
+ department: saved.department ?? saved.province,
58
60
  province: saved.province,
59
61
  district: saved.district,
60
62
  line: saved.address1,
61
63
  reference: saved.address2,
62
- phone: saved.phone
64
+ phone: saved.phone,
65
+ postalCode: saved.postalCode === UNSTRUCTURED_POSTAL_CODE ? null : saved.postalCode
63
66
  };
64
67
  if (address) return {
65
68
  ...addressDefaults(address),
@@ -172,9 +175,13 @@ async function saveContact(client, token, form) {
172
175
  invoiceType
173
176
  };
174
177
  if (!input.email || !input.firstName || !input.lastName || !input.phone) return failure("Completa tus datos de contacto.");
175
- if (invoiceType === "invoice" && (input.entityTaxId === null || identityDocumentError("TaxId", input.identificationCountryCode ?? "", input.entityTaxId) !== null || input.entityName === null)) return failure("Ingresa la identificación fiscal, el país emisor y la razón social para la factura.");
176
- if (entityTaxId !== null && identityDocumentError("TaxId", input.identificationCountryCode ?? "", entityTaxId) !== null) return failure("Revisa el documento del comprador.");
177
- if (identificationNumber !== null && !(isIdentityDocumentType(input.identificationType) && identityDocumentError(input.identificationType, input.identificationCountryCode ?? "", identificationNumber) === null)) return failure("Revisa el documento del comprador.");
178
+ if (!isPublicEmail(input.email)) return failure(EMAIL_ERROR);
179
+ if (!isPersonName(input.firstName) || !isPersonName(input.lastName)) return failure(PERSON_NAME_ERROR);
180
+ const { store: settings } = await client.getSettings();
181
+ if (phoneError(input.phone, settings.countryCode) !== null) return failure(PHONE_ERROR);
182
+ if (invoiceType === "invoice" && (input.entityTaxId === null || buyerDocumentError("TaxId", input.identificationCountryCode ?? "", input.entityTaxId) !== null || input.entityName === null)) return failure("Ingresa la identificación fiscal, el país emisor y la razón social para la factura.");
183
+ if (entityTaxId !== null && buyerDocumentError("TaxId", input.identificationCountryCode ?? "", entityTaxId) !== null) return failure("Revisa el documento del comprador.");
184
+ if (identificationNumber !== null && !(isIdentityDocumentType(input.identificationType) && buyerDocumentError(input.identificationType, input.identificationCountryCode ?? "", identificationNumber) === null)) return failure("Revisa el documento del comprador.");
178
185
  await client.patchCartBuyer(input);
179
186
  return redirect("/checkout");
180
187
  }
@@ -188,6 +195,9 @@ async function saveDelivery(client, token, form) {
188
195
  const district = readPlace(text(form, "district"));
189
196
  const line = text(form, "line");
190
197
  if (!line || !district.name) return failure("Completa la dirección de entrega.");
198
+ if (line.length < 3) return failure(ADDRESS_LINE_ERROR);
199
+ const phone = optional(form, "phone") ?? cart.phone;
200
+ if (phone !== null && phoneError(phone, settings.countryCode) !== null) return failure(PHONE_ERROR);
191
201
  const structured = department.code !== "" && province.code !== "";
192
202
  let city = district.name;
193
203
  let postalCode = optional(form, "postalCode") ?? UNSTRUCTURED_POSTAL_CODE;
@@ -196,16 +206,16 @@ async function saveDelivery(client, token, form) {
196
206
  postalCode = optional(form, "postalCode") ?? district.code;
197
207
  }
198
208
  const address = {
199
- name: `${cart.firstName ?? ""} ${cart.lastName ?? ""}`.trim() || line,
209
+ name: `${cart.firstName ?? ""} ${cart.lastName ?? ""}`.trim().slice(0, 200) || line,
200
210
  address1: line,
201
211
  address2: optional(form, "reference"),
202
212
  city,
203
213
  countryCode: settings.countryCode,
204
214
  department: department.name || null,
205
- province: structured ? province.name : null,
215
+ province: structured ? province.name : department.name || null,
206
216
  district: district.name,
207
217
  postalCode,
208
- phone: optional(form, "phone") ?? cart.phone,
218
+ phone,
209
219
  latitude: null,
210
220
  longitude: null
211
221
  };
@@ -398,7 +408,12 @@ const CHECKOUT_ERRORS = {
398
408
  "Payments.Rejected": "No pudimos cobrar tu pago. Prueba con otra tarjeta o elige otro medio de pago.",
399
409
  "Payments.InvalidPayerEmail": "La pasarela de pago no pudo validar tu correo. Revisa que esté bien escrito o usa otro.",
400
410
  "Carts.NotActive": "Esta compra ya terminó. Vuelve a la tienda para empezar otra.",
401
- "Order.DomesticShippingRequired": "La entrega debe ser dentro del país de la tienda."
411
+ "Order.DomesticShippingRequired": "La entrega debe ser dentro del país de la tienda.",
412
+ "Carts.InvalidPhone": PHONE_ERROR,
413
+ "Carts.InvalidGeography": "Elige el departamento, la provincia y el distrito de la lista.",
414
+ "Carts.InvalidReceipt": "Vuelve a subir el comprobante de pago.",
415
+ "CustomerDocument.Invalid": "Revisa el documento del comprador.",
416
+ "CustomerDocument.InvalidCountry": "Elige el país emisor del documento."
402
417
  };
403
418
  async function checkoutAction(request, context) {
404
419
  const current = await customer(request, context);
@@ -1,8 +1,9 @@
1
- import { captchaResponse } from "./captcha-CZkpghTO.js";
2
- import { COMPLAINT_DOCUMENT_TYPES, identityDocumentError } from "./documents-T1mzc_j8.js";
1
+ import { captchaResponse } from "./captcha-BgiQrAfa.js";
2
+ import { COMPLAINT_DOCUMENT_TYPES, identityDocumentError } from "./documents-Ka-EL9m0.js";
3
+ import { PHONE_ERROR, phoneError } from "./phone-B350moyr.js";
3
4
  import { optional, text } from "./form-BtQcbXlJ.js";
4
5
  import { rejectCrossOriginAction } from "./request-security-CRsRMgwj.js";
5
- import { found, readDocumentCountries, store } from "./store-uU2gWdMY.js";
6
+ import { found, readDocumentCountries, store } from "./store-BrR5-uon.js";
6
7
  import { data } from "react-router";
7
8
  import { ApiError, COMPLAINT_BOOK_ATTACHMENT_TYPES, COMPLAINT_BOOK_MAX_ATTACHMENTS, COMPLAINT_BOOK_MAX_ATTACHMENT_BYTES, ComplaintBookEntryInputSchema } from "@ecomiq/core";
8
9
  import { z } from "zod";
@@ -14,7 +15,8 @@ const COMPLAINT_BOOK_ERRORS = {
14
15
  "ComplaintBook.Unavailable": "El Libro de Reclamaciones no está disponible en esta tienda.",
15
16
  "ComplaintBook.TooManyAttachments": TOO_MANY_ATTACHMENTS,
16
17
  "ComplaintBook.InvalidAttachment": INVALID_ATTACHMENT,
17
- "ComplaintBook.AttachmentUploadFailed": "No pudimos guardar los adjuntos. Intenta de nuevo o envía sin ellos."
18
+ "ComplaintBook.AttachmentUploadFailed": "No pudimos guardar los adjuntos. Intenta de nuevo o envía sin ellos.",
19
+ "ComplaintBook.InvalidPhone": PHONE_ERROR
18
20
  };
19
21
  const ValidationProblemSchema = z.object({ fieldErrors: z.record(z.string(), z.array(z.string())) });
20
22
  function complaintBookLinks(settings) {
@@ -54,7 +56,7 @@ function person(form, prefix) {
54
56
  email: text(form, `${prefix}Email`)
55
57
  };
56
58
  }
57
- function complaintEntry(form) {
59
+ function complaintEntry(form, countryCode) {
58
60
  if (form.get("confirmed") !== "on") return "Confirma que los datos son verdaderos.";
59
61
  const amount = optional(form, "itemAmount");
60
62
  const parsed = ComplaintBookEntryInputSchema.safeParse({
@@ -77,6 +79,8 @@ function complaintEntry(form) {
77
79
  confirmed: true
78
80
  });
79
81
  if (!parsed.success) return "Completa los datos obligatorios.";
82
+ if (phoneError(parsed.data.consumer.phone, countryCode) !== null) return PHONE_ERROR;
83
+ if (parsed.data.guardian && phoneError(parsed.data.guardian.phone, countryCode) !== null) return PHONE_ERROR;
80
84
  const { documentType, documentNumber, documentCountryCode } = parsed.data.consumer;
81
85
  const documentError = identityDocumentError(COMPLAINT_DOCUMENT_TYPES[documentType], documentCountryCode, documentNumber);
82
86
  if (documentError !== null) return documentError;
@@ -96,7 +100,8 @@ async function complaintBookAction(request, context) {
96
100
  const book = await found(client.getComplaintBook());
97
101
  const token = captchaResponse(form, book.captcha.provider);
98
102
  if (!token) return failure("Completa la verificación de seguridad.");
99
- const sheet = complaintEntry(form);
103
+ const { store: settings } = await client.getSettings();
104
+ const sheet = complaintEntry(form, settings.countryCode);
100
105
  if (typeof sheet === "string") return failure(sheet);
101
106
  const files = form.getAll("files").filter((file) => file instanceof File && file.size > 0);
102
107
  const attachmentError = complaintBookAttachmentError(files);
@@ -1,4 +1,4 @@
1
- import { useStorefrontLocale, useStorefrontText } from "./storefront-language-Bnt-TU2F.js";
1
+ import { useStorefrontLocale, useStorefrontText } from "./storefront-language-20hJejSi.js";
2
2
  import { useCustomerCsrfToken } from "./customer-csrf-C1oDX-Py.js";
3
3
  import { CulqiPaymentSourceSchema, culqiSourceKey, loadCulqiThreeDS } from "./culqi-three-ds-HP3mfrvV.js";
4
4
  import { useNavigate, useSubmit } from "react-router";
@@ -1,5 +1,5 @@
1
- import { IDENTITY_DOCUMENT_TYPES, identityDocumentRule, isIdentityDocumentType } from "./documents-T1mzc_j8.js";
2
- import { useStorefrontText } from "./storefront-language-Bnt-TU2F.js";
1
+ import { IDENTITY_DOCUMENT_TYPES, identityDocumentRule, isIdentityDocumentType } from "./documents-Ka-EL9m0.js";
2
+ import { useStorefrontText } from "./storefront-language-20hJejSi.js";
3
3
  import { useState } from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  // src/customer-document-fields.tsx
@@ -1,5 +1,5 @@
1
- import { useStorefrontText } from "./storefront-language-Bnt-TU2F.js";
2
- import { Captcha } from "./captcha-CZkpghTO.js";
1
+ import { useStorefrontText } from "./storefront-language-20hJejSi.js";
2
+ import { Captcha } from "./captcha-BgiQrAfa.js";
3
3
  import { Form, useNavigation } from "react-router";
4
4
  import { useEffect, useState } from "react";
5
5
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -1,5 +1,6 @@
1
- import { useStorefrontText } from "./storefront-language-Bnt-TU2F.js";
1
+ import { useStorefrontText } from "./storefront-language-20hJejSi.js";
2
2
  import { CustomerCsrfField } from "./customer-csrf-C1oDX-Py.js";
3
+ import { PhoneField } from "./phone-field-D4io3zeV.js";
3
4
  import { Form, useNavigation } from "react-router";
4
5
  import { jsx, jsxs } from "react/jsx-runtime";
5
6
  // src/customer-registration-form.tsx
@@ -57,7 +58,14 @@ function CustomerRegistrationForm({ data, classNames }) {
57
58
  htmlFor: `registration-${field.name}`,
58
59
  className: storefrontTranslate(classNames.label),
59
60
  children: [storefrontTranslate(field.label), mode === "optional" ? ` (${storefrontTranslate("opcional")})` : ""]
60
- }), /* @__PURE__ */ jsx("input", {
61
+ }), field.name === "phone" ? /* @__PURE__ */ jsx(PhoneField, {
62
+ countryCode: data.countryCode,
63
+ initial: registration.phone ?? "",
64
+ id: "registration-phone",
65
+ required: mode === "required",
66
+ inputClassName: `min-w-0 flex-1 ${classNames.input}`,
67
+ errorClassName: classNames.error
68
+ }) : /* @__PURE__ */ jsx("input", {
61
69
  id: `registration-${field.name}`,
62
70
  name: field.name,
63
71
  type: field.type,
@@ -29,10 +29,38 @@ function identityDocumentError(type, countryCode, value) {
29
29
  if (value.trim() === "" || value.length > 50 || /[\u0000-\u001f\u007f-\u009f]/.test(value)) return identityDocumentRule(type).error;
30
30
  return null;
31
31
  }
32
+ const PERU_TAX_ID_PREFIXES = [
33
+ "10",
34
+ "15",
35
+ "16",
36
+ "17",
37
+ "20"
38
+ ];
39
+ const PERU_TAX_ID_WEIGHTS = [
40
+ 5,
41
+ 4,
42
+ 3,
43
+ 2,
44
+ 7,
45
+ 6,
46
+ 5,
47
+ 4,
48
+ 3,
49
+ 2
50
+ ];
51
+ function isPeruTaxId(value) {
52
+ if (!/^\d{11}$/.test(value) || !PERU_TAX_ID_PREFIXES.includes(value.slice(0, 2))) return false;
53
+ return (11 - PERU_TAX_ID_WEIGHTS.reduce((total, weight, index) => total + Number(value[index]) * weight, 0) % 11) % 10 === Number(value[10]);
54
+ }
55
+ function buyerDocumentError(type, countryCode, value) {
56
+ const error = identityDocumentError(type, countryCode, value);
57
+ if (error !== null || value === "" || type !== "TaxId" || countryCode !== "PE") return error;
58
+ return isPeruTaxId(value) ? null : "Revisa el RUC: debe tener 11 dígitos válidos.";
59
+ }
32
60
  const COMPLAINT_DOCUMENT_TYPES = {
33
61
  nationalId: "NationalId",
34
62
  taxId: "TaxId",
35
63
  foreignId: "ForeignId",
36
64
  passport: "Passport"
37
65
  };
38
- export { COMPLAINT_DOCUMENT_TYPES, IDENTITY_DOCUMENT_TYPES, identityDocumentError, identityDocumentRule, isIdentityDocumentType };
66
+ export { COMPLAINT_DOCUMENT_TYPES, IDENTITY_DOCUMENT_TYPES, buyerDocumentError, identityDocumentError, identityDocumentRule, isIdentityDocumentType };
@@ -1,10 +1,10 @@
1
- import { addressAction, loadAccount, loadAddresses, loadOrder, loadOrders, loadProfile, orderFiltersQuery, orderRequestAction, profileAction, readOrderFilters } from "../account-CZZ-ku6L.js";
1
+ import { addressAction, loadAccount, loadAddresses, loadOrder, loadOrders, loadProfile, orderFiltersQuery, orderRequestAction, profileAction, readOrderFilters } from "../account-CLF4iS_r.js";
2
2
  import { mainPayment, orderStepLabel, orderStepOf, paymentLabel, paymentStatusLabel } from "../order-view-9IlBg5AF.js";
3
3
  import { useOrderPages } from "../order-pages-Dm6l5m0m.js";
4
- import { PayButton, PaymentPreview, ReorderButton, useOrderHeadline, useOrderStepDetail } from "../order-display-CUXVESaF.js";
4
+ import { PayButton, PaymentPreview, ReorderButton, useOrderHeadline, useOrderStepDetail } from "../order-display-CK-5wCsa.js";
5
5
  import { AddressForm, ProfileForm } from "../account-forms-AVk71ko7.js";
6
- import { addressDefaults } from "../address-defaults-BqjRhS82.js";
7
- import { placeValue, useGeoCascade } from "../catalog-hooks-DjmpXROv.js";
6
+ import { addressDefaults } from "../address-defaults-Bj8j8noq.js";
7
+ import { placeValue, useGeoCascade } from "../catalog-hooks-Dk_58L_I.js";
8
8
  import { orderSummaryLines } from "../cart-summary-B6vtRGBO.js";
9
- import { CustomerDocumentFields } from "../customer-document-fields-BzLdztjM.js";
9
+ import { CustomerDocumentFields } from "../customer-document-fields-CkydNlq2.js";
10
10
  export { AddressForm, CustomerDocumentFields, PayButton, PaymentPreview, ProfileForm, ReorderButton, addressAction, addressDefaults, loadAccount, loadAddresses, loadOrder, loadOrders, loadProfile, mainPayment, orderFiltersQuery, orderRequestAction, orderStepLabel, orderStepOf, orderSummaryLines, paymentLabel, paymentStatusLabel, placeValue, profileAction, readOrderFilters, useGeoCascade, useOrderHeadline, useOrderPages, useOrderStepDetail };
@@ -1,5 +1,5 @@
1
1
  import { Analytics } from "../analytics/analytics-CiG_O37p.js";
2
- import { readAnalytics } from "../analytics/config-DN5B1GOG.js";
2
+ import { readAnalytics } from "../analytics/config-CtHbJ58z.js";
3
3
  import { ConsentBanner, ConsentLink } from "../analytics/consent-banner-D36fpU89.js";
4
4
  import { catalogAnalytics } from "../analytics/events-CWmKY7oX.js";
5
5
  export { Analytics, ConsentBanner, ConsentLink, catalogAnalytics, readAnalytics };
@@ -1,8 +1,8 @@
1
1
  import { readCart } from "../cart-D7DxZ2lD.js";
2
- import { cartAction, loadCart } from "../cart-actions-IKRYGqfj.js";
2
+ import { cartAction, loadCart } from "../cart-actions-DaGyBu9g.js";
3
3
  import { CartForm, useCart } from "../cart-form-Bq_B-Rh6.js";
4
4
  import { useOptimisticCart } from "../optimistic-cart-DcJ8-tCw.js";
5
5
  import { CartDrawerProvider, useCartDrawer } from "../cart-drawer-B7PPsR69.js";
6
6
  import { groupBySeller, summaryLines } from "../cart-summary-B6vtRGBO.js";
7
- import { ItemPersonalization, PersonalizationFields } from "../personalization-fields-CwBR8oGr.js";
7
+ import { ItemPersonalization, PersonalizationFields } from "../personalization-fields-BtNqpVpB.js";
8
8
  export { CartDrawerProvider, CartForm, ItemPersonalization, PersonalizationFields, cartAction, groupBySeller, loadCart, readCart, summaryLines, useCart, useCartDrawer, useOptimisticCart };
@@ -4,9 +4,12 @@ import { CheckoutPaymentControls, useCheckoutPayment } from "../use-checkout-pay
4
4
  import { MercadoPagoDialog, MercadoPagoDialogState } from "../mercadopago-dialog.js";
5
5
  import { StripeAuthentication, StripeDialog, StripeDialogState, StripeWallet, findStripeWallet, useAvailableStripeWallets } from "../stripe-dialog.js";
6
6
  import { CheckoutForm, CheckoutFormProps, OrderBumpForm, OrderBumpFormProps, PromoCodeForm, PromoCodeFormProps } from "../checkout-form.js";
7
+ import { ADDRESS_LINE_ERROR, ADDRESS_LINE_MAX_LENGTH, ADDRESS_LINE_MIN_LENGTH, ADDRESS_REFERENCE_MAX_LENGTH, EMAIL_ERROR, EMAIL_MAX_LENGTH, EMAIL_PATTERN, PERSON_NAME_ERROR, PERSON_NAME_MAX_LENGTH, PLACE_NAME_MAX_LENGTH, POSTAL_CODE_MAX_LENGTH, isPersonName, isPublicEmail } from "../buyer-rules.js";
8
+ import { PhoneField, PhoneFieldProps, PhoneFieldState, PhoneNumberInput, PhoneNumberInputProps, usePhoneField } from "../phone-field.js";
9
+ import { PHONE_ERROR, phoneError } from "../phone.js";
7
10
  import { InvoiceCart, InvoiceFields, InvoiceFieldsProps, InvoiceFieldsState, InvoiceInputProps, InvoiceType } from "../invoice-fields.js";
8
11
  import { ManualPaymentDetails, PaymentInputProps, PaymentMethodLike, PaymentMethodOption, PaymentMethodSaving, PaymentMethods, PaymentMethodsProps } from "../payment-methods.js";
9
12
  import { SummaryLabels, SummaryLine, summaryLines } from "../cart-summary.js";
10
13
  import { CheckoutIntent } from "../form-contracts.js";
11
14
  import { CulqiAuthentication } from "../culqi-authentication.js";
12
- export { type CheckoutActionData, type CheckoutAddressDefaults, type CheckoutData, CheckoutForm, type CheckoutFormProps, type CheckoutIntent, type CheckoutPaymentControls, type CheckoutPaymentMethod, type CheckoutRate, type CheckoutShippingGroup, type CheckoutStep, CulqiAuthentication, type InvoiceCart, InvoiceFields, type InvoiceFieldsProps, type InvoiceFieldsState, type InvoiceInputProps, type InvoiceType, type ManualPaymentDetails, MercadoPagoDialog, type MercadoPagoDialogState, OrderBumpForm, type OrderBumpFormProps, type PaymentInputProps, type PaymentMethodLike, type PaymentMethodOption, type PaymentMethodSaving, PaymentMethods, type PaymentMethodsProps, PromoCodeForm, type PromoCodeFormProps, StripeAuthentication, StripeDialog, type StripeDialogState, type StripeWallet, type SummaryLabels, type SummaryLine, checkoutAction, findStripeWallet, loadCheckout, shouldRevalidateCheckout, summaryLines, useAvailableStripeWallets, useCheckout, useCheckoutPayment };
15
+ export { ADDRESS_LINE_ERROR, ADDRESS_LINE_MAX_LENGTH, ADDRESS_LINE_MIN_LENGTH, ADDRESS_REFERENCE_MAX_LENGTH, type CheckoutActionData, type CheckoutAddressDefaults, type CheckoutData, CheckoutForm, type CheckoutFormProps, type CheckoutIntent, type CheckoutPaymentControls, type CheckoutPaymentMethod, type CheckoutRate, type CheckoutShippingGroup, type CheckoutStep, CulqiAuthentication, EMAIL_ERROR, EMAIL_MAX_LENGTH, EMAIL_PATTERN, type InvoiceCart, InvoiceFields, type InvoiceFieldsProps, type InvoiceFieldsState, type InvoiceInputProps, type InvoiceType, type ManualPaymentDetails, MercadoPagoDialog, type MercadoPagoDialogState, OrderBumpForm, type OrderBumpFormProps, PERSON_NAME_ERROR, PERSON_NAME_MAX_LENGTH, PHONE_ERROR, PLACE_NAME_MAX_LENGTH, POSTAL_CODE_MAX_LENGTH, type PaymentInputProps, type PaymentMethodLike, type PaymentMethodOption, type PaymentMethodSaving, PaymentMethods, type PaymentMethodsProps, PhoneField, type PhoneFieldProps, type PhoneFieldState, PhoneNumberInput, type PhoneNumberInputProps, PromoCodeForm, type PromoCodeFormProps, StripeAuthentication, StripeDialog, type StripeDialogState, type StripeWallet, type SummaryLabels, type SummaryLine, checkoutAction, findStripeWallet, isPersonName, isPublicEmail, loadCheckout, phoneError, shouldRevalidateCheckout, summaryLines, useAvailableStripeWallets, useCheckout, useCheckoutPayment, usePhoneField };
@@ -1,11 +1,14 @@
1
- import { checkoutAction, loadCheckout, shouldRevalidateCheckout } from "../checkout-DsI1MY14.js";
2
- import { useCheckout } from "../use-checkout-Jdk8P12A.js";
3
- import { useCheckoutPayment } from "../use-checkout-payment-BGX-BE6D.js";
4
- import { MercadoPagoDialog } from "../mercadopago-dialog-CpGlgKBl.js";
5
- import { StripeAuthentication, StripeDialog, findStripeWallet, useAvailableStripeWallets } from "../stripe-dialog-D88qfkUS.js";
1
+ import { checkoutAction, loadCheckout, shouldRevalidateCheckout } from "../checkout-Dyq58gRY.js";
2
+ import { useCheckout } from "../use-checkout-BElBkhVE.js";
3
+ import { useCheckoutPayment } from "../use-checkout-payment-C2t511ck.js";
4
+ import { MercadoPagoDialog } from "../mercadopago-dialog-C8pRoGAB.js";
5
+ import { StripeAuthentication, StripeDialog, findStripeWallet, useAvailableStripeWallets } from "../stripe-dialog-vlflY1WI.js";
6
6
  import { CheckoutForm, OrderBumpForm, PromoCodeForm } from "../checkout-form-CbOIdENC.js";
7
- import { InvoiceFields } from "../invoice-fields-BzDfV1nR.js";
7
+ import { ADDRESS_LINE_ERROR, ADDRESS_LINE_MAX_LENGTH, ADDRESS_LINE_MIN_LENGTH, ADDRESS_REFERENCE_MAX_LENGTH, EMAIL_ERROR, EMAIL_MAX_LENGTH, EMAIL_PATTERN, PERSON_NAME_ERROR, PERSON_NAME_MAX_LENGTH, PLACE_NAME_MAX_LENGTH, POSTAL_CODE_MAX_LENGTH, isPersonName, isPublicEmail } from "../buyer-rules-DBhUoaZX.js";
8
+ import { PhoneField, PhoneNumberInput, usePhoneField } from "../phone-field-D4io3zeV.js";
9
+ import { PHONE_ERROR, phoneError } from "../phone-B350moyr.js";
10
+ import { InvoiceFields } from "../invoice-fields-BPRnSo_s.js";
8
11
  import { PaymentMethods } from "../payment-methods-B8ocTgFZ.js";
9
12
  import { summaryLines } from "../cart-summary-B6vtRGBO.js";
10
- import { CulqiAuthentication } from "../culqi-authentication-DHxjPJRE.js";
11
- export { CheckoutForm, CulqiAuthentication, InvoiceFields, MercadoPagoDialog, OrderBumpForm, PaymentMethods, PromoCodeForm, StripeAuthentication, StripeDialog, checkoutAction, findStripeWallet, loadCheckout, shouldRevalidateCheckout, summaryLines, useAvailableStripeWallets, useCheckout, useCheckoutPayment };
13
+ import { CulqiAuthentication } from "../culqi-authentication-CThvkZYc.js";
14
+ export { ADDRESS_LINE_ERROR, ADDRESS_LINE_MAX_LENGTH, ADDRESS_LINE_MIN_LENGTH, ADDRESS_REFERENCE_MAX_LENGTH, CheckoutForm, CulqiAuthentication, EMAIL_ERROR, EMAIL_MAX_LENGTH, EMAIL_PATTERN, InvoiceFields, MercadoPagoDialog, OrderBumpForm, PERSON_NAME_ERROR, PERSON_NAME_MAX_LENGTH, PHONE_ERROR, PLACE_NAME_MAX_LENGTH, POSTAL_CODE_MAX_LENGTH, PaymentMethods, PhoneField, PhoneNumberInput, PromoCodeForm, StripeAuthentication, StripeDialog, checkoutAction, findStripeWallet, isPersonName, isPublicEmail, loadCheckout, phoneError, shouldRevalidateCheckout, summaryLines, useAvailableStripeWallets, useCheckout, useCheckoutPayment, usePhoneField };
@@ -1,11 +1,11 @@
1
- import { hasOrderPaymentContinuation, loadOrderStatus, orderPaymentAction, orderProgress, orderStepTitle } from "../order-status-QsmEO-89.js";
2
- import { loadOrderDraft, orderDraftAction } from "../order-draft-D8sqUUNp.js";
1
+ import { hasOrderPaymentContinuation, loadOrderStatus, orderPaymentAction, orderProgress, orderStepTitle } from "../order-status-Bow-z55_.js";
2
+ import { loadOrderDraft, orderDraftAction } from "../order-draft-DfEHthuU.js";
3
3
  import { useOrderPayment } from "../use-order-payment-BKIz_IO0.js";
4
- import { OrderPaymentContinuation } from "../order-payment-continuation-CS6omD7E.js";
5
- import { OrderPaymentInReview } from "../order-payment-in-review-D5Y8bjGA.js";
6
- import { BankAccountList } from "../bank-accounts-MpKIxHaX.js";
4
+ import { OrderPaymentContinuation } from "../order-payment-continuation-DEGeYVyv.js";
5
+ import { OrderPaymentInReview } from "../order-payment-in-review-D81gcAOe.js";
6
+ import { BankAccountList } from "../bank-accounts-CktJ_34-.js";
7
7
  import { PaymentMethods } from "../payment-methods-B8ocTgFZ.js";
8
8
  import { orderSummaryLines } from "../cart-summary-B6vtRGBO.js";
9
- import { MercadoPagoDialog } from "../mercadopago-dialog-CpGlgKBl.js";
10
- import { useOrderAuthentication } from "../culqi-authentication-DHxjPJRE.js";
9
+ import { MercadoPagoDialog } from "../mercadopago-dialog-C8pRoGAB.js";
10
+ import { useOrderAuthentication } from "../culqi-authentication-CThvkZYc.js";
11
11
  export { BankAccountList, MercadoPagoDialog, OrderPaymentContinuation, OrderPaymentInReview, PaymentMethods, hasOrderPaymentContinuation, loadOrderDraft, loadOrderStatus, orderDraftAction, orderPaymentAction, orderProgress, orderStepTitle, orderSummaryLines, useOrderAuthentication, useOrderPayment };
package/dist/index.d.ts CHANGED
@@ -43,8 +43,9 @@ import { COMPLAINT_DOCUMENT_TYPES, DocumentRule, IDENTITY_DOCUMENT_TYPES, Identi
43
43
  import { ComplaintBookActionData, ComplaintBookData, ComplaintBookLink, complaintBookAction, complaintBookAttachmentError, complaintBookLinks, complaintBookNumber, loadComplaintBook } from "./complaint-book.js";
44
44
  import { CustomerRegistrationData, loadCustomerRegistration, submitCustomerRegistration } from "./registration.js";
45
45
  import { CustomerRegistrationForm, CustomerRegistrationFormProps } from "./customer-registration-form.js";
46
+ import { PhoneField, PhoneFieldProps } from "./phone-field.js";
46
47
  import { storefrontContact } from "./store-contact.js";
47
48
  import { loadStorefrontTranslations, storefrontText } from "./storefront-text.js";
48
49
  import { StorefrontLanguageProvider, useStorefrontLocale, useStorefrontText } from "./storefront-language.js";
49
50
  import { storefrontRouteText } from "./route-text.js";
50
- export { type ActiveFilterChip, type AddressActionData, BankAccountList, COMPLAINT_DOCUMENT_TYPES, CUSTOMER_CSRF_FIELD, Captcha, type CaptchaProps, type CartActionData, type CartData, type CategoryData, type CategoryPage, type CheckoutActionData, type CheckoutAddressDefaults, type CheckoutData, type CheckoutPaymentMethod, type CheckoutRate, type CheckoutShippingGroup, type CheckoutStep, type CollectionPage, type ComplaintBookActionData, type ComplaintBookData, type ComplaintBookLink, type Customer, CustomerAvatar, CustomerCsrfField, type CustomerLoginData, CustomerLoginForm, type CustomerLoginFormProps, type CustomerRegistrationData, CustomerRegistrationForm, type CustomerRegistrationFormProps, type DocumentRule, FORM_CONTRACTS, Favicon, type FilterChipText, type FilterLabels, type FormContract, type GeoPlace, Hidden, IDENTITY_DOCUMENT_TYPES, type IdentityDocumentType, MAX_CART_QUANTITY, type OrderDraftActionData, type OrderDraftData, type OrderPaymentActionData, OrderPaymentContinuation, type OrderPaymentControls, OrderPaymentInReview, type OrderProgressStep, type OrderStatusData, type PageItem, type PageOptions, type PageSeo, type PageSeoInput, PaymentLogo, type PaymentMethodSaving, type ProductPage, type ProductReviews, type ProductSource, type ProductVariant, type ProfileActionData, type ResolvedPage, type ResolvedUrl, type ReviewActionData, type ReviewSummary, RichText, SORT_OPTIONS, type SectionCatalog, type SectionData, type SectionEntry, type SectionGroup, type SectionLoadArgs, type SectionModules, SectionPreview, type SectionPreviewData, type SectionProps, type SectionRoot, type SortLabels, type SortValue, SourceProvider, StorefrontAnchor, type StorefrontAnchorProps, type StorefrontEnv, StorefrontLanguageProvider, StorefrontLink, type StorefrontLinkProps, type StorefrontLinks, type StorefrontPageData, type TemplateKind, type TemplateModule, type TemplateModules, type TrackingData, type VariantOption, type WorkerContext, activeFilterChips, activeFilterCount, addressAction, canonicalUrl, cartAction, cartCookie, cartToken, categorySeo, checkoutAction, checkoutAddressDefaults, checkoutProgress, checkoutStep, clearedFiltersHref, collectionImageCandidates, collectionPage, collectionSeo, complaintBookAction, complaintBookAttachmentError, complaintBookLinks, complaintBookNumber, completeCustomerLogin, createRequestHandler, culqiSourceKey, customer, customerCsrfToken, customerHeaders, defaultPaymentMethod, discountPercent, filterLabel, filterValueLabel, found, hasOrderPaymentContinuation, homeSeo, identityDocumentRule, isOrderDraftPayable, isSingleChoiceFilter, isVariantAvailable, loadAccount, loadAddresses, loadCart, loadCategory, loadCheckout, loadComplaintBook, loadCustomerRegistration, loadGeo, loadOrder, loadOrderDraft, loadOrderStatus, loadOrders, loadPage, loadProduct, loadProfile, loadReview, loadSearchSuggestions, loadSections, loadStorefrontTranslations, loadTracking, logout, money, needsShipping, optional, orderDraftAction, orderPaymentAction, orderProgress, orderStepTitle, pageItems, pageSeo, paymentLogoCodes, paymentMethodSaving, pickProducts, pickVariant, productPage, productReviewAction, productReviews, productSeo, profileAction, readCart, readCatalog, readCountries, readCustomerAddress, readPage, readPlace, readStorefrontLayout, readStorefrontLinks, requireCanonical, requireCustomer, requireCustomerRegistration, resolvePage, resolveUrl, reviewAction, safeNext, section, sectionKey, sectionPreview, sectionPreviewMeta, selectedFacetCount, seoMeta, setting, shouldRevalidateCatalogRoot, source, sourceValue, startCustomerLogin, store, storefrontContact, storefrontHref, storefrontRouteText, storefrontText, submitCustomerLogin, submitCustomerRegistration, templateComponent, templateName, templatePath, templated, text, useCheckout, useCustomerCsrfToken, useFacets, useGeoCascade, useOrderPayment, usePagination, useSearchSuggestions, useSection, useSort, useStorefrontLinkPublished, useStorefrontLocale, useStorefrontText, variantOptions, variantSwatches, withImages, withSectionBoundary, withSections, worker };
51
+ export { type ActiveFilterChip, type AddressActionData, BankAccountList, COMPLAINT_DOCUMENT_TYPES, CUSTOMER_CSRF_FIELD, Captcha, type CaptchaProps, type CartActionData, type CartData, type CategoryData, type CategoryPage, type CheckoutActionData, type CheckoutAddressDefaults, type CheckoutData, type CheckoutPaymentMethod, type CheckoutRate, type CheckoutShippingGroup, type CheckoutStep, type CollectionPage, type ComplaintBookActionData, type ComplaintBookData, type ComplaintBookLink, type Customer, CustomerAvatar, CustomerCsrfField, type CustomerLoginData, CustomerLoginForm, type CustomerLoginFormProps, type CustomerRegistrationData, CustomerRegistrationForm, type CustomerRegistrationFormProps, type DocumentRule, FORM_CONTRACTS, Favicon, type FilterChipText, type FilterLabels, type FormContract, type GeoPlace, Hidden, IDENTITY_DOCUMENT_TYPES, type IdentityDocumentType, MAX_CART_QUANTITY, type OrderDraftActionData, type OrderDraftData, type OrderPaymentActionData, OrderPaymentContinuation, type OrderPaymentControls, OrderPaymentInReview, type OrderProgressStep, type OrderStatusData, type PageItem, type PageOptions, type PageSeo, type PageSeoInput, PaymentLogo, type PaymentMethodSaving, PhoneField, type PhoneFieldProps, type ProductPage, type ProductReviews, type ProductSource, type ProductVariant, type ProfileActionData, type ResolvedPage, type ResolvedUrl, type ReviewActionData, type ReviewSummary, RichText, SORT_OPTIONS, type SectionCatalog, type SectionData, type SectionEntry, type SectionGroup, type SectionLoadArgs, type SectionModules, SectionPreview, type SectionPreviewData, type SectionProps, type SectionRoot, type SortLabels, type SortValue, SourceProvider, StorefrontAnchor, type StorefrontAnchorProps, type StorefrontEnv, StorefrontLanguageProvider, StorefrontLink, type StorefrontLinkProps, type StorefrontLinks, type StorefrontPageData, type TemplateKind, type TemplateModule, type TemplateModules, type TrackingData, type VariantOption, type WorkerContext, activeFilterChips, activeFilterCount, addressAction, canonicalUrl, cartAction, cartCookie, cartToken, categorySeo, checkoutAction, checkoutAddressDefaults, checkoutProgress, checkoutStep, clearedFiltersHref, collectionImageCandidates, collectionPage, collectionSeo, complaintBookAction, complaintBookAttachmentError, complaintBookLinks, complaintBookNumber, completeCustomerLogin, createRequestHandler, culqiSourceKey, customer, customerCsrfToken, customerHeaders, defaultPaymentMethod, discountPercent, filterLabel, filterValueLabel, found, hasOrderPaymentContinuation, homeSeo, identityDocumentRule, isOrderDraftPayable, isSingleChoiceFilter, isVariantAvailable, loadAccount, loadAddresses, loadCart, loadCategory, loadCheckout, loadComplaintBook, loadCustomerRegistration, loadGeo, loadOrder, loadOrderDraft, loadOrderStatus, loadOrders, loadPage, loadProduct, loadProfile, loadReview, loadSearchSuggestions, loadSections, loadStorefrontTranslations, loadTracking, logout, money, needsShipping, optional, orderDraftAction, orderPaymentAction, orderProgress, orderStepTitle, pageItems, pageSeo, paymentLogoCodes, paymentMethodSaving, pickProducts, pickVariant, productPage, productReviewAction, productReviews, productSeo, profileAction, readCart, readCatalog, readCountries, readCustomerAddress, readPage, readPlace, readStorefrontLayout, readStorefrontLinks, requireCanonical, requireCustomer, requireCustomerRegistration, resolvePage, resolveUrl, reviewAction, safeNext, section, sectionKey, sectionPreview, sectionPreviewMeta, selectedFacetCount, seoMeta, setting, shouldRevalidateCatalogRoot, source, sourceValue, startCustomerLogin, store, storefrontContact, storefrontHref, storefrontRouteText, storefrontText, submitCustomerLogin, submitCustomerRegistration, templateComponent, templateName, templatePath, templated, text, useCheckout, useCustomerCsrfToken, useFacets, useGeoCascade, useOrderPayment, usePagination, useSearchSuggestions, useSection, useSort, useStorefrontLinkPublished, useStorefrontLocale, useStorefrontText, variantOptions, variantSwatches, withImages, withSectionBoundary, withSections, worker };