@wix/form-elements 1.159.0 → 1.161.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 (117) hide show
  1. package/dist/component/{appointment-rac-CpiyUOXo.js → appointment-rac-BubC8I9X.js} +388 -381
  2. package/dist/component/{bookings-address-rac-BBEUV1t7.js → bookings-address-rac-BbwvVs86.js} +1 -1
  3. package/dist/component/{bookings-email-rac-DdfoeLFV.js → bookings-email-rac-C2HCkcfa.js} +1 -1
  4. package/dist/component/{bookings-first-name-rac-DH39yvQ-.js → bookings-first-name-rac-Uy7c5EBs.js} +1 -1
  5. package/dist/component/{bookings-header-rac-StLm7b4I.js → bookings-header-rac-nmwsWRjS.js} +1 -1
  6. package/dist/component/{bookings-last-name-rac-DHZMPMOO.js → bookings-last-name-rac-BAioQLCg.js} +1 -1
  7. package/dist/component/{bookings-login-bar-rac-DrHp1ojM.js → bookings-login-bar-rac-CO6vOBjG.js} +5 -5
  8. package/dist/component/{bookings-phone-rac-6aGjbavK.js → bookings-phone-rac-Cr16h-_R.js} +1 -1
  9. package/dist/component/{bookings-rich-text-rac-DBlGZUM5.js → bookings-rich-text-rac-CHLH3jd7.js} +1 -1
  10. package/dist/component/{checkbox-field-rac-Cna1Va1X.js → checkbox-field-rac-CMwmwFMD.js} +4 -4
  11. package/dist/component/{checkbox-group-field-headless-m_-10Mdx.js → checkbox-group-field-headless-BNs_S-nT.js} +50 -50
  12. package/dist/component/{checkbox-group-field-rac-BSCi5hmx.js → checkbox-group-field-rac-BA60EPAN.js} +12 -12
  13. package/dist/component/{checkbox-group-rac-BWYQZmAI.js → checkbox-group-rac-BJZ4Oer9.js} +1 -1
  14. package/dist/component/{checkbox-rac-BsUTfSUf.js → checkbox-rac-KsVlI6_V.js} +1 -1
  15. package/dist/component/{contacts-address-rac-DwCLW8rV.js → contacts-address-rac-CRYkz87z.js} +1 -1
  16. package/dist/component/{contacts-birthdate-rac-DnNgxbKb.js → contacts-birthdate-rac-BIz-1-ZX.js} +1 -1
  17. package/dist/component/{contacts-company-rac-BQqXzpNl.js → contacts-company-rac-B8G__j6I.js} +1 -1
  18. package/dist/component/{contacts-email-rac-BINnZzxp.js → contacts-email-rac-Dztkvp5i.js} +1 -1
  19. package/dist/component/{contacts-first-name-rac-DBWKFkIU.js → contacts-first-name-rac-CVSEWpLU.js} +1 -1
  20. package/dist/component/{contacts-last-name-rac-D_-qrF7I.js → contacts-last-name-rac-Blz4M5bk.js} +1 -1
  21. package/dist/component/{contacts-phone-rac-7n7JkSDr.js → contacts-phone-rac-CPCE5soY.js} +1 -1
  22. package/dist/component/{contacts-position-rac-DvXP8nvT.js → contacts-position-rac-Dd_kBjqG.js} +1 -1
  23. package/dist/component/{contacts-subscribe-rac-DnLnV5Gm.js → contacts-subscribe-rac-C6AlsP10.js} +1 -1
  24. package/dist/component/{contacts-tax-id-rac-BJVWhvYW.js → contacts-tax-id-rac-CQ1n29zI.js} +1 -1
  25. package/dist/component/{date-availability-Df807-eN.js → date-availability-DDj1j0z5.js} +1 -1
  26. package/dist/component/date-input-field-rac-D5r1n_ah.js +309 -0
  27. package/dist/component/{date-input-rac-CSB3MWHW.js → date-input-rac-Cyi5mU_P.js} +1 -1
  28. package/dist/component/{date-picker-field-rac-CySThPfz.js → date-picker-field-rac-CeG391Zo.js} +79 -79
  29. package/dist/component/{date-picker-rac-Fp8_pxtf.js → date-picker-rac-Ci9aHgav.js} +1 -1
  30. package/dist/component/date-time-input-field-rac-CrbYEbJJ.js +441 -0
  31. package/dist/component/{date-time-input-rac-wctMR4uM.js → date-time-input-rac-DDJLkqs0.js} +1 -1
  32. package/dist/component/{dext-checkbox-group-rac-erMPfwFL.js → dext-checkbox-group-rac-C3ftVHBA.js} +4 -4
  33. package/dist/component/{dext-checkbox-rac-DQSq9Lqd.js → dext-checkbox-rac-BGLYWn68.js} +1 -1
  34. package/dist/component/{dext-date-picker-rac-RCLcd1VV.js → dext-date-picker-rac-Cy9RlDlt.js} +1 -1
  35. package/dist/component/{dext-date-time-input-rac-DMolWzvy.js → dext-date-time-input-rac-88ZoTd5e.js} +1 -1
  36. package/dist/component/{dext-dropdown-rac-wQ2GJL4V.js → dext-dropdown-rac-CPxDUuk9.js} +1 -1
  37. package/dist/component/{dext-email-rac-BtymBVTW.js → dext-email-rac-BAvQwDPA.js} +1 -1
  38. package/dist/component/{dext-number-input-rac-DHPiK0Z3.js → dext-number-input-rac-D7HYQVKq.js} +1 -1
  39. package/dist/component/{dext-phone-rac-C58vHEEe.js → dext-phone-rac--FhcplSI.js} +1 -1
  40. package/dist/component/dext-radio-group-rac-DBz8iCKW.js +18 -0
  41. package/dist/component/{dext-rating-input-rac-DI0k3tVa.js → dext-rating-input-rac-Cv7nThfe.js} +1 -1
  42. package/dist/component/{dext-tags-rac-DmF6ctvQ.js → dext-tags-rac-CRUUc5dr.js} +2 -2
  43. package/dist/component/{dext-text-area-rac-Bv6ridbR.js → dext-text-area-rac-DQBQXV1L.js} +1 -1
  44. package/dist/component/{dext-text-input-rac-DoTAdUgU.js → dext-text-input-rac-4CpM581y.js} +1 -1
  45. package/dist/component/{dext-url-input-rac-BuoMS6g2.js → dext-url-input-rac-0C1jTEr9.js} +1 -1
  46. package/dist/component/{donation-rac-CjZalSgn.js → donation-rac-Cgt0ZE50.js} +79 -79
  47. package/dist/component/{dropdown-field-rac-By_fpqhx.js → dropdown-field-rac-DlGKR7pZ.js} +14 -14
  48. package/dist/component/{dropdown-rac-BnIEC4RX.js → dropdown-rac-CYFW_3x_.js} +1 -1
  49. package/dist/component/{ecom-address-rac-B6Usk1Ty.js → ecom-address-rac-CQfQHpXC.js} +1 -1
  50. package/dist/component/{ecom-subscription-checkbox-rac-B4B0wzlC.js → ecom-subscription-checkbox-rac-D2v2Upvz.js} +2 -2
  51. package/dist/component/{email-input-field-rac-Df3KI3_v.js → email-input-field-rac-CVw25yRo.js} +39 -39
  52. package/dist/component/{events-repeater-rac-B2iBk8lV.js → events-repeater-rac-BCVUcmFj.js} +25 -25
  53. package/dist/component/{events-rsvp-rac-xl_qCIh3.js → events-rsvp-rac-DwbqEr8z.js} +18 -18
  54. package/dist/component/{field-error-headless-DWc76YmY.js → field-error-headless-XnVcMmsL.js} +3 -3
  55. package/dist/component/{field-label-headless-DKBKqI2X.js → field-label-headless-BRTLT2Yt.js} +16 -16
  56. package/dist/component/{file-upload-rac-BVj4cRqe.js → file-upload-rac-Dkwg9Jk4.js} +118 -118
  57. package/dist/component/{fixed-payment-rac-BS1Hb4hg.js → fixed-payment-rac-ST98xAa2.js} +13 -13
  58. package/dist/component/{form-BTUoOcqB.js → form-BUqSKOvc.js} +785 -727
  59. package/dist/component/form.js +1 -1
  60. package/dist/component/{header-field-rac-DTJ_Us6u.js → header-field-rac-CzNTGYWq.js} +6 -6
  61. package/dist/component/{header-rac-CvYp0Jjo.js → header-rac-DUt6AIAE.js} +1 -1
  62. package/dist/component/{image-choice-rac--qrYqKJl.js → image-choice-rac-DuBgrSt2.js} +23 -23
  63. package/dist/component/{index-DIl9BH2M.js → index-CDO22hht.js} +66 -66
  64. package/dist/component/{index-CoEV4QEy.js → index-cZZeAuuu.js} +2 -2
  65. package/dist/component/{isObjectLike-CLN09X5V.js → isObjectLike-cs4bARpC.js} +11 -11
  66. package/dist/component/multiline-address-field-rac-vcEWhUCV.js +1664 -0
  67. package/dist/component/{multiline-address-rac-DtaAJjbR.js → multiline-address-rac-WQaI2eUX.js} +1 -1
  68. package/dist/component/{number-input-field-rac-2gqDUlw9.js → number-input-field-rac-CBUMqATk.js} +23 -23
  69. package/dist/component/{number-input-rac-BlciEPLN.js → number-input-rac-B4j5hyzS.js} +1 -1
  70. package/dist/component/{password-rac-BvvQgafk.js → password-rac-DwLyf45N.js} +27 -27
  71. package/dist/component/{payment-input-rac-CSRyOPPr.js → payment-input-rac-D0Od---y.js} +31 -31
  72. package/dist/component/phone-input-field-rac-COlu9IeC.js +512 -0
  73. package/dist/component/{phone-rac-DMP1MoRs.js → phone-rac-Dh4RacOF.js} +1 -1
  74. package/dist/component/{product-list-rac-WQ9Qhzum.js → product-list-rac-D7zHDE2D.js} +39 -39
  75. package/dist/component/{quiz-radio-group-rac-DzrL3-gZ.js → quiz-radio-group-rac-1AaKphJt.js} +1 -1
  76. package/dist/component/{radio-button-module-classes-CJk18LzO.js → radio-button-module-classes-VqaP6vpA.js} +30 -30
  77. package/dist/component/{radio-group-field-rac-DGoMoSgo.js → radio-group-field-rac-Cp3LRN3C.js} +8 -8
  78. package/dist/component/{radio-group-rac-DhAELVNV.js → radio-group-rac-KhmhzYGf.js} +1 -1
  79. package/dist/component/{rating-input-field-rac-CFoesqmC.js → rating-input-field-rac-10n6ciCr.js} +39 -39
  80. package/dist/component/{rating-input-rac-CFMIxche.js → rating-input-rac-XZjjY2Gp.js} +1 -1
  81. package/dist/component/{rich-content-rac.module-xJ03MegT.js → rich-content-rac.module-kMwDoLBa.js} +8 -8
  82. package/dist/component/{rich-text-field-rac-CBMY4JOB.js → rich-text-field-rac-H5bd8fAt.js} +4 -4
  83. package/dist/component/{rich-text-rac-CvZ7s1Ct.js → rich-text-rac-88GSQR62.js} +1 -1
  84. package/dist/component/service-dropdown-rac-B1_Xr_X3.js +145 -0
  85. package/dist/component/{services-multi-choice-rac-fXOov4K7.js → services-multi-choice-rac-DWp_Llbi.js} +11 -11
  86. package/dist/component/{signature-rac-CG_Q9Oxr.js → signature-rac-zN_6KRDp.js} +82 -82
  87. package/dist/component/{submit-button-rac-DAsovEp2.js → submit-button-rac-Dv6UarYX.js} +12 -12
  88. package/dist/component/{tags-field-rac-9mpOMPLm.js → tags-field-rac-sVN6MHfJ.js} +43 -43
  89. package/dist/component/{tags-rac-CNBJ08wS.js → tags-rac-DhTHs_XN.js} +1 -1
  90. package/dist/component/{text-area-field-rac-D4aTm7CM.js → text-area-field-rac-DrWkww7W.js} +19 -19
  91. package/dist/component/{text-area-rac-DoKiH_Kv.js → text-area-rac-CXXh-ZdY.js} +1 -1
  92. package/dist/component/{text-input-field-rac-BbvPB26b.js → text-input-field-rac-C2YiMr-g.js} +5 -5
  93. package/dist/component/text-input-headless-BJMNbsMY.js +47 -0
  94. package/dist/component/{text-input-rac-1ac1EKad.js → text-input-rac-CpsPh7FH.js} +1 -1
  95. package/dist/component/{time-input-rac-BS0rR-89.js → time-input-rac-DG_1KxS4.js} +20 -20
  96. package/dist/component/{url-input-field-rac-DbO6ATng.js → url-input-field-rac-twxRREnl.js} +19 -19
  97. package/dist/component/{url-input-rac-DHuny3d-.js → url-input-rac-BTStO0NP.js} +1 -1
  98. package/dist/component/use-dropdown-option-class-name-DbMMg1ws.js +116 -0
  99. package/dist/component/use-dropdown-trigger-class-name-Yes4kC_0.js +96 -0
  100. package/dist/component/{use-element-state-class-name-BUsFQfoW.js → use-element-state-class-name-DlncY4hk.js} +1 -1
  101. package/dist/component/{use-hoverable-input-class-name-C2l3G8gb.js → use-hoverable-input-class-name-C__zqP5j.js} +2 -2
  102. package/dist/component/use-is-forced-open-dropdown-DnK_MQRO.js +53 -0
  103. package/dist/component/{use-service-options-base-D_enm38a.js → use-service-options-base-DKJe52Vk.js} +6 -6
  104. package/dist/component/use-text-input-class-name-D9tJTR-b.js +6 -0
  105. package/dist/form.d.ts +11 -0
  106. package/package.json +2 -2
  107. package/dist/component/date-input-field-rac-CEuPElMH.js +0 -303
  108. package/dist/component/date-time-input-field-rac-DG5KSBHe.js +0 -433
  109. package/dist/component/dext-radio-group-rac-Cp-I94HW.js +0 -18
  110. package/dist/component/dropdown-field-headless-BYEjiIUf.js +0 -93
  111. package/dist/component/multiline-address-field-rac-BjWzx-LH.js +0 -1659
  112. package/dist/component/phone-input-field-rac-BVWzH_TY.js +0 -508
  113. package/dist/component/service-dropdown-rac-B627AgPG.js +0 -145
  114. package/dist/component/text-input-headless-BGaBRrP1.js +0 -47
  115. package/dist/component/use-dropdown-trigger-class-name-rcGBzxI1.js +0 -117
  116. package/dist/component/use-is-forced-open-dropdown-CoOk4W4i.js +0 -48
  117. package/dist/component/use-text-input-class-name-BLtPQoYE.js +0 -6
@@ -0,0 +1,1664 @@
1
+ import { RicosViewer as G } from "@wix/ricos/viewer";
2
+ import L from "classnames";
3
+ import n, { useMemo as q, createContext as $e, useContext as Ce, useState as Ee, useRef as x, useCallback as R, useEffect as Ae } from "react";
4
+ import { UNSAFE_PortalProvider as Tt } from "react-aria";
5
+ import { bv as Ct, d as It, bq as Mt, bs as Lt, b3 as wt, b4 as qt, aY as xt, b2 as V, F as K, bK as Pe, bj as it, bA as P, bx as M, bC as ae, bw as Nt, b8 as Bt, C as Oe, bh as kt, bl as Ut, bH as Wt, bB as $t, bG as Vt, bo as Kt, bd as Yt, bn as Ht, bD as jt, aE as Jt, X as Xt, W as z, ac as Q, J as Ne, M as Z, G as ee, Y as Gt, Z as zt } from "./form-BUqSKOvc.js";
6
+ import { f as b, a as v } from "./find-child-C60k4CxG.js";
7
+ import { F as Qt, V as Zt } from "./headless-styles-CmcyA_pi.js";
8
+ import { a as en } from "./use-is-forced-open-dropdown-DnK_MQRO.js";
9
+ import { TextField as be, Input as le, ComboBoxStateContext as Ve, ComboBox as Fe, Popover as Se, ListBox as Te, ListBoxItem as he, Group as Ot, Button as gt } from "react-aria-components";
10
+ import { D as ie, E as ce } from "./field-error-headless-XnVcMmsL.js";
11
+ import { L as de } from "./field-label-headless-BRTLT2Yt.js";
12
+ import { e as tn, c as nn, a as rn, r as vt } from "./isObjectLike-cs4bARpC.js";
13
+ import { V as on, u as sn } from "./use-dropdown-option-class-name-DbMMg1ws.js";
14
+ import { u as an } from "./use-invoke-callback-UH73A_J3.js";
15
+ import { C as ct } from "./chevron-down-icon-CcpVm6B-.js";
16
+ import { E as te } from "./error-icon-hZxQ6DEy.js";
17
+ import { H as Me } from "./custom-focus-class-_483Pkwp.js";
18
+ import { s as C } from "./field-rac.module-DP0lkkEv.js";
19
+ import { u as dt } from "./use-hoverable-input-class-name-C__zqP5j.js";
20
+ const ln = (e, t, o) => {
21
+ var s, l, i, a;
22
+ const r = (s = e.steps) == null ? void 0 : s.map((d) => {
23
+ var m, u, y, I, p, E;
24
+ return {
25
+ ...d,
26
+ layout: {
27
+ ...d.layout,
28
+ large: {
29
+ ...(m = d.layout) == null ? void 0 : m.large,
30
+ items: ((I = (y = (u = d.layout) == null ? void 0 : u.large) == null ? void 0 : y.items) == null ? void 0 : I.map((f) => ({
31
+ ...f,
32
+ row: o.row <= f.row ? (f.row || 0) + 1 : f.row
33
+ }))) || ((E = (p = d.layout) == null ? void 0 : p.large) == null ? void 0 : E.items)
34
+ }
35
+ }
36
+ };
37
+ });
38
+ return (a = (i = (l = r == null ? void 0 : r[0].layout) == null ? void 0 : l.large) == null ? void 0 : i.items) == null || a.unshift(o), {
39
+ ...e,
40
+ fields: [
41
+ t,
42
+ ...e.fields || []
43
+ ],
44
+ steps: r || e.steps
45
+ };
46
+ };
47
+ var ye = /* @__PURE__ */ (function(e) {
48
+ return e.COUNTRY = "country", e.SUBDIVISION = "subdivision", e.CITY = "city", e.ADDRESS_LINE = "addressLine", e.ADDRESS_LINE_2 = "addressLine2", e.POSTAL_CODE = "postalCode", e.STREET_NAME = "streetName", e.STREET_NUMBER = "streetNumber", e.APARTMENT = "apartment", e;
49
+ })({});
50
+ function cn(e, t, o = !1) {
51
+ const { country: r, subdivision: s, city: l, addressLine: i, streetAddress: a, addressLine2: d, postalCode: m } = e, u = {};
52
+ return t ? (r && (u.country = r), s && (u.subdivision = s), l && (u.city = l), i ? u.addressLine = i : a != null && a.formattedAddressLine && (u.addressLine = a == null ? void 0 : a.formattedAddressLine), d && (u.addressLine = d), m && (u.postalCode = m), a != null && a.apt && (u.apartment = a == null ? void 0 : a.apt), a != null && a.name ? u.streetName = a == null ? void 0 : a.name : o && (a != null && a.formattedAddressLine) && (u.streetName = a == null ? void 0 : a.formattedAddressLine), a != null && a.number && (u.streetNumber = a.number)) : (r && (u.country = r), s && (u.subdivision = s), l && (u.city = l), i ? u.address_line = i : a != null && a.formattedAddressLine && (u.address_line = a == null ? void 0 : a.formattedAddressLine), d && (u.address_line = d), m && (u.postal_code = m), a != null && a.apt && (u.apartment = a == null ? void 0 : a.apt), a != null && a.name ? u.street_name = a == null ? void 0 : a.name : o && (a != null && a.formattedAddressLine) && (u.street_name = a == null ? void 0 : a.formattedAddressLine), a != null && a.number && (u.street_number = a.number)), u;
53
+ }
54
+ const Ft = /* @__PURE__ */ $e({
55
+ onAddressSelect: () => {
56
+ }
57
+ }), dn = ({ children: e, onAddressSelect: t, autocompleteEnabled: o }) => {
58
+ const r = q(() => ({
59
+ onAddressSelect: t,
60
+ autocompleteEnabled: o
61
+ }), [
62
+ t,
63
+ o
64
+ ]);
65
+ return /* @__PURE__ */ n.createElement(Ft.Provider, {
66
+ value: r
67
+ }, e);
68
+ };
69
+ function Ie() {
70
+ return Ce(Ft);
71
+ }
72
+ const St = /* @__PURE__ */ $e(void 0), un = ({ children: e, countryCode: t }) => {
73
+ const o = q(() => ({
74
+ countryCode: t
75
+ }), [
76
+ t
77
+ ]);
78
+ return /* @__PURE__ */ n.createElement(St.Provider, {
79
+ value: o
80
+ }, e);
81
+ };
82
+ function Le() {
83
+ const e = Ce(St);
84
+ return e == null ? void 0 : e.countryCode;
85
+ }
86
+ function we(e) {
87
+ return e != null;
88
+ }
89
+ function mn(e, t, o) {
90
+ return !t || !o ? e : {
91
+ ...e,
92
+ fields: (e.fields ?? []).map((r) => {
93
+ const { show: s, ...l } = t[r.target] || {}, { required: i } = o[r.target] || {};
94
+ return {
95
+ ...r,
96
+ view: {
97
+ ...r.view,
98
+ ...l
99
+ },
100
+ ...we(s) && {
101
+ hidden: !s
102
+ },
103
+ ...we(i) && we(r.validation) && {
104
+ validation: {
105
+ ...r.validation,
106
+ required: i
107
+ }
108
+ }
109
+ };
110
+ })
111
+ };
112
+ }
113
+ const pn = (e, t) => e.map((o) => ({
114
+ ...o,
115
+ id: ("target" in o ? t[o.target] : void 0) ?? o.id
116
+ })), ht = 12, En = (e) => {
117
+ const t = e.filter((r) => !r.properties.hidden), o = e.filter((r) => r.properties.hidden);
118
+ return {
119
+ visibleFields: t,
120
+ hiddenFields: o
121
+ };
122
+ }, bn = (e) => {
123
+ const t = {};
124
+ return e.forEach((o) => {
125
+ const r = o.layout.row;
126
+ t[r] || (t[r] = []), t[r].push(o);
127
+ }), t;
128
+ }, fn = (e) => {
129
+ const t = {};
130
+ return Object.keys(e).forEach((o) => {
131
+ const r = parseInt(o, 10), s = e[r];
132
+ s.reduce((i, a) => i + a.layout.width, 0) !== ht && (t[r] = s);
133
+ }), t;
134
+ }, yn = (e, t) => e.map((o) => {
135
+ const r = o.layout.row;
136
+ if (t[r] && !o.properties.hidden) {
137
+ const s = t[r], l = s.length, i = ht / l, a = s.findIndex((m) => m.id === o.id), d = i * a;
138
+ return {
139
+ ...o,
140
+ layout: {
141
+ ...o.layout,
142
+ width: i,
143
+ column: d
144
+ }
145
+ };
146
+ }
147
+ return o;
148
+ }), Cn = (e, t, o) => {
149
+ const r = Math.max(...t.map((s) => s.layout.row), -1);
150
+ return e.map((s) => {
151
+ if (s.properties.hidden) {
152
+ const l = o.findIndex((i) => i.id === s.id);
153
+ return {
154
+ ...s,
155
+ layout: {
156
+ ...s.layout,
157
+ row: r + 1 + l
158
+ }
159
+ };
160
+ }
161
+ return s;
162
+ });
163
+ }, In = (e) => {
164
+ const { visibleFields: t, hiddenFields: o } = En(e.fields), r = bn(t), s = fn(r), l = yn(e.fields, s), i = Cn(l, t, o);
165
+ return {
166
+ ...e,
167
+ fields: i
168
+ };
169
+ }, Ln = () => ({
170
+ country: V(),
171
+ subdivision: V(),
172
+ city: V(),
173
+ address_line: V(),
174
+ address_line_2: V(),
175
+ postal_code: V(),
176
+ street_name: V(),
177
+ street_number: V(),
178
+ apartment: V()
179
+ }), Nn = ({ id: e, target: t, fieldType: o, form: r, country: s, fieldSettings: l, validation: i, required: a }) => {
180
+ const [d] = Ee(Ln), { isExperimentEnabled: m } = Ct(), u = m(It.USE_FIELDS_V2), { getCountryAddressForm: y } = Mt(), { isMobile: I, breakpoint: p } = Lt(), E = y(s), f = o === K.MULTILINE_ADDRESS || o === K.BOOKINGS_ADDRESS, N = q(() => {
181
+ var g;
182
+ return wt(a, (g = i == null ? void 0 : i.predefined) == null ? void 0 : g.multilineAddressOptions);
183
+ }, [
184
+ i,
185
+ a
186
+ ]), S = q(() => qt(), []);
187
+ return {
188
+ form: q(() => {
189
+ var T, O;
190
+ if (!f || !E)
191
+ return r && {
192
+ ...r,
193
+ fields: pn(r.fields, d)
194
+ };
195
+ const g = xt({
196
+ useFieldsV2: u,
197
+ path: t,
198
+ parentId: e,
199
+ includeHiddenFields: !0,
200
+ isMobile: I,
201
+ breakpoint: p,
202
+ form: mn(ln(E, N, S), l, (O = (T = i == null ? void 0 : i.predefined) == null ? void 0 : T.multilineAddressOptions) == null ? void 0 : O.fields)
203
+ });
204
+ if (!g.fields.some((D) => D.properties.hidden))
205
+ return g;
206
+ const w = In(g);
207
+ return {
208
+ ...w,
209
+ fields: w.fields.filter((D) => !D.properties.hidden)
210
+ };
211
+ }, [
212
+ E,
213
+ r,
214
+ d,
215
+ l,
216
+ i,
217
+ t,
218
+ N,
219
+ S,
220
+ f,
221
+ u,
222
+ e,
223
+ I,
224
+ p
225
+ ]),
226
+ isMultilineAddressField: f
227
+ };
228
+ }, Dt = /* @__PURE__ */ $e(void 0), On = ({ children: e, fields: t }) => {
229
+ const o = q(() => ({
230
+ fields: t
231
+ }), [
232
+ t
233
+ ]);
234
+ return /* @__PURE__ */ n.createElement(Dt.Provider, {
235
+ value: o
236
+ }, e);
237
+ };
238
+ function ue(e) {
239
+ const t = Ce(Dt);
240
+ if (!t)
241
+ throw new Error("useAddressFields must be used within AddressFieldsProvider");
242
+ return t.fields[e];
243
+ }
244
+ function me(e) {
245
+ const { t } = Pe(), o = Le(), r = o && it.getCountryByShortKey(o), l = (r ? r.addressPartDisplayNames : it.getDefaultAddressDisplayNames())[e];
246
+ return l ? t(l) : "";
247
+ }
248
+ const ne = ({ children: e }) => {
249
+ const { id: t, value: o, onChange: r, disabled: s, readOnly: l, required: i, hasError: a, onBlur: d, onFocus: m, FieldLayout: u } = P(), { labelId: y } = M(), I = me("addressLine2"), p = b(e, ne.Label), E = b(e, ne.Input), f = b(e, ne.Description), N = b(e, ne.Error);
250
+ return /* @__PURE__ */ n.createElement(u, {
251
+ fieldId: t,
252
+ renderLabel: () => v(p, {
253
+ label: I
254
+ }),
255
+ renderInput: () => /* @__PURE__ */ n.createElement(be, {
256
+ "aria-labelledby": y,
257
+ value: o ?? "",
258
+ onChange: r,
259
+ isDisabled: s,
260
+ isReadOnly: l,
261
+ isRequired: i,
262
+ isInvalid: a,
263
+ onBlur: d,
264
+ onFocus: m
265
+ }, E),
266
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, N, f)
267
+ });
268
+ }, gn = ({ className: e }) => {
269
+ const { id: t, placeholder: o } = P(), { inputId: r, ariaDescribedBy: s } = M(), l = x(null);
270
+ return ae(() => {
271
+ var i;
272
+ (i = l.current) == null || i.focus({
273
+ preventScroll: !0
274
+ });
275
+ }, t), /* @__PURE__ */ n.createElement(le, {
276
+ ref: l,
277
+ id: r,
278
+ autoComplete: "address-line2",
279
+ "aria-describedby": s,
280
+ className: e,
281
+ placeholder: o
282
+ });
283
+ };
284
+ ne.Label = de;
285
+ ne.Input = gn;
286
+ ne.Description = ie;
287
+ ne.Error = ce;
288
+ const Ke = ({ enabled: e }) => {
289
+ const { actions: t } = Nt(), [o, r] = Ee(V()), s = R(() => r(V()), []);
290
+ return q(() => {
291
+ const { predict: l, getPlace: i, searchByPostalCode: a } = t ?? {};
292
+ if (!(!e || !l || !i || !a))
293
+ return {
294
+ predict: (d) => l({
295
+ ...d,
296
+ sessionToken: o
297
+ }),
298
+ getPlace: (d) => i({
299
+ ...d,
300
+ sessionToken: o,
301
+ refreshSessionToken: s
302
+ }),
303
+ searchByPostalCode: (d) => a({
304
+ ...d,
305
+ sessionToken: o
306
+ })
307
+ };
308
+ }, [
309
+ e,
310
+ t,
311
+ o,
312
+ s
313
+ ]);
314
+ };
315
+ var qe, ut;
316
+ function vn() {
317
+ if (ut) return qe;
318
+ ut = 1;
319
+ var e = tn(), t = function() {
320
+ return e.Date.now();
321
+ };
322
+ return qe = t, qe;
323
+ }
324
+ var xe, mt;
325
+ function Fn() {
326
+ if (mt) return xe;
327
+ mt = 1;
328
+ var e = /\s/;
329
+ function t(o) {
330
+ for (var r = o.length; r-- && e.test(o.charAt(r)); )
331
+ ;
332
+ return r;
333
+ }
334
+ return xe = t, xe;
335
+ }
336
+ var Be, pt;
337
+ function Sn() {
338
+ if (pt) return Be;
339
+ pt = 1;
340
+ var e = Fn(), t = /^\s+/;
341
+ function o(r) {
342
+ return r && r.slice(0, e(r) + 1).replace(t, "");
343
+ }
344
+ return Be = o, Be;
345
+ }
346
+ var ke, Et;
347
+ function hn() {
348
+ if (Et) return ke;
349
+ Et = 1;
350
+ var e = nn(), t = rn(), o = "[object Symbol]";
351
+ function r(s) {
352
+ return typeof s == "symbol" || t(s) && e(s) == o;
353
+ }
354
+ return ke = r, ke;
355
+ }
356
+ var Ue, bt;
357
+ function Dn() {
358
+ if (bt) return Ue;
359
+ bt = 1;
360
+ var e = Sn(), t = vt(), o = hn(), r = NaN, s = /^[-+]0x[0-9a-f]+$/i, l = /^0b[01]+$/i, i = /^0o[0-7]+$/i, a = parseInt;
361
+ function d(m) {
362
+ if (typeof m == "number")
363
+ return m;
364
+ if (o(m))
365
+ return r;
366
+ if (t(m)) {
367
+ var u = typeof m.valueOf == "function" ? m.valueOf() : m;
368
+ m = t(u) ? u + "" : u;
369
+ }
370
+ if (typeof m != "string")
371
+ return m === 0 ? m : +m;
372
+ m = e(m);
373
+ var y = l.test(m);
374
+ return y || i.test(m) ? a(m.slice(2), y ? 2 : 8) : s.test(m) ? r : +m;
375
+ }
376
+ return Ue = d, Ue;
377
+ }
378
+ var We, ft;
379
+ function Rn() {
380
+ if (ft) return We;
381
+ ft = 1;
382
+ var e = vt(), t = vn(), o = Dn(), r = "Expected a function", s = Math.max, l = Math.min;
383
+ function i(a, d, m) {
384
+ var u, y, I, p, E, f, N = 0, S = !1, h = !1, g = !0;
385
+ if (typeof a != "function")
386
+ throw new TypeError(r);
387
+ d = o(d) || 0, e(m) && (S = !!m.leading, h = "maxWait" in m, I = h ? s(o(m.maxWait) || 0, d) : I, g = "trailing" in m ? !!m.trailing : g);
388
+ function _(F) {
389
+ var J = u, pe = y;
390
+ return u = y = void 0, N = F, p = a.apply(pe, J), p;
391
+ }
392
+ function w(F) {
393
+ return N = F, E = setTimeout(D, d), S ? _(F) : p;
394
+ }
395
+ function T(F) {
396
+ var J = F - f, pe = F - N, De = d - J;
397
+ return h ? l(De, I - pe) : De;
398
+ }
399
+ function O(F) {
400
+ var J = F - f, pe = F - N;
401
+ return f === void 0 || J >= d || J < 0 || h && pe >= I;
402
+ }
403
+ function D() {
404
+ var F = t();
405
+ if (O(F))
406
+ return j(F);
407
+ E = setTimeout(D, T(F));
408
+ }
409
+ function j(F) {
410
+ return E = void 0, g && u ? _(F) : (u = y = void 0, p);
411
+ }
412
+ function fe() {
413
+ E !== void 0 && clearTimeout(E), N = 0, u = f = y = E = void 0;
414
+ }
415
+ function W() {
416
+ return E === void 0 ? p : j(t());
417
+ }
418
+ function A() {
419
+ var F = t(), J = O(F);
420
+ if (u = arguments, y = this, f = F, J) {
421
+ if (E === void 0)
422
+ return w(f);
423
+ if (h)
424
+ return clearTimeout(E), E = setTimeout(D, d), _(f);
425
+ }
426
+ return E === void 0 && (E = setTimeout(D, d)), p;
427
+ }
428
+ return A.cancel = fe, A.flush = W, A;
429
+ }
430
+ return We = i, We;
431
+ }
432
+ var _n = Rn();
433
+ const An = /* @__PURE__ */ Bt(_n), Pn = (e, t, o = 200) => {
434
+ const r = x(e), s = R(An((...l) => {
435
+ r.current(...l);
436
+ }, o), [
437
+ o
438
+ ]);
439
+ return Ae(() => {
440
+ r.current = e;
441
+ }, [
442
+ e,
443
+ t
444
+ ]), s;
445
+ }, Tn = () => {
446
+ const e = x(!0);
447
+ return Ae(() => () => {
448
+ e.current = !1;
449
+ }, []), () => e.current;
450
+ }, yt = {
451
+ loading: !1,
452
+ predictions: []
453
+ }, Rt = ({ atlas: e, onError: t }) => {
454
+ const [{ loading: r, predictions: s }, l] = Ee(yt), i = x(0), a = Tn(), d = R(() => {
455
+ i.current++, l(yt);
456
+ }, []), m = Pn(async ({ input: u, countryCodes: y }) => {
457
+ if (!e || !a())
458
+ return;
459
+ if (!u) {
460
+ d();
461
+ return;
462
+ }
463
+ const I = ++i.current;
464
+ l((E) => ({
465
+ ...E,
466
+ loading: !0
467
+ }));
468
+ let p;
469
+ try {
470
+ p = await e.predict({
471
+ input: u,
472
+ countryCodes: y
473
+ });
474
+ } catch (E) {
475
+ t ? t(E) : console.error(E);
476
+ } finally {
477
+ const E = I === i.current;
478
+ a() && E && l((f) => ({
479
+ loading: !1,
480
+ // set new predictions if fetched properly, else keep current predictions
481
+ predictions: p || f.predictions
482
+ }));
483
+ }
484
+ }, [
485
+ e,
486
+ t
487
+ ], 200);
488
+ return {
489
+ predictions: s,
490
+ loading: r,
491
+ updatePredictions: m,
492
+ clearPredictions: d
493
+ };
494
+ }, Ye = ({ optionCount: e }) => {
495
+ const t = Ce(Ve), o = x(t);
496
+ o.current = t;
497
+ const r = x(e);
498
+ return Ae(() => {
499
+ const s = e > 0 && r.current === 0;
500
+ r.current = e;
501
+ const l = o.current;
502
+ s && (l != null && l.isFocused) && !l.isOpen && l.open(null, "manual");
503
+ }, [
504
+ e
505
+ ]), null;
506
+ }, B = ({ children: e }) => {
507
+ const { id: t, value: o, onChange: r, disabled: s, readOnly: l, required: i, hasError: a, onBlur: d, onFocus: m, FieldLayout: u, autocomplete: y } = P(), { labelId: I } = M(), { autocompleteEnabled: p } = Ie(), E = y || p, f = me("addressLine1"), N = b(e, B.Label), S = b(e, B.Input), h = b(e, B.Options), g = b(e, B.Description), _ = b(e, B.Error);
508
+ return E ? /* @__PURE__ */ n.createElement(u, {
509
+ fieldId: t,
510
+ renderLabel: () => v(N, {
511
+ label: f
512
+ }),
513
+ renderInput: () => /* @__PURE__ */ n.createElement(Mn, {
514
+ value: o,
515
+ onChange: r,
516
+ disabled: s,
517
+ readOnly: l,
518
+ required: i,
519
+ hasError: a,
520
+ onBlur: d,
521
+ onFocus: m
522
+ }, S, h),
523
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, _, g)
524
+ }) : /* @__PURE__ */ n.createElement(u, {
525
+ fieldId: t,
526
+ renderLabel: () => v(N, {
527
+ label: f
528
+ }),
529
+ renderInput: () => /* @__PURE__ */ n.createElement(be, {
530
+ "aria-labelledby": I,
531
+ value: o ?? "",
532
+ onChange: r,
533
+ isDisabled: s,
534
+ isReadOnly: l,
535
+ isRequired: i,
536
+ isInvalid: a,
537
+ onBlur: d,
538
+ onFocus: m
539
+ }, S),
540
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, _, g)
541
+ });
542
+ }, Mn = ({ children: e, value: t, onChange: o, disabled: r, readOnly: s, required: l, hasError: i, onBlur: a, onFocus: d }) => {
543
+ const { labelId: m } = M(), { onAddressSelect: u } = Ie(), y = Le(), I = Ke({
544
+ enabled: !0
545
+ }), { predictions: p, updatePredictions: E, clearPredictions: f } = Rt({
546
+ atlas: I
547
+ }), N = q(() => p.map((O) => ({
548
+ id: O.searchId || "",
549
+ label: O.description || ""
550
+ })), [
551
+ p
552
+ ]), S = R((O) => {
553
+ E({
554
+ input: O,
555
+ countryCodes: y ? [
556
+ y
557
+ ] : void 0
558
+ }), o(O);
559
+ }, [
560
+ o,
561
+ E,
562
+ y
563
+ ]), h = R(async (O) => {
564
+ if (!O)
565
+ return;
566
+ f();
567
+ const D = await (I == null ? void 0 : I.getPlace({
568
+ searchId: String(O)
569
+ }));
570
+ D && u && u(D);
571
+ }, [
572
+ u,
573
+ f,
574
+ I
575
+ ]), g = R(() => {
576
+ f(), a == null || a();
577
+ }, [
578
+ a,
579
+ f
580
+ ]), _ = R(() => {
581
+ d == null || d();
582
+ }, [
583
+ d
584
+ ]), w = b(e, B.Input), T = b(e, B.Options);
585
+ return /* @__PURE__ */ n.createElement(Fe, {
586
+ "aria-labelledby": m,
587
+ inputValue: t ?? "",
588
+ onInputChange: S,
589
+ value: null,
590
+ onChange: h,
591
+ isDisabled: r,
592
+ isReadOnly: s,
593
+ isRequired: l,
594
+ isInvalid: i,
595
+ onBlur: g,
596
+ onFocus: _,
597
+ allowsCustomValue: !0,
598
+ menuTrigger: "input",
599
+ items: N
600
+ }, v(w, {
601
+ onFocus: _
602
+ }), v(T, {
603
+ options: N
604
+ }), /* @__PURE__ */ n.createElement(Ye, {
605
+ optionCount: N.length
606
+ }));
607
+ }, wn = ({ className: e, ...t }) => {
608
+ const { id: o, placeholder: r } = P(), { inputId: s, ariaDescribedBy: l } = M(), { onFocus: i } = t, a = x(null);
609
+ return ae(() => {
610
+ var d;
611
+ (d = a.current) == null || d.focus({
612
+ preventScroll: !0
613
+ });
614
+ }, o), /* @__PURE__ */ n.createElement(le, {
615
+ ref: a,
616
+ id: s,
617
+ autoComplete: "address-line1",
618
+ "aria-describedby": l,
619
+ className: e,
620
+ placeholder: r,
621
+ onFocus: i
622
+ });
623
+ }, He = ({ children: e, className: t }) => {
624
+ const o = b(e, He.Option);
625
+ return /* @__PURE__ */ n.createElement(Se, {
626
+ className: t,
627
+ containerPadding: 0,
628
+ offset: 0
629
+ }, /* @__PURE__ */ n.createElement(Te, {
630
+ renderEmptyState: () => null
631
+ }, (r) => v(o, {
632
+ id: r.id,
633
+ label: r.label
634
+ })));
635
+ }, qn = ({ className: e, ...t }) => {
636
+ const { id: o, label: r } = t;
637
+ return /* @__PURE__ */ n.createElement(he, {
638
+ className: e,
639
+ id: o,
640
+ textValue: r
641
+ }, r);
642
+ };
643
+ He.Option = qn;
644
+ B.Label = de;
645
+ B.Input = wn;
646
+ B.Options = He;
647
+ B.Description = ie;
648
+ B.Error = ce;
649
+ const re = ({ children: e }) => {
650
+ const { id: t, value: o, onChange: r, disabled: s, readOnly: l, required: i, hasError: a, onBlur: d, onFocus: m, FieldLayout: u } = P(), { labelId: y } = M(), { t: I } = Pe(), p = I("field.mla-apartment.label"), E = b(e, re.Label), f = b(e, re.Input), N = b(e, re.Description), S = b(e, re.Error);
651
+ return /* @__PURE__ */ n.createElement(u, {
652
+ fieldId: t,
653
+ renderLabel: () => v(E, {
654
+ label: p
655
+ }),
656
+ renderInput: () => /* @__PURE__ */ n.createElement(be, {
657
+ "aria-labelledby": y,
658
+ value: o ?? "",
659
+ onChange: r,
660
+ isDisabled: s,
661
+ isReadOnly: l,
662
+ isRequired: i,
663
+ isInvalid: a,
664
+ onBlur: d,
665
+ onFocus: m
666
+ }, f),
667
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, S, N)
668
+ });
669
+ }, xn = ({ className: e }) => {
670
+ const { id: t, placeholder: o } = P(), { inputId: r, ariaDescribedBy: s } = M(), l = x(null);
671
+ return ae(() => {
672
+ var i;
673
+ (i = l.current) == null || i.focus({
674
+ preventScroll: !0
675
+ });
676
+ }, t), /* @__PURE__ */ n.createElement(le, {
677
+ ref: l,
678
+ id: r,
679
+ autoComplete: "address-line2",
680
+ "aria-describedby": s,
681
+ className: e,
682
+ placeholder: o
683
+ });
684
+ };
685
+ re.Label = de;
686
+ re.Input = xn;
687
+ re.Description = ie;
688
+ re.Error = ce;
689
+ const oe = ({ children: e }) => {
690
+ const { id: t, value: o, onChange: r, disabled: s, readOnly: l, required: i, hasError: a, onBlur: d, onFocus: m, FieldLayout: u } = P(), { labelId: y } = M(), I = me("city"), p = b(e, oe.Label), E = b(e, oe.Input), f = b(e, oe.Description), N = b(e, oe.Error);
691
+ return /* @__PURE__ */ n.createElement(u, {
692
+ fieldId: t,
693
+ renderLabel: () => v(p, {
694
+ label: I
695
+ }),
696
+ renderInput: () => /* @__PURE__ */ n.createElement(be, {
697
+ "aria-labelledby": y,
698
+ value: o ?? "",
699
+ onChange: r,
700
+ isDisabled: s,
701
+ isReadOnly: l,
702
+ isRequired: i,
703
+ isInvalid: a,
704
+ onBlur: d,
705
+ onFocus: m
706
+ }, E),
707
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, N, f)
708
+ });
709
+ }, Bn = ({ className: e }) => {
710
+ const { id: t, placeholder: o } = P(), { inputId: r, ariaDescribedBy: s } = M(), l = x(null);
711
+ return ae(() => {
712
+ var i;
713
+ (i = l.current) == null || i.focus({
714
+ preventScroll: !0
715
+ });
716
+ }, t), /* @__PURE__ */ n.createElement(le, {
717
+ ref: l,
718
+ id: r,
719
+ autoComplete: "address-level2",
720
+ "aria-describedby": s,
721
+ className: e,
722
+ placeholder: o
723
+ });
724
+ };
725
+ oe.Label = de;
726
+ oe.Input = Bn;
727
+ oe.Description = ie;
728
+ oe.Error = ce;
729
+ const kn = ({ isOpen: e }) => {
730
+ const t = Ce(Ve), o = x(!1);
731
+ return Ae(() => {
732
+ e && t && !t.isOpen && t.open(null, "manual"), e && (t == null ? void 0 : t.selectionManager.focusedKey) != null && t.selectionManager.setFocusedKey(null), !e && o.current && (t == null || t.close()), o.current = e;
733
+ }, [
734
+ e,
735
+ t
736
+ ]), null;
737
+ }, _t = ({ readOnly: e, disabled: t } = {}) => {
738
+ const o = Ce(Ve);
739
+ return R(() => {
740
+ !o || o.isOpen || e || t || o.open(null, "manual");
741
+ }, [
742
+ o,
743
+ e,
744
+ t
745
+ ]);
746
+ }, Un = (e, t) => e.find((o) => o.label.toLocaleLowerCase() === t.toLocaleLowerCase().trim()), At = ({ options: e, value: t, commit: o, clear: r, onBlur: s }) => {
747
+ const [l, i] = Ee(null), a = an(s), d = q(() => {
748
+ var p;
749
+ return t ? ((p = e.find((E) => E.value === t)) == null ? void 0 : p.label) ?? "" : "";
750
+ }, [
751
+ t,
752
+ e
753
+ ]), m = R((p) => {
754
+ typeof p != "string" || p === "" || p === t || (i(null), o(p));
755
+ }, [
756
+ o,
757
+ t
758
+ ]), u = R((p) => {
759
+ if (i(p), p === "")
760
+ return;
761
+ const E = Un(e, p);
762
+ E && E.value !== t && o(E.value);
763
+ }, [
764
+ o,
765
+ e,
766
+ t
767
+ ]), y = R((p) => {
768
+ p.key !== "Enter" && p.key !== "Escape" || (i(null), p.key === "Enter" && l === "" && t && r());
769
+ }, [
770
+ l,
771
+ t,
772
+ r
773
+ ]), I = R(() => {
774
+ l === "" && t && r(), i(null), a();
775
+ }, [
776
+ l,
777
+ t,
778
+ r,
779
+ a
780
+ ]);
781
+ return {
782
+ value: t ?? null,
783
+ inputValue: l ?? d,
784
+ onChange: m,
785
+ onInputChange: u,
786
+ onBlur: I,
787
+ onInputKeyDown: y
788
+ };
789
+ }, Y = ({ children: e, ...t }) => {
790
+ const { isForcedOpen: o = !1 } = t, { id: r, value: s, onChange: l, disabled: i, readOnly: a, required: d, hasError: m, onBlur: u, onFocus: y, FieldLayout: I, options: p } = P(), { labelId: E } = M(), { t: f } = Pe(), { language: N } = Lt(), S = q(() => (p || []).reduce((A, F) => (F.value && Oe.hasOwnProperty(F.value) && A.push({
791
+ value: F.value,
792
+ label: f(`locale-dataset.countries.${Oe[F.value].toUpperCase()}`)
793
+ }), A), []).sort((A, F) => A.label.localeCompare(F.label, N)), [
794
+ p,
795
+ f,
796
+ N
797
+ ]), h = R((A) => l(A), [
798
+ l
799
+ ]), g = R(() => h(""), [
800
+ h
801
+ ]), { onInputKeyDown: _, ...w } = At({
802
+ options: S,
803
+ value: s,
804
+ commit: h,
805
+ clear: g,
806
+ onBlur: u
807
+ }), T = me("country"), O = b(e, Y.Label), D = b(e, Y.Control), j = b(e, Y.Options), fe = b(e, Y.Description), W = b(e, Y.Error);
808
+ return /* @__PURE__ */ n.createElement(I, {
809
+ fieldId: r,
810
+ renderLabel: () => v(O, {
811
+ label: T
812
+ }),
813
+ renderInput: () => /* @__PURE__ */ n.createElement(Fe, {
814
+ "aria-labelledby": E,
815
+ ...w,
816
+ isDisabled: i,
817
+ isReadOnly: a,
818
+ isRequired: d,
819
+ isInvalid: m,
820
+ onFocus: y,
821
+ menuTrigger: "input"
822
+ }, v(D, {
823
+ onKeyDown: _
824
+ }), v(j, {
825
+ options: S,
826
+ isForcedOpen: o
827
+ }), /* @__PURE__ */ n.createElement(kn, {
828
+ isOpen: o
829
+ })),
830
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, W, fe)
831
+ });
832
+ }, ge = ({ children: e, className: t, ...o }) => {
833
+ const { disabled: r, hasError: s } = P(), { onKeyDown: l } = o, i = b(e, ge.Input), a = b(e, ge.Trigger);
834
+ return /* @__PURE__ */ n.createElement(Ot, {
835
+ className: t,
836
+ isDisabled: r,
837
+ isInvalid: s
838
+ }, v(i, {
839
+ onKeyDown: l
840
+ }), a);
841
+ }, Wn = ({ className: e, ...t }) => {
842
+ const { id: o, placeholder: r, readOnly: s, disabled: l } = P(), { inputId: i, ariaDescribedBy: a } = M(), { onKeyDown: d } = t, m = x(null), u = _t({
843
+ readOnly: s,
844
+ disabled: l
845
+ });
846
+ return ae(() => {
847
+ var y;
848
+ (y = m.current) == null || y.focus({
849
+ preventScroll: !0
850
+ });
851
+ }, o), /* @__PURE__ */ n.createElement(le, {
852
+ ref: m,
853
+ id: i,
854
+ autoComplete: "country-name",
855
+ "aria-describedby": a,
856
+ className: e,
857
+ placeholder: r,
858
+ onClick: u,
859
+ onKeyDown: d
860
+ });
861
+ }, $n = ({ children: e, className: t }) => /* @__PURE__ */ n.createElement(gt, {
862
+ className: t
863
+ }, e);
864
+ ge.Input = Wn;
865
+ ge.Trigger = $n;
866
+ const je = ({ children: e, className: t, ...o }) => {
867
+ const { options: r, isForcedOpen: s } = o, l = b(e, je.Option);
868
+ return /* @__PURE__ */ n.createElement(Se, {
869
+ className: t,
870
+ containerPadding: 0,
871
+ offset: 0
872
+ }, /* @__PURE__ */ n.createElement(on, {
873
+ isForcedOpen: s
874
+ }, r.map((i) => v(l, {
875
+ key: i.value,
876
+ value: i.value,
877
+ label: i.label
878
+ }))));
879
+ }, Vn = ({ className: e, ...t }) => {
880
+ const { value: o, label: r } = t;
881
+ return /* @__PURE__ */ n.createElement(he, {
882
+ className: e,
883
+ id: o,
884
+ textValue: r
885
+ }, r);
886
+ };
887
+ je.Option = Vn;
888
+ Y.Label = de;
889
+ Y.Control = ge;
890
+ Y.Options = je;
891
+ Y.Description = ie;
892
+ Y.Error = ce;
893
+ const Kn = /(\d{7})|(\d{3}-\d{4})/;
894
+ function Yn(e) {
895
+ var t;
896
+ return (t = e.match(Kn)) == null ? void 0 : t[0];
897
+ }
898
+ function Hn({ isAutocompleteEnabled: e }) {
899
+ const t = x({
900
+ hasAddress: !1
901
+ }), o = Ke({
902
+ enabled: e
903
+ });
904
+ return {
905
+ searchByPostalCode: R(async (s) => {
906
+ const l = Yn(s);
907
+ if (l) {
908
+ if (t.current.postalCode === l && t.current.hasAddress)
909
+ return t.current.address;
910
+ t.current = {
911
+ postalCode: l,
912
+ address: void 0,
913
+ hasAddress: !1
914
+ };
915
+ try {
916
+ const i = await (o == null ? void 0 : o.searchByPostalCode({
917
+ countryCode: "JP",
918
+ postalCode: l
919
+ }));
920
+ return t.current.hasAddress = !0, t.current.address = void 0, i != null && i.formattedAddress ? (t.current.address = i, i) : void 0;
921
+ } catch (i) {
922
+ console.error(i);
923
+ }
924
+ }
925
+ }, [
926
+ o
927
+ ])
928
+ };
929
+ }
930
+ const k = ({ children: e }) => {
931
+ const { id: t, value: o, onChange: r, disabled: s, readOnly: l, required: i, hasError: a, onBlur: d, onFocus: m, FieldLayout: u, autocomplete: y } = P(), { labelId: I } = M(), p = Le(), { autocompleteEnabled: E } = Ie(), f = !!(p && Oe[p] === Oe.JP), N = (y || E) && f, S = me("zipCode"), h = b(e, k.Label), g = b(e, k.Control), _ = b(e, k.Options), w = b(e, k.Description), T = b(e, k.Error);
932
+ return N ? /* @__PURE__ */ n.createElement(u, {
933
+ fieldId: t,
934
+ renderLabel: () => v(h, {
935
+ label: S
936
+ }),
937
+ renderInput: () => /* @__PURE__ */ n.createElement(jn, {
938
+ value: o,
939
+ onChange: r,
940
+ disabled: s,
941
+ readOnly: l,
942
+ required: i,
943
+ hasError: a,
944
+ onBlur: d,
945
+ onFocus: m
946
+ }, g, _),
947
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, T, w)
948
+ }) : /* @__PURE__ */ n.createElement(u, {
949
+ fieldId: t,
950
+ renderLabel: () => v(h, {
951
+ label: S
952
+ }),
953
+ renderInput: () => /* @__PURE__ */ n.createElement(be, {
954
+ "aria-labelledby": I,
955
+ value: o ?? "",
956
+ onChange: r,
957
+ isDisabled: s,
958
+ isReadOnly: l,
959
+ isRequired: i,
960
+ isInvalid: a,
961
+ onBlur: d,
962
+ onFocus: m
963
+ }, g),
964
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, T, w)
965
+ });
966
+ }, jn = ({ children: e, value: t, onChange: o, disabled: r, readOnly: s, required: l, hasError: i, onBlur: a, onFocus: d }) => {
967
+ const { labelId: m } = M(), { onAddressSelect: u } = Ie(), [y, I] = Ee(!1), { searchByPostalCode: p } = Hn({
968
+ isAutocompleteEnabled: y
969
+ }), [E, f] = Ee(), N = q(() => E ? [
970
+ {
971
+ id: V(),
972
+ label: E.formattedAddress || ""
973
+ }
974
+ ] : [], [
975
+ E
976
+ ]), S = R(async (O) => {
977
+ o(O);
978
+ const D = await p(O ?? "");
979
+ f(D);
980
+ }, [
981
+ o,
982
+ p
983
+ ]), h = R(async (O) => {
984
+ O && (f(void 0), E && u && u(E));
985
+ }, [
986
+ u,
987
+ E
988
+ ]), g = R(() => {
989
+ f(void 0), a == null || a();
990
+ }, [
991
+ a
992
+ ]), _ = R(() => {
993
+ I(!0), d == null || d();
994
+ }, [
995
+ d
996
+ ]), w = b(e, k.Control), T = b(e, k.Options);
997
+ return /* @__PURE__ */ n.createElement(Fe, {
998
+ "aria-labelledby": m,
999
+ inputValue: t ?? "",
1000
+ onInputChange: S,
1001
+ value: null,
1002
+ onChange: h,
1003
+ isDisabled: r,
1004
+ isReadOnly: s,
1005
+ isRequired: l,
1006
+ isInvalid: i,
1007
+ onBlur: g,
1008
+ onFocus: _,
1009
+ allowsCustomValue: !0,
1010
+ menuTrigger: "input",
1011
+ items: N
1012
+ }, v(w, {
1013
+ onFocus: _
1014
+ }), v(T, {
1015
+ options: N
1016
+ }), /* @__PURE__ */ n.createElement(Ye, {
1017
+ optionCount: N.length
1018
+ }));
1019
+ }, Je = ({ children: e, className: t, ...o }) => {
1020
+ const { disabled: r, hasError: s } = P(), { onFocus: l } = o, i = Le(), a = b(e, Je.Input);
1021
+ return /* @__PURE__ */ n.createElement("div", {
1022
+ className: t,
1023
+ "data-country": i || void 0,
1024
+ "data-disabled": r || void 0,
1025
+ "data-invalid": s || void 0
1026
+ }, v(a, {
1027
+ onFocus: l
1028
+ }));
1029
+ }, Jn = ({ className: e, ...t }) => {
1030
+ const { id: o, placeholder: r } = P(), { inputId: s, ariaDescribedBy: l } = M(), { onFocus: i } = t, a = x(null);
1031
+ return ae(() => {
1032
+ var d;
1033
+ (d = a.current) == null || d.focus({
1034
+ preventScroll: !0
1035
+ });
1036
+ }, o), /* @__PURE__ */ n.createElement(le, {
1037
+ ref: a,
1038
+ id: s,
1039
+ autoComplete: "postal-code",
1040
+ "aria-describedby": l,
1041
+ className: e,
1042
+ placeholder: r,
1043
+ onFocus: i
1044
+ });
1045
+ }, Xe = ({ children: e, className: t }) => {
1046
+ const o = b(e, Xe.Option);
1047
+ return /* @__PURE__ */ n.createElement(Se, {
1048
+ className: t,
1049
+ containerPadding: 0,
1050
+ offset: 0
1051
+ }, /* @__PURE__ */ n.createElement(Te, {
1052
+ renderEmptyState: () => null
1053
+ }, (r) => v(o, {
1054
+ id: r.id,
1055
+ label: r.label
1056
+ })));
1057
+ }, Xn = ({ className: e, ...t }) => {
1058
+ const { id: o, label: r } = t;
1059
+ return /* @__PURE__ */ n.createElement(he, {
1060
+ className: e,
1061
+ id: o,
1062
+ textValue: r
1063
+ }, r);
1064
+ };
1065
+ Xe.Option = Xn;
1066
+ Je.Input = Jn;
1067
+ k.Label = de;
1068
+ k.Control = Je;
1069
+ k.Options = Xe;
1070
+ k.Description = ie;
1071
+ k.Error = ce;
1072
+ const U = ({ children: e }) => {
1073
+ const { id: t, value: o, onChange: r, disabled: s, readOnly: l, required: i, hasError: a, onBlur: d, onFocus: m, FieldLayout: u, autocomplete: y } = P(), { labelId: I } = M(), { autocompleteEnabled: p } = Ie(), E = y || p, f = me("streetName"), N = b(e, U.Label), S = b(e, U.Input), h = b(e, U.Options), g = b(e, U.Description), _ = b(e, U.Error);
1074
+ return E ? /* @__PURE__ */ n.createElement(u, {
1075
+ fieldId: t,
1076
+ renderLabel: () => v(N, {
1077
+ label: f
1078
+ }),
1079
+ renderInput: () => /* @__PURE__ */ n.createElement(Gn, {
1080
+ value: o,
1081
+ onChange: r,
1082
+ disabled: s,
1083
+ readOnly: l,
1084
+ required: i,
1085
+ hasError: a,
1086
+ onBlur: d,
1087
+ onFocus: m
1088
+ }, S, h),
1089
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, _, g)
1090
+ }) : /* @__PURE__ */ n.createElement(u, {
1091
+ fieldId: t,
1092
+ renderLabel: () => v(N, {
1093
+ label: f
1094
+ }),
1095
+ renderInput: () => /* @__PURE__ */ n.createElement(be, {
1096
+ "aria-labelledby": I,
1097
+ value: o ?? "",
1098
+ onChange: r,
1099
+ isDisabled: s,
1100
+ isReadOnly: l,
1101
+ isRequired: i,
1102
+ isInvalid: a,
1103
+ onBlur: d,
1104
+ onFocus: m
1105
+ }, S),
1106
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, _, g)
1107
+ });
1108
+ }, Gn = ({ children: e, value: t, onChange: o, disabled: r, readOnly: s, required: l, hasError: i, onBlur: a, onFocus: d }) => {
1109
+ const { labelId: m } = M(), { onAddressSelect: u } = Ie(), y = Le(), I = Ke({
1110
+ enabled: !0
1111
+ }), { predictions: p, updatePredictions: E, clearPredictions: f } = Rt({
1112
+ atlas: I
1113
+ }), N = b(e, U.Input), S = b(e, U.Options), h = q(() => p.reduce((O, D) => (D.searchId && D.description && O.push({
1114
+ id: D.searchId,
1115
+ label: D.description
1116
+ }), O), []), [
1117
+ p
1118
+ ]), g = R((O) => {
1119
+ E({
1120
+ input: O,
1121
+ countryCodes: y ? [
1122
+ y
1123
+ ] : void 0
1124
+ }), o(O);
1125
+ }, [
1126
+ o,
1127
+ E,
1128
+ y
1129
+ ]), _ = R(async (O) => {
1130
+ if (f(), !O)
1131
+ return;
1132
+ const D = await (I == null ? void 0 : I.getPlace({
1133
+ searchId: String(O)
1134
+ }));
1135
+ D && u && u(D);
1136
+ }, [
1137
+ u,
1138
+ f,
1139
+ I
1140
+ ]), w = R(() => {
1141
+ f(), a == null || a();
1142
+ }, [
1143
+ a,
1144
+ f
1145
+ ]), T = R(() => {
1146
+ d == null || d();
1147
+ }, [
1148
+ d
1149
+ ]);
1150
+ return /* @__PURE__ */ n.createElement(Fe, {
1151
+ "aria-labelledby": m,
1152
+ inputValue: t ?? "",
1153
+ onInputChange: g,
1154
+ value: null,
1155
+ onChange: _,
1156
+ isDisabled: r,
1157
+ isReadOnly: s,
1158
+ isRequired: l,
1159
+ isInvalid: i,
1160
+ onBlur: w,
1161
+ onFocus: T,
1162
+ allowsCustomValue: !0,
1163
+ menuTrigger: "input",
1164
+ items: h
1165
+ }, v(N, {
1166
+ onFocus: T
1167
+ }), v(S, {
1168
+ options: h
1169
+ }), /* @__PURE__ */ n.createElement(Ye, {
1170
+ optionCount: h.length
1171
+ }));
1172
+ }, zn = ({ className: e, ...t }) => {
1173
+ const { id: o, placeholder: r } = P(), { inputId: s, ariaDescribedBy: l } = M(), { onFocus: i } = t, a = x(null);
1174
+ return ae(() => {
1175
+ var d;
1176
+ (d = a.current) == null || d.focus({
1177
+ preventScroll: !0
1178
+ });
1179
+ }, o), /* @__PURE__ */ n.createElement(le, {
1180
+ ref: a,
1181
+ id: s,
1182
+ autoComplete: "address-line1",
1183
+ "aria-describedby": l,
1184
+ className: e,
1185
+ placeholder: r,
1186
+ onFocus: i
1187
+ });
1188
+ }, Ge = ({ children: e, className: t }) => {
1189
+ const o = b(e, Ge.Option);
1190
+ return /* @__PURE__ */ n.createElement(Se, {
1191
+ className: t,
1192
+ containerPadding: 0,
1193
+ offset: 0
1194
+ }, /* @__PURE__ */ n.createElement(Te, {
1195
+ renderEmptyState: () => null
1196
+ }, (r) => v(o, {
1197
+ id: r.id,
1198
+ label: r.label
1199
+ })));
1200
+ }, Qn = ({ className: e, ...t }) => {
1201
+ const { id: o, label: r } = t;
1202
+ return /* @__PURE__ */ n.createElement(he, {
1203
+ className: e,
1204
+ id: o,
1205
+ textValue: r
1206
+ }, r);
1207
+ };
1208
+ Ge.Option = Qn;
1209
+ U.Label = de;
1210
+ U.Input = zn;
1211
+ U.Options = Ge;
1212
+ U.Description = ie;
1213
+ U.Error = ce;
1214
+ const se = ({ children: e }) => {
1215
+ const { id: t, value: o, onChange: r, disabled: s, readOnly: l, required: i, hasError: a, onBlur: d, onFocus: m, FieldLayout: u } = P(), { labelId: y } = M(), I = me("streetNumber"), p = b(e, se.Label), E = b(e, se.Input), f = b(e, se.Description), N = b(e, se.Error);
1216
+ return /* @__PURE__ */ n.createElement(u, {
1217
+ fieldId: t,
1218
+ renderLabel: () => v(p, {
1219
+ label: I
1220
+ }),
1221
+ renderInput: () => /* @__PURE__ */ n.createElement(be, {
1222
+ "aria-labelledby": y,
1223
+ value: o ?? "",
1224
+ onChange: r,
1225
+ isDisabled: s,
1226
+ isReadOnly: l,
1227
+ isRequired: i,
1228
+ isInvalid: a,
1229
+ onBlur: d,
1230
+ onFocus: m
1231
+ }, E),
1232
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, N, f)
1233
+ });
1234
+ }, Zn = ({ className: e }) => {
1235
+ const { id: t, placeholder: o } = P(), { inputId: r, ariaDescribedBy: s } = M(), l = x(null);
1236
+ return ae(() => {
1237
+ var i;
1238
+ (i = l.current) == null || i.focus({
1239
+ preventScroll: !0
1240
+ });
1241
+ }, t), /* @__PURE__ */ n.createElement(le, {
1242
+ ref: l,
1243
+ id: r,
1244
+ "aria-describedby": s,
1245
+ className: e,
1246
+ placeholder: o
1247
+ });
1248
+ };
1249
+ se.Label = de;
1250
+ se.Input = Zn;
1251
+ se.Description = ie;
1252
+ se.Error = ce;
1253
+ const H = ({ children: e }) => {
1254
+ const { id: t, value: o, onChange: r, disabled: s, readOnly: l, required: i, hasError: a, onBlur: d, onFocus: m, FieldLayout: u } = P(), { labelId: y } = M(), { t: I } = Pe(), p = Le(), E = p ? Oe[p] : void 0, f = p && kt.getCountryByShortKey(p), N = q(() => {
1255
+ var W;
1256
+ return (Ut(((W = f == null ? void 0 : f.subdivisions) == null ? void 0 : W.list) || [], E) || []).map((A) => ({
1257
+ value: A.key,
1258
+ label: I(A.displayName)
1259
+ })).sort((A, F) => A.label.localeCompare(F.label));
1260
+ }, [
1261
+ E,
1262
+ I,
1263
+ f
1264
+ ]), S = R(() => r(""), [
1265
+ r
1266
+ ]), { onInputKeyDown: h, ...g } = At({
1267
+ options: N,
1268
+ value: o,
1269
+ commit: r,
1270
+ clear: S,
1271
+ onBlur: d
1272
+ }), _ = me("subdivision"), w = b(e, H.Label), T = b(e, H.Control), O = b(e, H.Options), D = b(e, H.Description), j = b(e, H.Error);
1273
+ return /* @__PURE__ */ n.createElement(u, {
1274
+ fieldId: t,
1275
+ renderLabel: () => v(w, {
1276
+ label: _
1277
+ }),
1278
+ renderInput: () => /* @__PURE__ */ n.createElement(Fe, {
1279
+ "aria-labelledby": y,
1280
+ ...g,
1281
+ isDisabled: s,
1282
+ isReadOnly: l,
1283
+ isRequired: i,
1284
+ isInvalid: a,
1285
+ onFocus: m,
1286
+ menuTrigger: "input"
1287
+ }, v(T, {
1288
+ onKeyDown: h
1289
+ }), v(O, {
1290
+ options: N
1291
+ })),
1292
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, j, D)
1293
+ });
1294
+ }, ve = ({ children: e, className: t, ...o }) => {
1295
+ const { disabled: r, hasError: s } = P(), { onKeyDown: l } = o, i = b(e, ve.Input), a = b(e, ve.Trigger);
1296
+ return /* @__PURE__ */ n.createElement(Ot, {
1297
+ className: t,
1298
+ isDisabled: r,
1299
+ isInvalid: s
1300
+ }, v(i, {
1301
+ onKeyDown: l
1302
+ }), a);
1303
+ }, er = ({ className: e, ...t }) => {
1304
+ const { id: o, placeholder: r, readOnly: s, disabled: l } = P(), { inputId: i, ariaDescribedBy: a } = M(), { onKeyDown: d } = t, m = x(null), u = _t({
1305
+ readOnly: s,
1306
+ disabled: l
1307
+ });
1308
+ return ae(() => {
1309
+ var y;
1310
+ (y = m.current) == null || y.focus({
1311
+ preventScroll: !0
1312
+ });
1313
+ }, o), /* @__PURE__ */ n.createElement(le, {
1314
+ ref: m,
1315
+ id: i,
1316
+ autoComplete: "address-level1",
1317
+ "aria-describedby": a,
1318
+ className: e,
1319
+ placeholder: r,
1320
+ onClick: u,
1321
+ onKeyDown: d
1322
+ });
1323
+ }, tr = ({ children: e, className: t }) => /* @__PURE__ */ n.createElement(gt, {
1324
+ className: t
1325
+ }, e);
1326
+ ve.Input = er;
1327
+ ve.Trigger = tr;
1328
+ const ze = ({ children: e, className: t, ...o }) => {
1329
+ const { options: r } = o, s = b(e, ze.Option);
1330
+ return /* @__PURE__ */ n.createElement(Se, {
1331
+ className: t,
1332
+ containerPadding: 0,
1333
+ offset: 0
1334
+ }, /* @__PURE__ */ n.createElement(Te, null, r.map((l) => v(s, {
1335
+ key: l.value,
1336
+ value: l.value,
1337
+ label: l.label
1338
+ }))));
1339
+ }, nr = ({ className: e, ...t }) => {
1340
+ const { value: o, label: r } = t;
1341
+ return /* @__PURE__ */ n.createElement(he, {
1342
+ className: e,
1343
+ id: o,
1344
+ textValue: r
1345
+ }, r);
1346
+ };
1347
+ ze.Option = nr;
1348
+ H.Label = de;
1349
+ H.Control = ve;
1350
+ H.Options = ze;
1351
+ H.Description = ie;
1352
+ H.Error = ce;
1353
+ const rr = () => ue("country"), or = () => ue("subdivision"), sr = () => ue("city"), ar = () => ue("addressLine"), lr = () => ue("addressLine2"), ir = () => ue("postalCode"), cr = () => ue("streetName"), dr = () => ue("streetNumber"), ur = () => ue("apartment"), mr = {
1354
+ [K.MLA_COUNTRY]: rr,
1355
+ [K.MLA_SUBDIVISION]: or,
1356
+ [K.MLA_CITY]: sr,
1357
+ [K.MLA_ADDRESS_LINE]: ar,
1358
+ [K.MLA_ADDRESS_LINE_2]: lr,
1359
+ [K.MLA_POSTAL_CODE]: ir,
1360
+ [K.MLA_STREET_NAME]: cr,
1361
+ [K.MLA_STREET_NUMBER]: dr,
1362
+ [K.MLA_APARTMENT]: ur
1363
+ }, pr = {}, Er = [], c = ({ children: e, className: t }) => {
1364
+ const { id: o, form: r, value: s, onChange: l, onFieldBlur: i, onFieldFocus: a, errors: d, FieldLayout: m, fieldSettings: u, label: y, validation: I, target: p, autocompleteEnabled: E, required: f, fieldType: N } = P(), [S, h] = Ee(null), g = Wt(), _ = q(() => ({
1365
+ ...g,
1366
+ ...mr
1367
+ }), [
1368
+ g
1369
+ ]), { isExperimentEnabled: w } = Ct(), T = w(It.STREETLESS_LOCALITY_FALLBACK), { validateFields: O } = $t(), D = Vt(), j = Nt(), fe = q(() => ({
1370
+ ...j,
1371
+ actions: {
1372
+ predict: Ht,
1373
+ getPlace: Yt,
1374
+ searchByPostalCode: Kt,
1375
+ ...j.actions
1376
+ }
1377
+ }), [
1378
+ j
1379
+ ]), { form: W, isMultilineAddressField: A } = Nn({
1380
+ id: o,
1381
+ target: p,
1382
+ fieldType: N,
1383
+ form: r,
1384
+ country: s == null ? void 0 : s.country,
1385
+ fieldSettings: u,
1386
+ validation: I,
1387
+ required: f
1388
+ }), F = R(($) => {
1389
+ if (!s)
1390
+ return;
1391
+ const X = cn($, A, T), Re = {
1392
+ ...X,
1393
+ [ye.COUNTRY]: X[ye.COUNTRY] ?? s[ye.COUNTRY]
1394
+ };
1395
+ l == null || l(Re);
1396
+ }, [
1397
+ l,
1398
+ s,
1399
+ A,
1400
+ T
1401
+ ]), J = R(($, X) => {
1402
+ if (A && $ === ye.COUNTRY && (s == null ? void 0 : s[$]) !== X) {
1403
+ l == null || l({
1404
+ [ye.COUNTRY]: X
1405
+ });
1406
+ return;
1407
+ }
1408
+ l == null || l({
1409
+ ...s,
1410
+ [$]: X
1411
+ });
1412
+ }, [
1413
+ l,
1414
+ s,
1415
+ A
1416
+ ]), pe = R(async ($) => O(A ? [
1417
+ ...$,
1418
+ {
1419
+ path: `${p}/${ye.COUNTRY}`,
1420
+ value: s == null ? void 0 : s.country
1421
+ }
1422
+ ] : $), [
1423
+ s,
1424
+ p,
1425
+ O,
1426
+ A
1427
+ ]);
1428
+ jt(o, () => {
1429
+ var Re;
1430
+ const $ = d == null ? void 0 : d[0], X = (Re = W == null ? void 0 : W.fields) == null ? void 0 : Re.find((lt) => "target" in lt && lt.target === ($ == null ? void 0 : $.errorPath));
1431
+ return X == null ? void 0 : X.id;
1432
+ });
1433
+ const De = en(o), Qe = v(b(e, c.Country), {
1434
+ isForcedOpen: De
1435
+ }), Ze = b(e, c.Subdivision), et = b(e, c.City), tt = b(e, c.AddressLine), nt = b(e, c.AddressLine2), rt = b(e, c.PostalCode), ot = b(e, c.StreetName), st = b(e, c.StreetNumber), at = b(e, c.Apartment), Pt = q(() => ({
1436
+ country: Qe,
1437
+ subdivision: Ze,
1438
+ city: et,
1439
+ addressLine: tt,
1440
+ addressLine2: nt,
1441
+ postalCode: rt,
1442
+ streetName: ot,
1443
+ streetNumber: st,
1444
+ apartment: at
1445
+ }), [
1446
+ Qe,
1447
+ Ze,
1448
+ et,
1449
+ tt,
1450
+ nt,
1451
+ rt,
1452
+ ot,
1453
+ st,
1454
+ at
1455
+ ]);
1456
+ return W ? /* @__PURE__ */ n.createElement(m, {
1457
+ fieldId: o
1458
+ }, /* @__PURE__ */ n.createElement(un, {
1459
+ countryCode: s == null ? void 0 : s.country
1460
+ }, /* @__PURE__ */ n.createElement(dn, {
1461
+ autocompleteEnabled: E,
1462
+ onAddressSelect: F
1463
+ }, /* @__PURE__ */ n.createElement(On, {
1464
+ fields: Pt
1465
+ }, /* @__PURE__ */ n.createElement("div", {
1466
+ ref: h,
1467
+ style: {
1468
+ display: "contents"
1469
+ }
1470
+ }), /* @__PURE__ */ n.createElement(Tt, {
1471
+ getContainer: () => S
1472
+ }, /* @__PURE__ */ n.createElement("fieldset", {
1473
+ className: t,
1474
+ style: Qt
1475
+ }, /* @__PURE__ */ n.createElement("legend", {
1476
+ style: Zt
1477
+ }, y), /* @__PURE__ */ n.createElement(Jt, {
1478
+ formSchema: D,
1479
+ form: W,
1480
+ values: s ?? pr,
1481
+ onFieldChange: J,
1482
+ onBlur: i,
1483
+ onFocus: a,
1484
+ errors: d ?? Er,
1485
+ validateFields: pe,
1486
+ fields: _,
1487
+ fieldActions: fe
1488
+ }))))))) : null;
1489
+ };
1490
+ c.Country = Y;
1491
+ c.Subdivision = H;
1492
+ c.City = oe;
1493
+ c.AddressLine = B;
1494
+ c.AddressLine2 = ne;
1495
+ c.PostalCode = k;
1496
+ c.StreetName = U;
1497
+ c.StreetNumber = se;
1498
+ c.Apartment = re;
1499
+ const br = "_postalCodeControl_1tire_1", fr = "_comboControl_1tire_5", yr = "_comboTrigger_1tire_19", _e = {
1500
+ postalCodeControl: br,
1501
+ comboControl: fr,
1502
+ comboTrigger: yr
1503
+ }, xr = () => {
1504
+ const e = dt(Gt, [
1505
+ _e.comboControl
1506
+ ]), t = dt(zt, []), o = sn(Me);
1507
+ return /* @__PURE__ */ n.createElement(c, {
1508
+ className: Xt
1509
+ }, /* @__PURE__ */ n.createElement(c.Country, null, /* @__PURE__ */ n.createElement(c.Country.Label, {
1510
+ className: L(z, C.label)
1511
+ }, /* @__PURE__ */ n.createElement(c.Country.Label.Required, {
1512
+ className: L(Q, C.requiredMark)
1513
+ })), /* @__PURE__ */ n.createElement(c.Country.Control, {
1514
+ className: e
1515
+ }, /* @__PURE__ */ n.createElement(c.Country.Control.Input, {
1516
+ className: L(C.innerInput, Me)
1517
+ }), /* @__PURE__ */ n.createElement(c.Country.Control.Trigger, {
1518
+ className: _e.comboTrigger
1519
+ }, /* @__PURE__ */ n.createElement(ct, {
1520
+ className: C.dropdownIcon
1521
+ }))), /* @__PURE__ */ n.createElement(c.Country.Options, {
1522
+ className: L(Ne, C.selectPopover, C.dropdownPopover)
1523
+ }, /* @__PURE__ */ n.createElement(c.Country.Options.Option, {
1524
+ className: o
1525
+ })), /* @__PURE__ */ n.createElement(c.Country.Error, {
1526
+ className: L(Z, C.error)
1527
+ }, /* @__PURE__ */ n.createElement(te, null), /* @__PURE__ */ n.createElement(c.Country.Error.Text, null)), /* @__PURE__ */ n.createElement(c.Country.Description, {
1528
+ className: L(ee, C.description)
1529
+ }, ({ content: r, locale: s }) => /* @__PURE__ */ n.createElement(G, {
1530
+ content: r,
1531
+ locale: s
1532
+ }))), /* @__PURE__ */ n.createElement(c.AddressLine, null, /* @__PURE__ */ n.createElement(c.AddressLine.Label, {
1533
+ className: L(z, C.label)
1534
+ }, /* @__PURE__ */ n.createElement(c.AddressLine.Label.Required, {
1535
+ className: L(Q, C.requiredMark)
1536
+ })), /* @__PURE__ */ n.createElement(c.AddressLine.Input, {
1537
+ className: t
1538
+ }), /* @__PURE__ */ n.createElement(c.AddressLine.Options, {
1539
+ className: L(Ne, C.selectPopover, C.dropdownPopover)
1540
+ }, /* @__PURE__ */ n.createElement(c.AddressLine.Options.Option, {
1541
+ className: o
1542
+ })), /* @__PURE__ */ n.createElement(c.AddressLine.Error, {
1543
+ className: L(Z, C.error)
1544
+ }, /* @__PURE__ */ n.createElement(te, null), /* @__PURE__ */ n.createElement(c.AddressLine.Error.Text, null)), /* @__PURE__ */ n.createElement(c.AddressLine.Description, {
1545
+ className: L(ee, C.description)
1546
+ }, ({ content: r, locale: s }) => /* @__PURE__ */ n.createElement(G, {
1547
+ content: r,
1548
+ locale: s
1549
+ }))), /* @__PURE__ */ n.createElement(c.AddressLine2, null, /* @__PURE__ */ n.createElement(c.AddressLine2.Label, {
1550
+ className: L(z, C.label)
1551
+ }, /* @__PURE__ */ n.createElement(c.AddressLine2.Label.Required, {
1552
+ className: L(Q, C.requiredMark)
1553
+ })), /* @__PURE__ */ n.createElement(c.AddressLine2.Input, {
1554
+ className: t
1555
+ }), /* @__PURE__ */ n.createElement(c.AddressLine2.Error, {
1556
+ className: L(Z, C.error)
1557
+ }, /* @__PURE__ */ n.createElement(te, null), /* @__PURE__ */ n.createElement(c.AddressLine2.Error.Text, null)), /* @__PURE__ */ n.createElement(c.AddressLine2.Description, {
1558
+ className: L(ee, C.description)
1559
+ }, ({ content: r, locale: s }) => /* @__PURE__ */ n.createElement(G, {
1560
+ content: r,
1561
+ locale: s
1562
+ }))), /* @__PURE__ */ n.createElement(c.City, null, /* @__PURE__ */ n.createElement(c.City.Label, {
1563
+ className: L(z, C.label)
1564
+ }, /* @__PURE__ */ n.createElement(c.City.Label.Required, {
1565
+ className: L(Q, C.requiredMark)
1566
+ })), /* @__PURE__ */ n.createElement(c.City.Input, {
1567
+ className: t
1568
+ }), /* @__PURE__ */ n.createElement(c.City.Error, {
1569
+ className: L(Z, C.error)
1570
+ }, /* @__PURE__ */ n.createElement(te, null), /* @__PURE__ */ n.createElement(c.City.Error.Text, null)), /* @__PURE__ */ n.createElement(c.City.Description, {
1571
+ className: L(ee, C.description)
1572
+ }, ({ content: r, locale: s }) => /* @__PURE__ */ n.createElement(G, {
1573
+ content: r,
1574
+ locale: s
1575
+ }))), /* @__PURE__ */ n.createElement(c.PostalCode, null, /* @__PURE__ */ n.createElement(c.PostalCode.Label, {
1576
+ className: L(z, C.label)
1577
+ }, /* @__PURE__ */ n.createElement(c.PostalCode.Label.Required, {
1578
+ className: L(Q, C.requiredMark)
1579
+ })), /* @__PURE__ */ n.createElement(c.PostalCode.Control, {
1580
+ className: _e.postalCodeControl
1581
+ }, /* @__PURE__ */ n.createElement(c.PostalCode.Control.Input, {
1582
+ className: t
1583
+ })), /* @__PURE__ */ n.createElement(c.PostalCode.Options, {
1584
+ className: L(Ne, C.selectPopover, C.dropdownPopover)
1585
+ }, /* @__PURE__ */ n.createElement(c.PostalCode.Options.Option, {
1586
+ className: o
1587
+ })), /* @__PURE__ */ n.createElement(c.PostalCode.Error, {
1588
+ className: L(Z, C.error)
1589
+ }, /* @__PURE__ */ n.createElement(te, null), /* @__PURE__ */ n.createElement(c.PostalCode.Error.Text, null)), /* @__PURE__ */ n.createElement(c.PostalCode.Description, {
1590
+ className: L(ee, C.description)
1591
+ }, ({ content: r, locale: s }) => /* @__PURE__ */ n.createElement(G, {
1592
+ content: r,
1593
+ locale: s
1594
+ }))), /* @__PURE__ */ n.createElement(c.Subdivision, null, /* @__PURE__ */ n.createElement(c.Subdivision.Label, {
1595
+ className: L(z, C.label)
1596
+ }, /* @__PURE__ */ n.createElement(c.Subdivision.Label.Required, {
1597
+ className: L(Q, C.requiredMark)
1598
+ })), /* @__PURE__ */ n.createElement(c.Subdivision.Control, {
1599
+ className: e
1600
+ }, /* @__PURE__ */ n.createElement(c.Subdivision.Control.Input, {
1601
+ className: L(C.innerInput, Me)
1602
+ }), /* @__PURE__ */ n.createElement(c.Subdivision.Control.Trigger, {
1603
+ className: _e.comboTrigger
1604
+ }, /* @__PURE__ */ n.createElement(ct, {
1605
+ className: C.dropdownIcon
1606
+ }))), /* @__PURE__ */ n.createElement(c.Subdivision.Options, {
1607
+ className: L(Ne, C.selectPopover, C.dropdownPopover)
1608
+ }, /* @__PURE__ */ n.createElement(c.Subdivision.Options.Option, {
1609
+ className: o
1610
+ })), /* @__PURE__ */ n.createElement(c.Subdivision.Error, {
1611
+ className: L(Z, C.error)
1612
+ }, /* @__PURE__ */ n.createElement(te, null), /* @__PURE__ */ n.createElement(c.Subdivision.Error.Text, null)), /* @__PURE__ */ n.createElement(c.Subdivision.Description, {
1613
+ className: L(ee, C.description)
1614
+ }, ({ content: r, locale: s }) => /* @__PURE__ */ n.createElement(G, {
1615
+ content: r,
1616
+ locale: s
1617
+ }))), /* @__PURE__ */ n.createElement(c.StreetName, null, /* @__PURE__ */ n.createElement(c.StreetName.Label, {
1618
+ className: L(z, C.label)
1619
+ }, /* @__PURE__ */ n.createElement(c.StreetName.Label.Required, {
1620
+ className: L(Q, C.requiredMark)
1621
+ })), /* @__PURE__ */ n.createElement(c.StreetName.Input, {
1622
+ className: t
1623
+ }), /* @__PURE__ */ n.createElement(c.StreetName.Options, {
1624
+ className: L(Ne, C.selectPopover, C.dropdownPopover)
1625
+ }, /* @__PURE__ */ n.createElement(c.StreetName.Options.Option, {
1626
+ className: o
1627
+ })), /* @__PURE__ */ n.createElement(c.StreetName.Error, {
1628
+ className: L(Z, C.error)
1629
+ }, /* @__PURE__ */ n.createElement(te, null), /* @__PURE__ */ n.createElement(c.StreetName.Error.Text, null)), /* @__PURE__ */ n.createElement(c.StreetName.Description, {
1630
+ className: L(ee, C.description)
1631
+ }, ({ content: r, locale: s }) => /* @__PURE__ */ n.createElement(G, {
1632
+ content: r,
1633
+ locale: s
1634
+ }))), /* @__PURE__ */ n.createElement(c.StreetNumber, null, /* @__PURE__ */ n.createElement(c.StreetNumber.Label, {
1635
+ className: L(z, C.label)
1636
+ }, /* @__PURE__ */ n.createElement(c.StreetNumber.Label.Required, {
1637
+ className: L(Q, C.requiredMark)
1638
+ })), /* @__PURE__ */ n.createElement(c.StreetNumber.Input, {
1639
+ className: t
1640
+ }), /* @__PURE__ */ n.createElement(c.StreetNumber.Error, {
1641
+ className: L(Z, C.error)
1642
+ }, /* @__PURE__ */ n.createElement(te, null), /* @__PURE__ */ n.createElement(c.StreetNumber.Error.Text, null)), /* @__PURE__ */ n.createElement(c.StreetNumber.Description, {
1643
+ className: L(ee, C.description)
1644
+ }, ({ content: r, locale: s }) => /* @__PURE__ */ n.createElement(G, {
1645
+ content: r,
1646
+ locale: s
1647
+ }))), /* @__PURE__ */ n.createElement(c.Apartment, null, /* @__PURE__ */ n.createElement(c.Apartment.Label, {
1648
+ className: L(z, C.label)
1649
+ }, /* @__PURE__ */ n.createElement(c.Apartment.Label.Required, {
1650
+ className: L(Q, C.requiredMark)
1651
+ })), /* @__PURE__ */ n.createElement(c.Apartment.Input, {
1652
+ className: t
1653
+ }), /* @__PURE__ */ n.createElement(c.Apartment.Error, {
1654
+ className: L(Z, C.error)
1655
+ }, /* @__PURE__ */ n.createElement(te, null), /* @__PURE__ */ n.createElement(c.Apartment.Error.Text, null)), /* @__PURE__ */ n.createElement(c.Apartment.Description, {
1656
+ className: L(ee, C.description)
1657
+ }, ({ content: r, locale: s }) => /* @__PURE__ */ n.createElement(G, {
1658
+ content: r,
1659
+ locale: s
1660
+ }))));
1661
+ };
1662
+ export {
1663
+ xr as M
1664
+ };