@ebrains/vue 0.4.0-alpha.0 → 0.5.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 (210) hide show
  1. package/analytics-1cde8e4a-BDRcCMlV.mjs +24 -0
  2. package/analytics-1cde8e4a-B_MD-9qW.js +1 -0
  3. package/color-2554aad6-CCcV5UJZ.mjs +131 -0
  4. package/color-2554aad6-D1hFGX4H.js +1 -0
  5. package/{color-primary-palette_6.entry-CSDWEKLH.mjs → color-primary-palette_6.entry-CgeStD0V.mjs} +21 -21
  6. package/color-primary-palette_6.entry-c_K7930i.js +1 -0
  7. package/correct-use-of-colors.entry-De5Tcxdm.mjs +59 -0
  8. package/correct-use-of-colors.entry-DpmXW_CD.js +1 -0
  9. package/eds-accordion.entry-B8TjhnWX.mjs +49 -0
  10. package/eds-accordion.entry-BySfMYU2.js +4 -0
  11. package/eds-alert_17.entry-BfpBSBVW.js +14999 -0
  12. package/eds-alert_17.entry-IJq6baZd.mjs +16075 -0
  13. package/eds-avatar_4.entry-B7CV7v_n.mjs +283 -0
  14. package/eds-avatar_4.entry-D1CDRW_R.js +149 -0
  15. package/eds-card-generic.entry-BhLK-nyp.js +1 -0
  16. package/eds-card-generic.entry-DIHPUjbI.mjs +63 -0
  17. package/{eds-card-project.entry-C3eyu1U0.mjs → eds-card-project.entry-C2dWgXXW.mjs} +12 -11
  18. package/eds-card-project.entry-CunHqbYK.js +1 -0
  19. package/{eds-card-section.entry-DU-1TB0I.js → eds-card-section.entry-0n2V-MH6.js} +1 -1
  20. package/{eds-card-section.entry-Dxk-Ob_Y.mjs → eds-card-section.entry-Ccjil38X.mjs} +4 -4
  21. package/eds-card-tags.entry-C6jjLiGA.mjs +13 -0
  22. package/{eds-card-tags.entry-YPPBWdFq.js → eds-card-tags.entry-CQS5AtAg.js} +1 -1
  23. package/{eds-card-tool.entry-1_RNWh8n.mjs → eds-card-tool.entry-Bi8w0xds.mjs} +7 -7
  24. package/eds-card-tool.entry-DJA23zJf.js +1 -0
  25. package/{eds-card-wrapper.entry-BfCDGeFs.js → eds-card-wrapper.entry-BKPCc7ci.js} +1 -1
  26. package/{eds-card-wrapper.entry-C4pNRjIj.mjs → eds-card-wrapper.entry-UPnkq2JI.mjs} +4 -4
  27. package/{eds-code-block.entry-B2xATQ7r.mjs → eds-code-block.entry-BZTLGjqq.mjs} +47 -47
  28. package/{eds-code-block.entry-DQEDpAjn.js → eds-code-block.entry-Ckb3jisn.js} +3 -3
  29. package/{eds-components-section.entry-D08woahG.js → eds-components-section.entry-B3WrdIfL.js} +45 -36
  30. package/{eds-components-section.entry-DR-984-3.mjs → eds-components-section.entry-D1ovrn93.mjs} +56 -37
  31. package/{eds-docs-palettes.entry-qKOj3XU9.js → eds-docs-palettes.entry-Bk77Xn04.js} +1 -1
  32. package/{eds-docs-palettes.entry-B0yU2ZpL.mjs → eds-docs-palettes.entry-lpT0ypSs.mjs} +2 -2
  33. package/{eds-docs-tokens.entry-BVHiM7cK.mjs → eds-docs-tokens.entry-Bi35zxEM.mjs} +2 -2
  34. package/{eds-docs-tokens.entry-BtRXzjrp.js → eds-docs-tokens.entry-DCHw-jrS.js} +1 -1
  35. package/eds-dropdown_2.entry-Bamjbo1o.mjs +115 -0
  36. package/eds-dropdown_2.entry-YEBzyKJu.js +1 -0
  37. package/eds-form.entry-a52cYx3b.js +7153 -0
  38. package/eds-form.entry-xm937wbh.mjs +7340 -0
  39. package/eds-frame.entry-BnT9nQwa.js +1 -0
  40. package/eds-frame.entry-CU7GoLj6.mjs +74 -0
  41. package/eds-icon-arrow-diagonal.entry-fzsCJiPP.js +1 -0
  42. package/eds-icon-arrow-diagonal.entry-kClkB8LF.mjs +13 -0
  43. package/eds-icon-arrow-right.entry-B75Ra6OD.js +1 -0
  44. package/eds-icon-arrow-right.entry-DX6A-VKL.mjs +13 -0
  45. package/{eds-icon-bluesky.entry-Dppj9cuC.js → eds-icon-bluesky.entry-7tzCZSoL.js} +1 -1
  46. package/eds-icon-bluesky.entry-BNSdVu2K.mjs +13 -0
  47. package/eds-icon-chevron-down.entry-BLvZ3e_N.mjs +13 -0
  48. package/{eds-icon-chevron-down.entry-CidjiGQS.js → eds-icon-chevron-down.entry-BUG6E9eR.js} +1 -1
  49. package/eds-icon-chevron-left.entry-BT-KYjSo.js +1 -0
  50. package/eds-icon-chevron-left.entry-Vq-R3b59.mjs +13 -0
  51. package/{eds-icon-chevron-right.entry-iy6d6tux.mjs → eds-icon-chevron-right.entry-B1qzmGrD.mjs} +2 -2
  52. package/eds-icon-chevron-right.entry-BmU_I0Y1.js +1 -0
  53. package/eds-icon-chevron-up.entry-DXXRgw1V.js +1 -0
  54. package/eds-icon-chevron-up.entry-DuySJU_i.mjs +13 -0
  55. package/eds-icon-close.entry-DDxUAr21.mjs +13 -0
  56. package/{eds-icon-close.entry-CE-Nory7.js → eds-icon-close.entry-DS7BLTzl.js} +1 -1
  57. package/eds-icon-copy.entry-DNa1wI4F.mjs +13 -0
  58. package/{eds-icon-copy.entry-Bpe3I5b6.js → eds-icon-copy.entry-Nz_P5A7p.js} +1 -1
  59. package/eds-icon-eu.entry-CLQcoimB.js +1 -0
  60. package/eds-icon-eu.entry-DTdf6Skc.mjs +13 -0
  61. package/eds-icon-facebook.entry-B9szoikj.mjs +13 -0
  62. package/eds-icon-facebook.entry-knUdck2t.js +1 -0
  63. package/eds-icon-gitlab.entry-IO7f4hgL.mjs +13 -0
  64. package/eds-icon-gitlab.entry-pKxaKA0B.js +1 -0
  65. package/{eds-icon-linkedin.entry-CstoPbTS.js → eds-icon-linkedin.entry-BD__kbDV.js} +1 -1
  66. package/eds-icon-linkedin.entry-CryUW1Er.mjs +13 -0
  67. package/{eds-icon-loader.entry-CaGFh0gM.js → eds-icon-loader.entry-B_3Sd6PB.js} +1 -1
  68. package/eds-icon-loader.entry-CxizdRT8.mjs +13 -0
  69. package/eds-icon-mastodon.entry-7152lwgd.js +1 -0
  70. package/eds-icon-mastodon.entry-MyM74vvm.mjs +13 -0
  71. package/eds-icon-menu.entry-5RRmRTxa.mjs +13 -0
  72. package/eds-icon-menu.entry-BVU8htgo.js +1 -0
  73. package/eds-icon-more.entry-KE6_EsAg.mjs +13 -0
  74. package/{eds-icon-more.entry-68jT9AEw.js → eds-icon-more.entry-lossstHZ.js} +1 -1
  75. package/eds-icon-search.entry-Dg0wabdP.mjs +13 -0
  76. package/eds-icon-search.entry-DiYaxnYX.js +1 -0
  77. package/{eds-icon-success.entry-CACuZjP6.js → eds-icon-success.entry-CRu9Ssdi.js} +1 -1
  78. package/eds-icon-success.entry-_fWfddhX.mjs +13 -0
  79. package/eds-icon-twitter.entry-B4xPE3Vz.js +1 -0
  80. package/eds-icon-twitter.entry-DHFpeStb.mjs +13 -0
  81. package/eds-icon-user.entry-BOv2lInW.mjs +13 -0
  82. package/eds-icon-user.entry-DkRLDrdp.js +1 -0
  83. package/eds-icon-youtube.entry-CRRGbDsw.mjs +13 -0
  84. package/eds-icon-youtube.entry-DL5fWU8k.js +1 -0
  85. package/eds-input_7.entry-BZ9afXqe.js +7167 -0
  86. package/eds-input_7.entry-WvoE_Mue.mjs +7373 -0
  87. package/eds-login.entry-BRWK6otG.js +1 -0
  88. package/eds-login.entry-C0eOhlEq.mjs +58 -0
  89. package/{eds-logo-variations.entry-CUD-M_Fd.js → eds-logo-variations.entry-BnB25dDH.js} +1 -1
  90. package/eds-logo-variations.entry-Cw44vuQE.mjs +22 -0
  91. package/eds-matomo-notice.entry-BpwE1vQ3.js +1 -0
  92. package/{eds-matomo-notice.entry-kSuLDx9K.mjs → eds-matomo-notice.entry-DsLbzeqQ.mjs} +2 -2
  93. package/eds-modal.entry-B9gXEOjT.js +1 -0
  94. package/eds-modal.entry-CCy9SRVR.mjs +84 -0
  95. package/{eds-navigator.entry-BJTqtqld.js → eds-navigator.entry-B9scz8p_.js} +1 -1
  96. package/{eds-navigator.entry-DdzcXSRW.mjs → eds-navigator.entry-Dk-4UW_d.mjs} +2 -2
  97. package/eds-pagination_2.entry-D_sngThL.js +1 -0
  98. package/{eds-pagination_2.entry-B5PLo2Uu.mjs → eds-pagination_2.entry-M3CLFGN_.mjs} +9 -9
  99. package/{eds-progress-bar.entry-DdqH0plT.mjs → eds-progress-bar.entry-BtI2_94Z.mjs} +5 -5
  100. package/{eds-progress-bar.entry-BBFsASiy.js → eds-progress-bar.entry-D56TNSGj.js} +1 -1
  101. package/{eds-section-core_2.entry-D_nLUa29.js → eds-section-core_2.entry-BmbK_RfT.js} +1 -1
  102. package/{eds-section-core_2.entry-D3HYngR_.mjs → eds-section-core_2.entry-pmUkAIz7.mjs} +6 -6
  103. package/{eds-svg-repository.entry-C-kayEdW.mjs → eds-svg-repository.entry-B3xCCFOp.mjs} +2 -2
  104. package/{eds-svg-repository.entry-in72TP_1.js → eds-svg-repository.entry-DZ1FMRrQ.js} +2 -2
  105. package/{eds-tab.entry-BKYSiEkl.mjs → eds-tab.entry-Bpv6R_M0.mjs} +2 -2
  106. package/{eds-tab.entry-BUzZWKac.js → eds-tab.entry-DjpVgaDN.js} +1 -1
  107. package/eds-tabs-content.entry-Bj5wNmkr.js +1 -0
  108. package/{eds-tabs-content.entry-3cyCQAth.mjs → eds-tabs-content.entry-CzwoLZzR.mjs} +4 -4
  109. package/{eds-tabs.entry-B8q09in2.mjs → eds-tabs.entry-BYBPkYRs.mjs} +5 -5
  110. package/eds-tabs.entry-Cbc9yhHL.js +1 -0
  111. package/{eds-timeline.entry-DEcov8mq.js → eds-timeline.entry-Bq-eo4Og.js} +1 -1
  112. package/{eds-timeline.entry-DhHSQScv.mjs → eds-timeline.entry-DJYcN7rN.mjs} +2 -2
  113. package/{eds-tooltip.entry-BTunlfGS.mjs → eds-tooltip.entry-CTCdKTKM.mjs} +3 -3
  114. package/eds-tooltip.entry-eiFlYpfl.js +1 -0
  115. package/{eds-trl.entry-Bt28XH55.mjs → eds-trl.entry-8BXrp9SK.mjs} +8 -8
  116. package/{eds-trl.entry-BHrlC_5O.js → eds-trl.entry-DtffM-e5.js} +1 -1
  117. package/eds-user.entry-DfBE6LuF.js +1 -0
  118. package/eds-user.entry-ybggwcts.mjs +66 -0
  119. package/eds-vertical-stepper.entry-DpcwvOst.mjs +27 -0
  120. package/eds-vertical-stepper.entry-O_GJNo8B.js +1 -0
  121. package/generated/components.d.ts +3 -0
  122. package/incorrect-use-of-colors.entry-CDHLoNBa.js +1 -0
  123. package/incorrect-use-of-colors.entry-DbwiJCH0.mjs +42 -0
  124. package/{index-I5Asbjce.mjs → index-C-Gy1Lax.mjs} +555 -497
  125. package/index-D_kZU_4I.js +21 -0
  126. package/index.js +1 -1
  127. package/index.mjs +30 -27
  128. package/{keycloak-13893af6-BLzE1H6E.mjs → keycloak-d502ec16-Ce0iGqyk.mjs} +259 -247
  129. package/keycloak-d502ec16-m7LwS-Gh.js +9 -0
  130. package/{logo-space.entry-DsM5jXgX.js → logo-space.entry-D56IaLNE.js} +1 -1
  131. package/{logo-space.entry-GnVq-srD.mjs → logo-space.entry-DERJLkyL.mjs} +7 -7
  132. package/logo-variations-horizontal_2.entry-OY3Zka_7.js +7 -0
  133. package/logo-variations-horizontal_2.entry-wp9D1MMl.mjs +29 -0
  134. package/logo-wrong-usage.entry-BniBpQrN.js +1 -0
  135. package/logo-wrong-usage.entry-RgKFDObE.mjs +14 -0
  136. package/package.json +1 -1
  137. package/{token-list_3.entry-DaIOT7_R.js → token-list_3.entry-C0Tohj1W.js} +1 -1
  138. package/{token-list_3.entry-CReCwFzO.mjs → token-list_3.entry-Zgzwbhio.mjs} +4 -4
  139. package/{token-ratios.entry-Dh8kvz8R.mjs → token-ratios.entry-B7ZwRluK.mjs} +2 -2
  140. package/token-ratios.entry-bO5CkZ9D.js +1 -0
  141. package/token-spacing.entry-BTYazF9c.js +1 -0
  142. package/token-spacing.entry-_yyMlwbO.mjs +12 -0
  143. package/{token-typography.entry-DG-4k5gY.js → token-typography.entry-D-PPtDvs.js} +1 -1
  144. package/{token-typography.entry-CIETKadf.mjs → token-typography.entry-D4bxbB2m.mjs} +2 -2
  145. package/color-bb472c37-CKu54kOY.js +0 -1
  146. package/color-bb472c37-DDERsxdk.mjs +0 -207
  147. package/color-primary-palette_6.entry-BB6740d4.js +0 -1
  148. package/correct-use-of-colors.entry-LuyuqIQ9.js +0 -1
  149. package/correct-use-of-colors.entry-hvZ1z3tc.mjs +0 -59
  150. package/eds-accordion_33.entry-DFgdjlJE.mjs +0 -31360
  151. package/eds-accordion_33.entry-DlnbmQ6R.js +0 -29468
  152. package/eds-card-project.entry-BQ-dH8vM.js +0 -1
  153. package/eds-card-tags.entry-CIu6lD0P.mjs +0 -13
  154. package/eds-card-tool.entry-DgBqQucY.js +0 -1
  155. package/eds-icon-arrow-diagonal.entry-DjDB--sU.js +0 -1
  156. package/eds-icon-arrow-diagonal.entry-E5xC3m8H.mjs +0 -13
  157. package/eds-icon-arrow-right.entry-DaXIkUew.mjs +0 -13
  158. package/eds-icon-arrow-right.entry-odZ8U-W2.js +0 -1
  159. package/eds-icon-bluesky.entry-B3yW2mUC.mjs +0 -13
  160. package/eds-icon-chevron-down.entry-xWODzTE-.mjs +0 -13
  161. package/eds-icon-chevron-left.entry-CJyHE01I.mjs +0 -13
  162. package/eds-icon-chevron-left.entry-DjJj-hmG.js +0 -1
  163. package/eds-icon-chevron-right.entry-D8RyOADq.js +0 -1
  164. package/eds-icon-chevron-up.entry-TKCdY_T3.mjs +0 -13
  165. package/eds-icon-chevron-up.entry-ezV-v92v.js +0 -1
  166. package/eds-icon-close.entry-Brv3Uxu1.mjs +0 -13
  167. package/eds-icon-copy.entry-DQioS3t7.mjs +0 -13
  168. package/eds-icon-eu.entry-BzmYOiKL.js +0 -1
  169. package/eds-icon-eu.entry-KylDo55P.mjs +0 -13
  170. package/eds-icon-facebook.entry-DWZ02rD5.js +0 -1
  171. package/eds-icon-facebook.entry-DpS2m4v2.mjs +0 -13
  172. package/eds-icon-gitlab.entry-D8PM12SK.js +0 -1
  173. package/eds-icon-gitlab.entry-JX-5azIw.mjs +0 -13
  174. package/eds-icon-linkedin.entry-BylIVu8G.mjs +0 -13
  175. package/eds-icon-loader.entry-DZyUa8Na.mjs +0 -13
  176. package/eds-icon-mastodon.entry-BIckHn_q.mjs +0 -13
  177. package/eds-icon-mastodon.entry-DxNG__-Y.js +0 -1
  178. package/eds-icon-menu.entry-C9N6s8Oa.mjs +0 -13
  179. package/eds-icon-menu.entry-DwN-ZAWi.js +0 -1
  180. package/eds-icon-more.entry-MUkUL_e2.mjs +0 -13
  181. package/eds-icon-search.entry-CcwwFnns.mjs +0 -13
  182. package/eds-icon-search.entry-CrfMqbyi.js +0 -1
  183. package/eds-icon-success.entry-BUzsze9h.mjs +0 -13
  184. package/eds-icon-twitter.entry-B1Iw69NW.mjs +0 -13
  185. package/eds-icon-twitter.entry-BbStwaGv.js +0 -1
  186. package/eds-icon-user.entry-CNo6pger.mjs +0 -13
  187. package/eds-icon-user.entry-vYVsxfK7.js +0 -1
  188. package/eds-icon-youtube.entry-CBU7Dvkh.mjs +0 -13
  189. package/eds-icon-youtube.entry-CmCAFp7D.js +0 -1
  190. package/eds-login.entry-Bfztcsrc.js +0 -1
  191. package/eds-login.entry-XqWPWCDL.mjs +0 -46
  192. package/eds-logo-variations.entry-Cy_fbJLx.mjs +0 -22
  193. package/eds-matomo-notice.entry-CytVSgYS.js +0 -1
  194. package/eds-pagination_2.entry-DUsG8tcv.js +0 -1
  195. package/eds-rating.entry-CErokyKU.mjs +0 -38
  196. package/eds-rating.entry-p9oWKCkQ.js +0 -1
  197. package/eds-tabs-content.entry-Cg7U8c5D.js +0 -1
  198. package/eds-tabs.entry-DS6qBEo7.js +0 -1
  199. package/eds-tooltip.entry-sjwuhdKF.js +0 -1
  200. package/incorrect-use-of-colors.entry-DkY89xG1.mjs +0 -42
  201. package/incorrect-use-of-colors.entry-e4VhTVHS.js +0 -1
  202. package/index-D2H_BflF.js +0 -21
  203. package/keycloak-13893af6-NiM3zoVg.js +0 -9
  204. package/logo-variations-horizontal_2.entry-BeQ_r9Li.js +0 -7
  205. package/logo-variations-horizontal_2.entry-CC7tj8Hr.mjs +0 -29
  206. package/logo-wrong-usage.entry-Ct1Ae63m.mjs +0 -14
  207. package/logo-wrong-usage.entry-DkqcMaqp.js +0 -1
  208. package/token-ratios.entry-aBiRsmfr.js +0 -1
  209. package/token-spacing.entry-C5HX4qPq.mjs +0 -12
  210. package/token-spacing.entry-DDiMRsNO.js +0 -1
@@ -1,9 +1,9 @@
1
1
  function Y(f) {
2
2
  if (!(this instanceof Y))
3
3
  throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");
4
- if (typeof f != "string" && !V(f))
4
+ if (typeof f != "string" && !z(f))
5
5
  throw new Error("The 'Keycloak' constructor must be provided with a configuration object, or a URL to a JSON configuration file.");
6
- if (V(f)) {
6
+ if (z(f)) {
7
7
  const r = "oidcProvider" in f ? ["clientId"] : ["url", "realm", "clientId"];
8
8
  for (const t of r)
9
9
  if (!f[t])
@@ -15,80 +15,77 @@ function Y(f) {
15
15
  interval: 5
16
16
  };
17
17
  e.didInitialize = !1;
18
- var A = !0, _ = J(console.info), L = J(console.warn);
19
- globalThis.isSecureContext || L(
18
+ var R = !0, _ = F(console.info), x = F(console.warn);
19
+ globalThis.isSecureContext || x(
20
20
  `[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
21
  Continuing to run your application insecurely will lead to unexpected behavior and breakage.
22
22
 
23
23
  For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts`
24
- ), e.init = function(r) {
24
+ ), e.init = function(r = {}) {
25
25
  if (e.didInitialize)
26
26
  throw new Error("A 'Keycloak' instance can only be initialized once.");
27
- e.didInitialize = !0, e.authenticated = !1, U = ee();
27
+ e.didInitialize = !0, e.authenticated = !1, U = te();
28
28
  var t = ["default", "cordova", "cordova-native"];
29
- if (r && t.indexOf(r.adapter) > -1 ? h = P(r.adapter) : r && typeof r.adapter == "object" ? h = r.adapter : window.Cordova || window.cordova ? h = P("cordova") : h = P(), r) {
30
- if (typeof r.useNonce < "u" && (A = 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 (r.responseMode === "query" || r.responseMode === "fragment")
32
- e.responseMode = r.responseMode;
33
- else
34
- throw "Invalid value for responseMode";
35
- if (r.flow) {
36
- switch (r.flow) {
37
- case "standard":
38
- e.responseType = "code";
39
- break;
40
- case "implicit":
41
- e.responseType = "id_token token";
42
- break;
43
- case "hybrid":
44
- e.responseType = "code id_token token";
45
- break;
46
- default:
47
- throw "Invalid value for flow";
48
- }
49
- e.flow = r.flow;
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)
30
+ if (r.responseMode === "query" || r.responseMode === "fragment")
31
+ e.responseMode = r.responseMode;
32
+ else
33
+ throw "Invalid value for responseMode";
34
+ if (r.flow) {
35
+ switch (r.flow) {
36
+ case "standard":
37
+ e.responseType = "code";
38
+ break;
39
+ case "implicit":
40
+ e.responseType = "id_token token";
41
+ break;
42
+ case "hybrid":
43
+ e.responseType = "code id_token token";
44
+ break;
45
+ default:
46
+ throw "Invalid value for flow";
50
47
  }
51
- if (r.timeSkew != null && (e.timeSkew = r.timeSkew), r.redirectUri && (e.redirectUri = r.redirectUri), r.silentCheckSsoRedirectUri && (e.silentCheckSsoRedirectUri = r.silentCheckSsoRedirectUri), typeof r.silentCheckSsoFallback == "boolean" ? e.silentCheckSsoFallback = r.silentCheckSsoFallback : e.silentCheckSsoFallback = !0, typeof r.pkceMethod < "u") {
52
- if (r.pkceMethod !== "S256" && r.pkceMethod !== !1)
53
- throw new TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${r.pkceMethod}.`);
54
- e.pkceMethod = r.pkceMethod;
55
- } else
56
- e.pkceMethod = "S256";
57
- typeof r.enableLogging == "boolean" ? e.enableLogging = r.enableLogging : e.enableLogging = !1, r.logoutMethod === "POST" ? e.logoutMethod = "POST" : e.logoutMethod = "GET", typeof r.scope == "string" && (e.scope = r.scope), typeof r.acrValues == "string" && (e.acrValues = r.acrValues), typeof r.messageReceiveTimeout == "number" && r.messageReceiveTimeout > 0 ? e.messageReceiveTimeout = r.messageReceiveTimeout : e.messageReceiveTimeout = 1e4;
48
+ e.flow = r.flow;
58
49
  }
59
- e.responseMode || (e.responseMode = "fragment"), e.responseType || (e.responseType = "code", e.flow = "standard");
50
+ if (r.timeSkew != null && (e.timeSkew = r.timeSkew), r.redirectUri && (e.redirectUri = r.redirectUri), r.silentCheckSsoRedirectUri && (e.silentCheckSsoRedirectUri = r.silentCheckSsoRedirectUri), typeof r.silentCheckSsoFallback == "boolean" ? e.silentCheckSsoFallback = r.silentCheckSsoFallback : e.silentCheckSsoFallback = !0, typeof r.pkceMethod < "u") {
51
+ if (r.pkceMethod !== "S256" && r.pkceMethod !== !1)
52
+ throw new TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${r.pkceMethod}.`);
53
+ e.pkceMethod = r.pkceMethod;
54
+ } else
55
+ e.pkceMethod = "S256";
56
+ typeof r.enableLogging == "boolean" ? e.enableLogging = r.enableLogging : e.enableLogging = !1, r.logoutMethod === "POST" ? e.logoutMethod = "POST" : e.logoutMethod = "GET", typeof r.scope == "string" && (e.scope = r.scope), typeof r.acrValues == "string" && (e.acrValues = r.acrValues), typeof r.messageReceiveTimeout == "number" && r.messageReceiveTimeout > 0 ? e.messageReceiveTimeout = r.messageReceiveTimeout : e.messageReceiveTimeout = 1e4, e.responseMode || (e.responseMode = "fragment"), e.responseType || (e.responseType = "code", e.flow = "standard");
60
57
  var s = g(), i = g();
61
58
  i.promise.then(function() {
62
59
  e.onReady && e.onReady(e.authenticated), s.setSuccess(e.authenticated);
63
60
  }).catch(function(o) {
64
61
  s.setError(o);
65
62
  });
66
- var a = W();
63
+ var a = Q();
67
64
  function c() {
68
- var o = function(d) {
69
- d || (u.prompt = "none"), r && r.locale && (u.locale = r.locale), e.login(u).then(function() {
65
+ var o = function(u) {
66
+ u || (d.prompt = "none"), r.locale && (d.locale = r.locale), e.login(d).then(function() {
70
67
  i.setSuccess();
71
- }).catch(function(k) {
72
- i.setError(k);
68
+ }).catch(function(m) {
69
+ i.setError(m);
73
70
  });
74
71
  }, l = async function() {
75
- var d = document.createElement("iframe"), k = await e.createLoginUrl({ prompt: "none", redirectUri: e.silentCheckSsoRedirectUri });
76
- d.setAttribute("src", k), d.setAttribute("sandbox", "allow-storage-access-by-user-activation allow-scripts allow-same-origin"), d.setAttribute("title", "keycloak-silent-check-sso"), d.style.display = "none", document.body.appendChild(d);
77
- var y = function(S) {
78
- if (!(S.origin !== window.location.origin || d.contentWindow !== S.source)) {
79
- var w = T(S.data);
80
- I(w, i), document.body.removeChild(d), window.removeEventListener("message", y);
72
+ var u = document.createElement("iframe"), m = await e.createLoginUrl({ prompt: "none", redirectUri: e.silentCheckSsoRedirectUri });
73
+ 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
+ var w = function(S) {
75
+ 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);
81
78
  }
82
79
  };
83
- window.addEventListener("message", y);
84
- }, u = {};
80
+ window.addEventListener("message", w);
81
+ }, d = {};
85
82
  switch (r.onLoad) {
86
83
  case "check-sso":
87
- p.enable ? R().then(function() {
88
- C().then(function(d) {
89
- d ? i.setSuccess() : e.silentCheckSsoRedirectUri ? l() : o(!1);
90
- }).catch(function(d) {
91
- i.setError(d);
84
+ p.enable ? P().then(function() {
85
+ C().then(function(u) {
86
+ u ? i.setSuccess() : e.silentCheckSsoRedirectUri ? l() : o(!1);
87
+ }).catch(function(u) {
88
+ i.setError(u);
92
89
  });
93
90
  }) : e.silentCheckSsoRedirectUri ? l() : o(!1);
94
91
  break;
@@ -102,14 +99,14 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
102
99
  function n() {
103
100
  var o = T(window.location.href);
104
101
  if (o && window.history.replaceState(window.history.state, null, o.newUrl), o && o.valid)
105
- return R().then(function() {
102
+ return P().then(function() {
106
103
  I(o, i);
107
104
  }).catch(function(l) {
108
105
  i.setError(l);
109
106
  });
110
- r ? r.token && r.refreshToken ? (E(r.token, r.refreshToken, r.idToken), p.enable ? R().then(function() {
107
+ r.token && r.refreshToken ? (A(r.token, r.refreshToken, r.idToken), p.enable ? P().then(function() {
111
108
  C().then(function(l) {
112
- l ? (e.onAuthSuccess && e.onAuthSuccess(), i.setSuccess(), x()) : i.setSuccess();
109
+ l ? (e.onAuthSuccess && e.onAuthSuccess(), i.setSuccess(), M()) : i.setSuccess();
113
110
  }).catch(function(l) {
114
111
  i.setError(l);
115
112
  });
@@ -117,10 +114,10 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
117
114
  e.onAuthSuccess && e.onAuthSuccess(), i.setSuccess();
118
115
  }).catch(function(l) {
119
116
  e.onAuthError && e.onAuthError(), r.onLoad ? c() : i.setError(l);
120
- })) : r.onLoad ? c() : i.setSuccess() : i.setSuccess();
117
+ })) : r.onLoad ? c() : i.setSuccess();
121
118
  }
122
119
  return a.then(function() {
123
- Z().then(n).catch(function(o) {
120
+ re().then(n).catch(function(o) {
124
121
  s.setError(o);
125
122
  });
126
123
  }), a.catch(function(o) {
@@ -129,26 +126,26 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
129
126
  }, e.login = function(r) {
130
127
  return h.login(r);
131
128
  };
132
- function F(r) {
129
+ function G(r) {
133
130
  if (typeof crypto > "u" || typeof crypto.getRandomValues > "u")
134
131
  throw new Error("Web Crypto API is not available.");
135
132
  return crypto.getRandomValues(new Uint8Array(r));
136
133
  }
137
- function O(r) {
134
+ function X(r) {
138
135
  return q(r, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
139
136
  }
140
137
  function q(r, t) {
141
- for (var s = F(r), i = new Array(r), a = 0; a < r; a++)
138
+ for (var s = G(r), i = new Array(r), a = 0; a < r; a++)
142
139
  i[a] = t.charCodeAt(s[a] % t.length);
143
140
  return String.fromCharCode.apply(null, i);
144
141
  }
145
142
  async function B(r, t) {
146
143
  if (r !== "S256")
147
144
  throw new TypeError(`Invalid value for 'pkceMethod', expected 'S256' but got '${r}'.`);
148
- const s = new Uint8Array(await te(t));
149
- return re(s).replace(/\+/g, "-").replace(/\//g, "_").replace(/\=/g, "");
145
+ const s = new Uint8Array(await oe(t));
146
+ return ne(s).replace(/\+/g, "-").replace(/\//g, "_").replace(/\=/g, "");
150
147
  }
151
- function G(r) {
148
+ function W(r) {
152
149
  var t = {
153
150
  id_token: {
154
151
  acr: r
@@ -157,7 +154,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
157
154
  return JSON.stringify(t);
158
155
  }
159
156
  e.createLoginUrl = async function(r) {
160
- var t = j(), s = j(), i = h.redirectUri(r), a = {
157
+ var t = J(), s = J(), i = h.redirectUri(r), a = {
161
158
  state: t,
162
159
  nonce: s,
163
160
  redirectUri: encodeURIComponent(i),
@@ -169,16 +166,16 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
169
166
  var n = r && r.scope || e.scope;
170
167
  n ? n.indexOf("openid") === -1 && (n = "openid " + n) : n = "openid";
171
168
  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);
172
- if (A && (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) {
173
- var l = G(r.acr);
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);
174
171
  o += "&claims=" + encodeURIComponent(l);
175
172
  }
176
173
  if ((r && r.acrValues || e.acrValues) && (o += "&acr_values=" + encodeURIComponent(r.acrValues || e.acrValues)), e.pkceMethod)
177
174
  try {
178
- const u = O(96), d = await B(e.pkceMethod, u);
179
- a.pkceCodeVerifier = u, o += "&code_challenge=" + d, o += "&code_challenge_method=" + e.pkceMethod;
180
- } catch (u) {
181
- throw new Error("Failed to generate PKCE challenge.", { cause: u });
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 });
182
179
  }
183
180
  return U.add(a), o;
184
181
  }, e.logout = function(r) {
@@ -193,7 +190,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
193
190
  }, e.createRegisterUrl = async function(r) {
194
191
  return r || (r = {}), r.action = "register", await e.createLoginUrl(r);
195
192
  }, e.createAccountUrl = function(r) {
196
- var t = b(), s = void 0;
193
+ var t = y(), s = void 0;
197
194
  return typeof t < "u" && (s = t + "/account?referrer=" + encodeURIComponent(e.clientId) + "&referrer_uri=" + encodeURIComponent(h.redirectUri(r))), s;
198
195
  }, e.accountManagement = function() {
199
196
  return h.accountManagement();
@@ -206,7 +203,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
206
203
  var s = e.resourceAccess[t || e.clientId];
207
204
  return !!s && s.roles.indexOf(r) >= 0;
208
205
  }, e.loadUserProfile = function() {
209
- var r = b() + "/account", t = new XMLHttpRequest();
206
+ var r = y() + "/account", t = new XMLHttpRequest();
210
207
  t.open("GET", r, !0), t.setRequestHeader("Accept", "application/json"), t.setRequestHeader("Authorization", "bearer " + e.token);
211
208
  var s = g();
212
209
  return t.onreadystatechange = function() {
@@ -250,14 +247,14 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
250
247
  if (o.readyState == 4)
251
248
  if (o.status == 200) {
252
249
  _("[KEYCLOAK] Token refreshed"), l = (l + (/* @__PURE__ */ new Date()).getTime()) / 2;
253
- var u = JSON.parse(o.responseText);
254
- E(u.access_token, u.refresh_token, u.id_token, l), e.onAuthRefreshSuccess && e.onAuthRefreshSuccess();
255
- for (var d = v.pop(); d != null; d = v.pop())
256
- d.setSuccess(!0);
250
+ var d = JSON.parse(o.responseText);
251
+ A(d.access_token, d.refresh_token, d.id_token, l), e.onAuthRefreshSuccess && e.onAuthRefreshSuccess();
252
+ for (var u = v.pop(); u != null; u = v.pop())
253
+ u.setSuccess(!0);
257
254
  } else {
258
- L("[KEYCLOAK] Failed to refresh token"), o.status == 400 && e.clearToken(), e.onAuthRefreshError && e.onAuthRefreshError();
259
- for (var d = v.pop(); d != null; d = v.pop())
260
- d.setError(!0);
255
+ x("[KEYCLOAK] Failed to refresh token"), o.status == 400 && e.clearToken(), e.onAuthRefreshError && e.onAuthRefreshError();
256
+ for (var u = v.pop(); u != null; u = v.pop())
257
+ u.setError("Failed to refresh token: An unexpected HTTP error occurred while attempting to refresh the token.");
261
258
  }
262
259
  }, o.send(c);
263
260
  }
@@ -274,13 +271,13 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
274
271
  s();
275
272
  return t.promise;
276
273
  }, e.clearToken = function() {
277
- e.token && (E(null, null, null), e.onAuthLogout && e.onAuthLogout(), e.loginRequired && e.login());
274
+ e.token && (A(null, null, null), e.onAuthLogout && e.onAuthLogout(), e.loginRequired && e.login());
278
275
  };
279
- function b() {
276
+ function y() {
280
277
  if (typeof e.authServerUrl < "u")
281
278
  return e.authServerUrl.charAt(e.authServerUrl.length - 1) == "/" ? e.authServerUrl + "realms/" + encodeURIComponent(e.realm) : e.authServerUrl + "/realms/" + encodeURIComponent(e.realm);
282
279
  }
283
- function X() {
280
+ function $() {
284
281
  return window.location.origin ? window.location.origin : window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : "");
285
282
  }
286
283
  function I(r, t) {
@@ -296,23 +293,23 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
296
293
  else
297
294
  t && t.setSuccess();
298
295
  return;
299
- } else e.flow != "standard" && (r.access_token || r.id_token) && d(r.access_token, null, r.id_token, !0);
296
+ } else e.flow != "standard" && (r.access_token || r.id_token) && u(r.access_token, null, r.id_token, !0);
300
297
  if (e.flow != "implicit" && s) {
301
- var o = "code=" + s + "&grant_type=authorization_code", l = e.endpoints.token(), u = new XMLHttpRequest();
302
- u.open("POST", l, !0), u.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), u.withCredentials = !0, u.onreadystatechange = function() {
303
- if (u.readyState == 4)
304
- if (u.status == 200) {
305
- var k = JSON.parse(u.responseText);
306
- d(k.access_token, k.refresh_token, k.id_token, e.flow === "standard"), x();
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();
307
304
  } else
308
305
  e.onAuthError && e.onAuthError(), t && t.setError();
309
- }, u.send(o);
306
+ }, d.send(o);
310
307
  }
311
- function d(k, y, S, w) {
312
- c = (c + (/* @__PURE__ */ new Date()).getTime()) / 2, E(k, y, S, c), A && e.idTokenParsed && e.idTokenParsed.nonce != r.storedNonce ? (_("[KEYCLOAK] Invalid nonce, clearing token"), e.clearToken(), t && t.setError()) : w && (e.onAuthSuccess && e.onAuthSuccess(), t && t.setSuccess());
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());
313
310
  }
314
311
  }
315
- function W() {
312
+ function Q() {
316
313
  var r = g(), t;
317
314
  typeof f == "string" && (t = f);
318
315
  function s(n) {
@@ -343,25 +340,25 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
343
340
  }
344
341
  } : e.endpoints = {
345
342
  authorize: function() {
346
- return b() + "/protocol/openid-connect/auth";
343
+ return y() + "/protocol/openid-connect/auth";
347
344
  },
348
345
  token: function() {
349
- return b() + "/protocol/openid-connect/token";
346
+ return y() + "/protocol/openid-connect/token";
350
347
  },
351
348
  logout: function() {
352
- return b() + "/protocol/openid-connect/logout";
349
+ return y() + "/protocol/openid-connect/logout";
353
350
  },
354
351
  checkSessionIframe: function() {
355
- return b() + "/protocol/openid-connect/login-status-iframe.html";
352
+ return y() + "/protocol/openid-connect/login-status-iframe.html";
356
353
  },
357
354
  thirdPartyCookiesIframe: function() {
358
- return b() + "/protocol/openid-connect/3p-cookies/step1.html";
355
+ return y() + "/protocol/openid-connect/3p-cookies/step1.html";
359
356
  },
360
357
  register: function() {
361
- return b() + "/protocol/openid-connect/registrations";
358
+ return y() + "/protocol/openid-connect/registrations";
362
359
  },
363
360
  userinfo: function() {
364
- return b() + "/protocol/openid-connect/userinfo";
361
+ return y() + "/protocol/openid-connect/userinfo";
365
362
  }
366
363
  };
367
364
  }
@@ -369,7 +366,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
369
366
  var i = new XMLHttpRequest();
370
367
  i.open("GET", t, !0), i.setRequestHeader("Accept", "application/json"), i.onreadystatechange = function() {
371
368
  if (i.readyState == 4)
372
- if (i.status == 200 || D(i)) {
369
+ if (i.status == 200 || O(i)) {
373
370
  var n = JSON.parse(i.responseText);
374
371
  e.authServerUrl = n["auth-server-url"], e.realm = n.realm, e.clientId = n.resource, s(null), r.setSuccess();
375
372
  } else
@@ -386,7 +383,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
386
383
  var i = new XMLHttpRequest();
387
384
  i.open("GET", c, !0), i.setRequestHeader("Accept", "application/json"), i.onreadystatechange = function() {
388
385
  if (i.readyState == 4)
389
- if (i.status == 200 || D(i)) {
386
+ if (i.status == 200 || O(i)) {
390
387
  var o = JSON.parse(i.responseText);
391
388
  s(o), r.setSuccess();
392
389
  } else
@@ -397,31 +394,31 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
397
394
  }
398
395
  return r.promise;
399
396
  }
400
- function D(r) {
397
+ function O(r) {
401
398
  return r.status == 0 && r.responseText && r.responseURL.startsWith("file:");
402
399
  }
403
- function E(r, t, s, i) {
404
- if (e.tokenTimeoutHandle && (clearTimeout(e.tokenTimeoutHandle), e.tokenTimeoutHandle = null), t ? (e.refreshToken = t, e.refreshTokenParsed = N(t)) : (delete e.refreshToken, delete e.refreshTokenParsed), s ? (e.idToken = s, e.idTokenParsed = N(s)) : (delete e.idToken, delete e.idTokenParsed), r) {
405
- if (e.token = r, e.tokenParsed = N(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)) {
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)) {
406
403
  var a = (e.tokenParsed.exp - (/* @__PURE__ */ new Date()).getTime() / 1e3 + e.timeSkew) * 1e3;
407
404
  _("[KEYCLOAK] Token expires in " + Math.round(a / 1e3) + " s"), a <= 0 ? e.onTokenExpired() : e.tokenTimeoutHandle = setTimeout(e.onTokenExpired, a);
408
405
  }
409
406
  } else
410
407
  delete e.token, delete e.tokenParsed, delete e.subject, delete e.realmAccess, delete e.resourceAccess, e.authenticated = !1;
411
408
  }
412
- function j() {
409
+ function J() {
413
410
  if (typeof crypto > "u" || typeof crypto.randomUUID > "u")
414
411
  throw new Error("Web Crypto API is not available.");
415
412
  return crypto.randomUUID();
416
413
  }
417
414
  function T(r) {
418
- var t = $(r);
415
+ var t = Z(r);
419
416
  if (t) {
420
417
  var s = U.get(t.state);
421
418
  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;
422
419
  }
423
420
  }
424
- function $(r) {
421
+ function Z(r) {
425
422
  var t;
426
423
  switch (e.flow) {
427
424
  case "standard":
@@ -436,7 +433,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
436
433
  }
437
434
  t.push("error"), t.push("error_description"), t.push("error_uri");
438
435
  var s = r.indexOf("?"), i = r.indexOf("#"), a, c;
439
- if (e.responseMode === "query" && s !== -1 ? (a = r.substring(0, s), c = z(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 = z(r.substring(i + 1), t), c.paramsString !== "" && (a += "#" + c.paramsString)), c && c.oauthParams) {
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) {
440
437
  if (e.flow === "standard" || e.flow === "hybrid") {
441
438
  if ((c.oauthParams.code || c.oauthParams.error) && c.oauthParams.state)
442
439
  return c.oauthParams.newUrl = a, c.oauthParams;
@@ -444,7 +441,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
444
441
  return c.oauthParams.newUrl = a, c.oauthParams;
445
442
  }
446
443
  }
447
- function z(r, t) {
444
+ function V(r, t) {
448
445
  for (var s = r.split("&"), i = {
449
446
  paramsString: "",
450
447
  oauthParams: {}
@@ -467,7 +464,7 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
467
464
  r.resolve = t, r.reject = s;
468
465
  }), r;
469
466
  }
470
- function Q(r, t, s) {
467
+ function ee(r, t, s) {
471
468
  var i = null, a = new Promise(function(c, n) {
472
469
  i = setTimeout(function() {
473
470
  n({ error: s });
@@ -477,14 +474,14 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
477
474
  clearTimeout(i);
478
475
  });
479
476
  }
480
- function R() {
477
+ function P() {
481
478
  var r = g();
482
479
  if (!p.enable || p.iframe)
483
480
  return r.setSuccess(), r.promise;
484
481
  var t = document.createElement("iframe");
485
482
  p.iframe = t, t.onload = function() {
486
483
  var a = e.endpoints.authorize();
487
- a.charAt(0) === "/" ? p.iframeOrigin = X() : p.iframeOrigin = a.substring(0, a.indexOf("/", 8)), r.setSuccess();
484
+ a.charAt(0) === "/" ? p.iframeOrigin = $() : p.iframeOrigin = a.substring(0, a.indexOf("/", 8)), r.setSuccess();
488
485
  };
489
486
  var s = e.endpoints.checkSessionIframe();
490
487
  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);
@@ -499,10 +496,10 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
499
496
  };
500
497
  return window.addEventListener("message", i, !1), r.promise;
501
498
  }
502
- function x() {
499
+ function M() {
503
500
  p.enable && e.token && setTimeout(function() {
504
501
  C().then(function(r) {
505
- r && x();
502
+ r && M();
506
503
  });
507
504
  }, p.interval * 1e3);
508
505
  }
@@ -517,27 +514,27 @@ For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/
517
514
  r.setSuccess();
518
515
  return r.promise;
519
516
  }
520
- function Z() {
517
+ function re() {
521
518
  var r = g();
522
- if (p.enable || e.silentCheckSsoRedirectUri) {
519
+ if ((p.enable || e.silentCheckSsoRedirectUri) && typeof e.endpoints.thirdPartyCookiesIframe == "function") {
523
520
  var t = document.createElement("iframe");
524
521
  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);
525
522
  var s = function(i) {
526
- t.contentWindow === i.source && (i.data !== "supported" && i.data !== "unsupported" || (i.data === "unsupported" && (L(
523
+ t.contentWindow === i.source && (i.data !== "supported" && i.data !== "unsupported" || (i.data === "unsupported" && (x(
527
524
  `[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:
528
525
 
529
526
  - It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).
530
527
  - It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).
531
528
 
532
- For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers`
529
+ For more information see: https://www.keycloak.org/securing-apps/javascript-adapter#_modern_browsers`
533
530
  ), p.enable = !1, e.silentCheckSsoFallback && (e.silentCheckSsoRedirectUri = !1)), document.body.removeChild(t), window.removeEventListener("message", s), r.setSuccess()));
534
531
  };
535
532
  window.addEventListener("message", s, !1);
536
533
  } else
537
534
  r.setSuccess();
538
- return Q(r.promise, e.messageReceiveTimeout, "Timeout when waiting for 3rd party check iframe message.");
535
+ return ee(r.promise, e.messageReceiveTimeout, "Timeout when waiting for 3rd party check iframe message.");
539
536
  }
540
- function P(r) {
537
+ function K(r) {
541
538
  if (!r || r == "default")
542
539
  return {
543
540
  login: async function(n) {
@@ -548,29 +545,21 @@ For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_m
548
545
  window.location.replace(e.createLogoutUrl(n));
549
546
  return;
550
547
  }
551
- const l = e.createLogoutUrl(n), u = await fetch(l, {
552
- method: "POST",
553
- headers: {
554
- "Content-Type": "application/x-www-form-urlencoded"
555
- },
556
- body: new URLSearchParams({
557
- id_token_hint: e.idToken,
558
- client_id: e.clientId,
559
- post_logout_redirect_uri: h.redirectUri(n, !1)
560
- })
561
- });
562
- if (u.redirected) {
563
- window.location.href = u.url;
564
- return;
565
- }
566
- if (u.ok) {
567
- window.location.reload();
568
- return;
548
+ const l = document.createElement("form");
549
+ l.setAttribute("method", "POST"), l.setAttribute("action", e.createLogoutUrl(n)), l.style.display = "none";
550
+ const d = {
551
+ id_token_hint: e.idToken,
552
+ client_id: e.clientId,
553
+ post_logout_redirect_uri: h.redirectUri(n, !1)
554
+ };
555
+ for (const [u, m] of Object.entries(d)) {
556
+ const w = document.createElement("input");
557
+ w.setAttribute("type", "hidden"), w.setAttribute("name", u), w.setAttribute("value", m), l.appendChild(w);
569
558
  }
570
- throw new Error("Logout failed, request returned an error code.");
559
+ document.body.appendChild(l), l.submit();
571
560
  },
572
- register: function(n) {
573
- return window.location.assign(e.createRegisterUrl(n)), g().promise;
561
+ register: async function(n) {
562
+ return window.location.assign(await e.createRegisterUrl(n)), g().promise;
574
563
  },
575
564
  accountManagement: function() {
576
565
  var n = e.createAccountUrl();
@@ -604,44 +593,44 @@ For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_m
604
593
  };
605
594
  return {
606
595
  login: async function(n) {
607
- var o = g(), l = a(n), u = await e.createLoginUrl(n), d = t(u, "_blank", l), k = !1, y = !1, S = function() {
608
- y = !0, d.close();
596
+ var o = g(), l = a(n), d = await e.createLoginUrl(n), u = t(d, "_blank", l), m = !1, w = !1, S = function() {
597
+ w = !0, u.close();
609
598
  };
610
- return d.addEventListener("loadstart", function(w) {
611
- if (w.url.indexOf(c()) == 0) {
612
- var H = T(w.url);
613
- I(H, o), S(), k = !0;
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;
614
603
  }
615
- }), d.addEventListener("loaderror", function(w) {
616
- if (!k)
617
- if (w.url.indexOf(c()) == 0) {
618
- var H = T(w.url);
619
- I(H, o), S(), k = !0;
604
+ }), u.addEventListener("loaderror", function(b) {
605
+ if (!m)
606
+ if (b.url.indexOf(c()) == 0) {
607
+ var D = T(b.url);
608
+ I(D, o), S(), m = !0;
620
609
  } else
621
610
  o.setError(), S();
622
- }), d.addEventListener("exit", function(w) {
623
- y || o.setError({
611
+ }), u.addEventListener("exit", function(b) {
612
+ w || o.setError({
624
613
  reason: "closed_by_user"
625
614
  });
626
615
  }), o.promise;
627
616
  },
628
617
  logout: function(n) {
629
- var o = g(), l = e.createLogoutUrl(n), u = t(l, "_blank", "location=no,hidden=yes,clearcache=yes"), d;
630
- return u.addEventListener("loadstart", function(k) {
631
- k.url.indexOf(c()) == 0 && u.close();
632
- }), u.addEventListener("loaderror", function(k) {
633
- k.url.indexOf(c()) == 0 || (d = !0), u.close();
634
- }), u.addEventListener("exit", function(k) {
635
- d ? o.setError() : (e.clearToken(), o.setSuccess());
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) {
624
+ u ? o.setError() : (e.clearToken(), o.setSuccess());
636
625
  }), o.promise;
637
626
  },
638
- register: function(n) {
639
- var o = g(), l = e.createRegisterUrl(), u = a(n), d = t(l, "_blank", u);
640
- return d.addEventListener("loadstart", function(k) {
641
- if (k.url.indexOf(c()) == 0) {
642
- d.close();
643
- var y = T(k.url);
644
- I(y, o);
627
+ register: async function(n) {
628
+ var o = g(), l = await e.createRegisterUrl(), d = a(n), u = t(l, "_blank", d);
629
+ return u.addEventListener("loadstart", function(m) {
630
+ if (m.url.indexOf(c()) == 0) {
631
+ u.close();
632
+ var w = T(m.url);
633
+ I(w, o);
645
634
  }
646
635
  }), o.promise;
647
636
  },
@@ -664,24 +653,24 @@ For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_m
664
653
  return p.enable = !1, {
665
654
  login: async function(n) {
666
655
  var o = g(), l = await e.createLoginUrl(n);
667
- return universalLinks.subscribe("keycloak", function(u) {
656
+ return universalLinks.subscribe("keycloak", function(d) {
668
657
  universalLinks.unsubscribe("keycloak"), window.cordova.plugins.browsertab.close();
669
- var d = T(u.url);
670
- I(d, o);
658
+ var u = T(d.url);
659
+ I(u, o);
671
660
  }), window.cordova.plugins.browsertab.openUrl(l), o.promise;
672
661
  },
673
662
  logout: function(n) {
674
663
  var o = g(), l = e.createLogoutUrl(n);
675
- return universalLinks.subscribe("keycloak", function(u) {
664
+ return universalLinks.subscribe("keycloak", function(d) {
676
665
  universalLinks.unsubscribe("keycloak"), window.cordova.plugins.browsertab.close(), e.clearToken(), o.setSuccess();
677
666
  }), window.cordova.plugins.browsertab.openUrl(l), o.promise;
678
667
  },
679
- register: function(n) {
680
- var o = g(), l = e.createRegisterUrl(n);
681
- return universalLinks.subscribe("keycloak", function(u) {
668
+ register: async function(n) {
669
+ var o = g(), l = await e.createRegisterUrl(n);
670
+ return universalLinks.subscribe("keycloak", function(d) {
682
671
  universalLinks.unsubscribe("keycloak"), window.cordova.plugins.browsertab.close();
683
- var d = T(u.url);
684
- I(d, o);
672
+ var u = T(d.url);
673
+ I(u, o);
685
674
  }), window.cordova.plugins.browsertab.openUrl(l), o.promise;
686
675
  },
687
676
  accountManagement: function() {
@@ -697,48 +686,65 @@ For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_m
697
686
  };
698
687
  throw "invalid adapter type: " + r;
699
688
  }
700
- var M = function() {
701
- if (!(this instanceof M))
702
- return new M();
689
+ const E = "kc-callback-";
690
+ var H = function() {
691
+ if (!(this instanceof H))
692
+ return new H();
703
693
  localStorage.setItem("kc-test", "test"), localStorage.removeItem("kc-test");
704
694
  var r = this;
705
695
  function t() {
706
- for (var s = (/* @__PURE__ */ new Date()).getTime(), i = 0; i < localStorage.length; i++) {
707
- var a = localStorage.key(i);
708
- if (a && a.indexOf("kc-callback-") == 0) {
709
- var c = localStorage.getItem(a);
710
- if (c)
711
- try {
712
- var n = JSON.parse(c).expires;
713
- (!n || n < s) && localStorage.removeItem(a);
714
- } catch {
715
- localStorage.removeItem(a);
716
- }
717
- }
696
+ const c = Date.now();
697
+ for (const [n, o] of i()) {
698
+ const l = a(o);
699
+ (l === null || l < c) && localStorage.removeItem(n);
718
700
  }
719
701
  }
720
- r.get = function(s) {
721
- if (s) {
722
- var i = "kc-callback-" + s, a = localStorage.getItem(i);
723
- return a && (localStorage.removeItem(i), a = JSON.parse(a)), t(), a;
702
+ function s() {
703
+ for (const [c] of i())
704
+ localStorage.removeItem(c);
705
+ }
706
+ function i() {
707
+ return Object.entries(localStorage).filter(([c]) => c.startsWith(E));
708
+ }
709
+ function a(c) {
710
+ let n;
711
+ try {
712
+ n = JSON.parse(c);
713
+ } catch {
714
+ return null;
724
715
  }
725
- }, r.add = function(s) {
716
+ return z(n) && "expires" in n && typeof n.expires == "number" ? n.expires : null;
717
+ }
718
+ r.get = function(c) {
719
+ if (c) {
720
+ var n = E + c, o = localStorage.getItem(n);
721
+ return o && (localStorage.removeItem(n), o = JSON.parse(o)), t(), o;
722
+ }
723
+ }, r.add = function(c) {
726
724
  t();
727
- var i = "kc-callback-" + s.state;
728
- s.expires = (/* @__PURE__ */ new Date()).getTime() + 60 * 60 * 1e3, localStorage.setItem(i, JSON.stringify(s));
725
+ const n = E + c.state, o = JSON.stringify({
726
+ ...c,
727
+ // Set the expiry time to 1 hour from now.
728
+ expires: Date.now() + 60 * 60 * 1e3
729
+ });
730
+ try {
731
+ localStorage.setItem(n, o);
732
+ } catch {
733
+ s(), localStorage.setItem(n, o);
734
+ }
729
735
  };
730
- }, K = function() {
731
- if (!(this instanceof K))
732
- return new K();
736
+ }, N = function() {
737
+ if (!(this instanceof N))
738
+ return new N();
733
739
  var r = this;
734
740
  r.get = function(a) {
735
741
  if (a) {
736
- var c = s("kc-callback-" + a);
737
- if (i("kc-callback-" + a, "", t(-100)), c)
742
+ var c = s(E + a);
743
+ if (i(E + a, "", t(-100)), c)
738
744
  return JSON.parse(c);
739
745
  }
740
746
  }, r.add = function(a) {
741
- i("kc-callback-" + a.state, JSON.stringify(a), t(60));
747
+ i(E + a.state, JSON.stringify(a), t(60));
742
748
  }, r.removeItem = function(a) {
743
749
  i(a, "", t(-100));
744
750
  };
@@ -758,36 +764,36 @@ For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_m
758
764
  document.cookie = o;
759
765
  };
760
766
  };
761
- function ee() {
767
+ function te() {
762
768
  try {
763
- return new M();
769
+ return new H();
764
770
  } catch {
765
771
  }
766
- return new K();
772
+ return new N();
767
773
  }
768
- function J(r) {
774
+ function F(r) {
769
775
  return function() {
770
776
  e.enableLogging && r.apply(console, Array.prototype.slice.call(arguments));
771
777
  };
772
778
  }
773
779
  }
774
- function re(f) {
780
+ function ne(f) {
775
781
  const e = String.fromCodePoint(...f);
776
782
  return btoa(e);
777
783
  }
778
- async function te(f) {
784
+ async function oe(f) {
779
785
  const h = new TextEncoder().encode(f);
780
786
  if (typeof crypto > "u" || typeof crypto.subtle > "u")
781
787
  throw new Error("Web Crypto API is not available.");
782
788
  return await crypto.subtle.digest("SHA-256", h);
783
789
  }
784
- function N(f) {
790
+ function j(f) {
785
791
  const [e, h] = f.split(".");
786
792
  if (typeof h != "string")
787
793
  throw new Error("Unable to decode token, payload not found.");
788
794
  let v;
789
795
  try {
790
- v = ne(h);
796
+ v = ae(h);
791
797
  } catch (U) {
792
798
  throw new Error("Unable to decode token, payload is not a valid Base64URL value.", { cause: U });
793
799
  }
@@ -797,7 +803,7 @@ function N(f) {
797
803
  throw new Error("Unable to decode token, payload is not a valid JSON value.", { cause: U });
798
804
  }
799
805
  }
800
- function ne(f) {
806
+ function ae(f) {
801
807
  let e = f.replaceAll("-", "+").replaceAll("_", "/");
802
808
  switch (e.length % 4) {
803
809
  case 0:
@@ -812,55 +818,61 @@ function ne(f) {
812
818
  throw new Error("Input is not of the correct length.");
813
819
  }
814
820
  try {
815
- return oe(e);
821
+ return ie(e);
816
822
  } catch {
817
823
  return atob(e);
818
824
  }
819
825
  }
820
- function oe(f) {
826
+ function ie(f) {
821
827
  return decodeURIComponent(atob(f).replace(/(.)/g, (e, h) => {
822
828
  let v = h.charCodeAt(0).toString(16).toUpperCase();
823
829
  return v.length < 2 && (v = "0" + v), "%" + v;
824
830
  }));
825
831
  }
826
- function V(f) {
832
+ function z(f) {
827
833
  return typeof f == "object" && f !== null;
828
834
  }
829
- let m = null;
830
- function ae(f, e = !0) {
831
- return m || (m = new Y({
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({
832
838
  url: f.url,
833
839
  realm: f.realm,
834
840
  clientId: f.clientId
835
- })), m.init({
841
+ })), L = k.init({
836
842
  onLoad: e ? "check-sso" : "login-required",
837
843
  checkLoginIframe: !1
838
844
  //silentCheckSsoRedirectUri: `${window.location.origin}/silent-check-sso.html`, // Ensure this file is set up
839
- }).then((h) => h).catch((h) => (console.error("Failed to initialize Keycloak:", h), !1));
845
+ }).then((h) => h).catch((h) => (console.error("Failed to initialize Keycloak:", h), !1)), L);
840
846
  }
841
- function ie() {
842
- return m != null && m.authenticated && (m != null && m.idTokenParsed) ? {
843
- fullname: m.idTokenParsed.name,
844
- email: m.idTokenParsed.email,
845
- lastname: m.idTokenParsed.family_name,
846
- firstname: m.idTokenParsed.given_name,
847
- username: m.idTokenParsed.preferred_username,
847
+ function ce() {
848
+ return k != null && k.authenticated && (k != null && k.idTokenParsed) ? {
849
+ fullname: k.idTokenParsed.name,
850
+ email: k.idTokenParsed.email,
851
+ lastname: k.idTokenParsed.family_name,
852
+ firstname: k.idTokenParsed.given_name,
853
+ username: k.idTokenParsed.preferred_username,
848
854
  background: "grey",
849
855
  // Optional custom value
850
- token: m.token,
851
- sub: m.idTokenParsed.sub
856
+ token: k.token,
857
+ sub: k.idTokenParsed.sub
852
858
  } : {};
853
859
  }
854
- function se() {
855
- m ? m.login() : console.error("Keycloak is not initialized.");
860
+ function le() {
861
+ if (k)
862
+ k.login();
863
+ else
864
+ throw new Error("Keycloak is not initialized.");
856
865
  }
857
- function ce() {
858
- m ? m.logout() : console.error("Keycloak is not initialized.");
866
+ function ue() {
867
+ if (k)
868
+ k.logout();
869
+ else
870
+ throw new Error("Keycloak is not initialized.");
859
871
  }
860
- function le() {
861
- return !!(m != null && m.authenticated);
872
+ function de() {
873
+ return !!(k != null && k.authenticated);
862
874
  }
863
- async function ue(f) {
875
+ async function fe(f) {
864
876
  try {
865
877
  const e = await fetch(f, { method: "HEAD", mode: "no-cors" });
866
878
  return e.ok || e.type === "opaque";
@@ -869,10 +881,10 @@ async function ue(f) {
869
881
  }
870
882
  }
871
883
  export {
872
- ce as a,
873
- le as b,
874
- ue as c,
875
- ie as g,
876
- ae as i,
877
- se as l
884
+ ue as a,
885
+ de as b,
886
+ fe as c,
887
+ ce as g,
888
+ se as i,
889
+ le as l
878
890
  };