@orangecheck/auth-client 2.47.0 → 2.48.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/bond.mjs CHANGED
@@ -4,10 +4,10 @@ import {
4
4
  bondFloorsText,
5
5
  bondRefusal,
6
6
  fetchOcBond
7
- } from "./chunk-CYMNVXRY.mjs";
7
+ } from "./chunk-PBDOIRFF.mjs";
8
8
  import "./chunk-OKHAVNEU.mjs";
9
- import "./chunk-ISO4Z37C.mjs";
10
- import "./chunk-4HJ2ZTAC.mjs";
9
+ import "./chunk-KL4QKCE3.mjs";
10
+ import "./chunk-KD4XTVFV.mjs";
11
11
  import "./chunk-E3QI365E.mjs";
12
12
  import "./chunk-F7O4OREM.mjs";
13
13
  import "./chunk-U7IUGDLW.mjs";
@@ -3,6 +3,13 @@ import {
3
3
  } from "./chunk-E3QI365E.mjs";
4
4
 
5
5
  // src/refusal.ts
6
+ var ENDED_ERRORS = {
7
+ signed_out: "You were signed out while signing in. Sign in again.",
8
+ account_deleted: "This account is being deleted, so you can't sign in to it."
9
+ };
10
+ function endedSigninText(reason) {
11
+ return ownWord(ENDED_ERRORS, reason);
12
+ }
6
13
  var SIGNIN_ERRORS = {
7
14
  bad_request: "That doesn't look like a Bitcoin address.",
8
15
  invalid_challenge: "That signature doesn't match this address. Sign with the wallet that holds it.",
@@ -24,10 +31,12 @@ var SIGNIN_ERRORS = {
24
31
  wrong_code: "That code isn't right. Check the newest email from us.",
25
32
  replay: "That code was already used. Send a new one.",
26
33
  invalid_token: "That code is no longer valid. Send a new one.",
27
- email_mismatch: "That code was sent to a different address. Send a new one."
34
+ email_mismatch: "That code was sent to a different address. Send a new one.",
35
+ ...ENDED_ERRORS
28
36
  };
29
37
  var EMAIL_ERRORS = {
30
- expired: "That code expired. Send a new one."
38
+ expired: "That code expired. Send a new one.",
39
+ signed_out: "You were signed out while signing in. Send a new code to sign in again."
31
40
  };
32
41
  var SUBMIT_ERRORS = {
33
42
  bad_request: "That signature couldn't be read. Copy it again, whole."
@@ -52,8 +61,9 @@ function failureMessage(err, path, step, authOrigin) {
52
61
  }
53
62
 
54
63
  export {
64
+ endedSigninText,
55
65
  networkError,
56
66
  humanSigninError,
57
67
  failureMessage
58
68
  };
59
- //# sourceMappingURL=chunk-4HJ2ZTAC.mjs.map
69
+ //# sourceMappingURL=chunk-KD4XTVFV.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/refusal.ts"],"sourcesContent":["/**\n * What a refused or failed call to the auth host says to a person. Sign-in\n * and linking read the same reasons from the same host, so they share these.\n */\n\nimport { ownWord } from './own-word';\n\n/** A sign-in the person's own sign-out or account deletion ended while it ran, by any way in. */\nconst ENDED_ERRORS: Record<string, string> = {\n signed_out: 'You were signed out while signing in. Sign in again.',\n account_deleted: \"This account is being deleted, so you can't sign in to it.\",\n};\n\nexport function endedSigninText(reason: string): string | undefined {\n return ownWord(ENDED_ERRORS, reason);\n}\n\n/**\n * The auth host answers with machine reasons. Its /api/auth/signin says it\n * exposes them \"so the /signin UI can give an actionable message\", and this\n * form printed them verbatim instead: typing \"hello\" as an address showed\n * `bad_request`. Each reason maps to what happened and what to do next.\n */\nconst SIGNIN_ERRORS: Record<string, string> = {\n bad_request: \"That doesn't look like a Bitcoin address.\",\n invalid_challenge:\n \"That signature doesn't match this address. Sign with the wallet that holds it.\",\n sig_invalid: \"That signature doesn't match this address. Sign with the wallet that holds it.\",\n sig_unsupported_scheme:\n \"We can't check this wallet's signature format yet. Try another wallet, or use email.\",\n expired: 'That request timed out. Try again for a fresh one.',\n not_yet_valid: 'That request is not valid yet. Check your device clock, then try again.',\n nonce_mismatch: \"That request didn't match. Try again for a fresh one.\",\n audience_mismatch: \"That request didn't match this site. Reload the page and try again.\",\n purpose_mismatch: \"That request didn't match. Try again for a fresh one.\",\n malformed: \"That signature couldn't be read. Copy it again, whole.\",\n challenge_mismatch:\n 'That sign-in message changed after it was issued. Get a new one and sign it again.',\n mainnet_only: 'Sign in with a mainnet Bitcoin address.',\n cross_site_blocked: 'Your browser blocked this request. Reload the page and try again.',\n rate_limited: 'Too many tries. Wait a minute, then try again.',\n invalid_email: \"That email address doesn't look right.\",\n mailer_unavailable: \"We couldn't send the email right now. Try again in a minute.\",\n mailer_error: \"We couldn't send the email right now. Try again in a minute.\",\n wrong_code: \"That code isn't right. Check the newest email from us.\",\n replay: 'That code was already used. Send a new one.',\n invalid_token: 'That code is no longer valid. Send a new one.',\n email_mismatch: 'That code was sent to a different address. Send a new one.',\n ...ENDED_ERRORS,\n};\n\nconst EMAIL_ERRORS: Record<string, string> = {\n expired: 'That code expired. Send a new one.',\n signed_out: 'You were signed out while signing in. Send a new code to sign in again.',\n};\n\n/**\n * `bad_request` means the host's body schema failed. Fetching a challenge\n * that is the address; submitting a signature it is the pasted signature\n * (under 10 characters, say), which is not an address problem at all.\n */\nconst SUBMIT_ERRORS: Record<string, string> = {\n bad_request: \"That signature couldn't be read. Copy it again, whole.\",\n};\n\n/** The auth host by name, so an outage reads as theirs and not the page's. */\nexport function networkError(authOrigin: string): string {\n let host = authOrigin;\n try {\n host = new URL(authOrigin).host;\n } catch {\n // not a URL: name it as given\n }\n return `We couldn't reach the orangecheck sign-in service at ${host}. Check your connection, then try again.`;\n}\n\nexport function humanSigninError(\n reason: string,\n path: 'wallet' | 'email',\n step: 'challenge' | 'submit' = 'challenge'\n): string {\n // A reason that is not a code is already a sentence.\n if (!/^[a-z0-9_]+$/.test(reason)) return reason;\n const own =\n (path === 'wallet' && step === 'submit' && ownWord(SUBMIT_ERRORS, reason)) ||\n (path === 'email' && ownWord(EMAIL_ERRORS, reason));\n if (own) return own;\n return (\n ownWord(SIGNIN_ERRORS, reason) ??\n (path === 'email'\n ? \"That didn't work. Try again, or send a new code.\"\n : \"That didn't work. Try again.\")\n );\n}\n\n/**\n * A failed fetch (\"Failed to fetch\") or an HTML error page parsed as JSON\n * (a SyntaxError) is not prose meant for a person; everything else thrown\n * here carries a host reason code. A wallet's failure never comes here.\n */\nexport function failureMessage(\n err: unknown,\n path: 'wallet' | 'email',\n step: 'challenge' | 'submit',\n authOrigin: string\n): string {\n if (err instanceof TypeError || err instanceof SyntaxError) return networkError(authOrigin);\n return humanSigninError(err instanceof Error ? err.message : 'failed', path, step);\n}\n"],"mappings":";;;;;AAQA,IAAM,eAAuC;AAAA,EACzC,YAAY;AAAA,EACZ,iBAAiB;AACrB;AAEO,SAAS,gBAAgB,QAAoC;AAChE,SAAO,QAAQ,cAAc,MAAM;AACvC;AAQA,IAAM,gBAAwC;AAAA,EAC1C,aAAa;AAAA,EACb,mBACI;AAAA,EACJ,aAAa;AAAA,EACb,wBACI;AAAA,EACJ,SAAS;AAAA,EACT,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,kBAAkB;AAAA,EAClB,WAAW;AAAA,EACX,oBACI;AAAA,EACJ,cAAc;AAAA,EACd,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,GAAG;AACP;AAEA,IAAM,eAAuC;AAAA,EACzC,SAAS;AAAA,EACT,YAAY;AAChB;AAOA,IAAM,gBAAwC;AAAA,EAC1C,aAAa;AACjB;AAGO,SAAS,aAAa,YAA4B;AACrD,MAAI,OAAO;AACX,MAAI;AACA,WAAO,IAAI,IAAI,UAAU,EAAE;AAAA,EAC/B,QAAQ;AAAA,EAER;AACA,SAAO,wDAAwD,IAAI;AACvE;AAEO,SAAS,iBACZ,QACA,MACA,OAA+B,aACzB;AAEN,MAAI,CAAC,eAAe,KAAK,MAAM,EAAG,QAAO;AACzC,QAAM,MACD,SAAS,YAAY,SAAS,YAAY,QAAQ,eAAe,MAAM,KACvE,SAAS,WAAW,QAAQ,cAAc,MAAM;AACrD,MAAI,IAAK,QAAO;AAChB,SACI,QAAQ,eAAe,MAAM,MAC5B,SAAS,UACJ,qDACA;AAEd;AAOO,SAAS,eACZ,KACA,MACA,MACA,YACM;AACN,MAAI,eAAe,aAAa,eAAe,YAAa,QAAO,aAAa,UAAU;AAC1F,SAAO,iBAAiB,eAAe,QAAQ,IAAI,UAAU,UAAU,MAAM,IAAI;AACrF;","names":[]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  failureMessage
3
- } from "./chunk-4HJ2ZTAC.mjs";
3
+ } from "./chunk-KD4XTVFV.mjs";
4
4
  import {
5
5
  SUDO_ACCOUNT_MISMATCH_MESSAGE,
6
6
  handleSudoRequired,
@@ -420,6 +420,7 @@ function EmailLinkForm({
420
420
  const [busy, setBusy] = React.useState(false);
421
421
  const [err, setErr] = React.useState(null);
422
422
  const [transfer, setTransfer] = React.useState(false);
423
+ const [moving, setMoving] = React.useState(false);
423
424
  async function start() {
424
425
  setBusy(true);
425
426
  setErr(null);
@@ -513,17 +514,19 @@ function EmailLinkForm({
513
514
  TransferConfirm,
514
515
  {
515
516
  what: "email",
517
+ next: "we send one more code to it",
516
518
  busy,
517
- onConfirm: () => void verify(true),
519
+ onConfirm: () => {
520
+ setTransfer(false);
521
+ setMoving(true);
522
+ setCode("");
523
+ void start();
524
+ },
518
525
  onCancel,
519
526
  err
520
527
  }
521
528
  ) : /* @__PURE__ */ jsxs(Fragment, { children: [
522
- /* @__PURE__ */ jsxs("p", { style: bodyStyle, children: [
523
- "Enter the 6-digit code sent to ",
524
- email,
525
- "."
526
- ] }),
529
+ /* @__PURE__ */ jsx("p", { style: bodyStyle, children: moving ? `Enter the new 6-digit code sent to ${email} to move it here.` : `Enter the 6-digit code sent to ${email}.` }),
527
530
  /* @__PURE__ */ jsx(
528
531
  "input",
529
532
  {
@@ -544,17 +547,20 @@ function EmailLinkForm({
544
547
  "button",
545
548
  {
546
549
  type: "button",
547
- onClick: () => void verify(false),
550
+ onClick: () => void verify(moving),
548
551
  disabled: busy || code.length !== 6,
549
552
  style: primaryBtnStyle(busy || code.length !== 6),
550
- children: busy ? "linking\u2026" : "verify + link"
553
+ children: busy ? "linking\u2026" : moving ? "verify + transfer" : "verify + link"
551
554
  }
552
555
  ),
553
556
  /* @__PURE__ */ jsx(
554
557
  "button",
555
558
  {
556
559
  type: "button",
557
- onClick: () => setStep("email"),
560
+ onClick: () => {
561
+ setStep("email");
562
+ setMoving(false);
563
+ },
558
564
  disabled: busy,
559
565
  style: ghostBtnStyle(busy),
560
566
  children: "back"
@@ -575,14 +581,15 @@ function BtcLinkForm({
575
581
  const [challenge, setChallenge] = React.useState("");
576
582
  const [busy, setBusy] = React.useState(false);
577
583
  const [err, setErr] = React.useState(null);
578
- const [pendingSig, setPendingSig] = React.useState(null);
579
- async function getChallenge() {
584
+ const [elsewhere, setElsewhere] = React.useState(false);
585
+ const [moving, setMoving] = React.useState(false);
586
+ async function getChallenge(keepErr = false) {
580
587
  if (!didOc) {
581
588
  setErr("session not loaded yet \xB7 refresh and retry");
582
589
  return;
583
590
  }
584
591
  setBusy(true);
585
- setErr(null);
592
+ if (!keepErr) setErr(null);
586
593
  try {
587
594
  const r = await fetch(
588
595
  `${authOrigin}/api/challenge?addr=${encodeURIComponent(addr)}&purpose=link&audience=${encodeURIComponent(didOc)}`
@@ -603,6 +610,7 @@ function BtcLinkForm({
603
610
  async function postLink(sig, confirmTransfer) {
604
611
  setBusy(true);
605
612
  setErr(null);
613
+ let answered = false;
606
614
  try {
607
615
  const r = await fetch(`${authOrigin}/api/auth/link/btc`, {
608
616
  method: "POST",
@@ -616,7 +624,7 @@ function BtcLinkForm({
616
624
  });
617
625
  const j = await r.json();
618
626
  if (r.status === 409 && j.reason === "address_linked_elsewhere") {
619
- setPendingSig(sig);
627
+ setElsewhere(true);
620
628
  setBusy(false);
621
629
  return;
622
630
  }
@@ -626,11 +634,15 @@ function BtcLinkForm({
626
634
  setBusy(false);
627
635
  return;
628
636
  }
629
- if (!r.ok || !j.ok) throw new Error(j.reason ?? `http_${r.status}`);
637
+ if (!r.ok || !j.ok) {
638
+ answered = true;
639
+ throw new Error(j.reason ?? `http_${r.status}`);
640
+ }
630
641
  onDone();
631
642
  } catch (e) {
632
643
  setErr(failureMessage(e, "wallet", "submit", authOrigin));
633
644
  setBusy(false);
645
+ if (answered) await getChallenge(true);
634
646
  }
635
647
  }
636
648
  return /* @__PURE__ */ jsxs("div", { style: panelStyle("accent"), "data-oc-li-form": "btc", children: [
@@ -664,21 +676,25 @@ function BtcLinkForm({
664
676
  ),
665
677
  /* @__PURE__ */ jsx("button", { type: "button", onClick: onCancel, style: ghostBtnStyle(busy), children: "cancel" })
666
678
  ] })
667
- ] }) : pendingSig ? /* @__PURE__ */ jsx(
679
+ ] }) : elsewhere ? /* @__PURE__ */ jsx(
668
680
  TransferConfirm,
669
681
  {
670
682
  what: "bitcoin address",
683
+ next: "you sign one more message with it",
671
684
  busy,
672
- onConfirm: () => void postLink(pendingSig, true),
685
+ onConfirm: () => {
686
+ setElsewhere(false);
687
+ setMoving(true);
688
+ void getChallenge();
689
+ },
673
690
  onCancel,
674
691
  err
675
692
  }
676
693
  ) : /* @__PURE__ */ jsxs(Fragment, { children: [
677
694
  /* @__PURE__ */ jsxs("p", { style: bodyStyle, children: [
678
- "Sign the challenge with the wallet that controls",
679
- " ",
695
+ moving ? "Sign one more message with the wallet that controls " : "Sign the challenge with the wallet that controls ",
680
696
  /* @__PURE__ */ jsx("span", { style: { fontFamily: SIGNIN_FONT, wordBreak: "break-all" }, children: addr }),
681
- "."
697
+ moving ? " to move it here." : "."
682
698
  ] }),
683
699
  /* @__PURE__ */ jsx(
684
700
  LazyWalletButton,
@@ -688,7 +704,7 @@ function BtcLinkForm({
688
704
  showManual: true,
689
705
  layout: "list",
690
706
  heading: null,
691
- onSigned: (sig) => void postLink(sig, false),
707
+ onSigned: (sig) => void postLink(sig, moving),
692
708
  onError: (e) => setErr(e?.message ?? "wallet rejected")
693
709
  }
694
710
  ),
@@ -700,6 +716,7 @@ function BtcLinkForm({
700
716
  onClick: () => {
701
717
  setStep("request");
702
718
  setErr(null);
719
+ setMoving(false);
703
720
  },
704
721
  disabled: busy,
705
722
  style: ghostBtnStyle(busy),
@@ -711,6 +728,7 @@ function BtcLinkForm({
711
728
  }
712
729
  function TransferConfirm({
713
730
  what,
731
+ next,
714
732
  busy,
715
733
  onConfirm,
716
734
  onCancel,
@@ -720,7 +738,9 @@ function TransferConfirm({
720
738
  /* @__PURE__ */ jsxs("p", { style: bodyStyle, children: [
721
739
  "This ",
722
740
  what,
723
- " is already linked to another OrangeCheck account. You've just proven control of it \u2014 you can transfer the link to this account under dual proof of control. The other account loses this sign-in path; its history stays verifiable. Continue?"
741
+ " is already linked to another OrangeCheck account. You can transfer the link to this account under dual proof of control: ",
742
+ next,
743
+ ". The other account loses this sign-in path; its history stays verifiable. Continue?"
724
744
  ] }),
725
745
  err && /* @__PURE__ */ jsx(ErrorLine, { children: err }),
726
746
  /* @__PURE__ */ jsxs(FormButtons, { children: [
@@ -760,7 +780,7 @@ function LazyWalletButton(props) {
760
780
  return /* @__PURE__ */ jsx(ErrorLine, { children: "could not load wallet support \xB7 refresh to try again" });
761
781
  }
762
782
  if (!Comp) return /* @__PURE__ */ jsx("span", { style: hintStyle, children: "loading wallet options\u2026" });
763
- return /* @__PURE__ */ jsx(Comp, { ...props });
783
+ return /* @__PURE__ */ jsx(Comp, { ...props }, props.message);
764
784
  }
765
785
  function mask(value, kind) {
766
786
  if (kind === "email") {
@@ -934,4 +954,4 @@ export {
934
954
  ghostBtnStyle,
935
955
  dangerBtnStyle
936
956
  };
937
- //# sourceMappingURL=chunk-ISO4Z37C.mjs.map
957
+ //# sourceMappingURL=chunk-KL4QKCE3.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/linked-identities.tsx"],"sourcesContent":["'use client';\n\n/**\n * @orangecheck/auth-client · OcLinkedIdentities\n *\n * The shared linked-identities management surface for every `X.ochk.io`\n * consumer. A signed-in user sees their linked email + Bitcoin address,\n * can reveal/hide each raw value, unlink a non-primary identity, and\n * link a new one. Linking a Bitcoin address that's already on another\n * OC account offers a dual-proof transfer; the same is now true for\n * email (auth host F4). Consolidated (`merged_from`) accounts render in\n * a tombstone panel.\n *\n * This generalizes me.ochk.io's bespoke `LinkedIdentitiesPanel` so\n * linking is no longer a single-product, one-tab feature — any family\n * site can drop in `<OcLinkedIdentities />`. See AUTH-PLAN.md §5.\n *\n * All endpoints live on the auth host (`ochk.io`); calls are\n * cross-origin with `credentials: 'include'` and rely on the auth\n * host's family-CORS — the same posture `OcSignIn` uses. No local\n * proxy route is needed (AUTH-AUDIT.md F6: direct-to-host is the\n * intended design).\n *\n * Style: inline, CSS-variable-themed (same approach as `OcSignIn`), so\n * the component carries zero CSS dependency and themes to each site.\n * Every block carries a `data-oc-li-*` attribute so a site may\n * override via its own stylesheet.\n */\n\nimport { normalizeEmail } from '@orangecheck/auth-core/identifiers';\nimport * as React from 'react';\nimport {\n handleSudoRequired,\n isSudoAccountMismatch,\n SUDO_ACCOUNT_MISMATCH_MESSAGE,\n} from './sudo';\n\nimport {\n SIGNIN_BUTTON_RADIUS,\n SIGNIN_CASE,\n SIGNIN_FONT,\n signinRadius,\n signinSize,\n signinTracking,\n} from './appearance';\nimport { addressInputValue } from './address';\nimport { capText } from './caps';\nimport { failureMessage } from './refusal';\nimport { tabSessionHeader } from './tab-session';\n\nconst DEFAULT_AUTH_ORIGIN = 'https://ochk.io';\n\n/* --- types --- */\n\nexport interface OcLinkedIdentity {\n id: string;\n kind: 'email' | 'btc';\n /** Raw value · null when the identity is pending recovery. */\n value: string | null;\n verified_at: string | null;\n verification_method: 'email-otp' | 'bip322' | null;\n /** The signup-time identity for its kind · cannot be unlinked here. */\n is_primary: boolean;\n}\n\ninterface MergedFromEntry {\n did_oc: string;\n created_at: string;\n last_signed_in_at: string | null;\n}\n\ninterface IdentitiesResp {\n ok: boolean;\n account_id?: string;\n did_oc?: string | null;\n linked?: OcLinkedIdentity[];\n merged_from?: MergedFromEntry[];\n reason?: string;\n}\n\n/**\n * Fetch the signed-in user's linked identities from the auth host —\n * the same data `<OcLinkedIdentities>` renders, exposed as a plain\n * function for surfaces that need the list without the full\n * management UI (notably `<OcAccountMenu>`'s badge-identity promote\n * list). Returns `[]` when anonymous; throws on network / server\n * error so the caller can show a deferred state.\n */\nexport async function fetchOcLinkedIdentities(opts?: {\n authOrigin?: string;\n}): Promise<OcLinkedIdentity[]> {\n const authOrigin = opts?.authOrigin ?? DEFAULT_AUTH_ORIGIN;\n // Per-tab pinning: forward the tab's session JWT so the host resolves\n // the SAME account this tab displays (its chip reads /api/auth/me\n // tab-aware). Without this, a pinned tab's show-as list is the shared\n // cookie account's identities — a menu that disagrees with itself.\n // Unpinned tabs send no header → unchanged cookie-default behavior.\n const r = await fetch(`${authOrigin}/api/auth/identities`, {\n credentials: 'include',\n headers: { ...tabSessionHeader() },\n });\n if (r.status === 401) return [];\n if (!r.ok) throw new Error(`identities fetch failed: http_${r.status}`);\n const body = (await r.json()) as IdentitiesResp;\n return body.linked ?? [];\n}\n\nexport interface OcLinkedIdentitiesProps {\n /** Auth host origin. Defaults to `https://ochk.io`. */\n authOrigin?: string;\n /** Outer container className. */\n className?: string;\n /** Called after every successful link / unlink / transfer. */\n onChange?: () => void;\n /**\n * Show the \"portable attestation\" card that links out to attest.ochk.io.\n * Defaults to `true`. Pass `false` on a page that already hosts its own\n * attestation builder (ochk.io's dashboard), or the same action is offered\n * twice, one panel apart.\n */\n attestationLink?: boolean;\n}\n\n/* --- main --- */\n\nexport function OcLinkedIdentities({\n authOrigin = DEFAULT_AUTH_ORIGIN,\n className,\n onChange,\n attestationLink = true,\n}: OcLinkedIdentitiesProps): React.ReactElement {\n const [resp, setResp] = React.useState<IdentitiesResp | null>(null);\n const [error, setError] = React.useState<string | null>(null);\n const [showEmailLink, setShowEmailLink] = React.useState(false);\n const [showBtcLink, setShowBtcLink] = React.useState(false);\n\n const refresh = React.useCallback(async () => {\n setError(null);\n try {\n const r = await fetch(`${authOrigin}/api/auth/identities`, {\n credentials: 'include',\n headers: { ...tabSessionHeader() },\n });\n if (!r.ok) {\n if (r.status === 401) {\n setError('not signed in');\n return;\n }\n throw new Error(`http_${r.status}`);\n }\n setResp((await r.json()) as IdentitiesResp);\n } catch (e) {\n setError(e instanceof Error ? e.message : 'load failed');\n }\n }, [authOrigin]);\n\n React.useEffect(() => {\n void refresh();\n }, [refresh]);\n\n const afterChange = React.useCallback(() => {\n setShowEmailLink(false);\n setShowBtcLink(false);\n void refresh();\n onChange?.();\n }, [refresh, onChange]);\n\n if (error) {\n return (\n <div className={className} data-oc-li=\"\" style={panelStyle('warn')} role=\"alert\">\n <SectionLabel tone=\"warn\">§ identities · load deferred</SectionLabel>\n <p style={bodyStyle}>\n Couldn&apos;t reach the auth host ({error}). Linking is temporarily\n unavailable; your signed-in identity still works as normal.\n </p>\n <button type=\"button\" onClick={() => void refresh()} style={ghostBtnStyle(false)}>\n retry\n </button>\n </div>\n );\n }\n\n if (!resp) {\n return (\n <div className={className} data-oc-li=\"\" style={panelStyle()}>\n <span style={hintStyle}>loading…</span>\n </div>\n );\n }\n\n const linked = resp.linked ?? [];\n const emailRows = linked.filter((i) => i.kind === 'email');\n const btcRows = linked.filter((i) => i.kind === 'btc');\n const hasEmail = emailRows.some((i) => i.value);\n const hasBtc = btcRows.some((i) => i.value);\n const mergedFrom = resp.merged_from ?? [];\n\n return (\n <div className={className} data-oc-li=\"\" style={{ display: 'grid', gap: 16 }}>\n <div style={panelStyle()}>\n <SectionLabel>§ what this is</SectionLabel>\n <p style={bodyStyle}>\n These are the ways you can sign in to this account. An app you sign in to\n sees one only if you grant it. Linking a second one is also your way back\n in: lose one, and the other still signs you in.\n </p>\n </div>\n\n {mergedFrom.length > 0 && <ConsolidationPanel entries={mergedFrom} />}\n\n <div style={panelStyle('plain')} data-oc-li-rows=\"\">\n <IdentityGroup\n kind=\"email\"\n title=\"email\"\n rows={emailRows}\n authOrigin={authOrigin}\n onChange={afterChange}\n addCta={hasEmail ? null : 'link an email'}\n onAdd={() => {\n setShowEmailLink((v) => !v);\n setShowBtcLink(false);\n }}\n />\n <div style={{ borderTop: `1px solid ${V.border}` }} />\n <IdentityGroup\n kind=\"btc\"\n title=\"bitcoin address\"\n rows={btcRows}\n authOrigin={authOrigin}\n onChange={afterChange}\n addCta={hasBtc ? null : 'link a Bitcoin address'}\n onAdd={() => {\n setShowBtcLink((v) => !v);\n setShowEmailLink(false);\n }}\n />\n </div>\n\n {showEmailLink && (\n <EmailLinkForm\n authOrigin={authOrigin}\n onDone={afterChange}\n onCancel={() => setShowEmailLink(false)}\n />\n )}\n {showBtcLink && (\n <BtcLinkForm\n authOrigin={authOrigin}\n didOc={resp.did_oc ?? null}\n onDone={afterChange}\n onCancel={() => setShowBtcLink(false)}\n />\n )}\n\n {hasBtc && attestationLink && <AttestationLink />}\n </div>\n );\n}\n\n/* --- identity group (rows for one kind, or an empty-state add CTA) --- */\n\nfunction IdentityGroup({\n kind,\n title,\n rows,\n authOrigin,\n onChange,\n addCta,\n onAdd,\n}: {\n kind: 'email' | 'btc';\n title: string;\n rows: OcLinkedIdentity[];\n authOrigin: string;\n onChange: () => void;\n addCta: string | null;\n onAdd: () => void;\n}): React.ReactElement {\n if (rows.length === 0) {\n return (\n <div style={rowStyle}>\n <div>\n <div style={rowLabelStyle}>§ {title}</div>\n <div style={{ ...bodyStyle, marginTop: 4 }}>none linked</div>\n </div>\n {addCta && (\n <button type=\"button\" onClick={onAdd} style={primaryChipStyle}>\n + {addCta}\n </button>\n )}\n </div>\n );\n }\n return (\n <>\n {rows.map((r) => (\n <IdentityRow\n key={r.id}\n row={r}\n kind={kind}\n authOrigin={authOrigin}\n onChange={onChange}\n />\n ))}\n </>\n );\n}\n\n/* --- single identity row --- */\n\nfunction IdentityRow({\n row,\n kind,\n authOrigin,\n onChange,\n}: {\n row: OcLinkedIdentity;\n kind: 'email' | 'btc';\n authOrigin: string;\n onChange: () => void;\n}): React.ReactElement {\n const [shown, setShown] = React.useState(false);\n const [confirming, setConfirming] = React.useState(false);\n const [busy, setBusy] = React.useState(false);\n const [err, setErr] = React.useState<string | null>(null);\n\n const masked = row.value ? mask(row.value, kind) : '— pending recovery —';\n const display = shown && row.value ? row.value : masked;\n\n async function unlink(): Promise<void> {\n if (row.is_primary) return;\n setBusy(true);\n setErr(null);\n try {\n const r = await fetch(\n `${authOrigin}/api/auth/identities?id=${encodeURIComponent(row.id)}`,\n { method: 'DELETE', credentials: 'include' }\n );\n if (!r.ok) {\n const j = (await r.json().catch(() => ({}))) as { reason?: string };\n if (handleSudoRequired(j, { purpose: 'remove a way to sign in' })) return;\n if (isSudoAccountMismatch(j)) throw new Error(SUDO_ACCOUNT_MISMATCH_MESSAGE);\n throw new Error(j.reason ?? `http_${r.status}`);\n }\n onChange();\n } catch (e) {\n setErr(failureMessage(e, 'wallet', 'challenge', authOrigin));\n setBusy(false);\n setConfirming(false);\n }\n }\n\n return (\n <div style={rowStyle} data-oc-li-row={kind}>\n <div style={{ minWidth: 0, flex: 1 }}>\n <div style={{ display: 'flex', flexWrap: 'wrap', gap: '4px 12px' }}>\n <span style={rowLabelStyle}>\n § {kind === 'email' ? 'email' : 'bitcoin address'}\n </span>\n {row.is_primary && (\n <span style={{ ...rowLabelStyle, color: V.primary }}>\n primary · signup-time\n </span>\n )}\n </div>\n <div\n style={{\n marginTop: 4,\n color: V.foreground,\n fontFamily: SIGNIN_FONT,\n fontSize: signinSize(12),\n wordBreak: 'break-all',\n }}\n >\n {display}\n </div>\n {row.verified_at && (\n <div style={{ ...hintStyle, marginTop: 4 }}>\n verified · {new Date(row.verified_at).toUTCString()}\n </div>\n )}\n {err && <ErrorLine>{err}</ErrorLine>}\n </div>\n <div style={{ display: 'flex', flexShrink: 0, gap: 8, flexWrap: 'wrap' }}>\n {row.value && (\n <button\n type=\"button\"\n onClick={() => setShown((s) => !s)}\n style={ghostBtnStyle(false)}\n >\n {shown ? 'hide' : 'show'}\n </button>\n )}\n {!row.is_primary && !confirming && (\n <button\n type=\"button\"\n onClick={() => setConfirming(true)}\n style={dangerBtnStyle(false)}\n >\n unlink\n </button>\n )}\n {!row.is_primary && confirming && (\n <>\n <button\n type=\"button\"\n onClick={() => void unlink()}\n disabled={busy}\n style={dangerBtnStyle(busy)}\n >\n {busy ? 'unlinking…' : 'confirm unlink'}\n </button>\n <button\n type=\"button\"\n onClick={() => setConfirming(false)}\n disabled={busy}\n style={ghostBtnStyle(busy)}\n >\n cancel\n </button>\n </>\n )}\n </div>\n </div>\n );\n}\n\n/* --- consolidated-accounts tombstone panel --- */\n\nfunction ConsolidationPanel({ entries }: { entries: MergedFromEntry[] }): React.ReactElement {\n return (\n <div style={panelStyle('success')} data-oc-li-consolidated=\"\">\n <SectionLabel tone=\"success\">\n § consolidated accounts · {entries.length}\n </SectionLabel>\n <p style={bodyStyle}>\n {entries.length === 1 ? 'A previous OC account' : 'Previous OC accounts'} you\n signed up with, folded into this one under dual proof of control. Historical\n activity is unioned into this account automatically;{' '}\n {entries.length === 1 ? 'it' : 'they'} can no longer sign in.\n </p>\n <ul style={{ listStyle: 'none', margin: '12px 0 0', padding: 0 }}>\n {entries.map((e) => (\n <li\n key={e.did_oc}\n style={{\n display: 'flex',\n flexWrap: 'wrap',\n gap: 8,\n padding: '8px 0',\n borderTop: `1px solid ${V.border}`,\n fontFamily: SIGNIN_FONT,\n fontSize: signinSize(11),\n }}\n >\n <code style={{ color: V.foreground, wordBreak: 'break-all' }}>\n {e.did_oc}\n </code>\n <span style={{ ...hintStyle, marginLeft: 'auto' }}>\n created {new Date(e.created_at).toLocaleDateString()}\n </span>\n </li>\n ))}\n </ul>\n </div>\n );\n}\n\n/* --- portable-attestation pointer --- */\n\n/**\n * A thin pointer to the OC Attest builder. The portable, self-sovereign\n * form of identity linking is a standard OrangeCheck attestation — one\n * BIP-322 signature by the Bitcoin address binding it to its handles,\n * published to Nostr. That ceremony already lives at\n * `attest.ochk.io/create` (which pre-fills the address from the signed-in\n * session); this panel routes the user there rather than re-implementing\n * it. Shown once the account has a linked Bitcoin address to attest with.\n */\nfunction AttestationLink(): React.ReactElement {\n return (\n <div style={panelStyle()} data-oc-li-attest=\"\">\n <SectionLabel>§ portable attestation</SectionLabel>\n <p style={bodyStyle}>\n Make your identity links portable: publish a standard OrangeCheck\n attestation — one Bitcoin-wallet signature (BIP-322) binding your address\n to your handles (Nostr, GitHub, …). It is published to Nostr and verifies\n with zero trust in OrangeCheck, so it outlives any single service.\n </p>\n <a\n href=\"https://attest.ochk.io/create\"\n target=\"_blank\"\n rel=\"noreferrer\"\n style={{ ...primaryChipStyle, textDecoration: 'none', display: 'inline-block' }}\n data-oc-li-attest-link=\"\"\n >\n open the attestation builder ↗\n </a>\n </div>\n );\n}\n\n/* --- post-sign-in link prompt (used by OcSignIn) --- */\n\n/** Where the ways to sign in are managed: ochk.app, which replaces me.ochk.io's pages. */\nconst ACCOUNT_WAYS_URL = 'https://ochk.app/me/account#ways';\n\n/**\n * Shown by `<OcSignIn>` after a successful sign-in *when the user ticked\n * the \"also link my other identity\" checkbox on the sign-in form*. It runs\n * the complementary identity's link ceremony inline — BIP-322 for a\n * Bitcoin address, OTP for an email.\n *\n * Skipping is first-class: even though the user opted in at the form, they\n * may change their mind here — an explicit \"skip, I'll do this later\"\n * control exits cleanly and tells them where to link later. `onResolved`\n * (linked, or skipped) hands control back to OcSignIn's post-sign-in\n * navigation.\n */\nexport function LinkPromptStep({\n method,\n didOc,\n authOrigin,\n onResolved,\n}: {\n /** The complementary identity to link — the opposite of the sign-in method. */\n method: 'btc' | 'email';\n didOc: string;\n authOrigin: string;\n /** Called once the user has linked the identity, or skipped. */\n onResolved: () => void;\n}): React.ReactElement {\n const what = method === 'btc' ? 'a Bitcoin address' : 'an email';\n return (\n <div data-oc-linkprompt={method}>\n <div style={{ ...panelStyle('success'), marginBottom: 16 }}>\n <SectionLabel tone=\"success\">§ signed in</SectionLabel>\n <p style={{ ...bodyStyle, margin: 0 }}>\n You chose to also link {what}. Complete it below — or skip for now; it is\n entirely optional and changes nothing about the sign-in you just completed.\n </p>\n </div>\n {method === 'btc' ? (\n <BtcLinkForm\n authOrigin={authOrigin}\n didOc={didOc}\n onDone={onResolved}\n onCancel={onResolved}\n />\n ) : (\n <EmailLinkForm authOrigin={authOrigin} onDone={onResolved} onCancel={onResolved} />\n )}\n <div\n data-oc-linkprompt-skip=\"\"\n style={{ marginTop: 14, paddingTop: 14, borderTop: `1px solid ${V.border}` }}\n >\n <button type=\"button\" onClick={onResolved} style={ghostBtnStyle(false)}>\n skip — I&apos;ll do this later\n </button>\n <p style={{ ...hintStyle, marginTop: 8 }}>\n Changed your mind? Skipping continues you straight on — your sign-in is\n unaffected. You can link {what} anytime later from your account page,{' '}\n <a\n href={ACCOUNT_WAYS_URL}\n target=\"_blank\"\n rel=\"noreferrer\"\n style={{ color: 'inherit' }}\n data-oc-linkprompt-account=\"\"\n >\n ochk.app/me/account\n </a>\n .\n </p>\n </div>\n </div>\n );\n}\n\n/* --- email link form --- */\n\nfunction EmailLinkForm({\n authOrigin,\n onDone,\n onCancel,\n}: {\n authOrigin: string;\n onDone: () => void;\n onCancel: () => void;\n}): React.ReactElement {\n const [step, setStep] = React.useState<'email' | 'code'>('email');\n const [email, setEmail] = React.useState('');\n const [code, setCode] = React.useState('');\n const [token, setToken] = React.useState('');\n const [busy, setBusy] = React.useState(false);\n const [err, setErr] = React.useState<string | null>(null);\n // Set when the auth host reports the email is linked elsewhere — the\n // user can confirm a dual-proof transfer (session + verified OTP).\n const [transfer, setTransfer] = React.useState(false);\n // The answer spent the code, so moving it here takes a new one.\n const [moving, setMoving] = React.useState(false);\n\n async function start(): Promise<void> {\n setBusy(true);\n setErr(null);\n try {\n const r = await fetch(`${authOrigin}/api/auth/email-otp/start`, {\n method: 'POST',\n credentials: 'include',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ email: normalizeEmail(email) }),\n });\n const j = (await r.json()) as {\n ok?: boolean;\n token?: string;\n reason?: string;\n retry_at?: unknown;\n };\n if (!r.ok || !j.token) {\n const reason = j.reason ?? `http_${r.status}`;\n throw new Error(capText(reason, j.retry_at, 'link a Bitcoin wallet instead') ?? reason);\n }\n setToken(j.token);\n setStep('code');\n } catch (e) {\n setErr(failureMessage(e, 'email', 'challenge', authOrigin));\n } finally {\n setBusy(false);\n }\n }\n\n async function verify(confirmTransfer: boolean): Promise<void> {\n setBusy(true);\n setErr(null);\n try {\n const r = await fetch(`${authOrigin}/api/auth/link/email`, {\n method: 'POST',\n credentials: 'include',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n email: normalizeEmail(email),\n code: code.trim(),\n token,\n ...(confirmTransfer ? { confirm_transfer: true } : {}),\n }),\n });\n const j = (await r.json()) as { ok?: boolean; reason?: string; retry_at?: unknown };\n if (r.status === 409 && j.reason === 'email_linked_elsewhere') {\n setTransfer(true);\n setBusy(false);\n return;\n }\n if (handleSudoRequired(j, { purpose: 'link an email' })) return;\n if (isSudoAccountMismatch(j)) {\n setErr(SUDO_ACCOUNT_MISMATCH_MESSAGE);\n setBusy(false);\n return;\n }\n if (!r.ok || !j.ok) {\n const reason = j.reason ?? `http_${r.status}`;\n throw new Error(capText(reason, j.retry_at, 'link a Bitcoin wallet instead') ?? reason);\n }\n onDone();\n } catch (e) {\n setErr(failureMessage(e, 'email', 'submit', authOrigin));\n setBusy(false);\n }\n }\n\n return (\n <div style={panelStyle('accent')} data-oc-li-form=\"email\">\n <SectionLabel>§ link an email</SectionLabel>\n {step === 'email' ? (\n <>\n <input\n data-oca-field=\"\"\n type=\"email\"\n autoComplete=\"email\"\n value={email}\n onChange={(e) => setEmail(e.target.value)}\n placeholder=\"you@example.com\"\n style={inputStyle}\n />\n {err && <ErrorLine>{err}</ErrorLine>}\n <FormButtons>\n <button\n type=\"button\"\n onClick={() => void start()}\n disabled={busy || email.trim().length < 5}\n style={primaryBtnStyle(busy || email.trim().length < 5)}\n >\n {busy ? 'sending…' : 'send code'}\n </button>\n <button type=\"button\" onClick={onCancel} style={ghostBtnStyle(busy)}>\n cancel\n </button>\n </FormButtons>\n </>\n ) : transfer ? (\n <TransferConfirm\n what=\"email\"\n next=\"we send one more code to it\"\n busy={busy}\n onConfirm={() => {\n setTransfer(false);\n setMoving(true);\n setCode('');\n void start();\n }}\n onCancel={onCancel}\n err={err}\n />\n ) : (\n <>\n <p style={bodyStyle}>\n {moving\n ? `Enter the new 6-digit code sent to ${email} to move it here.`\n : `Enter the 6-digit code sent to ${email}.`}\n </p>\n <input\n data-oca-field=\"\"\n type=\"text\"\n inputMode=\"numeric\"\n autoComplete=\"one-time-code\"\n maxLength={6}\n value={code}\n onChange={(e) => setCode(e.target.value.replace(/\\D/g, '').slice(0, 6))}\n placeholder=\"123456\"\n style={{ ...inputStyle, letterSpacing: '0.3em' }}\n />\n {err && <ErrorLine>{err}</ErrorLine>}\n <FormButtons>\n <button\n type=\"button\"\n onClick={() => void verify(moving)}\n disabled={busy || code.length !== 6}\n style={primaryBtnStyle(busy || code.length !== 6)}\n >\n {busy ? 'linking…' : moving ? 'verify + transfer' : 'verify + link'}\n </button>\n <button\n type=\"button\"\n onClick={() => {\n setStep('email');\n setMoving(false);\n }}\n disabled={busy}\n style={ghostBtnStyle(busy)}\n >\n back\n </button>\n </FormButtons>\n </>\n )}\n </div>\n );\n}\n\n/* --- btc link form --- */\n\nfunction BtcLinkForm({\n authOrigin,\n didOc,\n onDone,\n onCancel,\n}: {\n authOrigin: string;\n didOc: string | null;\n onDone: () => void;\n onCancel: () => void;\n}): React.ReactElement {\n const [step, setStep] = React.useState<'request' | 'sign'>('request');\n const [addr, setAddr] = React.useState('');\n const [challenge, setChallenge] = React.useState('');\n const [busy, setBusy] = React.useState(false);\n const [err, setErr] = React.useState<string | null>(null);\n // Set when the address is already linked to another account.\n const [elsewhere, setElsewhere] = React.useState(false);\n // Every answer spends the message, so moving it here signs a new one.\n const [moving, setMoving] = React.useState(false);\n\n async function getChallenge(keepErr = false): Promise<void> {\n if (!didOc) {\n setErr('session not loaded yet · refresh and retry');\n return;\n }\n setBusy(true);\n if (!keepErr) setErr(null);\n try {\n // /api/challenge is a public primitive — no session needed.\n // audience MUST be the caller's did_oc: the link endpoint\n // verifies expectedAudience=session.did_oc, so a signature\n // obtained here can't be replayed against another account.\n const r = await fetch(\n `${authOrigin}/api/challenge?addr=${encodeURIComponent(addr)}` +\n `&purpose=link&audience=${encodeURIComponent(didOc)}`\n );\n const j = (await r.json()) as {\n message?: string;\n reason?: string;\n error?: string;\n retry_at?: unknown;\n };\n if (!r.ok || !j.message) {\n const reason = j.reason ?? j.error ?? `http_${r.status}`;\n throw new Error(capText(reason, j.retry_at, 'link an email instead') ?? reason);\n }\n setChallenge(j.message);\n setStep('sign');\n } catch (e) {\n setErr(failureMessage(e, 'wallet', 'challenge', authOrigin));\n } finally {\n setBusy(false);\n }\n }\n\n async function postLink(sig: string, confirmTransfer: boolean): Promise<void> {\n setBusy(true);\n setErr(null);\n let answered = false;\n try {\n const r = await fetch(`${authOrigin}/api/auth/link/btc`, {\n method: 'POST',\n credentials: 'include',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n message: challenge,\n signature: sig,\n ...(confirmTransfer ? { confirm_transfer: true } : {}),\n }),\n });\n const j = (await r.json()) as { ok?: boolean; reason?: string };\n if (r.status === 409 && j.reason === 'address_linked_elsewhere') {\n setElsewhere(true);\n setBusy(false);\n return;\n }\n if (handleSudoRequired(j, { purpose: 'link a Bitcoin address' })) return;\n if (isSudoAccountMismatch(j)) {\n setErr(SUDO_ACCOUNT_MISMATCH_MESSAGE);\n setBusy(false);\n return;\n }\n if (!r.ok || !j.ok) {\n answered = true;\n throw new Error(j.reason ?? `http_${r.status}`);\n }\n onDone();\n } catch (e) {\n setErr(failureMessage(e, 'wallet', 'submit', authOrigin));\n setBusy(false);\n // The refusal spent the message; the next signature needs a new one.\n if (answered) await getChallenge(true);\n }\n }\n\n return (\n <div style={panelStyle('accent')} data-oc-li-form=\"btc\">\n <SectionLabel>§ link a Bitcoin address</SectionLabel>\n {step === 'request' ? (\n <>\n <p style={bodyStyle}>\n Enter a Bitcoin address you control. We generate a challenge and your\n wallet signs it (BIP-322).\n </p>\n <input\n data-oca-field=\"\"\n type=\"text\"\n value={addr}\n onChange={(e) => setAddr(addressInputValue(e.target.value.trim()))}\n placeholder=\"bc1q…\"\n autoCapitalize=\"none\"\n spellCheck={false}\n style={{ ...inputStyle, fontFamily: SIGNIN_FONT }}\n />\n {err && <ErrorLine>{err}</ErrorLine>}\n <FormButtons>\n <button\n type=\"button\"\n onClick={() => void getChallenge()}\n disabled={busy || addr.length < 14}\n style={primaryBtnStyle(busy || addr.length < 14)}\n >\n {busy ? 'requesting…' : 'get challenge'}\n </button>\n <button type=\"button\" onClick={onCancel} style={ghostBtnStyle(busy)}>\n cancel\n </button>\n </FormButtons>\n </>\n ) : elsewhere ? (\n <TransferConfirm\n what=\"bitcoin address\"\n next=\"you sign one more message with it\"\n busy={busy}\n onConfirm={() => {\n setElsewhere(false);\n setMoving(true);\n void getChallenge();\n }}\n onCancel={onCancel}\n err={err}\n />\n ) : (\n <>\n <p style={bodyStyle}>\n {moving\n ? 'Sign one more message with the wallet that controls '\n : 'Sign the challenge with the wallet that controls '}\n <span style={{ fontFamily: SIGNIN_FONT, wordBreak: 'break-all' }}>{addr}</span>\n {moving ? ' to move it here.' : '.'}\n </p>\n <LazyWalletButton\n address={addr}\n message={challenge}\n showManual\n layout=\"list\"\n heading={null}\n onSigned={(sig: string) => void postLink(sig, moving)}\n onError={(e: { message?: string }) =>\n setErr(e?.message ?? 'wallet rejected')\n }\n />\n {err && <ErrorLine>{err}</ErrorLine>}\n <FormButtons>\n <button\n type=\"button\"\n onClick={() => {\n setStep('request');\n setErr(null);\n setMoving(false);\n }}\n disabled={busy}\n style={ghostBtnStyle(busy)}\n >\n back\n </button>\n </FormButtons>\n </>\n )}\n </div>\n );\n}\n\n/* --- transfer-under-dual-proof confirm --- */\n\nfunction TransferConfirm({\n what,\n next,\n busy,\n onConfirm,\n onCancel,\n err,\n}: {\n what: string;\n /** The one more proof a move takes: ochk.io spent the first one answering. */\n next: string;\n busy: boolean;\n onConfirm: () => void;\n onCancel: () => void;\n err: string | null;\n}): React.ReactElement {\n return (\n <>\n <p style={bodyStyle}>\n This {what} is already linked to another OrangeCheck account. You can transfer the\n link to this account under dual proof of control: {next}. The other account loses\n this sign-in path; its history stays verifiable. Continue?\n </p>\n {err && <ErrorLine>{err}</ErrorLine>}\n <FormButtons>\n <button\n type=\"button\"\n onClick={onConfirm}\n disabled={busy}\n style={dangerBtnStyle(busy)}\n >\n {busy ? 'transferring…' : 'transfer link here'}\n </button>\n <button type=\"button\" onClick={onCancel} disabled={busy} style={ghostBtnStyle(busy)}>\n cancel\n </button>\n </FormButtons>\n </>\n );\n}\n\n/* --- lazy wallet button · wallet-adapter loads on demand, not with the page --- */\n\ninterface WalletButtonProps {\n address: string;\n message: string;\n showManual?: boolean;\n layout?: string;\n heading?: React.ReactNode;\n onSigned: (sig: string) => void;\n onError: (err: { message?: string }, walletId?: string) => void;\n}\n\nexport function LazyWalletButton(props: WalletButtonProps): React.ReactElement {\n const [Comp, setComp] = React.useState<React.ComponentType<WalletButtonProps> | null>(null);\n const [failed, setFailed] = React.useState(false);\n\n React.useEffect(() => {\n let alive = true;\n // A bundler resolves this specifier at build time, so wallet-adapter\n // is a real dependency; only the chunk is deferred.\n import('@orangecheck/wallet-adapter/react')\n .then((m) => {\n if (alive) {\n setComp(\n () => (m as { OcWalletButton: React.ComponentType<WalletButtonProps> })\n .OcWalletButton\n );\n }\n })\n .catch(() => {\n if (alive) setFailed(true);\n });\n return () => {\n alive = false;\n };\n }, []);\n\n if (failed) {\n return (\n <ErrorLine>\n could not load wallet support · refresh to try again\n </ErrorLine>\n );\n }\n if (!Comp) return <span style={hintStyle}>loading wallet options…</span>;\n // A new message is a new signing: nothing typed or chosen for the last one carries over.\n return <Comp key={props.message} {...props} />;\n}\n\n/* --- helpers --- */\n\nfunction mask(value: string, kind: 'email' | 'btc'): string {\n if (kind === 'email') {\n const [user, host] = value.split('@');\n if (!user || !host) return '••••';\n const m =\n user.length <= 2\n ? '•'.repeat(user.length)\n : user[0] + '•'.repeat(user.length - 2) + user.slice(-1);\n return `${m}@${host}`;\n }\n if (value.length <= 12) return '•'.repeat(value.length);\n return `${value.slice(0, 6)}…${value.slice(-4)}`;\n}\n\n/* --- presentational atoms · also used by bond.tsx; not re-exported from index --- */\n\nexport function SectionLabel({\n children,\n tone = 'primary',\n}: {\n children: React.ReactNode;\n tone?: 'primary' | 'success' | 'warn';\n}): React.ReactElement {\n const color = tone === 'success' ? V.success : tone === 'warn' ? V.warn : V.primary;\n return (\n <div\n style={{\n color,\n fontFamily: SIGNIN_FONT,\n fontSize: signinSize(10),\n letterSpacing: signinTracking('0.18em'),\n textTransform: SIGNIN_CASE,\n marginBottom: 8,\n }}\n >\n {children}\n </div>\n );\n}\n\nexport function ErrorLine({ children }: { children: React.ReactNode }): React.ReactElement {\n return (\n <p\n role=\"alert\"\n style={{\n margin: '8px 0 0',\n color: V.destructive,\n fontFamily: SIGNIN_FONT,\n fontSize: signinSize(11),\n }}\n >\n {children}\n </p>\n );\n}\n\nexport function FormButtons({ children }: { children: React.ReactNode }): React.ReactElement {\n return (\n <div style={{ display: 'flex', flexWrap: 'wrap', gap: 8, marginTop: 12 }}>{children}</div>\n );\n}\n\n/* --- style tokens (CSS-variable-themed, same approach as OcSignIn) --- */\n\n\nexport const V = {\n primary: 'var(--primary, #f97316)',\n foreground: 'var(--foreground, #fafafa)',\n muted: 'var(--muted-foreground, #a1a1aa)',\n background: 'var(--background, #0a0a0a)',\n card: 'var(--card, #111113)',\n border: 'var(--border, #27272a)',\n destructive: 'var(--destructive, #ef4444)',\n success: 'var(--success, #22c55e)',\n warn: 'var(--warning, #eab308)',\n} as const;\n\nexport function panelStyle(tone: 'plain' | 'accent' | 'success' | 'warn' | 'default' = 'default'): React.CSSProperties {\n const base: React.CSSProperties = {\n background: V.card,\n border: `1px solid ${V.border}`,\n padding: '1.25rem',\n };\n if (tone === 'plain') return { ...base, padding: 0 };\n if (tone === 'accent') return { ...base, borderColor: V.primary, background: 'var(--card, #111113)' };\n if (tone === 'success') return { ...base, borderColor: V.success };\n if (tone === 'warn') return { ...base, borderColor: V.warn };\n return base;\n}\n\nexport const bodyStyle: React.CSSProperties = {\n color: V.muted,\n fontSize: 13,\n lineHeight: 1.55,\n margin: '0 0 12px',\n};\n\nexport const hintStyle: React.CSSProperties = {\n color: V.muted,\n fontFamily: SIGNIN_FONT,\n fontSize: signinSize(10.5),\n opacity: 0.8,\n};\n\nconst rowStyle: React.CSSProperties = {\n display: 'flex',\n flexWrap: 'wrap',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: 12,\n padding: '1rem',\n};\n\nconst rowLabelStyle: React.CSSProperties = {\n color: V.foreground,\n fontFamily: SIGNIN_FONT,\n fontSize: signinSize(10.5),\n letterSpacing: signinTracking('0.12em'),\n textTransform: SIGNIN_CASE,\n opacity: 0.8,\n};\n\nexport const inputStyle: React.CSSProperties = {\n width: '100%',\n padding: '0.55rem 0.75rem',\n background: V.background,\n color: V.foreground,\n border: `1px solid ${V.border}`,\n borderRadius: signinRadius(6),\n fontFamily: SIGNIN_FONT,\n // 16px — never lower · suppresses iOS Safari focus auto-zoom.\n fontSize: 16,\n boxSizing: 'border-box',\n};\n\nfunction btnBase(disabled: boolean): React.CSSProperties {\n return {\n padding: '0.5rem 0.875rem',\n borderRadius: SIGNIN_BUTTON_RADIUS,\n fontFamily: SIGNIN_FONT,\n fontSize: signinSize(10.5),\n letterSpacing: signinTracking('0.12em'),\n textTransform: SIGNIN_CASE,\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.5 : 1,\n };\n}\n\nexport function primaryBtnStyle(disabled: boolean): React.CSSProperties {\n return {\n ...btnBase(disabled),\n background: V.primary,\n color: 'var(--primary-foreground, #0a0a0a)',\n border: `1px solid ${V.primary}`,\n fontWeight: 600,\n };\n}\n\nexport function ghostBtnStyle(disabled: boolean): React.CSSProperties {\n return {\n ...btnBase(disabled),\n background: V.background,\n color: V.foreground,\n border: `1px solid ${V.border}`,\n };\n}\n\nexport function dangerBtnStyle(disabled: boolean): React.CSSProperties {\n return {\n ...btnBase(disabled),\n background: 'transparent',\n color: V.destructive,\n border: `1px solid ${V.destructive}`,\n };\n}\n\nconst primaryChipStyle: React.CSSProperties = {\n ...btnBase(false),\n background: 'transparent',\n color: V.primary,\n border: `1px solid ${V.primary}`,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,SAAS,sBAAsB;AAC/B,YAAY,WAAW;AA4IP,SA4HR,UA5HQ,KACA,YADA;AAxHhB,IAAM,sBAAsB;AAsC5B,eAAsB,wBAAwB,MAEd;AAC5B,QAAM,aAAa,MAAM,cAAc;AAMvC,QAAM,IAAI,MAAM,MAAM,GAAG,UAAU,wBAAwB;AAAA,IACvD,aAAa;AAAA,IACb,SAAS,EAAE,GAAG,iBAAiB,EAAE;AAAA,EACrC,CAAC;AACD,MAAI,EAAE,WAAW,IAAK,QAAO,CAAC;AAC9B,MAAI,CAAC,EAAE,GAAI,OAAM,IAAI,MAAM,iCAAiC,EAAE,MAAM,EAAE;AACtE,QAAM,OAAQ,MAAM,EAAE,KAAK;AAC3B,SAAO,KAAK,UAAU,CAAC;AAC3B;AAoBO,SAAS,mBAAmB;AAAA,EAC/B,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA,kBAAkB;AACtB,GAAgD;AAC5C,QAAM,CAAC,MAAM,OAAO,IAAU,eAAgC,IAAI;AAClE,QAAM,CAAC,OAAO,QAAQ,IAAU,eAAwB,IAAI;AAC5D,QAAM,CAAC,eAAe,gBAAgB,IAAU,eAAS,KAAK;AAC9D,QAAM,CAAC,aAAa,cAAc,IAAU,eAAS,KAAK;AAE1D,QAAM,UAAgB,kBAAY,YAAY;AAC1C,aAAS,IAAI;AACb,QAAI;AACA,YAAM,IAAI,MAAM,MAAM,GAAG,UAAU,wBAAwB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k-KL4QKCE3.mjs";
7
7
  import {
8
+ endedSigninText,
8
9
  failureMessage,
9
10
  humanSigninError,
10
11
  networkError
11
- } from "./chunk-4HJ2ZTAC.mjs";
12
+ } from "./chunk-KD4XTVFV.mjs";
12
13
  import {
13
14
  addressInputValue
14
15
  } from "./chunk-U7IUGDLW.mjs";
@@ -90,6 +91,8 @@ var OAUTH_PROVIDER_NAMES = /* @__PURE__ */ new Map([
90
91
  function oauthErrorText(reason, retryAt, provider) {
91
92
  const cap = capText(reason, retryAt);
92
93
  if (cap) return cap;
94
+ const ended = endedSigninText(reason);
95
+ if (ended) return ended;
93
96
  if (reason === "email_code_required") {
94
97
  return "This email already has an orangecheck account. Sign in to it with an email code below.";
95
98
  }
@@ -1271,4 +1274,4 @@ export {
1271
1274
  looksLikeBitcoinAddress,
1272
1275
  OcSignIn
1273
1276
  };
1274
- //# sourceMappingURL=chunk-W22LIBTI.mjs.map
1277
+ //# sourceMappingURL=chunk-MEN6WL3W.mjs.map