@incodetech/web 0.0.0-dev-20260223-3222aae → 0.0.0-dev-20260223-4e681c2
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/base.css +265 -0
- package/dist/curp-validation/curp-validation.es.js +616 -429
- package/dist/curp-validation/styles.css +146 -21
- package/dist/flow/styles.css +125 -21
- package/dist/themes/dark.css +1 -0
- package/dist/themes/light.css +1 -0
- package/package.json +4 -4
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { u as e, c as
|
|
2
|
-
import { mexicanStates as
|
|
3
|
-
import { g as
|
|
1
|
+
import { u as e, c as E, S, B as N, r as be, a as ge } from "../incodeModule-DPTWfWvu.js";
|
|
2
|
+
import { mexicanStates as we, createCurpValidationManager as De } from "@incodetech/core/curp-validation";
|
|
3
|
+
import { g as ye, D as _, A as V, d as O, y as A, k as ce } from "../vendor-preact-CjD4WiuC.js";
|
|
4
4
|
import "@incodetech/core";
|
|
5
5
|
import "../instance-B-q0ZREN.js";
|
|
6
|
-
import { u as
|
|
7
|
-
import { I as
|
|
8
|
-
import { E as
|
|
9
|
-
import { S as
|
|
10
|
-
import { S as
|
|
11
|
-
import { C as
|
|
12
|
-
const
|
|
13
|
-
const
|
|
6
|
+
import { u as J } from "../useTranslation-CD9ZxEvP.js";
|
|
7
|
+
import { I as ke, P as H } from "../incodeComponent-3T8Qyjnt.js";
|
|
8
|
+
import { E as Z } from "../errorIcon-DjGwgLyL.js";
|
|
9
|
+
import { S as K } from "../successIcon-DV200b2L.js";
|
|
10
|
+
import { S as Le } from "../spinner-C-EwvA9l.js";
|
|
11
|
+
import { C as Re } from "../chevronDown-CU4P7j2Z.js";
|
|
12
|
+
const Ve = ({ class: t }) => {
|
|
13
|
+
const l = ye();
|
|
14
14
|
return /* @__PURE__ */ e(
|
|
15
15
|
"svg",
|
|
16
16
|
{
|
|
@@ -20,10 +20,10 @@ const ee = ({ class: n }) => {
|
|
|
20
20
|
fill: "none",
|
|
21
21
|
xmlns: "http://www.w3.org/2000/svg",
|
|
22
22
|
role: "img",
|
|
23
|
-
"aria-labelledby":
|
|
24
|
-
class:
|
|
23
|
+
"aria-labelledby": l,
|
|
24
|
+
class: t,
|
|
25
25
|
children: [
|
|
26
|
-
/* @__PURE__ */ e("title", { id:
|
|
26
|
+
/* @__PURE__ */ e("title", { id: l, children: "Calendar icon" }),
|
|
27
27
|
/* @__PURE__ */ e(
|
|
28
28
|
"path",
|
|
29
29
|
{
|
|
@@ -63,19 +63,19 @@ const ee = ({ class: n }) => {
|
|
|
63
63
|
]
|
|
64
64
|
}
|
|
65
65
|
);
|
|
66
|
-
},
|
|
67
|
-
width:
|
|
68
|
-
height:
|
|
69
|
-
class:
|
|
66
|
+
}, Se = ({
|
|
67
|
+
width: t = 14,
|
|
68
|
+
height: l = 14,
|
|
69
|
+
class: i
|
|
70
70
|
}) => /* @__PURE__ */ e(
|
|
71
71
|
"svg",
|
|
72
72
|
{
|
|
73
|
-
width:
|
|
74
|
-
height:
|
|
73
|
+
width: t,
|
|
74
|
+
height: l,
|
|
75
75
|
viewBox: "0 0 14 14",
|
|
76
76
|
fill: "none",
|
|
77
77
|
xmlns: "http://www.w3.org/2000/svg",
|
|
78
|
-
class: `IncodeCloseIcon ${
|
|
78
|
+
class: `IncodeCloseIcon ${i || ""}`,
|
|
79
79
|
"aria-hidden": "true",
|
|
80
80
|
children: /* @__PURE__ */ e(
|
|
81
81
|
"path",
|
|
@@ -87,195 +87,229 @@ const ee = ({ class: n }) => {
|
|
|
87
87
|
}
|
|
88
88
|
)
|
|
89
89
|
}
|
|
90
|
-
),
|
|
91
|
-
|
|
90
|
+
), Pe = ({ size: t = 20 }) => /* @__PURE__ */ e(
|
|
91
|
+
"svg",
|
|
92
|
+
{
|
|
93
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
94
|
+
width: t,
|
|
95
|
+
height: t,
|
|
96
|
+
viewBox: "0 0 20 20",
|
|
97
|
+
fill: "none",
|
|
98
|
+
class: "IncodeSearchIcon",
|
|
99
|
+
"aria-hidden": "true",
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ e("title", { children: "Search" }),
|
|
102
|
+
/* @__PURE__ */ e(
|
|
103
|
+
"path",
|
|
104
|
+
{
|
|
105
|
+
d: "M9 17C13.4183 17 17 13.4183 17 9C17 4.58172 13.4183 1 9 1C4.58172 1 1 4.58172 1 9C1 13.4183 4.58172 17 9 17Z",
|
|
106
|
+
stroke: "var(--icon-neutral-300)",
|
|
107
|
+
"stroke-width": "2",
|
|
108
|
+
"stroke-linecap": "round",
|
|
109
|
+
"stroke-linejoin": "round"
|
|
110
|
+
}
|
|
111
|
+
),
|
|
112
|
+
/* @__PURE__ */ e(
|
|
113
|
+
"path",
|
|
114
|
+
{
|
|
115
|
+
d: "M19 19L14.65 14.65",
|
|
116
|
+
stroke: "var(--icon-neutral-300)",
|
|
117
|
+
"stroke-width": "2",
|
|
118
|
+
"stroke-linecap": "round",
|
|
119
|
+
"stroke-linejoin": "round"
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
), He = _((t, l) => {
|
|
125
|
+
const { class: i, type: o = "text", ...n } = t;
|
|
92
126
|
return /* @__PURE__ */ e(
|
|
93
127
|
"input",
|
|
94
128
|
{
|
|
95
|
-
...
|
|
96
|
-
ref:
|
|
97
|
-
type:
|
|
98
|
-
class:
|
|
129
|
+
...n,
|
|
130
|
+
ref: l,
|
|
131
|
+
type: o,
|
|
132
|
+
class: E("IncodeInput", i)
|
|
99
133
|
}
|
|
100
134
|
);
|
|
101
|
-
}),
|
|
135
|
+
}), M = _(
|
|
102
136
|
({
|
|
103
|
-
id:
|
|
104
|
-
label:
|
|
105
|
-
"aria-label":
|
|
106
|
-
type:
|
|
107
|
-
error:
|
|
108
|
-
showErrorIcon:
|
|
137
|
+
id: t,
|
|
138
|
+
label: l,
|
|
139
|
+
"aria-label": i,
|
|
140
|
+
type: o,
|
|
141
|
+
error: n,
|
|
142
|
+
showErrorIcon: h,
|
|
109
143
|
helper: r,
|
|
110
|
-
showHelperIcon:
|
|
111
|
-
closeButton:
|
|
112
|
-
required:
|
|
113
|
-
suppressMessages:
|
|
144
|
+
showHelperIcon: I,
|
|
145
|
+
closeButton: c,
|
|
146
|
+
required: C,
|
|
147
|
+
suppressMessages: g = !1,
|
|
114
148
|
class: f,
|
|
115
|
-
value:
|
|
116
|
-
...
|
|
149
|
+
value: d,
|
|
150
|
+
...v
|
|
117
151
|
}, y) => {
|
|
118
|
-
const
|
|
119
|
-
return /* @__PURE__ */ e("div", { class:
|
|
120
|
-
|
|
152
|
+
const L = `${t}-helper`, k = `${t}-error`, R = g ? "" : [r ? L : null, n ? k : null].filter(Boolean).join(" ");
|
|
153
|
+
return /* @__PURE__ */ e("div", { class: E("IncodeInputComposed", f), children: [
|
|
154
|
+
l && /* @__PURE__ */ e(
|
|
121
155
|
"label",
|
|
122
156
|
{
|
|
123
157
|
class: "IncodeInputComposedLabel",
|
|
124
|
-
htmlFor:
|
|
125
|
-
"data-testid": `${
|
|
126
|
-
children:
|
|
158
|
+
htmlFor: t,
|
|
159
|
+
"data-testid": `${t}-label`,
|
|
160
|
+
children: l
|
|
127
161
|
}
|
|
128
162
|
),
|
|
129
163
|
/* @__PURE__ */ e("div", { class: "IncodeInputComposedWrapper", children: [
|
|
130
164
|
/* @__PURE__ */ e(
|
|
131
|
-
|
|
165
|
+
He,
|
|
132
166
|
{
|
|
133
|
-
id:
|
|
134
|
-
type:
|
|
135
|
-
...
|
|
167
|
+
id: t,
|
|
168
|
+
type: o,
|
|
169
|
+
...v,
|
|
136
170
|
ref: y,
|
|
137
|
-
required:
|
|
138
|
-
"data-has-value": !!(
|
|
139
|
-
...!
|
|
140
|
-
"aria-describedby":
|
|
141
|
-
"aria-required":
|
|
142
|
-
"aria-invalid":
|
|
143
|
-
value:
|
|
171
|
+
required: C,
|
|
172
|
+
"data-has-value": !!(d && String(d).length > 0),
|
|
173
|
+
...!l && i ? { "aria-label": i } : {},
|
|
174
|
+
"aria-describedby": R || void 0,
|
|
175
|
+
"aria-required": C ? "true" : void 0,
|
|
176
|
+
"aria-invalid": n ? "true" : void 0,
|
|
177
|
+
value: d
|
|
144
178
|
}
|
|
145
179
|
),
|
|
146
|
-
|
|
180
|
+
c?.show && /* @__PURE__ */ e(
|
|
147
181
|
"button",
|
|
148
182
|
{
|
|
149
183
|
type: "button",
|
|
150
184
|
"aria-label": "Clear",
|
|
151
185
|
class: "IncodeInputComposedClearButton",
|
|
152
|
-
onClick:
|
|
153
|
-
"data-testid": `${
|
|
154
|
-
children: /* @__PURE__ */ e(
|
|
186
|
+
onClick: c.onClose,
|
|
187
|
+
"data-testid": `${t}-clear`,
|
|
188
|
+
children: /* @__PURE__ */ e(Se, {})
|
|
155
189
|
}
|
|
156
190
|
)
|
|
157
191
|
] }),
|
|
158
|
-
!
|
|
192
|
+
!g && n && /* @__PURE__ */ e(
|
|
159
193
|
"div",
|
|
160
194
|
{
|
|
161
195
|
class: "IncodeInputComposedErrorWrapper",
|
|
162
|
-
"data-testid": `${
|
|
196
|
+
"data-testid": `${t}-error-wrapper`,
|
|
163
197
|
children: [
|
|
164
|
-
|
|
165
|
-
/* @__PURE__ */ e("p", { id:
|
|
198
|
+
h && /* @__PURE__ */ e("div", { class: "IncodeInputComposedIconWrapper", children: /* @__PURE__ */ e(Z, { size: 17 }) }),
|
|
199
|
+
/* @__PURE__ */ e("p", { id: k, class: "IncodeInputComposedError", children: n })
|
|
166
200
|
]
|
|
167
201
|
}
|
|
168
202
|
),
|
|
169
|
-
!
|
|
203
|
+
!g && r && !n && /* @__PURE__ */ e(
|
|
170
204
|
"div",
|
|
171
205
|
{
|
|
172
206
|
class: "IncodeInputComposedHelperWrapper",
|
|
173
|
-
"data-testid": `${
|
|
207
|
+
"data-testid": `${t}-helper-wrapper`,
|
|
174
208
|
children: [
|
|
175
|
-
|
|
176
|
-
/* @__PURE__ */ e("p", { id:
|
|
209
|
+
I && /* @__PURE__ */ e("div", { class: "IncodeInputComposedIconWrapper", children: /* @__PURE__ */ e(K, { size: 17 }) }),
|
|
210
|
+
/* @__PURE__ */ e("p", { id: L, class: "IncodeInputComposedHelper", children: r })
|
|
177
211
|
]
|
|
178
212
|
}
|
|
179
213
|
)
|
|
180
214
|
] });
|
|
181
215
|
}
|
|
182
|
-
),
|
|
183
|
-
curp:
|
|
184
|
-
isValid:
|
|
185
|
-
onCurpChange:
|
|
186
|
-
onVerify:
|
|
187
|
-
onSwitchToGenerate:
|
|
188
|
-
disabled:
|
|
216
|
+
), Te = ({
|
|
217
|
+
curp: t,
|
|
218
|
+
isValid: l,
|
|
219
|
+
onCurpChange: i,
|
|
220
|
+
onVerify: o,
|
|
221
|
+
onSwitchToGenerate: n,
|
|
222
|
+
disabled: h = !1,
|
|
189
223
|
placeholder: r,
|
|
190
|
-
continueLabel:
|
|
191
|
-
dontHaveLabel:
|
|
224
|
+
continueLabel: I,
|
|
225
|
+
dontHaveLabel: c
|
|
192
226
|
}) => {
|
|
193
|
-
const { t:
|
|
227
|
+
const { t: C } = J(), g = r ?? C("curp.placeholder.curp") ?? "CURP", f = I ?? C("curp.continue") ?? "Continue", d = c ?? C("curp.dontHave") ?? "I don't have my CURP", v = C("curp.placeholder.curp") ?? "CURP";
|
|
194
228
|
return /* @__PURE__ */ e("div", { class: "IncodeCurpValidation IncodeCurpInput", children: [
|
|
195
229
|
/* @__PURE__ */ e(
|
|
196
|
-
|
|
230
|
+
M,
|
|
197
231
|
{
|
|
198
232
|
id: "curp-input",
|
|
199
233
|
label: "",
|
|
200
|
-
value:
|
|
201
|
-
onInput: (
|
|
202
|
-
const
|
|
203
|
-
|
|
234
|
+
value: t,
|
|
235
|
+
onInput: (L) => {
|
|
236
|
+
const k = L.target;
|
|
237
|
+
i(k.value.toUpperCase());
|
|
204
238
|
},
|
|
205
|
-
placeholder:
|
|
206
|
-
disabled:
|
|
239
|
+
placeholder: g,
|
|
240
|
+
disabled: h,
|
|
207
241
|
maxLength: 18,
|
|
208
|
-
"aria-label":
|
|
242
|
+
"aria-label": v
|
|
209
243
|
}
|
|
210
244
|
),
|
|
211
|
-
/* @__PURE__ */ e(
|
|
245
|
+
/* @__PURE__ */ e(S, {}),
|
|
212
246
|
/* @__PURE__ */ e(
|
|
213
|
-
|
|
247
|
+
N,
|
|
214
248
|
{
|
|
215
249
|
type: "button",
|
|
216
|
-
onClick:
|
|
217
|
-
disabled: !
|
|
250
|
+
onClick: o,
|
|
251
|
+
disabled: !l || h,
|
|
218
252
|
"data-testid": "curp-verify",
|
|
219
253
|
children: f
|
|
220
254
|
}
|
|
221
255
|
),
|
|
222
256
|
/* @__PURE__ */ e(
|
|
223
|
-
|
|
257
|
+
N,
|
|
224
258
|
{
|
|
225
259
|
type: "button",
|
|
226
|
-
onClick:
|
|
227
|
-
disabled:
|
|
260
|
+
onClick: n,
|
|
261
|
+
disabled: h,
|
|
228
262
|
"data-testid": "curp-switch-to-generate",
|
|
229
263
|
class: "IncodeCurpInputDontHaveButton",
|
|
230
|
-
children:
|
|
264
|
+
children: d
|
|
231
265
|
}
|
|
232
266
|
)
|
|
233
267
|
] });
|
|
234
|
-
},
|
|
268
|
+
}, de = _(
|
|
235
269
|
({
|
|
236
|
-
id:
|
|
237
|
-
label:
|
|
238
|
-
value:
|
|
239
|
-
onInput:
|
|
240
|
-
min:
|
|
241
|
-
max:
|
|
270
|
+
id: t,
|
|
271
|
+
label: l,
|
|
272
|
+
value: i,
|
|
273
|
+
onInput: o,
|
|
274
|
+
min: n,
|
|
275
|
+
max: h,
|
|
242
276
|
placeholder: r = "mm/dd/yyyy",
|
|
243
|
-
error:
|
|
244
|
-
showErrorIcon:
|
|
245
|
-
helper:
|
|
246
|
-
showHelperIcon:
|
|
277
|
+
error: I,
|
|
278
|
+
showErrorIcon: c,
|
|
279
|
+
helper: C,
|
|
280
|
+
showHelperIcon: g,
|
|
247
281
|
suppressMessages: f = !1,
|
|
248
|
-
disabled:
|
|
249
|
-
required:
|
|
282
|
+
disabled: d,
|
|
283
|
+
required: v,
|
|
250
284
|
class: y,
|
|
251
|
-
"data-testid":
|
|
252
|
-
...
|
|
253
|
-
},
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
},
|
|
257
|
-
|
|
258
|
-
const
|
|
259
|
-
if (!(!
|
|
260
|
-
if (
|
|
285
|
+
"data-testid": L,
|
|
286
|
+
...k
|
|
287
|
+
}, R) => {
|
|
288
|
+
const F = V(null), W = `${t}-helper`, T = `${t}-error`, $ = f ? "" : [C ? W : null, I ? T : null].filter(Boolean).join(" "), ee = (P) => {
|
|
289
|
+
F.current = P, typeof R == "function" ? R(P) : R && (R.current = P);
|
|
290
|
+
}, B = (P) => {
|
|
291
|
+
P.preventDefault();
|
|
292
|
+
const s = F.current;
|
|
293
|
+
if (!(!s || d))
|
|
294
|
+
if (s.focus(), "showPicker" in HTMLInputElement.prototype)
|
|
261
295
|
try {
|
|
262
|
-
|
|
296
|
+
s.showPicker();
|
|
263
297
|
} catch {
|
|
264
|
-
|
|
298
|
+
s.click();
|
|
265
299
|
}
|
|
266
300
|
else
|
|
267
|
-
|
|
301
|
+
s.click();
|
|
268
302
|
};
|
|
269
|
-
return /* @__PURE__ */ e("div", { class:
|
|
270
|
-
|
|
303
|
+
return /* @__PURE__ */ e("div", { class: E("IncodeDateInputComposed", y), children: [
|
|
304
|
+
l && /* @__PURE__ */ e(
|
|
271
305
|
"label",
|
|
272
306
|
{
|
|
273
307
|
class: "IncodeDateInputComposedLabel",
|
|
274
|
-
htmlFor:
|
|
275
|
-
"data-testid": `${
|
|
308
|
+
htmlFor: t,
|
|
309
|
+
"data-testid": `${t}-label`,
|
|
276
310
|
children: [
|
|
277
|
-
|
|
278
|
-
|
|
311
|
+
l,
|
|
312
|
+
v && /* @__PURE__ */ e("span", { class: "IncodeDateInputComposedRequired", children: " *" })
|
|
279
313
|
]
|
|
280
314
|
}
|
|
281
315
|
),
|
|
@@ -283,23 +317,23 @@ const ee = ({ class: n }) => {
|
|
|
283
317
|
/* @__PURE__ */ e(
|
|
284
318
|
"input",
|
|
285
319
|
{
|
|
286
|
-
ref:
|
|
287
|
-
id:
|
|
320
|
+
ref: ee,
|
|
321
|
+
id: t,
|
|
288
322
|
type: "date",
|
|
289
323
|
class: "IncodeDateInputComposedInput",
|
|
290
|
-
value:
|
|
291
|
-
onInput:
|
|
292
|
-
min:
|
|
293
|
-
max:
|
|
324
|
+
value: i,
|
|
325
|
+
onInput: o,
|
|
326
|
+
min: n,
|
|
327
|
+
max: h,
|
|
294
328
|
placeholder: r,
|
|
295
|
-
disabled:
|
|
296
|
-
required:
|
|
297
|
-
"data-has-value": !!
|
|
298
|
-
"data-testid":
|
|
299
|
-
"aria-describedby":
|
|
300
|
-
"aria-required":
|
|
301
|
-
"aria-invalid":
|
|
302
|
-
...
|
|
329
|
+
disabled: d,
|
|
330
|
+
required: v,
|
|
331
|
+
"data-has-value": !!i,
|
|
332
|
+
"data-testid": L,
|
|
333
|
+
"aria-describedby": $ || void 0,
|
|
334
|
+
"aria-required": v ? "true" : void 0,
|
|
335
|
+
"aria-invalid": I ? "true" : void 0,
|
|
336
|
+
...k
|
|
303
337
|
}
|
|
304
338
|
),
|
|
305
339
|
/* @__PURE__ */ e(
|
|
@@ -307,200 +341,351 @@ const ee = ({ class: n }) => {
|
|
|
307
341
|
{
|
|
308
342
|
type: "button",
|
|
309
343
|
class: "IncodeDateInputComposedIconButton",
|
|
310
|
-
onClick:
|
|
311
|
-
onTouchEnd:
|
|
312
|
-
disabled:
|
|
313
|
-
"aria-label":
|
|
344
|
+
onClick: B,
|
|
345
|
+
onTouchEnd: B,
|
|
346
|
+
disabled: d,
|
|
347
|
+
"aria-label": l ?? "Date",
|
|
314
348
|
tabIndex: -1,
|
|
315
|
-
children: /* @__PURE__ */ e("span", { class: "IncodeDateInputComposedIcon", children: /* @__PURE__ */ e(
|
|
349
|
+
children: /* @__PURE__ */ e("span", { class: "IncodeDateInputComposedIcon", children: /* @__PURE__ */ e(Ve, {}) })
|
|
316
350
|
}
|
|
317
351
|
)
|
|
318
352
|
] }),
|
|
319
|
-
!f &&
|
|
353
|
+
!f && I && /* @__PURE__ */ e(
|
|
320
354
|
"div",
|
|
321
355
|
{
|
|
322
356
|
class: "IncodeDateInputComposedErrorWrapper",
|
|
323
|
-
"data-testid": `${
|
|
357
|
+
"data-testid": `${t}-error-wrapper`,
|
|
324
358
|
children: [
|
|
325
|
-
|
|
326
|
-
/* @__PURE__ */ e("p", { id:
|
|
359
|
+
c && /* @__PURE__ */ e("div", { class: "IncodeDateInputComposedIconWrapper", children: /* @__PURE__ */ e(Z, { size: 17 }) }),
|
|
360
|
+
/* @__PURE__ */ e("p", { id: T, class: "IncodeDateInputComposedError", children: I })
|
|
327
361
|
]
|
|
328
362
|
}
|
|
329
363
|
),
|
|
330
|
-
!f &&
|
|
364
|
+
!f && C && !I && /* @__PURE__ */ e(
|
|
331
365
|
"div",
|
|
332
366
|
{
|
|
333
367
|
class: "IncodeDateInputComposedHelperWrapper",
|
|
334
|
-
"data-testid": `${
|
|
368
|
+
"data-testid": `${t}-helper-wrapper`,
|
|
335
369
|
children: [
|
|
336
|
-
|
|
337
|
-
/* @__PURE__ */ e("p", { id:
|
|
370
|
+
g && /* @__PURE__ */ e("div", { class: "IncodeDateInputComposedIconWrapper", children: /* @__PURE__ */ e(K, { size: 17 }) }),
|
|
371
|
+
/* @__PURE__ */ e("p", { id: W, class: "IncodeDateInputComposedHelper", children: C })
|
|
338
372
|
]
|
|
339
373
|
}
|
|
340
374
|
)
|
|
341
375
|
] });
|
|
342
376
|
}
|
|
343
377
|
);
|
|
344
|
-
|
|
345
|
-
const
|
|
346
|
-
id:
|
|
347
|
-
label:
|
|
348
|
-
placeholder:
|
|
349
|
-
value:
|
|
350
|
-
options:
|
|
351
|
-
onChange:
|
|
378
|
+
de.displayName = "DateInputComposed";
|
|
379
|
+
const ie = ({
|
|
380
|
+
id: t,
|
|
381
|
+
label: l,
|
|
382
|
+
placeholder: i = "Choose an option",
|
|
383
|
+
value: o,
|
|
384
|
+
options: n,
|
|
385
|
+
onChange: h,
|
|
352
386
|
error: r,
|
|
353
|
-
helper:
|
|
354
|
-
showErrorIcon:
|
|
355
|
-
showHelperIcon:
|
|
356
|
-
suppressMessages:
|
|
387
|
+
helper: I,
|
|
388
|
+
showErrorIcon: c,
|
|
389
|
+
showHelperIcon: C,
|
|
390
|
+
suppressMessages: g = !1,
|
|
357
391
|
disabled: f = !1,
|
|
358
|
-
required:
|
|
359
|
-
|
|
360
|
-
|
|
392
|
+
required: d,
|
|
393
|
+
searchable: v = !1,
|
|
394
|
+
searchPlaceholder: y = "Search...",
|
|
395
|
+
noResultsText: L = "No results found",
|
|
396
|
+
name: k,
|
|
397
|
+
tabIndex: R,
|
|
398
|
+
onKeyDown: F,
|
|
399
|
+
onBlur: W,
|
|
400
|
+
renderSelectedLabel: T,
|
|
401
|
+
siblingElement: $,
|
|
402
|
+
enterKeyHint: ee,
|
|
403
|
+
class: B,
|
|
404
|
+
"data-testid": P
|
|
361
405
|
}) => {
|
|
362
|
-
const [
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
},
|
|
396
|
-
|
|
406
|
+
const [s, w] = O(!1), [ue, te] = O(!1), [m, p] = O(-1), [j, ne] = O(""), re = V(null), U = V(null), ae = V(null), q = V([]), Y = V(null), Q = V(""), x = V(), z = n.find((a) => a.value === o), b = v && j ? n.filter(
|
|
407
|
+
(a) => a.label.toLowerCase().includes(j.toLowerCase())
|
|
408
|
+
) : n, X = `${t}-label`, oe = `${t}-listbox`, le = `${t}-helper`, se = `${t}-error`, pe = g ? "" : [I ? le : null, r ? se : null].filter(Boolean).join(" ");
|
|
409
|
+
A(() => {
|
|
410
|
+
if (!s) return;
|
|
411
|
+
const a = requestAnimationFrame(() => {
|
|
412
|
+
v && Y.current && Y.current.focus(), requestAnimationFrame(() => {
|
|
413
|
+
ae.current?.scrollIntoView({
|
|
414
|
+
behavior: "smooth",
|
|
415
|
+
block: "nearest",
|
|
416
|
+
inline: "nearest"
|
|
417
|
+
});
|
|
418
|
+
});
|
|
419
|
+
});
|
|
420
|
+
return () => cancelAnimationFrame(a);
|
|
421
|
+
}, [s, v]), A(() => {
|
|
422
|
+
s || (p(-1), ne(""));
|
|
423
|
+
}, [s]), A(() => {
|
|
424
|
+
m >= 0 && q.current[m] && q.current[m]?.scrollIntoView({
|
|
425
|
+
block: "nearest",
|
|
426
|
+
inline: "nearest"
|
|
427
|
+
});
|
|
428
|
+
}, [m]), A(() => () => {
|
|
429
|
+
x.current && clearTimeout(x.current);
|
|
430
|
+
}, []);
|
|
431
|
+
const he = () => {
|
|
432
|
+
f || w((a) => !a);
|
|
433
|
+
}, G = (a) => {
|
|
434
|
+
h(a), w(!1), p(-1), U.current?.focus();
|
|
435
|
+
}, Ce = () => {
|
|
436
|
+
te(!0);
|
|
437
|
+
}, Ie = (a) => {
|
|
438
|
+
te(!1), re.current?.contains(a.relatedTarget) || (w(!1), W?.());
|
|
439
|
+
}, fe = (a) => {
|
|
440
|
+
if (f) return;
|
|
441
|
+
F?.(a);
|
|
442
|
+
const { key: D } = a;
|
|
443
|
+
if (D.length === 1 && /^[a-zA-Z0-9]$/.test(D)) {
|
|
444
|
+
a.preventDefault(), x.current && clearTimeout(x.current), Q.current += D.toLowerCase();
|
|
445
|
+
const u = b.findIndex(
|
|
446
|
+
(ve) => ve.label.toLowerCase().startsWith(Q.current)
|
|
447
|
+
);
|
|
448
|
+
u !== -1 && (s || w(!0), p(u)), x.current = setTimeout(() => {
|
|
449
|
+
Q.current = "";
|
|
450
|
+
}, 500);
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
switch (D) {
|
|
454
|
+
case "ArrowDown":
|
|
455
|
+
a.preventDefault(), s ? p(
|
|
456
|
+
(u) => u < b.length - 1 ? u + 1 : u
|
|
457
|
+
) : (w(!0), p(0));
|
|
458
|
+
break;
|
|
459
|
+
case "ArrowUp":
|
|
460
|
+
a.preventDefault(), s ? p((u) => u > 0 ? u - 1 : u) : (w(!0), p(b.length - 1));
|
|
461
|
+
break;
|
|
462
|
+
case "Home":
|
|
463
|
+
a.preventDefault(), s && p(0);
|
|
464
|
+
break;
|
|
465
|
+
case "End":
|
|
466
|
+
a.preventDefault(), s && p(b.length - 1);
|
|
467
|
+
break;
|
|
468
|
+
case "Enter":
|
|
469
|
+
a.preventDefault(), s && m >= 0 && b[m] ? G(b[m].value) : s || w(!0);
|
|
470
|
+
break;
|
|
471
|
+
case " ":
|
|
472
|
+
a.preventDefault(), s && m >= 0 && b[m] ? G(b[m].value) : s || (w(!0), p(0));
|
|
473
|
+
break;
|
|
474
|
+
case "Escape":
|
|
475
|
+
a.preventDefault(), s && (w(!1), p(-1), U.current?.focus());
|
|
476
|
+
break;
|
|
477
|
+
case "Tab":
|
|
478
|
+
s && (w(!1), p(-1));
|
|
479
|
+
break;
|
|
480
|
+
}
|
|
481
|
+
}, me = (a) => {
|
|
482
|
+
const { key: D } = a;
|
|
483
|
+
switch (D) {
|
|
484
|
+
case "ArrowDown":
|
|
485
|
+
a.preventDefault(), p(
|
|
486
|
+
(u) => u < b.length - 1 ? u + 1 : u
|
|
487
|
+
);
|
|
488
|
+
break;
|
|
489
|
+
case "ArrowUp":
|
|
490
|
+
a.preventDefault(), p((u) => u > 0 ? u - 1 : u);
|
|
491
|
+
break;
|
|
492
|
+
case "Home":
|
|
493
|
+
a.preventDefault(), p(0);
|
|
494
|
+
break;
|
|
495
|
+
case "End":
|
|
496
|
+
a.preventDefault(), p(b.length - 1);
|
|
497
|
+
break;
|
|
498
|
+
case "Enter":
|
|
499
|
+
a.preventDefault(), m >= 0 && b[m] && G(b[m].value);
|
|
500
|
+
break;
|
|
501
|
+
case "Escape":
|
|
502
|
+
a.preventDefault(), w(!1), p(-1), U.current?.focus();
|
|
503
|
+
break;
|
|
504
|
+
case "Tab":
|
|
505
|
+
w(!1), p(-1);
|
|
506
|
+
break;
|
|
507
|
+
}
|
|
397
508
|
};
|
|
398
|
-
return /* @__PURE__ */ e(
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
"span",
|
|
431
|
-
{
|
|
432
|
-
class: k ? "IncodeDropdownComposedTriggerText" : "IncodeDropdownComposedTriggerPlaceholder",
|
|
433
|
-
children: k ? k.label : s
|
|
434
|
-
}
|
|
435
|
-
),
|
|
436
|
-
/* @__PURE__ */ e(
|
|
437
|
-
"span",
|
|
438
|
-
{
|
|
439
|
-
class: "IncodeDropdownComposedTriggerIcon",
|
|
440
|
-
"aria-hidden": "true",
|
|
441
|
-
"data-open": i,
|
|
442
|
-
children: /* @__PURE__ */ e(_, {})
|
|
443
|
-
}
|
|
444
|
-
)
|
|
445
|
-
]
|
|
446
|
-
}
|
|
447
|
-
),
|
|
448
|
-
i && /* @__PURE__ */ e(
|
|
449
|
-
"div",
|
|
450
|
-
{
|
|
451
|
-
ref: P,
|
|
452
|
-
class: "IncodeDropdownComposedList",
|
|
453
|
-
role: "listbox",
|
|
454
|
-
"aria-label": o ?? s,
|
|
455
|
-
children: t.map((p, v) => /* @__PURE__ */ e(
|
|
509
|
+
return /* @__PURE__ */ e(
|
|
510
|
+
"div",
|
|
511
|
+
{
|
|
512
|
+
class: E("IncodeDropdownComposed", B),
|
|
513
|
+
ref: re,
|
|
514
|
+
onBlur: Ie,
|
|
515
|
+
children: [
|
|
516
|
+
k && /* @__PURE__ */ e(
|
|
517
|
+
"input",
|
|
518
|
+
{
|
|
519
|
+
type: "hidden",
|
|
520
|
+
name: k,
|
|
521
|
+
value: o || "",
|
|
522
|
+
disabled: f,
|
|
523
|
+
required: d
|
|
524
|
+
}
|
|
525
|
+
),
|
|
526
|
+
l && /* @__PURE__ */ e(
|
|
527
|
+
"label",
|
|
528
|
+
{
|
|
529
|
+
class: "IncodeDropdownComposedLabel",
|
|
530
|
+
id: X,
|
|
531
|
+
htmlFor: t,
|
|
532
|
+
"data-testid": `${t}-label`,
|
|
533
|
+
children: [
|
|
534
|
+
l,
|
|
535
|
+
d && /* @__PURE__ */ e("span", { class: "IncodeDropdownComposedRequired", children: " *" })
|
|
536
|
+
]
|
|
537
|
+
}
|
|
538
|
+
),
|
|
539
|
+
/* @__PURE__ */ e("div", { class: "IncodeDropdownComposedWrapper", children: [
|
|
540
|
+
/* @__PURE__ */ e(
|
|
456
541
|
"div",
|
|
457
542
|
{
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
543
|
+
class: E("IncodeDropdownComposedTriggerRow", {
|
|
544
|
+
IncodeDropdownComposedTriggerRowWithSibling: !!$
|
|
545
|
+
}),
|
|
546
|
+
children: [
|
|
547
|
+
/* @__PURE__ */ e(
|
|
548
|
+
"button",
|
|
549
|
+
{
|
|
550
|
+
ref: U,
|
|
551
|
+
type: "button",
|
|
552
|
+
id: t,
|
|
553
|
+
class: "IncodeDropdownComposedTrigger",
|
|
554
|
+
onClick: he,
|
|
555
|
+
onFocus: Ce,
|
|
556
|
+
onKeyDown: fe,
|
|
557
|
+
tabIndex: f ? -1 : R ?? 0,
|
|
558
|
+
disabled: f,
|
|
559
|
+
"aria-haspopup": "listbox",
|
|
560
|
+
"aria-expanded": s ? "true" : "false",
|
|
561
|
+
"aria-disabled": f ? "true" : void 0,
|
|
562
|
+
"aria-labelledby": l ? X : void 0,
|
|
563
|
+
"aria-label": l ? void 0 : i,
|
|
564
|
+
"aria-controls": s ? oe : void 0,
|
|
565
|
+
"aria-activedescendant": s && m >= 0 ? `${t}-option-${m}` : void 0,
|
|
566
|
+
"aria-invalid": r ? "true" : void 0,
|
|
567
|
+
"aria-required": d ? "true" : void 0,
|
|
568
|
+
"aria-describedby": pe || void 0,
|
|
569
|
+
"data-error": r ? "true" : void 0,
|
|
570
|
+
"data-focused": ue || s ? "true" : void 0,
|
|
571
|
+
"data-testid": P,
|
|
572
|
+
children: [
|
|
573
|
+
/* @__PURE__ */ e(
|
|
574
|
+
"span",
|
|
575
|
+
{
|
|
576
|
+
class: z ? "IncodeDropdownComposedTriggerText" : "IncodeDropdownComposedTriggerPlaceholder",
|
|
577
|
+
children: z ? T ? T(z) : z.label : i
|
|
578
|
+
}
|
|
579
|
+
),
|
|
580
|
+
/* @__PURE__ */ e(
|
|
581
|
+
"span",
|
|
582
|
+
{
|
|
583
|
+
class: "IncodeDropdownComposedTriggerIcon",
|
|
584
|
+
"aria-hidden": "true",
|
|
585
|
+
"data-open": s,
|
|
586
|
+
children: /* @__PURE__ */ e(Re, {})
|
|
587
|
+
}
|
|
588
|
+
)
|
|
589
|
+
]
|
|
590
|
+
}
|
|
591
|
+
),
|
|
592
|
+
$ && /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedSibling", children: $ })
|
|
593
|
+
]
|
|
594
|
+
}
|
|
595
|
+
),
|
|
596
|
+
s && /* @__PURE__ */ e(
|
|
597
|
+
"div",
|
|
598
|
+
{
|
|
599
|
+
ref: ae,
|
|
600
|
+
id: oe,
|
|
601
|
+
class: "IncodeDropdownComposedList",
|
|
602
|
+
role: "listbox",
|
|
603
|
+
"aria-labelledby": l ? X : void 0,
|
|
604
|
+
"aria-label": l ? void 0 : i,
|
|
605
|
+
"data-error": r ? "true" : void 0,
|
|
606
|
+
children: [
|
|
607
|
+
v && /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedSearchWrapper", children: /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedSearchInner", children: [
|
|
608
|
+
/* @__PURE__ */ e(
|
|
609
|
+
"input",
|
|
610
|
+
{
|
|
611
|
+
ref: Y,
|
|
612
|
+
type: "text",
|
|
613
|
+
class: "IncodeDropdownComposedSearchInput",
|
|
614
|
+
value: j,
|
|
615
|
+
onInput: (a) => {
|
|
616
|
+
ne(a.target.value), p(0);
|
|
617
|
+
},
|
|
618
|
+
onKeyDown: me,
|
|
619
|
+
placeholder: y,
|
|
620
|
+
"aria-label": y,
|
|
621
|
+
autocomplete: "off"
|
|
622
|
+
}
|
|
623
|
+
),
|
|
624
|
+
/* @__PURE__ */ e(
|
|
625
|
+
"span",
|
|
626
|
+
{
|
|
627
|
+
class: "IncodeDropdownComposedSearchIcon",
|
|
628
|
+
"aria-hidden": "true",
|
|
629
|
+
children: /* @__PURE__ */ e(Pe, { size: 20 })
|
|
630
|
+
}
|
|
631
|
+
)
|
|
632
|
+
] }) }),
|
|
633
|
+
/* @__PURE__ */ e("div", { class: "IncodeDropdownComposedOptionsScroll", children: b.length === 0 ? /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedNoResults", children: L }) : b.map((a, D) => /* @__PURE__ */ e(
|
|
634
|
+
"div",
|
|
635
|
+
{
|
|
636
|
+
id: `${t}-option-${D}`,
|
|
637
|
+
role: "option",
|
|
638
|
+
"aria-selected": o === a.value ? "true" : "false",
|
|
639
|
+
class: "IncodeDropdownComposedOption",
|
|
640
|
+
"data-highlighted": m === D,
|
|
641
|
+
ref: (u) => {
|
|
642
|
+
q.current[D] = u;
|
|
643
|
+
},
|
|
644
|
+
onClick: () => G(a.value),
|
|
645
|
+
onMouseDown: (u) => u.preventDefault(),
|
|
646
|
+
onMouseEnter: () => p(D),
|
|
647
|
+
children: a.label
|
|
648
|
+
},
|
|
649
|
+
a.value
|
|
650
|
+
)) })
|
|
651
|
+
]
|
|
652
|
+
}
|
|
653
|
+
)
|
|
654
|
+
] }),
|
|
655
|
+
!g && r && /* @__PURE__ */ e(
|
|
656
|
+
"div",
|
|
657
|
+
{
|
|
658
|
+
class: "IncodeDropdownComposedErrorWrapper",
|
|
659
|
+
"data-testid": `${t}-error-wrapper`,
|
|
660
|
+
children: [
|
|
661
|
+
c && /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedIconWrapper", children: /* @__PURE__ */ e(Z, { size: 17 }) }),
|
|
662
|
+
/* @__PURE__ */ e("p", { id: se, class: "IncodeDropdownComposedError", children: r })
|
|
663
|
+
]
|
|
664
|
+
}
|
|
665
|
+
),
|
|
666
|
+
!g && I && !r && /* @__PURE__ */ e(
|
|
667
|
+
"div",
|
|
668
|
+
{
|
|
669
|
+
class: "IncodeDropdownComposedHelperWrapper",
|
|
670
|
+
"data-testid": `${t}-helper-wrapper`,
|
|
671
|
+
children: [
|
|
672
|
+
C && /* @__PURE__ */ e("div", { class: "IncodeDropdownComposedIconWrapper", children: /* @__PURE__ */ e(K, { size: 17 }) }),
|
|
673
|
+
/* @__PURE__ */ e("p", { id: le, class: "IncodeDropdownComposedHelper", children: I })
|
|
674
|
+
]
|
|
675
|
+
}
|
|
676
|
+
)
|
|
677
|
+
]
|
|
678
|
+
}
|
|
679
|
+
);
|
|
680
|
+
}, $e = ({
|
|
681
|
+
form: t,
|
|
682
|
+
isValid: l,
|
|
683
|
+
onFormChange: i,
|
|
684
|
+
onGenerate: o,
|
|
685
|
+
disabled: n = !1,
|
|
686
|
+
labels: h
|
|
502
687
|
}) => {
|
|
503
|
-
const { t: r } =
|
|
688
|
+
const { t: r } = J(), c = { ...{
|
|
504
689
|
firstName: r("curp.labels.firstName") ?? "Your First name",
|
|
505
690
|
firstLast: r("curp.labels.firstLast") ?? "Your First last name",
|
|
506
691
|
secondLast: r("curp.labels.secondLast") ?? "Your Second last name",
|
|
@@ -513,227 +698,229 @@ const O = ({
|
|
|
513
698
|
birthState: r("curp.labels.birthState") ?? "State of birth",
|
|
514
699
|
statePlaceholder: r("curp.placeholder.state") ?? "Select state",
|
|
515
700
|
generate: r("curp.generateCta") ?? "Generate CURP"
|
|
516
|
-
}, ...
|
|
517
|
-
const y =
|
|
518
|
-
|
|
519
|
-
},
|
|
520
|
-
{ value: "H", label:
|
|
521
|
-
{ value: "M", label:
|
|
522
|
-
{ value: "X", label:
|
|
523
|
-
], f =
|
|
524
|
-
value:
|
|
525
|
-
label:
|
|
701
|
+
}, ...h }, C = (d) => (v) => {
|
|
702
|
+
const y = v.target;
|
|
703
|
+
i({ [d]: y.value });
|
|
704
|
+
}, g = [
|
|
705
|
+
{ value: "H", label: c.male },
|
|
706
|
+
{ value: "M", label: c.female },
|
|
707
|
+
{ value: "X", label: c.other }
|
|
708
|
+
], f = we.map((d) => ({
|
|
709
|
+
value: d.value,
|
|
710
|
+
label: d.label
|
|
526
711
|
}));
|
|
527
712
|
return /* @__PURE__ */ e("div", { class: "IncodeCurpValidation IncodeGenerateCurpForm", children: [
|
|
528
713
|
/* @__PURE__ */ e(
|
|
529
|
-
|
|
714
|
+
M,
|
|
530
715
|
{
|
|
531
716
|
id: "curp-first-name",
|
|
532
|
-
label:
|
|
533
|
-
value:
|
|
534
|
-
onInput:
|
|
535
|
-
placeholder:
|
|
536
|
-
disabled:
|
|
717
|
+
label: c.firstName,
|
|
718
|
+
value: t.name,
|
|
719
|
+
onInput: C("name"),
|
|
720
|
+
placeholder: c.firstName,
|
|
721
|
+
disabled: n,
|
|
537
722
|
autoComplete: "given-name"
|
|
538
723
|
}
|
|
539
724
|
),
|
|
540
725
|
/* @__PURE__ */ e(
|
|
541
|
-
|
|
726
|
+
M,
|
|
542
727
|
{
|
|
543
728
|
id: "curp-first-last",
|
|
544
|
-
label:
|
|
545
|
-
value:
|
|
546
|
-
onInput:
|
|
547
|
-
placeholder:
|
|
548
|
-
disabled:
|
|
729
|
+
label: c.firstLast,
|
|
730
|
+
value: t.firstLastName,
|
|
731
|
+
onInput: C("firstLastName"),
|
|
732
|
+
placeholder: c.firstLast,
|
|
733
|
+
disabled: n
|
|
549
734
|
}
|
|
550
735
|
),
|
|
551
736
|
/* @__PURE__ */ e(
|
|
552
|
-
|
|
737
|
+
M,
|
|
553
738
|
{
|
|
554
739
|
id: "curp-second-last",
|
|
555
|
-
label:
|
|
556
|
-
value:
|
|
557
|
-
onInput:
|
|
558
|
-
placeholder:
|
|
559
|
-
disabled:
|
|
740
|
+
label: c.secondLast,
|
|
741
|
+
value: t.secondLastName,
|
|
742
|
+
onInput: C("secondLastName"),
|
|
743
|
+
placeholder: c.secondLast,
|
|
744
|
+
disabled: n
|
|
560
745
|
}
|
|
561
746
|
),
|
|
562
747
|
/* @__PURE__ */ e(
|
|
563
|
-
|
|
748
|
+
ie,
|
|
564
749
|
{
|
|
565
750
|
id: "curp-gender",
|
|
566
|
-
label:
|
|
567
|
-
placeholder:
|
|
568
|
-
value:
|
|
569
|
-
options:
|
|
570
|
-
disabled:
|
|
571
|
-
onChange: (
|
|
751
|
+
label: c.gender,
|
|
752
|
+
placeholder: c.genderPlaceholder,
|
|
753
|
+
value: t.gender,
|
|
754
|
+
options: g,
|
|
755
|
+
disabled: n,
|
|
756
|
+
onChange: (d) => i({ gender: d }),
|
|
572
757
|
"data-testid": "curp-gender"
|
|
573
758
|
}
|
|
574
759
|
),
|
|
575
760
|
/* @__PURE__ */ e(
|
|
576
|
-
|
|
761
|
+
de,
|
|
577
762
|
{
|
|
578
763
|
id: "curp-birth-date",
|
|
579
|
-
label:
|
|
580
|
-
value:
|
|
581
|
-
onInput:
|
|
764
|
+
label: c.dob,
|
|
765
|
+
value: t.birthDate,
|
|
766
|
+
onInput: C("birthDate"),
|
|
582
767
|
max: (/* @__PURE__ */ new Date()).toISOString().split("T")[0],
|
|
583
768
|
placeholder: r("curp.placeholder.dob") ?? "mm/dd/yyyy",
|
|
584
|
-
disabled:
|
|
769
|
+
disabled: n,
|
|
585
770
|
"data-testid": "curp-birth-date"
|
|
586
771
|
}
|
|
587
772
|
),
|
|
588
773
|
/* @__PURE__ */ e(
|
|
589
|
-
|
|
774
|
+
ie,
|
|
590
775
|
{
|
|
591
776
|
id: "curp-birth-state",
|
|
592
|
-
label:
|
|
593
|
-
placeholder:
|
|
594
|
-
value:
|
|
777
|
+
label: c.birthState,
|
|
778
|
+
placeholder: c.statePlaceholder,
|
|
779
|
+
value: t.birthState,
|
|
595
780
|
options: f,
|
|
596
|
-
disabled:
|
|
597
|
-
onChange: (
|
|
598
|
-
"data-testid": "curp-birth-state"
|
|
781
|
+
disabled: n,
|
|
782
|
+
onChange: (d) => i({ birthState: d }),
|
|
783
|
+
"data-testid": "curp-birth-state",
|
|
784
|
+
searchable: !0
|
|
599
785
|
}
|
|
600
786
|
),
|
|
787
|
+
/* @__PURE__ */ e(S, { size: 16 }),
|
|
601
788
|
/* @__PURE__ */ e(
|
|
602
|
-
|
|
789
|
+
N,
|
|
603
790
|
{
|
|
604
791
|
type: "button",
|
|
605
|
-
onClick:
|
|
606
|
-
disabled: !
|
|
792
|
+
onClick: o,
|
|
793
|
+
disabled: !l || n,
|
|
607
794
|
"data-testid": "curp-generate",
|
|
608
|
-
children:
|
|
795
|
+
children: c.generate
|
|
609
796
|
}
|
|
610
797
|
)
|
|
611
798
|
] });
|
|
612
|
-
},
|
|
613
|
-
config:
|
|
614
|
-
onFinish:
|
|
615
|
-
onError:
|
|
799
|
+
}, xe = ({
|
|
800
|
+
config: t,
|
|
801
|
+
onFinish: l,
|
|
802
|
+
onError: i
|
|
616
803
|
}) => {
|
|
617
|
-
const { t:
|
|
618
|
-
if (!
|
|
804
|
+
const { t: o } = J(), [n, h] = ge(() => {
|
|
805
|
+
if (!t)
|
|
619
806
|
throw new Error("CURP validation config is required");
|
|
620
|
-
return
|
|
807
|
+
return De({ config: t });
|
|
621
808
|
});
|
|
622
|
-
if (
|
|
623
|
-
const r =
|
|
624
|
-
return /* @__PURE__ */ e(
|
|
809
|
+
if (n.status === "idle" || n.status === "loading" || n.status === "verifying" || n.status === "generating") {
|
|
810
|
+
const r = n.status === "generating" ? o("curp.status.generating") ?? "Generating..." : o("curp.status.verifying") ?? "Verifying...";
|
|
811
|
+
return /* @__PURE__ */ e(H, { className: "IncodeCurpValidationPage", children: /* @__PURE__ */ e("div", { class: "IncodeCurpValidation IncodeCurpLoading", children: /* @__PURE__ */ e(Le, { title: r, fullScreen: !1 }) }) });
|
|
625
812
|
}
|
|
626
|
-
if (
|
|
813
|
+
if (n.status === "enterCurp")
|
|
627
814
|
return /* @__PURE__ */ e(
|
|
628
|
-
|
|
815
|
+
H,
|
|
629
816
|
{
|
|
630
817
|
className: "IncodeCurpValidationPage",
|
|
631
|
-
title:
|
|
818
|
+
title: o("curp.enterCurp") ?? "Enter your CURP",
|
|
632
819
|
children: /* @__PURE__ */ e(
|
|
633
|
-
|
|
820
|
+
Te,
|
|
634
821
|
{
|
|
635
|
-
curp:
|
|
636
|
-
isValid:
|
|
637
|
-
onCurpChange: (r) =>
|
|
638
|
-
onVerify: () =>
|
|
639
|
-
onSwitchToGenerate: () =>
|
|
640
|
-
placeholder:
|
|
641
|
-
continueLabel:
|
|
642
|
-
dontHaveLabel:
|
|
822
|
+
curp: n.curp,
|
|
823
|
+
isValid: n.isValid,
|
|
824
|
+
onCurpChange: (r) => h.setCurp(r),
|
|
825
|
+
onVerify: () => h.verify(),
|
|
826
|
+
onSwitchToGenerate: () => h.switchToGenerate(),
|
|
827
|
+
placeholder: o("curp.placeholder.curp") ?? "CURP",
|
|
828
|
+
continueLabel: o("curp.continue") ?? "Continue",
|
|
829
|
+
dontHaveLabel: o("curp.dontHave") ?? "I don't have my CURP"
|
|
643
830
|
}
|
|
644
831
|
)
|
|
645
832
|
}
|
|
646
833
|
);
|
|
647
|
-
if (
|
|
834
|
+
if (n.status === "generateCurp")
|
|
648
835
|
return /* @__PURE__ */ e(
|
|
649
|
-
|
|
836
|
+
H,
|
|
650
837
|
{
|
|
651
838
|
className: "IncodeCurpValidationPage",
|
|
652
|
-
title:
|
|
839
|
+
title: o("curp.generate") ?? "Generate your CURP",
|
|
653
840
|
children: /* @__PURE__ */ e(
|
|
654
|
-
|
|
841
|
+
$e,
|
|
655
842
|
{
|
|
656
|
-
form:
|
|
657
|
-
isValid:
|
|
658
|
-
onFormChange: (r) =>
|
|
659
|
-
onGenerate: () =>
|
|
843
|
+
form: n.form,
|
|
844
|
+
isValid: n.isValid,
|
|
845
|
+
onFormChange: (r) => h.setGenerateForm(r),
|
|
846
|
+
onGenerate: () => h.generate()
|
|
660
847
|
}
|
|
661
848
|
)
|
|
662
849
|
}
|
|
663
850
|
);
|
|
664
|
-
if (
|
|
851
|
+
if (n.status === "confirmCurp")
|
|
665
852
|
return /* @__PURE__ */ e(
|
|
666
|
-
|
|
853
|
+
H,
|
|
667
854
|
{
|
|
668
855
|
className: "IncodeCurpValidationPage",
|
|
669
|
-
title:
|
|
856
|
+
title: o("curp.status.confirm") ?? "Confirm your CURP",
|
|
670
857
|
children: /* @__PURE__ */ e("div", { class: "IncodeCurpValidation IncodeCurpConfirm", children: [
|
|
671
858
|
/* @__PURE__ */ e(
|
|
672
859
|
"input",
|
|
673
860
|
{
|
|
674
861
|
type: "text",
|
|
675
862
|
class: "IncodeCurpConfirmInput",
|
|
676
|
-
value:
|
|
863
|
+
value: n.curp,
|
|
677
864
|
readOnly: !0,
|
|
678
|
-
"aria-label":
|
|
865
|
+
"aria-label": o("curp.status.generatedCurp") ?? "Generated CURP"
|
|
679
866
|
}
|
|
680
867
|
),
|
|
681
|
-
/* @__PURE__ */ e(
|
|
868
|
+
/* @__PURE__ */ e(S, {}),
|
|
682
869
|
/* @__PURE__ */ e(
|
|
683
|
-
|
|
870
|
+
N,
|
|
684
871
|
{
|
|
685
872
|
type: "button",
|
|
686
|
-
onClick: () =>
|
|
873
|
+
onClick: () => h.confirmGenerated(),
|
|
687
874
|
"data-testid": "curp-confirm",
|
|
688
|
-
children:
|
|
875
|
+
children: o("curp.continue") ?? "Continue"
|
|
689
876
|
}
|
|
690
877
|
)
|
|
691
878
|
] })
|
|
692
879
|
}
|
|
693
880
|
);
|
|
694
|
-
if (
|
|
695
|
-
return /* @__PURE__ */ e(
|
|
696
|
-
/* @__PURE__ */ e(
|
|
697
|
-
/* @__PURE__ */ e(
|
|
698
|
-
/* @__PURE__ */ e("h2", { class: "IncodeCurpSuccessTitle", children:
|
|
881
|
+
if (n.status === "success")
|
|
882
|
+
return /* @__PURE__ */ e(H, { className: "IncodeCurpValidationPage", children: /* @__PURE__ */ e("div", { class: "IncodeCurpValidation IncodeCurpSuccess", children: [
|
|
883
|
+
/* @__PURE__ */ e(K, { size: 32 }),
|
|
884
|
+
/* @__PURE__ */ e(S, { size: 16 }),
|
|
885
|
+
/* @__PURE__ */ e("h2", { class: "IncodeCurpSuccessTitle", children: o("curp.status.verified") ?? "Verified" })
|
|
699
886
|
] }) });
|
|
700
|
-
if (
|
|
701
|
-
const r =
|
|
702
|
-
return /* @__PURE__ */ e(
|
|
703
|
-
/* @__PURE__ */ e(
|
|
704
|
-
/* @__PURE__ */ e(
|
|
705
|
-
/* @__PURE__ */ e(
|
|
706
|
-
/* @__PURE__ */ e("h2", { class: "IncodeCurpFailureTitle", children:
|
|
707
|
-
|
|
708
|
-
/* @__PURE__ */ e(
|
|
709
|
-
/* @__PURE__ */ e("p", { class: "IncodeCurpFailureHint", children:
|
|
887
|
+
if (n.status === "failure" || n.status === "generateError") {
|
|
888
|
+
const r = n.retriesLeft > 0, I = n.status === "failure" ? o("curp.status.notVerified") ?? "Not verified" : o("curp.status.couldntGenerate") ?? "Couldn't generate CURP";
|
|
889
|
+
return /* @__PURE__ */ e(H, { className: "IncodeCurpValidationPage", children: /* @__PURE__ */ e("div", { class: "IncodeCurpValidation IncodeCurpFailure", children: [
|
|
890
|
+
/* @__PURE__ */ e(S, {}),
|
|
891
|
+
/* @__PURE__ */ e(Z, { size: 32 }),
|
|
892
|
+
/* @__PURE__ */ e(S, { size: 16 }),
|
|
893
|
+
/* @__PURE__ */ e("h2", { class: "IncodeCurpFailureTitle", children: I }),
|
|
894
|
+
n.status === "generateError" && r && /* @__PURE__ */ e(ce, { children: [
|
|
895
|
+
/* @__PURE__ */ e(S, { size: 12 }),
|
|
896
|
+
/* @__PURE__ */ e("p", { class: "IncodeCurpFailureHint", children: o("curp.status.checkInfo") ?? "Please check your information" })
|
|
710
897
|
] }),
|
|
711
|
-
/* @__PURE__ */ e(
|
|
712
|
-
r && /* @__PURE__ */ e(
|
|
713
|
-
|
|
898
|
+
/* @__PURE__ */ e(S, {}),
|
|
899
|
+
r && /* @__PURE__ */ e(ce, { children: /* @__PURE__ */ e(
|
|
900
|
+
N,
|
|
714
901
|
{
|
|
715
902
|
type: "button",
|
|
716
|
-
onClick: () =>
|
|
903
|
+
onClick: () => h.retry(),
|
|
717
904
|
"data-testid": "curp-retry",
|
|
718
|
-
children:
|
|
905
|
+
children: n.status === "failure" ? o("curp.status.tryAgain") ?? "Try again" : o("curp.status.edit") ?? "Edit information"
|
|
719
906
|
}
|
|
720
907
|
) })
|
|
721
908
|
] }) });
|
|
722
909
|
}
|
|
723
|
-
return
|
|
724
|
-
},
|
|
725
|
-
config:
|
|
726
|
-
onFinish:
|
|
727
|
-
onError:
|
|
728
|
-
}) => /* @__PURE__ */ e(
|
|
729
|
-
|
|
910
|
+
return n.status === "finished" ? (l?.(), null) : (n.status === "closed" && i?.(void 0), null);
|
|
911
|
+
}, Ee = ({
|
|
912
|
+
config: t,
|
|
913
|
+
onFinish: l,
|
|
914
|
+
onError: i
|
|
915
|
+
}) => /* @__PURE__ */ e(ke, { children: t ? /* @__PURE__ */ e(
|
|
916
|
+
xe,
|
|
730
917
|
{
|
|
731
|
-
config:
|
|
732
|
-
onFinish:
|
|
733
|
-
onError:
|
|
918
|
+
config: t,
|
|
919
|
+
onFinish: l,
|
|
920
|
+
onError: i
|
|
734
921
|
}
|
|
735
922
|
) : null });
|
|
736
|
-
|
|
923
|
+
be(Ee, "incode-curp-validation");
|
|
737
924
|
export {
|
|
738
|
-
|
|
925
|
+
Ee as CurpValidation
|
|
739
926
|
};
|