@myrasec/eu-captcha 0.0.8 → 0.0.10
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.
Potentially problematic release.
This version of @myrasec/eu-captcha might be problematic. Click here for more details.
- package/README.md +40 -2
- package/dist/eu-captcha.js +116 -106
- package/dist/eu-captcha.umd.cjs +2 -2
- package/package.json +1 -1
- package/publish.sh +5 -0
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@ This package provides an easy integration of Myra Security's EU Captcha.
|
|
|
2
2
|
|
|
3
3
|
You can use it with or without react.
|
|
4
4
|
|
|
5
|
+
## with react
|
|
6
|
+
|
|
5
7
|
How to use with react:
|
|
6
8
|
|
|
7
9
|
(0) npm i @myrasec/eu-captcha
|
|
@@ -9,7 +11,7 @@ How to use with react:
|
|
|
9
11
|
(1) In your code add:
|
|
10
12
|
|
|
11
13
|
```
|
|
12
|
-
import { EuCaptcha } from "@myrasec/eu-captcha";
|
|
14
|
+
import { EuCaptcha, isEuCaptchaDone } from "@myrasec/eu-captcha";
|
|
13
15
|
|
|
14
16
|
// use the public sitekey you find in the customer's backend here.
|
|
15
17
|
const captchaSitekey = "YOUR-SITEKEY-HERE";
|
|
@@ -25,6 +27,8 @@ You can test the integration using any fake sitekey. If a sitekey
|
|
|
25
27
|
does not exist, then the captcha runs with default parameters which
|
|
26
28
|
allow traffic to pass.
|
|
27
29
|
|
|
30
|
+
## without react
|
|
31
|
+
|
|
28
32
|
Without react, you can use the library like this:
|
|
29
33
|
|
|
30
34
|
(0) npm i @myrasec/eu-captcha
|
|
@@ -32,7 +36,7 @@ Without react, you can use the library like this:
|
|
|
32
36
|
(1) Load the JS components asynchronously:
|
|
33
37
|
|
|
34
38
|
```
|
|
35
|
-
import { loadEuCaptcha } from "@myrasec/eu-captcha";
|
|
39
|
+
import { loadEuCaptcha, isEuCaptchaDone } from "@myrasec/eu-captcha";
|
|
36
40
|
|
|
37
41
|
loadEuCaptcha();
|
|
38
42
|
```
|
|
@@ -42,3 +46,37 @@ loadEuCaptcha();
|
|
|
42
46
|
```
|
|
43
47
|
<div class="eu-captcha" data-sitekey="YOUR-SITEKEY-HERE"></div>
|
|
44
48
|
```
|
|
49
|
+
|
|
50
|
+
## Querying state
|
|
51
|
+
|
|
52
|
+
Before submitting a form to a server, please ensure that EuCaptcha is done.
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
import { isEuCaptchaDone } from "@myrasec/eu-captcha";
|
|
56
|
+
|
|
57
|
+
function onSubmit(e) {
|
|
58
|
+
e.preventDefault();
|
|
59
|
+
|
|
60
|
+
if (!isEuCaptchaDone()) {
|
|
61
|
+
// computation has not been completed
|
|
62
|
+
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Listening to state change
|
|
69
|
+
|
|
70
|
+
Additionally, a message will be posted to the main window with msg.data.type
|
|
71
|
+
set to 'euCaptchaDone', in case you want to be informed actively to change
|
|
72
|
+
e.g. the state of a button.
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
function listenForCaptchaDone(msg: MessageEvent) {
|
|
76
|
+
if (msg.data.type === 'euCaptchaDone') {
|
|
77
|
+
// change the state of the form, etc.
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
window.addEventListener("message", listenForCaptchaDone, false);
|
|
82
|
+
```
|
package/dist/eu-captcha.js
CHANGED
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ae, { useState as oe, useEffect as le } from "react";
|
|
2
2
|
var b = { exports: {} }, E = {};
|
|
3
|
-
var
|
|
4
|
-
function
|
|
5
|
-
if (
|
|
6
|
-
|
|
7
|
-
var t = /* @__PURE__ */ Symbol.for("react.transitional.element"),
|
|
8
|
-
function
|
|
3
|
+
var M;
|
|
4
|
+
function se() {
|
|
5
|
+
if (M) return E;
|
|
6
|
+
M = 1;
|
|
7
|
+
var t = /* @__PURE__ */ Symbol.for("react.transitional.element"), l = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
8
|
+
function c(s, u, i) {
|
|
9
9
|
var d = null;
|
|
10
|
-
if (
|
|
11
|
-
|
|
12
|
-
for (var m in
|
|
13
|
-
m !== "key" && (
|
|
14
|
-
} else
|
|
15
|
-
return
|
|
10
|
+
if (i !== void 0 && (d = "" + i), u.key !== void 0 && (d = "" + u.key), "key" in u) {
|
|
11
|
+
i = {};
|
|
12
|
+
for (var m in u)
|
|
13
|
+
m !== "key" && (i[m] = u[m]);
|
|
14
|
+
} else i = u;
|
|
15
|
+
return u = i.ref, {
|
|
16
16
|
$$typeof: t,
|
|
17
|
-
type:
|
|
17
|
+
type: s,
|
|
18
18
|
key: d,
|
|
19
|
-
ref:
|
|
20
|
-
props:
|
|
19
|
+
ref: u !== void 0 ? u : null,
|
|
20
|
+
props: i
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
return E.Fragment =
|
|
23
|
+
return E.Fragment = l, E.jsx = c, E.jsxs = c, E;
|
|
24
24
|
}
|
|
25
25
|
var _ = {};
|
|
26
|
-
var
|
|
27
|
-
function
|
|
28
|
-
return
|
|
26
|
+
var W;
|
|
27
|
+
function ue() {
|
|
28
|
+
return W || (W = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
29
29
|
function t(e) {
|
|
30
30
|
if (e == null) return null;
|
|
31
31
|
if (typeof e == "function")
|
|
32
|
-
return e.$$typeof ===
|
|
32
|
+
return e.$$typeof === re ? null : e.displayName || e.name || null;
|
|
33
33
|
if (typeof e == "string") return e;
|
|
34
34
|
switch (e) {
|
|
35
|
-
case
|
|
35
|
+
case y:
|
|
36
36
|
return "Fragment";
|
|
37
|
-
case
|
|
37
|
+
case G:
|
|
38
38
|
return "Profiler";
|
|
39
|
-
case
|
|
39
|
+
case z:
|
|
40
40
|
return "StrictMode";
|
|
41
|
-
case
|
|
41
|
+
case Z:
|
|
42
42
|
return "Suspense";
|
|
43
|
-
case
|
|
43
|
+
case Q:
|
|
44
44
|
return "SuspenseList";
|
|
45
|
-
case
|
|
45
|
+
case ee:
|
|
46
46
|
return "Activity";
|
|
47
47
|
}
|
|
48
48
|
if (typeof e == "object")
|
|
49
49
|
switch (typeof e.tag == "number" && console.error(
|
|
50
50
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
51
51
|
), e.$$typeof) {
|
|
52
|
-
case
|
|
52
|
+
case V:
|
|
53
53
|
return "Portal";
|
|
54
|
-
case
|
|
54
|
+
case H:
|
|
55
55
|
return e.displayName || "Context";
|
|
56
|
-
case
|
|
56
|
+
case X:
|
|
57
57
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
58
|
-
case
|
|
58
|
+
case B:
|
|
59
59
|
var r = e.render;
|
|
60
60
|
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
61
|
-
case
|
|
61
|
+
case K:
|
|
62
62
|
return r = e.displayName || null, r !== null ? r : t(e.type) || "Memo";
|
|
63
|
-
case
|
|
63
|
+
case h:
|
|
64
64
|
r = e._payload, e = e._init;
|
|
65
65
|
try {
|
|
66
66
|
return t(e(r));
|
|
@@ -69,12 +69,12 @@ function ne() {
|
|
|
69
69
|
}
|
|
70
70
|
return null;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function l(e) {
|
|
73
73
|
return "" + e;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function c(e) {
|
|
76
76
|
try {
|
|
77
|
-
|
|
77
|
+
l(e);
|
|
78
78
|
var r = !1;
|
|
79
79
|
} catch {
|
|
80
80
|
r = !0;
|
|
@@ -86,12 +86,12 @@ function ne() {
|
|
|
86
86
|
r,
|
|
87
87
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
88
88
|
a
|
|
89
|
-
),
|
|
89
|
+
), l(e);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
function
|
|
93
|
-
if (e ===
|
|
94
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
92
|
+
function s(e) {
|
|
93
|
+
if (e === y) return "<>";
|
|
94
|
+
if (typeof e == "object" && e !== null && e.$$typeof === h)
|
|
95
95
|
return "<...>";
|
|
96
96
|
try {
|
|
97
97
|
var r = t(e);
|
|
@@ -100,15 +100,15 @@ function ne() {
|
|
|
100
100
|
return "<...>";
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
var e =
|
|
103
|
+
function u() {
|
|
104
|
+
var e = g.A;
|
|
105
105
|
return e === null ? null : e.getOwner();
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function i() {
|
|
108
108
|
return Error("react-stack-top-frame");
|
|
109
109
|
}
|
|
110
110
|
function d(e) {
|
|
111
|
-
if (
|
|
111
|
+
if (Y.call(e, "key")) {
|
|
112
112
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
113
113
|
if (r && r.isReactWarning) return !1;
|
|
114
114
|
}
|
|
@@ -116,7 +116,7 @@ function ne() {
|
|
|
116
116
|
}
|
|
117
117
|
function m(e, r) {
|
|
118
118
|
function n() {
|
|
119
|
-
|
|
119
|
+
$ || ($ = !0, console.error(
|
|
120
120
|
"%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://react.dev/link/special-props)",
|
|
121
121
|
r
|
|
122
122
|
));
|
|
@@ -126,23 +126,23 @@ function ne() {
|
|
|
126
126
|
configurable: !0
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function q() {
|
|
130
130
|
var e = t(this.type);
|
|
131
|
-
return
|
|
131
|
+
return F[e] || (F[e] = !0, console.error(
|
|
132
132
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
133
133
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function J(e, r, n, a, R, w) {
|
|
136
136
|
var o = n.ref;
|
|
137
137
|
return e = {
|
|
138
|
-
$$typeof:
|
|
138
|
+
$$typeof: N,
|
|
139
139
|
type: e,
|
|
140
140
|
key: r,
|
|
141
141
|
props: n,
|
|
142
142
|
_owner: a
|
|
143
143
|
}, (o !== void 0 ? o : null) !== null ? Object.defineProperty(e, "ref", {
|
|
144
144
|
enumerable: !1,
|
|
145
|
-
get:
|
|
145
|
+
get: q
|
|
146
146
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
147
147
|
configurable: !1,
|
|
148
148
|
enumerable: !1,
|
|
@@ -162,28 +162,28 @@ function ne() {
|
|
|
162
162
|
configurable: !1,
|
|
163
163
|
enumerable: !1,
|
|
164
164
|
writable: !0,
|
|
165
|
-
value:
|
|
165
|
+
value: w
|
|
166
166
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
167
167
|
}
|
|
168
|
-
function
|
|
168
|
+
function j(e, r, n, a, R, w) {
|
|
169
169
|
var o = r.children;
|
|
170
170
|
if (o !== void 0)
|
|
171
171
|
if (a)
|
|
172
|
-
if (
|
|
172
|
+
if (te(o)) {
|
|
173
173
|
for (a = 0; a < o.length; a++)
|
|
174
|
-
|
|
174
|
+
x(o[a]);
|
|
175
175
|
Object.freeze && Object.freeze(o);
|
|
176
176
|
} else
|
|
177
177
|
console.error(
|
|
178
178
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
179
179
|
);
|
|
180
|
-
else
|
|
181
|
-
if (
|
|
180
|
+
else x(o);
|
|
181
|
+
if (Y.call(r, "key")) {
|
|
182
182
|
o = t(e);
|
|
183
|
-
var f = Object.keys(r).filter(function(
|
|
184
|
-
return
|
|
183
|
+
var f = Object.keys(r).filter(function(ne) {
|
|
184
|
+
return ne !== "key";
|
|
185
185
|
});
|
|
186
|
-
a = 0 < f.length ? "{key: someKey, " + f.join(": ..., ") + ": ...}" : "{key: someKey}",
|
|
186
|
+
a = 0 < f.length ? "{key: someKey, " + f.join(": ..., ") + ": ...}" : "{key: someKey}", D[o + a] || (f = 0 < f.length ? "{" + f.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
187
187
|
`A props object containing a "key" prop is being spread into JSX:
|
|
188
188
|
let props = %s;
|
|
189
189
|
<%s {...props} />
|
|
@@ -194,32 +194,32 @@ React keys must be passed directly to JSX without using spread:
|
|
|
194
194
|
o,
|
|
195
195
|
f,
|
|
196
196
|
o
|
|
197
|
-
),
|
|
197
|
+
), D[o + a] = !0);
|
|
198
198
|
}
|
|
199
|
-
if (o = null, n !== void 0 && (
|
|
199
|
+
if (o = null, n !== void 0 && (c(n), o = "" + n), d(r) && (c(r.key), o = "" + r.key), "key" in r) {
|
|
200
200
|
n = {};
|
|
201
|
-
for (var
|
|
202
|
-
|
|
201
|
+
for (var O in r)
|
|
202
|
+
O !== "key" && (n[O] = r[O]);
|
|
203
203
|
} else n = r;
|
|
204
204
|
return o && m(
|
|
205
205
|
n,
|
|
206
206
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
207
|
-
),
|
|
207
|
+
), J(
|
|
208
208
|
e,
|
|
209
209
|
o,
|
|
210
210
|
n,
|
|
211
|
-
|
|
211
|
+
u(),
|
|
212
212
|
R,
|
|
213
|
-
|
|
213
|
+
w
|
|
214
214
|
);
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
|
|
216
|
+
function x(e) {
|
|
217
|
+
C(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === h && (e._payload.status === "fulfilled" ? C(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
218
218
|
}
|
|
219
|
-
function
|
|
220
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
219
|
+
function C(e) {
|
|
220
|
+
return typeof e == "object" && e !== null && e.$$typeof === N;
|
|
221
221
|
}
|
|
222
|
-
var p =
|
|
222
|
+
var p = ae, N = /* @__PURE__ */ Symbol.for("react.transitional.element"), V = /* @__PURE__ */ Symbol.for("react.portal"), y = /* @__PURE__ */ Symbol.for("react.fragment"), z = /* @__PURE__ */ Symbol.for("react.strict_mode"), G = /* @__PURE__ */ Symbol.for("react.profiler"), X = /* @__PURE__ */ Symbol.for("react.consumer"), H = /* @__PURE__ */ Symbol.for("react.context"), B = /* @__PURE__ */ Symbol.for("react.forward_ref"), Z = /* @__PURE__ */ Symbol.for("react.suspense"), Q = /* @__PURE__ */ Symbol.for("react.suspense_list"), K = /* @__PURE__ */ Symbol.for("react.memo"), h = /* @__PURE__ */ Symbol.for("react.lazy"), ee = /* @__PURE__ */ Symbol.for("react.activity"), re = /* @__PURE__ */ Symbol.for("react.client.reference"), g = p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Y = Object.prototype.hasOwnProperty, te = Array.isArray, S = console.createTask ? console.createTask : function() {
|
|
223
223
|
return null;
|
|
224
224
|
};
|
|
225
225
|
p = {
|
|
@@ -227,63 +227,73 @@ React keys must be passed directly to JSX without using spread:
|
|
|
227
227
|
return e();
|
|
228
228
|
}
|
|
229
229
|
};
|
|
230
|
-
var
|
|
230
|
+
var $, F = {}, I = p.react_stack_bottom_frame.bind(
|
|
231
231
|
p,
|
|
232
|
-
|
|
233
|
-
)(),
|
|
234
|
-
_.Fragment =
|
|
235
|
-
var a = 1e4 >
|
|
236
|
-
return
|
|
232
|
+
i
|
|
233
|
+
)(), L = S(s(i)), D = {};
|
|
234
|
+
_.Fragment = y, _.jsx = function(e, r, n) {
|
|
235
|
+
var a = 1e4 > g.recentlyCreatedOwnerStacks++;
|
|
236
|
+
return j(
|
|
237
237
|
e,
|
|
238
238
|
r,
|
|
239
239
|
n,
|
|
240
240
|
!1,
|
|
241
|
-
a ? Error("react-stack-top-frame") :
|
|
242
|
-
a ?
|
|
241
|
+
a ? Error("react-stack-top-frame") : I,
|
|
242
|
+
a ? S(s(e)) : L
|
|
243
243
|
);
|
|
244
244
|
}, _.jsxs = function(e, r, n) {
|
|
245
|
-
var a = 1e4 >
|
|
246
|
-
return
|
|
245
|
+
var a = 1e4 > g.recentlyCreatedOwnerStacks++;
|
|
246
|
+
return j(
|
|
247
247
|
e,
|
|
248
248
|
r,
|
|
249
249
|
n,
|
|
250
250
|
!0,
|
|
251
|
-
a ? Error("react-stack-top-frame") :
|
|
252
|
-
a ?
|
|
251
|
+
a ? Error("react-stack-top-frame") : I,
|
|
252
|
+
a ? S(s(e)) : L
|
|
253
253
|
);
|
|
254
254
|
};
|
|
255
255
|
})()), _;
|
|
256
256
|
}
|
|
257
|
-
var
|
|
258
|
-
function
|
|
259
|
-
return
|
|
257
|
+
var U;
|
|
258
|
+
function ie() {
|
|
259
|
+
return U || (U = 1, process.env.NODE_ENV === "production" ? b.exports = se() : b.exports = ue()), b.exports;
|
|
260
260
|
}
|
|
261
|
-
var
|
|
262
|
-
let
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
}, v = null;
|
|
266
|
-
function
|
|
267
|
-
return typeof window > "u" ? Promise.reject("Cannot load script on server") :
|
|
261
|
+
var P = ie();
|
|
262
|
+
let k = {
|
|
263
|
+
done: !1,
|
|
264
|
+
registered: !1
|
|
265
|
+
}, v = !1, A = null, T = null;
|
|
266
|
+
function ce(t) {
|
|
267
|
+
return typeof window > "u" ? Promise.reject("Cannot load script on server") : T || (T = new Promise((l, c) => {
|
|
268
268
|
if (document.querySelector(`script[src="${t}"]`)) {
|
|
269
|
-
|
|
269
|
+
l();
|
|
270
270
|
return;
|
|
271
271
|
}
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
}),
|
|
272
|
+
const s = document.createElement("script");
|
|
273
|
+
s.src = t, s.async = !0, s.onload = () => l(), s.onerror = () => c(new Error(`Failed to load ${t}`)), document.head.appendChild(s);
|
|
274
|
+
}), T);
|
|
275
|
+
}
|
|
276
|
+
function fe(t) {
|
|
277
|
+
t.data.type === "euCaptchaCompleted" && (k.done = !0);
|
|
275
278
|
}
|
|
276
|
-
function
|
|
277
|
-
t = t || {}, typeof t.sitekey == "string" &&
|
|
278
|
-
|
|
279
|
-
}
|
|
280
|
-
console.
|
|
279
|
+
function de(t) {
|
|
280
|
+
t = t || {}, typeof t.sitekey == "string" && t.sitekey, typeof t.locale == "string" && t.locale, ce("https://cdn.eu-captcha.eu/verify.js").then(() => {
|
|
281
|
+
A && A(!0), k.registered || (k.registered = !0, window.addEventListener("message", fe, !1));
|
|
282
|
+
}).catch((l) => {
|
|
283
|
+
console.error("error during load of eu captcha library: " + l);
|
|
281
284
|
});
|
|
282
285
|
}
|
|
283
|
-
function
|
|
284
|
-
|
|
286
|
+
function Ee(t) {
|
|
287
|
+
if ([v, A] = oe(v), t && t.sitekey && de({
|
|
288
|
+
sitekey: t.sitekey
|
|
289
|
+
}), le(() => {
|
|
290
|
+
}, [v]), !v)
|
|
291
|
+
return /* @__PURE__ */ P.jsx(P.Fragment, { children: " " });
|
|
292
|
+
k.done = !1;
|
|
293
|
+
const l = t.theme ?? "light", c = window.getEuCaptchaElement(t.sitekey, l);
|
|
294
|
+
return /* @__PURE__ */ P.jsx("div", { dangerouslySetInnerHTML: { __html: c } });
|
|
285
295
|
}
|
|
286
296
|
export {
|
|
287
|
-
|
|
288
|
-
|
|
297
|
+
Ee as EuCaptcha,
|
|
298
|
+
de as loadEuCaptcha
|
|
289
299
|
};
|
package/dist/eu-captcha.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(f,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],d):(f=typeof globalThis<"u"?globalThis:f||self,d(f["@myra/eu-captcha"]={},f.React))})(this,(function(f,d){"use strict";var R={exports:{}},E={};var C;function z(){if(C)return E;C=1;var t=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function c(l,u,i){var p=null;if(i!==void 0&&(p=""+i),u.key!==void 0&&(p=""+u.key),"key"in u){i={};for(var b in u)b!=="key"&&(i[b]=u[b])}else i=u;return u=i.ref,{$$typeof:t,type:l,key:p,ref:u!==void 0?u:null,props:i}}return E.Fragment=s,E.jsx=c,E.jsxs=c,E}var _={};var N;function G(){return N||(N=1,process.env.NODE_ENV!=="production"&&(function(){function t(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ce?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case te:return"Profiler";case re:return"StrictMode";case se:return"Suspense";case le:return"SuspenseList";case ie:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case ee:return"Portal";case ae:return e.displayName||"Context";case ne:return(e._context.displayName||"Context")+".Consumer";case oe:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ue:return r=e.displayName||null,r!==null?r:t(e.type)||"Memo";case O:r=e._payload,e=e._init;try{return t(e(r))}catch{}}return null}function s(e){return""+e}function c(e){try{s(e);var r=!1}catch{r=!0}if(r){r=console;var n=r.error,a=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",a),s(e)}}function l(e){if(e===w)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===O)return"<...>";try{var r=t(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function u(){var e=P.A;return e===null?null:e.getOwner()}function i(){return Error("react-stack-top-frame")}function p(e){if($.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function b(e,r){function n(){W||(W=!0,console.error("%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://react.dev/link/special-props)",r))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function Q(){var e=t(this.type);return U[e]||(U[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function K(e,r,n,a,k,A){var o=n.ref;return e={$$typeof:D,type:e,key:r,props:n,_owner:a},(o!==void 0?o:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:Q}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:k}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:A}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function I(e,r,n,a,k,A){var o=r.children;if(o!==void 0)if(a)if(fe(o)){for(a=0;a<o.length;a++)L(o[a]);Object.freeze&&Object.freeze(o)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else L(o);if($.call(r,"key")){o=t(e);var m=Object.keys(r).filter(function(de){return de!=="key"});a=0<m.length?"{key: someKey, "+m.join(": ..., ")+": ...}":"{key: someKey}",q[o+a]||(m=0<m.length?"{"+m.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,a,o,
|
|
6
|
+
<%s key={someKey} {...props} />`,a,o,m,o),q[o+a]=!0)}if(o=null,n!==void 0&&(c(n),o=""+n),p(r)&&(c(r.key),o=""+r.key),"key"in r){n={};for(var x in r)x!=="key"&&(n[x]=r[x])}else n=r;return o&&b(n,typeof e=="function"?e.displayName||e.name||"Unknown":e),K(e,o,n,u(),k,A)}function L(e){M(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===O&&(e._payload.status==="fulfilled"?M(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function M(e){return typeof e=="object"&&e!==null&&e.$$typeof===D}var h=d,D=Symbol.for("react.transitional.element"),ee=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),re=Symbol.for("react.strict_mode"),te=Symbol.for("react.profiler"),ne=Symbol.for("react.consumer"),ae=Symbol.for("react.context"),oe=Symbol.for("react.forward_ref"),se=Symbol.for("react.suspense"),le=Symbol.for("react.suspense_list"),ue=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),ie=Symbol.for("react.activity"),ce=Symbol.for("react.client.reference"),P=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=Object.prototype.hasOwnProperty,fe=Array.isArray,j=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(e){return e()}};var W,U={},J=h.react_stack_bottom_frame.bind(h,i)(),V=j(l(i)),q={};_.Fragment=w,_.jsx=function(e,r,n){var a=1e4>P.recentlyCreatedOwnerStacks++;return I(e,r,n,!1,a?Error("react-stack-top-frame"):J,a?j(l(e)):V)},_.jsxs=function(e,r,n){var a=1e4>P.recentlyCreatedOwnerStacks++;return I(e,r,n,!0,a?Error("react-stack-top-frame"):J,a?j(l(e)):V)}})()),_}var Y;function X(){return Y||(Y=1,process.env.NODE_ENV==="production"?R.exports=z():R.exports=G()),R.exports}var S=X();let v={done:!1,registered:!1},T=!1,g=null,y=null;function H(t){return typeof window>"u"?Promise.reject("Cannot load script on server"):y||(y=new Promise((s,c)=>{if(document.querySelector(`script[src="${t}"]`)){s();return}const l=document.createElement("script");l.src=t,l.async=!0,l.onload=()=>s(),l.onerror=()=>c(new Error(`Failed to load ${t}`)),document.head.appendChild(l)}),y)}function B(t){t.data.type==="euCaptchaCompleted"&&(v.done=!0)}function F(t){t=t||{},typeof t.sitekey=="string"&&t.sitekey,typeof t.locale=="string"&&t.locale,H("https://cdn.eu-captcha.eu/verify.js").then(()=>{g&&g(!0),v.registered||(v.registered=!0,window.addEventListener("message",B,!1))}).catch(s=>{console.error("error during load of eu captcha library: "+s)})}function Z(t){if([T,g]=d.useState(T),t&&t.sitekey&&F({sitekey:t.sitekey}),d.useEffect(()=>{},[T]),!T)return S.jsx(S.Fragment,{children:" "});v.done=!1;const s=t.theme??"light",c=window.getEuCaptchaElement(t.sitekey,s);return S.jsx("div",{dangerouslySetInnerHTML:{__html:c}})}f.EuCaptcha=Z,f.loadEuCaptcha=F,Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED