@embarkai/ui-kit 0.1.2 → 0.1.3

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/dist/index.js CHANGED
@@ -150,15 +150,11 @@ var init_initial = __esm({
150
150
  ]
151
151
  },
152
152
  wallet: {
153
- enabled: true,
153
+ enabled: false,
154
154
  supportedChains: [1, 137, 56],
155
155
  requireSignature: true,
156
156
  walletConnectProjectId: void 0
157
157
  },
158
- development: {
159
- enabled: true,
160
- showOnProduction: false
161
- },
162
158
  // preferedColorMode: 'light', // undefined means 'auto'
163
159
  ui: {
164
160
  title: "Sign in",
@@ -803,11 +799,13 @@ var init_iframe_mpc_client = __esm({
803
799
 
804
800
  // src/internal/constants.ts
805
801
  import { Key, Mail, Wallet2 } from "lucide-react";
806
- var LOCAL_COLOR_MODE_KEY, DEFAULT_AUTH_MENU_HEIGHT, DEFAULT_MAIN_MENU_HEIGHT, MAX_CONTENT_HEIGHT, MAIN_DIALOG_ANIMATION_SPEED, Y_ANIMATION_SETUP, BLOCKSCOUT_QUERY_STALE_TIME, BLOCKSCOUT_QUERY_GC_TIME, BLOCKSCOUT_REFRESH_DEBOUNCE, IPFS_GATEWAY, PROVIDERS_META;
802
+ var LOCAL_COLOR_MODE_KEY, LOOCAL_BACKUP_STATUS_KEY, LP_JWT_TOKENS_LS_KEY, DEFAULT_AUTH_MENU_HEIGHT, DEFAULT_MAIN_MENU_HEIGHT, MAX_CONTENT_HEIGHT, MAIN_DIALOG_ANIMATION_SPEED, Y_ANIMATION_SETUP, BLOCKSCOUT_QUERY_STALE_TIME, BLOCKSCOUT_QUERY_GC_TIME, BLOCKSCOUT_REFRESH_DEBOUNCE, IPFS_GATEWAY, PROVIDERS_META;
807
803
  var init_constants = __esm({
808
804
  "src/internal/constants.ts"() {
809
805
  init_assets();
810
- LOCAL_COLOR_MODE_KEY = "lumia-passport-theme";
806
+ LOCAL_COLOR_MODE_KEY = "passport-theme-mode";
807
+ LOOCAL_BACKUP_STATUS_KEY = "passport-backup-status";
808
+ LP_JWT_TOKENS_LS_KEY = "passport-jwt-tokens";
811
809
  DEFAULT_AUTH_MENU_HEIGHT = 253;
812
810
  DEFAULT_MAIN_MENU_HEIGHT = 90;
813
811
  MAX_CONTENT_HEIGHT = 640;
@@ -1275,7 +1273,7 @@ var init_package = __esm({
1275
1273
  "package.json"() {
1276
1274
  package_default = {
1277
1275
  name: "@embarkai/ui-kit",
1278
- version: "0.1.2",
1276
+ version: "0.1.3",
1279
1277
  description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
1280
1278
  type: "module",
1281
1279
  main: "./dist/index.cjs",
@@ -2192,31 +2190,31 @@ var init_zh = __esm({
2192
2190
  backToSignIn: "\u8FD4\u56DE\u767B\u5F55",
2193
2191
  orSeparator: "\u6216\u4F7F\u7528\u4EE5\u4E0B\u65B9\u5F0F\u767B\u5F55",
2194
2192
  email: {
2195
- placeholder: null
2193
+ placeholder: "\u8F93\u5165\u60A8\u7684\u7535\u5B50\u90AE\u4EF6\u5730\u5740"
2196
2194
  },
2197
2195
  verification: {
2198
- title: null,
2199
- sentTo: null,
2200
- codeExpires: null,
2201
- didntReceive: null,
2202
- resend: null
2196
+ title: "\u9A8C\u8BC1\u7801",
2197
+ sentTo: "\u6211\u4EEC\u5DF2\u5411\u4EE5\u4E0B\u90AE\u7BB1\u53D1\u9001\u9A8C\u8BC1\u7801\uFF1A",
2198
+ codeExpires: "\u9A8C\u8BC1\u7801\u5C06\u5728 {{time}} \u540E\u8FC7\u671F",
2199
+ didntReceive: "\u6CA1\u6536\u5230\u9A8C\u8BC1\u7801\uFF1F",
2200
+ resend: "\u91CD\u65B0\u53D1\u9001"
2203
2201
  },
2204
2202
  social: {
2205
- comingSoonMessage: null
2203
+ comingSoonMessage: "{{provider}} \u8EAB\u4EFD\u9A8C\u8BC1\u5373\u5C06\u63A8\u51FA\uFF01"
2206
2204
  },
2207
2205
  wallet: {
2208
- label: null
2206
+ label: "\u94B1\u5305"
2209
2207
  },
2210
2208
  passkey: {
2211
- label: null,
2212
- title: null,
2213
- signInExisting: null,
2214
- dontHave: null,
2215
- create: null
2209
+ label: "\u5BC6\u7801\u5BC6\u94A5",
2210
+ title: "\u5BC6\u7801\u5BC6\u94A5",
2211
+ signInExisting: "\u4F7F\u7528\u73B0\u6709\u5BC6\u7801\u767B\u5F55",
2212
+ dontHave: "\u6CA1\u6709\u5BC6\u7801\uFF1F",
2213
+ create: "\u521B\u5EFA\u901A\u884C\u5BC6\u94A5"
2216
2214
  },
2217
2215
  terms: {
2218
- text: null,
2219
- action: null
2216
+ text: "\u767B\u5F55\u5373\u8868\u793A\u60A8\u540C\u610F",
2217
+ action: "\u670D\u52A1\u6761\u6B3E"
2220
2218
  }
2221
2219
  },
2222
2220
  main: {
@@ -2271,38 +2269,38 @@ var init_zh = __esm({
2271
2269
  placeholder: "\u8F93\u5165\u65B0\u6635\u79F0",
2272
2270
  hint: "\u4EC5\u9650 3-20 \u4E2A\u5B57\u7B26\uFF0C\u5B57\u6BCD\u3001\u6570\u5B57\u548C\u4E0B\u5212\u7EBF\u5747\u53EF",
2273
2271
  errors: {
2274
- tooShort: null,
2275
- tooLong: null,
2276
- invalidChars: null,
2277
- invalidUnderscore: null,
2278
- invalidFormat: null,
2279
- nicknameTaken: null,
2280
- nicknameReserved: null,
2281
- cooldownActive: null,
2282
- nicknameNotFound: null,
2283
- unknown: null
2272
+ tooShort: "\u6635\u79F0\u5FC5\u987B\u81F3\u5C11\u5305\u542B 3 \u4E2A\u5B57\u7B26",
2273
+ tooLong: "\u6635\u79F0\u6700\u591A\u5305\u542B 20 \u4E2A\u5B57\u7B26",
2274
+ invalidChars: "\u6635\u79F0\u53EA\u80FD\u5305\u542B\u5C0F\u5199\u5B57\u6BCD\u3001\u6570\u5B57\u548C\u4E0B\u5212\u7EBF",
2275
+ invalidUnderscore: "\u6635\u79F0\u4E0D\u80FD\u4EE5\u4E0B\u5212\u7EBF\u5F00\u5934/\u7ED3\u5C3E\u6216\u5305\u542B\u53CC\u4E0B\u5212\u7EBF",
2276
+ invalidFormat: "\u6635\u79F0\u53EA\u80FD\u5305\u542B\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u548C\u4E0B\u5212\u7EBF",
2277
+ nicknameTaken: "\u6B64\u6635\u79F0\u5DF2\u88AB\u5360\u7528",
2278
+ nicknameReserved: "\u6B64\u6635\u79F0\u5DF2\u88AB\u4FDD\u7559",
2279
+ cooldownActive: "\u60A8\u53EF\u4EE5\u5728 {days} \u5929\u540E\u518D\u6B21\u66F4\u6539\u6635\u79F0",
2280
+ nicknameNotFound: "\u672A\u627E\u5230\u4F7F\u7528\u6B64\u6635\u79F0\u7684\u7528\u6237",
2281
+ unknown: "\u53D1\u751F\u9519\u8BEF"
2284
2282
  },
2285
2283
  availability: {
2286
- alreadyYourNickname: null,
2287
- checkingAvailability: null,
2288
- nicknameAvailable: null,
2289
- nicknameNotAvailable: null
2284
+ alreadyYourNickname: "\u6B64\u6635\u79F0\u5DF2\u662F\u60A8\u7684\u6635\u79F0",
2285
+ checkingAvailability: "\u6B63\u5728\u68C0\u67E5\u53EF\u7528\u6027...",
2286
+ nicknameAvailable: "\u6635\u79F0\u53EF\u7528",
2287
+ nicknameNotAvailable: "\u6B64\u6635\u79F0\u4E0D\u53EF\u7528"
2290
2288
  }
2291
2289
  },
2292
2290
  profilesMenu: {
2293
2291
  title: "\u4E2A\u4EBA\u8D44\u6599",
2294
2292
  email: {
2295
- placeholder: null,
2296
- sentTo: null,
2297
- warningTitle: null,
2298
- warningMsg: null
2293
+ placeholder: "\u63D0\u4F9B\u90AE\u7BB1\u4EE5\u8FDE\u63A5",
2294
+ sentTo: "\u6211\u4EEC\u5DF2\u5411\u60A8\u7684\u90AE\u7BB1\u53D1\u9001\u9A8C\u8BC1\u7801",
2295
+ warningTitle: "\u8FDE\u63A5\u90AE\u7BB1",
2296
+ warningMsg: "\u8FDE\u63A5\u60A8\u7684\u90AE\u7BB1\u4EE5\u4FBF\u66F4\u8F7B\u677E\u5730\u6062\u590D\u5E10\u6237\u5E76\u589E\u5F3A\u5B89\u5168\u6027\u3002"
2299
2297
  },
2300
2298
  passkey: {
2301
- message: null,
2302
- message2: null,
2303
- linking: null,
2304
- createOnDevice: null,
2305
- createOnSecurityKey: null
2299
+ message: "\u4F7F\u7528 WebAuth \u5C06\u901A\u884C\u5BC6\u94A5\u5173\u8054\u5230\u60A8\u7684\u5E10\u6237\u3002\u60A8\u7684\u8BBE\u5907\u53EF\u80FD\u5141\u8BB8\u60A8\u9009\u62E9\u73B0\u6709\u7684\u5BC6\u7801\u3002",
2300
+ message2: "\u5426\u5219\u5C06\u521B\u5EFA\u4E00\u4E2A\u65B0\u7684\u5BC6\u7801",
2301
+ linking: "\u6B63\u5728\u5173\u8054\u5BC6\u7801...",
2302
+ createOnDevice: "\u5728\u6B64\u8BBE\u5907\u4E0A\u521B\u5EFA\u5BC6\u7801",
2303
+ createOnSecurityKey: "\u6DFB\u52A0\u5BC6\u7801\u914D\u7F6E\u6587\u4EF6"
2306
2304
  },
2307
2305
  unlinkTitle: "\u6B64\u64CD\u4F5C\u65E0\u6CD5\u64A4\u9500",
2308
2306
  unlinkConfirm: "\u8F93\u5165\u63D0\u4F9B\u5546 ID \u4EE5\u786E\u8BA4\u79FB\u9664",
@@ -2311,21 +2309,21 @@ var init_zh = __esm({
2311
2309
  securityMenu: {
2312
2310
  title: "\u5B89\u5168",
2313
2311
  trustedApps: {
2314
- trustedApp: null,
2315
- trustedApps: null,
2316
- noTrustedApps: null,
2317
- removalNoteTitle: null,
2318
- removalNoteMsg1: null,
2319
- removalNoteMsg2: null
2312
+ trustedApp: "\u53D7\u4FE1\u4EFB\u7684\u5E94\u7528\u7A0B\u5E8F",
2313
+ trustedApps: "\u53D7\u4FE1\u4EFB\u7684\u5E94\u7528\u7A0B\u5E8F",
2314
+ noTrustedApps: "\u672A\u627E\u5230\u53D7\u4FE1\u4EFB\u7684\u5E94\u7528\u7A0B\u5E8F",
2315
+ removalNoteTitle: "\u79FB\u9664\u6B64\u5E94\u7528\u7A0B\u5E8F\u540E\uFF1A",
2316
+ removalNoteMsg1: "\u6240\u6709\u4EA4\u6613\u90FD\u9700\u8981\u786E\u8BA4",
2317
+ removalNoteMsg2: "Trust this app&quot"
2320
2318
  },
2321
2319
  keyshareStatus: {
2322
- title: null,
2323
- serverReady: null,
2324
- serverMissing: null,
2325
- localReady: null,
2326
- localMissing: null,
2327
- valutBackupCreated: null,
2328
- valutBackupMissing: null
2320
+ title: "\u5BC6\u94A5\u5171\u4EAB\u72B6\u6001",
2321
+ serverReady: "\u60A8\u7684\u670D\u52A1\u5668\u5B89\u5168\u5BC6\u94A5\u5171\u4EAB\u5B89\u5168\u4E14\u5DF2\u51C6\u5907\u5C31\u7EEA",
2322
+ serverMissing: "\u670D\u52A1\u5668\u5B89\u5168\u5BC6\u94A5\u5171\u4EAB\u4E22\u5931",
2323
+ localReady: "\u60A8\u7684\u672C\u5730\u79C1\u94A5\u5171\u4EAB\u5B89\u5168\u4E14\u5DF2\u51C6\u5907\u5C31\u7EEA",
2324
+ localMissing: "\u672C\u5730\u79C1\u94A5\u5171\u4EAB\u7F3A\u5931",
2325
+ valutBackupCreated: "\u5B89\u5168\u5BC6\u94A5\u5171\u4EAB\u5E93\u5907\u4EFD\u5B58\u5728\u4E14\u5DF2\u51C6\u5907\u5C31\u7EEA",
2326
+ valutBackupMissing: "\u5B89\u5168\u5BC6\u94A5\u5171\u4EAB\u5E93\u5907\u4EFD\u7F3A\u5931\u3002\u8BF7\u521B\u5EFA\u4E00\u4E2A\u5907\u4EFD\u4EE5\u786E\u4FDD\u60A8\u7684\u6570\u636E\u5B89\u5168\u3002"
2329
2327
  },
2330
2328
  lastBackup: "\u6700\u540E\u4E00\u6B21\u5BC6\u94A5\u5171\u4EAB\u5E93\u5907\u4EFD",
2331
2329
  lastBackupMeta: "{{browser}} \u6D4F\u89C8\u5668\uFF0C\u4F4D\u4E8E {{deviceName}} \u8BBE\u5907\u4E0A\uFF0C\u64CD\u4F5C\u7CFB\u7EDF\u4E3A {{os}}\u3002"
@@ -2384,7 +2382,7 @@ var init_constants3 = __esm({
2384
2382
  ru: { passport: ru_default }
2385
2383
  };
2386
2384
  PASSPORT_NAMESPACE = "passport";
2387
- LOCAL_STORAGE_I18N_KEY = "lumia-passport-language";
2385
+ LOCAL_STORAGE_I18N_KEY = "passport-language";
2388
2386
  }
2389
2387
  });
2390
2388
 
@@ -2570,14 +2568,13 @@ function getAccessToken() {
2570
2568
  }
2571
2569
  return null;
2572
2570
  } catch (error) {
2573
- console.error("Failed to parse Lumia Passport session:", error);
2571
+ console.error("Failed to parse EmbarkAI session:", error);
2574
2572
  return null;
2575
2573
  }
2576
2574
  }
2577
- var LP_JWT_TOKENS_LS_KEY;
2578
2575
  var init_utils2 = __esm({
2579
2576
  "src/internal/lib/utils.ts"() {
2580
- LP_JWT_TOKENS_LS_KEY = "lumia-passport-jwt-tokens";
2577
+ init_constants();
2581
2578
  }
2582
2579
  });
2583
2580
 
@@ -2849,19 +2846,14 @@ var HttpClient, _tssClient, _vaultClient, tssClient, vaultClient;
2849
2846
  var init_httpClient = __esm({
2850
2847
  "src/internal/clients/httpClient.ts"() {
2851
2848
  init_auth();
2852
- init_base();
2853
2849
  init_projectId();
2850
+ init_base();
2854
2851
  HttpClient = class {
2855
2852
  constructor(baseUrl) {
2856
2853
  this.baseUrl = baseUrl.replace(/\/$/, "");
2857
2854
  }
2858
2855
  async makeRequest(endpoint, options = {}) {
2859
- const {
2860
- method = "GET",
2861
- headers = {},
2862
- body,
2863
- requireAuth = true
2864
- } = options;
2856
+ const { method = "GET", headers = {}, body, requireAuth = true } = options;
2865
2857
  const url = addProjectIdToUrl(`${this.baseUrl}${endpoint}`);
2866
2858
  const requestHeaders = {
2867
2859
  "Content-Type": "application/json",
@@ -2904,11 +2896,7 @@ var init_httpClient = __esm({
2904
2896
  }
2905
2897
  return await this.processResponse(response);
2906
2898
  } catch (error) {
2907
- logSdkError2(
2908
- error instanceof Error ? error : new Error("Network error"),
2909
- { url, method },
2910
- "http-client"
2911
- );
2899
+ logSdkError2(error instanceof Error ? error : new Error("Network error"), { url, method }, "http-client");
2912
2900
  return {
2913
2901
  success: false,
2914
2902
  error: error instanceof Error ? error.message : "Network error",
@@ -4922,7 +4910,8 @@ function useAutoConnect() {
4922
4910
  const finalHasKeyshare = verify?.hasKeyshare ?? hasKeyshare ?? false;
4923
4911
  try {
4924
4912
  callbacks?.onAccount?.({ userId, address: null, session: null, hasKeyshare: finalHasKeyshare });
4925
- } catch {
4913
+ } catch (error) {
4914
+ console.warn("[UI-KIT][AutoConnect] Error due onAccount callback:", error);
4926
4915
  }
4927
4916
  try {
4928
4917
  const jwt = await Promise.resolve().then(() => (init_auth(), auth_exports)).then((m) => m.jwtTokenManager.getTokens());
@@ -4937,7 +4926,8 @@ function useAutoConnect() {
4937
4926
  setIsLoading(false);
4938
4927
  try {
4939
4928
  callbacks?.onConnect?.({ address: addr, session: sess });
4940
- } catch {
4929
+ } catch (error) {
4930
+ console.warn("[UI-KIT][AutoConnect] Error due onConnect callback:", error);
4941
4931
  }
4942
4932
  try {
4943
4933
  callbacks?.onAccount?.({
@@ -4946,7 +4936,8 @@ function useAutoConnect() {
4946
4936
  session: sess,
4947
4937
  hasKeyshare: finalHasKeyshare
4948
4938
  });
4949
- } catch {
4939
+ } catch (error) {
4940
+ console.warn("[UI-KIT][AutoConnect] Error due onAccount callback:", error);
4950
4941
  }
4951
4942
  if (config.projectId) {
4952
4943
  try {
@@ -6414,11 +6405,6 @@ function useAuthMenuHandlers() {
6414
6405
  );
6415
6406
  setError(null);
6416
6407
  setAlert(null);
6417
- try {
6418
- callbacks?.onConnect?.({ address: addr, session: sess });
6419
- callbacks?.onAccount?.({ userId, address: addr, session: sess, hasKeyshare: hasServerKeyshare });
6420
- } catch {
6421
- }
6422
6408
  let hasKeyshareVaultBackup = false;
6423
6409
  try {
6424
6410
  const { checkServerBackupAvailability: checkServerBackupAvailability2, updateBackupStatus: updateBackupStatus2, getShareRecoveryStats: getShareRecoveryStats2 } = await Promise.resolve().then(() => (init_vaultClient(), vaultClient_exports));
@@ -6438,6 +6424,16 @@ function useAuthMenuHandlers() {
6438
6424
  setSession(sess);
6439
6425
  setAddress(addr);
6440
6426
  setStatus("ready");
6427
+ try {
6428
+ callbacks?.onConnect?.({ address: addr, session: sess });
6429
+ } catch (error) {
6430
+ console.warn("[UI-KIT][AuthMenu] Error due onConnect callback:", error);
6431
+ }
6432
+ try {
6433
+ callbacks?.onAccount?.({ userId, address: addr, session: sess, hasKeyshare: hasServerKeyshare });
6434
+ } catch (error) {
6435
+ console.warn("[UI-KIT][AuthMenu] Error due onAccount callback:", error);
6436
+ }
6441
6437
  setTimeout(() => {
6442
6438
  if (!!jwt?.isNewUser || !hasKeyshareVaultBackup) {
6443
6439
  if (!!jwt?.isNewUser) console.log("[AuthMenu] New user detected - forcing backup flow");
@@ -6993,14 +6989,11 @@ function SelectContent({
6993
6989
  return /* @__PURE__ */ jsx34(SelectPrimitive.Portal, { container, children: /* @__PURE__ */ jsxs29(
6994
6990
  SelectPrimitive.Content,
6995
6991
  {
6992
+ ...props,
6996
6993
  "data-slot": "select-content",
6994
+ position,
6995
+ align,
6997
6996
  "data-current-theme-mode": colorMode,
6998
- style: {
6999
- // backgroundColor: 'var(--l-pass-bg)',
7000
- // border: '1px solid var(--l-pass-bd)',
7001
- // color: 'var(--l-pass-fg)',
7002
- // borderRadius: 'var(--l-pass-el-bdrs)'
7003
- },
7004
6997
  className: cn(
7005
6998
  "account-abstraction-ui-scope text-[var(--l-pass-fg)] bg-[var(--l-pass-bg)]",
7006
6999
  "rounded-[var(--l-pass-el-bdrs)] border border-[var(--l-pass-bd)]",
@@ -7008,9 +7001,6 @@ function SelectContent({
7008
7001
  position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
7009
7002
  className
7010
7003
  ),
7011
- position,
7012
- align,
7013
- ...props,
7014
7004
  children: [
7015
7005
  /* @__PURE__ */ jsx34(SelectScrollUpButton, {}),
7016
7006
  /* @__PURE__ */ jsx34(
@@ -8528,22 +8518,6 @@ function useOnRestoreSuccess() {
8528
8518
  setRecoveryUserId(null);
8529
8519
  setSuccess(null);
8530
8520
  setError(null);
8531
- try {
8532
- callbacks?.onConnect?.({
8533
- address: addr,
8534
- session: sess
8535
- });
8536
- } catch {
8537
- }
8538
- try {
8539
- callbacks?.onAccount?.({
8540
- userId: recoveryUserId,
8541
- address: addr,
8542
- session: sess,
8543
- hasKeyshare: hasServerKeyshare
8544
- });
8545
- } catch {
8546
- }
8547
8521
  if (config.current?.projectId) {
8548
8522
  try {
8549
8523
  const { getIframeManager: getIframeManager2 } = await Promise.resolve().then(() => (init_iframe_manager(), iframe_manager_exports));
@@ -8562,6 +8536,21 @@ function useOnRestoreSuccess() {
8562
8536
  setSession(sess);
8563
8537
  setAddress(addr);
8564
8538
  setStatus("ready");
8539
+ try {
8540
+ callbacks?.onConnect?.({ address: addr, session: sess });
8541
+ } catch (error) {
8542
+ console.warn("[UI-KIT][Restore] Error due onConnect callback:", error);
8543
+ }
8544
+ try {
8545
+ callbacks?.onAccount?.({
8546
+ userId: recoveryUserId,
8547
+ address: addr,
8548
+ session: sess,
8549
+ hasKeyshare: hasServerKeyshare
8550
+ });
8551
+ } catch (error) {
8552
+ console.warn("[UI-KIT][Restore] Error due onAccount callback:", error);
8553
+ }
8565
8554
  setPage(null);
8566
8555
  setTimeout(() => {
8567
8556
  setIsDialogForced(false);
@@ -16483,7 +16472,7 @@ var init_SessionContext = __esm({
16483
16472
  // }
16484
16473
  }),
16485
16474
  {
16486
- name: "lumia-passport-session",
16475
+ name: "passport-session-meta",
16487
16476
  // Only persist activeChainId and isChainUserSelected (other session data is ephemeral)
16488
16477
  partialize: (state) => ({
16489
16478
  activeChainId: state.activeChainId
@@ -16806,7 +16795,11 @@ async function encryptKeyshare(data, password, encryptionMethod = "password", cr
16806
16795
  );
16807
16796
  const key = await crypto.subtle.importKey("raw", keyMaterial, "AES-GCM", false, ["encrypt"]);
16808
16797
  const iv = crypto.getRandomValues(new Uint8Array(12));
16809
- const encryptedData = await crypto.subtle.encrypt({ name: "AES-GCM", iv }, key, encoder.encode(plaintext));
16798
+ const encryptedData = await crypto.subtle.encrypt(
16799
+ { name: "AES-GCM", iv },
16800
+ key,
16801
+ encoder.encode(plaintext)
16802
+ );
16810
16803
  const checksumData = `${data.userId}:${data.sessionId}:${encryptionMethod}`;
16811
16804
  const checksumBuffer = await crypto.subtle.digest("SHA-256", encoder.encode(checksumData));
16812
16805
  const checksum = bytesToBase64(new Uint8Array(checksumBuffer));
@@ -16845,7 +16838,11 @@ async function decryptKeyshare(encryptedBackup, password) {
16845
16838
  256
16846
16839
  );
16847
16840
  const key = await crypto.subtle.importKey("raw", keyMaterial, "AES-GCM", false, ["decrypt"]);
16848
- const decryptedData = await crypto.subtle.decrypt({ name: "AES-GCM", iv }, key, encryptedData);
16841
+ const decryptedData = await crypto.subtle.decrypt(
16842
+ { name: "AES-GCM", iv },
16843
+ key,
16844
+ encryptedData
16845
+ );
16849
16846
  const plaintext = decoder.decode(decryptedData);
16850
16847
  const backupData = JSON.parse(plaintext);
16851
16848
  if (encryptedBackup.checksum) {
@@ -16909,7 +16906,7 @@ async function deriveBackupPasswordFromPasskey(userId, credentialId) {
16909
16906
  }
16910
16907
  function getBackupStatus(userId) {
16911
16908
  const storage = typeof window !== "undefined" ? window.localStorage : void 0;
16912
- const statusData = storage?.getItem(`lumia-passport.backup.status.${userId}`);
16909
+ const statusData = storage?.getItem(`${LOOCAL_BACKUP_STATUS_KEY}.${userId}`);
16913
16910
  if (statusData) {
16914
16911
  try {
16915
16912
  return JSON.parse(statusData);
@@ -16923,7 +16920,7 @@ function updateBackupStatus(userId, method, status) {
16923
16920
  if (!storage) return;
16924
16921
  const current = getBackupStatus(userId);
16925
16922
  current[method] = { ...current[method], ...status };
16926
- storage.setItem(`lumia-passport.backup.status.${userId}`, JSON.stringify(current));
16923
+ storage.setItem(`${LOOCAL_BACKUP_STATUS_KEY}.${userId}`, JSON.stringify(current));
16927
16924
  if (typeof window !== "undefined") {
16928
16925
  window.dispatchEvent(
16929
16926
  new CustomEvent("lumia-passport-backup-status-changed", { detail: { method, status, currentStatus: current } })
@@ -16932,7 +16929,7 @@ function updateBackupStatus(userId, method, status) {
16932
16929
  }
16933
16930
  function clearBackupStatus(userId) {
16934
16931
  const storage = typeof window !== "undefined" ? window.localStorage : void 0;
16935
- storage?.removeItem(`lumia-passport.backup.status.${userId}`);
16932
+ storage?.removeItem(`${LOOCAL_BACKUP_STATUS_KEY}.${userId}`);
16936
16933
  }
16937
16934
  async function checkServerBackupAvailability() {
16938
16935
  try {
@@ -17289,6 +17286,7 @@ var init_vaultClient = __esm({
17289
17286
  init_passkey();
17290
17287
  init_base();
17291
17288
  init_httpClient();
17289
+ init_constants();
17292
17290
  PasswordValidationError = class extends Error {
17293
17291
  constructor(message) {
17294
17292
  super(message);
@@ -17556,7 +17554,7 @@ function getIframeManager(config) {
17556
17554
  }
17557
17555
  if (!iframeManagerInstance) {
17558
17556
  throw new Error(
17559
- 'IframeManager not initialized. This usually means projectId is not configured.\n\nTo fix this:\n1. Get your projectId from https://dashboard.lumiapassport.com/\n2. Add it to LumiaPassportProvider:\n <LumiaPassportProvider projectId="your-project-id">\n\nFor more details, see the documentation.'
17557
+ 'IframeManager not initialized. This usually means projectId is not configured.\n\nTo fix this:\n1. Get your projectId from https://dashboard.lumiapassport.com/\n2. Add it to Provider:\n <Provider projectId="your-project-id">\n\nFor more details, see the documentation.'
17560
17558
  );
17561
17559
  }
17562
17560
  return iframeManagerInstance;
@@ -18769,7 +18767,7 @@ function notifyNoProjetctId(projectId) {
18769
18767
  return;
18770
18768
  }
18771
18769
  console.error(
18772
- '\n\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557\n\u2551 \u26A0\uFE0F LUMIA PASSPORT WARNING \u26A0\uFE0F \u2551\n\u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563\n\u2551 \u2551\n\u2551 projectId is NOT configured! \u2551\n\u2551 \u2551\n\u2551 Your integration will NOT work without a valid projectId. \u2551\n\u2551 Most features will be disabled and errors will occur. \u2551\n\u2551 \u2551\n\u2551 To fix this: \u2551\n\u2551 1. Get your projectId from: https://dashboard.lumiapassport.com/ \u2551\n\u2551 2. Add it to your LumiaPassportProvider: \u2551\n\u2551 \u2551\n\u2551 <LumiaPassportProvider projectId="your-project-id"> \u2551\n\u2551 {children} \u2551\n\u2551 </LumiaPassportProvider> \u2551\n\u2551 \u2551\n\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D\n'
18770
+ '\n\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557\n\u2551 \u26A0\uFE0F EmbarkAI WARNING \u26A0\uFE0F \u2551\n\u2560\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563\n\u2551 \u2551\n\u2551 projectId is NOT configured! \u2551\n\u2551 \u2551\n\u2551 Your integration will NOT work without a valid projectId. \u2551\n\u2551 Most features will be disabled and errors will occur. \u2551\n\u2551 \u2551\n\u2551 To fix this: \u2551\n\u2551 1. Get your projectId from: https://dashboard.lumiapassport.com/ \u2551\n\u2551 2. Add it to your Provider: \u2551\n\u2551 \u2551\n\u2551 <Provider projectId="your-project-id"> \u2551\n\u2551 {children} \u2551\n\u2551 </Provider> \u2551\n\u2551 \u2551\n\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D\n'
18773
18771
  );
18774
18772
  }
18775
18773
  var init_utils8 = __esm({
@@ -18856,7 +18854,6 @@ function Provider(props) {
18856
18854
  next.social = { ...next.social, ...updates.social };
18857
18855
  if (updates.social.providers) next.social.providers = updates.social.providers;
18858
18856
  }
18859
- if (updates.development) next.development = { ...next.development, ...updates.development };
18860
18857
  if (updates.ui) next.ui = { ...next.ui, ...updates.ui };
18861
18858
  if (updates.network) next.network = { ...next.network, ...updates.network };
18862
18859
  if (updates.services) next.services = { ...next.services, ...updates.services };
@@ -18967,7 +18964,6 @@ function ConnectWalletButton(props) {
18967
18964
  const setPage = useLayoutDataStore((st) => st.setPage);
18968
18965
  const settingsNotifications = useLayoutDataStore((st) => st.settingsNotifications);
18969
18966
  const colorMode = useLayoutStore((st) => st.colorMode);
18970
- const { config } = useProviderConfig();
18971
18967
  const { session, address, hasServerVault, isLoading, isIframeReady, status, setUsePaymaster } = useSession();
18972
18968
  const connectButtonLabel = getFormattedStatus(label || "Connect", status, isIframeReady);
18973
18969
  useEffect38(() => setUsePaymaster(usePaymaster), [setUsePaymaster, usePaymaster]);
@@ -19128,7 +19124,6 @@ function ConnectWalletButton(props) {
19128
19124
  var init_ConnectWalletButton = __esm({
19129
19125
  "src/components/ConnectWalletButton.tsx"() {
19130
19126
  init_LumiaIcon2();
19131
- init_ProviderContext();
19132
19127
  init_SessionContext();
19133
19128
  init_auth();
19134
19129
  init_profile();
@@ -20728,8 +20723,8 @@ var init_index = __esm({
20728
20723
  init_built();
20729
20724
  init_ProviderContext();
20730
20725
  init_ConnectWalletButton();
20731
- init_SessionContext();
20732
20726
  init_RainbowKitContext();
20727
+ init_SessionContext();
20733
20728
  init_childAppHooks();
20734
20729
  init_useOpenPage();
20735
20730
  init_useColorMode();