secure-keypad 1.0.0 → 1.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.
- package/dist/index.js +781 -2
- package/package.json +6 -2
package/dist/index.js
CHANGED
|
@@ -1,2 +1,781 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import Ye, { useRef as fe, useState as H, useMemo as pr, useEffect as Me, useCallback as yr } from "react";
|
|
2
|
+
var X = { exports: {} }, U = {};
|
|
3
|
+
var $e;
|
|
4
|
+
function mr() {
|
|
5
|
+
if ($e) return U;
|
|
6
|
+
$e = 1;
|
|
7
|
+
var d = Ye, u = /* @__PURE__ */ Symbol.for("react.element"), y = /* @__PURE__ */ Symbol.for("react.fragment"), h = Object.prototype.hasOwnProperty, S = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, F = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
8
|
+
function P(b, v, k) {
|
|
9
|
+
var p, T = {}, x = null, A = null;
|
|
10
|
+
k !== void 0 && (x = "" + k), v.key !== void 0 && (x = "" + v.key), v.ref !== void 0 && (A = v.ref);
|
|
11
|
+
for (p in v) h.call(v, p) && !F.hasOwnProperty(p) && (T[p] = v[p]);
|
|
12
|
+
if (b && b.defaultProps) for (p in v = b.defaultProps, v) T[p] === void 0 && (T[p] = v[p]);
|
|
13
|
+
return { $$typeof: u, type: b, key: x, ref: A, props: T, _owner: S.current };
|
|
14
|
+
}
|
|
15
|
+
return U.Fragment = y, U.jsx = P, U.jsxs = P, U;
|
|
16
|
+
}
|
|
17
|
+
var L = {};
|
|
18
|
+
var We;
|
|
19
|
+
function br() {
|
|
20
|
+
return We || (We = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
21
|
+
var d = Ye, u = /* @__PURE__ */ Symbol.for("react.element"), y = /* @__PURE__ */ Symbol.for("react.portal"), h = /* @__PURE__ */ Symbol.for("react.fragment"), S = /* @__PURE__ */ Symbol.for("react.strict_mode"), F = /* @__PURE__ */ Symbol.for("react.profiler"), P = /* @__PURE__ */ Symbol.for("react.provider"), b = /* @__PURE__ */ Symbol.for("react.context"), v = /* @__PURE__ */ Symbol.for("react.forward_ref"), k = /* @__PURE__ */ Symbol.for("react.suspense"), p = /* @__PURE__ */ Symbol.for("react.suspense_list"), T = /* @__PURE__ */ Symbol.for("react.memo"), x = /* @__PURE__ */ Symbol.for("react.lazy"), A = /* @__PURE__ */ Symbol.for("react.offscreen"), j = Symbol.iterator, Z = "@@iterator";
|
|
22
|
+
function Q(e) {
|
|
23
|
+
if (e === null || typeof e != "object")
|
|
24
|
+
return null;
|
|
25
|
+
var r = j && e[j] || e[Z];
|
|
26
|
+
return typeof r == "function" ? r : null;
|
|
27
|
+
}
|
|
28
|
+
var w = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
29
|
+
function m(e) {
|
|
30
|
+
{
|
|
31
|
+
for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
|
|
32
|
+
t[n - 1] = arguments[n];
|
|
33
|
+
ee("error", e, t);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function ee(e, r, t) {
|
|
37
|
+
{
|
|
38
|
+
var n = w.ReactDebugCurrentFrame, i = n.getStackAddendum();
|
|
39
|
+
i !== "" && (r += "%s", t = t.concat([i]));
|
|
40
|
+
var s = t.map(function(o) {
|
|
41
|
+
return String(o);
|
|
42
|
+
});
|
|
43
|
+
s.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, s);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
var V = !1, re = !1, l = !1, g = !1, C = !1, N;
|
|
47
|
+
N = /* @__PURE__ */ Symbol.for("react.module.reference");
|
|
48
|
+
function B(e) {
|
|
49
|
+
return !!(typeof e == "string" || typeof e == "function" || e === h || e === F || C || e === S || e === k || e === p || g || e === A || V || re || l || typeof e == "object" && e !== null && (e.$$typeof === x || e.$$typeof === T || e.$$typeof === P || e.$$typeof === b || e.$$typeof === v || // This needs to include all possible module reference object
|
|
50
|
+
// types supported by any Flight configuration anywhere since
|
|
51
|
+
// we don't know which Flight build this will end up being used
|
|
52
|
+
// with.
|
|
53
|
+
e.$$typeof === N || e.getModuleId !== void 0));
|
|
54
|
+
}
|
|
55
|
+
function te(e, r, t) {
|
|
56
|
+
var n = e.displayName;
|
|
57
|
+
if (n)
|
|
58
|
+
return n;
|
|
59
|
+
var i = r.displayName || r.name || "";
|
|
60
|
+
return i !== "" ? t + "(" + i + ")" : t;
|
|
61
|
+
}
|
|
62
|
+
function de(e) {
|
|
63
|
+
return e.displayName || "Context";
|
|
64
|
+
}
|
|
65
|
+
function D(e) {
|
|
66
|
+
if (e == null)
|
|
67
|
+
return null;
|
|
68
|
+
if (typeof e.tag == "number" && m("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
69
|
+
return e.displayName || e.name || null;
|
|
70
|
+
if (typeof e == "string")
|
|
71
|
+
return e;
|
|
72
|
+
switch (e) {
|
|
73
|
+
case h:
|
|
74
|
+
return "Fragment";
|
|
75
|
+
case y:
|
|
76
|
+
return "Portal";
|
|
77
|
+
case F:
|
|
78
|
+
return "Profiler";
|
|
79
|
+
case S:
|
|
80
|
+
return "StrictMode";
|
|
81
|
+
case k:
|
|
82
|
+
return "Suspense";
|
|
83
|
+
case p:
|
|
84
|
+
return "SuspenseList";
|
|
85
|
+
}
|
|
86
|
+
if (typeof e == "object")
|
|
87
|
+
switch (e.$$typeof) {
|
|
88
|
+
case b:
|
|
89
|
+
var r = e;
|
|
90
|
+
return de(r) + ".Consumer";
|
|
91
|
+
case P:
|
|
92
|
+
var t = e;
|
|
93
|
+
return de(t._context) + ".Provider";
|
|
94
|
+
case v:
|
|
95
|
+
return te(e, e.render, "ForwardRef");
|
|
96
|
+
case T:
|
|
97
|
+
var n = e.displayName || null;
|
|
98
|
+
return n !== null ? n : D(e.type) || "Memo";
|
|
99
|
+
case x: {
|
|
100
|
+
var i = e, s = i._payload, o = i._init;
|
|
101
|
+
try {
|
|
102
|
+
return D(o(s));
|
|
103
|
+
} catch {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
var I = Object.assign, Y = 0, ve, pe, ye, me, be, _e, he;
|
|
111
|
+
function ge() {
|
|
112
|
+
}
|
|
113
|
+
ge.__reactDisabledLog = !0;
|
|
114
|
+
function Ke() {
|
|
115
|
+
{
|
|
116
|
+
if (Y === 0) {
|
|
117
|
+
ve = console.log, pe = console.info, ye = console.warn, me = console.error, be = console.group, _e = console.groupCollapsed, he = console.groupEnd;
|
|
118
|
+
var e = {
|
|
119
|
+
configurable: !0,
|
|
120
|
+
enumerable: !0,
|
|
121
|
+
value: ge,
|
|
122
|
+
writable: !0
|
|
123
|
+
};
|
|
124
|
+
Object.defineProperties(console, {
|
|
125
|
+
info: e,
|
|
126
|
+
log: e,
|
|
127
|
+
warn: e,
|
|
128
|
+
error: e,
|
|
129
|
+
group: e,
|
|
130
|
+
groupCollapsed: e,
|
|
131
|
+
groupEnd: e
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
Y++;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
function Ue() {
|
|
138
|
+
{
|
|
139
|
+
if (Y--, Y === 0) {
|
|
140
|
+
var e = {
|
|
141
|
+
configurable: !0,
|
|
142
|
+
enumerable: !0,
|
|
143
|
+
writable: !0
|
|
144
|
+
};
|
|
145
|
+
Object.defineProperties(console, {
|
|
146
|
+
log: I({}, e, {
|
|
147
|
+
value: ve
|
|
148
|
+
}),
|
|
149
|
+
info: I({}, e, {
|
|
150
|
+
value: pe
|
|
151
|
+
}),
|
|
152
|
+
warn: I({}, e, {
|
|
153
|
+
value: ye
|
|
154
|
+
}),
|
|
155
|
+
error: I({}, e, {
|
|
156
|
+
value: me
|
|
157
|
+
}),
|
|
158
|
+
group: I({}, e, {
|
|
159
|
+
value: be
|
|
160
|
+
}),
|
|
161
|
+
groupCollapsed: I({}, e, {
|
|
162
|
+
value: _e
|
|
163
|
+
}),
|
|
164
|
+
groupEnd: I({}, e, {
|
|
165
|
+
value: he
|
|
166
|
+
})
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
Y < 0 && m("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
var ne = w.ReactCurrentDispatcher, ae;
|
|
173
|
+
function J(e, r, t) {
|
|
174
|
+
{
|
|
175
|
+
if (ae === void 0)
|
|
176
|
+
try {
|
|
177
|
+
throw Error();
|
|
178
|
+
} catch (i) {
|
|
179
|
+
var n = i.stack.trim().match(/\n( *(at )?)/);
|
|
180
|
+
ae = n && n[1] || "";
|
|
181
|
+
}
|
|
182
|
+
return `
|
|
183
|
+
` + ae + e;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
var oe = !1, q;
|
|
187
|
+
{
|
|
188
|
+
var Le = typeof WeakMap == "function" ? WeakMap : Map;
|
|
189
|
+
q = new Le();
|
|
190
|
+
}
|
|
191
|
+
function Ee(e, r) {
|
|
192
|
+
if (!e || oe)
|
|
193
|
+
return "";
|
|
194
|
+
{
|
|
195
|
+
var t = q.get(e);
|
|
196
|
+
if (t !== void 0)
|
|
197
|
+
return t;
|
|
198
|
+
}
|
|
199
|
+
var n;
|
|
200
|
+
oe = !0;
|
|
201
|
+
var i = Error.prepareStackTrace;
|
|
202
|
+
Error.prepareStackTrace = void 0;
|
|
203
|
+
var s;
|
|
204
|
+
s = ne.current, ne.current = null, Ke();
|
|
205
|
+
try {
|
|
206
|
+
if (r) {
|
|
207
|
+
var o = function() {
|
|
208
|
+
throw Error();
|
|
209
|
+
};
|
|
210
|
+
if (Object.defineProperty(o.prototype, "props", {
|
|
211
|
+
set: function() {
|
|
212
|
+
throw Error();
|
|
213
|
+
}
|
|
214
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
215
|
+
try {
|
|
216
|
+
Reflect.construct(o, []);
|
|
217
|
+
} catch (E) {
|
|
218
|
+
n = E;
|
|
219
|
+
}
|
|
220
|
+
Reflect.construct(e, [], o);
|
|
221
|
+
} else {
|
|
222
|
+
try {
|
|
223
|
+
o.call();
|
|
224
|
+
} catch (E) {
|
|
225
|
+
n = E;
|
|
226
|
+
}
|
|
227
|
+
e.call(o.prototype);
|
|
228
|
+
}
|
|
229
|
+
} else {
|
|
230
|
+
try {
|
|
231
|
+
throw Error();
|
|
232
|
+
} catch (E) {
|
|
233
|
+
n = E;
|
|
234
|
+
}
|
|
235
|
+
e();
|
|
236
|
+
}
|
|
237
|
+
} catch (E) {
|
|
238
|
+
if (E && n && typeof E.stack == "string") {
|
|
239
|
+
for (var a = E.stack.split(`
|
|
240
|
+
`), _ = n.stack.split(`
|
|
241
|
+
`), c = a.length - 1, f = _.length - 1; c >= 1 && f >= 0 && a[c] !== _[f]; )
|
|
242
|
+
f--;
|
|
243
|
+
for (; c >= 1 && f >= 0; c--, f--)
|
|
244
|
+
if (a[c] !== _[f]) {
|
|
245
|
+
if (c !== 1 || f !== 1)
|
|
246
|
+
do
|
|
247
|
+
if (c--, f--, f < 0 || a[c] !== _[f]) {
|
|
248
|
+
var R = `
|
|
249
|
+
` + a[c].replace(" at new ", " at ");
|
|
250
|
+
return e.displayName && R.includes("<anonymous>") && (R = R.replace("<anonymous>", e.displayName)), typeof e == "function" && q.set(e, R), R;
|
|
251
|
+
}
|
|
252
|
+
while (c >= 1 && f >= 0);
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
} finally {
|
|
257
|
+
oe = !1, ne.current = s, Ue(), Error.prepareStackTrace = i;
|
|
258
|
+
}
|
|
259
|
+
var W = e ? e.displayName || e.name : "", M = W ? J(W) : "";
|
|
260
|
+
return typeof e == "function" && q.set(e, M), M;
|
|
261
|
+
}
|
|
262
|
+
function Ve(e, r, t) {
|
|
263
|
+
return Ee(e, !1);
|
|
264
|
+
}
|
|
265
|
+
function Be(e) {
|
|
266
|
+
var r = e.prototype;
|
|
267
|
+
return !!(r && r.isReactComponent);
|
|
268
|
+
}
|
|
269
|
+
function G(e, r, t) {
|
|
270
|
+
if (e == null)
|
|
271
|
+
return "";
|
|
272
|
+
if (typeof e == "function")
|
|
273
|
+
return Ee(e, Be(e));
|
|
274
|
+
if (typeof e == "string")
|
|
275
|
+
return J(e);
|
|
276
|
+
switch (e) {
|
|
277
|
+
case k:
|
|
278
|
+
return J("Suspense");
|
|
279
|
+
case p:
|
|
280
|
+
return J("SuspenseList");
|
|
281
|
+
}
|
|
282
|
+
if (typeof e == "object")
|
|
283
|
+
switch (e.$$typeof) {
|
|
284
|
+
case v:
|
|
285
|
+
return Ve(e.render);
|
|
286
|
+
case T:
|
|
287
|
+
return G(e.type, r, t);
|
|
288
|
+
case x: {
|
|
289
|
+
var n = e, i = n._payload, s = n._init;
|
|
290
|
+
try {
|
|
291
|
+
return G(s(i), r, t);
|
|
292
|
+
} catch {
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
return "";
|
|
297
|
+
}
|
|
298
|
+
var K = Object.prototype.hasOwnProperty, Re = {}, ke = w.ReactDebugCurrentFrame;
|
|
299
|
+
function z(e) {
|
|
300
|
+
if (e) {
|
|
301
|
+
var r = e._owner, t = G(e.type, e._source, r ? r.type : null);
|
|
302
|
+
ke.setExtraStackFrame(t);
|
|
303
|
+
} else
|
|
304
|
+
ke.setExtraStackFrame(null);
|
|
305
|
+
}
|
|
306
|
+
function Je(e, r, t, n, i) {
|
|
307
|
+
{
|
|
308
|
+
var s = Function.call.bind(K);
|
|
309
|
+
for (var o in e)
|
|
310
|
+
if (s(e, o)) {
|
|
311
|
+
var a = void 0;
|
|
312
|
+
try {
|
|
313
|
+
if (typeof e[o] != "function") {
|
|
314
|
+
var _ = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
315
|
+
throw _.name = "Invariant Violation", _;
|
|
316
|
+
}
|
|
317
|
+
a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
318
|
+
} catch (c) {
|
|
319
|
+
a = c;
|
|
320
|
+
}
|
|
321
|
+
a && !(a instanceof Error) && (z(i), m("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), z(null)), a instanceof Error && !(a.message in Re) && (Re[a.message] = !0, z(i), m("Failed %s type: %s", t, a.message), z(null));
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
var qe = Array.isArray;
|
|
326
|
+
function ie(e) {
|
|
327
|
+
return qe(e);
|
|
328
|
+
}
|
|
329
|
+
function Ge(e) {
|
|
330
|
+
{
|
|
331
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
332
|
+
return t;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
function ze(e) {
|
|
336
|
+
try {
|
|
337
|
+
return Te(e), !1;
|
|
338
|
+
} catch {
|
|
339
|
+
return !0;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
function Te(e) {
|
|
343
|
+
return "" + e;
|
|
344
|
+
}
|
|
345
|
+
function xe(e) {
|
|
346
|
+
if (ze(e))
|
|
347
|
+
return m("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ge(e)), Te(e);
|
|
348
|
+
}
|
|
349
|
+
var Ce = w.ReactCurrentOwner, Xe = {
|
|
350
|
+
key: !0,
|
|
351
|
+
ref: !0,
|
|
352
|
+
__self: !0,
|
|
353
|
+
__source: !0
|
|
354
|
+
}, Oe, Se;
|
|
355
|
+
function He(e) {
|
|
356
|
+
if (K.call(e, "ref")) {
|
|
357
|
+
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
358
|
+
if (r && r.isReactWarning)
|
|
359
|
+
return !1;
|
|
360
|
+
}
|
|
361
|
+
return e.ref !== void 0;
|
|
362
|
+
}
|
|
363
|
+
function Ze(e) {
|
|
364
|
+
if (K.call(e, "key")) {
|
|
365
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
366
|
+
if (r && r.isReactWarning)
|
|
367
|
+
return !1;
|
|
368
|
+
}
|
|
369
|
+
return e.key !== void 0;
|
|
370
|
+
}
|
|
371
|
+
function Qe(e, r) {
|
|
372
|
+
typeof e.ref == "string" && Ce.current;
|
|
373
|
+
}
|
|
374
|
+
function er(e, r) {
|
|
375
|
+
{
|
|
376
|
+
var t = function() {
|
|
377
|
+
Oe || (Oe = !0, m("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
378
|
+
};
|
|
379
|
+
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
380
|
+
get: t,
|
|
381
|
+
configurable: !0
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
function rr(e, r) {
|
|
386
|
+
{
|
|
387
|
+
var t = function() {
|
|
388
|
+
Se || (Se = !0, m("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
389
|
+
};
|
|
390
|
+
t.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
391
|
+
get: t,
|
|
392
|
+
configurable: !0
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
var tr = function(e, r, t, n, i, s, o) {
|
|
397
|
+
var a = {
|
|
398
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
399
|
+
$$typeof: u,
|
|
400
|
+
// Built-in properties that belong on the element
|
|
401
|
+
type: e,
|
|
402
|
+
key: r,
|
|
403
|
+
ref: t,
|
|
404
|
+
props: o,
|
|
405
|
+
// Record the component responsible for creating this element.
|
|
406
|
+
_owner: s
|
|
407
|
+
};
|
|
408
|
+
return a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
409
|
+
configurable: !1,
|
|
410
|
+
enumerable: !1,
|
|
411
|
+
writable: !0,
|
|
412
|
+
value: !1
|
|
413
|
+
}), Object.defineProperty(a, "_self", {
|
|
414
|
+
configurable: !1,
|
|
415
|
+
enumerable: !1,
|
|
416
|
+
writable: !1,
|
|
417
|
+
value: n
|
|
418
|
+
}), Object.defineProperty(a, "_source", {
|
|
419
|
+
configurable: !1,
|
|
420
|
+
enumerable: !1,
|
|
421
|
+
writable: !1,
|
|
422
|
+
value: i
|
|
423
|
+
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
424
|
+
};
|
|
425
|
+
function nr(e, r, t, n, i) {
|
|
426
|
+
{
|
|
427
|
+
var s, o = {}, a = null, _ = null;
|
|
428
|
+
t !== void 0 && (xe(t), a = "" + t), Ze(r) && (xe(r.key), a = "" + r.key), He(r) && (_ = r.ref, Qe(r, i));
|
|
429
|
+
for (s in r)
|
|
430
|
+
K.call(r, s) && !Xe.hasOwnProperty(s) && (o[s] = r[s]);
|
|
431
|
+
if (e && e.defaultProps) {
|
|
432
|
+
var c = e.defaultProps;
|
|
433
|
+
for (s in c)
|
|
434
|
+
o[s] === void 0 && (o[s] = c[s]);
|
|
435
|
+
}
|
|
436
|
+
if (a || _) {
|
|
437
|
+
var f = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
438
|
+
a && er(o, f), _ && rr(o, f);
|
|
439
|
+
}
|
|
440
|
+
return tr(e, a, _, i, n, Ce.current, o);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
var ue = w.ReactCurrentOwner, Pe = w.ReactDebugCurrentFrame;
|
|
444
|
+
function $(e) {
|
|
445
|
+
if (e) {
|
|
446
|
+
var r = e._owner, t = G(e.type, e._source, r ? r.type : null);
|
|
447
|
+
Pe.setExtraStackFrame(t);
|
|
448
|
+
} else
|
|
449
|
+
Pe.setExtraStackFrame(null);
|
|
450
|
+
}
|
|
451
|
+
var se;
|
|
452
|
+
se = !1;
|
|
453
|
+
function le(e) {
|
|
454
|
+
return typeof e == "object" && e !== null && e.$$typeof === u;
|
|
455
|
+
}
|
|
456
|
+
function je() {
|
|
457
|
+
{
|
|
458
|
+
if (ue.current) {
|
|
459
|
+
var e = D(ue.current.type);
|
|
460
|
+
if (e)
|
|
461
|
+
return `
|
|
462
|
+
|
|
463
|
+
Check the render method of \`` + e + "`.";
|
|
464
|
+
}
|
|
465
|
+
return "";
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
function ar(e) {
|
|
469
|
+
return "";
|
|
470
|
+
}
|
|
471
|
+
var we = {};
|
|
472
|
+
function or(e) {
|
|
473
|
+
{
|
|
474
|
+
var r = je();
|
|
475
|
+
if (!r) {
|
|
476
|
+
var t = typeof e == "string" ? e : e.displayName || e.name;
|
|
477
|
+
t && (r = `
|
|
478
|
+
|
|
479
|
+
Check the top-level render call using <` + t + ">.");
|
|
480
|
+
}
|
|
481
|
+
return r;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
function De(e, r) {
|
|
485
|
+
{
|
|
486
|
+
if (!e._store || e._store.validated || e.key != null)
|
|
487
|
+
return;
|
|
488
|
+
e._store.validated = !0;
|
|
489
|
+
var t = or(r);
|
|
490
|
+
if (we[t])
|
|
491
|
+
return;
|
|
492
|
+
we[t] = !0;
|
|
493
|
+
var n = "";
|
|
494
|
+
e && e._owner && e._owner !== ue.current && (n = " It was passed a child from " + D(e._owner.type) + "."), $(e), m('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), $(null);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
function Fe(e, r) {
|
|
498
|
+
{
|
|
499
|
+
if (typeof e != "object")
|
|
500
|
+
return;
|
|
501
|
+
if (ie(e))
|
|
502
|
+
for (var t = 0; t < e.length; t++) {
|
|
503
|
+
var n = e[t];
|
|
504
|
+
le(n) && De(n, r);
|
|
505
|
+
}
|
|
506
|
+
else if (le(e))
|
|
507
|
+
e._store && (e._store.validated = !0);
|
|
508
|
+
else if (e) {
|
|
509
|
+
var i = Q(e);
|
|
510
|
+
if (typeof i == "function" && i !== e.entries)
|
|
511
|
+
for (var s = i.call(e), o; !(o = s.next()).done; )
|
|
512
|
+
le(o.value) && De(o.value, r);
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
function ir(e) {
|
|
517
|
+
{
|
|
518
|
+
var r = e.type;
|
|
519
|
+
if (r == null || typeof r == "string")
|
|
520
|
+
return;
|
|
521
|
+
var t;
|
|
522
|
+
if (typeof r == "function")
|
|
523
|
+
t = r.propTypes;
|
|
524
|
+
else if (typeof r == "object" && (r.$$typeof === v || // Note: Memo only checks outer props here.
|
|
525
|
+
// Inner props are checked in the reconciler.
|
|
526
|
+
r.$$typeof === T))
|
|
527
|
+
t = r.propTypes;
|
|
528
|
+
else
|
|
529
|
+
return;
|
|
530
|
+
if (t) {
|
|
531
|
+
var n = D(r);
|
|
532
|
+
Je(t, e.props, "prop", n, e);
|
|
533
|
+
} else if (r.PropTypes !== void 0 && !se) {
|
|
534
|
+
se = !0;
|
|
535
|
+
var i = D(r);
|
|
536
|
+
m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
|
|
537
|
+
}
|
|
538
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && m("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
function ur(e) {
|
|
542
|
+
{
|
|
543
|
+
for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
|
|
544
|
+
var n = r[t];
|
|
545
|
+
if (n !== "children" && n !== "key") {
|
|
546
|
+
$(e), m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), $(null);
|
|
547
|
+
break;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
e.ref !== null && ($(e), m("Invalid attribute `ref` supplied to `React.Fragment`."), $(null));
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
var Ae = {};
|
|
554
|
+
function Ie(e, r, t, n, i, s) {
|
|
555
|
+
{
|
|
556
|
+
var o = B(e);
|
|
557
|
+
if (!o) {
|
|
558
|
+
var a = "";
|
|
559
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
560
|
+
var _ = ar();
|
|
561
|
+
_ ? a += _ : a += je();
|
|
562
|
+
var c;
|
|
563
|
+
e === null ? c = "null" : ie(e) ? c = "array" : e !== void 0 && e.$$typeof === u ? (c = "<" + (D(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : c = typeof e, m("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", c, a);
|
|
564
|
+
}
|
|
565
|
+
var f = nr(e, r, t, i, s);
|
|
566
|
+
if (f == null)
|
|
567
|
+
return f;
|
|
568
|
+
if (o) {
|
|
569
|
+
var R = r.children;
|
|
570
|
+
if (R !== void 0)
|
|
571
|
+
if (n)
|
|
572
|
+
if (ie(R)) {
|
|
573
|
+
for (var W = 0; W < R.length; W++)
|
|
574
|
+
Fe(R[W], e);
|
|
575
|
+
Object.freeze && Object.freeze(R);
|
|
576
|
+
} else
|
|
577
|
+
m("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
578
|
+
else
|
|
579
|
+
Fe(R, e);
|
|
580
|
+
}
|
|
581
|
+
if (K.call(r, "key")) {
|
|
582
|
+
var M = D(e), E = Object.keys(r).filter(function(vr) {
|
|
583
|
+
return vr !== "key";
|
|
584
|
+
}), ce = E.length > 0 ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
585
|
+
if (!Ae[M + ce]) {
|
|
586
|
+
var dr = E.length > 0 ? "{" + E.join(": ..., ") + ": ...}" : "{}";
|
|
587
|
+
m(`A props object containing a "key" prop is being spread into JSX:
|
|
588
|
+
let props = %s;
|
|
589
|
+
<%s {...props} />
|
|
590
|
+
React keys must be passed directly to JSX without using spread:
|
|
591
|
+
let props = %s;
|
|
592
|
+
<%s key={someKey} {...props} />`, ce, M, dr, M), Ae[M + ce] = !0;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
return e === h ? ur(f) : ir(f), f;
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
function sr(e, r, t) {
|
|
599
|
+
return Ie(e, r, t, !0);
|
|
600
|
+
}
|
|
601
|
+
function lr(e, r, t) {
|
|
602
|
+
return Ie(e, r, t, !1);
|
|
603
|
+
}
|
|
604
|
+
var cr = lr, fr = sr;
|
|
605
|
+
L.Fragment = h, L.jsx = cr, L.jsxs = fr;
|
|
606
|
+
})()), L;
|
|
607
|
+
}
|
|
608
|
+
var Ne;
|
|
609
|
+
function _r() {
|
|
610
|
+
return Ne || (Ne = 1, process.env.NODE_ENV === "production" ? X.exports = mr() : X.exports = br()), X.exports;
|
|
611
|
+
}
|
|
612
|
+
var O = _r();
|
|
613
|
+
const hr = ({ currentKey: d }) => {
|
|
614
|
+
let u;
|
|
615
|
+
do
|
|
616
|
+
u = Math.floor(Math.random() * 10);
|
|
617
|
+
while (u === d);
|
|
618
|
+
return { randomKey: u };
|
|
619
|
+
};
|
|
620
|
+
function gr(d) {
|
|
621
|
+
const u = [...d];
|
|
622
|
+
for (let y = u.length - 1; y > 0; y--) {
|
|
623
|
+
const h = Math.floor(Math.random() * (y + 1));
|
|
624
|
+
[u[y], u[h]] = [u[h], u[y]];
|
|
625
|
+
}
|
|
626
|
+
return u;
|
|
627
|
+
}
|
|
628
|
+
const Er = 4, Rr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
|
|
629
|
+
function kr({
|
|
630
|
+
numbers: d = Rr,
|
|
631
|
+
shuffleKey: u = !1
|
|
632
|
+
} = {}) {
|
|
633
|
+
const y = fe(0), [h, S] = H(0);
|
|
634
|
+
return { keys: pr(() => {
|
|
635
|
+
const b = d.map((p) => ({
|
|
636
|
+
type: "num",
|
|
637
|
+
value: p
|
|
638
|
+
})), v = Array.from({ length: 2 }, () => ({ type: "dummy" })), k = [...b, ...v];
|
|
639
|
+
return u ? gr(k) : k;
|
|
640
|
+
}, [d, u, h]), onDigitPress: () => {
|
|
641
|
+
u && (y.current += 1, y.current >= Er && (y.current = 0, S((b) => b + 1)));
|
|
642
|
+
} };
|
|
643
|
+
}
|
|
644
|
+
const Tr = ({ onBackspace: d, disabled: u }) => /* @__PURE__ */ O.jsx(
|
|
645
|
+
"button",
|
|
646
|
+
{
|
|
647
|
+
className: "kp__btn kp__btn-del ",
|
|
648
|
+
type: "button",
|
|
649
|
+
onClick: d,
|
|
650
|
+
disabled: u,
|
|
651
|
+
children: "⌫"
|
|
652
|
+
}
|
|
653
|
+
), xr = ({ onClear: d, disabled: u }) => /* @__PURE__ */ O.jsx(
|
|
654
|
+
"button",
|
|
655
|
+
{
|
|
656
|
+
className: "kp__btn kp__btn--clear",
|
|
657
|
+
type: "button",
|
|
658
|
+
onClick: d,
|
|
659
|
+
disabled: u,
|
|
660
|
+
children: "초기화"
|
|
661
|
+
},
|
|
662
|
+
"clear"
|
|
663
|
+
), Cr = ({ onOk: d, disabled: u }) => /* @__PURE__ */ O.jsx(
|
|
664
|
+
"button",
|
|
665
|
+
{
|
|
666
|
+
className: "kp__btn kp__btn--ok",
|
|
667
|
+
type: "button",
|
|
668
|
+
onClick: d,
|
|
669
|
+
disabled: u,
|
|
670
|
+
children: "확인"
|
|
671
|
+
},
|
|
672
|
+
"ok"
|
|
673
|
+
), Or = [
|
|
674
|
+
{ type: "num", value: 1 },
|
|
675
|
+
{ type: "num", value: 2 },
|
|
676
|
+
{ type: "num", value: 3 },
|
|
677
|
+
{ type: "num", value: 4 },
|
|
678
|
+
{ type: "del" },
|
|
679
|
+
{ type: "num", value: 5 },
|
|
680
|
+
{ type: "num", value: 6 },
|
|
681
|
+
{ type: "num", value: 7 },
|
|
682
|
+
{ type: "num", value: 8 },
|
|
683
|
+
{ type: "clear" },
|
|
684
|
+
{ type: "num", value: 9 },
|
|
685
|
+
{ type: "num", value: 0 },
|
|
686
|
+
{ type: "dummy" },
|
|
687
|
+
{ type: "dummy" },
|
|
688
|
+
{ type: "ok" }
|
|
689
|
+
], Pr = ({
|
|
690
|
+
mixedKey: d = !1,
|
|
691
|
+
shuffleKey: u = !1,
|
|
692
|
+
pressCooldown: y = 500,
|
|
693
|
+
onPress: h,
|
|
694
|
+
onOkClick: S,
|
|
695
|
+
onBackspaceClick: F,
|
|
696
|
+
onClearClick: P
|
|
697
|
+
}) => {
|
|
698
|
+
const [b, v] = H(null), [k, p] = H([]), [T, x] = H(!1), A = fe(0), j = fe(null), Z = (l) => {
|
|
699
|
+
const g = l.target.closest("button");
|
|
700
|
+
if (!g || g.classList.contains("kp__btn--dummy")) return;
|
|
701
|
+
const C = g.dataset.key;
|
|
702
|
+
console.log("버튼 눌림: ", C), C != null && (ee(), v(Number(C)));
|
|
703
|
+
};
|
|
704
|
+
Me(() => () => j.current && clearTimeout(j.current), []);
|
|
705
|
+
const Q = (l) => {
|
|
706
|
+
x(!0), j.current && clearTimeout(j.current);
|
|
707
|
+
const g = Math.max(0, l - Date.now());
|
|
708
|
+
j.current = setTimeout(() => {
|
|
709
|
+
x(!1);
|
|
710
|
+
}, g);
|
|
711
|
+
}, w = yr(
|
|
712
|
+
(l) => {
|
|
713
|
+
const g = Date.now();
|
|
714
|
+
if (y > 0 && g < A.current) return;
|
|
715
|
+
const C = g + Math.max(0, y);
|
|
716
|
+
A.current = C, y > 0 && Q(C);
|
|
717
|
+
const { action: N, key: B } = l.currentTarget.dataset, te = N ? { type: N } : { type: "num", value: B != null ? Number(B) : void 0 };
|
|
718
|
+
h?.(te);
|
|
719
|
+
},
|
|
720
|
+
[h, y]
|
|
721
|
+
), { keys: m, onDigitPress: ee } = kr({
|
|
722
|
+
shuffleKey: u
|
|
723
|
+
});
|
|
724
|
+
let V = 0;
|
|
725
|
+
const re = Or.map((l) => {
|
|
726
|
+
if (l.type === "num" || l.type === "dummy") {
|
|
727
|
+
const g = m[V];
|
|
728
|
+
return V += 1, g ?? { type: "dummy" };
|
|
729
|
+
}
|
|
730
|
+
return l;
|
|
731
|
+
});
|
|
732
|
+
return Me(() => {
|
|
733
|
+
if (!d || b === null) {
|
|
734
|
+
p([]);
|
|
735
|
+
return;
|
|
736
|
+
}
|
|
737
|
+
const { randomKey: l } = hr({});
|
|
738
|
+
console.log("버튼 같이 눌림: ", b, l), p([b, l]), setTimeout(() => {
|
|
739
|
+
p([]);
|
|
740
|
+
}, 400);
|
|
741
|
+
}, [d, b]), /* @__PURE__ */ O.jsx("div", { className: "kp", children: /* @__PURE__ */ O.jsx("div", { className: "kp__grid", onClick: Z, children: re.map((l, g) => {
|
|
742
|
+
if (l.type === "num") {
|
|
743
|
+
const C = k.includes(l.value);
|
|
744
|
+
return /* @__PURE__ */ O.jsx(
|
|
745
|
+
"button",
|
|
746
|
+
{
|
|
747
|
+
className: "kp__btn kp__btn--num",
|
|
748
|
+
type: "button",
|
|
749
|
+
"data-key": l.value,
|
|
750
|
+
onClick: w,
|
|
751
|
+
disabled: T,
|
|
752
|
+
style: C ? {
|
|
753
|
+
background: "var(--blue-weak)",
|
|
754
|
+
borderColor: "rgba(49,130,246,.75)"
|
|
755
|
+
} : void 0,
|
|
756
|
+
children: l.value
|
|
757
|
+
},
|
|
758
|
+
`num-${l.value}`
|
|
759
|
+
);
|
|
760
|
+
}
|
|
761
|
+
return l.type === "del" ? /* @__PURE__ */ O.jsx(
|
|
762
|
+
Tr,
|
|
763
|
+
{
|
|
764
|
+
onBackspace: F,
|
|
765
|
+
disabled: !1
|
|
766
|
+
}
|
|
767
|
+
) : l.type === "ok" ? /* @__PURE__ */ O.jsx(Cr, { onOk: S, disabled: !1 }) : l.type === "clear" ? /* @__PURE__ */ O.jsx(xr, { onClear: P, disabled: !1 }) : l.type === "dummy" ? /* @__PURE__ */ O.jsx(
|
|
768
|
+
"button",
|
|
769
|
+
{
|
|
770
|
+
className: "kp__btn kp__btn--dummy",
|
|
771
|
+
type: "button",
|
|
772
|
+
tabIndex: -1,
|
|
773
|
+
"aria-hidden": "true"
|
|
774
|
+
},
|
|
775
|
+
`dummy-${g}`
|
|
776
|
+
) : null;
|
|
777
|
+
}) }) });
|
|
778
|
+
};
|
|
779
|
+
export {
|
|
780
|
+
Pr as Keypad
|
|
781
|
+
};
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "secure-keypad",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A secure numeric keypad with shuffled keys and anti-spam input protection",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
5
|
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": "./dist/index.js"
|
|
10
|
+
},
|
|
7
11
|
"scripts": {
|
|
8
12
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
13
|
"dev": "vite",
|