@ebrains/vue 0.9.3-beta → 1.0.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.
- package/README.md +4 -4
- package/analytics-d99780e3-Bay18Oil.mjs +28 -0
- package/analytics-d99780e3-DgvAss6l.js +1 -0
- package/{color-primary-palette_6.entry-CloKiAKI.mjs → color-primary-palette_6.entry-CfNmHzNO.mjs} +15 -15
- package/color-primary-palette_6.entry-c48Fqrz0.js +1 -0
- package/{components-section.entry-BZl-upvI.js → components-section.entry-3yJF6nRH.js} +5 -5
- package/{components-section.entry-DEtf0V8r.mjs → components-section.entry-oQTYayXm.mjs} +28 -19
- package/{correct-use-of-colors.entry-CvrVVhIA.mjs → correct-use-of-colors.entry-7fOSokhJ.mjs} +2 -2
- package/{correct-use-of-colors.entry-ajROARV6.js → correct-use-of-colors.entry-DEdyB_h5.js} +1 -1
- package/{docs-palettes.entry-CegYRhKo.js → docs-palettes.entry-6ekOz4GT.js} +1 -1
- package/{docs-palettes.entry-OWUmgE8-.mjs → docs-palettes.entry-Bz96UO-K.mjs} +2 -2
- package/{docs-tokens.entry-D720jRIB.mjs → docs-tokens.entry-D-hRYpqk.mjs} +2 -2
- package/{docs-tokens.entry-BIwcLv8t.js → docs-tokens.entry-DjHB8v2C.js} +1 -1
- package/{eds-accordion.entry-D5Qn9bWB.js → eds-accordion.entry-Czj2ZwpQ.js} +1 -1
- package/{eds-accordion.entry-Ct4upGzD.mjs → eds-accordion.entry-D1L8fv2r.mjs} +5 -5
- package/eds-alert.entry-BqEeR0Xw.js +165 -0
- package/eds-alert.entry-DAeVRXua.mjs +251 -0
- package/{eds-app-root.entry-DPM5X6uN.mjs → eds-app-root.entry-BBbgNK8b.mjs} +2 -2
- package/{eds-app-root.entry-C-CwU-8Y.js → eds-app-root.entry-BrJeEAVb.js} +1 -1
- package/{eds-timeline.entry-AsApD57a.mjs → eds-avatar_34.entry-1U84FvGQ.mjs} +7346 -3065
- package/{eds-tabs.entry-DRJv1vVW.mjs → eds-avatar_34.entry-iuvkwQW_.js} +5138 -2826
- package/eds-card-project.entry-Cd7tP9g4.mjs +170 -0
- package/eds-card-project.entry-CewRPvW7.js +1 -0
- package/{eds-card-section.entry-BWDrARpV.js → eds-card-section.entry-BU4fC9y5.js} +1 -1
- package/{eds-card-section.entry-CXFOGMeJ.mjs → eds-card-section.entry-CQLG4D0D.mjs} +1 -1
- package/{eds-card-tags.entry-Debtxwjy.mjs → eds-card-tags.entry-BKuk3O8k.mjs} +1 -1
- package/{eds-card-tags.entry-Do7oGWtS.js → eds-card-tags.entry-DOV6K1FD.js} +1 -1
- package/{eds-card-tool.entry-CXluEgpO.mjs → eds-card-tool.entry-DpfInwr3.mjs} +5 -5
- package/{eds-card-tool.entry-kxsYfCOl.js → eds-card-tool.entry-LSjtu5k_.js} +1 -1
- package/{eds-code-block.entry-BIGwear1.mjs → eds-code-block.entry-Bz1Pbg4W.mjs} +1 -1
- package/{eds-code-block.entry-B2tVEczx.js → eds-code-block.entry-DG1tMA_4.js} +1 -1
- package/{eds-cookies-preference.entry-mbjVkbaf.js → eds-cookies-preference.entry-0J8XlEDN.js} +1 -1
- package/{eds-cookies-preference.entry-BwTBWuc7.mjs → eds-cookies-preference.entry-DgP6pxkr.mjs} +2 -2
- package/{eds-feedback.entry-CxE8Mda2.js → eds-feedback.entry-Cmn3G5sR.js} +1 -1
- package/{eds-feedback.entry-DQZP2iFN.mjs → eds-feedback.entry-CxyxT-OD.mjs} +10 -9
- package/eds-frame.entry-Dh_T8O60.mjs +67 -0
- package/eds-frame.entry-LDVXpjkU.js +1 -0
- package/{eds-icon-arrow-diagonal.entry-BzMthIH3.js → eds-icon-arrow-diagonal.entry-C6AHMuMB.js} +1 -1
- package/{eds-icon-arrow-diagonal.entry-D0nObc1G.mjs → eds-icon-arrow-diagonal.entry-C75xEcUs.mjs} +1 -1
- package/{eds-icon-arrow-right.entry-BGLDpWIT.mjs → eds-icon-arrow-right.entry-DOsVz4oP.mjs} +1 -1
- package/{eds-icon-arrow-right.entry-DPLcd0Dg.js → eds-icon-arrow-right.entry-VMROpz2J.js} +1 -1
- package/{eds-icon-bluesky.entry-bnwTCSoD.js → eds-icon-bluesky.entry-BmSl31Ky.js} +1 -1
- package/{eds-icon-bluesky.entry-ZXTtFyYw.mjs → eds-icon-bluesky.entry-C9skxio2.mjs} +1 -1
- package/{eds-icon-bookmark.entry-vBTnOEht.js → eds-icon-bookmark.entry-DdUP23Uu.js} +1 -1
- package/{eds-icon-bookmark.entry-BV8nKCLz.mjs → eds-icon-bookmark.entry-xWgHPpg-.mjs} +1 -1
- package/{eds-icon-chevron-down.entry-BNSIoEMh.js → eds-icon-chevron-down.entry-DNY1bk_l.js} +1 -1
- package/{eds-icon-chevron-down.entry-9YeZRA_B.mjs → eds-icon-chevron-down.entry-ut52sjbR.mjs} +1 -1
- package/{eds-icon-chevron-left.entry-Bm5LaJAt.mjs → eds-icon-chevron-left.entry-Bi82EnZL.mjs} +1 -1
- package/{eds-icon-chevron-left.entry-BBKqN2RH.js → eds-icon-chevron-left.entry-nzi05fTd.js} +1 -1
- package/{eds-icon-chevron-right.entry-CieI-tuC.js → eds-icon-chevron-right.entry-CBW3L3p8.js} +1 -1
- package/{eds-icon-chevron-right.entry-ChbDkmms.mjs → eds-icon-chevron-right.entry-Dc_uRypg.mjs} +1 -1
- package/{eds-icon-chevron-up.entry-D3DkXrLO.mjs → eds-icon-chevron-up.entry-CO7nzD9J.mjs} +1 -1
- package/{eds-icon-chevron-up.entry-BqkKRoL-.js → eds-icon-chevron-up.entry-Cc10e7Ce.js} +1 -1
- package/{eds-icon-close.entry-DQv18xqh.mjs → eds-icon-close.entry-CvXUDttz.mjs} +1 -1
- package/{eds-icon-close.entry-4xYgUnOY.js → eds-icon-close.entry-Dw7ZUnkQ.js} +1 -1
- package/{eds-icon-copy.entry-C7-kaujN.mjs → eds-icon-copy.entry-DV4qtIA7.mjs} +1 -1
- package/{eds-icon-copy.entry-DQl13_LK.js → eds-icon-copy.entry-x46asO9P.js} +1 -1
- package/{eds-icon-eu.entry-DR5lezcj.mjs → eds-icon-eu.entry-BaEbXLNS.mjs} +1 -1
- package/{eds-icon-eu.entry-B8fNjCUv.js → eds-icon-eu.entry-D2CoGoAF.js} +1 -1
- package/{eds-icon-external.entry-BaIofxzF.js → eds-icon-external.entry-C0Zm0isI.js} +1 -1
- package/{eds-icon-external.entry-DvY_6Ld0.mjs → eds-icon-external.entry-CckFcmA1.mjs} +1 -1
- package/{eds-icon-facebook.entry-D7FANZCQ.mjs → eds-icon-facebook.entry-CIiiUf27.mjs} +1 -1
- package/{eds-icon-facebook.entry-Do2GEkmS.js → eds-icon-facebook.entry-DwUcANz7.js} +1 -1
- package/{eds-icon-gitlab.entry-p78Zzlxs.js → eds-icon-gitlab.entry-CuKUR41Q.js} +1 -1
- package/{eds-icon-gitlab.entry-D7FC3Vn4.mjs → eds-icon-gitlab.entry-PCSE_PYe.mjs} +1 -1
- package/{eds-icon-linkedin.entry-BYQGxGkX.js → eds-icon-linkedin.entry-Bpoynapn.js} +1 -1
- package/{eds-icon-linkedin.entry-CchbiOIO.mjs → eds-icon-linkedin.entry-C9xqBwJ1.mjs} +1 -1
- package/{eds-icon-loader.entry-C8zfXt5G.mjs → eds-icon-loader.entry-CkIiBDsV.mjs} +1 -1
- package/{eds-icon-loader.entry-Cw7oYrm3.js → eds-icon-loader.entry-dxgwIFD3.js} +1 -1
- package/{eds-icon-mastodon.entry-C_TXVQJB.js → eds-icon-mastodon.entry-7CmZhvNG.js} +1 -1
- package/{eds-icon-mastodon.entry-BOgFKnbj.mjs → eds-icon-mastodon.entry-k86mWfUp.mjs} +1 -1
- package/{eds-icon-menu.entry-Dl7Xqhc3.mjs → eds-icon-menu.entry-7zPtmR24.mjs} +1 -1
- package/{eds-icon-menu.entry-BtdrFvM4.js → eds-icon-menu.entry-CFIbaI5j.js} +1 -1
- package/{eds-icon-minus.entry-BA5Al4_F.js → eds-icon-minus.entry-B4ntnZW_.js} +1 -1
- package/{eds-icon-minus.entry-Bfm78Q48.mjs → eds-icon-minus.entry-fPsoVmGR.mjs} +1 -1
- package/{eds-icon-more.entry-mAUgJoHF.js → eds-icon-more.entry-D_HCuwKk.js} +1 -1
- package/{eds-icon-more.entry-CHzRpt-L.mjs → eds-icon-more.entry-DyH3sCa4.mjs} +1 -1
- package/{eds-icon-paper.entry-DEiOlvnw.mjs → eds-icon-paper.entry-BQlPnCrf.mjs} +1 -1
- package/{eds-icon-paper.entry-DtE79_lg.js → eds-icon-paper.entry-CHAw7mqA.js} +1 -1
- package/{eds-icon-plus.entry-BCc2gk-Y.js → eds-icon-plus.entry-QOVehJoq.js} +1 -1
- package/{eds-icon-plus.entry-DxdfImnp.mjs → eds-icon-plus.entry-zTfrWeuu.mjs} +1 -1
- package/{eds-icon-portal.entry-DgJxnehb.js → eds-icon-portal.entry-CbJqS4OZ.js} +1 -1
- package/{eds-icon-portal.entry-DygPWj8q.mjs → eds-icon-portal.entry-SlgbRrHY.mjs} +1 -1
- package/{eds-icon-private.entry-BtxnzDjj.js → eds-icon-private.entry-DSIHrQEv.js} +1 -1
- package/{eds-icon-private.entry-ClDqtUa4.mjs → eds-icon-private.entry-uHBGM_wp.mjs} +1 -1
- package/{eds-icon-public.entry-BKL5QMPS.js → eds-icon-public.entry-Cj1hddsF.js} +1 -1
- package/{eds-icon-public.entry-D0qOA8dF.mjs → eds-icon-public.entry-_sTE1w2W.mjs} +1 -1
- package/{eds-icon-search.entry-BPeHLF3h.js → eds-icon-search.entry-CXVkIZak.js} +1 -1
- package/{eds-icon-search.entry-iegCSWzH.mjs → eds-icon-search.entry-DIww9BJF.mjs} +1 -1
- package/{eds-icon-star.entry-BP6oBKRH.mjs → eds-icon-star.entry-B3WySZM_.mjs} +1 -1
- package/{eds-icon-star.entry-DSHqvj6t.js → eds-icon-star.entry-B464U0ht.js} +1 -1
- package/{eds-icon-success.entry-DoaW0KlM.js → eds-icon-success.entry-BhRuLH3J.js} +1 -1
- package/{eds-icon-success.entry-B2vqFpAU.mjs → eds-icon-success.entry-HesFgi8E.mjs} +1 -1
- package/{eds-icon-thumbs-down.entry-CmV8Km2F.mjs → eds-icon-thumbs-down.entry-CbL3623r.mjs} +1 -1
- package/{eds-icon-thumbs-down.entry-CFMyu-CY.js → eds-icon-thumbs-down.entry-DVK5ACMh.js} +1 -1
- package/{eds-icon-thumbs-up.entry-DhfFxKPT.mjs → eds-icon-thumbs-up.entry-C2QZ3OSz.mjs} +1 -1
- package/{eds-icon-thumbs-up.entry-8RPnzfnW.js → eds-icon-thumbs-up.entry-MDqpoPcO.js} +1 -1
- package/{eds-icon-tutorial.entry-B3NRKCnl.mjs → eds-icon-tutorial.entry-DRB27GWh.mjs} +1 -1
- package/{eds-icon-tutorial.entry-ImfBSV9b.js → eds-icon-tutorial.entry-xaf63POz.js} +1 -1
- package/{eds-icon-twitter.entry-Da3X1sWO.mjs → eds-icon-twitter.entry-CYCIFfgj.mjs} +1 -1
- package/{eds-icon-twitter.entry-BLvpOiN-.js → eds-icon-twitter.entry-CcpEPKUu.js} +1 -1
- package/{eds-icon-unknown.entry--9_uerA-.js → eds-icon-unknown.entry-kYRE4en_.js} +1 -1
- package/{eds-icon-unknown.entry-DH3YcJSO.mjs → eds-icon-unknown.entry-ksugYL8s.mjs} +1 -1
- package/{eds-icon-updown.entry-BU4FzzAC.js → eds-icon-updown.entry-3_UTqXet.js} +1 -1
- package/{eds-icon-updown.entry-D6t6TWtG.mjs → eds-icon-updown.entry-DrW4QdWY.mjs} +1 -1
- package/{eds-icon-user.entry-yNOw7Z1J.js → eds-icon-user.entry-BimbLh7T.js} +1 -1
- package/{eds-icon-user.entry-pb-JM7tE.mjs → eds-icon-user.entry-CMjrRV4a.mjs} +1 -1
- package/{eds-icon-youtube.entry-CNH9Mxfw.js → eds-icon-youtube.entry-BepDLIVw.js} +1 -1
- package/{eds-icon-youtube.entry-CIx5D-1i.mjs → eds-icon-youtube.entry-CGXXdMzx.mjs} +1 -1
- package/{eds-matomo-notice.entry-cucI3F6F.js → eds-matomo-notice.entry-BnbhjXrV.js} +1 -1
- package/{eds-matomo-notice.entry-DD0R8UUN.mjs → eds-matomo-notice.entry-DQLfTEH4.mjs} +26 -24
- package/{eds-pagination_2.entry-Cmqe9RbB.mjs → eds-pagination_2.entry-BK--gyZ0.mjs} +8 -8
- package/{eds-pagination_2.entry-DFO92YFs.js → eds-pagination_2.entry-De883ILy.js} +1 -1
- package/eds-progress-bar.entry-CnzFrS-7.js +1 -0
- package/eds-progress-bar.entry-UWeq2B4o.mjs +39 -0
- package/{eds-rating.entry-BJZaV3ft.js → eds-rating.entry-D48_hoBw.js} +1 -1
- package/{eds-rating.entry-BaneuoOA.mjs → eds-rating.entry-ScrHbfrp.mjs} +2 -2
- package/{eds-section-core_2.entry-dmjdE4gJ.mjs → eds-section-core_2.entry-D3FNm7II.mjs} +9 -9
- package/eds-section-core_2.entry-DshZ38Q9.js +1 -0
- package/{eds-spinner.entry-Cdu4PTNJ.js → eds-spinner.entry-CAKA3YkP.js} +1 -1
- package/{eds-spinner.entry-BwIR2ZO2.mjs → eds-spinner.entry-KZWQRAHb.mjs} +5 -5
- package/eds-splash-screen.entry-B7f2rbAn.mjs +39 -0
- package/eds-splash-screen.entry-YJ_mGQYU.js +1 -0
- package/eds-switch.entry-CKv4fbm-.js +1 -0
- package/eds-switch.entry-DbBUxVI8.mjs +29 -0
- package/eds-timeline.entry-BE-6PK5Q.js +1 -0
- package/eds-timeline.entry-uFV4mRmh.mjs +46 -0
- package/eds-toast-manager.entry-BKIf0Xw3.js +1 -0
- package/eds-toast-manager.entry-CXL8sMaG.mjs +61 -0
- package/{eds-toast.entry-B1RS9m4v.js → eds-toast.entry-a-RIjL18.js} +2 -2
- package/{eds-toast.entry-BNYlJ84c.mjs → eds-toast.entry-oZ1Juhqm.mjs} +6 -6
- package/eds-trl.entry-Bw8w42hZ.mjs +34 -0
- package/eds-trl.entry-DmSx4bnn.js +1 -0
- package/generated/components.d.ts +2 -2
- package/incorrect-use-of-colors.entry-BlDQxmUQ.mjs +42 -0
- package/incorrect-use-of-colors.entry-CglkFNGU.js +1 -0
- package/index-BvZ-fq9l.mjs +3486 -0
- package/index-CJvr9v3B.js +21 -0
- package/index.js +1 -1
- package/index.mjs +18 -18
- package/{logo-space.entry-GOUZQmu9.mjs → logo-space.entry-D1gv5Jv7.mjs} +5 -5
- package/{logo-space.entry-DxZ7v-wS.js → logo-space.entry-d5Tx6GSR.js} +2 -2
- package/{logo-variations-horizontal_2.entry-CRdycvC5.js → logo-variations-horizontal_2.entry-CiMlktdv.js} +3 -3
- package/{logo-variations-horizontal_2.entry-DimbU2IU.mjs → logo-variations-horizontal_2.entry-DPHzlUCt.mjs} +10 -10
- package/{logo-variations-tabs.entry-Uc3TLufg.mjs → logo-variations-tabs.entry-BYi6NRAo.mjs} +3 -3
- package/{logo-variations-tabs.entry-5kLk6tXo.js → logo-variations-tabs.entry-CcSRDFWV.js} +1 -1
- package/{logo-wrong-usage.entry-CYcqaVbn.mjs → logo-wrong-usage.entry-9iDssoCI.mjs} +5 -5
- package/{logo-wrong-usage.entry-13RSC-bu.js → logo-wrong-usage.entry-gsDvZ1sn.js} +1 -1
- package/package.json +1 -1
- package/{svg-repository.entry-IIRiiFbB.mjs → svg-repository.entry-BtksDklW.mjs} +11 -11
- package/{svg-repository.entry-Ck1z1CpA.js → svg-repository.entry-_-HISW99.js} +2 -2
- package/{token-list_3.entry-CQ9aUIVd.mjs → token-list_3.entry-CNkWD89P.mjs} +4 -4
- package/{token-list_3.entry-CLlUT7ge.js → token-list_3.entry-CRZq4och.js} +1 -1
- package/token-ratios.entry-CL40j9gF.js +1 -0
- package/{token-ratios.entry-DkgSpwqw.mjs → token-ratios.entry-D4aHLsX-.mjs} +5 -5
- package/{token-typography.entry-CgJdJgCR.js → token-typography.entry-D17oZHbh.js} +1 -1
- package/{token-typography.entry-CrMCS1R0.mjs → token-typography.entry-ayRMMiOe.mjs} +2 -2
- package/analytics-44b1416b-3vYuu4Xs.mjs +0 -28
- package/analytics-44b1416b-ol77SdQE.js +0 -1
- package/color-2554aad6-CCcV5UJZ.mjs +0 -131
- package/color-2554aad6-D1hFGX4H.js +0 -1
- package/color-primary-palette_6.entry-DnBuZqiu.js +0 -1
- package/eds-alert.entry-D9ClanEp.js +0 -739
- package/eds-alert.entry-D9R2BeLM.mjs +0 -825
- package/eds-avatar_27.entry-7vAHtj7m.mjs +0 -33545
- package/eds-avatar_27.entry-CnmtSNAS.js +0 -31838
- package/eds-card-desc_2.entry-1GoZmzeQ.mjs +0 -53
- package/eds-card-desc_2.entry-BfOXVZi0.js +0 -1
- package/eds-card-generic.entry-BKpFgWlR.js +0 -1
- package/eds-card-generic.entry-CT7jqo3p.mjs +0 -56
- package/eds-card-project.entry-BbLZfxAE.js +0 -1
- package/eds-card-project.entry-O11d3day.mjs +0 -44
- package/eds-card-wrapper.entry-DnHxiCgs.js +0 -1
- package/eds-card-wrapper.entry-Dyrfqp6K.mjs +0 -24
- package/eds-frame.entry-BzGgy3Ya.mjs +0 -67
- package/eds-frame.entry-CGFInzxQ.js +0 -1
- package/eds-login_2.entry-shWfmpH4.mjs +0 -981
- package/eds-login_2.entry-swrZnwUp.js +0 -9
- package/eds-progress-bar.entry-CIkJEHf9.mjs +0 -21
- package/eds-progress-bar.entry-CUoQ0OmO.js +0 -1
- package/eds-section-core_2.entry-wnSqKsfm.js +0 -1
- package/eds-switch.entry-8g9JkW0c.js +0 -1
- package/eds-switch.entry-BOxsYeYC.mjs +0 -20
- package/eds-tabs.entry-CdlLmrmB.js +0 -7794
- package/eds-timeline.entry-MDj5oqZG.js +0 -7794
- package/eds-toast-manager.entry-Bri3h_MP.mjs +0 -36
- package/eds-toast-manager.entry-zrDxthPz.js +0 -1
- package/eds-tooltip.entry-B6UpJ0wf.js +0 -1
- package/eds-tooltip.entry-Ci5te9B_.mjs +0 -77
- package/eds-trl.entry-CuUDfGYw.js +0 -1
- package/eds-trl.entry-Dz7LP4G1.mjs +0 -34
- package/incorrect-use-of-colors.entry-CYXsk3TR.mjs +0 -42
- package/incorrect-use-of-colors.entry-CfmdbA7l.js +0 -1
- package/index-7ljGsgwC.js +0 -21
- package/index-l365C9dI.mjs +0 -3617
- package/toastManager-d9eee791-CEYNwx25.mjs +0 -30
- package/toastManager-d9eee791-DvR_vUPI.js +0 -1
- package/token-ratios.entry-Dtrkv16c.js +0 -1
|
@@ -1,981 +0,0 @@
|
|
|
1
|
-
import { r as X, c as J, h as U, H as se } from "./index-l365C9dI.mjs";
|
|
2
|
-
import { t as R } from "./toastManager-d9eee791-CEYNwx25.mjs";
|
|
3
|
-
function q(u) {
|
|
4
|
-
if (!(this instanceof q))
|
|
5
|
-
throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");
|
|
6
|
-
if (typeof u != "string" && !O(u))
|
|
7
|
-
throw new Error("The 'Keycloak' constructor must be provided with a configuration object, or a URL to a JSON configuration file.");
|
|
8
|
-
if (O(u)) {
|
|
9
|
-
const r = "oidcProvider" in u ? ["clientId"] : ["url", "realm", "clientId"];
|
|
10
|
-
for (const t of r)
|
|
11
|
-
if (!u[t])
|
|
12
|
-
throw new Error(`The configuration object is missing the required '${t}' property.`);
|
|
13
|
-
}
|
|
14
|
-
var e = this, p, v = [], I, h = {
|
|
15
|
-
enable: !0,
|
|
16
|
-
callbackList: [],
|
|
17
|
-
interval: 5
|
|
18
|
-
};
|
|
19
|
-
e.didInitialize = !1;
|
|
20
|
-
var P = !0, _ = W(console.info), M = W(console.warn);
|
|
21
|
-
globalThis.isSecureContext || M(
|
|
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.
|
|
23
|
-
Continuing to run your application insecurely will lead to unexpected behavior and breakage.
|
|
24
|
-
|
|
25
|
-
For more information see: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts`
|
|
26
|
-
), e.init = function(r = {}) {
|
|
27
|
-
if (e.didInitialize)
|
|
28
|
-
throw new Error("A 'Keycloak' instance can only be initialized once.");
|
|
29
|
-
e.didInitialize = !0, e.authenticated = !1, I = ie();
|
|
30
|
-
var t = ["default", "cordova", "cordova-native"];
|
|
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)
|
|
32
|
-
if (r.responseMode === "query" || r.responseMode === "fragment")
|
|
33
|
-
e.responseMode = r.responseMode;
|
|
34
|
-
else
|
|
35
|
-
throw "Invalid value for responseMode";
|
|
36
|
-
if (r.flow) {
|
|
37
|
-
switch (r.flow) {
|
|
38
|
-
case "standard":
|
|
39
|
-
e.responseType = "code";
|
|
40
|
-
break;
|
|
41
|
-
case "implicit":
|
|
42
|
-
e.responseType = "id_token token";
|
|
43
|
-
break;
|
|
44
|
-
case "hybrid":
|
|
45
|
-
e.responseType = "code id_token token";
|
|
46
|
-
break;
|
|
47
|
-
default:
|
|
48
|
-
throw "Invalid value for flow";
|
|
49
|
-
}
|
|
50
|
-
e.flow = r.flow;
|
|
51
|
-
}
|
|
52
|
-
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") {
|
|
53
|
-
if (r.pkceMethod !== "S256" && r.pkceMethod !== !1)
|
|
54
|
-
throw new TypeError(`Invalid value for pkceMethod', expected 'S256' or false but got ${r.pkceMethod}.`);
|
|
55
|
-
e.pkceMethod = r.pkceMethod;
|
|
56
|
-
} else
|
|
57
|
-
e.pkceMethod = "S256";
|
|
58
|
-
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");
|
|
59
|
-
var s = g(), i = g();
|
|
60
|
-
i.promise.then(function() {
|
|
61
|
-
e.onReady && e.onReady(e.authenticated), s.setSuccess(e.authenticated);
|
|
62
|
-
}).catch(function(o) {
|
|
63
|
-
s.setError(o);
|
|
64
|
-
});
|
|
65
|
-
var a = te();
|
|
66
|
-
function c() {
|
|
67
|
-
var o = function(d) {
|
|
68
|
-
d || (f.prompt = "none"), r.locale && (f.locale = r.locale), e.login(f).then(function() {
|
|
69
|
-
i.setSuccess();
|
|
70
|
-
}).catch(function(m) {
|
|
71
|
-
i.setError(m);
|
|
72
|
-
});
|
|
73
|
-
}, l = async function() {
|
|
74
|
-
var d = document.createElement("iframe"), m = await e.createLoginUrl({ prompt: "none", redirectUri: e.silentCheckSsoRedirectUri });
|
|
75
|
-
d.setAttribute("src", m), 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);
|
|
76
|
-
var w = function(S) {
|
|
77
|
-
if (!(S.origin !== window.location.origin || d.contentWindow !== S.source)) {
|
|
78
|
-
var y = E(S.data);
|
|
79
|
-
T(y, i), document.body.removeChild(d), window.removeEventListener("message", w);
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
window.addEventListener("message", w);
|
|
83
|
-
}, f = {};
|
|
84
|
-
switch (r.onLoad) {
|
|
85
|
-
case "check-sso":
|
|
86
|
-
h.enable ? K().then(function() {
|
|
87
|
-
L().then(function(d) {
|
|
88
|
-
d ? i.setSuccess() : e.silentCheckSsoRedirectUri ? l() : o(!1);
|
|
89
|
-
}).catch(function(d) {
|
|
90
|
-
i.setError(d);
|
|
91
|
-
});
|
|
92
|
-
}) : e.silentCheckSsoRedirectUri ? l() : o(!1);
|
|
93
|
-
break;
|
|
94
|
-
case "login-required":
|
|
95
|
-
o(!0);
|
|
96
|
-
break;
|
|
97
|
-
default:
|
|
98
|
-
throw "Invalid value for onLoad";
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
function n() {
|
|
102
|
-
var o = E(window.location.href);
|
|
103
|
-
if (o && window.history.replaceState(window.history.state, null, o.newUrl), o && o.valid)
|
|
104
|
-
return K().then(function() {
|
|
105
|
-
T(o, i);
|
|
106
|
-
}).catch(function(l) {
|
|
107
|
-
i.setError(l);
|
|
108
|
-
});
|
|
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();
|
|
112
|
-
}).catch(function(l) {
|
|
113
|
-
i.setError(l);
|
|
114
|
-
});
|
|
115
|
-
}) : e.updateToken(-1).then(function() {
|
|
116
|
-
e.onAuthSuccess && e.onAuthSuccess(), i.setSuccess();
|
|
117
|
-
}).catch(function(l) {
|
|
118
|
-
e.onAuthError && e.onAuthError(), r.onLoad ? c() : i.setError(l);
|
|
119
|
-
})) : r.onLoad ? c() : i.setSuccess();
|
|
120
|
-
}
|
|
121
|
-
return a.then(function() {
|
|
122
|
-
ae().then(n).catch(function(o) {
|
|
123
|
-
s.setError(o);
|
|
124
|
-
});
|
|
125
|
-
}), a.catch(function(o) {
|
|
126
|
-
s.setError(o);
|
|
127
|
-
}), s.promise;
|
|
128
|
-
}, e.login = function(r) {
|
|
129
|
-
return p.login(r);
|
|
130
|
-
};
|
|
131
|
-
function B(r) {
|
|
132
|
-
if (typeof crypto > "u" || typeof crypto.getRandomValues > "u")
|
|
133
|
-
throw new Error("Web Crypto API is not available.");
|
|
134
|
-
return crypto.getRandomValues(new Uint8Array(r));
|
|
135
|
-
}
|
|
136
|
-
function $(r) {
|
|
137
|
-
return Q(r, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
|
|
138
|
-
}
|
|
139
|
-
function Q(r, t) {
|
|
140
|
-
for (var s = B(r), i = new Array(r), a = 0; a < r; a++)
|
|
141
|
-
i[a] = t.charCodeAt(s[a] % t.length);
|
|
142
|
-
return String.fromCharCode.apply(null, i);
|
|
143
|
-
}
|
|
144
|
-
async function Z(r, t) {
|
|
145
|
-
if (r !== "S256")
|
|
146
|
-
throw new TypeError(`Invalid value for 'pkceMethod', expected 'S256' but got '${r}'.`);
|
|
147
|
-
const s = new Uint8Array(await le(t));
|
|
148
|
-
return ce(s).replace(/\+/g, "-").replace(/\//g, "_").replace(/\=/g, "");
|
|
149
|
-
}
|
|
150
|
-
function ee(r) {
|
|
151
|
-
var t = {
|
|
152
|
-
id_token: {
|
|
153
|
-
acr: r
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
return JSON.stringify(t);
|
|
157
|
-
}
|
|
158
|
-
e.createLoginUrl = async function(r) {
|
|
159
|
-
var t = Y(), s = Y(), i = p.redirectUri(r), a = {
|
|
160
|
-
state: t,
|
|
161
|
-
nonce: s,
|
|
162
|
-
redirectUri: encodeURIComponent(i),
|
|
163
|
-
loginOptions: r
|
|
164
|
-
};
|
|
165
|
-
r && r.prompt && (a.prompt = r.prompt);
|
|
166
|
-
var c;
|
|
167
|
-
r && r.action == "register" ? c = e.endpoints.register() : c = e.endpoints.authorize();
|
|
168
|
-
var n = r && r.scope || e.scope;
|
|
169
|
-
n ? n.indexOf("openid") === -1 && (n = "openid " + n) : n = "openid";
|
|
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);
|
|
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);
|
|
173
|
-
o += "&claims=" + encodeURIComponent(l);
|
|
174
|
-
}
|
|
175
|
-
if ((r && r.acrValues || e.acrValues) && (o += "&acr_values=" + encodeURIComponent(r.acrValues || e.acrValues)), e.pkceMethod)
|
|
176
|
-
try {
|
|
177
|
-
const f = $(96), d = await Z(e.pkceMethod, f);
|
|
178
|
-
a.pkceCodeVerifier = f, o += "&code_challenge=" + d, o += "&code_challenge_method=" + e.pkceMethod;
|
|
179
|
-
} catch (f) {
|
|
180
|
-
throw new Error("Failed to generate PKCE challenge.", { cause: f });
|
|
181
|
-
}
|
|
182
|
-
return I.add(a), o;
|
|
183
|
-
}, e.logout = function(r) {
|
|
184
|
-
return p.logout(r);
|
|
185
|
-
}, e.createLogoutUrl = function(r) {
|
|
186
|
-
if (((r == null ? void 0 : r.logoutMethod) ?? e.logoutMethod) === "POST")
|
|
187
|
-
return e.endpoints.logout();
|
|
188
|
-
var s = e.endpoints.logout() + "?client_id=" + encodeURIComponent(e.clientId) + "&post_logout_redirect_uri=" + encodeURIComponent(p.redirectUri(r, !1));
|
|
189
|
-
return e.idToken && (s += "&id_token_hint=" + encodeURIComponent(e.idToken)), s;
|
|
190
|
-
}, e.register = function(r) {
|
|
191
|
-
return p.register(r);
|
|
192
|
-
}, e.createRegisterUrl = async function(r) {
|
|
193
|
-
return r || (r = {}), r.action = "register", await e.createLoginUrl(r);
|
|
194
|
-
}, e.createAccountUrl = function(r) {
|
|
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;
|
|
197
|
-
}, e.accountManagement = function() {
|
|
198
|
-
return p.accountManagement();
|
|
199
|
-
}, e.hasRealmRole = function(r) {
|
|
200
|
-
var t = e.realmAccess;
|
|
201
|
-
return !!t && t.roles.indexOf(r) >= 0;
|
|
202
|
-
}, e.hasResourceRole = function(r, t) {
|
|
203
|
-
if (!e.resourceAccess)
|
|
204
|
-
return !1;
|
|
205
|
-
var s = e.resourceAccess[t || e.clientId];
|
|
206
|
-
return !!s && s.roles.indexOf(r) >= 0;
|
|
207
|
-
}, e.loadUserProfile = function() {
|
|
208
|
-
var r = b() + "/account", t = new XMLHttpRequest();
|
|
209
|
-
t.open("GET", r, !0), t.setRequestHeader("Accept", "application/json"), t.setRequestHeader("Authorization", "bearer " + e.token);
|
|
210
|
-
var s = g();
|
|
211
|
-
return t.onreadystatechange = function() {
|
|
212
|
-
t.readyState == 4 && (t.status == 200 ? (e.profile = JSON.parse(t.responseText), s.setSuccess(e.profile)) : s.setError());
|
|
213
|
-
}, t.send(), s.promise;
|
|
214
|
-
}, e.loadUserInfo = function() {
|
|
215
|
-
var r = e.endpoints.userinfo(), t = new XMLHttpRequest();
|
|
216
|
-
t.open("GET", r, !0), t.setRequestHeader("Accept", "application/json"), t.setRequestHeader("Authorization", "bearer " + e.token);
|
|
217
|
-
var s = g();
|
|
218
|
-
return t.onreadystatechange = function() {
|
|
219
|
-
t.readyState == 4 && (t.status == 200 ? (e.userInfo = JSON.parse(t.responseText), s.setSuccess(e.userInfo)) : s.setError());
|
|
220
|
-
}, t.send(), s.promise;
|
|
221
|
-
}, e.isTokenExpired = function(r) {
|
|
222
|
-
if (!e.tokenParsed || !e.refreshToken && e.flow != "implicit")
|
|
223
|
-
throw "Not authenticated";
|
|
224
|
-
if (e.timeSkew == null)
|
|
225
|
-
return _("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"), !0;
|
|
226
|
-
var t = e.tokenParsed.exp - Math.ceil((/* @__PURE__ */ new Date()).getTime() / 1e3) + e.timeSkew;
|
|
227
|
-
if (r) {
|
|
228
|
-
if (isNaN(r))
|
|
229
|
-
throw "Invalid minValidity";
|
|
230
|
-
t -= r;
|
|
231
|
-
}
|
|
232
|
-
return t < 0;
|
|
233
|
-
}, e.updateToken = function(r) {
|
|
234
|
-
var t = g();
|
|
235
|
-
if (!e.refreshToken)
|
|
236
|
-
return t.setError(), t.promise;
|
|
237
|
-
r = r || 5;
|
|
238
|
-
var s = function() {
|
|
239
|
-
var a = !1;
|
|
240
|
-
if (r == -1 ? (a = !0, _("[KEYCLOAK] Refreshing token: forced refresh")) : (!e.tokenParsed || e.isTokenExpired(r)) && (a = !0, _("[KEYCLOAK] Refreshing token: token expired")), !a)
|
|
241
|
-
t.setSuccess(!1);
|
|
242
|
-
else {
|
|
243
|
-
var c = "grant_type=refresh_token&refresh_token=" + e.refreshToken, n = e.endpoints.token();
|
|
244
|
-
if (v.push(t), v.length == 1) {
|
|
245
|
-
var o = new XMLHttpRequest();
|
|
246
|
-
o.open("POST", n, !0), o.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), o.withCredentials = !0, c += "&client_id=" + encodeURIComponent(e.clientId);
|
|
247
|
-
var l = (/* @__PURE__ */ new Date()).getTime();
|
|
248
|
-
o.onreadystatechange = function() {
|
|
249
|
-
if (o.readyState == 4)
|
|
250
|
-
if (o.status == 200) {
|
|
251
|
-
_("[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();
|
|
254
|
-
for (var d = v.pop(); d != null; d = v.pop())
|
|
255
|
-
d.setSuccess(!0);
|
|
256
|
-
} else {
|
|
257
|
-
M("[KEYCLOAK] Failed to refresh token"), o.status == 400 && e.clearToken(), e.onAuthRefreshError && e.onAuthRefreshError();
|
|
258
|
-
for (var d = v.pop(); d != null; d = v.pop())
|
|
259
|
-
d.setError("Failed to refresh token: An unexpected HTTP error occurred while attempting to refresh the token.");
|
|
260
|
-
}
|
|
261
|
-
}, o.send(c);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
};
|
|
265
|
-
if (h.enable) {
|
|
266
|
-
var i = L();
|
|
267
|
-
i.then(function() {
|
|
268
|
-
s();
|
|
269
|
-
}).catch(function(a) {
|
|
270
|
-
t.setError(a);
|
|
271
|
-
});
|
|
272
|
-
} else
|
|
273
|
-
s();
|
|
274
|
-
return t.promise;
|
|
275
|
-
}, e.clearToken = function() {
|
|
276
|
-
e.token && (C(null, null, null), e.onAuthLogout && e.onAuthLogout(), e.loginRequired && e.login());
|
|
277
|
-
};
|
|
278
|
-
function b() {
|
|
279
|
-
if (typeof e.authServerUrl < "u")
|
|
280
|
-
return e.authServerUrl.charAt(e.authServerUrl.length - 1) == "/" ? e.authServerUrl + "realms/" + encodeURIComponent(e.realm) : e.authServerUrl + "/realms/" + encodeURIComponent(e.realm);
|
|
281
|
-
}
|
|
282
|
-
function re() {
|
|
283
|
-
return window.location.origin ? window.location.origin : window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : "");
|
|
284
|
-
}
|
|
285
|
-
function T(r, t) {
|
|
286
|
-
var s = r.code, i = r.error, a = r.prompt, c = (/* @__PURE__ */ new Date()).getTime();
|
|
287
|
-
if (r.kc_action_status && e.onActionUpdate && e.onActionUpdate(r.kc_action_status, r.kc_action), i) {
|
|
288
|
-
if (a != "none")
|
|
289
|
-
if (r.error_description && r.error_description === "authentication_expired")
|
|
290
|
-
e.login(r.loginOptions);
|
|
291
|
-
else {
|
|
292
|
-
var n = { error: i, error_description: r.error_description };
|
|
293
|
-
e.onAuthError && e.onAuthError(n), t && t.setError(n);
|
|
294
|
-
}
|
|
295
|
-
else
|
|
296
|
-
t && t.setSuccess();
|
|
297
|
-
return;
|
|
298
|
-
} else e.flow != "standard" && (r.access_token || r.id_token) && d(r.access_token, null, r.id_token, !0);
|
|
299
|
-
if (e.flow != "implicit" && s) {
|
|
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
|
-
d(m.access_token, m.refresh_token, m.id_token, e.flow === "standard"), H();
|
|
306
|
-
} else
|
|
307
|
-
e.onAuthError && e.onAuthError(), t && t.setError();
|
|
308
|
-
}, f.send(o);
|
|
309
|
-
}
|
|
310
|
-
function d(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 ? (_("[KEYCLOAK] Invalid nonce, clearing token"), e.clearToken(), t && t.setError()) : y && (e.onAuthSuccess && e.onAuthSuccess(), t && t.setSuccess());
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
function te() {
|
|
315
|
-
var r = g(), t;
|
|
316
|
-
typeof u == "string" && (t = u);
|
|
317
|
-
function s(n) {
|
|
318
|
-
n ? e.endpoints = {
|
|
319
|
-
authorize: function() {
|
|
320
|
-
return n.authorization_endpoint;
|
|
321
|
-
},
|
|
322
|
-
token: function() {
|
|
323
|
-
return n.token_endpoint;
|
|
324
|
-
},
|
|
325
|
-
logout: function() {
|
|
326
|
-
if (!n.end_session_endpoint)
|
|
327
|
-
throw "Not supported by the OIDC server";
|
|
328
|
-
return n.end_session_endpoint;
|
|
329
|
-
},
|
|
330
|
-
checkSessionIframe: function() {
|
|
331
|
-
if (!n.check_session_iframe)
|
|
332
|
-
throw "Not supported by the OIDC server";
|
|
333
|
-
return n.check_session_iframe;
|
|
334
|
-
},
|
|
335
|
-
register: function() {
|
|
336
|
-
throw 'Redirection to "Register user" page not supported in standard OIDC mode';
|
|
337
|
-
},
|
|
338
|
-
userinfo: function() {
|
|
339
|
-
if (!n.userinfo_endpoint)
|
|
340
|
-
throw "Not supported by the OIDC server";
|
|
341
|
-
return n.userinfo_endpoint;
|
|
342
|
-
}
|
|
343
|
-
} : e.endpoints = {
|
|
344
|
-
authorize: function() {
|
|
345
|
-
return b() + "/protocol/openid-connect/auth";
|
|
346
|
-
},
|
|
347
|
-
token: function() {
|
|
348
|
-
return b() + "/protocol/openid-connect/token";
|
|
349
|
-
},
|
|
350
|
-
logout: function() {
|
|
351
|
-
return b() + "/protocol/openid-connect/logout";
|
|
352
|
-
},
|
|
353
|
-
checkSessionIframe: function() {
|
|
354
|
-
return b() + "/protocol/openid-connect/login-status-iframe.html";
|
|
355
|
-
},
|
|
356
|
-
thirdPartyCookiesIframe: function() {
|
|
357
|
-
return b() + "/protocol/openid-connect/3p-cookies/step1.html";
|
|
358
|
-
},
|
|
359
|
-
register: function() {
|
|
360
|
-
return b() + "/protocol/openid-connect/registrations";
|
|
361
|
-
},
|
|
362
|
-
userinfo: function() {
|
|
363
|
-
return b() + "/protocol/openid-connect/userinfo";
|
|
364
|
-
}
|
|
365
|
-
};
|
|
366
|
-
}
|
|
367
|
-
if (t) {
|
|
368
|
-
var i = new XMLHttpRequest();
|
|
369
|
-
i.open("GET", t, !0), i.setRequestHeader("Accept", "application/json"), i.onreadystatechange = function() {
|
|
370
|
-
if (i.readyState == 4)
|
|
371
|
-
if (i.status == 200 || F(i)) {
|
|
372
|
-
var n = JSON.parse(i.responseText);
|
|
373
|
-
e.authServerUrl = n["auth-server-url"], e.realm = n.realm, e.clientId = n.resource, s(null), r.setSuccess();
|
|
374
|
-
} else
|
|
375
|
-
r.setError();
|
|
376
|
-
}, i.send();
|
|
377
|
-
} else {
|
|
378
|
-
e.clientId = u.clientId;
|
|
379
|
-
var a = u.oidcProvider;
|
|
380
|
-
if (!a)
|
|
381
|
-
e.authServerUrl = u.url, e.realm = u.realm, s(null), r.setSuccess();
|
|
382
|
-
else if (typeof a == "string") {
|
|
383
|
-
var c;
|
|
384
|
-
a.charAt(a.length - 1) == "/" ? c = a + ".well-known/openid-configuration" : c = a + "/.well-known/openid-configuration";
|
|
385
|
-
var i = new XMLHttpRequest();
|
|
386
|
-
i.open("GET", c, !0), i.setRequestHeader("Accept", "application/json"), i.onreadystatechange = function() {
|
|
387
|
-
if (i.readyState == 4)
|
|
388
|
-
if (i.status == 200 || F(i)) {
|
|
389
|
-
var o = JSON.parse(i.responseText);
|
|
390
|
-
s(o), r.setSuccess();
|
|
391
|
-
} else
|
|
392
|
-
r.setError();
|
|
393
|
-
}, i.send();
|
|
394
|
-
} else
|
|
395
|
-
s(a), r.setSuccess();
|
|
396
|
-
}
|
|
397
|
-
return r.promise;
|
|
398
|
-
}
|
|
399
|
-
function F(r) {
|
|
400
|
-
return r.status == 0 && r.responseText && r.responseURL.startsWith("file:");
|
|
401
|
-
}
|
|
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 && (_("[KEYCLOAK] Estimated time difference between browser and server is " + e.timeSkew + " seconds"), e.onTokenExpired)) {
|
|
405
|
-
var a = (e.tokenParsed.exp - (/* @__PURE__ */ new Date()).getTime() / 1e3 + e.timeSkew) * 1e3;
|
|
406
|
-
_("[KEYCLOAK] Token expires in " + Math.round(a / 1e3) + " s"), a <= 0 ? e.onTokenExpired() : e.tokenTimeoutHandle = setTimeout(e.onTokenExpired, a);
|
|
407
|
-
}
|
|
408
|
-
} else
|
|
409
|
-
delete e.token, delete e.tokenParsed, delete e.subject, delete e.realmAccess, delete e.resourceAccess, e.authenticated = !1;
|
|
410
|
-
}
|
|
411
|
-
function Y() {
|
|
412
|
-
if (typeof crypto > "u" || typeof crypto.randomUUID > "u")
|
|
413
|
-
throw new Error("Web Crypto API is not available.");
|
|
414
|
-
return crypto.randomUUID();
|
|
415
|
-
}
|
|
416
|
-
function E(r) {
|
|
417
|
-
var t = ne(r);
|
|
418
|
-
if (t) {
|
|
419
|
-
var s = I.get(t.state);
|
|
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;
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
function ne(r) {
|
|
424
|
-
var t;
|
|
425
|
-
switch (e.flow) {
|
|
426
|
-
case "standard":
|
|
427
|
-
t = ["code", "state", "session_state", "kc_action_status", "kc_action", "iss"];
|
|
428
|
-
break;
|
|
429
|
-
case "implicit":
|
|
430
|
-
t = ["access_token", "token_type", "id_token", "state", "session_state", "expires_in", "kc_action_status", "kc_action", "iss"];
|
|
431
|
-
break;
|
|
432
|
-
case "hybrid":
|
|
433
|
-
t = ["access_token", "token_type", "id_token", "code", "state", "session_state", "expires_in", "kc_action_status", "kc_action", "iss"];
|
|
434
|
-
break;
|
|
435
|
-
}
|
|
436
|
-
t.push("error"), t.push("error_description"), t.push("error_uri");
|
|
437
|
-
var s = r.indexOf("?"), i = r.indexOf("#"), a, c;
|
|
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) {
|
|
439
|
-
if (e.flow === "standard" || e.flow === "hybrid") {
|
|
440
|
-
if ((c.oauthParams.code || c.oauthParams.error) && c.oauthParams.state)
|
|
441
|
-
return c.oauthParams.newUrl = a, c.oauthParams;
|
|
442
|
-
} else if (e.flow === "implicit" && (c.oauthParams.access_token || c.oauthParams.error) && c.oauthParams.state)
|
|
443
|
-
return c.oauthParams.newUrl = a, c.oauthParams;
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
function G(r, t) {
|
|
447
|
-
for (var s = r.split("&"), i = {
|
|
448
|
-
paramsString: "",
|
|
449
|
-
oauthParams: {}
|
|
450
|
-
}, a = 0; a < s.length; a++) {
|
|
451
|
-
var c = s[a].indexOf("="), n = s[a].slice(0, c);
|
|
452
|
-
t.indexOf(n) !== -1 ? i.oauthParams[n] = s[a].slice(c + 1) : (i.paramsString !== "" && (i.paramsString += "&"), i.paramsString += s[a]);
|
|
453
|
-
}
|
|
454
|
-
return i;
|
|
455
|
-
}
|
|
456
|
-
function g() {
|
|
457
|
-
var r = {
|
|
458
|
-
setSuccess: function(t) {
|
|
459
|
-
r.resolve(t);
|
|
460
|
-
},
|
|
461
|
-
setError: function(t) {
|
|
462
|
-
r.reject(t);
|
|
463
|
-
}
|
|
464
|
-
};
|
|
465
|
-
return r.promise = new Promise(function(t, s) {
|
|
466
|
-
r.resolve = t, r.reject = s;
|
|
467
|
-
}), r;
|
|
468
|
-
}
|
|
469
|
-
function oe(r, t, s) {
|
|
470
|
-
var i = null, a = new Promise(function(c, n) {
|
|
471
|
-
i = setTimeout(function() {
|
|
472
|
-
n({ error: s });
|
|
473
|
-
}, t);
|
|
474
|
-
});
|
|
475
|
-
return Promise.race([r, a]).finally(function() {
|
|
476
|
-
clearTimeout(i);
|
|
477
|
-
});
|
|
478
|
-
}
|
|
479
|
-
function K() {
|
|
480
|
-
var r = g();
|
|
481
|
-
if (!h.enable || h.iframe)
|
|
482
|
-
return r.setSuccess(), r.promise;
|
|
483
|
-
var t = document.createElement("iframe");
|
|
484
|
-
h.iframe = t, t.onload = function() {
|
|
485
|
-
var a = e.endpoints.authorize();
|
|
486
|
-
a.charAt(0) === "/" ? h.iframeOrigin = re() : h.iframeOrigin = a.substring(0, a.indexOf("/", 8)), r.setSuccess();
|
|
487
|
-
};
|
|
488
|
-
var s = e.endpoints.checkSessionIframe();
|
|
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);
|
|
490
|
-
var i = function(a) {
|
|
491
|
-
if (!(a.origin !== h.iframeOrigin || h.iframe.contentWindow !== a.source) && (a.data == "unchanged" || a.data == "changed" || a.data == "error")) {
|
|
492
|
-
a.data != "unchanged" && e.clearToken();
|
|
493
|
-
for (var c = h.callbackList.splice(0, h.callbackList.length), n = c.length - 1; n >= 0; --n) {
|
|
494
|
-
var o = c[n];
|
|
495
|
-
a.data == "error" ? o.setError() : o.setSuccess(a.data == "unchanged");
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
};
|
|
499
|
-
return window.addEventListener("message", i, !1), r.promise;
|
|
500
|
-
}
|
|
501
|
-
function H() {
|
|
502
|
-
h.enable && e.token && setTimeout(function() {
|
|
503
|
-
L().then(function(r) {
|
|
504
|
-
r && H();
|
|
505
|
-
});
|
|
506
|
-
}, h.interval * 1e3);
|
|
507
|
-
}
|
|
508
|
-
function L() {
|
|
509
|
-
var r = g();
|
|
510
|
-
if (h.iframe && h.iframeOrigin) {
|
|
511
|
-
var t = e.clientId + " " + (e.sessionId ? e.sessionId : "");
|
|
512
|
-
h.callbackList.push(r);
|
|
513
|
-
var s = h.iframeOrigin;
|
|
514
|
-
h.callbackList.length == 1 && h.iframe.contentWindow.postMessage(t, s);
|
|
515
|
-
} else
|
|
516
|
-
r.setSuccess();
|
|
517
|
-
return r.promise;
|
|
518
|
-
}
|
|
519
|
-
function ae() {
|
|
520
|
-
var r = g();
|
|
521
|
-
if ((h.enable || e.silentCheckSsoRedirectUri) && typeof e.endpoints.thirdPartyCookiesIframe == "function") {
|
|
522
|
-
var t = document.createElement("iframe");
|
|
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);
|
|
524
|
-
var s = function(i) {
|
|
525
|
-
t.contentWindow === i.source && (i.data !== "supported" && i.data !== "unsupported" || (i.data === "unsupported" && (M(
|
|
526
|
-
`[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:
|
|
527
|
-
|
|
528
|
-
- It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).
|
|
529
|
-
- It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).
|
|
530
|
-
|
|
531
|
-
For more information see: https://www.keycloak.org/securing-apps/javascript-adapter#_modern_browsers`
|
|
532
|
-
), h.enable = !1, e.silentCheckSsoFallback && (e.silentCheckSsoRedirectUri = !1)), document.body.removeChild(t), window.removeEventListener("message", s), r.setSuccess()));
|
|
533
|
-
};
|
|
534
|
-
window.addEventListener("message", s, !1);
|
|
535
|
-
} else
|
|
536
|
-
r.setSuccess();
|
|
537
|
-
return oe(r.promise, e.messageReceiveTimeout, "Timeout when waiting for 3rd party check iframe message.");
|
|
538
|
-
}
|
|
539
|
-
function N(r) {
|
|
540
|
-
if (!r || r == "default")
|
|
541
|
-
return {
|
|
542
|
-
login: async function(n) {
|
|
543
|
-
return window.location.assign(await e.createLoginUrl(n)), g().promise;
|
|
544
|
-
},
|
|
545
|
-
logout: async function(n) {
|
|
546
|
-
if (((n == null ? void 0 : n.logoutMethod) ?? e.logoutMethod) === "GET") {
|
|
547
|
-
window.location.replace(e.createLogoutUrl(n));
|
|
548
|
-
return;
|
|
549
|
-
}
|
|
550
|
-
const l = document.createElement("form");
|
|
551
|
-
l.setAttribute("method", "POST"), l.setAttribute("action", e.createLogoutUrl(n)), l.style.display = "none";
|
|
552
|
-
const f = {
|
|
553
|
-
id_token_hint: e.idToken,
|
|
554
|
-
client_id: e.clientId,
|
|
555
|
-
post_logout_redirect_uri: p.redirectUri(n, !1)
|
|
556
|
-
};
|
|
557
|
-
for (const [d, m] of Object.entries(f)) {
|
|
558
|
-
const w = document.createElement("input");
|
|
559
|
-
w.setAttribute("type", "hidden"), w.setAttribute("name", d), w.setAttribute("value", m), l.appendChild(w);
|
|
560
|
-
}
|
|
561
|
-
document.body.appendChild(l), l.submit();
|
|
562
|
-
},
|
|
563
|
-
register: async function(n) {
|
|
564
|
-
return window.location.assign(await e.createRegisterUrl(n)), g().promise;
|
|
565
|
-
},
|
|
566
|
-
accountManagement: function() {
|
|
567
|
-
var n = e.createAccountUrl();
|
|
568
|
-
if (typeof n < "u")
|
|
569
|
-
window.location.href = n;
|
|
570
|
-
else
|
|
571
|
-
throw "Not supported by the OIDC server";
|
|
572
|
-
return g().promise;
|
|
573
|
-
},
|
|
574
|
-
redirectUri: function(n, o) {
|
|
575
|
-
return n && n.redirectUri ? n.redirectUri : e.redirectUri ? e.redirectUri : location.href;
|
|
576
|
-
}
|
|
577
|
-
};
|
|
578
|
-
if (r == "cordova") {
|
|
579
|
-
h.enable = !1;
|
|
580
|
-
var t = function(n, o, l) {
|
|
581
|
-
return window.cordova && window.cordova.InAppBrowser ? window.cordova.InAppBrowser.open(n, o, l) : window.open(n, o, l);
|
|
582
|
-
}, s = function(n) {
|
|
583
|
-
return n && n.cordovaOptions ? Object.keys(n.cordovaOptions).reduce(function(o, l) {
|
|
584
|
-
return o[l] = n.cordovaOptions[l], o;
|
|
585
|
-
}, {}) : {};
|
|
586
|
-
}, i = function(n) {
|
|
587
|
-
return Object.keys(n).reduce(function(o, l) {
|
|
588
|
-
return o.push(l + "=" + n[l]), o;
|
|
589
|
-
}, []).join(",");
|
|
590
|
-
}, a = function(n) {
|
|
591
|
-
var o = s(n);
|
|
592
|
-
return o.location = "no", n && n.prompt == "none" && (o.hidden = "yes"), i(o);
|
|
593
|
-
}, c = function() {
|
|
594
|
-
return e.redirectUri || "http://localhost";
|
|
595
|
-
};
|
|
596
|
-
return {
|
|
597
|
-
login: async function(n) {
|
|
598
|
-
var o = g(), l = a(n), f = await e.createLoginUrl(n), d = t(f, "_blank", l), m = !1, w = !1, S = function() {
|
|
599
|
-
w = !0, d.close();
|
|
600
|
-
};
|
|
601
|
-
return d.addEventListener("loadstart", function(y) {
|
|
602
|
-
if (y.url.indexOf(c()) == 0) {
|
|
603
|
-
var z = E(y.url);
|
|
604
|
-
T(z, o), S(), m = !0;
|
|
605
|
-
}
|
|
606
|
-
}), d.addEventListener("loaderror", function(y) {
|
|
607
|
-
if (!m)
|
|
608
|
-
if (y.url.indexOf(c()) == 0) {
|
|
609
|
-
var z = E(y.url);
|
|
610
|
-
T(z, o), S(), m = !0;
|
|
611
|
-
} else
|
|
612
|
-
o.setError(), S();
|
|
613
|
-
}), d.addEventListener("exit", function(y) {
|
|
614
|
-
w || o.setError({
|
|
615
|
-
reason: "closed_by_user"
|
|
616
|
-
});
|
|
617
|
-
}), o.promise;
|
|
618
|
-
},
|
|
619
|
-
logout: function(n) {
|
|
620
|
-
var o = g(), l = e.createLogoutUrl(n), f = t(l, "_blank", "location=no,hidden=yes,clearcache=yes"), d;
|
|
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 || (d = !0), f.close();
|
|
625
|
-
}), f.addEventListener("exit", function(m) {
|
|
626
|
-
d ? o.setError() : (e.clearToken(), o.setSuccess());
|
|
627
|
-
}), o.promise;
|
|
628
|
-
},
|
|
629
|
-
register: async function(n) {
|
|
630
|
-
var o = g(), l = await e.createRegisterUrl(), f = a(n), d = t(l, "_blank", f);
|
|
631
|
-
return d.addEventListener("loadstart", function(m) {
|
|
632
|
-
if (m.url.indexOf(c()) == 0) {
|
|
633
|
-
d.close();
|
|
634
|
-
var w = E(m.url);
|
|
635
|
-
T(w, o);
|
|
636
|
-
}
|
|
637
|
-
}), o.promise;
|
|
638
|
-
},
|
|
639
|
-
accountManagement: function() {
|
|
640
|
-
var n = e.createAccountUrl();
|
|
641
|
-
if (typeof n < "u") {
|
|
642
|
-
var o = t(n, "_blank", "location=no");
|
|
643
|
-
o.addEventListener("loadstart", function(l) {
|
|
644
|
-
l.url.indexOf(c()) == 0 && o.close();
|
|
645
|
-
});
|
|
646
|
-
} else
|
|
647
|
-
throw "Not supported by the OIDC server";
|
|
648
|
-
},
|
|
649
|
-
redirectUri: function(n) {
|
|
650
|
-
return c();
|
|
651
|
-
}
|
|
652
|
-
};
|
|
653
|
-
}
|
|
654
|
-
if (r == "cordova-native")
|
|
655
|
-
return h.enable = !1, {
|
|
656
|
-
login: async function(n) {
|
|
657
|
-
var o = g(), l = await e.createLoginUrl(n);
|
|
658
|
-
return universalLinks.subscribe("keycloak", function(f) {
|
|
659
|
-
universalLinks.unsubscribe("keycloak"), window.cordova.plugins.browsertab.close();
|
|
660
|
-
var d = E(f.url);
|
|
661
|
-
T(d, o);
|
|
662
|
-
}), window.cordova.plugins.browsertab.openUrl(l), o.promise;
|
|
663
|
-
},
|
|
664
|
-
logout: function(n) {
|
|
665
|
-
var o = g(), l = e.createLogoutUrl(n);
|
|
666
|
-
return universalLinks.subscribe("keycloak", function(f) {
|
|
667
|
-
universalLinks.unsubscribe("keycloak"), window.cordova.plugins.browsertab.close(), e.clearToken(), o.setSuccess();
|
|
668
|
-
}), window.cordova.plugins.browsertab.openUrl(l), o.promise;
|
|
669
|
-
},
|
|
670
|
-
register: async function(n) {
|
|
671
|
-
var o = g(), l = await e.createRegisterUrl(n);
|
|
672
|
-
return universalLinks.subscribe("keycloak", function(f) {
|
|
673
|
-
universalLinks.unsubscribe("keycloak"), window.cordova.plugins.browsertab.close();
|
|
674
|
-
var d = E(f.url);
|
|
675
|
-
T(d, o);
|
|
676
|
-
}), window.cordova.plugins.browsertab.openUrl(l), o.promise;
|
|
677
|
-
},
|
|
678
|
-
accountManagement: function() {
|
|
679
|
-
var n = e.createAccountUrl();
|
|
680
|
-
if (typeof n < "u")
|
|
681
|
-
window.cordova.plugins.browsertab.openUrl(n);
|
|
682
|
-
else
|
|
683
|
-
throw "Not supported by the OIDC server";
|
|
684
|
-
},
|
|
685
|
-
redirectUri: function(n) {
|
|
686
|
-
return n && n.redirectUri ? n.redirectUri : e.redirectUri ? e.redirectUri : "http://localhost";
|
|
687
|
-
}
|
|
688
|
-
};
|
|
689
|
-
throw "invalid adapter type: " + r;
|
|
690
|
-
}
|
|
691
|
-
const A = "kc-callback-";
|
|
692
|
-
var D = function() {
|
|
693
|
-
if (!(this instanceof D))
|
|
694
|
-
return new D();
|
|
695
|
-
localStorage.setItem("kc-test", "test"), localStorage.removeItem("kc-test");
|
|
696
|
-
var r = this;
|
|
697
|
-
function t() {
|
|
698
|
-
const c = Date.now();
|
|
699
|
-
for (const [n, o] of i()) {
|
|
700
|
-
const l = a(o);
|
|
701
|
-
(l === null || l < c) && localStorage.removeItem(n);
|
|
702
|
-
}
|
|
703
|
-
}
|
|
704
|
-
function s() {
|
|
705
|
-
for (const [c] of i())
|
|
706
|
-
localStorage.removeItem(c);
|
|
707
|
-
}
|
|
708
|
-
function i() {
|
|
709
|
-
return Object.entries(localStorage).filter(([c]) => c.startsWith(A));
|
|
710
|
-
}
|
|
711
|
-
function a(c) {
|
|
712
|
-
let n;
|
|
713
|
-
try {
|
|
714
|
-
n = JSON.parse(c);
|
|
715
|
-
} catch {
|
|
716
|
-
return null;
|
|
717
|
-
}
|
|
718
|
-
return O(n) && "expires" in n && typeof n.expires == "number" ? n.expires : null;
|
|
719
|
-
}
|
|
720
|
-
r.get = function(c) {
|
|
721
|
-
if (c) {
|
|
722
|
-
var n = A + c, o = localStorage.getItem(n);
|
|
723
|
-
return o && (localStorage.removeItem(n), o = JSON.parse(o)), t(), o;
|
|
724
|
-
}
|
|
725
|
-
}, r.add = function(c) {
|
|
726
|
-
t();
|
|
727
|
-
const n = A + c.state, o = JSON.stringify({
|
|
728
|
-
...c,
|
|
729
|
-
// Set the expiry time to 1 hour from now.
|
|
730
|
-
expires: Date.now() + 60 * 60 * 1e3
|
|
731
|
-
});
|
|
732
|
-
try {
|
|
733
|
-
localStorage.setItem(n, o);
|
|
734
|
-
} catch {
|
|
735
|
-
s(), localStorage.setItem(n, o);
|
|
736
|
-
}
|
|
737
|
-
};
|
|
738
|
-
}, j = function() {
|
|
739
|
-
if (!(this instanceof j))
|
|
740
|
-
return new j();
|
|
741
|
-
var r = this;
|
|
742
|
-
r.get = function(a) {
|
|
743
|
-
if (a) {
|
|
744
|
-
var c = s(A + a);
|
|
745
|
-
if (i(A + a, "", t(-100)), c)
|
|
746
|
-
return JSON.parse(c);
|
|
747
|
-
}
|
|
748
|
-
}, r.add = function(a) {
|
|
749
|
-
i(A + a.state, JSON.stringify(a), t(60));
|
|
750
|
-
}, r.removeItem = function(a) {
|
|
751
|
-
i(a, "", t(-100));
|
|
752
|
-
};
|
|
753
|
-
var t = function(a) {
|
|
754
|
-
var c = /* @__PURE__ */ new Date();
|
|
755
|
-
return c.setTime(c.getTime() + a * 60 * 1e3), c;
|
|
756
|
-
}, s = function(a) {
|
|
757
|
-
for (var c = a + "=", n = document.cookie.split(";"), o = 0; o < n.length; o++) {
|
|
758
|
-
for (var l = n[o]; l.charAt(0) == " "; )
|
|
759
|
-
l = l.substring(1);
|
|
760
|
-
if (l.indexOf(c) == 0)
|
|
761
|
-
return l.substring(c.length, l.length);
|
|
762
|
-
}
|
|
763
|
-
return "";
|
|
764
|
-
}, i = function(a, c, n) {
|
|
765
|
-
var o = a + "=" + c + "; expires=" + n.toUTCString() + "; ";
|
|
766
|
-
document.cookie = o;
|
|
767
|
-
};
|
|
768
|
-
};
|
|
769
|
-
function ie() {
|
|
770
|
-
try {
|
|
771
|
-
return new D();
|
|
772
|
-
} catch {
|
|
773
|
-
}
|
|
774
|
-
return new j();
|
|
775
|
-
}
|
|
776
|
-
function W(r) {
|
|
777
|
-
return function() {
|
|
778
|
-
e.enableLogging && r.apply(console, Array.prototype.slice.call(arguments));
|
|
779
|
-
};
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
function ce(u) {
|
|
783
|
-
const e = String.fromCodePoint(...u);
|
|
784
|
-
return btoa(e);
|
|
785
|
-
}
|
|
786
|
-
async function le(u) {
|
|
787
|
-
const p = new TextEncoder().encode(u);
|
|
788
|
-
if (typeof crypto > "u" || typeof crypto.subtle > "u")
|
|
789
|
-
throw new Error("Web Crypto API is not available.");
|
|
790
|
-
return await crypto.subtle.digest("SHA-256", p);
|
|
791
|
-
}
|
|
792
|
-
function V(u) {
|
|
793
|
-
const [e, p] = u.split(".");
|
|
794
|
-
if (typeof p != "string")
|
|
795
|
-
throw new Error("Unable to decode token, payload not found.");
|
|
796
|
-
let v;
|
|
797
|
-
try {
|
|
798
|
-
v = ue(p);
|
|
799
|
-
} catch (I) {
|
|
800
|
-
throw new Error("Unable to decode token, payload is not a valid Base64URL value.", { cause: I });
|
|
801
|
-
}
|
|
802
|
-
try {
|
|
803
|
-
return JSON.parse(v);
|
|
804
|
-
} catch (I) {
|
|
805
|
-
throw new Error("Unable to decode token, payload is not a valid JSON value.", { cause: I });
|
|
806
|
-
}
|
|
807
|
-
}
|
|
808
|
-
function ue(u) {
|
|
809
|
-
let e = u.replaceAll("-", "+").replaceAll("_", "/");
|
|
810
|
-
switch (e.length % 4) {
|
|
811
|
-
case 0:
|
|
812
|
-
break;
|
|
813
|
-
case 2:
|
|
814
|
-
e += "==";
|
|
815
|
-
break;
|
|
816
|
-
case 3:
|
|
817
|
-
e += "=";
|
|
818
|
-
break;
|
|
819
|
-
default:
|
|
820
|
-
throw new Error("Input is not of the correct length.");
|
|
821
|
-
}
|
|
822
|
-
try {
|
|
823
|
-
return de(e);
|
|
824
|
-
} catch {
|
|
825
|
-
return atob(e);
|
|
826
|
-
}
|
|
827
|
-
}
|
|
828
|
-
function de(u) {
|
|
829
|
-
return decodeURIComponent(atob(u).replace(/(.)/g, (e, p) => {
|
|
830
|
-
let v = p.charCodeAt(0).toString(16).toUpperCase();
|
|
831
|
-
return v.length < 2 && (v = "0" + v), "%" + v;
|
|
832
|
-
}));
|
|
833
|
-
}
|
|
834
|
-
function O(u) {
|
|
835
|
-
return typeof u == "object" && u !== null;
|
|
836
|
-
}
|
|
837
|
-
let k = null, x = null;
|
|
838
|
-
function fe(u, e = !0) {
|
|
839
|
-
return x ? (console.log("Keycloak already initialized, returning from cache"), x) : (k || (k = new q({
|
|
840
|
-
url: u.url,
|
|
841
|
-
realm: u.realm,
|
|
842
|
-
clientId: u.clientId
|
|
843
|
-
})), x = k.init({
|
|
844
|
-
onLoad: e ? "check-sso" : "login-required",
|
|
845
|
-
checkLoginIframe: !1
|
|
846
|
-
//silentCheckSsoRedirectUri: `${window.location.origin}/silent-check-sso.html`, // Ensure this file is set up
|
|
847
|
-
}).then((p) => p).catch((p) => (console.error("Failed to initialize Keycloak:", p), !1)), x);
|
|
848
|
-
}
|
|
849
|
-
function he() {
|
|
850
|
-
return k != null && k.authenticated && (k != null && k.idTokenParsed) ? {
|
|
851
|
-
fullname: k.idTokenParsed.name,
|
|
852
|
-
email: k.idTokenParsed.email,
|
|
853
|
-
lastname: k.idTokenParsed.family_name,
|
|
854
|
-
firstname: k.idTokenParsed.given_name,
|
|
855
|
-
username: k.idTokenParsed.preferred_username,
|
|
856
|
-
background: "grey",
|
|
857
|
-
// Optional custom value
|
|
858
|
-
token: k.token,
|
|
859
|
-
sub: k.idTokenParsed.sub
|
|
860
|
-
} : {};
|
|
861
|
-
}
|
|
862
|
-
function pe() {
|
|
863
|
-
if (k)
|
|
864
|
-
k.login();
|
|
865
|
-
else
|
|
866
|
-
throw new Error("Keycloak is not initialized.");
|
|
867
|
-
}
|
|
868
|
-
function me() {
|
|
869
|
-
if (k)
|
|
870
|
-
k.logout();
|
|
871
|
-
else
|
|
872
|
-
throw new Error("Keycloak is not initialized.");
|
|
873
|
-
}
|
|
874
|
-
function ke() {
|
|
875
|
-
return !!(k != null && k.authenticated);
|
|
876
|
-
}
|
|
877
|
-
async function ge(u) {
|
|
878
|
-
try {
|
|
879
|
-
const e = await fetch(u, { method: "HEAD", mode: "no-cors" });
|
|
880
|
-
return e.ok || e.type === "opaque";
|
|
881
|
-
} catch {
|
|
882
|
-
return !1;
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
const Ue = class {
|
|
886
|
-
constructor(u) {
|
|
887
|
-
X(this, u), 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 u = await fe({
|
|
926
|
-
url: this.keycloakUrl,
|
|
927
|
-
realm: this.keycloakRealm,
|
|
928
|
-
clientId: this.keycloakClientId
|
|
929
|
-
}, !0);
|
|
930
|
-
this.keycloak.emit({
|
|
931
|
-
init: u
|
|
932
|
-
}), ke() && (this.user = he(), this.authenticated = !0, this.auth.emit({
|
|
933
|
-
authenticated: this.authenticated,
|
|
934
|
-
user: this.user
|
|
935
|
-
}));
|
|
936
|
-
} catch (u) {
|
|
937
|
-
R.show(u.message, "error");
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
render() {
|
|
941
|
-
return U("div", { key: "041846174aaad541acce03588a087793d10daa1e", class: "block" }, !this.authenticated && U("eds-button", { key: "360a84ec79a15c9293e3898b77df649c469d9529", 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(u) {
|
|
945
|
-
X(this, u), this.splash = J(this, "splash", 7), this.inverse = !1, this.initPromise = void 0, this.isVisible = !0;
|
|
946
|
-
}
|
|
947
|
-
// When the component loads, check if there is a promise.
|
|
948
|
-
componentWillLoad() {
|
|
949
|
-
this.initPromise && this.handleInitPromise(this.initPromise);
|
|
950
|
-
}
|
|
951
|
-
// Watch for changes on initPromise.
|
|
952
|
-
async watchInitPromise(u) {
|
|
953
|
-
u && this.handleInitPromise(u);
|
|
954
|
-
}
|
|
955
|
-
async handleInitPromise(u) {
|
|
956
|
-
try {
|
|
957
|
-
await u, this.hideSplash();
|
|
958
|
-
} catch (e) {
|
|
959
|
-
this.splash.emit({ type: "error", message: e.message || "Unknown error" });
|
|
960
|
-
}
|
|
961
|
-
}
|
|
962
|
-
handleHideSplash() {
|
|
963
|
-
this.hideSplash();
|
|
964
|
-
}
|
|
965
|
-
hideSplash() {
|
|
966
|
-
this.isVisible = !1, this.splash.emit({ type: "hidden", message: "Splash screen hidden successfully" });
|
|
967
|
-
}
|
|
968
|
-
render() {
|
|
969
|
-
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;
|
|
970
|
-
}
|
|
971
|
-
static get watchers() {
|
|
972
|
-
return {
|
|
973
|
-
initPromise: ["watchInitPromise"]
|
|
974
|
-
};
|
|
975
|
-
}
|
|
976
|
-
};
|
|
977
|
-
ye.style = we;
|
|
978
|
-
export {
|
|
979
|
-
Ue as eds_login,
|
|
980
|
-
ye as eds_splash_screen
|
|
981
|
-
};
|