@prosopo/procaptcha-bundle 3.1.6 → 3.2.3

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.
Files changed (174) hide show
  1. package/CHANGELOG.md +114 -0
  2. package/dist/cjs/index.cjs +10 -1
  3. package/dist/cjs/util/configCreator.cjs +0 -1
  4. package/dist/index.js +10 -1
  5. package/dist/util/configCreator.js +0 -1
  6. package/package.json +16 -16
  7. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/components.d.ts +0 -5
  8. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/components.d.ts.map +0 -1
  9. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/components.js +0 -5
  10. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/components.js.map +0 -1
  11. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.d.ts +0 -16
  12. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.d.ts.map +0 -1
  13. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.js +0 -135
  14. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.js.map +0 -1
  15. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.d.ts +0 -2
  16. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.d.ts.map +0 -1
  17. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.js +0 -36
  18. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/captchaType.test.js.map +0 -1
  19. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.d.ts +0 -2
  20. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.d.ts.map +0 -1
  21. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.js +0 -69
  22. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/config.test.js.map +0 -1
  23. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.d.ts +0 -2
  24. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.d.ts.map +0 -1
  25. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js +0 -136
  26. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/tests/util/renderLogic.test.js.map +0 -1
  27. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts +0 -8
  28. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +0 -1
  29. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js +0 -15
  30. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js.map +0 -1
  31. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts +0 -6
  32. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +0 -1
  33. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.js +0 -11
  34. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.js.map +0 -1
  35. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts +0 -10
  36. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.d.ts.map +0 -1
  37. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.js +0 -2
  38. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaProps.js.map +0 -1
  39. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts +0 -24
  40. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts.map +0 -1
  41. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js +0 -49
  42. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js.map +0 -1
  43. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.d.ts +0 -3
  44. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.d.ts.map +0 -1
  45. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.js +0 -8
  46. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaType.js.map +0 -1
  47. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts +0 -4
  48. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +0 -1
  49. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js +0 -14
  50. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/frictionlessCaptcha.js.map +0 -1
  51. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.d.ts +0 -4
  52. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.d.ts.map +0 -1
  53. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.js +0 -9
  54. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/imageCaptcha.js.map +0 -1
  55. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.d.ts +0 -4
  56. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.d.ts.map +0 -1
  57. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.js +0 -9
  58. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/components/powCaptcha.js.map +0 -1
  59. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/config.d.ts +0 -6
  60. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/config.d.ts.map +0 -1
  61. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/config.js +0 -13
  62. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/config.js.map +0 -1
  63. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.d.ts +0 -5
  64. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.d.ts.map +0 -1
  65. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.js +0 -24
  66. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.js.map +0 -1
  67. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/language.d.ts +0 -3
  68. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/language.d.ts.map +0 -1
  69. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/language.js +0 -17
  70. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/language.js.map +0 -1
  71. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.d.ts +0 -3
  72. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.d.ts.map +0 -1
  73. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.js +0 -9
  74. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/timeout.js.map +0 -1
  75. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts +0 -18
  76. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.d.ts.map +0 -1
  77. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js +0 -66
  78. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetFactory.js.map +0 -1
  79. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.d.ts +0 -9
  80. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.d.ts.map +0 -1
  81. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.js +0 -19
  82. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/widgetThemeResolver.js.map +0 -1
  83. package/dist/bundle/ProcaptchaWidget-CJ-4hVS1.js +0 -187
  84. package/dist/bundle/ProcaptchaWidget-Cw3s7cGX.js +0 -1014
  85. package/dist/bundle/Signer-DP9drQ55.js +0 -23
  86. package/dist/bundle/bnChunk-DRlDxTFg.js +0 -1137
  87. package/dist/bundle/browser-ponyfill-CvzSbL_o.js +0 -339
  88. package/dist/bundle/builder-ByZ5z580.js +0 -46
  89. package/dist/bundle/captchaComponentProvider-Cn75EmSH.js +0 -1002
  90. package/dist/bundle/captchaRenderer-s4QuLEen.js +0 -71
  91. package/dist/bundle/commonChunk-BjvuHlB1.js +0 -180
  92. package/dist/bundle/components.d.ts +0 -5
  93. package/dist/bundle/components.d.ts.map +0 -1
  94. package/dist/bundle/emotion-element-c39617d8.browser.esm-BNNnmykm.js +0 -916
  95. package/dist/bundle/fp.esm-DYWeNGcH.js +0 -1654
  96. package/dist/bundle/index-BuQg3Zno.js +0 -1884
  97. package/dist/bundle/index-DIdd2cUz.js +0 -5416
  98. package/dist/bundle/index-IgqrmVIs.js +0 -601
  99. package/dist/bundle/index.d.ts +0 -16
  100. package/dist/bundle/index.d.ts.map +0 -1
  101. package/dist/bundle/locales/ar/translation.json +0 -57
  102. package/dist/bundle/locales/az/translation.json +0 -57
  103. package/dist/bundle/locales/cs/translation.json +0 -57
  104. package/dist/bundle/locales/de/translation.json +0 -57
  105. package/dist/bundle/locales/el/translation.json +0 -57
  106. package/dist/bundle/locales/en/translation.json +0 -57
  107. package/dist/bundle/locales/es/translation.json +0 -57
  108. package/dist/bundle/locales/fi/translation.json +0 -57
  109. package/dist/bundle/locales/fr/translation.json +0 -57
  110. package/dist/bundle/locales/hi/translation.json +0 -57
  111. package/dist/bundle/locales/hu/translation.json +0 -57
  112. package/dist/bundle/locales/id/translation.json +0 -57
  113. package/dist/bundle/locales/it/translation.json +0 -57
  114. package/dist/bundle/locales/ja/translation.json +0 -57
  115. package/dist/bundle/locales/jv/translation.json +0 -57
  116. package/dist/bundle/locales/ko/translation.json +0 -57
  117. package/dist/bundle/locales/ml/translation.json +0 -57
  118. package/dist/bundle/locales/ms/translation.json +0 -57
  119. package/dist/bundle/locales/nl/translation.json +0 -57
  120. package/dist/bundle/locales/no/translation.json +0 -57
  121. package/dist/bundle/locales/pl/translation.json +0 -57
  122. package/dist/bundle/locales/pt/translation.json +0 -57
  123. package/dist/bundle/locales/pt-BR/translation.json +0 -57
  124. package/dist/bundle/locales/ro/translation.json +0 -57
  125. package/dist/bundle/locales/ru/translation.json +0 -57
  126. package/dist/bundle/locales/sr/translation.json +0 -57
  127. package/dist/bundle/locales/sv/translation.json +0 -57
  128. package/dist/bundle/locales/th/translation.json +0 -57
  129. package/dist/bundle/locales/tr/translation.json +0 -57
  130. package/dist/bundle/locales/uk/translation.json +0 -57
  131. package/dist/bundle/locales/vi/translation.json +0 -57
  132. package/dist/bundle/locales/zh-CN/translation.json +0 -57
  133. package/dist/bundle/nobleChunk-Bbltwf44.js +0 -2728
  134. package/dist/bundle/procaptcha.bundle.js +0 -8
  135. package/dist/bundle/tests/util/captchaType.test.d.ts +0 -2
  136. package/dist/bundle/tests/util/captchaType.test.d.ts.map +0 -1
  137. package/dist/bundle/tests/util/config.test.d.ts +0 -2
  138. package/dist/bundle/tests/util/config.test.d.ts.map +0 -1
  139. package/dist/bundle/tests/util/renderLogic.test.d.ts +0 -2
  140. package/dist/bundle/tests/util/renderLogic.test.d.ts.map +0 -1
  141. package/dist/bundle/util/captcha/captchaComponentProvider.d.ts +0 -8
  142. package/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +0 -1
  143. package/dist/bundle/util/captcha/captchaComponentsList.d.ts +0 -6
  144. package/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +0 -1
  145. package/dist/bundle/util/captcha/captchaProps.d.ts +0 -10
  146. package/dist/bundle/util/captcha/captchaProps.d.ts.map +0 -1
  147. package/dist/bundle/util/captcha/captchaRenderer.d.ts +0 -24
  148. package/dist/bundle/util/captcha/captchaRenderer.d.ts.map +0 -1
  149. package/dist/bundle/util/captcha/captchaType.d.ts +0 -3
  150. package/dist/bundle/util/captcha/captchaType.d.ts.map +0 -1
  151. package/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts +0 -4
  152. package/dist/bundle/util/captcha/components/frictionlessCaptcha.d.ts.map +0 -1
  153. package/dist/bundle/util/captcha/components/imageCaptcha.d.ts +0 -4
  154. package/dist/bundle/util/captcha/components/imageCaptcha.d.ts.map +0 -1
  155. package/dist/bundle/util/captcha/components/powCaptcha.d.ts +0 -4
  156. package/dist/bundle/util/captcha/components/powCaptcha.d.ts.map +0 -1
  157. package/dist/bundle/util/config.d.ts +0 -6
  158. package/dist/bundle/util/config.d.ts.map +0 -1
  159. package/dist/bundle/util/configCreator.d.ts +0 -5
  160. package/dist/bundle/util/configCreator.d.ts.map +0 -1
  161. package/dist/bundle/util/language.d.ts +0 -3
  162. package/dist/bundle/util/language.d.ts.map +0 -1
  163. package/dist/bundle/util/timeout.d.ts +0 -3
  164. package/dist/bundle/util/timeout.d.ts.map +0 -1
  165. package/dist/bundle/util/widgetFactory.d.ts +0 -18
  166. package/dist/bundle/util/widgetFactory.d.ts.map +0 -1
  167. package/dist/bundle/util/widgetThemeResolver.d.ts +0 -9
  168. package/dist/bundle/util/widgetThemeResolver.d.ts.map +0 -1
  169. package/dist/bundle/utilChunk-DPr6oTOj.js +0 -317
  170. package/dist/bundle/utilCryptoChunk-D6ZLkbFV.js +0 -1236
  171. package/dist/bundle/web2Chunk-CNoojUDK.js +0 -3967
  172. package/dist/bundle/web3Chunk-BlYvY4Ea.js +0 -525
  173. package/dist/bundle/zodChunk-aEfPZzrp.js +0 -2882
  174. package/stats.html +0 -4842
@@ -1,601 +0,0 @@
1
- import { A, a as v, C as W, l as $ } from "./web2Chunk-CNoojUDK.js";
2
- function N(e) {
3
- const t = e.getRootNode();
4
- return (t instanceof ShadowRoot ? t.host : e).closest("form");
5
- }
6
- const l = () => {
7
- Array.from(
8
- document.getElementsByName(A.procaptchaResponse)
9
- ).map((t) => t.remove());
10
- }, u = (e) => {
11
- const t = window[e.replace("window.", "")];
12
- if (typeof t != "function")
13
- throw new Error(
14
- `Callback ${e} is not defined on the window object`
15
- );
16
- return t;
17
- }, M = (e) => ({
18
- onHuman: (t) => I(t, e),
19
- onChallengeExpired: () => {
20
- l();
21
- },
22
- onExtensionNotFound: () => {
23
- console.error("Extension not found");
24
- },
25
- onExpired: () => {
26
- l();
27
- },
28
- onError: (t) => {
29
- l(), console.error(t);
30
- },
31
- onClose: () => {
32
- },
33
- onOpen: () => {
34
- },
35
- onFailed: () => {
36
- alert("Captcha challenge failed. Please try again");
37
- },
38
- onReset: () => {
39
- l();
40
- },
41
- onReload: () => {
42
- }
43
- }), d = (e, t, o) => {
44
- const a = t.getAttribute(`data-${e}`);
45
- if (a) {
46
- const n = u(a);
47
- if (n)
48
- return n;
49
- }
50
- if (typeof o == "function")
51
- return o;
52
- if (typeof o == "string")
53
- return u(o);
54
- };
55
- function H(e, t, o) {
56
- const a = d(
57
- "callback",
58
- o,
59
- e == null ? void 0 : e.callback
60
- );
61
- a && (t.onHuman = (r) => {
62
- I(r, o), a(r);
63
- });
64
- const n = d(
65
- "chalexpired-callback",
66
- o,
67
- e == null ? void 0 : e["chalexpired-callback"]
68
- );
69
- n && (t.onChallengeExpired = () => {
70
- l(), n();
71
- });
72
- const c = d(
73
- "expired-callback",
74
- o,
75
- e == null ? void 0 : e["expired-callback"]
76
- );
77
- c && (t.onExpired = () => {
78
- l(), c();
79
- });
80
- const i = d(
81
- "error-callback",
82
- o,
83
- e == null ? void 0 : e["error-callback"]
84
- );
85
- i && (t.onError = (r) => {
86
- l(), i(r);
87
- });
88
- const s = d(
89
- "close-callback",
90
- o,
91
- e == null ? void 0 : e["close-callback"]
92
- );
93
- s && (t.onClose = () => {
94
- s();
95
- });
96
- const p = d(
97
- "open-callback",
98
- o,
99
- e == null ? void 0 : e["open-callback"]
100
- );
101
- p && (t.onOpen = () => {
102
- p();
103
- });
104
- const y = d(
105
- "failed-callback",
106
- o,
107
- e == null ? void 0 : e["failed-callback"]
108
- );
109
- y && (t.onFailed = () => {
110
- y();
111
- });
112
- const w = d(
113
- "reset-callback",
114
- o,
115
- e == null ? void 0 : e["reset-callback"]
116
- );
117
- w && (t.onReset = () => {
118
- l(), w();
119
- });
120
- }
121
- const I = (e, t) => {
122
- if (l(), t) {
123
- const o = N(t);
124
- if (!o) {
125
- console.error("Parent form not found for the element:", t);
126
- return;
127
- }
128
- const a = document.createElement("input");
129
- a.type = "hidden", a.name = A.procaptchaResponse, a.value = e, o.appendChild(a);
130
- }
131
- }, P = "https://prosopo.io", T = "Visit prosopo.io to learn more about the service and its accessibility options.", U = 74, x = 80, F = "80px", _ = "302px", G = "8px", j = "2px", z = "1px solid", E = "checkbox__loading-spinner";
132
- function B(e) {
133
- const t = document.createElement("div");
134
- return t.className = "checkbox", t.innerHTML = X(e) + q, t;
135
- }
136
- const K = (e) => (e.shadowRoot || e).querySelector(".checkbox__content"), q = `
137
- <div class="checkbox__outer">
138
- <div class="checkbox__wrapper">
139
- <div class="checkbox__inner">
140
- <div class="checkbox__content">
141
- <div class="${E}" aria-label="Loading spinner"></div>
142
- </div>
143
- </div>
144
- </div>
145
- </div>
146
- `, X = (e) => `
147
- <style>
148
- .checkbox {
149
- display: flex;
150
- flex-direction: column;
151
- }
152
-
153
- .checkbox__outer {
154
- align-items: center;
155
- flex: 1;
156
- }
157
-
158
- .checkbox__wrapper {
159
- display: flex;
160
- align-items: center;
161
- justify-content: center;
162
- flex-direction: column;
163
- vertical-align: middle;
164
- }
165
-
166
- .checkbox__inner {
167
- display: flex;
168
- }
169
-
170
- .checkbox__content {
171
- display: inline-flex;
172
- }
173
-
174
- .${E} {
175
- margin-top: 0;
176
- margin-left: 15px;
177
- margin-right: 15px;
178
- width: 2em;
179
- height: 2em;
180
- border: 4px solid ${e.palette.background.contrastText};
181
- border-bottom-color: transparent;
182
- border-radius: 50%;
183
- display: inherit;
184
- box-sizing: border-box;
185
- animation: checkbox__loading-spinner-rotation 1s linear infinite;
186
- will-change: transform;
187
- }
188
-
189
- @keyframes ${E}-rotation {
190
- 0% {
191
- transform: rotate(0deg);
192
- }
193
- 100% {
194
- transform: rotate(360deg);
195
- }
196
- }
197
- </style>
198
- `;
199
- function V(e) {
200
- const t = document.createElement("div");
201
- return t.className = "logo", t.innerHTML = Y + Z(e), t;
202
- }
203
- const Y = `
204
- <style>
205
- .logo {
206
- display: inline-flex;
207
- flex-direction: column;
208
- }
209
-
210
- .prosopo-logo {
211
- display: inline-flex;
212
- flex-direction: column; /* ✅ Stack vertically */
213
- align-items: center; /* ✅ Center horizontally */
214
- justify-content: center; /* ✅ Optional: center vertically if needed */
215
- padding: 8px;
216
- height: auto;
217
- min-width: max-content;
218
- gap: 2px; /* ✅ Space between SVG and text */
219
- }
220
-
221
- .prosopo-logo-text {
222
- all: unset;
223
- font-size: 9px !important;
224
- font-weight: bold !important;
225
- font-family: Helvetica Neue, Helvetica, Arial, sans-serif !important;
226
- line-height: 1 !important;
227
- text-align: center;
228
- }
229
-
230
- #logo {
231
- width: 28px;
232
- height: 28px;
233
- }
234
-
235
- </style>
236
- `;
237
- function Z(e) {
238
- return `
239
- <a href="${P}?utm_campaign=widget" tabindex="0" target="_blank" role="button"
240
- aria-label="${T}"
241
- style="text-decoration: none;">
242
- <div class="prosopo-logo">
243
- <svg id="logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 49.010001 49.009997" style="fill: ${e.palette.logoFill};"
244
- aria-label="Prosopo Logo With Text">
245
- <title>${T}</title>
246
- <g transform="matrix(0.11319331,0,0,0.11319331,6.504999,-2.2052113e-4)">
247
- <g>
248
- <path d="m 119.79,50.5 a 147.75,147.75 0 0 1 147.75,147.75 h 50.5 C 318.04,88.76 229.28,0 119.79,0 Z"></path>
249
- <path d="m 53.6,116.7 a 147.74,147.74 0 0 1 147.74,147.74 h 50.5 C 251.84,154.95 163.09,66.2 53.6,66.2 Z"></path>
250
- <path d="M 198.24,382.48 A 147.75,147.75 0 0 1 50.5,234.74 H 0 c 0,109.49 88.75,198.24 198.24,198.24 z"></path>
251
- <path d="M 264.41,316.31 A 147.74,147.74 0 0 1 116.67,168.56 H 66.16 c 0,109.49 88.76,198.25 198.25,198.25 z"></path>
252
- </g>
253
- </g>
254
- </svg>
255
- <span class="prosopo-logo-text" id="logo-text" style="color: ${e.palette.logoFill};">
256
- Prosopo
257
- </span>
258
- </div>
259
- </a>
260
- `;
261
- }
262
- function J(e) {
263
- var n, c;
264
- const t = document.createElement("div");
265
- t.className = "widget";
266
- const o = B(e), a = V(e);
267
- return t.innerHTML = O(e) + Q(te()), (n = t.querySelector(".widget__checkbox")) == null || n.replaceWith(o), (c = t.querySelector(".widget__logo")) == null || c.replaceWith(a), t;
268
- }
269
- function Q(e) {
270
- return `
271
- <div class="widget__outer">
272
- <div class="widget__wrapper">
273
- <div class="widget__inner">
274
- <div class="widget__dimensions" ${e ? 'data-cy="captcha-checkbox"' : ""}>
275
- <div class="widget__content">
276
- <div class="widget__checkbox"></div>
277
- <div class="widget__logo"></div>
278
- </div>
279
- </div>
280
- </div>
281
- </div>
282
- </div>
283
- `;
284
- }
285
- function O(e) {
286
- return `
287
- <style>
288
- .widget {
289
- width: 100%;
290
- min-height: ${F}
291
- }
292
-
293
- .widget__outer {
294
- max-width: ${_};
295
- min-height: 100%;
296
- overflow-x: auto;
297
- width: 100%;
298
- font-family: ${e.font.fontFamily};
299
- color: ${e.font.color};
300
- }
301
-
302
- .widget__wrapper {
303
- container-type: size;
304
- container-name: widget;
305
- display: flex;
306
- flex-direction: column;
307
- height: ${x}px;
308
- min-width: 220px;
309
- }
310
-
311
- .widget__inner {
312
- max-height: 100%;
313
- min-width: 100%;
314
- overflow: hidden;
315
- height: ${x}px;
316
- width: 100%;
317
- display: grid;
318
- }
319
-
320
- .widget__dimensions {
321
- max-width: ${_};
322
- min-height: ${x}px;
323
- }
324
-
325
- .widget__content {
326
- padding: ${j};
327
- border: ${z};
328
- background-color: ${e.palette.background.default};
329
- border-color: ${e.palette.grey[300]};
330
- border-radius: ${G};
331
- display: flex;
332
- align-items: center;
333
- flex-wrap: wrap;
334
- justify-content: space-between;
335
- min-height: ${U}px;
336
- overflow: hidden;
337
- }
338
- </style>
339
- `;
340
- }
341
- function ee() {
342
- var t;
343
- return typeof process < "u" ? "production" : (t = import.meta.env) == null ? void 0 : t.MODE;
344
- }
345
- const te = () => ee() !== "production", oe = 'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"';
346
- function ae(e, t = "") {
347
- const o = document.createElement(e);
348
- ce(o);
349
- const a = o.attachShadow({ mode: "open" });
350
- return a.innerHTML = ne(t), o;
351
- }
352
- const ne = (e) => `
353
- <style>
354
- *{font-family: ${oe};}
355
- </style>
356
-
357
- <style>
358
- ${e}
359
- </style>
360
- `, ce = (e) => {
361
- e.style.display = "flex", e.style.flexDirection = "column", e.style.width = "100%", e.style.maxWidth = _;
362
- };
363
- function ie(e, t, o) {
364
- const a = J(t), n = ae(o);
365
- re(n).appendChild(a), e.innerHTML = "", e.appendChild(n);
366
- const i = K(n);
367
- if (!(i instanceof HTMLElement))
368
- throw new Error("Fail to initialize widget: interactive area is not found");
369
- return { widgetInteractiveArea: i, webComponent: n };
370
- }
371
- const re = (e) => e.shadowRoot || e, g = {
372
- 0: "#fff",
373
- 100: "#f5f5f5",
374
- 200: "#eeeeee",
375
- 300: "#e0e0e0",
376
- 400: "#bdbdbd",
377
- 500: "#9e9e9e",
378
- 600: "#757575",
379
- 700: "#616161",
380
- 800: "#424242",
381
- 900: "#212121"
382
- }, m = 10, le = {
383
- palette: {
384
- mode: "light",
385
- primary: {
386
- main: "#487DFA",
387
- contrastText: "#fff"
388
- },
389
- background: {
390
- default: "#fff",
391
- contrastText: "#000"
392
- },
393
- border: g[400],
394
- error: {
395
- main: "#f44336"
396
- },
397
- logoFill: "#1d1d1b",
398
- grey: g
399
- },
400
- spacing: {
401
- unit: m,
402
- half: Math.floor(m / 2)
403
- },
404
- font: {
405
- fontFamily: 'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
406
- color: "#000"
407
- }
408
- }, se = {
409
- palette: {
410
- mode: "dark",
411
- primary: {
412
- main: "#487DFA",
413
- contrastText: "#fff"
414
- },
415
- background: {
416
- default: "#303030",
417
- contrastText: "#fff"
418
- },
419
- border: g[300],
420
- error: {
421
- main: "#f44336"
422
- },
423
- logoFill: "#fff",
424
- grey: g
425
- },
426
- spacing: {
427
- unit: m,
428
- half: Math.floor(m / 2)
429
- },
430
- font: {
431
- fontFamily: 'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
432
- color: "#fff"
433
- }
434
- };
435
- function R(e) {
436
- return Object.values(W).find((a) => a === v(e, 0).getAttribute("data-captcha-type")) || "frictionless";
437
- }
438
- const k = (e) => document.querySelector('script[src*="'.concat(e, '"]')), de = (e) => {
439
- const t = k(e);
440
- if (t && t.src.indexOf("".concat(e)) !== -1) {
441
- const o = new URLSearchParams(t.src.split("?")[1]);
442
- return {
443
- onloadUrlCallback: o.get("onload") || void 0,
444
- renderExplicit: o.get("render") || void 0
445
- };
446
- }
447
- return { onloadUrlCallback: void 0, renderExplicit: void 0 };
448
- };
449
- class pe {
450
- constructor(t) {
451
- this.widgetThemeResolver = t, this.captchaRenderer = null, this._i18n = null;
452
- }
453
- get i18n() {
454
- if (this._i18n === null)
455
- throw new Error("I18n is not initialized");
456
- return this._i18n;
457
- }
458
- async createWidgets(t, o, a = !0, n = !1) {
459
- return Promise.all(t.map((c) => {
460
- const i = M(c);
461
- return H(o, i, c), this.createWidget(c, o, i, a, n);
462
- }));
463
- }
464
- async createWidget(t, o, a, n = !0, c = !1) {
465
- o.theme = this.widgetThemeResolver.resolveWidgetTheme(t, o);
466
- const i = o.theme === "light" ? le : se;
467
- let s, p;
468
- if (c) {
469
- const r = document.createElement("div");
470
- t.appendChild(r), s = r, p = r;
471
- } else {
472
- const r = ie(t, i, "prosopo-procaptcha");
473
- s = r.widgetInteractiveArea, p = r.webComponent;
474
- }
475
- return (await this.getCaptchaRenderer()).renderCaptcha({
476
- identifierPrefix: "procaptcha-",
477
- emotionCacheKey: "procaptcha",
478
- webComponentTag: "prosopo-procaptcha",
479
- defaultCaptchaType: W.frictionless
480
- }, s, o, a, n, this.i18n, c, p);
481
- }
482
- async getCaptchaRenderer() {
483
- return this._i18n === null && (this._i18n = await $()), this.captchaRenderer === null && (this.captchaRenderer = await this.createCaptchaRenderer()), this.captchaRenderer;
484
- }
485
- async createCaptchaRenderer() {
486
- const t = (await import("./captchaRenderer-s4QuLEen.js")).CaptchaRenderer, o = (await import("./captchaComponentProvider-Cn75EmSH.js").then((a) => a.d)).CaptchaComponentProvider;
487
- return new t(new o());
488
- }
489
- }
490
- class he {
491
- constructor() {
492
- this.themesSet = /* @__PURE__ */ new Set(["light", "dark"]), this.defaultTheme = "light";
493
- }
494
- resolveWidgetTheme(t, o) {
495
- const a = o.theme || t.getAttribute("data-theme") || this.defaultTheme;
496
- return this.validateTheme(a);
497
- }
498
- validateTheme(t) {
499
- return this.themesSet.has(t) ? t : this.defaultTheme;
500
- }
501
- }
502
- const C = "procaptcha.bundle.js";
503
- let h = [];
504
- const b = new pe(new he()), fe = "procaptcha:execute", S = async () => {
505
- const e = Array.from(document.getElementsByClassName("procaptcha")).filter((o) => o.tagName.toLowerCase() !== "button");
506
- if (e.length) {
507
- const o = v(e, 0).getAttribute("data-sitekey"), a = v(e, 0).getAttribute("data-web3");
508
- if (!o) {
509
- console.error("No siteKey found");
510
- return;
511
- }
512
- const n = R(e), c = await b.createWidgets(e, {
513
- captchaType: n,
514
- siteKey: o
515
- }, a !== "true");
516
- h.push(...c);
517
- }
518
- const t = Array.from(document.getElementsByClassName("procaptcha")).filter((o) => o.tagName.toLowerCase() === "button");
519
- if (t.length)
520
- for (const o of t) {
521
- const a = o.getAttribute("data-sitekey") || "", n = o.getAttribute("data-callback") || "", c = R([o]), i = await b.createWidgets([o], {
522
- captchaType: c,
523
- siteKey: a,
524
- callback: n
525
- }, !0, !0);
526
- h.push(...i), o.addEventListener("click", async (s) => {
527
- s.preventDefault(), D();
528
- });
529
- }
530
- }, ue = async (e, t) => {
531
- const o = Object.prototype.hasOwnProperty.call(t, "size") && t.size === "invisible", a = !t.web3;
532
- if (o || e.tagName.toLowerCase() === "button") {
533
- const c = await b.createWidgets([e], t, a, !0);
534
- h.push(...c);
535
- return;
536
- }
537
- const n = await b.createWidgets([e], t, a, !1);
538
- h.push(...n);
539
- };
540
- function f(e) {
541
- document && document.readyState !== "loading" ? e() : document.addEventListener("DOMContentLoaded", () => {
542
- e();
543
- });
544
- }
545
- const D = () => {
546
- var e;
547
- const t = ge();
548
- if (t.length === 0) {
549
- console.error("No Procaptcha containers found for execution");
550
- return;
551
- }
552
- const o = new CustomEvent(fe, {
553
- detail: {
554
- containerId: ((e = t[0]) == null ? void 0 : e.id) || "procaptcha-container",
555
- containerCount: t.length,
556
- timestamp: Date.now()
557
- },
558
- bubbles: !0,
559
- cancelable: !0
560
- });
561
- document.dispatchEvent(o);
562
- };
563
- function ge() {
564
- const e = [], t = Array.from(document.querySelectorAll('[data-size="invisible"]'));
565
- e.push(...t);
566
- const o = Array.from(document.querySelectorAll('#procaptcha-container, [id$="-procaptcha-container"]')), a = Array.from(document.getElementsByClassName("p-procaptcha"));
567
- e.push(...a);
568
- for (const n of o)
569
- e.includes(n) || e.push(n);
570
- return e;
571
- }
572
- const L = () => {
573
- var e, t;
574
- const { onloadUrlCallback: o, renderExplicit: a } = de(C);
575
- let n = !1;
576
- if (a !== "explicit" && ((e = k(C)) == null || e.addEventListener("load", () => {
577
- f(S), n = !0;
578
- }), document.readyState === "complete" && !n && f(S)), o && ((t = k(C)) == null || t.addEventListener("load", () => {
579
- const c = u(o);
580
- f(c);
581
- }), document.readyState === "complete" && !n)) {
582
- const c = u(o);
583
- f(c);
584
- }
585
- }, me = () => {
586
- for (const e of h)
587
- e.unmount();
588
- h = [], L();
589
- };
590
- window.procaptcha = { ready: f, render: ue, reset: me, execute: D };
591
- L();
592
- export {
593
- E as W,
594
- f as a,
595
- me as b,
596
- se as d,
597
- D as e,
598
- M as g,
599
- le as l,
600
- ue as r
601
- };
@@ -1,16 +0,0 @@
1
- import type { ProcaptchaRenderOptions } from "@prosopo/types";
2
- export declare const render: (element: Element, renderOptions: ProcaptchaRenderOptions) => Promise<void>;
3
- export default function ready(fn: () => void): void;
4
- export declare const execute: () => void;
5
- declare global {
6
- interface Window {
7
- procaptcha: {
8
- ready: typeof ready;
9
- render: typeof render;
10
- reset: typeof reset;
11
- execute: typeof execute;
12
- };
13
- }
14
- }
15
- export declare const reset: () => void;
16
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAiF9D,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"}
@@ -1,57 +0,0 @@
1
- {
2
- "GENERAL": {
3
- "MISSING_SECRET_KEY": "مفتاح سري مفقود",
4
- "CANT_FIND_KEYRINGPAIR": "تعذر العثور على مفتاح Keyringpair لـ {{address}}",
5
- "SITE_KEY_MISSING": "مفتاح الموقع مفقود",
6
- "ACCOUNT_NOT_FOUND": "الحساب غير موجود"
7
- },
8
- "API": {
9
- "BAD_REQUEST": "طلب غير صالح",
10
- "UNKNOWN": "خطأ API غير معروف",
11
- "INVALID_IP": "IP غير صالح",
12
- "INVALID_BODY": "بيانات غير صالحة"
13
- },
14
- "ACCOUNT": {
15
- "NO_POLKADOT_EXTENSION": "لم يتم العثور على امتداد بولكادوت"
16
- },
17
- "WIDGET": {
18
- "SELECT_ALL": "تحديد الكل الذي يحتوي على ما يلي",
19
- "IF_NONE_CLICK_NEXT": "إذا لم يكن هناك أي شيء، انقر على التالي",
20
- "NEXT": "التالي",
21
- "SUBMIT": "إرسال",
22
- "CANCEL": "إلغاء",
23
- "I_AM_HUMAN": "أنا إنسان",
24
- "NO_ACCOUNTS_FOUND": "لم يتم العثور على حسابات",
25
- "ACCOUNT_NOT_FOUND": "حساب غير موجود",
26
- "NO_EXTENSION_FOUND": "لم يتم العثور على امتداد"
27
- },
28
- "CONFIG": {
29
- "UNKNOWN_ENVIRONMENT": "البيئة المطلوبة غير معروفة"
30
- },
31
- "DATASET": {
32
- "DATASET_PARSE_ERROR": "خطأ في تحليل مجموعة البيانات",
33
- "SOLUTION_PARSE_ERROR": "خطأ في تحليل مجموعة البيانات",
34
- "HASH_ERROR": "خطأ في تجزئة مجموعة البيانات",
35
- "MERKLE_ERROR": "خطأ في إنشاء شجرة ميركل"
36
- },
37
- "DATABASE": {
38
- "IMAGE_GET_FAILED": "فشل الحصول على الصورة"
39
- },
40
- "CAPTCHA": {
41
- "INVALID_CAPTCHA_ID": "معرف كلمة التحقق غير صالح",
42
- "INVALID_ITEM_FORMAT": "الأنواع المسموح بها هي الصورة ونوع العنصر النصي فقط",
43
- "INVALID_SOLUTION_TYPE": "نوع الحل غير صالح",
44
- "INVALID_ITEM_HASH": "تجزئة العنصر غير صالحة",
45
- "ID_MISMATCH": "عدم تطابق معرف التحقق",
46
- "MISSING_ITEM_HASH": "مفقود هاش العنصر",
47
- "INVALID_CAPTCHA_CHALLENGE": "التحدي غير صالح",
48
- "NO_CAPTCHA": "لم يتم العثور على captcha",
49
- "NO_SESSION_FOUND": "لم يتم العثور على جلسة",
50
- "INVALID_TOKEN": "الرمز غير صالح",
51
- "INVALID_SOLUTION": "الحل غير صالح"
52
- },
53
- "DEVELOPER": {
54
- "PROVIDER_NO_CAPTCHA": "لم يتم إرجاع captchas من مزود",
55
- "GENERAL": "خطأ تطوير عام، انظر السياق"
56
- }
57
- }