md-components-mdigial-azamat 0.0.293 → 0.0.295
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.
- package/dist/ConfigProvider/index.js +1 -1
- package/dist/FinanceApplicationForm/FinanceApplicationForm.js +196 -157
- package/dist/FinanceApplicationForm/FinanceApplicationFormBuilder.js +184 -155
- package/dist/FinanceApplicationForm/defaultConfig.js +24 -15
- package/dist/FinanceApplicationForm/payloadTemplate.js +38 -28
- package/dist/FinanceApplicationForm/player/submitErrors.js +72 -0
- package/dist/FinanceApplicationForm/schema.js +14 -2
- package/dist/Stepper/Stepper.js +1 -1
- package/dist/assets/index.8fb6dbbd.css +1 -0
- package/package.json +1 -1
- package/dist/assets/index.5961e40b.css +0 -1
|
@@ -1,56 +1,59 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { c as
|
|
4
|
-
import { PlayerRangeField as
|
|
5
|
-
import { PlayerSelectField as
|
|
6
|
-
import { formatFinanceMoney as
|
|
7
|
-
import { B as
|
|
8
|
-
import { b as
|
|
9
|
-
import { C as
|
|
10
|
-
import { C as
|
|
11
|
-
import { getFinanceApplicationFormConfig as
|
|
12
|
-
import { buildFinanceApplicationPayload as
|
|
13
|
-
import { getMonthlyPayment as
|
|
14
|
-
import { DocumentsList as
|
|
15
|
-
import { getInitialValues as
|
|
16
|
-
import { toNumber as
|
|
17
|
-
import { getApiRateRequest as
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { jsxs as i, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as b, useState as x, useEffect as B } from "react";
|
|
3
|
+
import { c as ce } from "../cn-6a4bf187.js";
|
|
4
|
+
import { PlayerRangeField as ie } from "../CustomCalculator/components/player/PlayerRangeField.js";
|
|
5
|
+
import { PlayerSelectField as me } from "../CustomCalculator/components/player/PlayerSelectField.js";
|
|
6
|
+
import { formatFinanceMoney as F } from "../FinanceCalculator/utils/calculations.js";
|
|
7
|
+
import { B as K } from "../index-db918f20.js";
|
|
8
|
+
import { b as Q, a as U } from "../const-6b683c28.js";
|
|
9
|
+
import { C as ue } from "../CheckboxGroup-8262fc49.js";
|
|
10
|
+
import { C as pe } from "../ComponentContainer-dca711c6.js";
|
|
11
|
+
import { getFinanceApplicationFormConfig as de } from "./defaultConfig.js";
|
|
12
|
+
import { buildFinanceApplicationPayload as xe, getFinanceApplicationPayloadFieldMap as he } from "./payloadTemplate.js";
|
|
13
|
+
import { getMonthlyPayment as be } from "./player/calculation.js";
|
|
14
|
+
import { DocumentsList as fe, TextInput as ye, FieldError as v, PhoneInput as ge, textControlClass as we } from "./player/fields.js";
|
|
15
|
+
import { getInitialValues as C, getComputedValue as Ne, isFieldVisible as ve, getCurrencyLabel as V, resolveFieldTemplate as Ce } from "./player/fieldValues.js";
|
|
16
|
+
import { toNumber as Se } from "./player/format.js";
|
|
17
|
+
import { getApiRateRequest as Fe, extractSelectItems as Ee, getResolvedSelectOptions as Pe, extractRateFromResponse as Be } from "./player/remote.js";
|
|
18
|
+
import { readSubmitErrorResponse as Ve, normalizeSubmitErrors as Le } from "./player/submitErrors.js";
|
|
19
|
+
import { getFieldError as ke } from "./player/validation.js";
|
|
20
|
+
const Ye = (f) => {
|
|
21
|
+
var X, R, W, G;
|
|
22
|
+
const t = b(() => de(f), [f]), [L, k] = x(!1), [Y, O] = x(!1), [$, y] = x({}), [j, g] = x(""), [I, E] = x({}), [_, P] = x({}), [D, S] = x(
|
|
23
|
+
() => C(t.fields)
|
|
24
|
+
), h = (e, n) => {
|
|
25
|
+
S((o) => ({
|
|
25
26
|
...o,
|
|
26
27
|
[e]: n
|
|
27
|
-
})),
|
|
28
|
+
})), y((o) => {
|
|
28
29
|
if (!o[e])
|
|
29
30
|
return o;
|
|
30
31
|
const { [e]: a, ...r } = o;
|
|
31
32
|
return r;
|
|
32
|
-
});
|
|
33
|
-
},
|
|
33
|
+
}), g("");
|
|
34
|
+
}, Z = () => {
|
|
35
|
+
S(C(t.fields)), y({}), g(""), O(!1);
|
|
36
|
+
}, c = b(() => {
|
|
34
37
|
const e = {
|
|
35
|
-
...
|
|
36
|
-
...
|
|
38
|
+
...C(t.fields),
|
|
39
|
+
...D
|
|
37
40
|
};
|
|
38
41
|
return t.fields.forEach((n) => {
|
|
39
|
-
n.type === "computed" && (e[n.name] =
|
|
42
|
+
n.type === "computed" && (e[n.name] = Ne(n, e));
|
|
40
43
|
}), e;
|
|
41
|
-
}, [t.fields,
|
|
42
|
-
() =>
|
|
44
|
+
}, [t.fields, D]), l = b(
|
|
45
|
+
() => Fe(t.calculation, c),
|
|
43
46
|
[t.calculation, c]
|
|
44
47
|
);
|
|
45
|
-
|
|
46
|
-
if (!(
|
|
47
|
-
|
|
48
|
+
B(() => {
|
|
49
|
+
if (!(l != null && l.url)) {
|
|
50
|
+
E({});
|
|
48
51
|
return;
|
|
49
52
|
}
|
|
50
53
|
let e = !0;
|
|
51
54
|
return (async () => {
|
|
52
55
|
try {
|
|
53
|
-
const o = await fetch(
|
|
56
|
+
const o = await fetch(l.url);
|
|
54
57
|
if (!o.ok)
|
|
55
58
|
throw new Error(`Rate request failed: ${o.status}`);
|
|
56
59
|
let a;
|
|
@@ -59,16 +62,16 @@ const Te = (h) => {
|
|
|
59
62
|
} catch {
|
|
60
63
|
a = await o.text();
|
|
61
64
|
}
|
|
62
|
-
const r =
|
|
63
|
-
e &&
|
|
65
|
+
const r = Be(a, l.responsePath);
|
|
66
|
+
e && E({ url: l.url, rate: r });
|
|
64
67
|
} catch {
|
|
65
|
-
e &&
|
|
68
|
+
e && E({ url: l.url });
|
|
66
69
|
}
|
|
67
70
|
})(), () => {
|
|
68
71
|
e = !1;
|
|
69
72
|
};
|
|
70
|
-
}, [
|
|
71
|
-
const
|
|
73
|
+
}, [l == null ? void 0 : l.responsePath, l == null ? void 0 : l.url]);
|
|
74
|
+
const q = b(
|
|
72
75
|
() => JSON.stringify(
|
|
73
76
|
t.apiCollections.filter(
|
|
74
77
|
(e) => t.fields.some(
|
|
@@ -87,7 +90,7 @@ const Te = (h) => {
|
|
|
87
90
|
),
|
|
88
91
|
[t.apiCollections, t.fields]
|
|
89
92
|
);
|
|
90
|
-
|
|
93
|
+
B(() => {
|
|
91
94
|
const e = new Set(
|
|
92
95
|
t.fields.filter(
|
|
93
96
|
(a) => {
|
|
@@ -99,7 +102,7 @@ const Te = (h) => {
|
|
|
99
102
|
(a) => e.has(a.id) && !!a.url
|
|
100
103
|
);
|
|
101
104
|
if (n.length === 0) {
|
|
102
|
-
|
|
105
|
+
P({});
|
|
103
106
|
return;
|
|
104
107
|
}
|
|
105
108
|
let o = !0;
|
|
@@ -108,13 +111,13 @@ const Te = (h) => {
|
|
|
108
111
|
const r = await fetch(a.url);
|
|
109
112
|
if (!r.ok)
|
|
110
113
|
throw new Error(`Options request failed: ${r.status}`);
|
|
111
|
-
const u = await r.json(),
|
|
112
|
-
o &&
|
|
114
|
+
const u = await r.json(), m = Ee(u, a.responsePath);
|
|
115
|
+
o && P((p) => ({
|
|
113
116
|
...p,
|
|
114
|
-
[a.id]: { items:
|
|
117
|
+
[a.id]: { items: m }
|
|
115
118
|
}));
|
|
116
119
|
} catch {
|
|
117
|
-
o &&
|
|
120
|
+
o && P((r) => ({
|
|
118
121
|
...r,
|
|
119
122
|
[a.id]: { items: [] }
|
|
120
123
|
}));
|
|
@@ -122,177 +125,189 @@ const Te = (h) => {
|
|
|
122
125
|
}), () => {
|
|
123
126
|
o = !1;
|
|
124
127
|
};
|
|
125
|
-
}, [t.apiCollections, t.fields,
|
|
126
|
-
const
|
|
127
|
-
(e) =>
|
|
128
|
-
),
|
|
128
|
+
}, [t.apiCollections, t.fields, q]);
|
|
129
|
+
const w = t.fields.filter(
|
|
130
|
+
(e) => ve(e, c)
|
|
131
|
+
), ee = w.filter(
|
|
129
132
|
(e) => (e.placement || "form") === "form"
|
|
130
|
-
),
|
|
133
|
+
), te = w.filter(
|
|
131
134
|
(e) => e.placement === "result"
|
|
132
|
-
),
|
|
135
|
+
), N = b(
|
|
133
136
|
() => t.fields.reduce(
|
|
134
|
-
(e, n) => (n.type === "select" && (e[n.name] =
|
|
137
|
+
(e, n) => (n.type === "select" && (e[n.name] = Pe(
|
|
135
138
|
n,
|
|
136
139
|
c,
|
|
137
|
-
|
|
140
|
+
_
|
|
138
141
|
)), e),
|
|
139
142
|
{}
|
|
140
143
|
),
|
|
141
|
-
[t.fields, c,
|
|
142
|
-
),
|
|
144
|
+
[t.fields, c, _]
|
|
145
|
+
), ae = b(
|
|
143
146
|
() => JSON.stringify(
|
|
144
|
-
Object.entries(
|
|
147
|
+
Object.entries(N).map(([e, n]) => [
|
|
145
148
|
e,
|
|
146
149
|
n.map((o) => o.value)
|
|
147
150
|
])
|
|
148
151
|
),
|
|
149
|
-
[
|
|
152
|
+
[N]
|
|
150
153
|
);
|
|
151
|
-
|
|
152
|
-
|
|
154
|
+
B(() => {
|
|
155
|
+
S((e) => {
|
|
153
156
|
const n = {
|
|
154
|
-
...
|
|
157
|
+
...C(t.fields),
|
|
155
158
|
...e
|
|
156
159
|
};
|
|
157
160
|
let o = !1, a = e;
|
|
158
161
|
return t.fields.forEach((r) => {
|
|
159
162
|
if (r.type !== "select")
|
|
160
163
|
return;
|
|
161
|
-
const u =
|
|
164
|
+
const u = N[r.name] || r.options;
|
|
162
165
|
if (u.length === 0)
|
|
163
166
|
return;
|
|
164
|
-
const
|
|
167
|
+
const m = n[r.name];
|
|
165
168
|
u.some(
|
|
166
|
-
(
|
|
169
|
+
(d) => String(d.value) === String(m)
|
|
167
170
|
) || (o || (a = { ...e }, o = !0), a[r.name] = u[0].value);
|
|
168
171
|
}), o ? a : e;
|
|
169
172
|
});
|
|
170
|
-
}, [t.fields,
|
|
171
|
-
const
|
|
173
|
+
}, [t.fields, N, ae]);
|
|
174
|
+
const M = be(
|
|
172
175
|
t,
|
|
173
176
|
c,
|
|
174
|
-
|
|
175
|
-
),
|
|
177
|
+
I.url === (l == null ? void 0 : l.url) ? I.rate : void 0
|
|
178
|
+
), T = w.find(
|
|
176
179
|
(e) => e.type === "money_range" && e.name === (t.calculation.amountField || "price")
|
|
177
|
-
),
|
|
180
|
+
), ne = T ? V(T, t.fields, c) : "", A = (X = t.labels.resultNote) == null ? void 0 : X.replace(/^\*\s*/, "").trim(), oe = !!((R = t.documents) != null && R.title) || !!((G = (W = t.documents) == null ? void 0 : W.items) != null && G.filter(Boolean).length), re = async (e) => {
|
|
178
181
|
var a, r, u;
|
|
179
|
-
e.preventDefault();
|
|
180
|
-
const n =
|
|
181
|
-
(
|
|
182
|
-
const
|
|
183
|
-
return
|
|
182
|
+
e.preventDefault(), g("");
|
|
183
|
+
const n = w.reduce(
|
|
184
|
+
(m, p) => {
|
|
185
|
+
const d = ke(p, c[p.name]);
|
|
186
|
+
return d && (m[p.name] = d), m;
|
|
184
187
|
},
|
|
185
188
|
{}
|
|
186
189
|
);
|
|
187
|
-
if (
|
|
190
|
+
if (y(n), Object.keys(n).length > 0)
|
|
188
191
|
return;
|
|
189
|
-
|
|
192
|
+
k(!0);
|
|
190
193
|
const o = {
|
|
191
194
|
...c,
|
|
192
|
-
monthly:
|
|
195
|
+
monthly: M,
|
|
193
196
|
topic: t.topic
|
|
194
197
|
};
|
|
195
|
-
t.fields.forEach((
|
|
196
|
-
|
|
198
|
+
t.fields.forEach((m) => {
|
|
199
|
+
m.type === "phone" && (o[m.name] = `${m.countryCode || "+996"}${c[m.name] || ""}`);
|
|
197
200
|
});
|
|
198
201
|
try {
|
|
199
|
-
const
|
|
200
|
-
if (
|
|
201
|
-
const p =
|
|
202
|
+
const m = (r = (a = t.submit) == null ? void 0 : a.endpoint) == null ? void 0 : r.trim();
|
|
203
|
+
if (m) {
|
|
204
|
+
const p = xe(
|
|
202
205
|
t.submit.payloadTemplate,
|
|
203
206
|
o
|
|
204
|
-
)
|
|
205
|
-
await fetch(i, {
|
|
207
|
+
), d = await fetch(m, {
|
|
206
208
|
method: t.submit.method || "POST",
|
|
207
209
|
headers: { "Content-Type": "application/json" },
|
|
208
210
|
body: JSON.stringify(p)
|
|
209
211
|
});
|
|
212
|
+
if (!d.ok) {
|
|
213
|
+
const le = await Ve(d), H = Le(
|
|
214
|
+
le,
|
|
215
|
+
w,
|
|
216
|
+
he(t.submit.payloadTemplate),
|
|
217
|
+
t.submit.errorFieldMap
|
|
218
|
+
);
|
|
219
|
+
y(H.fieldErrors), g(H.formError);
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
210
222
|
} else
|
|
211
|
-
await ((u =
|
|
223
|
+
await ((u = f.onSubmit) == null ? void 0 : u.call(f, o));
|
|
224
|
+
y({}), S(C(t.fields)), O(!0);
|
|
225
|
+
} catch {
|
|
226
|
+
g("Не удалось отправить заявку. Попробуйте позже.");
|
|
212
227
|
} finally {
|
|
213
|
-
|
|
228
|
+
k(!1);
|
|
214
229
|
}
|
|
215
|
-
},
|
|
216
|
-
const n = c[e.name], o =
|
|
230
|
+
}, z = (e) => {
|
|
231
|
+
const n = c[e.name], o = $[e.name];
|
|
217
232
|
if (e.type === "text")
|
|
218
|
-
return /* @__PURE__ */
|
|
233
|
+
return /* @__PURE__ */ i(
|
|
219
234
|
"div",
|
|
220
235
|
{
|
|
221
236
|
className: "w-full",
|
|
222
237
|
children: [
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
|
|
238
|
+
/* @__PURE__ */ s(
|
|
239
|
+
ye,
|
|
225
240
|
{
|
|
226
241
|
label: e.label,
|
|
227
242
|
value: String(n || ""),
|
|
228
243
|
placeholder: e.placeholder,
|
|
229
244
|
inputMode: e.inputMode,
|
|
230
|
-
onChange: (a) =>
|
|
245
|
+
onChange: (a) => h(e.name, a)
|
|
231
246
|
}
|
|
232
247
|
),
|
|
233
|
-
/* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ s(v, { error: o })
|
|
234
249
|
]
|
|
235
250
|
},
|
|
236
251
|
e.id
|
|
237
252
|
);
|
|
238
253
|
if (e.type === "phone")
|
|
239
|
-
return /* @__PURE__ */
|
|
254
|
+
return /* @__PURE__ */ i(
|
|
240
255
|
"div",
|
|
241
256
|
{
|
|
242
257
|
className: "w-full",
|
|
243
258
|
children: [
|
|
244
|
-
/* @__PURE__ */
|
|
245
|
-
|
|
259
|
+
/* @__PURE__ */ s(
|
|
260
|
+
ge,
|
|
246
261
|
{
|
|
247
262
|
label: e.label,
|
|
248
263
|
value: String(n || ""),
|
|
249
264
|
countryLabel: e.countryLabel,
|
|
250
265
|
countryCode: e.countryCode,
|
|
251
266
|
maxLength: e.maxLength,
|
|
252
|
-
onChange: (a) =>
|
|
267
|
+
onChange: (a) => h(e.name, a)
|
|
253
268
|
}
|
|
254
269
|
),
|
|
255
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ s(v, { error: o })
|
|
256
271
|
]
|
|
257
272
|
},
|
|
258
273
|
e.id
|
|
259
274
|
);
|
|
260
275
|
if (e.type === "select") {
|
|
261
|
-
const a =
|
|
262
|
-
return /* @__PURE__ */
|
|
276
|
+
const a = N[e.name] || e.options;
|
|
277
|
+
return /* @__PURE__ */ i(
|
|
263
278
|
"div",
|
|
264
279
|
{
|
|
265
280
|
className: "w-full",
|
|
266
281
|
children: [
|
|
267
|
-
/* @__PURE__ */
|
|
268
|
-
|
|
282
|
+
/* @__PURE__ */ s(
|
|
283
|
+
me,
|
|
269
284
|
{
|
|
270
285
|
title: e.label,
|
|
271
286
|
value: n,
|
|
272
287
|
options: a,
|
|
273
288
|
color: t.color,
|
|
274
|
-
onChangeValue: (r) =>
|
|
289
|
+
onChangeValue: (r) => h(e.name, r)
|
|
275
290
|
}
|
|
276
291
|
),
|
|
277
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ s(v, { error: o })
|
|
278
293
|
]
|
|
279
294
|
},
|
|
280
295
|
e.id
|
|
281
296
|
);
|
|
282
297
|
}
|
|
283
298
|
if (e.type === "money_range" || e.type === "term_range") {
|
|
284
|
-
const a = e.type === "money_range" ?
|
|
285
|
-
return /* @__PURE__ */
|
|
299
|
+
const a = e.type === "money_range" ? V(e, t.fields, c) : Ce(e.suffix, t.fields, c);
|
|
300
|
+
return /* @__PURE__ */ i(
|
|
286
301
|
"div",
|
|
287
302
|
{
|
|
288
303
|
className: "flex w-full flex-col gap-2",
|
|
289
304
|
children: [
|
|
290
|
-
e.sectionLabel && /* @__PURE__ */
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
-
|
|
305
|
+
e.sectionLabel && /* @__PURE__ */ s("p", { className: "m-0", children: e.sectionLabel }),
|
|
306
|
+
/* @__PURE__ */ s(
|
|
307
|
+
ie,
|
|
293
308
|
{
|
|
294
309
|
title: e.title || e.label,
|
|
295
|
-
label: e.type === "money_range" ? `${e.minLabel || "Мин. сумма"}: ${
|
|
310
|
+
label: e.type === "money_range" ? `${e.minLabel || "Мин. сумма"}: ${F(e.min)} ${a || ""}, ${e.maxLabel || "Макс. сумма"}: ${F(e.max)} ${a || ""}` : void 0,
|
|
296
311
|
currency: a || "",
|
|
297
312
|
color: t.color,
|
|
298
313
|
min: e.min,
|
|
@@ -301,18 +316,18 @@ const Te = (h) => {
|
|
|
301
316
|
value: n,
|
|
302
317
|
allowedValues: e.allowedValues,
|
|
303
318
|
errorMin: e.min,
|
|
304
|
-
onChangeValue: (r) =>
|
|
319
|
+
onChangeValue: (r) => h(e.name, r)
|
|
305
320
|
}
|
|
306
321
|
),
|
|
307
|
-
e.allowedValues && e.allowedValues.length > 0 && /* @__PURE__ */
|
|
322
|
+
e.allowedValues && e.allowedValues.length > 0 && /* @__PURE__ */ s("div", { className: "w-full overflow-x-auto pb-2", children: /* @__PURE__ */ s("div", { className: "mt-4 flex w-fit gap-3 max-tablet:gap-2", children: e.allowedValues.map((r) => {
|
|
308
323
|
const u = Number(n) === Number(r);
|
|
309
|
-
return /* @__PURE__ */
|
|
324
|
+
return /* @__PURE__ */ i(
|
|
310
325
|
"button",
|
|
311
326
|
{
|
|
312
327
|
type: "button",
|
|
313
|
-
onClick: () =>
|
|
328
|
+
onClick: () => h(e.name, r),
|
|
314
329
|
style: u ? { backgroundColor: t.color } : void 0,
|
|
315
|
-
className:
|
|
330
|
+
className: ce(
|
|
316
331
|
"min-w-[96px] rounded-xl border-none px-4 py-[10px] text-[15px] leading-5 transition-colors max-tablet:min-w-fit max-tablet:px-3 max-tablet:py-1.5 max-tablet:text-sm",
|
|
317
332
|
u ? "text-white" : "bg-lightBlue text-neutral-900 hover:bg-grayBlue"
|
|
318
333
|
),
|
|
@@ -325,27 +340,27 @@ const Te = (h) => {
|
|
|
325
340
|
r
|
|
326
341
|
);
|
|
327
342
|
}) }) }),
|
|
328
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ s(v, { error: o })
|
|
329
344
|
]
|
|
330
345
|
},
|
|
331
346
|
e.id
|
|
332
347
|
);
|
|
333
348
|
}
|
|
334
349
|
if (e.type === "computed") {
|
|
335
|
-
const a =
|
|
336
|
-
return /* @__PURE__ */
|
|
350
|
+
const a = V(e, t.fields, c);
|
|
351
|
+
return /* @__PURE__ */ i(
|
|
337
352
|
"div",
|
|
338
353
|
{
|
|
339
354
|
className: "flex w-full flex-col gap-2",
|
|
340
355
|
children: [
|
|
341
|
-
e.sectionLabel && /* @__PURE__ */
|
|
342
|
-
e.placeholder && /* @__PURE__ */
|
|
343
|
-
/* @__PURE__ */
|
|
356
|
+
e.sectionLabel && /* @__PURE__ */ s("p", { className: "m-0", children: e.sectionLabel }),
|
|
357
|
+
e.placeholder && /* @__PURE__ */ s("span", { className: "text-[13px] leading-[13px] mt-1 text-[#8a96a8]", children: e.placeholder }),
|
|
358
|
+
/* @__PURE__ */ s(
|
|
344
359
|
"input",
|
|
345
360
|
{
|
|
346
|
-
className:
|
|
361
|
+
className: we,
|
|
347
362
|
disabled: !0,
|
|
348
|
-
value: `${
|
|
363
|
+
value: `${F(Se(n))} ${a || e.suffix || ""}`,
|
|
349
364
|
readOnly: !0
|
|
350
365
|
}
|
|
351
366
|
)
|
|
@@ -354,69 +369,93 @@ const Te = (h) => {
|
|
|
354
369
|
e.id
|
|
355
370
|
);
|
|
356
371
|
}
|
|
357
|
-
return e.type === "checkbox" ?
|
|
358
|
-
},
|
|
372
|
+
return e.type === "checkbox" ? J(e) : null;
|
|
373
|
+
}, J = (e) => /* @__PURE__ */ i(
|
|
359
374
|
"div",
|
|
360
375
|
{
|
|
361
376
|
className: "flex flex-col gap-1",
|
|
362
377
|
children: [
|
|
363
|
-
/* @__PURE__ */
|
|
364
|
-
|
|
378
|
+
/* @__PURE__ */ s(
|
|
379
|
+
ue,
|
|
365
380
|
{
|
|
366
381
|
checked: !!c[e.name],
|
|
367
|
-
onChange: (n) =>
|
|
382
|
+
onChange: (n) => h(e.name, n.target.checked),
|
|
368
383
|
label: e.label
|
|
369
384
|
}
|
|
370
385
|
),
|
|
371
|
-
/* @__PURE__ */
|
|
386
|
+
/* @__PURE__ */ s(v, { error: $[e.name] })
|
|
372
387
|
]
|
|
373
388
|
},
|
|
374
389
|
e.id
|
|
375
|
-
)
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
390
|
+
), se = /* @__PURE__ */ i("div", { className: "flex min-h-[360px] flex-col items-center justify-center rounded-[20px] bg-white px-6 py-12 text-center", children: [
|
|
391
|
+
/* @__PURE__ */ s(
|
|
392
|
+
"div",
|
|
393
|
+
{
|
|
394
|
+
className: "mb-6 flex h-16 w-16 items-center justify-center rounded-full text-[34px] font-bold text-white",
|
|
395
|
+
style: { backgroundColor: t.color },
|
|
396
|
+
"aria-hidden": "true",
|
|
397
|
+
children: "✓"
|
|
398
|
+
}
|
|
399
|
+
),
|
|
400
|
+
/* @__PURE__ */ s("h3", { className: "m-0 text-[28px] leading-9 font-bold text-neutral-900", children: t.labels.successTitle }),
|
|
401
|
+
t.labels.successDescription && /* @__PURE__ */ s("p", { className: "m-0 mt-3 max-w-[460px] text-[16px] leading-6 text-[#6f7f95]", children: t.labels.successDescription }),
|
|
402
|
+
/* @__PURE__ */ s(
|
|
403
|
+
K,
|
|
404
|
+
{
|
|
405
|
+
type: "button",
|
|
406
|
+
size: Q.XL,
|
|
407
|
+
variant: U.Primary,
|
|
408
|
+
className: "mt-8 min-w-[260px]",
|
|
409
|
+
onClick: Z,
|
|
410
|
+
children: t.labels.successButton
|
|
411
|
+
}
|
|
412
|
+
)
|
|
413
|
+
] });
|
|
414
|
+
return /* @__PURE__ */ i(pe, { children: [
|
|
415
|
+
t.title && /* @__PURE__ */ s("h2", { className: "text-[26px] leading-[32px] md:text-[44px] md:leading-[52px] font-bold text-neutral-900 text-center m-0 mb-6", children: t.title }),
|
|
416
|
+
Y ? se : /* @__PURE__ */ i(
|
|
379
417
|
"form",
|
|
380
418
|
{
|
|
381
419
|
className: "flex rounded-[20px] overflow-hidden max-tablet:flex-col",
|
|
382
|
-
onSubmit:
|
|
420
|
+
onSubmit: re,
|
|
383
421
|
children: [
|
|
384
|
-
/* @__PURE__ */
|
|
385
|
-
/* @__PURE__ */
|
|
386
|
-
|
|
422
|
+
/* @__PURE__ */ i("div", { className: "w-[60%] flex flex-col items-start justify-center gap-4 bg-white px-[88px] pt-8 pb-16 max-tablet:w-full max-tablet:px-4 max-tablet:py-3", children: [
|
|
423
|
+
/* @__PURE__ */ s("p", { className: "text-[24px] leading-8 font-bold m-0 mb-2 max-tablet:text-center max-tablet:w-full", children: t.labels.formTitle }),
|
|
424
|
+
ee.map(z)
|
|
387
425
|
] }),
|
|
388
|
-
/* @__PURE__ */
|
|
389
|
-
/* @__PURE__ */
|
|
390
|
-
/* @__PURE__ */
|
|
391
|
-
/* @__PURE__ */
|
|
392
|
-
|
|
426
|
+
/* @__PURE__ */ i("div", { className: "w-[40%] bg-[#f7f8fa] px-10 py-8 flex flex-col gap-8 max-tablet:w-full max-tablet:px-5 max-tablet:py-4", children: [
|
|
427
|
+
/* @__PURE__ */ i("div", { className: "bg-white rounded-[20px] shadow-[0px_4px_24px_0px_rgba(55,65,81,0.12)] py-4 px-6 flex flex-col gap-1", children: [
|
|
428
|
+
/* @__PURE__ */ s("span", { className: "text-[14px] leading-5 text-[#8a96a8]", children: t.labels.monthlyPayment }),
|
|
429
|
+
/* @__PURE__ */ i("p", { className: "text-[24px] leading-8 font-semibold text-neutral-900 m-0", children: [
|
|
430
|
+
F(M),
|
|
393
431
|
" ",
|
|
394
|
-
|
|
432
|
+
ne
|
|
395
433
|
] }),
|
|
396
|
-
A && /* @__PURE__ */
|
|
397
|
-
/* @__PURE__ */
|
|
434
|
+
A && /* @__PURE__ */ i("p", { className: "mt-3 mb-0 border-t border-[#d7dce1] pt-3 text-[13px] leading-[18px] text-[#6f7f95]", children: [
|
|
435
|
+
/* @__PURE__ */ s("span", { className: "text-red-500", children: "*" }),
|
|
398
436
|
" ",
|
|
399
437
|
A
|
|
400
438
|
] })
|
|
401
439
|
] }),
|
|
402
|
-
|
|
403
|
-
|
|
440
|
+
oe && /* @__PURE__ */ s(
|
|
441
|
+
fe,
|
|
404
442
|
{
|
|
405
443
|
title: t.documents.title,
|
|
406
444
|
items: t.documents.items
|
|
407
445
|
}
|
|
408
446
|
),
|
|
409
|
-
|
|
410
|
-
(e) => e.type === "checkbox" ?
|
|
447
|
+
te.map(
|
|
448
|
+
(e) => e.type === "checkbox" ? J(e) : z(e)
|
|
411
449
|
),
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
|
|
450
|
+
j && /* @__PURE__ */ s("p", { className: "m-0 rounded-xl bg-red-50 px-4 py-3 text-[13px] leading-[18px] text-red-600", children: j }),
|
|
451
|
+
/* @__PURE__ */ s(
|
|
452
|
+
K,
|
|
414
453
|
{
|
|
415
454
|
type: "submit",
|
|
416
|
-
loading:
|
|
417
|
-
disabled:
|
|
418
|
-
size:
|
|
419
|
-
variant:
|
|
455
|
+
loading: L,
|
|
456
|
+
disabled: L,
|
|
457
|
+
size: Q.XL,
|
|
458
|
+
variant: U.Primary,
|
|
420
459
|
className: "w-full",
|
|
421
460
|
children: t.labels.submit
|
|
422
461
|
}
|
|
@@ -428,5 +467,5 @@ const Te = (h) => {
|
|
|
428
467
|
] });
|
|
429
468
|
};
|
|
430
469
|
export {
|
|
431
|
-
|
|
470
|
+
Ye as FinanceApplicationForm
|
|
432
471
|
};
|