@ebrains/vue 0.6.0-alpha.0 → 0.7.0-alpha.0

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 (241) hide show
  1. package/{color-primary-palette_6.entry-BJGrNiKE.mjs → color-primary-palette_6.entry-BDyyrFB5.mjs} +17 -17
  2. package/color-primary-palette_6.entry-BhxgE7ff.js +1 -0
  3. package/correct-use-of-colors.entry-DXASqwFp.js +1 -0
  4. package/correct-use-of-colors.entry-z7k3YWpg.mjs +59 -0
  5. package/eds-accordion_22.entry-LksMmZ4o.js +28813 -0
  6. package/eds-accordion_22.entry-Lqf1NKBk.mjs +30175 -0
  7. package/{eds-alert.entry-B9K7jZdM.mjs → eds-alert.entry-BqjTTCgj.mjs} +1 -1
  8. package/{eds-alert.entry-HNjGFpMQ.js → eds-alert.entry-DZcz_4Dj.js} +1 -1
  9. package/eds-app-root.entry-Cz-9z7Za.js +1 -0
  10. package/eds-app-root.entry-DobAtes_.mjs +25 -0
  11. package/eds-avatar_4.entry-BYrgwmj2.mjs +278 -0
  12. package/eds-avatar_4.entry-Bqr0d5Cj.js +149 -0
  13. package/{eds-breadcrumb.entry-nSQcSQxS.mjs → eds-breadcrumb.entry-N3NSBwJL.mjs} +13 -19
  14. package/eds-breadcrumb.entry-elqbS74P.js +1 -0
  15. package/eds-card-generic.entry-D5pTUUco.js +1 -0
  16. package/eds-card-generic.entry-zKJ2hHOe.mjs +56 -0
  17. package/{eds-card-project.entry-BMRVlg7J.mjs → eds-card-project.entry-DDo4ZJs8.mjs} +1 -1
  18. package/{eds-card-project.entry-BQKGTSJB.js → eds-card-project.entry-e4n5lQbW.js} +1 -1
  19. package/eds-card-section.entry-C8nt6j3h.mjs +30 -0
  20. package/eds-card-section.entry-CeznIbCo.js +1 -0
  21. package/{eds-card-tags.entry-DAkoUUin.js → eds-card-tags.entry-Bl3YXNtv.js} +1 -1
  22. package/{eds-card-tags.entry-BjvxuQg1.mjs → eds-card-tags.entry-Do9kx7rP.mjs} +1 -1
  23. package/{eds-card-tool.entry-BPrlMiqY.mjs → eds-card-tool.entry-BewNCjRU.mjs} +1 -1
  24. package/{eds-card-tool.entry-B0rDGNdA.js → eds-card-tool.entry-DnVIn9BX.js} +1 -1
  25. package/{eds-card-wrapper.entry-DyPmlYoI.js → eds-card-wrapper.entry-BzKcrwEf.js} +1 -1
  26. package/{eds-card-wrapper.entry-Ba4ljzon.mjs → eds-card-wrapper.entry-DMj1bZ4i.mjs} +1 -1
  27. package/{eds-code-block.entry-B3RL-q6l.js → eds-code-block.entry-DUeN87Fw.js} +1 -1
  28. package/{eds-code-block.entry-zX5MUsAS.mjs → eds-code-block.entry-fqrA-Frf.mjs} +1 -1
  29. package/{eds-components-section.entry-xnXY70G_.mjs → eds-components-section.entry-BgfCSxk1.mjs} +2 -2
  30. package/{eds-components-section.entry-BsmIIcun.js → eds-components-section.entry-CLJMns6h.js} +2 -2
  31. package/{eds-cookies-preference.entry-DAQEpE8v.mjs → eds-cookies-preference.entry-B1a8qild.mjs} +5 -5
  32. package/{eds-cookies-preference.entry-MAmSehJX.js → eds-cookies-preference.entry-BGx0tglE.js} +1 -1
  33. package/{eds-docs-palettes.entry-BiC_mzap.js → eds-docs-palettes.entry-C1EcBwSy.js} +1 -1
  34. package/{eds-docs-palettes.entry-CFIZWB7Y.mjs → eds-docs-palettes.entry-TXbXKJJN.mjs} +2 -2
  35. package/{eds-docs-tokens.entry-ClVBrRzm.mjs → eds-docs-tokens.entry-B1xc8BFa.mjs} +2 -2
  36. package/{eds-docs-tokens.entry-CCwf01ke.js → eds-docs-tokens.entry-BJVBVsOy.js} +1 -1
  37. package/eds-dropdown.entry-CMK8E_J2.mjs +83 -0
  38. package/eds-dropdown.entry-FqX7fOIb.js +1 -0
  39. package/eds-feedback.entry-B-Lue8P0.js +1 -0
  40. package/eds-feedback.entry-fz73-syB.mjs +53 -0
  41. package/{eds-form.entry-gO7sMMVG.js → eds-form.entry-0saB-Hm9.js} +2 -2
  42. package/{eds-form.entry-znKH1sqi.mjs → eds-form.entry-BB1gfXVy.mjs} +174 -159
  43. package/eds-frame.entry-BvJCKWMT.mjs +73 -0
  44. package/eds-frame.entry-dX3nZxD0.js +1 -0
  45. package/{eds-icon-arrow-diagonal.entry-C7CZIqBn.mjs → eds-icon-arrow-diagonal.entry-BD3xdvR4.mjs} +2 -2
  46. package/{eds-icon-arrow-diagonal.entry-BTLKc1cS.js → eds-icon-arrow-diagonal.entry-DkQFuVkT.js} +1 -1
  47. package/eds-icon-arrow-right.entry-BH0zDB1H.js +1 -0
  48. package/eds-icon-arrow-right.entry-Diax6KZB.mjs +13 -0
  49. package/{eds-icon-bluesky.entry-BfYrb4Uv.js → eds-icon-bluesky.entry-CDZCjWCh.js} +1 -1
  50. package/eds-icon-bluesky.entry-DwvxMR1q.mjs +13 -0
  51. package/{eds-icon-chevron-down.entry-OPmfChgp.js → eds-icon-chevron-down.entry-CGsA1rJ0.js} +1 -1
  52. package/eds-icon-chevron-down.entry-CiJcqZuh.mjs +13 -0
  53. package/{eds-icon-chevron-left.entry-CRr4AWkS.mjs → eds-icon-chevron-left.entry-Dt2WsKob.mjs} +2 -2
  54. package/{eds-icon-chevron-left.entry-_zMMz-c9.js → eds-icon-chevron-left.entry-nBBudzCb.js} +1 -1
  55. package/{eds-icon-chevron-right.entry-YLnmNxjo.mjs → eds-icon-chevron-right.entry-BG7_qznz.mjs} +2 -2
  56. package/{eds-icon-chevron-right.entry-0FshDV46.js → eds-icon-chevron-right.entry-CjhJFKog.js} +1 -1
  57. package/eds-icon-chevron-up.entry-DfsbHKk1.mjs +13 -0
  58. package/eds-icon-chevron-up.entry-Dy81hGw-.js +1 -0
  59. package/eds-icon-close.entry-CpGzc34L.mjs +13 -0
  60. package/{eds-icon-close.entry-BSSS65tZ.js → eds-icon-close.entry-DNhXNl8O.js} +1 -1
  61. package/eds-icon-copy.entry-CsD2FpUS.mjs +13 -0
  62. package/eds-icon-copy.entry-DD2HXgFK.js +1 -0
  63. package/eds-icon-eu.entry-BRuCbl7O.mjs +13 -0
  64. package/eds-icon-eu.entry-ChKv8iZB.js +1 -0
  65. package/{eds-icon-facebook.entry-CKmUhO4W.mjs → eds-icon-facebook.entry--ctHhWkj.mjs} +2 -2
  66. package/{eds-icon-facebook.entry-DsPVhA3Z.js → eds-icon-facebook.entry-Bjkse_bn.js} +1 -1
  67. package/{eds-icon-gitlab.entry-D6VEWpO6.mjs → eds-icon-gitlab.entry-BDqNL5zl.mjs} +2 -2
  68. package/{eds-icon-gitlab.entry-Dzq7ViR-.js → eds-icon-gitlab.entry-DUQcgTMM.js} +1 -1
  69. package/eds-icon-linkedin.entry-Cq13-Zdb.mjs +13 -0
  70. package/{eds-icon-linkedin.entry-7PCeoMEi.js → eds-icon-linkedin.entry-D-D3hmxE.js} +1 -1
  71. package/eds-icon-loader.entry-DgpUjCng.mjs +13 -0
  72. package/eds-icon-loader.entry-rKBBXz_C.js +1 -0
  73. package/{eds-icon-mastodon.entry-DsU7dMbW.js → eds-icon-mastodon.entry-CCn_r682.js} +1 -1
  74. package/eds-icon-mastodon.entry-OpdPcGQ7.mjs +13 -0
  75. package/eds-icon-menu.entry-B3mQ8ma1.mjs +13 -0
  76. package/{eds-icon-menu.entry-DRd13IcH.js → eds-icon-menu.entry-DUxzhro5.js} +1 -1
  77. package/{eds-icon-more.entry-BOWM2H9H.js → eds-icon-more.entry-CBDi0LJC.js} +1 -1
  78. package/{eds-icon-more.entry-CqvnBXDu.mjs → eds-icon-more.entry-CDDxBiBM.mjs} +2 -2
  79. package/eds-icon-search.entry-Bok3Oo0Q.js +1 -0
  80. package/eds-icon-search.entry-CvnFqzlk.mjs +13 -0
  81. package/eds-icon-star.entry-BRQ07hMQ.mjs +13 -0
  82. package/eds-icon-star.entry-CkeEbwgJ.js +1 -0
  83. package/{eds-icon-success.entry-CDwqLyts.js → eds-icon-success.entry-DA4C5Hwg.js} +1 -1
  84. package/eds-icon-success.entry-nWUVTFzX.mjs +13 -0
  85. package/eds-icon-thumbs-down.entry-BqEOrmiW.js +1 -0
  86. package/eds-icon-thumbs-down.entry-Dme-Ippn.mjs +13 -0
  87. package/eds-icon-thumbs-up.entry-Dkqv6r_x.js +1 -0
  88. package/eds-icon-thumbs-up.entry-Dp-eslmx.mjs +13 -0
  89. package/eds-icon-twitter.entry-BcZ2atce.js +1 -0
  90. package/eds-icon-twitter.entry-CqalD8Wf.mjs +13 -0
  91. package/eds-icon-user.entry-DU8EF-lQ.mjs +13 -0
  92. package/{eds-icon-user.entry-GYJBVLsU.js → eds-icon-user.entry-DpvoOnVA.js} +1 -1
  93. package/{eds-icon-youtube.entry-BluzizaX.js → eds-icon-youtube.entry-DbPAn4pN.js} +1 -1
  94. package/{eds-icon-youtube.entry-BqP_g-Pb.mjs → eds-icon-youtube.entry-vFg7QtYg.mjs} +2 -2
  95. package/eds-login_2.entry-6Hxmqih9.js +9 -0
  96. package/{keycloak-d502ec16-Ce0iGqyk.mjs → eds-login_2.entry-DD8g9nqu.mjs} +288 -210
  97. package/eds-logo-variations.entry-CDTTH-iG.mjs +22 -0
  98. package/{eds-logo-variations.entry-B7BEqih8.js → eds-logo-variations.entry-dLBnZPi7.js} +1 -1
  99. package/{eds-modal.entry-2mm8jzwO.mjs → eds-modal.entry-CV3bf08X.mjs} +16 -4
  100. package/{eds-modal.entry-N0Zu-2yI.js → eds-modal.entry-DJybVbNk.js} +1 -1
  101. package/{eds-progress-bar.entry-C-qHC2dN.js → eds-progress-bar.entry-23-I0rSz.js} +1 -1
  102. package/{eds-progress-bar.entry-BpqT4TGP.mjs → eds-progress-bar.entry-BP6AqtI7.mjs} +2 -2
  103. package/eds-rating.entry-CHo7h3Y4.mjs +61 -0
  104. package/eds-rating.entry-dDYfYR7o.js +1 -0
  105. package/{eds-section-core_2.entry-JyCa51Zs.js → eds-section-core_2.entry-BdnBCBit.js} +1 -1
  106. package/{eds-section-core_2.entry-BwoSUszo.mjs → eds-section-core_2.entry-DTItYLUC.mjs} +4 -4
  107. package/eds-spinner.entry-BwTZAz8I.mjs +36 -0
  108. package/eds-spinner.entry-CXLe8IAk.js +1 -0
  109. package/{eds-steps.entry-gPHX8t5y.mjs → eds-steps.entry-Nz_XqcUl.mjs} +10 -19
  110. package/eds-steps.entry-ceVyrSe-.js +1 -0
  111. package/{eds-svg-repository.entry-BhAWpTfJ.js → eds-svg-repository.entry-CKQ6S13R.js} +13 -13
  112. package/{eds-svg-repository.entry-DeKbE1sw.mjs → eds-svg-repository.entry-DoYT85te.mjs} +54 -48
  113. package/{eds-switch.entry-6C-fiD1f.js → eds-switch.entry-4a3DLV-c.js} +1 -1
  114. package/{eds-switch.entry-LXqTebs4.mjs → eds-switch.entry-DjT9dev_.mjs} +3 -3
  115. package/{eds-link.entry-D4lqKj64.mjs → eds-tabs.entry-BYxiMlkR.mjs} +590 -166
  116. package/{eds-link.entry-B_t5O_EC.js → eds-tabs.entry-DJKEg0Gs.js} +503 -16
  117. package/eds-timeline.entry-DKx-pd67.js +1 -0
  118. package/eds-timeline.entry-DOSKCjPH.mjs +45 -0
  119. package/eds-toast-manager.entry-BV-sP7cR.mjs +36 -0
  120. package/eds-toast-manager.entry-BopxpC3o.js +1 -0
  121. package/eds-toast.entry-DDBTRdmP.mjs +61 -0
  122. package/eds-toast.entry-DPibhM-Z.js +3 -0
  123. package/{eds-tooltip.entry-BSd2vlEo.mjs → eds-tooltip.entry-B53fpM9t.mjs} +7 -7
  124. package/{eds-tooltip.entry-D9pRQyxl.js → eds-tooltip.entry-Cf6bse_x.js} +1 -1
  125. package/eds-trl.entry-C0cSVG_Q.mjs +34 -0
  126. package/eds-trl.entry-fYVgYPts.js +1 -0
  127. package/eds-user.entry-hUkYJDp4.js +1 -0
  128. package/eds-user.entry-qM0swzIt.mjs +26 -0
  129. package/{eds-vertical-stepper.entry-CdmDXaW2.mjs → eds-vertical-stepper.entry-Bb6dUinj.mjs} +5 -5
  130. package/{eds-vertical-stepper.entry-DphlSSa0.js → eds-vertical-stepper.entry-CvadBA1x.js} +1 -1
  131. package/formUtils-ac68474d-BDuxB0K8.js +1 -0
  132. package/formUtils-ac68474d-D2e59S7S.mjs +122 -0
  133. package/generated/components.d.ts +4 -1
  134. package/incorrect-use-of-colors.entry-B6fKAvAx.mjs +42 -0
  135. package/incorrect-use-of-colors.entry-DZ_SBoa8.js +1 -0
  136. package/index-D4alMZtT.js +21 -0
  137. package/{index-Df31uHzU.mjs → index-E1PpO1J3.mjs} +453 -430
  138. package/index.js +1 -1
  139. package/index.mjs +32 -29
  140. package/{logo-space.entry-q9Uznxi3.js → logo-space.entry-BOh7Odfh.js} +1 -1
  141. package/{logo-space.entry-CChbx8AS.mjs → logo-space.entry-xGhYUj5r.mjs} +7 -7
  142. package/logo-variations-horizontal_2.entry-BWlXcmRe.js +7 -0
  143. package/logo-variations-horizontal_2.entry-CIUDEw3Y.mjs +29 -0
  144. package/logo-wrong-usage.entry-CtPXf-5h.js +1 -0
  145. package/logo-wrong-usage.entry-D4aBJ6Wk.mjs +14 -0
  146. package/package.json +1 -1
  147. package/sharedUtils-a550989c-Ci3Tx3jc.mjs +15 -0
  148. package/sharedUtils-a550989c-m4pF1Vqy.js +1 -0
  149. package/star-0da9b5e9-B3-jr0yE.js +3 -0
  150. package/star-0da9b5e9-DX8_iFmu.mjs +6 -0
  151. package/thumbs-down-a18fd049-CzuBAj99.mjs +6 -0
  152. package/thumbs-down-a18fd049-DTNIbYbm.js +3 -0
  153. package/thumbs-up-c19a71bc-CjLv5Wgw.mjs +7 -0
  154. package/thumbs-up-c19a71bc-w8Z8gegt.js +4 -0
  155. package/{token-list_3.entry-CJXI55T0.mjs → token-list_3.entry-DJ-cqa3_.mjs} +4 -4
  156. package/{token-list_3.entry-B4bQ3_yz.js → token-list_3.entry-DVoMZtdK.js} +1 -1
  157. package/{token-ratios.entry-LNQoHORe.mjs → token-ratios.entry-FKky7w4Z.mjs} +2 -2
  158. package/token-ratios.entry-JS-ffZPx.js +1 -0
  159. package/token-spacing.entry-Cf5LP8jh.mjs +12 -0
  160. package/token-spacing.entry-YJWgDaTr.js +1 -0
  161. package/{token-typography.entry-qTyV0EeH.mjs → token-typography.entry-CKyKPdVF.mjs} +2 -2
  162. package/{token-typography.entry-DddK_fiy.js → token-typography.entry-CuHfxHRU.js} +1 -1
  163. package/color-primary-palette_6.entry-CYSEDId9.js +0 -1
  164. package/correct-use-of-colors.entry-B36yaMb6.js +0 -1
  165. package/correct-use-of-colors.entry-C2K5ii07.mjs +0 -59
  166. package/eds-accordion_13.entry-BwXBZQ7p.mjs +0 -8044
  167. package/eds-accordion_13.entry-DuX3jvBd.js +0 -7375
  168. package/eds-block-break.entry-1HfuhJmn.mjs +0 -13
  169. package/eds-block-break.entry-DQDjLThR.js +0 -1
  170. package/eds-breadcrumb.entry-Oe7Iu_rp.js +0 -1
  171. package/eds-dropdown_2.entry-Dhtc1LQe.js +0 -1
  172. package/eds-dropdown_2.entry-Ds54Abix.mjs +0 -115
  173. package/eds-footer.entry-CKr0MOpU.mjs +0 -22
  174. package/eds-footer.entry-DuNEl6BR.js +0 -1
  175. package/eds-frame.entry-BE9_G-56.js +0 -1
  176. package/eds-frame.entry-COwMtc5z.mjs +0 -74
  177. package/eds-fullscreen-menu.entry-CRIb_lLm.js +0 -1
  178. package/eds-fullscreen-menu.entry-DdO0Nwbq.mjs +0 -74
  179. package/eds-header.entry-38uAVZoC.js +0 -2
  180. package/eds-header.entry-C0qfjzDY.mjs +0 -75
  181. package/eds-icon-arrow-right.entry-Bv_6skZy.js +0 -1
  182. package/eds-icon-arrow-right.entry-DNkmpAdY.mjs +0 -13
  183. package/eds-icon-bluesky.entry-B_WksyEk.mjs +0 -13
  184. package/eds-icon-chevron-down.entry-DGjMxTKO.mjs +0 -13
  185. package/eds-icon-chevron-up.entry-DGt49ffi.js +0 -1
  186. package/eds-icon-chevron-up.entry-NPODej6j.mjs +0 -13
  187. package/eds-icon-close.entry-BQULA4ki.mjs +0 -13
  188. package/eds-icon-copy.entry-Di_H0U8v.mjs +0 -13
  189. package/eds-icon-copy.entry-PvAtojYn.js +0 -1
  190. package/eds-icon-eu.entry-BTzpJByN.mjs +0 -13
  191. package/eds-icon-eu.entry-D77vjTJ9.js +0 -1
  192. package/eds-icon-linkedin.entry-BI2sjTDa.mjs +0 -13
  193. package/eds-icon-loader.entry-BoQTR6PV.mjs +0 -13
  194. package/eds-icon-loader.entry-Bp-ZxeW7.js +0 -1
  195. package/eds-icon-mastodon.entry-Cm8XCAqa.mjs +0 -13
  196. package/eds-icon-menu.entry-C7HmF2n5.mjs +0 -13
  197. package/eds-icon-search.entry-BrANR30M.mjs +0 -13
  198. package/eds-icon-search.entry-CubLvPO7.js +0 -1
  199. package/eds-icon-success.entry-CtMWWFTW.mjs +0 -13
  200. package/eds-icon-twitter.entry-BnhBJxrn.js +0 -1
  201. package/eds-icon-twitter.entry-DHTwTPKu.mjs +0 -13
  202. package/eds-icon-user.entry-LTXtb_m4.mjs +0 -13
  203. package/eds-input_7.entry-Bo9-yfaP.js +0 -7167
  204. package/eds-input_7.entry-CCX6iGUA.mjs +0 -7373
  205. package/eds-login.entry-CB_gy86p.mjs +0 -58
  206. package/eds-login.entry-CDj80EGl.js +0 -1
  207. package/eds-logo-variations.entry-AbwI_N4g.mjs +0 -22
  208. package/eds-logo.entry-C4YV268f.mjs +0 -61
  209. package/eds-logo.entry-D-2GjdZl.js +0 -1
  210. package/eds-navigator.entry-Bd0BYBJE.js +0 -1
  211. package/eds-navigator.entry-DJHFUppb.mjs +0 -33
  212. package/eds-pagination_2.entry-N7stHjY-.js +0 -1
  213. package/eds-pagination_2.entry-T_lnxySd.mjs +0 -249
  214. package/eds-rating.entry-C1djorgY.js +0 -1
  215. package/eds-rating.entry-DJbkld-l.mjs +0 -48
  216. package/eds-social-networks.entry-CWw8CODU.mjs +0 -50
  217. package/eds-social-networks.entry-CveQgGlC.js +0 -1
  218. package/eds-steps.entry-NC8mexCJ.js +0 -1
  219. package/eds-tab.entry-7_C7zAnd.mjs +0 -31
  220. package/eds-tab.entry-BI3X5Amp.js +0 -1
  221. package/eds-tabs-content.entry-BYK_ciTB.mjs +0 -106
  222. package/eds-tabs-content.entry-FqonRXn9.js +0 -1
  223. package/eds-tabs.entry-CCGBUoii.mjs +0 -112
  224. package/eds-tabs.entry-VauMxz1h.js +0 -1
  225. package/eds-timeline.entry-B-eABvy-.mjs +0 -51
  226. package/eds-timeline.entry-UjKckHoD.js +0 -1
  227. package/eds-trl.entry-C1CKXjzi.mjs +0 -34
  228. package/eds-trl.entry-DdPaX9aY.js +0 -1
  229. package/eds-user.entry-BX3nKCHB.mjs +0 -66
  230. package/eds-user.entry-CyEG-Wtm.js +0 -1
  231. package/incorrect-use-of-colors.entry-BhygRTdu.js +0 -1
  232. package/incorrect-use-of-colors.entry-QkMrxvFS.mjs +0 -42
  233. package/index-DvG3cC-8.js +0 -21
  234. package/keycloak-d502ec16-m7LwS-Gh.js +0 -9
  235. package/logo-variations-horizontal_2.entry-DA_yMnFa.mjs +0 -29
  236. package/logo-variations-horizontal_2.entry-G3ih093R.js +0 -7
  237. package/logo-wrong-usage.entry-BoBmwzLl.mjs +0 -14
  238. package/logo-wrong-usage.entry-l4pJC0KB.js +0 -1
  239. package/token-ratios.entry-hdef-MAq.js +0 -1
  240. package/token-spacing.entry-YXQwnYx0.mjs +0 -12
  241. package/token-spacing.entry-xhNHm9Tw.js +0 -1
@@ -1,22 +1,24 @@
1
- function Y(f) {
2
- if (!(this instanceof Y))
1
+ import { r as X, c as J, h as U, H as se } from "./index-E1PpO1J3.mjs";
2
+ import { t as R } from "./toastManager-d9eee791-CEYNwx25.mjs";
3
+ function q(d) {
4
+ if (!(this instanceof q))
3
5
  throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");
4
- if (typeof f != "string" && !z(f))
6
+ if (typeof d != "string" && !O(d))
5
7
  throw new Error("The 'Keycloak' constructor must be provided with a configuration object, or a URL to a JSON configuration file.");
6
- if (z(f)) {
7
- const r = "oidcProvider" in f ? ["clientId"] : ["url", "realm", "clientId"];
8
+ if (O(d)) {
9
+ const r = "oidcProvider" in d ? ["clientId"] : ["url", "realm", "clientId"];
8
10
  for (const t of r)
9
- if (!f[t])
11
+ if (!d[t])
10
12
  throw new Error(`The configuration object is missing the required '${t}' property.`);
11
13
  }
12
- var e = this, h, v = [], U, p = {
14
+ var e = this, p, v = [], _, h = {
13
15
  enable: !0,
14
16
  callbackList: [],
15
17
  interval: 5
16
18
  };
17
19
  e.didInitialize = !1;
18
- var R = !0, _ = F(console.info), x = F(console.warn);
19
- globalThis.isSecureContext || x(
20
+ var P = !0, I = W(console.info), M = W(console.warn);
21
+ globalThis.isSecureContext || M(
20
22
  `[KEYCLOAK] Keycloak JS must be used in a 'secure context' to function properly as it relies on browser APIs that are otherwise not available.
21
23
  Continuing to run your application insecurely will lead to unexpected behavior and breakage.
22
24
 
@@ -24,9 +26,9 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
24
26
  ), e.init = function(r = {}) {
25
27
  if (e.didInitialize)
26
28
  throw new Error("A 'Keycloak' instance can only be initialized once.");
27
- e.didInitialize = !0, e.authenticated = !1, U = te();
29
+ e.didInitialize = !0, e.authenticated = !1, _ = ie();
28
30
  var t = ["default", "cordova", "cordova-native"];
29
- if (t.indexOf(r.adapter) > -1 ? h = K(r.adapter) : typeof r.adapter == "object" ? h = r.adapter : window.Cordova || window.cordova ? h = K("cordova") : h = K(), typeof r.useNonce < "u" && (R = r.useNonce), typeof r.checkLoginIframe < "u" && (p.enable = r.checkLoginIframe), r.checkLoginIframeInterval && (p.interval = r.checkLoginIframeInterval), r.onLoad === "login-required" && (e.loginRequired = !0), r.responseMode)
31
+ if (t.indexOf(r.adapter) > -1 ? p = N(r.adapter) : typeof r.adapter == "object" ? p = r.adapter : window.Cordova || window.cordova ? p = N("cordova") : p = N(), typeof r.useNonce < "u" && (P = r.useNonce), typeof r.checkLoginIframe < "u" && (h.enable = r.checkLoginIframe), r.checkLoginIframeInterval && (h.interval = r.checkLoginIframeInterval), r.onLoad === "login-required" && (e.loginRequired = !0), r.responseMode)
30
32
  if (r.responseMode === "query" || r.responseMode === "fragment")
31
33
  e.responseMode = r.responseMode;
32
34
  else
@@ -60,10 +62,10 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
60
62
  }).catch(function(o) {
61
63
  s.setError(o);
62
64
  });
63
- var a = Q();
65
+ var a = te();
64
66
  function c() {
65
67
  var o = function(u) {
66
- u || (d.prompt = "none"), r.locale && (d.locale = r.locale), e.login(d).then(function() {
68
+ u || (f.prompt = "none"), r.locale && (f.locale = r.locale), e.login(f).then(function() {
67
69
  i.setSuccess();
68
70
  }).catch(function(m) {
69
71
  i.setError(m);
@@ -73,16 +75,16 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
73
75
  u.setAttribute("src", m), u.setAttribute("sandbox", "allow-storage-access-by-user-activation allow-scripts allow-same-origin"), u.setAttribute("title", "keycloak-silent-check-sso"), u.style.display = "none", document.body.appendChild(u);
74
76
  var w = function(S) {
75
77
  if (!(S.origin !== window.location.origin || u.contentWindow !== S.source)) {
76
- var b = T(S.data);
77
- I(b, i), document.body.removeChild(u), window.removeEventListener("message", w);
78
+ var y = E(S.data);
79
+ T(y, i), document.body.removeChild(u), window.removeEventListener("message", w);
78
80
  }
79
81
  };
80
82
  window.addEventListener("message", w);
81
- }, d = {};
83
+ }, f = {};
82
84
  switch (r.onLoad) {
83
85
  case "check-sso":
84
- p.enable ? P().then(function() {
85
- C().then(function(u) {
86
+ h.enable ? K().then(function() {
87
+ L().then(function(u) {
86
88
  u ? i.setSuccess() : e.silentCheckSsoRedirectUri ? l() : o(!1);
87
89
  }).catch(function(u) {
88
90
  i.setError(u);
@@ -97,16 +99,16 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
97
99
  }
98
100
  }
99
101
  function n() {
100
- var o = T(window.location.href);
102
+ var o = E(window.location.href);
101
103
  if (o && window.history.replaceState(window.history.state, null, o.newUrl), o && o.valid)
102
- return P().then(function() {
103
- I(o, i);
104
+ return K().then(function() {
105
+ T(o, i);
104
106
  }).catch(function(l) {
105
107
  i.setError(l);
106
108
  });
107
- r.token && r.refreshToken ? (A(r.token, r.refreshToken, r.idToken), p.enable ? P().then(function() {
108
- C().then(function(l) {
109
- l ? (e.onAuthSuccess && e.onAuthSuccess(), i.setSuccess(), M()) : i.setSuccess();
109
+ r.token && r.refreshToken ? (C(r.token, r.refreshToken, r.idToken), h.enable ? K().then(function() {
110
+ L().then(function(l) {
111
+ l ? (e.onAuthSuccess && e.onAuthSuccess(), i.setSuccess(), H()) : i.setSuccess();
110
112
  }).catch(function(l) {
111
113
  i.setError(l);
112
114
  });
@@ -117,35 +119,35 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
117
119
  })) : r.onLoad ? c() : i.setSuccess();
118
120
  }
119
121
  return a.then(function() {
120
- re().then(n).catch(function(o) {
122
+ ae().then(n).catch(function(o) {
121
123
  s.setError(o);
122
124
  });
123
125
  }), a.catch(function(o) {
124
126
  s.setError(o);
125
127
  }), s.promise;
126
128
  }, e.login = function(r) {
127
- return h.login(r);
129
+ return p.login(r);
128
130
  };
129
- function G(r) {
131
+ function B(r) {
130
132
  if (typeof crypto > "u" || typeof crypto.getRandomValues > "u")
131
133
  throw new Error("Web Crypto API is not available.");
132
134
  return crypto.getRandomValues(new Uint8Array(r));
133
135
  }
134
- function X(r) {
135
- return q(r, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
136
+ function $(r) {
137
+ return Q(r, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
136
138
  }
137
- function q(r, t) {
138
- for (var s = G(r), i = new Array(r), a = 0; a < r; a++)
139
+ function Q(r, t) {
140
+ for (var s = B(r), i = new Array(r), a = 0; a < r; a++)
139
141
  i[a] = t.charCodeAt(s[a] % t.length);
140
142
  return String.fromCharCode.apply(null, i);
141
143
  }
142
- async function B(r, t) {
144
+ async function Z(r, t) {
143
145
  if (r !== "S256")
144
146
  throw new TypeError(`Invalid value for 'pkceMethod', expected 'S256' but got '${r}'.`);
145
- const s = new Uint8Array(await oe(t));
146
- return ne(s).replace(/\+/g, "-").replace(/\//g, "_").replace(/\=/g, "");
147
+ const s = new Uint8Array(await le(t));
148
+ return ce(s).replace(/\+/g, "-").replace(/\//g, "_").replace(/\=/g, "");
147
149
  }
148
- function W(r) {
150
+ function ee(r) {
149
151
  var t = {
150
152
  id_token: {
151
153
  acr: r
@@ -154,7 +156,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
154
156
  return JSON.stringify(t);
155
157
  }
156
158
  e.createLoginUrl = async function(r) {
157
- var t = J(), s = J(), i = h.redirectUri(r), a = {
159
+ var t = Y(), s = Y(), i = p.redirectUri(r), a = {
158
160
  state: t,
159
161
  nonce: s,
160
162
  redirectUri: encodeURIComponent(i),
@@ -166,34 +168,34 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
166
168
  var n = r && r.scope || e.scope;
167
169
  n ? n.indexOf("openid") === -1 && (n = "openid " + n) : n = "openid";
168
170
  var o = c + "?client_id=" + encodeURIComponent(e.clientId) + "&redirect_uri=" + encodeURIComponent(i) + "&state=" + encodeURIComponent(t) + "&response_mode=" + encodeURIComponent(e.responseMode) + "&response_type=" + encodeURIComponent(e.responseType) + "&scope=" + encodeURIComponent(n);
169
- if (R && (o = o + "&nonce=" + encodeURIComponent(s)), r && r.prompt && (o += "&prompt=" + encodeURIComponent(r.prompt)), r && typeof r.maxAge == "number" && (o += "&max_age=" + encodeURIComponent(r.maxAge)), r && r.loginHint && (o += "&login_hint=" + encodeURIComponent(r.loginHint)), r && r.idpHint && (o += "&kc_idp_hint=" + encodeURIComponent(r.idpHint)), r && r.action && r.action != "register" && (o += "&kc_action=" + encodeURIComponent(r.action)), r && r.locale && (o += "&ui_locales=" + encodeURIComponent(r.locale)), r && r.acr) {
170
- var l = W(r.acr);
171
+ if (P && (o = o + "&nonce=" + encodeURIComponent(s)), r && r.prompt && (o += "&prompt=" + encodeURIComponent(r.prompt)), r && typeof r.maxAge == "number" && (o += "&max_age=" + encodeURIComponent(r.maxAge)), r && r.loginHint && (o += "&login_hint=" + encodeURIComponent(r.loginHint)), r && r.idpHint && (o += "&kc_idp_hint=" + encodeURIComponent(r.idpHint)), r && r.action && r.action != "register" && (o += "&kc_action=" + encodeURIComponent(r.action)), r && r.locale && (o += "&ui_locales=" + encodeURIComponent(r.locale)), r && r.acr) {
172
+ var l = ee(r.acr);
171
173
  o += "&claims=" + encodeURIComponent(l);
172
174
  }
173
175
  if ((r && r.acrValues || e.acrValues) && (o += "&acr_values=" + encodeURIComponent(r.acrValues || e.acrValues)), e.pkceMethod)
174
176
  try {
175
- const d = X(96), u = await B(e.pkceMethod, d);
176
- a.pkceCodeVerifier = d, o += "&code_challenge=" + u, o += "&code_challenge_method=" + e.pkceMethod;
177
- } catch (d) {
178
- throw new Error("Failed to generate PKCE challenge.", { cause: d });
177
+ const f = $(96), u = await Z(e.pkceMethod, f);
178
+ a.pkceCodeVerifier = f, o += "&code_challenge=" + u, o += "&code_challenge_method=" + e.pkceMethod;
179
+ } catch (f) {
180
+ throw new Error("Failed to generate PKCE challenge.", { cause: f });
179
181
  }
180
- return U.add(a), o;
182
+ return _.add(a), o;
181
183
  }, e.logout = function(r) {
182
- return h.logout(r);
184
+ return p.logout(r);
183
185
  }, e.createLogoutUrl = function(r) {
184
186
  if (((r == null ? void 0 : r.logoutMethod) ?? e.logoutMethod) === "POST")
185
187
  return e.endpoints.logout();
186
- var s = e.endpoints.logout() + "?client_id=" + encodeURIComponent(e.clientId) + "&post_logout_redirect_uri=" + encodeURIComponent(h.redirectUri(r, !1));
188
+ var s = e.endpoints.logout() + "?client_id=" + encodeURIComponent(e.clientId) + "&post_logout_redirect_uri=" + encodeURIComponent(p.redirectUri(r, !1));
187
189
  return e.idToken && (s += "&id_token_hint=" + encodeURIComponent(e.idToken)), s;
188
190
  }, e.register = function(r) {
189
- return h.register(r);
191
+ return p.register(r);
190
192
  }, e.createRegisterUrl = async function(r) {
191
193
  return r || (r = {}), r.action = "register", await e.createLoginUrl(r);
192
194
  }, e.createAccountUrl = function(r) {
193
- var t = y(), s = void 0;
194
- return typeof t < "u" && (s = t + "/account?referrer=" + encodeURIComponent(e.clientId) + "&referrer_uri=" + encodeURIComponent(h.redirectUri(r))), s;
195
+ var t = b(), s = void 0;
196
+ return typeof t < "u" && (s = t + "/account?referrer=" + encodeURIComponent(e.clientId) + "&referrer_uri=" + encodeURIComponent(p.redirectUri(r))), s;
195
197
  }, e.accountManagement = function() {
196
- return h.accountManagement();
198
+ return p.accountManagement();
197
199
  }, e.hasRealmRole = function(r) {
198
200
  var t = e.realmAccess;
199
201
  return !!t && t.roles.indexOf(r) >= 0;
@@ -203,7 +205,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
203
205
  var s = e.resourceAccess[t || e.clientId];
204
206
  return !!s && s.roles.indexOf(r) >= 0;
205
207
  }, e.loadUserProfile = function() {
206
- var r = y() + "/account", t = new XMLHttpRequest();
208
+ var r = b() + "/account", t = new XMLHttpRequest();
207
209
  t.open("GET", r, !0), t.setRequestHeader("Accept", "application/json"), t.setRequestHeader("Authorization", "bearer " + e.token);
208
210
  var s = g();
209
211
  return t.onreadystatechange = function() {
@@ -220,7 +222,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
220
222
  if (!e.tokenParsed || !e.refreshToken && e.flow != "implicit")
221
223
  throw "Not authenticated";
222
224
  if (e.timeSkew == null)
223
- return _("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"), !0;
225
+ return I("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"), !0;
224
226
  var t = e.tokenParsed.exp - Math.ceil((/* @__PURE__ */ new Date()).getTime() / 1e3) + e.timeSkew;
225
227
  if (r) {
226
228
  if (isNaN(r))
@@ -235,7 +237,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
235
237
  r = r || 5;
236
238
  var s = function() {
237
239
  var a = !1;
238
- if (r == -1 ? (a = !0, _("[KEYCLOAK] Refreshing token: forced refresh")) : (!e.tokenParsed || e.isTokenExpired(r)) && (a = !0, _("[KEYCLOAK] Refreshing token: token expired")), !a)
240
+ if (r == -1 ? (a = !0, I("[KEYCLOAK] Refreshing token: forced refresh")) : (!e.tokenParsed || e.isTokenExpired(r)) && (a = !0, I("[KEYCLOAK] Refreshing token: token expired")), !a)
239
241
  t.setSuccess(!1);
240
242
  else {
241
243
  var c = "grant_type=refresh_token&refresh_token=" + e.refreshToken, n = e.endpoints.token();
@@ -246,13 +248,13 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
246
248
  o.onreadystatechange = function() {
247
249
  if (o.readyState == 4)
248
250
  if (o.status == 200) {
249
- _("[KEYCLOAK] Token refreshed"), l = (l + (/* @__PURE__ */ new Date()).getTime()) / 2;
250
- var d = JSON.parse(o.responseText);
251
- A(d.access_token, d.refresh_token, d.id_token, l), e.onAuthRefreshSuccess && e.onAuthRefreshSuccess();
251
+ I("[KEYCLOAK] Token refreshed"), l = (l + (/* @__PURE__ */ new Date()).getTime()) / 2;
252
+ var f = JSON.parse(o.responseText);
253
+ C(f.access_token, f.refresh_token, f.id_token, l), e.onAuthRefreshSuccess && e.onAuthRefreshSuccess();
252
254
  for (var u = v.pop(); u != null; u = v.pop())
253
255
  u.setSuccess(!0);
254
256
  } else {
255
- x("[KEYCLOAK] Failed to refresh token"), o.status == 400 && e.clearToken(), e.onAuthRefreshError && e.onAuthRefreshError();
257
+ M("[KEYCLOAK] Failed to refresh token"), o.status == 400 && e.clearToken(), e.onAuthRefreshError && e.onAuthRefreshError();
256
258
  for (var u = v.pop(); u != null; u = v.pop())
257
259
  u.setError("Failed to refresh token: An unexpected HTTP error occurred while attempting to refresh the token.");
258
260
  }
@@ -260,8 +262,8 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
260
262
  }
261
263
  }
262
264
  };
263
- if (p.enable) {
264
- var i = C();
265
+ if (h.enable) {
266
+ var i = L();
265
267
  i.then(function() {
266
268
  s();
267
269
  }).catch(function(a) {
@@ -271,16 +273,16 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
271
273
  s();
272
274
  return t.promise;
273
275
  }, e.clearToken = function() {
274
- e.token && (A(null, null, null), e.onAuthLogout && e.onAuthLogout(), e.loginRequired && e.login());
276
+ e.token && (C(null, null, null), e.onAuthLogout && e.onAuthLogout(), e.loginRequired && e.login());
275
277
  };
276
- function y() {
278
+ function b() {
277
279
  if (typeof e.authServerUrl < "u")
278
280
  return e.authServerUrl.charAt(e.authServerUrl.length - 1) == "/" ? e.authServerUrl + "realms/" + encodeURIComponent(e.realm) : e.authServerUrl + "/realms/" + encodeURIComponent(e.realm);
279
281
  }
280
- function $() {
282
+ function re() {
281
283
  return window.location.origin ? window.location.origin : window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : "");
282
284
  }
283
- function I(r, t) {
285
+ function T(r, t) {
284
286
  var s = r.code, i = r.error, a = r.prompt, c = (/* @__PURE__ */ new Date()).getTime();
285
287
  if (r.kc_action_status && e.onActionUpdate && e.onActionUpdate(r.kc_action_status, r.kc_action), i) {
286
288
  if (a != "none")
@@ -295,23 +297,23 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
295
297
  return;
296
298
  } else e.flow != "standard" && (r.access_token || r.id_token) && u(r.access_token, null, r.id_token, !0);
297
299
  if (e.flow != "implicit" && s) {
298
- var o = "code=" + s + "&grant_type=authorization_code", l = e.endpoints.token(), d = new XMLHttpRequest();
299
- d.open("POST", l, !0), d.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), o += "&client_id=" + encodeURIComponent(e.clientId), o += "&redirect_uri=" + r.redirectUri, r.pkceCodeVerifier && (o += "&code_verifier=" + r.pkceCodeVerifier), d.withCredentials = !0, d.onreadystatechange = function() {
300
- if (d.readyState == 4)
301
- if (d.status == 200) {
302
- var m = JSON.parse(d.responseText);
303
- u(m.access_token, m.refresh_token, m.id_token, e.flow === "standard"), M();
300
+ var o = "code=" + s + "&grant_type=authorization_code", l = e.endpoints.token(), f = new XMLHttpRequest();
301
+ f.open("POST", l, !0), f.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), o += "&client_id=" + encodeURIComponent(e.clientId), o += "&redirect_uri=" + r.redirectUri, r.pkceCodeVerifier && (o += "&code_verifier=" + r.pkceCodeVerifier), f.withCredentials = !0, f.onreadystatechange = function() {
302
+ if (f.readyState == 4)
303
+ if (f.status == 200) {
304
+ var m = JSON.parse(f.responseText);
305
+ u(m.access_token, m.refresh_token, m.id_token, e.flow === "standard"), H();
304
306
  } else
305
307
  e.onAuthError && e.onAuthError(), t && t.setError();
306
- }, d.send(o);
308
+ }, f.send(o);
307
309
  }
308
- function u(m, w, S, b) {
309
- c = (c + (/* @__PURE__ */ new Date()).getTime()) / 2, A(m, w, S, c), R && e.idTokenParsed && e.idTokenParsed.nonce != r.storedNonce ? (_("[KEYCLOAK] Invalid nonce, clearing token"), e.clearToken(), t && t.setError()) : b && (e.onAuthSuccess && e.onAuthSuccess(), t && t.setSuccess());
310
+ function u(m, w, S, y) {
311
+ c = (c + (/* @__PURE__ */ new Date()).getTime()) / 2, C(m, w, S, c), P && e.idTokenParsed && e.idTokenParsed.nonce != r.storedNonce ? (I("[KEYCLOAK] Invalid nonce, clearing token"), e.clearToken(), t && t.setError()) : y && (e.onAuthSuccess && e.onAuthSuccess(), t && t.setSuccess());
310
312
  }
311
313
  }
312
- function Q() {
314
+ function te() {
313
315
  var r = g(), t;
314
- typeof f == "string" && (t = f);
316
+ typeof d == "string" && (t = d);
315
317
  function s(n) {
316
318
  n ? e.endpoints = {
317
319
  authorize: function() {
@@ -340,25 +342,25 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
340
342
  }
341
343
  } : e.endpoints = {
342
344
  authorize: function() {
343
- return y() + "/protocol/openid-connect/auth";
345
+ return b() + "/protocol/openid-connect/auth";
344
346
  },
345
347
  token: function() {
346
- return y() + "/protocol/openid-connect/token";
348
+ return b() + "/protocol/openid-connect/token";
347
349
  },
348
350
  logout: function() {
349
- return y() + "/protocol/openid-connect/logout";
351
+ return b() + "/protocol/openid-connect/logout";
350
352
  },
351
353
  checkSessionIframe: function() {
352
- return y() + "/protocol/openid-connect/login-status-iframe.html";
354
+ return b() + "/protocol/openid-connect/login-status-iframe.html";
353
355
  },
354
356
  thirdPartyCookiesIframe: function() {
355
- return y() + "/protocol/openid-connect/3p-cookies/step1.html";
357
+ return b() + "/protocol/openid-connect/3p-cookies/step1.html";
356
358
  },
357
359
  register: function() {
358
- return y() + "/protocol/openid-connect/registrations";
360
+ return b() + "/protocol/openid-connect/registrations";
359
361
  },
360
362
  userinfo: function() {
361
- return y() + "/protocol/openid-connect/userinfo";
363
+ return b() + "/protocol/openid-connect/userinfo";
362
364
  }
363
365
  };
364
366
  }
@@ -366,24 +368,24 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
366
368
  var i = new XMLHttpRequest();
367
369
  i.open("GET", t, !0), i.setRequestHeader("Accept", "application/json"), i.onreadystatechange = function() {
368
370
  if (i.readyState == 4)
369
- if (i.status == 200 || O(i)) {
371
+ if (i.status == 200 || F(i)) {
370
372
  var n = JSON.parse(i.responseText);
371
373
  e.authServerUrl = n["auth-server-url"], e.realm = n.realm, e.clientId = n.resource, s(null), r.setSuccess();
372
374
  } else
373
375
  r.setError();
374
376
  }, i.send();
375
377
  } else {
376
- e.clientId = f.clientId;
377
- var a = f.oidcProvider;
378
+ e.clientId = d.clientId;
379
+ var a = d.oidcProvider;
378
380
  if (!a)
379
- e.authServerUrl = f.url, e.realm = f.realm, s(null), r.setSuccess();
381
+ e.authServerUrl = d.url, e.realm = d.realm, s(null), r.setSuccess();
380
382
  else if (typeof a == "string") {
381
383
  var c;
382
384
  a.charAt(a.length - 1) == "/" ? c = a + ".well-known/openid-configuration" : c = a + "/.well-known/openid-configuration";
383
385
  var i = new XMLHttpRequest();
384
386
  i.open("GET", c, !0), i.setRequestHeader("Accept", "application/json"), i.onreadystatechange = function() {
385
387
  if (i.readyState == 4)
386
- if (i.status == 200 || O(i)) {
388
+ if (i.status == 200 || F(i)) {
387
389
  var o = JSON.parse(i.responseText);
388
390
  s(o), r.setSuccess();
389
391
  } else
@@ -394,31 +396,31 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
394
396
  }
395
397
  return r.promise;
396
398
  }
397
- function O(r) {
399
+ function F(r) {
398
400
  return r.status == 0 && r.responseText && r.responseURL.startsWith("file:");
399
401
  }
400
- function A(r, t, s, i) {
401
- if (e.tokenTimeoutHandle && (clearTimeout(e.tokenTimeoutHandle), e.tokenTimeoutHandle = null), t ? (e.refreshToken = t, e.refreshTokenParsed = j(t)) : (delete e.refreshToken, delete e.refreshTokenParsed), s ? (e.idToken = s, e.idTokenParsed = j(s)) : (delete e.idToken, delete e.idTokenParsed), r) {
402
- if (e.token = r, e.tokenParsed = j(r), e.sessionId = e.tokenParsed.sid, e.authenticated = !0, e.subject = e.tokenParsed.sub, e.realmAccess = e.tokenParsed.realm_access, e.resourceAccess = e.tokenParsed.resource_access, i && (e.timeSkew = Math.floor(i / 1e3) - e.tokenParsed.iat), e.timeSkew != null && (_("[KEYCLOAK] Estimated time difference between browser and server is " + e.timeSkew + " seconds"), e.onTokenExpired)) {
402
+ function C(r, t, s, i) {
403
+ if (e.tokenTimeoutHandle && (clearTimeout(e.tokenTimeoutHandle), e.tokenTimeoutHandle = null), t ? (e.refreshToken = t, e.refreshTokenParsed = V(t)) : (delete e.refreshToken, delete e.refreshTokenParsed), s ? (e.idToken = s, e.idTokenParsed = V(s)) : (delete e.idToken, delete e.idTokenParsed), r) {
404
+ if (e.token = r, e.tokenParsed = V(r), e.sessionId = e.tokenParsed.sid, e.authenticated = !0, e.subject = e.tokenParsed.sub, e.realmAccess = e.tokenParsed.realm_access, e.resourceAccess = e.tokenParsed.resource_access, i && (e.timeSkew = Math.floor(i / 1e3) - e.tokenParsed.iat), e.timeSkew != null && (I("[KEYCLOAK] Estimated time difference between browser and server is " + e.timeSkew + " seconds"), e.onTokenExpired)) {
403
405
  var a = (e.tokenParsed.exp - (/* @__PURE__ */ new Date()).getTime() / 1e3 + e.timeSkew) * 1e3;
404
- _("[KEYCLOAK] Token expires in " + Math.round(a / 1e3) + " s"), a <= 0 ? e.onTokenExpired() : e.tokenTimeoutHandle = setTimeout(e.onTokenExpired, a);
406
+ I("[KEYCLOAK] Token expires in " + Math.round(a / 1e3) + " s"), a <= 0 ? e.onTokenExpired() : e.tokenTimeoutHandle = setTimeout(e.onTokenExpired, a);
405
407
  }
406
408
  } else
407
409
  delete e.token, delete e.tokenParsed, delete e.subject, delete e.realmAccess, delete e.resourceAccess, e.authenticated = !1;
408
410
  }
409
- function J() {
411
+ function Y() {
410
412
  if (typeof crypto > "u" || typeof crypto.randomUUID > "u")
411
413
  throw new Error("Web Crypto API is not available.");
412
414
  return crypto.randomUUID();
413
415
  }
414
- function T(r) {
415
- var t = Z(r);
416
+ function E(r) {
417
+ var t = ne(r);
416
418
  if (t) {
417
- var s = U.get(t.state);
419
+ var s = _.get(t.state);
418
420
  return s && (t.valid = !0, t.redirectUri = s.redirectUri, t.storedNonce = s.nonce, t.prompt = s.prompt, t.pkceCodeVerifier = s.pkceCodeVerifier, t.loginOptions = s.loginOptions), t;
419
421
  }
420
422
  }
421
- function Z(r) {
423
+ function ne(r) {
422
424
  var t;
423
425
  switch (e.flow) {
424
426
  case "standard":
@@ -433,7 +435,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
433
435
  }
434
436
  t.push("error"), t.push("error_description"), t.push("error_uri");
435
437
  var s = r.indexOf("?"), i = r.indexOf("#"), a, c;
436
- if (e.responseMode === "query" && s !== -1 ? (a = r.substring(0, s), c = V(r.substring(s + 1, i !== -1 ? i : r.length), t), c.paramsString !== "" && (a += "?" + c.paramsString), i !== -1 && (a += r.substring(i))) : e.responseMode === "fragment" && i !== -1 && (a = r.substring(0, i), c = V(r.substring(i + 1), t), c.paramsString !== "" && (a += "#" + c.paramsString)), c && c.oauthParams) {
438
+ if (e.responseMode === "query" && s !== -1 ? (a = r.substring(0, s), c = G(r.substring(s + 1, i !== -1 ? i : r.length), t), c.paramsString !== "" && (a += "?" + c.paramsString), i !== -1 && (a += r.substring(i))) : e.responseMode === "fragment" && i !== -1 && (a = r.substring(0, i), c = G(r.substring(i + 1), t), c.paramsString !== "" && (a += "#" + c.paramsString)), c && c.oauthParams) {
437
439
  if (e.flow === "standard" || e.flow === "hybrid") {
438
440
  if ((c.oauthParams.code || c.oauthParams.error) && c.oauthParams.state)
439
441
  return c.oauthParams.newUrl = a, c.oauthParams;
@@ -441,7 +443,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
441
443
  return c.oauthParams.newUrl = a, c.oauthParams;
442
444
  }
443
445
  }
444
- function V(r, t) {
446
+ function G(r, t) {
445
447
  for (var s = r.split("&"), i = {
446
448
  paramsString: "",
447
449
  oauthParams: {}
@@ -464,7 +466,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
464
466
  r.resolve = t, r.reject = s;
465
467
  }), r;
466
468
  }
467
- function ee(r, t, s) {
469
+ function oe(r, t, s) {
468
470
  var i = null, a = new Promise(function(c, n) {
469
471
  i = setTimeout(function() {
470
472
  n({ error: s });
@@ -474,21 +476,21 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
474
476
  clearTimeout(i);
475
477
  });
476
478
  }
477
- function P() {
479
+ function K() {
478
480
  var r = g();
479
- if (!p.enable || p.iframe)
481
+ if (!h.enable || h.iframe)
480
482
  return r.setSuccess(), r.promise;
481
483
  var t = document.createElement("iframe");
482
- p.iframe = t, t.onload = function() {
484
+ h.iframe = t, t.onload = function() {
483
485
  var a = e.endpoints.authorize();
484
- a.charAt(0) === "/" ? p.iframeOrigin = $() : p.iframeOrigin = a.substring(0, a.indexOf("/", 8)), r.setSuccess();
486
+ a.charAt(0) === "/" ? h.iframeOrigin = re() : h.iframeOrigin = a.substring(0, a.indexOf("/", 8)), r.setSuccess();
485
487
  };
486
488
  var s = e.endpoints.checkSessionIframe();
487
489
  t.setAttribute("src", s), t.setAttribute("sandbox", "allow-storage-access-by-user-activation allow-scripts allow-same-origin"), t.setAttribute("title", "keycloak-session-iframe"), t.style.display = "none", document.body.appendChild(t);
488
490
  var i = function(a) {
489
- if (!(a.origin !== p.iframeOrigin || p.iframe.contentWindow !== a.source) && (a.data == "unchanged" || a.data == "changed" || a.data == "error")) {
491
+ if (!(a.origin !== h.iframeOrigin || h.iframe.contentWindow !== a.source) && (a.data == "unchanged" || a.data == "changed" || a.data == "error")) {
490
492
  a.data != "unchanged" && e.clearToken();
491
- for (var c = p.callbackList.splice(0, p.callbackList.length), n = c.length - 1; n >= 0; --n) {
493
+ for (var c = h.callbackList.splice(0, h.callbackList.length), n = c.length - 1; n >= 0; --n) {
492
494
  var o = c[n];
493
495
  a.data == "error" ? o.setError() : o.setSuccess(a.data == "unchanged");
494
496
  }
@@ -496,45 +498,45 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
496
498
  };
497
499
  return window.addEventListener("message", i, !1), r.promise;
498
500
  }
499
- function M() {
500
- p.enable && e.token && setTimeout(function() {
501
- C().then(function(r) {
502
- r && M();
501
+ function H() {
502
+ h.enable && e.token && setTimeout(function() {
503
+ L().then(function(r) {
504
+ r && H();
503
505
  });
504
- }, p.interval * 1e3);
506
+ }, h.interval * 1e3);
505
507
  }
506
- function C() {
508
+ function L() {
507
509
  var r = g();
508
- if (p.iframe && p.iframeOrigin) {
510
+ if (h.iframe && h.iframeOrigin) {
509
511
  var t = e.clientId + " " + (e.sessionId ? e.sessionId : "");
510
- p.callbackList.push(r);
511
- var s = p.iframeOrigin;
512
- p.callbackList.length == 1 && p.iframe.contentWindow.postMessage(t, s);
512
+ h.callbackList.push(r);
513
+ var s = h.iframeOrigin;
514
+ h.callbackList.length == 1 && h.iframe.contentWindow.postMessage(t, s);
513
515
  } else
514
516
  r.setSuccess();
515
517
  return r.promise;
516
518
  }
517
- function re() {
519
+ function ae() {
518
520
  var r = g();
519
- if ((p.enable || e.silentCheckSsoRedirectUri) && typeof e.endpoints.thirdPartyCookiesIframe == "function") {
521
+ if ((h.enable || e.silentCheckSsoRedirectUri) && typeof e.endpoints.thirdPartyCookiesIframe == "function") {
520
522
  var t = document.createElement("iframe");
521
523
  t.setAttribute("src", e.endpoints.thirdPartyCookiesIframe()), t.setAttribute("sandbox", "allow-storage-access-by-user-activation allow-scripts allow-same-origin"), t.setAttribute("title", "keycloak-3p-check-iframe"), t.style.display = "none", document.body.appendChild(t);
522
524
  var s = function(i) {
523
- t.contentWindow === i.source && (i.data !== "supported" && i.data !== "unsupported" || (i.data === "unsupported" && (x(
525
+ t.contentWindow === i.source && (i.data !== "supported" && i.data !== "unsupported" || (i.data === "unsupported" && (M(
524
526
  `[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:
525
527
 
526
528
  - It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).
527
529
  - It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).
528
530
 
529
531
  For more information see: https://www.keycloak.org/securing-apps/javascript-adapter#_modern_browsers`
530
- ), p.enable = !1, e.silentCheckSsoFallback && (e.silentCheckSsoRedirectUri = !1)), document.body.removeChild(t), window.removeEventListener("message", s), r.setSuccess()));
532
+ ), h.enable = !1, e.silentCheckSsoFallback && (e.silentCheckSsoRedirectUri = !1)), document.body.removeChild(t), window.removeEventListener("message", s), r.setSuccess()));
531
533
  };
532
534
  window.addEventListener("message", s, !1);
533
535
  } else
534
536
  r.setSuccess();
535
- return ee(r.promise, e.messageReceiveTimeout, "Timeout when waiting for 3rd party check iframe message.");
537
+ return oe(r.promise, e.messageReceiveTimeout, "Timeout when waiting for 3rd party check iframe message.");
536
538
  }
537
- function K(r) {
539
+ function N(r) {
538
540
  if (!r || r == "default")
539
541
  return {
540
542
  login: async function(n) {
@@ -547,12 +549,12 @@ For more information see: https://www.keycloak.org/securing-apps/javascript-adap
547
549
  }
548
550
  const l = document.createElement("form");
549
551
  l.setAttribute("method", "POST"), l.setAttribute("action", e.createLogoutUrl(n)), l.style.display = "none";
550
- const d = {
552
+ const f = {
551
553
  id_token_hint: e.idToken,
552
554
  client_id: e.clientId,
553
- post_logout_redirect_uri: h.redirectUri(n, !1)
555
+ post_logout_redirect_uri: p.redirectUri(n, !1)
554
556
  };
555
- for (const [u, m] of Object.entries(d)) {
557
+ for (const [u, m] of Object.entries(f)) {
556
558
  const w = document.createElement("input");
557
559
  w.setAttribute("type", "hidden"), w.setAttribute("name", u), w.setAttribute("value", m), l.appendChild(w);
558
560
  }
@@ -574,7 +576,7 @@ For more information see: https://www.keycloak.org/securing-apps/javascript-adap
574
576
  }
575
577
  };
576
578
  if (r == "cordova") {
577
- p.enable = !1;
579
+ h.enable = !1;
578
580
  var t = function(n, o, l) {
579
581
  return window.cordova && window.cordova.InAppBrowser ? window.cordova.InAppBrowser.open(n, o, l) : window.open(n, o, l);
580
582
  }, s = function(n) {
@@ -593,44 +595,44 @@ For more information see: https://www.keycloak.org/securing-apps/javascript-adap
593
595
  };
594
596
  return {
595
597
  login: async function(n) {
596
- var o = g(), l = a(n), d = await e.createLoginUrl(n), u = t(d, "_blank", l), m = !1, w = !1, S = function() {
598
+ var o = g(), l = a(n), f = await e.createLoginUrl(n), u = t(f, "_blank", l), m = !1, w = !1, S = function() {
597
599
  w = !0, u.close();
598
600
  };
599
- return u.addEventListener("loadstart", function(b) {
600
- if (b.url.indexOf(c()) == 0) {
601
- var D = T(b.url);
602
- I(D, o), S(), m = !0;
601
+ return u.addEventListener("loadstart", function(y) {
602
+ if (y.url.indexOf(c()) == 0) {
603
+ var z = E(y.url);
604
+ T(z, o), S(), m = !0;
603
605
  }
604
- }), u.addEventListener("loaderror", function(b) {
606
+ }), u.addEventListener("loaderror", function(y) {
605
607
  if (!m)
606
- if (b.url.indexOf(c()) == 0) {
607
- var D = T(b.url);
608
- I(D, o), S(), m = !0;
608
+ if (y.url.indexOf(c()) == 0) {
609
+ var z = E(y.url);
610
+ T(z, o), S(), m = !0;
609
611
  } else
610
612
  o.setError(), S();
611
- }), u.addEventListener("exit", function(b) {
613
+ }), u.addEventListener("exit", function(y) {
612
614
  w || o.setError({
613
615
  reason: "closed_by_user"
614
616
  });
615
617
  }), o.promise;
616
618
  },
617
619
  logout: function(n) {
618
- var o = g(), l = e.createLogoutUrl(n), d = t(l, "_blank", "location=no,hidden=yes,clearcache=yes"), u;
619
- return d.addEventListener("loadstart", function(m) {
620
- m.url.indexOf(c()) == 0 && d.close();
621
- }), d.addEventListener("loaderror", function(m) {
622
- m.url.indexOf(c()) == 0 || (u = !0), d.close();
623
- }), d.addEventListener("exit", function(m) {
620
+ var o = g(), l = e.createLogoutUrl(n), f = t(l, "_blank", "location=no,hidden=yes,clearcache=yes"), u;
621
+ return f.addEventListener("loadstart", function(m) {
622
+ m.url.indexOf(c()) == 0 && f.close();
623
+ }), f.addEventListener("loaderror", function(m) {
624
+ m.url.indexOf(c()) == 0 || (u = !0), f.close();
625
+ }), f.addEventListener("exit", function(m) {
624
626
  u ? o.setError() : (e.clearToken(), o.setSuccess());
625
627
  }), o.promise;
626
628
  },
627
629
  register: async function(n) {
628
- var o = g(), l = await e.createRegisterUrl(), d = a(n), u = t(l, "_blank", d);
630
+ var o = g(), l = await e.createRegisterUrl(), f = a(n), u = t(l, "_blank", f);
629
631
  return u.addEventListener("loadstart", function(m) {
630
632
  if (m.url.indexOf(c()) == 0) {
631
633
  u.close();
632
- var w = T(m.url);
633
- I(w, o);
634
+ var w = E(m.url);
635
+ T(w, o);
634
636
  }
635
637
  }), o.promise;
636
638
  },
@@ -650,27 +652,27 @@ For more information see: https://www.keycloak.org/securing-apps/javascript-adap
650
652
  };
651
653
  }
652
654
  if (r == "cordova-native")
653
- return p.enable = !1, {
655
+ return h.enable = !1, {
654
656
  login: async function(n) {
655
657
  var o = g(), l = await e.createLoginUrl(n);
656
- return universalLinks.subscribe("keycloak", function(d) {
658
+ return universalLinks.subscribe("keycloak", function(f) {
657
659
  universalLinks.unsubscribe("keycloak"), window.cordova.plugins.browsertab.close();
658
- var u = T(d.url);
659
- I(u, o);
660
+ var u = E(f.url);
661
+ T(u, o);
660
662
  }), window.cordova.plugins.browsertab.openUrl(l), o.promise;
661
663
  },
662
664
  logout: function(n) {
663
665
  var o = g(), l = e.createLogoutUrl(n);
664
- return universalLinks.subscribe("keycloak", function(d) {
666
+ return universalLinks.subscribe("keycloak", function(f) {
665
667
  universalLinks.unsubscribe("keycloak"), window.cordova.plugins.browsertab.close(), e.clearToken(), o.setSuccess();
666
668
  }), window.cordova.plugins.browsertab.openUrl(l), o.promise;
667
669
  },
668
670
  register: async function(n) {
669
671
  var o = g(), l = await e.createRegisterUrl(n);
670
- return universalLinks.subscribe("keycloak", function(d) {
672
+ return universalLinks.subscribe("keycloak", function(f) {
671
673
  universalLinks.unsubscribe("keycloak"), window.cordova.plugins.browsertab.close();
672
- var u = T(d.url);
673
- I(u, o);
674
+ var u = E(f.url);
675
+ T(u, o);
674
676
  }), window.cordova.plugins.browsertab.openUrl(l), o.promise;
675
677
  },
676
678
  accountManagement: function() {
@@ -686,10 +688,10 @@ For more information see: https://www.keycloak.org/securing-apps/javascript-adap
686
688
  };
687
689
  throw "invalid adapter type: " + r;
688
690
  }
689
- const E = "kc-callback-";
690
- var H = function() {
691
- if (!(this instanceof H))
692
- return new H();
691
+ const A = "kc-callback-";
692
+ var D = function() {
693
+ if (!(this instanceof D))
694
+ return new D();
693
695
  localStorage.setItem("kc-test", "test"), localStorage.removeItem("kc-test");
694
696
  var r = this;
695
697
  function t() {
@@ -704,7 +706,7 @@ For more information see: https://www.keycloak.org/securing-apps/javascript-adap
704
706
  localStorage.removeItem(c);
705
707
  }
706
708
  function i() {
707
- return Object.entries(localStorage).filter(([c]) => c.startsWith(E));
709
+ return Object.entries(localStorage).filter(([c]) => c.startsWith(A));
708
710
  }
709
711
  function a(c) {
710
712
  let n;
@@ -713,16 +715,16 @@ For more information see: https://www.keycloak.org/securing-apps/javascript-adap
713
715
  } catch {
714
716
  return null;
715
717
  }
716
- return z(n) && "expires" in n && typeof n.expires == "number" ? n.expires : null;
718
+ return O(n) && "expires" in n && typeof n.expires == "number" ? n.expires : null;
717
719
  }
718
720
  r.get = function(c) {
719
721
  if (c) {
720
- var n = E + c, o = localStorage.getItem(n);
722
+ var n = A + c, o = localStorage.getItem(n);
721
723
  return o && (localStorage.removeItem(n), o = JSON.parse(o)), t(), o;
722
724
  }
723
725
  }, r.add = function(c) {
724
726
  t();
725
- const n = E + c.state, o = JSON.stringify({
727
+ const n = A + c.state, o = JSON.stringify({
726
728
  ...c,
727
729
  // Set the expiry time to 1 hour from now.
728
730
  expires: Date.now() + 60 * 60 * 1e3
@@ -733,18 +735,18 @@ For more information see: https://www.keycloak.org/securing-apps/javascript-adap
733
735
  s(), localStorage.setItem(n, o);
734
736
  }
735
737
  };
736
- }, N = function() {
737
- if (!(this instanceof N))
738
- return new N();
738
+ }, j = function() {
739
+ if (!(this instanceof j))
740
+ return new j();
739
741
  var r = this;
740
742
  r.get = function(a) {
741
743
  if (a) {
742
- var c = s(E + a);
743
- if (i(E + a, "", t(-100)), c)
744
+ var c = s(A + a);
745
+ if (i(A + a, "", t(-100)), c)
744
746
  return JSON.parse(c);
745
747
  }
746
748
  }, r.add = function(a) {
747
- i(E + a.state, JSON.stringify(a), t(60));
749
+ i(A + a.state, JSON.stringify(a), t(60));
748
750
  }, r.removeItem = function(a) {
749
751
  i(a, "", t(-100));
750
752
  };
@@ -764,47 +766,47 @@ For more information see: https://www.keycloak.org/securing-apps/javascript-adap
764
766
  document.cookie = o;
765
767
  };
766
768
  };
767
- function te() {
769
+ function ie() {
768
770
  try {
769
- return new H();
771
+ return new D();
770
772
  } catch {
771
773
  }
772
- return new N();
774
+ return new j();
773
775
  }
774
- function F(r) {
776
+ function W(r) {
775
777
  return function() {
776
778
  e.enableLogging && r.apply(console, Array.prototype.slice.call(arguments));
777
779
  };
778
780
  }
779
781
  }
780
- function ne(f) {
781
- const e = String.fromCodePoint(...f);
782
+ function ce(d) {
783
+ const e = String.fromCodePoint(...d);
782
784
  return btoa(e);
783
785
  }
784
- async function oe(f) {
785
- const h = new TextEncoder().encode(f);
786
+ async function le(d) {
787
+ const p = new TextEncoder().encode(d);
786
788
  if (typeof crypto > "u" || typeof crypto.subtle > "u")
787
789
  throw new Error("Web Crypto API is not available.");
788
- return await crypto.subtle.digest("SHA-256", h);
790
+ return await crypto.subtle.digest("SHA-256", p);
789
791
  }
790
- function j(f) {
791
- const [e, h] = f.split(".");
792
- if (typeof h != "string")
792
+ function V(d) {
793
+ const [e, p] = d.split(".");
794
+ if (typeof p != "string")
793
795
  throw new Error("Unable to decode token, payload not found.");
794
796
  let v;
795
797
  try {
796
- v = ae(h);
797
- } catch (U) {
798
- throw new Error("Unable to decode token, payload is not a valid Base64URL value.", { cause: U });
798
+ v = ue(p);
799
+ } catch (_) {
800
+ throw new Error("Unable to decode token, payload is not a valid Base64URL value.", { cause: _ });
799
801
  }
800
802
  try {
801
803
  return JSON.parse(v);
802
- } catch (U) {
803
- throw new Error("Unable to decode token, payload is not a valid JSON value.", { cause: U });
804
+ } catch (_) {
805
+ throw new Error("Unable to decode token, payload is not a valid JSON value.", { cause: _ });
804
806
  }
805
807
  }
806
- function ae(f) {
807
- let e = f.replaceAll("-", "+").replaceAll("_", "/");
808
+ function ue(d) {
809
+ let e = d.replaceAll("-", "+").replaceAll("_", "/");
808
810
  switch (e.length % 4) {
809
811
  case 0:
810
812
  break;
@@ -818,33 +820,33 @@ function ae(f) {
818
820
  throw new Error("Input is not of the correct length.");
819
821
  }
820
822
  try {
821
- return ie(e);
823
+ return de(e);
822
824
  } catch {
823
825
  return atob(e);
824
826
  }
825
827
  }
826
- function ie(f) {
827
- return decodeURIComponent(atob(f).replace(/(.)/g, (e, h) => {
828
- let v = h.charCodeAt(0).toString(16).toUpperCase();
828
+ function de(d) {
829
+ return decodeURIComponent(atob(d).replace(/(.)/g, (e, p) => {
830
+ let v = p.charCodeAt(0).toString(16).toUpperCase();
829
831
  return v.length < 2 && (v = "0" + v), "%" + v;
830
832
  }));
831
833
  }
832
- function z(f) {
833
- return typeof f == "object" && f !== null;
834
+ function O(d) {
835
+ return typeof d == "object" && d !== null;
834
836
  }
835
- let k = null, L = null;
836
- function se(f, e = !0) {
837
- return L ? (console.log("Keycloak already initialized, returning from cache"), L) : (k || (k = new Y({
838
- url: f.url,
839
- realm: f.realm,
840
- clientId: f.clientId
841
- })), L = k.init({
837
+ let k = null, x = null;
838
+ function fe(d, e = !0) {
839
+ return x ? (console.log("Keycloak already initialized, returning from cache"), x) : (k || (k = new q({
840
+ url: d.url,
841
+ realm: d.realm,
842
+ clientId: d.clientId
843
+ })), x = k.init({
842
844
  onLoad: e ? "check-sso" : "login-required",
843
845
  checkLoginIframe: !1
844
846
  //silentCheckSsoRedirectUri: `${window.location.origin}/silent-check-sso.html`, // Ensure this file is set up
845
- }).then((h) => h).catch((h) => (console.error("Failed to initialize Keycloak:", h), !1)), L);
847
+ }).then((p) => p).catch((p) => (console.error("Failed to initialize Keycloak:", p), !1)), x);
846
848
  }
847
- function ce() {
849
+ function he() {
848
850
  return k != null && k.authenticated && (k != null && k.idTokenParsed) ? {
849
851
  fullname: k.idTokenParsed.name,
850
852
  email: k.idTokenParsed.email,
@@ -857,34 +859,110 @@ function ce() {
857
859
  sub: k.idTokenParsed.sub
858
860
  } : {};
859
861
  }
860
- function le() {
862
+ function pe() {
861
863
  if (k)
862
864
  k.login();
863
865
  else
864
866
  throw new Error("Keycloak is not initialized.");
865
867
  }
866
- function ue() {
868
+ function me() {
867
869
  if (k)
868
870
  k.logout();
869
871
  else
870
872
  throw new Error("Keycloak is not initialized.");
871
873
  }
872
- function de() {
874
+ function ke() {
873
875
  return !!(k != null && k.authenticated);
874
876
  }
875
- async function fe(f) {
877
+ async function ge(d) {
876
878
  try {
877
- const e = await fetch(f, { method: "HEAD", mode: "no-cors" });
879
+ const e = await fetch(d, { method: "HEAD", mode: "no-cors" });
878
880
  return e.ok || e.type === "opaque";
879
881
  } catch {
880
882
  return !1;
881
883
  }
882
884
  }
885
+ const Ue = class {
886
+ constructor(d) {
887
+ X(this, d), this.keycloak = J(this, "keycloak", 7), this.auth = J(this, "auth", 7), this.handleLogin = async () => {
888
+ if (!this.authenticated)
889
+ try {
890
+ await pe();
891
+ } catch (e) {
892
+ R.show(e.message, "error");
893
+ }
894
+ }, this.handleLogout = async () => {
895
+ try {
896
+ await me();
897
+ } catch (e) {
898
+ R.show(e.message, "error");
899
+ }
900
+ this.authenticated = !1, this.user = null;
901
+ }, this.keycloakUrl = void 0, this.keycloakRealm = void 0, this.keycloakClientId = void 0, this.authenticated = !1, this.user = null, this.serverAvailable = !1;
902
+ }
903
+ /**
904
+ * Lifecycle method that runs when the component is about to load.
905
+ * It initializes authentication by calling the `initAuth` method.
906
+ */
907
+ async componentWillLoad() {
908
+ if (!this.keycloakUrl || !this.keycloakRealm || !this.keycloakClientId) {
909
+ console.error("Keycloak configuration props are missing.");
910
+ return;
911
+ }
912
+ if (this.serverAvailable = await ge(`${this.keycloakUrl}/realms/${this.keycloakRealm}`), !this.serverAvailable) {
913
+ R.show("Keycloak server is unavailable.", "error");
914
+ return;
915
+ }
916
+ await this.initAuth();
917
+ }
918
+ /**
919
+ * Initializes the Keycloak authentication by configuring Keycloak with the provided props.
920
+ * Sets the `authenticated` state and `user` data if the user is authenticated.
921
+ * Emits `authStatusChanged` event with the authentication status.
922
+ */
923
+ async initAuth() {
924
+ try {
925
+ const d = await fe({
926
+ url: this.keycloakUrl,
927
+ realm: this.keycloakRealm,
928
+ clientId: this.keycloakClientId
929
+ }, !0);
930
+ this.keycloak.emit({
931
+ init: d
932
+ }), ke() && (this.user = he(), this.authenticated = !0, this.auth.emit({
933
+ authenticated: this.authenticated,
934
+ user: this.user
935
+ }));
936
+ } catch (d) {
937
+ R.show(d.message, "error");
938
+ }
939
+ }
940
+ render() {
941
+ return U("div", { key: "074566b791eeb9ea4a0558b4ed83a96e4b673356", class: "block" }, !this.authenticated && U("eds-button", { key: "3a05ff97a90d73204eb77c5dad0d328294d72d3e", label: "Login", intent: "primary", "extra-class": "text-default", "aria-label": "Login", triggerClick: this.handleLogin.bind(this) }));
942
+ }
943
+ }, ve = ".splash-overlay{position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:9999999;background-color:var(--grey-200);display:flex;flex-direction:column;align-items:center;justify-content:center}.logo-container{width:200px;height:200px;margin-bottom:1rem}.content-container{position:relative;width:5rem;height:5rem;display:flex;align-items:center;justify-content:center}", we = ve, ye = class {
944
+ constructor(d) {
945
+ X(this, d), this.splash = J(this, "splash", 7), this.inverse = !1, this.initPromise = void 0, this.isVisible = !0;
946
+ }
947
+ componentWillLoad() {
948
+ this.initPromise && this.initPromise.then(() => {
949
+ console.log("Promises resolved"), this.hideSplash();
950
+ }).catch((d) => {
951
+ console.error("Initialization error:", d), this.splash.emit({ type: "error", message: d.message || "Unknown error" });
952
+ });
953
+ }
954
+ handleHideSplash() {
955
+ this.hideSplash();
956
+ }
957
+ hideSplash() {
958
+ this.isVisible = !1, this.splash.emit({ type: "hidden", message: "Splash screen hidden successfully" });
959
+ }
960
+ render() {
961
+ return this.isVisible ? U(se, null, U("div", { class: "splash-overlay", style: { background: this.inverse ? "black" : "var(--grey-200)" } }, U("div", { class: "logo-container" }, this.inverse ? U("eds-logo", { orientation: "vertical", type: "color-white" }) : U("eds-logo", { orientation: "vertical", type: "color" })), U("div", { class: "content-container" }, U("eds-spinner", { size: "1rem", thickness: "3px", "border-color": "var(--grey-400)", "bottom-color": "var(--grey-900)", background: "none", fullscreen: !1 })))) : null;
962
+ }
963
+ };
964
+ ye.style = we;
883
965
  export {
884
- ue as a,
885
- de as b,
886
- fe as c,
887
- ce as g,
888
- se as i,
889
- le as l
966
+ Ue as eds_login,
967
+ ye as eds_splash_screen
890
968
  };