@myrasec/eu-captcha 0.0.15 → 0.0.16
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/eu-captcha.js +23 -23
- package/dist/eu-captcha.umd.cjs +2 -2
- package/package.json +1 -1
package/dist/eu-captcha.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import oe, { useState as ie, useEffect as
|
|
1
|
+
import oe, { useState as ie, useEffect as W } from "react";
|
|
2
2
|
var T = { exports: {} }, _ = {};
|
|
3
3
|
var q;
|
|
4
4
|
function le() {
|
|
@@ -132,7 +132,7 @@ function ue() {
|
|
|
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 m(e, t, n, a, h,
|
|
135
|
+
function m(e, t, n, a, h, A) {
|
|
136
136
|
var o = n.ref;
|
|
137
137
|
return e = {
|
|
138
138
|
$$typeof: Y,
|
|
@@ -162,10 +162,10 @@ function ue() {
|
|
|
162
162
|
configurable: !1,
|
|
163
163
|
enumerable: !1,
|
|
164
164
|
writable: !0,
|
|
165
|
-
value:
|
|
165
|
+
value: A
|
|
166
166
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
167
167
|
}
|
|
168
|
-
function j(e, t, n, a, h,
|
|
168
|
+
function j(e, t, n, a, h, A) {
|
|
169
169
|
var o = t.children;
|
|
170
170
|
if (o !== void 0)
|
|
171
171
|
if (a)
|
|
@@ -183,7 +183,7 @@ function ue() {
|
|
|
183
183
|
var E = Object.keys(t).filter(function(ae) {
|
|
184
184
|
return ae !== "key";
|
|
185
185
|
});
|
|
186
|
-
a = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}",
|
|
186
|
+
a = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}", U[o + a] || (E = 0 < E.length ? "{" + E.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,12 +194,12 @@ React keys must be passed directly to JSX without using spread:
|
|
|
194
194
|
o,
|
|
195
195
|
E,
|
|
196
196
|
o
|
|
197
|
-
),
|
|
197
|
+
), U[o + a] = !0);
|
|
198
198
|
}
|
|
199
199
|
if (o = null, n !== void 0 && (c(n), o = "" + n), d(t) && (c(t.key), o = "" + t.key), "key" in t) {
|
|
200
200
|
n = {};
|
|
201
|
-
for (var
|
|
202
|
-
|
|
201
|
+
for (var C in t)
|
|
202
|
+
C !== "key" && (n[C] = t[C]);
|
|
203
203
|
} else n = t;
|
|
204
204
|
return o && f(
|
|
205
205
|
n,
|
|
@@ -210,7 +210,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
210
210
|
n,
|
|
211
211
|
l(),
|
|
212
212
|
h,
|
|
213
|
-
|
|
213
|
+
A
|
|
214
214
|
);
|
|
215
215
|
}
|
|
216
216
|
function N(e) {
|
|
@@ -230,7 +230,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
230
230
|
var L, F = {}, D = b.react_stack_bottom_frame.bind(
|
|
231
231
|
b,
|
|
232
232
|
u
|
|
233
|
-
)(), M = x(i(u)),
|
|
233
|
+
)(), M = x(i(u)), U = {};
|
|
234
234
|
v.Fragment = k, v.jsx = function(e, t, n) {
|
|
235
235
|
var a = 1e4 > S.recentlyCreatedOwnerStacks++;
|
|
236
236
|
return j(
|
|
@@ -258,20 +258,20 @@ var V;
|
|
|
258
258
|
function se() {
|
|
259
259
|
return V || (V = 1, process.env.NODE_ENV === "production" ? T.exports = le() : T.exports = ue()), T.exports;
|
|
260
260
|
}
|
|
261
|
-
var
|
|
261
|
+
var O = se();
|
|
262
262
|
let R = {
|
|
263
263
|
done: !1,
|
|
264
264
|
registered: !1
|
|
265
|
-
},
|
|
265
|
+
}, w = !1, P = null, g = null;
|
|
266
266
|
function ce(r) {
|
|
267
|
-
return typeof window > "u" ? Promise.reject("Cannot load script on server") :
|
|
267
|
+
return typeof window > "u" ? Promise.reject("Cannot load script on server") : g || (g = new Promise((s, c) => {
|
|
268
268
|
if (document.querySelector(`script[src="${r}"]`)) {
|
|
269
269
|
s();
|
|
270
270
|
return;
|
|
271
271
|
}
|
|
272
272
|
const i = document.createElement("script");
|
|
273
273
|
i.src = r, i.async = !0, i.onload = () => s(), i.onerror = () => c(new Error(`Failed to load ${r}`)), document.head.appendChild(i);
|
|
274
|
-
}),
|
|
274
|
+
}), g);
|
|
275
275
|
}
|
|
276
276
|
function fe(r) {
|
|
277
277
|
r.data.type === "euCaptchaCompleted" && (R.done = !0);
|
|
@@ -280,28 +280,28 @@ function Ee() {
|
|
|
280
280
|
return R.done;
|
|
281
281
|
}
|
|
282
282
|
function de(r) {
|
|
283
|
-
r = r || {}, typeof r.sitekey == "string" && r.sitekey, typeof r.locale == "string" && r.locale, ce("https://cdn.eu-captcha.eu/verify.js").then(() => {
|
|
284
|
-
|
|
283
|
+
r = r || {}, typeof r.sitekey == "string" && r.sitekey, typeof r.locale == "string" && r.locale, window.euCaptchaNoAutoInit = !0, ce("https://cdn.eu-captcha.eu/verify.js").then(() => {
|
|
284
|
+
P && P(!0), R.registered || (R.registered = !0, window.addEventListener("message", fe, !1));
|
|
285
285
|
}).catch((s) => {
|
|
286
|
-
console.error("
|
|
286
|
+
console.error("EU CAPTCHA: failed to load library: " + s);
|
|
287
287
|
});
|
|
288
288
|
}
|
|
289
289
|
function _e(r) {
|
|
290
|
-
if ([
|
|
290
|
+
if ([w, P] = ie(w), r && r.sitekey && de({
|
|
291
291
|
sitekey: r.sitekey
|
|
292
|
-
}),
|
|
293
|
-
}, [
|
|
292
|
+
}), W(() => {
|
|
293
|
+
}, [w]), W(() => {
|
|
294
294
|
if (!r.onComplete && !r.onExpired && !r.onError) return;
|
|
295
295
|
function f(y) {
|
|
296
296
|
const m = y.data ?? {};
|
|
297
297
|
r.widgetId && m.widgetId !== r.widgetId || (m.type === "euCaptchaCompleted" && r.onComplete && r.onComplete(m.payload ?? ""), m.type === "euCaptchaExpired" && r.onExpired && r.onExpired(), m.type === "euCaptchaError" && r.onError && r.onError());
|
|
298
298
|
}
|
|
299
299
|
return window.addEventListener("message", f, !1), () => window.removeEventListener("message", f, !1);
|
|
300
|
-
}, [r.onComplete, r.onExpired, r.onError, r.widgetId]), !
|
|
301
|
-
return /* @__PURE__ */
|
|
300
|
+
}, [r.onComplete, r.onExpired, r.onError, r.widgetId]), !w)
|
|
301
|
+
return /* @__PURE__ */ O.jsx(O.Fragment, { children: " " });
|
|
302
302
|
R.done = !1;
|
|
303
303
|
const s = r.theme ?? "light", c = r.width ?? 330, i = r.height ?? 100, l = r.widgetId, u = r.autostart ?? !0, d = window.getEuCaptchaElement(r.sitekey, { theme: s, width: c, height: i, widgetId: l, autostart: u });
|
|
304
|
-
return /* @__PURE__ */
|
|
304
|
+
return /* @__PURE__ */ O.jsx("div", { dangerouslySetInnerHTML: { __html: d } });
|
|
305
305
|
}
|
|
306
306
|
export {
|
|
307
307
|
_e as EuCaptcha,
|
package/dist/eu-captcha.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(c,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],d):(c=typeof globalThis<"u"?globalThis:c||self,d(c["@myra/eu-captcha"]={},c.React))})(this,(function(c,d){"use strict";var T={exports:{}},b={};var I;function X(){if(I)return b;I=1;var r=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function f(i,u,l){var E=null;if(l!==void 0&&(E=""+l),u.key!==void 0&&(E=""+u.key),"key"in u){l={};for(var m in u)m!=="key"&&(l[m]=u[m])}else l=u;return u=l.ref,{$$typeof:r,type:i,key:E,ref:u!==void 0?u:null,props:l}}return b.Fragment=s,b.jsx=f,b.jsxs=f,b}var R={};var Y;function H(){return Y||(Y=1,process.env.NODE_ENV!=="production"&&(function(){function r(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===fe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case
|
|
1
|
+
(function(c,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],d):(c=typeof globalThis<"u"?globalThis:c||self,d(c["@myra/eu-captcha"]={},c.React))})(this,(function(c,d){"use strict";var T={exports:{}},b={};var I;function X(){if(I)return b;I=1;var r=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function f(i,u,l){var E=null;if(l!==void 0&&(E=""+l),u.key!==void 0&&(E=""+u.key),"key"in u){l={};for(var m in u)m!=="key"&&(l[m]=u[m])}else l=u;return u=l.ref,{$$typeof:r,type:i,key:E,ref:u!==void 0?u:null,props:l}}return b.Fragment=s,b.jsx=f,b.jsxs=f,b}var R={};var Y;function H(){return Y||(Y=1,process.env.NODE_ENV!=="production"&&(function(){function r(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===fe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case A:return"Fragment";case ne:return"Profiler";case te:return"StrictMode";case ue:return"Suspense";case le:return"SuspenseList";case ce: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 re:return"Portal";case oe:return e.displayName||"Context";case ae:return(e._context.displayName||"Context")+".Consumer";case ie:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case se:return t=e.displayName||null,t!==null?t:r(e.type)||"Memo";case O:t=e._payload,e=e._init;try{return r(e(t))}catch{}}return null}function s(e){return""+e}function f(e){try{s(e);var t=!1}catch{t=!0}if(t){t=console;var n=t.error,a=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",a),s(e)}}function i(e){if(e===A)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===O)return"<...>";try{var t=r(e);return t?"<"+t+">":"<...>"}catch{return"<...>"}}function u(){var e=P.A;return e===null?null:e.getOwner()}function l(){return Error("react-stack-top-frame")}function E(e){if($.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function m(e,t){function n(){J||(J=!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)",t))}n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}function C(){var e=r(this.type);return V[e]||(V[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 _(e,t,n,a,p,j){var o=n.ref;return e={$$typeof:W,type:e,key:t,props:n,_owner:a},(o!==void 0?o:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:C}):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:p}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:j}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function D(e,t,n,a,p,j){var o=t.children;if(o!==void 0)if(a)if(de(o)){for(a=0;a<o.length;a++)M(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 M(o);if($.call(t,"key")){o=r(e);var v=Object.keys(t).filter(function(me){return me!=="key"});a=0<v.length?"{key: someKey, "+v.join(": ..., ")+": ...}":"{key: someKey}",G[o+a]||(v=0<v.length?"{"+v.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,v,o),G[o+a]=!0)}if(o=null,n!==void 0&&(f(n),o=""+n),E(t)&&(f(t.key),o=""+t.key),"key"in t){n={};for(var N in t)N!=="key"&&(n[N]=t[N])}else n=t;return o&&m(n,typeof e=="function"?e.displayName||e.name||"Unknown":e),_(e,o,n,u(),p,
|
|
6
|
+
<%s key={someKey} {...props} />`,a,o,v,o),G[o+a]=!0)}if(o=null,n!==void 0&&(f(n),o=""+n),E(t)&&(f(t.key),o=""+t.key),"key"in t){n={};for(var N in t)N!=="key"&&(n[N]=t[N])}else n=t;return o&&m(n,typeof e=="function"?e.displayName||e.name||"Unknown":e),_(e,o,n,u(),p,j)}function M(e){U(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===O&&(e._payload.status==="fulfilled"?U(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function U(e){return typeof e=="object"&&e!==null&&e.$$typeof===W}var g=d,W=Symbol.for("react.transitional.element"),re=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),te=Symbol.for("react.strict_mode"),ne=Symbol.for("react.profiler"),ae=Symbol.for("react.consumer"),oe=Symbol.for("react.context"),ie=Symbol.for("react.forward_ref"),ue=Symbol.for("react.suspense"),le=Symbol.for("react.suspense_list"),se=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),ce=Symbol.for("react.activity"),fe=Symbol.for("react.client.reference"),P=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=Object.prototype.hasOwnProperty,de=Array.isArray,x=console.createTask?console.createTask:function(){return null};g={react_stack_bottom_frame:function(e){return e()}};var J,V={},z=g.react_stack_bottom_frame.bind(g,l)(),q=x(i(l)),G={};R.Fragment=A,R.jsx=function(e,t,n){var a=1e4>P.recentlyCreatedOwnerStacks++;return D(e,t,n,!1,a?Error("react-stack-top-frame"):z,a?x(i(e)):q)},R.jsxs=function(e,t,n){var a=1e4>P.recentlyCreatedOwnerStacks++;return D(e,t,n,!0,a?Error("react-stack-top-frame"):z,a?x(i(e)):q)}})()),R}var L;function B(){return L||(L=1,process.env.NODE_ENV==="production"?T.exports=X():T.exports=H()),T.exports}var k=B();let h={done:!1,registered:!1},y=!1,S=null,w=null;function Z(r){return typeof window>"u"?Promise.reject("Cannot load script on server"):w||(w=new Promise((s,f)=>{if(document.querySelector(`script[src="${r}"]`)){s();return}const i=document.createElement("script");i.src=r,i.async=!0,i.onload=()=>s(),i.onerror=()=>f(new Error(`Failed to load ${r}`)),document.head.appendChild(i)}),w)}function Q(r){r.data.type==="euCaptchaCompleted"&&(h.done=!0)}function K(){return h.done}function F(r){r=r||{},typeof r.sitekey=="string"&&r.sitekey,typeof r.locale=="string"&&r.locale,window.euCaptchaNoAutoInit=!0,Z("https://cdn.eu-captcha.eu/verify.js").then(()=>{S&&S(!0),h.registered||(h.registered=!0,window.addEventListener("message",Q,!1))}).catch(s=>{console.error("EU CAPTCHA: failed to load library: "+s)})}function ee(r){if([y,S]=d.useState(y),r&&r.sitekey&&F({sitekey:r.sitekey}),d.useEffect(()=>{},[y]),d.useEffect(()=>{if(!r.onComplete&&!r.onExpired&&!r.onError)return;function m(C){const _=C.data??{};r.widgetId&&_.widgetId!==r.widgetId||(_.type==="euCaptchaCompleted"&&r.onComplete&&r.onComplete(_.payload??""),_.type==="euCaptchaExpired"&&r.onExpired&&r.onExpired(),_.type==="euCaptchaError"&&r.onError&&r.onError())}return window.addEventListener("message",m,!1),()=>window.removeEventListener("message",m,!1)},[r.onComplete,r.onExpired,r.onError,r.widgetId]),!y)return k.jsx(k.Fragment,{children:" "});h.done=!1;const s=r.theme??"light",f=r.width??330,i=r.height??100,u=r.widgetId,l=r.autostart??!0,E=window.getEuCaptchaElement(r.sitekey,{theme:s,width:f,height:i,widgetId:u,autostart:l});return k.jsx("div",{dangerouslySetInnerHTML:{__html:E}})}c.EuCaptcha=ee,c.isEuCaptchaDone=K,c.loadEuCaptcha=F,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})}));
|