@arcblock/did-connect-react 3.1.28 → 3.1.31
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/lib/Connect/components/login-item/connect-choose-list.js +104 -102
- package/lib/Connect/plugins/email/list-item.js +13 -11
- package/lib/OAuth/context.js +98 -89
- package/lib/OAuth/passport-switcher.js +3 -112
- package/lib/Passkey/context.js +65 -54
- package/lib/Session/handler.js +55 -0
- package/lib/Session/hooks/use-session-token.js +109 -105
- package/lib/Session/index.js +455 -425
- package/lib/Session/libs/constants.js +5 -2
- package/lib/components/PassportSwitcher.js +128 -0
- package/lib/package.json.js +1 -1
- package/package.json +5 -5
- package/src/Connect/components/login-item/connect-choose-list.jsx +6 -0
- package/src/Connect/plugins/email/list-item.jsx +2 -0
- package/src/OAuth/context.jsx +15 -6
- package/src/OAuth/passport-switcher.jsx +2 -133
- package/src/Passkey/context.jsx +13 -5
- package/src/Session/handler.jsx +98 -0
- package/src/Session/hooks/use-session-token.js +12 -0
- package/src/Session/index.jsx +103 -31
- package/src/Session/libs/constants.js +3 -0
- package/src/components/PassportSwitcher.jsx +160 -0
package/lib/Session/index.js
CHANGED
|
@@ -1,96 +1,98 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as g, jsxs as j, Fragment as Mo } from "react/jsx-runtime";
|
|
2
2
|
import S from "prop-types";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import zo from "lodash/omit";
|
|
4
|
+
import Go from "lodash/pick";
|
|
5
|
+
import Ce from "lodash/cloneDeep";
|
|
6
6
|
import J from "lodash/isFunction";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { useTheme as
|
|
13
|
-
import { getVisitorId as $, isUrl as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { useReactive as
|
|
17
|
-
import { joinURL as
|
|
18
|
-
import { Icon as
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
7
|
+
import w from "lodash/isUndefined";
|
|
8
|
+
import Vo from "lodash/defaultsDeep";
|
|
9
|
+
import jo from "js-cookie";
|
|
10
|
+
import Ko from "eventemitter3";
|
|
11
|
+
import $o from "p-wait-for";
|
|
12
|
+
import { useTheme as qo, Typography as Xo, Box as K, CircularProgress as Qo } from "@mui/material";
|
|
13
|
+
import { getVisitorId as $, isUrl as Yo, ensureVisitorId as Jo, setVisitorId as Te } from "@arcblock/ux/lib/Util";
|
|
14
|
+
import ae, { ToastProvider as ke } from "@arcblock/ux/lib/Toast";
|
|
15
|
+
import Zo from "@arcblock/ux/lib/Center";
|
|
16
|
+
import { useReactive as ye, useCreation as Ie, useMemoizedFn as f, usePrevious as ei, useLatest as Le, useUpdateEffect as le, useMount as oi } from "ahooks";
|
|
17
|
+
import { joinURL as H } from "ufo";
|
|
18
|
+
import { Icon as ii } from "@iconify/react";
|
|
19
|
+
import ti from "@iconify-icons/material-symbols/keyboard-double-arrow-right-rounded";
|
|
20
|
+
import ri from "@arcblock/react-hooks/lib/useBrowser";
|
|
21
|
+
import ni from "@arcblock/ux/lib/Dialog/use-confirm";
|
|
22
22
|
import De from "@arcblock/ux/lib/DID";
|
|
23
|
-
import
|
|
24
|
-
import { getCurrentAppPid as
|
|
25
|
-
import { translate as
|
|
26
|
-
import { getBlockletSDK as
|
|
23
|
+
import _e from "@arcblock/ux/lib/Avatar";
|
|
24
|
+
import { getCurrentAppPid as si } from "@arcblock/ux/lib/SessionUser/libs/utils";
|
|
25
|
+
import { translate as ci } from "@arcblock/ux/lib/Locale/util";
|
|
26
|
+
import { getBlockletSDK as ai, BlockletSDK as li } from "@blocklet/js-sdk";
|
|
27
27
|
import P from "@arcblock/bridge";
|
|
28
|
-
import { getFederatedEnabled as
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import {
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import {
|
|
28
|
+
import { getFederatedEnabled as di } from "@arcblock/ux/lib/Util/federated";
|
|
29
|
+
import pi from "lodash/noop";
|
|
30
|
+
import fi from "lodash/isNil";
|
|
31
|
+
import { ReactGA as ui } from "@arcblock/ux/lib/withTracker";
|
|
32
|
+
import { useState as wi, useEffect as hi } from "react";
|
|
33
|
+
import Ee from "../Storage/index.js";
|
|
34
|
+
import { formatCacheTtl as mi, getBrowserLang as gi, debug as h, decodeUrlParams as ve, sleep as E, updateConnectedInfo as Z, getAppId as ee, logger as xe } from "../utils.js";
|
|
35
|
+
import Oe from "./window-focus-aware.js";
|
|
36
|
+
import { OAuthContext as Si, OAuthConsumer as Ai, OAuthProvider as Re, useOAuth as Pi } from "../OAuth/context.js";
|
|
37
|
+
import { PasskeyContext as bi, PasskeyConsumer as Ci, PasskeyProvider as Ne, usePasskey as Ti } from "../Passkey/context.js";
|
|
37
38
|
import "../Passkey/actions.js";
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import { SessionContext as
|
|
44
|
-
import
|
|
45
|
-
import { EVENTS as
|
|
46
|
-
import { translations as
|
|
47
|
-
import { NotOpenError as
|
|
48
|
-
import { SESSION_TOKEN_STORAGE_KEY as
|
|
49
|
-
import { getMobileVisitorId as
|
|
50
|
-
import
|
|
51
|
-
import { didSpacesIsRequired as
|
|
52
|
-
import
|
|
53
|
-
import { FederatedProvider as
|
|
54
|
-
import
|
|
55
|
-
import {
|
|
56
|
-
|
|
39
|
+
import ki, { getWalletDid as yi } from "../User/use-did.js";
|
|
40
|
+
import Ii from "../User/wrap-did.js";
|
|
41
|
+
import Li from "./hooks/use-federated.js";
|
|
42
|
+
import Di from "./hooks/use-session-token.js";
|
|
43
|
+
import _i from "./hooks/use-protected-routes.js";
|
|
44
|
+
import { SessionContext as qe } from "./context.js";
|
|
45
|
+
import Ei from "../Connect/use-connect.js";
|
|
46
|
+
import { EVENTS as c } from "./libs/constants.js";
|
|
47
|
+
import { translations as F } from "./libs/locales.js";
|
|
48
|
+
import { NotOpenError as vi } from "../error.js";
|
|
49
|
+
import { SESSION_TOKEN_STORAGE_KEY as Xe, REFRESH_TOKEN_STORAGE_KEY as Qe, API_DID_PREFIX as xi, DEFAULT_TIMEOUT as Oi, BLOCKLET_SERVICE_PATH_PREFIX as M, DID_SPACES_BASE_URL as Ri } from "../constant.js";
|
|
50
|
+
import { getMobileVisitorId as Ni, checkEnableAutoLogin as Wi, login as Fi } from "./libs/login-mobile.js";
|
|
51
|
+
import Bi from "../Connect/hooks/use-quick-connect.js";
|
|
52
|
+
import { didSpacesIsRequired as We } from "./libs/did-spaces.js";
|
|
53
|
+
import Ui from "./did-spaces-guide.js";
|
|
54
|
+
import { FederatedProvider as Hi, useFederatedContext as Mi } from "../Federated/context.js";
|
|
55
|
+
import zi from "./hooks/use-verify.js";
|
|
56
|
+
import { gaLoginSuccessHandler as Fe, gaLoginFailedHandler as Be, gaSwitchPassportSuccessHandler as Ue, gaSwitchPassportFailedHandler as He, gaBindWalletSuccessHandler as Me, gaBindWalletFailedHandler as ze } from "./handler.js";
|
|
57
|
+
import { loginFederatedMaster as Xt, mountFederatedIframe as Qt } from "./libs/federated.js";
|
|
58
|
+
const Ge = ai(), { Provider: Gi, Consumer: Ve } = qe, je = {
|
|
57
59
|
en: "DID Connect timeout, please reopen DID Connect popup",
|
|
58
60
|
zh: "DID Connect 超时, 请重新打开 DID Connect"
|
|
59
|
-
},
|
|
61
|
+
}, Ke = {
|
|
60
62
|
en: "DID Connect is already opened, please wait for it to complete",
|
|
61
63
|
zh: "DID Connect 已打开,请等待完成"
|
|
62
64
|
};
|
|
63
|
-
function
|
|
64
|
-
let
|
|
65
|
-
globalThis?.blocklet?.prefix && (
|
|
66
|
-
appendAuthServicePrefix:
|
|
65
|
+
function $e(q = Xe, X = "ls", oe = {}, T = {}) {
|
|
66
|
+
let D = "/";
|
|
67
|
+
globalThis?.blocklet?.prefix && (D = globalThis.blocklet.prefix), typeof T == "boolean" && (T = {
|
|
68
|
+
appendAuthServicePrefix: T,
|
|
67
69
|
extraParams: {}
|
|
68
|
-
}),
|
|
70
|
+
}), Vo(T, {
|
|
69
71
|
rolling: !0,
|
|
70
72
|
appendAuthServicePrefix: !1,
|
|
71
73
|
extraParams: {},
|
|
72
|
-
refreshTokenStorageKey:
|
|
74
|
+
refreshTokenStorageKey: Qe
|
|
73
75
|
});
|
|
74
|
-
function
|
|
76
|
+
function x(I) {
|
|
75
77
|
if (globalThis.blocklet)
|
|
76
|
-
if (
|
|
78
|
+
if (I?.user) {
|
|
77
79
|
const r = {
|
|
78
|
-
did:
|
|
80
|
+
did: I.user.did,
|
|
79
81
|
host: window.location.host,
|
|
80
82
|
appPid: globalThis.blocklet.appPid,
|
|
81
83
|
visitorId: $(),
|
|
82
|
-
sourceAppPid:
|
|
83
|
-
fullName:
|
|
84
|
+
sourceAppPid: I.user.sourceAppPid,
|
|
85
|
+
fullName: I.user.fullName
|
|
84
86
|
};
|
|
85
|
-
|
|
87
|
+
h("bridge callArc: onLogin", r), P.callArc("onLogin", { ...r, user: r });
|
|
86
88
|
} else
|
|
87
|
-
P.callArc("onLogin", { error: "no user", code: 400 }),
|
|
89
|
+
P.callArc("onLogin", { error: "no user", code: 400 }), h("notifyBridge failed", { sessionState: I });
|
|
88
90
|
}
|
|
89
|
-
const Q =
|
|
90
|
-
function
|
|
91
|
-
const r = Object.assign({},
|
|
92
|
-
|
|
93
|
-
const { connectApi:
|
|
91
|
+
const Q = Ee(q, X, oe), z = Ee(T.refreshTokenStorageKey, "ls");
|
|
92
|
+
function de({ ...I }) {
|
|
93
|
+
const r = Object.assign({}, I);
|
|
94
|
+
w(r.serviceHost) && (r.serviceHost = D), w(r.locale) && (r.locale = ""), w(r.action) && (r.action = "login"), w(r.prefix) && (r.prefix = xi), w(r.appendAuthServicePrefix) && (r.appendAuthServicePrefix = !1), w(r.extraParams) && (r.extraParams = {}), w(r.options) && (r.options = {}), w(r.autoConnect) && (r.autoConnect = !1), w(r.autoDisconnect) && (r.autoDisconnect = !0), w(r.useSocket) && (r.useSocket = !0), w(r.timeout) && (r.timeout = Oi * 1e3), w(r.webWalletUrl) && (r.webWalletUrl = void 0), w(r.protectedRoutes) && (r.protectedRoutes = ["*"]), w(r.apiOptions) && (r.apiOptions = {}), w(r.lazyRefreshToken) && (r.lazyRefreshToken = !1);
|
|
95
|
+
const { connectApi: k, connectHolder: ie } = Ei(), [Je, pe] = wi(0), y = ri(), { requestStorageAccess: Ze } = Mi(), { palette: eo } = qo(), B = new URLSearchParams(window.location.search), s = ye({
|
|
94
96
|
extraParams: {},
|
|
95
97
|
options: {},
|
|
96
98
|
currentLocale: r.locale,
|
|
@@ -100,13 +102,13 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
|
|
|
100
102
|
return typeof r.autoConnect == "boolean" ? r.autoConnect : !!r.autoLogin;
|
|
101
103
|
},
|
|
102
104
|
get prefix() {
|
|
103
|
-
return
|
|
105
|
+
return T.appendAuthServicePrefix || r.appendAuthServicePrefix ? H(M, r.prefix) : r.prefix;
|
|
104
106
|
},
|
|
105
107
|
get notificationPrefix() {
|
|
106
108
|
const e = "/api/notifications";
|
|
107
|
-
return
|
|
109
|
+
return T.appendAuthServicePrefix || r.appendAuthServicePrefix ? H(M, e) : e;
|
|
108
110
|
}
|
|
109
|
-
}), t =
|
|
111
|
+
}), t = ye({
|
|
110
112
|
action: r.action,
|
|
111
113
|
error: "",
|
|
112
114
|
initialized: !1,
|
|
@@ -118,54 +120,58 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
|
|
|
118
120
|
baseUrl: "",
|
|
119
121
|
unReadCount: 0
|
|
120
122
|
// 不可以直接个性 props.autoConnect (readonly)
|
|
121
|
-
}), b =
|
|
122
|
-
if (t.open && !
|
|
123
|
-
const e =
|
|
124
|
-
throw
|
|
123
|
+
}), b = Ie(() => r.locale || s.currentLocale || gi(), [r.locale, s.currentLocale]), { confirmApi: oo, confirmHolder: io } = ni(), O = f(() => {
|
|
124
|
+
if (t.open && !y.arcSphere) {
|
|
125
|
+
const e = Ke[b] || Ke.en;
|
|
126
|
+
throw ae.warning(e), new Error(e);
|
|
125
127
|
}
|
|
126
|
-
}),
|
|
128
|
+
}), d = Ie(() => new Ko(), []);
|
|
129
|
+
hi(() => (d.on(c.LOGIN, Fe), d.on(c.LOGIN_FAILED, Be), d.on(c.SWITCH_PASSPORT, Ue), d.on(c.SWITCH_PASSPORT_FAILED, He), d.on(c.BIND_WALLET, Me), d.on(c.BIND_WALLET_FAILED, ze), () => {
|
|
130
|
+
d.off(c.LOGIN, Fe), d.off(c.LOGIN_FAILED, Be), d.off(c.SWITCH_PASSPORT, Ue), d.off(c.SWITCH_PASSPORT_FAILED, He), d.off(c.BIND_WALLET, Me), d.off(c.BIND_WALLET_FAILED, ze);
|
|
131
|
+
}), [d]);
|
|
132
|
+
const U = f((e, o, i) => {
|
|
127
133
|
const n = {
|
|
128
|
-
login: [
|
|
129
|
-
"bind-wallet": [
|
|
130
|
-
"switch-passport": [
|
|
131
|
-
"switch-profile": [
|
|
134
|
+
login: [c.LOGIN, c.CANCEL_LOGIN],
|
|
135
|
+
"bind-wallet": [c.BIND_WALLET, c.CANCEL_BIND_WALLET],
|
|
136
|
+
"switch-passport": [c.SWITCH_PASSPORT, c.CANCEL_SWITCH_PASSPORT],
|
|
137
|
+
"switch-profile": [c.SWITCH_PROFILE, c.CANCEL_SWITCH_PROFILE],
|
|
132
138
|
// HACK: 对于内部来说,switch-did 就是 login,所以内部的监听事件仍然是 login
|
|
133
|
-
"switch-did": [
|
|
139
|
+
"switch-did": [c.LOGIN, c.CANCEL_LOGIN],
|
|
134
140
|
// @FIXME: @zhanghan 整个事件发射的机制需要重构,目前的实现不是很优雅,对于用户来说不是很好用。 https://github.com/ArcBlock/ux/pull/1414#discussion_r1904830954
|
|
135
|
-
"did-space-connected": [
|
|
141
|
+
"did-space-connected": [c.DID_SPACE_CONNECTED]
|
|
136
142
|
};
|
|
137
143
|
if (!Object.keys(n).includes(e))
|
|
138
144
|
return;
|
|
139
|
-
const
|
|
140
|
-
J(o) && await o(...
|
|
145
|
+
const l = async (...u) => {
|
|
146
|
+
J(o) && await o(...u), d.emit(e, ...u);
|
|
141
147
|
};
|
|
142
|
-
|
|
143
|
-
J(
|
|
148
|
+
d.once(n[e][0], l), d.once(n[e][1], async (...u) => {
|
|
149
|
+
J(l) && d.off(n[e][0], l), J(i) && await i(...u), d.emit(`cancel-${e}`, ...u);
|
|
144
150
|
});
|
|
145
|
-
}),
|
|
146
|
-
syncSessionSate:
|
|
147
|
-
handleRefreshUser:
|
|
148
|
-
handleRefreshToken:
|
|
149
|
-
renewToken:
|
|
150
|
-
clearSession:
|
|
151
|
-
handleLoginResult:
|
|
152
|
-
decrypt:
|
|
153
|
-
service:
|
|
154
|
-
getSessionToken:
|
|
155
|
-
getRefreshToken:
|
|
156
|
-
setRefreshToken:
|
|
157
|
-
setSessionToken:
|
|
158
|
-
} =
|
|
151
|
+
}), to = ei(t.initialized, (e, o) => e !== o || e === !0 && o === !0), {
|
|
152
|
+
syncSessionSate: ro,
|
|
153
|
+
handleRefreshUser: C,
|
|
154
|
+
handleRefreshToken: no,
|
|
155
|
+
renewToken: so,
|
|
156
|
+
clearSession: fe,
|
|
157
|
+
handleLoginResult: v,
|
|
158
|
+
decrypt: _,
|
|
159
|
+
service: co,
|
|
160
|
+
getSessionToken: ao,
|
|
161
|
+
getRefreshToken: lo,
|
|
162
|
+
setRefreshToken: po,
|
|
163
|
+
setSessionToken: fo
|
|
164
|
+
} = Di({
|
|
159
165
|
state: t,
|
|
160
166
|
pageState: s,
|
|
161
167
|
sessionTokenStorage: Q,
|
|
162
|
-
refreshTokenStorage:
|
|
168
|
+
refreshTokenStorage: z,
|
|
163
169
|
serviceHost: r.serviceHost,
|
|
164
170
|
apiOptions: r.apiOptions,
|
|
165
171
|
lazyRefreshToken: r.lazyRefreshToken,
|
|
166
172
|
onRefresh({ type: e, sessionToken: o, refreshToken: i, user: n }) {
|
|
167
|
-
if (
|
|
168
|
-
const
|
|
173
|
+
if (h("onRefresh", { type: e, user: n }), globalThis.blocklet) {
|
|
174
|
+
const l = {
|
|
169
175
|
did: n.did,
|
|
170
176
|
host: window.location.host,
|
|
171
177
|
appPid: globalThis.blocklet.appPid,
|
|
@@ -173,72 +179,74 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
|
|
|
173
179
|
sourceAppPid: n.sourceAppPid,
|
|
174
180
|
fullName: n.fullName
|
|
175
181
|
};
|
|
176
|
-
e === "refreshToken" ? (
|
|
182
|
+
e === "refreshToken" ? (h("bridge callArc: onRefreshToken"), P.callArc("onRefreshToken", {
|
|
177
183
|
sessionToken: o,
|
|
178
184
|
refreshToken: i,
|
|
179
|
-
user:
|
|
180
|
-
})) : e === "refreshUser" && (
|
|
185
|
+
user: l
|
|
186
|
+
})) : e === "refreshUser" && (h("bridge callArc: onRefreshUser"), P.callArc("onRefreshUser", {
|
|
181
187
|
sessionToken: o,
|
|
182
188
|
refreshToken: i,
|
|
183
|
-
user:
|
|
189
|
+
user: l
|
|
184
190
|
}));
|
|
185
191
|
}
|
|
186
192
|
}
|
|
187
|
-
}),
|
|
188
|
-
|
|
193
|
+
}), uo = zi({ state: t, connectApi: k }), ue = f((e, o = {}, i = {}) => {
|
|
194
|
+
O();
|
|
189
195
|
const n = e;
|
|
190
|
-
typeof n == "object" && (e = n.onSuccess, o = n.extraParams || {}, i = n.options || {}, i.origin = n.origin || ""), (!t.user || i.origin === "switch-did") && (i.origin === "switch-did" ?
|
|
191
|
-
}),
|
|
196
|
+
typeof n == "object" && (e = n.onSuccess, o = n.extraParams || {}, i = n.options || {}, i.origin = n.origin || ""), (!t.user || i.origin === "switch-did") && (i.origin === "switch-did" ? U("switch-did", e, n?.onCancel) : U("login", e, n?.onCancel), s.extraParams = o, s.options = i, t.action = "login", W());
|
|
197
|
+
}), wo = f((e, o = {}) => {
|
|
192
198
|
const i = e;
|
|
193
|
-
return function(...
|
|
194
|
-
const
|
|
199
|
+
return function(...l) {
|
|
200
|
+
const u = this;
|
|
195
201
|
return (async () => {
|
|
196
202
|
try {
|
|
197
|
-
const
|
|
198
|
-
if (!
|
|
203
|
+
const p = await uo(o);
|
|
204
|
+
if (!p.sessionId)
|
|
199
205
|
throw new Error("Authentication failed");
|
|
200
|
-
return await i.call(
|
|
201
|
-
} catch (
|
|
202
|
-
throw console.error("Authentication failed",
|
|
206
|
+
return await i.call(u, p, ...l);
|
|
207
|
+
} catch (p) {
|
|
208
|
+
throw console.error("Authentication failed", p), p;
|
|
203
209
|
}
|
|
204
210
|
})();
|
|
205
211
|
};
|
|
206
212
|
}), te = f(async (e, o = {}, i = {}) => {
|
|
207
|
-
|
|
213
|
+
O();
|
|
208
214
|
const n = e;
|
|
209
|
-
typeof n == "object" && (e = n.onSuccess, o = n.extraParams || {}, i = n.options || {}),
|
|
210
|
-
const { params:
|
|
211
|
-
if (
|
|
212
|
-
const
|
|
213
|
-
|
|
215
|
+
typeof n == "object" && (e = n.onSuccess, o = n.extraParams || {}, i = n.options || {}), w(o?.inviter) && window.localStorage.getItem("inviter") && (o.inviter = window.localStorage.getItem("inviter"));
|
|
216
|
+
const { params: l } = await ve();
|
|
217
|
+
if (w(o?.forceConnected) && l?.forceConnected && (o.forceConnected = l.forceConnected, w(i.showQuickConnect) && (i.showQuickConnect = !1)), w(o?.sourceAppPid) && !w(l?.sourceAppPid) && (o.sourceAppPid = l.sourceAppPid), o?.openMode === "redirect") {
|
|
218
|
+
const m = o?.redirect || "/", L = new URL(`${M}/login`, window.location.origin);
|
|
219
|
+
L.searchParams.set("redirect", m), o?.forceConnected && L.searchParams.set("forceConnected", o?.forceConnected), w(o?.sourceAppPid) || L.searchParams.set("sourceAppPid", o?.sourceAppPid), w(o?.inviter) || L.searchParams.set("inviter", o?.inviter), i?.origin && L.searchParams.set("origin", i.origin), window.location.href = L.href;
|
|
214
220
|
return;
|
|
215
221
|
}
|
|
216
|
-
let
|
|
217
|
-
|
|
218
|
-
const
|
|
219
|
-
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
}),
|
|
222
|
+
let u = o?.sourceAppPid;
|
|
223
|
+
w(u) && xo && (u = Oo.appPid), await $o(() => t.initialized), typeof i == "string" && (i = { origin: i });
|
|
224
|
+
const p = Ce(o);
|
|
225
|
+
p.passkeyBehavior = "both", s.allowWallet = void 0;
|
|
226
|
+
const a = p?.openMode || r?.extraParams?.openMode;
|
|
227
|
+
w(a) ? u ? u !== globalThis.blocklet.appPid && di(globalThis.blocklet) && (s.openMode = "window") : s.openMode = "popup" : s.openMode = a, s.openMode === "window" && !y.arcSphere && !y.wallet && await Ze() && (s.openMode = "popup"), u ? t.baseUrl = globalThis.blocklet.appUrl : t.baseUrl = "", ue(e, p, i);
|
|
228
|
+
}), we = f(async (e) => {
|
|
223
229
|
const o = $();
|
|
224
|
-
if (globalThis.blocklet && (
|
|
230
|
+
if (globalThis.blocklet && (Ge.user.logout({ visitorId: o }).catch((i) => {
|
|
225
231
|
console.warn("Failed to logout remote", i);
|
|
226
|
-
}), await
|
|
232
|
+
}), await E(100)), globalThis.blocklet) {
|
|
227
233
|
const i = {
|
|
228
234
|
visitorId: o,
|
|
229
235
|
appPid: globalThis.blocklet.appPid,
|
|
230
236
|
userDid: t.user.did
|
|
231
237
|
};
|
|
232
|
-
|
|
238
|
+
h("bridge callArc: onLogout", i), P.callArc("onLogout", i);
|
|
233
239
|
}
|
|
234
|
-
|
|
240
|
+
fe(), V(), t.user = null, t.provider = "", t.walletOS = "", t.error = "", t.loading = !1, d.emit("logout"), ui.set({
|
|
241
|
+
user_id: void 0
|
|
242
|
+
}), typeof e == "function" && e();
|
|
235
243
|
}), {
|
|
236
|
-
userSessions:
|
|
237
|
-
refresh:
|
|
238
|
-
loaded:
|
|
244
|
+
userSessions: ho,
|
|
245
|
+
refresh: mo,
|
|
246
|
+
loaded: go,
|
|
239
247
|
loginUserSession: re
|
|
240
|
-
} =
|
|
241
|
-
appPid:
|
|
248
|
+
} = Bi({
|
|
249
|
+
appPid: si(t.user),
|
|
242
250
|
loginAppPid: globalThis?.blocklet?.appPid,
|
|
243
251
|
sourceAppPid: t?.user?.sourceAppPid,
|
|
244
252
|
autoFetch: !1,
|
|
@@ -250,9 +258,9 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
|
|
|
250
258
|
});
|
|
251
259
|
});
|
|
252
260
|
}), ne = f((e, o = {}, i = {}) => {
|
|
253
|
-
|
|
261
|
+
O();
|
|
254
262
|
const n = e;
|
|
255
|
-
typeof n == "object" && (e = n.onSuccess, o = n.extraParams || {}, i = n.options || {}), typeof i == "string" && (i = { origin: i }), i?.userSession ? re(i.userSession).then((
|
|
263
|
+
typeof n == "object" && (e = n.onSuccess, o = n.extraParams || {}, i = n.options || {}), typeof i == "string" && (i = { origin: i }), i?.userSession ? re(i.userSession).then((l) => {
|
|
256
264
|
Z(
|
|
257
265
|
{
|
|
258
266
|
connected_did: i.userSession.user.did,
|
|
@@ -261,35 +269,37 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
|
|
|
261
269
|
connected_app: ee()
|
|
262
270
|
},
|
|
263
271
|
!0
|
|
264
|
-
),
|
|
265
|
-
await
|
|
272
|
+
), U("switch-did", e), v({ ...l, encrypted: !1 }), C({ showProgress: !0 }).then(async () => {
|
|
273
|
+
await E(200), d.emit(c.LOGIN, l, _, A.current), x(A.current), await N();
|
|
274
|
+
}).catch((u) => {
|
|
275
|
+
throw d.emit(c.LOGIN_FAILED, u), u;
|
|
266
276
|
});
|
|
267
|
-
}) : (
|
|
268
|
-
}),
|
|
269
|
-
await
|
|
270
|
-
}),
|
|
271
|
-
await R(),
|
|
277
|
+
}) : (w(o?.forceConnected) && (o.forceConnected = !1), o.passkeyBehavior = "both", te(e, o, { ...i, origin: "switch-did" }));
|
|
278
|
+
}), So = f(async () => {
|
|
279
|
+
await Ge.user.refreshProfile();
|
|
280
|
+
}), Ao = f(async (e, o = {}) => {
|
|
281
|
+
await R(), O();
|
|
272
282
|
const i = e;
|
|
273
|
-
typeof i == "object" && (e = i.onSuccess, o = i.extraParams || {}),
|
|
274
|
-
}),
|
|
275
|
-
await R(),
|
|
283
|
+
typeof i == "object" && (e = i.onSuccess, o = i.extraParams || {}), U("switch-profile", e, i?.onCancel), s.extraParams = o, s.options = {}, t.action = "switch-profile", W();
|
|
284
|
+
}), Po = f(async (e, o = {}) => {
|
|
285
|
+
await R(), O();
|
|
276
286
|
const i = e;
|
|
277
|
-
typeof i == "object" && (e = i.onSuccess, o = i.extraParams || {}),
|
|
278
|
-
}),
|
|
287
|
+
typeof i == "object" && (e = i.onSuccess, o = i.extraParams || {}), U("switch-passport", e, i?.onCancel), s.extraParams = o, s.options = {}, t.action = "switch-passport", W();
|
|
288
|
+
}), bo = f(async ({ extraParams: e = {}, onSuccess: o = () => {
|
|
279
289
|
}, ...i } = {}) => {
|
|
280
|
-
await R(),
|
|
290
|
+
await R(), O(), s.extraParams = {
|
|
281
291
|
referrer: window.location.href,
|
|
282
292
|
purpose: "authorize-for-import",
|
|
283
293
|
...e,
|
|
284
294
|
saveConnect: !1
|
|
285
295
|
// 连接 spaces 不保存连接信息
|
|
286
|
-
}, s.options = {}, t.action = "connect-to-did-spaces-for-user",
|
|
296
|
+
}, s.options = {}, t.action = "connect-to-did-spaces-for-user", W({
|
|
287
297
|
hideCloseButton: !0,
|
|
288
298
|
onSuccess: o,
|
|
289
299
|
...i
|
|
290
300
|
});
|
|
291
|
-
}),
|
|
292
|
-
await R(),
|
|
301
|
+
}), he = f(async ({ extraParams: e = {}, onSuccess: o = {} } = {}) => {
|
|
302
|
+
await R(), bo({
|
|
293
303
|
extraParams: {
|
|
294
304
|
// service 交互
|
|
295
305
|
purpose: "authorize-for-import",
|
|
@@ -298,11 +308,11 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
|
|
|
298
308
|
onSuccess: o,
|
|
299
309
|
hideCloseButton: !1
|
|
300
310
|
});
|
|
301
|
-
}), { didSpacesGuideApi: Y, DidSpacesGuideView:
|
|
311
|
+
}), { didSpacesGuideApi: Y, DidSpacesGuideView: Co } = Ui({
|
|
302
312
|
autoClose: !1
|
|
303
|
-
}),
|
|
313
|
+
}), N = async ({ extraParams: e = {}, onSuccess: o = () => {
|
|
304
314
|
} } = {}) => {
|
|
305
|
-
await R(), await
|
|
315
|
+
await R(), await We(t?.user) && (Y.open(), Y.onConnect((i = pi) => {
|
|
306
316
|
const n = {
|
|
307
317
|
prefix: "/connect-to-did-space",
|
|
308
318
|
custom: !0,
|
|
@@ -317,109 +327,117 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
|
|
|
317
327
|
connectScope: "user",
|
|
318
328
|
...e
|
|
319
329
|
},
|
|
320
|
-
onSuccess: async (
|
|
321
|
-
const
|
|
322
|
-
await new
|
|
330
|
+
onSuccess: async (l, u) => {
|
|
331
|
+
const p = u ? u(l.spaceGateway) : l.spaceGateway;
|
|
332
|
+
await new li().user.updateDidSpace({ spaceGateway: p }), await C({ showProgress: !0 }), await o(l, u), await Y.close(), d.emit(c.DID_SPACE_CONNECTED, l, u), globalThis.blocklet && (h("bridge callArc: onDidSpaceConnected"), P.callArc("onDidSpaceConnected")), i(!0);
|
|
323
333
|
},
|
|
324
|
-
onError: (
|
|
325
|
-
console.error(
|
|
334
|
+
onError: (l) => {
|
|
335
|
+
console.error(l), ae.error(l.message), Y.close(), i(!1);
|
|
326
336
|
},
|
|
327
337
|
onClose: () => {
|
|
328
338
|
i();
|
|
329
339
|
}
|
|
330
340
|
};
|
|
331
|
-
|
|
332
|
-
baseUrl:
|
|
341
|
+
k.openPopup(n, {
|
|
342
|
+
baseUrl: Ri
|
|
333
343
|
});
|
|
334
344
|
}));
|
|
335
|
-
},
|
|
336
|
-
if (await R(),
|
|
337
|
-
e({},
|
|
345
|
+
}, me = f(async (e, o = {}) => {
|
|
346
|
+
if (await R(), yi(t.user)) {
|
|
347
|
+
e({}, _, A.current);
|
|
338
348
|
return;
|
|
339
349
|
}
|
|
340
|
-
|
|
350
|
+
O();
|
|
341
351
|
const i = e;
|
|
342
|
-
typeof i == "object" && (e = i.onSuccess),
|
|
352
|
+
typeof i == "object" && (e = i.onSuccess), U("bind-wallet", e, i?.onCancel), s.extraParams = o, s.options = {}, t.action = "bind-wallet", W();
|
|
343
353
|
}), se = f(async (e) => {
|
|
344
|
-
|
|
354
|
+
h("onSwitchPassport", { result: e }), s.extraParams = {}, s.options = {}, v(e), t.loading = !1, await C({ showProgress: !0 }), await E(200), d.emit(c.SWITCH_PASSPORT, e, _, A.current), globalThis.blocklet && (h("bridge callArc: onSwitchPassport"), P.callArc("onSwitchPassport"));
|
|
355
|
+
}), To = f((e) => {
|
|
356
|
+
d.emit(c.SWITCH_PASSPORT_FAILED, e);
|
|
345
357
|
}), G = f(async (e) => {
|
|
346
358
|
if (t.action === "switch-passport") {
|
|
347
359
|
se(e);
|
|
348
360
|
return;
|
|
349
361
|
}
|
|
350
|
-
|
|
351
|
-
}),
|
|
352
|
-
|
|
353
|
-
|
|
362
|
+
h("onLogin", { result: e }), s.extraParams = {}, s.options = {}, v(e), t.loading = !1, await C({ showProgress: !0 }), await E(200), t.action === "login" && (h("onLogin: emit LOGIN event", { result: e }), d.emit(c.LOGIN, e, _, A.current), x(A.current), N());
|
|
363
|
+
}), ko = f((e) => {
|
|
364
|
+
d.emit(c.LOGIN_FAILED, e);
|
|
365
|
+
}), yo = f((e) => {
|
|
366
|
+
s.extraParams = {}, s.options = {}, v(e), t.loading = !1, C({ showProgress: !0 }).then(async () => {
|
|
367
|
+
await E(100), d.emit(c.BIND_WALLET, e, _, A.current), globalThis.blocklet && (h("bridge callArc: onBindWallet"), P.callArc("onBindWallet"));
|
|
354
368
|
});
|
|
355
|
-
}),
|
|
356
|
-
|
|
357
|
-
|
|
369
|
+
}), Io = f((e) => {
|
|
370
|
+
d.emit(c.BIND_WALLET_FAILED, e, A);
|
|
371
|
+
}), Lo = f((e) => {
|
|
372
|
+
h("onSwitchProfile", { result: e }), s.extraParams = {}, s.options = {}, t.loading = !1, C({ showProgress: !0 }).then(async () => {
|
|
373
|
+
await E(100), d.emit(c.SWITCH_PROFILE, e, _, A.current), globalThis.blocklet && (h("bridge callArc: onSwitchProfile"), P.callArc("onSwitchProfile"));
|
|
358
374
|
});
|
|
359
|
-
}),
|
|
375
|
+
}), Do = f((e) => {
|
|
360
376
|
s.extraParams = {}, s.options = {}, V();
|
|
361
377
|
const o = {
|
|
362
|
-
login:
|
|
363
|
-
"switch-profile":
|
|
364
|
-
"switch-passport":
|
|
365
|
-
"bind-wallet":
|
|
378
|
+
login: c.CANCEL_LOGIN,
|
|
379
|
+
"switch-profile": c.CANCEL_SWITCH_PROFILE,
|
|
380
|
+
"switch-passport": c.CANCEL_SWITCH_PASSPORT,
|
|
381
|
+
"bind-wallet": c.CANCEL_BIND_WALLET
|
|
366
382
|
}, i = {
|
|
367
383
|
login: "offLogin",
|
|
368
384
|
"switch-profile": "offSwitchProfile",
|
|
369
385
|
"switch-passport": "offSwitchPassport",
|
|
370
386
|
"bind-wallet": "offBindWallet"
|
|
371
387
|
};
|
|
372
|
-
|
|
373
|
-
}),
|
|
388
|
+
d.emit(o[e]), globalThis.blocklet && (h(`bridge callArc: ${i[e]}`), P.callArc(`${i[e]}`));
|
|
389
|
+
}), _o = f((e, ...o) => {
|
|
374
390
|
try {
|
|
375
|
-
|
|
391
|
+
ce[e](...o);
|
|
376
392
|
} catch (i) {
|
|
377
|
-
|
|
393
|
+
xe.error("Catch error in onSuccess", {
|
|
378
394
|
action: e,
|
|
379
395
|
args: o,
|
|
380
396
|
err: i
|
|
381
|
-
});
|
|
397
|
+
}), ce[`${e}-failed`]?.(i, ...o);
|
|
382
398
|
}
|
|
399
|
+
}), Eo = f((e, o, ...i) => {
|
|
400
|
+
ce[`${e}-failed`]?.(o, ...i);
|
|
383
401
|
}), {
|
|
384
|
-
federatedMaster:
|
|
385
|
-
federatedEnabled:
|
|
386
|
-
master:
|
|
387
|
-
} =
|
|
402
|
+
federatedMaster: vo,
|
|
403
|
+
federatedEnabled: xo,
|
|
404
|
+
master: Oo
|
|
405
|
+
} = Li({
|
|
388
406
|
locale: b,
|
|
389
|
-
decrypt:
|
|
390
|
-
login:
|
|
391
|
-
handleLoginResult:
|
|
392
|
-
handleRefreshUser:
|
|
393
|
-
setRefreshToken:
|
|
394
|
-
setSessionToken:
|
|
395
|
-
}), { checkMatch:
|
|
396
|
-
t.open = !1,
|
|
397
|
-
}),
|
|
407
|
+
decrypt: _,
|
|
408
|
+
login: ue,
|
|
409
|
+
handleLoginResult: v,
|
|
410
|
+
handleRefreshUser: C,
|
|
411
|
+
setRefreshToken: po,
|
|
412
|
+
setSessionToken: fo
|
|
413
|
+
}), { checkMatch: Ro } = _i({ protectedRoutes: r.protectedRoutes || [] }), No = Le(ho), ge = f(async () => (go || (await mo(), await E(100)), No.current)), V = f(() => {
|
|
414
|
+
t.open = !1, k.close();
|
|
415
|
+
}), W = async (e = {}) => {
|
|
398
416
|
let o = t.action;
|
|
399
417
|
s?.options?.origin === "switch-did" && (o = s?.options?.origin);
|
|
400
|
-
const i =
|
|
401
|
-
...
|
|
418
|
+
const i = F[o], n = i[b] || i.en, l = {
|
|
419
|
+
...T.extraParams,
|
|
402
420
|
...r.extraParams,
|
|
403
421
|
...s.extraParams,
|
|
404
422
|
previousUserDid: t?.user?.did,
|
|
405
423
|
email: t?.user?.email
|
|
406
424
|
};
|
|
407
|
-
if (o === "switch-did" &&
|
|
408
|
-
const
|
|
409
|
-
n.title =
|
|
425
|
+
if (o === "switch-did" && l?.forceConnected) {
|
|
426
|
+
const p = (a, m = {}) => ci(F["switch-specified-did"], a, b, "en", m);
|
|
427
|
+
n.title = p("title"), n.scan = p("scan", { did: l.forceConnected }), n.confirm = p("confirm"), n.success = p("success");
|
|
410
428
|
}
|
|
411
|
-
delete
|
|
412
|
-
const
|
|
429
|
+
delete l?.openMode;
|
|
430
|
+
const u = {
|
|
413
431
|
action: t.action,
|
|
414
432
|
locale: b,
|
|
415
433
|
hideCloseButton: e?.hideCloseButton,
|
|
416
|
-
extraParams:
|
|
434
|
+
extraParams: l,
|
|
417
435
|
options: { ...r.options || {}, ...s.options },
|
|
418
436
|
checkTimeout: r.timeout,
|
|
419
437
|
webWalletUrl: r.webWalletUrl,
|
|
420
438
|
messages: n,
|
|
421
439
|
useSocket: r.useSocket,
|
|
422
|
-
...
|
|
440
|
+
...zo(r, [
|
|
423
441
|
"action",
|
|
424
442
|
"locale",
|
|
425
443
|
// NOTICE: 将 serviceHost 也透传给 DID Connect 组件
|
|
@@ -438,7 +456,7 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
|
|
|
438
456
|
"protectedRoutes"
|
|
439
457
|
]),
|
|
440
458
|
// 允许 login/switchProfile/switchDid 的时候传入自定义参数
|
|
441
|
-
...
|
|
459
|
+
...Go(s.extraParams || {}, [
|
|
442
460
|
"autoConnect",
|
|
443
461
|
"forceConnected",
|
|
444
462
|
"saveConnect",
|
|
@@ -448,43 +466,43 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
|
|
|
448
466
|
// baseUrl: state.baseUrl || props.baseUrl || '',
|
|
449
467
|
// 注意 prefix 经过了特殊处理, 优先级高于 "...rest", 所以放在其后
|
|
450
468
|
prefix: s.prefix,
|
|
451
|
-
allowWallet:
|
|
452
|
-
onSuccess: async (...
|
|
453
|
-
|
|
469
|
+
allowWallet: w(s.allowWallet) ? t.action !== "login" || ["1", "true", void 0, null].includes(globalThis.blocklet?.DID_CONNECT_ALLOW_WALLET) : s.allowWallet,
|
|
470
|
+
onSuccess: async (...p) => {
|
|
471
|
+
_o(t.action, ...p), J(e?.onSuccess) && await e.onSuccess(...p), t.open = !1;
|
|
454
472
|
},
|
|
455
|
-
onClose(...
|
|
456
|
-
|
|
473
|
+
onClose(...p) {
|
|
474
|
+
Do(t.action, ...p);
|
|
457
475
|
},
|
|
458
|
-
onError(
|
|
459
|
-
console.error(
|
|
476
|
+
onError(p) {
|
|
477
|
+
console.error(t.action, p), Eo(t.action, p, A.current);
|
|
460
478
|
}
|
|
461
479
|
};
|
|
462
|
-
if (t.open = !0, ["login"].includes(t.action) && s.openMode === "window" && !(
|
|
480
|
+
if (t.open = !0, ["login"].includes(t.action) && s.openMode === "window" && !(y.wallet || y.arcSphere))
|
|
463
481
|
try {
|
|
464
|
-
const
|
|
465
|
-
...
|
|
482
|
+
const p = {
|
|
483
|
+
...u,
|
|
466
484
|
baseUrl: window.location.origin
|
|
467
485
|
};
|
|
468
|
-
|
|
469
|
-
} catch (
|
|
470
|
-
|
|
486
|
+
Yo(s.prefix) || (p.prefix = H(window.location.origin, r.serviceHost, s.prefix)), p.extraParams?.provider || (p.extraParams.provider = t?.user?.provider || "wallet"), await k.openPopup(p, { locale: b });
|
|
487
|
+
} catch (p) {
|
|
488
|
+
p instanceof vi && V(), p.message === "Timeout" ? ae.error(je[b] || je.en) : console.error(p);
|
|
471
489
|
}
|
|
472
490
|
else
|
|
473
|
-
|
|
474
|
-
},
|
|
475
|
-
const { params: e, url: o } = await
|
|
491
|
+
k.open(u);
|
|
492
|
+
}, Se = f(async () => {
|
|
493
|
+
const { params: e, url: o } = await ve();
|
|
476
494
|
if (e) {
|
|
477
|
-
const { switchBehavior: i, forceConnected: n, sourceAppPid:
|
|
495
|
+
const { switchBehavior: i, forceConnected: n, sourceAppPid: l, showClose: u } = e;
|
|
478
496
|
n === t.user.did ? window.history.replaceState(null, "trim", o) : i === "required" ? ne(() => {
|
|
479
497
|
}, {
|
|
480
498
|
openMode: "redirect",
|
|
481
499
|
redirect: o,
|
|
482
|
-
sourceAppPid:
|
|
500
|
+
sourceAppPid: l,
|
|
483
501
|
forceConnected: n
|
|
484
|
-
}) : i === "disabled" ? window.history.replaceState(null, "trim", o) :
|
|
485
|
-
title:
|
|
486
|
-
content: /* @__PURE__ */ j(
|
|
487
|
-
/* @__PURE__ */
|
|
502
|
+
}) : i === "disabled" ? window.history.replaceState(null, "trim", o) : oo.open({
|
|
503
|
+
title: F.switchAccountDialog[b].title,
|
|
504
|
+
content: /* @__PURE__ */ j(Mo, { children: [
|
|
505
|
+
/* @__PURE__ */ g(Xo, { variant: "body1", sx: { textAlign: "center", mb: 2 }, children: F.switchAccountDialog[b].description }),
|
|
488
506
|
/* @__PURE__ */ j(K, { sx: { display: "flex", alignItems: "center", color: "grey.A700" }, children: [
|
|
489
507
|
/* @__PURE__ */ j(
|
|
490
508
|
K,
|
|
@@ -497,20 +515,20 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
|
|
|
497
515
|
lineHeight: 1
|
|
498
516
|
},
|
|
499
517
|
children: [
|
|
500
|
-
/* @__PURE__ */
|
|
501
|
-
/* @__PURE__ */
|
|
502
|
-
|
|
518
|
+
/* @__PURE__ */ g(_e, { did: t.user.did, shape: "circle", variant: "circle", size: 80 }),
|
|
519
|
+
/* @__PURE__ */ g(De, { did: t.user.did, showAvatar: !1, compact: !0, responsive: !1 }),
|
|
520
|
+
F.switchAccountDialog[b].currentAccount
|
|
503
521
|
]
|
|
504
522
|
}
|
|
505
523
|
),
|
|
506
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ g(K, { sx: { display: "flex", justifyContent: "center", px: 2 }, children: /* @__PURE__ */ g(
|
|
507
525
|
K,
|
|
508
526
|
{
|
|
509
|
-
component:
|
|
510
|
-
icon:
|
|
527
|
+
component: ii,
|
|
528
|
+
icon: ti,
|
|
511
529
|
sx: {
|
|
512
530
|
fontSize: 24,
|
|
513
|
-
color:
|
|
531
|
+
color: eo.grey[400],
|
|
514
532
|
animation: "right 2.5s linear infinite",
|
|
515
533
|
"@keyframes right": {
|
|
516
534
|
"0%": {
|
|
@@ -541,46 +559,48 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
|
|
|
541
559
|
fontWeight: 500
|
|
542
560
|
},
|
|
543
561
|
children: [
|
|
544
|
-
/* @__PURE__ */
|
|
545
|
-
/* @__PURE__ */
|
|
546
|
-
|
|
562
|
+
/* @__PURE__ */ g(_e, { did: n, shape: "circle", variant: "circle", size: 80 }),
|
|
563
|
+
/* @__PURE__ */ g(De, { did: n, showAvatar: !1, compact: !0, responsive: !1 }),
|
|
564
|
+
F.switchAccountDialog[b].nextAccount
|
|
547
565
|
]
|
|
548
566
|
}
|
|
549
567
|
)
|
|
550
568
|
] })
|
|
551
569
|
] }),
|
|
552
|
-
showCloseButton:
|
|
570
|
+
showCloseButton: u,
|
|
553
571
|
showCancelButton: !1,
|
|
554
|
-
confirmButtonText:
|
|
555
|
-
async onConfirm(
|
|
556
|
-
const
|
|
557
|
-
if (
|
|
558
|
-
re(
|
|
572
|
+
confirmButtonText: F.switchAccountDialog[b].confirm,
|
|
573
|
+
async onConfirm(p) {
|
|
574
|
+
const m = (await ge()).find((L) => L.userDid === n);
|
|
575
|
+
if (m) {
|
|
576
|
+
re(m).then((L) => {
|
|
559
577
|
Z(
|
|
560
578
|
{
|
|
561
|
-
connected_did:
|
|
562
|
-
connected_pk:
|
|
563
|
-
connected_wallet_os:
|
|
579
|
+
connected_did: m.user.did,
|
|
580
|
+
connected_pk: m.user.pk,
|
|
581
|
+
connected_wallet_os: m.extra.walletOS,
|
|
564
582
|
connected_app: ee()
|
|
565
583
|
},
|
|
566
584
|
!0
|
|
567
|
-
),
|
|
568
|
-
await
|
|
585
|
+
), v({ ...L, encrypted: !1 }), C({ showProgress: !0 }).then(async () => {
|
|
586
|
+
await E(200), d.emit(c.LOGIN, L, _, A.current), x(A.current), await N();
|
|
587
|
+
}).catch((be) => {
|
|
588
|
+
throw d.emit(c.LOGIN_FAILED, be), be;
|
|
569
589
|
});
|
|
570
|
-
}),
|
|
590
|
+
}), p();
|
|
571
591
|
return;
|
|
572
592
|
}
|
|
573
593
|
ne(
|
|
574
594
|
() => {
|
|
575
|
-
|
|
595
|
+
p(), window.location.replace(o);
|
|
576
596
|
},
|
|
577
|
-
{ sourceAppPid:
|
|
597
|
+
{ sourceAppPid: l, forceConnected: n, enableSwitchApp: !1 },
|
|
578
598
|
{ showQuickConnect: !0 }
|
|
579
599
|
);
|
|
580
600
|
}
|
|
581
601
|
});
|
|
582
602
|
}
|
|
583
|
-
}),
|
|
603
|
+
}), Wo = f(async (e, o) => {
|
|
584
604
|
const i = Object.assign(
|
|
585
605
|
{
|
|
586
606
|
login: !0,
|
|
@@ -589,30 +609,30 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
|
|
|
589
609
|
},
|
|
590
610
|
o?.requirements
|
|
591
611
|
), n = o?.openMode || "popup";
|
|
592
|
-
i.login && await R(), i.bindWallet && await new Promise((
|
|
593
|
-
|
|
594
|
-
|
|
612
|
+
i.login && await R(), i.bindWallet && await new Promise((l) => {
|
|
613
|
+
me(() => {
|
|
614
|
+
l();
|
|
595
615
|
});
|
|
596
|
-
}), i.bindDidSpaces && (await
|
|
597
|
-
i.bindDidSpaces === "full" ?
|
|
616
|
+
}), i.bindDidSpaces && (await We(t?.user) || await new Promise((l) => {
|
|
617
|
+
i.bindDidSpaces === "full" ? N({
|
|
598
618
|
onSuccess() {
|
|
599
|
-
|
|
619
|
+
l();
|
|
600
620
|
}
|
|
601
|
-
}) : i.bindDidSpaces === "read" &&
|
|
621
|
+
}) : i.bindDidSpaces === "read" && he({
|
|
602
622
|
onSuccess() {
|
|
603
|
-
|
|
623
|
+
l();
|
|
604
624
|
}
|
|
605
625
|
});
|
|
606
|
-
})), n === "window" ?
|
|
626
|
+
})), n === "window" ? k.openPopup(e, o) : n === "popup" && k.open(e);
|
|
607
627
|
});
|
|
608
|
-
|
|
628
|
+
le(() => {
|
|
609
629
|
const e = Number(t.unReadCount || 0);
|
|
610
|
-
|
|
630
|
+
pe(e);
|
|
611
631
|
}, [t.unReadCount]);
|
|
612
|
-
const
|
|
632
|
+
const Fo = f(() => {
|
|
613
633
|
B.get("magicToken") && B.delete("magicToken"), B.toString() && window.history.replaceState({}, "", `${window.location.pathname}?${B.toString()}`);
|
|
614
|
-
}),
|
|
615
|
-
|
|
634
|
+
}), Ae = f((e) => new Promise((o, i) => {
|
|
635
|
+
k.open({
|
|
616
636
|
action: "login",
|
|
617
637
|
locale: b,
|
|
618
638
|
prefix: s.prefix,
|
|
@@ -622,77 +642,84 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
|
|
|
622
642
|
},
|
|
623
643
|
magicToken: e,
|
|
624
644
|
onSuccess(...n) {
|
|
625
|
-
G(...n),
|
|
645
|
+
G(...n), Fo(), o();
|
|
626
646
|
},
|
|
627
647
|
onError(n) {
|
|
628
|
-
|
|
648
|
+
d.emit(c.LOGIN_FAILED, n), i(n);
|
|
629
649
|
}
|
|
630
650
|
});
|
|
631
|
-
})),
|
|
651
|
+
})), Bo = {
|
|
632
652
|
...t,
|
|
633
653
|
loading: s.autoConnect && !t.user || t.loading,
|
|
634
|
-
openDidConnect:
|
|
654
|
+
openDidConnect: Wo,
|
|
635
655
|
login: te,
|
|
636
|
-
logout:
|
|
656
|
+
logout: we,
|
|
637
657
|
switchDid: ne,
|
|
638
|
-
autoSwitchDid:
|
|
639
|
-
refreshProfile:
|
|
640
|
-
switchProfile:
|
|
641
|
-
switchPassport:
|
|
642
|
-
connectToDidSpaceForImport:
|
|
643
|
-
connectToDidSpaceForFullAccess:
|
|
644
|
-
bindWallet:
|
|
645
|
-
refresh:
|
|
658
|
+
autoSwitchDid: Se,
|
|
659
|
+
refreshProfile: So,
|
|
660
|
+
switchProfile: Ao,
|
|
661
|
+
switchPassport: Po,
|
|
662
|
+
connectToDidSpaceForImport: he,
|
|
663
|
+
connectToDidSpaceForFullAccess: N,
|
|
664
|
+
bindWallet: me,
|
|
665
|
+
refresh: C,
|
|
646
666
|
updateConnectedInfo: Z,
|
|
647
667
|
// federated relates
|
|
648
|
-
federatedMaster:
|
|
668
|
+
federatedMaster: vo,
|
|
649
669
|
// oauth relates
|
|
650
|
-
useOAuth:
|
|
651
|
-
OAuthProvider:
|
|
652
|
-
OAuthConsumer:
|
|
653
|
-
OAuthContext:
|
|
670
|
+
useOAuth: Pi,
|
|
671
|
+
OAuthProvider: Re,
|
|
672
|
+
OAuthConsumer: Ai,
|
|
673
|
+
OAuthContext: Si,
|
|
654
674
|
// passkey relates
|
|
655
|
-
usePasskey:
|
|
656
|
-
PasskeyProvider:
|
|
657
|
-
PasskeyConsumer:
|
|
658
|
-
PasskeyContext:
|
|
675
|
+
usePasskey: Ti,
|
|
676
|
+
PasskeyProvider: Ne,
|
|
677
|
+
PasskeyConsumer: Ci,
|
|
678
|
+
PasskeyContext: bi,
|
|
659
679
|
// user related
|
|
660
|
-
useDid:
|
|
661
|
-
WrapDid:
|
|
662
|
-
getUserSessions:
|
|
680
|
+
useDid: ki,
|
|
681
|
+
WrapDid: Ii,
|
|
682
|
+
getUserSessions: ge,
|
|
663
683
|
async loginUserSession(e) {
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
684
|
+
try {
|
|
685
|
+
const o = await re(e);
|
|
686
|
+
Z(
|
|
687
|
+
{
|
|
688
|
+
connected_did: e.user.did,
|
|
689
|
+
connected_pk: e.user.pk,
|
|
690
|
+
connected_wallet_os: e.extra.walletOS,
|
|
691
|
+
connected_app: ee()
|
|
692
|
+
},
|
|
693
|
+
!0
|
|
694
|
+
), v({ ...o, encrypted: !1 }), await C({ showProgress: !0 }), await E(200), d.emit(c.LOGIN, o, _, A.current), x(A.current), await N();
|
|
695
|
+
} catch (o) {
|
|
696
|
+
throw d.emit(c.LOGIN_FAILED, o), o;
|
|
697
|
+
}
|
|
674
698
|
},
|
|
675
|
-
unReadCount:
|
|
676
|
-
setUnReadCount:
|
|
677
|
-
verifyMagicToken:
|
|
699
|
+
unReadCount: Je,
|
|
700
|
+
setUnReadCount: pe,
|
|
701
|
+
verifyMagicToken: Ae,
|
|
678
702
|
// 二次认证相关方法
|
|
679
|
-
withSecondaryAuth:
|
|
680
|
-
},
|
|
681
|
-
api:
|
|
682
|
-
events:
|
|
703
|
+
withSecondaryAuth: wo
|
|
704
|
+
}, A = Le(Bo), Uo = {
|
|
705
|
+
api: co,
|
|
706
|
+
events: d,
|
|
683
707
|
storage: Q,
|
|
684
|
-
connectApi:
|
|
685
|
-
session:
|
|
686
|
-
},
|
|
708
|
+
connectApi: k,
|
|
709
|
+
session: A.current
|
|
710
|
+
}, ce = {
|
|
687
711
|
login: G,
|
|
688
|
-
"switch-profile":
|
|
712
|
+
"switch-profile": Lo,
|
|
689
713
|
"switch-passport": se,
|
|
690
|
-
"
|
|
714
|
+
"switch-passport-failed": To,
|
|
715
|
+
"bind-wallet": yo,
|
|
716
|
+
"bind-wallet-failed": Io,
|
|
717
|
+
"login-failed": ko
|
|
691
718
|
};
|
|
692
|
-
|
|
719
|
+
le(() => {
|
|
693
720
|
if (t.initialized) {
|
|
694
|
-
const e = !
|
|
695
|
-
if (
|
|
721
|
+
const e = !to;
|
|
722
|
+
if (d.emit("change", { user: Ce(t.user), isFirst: e }), t.user && globalThis.blocklet) {
|
|
696
723
|
const o = {
|
|
697
724
|
did: t.user.did,
|
|
698
725
|
host: window.location.host,
|
|
@@ -701,7 +728,7 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
|
|
|
701
728
|
sourceAppPid: t.user.sourceAppPid,
|
|
702
729
|
fullName: t.user.fullName
|
|
703
730
|
};
|
|
704
|
-
|
|
731
|
+
h("bridge callArc: onChange", {
|
|
705
732
|
isFirst: e,
|
|
706
733
|
user: o
|
|
707
734
|
}), P.callArc("onChange", {
|
|
@@ -711,116 +738,119 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
|
|
|
711
738
|
});
|
|
712
739
|
}
|
|
713
740
|
}
|
|
714
|
-
}, [t.user, t.initialized,
|
|
715
|
-
t.initialized && t.user &&
|
|
716
|
-
}, [t.initialized]),
|
|
717
|
-
const e = (
|
|
718
|
-
|
|
741
|
+
}, [t.user, t.initialized, d]), le(() => {
|
|
742
|
+
t.initialized && t.user && Se();
|
|
743
|
+
}, [t.initialized]), oi(async () => {
|
|
744
|
+
const e = (a) => {
|
|
745
|
+
fi(a.encrypted) && (a.encrypted = !1), window.temporaryDIDConnectOnSuccess instanceof Function ? (h("bridgeOnLogin: temporaryDIDConnectOnSuccess", { result: a }), window.temporaryDIDConnectOnSuccess(a, (m) => m)) : (h("bridgeOnLogin: onLogin", { result: a }), G(a));
|
|
719
746
|
};
|
|
720
|
-
if (P.registerBlocklet("callLoginOAuth", (
|
|
721
|
-
|
|
722
|
-
...
|
|
747
|
+
if (P.registerBlocklet("callLoginOAuth", (a) => {
|
|
748
|
+
h("bridge registerBlocklet: callLoginOAuth", a), k.loginOAuth({
|
|
749
|
+
...a,
|
|
723
750
|
onLogin: e
|
|
724
751
|
});
|
|
725
|
-
}), P.registerBlocklet("logout",
|
|
726
|
-
|
|
727
|
-
}),
|
|
728
|
-
if (
|
|
729
|
-
|
|
730
|
-
const
|
|
731
|
-
|
|
732
|
-
} else if (
|
|
733
|
-
const
|
|
734
|
-
|
|
752
|
+
}), P.registerBlocklet("logout", we), P.registerBlocklet("login", (a) => {
|
|
753
|
+
h("bridge registerBlocklet: login", a), e(a);
|
|
754
|
+
}), Jo(), !$()) {
|
|
755
|
+
if (y.arcSphere) {
|
|
756
|
+
h("bridge callArc: getVisitorId");
|
|
757
|
+
const a = await P.callArc("getVisitorId");
|
|
758
|
+
h("bridge callArc: getVisitorId result", { walletVisitorId: a }), Te(a);
|
|
759
|
+
} else if (y.wallet) {
|
|
760
|
+
const a = await Ni();
|
|
761
|
+
Te(a);
|
|
735
762
|
}
|
|
736
763
|
}
|
|
737
|
-
const i =
|
|
764
|
+
const i = jo.get("connected_app"), n = ee();
|
|
738
765
|
if (r.autoDisconnect && i && n && i !== n) {
|
|
739
|
-
|
|
766
|
+
fe(), t.initialized = !0, s.autoConnect ? W() : V();
|
|
740
767
|
return;
|
|
741
768
|
}
|
|
742
|
-
const
|
|
769
|
+
const l = ao();
|
|
743
770
|
if (window?.self === window?.parent) {
|
|
744
|
-
let
|
|
745
|
-
if (
|
|
771
|
+
let a = "web";
|
|
772
|
+
if (y.mobile.apple.device ? a = "ios" : y.mobile.android.device && (a = "android"), y.wallet && Wi({ version: y.walletVersion, platform: a }) && !l)
|
|
746
773
|
try {
|
|
747
774
|
t.loading = !0;
|
|
748
|
-
const
|
|
749
|
-
if (
|
|
775
|
+
const m = await Fi();
|
|
776
|
+
if (m) {
|
|
750
777
|
await G({
|
|
751
|
-
sessionToken:
|
|
752
|
-
refreshToken:
|
|
753
|
-
visitorId:
|
|
778
|
+
sessionToken: m.sessionToken,
|
|
779
|
+
refreshToken: m.refreshToken,
|
|
780
|
+
visitorId: m.visitorId,
|
|
754
781
|
encrypted: !1
|
|
755
782
|
}), t.initialized = !0;
|
|
756
783
|
return;
|
|
757
784
|
}
|
|
785
|
+
} catch (m) {
|
|
786
|
+
throw d.emit(c.LOGIN_FAILED, m), m;
|
|
758
787
|
} finally {
|
|
759
788
|
t.loading = !1;
|
|
760
789
|
}
|
|
761
790
|
}
|
|
762
|
-
const
|
|
763
|
-
if (
|
|
791
|
+
const u = B.get("magicToken");
|
|
792
|
+
if (u)
|
|
764
793
|
try {
|
|
765
|
-
t.initialized = !0, await
|
|
766
|
-
} catch (
|
|
767
|
-
console.error("verifyMagicToken failed",
|
|
794
|
+
t.initialized = !0, await Ae(u);
|
|
795
|
+
} catch (a) {
|
|
796
|
+
console.error("verifyMagicToken failed", a);
|
|
768
797
|
}
|
|
769
|
-
if (
|
|
770
|
-
await
|
|
798
|
+
if (l) {
|
|
799
|
+
await C({ showProgress: !0 }), t.initialized = !0, t.user && await N();
|
|
771
800
|
return;
|
|
772
801
|
}
|
|
773
802
|
if (typeof window < "u") {
|
|
774
|
-
const
|
|
775
|
-
if (
|
|
776
|
-
|
|
803
|
+
const a = new URL(window.location.href), m = a.searchParams.get("loginToken");
|
|
804
|
+
if (m) {
|
|
805
|
+
v({ loginToken: m, encrypted: !1 }), a.searchParams.delete("loginToken"), window.history.replaceState({}, window.title, a.href);
|
|
777
806
|
return;
|
|
778
807
|
}
|
|
779
808
|
}
|
|
780
|
-
if (
|
|
781
|
-
await
|
|
809
|
+
if (lo()) {
|
|
810
|
+
await no(!0), t.initialized = !0;
|
|
782
811
|
return;
|
|
783
812
|
}
|
|
784
|
-
if (t.initialized = !0, s.autoConnect ?
|
|
813
|
+
if (t.initialized = !0, s.autoConnect ? W() : V(), y.arcSphere && ![
|
|
785
814
|
// 不应该唤起自动登录的路由
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
].includes(window.location.pathname) && !
|
|
815
|
+
H(M, "login"),
|
|
816
|
+
H(M, "connect"),
|
|
817
|
+
H(M, "lost-passport")
|
|
818
|
+
].includes(window.location.pathname) && !l)
|
|
790
819
|
try {
|
|
791
|
-
|
|
792
|
-
const
|
|
793
|
-
|
|
794
|
-
sessionToken:
|
|
795
|
-
refreshToken:
|
|
796
|
-
visitorId:
|
|
820
|
+
h("bridge callArc: autoLogin");
|
|
821
|
+
const a = await P.callArc("autoLogin");
|
|
822
|
+
h("bridgecallArc: autoLogin result", a), a && await G({
|
|
823
|
+
sessionToken: a.sessionToken,
|
|
824
|
+
refreshToken: a.refreshToken,
|
|
825
|
+
visitorId: a.visitorId,
|
|
797
826
|
encrypted: !1
|
|
798
827
|
});
|
|
799
|
-
} catch (
|
|
800
|
-
|
|
828
|
+
} catch (a) {
|
|
829
|
+
d.emit(c.LOGIN_FAILED, a), xe.error("Failed to autoLogin ArcSphere", a);
|
|
801
830
|
}
|
|
802
831
|
});
|
|
803
|
-
const
|
|
804
|
-
if (
|
|
805
|
-
return /* @__PURE__ */
|
|
832
|
+
const Ho = B.has("popup");
|
|
833
|
+
if (Ro() && !t.initialized)
|
|
834
|
+
return /* @__PURE__ */ g(Zo, { children: Ho ? null : /* @__PURE__ */ g(Qo, {}) });
|
|
806
835
|
const Pe = {
|
|
807
836
|
locale: b,
|
|
808
837
|
onSwitchPassport: ({ sessionToken: e, refreshToken: o }) => se({ sessionToken: e, refreshToken: o, encrypted: !1 }),
|
|
809
|
-
onUnbindOAuth: () =>
|
|
810
|
-
onBindOAuth: () =>
|
|
811
|
-
onAddPasskey: () =>
|
|
812
|
-
onRemovePasskey: () =>
|
|
838
|
+
onUnbindOAuth: () => C(),
|
|
839
|
+
onBindOAuth: () => C(),
|
|
840
|
+
onAddPasskey: () => C(),
|
|
841
|
+
onRemovePasskey: () => C(),
|
|
842
|
+
session: A.current
|
|
813
843
|
};
|
|
814
|
-
return /* @__PURE__ */
|
|
844
|
+
return /* @__PURE__ */ g(Gi, { value: Uo, children: /* @__PURE__ */ g(Ne, { ...Pe, children: /* @__PURE__ */ j(Re, { ...Pe, children: [
|
|
815
845
|
!t.open && typeof r.children == "function" ? r.children(t) : r.children,
|
|
816
846
|
ie,
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
/* @__PURE__ */
|
|
847
|
+
io,
|
|
848
|
+
Co,
|
|
849
|
+
T.rolling && /* @__PURE__ */ g(Oe, { callback: () => so() }),
|
|
850
|
+
/* @__PURE__ */ g(Oe, { callback: ro })
|
|
821
851
|
] }) }) });
|
|
822
852
|
}
|
|
823
|
-
|
|
853
|
+
de.propTypes = {
|
|
824
854
|
children: S.any.isRequired,
|
|
825
855
|
serviceHost: S.string,
|
|
826
856
|
action: S.string,
|
|
@@ -841,57 +871,57 @@ function Me(q = Fe, X = "ls", oe = {}, k = {}) {
|
|
|
841
871
|
apiOptions: S.object,
|
|
842
872
|
lazyRefreshToken: S.bool
|
|
843
873
|
};
|
|
844
|
-
function
|
|
845
|
-
return function(
|
|
846
|
-
return /* @__PURE__ */
|
|
874
|
+
function Ye(I) {
|
|
875
|
+
return function(k) {
|
|
876
|
+
return /* @__PURE__ */ g(ke, { children: /* @__PURE__ */ g(Ve, { children: (ie) => /* @__PURE__ */ g(I, { ...k, ...ie }) }) });
|
|
847
877
|
};
|
|
848
878
|
}
|
|
849
879
|
return {
|
|
850
|
-
SessionProvider: (
|
|
851
|
-
SessionConsumer:
|
|
852
|
-
SessionContext:
|
|
853
|
-
withSession:
|
|
880
|
+
SessionProvider: (I) => /* @__PURE__ */ g(ke, { children: /* @__PURE__ */ g(Hi, { children: /* @__PURE__ */ g(de, { ...I }) }) }),
|
|
881
|
+
SessionConsumer: Ve,
|
|
882
|
+
SessionContext: qe,
|
|
883
|
+
withSession: Ye
|
|
854
884
|
};
|
|
855
885
|
}
|
|
856
|
-
function
|
|
857
|
-
const X =
|
|
858
|
-
let
|
|
859
|
-
if (typeof window < "u" && (
|
|
860
|
-
let
|
|
886
|
+
function Kt({ storageEngine: q = "cookie" } = {}) {
|
|
887
|
+
const X = Xe, oe = Qe;
|
|
888
|
+
let T = null;
|
|
889
|
+
if (typeof window < "u" && (T = (globalThis.blocklet || {}).componentId), q === "cookie") {
|
|
890
|
+
let D = "/", x = 1;
|
|
861
891
|
if (typeof window < "u") {
|
|
862
|
-
const Q = window.env || {},
|
|
863
|
-
|
|
892
|
+
const Q = window.env || {}, z = window.blocklet || {};
|
|
893
|
+
D = Q.groupPathPrefix || z.groupPrefix || z.prefix || "", D = D.replace(/\/+$/, ""), D = D || "/", z.serverVersion && (x = mi(window.blocklet?.settings?.session?.cacheTtl, 1 / 24));
|
|
864
894
|
}
|
|
865
|
-
return
|
|
895
|
+
return $e(
|
|
866
896
|
X,
|
|
867
897
|
"cookie",
|
|
868
898
|
{
|
|
869
|
-
path:
|
|
899
|
+
path: D,
|
|
870
900
|
returnDomain: !1,
|
|
871
|
-
expireInDays:
|
|
901
|
+
expireInDays: x
|
|
872
902
|
},
|
|
873
903
|
{
|
|
874
904
|
appendAuthServicePrefix: !0,
|
|
875
|
-
extraParams: { componentId:
|
|
905
|
+
extraParams: { componentId: T },
|
|
876
906
|
refreshTokenStorageKey: oe
|
|
877
907
|
}
|
|
878
908
|
);
|
|
879
909
|
}
|
|
880
910
|
if (q === "localStorage")
|
|
881
|
-
return
|
|
911
|
+
return $e(X, "ls", {}, !0);
|
|
882
912
|
throw new Error("storageEngine must be cookie or localStorage");
|
|
883
913
|
}
|
|
884
914
|
export {
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
915
|
+
c as EVENTS,
|
|
916
|
+
qe as SessionContext,
|
|
917
|
+
Wi as checkEnableAutoLogin,
|
|
918
|
+
Kt as createAuthServiceSessionContext,
|
|
919
|
+
$e as createSessionContext,
|
|
920
|
+
$e as default,
|
|
921
|
+
We as didSpacesIsRequired,
|
|
922
|
+
Ni as getMobileVisitorId,
|
|
923
|
+
Fi as login,
|
|
924
|
+
Xt as loginFederatedMaster,
|
|
925
|
+
Qt as mountFederatedIframe,
|
|
926
|
+
F as translations
|
|
897
927
|
};
|