@prosopo/procaptcha-bundle 4.1.40 → 4.1.41
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/.turbo/turbo-build$colon$cjs.log +20 -16
- package/.turbo/turbo-build$colon$tsc.log +27 -27
- package/.turbo/turbo-build.log +19 -16
- package/CHANGELOG.md +19 -0
- package/dist/_virtual/_rolldown/runtime.js +3 -0
- package/dist/cjs/_virtual/_rolldown/runtime.cjs +23 -0
- package/dist/cjs/index.cjs +128 -166
- package/dist/cjs/util/captcha/captchaRenderer.cjs +48 -69
- package/dist/cjs/util/captcha/components/bundleCaptcha.cjs +19 -23
- package/dist/cjs/util/config.cjs +21 -22
- package/dist/cjs/util/configCreator.cjs +17 -21
- package/dist/cjs/util/language.cjs +29 -21
- package/dist/cjs/util/timeout.cjs +15 -12
- package/dist/cjs/util/widgetFactory.cjs +56 -90
- package/dist/cjs/util/widgetThemeResolver.cjs +15 -15
- package/dist/index.js +123 -167
- package/dist/util/captcha/captchaRenderer.js +44 -66
- package/dist/util/captcha/components/bundleCaptcha.js +17 -21
- package/dist/util/config.js +22 -24
- package/dist/util/configCreator.js +18 -22
- package/dist/util/language.js +29 -22
- package/dist/util/timeout.js +16 -13
- package/dist/util/widgetFactory.js +55 -89
- package/dist/util/widgetThemeResolver.js +15 -15
- package/package.json +11 -11
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/procaptcha-bundle@4.1.
|
|
2
|
+
> @prosopo/procaptcha-bundle@4.1.41 build:cjs
|
|
3
3
|
> NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
|
|
4
4
|
|
|
5
5
|
ViteCommonJSConfig: .
|
|
@@ -55,20 +55,24 @@ ViteCommonJSConfig: .
|
|
|
55
55
|
'@prosopo/datasets'
|
|
56
56
|
]
|
|
57
57
|
}
|
|
58
|
-
[
|
|
58
|
+
[33mThe plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the [1mresolve.tsconfigPaths[22m option. You can remove the plugin and set [1mresolve.tsconfigPaths: true[22m in your Vite config instead.[39m
|
|
59
|
+
[36mvite v8.1.5 [32mbuilding ssr environment for production...[36m[39m
|
|
59
60
|
Bundle build started
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
[32m✓[39m 9 modules transformed.
|
|
63
|
-
[33mEntry module "src/index.ts" is using named and default exports together. Consumers of your bundle will have to use `..default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.[39m
|
|
61
|
+
[2K
|
|
62
|
+
✓ 10 modules transformed.
|
|
64
63
|
rendering chunks...
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
computing gzip size...
|
|
65
|
+
dist/cjs/util/widgetThemeResolver.cjs 0.57 kB │ gzip: 0.29 kB
|
|
66
|
+
dist/cjs/util/timeout.cjs 0.63 kB │ gzip: 0.29 kB
|
|
67
|
+
dist/cjs/util/config.cjs 0.66 kB │ gzip: 0.33 kB
|
|
68
|
+
dist/cjs/util/captcha/components/bundleCaptcha.cjs 0.82 kB │ gzip: 0.39 kB
|
|
69
|
+
dist/cjs/util/configCreator.cjs 0.88 kB │ gzip: 0.46 kB
|
|
70
|
+
dist/cjs/_virtual/_rolldown/runtime.cjs 1.00 kB │ gzip: 0.50 kB
|
|
71
|
+
dist/cjs/util/language.cjs 1.08 kB │ gzip: 0.45 kB
|
|
72
|
+
dist/cjs/util/captcha/captchaRenderer.cjs 2.26 kB │ gzip: 0.78 kB
|
|
73
|
+
dist/cjs/util/widgetFactory.cjs 2.73 kB │ gzip: 0.89 kB
|
|
74
|
+
dist/cjs/index.cjs 5.35 kB │ gzip: 1.66 kB
|
|
75
|
+
|
|
76
|
+
[33m[33m[MIXED_EXPORTS] [0mEntry module "src/index.ts" is using named (including "default", "execute", "render", "reset") and default exports together. Consumers of your bundle will have to use `..default` to access the default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
|
|
77
|
+
[39m
|
|
78
|
+
[32m✓ built in 59ms[39m
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/procaptcha-bundle@4.1.
|
|
2
|
+
> @prosopo/procaptcha-bundle@4.1.41 build:tsc
|
|
3
3
|
> tsc --build --verbose
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
8:59:49 PM - Projects in this build:
|
|
6
6
|
* ../../dev/config/tsconfig.json
|
|
7
7
|
* ../util/tsconfig.json
|
|
8
8
|
* ../logger/tsconfig.json
|
|
@@ -28,53 +28,53 @@
|
|
|
28
28
|
* ../procaptcha-frictionless/tsconfig.json
|
|
29
29
|
* tsconfig.json
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
8:59:49 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/webpack.config.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
8:59:49 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
8:59:49 PM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/index.ts' is older than output '../logger/tsconfig.tsbuildinfo'
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
8:59:49 PM - Project '../dotenv/tsconfig.json' is up to date because newest input '../dotenv/src/env.ts' is older than output '../dotenv/tsconfig.tsbuildinfo'
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
8:59:49 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
8:59:49 PM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/tsconfig.tsbuildinfo'
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
8:59:49 PM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/provider/api.ts' is older than output '../types/tsconfig.tsbuildinfo'
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
8:59:49 PM - Project '../detector/tsconfig.json' is up to date because newest input '../detector/src/index.js' is older than output '../detector/tsconfig.tsbuildinfo'
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
8:59:49 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
8:59:49 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/tests/utils/batches.unit.test.ts' is older than output '../common/tsconfig.tsbuildinfo'
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
8:59:49 PM - Project '../fingerprintjs/tsconfig.json' is up to date because newest input '../fingerprintjs/src/utils/browser.ts' is older than output '../fingerprintjs/tsconfig.tsbuildinfo'
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
8:59:49 PM - Project '../fingerprint/tsconfig.json' is up to date because newest input '../fingerprint/src/index.ts' is older than output '../fingerprint/tsconfig.tsbuildinfo'
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
8:59:49 PM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/tests/providers.unit.test.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
8:59:49 PM - Project '../widget-skeleton/tsconfig.json' is up to date because newest input '../widget-skeleton/src/index.ts' is older than output '../widget-skeleton/tsconfig.tsbuildinfo'
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
8:59:49 PM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/keyring/keyring.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
8:59:49 PM - Project '../account/tsconfig.json' is up to date because newest input '../account/src/tests/cryptoWorker.unit.test.ts' is older than output '../account/tsconfig.tsbuildinfo'
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
8:59:50 PM - Project '../procaptcha-common/tsconfig.json' is up to date because newest input '../procaptcha-common/src/tests/defaultEvents.test.ts' is older than output '../procaptcha-common/tsconfig.tsbuildinfo'
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
8:59:50 PM - Project '../procaptcha-pow/tsconfig.json' is up to date because newest input '../procaptcha-pow/src/index.ts' is older than output '../procaptcha-pow/tsconfig.tsbuildinfo'
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
8:59:50 PM - Project '../procaptcha-puzzle/tsconfig.json' is up to date because newest input '../procaptcha-puzzle/src/index.ts' is older than output '../procaptcha-puzzle/tsconfig.tsbuildinfo'
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
8:59:50 PM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/tests/mocks/data/captchas.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
8:59:50 PM - Project '../procaptcha/tsconfig.json' is up to date because newest input '../procaptcha/src/modules/Manager.ts' is older than output '../procaptcha/tsconfig.tsbuildinfo'
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
8:59:50 PM - Project '../procaptcha-react/tsconfig.json' is up to date because newest input '../procaptcha-react/src/index.ts' is older than output '../procaptcha-react/tsconfig.tsbuildinfo'
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
8:59:50 PM - Project '../procaptcha-frictionless/tsconfig.json' is up to date because newest input '../procaptcha-frictionless/src/customDetectBot.ts' is older than output '../procaptcha-frictionless/tsconfig.tsbuildinfo'
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
8:59:50 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
8:59:50 PM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha-bundle/tsconfig.json'...
|
|
80
80
|
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/procaptcha-bundle@4.1.
|
|
2
|
+
> @prosopo/procaptcha-bundle@4.1.41 build
|
|
3
3
|
> npm run build:cross-env -- --mode ${NODE_ENV:-development}
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @prosopo/procaptcha-bundle@4.1.
|
|
6
|
+
> @prosopo/procaptcha-bundle@4.1.41 build:cross-env
|
|
7
7
|
> vite build --config vite.esm.config.ts --mode production
|
|
8
8
|
|
|
9
9
|
ViteEsmConfig: .
|
|
@@ -59,19 +59,22 @@ ViteEsmConfig: .
|
|
|
59
59
|
'@prosopo/datasets'
|
|
60
60
|
]
|
|
61
61
|
}
|
|
62
|
-
[
|
|
62
|
+
[33mThe plugin "vite-tsconfig-paths" is detected. Vite now supports tsconfig paths resolution natively via the [1mresolve.tsconfigPaths[22m option. You can remove the plugin and set [1mresolve.tsconfigPaths: true[22m in your Vite config instead.[39m
|
|
63
|
+
[36mvite v8.1.5 [32mbuilding ssr environment for production...[36m[39m
|
|
63
64
|
Bundle build started
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
[32m✓[39m 9 modules transformed.
|
|
65
|
+
[2K
|
|
66
|
+
✓ 10 modules transformed.
|
|
67
67
|
rendering chunks...
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
68
|
+
computing gzip size...
|
|
69
|
+
dist/_virtual/_rolldown/runtime.js 0.04 kB │ gzip: 0.06 kB
|
|
70
|
+
dist/util/widgetThemeResolver.js 0.55 kB │ gzip: 0.29 kB
|
|
71
|
+
dist/util/timeout.js 0.61 kB │ gzip: 0.29 kB
|
|
72
|
+
dist/util/config.js 0.62 kB │ gzip: 0.33 kB
|
|
73
|
+
dist/util/captcha/components/bundleCaptcha.js 0.68 kB │ gzip: 0.35 kB
|
|
74
|
+
dist/util/configCreator.js 0.86 kB │ gzip: 0.45 kB
|
|
75
|
+
dist/util/language.js 1.01 kB │ gzip: 0.44 kB
|
|
76
|
+
dist/util/captcha/captchaRenderer.js 1.93 kB │ gzip: 0.70 kB
|
|
77
|
+
dist/util/widgetFactory.js 2.52 kB │ gzip: 0.85 kB
|
|
78
|
+
dist/index.js 5.03 kB │ gzip: 1.58 kB
|
|
79
|
+
|
|
80
|
+
[32m✓ built in 59ms[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @prosopo/procaptcha-bundle
|
|
2
2
|
|
|
3
|
+
## 4.1.41
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- e14fce6: chore(deps): bump vite to 6.4.3 and mongoose to 8.24.1, and adjust types for the mongoose 8.24 Document/ObjectId changes
|
|
7
|
+
- Updated dependencies [2c47bb7]
|
|
8
|
+
- Updated dependencies [ab3499c]
|
|
9
|
+
- Updated dependencies [0e1171c]
|
|
10
|
+
- Updated dependencies [103318c]
|
|
11
|
+
- Updated dependencies [4cd9035]
|
|
12
|
+
- Updated dependencies [8fba211]
|
|
13
|
+
- Updated dependencies [270a8d8]
|
|
14
|
+
- Updated dependencies [e14fce6]
|
|
15
|
+
- @prosopo/util@3.3.5
|
|
16
|
+
- @prosopo/procaptcha-common@2.11.18
|
|
17
|
+
- @prosopo/locale@3.2.8
|
|
18
|
+
- @prosopo/types@4.10.0
|
|
19
|
+
- @prosopo/dotenv@3.0.50
|
|
20
|
+
- @prosopo/procaptcha-frictionless@2.12.22
|
|
21
|
+
|
|
3
22
|
## 4.1.40
|
|
4
23
|
### Patch Changes
|
|
5
24
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.__toESM = __toESM;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,181 +1,143 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
ipv6
|
|
54
|
-
},
|
|
55
|
-
true,
|
|
56
|
-
true
|
|
57
|
-
);
|
|
58
|
-
procaptchaRoots.push(...root);
|
|
59
|
-
button.addEventListener("click", async (event) => {
|
|
60
|
-
event.preventDefault();
|
|
61
|
-
execute();
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
}
|
|
1
|
+
Object.defineProperties(exports, {
|
|
2
|
+
__esModule: { value: true },
|
|
3
|
+
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
+
});
|
|
5
|
+
const require_config = require("./util/config.cjs");
|
|
6
|
+
const require_widgetFactory = require("./util/widgetFactory.cjs");
|
|
7
|
+
const require_widgetThemeResolver = require("./util/widgetThemeResolver.cjs");
|
|
8
|
+
let _prosopo_procaptcha_common = require("@prosopo/procaptcha-common");
|
|
9
|
+
let _prosopo_util = require("@prosopo/util");
|
|
10
|
+
//#region src/index.ts
|
|
11
|
+
var BUNDLE_NAMES = ["procaptcha.bundle.iife.js", "procaptcha.bundle.js"];
|
|
12
|
+
var procaptchaRoots = [];
|
|
13
|
+
var widgetFactory = new require_widgetFactory.WidgetFactory(new require_widgetThemeResolver.WidgetThemeResolver());
|
|
14
|
+
var PROCAPTCHA_EXECUTE_EVENT = "procaptcha:execute";
|
|
15
|
+
var PROCAPTCHA_READY_EVENT = "procaptcha:ready";
|
|
16
|
+
var implicitRender = async () => {
|
|
17
|
+
const elements = Array.from(document.getElementsByClassName("procaptcha")).filter((element) => element.tagName.toLowerCase() !== "button");
|
|
18
|
+
if (elements.length) {
|
|
19
|
+
const firstElement = (0, _prosopo_util.at)(elements, 0);
|
|
20
|
+
const siteKey = firstElement.getAttribute("data-sitekey");
|
|
21
|
+
const web3 = firstElement.getAttribute("data-web3");
|
|
22
|
+
const ipv4 = firstElement.getAttribute("data-ipv4") === "true";
|
|
23
|
+
const ipv6 = firstElement.getAttribute("data-ipv6") === "true";
|
|
24
|
+
if (!siteKey) {
|
|
25
|
+
console.error("No site key found");
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const root = await widgetFactory.createWidgets(elements, {
|
|
29
|
+
siteKey,
|
|
30
|
+
ipv4,
|
|
31
|
+
ipv6
|
|
32
|
+
}, !(web3 === "true"));
|
|
33
|
+
procaptchaRoots.push(...root);
|
|
34
|
+
}
|
|
35
|
+
const invisibleButtons = Array.from(document.getElementsByClassName("procaptcha")).filter((button) => button.tagName.toLowerCase() === "button");
|
|
36
|
+
if (invisibleButtons.length) for (const button of invisibleButtons) {
|
|
37
|
+
const siteKey = button.getAttribute("data-sitekey") || "";
|
|
38
|
+
const callback = button.getAttribute("data-callback") || "";
|
|
39
|
+
const ipv4 = button.getAttribute("data-ipv4") === "true";
|
|
40
|
+
const ipv6 = button.getAttribute("data-ipv6") === "true";
|
|
41
|
+
const root = await widgetFactory.createWidgets([button], {
|
|
42
|
+
siteKey,
|
|
43
|
+
callback,
|
|
44
|
+
ipv4,
|
|
45
|
+
ipv6
|
|
46
|
+
}, true, true);
|
|
47
|
+
procaptchaRoots.push(...root);
|
|
48
|
+
button.addEventListener("click", async (event) => {
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
execute();
|
|
51
|
+
});
|
|
52
|
+
}
|
|
65
53
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
procaptchaRoots.push(...roots2);
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
const roots = await widgetFactory.createWidgets(
|
|
80
|
-
[element],
|
|
81
|
-
renderOptions,
|
|
82
|
-
isWeb2,
|
|
83
|
-
false
|
|
84
|
-
);
|
|
85
|
-
procaptchaRoots.push(...roots);
|
|
54
|
+
var render = async (element, renderOptions) => {
|
|
55
|
+
const hasInvisibleSize = Object.prototype.hasOwnProperty.call(renderOptions, "size") && renderOptions.size === "invisible";
|
|
56
|
+
const isWeb2 = !renderOptions.web3;
|
|
57
|
+
if (hasInvisibleSize || element.tagName.toLowerCase() === "button") {
|
|
58
|
+
const roots = await widgetFactory.createWidgets([element], renderOptions, isWeb2, true);
|
|
59
|
+
procaptchaRoots.push(...roots);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const roots = await widgetFactory.createWidgets([element], renderOptions, isWeb2, false);
|
|
63
|
+
procaptchaRoots.push(...roots);
|
|
86
64
|
};
|
|
87
65
|
function ready(fn) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
66
|
+
if (document && document.readyState !== "loading") {
|
|
67
|
+
console.log("document.readyState ready!");
|
|
68
|
+
fn();
|
|
69
|
+
} else {
|
|
70
|
+
console.log("DOMContentLoaded listener!");
|
|
71
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
72
|
+
console.log("DOMContentLoaded fired");
|
|
73
|
+
console.log(window);
|
|
74
|
+
fn();
|
|
75
|
+
});
|
|
76
|
+
}
|
|
99
77
|
}
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
78
|
+
var execute = () => {
|
|
79
|
+
const containers = findProcaptchaContainers();
|
|
80
|
+
if (containers.length === 0) {
|
|
81
|
+
console.error("No Procaptcha containers found for execution");
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const executeEvent = new CustomEvent(PROCAPTCHA_EXECUTE_EVENT, {
|
|
85
|
+
detail: {
|
|
86
|
+
containerId: containers[0]?.id || "procaptcha-container",
|
|
87
|
+
containerCount: containers.length,
|
|
88
|
+
timestamp: Date.now()
|
|
89
|
+
},
|
|
90
|
+
bubbles: true,
|
|
91
|
+
cancelable: true
|
|
92
|
+
});
|
|
93
|
+
document.dispatchEvent(executeEvent);
|
|
116
94
|
};
|
|
117
95
|
function findProcaptchaContainers() {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
)
|
|
127
|
-
);
|
|
128
|
-
const classContainers = Array.from(
|
|
129
|
-
document.getElementsByClassName("p-procaptcha")
|
|
130
|
-
);
|
|
131
|
-
containers.push(...classContainers);
|
|
132
|
-
for (const container of idContainers) {
|
|
133
|
-
if (!containers.includes(container)) {
|
|
134
|
-
containers.push(container);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return containers;
|
|
96
|
+
const containers = [];
|
|
97
|
+
const invisibleContainers = Array.from(document.querySelectorAll("[data-size=\"invisible\"]"));
|
|
98
|
+
containers.push(...invisibleContainers);
|
|
99
|
+
const idContainers = Array.from(document.querySelectorAll("#procaptcha-container, [id$=\"-procaptcha-container\"]"));
|
|
100
|
+
const classContainers = Array.from(document.getElementsByClassName("p-procaptcha"));
|
|
101
|
+
containers.push(...classContainers);
|
|
102
|
+
for (const container of idContainers) if (!containers.includes(container)) containers.push(container);
|
|
103
|
+
return containers;
|
|
138
104
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
105
|
+
var start = () => {
|
|
106
|
+
const { onloadUrlCallback, renderExplicit } = require_config.extractParams(BUNDLE_NAMES);
|
|
107
|
+
let readyCalled = false;
|
|
108
|
+
if (renderExplicit !== "explicit") {
|
|
109
|
+
require_config.getProcaptchaScript(BUNDLE_NAMES)?.addEventListener("load", () => {
|
|
110
|
+
ready(implicitRender);
|
|
111
|
+
readyCalled = true;
|
|
112
|
+
});
|
|
113
|
+
if (document.readyState === "complete" && !readyCalled) ready(implicitRender);
|
|
114
|
+
}
|
|
115
|
+
if (onloadUrlCallback) {
|
|
116
|
+
require_config.getProcaptchaScript(BUNDLE_NAMES)?.addEventListener("load", () => {
|
|
117
|
+
ready((0, _prosopo_procaptcha_common.getWindowCallback)(onloadUrlCallback));
|
|
118
|
+
});
|
|
119
|
+
if (document.readyState === "complete" && !readyCalled) ready((0, _prosopo_procaptcha_common.getWindowCallback)(onloadUrlCallback));
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
var reset = () => {
|
|
123
|
+
for (const root of procaptchaRoots) root.unmount();
|
|
124
|
+
procaptchaRoots = [];
|
|
125
|
+
start();
|
|
161
126
|
};
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
start();
|
|
127
|
+
window.procaptcha = {
|
|
128
|
+
ready,
|
|
129
|
+
render,
|
|
130
|
+
reset,
|
|
131
|
+
execute
|
|
168
132
|
};
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
},
|
|
174
|
-
bubbles: true,
|
|
175
|
-
cancelable: false
|
|
133
|
+
var procaptchaReadyEvent = new CustomEvent(PROCAPTCHA_READY_EVENT, {
|
|
134
|
+
detail: { timestamp: Date.now() },
|
|
135
|
+
bubbles: true,
|
|
136
|
+
cancelable: false
|
|
176
137
|
});
|
|
177
138
|
document.dispatchEvent(procaptchaReadyEvent);
|
|
178
139
|
start();
|
|
140
|
+
//#endregion
|
|
179
141
|
exports.default = ready;
|
|
180
142
|
exports.execute = execute;
|
|
181
143
|
exports.render = render;
|