@unidy.io/sdk 1.1.8 → 1.1.10

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 (769) hide show
  1. package/dist/cjs/app-globals-Pb3mNuRv.js +10 -0
  2. package/dist/cjs/app-globals-Pb3mNuRv.js.map +1 -0
  3. package/dist/cjs/auth-ChsE2RD7.js +614 -0
  4. package/dist/cjs/auth-ChsE2RD7.js.map +1 -0
  5. package/dist/cjs/auth-store-BO38Txmj.js +187 -0
  6. package/dist/cjs/auth-store-BO38Txmj.js.map +1 -0
  7. package/dist/cjs/component-utils-bu3SY4dE.js +42 -0
  8. package/dist/cjs/component-utils-bu3SY4dE.js.map +1 -0
  9. package/dist/cjs/flash-store-D5vGuIFc.js +50 -0
  10. package/dist/cjs/flash-store-D5vGuIFc.js.map +1 -0
  11. package/dist/cjs/helpers-BcPlKlBG.js +11 -0
  12. package/dist/cjs/helpers-BcPlKlBG.js.map +1 -0
  13. package/dist/cjs/helpers-DJyRa0Qo.js +11 -0
  14. package/dist/cjs/helpers-DJyRa0Qo.js.map +1 -0
  15. package/dist/cjs/i18n-B2T1e9Mf.js +3072 -0
  16. package/dist/cjs/i18n-B2T1e9Mf.js.map +1 -0
  17. package/dist/cjs/index-BzhKFIXk.js +14706 -0
  18. package/dist/cjs/index-BzhKFIXk.js.map +1 -0
  19. package/dist/cjs/index-DmDGhWTM.js +6338 -0
  20. package/dist/cjs/index-DmDGhWTM.js.map +1 -0
  21. package/dist/cjs/index-DxENvy7x.js +283 -0
  22. package/dist/cjs/index-DxENvy7x.js.map +1 -0
  23. package/dist/cjs/index.cjs.js +64 -0
  24. package/dist/cjs/index.cjs.js.map +1 -0
  25. package/dist/cjs/loader.cjs.js +14 -0
  26. package/dist/cjs/loader.cjs.js.map +1 -0
  27. package/dist/cjs/newsletter-helpers-B5P7q8Xk.js +289 -0
  28. package/dist/cjs/newsletter-helpers-B5P7q8Xk.js.map +1 -0
  29. package/dist/cjs/newsletter-store-f5zhJljn.js +38 -0
  30. package/dist/cjs/newsletter-store-f5zhJljn.js.map +1 -0
  31. package/dist/cjs/pagination-store-DjGYEIqm.js +16 -0
  32. package/dist/cjs/pagination-store-DjGYEIqm.js.map +1 -0
  33. package/dist/cjs/profile-helpers-BcLjojeG.js +39 -0
  34. package/dist/cjs/profile-helpers-BcLjojeG.js.map +1 -0
  35. package/dist/cjs/profile-store-BWJ9qAcg.js +22 -0
  36. package/dist/cjs/profile-store-BWJ9qAcg.js.map +1 -0
  37. package/dist/cjs/sdk.cjs.js +53 -0
  38. package/dist/cjs/sdk.cjs.js.map +1 -0
  39. package/dist/cjs/u-conditional-render.cjs.entry.js +102 -0
  40. package/dist/cjs/u-conditional-render.entry.cjs.js.map +1 -0
  41. package/dist/cjs/u-config.cjs.entry.js +91 -0
  42. package/dist/cjs/u-config.entry.cjs.js.map +1 -0
  43. package/dist/cjs/u-email-field.cjs.entry.js +77 -0
  44. package/dist/cjs/u-email-field.entry.cjs.js.map +1 -0
  45. package/dist/cjs/u-error-message.cjs.entry.js +82 -0
  46. package/dist/cjs/u-error-message.entry.cjs.js.map +1 -0
  47. package/dist/cjs/u-field.u-raw-field.entry.cjs.js.map +1 -0
  48. package/dist/cjs/u-field_2.cjs.entry.js +371 -0
  49. package/dist/cjs/u-flash-message.cjs.entry.js +37 -0
  50. package/dist/cjs/u-flash-message.entry.cjs.js.map +1 -0
  51. package/dist/cjs/u-full-profile.cjs.entry.js +37 -0
  52. package/dist/cjs/u-full-profile.entry.cjs.js.map +1 -0
  53. package/dist/cjs/u-logout-button.u-signed-in.entry.cjs.js.map +1 -0
  54. package/dist/cjs/u-logout-button_2.cjs.entry.js +62 -0
  55. package/dist/cjs/u-magic-code-field.cjs.entry.js +91 -0
  56. package/dist/cjs/u-magic-code-field.entry.cjs.js.map +1 -0
  57. package/dist/cjs/u-missing-field.cjs.entry.js +22 -0
  58. package/dist/cjs/u-missing-field.entry.cjs.js.map +1 -0
  59. package/dist/cjs/u-missing-fields-submit-button.cjs.entry.js +46 -0
  60. package/dist/cjs/u-missing-fields-submit-button.entry.cjs.js.map +1 -0
  61. package/dist/cjs/u-newsletter-checkbox.cjs.entry.js +77 -0
  62. package/dist/cjs/u-newsletter-checkbox.entry.cjs.js.map +1 -0
  63. package/dist/cjs/u-newsletter-logout-button.cjs.entry.js +41 -0
  64. package/dist/cjs/u-newsletter-logout-button.entry.cjs.js.map +1 -0
  65. package/dist/cjs/u-newsletter-preference-checkbox.cjs.entry.js +120 -0
  66. package/dist/cjs/u-newsletter-preference-checkbox.entry.cjs.js.map +1 -0
  67. package/dist/cjs/u-newsletter-resend-doi-button.cjs.entry.js +49 -0
  68. package/dist/cjs/u-newsletter-resend-doi-button.entry.cjs.js.map +1 -0
  69. package/dist/cjs/u-newsletter-root.cjs.entry.js +72 -0
  70. package/dist/cjs/u-newsletter-root.entry.cjs.js.map +1 -0
  71. package/dist/cjs/u-newsletter-toggle-subscription-button.cjs.entry.js +73 -0
  72. package/dist/cjs/u-newsletter-toggle-subscription-button.entry.cjs.js.map +1 -0
  73. package/dist/cjs/u-pagination-button.cjs.entry.js +63 -0
  74. package/dist/cjs/u-pagination-button.entry.cjs.js.map +1 -0
  75. package/dist/cjs/u-pagination-page.cjs.entry.js +44 -0
  76. package/dist/cjs/u-pagination-page.entry.cjs.js.map +1 -0
  77. package/dist/cjs/u-passkey.cjs.entry.js +47 -0
  78. package/dist/cjs/u-passkey.entry.cjs.js.map +1 -0
  79. package/dist/cjs/u-password-field.cjs.entry.js +106 -0
  80. package/dist/cjs/u-password-field.entry.cjs.js.map +1 -0
  81. package/dist/cjs/u-profile.u-submit-button.entry.cjs.js.map +1 -0
  82. package/dist/cjs/u-profile_2.cjs.entry.js +329 -0
  83. package/dist/cjs/u-registration-button.cjs.entry.js +48 -0
  84. package/dist/cjs/u-registration-button.entry.cjs.js.map +1 -0
  85. package/dist/cjs/u-reset-password-button.cjs.entry.js +56 -0
  86. package/dist/cjs/u-reset-password-button.entry.cjs.js.map +1 -0
  87. package/dist/cjs/u-send-magic-code-button.cjs.entry.js +68 -0
  88. package/dist/cjs/u-send-magic-code-button.entry.cjs.js.map +1 -0
  89. package/dist/cjs/u-signin-root.cjs.entry.js +43 -0
  90. package/dist/cjs/u-signin-root.entry.cjs.js.map +1 -0
  91. package/dist/cjs/u-signin-step.cjs.entry.js +66 -0
  92. package/dist/cjs/u-signin-step.entry.cjs.js.map +1 -0
  93. package/dist/cjs/u-signin-strategy.cjs.entry.js +30 -0
  94. package/dist/cjs/u-signin-strategy.entry.cjs.js.map +1 -0
  95. package/dist/cjs/u-social-login-button.cjs.entry.js +100 -0
  96. package/dist/cjs/u-social-login-button.entry.cjs.js.map +1 -0
  97. package/dist/cjs/u-spinner.cjs.entry.js +18 -0
  98. package/dist/cjs/u-spinner.entry.cjs.js.map +1 -0
  99. package/dist/cjs/u-ticketable-list.cjs.entry.js +6097 -0
  100. package/dist/cjs/u-ticketable-list.entry.cjs.js.map +1 -0
  101. package/dist/cjs/unidy-store-zhdhlK0a.js +41 -0
  102. package/dist/cjs/unidy-store-zhdhlK0a.js.map +1 -0
  103. package/dist/collection/api/client.js +144 -0
  104. package/dist/collection/api/client.js.map +1 -0
  105. package/dist/collection/api/index.js +42 -0
  106. package/dist/collection/api/index.js.map +1 -0
  107. package/dist/collection/api/shared.js +18 -0
  108. package/dist/collection/api/shared.js.map +1 -0
  109. package/dist/collection/auth/api/auth.js +274 -0
  110. package/dist/collection/auth/api/auth.js.map +1 -0
  111. package/dist/collection/auth/auth-helpers.js +314 -0
  112. package/dist/collection/auth/auth-helpers.js.map +1 -0
  113. package/dist/collection/auth/auth.js +139 -0
  114. package/dist/collection/auth/auth.js.map +1 -0
  115. package/dist/collection/auth/components/helpers.js +5 -0
  116. package/dist/collection/auth/components/helpers.js.map +1 -0
  117. package/dist/collection/auth/components/logout-button/logout-button.js +94 -0
  118. package/dist/collection/auth/components/logout-button/logout-button.js.map +1 -0
  119. package/dist/collection/auth/components/magic-code-field/magic-code-field.css +1 -0
  120. package/dist/collection/auth/components/magic-code-field/magic-code-field.js +113 -0
  121. package/dist/collection/auth/components/magic-code-field/magic-code-field.js.map +1 -0
  122. package/dist/collection/auth/components/missing-field/missing-field.js +14 -0
  123. package/dist/collection/auth/components/missing-field/missing-field.js.map +1 -0
  124. package/dist/collection/auth/components/missing-fields-submit-button/missing-fields-submit-button.js +39 -0
  125. package/dist/collection/auth/components/missing-fields-submit-button/missing-fields-submit-button.js.map +1 -0
  126. package/dist/collection/auth/components/passkey/passkey.js +103 -0
  127. package/dist/collection/auth/components/passkey/passkey.js.map +1 -0
  128. package/dist/collection/auth/components/password-field/password-field.js +168 -0
  129. package/dist/collection/auth/components/password-field/password-field.js.map +1 -0
  130. package/dist/collection/auth/components/registration/registration-button.js +104 -0
  131. package/dist/collection/auth/components/registration/registration-button.js.map +1 -0
  132. package/dist/collection/auth/components/reset-pass-button/reset-pass-button.js +68 -0
  133. package/dist/collection/auth/components/reset-pass-button/reset-pass-button.js.map +1 -0
  134. package/dist/collection/auth/components/send-magic-code-button/send-magic-code-button.js +104 -0
  135. package/dist/collection/auth/components/send-magic-code-button/send-magic-code-button.js.map +1 -0
  136. package/dist/collection/auth/components/signed-in/signed-in.js +59 -0
  137. package/dist/collection/auth/components/signed-in/signed-in.js.map +1 -0
  138. package/dist/collection/auth/components/signin-root/signin-root.js +97 -0
  139. package/dist/collection/auth/components/signin-root/signin-root.js.map +1 -0
  140. package/dist/collection/auth/components/signin-step/signin-step.js +135 -0
  141. package/dist/collection/auth/components/signin-step/signin-step.js.map +1 -0
  142. package/dist/collection/auth/components/signin-strategy/signin-strategy.js +64 -0
  143. package/dist/collection/auth/components/signin-strategy/signin-strategy.js.map +1 -0
  144. package/dist/collection/auth/components/social-logins/logos/apple.js +3 -0
  145. package/dist/collection/auth/components/social-logins/logos/apple.js.map +1 -0
  146. package/dist/collection/auth/components/social-logins/logos/discord.js +3 -0
  147. package/dist/collection/auth/components/social-logins/logos/discord.js.map +1 -0
  148. package/dist/collection/auth/components/social-logins/logos/facebook.js +3 -0
  149. package/dist/collection/auth/components/social-logins/logos/facebook.js.map +1 -0
  150. package/dist/collection/auth/components/social-logins/logos/google.js +3 -0
  151. package/dist/collection/auth/components/social-logins/logos/google.js.map +1 -0
  152. package/dist/collection/auth/components/social-logins/logos/linkedin.js +3 -0
  153. package/dist/collection/auth/components/social-logins/logos/linkedin.js.map +1 -0
  154. package/dist/collection/auth/components/social-logins/social-login-button.css +1 -0
  155. package/dist/collection/auth/components/social-logins/social-login-button.js +188 -0
  156. package/dist/collection/auth/components/social-logins/social-login-button.js.map +1 -0
  157. package/dist/collection/auth/components/submit-button/auth-submit-button.js +62 -0
  158. package/dist/collection/auth/components/submit-button/auth-submit-button.js.map +1 -0
  159. package/dist/collection/auth/error-definitions.js +26 -0
  160. package/dist/collection/auth/error-definitions.js.map +1 -0
  161. package/dist/collection/auth/index.js +13 -0
  162. package/dist/collection/auth/index.js.map +1 -0
  163. package/dist/collection/auth/passkey-auth.js +106 -0
  164. package/dist/collection/auth/passkey-auth.js.map +1 -0
  165. package/dist/collection/auth/store/auth-store.js +178 -0
  166. package/dist/collection/auth/store/auth-store.js.map +1 -0
  167. package/dist/collection/collection-manifest.json +46 -0
  168. package/dist/collection/globalScript.js +18 -0
  169. package/dist/collection/globalScript.js.map +1 -0
  170. package/dist/collection/i18n.js +31 -0
  171. package/dist/collection/i18n.js.map +1 -0
  172. package/dist/collection/index.js +16 -0
  173. package/dist/collection/index.js.map +1 -0
  174. package/dist/collection/locales/de.json +133 -0
  175. package/dist/collection/locales/en.json +133 -0
  176. package/dist/collection/locales/fr.json +133 -0
  177. package/dist/collection/locales/it.json +133 -0
  178. package/dist/collection/locales/nl_be.json +133 -0
  179. package/dist/collection/locales/ro.json +133 -0
  180. package/dist/collection/logger.js +106 -0
  181. package/dist/collection/logger.js.map +1 -0
  182. package/dist/collection/newsletter/api/newsletters.js +189 -0
  183. package/dist/collection/newsletter/api/newsletters.js.map +1 -0
  184. package/dist/collection/newsletter/components/helpers.js +5 -0
  185. package/dist/collection/newsletter/components/helpers.js.map +1 -0
  186. package/dist/collection/newsletter/components/logout-button/logout-button.js +53 -0
  187. package/dist/collection/newsletter/components/logout-button/logout-button.js.map +1 -0
  188. package/dist/collection/newsletter/components/newsletter-checkbox/newsletter-checkbox.js +165 -0
  189. package/dist/collection/newsletter/components/newsletter-checkbox/newsletter-checkbox.js.map +1 -0
  190. package/dist/collection/newsletter/components/newsletter-root/newsletter-root.js +119 -0
  191. package/dist/collection/newsletter/components/newsletter-root/newsletter-root.js.map +1 -0
  192. package/dist/collection/newsletter/components/preference-checkbox/preference-checkbox.js +234 -0
  193. package/dist/collection/newsletter/components/preference-checkbox/preference-checkbox.js.map +1 -0
  194. package/dist/collection/newsletter/components/resend-doi-button/resend-doi-button.css +1 -0
  195. package/dist/collection/newsletter/components/resend-doi-button/resend-doi-button.js +89 -0
  196. package/dist/collection/newsletter/components/resend-doi-button/resend-doi-button.js.map +1 -0
  197. package/dist/collection/newsletter/components/submit-button/newsletter-submit-button.js +18 -0
  198. package/dist/collection/newsletter/components/submit-button/newsletter-submit-button.js.map +1 -0
  199. package/dist/collection/newsletter/components/toggle-subscription-button/toggle-subscription-button.css +1 -0
  200. package/dist/collection/newsletter/components/toggle-subscription-button/toggle-subscription-button.js +154 -0
  201. package/dist/collection/newsletter/components/toggle-subscription-button/toggle-subscription-button.js.map +1 -0
  202. package/dist/collection/newsletter/index.js +11 -0
  203. package/dist/collection/newsletter/index.js.map +1 -0
  204. package/dist/collection/newsletter/newsletter-helpers.js +277 -0
  205. package/dist/collection/newsletter/newsletter-helpers.js.map +1 -0
  206. package/dist/collection/newsletter/store/newsletter-store.js +34 -0
  207. package/dist/collection/newsletter/store/newsletter-store.js.map +1 -0
  208. package/dist/collection/profile/api/profile.js +168 -0
  209. package/dist/collection/profile/api/profile.js.map +1 -0
  210. package/dist/collection/profile/components/field/field.css +1 -0
  211. package/dist/collection/profile/components/field/field.js +355 -0
  212. package/dist/collection/profile/components/field/field.js.map +1 -0
  213. package/dist/collection/profile/components/full-profile/full-profile.css +1 -0
  214. package/dist/collection/profile/components/full-profile/full-profile.js +78 -0
  215. package/dist/collection/profile/components/full-profile/full-profile.js.map +1 -0
  216. package/dist/collection/profile/components/profile/profile.js +250 -0
  217. package/dist/collection/profile/components/profile/profile.js.map +1 -0
  218. package/dist/collection/profile/components/raw-field/raw-field.js +697 -0
  219. package/dist/collection/profile/components/raw-field/raw-field.js.map +1 -0
  220. package/dist/collection/profile/components/raw-input-fields/Input.js +3 -0
  221. package/dist/collection/profile/components/raw-input-fields/Input.js.map +1 -0
  222. package/dist/collection/profile/components/raw-input-fields/MultiSelect.js +8 -0
  223. package/dist/collection/profile/components/raw-input-fields/MultiSelect.js.map +1 -0
  224. package/dist/collection/profile/components/raw-input-fields/RadioGroup.js +8 -0
  225. package/dist/collection/profile/components/raw-input-fields/RadioGroup.js.map +1 -0
  226. package/dist/collection/profile/components/raw-input-fields/Select.js +11 -0
  227. package/dist/collection/profile/components/raw-input-fields/Select.js.map +1 -0
  228. package/dist/collection/profile/components/raw-input-fields/Textarea.js +3 -0
  229. package/dist/collection/profile/components/raw-input-fields/Textarea.js.map +1 -0
  230. package/dist/collection/profile/components/submit-button/profile-submit-button.js +17 -0
  231. package/dist/collection/profile/components/submit-button/profile-submit-button.js.map +1 -0
  232. package/dist/collection/profile/index.js +12 -0
  233. package/dist/collection/profile/index.js.map +1 -0
  234. package/dist/collection/profile/profile-helpers.js +31 -0
  235. package/dist/collection/profile/profile-helpers.js.map +1 -0
  236. package/dist/collection/profile/store/profile-store.js +15 -0
  237. package/dist/collection/profile/store/profile-store.js.map +1 -0
  238. package/dist/collection/sdk.css +39 -0
  239. package/dist/collection/shared/component-utils.js +35 -0
  240. package/dist/collection/shared/component-utils.js.map +1 -0
  241. package/dist/collection/shared/components/conditional-render/conditional-render.js +177 -0
  242. package/dist/collection/shared/components/conditional-render/conditional-render.js.map +1 -0
  243. package/dist/collection/shared/components/config/config.js +284 -0
  244. package/dist/collection/shared/components/config/config.js.map +1 -0
  245. package/dist/collection/shared/components/email-field/email-field.css +1 -0
  246. package/dist/collection/shared/components/email-field/email-field.js +145 -0
  247. package/dist/collection/shared/components/email-field/email-field.js.map +1 -0
  248. package/dist/collection/shared/components/error-message/error-message.js +141 -0
  249. package/dist/collection/shared/components/error-message/error-message.js.map +1 -0
  250. package/dist/collection/shared/components/flash-message/close-icon.js +3 -0
  251. package/dist/collection/shared/components/flash-message/close-icon.js.map +1 -0
  252. package/dist/collection/shared/components/flash-message/flash-message.css +1 -0
  253. package/dist/collection/shared/components/flash-message/flash-message.js +79 -0
  254. package/dist/collection/shared/components/flash-message/flash-message.js.map +1 -0
  255. package/dist/collection/shared/components/spinner/spinner.css +1 -0
  256. package/dist/collection/shared/components/spinner/spinner.js +19 -0
  257. package/dist/collection/shared/components/spinner/spinner.js.map +1 -0
  258. package/dist/collection/shared/components/submit-button/context.js +10 -0
  259. package/dist/collection/shared/components/submit-button/context.js.map +1 -0
  260. package/dist/collection/shared/components/submit-button/submit-button.css +1 -0
  261. package/dist/collection/shared/components/submit-button/submit-button.js +198 -0
  262. package/dist/collection/shared/components/submit-button/submit-button.js.map +1 -0
  263. package/dist/collection/shared/store/flash-store.js +43 -0
  264. package/dist/collection/shared/store/flash-store.js.map +1 -0
  265. package/dist/collection/shared/store/unidy-store.js +33 -0
  266. package/dist/collection/shared/store/unidy-store.js.map +1 -0
  267. package/dist/collection/ticketable/api/get-with-schema.js +35 -0
  268. package/dist/collection/ticketable/api/get-with-schema.js.map +1 -0
  269. package/dist/collection/ticketable/api/schemas.js +12 -0
  270. package/dist/collection/ticketable/api/schemas.js.map +1 -0
  271. package/dist/collection/ticketable/api/subscriptions.js +47 -0
  272. package/dist/collection/ticketable/api/subscriptions.js.map +1 -0
  273. package/dist/collection/ticketable/api/tickets.js +48 -0
  274. package/dist/collection/ticketable/api/tickets.js.map +1 -0
  275. package/dist/collection/ticketable/components/pagination/pagination-button.js +108 -0
  276. package/dist/collection/ticketable/components/pagination/pagination-button.js.map +1 -0
  277. package/dist/collection/ticketable/components/pagination/pagination-page.js +69 -0
  278. package/dist/collection/ticketable/components/pagination/pagination-page.js.map +1 -0
  279. package/dist/collection/ticketable/components/ticketable-list/skeleton-helpers.js +54 -0
  280. package/dist/collection/ticketable/components/ticketable-list/skeleton-helpers.js.map +1 -0
  281. package/dist/collection/ticketable/components/ticketable-list/ticketable-list.js +505 -0
  282. package/dist/collection/ticketable/components/ticketable-list/ticketable-list.js.map +1 -0
  283. package/dist/collection/ticketable/index.js +13 -0
  284. package/dist/collection/ticketable/index.js.map +1 -0
  285. package/dist/collection/ticketable/store/pagination-store.js +9 -0
  286. package/dist/collection/ticketable/store/pagination-store.js.map +1 -0
  287. package/dist/components/auth-store.js +182 -0
  288. package/dist/components/auth-store.js.map +1 -0
  289. package/dist/components/auth.js +613 -0
  290. package/dist/components/auth.js.map +1 -0
  291. package/dist/components/component-utils.js +39 -0
  292. package/dist/components/component-utils.js.map +1 -0
  293. package/dist/components/exports.js +4262 -0
  294. package/dist/components/exports.js.map +1 -0
  295. package/dist/components/field.js +134 -0
  296. package/dist/components/field.js.map +1 -0
  297. package/dist/components/flash-store.js +47 -0
  298. package/dist/components/flash-store.js.map +1 -0
  299. package/dist/components/helpers.js +9 -0
  300. package/dist/components/helpers.js.map +1 -0
  301. package/dist/components/helpers2.js +9 -0
  302. package/dist/components/helpers2.js.map +1 -0
  303. package/dist/components/i18n.js +3070 -0
  304. package/dist/components/i18n.js.map +1 -0
  305. package/dist/components/index.d.ts +33 -0
  306. package/dist/components/index.js +5929 -0
  307. package/dist/components/index.js.map +1 -0
  308. package/dist/components/index2.js +6327 -0
  309. package/dist/components/index2.js.map +1 -0
  310. package/dist/components/index3.js +281 -0
  311. package/dist/components/index3.js.map +1 -0
  312. package/dist/components/logger.js +111 -0
  313. package/dist/components/logger.js.map +1 -0
  314. package/dist/components/newsletter-helpers.js +278 -0
  315. package/dist/components/newsletter-helpers.js.map +1 -0
  316. package/dist/components/newsletter-store.js +34 -0
  317. package/dist/components/newsletter-store.js.map +1 -0
  318. package/dist/components/pagination-store.js +14 -0
  319. package/dist/components/pagination-store.js.map +1 -0
  320. package/dist/components/profile-helpers.js +36 -0
  321. package/dist/components/profile-helpers.js.map +1 -0
  322. package/dist/components/profile-store.js +18 -0
  323. package/dist/components/profile-store.js.map +1 -0
  324. package/dist/components/profile.js +151 -0
  325. package/dist/components/profile.js.map +1 -0
  326. package/dist/components/raw-field.js +318 -0
  327. package/dist/components/raw-field.js.map +1 -0
  328. package/dist/components/spinner.js +35 -0
  329. package/dist/components/spinner.js.map +1 -0
  330. package/dist/components/submit-button.js +233 -0
  331. package/dist/components/submit-button.js.map +1 -0
  332. package/dist/components/u-conditional-render.d.ts +11 -0
  333. package/dist/components/u-conditional-render.js +120 -0
  334. package/dist/components/u-conditional-render.js.map +1 -0
  335. package/dist/components/u-config.d.ts +11 -0
  336. package/dist/components/u-config.js +118 -0
  337. package/dist/components/u-config.js.map +1 -0
  338. package/dist/components/u-email-field.d.ts +11 -0
  339. package/dist/components/u-email-field.js +99 -0
  340. package/dist/components/u-email-field.js.map +1 -0
  341. package/dist/components/u-error-message.d.ts +11 -0
  342. package/dist/components/u-error-message.js +105 -0
  343. package/dist/components/u-error-message.js.map +1 -0
  344. package/dist/components/u-field.d.ts +11 -0
  345. package/dist/components/u-field.js +9 -0
  346. package/dist/components/u-field.js.map +1 -0
  347. package/dist/components/u-flash-message.d.ts +11 -0
  348. package/dist/components/u-flash-message.js +58 -0
  349. package/dist/components/u-flash-message.js.map +1 -0
  350. package/dist/components/u-full-profile.d.ts +11 -0
  351. package/dist/components/u-full-profile.js +87 -0
  352. package/dist/components/u-full-profile.js.map +1 -0
  353. package/dist/components/u-logout-button.d.ts +11 -0
  354. package/dist/components/u-logout-button.js +61 -0
  355. package/dist/components/u-logout-button.js.map +1 -0
  356. package/dist/components/u-magic-code-field.d.ts +11 -0
  357. package/dist/components/u-magic-code-field.js +106 -0
  358. package/dist/components/u-magic-code-field.js.map +1 -0
  359. package/dist/components/u-missing-field.d.ts +11 -0
  360. package/dist/components/u-missing-field.js +51 -0
  361. package/dist/components/u-missing-field.js.map +1 -0
  362. package/dist/components/u-missing-fields-submit-button.d.ts +11 -0
  363. package/dist/components/u-missing-fields-submit-button.js +70 -0
  364. package/dist/components/u-missing-fields-submit-button.js.map +1 -0
  365. package/dist/components/u-newsletter-checkbox.d.ts +11 -0
  366. package/dist/components/u-newsletter-checkbox.js +93 -0
  367. package/dist/components/u-newsletter-checkbox.js.map +1 -0
  368. package/dist/components/u-newsletter-logout-button.d.ts +11 -0
  369. package/dist/components/u-newsletter-logout-button.js +56 -0
  370. package/dist/components/u-newsletter-logout-button.js.map +1 -0
  371. package/dist/components/u-newsletter-preference-checkbox.d.ts +11 -0
  372. package/dist/components/u-newsletter-preference-checkbox.js +140 -0
  373. package/dist/components/u-newsletter-preference-checkbox.js.map +1 -0
  374. package/dist/components/u-newsletter-resend-doi-button.d.ts +11 -0
  375. package/dist/components/u-newsletter-resend-doi-button.js +70 -0
  376. package/dist/components/u-newsletter-resend-doi-button.js.map +1 -0
  377. package/dist/components/u-newsletter-root.d.ts +11 -0
  378. package/dist/components/u-newsletter-root.js +90 -0
  379. package/dist/components/u-newsletter-root.js.map +1 -0
  380. package/dist/components/u-newsletter-toggle-subscription-button.d.ts +11 -0
  381. package/dist/components/u-newsletter-toggle-subscription-button.js +97 -0
  382. package/dist/components/u-newsletter-toggle-subscription-button.js.map +1 -0
  383. package/dist/components/u-pagination-button.d.ts +11 -0
  384. package/dist/components/u-pagination-button.js +86 -0
  385. package/dist/components/u-pagination-button.js.map +1 -0
  386. package/dist/components/u-pagination-page.d.ts +11 -0
  387. package/dist/components/u-pagination-page.js +66 -0
  388. package/dist/components/u-pagination-page.js.map +1 -0
  389. package/dist/components/u-passkey.d.ts +11 -0
  390. package/dist/components/u-passkey.js +65 -0
  391. package/dist/components/u-passkey.js.map +1 -0
  392. package/dist/components/u-password-field.d.ts +11 -0
  393. package/dist/components/u-password-field.js +127 -0
  394. package/dist/components/u-password-field.js.map +1 -0
  395. package/dist/components/u-profile.d.ts +11 -0
  396. package/dist/components/u-profile.js +9 -0
  397. package/dist/components/u-profile.js.map +1 -0
  398. package/dist/components/u-raw-field.d.ts +11 -0
  399. package/dist/components/u-raw-field.js +9 -0
  400. package/dist/components/u-raw-field.js.map +1 -0
  401. package/dist/components/u-registration-button.d.ts +11 -0
  402. package/dist/components/u-registration-button.js +70 -0
  403. package/dist/components/u-registration-button.js.map +1 -0
  404. package/dist/components/u-reset-password-button.d.ts +11 -0
  405. package/dist/components/u-reset-password-button.js +72 -0
  406. package/dist/components/u-reset-password-button.js.map +1 -0
  407. package/dist/components/u-send-magic-code-button.d.ts +11 -0
  408. package/dist/components/u-send-magic-code-button.js +85 -0
  409. package/dist/components/u-send-magic-code-button.js.map +1 -0
  410. package/dist/components/u-signed-in.d.ts +11 -0
  411. package/dist/components/u-signed-in.js +44 -0
  412. package/dist/components/u-signed-in.js.map +1 -0
  413. package/dist/components/u-signin-root.d.ts +11 -0
  414. package/dist/components/u-signin-root.js +63 -0
  415. package/dist/components/u-signin-root.js.map +1 -0
  416. package/dist/components/u-signin-step.d.ts +11 -0
  417. package/dist/components/u-signin-step.js +84 -0
  418. package/dist/components/u-signin-step.js.map +1 -0
  419. package/dist/components/u-signin-strategy.d.ts +11 -0
  420. package/dist/components/u-signin-strategy.js +50 -0
  421. package/dist/components/u-signin-strategy.js.map +1 -0
  422. package/dist/components/u-social-login-button.d.ts +11 -0
  423. package/dist/components/u-social-login-button.js +125 -0
  424. package/dist/components/u-social-login-button.js.map +1 -0
  425. package/dist/components/u-spinner.d.ts +11 -0
  426. package/dist/components/u-spinner.js +9 -0
  427. package/dist/components/u-spinner.js.map +1 -0
  428. package/dist/components/u-submit-button.d.ts +11 -0
  429. package/dist/components/u-submit-button.js +9 -0
  430. package/dist/components/u-submit-button.js.map +1 -0
  431. package/dist/components/u-ticketable-list.d.ts +11 -0
  432. package/dist/components/u-ticketable-list.js +6130 -0
  433. package/dist/components/u-ticketable-list.js.map +1 -0
  434. package/dist/components/unidy-store.js +37 -0
  435. package/dist/components/unidy-store.js.map +1 -0
  436. package/dist/esm/app-globals-BHWOrMsm.js +8 -0
  437. package/dist/esm/app-globals-BHWOrMsm.js.map +1 -0
  438. package/dist/esm/auth-CAHM6e4m.js +612 -0
  439. package/dist/esm/auth-CAHM6e4m.js.map +1 -0
  440. package/dist/esm/auth-store-ItTnEMlF.js +182 -0
  441. package/dist/esm/auth-store-ItTnEMlF.js.map +1 -0
  442. package/dist/esm/component-utils-BGq0leDV.js +39 -0
  443. package/dist/esm/component-utils-BGq0leDV.js.map +1 -0
  444. package/dist/esm/flash-store-CMXH65i_.js +47 -0
  445. package/dist/esm/flash-store-CMXH65i_.js.map +1 -0
  446. package/dist/esm/helpers-BqFCd65h.js +9 -0
  447. package/dist/esm/helpers-BqFCd65h.js.map +1 -0
  448. package/dist/esm/helpers-DUHc_Cx7.js +9 -0
  449. package/dist/esm/helpers-DUHc_Cx7.js.map +1 -0
  450. package/dist/esm/i18n-OKf8uE5j.js +3069 -0
  451. package/dist/esm/i18n-OKf8uE5j.js.map +1 -0
  452. package/dist/esm/index-COQ27Nb6.js +14684 -0
  453. package/dist/esm/index-COQ27Nb6.js.map +1 -0
  454. package/dist/esm/index-DVkRTYPC.js +281 -0
  455. package/dist/esm/index-DVkRTYPC.js.map +1 -0
  456. package/dist/esm/index-Du3hUdhU.js +6325 -0
  457. package/dist/esm/index-Du3hUdhU.js.map +1 -0
  458. package/dist/esm/index.js +40 -0
  459. package/dist/esm/index.js.map +1 -0
  460. package/dist/esm/loader.js +12 -0
  461. package/dist/esm/loader.js.map +1 -0
  462. package/dist/esm/newsletter-helpers-ChXON0f4.js +278 -0
  463. package/dist/esm/newsletter-helpers-ChXON0f4.js.map +1 -0
  464. package/dist/esm/newsletter-store-CIsyE51r.js +34 -0
  465. package/dist/esm/newsletter-store-CIsyE51r.js.map +1 -0
  466. package/dist/esm/pagination-store-B9lk_lqK.js +14 -0
  467. package/dist/esm/pagination-store-B9lk_lqK.js.map +1 -0
  468. package/dist/esm/profile-helpers-Beduxnin.js +36 -0
  469. package/dist/esm/profile-helpers-Beduxnin.js.map +1 -0
  470. package/dist/esm/profile-store-CsSDT9Tb.js +18 -0
  471. package/dist/esm/profile-store-CsSDT9Tb.js.map +1 -0
  472. package/dist/esm/sdk.js +49 -0
  473. package/dist/esm/sdk.js.map +1 -0
  474. package/dist/esm/u-conditional-render.entry.js +100 -0
  475. package/dist/esm/u-conditional-render.entry.js.map +1 -0
  476. package/dist/esm/u-config.entry.js +89 -0
  477. package/dist/esm/u-config.entry.js.map +1 -0
  478. package/dist/esm/u-email-field.entry.js +75 -0
  479. package/dist/esm/u-email-field.entry.js.map +1 -0
  480. package/dist/esm/u-error-message.entry.js +80 -0
  481. package/dist/esm/u-error-message.entry.js.map +1 -0
  482. package/dist/esm/u-field.u-raw-field.entry.js.map +1 -0
  483. package/dist/esm/u-field_2.entry.js +368 -0
  484. package/dist/esm/u-flash-message.entry.js +35 -0
  485. package/dist/esm/u-flash-message.entry.js.map +1 -0
  486. package/dist/esm/u-full-profile.entry.js +35 -0
  487. package/dist/esm/u-full-profile.entry.js.map +1 -0
  488. package/dist/esm/u-logout-button.u-signed-in.entry.js.map +1 -0
  489. package/dist/esm/u-logout-button_2.entry.js +59 -0
  490. package/dist/esm/u-magic-code-field.entry.js +89 -0
  491. package/dist/esm/u-magic-code-field.entry.js.map +1 -0
  492. package/dist/esm/u-missing-field.entry.js +20 -0
  493. package/dist/esm/u-missing-field.entry.js.map +1 -0
  494. package/dist/esm/u-missing-fields-submit-button.entry.js +44 -0
  495. package/dist/esm/u-missing-fields-submit-button.entry.js.map +1 -0
  496. package/dist/esm/u-newsletter-checkbox.entry.js +75 -0
  497. package/dist/esm/u-newsletter-checkbox.entry.js.map +1 -0
  498. package/dist/esm/u-newsletter-logout-button.entry.js +39 -0
  499. package/dist/esm/u-newsletter-logout-button.entry.js.map +1 -0
  500. package/dist/esm/u-newsletter-preference-checkbox.entry.js +118 -0
  501. package/dist/esm/u-newsletter-preference-checkbox.entry.js.map +1 -0
  502. package/dist/esm/u-newsletter-resend-doi-button.entry.js +47 -0
  503. package/dist/esm/u-newsletter-resend-doi-button.entry.js.map +1 -0
  504. package/dist/esm/u-newsletter-root.entry.js +70 -0
  505. package/dist/esm/u-newsletter-root.entry.js.map +1 -0
  506. package/dist/esm/u-newsletter-toggle-subscription-button.entry.js +71 -0
  507. package/dist/esm/u-newsletter-toggle-subscription-button.entry.js.map +1 -0
  508. package/dist/esm/u-pagination-button.entry.js +61 -0
  509. package/dist/esm/u-pagination-button.entry.js.map +1 -0
  510. package/dist/esm/u-pagination-page.entry.js +42 -0
  511. package/dist/esm/u-pagination-page.entry.js.map +1 -0
  512. package/dist/esm/u-passkey.entry.js +45 -0
  513. package/dist/esm/u-passkey.entry.js.map +1 -0
  514. package/dist/esm/u-password-field.entry.js +104 -0
  515. package/dist/esm/u-password-field.entry.js.map +1 -0
  516. package/dist/esm/u-profile.u-submit-button.entry.js.map +1 -0
  517. package/dist/esm/u-profile_2.entry.js +326 -0
  518. package/dist/esm/u-registration-button.entry.js +46 -0
  519. package/dist/esm/u-registration-button.entry.js.map +1 -0
  520. package/dist/esm/u-reset-password-button.entry.js +54 -0
  521. package/dist/esm/u-reset-password-button.entry.js.map +1 -0
  522. package/dist/esm/u-send-magic-code-button.entry.js +66 -0
  523. package/dist/esm/u-send-magic-code-button.entry.js.map +1 -0
  524. package/dist/esm/u-signin-root.entry.js +41 -0
  525. package/dist/esm/u-signin-root.entry.js.map +1 -0
  526. package/dist/esm/u-signin-step.entry.js +64 -0
  527. package/dist/esm/u-signin-step.entry.js.map +1 -0
  528. package/dist/esm/u-signin-strategy.entry.js +28 -0
  529. package/dist/esm/u-signin-strategy.entry.js.map +1 -0
  530. package/dist/esm/u-social-login-button.entry.js +98 -0
  531. package/dist/esm/u-social-login-button.entry.js.map +1 -0
  532. package/dist/esm/u-spinner.entry.js +16 -0
  533. package/dist/esm/u-spinner.entry.js.map +1 -0
  534. package/dist/esm/u-ticketable-list.entry.js +6095 -0
  535. package/dist/esm/u-ticketable-list.entry.js.map +1 -0
  536. package/dist/esm/unidy-store-CAcMVdD8.js +37 -0
  537. package/dist/esm/unidy-store-CAcMVdD8.js.map +1 -0
  538. package/dist/index.cjs.js +1 -0
  539. package/dist/index.js +1 -0
  540. package/dist/sdk/index.esm.js +2 -0
  541. package/dist/sdk/index.esm.js.map +1 -0
  542. package/dist/sdk/loader.esm.js.map +1 -0
  543. package/dist/sdk/locales/de.json +133 -0
  544. package/dist/sdk/locales/en.json +133 -0
  545. package/dist/sdk/locales/fr.json +133 -0
  546. package/dist/sdk/locales/it.json +133 -0
  547. package/dist/sdk/locales/nl_be.json +133 -0
  548. package/dist/sdk/locales/ro.json +133 -0
  549. package/dist/sdk/p-1bad3fd0.entry.js +2 -0
  550. package/dist/sdk/p-1bad3fd0.entry.js.map +1 -0
  551. package/dist/sdk/p-1d6982cd.entry.js +2 -0
  552. package/dist/sdk/p-1d6982cd.entry.js.map +1 -0
  553. package/dist/sdk/p-23d8e922.entry.js +2 -0
  554. package/dist/sdk/p-23d8e922.entry.js.map +1 -0
  555. package/dist/sdk/p-2855d3bb.entry.js +2 -0
  556. package/dist/sdk/p-2855d3bb.entry.js.map +1 -0
  557. package/dist/sdk/p-288f37c3.entry.js +2 -0
  558. package/dist/sdk/p-288f37c3.entry.js.map +1 -0
  559. package/dist/sdk/p-32842e98.entry.js +2 -0
  560. package/dist/sdk/p-32842e98.entry.js.map +1 -0
  561. package/dist/sdk/p-34af7470.entry.js +2 -0
  562. package/dist/sdk/p-34af7470.entry.js.map +1 -0
  563. package/dist/sdk/p-39126514.entry.js +2 -0
  564. package/dist/sdk/p-39126514.entry.js.map +1 -0
  565. package/dist/sdk/p-438f62e5.entry.js +2 -0
  566. package/dist/sdk/p-438f62e5.entry.js.map +1 -0
  567. package/dist/sdk/p-46013b2f.entry.js +2 -0
  568. package/dist/sdk/p-46013b2f.entry.js.map +1 -0
  569. package/dist/sdk/p-46cdb255.entry.js +2 -0
  570. package/dist/sdk/p-46cdb255.entry.js.map +1 -0
  571. package/dist/sdk/p-4d9bde6e.entry.js +2 -0
  572. package/dist/sdk/p-4d9bde6e.entry.js.map +1 -0
  573. package/dist/sdk/p-5c40c6ea.entry.js +2 -0
  574. package/dist/sdk/p-5c40c6ea.entry.js.map +1 -0
  575. package/dist/sdk/p-5c8b31bd.entry.js +2 -0
  576. package/dist/sdk/p-5c8b31bd.entry.js.map +1 -0
  577. package/dist/sdk/p-69172b22.entry.js +2 -0
  578. package/dist/sdk/p-69172b22.entry.js.map +1 -0
  579. package/dist/sdk/p-7381aca7.entry.js +2 -0
  580. package/dist/sdk/p-7381aca7.entry.js.map +1 -0
  581. package/dist/sdk/p-BGq0leDV.js +2 -0
  582. package/dist/sdk/p-BGq0leDV.js.map +1 -0
  583. package/dist/sdk/p-BR6L248H.js +2 -0
  584. package/dist/sdk/p-BR6L248H.js.map +1 -0
  585. package/dist/sdk/p-BhrvnKAS.js +2 -0
  586. package/dist/sdk/p-BhrvnKAS.js.map +1 -0
  587. package/dist/sdk/p-BqFCd65h.js +2 -0
  588. package/dist/sdk/p-BqFCd65h.js.map +1 -0
  589. package/dist/sdk/p-CMw6v6sC.js +2 -0
  590. package/dist/sdk/p-CMw6v6sC.js.map +1 -0
  591. package/dist/sdk/p-COQ27Nb6.js +14 -0
  592. package/dist/sdk/p-COQ27Nb6.js.map +1 -0
  593. package/dist/sdk/p-CSLU6kes.js +2 -0
  594. package/dist/sdk/p-CSLU6kes.js.map +1 -0
  595. package/dist/sdk/p-Cai8JwlG.js +2 -0
  596. package/dist/sdk/p-Cai8JwlG.js.map +1 -0
  597. package/dist/sdk/p-CpJghKnM.js +2 -0
  598. package/dist/sdk/p-CpJghKnM.js.map +1 -0
  599. package/dist/sdk/p-DAn4FkxC.js +2 -0
  600. package/dist/sdk/p-DAn4FkxC.js.map +1 -0
  601. package/dist/sdk/p-DUHc_Cx7.js +2 -0
  602. package/dist/sdk/p-DUHc_Cx7.js.map +1 -0
  603. package/dist/sdk/p-FFRhPCmc.js +2 -0
  604. package/dist/sdk/p-FFRhPCmc.js.map +1 -0
  605. package/dist/sdk/p-Jrp0G45B.js +2 -0
  606. package/dist/sdk/p-Jrp0G45B.js.map +1 -0
  607. package/dist/sdk/p-MA26cw6g.js +2 -0
  608. package/dist/sdk/p-MA26cw6g.js.map +1 -0
  609. package/dist/sdk/p-P0eZf5rH.js +2 -0
  610. package/dist/sdk/p-P0eZf5rH.js.map +1 -0
  611. package/dist/sdk/p-PSIHL0wP.js +2 -0
  612. package/dist/sdk/p-PSIHL0wP.js.map +1 -0
  613. package/dist/sdk/p-a341c7f6.entry.js +2 -0
  614. package/dist/sdk/p-a341c7f6.entry.js.map +1 -0
  615. package/dist/sdk/p-a38cd448.entry.js +2 -0
  616. package/dist/sdk/p-a38cd448.entry.js.map +1 -0
  617. package/dist/sdk/p-a45ef398.entry.js +2 -0
  618. package/dist/sdk/p-a45ef398.entry.js.map +1 -0
  619. package/dist/sdk/p-b5a6ad01.entry.js +2 -0
  620. package/dist/sdk/p-b5a6ad01.entry.js.map +1 -0
  621. package/dist/sdk/p-b93bf91d.entry.js +2 -0
  622. package/dist/sdk/p-b93bf91d.entry.js.map +1 -0
  623. package/dist/sdk/p-baf5dcb7.entry.js +2 -0
  624. package/dist/sdk/p-baf5dcb7.entry.js.map +1 -0
  625. package/dist/sdk/p-c07a43e2.entry.js +2 -0
  626. package/dist/sdk/p-c07a43e2.entry.js.map +1 -0
  627. package/dist/sdk/p-c98ad60d.entry.js +2 -0
  628. package/dist/sdk/p-c98ad60d.entry.js.map +1 -0
  629. package/dist/sdk/p-d0c0fb6b.entry.js +2 -0
  630. package/dist/sdk/p-d0c0fb6b.entry.js.map +1 -0
  631. package/dist/sdk/p-d47aaf26.entry.js +2 -0
  632. package/dist/sdk/p-d47aaf26.entry.js.map +1 -0
  633. package/dist/sdk/p-e5ef30ef.entry.js +2 -0
  634. package/dist/sdk/p-e5ef30ef.entry.js.map +1 -0
  635. package/dist/sdk/p-eb348798.entry.js +2 -0
  636. package/dist/sdk/p-eb348798.entry.js.map +1 -0
  637. package/dist/sdk/p-f82f500d.entry.js +2 -0
  638. package/dist/sdk/p-f82f500d.entry.js.map +1 -0
  639. package/dist/sdk/p-f88ed6e8.entry.js +2 -0
  640. package/dist/sdk/p-f88ed6e8.entry.js.map +1 -0
  641. package/dist/sdk/p-f9affafe.entry.js +2 -0
  642. package/dist/sdk/p-f9affafe.entry.js.map +1 -0
  643. package/dist/sdk/p-jyF1XwDG.js +2 -0
  644. package/dist/sdk/p-jyF1XwDG.js.map +1 -0
  645. package/dist/sdk/sdk.css +39 -0
  646. package/dist/sdk/sdk.esm.js +2 -0
  647. package/dist/sdk/sdk.esm.js.map +1 -0
  648. package/dist/sdk/u-conditional-render.entry.esm.js.map +1 -0
  649. package/dist/sdk/u-config.entry.esm.js.map +1 -0
  650. package/dist/sdk/u-email-field.entry.esm.js.map +1 -0
  651. package/dist/sdk/u-error-message.entry.esm.js.map +1 -0
  652. package/dist/sdk/u-field.u-raw-field.entry.esm.js.map +1 -0
  653. package/dist/sdk/u-flash-message.entry.esm.js.map +1 -0
  654. package/dist/sdk/u-full-profile.entry.esm.js.map +1 -0
  655. package/dist/sdk/u-logout-button.u-signed-in.entry.esm.js.map +1 -0
  656. package/dist/sdk/u-magic-code-field.entry.esm.js.map +1 -0
  657. package/dist/sdk/u-missing-field.entry.esm.js.map +1 -0
  658. package/dist/sdk/u-missing-fields-submit-button.entry.esm.js.map +1 -0
  659. package/dist/sdk/u-newsletter-checkbox.entry.esm.js.map +1 -0
  660. package/dist/sdk/u-newsletter-logout-button.entry.esm.js.map +1 -0
  661. package/dist/sdk/u-newsletter-preference-checkbox.entry.esm.js.map +1 -0
  662. package/dist/sdk/u-newsletter-resend-doi-button.entry.esm.js.map +1 -0
  663. package/dist/sdk/u-newsletter-root.entry.esm.js.map +1 -0
  664. package/dist/sdk/u-newsletter-toggle-subscription-button.entry.esm.js.map +1 -0
  665. package/dist/sdk/u-pagination-button.entry.esm.js.map +1 -0
  666. package/dist/sdk/u-pagination-page.entry.esm.js.map +1 -0
  667. package/dist/sdk/u-passkey.entry.esm.js.map +1 -0
  668. package/dist/sdk/u-password-field.entry.esm.js.map +1 -0
  669. package/dist/sdk/u-profile.u-submit-button.entry.esm.js.map +1 -0
  670. package/dist/sdk/u-registration-button.entry.esm.js.map +1 -0
  671. package/dist/sdk/u-reset-password-button.entry.esm.js.map +1 -0
  672. package/dist/sdk/u-send-magic-code-button.entry.esm.js.map +1 -0
  673. package/dist/sdk/u-signin-root.entry.esm.js.map +1 -0
  674. package/dist/sdk/u-signin-step.entry.esm.js.map +1 -0
  675. package/dist/sdk/u-signin-strategy.entry.esm.js.map +1 -0
  676. package/dist/sdk/u-social-login-button.entry.esm.js.map +1 -0
  677. package/dist/sdk/u-spinner.entry.esm.js.map +1 -0
  678. package/dist/sdk/u-ticketable-list.entry.esm.js.map +1 -0
  679. package/dist/types/api/client.d.ts +32 -0
  680. package/dist/types/api/index.d.ts +22 -0
  681. package/dist/types/api/shared.d.ts +20 -0
  682. package/dist/types/auth/api/auth.d.ts +302 -0
  683. package/dist/types/auth/auth-helpers.d.ts +376 -0
  684. package/dist/types/auth/auth.d.ts +62 -0
  685. package/dist/types/auth/components/helpers.d.ts +1 -0
  686. package/dist/types/auth/components/logout-button/logout-button.d.ts +11 -0
  687. package/dist/types/auth/components/magic-code-field/magic-code-field.d.ts +10 -0
  688. package/dist/types/auth/components/missing-field/missing-field.d.ts +4 -0
  689. package/dist/types/auth/components/missing-fields-submit-button/missing-fields-submit-button.d.ts +5 -0
  690. package/dist/types/auth/components/passkey/passkey.d.ts +9 -0
  691. package/dist/types/auth/components/password-field/password-field.d.ts +15 -0
  692. package/dist/types/auth/components/registration/registration-button.d.ts +11 -0
  693. package/dist/types/auth/components/reset-pass-button/reset-pass-button.d.ts +7 -0
  694. package/dist/types/auth/components/send-magic-code-button/send-magic-code-button.d.ts +11 -0
  695. package/dist/types/auth/components/signed-in/signed-in.d.ts +5 -0
  696. package/dist/types/auth/components/signin-root/signin-root.d.ts +14 -0
  697. package/dist/types/auth/components/signin-step/signin-step.d.ts +8 -0
  698. package/dist/types/auth/components/signin-strategy/signin-strategy.d.ts +5 -0
  699. package/dist/types/auth/components/social-logins/logos/apple.d.ts +4 -0
  700. package/dist/types/auth/components/social-logins/logos/discord.d.ts +4 -0
  701. package/dist/types/auth/components/social-logins/logos/facebook.d.ts +4 -0
  702. package/dist/types/auth/components/social-logins/logos/google.d.ts +4 -0
  703. package/dist/types/auth/components/social-logins/logos/linkedin.d.ts +4 -0
  704. package/dist/types/auth/components/social-logins/social-login-button.d.ts +24 -0
  705. package/dist/types/auth/components/submit-button/auth-submit-button.d.ts +3 -0
  706. package/dist/types/auth/error-definitions.d.ts +23 -0
  707. package/dist/types/auth/index.d.ts +15 -0
  708. package/dist/types/auth/passkey-auth.d.ts +2 -0
  709. package/dist/types/auth/store/auth-store.d.ts +58 -0
  710. package/dist/types/components.d.ts +1270 -0
  711. package/dist/types/globalScript.d.ts +1 -0
  712. package/dist/types/i18n.d.ts +3 -0
  713. package/dist/types/index.d.ts +16 -0
  714. package/dist/types/logger.d.ts +55 -0
  715. package/dist/types/newsletter/api/newsletters.d.ts +198 -0
  716. package/dist/types/newsletter/components/helpers.d.ts +1 -0
  717. package/dist/types/newsletter/components/logout-button/logout-button.d.ts +8 -0
  718. package/dist/types/newsletter/components/newsletter-checkbox/newsletter-checkbox.d.ts +15 -0
  719. package/dist/types/newsletter/components/newsletter-root/newsletter-root.d.ts +11 -0
  720. package/dist/types/newsletter/components/preference-checkbox/preference-checkbox.d.ts +28 -0
  721. package/dist/types/newsletter/components/resend-doi-button/resend-doi-button.d.ts +8 -0
  722. package/dist/types/newsletter/components/submit-button/newsletter-submit-button.d.ts +3 -0
  723. package/dist/types/newsletter/components/toggle-subscription-button/toggle-subscription-button.d.ts +12 -0
  724. package/dist/types/newsletter/index.d.ts +10 -0
  725. package/dist/types/newsletter/newsletter-helpers.d.ts +15 -0
  726. package/dist/types/newsletter/store/newsletter-store.d.ts +25 -0
  727. package/dist/types/profile/api/profile.d.ts +238 -0
  728. package/dist/types/profile/components/field/field.d.ts +39 -0
  729. package/dist/types/profile/components/full-profile/full-profile.d.ts +6 -0
  730. package/dist/types/profile/components/profile/profile.d.ts +27 -0
  731. package/dist/types/profile/components/raw-field/raw-field.d.ts +45 -0
  732. package/dist/types/profile/components/raw-input-fields/Input.d.ts +17 -0
  733. package/dist/types/profile/components/raw-input-fields/MultiSelect.d.ts +28 -0
  734. package/dist/types/profile/components/raw-input-fields/RadioGroup.d.ts +30 -0
  735. package/dist/types/profile/components/raw-input-fields/Select.d.ts +24 -0
  736. package/dist/types/profile/components/raw-input-fields/Textarea.d.ts +17 -0
  737. package/dist/types/profile/components/submit-button/profile-submit-button.d.ts +2 -0
  738. package/dist/types/profile/index.d.ts +12 -0
  739. package/dist/types/profile/profile-helpers.d.ts +7 -0
  740. package/dist/types/profile/store/profile-store.d.ts +39 -0
  741. package/dist/types/shared/component-utils.d.ts +16 -0
  742. package/dist/types/shared/components/conditional-render/conditional-render.d.ts +11 -0
  743. package/dist/types/shared/components/config/config.d.ts +32 -0
  744. package/dist/types/shared/components/email-field/email-field.d.ts +13 -0
  745. package/dist/types/shared/components/error-message/error-message.d.ts +15 -0
  746. package/dist/types/shared/components/flash-message/close-icon.d.ts +1 -0
  747. package/dist/types/shared/components/flash-message/flash-message.d.ts +6 -0
  748. package/dist/types/shared/components/spinner/spinner.d.ts +3 -0
  749. package/dist/types/shared/components/submit-button/context.d.ts +9 -0
  750. package/dist/types/shared/components/submit-button/submit-button.d.ts +20 -0
  751. package/dist/types/shared/store/flash-store.d.ts +29 -0
  752. package/dist/types/shared/store/unidy-store.d.ts +12 -0
  753. package/dist/types/stencil-public-runtime.d.ts +1756 -0
  754. package/dist/types/ticketable/api/get-with-schema.d.ts +3 -0
  755. package/dist/types/ticketable/api/schemas.d.ts +18 -0
  756. package/dist/types/ticketable/api/subscriptions.d.ts +84 -0
  757. package/dist/types/ticketable/api/tickets.d.ts +86 -0
  758. package/dist/types/ticketable/components/pagination/pagination-button.d.ts +14 -0
  759. package/dist/types/ticketable/components/pagination/pagination-page.d.ts +12 -0
  760. package/dist/types/ticketable/components/ticketable-list/skeleton-helpers.d.ts +13 -0
  761. package/dist/types/ticketable/components/ticketable-list/ticketable-list.d.ts +41 -0
  762. package/dist/types/ticketable/index.d.ts +12 -0
  763. package/dist/types/ticketable/store/pagination-store.d.ts +10 -0
  764. package/loader/cdn.js +1 -0
  765. package/loader/index.cjs.js +1 -0
  766. package/loader/index.d.ts +24 -0
  767. package/loader/index.es2017.js +1 -0
  768. package/loader/index.js +2 -0
  769. package/package.json +23 -18
@@ -0,0 +1,41 @@
1
+ 'use strict';
2
+
3
+ var index = require('./index-DxENvy7x.js');
4
+
5
+ const initialState = {
6
+ mode: "production",
7
+ apiKey: "",
8
+ baseUrl: "",
9
+ locale: "en",
10
+ isConfigured: false,
11
+ backendConnected: true,
12
+ };
13
+ const store = index.createStore(initialState);
14
+ const unidyState = store.state;
15
+ const onChange = store.onChange;
16
+ const CONFIG_TIMEOUT_MS = 1000;
17
+ function waitForConfig() {
18
+ if (unidyState.isConfigured) {
19
+ return Promise.resolve();
20
+ }
21
+ return new Promise((resolve, reject) => {
22
+ const timeout = setTimeout(() => {
23
+ unsubscribe();
24
+ reject(new Error(`Unidy SDK: <u-config> not found or not loaded within ${CONFIG_TIMEOUT_MS}ms`));
25
+ }, CONFIG_TIMEOUT_MS);
26
+ const unsubscribe = onChange("isConfigured", (value) => {
27
+ if (value) {
28
+ clearTimeout(timeout);
29
+ unsubscribe();
30
+ resolve();
31
+ }
32
+ });
33
+ });
34
+ }
35
+
36
+ exports.onChange = onChange;
37
+ exports.unidyState = unidyState;
38
+ exports.waitForConfig = waitForConfig;
39
+ //# sourceMappingURL=unidy-store-zhdhlK0a.js.map
40
+
41
+ //# sourceMappingURL=unidy-store-zhdhlK0a.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unidy-store-zhdhlK0a.js","sources":["src/shared/store/unidy-store.ts"],"sourcesContent":["import { createStore } from \"@stencil/store\";\n\nexport interface UnidyState {\n mode: \"production\" | \"development\";\n apiKey: string;\n baseUrl: string;\n locale: string;\n\n isConfigured: boolean;\n backendConnected: boolean;\n}\n\nconst initialState: UnidyState = {\n mode: \"production\",\n apiKey: \"\",\n baseUrl: \"\",\n locale: \"en\",\n\n isConfigured: false,\n backendConnected: true,\n};\n\nconst store = createStore<UnidyState>(initialState);\n\nexport const unidyState = store.state;\nexport const reset = store.reset;\nexport const onChange: <K extends keyof UnidyState>(prop: K, cb: (value: UnidyState[K]) => void) => () => void = store.onChange;\n\nconst CONFIG_TIMEOUT_MS = 1000;\n\nexport function waitForConfig(): Promise<void> {\n if (unidyState.isConfigured) {\n return Promise.resolve();\n }\n\n return new Promise((resolve, reject) => {\n const timeout = setTimeout(() => {\n unsubscribe();\n reject(new Error(`Unidy SDK: <u-config> not found or not loaded within ${CONFIG_TIMEOUT_MS}ms`));\n }, CONFIG_TIMEOUT_MS);\n\n const unsubscribe = onChange(\"isConfigured\", (value) => {\n if (value) {\n clearTimeout(timeout);\n unsubscribe();\n resolve();\n }\n });\n });\n}\n"],"names":["createStore"],"mappings":";;;;AAYA,MAAM,YAAY,GAAe;AAC/B,IAAA,IAAI,EAAE,YAAY;AAClB,IAAA,MAAM,EAAE,EAAE;AACV,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,MAAM,EAAE,IAAI;AAEZ,IAAA,YAAY,EAAE,KAAK;AACnB,IAAA,gBAAgB,EAAE,IAAI;CACvB;AAED,MAAM,KAAK,GAAGA,iBAAW,CAAa,YAAY,CAAC;AAEtC,MAAA,UAAU,GAAG,KAAK,CAAC;AAEnB,MAAA,QAAQ,GAA4F,KAAK,CAAC;AAEvH,MAAM,iBAAiB,GAAG,IAAI;SAEd,aAAa,GAAA;AAC3B,IAAA,IAAI,UAAU,CAAC,YAAY,EAAE;AAC3B,QAAA,OAAO,OAAO,CAAC,OAAO,EAAE;;IAG1B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,KAAI;AACrC,QAAA,MAAM,OAAO,GAAG,UAAU,CAAC,MAAK;AAC9B,YAAA,WAAW,EAAE;YACb,MAAM,CAAC,IAAI,KAAK,CAAC,wDAAwD,iBAAiB,CAAA,EAAA,CAAI,CAAC,CAAC;SACjG,EAAE,iBAAiB,CAAC;QAErB,MAAM,WAAW,GAAG,QAAQ,CAAC,cAAc,EAAE,CAAC,KAAK,KAAI;YACrD,IAAI,KAAK,EAAE;gBACT,YAAY,CAAC,OAAO,CAAC;AACrB,gBAAA,WAAW,EAAE;AACb,gBAAA,OAAO,EAAE;;AAEb,SAAC,CAAC;AACJ,KAAC,CAAC;AACJ;;;;;;"}
@@ -0,0 +1,144 @@
1
+ import * as Sentry from "@sentry/browser";
2
+ import { t } from "../i18n";
3
+ import { createLogger } from "../logger";
4
+ export class ApiClient {
5
+ baseUrl;
6
+ api_key;
7
+ static CONNECTION_ERROR_MESSAGES = [
8
+ "Failed to fetch",
9
+ "NetworkError",
10
+ "ERR_CONNECTION_REFUSED",
11
+ "ERR_NETWORK",
12
+ "ERR_INTERNET_DISCONNECTED",
13
+ ];
14
+ onConnectionChange;
15
+ logger = createLogger("ApiClient");
16
+ constructor(baseUrl, api_key, onConnectionChange) {
17
+ this.baseUrl = baseUrl;
18
+ this.api_key = api_key;
19
+ this.api_key = api_key;
20
+ this.onConnectionChange = onConnectionChange;
21
+ }
22
+ isConnectionError(error) {
23
+ if (error instanceof Error) {
24
+ return ApiClient.CONNECTION_ERROR_MESSAGES.some((msg) => error.message.includes(msg));
25
+ }
26
+ return false;
27
+ }
28
+ setConnectionStatus(isConnected) {
29
+ if (this.onConnectionChange) {
30
+ this.onConnectionChange(isConnected);
31
+ }
32
+ }
33
+ baseHeaders() {
34
+ const h = new Headers();
35
+ h.set("Content-Type", "application/json");
36
+ h.set("Accept", "application/json");
37
+ h.set("Authorization", `Bearer ${this.api_key}`);
38
+ return h;
39
+ }
40
+ mergeHeaders(base, extra) {
41
+ const out = new Headers(base);
42
+ if (extra) {
43
+ new Headers(extra).forEach((v, k) => {
44
+ out.set(k, v);
45
+ });
46
+ }
47
+ return out;
48
+ }
49
+ async request(method, endpoint, body, headers) {
50
+ let res = null;
51
+ try {
52
+ res = await fetch(`${this.baseUrl}${endpoint}`, {
53
+ method,
54
+ mode: "cors",
55
+ credentials: "include",
56
+ headers: this.mergeHeaders(this.baseHeaders(), headers),
57
+ body: JSON.stringify(body) || undefined,
58
+ });
59
+ let data;
60
+ try {
61
+ data = await res.json();
62
+ }
63
+ catch {
64
+ data = undefined;
65
+ }
66
+ this.setConnectionStatus(true);
67
+ const response = {
68
+ data,
69
+ status: res.status,
70
+ headers: res.headers,
71
+ success: res.ok,
72
+ connectionError: false,
73
+ };
74
+ return response;
75
+ }
76
+ catch (error) {
77
+ const connectionFailed = this.isConnectionError(error);
78
+ if (connectionFailed) {
79
+ this.setConnectionStatus(false);
80
+ Sentry.captureException(error, {
81
+ tags: { error_type: "connection_error" },
82
+ extra: { endpoint, method },
83
+ });
84
+ }
85
+ const response = {
86
+ status: res ? res.status : connectionFailed ? 0 : 500,
87
+ error: error instanceof Error ? error.message : String(error),
88
+ headers: res ? res.headers : new Headers(),
89
+ success: false,
90
+ data: undefined,
91
+ connectionError: connectionFailed,
92
+ };
93
+ return response;
94
+ }
95
+ }
96
+ async get(endpoint, headers) {
97
+ return this.request("GET", endpoint, undefined, headers);
98
+ }
99
+ async post(endpoint, body, headers) {
100
+ return this.request("POST", endpoint, body, headers);
101
+ }
102
+ async patch(endpoint, body, headers) {
103
+ return this.request("PATCH", endpoint, body, headers);
104
+ }
105
+ async delete(endpoint, headers) {
106
+ return this.request("DELETE", endpoint, undefined, headers);
107
+ }
108
+ getWithSchema(returnSchema, urlBuilder, paramSchema) {
109
+ const fn = async (args, params) => {
110
+ // Build URL
111
+ const baseUrl = urlBuilder(args);
112
+ // Validate and parse params with Zod if provided
113
+ let queryString = "";
114
+ if (paramSchema && params) {
115
+ const validatedParams = paramSchema.parse(params);
116
+ queryString = `?${new URLSearchParams(validatedParams).toString()}`;
117
+ }
118
+ const fullUrl = `${baseUrl}${queryString}`;
119
+ const response = await this.get(fullUrl);
120
+ if (!response.success || !response.data) {
121
+ return response;
122
+ }
123
+ const parsed = returnSchema.safeParse(response.data);
124
+ if (!parsed.success) {
125
+ this.logger.error("Invalid response format", parsed.error);
126
+ return {
127
+ ...response,
128
+ success: false,
129
+ error: t("errors.invalid_response_format", {
130
+ defaultValue: "Invalid response format",
131
+ }),
132
+ data: undefined,
133
+ };
134
+ }
135
+ return {
136
+ ...response,
137
+ data: parsed.data,
138
+ };
139
+ };
140
+ // biome-ignore lint/suspicious/noExplicitAny: fn can literally be any function
141
+ return fn;
142
+ }
143
+ }
144
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,CAAC,EAAE,MAAM,SAAS,CAAC;AAC5B,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAiBzC,MAAM,OAAO,SAAS;IAaX;IACA;IAbD,MAAM,CAAU,yBAAyB,GAAG;QAClD,iBAAiB;QACjB,cAAc;QACd,wBAAwB;QACxB,aAAa;QACb,2BAA2B;KAC5B,CAAC;IAEM,kBAAkB,CAAkC;IACpD,MAAM,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;IAE3C,YACS,OAAe,EACf,OAAe,EACtB,kBAAmD;QAF5C,YAAO,GAAP,OAAO,CAAQ;QACf,YAAO,GAAP,OAAO,CAA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,EAAE;YACjD,YAAY;YACZ,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;YAEjC,iDAAiD;YACjD,IAAI,WAAW,GAAG,EAAE,CAAC;YACrB,IAAI,WAAW,IAAI,MAAM,EAAE,CAAC;gBAC1B,MAAM,eAAe,GAAG,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBAClD,WAAW,GAAG,IAAI,IAAI,eAAe,CAAC,eAAyC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC;YAChG,CAAC;YAED,MAAM,OAAO,GAAG,GAAG,OAAO,GAAG,WAAW,EAAE,CAAC;YAC3C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,CAAU,OAAO,CAAC,CAAC;YAElD,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;gBACxC,OAAO,QAAgC,CAAC;YAC1C,CAAC;YAED,MAAM,MAAM,GAAG,YAAY,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YAErD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACpB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,yBAAyB,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;gBAC3D,OAAO;oBACL,GAAG,QAAQ;oBACX,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,CAAC,CAAC,gCAAgC,EAAE;wBACzC,YAAY,EAAE,yBAAyB;qBACxC,CAAC;oBACF,IAAI,EAAE,SAAS;iBAChB,CAAC;YACJ,CAAC;YAED,OAAO;gBACL,GAAG,QAAQ;gBACX,IAAI,EAAE,MAAM,CAAC,IAAI;aAClB,CAAC;QACJ,CAAC,CAAC;QACF,+EAA+E;QAC/E,OAAO,EAAS,CAAC;IACnB,CAAC","sourcesContent":["import * as Sentry from \"@sentry/browser\";\nimport type * as z from \"zod\";\nimport { t } from \"../i18n\";\nimport { createLogger } from \"../logger\";\n\nexport interface ApiResponse<T> {\n data?: T;\n success: boolean;\n status: number;\n headers: Headers;\n error?: Error | string;\n connectionError?: boolean; // when backend is unreachable (network error, connection refused, etc.)\n}\n\nexport type ApiConfig = {\n baseUrl: string;\n apiKey: string;\n onConnectionChange?: (isConnected: boolean) => void;\n};\n\nexport class ApiClient {\n private static readonly CONNECTION_ERROR_MESSAGES = [\n \"Failed to fetch\",\n \"NetworkError\",\n \"ERR_CONNECTION_REFUSED\",\n \"ERR_NETWORK\",\n \"ERR_INTERNET_DISCONNECTED\",\n ];\n\n private onConnectionChange?: (isConnected: boolean) => void;\n private logger = createLogger(\"ApiClient\");\n\n constructor(\n public baseUrl: string,\n public api_key: string,\n onConnectionChange?: (isConnected: boolean) => void,\n ) {\n this.api_key = api_key;\n this.onConnectionChange = onConnectionChange;\n }\n\n private isConnectionError(error: unknown): boolean {\n if (error instanceof Error) {\n return ApiClient.CONNECTION_ERROR_MESSAGES.some((msg) => error.message.includes(msg));\n }\n\n return false;\n }\n\n private setConnectionStatus(isConnected: boolean) {\n if (this.onConnectionChange) {\n this.onConnectionChange(isConnected);\n }\n }\n\n private baseHeaders(): Headers {\n const h = new Headers();\n h.set(\"Content-Type\", \"application/json\");\n h.set(\"Accept\", \"application/json\");\n h.set(\"Authorization\", `Bearer ${this.api_key}`);\n return h;\n }\n\n private mergeHeaders(base: Headers, extra?: HeadersInit): Headers {\n const out = new Headers(base);\n if (extra) {\n new Headers(extra).forEach((v, k) => {\n out.set(k, v);\n });\n }\n return out;\n }\n\n private async request<T>(method: string, endpoint: string, body?: object, headers?: HeadersInit): Promise<ApiResponse<T>> {\n let res: Response | null = null;\n try {\n res = await fetch(`${this.baseUrl}${endpoint}`, {\n method,\n mode: \"cors\",\n credentials: \"include\",\n headers: this.mergeHeaders(this.baseHeaders(), headers),\n body: JSON.stringify(body) || undefined,\n });\n\n let data: T | undefined;\n try {\n data = await res.json();\n } catch {\n data = undefined;\n }\n\n this.setConnectionStatus(true);\n\n const response: ApiResponse<T> = {\n data,\n status: res.status,\n headers: res.headers,\n success: res.ok,\n connectionError: false,\n };\n\n return response;\n } catch (error) {\n const connectionFailed = this.isConnectionError(error);\n\n if (connectionFailed) {\n this.setConnectionStatus(false);\n\n Sentry.captureException(error, {\n tags: { error_type: \"connection_error\" },\n extra: { endpoint, method },\n });\n }\n\n const response: ApiResponse<T> = {\n status: res ? res.status : connectionFailed ? 0 : 500,\n error: error instanceof Error ? error.message : String(error),\n headers: res ? res.headers : new Headers(),\n success: false,\n data: undefined,\n connectionError: connectionFailed,\n };\n\n return response;\n }\n }\n\n async get<T>(endpoint: string, headers?: HeadersInit): Promise<ApiResponse<T>> {\n return this.request<T>(\"GET\", endpoint, undefined, headers);\n }\n\n async post<T>(endpoint: string, body: object, headers?: HeadersInit): Promise<ApiResponse<T>> {\n return this.request<T>(\"POST\", endpoint, body, headers);\n }\n\n async patch<T>(endpoint: string, body: object, headers?: HeadersInit): Promise<ApiResponse<T>> {\n return this.request<T>(\"PATCH\", endpoint, body, headers);\n }\n\n async delete<T>(endpoint: string, headers?: HeadersInit): Promise<ApiResponse<T>> {\n return this.request<T>(\"DELETE\", endpoint, undefined, headers);\n }\n\n getWithSchema<TReturn, TArgs extends object, TParams = undefined>(\n returnSchema: z.ZodSchema<TReturn>,\n urlBuilder: (args: TArgs) => string,\n paramSchema?: z.ZodSchema<TParams>,\n ): TParams extends undefined\n ? (args: TArgs) => Promise<ApiResponse<TReturn>>\n : (args: TArgs, params?: TParams) => Promise<ApiResponse<TReturn>> {\n const fn = async (args: TArgs, params?: TParams) => {\n // Build URL\n const baseUrl = urlBuilder(args);\n\n // Validate and parse params with Zod if provided\n let queryString = \"\";\n if (paramSchema && params) {\n const validatedParams = paramSchema.parse(params);\n queryString = `?${new URLSearchParams(validatedParams as Record<string, string>).toString()}`;\n }\n\n const fullUrl = `${baseUrl}${queryString}`;\n const response = await this.get<unknown>(fullUrl);\n\n if (!response.success || !response.data) {\n return response as ApiResponse<TReturn>;\n }\n\n const parsed = returnSchema.safeParse(response.data);\n\n if (!parsed.success) {\n this.logger.error(\"Invalid response format\", parsed.error);\n return {\n ...response,\n success: false,\n error: t(\"errors.invalid_response_format\", {\n defaultValue: \"Invalid response format\",\n }),\n data: undefined,\n };\n }\n\n return {\n ...response,\n data: parsed.data,\n };\n };\n // biome-ignore lint/suspicious/noExplicitAny: fn can literally be any function\n return fn as any;\n }\n}\n"]}
@@ -0,0 +1,42 @@
1
+ import { AuthService } from "../auth/api/auth";
2
+ import { NewsletterService } from "../newsletter";
3
+ import { ProfileService } from "../profile";
4
+ import { unidyState } from "../shared/store/unidy-store";
5
+ import { SubscriptionsService, TicketsService } from "../ticketable";
6
+ import { ApiClient } from "./client";
7
+ export * from "../auth/api/auth";
8
+ export * from "../newsletter/api/newsletters";
9
+ export * from "../profile/api/profile";
10
+ export * from "../ticketable/api/subscriptions";
11
+ export * from "../ticketable/api/tickets";
12
+ export * from "./shared";
13
+ export class UnidyClient {
14
+ apiClient;
15
+ newsletters;
16
+ profile;
17
+ auth;
18
+ tickets;
19
+ subscriptions;
20
+ constructor(baseUrl, apiKey) {
21
+ this.apiClient = new ApiClient(baseUrl, apiKey, (isConnected) => {
22
+ unidyState.backendConnected = isConnected;
23
+ });
24
+ this.newsletters = new NewsletterService(this.apiClient);
25
+ this.profile = new ProfileService(this.apiClient);
26
+ this.auth = new AuthService(this.apiClient);
27
+ this.tickets = new TicketsService(this.apiClient);
28
+ this.subscriptions = new SubscriptionsService(this.apiClient);
29
+ }
30
+ }
31
+ let instance = null;
32
+ function getUnidyClient() {
33
+ if (!unidyState.isConfigured) {
34
+ throw new Error("Config not initialized. Ensure <u-config> is loaded before making API calls by using waitForConfig() to wait for initialization.");
35
+ }
36
+ if (!instance) {
37
+ instance = new UnidyClient(unidyState.baseUrl, unidyState.apiKey);
38
+ }
39
+ return instance;
40
+ }
41
+ export { getUnidyClient, ApiClient };
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3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AAI,CAAC,SAAS,CAAC,CAAC;IAChE,CAAC;CACF;AAED,IAAI,QAAQ,GAAuB,IAAI,CAAC;AAExC,SAAS,cAAc;IACrB,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CACb,kIAAkI,CACnI,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,QAAQ,GAAG,IAAI,WAAW,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IACpE,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,OAAO,EAAE,cAAc,EAAE,SAAS,EAAe,CAAC","sourcesContent":["import { AuthService } from \"../auth/api/auth\";\nimport { NewsletterService } from \"../newsletter\";\nimport { ProfileService } from \"../profile\";\nimport { unidyState } from \"../shared/store/unidy-store\";\nimport { SubscriptionsService, TicketsService } from \"../ticketable\";\nimport { ApiClient, ApiResponse } from \"./client\";\n\nexport * from \"../auth/api/auth\";\nexport * from \"../newsletter/api/newsletters\";\nexport * from \"../profile/api/profile\";\nexport * from \"../ticketable/api/subscriptions\";\nexport * from \"../ticketable/api/tickets\";\nexport * from \"./shared\";\n\nexport class UnidyClient {\n private apiClient: ApiClient;\n\n newsletters: NewsletterService;\n profile: ProfileService;\n auth: AuthService;\n tickets: TicketsService;\n subscriptions: SubscriptionsService;\n\n constructor(baseUrl: string, apiKey: string) {\n this.apiClient = new ApiClient(baseUrl, apiKey, (isConnected) => {\n unidyState.backendConnected = isConnected;\n });\n\n this.newsletters = new NewsletterService(this.apiClient);\n this.profile = new ProfileService(this.apiClient);\n this.auth = new AuthService(this.apiClient);\n this.tickets = new TicketsService(this.apiClient);\n this.subscriptions = new SubscriptionsService(this.apiClient);\n }\n}\n\nlet instance: UnidyClient | null = null;\n\nfunction getUnidyClient(): UnidyClient {\n if (!unidyState.isConfigured) {\n throw new Error(\n \"Config not initialized. Ensure <u-config> is loaded before making API calls by using waitForConfig() to wait for initialization.\",\n );\n }\n\n if (!instance) {\n instance = new UnidyClient(unidyState.baseUrl, unidyState.apiKey);\n }\n\n return instance;\n}\n\nexport { getUnidyClient, ApiClient, ApiResponse };\n"]}
@@ -0,0 +1,18 @@
1
+ import * as z from "zod";
2
+ export const SchemaValidationErrorSchema = z.object({
3
+ error_identifier: z.string(), // unprocessable entity etc. TODO we can define enum later
4
+ errors: z.array(z.string()),
5
+ });
6
+ export const PaginationMetaSchema = z.object({
7
+ count: z.number(),
8
+ page: z.number(),
9
+ limit: z.number(),
10
+ last: z.number(),
11
+ prev: z.number().nullable(),
12
+ next: z.number().nullable(),
13
+ });
14
+ export const PaginationParamsSchema = z.object({
15
+ page: z.number().int().min(1),
16
+ limit: z.number().int().min(0).max(250),
17
+ });
18
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/api/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,0DAA0D;IACxF,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;CAC5B,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC5B,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;CACxC,CAAC,CAAC","sourcesContent":["import * as z from \"zod\";\n\nexport const SchemaValidationErrorSchema = z.object({\n error_identifier: z.string(), // unprocessable entity etc. TODO we can define enum later\n errors: z.array(z.string()),\n});\n\nexport type SchemaValidationError = z.infer<typeof SchemaValidationErrorSchema>;\n\nexport const PaginationMetaSchema = z.object({\n count: z.number(),\n page: z.number(),\n limit: z.number(),\n last: z.number(),\n prev: z.number().nullable(),\n next: z.number().nullable(),\n});\n\nexport type PaginationMeta = z.infer<typeof PaginationMetaSchema>;\n\nexport const PaginationParamsSchema = z.object({\n page: z.number().int().min(1),\n limit: z.number().int().min(0).max(250),\n});\n\nexport type PaginationParams = z.infer<typeof PaginationParamsSchema>;\n"]}
@@ -0,0 +1,274 @@
1
+ import * as Sentry from "@sentry/browser";
2
+ import * as z from "zod";
3
+ import { SchemaValidationErrorSchema } from "../../api";
4
+ import { UserProfileSchema } from "../../profile";
5
+ import { unidyState } from "../../shared/store/unidy-store";
6
+ const LoginOptionsSchema = z.object({
7
+ magic_link: z.boolean(),
8
+ password: z.boolean(),
9
+ social_logins: z.array(z.string()),
10
+ passkey: z.boolean(),
11
+ });
12
+ const CreateSignInResponseSchema = z.object({
13
+ sid: z.string(),
14
+ status: z.enum(["pending_verification", "authenticated", "completed"]),
15
+ email: z.string(),
16
+ expired: z.boolean(),
17
+ login_options: LoginOptionsSchema,
18
+ });
19
+ const ErrorSchema = z.object({
20
+ error_identifier: z.string(),
21
+ });
22
+ const SendMagicCodeResponseSchema = z.object({
23
+ enable_resend_after: z.number(),
24
+ sid: z.string().optional(),
25
+ });
26
+ const SendMagicCodeErrorSchema = z.object({
27
+ error_identifier: z.string(),
28
+ enable_resend_after: z.number(),
29
+ });
30
+ const TokenResponseSchema = z.object({
31
+ jwt: z.string(),
32
+ sid: z.string().optional(),
33
+ });
34
+ const RequiredFieldsResponseSchema = z.object({
35
+ error_identifier: z.literal("missing_required_fields"),
36
+ fields: UserProfileSchema.omit({ custom_attributes: true }).partial().extend({
37
+ custom_attributes: UserProfileSchema.shape.custom_attributes?.optional(),
38
+ }),
39
+ sid: z.string().optional(),
40
+ });
41
+ const InvalidPasswordResponseSchema = z.object({
42
+ error_details: z.object({
43
+ password: z.array(z.string()),
44
+ }),
45
+ });
46
+ const PasskeyOptionsResponseSchema = z.object({
47
+ challenge: z.string(),
48
+ timeout: z.number(),
49
+ rpId: z.string(),
50
+ userVerification: z.string(),
51
+ allowCredentials: z.array(z.any()),
52
+ });
53
+ const PasskeyCredentialSchema = z.object({
54
+ id: z.string(),
55
+ rawId: z.string(),
56
+ response: z.object({
57
+ authenticatorData: z.string(),
58
+ clientDataJSON: z.string(),
59
+ signature: z.string(),
60
+ }),
61
+ type: z.string(),
62
+ });
63
+ export class AuthService {
64
+ client;
65
+ constructor(client) {
66
+ this.client = client;
67
+ }
68
+ async createSignIn(email, password, sendMagicCode) {
69
+ const response = await this.client.post("/api/sdk/v1/sign_ins", { email, password, sendMagicCode });
70
+ return this.handleResponse(response, () => {
71
+ if (!response.success) {
72
+ const missing_fields_check = RequiredFieldsResponseSchema.safeParse(response.data);
73
+ if (missing_fields_check.success) {
74
+ return ["missing_required_fields", missing_fields_check.data];
75
+ }
76
+ const error_response = ErrorSchema.parse(response.data);
77
+ return [
78
+ error_response.error_identifier,
79
+ error_response,
80
+ ];
81
+ }
82
+ if (password) {
83
+ return [null, TokenResponseSchema.parse(response.data)];
84
+ }
85
+ if (sendMagicCode) {
86
+ return [null, SendMagicCodeResponseSchema.parse(response.data)];
87
+ }
88
+ return [null, CreateSignInResponseSchema.parse(response.data)];
89
+ });
90
+ }
91
+ async sendMagicCode(signInId) {
92
+ const response = await this.client.post(`/api/sdk/v1/sign_ins/${signInId}/send_magic_code`, {});
93
+ return this.handleResponse(response, () => {
94
+ if (!response.success) {
95
+ try {
96
+ const error_response = SendMagicCodeErrorSchema.parse(response.data);
97
+ return ["magic_code_recently_created", error_response];
98
+ }
99
+ catch {
100
+ const error_response = ErrorSchema.parse(response.data);
101
+ return [error_response.error_identifier, error_response];
102
+ }
103
+ }
104
+ return [null, SendMagicCodeResponseSchema.parse(response.data)];
105
+ });
106
+ }
107
+ async authenticateWithPassword(signInId, password) {
108
+ const response = await this.client.post(`/api/sdk/v1/sign_ins/${signInId}/authenticate`, {
109
+ password,
110
+ });
111
+ return this.handleResponse(response, () => {
112
+ if (!response.success) {
113
+ const missing_fields_check = RequiredFieldsResponseSchema.safeParse(response.data);
114
+ if (missing_fields_check.success) {
115
+ return ["missing_required_fields", missing_fields_check.data];
116
+ }
117
+ const error_response = ErrorSchema.parse(response.data);
118
+ return [
119
+ error_response.error_identifier,
120
+ error_response,
121
+ ];
122
+ }
123
+ return [null, TokenResponseSchema.parse(response.data)];
124
+ });
125
+ }
126
+ // biome-ignore lint/suspicious/noExplicitAny: user fields are dynamic
127
+ async updateMissingFields(signInId, user) {
128
+ const response = await this.client.patch(`/api/sdk/v1/sign_ins/${signInId}/update_required_fields`, {
129
+ user,
130
+ });
131
+ return this.handleResponse(response, () => {
132
+ if (!response.success) {
133
+ const missing_fields_check = RequiredFieldsResponseSchema.safeParse(response.data);
134
+ if (missing_fields_check.success) {
135
+ return ["missing_required_fields", missing_fields_check.data];
136
+ }
137
+ const error_response = ErrorSchema.parse(response.data);
138
+ return [error_response.error_identifier, error_response];
139
+ }
140
+ return [null, TokenResponseSchema.parse(response.data)];
141
+ });
142
+ }
143
+ async authenticateWithMagicCode(signInId, code) {
144
+ const response = await this.client.post(`/api/sdk/v1/sign_ins/${signInId}/authenticate`, {
145
+ code,
146
+ });
147
+ return this.handleResponse(response, () => {
148
+ if (!response.success) {
149
+ const missing_fields_check = RequiredFieldsResponseSchema.safeParse(response.data);
150
+ if (missing_fields_check.success) {
151
+ return ["missing_required_fields", missing_fields_check.data];
152
+ }
153
+ const error_response = ErrorSchema.parse(response.data);
154
+ return [
155
+ error_response.error_identifier,
156
+ error_response,
157
+ ];
158
+ }
159
+ return [null, TokenResponseSchema.parse(response.data)];
160
+ });
161
+ }
162
+ async refreshToken(signInId) {
163
+ const response = await this.client.post(`/api/sdk/v1/sign_ins/${signInId}/refresh_token`, {});
164
+ return this.handleResponse(response, () => {
165
+ if (!response.success) {
166
+ const error_response = ErrorSchema.parse(response.data);
167
+ return [error_response.error_identifier, error_response];
168
+ }
169
+ return [null, TokenResponseSchema.parse(response.data)];
170
+ });
171
+ }
172
+ async sendResetPasswordEmail(signInId, returnTo) {
173
+ const response = await this.client.post(`/api/sdk/v1/sign_ins/${signInId}/password_reset/send`, { return_to: returnTo });
174
+ return this.handleResponse(response, () => {
175
+ if (!response.success) {
176
+ const error_response = ErrorSchema.parse(response.data);
177
+ return [
178
+ error_response.error_identifier,
179
+ error_response,
180
+ ];
181
+ }
182
+ return [null, null];
183
+ });
184
+ }
185
+ async resetPassword(signInId, token, password, passwordConfirmation) {
186
+ const response = await this.client.patch(`/api/sdk/v1/sign_ins/${signInId}/password_reset`, {
187
+ token,
188
+ password,
189
+ password_confirmation: passwordConfirmation,
190
+ });
191
+ return this.handleResponse(response, () => {
192
+ if (!response.success) {
193
+ const error_response = ErrorSchema.parse(response.data);
194
+ return [
195
+ error_response.error_identifier,
196
+ response.data,
197
+ ];
198
+ }
199
+ return [null, null];
200
+ });
201
+ }
202
+ async validateResetPasswordToken(signInId, token) {
203
+ const response = await this.client.get(`/api/sdk/v1/sign_ins/${signInId}/password_reset?token=${encodeURIComponent(token)}`);
204
+ return this.handleResponse(response, () => {
205
+ if (!response.success) {
206
+ const error_response = ErrorSchema.parse(response.data);
207
+ return [error_response.error_identifier, error_response];
208
+ }
209
+ return [null, null];
210
+ });
211
+ }
212
+ async signOut(signInId, globalLogout = false) {
213
+ const response = await this.client.post(`/api/sdk/v1/sign_ins/${signInId}/sign_out`, { globalLogout });
214
+ return this.handleResponse(response, () => {
215
+ if (!response.success) {
216
+ const error_response = ErrorSchema.parse(response.data);
217
+ return [error_response.error_identifier, error_response];
218
+ }
219
+ return [null, null];
220
+ });
221
+ }
222
+ async signedIn() {
223
+ const response = await this.client.get("/api/sdk/v1/sign_ins/signed_in");
224
+ return this.handleResponse(response, () => {
225
+ if (!response.success) {
226
+ const error_response = ErrorSchema.parse(response.data);
227
+ return ["not_found", error_response];
228
+ }
229
+ return [null, TokenResponseSchema.parse(response.data)];
230
+ });
231
+ }
232
+ async getPasskeyOptions(sid) {
233
+ const endpoint = sid ? `/api/sdk/v1/passkeys/new?sid=${encodeURIComponent(sid)}` : "/api/sdk/v1/passkeys/new";
234
+ const response = await this.client.get(endpoint);
235
+ return this.handleResponse(response, () => {
236
+ if (!response.success) {
237
+ const error_response = ErrorSchema.parse(response.data);
238
+ return ["bad_request", error_response];
239
+ }
240
+ return [null, PasskeyOptionsResponseSchema.parse(response.data)];
241
+ });
242
+ }
243
+ async authenticateWithPasskey(credential) {
244
+ const response = await this.client.post("/api/sdk/v1/passkeys", {
245
+ publicKeyCredential: credential,
246
+ });
247
+ return this.handleResponse(response, () => {
248
+ if (!response.success) {
249
+ const error_response = ErrorSchema.parse(response.data);
250
+ return [
251
+ error_response.error_identifier,
252
+ error_response,
253
+ ];
254
+ }
255
+ return [null, TokenResponseSchema.parse(response.data)];
256
+ });
257
+ }
258
+ handleResponse(
259
+ // biome-ignore lint/suspicious/noExplicitAny: generic handler for all responses
260
+ response, handler) {
261
+ if (response.connectionError) {
262
+ unidyState.backendConnected = false;
263
+ return ["connection_failed", null];
264
+ }
265
+ try {
266
+ return handler();
267
+ }
268
+ catch (error) {
269
+ Sentry.captureException(error);
270
+ return ["schema_validation_error", SchemaValidationErrorSchema.parse(response.data)];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;IAED,KAAK,CAAC,uBAAuB,CAAC,UAA6B;QACzD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAA6C,sBAAsB,EAAE;YAC1G,mBAAmB,EAAE,UAAU;SAChC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,EAAE;YACxC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;gBACtB,MAAM,cAAc,GAAG,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;gBACxD,OAAO;oBACL,cAAc,CAAC,gBAAuG;oBACtH,cAAc;iBACf,CAAC;YACJ,CAAC;YAED,OAAO,CAAC,IAAI,EAAE,mBAAmB,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,cAAc;IACpB,gFAAgF;IAChF,QAAa,EACb,OAAgB;QAEhB,IAAI,QAAQ,CAAC,eAAe,EAAE,CAAC;YAC7B,UAAU,CAAC,gBAAgB,GAAG,KAAK,CAAC;YAEpC,OAAO,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;QACrC,CAAC;QAED,IAAI,CAAC;YACH,OAAO,OAAO,EAAE,CAAC;QACnB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;YAC/B,OAAO,CAAC,yBAAyB,EAAE,2BAA2B,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;QACvF,CAAC;IACH,CAAC;CACF","sourcesContent":["import * as Sentry from \"@sentry/browser\";\nimport * as z from \"zod\";\n\nimport { type ApiClient, type SchemaValidationError, SchemaValidationErrorSchema } from \"../../api\";\nimport { UserProfileSchema } from \"../../profile\";\nimport { unidyState } from \"../../shared/store/unidy-store\";\n\nconst LoginOptionsSchema = z.object({\n magic_link: z.boolean(),\n password: z.boolean(),\n social_logins: z.array(z.string()),\n passkey: z.boolean(),\n});\n\nconst CreateSignInResponseSchema = z.object({\n sid: z.string(),\n status: z.enum([\"pending_verification\", \"authenticated\", \"completed\"]),\n email: z.string(),\n expired: z.boolean(),\n login_options: LoginOptionsSchema,\n});\n\nconst ErrorSchema = z.object({\n error_identifier: z.string(),\n});\n\nconst SendMagicCodeResponseSchema = z.object({\n enable_resend_after: z.number(),\n sid: z.string().optional(),\n});\n\nconst SendMagicCodeErrorSchema = z.object({\n error_identifier: z.string(),\n enable_resend_after: z.number(),\n});\n\nconst TokenResponseSchema = z.object({\n jwt: z.string(),\n sid: z.string().optional(),\n});\n\nconst RequiredFieldsResponseSchema = z.object({\n error_identifier: z.literal(\"missing_required_fields\"),\n fields: UserProfileSchema.omit({ custom_attributes: true }).partial().extend({\n custom_attributes: UserProfileSchema.shape.custom_attributes?.optional(),\n }),\n sid: z.string().optional(),\n});\n\nconst InvalidPasswordResponseSchema = z.object({\n error_details: z.object({\n password: z.array(z.string()),\n }),\n});\n\nexport type ErrorResponse = z.infer<typeof ErrorSchema>;\nexport type LoginOptions = z.infer<typeof LoginOptionsSchema>;\nexport type CreateSignInResponse = z.infer<typeof CreateSignInResponseSchema>;\nexport type TokenResponse = z.infer<typeof TokenResponseSchema>;\nexport type SendMagicCodeResponse = z.infer<typeof SendMagicCodeResponseSchema>;\nexport type RequiredFieldsResponse = z.infer<typeof RequiredFieldsResponseSchema>;\nexport type SendMagicCodeError = z.infer<typeof SendMagicCodeErrorSchema>;\n\ntype CommonErrors = [\"connection_failed\", null] | [\"schema_validation_error\", SchemaValidationError];\n\nexport type CreateSignInResult =\n | CommonErrors\n | [\"account_not_found\", ErrorResponse]\n | [null, CreateSignInResponse]\n | AuthenticateWithPasswordResult\n | SendMagicCodeResult;\n\nexport type AuthenticateResultShared =\n | CommonErrors\n | [\"sign_in_not_found\", ErrorResponse]\n | [\"sign_in_expired\", ErrorResponse]\n | [\"account_locked\", ErrorResponse]\n | [\"missing_required_fields\", RequiredFieldsResponse]\n | [null, TokenResponse];\n\nexport type SendMagicCodeResult =\n | CommonErrors\n | [\"magic_code_recently_created\", SendMagicCodeError]\n | [\"sign_in_not_found\", ErrorResponse]\n | [\"sign_in_expired\", ErrorResponse]\n | [\"account_locked\", ErrorResponse]\n | [null, SendMagicCodeResponse];\n\nexport type AuthenticateWithPasswordResult = [\"invalid_password\", ErrorResponse] | AuthenticateResultShared;\n\nexport type AuthenticateWithMagicCodeResult =\n | [\"not_valid\", ErrorResponse]\n | [\"used\", ErrorResponse]\n | [\"expired\", ErrorResponse]\n | AuthenticateResultShared;\n\nexport type RefreshTokenResult =\n | CommonErrors\n | [\"invalid_refresh_token\", ErrorResponse]\n | [\"refresh_token_revoked\", ErrorResponse]\n | [\"sign_in_not_found\", ErrorResponse]\n | [null, TokenResponse];\n\nexport type SendResetPasswordEmailResult =\n | CommonErrors\n | [\"password_not_set\", ErrorResponse]\n | [\"reset_password_already_sent\", ErrorResponse]\n | [\"sign_in_not_found\", ErrorResponse]\n | [\"invalid_return_to\", ErrorResponse]\n | [\"return_to_required\", ErrorResponse]\n | [null, null];\n\nexport type InvalidPasswordResponse = z.infer<typeof InvalidPasswordResponseSchema>;\n\nexport type ResetPasswordResult =\n | CommonErrors\n | [\"reset_token_missing\", ErrorResponse]\n | [\"invalid_reset_token\", ErrorResponse]\n | [\"reset_token_expired\", ErrorResponse]\n | [\"invalid_password\", InvalidPasswordResponse]\n | [null, null];\n\nexport type ValidateResetPasswordTokenResult =\n | CommonErrors\n | [\"reset_token_missing\", ErrorResponse]\n | [\"invalid_reset_token\", ErrorResponse]\n | [\"reset_token_expired\", ErrorResponse]\n | [null, null];\n\nexport type SignOutResult =\n | CommonErrors\n | [\"sign_in_not_found\", ErrorResponse]\n | [\"missing_id_token\", ErrorResponse]\n | [\"invalid_id_token\", ErrorResponse]\n | [null, null];\n\nexport type SignedInResult = CommonErrors | [\"not_found\", ErrorResponse] | [null, TokenResponse];\n\nconst PasskeyOptionsResponseSchema = z.object({\n challenge: z.string(),\n timeout: z.number(),\n rpId: z.string(),\n userVerification: z.string(),\n allowCredentials: z.array(z.any()),\n});\n\nconst PasskeyCredentialSchema = z.object({\n id: z.string(),\n rawId: z.string(),\n response: z.object({\n authenticatorData: z.string(),\n clientDataJSON: z.string(),\n signature: z.string(),\n }),\n type: z.string(),\n});\n\nexport type PasskeyOptionsResponse = z.infer<typeof PasskeyOptionsResponseSchema>;\nexport type PasskeyCredential = z.infer<typeof PasskeyCredentialSchema>;\n\nexport type GetPasskeyOptionsResult = CommonErrors | [\"bad_request\", ErrorResponse] | [null, PasskeyOptionsResponse];\n\nexport type AuthenticateWithPasskeyResult =\n | CommonErrors\n | [\"invalid_passkey\", ErrorResponse]\n | [\"verification_failed\", ErrorResponse]\n | [\"authentication_failed\", ErrorResponse]\n | [\"bad_request\", ErrorResponse]\n | [null, TokenResponse];\n\nexport class AuthService {\n private client: ApiClient;\n\n constructor(client: ApiClient) {\n this.client = client;\n }\n\n async createSignIn(email: string, password?: string, sendMagicCode?: boolean): Promise<CreateSignInResult> {\n const response = await this.client.post<CreateSignInResponse>(\"/api/sdk/v1/sign_ins\", { email, password, sendMagicCode });\n\n return this.handleResponse(response, () => {\n if (!response.success) {\n const missing_fields_check = RequiredFieldsResponseSchema.safeParse(response.data);\n\n if (missing_fields_check.success) {\n return [\"missing_required_fields\", missing_fields_check.data];\n }\n const error_response = ErrorSchema.parse(response.data);\n return [\n error_response.error_identifier as\n | \"account_not_found\"\n | \"sign_in_not_found\"\n | \"sign_in_expired\"\n | \"account_locked\"\n | \"invalid_password\",\n error_response,\n ];\n }\n\n if (password) {\n return [null, TokenResponseSchema.parse(response.data)];\n }\n\n if (sendMagicCode) {\n return [null, SendMagicCodeResponseSchema.parse(response.data)];\n }\n\n return [null, CreateSignInResponseSchema.parse(response.data)];\n });\n }\n\n async sendMagicCode(signInId: string): Promise<SendMagicCodeResult> {\n const response = await this.client.post<SendMagicCodeResponse>(`/api/sdk/v1/sign_ins/${signInId}/send_magic_code`, {});\n\n return this.handleResponse(response, () => {\n if (!response.success) {\n try {\n const error_response = SendMagicCodeErrorSchema.parse(response.data);\n return [\"magic_code_recently_created\", error_response];\n } catch {\n const error_response = ErrorSchema.parse(response.data);\n return [error_response.error_identifier as \"sign_in_not_found\" | \"sign_in_expired\" | \"account_locked\", error_response];\n }\n }\n\n return [null, SendMagicCodeResponseSchema.parse(response.data)];\n });\n }\n\n async authenticateWithPassword(signInId: string, password: string): Promise<AuthenticateWithPasswordResult> {\n const response = await this.client.post<{ password: string }>(`/api/sdk/v1/sign_ins/${signInId}/authenticate`, {\n password,\n });\n\n return this.handleResponse(response, () => {\n if (!response.success) {\n const missing_fields_check = RequiredFieldsResponseSchema.safeParse(response.data);\n\n if (missing_fields_check.success) {\n return [\"missing_required_fields\", missing_fields_check.data];\n }\n const error_response = ErrorSchema.parse(response.data);\n\n return [\n error_response.error_identifier as \"sign_in_not_found\" | \"sign_in_expired\" | \"account_locked\" | \"invalid_password\",\n error_response,\n ];\n }\n\n return [null, TokenResponseSchema.parse(response.data)];\n });\n }\n\n // biome-ignore lint/suspicious/noExplicitAny: user fields are dynamic\n async updateMissingFields(signInId: string, user: Record<string, any>): Promise<AuthenticateResultShared> {\n const response = await this.client.patch<unknown>(`/api/sdk/v1/sign_ins/${signInId}/update_required_fields`, {\n user,\n });\n\n return this.handleResponse(response, () => {\n if (!response.success) {\n const missing_fields_check = RequiredFieldsResponseSchema.safeParse(response.data);\n if (missing_fields_check.success) {\n return [\"missing_required_fields\", missing_fields_check.data];\n }\n\n const error_response = ErrorSchema.parse(response.data);\n\n return [error_response.error_identifier as \"sign_in_not_found\" | \"sign_in_expired\" | \"account_locked\", error_response];\n }\n\n return [null, TokenResponseSchema.parse(response.data)];\n });\n }\n\n async authenticateWithMagicCode(signInId: string, code: string): Promise<AuthenticateWithMagicCodeResult> {\n const response = await this.client.post<{ code: string }>(`/api/sdk/v1/sign_ins/${signInId}/authenticate`, {\n code,\n });\n\n return this.handleResponse(response, () => {\n if (!response.success) {\n const missing_fields_check = RequiredFieldsResponseSchema.safeParse(response.data);\n\n if (missing_fields_check.success) {\n return [\"missing_required_fields\", missing_fields_check.data];\n }\n\n const error_response = ErrorSchema.parse(response.data);\n\n return [\n error_response.error_identifier as \"sign_in_not_found\" | \"sign_in_expired\" | \"account_locked\" | \"not_valid\" | \"used\" | \"expired\",\n error_response,\n ];\n }\n return [null, TokenResponseSchema.parse(response.data)];\n });\n }\n\n async refreshToken(signInId: string): Promise<RefreshTokenResult> {\n const response = await this.client.post<Record<string, never>>(`/api/sdk/v1/sign_ins/${signInId}/refresh_token`, {});\n\n return this.handleResponse(response, () => {\n if (!response.success) {\n const error_response = ErrorSchema.parse(response.data);\n\n return [error_response.error_identifier as \"invalid_refresh_token\" | \"refresh_token_revoked\" | \"sign_in_not_found\", error_response];\n }\n\n return [null, TokenResponseSchema.parse(response.data)];\n });\n }\n\n async sendResetPasswordEmail(signInId: string, returnTo: string): Promise<SendResetPasswordEmailResult> {\n const response = await this.client.post<null>(`/api/sdk/v1/sign_ins/${signInId}/password_reset/send`, { return_to: returnTo });\n\n return this.handleResponse(response, () => {\n if (!response.success) {\n const error_response = ErrorSchema.parse(response.data);\n\n return [\n error_response.error_identifier as\n | \"password_not_set\"\n | \"reset_password_already_sent\"\n | \"sign_in_not_found\"\n | \"invalid_return_to\"\n | \"return_to_required\",\n error_response,\n ];\n }\n\n return [null, null];\n });\n }\n\n async resetPassword(signInId: string, token: string, password: string, passwordConfirmation: string): Promise<ResetPasswordResult> {\n const response = await this.client.patch<null>(`/api/sdk/v1/sign_ins/${signInId}/password_reset`, {\n token,\n password,\n password_confirmation: passwordConfirmation,\n });\n\n return this.handleResponse(response, () => {\n if (!response.success) {\n const error_response = ErrorSchema.parse(response.data);\n\n return [\n error_response.error_identifier as \"reset_token_missing\" | \"invalid_reset_token\" | \"reset_token_expired\" | \"invalid_password\",\n response.data,\n ];\n }\n\n return [null, null];\n });\n }\n\n async validateResetPasswordToken(signInId: string, token: string): Promise<ValidateResetPasswordTokenResult> {\n const response = await this.client.get<{ valid: boolean }>(\n `/api/sdk/v1/sign_ins/${signInId}/password_reset?token=${encodeURIComponent(token)}`,\n );\n\n return this.handleResponse(response, () => {\n if (!response.success) {\n const error_response = ErrorSchema.parse(response.data);\n return [error_response.error_identifier as \"reset_token_missing\" | \"invalid_reset_token\" | \"reset_token_expired\", error_response];\n }\n\n return [null, null];\n });\n }\n\n async signOut(signInId: string, globalLogout = false): Promise<SignOutResult> {\n const response = await this.client.post<null>(`/api/sdk/v1/sign_ins/${signInId}/sign_out`, { globalLogout });\n\n return this.handleResponse(response, () => {\n if (!response.success) {\n const error_response = ErrorSchema.parse(response.data);\n\n return [error_response.error_identifier as \"sign_in_not_found\" | \"missing_id_token\" | \"invalid_id_token\", error_response];\n }\n\n return [null, null];\n });\n }\n\n async signedIn(): Promise<SignedInResult> {\n const response = await this.client.get<TokenResponse>(\"/api/sdk/v1/sign_ins/signed_in\");\n\n return this.handleResponse(response, () => {\n if (!response.success) {\n const error_response = ErrorSchema.parse(response.data);\n return [\"not_found\", error_response];\n }\n\n return [null, TokenResponseSchema.parse(response.data)];\n });\n }\n\n async getPasskeyOptions(sid?: string): Promise<GetPasskeyOptionsResult> {\n const endpoint = sid ? `/api/sdk/v1/passkeys/new?sid=${encodeURIComponent(sid)}` : \"/api/sdk/v1/passkeys/new\";\n const response = await this.client.get<PasskeyOptionsResponse>(endpoint);\n\n return this.handleResponse(response, () => {\n if (!response.success) {\n const error_response = ErrorSchema.parse(response.data);\n return [\"bad_request\", error_response];\n }\n\n return [null, PasskeyOptionsResponseSchema.parse(response.data)];\n });\n }\n\n async authenticateWithPasskey(credential: PasskeyCredential): Promise<AuthenticateWithPasskeyResult> {\n const response = await this.client.post<{ publicKeyCredential: PasskeyCredential }>(\"/api/sdk/v1/passkeys\", {\n publicKeyCredential: credential,\n });\n\n return this.handleResponse(response, () => {\n if (!response.success) {\n const error_response = ErrorSchema.parse(response.data);\n return [\n error_response.error_identifier as \"invalid_passkey\" | \"verification_failed\" | \"authentication_failed\" | \"bad_request\",\n error_response,\n ];\n }\n\n return [null, TokenResponseSchema.parse(response.data)];\n });\n }\n\n private handleResponse<T>(\n // biome-ignore lint/suspicious/noExplicitAny: generic handler for all responses\n response: any,\n handler: () => T,\n ): T | [\"connection_failed\", null] | [\"schema_validation_error\", SchemaValidationError] {\n if (response.connectionError) {\n unidyState.backendConnected = false;\n\n return [\"connection_failed\", null];\n }\n\n try {\n return handler();\n } catch (error) {\n Sentry.captureException(error);\n return [\"schema_validation_error\", SchemaValidationErrorSchema.parse(response.data)];\n }\n }\n}\n"]}