altcha 2.3.0 → 3.0.0-beta.1

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 (494) hide show
  1. package/LICENSE.txt +1 -1
  2. package/README.md +149 -204
  3. package/dist/external/altcha.css +1 -0
  4. package/dist/external/altcha.js +6681 -0
  5. package/dist/external/altcha.min.js +1 -0
  6. package/dist/external/altcha.umd.cjs +6687 -0
  7. package/dist/external/altcha.umd.min.cjs +1 -0
  8. package/dist/external/index.d.ts +1 -0
  9. package/dist/i18n/419.d.ts +1 -0
  10. package/dist/i18n/af.d.ts +1 -0
  11. package/dist/i18n/af.js +22 -0
  12. package/dist/i18n/af.umd.cjs +27 -0
  13. package/dist/i18n/africa.d.ts +1 -0
  14. package/{dist_i18n → dist/i18n}/africa.js +52 -97
  15. package/dist/i18n/africa.umd.cjs +159 -0
  16. package/dist/i18n/all.d.ts +1 -0
  17. package/{dist_i18n → dist/i18n}/all.js +465 -299
  18. package/dist/i18n/all.umd.cjs +1325 -0
  19. package/dist/i18n/am.d.ts +1 -0
  20. package/dist/i18n/am.js +22 -0
  21. package/dist/i18n/am.umd.cjs +27 -0
  22. package/dist/i18n/americas.d.ts +1 -0
  23. package/{dist_i18n → dist/i18n}/americas.js +24 -85
  24. package/dist/i18n/americas.umd.cjs +71 -0
  25. package/dist/i18n/ar.d.ts +1 -0
  26. package/dist/i18n/ar.js +22 -0
  27. package/dist/i18n/ar.umd.cjs +27 -0
  28. package/dist/i18n/asia.d.ts +1 -0
  29. package/{dist_i18n → dist/i18n}/asia.js +177 -158
  30. package/dist/i18n/asia.umd.cjs +511 -0
  31. package/dist/i18n/az.d.ts +1 -0
  32. package/dist/i18n/az.js +22 -0
  33. package/dist/i18n/az.umd.cjs +27 -0
  34. package/dist/i18n/be.d.ts +1 -0
  35. package/dist/i18n/be.js +22 -0
  36. package/dist/i18n/be.umd.cjs +27 -0
  37. package/dist/i18n/bg.d.ts +1 -0
  38. package/dist/i18n/bg.js +22 -0
  39. package/dist/i18n/bg.umd.cjs +27 -0
  40. package/dist/i18n/bn.d.ts +1 -0
  41. package/dist/i18n/bn.js +22 -0
  42. package/dist/i18n/bn.umd.cjs +27 -0
  43. package/dist/i18n/br.d.ts +1 -0
  44. package/dist/i18n/bs.d.ts +1 -0
  45. package/dist/i18n/bs.js +22 -0
  46. package/dist/i18n/bs.umd.cjs +27 -0
  47. package/dist/i18n/ca.d.ts +1 -0
  48. package/dist/i18n/ca.js +22 -0
  49. package/dist/i18n/ca.umd.cjs +27 -0
  50. package/dist/i18n/cn.d.ts +1 -0
  51. package/dist/i18n/cs.d.ts +1 -0
  52. package/dist/i18n/cs.js +22 -0
  53. package/dist/i18n/cs.umd.cjs +27 -0
  54. package/dist/i18n/da.d.ts +1 -0
  55. package/dist/i18n/da.js +22 -0
  56. package/dist/i18n/da.umd.cjs +27 -0
  57. package/dist/i18n/de.d.ts +1 -0
  58. package/dist/i18n/de.js +22 -0
  59. package/dist/i18n/de.umd.cjs +27 -0
  60. package/dist/i18n/el.d.ts +1 -0
  61. package/dist/i18n/el.js +22 -0
  62. package/dist/i18n/el.umd.cjs +27 -0
  63. package/dist/i18n/en.d.ts +1 -0
  64. package/dist/i18n/en.js +22 -0
  65. package/dist/i18n/en.umd.cjs +27 -0
  66. package/dist/i18n/es-419.js +22 -0
  67. package/dist/i18n/es-419.umd.cjs +27 -0
  68. package/dist/i18n/es-es.js +22 -0
  69. package/dist/i18n/es-es.umd.cjs +27 -0
  70. package/dist/i18n/es.d.ts +1 -0
  71. package/dist/i18n/et.d.ts +1 -0
  72. package/dist/i18n/et.js +22 -0
  73. package/dist/i18n/et.umd.cjs +27 -0
  74. package/dist/i18n/eu.d.ts +1 -0
  75. package/dist/i18n/eu.js +22 -0
  76. package/dist/i18n/eu.umd.cjs +27 -0
  77. package/dist/i18n/europe.d.ts +1 -0
  78. package/{dist_i18n → dist/i18n}/europe.js +283 -209
  79. package/dist/i18n/europe.umd.cjs +819 -0
  80. package/dist/i18n/fa.d.ts +1 -0
  81. package/dist/i18n/fa.js +22 -0
  82. package/dist/i18n/fa.umd.cjs +27 -0
  83. package/dist/i18n/fi.d.ts +1 -0
  84. package/dist/i18n/fi.js +22 -0
  85. package/dist/i18n/fi.umd.cjs +27 -0
  86. package/dist/i18n/fr-ca.js +22 -0
  87. package/dist/i18n/fr-ca.umd.cjs +27 -0
  88. package/dist/i18n/fr-fr.js +22 -0
  89. package/dist/i18n/fr-fr.umd.cjs +27 -0
  90. package/dist/i18n/fr.d.ts +1 -0
  91. package/dist/i18n/ga.d.ts +1 -0
  92. package/dist/i18n/ga.js +22 -0
  93. package/dist/i18n/ga.umd.cjs +27 -0
  94. package/dist/i18n/he.d.ts +1 -0
  95. package/dist/i18n/he.js +22 -0
  96. package/dist/i18n/he.umd.cjs +27 -0
  97. package/dist/i18n/hi.d.ts +1 -0
  98. package/dist/i18n/hi.js +22 -0
  99. package/dist/i18n/hi.umd.cjs +27 -0
  100. package/dist/i18n/hr.d.ts +1 -0
  101. package/dist/i18n/hr.js +22 -0
  102. package/dist/i18n/hr.umd.cjs +27 -0
  103. package/dist/i18n/hu.d.ts +1 -0
  104. package/dist/i18n/hu.js +22 -0
  105. package/dist/i18n/hu.umd.cjs +27 -0
  106. package/dist/i18n/hy.d.ts +1 -0
  107. package/dist/i18n/hy.js +22 -0
  108. package/dist/i18n/hy.umd.cjs +27 -0
  109. package/dist/i18n/id.d.ts +1 -0
  110. package/dist/i18n/id.js +22 -0
  111. package/dist/i18n/id.umd.cjs +27 -0
  112. package/dist/i18n/is.d.ts +1 -0
  113. package/dist/i18n/is.js +22 -0
  114. package/dist/i18n/is.umd.cjs +27 -0
  115. package/dist/i18n/it.d.ts +1 -0
  116. package/dist/i18n/it.js +22 -0
  117. package/dist/i18n/it.umd.cjs +27 -0
  118. package/dist/i18n/ja.d.ts +1 -0
  119. package/dist/i18n/ja.js +22 -0
  120. package/dist/i18n/ja.umd.cjs +27 -0
  121. package/dist/i18n/ka.d.ts +1 -0
  122. package/dist/i18n/ka.js +22 -0
  123. package/dist/i18n/ka.umd.cjs +27 -0
  124. package/dist/i18n/kk.d.ts +1 -0
  125. package/dist/i18n/kk.js +22 -0
  126. package/dist/i18n/kk.umd.cjs +27 -0
  127. package/dist/i18n/ko.d.ts +1 -0
  128. package/dist/i18n/ko.js +22 -0
  129. package/dist/i18n/ko.umd.cjs +27 -0
  130. package/dist/i18n/lb.d.ts +1 -0
  131. package/dist/i18n/lb.js +22 -0
  132. package/dist/i18n/lb.umd.cjs +27 -0
  133. package/dist/i18n/lt.d.ts +1 -0
  134. package/dist/i18n/lt.js +22 -0
  135. package/dist/i18n/lt.umd.cjs +27 -0
  136. package/dist/i18n/lv.d.ts +1 -0
  137. package/dist/i18n/lv.js +22 -0
  138. package/dist/i18n/lv.umd.cjs +27 -0
  139. package/dist/i18n/me.d.ts +1 -0
  140. package/dist/i18n/me.js +22 -0
  141. package/dist/i18n/me.umd.cjs +27 -0
  142. package/dist/i18n/mk.d.ts +1 -0
  143. package/dist/i18n/mk.js +22 -0
  144. package/dist/i18n/mk.umd.cjs +27 -0
  145. package/dist/i18n/mr.d.ts +1 -0
  146. package/dist/i18n/mr.js +22 -0
  147. package/dist/i18n/mr.umd.cjs +27 -0
  148. package/dist/i18n/mt.d.ts +1 -0
  149. package/dist/i18n/mt.js +22 -0
  150. package/dist/i18n/mt.umd.cjs +27 -0
  151. package/dist/i18n/nb.d.ts +1 -0
  152. package/dist/i18n/nb.js +22 -0
  153. package/dist/i18n/nb.umd.cjs +27 -0
  154. package/dist/i18n/nl.d.ts +1 -0
  155. package/dist/i18n/nl.js +22 -0
  156. package/dist/i18n/nl.umd.cjs +27 -0
  157. package/dist/i18n/pl.d.ts +1 -0
  158. package/dist/i18n/pl.js +22 -0
  159. package/dist/i18n/pl.umd.cjs +27 -0
  160. package/dist/i18n/pt-br.js +22 -0
  161. package/dist/i18n/pt-br.umd.cjs +27 -0
  162. package/dist/i18n/pt-pt.js +22 -0
  163. package/dist/i18n/pt-pt.umd.cjs +27 -0
  164. package/dist/i18n/pt.d.ts +1 -0
  165. package/dist/i18n/ro.d.ts +1 -0
  166. package/dist/i18n/ro.js +22 -0
  167. package/dist/i18n/ro.umd.cjs +27 -0
  168. package/dist/i18n/ru.d.ts +1 -0
  169. package/dist/i18n/ru.js +22 -0
  170. package/dist/i18n/ru.umd.cjs +27 -0
  171. package/dist/i18n/sk.d.ts +1 -0
  172. package/dist/i18n/sk.js +22 -0
  173. package/dist/i18n/sk.umd.cjs +27 -0
  174. package/dist/i18n/sl.d.ts +1 -0
  175. package/dist/i18n/sl.js +22 -0
  176. package/dist/i18n/sl.umd.cjs +27 -0
  177. package/dist/i18n/sq.d.ts +1 -0
  178. package/dist/i18n/sq.js +22 -0
  179. package/dist/i18n/sq.umd.cjs +27 -0
  180. package/dist/i18n/sr.d.ts +1 -0
  181. package/dist/i18n/sr.js +22 -0
  182. package/dist/i18n/sr.umd.cjs +27 -0
  183. package/dist/i18n/sv.d.ts +1 -0
  184. package/dist/i18n/sv.js +22 -0
  185. package/dist/i18n/sv.umd.cjs +27 -0
  186. package/dist/i18n/sw.d.ts +1 -0
  187. package/dist/i18n/sw.js +22 -0
  188. package/dist/i18n/sw.umd.cjs +27 -0
  189. package/dist/i18n/ta.d.ts +1 -0
  190. package/dist/i18n/ta.js +22 -0
  191. package/dist/i18n/ta.umd.cjs +27 -0
  192. package/dist/i18n/te.d.ts +1 -0
  193. package/dist/i18n/te.js +22 -0
  194. package/dist/i18n/te.umd.cjs +27 -0
  195. package/dist/i18n/th.d.ts +1 -0
  196. package/dist/i18n/th.js +22 -0
  197. package/dist/i18n/th.umd.cjs +27 -0
  198. package/dist/i18n/tk.d.ts +1 -0
  199. package/dist/i18n/tk.js +22 -0
  200. package/dist/i18n/tk.umd.cjs +27 -0
  201. package/dist/i18n/tr.d.ts +1 -0
  202. package/dist/i18n/tr.js +22 -0
  203. package/dist/i18n/tr.umd.cjs +27 -0
  204. package/dist/i18n/tw.d.ts +1 -0
  205. package/dist/i18n/uk.d.ts +1 -0
  206. package/dist/i18n/uk.js +22 -0
  207. package/dist/i18n/uk.umd.cjs +27 -0
  208. package/dist/i18n/ur.d.ts +1 -0
  209. package/dist/i18n/ur.js +22 -0
  210. package/dist/i18n/ur.umd.cjs +27 -0
  211. package/dist/i18n/uz.d.ts +1 -0
  212. package/dist/i18n/uz.js +22 -0
  213. package/dist/i18n/uz.umd.cjs +27 -0
  214. package/dist/i18n/vi.d.ts +1 -0
  215. package/dist/i18n/vi.js +22 -0
  216. package/dist/i18n/vi.umd.cjs +27 -0
  217. package/dist/i18n/yo.d.ts +1 -0
  218. package/dist/i18n/yo.js +22 -0
  219. package/dist/i18n/yo.umd.cjs +27 -0
  220. package/dist/i18n/zh-cn.js +22 -0
  221. package/dist/i18n/zh-cn.umd.cjs +27 -0
  222. package/dist/i18n/zh-tw.js +22 -0
  223. package/dist/i18n/zh-tw.umd.cjs +27 -0
  224. package/dist/lib/index.d.ts +143 -0
  225. package/dist/lib/index.js +1344 -0
  226. package/dist/lib/index.min.js +1 -0
  227. package/dist/lib/index.umd.cjs +1348 -0
  228. package/dist/lib/index.umd.min.cjs +1 -0
  229. package/dist/main/altcha.i18n.js +8389 -0
  230. package/dist/main/altcha.i18n.min.js +1 -0
  231. package/dist/main/altcha.i18n.umd.cjs +8392 -0
  232. package/dist/main/altcha.i18n.umd.min.cjs +1 -0
  233. package/dist/main/altcha.js +7069 -0
  234. package/dist/main/altcha.min.js +1 -0
  235. package/dist/main/altcha.umd.cjs +7072 -0
  236. package/dist/main/altcha.umd.min.cjs +1 -0
  237. package/dist/plugins/obfuscation.plugin.d.ts +1 -0
  238. package/dist/plugins/obfuscation.plugin.js +320 -0
  239. package/dist/plugins/obfuscation.plugin.min.js +1 -0
  240. package/dist/plugins/obfuscation.plugin.umd.cjs +325 -0
  241. package/dist/plugins/obfuscation.plugin.umd.min.cjs +1 -0
  242. package/dist/themes/aqua.css +19 -0
  243. package/dist/themes/aqua.min.css +1 -0
  244. package/dist/themes/business.css +15 -0
  245. package/dist/themes/business.min.css +1 -0
  246. package/dist/themes/caramel.css +19 -0
  247. package/dist/themes/caramel.min.css +1 -0
  248. package/dist/themes/cupcake.css +16 -0
  249. package/dist/themes/cupcake.min.css +1 -0
  250. package/dist/themes/cyberpunk.css +24 -0
  251. package/dist/themes/cyberpunk.min.css +1 -0
  252. package/dist/themes/lime.css +13 -0
  253. package/dist/themes/lime.min.css +1 -0
  254. package/dist/themes/wireframe.css +17 -0
  255. package/dist/themes/wireframe.min.css +1 -0
  256. package/dist/types/generic.d.ts +25 -0
  257. package/dist/types/generic.js +1 -0
  258. package/dist/types/global.d.ts +5 -0
  259. package/dist/types/global.js +1 -0
  260. package/dist/types/index.d.ts +352 -0
  261. package/dist/types/index.js +23 -0
  262. package/dist/types/jsx.d.ts +13 -0
  263. package/dist/types/jsx.js +1 -0
  264. package/dist/types/react.d.ts +35 -0
  265. package/dist/types/react.js +1 -0
  266. package/dist/types/svelte.d.ts +26 -0
  267. package/dist/types/svelte.js +1 -0
  268. package/dist/workers/argon2id.js +786 -0
  269. package/dist/workers/pbkdf2.js +166 -0
  270. package/dist/workers/scrypt.js +739 -0
  271. package/dist/workers/sha.js +160 -0
  272. package/package.json +115 -81
  273. package/dist/altcha.d.ts +0 -183
  274. package/dist/altcha.i18n.d.ts +0 -183
  275. package/dist/altcha.i18n.js +0 -4182
  276. package/dist/altcha.i18n.umd.js +0 -4
  277. package/dist/altcha.js +0 -3105
  278. package/dist/altcha.umd.cjs +0 -4
  279. package/dist_external/altcha.css +0 -1
  280. package/dist_external/altcha.d.ts +0 -183
  281. package/dist_external/altcha.js +0 -3075
  282. package/dist_external/altcha.umd.cjs +0 -3
  283. package/dist_external/worker.js +0 -1
  284. package/dist_i18n/af.d.ts +0 -1
  285. package/dist_i18n/af.js +0 -94
  286. package/dist_i18n/af.umd.cjs +0 -1
  287. package/dist_i18n/africa.d.ts +0 -1
  288. package/dist_i18n/africa.umd.cjs +0 -1
  289. package/dist_i18n/all.d.ts +0 -1
  290. package/dist_i18n/all.umd.cjs +0 -1
  291. package/dist_i18n/am.d.ts +0 -1
  292. package/dist_i18n/am.js +0 -94
  293. package/dist_i18n/am.umd.cjs +0 -1
  294. package/dist_i18n/americas.d.ts +0 -1
  295. package/dist_i18n/americas.umd.cjs +0 -1
  296. package/dist_i18n/ar.d.ts +0 -1
  297. package/dist_i18n/ar.js +0 -94
  298. package/dist_i18n/ar.umd.cjs +0 -1
  299. package/dist_i18n/asia.d.ts +0 -1
  300. package/dist_i18n/asia.umd.cjs +0 -1
  301. package/dist_i18n/az.d.ts +0 -1
  302. package/dist_i18n/az.js +0 -94
  303. package/dist_i18n/az.umd.cjs +0 -1
  304. package/dist_i18n/be.d.ts +0 -1
  305. package/dist_i18n/be.js +0 -94
  306. package/dist_i18n/be.umd.cjs +0 -1
  307. package/dist_i18n/bg.d.ts +0 -1
  308. package/dist_i18n/bg.js +0 -94
  309. package/dist_i18n/bg.umd.cjs +0 -1
  310. package/dist_i18n/bn.d.ts +0 -1
  311. package/dist_i18n/bn.js +0 -94
  312. package/dist_i18n/bn.umd.cjs +0 -1
  313. package/dist_i18n/bs.d.ts +0 -1
  314. package/dist_i18n/bs.js +0 -94
  315. package/dist_i18n/bs.umd.cjs +0 -1
  316. package/dist_i18n/ca.d.ts +0 -1
  317. package/dist_i18n/ca.js +0 -94
  318. package/dist_i18n/ca.umd.cjs +0 -1
  319. package/dist_i18n/cs.d.ts +0 -1
  320. package/dist_i18n/cs.js +0 -94
  321. package/dist_i18n/cs.umd.cjs +0 -1
  322. package/dist_i18n/da.d.ts +0 -1
  323. package/dist_i18n/da.js +0 -94
  324. package/dist_i18n/da.umd.cjs +0 -1
  325. package/dist_i18n/de.d.ts +0 -1
  326. package/dist_i18n/de.js +0 -94
  327. package/dist_i18n/de.umd.cjs +0 -1
  328. package/dist_i18n/el.d.ts +0 -1
  329. package/dist_i18n/el.js +0 -94
  330. package/dist_i18n/el.umd.cjs +0 -1
  331. package/dist_i18n/en.d.ts +0 -1
  332. package/dist_i18n/en.js +0 -94
  333. package/dist_i18n/en.umd.cjs +0 -1
  334. package/dist_i18n/es-419.d.ts +0 -1
  335. package/dist_i18n/es-419.js +0 -94
  336. package/dist_i18n/es-419.umd.cjs +0 -1
  337. package/dist_i18n/es-es.d.ts +0 -1
  338. package/dist_i18n/es-es.js +0 -94
  339. package/dist_i18n/es-es.umd.cjs +0 -1
  340. package/dist_i18n/et.d.ts +0 -1
  341. package/dist_i18n/et.js +0 -94
  342. package/dist_i18n/et.umd.cjs +0 -1
  343. package/dist_i18n/eu.d.ts +0 -1
  344. package/dist_i18n/eu.js +0 -94
  345. package/dist_i18n/eu.umd.cjs +0 -1
  346. package/dist_i18n/europe.d.ts +0 -1
  347. package/dist_i18n/europe.umd.cjs +0 -1
  348. package/dist_i18n/fa.d.ts +0 -1
  349. package/dist_i18n/fa.js +0 -94
  350. package/dist_i18n/fa.umd.cjs +0 -1
  351. package/dist_i18n/fi.d.ts +0 -1
  352. package/dist_i18n/fi.js +0 -94
  353. package/dist_i18n/fi.umd.cjs +0 -1
  354. package/dist_i18n/fr-ca.d.ts +0 -1
  355. package/dist_i18n/fr-ca.js +0 -94
  356. package/dist_i18n/fr-ca.umd.cjs +0 -1
  357. package/dist_i18n/fr-fr.d.ts +0 -1
  358. package/dist_i18n/fr-fr.js +0 -94
  359. package/dist_i18n/fr-fr.umd.cjs +0 -1
  360. package/dist_i18n/ga.d.ts +0 -1
  361. package/dist_i18n/ga.js +0 -94
  362. package/dist_i18n/ga.umd.cjs +0 -1
  363. package/dist_i18n/he.d.ts +0 -1
  364. package/dist_i18n/he.js +0 -94
  365. package/dist_i18n/he.umd.cjs +0 -1
  366. package/dist_i18n/hi.d.ts +0 -1
  367. package/dist_i18n/hi.js +0 -94
  368. package/dist_i18n/hi.umd.cjs +0 -1
  369. package/dist_i18n/hr.d.ts +0 -1
  370. package/dist_i18n/hr.js +0 -94
  371. package/dist_i18n/hr.umd.cjs +0 -1
  372. package/dist_i18n/hu.d.ts +0 -1
  373. package/dist_i18n/hu.js +0 -94
  374. package/dist_i18n/hu.umd.cjs +0 -1
  375. package/dist_i18n/hy.d.ts +0 -1
  376. package/dist_i18n/hy.js +0 -94
  377. package/dist_i18n/hy.umd.cjs +0 -1
  378. package/dist_i18n/id.d.ts +0 -1
  379. package/dist_i18n/id.js +0 -94
  380. package/dist_i18n/id.umd.cjs +0 -1
  381. package/dist_i18n/is.d.ts +0 -1
  382. package/dist_i18n/is.js +0 -94
  383. package/dist_i18n/is.umd.cjs +0 -1
  384. package/dist_i18n/it.d.ts +0 -1
  385. package/dist_i18n/it.js +0 -94
  386. package/dist_i18n/it.umd.cjs +0 -1
  387. package/dist_i18n/ja.d.ts +0 -1
  388. package/dist_i18n/ja.js +0 -94
  389. package/dist_i18n/ja.umd.cjs +0 -1
  390. package/dist_i18n/ka.d.ts +0 -1
  391. package/dist_i18n/ka.js +0 -94
  392. package/dist_i18n/ka.umd.cjs +0 -1
  393. package/dist_i18n/kk.d.ts +0 -1
  394. package/dist_i18n/kk.js +0 -94
  395. package/dist_i18n/kk.umd.cjs +0 -1
  396. package/dist_i18n/ko.d.ts +0 -1
  397. package/dist_i18n/ko.js +0 -94
  398. package/dist_i18n/ko.umd.cjs +0 -1
  399. package/dist_i18n/lb.d.ts +0 -1
  400. package/dist_i18n/lb.js +0 -94
  401. package/dist_i18n/lb.umd.cjs +0 -1
  402. package/dist_i18n/lt.d.ts +0 -1
  403. package/dist_i18n/lt.js +0 -94
  404. package/dist_i18n/lt.umd.cjs +0 -1
  405. package/dist_i18n/lv.d.ts +0 -1
  406. package/dist_i18n/lv.js +0 -94
  407. package/dist_i18n/lv.umd.cjs +0 -1
  408. package/dist_i18n/me.d.ts +0 -1
  409. package/dist_i18n/me.js +0 -94
  410. package/dist_i18n/me.umd.cjs +0 -1
  411. package/dist_i18n/mk.d.ts +0 -1
  412. package/dist_i18n/mk.js +0 -94
  413. package/dist_i18n/mk.umd.cjs +0 -1
  414. package/dist_i18n/mr.d.ts +0 -1
  415. package/dist_i18n/mr.js +0 -94
  416. package/dist_i18n/mr.umd.cjs +0 -1
  417. package/dist_i18n/mt.d.ts +0 -1
  418. package/dist_i18n/mt.js +0 -94
  419. package/dist_i18n/mt.umd.cjs +0 -1
  420. package/dist_i18n/nb.d.ts +0 -1
  421. package/dist_i18n/nb.js +0 -95
  422. package/dist_i18n/nb.umd.cjs +0 -1
  423. package/dist_i18n/nl.d.ts +0 -1
  424. package/dist_i18n/nl.js +0 -94
  425. package/dist_i18n/nl.umd.cjs +0 -1
  426. package/dist_i18n/pl.d.ts +0 -1
  427. package/dist_i18n/pl.js +0 -94
  428. package/dist_i18n/pl.umd.cjs +0 -1
  429. package/dist_i18n/pt-br.d.ts +0 -1
  430. package/dist_i18n/pt-br.js +0 -94
  431. package/dist_i18n/pt-br.umd.cjs +0 -1
  432. package/dist_i18n/pt-pt.d.ts +0 -1
  433. package/dist_i18n/pt-pt.js +0 -94
  434. package/dist_i18n/pt-pt.umd.cjs +0 -1
  435. package/dist_i18n/ro.d.ts +0 -1
  436. package/dist_i18n/ro.js +0 -94
  437. package/dist_i18n/ro.umd.cjs +0 -1
  438. package/dist_i18n/ru.d.ts +0 -1
  439. package/dist_i18n/ru.js +0 -94
  440. package/dist_i18n/ru.umd.cjs +0 -1
  441. package/dist_i18n/sk.d.ts +0 -1
  442. package/dist_i18n/sk.js +0 -94
  443. package/dist_i18n/sk.umd.cjs +0 -1
  444. package/dist_i18n/sl.d.ts +0 -1
  445. package/dist_i18n/sl.js +0 -94
  446. package/dist_i18n/sl.umd.cjs +0 -1
  447. package/dist_i18n/sq.d.ts +0 -1
  448. package/dist_i18n/sq.js +0 -94
  449. package/dist_i18n/sq.umd.cjs +0 -1
  450. package/dist_i18n/sr.d.ts +0 -1
  451. package/dist_i18n/sr.js +0 -94
  452. package/dist_i18n/sr.umd.cjs +0 -1
  453. package/dist_i18n/sv.d.ts +0 -1
  454. package/dist_i18n/sv.js +0 -94
  455. package/dist_i18n/sv.umd.cjs +0 -1
  456. package/dist_i18n/sw.d.ts +0 -1
  457. package/dist_i18n/sw.js +0 -94
  458. package/dist_i18n/sw.umd.cjs +0 -1
  459. package/dist_i18n/ta.d.ts +0 -1
  460. package/dist_i18n/ta.js +0 -94
  461. package/dist_i18n/ta.umd.cjs +0 -1
  462. package/dist_i18n/te.d.ts +0 -1
  463. package/dist_i18n/te.js +0 -94
  464. package/dist_i18n/te.umd.cjs +0 -1
  465. package/dist_i18n/th.d.ts +0 -1
  466. package/dist_i18n/th.js +0 -94
  467. package/dist_i18n/th.umd.cjs +0 -1
  468. package/dist_i18n/tk.d.ts +0 -1
  469. package/dist_i18n/tk.js +0 -94
  470. package/dist_i18n/tk.umd.cjs +0 -1
  471. package/dist_i18n/tr.d.ts +0 -1
  472. package/dist_i18n/tr.js +0 -94
  473. package/dist_i18n/tr.umd.cjs +0 -1
  474. package/dist_i18n/uk.d.ts +0 -1
  475. package/dist_i18n/uk.js +0 -94
  476. package/dist_i18n/uk.umd.cjs +0 -1
  477. package/dist_i18n/ur.d.ts +0 -1
  478. package/dist_i18n/ur.js +0 -94
  479. package/dist_i18n/ur.umd.cjs +0 -1
  480. package/dist_i18n/uz.d.ts +0 -1
  481. package/dist_i18n/uz.js +0 -94
  482. package/dist_i18n/uz.umd.cjs +0 -1
  483. package/dist_i18n/vi.d.ts +0 -1
  484. package/dist_i18n/vi.js +0 -94
  485. package/dist_i18n/vi.umd.cjs +0 -1
  486. package/dist_i18n/yo.d.ts +0 -1
  487. package/dist_i18n/yo.js +0 -94
  488. package/dist_i18n/yo.umd.cjs +0 -1
  489. package/dist_i18n/zh-cn.d.ts +0 -1
  490. package/dist_i18n/zh-cn.js +0 -94
  491. package/dist_i18n/zh-cn.umd.cjs +0 -1
  492. package/dist_i18n/zh-tw.d.ts +0 -1
  493. package/dist_i18n/zh-tw.js +0 -94
  494. package/dist_i18n/zh-tw.umd.cjs +0 -1
@@ -0,0 +1,325 @@
1
+ (function(factory) {
2
+ typeof define === "function" && define.amd ? define(factory) : factory();
3
+ })((function() {
4
+ "use strict";
5
+ class BasePlugin {
6
+ constructor(host) {
7
+ this.host = host;
8
+ }
9
+ static register(pluginClass) {
10
+ if ("$altcha" in globalThis && !globalThis.$altcha.plugins.has(pluginClass)) {
11
+ globalThis.$altcha.plugins.add(pluginClass);
12
+ }
13
+ }
14
+ async onFetchChallenge(source) {
15
+ }
16
+ async onRequestServerVerification(payload, code) {
17
+ }
18
+ async onVerify(value) {
19
+ }
20
+ }
21
+ var State = /* @__PURE__ */ ((State2) => {
22
+ State2["CODE"] = "code";
23
+ State2["ERROR"] = "error";
24
+ State2["VERIFIED"] = "verified";
25
+ State2["VERIFYING"] = "verifying";
26
+ State2["UNVERIFIED"] = "unverified";
27
+ State2["EXPIRED"] = "expired";
28
+ return State2;
29
+ })(State || {});
30
+ class PasswordBuffer {
31
+ constructor(nonce, mode = "uint32") {
32
+ this.nonce = nonce;
33
+ this.mode = mode;
34
+ this.buffer = new Uint8Array(this.nonce.length + this.COUNTER_BYTES);
35
+ this.buffer.set(this.nonce, 0);
36
+ this.dataView = new DataView(this.buffer.buffer);
37
+ }
38
+ COUNTER_BYTES = 4;
39
+ buffer;
40
+ dataView;
41
+ encoder = new TextEncoder();
42
+ /**
43
+ * Appends the counter to the nonce buffer.
44
+ * In 'string' mode, encodes the counter as a UTF-8 string.
45
+ * In 'uint32' mode, writes the counter as a big-endian 32-bit integer.
46
+ */
47
+ setCounter(n) {
48
+ if (this.mode === "string") {
49
+ return concatBuffers(this.nonce, this.encoder.encode(n.toString()));
50
+ }
51
+ this.dataView.setUint32(this.nonce.length, n, false);
52
+ return this.buffer;
53
+ }
54
+ }
55
+ function bufferToHex(buffer) {
56
+ return Array.from(new Uint8Array(buffer)).map((b) => b.toString(16).padStart(2, "0")).join("");
57
+ }
58
+ function concatBuffers(a, b) {
59
+ const out = new Uint8Array(a.length + b.length);
60
+ out.set(a, 0);
61
+ out.set(b, a.length);
62
+ return out;
63
+ }
64
+ function hexToBuffer(hex) {
65
+ if (hex.length % 2 !== 0) {
66
+ throw new Error(`Hex string must have an even length. Got: ${hex}`);
67
+ }
68
+ const buffer = new ArrayBuffer(hex.length / 2);
69
+ const view = new DataView(buffer);
70
+ for (let i = 0; i < hex.length; i += 2) {
71
+ const byteString = hex.substring(i, i + 2);
72
+ const byteValue = parseInt(byteString, 16);
73
+ view.setUint8(i / 2, byteValue);
74
+ }
75
+ return new Uint8Array(buffer);
76
+ }
77
+ async function solveChallenge(options) {
78
+ const {
79
+ challenge,
80
+ controller,
81
+ counterMode = "uint32",
82
+ counterStart = 0,
83
+ counterStep = 1,
84
+ deriveKey,
85
+ timeout = 9e4
86
+ } = options;
87
+ let { nonce, keyPrefix, salt } = challenge.parameters;
88
+ const nonceBuf = hexToBuffer(nonce);
89
+ const saltBuf = hexToBuffer(salt);
90
+ const keyPrefixBuf = keyPrefix.length % 2 === 0 ? hexToBuffer(keyPrefix) : null;
91
+ const password = new PasswordBuffer(nonceBuf, counterMode);
92
+ const start = performance.now();
93
+ let counter = counterStart;
94
+ let derivedKeyHex = "";
95
+ let lastYield = start;
96
+ while (true) {
97
+ if (controller?.signal.aborted || timeout && counter % 10 === 0 && performance.now() - start > timeout) {
98
+ return null;
99
+ }
100
+ const { derivedKey } = await deriveKey(
101
+ challenge.parameters,
102
+ saltBuf,
103
+ password.setCounter(counter)
104
+ );
105
+ if (counter % 10 === 0 && performance.now() - lastYield > 200) {
106
+ await delay(0);
107
+ lastYield = performance.now();
108
+ }
109
+ if (keyPrefixBuf ? bufferStartsWith(derivedKey, keyPrefixBuf) : bufferToHex(derivedKey).startsWith(keyPrefix)) {
110
+ derivedKeyHex = bufferToHex(derivedKey);
111
+ break;
112
+ }
113
+ counter = counter + counterStep;
114
+ }
115
+ return {
116
+ counter,
117
+ derivedKey: derivedKeyHex,
118
+ time: timeDuration(start)
119
+ };
120
+ }
121
+ async function solveChallengeWorkers(options) {
122
+ let {
123
+ challenge,
124
+ concurrency = navigator.hardwareConcurrency,
125
+ controller = new AbortController(),
126
+ createWorker,
127
+ onOutOfMemory = (c) => c > 1 ? Math.floor(c / 2) : 0,
128
+ counterMode
129
+ } = options;
130
+ concurrency = Math.min(16, Math.max(1, concurrency));
131
+ const workersInstances = [];
132
+ const terminate = () => {
133
+ for (const worker of workersInstances) {
134
+ worker.terminate();
135
+ }
136
+ };
137
+ for (let i = 0; i < concurrency; i++) {
138
+ workersInstances.push(await createWorker(challenge.parameters.algorithm));
139
+ }
140
+ let solution = null;
141
+ try {
142
+ solution = await Promise.race(
143
+ workersInstances.map((worker, i) => {
144
+ controller.signal.addEventListener("abort", () => {
145
+ worker.postMessage({ type: "abort" });
146
+ });
147
+ return new Promise((resolve, reject) => {
148
+ worker.addEventListener("error", (err) => {
149
+ reject(err);
150
+ });
151
+ worker.addEventListener("message", (message) => {
152
+ if (message.data) {
153
+ for (const w of workersInstances) {
154
+ if (w !== worker) {
155
+ w.postMessage({ type: "abort" });
156
+ }
157
+ }
158
+ if (message.data.error) {
159
+ return reject(new Error(message.data.error));
160
+ }
161
+ }
162
+ resolve(message.data);
163
+ });
164
+ worker.postMessage({
165
+ challenge,
166
+ counterMode,
167
+ counterStart: i,
168
+ counterStep: concurrency,
169
+ type: "work"
170
+ });
171
+ });
172
+ })
173
+ );
174
+ } catch (err) {
175
+ const isOOM = !!err?.message?.includes("Out of memory");
176
+ if (isOOM) {
177
+ if (!!onOutOfMemory) {
178
+ terminate();
179
+ const retryConcurrency = onOutOfMemory(concurrency);
180
+ if (retryConcurrency) {
181
+ return solveChallengeWorkers({
182
+ ...options,
183
+ challenge,
184
+ controller,
185
+ concurrency: retryConcurrency,
186
+ createWorker
187
+ });
188
+ }
189
+ }
190
+ }
191
+ throw err;
192
+ } finally {
193
+ terminate();
194
+ }
195
+ if (controller.signal.aborted) {
196
+ return null;
197
+ }
198
+ return solution || null;
199
+ }
200
+ function bufferStartsWith(buffer, prefix) {
201
+ if (prefix.length > buffer.length) {
202
+ return false;
203
+ }
204
+ for (let i = 0; i < prefix.length; i++) {
205
+ if (buffer[i] !== prefix[i]) {
206
+ return false;
207
+ }
208
+ }
209
+ return true;
210
+ }
211
+ async function delay(ms) {
212
+ await new Promise((resolve) => setTimeout(resolve, ms));
213
+ }
214
+ function timeDuration(start) {
215
+ return Math.floor((performance.now() - start) * 10) / 10;
216
+ }
217
+ async function deobfuscate(obfuscatedData, options = {}) {
218
+ const { concurrency = navigator.hardwareConcurrency, deriveKey: deriveKey2 } = options;
219
+ let challenge = null;
220
+ try {
221
+ challenge = JSON.parse(atob(obfuscatedData));
222
+ } catch {
223
+ throw new Error(`Unable to parse obfuscated data.`);
224
+ }
225
+ if (!challenge || typeof challenge !== "object" || !("parameters" in challenge) || !("cipher" in challenge)) {
226
+ throw new Error(`Invalid obfuscated data format.`);
227
+ }
228
+ const cipher = challenge.cipher;
229
+ let solution = null;
230
+ if (deriveKey2) {
231
+ solution = await solveChallenge({
232
+ challenge,
233
+ deriveKey: deriveKey2
234
+ });
235
+ } else {
236
+ const createWorker = globalThis.$altcha.algorithms.get(challenge.parameters.algorithm);
237
+ if (!createWorker) {
238
+ throw new Error(`Unsupported algorithm ${challenge.parameters.algorithm}.`);
239
+ }
240
+ solution = await solveChallengeWorkers({
241
+ challenge,
242
+ concurrency,
243
+ createWorker
244
+ });
245
+ }
246
+ if (!solution) {
247
+ throw new Error("Unable to find solution.");
248
+ }
249
+ const key = await crypto.subtle.importKey(
250
+ "raw",
251
+ hexToBuffer(solution.derivedKey),
252
+ { name: "AES-GCM" },
253
+ false,
254
+ ["decrypt"]
255
+ );
256
+ const result = await crypto.subtle.decrypt(
257
+ {
258
+ name: "AES-GCM",
259
+ iv: hexToBuffer(cipher.iv)
260
+ },
261
+ key,
262
+ hexToBuffer(cipher.data)
263
+ );
264
+ return new TextDecoder().decode(result);
265
+ }
266
+ class ObfuscationPlugin extends BasePlugin {
267
+ elTrigger = null;
268
+ activate() {
269
+ this.elTrigger = this.host.querySelector("button");
270
+ if (this.elTrigger) {
271
+ this.elTrigger.addEventListener("click", this.onTriggerClick.bind(this));
272
+ this.host.configure({
273
+ floatingAnchor: this.elTrigger
274
+ });
275
+ }
276
+ }
277
+ destroy() {
278
+ }
279
+ async onVerify(options) {
280
+ const { minDuration = 500 } = options;
281
+ const start = performance.now();
282
+ const obfuscated = this.host.getAttribute("data-obfuscated");
283
+ if (obfuscated) {
284
+ this.host.reset(State.VERIFYING);
285
+ try {
286
+ const text = await deobfuscate(obfuscated);
287
+ await this.#wait(Math.max(0, minDuration - (performance.now() - start)));
288
+ this.#renderClearText(text);
289
+ } catch (err) {
290
+ this.host.setState(State.ERROR, String(err));
291
+ } finally {
292
+ this.host.setState(State.VERIFIED);
293
+ }
294
+ return null;
295
+ }
296
+ }
297
+ onTriggerClick(ev) {
298
+ ev.preventDefault();
299
+ this.host.show();
300
+ this.host.verify().then(() => {
301
+ this.host.hide();
302
+ });
303
+ }
304
+ #renderClearText(clearText) {
305
+ const match = clearText.match(/^(mailto|tel|sms|https?):/);
306
+ let el;
307
+ if (match) {
308
+ const [contact] = clearText.slice(clearText.indexOf(":") + 1).replace(/^\/\//, "").split("?");
309
+ el = document.createElement("a");
310
+ el.href = clearText;
311
+ el.innerText = contact;
312
+ } else {
313
+ el = document.createTextNode(clearText);
314
+ }
315
+ if (this.elTrigger && el) {
316
+ this.elTrigger.after(el);
317
+ this.elTrigger.parentElement?.removeChild(this.elTrigger);
318
+ }
319
+ }
320
+ async #wait(ms) {
321
+ await new Promise((resolve) => setTimeout(resolve, ms));
322
+ }
323
+ }
324
+ BasePlugin.register(ObfuscationPlugin);
325
+ }));
@@ -0,0 +1 @@
1
+ !function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";class e{constructor(e){this.host=e}static register(e){"$altcha"in globalThis&&!globalThis.$altcha.plugins.has(e)&&globalThis.$altcha.plugins.add(e)}async onFetchChallenge(e){}async onRequestServerVerification(e,t){}async onVerify(e){}}var t=(e=>(e.CODE="code",e.ERROR="error",e.VERIFIED="verified",e.VERIFYING="verifying",e.UNVERIFIED="unverified",e.EXPIRED="expired",e))(t||{});class r{constructor(e,t="uint32"){this.nonce=e,this.mode=t,this.buffer=new Uint8Array(this.nonce.length+this.COUNTER_BYTES),this.buffer.set(this.nonce,0),this.dataView=new DataView(this.buffer.buffer)}COUNTER_BYTES=4;buffer;dataView;encoder=new TextEncoder;setCounter(e){return"string"===this.mode?function(e,t){const r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r}(this.nonce,this.encoder.encode(e.toString())):(this.dataView.setUint32(this.nonce.length,e,!1),this.buffer)}}function n(e){return Array.from(new Uint8Array(e)).map(e=>e.toString(16).padStart(2,"0")).join("")}function a(e){if(e.length%2!=0)throw new Error(`Hex string must have an even length. Got: ${e}`);const t=new ArrayBuffer(e.length/2),r=new DataView(t);for(let t=0;t<e.length;t+=2){const n=e.substring(t,t+2),a=parseInt(n,16);r.setUint8(t/2,a)}return new Uint8Array(t)}async function o(e){let{challenge:t,concurrency:r=navigator.hardwareConcurrency,controller:n=new AbortController,createWorker:a,onOutOfMemory:i=e=>e>1?Math.floor(e/2):0,counterMode:s}=e;r=Math.min(16,Math.max(1,r));const c=[],l=()=>{for(const e of c)e.terminate()};for(let e=0;e<r;e++)c.push(await a(t.parameters.algorithm));let h=null;try{h=await Promise.race(c.map((e,a)=>(n.signal.addEventListener("abort",()=>{e.postMessage({type:"abort"})}),new Promise((n,o)=>{e.addEventListener("error",e=>{o(e)}),e.addEventListener("message",t=>{if(t.data){for(const t of c)t!==e&&t.postMessage({type:"abort"});if(t.data.error)return o(new Error(t.data.error))}n(t.data)}),e.postMessage({challenge:t,counterMode:s,counterStart:a,counterStep:r,type:"work"})}))))}catch(s){if(!!s?.message?.includes("Out of memory")&&i){l();const s=i(r);if(s)return o({...e,challenge:t,controller:n,concurrency:s,createWorker:a})}throw s}finally{l()}return n.signal.aborted?null:h||null}function i(e,t){if(t.length>e.length)return!1;for(let r=0;r<t.length;r++)if(e[r]!==t[r])return!1;return!0}async function s(e){await new Promise(t=>setTimeout(t,e))}function c(e){return Math.floor(10*(performance.now()-e))/10}async function l(e,t={}){const{concurrency:l=navigator.hardwareConcurrency,deriveKey:h}=t;let u=null;try{u=JSON.parse(atob(e))}catch{throw new Error("Unable to parse obfuscated data.")}if(!u||"object"!=typeof u||!("parameters"in u)||!("cipher"in u))throw new Error("Invalid obfuscated data format.");const f=u.cipher;let g=null;if(h)g=await async function(e){const{challenge:t,controller:o,counterMode:l="uint32",counterStart:h=0,counterStep:u=1,deriveKey:f,timeout:g=9e4}=e;let{nonce:d,keyPrefix:w,salt:m}=t.parameters;const y=a(d),p=a(m),E=w.length%2==0?a(w):null,b=new r(y,l),T=performance.now();let v=h,S="",C=T;for(;;){if(o?.signal.aborted||g&&v%10==0&&performance.now()-T>g)return null;const{derivedKey:e}=await f(t.parameters,p,b.setCounter(v));if(v%10==0&&performance.now()-C>200&&(await s(0),C=performance.now()),E?i(e,E):n(e).startsWith(w)){S=n(e);break}v+=u}return{counter:v,derivedKey:S,time:c(T)}}({challenge:u,deriveKey:h});else{const e=globalThis.$altcha.algorithms.get(u.parameters.algorithm);if(!e)throw new Error(`Unsupported algorithm ${u.parameters.algorithm}.`);g=await o({challenge:u,concurrency:l,createWorker:e})}if(!g)throw new Error("Unable to find solution.");const d=await crypto.subtle.importKey("raw",a(g.derivedKey),{name:"AES-GCM"},!1,["decrypt"]),w=await crypto.subtle.decrypt({name:"AES-GCM",iv:a(f.iv)},d,a(f.data));return(new TextDecoder).decode(w)}e.register(class extends e{elTrigger=null;activate(){this.elTrigger=this.host.querySelector("button"),this.elTrigger&&(this.elTrigger.addEventListener("click",this.onTriggerClick.bind(this)),this.host.configure({floatingAnchor:this.elTrigger}))}destroy(){}async onVerify(e){const{minDuration:r=500}=e,n=performance.now(),a=this.host.getAttribute("data-obfuscated");if(a){this.host.reset(t.VERIFYING);try{const e=await l(a);await this.#e(Math.max(0,r-(performance.now()-n))),this.#t(e)}catch(e){this.host.setState(t.ERROR,String(e))}finally{this.host.setState(t.VERIFIED)}return null}}onTriggerClick(e){e.preventDefault(),this.host.show(),this.host.verify().then(()=>{this.host.hide()})}#t(e){let t;if(e.match(/^(mailto|tel|sms|https?):/)){const[r]=e.slice(e.indexOf(":")+1).replace(/^\/\//,"").split("?");t=document.createElement("a"),t.href=e,t.innerText=r}else t=document.createTextNode(e);this.elTrigger&&t&&(this.elTrigger.after(t),this.elTrigger.parentElement?.removeChild(this.elTrigger))}async#e(e){await new Promise(t=>setTimeout(t,e))}})});
@@ -0,0 +1,19 @@
1
+ [data-altcha-theme='aqua'],
2
+ altcha-widget[theme='aqua'] {
3
+ --altcha-checkbox-border-width: 1.5px;
4
+ --altcha-color-base: oklch(36.993% 0.14552 265.614);
5
+ --altcha-color-base-content: oklch(96.183% 0.0235 227.909);
6
+ --altcha-color-neutral: oklch(46.768% 0.15756 266.404);
7
+ --altcha-color-neutral-content: var(--altcha-color-base-content);
8
+ --altcha-color-primary: oklch(60.683% 0.10883 309.763);
9
+ --altcha-color-primary-content: oklch(96.014% 0.0162 293.609);
10
+ --altcha-border-color: light-dark(oklch(27.079% 0.14584 265.379), oklch(46.768% 0.15756 266.404));
11
+ --altcha-input-background-color: light-dark(
12
+ oklch(100% 0.00011 271.152),
13
+ oklch(25.197% 0.00003 271.152)
14
+ );
15
+ --altcha-input-color: light-dark(oklch(27.079% 0.14584 265.379), oklch(96.014% 0.0162 293.609));
16
+ --altcha-switch-background-color: var(--altcha-input-background-color);
17
+ --altcha-checkbox-border-color: var(--altcha-color-neutral);
18
+ --altcha-spinner-color: var(--altcha-color-base-content);
19
+ }
@@ -0,0 +1 @@
1
+ [data-altcha-theme=aqua],altcha-widget[theme=aqua]{--altcha-checkbox-border-width:1.5px;--altcha-color-base:oklch(36.993% 0.14552 265.614);--altcha-color-base-content:oklch(96.183% 0.0235 227.909);--altcha-color-neutral:oklch(46.768% 0.15756 266.404);--altcha-color-neutral-content:var(--altcha-color-base-content);--altcha-color-primary:oklch(60.683% 0.10883 309.763);--altcha-color-primary-content:oklch(96.014% 0.0162 293.609);--altcha-border-color:light-dark(oklch(27.079% 0.14584 265.379),oklch(46.768% 0.15756 266.404));--altcha-input-background-color:light-dark(oklch(100% 0.00011 271.152),oklch(25.197% 0.00003 271.152));--altcha-input-color:light-dark(oklch(27.079% 0.14584 265.379),oklch(96.014% 0.0162 293.609));--altcha-switch-background-color:var(--altcha-input-background-color);--altcha-checkbox-border-color:var(--altcha-color-neutral);--altcha-spinner-color:var(--altcha-color-base-content)}
@@ -0,0 +1,15 @@
1
+ [data-altcha-theme='business'],
2
+ altcha-widget[theme='business'] {
3
+ --altcha-border-radius: 6px;
4
+ --altcha-border-width: 0;
5
+ --altcha-checkbox-border-width: 1.5px;
6
+ --altcha-color-base: light-dark(oklch(95.099% 0.00637 255.746), oklch(32.438% 0.02298 264.201));
7
+ --altcha-color-base-content: light-dark(
8
+ oklch(32.438% 0.02298 264.201),
9
+ oklch(95.099% 0.00637 255.746)
10
+ );
11
+ --altcha-input-background-color: light-dark(
12
+ oklch(100% 0.00011 271.152),
13
+ oklch(25.197% 0.00003 271.152)
14
+ );
15
+ }
@@ -0,0 +1 @@
1
+ [data-altcha-theme=business],altcha-widget[theme=business]{--altcha-border-radius:6px;--altcha-border-width:0;--altcha-checkbox-border-width:1.5px;--altcha-color-base:light-dark(oklch(95.099% 0.00637 255.746),oklch(32.438% 0.02298 264.201));--altcha-color-base-content:light-dark(oklch(32.438% 0.02298 264.201),oklch(95.099% 0.00637 255.746));--altcha-input-background-color:light-dark(oklch(100% 0.00011 271.152),oklch(25.197% 0.00003 271.152))}
@@ -0,0 +1,19 @@
1
+ [data-altcha-theme='caramel'],
2
+ altcha-widget[theme='caramel'] {
3
+ --altcha-border-width: 2px;
4
+ --altcha-border-radius: 12px;
5
+ --altcha-border-color: var(--altcha-color-base-content);
6
+ --altcha-color-base: light-dark(oklch(98.156% 0.01623 79.28), oklch(32.376% 0.03463 80.678));
7
+ --altcha-color-base-content: light-dark(
8
+ oklch(39.904% 0.12205 38.479),
9
+ oklch(85.594% 0.05829 42.379)
10
+ );
11
+ --altcha-checkbox-border-color: var(--altcha-color-base-content);
12
+ --altcha-checkbox-border-width: var(--altcha-border-width);
13
+ --altcha-input-background-color: light-dark(
14
+ oklch(100% 0.00011 271.152),
15
+ oklch(25.197% 0.00003 271.152)
16
+ );
17
+ --altcha-checkbox-border-radius: 50%;
18
+ --altcha-popover-color: var(--altcha-border-color);
19
+ }
@@ -0,0 +1 @@
1
+ [data-altcha-theme=caramel],altcha-widget[theme=caramel]{--altcha-border-width:2px;--altcha-border-radius:12px;--altcha-border-color:var(--altcha-color-base-content);--altcha-color-base:light-dark(oklch(98.156% 0.01623 79.28),oklch(32.376% 0.03463 80.678));--altcha-color-base-content:light-dark(oklch(39.904% 0.12205 38.479),oklch(85.594% 0.05829 42.379));--altcha-checkbox-border-color:var(--altcha-color-base-content);--altcha-checkbox-border-width:var(--altcha-border-width);--altcha-input-background-color:light-dark(oklch(100% 0.00011 271.152),oklch(25.197% 0.00003 271.152));--altcha-checkbox-border-radius:50%;--altcha-popover-color:var(--altcha-border-color)}
@@ -0,0 +1,16 @@
1
+ [data-altcha-theme='cupcake'],
2
+ altcha-widget[theme='cupcake'] {
3
+ --altcha-border-width: 2px;
4
+ --altcha-border-radius: 12px;
5
+ --altcha-color-base: light-dark(oklch(97.816% 0.00342 38.025), oklch(21.06% 0.00803 17.645));
6
+ --altcha-checkbox-border-color: light-dark(
7
+ oklch(82.809% 0.10217 344.861),
8
+ oklch(62.147% 0.1135 345.959)
9
+ );
10
+ --altcha-checkbox-border-width: var(--altcha-border-width);
11
+ --altcha-input-background-color: light-dark(
12
+ oklch(100% 0.00011 271.152),
13
+ oklch(25.197% 0.00003 271.152)
14
+ );
15
+ --altcha-switch-background-color: var(--altcha-checkbox-border-color);
16
+ }
@@ -0,0 +1 @@
1
+ [data-altcha-theme=cupcake],altcha-widget[theme=cupcake]{--altcha-border-width:2px;--altcha-border-radius:12px;--altcha-color-base:light-dark(oklch(97.816% 0.00342 38.025),oklch(21.06% 0.00803 17.645));--altcha-checkbox-border-color:light-dark(oklch(82.809% 0.10217 344.861),oklch(62.147% 0.1135 345.959));--altcha-checkbox-border-width:var(--altcha-border-width);--altcha-input-background-color:light-dark(oklch(100% 0.00011 271.152),oklch(25.197% 0.00003 271.152));--altcha-switch-background-color:var(--altcha-checkbox-border-color)}
@@ -0,0 +1,24 @@
1
+ [data-altcha-theme='cyberpunk'],
2
+ altcha-widget[theme='cyberpunk'] {
3
+ --altcha-border-color: var(--altcha-color-neutral);
4
+ --altcha-border-width: 2px;
5
+ --altcha-border-radius: 12px;
6
+ --altcha-color-base: oklch(94.343% 0.17917 104.914);
7
+ --altcha-color-base-content: oklch(23.042% 0.0647 269.34);
8
+ --altcha-color-neutral: var(--altcha-color-base-content);
9
+ --altcha-color-neutral-content: var(--altcha-color-base-content);
10
+ --altcha-color-primary: oklch(69.603% 0.26545 340.482);
11
+ --altcha-color-success: oklch(90.486% 0.15061 195.382);
12
+ --altcha-color-success-content: var(--altcha-color-base-content);
13
+ --altcha-checkbox-border-color: var(--altcha-color-neutral);
14
+ --altcha-checkbox-border-width: var(--altcha-border-width);
15
+ --altcha-input-background-color: light-dark(
16
+ oklch(86.286% 0.16763 104.933),
17
+ oklch(86.286% 0.16763 104.933)
18
+ );
19
+ --altcha-input-color: var(--altcha-color-base-content);
20
+ --altcha-switch-background-color: var(--altcha-input-background-color);
21
+ --altcha-switch-toggle-color: var(--altcha-color-neutral);
22
+ --altcha-popover-color: var(--altcha-border-color);
23
+ --altcha-spinner-color: var(--altcha-color-base-content);
24
+ }
@@ -0,0 +1 @@
1
+ [data-altcha-theme=cyberpunk],altcha-widget[theme=cyberpunk]{--altcha-border-color:var(--altcha-color-neutral);--altcha-border-width:2px;--altcha-border-radius:12px;--altcha-color-base:oklch(94.343% 0.17917 104.914);--altcha-color-base-content:oklch(23.042% 0.0647 269.34);--altcha-color-neutral:var(--altcha-color-base-content);--altcha-color-neutral-content:var(--altcha-color-base-content);--altcha-color-primary:oklch(69.603% 0.26545 340.482);--altcha-color-success:oklch(90.486% 0.15061 195.382);--altcha-color-success-content:var(--altcha-color-base-content);--altcha-checkbox-border-color:var(--altcha-color-neutral);--altcha-checkbox-border-width:var(--altcha-border-width);--altcha-input-background-color:light-dark(oklch(86.286% 0.16763 104.933),oklch(86.286% 0.16763 104.933));--altcha-input-color:var(--altcha-color-base-content);--altcha-switch-background-color:var(--altcha-input-background-color);--altcha-switch-toggle-color:var(--altcha-color-neutral);--altcha-popover-color:var(--altcha-border-color);--altcha-spinner-color:var(--altcha-color-base-content)}
@@ -0,0 +1,13 @@
1
+ [data-altcha-theme='lime'],
2
+ altcha-widget[theme='lime'] {
3
+ --altcha-color-base: oklch(98.65% 0.019 123.003);
4
+ --altcha-color-base-content: oklch(27.44% 0.01383 131.799);
5
+ --altcha-color-primary: oklch(77.94% 0.17114 110.922);
6
+ --altcha-color-primary-content: var(--altcha-color-base-content);
7
+ --altcha-color-primary-content: var(--altcha-color-base-content);
8
+ --altcha-color-neutral: oklch(76.243% 0.05879 130.835);
9
+ --altcha-color-neutral-content: var(--altcha-color-base-content);
10
+ --altcha-border-color: light-dark(oklch(76.243% 0.05879 130.835), oklch(98.884% 0.01122 128.94));
11
+ --altcha-input-background-color: oklch(100% 0.00011 271.152);
12
+ --altcha-input-color: var(--altcha-color-base-content);
13
+ }
@@ -0,0 +1 @@
1
+ [data-altcha-theme=lime],altcha-widget[theme=lime]{--altcha-color-base:oklch(98.65% 0.019 123.003);--altcha-color-base-content:oklch(27.44% 0.01383 131.799);--altcha-color-primary:oklch(77.94% 0.17114 110.922);--altcha-color-primary-content:var(--altcha-color-base-content);--altcha-color-neutral:oklch(76.243% 0.05879 130.835);--altcha-color-neutral-content:var(--altcha-color-base-content);--altcha-border-color:light-dark(oklch(76.243% 0.05879 130.835),oklch(98.884% 0.01122 128.94));--altcha-input-background-color:oklch(100% 0.00011 271.152);--altcha-input-color:var(--altcha-color-base-content)}
@@ -0,0 +1,17 @@
1
+ [data-altcha-theme='wireframe'],
2
+ altcha-widget[theme='wireframe'] {
3
+ --altcha-border-width: 1px;
4
+ --altcha-border-radius: 0;
5
+ --altcha-checkbox-border-radius: 0;
6
+ --altcha-input-border-radius: 0;
7
+ --altcha-color-neutral: light-dark(oklch(25.197% 0.00003 271.152), oklch(37.346% 0.00272 16.419));
8
+ --altcha-color-neutral-content: light-dark(
9
+ oklch(73.802% 0.00008 271.152),
10
+ oklch(68.622% 0.00008 271.152)
11
+ );
12
+ --altcha-switch-border-radius: 4px;
13
+ --altcha-switch-toggle-border-radius: 2px;
14
+ --altcha-switch-background-color: var(--altcha-color-neutral);
15
+ --altcha-switch-toggle-color: var(--altcha-color-neutral-content);
16
+ --altcha-spinner-color: var(--altcha-color-neutral-content);
17
+ }
@@ -0,0 +1 @@
1
+ [data-altcha-theme=wireframe],altcha-widget[theme=wireframe]{--altcha-border-width:1px;--altcha-border-radius:0;--altcha-checkbox-border-radius:0;--altcha-input-border-radius:0;--altcha-color-neutral:light-dark(oklch(25.197% 0.00003 271.152),oklch(37.346% 0.00272 16.419));--altcha-color-neutral-content:light-dark(oklch(73.802% 0.00008 271.152),oklch(68.622% 0.00008 271.152));--altcha-switch-border-radius:4px;--altcha-switch-toggle-border-radius:2px;--altcha-switch-background-color:var(--altcha-color-neutral);--altcha-switch-toggle-color:var(--altcha-color-neutral-content);--altcha-spinner-color:var(--altcha-color-neutral-content)}
@@ -0,0 +1,25 @@
1
+ import './global';
2
+ import type { Configuration, State, VerifyOptions, VerifyResult } from './';
3
+ export {};
4
+ export declare class AltchaWidgetElement extends HTMLElement {
5
+ auto?: Configuration['auto'];
6
+ challenge?: string;
7
+ display?: Configuration['display'];
8
+ language?: string;
9
+ name?: string;
10
+ type?: Configuration['type'];
11
+ configure: (config: Partial<Configuration>) => Promise<void>;
12
+ getConfiguration: () => Configuration;
13
+ getState: () => State;
14
+ hide: () => void;
15
+ reset: (newState: State) => void;
16
+ setState: (newState: State, err?: string | null) => void;
17
+ show: () => void;
18
+ updateUI: () => void;
19
+ verify: (options?: VerifyOptions) => Promise<VerifyResult | null>;
20
+ }
21
+ declare global {
22
+ interface HTMLElementTagNameMap {
23
+ 'altcha-widget': AltchaWidgetElement;
24
+ }
25
+ }
@@ -0,0 +1 @@
1
+ import './global';
@@ -0,0 +1,5 @@
1
+ import type { AltchaGlobal } from './index';
2
+ export {};
3
+ declare global {
4
+ var $altcha: AltchaGlobal;
5
+ }
@@ -0,0 +1 @@
1
+ export {};