@thunderid/react 0.11.2 → 0.11.4

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 (652) hide show
  1. package/dist/ThunderIDReactClient.d.ts +0 -17
  2. package/dist/ThunderIDReactClient.d.ts.map +1 -1
  3. package/dist/ThunderIDReactClient.js +13 -7
  4. package/dist/ThunderIDReactClient.js.map +1 -1
  5. package/dist/api/getUsersMe.d.ts +0 -17
  6. package/dist/api/getUsersMe.d.ts.map +1 -1
  7. package/dist/api/getUsersMe.js.map +1 -1
  8. package/dist/api/updateMeProfile.d.ts +0 -17
  9. package/dist/api/updateMeProfile.d.ts.map +1 -1
  10. package/dist/api/updateMeProfile.js.map +1 -1
  11. package/dist/cjs/ThunderIDReactClient.cjs +12 -6
  12. package/dist/cjs/ThunderIDReactClient.cjs.map +1 -1
  13. package/dist/cjs/api/getUsersMe.cjs.map +1 -1
  14. package/dist/cjs/api/updateMeProfile.cjs.map +1 -1
  15. package/dist/cjs/components/actions/SignInButton/BaseSignInButton.cjs.map +1 -1
  16. package/dist/cjs/components/actions/SignInButton/SignInButton.cjs.map +1 -1
  17. package/dist/cjs/components/actions/SignOutButton/BaseSignOutButton.cjs.map +1 -1
  18. package/dist/cjs/components/actions/SignOutButton/SignOutButton.cjs.map +1 -1
  19. package/dist/cjs/components/actions/SignUpButton/BaseSignUpButton.cjs.map +1 -1
  20. package/dist/cjs/components/actions/SignUpButton/SignUpButton.cjs.map +1 -1
  21. package/dist/cjs/components/adapters/Consent.cjs.map +1 -1
  22. package/dist/cjs/components/adapters/ConsentCheckboxList.cjs.map +1 -1
  23. package/dist/cjs/components/adapters/ConsentCheckboxList.styles.cjs.map +1 -1
  24. package/dist/cjs/components/adapters/FacebookButton.cjs.map +1 -1
  25. package/dist/cjs/components/adapters/FlowTimer.cjs.map +1 -1
  26. package/dist/cjs/components/adapters/GitHubButton.cjs.map +1 -1
  27. package/dist/cjs/components/adapters/GoogleButton.cjs.map +1 -1
  28. package/dist/cjs/components/adapters/ImageComponent.cjs.map +1 -1
  29. package/dist/cjs/components/adapters/LinkedInButton.cjs.map +1 -1
  30. package/dist/cjs/components/adapters/MicrosoftButton.cjs.map +1 -1
  31. package/dist/cjs/components/adapters/SignInWithEthereumButton.cjs.map +1 -1
  32. package/dist/cjs/components/adapters/SmsOtpButton.cjs.map +1 -1
  33. package/dist/cjs/components/auth/Callback/Callback.cjs.map +1 -1
  34. package/dist/cjs/components/auth/Callback/OAuthCallback.cjs.map +1 -1
  35. package/dist/cjs/components/auth/Callback/TokenCallback.cjs.map +1 -1
  36. package/dist/cjs/components/control/Loading.cjs.map +1 -1
  37. package/dist/cjs/components/control/SignedIn.cjs.map +1 -1
  38. package/dist/cjs/components/control/SignedOut.cjs.map +1 -1
  39. package/dist/cjs/components/factories/FieldFactory.cjs.map +1 -1
  40. package/dist/cjs/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.cjs.map +1 -1
  41. package/dist/cjs/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.styles.cjs.map +1 -1
  42. package/dist/cjs/components/presentation/LanguageSwitcher/LanguageSwitcher.cjs.map +1 -1
  43. package/dist/cjs/components/presentation/User/BaseUser.cjs.map +1 -1
  44. package/dist/cjs/components/presentation/User/User.cjs.map +1 -1
  45. package/dist/cjs/components/presentation/UserAvatar/BaseUserAvatar.cjs.map +1 -1
  46. package/dist/cjs/components/presentation/UserAvatar/UserAvatar.cjs.map +1 -1
  47. package/dist/cjs/components/presentation/UserDropdown/BaseUserDropdown.cjs.map +1 -1
  48. package/dist/cjs/components/presentation/UserDropdown/BaseUserDropdown.styles.cjs.map +1 -1
  49. package/dist/cjs/components/presentation/UserDropdown/UserDropdown.cjs.map +1 -1
  50. package/dist/cjs/components/presentation/UserProfile/BaseUserProfile.cjs.map +1 -1
  51. package/dist/cjs/components/presentation/UserProfile/BaseUserProfile.styles.cjs.map +1 -1
  52. package/dist/cjs/components/presentation/UserProfile/UserProfile.cjs.map +1 -1
  53. package/dist/cjs/components/presentation/auth/AcceptInvite/AcceptInvite.cjs +3 -4
  54. package/dist/cjs/components/presentation/auth/AcceptInvite/AcceptInvite.cjs.map +1 -1
  55. package/dist/cjs/components/presentation/auth/AcceptInvite/BaseAcceptInvite.cjs.map +1 -1
  56. package/dist/cjs/components/presentation/auth/AcceptInvite/BaseAcceptInvite.styles.cjs.map +1 -1
  57. package/dist/cjs/components/presentation/auth/AuthOptionFactory.cjs.map +1 -1
  58. package/dist/cjs/components/presentation/auth/InviteUser/BaseInviteUser.cjs.map +1 -1
  59. package/dist/cjs/components/presentation/auth/InviteUser/BaseInviteUser.styles.cjs.map +1 -1
  60. package/dist/cjs/components/presentation/auth/InviteUser/InviteUser.cjs +4 -3
  61. package/dist/cjs/components/presentation/auth/InviteUser/InviteUser.cjs.map +1 -1
  62. package/dist/cjs/components/presentation/auth/Recovery/BaseRecovery.cjs.map +1 -1
  63. package/dist/cjs/components/presentation/auth/Recovery/Recovery.cjs.map +1 -1
  64. package/dist/cjs/components/presentation/auth/SignIn/BaseSignIn.cjs.map +1 -1
  65. package/dist/cjs/components/presentation/auth/SignIn/BaseSignIn.styles.cjs.map +1 -1
  66. package/dist/cjs/components/presentation/auth/SignIn/SignIn.cjs +10 -1
  67. package/dist/cjs/components/presentation/auth/SignIn/SignIn.cjs.map +1 -1
  68. package/dist/cjs/components/presentation/auth/SignUp/BaseSignUp.cjs.map +1 -1
  69. package/dist/cjs/components/presentation/auth/SignUp/BaseSignUp.styles.cjs.map +1 -1
  70. package/dist/cjs/components/presentation/auth/SignUp/SignUp.cjs.map +1 -1
  71. package/dist/cjs/components/primitives/AffixedField/AffixedField.cjs.map +1 -1
  72. package/dist/cjs/components/primitives/AffixedField/AffixedField.styles.cjs.map +1 -1
  73. package/dist/cjs/components/primitives/Alert/Alert.cjs.map +1 -1
  74. package/dist/cjs/components/primitives/Alert/Alert.styles.cjs.map +1 -1
  75. package/dist/cjs/components/primitives/Avatar/Avatar.cjs.map +1 -1
  76. package/dist/cjs/components/primitives/Avatar/Avatar.styles.cjs.map +1 -1
  77. package/dist/cjs/components/primitives/Button/Button.cjs.map +1 -1
  78. package/dist/cjs/components/primitives/Button/Button.styles.cjs.map +1 -1
  79. package/dist/cjs/components/primitives/Card/Card.cjs.map +1 -1
  80. package/dist/cjs/components/primitives/Card/Card.styles.cjs.map +1 -1
  81. package/dist/cjs/components/primitives/Checkbox/Checkbox.cjs.map +1 -1
  82. package/dist/cjs/components/primitives/Checkbox/Checkbox.styles.cjs.map +1 -1
  83. package/dist/cjs/components/primitives/CopyableText/CopyableText.cjs.map +1 -1
  84. package/dist/cjs/components/primitives/CopyableText/CopyableText.styles.cjs.map +1 -1
  85. package/dist/cjs/components/primitives/DatePicker/DatePicker.cjs.map +1 -1
  86. package/dist/cjs/components/primitives/DatePicker/DatePicker.styles.cjs.map +1 -1
  87. package/dist/cjs/components/primitives/Dialog/Dialog.cjs.map +1 -1
  88. package/dist/cjs/components/primitives/Dialog/Dialog.styles.cjs.map +1 -1
  89. package/dist/cjs/components/primitives/Divider/Divider.cjs.map +1 -1
  90. package/dist/cjs/components/primitives/Divider/Divider.styles.cjs.map +1 -1
  91. package/dist/cjs/components/primitives/FormControl/FormControl.cjs.map +1 -1
  92. package/dist/cjs/components/primitives/FormControl/FormControl.styles.cjs.map +1 -1
  93. package/dist/cjs/components/primitives/Icons/ArrowLeftRight.cjs.map +1 -1
  94. package/dist/cjs/components/primitives/Icons/ArrowRightLeft.cjs.map +1 -1
  95. package/dist/cjs/components/primitives/Icons/BuildingAlt.cjs.map +1 -1
  96. package/dist/cjs/components/primitives/Icons/Check.cjs.map +1 -1
  97. package/dist/cjs/components/primitives/Icons/ChevronDown.cjs.map +1 -1
  98. package/dist/cjs/components/primitives/Icons/CircleAlert.cjs.map +1 -1
  99. package/dist/cjs/components/primitives/Icons/CircleCheck.cjs.map +1 -1
  100. package/dist/cjs/components/primitives/Icons/Eye.cjs.map +1 -1
  101. package/dist/cjs/components/primitives/Icons/EyeOff.cjs.map +1 -1
  102. package/dist/cjs/components/primitives/Icons/Info.cjs.map +1 -1
  103. package/dist/cjs/components/primitives/Icons/LogOut.cjs.map +1 -1
  104. package/dist/cjs/components/primitives/Icons/Plus.cjs.map +1 -1
  105. package/dist/cjs/components/primitives/Icons/TriangleAlert.cjs.map +1 -1
  106. package/dist/cjs/components/primitives/Icons/User.cjs.map +1 -1
  107. package/dist/cjs/components/primitives/Icons/X.cjs.map +1 -1
  108. package/dist/cjs/components/primitives/Icons/flowIconRegistry.cjs.map +1 -1
  109. package/dist/cjs/components/primitives/InputLabel/InputLabel.cjs.map +1 -1
  110. package/dist/cjs/components/primitives/InputLabel/InputLabel.styles.cjs.map +1 -1
  111. package/dist/cjs/components/primitives/KeyValueInput/KeyValueInput.cjs.map +1 -1
  112. package/dist/cjs/components/primitives/KeyValueInput/KeyValueInput.styles.cjs.map +1 -1
  113. package/dist/cjs/components/primitives/Logo/Logo.cjs.map +1 -1
  114. package/dist/cjs/components/primitives/Logo/Logo.styles.cjs.map +1 -1
  115. package/dist/cjs/components/primitives/MultiInput/MultiInput.cjs.map +1 -1
  116. package/dist/cjs/components/primitives/MultiInput/MultiInput.styles.cjs.map +1 -1
  117. package/dist/cjs/components/primitives/OtpField/OtpField.cjs.map +1 -1
  118. package/dist/cjs/components/primitives/OtpField/OtpField.styles.cjs.map +1 -1
  119. package/dist/cjs/components/primitives/PasswordField/PasswordField.cjs.map +1 -1
  120. package/dist/cjs/components/primitives/PasswordField/PasswordField.styles.cjs.map +1 -1
  121. package/dist/cjs/components/primitives/Select/Select.cjs.map +1 -1
  122. package/dist/cjs/components/primitives/Select/Select.styles.cjs.map +1 -1
  123. package/dist/cjs/components/primitives/Spinner/Spinner.cjs.map +1 -1
  124. package/dist/cjs/components/primitives/Spinner/Spinner.styles.cjs.map +1 -1
  125. package/dist/cjs/components/primitives/TextField/TextField.cjs.map +1 -1
  126. package/dist/cjs/components/primitives/TextField/TextField.styles.cjs.map +1 -1
  127. package/dist/cjs/components/primitives/Toggle/Toggle.cjs.map +1 -1
  128. package/dist/cjs/components/primitives/Toggle/Toggle.styles.cjs.map +1 -1
  129. package/dist/cjs/components/primitives/Tooltip/Tooltip.cjs.map +1 -1
  130. package/dist/cjs/components/primitives/Tooltip/Tooltip.styles.cjs.map +1 -1
  131. package/dist/cjs/components/primitives/Typography/Typography.cjs.map +1 -1
  132. package/dist/cjs/components/primitives/Typography/Typography.styles.cjs.map +1 -1
  133. package/dist/cjs/contexts/ComponentRenderer/ComponentRendererContext.cjs.map +1 -1
  134. package/dist/cjs/contexts/ComponentRenderer/ComponentRendererProvider.cjs.map +1 -1
  135. package/dist/cjs/contexts/Flow/FlowContext.cjs.map +1 -1
  136. package/dist/cjs/contexts/Flow/FlowProvider.cjs.map +1 -1
  137. package/dist/cjs/contexts/Flow/useFlow.cjs.map +1 -1
  138. package/dist/cjs/contexts/FlowMeta/FlowMetaContext.cjs.map +1 -1
  139. package/dist/cjs/contexts/FlowMeta/FlowMetaProvider.cjs +5 -1
  140. package/dist/cjs/contexts/FlowMeta/FlowMetaProvider.cjs.map +1 -1
  141. package/dist/cjs/contexts/FlowMeta/useFlowMeta.cjs.map +1 -1
  142. package/dist/cjs/contexts/I18n/ComponentPreferencesContext.cjs.map +1 -1
  143. package/dist/cjs/contexts/I18n/I18nContext.cjs.map +1 -1
  144. package/dist/cjs/contexts/I18n/I18nProvider.cjs.map +1 -1
  145. package/dist/cjs/contexts/I18n/useI18n.cjs.map +1 -1
  146. package/dist/cjs/contexts/Theme/ThemeContext.cjs.map +1 -1
  147. package/dist/cjs/contexts/Theme/ThemeProvider.cjs.map +1 -1
  148. package/dist/cjs/contexts/Theme/useTheme.cjs.map +1 -1
  149. package/dist/cjs/contexts/ThunderID/ThunderIDContext.cjs.map +1 -1
  150. package/dist/cjs/contexts/ThunderID/ThunderIDProvider.cjs +33 -17
  151. package/dist/cjs/contexts/ThunderID/ThunderIDProvider.cjs.map +1 -1
  152. package/dist/cjs/contexts/ThunderID/useThunderID.cjs.map +1 -1
  153. package/dist/cjs/contexts/User/UserContext.cjs.map +1 -1
  154. package/dist/cjs/contexts/User/UserProvider.cjs.map +1 -1
  155. package/dist/cjs/contexts/User/useUser.cjs.map +1 -1
  156. package/dist/cjs/hooks/useBrowserUrl.cjs.map +1 -1
  157. package/dist/cjs/hooks/useForm.cjs.map +1 -1
  158. package/dist/cjs/hooks/useOAuthCallback.cjs.map +1 -1
  159. package/dist/cjs/hooks/useTranslation.cjs.map +1 -1
  160. package/dist/cjs/utils/applyThemeToDOM.cjs.map +1 -1
  161. package/dist/cjs/utils/buildThemeConfigFromFlowMeta.cjs.map +1 -1
  162. package/dist/cjs/utils/composeAffixedInputs.cjs.map +1 -1
  163. package/dist/cjs/utils/flowTransformer.cjs.map +1 -1
  164. package/dist/cjs/utils/getAuthComponentHeadings.cjs.map +1 -1
  165. package/dist/cjs/utils/getDisplayName.cjs.map +1 -1
  166. package/dist/cjs/utils/getMappedUserProfileValue.cjs.map +1 -1
  167. package/dist/cjs/utils/normalizeThemeConfig.cjs.map +1 -1
  168. package/dist/cjs/utils/oauth.cjs.map +1 -1
  169. package/dist/cjs/utils/passkey.cjs.map +1 -1
  170. package/dist/cjs/utils/resolveTranslationsInArray.cjs.map +1 -1
  171. package/dist/cjs/utils/resolveTranslationsInObject.cjs.map +1 -1
  172. package/dist/components/actions/SignInButton/BaseSignInButton.d.ts +0 -17
  173. package/dist/components/actions/SignInButton/BaseSignInButton.d.ts.map +1 -1
  174. package/dist/components/actions/SignInButton/BaseSignInButton.js.map +1 -1
  175. package/dist/components/actions/SignInButton/SignInButton.d.ts +0 -17
  176. package/dist/components/actions/SignInButton/SignInButton.d.ts.map +1 -1
  177. package/dist/components/actions/SignInButton/SignInButton.js.map +1 -1
  178. package/dist/components/actions/SignOutButton/BaseSignOutButton.d.ts +0 -17
  179. package/dist/components/actions/SignOutButton/BaseSignOutButton.d.ts.map +1 -1
  180. package/dist/components/actions/SignOutButton/BaseSignOutButton.js.map +1 -1
  181. package/dist/components/actions/SignOutButton/SignOutButton.d.ts +0 -17
  182. package/dist/components/actions/SignOutButton/SignOutButton.d.ts.map +1 -1
  183. package/dist/components/actions/SignOutButton/SignOutButton.js.map +1 -1
  184. package/dist/components/actions/SignUpButton/BaseSignUpButton.d.ts +0 -17
  185. package/dist/components/actions/SignUpButton/BaseSignUpButton.d.ts.map +1 -1
  186. package/dist/components/actions/SignUpButton/BaseSignUpButton.js.map +1 -1
  187. package/dist/components/actions/SignUpButton/SignUpButton.d.ts +0 -17
  188. package/dist/components/actions/SignUpButton/SignUpButton.d.ts.map +1 -1
  189. package/dist/components/actions/SignUpButton/SignUpButton.js.map +1 -1
  190. package/dist/components/adapters/Consent.d.ts +0 -17
  191. package/dist/components/adapters/Consent.d.ts.map +1 -1
  192. package/dist/components/adapters/Consent.js.map +1 -1
  193. package/dist/components/adapters/ConsentCheckboxList.d.ts +0 -17
  194. package/dist/components/adapters/ConsentCheckboxList.d.ts.map +1 -1
  195. package/dist/components/adapters/ConsentCheckboxList.js.map +1 -1
  196. package/dist/components/adapters/ConsentCheckboxList.styles.d.ts +0 -17
  197. package/dist/components/adapters/ConsentCheckboxList.styles.d.ts.map +1 -1
  198. package/dist/components/adapters/ConsentCheckboxList.styles.js.map +1 -1
  199. package/dist/components/adapters/FacebookButton.d.ts +0 -17
  200. package/dist/components/adapters/FacebookButton.d.ts.map +1 -1
  201. package/dist/components/adapters/FacebookButton.js.map +1 -1
  202. package/dist/components/adapters/FlowTimer.d.ts +0 -17
  203. package/dist/components/adapters/FlowTimer.d.ts.map +1 -1
  204. package/dist/components/adapters/FlowTimer.js.map +1 -1
  205. package/dist/components/adapters/GitHubButton.d.ts +0 -17
  206. package/dist/components/adapters/GitHubButton.d.ts.map +1 -1
  207. package/dist/components/adapters/GitHubButton.js.map +1 -1
  208. package/dist/components/adapters/GoogleButton.d.ts +0 -17
  209. package/dist/components/adapters/GoogleButton.d.ts.map +1 -1
  210. package/dist/components/adapters/GoogleButton.js.map +1 -1
  211. package/dist/components/adapters/ImageComponent.d.ts +0 -17
  212. package/dist/components/adapters/ImageComponent.d.ts.map +1 -1
  213. package/dist/components/adapters/ImageComponent.js.map +1 -1
  214. package/dist/components/adapters/LinkedInButton.d.ts +0 -17
  215. package/dist/components/adapters/LinkedInButton.d.ts.map +1 -1
  216. package/dist/components/adapters/LinkedInButton.js.map +1 -1
  217. package/dist/components/adapters/MicrosoftButton.d.ts +0 -17
  218. package/dist/components/adapters/MicrosoftButton.d.ts.map +1 -1
  219. package/dist/components/adapters/MicrosoftButton.js.map +1 -1
  220. package/dist/components/adapters/SignInWithEthereumButton.d.ts +0 -17
  221. package/dist/components/adapters/SignInWithEthereumButton.d.ts.map +1 -1
  222. package/dist/components/adapters/SignInWithEthereumButton.js.map +1 -1
  223. package/dist/components/adapters/SmsOtpButton.d.ts +0 -17
  224. package/dist/components/adapters/SmsOtpButton.d.ts.map +1 -1
  225. package/dist/components/adapters/SmsOtpButton.js.map +1 -1
  226. package/dist/components/auth/Callback/Callback.d.ts.map +1 -1
  227. package/dist/components/auth/Callback/Callback.js.map +1 -1
  228. package/dist/components/auth/Callback/OAuthCallback.d.ts +0 -17
  229. package/dist/components/auth/Callback/OAuthCallback.d.ts.map +1 -1
  230. package/dist/components/auth/Callback/OAuthCallback.js.map +1 -1
  231. package/dist/components/auth/Callback/TokenCallback.d.ts +0 -16
  232. package/dist/components/auth/Callback/TokenCallback.d.ts.map +1 -1
  233. package/dist/components/auth/Callback/TokenCallback.js.map +1 -1
  234. package/dist/components/control/Loading.d.ts +0 -17
  235. package/dist/components/control/Loading.d.ts.map +1 -1
  236. package/dist/components/control/Loading.js.map +1 -1
  237. package/dist/components/control/SignedIn.d.ts +0 -17
  238. package/dist/components/control/SignedIn.d.ts.map +1 -1
  239. package/dist/components/control/SignedIn.js.map +1 -1
  240. package/dist/components/control/SignedOut.d.ts +0 -17
  241. package/dist/components/control/SignedOut.d.ts.map +1 -1
  242. package/dist/components/control/SignedOut.js.map +1 -1
  243. package/dist/components/factories/FieldFactory.d.ts +0 -17
  244. package/dist/components/factories/FieldFactory.d.ts.map +1 -1
  245. package/dist/components/factories/FieldFactory.js.map +1 -1
  246. package/dist/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.d.ts +0 -17
  247. package/dist/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.d.ts.map +1 -1
  248. package/dist/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.js.map +1 -1
  249. package/dist/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.styles.d.ts +0 -17
  250. package/dist/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.styles.d.ts.map +1 -1
  251. package/dist/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.styles.js.map +1 -1
  252. package/dist/components/presentation/LanguageSwitcher/LanguageSwitcher.d.ts +0 -17
  253. package/dist/components/presentation/LanguageSwitcher/LanguageSwitcher.d.ts.map +1 -1
  254. package/dist/components/presentation/LanguageSwitcher/LanguageSwitcher.js.map +1 -1
  255. package/dist/components/presentation/User/BaseUser.d.ts +0 -17
  256. package/dist/components/presentation/User/BaseUser.d.ts.map +1 -1
  257. package/dist/components/presentation/User/BaseUser.js.map +1 -1
  258. package/dist/components/presentation/User/User.d.ts +0 -17
  259. package/dist/components/presentation/User/User.d.ts.map +1 -1
  260. package/dist/components/presentation/User/User.js.map +1 -1
  261. package/dist/components/presentation/UserAvatar/BaseUserAvatar.d.ts +0 -17
  262. package/dist/components/presentation/UserAvatar/BaseUserAvatar.d.ts.map +1 -1
  263. package/dist/components/presentation/UserAvatar/BaseUserAvatar.js.map +1 -1
  264. package/dist/components/presentation/UserAvatar/UserAvatar.d.ts +0 -17
  265. package/dist/components/presentation/UserAvatar/UserAvatar.d.ts.map +1 -1
  266. package/dist/components/presentation/UserAvatar/UserAvatar.js.map +1 -1
  267. package/dist/components/presentation/UserDropdown/BaseUserDropdown.d.ts +0 -17
  268. package/dist/components/presentation/UserDropdown/BaseUserDropdown.d.ts.map +1 -1
  269. package/dist/components/presentation/UserDropdown/BaseUserDropdown.js.map +1 -1
  270. package/dist/components/presentation/UserDropdown/BaseUserDropdown.styles.d.ts +0 -17
  271. package/dist/components/presentation/UserDropdown/BaseUserDropdown.styles.d.ts.map +1 -1
  272. package/dist/components/presentation/UserDropdown/BaseUserDropdown.styles.js.map +1 -1
  273. package/dist/components/presentation/UserDropdown/UserDropdown.d.ts +0 -17
  274. package/dist/components/presentation/UserDropdown/UserDropdown.d.ts.map +1 -1
  275. package/dist/components/presentation/UserDropdown/UserDropdown.js.map +1 -1
  276. package/dist/components/presentation/UserProfile/BaseUserProfile.d.ts +0 -17
  277. package/dist/components/presentation/UserProfile/BaseUserProfile.d.ts.map +1 -1
  278. package/dist/components/presentation/UserProfile/BaseUserProfile.js.map +1 -1
  279. package/dist/components/presentation/UserProfile/BaseUserProfile.styles.d.ts +0 -17
  280. package/dist/components/presentation/UserProfile/BaseUserProfile.styles.d.ts.map +1 -1
  281. package/dist/components/presentation/UserProfile/BaseUserProfile.styles.js.map +1 -1
  282. package/dist/components/presentation/UserProfile/UserProfile.d.ts +0 -17
  283. package/dist/components/presentation/UserProfile/UserProfile.d.ts.map +1 -1
  284. package/dist/components/presentation/UserProfile/UserProfile.js.map +1 -1
  285. package/dist/components/presentation/auth/AcceptInvite/AcceptInvite.d.ts +0 -17
  286. package/dist/components/presentation/auth/AcceptInvite/AcceptInvite.d.ts.map +1 -1
  287. package/dist/components/presentation/auth/AcceptInvite/AcceptInvite.js +2 -4
  288. package/dist/components/presentation/auth/AcceptInvite/AcceptInvite.js.map +1 -1
  289. package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.d.ts +0 -17
  290. package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.d.ts.map +1 -1
  291. package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.js.map +1 -1
  292. package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.styles.d.ts +0 -17
  293. package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.styles.d.ts.map +1 -1
  294. package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.styles.js.map +1 -1
  295. package/dist/components/presentation/auth/AcceptInvite/index.d.ts +0 -17
  296. package/dist/components/presentation/auth/AcceptInvite/index.d.ts.map +1 -1
  297. package/dist/components/presentation/auth/AuthOptionFactory.d.ts +0 -17
  298. package/dist/components/presentation/auth/AuthOptionFactory.d.ts.map +1 -1
  299. package/dist/components/presentation/auth/AuthOptionFactory.js.map +1 -1
  300. package/dist/components/presentation/auth/InviteUser/BaseInviteUser.d.ts +0 -17
  301. package/dist/components/presentation/auth/InviteUser/BaseInviteUser.d.ts.map +1 -1
  302. package/dist/components/presentation/auth/InviteUser/BaseInviteUser.js.map +1 -1
  303. package/dist/components/presentation/auth/InviteUser/BaseInviteUser.styles.d.ts +0 -17
  304. package/dist/components/presentation/auth/InviteUser/BaseInviteUser.styles.d.ts.map +1 -1
  305. package/dist/components/presentation/auth/InviteUser/BaseInviteUser.styles.js.map +1 -1
  306. package/dist/components/presentation/auth/InviteUser/InviteUser.d.ts +0 -17
  307. package/dist/components/presentation/auth/InviteUser/InviteUser.d.ts.map +1 -1
  308. package/dist/components/presentation/auth/InviteUser/InviteUser.js +5 -4
  309. package/dist/components/presentation/auth/InviteUser/InviteUser.js.map +1 -1
  310. package/dist/components/presentation/auth/InviteUser/index.d.ts +0 -17
  311. package/dist/components/presentation/auth/InviteUser/index.d.ts.map +1 -1
  312. package/dist/components/presentation/auth/Recovery/BaseRecovery.d.ts +0 -17
  313. package/dist/components/presentation/auth/Recovery/BaseRecovery.d.ts.map +1 -1
  314. package/dist/components/presentation/auth/Recovery/BaseRecovery.js.map +1 -1
  315. package/dist/components/presentation/auth/Recovery/Recovery.d.ts +0 -17
  316. package/dist/components/presentation/auth/Recovery/Recovery.d.ts.map +1 -1
  317. package/dist/components/presentation/auth/Recovery/Recovery.js.map +1 -1
  318. package/dist/components/presentation/auth/SignIn/BaseSignIn.d.ts +0 -17
  319. package/dist/components/presentation/auth/SignIn/BaseSignIn.d.ts.map +1 -1
  320. package/dist/components/presentation/auth/SignIn/BaseSignIn.js.map +1 -1
  321. package/dist/components/presentation/auth/SignIn/BaseSignIn.styles.d.ts +0 -17
  322. package/dist/components/presentation/auth/SignIn/BaseSignIn.styles.d.ts.map +1 -1
  323. package/dist/components/presentation/auth/SignIn/BaseSignIn.styles.js.map +1 -1
  324. package/dist/components/presentation/auth/SignIn/SignIn.d.ts +0 -17
  325. package/dist/components/presentation/auth/SignIn/SignIn.d.ts.map +1 -1
  326. package/dist/components/presentation/auth/SignIn/SignIn.js +10 -1
  327. package/dist/components/presentation/auth/SignIn/SignIn.js.map +1 -1
  328. package/dist/components/presentation/auth/SignUp/BaseSignUp.d.ts +0 -17
  329. package/dist/components/presentation/auth/SignUp/BaseSignUp.d.ts.map +1 -1
  330. package/dist/components/presentation/auth/SignUp/BaseSignUp.js.map +1 -1
  331. package/dist/components/presentation/auth/SignUp/BaseSignUp.styles.d.ts +0 -17
  332. package/dist/components/presentation/auth/SignUp/BaseSignUp.styles.d.ts.map +1 -1
  333. package/dist/components/presentation/auth/SignUp/BaseSignUp.styles.js.map +1 -1
  334. package/dist/components/presentation/auth/SignUp/SignUp.d.ts +0 -17
  335. package/dist/components/presentation/auth/SignUp/SignUp.d.ts.map +1 -1
  336. package/dist/components/presentation/auth/SignUp/SignUp.js.map +1 -1
  337. package/dist/components/primitives/AffixedField/AffixedField.d.ts +0 -17
  338. package/dist/components/primitives/AffixedField/AffixedField.d.ts.map +1 -1
  339. package/dist/components/primitives/AffixedField/AffixedField.js.map +1 -1
  340. package/dist/components/primitives/AffixedField/AffixedField.styles.d.ts +0 -17
  341. package/dist/components/primitives/AffixedField/AffixedField.styles.d.ts.map +1 -1
  342. package/dist/components/primitives/AffixedField/AffixedField.styles.js.map +1 -1
  343. package/dist/components/primitives/AffixedField/index.d.ts +0 -17
  344. package/dist/components/primitives/AffixedField/index.d.ts.map +1 -1
  345. package/dist/components/primitives/Alert/Alert.d.ts +0 -17
  346. package/dist/components/primitives/Alert/Alert.d.ts.map +1 -1
  347. package/dist/components/primitives/Alert/Alert.js.map +1 -1
  348. package/dist/components/primitives/Alert/Alert.styles.d.ts +0 -17
  349. package/dist/components/primitives/Alert/Alert.styles.d.ts.map +1 -1
  350. package/dist/components/primitives/Alert/Alert.styles.js.map +1 -1
  351. package/dist/components/primitives/Avatar/Avatar.d.ts +0 -17
  352. package/dist/components/primitives/Avatar/Avatar.d.ts.map +1 -1
  353. package/dist/components/primitives/Avatar/Avatar.js.map +1 -1
  354. package/dist/components/primitives/Avatar/Avatar.styles.d.ts +0 -17
  355. package/dist/components/primitives/Avatar/Avatar.styles.d.ts.map +1 -1
  356. package/dist/components/primitives/Avatar/Avatar.styles.js.map +1 -1
  357. package/dist/components/primitives/Button/Button.d.ts +0 -17
  358. package/dist/components/primitives/Button/Button.d.ts.map +1 -1
  359. package/dist/components/primitives/Button/Button.js.map +1 -1
  360. package/dist/components/primitives/Button/Button.styles.d.ts +0 -17
  361. package/dist/components/primitives/Button/Button.styles.d.ts.map +1 -1
  362. package/dist/components/primitives/Button/Button.styles.js.map +1 -1
  363. package/dist/components/primitives/Card/Card.d.ts +0 -17
  364. package/dist/components/primitives/Card/Card.d.ts.map +1 -1
  365. package/dist/components/primitives/Card/Card.js.map +1 -1
  366. package/dist/components/primitives/Card/Card.styles.d.ts +0 -17
  367. package/dist/components/primitives/Card/Card.styles.d.ts.map +1 -1
  368. package/dist/components/primitives/Card/Card.styles.js.map +1 -1
  369. package/dist/components/primitives/Checkbox/Checkbox.d.ts +0 -17
  370. package/dist/components/primitives/Checkbox/Checkbox.d.ts.map +1 -1
  371. package/dist/components/primitives/Checkbox/Checkbox.js.map +1 -1
  372. package/dist/components/primitives/Checkbox/Checkbox.styles.d.ts +0 -17
  373. package/dist/components/primitives/Checkbox/Checkbox.styles.d.ts.map +1 -1
  374. package/dist/components/primitives/Checkbox/Checkbox.styles.js.map +1 -1
  375. package/dist/components/primitives/CopyableText/CopyableText.d.ts +0 -17
  376. package/dist/components/primitives/CopyableText/CopyableText.d.ts.map +1 -1
  377. package/dist/components/primitives/CopyableText/CopyableText.js.map +1 -1
  378. package/dist/components/primitives/CopyableText/CopyableText.styles.d.ts +0 -17
  379. package/dist/components/primitives/CopyableText/CopyableText.styles.d.ts.map +1 -1
  380. package/dist/components/primitives/CopyableText/CopyableText.styles.js.map +1 -1
  381. package/dist/components/primitives/CopyableText/index.d.ts +0 -17
  382. package/dist/components/primitives/CopyableText/index.d.ts.map +1 -1
  383. package/dist/components/primitives/DatePicker/DatePicker.d.ts +0 -17
  384. package/dist/components/primitives/DatePicker/DatePicker.d.ts.map +1 -1
  385. package/dist/components/primitives/DatePicker/DatePicker.js.map +1 -1
  386. package/dist/components/primitives/DatePicker/DatePicker.styles.d.ts +0 -17
  387. package/dist/components/primitives/DatePicker/DatePicker.styles.d.ts.map +1 -1
  388. package/dist/components/primitives/DatePicker/DatePicker.styles.js.map +1 -1
  389. package/dist/components/primitives/Dialog/Dialog.d.ts +0 -17
  390. package/dist/components/primitives/Dialog/Dialog.d.ts.map +1 -1
  391. package/dist/components/primitives/Dialog/Dialog.js.map +1 -1
  392. package/dist/components/primitives/Dialog/Dialog.styles.d.ts +0 -17
  393. package/dist/components/primitives/Dialog/Dialog.styles.d.ts.map +1 -1
  394. package/dist/components/primitives/Dialog/Dialog.styles.js.map +1 -1
  395. package/dist/components/primitives/Divider/Divider.d.ts +0 -17
  396. package/dist/components/primitives/Divider/Divider.d.ts.map +1 -1
  397. package/dist/components/primitives/Divider/Divider.js.map +1 -1
  398. package/dist/components/primitives/Divider/Divider.styles.d.ts +0 -17
  399. package/dist/components/primitives/Divider/Divider.styles.d.ts.map +1 -1
  400. package/dist/components/primitives/Divider/Divider.styles.js.map +1 -1
  401. package/dist/components/primitives/FormControl/FormControl.d.ts +0 -17
  402. package/dist/components/primitives/FormControl/FormControl.d.ts.map +1 -1
  403. package/dist/components/primitives/FormControl/FormControl.js.map +1 -1
  404. package/dist/components/primitives/FormControl/FormControl.styles.d.ts +0 -17
  405. package/dist/components/primitives/FormControl/FormControl.styles.d.ts.map +1 -1
  406. package/dist/components/primitives/FormControl/FormControl.styles.js.map +1 -1
  407. package/dist/components/primitives/Icons/ArrowLeftRight.d.ts +0 -17
  408. package/dist/components/primitives/Icons/ArrowLeftRight.d.ts.map +1 -1
  409. package/dist/components/primitives/Icons/ArrowLeftRight.js.map +1 -1
  410. package/dist/components/primitives/Icons/ArrowRightLeft.d.ts +0 -17
  411. package/dist/components/primitives/Icons/ArrowRightLeft.d.ts.map +1 -1
  412. package/dist/components/primitives/Icons/ArrowRightLeft.js.map +1 -1
  413. package/dist/components/primitives/Icons/Building.d.ts +0 -17
  414. package/dist/components/primitives/Icons/Building.d.ts.map +1 -1
  415. package/dist/components/primitives/Icons/BuildingAlt.d.ts +0 -17
  416. package/dist/components/primitives/Icons/BuildingAlt.d.ts.map +1 -1
  417. package/dist/components/primitives/Icons/BuildingAlt.js.map +1 -1
  418. package/dist/components/primitives/Icons/Check.d.ts +0 -17
  419. package/dist/components/primitives/Icons/Check.d.ts.map +1 -1
  420. package/dist/components/primitives/Icons/Check.js.map +1 -1
  421. package/dist/components/primitives/Icons/ChevronDown.d.ts +0 -17
  422. package/dist/components/primitives/Icons/ChevronDown.d.ts.map +1 -1
  423. package/dist/components/primitives/Icons/ChevronDown.js.map +1 -1
  424. package/dist/components/primitives/Icons/CircleAlert.d.ts +0 -17
  425. package/dist/components/primitives/Icons/CircleAlert.d.ts.map +1 -1
  426. package/dist/components/primitives/Icons/CircleAlert.js.map +1 -1
  427. package/dist/components/primitives/Icons/CircleCheck.d.ts +0 -17
  428. package/dist/components/primitives/Icons/CircleCheck.d.ts.map +1 -1
  429. package/dist/components/primitives/Icons/CircleCheck.js.map +1 -1
  430. package/dist/components/primitives/Icons/Eye.d.ts +0 -17
  431. package/dist/components/primitives/Icons/Eye.d.ts.map +1 -1
  432. package/dist/components/primitives/Icons/Eye.js.map +1 -1
  433. package/dist/components/primitives/Icons/EyeOff.d.ts +0 -17
  434. package/dist/components/primitives/Icons/EyeOff.d.ts.map +1 -1
  435. package/dist/components/primitives/Icons/EyeOff.js.map +1 -1
  436. package/dist/components/primitives/Icons/Info.d.ts +0 -17
  437. package/dist/components/primitives/Icons/Info.d.ts.map +1 -1
  438. package/dist/components/primitives/Icons/Info.js.map +1 -1
  439. package/dist/components/primitives/Icons/LogOut.d.ts +0 -17
  440. package/dist/components/primitives/Icons/LogOut.d.ts.map +1 -1
  441. package/dist/components/primitives/Icons/LogOut.js.map +1 -1
  442. package/dist/components/primitives/Icons/Plus.d.ts +0 -17
  443. package/dist/components/primitives/Icons/Plus.d.ts.map +1 -1
  444. package/dist/components/primitives/Icons/Plus.js.map +1 -1
  445. package/dist/components/primitives/Icons/TriangleAlert.d.ts +0 -17
  446. package/dist/components/primitives/Icons/TriangleAlert.d.ts.map +1 -1
  447. package/dist/components/primitives/Icons/TriangleAlert.js.map +1 -1
  448. package/dist/components/primitives/Icons/User.d.ts +0 -17
  449. package/dist/components/primitives/Icons/User.d.ts.map +1 -1
  450. package/dist/components/primitives/Icons/User.js.map +1 -1
  451. package/dist/components/primitives/Icons/X.d.ts +0 -17
  452. package/dist/components/primitives/Icons/X.d.ts.map +1 -1
  453. package/dist/components/primitives/Icons/X.js.map +1 -1
  454. package/dist/components/primitives/Icons/flowIconRegistry.d.ts +0 -17
  455. package/dist/components/primitives/Icons/flowIconRegistry.d.ts.map +1 -1
  456. package/dist/components/primitives/Icons/flowIconRegistry.js.map +1 -1
  457. package/dist/components/primitives/Icons/index.d.ts +0 -17
  458. package/dist/components/primitives/Icons/index.d.ts.map +1 -1
  459. package/dist/components/primitives/InputLabel/InputLabel.d.ts +0 -17
  460. package/dist/components/primitives/InputLabel/InputLabel.d.ts.map +1 -1
  461. package/dist/components/primitives/InputLabel/InputLabel.js.map +1 -1
  462. package/dist/components/primitives/InputLabel/InputLabel.styles.d.ts +0 -17
  463. package/dist/components/primitives/InputLabel/InputLabel.styles.d.ts.map +1 -1
  464. package/dist/components/primitives/InputLabel/InputLabel.styles.js.map +1 -1
  465. package/dist/components/primitives/KeyValueInput/KeyValueInput.d.ts +0 -17
  466. package/dist/components/primitives/KeyValueInput/KeyValueInput.d.ts.map +1 -1
  467. package/dist/components/primitives/KeyValueInput/KeyValueInput.js.map +1 -1
  468. package/dist/components/primitives/KeyValueInput/KeyValueInput.styles.d.ts +0 -17
  469. package/dist/components/primitives/KeyValueInput/KeyValueInput.styles.d.ts.map +1 -1
  470. package/dist/components/primitives/KeyValueInput/KeyValueInput.styles.js.map +1 -1
  471. package/dist/components/primitives/Logo/Logo.d.ts +0 -17
  472. package/dist/components/primitives/Logo/Logo.d.ts.map +1 -1
  473. package/dist/components/primitives/Logo/Logo.js.map +1 -1
  474. package/dist/components/primitives/Logo/Logo.styles.d.ts +0 -17
  475. package/dist/components/primitives/Logo/Logo.styles.d.ts.map +1 -1
  476. package/dist/components/primitives/Logo/Logo.styles.js.map +1 -1
  477. package/dist/components/primitives/MultiInput/MultiInput.d.ts +0 -17
  478. package/dist/components/primitives/MultiInput/MultiInput.d.ts.map +1 -1
  479. package/dist/components/primitives/MultiInput/MultiInput.js.map +1 -1
  480. package/dist/components/primitives/MultiInput/MultiInput.styles.d.ts +0 -17
  481. package/dist/components/primitives/MultiInput/MultiInput.styles.d.ts.map +1 -1
  482. package/dist/components/primitives/MultiInput/MultiInput.styles.js.map +1 -1
  483. package/dist/components/primitives/OtpField/OtpField.d.ts +0 -17
  484. package/dist/components/primitives/OtpField/OtpField.d.ts.map +1 -1
  485. package/dist/components/primitives/OtpField/OtpField.js.map +1 -1
  486. package/dist/components/primitives/OtpField/OtpField.styles.d.ts +0 -17
  487. package/dist/components/primitives/OtpField/OtpField.styles.d.ts.map +1 -1
  488. package/dist/components/primitives/OtpField/OtpField.styles.js.map +1 -1
  489. package/dist/components/primitives/PasswordField/PasswordField.d.ts +0 -17
  490. package/dist/components/primitives/PasswordField/PasswordField.d.ts.map +1 -1
  491. package/dist/components/primitives/PasswordField/PasswordField.js.map +1 -1
  492. package/dist/components/primitives/PasswordField/PasswordField.styles.d.ts +0 -17
  493. package/dist/components/primitives/PasswordField/PasswordField.styles.d.ts.map +1 -1
  494. package/dist/components/primitives/PasswordField/PasswordField.styles.js.map +1 -1
  495. package/dist/components/primitives/Select/Select.d.ts +0 -17
  496. package/dist/components/primitives/Select/Select.d.ts.map +1 -1
  497. package/dist/components/primitives/Select/Select.js.map +1 -1
  498. package/dist/components/primitives/Select/Select.styles.d.ts +0 -17
  499. package/dist/components/primitives/Select/Select.styles.d.ts.map +1 -1
  500. package/dist/components/primitives/Select/Select.styles.js.map +1 -1
  501. package/dist/components/primitives/Spinner/Spinner.d.ts +0 -17
  502. package/dist/components/primitives/Spinner/Spinner.d.ts.map +1 -1
  503. package/dist/components/primitives/Spinner/Spinner.js.map +1 -1
  504. package/dist/components/primitives/Spinner/Spinner.styles.d.ts +0 -17
  505. package/dist/components/primitives/Spinner/Spinner.styles.d.ts.map +1 -1
  506. package/dist/components/primitives/Spinner/Spinner.styles.js.map +1 -1
  507. package/dist/components/primitives/TextField/TextField.d.ts +0 -17
  508. package/dist/components/primitives/TextField/TextField.d.ts.map +1 -1
  509. package/dist/components/primitives/TextField/TextField.js.map +1 -1
  510. package/dist/components/primitives/TextField/TextField.styles.d.ts +0 -17
  511. package/dist/components/primitives/TextField/TextField.styles.d.ts.map +1 -1
  512. package/dist/components/primitives/TextField/TextField.styles.js.map +1 -1
  513. package/dist/components/primitives/Toggle/Toggle.d.ts +0 -17
  514. package/dist/components/primitives/Toggle/Toggle.d.ts.map +1 -1
  515. package/dist/components/primitives/Toggle/Toggle.js.map +1 -1
  516. package/dist/components/primitives/Toggle/Toggle.styles.d.ts +0 -17
  517. package/dist/components/primitives/Toggle/Toggle.styles.d.ts.map +1 -1
  518. package/dist/components/primitives/Toggle/Toggle.styles.js.map +1 -1
  519. package/dist/components/primitives/Tooltip/Tooltip.d.ts +0 -17
  520. package/dist/components/primitives/Tooltip/Tooltip.d.ts.map +1 -1
  521. package/dist/components/primitives/Tooltip/Tooltip.js.map +1 -1
  522. package/dist/components/primitives/Tooltip/Tooltip.styles.d.ts +0 -17
  523. package/dist/components/primitives/Tooltip/Tooltip.styles.d.ts.map +1 -1
  524. package/dist/components/primitives/Tooltip/Tooltip.styles.js.map +1 -1
  525. package/dist/components/primitives/Typography/Typography.d.ts +0 -17
  526. package/dist/components/primitives/Typography/Typography.d.ts.map +1 -1
  527. package/dist/components/primitives/Typography/Typography.js.map +1 -1
  528. package/dist/components/primitives/Typography/Typography.styles.d.ts +0 -17
  529. package/dist/components/primitives/Typography/Typography.styles.d.ts.map +1 -1
  530. package/dist/components/primitives/Typography/Typography.styles.js.map +1 -1
  531. package/dist/contexts/ComponentRenderer/ComponentRendererContext.d.ts +0 -17
  532. package/dist/contexts/ComponentRenderer/ComponentRendererContext.d.ts.map +1 -1
  533. package/dist/contexts/ComponentRenderer/ComponentRendererContext.js.map +1 -1
  534. package/dist/contexts/ComponentRenderer/ComponentRendererProvider.d.ts +0 -17
  535. package/dist/contexts/ComponentRenderer/ComponentRendererProvider.d.ts.map +1 -1
  536. package/dist/contexts/ComponentRenderer/ComponentRendererProvider.js.map +1 -1
  537. package/dist/contexts/Flow/FlowContext.d.ts +0 -17
  538. package/dist/contexts/Flow/FlowContext.d.ts.map +1 -1
  539. package/dist/contexts/Flow/FlowContext.js.map +1 -1
  540. package/dist/contexts/Flow/FlowProvider.d.ts +0 -17
  541. package/dist/contexts/Flow/FlowProvider.d.ts.map +1 -1
  542. package/dist/contexts/Flow/FlowProvider.js.map +1 -1
  543. package/dist/contexts/Flow/useFlow.d.ts +0 -17
  544. package/dist/contexts/Flow/useFlow.d.ts.map +1 -1
  545. package/dist/contexts/Flow/useFlow.js.map +1 -1
  546. package/dist/contexts/FlowMeta/FlowMetaContext.d.ts +0 -17
  547. package/dist/contexts/FlowMeta/FlowMetaContext.d.ts.map +1 -1
  548. package/dist/contexts/FlowMeta/FlowMetaContext.js.map +1 -1
  549. package/dist/contexts/FlowMeta/FlowMetaProvider.d.ts +0 -17
  550. package/dist/contexts/FlowMeta/FlowMetaProvider.d.ts.map +1 -1
  551. package/dist/contexts/FlowMeta/FlowMetaProvider.js +6 -2
  552. package/dist/contexts/FlowMeta/FlowMetaProvider.js.map +1 -1
  553. package/dist/contexts/FlowMeta/useFlowMeta.d.ts +0 -17
  554. package/dist/contexts/FlowMeta/useFlowMeta.d.ts.map +1 -1
  555. package/dist/contexts/FlowMeta/useFlowMeta.js.map +1 -1
  556. package/dist/contexts/I18n/ComponentPreferencesContext.d.ts +0 -17
  557. package/dist/contexts/I18n/ComponentPreferencesContext.d.ts.map +1 -1
  558. package/dist/contexts/I18n/ComponentPreferencesContext.js.map +1 -1
  559. package/dist/contexts/I18n/I18nContext.d.ts +0 -17
  560. package/dist/contexts/I18n/I18nContext.d.ts.map +1 -1
  561. package/dist/contexts/I18n/I18nContext.js.map +1 -1
  562. package/dist/contexts/I18n/I18nProvider.d.ts +0 -17
  563. package/dist/contexts/I18n/I18nProvider.d.ts.map +1 -1
  564. package/dist/contexts/I18n/I18nProvider.js.map +1 -1
  565. package/dist/contexts/I18n/useI18n.d.ts +0 -17
  566. package/dist/contexts/I18n/useI18n.d.ts.map +1 -1
  567. package/dist/contexts/I18n/useI18n.js.map +1 -1
  568. package/dist/contexts/Theme/ThemeContext.d.ts +0 -17
  569. package/dist/contexts/Theme/ThemeContext.d.ts.map +1 -1
  570. package/dist/contexts/Theme/ThemeContext.js.map +1 -1
  571. package/dist/contexts/Theme/ThemeProvider.d.ts +0 -17
  572. package/dist/contexts/Theme/ThemeProvider.d.ts.map +1 -1
  573. package/dist/contexts/Theme/ThemeProvider.js.map +1 -1
  574. package/dist/contexts/Theme/types.d.ts +0 -17
  575. package/dist/contexts/Theme/types.d.ts.map +1 -1
  576. package/dist/contexts/Theme/useTheme.d.ts +0 -17
  577. package/dist/contexts/Theme/useTheme.d.ts.map +1 -1
  578. package/dist/contexts/Theme/useTheme.js.map +1 -1
  579. package/dist/contexts/ThunderID/ThunderIDContext.d.ts +5 -17
  580. package/dist/contexts/ThunderID/ThunderIDContext.d.ts.map +1 -1
  581. package/dist/contexts/ThunderID/ThunderIDContext.js.map +1 -1
  582. package/dist/contexts/ThunderID/ThunderIDProvider.d.ts +0 -17
  583. package/dist/contexts/ThunderID/ThunderIDProvider.d.ts.map +1 -1
  584. package/dist/contexts/ThunderID/ThunderIDProvider.js +34 -18
  585. package/dist/contexts/ThunderID/ThunderIDProvider.js.map +1 -1
  586. package/dist/contexts/ThunderID/useThunderID.d.ts +0 -17
  587. package/dist/contexts/ThunderID/useThunderID.d.ts.map +1 -1
  588. package/dist/contexts/ThunderID/useThunderID.js.map +1 -1
  589. package/dist/contexts/User/UserContext.d.ts +0 -17
  590. package/dist/contexts/User/UserContext.d.ts.map +1 -1
  591. package/dist/contexts/User/UserContext.js.map +1 -1
  592. package/dist/contexts/User/UserProvider.d.ts +0 -17
  593. package/dist/contexts/User/UserProvider.d.ts.map +1 -1
  594. package/dist/contexts/User/UserProvider.js.map +1 -1
  595. package/dist/contexts/User/useUser.d.ts +0 -17
  596. package/dist/contexts/User/useUser.d.ts.map +1 -1
  597. package/dist/contexts/User/useUser.js.map +1 -1
  598. package/dist/hooks/useBrowserUrl.d.ts +0 -17
  599. package/dist/hooks/useBrowserUrl.d.ts.map +1 -1
  600. package/dist/hooks/useBrowserUrl.js.map +1 -1
  601. package/dist/hooks/useForm.d.ts +0 -17
  602. package/dist/hooks/useForm.d.ts.map +1 -1
  603. package/dist/hooks/useForm.js.map +1 -1
  604. package/dist/hooks/useOAuthCallback.d.ts +0 -17
  605. package/dist/hooks/useOAuthCallback.d.ts.map +1 -1
  606. package/dist/hooks/useOAuthCallback.js.map +1 -1
  607. package/dist/hooks/useTranslation.d.ts +0 -17
  608. package/dist/hooks/useTranslation.d.ts.map +1 -1
  609. package/dist/hooks/useTranslation.js.map +1 -1
  610. package/dist/index.d.ts +0 -17
  611. package/dist/index.d.ts.map +1 -1
  612. package/dist/models/adapters.d.ts +0 -17
  613. package/dist/models/adapters.d.ts.map +1 -1
  614. package/dist/models/config.d.ts +0 -17
  615. package/dist/models/config.d.ts.map +1 -1
  616. package/dist/utils/applyThemeToDOM.d.ts +0 -17
  617. package/dist/utils/applyThemeToDOM.d.ts.map +1 -1
  618. package/dist/utils/applyThemeToDOM.js.map +1 -1
  619. package/dist/utils/buildThemeConfigFromFlowMeta.d.ts +0 -17
  620. package/dist/utils/buildThemeConfigFromFlowMeta.d.ts.map +1 -1
  621. package/dist/utils/buildThemeConfigFromFlowMeta.js.map +1 -1
  622. package/dist/utils/composeAffixedInputs.d.ts +0 -17
  623. package/dist/utils/composeAffixedInputs.d.ts.map +1 -1
  624. package/dist/utils/composeAffixedInputs.js.map +1 -1
  625. package/dist/utils/flowTransformer.d.ts +0 -17
  626. package/dist/utils/flowTransformer.d.ts.map +1 -1
  627. package/dist/utils/flowTransformer.js.map +1 -1
  628. package/dist/utils/getAuthComponentHeadings.d.ts +0 -17
  629. package/dist/utils/getAuthComponentHeadings.d.ts.map +1 -1
  630. package/dist/utils/getAuthComponentHeadings.js.map +1 -1
  631. package/dist/utils/getDisplayName.d.ts +0 -17
  632. package/dist/utils/getDisplayName.d.ts.map +1 -1
  633. package/dist/utils/getDisplayName.js.map +1 -1
  634. package/dist/utils/getMappedUserProfileValue.d.ts +0 -17
  635. package/dist/utils/getMappedUserProfileValue.d.ts.map +1 -1
  636. package/dist/utils/getMappedUserProfileValue.js.map +1 -1
  637. package/dist/utils/normalizeThemeConfig.d.ts +0 -17
  638. package/dist/utils/normalizeThemeConfig.d.ts.map +1 -1
  639. package/dist/utils/normalizeThemeConfig.js.map +1 -1
  640. package/dist/utils/oauth.d.ts +0 -17
  641. package/dist/utils/oauth.d.ts.map +1 -1
  642. package/dist/utils/oauth.js.map +1 -1
  643. package/dist/utils/passkey.d.ts +0 -17
  644. package/dist/utils/passkey.d.ts.map +1 -1
  645. package/dist/utils/passkey.js.map +1 -1
  646. package/dist/utils/resolveTranslationsInArray.d.ts +0 -17
  647. package/dist/utils/resolveTranslationsInArray.d.ts.map +1 -1
  648. package/dist/utils/resolveTranslationsInArray.js.map +1 -1
  649. package/dist/utils/resolveTranslationsInObject.d.ts +0 -17
  650. package/dist/utils/resolveTranslationsInObject.d.ts.map +1 -1
  651. package/dist/utils/resolveTranslationsInObject.js.map +1 -1
  652. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"useTranslation.cjs","names":["context: any","I18nContext","contextPreferences: I18nPreferences | undefined","ComponentPreferencesContext","effectivePreferences: I18nPreferences | undefined","mergedBundles: Record<string, I18nBundle>","merged: Record<string, I18nBundle>","normalizedTranslations: I18nTranslations","enhancedT: (key: string, params?: Record<string, string | number>) => string","translation: string | undefined","currentBundle: I18nBundle | undefined","fallbackBundle: I18nBundle | undefined"],"sources":["../../../src/hooks/useTranslation.ts"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n deepMerge,\n I18nPreferences,\n Preferences,\n I18nBundle,\n I18nTranslations,\n normalizeTranslations,\n} from '@thunderid/browser';\nimport {useContext, useMemo} from 'react';\nimport ComponentPreferencesContext from '../contexts/I18n/ComponentPreferencesContext';\nimport I18nContext from '../contexts/I18n/I18nContext';\n\nexport interface UseTranslation {\n /**\n * All available language codes\n */\n availableLanguages: string[];\n\n /**\n * The current language code\n */\n currentLanguage: string;\n\n /**\n * Function to change the current language\n */\n setLanguage: (language: string) => void;\n\n /**\n * Translation function that returns a translated string for the given key\n */\n t: (key: string, params?: Record<string, string | number>) => string;\n}\n\nexport interface UseTranslationWithPreferences extends UseTranslation {\n /**\n * Enhanced translation function that merges component-level preferences\n */\n t: (key: string, params?: Record<string, string | number>) => string;\n}\n\n/**\n * Hook for accessing translation functions and language management.\n * Must be used within an I18nProvider context.\n *\n * @param componentPreferences - Optional component-level i18n preferences to merge with global ones\n * @returns An object containing translation function and language management utilities\n * @throws Error if used outside of I18nProvider context\n */\nconst useTranslation = (componentPreferences?: I18nPreferences): UseTranslationWithPreferences => {\n const context: any = useContext(I18nContext);\n const componentPrefs: Preferences | undefined = useContext(ComponentPreferencesContext);\n const contextPreferences: I18nPreferences | undefined = componentPrefs?.i18n;\n\n if (!context) {\n throw new Error(\n 'useTranslation must be used within an I18nProvider. Make sure your component is wrapped with ThunderIDProvider which includes I18nProvider.',\n );\n }\n\n // Direct parameter takes precedence over context-provided preferences\n const effectivePreferences: I18nPreferences | undefined = componentPreferences ?? contextPreferences;\n\n const {t: globalT, currentLanguage, setLanguage, bundles: globalBundles, fallbackLanguage} = context;\n\n // Merge global bundles with component-level bundles if provided\n const mergedBundles: Record<string, I18nBundle> = useMemo(() => {\n if (!effectivePreferences?.bundles) {\n return globalBundles;\n }\n\n const merged: Record<string, I18nBundle> = {};\n\n // Start with global bundles\n Object.entries(globalBundles).forEach(([key, bundle]: [string, I18nBundle]) => {\n merged[key] = bundle;\n });\n\n // Merge component-level bundles using deepMerge for better merging\n Object.entries(effectivePreferences.bundles).forEach(([key, componentBundle]: [string, I18nBundle]) => {\n const normalizedTranslations: I18nTranslations = normalizeTranslations(\n componentBundle.translations as unknown as Record<string, string | Record<string, string>>,\n );\n if (merged[key]) {\n // Deep merge component bundle with existing global bundle\n merged[key] = {\n ...merged[key],\n metadata: componentBundle.metadata\n ? {...merged[key].metadata, ...componentBundle.metadata}\n : merged[key].metadata,\n translations: deepMerge(merged[key].translations, normalizedTranslations),\n };\n } else {\n // No global bundle for this language, use component bundle as-is\n merged[key] = {...componentBundle, translations: normalizedTranslations};\n }\n });\n\n return merged;\n }, [globalBundles, effectivePreferences?.bundles]);\n\n // Create enhanced translation function that uses merged bundles\n const enhancedT: (key: string, params?: Record<string, string | number>) => string = useMemo(() => {\n if (!effectivePreferences?.bundles) {\n // No component preferences, use global translation function\n return globalT;\n }\n\n return (key: string, params?: Record<string, string | number>): string => {\n let translation: string | undefined;\n\n // Try to get translation from current language bundle\n const currentBundle: I18nBundle | undefined = mergedBundles[currentLanguage];\n if (currentBundle?.translations?.[key]) {\n translation = currentBundle.translations[key];\n }\n\n // Fallback to fallback language if translation not found\n if (!translation && currentLanguage !== fallbackLanguage) {\n const fallbackBundle: I18nBundle | undefined = mergedBundles[fallbackLanguage];\n if (fallbackBundle?.translations?.[key]) {\n translation = fallbackBundle.translations[key];\n }\n }\n\n // If still no translation found, return the key itself\n if (!translation) {\n translation = key;\n }\n\n // Replace parameters if provided\n if (params && Object.keys(params).length > 0) {\n return Object.entries(params).reduce(\n (acc: string, [paramKey, paramValue]: [string, string | number]) =>\n acc.replace(new RegExp(`\\\\{${paramKey}\\\\}`, 'g'), String(paramValue)),\n translation,\n );\n }\n\n return translation;\n };\n }, [mergedBundles, currentLanguage, fallbackLanguage, globalT, effectivePreferences?.bundles]);\n\n return {\n availableLanguages: Object.keys(mergedBundles),\n currentLanguage,\n setLanguage,\n t: enhancedT,\n };\n};\n\nexport default useTranslation;\n"],"mappings":";;;;;;;;;;;;;;;;;AAmEA,MAAM,kBAAkB,yBAA0E;CAChG,MAAMA,gCAA0BC,4BAAY;CAE5C,MAAMC,2CADqDC,4CAA4B,EACf;AAExE,KAAI,CAAC,QACH,OAAM,IAAI,MACR,8IACD;CAIH,MAAMC,uBAAoD,wBAAwB;CAElF,MAAM,EAAC,GAAG,SAAS,iBAAiB,aAAa,SAAS,eAAe,qBAAoB;CAG7F,MAAMC,yCAA0D;AAC9D,MAAI,CAAC,sBAAsB,QACzB,QAAO;EAGT,MAAMC,SAAqC,EAAE;AAG7C,SAAO,QAAQ,cAAc,CAAC,SAAS,CAAC,KAAK,YAAkC;AAC7E,UAAO,OAAO;IACd;AAGF,SAAO,QAAQ,qBAAqB,QAAQ,CAAC,SAAS,CAAC,KAAK,qBAA2C;GACrG,MAAMC,wEACJ,gBAAgB,aACjB;AACD,OAAI,OAAO,KAET,QAAO,OAAO;IACZ,GAAG,OAAO;IACV,UAAU,gBAAgB,WACtB;KAAC,GAAG,OAAO,KAAK;KAAU,GAAG,gBAAgB;KAAS,GACtD,OAAO,KAAK;IAChB,iDAAwB,OAAO,KAAK,cAAc,uBAAuB;IAC1E;OAGD,QAAO,OAAO;IAAC,GAAG;IAAiB,cAAc;IAAuB;IAE1E;AAEF,SAAO;IACN,CAAC,eAAe,sBAAsB,QAAQ,CAAC;CAGlD,MAAMC,qCAA6F;AACjG,MAAI,CAAC,sBAAsB,QAEzB,QAAO;AAGT,UAAQ,KAAa,WAAqD;GACxE,IAAIC;GAGJ,MAAMC,gBAAwC,cAAc;AAC5D,OAAI,eAAe,eAAe,KAChC,eAAc,cAAc,aAAa;AAI3C,OAAI,CAAC,eAAe,oBAAoB,kBAAkB;IACxD,MAAMC,iBAAyC,cAAc;AAC7D,QAAI,gBAAgB,eAAe,KACjC,eAAc,eAAe,aAAa;;AAK9C,OAAI,CAAC,YACH,eAAc;AAIhB,OAAI,UAAU,OAAO,KAAK,OAAO,CAAC,SAAS,EACzC,QAAO,OAAO,QAAQ,OAAO,CAAC,QAC3B,KAAa,CAAC,UAAU,gBACvB,IAAI,QAAQ,IAAI,OAAO,MAAM,SAAS,MAAM,IAAI,EAAE,OAAO,WAAW,CAAC,EACvE,YACD;AAGH,UAAO;;IAER;EAAC;EAAe;EAAiB;EAAkB;EAAS,sBAAsB;EAAQ,CAAC;AAE9F,QAAO;EACL,oBAAoB,OAAO,KAAK,cAAc;EAC9C;EACA;EACA,GAAG;EACJ;;AAGH,6BAAe"}
1
+ {"version":3,"file":"useTranslation.cjs","names":["context: any","I18nContext","contextPreferences: I18nPreferences | undefined","ComponentPreferencesContext","effectivePreferences: I18nPreferences | undefined","mergedBundles: Record<string, I18nBundle>","merged: Record<string, I18nBundle>","normalizedTranslations: I18nTranslations","enhancedT: (key: string, params?: Record<string, string | number>) => string","translation: string | undefined","currentBundle: I18nBundle | undefined","fallbackBundle: I18nBundle | undefined"],"sources":["../../../src/hooks/useTranslation.ts"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n deepMerge,\n I18nPreferences,\n Preferences,\n I18nBundle,\n I18nTranslations,\n normalizeTranslations,\n} from '@thunderid/browser';\nimport {useContext, useMemo} from 'react';\nimport ComponentPreferencesContext from '../contexts/I18n/ComponentPreferencesContext';\nimport I18nContext from '../contexts/I18n/I18nContext';\n\nexport interface UseTranslation {\n /**\n * All available language codes\n */\n availableLanguages: string[];\n\n /**\n * The current language code\n */\n currentLanguage: string;\n\n /**\n * Function to change the current language\n */\n setLanguage: (language: string) => void;\n\n /**\n * Translation function that returns a translated string for the given key\n */\n t: (key: string, params?: Record<string, string | number>) => string;\n}\n\nexport interface UseTranslationWithPreferences extends UseTranslation {\n /**\n * Enhanced translation function that merges component-level preferences\n */\n t: (key: string, params?: Record<string, string | number>) => string;\n}\n\n/**\n * Hook for accessing translation functions and language management.\n * Must be used within an I18nProvider context.\n *\n * @param componentPreferences - Optional component-level i18n preferences to merge with global ones\n * @returns An object containing translation function and language management utilities\n * @throws Error if used outside of I18nProvider context\n */\nconst useTranslation = (componentPreferences?: I18nPreferences): UseTranslationWithPreferences => {\n const context: any = useContext(I18nContext);\n const componentPrefs: Preferences | undefined = useContext(ComponentPreferencesContext);\n const contextPreferences: I18nPreferences | undefined = componentPrefs?.i18n;\n\n if (!context) {\n throw new Error(\n 'useTranslation must be used within an I18nProvider. Make sure your component is wrapped with ThunderIDProvider which includes I18nProvider.',\n );\n }\n\n // Direct parameter takes precedence over context-provided preferences\n const effectivePreferences: I18nPreferences | undefined = componentPreferences ?? contextPreferences;\n\n const {t: globalT, currentLanguage, setLanguage, bundles: globalBundles, fallbackLanguage} = context;\n\n // Merge global bundles with component-level bundles if provided\n const mergedBundles: Record<string, I18nBundle> = useMemo(() => {\n if (!effectivePreferences?.bundles) {\n return globalBundles;\n }\n\n const merged: Record<string, I18nBundle> = {};\n\n // Start with global bundles\n Object.entries(globalBundles).forEach(([key, bundle]: [string, I18nBundle]) => {\n merged[key] = bundle;\n });\n\n // Merge component-level bundles using deepMerge for better merging\n Object.entries(effectivePreferences.bundles).forEach(([key, componentBundle]: [string, I18nBundle]) => {\n const normalizedTranslations: I18nTranslations = normalizeTranslations(\n componentBundle.translations as unknown as Record<string, string | Record<string, string>>,\n );\n if (merged[key]) {\n // Deep merge component bundle with existing global bundle\n merged[key] = {\n ...merged[key],\n metadata: componentBundle.metadata\n ? {...merged[key].metadata, ...componentBundle.metadata}\n : merged[key].metadata,\n translations: deepMerge(merged[key].translations, normalizedTranslations),\n };\n } else {\n // No global bundle for this language, use component bundle as-is\n merged[key] = {...componentBundle, translations: normalizedTranslations};\n }\n });\n\n return merged;\n }, [globalBundles, effectivePreferences?.bundles]);\n\n // Create enhanced translation function that uses merged bundles\n const enhancedT: (key: string, params?: Record<string, string | number>) => string = useMemo(() => {\n if (!effectivePreferences?.bundles) {\n // No component preferences, use global translation function\n return globalT;\n }\n\n return (key: string, params?: Record<string, string | number>): string => {\n let translation: string | undefined;\n\n // Try to get translation from current language bundle\n const currentBundle: I18nBundle | undefined = mergedBundles[currentLanguage];\n if (currentBundle?.translations?.[key]) {\n translation = currentBundle.translations[key];\n }\n\n // Fallback to fallback language if translation not found\n if (!translation && currentLanguage !== fallbackLanguage) {\n const fallbackBundle: I18nBundle | undefined = mergedBundles[fallbackLanguage];\n if (fallbackBundle?.translations?.[key]) {\n translation = fallbackBundle.translations[key];\n }\n }\n\n // If still no translation found, return the key itself\n if (!translation) {\n translation = key;\n }\n\n // Replace parameters if provided\n if (params && Object.keys(params).length > 0) {\n return Object.entries(params).reduce(\n (acc: string, [paramKey, paramValue]: [string, string | number]) =>\n acc.replace(new RegExp(`\\\\{${paramKey}\\\\}`, 'g'), String(paramValue)),\n translation,\n );\n }\n\n return translation;\n };\n }, [mergedBundles, currentLanguage, fallbackLanguage, globalT, effectivePreferences?.bundles]);\n\n return {\n availableLanguages: Object.keys(mergedBundles),\n currentLanguage,\n setLanguage,\n t: enhancedT,\n };\n};\n\nexport default useTranslation;\n"],"mappings":";;;;;;;;;;;;;;;;;AAoDA,MAAM,kBAAkB,yBAA0E;CAChG,MAAMA,gCAA0BC,4BAAY;CAE5C,MAAMC,2CADqDC,4CAA4B,EACf;AAExE,KAAI,CAAC,QACH,OAAM,IAAI,MACR,8IACD;CAIH,MAAMC,uBAAoD,wBAAwB;CAElF,MAAM,EAAC,GAAG,SAAS,iBAAiB,aAAa,SAAS,eAAe,qBAAoB;CAG7F,MAAMC,yCAA0D;AAC9D,MAAI,CAAC,sBAAsB,QACzB,QAAO;EAGT,MAAMC,SAAqC,EAAE;AAG7C,SAAO,QAAQ,cAAc,CAAC,SAAS,CAAC,KAAK,YAAkC;AAC7E,UAAO,OAAO;IACd;AAGF,SAAO,QAAQ,qBAAqB,QAAQ,CAAC,SAAS,CAAC,KAAK,qBAA2C;GACrG,MAAMC,wEACJ,gBAAgB,aACjB;AACD,OAAI,OAAO,KAET,QAAO,OAAO;IACZ,GAAG,OAAO;IACV,UAAU,gBAAgB,WACtB;KAAC,GAAG,OAAO,KAAK;KAAU,GAAG,gBAAgB;KAAS,GACtD,OAAO,KAAK;IAChB,iDAAwB,OAAO,KAAK,cAAc,uBAAuB;IAC1E;OAGD,QAAO,OAAO;IAAC,GAAG;IAAiB,cAAc;IAAuB;IAE1E;AAEF,SAAO;IACN,CAAC,eAAe,sBAAsB,QAAQ,CAAC;CAGlD,MAAMC,qCAA6F;AACjG,MAAI,CAAC,sBAAsB,QAEzB,QAAO;AAGT,UAAQ,KAAa,WAAqD;GACxE,IAAIC;GAGJ,MAAMC,gBAAwC,cAAc;AAC5D,OAAI,eAAe,eAAe,KAChC,eAAc,cAAc,aAAa;AAI3C,OAAI,CAAC,eAAe,oBAAoB,kBAAkB;IACxD,MAAMC,iBAAyC,cAAc;AAC7D,QAAI,gBAAgB,eAAe,KACjC,eAAc,eAAe,aAAa;;AAK9C,OAAI,CAAC,YACH,eAAc;AAIhB,OAAI,UAAU,OAAO,KAAK,OAAO,CAAC,SAAS,EACzC,QAAO,OAAO,QAAQ,OAAO,CAAC,QAC3B,KAAa,CAAC,UAAU,gBACvB,IAAI,QAAQ,IAAI,OAAO,MAAM,SAAS,MAAM,IAAI,EAAE,OAAO,WAAW,CAAC,EACvE,YACD;AAGH,UAAO;;IAER;EAAC;EAAe;EAAiB;EAAkB;EAAS,sBAAsB;EAAQ,CAAC;AAE9F,QAAO;EACL,oBAAoB,OAAO,KAAK,cAAc;EAC9C;EACA;EACA,GAAG;EACJ;;AAGH,6BAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"applyThemeToDOM.cjs","names":[],"sources":["../../../src/utils/applyThemeToDOM.ts"],"sourcesContent":["/**\n * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {Theme} from '@thunderid/browser';\n\n/**\n * Writes all CSS custom properties from a resolved `Theme` onto the document root.\n * Called inside a `useEffect` whenever the active theme changes.\n */\nconst applyThemeToDOM = (theme: Theme): void => {\n Object.entries(theme.cssVariables).forEach(([key, value]: [string, string]) => {\n document.documentElement.style.setProperty(key, value);\n });\n};\n\nexport default applyThemeToDOM;\n"],"mappings":";;;;;;AAwBA,MAAM,mBAAmB,UAAuB;AAC9C,QAAO,QAAQ,MAAM,aAAa,CAAC,SAAS,CAAC,KAAK,WAA6B;AAC7E,WAAS,gBAAgB,MAAM,YAAY,KAAK,MAAM;GACtD;;AAGJ,8BAAe"}
1
+ {"version":3,"file":"applyThemeToDOM.cjs","names":[],"sources":["../../../src/utils/applyThemeToDOM.ts"],"sourcesContent":["// Copyright 2026 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {Theme} from '@thunderid/browser';\n\n/**\n * Writes all CSS custom properties from a resolved `Theme` onto the document root.\n * Called inside a `useEffect` whenever the active theme changes.\n */\nconst applyThemeToDOM = (theme: Theme): void => {\n Object.entries(theme.cssVariables).forEach(([key, value]: [string, string]) => {\n document.documentElement.style.setProperty(key, value);\n });\n};\n\nexport default applyThemeToDOM;\n"],"mappings":";;;;;;AASA,MAAM,mBAAmB,UAAuB;AAC9C,QAAO,QAAQ,MAAM,aAAa,CAAC,SAAS,CAAC,KAAK,WAA6B;AAC7E,WAAS,gBAAgB,MAAM,YAAY,KAAK,MAAM;GACtD;;AAGJ,8BAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"buildThemeConfigFromFlowMeta.cjs","names":["scheme: FlowMetaThemeColorScheme | undefined","colors: RecursivePartial<ThemeConfig['colors']> | undefined","bg: RecursivePartial<ThemeConfig['colors']['background']>"],"sources":["../../../src/utils/buildThemeConfigFromFlowMeta.ts"],"sourcesContent":["/**\n * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {\n FlowMetaTheme,\n FlowMetaThemeColorScheme,\n RecursivePartial,\n ThemeConfig,\n normalizeBorderRadius,\n} from '@thunderid/browser';\n\n/**\n * Converts a v2 `FlowMetaTheme` into a `RecursivePartial<ThemeConfig>` that\n * `createTheme` can consume.\n *\n * Only fields explicitly present in the FlowMeta response are included so that\n * `createTheme` can deep-merge them onto its base (light/dark) defaults without\n * accidentally dropping sibling keys that were not returned by the server.\n *\n * For example, when FlowMeta returns only `background.default` and\n * `background.paper`, only `body.main` and `surface` are set — the base\n * theme's `background.disabled` and `background.dark` are **not** overridden\n * and therefore keep their default CSS variable values.\n */\nconst buildThemeConfigFromFlowMeta = (\n flowMetaTheme: FlowMetaTheme,\n colorScheme: 'light' | 'dark',\n): RecursivePartial<ThemeConfig> => {\n const scheme: FlowMetaThemeColorScheme | undefined = flowMetaTheme.colorSchemes?.[colorScheme];\n const borderRadiusConfig = normalizeBorderRadius(flowMetaTheme.shape?.borderRadius);\n\n // Build only the colors that the server actually provided.\n // Each nested object is constructed incrementally so that absent fields are\n // simply omitted rather than set to `undefined`, which would shadow the\n // base-theme defaults inside `createTheme`.\n let colors: RecursivePartial<ThemeConfig['colors']> | undefined;\n\n if (scheme?.palette) {\n colors = {};\n\n if (scheme.palette.primary) {\n colors.primary = scheme.palette.primary;\n }\n if (scheme.palette.secondary) {\n colors.secondary = scheme.palette.secondary;\n }\n if (scheme.palette.text) {\n colors.text = scheme.palette.text;\n }\n\n // Build background incrementally to avoid replacing the full base object.\n if (scheme.palette.background) {\n const bg: RecursivePartial<ThemeConfig['colors']['background']> = {};\n\n if (scheme.palette.background.default) {\n bg.body = {main: scheme.palette.background.default};\n }\n if (scheme.palette.background.paper) {\n bg.surface = scheme.palette.background.paper;\n }\n\n if (Object.keys(bg).length > 0) {\n colors.background = bg;\n }\n }\n }\n\n return {\n ...flowMetaTheme,\n ...(flowMetaTheme.direction ? {direction: flowMetaTheme.direction} : {}),\n ...(borderRadiusConfig ? {borderRadius: borderRadiusConfig} : {}),\n ...(colors && Object.keys(colors).length > 0 ? {colors} : {}),\n ...(flowMetaTheme.typography?.fontFamily ? {typography: {fontFamily: flowMetaTheme.typography.fontFamily}} : {}),\n };\n};\n\nexport default buildThemeConfigFromFlowMeta;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAuCA,MAAM,gCACJ,eACA,gBACkC;CAClC,MAAMA,SAA+C,cAAc,eAAe;CAClF,MAAM,oEAA2C,cAAc,OAAO,aAAa;CAMnF,IAAIC;AAEJ,KAAI,QAAQ,SAAS;AACnB,WAAS,EAAE;AAEX,MAAI,OAAO,QAAQ,QACjB,QAAO,UAAU,OAAO,QAAQ;AAElC,MAAI,OAAO,QAAQ,UACjB,QAAO,YAAY,OAAO,QAAQ;AAEpC,MAAI,OAAO,QAAQ,KACjB,QAAO,OAAO,OAAO,QAAQ;AAI/B,MAAI,OAAO,QAAQ,YAAY;GAC7B,MAAMC,KAA4D,EAAE;AAEpE,OAAI,OAAO,QAAQ,WAAW,QAC5B,IAAG,OAAO,EAAC,MAAM,OAAO,QAAQ,WAAW,SAAQ;AAErD,OAAI,OAAO,QAAQ,WAAW,MAC5B,IAAG,UAAU,OAAO,QAAQ,WAAW;AAGzC,OAAI,OAAO,KAAK,GAAG,CAAC,SAAS,EAC3B,QAAO,aAAa;;;AAK1B,QAAO;EACL,GAAG;EACH,GAAI,cAAc,YAAY,EAAC,WAAW,cAAc,WAAU,GAAG,EAAE;EACvE,GAAI,qBAAqB,EAAC,cAAc,oBAAmB,GAAG,EAAE;EAChE,GAAI,UAAU,OAAO,KAAK,OAAO,CAAC,SAAS,IAAI,EAAC,QAAO,GAAG,EAAE;EAC5D,GAAI,cAAc,YAAY,aAAa,EAAC,YAAY,EAAC,YAAY,cAAc,WAAW,YAAW,EAAC,GAAG,EAAE;EAChH;;AAGH,2CAAe"}
1
+ {"version":3,"file":"buildThemeConfigFromFlowMeta.cjs","names":["scheme: FlowMetaThemeColorScheme | undefined","colors: RecursivePartial<ThemeConfig['colors']> | undefined","bg: RecursivePartial<ThemeConfig['colors']['background']>"],"sources":["../../../src/utils/buildThemeConfigFromFlowMeta.ts"],"sourcesContent":["// Copyright 2026 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n FlowMetaTheme,\n FlowMetaThemeColorScheme,\n RecursivePartial,\n ThemeConfig,\n normalizeBorderRadius,\n} from '@thunderid/browser';\n\n/**\n * Converts a v2 `FlowMetaTheme` into a `RecursivePartial<ThemeConfig>` that\n * `createTheme` can consume.\n *\n * Only fields explicitly present in the FlowMeta response are included so that\n * `createTheme` can deep-merge them onto its base (light/dark) defaults without\n * accidentally dropping sibling keys that were not returned by the server.\n *\n * For example, when FlowMeta returns only `background.default` and\n * `background.paper`, only `body.main` and `surface` are set — the base\n * theme's `background.disabled` and `background.dark` are **not** overridden\n * and therefore keep their default CSS variable values.\n */\nconst buildThemeConfigFromFlowMeta = (\n flowMetaTheme: FlowMetaTheme,\n colorScheme: 'light' | 'dark',\n): RecursivePartial<ThemeConfig> => {\n const scheme: FlowMetaThemeColorScheme | undefined = flowMetaTheme.colorSchemes?.[colorScheme];\n const borderRadiusConfig = normalizeBorderRadius(flowMetaTheme.shape?.borderRadius);\n\n // Build only the colors that the server actually provided.\n // Each nested object is constructed incrementally so that absent fields are\n // simply omitted rather than set to `undefined`, which would shadow the\n // base-theme defaults inside `createTheme`.\n let colors: RecursivePartial<ThemeConfig['colors']> | undefined;\n\n if (scheme?.palette) {\n colors = {};\n\n if (scheme.palette.primary) {\n colors.primary = scheme.palette.primary;\n }\n if (scheme.palette.secondary) {\n colors.secondary = scheme.palette.secondary;\n }\n if (scheme.palette.text) {\n colors.text = scheme.palette.text;\n }\n\n // Build background incrementally to avoid replacing the full base object.\n if (scheme.palette.background) {\n const bg: RecursivePartial<ThemeConfig['colors']['background']> = {};\n\n if (scheme.palette.background.default) {\n bg.body = {main: scheme.palette.background.default};\n }\n if (scheme.palette.background.paper) {\n bg.surface = scheme.palette.background.paper;\n }\n\n if (Object.keys(bg).length > 0) {\n colors.background = bg;\n }\n }\n }\n\n return {\n ...flowMetaTheme,\n ...(flowMetaTheme.direction ? {direction: flowMetaTheme.direction} : {}),\n ...(borderRadiusConfig ? {borderRadius: borderRadiusConfig} : {}),\n ...(colors && Object.keys(colors).length > 0 ? {colors} : {}),\n ...(flowMetaTheme.typography?.fontFamily ? {typography: {fontFamily: flowMetaTheme.typography.fontFamily}} : {}),\n };\n};\n\nexport default buildThemeConfigFromFlowMeta;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAwBA,MAAM,gCACJ,eACA,gBACkC;CAClC,MAAMA,SAA+C,cAAc,eAAe;CAClF,MAAM,oEAA2C,cAAc,OAAO,aAAa;CAMnF,IAAIC;AAEJ,KAAI,QAAQ,SAAS;AACnB,WAAS,EAAE;AAEX,MAAI,OAAO,QAAQ,QACjB,QAAO,UAAU,OAAO,QAAQ;AAElC,MAAI,OAAO,QAAQ,UACjB,QAAO,YAAY,OAAO,QAAQ;AAEpC,MAAI,OAAO,QAAQ,KACjB,QAAO,OAAO,OAAO,QAAQ;AAI/B,MAAI,OAAO,QAAQ,YAAY;GAC7B,MAAMC,KAA4D,EAAE;AAEpE,OAAI,OAAO,QAAQ,WAAW,QAC5B,IAAG,OAAO,EAAC,MAAM,OAAO,QAAQ,WAAW,SAAQ;AAErD,OAAI,OAAO,QAAQ,WAAW,MAC5B,IAAG,UAAU,OAAO,QAAQ,WAAW;AAGzC,OAAI,OAAO,KAAK,GAAG,CAAC,SAAS,EAC3B,QAAO,aAAa;;;AAK1B,QAAO;EACL,GAAG;EACH,GAAI,cAAc,YAAY,EAAC,WAAW,cAAc,WAAU,GAAG,EAAE;EACvE,GAAI,qBAAqB,EAAC,cAAc,oBAAmB,GAAG,EAAE;EAChE,GAAI,UAAU,OAAO,KAAK,OAAO,CAAC,SAAS,IAAI,EAAC,QAAO,GAAG,EAAE;EAC5D,GAAI,cAAc,YAAY,aAAa,EAAC,YAAY,EAAC,YAAY,cAAc,WAAW,YAAW,EAAC,GAAG,EAAE;EAChH;;AAGH,2CAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"composeAffixedInputs.cjs","names":["composed: Record<string, string>","prefixTag: string","postfixTag: string","identifier: string","typed: string"],"sources":["../../../src/utils/composeAffixedInputs.ts"],"sourcesContent":["/**\n * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {getVendorPrefix} from '@thunderid/browser';\n\n/**\n * Returns the runtime sentinel prefix used to tag \"selected prefix\" entries in the\n * form-state map. Resolved through the vendor namespace so white-labeled deployments\n * do not collide with each other or with a real field identifier.\n */\nconst prefixSentinel = (vendor?: string): string => `__${getVendorPrefix(vendor)}_prefix__`;\n\n/**\n * Returns the runtime sentinel prefix used to tag \"postfix\" entries in the form-state\n * map. See {@link prefixSentinel}.\n */\nconst postfixSentinel = (vendor?: string): string => `__${getVendorPrefix(vendor)}_postfix__`;\n\n/**\n * Returns the sentinel key used to store the selected prefix `value` for the affixed\n * field addressed by `identifier`. The vendor namespace controls the runtime string\n * so consumers overriding `vendor` do not conflict with the SDK default.\n */\nexport const affixPrefixKey = (identifier: string, vendor?: string): string => `${prefixSentinel(vendor)}${identifier}`;\n\n/**\n * Returns the sentinel key used to store the postfix `value` for the affixed field\n * addressed by `identifier`. See {@link affixPrefixKey}.\n */\nexport const affixPostfixKey = (identifier: string, vendor?: string): string =>\n `${postfixSentinel(vendor)}${identifier}`;\n\n/**\n * Rewrites `formData` (returns a new object) so that any affixed-input identifier\n * tracked by matching sentinel prefix/postfix keys is replaced with its composed\n * form `${prefix}${typed}${postfix}`. Sentinel keys are stripped from the result.\n *\n * Behaviour:\n * - Prefix present, postfix present → `prefix + typed + postfix`.\n * - Only prefix present → `prefix + typed`.\n * - Only postfix present → `typed + postfix`.\n * - Both empty / typed empty → the identifier is left untouched.\n * - No sentinel keys → returns a shallow copy of `formData` unchanged.\n *\n * The input object is not mutated. This is component-type agnostic: any field carrying\n * matching sentinel keys is composed, regardless of whether it originated from a\n * TEXT_INPUT, EMAIL_INPUT, PASSWORD_INPUT, or PHONE_INPUT.\n *\n * @param formData - The current form values map (values indexed by field identifier).\n * @param vendor - The vendor namespace configured on the SDK client, if any. Sentinel\n * keys are resolved through this namespace so composition ignores unrelated keys\n * written by other vendors when multiple SDK instances share a form.\n */\nconst composeAffixedInputs = (formData: Record<string, string>, vendor?: string): Record<string, string> => {\n const composed: Record<string, string> = {...formData};\n const prefixTag: string = prefixSentinel(vendor);\n const postfixTag: string = postfixSentinel(vendor);\n\n for (const key of Object.keys(formData)) {\n if (!key.startsWith(prefixTag) && !key.startsWith(postfixTag)) {\n continue;\n }\n\n const identifier: string = key.startsWith(prefixTag) ? key.slice(prefixTag.length) : key.slice(postfixTag.length);\n\n const typed: string = composed[identifier] ?? '';\n if (typed === '') {\n // Preserve emptiness — required-field checks are the caller's responsibility.\n delete composed[affixPrefixKey(identifier, vendor)];\n delete composed[affixPostfixKey(identifier, vendor)];\n continue;\n }\n\n const prefix: string = composed[affixPrefixKey(identifier, vendor)] ?? '';\n const postfix: string = composed[affixPostfixKey(identifier, vendor)] ?? '';\n\n composed[identifier] = `${prefix}${typed}${postfix}`;\n delete composed[affixPrefixKey(identifier, vendor)];\n delete composed[affixPostfixKey(identifier, vendor)];\n }\n\n return composed;\n};\n\nexport default composeAffixedInputs;\n"],"mappings":";;;;;;;;;;AAyBA,MAAM,kBAAkB,WAA4B,8CAAqB,OAAO,CAAC;;;;;AAMjF,MAAM,mBAAmB,WAA4B,8CAAqB,OAAO,CAAC;;;;;;AAOlF,MAAa,kBAAkB,YAAoB,WAA4B,GAAG,eAAe,OAAO,GAAG;;;;;AAM3G,MAAa,mBAAmB,YAAoB,WAClD,GAAG,gBAAgB,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;AAuB/B,MAAM,wBAAwB,UAAkC,WAA4C;CAC1G,MAAMA,WAAmC,EAAC,GAAG,UAAS;CACtD,MAAMC,YAAoB,eAAe,OAAO;CAChD,MAAMC,aAAqB,gBAAgB,OAAO;AAElD,MAAK,MAAM,OAAO,OAAO,KAAK,SAAS,EAAE;AACvC,MAAI,CAAC,IAAI,WAAW,UAAU,IAAI,CAAC,IAAI,WAAW,WAAW,CAC3D;EAGF,MAAMC,aAAqB,IAAI,WAAW,UAAU,GAAG,IAAI,MAAM,UAAU,OAAO,GAAG,IAAI,MAAM,WAAW,OAAO;EAEjH,MAAMC,QAAgB,SAAS,eAAe;AAC9C,MAAI,UAAU,IAAI;AAEhB,UAAO,SAAS,eAAe,YAAY,OAAO;AAClD,UAAO,SAAS,gBAAgB,YAAY,OAAO;AACnD;;AAMF,WAAS,cAAc,GAHA,SAAS,eAAe,YAAY,OAAO,KAAK,KAGpC,QAFX,SAAS,gBAAgB,YAAY,OAAO,KAAK;AAGzE,SAAO,SAAS,eAAe,YAAY,OAAO;AAClD,SAAO,SAAS,gBAAgB,YAAY,OAAO;;AAGrD,QAAO;;AAGT,mCAAe"}
1
+ {"version":3,"file":"composeAffixedInputs.cjs","names":["composed: Record<string, string>","prefixTag: string","postfixTag: string","identifier: string","typed: string"],"sources":["../../../src/utils/composeAffixedInputs.ts"],"sourcesContent":["// Copyright 2026 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {getVendorPrefix} from '@thunderid/browser';\n\n/**\n * Returns the runtime sentinel prefix used to tag \"selected prefix\" entries in the\n * form-state map. Resolved through the vendor namespace so white-labeled deployments\n * do not collide with each other or with a real field identifier.\n */\nconst prefixSentinel = (vendor?: string): string => `__${getVendorPrefix(vendor)}_prefix__`;\n\n/**\n * Returns the runtime sentinel prefix used to tag \"postfix\" entries in the form-state\n * map. See {@link prefixSentinel}.\n */\nconst postfixSentinel = (vendor?: string): string => `__${getVendorPrefix(vendor)}_postfix__`;\n\n/**\n * Returns the sentinel key used to store the selected prefix `value` for the affixed\n * field addressed by `identifier`. The vendor namespace controls the runtime string\n * so consumers overriding `vendor` do not conflict with the SDK default.\n */\nexport const affixPrefixKey = (identifier: string, vendor?: string): string => `${prefixSentinel(vendor)}${identifier}`;\n\n/**\n * Returns the sentinel key used to store the postfix `value` for the affixed field\n * addressed by `identifier`. See {@link affixPrefixKey}.\n */\nexport const affixPostfixKey = (identifier: string, vendor?: string): string =>\n `${postfixSentinel(vendor)}${identifier}`;\n\n/**\n * Rewrites `formData` (returns a new object) so that any affixed-input identifier\n * tracked by matching sentinel prefix/postfix keys is replaced with its composed\n * form `${prefix}${typed}${postfix}`. Sentinel keys are stripped from the result.\n *\n * Behaviour:\n * - Prefix present, postfix present → `prefix + typed + postfix`.\n * - Only prefix present → `prefix + typed`.\n * - Only postfix present → `typed + postfix`.\n * - Both empty / typed empty → the identifier is left untouched.\n * - No sentinel keys → returns a shallow copy of `formData` unchanged.\n *\n * The input object is not mutated. This is component-type agnostic: any field carrying\n * matching sentinel keys is composed, regardless of whether it originated from a\n * TEXT_INPUT, EMAIL_INPUT, PASSWORD_INPUT, or PHONE_INPUT.\n *\n * @param formData - The current form values map (values indexed by field identifier).\n * @param vendor - The vendor namespace configured on the SDK client, if any. Sentinel\n * keys are resolved through this namespace so composition ignores unrelated keys\n * written by other vendors when multiple SDK instances share a form.\n */\nconst composeAffixedInputs = (formData: Record<string, string>, vendor?: string): Record<string, string> => {\n const composed: Record<string, string> = {...formData};\n const prefixTag: string = prefixSentinel(vendor);\n const postfixTag: string = postfixSentinel(vendor);\n\n for (const key of Object.keys(formData)) {\n if (!key.startsWith(prefixTag) && !key.startsWith(postfixTag)) {\n continue;\n }\n\n const identifier: string = key.startsWith(prefixTag) ? key.slice(prefixTag.length) : key.slice(postfixTag.length);\n\n const typed: string = composed[identifier] ?? '';\n if (typed === '') {\n // Preserve emptiness — required-field checks are the caller's responsibility.\n delete composed[affixPrefixKey(identifier, vendor)];\n delete composed[affixPostfixKey(identifier, vendor)];\n continue;\n }\n\n const prefix: string = composed[affixPrefixKey(identifier, vendor)] ?? '';\n const postfix: string = composed[affixPostfixKey(identifier, vendor)] ?? '';\n\n composed[identifier] = `${prefix}${typed}${postfix}`;\n delete composed[affixPrefixKey(identifier, vendor)];\n delete composed[affixPostfixKey(identifier, vendor)];\n }\n\n return composed;\n};\n\nexport default composeAffixedInputs;\n"],"mappings":";;;;;;;;;;AAUA,MAAM,kBAAkB,WAA4B,8CAAqB,OAAO,CAAC;;;;;AAMjF,MAAM,mBAAmB,WAA4B,8CAAqB,OAAO,CAAC;;;;;;AAOlF,MAAa,kBAAkB,YAAoB,WAA4B,GAAG,eAAe,OAAO,GAAG;;;;;AAM3G,MAAa,mBAAmB,YAAoB,WAClD,GAAG,gBAAgB,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;AAuB/B,MAAM,wBAAwB,UAAkC,WAA4C;CAC1G,MAAMA,WAAmC,EAAC,GAAG,UAAS;CACtD,MAAMC,YAAoB,eAAe,OAAO;CAChD,MAAMC,aAAqB,gBAAgB,OAAO;AAElD,MAAK,MAAM,OAAO,OAAO,KAAK,SAAS,EAAE;AACvC,MAAI,CAAC,IAAI,WAAW,UAAU,IAAI,CAAC,IAAI,WAAW,WAAW,CAC3D;EAGF,MAAMC,aAAqB,IAAI,WAAW,UAAU,GAAG,IAAI,MAAM,UAAU,OAAO,GAAG,IAAI,MAAM,WAAW,OAAO;EAEjH,MAAMC,QAAgB,SAAS,eAAe;AAC9C,MAAI,UAAU,IAAI;AAEhB,UAAO,SAAS,eAAe,YAAY,OAAO;AAClD,UAAO,SAAS,gBAAgB,YAAY,OAAO;AACnD;;AAMF,WAAS,cAAc,GAHA,SAAS,eAAe,YAAY,OAAO,KAAK,KAGpC,QAFX,SAAS,gBAAgB,YAAY,OAAO,KAAK;AAGzE,SAAO,SAAS,eAAe,YAAY,OAAO;AAClD,SAAO,SAAS,gBAAgB,YAAY,OAAO;;AAGrD,QAAO;;AAGT,mCAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"flowTransformer.cjs","names":["mapping: Map<string, string>","transformedComponent: any","inputData: any","value: string","refMapping: Map<string, string>","actionMapping: Map<string, string>","inputsData: any[]","resolveTranslationsInArray","flowError: FlowErrorResponse['error']","translated: string","systemTranslated: string","fallback: string | undefined","additionalData: Record<string, any>","parsed: any"],"sources":["../../../src/utils/flowTransformer.ts"],"sourcesContent":["/**\n * Copyright (c) 2025-2026, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n/**\n * @fileoverview Shared flow response transformer utilities for v2 embedded flows.\n *\n * This module provides reusable transformation functions for normalizing embedded flow\n * responses from ThunderID APIs. It handles both successful responses with component\n * extraction and error responses with proper error message extraction.\n *\n * Key features:\n * - Component extraction from flow meta structure\n * - Translation string resolution in components\n * - Error response detection and message extraction\n * - Configurable error handling (throw vs return errors)\n *\n * Usage:\n * ```typescript\n * import { normalizeFlowResponse } from '../../../utils/flowTransformer';\n *\n * const { executionId, components } = normalizeFlowResponse(apiResponse, t, {\n * defaultErrorKey: 'components.signIn.errors.generic'\n * });\n * ```\n *\n * This transformer is used by both SignIn and SignUp v2 components to ensure\n * consistent response handling across all embedded flows.\n */\n\nimport {EmbeddedFlowComponent, FlowMetadataResponse} from '@thunderid/browser';\nimport resolveTranslationsInArray from './resolveTranslationsInArray';\nimport {UseTranslation} from '../hooks/useTranslation';\n\n/**\n * Generic flow error response interface that covers common error structure\n */\nexport interface FlowErrorResponse {\n error?: {\n code: string;\n description: {key: string; defaultValue?: string};\n message: {key: string; defaultValue?: string};\n };\n executionId: string;\n flowStatus: 'ERROR';\n}\n\n/**\n * Configuration options for flow transformation\n */\nexport interface FlowTransformOptions {\n /**\n * Default error message key for translation fallback\n * @default 'errors.flow.generic'\n */\n defaultErrorKey?: string;\n /**\n * Whether to resolve translation strings or keep them as i18n keys\n * @default true\n */\n resolveTranslations?: boolean;\n /**\n * Whether to throw errors or return them as normalized response\n * @default true\n */\n throwOnError?: boolean;\n}\n\n/**\n * Create a mapping from ref to identifier based on data.inputs array.\n * This handles cases where meta.components use 'ref' to reference inputs,\n * and data.inputs contain the actual 'identifier' field.\n *\n * @param response - The flow response object\n * @returns Map of ref to identifier\n */\nconst createInputRefMapping = (response: any): Map<string, string> => {\n const mapping: Map<string, string> = new Map<string, string>();\n\n if (response?.data?.inputs && Array.isArray(response.data.inputs)) {\n response.data.inputs.forEach((input: any) => {\n if (input.ref && input.identifier) {\n mapping.set(input.ref, input.identifier);\n }\n });\n }\n\n return mapping;\n};\n\n/**\n * Create a mapping from action ref to nextNode based on data.actions array.\n * This handles cases where meta.components reference actions by ref,\n * and data.actions contain the actual nextNode field for routing.\n *\n * @param response - The flow response object\n * @returns Map of action ref to nextNode\n */\nconst createActionRefMapping = (response: any): Map<string, string> => {\n const mapping: Map<string, string> = new Map<string, string>();\n\n if (response?.data?.actions && Array.isArray(response.data.actions)) {\n response.data.actions.forEach((action: any) => {\n if (action.ref && action.nextNode) {\n mapping.set(action.ref, action.nextNode);\n }\n });\n }\n\n return mapping;\n};\n\n/**\n * Apply input ref mapping to components recursively.\n * This ensures that component.ref values are mapped to the correct identifier\n * from data.inputs, enabling proper form submission.\n *\n * @param components - Array of components to transform\n * @param refMapping - Map of ref to identifier\n * @param actionMapping - Map of action ref to nextNode\n * @param inputsData - Array of input data for resolving SELECT options\n * @returns Transformed components with correct identifiers and action references\n */\nconst applyInputRefMapping = (\n components: EmbeddedFlowComponent[],\n refMapping: Map<string, string>,\n actionMapping: Map<string, string>,\n inputsData: any[] = [],\n): EmbeddedFlowComponent[] =>\n components.map((component: EmbeddedFlowComponent) => {\n const transformedComponent: any = {...component} as EmbeddedFlowComponent & {\n actionRef?: string;\n options?: {label: string; value: string}[];\n };\n\n // If this component has a ref that maps to an identifier, update it\n if (transformedComponent.ref && refMapping.has(transformedComponent.ref)) {\n transformedComponent.ref = refMapping.get(transformedComponent.ref);\n }\n\n // For SELECT components, copy options from data.inputs\n // The component.id matches the input.ref in the data structure\n if (transformedComponent.type === 'SELECT' && component.id) {\n const inputData: any = inputsData.find((input: any) => input.ref === component.id);\n if (inputData?.options) {\n transformedComponent.options = inputData.options.map((opt: any) => {\n if (typeof opt === 'string') {\n return {label: opt, value: opt};\n }\n // Safely handle non-string values to prevent React key crashes\n const value: string = typeof opt.value === 'object' ? JSON.stringify(opt.value) : String(opt.value || '');\n const label: string = typeof opt.label === 'object' ? JSON.stringify(opt.label) : String(opt.label || value);\n\n return {label, value};\n });\n }\n }\n\n // If this is an action component, map its id to the nextNode\n // Store the nextNode reference as actionRef property for later use\n if (\n transformedComponent.type === 'ACTION' &&\n transformedComponent.id &&\n actionMapping.has(transformedComponent.id)\n ) {\n transformedComponent.actionRef = actionMapping.get(transformedComponent.id);\n }\n\n // Recursively apply to nested components\n if (transformedComponent.components && Array.isArray(transformedComponent.components)) {\n transformedComponent.components = applyInputRefMapping(\n transformedComponent.components,\n refMapping,\n actionMapping,\n inputsData,\n );\n }\n\n return transformedComponent;\n });\n\n/**\n * Transform and resolve translations in components from flow response.\n * This function extracts components from the response meta structure and optionally resolves\n * any translation strings within them. It also handles mapping of input refs to identifiers\n * and action refs to nextNode values.\n *\n * @param response - The flow response object containing components in meta structure\n * @param t - Translation function from useTranslation hook\n * @param resolveTranslations - Whether to resolve translation strings or keep them as i18n keys (default: true)\n * @returns Array of flow components with resolved or unresolved translations\n */\nexport const transformComponents = (\n response: any,\n t: UseTranslation['t'],\n resolveTranslations = true,\n meta?: FlowMetadataResponse | null,\n): EmbeddedFlowComponent[] => {\n if (!response?.data?.meta?.components) {\n return [];\n }\n\n let {components} = response.data.meta;\n\n // Create mapping from ref to identifier based on data.inputs\n const refMapping: Map<string, string> = createInputRefMapping(response);\n\n // Create mapping from action ref to nextNode based on data.actions\n const actionMapping: Map<string, string> = createActionRefMapping(response);\n\n // Get inputs data for SELECT option resolution\n const inputsData: any[] = response?.data?.inputs || [];\n\n // Apply ref and action mapping if there are any mappings\n if (refMapping.size > 0 || actionMapping.size > 0 || inputsData.length > 0) {\n components = applyInputRefMapping(components, refMapping, actionMapping, inputsData);\n }\n\n return resolveTranslations ? resolveTranslationsInArray(components, t, undefined, meta) : components;\n};\n\n/**\n * Extract error message from flow error response.\n *\n * Resolution order:\n * 1. Structured `error` object: try i18n lookup via `t(error.message.key)`.\n * 2. Fallback to `defaultValue` from `message`, then `description`.\n * 3. Standard `Error.message`.\n * 4. Generic translated fallback via `defaultErrorKey`.\n */\nexport const extractErrorMessage = (\n error: FlowErrorResponse | any,\n t: UseTranslation['t'],\n defaultErrorKey = 'errors.flow.generic',\n): string => {\n if (error && typeof error === 'object' && error.error) {\n const flowError: FlowErrorResponse['error'] = error.error;\n\n // 1. Try i18n lookup on message.key first (preferred for user-facing errors)\n if (flowError?.message?.key) {\n const translated: string = t(flowError.message.key);\n if (translated && translated !== flowError.message.key) {\n return translated;\n }\n\n // If the key resolved to itself, retry under the 'system:' namespace\n const systemKey = `system.${flowError.message.key}`;\n const systemTranslated: string = t(systemKey);\n if (systemTranslated && systemTranslated !== systemKey) {\n return systemTranslated;\n }\n }\n\n // 2. Fall back to defaultValue from message, then description\n const fallback: string | undefined = flowError?.message?.defaultValue ?? flowError?.description?.defaultValue;\n if (fallback) {\n return fallback;\n }\n }\n\n // Legacy backward compatibility\n if (error && typeof error === 'object' && error.failureReason) {\n return error.failureReason;\n }\n\n if (error instanceof Error && error.message) {\n return error.message;\n }\n\n return t(defaultErrorKey);\n};\n\n/**\n * Check if a response is an error response and extract the error message.\n * This function identifies error responses by checking for ERROR status and failure reasons.\n *\n * @param response - The flow response to check\n * @param t - Translation function for error messages\n * @param defaultErrorKey - Default translation key for generic errors\n * @returns Error message string if response is an error, null otherwise\n */\nexport const checkForErrorResponse = (\n response: any,\n t: UseTranslation['t'],\n defaultErrorKey = 'errors.flow.generic',\n): string | null => {\n if (response?.flowStatus === 'ERROR') {\n return extractErrorMessage(response, t, defaultErrorKey);\n }\n\n return null;\n};\n\n/**\n * Generic flow response normalizer that handles both success and error responses.\n * This is the main transformer function that should be used by all flow components.\n *\n * @param response - The raw flow response from the API\n * @param t - Translation function from useTranslation hook\n * @param options - Configuration options for transformation behavior\n * @returns Normalized flow response with executionId and transformed components\n * @throws {any} The original response if it's an error and throwOnError is true\n */\nexport const normalizeFlowResponse = (\n response: any,\n t: UseTranslation['t'],\n options: FlowTransformOptions = {},\n meta?: FlowMetadataResponse | null,\n): {\n additionalData: Record<string, any>;\n components: EmbeddedFlowComponent[];\n executionId: string;\n} => {\n const {throwOnError = true, defaultErrorKey = 'errors.flow.generic', resolveTranslations = true} = options;\n\n // Check if this is an error response\n const errorMessage: string | null = checkForErrorResponse(response, t, defaultErrorKey);\n\n if (errorMessage && throwOnError) {\n // Throw the original response so it can be caught by error handling\n throw response;\n }\n\n const additionalData: Record<string, any> = (response?.data?.additionalData as Record<string, any>) ?? {};\n\n // The consent prompt is serialized as a JSON string (array) by the backend.\n // Parse it and wrap in the expected {purposes: [...]} structure.\n if (typeof additionalData['consentPrompt'] === 'string') {\n try {\n const parsed: any = JSON.parse(additionalData['consentPrompt']);\n additionalData['consentPrompt'] = {purposes: Array.isArray(parsed) ? parsed : []};\n } catch {\n // Leave unparseable value as-is\n }\n }\n\n return {\n additionalData,\n components: transformComponents(response, t, resolveTranslations, meta),\n executionId: response.executionId,\n };\n};\n"],"mappings":";;;;;;;;;;;AA0FA,MAAM,yBAAyB,aAAuC;CACpE,MAAMA,0BAA+B,IAAI,KAAqB;AAE9D,KAAI,UAAU,MAAM,UAAU,MAAM,QAAQ,SAAS,KAAK,OAAO,CAC/D,UAAS,KAAK,OAAO,SAAS,UAAe;AAC3C,MAAI,MAAM,OAAO,MAAM,WACrB,SAAQ,IAAI,MAAM,KAAK,MAAM,WAAW;GAE1C;AAGJ,QAAO;;;;;;;;;;AAWT,MAAM,0BAA0B,aAAuC;CACrE,MAAMA,0BAA+B,IAAI,KAAqB;AAE9D,KAAI,UAAU,MAAM,WAAW,MAAM,QAAQ,SAAS,KAAK,QAAQ,CACjE,UAAS,KAAK,QAAQ,SAAS,WAAgB;AAC7C,MAAI,OAAO,OAAO,OAAO,SACvB,SAAQ,IAAI,OAAO,KAAK,OAAO,SAAS;GAE1C;AAGJ,QAAO;;;;;;;;;;;;;AAcT,MAAM,wBACJ,YACA,YACA,eACA,aAAoB,EAAE,KAEtB,WAAW,KAAK,cAAqC;CACnD,MAAMC,uBAA4B,EAAC,GAAG,WAAU;AAMhD,KAAI,qBAAqB,OAAO,WAAW,IAAI,qBAAqB,IAAI,CACtE,sBAAqB,MAAM,WAAW,IAAI,qBAAqB,IAAI;AAKrE,KAAI,qBAAqB,SAAS,YAAY,UAAU,IAAI;EAC1D,MAAMC,YAAiB,WAAW,MAAM,UAAe,MAAM,QAAQ,UAAU,GAAG;AAClF,MAAI,WAAW,QACb,sBAAqB,UAAU,UAAU,QAAQ,KAAK,QAAa;AACjE,OAAI,OAAO,QAAQ,SACjB,QAAO;IAAC,OAAO;IAAK,OAAO;IAAI;GAGjC,MAAMC,QAAgB,OAAO,IAAI,UAAU,WAAW,KAAK,UAAU,IAAI,MAAM,GAAG,OAAO,IAAI,SAAS,GAAG;AAGzG,UAAO;IAAC,OAFc,OAAO,IAAI,UAAU,WAAW,KAAK,UAAU,IAAI,MAAM,GAAG,OAAO,IAAI,SAAS,MAAM;IAE7F;IAAM;IACrB;;AAMN,KACE,qBAAqB,SAAS,YAC9B,qBAAqB,MACrB,cAAc,IAAI,qBAAqB,GAAG,CAE1C,sBAAqB,YAAY,cAAc,IAAI,qBAAqB,GAAG;AAI7E,KAAI,qBAAqB,cAAc,MAAM,QAAQ,qBAAqB,WAAW,CACnF,sBAAqB,aAAa,qBAChC,qBAAqB,YACrB,YACA,eACA,WACD;AAGH,QAAO;EACP;;;;;;;;;;;;AAaJ,MAAa,uBACX,UACA,GACA,sBAAsB,MACtB,SAC4B;AAC5B,KAAI,CAAC,UAAU,MAAM,MAAM,WACzB,QAAO,EAAE;CAGX,IAAI,EAAC,eAAc,SAAS,KAAK;CAGjC,MAAMC,aAAkC,sBAAsB,SAAS;CAGvE,MAAMC,gBAAqC,uBAAuB,SAAS;CAG3E,MAAMC,aAAoB,UAAU,MAAM,UAAU,EAAE;AAGtD,KAAI,WAAW,OAAO,KAAK,cAAc,OAAO,KAAK,WAAW,SAAS,EACvE,cAAa,qBAAqB,YAAY,YAAY,eAAe,WAAW;AAGtF,QAAO,sBAAsBC,2CAA2B,YAAY,GAAG,QAAW,KAAK,GAAG;;;;;;;;;;;AAY5F,MAAa,uBACX,OACA,GACA,kBAAkB,0BACP;AACX,KAAI,SAAS,OAAO,UAAU,YAAY,MAAM,OAAO;EACrD,MAAMC,YAAwC,MAAM;AAGpD,MAAI,WAAW,SAAS,KAAK;GAC3B,MAAMC,aAAqB,EAAE,UAAU,QAAQ,IAAI;AACnD,OAAI,cAAc,eAAe,UAAU,QAAQ,IACjD,QAAO;GAIT,MAAM,YAAY,UAAU,UAAU,QAAQ;GAC9C,MAAMC,mBAA2B,EAAE,UAAU;AAC7C,OAAI,oBAAoB,qBAAqB,UAC3C,QAAO;;EAKX,MAAMC,WAA+B,WAAW,SAAS,gBAAgB,WAAW,aAAa;AACjG,MAAI,SACF,QAAO;;AAKX,KAAI,SAAS,OAAO,UAAU,YAAY,MAAM,cAC9C,QAAO,MAAM;AAGf,KAAI,iBAAiB,SAAS,MAAM,QAClC,QAAO,MAAM;AAGf,QAAO,EAAE,gBAAgB;;;;;;;;;;;AAY3B,MAAa,yBACX,UACA,GACA,kBAAkB,0BACA;AAClB,KAAI,UAAU,eAAe,QAC3B,QAAO,oBAAoB,UAAU,GAAG,gBAAgB;AAG1D,QAAO;;;;;;;;;;;;AAaT,MAAa,yBACX,UACA,GACA,UAAgC,EAAE,EAClC,SAKG;CACH,MAAM,EAAC,eAAe,MAAM,kBAAkB,uBAAuB,sBAAsB,SAAQ;AAKnG,KAFoC,sBAAsB,UAAU,GAAG,gBAAgB,IAEnE,aAElB,OAAM;CAGR,MAAMC,iBAAuC,UAAU,MAAM,kBAA0C,EAAE;AAIzG,KAAI,OAAO,eAAe,qBAAqB,SAC7C,KAAI;EACF,MAAMC,SAAc,KAAK,MAAM,eAAe,iBAAiB;AAC/D,iBAAe,mBAAmB,EAAC,UAAU,MAAM,QAAQ,OAAO,GAAG,SAAS,EAAE,EAAC;SAC3E;AAKV,QAAO;EACL;EACA,YAAY,oBAAoB,UAAU,GAAG,qBAAqB,KAAK;EACvE,aAAa,SAAS;EACvB"}
1
+ {"version":3,"file":"flowTransformer.cjs","names":["mapping: Map<string, string>","transformedComponent: any","inputData: any","value: string","refMapping: Map<string, string>","actionMapping: Map<string, string>","inputsData: any[]","resolveTranslationsInArray","flowError: FlowErrorResponse['error']","translated: string","systemTranslated: string","fallback: string | undefined","additionalData: Record<string, any>","parsed: any"],"sources":["../../../src/utils/flowTransformer.ts"],"sourcesContent":["// Copyright 2025-2026 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\n/**\n * @fileoverview Shared flow response transformer utilities for v2 embedded flows.\n *\n * This module provides reusable transformation functions for normalizing embedded flow\n * responses from ThunderID APIs. It handles both successful responses with component\n * extraction and error responses with proper error message extraction.\n *\n * Key features:\n * - Component extraction from flow meta structure\n * - Translation string resolution in components\n * - Error response detection and message extraction\n * - Configurable error handling (throw vs return errors)\n *\n * Usage:\n * ```typescript\n * import { normalizeFlowResponse } from '../../../utils/flowTransformer';\n *\n * const { executionId, components } = normalizeFlowResponse(apiResponse, t, {\n * defaultErrorKey: 'components.signIn.errors.generic'\n * });\n * ```\n *\n * This transformer is used by both SignIn and SignUp v2 components to ensure\n * consistent response handling across all embedded flows.\n */\n\nimport {EmbeddedFlowComponent, FlowMetadataResponse} from '@thunderid/browser';\nimport resolveTranslationsInArray from './resolveTranslationsInArray';\nimport {UseTranslation} from '../hooks/useTranslation';\n\n/**\n * Generic flow error response interface that covers common error structure\n */\nexport interface FlowErrorResponse {\n error?: {\n code: string;\n description: {key: string; defaultValue?: string};\n message: {key: string; defaultValue?: string};\n };\n executionId: string;\n flowStatus: 'ERROR';\n}\n\n/**\n * Configuration options for flow transformation\n */\nexport interface FlowTransformOptions {\n /**\n * Default error message key for translation fallback\n * @default 'errors.flow.generic'\n */\n defaultErrorKey?: string;\n /**\n * Whether to resolve translation strings or keep them as i18n keys\n * @default true\n */\n resolveTranslations?: boolean;\n /**\n * Whether to throw errors or return them as normalized response\n * @default true\n */\n throwOnError?: boolean;\n}\n\n/**\n * Create a mapping from ref to identifier based on data.inputs array.\n * This handles cases where meta.components use 'ref' to reference inputs,\n * and data.inputs contain the actual 'identifier' field.\n *\n * @param response - The flow response object\n * @returns Map of ref to identifier\n */\nconst createInputRefMapping = (response: any): Map<string, string> => {\n const mapping: Map<string, string> = new Map<string, string>();\n\n if (response?.data?.inputs && Array.isArray(response.data.inputs)) {\n response.data.inputs.forEach((input: any) => {\n if (input.ref && input.identifier) {\n mapping.set(input.ref, input.identifier);\n }\n });\n }\n\n return mapping;\n};\n\n/**\n * Create a mapping from action ref to nextNode based on data.actions array.\n * This handles cases where meta.components reference actions by ref,\n * and data.actions contain the actual nextNode field for routing.\n *\n * @param response - The flow response object\n * @returns Map of action ref to nextNode\n */\nconst createActionRefMapping = (response: any): Map<string, string> => {\n const mapping: Map<string, string> = new Map<string, string>();\n\n if (response?.data?.actions && Array.isArray(response.data.actions)) {\n response.data.actions.forEach((action: any) => {\n if (action.ref && action.nextNode) {\n mapping.set(action.ref, action.nextNode);\n }\n });\n }\n\n return mapping;\n};\n\n/**\n * Apply input ref mapping to components recursively.\n * This ensures that component.ref values are mapped to the correct identifier\n * from data.inputs, enabling proper form submission.\n *\n * @param components - Array of components to transform\n * @param refMapping - Map of ref to identifier\n * @param actionMapping - Map of action ref to nextNode\n * @param inputsData - Array of input data for resolving SELECT options\n * @returns Transformed components with correct identifiers and action references\n */\nconst applyInputRefMapping = (\n components: EmbeddedFlowComponent[],\n refMapping: Map<string, string>,\n actionMapping: Map<string, string>,\n inputsData: any[] = [],\n): EmbeddedFlowComponent[] =>\n components.map((component: EmbeddedFlowComponent) => {\n const transformedComponent: any = {...component} as EmbeddedFlowComponent & {\n actionRef?: string;\n options?: {label: string; value: string}[];\n };\n\n // If this component has a ref that maps to an identifier, update it\n if (transformedComponent.ref && refMapping.has(transformedComponent.ref)) {\n transformedComponent.ref = refMapping.get(transformedComponent.ref);\n }\n\n // For SELECT components, copy options from data.inputs\n // The component.id matches the input.ref in the data structure\n if (transformedComponent.type === 'SELECT' && component.id) {\n const inputData: any = inputsData.find((input: any) => input.ref === component.id);\n if (inputData?.options) {\n transformedComponent.options = inputData.options.map((opt: any) => {\n if (typeof opt === 'string') {\n return {label: opt, value: opt};\n }\n // Safely handle non-string values to prevent React key crashes\n const value: string = typeof opt.value === 'object' ? JSON.stringify(opt.value) : String(opt.value || '');\n const label: string = typeof opt.label === 'object' ? JSON.stringify(opt.label) : String(opt.label || value);\n\n return {label, value};\n });\n }\n }\n\n // If this is an action component, map its id to the nextNode\n // Store the nextNode reference as actionRef property for later use\n if (\n transformedComponent.type === 'ACTION' &&\n transformedComponent.id &&\n actionMapping.has(transformedComponent.id)\n ) {\n transformedComponent.actionRef = actionMapping.get(transformedComponent.id);\n }\n\n // Recursively apply to nested components\n if (transformedComponent.components && Array.isArray(transformedComponent.components)) {\n transformedComponent.components = applyInputRefMapping(\n transformedComponent.components,\n refMapping,\n actionMapping,\n inputsData,\n );\n }\n\n return transformedComponent;\n });\n\n/**\n * Transform and resolve translations in components from flow response.\n * This function extracts components from the response meta structure and optionally resolves\n * any translation strings within them. It also handles mapping of input refs to identifiers\n * and action refs to nextNode values.\n *\n * @param response - The flow response object containing components in meta structure\n * @param t - Translation function from useTranslation hook\n * @param resolveTranslations - Whether to resolve translation strings or keep them as i18n keys (default: true)\n * @returns Array of flow components with resolved or unresolved translations\n */\nexport const transformComponents = (\n response: any,\n t: UseTranslation['t'],\n resolveTranslations = true,\n meta?: FlowMetadataResponse | null,\n): EmbeddedFlowComponent[] => {\n if (!response?.data?.meta?.components) {\n return [];\n }\n\n let {components} = response.data.meta;\n\n // Create mapping from ref to identifier based on data.inputs\n const refMapping: Map<string, string> = createInputRefMapping(response);\n\n // Create mapping from action ref to nextNode based on data.actions\n const actionMapping: Map<string, string> = createActionRefMapping(response);\n\n // Get inputs data for SELECT option resolution\n const inputsData: any[] = response?.data?.inputs || [];\n\n // Apply ref and action mapping if there are any mappings\n if (refMapping.size > 0 || actionMapping.size > 0 || inputsData.length > 0) {\n components = applyInputRefMapping(components, refMapping, actionMapping, inputsData);\n }\n\n return resolveTranslations ? resolveTranslationsInArray(components, t, undefined, meta) : components;\n};\n\n/**\n * Extract error message from flow error response.\n *\n * Resolution order:\n * 1. Structured `error` object: try i18n lookup via `t(error.message.key)`.\n * 2. Fallback to `defaultValue` from `message`, then `description`.\n * 3. Standard `Error.message`.\n * 4. Generic translated fallback via `defaultErrorKey`.\n */\nexport const extractErrorMessage = (\n error: FlowErrorResponse | any,\n t: UseTranslation['t'],\n defaultErrorKey = 'errors.flow.generic',\n): string => {\n if (error && typeof error === 'object' && error.error) {\n const flowError: FlowErrorResponse['error'] = error.error;\n\n // 1. Try i18n lookup on message.key first (preferred for user-facing errors)\n if (flowError?.message?.key) {\n const translated: string = t(flowError.message.key);\n if (translated && translated !== flowError.message.key) {\n return translated;\n }\n\n // If the key resolved to itself, retry under the 'system:' namespace\n const systemKey = `system.${flowError.message.key}`;\n const systemTranslated: string = t(systemKey);\n if (systemTranslated && systemTranslated !== systemKey) {\n return systemTranslated;\n }\n }\n\n // 2. Fall back to defaultValue from message, then description\n const fallback: string | undefined = flowError?.message?.defaultValue ?? flowError?.description?.defaultValue;\n if (fallback) {\n return fallback;\n }\n }\n\n // Legacy backward compatibility\n if (error && typeof error === 'object' && error.failureReason) {\n return error.failureReason;\n }\n\n if (error instanceof Error && error.message) {\n return error.message;\n }\n\n return t(defaultErrorKey);\n};\n\n/**\n * Check if a response is an error response and extract the error message.\n * This function identifies error responses by checking for ERROR status and failure reasons.\n *\n * @param response - The flow response to check\n * @param t - Translation function for error messages\n * @param defaultErrorKey - Default translation key for generic errors\n * @returns Error message string if response is an error, null otherwise\n */\nexport const checkForErrorResponse = (\n response: any,\n t: UseTranslation['t'],\n defaultErrorKey = 'errors.flow.generic',\n): string | null => {\n if (response?.flowStatus === 'ERROR') {\n return extractErrorMessage(response, t, defaultErrorKey);\n }\n\n return null;\n};\n\n/**\n * Generic flow response normalizer that handles both success and error responses.\n * This is the main transformer function that should be used by all flow components.\n *\n * @param response - The raw flow response from the API\n * @param t - Translation function from useTranslation hook\n * @param options - Configuration options for transformation behavior\n * @returns Normalized flow response with executionId and transformed components\n * @throws {any} The original response if it's an error and throwOnError is true\n */\nexport const normalizeFlowResponse = (\n response: any,\n t: UseTranslation['t'],\n options: FlowTransformOptions = {},\n meta?: FlowMetadataResponse | null,\n): {\n additionalData: Record<string, any>;\n components: EmbeddedFlowComponent[];\n executionId: string;\n} => {\n const {throwOnError = true, defaultErrorKey = 'errors.flow.generic', resolveTranslations = true} = options;\n\n // Check if this is an error response\n const errorMessage: string | null = checkForErrorResponse(response, t, defaultErrorKey);\n\n if (errorMessage && throwOnError) {\n // Throw the original response so it can be caught by error handling\n throw response;\n }\n\n const additionalData: Record<string, any> = (response?.data?.additionalData as Record<string, any>) ?? {};\n\n // The consent prompt is serialized as a JSON string (array) by the backend.\n // Parse it and wrap in the expected {purposes: [...]} structure.\n if (typeof additionalData['consentPrompt'] === 'string') {\n try {\n const parsed: any = JSON.parse(additionalData['consentPrompt']);\n additionalData['consentPrompt'] = {purposes: Array.isArray(parsed) ? parsed : []};\n } catch {\n // Leave unparseable value as-is\n }\n }\n\n return {\n additionalData,\n components: transformComponents(response, t, resolveTranslations, meta),\n executionId: response.executionId,\n };\n};\n"],"mappings":";;;;;;;;;;;AA2EA,MAAM,yBAAyB,aAAuC;CACpE,MAAMA,0BAA+B,IAAI,KAAqB;AAE9D,KAAI,UAAU,MAAM,UAAU,MAAM,QAAQ,SAAS,KAAK,OAAO,CAC/D,UAAS,KAAK,OAAO,SAAS,UAAe;AAC3C,MAAI,MAAM,OAAO,MAAM,WACrB,SAAQ,IAAI,MAAM,KAAK,MAAM,WAAW;GAE1C;AAGJ,QAAO;;;;;;;;;;AAWT,MAAM,0BAA0B,aAAuC;CACrE,MAAMA,0BAA+B,IAAI,KAAqB;AAE9D,KAAI,UAAU,MAAM,WAAW,MAAM,QAAQ,SAAS,KAAK,QAAQ,CACjE,UAAS,KAAK,QAAQ,SAAS,WAAgB;AAC7C,MAAI,OAAO,OAAO,OAAO,SACvB,SAAQ,IAAI,OAAO,KAAK,OAAO,SAAS;GAE1C;AAGJ,QAAO;;;;;;;;;;;;;AAcT,MAAM,wBACJ,YACA,YACA,eACA,aAAoB,EAAE,KAEtB,WAAW,KAAK,cAAqC;CACnD,MAAMC,uBAA4B,EAAC,GAAG,WAAU;AAMhD,KAAI,qBAAqB,OAAO,WAAW,IAAI,qBAAqB,IAAI,CACtE,sBAAqB,MAAM,WAAW,IAAI,qBAAqB,IAAI;AAKrE,KAAI,qBAAqB,SAAS,YAAY,UAAU,IAAI;EAC1D,MAAMC,YAAiB,WAAW,MAAM,UAAe,MAAM,QAAQ,UAAU,GAAG;AAClF,MAAI,WAAW,QACb,sBAAqB,UAAU,UAAU,QAAQ,KAAK,QAAa;AACjE,OAAI,OAAO,QAAQ,SACjB,QAAO;IAAC,OAAO;IAAK,OAAO;IAAI;GAGjC,MAAMC,QAAgB,OAAO,IAAI,UAAU,WAAW,KAAK,UAAU,IAAI,MAAM,GAAG,OAAO,IAAI,SAAS,GAAG;AAGzG,UAAO;IAAC,OAFc,OAAO,IAAI,UAAU,WAAW,KAAK,UAAU,IAAI,MAAM,GAAG,OAAO,IAAI,SAAS,MAAM;IAE7F;IAAM;IACrB;;AAMN,KACE,qBAAqB,SAAS,YAC9B,qBAAqB,MACrB,cAAc,IAAI,qBAAqB,GAAG,CAE1C,sBAAqB,YAAY,cAAc,IAAI,qBAAqB,GAAG;AAI7E,KAAI,qBAAqB,cAAc,MAAM,QAAQ,qBAAqB,WAAW,CACnF,sBAAqB,aAAa,qBAChC,qBAAqB,YACrB,YACA,eACA,WACD;AAGH,QAAO;EACP;;;;;;;;;;;;AAaJ,MAAa,uBACX,UACA,GACA,sBAAsB,MACtB,SAC4B;AAC5B,KAAI,CAAC,UAAU,MAAM,MAAM,WACzB,QAAO,EAAE;CAGX,IAAI,EAAC,eAAc,SAAS,KAAK;CAGjC,MAAMC,aAAkC,sBAAsB,SAAS;CAGvE,MAAMC,gBAAqC,uBAAuB,SAAS;CAG3E,MAAMC,aAAoB,UAAU,MAAM,UAAU,EAAE;AAGtD,KAAI,WAAW,OAAO,KAAK,cAAc,OAAO,KAAK,WAAW,SAAS,EACvE,cAAa,qBAAqB,YAAY,YAAY,eAAe,WAAW;AAGtF,QAAO,sBAAsBC,2CAA2B,YAAY,GAAG,QAAW,KAAK,GAAG;;;;;;;;;;;AAY5F,MAAa,uBACX,OACA,GACA,kBAAkB,0BACP;AACX,KAAI,SAAS,OAAO,UAAU,YAAY,MAAM,OAAO;EACrD,MAAMC,YAAwC,MAAM;AAGpD,MAAI,WAAW,SAAS,KAAK;GAC3B,MAAMC,aAAqB,EAAE,UAAU,QAAQ,IAAI;AACnD,OAAI,cAAc,eAAe,UAAU,QAAQ,IACjD,QAAO;GAIT,MAAM,YAAY,UAAU,UAAU,QAAQ;GAC9C,MAAMC,mBAA2B,EAAE,UAAU;AAC7C,OAAI,oBAAoB,qBAAqB,UAC3C,QAAO;;EAKX,MAAMC,WAA+B,WAAW,SAAS,gBAAgB,WAAW,aAAa;AACjG,MAAI,SACF,QAAO;;AAKX,KAAI,SAAS,OAAO,UAAU,YAAY,MAAM,cAC9C,QAAO,MAAM;AAGf,KAAI,iBAAiB,SAAS,MAAM,QAClC,QAAO,MAAM;AAGf,QAAO,EAAE,gBAAgB;;;;;;;;;;;AAY3B,MAAa,yBACX,UACA,GACA,kBAAkB,0BACA;AAClB,KAAI,UAAU,eAAe,QAC3B,QAAO,oBAAoB,UAAU,GAAG,gBAAgB;AAG1D,QAAO;;;;;;;;;;;;AAaT,MAAa,yBACX,UACA,GACA,UAAgC,EAAE,EAClC,SAKG;CACH,MAAM,EAAC,eAAe,MAAM,kBAAkB,uBAAuB,sBAAsB,SAAQ;AAKnG,KAFoC,sBAAsB,UAAU,GAAG,gBAAgB,IAEnE,aAElB,OAAM;CAGR,MAAMC,iBAAuC,UAAU,MAAM,kBAA0C,EAAE;AAIzG,KAAI,OAAO,eAAe,qBAAqB,SAC7C,KAAI;EACF,MAAMC,SAAc,KAAK,MAAM,eAAe,iBAAiB;AAC/D,iBAAe,mBAAmB,EAAC,UAAU,MAAM,QAAQ,OAAO,GAAG,SAAS,EAAE,EAAC;SAC3E;AAKV,QAAO;EACL;EACA,YAAY,oBAAoB,UAAU,GAAG,qBAAqB,KAAK;EACvE,aAAa,SAAS;EACvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"getAuthComponentHeadings.cjs","names":["heading: EmbeddedFlowComponent | null","subheading: EmbeddedFlowComponent | null","filteredNestedComponents: EmbeddedFlowComponent[]","headingText: string","subheadingText: string"],"sources":["../../../src/utils/getAuthComponentHeadings.ts"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {EmbeddedFlowComponent} from '@thunderid/browser';\n\n/**\n * Result of heading extraction from flow components\n */\nexport interface HeadingExtractionResult {\n heading: EmbeddedFlowComponent | null;\n subheading: EmbeddedFlowComponent | null;\n}\n\n/**\n * Complete result of authentication component heading extraction\n */\nexport interface AuthComponentHeadingsResult {\n componentsWithoutHeadings: EmbeddedFlowComponent[];\n headingComponents: HeadingExtractionResult;\n subtitle: string;\n title: string;\n}\n\n/**\n * Extracts heading and subheading components from authentication flow components\n * and provides resolved title/subtitle text with fallback logic.\n *\n * This utility helps maintain consistent heading extraction across authentication\n * components (SignIn, SignUp, etc.) by identifying heading components within the\n * flow structure and providing clean fallback behavior.\n *\n * @param components - Array of flow components to search\n * @param flowTitle - Title from flow context (highest priority)\n * @param flowSubtitle - Subtitle from flow context (highest priority)\n * @param defaultTitle - Default title fallback (lowest priority)\n * @param defaultSubtitle - Default subtitle fallback (lowest priority)\n * @returns Object with resolved title and subtitle text, plus filtered components\n *\n * @example\n * ```typescript\n * const result = getAuthComponentHeadings(\n * components,\n * flowTitle,\n * flowSubtitle,\n * t('signin.heading'),\n * t('signin.subheading')\n * );\n *\n * // Use resolved titles\n * <Card.Title>{result.title}</Card.Title>\n * <Typography>{result.subtitle}</Typography>\n *\n * // Render filtered components (without headings)\n * renderComponents(result.componentsWithoutHeadings);\n * ```\n */\nconst getAuthComponentHeadings = (\n components: EmbeddedFlowComponent[],\n flowTitle?: string,\n flowSubtitle?: string,\n defaultTitle?: string,\n defaultSubtitle?: string,\n): AuthComponentHeadingsResult => {\n let heading: EmbeddedFlowComponent | null = null;\n let subheading: EmbeddedFlowComponent | null = null;\n\n /**\n * Recursively search for heading components\n */\n const findHeadings = (comps: EmbeddedFlowComponent[]): void => {\n for (const component of comps) {\n if (component.type === 'TEXT' && component.variant?.startsWith('HEADING_')) {\n if (!heading) {\n heading = component;\n } else if (!subheading) {\n subheading = component;\n break; // We found both, no need to continue\n }\n }\n if (component.components && component.components.length > 0) {\n findHeadings(component.components);\n if (heading && subheading) break; // Early exit if both found\n }\n }\n };\n\n /**\n * Filter out heading components from the flow\n */\n const filterComponents = (comps: EmbeddedFlowComponent[]): EmbeddedFlowComponent[] => {\n let foundHeadings = 0;\n const maxHeadings = 2;\n\n const filter = (items: EmbeddedFlowComponent[]): EmbeddedFlowComponent[] =>\n items.reduce((acc: EmbeddedFlowComponent[], component: EmbeddedFlowComponent) => {\n if (foundHeadings < maxHeadings && component.type === 'TEXT' && component.variant?.startsWith('HEADING_')) {\n foundHeadings += 1;\n return acc;\n }\n\n if (component.components && component.components.length > 0) {\n const filteredNestedComponents: EmbeddedFlowComponent[] = filter(component.components);\n if (filteredNestedComponents.length > 0) {\n acc.push({\n ...component,\n components: filteredNestedComponents,\n });\n }\n } else {\n acc.push(component);\n }\n\n return acc;\n }, []);\n\n return filter(comps);\n };\n\n /**\n * Extract text content from a component\n */\n const getComponentText = (component: EmbeddedFlowComponent | null): string => {\n if (!component) return '';\n return component.label || '';\n };\n\n findHeadings(components);\n\n const headingText: string = getComponentText(heading);\n const subheadingText: string = getComponentText(subheading);\n\n const result: AuthComponentHeadingsResult = {\n componentsWithoutHeadings: filterComponents(components),\n headingComponents: {heading, subheading},\n subtitle: flowSubtitle || subheadingText || defaultSubtitle || '',\n title: flowTitle || headingText || defaultTitle || '',\n };\n\n return result;\n};\n\nexport default getAuthComponentHeadings;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,MAAM,4BACJ,YACA,WACA,cACA,cACA,oBACgC;CAChC,IAAIA,UAAwC;CAC5C,IAAIC,aAA2C;;;;CAK/C,MAAM,gBAAgB,UAAyC;AAC7D,OAAK,MAAM,aAAa,OAAO;AAC7B,OAAI,UAAU,SAAS,UAAU,UAAU,SAAS,WAAW,WAAW,EACxE;QAAI,CAAC,QACH,WAAU;aACD,CAAC,YAAY;AACtB,kBAAa;AACb;;;AAGJ,OAAI,UAAU,cAAc,UAAU,WAAW,SAAS,GAAG;AAC3D,iBAAa,UAAU,WAAW;AAClC,QAAI,WAAW,WAAY;;;;;;;CAQjC,MAAM,oBAAoB,UAA4D;EACpF,IAAI,gBAAgB;EACpB,MAAM,cAAc;EAEpB,MAAM,UAAU,UACd,MAAM,QAAQ,KAA8B,cAAqC;AAC/E,OAAI,gBAAgB,eAAe,UAAU,SAAS,UAAU,UAAU,SAAS,WAAW,WAAW,EAAE;AACzG,qBAAiB;AACjB,WAAO;;AAGT,OAAI,UAAU,cAAc,UAAU,WAAW,SAAS,GAAG;IAC3D,MAAMC,2BAAoD,OAAO,UAAU,WAAW;AACtF,QAAI,yBAAyB,SAAS,EACpC,KAAI,KAAK;KACP,GAAG;KACH,YAAY;KACb,CAAC;SAGJ,KAAI,KAAK,UAAU;AAGrB,UAAO;KACN,EAAE,CAAC;AAER,SAAO,OAAO,MAAM;;;;;CAMtB,MAAM,oBAAoB,cAAoD;AAC5E,MAAI,CAAC,UAAW,QAAO;AACvB,SAAO,UAAU,SAAS;;AAG5B,cAAa,WAAW;CAExB,MAAMC,cAAsB,iBAAiB,QAAQ;CACrD,MAAMC,iBAAyB,iBAAiB,WAAW;AAS3D,QAP4C;EAC1C,2BAA2B,iBAAiB,WAAW;EACvD,mBAAmB;GAAC;GAAS;GAAW;EACxC,UAAU,gBAAgB,kBAAkB,mBAAmB;EAC/D,OAAO,aAAa,eAAe,gBAAgB;EACpD;;AAKH,uCAAe"}
1
+ {"version":3,"file":"getAuthComponentHeadings.cjs","names":["heading: EmbeddedFlowComponent | null","subheading: EmbeddedFlowComponent | null","filteredNestedComponents: EmbeddedFlowComponent[]","headingText: string","subheadingText: string"],"sources":["../../../src/utils/getAuthComponentHeadings.ts"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {EmbeddedFlowComponent} from '@thunderid/browser';\n\n/**\n * Result of heading extraction from flow components\n */\nexport interface HeadingExtractionResult {\n heading: EmbeddedFlowComponent | null;\n subheading: EmbeddedFlowComponent | null;\n}\n\n/**\n * Complete result of authentication component heading extraction\n */\nexport interface AuthComponentHeadingsResult {\n componentsWithoutHeadings: EmbeddedFlowComponent[];\n headingComponents: HeadingExtractionResult;\n subtitle: string;\n title: string;\n}\n\n/**\n * Extracts heading and subheading components from authentication flow components\n * and provides resolved title/subtitle text with fallback logic.\n *\n * This utility helps maintain consistent heading extraction across authentication\n * components (SignIn, SignUp, etc.) by identifying heading components within the\n * flow structure and providing clean fallback behavior.\n *\n * @param components - Array of flow components to search\n * @param flowTitle - Title from flow context (highest priority)\n * @param flowSubtitle - Subtitle from flow context (highest priority)\n * @param defaultTitle - Default title fallback (lowest priority)\n * @param defaultSubtitle - Default subtitle fallback (lowest priority)\n * @returns Object with resolved title and subtitle text, plus filtered components\n *\n * @example\n * ```typescript\n * const result = getAuthComponentHeadings(\n * components,\n * flowTitle,\n * flowSubtitle,\n * t('signin.heading'),\n * t('signin.subheading')\n * );\n *\n * // Use resolved titles\n * <Card.Title>{result.title}</Card.Title>\n * <Typography>{result.subtitle}</Typography>\n *\n * // Render filtered components (without headings)\n * renderComponents(result.componentsWithoutHeadings);\n * ```\n */\nconst getAuthComponentHeadings = (\n components: EmbeddedFlowComponent[],\n flowTitle?: string,\n flowSubtitle?: string,\n defaultTitle?: string,\n defaultSubtitle?: string,\n): AuthComponentHeadingsResult => {\n let heading: EmbeddedFlowComponent | null = null;\n let subheading: EmbeddedFlowComponent | null = null;\n\n /**\n * Recursively search for heading components\n */\n const findHeadings = (comps: EmbeddedFlowComponent[]): void => {\n for (const component of comps) {\n if (component.type === 'TEXT' && component.variant?.startsWith('HEADING_')) {\n if (!heading) {\n heading = component;\n } else if (!subheading) {\n subheading = component;\n break; // We found both, no need to continue\n }\n }\n if (component.components && component.components.length > 0) {\n findHeadings(component.components);\n if (heading && subheading) break; // Early exit if both found\n }\n }\n };\n\n /**\n * Filter out heading components from the flow\n */\n const filterComponents = (comps: EmbeddedFlowComponent[]): EmbeddedFlowComponent[] => {\n let foundHeadings = 0;\n const maxHeadings = 2;\n\n const filter = (items: EmbeddedFlowComponent[]): EmbeddedFlowComponent[] =>\n items.reduce((acc: EmbeddedFlowComponent[], component: EmbeddedFlowComponent) => {\n if (foundHeadings < maxHeadings && component.type === 'TEXT' && component.variant?.startsWith('HEADING_')) {\n foundHeadings += 1;\n return acc;\n }\n\n if (component.components && component.components.length > 0) {\n const filteredNestedComponents: EmbeddedFlowComponent[] = filter(component.components);\n if (filteredNestedComponents.length > 0) {\n acc.push({\n ...component,\n components: filteredNestedComponents,\n });\n }\n } else {\n acc.push(component);\n }\n\n return acc;\n }, []);\n\n return filter(comps);\n };\n\n /**\n * Extract text content from a component\n */\n const getComponentText = (component: EmbeddedFlowComponent | null): string => {\n if (!component) return '';\n return component.label || '';\n };\n\n findHeadings(components);\n\n const headingText: string = getComponentText(heading);\n const subheadingText: string = getComponentText(subheading);\n\n const result: AuthComponentHeadingsResult = {\n componentsWithoutHeadings: filterComponents(components),\n headingComponents: {heading, subheading},\n subtitle: flowSubtitle || subheadingText || defaultSubtitle || '',\n title: flowTitle || headingText || defaultTitle || '',\n };\n\n return result;\n};\n\nexport default getAuthComponentHeadings;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDA,MAAM,4BACJ,YACA,WACA,cACA,cACA,oBACgC;CAChC,IAAIA,UAAwC;CAC5C,IAAIC,aAA2C;;;;CAK/C,MAAM,gBAAgB,UAAyC;AAC7D,OAAK,MAAM,aAAa,OAAO;AAC7B,OAAI,UAAU,SAAS,UAAU,UAAU,SAAS,WAAW,WAAW,EACxE;QAAI,CAAC,QACH,WAAU;aACD,CAAC,YAAY;AACtB,kBAAa;AACb;;;AAGJ,OAAI,UAAU,cAAc,UAAU,WAAW,SAAS,GAAG;AAC3D,iBAAa,UAAU,WAAW;AAClC,QAAI,WAAW,WAAY;;;;;;;CAQjC,MAAM,oBAAoB,UAA4D;EACpF,IAAI,gBAAgB;EACpB,MAAM,cAAc;EAEpB,MAAM,UAAU,UACd,MAAM,QAAQ,KAA8B,cAAqC;AAC/E,OAAI,gBAAgB,eAAe,UAAU,SAAS,UAAU,UAAU,SAAS,WAAW,WAAW,EAAE;AACzG,qBAAiB;AACjB,WAAO;;AAGT,OAAI,UAAU,cAAc,UAAU,WAAW,SAAS,GAAG;IAC3D,MAAMC,2BAAoD,OAAO,UAAU,WAAW;AACtF,QAAI,yBAAyB,SAAS,EACpC,KAAI,KAAK;KACP,GAAG;KACH,YAAY;KACb,CAAC;SAGJ,KAAI,KAAK,UAAU;AAGrB,UAAO;KACN,EAAE,CAAC;AAER,SAAO,OAAO,MAAM;;;;;CAMtB,MAAM,oBAAoB,cAAoD;AAC5E,MAAI,CAAC,UAAW,QAAO;AACvB,SAAO,UAAU,SAAS;;AAG5B,cAAa,WAAW;CAExB,MAAMC,cAAsB,iBAAiB,QAAQ;CACrD,MAAMC,iBAAyB,iBAAiB,WAAW;AAS3D,QAP4C;EAC1C,2BAA2B,iBAAiB,WAAW;EACvD,mBAAmB;GAAC;GAAS;GAAW;EACxC,UAAU,gBAAgB,kBAAkB,mBAAmB;EAC/D,OAAO,aAAa,eAAe,gBAAgB;EACpD;;AAKH,uCAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"getDisplayName.cjs","names":["mappings: Record<string, string | string[]>","foundValue: string | undefined","value: any","getMappedUserProfileValue","firstName: any","lastName: any"],"sources":["../../../src/utils/getDisplayName.ts"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {User} from '@thunderid/browser';\nimport getMappedUserProfileValue from './getMappedUserProfileValue';\n\n/**\n * Get the display name of a user by mapping their profile attributes.\n *\n * @param mergedMappings - The merged attribute mappings.\n * @param user - The user object containing profile information.\n * @param displayAttributes - Optional array of attribute keys or paths to try first.\n * Each entry is resolved via `getMappedUserProfileValue`. The first non-empty\n * value found is returned. If none resolve, the default fallback chain is used.\n *\n * @example\n * ```ts\n * // Default behavior — tries firstName+lastName, then username, email, name\n * const displayName = getDisplayName(mergedMappings, user);\n *\n * // Custom attributes — try 'nickname' first, then fall back to defaults\n * const displayName = getDisplayName(mergedMappings, user, ['nickname']);\n *\n * // Multiple custom attributes\n * const displayName = getDisplayName(mergedMappings, user, ['preferred_username', 'nickname']);\n * ```\n *\n * @returns The display name of the user.\n */\nconst getDisplayName = (\n mergedMappings: Record<string, string | string[] | undefined>,\n user: User,\n displayAttributes?: string[],\n): string => {\n const mappings: Record<string, string | string[]> = mergedMappings as Record<string, string | string[]>;\n if (displayAttributes && displayAttributes.length > 0) {\n let foundValue: string | undefined;\n displayAttributes.some((attr: string) => {\n const value: any = getMappedUserProfileValue(attr, mappings, user);\n\n if (value !== undefined && value !== null && value !== '') {\n foundValue = String(value);\n return true;\n }\n return false;\n });\n if (foundValue !== undefined) {\n return foundValue;\n }\n }\n\n const firstName: any = getMappedUserProfileValue('firstName', mappings, user);\n const lastName: any = getMappedUserProfileValue('lastName', mappings, user);\n\n if (firstName && lastName) {\n return `${firstName} ${lastName}`;\n }\n\n return (\n getMappedUserProfileValue('username', mappings, user) ||\n getMappedUserProfileValue('email', mappings, user) ||\n getMappedUserProfileValue('name', mappings, user) ||\n 'User'\n );\n};\n\nexport default getDisplayName;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,MAAM,kBACJ,gBACA,MACA,sBACW;CACX,MAAMA,WAA8C;AACpD,KAAI,qBAAqB,kBAAkB,SAAS,GAAG;EACrD,IAAIC;AACJ,oBAAkB,MAAM,SAAiB;GACvC,MAAMC,QAAaC,0CAA0B,MAAM,UAAU,KAAK;AAElE,OAAI,UAAU,UAAa,UAAU,QAAQ,UAAU,IAAI;AACzD,iBAAa,OAAO,MAAM;AAC1B,WAAO;;AAET,UAAO;IACP;AACF,MAAI,eAAe,OACjB,QAAO;;CAIX,MAAMC,YAAiBD,0CAA0B,aAAa,UAAU,KAAK;CAC7E,MAAME,WAAgBF,0CAA0B,YAAY,UAAU,KAAK;AAE3E,KAAI,aAAa,SACf,QAAO,GAAG,UAAU,GAAG;AAGzB,QACEA,0CAA0B,YAAY,UAAU,KAAK,IACrDA,0CAA0B,SAAS,UAAU,KAAK,IAClDA,0CAA0B,QAAQ,UAAU,KAAK,IACjD;;AAIJ,6BAAe"}
1
+ {"version":3,"file":"getDisplayName.cjs","names":["mappings: Record<string, string | string[]>","foundValue: string | undefined","value: any","getMappedUserProfileValue","firstName: any","lastName: any"],"sources":["../../../src/utils/getDisplayName.ts"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {User} from '@thunderid/browser';\nimport getMappedUserProfileValue from './getMappedUserProfileValue';\n\n/**\n * Get the display name of a user by mapping their profile attributes.\n *\n * @param mergedMappings - The merged attribute mappings.\n * @param user - The user object containing profile information.\n * @param displayAttributes - Optional array of attribute keys or paths to try first.\n * Each entry is resolved via `getMappedUserProfileValue`. The first non-empty\n * value found is returned. If none resolve, the default fallback chain is used.\n *\n * @example\n * ```ts\n * // Default behavior — tries firstName+lastName, then username, email, name\n * const displayName = getDisplayName(mergedMappings, user);\n *\n * // Custom attributes — try 'nickname' first, then fall back to defaults\n * const displayName = getDisplayName(mergedMappings, user, ['nickname']);\n *\n * // Multiple custom attributes\n * const displayName = getDisplayName(mergedMappings, user, ['preferred_username', 'nickname']);\n * ```\n *\n * @returns The display name of the user.\n */\nconst getDisplayName = (\n mergedMappings: Record<string, string | string[] | undefined>,\n user: User,\n displayAttributes?: string[],\n): string => {\n const mappings: Record<string, string | string[]> = mergedMappings as Record<string, string | string[]>;\n if (displayAttributes && displayAttributes.length > 0) {\n let foundValue: string | undefined;\n displayAttributes.some((attr: string) => {\n const value: any = getMappedUserProfileValue(attr, mappings, user);\n\n if (value !== undefined && value !== null && value !== '') {\n foundValue = String(value);\n return true;\n }\n return false;\n });\n if (foundValue !== undefined) {\n return foundValue;\n }\n }\n\n const firstName: any = getMappedUserProfileValue('firstName', mappings, user);\n const lastName: any = getMappedUserProfileValue('lastName', mappings, user);\n\n if (firstName && lastName) {\n return `${firstName} ${lastName}`;\n }\n\n return (\n getMappedUserProfileValue('username', mappings, user) ||\n getMappedUserProfileValue('email', mappings, user) ||\n getMappedUserProfileValue('name', mappings, user) ||\n 'User'\n );\n};\n\nexport default getDisplayName;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,kBACJ,gBACA,MACA,sBACW;CACX,MAAMA,WAA8C;AACpD,KAAI,qBAAqB,kBAAkB,SAAS,GAAG;EACrD,IAAIC;AACJ,oBAAkB,MAAM,SAAiB;GACvC,MAAMC,QAAaC,0CAA0B,MAAM,UAAU,KAAK;AAElE,OAAI,UAAU,UAAa,UAAU,QAAQ,UAAU,IAAI;AACzD,iBAAa,OAAO,MAAM;AAC1B,WAAO;;AAET,UAAO;IACP;AACF,MAAI,eAAe,OACjB,QAAO;;CAIX,MAAMC,YAAiBD,0CAA0B,aAAa,UAAU,KAAK;CAC7E,MAAME,WAAgBF,0CAA0B,YAAY,UAAU,KAAK;AAE3E,KAAI,aAAa,SACf,QAAO,GAAG,UAAU,GAAG;AAGzB,QACEA,0CAA0B,YAAY,UAAU,KAAK,IACrDA,0CAA0B,SAAS,UAAU,KAAK,IAClDA,0CAA0B,QAAQ,UAAU,KAAK,IACjD;;AAIJ,6BAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"getMappedUserProfileValue.cjs","names":["mapping: string | string[]","foundValue: any","value: any"],"sources":["../../../src/utils/getMappedUserProfileValue.ts"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {User, get} from '@thunderid/browser';\n\n/**\n * Retrieves a user profile value based on attribute mapping configuration.\n *\n * This function allows flexible mapping of component attribute names to actual\n * user profile field paths. It supports both simple string mappings and arrays\n * of potential field paths for fallback scenarios.\n *\n * @param key - The logical attribute name to retrieve (e.g., 'firstName', 'email')\n * @param mappings - Object mapping logical names to user profile field paths\n * @param user - The user object to extract values from\n * @returns The mapped value from the user profile, or undefined if not found\n *\n * @example\n * ```typescript\n * const mappings = {\n * firstName: 'name.givenName',\n * email: 'emails[0]',\n * picture: ['profileUrl', 'profile', 'avatar'] // fallback options\n * };\n *\n * const user = {\n * name: { givenName: 'John' },\n * emails: ['john@example.com'],\n * profileUrl: 'https://example.com/avatar.jpg'\n * };\n *\n * getMappedUserProfileValue('firstName', mappings, user); // 'John'\n * getMappedUserProfileValue('email', mappings, user); // 'john@example.com'\n * getMappedUserProfileValue('picture', mappings, user); // 'https://example.com/avatar.jpg'\n * ```\n */\nconst getMappedUserProfileValue = (key: string, mappings: Record<string, string | string[]>, user: User): any => {\n if (!key || !mappings || !user) {\n return undefined;\n }\n\n const mapping: string | string[] = mappings[key];\n\n if (!mapping) {\n // If no mapping defined, try to get the value directly from the user object\n return get(user, key);\n }\n\n // If mapping is an array, try each path until we find a value\n if (Array.isArray(mapping)) {\n let foundValue: any;\n let found = false;\n mapping.some((path: string) => {\n const value: any = get(user, path);\n if (value !== undefined && value !== null && value !== '') {\n foundValue = value;\n found = true;\n return true;\n }\n return false;\n });\n return found ? foundValue : undefined;\n }\n\n // For single string mapping, get the value directly\n return get(user, mapping);\n};\n\nexport default getMappedUserProfileValue;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDA,MAAM,6BAA6B,KAAa,UAA6C,SAAoB;AAC/G,KAAI,CAAC,OAAO,CAAC,YAAY,CAAC,KACxB;CAGF,MAAMA,UAA6B,SAAS;AAE5C,KAAI,CAAC,QAEH,qCAAW,MAAM,IAAI;AAIvB,KAAI,MAAM,QAAQ,QAAQ,EAAE;EAC1B,IAAIC;EACJ,IAAI,QAAQ;AACZ,UAAQ,MAAM,SAAiB;GAC7B,MAAMC,qCAAiB,MAAM,KAAK;AAClC,OAAI,UAAU,UAAa,UAAU,QAAQ,UAAU,IAAI;AACzD,iBAAa;AACb,YAAQ;AACR,WAAO;;AAET,UAAO;IACP;AACF,SAAO,QAAQ,aAAa;;AAI9B,qCAAW,MAAM,QAAQ;;AAG3B,wCAAe"}
1
+ {"version":3,"file":"getMappedUserProfileValue.cjs","names":["mapping: string | string[]","foundValue: any","value: any"],"sources":["../../../src/utils/getMappedUserProfileValue.ts"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {User, get} from '@thunderid/browser';\n\n/**\n * Retrieves a user profile value based on attribute mapping configuration.\n *\n * This function allows flexible mapping of component attribute names to actual\n * user profile field paths. It supports both simple string mappings and arrays\n * of potential field paths for fallback scenarios.\n *\n * @param key - The logical attribute name to retrieve (e.g., 'firstName', 'email')\n * @param mappings - Object mapping logical names to user profile field paths\n * @param user - The user object to extract values from\n * @returns The mapped value from the user profile, or undefined if not found\n *\n * @example\n * ```typescript\n * const mappings = {\n * firstName: 'name.givenName',\n * email: 'emails[0]',\n * picture: ['profileUrl', 'profile', 'avatar'] // fallback options\n * };\n *\n * const user = {\n * name: { givenName: 'John' },\n * emails: ['john@example.com'],\n * profileUrl: 'https://example.com/avatar.jpg'\n * };\n *\n * getMappedUserProfileValue('firstName', mappings, user); // 'John'\n * getMappedUserProfileValue('email', mappings, user); // 'john@example.com'\n * getMappedUserProfileValue('picture', mappings, user); // 'https://example.com/avatar.jpg'\n * ```\n */\nconst getMappedUserProfileValue = (key: string, mappings: Record<string, string | string[]>, user: User): any => {\n if (!key || !mappings || !user) {\n return undefined;\n }\n\n const mapping: string | string[] = mappings[key];\n\n if (!mapping) {\n // If no mapping defined, try to get the value directly from the user object\n return get(user, key);\n }\n\n // If mapping is an array, try each path until we find a value\n if (Array.isArray(mapping)) {\n let foundValue: any;\n let found = false;\n mapping.some((path: string) => {\n const value: any = get(user, path);\n if (value !== undefined && value !== null && value !== '') {\n foundValue = value;\n found = true;\n return true;\n }\n return false;\n });\n return found ? foundValue : undefined;\n }\n\n // For single string mapping, get the value directly\n return get(user, mapping);\n};\n\nexport default getMappedUserProfileValue;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAM,6BAA6B,KAAa,UAA6C,SAAoB;AAC/G,KAAI,CAAC,OAAO,CAAC,YAAY,CAAC,KACxB;CAGF,MAAMA,UAA6B,SAAS;AAE5C,KAAI,CAAC,QAEH,qCAAW,MAAM,IAAI;AAIvB,KAAI,MAAM,QAAQ,QAAQ,EAAE;EAC1B,IAAIC;EACJ,IAAI,QAAQ;AACZ,UAAQ,MAAM,SAAiB;GAC7B,MAAMC,qCAAiB,MAAM,KAAK;AAClC,OAAI,UAAU,UAAa,UAAU,QAAQ,UAAU,IAAI;AACzD,iBAAa;AACb,YAAQ;AACR,WAAO;;AAET,UAAO;IACP;AACF,SAAO,QAAQ,aAAa;;AAI9B,qCAAW,MAAM,QAAQ;;AAG3B,wCAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"normalizeThemeConfig.cjs","names":[],"sources":["../../../src/utils/normalizeThemeConfig.ts"],"sourcesContent":["/**\n * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {RecursivePartial, ThemeConfig} from '@thunderid/browser';\n\ninterface ColorWithMain {\n [key: string]: unknown;\n main: string;\n}\n\n/**\n * Normalizes a single color value that may have been supplied as a shorthand\n * CSS color string (`'#2563eb'`) instead of the expected object form\n * (`{ main: '#2563eb' }`).\n *\n * This makes the `preferences.theme.overrides.colors.*` API forgiving for\n * JavaScript callers who don't have TypeScript's type-checker to catch the\n * mismatch at compile time.\n */\nconst normalizeColorValue = (color: string | ColorWithMain): ColorWithMain =>\n typeof color === 'string' ? {main: color} : color;\n\n/**\n * Normalizes a `RecursivePartial<ThemeConfig>` so that color fields which are\n * supplied as plain CSS color strings are coerced into `{ main: string }`\n * objects before being handed to `createTheme`.\n *\n * Only the color groups that `toCssVariables` in `createTheme` actually reads\n * individual sub-keys from are normalized here (`primary`, `secondary`,\n * `error`, `success`, `warning`, `info`). `border` is left alone because it\n * IS a plain string in `ThemeConfig`.\n */\nconst normalizeThemeConfig = (\n config: RecursivePartial<ThemeConfig> | undefined,\n): RecursivePartial<ThemeConfig> | undefined => {\n if (!config?.colors) {\n return config;\n }\n\n const {primary, secondary, error, success, warning, info, ...restColors} = config.colors as any;\n\n return {\n ...config,\n colors: {\n ...restColors,\n ...(primary !== undefined ? {primary: normalizeColorValue(primary)} : {}),\n ...(secondary !== undefined ? {secondary: normalizeColorValue(secondary)} : {}),\n ...(error !== undefined ? {error: normalizeColorValue(error)} : {}),\n ...(success !== undefined ? {success: normalizeColorValue(success)} : {}),\n ...(warning !== undefined ? {warning: normalizeColorValue(warning)} : {}),\n ...(info !== undefined ? {info: normalizeColorValue(info)} : {}),\n },\n };\n};\n\nexport default normalizeThemeConfig;\n"],"mappings":";;;;;;;;;;;AAkCA,MAAM,uBAAuB,UAC3B,OAAO,UAAU,WAAW,EAAC,MAAM,OAAM,GAAG;;;;;;;;;;;AAY9C,MAAM,wBACJ,WAC8C;AAC9C,KAAI,CAAC,QAAQ,OACX,QAAO;CAGT,MAAM,EAAC,SAAS,WAAW,OAAO,SAAS,SAAS,KAAM,GAAG,eAAc,OAAO;AAElF,QAAO;EACL,GAAG;EACH,QAAQ;GACN,GAAG;GACH,GAAI,YAAY,SAAY,EAAC,SAAS,oBAAoB,QAAQ,EAAC,GAAG,EAAE;GACxE,GAAI,cAAc,SAAY,EAAC,WAAW,oBAAoB,UAAU,EAAC,GAAG,EAAE;GAC9E,GAAI,UAAU,SAAY,EAAC,OAAO,oBAAoB,MAAM,EAAC,GAAG,EAAE;GAClE,GAAI,YAAY,SAAY,EAAC,SAAS,oBAAoB,QAAQ,EAAC,GAAG,EAAE;GACxE,GAAI,YAAY,SAAY,EAAC,SAAS,oBAAoB,QAAQ,EAAC,GAAG,EAAE;GACxE,GAAI,SAAS,SAAY,EAAC,MAAM,oBAAoB,KAAK,EAAC,GAAG,EAAE;GAChE;EACF;;AAGH,mCAAe"}
1
+ {"version":3,"file":"normalizeThemeConfig.cjs","names":[],"sources":["../../../src/utils/normalizeThemeConfig.ts"],"sourcesContent":["// Copyright 2026 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {RecursivePartial, ThemeConfig} from '@thunderid/browser';\n\ninterface ColorWithMain {\n [key: string]: unknown;\n main: string;\n}\n\n/**\n * Normalizes a single color value that may have been supplied as a shorthand\n * CSS color string (`'#2563eb'`) instead of the expected object form\n * (`{ main: '#2563eb' }`).\n *\n * This makes the `preferences.theme.overrides.colors.*` API forgiving for\n * JavaScript callers who don't have TypeScript's type-checker to catch the\n * mismatch at compile time.\n */\nconst normalizeColorValue = (color: string | ColorWithMain): ColorWithMain =>\n typeof color === 'string' ? {main: color} : color;\n\n/**\n * Normalizes a `RecursivePartial<ThemeConfig>` so that color fields which are\n * supplied as plain CSS color strings are coerced into `{ main: string }`\n * objects before being handed to `createTheme`.\n *\n * Only the color groups that `toCssVariables` in `createTheme` actually reads\n * individual sub-keys from are normalized here (`primary`, `secondary`,\n * `error`, `success`, `warning`, `info`). `border` is left alone because it\n * IS a plain string in `ThemeConfig`.\n */\nconst normalizeThemeConfig = (\n config: RecursivePartial<ThemeConfig> | undefined,\n): RecursivePartial<ThemeConfig> | undefined => {\n if (!config?.colors) {\n return config;\n }\n\n const {primary, secondary, error, success, warning, info, ...restColors} = config.colors as any;\n\n return {\n ...config,\n colors: {\n ...restColors,\n ...(primary !== undefined ? {primary: normalizeColorValue(primary)} : {}),\n ...(secondary !== undefined ? {secondary: normalizeColorValue(secondary)} : {}),\n ...(error !== undefined ? {error: normalizeColorValue(error)} : {}),\n ...(success !== undefined ? {success: normalizeColorValue(success)} : {}),\n ...(warning !== undefined ? {warning: normalizeColorValue(warning)} : {}),\n ...(info !== undefined ? {info: normalizeColorValue(info)} : {}),\n },\n };\n};\n\nexport default normalizeThemeConfig;\n"],"mappings":";;;;;;;;;;;AAmBA,MAAM,uBAAuB,UAC3B,OAAO,UAAU,WAAW,EAAC,MAAM,OAAM,GAAG;;;;;;;;;;;AAY9C,MAAM,wBACJ,WAC8C;AAC9C,KAAI,CAAC,QAAQ,OACX,QAAO;CAGT,MAAM,EAAC,SAAS,WAAW,OAAO,SAAS,SAAS,KAAM,GAAG,eAAc,OAAO;AAElF,QAAO;EACL,GAAG;EACH,QAAQ;GACN,GAAG;GACH,GAAI,YAAY,SAAY,EAAC,SAAS,oBAAoB,QAAQ,EAAC,GAAG,EAAE;GACxE,GAAI,cAAc,SAAY,EAAC,WAAW,oBAAoB,UAAU,EAAC,GAAG,EAAE;GAC9E,GAAI,UAAU,SAAY,EAAC,OAAO,oBAAoB,MAAM,EAAC,GAAG,EAAE;GAClE,GAAI,YAAY,SAAY,EAAC,SAAS,oBAAoB,QAAQ,EAAC,GAAG,EAAE;GACxE,GAAI,YAAY,SAAY,EAAC,SAAS,oBAAoB,QAAQ,EAAC,GAAG,EAAE;GACxE,GAAI,SAAS,SAAY,EAAC,MAAM,oBAAoB,KAAK,EAAC,GAAG,EAAE;GAChE;EACF;;AAGH,mCAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"oauth.cjs","names":["basePath: string","returnPath: string","state: string","redirectUrlObj: URL"],"sources":["../../../src/utils/oauth.ts"],"sourcesContent":["/**\n * Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {navigate, getVendorPrefix} from '@thunderid/browser';\n\n/**\n * Initiates OAuth redirect with CSRF protection.\n * Generates random state, stores return path in sessionStorage, and redirects to OAuth provider.\n *\n * @param redirectURL - OAuth authorization URL from the server\n * @param vendor - Vendor/brand namespace used to prefix the sessionStorage key. Defaults to `'thunderid'`.\n */\nexport function initiateOAuthRedirect(redirectURL: string, vendor?: string): void {\n const basePath: string = document.querySelector('base')?.getAttribute('href') || '';\n let returnPath: string = window.location.pathname;\n\n if (basePath && returnPath.startsWith(basePath)) {\n returnPath = returnPath.slice(basePath.length) || '/';\n }\n\n const state: string = crypto.randomUUID();\n\n sessionStorage.setItem(\n `${getVendorPrefix(vendor)}_oauth_${state}`,\n JSON.stringify({\n path: returnPath,\n timestamp: Date.now(),\n }),\n );\n\n const redirectUrlObj: URL = new URL(redirectURL);\n redirectUrlObj.searchParams.set('state', state);\n\n navigate(redirectUrlObj.toString());\n}\n"],"mappings":";;;;;;;;;;;;AA2BA,SAAgB,sBAAsB,aAAqB,QAAuB;CAChF,MAAMA,WAAmB,SAAS,cAAc,OAAO,EAAE,aAAa,OAAO,IAAI;CACjF,IAAIC,aAAqB,OAAO,SAAS;AAEzC,KAAI,YAAY,WAAW,WAAW,SAAS,CAC7C,cAAa,WAAW,MAAM,SAAS,OAAO,IAAI;CAGpD,MAAMC,QAAgB,OAAO,YAAY;AAEzC,gBAAe,QACb,4CAAmB,OAAO,CAAC,SAAS,SACpC,KAAK,UAAU;EACb,MAAM;EACN,WAAW,KAAK,KAAK;EACtB,CAAC,CACH;CAED,MAAMC,iBAAsB,IAAI,IAAI,YAAY;AAChD,gBAAe,aAAa,IAAI,SAAS,MAAM;AAE/C,mCAAS,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"oauth.cjs","names":["basePath: string","returnPath: string","state: string","redirectUrlObj: URL"],"sources":["../../../src/utils/oauth.ts"],"sourcesContent":["// Copyright 2026 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {navigate, getVendorPrefix} from '@thunderid/browser';\n\n/**\n * Initiates OAuth redirect with CSRF protection.\n * Generates random state, stores return path in sessionStorage, and redirects to OAuth provider.\n *\n * @param redirectURL - OAuth authorization URL from the server\n * @param vendor - Vendor/brand namespace used to prefix the sessionStorage key. Defaults to `'thunderid'`.\n */\nexport function initiateOAuthRedirect(redirectURL: string, vendor?: string): void {\n const basePath: string = document.querySelector('base')?.getAttribute('href') || '';\n let returnPath: string = window.location.pathname;\n\n if (basePath && returnPath.startsWith(basePath)) {\n returnPath = returnPath.slice(basePath.length) || '/';\n }\n\n const state: string = crypto.randomUUID();\n\n sessionStorage.setItem(\n `${getVendorPrefix(vendor)}_oauth_${state}`,\n JSON.stringify({\n path: returnPath,\n timestamp: Date.now(),\n }),\n );\n\n const redirectUrlObj: URL = new URL(redirectURL);\n redirectUrlObj.searchParams.set('state', state);\n\n navigate(redirectUrlObj.toString());\n}\n"],"mappings":";;;;;;;;;;;;AAYA,SAAgB,sBAAsB,aAAqB,QAAuB;CAChF,MAAMA,WAAmB,SAAS,cAAc,OAAO,EAAE,aAAa,OAAO,IAAI;CACjF,IAAIC,aAAqB,OAAO,SAAS;AAEzC,KAAI,YAAY,WAAW,WAAW,SAAS,CAC7C,cAAa,WAAW,MAAM,SAAS,OAAO,IAAI;CAGpD,MAAMC,QAAgB,OAAO,YAAY;AAEzC,gBAAe,QACb,4CAAmB,OAAO,CAAC,SAAS,SACpC,KAAK,UAAU;EACb,MAAM;EACN,WAAW,KAAK,KAAK;EACtB,CAAC,CACH;CAED,MAAMC,iBAAsB,IAAI,IAAI,YAAY;AAChD,gBAAe,aAAa,IAAI,SAAS,MAAM;AAE/C,mCAAS,eAAe,UAAU,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"passkey.cjs","names":["ThunderIDRuntimeError","creationOptions: any","publicKey: any","credential: PublicKeyCredential","response: AuthenticatorAttestationResponse","registrationResponse: any","requestOptions: any","response: AuthenticatorAssertionResponse","authenticationResponse: any"],"sources":["../../../src/utils/passkey.ts"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {ThunderIDRuntimeError, arrayBufferToBase64url, base64urlToArrayBuffer} from '@thunderid/browser';\n\n/**\n * Handles WebAuthn/Passkey registration flow for browser environments.\n *\n * @param challengeData - JSON stringified challenge data containing WebAuthn creation options.\n * @returns Promise that resolves to a JSON string containing the WebAuthn registration response.\n */\nexport const handlePasskeyRegistration = async (challengeData: string): Promise<string> => {\n if (!window.navigator.credentials?.create) {\n throw new ThunderIDRuntimeError(\n 'WebAuthn is not supported in this browser.',\n 'browser-webauthn-not-supported',\n 'browser',\n 'WebAuthn/Passkey registration requires a browser that supports the Web Authentication API.',\n );\n }\n\n try {\n const creationOptions: any = JSON.parse(challengeData);\n\n // Decode challenge and user ID from base64url to BufferSource\n const publicKey: any = {\n ...creationOptions,\n challenge: base64urlToArrayBuffer(creationOptions.challenge),\n user: {\n ...creationOptions.user,\n id: base64urlToArrayBuffer(creationOptions.user.id),\n },\n ...(creationOptions.excludeCredentials && {\n excludeCredentials: creationOptions.excludeCredentials.map((cred: any) => ({\n ...cred,\n id: base64urlToArrayBuffer(cred.id),\n })),\n }),\n };\n\n const credential: PublicKeyCredential = (await navigator.credentials.create({\n publicKey,\n })) as PublicKeyCredential;\n\n if (!credential) {\n throw new ThunderIDRuntimeError(\n 'No credential returned from WebAuthn registration.',\n 'browser-webauthn-no-credential',\n 'browser',\n 'The WebAuthn registration ceremony completed but did not return a valid credential.',\n );\n }\n\n const response: AuthenticatorAttestationResponse = credential.response as AuthenticatorAttestationResponse;\n\n // Encode response fields back to base64url\n const registrationResponse: any = {\n id: credential.id,\n rawId: arrayBufferToBase64url(credential.rawId),\n response: {\n attestationObject: arrayBufferToBase64url(response.attestationObject),\n clientDataJSON: arrayBufferToBase64url(response.clientDataJSON),\n ...(response.getTransports && {\n transports: response.getTransports(),\n }),\n },\n type: credential.type,\n ...(credential.authenticatorAttachment && {\n authenticatorAttachment: credential.authenticatorAttachment,\n }),\n };\n\n return JSON.stringify(registrationResponse);\n } catch (error) {\n if (error instanceof ThunderIDRuntimeError) {\n throw error;\n }\n\n if (error instanceof Error) {\n // Map specific WebAuthn errors to ThunderIDRuntimeError/friendly messages as needed\n throw new ThunderIDRuntimeError(\n 'Passkey registration failed. Please try again.',\n 'browser-webauthn-registration-error',\n 'browser',\n `WebAuthn registration failed with error: ${error.name}: ${error.message}`,\n );\n }\n\n throw new ThunderIDRuntimeError(\n 'Passkey registration failed due to an unexpected error.',\n 'browser-webauthn-unexpected-error',\n 'browser',\n 'An unexpected error occurred during WebAuthn registration.',\n );\n }\n};\n\n/**\n * Handles WebAuthn/Passkey authentication flow for browser environments.\n *\n * @param challengeData - JSON stringified challenge data containing WebAuthn request options.\n * @returns Promise that resolves to a JSON string containing the WebAuthn authentication response.\n */\nexport const handlePasskeyAuthentication = async (challengeData: string): Promise<string> => {\n if (!window.navigator.credentials?.get) {\n throw new ThunderIDRuntimeError(\n 'WebAuthn is not supported in this browser.',\n 'browser-webauthn-not-supported',\n 'browser',\n 'WebAuthn/Passkey authentication requires a browser that supports the Web Authentication API.',\n );\n }\n\n try {\n const requestOptions: any = JSON.parse(challengeData);\n\n // Decode challenge and allowed credentials from base64url to BufferSource\n const publicKey: any = {\n ...requestOptions,\n challenge: base64urlToArrayBuffer(requestOptions.challenge),\n ...(requestOptions.allowCredentials && {\n allowCredentials: requestOptions.allowCredentials.map((cred: any) => ({\n ...cred,\n id: base64urlToArrayBuffer(cred.id),\n })),\n }),\n };\n\n const credential: PublicKeyCredential = (await navigator.credentials.get({\n publicKey,\n })) as PublicKeyCredential;\n\n if (!credential) {\n throw new ThunderIDRuntimeError(\n 'No credential returned from WebAuthn authentication.',\n 'browser-webauthn-no-credential',\n 'browser',\n 'The WebAuthn authentication ceremony completed but did not return a valid credential.',\n );\n }\n\n const response: AuthenticatorAssertionResponse = credential.response as AuthenticatorAssertionResponse;\n\n // Encode response fields back to base64url\n const authenticationResponse: any = {\n id: credential.id,\n rawId: arrayBufferToBase64url(credential.rawId),\n response: {\n authenticatorData: arrayBufferToBase64url(response.authenticatorData),\n clientDataJSON: arrayBufferToBase64url(response.clientDataJSON),\n signature: arrayBufferToBase64url(response.signature),\n ...(response.userHandle && {\n userHandle: arrayBufferToBase64url(response.userHandle),\n }),\n },\n type: credential.type,\n ...(credential.authenticatorAttachment && {\n authenticatorAttachment: credential.authenticatorAttachment,\n }),\n };\n\n return JSON.stringify(authenticationResponse);\n } catch (error) {\n if (error instanceof ThunderIDRuntimeError) {\n throw error;\n }\n\n if (error instanceof Error) {\n throw new ThunderIDRuntimeError(\n 'Passkey authentication failed. Please try again.',\n 'browser-webauthn-authentication-error',\n 'browser',\n `WebAuthn authentication failed with error: ${error.name}: ${error.message}`,\n );\n }\n\n throw new ThunderIDRuntimeError(\n 'Passkey authentication failed due to an unexpected error.',\n 'browser-webauthn-unexpected-error',\n 'browser',\n 'An unexpected error occurred during WebAuthn authentication.',\n );\n }\n};\n"],"mappings":";;;;;;;;;;;AA0BA,MAAa,4BAA4B,OAAO,kBAA2C;AACzF,KAAI,CAAC,OAAO,UAAU,aAAa,OACjC,OAAM,IAAIA,0CACR,8CACA,kCACA,WACA,6FACD;AAGH,KAAI;EACF,MAAMC,kBAAuB,KAAK,MAAM,cAAc;EAGtD,MAAMC,YAAiB;GACrB,GAAG;GACH,2DAAkC,gBAAgB,UAAU;GAC5D,MAAM;IACJ,GAAG,gBAAgB;IACnB,oDAA2B,gBAAgB,KAAK,GAAG;IACpD;GACD,GAAI,gBAAgB,sBAAsB,EACxC,oBAAoB,gBAAgB,mBAAmB,KAAK,UAAe;IACzE,GAAG;IACH,oDAA2B,KAAK,GAAG;IACpC,EAAE,EACJ;GACF;EAED,MAAMC,aAAmC,MAAM,UAAU,YAAY,OAAO,EAC1E,WACD,CAAC;AAEF,MAAI,CAAC,WACH,OAAM,IAAIH,0CACR,sDACA,kCACA,WACA,sFACD;EAGH,MAAMI,WAA6C,WAAW;EAG9D,MAAMC,uBAA4B;GAChC,IAAI,WAAW;GACf,uDAA8B,WAAW,MAAM;GAC/C,UAAU;IACR,mEAA0C,SAAS,kBAAkB;IACrE,gEAAuC,SAAS,eAAe;IAC/D,GAAI,SAAS,iBAAiB,EAC5B,YAAY,SAAS,eAAe,EACrC;IACF;GACD,MAAM,WAAW;GACjB,GAAI,WAAW,2BAA2B,EACxC,yBAAyB,WAAW,yBACrC;GACF;AAED,SAAO,KAAK,UAAU,qBAAqB;UACpC,OAAO;AACd,MAAI,iBAAiBL,0CACnB,OAAM;AAGR,MAAI,iBAAiB,MAEnB,OAAM,IAAIA,0CACR,kDACA,uCACA,WACA,4CAA4C,MAAM,KAAK,IAAI,MAAM,UAClE;AAGH,QAAM,IAAIA,0CACR,2DACA,qCACA,WACA,6DACD;;;;;;;;;AAUL,MAAa,8BAA8B,OAAO,kBAA2C;AAC3F,KAAI,CAAC,OAAO,UAAU,aAAa,IACjC,OAAM,IAAIA,0CACR,8CACA,kCACA,WACA,+FACD;AAGH,KAAI;EACF,MAAMM,iBAAsB,KAAK,MAAM,cAAc;EAGrD,MAAMJ,YAAiB;GACrB,GAAG;GACH,2DAAkC,eAAe,UAAU;GAC3D,GAAI,eAAe,oBAAoB,EACrC,kBAAkB,eAAe,iBAAiB,KAAK,UAAe;IACpE,GAAG;IACH,oDAA2B,KAAK,GAAG;IACpC,EAAE,EACJ;GACF;EAED,MAAMC,aAAmC,MAAM,UAAU,YAAY,IAAI,EACvE,WACD,CAAC;AAEF,MAAI,CAAC,WACH,OAAM,IAAIH,0CACR,wDACA,kCACA,WACA,wFACD;EAGH,MAAMO,WAA2C,WAAW;EAG5D,MAAMC,yBAA8B;GAClC,IAAI,WAAW;GACf,uDAA8B,WAAW,MAAM;GAC/C,UAAU;IACR,mEAA0C,SAAS,kBAAkB;IACrE,gEAAuC,SAAS,eAAe;IAC/D,2DAAkC,SAAS,UAAU;IACrD,GAAI,SAAS,cAAc,EACzB,4DAAmC,SAAS,WAAW,EACxD;IACF;GACD,MAAM,WAAW;GACjB,GAAI,WAAW,2BAA2B,EACxC,yBAAyB,WAAW,yBACrC;GACF;AAED,SAAO,KAAK,UAAU,uBAAuB;UACtC,OAAO;AACd,MAAI,iBAAiBR,0CACnB,OAAM;AAGR,MAAI,iBAAiB,MACnB,OAAM,IAAIA,0CACR,oDACA,yCACA,WACA,8CAA8C,MAAM,KAAK,IAAI,MAAM,UACpE;AAGH,QAAM,IAAIA,0CACR,6DACA,qCACA,WACA,+DACD"}
1
+ {"version":3,"file":"passkey.cjs","names":["ThunderIDRuntimeError","creationOptions: any","publicKey: any","credential: PublicKeyCredential","response: AuthenticatorAttestationResponse","registrationResponse: any","requestOptions: any","response: AuthenticatorAssertionResponse","authenticationResponse: any"],"sources":["../../../src/utils/passkey.ts"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {ThunderIDRuntimeError, arrayBufferToBase64url, base64urlToArrayBuffer} from '@thunderid/browser';\n\n/**\n * Handles WebAuthn/Passkey registration flow for browser environments.\n *\n * @param challengeData - JSON stringified challenge data containing WebAuthn creation options.\n * @returns Promise that resolves to a JSON string containing the WebAuthn registration response.\n */\nexport const handlePasskeyRegistration = async (challengeData: string): Promise<string> => {\n if (!window.navigator.credentials?.create) {\n throw new ThunderIDRuntimeError(\n 'WebAuthn is not supported in this browser.',\n 'browser-webauthn-not-supported',\n 'browser',\n 'WebAuthn/Passkey registration requires a browser that supports the Web Authentication API.',\n );\n }\n\n try {\n const creationOptions: any = JSON.parse(challengeData);\n\n // Decode challenge and user ID from base64url to BufferSource\n const publicKey: any = {\n ...creationOptions,\n challenge: base64urlToArrayBuffer(creationOptions.challenge),\n user: {\n ...creationOptions.user,\n id: base64urlToArrayBuffer(creationOptions.user.id),\n },\n ...(creationOptions.excludeCredentials && {\n excludeCredentials: creationOptions.excludeCredentials.map((cred: any) => ({\n ...cred,\n id: base64urlToArrayBuffer(cred.id),\n })),\n }),\n };\n\n const credential: PublicKeyCredential = (await navigator.credentials.create({\n publicKey,\n })) as PublicKeyCredential;\n\n if (!credential) {\n throw new ThunderIDRuntimeError(\n 'No credential returned from WebAuthn registration.',\n 'browser-webauthn-no-credential',\n 'browser',\n 'The WebAuthn registration ceremony completed but did not return a valid credential.',\n );\n }\n\n const response: AuthenticatorAttestationResponse = credential.response as AuthenticatorAttestationResponse;\n\n // Encode response fields back to base64url\n const registrationResponse: any = {\n id: credential.id,\n rawId: arrayBufferToBase64url(credential.rawId),\n response: {\n attestationObject: arrayBufferToBase64url(response.attestationObject),\n clientDataJSON: arrayBufferToBase64url(response.clientDataJSON),\n ...(response.getTransports && {\n transports: response.getTransports(),\n }),\n },\n type: credential.type,\n ...(credential.authenticatorAttachment && {\n authenticatorAttachment: credential.authenticatorAttachment,\n }),\n };\n\n return JSON.stringify(registrationResponse);\n } catch (error) {\n if (error instanceof ThunderIDRuntimeError) {\n throw error;\n }\n\n if (error instanceof Error) {\n // Map specific WebAuthn errors to ThunderIDRuntimeError/friendly messages as needed\n throw new ThunderIDRuntimeError(\n 'Passkey registration failed. Please try again.',\n 'browser-webauthn-registration-error',\n 'browser',\n `WebAuthn registration failed with error: ${error.name}: ${error.message}`,\n );\n }\n\n throw new ThunderIDRuntimeError(\n 'Passkey registration failed due to an unexpected error.',\n 'browser-webauthn-unexpected-error',\n 'browser',\n 'An unexpected error occurred during WebAuthn registration.',\n );\n }\n};\n\n/**\n * Handles WebAuthn/Passkey authentication flow for browser environments.\n *\n * @param challengeData - JSON stringified challenge data containing WebAuthn request options.\n * @returns Promise that resolves to a JSON string containing the WebAuthn authentication response.\n */\nexport const handlePasskeyAuthentication = async (challengeData: string): Promise<string> => {\n if (!window.navigator.credentials?.get) {\n throw new ThunderIDRuntimeError(\n 'WebAuthn is not supported in this browser.',\n 'browser-webauthn-not-supported',\n 'browser',\n 'WebAuthn/Passkey authentication requires a browser that supports the Web Authentication API.',\n );\n }\n\n try {\n const requestOptions: any = JSON.parse(challengeData);\n\n // Decode challenge and allowed credentials from base64url to BufferSource\n const publicKey: any = {\n ...requestOptions,\n challenge: base64urlToArrayBuffer(requestOptions.challenge),\n ...(requestOptions.allowCredentials && {\n allowCredentials: requestOptions.allowCredentials.map((cred: any) => ({\n ...cred,\n id: base64urlToArrayBuffer(cred.id),\n })),\n }),\n };\n\n const credential: PublicKeyCredential = (await navigator.credentials.get({\n publicKey,\n })) as PublicKeyCredential;\n\n if (!credential) {\n throw new ThunderIDRuntimeError(\n 'No credential returned from WebAuthn authentication.',\n 'browser-webauthn-no-credential',\n 'browser',\n 'The WebAuthn authentication ceremony completed but did not return a valid credential.',\n );\n }\n\n const response: AuthenticatorAssertionResponse = credential.response as AuthenticatorAssertionResponse;\n\n // Encode response fields back to base64url\n const authenticationResponse: any = {\n id: credential.id,\n rawId: arrayBufferToBase64url(credential.rawId),\n response: {\n authenticatorData: arrayBufferToBase64url(response.authenticatorData),\n clientDataJSON: arrayBufferToBase64url(response.clientDataJSON),\n signature: arrayBufferToBase64url(response.signature),\n ...(response.userHandle && {\n userHandle: arrayBufferToBase64url(response.userHandle),\n }),\n },\n type: credential.type,\n ...(credential.authenticatorAttachment && {\n authenticatorAttachment: credential.authenticatorAttachment,\n }),\n };\n\n return JSON.stringify(authenticationResponse);\n } catch (error) {\n if (error instanceof ThunderIDRuntimeError) {\n throw error;\n }\n\n if (error instanceof Error) {\n throw new ThunderIDRuntimeError(\n 'Passkey authentication failed. Please try again.',\n 'browser-webauthn-authentication-error',\n 'browser',\n `WebAuthn authentication failed with error: ${error.name}: ${error.message}`,\n );\n }\n\n throw new ThunderIDRuntimeError(\n 'Passkey authentication failed due to an unexpected error.',\n 'browser-webauthn-unexpected-error',\n 'browser',\n 'An unexpected error occurred during WebAuthn authentication.',\n );\n }\n};\n"],"mappings":";;;;;;;;;;;AAWA,MAAa,4BAA4B,OAAO,kBAA2C;AACzF,KAAI,CAAC,OAAO,UAAU,aAAa,OACjC,OAAM,IAAIA,0CACR,8CACA,kCACA,WACA,6FACD;AAGH,KAAI;EACF,MAAMC,kBAAuB,KAAK,MAAM,cAAc;EAGtD,MAAMC,YAAiB;GACrB,GAAG;GACH,2DAAkC,gBAAgB,UAAU;GAC5D,MAAM;IACJ,GAAG,gBAAgB;IACnB,oDAA2B,gBAAgB,KAAK,GAAG;IACpD;GACD,GAAI,gBAAgB,sBAAsB,EACxC,oBAAoB,gBAAgB,mBAAmB,KAAK,UAAe;IACzE,GAAG;IACH,oDAA2B,KAAK,GAAG;IACpC,EAAE,EACJ;GACF;EAED,MAAMC,aAAmC,MAAM,UAAU,YAAY,OAAO,EAC1E,WACD,CAAC;AAEF,MAAI,CAAC,WACH,OAAM,IAAIH,0CACR,sDACA,kCACA,WACA,sFACD;EAGH,MAAMI,WAA6C,WAAW;EAG9D,MAAMC,uBAA4B;GAChC,IAAI,WAAW;GACf,uDAA8B,WAAW,MAAM;GAC/C,UAAU;IACR,mEAA0C,SAAS,kBAAkB;IACrE,gEAAuC,SAAS,eAAe;IAC/D,GAAI,SAAS,iBAAiB,EAC5B,YAAY,SAAS,eAAe,EACrC;IACF;GACD,MAAM,WAAW;GACjB,GAAI,WAAW,2BAA2B,EACxC,yBAAyB,WAAW,yBACrC;GACF;AAED,SAAO,KAAK,UAAU,qBAAqB;UACpC,OAAO;AACd,MAAI,iBAAiBL,0CACnB,OAAM;AAGR,MAAI,iBAAiB,MAEnB,OAAM,IAAIA,0CACR,kDACA,uCACA,WACA,4CAA4C,MAAM,KAAK,IAAI,MAAM,UAClE;AAGH,QAAM,IAAIA,0CACR,2DACA,qCACA,WACA,6DACD;;;;;;;;;AAUL,MAAa,8BAA8B,OAAO,kBAA2C;AAC3F,KAAI,CAAC,OAAO,UAAU,aAAa,IACjC,OAAM,IAAIA,0CACR,8CACA,kCACA,WACA,+FACD;AAGH,KAAI;EACF,MAAMM,iBAAsB,KAAK,MAAM,cAAc;EAGrD,MAAMJ,YAAiB;GACrB,GAAG;GACH,2DAAkC,eAAe,UAAU;GAC3D,GAAI,eAAe,oBAAoB,EACrC,kBAAkB,eAAe,iBAAiB,KAAK,UAAe;IACpE,GAAG;IACH,oDAA2B,KAAK,GAAG;IACpC,EAAE,EACJ;GACF;EAED,MAAMC,aAAmC,MAAM,UAAU,YAAY,IAAI,EACvE,WACD,CAAC;AAEF,MAAI,CAAC,WACH,OAAM,IAAIH,0CACR,wDACA,kCACA,WACA,wFACD;EAGH,MAAMO,WAA2C,WAAW;EAG5D,MAAMC,yBAA8B;GAClC,IAAI,WAAW;GACf,uDAA8B,WAAW,MAAM;GAC/C,UAAU;IACR,mEAA0C,SAAS,kBAAkB;IACrE,gEAAuC,SAAS,eAAe;IAC/D,2DAAkC,SAAS,UAAU;IACrD,GAAI,SAAS,cAAc,EACzB,4DAAmC,SAAS,WAAW,EACxD;IACF;GACD,MAAM,WAAW;GACjB,GAAI,WAAW,2BAA2B,EACxC,yBAAyB,WAAW,yBACrC;GACF;AAED,SAAO,KAAK,UAAU,uBAAuB;UACtC,OAAO;AACd,MAAI,iBAAiBR,0CACnB,OAAM;AAGR,MAAI,iBAAiB,MACnB,OAAM,IAAIA,0CACR,oDACA,yCACA,WACA,8CAA8C,MAAM,KAAK,IAAI,MAAM,UACpE;AAGH,QAAM,IAAIA,0CACR,6DACA,qCACA,WACA,+DACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"resolveTranslationsInArray.cjs","names":["resolved: T","resolveTranslationsInObject"],"sources":["../../../src/utils/resolveTranslationsInArray.ts"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FlowMetadataResponse} from '@thunderid/browser';\nimport {resolveTranslationsInObject} from './resolveTranslationsInObject';\nimport {UseTranslation} from '../hooks/useTranslation';\n\n/**\n * Recursively resolves translation and meta template strings in an array of objects.\n * @param items - Array of objects to process\n * @param t - The translation function from useTranslation\n * @param properties - Array of property names to resolve (optional)\n * @param meta - Optional flow metadata for resolving meta() expressions\n * @returns A new array with resolved translations\n */\nconst resolveTranslationsInArray = <T extends Record<string, any>>(\n items: T[],\n t: UseTranslation['t'],\n properties?: string[],\n meta?: FlowMetadataResponse | null,\n): T[] =>\n items.map((item: T) => {\n const resolved: T = resolveTranslationsInObject(item, t, properties, meta);\n\n // If the item has nested components (like BLOCK or STACK type), resolve those too\n if (resolved['components'] && Array.isArray(resolved['components'])) {\n (resolved as any).components = resolveTranslationsInArray(resolved['components'], t, properties, meta);\n }\n\n return resolved;\n });\n\nexport default resolveTranslationsInArray;\n"],"mappings":";;;;;;;;;;;AA8BA,MAAM,8BACJ,OACA,GACA,YACA,SAEA,MAAM,KAAK,SAAY;CACrB,MAAMA,WAAcC,gEAA4B,MAAM,GAAG,YAAY,KAAK;AAG1E,KAAI,SAAS,iBAAiB,MAAM,QAAQ,SAAS,cAAc,CACjE,CAAC,SAAiB,aAAa,2BAA2B,SAAS,eAAe,GAAG,YAAY,KAAK;AAGxG,QAAO;EACP;AAEJ,yCAAe"}
1
+ {"version":3,"file":"resolveTranslationsInArray.cjs","names":["resolved: T","resolveTranslationsInObject"],"sources":["../../../src/utils/resolveTranslationsInArray.ts"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {FlowMetadataResponse} from '@thunderid/browser';\nimport {resolveTranslationsInObject} from './resolveTranslationsInObject';\nimport {UseTranslation} from '../hooks/useTranslation';\n\n/**\n * Recursively resolves translation and meta template strings in an array of objects.\n * @param items - Array of objects to process\n * @param t - The translation function from useTranslation\n * @param properties - Array of property names to resolve (optional)\n * @param meta - Optional flow metadata for resolving meta() expressions\n * @returns A new array with resolved translations\n */\nconst resolveTranslationsInArray = <T extends Record<string, any>>(\n items: T[],\n t: UseTranslation['t'],\n properties?: string[],\n meta?: FlowMetadataResponse | null,\n): T[] =>\n items.map((item: T) => {\n const resolved: T = resolveTranslationsInObject(item, t, properties, meta);\n\n // If the item has nested components (like BLOCK or STACK type), resolve those too\n if (resolved['components'] && Array.isArray(resolved['components'])) {\n (resolved as any).components = resolveTranslationsInArray(resolved['components'], t, properties, meta);\n }\n\n return resolved;\n });\n\nexport default resolveTranslationsInArray;\n"],"mappings":";;;;;;;;;;;AAeA,MAAM,8BACJ,OACA,GACA,YACA,SAEA,MAAM,KAAK,SAAY;CACrB,MAAMA,WAAcC,gEAA4B,MAAM,GAAG,YAAY,KAAK;AAG1E,KAAI,SAAS,iBAAiB,MAAM,QAAQ,SAAS,cAAc,CACjE,CAAC,SAAiB,aAAa,2BAA2B,SAAS,eAAe,GAAG,YAAY,KAAK;AAGxG,QAAO;EACP;AAEJ,yCAAe"}
@@ -1 +1 @@
1
- {"version":3,"file":"resolveTranslationsInObject.cjs","names":["resolved: T"],"sources":["../../../src/utils/resolveTranslationsInObject.ts"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {FlowMetadataResponse, resolveFlowTemplateLiterals} from '@thunderid/browser';\nimport {UseTranslation} from '../hooks/useTranslation';\n\n/**\n * Resolves all {{ t() }} and {{ meta() }} template expressions in an object's string properties.\n * @param obj - The object to process\n * @param t - The translation function from useTranslation\n * @param properties - Array of property names to resolve (optional, defaults to common properties)\n * @param meta - Optional flow metadata for resolving meta() expressions\n * @returns A new object with resolved template strings\n */\nexport const resolveTranslationsInObject = <T extends Record<string, any>>(\n obj: T,\n t: UseTranslation['t'],\n properties: string[] = ['label', 'placeholder', 'text', 'title', 'subtitle'],\n meta?: FlowMetadataResponse | null,\n): T => {\n const resolved: T = {...obj};\n\n properties.forEach((prop: string) => {\n if (resolved[prop] && typeof resolved[prop] === 'string') {\n (resolved as any)[prop] = resolveFlowTemplateLiterals(resolved[prop], {meta, t});\n }\n });\n\n return resolved;\n};\n\nexport default resolveTranslationsInObject;\n"],"mappings":";;;;;;;;;;;;;AA6BA,MAAa,+BACX,KACA,GACA,aAAuB;CAAC;CAAS;CAAe;CAAQ;CAAS;CAAW,EAC5E,SACM;CACN,MAAMA,WAAc,EAAC,GAAG,KAAI;AAE5B,YAAW,SAAS,SAAiB;AACnC,MAAI,SAAS,SAAS,OAAO,SAAS,UAAU,SAC9C,CAAC,SAAiB,6DAAoC,SAAS,OAAO;GAAC;GAAM;GAAE,CAAC;GAElF;AAEF,QAAO"}
1
+ {"version":3,"file":"resolveTranslationsInObject.cjs","names":["resolved: T"],"sources":["../../../src/utils/resolveTranslationsInObject.ts"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {FlowMetadataResponse, resolveFlowTemplateLiterals} from '@thunderid/browser';\nimport {UseTranslation} from '../hooks/useTranslation';\n\n/**\n * Resolves all {{ t() }} and {{ meta() }} template expressions in an object's string properties.\n * @param obj - The object to process\n * @param t - The translation function from useTranslation\n * @param properties - Array of property names to resolve (optional, defaults to common properties)\n * @param meta - Optional flow metadata for resolving meta() expressions\n * @returns A new object with resolved template strings\n */\nexport const resolveTranslationsInObject = <T extends Record<string, any>>(\n obj: T,\n t: UseTranslation['t'],\n properties: string[] = ['label', 'placeholder', 'text', 'title', 'subtitle'],\n meta?: FlowMetadataResponse | null,\n): T => {\n const resolved: T = {...obj};\n\n properties.forEach((prop: string) => {\n if (resolved[prop] && typeof resolved[prop] === 'string') {\n (resolved as any)[prop] = resolveFlowTemplateLiterals(resolved[prop], {meta, t});\n }\n });\n\n return resolved;\n};\n\nexport default resolveTranslationsInObject;\n"],"mappings":";;;;;;;;;;;;;AAcA,MAAa,+BACX,KACA,GACA,aAAuB;CAAC;CAAS;CAAe;CAAQ;CAAS;CAAW,EAC5E,SACM;CACN,MAAMA,WAAc,EAAC,GAAG,KAAI;AAE5B,YAAW,SAAS,SAAiB;AACnC,MAAI,SAAS,SAAS,OAAO,SAAS,UAAU,SAC9C,CAAC,SAAiB,6DAAoC,SAAS,OAAO;GAAC;GAAM;GAAE,CAAC;GAElF;AAEF,QAAO"}
@@ -1,20 +1,3 @@
1
- /**
2
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
- *
4
- * WSO2 LLC. licenses this file to you under the Apache License,
5
- * Version 2.0 (the "License"); you may not use this file except
6
- * in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing,
12
- * software distributed under the License is distributed on an
13
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- * KIND, either express or implied. See the License for the
15
- * specific language governing permissions and limitations
16
- * under the License.
17
- */
18
1
  import { FlowMetadataResponse, WithPreferences } from '@thunderid/browser';
19
2
  import { ButtonHTMLAttributes, ForwardRefExoticComponent, ReactNode, RefAttributes } from 'react';
20
3
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"BaseSignInButton.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/SignInButton/BaseSignInButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,oBAAoB,EAAE,eAAe,EAA2B,MAAM,oBAAoB,CAAC;AACnG,OAAO,EACL,oBAAoB,EAEpB,yBAAyB,EAEzB,SAAS,EAET,aAAa,EACd,MAAM,OAAO,CAAC;AAGf;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACnC;;OAEG;IACH,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,2BAA2B,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,qBACf,SAAQ,OAAO,CAAC,2BAA2B,CAAC,EAC1C,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,EACzD,eAAe;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,2BAA2B,KAAK,SAAS,CAAC,GAAG,SAAS,CAAC;CAC5E;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,gBAAgB,EAAE,yBAAyB,CAAC,qBAAqB,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAwBvG,CAAC;AAIJ,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"BaseSignInButton.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/SignInButton/BaseSignInButton.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,oBAAoB,EAAE,eAAe,EAA2B,MAAM,oBAAoB,CAAC;AACnG,OAAO,EACL,oBAAoB,EAEpB,yBAAyB,EAEzB,SAAS,EAET,aAAa,EACd,MAAM,OAAO,CAAC;AAGf;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACnC;;OAEG;IACH,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,2BAA2B,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,qBACf,SAAQ,OAAO,CAAC,2BAA2B,CAAC,EAC1C,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,EACzD,eAAe;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,2BAA2B,KAAK,SAAS,CAAC,GAAG,SAAS,CAAC;CAC5E;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,gBAAgB,EAAE,yBAAyB,CAAC,qBAAqB,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAwBvG,CAAC;AAIJ,eAAe,gBAAgB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BaseSignInButton.js","names":["BaseSignInButton: ForwardRefExoticComponent<BaseSignInButtonProps & RefAttributes<HTMLButtonElement>>","Button"],"sources":["../../../../src/components/actions/SignInButton/BaseSignInButton.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {cx} from '@emotion/css';\nimport {FlowMetadataResponse, WithPreferences, withVendorCSSClassPrefix} from '@thunderid/browser';\nimport {\n ButtonHTMLAttributes,\n forwardRef,\n ForwardRefExoticComponent,\n ReactElement,\n ReactNode,\n Ref,\n RefAttributes,\n} from 'react';\nimport Button from '../../primitives/Button/Button';\n\n/**\n * Common props shared by all {@link BaseSignInButton} components.\n */\nexport interface CommonBaseSignInButtonProps {\n /**\n * Loading state during sign-in process\n */\n isLoading?: boolean;\n /**\n * Flow metadata returned by the platform (v2 only). `null` while loading or unavailable.\n */\n meta?: FlowMetadataResponse | null;\n /**\n * Function to initiate the sign-in process\n */\n signIn: () => Promise<void>;\n}\n\n/**\n * Props passed to the render function of {@link BaseSignInButton}\n */\nexport type BaseSignInButtonRenderProps = CommonBaseSignInButtonProps;\n\n/**\n * Props interface of {@link BaseSignInButton}\n */\nexport interface BaseSignInButtonProps\n extends Partial<CommonBaseSignInButtonProps>,\n Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'>,\n WithPreferences {\n /**\n * Render prop function that receives sign-in props, or traditional ReactNode children\n */\n children?: ((props: BaseSignInButtonRenderProps) => ReactNode) | ReactNode;\n}\n\n/**\n * Base SignInButton component that supports both render props and traditional props patterns.\n *\n * @example Using render props\n * ```tsx\n * <BaseSignInButton>\n * {({signIn, isLoading}) => (\n * <button onClick={signIn} disabled={isLoading}>\n * {isLoading ? 'Signing in...' : 'Sign In'}\n * </button>\n * )}\n * </BaseSignInButton>\n * ```\n *\n * @example Using traditional props\n * ```tsx\n * <BaseSignInButton className=\"custom-button\">Sign In</BaseSignInButton>\n * ```\n */\nconst BaseSignInButton: ForwardRefExoticComponent<BaseSignInButtonProps & RefAttributes<HTMLButtonElement>> =\n forwardRef<HTMLButtonElement, BaseSignInButtonProps>(\n (\n {children, className, style, signIn, isLoading, meta, preferences, ...rest}: BaseSignInButtonProps,\n ref: Ref<HTMLButtonElement>,\n ): ReactElement => {\n if (typeof children === 'function') {\n return <>{children({isLoading, meta, signIn: signIn!})}</>;\n }\n\n return (\n <Button\n ref={ref}\n className={cx(withVendorCSSClassPrefix('sign-in-button'), className)}\n style={style}\n disabled={isLoading}\n loading={isLoading}\n type=\"button\"\n {...rest}\n >\n {children}\n </Button>\n );\n },\n );\n\nBaseSignInButton.displayName = 'BaseSignInButton';\n\nexport default BaseSignInButton;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAsFA,MAAMA,mBACJ,YAEI,EAAC,UAAU,WAAW,OAAO,QAAQ,WAAW,MAAM,YAAa,GAAG,QACtE,QACiB;AACjB,KAAI,OAAO,aAAa,WACtB,QAAO,0CAAG,SAAS;EAAC;EAAW;EAAc;EAAQ,CAAC,GAAI;AAG5D,QACE,oBAACC;EACM;EACL,WAAW,GAAG,yBAAyB,iBAAiB,EAAE,UAAU;EAC7D;EACP,UAAU;EACV,SAAS;EACT,MAAK;EACL,GAAI;EAEH;GACM;EAGd;AAEH,iBAAiB,cAAc;AAE/B,+BAAe"}
1
+ {"version":3,"file":"BaseSignInButton.js","names":["BaseSignInButton: ForwardRefExoticComponent<BaseSignInButtonProps & RefAttributes<HTMLButtonElement>>","Button"],"sources":["../../../../src/components/actions/SignInButton/BaseSignInButton.tsx"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {cx} from '@emotion/css';\nimport {FlowMetadataResponse, WithPreferences, withVendorCSSClassPrefix} from '@thunderid/browser';\nimport {\n ButtonHTMLAttributes,\n forwardRef,\n ForwardRefExoticComponent,\n ReactElement,\n ReactNode,\n Ref,\n RefAttributes,\n} from 'react';\nimport Button from '../../primitives/Button/Button';\n\n/**\n * Common props shared by all {@link BaseSignInButton} components.\n */\nexport interface CommonBaseSignInButtonProps {\n /**\n * Loading state during sign-in process\n */\n isLoading?: boolean;\n /**\n * Flow metadata returned by the platform (v2 only). `null` while loading or unavailable.\n */\n meta?: FlowMetadataResponse | null;\n /**\n * Function to initiate the sign-in process\n */\n signIn: () => Promise<void>;\n}\n\n/**\n * Props passed to the render function of {@link BaseSignInButton}\n */\nexport type BaseSignInButtonRenderProps = CommonBaseSignInButtonProps;\n\n/**\n * Props interface of {@link BaseSignInButton}\n */\nexport interface BaseSignInButtonProps\n extends Partial<CommonBaseSignInButtonProps>,\n Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'>,\n WithPreferences {\n /**\n * Render prop function that receives sign-in props, or traditional ReactNode children\n */\n children?: ((props: BaseSignInButtonRenderProps) => ReactNode) | ReactNode;\n}\n\n/**\n * Base SignInButton component that supports both render props and traditional props patterns.\n *\n * @example Using render props\n * ```tsx\n * <BaseSignInButton>\n * {({signIn, isLoading}) => (\n * <button onClick={signIn} disabled={isLoading}>\n * {isLoading ? 'Signing in...' : 'Sign In'}\n * </button>\n * )}\n * </BaseSignInButton>\n * ```\n *\n * @example Using traditional props\n * ```tsx\n * <BaseSignInButton className=\"custom-button\">Sign In</BaseSignInButton>\n * ```\n */\nconst BaseSignInButton: ForwardRefExoticComponent<BaseSignInButtonProps & RefAttributes<HTMLButtonElement>> =\n forwardRef<HTMLButtonElement, BaseSignInButtonProps>(\n (\n {children, className, style, signIn, isLoading, meta, preferences, ...rest}: BaseSignInButtonProps,\n ref: Ref<HTMLButtonElement>,\n ): ReactElement => {\n if (typeof children === 'function') {\n return <>{children({isLoading, meta, signIn: signIn!})}</>;\n }\n\n return (\n <Button\n ref={ref}\n className={cx(withVendorCSSClassPrefix('sign-in-button'), className)}\n style={style}\n disabled={isLoading}\n loading={isLoading}\n type=\"button\"\n {...rest}\n >\n {children}\n </Button>\n );\n },\n );\n\nBaseSignInButton.displayName = 'BaseSignInButton';\n\nexport default BaseSignInButton;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,MAAMA,mBACJ,YAEI,EAAC,UAAU,WAAW,OAAO,QAAQ,WAAW,MAAM,YAAa,GAAG,QACtE,QACiB;AACjB,KAAI,OAAO,aAAa,WACtB,QAAO,0CAAG,SAAS;EAAC;EAAW;EAAc;EAAQ,CAAC,GAAI;AAG5D,QACE,oBAACC;EACM;EACL,WAAW,GAAG,yBAAyB,iBAAiB,EAAE,UAAU;EAC7D;EACP,UAAU;EACV,SAAS;EACT,MAAK;EACL,GAAI;EAEH;GACM;EAGd;AAEH,iBAAiB,cAAc;AAE/B,+BAAe"}
@@ -1,20 +1,3 @@
1
- /**
2
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
- *
4
- * WSO2 LLC. licenses this file to you under the Apache License,
5
- * Version 2.0 (the "License"); you may not use this file except
6
- * in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing,
12
- * software distributed under the License is distributed on an
13
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- * KIND, either express or implied. See the License for the
15
- * specific language governing permissions and limitations
16
- * under the License.
17
- */
18
1
  import { ForwardRefExoticComponent, RefAttributes } from 'react';
19
2
  import { BaseSignInButtonProps } from './BaseSignInButton';
20
3
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"SignInButton.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/SignInButton/SignInButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAa,yBAAyB,EAAiC,aAAa,EAAW,MAAM,OAAO,CAAC;AACpH,OAAyB,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAC;AAI3E;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,GAAG;IACtD;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC;;OAEG;IACH,YAAY,CAAC,EAAE;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAC,CAAC;CACnD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,QAAA,MAAM,YAAY,EAAE,yBAAyB,CAAC,iBAAiB,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAmEjG,CAAC;AAIF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"SignInButton.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/SignInButton/SignInButton.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,yBAAyB,EAAiC,aAAa,EAAW,MAAM,OAAO,CAAC;AACpH,OAAyB,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAC;AAI3E;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,GAAG;IACtD;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC;;OAEG;IACH,YAAY,CAAC,EAAE;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAC,CAAC;CACnD,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,QAAA,MAAM,YAAY,EAAE,yBAAyB,CAAC,iBAAiB,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAmEjG,CAAC;AAIF,eAAe,YAAY,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SignInButton.js","names":["SignInButton: ForwardRefExoticComponent<SignInButtonProps & RefAttributes<HTMLButtonElement>>","useThunderID","useTranslation","BaseSignInButton"],"sources":["../../../../src/components/actions/SignInButton/SignInButton.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {ThunderIDRuntimeError, navigate} from '@thunderid/browser';\nimport {forwardRef, ForwardRefExoticComponent, MouseEvent, ReactElement, Ref, RefAttributes, useState} from 'react';\nimport BaseSignInButton, {BaseSignInButtonProps} from './BaseSignInButton';\nimport useThunderID from '../../../contexts/ThunderID/useThunderID';\nimport useTranslation from '../../../hooks/useTranslation';\n\n/**\n * Props interface of {@link SignInButton}\n */\nexport type SignInButtonProps = BaseSignInButtonProps & {\n /**\n * Additional parameters to pass to the `authorize` request.\n */\n signInOptions?: Record<string, any>;\n /**\n * Additional parameters to pass to the token request body.\n */\n tokenRequest?: {params?: Record<string, unknown>};\n};\n\n/**\n * SignInButton component that supports both render props and traditional props patterns.\n *\n * @remarks This component is only supported in browser based React applications (CSR).\n *\n * @example Using render props\n * ```tsx\n * <SignInButton>\n * {({signIn, isLoading}) => (\n * <button onClick={signIn} disabled={isLoading}>\n * {isLoading ? 'Signing in...' : 'Sign In'}\n * </button>\n * )}\n * </SignInButton>\n * ```\n *\n * @example Using traditional props\n * ```tsx\n * <SignInButton className=\"custom-button\">Sign In</SignInButton>\n * ```\n *\n * @example Using component-level preferences\n * ```tsx\n * <SignInButton\n * preferences={{\n * i18n: {\n * bundles: {\n * 'en-US': {\n * translations: {\n * 'buttons.signIn': 'Custom Sign In Text'\n * }\n * }\n * }\n * }\n * }}\n * >\n * Custom Sign In\n * </SignInButton>\n * ```\n */\nconst SignInButton: ForwardRefExoticComponent<SignInButtonProps & RefAttributes<HTMLButtonElement>> = forwardRef<\n HTMLButtonElement,\n SignInButtonProps\n>(\n (\n {\n children,\n onClick,\n preferences,\n signInOptions: overriddenSignInOptions,\n tokenRequest: overriddenTokenRequest,\n ...rest\n }: SignInButtonProps,\n ref: Ref<HTMLButtonElement>,\n ): ReactElement => {\n const {signIn, signInUrl, signInOptions, tokenRequest, meta} = useThunderID();\n const {t} = useTranslation(preferences?.i18n);\n\n const [isLoading, setIsLoading] = useState(false);\n\n const handleSignIn = async (e?: MouseEvent<HTMLButtonElement>): Promise<void> => {\n try {\n setIsLoading(true);\n\n // If a custom `signInUrl` is provided, use it for navigation.\n if (signInUrl) {\n navigate(signInUrl);\n } else {\n const mergedParams = (overriddenTokenRequest ?? tokenRequest)?.params;\n await signIn(\n overriddenSignInOptions ?? signInOptions,\n undefined,\n undefined,\n undefined,\n mergedParams && Object.keys(mergedParams).length > 0 ? {params: mergedParams} : undefined,\n );\n }\n\n if (onClick) {\n onClick(e!);\n }\n } catch (error) {\n throw new ThunderIDRuntimeError(\n `Sign in failed: ${error instanceof Error ? error.message : String(JSON.stringify(error))}`,\n 'SignInButton-handleSignIn-RuntimeError-001',\n 'react',\n 'Something went wrong while trying to sign in. Please try again later.',\n );\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <BaseSignInButton\n ref={ref}\n onClick={handleSignIn}\n isLoading={isLoading}\n meta={meta}\n signIn={handleSignIn}\n preferences={preferences}\n {...rest}\n >\n {children ?? t('elements.buttons.signin.text')}\n </BaseSignInButton>\n );\n },\n);\n\nSignInButton.displayName = 'SignInButton';\n\nexport default SignInButton;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8EA,MAAMA,eAAgG,YAKlG,EACE,UACA,SACA,aACA,eAAe,yBACf,cAAc,uBACd,GAAG,QAEL,QACiB;CACjB,MAAM,EAAC,QAAQ,WAAW,eAAe,cAAc,SAAQC,sBAAc;CAC7E,MAAM,EAAC,MAAKC,uBAAe,aAAa,KAAK;CAE7C,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;CAEjD,MAAM,eAAe,OAAO,MAAqD;AAC/E,MAAI;AACF,gBAAa,KAAK;AAGlB,OAAI,UACF,UAAS,UAAU;QACd;IACL,MAAM,gBAAgB,0BAA0B,eAAe;AAC/D,UAAM,OACJ,2BAA2B,eAC3B,QACA,QACA,QACA,gBAAgB,OAAO,KAAK,aAAa,CAAC,SAAS,IAAI,EAAC,QAAQ,cAAa,GAAG,OACjF;;AAGH,OAAI,QACF,SAAQ,EAAG;WAEN,OAAO;AACd,SAAM,IAAI,sBACR,mBAAmB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,UAAU,MAAM,CAAC,IACzF,8CACA,SACA,wEACD;YACO;AACR,gBAAa,MAAM;;;AAIvB,QACE,oBAACC;EACM;EACL,SAAS;EACE;EACL;EACN,QAAQ;EACK;EACb,GAAI;YAEH,YAAY,EAAE,+BAA+B;GAC7B;EAGxB;AAED,aAAa,cAAc;AAE3B,2BAAe"}
1
+ {"version":3,"file":"SignInButton.js","names":["SignInButton: ForwardRefExoticComponent<SignInButtonProps & RefAttributes<HTMLButtonElement>>","useThunderID","useTranslation","BaseSignInButton"],"sources":["../../../../src/components/actions/SignInButton/SignInButton.tsx"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {ThunderIDRuntimeError, navigate} from '@thunderid/browser';\nimport {forwardRef, ForwardRefExoticComponent, MouseEvent, ReactElement, Ref, RefAttributes, useState} from 'react';\nimport BaseSignInButton, {BaseSignInButtonProps} from './BaseSignInButton';\nimport useThunderID from '../../../contexts/ThunderID/useThunderID';\nimport useTranslation from '../../../hooks/useTranslation';\n\n/**\n * Props interface of {@link SignInButton}\n */\nexport type SignInButtonProps = BaseSignInButtonProps & {\n /**\n * Additional parameters to pass to the `authorize` request.\n */\n signInOptions?: Record<string, any>;\n /**\n * Additional parameters to pass to the token request body.\n */\n tokenRequest?: {params?: Record<string, unknown>};\n};\n\n/**\n * SignInButton component that supports both render props and traditional props patterns.\n *\n * @remarks This component is only supported in browser based React applications (CSR).\n *\n * @example Using render props\n * ```tsx\n * <SignInButton>\n * {({signIn, isLoading}) => (\n * <button onClick={signIn} disabled={isLoading}>\n * {isLoading ? 'Signing in...' : 'Sign In'}\n * </button>\n * )}\n * </SignInButton>\n * ```\n *\n * @example Using traditional props\n * ```tsx\n * <SignInButton className=\"custom-button\">Sign In</SignInButton>\n * ```\n *\n * @example Using component-level preferences\n * ```tsx\n * <SignInButton\n * preferences={{\n * i18n: {\n * bundles: {\n * 'en-US': {\n * translations: {\n * 'buttons.signIn': 'Custom Sign In Text'\n * }\n * }\n * }\n * }\n * }}\n * >\n * Custom Sign In\n * </SignInButton>\n * ```\n */\nconst SignInButton: ForwardRefExoticComponent<SignInButtonProps & RefAttributes<HTMLButtonElement>> = forwardRef<\n HTMLButtonElement,\n SignInButtonProps\n>(\n (\n {\n children,\n onClick,\n preferences,\n signInOptions: overriddenSignInOptions,\n tokenRequest: overriddenTokenRequest,\n ...rest\n }: SignInButtonProps,\n ref: Ref<HTMLButtonElement>,\n ): ReactElement => {\n const {signIn, signInUrl, signInOptions, tokenRequest, meta} = useThunderID();\n const {t} = useTranslation(preferences?.i18n);\n\n const [isLoading, setIsLoading] = useState(false);\n\n const handleSignIn = async (e?: MouseEvent<HTMLButtonElement>): Promise<void> => {\n try {\n setIsLoading(true);\n\n // If a custom `signInUrl` is provided, use it for navigation.\n if (signInUrl) {\n navigate(signInUrl);\n } else {\n const mergedParams = (overriddenTokenRequest ?? tokenRequest)?.params;\n await signIn(\n overriddenSignInOptions ?? signInOptions,\n undefined,\n undefined,\n undefined,\n mergedParams && Object.keys(mergedParams).length > 0 ? {params: mergedParams} : undefined,\n );\n }\n\n if (onClick) {\n onClick(e!);\n }\n } catch (error) {\n throw new ThunderIDRuntimeError(\n `Sign in failed: ${error instanceof Error ? error.message : String(JSON.stringify(error))}`,\n 'SignInButton-handleSignIn-RuntimeError-001',\n 'react',\n 'Something went wrong while trying to sign in. Please try again later.',\n );\n } finally {\n setIsLoading(false);\n }\n };\n\n return (\n <BaseSignInButton\n ref={ref}\n onClick={handleSignIn}\n isLoading={isLoading}\n meta={meta}\n signIn={handleSignIn}\n preferences={preferences}\n {...rest}\n >\n {children ?? t('elements.buttons.signin.text')}\n </BaseSignInButton>\n );\n },\n);\n\nSignInButton.displayName = 'SignInButton';\n\nexport default SignInButton;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+DA,MAAMA,eAAgG,YAKlG,EACE,UACA,SACA,aACA,eAAe,yBACf,cAAc,uBACd,GAAG,QAEL,QACiB;CACjB,MAAM,EAAC,QAAQ,WAAW,eAAe,cAAc,SAAQC,sBAAc;CAC7E,MAAM,EAAC,MAAKC,uBAAe,aAAa,KAAK;CAE7C,MAAM,CAAC,WAAW,gBAAgB,SAAS,MAAM;CAEjD,MAAM,eAAe,OAAO,MAAqD;AAC/E,MAAI;AACF,gBAAa,KAAK;AAGlB,OAAI,UACF,UAAS,UAAU;QACd;IACL,MAAM,gBAAgB,0BAA0B,eAAe;AAC/D,UAAM,OACJ,2BAA2B,eAC3B,QACA,QACA,QACA,gBAAgB,OAAO,KAAK,aAAa,CAAC,SAAS,IAAI,EAAC,QAAQ,cAAa,GAAG,OACjF;;AAGH,OAAI,QACF,SAAQ,EAAG;WAEN,OAAO;AACd,SAAM,IAAI,sBACR,mBAAmB,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,UAAU,MAAM,CAAC,IACzF,8CACA,SACA,wEACD;YACO;AACR,gBAAa,MAAM;;;AAIvB,QACE,oBAACC;EACM;EACL,SAAS;EACE;EACL;EACN,QAAQ;EACK;EACb,GAAI;YAEH,YAAY,EAAE,+BAA+B;GAC7B;EAGxB;AAED,aAAa,cAAc;AAE3B,2BAAe"}
@@ -1,20 +1,3 @@
1
- /**
2
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
- *
4
- * WSO2 LLC. licenses this file to you under the Apache License,
5
- * Version 2.0 (the "License"); you may not use this file except
6
- * in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing,
12
- * software distributed under the License is distributed on an
13
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- * KIND, either express or implied. See the License for the
15
- * specific language governing permissions and limitations
16
- * under the License.
17
- */
18
1
  import { FlowMetadataResponse, WithPreferences } from '@thunderid/browser';
19
2
  import { ForwardRefExoticComponent, ButtonHTMLAttributes, ReactNode, RefAttributes } from 'react';
20
3
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"BaseSignOutButton.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/SignOutButton/BaseSignOutButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAC,oBAAoB,EAAE,eAAe,EAA2B,MAAM,oBAAoB,CAAC;AACnG,OAAO,EAEL,yBAAyB,EACzB,oBAAoB,EAEpB,SAAS,EAET,aAAa,EACd,MAAM,OAAO,CAAC;AAGf;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACnC;;OAEG;IACH,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,4BAA4B,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,sBACf,SAAQ,OAAO,CAAC,4BAA4B,CAAC,EAC3C,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,EACzD,eAAe;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,4BAA4B,KAAK,SAAS,CAAC,GAAG,SAAS,CAAC;CAC7E;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,iBAAiB,EAAE,yBAAyB,CAAC,sBAAsB,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAwBzG,CAAC;AAIJ,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"BaseSignOutButton.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/SignOutButton/BaseSignOutButton.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,oBAAoB,EAAE,eAAe,EAA2B,MAAM,oBAAoB,CAAC;AACnG,OAAO,EAEL,yBAAyB,EACzB,oBAAoB,EAEpB,SAAS,EAET,aAAa,EACd,MAAM,OAAO,CAAC;AAGf;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACnC;;OAEG;IACH,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,4BAA4B,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,sBACf,SAAQ,OAAO,CAAC,4BAA4B,CAAC,EAC3C,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,EACzD,eAAe;IACjB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,4BAA4B,KAAK,SAAS,CAAC,GAAG,SAAS,CAAC;CAC7E;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,QAAA,MAAM,iBAAiB,EAAE,yBAAyB,CAAC,sBAAsB,GAAG,aAAa,CAAC,iBAAiB,CAAC,CAwBzG,CAAC;AAIJ,eAAe,iBAAiB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"BaseSignOutButton.js","names":["BaseSignOutButton: ForwardRefExoticComponent<BaseSignOutButtonProps & RefAttributes<HTMLButtonElement>>","Button"],"sources":["../../../../src/components/actions/SignOutButton/BaseSignOutButton.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\nimport {cx} from '@emotion/css';\nimport {FlowMetadataResponse, WithPreferences, withVendorCSSClassPrefix} from '@thunderid/browser';\nimport {\n forwardRef,\n ForwardRefExoticComponent,\n ButtonHTMLAttributes,\n ReactElement,\n ReactNode,\n Ref,\n RefAttributes,\n} from 'react';\nimport Button from '../../primitives/Button/Button';\n\n/**\n * Common props shared by all {@link BaseSignOutButton} components.\n */\nexport interface CommonBaseSignOutButtonProps {\n /**\n * Loading state during sign-out process\n */\n isLoading?: boolean;\n /**\n * Flow metadata returned by the platform (v2 only). `null` while loading or unavailable.\n */\n meta?: FlowMetadataResponse | null;\n /**\n * Function to initiate the sign-out process\n */\n signOut: () => Promise<void>;\n}\n\n/**\n * Props passed to the render function of {@link BaseSignOutButton}\n */\nexport type BaseSignOutButtonRenderProps = CommonBaseSignOutButtonProps;\n\n/**\n * Props interface of {@link BaseSignOutButton}\n */\nexport interface BaseSignOutButtonProps\n extends Partial<CommonBaseSignOutButtonProps>,\n Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'>,\n WithPreferences {\n /**\n * Render prop function that receives sign-out props, or traditional ReactNode children\n */\n children?: ((props: BaseSignOutButtonRenderProps) => ReactNode) | ReactNode;\n}\n\n/**\n * Base SignOutButton component that supports both render props and traditional props patterns.\n *\n * @example Using render props\n * ```tsx\n * <BaseSignOutButton>\n * {({signOut, isLoading}) => (\n * <button onClick={signOut} disabled={isLoading}>\n * {isLoading ? 'Signing out...' : 'Sign Out'}\n * </button>\n * )}\n * </BaseSignOutButton>\n * ```\n *\n * @example Using traditional props\n * ```tsx\n * <BaseSignOutButton className=\"custom-button\">Sign Out</BaseSignOutButton>\n * ```\n */\nconst BaseSignOutButton: ForwardRefExoticComponent<BaseSignOutButtonProps & RefAttributes<HTMLButtonElement>> =\n forwardRef<HTMLButtonElement, BaseSignOutButtonProps>(\n (\n {children, className, style, signOut, isLoading, meta, preferences, ...rest}: BaseSignOutButtonProps,\n ref: Ref<HTMLButtonElement>,\n ): ReactElement => {\n if (typeof children === 'function') {\n return <>{children({isLoading, meta, signOut: signOut!})}</>;\n }\n\n return (\n <Button\n ref={ref}\n className={cx(withVendorCSSClassPrefix('sign-out-button'), className)}\n style={style}\n disabled={isLoading}\n loading={isLoading}\n type=\"button\"\n {...rest}\n >\n {children}\n </Button>\n );\n },\n );\n\nBaseSignOutButton.displayName = 'BaseSignOutButton';\n\nexport default BaseSignOutButton;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAsFA,MAAMA,oBACJ,YAEI,EAAC,UAAU,WAAW,OAAO,SAAS,WAAW,MAAM,YAAa,GAAG,QACvE,QACiB;AACjB,KAAI,OAAO,aAAa,WACtB,QAAO,0CAAG,SAAS;EAAC;EAAW;EAAe;EAAS,CAAC,GAAI;AAG9D,QACE,oBAACC;EACM;EACL,WAAW,GAAG,yBAAyB,kBAAkB,EAAE,UAAU;EAC9D;EACP,UAAU;EACV,SAAS;EACT,MAAK;EACL,GAAI;EAEH;GACM;EAGd;AAEH,kBAAkB,cAAc;AAEhC,gCAAe"}
1
+ {"version":3,"file":"BaseSignOutButton.js","names":["BaseSignOutButton: ForwardRefExoticComponent<BaseSignOutButtonProps & RefAttributes<HTMLButtonElement>>","Button"],"sources":["../../../../src/components/actions/SignOutButton/BaseSignOutButton.tsx"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {cx} from '@emotion/css';\nimport {FlowMetadataResponse, WithPreferences, withVendorCSSClassPrefix} from '@thunderid/browser';\nimport {\n forwardRef,\n ForwardRefExoticComponent,\n ButtonHTMLAttributes,\n ReactElement,\n ReactNode,\n Ref,\n RefAttributes,\n} from 'react';\nimport Button from '../../primitives/Button/Button';\n\n/**\n * Common props shared by all {@link BaseSignOutButton} components.\n */\nexport interface CommonBaseSignOutButtonProps {\n /**\n * Loading state during sign-out process\n */\n isLoading?: boolean;\n /**\n * Flow metadata returned by the platform (v2 only). `null` while loading or unavailable.\n */\n meta?: FlowMetadataResponse | null;\n /**\n * Function to initiate the sign-out process\n */\n signOut: () => Promise<void>;\n}\n\n/**\n * Props passed to the render function of {@link BaseSignOutButton}\n */\nexport type BaseSignOutButtonRenderProps = CommonBaseSignOutButtonProps;\n\n/**\n * Props interface of {@link BaseSignOutButton}\n */\nexport interface BaseSignOutButtonProps\n extends Partial<CommonBaseSignOutButtonProps>,\n Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'>,\n WithPreferences {\n /**\n * Render prop function that receives sign-out props, or traditional ReactNode children\n */\n children?: ((props: BaseSignOutButtonRenderProps) => ReactNode) | ReactNode;\n}\n\n/**\n * Base SignOutButton component that supports both render props and traditional props patterns.\n *\n * @example Using render props\n * ```tsx\n * <BaseSignOutButton>\n * {({signOut, isLoading}) => (\n * <button onClick={signOut} disabled={isLoading}>\n * {isLoading ? 'Signing out...' : 'Sign Out'}\n * </button>\n * )}\n * </BaseSignOutButton>\n * ```\n *\n * @example Using traditional props\n * ```tsx\n * <BaseSignOutButton className=\"custom-button\">Sign Out</BaseSignOutButton>\n * ```\n */\nconst BaseSignOutButton: ForwardRefExoticComponent<BaseSignOutButtonProps & RefAttributes<HTMLButtonElement>> =\n forwardRef<HTMLButtonElement, BaseSignOutButtonProps>(\n (\n {children, className, style, signOut, isLoading, meta, preferences, ...rest}: BaseSignOutButtonProps,\n ref: Ref<HTMLButtonElement>,\n ): ReactElement => {\n if (typeof children === 'function') {\n return <>{children({isLoading, meta, signOut: signOut!})}</>;\n }\n\n return (\n <Button\n ref={ref}\n className={cx(withVendorCSSClassPrefix('sign-out-button'), className)}\n style={style}\n disabled={isLoading}\n loading={isLoading}\n type=\"button\"\n {...rest}\n >\n {children}\n </Button>\n );\n },\n );\n\nBaseSignOutButton.displayName = 'BaseSignOutButton';\n\nexport default BaseSignOutButton;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuEA,MAAMA,oBACJ,YAEI,EAAC,UAAU,WAAW,OAAO,SAAS,WAAW,MAAM,YAAa,GAAG,QACvE,QACiB;AACjB,KAAI,OAAO,aAAa,WACtB,QAAO,0CAAG,SAAS;EAAC;EAAW;EAAe;EAAS,CAAC,GAAI;AAG9D,QACE,oBAACC;EACM;EACL,WAAW,GAAG,yBAAyB,kBAAkB,EAAE,UAAU;EAC9D;EACP,UAAU;EACV,SAAS;EACT,MAAK;EACL,GAAI;EAEH;GACM;EAGd;AAEH,kBAAkB,cAAc;AAEhC,gCAAe"}
@@ -1,20 +1,3 @@
1
- /**
2
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
3
- *
4
- * WSO2 LLC. licenses this file to you under the Apache License,
5
- * Version 2.0 (the "License"); you may not use this file except
6
- * in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing,
12
- * software distributed under the License is distributed on an
13
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- * KIND, either express or implied. See the License for the
15
- * specific language governing permissions and limitations
16
- * under the License.
17
- */
18
1
  import { ForwardRefExoticComponent, RefAttributes } from 'react';
19
2
  import { BaseSignOutButtonProps } from './BaseSignOutButton';
20
3
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"SignOutButton.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/SignOutButton/SignOutButton.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAa,yBAAyB,EAAiC,aAAa,EAAW,MAAM,OAAO,CAAC;AACpH,OAA0B,EAAC,sBAAsB,EAAC,MAAM,qBAAqB,CAAC;AAI9E;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,QAAA,MAAM,aAAa,EAAE,yBAAyB,CAAC,kBAAkB,GAAG,aAAa,CAAC,iBAAiB,CAAC,CA2ClG,CAAC;AAIH,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"SignOutButton.d.ts","sourceRoot":"","sources":["../../../../src/components/actions/SignOutButton/SignOutButton.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,yBAAyB,EAAiC,aAAa,EAAW,MAAM,OAAO,CAAC;AACpH,OAA0B,EAAC,sBAAsB,EAAC,MAAM,qBAAqB,CAAC;AAI9E;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,CAAC;AAExD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,QAAA,MAAM,aAAa,EAAE,yBAAyB,CAAC,kBAAkB,GAAG,aAAa,CAAC,iBAAiB,CAAC,CA2ClG,CAAC;AAIH,eAAe,aAAa,CAAC"}