{
  "version": 3,
  "sources": ["auth.js"],
  "sourcesContent": ["// ─────────────────────────────────────────────────────────────────────────\n// Shared client-side auth helpers, used by every page in /account/.\n// Loads the Supabase JS client from a CDN (no build step) and exposes a few\n// small helpers so each page stays tiny.\n// ─────────────────────────────────────────────────────────────────────────\n// Vendored, same-origin, pinned. This was `https://esm.sh/@supabase/supabase-js@2`\n// — a third-party CDN in the critical path of every authenticated page, and five\n// chained requests deep, because the esm.sh entry imports four more modules. Any\n// one of them stalling meant the module graph never resolved, so the top-level\n// `await getUser()` below never ran and the page stayed blank with no error and\n// no timeout. See vendor/supabase-js-2.112.0.js (versioned name, cached immutable).\nimport { createClient } from \"/vendor/supabase-js-2.112.0.js\";\nimport { SUPABASE_URL, SUPABASE_ANON_KEY } from \"./config.js\";\nimport { safeNext } from \"./safe-next.js\";\nexport { safeNext };\n// Side-effect: enhances the account header into a hamburger menu on mobile.\n// Loaded here because every /account/ page imports this module. Self-guards to\n// no-op where there's no .account-subnav (login/signup/report pages).\nimport \"./account-nav.js\";\nimport { clearDataCache } from \"./datacache.js\";\n\n// Embedded-viewer mode: /account/<viewer>/?embed=1 strips the page chrome so the\n// viewer can be iframed inside the crawl page's deliverable directory.\ntry { if (new URLSearchParams(location.search).get(\"embed\") === \"1\") document.documentElement.classList.add(\"rl-embed\"); } catch { /* no location (tests) */ }\n\n// Inside a company's resource hub (manage mode), the Foundation, the questions and the report are framed at /hub-view/…\n// (functions/hub-view). There they never touch the account's sign-in: they read with the hub pass handed over in the\n// #fragment (functions/api/_hub-view.js), kept for this frame only, and they only read.\nexport const HUB_VIEW = (() => { try { return location.pathname.startsWith(\"/hub-view/\"); } catch { return false; } })();\nlet HUB_PASS = null;\nif (HUB_VIEW) {\n  const m = /[#&]pass=([\\w.-]+)/.exec(location.hash);\n  if (m) {\n    HUB_PASS = m[1];\n    try { sessionStorage.setItem(\"rl_hub_view_pass\", HUB_PASS); } catch { /* the frame's own copy is enough */ }\n    const rest = location.hash.replace(/[#&]pass=[\\w.-]+/, \"\").replace(/^&/, \"#\");\n    history.replaceState(null, \"\", location.pathname + location.search + (rest === \"#\" ? \"\" : rest));\n  } else { try { HUB_PASS = sessionStorage.getItem(\"rl_hub_view_pass\"); } catch { HUB_PASS = null; } }\n}\n// The person the pass names (its payload; the server checks the signature and their access on every read).\nfunction passUser() {\n  try {\n    const d = JSON.parse(atob(HUB_PASS.split(\".\")[0].replace(/-/g, \"+\").replace(/_/g, \"/\")));\n    if (!d.u || !d.x || d.x * 1000 <= Date.now()) return null;\n    return { id: d.u, email: d.e || \"\", user_metadata: { full_name: d.n || \"\" }, hub_view: true };\n  } catch { return null; }\n}\n\n// flowType:\"pkce\" + detectSessionInUrl is the supported browser OAuth flow: the\n// code_verifier is stashed in localStorage when signInWithGoogle() runs and the\n// returned ?code= is exchanged for a session on the landing page. Left implicit,\n// some supabase-js builds don't auto-exchange the code → the user lands on\n// /account/ with no session and bounces back to login.\nexport const supabase = createClient(SUPABASE_URL, SUPABASE_ANON_KEY, {\n  // Framed in a hub: a client with nothing in it, so the account's stored session is never read or sent.\n  auth: HUB_VIEW ? { persistSession: false, autoRefreshToken: false, detectSessionInUrl: false, storage: { getItem: () => null, setItem() {}, removeItem() {} } } : {\n    flowType: \"pkce\",\n    detectSessionInUrl: true,\n    persistSession: true,\n    autoRefreshToken: true,\n  },\n});\n\n// Read an OAuth error returned in the URL (query string or hash), or null.\n// Lets the landing/login page show *why* a Google sign-in failed instead of\n// silently bouncing.\nexport function authRedirectError() {\n  const fromHash = new URLSearchParams(location.hash.replace(/^#/, \"\"));\n  const fromQuery = new URLSearchParams(location.search);\n  const err = fromQuery.get(\"error\") || fromHash.get(\"error\");\n  if (!err) return null;\n  return fromQuery.get(\"error_description\") || fromHash.get(\"error_description\") || err;\n}\n\n// Resolve the current user (or null). Awaits the initial session restore.\n//\n// Bounded, because this call is the gate on every page: it hits /auth/v1/user\n// over the network and, when the access token has expired, refreshes it first.\n// Every /account/ page does `const user = await getUser()` at module top level,\n// so if it never settles, nothing after it runs — not the render, not even the\n// redirect to /account/login/. The page just sits blank. A hang here has to end\n// in an ANSWER, and \"we couldn't confirm your sign-in\" is an answer; waiting\n// forever is not.\n//\n// Timing out resolves to null, which every caller already handles as \"not signed\n// in\" — they send the reader to the login page, which is the right place to be\n// when we can't confirm a session. Worst case for a signed-in user is one extra\n// sign-in; the alternative is a dead page.\nexport const AUTH_TIMEOUT_MS = 12000;\n\n/* …and it answers from the SESSION, not from the network.\n *\n * This used to call supabase.auth.getUser(), which round-trips to /auth/v1/user\n * to have the server validate the JWT. Every /account/ page awaits this at module\n * top level, so that hop sat in front of every page's first data request —\n * nothing else could even start until it came back. On a phone that is the\n * difference between a page that opens and a page you wait for.\n *\n * getSession() reads the session the client already holds and returns the user\n * the JWT carries. It is not a weaker check for what it is used for: this gate\n * decides what to PAINT, and every request the page then makes carries the token\n * to a server that verifies it independently (verifyUser in functions/api/\n * _shared.js). A forged local session buys nothing — the API answers 401.\n *\n * Nor is it stale in the way it sounds. getSession() refreshes an expired access\n * token before returning, and a refresh the server rejects yields NO session — so\n * a revoked or expired sign-in still resolves to null here, as before, within the\n * access token's lifetime. The one case it cannot see is an account revoked\n * server-side while an unexpired token is still in hand, and revalidate() below\n * closes that after first paint rather than in front of it.\n */\nexport async function getUser({ timeoutMs = AUTH_TIMEOUT_MS } = {}) {\n  if (HUB_VIEW) return HUB_PASS ? passUser() : null;\n  let timer;\n  const timeout = new Promise((resolve) => {\n    timer = setTimeout(() => {\n      console.warn(`[auth] getUser() exceeded ${timeoutMs}ms — treating as signed out`);\n      resolve(null);\n    }, timeoutMs);\n  });\n  try {\n    const session = await Promise.race([\n      supabase.auth.getSession().then(({ data }) => data?.session ?? null)\n        .catch((e) => { console.warn(\"[auth] getSession() failed:\", e?.message); return null; }),\n      timeout,\n    ]);\n    if (!session?.user) return null;\n    revalidate();          // after we return, never in front of it\n    teamPass(session);\n    return session.user;\n  } finally {\n    clearTimeout(timer);\n  }\n}\n\n/* Confirm with the server, once per page, without anyone waiting for it.\n *\n * The gap getSession() leaves is narrow — an account disabled or deleted while an\n * unexpired access token is still in the browser — but the failure it produces is\n * ugly: a page that paints normally and then 401s on everything it asks for.\n *\n * Deliberately narrow about what counts as \"signed out\". Only an explicit\n * rejection from the auth server does; a network failure, a timeout, an offline\n * phone must NOT throw someone out of a page that is working. That distinction is\n * the whole reason this is a status check and not a truthiness check on `user`.\n */\nlet _revalidated = false;\nfunction revalidate() {\n  if (_revalidated) return;\n  _revalidated = true;\n  // Being signed out is the normal state on these pages; bouncing to login from\n  // login is a loop with nothing at the end of it.\n  if (/^\\/account\\/(login|reset)\\//.test(location.pathname)) return;\n\n  supabase.auth.getUser().then(async ({ data, error }) => {\n    const rejected = error && (error.status === 401 || error.status === 403);\n    if (!rejected && data?.user) return;                   // confirmed, or unreachable\n    if (!rejected) return;                                 // network trouble — leave them be\n    console.warn(\"[auth] session rejected by the server — signing out\");\n    // Drop the local session first. Without this every subsequent page repeats\n    // the same optimistic paint before landing back here. The login page checks\n    // the server itself, so it will show the form rather than bounce.\n    try { await supabase.auth.signOut({ scope: \"local\" }); } catch { /* best effort */ }\n    try { clearDataCache(); } catch { /* best effort */ }\n    const url = new URL(location.href);\n    url.searchParams.delete(\"embed\");\n    const next = encodeURIComponent(url.pathname + url.search);\n    location.replace(`/account/login/?next=${next}`);\n  }).catch(() => { /* offline: the page keeps working on what it has */ });\n}\n\n// Redirect to login if there is no session. Returns the user when present.\n// `next` is preserved so we can bounce back after login.\nexport async function requireAuth() {\n  const user = await getUser();\n  if (!user && HUB_VIEW) {\n    // No sign-in screen inside someone's hub: the pass ran out, and the hub's Manage gets a fresh one.\n    document.body.innerHTML = '<p style=\"font:500 16px/1.5 system-ui,sans-serif;padding:40px;max-width:520px\">This view has timed out. Close it and open it again from the Manage bar.</p>';\n    return null;\n  }\n  if (!user) {\n    // Preserve the query string too (e.g. ?id=<audit>) — without it, an email\n    // link followed while logged out bounces back to a page missing its id.\n    const url = new URL(location.href);\n    url.searchParams.delete(\"embed\");   // never send someone back into a framed viewer\n    const next = encodeURIComponent(url.pathname + url.search);\n    // A viewer opened inside the crawl hub's overlay must send the WHOLE window\n    // to login — rendering the sign-in form inside a 900px frame is a dead end\n    // the reader can't escape.\n    try {\n      if (window.top !== window.self) { window.top.location.href = `/account/login/?next=${next}`; return null; }\n    } catch (_) { /* cross-origin top — fall through to the local redirect */ }\n    location.replace(`/account/login/?next=${next}`);\n    return null;\n  }\n  return user;\n}\n\n// The team pass (functions/api/_team-pass.js): a cookie on this domain that lets a page of ours on a client's store or\n// site show its Edit button to someone signed in here who may edit it. Renewed once a day while signed in (and when\n// the account changes), cleared on sign-out. Nothing here reads it: it's HttpOnly.\nconst PASS_KEY = \"rl_team_pass\";\nfunction teamPass(session) {\n  if (HUB_VIEW || !session?.access_token || !session.user?.id) return;\n  try {\n    const [uid, at] = String(localStorage.getItem(PASS_KEY) || \"\").split(\":\");\n    if (uid === session.user.id && Date.now() - Number(at || 0) < 864e5) return;\n    localStorage.setItem(PASS_KEY, `${session.user.id}:${Date.now()}`);\n  } catch { return; }\n  fetch(\"/api/site/team-pass\", { method: \"POST\", headers: { Authorization: `Bearer ${session.access_token}` } }).catch(() => {});\n}\nfunction dropTeamPass() {\n  try { localStorage.removeItem(PASS_KEY); } catch { /* nothing kept */ }\n  fetch(\"/api/site/team-pass\", { method: \"DELETE\", keepalive: true }).catch(() => {});\n}\nif (!HUB_VIEW) supabase.auth.onAuthStateChange((event) => { if (event === \"SIGNED_OUT\") dropTeamPass(); });\n\nexport async function signOut() {\n  dropTeamPass();\n  clearDataCache(); // drop this user's cached audits + view state before leaving\n  await supabase.auth.signOut();\n  location.href = \"/account/login/\";\n}\n\n// Start a Google OAuth sign-in / sign-up. Supabase redirects to Google and back\n// to `redirectTo`; the client's detectSessionInUrl (on by default) exchanges the\n// returned code there, so the landing page just needs to load this module (every\n// /account/ page does). `next` is the same-origin path to return to, validated by\n// safeNext (it must parse to this origin, SEC-17) so a crafted value can't\n// become an open redirect.\n// On success the browser navigates away (no return); only errors come back here.\nexport async function signInWithGoogle(next = \"/account/\") {\n  const safe = safeNext(next);\n  return supabase.auth.signInWithOAuth({\n    provider: \"google\",\n    options: { redirectTo: location.origin + safe },\n  });\n}\n\n// How long apiPost waits for an answer before giving up with an error, so a hung\n// request surfaces as a message the page already knows how to show instead of a\n// spinner that never ends. Deliberately generous: the operator board's heavy\n// actions share this default and pass no timeout of their own, and a slow but\n// working request must never be cut off. The server gives up long before this\n// on the reads a customer page makes (a database statement stops at 15s).\nexport const API_TIMEOUT_MS = 45000;\n\n// Call a Pages Function with the user's access token attached. Returns parsed\n// JSON. Throws on a non-2xx response with the server's error message.\n// `opts.keepalive` lets a fire-and-forget write survive page navigation (used by\n// the preferences flush on pagehide).\n// `opts.timeoutMs` overrides API_TIMEOUT_MS for a call that legitimately takes\n// longer (an upload); 0 turns the deadline off. A timeout throws an Error with\n// `code: \"timeout\"`, which every caller already handles as a failed request.\nexport async function apiPost(path, body = {}, opts = {}) {\n  /* The public showcase (/showcase/*) is a static fixture and must reach the\n     network for nothing at all. Its pages set their own data, but they also\n     load shared machinery — the account nav's inbox badge, the preferences\n     store, the plan's progress read, the foundation's VoC and notes fetches —\n     which fires regardless and, with no session, answers 401. That is four\n     pointless round trips and a console full of red on our own sample page.\n     Refusing here rather than at each call site is deliberate: this is the one\n     chokepoint every one of them goes through, and a new caller added later\n     is covered without anyone remembering to. Rejecting matches exactly what\n     those callers already handle (they all tolerate a 401 today), so the only\n     behaviour that changes is that no request leaves the browser. */\n  if (location.pathname.startsWith(\"/showcase\")) {\n    throw new Error(\"Sample data — not connected to an account.\");\n  }\n  const { data } = HUB_VIEW ? { data: null } : await supabase.auth.getSession();\n  const token = data?.session?.access_token;\n  // AbortController + setTimeout rather than AbortSignal.timeout(), which older\n  // Safari lacks. The deadline covers reading the body too.\n  const ms = opts.timeoutMs ?? API_TIMEOUT_MS;\n  const ctl = ms > 0 && typeof AbortController === \"function\" ? new AbortController() : null;\n  const timer = ctl ? setTimeout(() => ctl.abort(), ms) : null;\n  try {\n    const res = await fetch(path, {\n      method: \"POST\",\n      headers: {\n        \"Content-Type\": \"application/json\",\n        ...(token ? { Authorization: `Bearer ${token}` } : {}),\n        ...(HUB_VIEW && HUB_PASS ? { \"X-RL-Hub-Pass\": HUB_PASS } : {}),\n      },\n      body: JSON.stringify(body),\n      ...(opts.keepalive ? { keepalive: true } : {}),\n      ...(ctl ? { signal: ctl.signal } : {}),\n    });\n    let parsed = true;\n    const json = await res.json().catch(() => { parsed = false; return {}; });\n    // A body cut off by the deadline is a timeout, not an empty answer.\n    if (!parsed && ctl?.signal.aborted) throw new DOMException(\"Aborted\", \"AbortError\");\n    if (!res.ok) throw new Error(json.error || `Request failed (${res.status})`);\n    return json;\n  } catch (e) {\n    if (ctl?.signal.aborted && e?.name === \"AbortError\") {\n      const err = new Error(`The request took longer than ${Math.round(ms / 1000)} seconds. Please try again.`);\n      err.code = \"timeout\";\n      throw err;\n    }\n    throw e;\n  } finally {\n    if (timer) clearTimeout(timer);\n  }\n}\n\n// Add a \"show password\" reveal toggle to every password field on the page.\n// Wraps each input in a positioned container and drops an eye button on the\n// right that flips type=password ↔ text. Accessible (real <button>, aria-label,\n// aria-pressed) and idempotent — safe to call once on page load.\nconst EYE_SHOW =\n  '<svg viewBox=\"0 0 24 24\" width=\"18\" height=\"18\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M1 12s4-7 11-7 11 7 11 7-4 7-11 7-11-7-11-7Z\"/><circle cx=\"12\" cy=\"12\" r=\"3\"/></svg>';\nconst EYE_HIDE =\n  '<svg viewBox=\"0 0 24 24\" width=\"18\" height=\"18\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19M1 1l22 22\"/><path d=\"M9.9 9.9a3 3 0 0 0 4.2 4.2\"/></svg>';\n\nexport function attachPasswordToggles(scope = document) {\n  scope.querySelectorAll('input[type=\"password\"]').forEach((input) => {\n    if (input.dataset.toggleWired) return;\n    input.dataset.toggleWired = \"1\";\n\n    const wrap = document.createElement(\"div\");\n    wrap.className = \"field__pw\";\n    input.parentNode.insertBefore(wrap, input);\n    wrap.appendChild(input);\n\n    const btn = document.createElement(\"button\");\n    btn.type = \"button\";\n    btn.className = \"field__pw-toggle\";\n    btn.setAttribute(\"aria-label\", \"Show password\");\n    btn.setAttribute(\"aria-pressed\", \"false\");\n    btn.innerHTML = EYE_SHOW;\n    wrap.appendChild(btn);\n\n    btn.addEventListener(\"click\", () => {\n      const show = input.type === \"password\";\n      input.type = show ? \"text\" : \"password\";\n      btn.innerHTML = show ? EYE_HIDE : EYE_SHOW;\n      btn.setAttribute(\"aria-pressed\", String(show));\n      btn.setAttribute(\"aria-label\", show ? \"Hide password\" : \"Show password\");\n      input.focus();\n    });\n  });\n}\n\n// Small DOM helper for the status/error line on each form. Announces changes to\n// assistive tech: errors interrupt (assertive), everything else is polite.\nexport function setStatus(el, message, kind = \"info\") {\n  if (!el) return;\n  el.setAttribute(\"role\", \"status\");\n  el.setAttribute(\"aria-live\", kind === \"error\" ? \"assertive\" : \"polite\");\n  el.textContent = message || \"\";\n  el.dataset.kind = kind; // info | error | success — styled in account.css\n  el.hidden = !message;\n}\n"],
  "mappings": "AAWA,OAAS,gBAAAA,MAAoB,iCAC7B,OAAS,gBAAAC,EAAc,qBAAAC,MAAyB,cAChD,OAAS,YAAAC,MAAgB,iBACzB,OAASA,KAAA,UAIT,MAAO,mBACP,OAAS,kBAAAC,MAAsB,iBAI/B,GAAI,CAAM,IAAI,gBAAgB,SAAS,MAAM,EAAE,IAAI,OAAO,IAA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OAAO,EACxCA,EAAI,UAAYL,EAChBI,EAAK,YAAYC,CAAG,EAEpBA,EAAI,iBAAiB,QAAS,IAAM,CAClC,MAAMC,EAAOH,EAAM,OAAS,WAC5BA,EAAM,KAAOG,EAAO,OAAS,WAC7BD,EAAI,UAAYC,EAAOL,EAAWD,EAClCK,EAAI,aAAa,eAAgB,OAAOC,CAAI,CAAC,EAC7CD,EAAI,aAAa,aAAcC,EAAO,gBAAkB,eAAe,EACvEH,EAAM,MAAM,CACd,CAAC,CACH,CAAC,CACH,CAIO,gBAAS,UAAUI,EAAIC,EAASC,EAAO,OAAQ,CAC/CF,IACLA,EAAG,aAAa,OAAQ,QAAQ,EAChCA,EAAG,aAAa,YAAaE,IAAS,QAAU,YAAc,QAAQ,EACtEF,EAAG,YAAcC,GAAW,GAC5BD,EAAG,QAAQ,KAAOE,EAClBF,EAAG,OAAS,CAACC,EACf",
  "names": ["createClient", "SUPABASE_URL", "SUPABASE_ANON_KEY", "safeNext", "clearDataCache", "HUB_PASS", "m", "rest", "passUser", "d", "fromHash", "fromQuery", "err", "timeoutMs", "timer", "timeout", "resolve", "session", "data", "e", "revalidate", "teamPass", "_revalidated", "error", "rejected", "url", "next", "user", "PASS_KEY", "uid", "at", "dropTeamPass", "event", "safe", "path", "body", "opts", "token", "ms", "ctl", "res", "parsed", "json", "EYE_SHOW", "EYE_HIDE", "scope", "input", "wrap", "btn", "show", "el", "message", "kind"]
}
