decane-connect-kit 2.27.0 → 2.29.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/dist/index.cjs +314 -443
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.js +313 -443
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -37,11 +37,12 @@ __export(errors_exports, {
|
|
|
37
37
|
UnlockTokenRejectedError: () => UnlockTokenRejectedError,
|
|
38
38
|
UserCancelledError: () => UserCancelledError,
|
|
39
39
|
WalletEnrolmentError: () => WalletEnrolmentError,
|
|
40
|
+
WalletExistsError: () => WalletExistsError,
|
|
40
41
|
WebAuthnNotSupportedError: () => WebAuthnNotSupportedError,
|
|
41
42
|
WrongPasswordError: () => WrongPasswordError,
|
|
42
43
|
WrongUnlockPasswordError: () => WrongUnlockPasswordError
|
|
43
44
|
});
|
|
44
|
-
var DecaneConnectError, InvalidApiKeyError, OriginNotAllowedError, SessionExpiredError, UnlockRequiredError, ReconnectRequiredError, UserCancelledError, WebAuthnNotSupportedError, InvalidPinError, CallSequenceError, NetworkError, ShareCorruptedError, ProvisioningTimeoutError, NewDeviceError, StaleDeviceShareError, PromptPinNotConfiguredError, PromptPasswordNotConfiguredError, WrongUnlockPasswordError, InvalidAccessTokenError, UnlockTokenRejectedError, AttestationError, RecoveryFailedError, InvalidRecoveryFileError, WrongPasswordError, RecoveryWalletMismatchError, ExportNotAuthorizedError, WalletEnrolmentError, ProvisioningRateLimitedError, EnclaveHttpError;
|
|
45
|
+
var DecaneConnectError, InvalidApiKeyError, OriginNotAllowedError, SessionExpiredError, UnlockRequiredError, ReconnectRequiredError, UserCancelledError, WebAuthnNotSupportedError, InvalidPinError, CallSequenceError, NetworkError, ShareCorruptedError, ProvisioningTimeoutError, NewDeviceError, StaleDeviceShareError, PromptPinNotConfiguredError, PromptPasswordNotConfiguredError, WrongUnlockPasswordError, InvalidAccessTokenError, UnlockTokenRejectedError, AttestationError, RecoveryFailedError, InvalidRecoveryFileError, WrongPasswordError, RecoveryWalletMismatchError, ExportNotAuthorizedError, WalletExistsError, WalletEnrolmentError, ProvisioningRateLimitedError, EnclaveHttpError;
|
|
45
46
|
var init_errors = __esm({
|
|
46
47
|
"src/social/errors.ts"() {
|
|
47
48
|
"use strict";
|
|
@@ -190,6 +191,11 @@ var init_errors = __esm({
|
|
|
190
191
|
super("EXPORT_NOT_AUTHORIZED", "Export requires a fresh security check", true);
|
|
191
192
|
}
|
|
192
193
|
};
|
|
194
|
+
WalletExistsError = class extends DecaneConnectError {
|
|
195
|
+
constructor() {
|
|
196
|
+
super("WALLET_EXISTS", "This account already has a wallet; opening it instead.", true);
|
|
197
|
+
}
|
|
198
|
+
};
|
|
193
199
|
WalletEnrolmentError = class extends DecaneConnectError {
|
|
194
200
|
constructor(cause) {
|
|
195
201
|
super(
|
|
@@ -2023,7 +2029,9 @@ var ERROR_MAP = {
|
|
|
2023
2029
|
// The backend's authMiddleware code for an expired/revoked JWT. Surfacing it
|
|
2024
2030
|
// as ReconnectRequiredError routes callers to the sign-in UI instead of a
|
|
2025
2031
|
// generic failure message.
|
|
2026
|
-
UNAUTHORIZED: ReconnectRequiredError
|
|
2032
|
+
UNAUTHORIZED: ReconnectRequiredError,
|
|
2033
|
+
// A restorable wallet already exists: the client provisions instead of creating.
|
|
2034
|
+
WALLET_EXISTS: WalletExistsError
|
|
2027
2035
|
};
|
|
2028
2036
|
var REQUEST_TIMEOUT_MS = 3e4;
|
|
2029
2037
|
var ApiClient = class {
|
|
@@ -2428,7 +2436,7 @@ function dropCollateral(teeUrl) {
|
|
|
2428
2436
|
// src/social/attestation.ts
|
|
2429
2437
|
init_errors();
|
|
2430
2438
|
|
|
2431
|
-
//
|
|
2439
|
+
// ../infra/tee-measurement.json
|
|
2432
2440
|
var tee_measurement_default = {
|
|
2433
2441
|
signerVersion: "0.2.10",
|
|
2434
2442
|
acceptedMrtd: [
|
|
@@ -4390,24 +4398,37 @@ async function createDecaneConnect(config) {
|
|
|
4390
4398
|
if (unlockTokenKey) await attachUnlockToken(userId, jwt, unlockTokenKey);
|
|
4391
4399
|
}
|
|
4392
4400
|
const serverIv = generateRandomBytes(12);
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4399
|
-
|
|
4400
|
-
|
|
4401
|
-
|
|
4402
|
-
|
|
4403
|
-
|
|
4404
|
-
|
|
4405
|
-
|
|
4406
|
-
|
|
4407
|
-
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4401
|
+
try {
|
|
4402
|
+
await withDeadline(api.putShare(jwt, {
|
|
4403
|
+
ciphertext: shareSet.server,
|
|
4404
|
+
iv: serverIv,
|
|
4405
|
+
wrappedShareMeta: {
|
|
4406
|
+
// The server records this on the wallet_created event and nothing else.
|
|
4407
|
+
unlockMethod: identityTier ? "identity" : unlockMethod
|
|
4408
|
+
// credential IDs, prfSalt, pinSalt stay on-device — never sent to server
|
|
4409
|
+
},
|
|
4410
|
+
evmAddress,
|
|
4411
|
+
solanaAddress,
|
|
4412
|
+
tronAddress,
|
|
4413
|
+
// Provisional until the enclave has sealed the auth share, just below. A
|
|
4414
|
+
// backend that knows the flag keeps this row invisible to hasShare until
|
|
4415
|
+
// then, so a creation that fails past this point leaves no wallet behind
|
|
4416
|
+
// and the next sign-in simply creates again — with a new key, which is
|
|
4417
|
+
// why the backend also replaces the recorded addresses outright.
|
|
4418
|
+
pendingEnrolment: true
|
|
4419
|
+
}), remainingBudget(), "storing your wallet");
|
|
4420
|
+
} catch (e) {
|
|
4421
|
+
if (e instanceof WalletExistsError) {
|
|
4422
|
+
zeroize(shareSet.server);
|
|
4423
|
+
zeroize(shareSet.device);
|
|
4424
|
+
zeroize(shareSet.recovery);
|
|
4425
|
+
if (wrappingKey) await storage2.deleteShare(userId).catch(() => {
|
|
4426
|
+
});
|
|
4427
|
+
events.emit("wallet-unlocking");
|
|
4428
|
+
return returningUserUnlock(userId, jwt);
|
|
4429
|
+
}
|
|
4430
|
+
throw e;
|
|
4431
|
+
}
|
|
4411
4432
|
zeroize(shareSet.server);
|
|
4412
4433
|
try {
|
|
4413
4434
|
await enrolBlocking(jwt, new Uint8Array(shareSet.recovery), remainingBudget());
|
|
@@ -5498,6 +5519,7 @@ var tokens = {
|
|
|
5498
5519
|
accent: "#F5C800",
|
|
5499
5520
|
accentHover: "#D4A800",
|
|
5500
5521
|
accentText: "#0D0D0B",
|
|
5522
|
+
accentInk: "#7A5F00",
|
|
5501
5523
|
badgeEvm: "#1A1917",
|
|
5502
5524
|
badgeEvmText: "#F5C800",
|
|
5503
5525
|
badgeSolana: "#F5C800",
|
|
@@ -5518,6 +5540,7 @@ var tokens = {
|
|
|
5518
5540
|
accent: "#F5C800",
|
|
5519
5541
|
accentHover: "#FFE04D",
|
|
5520
5542
|
accentText: "#0D0D0B",
|
|
5543
|
+
accentInk: "#F5C800",
|
|
5521
5544
|
badgeEvm: "#F5C800",
|
|
5522
5545
|
badgeEvmText: "#0D0D0B",
|
|
5523
5546
|
badgeSolana: "#1A1917",
|
|
@@ -5543,6 +5566,7 @@ var CSS_VARS = {
|
|
|
5543
5566
|
--dc-accent: ${tokens.light.accent};
|
|
5544
5567
|
--dc-accent-hover: ${tokens.light.accentHover};
|
|
5545
5568
|
--dc-accent-text: ${tokens.light.accentText};
|
|
5569
|
+
--dc-accent-ink: ${tokens.light.accentInk};
|
|
5546
5570
|
--dc-badge-evm: ${tokens.light.badgeEvm};
|
|
5547
5571
|
--dc-badge-evm-text: ${tokens.light.badgeEvmText};
|
|
5548
5572
|
--dc-badge-sol: ${tokens.light.badgeSolana};
|
|
@@ -5564,6 +5588,7 @@ var CSS_VARS = {
|
|
|
5564
5588
|
--dc-accent: ${tokens.dark.accent};
|
|
5565
5589
|
--dc-accent-hover: ${tokens.dark.accentHover};
|
|
5566
5590
|
--dc-accent-text: ${tokens.dark.accentText};
|
|
5591
|
+
--dc-accent-ink: ${tokens.dark.accentInk};
|
|
5567
5592
|
--dc-badge-evm: ${tokens.dark.badgeEvm};
|
|
5568
5593
|
--dc-badge-evm-text: ${tokens.dark.badgeEvmText};
|
|
5569
5594
|
--dc-badge-sol: ${tokens.dark.badgeSolana};
|
|
@@ -5725,6 +5750,54 @@ function XLogo({ size = 14 }) {
|
|
|
5725
5750
|
/* @__PURE__ */ React.createElement("path", { d: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z" })
|
|
5726
5751
|
);
|
|
5727
5752
|
}
|
|
5753
|
+
var line = {
|
|
5754
|
+
fill: "none",
|
|
5755
|
+
stroke: "currentColor",
|
|
5756
|
+
strokeWidth: 1.8,
|
|
5757
|
+
strokeLinecap: "round",
|
|
5758
|
+
strokeLinejoin: "round"
|
|
5759
|
+
};
|
|
5760
|
+
function GoogleMark({ size = 18 }) {
|
|
5761
|
+
return /* @__PURE__ */ React.createElement("svg", { width: size, height: size, viewBox: "0 0 48 48", "aria-hidden": "true", style: { flexShrink: 0 } }, /* @__PURE__ */ React.createElement("path", { fill: "#EA4335", d: "M24 9.5c3.5 0 6 1.5 7.4 2.8l5.4-5.3C33.5 3.9 29.2 2 24 2 15.4 2 8 7 4.7 14.2l6.3 4.9C12.6 13.4 17.8 9.5 24 9.5z" }), /* @__PURE__ */ React.createElement("path", { fill: "#4285F4", d: "M46 24.5c0-1.6-.1-2.8-.4-4H24v7.5h12.6c-.3 2.2-1.7 5.5-4.9 7.7l6.1 4.7C41.5 37 46 31.4 46 24.5z" }), /* @__PURE__ */ React.createElement("path", { fill: "#FBBC05", d: "M11 29.1a13.9 13.9 0 0 1 0-10l-6.3-4.9A22 22 0 0 0 2 24c0 3.5.8 6.9 2.4 9.8L11 29.1z" }), /* @__PURE__ */ React.createElement("path", { fill: "#34A853", d: "M24 46c5.9 0 10.9-2 14.5-5.4l-6.1-4.7c-1.7 1.2-4 2-8.4 2-6.2 0-11.4-4-13.1-9.6l-6.3 4.9C7.9 40.9 15.3 46 24 46z" }));
|
|
5762
|
+
}
|
|
5763
|
+
function MailIcon({ size = 18 }) {
|
|
5764
|
+
return /* @__PURE__ */ React.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", ...line, "aria-hidden": "true", style: { flexShrink: 0 } }, /* @__PURE__ */ React.createElement("rect", { x: "3", y: "5", width: "18", height: "14", rx: "2.5" }), /* @__PURE__ */ React.createElement("path", { d: "m3.5 7 8.5 6 8.5-6" }));
|
|
5765
|
+
}
|
|
5766
|
+
function PhoneIcon({ size = 18 }) {
|
|
5767
|
+
return /* @__PURE__ */ React.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", ...line, "aria-hidden": "true", style: { flexShrink: 0 } }, /* @__PURE__ */ React.createElement("rect", { x: "7", y: "2.5", width: "10", height: "19", rx: "2.5" }), /* @__PURE__ */ React.createElement("path", { d: "M11 18h2" }));
|
|
5768
|
+
}
|
|
5769
|
+
function ChatIcon({ size = 18 }) {
|
|
5770
|
+
return /* @__PURE__ */ React.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", ...line, "aria-hidden": "true", style: { flexShrink: 0 } }, /* @__PURE__ */ React.createElement("path", { d: "M4 6.5A2.5 2.5 0 0 1 6.5 4h11A2.5 2.5 0 0 1 20 6.5v7a2.5 2.5 0 0 1-2.5 2.5H10l-4.2 3.2a.6.6 0 0 1-1-.5V16A2.5 2.5 0 0 1 4 13.5z" }), /* @__PURE__ */ React.createElement("path", { d: "M8.5 9h7M8.5 12.5h4.5" }));
|
|
5771
|
+
}
|
|
5772
|
+
function KeyIcon({ size = 18 }) {
|
|
5773
|
+
return /* @__PURE__ */ React.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", ...line, "aria-hidden": "true", style: { flexShrink: 0 } }, /* @__PURE__ */ React.createElement("circle", { cx: "8", cy: "12", r: "4" }), /* @__PURE__ */ React.createElement("path", { d: "M12 12h9M18 12v3M15 12v2.5" }));
|
|
5774
|
+
}
|
|
5775
|
+
function UserIcon({ size = 18 }) {
|
|
5776
|
+
return /* @__PURE__ */ React.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", ...line, "aria-hidden": "true", style: { flexShrink: 0 } }, /* @__PURE__ */ React.createElement("circle", { cx: "12", cy: "8.5", r: "3.8" }), /* @__PURE__ */ React.createElement("path", { d: "M4.5 20a7.5 7.5 0 0 1 15 0" }));
|
|
5777
|
+
}
|
|
5778
|
+
function CopyIcon({ size = 15 }) {
|
|
5779
|
+
return /* @__PURE__ */ React.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", ...line, "aria-hidden": "true", style: { flexShrink: 0 } }, /* @__PURE__ */ React.createElement("rect", { x: "8.5", y: "8.5", width: "12", height: "12", rx: "2.5" }), /* @__PURE__ */ React.createElement("path", { d: "M15.5 8.5V6A2.5 2.5 0 0 0 13 3.5H6A2.5 2.5 0 0 0 3.5 6v7A2.5 2.5 0 0 0 6 15.5h2.5" }));
|
|
5780
|
+
}
|
|
5781
|
+
function CheckIcon({ size = 15 }) {
|
|
5782
|
+
return /* @__PURE__ */ React.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", ...line, "aria-hidden": "true", style: { flexShrink: 0 } }, /* @__PURE__ */ React.createElement("path", { d: "m5 12.5 4.5 4.5L19 7.5" }));
|
|
5783
|
+
}
|
|
5784
|
+
function CloseIcon({ size = 16 }) {
|
|
5785
|
+
return /* @__PURE__ */ React.createElement("svg", { width: size, height: size, viewBox: "0 0 24 24", ...line, "aria-hidden": "true", style: { flexShrink: 0 } }, /* @__PURE__ */ React.createElement("path", { d: "M6 6l12 12M18 6 6 18" }));
|
|
5786
|
+
}
|
|
5787
|
+
function ChevronIcon({ size = 16, open = false }) {
|
|
5788
|
+
return /* @__PURE__ */ React.createElement(
|
|
5789
|
+
"svg",
|
|
5790
|
+
{
|
|
5791
|
+
width: size,
|
|
5792
|
+
height: size,
|
|
5793
|
+
viewBox: "0 0 24 24",
|
|
5794
|
+
...line,
|
|
5795
|
+
"aria-hidden": "true",
|
|
5796
|
+
style: { flexShrink: 0, transition: "transform .2s", transform: open ? "rotate(180deg)" : "none" }
|
|
5797
|
+
},
|
|
5798
|
+
/* @__PURE__ */ React.createElement("path", { d: "m6 9 6 6 6-6" })
|
|
5799
|
+
);
|
|
5800
|
+
}
|
|
5728
5801
|
|
|
5729
5802
|
// src/ui/WalletSelector.tsx
|
|
5730
5803
|
var FONT_URL = "https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap";
|
|
@@ -6788,33 +6861,6 @@ function downloadJson(data, filename) {
|
|
|
6788
6861
|
a.click();
|
|
6789
6862
|
URL.revokeObjectURL(url);
|
|
6790
6863
|
}
|
|
6791
|
-
function CopyButton({ value }) {
|
|
6792
|
-
const [copied, setCopied] = useState2(false);
|
|
6793
|
-
async function copy() {
|
|
6794
|
-
await navigator.clipboard.writeText(value).catch(() => {
|
|
6795
|
-
});
|
|
6796
|
-
setCopied(true);
|
|
6797
|
-
setTimeout(() => setCopied(false), 1500);
|
|
6798
|
-
}
|
|
6799
|
-
return /* @__PURE__ */ React3.createElement(
|
|
6800
|
-
"button",
|
|
6801
|
-
{
|
|
6802
|
-
onClick: copy,
|
|
6803
|
-
style: {
|
|
6804
|
-
background: "none",
|
|
6805
|
-
border: "none",
|
|
6806
|
-
cursor: "pointer",
|
|
6807
|
-
color: copied ? "var(--dc-accent)" : "var(--dc-text-muted)",
|
|
6808
|
-
fontSize: 11,
|
|
6809
|
-
fontFamily: "inherit",
|
|
6810
|
-
padding: "2px 6px",
|
|
6811
|
-
borderRadius: 5,
|
|
6812
|
-
transition: "color 0.15s"
|
|
6813
|
-
}
|
|
6814
|
-
},
|
|
6815
|
-
copied ? "\u2713" : "copy"
|
|
6816
|
-
);
|
|
6817
|
-
}
|
|
6818
6864
|
function useBalance(kind, address, chain, rpcUrls) {
|
|
6819
6865
|
const [state, setState] = useState2({ loading: false, value: null, symbol: kind === "evm" ? "ETH" : "SOL" });
|
|
6820
6866
|
useEffect2(() => {
|
|
@@ -6832,6 +6878,117 @@ function useBalance(kind, address, chain, rpcUrls) {
|
|
|
6832
6878
|
}, [kind, address, chain, rpcUrls]);
|
|
6833
6879
|
return state;
|
|
6834
6880
|
}
|
|
6881
|
+
var MODAL_CSS = `
|
|
6882
|
+
.dcm-card { position: relative; width: 100%; max-width: 380px; max-height: calc(100vh - 32px); overflow-y: auto;
|
|
6883
|
+
background: var(--dc-bg); color: var(--dc-text); border: 1px solid var(--dc-border); border-radius: 24px;
|
|
6884
|
+
box-shadow: 0 24px 64px -12px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.08);
|
|
6885
|
+
animation: dcm-in .22s cubic-bezier(.2,.8,.2,1); box-sizing: border-box; }
|
|
6886
|
+
.dcm-card *, .dcm-card *::before, .dcm-card *::after { box-sizing: border-box; }
|
|
6887
|
+
@keyframes dcm-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
|
|
6888
|
+
@keyframes dcm-fade { from { opacity: 0; } to { opacity: 1; } }
|
|
6889
|
+
@media (prefers-reduced-motion: reduce) { .dcm-card, .dcm-backdrop { animation: none !important; } }
|
|
6890
|
+
.dcm-backdrop { position: absolute; inset: 0; background: var(--dc-bg-overlay);
|
|
6891
|
+
backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: dcm-fade .2s ease; }
|
|
6892
|
+
.dcm-icon-btn { position: absolute; top: 14px; width: 32px; height: 32px; border-radius: 10px; border: 0;
|
|
6893
|
+
background: transparent; color: var(--dc-text-muted); cursor: pointer; display: grid; place-items: center;
|
|
6894
|
+
padding: 0; transition: background .15s, color .15s; z-index: 1; }
|
|
6895
|
+
.dcm-icon-btn:hover { background: var(--dc-surface-hover); color: var(--dc-text); }
|
|
6896
|
+
.dcm-body { padding: 32px 24px 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
|
|
6897
|
+
.dcm-title { margin: 4px 0 0; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; color: var(--dc-text); }
|
|
6898
|
+
.dcm-sub { margin: -6px 0 2px; font-size: 13.5px; line-height: 1.5; color: var(--dc-text-secondary); overflow-wrap: anywhere; }
|
|
6899
|
+
.dcm-sub b { color: var(--dc-text); font-weight: 600; }
|
|
6900
|
+
.dcm-methods { width: 100%; display: grid; gap: 8px; margin-top: 4px; }
|
|
6901
|
+
.dcm-method { width: 100%; height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 14px;
|
|
6902
|
+
border-radius: 14px; border: 1px solid var(--dc-border); background: var(--dc-surface); color: var(--dc-text);
|
|
6903
|
+
font-weight: 500; font-size: 14.5px; line-height: 1; font-family: inherit; cursor: pointer; text-align: left;
|
|
6904
|
+
transition: border-color .15s, background .15s; }
|
|
6905
|
+
.dcm-method:hover:not(:disabled) { border-color: var(--dc-text-muted); background: var(--dc-surface-hover); }
|
|
6906
|
+
.dcm-method:disabled { opacity: .6; cursor: default; }
|
|
6907
|
+
.dcm-method:focus-visible, .dcm-primary:focus-visible, .dcm-link:focus-visible, .dcm-icon-btn:focus-visible,
|
|
6908
|
+
.dcm-ghost:focus-visible, .dcm-copy:focus-visible { outline: 2px solid var(--dc-accent); outline-offset: 2px; }
|
|
6909
|
+
.dcm-method > svg { color: var(--dc-text-secondary); }
|
|
6910
|
+
.dcm-method-input { cursor: text; padding-right: 6px; }
|
|
6911
|
+
.dcm-method-input:focus-within { border-color: var(--dc-accent); }
|
|
6912
|
+
.dcm-method-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
|
|
6913
|
+
color: var(--dc-text); font-family: inherit; font-size: 14.5px; padding: 0; }
|
|
6914
|
+
.dcm-method-input input::placeholder { color: var(--dc-text-muted); }
|
|
6915
|
+
.dcm-submit { height: 34px; padding: 0 12px; border-radius: 10px; border: 0; background: transparent;
|
|
6916
|
+
color: var(--dc-accent-ink); font-weight: 600; font-size: 13.5px; line-height: 1; font-family: inherit; cursor: pointer; transition: background .15s; }
|
|
6917
|
+
.dcm-submit:hover:not(:disabled) { background: var(--dc-surface-hover); }
|
|
6918
|
+
.dcm-submit:disabled { color: var(--dc-text-muted); cursor: default; }
|
|
6919
|
+
.dcm-form { width: 100%; display: grid; gap: 10px; margin-top: 4px; }
|
|
6920
|
+
.dcm-field { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--dc-border);
|
|
6921
|
+
background: var(--dc-surface); color: var(--dc-text); font-family: inherit; font-size: 15px; outline: none;
|
|
6922
|
+
transition: border-color .15s, box-shadow .15s; }
|
|
6923
|
+
.dcm-field::placeholder { color: var(--dc-text-muted); }
|
|
6924
|
+
.dcm-field:focus { border-color: var(--dc-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dc-accent) 22%, transparent); }
|
|
6925
|
+
.dcm-code { height: 56px; text-align: center; font-family: var(--dc-font-mono); font-size: 24px; letter-spacing: .45em; padding-left: calc(14px + .45em); }
|
|
6926
|
+
.dcm-primary { width: 100%; height: 48px; border-radius: 14px; border: 0; background: var(--dc-accent); color: var(--dc-accent-text);
|
|
6927
|
+
font-weight: 600; font-size: 14.5px; line-height: 1; font-family: inherit; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
|
|
6928
|
+
transition: background .15s, opacity .15s; }
|
|
6929
|
+
.dcm-primary:hover:not(:disabled) { background: var(--dc-accent-hover); }
|
|
6930
|
+
.dcm-primary:disabled { opacity: .55; cursor: default; }
|
|
6931
|
+
.dcm-ghost { height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--dc-border); background: transparent;
|
|
6932
|
+
color: var(--dc-text); font-weight: 500; font-size: 14px; line-height: 1; font-family: inherit; cursor: pointer; transition: background .15s, border-color .15s; white-space: nowrap; }
|
|
6933
|
+
.dcm-ghost:hover:not(:disabled) { background: var(--dc-surface-hover); border-color: var(--dc-text-muted); }
|
|
6934
|
+
.dcm-ghost:disabled { opacity: .55; cursor: default; }
|
|
6935
|
+
.dcm-link { border: 0; background: transparent; color: var(--dc-accent-ink); font-weight: 500; font-size: 13.5px; line-height: 1.4; font-family: inherit;
|
|
6936
|
+
cursor: pointer; padding: 4px; border-radius: 6px; }
|
|
6937
|
+
.dcm-link:hover { text-decoration: underline; text-underline-offset: 3px; }
|
|
6938
|
+
.dcm-badge { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center;
|
|
6939
|
+
background: var(--dc-surface); border: 1px solid var(--dc-border); color: var(--dc-text); }
|
|
6940
|
+
.dcm-error { margin: 0; width: 100%; font-size: 13px; line-height: 1.45; color: var(--dc-danger); overflow-wrap: anywhere; }
|
|
6941
|
+
.dcm-protected { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px;
|
|
6942
|
+
margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--dc-border); font-size: 12.5px; color: var(--dc-text-muted); }
|
|
6943
|
+
.dcm-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; }
|
|
6944
|
+
.dcm-status i { width: 7px; height: 7px; border-radius: 50%; display: block; }
|
|
6945
|
+
.dcm-addresses { width: 100%; border: 1px solid var(--dc-border); border-radius: 16px; overflow: hidden; text-align: left; }
|
|
6946
|
+
.dcm-address { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--dc-surface); }
|
|
6947
|
+
.dcm-address + .dcm-address { border-top: 1px solid var(--dc-border); }
|
|
6948
|
+
.dcm-address-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
|
|
6949
|
+
.dcm-address-main span { font-size: 13px; color: var(--dc-text-secondary); }
|
|
6950
|
+
.dcm-address-main code { font-family: var(--dc-font-mono); font-size: 13px; color: var(--dc-text); }
|
|
6951
|
+
.dcm-balance { font-family: var(--dc-font-mono); font-size: 13px; color: var(--dc-text); white-space: nowrap; }
|
|
6952
|
+
.dcm-copy { width: 30px; height: 30px; border-radius: 9px; border: 0; background: transparent; color: var(--dc-text-muted);
|
|
6953
|
+
display: grid; place-items: center; cursor: pointer; padding: 0; transition: background .15s, color .15s; }
|
|
6954
|
+
.dcm-copy:hover { background: var(--dc-surface-hover); color: var(--dc-text); }
|
|
6955
|
+
.dcm-panel { width: 100%; border: 1px solid var(--dc-border); border-radius: 16px; text-align: left; overflow: hidden; }
|
|
6956
|
+
.dcm-panel-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 14px;
|
|
6957
|
+
border: 0; background: var(--dc-surface); color: var(--dc-text); font-weight: 500; font-size: 14px; line-height: 1; font-family: inherit; cursor: pointer; }
|
|
6958
|
+
.dcm-panel-head:hover { background: var(--dc-surface-hover); }
|
|
6959
|
+
.dcm-panel-head svg { color: var(--dc-text-muted); }
|
|
6960
|
+
.dcm-panel-body { padding: 14px; border-top: 1px solid var(--dc-border); display: grid; gap: 10px; }
|
|
6961
|
+
.dcm-note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--dc-text-secondary); }
|
|
6962
|
+
.dcm-warn { padding: 12px; border-radius: 12px; font-size: 13px; line-height: 1.5;
|
|
6963
|
+
background: color-mix(in srgb, var(--dc-danger) 9%, transparent); border: 1px solid color-mix(in srgb, var(--dc-danger) 30%, transparent); color: var(--dc-text); }
|
|
6964
|
+
.dcm-warn strong { display: block; margin-bottom: 2px; color: var(--dc-danger); font-weight: 600; }
|
|
6965
|
+
.dcm-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dc-text); cursor: pointer; }
|
|
6966
|
+
.dcm-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--dc-accent); }
|
|
6967
|
+
.dcm-row { display: flex; gap: 8px; width: 100%; }
|
|
6968
|
+
.dcm-row > .dcm-primary { flex: 1; height: 44px; border-radius: 12px; }
|
|
6969
|
+
.dcm-actions { width: 100%; display: flex; gap: 8px; }
|
|
6970
|
+
.dcm-actions > * { flex: 1; }
|
|
6971
|
+
`;
|
|
6972
|
+
function injectModalCss() {
|
|
6973
|
+
if (document.getElementById("decane-modal-css")) return;
|
|
6974
|
+
const el = document.createElement("style");
|
|
6975
|
+
el.id = "decane-modal-css";
|
|
6976
|
+
el.textContent = MODAL_CSS;
|
|
6977
|
+
document.head.appendChild(el);
|
|
6978
|
+
}
|
|
6979
|
+
function shortAddress(a, head = 6, tail = 4) {
|
|
6980
|
+
return a.length > head + tail + 1 ? `${a.slice(0, head)}\u2026${a.slice(-tail)}` : a;
|
|
6981
|
+
}
|
|
6982
|
+
function CopyButton({ value, label }) {
|
|
6983
|
+
const [copied, setCopied] = useState2(false);
|
|
6984
|
+
async function copy() {
|
|
6985
|
+
await navigator.clipboard.writeText(value).catch(() => {
|
|
6986
|
+
});
|
|
6987
|
+
setCopied(true);
|
|
6988
|
+
setTimeout(() => setCopied(false), 1500);
|
|
6989
|
+
}
|
|
6990
|
+
return /* @__PURE__ */ React3.createElement("button", { type: "button", className: "dcm-copy", onClick: copy, "aria-label": copied ? "Copied" : `Copy ${label} address`, title: copied ? "Copied" : "Copy address" }, copied ? /* @__PURE__ */ React3.createElement(CheckIcon, null) : /* @__PURE__ */ React3.createElement(CopyIcon, null));
|
|
6991
|
+
}
|
|
6835
6992
|
function AddressRow({
|
|
6836
6993
|
label,
|
|
6837
6994
|
address,
|
|
@@ -6840,14 +6997,10 @@ function AddressRow({
|
|
|
6840
6997
|
rpcUrls
|
|
6841
6998
|
}) {
|
|
6842
6999
|
const balance = useBalance(kind, address, chain, rpcUrls);
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6846
|
-
|
|
6847
|
-
borderRadius: 10,
|
|
6848
|
-
padding: "10px 14px",
|
|
6849
|
-
marginBottom: 8
|
|
6850
|
-
} }, /* @__PURE__ */ React3.createElement("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: 5 } }, /* @__PURE__ */ React3.createElement("span", { style: { fontSize: 10, fontWeight: 700, color: "var(--dc-text-muted)", letterSpacing: "0.06em", textTransform: "uppercase" } }, label), /* @__PURE__ */ React3.createElement("span", { style: { fontSize: 11, fontFamily: "monospace", color: "var(--dc-text)" } }, balance.loading ? "\u2026" : `${formatBalanceDisplay(balance.value)} ${balance.symbol}`)), /* @__PURE__ */ React3.createElement("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 8 } }, /* @__PURE__ */ React3.createElement("span", { style: { fontSize: 13, fontFamily: "monospace", color: "var(--dc-text)", letterSpacing: "0.02em" } }, short), /* @__PURE__ */ React3.createElement(CopyButton, { value: address })));
|
|
7000
|
+
return /* @__PURE__ */ React3.createElement("div", { className: "dcm-address" }, /* @__PURE__ */ React3.createElement("div", { className: "dcm-address-main" }, /* @__PURE__ */ React3.createElement("span", null, label), /* @__PURE__ */ React3.createElement("code", { title: address }, shortAddress(address, 8, 6))), /* @__PURE__ */ React3.createElement("span", { className: "dcm-balance" }, balance.loading ? "\u2026" : `${formatBalanceDisplay(balance.value)} ${balance.symbol}`), /* @__PURE__ */ React3.createElement(CopyButton, { value: address, label }));
|
|
7001
|
+
}
|
|
7002
|
+
function ProtectedBy() {
|
|
7003
|
+
return /* @__PURE__ */ React3.createElement("div", { className: "dcm-protected" }, /* @__PURE__ */ React3.createElement("span", null, "Protected by"), /* @__PURE__ */ React3.createElement(DecaneMark, { size: 14, muted: true }), /* @__PURE__ */ React3.createElement(DecaneWordmark, { size: 12, muted: true }));
|
|
6851
7004
|
}
|
|
6852
7005
|
function SignInView({
|
|
6853
7006
|
onGoogleSignIn,
|
|
@@ -6881,6 +7034,7 @@ function SignInView({
|
|
|
6881
7034
|
const [showOtherMethods, setShowOtherMethods] = useState2(false);
|
|
6882
7035
|
const [error, setError] = useState2("");
|
|
6883
7036
|
const passkeyFirst = !!canUsePasskey && !!onPasskeySignIn && !showOtherMethods;
|
|
7037
|
+
const busy = googleLoading || kingsChatLoading || xLoading || customLoading || emailLoading || phoneLoading;
|
|
6884
7038
|
async function handlePasskey() {
|
|
6885
7039
|
if (!onPasskeySignIn) return;
|
|
6886
7040
|
setError("");
|
|
@@ -6934,7 +7088,7 @@ function SignInView({
|
|
|
6934
7088
|
setError("");
|
|
6935
7089
|
setEmailLoading(true);
|
|
6936
7090
|
try {
|
|
6937
|
-
await onEmailStart(email);
|
|
7091
|
+
await onEmailStart(email.trim());
|
|
6938
7092
|
setEmailSent(true);
|
|
6939
7093
|
} catch (e2) {
|
|
6940
7094
|
setError(e2.message);
|
|
@@ -6947,7 +7101,7 @@ function SignInView({
|
|
|
6947
7101
|
setError("");
|
|
6948
7102
|
setEmailLoading(true);
|
|
6949
7103
|
try {
|
|
6950
|
-
await onEmailVerify(email, code);
|
|
7104
|
+
await onEmailVerify(email.trim(), code);
|
|
6951
7105
|
} catch (e2) {
|
|
6952
7106
|
setError(e2.message);
|
|
6953
7107
|
} finally {
|
|
@@ -6960,7 +7114,7 @@ function SignInView({
|
|
|
6960
7114
|
setError("");
|
|
6961
7115
|
setPhoneLoading(true);
|
|
6962
7116
|
try {
|
|
6963
|
-
await onPhoneStart(phone);
|
|
7117
|
+
await onPhoneStart(phone.trim());
|
|
6964
7118
|
setPhoneSent(true);
|
|
6965
7119
|
} catch (e2) {
|
|
6966
7120
|
setError(e2.message);
|
|
@@ -6974,7 +7128,7 @@ function SignInView({
|
|
|
6974
7128
|
setError("");
|
|
6975
7129
|
setPhoneLoading(true);
|
|
6976
7130
|
try {
|
|
6977
|
-
await onPhoneVerify(phone, phoneCode);
|
|
7131
|
+
await onPhoneVerify(phone.trim(), phoneCode);
|
|
6978
7132
|
} catch (e2) {
|
|
6979
7133
|
setError(e2.message);
|
|
6980
7134
|
} finally {
|
|
@@ -6993,226 +7147,67 @@ function SignInView({
|
|
|
6993
7147
|
setCustomLoading(false);
|
|
6994
7148
|
}
|
|
6995
7149
|
}
|
|
6996
|
-
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
|
|
7032
|
-
), /* @__PURE__ */ React3.createElement(
|
|
7033
|
-
"button",
|
|
7034
|
-
{
|
|
7035
|
-
onClick: () => setShowOtherMethods(true),
|
|
7036
|
-
style: {
|
|
7037
|
-
width: "100%",
|
|
7038
|
-
marginTop: 10,
|
|
7039
|
-
background: "none",
|
|
7040
|
-
border: "none",
|
|
7041
|
-
color: "var(--dc-text-muted)",
|
|
7042
|
-
fontSize: 12,
|
|
7043
|
-
cursor: "pointer",
|
|
7044
|
-
fontFamily: "inherit"
|
|
7045
|
-
}
|
|
7046
|
-
},
|
|
7047
|
-
"Use email or Google instead"
|
|
7048
|
-
), error && /* @__PURE__ */ React3.createElement("div", { style: { marginTop: 10, fontSize: 12, color: "var(--dc-danger, #ff5533)" } }, error)), !passkeyFirst && authMethods.includes("google") && /* @__PURE__ */ React3.createElement(
|
|
7049
|
-
"button",
|
|
7050
|
-
{
|
|
7051
|
-
onClick: handleGoogle,
|
|
7052
|
-
disabled: googleLoading,
|
|
7053
|
-
style: {
|
|
7054
|
-
width: "100%",
|
|
7055
|
-
padding: "10px 0",
|
|
7056
|
-
marginBottom: 10,
|
|
7057
|
-
background: "var(--dc-accent)",
|
|
7058
|
-
color: "var(--dc-accent-text)",
|
|
7059
|
-
border: "none",
|
|
7060
|
-
borderRadius: 10,
|
|
7061
|
-
fontSize: 13,
|
|
7062
|
-
fontWeight: 700,
|
|
7063
|
-
cursor: googleLoading ? "not-allowed" : "pointer",
|
|
7064
|
-
opacity: googleLoading ? 0.7 : 1,
|
|
7065
|
-
fontFamily: "inherit"
|
|
7066
|
-
}
|
|
7067
|
-
},
|
|
7068
|
-
googleLoading ? "Redirecting\u2026" : "Continue with Google"
|
|
7069
|
-
), !passkeyFirst && authMethods.includes("kingschat") && onKingsChatSignIn && /* @__PURE__ */ React3.createElement(
|
|
7070
|
-
"button",
|
|
7071
|
-
{
|
|
7072
|
-
onClick: handleKingsChat,
|
|
7073
|
-
disabled: kingsChatLoading,
|
|
7074
|
-
style: {
|
|
7075
|
-
width: "100%",
|
|
7076
|
-
padding: "10px 0",
|
|
7077
|
-
marginBottom: 10,
|
|
7078
|
-
background: "var(--dc-surface)",
|
|
7079
|
-
color: "var(--dc-text)",
|
|
7080
|
-
border: "1px solid var(--dc-border)",
|
|
7081
|
-
borderRadius: 10,
|
|
7082
|
-
fontSize: 13,
|
|
7083
|
-
fontWeight: 700,
|
|
7084
|
-
cursor: kingsChatLoading ? "not-allowed" : "pointer",
|
|
7085
|
-
opacity: kingsChatLoading ? 0.7 : 1,
|
|
7086
|
-
fontFamily: "inherit"
|
|
7087
|
-
}
|
|
7088
|
-
},
|
|
7089
|
-
kingsChatLoading ? "Waiting for KingsChat\u2026" : "Continue with KingsChat"
|
|
7090
|
-
), !passkeyFirst && authMethods.includes("x") && onXSignIn && /* @__PURE__ */ React3.createElement(
|
|
7091
|
-
"button",
|
|
7092
|
-
{
|
|
7093
|
-
onClick: handleX,
|
|
7094
|
-
disabled: xLoading,
|
|
7095
|
-
style: {
|
|
7096
|
-
width: "100%",
|
|
7097
|
-
padding: "10px 0",
|
|
7098
|
-
marginBottom: 10,
|
|
7099
|
-
background: "var(--dc-surface)",
|
|
7100
|
-
color: "var(--dc-text)",
|
|
7101
|
-
border: "1px solid var(--dc-border)",
|
|
7102
|
-
borderRadius: 10,
|
|
7103
|
-
fontSize: 13,
|
|
7104
|
-
fontWeight: 700,
|
|
7105
|
-
cursor: xLoading ? "not-allowed" : "pointer",
|
|
7106
|
-
opacity: xLoading ? 0.7 : 1,
|
|
7107
|
-
fontFamily: "inherit",
|
|
7108
|
-
display: "flex",
|
|
7109
|
-
alignItems: "center",
|
|
7110
|
-
justifyContent: "center",
|
|
7111
|
-
gap: 8
|
|
7112
|
-
}
|
|
7113
|
-
},
|
|
7114
|
-
/* @__PURE__ */ React3.createElement(XLogo, null),
|
|
7115
|
-
xLoading ? "Redirecting\u2026" : "Continue with X"
|
|
7116
|
-
), !passkeyFirst && authMethods.includes("email") && /* @__PURE__ */ React3.createElement(React3.Fragment, null, authMethods.includes("google") && /* @__PURE__ */ React3.createElement("div", { style: { textAlign: "center", color: "var(--dc-text-muted)", fontSize: 12, margin: "10px 0" } }, "\u2014 or \u2014"), !emailSent ? /* @__PURE__ */ React3.createElement("form", { onSubmit: handleEmailStart, style: { display: "flex", gap: 8 } }, /* @__PURE__ */ React3.createElement(
|
|
7150
|
+
function backToMethods() {
|
|
7151
|
+
setEmailSent(false);
|
|
7152
|
+
setCode("");
|
|
7153
|
+
setPhoneSent(false);
|
|
7154
|
+
setPhoneCode("");
|
|
7155
|
+
setError("");
|
|
7156
|
+
}
|
|
7157
|
+
const errorLine = error ? /* @__PURE__ */ React3.createElement("p", { className: "dcm-error", role: "alert" }, error) : null;
|
|
7158
|
+
if (passkeyFirst) {
|
|
7159
|
+
return /* @__PURE__ */ React3.createElement("div", { className: "dcm-body" }, /* @__PURE__ */ React3.createElement("div", { className: "dcm-badge" }, /* @__PURE__ */ React3.createElement(KeyIcon, { size: 22 })), /* @__PURE__ */ React3.createElement("h2", { className: "dcm-title" }, "Welcome back"), /* @__PURE__ */ React3.createElement("p", { className: "dcm-sub" }, passkeyAddress ? /* @__PURE__ */ React3.createElement(React3.Fragment, null, "Unlock ", /* @__PURE__ */ React3.createElement("b", null, shortAddress(passkeyAddress)), " with your passkey.") : "Unlock your wallet with your passkey."), /* @__PURE__ */ React3.createElement("button", { type: "button", className: "dcm-primary", onClick: handlePasskey, disabled: passkeyLoading }, passkeyLoading ? "Waiting for passkey\u2026" : "Continue with passkey"), errorLine, /* @__PURE__ */ React3.createElement("button", { type: "button", className: "dcm-link", onClick: () => {
|
|
7160
|
+
setError("");
|
|
7161
|
+
setShowOtherMethods(true);
|
|
7162
|
+
} }, "Use another sign-in method"), /* @__PURE__ */ React3.createElement(ProtectedBy, null));
|
|
7163
|
+
}
|
|
7164
|
+
if (emailSent || phoneSent) {
|
|
7165
|
+
const isEmail = emailSent;
|
|
7166
|
+
const value = isEmail ? code : phoneCode;
|
|
7167
|
+
const setValue = isEmail ? setCode : setPhoneCode;
|
|
7168
|
+
const loading = isEmail ? emailLoading : phoneLoading;
|
|
7169
|
+
return /* @__PURE__ */ React3.createElement("form", { className: "dcm-body", onSubmit: isEmail ? handleEmailVerify : handlePhoneVerify }, /* @__PURE__ */ React3.createElement("div", { className: "dcm-badge" }, isEmail ? /* @__PURE__ */ React3.createElement(MailIcon, { size: 22 }) : /* @__PURE__ */ React3.createElement(PhoneIcon, { size: 22 })), /* @__PURE__ */ React3.createElement("h2", { className: "dcm-title" }, "Enter your code"), /* @__PURE__ */ React3.createElement("p", { className: "dcm-sub" }, "We sent a 6-digit code to ", /* @__PURE__ */ React3.createElement("b", null, isEmail ? email.trim() : phone.trim())), /* @__PURE__ */ React3.createElement("div", { className: "dcm-form" }, /* @__PURE__ */ React3.createElement(
|
|
7170
|
+
"input",
|
|
7171
|
+
{
|
|
7172
|
+
className: "dcm-field dcm-code",
|
|
7173
|
+
"aria-label": "6-digit code",
|
|
7174
|
+
placeholder: "000000",
|
|
7175
|
+
value,
|
|
7176
|
+
maxLength: 6,
|
|
7177
|
+
autoFocus: true,
|
|
7178
|
+
inputMode: "numeric",
|
|
7179
|
+
autoComplete: "one-time-code",
|
|
7180
|
+
onChange: (e) => setValue(e.target.value.replace(/\D/g, ""))
|
|
7181
|
+
}
|
|
7182
|
+
), /* @__PURE__ */ React3.createElement("button", { type: "submit", className: "dcm-primary", disabled: loading || value.length < 6 }, loading ? "Verifying\u2026" : "Continue")), errorLine, /* @__PURE__ */ React3.createElement("button", { type: "button", className: "dcm-link", onClick: backToMethods }, "Use a different method"), /* @__PURE__ */ React3.createElement(ProtectedBy, null));
|
|
7183
|
+
}
|
|
7184
|
+
const showPhone = authMethods.includes("phone") && !!onPhoneStart && !!onPhoneVerify;
|
|
7185
|
+
return /* @__PURE__ */ React3.createElement("div", { className: "dcm-body" }, /* @__PURE__ */ React3.createElement(DecaneMark, { size: 44 }), /* @__PURE__ */ React3.createElement("h2", { className: "dcm-title" }, resumeHint ? "Welcome back" : "Log in or sign up"), resumeHint && /* @__PURE__ */ React3.createElement("p", { className: "dcm-sub" }, "Sign in again to resume ", resumeHint, "."), /* @__PURE__ */ React3.createElement("div", { className: "dcm-methods" }, authMethods.includes("google") && /* @__PURE__ */ React3.createElement("button", { type: "button", className: "dcm-method", onClick: handleGoogle, disabled: busy }, /* @__PURE__ */ React3.createElement(GoogleMark, { size: 18 }), /* @__PURE__ */ React3.createElement("span", null, googleLoading ? "Redirecting to Google\u2026" : "Google")), authMethods.includes("email") && /* @__PURE__ */ React3.createElement("form", { className: "dcm-method dcm-method-input", onSubmit: handleEmailStart }, /* @__PURE__ */ React3.createElement(MailIcon, { size: 18 }), /* @__PURE__ */ React3.createElement(
|
|
7117
7186
|
"input",
|
|
7118
7187
|
{
|
|
7119
7188
|
type: "email",
|
|
7120
7189
|
required: true,
|
|
7121
7190
|
placeholder: "your@email.com",
|
|
7191
|
+
"aria-label": "Email address",
|
|
7192
|
+
autoComplete: "email",
|
|
7122
7193
|
value: email,
|
|
7123
|
-
onChange: (e) => setEmail(e.target.value)
|
|
7124
|
-
|
|
7125
|
-
|
|
7126
|
-
), /* @__PURE__ */ React3.createElement("button", { type: "submit", disabled: emailLoading, style: {
|
|
7127
|
-
padding: "0 16px",
|
|
7128
|
-
background: "var(--dc-surface)",
|
|
7129
|
-
border: "1px solid var(--dc-border)",
|
|
7130
|
-
borderRadius: 8,
|
|
7131
|
-
color: "var(--dc-text)",
|
|
7132
|
-
fontSize: 13,
|
|
7133
|
-
cursor: "pointer",
|
|
7134
|
-
fontFamily: "inherit"
|
|
7135
|
-
} }, emailLoading ? "\u2026" : "Send code")) : /* @__PURE__ */ React3.createElement("form", { onSubmit: handleEmailVerify, style: { display: "flex", gap: 8 } }, /* @__PURE__ */ React3.createElement(
|
|
7136
|
-
"input",
|
|
7137
|
-
{
|
|
7138
|
-
placeholder: "6-digit code",
|
|
7139
|
-
value: code,
|
|
7140
|
-
maxLength: 6,
|
|
7141
|
-
autoFocus: true,
|
|
7142
|
-
onChange: (e) => setCode(e.target.value.replace(/\D/g, "")),
|
|
7143
|
-
style: { ...inputStyle, flex: 1, letterSpacing: 4, textAlign: "center" }
|
|
7144
|
-
}
|
|
7145
|
-
), /* @__PURE__ */ React3.createElement("button", { type: "submit", disabled: emailLoading, style: {
|
|
7146
|
-
padding: "0 16px",
|
|
7147
|
-
background: "var(--dc-accent)",
|
|
7148
|
-
color: "var(--dc-accent-text)",
|
|
7149
|
-
border: "none",
|
|
7150
|
-
borderRadius: 8,
|
|
7151
|
-
fontSize: 13,
|
|
7152
|
-
fontWeight: 700,
|
|
7153
|
-
cursor: "pointer",
|
|
7154
|
-
fontFamily: "inherit"
|
|
7155
|
-
} }, emailLoading ? "\u2026" : "Verify"))), !passkeyFirst && authMethods.includes("phone") && onPhoneStart && onPhoneVerify && /* @__PURE__ */ React3.createElement(React3.Fragment, null, (authMethods.includes("google") || authMethods.includes("email")) && /* @__PURE__ */ React3.createElement("div", { style: { textAlign: "center", color: "var(--dc-text-muted)", fontSize: 12, margin: "10px 0" } }, "\u2014 or \u2014"), !phoneSent ? /* @__PURE__ */ React3.createElement("form", { onSubmit: handlePhoneStart, style: { display: "flex", gap: 8 } }, /* @__PURE__ */ React3.createElement(
|
|
7194
|
+
onChange: (e) => setEmail(e.target.value)
|
|
7195
|
+
}
|
|
7196
|
+
), /* @__PURE__ */ React3.createElement("button", { type: "submit", className: "dcm-submit", disabled: busy || !email.trim() }, emailLoading ? "Sending\u2026" : "Submit")), showPhone && /* @__PURE__ */ React3.createElement("form", { className: "dcm-method dcm-method-input", onSubmit: handlePhoneStart }, /* @__PURE__ */ React3.createElement(PhoneIcon, { size: 18 }), /* @__PURE__ */ React3.createElement(
|
|
7156
7197
|
"input",
|
|
7157
7198
|
{
|
|
7158
7199
|
type: "tel",
|
|
7159
7200
|
required: true,
|
|
7160
7201
|
placeholder: "+234 801 234 5678",
|
|
7202
|
+
"aria-label": "Phone number",
|
|
7203
|
+
autoComplete: "tel",
|
|
7161
7204
|
value: phone,
|
|
7162
|
-
onChange: (e) => setPhone(e.target.value)
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
7167
|
-
|
|
7168
|
-
border: "1px solid var(--dc-border)",
|
|
7169
|
-
borderRadius: 8,
|
|
7170
|
-
color: "var(--dc-text)",
|
|
7171
|
-
fontSize: 13,
|
|
7172
|
-
cursor: "pointer",
|
|
7173
|
-
fontFamily: "inherit"
|
|
7174
|
-
} }, phoneLoading ? "\u2026" : "Send code")) : /* @__PURE__ */ React3.createElement("form", { onSubmit: handlePhoneVerify, style: { display: "flex", gap: 8 } }, /* @__PURE__ */ React3.createElement(
|
|
7175
|
-
"input",
|
|
7176
|
-
{
|
|
7177
|
-
placeholder: "6-digit code",
|
|
7178
|
-
value: phoneCode,
|
|
7179
|
-
maxLength: 6,
|
|
7180
|
-
autoFocus: true,
|
|
7181
|
-
inputMode: "numeric",
|
|
7182
|
-
onChange: (e) => setPhoneCode(e.target.value.replace(/\D/g, "")),
|
|
7183
|
-
style: { ...inputStyle, flex: 1, letterSpacing: 4, textAlign: "center" }
|
|
7184
|
-
}
|
|
7185
|
-
), /* @__PURE__ */ React3.createElement("button", { type: "submit", disabled: phoneLoading, style: {
|
|
7186
|
-
padding: "0 16px",
|
|
7187
|
-
background: "var(--dc-accent)",
|
|
7188
|
-
color: "var(--dc-accent-text)",
|
|
7189
|
-
border: "none",
|
|
7190
|
-
borderRadius: 8,
|
|
7191
|
-
fontSize: 13,
|
|
7192
|
-
fontWeight: 700,
|
|
7193
|
-
cursor: "pointer",
|
|
7194
|
-
fontFamily: "inherit"
|
|
7195
|
-
} }, phoneLoading ? "\u2026" : "Verify"))), !passkeyFirst && customAuthLabel && onCustomAuthSignIn && /* @__PURE__ */ React3.createElement(React3.Fragment, null, (authMethods.includes("google") || authMethods.includes("email")) && /* @__PURE__ */ React3.createElement("div", { style: { textAlign: "center", color: "var(--dc-text-muted)", fontSize: 12, margin: "10px 0" } }, "\u2014 or \u2014"), /* @__PURE__ */ React3.createElement(
|
|
7196
|
-
"button",
|
|
7197
|
-
{
|
|
7198
|
-
onClick: handleCustomAuth,
|
|
7199
|
-
disabled: customLoading,
|
|
7200
|
-
style: {
|
|
7201
|
-
width: "100%",
|
|
7202
|
-
padding: "10px 0",
|
|
7203
|
-
background: "var(--dc-surface)",
|
|
7204
|
-
color: "var(--dc-text)",
|
|
7205
|
-
border: "1px solid var(--dc-border)",
|
|
7206
|
-
borderRadius: 10,
|
|
7207
|
-
fontSize: 13,
|
|
7208
|
-
fontWeight: 600,
|
|
7209
|
-
cursor: customLoading ? "not-allowed" : "pointer",
|
|
7210
|
-
opacity: customLoading ? 0.7 : 1,
|
|
7211
|
-
fontFamily: "inherit"
|
|
7212
|
-
}
|
|
7213
|
-
},
|
|
7214
|
-
customLoading ? "Connecting\u2026" : customAuthLabel
|
|
7215
|
-
)), error && /* @__PURE__ */ React3.createElement("div", { style: { marginTop: 10, fontSize: 12, color: "var(--dc-danger, #ff5533)" } }, error));
|
|
7205
|
+
onChange: (e) => setPhone(e.target.value)
|
|
7206
|
+
}
|
|
7207
|
+
), /* @__PURE__ */ React3.createElement("button", { type: "submit", className: "dcm-submit", disabled: busy || !phone.trim() }, phoneLoading ? "Sending\u2026" : "Submit")), authMethods.includes("x") && onXSignIn && /* @__PURE__ */ React3.createElement("button", { type: "button", className: "dcm-method", onClick: handleX, disabled: busy }, /* @__PURE__ */ React3.createElement(XLogo, { size: 16 }), /* @__PURE__ */ React3.createElement("span", null, xLoading ? "Redirecting to X\u2026" : "X")), authMethods.includes("kingschat") && onKingsChatSignIn && /* @__PURE__ */ React3.createElement("button", { type: "button", className: "dcm-method", onClick: handleKingsChat, disabled: busy }, /* @__PURE__ */ React3.createElement(ChatIcon, { size: 18 }), /* @__PURE__ */ React3.createElement("span", null, kingsChatLoading ? "Waiting for KingsChat\u2026" : "KingsChat")), customAuthLabel && onCustomAuthSignIn && /* @__PURE__ */ React3.createElement("button", { type: "button", className: "dcm-method", onClick: handleCustomAuth, disabled: busy }, /* @__PURE__ */ React3.createElement(UserIcon, { size: 18 }), /* @__PURE__ */ React3.createElement("span", null, customLoading ? "Connecting\u2026" : customAuthLabel))), errorLine, canUsePasskey && onPasskeySignIn && /* @__PURE__ */ React3.createElement("button", { type: "button", className: "dcm-link", onClick: () => {
|
|
7208
|
+
setError("");
|
|
7209
|
+
setShowOtherMethods(false);
|
|
7210
|
+
} }, "Use my passkey instead"), /* @__PURE__ */ React3.createElement(ProtectedBy, null));
|
|
7216
7211
|
}
|
|
7217
7212
|
function RecoverySection({
|
|
7218
7213
|
addresses,
|
|
@@ -7263,60 +7258,34 @@ function RecoverySection({
|
|
|
7263
7258
|
setBusy(false);
|
|
7264
7259
|
}
|
|
7265
7260
|
}
|
|
7266
|
-
const
|
|
7267
|
-
|
|
7268
|
-
background: "var(--dc-bg)",
|
|
7269
|
-
border: "1px solid var(--dc-border)",
|
|
7270
|
-
borderRadius: 8,
|
|
7271
|
-
color: "var(--dc-text)",
|
|
7272
|
-
padding: "8px 10px",
|
|
7273
|
-
fontSize: 12,
|
|
7274
|
-
outline: "none",
|
|
7275
|
-
fontFamily: "inherit",
|
|
7276
|
-
boxSizing: "border-box"
|
|
7277
|
-
};
|
|
7278
|
-
const btnStyle = {
|
|
7279
|
-
padding: "8px 12px",
|
|
7280
|
-
borderRadius: 8,
|
|
7281
|
-
fontSize: 12,
|
|
7282
|
-
fontWeight: 700,
|
|
7283
|
-
cursor: "pointer",
|
|
7284
|
-
fontFamily: "inherit",
|
|
7285
|
-
border: "none"
|
|
7286
|
-
};
|
|
7287
|
-
return /* @__PURE__ */ React3.createElement("div", { style: { margin: "0 16px 14px", border: "1px solid var(--dc-border)", borderRadius: 10, overflow: "hidden" } }, /* @__PURE__ */ React3.createElement(
|
|
7288
|
-
"button",
|
|
7261
|
+
const passwordFields = /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(
|
|
7262
|
+
"input",
|
|
7289
7263
|
{
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
|
|
7296
|
-
|
|
7297
|
-
|
|
7298
|
-
|
|
7299
|
-
|
|
7300
|
-
|
|
7301
|
-
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
|
|
7305
|
-
|
|
7264
|
+
className: "dcm-field",
|
|
7265
|
+
type: "password",
|
|
7266
|
+
placeholder: "Password (at least 8 characters)",
|
|
7267
|
+
"aria-label": "Password",
|
|
7268
|
+
autoComplete: "new-password",
|
|
7269
|
+
value: password,
|
|
7270
|
+
onChange: (e) => setPassword(e.target.value)
|
|
7271
|
+
}
|
|
7272
|
+
), /* @__PURE__ */ React3.createElement(
|
|
7273
|
+
"input",
|
|
7274
|
+
{
|
|
7275
|
+
className: "dcm-field",
|
|
7276
|
+
placeholder: "Password hint (optional)",
|
|
7277
|
+
"aria-label": "Password hint",
|
|
7278
|
+
value: passwordHint,
|
|
7279
|
+
onChange: (e) => setPasswordHint(e.target.value)
|
|
7280
|
+
}
|
|
7281
|
+
), error && /* @__PURE__ */ React3.createElement("p", { className: "dcm-error", role: "alert" }, error));
|
|
7282
|
+
return /* @__PURE__ */ React3.createElement("div", { className: "dcm-panel" }, /* @__PURE__ */ React3.createElement("button", { type: "button", className: "dcm-panel-head", onClick: () => setExpanded((v) => !v), "aria-expanded": expanded }, /* @__PURE__ */ React3.createElement("span", null, "Recovery file"), /* @__PURE__ */ React3.createElement(ChevronIcon, { open: expanded })), expanded && /* @__PURE__ */ React3.createElement("div", { className: "dcm-panel-body" }, !mode && /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement("p", { className: "dcm-note" }, "Save a recovery file so you can restore this wallet on a new device."), /* @__PURE__ */ React3.createElement("button", { type: "button", className: "dcm-primary", style: { height: 44, borderRadius: 12 }, onClick: () => {
|
|
7306
7283
|
reset();
|
|
7307
7284
|
setMode("share");
|
|
7308
|
-
}
|
|
7285
|
+
} }, "Download recovery-share file"), /* @__PURE__ */ React3.createElement("button", { type: "button", className: "dcm-ghost", onClick: () => {
|
|
7309
7286
|
reset();
|
|
7310
7287
|
setMode("portable");
|
|
7311
|
-
}
|
|
7312
|
-
background: "rgba(255,85,51,0.08)",
|
|
7313
|
-
border: "1px solid rgba(255,85,51,0.3)",
|
|
7314
|
-
borderRadius: 8,
|
|
7315
|
-
padding: "8px 10px",
|
|
7316
|
-
fontSize: 11,
|
|
7317
|
-
color: "#ff9977",
|
|
7318
|
-
lineHeight: 1.5
|
|
7319
|
-
} }, /* @__PURE__ */ React3.createElement("strong", { style: { display: "block", marginBottom: 3, color: "#ff5533" } }, "This file controls your wallet"), "Contains two shares \u2014 file plus password gives complete control. Keep it offline, not a cloud drive. This also invalidates your current recovery-share file."), /* @__PURE__ */ React3.createElement("label", { style: { display: "flex", alignItems: "center", gap: 6, fontSize: 11, color: "var(--dc-text)" } }, /* @__PURE__ */ React3.createElement("input", { type: "checkbox", checked: confirmed, onChange: (e) => setConfirmed(e.target.checked), style: { width: "auto" } }), "I understand this is a bearer secret"), /* @__PURE__ */ React3.createElement("input", { type: "password", placeholder: "Password (min 8 chars)", value: password, onChange: (e) => setPassword(e.target.value), style: inputStyle }), /* @__PURE__ */ React3.createElement("input", { placeholder: "Password hint (optional)", value: passwordHint, onChange: (e) => setPasswordHint(e.target.value), style: inputStyle }), error && /* @__PURE__ */ React3.createElement("div", { style: { fontSize: 11, color: "var(--dc-danger, #ff5533)" } }, error), /* @__PURE__ */ React3.createElement("div", { style: { display: "flex", gap: 8 } }, /* @__PURE__ */ React3.createElement("button", { onClick: handleGenerate, disabled: busy || !confirmed, style: { ...btnStyle, flex: 1, background: "var(--dc-accent)", color: "var(--dc-accent-text)" } }, busy ? "Generating\u2026" : "Generate & download"), /* @__PURE__ */ React3.createElement("button", { onClick: reset, style: { ...btnStyle, background: "transparent", border: "1px solid var(--dc-border)", color: "var(--dc-text-muted)" } }, "Cancel"))), result && /* @__PURE__ */ React3.createElement("div", { style: { marginTop: 10, fontSize: 11, color: "var(--dc-text-muted)", lineHeight: 1.5 } }, result.kind === "share" ? "Recovery-share file" : "Full recovery file", " downloaded \u2014 share set is now version ", result.version, ". Any previous recovery file no longer works.")));
|
|
7288
|
+
} }, "Download full recovery file")), mode === "share" && /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement("p", { className: "dcm-note" }, "One share. It is useless on its own, so a password manager or cloud drive is a fine place for it. A new file replaces any previous recovery-share file."), passwordFields, /* @__PURE__ */ React3.createElement("div", { className: "dcm-row" }, /* @__PURE__ */ React3.createElement("button", { type: "button", className: "dcm-primary", onClick: handleGenerate, disabled: busy }, busy ? "Preparing\u2026" : "Download"), /* @__PURE__ */ React3.createElement("button", { type: "button", className: "dcm-ghost", onClick: reset }, "Cancel"))), mode === "portable" && /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement("div", { className: "dcm-warn" }, /* @__PURE__ */ React3.createElement("strong", null, "This file controls your wallet"), "It holds two shares, so the file plus its password is full control. Keep it offline, not in a cloud drive. It also replaces your current recovery-share file."), /* @__PURE__ */ React3.createElement("label", { className: "dcm-check" }, /* @__PURE__ */ React3.createElement("input", { type: "checkbox", checked: confirmed, onChange: (e) => setConfirmed(e.target.checked) }), "I understand anyone with this file and password controls the wallet"), passwordFields, /* @__PURE__ */ React3.createElement("div", { className: "dcm-row" }, /* @__PURE__ */ React3.createElement("button", { type: "button", className: "dcm-primary", onClick: handleGenerate, disabled: busy || !confirmed }, busy ? "Preparing\u2026" : "Download"), /* @__PURE__ */ React3.createElement("button", { type: "button", className: "dcm-ghost", onClick: reset }, "Cancel"))), result && /* @__PURE__ */ React3.createElement("p", { className: "dcm-note" }, result.kind === "share" ? "Recovery-share file" : "Full recovery file", " downloaded. The share set is now version ", result.version, ", and any earlier recovery file no longer works.")));
|
|
7320
7289
|
}
|
|
7321
7290
|
function SocialWalletModal({
|
|
7322
7291
|
open,
|
|
@@ -7327,6 +7296,7 @@ function SocialWalletModal({
|
|
|
7327
7296
|
onDisconnect,
|
|
7328
7297
|
onGoogleSignIn,
|
|
7329
7298
|
onKingsChatSignIn,
|
|
7299
|
+
onXSignIn,
|
|
7330
7300
|
onEmailStart,
|
|
7331
7301
|
onEmailVerify,
|
|
7332
7302
|
onPhoneStart,
|
|
@@ -7345,9 +7315,11 @@ function SocialWalletModal({
|
|
|
7345
7315
|
const [timer, setTimer] = useState2("");
|
|
7346
7316
|
const [unlocking, setUnlocking] = useState2(false);
|
|
7347
7317
|
const [disconnecting, setDisconnecting] = useState2(false);
|
|
7318
|
+
const [actionError, setActionError] = useState2("");
|
|
7348
7319
|
useEffect2(() => {
|
|
7349
7320
|
if (!open) return;
|
|
7350
7321
|
injectTokens2(theme);
|
|
7322
|
+
injectModalCss();
|
|
7351
7323
|
if (theme !== "auto") return;
|
|
7352
7324
|
const mq = window.matchMedia("(prefers-color-scheme: dark)");
|
|
7353
7325
|
const h = () => injectTokens2("auto");
|
|
@@ -7374,17 +7346,23 @@ function SocialWalletModal({
|
|
|
7374
7346
|
if (!open) return null;
|
|
7375
7347
|
async function handleUnlock() {
|
|
7376
7348
|
setUnlocking(true);
|
|
7349
|
+
setActionError("");
|
|
7377
7350
|
try {
|
|
7378
7351
|
await onUnlock();
|
|
7352
|
+
} catch (e) {
|
|
7353
|
+
setActionError(e.message);
|
|
7379
7354
|
} finally {
|
|
7380
7355
|
setUnlocking(false);
|
|
7381
7356
|
}
|
|
7382
7357
|
}
|
|
7383
7358
|
async function handleDisconnect() {
|
|
7384
7359
|
setDisconnecting(true);
|
|
7360
|
+
setActionError("");
|
|
7385
7361
|
try {
|
|
7386
7362
|
await onDisconnect();
|
|
7387
7363
|
onClose();
|
|
7364
|
+
} catch (e) {
|
|
7365
|
+
setActionError(e.message);
|
|
7388
7366
|
} finally {
|
|
7389
7367
|
setDisconnecting(false);
|
|
7390
7368
|
}
|
|
@@ -7392,12 +7370,13 @@ function SocialWalletModal({
|
|
|
7392
7370
|
const evmChain = chains?.find((c) => c.startsWith("evm:")) ?? "evm:11155111";
|
|
7393
7371
|
const solChain = chains?.find((c) => c.startsWith("solana:")) ?? "solana:mainnet";
|
|
7394
7372
|
const showSignIn = !socialAuth.addresses || socialAuth.needsReconnect;
|
|
7373
|
+
const unlocked = socialAuth.isUnlocked;
|
|
7395
7374
|
const modal = /* @__PURE__ */ React3.createElement(
|
|
7396
7375
|
"div",
|
|
7397
7376
|
{
|
|
7398
7377
|
role: "dialog",
|
|
7399
7378
|
"aria-modal": "true",
|
|
7400
|
-
"aria-label": "
|
|
7379
|
+
"aria-label": showSignIn ? "Log in or sign up" : "Your wallet",
|
|
7401
7380
|
style: {
|
|
7402
7381
|
position: "fixed",
|
|
7403
7382
|
inset: 0,
|
|
@@ -7406,63 +7385,17 @@ function SocialWalletModal({
|
|
|
7406
7385
|
alignItems: "center",
|
|
7407
7386
|
justifyContent: "center",
|
|
7408
7387
|
padding: 16,
|
|
7409
|
-
fontFamily: "var(--dc-font-sans, system-ui, sans-serif)"
|
|
7388
|
+
fontFamily: "var(--dc-font-sans, system-ui, sans-serif)",
|
|
7389
|
+
WebkitFontSmoothing: "antialiased"
|
|
7410
7390
|
}
|
|
7411
7391
|
},
|
|
7412
|
-
/* @__PURE__ */ React3.createElement(
|
|
7413
|
-
|
|
7414
|
-
{
|
|
7415
|
-
onClick: onClose,
|
|
7416
|
-
style: {
|
|
7417
|
-
position: "absolute",
|
|
7418
|
-
inset: 0,
|
|
7419
|
-
background: "var(--dc-bg-overlay)",
|
|
7420
|
-
backdropFilter: "blur(8px)",
|
|
7421
|
-
WebkitBackdropFilter: "blur(8px)"
|
|
7422
|
-
}
|
|
7423
|
-
}
|
|
7424
|
-
),
|
|
7425
|
-
/* @__PURE__ */ React3.createElement("div", { style: {
|
|
7426
|
-
position: "relative",
|
|
7427
|
-
background: "var(--dc-bg)",
|
|
7428
|
-
border: "1px solid var(--dc-border)",
|
|
7429
|
-
borderRadius: 20,
|
|
7430
|
-
width: "100%",
|
|
7431
|
-
maxWidth: 380,
|
|
7432
|
-
maxHeight: "90vh",
|
|
7433
|
-
overflowY: "auto",
|
|
7434
|
-
boxShadow: "0 24px 64px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04)"
|
|
7435
|
-
} }, /* @__PURE__ */ React3.createElement("div", { style: {
|
|
7436
|
-
height: 2,
|
|
7437
|
-
position: "sticky",
|
|
7438
|
-
top: 0,
|
|
7439
|
-
zIndex: 1,
|
|
7440
|
-
background: "linear-gradient(90deg, transparent, var(--dc-accent) 30%, var(--dc-accent) 70%, transparent)"
|
|
7441
|
-
} }), /* @__PURE__ */ React3.createElement("div", { style: { padding: "18px 20px 16px", display: "flex", alignItems: "center", gap: 11 } }, /* @__PURE__ */ React3.createElement(DecaneMark, { size: 38 }), /* @__PURE__ */ React3.createElement("div", { style: { flex: 1 } }, /* @__PURE__ */ React3.createElement("div", { style: { display: "flex", alignItems: "baseline", gap: 6 } }, /* @__PURE__ */ React3.createElement(DecaneWordmark, { size: 15 }), /* @__PURE__ */ React3.createElement("span", { style: { fontSize: 13, fontWeight: 700, color: "var(--dc-text-muted)", letterSpacing: "-0.01em" } }, "wallet")), /* @__PURE__ */ React3.createElement("div", { style: { fontSize: 11, color: "var(--dc-text-muted)", marginTop: 2 } }, "Non-custodial \xB7 key split three ways")), /* @__PURE__ */ React3.createElement(
|
|
7442
|
-
"button",
|
|
7443
|
-
{
|
|
7444
|
-
onClick: onClose,
|
|
7445
|
-
style: {
|
|
7446
|
-
background: "var(--dc-surface)",
|
|
7447
|
-
border: "1px solid var(--dc-border)",
|
|
7448
|
-
borderRadius: 8,
|
|
7449
|
-
width: 28,
|
|
7450
|
-
height: 28,
|
|
7451
|
-
cursor: "pointer",
|
|
7452
|
-
display: "flex",
|
|
7453
|
-
alignItems: "center",
|
|
7454
|
-
justifyContent: "center",
|
|
7455
|
-
color: "var(--dc-text-muted)",
|
|
7456
|
-
flexShrink: 0,
|
|
7457
|
-
padding: 0
|
|
7458
|
-
}
|
|
7459
|
-
},
|
|
7460
|
-
/* @__PURE__ */ React3.createElement("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" }, /* @__PURE__ */ React3.createElement("path", { d: "M1.5 1.5L10.5 10.5M10.5 1.5L1.5 10.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round" }))
|
|
7461
|
-
)), showSignIn ? /* @__PURE__ */ React3.createElement(
|
|
7392
|
+
/* @__PURE__ */ React3.createElement("div", { className: "dcm-backdrop", onClick: onClose }),
|
|
7393
|
+
/* @__PURE__ */ React3.createElement("div", { className: "dcm-card" }, /* @__PURE__ */ React3.createElement("button", { type: "button", className: "dcm-icon-btn", style: { right: 14 }, onClick: onClose, "aria-label": "Close" }, /* @__PURE__ */ React3.createElement(CloseIcon, null)), showSignIn ? /* @__PURE__ */ React3.createElement(
|
|
7462
7394
|
SignInView,
|
|
7463
7395
|
{
|
|
7464
7396
|
onGoogleSignIn,
|
|
7465
7397
|
onKingsChatSignIn,
|
|
7398
|
+
onXSignIn,
|
|
7466
7399
|
onEmailStart,
|
|
7467
7400
|
onEmailVerify,
|
|
7468
7401
|
onPhoneStart,
|
|
@@ -7475,86 +7408,22 @@ function SocialWalletModal({
|
|
|
7475
7408
|
passkeyAddress,
|
|
7476
7409
|
onPasskeySignIn
|
|
7477
7410
|
}
|
|
7478
|
-
) : /* @__PURE__ */ React3.createElement(React3.
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
} }, /* @__PURE__ */ React3.createElement("div", { style: { display: "flex", alignItems: "center", gap: 8 } }, /* @__PURE__ */ React3.createElement("span", { style: {
|
|
7488
|
-
width: 7,
|
|
7489
|
-
height: 7,
|
|
7490
|
-
borderRadius: "50%",
|
|
7491
|
-
flexShrink: 0,
|
|
7492
|
-
background: socialAuth.isUnlocked ? "#12b76a" : "var(--dc-accent)",
|
|
7493
|
-
boxShadow: `0 0 6px ${socialAuth.isUnlocked ? "#12b76a" : "var(--dc-accent)"}`
|
|
7494
|
-
} }), /* @__PURE__ */ React3.createElement("span", { style: {
|
|
7495
|
-
fontSize: 12,
|
|
7496
|
-
fontWeight: 700,
|
|
7497
|
-
color: socialAuth.isUnlocked ? "#12b76a" : "var(--dc-accent)"
|
|
7498
|
-
} }, socialAuth.isUnlocked ? "Unlocked" : "Locked")), socialAuth.isUnlocked && timer && /* @__PURE__ */ React3.createElement("span", { style: { fontSize: 11, color: "var(--dc-text-muted)", fontFamily: "monospace" } }, "expires ", timer)), /* @__PURE__ */ React3.createElement("div", { style: { padding: "0 16px 14px" } }, socialAuth.addresses?.evm && /* @__PURE__ */ React3.createElement(AddressRow, { label: "EVM (Ethereum, Base, \u2026)", address: socialAuth.addresses.evm, kind: "evm", chain: evmChain, rpcUrls }), socialAuth.addresses?.solana && /* @__PURE__ */ React3.createElement(AddressRow, { label: "Solana", address: socialAuth.addresses.solana, kind: "solana", chain: solChain, rpcUrls })), socialAuth.isUnlocked && /* @__PURE__ */ React3.createElement(
|
|
7411
|
+
) : /* @__PURE__ */ React3.createElement("div", { className: "dcm-body" }, /* @__PURE__ */ React3.createElement(DecaneMark, { size: 44 }), /* @__PURE__ */ React3.createElement("h2", { className: "dcm-title" }, "Your wallet"), /* @__PURE__ */ React3.createElement(
|
|
7412
|
+
"span",
|
|
7413
|
+
{
|
|
7414
|
+
className: "dcm-status",
|
|
7415
|
+
style: { color: unlocked ? "#12b76a" : "var(--dc-accent-ink)", marginTop: -8 }
|
|
7416
|
+
},
|
|
7417
|
+
/* @__PURE__ */ React3.createElement("i", { style: { background: unlocked ? "#12b76a" : "var(--dc-accent)" } }),
|
|
7418
|
+
unlocked ? timer ? `Unlocked, expires in ${timer}` : "Unlocked" : "Locked"
|
|
7419
|
+
), (socialAuth.addresses?.evm || socialAuth.addresses?.solana) && /* @__PURE__ */ React3.createElement("div", { className: "dcm-addresses" }, socialAuth.addresses?.evm && /* @__PURE__ */ React3.createElement(AddressRow, { label: "Ethereum and EVM", address: socialAuth.addresses.evm, kind: "evm", chain: evmChain, rpcUrls }), socialAuth.addresses?.solana && /* @__PURE__ */ React3.createElement(AddressRow, { label: "Solana", address: socialAuth.addresses.solana, kind: "solana", chain: solChain, rpcUrls })), unlocked && /* @__PURE__ */ React3.createElement(
|
|
7499
7420
|
RecoverySection,
|
|
7500
7421
|
{
|
|
7501
7422
|
addresses: socialAuth.addresses,
|
|
7502
7423
|
onRotateShares,
|
|
7503
7424
|
onExportPortableBackup
|
|
7504
7425
|
}
|
|
7505
|
-
), /* @__PURE__ */ React3.createElement("div", { style: {
|
|
7506
|
-
padding: "14px 16px",
|
|
7507
|
-
borderTop: "1px solid var(--dc-border)",
|
|
7508
|
-
display: "flex",
|
|
7509
|
-
gap: 8
|
|
7510
|
-
} }, !socialAuth.isUnlocked && /* @__PURE__ */ React3.createElement(
|
|
7511
|
-
"button",
|
|
7512
|
-
{
|
|
7513
|
-
onClick: handleUnlock,
|
|
7514
|
-
disabled: unlocking,
|
|
7515
|
-
style: {
|
|
7516
|
-
flex: 1,
|
|
7517
|
-
padding: "10px 0",
|
|
7518
|
-
background: "var(--dc-accent)",
|
|
7519
|
-
color: "var(--dc-accent-text)",
|
|
7520
|
-
border: "none",
|
|
7521
|
-
borderRadius: 10,
|
|
7522
|
-
fontSize: 13,
|
|
7523
|
-
fontWeight: 700,
|
|
7524
|
-
cursor: unlocking ? "not-allowed" : "pointer",
|
|
7525
|
-
fontFamily: "inherit",
|
|
7526
|
-
opacity: unlocking ? 0.7 : 1
|
|
7527
|
-
}
|
|
7528
|
-
},
|
|
7529
|
-
unlocking ? "Unlocking\u2026" : "\u{1F513} Unlock wallet"
|
|
7530
|
-
), /* @__PURE__ */ React3.createElement(
|
|
7531
|
-
"button",
|
|
7532
|
-
{
|
|
7533
|
-
onClick: handleDisconnect,
|
|
7534
|
-
disabled: disconnecting,
|
|
7535
|
-
style: {
|
|
7536
|
-
flex: socialAuth.isUnlocked ? 1 : 0,
|
|
7537
|
-
padding: "10px 16px",
|
|
7538
|
-
background: "transparent",
|
|
7539
|
-
border: "1px solid var(--dc-border)",
|
|
7540
|
-
borderRadius: 10,
|
|
7541
|
-
color: "var(--dc-text-muted)",
|
|
7542
|
-
fontSize: 13,
|
|
7543
|
-
cursor: disconnecting ? "not-allowed" : "pointer",
|
|
7544
|
-
fontFamily: "inherit",
|
|
7545
|
-
opacity: disconnecting ? 0.7 : 1,
|
|
7546
|
-
whiteSpace: "nowrap"
|
|
7547
|
-
}
|
|
7548
|
-
},
|
|
7549
|
-
disconnecting ? "Signing out\u2026" : "Sign out"
|
|
7550
|
-
))), /* @__PURE__ */ React3.createElement("div", { style: {
|
|
7551
|
-
padding: "11px 16px",
|
|
7552
|
-
borderTop: "1px solid var(--dc-border)",
|
|
7553
|
-
display: "flex",
|
|
7554
|
-
alignItems: "center",
|
|
7555
|
-
justifyContent: "center",
|
|
7556
|
-
gap: 6
|
|
7557
|
-
} }, /* @__PURE__ */ React3.createElement("span", { style: { fontSize: 10.5, color: "var(--dc-text-muted)", letterSpacing: "0.02em" } }, "Secured by"), /* @__PURE__ */ React3.createElement(DecaneMark, { size: 13, muted: true }), /* @__PURE__ */ React3.createElement(DecaneWordmark, { size: 11, muted: true })))
|
|
7426
|
+
), actionError && /* @__PURE__ */ React3.createElement("p", { className: "dcm-error", role: "alert" }, actionError), /* @__PURE__ */ React3.createElement("div", { className: "dcm-actions" }, !unlocked && /* @__PURE__ */ React3.createElement("button", { type: "button", className: "dcm-primary", style: { height: 44, borderRadius: 12 }, onClick: handleUnlock, disabled: unlocking }, unlocking ? "Unlocking\u2026" : "Unlock wallet"), /* @__PURE__ */ React3.createElement("button", { type: "button", className: "dcm-ghost", onClick: handleDisconnect, disabled: disconnecting }, disconnecting ? "Signing out\u2026" : "Sign out")), /* @__PURE__ */ React3.createElement(ProtectedBy, null)))
|
|
7558
7427
|
);
|
|
7559
7428
|
return createPortal2(modal, document.body);
|
|
7560
7429
|
}
|
|
@@ -8977,6 +8846,7 @@ export {
|
|
|
8977
8846
|
UnlockTokenRejectedError,
|
|
8978
8847
|
UserCancelledError,
|
|
8979
8848
|
WalletEnrolmentError,
|
|
8849
|
+
WalletExistsError,
|
|
8980
8850
|
WalletSelector,
|
|
8981
8851
|
WeakPasswordError,
|
|
8982
8852
|
WebAuthnNotSupportedError,
|