md-components-mdigial-azamat 0.0.1 → 0.0.2

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 (182) hide show
  1. package/dist/Banner/Banner.js +146 -0
  2. package/dist/Banner/index.js +4 -0
  3. package/dist/Banner/model.js +8 -0
  4. package/dist/Banner/types.js +4 -0
  5. package/dist/BannerAndText/index.js +36 -0
  6. package/dist/CardIconList/CardIconList.js +72 -0
  7. package/dist/CardIconList/index.js +4 -0
  8. package/dist/CardImageList/CardImageList.js +50 -0
  9. package/dist/CardImageList/index.js +4 -0
  10. package/dist/Cards/CardImage/CardImage.js +51 -0
  11. package/dist/Cards/CardImage/index.js +4 -0
  12. package/dist/Cards/ColoredCard/index.js +47 -0
  13. package/dist/Cards/ContentCard/ContentCard.js +38 -0
  14. package/dist/Cards/ContentCard/index.js +4 -0
  15. package/dist/Cards/FeaturesCard/index.js +7 -0
  16. package/dist/Cards/WarningCard/WarningCard.js +51 -0
  17. package/dist/Cards/WarningCard/index.js +4 -0
  18. package/dist/Cards/WarningCard/model.js +24 -0
  19. package/dist/ComponentContainer-41408843.js +15 -0
  20. package/dist/ContentCardList/ContentCardList.js +26 -0
  21. package/dist/ContentCardList/index.js +4 -0
  22. package/dist/DownloadFile/components/DownloadFileBanner/DownloadFileBanner.js +38 -0
  23. package/dist/DownloadFile/components/DownloadFileBanner/index.js +4 -0
  24. package/dist/DownloadFile/components/DownloadFileFull/DownloadFileFull.js +39 -0
  25. package/dist/DownloadFile/components/DownloadFileFull/index.js +4 -0
  26. package/dist/DownloadFile/components/DownloadFileHalf/DownloadFileHalf.js +46 -0
  27. package/dist/DownloadFile/components/DownloadFileHalf/index.js +4 -0
  28. package/dist/DownloadFile/components/DownloadFileMini/DownloadFileMini.js +45 -0
  29. package/dist/DownloadFile/components/DownloadFileMini/index.js +4 -0
  30. package/dist/Faq/Faq.js +35 -0
  31. package/dist/Faq/components/Collapse/Collapse.js +42 -0
  32. package/dist/Faq/components/Collapse/index.js +4 -0
  33. package/dist/Faq/components/FeedbackForm/FeedbackForm.js +1033 -0
  34. package/dist/Faq/components/FeedbackForm/index.js +4 -0
  35. package/dist/Faq/components/PlusMinusIcon/PlusMinusIcon.js +62 -0
  36. package/dist/Faq/components/PlusMinusIcon/index.js +4 -0
  37. package/dist/Faq/index.js +4 -0
  38. package/dist/HeroPossibilityBanner/index.js +26 -0
  39. package/dist/HtmlContent/HtmlContent.js +12 -0
  40. package/dist/HtmlContent/index.js +4 -0
  41. package/dist/Icon-70ea6cb8.js +187 -0
  42. package/dist/InstructionList/InstructionList.js +30 -0
  43. package/dist/InstructionList/components/InstructionCard/InstructionCard.js +67 -0
  44. package/dist/InstructionList/components/InstructionCard/index.js +4 -0
  45. package/dist/InstructionList/components/InstructionModal/InstructionModal.js +40 -0
  46. package/dist/InstructionList/components/InstructionModal/index.js +4 -0
  47. package/dist/InstructionList/index.js +4 -0
  48. package/dist/MainBanner/MainBanner.js +70 -0
  49. package/dist/MainBanner/index.js +4 -0
  50. package/dist/MultiCards/index.js +48 -0
  51. package/dist/Partners/Partners.js +31 -0
  52. package/dist/Partners/index.js +4 -0
  53. package/dist/PartnersColors/PartnersColors.js +37 -0
  54. package/dist/PartnersColors/components/PartnerCard/PartnerCard.js +30 -0
  55. package/dist/PartnersColors/components/PartnerCard/const.js +19 -0
  56. package/dist/PartnersColors/components/PartnerCard/index.js +4 -0
  57. package/dist/PartnersColors/components/PartnerTab/PartnerTab.js +37 -0
  58. package/dist/PartnersColors/components/PartnerTab/index.js +4 -0
  59. package/dist/PartnersColors/index.js +4 -0
  60. package/dist/PreviewList/PreviewList.js +26 -0
  61. package/dist/PreviewList/components/PreviewCard/PreviewCard.js +32 -0
  62. package/dist/PreviewList/components/PreviewCard/index.js +4 -0
  63. package/dist/PreviewList/index.js +4 -0
  64. package/dist/Segments/Segments.js +34 -0
  65. package/dist/Segments/index.js +4 -0
  66. package/dist/Stepper/Stepper.js +41 -0
  67. package/dist/Stepper/index.js +4 -0
  68. package/dist/Video/VideoFull/VideoFull.js +13 -0
  69. package/dist/Video/VideoFull/index.js +4 -0
  70. package/dist/Video/VideoList/VideoList.js +23 -0
  71. package/dist/Video/VideoList/index.js +4 -0
  72. package/dist/Video/VideoListMini/VideoListMini.js +23 -0
  73. package/dist/Video/VideoListMini/index.js +4 -0
  74. package/dist/Video/components/VideoPlayer/VideoPlayer.js +1339 -0
  75. package/dist/Video/components/VideoPlayer/index.js +4 -0
  76. package/dist/Video/index.js +8 -0
  77. package/dist/cn-eacd4725.js +2749 -0
  78. package/dist/index-89dcf24f.js +54 -0
  79. package/dist/index-cd468670.js +51 -0
  80. package/dist/index-fb8c9446.js +46 -0
  81. package/dist/main.js +21 -0
  82. package/dist/palette-52b06a82.js +26 -0
  83. package/dist/trash/HeroLargeCards/index.js +26 -0
  84. package/package.json +6 -3
  85. package/dist/assets/minimise.svg +0 -10
  86. package/dist/components/Banner/Banner.js +0 -1
  87. package/dist/components/Banner/index.js +0 -1
  88. package/dist/components/Banner/model.js +0 -1
  89. package/dist/components/BannerAndText/index.js +0 -1
  90. package/dist/components/CardIconList/CardIconList.js +0 -1
  91. package/dist/components/CardIconList/index.js +0 -1
  92. package/dist/components/CardImageList/CardImageList.js +0 -1
  93. package/dist/components/CardImageList/index.js +0 -1
  94. package/dist/components/Cards/CardImage/CardImage.js +0 -1
  95. package/dist/components/Cards/CardImage/index.js +0 -1
  96. package/dist/components/Cards/ColoredCard/index.js +0 -1
  97. package/dist/components/Cards/ContentCard/ContentCard.js +0 -1
  98. package/dist/components/Cards/ContentCard/index.js +0 -1
  99. package/dist/components/Cards/FeaturesCard/index.js +0 -1
  100. package/dist/components/Cards/WarningCard/WarningCard.js +0 -1
  101. package/dist/components/Cards/WarningCard/index.js +0 -1
  102. package/dist/components/Cards/WarningCard/model.js +0 -1
  103. package/dist/components/ContentCardList/ContentCardList.js +0 -1
  104. package/dist/components/ContentCardList/index.js +0 -1
  105. package/dist/components/DownloadFile/components/DownloadFileBanner/DownloadFileBanner.js +0 -1
  106. package/dist/components/DownloadFile/components/DownloadFileBanner/index.js +0 -1
  107. package/dist/components/DownloadFile/components/DownloadFileFull/DownloadFileFull.js +0 -1
  108. package/dist/components/DownloadFile/components/DownloadFileFull/index.js +0 -1
  109. package/dist/components/DownloadFile/components/DownloadFileHalf/DownloadFileHalf.js +0 -1
  110. package/dist/components/DownloadFile/components/DownloadFileHalf/index.js +0 -1
  111. package/dist/components/DownloadFile/components/DownloadFileMini/DownloadFileMini.js +0 -1
  112. package/dist/components/DownloadFile/components/DownloadFileMini/index.js +0 -1
  113. package/dist/components/Faq/Faq.js +0 -1
  114. package/dist/components/Faq/components/Collapse/Collapse.js +0 -1
  115. package/dist/components/Faq/components/Collapse/index.js +0 -1
  116. package/dist/components/Faq/components/FeedbackForm/FeedbackForm.js +0 -1
  117. package/dist/components/Faq/components/FeedbackForm/index.js +0 -1
  118. package/dist/components/Faq/components/PlusMinusIcon/PlusMinusIcon.js +0 -1
  119. package/dist/components/Faq/components/PlusMinusIcon/index.js +0 -1
  120. package/dist/components/Faq/index.js +0 -1
  121. package/dist/components/HeroPossibilityBanner/index.js +0 -1
  122. package/dist/components/HtmlContent/HtmlContent.js +0 -1
  123. package/dist/components/HtmlContent/index.js +0 -1
  124. package/dist/components/InstructionList/InstructionList.js +0 -1
  125. package/dist/components/InstructionList/components/InstructionCard/InstructionCard.js +0 -1
  126. package/dist/components/InstructionList/components/InstructionCard/index.js +0 -1
  127. package/dist/components/InstructionList/components/InstructionModal/InstructionModal.js +0 -1
  128. package/dist/components/InstructionList/components/InstructionModal/index.js +0 -1
  129. package/dist/components/InstructionList/index.js +0 -1
  130. package/dist/components/MainBanner/MainBanner.js +0 -1
  131. package/dist/components/MainBanner/index.js +0 -1
  132. package/dist/components/MultiCards/index.js +0 -1
  133. package/dist/components/Partners/Partners.js +0 -1
  134. package/dist/components/Partners/index.js +0 -1
  135. package/dist/components/PartnersColors/PartnersColors.js +0 -1
  136. package/dist/components/PartnersColors/components/PartnerCard/PartnerCard.js +0 -1
  137. package/dist/components/PartnersColors/components/PartnerCard/const.js +0 -1
  138. package/dist/components/PartnersColors/components/PartnerCard/index.js +0 -1
  139. package/dist/components/PartnersColors/components/PartnerTab/PartnerTab.js +0 -1
  140. package/dist/components/PartnersColors/components/PartnerTab/index.js +0 -1
  141. package/dist/components/PartnersColors/index.js +0 -1
  142. package/dist/components/PreviewList/PreviewList.js +0 -1
  143. package/dist/components/PreviewList/components/PreviewCard/PreviewCard.js +0 -1
  144. package/dist/components/PreviewList/components/PreviewCard/index.js +0 -1
  145. package/dist/components/PreviewList/index.js +0 -1
  146. package/dist/components/Segments/Segments.js +0 -1
  147. package/dist/components/Segments/index.js +0 -1
  148. package/dist/components/Stepper/Stepper.js +0 -1
  149. package/dist/components/Stepper/index.js +0 -1
  150. package/dist/components/Video/VideoFull/VideoFull.js +0 -1
  151. package/dist/components/Video/VideoFull/index.js +0 -1
  152. package/dist/components/Video/VideoList/VideoList.js +0 -1
  153. package/dist/components/Video/VideoList/index.js +0 -1
  154. package/dist/components/Video/VideoListMini/VideoListMini.js +0 -1
  155. package/dist/components/Video/VideoListMini/index.js +0 -1
  156. package/dist/components/Video/components/VideoPlayer/VideoPlayer.js +0 -1
  157. package/dist/components/Video/components/VideoPlayer/index.js +0 -1
  158. package/dist/components/Video/index.js +0 -1
  159. package/dist/components/Video/types.js +0 -1
  160. package/dist/components/index.js +0 -1
  161. package/dist/components/trash/HeroLargeCards/index.js +0 -1
  162. /package/dist/{components/Banner → CardIconList}/types.js +0 -0
  163. /package/dist/{components/CardIconList → CardImageList}/types.js +0 -0
  164. /package/dist/{components/CardImageList → Cards/CardImage}/types.js +0 -0
  165. /package/dist/{components/Cards/CardImage → Cards/ColoredCard}/types.js +0 -0
  166. /package/dist/{components/Cards/ColoredCard → Cards/ContentCard}/types.js +0 -0
  167. /package/dist/{components/Cards/ContentCard → Cards/FeaturesCard}/types.js +0 -0
  168. /package/dist/{components/Cards/FeaturesCard → Cards/WarningCard}/types.js +0 -0
  169. /package/dist/{components/Cards/WarningCard → ContentCardList}/types.js +0 -0
  170. /package/dist/{components/ContentCardList → DownloadFile}/types.js +0 -0
  171. /package/dist/{components/DownloadFile → Faq/components/Collapse}/types.js +0 -0
  172. /package/dist/{components/Faq/components/Collapse → Faq/components/FeedbackForm}/types.js +0 -0
  173. /package/dist/{components/Faq/components/FeedbackForm → Faq}/types.js +0 -0
  174. /package/dist/{components/Faq → InstructionList}/types.js +0 -0
  175. /package/dist/{components/InstructionList → MainBanner}/types.js +0 -0
  176. /package/dist/{components/MainBanner → MultiCards}/types.js +0 -0
  177. /package/dist/{components/MultiCards → Partners}/types.js +0 -0
  178. /package/dist/{components/Partners → PartnersColors}/types.js +0 -0
  179. /package/dist/{components/PartnersColors → PreviewList/components/PreviewCard}/types.js +0 -0
  180. /package/dist/{components/PreviewList/components/PreviewCard → Segments}/types.js +0 -0
  181. /package/dist/{components/Segments → Stepper}/types.js +0 -0
  182. /package/dist/{components/Stepper → Video}/types.js +0 -0
@@ -0,0 +1,1033 @@
1
+ import { jsx as ie, jsxs as Ee } from "react/jsx-runtime";
2
+ import * as je from "react";
3
+ import P, { useState as kt } from "react";
4
+ import { B as Ke, b as Ge, a as Ye } from "../../../index-89dcf24f.js";
5
+ var ce = (e) => e.type === "checkbox", re = (e) => e instanceof Date, N = (e) => e == null;
6
+ const ut = (e) => typeof e == "object";
7
+ var k = (e) => !N(e) && !Array.isArray(e) && ut(e) && !re(e), St = (e) => k(e) && e.target ? ce(e.target) ? e.target.checked : e.target.value : e, Et = (e) => e.substring(0, e.search(/\.\d+(\.|$)/)) || e, Ct = (e, s) => e.has(Et(s)), Lt = (e) => {
8
+ const s = e.constructor && e.constructor.prototype;
9
+ return k(s) && s.hasOwnProperty("isPrototypeOf");
10
+ }, Oe = typeof window < "u" && typeof window.HTMLElement < "u" && typeof document < "u";
11
+ function T(e) {
12
+ let s;
13
+ const r = Array.isArray(e), a = typeof FileList < "u" ? e instanceof FileList : !1;
14
+ if (e instanceof Date)
15
+ s = new Date(e);
16
+ else if (e instanceof Set)
17
+ s = new Set(e);
18
+ else if (!(Oe && (e instanceof Blob || a)) && (r || k(e)))
19
+ if (s = r ? [] : {}, !r && !Lt(e))
20
+ s = e;
21
+ else
22
+ for (const u in e)
23
+ e.hasOwnProperty(u) && (s[u] = T(e[u]));
24
+ else
25
+ return e;
26
+ return s;
27
+ }
28
+ var me = (e) => /^\w*$/.test(e), S = (e) => e === void 0, Te = (e) => Array.isArray(e) ? e.filter(Boolean) : [], Re = (e) => Te(e.replace(/["|']|\]/g, "").split(/\.|\[/)), h = (e, s, r) => {
29
+ if (!s || !k(e))
30
+ return r;
31
+ const a = (me(s) ? [s] : Re(s)).reduce((u, n) => N(u) ? u : u[n], e);
32
+ return S(a) || a === e ? S(e[s]) ? r : e[s] : a;
33
+ }, j = (e) => typeof e == "boolean", A = (e, s, r) => {
34
+ let a = -1;
35
+ const u = me(s) ? [s] : Re(s), n = u.length, c = n - 1;
36
+ for (; ++a < n; ) {
37
+ const y = u[a];
38
+ let O = r;
39
+ if (a !== c) {
40
+ const B = e[y];
41
+ O = k(B) || Array.isArray(B) ? B : isNaN(+u[a + 1]) ? {} : [];
42
+ }
43
+ if (y === "__proto__" || y === "constructor" || y === "prototype")
44
+ return;
45
+ e[y] = O, e = e[y];
46
+ }
47
+ };
48
+ const Je = {
49
+ BLUR: "blur",
50
+ FOCUS_OUT: "focusout",
51
+ CHANGE: "change"
52
+ }, q = {
53
+ onBlur: "onBlur",
54
+ onChange: "onChange",
55
+ onSubmit: "onSubmit",
56
+ onTouched: "onTouched",
57
+ all: "all"
58
+ }, Y = {
59
+ max: "max",
60
+ min: "min",
61
+ maxLength: "maxLength",
62
+ minLength: "minLength",
63
+ pattern: "pattern",
64
+ required: "required",
65
+ validate: "validate"
66
+ }, ot = P.createContext(null);
67
+ ot.displayName = "HookFormContext";
68
+ const Ot = (e) => {
69
+ const { children: s, ...r } = e;
70
+ return P.createElement(ot.Provider, { value: r }, s);
71
+ };
72
+ var Tt = (e, s, r, a = !0) => {
73
+ const u = {
74
+ defaultValues: s._defaultValues
75
+ };
76
+ for (const n in e)
77
+ Object.defineProperty(u, n, {
78
+ get: () => {
79
+ const c = n;
80
+ return s._proxyFormState[c] !== q.all && (s._proxyFormState[c] = !a || q.all), r && (r[c] = !0), e[c];
81
+ }
82
+ });
83
+ return u;
84
+ };
85
+ const Rt = typeof window < "u" ? je.useLayoutEffect : je.useEffect;
86
+ var K = (e) => typeof e == "string", Nt = (e, s, r, a, u) => K(e) ? (a && s.watch.add(e), h(r, e, u)) : Array.isArray(e) ? e.map((n) => (a && s.watch.add(n), h(r, n))) : (a && (s.watchAll = !0), r), Mt = (e, s, r, a, u) => s ? {
87
+ ...r[e],
88
+ types: {
89
+ ...r[e] && r[e].types ? r[e].types : {},
90
+ [a]: u || !0
91
+ }
92
+ } : {}, de = (e) => Array.isArray(e) ? e : [e], Qe = () => {
93
+ let e = [];
94
+ return {
95
+ get observers() {
96
+ return e;
97
+ },
98
+ next: (u) => {
99
+ for (const n of e)
100
+ n.next && n.next(u);
101
+ },
102
+ subscribe: (u) => (e.push(u), {
103
+ unsubscribe: () => {
104
+ e = e.filter((n) => n !== u);
105
+ }
106
+ }),
107
+ unsubscribe: () => {
108
+ e = [];
109
+ }
110
+ };
111
+ }, Le = (e) => N(e) || !ut(e);
112
+ function ee(e, s) {
113
+ if (Le(e) || Le(s))
114
+ return e === s;
115
+ if (re(e) && re(s))
116
+ return e.getTime() === s.getTime();
117
+ const r = Object.keys(e), a = Object.keys(s);
118
+ if (r.length !== a.length)
119
+ return !1;
120
+ for (const u of r) {
121
+ const n = e[u];
122
+ if (!a.includes(u))
123
+ return !1;
124
+ if (u !== "ref") {
125
+ const c = s[u];
126
+ if (re(n) && re(c) || k(n) && k(c) || Array.isArray(n) && Array.isArray(c) ? !ee(n, c) : n !== c)
127
+ return !1;
128
+ }
129
+ }
130
+ return !0;
131
+ }
132
+ var U = (e) => k(e) && !Object.keys(e).length, Ne = (e) => e.type === "file", W = (e) => typeof e == "function", be = (e) => {
133
+ if (!Oe)
134
+ return !1;
135
+ const s = e ? e.ownerDocument : 0;
136
+ return e instanceof (s && s.defaultView ? s.defaultView.HTMLElement : HTMLElement);
137
+ }, dt = (e) => e.type === "select-multiple", Me = (e) => e.type === "radio", Ut = (e) => Me(e) || ce(e), Ce = (e) => be(e) && e.isConnected;
138
+ function Bt(e, s) {
139
+ const r = s.slice(0, -1).length;
140
+ let a = 0;
141
+ for (; a < r; )
142
+ e = S(e) ? a++ : e[s[a++]];
143
+ return e;
144
+ }
145
+ function It(e) {
146
+ for (const s in e)
147
+ if (e.hasOwnProperty(s) && !S(e[s]))
148
+ return !1;
149
+ return !0;
150
+ }
151
+ function L(e, s) {
152
+ const r = Array.isArray(s) ? s : me(s) ? [s] : Re(s), a = r.length === 1 ? e : Bt(e, r), u = r.length - 1, n = r[u];
153
+ return a && delete a[n], u !== 0 && (k(a) && U(a) || Array.isArray(a) && It(a)) && L(e, r.slice(0, -1)), e;
154
+ }
155
+ var ft = (e) => {
156
+ for (const s in e)
157
+ if (W(e[s]))
158
+ return !0;
159
+ return !1;
160
+ };
161
+ function _e(e, s = {}) {
162
+ const r = Array.isArray(e);
163
+ if (k(e) || r)
164
+ for (const a in e)
165
+ Array.isArray(e[a]) || k(e[a]) && !ft(e[a]) ? (s[a] = Array.isArray(e[a]) ? [] : {}, _e(e[a], s[a])) : N(e[a]) || (s[a] = !0);
166
+ return s;
167
+ }
168
+ function ct(e, s, r) {
169
+ const a = Array.isArray(e);
170
+ if (k(e) || a)
171
+ for (const u in e)
172
+ Array.isArray(e[u]) || k(e[u]) && !ft(e[u]) ? S(s) || Le(r[u]) ? r[u] = Array.isArray(e[u]) ? _e(e[u], []) : { ..._e(e[u]) } : ct(e[u], N(s) ? {} : s[u], r[u]) : r[u] = !ee(e[u], s[u]);
173
+ return r;
174
+ }
175
+ var ue = (e, s) => ct(e, s, _e(s));
176
+ const Xe = {
177
+ value: !1,
178
+ isValid: !1
179
+ }, Ze = { value: !0, isValid: !0 };
180
+ var yt = (e) => {
181
+ if (Array.isArray(e)) {
182
+ if (e.length > 1) {
183
+ const s = e.filter((r) => r && r.checked && !r.disabled).map((r) => r.value);
184
+ return { value: s, isValid: !!s.length };
185
+ }
186
+ return e[0].checked && !e[0].disabled ? (
187
+ // @ts-expect-error expected to work in the browser
188
+ e[0].attributes && !S(e[0].attributes.value) ? S(e[0].value) || e[0].value === "" ? Ze : { value: e[0].value, isValid: !0 } : Ze
189
+ ) : Xe;
190
+ }
191
+ return Xe;
192
+ }, ht = (e, { valueAsNumber: s, valueAsDate: r, setValueAs: a }) => S(e) ? e : s ? e === "" ? NaN : e && +e : r && K(e) ? new Date(e) : a ? a(e) : e;
193
+ const et = {
194
+ isValid: !1,
195
+ value: null
196
+ };
197
+ var gt = (e) => Array.isArray(e) ? e.reduce((s, r) => r && r.checked && !r.disabled ? {
198
+ isValid: !0,
199
+ value: r.value
200
+ } : s, et) : et;
201
+ function tt(e) {
202
+ const s = e.ref;
203
+ return Ne(s) ? s.files : Me(s) ? gt(e.refs).value : dt(s) ? [...s.selectedOptions].map(({ value: r }) => r) : ce(s) ? yt(e.refs).value : ht(S(s.value) ? e.ref.value : s.value, e);
204
+ }
205
+ var Pt = (e, s, r, a) => {
206
+ const u = {};
207
+ for (const n of e) {
208
+ const c = h(s, n);
209
+ c && A(u, n, c._f);
210
+ }
211
+ return {
212
+ criteriaMode: r,
213
+ names: [...e],
214
+ fields: u,
215
+ shouldUseNativeValidation: a
216
+ };
217
+ }, Ve = (e) => e instanceof RegExp, oe = (e) => S(e) ? e : Ve(e) ? e.source : k(e) ? Ve(e.value) ? e.value.source : e.value : e, rt = (e) => ({
218
+ isOnSubmit: !e || e === q.onSubmit,
219
+ isOnBlur: e === q.onBlur,
220
+ isOnChange: e === q.onChange,
221
+ isOnAll: e === q.all,
222
+ isOnTouch: e === q.onTouched
223
+ });
224
+ const st = "AsyncFunction";
225
+ var pt = (e) => !!e && !!e.validate && !!(W(e.validate) && e.validate.constructor.name === st || k(e.validate) && Object.values(e.validate).find((s) => s.constructor.name === st)), qt = (e) => e.mount && (e.required || e.min || e.max || e.maxLength || e.minLength || e.pattern || e.validate), it = (e, s, r) => !r && (s.watchAll || s.watch.has(e) || [...s.watch].some((a) => e.startsWith(a) && /^\.\w+/.test(e.slice(a.length))));
226
+ const fe = (e, s, r, a) => {
227
+ for (const u of r || Object.keys(e)) {
228
+ const n = h(e, u);
229
+ if (n) {
230
+ const { _f: c, ...y } = n;
231
+ if (c) {
232
+ if (c.refs && c.refs[0] && s(c.refs[0], u) && !a)
233
+ return !0;
234
+ if (c.ref && s(c.ref, c.name) && !a)
235
+ return !0;
236
+ if (fe(y, s))
237
+ break;
238
+ } else if (k(y) && fe(y, s))
239
+ break;
240
+ }
241
+ }
242
+ };
243
+ function at(e, s, r) {
244
+ const a = h(e, r);
245
+ if (a || me(r))
246
+ return {
247
+ error: a,
248
+ name: r
249
+ };
250
+ const u = r.split(".");
251
+ for (; u.length; ) {
252
+ const n = u.join("."), c = h(s, n), y = h(e, n);
253
+ if (c && !Array.isArray(c) && r !== n)
254
+ return { name: r };
255
+ if (y && y.type)
256
+ return {
257
+ name: n,
258
+ error: y
259
+ };
260
+ if (y && y.root && y.root.type)
261
+ return {
262
+ name: `${n}.root`,
263
+ error: y.root
264
+ };
265
+ u.pop();
266
+ }
267
+ return {
268
+ name: r
269
+ };
270
+ }
271
+ var Wt = (e, s, r, a) => {
272
+ r(e);
273
+ const { name: u, ...n } = e;
274
+ return U(n) || Object.keys(n).length >= Object.keys(s).length || Object.keys(n).find((c) => s[c] === (!a || q.all));
275
+ }, Ht = (e, s, r) => !e || !s || e === s || de(e).some((a) => a && (r ? a === s : a.startsWith(s) || s.startsWith(a))), zt = (e, s, r, a, u) => u.isOnAll ? !1 : !r && u.isOnTouch ? !(s || e) : (r ? a.isOnBlur : u.isOnBlur) ? !e : (r ? a.isOnChange : u.isOnChange) ? e : !0, $t = (e, s) => !Te(h(e, s)).length && L(e, s), jt = (e, s, r) => {
276
+ const a = de(h(e, r));
277
+ return A(a, "root", s[r]), A(e, r, a), e;
278
+ }, ve = (e) => K(e);
279
+ function lt(e, s, r = "validate") {
280
+ if (ve(e) || Array.isArray(e) && e.every(ve) || j(e) && !e)
281
+ return {
282
+ type: r,
283
+ message: ve(e) ? e : "",
284
+ ref: s
285
+ };
286
+ }
287
+ var ae = (e) => k(e) && !Ve(e) ? e : {
288
+ value: e,
289
+ message: ""
290
+ }, nt = async (e, s, r, a, u, n) => {
291
+ const { ref: c, refs: y, required: O, maxLength: B, minLength: F, min: w, max: v, pattern: le, validate: J, name: E, valueAsNumber: Q, mount: Fe } = e._f, _ = h(r, E);
292
+ if (!Fe || s.has(E))
293
+ return {};
294
+ const G = y ? y[0] : c, H = (b) => {
295
+ u && G.reportValidity && (G.setCustomValidity(j(b) ? "" : b || ""), G.reportValidity());
296
+ }, C = {}, ye = Me(c), X = ce(c), xe = ye || X, p = (Q || Ne(c)) && S(c.value) && S(_) || be(c) && c.value === "" || _ === "" || Array.isArray(_) && !_.length, te = Mt.bind(null, E, a, C), z = (b, m, D, R = Y.maxLength, M = Y.minLength) => {
297
+ const $ = b ? m : D;
298
+ C[E] = {
299
+ type: b ? R : M,
300
+ message: $,
301
+ ref: c,
302
+ ...te(b ? R : M, $)
303
+ };
304
+ };
305
+ if (n ? !Array.isArray(_) || !_.length : O && (!xe && (p || N(_)) || j(_) && !_ || X && !yt(y).isValid || ye && !gt(y).isValid)) {
306
+ const { value: b, message: m } = ve(O) ? { value: !!O, message: O } : ae(O);
307
+ if (b && (C[E] = {
308
+ type: Y.required,
309
+ message: m,
310
+ ref: G,
311
+ ...te(Y.required, m)
312
+ }, !a))
313
+ return H(m), C;
314
+ }
315
+ if (!p && (!N(w) || !N(v))) {
316
+ let b, m;
317
+ const D = ae(v), R = ae(w);
318
+ if (!N(_) && !isNaN(_)) {
319
+ const M = c.valueAsNumber || _ && +_;
320
+ N(D.value) || (b = M > D.value), N(R.value) || (m = M < R.value);
321
+ } else {
322
+ const M = c.valueAsDate || new Date(_), $ = (he) => /* @__PURE__ */ new Date((/* @__PURE__ */ new Date()).toDateString() + " " + he), ne = c.type == "time", se = c.type == "week";
323
+ K(D.value) && _ && (b = ne ? $(_) > $(D.value) : se ? _ > D.value : M > new Date(D.value)), K(R.value) && _ && (m = ne ? $(_) < $(R.value) : se ? _ < R.value : M < new Date(R.value));
324
+ }
325
+ if ((b || m) && (z(!!b, D.message, R.message, Y.max, Y.min), !a))
326
+ return H(C[E].message), C;
327
+ }
328
+ if ((B || F) && !p && (K(_) || n && Array.isArray(_))) {
329
+ const b = ae(B), m = ae(F), D = !N(b.value) && _.length > +b.value, R = !N(m.value) && _.length < +m.value;
330
+ if ((D || R) && (z(D, b.message, m.message), !a))
331
+ return H(C[E].message), C;
332
+ }
333
+ if (le && !p && K(_)) {
334
+ const { value: b, message: m } = ae(le);
335
+ if (Ve(b) && !_.match(b) && (C[E] = {
336
+ type: Y.pattern,
337
+ message: m,
338
+ ref: c,
339
+ ...te(Y.pattern, m)
340
+ }, !a))
341
+ return H(m), C;
342
+ }
343
+ if (J) {
344
+ if (W(J)) {
345
+ const b = await J(_, r), m = lt(b, G);
346
+ if (m && (C[E] = {
347
+ ...m,
348
+ ...te(Y.validate, m.message)
349
+ }, !a))
350
+ return H(m.message), C;
351
+ } else if (k(J)) {
352
+ let b = {};
353
+ for (const m in J) {
354
+ if (!U(b) && !a)
355
+ break;
356
+ const D = lt(await J[m](_, r), G, m);
357
+ D && (b = {
358
+ ...D,
359
+ ...te(m, D.message)
360
+ }, H(D.message), a && (C[E] = b));
361
+ }
362
+ if (!U(b) && (C[E] = {
363
+ ref: G,
364
+ ...b
365
+ }, !a))
366
+ return C;
367
+ }
368
+ }
369
+ return H(!0), C;
370
+ };
371
+ const Kt = {
372
+ mode: q.onSubmit,
373
+ reValidateMode: q.onChange,
374
+ shouldFocusError: !0
375
+ };
376
+ function Gt(e = {}) {
377
+ let s = {
378
+ ...Kt,
379
+ ...e
380
+ }, r = {
381
+ submitCount: 0,
382
+ isDirty: !1,
383
+ isReady: !1,
384
+ isLoading: W(s.defaultValues),
385
+ isValidating: !1,
386
+ isSubmitted: !1,
387
+ isSubmitting: !1,
388
+ isSubmitSuccessful: !1,
389
+ isValid: !1,
390
+ touchedFields: {},
391
+ dirtyFields: {},
392
+ validatingFields: {},
393
+ errors: s.errors || {},
394
+ disabled: s.disabled || !1
395
+ };
396
+ const a = {};
397
+ let u = k(s.defaultValues) || k(s.values) ? T(s.defaultValues || s.values) || {} : {}, n = s.shouldUnregister ? {} : T(u), c = {
398
+ action: !1,
399
+ mount: !1,
400
+ watch: !1
401
+ }, y = {
402
+ mount: /* @__PURE__ */ new Set(),
403
+ disabled: /* @__PURE__ */ new Set(),
404
+ unMount: /* @__PURE__ */ new Set(),
405
+ array: /* @__PURE__ */ new Set(),
406
+ watch: /* @__PURE__ */ new Set()
407
+ }, O, B = 0;
408
+ const F = {
409
+ isDirty: !1,
410
+ dirtyFields: !1,
411
+ validatingFields: !1,
412
+ touchedFields: !1,
413
+ isValidating: !1,
414
+ isValid: !1,
415
+ errors: !1
416
+ };
417
+ let w = {
418
+ ...F
419
+ };
420
+ const v = {
421
+ array: Qe(),
422
+ state: Qe()
423
+ }, le = s.criteriaMode === q.all, J = (t) => (i) => {
424
+ clearTimeout(B), B = setTimeout(t, i);
425
+ }, E = async (t) => {
426
+ if (!s.disabled && (F.isValid || w.isValid || t)) {
427
+ const i = s.resolver ? U((await X()).errors) : await p(a, !0);
428
+ i !== r.isValid && v.state.next({
429
+ isValid: i
430
+ });
431
+ }
432
+ }, Q = (t, i) => {
433
+ !s.disabled && (F.isValidating || F.validatingFields || w.isValidating || w.validatingFields) && ((t || Array.from(y.mount)).forEach((l) => {
434
+ l && (i ? A(r.validatingFields, l, i) : L(r.validatingFields, l));
435
+ }), v.state.next({
436
+ validatingFields: r.validatingFields,
437
+ isValidating: !U(r.validatingFields)
438
+ }));
439
+ }, Fe = (t, i = [], l, f, d = !0, o = !0) => {
440
+ if (f && l && !s.disabled) {
441
+ if (c.action = !0, o && Array.isArray(h(a, t))) {
442
+ const g = l(h(a, t), f.argA, f.argB);
443
+ d && A(a, t, g);
444
+ }
445
+ if (o && Array.isArray(h(r.errors, t))) {
446
+ const g = l(h(r.errors, t), f.argA, f.argB);
447
+ d && A(r.errors, t, g), $t(r.errors, t);
448
+ }
449
+ if ((F.touchedFields || w.touchedFields) && o && Array.isArray(h(r.touchedFields, t))) {
450
+ const g = l(h(r.touchedFields, t), f.argA, f.argB);
451
+ d && A(r.touchedFields, t, g);
452
+ }
453
+ (F.dirtyFields || w.dirtyFields) && (r.dirtyFields = ue(u, n)), v.state.next({
454
+ name: t,
455
+ isDirty: z(t, i),
456
+ dirtyFields: r.dirtyFields,
457
+ errors: r.errors,
458
+ isValid: r.isValid
459
+ });
460
+ } else
461
+ A(n, t, i);
462
+ }, _ = (t, i) => {
463
+ A(r.errors, t, i), v.state.next({
464
+ errors: r.errors
465
+ });
466
+ }, G = (t) => {
467
+ r.errors = t, v.state.next({
468
+ errors: r.errors,
469
+ isValid: !1
470
+ });
471
+ }, H = (t, i, l, f) => {
472
+ const d = h(a, t);
473
+ if (d) {
474
+ const o = h(n, t, S(l) ? h(u, t) : l);
475
+ S(o) || f && f.defaultChecked || i ? A(n, t, i ? o : tt(d._f)) : D(t, o), c.mount && E();
476
+ }
477
+ }, C = (t, i, l, f, d) => {
478
+ let o = !1, g = !1;
479
+ const V = {
480
+ name: t
481
+ };
482
+ if (!s.disabled) {
483
+ if (!l || f) {
484
+ (F.isDirty || w.isDirty) && (g = r.isDirty, r.isDirty = V.isDirty = z(), o = g !== V.isDirty);
485
+ const x = ee(h(u, t), i);
486
+ g = !!h(r.dirtyFields, t), x ? L(r.dirtyFields, t) : A(r.dirtyFields, t, !0), V.dirtyFields = r.dirtyFields, o = o || (F.dirtyFields || w.dirtyFields) && g !== !x;
487
+ }
488
+ if (l) {
489
+ const x = h(r.touchedFields, t);
490
+ x || (A(r.touchedFields, t, l), V.touchedFields = r.touchedFields, o = o || (F.touchedFields || w.touchedFields) && x !== l);
491
+ }
492
+ o && d && v.state.next(V);
493
+ }
494
+ return o ? V : {};
495
+ }, ye = (t, i, l, f) => {
496
+ const d = h(r.errors, t), o = (F.isValid || w.isValid) && j(i) && r.isValid !== i;
497
+ if (s.delayError && l ? (O = J(() => _(t, l)), O(s.delayError)) : (clearTimeout(B), O = null, l ? A(r.errors, t, l) : L(r.errors, t)), (l ? !ee(d, l) : d) || !U(f) || o) {
498
+ const g = {
499
+ ...f,
500
+ ...o && j(i) ? { isValid: i } : {},
501
+ errors: r.errors,
502
+ name: t
503
+ };
504
+ r = {
505
+ ...r,
506
+ ...g
507
+ }, v.state.next(g);
508
+ }
509
+ }, X = async (t) => {
510
+ Q(t, !0);
511
+ const i = await s.resolver(n, s.context, Pt(t || y.mount, a, s.criteriaMode, s.shouldUseNativeValidation));
512
+ return Q(t), i;
513
+ }, xe = async (t) => {
514
+ const { errors: i } = await X(t);
515
+ if (t)
516
+ for (const l of t) {
517
+ const f = h(i, l);
518
+ f ? A(r.errors, l, f) : L(r.errors, l);
519
+ }
520
+ else
521
+ r.errors = i;
522
+ return i;
523
+ }, p = async (t, i, l = {
524
+ valid: !0
525
+ }) => {
526
+ for (const f in t) {
527
+ const d = t[f];
528
+ if (d) {
529
+ const { _f: o, ...g } = d;
530
+ if (o) {
531
+ const V = y.array.has(o.name), x = d._f && pt(d._f);
532
+ x && F.validatingFields && Q([f], !0);
533
+ const I = await nt(d, y.disabled, n, le, s.shouldUseNativeValidation && !i, V);
534
+ if (x && F.validatingFields && Q([f]), I[o.name] && (l.valid = !1, i))
535
+ break;
536
+ !i && (h(I, o.name) ? V ? jt(r.errors, I, o.name) : A(r.errors, o.name, I[o.name]) : L(r.errors, o.name));
537
+ }
538
+ !U(g) && await p(g, i, l);
539
+ }
540
+ }
541
+ return l.valid;
542
+ }, te = () => {
543
+ for (const t of y.unMount) {
544
+ const i = h(a, t);
545
+ i && (i._f.refs ? i._f.refs.every((l) => !Ce(l)) : !Ce(i._f.ref)) && Ae(t);
546
+ }
547
+ y.unMount = /* @__PURE__ */ new Set();
548
+ }, z = (t, i) => !s.disabled && (t && i && A(n, t, i), !ee(he(), u)), b = (t, i, l) => Nt(t, y, {
549
+ ...c.mount ? n : S(i) ? u : K(t) ? { [t]: i } : i
550
+ }, l, i), m = (t) => Te(h(c.mount ? n : u, t, s.shouldUnregister ? h(u, t, []) : [])), D = (t, i, l = {}) => {
551
+ const f = h(a, t);
552
+ let d = i;
553
+ if (f) {
554
+ const o = f._f;
555
+ o && (!o.disabled && A(n, t, ht(i, o)), d = be(o.ref) && N(i) ? "" : i, dt(o.ref) ? [...o.ref.options].forEach((g) => g.selected = d.includes(g.value)) : o.refs ? ce(o.ref) ? o.refs.forEach((g) => {
556
+ (!g.defaultChecked || !g.disabled) && (Array.isArray(d) ? g.checked = !!d.find((V) => V === g.value) : g.checked = d === g.value || !!d);
557
+ }) : o.refs.forEach((g) => g.checked = g.value === d) : Ne(o.ref) ? o.ref.value = "" : (o.ref.value = d, o.ref.type || v.state.next({
558
+ name: t,
559
+ values: T(n)
560
+ })));
561
+ }
562
+ (l.shouldDirty || l.shouldTouch) && C(t, d, l.shouldTouch, l.shouldDirty, !0), l.shouldValidate && se(t);
563
+ }, R = (t, i, l) => {
564
+ for (const f in i) {
565
+ if (!i.hasOwnProperty(f))
566
+ return;
567
+ const d = i[f], o = t + "." + f, g = h(a, o);
568
+ (y.array.has(t) || k(d) || g && !g._f) && !re(d) ? R(o, d, l) : D(o, d, l);
569
+ }
570
+ }, M = (t, i, l = {}) => {
571
+ const f = h(a, t), d = y.array.has(t), o = T(i);
572
+ A(n, t, o), d ? (v.array.next({
573
+ name: t,
574
+ values: T(n)
575
+ }), (F.isDirty || F.dirtyFields || w.isDirty || w.dirtyFields) && l.shouldDirty && v.state.next({
576
+ name: t,
577
+ dirtyFields: ue(u, n),
578
+ isDirty: z(t, o)
579
+ })) : f && !f._f && !N(o) ? R(t, o, l) : D(t, o, l), it(t, y) && v.state.next({ ...r }), v.state.next({
580
+ name: c.mount ? t : void 0,
581
+ values: T(n)
582
+ });
583
+ }, $ = async (t) => {
584
+ c.mount = !0;
585
+ const i = t.target;
586
+ let l = i.name, f = !0;
587
+ const d = h(a, l), o = (x) => {
588
+ f = Number.isNaN(x) || re(x) && isNaN(x.getTime()) || ee(x, h(n, l, x));
589
+ }, g = rt(s.mode), V = rt(s.reValidateMode);
590
+ if (d) {
591
+ let x, I;
592
+ const ge = i.type ? tt(d._f) : St(t), Z = t.type === Je.BLUR || t.type === Je.FOCUS_OUT, At = !qt(d._f) && !s.resolver && !h(r.errors, l) && !d._f.deps || zt(Z, h(r.touchedFields, l), r.isSubmitted, V, g), ke = it(l, y, Z);
593
+ A(n, l, ge), Z ? (d._f.onBlur && d._f.onBlur(t), O && O(0)) : d._f.onChange && d._f.onChange(t);
594
+ const Se = C(l, ge, Z), wt = !U(Se) || ke;
595
+ if (!Z && v.state.next({
596
+ name: l,
597
+ type: t.type,
598
+ values: T(n)
599
+ }), At)
600
+ return (F.isValid || w.isValid) && (s.mode === "onBlur" ? Z && E() : Z || E()), wt && v.state.next({ name: l, ...ke ? {} : Se });
601
+ if (!Z && ke && v.state.next({ ...r }), s.resolver) {
602
+ const { errors: ze } = await X([l]);
603
+ if (o(ge), f) {
604
+ const Dt = at(r.errors, a, l), $e = at(ze, a, Dt.name || l);
605
+ x = $e.error, l = $e.name, I = U(ze);
606
+ }
607
+ } else
608
+ Q([l], !0), x = (await nt(d, y.disabled, n, le, s.shouldUseNativeValidation))[l], Q([l]), o(ge), f && (x ? I = !1 : (F.isValid || w.isValid) && (I = await p(a, !0)));
609
+ f && (d._f.deps && se(d._f.deps), ye(l, I, x, Se));
610
+ }
611
+ }, ne = (t, i) => {
612
+ if (h(r.errors, i) && t.focus)
613
+ return t.focus(), 1;
614
+ }, se = async (t, i = {}) => {
615
+ let l, f;
616
+ const d = de(t);
617
+ if (s.resolver) {
618
+ const o = await xe(S(t) ? t : d);
619
+ l = U(o), f = t ? !d.some((g) => h(o, g)) : l;
620
+ } else
621
+ t ? (f = (await Promise.all(d.map(async (o) => {
622
+ const g = h(a, o);
623
+ return await p(g && g._f ? { [o]: g } : g);
624
+ }))).every(Boolean), !(!f && !r.isValid) && E()) : f = l = await p(a);
625
+ return v.state.next({
626
+ ...!K(t) || (F.isValid || w.isValid) && l !== r.isValid ? {} : { name: t },
627
+ ...s.resolver || !t ? { isValid: l } : {},
628
+ errors: r.errors
629
+ }), i.shouldFocus && !f && fe(a, ne, t ? d : y.mount), f;
630
+ }, he = (t) => {
631
+ const i = {
632
+ ...c.mount ? n : u
633
+ };
634
+ return S(t) ? i : K(t) ? h(i, t) : t.map((l) => h(i, l));
635
+ }, Ue = (t, i) => ({
636
+ invalid: !!h((i || r).errors, t),
637
+ isDirty: !!h((i || r).dirtyFields, t),
638
+ error: h((i || r).errors, t),
639
+ isValidating: !!h(r.validatingFields, t),
640
+ isTouched: !!h((i || r).touchedFields, t)
641
+ }), vt = (t) => {
642
+ t && de(t).forEach((i) => L(r.errors, i)), v.state.next({
643
+ errors: t ? r.errors : {}
644
+ });
645
+ }, Be = (t, i, l) => {
646
+ const f = (h(a, t, { _f: {} })._f || {}).ref, d = h(r.errors, t) || {}, { ref: o, message: g, type: V, ...x } = d;
647
+ A(r.errors, t, {
648
+ ...x,
649
+ ...i,
650
+ ref: f
651
+ }), v.state.next({
652
+ name: t,
653
+ errors: r.errors,
654
+ isValid: !1
655
+ }), l && l.shouldFocus && f && f.focus && f.focus();
656
+ }, bt = (t, i) => W(t) ? v.state.subscribe({
657
+ next: (l) => t(b(void 0, i), l)
658
+ }) : b(t, i, !0), Ie = (t) => v.state.subscribe({
659
+ next: (i) => {
660
+ Ht(t.name, i.name, t.exact) && Wt(i, t.formState || F, xt, t.reRenderRoot) && t.callback({
661
+ values: { ...n },
662
+ ...r,
663
+ ...i
664
+ });
665
+ }
666
+ }).unsubscribe, _t = (t) => (c.mount = !0, w = {
667
+ ...w,
668
+ ...t.formState
669
+ }, Ie({
670
+ ...t,
671
+ formState: w
672
+ })), Ae = (t, i = {}) => {
673
+ for (const l of t ? de(t) : y.mount)
674
+ y.mount.delete(l), y.array.delete(l), i.keepValue || (L(a, l), L(n, l)), !i.keepError && L(r.errors, l), !i.keepDirty && L(r.dirtyFields, l), !i.keepTouched && L(r.touchedFields, l), !i.keepIsValidating && L(r.validatingFields, l), !s.shouldUnregister && !i.keepDefaultValue && L(u, l);
675
+ v.state.next({
676
+ values: T(n)
677
+ }), v.state.next({
678
+ ...r,
679
+ ...i.keepDirty ? { isDirty: z() } : {}
680
+ }), !i.keepIsValid && E();
681
+ }, Pe = ({ disabled: t, name: i }) => {
682
+ (j(t) && c.mount || t || y.disabled.has(i)) && (t ? y.disabled.add(i) : y.disabled.delete(i));
683
+ }, we = (t, i = {}) => {
684
+ let l = h(a, t);
685
+ const f = j(i.disabled) || j(s.disabled);
686
+ return A(a, t, {
687
+ ...l || {},
688
+ _f: {
689
+ ...l && l._f ? l._f : { ref: { name: t } },
690
+ name: t,
691
+ mount: !0,
692
+ ...i
693
+ }
694
+ }), y.mount.add(t), l ? Pe({
695
+ disabled: j(i.disabled) ? i.disabled : s.disabled,
696
+ name: t
697
+ }) : H(t, !0, i.value), {
698
+ ...f ? { disabled: i.disabled || s.disabled } : {},
699
+ ...s.progressive ? {
700
+ required: !!i.required,
701
+ min: oe(i.min),
702
+ max: oe(i.max),
703
+ minLength: oe(i.minLength),
704
+ maxLength: oe(i.maxLength),
705
+ pattern: oe(i.pattern)
706
+ } : {},
707
+ name: t,
708
+ onChange: $,
709
+ onBlur: $,
710
+ ref: (d) => {
711
+ if (d) {
712
+ we(t, i), l = h(a, t);
713
+ const o = S(d.value) && d.querySelectorAll && d.querySelectorAll("input,select,textarea")[0] || d, g = Ut(o), V = l._f.refs || [];
714
+ if (g ? V.find((x) => x === o) : o === l._f.ref)
715
+ return;
716
+ A(a, t, {
717
+ _f: {
718
+ ...l._f,
719
+ ...g ? {
720
+ refs: [
721
+ ...V.filter(Ce),
722
+ o,
723
+ ...Array.isArray(h(u, t)) ? [{}] : []
724
+ ],
725
+ ref: { type: o.type, name: t }
726
+ } : { ref: o }
727
+ }
728
+ }), H(t, !1, void 0, o);
729
+ } else
730
+ l = h(a, t, {}), l._f && (l._f.mount = !1), (s.shouldUnregister || i.shouldUnregister) && !(Ct(y.array, t) && c.action) && y.unMount.add(t);
731
+ }
732
+ };
733
+ }, De = () => s.shouldFocusError && fe(a, ne, y.mount), Vt = (t) => {
734
+ j(t) && (v.state.next({ disabled: t }), fe(a, (i, l) => {
735
+ const f = h(a, l);
736
+ f && (i.disabled = f._f.disabled || t, Array.isArray(f._f.refs) && f._f.refs.forEach((d) => {
737
+ d.disabled = f._f.disabled || t;
738
+ }));
739
+ }, 0, !1));
740
+ }, pe = (t, i) => async (l) => {
741
+ let f;
742
+ l && (l.preventDefault && l.preventDefault(), l.persist && l.persist());
743
+ let d = T(n);
744
+ if (v.state.next({
745
+ isSubmitting: !0
746
+ }), s.resolver) {
747
+ const { errors: o, values: g } = await X();
748
+ r.errors = o, d = g;
749
+ } else
750
+ await p(a);
751
+ if (y.disabled.size)
752
+ for (const o of y.disabled)
753
+ A(d, o, void 0);
754
+ if (L(r.errors, "root"), U(r.errors)) {
755
+ v.state.next({
756
+ errors: {}
757
+ });
758
+ try {
759
+ await t(d, l);
760
+ } catch (o) {
761
+ f = o;
762
+ }
763
+ } else
764
+ i && await i({ ...r.errors }, l), De(), setTimeout(De);
765
+ if (v.state.next({
766
+ isSubmitted: !0,
767
+ isSubmitting: !1,
768
+ isSubmitSuccessful: U(r.errors) && !f,
769
+ submitCount: r.submitCount + 1,
770
+ errors: r.errors
771
+ }), f)
772
+ throw f;
773
+ }, mt = (t, i = {}) => {
774
+ h(a, t) && (S(i.defaultValue) ? M(t, T(h(u, t))) : (M(t, i.defaultValue), A(u, t, T(i.defaultValue))), i.keepTouched || L(r.touchedFields, t), i.keepDirty || (L(r.dirtyFields, t), r.isDirty = i.defaultValue ? z(t, T(h(u, t))) : z()), i.keepError || (L(r.errors, t), F.isValid && E()), v.state.next({ ...r }));
775
+ }, qe = (t, i = {}) => {
776
+ const l = t ? T(t) : u, f = T(l), d = U(t), o = d ? u : f;
777
+ if (i.keepDefaultValues || (u = l), !i.keepValues) {
778
+ if (i.keepDirtyValues) {
779
+ const g = /* @__PURE__ */ new Set([
780
+ ...y.mount,
781
+ ...Object.keys(ue(u, n))
782
+ ]);
783
+ for (const V of Array.from(g))
784
+ h(r.dirtyFields, V) ? A(o, V, h(n, V)) : M(V, h(o, V));
785
+ } else {
786
+ if (Oe && S(t))
787
+ for (const g of y.mount) {
788
+ const V = h(a, g);
789
+ if (V && V._f) {
790
+ const x = Array.isArray(V._f.refs) ? V._f.refs[0] : V._f.ref;
791
+ if (be(x)) {
792
+ const I = x.closest("form");
793
+ if (I) {
794
+ I.reset();
795
+ break;
796
+ }
797
+ }
798
+ }
799
+ }
800
+ for (const g of y.mount)
801
+ M(g, h(o, g));
802
+ }
803
+ n = T(o), v.array.next({
804
+ values: { ...o }
805
+ }), v.state.next({
806
+ values: { ...o }
807
+ });
808
+ }
809
+ y = {
810
+ mount: i.keepDirtyValues ? y.mount : /* @__PURE__ */ new Set(),
811
+ unMount: /* @__PURE__ */ new Set(),
812
+ array: /* @__PURE__ */ new Set(),
813
+ disabled: /* @__PURE__ */ new Set(),
814
+ watch: /* @__PURE__ */ new Set(),
815
+ watchAll: !1,
816
+ focus: ""
817
+ }, c.mount = !F.isValid || !!i.keepIsValid || !!i.keepDirtyValues, c.watch = !!s.shouldUnregister, v.state.next({
818
+ submitCount: i.keepSubmitCount ? r.submitCount : 0,
819
+ isDirty: d ? !1 : i.keepDirty ? r.isDirty : !!(i.keepDefaultValues && !ee(t, u)),
820
+ isSubmitted: i.keepIsSubmitted ? r.isSubmitted : !1,
821
+ dirtyFields: d ? {} : i.keepDirtyValues ? i.keepDefaultValues && n ? ue(u, n) : r.dirtyFields : i.keepDefaultValues && t ? ue(u, t) : i.keepDirty ? r.dirtyFields : {},
822
+ touchedFields: i.keepTouched ? r.touchedFields : {},
823
+ errors: i.keepErrors ? r.errors : {},
824
+ isSubmitSuccessful: i.keepIsSubmitSuccessful ? r.isSubmitSuccessful : !1,
825
+ isSubmitting: !1
826
+ });
827
+ }, We = (t, i) => qe(W(t) ? t(n) : t, i), Ft = (t, i = {}) => {
828
+ const l = h(a, t), f = l && l._f;
829
+ if (f) {
830
+ const d = f.refs ? f.refs[0] : f.ref;
831
+ d.focus && (d.focus(), i.shouldSelect && W(d.select) && d.select());
832
+ }
833
+ }, xt = (t) => {
834
+ r = {
835
+ ...r,
836
+ ...t
837
+ };
838
+ }, He = {
839
+ control: {
840
+ register: we,
841
+ unregister: Ae,
842
+ getFieldState: Ue,
843
+ handleSubmit: pe,
844
+ setError: Be,
845
+ _subscribe: Ie,
846
+ _runSchema: X,
847
+ _focusError: De,
848
+ _getWatch: b,
849
+ _getDirty: z,
850
+ _setValid: E,
851
+ _setFieldArray: Fe,
852
+ _setDisabledField: Pe,
853
+ _setErrors: G,
854
+ _getFieldArray: m,
855
+ _reset: qe,
856
+ _resetDefaultValues: () => W(s.defaultValues) && s.defaultValues().then((t) => {
857
+ We(t, s.resetOptions), v.state.next({
858
+ isLoading: !1
859
+ });
860
+ }),
861
+ _removeUnmounted: te,
862
+ _disableForm: Vt,
863
+ _subjects: v,
864
+ _proxyFormState: F,
865
+ get _fields() {
866
+ return a;
867
+ },
868
+ get _formValues() {
869
+ return n;
870
+ },
871
+ get _state() {
872
+ return c;
873
+ },
874
+ set _state(t) {
875
+ c = t;
876
+ },
877
+ get _defaultValues() {
878
+ return u;
879
+ },
880
+ get _names() {
881
+ return y;
882
+ },
883
+ set _names(t) {
884
+ y = t;
885
+ },
886
+ get _formState() {
887
+ return r;
888
+ },
889
+ get _options() {
890
+ return s;
891
+ },
892
+ set _options(t) {
893
+ s = {
894
+ ...s,
895
+ ...t
896
+ };
897
+ }
898
+ },
899
+ subscribe: _t,
900
+ trigger: se,
901
+ register: we,
902
+ handleSubmit: pe,
903
+ watch: bt,
904
+ setValue: M,
905
+ getValues: he,
906
+ reset: We,
907
+ resetField: mt,
908
+ clearErrors: vt,
909
+ unregister: Ae,
910
+ setError: Be,
911
+ setFocus: Ft,
912
+ getFieldState: Ue
913
+ };
914
+ return {
915
+ ...He,
916
+ formControl: He
917
+ };
918
+ }
919
+ function Yt(e = {}) {
920
+ const s = P.useRef(void 0), r = P.useRef(void 0), [a, u] = P.useState({
921
+ isDirty: !1,
922
+ isValidating: !1,
923
+ isLoading: W(e.defaultValues),
924
+ isSubmitted: !1,
925
+ isSubmitting: !1,
926
+ isSubmitSuccessful: !1,
927
+ isValid: !1,
928
+ submitCount: 0,
929
+ dirtyFields: {},
930
+ touchedFields: {},
931
+ validatingFields: {},
932
+ errors: e.errors || {},
933
+ disabled: e.disabled || !1,
934
+ isReady: !1,
935
+ defaultValues: W(e.defaultValues) ? void 0 : e.defaultValues
936
+ });
937
+ if (!s.current)
938
+ if (e.formControl)
939
+ s.current = {
940
+ ...e.formControl,
941
+ formState: a
942
+ }, e.defaultValues && !W(e.defaultValues) && e.formControl.reset(e.defaultValues, e.resetOptions);
943
+ else {
944
+ const { formControl: c, ...y } = Gt(e);
945
+ s.current = {
946
+ ...y,
947
+ formState: a
948
+ };
949
+ }
950
+ const n = s.current.control;
951
+ return n._options = e, Rt(() => {
952
+ const c = n._subscribe({
953
+ formState: n._proxyFormState,
954
+ callback: () => u({ ...n._formState }),
955
+ reRenderRoot: !0
956
+ });
957
+ return u((y) => ({
958
+ ...y,
959
+ isReady: !0
960
+ })), n._formState.isReady = !0, c;
961
+ }, [n]), P.useEffect(() => n._disableForm(e.disabled), [n, e.disabled]), P.useEffect(() => {
962
+ e.mode && (n._options.mode = e.mode), e.reValidateMode && (n._options.reValidateMode = e.reValidateMode);
963
+ }, [n, e.mode, e.reValidateMode]), P.useEffect(() => {
964
+ e.errors && (n._setErrors(e.errors), n._focusError());
965
+ }, [n, e.errors]), P.useEffect(() => {
966
+ e.shouldUnregister && n._subjects.state.next({
967
+ values: n._getWatch()
968
+ });
969
+ }, [n, e.shouldUnregister]), P.useEffect(() => {
970
+ if (n._proxyFormState.isDirty) {
971
+ const c = n._getDirty();
972
+ c !== a.isDirty && n._subjects.state.next({
973
+ isDirty: c
974
+ });
975
+ }
976
+ }, [n, a.isDirty]), P.useEffect(() => {
977
+ e.values && !ee(e.values, r.current) ? (n._reset(e.values, n._options.resetOptions), r.current = e.values, u((c) => ({ ...c }))) : n._resetDefaultValues();
978
+ }, [n, e.values]), P.useEffect(() => {
979
+ n._state.mount || (n._setValid(), n._state.mount = !0), n._state.watch && (n._state.watch = !1, n._subjects.state.next({ ...n._formState })), n._removeUnmounted();
980
+ }), s.current.formState = Tt(a, n), s.current;
981
+ }
982
+ const er = ({ faqId: e, percent: s }) => {
983
+ const [r, a] = kt(!1), u = Yt({
984
+ defaultValues: {
985
+ faq: e
986
+ }
987
+ }), { handleSubmit: n, setValue: c, getValues: y } = u, O = (w) => {
988
+ try {
989
+ a(!0), console.log("Submitted:", w);
990
+ } catch (v) {
991
+ console.error("Error submitting feedback:", v);
992
+ } finally {
993
+ a(!1);
994
+ }
995
+ }, B = (w) => {
996
+ c("rate", w), n(O)();
997
+ }, F = y("rate");
998
+ return /* @__PURE__ */ ie(Ot, { ...u, children: /* @__PURE__ */ ie("form", { children: /* @__PURE__ */ Ee("div", { className: "mt-6 flex items-center gap-6 max-tablet:flex-col max-tablet:items-start", children: [
999
+ /* @__PURE__ */ Ee("div", { className: "border-l-2 border-green pl-6 mr-14 shrink-0", children: [
1000
+ /* @__PURE__ */ ie("span", { className: "text-gray2 block text-[14px] leading-5", children: `${s}% считают ответ полезным` }),
1001
+ /* @__PURE__ */ ie("p", { className: "text-blackBG text-[15px] leading-[22px]", children: "Ответ был полезным?" })
1002
+ ] }),
1003
+ /* @__PURE__ */ Ee("div", { className: "flex items-center gap-4 w-full max-tablet::pt-4", children: [
1004
+ /* @__PURE__ */ ie(
1005
+ Ke,
1006
+ {
1007
+ size: Ge.M,
1008
+ variant: Ye.Secondary,
1009
+ className: "w-[125px]",
1010
+ disabled: r,
1011
+ onClick: () => B("yes"),
1012
+ loading: F === "yes" && r,
1013
+ children: "Да"
1014
+ }
1015
+ ),
1016
+ /* @__PURE__ */ ie(
1017
+ Ke,
1018
+ {
1019
+ size: Ge.M,
1020
+ variant: Ye.Secondary,
1021
+ className: "w-[125px]",
1022
+ disabled: r,
1023
+ onClick: () => B("no"),
1024
+ loading: F === "no" && r,
1025
+ children: "Нет"
1026
+ }
1027
+ )
1028
+ ] })
1029
+ ] }) }) });
1030
+ };
1031
+ export {
1032
+ er as FeedbackForm
1033
+ };