@wix/form-elements 0.0.0-stage → 1.53.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 (237) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +118 -2
  3. package/dist/component/appointment-rac-Qa4fzPC_.js +1005 -0
  4. package/dist/component/bookings-address-rac-D9M-ozbl.js +6 -0
  5. package/dist/component/bookings-email-rac-BsQBkcmz.js +6 -0
  6. package/dist/component/bookings-first-name-rac-B3Ttwrj1.js +6 -0
  7. package/dist/component/bookings-header-rac-D1SGpqGf.js +8 -0
  8. package/dist/component/bookings-last-name-rac-B9O--4tU.js +6 -0
  9. package/dist/component/bookings-login-bar-rac-CHzNCOWx.js +74 -0
  10. package/dist/component/bookings-phone-rac-DhCGxcEU.js +6 -0
  11. package/dist/component/bookings-rich-text-rac-CftLqeZI.js +8 -0
  12. package/dist/component/calling-country-codes-PyWuOTmF.js +243 -0
  13. package/dist/component/checkbox-field-rac-B4NsTbRK.js +625 -0
  14. package/dist/component/checkbox-group-field-headless-qntvm5XF.js +204 -0
  15. package/dist/component/checkbox-group-field-rac-DwHc_GX9.js +33 -0
  16. package/dist/component/checkbox-group-rac-C1L8G1Y6.js +6 -0
  17. package/dist/component/checkbox-rac-DfbwQtOy.js +6 -0
  18. package/dist/component/chevron-down-icon-CcpVm6B-.js +15 -0
  19. package/dist/component/contacts-address-rac-Bstl5CRy.js +6 -0
  20. package/dist/component/contacts-birthdate-rac-DA4ijdaj.js +6 -0
  21. package/dist/component/contacts-company-rac-m0NA2GWU.js +6 -0
  22. package/dist/component/contacts-email-rac-DPVSYPew.js +6 -0
  23. package/dist/component/contacts-first-name-rac-C-JRqRzG.js +6 -0
  24. package/dist/component/contacts-last-name-rac-COBf-dyW.js +6 -0
  25. package/dist/component/contacts-phone-rac-Cw70dW7b.js +6 -0
  26. package/dist/component/contacts-position-rac-CMz19BR-.js +6 -0
  27. package/dist/component/contacts-subscribe-rac-KpLlwquo.js +13 -0
  28. package/dist/component/contacts-tax-id-rac-_uTLfEkF.js +6 -0
  29. package/dist/component/custom-focus-class-_483Pkwp.js +4 -0
  30. package/dist/component/data-hooks-Dkw1pbRj.js +6 -0
  31. package/dist/component/date-availability-DPHhHaFW.js +49 -0
  32. package/dist/component/date-input-field-rac-BrdGNXKw.js +286 -0
  33. package/dist/component/date-input-rac-D93biRsl.js +6 -0
  34. package/dist/component/date-picker-field-rac-ByhJ3Koo.js +304 -0
  35. package/dist/component/date-picker-rac-CuwcuCmJ.js +6 -0
  36. package/dist/component/date-time-input-field-rac-DY1u3LS6.js +421 -0
  37. package/dist/component/date-time-input-rac-BuGAMm_l.js +6 -0
  38. package/dist/component/default-limits-D7qVv_Hv.js +6 -0
  39. package/dist/component/dext-checkbox-group-rac-C3jCmtB7.js +18 -0
  40. package/dist/component/dext-checkbox-rac-dOvFH4gX.js +6 -0
  41. package/dist/component/dext-date-picker-rac-Bq6xFRoL.js +6 -0
  42. package/dist/component/dext-date-time-input-rac-9BE7wXiZ.js +6 -0
  43. package/dist/component/dext-dropdown-rac-j2ACAxk6.js +6 -0
  44. package/dist/component/dext-email-rac-CLoZGIl3.js +6 -0
  45. package/dist/component/dext-number-input-rac-D8IxqGdJ.js +6 -0
  46. package/dist/component/dext-phone-rac-B2Y-Ou4W.js +6 -0
  47. package/dist/component/dext-radio-group-rac-C88xnXTc.js +18 -0
  48. package/dist/component/dext-rating-input-rac-BArLS_bA.js +6 -0
  49. package/dist/component/dext-tags-rac-B9tKb852.js +18 -0
  50. package/dist/component/dext-text-area-rac-cBh24v0g.js +6 -0
  51. package/dist/component/dext-text-input-rac-B75yIKQa.js +6 -0
  52. package/dist/component/dext-url-input-rac-Da6T681p.js +6 -0
  53. package/dist/component/donation-rac-A0HtRtbH.js +305 -0
  54. package/dist/component/dropdown-field-headless-CYpFgZ3H.js +84 -0
  55. package/dist/component/dropdown-field-rac-B5emHw3_.js +32 -0
  56. package/dist/component/dropdown-rac-CRj3gKMe.js +6 -0
  57. package/dist/component/ecom-address-rac-ClBWgRGU.js +6 -0
  58. package/dist/component/ecom-subscription-checkbox-rac-DLvoidqP.js +49 -0
  59. package/dist/component/email-input-field-rac-Dq1HVu3Y.js +507 -0
  60. package/dist/component/error-icon-hZxQ6DEy.js +15 -0
  61. package/dist/component/events-repeater-rac-BwbNXM88.js +247 -0
  62. package/dist/component/events-rsvp-rac-BzVK7JNO.js +38 -0
  63. package/dist/component/field-error-headless-D40GACk4.js +34 -0
  64. package/dist/component/field-label-headless-Beq2Tn6V.js +52 -0
  65. package/dist/component/field-rac.module-DXfwku6m.js +21 -0
  66. package/dist/component/fieldset-headless-CD3fds9J.js +54 -0
  67. package/dist/component/file-upload-rac-BHqXPy1r.js +484 -0
  68. package/dist/component/find-child-C60k4CxG.js +11 -0
  69. package/dist/component/fixed-payment-rac-CSmY8yrQ.js +62 -0
  70. package/dist/component/form-Dn-MrArr.js +8890 -0
  71. package/dist/component/form-element-classes-Bi-nNM8q.js +55 -0
  72. package/dist/component/form.css +1 -0
  73. package/dist/component/form.js +9 -0
  74. package/dist/component/format-currency-BwShJ9vM.js +44 -0
  75. package/dist/component/get-first-day-of-the-week-DvnsxYhQ.js +118 -0
  76. package/dist/component/header-field-rac-DlUZ8kEf.js +25 -0
  77. package/dist/component/header-rac-CKAFxlLV.js +6 -0
  78. package/dist/component/headless-styles-CmcyA_pi.js +20 -0
  79. package/dist/component/helpers-HmkkXrh2.js +12 -0
  80. package/dist/component/image-choice-rac-DHtMOk8B.js +141 -0
  81. package/dist/component/index-0TWILUAM.js +64 -0
  82. package/dist/component/index-DS4A9cSk.js +2290 -0
  83. package/dist/component/isObject-BAwJJxQ3.js +34 -0
  84. package/dist/component/messages_ar-BZXnU2Gj.js +3517 -0
  85. package/dist/component/messages_ar-L1BYLZbF.js +20 -0
  86. package/dist/component/messages_ar-PAHg01OB.js +299 -0
  87. package/dist/component/messages_bg-CO56qlOt.js +299 -0
  88. package/dist/component/messages_bg-CQcGl0Yi.js +20 -0
  89. package/dist/component/messages_bg-DgbMwIbv.js +3515 -0
  90. package/dist/component/messages_ca-BAHE5nuo.js +3515 -0
  91. package/dist/component/messages_ca-BRoHmzRw.js +20 -0
  92. package/dist/component/messages_ca-Bl6rZi_O.js +299 -0
  93. package/dist/component/messages_cs-BADd3t_h.js +3515 -0
  94. package/dist/component/messages_cs-CDyWDExk.js +298 -0
  95. package/dist/component/messages_cs-wn5UmrBw.js +20 -0
  96. package/dist/component/messages_da-BPnmb9Qb.js +20 -0
  97. package/dist/component/messages_da-BvVUWnBz.js +3515 -0
  98. package/dist/component/messages_da-DHlpaT4q.js +298 -0
  99. package/dist/component/messages_de-2czOmM8X.js +3515 -0
  100. package/dist/component/messages_de-BKgzIF1d.js +298 -0
  101. package/dist/component/messages_de-Bwx84N0O.js +20 -0
  102. package/dist/component/messages_el-BnuYMjcf.js +299 -0
  103. package/dist/component/messages_el-_D2RUBSU.js +20 -0
  104. package/dist/component/messages_el-qCyH12Uq.js +3515 -0
  105. package/dist/component/messages_en-BWaixPd6.js +3518 -0
  106. package/dist/component/messages_en-CBBcgtxs.js +296 -0
  107. package/dist/component/messages_en-DvSLxqKp.js +20 -0
  108. package/dist/component/messages_es-Cq6i2xci.js +3515 -0
  109. package/dist/component/messages_es-DlGCLaYi.js +298 -0
  110. package/dist/component/messages_es-rCKXnGf0.js +20 -0
  111. package/dist/component/messages_fi-B-ciZGqD.js +3515 -0
  112. package/dist/component/messages_fi-DzKva_Wq.js +299 -0
  113. package/dist/component/messages_fi-PCCXPo0O.js +20 -0
  114. package/dist/component/messages_fr-2im0dcYp.js +3515 -0
  115. package/dist/component/messages_fr-DMFilq1G.js +298 -0
  116. package/dist/component/messages_fr-DQa1dT9u.js +20 -0
  117. package/dist/component/messages_he-Bb1qTc2Y.js +299 -0
  118. package/dist/component/messages_he-BfIkDo1h.js +3515 -0
  119. package/dist/component/messages_he-DwIysfDp.js +20 -0
  120. package/dist/component/messages_hi-Bty6ytCh.js +3515 -0
  121. package/dist/component/messages_hi-C-6UHGbM.js +298 -0
  122. package/dist/component/messages_hi-DF1w6b6B.js +20 -0
  123. package/dist/component/messages_hr-BXzIzU3d.js +20 -0
  124. package/dist/component/messages_hr-CiU1ZVrx.js +3515 -0
  125. package/dist/component/messages_hr-tRSM9lmc.js +299 -0
  126. package/dist/component/messages_hu-ChzHFUtB.js +3515 -0
  127. package/dist/component/messages_hu-D86Taf9R.js +299 -0
  128. package/dist/component/messages_hu-Z9XpByCO.js +20 -0
  129. package/dist/component/messages_id-3952ilBE.js +20 -0
  130. package/dist/component/messages_id-CPuhTUYV.js +298 -0
  131. package/dist/component/messages_id-Ddr3ijST.js +3515 -0
  132. package/dist/component/messages_it-B-A1X4BZ.js +298 -0
  133. package/dist/component/messages_it-DnUTUabT.js +20 -0
  134. package/dist/component/messages_it-eY6GnuZC.js +3515 -0
  135. package/dist/component/messages_ja-B3PxHv2c.js +3515 -0
  136. package/dist/component/messages_ja-Ced6ZBxD.js +298 -0
  137. package/dist/component/messages_ja-Cg7CqBUL.js +20 -0
  138. package/dist/component/messages_ko-DBCjHG4c.js +3515 -0
  139. package/dist/component/messages_ko-PKIrqwPk.js +298 -0
  140. package/dist/component/messages_ko-zvhtZMGA.js +20 -0
  141. package/dist/component/messages_lt-DV3hdFsp.js +3515 -0
  142. package/dist/component/messages_lt-DywusvNm.js +20 -0
  143. package/dist/component/messages_lt-zxcCPHno.js +299 -0
  144. package/dist/component/messages_lv-BEowUv-S.js +299 -0
  145. package/dist/component/messages_lv-DggJE2f9.js +20 -0
  146. package/dist/component/messages_lv-hIonzpTs.js +3515 -0
  147. package/dist/component/messages_ms-Ca0m7bf7.js +20 -0
  148. package/dist/component/messages_ms-Cvypo0vi.js +299 -0
  149. package/dist/component/messages_ms-DoMzA8a3.js +3515 -0
  150. package/dist/component/messages_nl-CEmANR_r.js +3515 -0
  151. package/dist/component/messages_nl-CZR4TvNo.js +298 -0
  152. package/dist/component/messages_nl-DgVYmdO9.js +20 -0
  153. package/dist/component/messages_no-B2BBaGBH.js +298 -0
  154. package/dist/component/messages_no-DJfJSlDm.js +3515 -0
  155. package/dist/component/messages_no-hPkfRJQ9.js +20 -0
  156. package/dist/component/messages_pl-Bzph-WyD.js +20 -0
  157. package/dist/component/messages_pl-ChJVH7RO.js +3515 -0
  158. package/dist/component/messages_pl-rCMsbMbN.js +298 -0
  159. package/dist/component/messages_pt-Bv63V1uB.js +3515 -0
  160. package/dist/component/messages_pt-CBgCNF3T.js +20 -0
  161. package/dist/component/messages_pt-Cx0FF6uF.js +298 -0
  162. package/dist/component/messages_ro-BvLoD_wE.js +299 -0
  163. package/dist/component/messages_ro-CMzcu-9b.js +20 -0
  164. package/dist/component/messages_ro-PVRK7Gx4.js +3515 -0
  165. package/dist/component/messages_ru-8BI6MYA0.js +3515 -0
  166. package/dist/component/messages_ru-BhRKVmVC.js +298 -0
  167. package/dist/component/messages_ru-C_BaQo57.js +20 -0
  168. package/dist/component/messages_sk-Bgi_3583.js +3515 -0
  169. package/dist/component/messages_sk-CrsC7rOj.js +20 -0
  170. package/dist/component/messages_sk-CtF-ei23.js +299 -0
  171. package/dist/component/messages_sl-B5t-KKi8.js +299 -0
  172. package/dist/component/messages_sl-BFdYWVHd.js +3515 -0
  173. package/dist/component/messages_sl-NqfmyUP1.js +20 -0
  174. package/dist/component/messages_sv-Bd1CcY6G.js +3515 -0
  175. package/dist/component/messages_sv-DPRT-DpN.js +20 -0
  176. package/dist/component/messages_sv-bQwbNmjr.js +298 -0
  177. package/dist/component/messages_th-BauH9qdo.js +20 -0
  178. package/dist/component/messages_th-C_dL_PCq.js +298 -0
  179. package/dist/component/messages_th-DEWm01uD.js +3515 -0
  180. package/dist/component/messages_tl-CouXLNcW.js +299 -0
  181. package/dist/component/messages_tl-D2t9Y_ZC.js +3515 -0
  182. package/dist/component/messages_tl-UDZY8Wuk.js +20 -0
  183. package/dist/component/messages_tr-2-OHesob.js +3515 -0
  184. package/dist/component/messages_tr-CpsxYTDb.js +20 -0
  185. package/dist/component/messages_tr-DHXnlj_j.js +298 -0
  186. package/dist/component/messages_uk-CPK4y5lH.js +298 -0
  187. package/dist/component/messages_uk-DIuQ2HoD.js +3515 -0
  188. package/dist/component/messages_uk-gPkmA_ar.js +20 -0
  189. package/dist/component/messages_vi-CgxB4Ey0.js +20 -0
  190. package/dist/component/messages_vi-DZeFWgwp.js +3515 -0
  191. package/dist/component/messages_vi-Det8i7_V.js +298 -0
  192. package/dist/component/messages_zh-D53_A4N9.js +298 -0
  193. package/dist/component/messages_zh-O552w5dp.js +20 -0
  194. package/dist/component/messages_zh-nG7LNxIt.js +3515 -0
  195. package/dist/component/multiline-address-field-rac-C0PUrp9n.js +1574 -0
  196. package/dist/component/multiline-address-rac-BuIrCxJO.js +6 -0
  197. package/dist/component/non-modal-popover-DtIMXHbe.js +63 -0
  198. package/dist/component/number-input-field-rac-DY3hBv5k.js +89 -0
  199. package/dist/component/number-input-rac-LU2RRhXv.js +6 -0
  200. package/dist/component/numeric-input-utils-CuBMi4-a.js +45 -0
  201. package/dist/component/options-layout-constants-DEfIEJWD.js +6 -0
  202. package/dist/component/options-rac.module-KM-VT_KY.js +7 -0
  203. package/dist/component/password-rac-CKUa-xXB.js +142 -0
  204. package/dist/component/payment-field-utils-DobiK5Xh.js +12 -0
  205. package/dist/component/payment-input-rac-4-nB0Dtf.js +137 -0
  206. package/dist/component/phone-input-field-rac-D-WSiybW.js +473 -0
  207. package/dist/component/phone-rac-CHpAV4y9.js +6 -0
  208. package/dist/component/product-list-rac-43aeb4bH.js +263 -0
  209. package/dist/component/quiz-radio-group-rac-CIp82PU6.js +13 -0
  210. package/dist/component/radio-group-field-rac-Ctu5L43b.js +40 -0
  211. package/dist/component/radio-group-field-rac.module-xWCK2zEh.js +124 -0
  212. package/dist/component/radio-group-rac-C2z9k9zW.js +6 -0
  213. package/dist/component/rating-input-field-rac-FGf61_-a.js +130 -0
  214. package/dist/component/rating-input-rac-B4_5V8X4.js +6 -0
  215. package/dist/component/rich-content-rac.module-DuFIPLXP.js +49 -0
  216. package/dist/component/rich-text-field-rac-B1PbdTgi.js +22 -0
  217. package/dist/component/rich-text-rac-D1PDXRg5.js +6 -0
  218. package/dist/component/ricos-viewer-chunk-B4rfbgjA.js +5 -0
  219. package/dist/component/service-dropdown-rac-DIFcHwYR.js +142 -0
  220. package/dist/component/services-multi-choice-rac-BVgZsVc2.js +76 -0
  221. package/dist/component/signature-rac-DoznfA7u.js +795 -0
  222. package/dist/component/submit-button-rac-DQFhhUWx.js +115 -0
  223. package/dist/component/tags-field-rac-F3yYmtiN.js +201 -0
  224. package/dist/component/tags-rac-BkJ8931D.js +6 -0
  225. package/dist/component/text-area-field-rac-BQXCdqvK.js +69 -0
  226. package/dist/component/text-area-rac-CI4idsCI.js +6 -0
  227. package/dist/component/text-input-field-rac-Di3rvMr8.js +24 -0
  228. package/dist/component/text-input-headless-BFldUMDr.js +44 -0
  229. package/dist/component/text-input-rac-v2DSKy7B.js +6 -0
  230. package/dist/component/time-input-rac-CcbyfeiV.js +152 -0
  231. package/dist/component/url-input-field-rac-CcMmHuDT.js +71 -0
  232. package/dist/component/url-input-rac-DtbctKi2.js +6 -0
  233. package/dist/component/use-invoke-callback-UH73A_J3.js +15 -0
  234. package/dist/component/use-service-options-base-Cr8hJp01.js +48 -0
  235. package/dist/component/use-synced-display-value-DcAxdn3M.js +19 -0
  236. package/dist/form.d.ts +6930 -0
  237. package/package.json +164 -3
@@ -0,0 +1,1574 @@
1
+ import { RicosViewer as j } from "@wix/ricos/viewer";
2
+ import b from "classnames";
3
+ import n, { useMemo as w, createContext as we, useContext as Fe, useState as pe, useRef as B, useCallback as D, useEffect as Be } from "react";
4
+ import { UNSAFE_PortalProvider as gt } from "react-aria";
5
+ import { ab as at, c as lt, a8 as Ot, aa as it, z as Ft, G as ht, t as vt, y as W, F as V, aq as Re, a1 as tt, ag as _, ad as T, ai as oe, ac as ct, C as Ne, $ as St, a3 as Dt, an as At, ah as Rt, am as Pt, a6 as _t, X as Tt, a5 as Mt, aj as wt, j as Bt } from "./form-Dn-MrArr.js";
6
+ import { f as m, a as v } from "./find-child-C60k4CxG.js";
7
+ import { F as xt, V as qt } from "./headless-styles-CmcyA_pi.js";
8
+ import { TextField as Ee, Input as se, ComboBoxStateContext as dt, ComboBox as he, Popover as ve, ListBox as Se, ListBoxItem as De, Group as ut, Button as mt } from "react-aria-components";
9
+ import { D as ae, E as le } from "./field-error-headless-D40GACk4.js";
10
+ import { L as ie } from "./field-label-headless-Beq2Tn6V.js";
11
+ import { a as kt, b as $t, i as Me, r as Ut } from "./isObject-BAwJJxQ3.js";
12
+ import { u as Wt } from "./use-invoke-callback-UH73A_J3.js";
13
+ import { C as nt } from "./chevron-down-icon-CcpVm6B-.js";
14
+ import { E as J } from "./error-icon-hZxQ6DEy.js";
15
+ import { H as me } from "./custom-focus-class-_483Pkwp.js";
16
+ import { s as p } from "./field-rac.module-DXfwku6m.js";
17
+ import { r as X, H as z, q as G, u as Ie, l as Q, h as Z } from "./form-element-classes-Bi-nNM8q.js";
18
+ var Vt = "[object Symbol]";
19
+ function Kt(e) {
20
+ return typeof e == "symbol" || kt(e) && $t(e) == Vt;
21
+ }
22
+ var Yt = /\s/;
23
+ function Ht(e) {
24
+ for (var t = e.length; t-- && Yt.test(e.charAt(t)); )
25
+ ;
26
+ return t;
27
+ }
28
+ var jt = /^\s+/;
29
+ function Jt(e) {
30
+ return e && e.slice(0, Ht(e) + 1).replace(jt, "");
31
+ }
32
+ var rt = NaN, Xt = /^[-+]0x[0-9a-f]+$/i, zt = /^0b[01]+$/i, Gt = /^0o[0-7]+$/i, Qt = parseInt;
33
+ function ot(e) {
34
+ if (typeof e == "number")
35
+ return e;
36
+ if (Kt(e))
37
+ return rt;
38
+ if (Me(e)) {
39
+ var t = typeof e.valueOf == "function" ? e.valueOf() : e;
40
+ e = Me(t) ? t + "" : t;
41
+ }
42
+ if (typeof e != "string")
43
+ return e === 0 ? e : +e;
44
+ e = Jt(e);
45
+ var o = zt.test(e);
46
+ return o || Gt.test(e) ? Qt(e.slice(2), o ? 2 : 8) : Xt.test(e) ? rt : +e;
47
+ }
48
+ var _e = function() {
49
+ return Ut.Date.now();
50
+ }, Zt = "Expected a function", en = Math.max, tn = Math.min;
51
+ function nn(e, t, o) {
52
+ var r, l, a, i, s, d, f = 0, u = !1, I = !1, L = !0;
53
+ if (typeof e != "function")
54
+ throw new TypeError(Zt);
55
+ t = ot(t) || 0, Me(o) && (u = !!o.leading, I = "maxWait" in o, a = I ? en(ot(o.maxWait) || 0, t) : a, L = "trailing" in o ? !!o.trailing : L);
56
+ function E(g) {
57
+ var O = r, F = l;
58
+ return r = l = void 0, f = g, i = e.apply(F, O), i;
59
+ }
60
+ function y(g) {
61
+ return f = g, s = setTimeout(h, t), u ? E(g) : i;
62
+ }
63
+ function C(g) {
64
+ var O = g - d, F = g - f, de = t - O;
65
+ return I ? tn(de, a - F) : de;
66
+ }
67
+ function N(g) {
68
+ var O = g - d, F = g - f;
69
+ return d === void 0 || O >= t || O < 0 || I && F >= a;
70
+ }
71
+ function h() {
72
+ var g = _e();
73
+ if (N(g))
74
+ return A(g);
75
+ s = setTimeout(h, C(g));
76
+ }
77
+ function A(g) {
78
+ return s = void 0, L && r ? E(g) : (r = l = void 0, i);
79
+ }
80
+ function S() {
81
+ s !== void 0 && clearTimeout(s), f = 0, r = d = l = s = void 0;
82
+ }
83
+ function R() {
84
+ return s === void 0 ? i : A(_e());
85
+ }
86
+ function P() {
87
+ var g = _e(), O = N(g);
88
+ if (r = arguments, l = this, d = g, O) {
89
+ if (s === void 0)
90
+ return y(d);
91
+ if (I)
92
+ return clearTimeout(s), s = setTimeout(h, t), E(d);
93
+ }
94
+ return s === void 0 && (s = setTimeout(h, t)), i;
95
+ }
96
+ return P.cancel = S, P.flush = R, P;
97
+ }
98
+ const rn = (e, t, o) => {
99
+ var l, a, i, s;
100
+ const r = (l = e.steps) == null ? void 0 : l.map((d) => {
101
+ var f, u, I, L, E, y;
102
+ return {
103
+ ...d,
104
+ layout: {
105
+ ...d.layout,
106
+ large: {
107
+ ...(f = d.layout) == null ? void 0 : f.large,
108
+ items: ((L = (I = (u = d.layout) == null ? void 0 : u.large) == null ? void 0 : I.items) == null ? void 0 : L.map((C) => ({
109
+ ...C,
110
+ row: o.row <= C.row ? (C.row || 0) + 1 : C.row
111
+ }))) || ((y = (E = d.layout) == null ? void 0 : E.large) == null ? void 0 : y.items)
112
+ }
113
+ }
114
+ };
115
+ });
116
+ return (s = (i = (a = r == null ? void 0 : r[0].layout) == null ? void 0 : a.large) == null ? void 0 : i.items) == null || s.unshift(o), {
117
+ ...e,
118
+ fields: [
119
+ t,
120
+ ...e.fields || []
121
+ ],
122
+ steps: r || e.steps
123
+ };
124
+ };
125
+ var fe = /* @__PURE__ */ (function(e) {
126
+ 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;
127
+ })({});
128
+ function on(e, t, o = !1) {
129
+ const { country: r, subdivision: l, city: a, addressLine: i, streetAddress: s, addressLine2: d, postalCode: f } = e, u = {};
130
+ return t ? (r && (u.country = r), l && (u.subdivision = l), a && (u.city = a), i ? u.addressLine = i : s != null && s.formattedAddressLine && (u.addressLine = s == null ? void 0 : s.formattedAddressLine), d && (u.addressLine = d), f && (u.postalCode = f), s != null && s.apt && (u.apartment = s == null ? void 0 : s.apt), s != null && s.name ? u.streetName = s == null ? void 0 : s.name : o && (s != null && s.formattedAddressLine) && (u.streetName = s == null ? void 0 : s.formattedAddressLine), s != null && s.number && (u.streetNumber = s.number)) : (r && (u.country = r), l && (u.subdivision = l), a && (u.city = a), i ? u.address_line = i : s != null && s.formattedAddressLine && (u.address_line = s == null ? void 0 : s.formattedAddressLine), d && (u.address_line = d), f && (u.postal_code = f), s != null && s.apt && (u.apartment = s == null ? void 0 : s.apt), s != null && s.name ? u.street_name = s == null ? void 0 : s.name : o && (s != null && s.formattedAddressLine) && (u.street_name = s == null ? void 0 : s.formattedAddressLine), s != null && s.number && (u.street_number = s.number)), u;
131
+ }
132
+ const pt = /* @__PURE__ */ we({
133
+ onAddressSelect: () => {
134
+ }
135
+ }), sn = ({ children: e, onAddressSelect: t, autocompleteEnabled: o }) => {
136
+ const r = w(() => ({
137
+ onAddressSelect: t,
138
+ autocompleteEnabled: o
139
+ }), [
140
+ t,
141
+ o
142
+ ]);
143
+ return /* @__PURE__ */ n.createElement(pt.Provider, {
144
+ value: r
145
+ }, e);
146
+ };
147
+ function ye() {
148
+ return Fe(pt);
149
+ }
150
+ const Et = /* @__PURE__ */ we(void 0), an = ({ children: e, countryCode: t }) => {
151
+ const o = w(() => ({
152
+ countryCode: t
153
+ }), [
154
+ t
155
+ ]);
156
+ return /* @__PURE__ */ n.createElement(Et.Provider, {
157
+ value: o
158
+ }, e);
159
+ };
160
+ function Ce() {
161
+ const e = Fe(Et);
162
+ return e == null ? void 0 : e.countryCode;
163
+ }
164
+ function Te(e) {
165
+ return e != null;
166
+ }
167
+ function ln(e, t, o) {
168
+ return !t || !o ? e : {
169
+ ...e,
170
+ fields: (e.fields ?? []).map((r) => {
171
+ const { show: l, ...a } = t[r.target] || {}, { required: i } = o[r.target] || {};
172
+ return {
173
+ ...r,
174
+ view: {
175
+ ...r.view,
176
+ ...a
177
+ },
178
+ ...Te(l) && {
179
+ hidden: !l
180
+ },
181
+ ...Te(i) && Te(r.validation) && {
182
+ validation: {
183
+ ...r.validation,
184
+ required: i
185
+ }
186
+ }
187
+ };
188
+ })
189
+ };
190
+ }
191
+ const cn = (e, t) => e.map((o) => ({
192
+ ...o,
193
+ id: ("target" in o ? t[o.target] : void 0) ?? o.id
194
+ })), bt = 12, dn = (e) => {
195
+ const t = e.filter((r) => !r.properties.hidden), o = e.filter((r) => r.properties.hidden);
196
+ return {
197
+ visibleFields: t,
198
+ hiddenFields: o
199
+ };
200
+ }, un = (e) => {
201
+ const t = {};
202
+ return e.forEach((o) => {
203
+ const r = o.layout.row;
204
+ t[r] || (t[r] = []), t[r].push(o);
205
+ }), t;
206
+ }, mn = (e) => {
207
+ const t = {};
208
+ return Object.keys(e).forEach((o) => {
209
+ const r = parseInt(o, 10), l = e[r];
210
+ l.reduce((i, s) => i + s.layout.width, 0) !== bt && (t[r] = l);
211
+ }), t;
212
+ }, pn = (e, t) => e.map((o) => {
213
+ const r = o.layout.row;
214
+ if (t[r] && !o.properties.hidden) {
215
+ const l = t[r], a = l.length, i = bt / a, s = l.findIndex((f) => f.id === o.id), d = i * s;
216
+ return {
217
+ ...o,
218
+ layout: {
219
+ ...o.layout,
220
+ width: i,
221
+ column: d
222
+ }
223
+ };
224
+ }
225
+ return o;
226
+ }), En = (e, t, o) => {
227
+ const r = Math.max(...t.map((l) => l.layout.row), -1);
228
+ return e.map((l) => {
229
+ if (l.properties.hidden) {
230
+ const a = o.findIndex((i) => i.id === l.id);
231
+ return {
232
+ ...l,
233
+ layout: {
234
+ ...l.layout,
235
+ row: r + 1 + a
236
+ }
237
+ };
238
+ }
239
+ return l;
240
+ });
241
+ }, bn = (e) => {
242
+ const { visibleFields: t, hiddenFields: o } = dn(e.fields), r = un(t), l = mn(r), a = pn(e.fields, l), i = En(a, t, o);
243
+ return {
244
+ ...e,
245
+ fields: i
246
+ };
247
+ }, fn = () => ({
248
+ country: W(),
249
+ subdivision: W(),
250
+ city: W(),
251
+ address_line: W(),
252
+ address_line_2: W(),
253
+ postal_code: W(),
254
+ street_name: W(),
255
+ street_number: W(),
256
+ apartment: W()
257
+ }), yn = ({ id: e, target: t, fieldType: o, form: r, country: l, fieldSettings: a, validation: i, required: s }) => {
258
+ const [d] = pe(fn), { isExperimentEnabled: f } = at(), u = f(lt.USE_FIELDS_V2), { getCountryAddressForm: I } = Ot(), { isMobile: L, breakpoint: E } = it(), y = I(l), C = o === V.MULTILINE_ADDRESS || o === V.BOOKINGS_ADDRESS, N = w(() => {
259
+ var S;
260
+ return Ft(s, (S = i == null ? void 0 : i.predefined) == null ? void 0 : S.multilineAddressOptions);
261
+ }, [
262
+ i,
263
+ s
264
+ ]), h = w(() => ht(), []);
265
+ return {
266
+ form: w(() => {
267
+ var g, O;
268
+ if (!C || !y)
269
+ return r && {
270
+ ...r,
271
+ fields: cn(r.fields, d)
272
+ };
273
+ const S = vt({
274
+ useFieldsV2: u,
275
+ path: t,
276
+ parentId: e,
277
+ includeHiddenFields: !0,
278
+ isMobile: L,
279
+ breakpoint: E,
280
+ form: ln(rn(y, N, h), a, (O = (g = i == null ? void 0 : i.predefined) == null ? void 0 : g.multilineAddressOptions) == null ? void 0 : O.fields)
281
+ });
282
+ if (!S.fields.some((F) => F.properties.hidden))
283
+ return S;
284
+ const P = bn(S);
285
+ return {
286
+ ...P,
287
+ fields: P.fields.filter((F) => !F.properties.hidden)
288
+ };
289
+ }, [
290
+ y,
291
+ r,
292
+ d,
293
+ a,
294
+ i,
295
+ t,
296
+ N,
297
+ h,
298
+ C,
299
+ u,
300
+ e,
301
+ L,
302
+ E
303
+ ]),
304
+ isMultilineAddressField: C
305
+ };
306
+ }, ft = /* @__PURE__ */ we(void 0), Cn = ({ children: e, fields: t }) => {
307
+ const o = w(() => ({
308
+ fields: t
309
+ }), [
310
+ t
311
+ ]);
312
+ return /* @__PURE__ */ n.createElement(ft.Provider, {
313
+ value: o
314
+ }, e);
315
+ };
316
+ function ce(e) {
317
+ const t = Fe(ft);
318
+ if (!t)
319
+ throw new Error("useAddressFields must be used within AddressFieldsProvider");
320
+ return t.fields[e];
321
+ }
322
+ function ue(e) {
323
+ const { t } = Re(), o = Ce(), r = o && tt.getCountryByShortKey(o), a = (r ? r.addressPartDisplayNames : tt.getDefaultAddressDisplayNames())[e];
324
+ return a ? t(a) : "";
325
+ }
326
+ const ee = ({ children: e }) => {
327
+ const { id: t, value: o, onChange: r, disabled: l, readOnly: a, required: i, hasError: s, onBlur: d, onFocus: f, FieldLayout: u } = _(), { labelId: I } = T(), L = ue("addressLine2"), E = m(e, ee.Label), y = m(e, ee.Input), C = m(e, ee.Description), N = m(e, ee.Error);
328
+ return /* @__PURE__ */ n.createElement(u, {
329
+ fieldId: t,
330
+ renderLabel: () => v(E, {
331
+ label: L
332
+ }),
333
+ renderInput: () => /* @__PURE__ */ n.createElement(Ee, {
334
+ "aria-labelledby": I,
335
+ value: o ?? "",
336
+ onChange: r,
337
+ isDisabled: l,
338
+ isReadOnly: a,
339
+ isRequired: i,
340
+ isInvalid: s,
341
+ onBlur: d,
342
+ onFocus: f
343
+ }, y),
344
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, N, C)
345
+ });
346
+ }, In = ({ className: e }) => {
347
+ const { id: t, placeholder: o } = _(), { inputId: r, ariaDescribedBy: l } = T(), a = B(null);
348
+ return oe(() => {
349
+ var i;
350
+ (i = a.current) == null || i.focus();
351
+ }, t), /* @__PURE__ */ n.createElement(se, {
352
+ ref: a,
353
+ id: r,
354
+ "aria-describedby": l,
355
+ className: e,
356
+ placeholder: o
357
+ });
358
+ };
359
+ ee.Label = ie;
360
+ ee.Input = In;
361
+ ee.Description = ae;
362
+ ee.Error = le;
363
+ const xe = ({ enabled: e }) => {
364
+ const { actions: t } = ct(), [o, r] = pe(W()), l = D(() => r(W()), []);
365
+ return w(() => {
366
+ const { predict: a, getPlace: i, searchByPostalCode: s } = t ?? {};
367
+ if (!(!e || !a || !i || !s))
368
+ return {
369
+ predict: (d) => a({
370
+ ...d,
371
+ sessionToken: o
372
+ }),
373
+ getPlace: (d) => i({
374
+ ...d,
375
+ sessionToken: o,
376
+ refreshSessionToken: l
377
+ }),
378
+ searchByPostalCode: (d) => s({
379
+ ...d,
380
+ sessionToken: o
381
+ })
382
+ };
383
+ }, [
384
+ e,
385
+ t,
386
+ o,
387
+ l
388
+ ]);
389
+ }, Ln = (e, t, o = 200) => {
390
+ const r = B(e), l = D(nn((...a) => {
391
+ r.current(...a);
392
+ }, o), [
393
+ o
394
+ ]);
395
+ return Be(() => {
396
+ r.current = e;
397
+ }, [
398
+ e,
399
+ t
400
+ ]), l;
401
+ }, Nn = () => {
402
+ const e = B(!0);
403
+ return Be(() => () => {
404
+ e.current = !1;
405
+ }, []), () => e.current;
406
+ }, st = {
407
+ loading: !1,
408
+ predictions: []
409
+ }, yt = ({ atlas: e, onError: t }) => {
410
+ const [{ loading: r, predictions: l }, a] = pe(st), i = B(0), s = Nn(), d = D(() => {
411
+ i.current++, a(st);
412
+ }, []), f = Ln(async ({ input: u, countryCodes: I }) => {
413
+ if (!e || !s())
414
+ return;
415
+ if (!u) {
416
+ d();
417
+ return;
418
+ }
419
+ const L = ++i.current;
420
+ a((y) => ({
421
+ ...y,
422
+ loading: !0
423
+ }));
424
+ let E;
425
+ try {
426
+ E = await e.predict({
427
+ input: u,
428
+ countryCodes: I
429
+ });
430
+ } catch (y) {
431
+ t ? t(y) : console.error(y);
432
+ } finally {
433
+ const y = L === i.current;
434
+ s() && y && a((C) => ({
435
+ loading: !1,
436
+ // set new predictions if fetched properly, else keep current predictions
437
+ predictions: E || C.predictions
438
+ }));
439
+ }
440
+ }, [
441
+ e,
442
+ t
443
+ ], 200);
444
+ return {
445
+ predictions: l,
446
+ loading: r,
447
+ updatePredictions: f,
448
+ clearPredictions: d
449
+ };
450
+ }, qe = ({ optionCount: e }) => {
451
+ const t = Fe(dt), o = B(t);
452
+ o.current = t;
453
+ const r = B(e);
454
+ return Be(() => {
455
+ const l = e > 0 && r.current === 0;
456
+ r.current = e;
457
+ const a = o.current;
458
+ l && (a != null && a.isFocused) && !a.isOpen && a.open(null, "manual");
459
+ }, [
460
+ e
461
+ ]), null;
462
+ }, q = ({ children: e }) => {
463
+ const { id: t, value: o, onChange: r, disabled: l, readOnly: a, required: i, hasError: s, onBlur: d, onFocus: f, FieldLayout: u, autocomplete: I } = _(), { labelId: L } = T(), { autocompleteEnabled: E } = ye(), y = I || E, C = ue("addressLine1"), N = m(e, q.Label), h = m(e, q.Input), A = m(e, q.Options), S = m(e, q.Description), R = m(e, q.Error);
464
+ return y ? /* @__PURE__ */ n.createElement(u, {
465
+ fieldId: t,
466
+ renderLabel: () => v(N, {
467
+ label: C
468
+ }),
469
+ renderInput: () => /* @__PURE__ */ n.createElement(gn, {
470
+ value: o,
471
+ onChange: r,
472
+ disabled: l,
473
+ readOnly: a,
474
+ required: i,
475
+ hasError: s,
476
+ onBlur: d,
477
+ onFocus: f
478
+ }, h, A),
479
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, R, S)
480
+ }) : /* @__PURE__ */ n.createElement(u, {
481
+ fieldId: t,
482
+ renderLabel: () => v(N, {
483
+ label: C
484
+ }),
485
+ renderInput: () => /* @__PURE__ */ n.createElement(Ee, {
486
+ "aria-labelledby": L,
487
+ value: o ?? "",
488
+ onChange: r,
489
+ isDisabled: l,
490
+ isReadOnly: a,
491
+ isRequired: i,
492
+ isInvalid: s,
493
+ onBlur: d,
494
+ onFocus: f
495
+ }, h),
496
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, R, S)
497
+ });
498
+ }, gn = ({ children: e, value: t, onChange: o, disabled: r, readOnly: l, required: a, hasError: i, onBlur: s, onFocus: d }) => {
499
+ const { labelId: f } = T(), { onAddressSelect: u } = ye(), I = Ce(), L = xe({
500
+ enabled: !0
501
+ }), { predictions: E, updatePredictions: y, clearPredictions: C } = yt({
502
+ atlas: L
503
+ }), N = w(() => E.map((O) => ({
504
+ id: O.searchId || "",
505
+ label: O.description || ""
506
+ })), [
507
+ E
508
+ ]), h = D((O) => {
509
+ y({
510
+ input: O,
511
+ countryCodes: I ? [
512
+ I
513
+ ] : void 0
514
+ }), o(O);
515
+ }, [
516
+ o,
517
+ y,
518
+ I
519
+ ]), A = D(async (O) => {
520
+ if (!O)
521
+ return;
522
+ C();
523
+ const F = await (L == null ? void 0 : L.getPlace({
524
+ searchId: String(O)
525
+ }));
526
+ F && u && u(F);
527
+ }, [
528
+ u,
529
+ C,
530
+ L
531
+ ]), S = D(() => {
532
+ C(), s == null || s();
533
+ }, [
534
+ s,
535
+ C
536
+ ]), R = D(() => {
537
+ d == null || d();
538
+ }, [
539
+ d
540
+ ]), P = m(e, q.Input), g = m(e, q.Options);
541
+ return /* @__PURE__ */ n.createElement(he, {
542
+ "aria-labelledby": f,
543
+ inputValue: t ?? "",
544
+ onInputChange: h,
545
+ value: null,
546
+ onChange: A,
547
+ isDisabled: r,
548
+ isReadOnly: l,
549
+ isRequired: a,
550
+ isInvalid: i,
551
+ onBlur: S,
552
+ onFocus: R,
553
+ allowsCustomValue: !0,
554
+ menuTrigger: "input",
555
+ items: N
556
+ }, v(P, {
557
+ onFocus: R
558
+ }), v(g, {
559
+ options: N
560
+ }), /* @__PURE__ */ n.createElement(qe, {
561
+ optionCount: N.length
562
+ }));
563
+ }, On = ({ className: e, ...t }) => {
564
+ const { id: o, placeholder: r } = _(), { inputId: l, ariaDescribedBy: a } = T(), { onFocus: i } = t, s = B(null);
565
+ return oe(() => {
566
+ var d;
567
+ (d = s.current) == null || d.focus();
568
+ }, o), /* @__PURE__ */ n.createElement(se, {
569
+ ref: s,
570
+ id: l,
571
+ "aria-describedby": a,
572
+ className: e,
573
+ placeholder: r,
574
+ onFocus: i
575
+ });
576
+ }, ke = ({ children: e, className: t }) => {
577
+ const o = m(e, ke.Option);
578
+ return /* @__PURE__ */ n.createElement(ve, {
579
+ className: t,
580
+ containerPadding: 0,
581
+ offset: 0
582
+ }, /* @__PURE__ */ n.createElement(Se, {
583
+ renderEmptyState: () => null
584
+ }, (r) => v(o, {
585
+ id: r.id,
586
+ label: r.label
587
+ })));
588
+ }, Fn = ({ className: e, ...t }) => {
589
+ const { id: o, label: r } = t;
590
+ return /* @__PURE__ */ n.createElement(De, {
591
+ className: e,
592
+ id: o,
593
+ textValue: r
594
+ }, r);
595
+ };
596
+ ke.Option = Fn;
597
+ q.Label = ie;
598
+ q.Input = On;
599
+ q.Options = ke;
600
+ q.Description = ae;
601
+ q.Error = le;
602
+ const te = ({ children: e }) => {
603
+ const { id: t, value: o, onChange: r, disabled: l, readOnly: a, required: i, hasError: s, onBlur: d, onFocus: f, FieldLayout: u } = _(), { labelId: I } = T(), { t: L } = Re(), E = L("field.mla-apartment.label"), y = m(e, te.Label), C = m(e, te.Input), N = m(e, te.Description), h = m(e, te.Error);
604
+ return /* @__PURE__ */ n.createElement(u, {
605
+ fieldId: t,
606
+ renderLabel: () => v(y, {
607
+ label: E
608
+ }),
609
+ renderInput: () => /* @__PURE__ */ n.createElement(Ee, {
610
+ "aria-labelledby": I,
611
+ value: o ?? "",
612
+ onChange: r,
613
+ isDisabled: l,
614
+ isReadOnly: a,
615
+ isRequired: i,
616
+ isInvalid: s,
617
+ onBlur: d,
618
+ onFocus: f
619
+ }, C),
620
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, h, N)
621
+ });
622
+ }, hn = ({ className: e }) => {
623
+ const { id: t, placeholder: o } = _(), { inputId: r, ariaDescribedBy: l } = T(), a = B(null);
624
+ return oe(() => {
625
+ var i;
626
+ (i = a.current) == null || i.focus();
627
+ }, t), /* @__PURE__ */ n.createElement(se, {
628
+ ref: a,
629
+ id: r,
630
+ "aria-describedby": l,
631
+ className: e,
632
+ placeholder: o
633
+ });
634
+ };
635
+ te.Label = ie;
636
+ te.Input = hn;
637
+ te.Description = ae;
638
+ te.Error = le;
639
+ const ne = ({ children: e }) => {
640
+ const { id: t, value: o, onChange: r, disabled: l, readOnly: a, required: i, hasError: s, onBlur: d, onFocus: f, FieldLayout: u } = _(), { labelId: I } = T(), L = ue("city"), E = m(e, ne.Label), y = m(e, ne.Input), C = m(e, ne.Description), N = m(e, ne.Error);
641
+ return /* @__PURE__ */ n.createElement(u, {
642
+ fieldId: t,
643
+ renderLabel: () => v(E, {
644
+ label: L
645
+ }),
646
+ renderInput: () => /* @__PURE__ */ n.createElement(Ee, {
647
+ "aria-labelledby": I,
648
+ value: o ?? "",
649
+ onChange: r,
650
+ isDisabled: l,
651
+ isReadOnly: a,
652
+ isRequired: i,
653
+ isInvalid: s,
654
+ onBlur: d,
655
+ onFocus: f
656
+ }, y),
657
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, N, C)
658
+ });
659
+ }, vn = ({ className: e }) => {
660
+ const { id: t, placeholder: o } = _(), { inputId: r, ariaDescribedBy: l } = T(), a = B(null);
661
+ return oe(() => {
662
+ var i;
663
+ (i = a.current) == null || i.focus();
664
+ }, t), /* @__PURE__ */ n.createElement(se, {
665
+ ref: a,
666
+ id: r,
667
+ "aria-describedby": l,
668
+ className: e,
669
+ placeholder: o
670
+ });
671
+ };
672
+ ne.Label = ie;
673
+ ne.Input = vn;
674
+ ne.Description = ae;
675
+ ne.Error = le;
676
+ const Ct = ({ readOnly: e, disabled: t } = {}) => {
677
+ const o = Fe(dt);
678
+ return D(() => {
679
+ !o || o.isOpen || e || t || o.open(null, "manual");
680
+ }, [
681
+ o,
682
+ e,
683
+ t
684
+ ]);
685
+ }, Sn = (e, t) => e.find((o) => o.label.toLocaleLowerCase() === t.toLocaleLowerCase().trim()), It = ({ options: e, value: t, commit: o, clear: r, onBlur: l }) => {
686
+ const [a, i] = pe(null), s = Wt(l), d = w(() => {
687
+ var E;
688
+ return t ? ((E = e.find((y) => y.value === t)) == null ? void 0 : E.label) ?? "" : "";
689
+ }, [
690
+ t,
691
+ e
692
+ ]), f = D((E) => {
693
+ typeof E != "string" || E === "" || E === t || (i(null), o(E));
694
+ }, [
695
+ o,
696
+ t
697
+ ]), u = D((E) => {
698
+ if (i(E), E === "")
699
+ return;
700
+ const y = Sn(e, E);
701
+ y && y.value !== t && o(y.value);
702
+ }, [
703
+ o,
704
+ e,
705
+ t
706
+ ]), I = D((E) => {
707
+ E.key !== "Enter" && E.key !== "Escape" || (i(null), E.key === "Enter" && a === "" && t && r());
708
+ }, [
709
+ a,
710
+ t,
711
+ r
712
+ ]), L = D(() => {
713
+ a === "" && t && r(), i(null), s();
714
+ }, [
715
+ a,
716
+ t,
717
+ r,
718
+ s
719
+ ]);
720
+ return {
721
+ value: t ?? null,
722
+ inputValue: a ?? d,
723
+ onChange: f,
724
+ onInputChange: u,
725
+ onBlur: L,
726
+ onInputKeyDown: I
727
+ };
728
+ }, K = ({ children: e }) => {
729
+ const { id: t, value: o, onChange: r, disabled: l, readOnly: a, required: i, hasError: s, onBlur: d, onFocus: f, FieldLayout: u, options: I } = _(), { labelId: L } = T(), { t: E } = Re(), { language: y } = it(), C = w(() => (I || []).reduce((x, M) => (M.value && Ne.hasOwnProperty(M.value) && x.push({
730
+ value: M.value,
731
+ label: E(`locale-dataset.countries.${Ne[M.value].toUpperCase()}`)
732
+ }), x), []).sort((x, M) => x.label.localeCompare(M.label, y)), [
733
+ I,
734
+ E,
735
+ y
736
+ ]), N = D((x) => r(x), [
737
+ r
738
+ ]), h = D(() => N(""), [
739
+ N
740
+ ]), { onInputKeyDown: A, ...S } = It({
741
+ options: C,
742
+ value: o,
743
+ commit: N,
744
+ clear: h,
745
+ onBlur: d
746
+ }), R = ue("country"), P = m(e, K.Label), g = m(e, K.Control), O = m(e, K.Options), F = m(e, K.Description), de = m(e, K.Error);
747
+ return /* @__PURE__ */ n.createElement(u, {
748
+ fieldId: t,
749
+ renderLabel: () => v(P, {
750
+ label: R
751
+ }),
752
+ renderInput: () => /* @__PURE__ */ n.createElement(he, {
753
+ "aria-labelledby": L,
754
+ ...S,
755
+ isDisabled: l,
756
+ isReadOnly: a,
757
+ isRequired: i,
758
+ isInvalid: s,
759
+ onFocus: f,
760
+ menuTrigger: "input"
761
+ }, v(g, {
762
+ onKeyDown: A
763
+ }), v(O, {
764
+ options: C
765
+ })),
766
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, de, F)
767
+ });
768
+ }, ge = ({ children: e, className: t, ...o }) => {
769
+ const { disabled: r, hasError: l } = _(), { onKeyDown: a } = o, i = m(e, ge.Input), s = m(e, ge.Trigger);
770
+ return /* @__PURE__ */ n.createElement(ut, {
771
+ className: t,
772
+ isDisabled: r,
773
+ isInvalid: l
774
+ }, v(i, {
775
+ onKeyDown: a
776
+ }), s);
777
+ }, Dn = ({ className: e, ...t }) => {
778
+ const { id: o, placeholder: r, readOnly: l, disabled: a } = _(), { inputId: i, ariaDescribedBy: s } = T(), { onKeyDown: d } = t, f = B(null), u = Ct({
779
+ readOnly: l,
780
+ disabled: a
781
+ });
782
+ return oe(() => {
783
+ var I;
784
+ (I = f.current) == null || I.focus();
785
+ }, o), /* @__PURE__ */ n.createElement(se, {
786
+ ref: f,
787
+ id: i,
788
+ "aria-describedby": s,
789
+ className: e,
790
+ placeholder: r,
791
+ onClick: u,
792
+ onKeyDown: d
793
+ });
794
+ }, An = ({ children: e, className: t }) => /* @__PURE__ */ n.createElement(mt, {
795
+ className: t
796
+ }, e);
797
+ ge.Input = Dn;
798
+ ge.Trigger = An;
799
+ const $e = ({ children: e, className: t, ...o }) => {
800
+ const { options: r } = o, l = m(e, $e.Option);
801
+ return /* @__PURE__ */ n.createElement(ve, {
802
+ className: t,
803
+ containerPadding: 0,
804
+ offset: 0
805
+ }, /* @__PURE__ */ n.createElement(Se, null, r.map((a) => v(l, {
806
+ key: a.value,
807
+ value: a.value,
808
+ label: a.label
809
+ }))));
810
+ }, Rn = ({ className: e, ...t }) => {
811
+ const { value: o, label: r } = t;
812
+ return /* @__PURE__ */ n.createElement(De, {
813
+ className: e,
814
+ id: o,
815
+ textValue: r
816
+ }, r);
817
+ };
818
+ $e.Option = Rn;
819
+ K.Label = ie;
820
+ K.Control = ge;
821
+ K.Options = $e;
822
+ K.Description = ae;
823
+ K.Error = le;
824
+ const Pn = /(\d{7})|(\d{3}-\d{4})/;
825
+ function _n(e) {
826
+ var t;
827
+ return (t = e.match(Pn)) == null ? void 0 : t[0];
828
+ }
829
+ function Tn({ isAutocompleteEnabled: e }) {
830
+ const t = B({
831
+ hasAddress: !1
832
+ }), o = xe({
833
+ enabled: e
834
+ });
835
+ return {
836
+ searchByPostalCode: D(async (l) => {
837
+ const a = _n(l);
838
+ if (a) {
839
+ if (t.current.postalCode === a && t.current.hasAddress)
840
+ return t.current.address;
841
+ t.current = {
842
+ postalCode: a,
843
+ address: void 0,
844
+ hasAddress: !1
845
+ };
846
+ try {
847
+ const i = await (o == null ? void 0 : o.searchByPostalCode({
848
+ countryCode: "JP",
849
+ postalCode: a
850
+ }));
851
+ return t.current.hasAddress = !0, t.current.address = void 0, i != null && i.formattedAddress ? (t.current.address = i, i) : void 0;
852
+ } catch (i) {
853
+ console.error(i);
854
+ }
855
+ }
856
+ }, [
857
+ o
858
+ ])
859
+ };
860
+ }
861
+ const k = ({ children: e }) => {
862
+ const { id: t, value: o, onChange: r, disabled: l, readOnly: a, required: i, hasError: s, onBlur: d, onFocus: f, FieldLayout: u, autocomplete: I } = _(), { labelId: L } = T(), E = Ce(), { autocompleteEnabled: y } = ye(), C = !!(E && Ne[E] === Ne.JP), N = (I || y) && C, h = ue("zipCode"), A = m(e, k.Label), S = m(e, k.Control), R = m(e, k.Options), P = m(e, k.Description), g = m(e, k.Error);
863
+ return N ? /* @__PURE__ */ n.createElement(u, {
864
+ fieldId: t,
865
+ renderLabel: () => v(A, {
866
+ label: h
867
+ }),
868
+ renderInput: () => /* @__PURE__ */ n.createElement(Mn, {
869
+ value: o,
870
+ onChange: r,
871
+ disabled: l,
872
+ readOnly: a,
873
+ required: i,
874
+ hasError: s,
875
+ onBlur: d,
876
+ onFocus: f
877
+ }, S, R),
878
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, g, P)
879
+ }) : /* @__PURE__ */ n.createElement(u, {
880
+ fieldId: t,
881
+ renderLabel: () => v(A, {
882
+ label: h
883
+ }),
884
+ renderInput: () => /* @__PURE__ */ n.createElement(Ee, {
885
+ "aria-labelledby": L,
886
+ value: o ?? "",
887
+ onChange: r,
888
+ isDisabled: l,
889
+ isReadOnly: a,
890
+ isRequired: i,
891
+ isInvalid: s,
892
+ onBlur: d,
893
+ onFocus: f
894
+ }, S),
895
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, g, P)
896
+ });
897
+ }, Mn = ({ children: e, value: t, onChange: o, disabled: r, readOnly: l, required: a, hasError: i, onBlur: s, onFocus: d }) => {
898
+ const { labelId: f } = T(), { onAddressSelect: u } = ye(), [I, L] = pe(!1), { searchByPostalCode: E } = Tn({
899
+ isAutocompleteEnabled: I
900
+ }), [y, C] = pe(), N = w(() => y ? [
901
+ {
902
+ id: W(),
903
+ label: y.formattedAddress || ""
904
+ }
905
+ ] : [], [
906
+ y
907
+ ]), h = D(async (O) => {
908
+ o(O);
909
+ const F = await E(O ?? "");
910
+ C(F);
911
+ }, [
912
+ o,
913
+ E
914
+ ]), A = D(async (O) => {
915
+ O && (C(void 0), y && u && u(y));
916
+ }, [
917
+ u,
918
+ y
919
+ ]), S = D(() => {
920
+ C(void 0), s == null || s();
921
+ }, [
922
+ s
923
+ ]), R = D(() => {
924
+ L(!0), d == null || d();
925
+ }, [
926
+ d
927
+ ]), P = m(e, k.Control), g = m(e, k.Options);
928
+ return /* @__PURE__ */ n.createElement(he, {
929
+ "aria-labelledby": f,
930
+ inputValue: t ?? "",
931
+ onInputChange: h,
932
+ value: null,
933
+ onChange: A,
934
+ isDisabled: r,
935
+ isReadOnly: l,
936
+ isRequired: a,
937
+ isInvalid: i,
938
+ onBlur: S,
939
+ onFocus: R,
940
+ allowsCustomValue: !0,
941
+ menuTrigger: "input",
942
+ items: N
943
+ }, v(P, {
944
+ onFocus: R
945
+ }), v(g, {
946
+ options: N
947
+ }), /* @__PURE__ */ n.createElement(qe, {
948
+ optionCount: N.length
949
+ }));
950
+ }, Ue = ({ children: e, className: t, ...o }) => {
951
+ const { disabled: r, hasError: l } = _(), { onFocus: a } = o, i = Ce(), s = m(e, Ue.Input);
952
+ return /* @__PURE__ */ n.createElement("div", {
953
+ className: t,
954
+ "data-country": i || void 0,
955
+ "data-disabled": r || void 0,
956
+ "data-invalid": l || void 0
957
+ }, v(s, {
958
+ onFocus: a
959
+ }));
960
+ }, wn = ({ className: e, ...t }) => {
961
+ const { id: o, placeholder: r } = _(), { inputId: l, ariaDescribedBy: a } = T(), { onFocus: i } = t, s = B(null);
962
+ return oe(() => {
963
+ var d;
964
+ (d = s.current) == null || d.focus();
965
+ }, o), /* @__PURE__ */ n.createElement(se, {
966
+ ref: s,
967
+ id: l,
968
+ "aria-describedby": a,
969
+ className: e,
970
+ placeholder: r,
971
+ onFocus: i
972
+ });
973
+ }, We = ({ children: e, className: t }) => {
974
+ const o = m(e, We.Option);
975
+ return /* @__PURE__ */ n.createElement(ve, {
976
+ className: t,
977
+ containerPadding: 0,
978
+ offset: 0
979
+ }, /* @__PURE__ */ n.createElement(Se, {
980
+ renderEmptyState: () => null
981
+ }, (r) => v(o, {
982
+ id: r.id,
983
+ label: r.label
984
+ })));
985
+ }, Bn = ({ className: e, ...t }) => {
986
+ const { id: o, label: r } = t;
987
+ return /* @__PURE__ */ n.createElement(De, {
988
+ className: e,
989
+ id: o,
990
+ textValue: r
991
+ }, r);
992
+ };
993
+ We.Option = Bn;
994
+ Ue.Input = wn;
995
+ k.Label = ie;
996
+ k.Control = Ue;
997
+ k.Options = We;
998
+ k.Description = ae;
999
+ k.Error = le;
1000
+ const $ = ({ children: e }) => {
1001
+ const { id: t, value: o, onChange: r, disabled: l, readOnly: a, required: i, hasError: s, onBlur: d, onFocus: f, FieldLayout: u, autocomplete: I } = _(), { labelId: L } = T(), { autocompleteEnabled: E } = ye(), y = I || E, C = ue("streetName"), N = m(e, $.Label), h = m(e, $.Input), A = m(e, $.Options), S = m(e, $.Description), R = m(e, $.Error);
1002
+ return y ? /* @__PURE__ */ n.createElement(u, {
1003
+ fieldId: t,
1004
+ renderLabel: () => v(N, {
1005
+ label: C
1006
+ }),
1007
+ renderInput: () => /* @__PURE__ */ n.createElement(xn, {
1008
+ value: o,
1009
+ onChange: r,
1010
+ disabled: l,
1011
+ readOnly: a,
1012
+ required: i,
1013
+ hasError: s,
1014
+ onBlur: d,
1015
+ onFocus: f
1016
+ }, h, A),
1017
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, R, S)
1018
+ }) : /* @__PURE__ */ n.createElement(u, {
1019
+ fieldId: t,
1020
+ renderLabel: () => v(N, {
1021
+ label: C
1022
+ }),
1023
+ renderInput: () => /* @__PURE__ */ n.createElement(Ee, {
1024
+ "aria-labelledby": L,
1025
+ value: o ?? "",
1026
+ onChange: r,
1027
+ isDisabled: l,
1028
+ isReadOnly: a,
1029
+ isRequired: i,
1030
+ isInvalid: s,
1031
+ onBlur: d,
1032
+ onFocus: f
1033
+ }, h),
1034
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, R, S)
1035
+ });
1036
+ }, xn = ({ children: e, value: t, onChange: o, disabled: r, readOnly: l, required: a, hasError: i, onBlur: s, onFocus: d }) => {
1037
+ const { labelId: f } = T(), { onAddressSelect: u } = ye(), I = Ce(), L = xe({
1038
+ enabled: !0
1039
+ }), { predictions: E, updatePredictions: y, clearPredictions: C } = yt({
1040
+ atlas: L
1041
+ }), N = m(e, $.Input), h = m(e, $.Options), A = w(() => E.reduce((O, F) => (F.searchId && F.description && O.push({
1042
+ id: F.searchId,
1043
+ label: F.description
1044
+ }), O), []), [
1045
+ E
1046
+ ]), S = D((O) => {
1047
+ y({
1048
+ input: O,
1049
+ countryCodes: I ? [
1050
+ I
1051
+ ] : void 0
1052
+ }), o(O);
1053
+ }, [
1054
+ o,
1055
+ y,
1056
+ I
1057
+ ]), R = D(async (O) => {
1058
+ if (C(), !O)
1059
+ return;
1060
+ const F = await (L == null ? void 0 : L.getPlace({
1061
+ searchId: String(O)
1062
+ }));
1063
+ F && u && u(F);
1064
+ }, [
1065
+ u,
1066
+ C,
1067
+ L
1068
+ ]), P = D(() => {
1069
+ C(), s == null || s();
1070
+ }, [
1071
+ s,
1072
+ C
1073
+ ]), g = D(() => {
1074
+ d == null || d();
1075
+ }, [
1076
+ d
1077
+ ]);
1078
+ return /* @__PURE__ */ n.createElement(he, {
1079
+ "aria-labelledby": f,
1080
+ inputValue: t ?? "",
1081
+ onInputChange: S,
1082
+ value: null,
1083
+ onChange: R,
1084
+ isDisabled: r,
1085
+ isReadOnly: l,
1086
+ isRequired: a,
1087
+ isInvalid: i,
1088
+ onBlur: P,
1089
+ onFocus: g,
1090
+ allowsCustomValue: !0,
1091
+ menuTrigger: "input",
1092
+ items: A
1093
+ }, v(N, {
1094
+ onFocus: g
1095
+ }), v(h, {
1096
+ options: A
1097
+ }), /* @__PURE__ */ n.createElement(qe, {
1098
+ optionCount: A.length
1099
+ }));
1100
+ }, qn = ({ className: e, ...t }) => {
1101
+ const { id: o, placeholder: r } = _(), { inputId: l, ariaDescribedBy: a } = T(), { onFocus: i } = t, s = B(null);
1102
+ return oe(() => {
1103
+ var d;
1104
+ (d = s.current) == null || d.focus();
1105
+ }, o), /* @__PURE__ */ n.createElement(se, {
1106
+ ref: s,
1107
+ id: l,
1108
+ "aria-describedby": a,
1109
+ className: e,
1110
+ placeholder: r,
1111
+ onFocus: i
1112
+ });
1113
+ }, Ve = ({ children: e, className: t }) => {
1114
+ const o = m(e, Ve.Option);
1115
+ return /* @__PURE__ */ n.createElement(ve, {
1116
+ className: t,
1117
+ containerPadding: 0,
1118
+ offset: 0
1119
+ }, /* @__PURE__ */ n.createElement(Se, {
1120
+ renderEmptyState: () => null
1121
+ }, (r) => v(o, {
1122
+ id: r.id,
1123
+ label: r.label
1124
+ })));
1125
+ }, kn = ({ className: e, ...t }) => {
1126
+ const { id: o, label: r } = t;
1127
+ return /* @__PURE__ */ n.createElement(De, {
1128
+ className: e,
1129
+ id: o,
1130
+ textValue: r
1131
+ }, r);
1132
+ };
1133
+ Ve.Option = kn;
1134
+ $.Label = ie;
1135
+ $.Input = qn;
1136
+ $.Options = Ve;
1137
+ $.Description = ae;
1138
+ $.Error = le;
1139
+ const re = ({ children: e }) => {
1140
+ const { id: t, value: o, onChange: r, disabled: l, readOnly: a, required: i, hasError: s, onBlur: d, onFocus: f, FieldLayout: u } = _(), { labelId: I } = T(), L = ue("streetNumber"), E = m(e, re.Label), y = m(e, re.Input), C = m(e, re.Description), N = m(e, re.Error);
1141
+ return /* @__PURE__ */ n.createElement(u, {
1142
+ fieldId: t,
1143
+ renderLabel: () => v(E, {
1144
+ label: L
1145
+ }),
1146
+ renderInput: () => /* @__PURE__ */ n.createElement(Ee, {
1147
+ "aria-labelledby": I,
1148
+ value: o ?? "",
1149
+ onChange: r,
1150
+ isDisabled: l,
1151
+ isReadOnly: a,
1152
+ isRequired: i,
1153
+ isInvalid: s,
1154
+ onBlur: d,
1155
+ onFocus: f
1156
+ }, y),
1157
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, N, C)
1158
+ });
1159
+ }, $n = ({ className: e }) => {
1160
+ const { id: t, placeholder: o } = _(), { inputId: r, ariaDescribedBy: l } = T(), a = B(null);
1161
+ return oe(() => {
1162
+ var i;
1163
+ (i = a.current) == null || i.focus();
1164
+ }, t), /* @__PURE__ */ n.createElement(se, {
1165
+ ref: a,
1166
+ id: r,
1167
+ "aria-describedby": l,
1168
+ className: e,
1169
+ placeholder: o
1170
+ });
1171
+ };
1172
+ re.Label = ie;
1173
+ re.Input = $n;
1174
+ re.Description = ae;
1175
+ re.Error = le;
1176
+ const Y = ({ children: e }) => {
1177
+ const { id: t, value: o, onChange: r, disabled: l, readOnly: a, required: i, hasError: s, onBlur: d, onFocus: f, FieldLayout: u } = _(), { labelId: I } = T(), { t: L } = Re(), E = Ce(), y = E ? Ne[E] : void 0, C = E && St.getCountryByShortKey(E), N = w(() => {
1178
+ var M;
1179
+ return (Dt(((M = C == null ? void 0 : C.subdivisions) == null ? void 0 : M.list) || [], y) || []).map((be) => ({
1180
+ value: be.key,
1181
+ label: L(be.displayName)
1182
+ })).sort((be, Pe) => be.label.localeCompare(Pe.label));
1183
+ }, [
1184
+ y,
1185
+ L,
1186
+ C
1187
+ ]), h = D(() => r(""), [
1188
+ r
1189
+ ]), { onInputKeyDown: A, ...S } = It({
1190
+ options: N,
1191
+ value: o,
1192
+ commit: r,
1193
+ clear: h,
1194
+ onBlur: d
1195
+ }), R = ue("subdivision"), P = m(e, Y.Label), g = m(e, Y.Control), O = m(e, Y.Options), F = m(e, Y.Description), de = m(e, Y.Error);
1196
+ return /* @__PURE__ */ n.createElement(u, {
1197
+ fieldId: t,
1198
+ renderLabel: () => v(P, {
1199
+ label: R
1200
+ }),
1201
+ renderInput: () => /* @__PURE__ */ n.createElement(he, {
1202
+ "aria-labelledby": I,
1203
+ ...S,
1204
+ isDisabled: l,
1205
+ isReadOnly: a,
1206
+ isRequired: i,
1207
+ isInvalid: s,
1208
+ onFocus: f,
1209
+ menuTrigger: "input"
1210
+ }, v(g, {
1211
+ onKeyDown: A
1212
+ }), v(O, {
1213
+ options: N
1214
+ })),
1215
+ renderDescription: () => /* @__PURE__ */ n.createElement(n.Fragment, null, de, F)
1216
+ });
1217
+ }, Oe = ({ children: e, className: t, ...o }) => {
1218
+ const { disabled: r, hasError: l } = _(), { onKeyDown: a } = o, i = m(e, Oe.Input), s = m(e, Oe.Trigger);
1219
+ return /* @__PURE__ */ n.createElement(ut, {
1220
+ className: t,
1221
+ isDisabled: r,
1222
+ isInvalid: l
1223
+ }, v(i, {
1224
+ onKeyDown: a
1225
+ }), s);
1226
+ }, Un = ({ className: e, ...t }) => {
1227
+ const { id: o, placeholder: r, readOnly: l, disabled: a } = _(), { inputId: i, ariaDescribedBy: s } = T(), { onKeyDown: d } = t, f = B(null), u = Ct({
1228
+ readOnly: l,
1229
+ disabled: a
1230
+ });
1231
+ return oe(() => {
1232
+ var I;
1233
+ (I = f.current) == null || I.focus();
1234
+ }, o), /* @__PURE__ */ n.createElement(se, {
1235
+ ref: f,
1236
+ id: i,
1237
+ "aria-describedby": s,
1238
+ className: e,
1239
+ placeholder: r,
1240
+ onClick: u,
1241
+ onKeyDown: d
1242
+ });
1243
+ }, Wn = ({ children: e, className: t }) => /* @__PURE__ */ n.createElement(mt, {
1244
+ className: t
1245
+ }, e);
1246
+ Oe.Input = Un;
1247
+ Oe.Trigger = Wn;
1248
+ const Ke = ({ children: e, className: t, ...o }) => {
1249
+ const { options: r } = o, l = m(e, Ke.Option);
1250
+ return /* @__PURE__ */ n.createElement(ve, {
1251
+ className: t,
1252
+ containerPadding: 0,
1253
+ offset: 0
1254
+ }, /* @__PURE__ */ n.createElement(Se, null, r.map((a) => v(l, {
1255
+ key: a.value,
1256
+ value: a.value,
1257
+ label: a.label
1258
+ }))));
1259
+ }, Vn = ({ className: e, ...t }) => {
1260
+ const { value: o, label: r } = t;
1261
+ return /* @__PURE__ */ n.createElement(De, {
1262
+ className: e,
1263
+ id: o,
1264
+ textValue: r
1265
+ }, r);
1266
+ };
1267
+ Ke.Option = Vn;
1268
+ Y.Label = ie;
1269
+ Y.Control = Oe;
1270
+ Y.Options = Ke;
1271
+ Y.Description = ae;
1272
+ Y.Error = le;
1273
+ const Kn = () => ce("country"), Yn = () => ce("subdivision"), Hn = () => ce("city"), jn = () => ce("addressLine"), Jn = () => ce("addressLine2"), Xn = () => ce("postalCode"), zn = () => ce("streetName"), Gn = () => ce("streetNumber"), Qn = () => ce("apartment"), Zn = {
1274
+ [V.MLA_COUNTRY]: Kn,
1275
+ [V.MLA_SUBDIVISION]: Yn,
1276
+ [V.MLA_CITY]: Hn,
1277
+ [V.MLA_ADDRESS_LINE]: jn,
1278
+ [V.MLA_ADDRESS_LINE_2]: Jn,
1279
+ [V.MLA_POSTAL_CODE]: Xn,
1280
+ [V.MLA_STREET_NAME]: zn,
1281
+ [V.MLA_STREET_NUMBER]: Gn,
1282
+ [V.MLA_APARTMENT]: Qn
1283
+ }, er = {}, tr = [], c = ({ children: e }) => {
1284
+ const { id: t, form: o, value: r, onChange: l, onFieldBlur: a, onFieldFocus: i, errors: s, FieldLayout: d, fieldSettings: f, label: u, validation: I, target: L, autocompleteEnabled: E, required: y, fieldType: C } = _(), [N, h] = pe(null), A = At(), S = w(() => ({
1285
+ ...A,
1286
+ ...Zn
1287
+ }), [
1288
+ A
1289
+ ]), { isExperimentEnabled: R } = at(), P = R(lt.STREETLESS_LOCALITY_FALLBACK), { validateFields: g } = Rt(), O = Pt(), F = ct(), de = w(() => ({
1290
+ ...F,
1291
+ actions: {
1292
+ predict: Mt,
1293
+ getPlace: Tt,
1294
+ searchByPostalCode: _t,
1295
+ ...F.actions
1296
+ }
1297
+ }), [
1298
+ F
1299
+ ]), { form: x, isMultilineAddressField: M } = yn({
1300
+ id: t,
1301
+ target: L,
1302
+ fieldType: C,
1303
+ form: o,
1304
+ country: r == null ? void 0 : r.country,
1305
+ fieldSettings: f,
1306
+ validation: I,
1307
+ required: y
1308
+ }), be = D((U) => {
1309
+ if (!r)
1310
+ return;
1311
+ const H = on(U, M, P), Ae = {
1312
+ ...H,
1313
+ [fe.COUNTRY]: H[fe.COUNTRY] ?? r[fe.COUNTRY]
1314
+ };
1315
+ l == null || l(Ae);
1316
+ }, [
1317
+ l,
1318
+ r,
1319
+ M,
1320
+ P
1321
+ ]), Pe = D((U, H) => {
1322
+ if (M && U === fe.COUNTRY && (r == null ? void 0 : r[U]) !== H) {
1323
+ l == null || l({
1324
+ [fe.COUNTRY]: H
1325
+ });
1326
+ return;
1327
+ }
1328
+ l == null || l({
1329
+ ...r,
1330
+ [U]: H
1331
+ });
1332
+ }, [
1333
+ l,
1334
+ r,
1335
+ M
1336
+ ]), Lt = D(async (U) => g(M ? [
1337
+ ...U,
1338
+ {
1339
+ path: `${L}/${fe.COUNTRY}`,
1340
+ value: r == null ? void 0 : r.country
1341
+ }
1342
+ ] : U), [
1343
+ r,
1344
+ L,
1345
+ g,
1346
+ M
1347
+ ]);
1348
+ wt(t, () => {
1349
+ var Ae;
1350
+ const U = s == null ? void 0 : s[0], H = (Ae = x == null ? void 0 : x.fields) == null ? void 0 : Ae.find((et) => "target" in et && et.target === (U == null ? void 0 : U.errorPath));
1351
+ return H == null ? void 0 : H.id;
1352
+ });
1353
+ const Ye = m(e, c.Country), He = m(e, c.Subdivision), je = m(e, c.City), Je = m(e, c.AddressLine), Xe = m(e, c.AddressLine2), ze = m(e, c.PostalCode), Ge = m(e, c.StreetName), Qe = m(e, c.StreetNumber), Ze = m(e, c.Apartment), Nt = w(() => ({
1354
+ country: Ye,
1355
+ subdivision: He,
1356
+ city: je,
1357
+ addressLine: Je,
1358
+ addressLine2: Xe,
1359
+ postalCode: ze,
1360
+ streetName: Ge,
1361
+ streetNumber: Qe,
1362
+ apartment: Ze
1363
+ }), [
1364
+ Ye,
1365
+ He,
1366
+ je,
1367
+ Je,
1368
+ Xe,
1369
+ ze,
1370
+ Ge,
1371
+ Qe,
1372
+ Ze
1373
+ ]);
1374
+ return x ? /* @__PURE__ */ n.createElement(d, {
1375
+ fieldId: t
1376
+ }, /* @__PURE__ */ n.createElement(an, {
1377
+ countryCode: r == null ? void 0 : r.country
1378
+ }, /* @__PURE__ */ n.createElement(sn, {
1379
+ autocompleteEnabled: E,
1380
+ onAddressSelect: be
1381
+ }, /* @__PURE__ */ n.createElement(Cn, {
1382
+ fields: Nt
1383
+ }, /* @__PURE__ */ n.createElement("div", {
1384
+ ref: h,
1385
+ style: {
1386
+ display: "contents"
1387
+ }
1388
+ }), /* @__PURE__ */ n.createElement(gt, {
1389
+ getContainer: () => N
1390
+ }, /* @__PURE__ */ n.createElement("fieldset", {
1391
+ style: xt
1392
+ }, /* @__PURE__ */ n.createElement("legend", {
1393
+ style: qt
1394
+ }, u), /* @__PURE__ */ n.createElement(Bt, {
1395
+ formSchema: O,
1396
+ form: x,
1397
+ values: r ?? er,
1398
+ onFieldChange: Pe,
1399
+ onBlur: a,
1400
+ onFocus: i,
1401
+ errors: s ?? tr,
1402
+ validateFields: Lt,
1403
+ fields: S,
1404
+ fieldActions: de
1405
+ }))))))) : null;
1406
+ };
1407
+ c.Country = K;
1408
+ c.Subdivision = Y;
1409
+ c.City = ne;
1410
+ c.AddressLine = q;
1411
+ c.AddressLine2 = ee;
1412
+ c.PostalCode = k;
1413
+ c.StreetName = $;
1414
+ c.StreetNumber = re;
1415
+ c.Apartment = te;
1416
+ const nr = "_postalCodeControl_1tire_1", rr = "_comboControl_1tire_5", or = "_comboTrigger_1tire_19", Le = {
1417
+ postalCodeControl: nr,
1418
+ comboControl: rr,
1419
+ comboTrigger: or
1420
+ }, gr = () => /* @__PURE__ */ n.createElement(c, null, /* @__PURE__ */ n.createElement(c.Country, null, /* @__PURE__ */ n.createElement(c.Country.Label, {
1421
+ className: b(X, p.label)
1422
+ }, /* @__PURE__ */ n.createElement(c.Country.Label.Required, {
1423
+ className: b(z, p.requiredMark)
1424
+ })), /* @__PURE__ */ n.createElement(c.Country.Control, {
1425
+ className: b(G, p.input, Le.comboControl)
1426
+ }, /* @__PURE__ */ n.createElement(c.Country.Control.Input, {
1427
+ className: b(p.innerInput, me)
1428
+ }), /* @__PURE__ */ n.createElement(c.Country.Control.Trigger, {
1429
+ className: Le.comboTrigger
1430
+ }, /* @__PURE__ */ n.createElement(nt, {
1431
+ className: p.dropdownIcon
1432
+ }))), /* @__PURE__ */ n.createElement(c.Country.Options, {
1433
+ className: b(Ie, p.selectPopover, p.dropdownPopover)
1434
+ }, /* @__PURE__ */ n.createElement(c.Country.Options.Option, {
1435
+ className: b(p.selectOption, me)
1436
+ })), /* @__PURE__ */ n.createElement(c.Country.Error, {
1437
+ className: b(Q, p.error)
1438
+ }, /* @__PURE__ */ n.createElement(J, null), /* @__PURE__ */ n.createElement(c.Country.Error.Text, null)), /* @__PURE__ */ n.createElement(c.Country.Description, {
1439
+ className: b(Z, p.description)
1440
+ }, ({ content: e, locale: t }) => /* @__PURE__ */ n.createElement(j, {
1441
+ content: e,
1442
+ locale: t
1443
+ }))), /* @__PURE__ */ n.createElement(c.AddressLine, null, /* @__PURE__ */ n.createElement(c.AddressLine.Label, {
1444
+ className: b(X, p.label)
1445
+ }, /* @__PURE__ */ n.createElement(c.AddressLine.Label.Required, {
1446
+ className: b(z, p.requiredMark)
1447
+ })), /* @__PURE__ */ n.createElement(c.AddressLine.Input, {
1448
+ className: b(G, p.input)
1449
+ }), /* @__PURE__ */ n.createElement(c.AddressLine.Options, {
1450
+ className: b(Ie, p.selectPopover, p.dropdownPopover)
1451
+ }, /* @__PURE__ */ n.createElement(c.AddressLine.Options.Option, {
1452
+ className: b(p.selectOption, me)
1453
+ })), /* @__PURE__ */ n.createElement(c.AddressLine.Error, {
1454
+ className: b(Q, p.error)
1455
+ }, /* @__PURE__ */ n.createElement(J, null), /* @__PURE__ */ n.createElement(c.AddressLine.Error.Text, null)), /* @__PURE__ */ n.createElement(c.AddressLine.Description, {
1456
+ className: b(Z, p.description)
1457
+ }, ({ content: e, locale: t }) => /* @__PURE__ */ n.createElement(j, {
1458
+ content: e,
1459
+ locale: t
1460
+ }))), /* @__PURE__ */ n.createElement(c.AddressLine2, null, /* @__PURE__ */ n.createElement(c.AddressLine2.Label, {
1461
+ className: b(X, p.label)
1462
+ }, /* @__PURE__ */ n.createElement(c.AddressLine2.Label.Required, {
1463
+ className: b(z, p.requiredMark)
1464
+ })), /* @__PURE__ */ n.createElement(c.AddressLine2.Input, {
1465
+ className: b(G, p.input)
1466
+ }), /* @__PURE__ */ n.createElement(c.AddressLine2.Error, {
1467
+ className: b(Q, p.error)
1468
+ }, /* @__PURE__ */ n.createElement(J, null), /* @__PURE__ */ n.createElement(c.AddressLine2.Error.Text, null)), /* @__PURE__ */ n.createElement(c.AddressLine2.Description, {
1469
+ className: b(Z, p.description)
1470
+ }, ({ content: e, locale: t }) => /* @__PURE__ */ n.createElement(j, {
1471
+ content: e,
1472
+ locale: t
1473
+ }))), /* @__PURE__ */ n.createElement(c.City, null, /* @__PURE__ */ n.createElement(c.City.Label, {
1474
+ className: b(X, p.label)
1475
+ }, /* @__PURE__ */ n.createElement(c.City.Label.Required, {
1476
+ className: b(z, p.requiredMark)
1477
+ })), /* @__PURE__ */ n.createElement(c.City.Input, {
1478
+ className: b(G, p.input)
1479
+ }), /* @__PURE__ */ n.createElement(c.City.Error, {
1480
+ className: b(Q, p.error)
1481
+ }, /* @__PURE__ */ n.createElement(J, null), /* @__PURE__ */ n.createElement(c.City.Error.Text, null)), /* @__PURE__ */ n.createElement(c.City.Description, {
1482
+ className: b(Z, p.description)
1483
+ }, ({ content: e, locale: t }) => /* @__PURE__ */ n.createElement(j, {
1484
+ content: e,
1485
+ locale: t
1486
+ }))), /* @__PURE__ */ n.createElement(c.PostalCode, null, /* @__PURE__ */ n.createElement(c.PostalCode.Label, {
1487
+ className: b(X, p.label)
1488
+ }, /* @__PURE__ */ n.createElement(c.PostalCode.Label.Required, {
1489
+ className: b(z, p.requiredMark)
1490
+ })), /* @__PURE__ */ n.createElement(c.PostalCode.Control, {
1491
+ className: Le.postalCodeControl
1492
+ }, /* @__PURE__ */ n.createElement(c.PostalCode.Control.Input, {
1493
+ className: b(G, p.input)
1494
+ })), /* @__PURE__ */ n.createElement(c.PostalCode.Options, {
1495
+ className: b(Ie, p.selectPopover, p.dropdownPopover)
1496
+ }, /* @__PURE__ */ n.createElement(c.PostalCode.Options.Option, {
1497
+ className: b(p.selectOption, me)
1498
+ })), /* @__PURE__ */ n.createElement(c.PostalCode.Error, {
1499
+ className: b(Q, p.error)
1500
+ }, /* @__PURE__ */ n.createElement(J, null), /* @__PURE__ */ n.createElement(c.PostalCode.Error.Text, null)), /* @__PURE__ */ n.createElement(c.PostalCode.Description, {
1501
+ className: b(Z, p.description)
1502
+ }, ({ content: e, locale: t }) => /* @__PURE__ */ n.createElement(j, {
1503
+ content: e,
1504
+ locale: t
1505
+ }))), /* @__PURE__ */ n.createElement(c.Subdivision, null, /* @__PURE__ */ n.createElement(c.Subdivision.Label, {
1506
+ className: b(X, p.label)
1507
+ }, /* @__PURE__ */ n.createElement(c.Subdivision.Label.Required, {
1508
+ className: b(z, p.requiredMark)
1509
+ })), /* @__PURE__ */ n.createElement(c.Subdivision.Control, {
1510
+ className: b(G, p.input, Le.comboControl)
1511
+ }, /* @__PURE__ */ n.createElement(c.Subdivision.Control.Input, {
1512
+ className: b(p.innerInput, me)
1513
+ }), /* @__PURE__ */ n.createElement(c.Subdivision.Control.Trigger, {
1514
+ className: Le.comboTrigger
1515
+ }, /* @__PURE__ */ n.createElement(nt, {
1516
+ className: p.dropdownIcon
1517
+ }))), /* @__PURE__ */ n.createElement(c.Subdivision.Options, {
1518
+ className: b(Ie, p.selectPopover, p.dropdownPopover)
1519
+ }, /* @__PURE__ */ n.createElement(c.Subdivision.Options.Option, {
1520
+ className: b(p.selectOption, me)
1521
+ })), /* @__PURE__ */ n.createElement(c.Subdivision.Error, {
1522
+ className: b(Q, p.error)
1523
+ }, /* @__PURE__ */ n.createElement(J, null), /* @__PURE__ */ n.createElement(c.Subdivision.Error.Text, null)), /* @__PURE__ */ n.createElement(c.Subdivision.Description, {
1524
+ className: b(Z, p.description)
1525
+ }, ({ content: e, locale: t }) => /* @__PURE__ */ n.createElement(j, {
1526
+ content: e,
1527
+ locale: t
1528
+ }))), /* @__PURE__ */ n.createElement(c.StreetName, null, /* @__PURE__ */ n.createElement(c.StreetName.Label, {
1529
+ className: b(X, p.label)
1530
+ }, /* @__PURE__ */ n.createElement(c.StreetName.Label.Required, {
1531
+ className: b(z, p.requiredMark)
1532
+ })), /* @__PURE__ */ n.createElement(c.StreetName.Input, {
1533
+ className: b(G, p.input)
1534
+ }), /* @__PURE__ */ n.createElement(c.StreetName.Options, {
1535
+ className: b(Ie, p.selectPopover, p.dropdownPopover)
1536
+ }, /* @__PURE__ */ n.createElement(c.StreetName.Options.Option, {
1537
+ className: b(p.selectOption, me)
1538
+ })), /* @__PURE__ */ n.createElement(c.StreetName.Error, {
1539
+ className: b(Q, p.error)
1540
+ }, /* @__PURE__ */ n.createElement(J, null), /* @__PURE__ */ n.createElement(c.StreetName.Error.Text, null)), /* @__PURE__ */ n.createElement(c.StreetName.Description, {
1541
+ className: b(Z, p.description)
1542
+ }, ({ content: e, locale: t }) => /* @__PURE__ */ n.createElement(j, {
1543
+ content: e,
1544
+ locale: t
1545
+ }))), /* @__PURE__ */ n.createElement(c.StreetNumber, null, /* @__PURE__ */ n.createElement(c.StreetNumber.Label, {
1546
+ className: b(X, p.label)
1547
+ }, /* @__PURE__ */ n.createElement(c.StreetNumber.Label.Required, {
1548
+ className: b(z, p.requiredMark)
1549
+ })), /* @__PURE__ */ n.createElement(c.StreetNumber.Input, {
1550
+ className: b(G, p.input)
1551
+ }), /* @__PURE__ */ n.createElement(c.StreetNumber.Error, {
1552
+ className: b(Q, p.error)
1553
+ }, /* @__PURE__ */ n.createElement(J, null), /* @__PURE__ */ n.createElement(c.StreetNumber.Error.Text, null)), /* @__PURE__ */ n.createElement(c.StreetNumber.Description, {
1554
+ className: b(Z, p.description)
1555
+ }, ({ content: e, locale: t }) => /* @__PURE__ */ n.createElement(j, {
1556
+ content: e,
1557
+ locale: t
1558
+ }))), /* @__PURE__ */ n.createElement(c.Apartment, null, /* @__PURE__ */ n.createElement(c.Apartment.Label, {
1559
+ className: b(X, p.label)
1560
+ }, /* @__PURE__ */ n.createElement(c.Apartment.Label.Required, {
1561
+ className: b(z, p.requiredMark)
1562
+ })), /* @__PURE__ */ n.createElement(c.Apartment.Input, {
1563
+ className: b(G, p.input)
1564
+ }), /* @__PURE__ */ n.createElement(c.Apartment.Error, {
1565
+ className: b(Q, p.error)
1566
+ }, /* @__PURE__ */ n.createElement(J, null), /* @__PURE__ */ n.createElement(c.Apartment.Error.Text, null)), /* @__PURE__ */ n.createElement(c.Apartment.Description, {
1567
+ className: b(Z, p.description)
1568
+ }, ({ content: e, locale: t }) => /* @__PURE__ */ n.createElement(j, {
1569
+ content: e,
1570
+ locale: t
1571
+ }))));
1572
+ export {
1573
+ gr as M
1574
+ };