@prosopo/procaptcha-bundle 3.0.13 → 3.2.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/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/index.d.ts.map +1 -1
- package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/index.js +10 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/index.js.map +1 -0
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/procaptchaReady.unit.test.d.ts +2 -0
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/procaptchaReady.unit.test.d.ts.map +1 -0
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/procaptchaReady.unit.test.js +32 -0
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/procaptchaReady.unit.test.js.map +1 -0
- package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js +19 -9
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js.map +1 -0
- package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
- package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js +1 -1
- package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js.map +1 -1
- package/{dist → .rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist}/bundle/util/captcha/captchaProps.d.ts +1 -0
- package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts.map +1 -1
- package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts +1 -1
- package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
- package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js +2 -1
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js.map +1 -0
- package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -1
- package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js +2 -2
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js.map +1 -0
- package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.d.ts.map +1 -1
- package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.js +0 -1
- package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.js.map +1 -1
- package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts.map +1 -1
- package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js +6 -2
- package/.rollup.cache/home/chris/dev/prosopo/captcha-private/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js.map +1 -0
- package/CHANGELOG.md +440 -0
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/clover.xml +599 -0
- package/coverage/coverage-final.json +17 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +161 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +210 -0
- package/coverage/src/components.ts.html +139 -0
- package/coverage/src/index.html +131 -0
- package/coverage/src/index.ts.html +844 -0
- package/coverage/src/util/captcha/captchaComponentProvider.tsx.html +214 -0
- package/coverage/src/util/captcha/captchaComponentsList.ts.html +178 -0
- package/coverage/src/util/captcha/captchaProps.ts.html +166 -0
- package/coverage/src/util/captcha/captchaRenderer.tsx.html +481 -0
- package/coverage/src/util/captcha/captchaType.ts.html +181 -0
- package/coverage/src/util/captcha/components/frictionlessCaptcha.tsx.html +205 -0
- package/coverage/src/util/captcha/components/imageCaptcha.tsx.html +178 -0
- package/coverage/src/util/captcha/components/index.html +146 -0
- package/coverage/src/util/captcha/components/powCaptcha.tsx.html +178 -0
- package/coverage/src/util/captcha/index.html +176 -0
- package/coverage/src/util/config.ts.html +172 -0
- package/coverage/src/util/configCreator.ts.html +241 -0
- package/coverage/src/util/index.html +191 -0
- package/coverage/src/util/language.ts.html +244 -0
- package/coverage/src/util/timeout.ts.html +214 -0
- package/coverage/src/util/widgetFactory.ts.html +532 -0
- package/coverage/src/util/widgetThemeResolver.ts.html +205 -0
- package/dist/bundle/{ProcaptchaWidget-CXxnCzl2.js → ProcaptchaWidget-CuMH13Bh.js} +340 -320
- package/dist/bundle/{ProcaptchaWidget-BIt2pcrz.js → ProcaptchaWidget-DsflBBn_.js} +25 -25
- package/dist/bundle/{browser-ponyfill-CvzSbL_o.js → browser-ponyfill-DXriyH6D.js} +4 -4
- package/dist/bundle/{builder-DNHtDoNG.js → builder-ByZ5z580.js} +3 -1
- package/dist/bundle/captchaComponentProvider-D02Su4nd.js +1013 -0
- package/dist/bundle/captchaRenderer-BV-WgbEA.js +70 -0
- package/dist/bundle/{commonChunk-BKceWhtS.js → commonChunk-PB26mndo.js} +66 -69
- package/dist/bundle/{emotion-element-5486c51c.browser.esm-CimrRZxS.js → emotion-element-c39617d8.browser.esm-DG1XhEZ1.js} +343 -345
- package/dist/bundle/{index-KHTbPva_.js → index-B9KeZfID.js} +3 -3
- package/dist/bundle/{index-hrOz2CPm.js → index-Calnfnac.js} +97 -87
- package/dist/bundle/index-DU371vQ0.js +1634 -0
- package/dist/bundle/index.d.ts.map +1 -1
- package/dist/bundle/nobleChunk-Bbltwf44.js +2728 -0
- package/dist/bundle/procaptcha.bundle.js +2 -2
- package/dist/bundle/tests/procaptchaReady.unit.test.d.ts.map +1 -0
- package/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
- package/dist/bundle/util/captcha/captchaProps.d.ts.map +1 -1
- package/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
- package/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -1
- package/dist/bundle/util/configCreator.d.ts.map +1 -1
- package/dist/bundle/util/widgetFactory.d.ts.map +1 -1
- package/dist/bundle/{utilChunk-DPr6oTOj.js → utilChunk-WRTGKXbU.js} +109 -102
- package/dist/bundle/{utilCryptoChunk-BKe3CKqn.js → utilCryptoChunk-B4ZdOwus.js} +252 -243
- package/dist/bundle/{web2Chunk-Cqw91v-J.js → web2Chunk-BGN6Hv-C.js} +1097 -1002
- package/dist/bundle/web3Chunk-BIX2T9Eo.js +525 -0
- package/dist/bundle/{zodChunk-wTu9ZHzV.js → zodChunk-CaINhWMQ.js} +10 -10
- package/dist/cjs/index.cjs +10 -1
- package/dist/cjs/util/captcha/captchaComponentProvider.cjs +3 -2
- package/dist/cjs/util/captcha/captchaRenderer.cjs +4 -3
- package/dist/cjs/util/captcha/components/frictionlessCaptcha.cjs +4 -3
- package/dist/cjs/util/captcha/components/imageCaptcha.cjs +1 -1
- package/dist/cjs/util/captcha/components/powCaptcha.cjs +1 -1
- package/dist/cjs/util/configCreator.cjs +0 -1
- package/dist/cjs/util/widgetFactory.cjs +7 -2
- package/dist/components.d.ts.map +1 -0
- package/dist/components.js +5 -0
- package/dist/components.js.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -0
- package/dist/tests/procaptchaReady.unit.test.d.ts +2 -0
- package/dist/tests/procaptchaReady.unit.test.d.ts.map +1 -0
- package/dist/tests/procaptchaReady.unit.test.js +32 -0
- package/dist/tests/procaptchaReady.unit.test.js.map +1 -0
- package/dist/tests/util/captchaType.test.d.ts.map +1 -0
- package/dist/tests/util/captchaType.test.js +36 -0
- package/dist/tests/util/captchaType.test.js.map +1 -0
- package/dist/tests/util/config.test.d.ts.map +1 -0
- package/dist/tests/util/config.test.js +69 -0
- package/dist/tests/util/config.test.js.map +1 -0
- package/dist/tests/util/renderLogic.test.d.ts.map +1 -0
- package/dist/tests/util/renderLogic.test.js +136 -0
- package/dist/tests/util/renderLogic.test.js.map +1 -0
- package/dist/util/captcha/captchaComponentProvider.d.ts.map +1 -0
- package/dist/util/captcha/captchaComponentProvider.js +3 -2
- package/dist/util/captcha/captchaComponentProvider.js.map +1 -0
- package/dist/util/captcha/captchaComponentsList.d.ts.map +1 -0
- package/dist/util/captcha/captchaComponentsList.js.map +1 -0
- package/{.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle → dist}/util/captcha/captchaProps.d.ts +1 -0
- package/dist/util/captcha/captchaProps.d.ts.map +1 -0
- package/dist/util/captcha/captchaProps.js +2 -0
- package/dist/util/captcha/captchaProps.js.map +1 -0
- package/dist/{bundle/util → util}/captcha/captchaRenderer.d.ts +1 -1
- package/dist/util/captcha/captchaRenderer.d.ts.map +1 -0
- package/dist/util/captcha/captchaRenderer.js +4 -3
- package/dist/util/captcha/captchaRenderer.js.map +1 -0
- package/dist/util/captcha/captchaType.d.ts.map +1 -0
- package/dist/util/captcha/captchaType.js.map +1 -0
- package/dist/util/captcha/components/frictionlessCaptcha.d.ts.map +1 -0
- package/dist/util/captcha/components/frictionlessCaptcha.js +4 -3
- package/dist/util/captcha/components/frictionlessCaptcha.js.map +1 -0
- package/dist/util/captcha/components/imageCaptcha.d.ts.map +1 -0
- package/dist/util/captcha/components/imageCaptcha.js +1 -1
- package/dist/util/captcha/components/imageCaptcha.js.map +1 -0
- package/dist/util/captcha/components/powCaptcha.d.ts.map +1 -0
- package/dist/util/captcha/components/powCaptcha.js +1 -1
- package/dist/util/captcha/components/powCaptcha.js.map +1 -0
- package/dist/util/config.d.ts.map +1 -0
- package/dist/util/config.js.map +1 -0
- package/dist/util/configCreator.d.ts.map +1 -0
- package/dist/util/configCreator.js +0 -1
- package/dist/util/configCreator.js.map +1 -0
- package/dist/util/language.d.ts.map +1 -0
- package/dist/util/language.js.map +1 -0
- package/dist/util/timeout.d.ts.map +1 -0
- package/dist/util/timeout.js.map +1 -0
- package/dist/util/widgetFactory.d.ts.map +1 -0
- package/dist/util/widgetFactory.js +7 -2
- package/dist/util/widgetFactory.js.map +1 -0
- package/dist/util/widgetThemeResolver.d.ts.map +1 -0
- package/dist/util/widgetThemeResolver.js.map +1 -0
- package/package.json +24 -25
- package/stats.html +2239 -2132
- package/vite.test.config.ts +3 -2
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js.map +0 -1
- package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js.map +0 -1
- package/dist/bundle/captchaComponentProvider-BGEAkC9Y.js +0 -968
- package/dist/bundle/captchaRenderer-CqnUYyKY.js +0 -70
- package/dist/bundle/index-7Xh-Mf8v.js +0 -1318
- package/dist/bundle/nobleChunk-CQ4ENyKh.js +0 -3769
- package/dist/bundle/web3Chunk-BcwDKvjL.js +0 -517
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/components.d.ts +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/components.d.ts.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/components.js +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/components.js.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/index.d.ts +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.d.ts +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.d.ts.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.js +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.js.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.d.ts +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.d.ts.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.js +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.js.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.d.ts +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.d.ts.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.js +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.js.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.js +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.js.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.d.ts +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.d.ts.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.js +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.js.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.d.ts +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.d.ts.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.js +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.js.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.d.ts +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.d.ts.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.js +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.js.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/config.d.ts +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/config.d.ts.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/config.js +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/config.js.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.d.ts +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/language.d.ts +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/language.d.ts.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/language.js +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/language.js.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.d.ts +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.d.ts.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.js +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.js.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.d.ts +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.d.ts.map +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.js +0 -0
- /package/.rollup.cache/home/{runner/work/captcha → chris/dev/prosopo/captcha-private}/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.js.map +0 -0
- /package/dist/{bundle/components.d.ts → components.d.ts} +0 -0
- /package/dist/{bundle/index.d.ts → index.d.ts} +0 -0
- /package/dist/{bundle/tests → tests}/util/captchaType.test.d.ts +0 -0
- /package/dist/{bundle/tests → tests}/util/config.test.d.ts +0 -0
- /package/dist/{bundle/tests → tests}/util/renderLogic.test.d.ts +0 -0
- /package/dist/{bundle/util → util}/captcha/captchaComponentProvider.d.ts +0 -0
- /package/dist/{bundle/util → util}/captcha/captchaComponentsList.d.ts +0 -0
- /package/dist/{bundle/util → util}/captcha/captchaType.d.ts +0 -0
- /package/dist/{bundle/util → util}/captcha/components/frictionlessCaptcha.d.ts +0 -0
- /package/dist/{bundle/util → util}/captcha/components/imageCaptcha.d.ts +0 -0
- /package/dist/{bundle/util → util}/captcha/components/powCaptcha.d.ts +0 -0
- /package/dist/{bundle/util → util}/config.d.ts +0 -0
- /package/dist/{bundle/util → util}/configCreator.d.ts +0 -0
- /package/dist/{bundle/util → util}/language.d.ts +0 -0
- /package/dist/{bundle/util → util}/timeout.d.ts +0 -0
- /package/dist/{bundle/util → util}/widgetFactory.d.ts +0 -0
- /package/dist/{bundle/util → util}/widgetThemeResolver.d.ts +0 -0
|
@@ -2739,14 +2739,14 @@ var p;
|
|
|
2739
2739
|
const nt = (r, e = {
|
|
2740
2740
|
message: `Input not instance of ${r.name}`
|
|
2741
2741
|
}) => Ae((t) => t instanceof r, e), Me = Z.create, $e = A.create, at = ye.create, it = M.create, Pe = Q.create, ot = D.create, dt = he.create, ct = K.create, ut = F.create, lt = q.create, ft = V.create, ht = I.create, pt = pe.create, mt = S.create, yt = x.create, vt = x.strictCreate, _t = ee.create, gt = ve.create, xt = te.create, kt = E.create, bt = re.create, wt = me.create, Tt = L.create, Zt = B.create, St = se.create, Ct = ne.create, Nt = $.create, Ot = ae.create, Et = Y.create, Ce = C.create, Rt = N.create, It = P.create, jt = C.createWithPreprocess, At = ce.create, Mt = () => Me().optional(), $t = () => $e().optional(), Pt = () => Pe().optional(), Vt = {
|
|
2742
|
-
string: (r) => Z.create({ ...r, coerce: !0 }),
|
|
2743
|
-
number: (r) => A.create({ ...r, coerce: !0 }),
|
|
2744
|
-
boolean: (r) => Q.create({
|
|
2742
|
+
string: ((r) => Z.create({ ...r, coerce: !0 })),
|
|
2743
|
+
number: ((r) => A.create({ ...r, coerce: !0 })),
|
|
2744
|
+
boolean: ((r) => Q.create({
|
|
2745
2745
|
...r,
|
|
2746
2746
|
coerce: !0
|
|
2747
|
-
}),
|
|
2748
|
-
bigint: (r) => M.create({ ...r, coerce: !0 }),
|
|
2749
|
-
date: (r) => D.create({ ...r, coerce: !0 })
|
|
2747
|
+
})),
|
|
2748
|
+
bigint: ((r) => M.create({ ...r, coerce: !0 })),
|
|
2749
|
+
date: ((r) => D.create({ ...r, coerce: !0 }))
|
|
2750
2750
|
}, Dt = m;
|
|
2751
2751
|
var Lt = /* @__PURE__ */ Object.freeze({
|
|
2752
2752
|
__proto__: null,
|
|
@@ -2866,10 +2866,10 @@ var Lt = /* @__PURE__ */ Object.freeze({
|
|
|
2866
2866
|
});
|
|
2867
2867
|
export {
|
|
2868
2868
|
$e as a,
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2869
|
+
Pe as b,
|
|
2870
|
+
mt as c,
|
|
2871
|
+
Ae as d,
|
|
2872
|
+
ct as e,
|
|
2873
2873
|
Vt as f,
|
|
2874
2874
|
Nt as g,
|
|
2875
2875
|
Ct as l,
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -10,6 +10,7 @@ const BUNDLE_NAME = "procaptcha.bundle.js";
|
|
|
10
10
|
let procaptchaRoots = [];
|
|
11
11
|
const widgetFactory = new widgetFactory$1.WidgetFactory(new widgetThemeResolver.WidgetThemeResolver());
|
|
12
12
|
const PROCAPTCHA_EXECUTE_EVENT = "procaptcha:execute";
|
|
13
|
+
const PROCAPTCHA_READY_EVENT = "procaptcha:ready";
|
|
13
14
|
const implicitRender = async () => {
|
|
14
15
|
const elements = Array.from(
|
|
15
16
|
document.getElementsByClassName("procaptcha")
|
|
@@ -18,7 +19,7 @@ const implicitRender = async () => {
|
|
|
18
19
|
const siteKey = util.at(elements, 0).getAttribute("data-sitekey");
|
|
19
20
|
const web3 = util.at(elements, 0).getAttribute("data-web3");
|
|
20
21
|
if (!siteKey) {
|
|
21
|
-
console.error("No
|
|
22
|
+
console.error("No site key found");
|
|
22
23
|
return;
|
|
23
24
|
}
|
|
24
25
|
const captchaType$1 = captchaType.getCaptchaType(elements);
|
|
@@ -162,6 +163,14 @@ const reset = () => {
|
|
|
162
163
|
start();
|
|
163
164
|
};
|
|
164
165
|
window.procaptcha = { ready, render, reset, execute };
|
|
166
|
+
const procaptchaReadyEvent = new CustomEvent(PROCAPTCHA_READY_EVENT, {
|
|
167
|
+
detail: {
|
|
168
|
+
timestamp: Date.now()
|
|
169
|
+
},
|
|
170
|
+
bubbles: true,
|
|
171
|
+
cancelable: false
|
|
172
|
+
});
|
|
173
|
+
document.dispatchEvent(procaptchaReadyEvent);
|
|
165
174
|
start();
|
|
166
175
|
exports.default = ready;
|
|
167
176
|
exports.execute = execute;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
+
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
4
4
|
const types = require("@prosopo/types");
|
|
5
5
|
const captchaComponentsList = require("./captchaComponentsList.cjs");
|
|
6
6
|
class CaptchaComponentProvider {
|
|
@@ -15,7 +15,8 @@ class CaptchaComponentProvider {
|
|
|
15
15
|
{
|
|
16
16
|
config: captchaProps.config,
|
|
17
17
|
callbacks: captchaProps.callbacks,
|
|
18
|
-
i18n: captchaProps.i18n
|
|
18
|
+
i18n: captchaProps.i18n,
|
|
19
|
+
container: captchaProps.container
|
|
19
20
|
}
|
|
20
21
|
);
|
|
21
22
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
+
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
4
4
|
const createCache = require("@emotion/cache");
|
|
5
5
|
const react = require("@emotion/react");
|
|
6
6
|
const client = require("react-dom/client");
|
|
@@ -11,7 +11,7 @@ class CaptchaRenderer {
|
|
|
11
11
|
constructor(captchaComponentProvider) {
|
|
12
12
|
this.captchaComponentProvider = captchaComponentProvider;
|
|
13
13
|
}
|
|
14
|
-
renderCaptcha(settings, container, renderOptions, callbacks, isWeb2, i18n, invisible
|
|
14
|
+
renderCaptcha(settings, container, renderOptions, callbacks, isWeb2, i18n, invisible, widgetContainer) {
|
|
15
15
|
const captchaType = renderOptions?.captchaType || settings.defaultCaptchaType;
|
|
16
16
|
const config = configCreator.createConfig(
|
|
17
17
|
renderOptions.siteKey,
|
|
@@ -35,7 +35,8 @@ class CaptchaRenderer {
|
|
|
35
35
|
{
|
|
36
36
|
config,
|
|
37
37
|
i18n,
|
|
38
|
-
callbacks
|
|
38
|
+
callbacks,
|
|
39
|
+
container: widgetContainer
|
|
39
40
|
}
|
|
40
41
|
);
|
|
41
42
|
this.renderCaptchaComponent(reactRoot, emotionCache, captchaComponent);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
+
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
4
4
|
const procaptchaCommon = require("@prosopo/procaptcha-common");
|
|
5
5
|
const procaptchaFrictionless = require("@prosopo/procaptcha-frictionless");
|
|
6
6
|
const react = require("react");
|
|
7
7
|
const FrictionlessCaptcha = (props) => {
|
|
8
|
-
const { config, callbacks, i18n } = props;
|
|
8
|
+
const { config, callbacks, i18n, container } = props;
|
|
9
9
|
const [componentKey, setComponentKey] = react.useState(0);
|
|
10
10
|
const restart = () => {
|
|
11
11
|
setComponentKey((prevKey) => prevKey + 1);
|
|
@@ -16,7 +16,8 @@ const FrictionlessCaptcha = (props) => {
|
|
|
16
16
|
config,
|
|
17
17
|
callbacks: procaptchaCommon.getDefaultEvents(callbacks),
|
|
18
18
|
restart,
|
|
19
|
-
i18n
|
|
19
|
+
i18n,
|
|
20
|
+
container
|
|
20
21
|
},
|
|
21
22
|
componentKey
|
|
22
23
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
+
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
4
4
|
const procaptchaCommon = require("@prosopo/procaptcha-common");
|
|
5
5
|
const procaptchaReact = require("@prosopo/procaptcha-react");
|
|
6
6
|
const ImageCaptcha = (props) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
+
const jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
4
4
|
const procaptchaCommon = require("@prosopo/procaptcha-common");
|
|
5
5
|
const procaptchaPow = require("@prosopo/procaptcha-pow");
|
|
6
6
|
const PowCaptcha = (props) => {
|
|
@@ -13,7 +13,6 @@ function createConfig(siteKey, theme = "light", language, web2 = true, invisible
|
|
|
13
13
|
},
|
|
14
14
|
serverUrl: process.env.PROSOPO_SERVER_URL || "",
|
|
15
15
|
mongoAtlasUri: process.env.PROSOPO_MONGO_EVENTS_URI || "",
|
|
16
|
-
devOnlyWatchEvents: process.env._DEV_ONLY_WATCH_EVENTS === "true" || false,
|
|
17
16
|
web2,
|
|
18
17
|
mode: invisible ? "invisible" : "visible",
|
|
19
18
|
theme,
|
|
@@ -38,16 +38,20 @@ class WidgetFactory {
|
|
|
38
38
|
);
|
|
39
39
|
const widgetTheme = "light" === renderOptions.theme ? widgetSkeleton.lightTheme : widgetSkeleton.darkTheme;
|
|
40
40
|
let widgetInteractiveArea;
|
|
41
|
+
let widgetContainer;
|
|
41
42
|
if (invisible) {
|
|
42
43
|
const newDiv = document.createElement("div");
|
|
43
44
|
container.appendChild(newDiv);
|
|
44
45
|
widgetInteractiveArea = newDiv;
|
|
46
|
+
widgetContainer = newDiv;
|
|
45
47
|
} else {
|
|
46
|
-
|
|
48
|
+
const widgetResult = widgetSkeleton.createWidgetSkeleton(
|
|
47
49
|
container,
|
|
48
50
|
widgetTheme,
|
|
49
51
|
"prosopo-procaptcha"
|
|
50
52
|
);
|
|
53
|
+
widgetInteractiveArea = widgetResult.widgetInteractiveArea;
|
|
54
|
+
widgetContainer = widgetResult.webComponent;
|
|
51
55
|
}
|
|
52
56
|
const captchaRenderer = await this.getCaptchaRenderer();
|
|
53
57
|
const captchaRoot = captchaRenderer.renderCaptcha(
|
|
@@ -62,7 +66,8 @@ class WidgetFactory {
|
|
|
62
66
|
callbacks,
|
|
63
67
|
isWeb2,
|
|
64
68
|
this.i18n,
|
|
65
|
-
invisible
|
|
69
|
+
invisible,
|
|
70
|
+
widgetContainer
|
|
66
71
|
);
|
|
67
72
|
return captchaRoot;
|
|
68
73
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAcA,cAAc,kDAAkD,CAAC;AACjE,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from "./util/captcha/components/frictionlessCaptcha.js";
|
|
2
|
+
export * from "./util/captcha/components/powCaptcha.js";
|
|
3
|
+
export * from "./util/captcha/components/imageCaptcha.js";
|
|
4
|
+
export * from "./util/captcha/captchaComponentProvider.js";
|
|
5
|
+
//# sourceMappingURL=components.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAcA,cAAc,kDAAkD,CAAC;AACjE,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAoF9D,eAAO,MAAM,MAAM,YACT,OAAO,iBACD,uBAAuB,kBA2BtC,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,EAAE,MAAM,IAAI,QAY3C;AAED,eAAO,MAAM,OAAO,YAqBnB,CAAC;AAkCF,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,UAAU,EAAE;YACX,KAAK,EAAE,OAAO,KAAK,CAAC;YACpB,MAAM,EAAE,OAAO,MAAM,CAAC;YACtB,KAAK,EAAE,OAAO,KAAK,CAAC;YACpB,OAAO,EAAE,OAAO,OAAO,CAAC;SACxB,CAAC;KACF;CACD;AAmCD,eAAO,MAAM,KAAK,YAOjB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ const BUNDLE_NAME = "procaptcha.bundle.js";
|
|
|
8
8
|
let procaptchaRoots = [];
|
|
9
9
|
const widgetFactory = new WidgetFactory(new WidgetThemeResolver());
|
|
10
10
|
const PROCAPTCHA_EXECUTE_EVENT = "procaptcha:execute";
|
|
11
|
+
const PROCAPTCHA_READY_EVENT = "procaptcha:ready";
|
|
11
12
|
const implicitRender = async () => {
|
|
12
13
|
const elements = Array.from(
|
|
13
14
|
document.getElementsByClassName("procaptcha")
|
|
@@ -16,7 +17,7 @@ const implicitRender = async () => {
|
|
|
16
17
|
const siteKey = at(elements, 0).getAttribute("data-sitekey");
|
|
17
18
|
const web3 = at(elements, 0).getAttribute("data-web3");
|
|
18
19
|
if (!siteKey) {
|
|
19
|
-
console.error("No
|
|
20
|
+
console.error("No site key found");
|
|
20
21
|
return;
|
|
21
22
|
}
|
|
22
23
|
const captchaType = getCaptchaType(elements);
|
|
@@ -160,6 +161,14 @@ const reset = () => {
|
|
|
160
161
|
start();
|
|
161
162
|
};
|
|
162
163
|
window.procaptcha = { ready, render, reset, execute };
|
|
164
|
+
const procaptchaReadyEvent = new CustomEvent(PROCAPTCHA_READY_EVENT, {
|
|
165
|
+
detail: {
|
|
166
|
+
timestamp: Date.now()
|
|
167
|
+
},
|
|
168
|
+
bubbles: true,
|
|
169
|
+
cancelable: false
|
|
170
|
+
});
|
|
171
|
+
document.dispatchEvent(procaptchaReadyEvent);
|
|
163
172
|
start();
|
|
164
173
|
export {
|
|
165
174
|
ready as default,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,EAAE,EAAE,MAAM,eAAe,CAAC;AAEnC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,MAAM,WAAW,GAAG,sBAAsB,CAAC;AAC3C,IAAI,eAAe,GAAW,EAAE,CAAC;AAEjC,MAAM,aAAa,GAAG,IAAI,aAAa,CAAC,IAAI,mBAAmB,EAAE,CAAC,CAAC;AAGnE,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;AAGtD,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAGlD,MAAM,cAAc,GAAG,KAAK,IAAI,EAAE;IAEjC,MAAM,QAAQ,GAAc,KAAK,CAAC,IAAI,CACrC,QAAQ,CAAC,sBAAsB,CAAC,YAAY,CAAC,CAC7C,CAAC,MAAM,CAA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,CAAC,cAAc,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;QAGH,IAAI,QAAQ,CAAC,UAAU,KAAK,UAAU,IAAI,CAAC,WAAW,EAAE,CAAC;YACxD,MAAM,cAAc,GAAG,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;YAC5D,KAAK,CAAC,cAAc,CAAC,CAAC;QACvB,CAAC;IACF,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,EAAE;IACzB,KAAK,MAAM,IAAI,IAAI,eAAe,EAAE,CAAC;QACpC,IAAI,CAAC,OAAO,EAAE,CAAC;IAChB,CAAC;IACD,eAAe,GAAG,EAAE,CAAC;IAErB,KAAK,EAAE,CAAC;AACT,CAAC,CAAC;AAGF,MAAM,CAAC,UAAU,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAGtD,MAAM,oBAAoB,GAAG,IAAI,WAAW,CAAC,sBAAsB,EAAE;IACpE,MAAM,EAAE;QACP,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;KACrB;IACD,OAAO,EAAE,IAAI;IACb,UAAU,EAAE,KAAK;CACjB,CAAC,CAAC;AACH,QAAQ,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC;AAE7C,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"procaptchaReady.unit.test.d.ts","sourceRoot":"","sources":["../../src/tests/procaptchaReady.unit.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { JSDOM } from "jsdom";
|
|
2
|
+
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
3
|
+
describe("procaptcha:ready event", () => {
|
|
4
|
+
let dom;
|
|
5
|
+
beforeEach(() => {
|
|
6
|
+
dom = new JSDOM("<!DOCTYPE html><html><body></body></html>", {
|
|
7
|
+
url: "https://example.com",
|
|
8
|
+
});
|
|
9
|
+
global.document = dom.window.document;
|
|
10
|
+
global.window = dom.window;
|
|
11
|
+
});
|
|
12
|
+
afterEach(() => {
|
|
13
|
+
global.document = undefined;
|
|
14
|
+
global.window = undefined;
|
|
15
|
+
});
|
|
16
|
+
it("should dispatch procaptcha:ready event when window.procaptcha is set", (done) => {
|
|
17
|
+
document.addEventListener("procaptcha:ready", (event) => {
|
|
18
|
+
const customEvent = event;
|
|
19
|
+
expect(customEvent.detail).toBeDefined();
|
|
20
|
+
expect(typeof customEvent.detail.timestamp).toBe("number");
|
|
21
|
+
expect(customEvent.bubbles).toBe(true);
|
|
22
|
+
expect(customEvent.cancelable).toBe(false);
|
|
23
|
+
expect(window.procaptcha).toBeDefined();
|
|
24
|
+
expect(window.procaptcha?.render).toBeDefined();
|
|
25
|
+
expect(window.procaptcha?.ready).toBeDefined();
|
|
26
|
+
expect(window.procaptcha?.reset).toBeDefined();
|
|
27
|
+
expect(window.procaptcha?.execute).toBeDefined();
|
|
28
|
+
});
|
|
29
|
+
import("../index.js");
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=procaptchaReady.unit.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"procaptchaReady.unit.test.js","sourceRoot":"","sources":["../../src/tests/procaptchaReady.unit.test.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAC9B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAErE,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACvC,IAAI,GAAU,CAAC;IAEf,UAAU,CAAC,GAAG,EAAE;QACf,GAAG,GAAG,IAAI,KAAK,CAAC,2CAA2C,EAAE;YAC5D,GAAG,EAAE,qBAAqB;SAC1B,CAAC,CAAC;QAEH,MAAM,CAAC,QAAQ,GAAG,GAAG,CAAC,MAAM,CAA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0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captchaType.test.d.ts","sourceRoot":"","sources":["../../../src/tests/util/captchaType.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { CaptchaType } from "@prosopo/types";
|
|
2
|
+
import { JSDOM } from "jsdom";
|
|
3
|
+
import { beforeEach, describe, expect, it } from "vitest";
|
|
4
|
+
import { getCaptchaType } from "../../util/captcha/captchaType.js";
|
|
5
|
+
describe("getCaptchaType", () => {
|
|
6
|
+
beforeEach(() => {
|
|
7
|
+
const dom = new JSDOM("<!DOCTYPE html><html><body></body></html>");
|
|
8
|
+
global.document = dom.window.document;
|
|
9
|
+
});
|
|
10
|
+
it("should return the correct captcha type when a valid type is set", () => {
|
|
11
|
+
const element = document.createElement("div");
|
|
12
|
+
element.setAttribute("data-captcha-type", CaptchaType.pow);
|
|
13
|
+
const result = getCaptchaType([element]);
|
|
14
|
+
expect(result).toBe(CaptchaType.pow);
|
|
15
|
+
});
|
|
16
|
+
it('should return "frictionless" when no captcha type is set', () => {
|
|
17
|
+
const element = document.createElement("div");
|
|
18
|
+
const result = getCaptchaType([element]);
|
|
19
|
+
expect(result).toBe("frictionless");
|
|
20
|
+
});
|
|
21
|
+
it('should return "frictionless" when an invalid captcha type is set', () => {
|
|
22
|
+
const element = document.createElement("div");
|
|
23
|
+
element.setAttribute("data-captcha-type", "invalid-type");
|
|
24
|
+
const result = getCaptchaType([element]);
|
|
25
|
+
expect(result).toBe("frictionless");
|
|
26
|
+
});
|
|
27
|
+
it("should work with all valid FeaturesEnum values", () => {
|
|
28
|
+
const element = document.createElement("div");
|
|
29
|
+
for (const feature of Object.values(CaptchaType)) {
|
|
30
|
+
element.setAttribute("data-captcha-type", feature);
|
|
31
|
+
const result = getCaptchaType([element]);
|
|
32
|
+
expect(result).toBe(feature);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=captchaType.test.js.map
|
|
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kE,EAAE,GAAG,EAAE;QAC3E,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC9C,OAAO,CAAC,YAAY,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;QAE1D,MAAM,MAAM,GAAG,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAEzC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACzD,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAE9C,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC;YAClD,OAAO,CAAC,YAAY,CAAC,mBAAmB,EAAE,OAAO,CAAC,CAAC;YACnD,MAAM,MAAM,GAAG,cAAc,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YACzC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC9B,CAAC;IACF,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.test.d.ts","sourceRoot":"","sources":["../../../src/tests/util/config.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { JSDOM } from "jsdom";
|
|
2
|
+
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
3
|
+
import { extractParams, getProcaptchaScript } from "../../util/config.js";
|
|
4
|
+
describe("Config utility functions", () => {
|
|
5
|
+
let dom;
|
|
6
|
+
beforeEach(() => {
|
|
7
|
+
dom = new JSDOM("<!DOCTYPE html><html><body></body></html>", {
|
|
8
|
+
url: "https://example.com",
|
|
9
|
+
});
|
|
10
|
+
global.document = dom.window.document;
|
|
11
|
+
});
|
|
12
|
+
afterEach(() => {
|
|
13
|
+
global.document = undefined;
|
|
14
|
+
});
|
|
15
|
+
describe("getProcaptchaScript", () => {
|
|
16
|
+
it("should return null when no matching script is found", () => {
|
|
17
|
+
const result = getProcaptchaScript("nonexistent");
|
|
18
|
+
expect(result).toBeNull();
|
|
19
|
+
});
|
|
20
|
+
it("should return the script element when a matching script is found", () => {
|
|
21
|
+
const script = document.createElement("script");
|
|
22
|
+
script.src = "https://example.com/procaptcha.js";
|
|
23
|
+
document.body.appendChild(script);
|
|
24
|
+
const result = getProcaptchaScript("procaptcha");
|
|
25
|
+
expect(result).toBe(script);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
describe("extractParams", () => {
|
|
29
|
+
it("should return undefined values when no matching script is found", () => {
|
|
30
|
+
const result = extractParams("nonexistent");
|
|
31
|
+
expect(result).toEqual({
|
|
32
|
+
onloadUrlCallback: undefined,
|
|
33
|
+
renderExplicit: undefined,
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
it("should extract parameters from the script URL", () => {
|
|
37
|
+
const script = document.createElement("script");
|
|
38
|
+
script.src =
|
|
39
|
+
"https://example.com/procaptcha.js?onload=onloadCallback&render=explicit";
|
|
40
|
+
document.body.appendChild(script);
|
|
41
|
+
const result = extractParams("procaptcha");
|
|
42
|
+
expect(result).toEqual({
|
|
43
|
+
onloadUrlCallback: "onloadCallback",
|
|
44
|
+
renderExplicit: "explicit",
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
it("should return undefined for missing parameters", () => {
|
|
48
|
+
const script = document.createElement("script");
|
|
49
|
+
script.src = "https://example.com/procaptcha.js?onload=onloadCallback";
|
|
50
|
+
document.body.appendChild(script);
|
|
51
|
+
const result = extractParams("procaptcha");
|
|
52
|
+
expect(result).toEqual({
|
|
53
|
+
onloadUrlCallback: "onloadCallback",
|
|
54
|
+
renderExplicit: undefined,
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
it("should handle scripts without query parameters", () => {
|
|
58
|
+
const script = document.createElement("script");
|
|
59
|
+
script.src = "https://example.com/procaptcha.js";
|
|
60
|
+
document.body.appendChild(script);
|
|
61
|
+
const result = extractParams("procaptcha");
|
|
62
|
+
expect(result).toEqual({
|
|
63
|
+
onloadUrlCallback: undefined,
|
|
64
|
+
renderExplicit: undefined,
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=config.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.test.js","sourceRoot":"","sources":["../../../src/tests/util/config.test.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAE9B,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE1E,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACzC,IAAI,GAAU,CAAC;IAEf,UAAU,CAAC,GAAG,EAAE;QACf,GAAG,GAAG,IAAI,KAAK,CAAC,2CAA2C,EAAE;YAC5D,GAAG,EAAE,qBAAqB;SAC1B,CAAC,CAAC;QACH,MAAM,CAAC,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC;IACvC,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QAEb,MAAc,CAAC,QAAQ,GAAG,SAAS,CAAC;IACtC,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;QACpC,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;YAC9D,MAAM,MAAM,GAAG,mBAAmB,CAAC,aAAa,CAAC,CAAC;YAClD,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,CAAC;QAC3B,CAAC,CAAC,CAAC;QAEH,EA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,GAAG,yDAAyD,CAAC;YACvE,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAElC,MAAM,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;YAC3C,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;gBACtB,iBAAiB,EAAE,gBAAgB;gBACnC,cAAc,EAAE,SAAS;aACzB,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;YACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;YAChD,MAAM,CAAC,GAAG,GAAG,mCAAmC,CAAC;YACjD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;YAElC,MAAM,MAAM,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;YAC3C,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;gBACtB,iBAAiB,EAAE,SAAS;gBAC5B,cAAc,EAAE,SAAS;aACzB,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderLogic.test.d.ts","sourceRoot":"","sources":["../../../src/tests/util/renderLogic.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ProcaptchaPow } from "@prosopo/procaptcha-pow";
|
|
3
|
+
import { JSDOM } from "jsdom";
|
|
4
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
|
+
import { WidgetFactory } from "../../util/widgetFactory.js";
|
|
6
|
+
import { WidgetThemeResolver } from "../../util/widgetThemeResolver.js";
|
|
7
|
+
const widgetFactory = new WidgetFactory(new WidgetThemeResolver());
|
|
8
|
+
const callbacks = {
|
|
9
|
+
onHuman: () => console.log("onHuman"),
|
|
10
|
+
onChallengeExpired: () => console.log("onChallengeExpired"),
|
|
11
|
+
onExpired: () => console.log("onExpired"),
|
|
12
|
+
onError: () => console.log("onError"),
|
|
13
|
+
onClose: () => console.log("onClose"),
|
|
14
|
+
onOpen: () => console.log("onOpen"),
|
|
15
|
+
onFailed: () => console.log("onFailed"),
|
|
16
|
+
onReset: () => console.log("onReset"),
|
|
17
|
+
onExtensionNotFound: () => console.log("onExtensionNotFound"),
|
|
18
|
+
onReload: () => console.log("onReload"),
|
|
19
|
+
};
|
|
20
|
+
vi.mock("@prosopo/detector", async () => {
|
|
21
|
+
return {
|
|
22
|
+
isBot: async () => {
|
|
23
|
+
return { isBot: true };
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
vi.mock("@polkadot/extension-dapp", async () => {
|
|
28
|
+
return {
|
|
29
|
+
web3Enable: async () => {
|
|
30
|
+
return [];
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
vi.mock("@prosopo/procaptcha-pow", async () => {
|
|
35
|
+
return {
|
|
36
|
+
ProcaptchaPow: vi.fn((props) => {
|
|
37
|
+
return (_jsx("div", { config: props.config, callbacks: props.callbacks, children: "ProcaptchaPow" }));
|
|
38
|
+
}),
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
vi.mock("@prosopo/procaptcha-frictionless", async () => {
|
|
42
|
+
return {
|
|
43
|
+
ProcaptchaFrictionless: vi.fn((props) => {
|
|
44
|
+
return (_jsx("div", { config: props.config, callbacks: props.callbacks, children: "ProcaptchaFrictionless" }));
|
|
45
|
+
}),
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
describe("Config utility functions", () => {
|
|
49
|
+
let dom;
|
|
50
|
+
beforeEach((context) => {
|
|
51
|
+
dom = new JSDOM("<!DOCTYPE html><html><body></body></html>", {
|
|
52
|
+
url: "https://example.com",
|
|
53
|
+
});
|
|
54
|
+
context.document = dom.window.document;
|
|
55
|
+
context.window = dom.window;
|
|
56
|
+
global.window = dom.window;
|
|
57
|
+
global.document = dom.window.document;
|
|
58
|
+
global.HTMLElement = dom.window.HTMLElement;
|
|
59
|
+
global.Element = dom.window.Element;
|
|
60
|
+
global.Node = dom.window.Node;
|
|
61
|
+
global.navigator = dom.window.navigator;
|
|
62
|
+
vi.clearAllMocks();
|
|
63
|
+
});
|
|
64
|
+
afterEach((context) => {
|
|
65
|
+
context.document = undefined;
|
|
66
|
+
context.window = undefined;
|
|
67
|
+
global.HTMLElement = undefined;
|
|
68
|
+
global.Element = undefined;
|
|
69
|
+
global.Node = undefined;
|
|
70
|
+
global.navigator = undefined;
|
|
71
|
+
vi.clearAllMocks();
|
|
72
|
+
});
|
|
73
|
+
it("renders the correct captcha type", async (ctx) => {
|
|
74
|
+
const script = ctx.document.createElement("script");
|
|
75
|
+
script.src = "https://example.com/procaptcha.js";
|
|
76
|
+
document.body.appendChild(script);
|
|
77
|
+
expect(ctx.window).toBeDefined();
|
|
78
|
+
if (!ctx.window) {
|
|
79
|
+
expect(true).toBe(false);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
await widgetFactory.createWidgets([script], {
|
|
83
|
+
siteKey: "1234",
|
|
84
|
+
captchaType: "pow",
|
|
85
|
+
});
|
|
86
|
+
await vi.waitFor(() => {
|
|
87
|
+
expect(ProcaptchaPow).toHaveBeenCalledTimes(1);
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
it("user callbacks should be set when defined on the window and pulled in via data attributes", async (ctx) => {
|
|
91
|
+
const script = ctx.document.createElement("script");
|
|
92
|
+
script.src = "https://example.com/procaptcha.js";
|
|
93
|
+
script["data-callback"] = "onHuman";
|
|
94
|
+
script["data-chalexpired-callback"] = "onChallengeExpired";
|
|
95
|
+
script["data-expired-callback"] = "onExpired";
|
|
96
|
+
script["data-error-callback"] = "onError";
|
|
97
|
+
script["data-close-callback"] = "onClose";
|
|
98
|
+
script["data-open-callback"] = "onOpen";
|
|
99
|
+
script["data-failed-callback"] = "onFailed";
|
|
100
|
+
script["data-reset-callback"] = "onReset";
|
|
101
|
+
document.body.appendChild(script);
|
|
102
|
+
expect(ctx.window).toBeDefined();
|
|
103
|
+
if (!ctx.window) {
|
|
104
|
+
expect(true).toBe(false);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
ctx.window.onHuman = callbacks.onHuman;
|
|
108
|
+
ctx.window.onChallengeExpired = callbacks.onChallengeExpired;
|
|
109
|
+
ctx.window.onExpired = callbacks.onExpired;
|
|
110
|
+
ctx.window.onError = callbacks.onError;
|
|
111
|
+
ctx.window.onClose = callbacks.onClose;
|
|
112
|
+
ctx.window.onOpen = callbacks.onOpen;
|
|
113
|
+
ctx.window.onFailed = callbacks.onFailed;
|
|
114
|
+
ctx.window.onReset = callbacks.onReset;
|
|
115
|
+
ctx.window.onExtensionNotFound = callbacks.onExtensionNotFound;
|
|
116
|
+
ctx.window.onReload = callbacks.onReload;
|
|
117
|
+
await widgetFactory.createWidgets([script], {
|
|
118
|
+
siteKey: "1234",
|
|
119
|
+
captchaType: "pow",
|
|
120
|
+
});
|
|
121
|
+
await vi.waitFor(() => {
|
|
122
|
+
expect(ProcaptchaPow).toHaveBeenCalledTimes(1);
|
|
123
|
+
const call = ProcaptchaPow.mock.calls[0];
|
|
124
|
+
const props = call[0];
|
|
125
|
+
expect(props.config.account.address).toBe("1234");
|
|
126
|
+
expect(props.config.web2).toBe(true);
|
|
127
|
+
expect(props.config.solutionThreshold).toBe(80);
|
|
128
|
+
expect(props.config.dappName).toBe("ProsopoClientDapp");
|
|
129
|
+
expect(props.config.theme).toBe("light");
|
|
130
|
+
expect(props.config.mode).toBe("visible");
|
|
131
|
+
expect(props.callbacks).toBeDefined();
|
|
132
|
+
expect(typeof props.callbacks).toBe("object");
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
//# sourceMappingURL=renderLogic.test.js.map
|
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AI,CAAC,MAAM,CAAC,CAAC;YAClD,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACrC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAChD,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACxD,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACzC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YAG1C,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC;YACtC,MAAM,CAAC,OAAO,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captchaComponentProvider.d.ts","sourceRoot":"","sources":["../../../src/util/captcha/captchaComponentProvider.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,cAAM,wBAAwB;IACtB,mBAAmB,CACzB,WAAW,EAAE,WAAW,EACxB,YAAY,EAAE,YAAY,GACxB,SAAS;CAkBZ;AAED,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { CaptchaType } from "@prosopo/types";
|
|
3
3
|
import { captchaComponentsList } from "./captchaComponentsList.js";
|
|
4
4
|
class CaptchaComponentProvider {
|
|
@@ -13,7 +13,8 @@ class CaptchaComponentProvider {
|
|
|
13
13
|
{
|
|
14
14
|
config: captchaProps.config,
|
|
15
15
|
callbacks: captchaProps.callbacks,
|
|
16
|
-
i18n: captchaProps.i18n
|
|
16
|
+
i18n: captchaProps.i18n,
|
|
17
|
+
container: captchaProps.container
|
|
17
18
|
}
|
|
18
19
|
);
|
|
19
20
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captchaComponentProvider.js","sourceRoot":"","sources":["../../../src/util/captcha/captchaComponentProvider.tsx"],"names":[],"mappings":";AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAGnE,MAAM,wBAAwB;IACtB,mBAAmB,CACzB,WAAwB,EACxB,YAA0B;QAE1B,IAAI,WAAW,KAAK,WAAW,CAAC,SAAS,EAAE,CAAC;YAC3C,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;QACpC,CAAC;QAED,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,WAAW,CAAC,CAAC;QAE5D,OAAO,CAAC,GAAG,CAAC,aAAa,WAAW,EAAE,CAAC,CAAC;QAExC,OAAO,CACN,KAAC,gBAAgB,IAChB,MAAM,EAAE,YAAY,CAAC,MAAM,EAC3B,SAAS,EAAE,YAAY,CAAC,SAAS,EACjC,IAAI,EAAE,YAAY,CAAC,IAAI,EACvB,SAAS,EAAE,YAAY,CAAC,SAAS,GAChC,CACF,CAAC;IACH,CAAC;CACD;AAED,OAAO,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captchaComponentsList.d.ts","sourceRoot":"","sources":["../../../src/util/captcha/captchaComponentsList.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAKtD,QAAA,MAAM,qBAAqB,EAAE,IAAI,CAChC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,EACtD,WAAW,CAAC,KAAK,GAAG,WAAW,CAAC,GAAG,GAAG,WAAW,CAAC,YAAY,CAK9D,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"captchaComponentsList.js","sourceRoot":"","sources":["../../../src/util/captcha/captchaComponentsList.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAExD,MAAM,qBAAqB,GAGvB;IACH,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,YAAY;IACjC,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,UAAU;IAC7B,CAAC,WAAW,CAAC,YAAY,CAAC,EAAE,mBAAmB;CAC/C,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
|