@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,71 +0,0 @@
1
- import { c as C, j as v, C as f } from "./emotion-element-c39617d8.browser.esm-BNNnmykm.js";
2
- import { r as A } from "./index-DIdd2cUz.js";
3
- import { P as b, b as R, L as i } from "./web2Chunk-CNoojUDK.js";
4
- var l, y = A;
5
- l = y.createRoot;
6
- function E(o, e = "light", t, a = !0, c = !1, r) {
7
- return o || (o = ""), b.parse({
8
- defaultEnvironment: R.parse("production"),
9
- userAccountAddress: r || "",
10
- account: {
11
- address: o
12
- },
13
- serverUrl: "",
14
- mongoAtlasUri: "",
15
- devOnlyWatchEvents: !1,
16
- web2: a,
17
- mode: c ? "invisible" : "visible",
18
- theme: e,
19
- language: t
20
- });
21
- }
22
- const x = (o, e, t) => {
23
- const a = (o == null ? void 0 : o.language) || e.getAttribute("data-language");
24
- a && (t.language = L(a));
25
- }, L = (o) => {
26
- try {
27
- return i.parse(o);
28
- } catch {
29
- return console.error("Invalid language attribute: ".concat(o)), i.parse("en");
30
- }
31
- }, P = (o, e, t) => {
32
- const a = (o == null ? void 0 : o["challenge-valid-length"]) || e.getAttribute("data-challenge-valid-length");
33
- a && (t.captchas.image.solutionTimeout = Number.parseInt(a), t.captchas.pow.solutionTimeout = Number.parseInt(a));
34
- };
35
- class j {
36
- constructor(e) {
37
- this.captchaComponentProvider = e;
38
- }
39
- renderCaptcha(e, t, a, c, r, h, u, m) {
40
- const g = (a == null ? void 0 : a.captchaType) || e.defaultCaptchaType, n = E(a.siteKey, a.theme, a.language, r, u, a.userAccountAddress);
41
- this.readAndValidateSettings(t, n, a);
42
- const s = this.createReactRoot(t, e.identifierPrefix), p = this.makeEmotionCache(e.emotionCacheKey, t), d = this.captchaComponentProvider.getCaptchaComponent(g, {
43
- config: n,
44
- i18n: h,
45
- callbacks: c,
46
- container: m
47
- });
48
- return this.renderCaptchaComponent(s, p, d), s;
49
- }
50
- readAndValidateSettings(e, t, a) {
51
- P(a, e, t), x(a, e, t);
52
- }
53
- makeEmotionCache(e, t) {
54
- return C({
55
- key: e,
56
- prepend: !0,
57
- container: t
58
- });
59
- }
60
- createReactRoot(e, t) {
61
- return l(e, {
62
- identifierPrefix: t
63
- });
64
- }
65
- renderCaptchaComponent(e, t, a) {
66
- e.render(v.jsx(f, { value: t, children: a }));
67
- }
68
- }
69
- export {
70
- j as CaptchaRenderer
71
- };
@@ -1,180 +0,0 @@
1
- import { z as L } from "./zodChunk-aEfPZzrp.js";
2
- const h = "info", d = "debug", m = "trace", b = "warn", k = "error", w = "fatal";
3
- L.enum([
4
- h,
5
- d,
6
- m,
7
- b,
8
- k,
9
- w
10
- ]);
11
- const P = {
12
- [m]: 5,
13
- [d]: 4,
14
- [h]: 3,
15
- [b]: 2,
16
- [k]: 1,
17
- [w]: 0
18
- };
19
- function S(s, t) {
20
- const e = new E(t);
21
- return e.setLogLevel(s), e;
22
- }
23
- const D = typeof window < "u" && typeof window.document < "u", g = "json", M = "plain";
24
- L.enum([g, M]);
25
- class E {
26
- constructor(t, e = P) {
27
- this.scope = t, this.levelMap = e, this.pretty = 0, this.printStack = !1, this.format = g, this.level = h, this.levelNum = this.levelMap[this.level];
28
- }
29
- setFormat(t) {
30
- if (this.format = t, this.format !== g)
31
- throw new Error("Only JSON format implemented for now");
32
- }
33
- getFormat() {
34
- return this.format;
35
- }
36
- with(t) {
37
- const e = new E(this.scope);
38
- return e.defaultData = { ...this.defaultData, ...t }, e.setLogLevel(this.getLogLevel()), e;
39
- }
40
- getPrintStack() {
41
- return this.printStack;
42
- }
43
- setPrintStack(t) {
44
- this.printStack = t;
45
- }
46
- getPretty() {
47
- return this.pretty > 0;
48
- }
49
- setPretty(t) {
50
- this.pretty = t ? 2 : 0;
51
- }
52
- getScope() {
53
- return this.scope;
54
- }
55
- setLogLevel(t) {
56
- this.level = t, this.levelNum = this.levelMap[t];
57
- }
58
- getLogLevel() {
59
- return this.level;
60
- }
61
- unpackError(t) {
62
- const e = t, r = { ...t };
63
- r.name = e.name || "Error", this.printStack && (e.stack && (r.stack = e.stack), e.stacktrace && (r.stacktrace = e.stacktrace)), e.cause && (r.cause = e.cause), e.code && (r.code = e.code), e.details && (r.details = e.details), e.context && (r.context = e.context), e.data && (r.data = e.data), e.info && (r.info = e.info), e.metadata && (r.metadata = e.metadata), e.status && (r.status = e.status), e.statusCode && (r.statusCode = e.statusCode), e.cause && (e.cause instanceof Error ? r.cause = this.unpackError(e.cause) : r.cause = e.cause);
64
- const a = e.message || e.msg || "";
65
- return e.message && e.msg && (r.msg = e.msg), {
66
- msg: a,
67
- data: r
68
- };
69
- }
70
- print(t, e, r) {
71
- if (this.levelMap[r] > this.levelNum)
72
- return;
73
- const a = (/* @__PURE__ */ new Date()).toISOString();
74
- let { data: c, msg: i, err: l } = e(), o, u;
75
- if (l)
76
- if (l instanceof Error || typeof l == "object") {
77
- const f = this.unpackError(l);
78
- o = f.msg, u = f.data;
79
- } else
80
- o = String(l);
81
- this.defaultData && (c = { ...this.defaultData, ...c });
82
- const n = { scope: this.scope, ts: a, level: this.level };
83
- if (c && (n.data = c), i && (n.msg = i), o && (n.err = o), u && (n.errData = u), D)
84
- i || o ? t(i || o, n) : t(n);
85
- else {
86
- const f = v(n), x = JSON.stringify(f, null, this.pretty);
87
- t(x);
88
- }
89
- }
90
- info(t) {
91
- this.print(console.info.bind(console), t, h);
92
- }
93
- debug(t) {
94
- this.print(console.debug.bind(console), t, d);
95
- }
96
- trace(t) {
97
- this.print(console.trace.bind(console), t, m);
98
- }
99
- warn(t) {
100
- this.print(console.warn.bind(console), t, b);
101
- }
102
- error(t) {
103
- this.print(console.error.bind(console), t, k);
104
- }
105
- fatal(t) {
106
- this.print(console.error.bind(console), t, w);
107
- }
108
- log(t, e) {
109
- switch (t) {
110
- case "trace":
111
- this.trace(e);
112
- break;
113
- case "debug":
114
- this.debug(e);
115
- break;
116
- case "info":
117
- this.info(e);
118
- break;
119
- case "warn":
120
- this.warn(e);
121
- break;
122
- case "error":
123
- this.error(e);
124
- break;
125
- case "fatal":
126
- this.fatal(e);
127
- break;
128
- default:
129
- throw new Error(`Unknown log level: ${t}`);
130
- }
131
- }
132
- }
133
- const v = (s) => {
134
- if (typeof s == "bigint")
135
- return s.toString();
136
- if (N(s))
137
- for (const t of Object.keys(s))
138
- s[t] = v(s[t]);
139
- return s;
140
- }, N = (s) => Object === (s == null ? void 0 : s.constructor), O = { t: (s) => s };
141
- class y extends Error {
142
- constructor(t, e) {
143
- const r = (e == null ? void 0 : e.logger) || S("info", import.meta.url), a = (e == null ? void 0 : e.logLevel) || "error", c = (e == null ? void 0 : e.i18n) || O;
144
- t instanceof Error ? (super(c.t(t.message)), this.translationKey = e == null ? void 0 : e.translationKey, this.context = {
145
- ...e == null ? void 0 : e.context,
146
- ...e != null && e.translationKey ? { translationMessage: c.t(e.translationKey) } : {}
147
- }) : (super(c.t(t)), this.translationKey = t, this.context = e == null ? void 0 : e.context), e != null && e.silent || this.logError(r, a, e == null ? void 0 : e.name);
148
- }
149
- logError(t, e, r) {
150
- const a = { error: this.message, context: this.context }, c = { errorType: r || this.name, errorParams: a };
151
- if (e === "debug") {
152
- t.debug(() => ({ data: { ...c, stack: this.stack } }));
153
- return;
154
- }
155
- t.error(() => ({ data: { ...c } }));
156
- }
157
- }
158
- class F extends y {
159
- constructor(t, e) {
160
- const r = (e == null ? void 0 : e.name) || "ProsopoError", a = { ...e, name: r };
161
- super(t, a);
162
- }
163
- }
164
- class K extends y {
165
- constructor(t, e) {
166
- const r = (e == null ? void 0 : e.name) || "ProsopoEnvError", a = { ...e, name: r };
167
- super(t, a);
168
- }
169
- }
170
- class A extends y {
171
- constructor(t, e) {
172
- const r = (e == null ? void 0 : e.name) || "ProsopoDatasetError", a = { ...e, name: r };
173
- super(t, a);
174
- }
175
- }
176
- export {
177
- F as P,
178
- K as a,
179
- A as b
180
- };
@@ -1,5 +0,0 @@
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.d.ts.map
@@ -1 +0,0 @@
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"}