@prosopo/procaptcha-bundle 2.6.12 → 3.0.5

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 (117) hide show
  1. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.d.ts.map +1 -1
  2. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.js +3 -2
  3. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/index.js.map +1 -1
  4. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
  5. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js +4 -0
  6. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentProvider.js.map +1 -1
  7. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts +1 -1
  8. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +1 -1
  9. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
  10. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js +1 -1
  11. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/captcha/captchaRenderer.js.map +1 -1
  12. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.d.ts +1 -1
  13. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.d.ts.map +1 -1
  14. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.js +2 -2
  15. package/.rollup.cache/home/runner/work/captcha/captcha/packages/procaptcha-bundle/dist/bundle/util/configCreator.js.map +1 -1
  16. package/CHANGELOG.md +132 -0
  17. package/dist/bundle/ProcaptchaWidget-BpzncYOb.js +612 -0
  18. package/dist/bundle/ProcaptchaWidget-D961oZ27.js +148 -0
  19. package/dist/bundle/bnChunk-DRlDxTFg.js +1137 -0
  20. package/dist/bundle/{browser-ponyfill-Bctlk3uB.js → browser-ponyfill-CvzSbL_o.js} +31 -30
  21. package/dist/bundle/builder-CQlqPNRd.js +37 -0
  22. package/dist/bundle/captchaComponentProvider-Dw6ydLe3.js +802 -0
  23. package/dist/bundle/{captchaRenderer-BAMErqQN.js → captchaRenderer-CY8KuZK-.js} +22 -22
  24. package/dist/bundle/commonChunk-24zMb_mF.js +189 -0
  25. package/dist/bundle/emotion-element-5486c51c.browser.esm-PRDDgd_k.js +918 -0
  26. package/dist/bundle/{fp.esm-DYWeNGcH.js → fp.esm-BADUiinQ.js} +548 -648
  27. package/dist/bundle/index-BRg_gWPo.js +1328 -0
  28. package/dist/bundle/{index-ByKGlSkE.js → index-BzOMq-ud.js} +2 -2
  29. package/dist/bundle/{index-1qH2dz7u.js → index-DqwVRCwA.js} +166 -199
  30. package/dist/bundle/index.d.ts.map +1 -1
  31. package/dist/bundle/locales/ar/translation.json +4 -3
  32. package/dist/bundle/locales/az/translation.json +4 -3
  33. package/dist/bundle/locales/cs/translation.json +4 -3
  34. package/dist/bundle/locales/de/translation.json +4 -3
  35. package/dist/bundle/locales/el/translation.json +4 -3
  36. package/dist/bundle/locales/en/translation.json +4 -3
  37. package/dist/bundle/locales/es/translation.json +4 -3
  38. package/dist/bundle/locales/fi/translation.json +4 -3
  39. package/dist/bundle/locales/fr/translation.json +4 -3
  40. package/dist/bundle/locales/hi/translation.json +4 -3
  41. package/dist/bundle/locales/hu/translation.json +4 -3
  42. package/dist/bundle/locales/id/translation.json +4 -3
  43. package/dist/bundle/locales/it/translation.json +4 -3
  44. package/dist/bundle/locales/ja/translation.json +4 -3
  45. package/dist/bundle/locales/jv/translation.json +4 -3
  46. package/dist/bundle/locales/ko/translation.json +4 -3
  47. package/dist/bundle/locales/ml/translation.json +4 -3
  48. package/dist/bundle/locales/ms/translation.json +4 -3
  49. package/dist/bundle/locales/nl/translation.json +4 -3
  50. package/dist/bundle/locales/no/translation.json +4 -3
  51. package/dist/bundle/locales/pl/translation.json +4 -3
  52. package/dist/bundle/locales/pt/translation.json +4 -3
  53. package/dist/bundle/locales/{pt-br → pt-BR}/translation.json +4 -3
  54. package/dist/bundle/locales/ro/translation.json +4 -3
  55. package/dist/bundle/locales/ru/translation.json +4 -3
  56. package/dist/bundle/locales/sr/translation.json +4 -3
  57. package/dist/bundle/locales/sv/translation.json +4 -3
  58. package/dist/bundle/locales/th/translation.json +4 -3
  59. package/dist/bundle/locales/tr/translation.json +4 -3
  60. package/dist/bundle/locales/uk/translation.json +4 -3
  61. package/dist/bundle/locales/vi/translation.json +4 -3
  62. package/dist/bundle/locales/{zh-cn → zh-CN}/translation.json +4 -3
  63. package/dist/bundle/nobleChunk-Xl5XLrx3.js +3635 -0
  64. package/dist/bundle/procaptcha.bundle.js +6 -5
  65. package/dist/bundle/util/captcha/captchaComponentProvider.d.ts.map +1 -1
  66. package/dist/bundle/util/captcha/captchaComponentsList.d.ts +1 -1
  67. package/dist/bundle/util/captcha/captchaComponentsList.d.ts.map +1 -1
  68. package/dist/bundle/util/captcha/captchaRenderer.d.ts.map +1 -1
  69. package/dist/bundle/util/configCreator.d.ts +1 -1
  70. package/dist/bundle/util/configCreator.d.ts.map +1 -1
  71. package/dist/bundle/utilChunk-sqstc6C5.js +317 -0
  72. package/dist/bundle/utilCryptoChunk-CIPUtfoO.js +1256 -0
  73. package/dist/bundle/web2Chunk-7Vd8yt2r.js +3711 -0
  74. package/dist/bundle/{hash-CrwduMDb.js → web3Chunk-DrUvbVNW.js} +257 -695
  75. package/dist/bundle/{translations-DEL070wJ.js → zodChunk-wTu9ZHzV.js} +46 -82
  76. package/dist/cjs/index.cjs +8 -2
  77. package/dist/cjs/util/captcha/captchaComponentProvider.cjs +4 -0
  78. package/dist/cjs/util/captcha/captchaRenderer.cjs +2 -1
  79. package/dist/cjs/util/configCreator.cjs +2 -2
  80. package/dist/index.d.ts.map +1 -1
  81. package/dist/index.js +3 -2
  82. package/dist/index.js.map +1 -1
  83. package/dist/util/captcha/captchaComponentProvider.d.ts +1 -1
  84. package/dist/util/captcha/captchaComponentProvider.d.ts.map +1 -1
  85. package/dist/util/captcha/captchaComponentProvider.js +4 -0
  86. package/dist/util/captcha/captchaComponentProvider.js.map +1 -1
  87. package/dist/util/captcha/captchaComponentsList.d.ts +1 -1
  88. package/dist/util/captcha/captchaComponentsList.d.ts.map +1 -1
  89. package/dist/util/captcha/captchaRenderer.d.ts.map +1 -1
  90. package/dist/util/captcha/captchaRenderer.js +1 -1
  91. package/dist/util/captcha/captchaRenderer.js.map +1 -1
  92. package/dist/util/configCreator.d.ts +1 -1
  93. package/dist/util/configCreator.d.ts.map +1 -1
  94. package/dist/util/configCreator.js +2 -2
  95. package/dist/util/configCreator.js.map +1 -1
  96. package/package.json +21 -14
  97. package/stats.html +1 -1
  98. package/vite.config.ts +47 -4
  99. package/vite.serve.config.ts +2 -0
  100. package/vite.test.config.ts +1 -1
  101. package/webpack.config.cjs +5 -0
  102. package/dist/bundle/ProcaptchaWidget-DPyDGPiI.js +0 -156
  103. package/dist/bundle/ProcaptchaWidget-DoqUlwHS.js +0 -636
  104. package/dist/bundle/_commonjsHelpers-DaMA6jEr.js +0 -8
  105. package/dist/bundle/asU8a-BixKX-w0.js +0 -9
  106. package/dist/bundle/bip39-D7YSihxf.js +0 -260
  107. package/dist/bundle/captchaComponentProvider-BL18T1UE.js +0 -1242
  108. package/dist/bundle/emotion-element-5486c51c.browser.esm-Bjt1gs1F.js +0 -1807
  109. package/dist/bundle/i18nFrontend-DCv3P9jv.js +0 -2273
  110. package/dist/bundle/index-BeN3et18.js +0 -4844
  111. package/dist/bundle/index-BjRdPnnE.js +0 -1198
  112. package/dist/bundle/index-CBquknc2.js +0 -81
  113. package/dist/bundle/index-QVME9Prx.js +0 -32
  114. package/dist/bundle/sha256-CGE_4eEY.js +0 -171
  115. package/dist/bundle/spread-DEmVz7RJ.js +0 -15
  116. package/dist/bundle/toU8a-CPMbkkSw.js +0 -109
  117. package/dist/bundle/useTranslation-BJsfZyOx.js +0 -158
@@ -1,5 +1,5 @@
1
- import { g as Dc } from "./_commonjsHelpers-DaMA6jEr.js";
2
- import { r as _a } from "./emotion-element-5486c51c.browser.esm-Bjt1gs1F.js";
1
+ import { g as Dc } from "./bnChunk-DRlDxTFg.js";
2
+ import { r as _a } from "./web2Chunk-7Vd8yt2r.js";
3
3
  var Co = { exports: {} }, ve = {}, xo = { exports: {} }, _o = {};
4
4
  (function(e) {
5
5
  function t(C, z) {
@@ -1,58 +1,28 @@
1
- function k(e, t, o) {
2
- if (e.length === 0)
3
- throw new Error("Array is empty");
4
- if (!Number.isFinite(t))
5
- throw new Error(`Index ${t} is not a finite number`);
6
- if (t > 0 ? t = t % e.length : t = Math.ceil(Math.abs(t) / e.length) * e.length + t, t >= e.length)
7
- throw new Error(`Index ${t} larger than array length ${e.length}`);
8
- if (t < 0)
9
- throw new Error(`Index ${t} smaller than 0`);
10
- return e[t];
11
- }
12
- var p;
13
- (function(e) {
14
- e.datasetId = "datasetId", e.user = "user", e.dapp = "dapp", e.provider = "provider", e.blockNumber = "blockNumber", e.requestHash = "requestHash", e.captchas = "captchas", e.commitmentId = "commitmentId", e.proof = "proof", e.dappSignature = "dappSignature", e.dappUserSignature = "dappUserSignature", e.providerUrl = "providerUrl", e.procaptchaResponse = "procaptcha-response", e.verifiedTimeout = "verifiedTimeout", e.maxVerifiedTime = "maxVerifiedTime", e.verified = "verified", e.status = "status", e.challenge = "challenge", e.difficulty = "difficulty", e.nonce = "nonce", e.timeouts = "timeouts", e.token = "token", e.secret = "secret", e.timestamp = "timestamp", e.signature = "signature", e.error = "error", e.siteKey = "siteKey", e.captchaType = "captchaType", e.sessionId = "sessionId", e.settings = "settings", e.domains = "domains", e.frictionlessThreshold = "frictionlessThreshold", e.powDifficulty = "powDifficulty", e.score = "score", e.tier = "tier", e.detectorKey = "detectorKey", e.ip = "ip";
15
- })(p || (p = {}));
16
- var g;
17
- (function(e) {
18
- e.image = "image", e.pow = "pow", e.frictionless = "frictionless";
19
- })(g || (g = {}));
20
- let C;
21
- async function M(e) {
22
- return new Promise((t, o) => {
23
- try {
24
- import("./i18nFrontend-DCv3P9jv.js").then((n) => n.b).then(({ default: n }) => {
25
- C || (C = n()), t(C);
26
- });
27
- } catch (n) {
28
- o(n);
29
- }
30
- });
31
- }
32
- function H(e) {
1
+ import { A, C as W, a as _, l as $ } from "./web2Chunk-7Vd8yt2r.js";
2
+ function N(e) {
33
3
  const t = e.getRootNode();
34
4
  return (t instanceof ShadowRoot ? t.host : e).closest("form");
35
5
  }
36
- const r = () => {
37
- Array.from(document.getElementsByName(p.procaptchaResponse)).map((t) => t.remove());
38
- }, m = (e) => {
6
+ const l = () => {
7
+ Array.from(document.getElementsByName(A.procaptchaResponse)).map((t) => t.remove());
8
+ }, u = (e) => {
39
9
  const t = window[e.replace("window.", "")];
40
10
  if (typeof t != "function")
41
11
  throw new Error(`Callback ${e} is not defined on the window object`);
42
12
  return t;
43
- }, U = (e) => ({
44
- onHuman: (t) => $(t, e),
13
+ }, M = (e) => ({
14
+ onHuman: (t) => I(t, e),
45
15
  onChallengeExpired: () => {
46
- r();
16
+ l();
47
17
  },
48
18
  onExtensionNotFound: () => {
49
19
  console.error("Extension not found");
50
20
  },
51
21
  onExpired: () => {
52
- r();
22
+ l();
53
23
  },
54
24
  onError: (t) => {
55
- r(), console.error(t);
25
+ l(), console.error(t);
56
26
  },
57
27
  onClose: () => {
58
28
  },
@@ -62,82 +32,82 @@ const r = () => {
62
32
  alert("Captcha challenge failed. Please try again");
63
33
  },
64
34
  onReset: () => {
65
- r();
35
+ l();
66
36
  },
67
37
  onReload: () => {
68
38
  }
69
39
  }), s = (e, t, o) => {
70
- const n = t.getAttribute(`data-${e}`);
71
- if (n) {
72
- const a = m(n);
73
- if (a)
74
- return a;
40
+ const a = t.getAttribute(`data-${e}`);
41
+ if (a) {
42
+ const n = u(a);
43
+ if (n)
44
+ return n;
75
45
  }
76
46
  if (typeof o == "function")
77
47
  return o;
78
48
  if (typeof o == "string")
79
- return m(o);
49
+ return u(o);
80
50
  };
81
- function F(e, t, o) {
82
- const n = s("callback", o, e == null ? void 0 : e.callback);
83
- n && (t.onHuman = (u) => {
84
- $(u, o), n(u);
51
+ function H(e, t, o) {
52
+ const a = s("callback", o, e == null ? void 0 : e.callback);
53
+ a && (t.onHuman = (f) => {
54
+ I(f, o), a(f);
85
55
  });
86
- const a = s("chalexpired-callback", o, e == null ? void 0 : e["chalexpired-callback"]);
87
- a && (t.onChallengeExpired = () => {
88
- r(), a();
56
+ const n = s("chalexpired-callback", o, e == null ? void 0 : e["chalexpired-callback"]);
57
+ n && (t.onChallengeExpired = () => {
58
+ l(), n();
89
59
  });
90
60
  const c = s("expired-callback", o, e == null ? void 0 : e["expired-callback"]);
91
61
  c && (t.onExpired = () => {
92
- r(), c();
62
+ l(), c();
93
63
  });
94
64
  const i = s("error-callback", o, e == null ? void 0 : e["error-callback"]);
95
- i && (t.onError = (u) => {
96
- r(), i(u);
65
+ i && (t.onError = (f) => {
66
+ l(), i(f);
97
67
  });
98
- const l = s("close-callback", o, e == null ? void 0 : e["close-callback"]);
99
- l && (t.onClose = () => {
100
- l();
68
+ const r = s("close-callback", o, e == null ? void 0 : e["close-callback"]);
69
+ r && (t.onClose = () => {
70
+ r();
101
71
  });
102
- const x = s("open-callback", o, e == null ? void 0 : e["open-callback"]);
103
- x && (t.onOpen = () => {
104
- x();
72
+ const y = s("open-callback", o, e == null ? void 0 : e["open-callback"]);
73
+ y && (t.onOpen = () => {
74
+ y();
105
75
  });
106
- const v = s("failed-callback", o, e == null ? void 0 : e["failed-callback"]);
107
- v && (t.onFailed = () => {
108
- v();
76
+ const w = s("failed-callback", o, e == null ? void 0 : e["failed-callback"]);
77
+ w && (t.onFailed = () => {
78
+ w();
109
79
  });
110
80
  const h = s("reset-callback", o, e == null ? void 0 : e["reset-callback"]);
111
81
  h && (t.onReset = () => {
112
- r(), h();
82
+ l(), h();
113
83
  });
114
84
  }
115
- const $ = (e, t) => {
116
- if (r(), t) {
117
- const o = H(t);
85
+ const I = (e, t) => {
86
+ if (l(), t) {
87
+ const o = N(t);
118
88
  if (!o) {
119
89
  console.error("Parent form not found for the element:", t);
120
90
  return;
121
91
  }
122
- const n = document.createElement("input");
123
- n.type = "hidden", n.name = p.procaptchaResponse, n.value = e, o.appendChild(n);
92
+ const a = document.createElement("input");
93
+ a.type = "hidden", a.name = A.procaptchaResponse, a.value = e, o.appendChild(a);
124
94
  }
125
- }, G = "https://prosopo.io", I = "Visit prosopo.io to learn more about the service and its accessibility options.", j = 74, _ = 80, z = "80px", T = "302px", B = "8px", K = "2px", q = "1px solid", S = "checkbox__loading-spinner";
126
- function A(e) {
95
+ }, P = "https://prosopo.io", T = "Visit prosopo.io to learn more about the service and its accessibility options.", U = 74, x = 80, F = "80px", v = "302px", G = "8px", j = "2px", z = "1px solid", E = "checkbox__loading-spinner";
96
+ function B(e) {
127
97
  const t = document.createElement("div");
128
- return t.className = "checkbox", t.innerHTML = Y(e) + X, t;
98
+ return t.className = "checkbox", t.innerHTML = X(e) + q, t;
129
99
  }
130
- const V = (e) => (e.shadowRoot || e).querySelector(".checkbox__content"), X = `
100
+ const K = (e) => (e.shadowRoot || e).querySelector(".checkbox__content"), q = `
131
101
  <div class="checkbox__outer">
132
102
  <div class="checkbox__wrapper">
133
103
  <div class="checkbox__inner">
134
104
  <div class="checkbox__content">
135
- <div class="${S}" aria-label="Loading spinner"></div>
105
+ <div class="${E}" aria-label="Loading spinner"></div>
136
106
  </div>
137
107
  </div>
138
108
  </div>
139
109
  </div>
140
- `, Y = (e) => `
110
+ `, X = (e) => `
141
111
  <style>
142
112
  .checkbox {
143
113
  display: flex;
@@ -165,7 +135,7 @@ const V = (e) => (e.shadowRoot || e).querySelector(".checkbox__content"), X = `
165
135
  display: inline-flex;
166
136
  }
167
137
 
168
- .${S} {
138
+ .${E} {
169
139
  margin-top: 0;
170
140
  margin-left: 15px;
171
141
  margin-right: 15px;
@@ -180,7 +150,7 @@ const V = (e) => (e.shadowRoot || e).querySelector(".checkbox__content"), X = `
180
150
  will-change: transform;
181
151
  }
182
152
 
183
- @keyframes ${S}-rotation {
153
+ @keyframes ${E}-rotation {
184
154
  0% {
185
155
  transform: rotate(0deg);
186
156
  }
@@ -190,11 +160,11 @@ const V = (e) => (e.shadowRoot || e).querySelector(".checkbox__content"), X = `
190
160
  }
191
161
  </style>
192
162
  `;
193
- function Z(e) {
163
+ function V(e) {
194
164
  const t = document.createElement("div");
195
- return t.className = "logo", t.innerHTML = J + Q(e), t;
165
+ return t.className = "logo", t.innerHTML = Y + Z(e), t;
196
166
  }
197
- const J = `
167
+ const Y = `
198
168
  <style>
199
169
  .logo {
200
170
  display: inline-flex;
@@ -228,15 +198,15 @@ const J = `
228
198
 
229
199
  </style>
230
200
  `;
231
- function Q(e) {
201
+ function Z(e) {
232
202
  return `
233
- <a href="${G}?utm_campaign=widget" tabindex="0" target="_blank" role="button"
234
- aria-label="${I}"
203
+ <a href="${P}?utm_campaign=widget" tabindex="0" target="_blank" role="button"
204
+ aria-label="${T}"
235
205
  style="text-decoration: none;">
236
206
  <div class="prosopo-logo">
237
207
  <svg id="logo" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 49.010001 49.009997" style="fill: ${e.palette.logoFill};"
238
208
  aria-label="Prosopo Logo With Text">
239
- <title>${I}</title>
209
+ <title>${T}</title>
240
210
  <g transform="matrix(0.11319331,0,0,0.11319331,6.504999,-2.2052113e-4)">
241
211
  <g>
242
212
  <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>
@@ -253,14 +223,14 @@ function Q(e) {
253
223
  </a>
254
224
  `;
255
225
  }
256
- function P(e) {
257
- var a, c;
226
+ function J(e) {
227
+ var n, c;
258
228
  const t = document.createElement("div");
259
229
  t.className = "widget";
260
- const o = A(e), n = Z(e);
261
- return t.innerHTML = ee(e) + O(oe()), (a = t.querySelector(".widget__checkbox")) == null || a.replaceWith(o), (c = t.querySelector(".widget__logo")) == null || c.replaceWith(n), t;
230
+ const o = B(e), a = V(e);
231
+ 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;
262
232
  }
263
- function O(e) {
233
+ function Q(e) {
264
234
  return `
265
235
  <div class="widget__outer">
266
236
  <div class="widget__wrapper">
@@ -276,16 +246,16 @@ function O(e) {
276
246
  </div>
277
247
  `;
278
248
  }
279
- function ee(e) {
249
+ function O(e) {
280
250
  return `
281
251
  <style>
282
252
  .widget {
283
253
  width: 100%;
284
- min-height: ${z}
254
+ min-height: ${F}
285
255
  }
286
256
 
287
257
  .widget__outer {
288
- max-width: ${T};
258
+ max-width: ${v};
289
259
  min-height: 100%;
290
260
  overflow-x: auto;
291
261
  width: 100%;
@@ -298,7 +268,7 @@ function ee(e) {
298
268
  container-name: widget;
299
269
  display: flex;
300
270
  flex-direction: column;
301
- height: ${_}px;
271
+ height: ${x}px;
302
272
  min-width: 220px;
303
273
  }
304
274
 
@@ -306,63 +276,63 @@ function ee(e) {
306
276
  max-height: 100%;
307
277
  min-width: 100%;
308
278
  overflow: hidden;
309
- height: ${_}px;
279
+ height: ${x}px;
310
280
  width: 100%;
311
281
  display: grid;
312
282
  }
313
283
 
314
284
  .widget__dimensions {
315
- max-width: ${T};
316
- min-height: ${_}px;
285
+ max-width: ${v};
286
+ min-height: ${x}px;
317
287
  }
318
288
 
319
289
  .widget__content {
320
- padding: ${K};
321
- border: ${q};
290
+ padding: ${j};
291
+ border: ${z};
322
292
  background-color: ${e.palette.background.default};
323
293
  border-color: ${e.palette.grey[300]};
324
- border-radius: ${B};
294
+ border-radius: ${G};
325
295
  display: flex;
326
296
  align-items: center;
327
297
  flex-wrap: wrap;
328
298
  justify-content: space-between;
329
- min-height: ${j}px;
299
+ min-height: ${U}px;
330
300
  overflow: hidden;
331
301
  }
332
302
  </style>
333
303
  `;
334
304
  }
335
- function te() {
305
+ function ee() {
336
306
  var t;
337
307
  return typeof process < "u" ? "production" : (t = import.meta.env) == null ? void 0 : t.MODE;
338
308
  }
339
- const oe = () => te() !== "production", ne = 'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"';
309
+ const te = () => ee() !== "production", oe = 'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"';
340
310
  function ae(e, t = "") {
341
311
  const o = document.createElement(e);
342
- ie(o);
343
- const n = o.attachShadow({ mode: "open" });
344
- return n.innerHTML = ce(t), o;
312
+ ce(o);
313
+ const a = o.attachShadow({ mode: "open" });
314
+ return a.innerHTML = ne(t), o;
345
315
  }
346
- const ce = (e) => `
316
+ const ne = (e) => `
347
317
  <style>
348
- *{font-family: ${ne};}
318
+ *{font-family: ${oe};}
349
319
  </style>
350
320
 
351
321
  <style>
352
322
  ${e}
353
323
  </style>
354
- `, ie = (e) => {
355
- e.style.display = "flex", e.style.flexDirection = "column", e.style.width = "100%", e.style.maxWidth = T;
324
+ `, ce = (e) => {
325
+ e.style.display = "flex", e.style.flexDirection = "column", e.style.width = "100%", e.style.maxWidth = v;
356
326
  };
357
- function re(e, t, o) {
358
- const n = P(t), a = ae(o);
359
- le(a).appendChild(n), e.innerHTML = "", e.appendChild(a);
360
- const i = V(a);
327
+ function ie(e, t, o) {
328
+ const a = J(t), n = ae(o);
329
+ le(n).appendChild(a), e.innerHTML = "", e.appendChild(n);
330
+ const i = K(n);
361
331
  if (!(i instanceof HTMLElement))
362
332
  throw new Error("Fail to initialize widget: interactive area is not found");
363
333
  return i;
364
334
  }
365
- const le = (e) => e.shadowRoot || e, b = {
335
+ const le = (e) => e.shadowRoot || e, g = {
366
336
  0: "#fff",
367
337
  100: "#f5f5f5",
368
338
  200: "#eeeeee",
@@ -373,7 +343,7 @@ const le = (e) => e.shadowRoot || e, b = {
373
343
  700: "#616161",
374
344
  800: "#424242",
375
345
  900: "#212121"
376
- }, y = 10, se = {
346
+ }, m = 10, re = {
377
347
  palette: {
378
348
  mode: "light",
379
349
  primary: {
@@ -384,22 +354,22 @@ const le = (e) => e.shadowRoot || e, b = {
384
354
  default: "#fff",
385
355
  contrastText: "#000"
386
356
  },
387
- border: b[400],
357
+ border: g[400],
388
358
  error: {
389
359
  main: "#f44336"
390
360
  },
391
361
  logoFill: "#1d1d1b",
392
- grey: b
362
+ grey: g
393
363
  },
394
364
  spacing: {
395
- unit: y,
396
- half: Math.floor(y / 2)
365
+ unit: m,
366
+ half: Math.floor(m / 2)
397
367
  },
398
368
  font: {
399
369
  fontFamily: 'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
400
370
  color: "#000"
401
371
  }
402
- }, de = {
372
+ }, se = {
403
373
  palette: {
404
374
  mode: "dark",
405
375
  primary: {
@@ -410,27 +380,27 @@ const le = (e) => e.shadowRoot || e, b = {
410
380
  default: "#303030",
411
381
  contrastText: "#fff"
412
382
  },
413
- border: b[300],
383
+ border: g[300],
414
384
  error: {
415
385
  main: "#f44336"
416
386
  },
417
387
  logoFill: "#fff",
418
- grey: b
388
+ grey: g
419
389
  },
420
390
  spacing: {
421
- unit: y,
422
- half: Math.floor(y / 2)
391
+ unit: m,
392
+ half: Math.floor(m / 2)
423
393
  },
424
394
  font: {
425
395
  fontFamily: 'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
426
396
  color: "#fff"
427
397
  }
428
398
  };
429
- function W(e) {
430
- return Object.values(g).find((n) => n === k(e, 0).getAttribute("data-captcha-type")) || "frictionless";
399
+ function R(e) {
400
+ return Object.values(W).find((a) => a === _(e, 0).getAttribute("data-captcha-type")) || "frictionless";
431
401
  }
432
- const R = (e) => document.querySelector('script[src*="'.concat(e, '"]')), he = (e) => {
433
- const t = R(e);
402
+ const k = (e) => document.querySelector('script[src*="'.concat(e, '"]')), de = (e) => {
403
+ const t = k(e);
434
404
  if (t && t.src.indexOf("".concat(e)) !== -1) {
435
405
  const o = new URLSearchParams(t.src.split("?")[1]);
436
406
  return {
@@ -440,7 +410,7 @@ const R = (e) => document.querySelector('script[src*="'.concat(e, '"]')), he = (
440
410
  }
441
411
  return { onloadUrlCallback: void 0, renderExplicit: void 0 };
442
412
  };
443
- class fe {
413
+ class he {
444
414
  constructor(t) {
445
415
  this.widgetThemeResolver = t, this.captchaRenderer = null, this._i18n = null;
446
416
  }
@@ -449,98 +419,99 @@ class fe {
449
419
  throw new Error("I18n is not initialized");
450
420
  return this._i18n;
451
421
  }
452
- async createWidgets(t, o, n = !0, a = !1) {
422
+ async createWidgets(t, o, a = !0, n = !1) {
453
423
  return Promise.all(t.map((c) => {
454
- const i = U(c);
455
- return F(o, i, c), this.createWidget(c, o, i, n, a);
424
+ const i = M(c);
425
+ return H(o, i, c), this.createWidget(c, o, i, a, n);
456
426
  }));
457
427
  }
458
- async createWidget(t, o, n, a = !0, c = !1) {
428
+ async createWidget(t, o, a, n = !0, c = !1) {
459
429
  o.theme = this.widgetThemeResolver.resolveWidgetTheme(t, o);
460
- const i = o.theme === "light" ? se : de;
461
- let l;
430
+ const i = o.theme === "light" ? re : se;
431
+ let r;
462
432
  if (c) {
463
433
  const h = document.createElement("div");
464
- t.appendChild(h), l = h;
434
+ t.appendChild(h), r = h;
465
435
  } else
466
- l = re(t, i, "prosopo-procaptcha");
436
+ r = ie(t, i, "prosopo-procaptcha");
467
437
  return (await this.getCaptchaRenderer()).renderCaptcha({
468
438
  identifierPrefix: "procaptcha-",
469
439
  emotionCacheKey: "procaptcha",
470
440
  webComponentTag: "prosopo-procaptcha",
471
- defaultCaptchaType: g.frictionless
472
- }, l, o, n, a, this.i18n, c);
441
+ defaultCaptchaType: W.frictionless
442
+ }, r, o, a, n, this.i18n, c);
473
443
  }
474
444
  async getCaptchaRenderer() {
475
- return this._i18n === null && (this._i18n = await M()), this.captchaRenderer === null && (this.captchaRenderer = await this.createCaptchaRenderer()), this.captchaRenderer;
445
+ return this._i18n === null && (this._i18n = await $()), this.captchaRenderer === null && (this.captchaRenderer = await this.createCaptchaRenderer()), this.captchaRenderer;
476
446
  }
477
447
  async createCaptchaRenderer() {
478
- const t = (await import("./captchaRenderer-BAMErqQN.js")).CaptchaRenderer, o = (await import("./captchaComponentProvider-BL18T1UE.js").then((n) => n.h)).CaptchaComponentProvider;
448
+ const t = (await import("./captchaRenderer-CY8KuZK-.js")).CaptchaRenderer, o = (await import("./captchaComponentProvider-Dw6ydLe3.js").then((a) => a.d)).CaptchaComponentProvider;
479
449
  return new t(new o());
480
450
  }
481
451
  }
482
- class ue {
452
+ class pe {
483
453
  constructor() {
484
454
  this.themesSet = /* @__PURE__ */ new Set(["light", "dark"]), this.defaultTheme = "light";
485
455
  }
486
456
  resolveWidgetTheme(t, o) {
487
- const n = o.theme || t.getAttribute("data-theme") || this.defaultTheme;
488
- return this.validateTheme(n);
457
+ const a = o.theme || t.getAttribute("data-theme") || this.defaultTheme;
458
+ return this.validateTheme(a);
489
459
  }
490
460
  validateTheme(t) {
491
461
  return this.themesSet.has(t) ? t : this.defaultTheme;
492
462
  }
493
463
  }
494
- const E = "procaptcha.bundle.js";
464
+ const C = "procaptcha.bundle.js";
495
465
  let d = [];
496
- const w = new fe(new ue()), pe = "procaptcha:execute", D = async () => {
466
+ const b = new he(new pe()), fe = "procaptcha:execute", S = async () => {
497
467
  const e = Array.from(document.getElementsByClassName("procaptcha")).filter((o) => o.tagName.toLowerCase() !== "button");
498
468
  if (e.length) {
499
- const o = k(e, 0).getAttribute("data-sitekey"), n = k(e, 0).getAttribute("data-web3");
469
+ const o = _(e, 0).getAttribute("data-sitekey"), a = _(e, 0).getAttribute("data-web3");
500
470
  if (!o) {
501
471
  console.error("No siteKey found");
502
472
  return;
503
473
  }
504
- const a = W(e), c = await w.createWidgets(e, {
505
- captchaType: a,
474
+ const n = R(e), c = await b.createWidgets(e, {
475
+ captchaType: n,
506
476
  siteKey: o
507
- }, n !== "true");
477
+ }, a !== "true");
508
478
  d.push(...c);
509
479
  }
510
480
  const t = Array.from(document.getElementsByClassName("procaptcha")).filter((o) => o.tagName.toLowerCase() === "button");
511
481
  if (t.length)
512
482
  for (const o of t) {
513
- const n = o.getAttribute("data-sitekey") || "", a = o.getAttribute("data-callback") || "", c = W([o]), i = await w.createWidgets([o], {
483
+ const a = o.getAttribute("data-sitekey") || "", n = o.getAttribute("data-callback") || "", c = R([o]), i = await b.createWidgets([o], {
514
484
  captchaType: c,
515
- siteKey: n,
516
- callback: a
485
+ siteKey: a,
486
+ callback: n
517
487
  }, !0, !0);
518
- d.push(...i), o.addEventListener("click", async (l) => {
519
- l.preventDefault(), L();
488
+ d.push(...i), o.addEventListener("click", async (r) => {
489
+ r.preventDefault(), D();
520
490
  });
521
491
  }
522
- }, ge = async (e, t) => {
523
- if (Object.prototype.hasOwnProperty.call(t, "size") && t.size === "invisible" || e.tagName.toLowerCase() === "button") {
524
- const a = await w.createWidgets([e], t, !0, !0);
525
- d.push(...a);
492
+ }, ue = async (e, t) => {
493
+ const o = Object.prototype.hasOwnProperty.call(t, "size") && t.size === "invisible", a = !t.web3;
494
+ if (o || e.tagName.toLowerCase() === "button") {
495
+ const c = await b.createWidgets([e], t, a, !0);
496
+ d.push(...c);
526
497
  return;
527
498
  }
528
- const n = await w.createWidgets([e], t);
499
+ const n = await b.createWidgets([e], t, a, !1);
529
500
  d.push(...n);
530
501
  };
531
- function f(e) {
502
+ function p(e) {
532
503
  document && document.readyState !== "loading" ? e() : document.addEventListener("DOMContentLoaded", () => {
533
504
  e();
534
505
  });
535
506
  }
536
- const L = () => {
507
+ const D = () => {
537
508
  var e;
538
- const t = me();
509
+ const t = ge();
539
510
  if (t.length === 0) {
540
511
  console.error("No Procaptcha containers found for execution");
541
512
  return;
542
513
  }
543
- const o = new CustomEvent(pe, {
514
+ const o = new CustomEvent(fe, {
544
515
  detail: {
545
516
  containerId: ((e = t[0]) == null ? void 0 : e.id) || "procaptcha-container",
546
517
  containerCount: t.length,
@@ -551,46 +522,42 @@ const L = () => {
551
522
  });
552
523
  document.dispatchEvent(o);
553
524
  };
554
- function me() {
525
+ function ge() {
555
526
  const e = [], t = Array.from(document.querySelectorAll('[data-size="invisible"]'));
556
527
  e.push(...t);
557
- const o = Array.from(document.querySelectorAll('#procaptcha-container, [id$="-procaptcha-container"]')), n = Array.from(document.getElementsByClassName("p-procaptcha"));
558
- e.push(...n);
559
- for (const a of o)
560
- e.includes(a) || e.push(a);
528
+ const o = Array.from(document.querySelectorAll('#procaptcha-container, [id$="-procaptcha-container"]')), a = Array.from(document.getElementsByClassName("p-procaptcha"));
529
+ e.push(...a);
530
+ for (const n of o)
531
+ e.includes(n) || e.push(n);
561
532
  return e;
562
533
  }
563
- const N = () => {
534
+ const L = () => {
564
535
  var e, t;
565
- const { onloadUrlCallback: o, renderExplicit: n } = he(E);
566
- let a = !1;
567
- if (n !== "explicit" && ((e = R(E)) == null || e.addEventListener("load", () => {
568
- f(D), a = !0;
569
- }), document.readyState === "complete" && !a && f(D)), o && ((t = R(E)) == null || t.addEventListener("load", () => {
570
- const c = m(o);
571
- f(c);
572
- }), document.readyState === "complete" && !a)) {
573
- const c = m(o);
574
- f(c);
536
+ const { onloadUrlCallback: o, renderExplicit: a } = de(C);
537
+ let n = !1;
538
+ if (a !== "explicit" && ((e = k(C)) == null || e.addEventListener("load", () => {
539
+ p(S), n = !0;
540
+ }), document.readyState === "complete" && !n && p(S)), o && ((t = k(C)) == null || t.addEventListener("load", () => {
541
+ const c = u(o);
542
+ p(c);
543
+ }), document.readyState === "complete" && !n)) {
544
+ const c = u(o);
545
+ p(c);
575
546
  }
576
- }, be = () => {
547
+ }, me = () => {
577
548
  for (const e of d)
578
549
  e.unmount();
579
- d = [], N();
550
+ d = [], L();
580
551
  };
581
- window.procaptcha = { ready: f, render: ge, reset: be, execute: L };
582
- N();
552
+ window.procaptcha = { ready: p, render: ue, reset: me, execute: D };
553
+ L();
583
554
  export {
584
- p as A,
585
- g as C,
586
- S as W,
587
- k as a,
588
- se as b,
589
- f as c,
590
- de as d,
591
- L as e,
592
- be as f,
593
- U as g,
594
- M as l,
595
- ge as r
555
+ E as W,
556
+ p as a,
557
+ me as b,
558
+ se as d,
559
+ D as e,
560
+ M as g,
561
+ re as l,
562
+ ue as r
596
563
  };