@wix/form-elements 1.125.0 → 1.127.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 (113) hide show
  1. package/dist/component/{appointment-rac-Z-zuUkSk.js → appointment-rac-BrC7gcpn.js} +5 -5
  2. package/dist/component/{bookings-address-rac-CKDBaGLn.js → bookings-address-rac-D-UmBxjD.js} +1 -1
  3. package/dist/component/{bookings-email-rac-D4aI_Jzq.js → bookings-email-rac-CjHDzU0Q.js} +1 -1
  4. package/dist/component/{bookings-first-name-rac-zzQHBi06.js → bookings-first-name-rac-ChBkkkWm.js} +1 -1
  5. package/dist/component/{bookings-header-rac-Ck8ODZZj.js → bookings-header-rac-ERfGeYyw.js} +1 -1
  6. package/dist/component/{bookings-last-name-rac-Bf6GZjrX.js → bookings-last-name-rac-CuTJ7Y8w.js} +1 -1
  7. package/dist/component/{bookings-login-bar-rac-DFDj9-BP.js → bookings-login-bar-rac-pudlQ67l.js} +6 -6
  8. package/dist/component/{bookings-phone-rac-Bv1-qlMw.js → bookings-phone-rac-nLPnLRfS.js} +1 -1
  9. package/dist/component/{bookings-rich-text-rac-D7B-s_XR.js → bookings-rich-text-rac-DOmGQlyG.js} +1 -1
  10. package/dist/component/{checkbox-field-rac-CiKYZvTz.js → checkbox-field-rac-DLazY-iO.js} +86 -86
  11. package/dist/component/{checkbox-group-field-headless-CV6U8eSj.js → checkbox-group-field-headless-CPyWmFBH.js} +3 -3
  12. package/dist/component/{checkbox-group-field-rac-BQlPsFkN.js → checkbox-group-field-rac-Bir3gaI9.js} +6 -6
  13. package/dist/component/{checkbox-group-rac-DS3C_O04.js → checkbox-group-rac-BGXUl-sJ.js} +1 -1
  14. package/dist/component/{checkbox-indicator-module-classes-DOAYUQ_Q.js → checkbox-indicator-module-classes-Bqo0QILF.js} +1 -1
  15. package/dist/component/{checkbox-rac-dUEfjEya.js → checkbox-rac-D_wZVUFV.js} +1 -1
  16. package/dist/component/{contacts-address-rac-CpszOK8V.js → contacts-address-rac-CNldSQbf.js} +1 -1
  17. package/dist/component/{contacts-birthdate-rac-8VQHFq-M.js → contacts-birthdate-rac-AVyldaRF.js} +1 -1
  18. package/dist/component/{contacts-company-rac-BOBr0Kk7.js → contacts-company-rac-CiP1Ctpa.js} +1 -1
  19. package/dist/component/{contacts-email-rac-CTLHE5HL.js → contacts-email-rac-CzjMVEJZ.js} +1 -1
  20. package/dist/component/{contacts-first-name-rac-nYNH569s.js → contacts-first-name-rac-G0kE0HmA.js} +1 -1
  21. package/dist/component/{contacts-last-name-rac-BX1D0mI7.js → contacts-last-name-rac-cnTTtnMZ.js} +1 -1
  22. package/dist/component/{contacts-phone-rac-DKbEfOsH.js → contacts-phone-rac-DJ9oxox4.js} +1 -1
  23. package/dist/component/{contacts-position-rac-B0y-O-4j.js → contacts-position-rac-e0uQ-eqL.js} +1 -1
  24. package/dist/component/{contacts-subscribe-rac-5yYJn7F0.js → contacts-subscribe-rac-D4J2x78f.js} +1 -1
  25. package/dist/component/{contacts-tax-id-rac-BB5ngpkv.js → contacts-tax-id-rac-DwJuNH-C.js} +1 -1
  26. package/dist/component/{date-availability-C87SaTKG.js → date-availability-D2BSwZ_r.js} +1 -1
  27. package/dist/component/{date-input-field-rac-CS8QQO3m.js → date-input-field-rac-ztJ02C60.js} +42 -42
  28. package/dist/component/{date-input-rac-VHB7v5UL.js → date-input-rac-D-SFsC6P.js} +1 -1
  29. package/dist/component/{date-picker-field-rac-Cri5p6Ms.js → date-picker-field-rac-DaNwsa8z.js} +15 -15
  30. package/dist/component/{date-picker-rac-B57G3x5E.js → date-picker-rac-Bn0sA6P1.js} +1 -1
  31. package/dist/component/{date-time-input-field-rac-4Qka-NnP.js → date-time-input-field-rac-D-ArMpcJ.js} +64 -64
  32. package/dist/component/{date-time-input-rac-DGCjjMFb.js → date-time-input-rac-qYLa3IDx.js} +1 -1
  33. package/dist/component/{dext-checkbox-group-rac-DWvCwPTc.js → dext-checkbox-group-rac-Dir6tyvo.js} +2 -2
  34. package/dist/component/{dext-checkbox-rac-33LSTC36.js → dext-checkbox-rac-ByiMc3BH.js} +1 -1
  35. package/dist/component/{dext-date-picker-rac-Bf7NykP3.js → dext-date-picker-rac-BwOozu5y.js} +1 -1
  36. package/dist/component/{dext-date-time-input-rac-Bao0DdBz.js → dext-date-time-input-rac-CaJEzZa4.js} +1 -1
  37. package/dist/component/{dext-dropdown-rac-DmcOs3JV.js → dext-dropdown-rac-DJnMjggU.js} +1 -1
  38. package/dist/component/{dext-email-rac-BQZuGJyR.js → dext-email-rac-CF4SQ86l.js} +1 -1
  39. package/dist/component/{dext-number-input-rac-BkRW3syI.js → dext-number-input-rac--3goVI8C.js} +1 -1
  40. package/dist/component/{dext-phone-rac-BQTtIO3M.js → dext-phone-rac-MYJYG040.js} +1 -1
  41. package/dist/component/{dext-radio-group-rac-8OX3bK1R.js → dext-radio-group-rac-Q2J5Hk5W.js} +4 -4
  42. package/dist/component/{dext-rating-input-rac-DzsAbe6_.js → dext-rating-input-rac-CAWhD-lI.js} +1 -1
  43. package/dist/component/{dext-tags-rac-vBL9kqB4.js → dext-tags-rac-DyxI5ooy.js} +4 -4
  44. package/dist/component/{dext-text-area-rac-DnaX_wQ4.js → dext-text-area-rac-CZpM-r49.js} +1 -1
  45. package/dist/component/{dext-text-input-rac-D94mFw2C.js → dext-text-input-rac-Bv5Mhyw6.js} +1 -1
  46. package/dist/component/{dext-url-input-rac-BbGsxHGa.js → dext-url-input-rac-BkbTjbAI.js} +1 -1
  47. package/dist/component/{donation-rac-BMSQOEKY.js → donation-rac-DZjFeJFy.js} +36 -36
  48. package/dist/component/{dropdown-field-headless-DfV7Hu_x.js → dropdown-field-headless-C7l2TQYy.js} +16 -16
  49. package/dist/component/{dropdown-field-rac-DV8KVcfL.js → dropdown-field-rac-DOAlecw8.js} +5 -5
  50. package/dist/component/{dropdown-rac-CWxp-u5t.js → dropdown-rac-D8HtaeBe.js} +1 -1
  51. package/dist/component/{ecom-address-rac-DDUa9lKf.js → ecom-address-rac-B25o-GVv.js} +1 -1
  52. package/dist/component/{ecom-subscription-checkbox-rac-C6Bl1HwZ.js → ecom-subscription-checkbox-rac-NvdWnD0v.js} +2 -2
  53. package/dist/component/{email-input-field-rac-DssxRa6A.js → email-input-field-rac-rWyojsu0.js} +19 -19
  54. package/dist/component/{events-repeater-rac-C-Y70-hO.js → events-repeater-rac-D2HvNt0y.js} +11 -11
  55. package/dist/component/{events-rsvp-rac-CH8cmC73.js → events-rsvp-rac-D4WLn0Bx.js} +4 -4
  56. package/dist/component/{field-error-headless-B-dJmWQP.js → field-error-headless-DU0YsEXR.js} +6 -6
  57. package/dist/component/{field-label-headless-BMozN-s1.js → field-label-headless-CvdTZi6i.js} +1 -1
  58. package/dist/component/field-rac.module-BIBNQEOK.js +25 -0
  59. package/dist/component/{file-upload-rac-q-JbJbUf.js → file-upload-rac-CMelyfA8.js} +68 -68
  60. package/dist/component/{fixed-payment-rac-BUeec_59.js → fixed-payment-rac-CewsqE-k.js} +9 -9
  61. package/dist/component/{form-D_BE2Fzt.js → form-D9IxiDXP.js} +2400 -2346
  62. package/dist/component/form.css +1 -1
  63. package/dist/component/form.js +3 -3
  64. package/dist/component/{header-field-rac-DWDGXZ-1.js → header-field-rac-CYBfb_5D.js} +6 -6
  65. package/dist/component/{header-rac-DSJRq-aS.js → header-rac-BIq3DmbL.js} +1 -1
  66. package/dist/component/{image-choice-rac-CZhE0M_b.js → image-choice-rac-aOObRIMi.js} +12 -12
  67. package/dist/component/{index-COa1NdN9.js → index-BXqA4oNj.js} +15 -15
  68. package/dist/component/{index-CbQKmL2D.js → index-D-g3wQ-z.js} +43 -43
  69. package/dist/component/{isObjectLike-OXbnWiQZ.js → isObjectLike-BNDXzCto.js} +7 -7
  70. package/dist/component/{multiline-address-field-rac-uwvOu2s8.js → multiline-address-field-rac-BcTa7Von.js} +8 -8
  71. package/dist/component/{multiline-address-rac-dechT7TO.js → multiline-address-rac-Cd_BFreP.js} +1 -1
  72. package/dist/component/{number-input-field-rac-Dzd1zIZ3.js → number-input-field-rac-_JlH34_3.js} +9 -9
  73. package/dist/component/{number-input-rac-CEkIm28k.js → number-input-rac-CiM20ScT.js} +1 -1
  74. package/dist/component/{password-rac-CWitmbZm.js → password-rac-DrpXSY74.js} +32 -32
  75. package/dist/component/{payment-input-rac-CM0uC5on.js → payment-input-rac-RnMeVWDc.js} +15 -15
  76. package/dist/component/{phone-input-field-rac-fWGQuICi.js → phone-input-field-rac-nNp7D7gK.js} +39 -39
  77. package/dist/component/{phone-rac-Yz8_o8zI.js → phone-rac-B2JjPT2w.js} +1 -1
  78. package/dist/component/{product-list-rac-CEWFFKC_.js → product-list-rac-Cv_fjFn3.js} +28 -28
  79. package/dist/component/{quiz-radio-group-rac-D0x2dT8O.js → quiz-radio-group-rac-CNqF6Tq3.js} +1 -1
  80. package/dist/component/{radio-button-module-classes-ByzyRWGZ.js → radio-button-module-classes-vqR4TN-z.js} +3 -3
  81. package/dist/component/{radio-group-field-rac-Bp-gAa8G.js → radio-group-field-rac-Bpyr40q-.js} +5 -5
  82. package/dist/component/{radio-group-rac-v2iHQ7Do.js → radio-group-rac-DBLPP0YC.js} +1 -1
  83. package/dist/component/{rating-input-field-rac-Cy2FMWGM.js → rating-input-field-rac-BOi0G37L.js} +10 -10
  84. package/dist/component/{rating-input-rac-BbVp3WB3.js → rating-input-rac-CxpmV0Pa.js} +1 -1
  85. package/dist/component/{rich-content-rac.module-CD6SVCbh.js → rich-content-rac.module-Dmm9GyQq.js} +1 -1
  86. package/dist/component/{rich-text-field-rac-BpNrx6yp.js → rich-text-field-rac-C466OrTf.js} +9 -9
  87. package/dist/component/{rich-text-rac-Dhy7uiP1.js → rich-text-rac-BvVxD7oJ.js} +1 -1
  88. package/dist/component/{service-dropdown-rac-CAneRKHw.js → service-dropdown-rac-pmUKH0sP.js} +14 -14
  89. package/dist/component/{services-multi-choice-rac-D6sXFbh-.js → services-multi-choice-rac-B65i6q2D.js} +7 -7
  90. package/dist/component/signature-rac-BRyM06Vz.js +918 -0
  91. package/dist/component/{submit-button-rac-BXXTjOsT.js → submit-button-rac-DaCRjZlQ.js} +15 -15
  92. package/dist/component/{tags-field-rac-C5UfRny_.js → tags-field-rac-CEdfh-EQ.js} +17 -17
  93. package/dist/component/{tags-rac-B9CeCJ7N.js → tags-rac-CGSTQ0qK.js} +1 -1
  94. package/dist/component/{text-area-field-rac-CPRcMTLB.js → text-area-field-rac-C-EHPWwQ.js} +15 -15
  95. package/dist/component/{text-area-rac-DTP1F7-n.js → text-area-rac-Df1nSb2q.js} +1 -1
  96. package/dist/component/{text-input-field-rac-BNWvKfLB.js → text-input-field-rac-DmCZtBi_.js} +4 -4
  97. package/dist/component/{text-input-headless-CLQsDBPq.js → text-input-headless-DAxEZP1P.js} +8 -8
  98. package/dist/component/{text-input-rac-D-x0vJ11.js → text-input-rac-DgpO17dl.js} +1 -1
  99. package/dist/component/{time-input-rac-CDyfV8is.js → time-input-rac-Dld_tLub.js} +10 -10
  100. package/dist/component/{url-input-field-rac-DS-y2pYu.js → url-input-field-rac-DHZ6bpxZ.js} +10 -10
  101. package/dist/component/{url-input-rac-mPuawQc5.js → url-input-rac-CZlWy5RB.js} +1 -1
  102. package/dist/component/{use-dropdown-option-class-name-C8fUy9a7.js → use-dropdown-option-class-name-opBd-YJA.js} +3 -3
  103. package/dist/component/{use-dropdown-trigger-class-name-TB7azWxx.js → use-dropdown-trigger-class-name-BGQH0WCO.js} +10 -10
  104. package/dist/component/use-element-state-class-name-B2ecLjwN.js +20 -0
  105. package/dist/component/{use-hoverable-input-class-name-Dd0kMkOT.js → use-hoverable-input-class-name-B42rAp82.js} +3 -3
  106. package/dist/component/{use-service-options-base-CZXMLBQ0.js → use-service-options-base-D60-jNUT.js} +4 -4
  107. package/dist/component/use-text-input-class-name-DGpCdZ_e.js +6 -0
  108. package/dist/form.d.ts +11 -1
  109. package/package.json +23 -23
  110. package/dist/component/field-rac.module-DQxyEwK7.js +0 -26
  111. package/dist/component/signature-rac-D_mfewhJ.js +0 -794
  112. package/dist/component/use-element-state-class-name-BUWRj3G2.js +0 -22
  113. package/dist/component/use-text-input-class-name-BJ6Qm1bq.js +0 -6
@@ -0,0 +1,918 @@
1
+ import s, { useRef as V, useContext as Ae, useMemo as be, useCallback as v, useState as ne, useEffect as oe, Children as we, isValidElement as Le } from "react";
2
+ import Fe from "@wix/editor-react-components/AnimatedIcon";
3
+ import { RicosViewer as xe } from "@wix/ricos/viewer";
4
+ import w from "classnames";
5
+ import { aL as Ue, bb as Te, an as Oe, F as Pe, bd as Be, b9 as Me, bp as Ce, E as me, ad as ee, bh as U, be as M, bj as Ie, br as He, ba as We, I as Ye, U as Ze, X as ke, p as pe, b as Ve, a0 as Ge, a1 as fe, v as $e, W as ze, _ as Xe, Y as qe, $ as je, f as K, Z as Je } from "./form-D9IxiDXP.js";
6
+ import { useHover as Ke, useFocusRing as Qe, mergeProps as et } from "react-aria";
7
+ import { RadioGroup as tt, Button as ye, TextField as nt, DropZone as at, Input as ot, FileTrigger as rt, RadioField as st, RadioButton as lt } from "react-aria-components";
8
+ import _e from "signature_pad";
9
+ import { f as I, a as A } from "./find-child-C60k4CxG.js";
10
+ import { D as it, E as ct } from "./field-error-headless-DU0YsEXR.js";
11
+ import { L as ut } from "./field-label-headless-CvdTZi6i.js";
12
+ import { D as dt } from "./data-hooks-Dkw1pbRj.js";
13
+ import { E as mt } from "./error-icon-hZxQ6DEy.js";
14
+ import { s as Q } from "./field-rac.module-BIBNQEOK.js";
15
+ import { u as $ } from "./use-element-state-class-name-B2ecLjwN.js";
16
+ const pt = typeof s.useId == "function" ? s.useId : () => V(Ue()).current, ft = ({ properties: e }) => e.uploadEnabled === !0, Et = (e, t) => e.fieldType === Pe.SIGNATURE && !e.properties.hidden && !e.properties.disabled && !e.properties.readOnly && (t !== "upload" || ft(e)), ht = (e, t) => e.layout.row - t.layout.row || e.layout.column - t.layout.column, gt = (e) => {
17
+ var o;
18
+ const t = (o = Te().signatureContainer) == null ? void 0 : o.signatureMode, a = Ae(Oe);
19
+ return be(() => {
20
+ var r;
21
+ return a && !a.parentId && t ? (r = a.fields.filter((l) => Et(l, t)).sort(ht)[0]) == null ? void 0 : r.id : void 0;
22
+ }, [
23
+ a,
24
+ t
25
+ ]) === e ? t : void 0;
26
+ };
27
+ var N = /* @__PURE__ */ (function(e) {
28
+ return e.TEXT = "text/plain", e.POINTS = "points/json", e;
29
+ })({}), C = /* @__PURE__ */ (function(e) {
30
+ return e.DRAW = "draw", e.TYPE = "type", e.UPLOAD = "upload", e;
31
+ })({}), S = /* @__PURE__ */ (function(e) {
32
+ return e.DRAW = "draw", e.TYPE = "type", e.IMAGE = "image", e.UPLOAD = "upload", e;
33
+ })({});
34
+ const bt = (e) => {
35
+ const { actions: t, formId: a } = Be(), n = t == null ? void 0 : t.uploadFile;
36
+ return v(async (o) => {
37
+ if (!n)
38
+ throw new Error("No uploadFile action");
39
+ const r = await n({
40
+ file: o,
41
+ formId: a,
42
+ uploadTarget: e
43
+ }), { id: l, displayName: i, url: c, isPrivate: u } = r;
44
+ return {
45
+ fileId: l,
46
+ displayName: i || o.name,
47
+ url: u ? void 0 : c,
48
+ fileType: o.type
49
+ };
50
+ }, [
51
+ n,
52
+ a,
53
+ e
54
+ ]);
55
+ };
56
+ function Lt(e) {
57
+ const a = z(1, 1).getContext("2d");
58
+ a.fillStyle = e, a.fillRect(0, 0, 1, 1);
59
+ const n = a.getImageData(0, 0, 1, 1);
60
+ return n.data[0] * 65536 + n.data[1] * 256 + n.data[2];
61
+ }
62
+ const Tt = (e, t) => {
63
+ const a = Lt(e);
64
+ return (n, o) => {
65
+ const r = (o * t.width + n) * 4;
66
+ return t.data[r] * 65536 + t.data[r + 1] * 256 + t.data[r + 2] === a;
67
+ };
68
+ }, Ct = (e) => (t, a) => {
69
+ const n = (a * e.width + t) * 4;
70
+ return e.data[n + 3] === 0;
71
+ };
72
+ function ae(e, t) {
73
+ const a = e.getContext("2d", {
74
+ willReadFrequently: !0
75
+ }), n = e.width, o = e.height, r = a.getImageData(0, 0, n, o), l = t ? Tt(t, r) : Ct(r);
76
+ let i = n + 1, c = -1, u = o + 1, d = -1, E = 0, m = 0;
77
+ for (m = 0; m < o; m++)
78
+ for (E = 0; E < n; E++)
79
+ l(E, m) || (i > E && (i = E), c < E && (c = E), u > m && (u = m), d < m && (d = m));
80
+ const h = c - i, b = d - u;
81
+ if (h < 0 || b < 0)
82
+ return null;
83
+ const p = a.getImageData(i, u, h, b), f = document.createElement("canvas"), L = f.getContext("2d");
84
+ return f.width = h, f.height = b, t ? (L.fillStyle = t, L.fillRect(0, 0, h, b)) : L.clearRect(0, 0, h, b), L.putImageData(p, 0, 0), f;
85
+ }
86
+ function z(e, t, a) {
87
+ const n = document.createElement("canvas");
88
+ if (n.width = e, n.height = t, a) {
89
+ const o = n.getContext("2d", {
90
+ willReadFrequently: !0
91
+ });
92
+ o == null || o.scale(a, a);
93
+ }
94
+ return n;
95
+ }
96
+ function It(e, t) {
97
+ return new Promise((a, n) => {
98
+ const o = new Image();
99
+ o.onload = () => {
100
+ const r = z(o.width, o.height), l = r.getContext("2d", {
101
+ willReadFrequently: !0
102
+ });
103
+ l == null || l.drawImage(o, 0, 0), a(r);
104
+ }, o.onerror = n, o.src = e;
105
+ });
106
+ }
107
+ function Ee(e, t, a, n) {
108
+ const o = e.width, r = e.height, l = 1, i = a / r, c = Math.min(i, l), u = o * c, d = r * c, E = z(u, d), m = E.getContext("2d");
109
+ return n && m && (m.fillStyle = n, m.fillRect(0, 0, u, d)), m == null || m.drawImage(e, 0, 0, o, r, 0, 0, u, d), E;
110
+ }
111
+ function he(e, t) {
112
+ const a = e.getContext("2d"), n = e.offsetWidth, o = e.offsetHeight, r = Math.max(window.devicePixelRatio || 1, 1), l = n * r, i = o * r;
113
+ return (e.width !== l || e.height !== i) && a ? (e.width = l, e.height = i, a.scale(r, r), t == null || t.redraw(), !0) : !1;
114
+ }
115
+ const k = 480, yt = (e) => Re({
116
+ data: JSON.stringify(e),
117
+ mimeType: N.POINTS
118
+ }), ve = (e) => {
119
+ const t = H(e);
120
+ if ((t == null ? void 0 : t.mimeType) === N.POINTS)
121
+ try {
122
+ return JSON.parse(t.data);
123
+ } catch {
124
+ return null;
125
+ }
126
+ return null;
127
+ }, ge = 0.8, De = "Madefor";
128
+ function Ne(e, t) {
129
+ const { width: a, actualBoundingBoxAscent: n, actualBoundingBoxDescent: o } = t.measureText(e);
130
+ return {
131
+ width: a,
132
+ height: n + o,
133
+ offsetY: n
134
+ };
135
+ }
136
+ function _t(e, t) {
137
+ const a = t.getContext("2d"), n = t.offsetWidth || t.width, r = (t.offsetHeight || t.height) * ge, l = n * ge;
138
+ a.font = `${r}px ${De}`;
139
+ const { width: i, height: c } = Ne(e, a), u = r / (i / l), d = r / (c / r);
140
+ return Math.min(u, d);
141
+ }
142
+ function vt(e, t, a = "black", n = !1, o) {
143
+ const r = e.getContext("2d"), l = _t(t, e);
144
+ r.font = `${l}px ${De}`, r.textBaseline = "top";
145
+ const i = e.offsetWidth || e.width, c = e.offsetHeight || e.height, { width: u, height: d, offsetY: E } = Ne(t, r);
146
+ r.fillStyle = o, r.fillRect(0, 0, i, c), r.fillStyle = a;
147
+ const m = (i - u) / 2;
148
+ r.fillText(t, n ? i - m : m, (c - d) / 2 + E);
149
+ }
150
+ const Se = /^data:([^;,]+)(?:;([^,]+))?,(.+)$/;
151
+ function Dt(e) {
152
+ return Se.test(e);
153
+ }
154
+ function H(e) {
155
+ if (!e)
156
+ return;
157
+ const t = e.match(Se);
158
+ if (!t)
159
+ return;
160
+ const [, a, n, o] = t;
161
+ return {
162
+ data: n === "base64" ? atob(o) : decodeURI(o),
163
+ mimeType: a,
164
+ encoding: n
165
+ };
166
+ }
167
+ function Re({ data: e, mimeType: t, encoding: a = "text" }) {
168
+ const n = a === "base64" ? btoa(e) : encodeURI(e);
169
+ return `data:${a === "base64" ? `${t};base64` : t},${n}`;
170
+ }
171
+ function Nt(e, t) {
172
+ const a = H(e);
173
+ if (!a)
174
+ return;
175
+ let n = a.data.length;
176
+ const o = new Uint8Array(n);
177
+ for (; n--; )
178
+ o[n] = a.data.charCodeAt(n);
179
+ const r = a.mimeType.split("/")[1] ?? "txt";
180
+ return new File([
181
+ o
182
+ ], `${t}.${r}`, {
183
+ type: a.mimeType
184
+ });
185
+ }
186
+ function re(e, t = "temp") {
187
+ const a = H(e);
188
+ return {
189
+ fileId: "temp",
190
+ displayName: t,
191
+ url: e,
192
+ fileType: (a == null ? void 0 : a.mimeType) ?? ""
193
+ };
194
+ }
195
+ async function St(e, t) {
196
+ const a = H(e);
197
+ if (!a)
198
+ return e;
199
+ const n = a.mimeType;
200
+ if (n === N.TEXT) {
201
+ const o = z(k * 20, k, 1);
202
+ vt(o, a.data, "black", t, "white");
203
+ const r = ae(o, "white");
204
+ return (r == null ? void 0 : r.toDataURL("image/jpeg", 0.7)) ?? null;
205
+ }
206
+ if (n === N.POINTS) {
207
+ const o = ve(e);
208
+ if (!o)
209
+ return null;
210
+ const r = o.map((d) => ({
211
+ ...d,
212
+ penColor: "black"
213
+ })), l = z(k * 20, k, Math.max(window.devicePixelRatio || 1, 1));
214
+ new _e(l).fromData(r);
215
+ const c = ae(l);
216
+ return c ? Ee(c, void 0, k, "white").toDataURL("image/jpeg", 0.7) : null;
217
+ }
218
+ if (n != null && n.startsWith("image/")) {
219
+ const o = await It(e), r = ae(o);
220
+ return r ? Ee(r, void 0, k).toDataURL("image/jpeg", 0.7) : null;
221
+ }
222
+ return e;
223
+ }
224
+ async function Rt(e, t) {
225
+ const a = await St(e, t);
226
+ if (a)
227
+ return Nt(a, "signature");
228
+ }
229
+ const At = ({ value: e, onChange: t, target: a }) => {
230
+ const [n, o] = ne(e), { isRTL: r } = Me(), l = bt(a), { setFormStatus: i } = Ce(), c = V();
231
+ oe(() => {
232
+ e === me && o(me);
233
+ }, [
234
+ e
235
+ ]);
236
+ const u = v(() => {
237
+ c.current && (clearTimeout(c.current), c.current = null);
238
+ }, []), d = n == null ? void 0 : n[0], E = d != null && d.url ? H(d.url) : void 0, m = v(async (b) => {
239
+ try {
240
+ const p = (b == null ? void 0 : b.url) ?? "";
241
+ if (Dt(p)) {
242
+ const f = await Rt(p, r);
243
+ if (f) {
244
+ const L = await l(f);
245
+ t([
246
+ L
247
+ ]);
248
+ } else
249
+ o(void 0), t(void 0);
250
+ }
251
+ c.current = null;
252
+ } finally {
253
+ i(a, ee.READY);
254
+ }
255
+ }, [
256
+ i,
257
+ a,
258
+ r,
259
+ l,
260
+ t
261
+ ]);
262
+ return {
263
+ handleChange: v((b) => {
264
+ const p = (f) => {
265
+ c.current = setTimeout(() => m(f), 1500);
266
+ };
267
+ b ? (c.current && (clearTimeout(c.current), c.current = null), o([
268
+ b
269
+ ]), p(b)) : (t == null || t(null), o(void 0), i(a, ee.READY));
270
+ }, [
271
+ m,
272
+ t,
273
+ i,
274
+ a
275
+ ]),
276
+ signature: d,
277
+ decodedValue: E,
278
+ cancelUpload: u
279
+ };
280
+ }, wt = ({ target: e, value: t, onChange: a }) => {
281
+ const { handleChange: n, cancelUpload: o, signature: r, decodedValue: l } = At({
282
+ value: t,
283
+ onChange: a,
284
+ target: e
285
+ }), [i, c] = ne(() => {
286
+ if (r == null)
287
+ return C.DRAW;
288
+ switch (l == null ? void 0 : l.mimeType) {
289
+ case N.POINTS:
290
+ return C.DRAW;
291
+ case N.TEXT:
292
+ return C.TYPE;
293
+ default:
294
+ return C.UPLOAD;
295
+ }
296
+ }), { setFormStatus: u } = Ce(), d = v(() => {
297
+ o(), u(e, ee.BUSY);
298
+ }, [
299
+ o,
300
+ u,
301
+ e
302
+ ]), E = v(() => {
303
+ o(), n(null), u(e, ee.READY);
304
+ }, [
305
+ o,
306
+ n,
307
+ u,
308
+ e
309
+ ]), m = r != null, h = xt(i, r, l), b = (() => {
310
+ switch (i) {
311
+ case C.DRAW:
312
+ return S.DRAW;
313
+ case C.TYPE:
314
+ return S.TYPE;
315
+ case C.UPLOAD:
316
+ return h != null ? S.IMAGE : S.UPLOAD;
317
+ default:
318
+ return S.DRAW;
319
+ }
320
+ })();
321
+ return {
322
+ signature: r,
323
+ decodedValue: l,
324
+ signatureMode: i,
325
+ clearable: m,
326
+ signatureValueForView: h,
327
+ signatureView: b,
328
+ handleChange: n,
329
+ setSignatureMode: c,
330
+ handleBeforeChange: d,
331
+ handleClear: E
332
+ };
333
+ }, Ft = {
334
+ [C.DRAW]: (e) => (e == null ? void 0 : e.mimeType) === N.POINTS,
335
+ [C.TYPE]: (e) => (e == null ? void 0 : e.mimeType) === N.TEXT,
336
+ [C.UPLOAD]: (e) => (e == null ? void 0 : e.mimeType) !== N.POINTS && (e == null ? void 0 : e.mimeType) !== N.TEXT
337
+ };
338
+ function xt(e, t, a) {
339
+ return t && Ft[e](a) ? t : void 0;
340
+ }
341
+ const Ut = (e) => {
342
+ const t = e.url ? H(e.url) : void 0;
343
+ return t ? t.mimeType !== N.POINTS && t.mimeType !== N.TEXT : !0;
344
+ }, se = () => {
345
+ const { hoverProps: e, isHovered: t } = Ke({}), { focusProps: a, isFocused: n, isFocusVisible: o } = Qe({
346
+ within: !0
347
+ });
348
+ return {
349
+ ...et(e, a),
350
+ "data-hovered": t || void 0,
351
+ "data-focus-within": n || void 0,
352
+ "data-focus-visible": o || void 0
353
+ };
354
+ }, g = ({ children: e }) => {
355
+ const { id: t, FieldLayout: a } = U(), n = I(e, g.Label), o = I(e, g.Input), r = I(e, g.Description), l = I(e, g.Error);
356
+ return /* @__PURE__ */ s.createElement(a, {
357
+ fieldId: t,
358
+ renderLabel: () => n,
359
+ renderInput: () => o,
360
+ renderDescription: () => /* @__PURE__ */ s.createElement(s.Fragment, null, l, r)
361
+ });
362
+ }, Ot = {
363
+ [C.DRAW]: S.DRAW,
364
+ [C.TYPE]: S.TYPE,
365
+ [C.UPLOAD]: S.UPLOAD
366
+ }, X = ({ children: e, className: t }) => {
367
+ const { id: a, value: n, onChange: o, target: r, readOnly: l } = U(), i = gt(a), { signatureMode: c, setSignatureMode: u, handleClear: d, clearable: E, signatureView: m, signatureValueForView: h, handleChange: b, handleBeforeChange: p } = wt({
368
+ target: r,
369
+ value: n,
370
+ onChange: o
371
+ }), f = I(e, X.Header), L = I(e, X.Value), R = {
372
+ signatureMode: i ?? c,
373
+ setSignatureMode: u,
374
+ handleClear: d,
375
+ clearable: E,
376
+ signatureView: i ? Ot[i] : m,
377
+ signatureValueForView: i ? void 0 : h,
378
+ handleChange: b,
379
+ handleBeforeChange: p
380
+ };
381
+ return /* @__PURE__ */ s.createElement("div", {
382
+ className: t,
383
+ "data-hook": "signature-container"
384
+ }, !l && A(f, R), A(L, R));
385
+ }, q = ({ children: e, className: t, ...a }) => {
386
+ const { signatureMode: n, setSignatureMode: o, clearable: r, handleClear: l } = a, { uploadEnabled: i } = U(), c = I(e, q.Tabs), u = I(e, q.Clear);
387
+ return /* @__PURE__ */ s.createElement("div", {
388
+ className: t
389
+ }, A(c, {
390
+ signatureMode: n,
391
+ setSignatureMode: o,
392
+ uploadEnabled: i
393
+ }), r && A(u, {
394
+ handleClear: l
395
+ }));
396
+ }, P = ({ children: e, className: t, ...a }) => {
397
+ const { signatureMode: n, setSignatureMode: o, uploadEnabled: r } = a, { disabled: l } = U(), { labelId: i, inputId: c } = M(), u = v((h) => {
398
+ o(h);
399
+ }, [
400
+ o
401
+ ]), d = {
402
+ [C.DRAW]: I(e, P.Draw),
403
+ [C.TYPE]: I(e, P.Type),
404
+ [C.UPLOAD]: r ? I(e, P.Upload) : null
405
+ }, E = d[n], m = Pt(E) ? E.props.description : void 0;
406
+ return /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement("div", {
407
+ role: "status",
408
+ "aria-live": "polite",
409
+ style: {
410
+ position: "absolute",
411
+ left: "-10000px",
412
+ width: "1px",
413
+ height: "1px",
414
+ overflow: "hidden"
415
+ }
416
+ }, m), /* @__PURE__ */ s.createElement(tt, {
417
+ value: n,
418
+ onChange: u,
419
+ isDisabled: l,
420
+ "aria-labelledby": i,
421
+ "aria-controls": c,
422
+ "data-hook": dt.SIGNATURE_FIELD_MODE_SELECT,
423
+ className: t
424
+ }, d[C.DRAW], d[C.TYPE], d[C.UPLOAD]));
425
+ }, Pt = (e) => /* @__PURE__ */ Le(e), le = ({ mode: e, children: t, className: a, "aria-label": n }) => /* @__PURE__ */ s.createElement(st, {
426
+ value: e,
427
+ "aria-label": n
428
+ }, /* @__PURE__ */ s.createElement(lt, {
429
+ "data-hook": `signature-mode-${e}`,
430
+ className: a
431
+ }, t)), Bt = (e) => /* @__PURE__ */ s.createElement(le, {
432
+ ...e,
433
+ mode: C.DRAW
434
+ }), Mt = (e) => /* @__PURE__ */ s.createElement(le, {
435
+ ...e,
436
+ mode: C.TYPE
437
+ }), Ht = (e) => /* @__PURE__ */ s.createElement(le, {
438
+ ...e,
439
+ mode: C.UPLOAD
440
+ }), Wt = ({ children: e, className: t, "aria-label": a, ...n }) => {
441
+ const { handleClear: o } = n, { disabled: r, target: l } = U(), { inputId: i } = M();
442
+ return /* @__PURE__ */ s.createElement(ye, {
443
+ onPress: o,
444
+ isDisabled: r,
445
+ "aria-label": a,
446
+ "aria-controls": i,
447
+ "data-hook": `clear-${l}`,
448
+ className: t
449
+ }, e);
450
+ }, B = ({ children: e, className: t, ...a }) => {
451
+ const { signatureView: n, signatureValueForView: o, handleChange: r, handleBeforeChange: l } = a, { disabled: i, readOnly: c, onBlur: u, onFocus: d, hasError: E } = U(), m = I(e, B.Canvas), h = I(e, B.Type), b = I(e, B.Upload);
452
+ return /* @__PURE__ */ s.createElement("div", {
453
+ className: t,
454
+ "data-hook": "signature-input",
455
+ "data-invalid": E,
456
+ "data-disabled": i,
457
+ "data-readonly": c
458
+ }, n === S.DRAW && A(m, {
459
+ value: o,
460
+ onChange: r,
461
+ onBeforeChange: l,
462
+ disabled: i,
463
+ readOnly: c,
464
+ onBlur: u,
465
+ onFocus: d
466
+ }), n === S.TYPE && A(h, {
467
+ value: o,
468
+ onChange: r,
469
+ onBeforeChange: l,
470
+ disabled: i,
471
+ readOnly: c,
472
+ onBlur: u,
473
+ onFocus: d
474
+ }), (n === S.UPLOAD || n === S.IMAGE) && A(b, {
475
+ value: o,
476
+ onChange: r,
477
+ onBeforeChange: l,
478
+ disabled: i,
479
+ readOnly: c,
480
+ onBlur: u,
481
+ onFocus: d
482
+ }));
483
+ }, Yt = ({ className: e, emptyLabel: t, signedLabel: a, ...n }) => {
484
+ const { value: o, onChange: r, onBeforeChange: l, disabled: i, readOnly: c, onBlur: u, onFocus: d } = n, { id: E } = U(), { inputId: m, ariaDescribedBy: h } = M(), b = se(), p = V(), f = V(), L = V(null), R = o == null ? void 0 : o.url, [W, O] = ne(!1);
485
+ Ie(() => {
486
+ var _;
487
+ (_ = f.current) == null || _.focus();
488
+ }, E);
489
+ const D = be(() => ({
490
+ throttle: 0,
491
+ dotSize: 2,
492
+ minWidth: 1,
493
+ maxWidth: 3,
494
+ velocityFilterWeight: 0.2
495
+ }), []), G = v(() => {
496
+ var F, y, x;
497
+ if ((F = p.current) != null && F.isEmpty())
498
+ return "";
499
+ const _ = (y = p.current) == null ? void 0 : y.toData();
500
+ return _ ? yt(_) : ((x = p.current) == null ? void 0 : x.toDataURL()) ?? "";
501
+ }, []), Y = v(() => {
502
+ var F;
503
+ const _ = (F = p.current) == null ? void 0 : F.isEmpty();
504
+ O(!_), r(re(G()));
505
+ }, [
506
+ G,
507
+ r
508
+ ]), Z = v(() => {
509
+ l == null || l();
510
+ }, [
511
+ l
512
+ ]), J = v((_) => {
513
+ var y, x, ce, ue;
514
+ if (_ != null) {
515
+ if (f.current = _, p.current = new _e(_, {
516
+ ...D,
517
+ penColor: getComputedStyle(_).color || void 0
518
+ }), he(f.current, p.current), R) {
519
+ const de = ve(R);
520
+ de && (p.current.fromData(de), O(!0));
521
+ } else
522
+ p.current.clear(), O(!1);
523
+ p.current.addEventListener("beginStroke", Z), p.current.addEventListener("endStroke", Y), typeof ResizeObserver < "u" && !L.current && (L.current = new ResizeObserver(() => {
524
+ f.current && he(f.current, p == null ? void 0 : p.current);
525
+ })), (y = L.current) == null || y.observe(_);
526
+ } else
527
+ (x = L.current) == null || x.disconnect(), (ce = p.current) == null || ce.removeEventListener("endStroke", Y), (ue = p.current) == null || ue.removeEventListener("beginStroke", Z);
528
+ }, [
529
+ D,
530
+ R,
531
+ Z,
532
+ Y
533
+ ]);
534
+ return oe(() => {
535
+ p.current && (c || i ? p.current.off() : p.current.on());
536
+ }, [
537
+ i,
538
+ c
539
+ ]), /* @__PURE__ */ s.createElement("div", {
540
+ className: e,
541
+ ...b
542
+ }, /* @__PURE__ */ s.createElement("canvas", {
543
+ ref: J,
544
+ id: m,
545
+ "data-hook": "signature-canvas",
546
+ "data-input-id": m,
547
+ "data-has-value": !!R,
548
+ onFocus: d,
549
+ onBlur: u,
550
+ role: "img",
551
+ "aria-label": W ? a : t,
552
+ "aria-describedby": h
553
+ }));
554
+ }, ie = ({ children: e, className: t, ...a }) => {
555
+ const { value: n, onChange: o, onBeforeChange: r, disabled: l, readOnly: i, onBlur: c, onFocus: u } = a, { id: d, required: E, hasError: m } = U(), { inputId: h, ariaDescribedBy: b, labelId: p } = M(), f = se(), L = n != null && n.url ? H(n.url) : void 0, { data: R = "" } = L ?? {
556
+ data: ""
557
+ };
558
+ Ie(() => {
559
+ const D = document.getElementById(h);
560
+ D == null || D.focus({
561
+ preventScroll: !0
562
+ });
563
+ }, d), oe(() => {
564
+ if (!n) {
565
+ const D = document.getElementById(h);
566
+ D && (D.value = "");
567
+ }
568
+ }, [
569
+ n,
570
+ h
571
+ ]);
572
+ const W = v((D) => {
573
+ r == null || r(), D.trim() ? o(re(Re({
574
+ data: D,
575
+ mimeType: N.TEXT
576
+ }))) : o(null);
577
+ }, [
578
+ r,
579
+ o
580
+ ]), O = I(e, ie.Value);
581
+ return /* @__PURE__ */ s.createElement(nt, {
582
+ "aria-labelledby": p,
583
+ value: R,
584
+ onChange: W,
585
+ onBlur: c,
586
+ onFocus: u,
587
+ isDisabled: l,
588
+ isReadOnly: i,
589
+ isRequired: E,
590
+ isInvalid: m,
591
+ validationBehavior: "aria"
592
+ }, /* @__PURE__ */ s.createElement("div", {
593
+ className: t,
594
+ ...f
595
+ }, A(O, {
596
+ inputId: h,
597
+ ariaDescribedBy: b
598
+ })));
599
+ }, Zt = ({ className: e, placeholder: t, ...a }) => {
600
+ const { inputId: n, ariaDescribedBy: o } = a;
601
+ return /* @__PURE__ */ s.createElement(ot, {
602
+ id: n,
603
+ "data-hook": "signature-text",
604
+ "aria-describedby": o,
605
+ placeholder: t,
606
+ className: e
607
+ });
608
+ }, j = ({ children: e, className: t, ...a }) => {
609
+ const { value: n, onChange: o, disabled: r, readOnly: l, onBlur: i, onFocus: c } = a, { labelId: u, ariaDescribedBy: d } = M(), E = I(e, j.Button), m = I(e, j.Preview), h = v((p) => {
610
+ const f = p[0];
611
+ if (!f) {
612
+ o(null);
613
+ return;
614
+ }
615
+ const L = new FileReader();
616
+ L.onload = () => {
617
+ o(re(L.result, f.name));
618
+ }, L.readAsDataURL(f);
619
+ }, [
620
+ o
621
+ ]);
622
+ return n && Ut(n) ? A(m, {
623
+ value: n
624
+ }) ?? null : /* @__PURE__ */ s.createElement(at, {
625
+ className: t,
626
+ isDisabled: r || l,
627
+ "aria-labelledby": u,
628
+ "aria-describedby": d,
629
+ "data-hook": "signature-upload-drop-zone",
630
+ onDrop: async (p) => {
631
+ for (const f of p.items)
632
+ if (f.kind === "file" && f.type.startsWith("image/")) {
633
+ const L = await f.getFile();
634
+ if (L) {
635
+ h([
636
+ L
637
+ ]);
638
+ return;
639
+ }
640
+ }
641
+ }
642
+ }, A(E, {
643
+ onSelectFiles: h,
644
+ disabled: r,
645
+ readOnly: l,
646
+ onBlur: i,
647
+ onFocus: c
648
+ }));
649
+ }, kt = ({ className: e, imageAlt: t, ...a }) => {
650
+ const { value: n } = a, { inputId: o } = M(), r = se();
651
+ return /* @__PURE__ */ s.createElement("div", {
652
+ className: e,
653
+ "data-has-value": !0,
654
+ ...r
655
+ }, n.url ? /* @__PURE__ */ s.createElement("img", {
656
+ id: o,
657
+ src: n.url,
658
+ alt: n.displayName || t,
659
+ "data-hook": "signature-image"
660
+ }) : /* @__PURE__ */ s.createElement("span", {
661
+ id: o,
662
+ "data-hook": "signature-image"
663
+ }, n.displayName || t));
664
+ }, te = ({ children: e, className: t, onHoverStart: a, onHoverEnd: n, ...o }) => {
665
+ const { onSelectFiles: r, disabled: l, readOnly: i, onBlur: c, onFocus: u } = o, { inputId: d, ariaDescribedBy: E, labelId: m } = M(), h = pt(), p = !!I(e, te.Text) ? we.map(e, (f) => /* @__PURE__ */ Le(f) && f.type === te.Text ? A(f, {
666
+ textId: h
667
+ }) : f) : /* @__PURE__ */ s.createElement("span", {
668
+ id: h
669
+ }, e);
670
+ return /* @__PURE__ */ s.createElement(rt, {
671
+ acceptedFileTypes: [
672
+ "image/*"
673
+ ],
674
+ onSelect: (f) => {
675
+ r(f ? Array.from(f) : []);
676
+ }
677
+ }, /* @__PURE__ */ s.createElement(ye, {
678
+ id: d,
679
+ onBlur: c,
680
+ onFocus: u,
681
+ isDisabled: l || i,
682
+ "aria-labelledby": `${m} ${h}`,
683
+ "aria-describedby": E,
684
+ "data-hook": "signature-upload",
685
+ className: t,
686
+ onHoverStart: a,
687
+ onHoverEnd: n
688
+ }, p));
689
+ }, Vt = ({ children: e, className: t, ...a }) => {
690
+ const { textId: n } = a;
691
+ return /* @__PURE__ */ s.createElement("span", {
692
+ id: n,
693
+ className: t
694
+ }, e);
695
+ };
696
+ g.Label = ut;
697
+ g.Input = X;
698
+ g.Description = it;
699
+ g.Error = ct;
700
+ X.Header = q;
701
+ X.Value = B;
702
+ q.Tabs = P;
703
+ q.Clear = Wt;
704
+ P.Draw = Bt;
705
+ P.Type = Mt;
706
+ P.Upload = Ht;
707
+ B.Canvas = Yt;
708
+ B.Type = ie;
709
+ B.Upload = j;
710
+ ie.Value = Zt;
711
+ j.Preview = kt;
712
+ j.Button = te;
713
+ te.Text = Vt;
714
+ const Gt = () => {
715
+ const { t: e } = He();
716
+ return {
717
+ drawLabel: e("field.signature.mode.draw.label"),
718
+ typeLabel: e("field.signature.mode.type.label"),
719
+ uploadModeLabel: e("field.signature.mode.upload.label"),
720
+ drawDescription: e("field.signature.mode.draw.description"),
721
+ typeDescription: e("field.signature.mode.type.description"),
722
+ uploadDescription: e("field.signature.mode.upload.description"),
723
+ clearLabel: e("field.signature.clear-button.label"),
724
+ emptyLabel: e("field.signature.canvas.aria-label.empty"),
725
+ signedLabel: e("field.signature.canvas.aria-label.signed"),
726
+ placeholder: e("field.signature.text.placeholder"),
727
+ imageAlt: e("field.signature.a11y.state.signed"),
728
+ uploadLabel: e("field.signature.settings.upload-button.label")
729
+ };
730
+ }, $t = (e) => /* @__PURE__ */ s.createElement("svg", {
731
+ viewBox: "0 0 24 24",
732
+ width: 24,
733
+ height: 24,
734
+ fill: "currentColor",
735
+ "aria-hidden": "true",
736
+ ...e
737
+ }, /* @__PURE__ */ s.createElement("path", {
738
+ fillRule: "evenodd",
739
+ d: "M13.5,3 C14.327,3 15,3.673 15,4.5 L15,4.5 L15,5 L19,5 L19,6 L18,6 L18,17.5 C18,18.879 16.878,20 15.5,20 L15.5,20 L7.5,20 C6.122,20 5,18.879 5,17.5 L5,17.5 L5,6 L4,6 L4,5 L8,5 L8,4.5 C8,3.673 8.673,3 9.5,3 L9.5,3 Z M17,6 L6,6 L6,17.5 C6,18.327 6.673,19 7.5,19 L7.5,19 L15.5,19 C16.327,19 17,18.327 17,17.5 L17,17.5 L17,6 Z M10,9 L10,16 L9,16 L9,9 L10,9 Z M14,9 L14,16 L13,16 L13,9 L14,9 Z M13.5,4 L9.5,4 C9.224,4 9,4.225 9,4.5 L9,4.5 L9,5 L14,5 L14,4.5 C14,4.225 13.776,4 13.5,4 L13.5,4 Z"
740
+ })), zt = (e) => /* @__PURE__ */ s.createElement("svg", {
741
+ viewBox: "0 0 24 24",
742
+ width: 24,
743
+ height: 24,
744
+ fill: "currentColor",
745
+ "aria-hidden": "true",
746
+ ...e
747
+ }, /* @__PURE__ */ s.createElement("path", {
748
+ fillRule: "evenodd",
749
+ d: "M4.9937,15.9971 L4.9937,18.4971 C4.9937,18.7721 5.2177,18.9971 5.4937,18.9971 L5.4937,18.9971 L17.4937,18.9971 C17.7697,18.9971 17.9937,18.7721 17.9937,18.4971 L17.9937,18.4971 L17.9937,15.9971 L18.9937,15.9971 L18.9937,18.4971 C18.9937,19.3241 18.3207,19.9971 17.4937,19.9971 L17.4937,19.9971 L5.4937,19.9971 C4.6657,19.9971 3.9937,19.3241 3.9937,18.4971 L3.9937,18.4971 L3.9937,15.9971 L4.9937,15.9971 Z M11.9933,4 L11.9933,14.078 L15.0293,11.043 L15.7363,11.75 L11.4933,15.992 L7.2513,11.75 L7.9583,11.043 L10.9933,14.078 L10.9933,4 L11.9933,4 Z"
750
+ })), Xt = (e) => /* @__PURE__ */ s.createElement("svg", {
751
+ viewBox: "0 0 24 24",
752
+ width: 24,
753
+ height: 24,
754
+ fill: "currentColor",
755
+ "aria-hidden": "true",
756
+ ...e
757
+ }, /* @__PURE__ */ s.createElement("path", {
758
+ fillRule: "evenodd",
759
+ d: "M18.8525,7.543 L17.7515,8.644 L15.3565,6.248 L16.4575,5.147 C16.5555,5.05 16.6835,5.001 16.8105,5.001 C16.9385,5.001 17.0665,5.05 17.1645,5.147 L18.8525,6.835 C19.0475,7.03 19.0475,7.348 18.8525,7.543 L18.8525,7.543 Z M8.1895,18.206 C8.1185,18.276 8.0275,18.324 7.9295,18.344 L5.1275,18.873 L5.6575,16.07 C5.6755,15.972 5.7225,15.882 5.7945,15.811 L14.6495,6.955 L17.0445,9.351 L8.1895,18.206 Z M19.5595,6.128 L17.8715,4.44 C17.2865,3.856 16.3355,3.856 15.7505,4.44 L5.0875,15.103 C4.8735,15.317 4.7295,15.588 4.6745,15.886 L4.0085,19.407 C3.9775,19.569 4.0295,19.736 4.1465,19.854 C4.2415,19.948 4.3685,20 4.4995,20 C4.5305,20 4.5615,19.997 4.5925,19.991 L8.1165,19.326 C8.4145,19.269 8.6855,19.125 8.8965,18.912 L19.5595,8.25 C20.1445,7.665 20.1445,6.713 19.5595,6.128 L19.5595,6.128 Z"
760
+ })), qt = (e) => /* @__PURE__ */ s.createElement("svg", {
761
+ viewBox: "0 0 20 20",
762
+ width: 24,
763
+ height: 24,
764
+ fill: "currentColor",
765
+ "aria-hidden": "true",
766
+ ...e
767
+ }, /* @__PURE__ */ s.createElement("path", {
768
+ fillRule: "evenodd",
769
+ d: "M12,4 L12,5 L8,5 L8,16 L7,16 L7,5 L3,5 L3,4 L12,4 Z M18,8 L18,9 L15,9 L15,16 L14,16 L14,9 L11,9 L11,8 L18,8 Z"
770
+ })), jt = "_container_10dir_1", Jt = "_header_10dir_7", Kt = "_tabs_10dir_13", Qt = "_tab_10dir_13", en = "_tabHover_10dir_46", tn = "_tabSelected_10dir_51", nn = "_tabIcon_10dir_81", an = "_uploadButton_10dir_88", on = "_uploadButtonHover_10dir_138", rn = "_clear_10dir_155", sn = "_value_10dir_187", ln = "_box_10dir_192", cn = "_uploadBox_10dir_193", un = "_dropZone_10dir_225", dn = "_dropZoneHover_10dir_244", mn = "_boxHover_10dir_278", pn = "_typeInput_10dir_331", T = {
771
+ container: jt,
772
+ header: Jt,
773
+ tabs: Kt,
774
+ tab: Qt,
775
+ tabHover: en,
776
+ tabSelected: tn,
777
+ tabIcon: nn,
778
+ uploadButton: an,
779
+ uploadButtonHover: on,
780
+ clear: rn,
781
+ value: sn,
782
+ box: ln,
783
+ uploadBox: cn,
784
+ dropZone: un,
785
+ dropZoneHover: dn,
786
+ boxHover: mn,
787
+ typeInput: pn
788
+ }, fn = ({ content: e, locale: t }) => /* @__PURE__ */ s.createElement(xe, {
789
+ content: e,
790
+ locale: t
791
+ }), En = () => {
792
+ var G, Y, Z, J, _, F;
793
+ const e = Gt(), { disabled: t, readOnly: a } = U(), n = !t && !a, o = $({
794
+ globalClasses: Je,
795
+ moduleClasses: {
796
+ base: T.tab,
797
+ hover: T.tabHover,
798
+ selected: T.tabSelected
799
+ }
800
+ }), r = ({ isSelected: y, isHovered: x }) => o({
801
+ isSelected: y,
802
+ isHovered: x,
803
+ isInteractive: n
804
+ }), i = $({
805
+ globalClasses: ze,
806
+ moduleClasses: {
807
+ base: T.box,
808
+ hover: T.boxHover
809
+ }
810
+ })({
811
+ isSelected: !1,
812
+ isHovered: !1,
813
+ isInteractive: n
814
+ }), u = $({
815
+ globalClasses: Xe,
816
+ moduleClasses: {
817
+ base: T.box,
818
+ hover: T.boxHover
819
+ }
820
+ })({
821
+ isSelected: !1,
822
+ isHovered: !1,
823
+ isInteractive: n
824
+ }), d = $({
825
+ globalClasses: qe,
826
+ moduleClasses: {
827
+ base: T.dropZone,
828
+ hover: T.dropZoneHover
829
+ }
830
+ }), E = $({
831
+ globalClasses: je,
832
+ moduleClasses: {
833
+ base: T.uploadButton,
834
+ hover: T.uploadButtonHover
835
+ }
836
+ }), m = (F = (_ = (J = (Z = (Y = (G = Te().signatureContainer) == null ? void 0 : G.elementProps) == null ? void 0 : Y.signatureDropZone) == null ? void 0 : Z.elementProps) == null ? void 0 : J.signatureUploadButton) == null ? void 0 : _.elementProps) == null ? void 0 : F.icon, { wix: h, className: b, ...p } = m ?? {}, f = We(K.SIGNATURE_CONTAINER, K.SIGNATURE_DROP_ZONE, K.SIGNATURE_UPLOAD_BUTTON, K.UPLOAD_BUTTON_LABEL), L = V(null), [R, W] = ne(!1), O = v(() => {
837
+ var y;
838
+ W(!0), (y = L.current) == null || y.runAnimationForward();
839
+ }, []), D = v(() => {
840
+ var y;
841
+ W(!1), (y = L.current) == null || y.runAnimationBackward();
842
+ }, []);
843
+ return /* @__PURE__ */ s.createElement(g, null, /* @__PURE__ */ s.createElement(g.Label, {
844
+ className: w(Ye, Q.label)
845
+ }, /* @__PURE__ */ s.createElement(g.Label.Required, {
846
+ className: w(Ze, Q.requiredMark)
847
+ })), /* @__PURE__ */ s.createElement(g.Input, {
848
+ className: w(ke, T.container)
849
+ }, /* @__PURE__ */ s.createElement(g.Input.Header, {
850
+ className: T.header
851
+ }, /* @__PURE__ */ s.createElement(g.Input.Header.Tabs, {
852
+ className: T.tabs
853
+ }, /* @__PURE__ */ s.createElement(g.Input.Header.Tabs.Draw, {
854
+ className: r,
855
+ "aria-label": e.drawLabel,
856
+ description: e.drawDescription
857
+ }, /* @__PURE__ */ s.createElement(Xt, {
858
+ className: T.tabIcon
859
+ })), /* @__PURE__ */ s.createElement(g.Input.Header.Tabs.Type, {
860
+ className: r,
861
+ "aria-label": e.typeLabel,
862
+ description: e.typeDescription
863
+ }, /* @__PURE__ */ s.createElement(qt, {
864
+ className: T.tabIcon
865
+ })), /* @__PURE__ */ s.createElement(g.Input.Header.Tabs.Upload, {
866
+ className: r,
867
+ "aria-label": e.uploadModeLabel,
868
+ description: e.uploadDescription
869
+ }, /* @__PURE__ */ s.createElement(zt, {
870
+ className: T.tabIcon
871
+ }))), /* @__PURE__ */ s.createElement(g.Input.Header.Clear, {
872
+ className: w(pe, T.clear),
873
+ "aria-label": e.clearLabel
874
+ }, /* @__PURE__ */ s.createElement($t, null))), /* @__PURE__ */ s.createElement(g.Input.Value, {
875
+ className: T.value
876
+ }, /* @__PURE__ */ s.createElement(g.Input.Value.Canvas, {
877
+ className: i,
878
+ emptyLabel: e.emptyLabel,
879
+ signedLabel: e.signedLabel
880
+ }), /* @__PURE__ */ s.createElement(g.Input.Value.Type, {
881
+ className: u
882
+ }, /* @__PURE__ */ s.createElement(g.Input.Value.Type.Value, {
883
+ className: T.typeInput,
884
+ placeholder: e.placeholder
885
+ })), /* @__PURE__ */ s.createElement(g.Input.Value.Upload, {
886
+ className: ({ isHovered: y, isDropTarget: x }) => w(T.uploadBox, d({
887
+ isSelected: !1,
888
+ isHovered: y || x,
889
+ isInteractive: n
890
+ }))
891
+ }, /* @__PURE__ */ s.createElement(g.Input.Value.Upload.Preview, {
892
+ className: w(T.uploadBox, i),
893
+ imageAlt: e.imageAlt
894
+ }), /* @__PURE__ */ s.createElement(g.Input.Value.Upload.Button, {
895
+ className: ({ isHovered: y }) => E({
896
+ isSelected: !1,
897
+ isHovered: y,
898
+ isInteractive: n
899
+ }),
900
+ onHoverStart: O,
901
+ onHoverEnd: D
902
+ }, p.svg ? /* @__PURE__ */ s.createElement(Fe, {
903
+ ...p,
904
+ ref: L,
905
+ className: w(Ve, Ge, b)
906
+ }) : null, /* @__PURE__ */ s.createElement(g.Input.Value.Upload.Button.Text, {
907
+ className: w(fe.base, f, {
908
+ [fe.hover]: n && R
909
+ })
910
+ }, e.uploadLabel))))), /* @__PURE__ */ s.createElement(g.Error, {
911
+ className: w($e, Q.error)
912
+ }, /* @__PURE__ */ s.createElement(mt, null), /* @__PURE__ */ s.createElement(g.Error.Text, null)), /* @__PURE__ */ s.createElement(g.Description, {
913
+ className: w(pe, Q.description)
914
+ }, fn));
915
+ }, wn = () => /* @__PURE__ */ s.createElement(En, null);
916
+ export {
917
+ wn as SignatureRAC
918
+ };