@ciromaciel/auth-react 1.6.0 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/recent-accounts.js","../src/identitySwitch.js","../src/authSdk.js","../src/redirect.js","../src/authStore.js","../src/components/ImpersonationBanner.jsx","../src/AuthProvider.jsx","../src/Protect.jsx","../src/GuestOnly.jsx","../src/components/AuthCard.jsx","../src/components/RecentAccounts.jsx","../src/components/SocialButtons.jsx","../src/components/Wordmark.jsx","../src/terms.js","../src/components/SignIn.jsx","../src/session-display.js","../src/user-identity.js","../src/components/UserProfile.jsx","../src/components/UserInformation.jsx","../src/components/control/SignedIn.jsx","../src/components/control/SignedOut.jsx","../src/components/control/AuthLoading.jsx","../src/components/control/AuthLoaded.jsx","../src/components/unstyled/SignInButton.jsx","../src/components/unstyled/SignOutButton.jsx"],"sourcesContent":["/**\n * The accounts that already signed in on this browser.\n *\n * `<SignIn />` offers them before the empty email field: for a returning\n * person, choosing the account IS the click that sends the code. Nothing here\n * is a credential — a saved email still has to receive and type a fresh code —\n * so the list is a shortcut, never a session.\n *\n * WHAT IS KEPT, AND WHEN\n *\n * Email, the way in (`'code'` or a provider id such as `'google'`) and the time\n * of the last sign-in. No token, name or picture: that is everything needed to\n * draw a row, and the rest arrives with the session.\n *\n * An email enters only after a session exists — the code confirmed, or the\n * provider's token back in the fragment. Never on \"send code\": a typo there\n * would otherwise become a permanent suggestion.\n *\n * WHY IT SURVIVES SIGN-OUT AND IDENTITY SWITCHES\n *\n * The list exists precisely for the person who left and is coming back, so\n * signing out does not clear it; removing an account is an explicit action on\n * the screen. The key is in `KEEP` in `identitySwitch.js` for the same reason:\n * the list belongs to the browser, not to whichever account is signed in, and\n * holds no data of any account beyond its own email.\n *\n * `localStorage` is per origin, so each panel keeps its own list.\n */\n\nexport const RECENT_ACCOUNTS_KEY = 'auth:recent-accounts'\n\n// Five rows fit the 350px card with no scroll. The oldest drops out on its\n// own; signing in with it again puts it back on top.\nexport const MAX_RECENT_ACCOUNTS = 5\n\n// Which provider this tab left for. `sessionStorage` because the answer only\n// matters to the tab that comes back, and it expires so an abandoned consent\n// screen does not label a later, unrelated token.\nconst SOCIAL_DEPARTURE_KEY = 'auth:social-departure'\nconst SOCIAL_DEPARTURE_TTL_MS = 15 * 60 * 1000\n\nconst normalizeEmail = email =>\n String(email ?? '')\n .trim()\n .toLowerCase()\n\n/**\n * The saved accounts, most recent first. Never throws: a private window,\n * blocked storage or a hand-edited value all read as an empty list.\n *\n * @returns {{ email: string, method: string, lastUsedAt: number }[]}\n */\nexport function listRecentAccounts() {\n try {\n const raw = window.localStorage.getItem(RECENT_ACCOUNTS_KEY)\n if (!raw) return []\n\n const parsed = JSON.parse(raw)\n if (!Array.isArray(parsed)) return []\n\n return parsed\n .filter(account => account && typeof account.email === 'string' && account.email.includes('@'))\n .map(account => ({\n email: normalizeEmail(account.email),\n method: typeof account.method === 'string' && account.method ? account.method : 'code',\n lastUsedAt: Number(account.lastUsedAt) || 0,\n }))\n .sort((a, b) => b.lastUsedAt - a.lastUsedAt)\n .slice(0, MAX_RECENT_ACCOUNTS)\n } catch {\n return []\n }\n}\n\nfunction writeRecentAccounts(accounts) {\n try {\n window.localStorage.setItem(RECENT_ACCOUNTS_KEY, JSON.stringify(accounts))\n } catch {\n // No storage: the screen simply keeps asking for the email.\n }\n}\n\n/**\n * Puts the account on top of the list, creating it or refreshing it.\n *\n * @param {string} email\n * @param {string} [method='code'] - `'code'` or the provider id\n * @returns the list as it stands after the write\n */\nexport function rememberAccount(email, method = 'code') {\n const normalized = normalizeEmail(email)\n if (!normalized.includes('@')) return listRecentAccounts()\n\n const next = [{ email: normalized, method: method || 'code', lastUsedAt: Date.now() }, ...listRecentAccounts().filter(account => account.email !== normalized)].slice(0, MAX_RECENT_ACCOUNTS)\n\n writeRecentAccounts(next)\n return next\n}\n\n/**\n * Removes one account from this browser's list. The account itself, its\n * sessions and the lists of other panels are untouched.\n *\n * @returns the list as it stands after the removal\n */\nexport function forgetAccount(email) {\n const normalized = normalizeEmail(email)\n const next = listRecentAccounts().filter(account => account.email !== normalized)\n\n writeRecentAccounts(next)\n return next\n}\n\n/**\n * Replaces the local copy with the list the worker returned.\n *\n * The worker's list is the one every panel shares, so when it has accounts it\n * wins: an account removed on another panel must not come back from this\n * panel's stale copy. An EMPTY answer does not wipe the local one — it is what\n * a browser that signed in before the shared list existed gets, and those\n * shortcuts are still true.\n *\n * @returns the list to show\n */\nexport function adoptRecentAccounts(remote) {\n if (!Array.isArray(remote) || remote.length === 0) return listRecentAccounts()\n\n const next = remote\n .filter(account => account && typeof account.email === 'string' && account.email.includes('@'))\n .map(account => ({\n email: normalizeEmail(account.email),\n method: typeof account.method === 'string' && account.method ? account.method : 'code',\n lastUsedAt: Number(account.lastUsedAt) || 0,\n }))\n .sort((a, b) => b.lastUsedAt - a.lastUsedAt)\n .slice(0, MAX_RECENT_ACCOUNTS)\n\n writeRecentAccounts(next)\n return next\n}\n\n/** Records the provider this tab is leaving for. */\nexport function markSocialDeparture(provider) {\n try {\n window.sessionStorage.setItem(SOCIAL_DEPARTURE_KEY, JSON.stringify({ provider, at: Date.now() }))\n } catch {\n // No storage: the account is not remembered, and the sign-in still works.\n }\n}\n\n/**\n * Reads and clears the provider this tab left for, if it left recently.\n *\n * Read BEFORE an identity switch runs: the switch clears `sessionStorage`.\n */\nexport function takeSocialDeparture() {\n try {\n const raw = window.sessionStorage.getItem(SOCIAL_DEPARTURE_KEY)\n if (!raw) return null\n window.sessionStorage.removeItem(SOCIAL_DEPARTURE_KEY)\n\n const { provider, at } = JSON.parse(raw)\n if (typeof provider !== 'string' || !provider) return null\n if (!(Date.now() - Number(at) < SOCIAL_DEPARTURE_TTL_MS)) return null\n\n return provider\n } catch {\n return null\n }\n}\n","/**\n * The identity switch — when the panel stops being one person and becomes\n * another in the middle of a live session.\n *\n * It happens in both directions of an impersonation: entering (the response\n * carries a `Set-Cookie` that changes who the server sees in that instant) and\n * leaving (by the button, by the clock, or because another tab ended it). In\n * every case the panel stays mounted for a short interval until the navigation\n * — and during that interval the mounted screens refetch holding the old\n * identity.\n *\n * The server answers those calls with 403 and 401, and it is right to: they are\n * another person's resources, or a session that stopped being valid. What is\n * wrong is SHOWING it — on screen it read as \"Acesso negado: Sem permissão para\n * esta organização\" in the middle of a switch that was working.\n *\n * The flag lives on `window` because whoever sets it (the SDK) and whoever reads\n * it (each panel's HTTP client) do not share a module. It is never turned off:\n * the whole page is replaced right after, and `window` dies with it.\n *\n * Exported by the package so any panel can mark its own switches — the Auth\n * panel marks the START of an impersonation, a moment only it knows about.\n */\n\nimport { RECENT_ACCOUNTS_KEY } from './recent-accounts.js'\n\nconst FLAG = '__riligarSwitchingIdentity'\n\n/**\n * The event that announces: the person behind this session changed.\n *\n * The SDK knows WHEN the identity switches, but not what each panel keeps — and\n * they all keep something account-shaped. The Auth panel persists the selected\n * organization, and it was that persistence surviving the reload that made the\n * panel ask for `/applications/<the operator's organization>` already as the\n * target. The server refused with 403, correctly, and the screen showed \"Acesso\n * negado\" AFTER the switch had finished — outside any transition window, which\n * is why silencing the interceptor never fixed it.\n *\n * Each panel listens and clears what is its own. The SDK needs to know no key,\n * and a new panel that persists something solves its own case without touching\n * this file.\n *\n * Fired by `markIdentitySwitching`, which every identity switch already goes\n * through — so a client of this package gets it by listening, with no call of\n * its own to make and no knowledge of when a switch happens.\n */\nexport const IDENTITY_CHANGED_EVENT = 'riligar:identity-changed'\n\n/**\n * Announces the switch, giving listeners a chance to clear before the reload.\n *\n * Synchronous on purpose: `dispatchEvent` only returns once every listener has\n * run, so the caller can reload on the next line knowing storage is already\n * clean.\n */\nexport function announceIdentityChange(detail) {\n try {\n window.dispatchEvent(new CustomEvent(IDENTITY_CHANGED_EVENT, { detail }))\n } catch {\n // No `window` (SSR, tests): there is no panel to notify.\n }\n}\n\n/**\n * Everything a panel remembers about an account, wiped on every switch.\n *\n * ALLOWLIST, NOT BLOCKLIST — and that is the whole point.\n *\n * The seven panels each persist something account-shaped, under names that\n * follow no single pattern: `organizations` (the selected company),\n * `hoster:pinned`, `rlg-payments-project-storage`,\n * `riligar_storage_active_tenant`, per-product API keys. Listing them would be\n * a blocklist, and a blocklist is wrong here in the way that hurts: a panel\n * that persists something new is silently left out, and the next person to open\n * that tab sees another account's data with nobody's name on it.\n *\n * So the rule is inverted. Everything goes, except the few keys that are about\n * the BROWSER rather than about the person — the session token, which the SDK\n * manages itself and rewrites on the next load, and per-device preferences that\n * carry no account data.\n *\n * Dropping the rest costs a refetch. Keeping it costs showing one person's data\n * under another person's name, which cannot be undone after it is on screen.\n */\nconst KEEP = new Set([\n // The SDK's own slot: cleared where it must be (ending an impersonation),\n // and rewritten from the shared cookie on the next load. Wiping it here too\n // would sign the operator out of a tab that only needed to forget the\n // target's lists.\n 'auth:token',\n // Cross-tab logout beacon. It is a timestamp, not account data, and clearing\n // it would break the very synchronisation this file exists to serve.\n 'auth:logout',\n // The switch beacon: a timestamp the sibling tabs listen for. Wiping it\n // would make the NEXT write look unchanged to the browser in some cases,\n // and the event that carries the switch would not fire.\n 'auth:identity-switched',\n // The accounts that signed in on this browser (`recent-accounts.js`). It\n // belongs to the browser, not to whoever is signed in, and holds nothing\n // of any account beyond its email — wiping it on every switch would empty\n // the sign-in shortcuts each time an operator impersonates someone.\n RECENT_ACCOUNTS_KEY,\n])\n\nfunction dropStoredAccountState() {\n try {\n const doomed = []\n for (let i = 0; i < window.localStorage.length; i++) {\n const k = window.localStorage.key(i)\n if (k && !KEEP.has(k)) doomed.push(k)\n }\n for (const k of doomed) window.localStorage.removeItem(k)\n\n // `sessionStorage` too: it survives a reload in the same tab, which is\n // exactly the window this function exists to close.\n window.sessionStorage?.clear()\n } catch {\n // No storage (SSR, private window, blocked cookies): there is nothing\n // persisted to leak.\n }\n}\n\n/**\n * The beacon sibling tabs listen for.\n *\n * `storage` only fires in OTHER tabs of the same origin, and only when a value\n * actually changes — so a timestamp is what turns \"this tab switched identity\"\n * into an event the siblings receive. The SDK writes it, the SDK reads it\n * (`AuthProvider`), and every panel that mounts the provider follows along\n * without writing a line: that is what makes it work for our own seven panels\n * and for anyone else's app on the same footing.\n *\n * It cannot reach ANOTHER origin — no browser mechanism can. Those tabs catch up\n * through the poll, which asks the server on its own schedule.\n */\nconst SWITCH_BEACON = 'auth:identity-switched'\n\nexport function markIdentitySwitching() {\n try {\n window[FLAG] = true\n } catch {\n // No `window` (SSR, tests): there is no panel to notify.\n }\n\n try {\n // Written BEFORE the wipe below, because the wipe removes it again —\n // and it is the write itself, not the value, that the siblings hear.\n window.localStorage.setItem(SWITCH_BEACON, String(Date.now()))\n } catch {\n // No storage: the sibling tabs fall back to the poll.\n }\n // Applies to EVERY identity switch — entering and leaving an impersonation —\n // because in both directions everything remembered starts belonging to\n // another account.\n dropStoredAccountState()\n\n /*\n * Wiping storage is not enough on its own: a store that keeps its state in\n * MEMORY and only mirrors it to storage — every `zustand/persist` store is\n * one — survives the wipe untouched, and rewrites the old value on its next\n * `set()`. That is the whole bug this event exists for: the Auth panel's\n * selected organization stayed in memory across the switch, and the screen\n * asked for `/applications/<the target's organization>` as the operator,\n * which the server refused with 403 — correctly.\n *\n * Announced LAST, so a listener that reads storage sees it already clean.\n */\n announceIdentityChange({ reason: 'switch' })\n}\n\nexport function clearIdentitySwitching() {\n try {\n window[FLAG] = false\n } catch {\n // Same reasoning as above.\n }\n}\n\nexport function isIdentitySwitching() {\n try {\n return Boolean(window[FLAG])\n } catch {\n return false\n }\n}\n\n/**\n * Should a 401 sign the person out — or is it the expected 401 of a switch?\n *\n * Every panel's HTTP client reacts to a 401 by signing out. On the server that\n * `signOut` deletes EVERY session of the person's e-mail across all products\n * (one account, one e-mail, many application rows) — the right thing for a real\n * \"sign out everywhere\", and a catastrophe for a transient 401.\n *\n * Leaving an impersonation keeps the panel mounted for a moment while it\n * reloads, and calls already in flight carry the dying impersonation token. The\n * server answers 401, correctly. Acting on THAT 401 signed the operator out of\n * everything — the account came back for a second and was then wiped by its own\n * panel. Exiting from the Auth tab happened to dodge it; exiting from Functions,\n * Monitors or Hoster did not, which is why it looked panel-specific.\n *\n * Pure and exported so each panel shares one decision instead of three copies of\n * an inline `&& !isIdentitySwitching()`, and so a single test covers all of\n * them. Pass the flag in (do not read it here) to keep it testable without a\n * `window`.\n */\nexport function shouldSignOutOn401(switching) {\n return !switching\n}\n","import { markIdentitySwitching } from './identitySwitch.js'\nimport { markSocialDeparture, rememberAccount, takeSocialDeparture } from './recent-accounts.js'\n\n// The default this package resolves to when an integration does not pass a URL.\n// It ships inside the published bundle, so a stale value here fails on the\n// customer's machine, not on ours.\nlet API_BASE = 'https://auth.worker.myinfrastructure.click'\nlet API_KEY = null\nlet INTERNAL_MODE = false // Internal mode: no API key required (same-domain apps)\n\n// Permite configurar API key e modo interno externamente (chamado pelo AuthProvider)\nexport function configure({ apiKey, apiUrl, internal = false }) {\n if (apiKey) API_KEY = apiKey\n if (apiUrl) API_BASE = apiUrl.endsWith('/') ? apiUrl.slice(0, -1) : apiUrl\n INTERNAL_MODE = internal\n}\n\nexport const isInternal = () => INTERNAL_MODE\n\n/** A URL da API de autenticação em uso. É a origem confiável por definição. */\nexport const getApiUrl = () => API_BASE\n\n/** A chave onde o token de sessão é guardado. Exposta para quem precisa lê-lo. */\nexport const TOKEN_STORAGE_KEY = 'auth:token'\n\n// Cache para JWKS\nlet jwksCache = null\nlet jwksCacheExpiry = 0\n\n// helper fetch pré-configurado\nasync function api(route, opts = {}) {\n // Garante que a rota comece com /\n const cleanRoute = route.startsWith('/') ? route : `/${route}`\n\n // Constrói URL completa (API_BASE já teve trailing slash removido no configure)\n const url = `${API_BASE}${cleanRoute}`\n\n const token = getStoredToken()\n const headers = {\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n ...opts.headers,\n }\n\n // Adiciona Authorization header se tiver token\n if (token) {\n headers.Authorization = `Bearer ${token}`\n }\n\n // Adiciona API Key se configurada e não estiver em modo interno\n if (API_KEY && !INTERNAL_MODE) {\n headers['X-API-Key'] = API_KEY\n }\n\n const res = await fetch(url, {\n headers,\n credentials: 'include', // Required for sending session cookies\n ...opts,\n })\n\n // Converte JSON automaticamente e lança erro legível\n const data = res.status !== 204 ? await res.json().catch(() => ({})) : null\n\n if (!res.ok) {\n /*\n * O contrato: `{error: {code, message, details?}}`.\n *\n * `code` é o identificador estável — programe contra ele. `message` é\n * a frase para o humano e pode mudar de redação a qualquer momento.\n * `details` traz o que dá para agir (o limite estourado, o campo que\n * faltou), e vai no Error para quem trata sem precisar do corpo.\n */\n const payloadError = data?.error\n const failure = new Error(payloadError?.message || res.statusText)\n failure.res = res\n failure.data = data\n failure.status = res.status\n failure.code = payloadError?.code ?? null\n failure.details = payloadError?.details ?? null\n failure.retriable = Boolean(payloadError?.retriable)\n throw failure\n }\n return data\n}\n\n// Gerenciamento de token no localStorage\nfunction getStoredToken() {\n if (typeof window === 'undefined') return null\n return window.localStorage.getItem(TOKEN_STORAGE_KEY)\n}\n\n// Exportada: o store precisa DESCARTAR o token quando o servidor não\n// reconhece a sessão. Sem isso, um valor obsoleto sobrevive no localStorage e\n// o handoff do OAuth o envia no `#token=`, derrubando a autorização.\nexport function setStoredToken(token) {\n if (typeof window === 'undefined') return\n if (token) {\n window.localStorage.setItem(TOKEN_STORAGE_KEY, token)\n } else {\n window.localStorage.removeItem(TOKEN_STORAGE_KEY)\n }\n}\n// Helper para processar resposta de autenticação e salvar token\nfunction handleAuthResponse(result) {\n // Tenta encontrar o token em vários lugares possíveis\n const token = result.token || result.session?.token || result.session?.sessionToken\n\n if (token) {\n setStoredToken(token)\n }\n\n return result\n}\n// Busca JWKS do servidor\nasync function fetchJWKS() {\n const now = Date.now()\n if (jwksCache && now < jwksCacheExpiry) {\n return jwksCache\n }\n\n try {\n const response = await fetch(`${API_BASE}/.well-known/jwks.json`)\n const jwks = await response.json()\n jwksCache = jwks\n jwksCacheExpiry = now + 5 * 60 * 1000 // Cache por 5 minutos\n return jwks\n } catch (error) {\n console.error('Erro ao buscar JWKS:', error)\n return null\n }\n}\n\n// Decodifica JWT (apenas payload, sem verificação de assinatura)\nexport function decodeJWT(token) {\n try {\n const parts = token.split('.')\n if (parts.length !== 3) return null\n\n // Safe base64 decode\n const base64Url = parts[1]\n const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/')\n\n // Verifica ambiente para decodificar\n const jsonPayload = typeof window !== 'undefined' ? window.atob(base64) : Buffer.from(base64, 'base64').toString()\n\n return JSON.parse(jsonPayload)\n } catch {\n return null\n }\n}\n\n// Verifica se o token está expirado\nfunction isTokenExpired(token) {\n const payload = decodeJWT(token)\n\n // Se não for um JWT válido (payload null), assumimos que é um token opaco (session token)\n // Nesse caso, deixamos o servidor validar via 401\n if (!payload) return false\n\n if (!payload.exp) return false\n\n const now = Date.now()\n const exp = payload.exp * 1000\n const isExpired = now >= exp\n\n if (isExpired) {\n console.log('[AuthSDK] Token expired:', { now, exp, diff: exp - now })\n }\n\n return isExpired\n}\n\n// Verifica se o usuário está autenticado\nexport function isAuthenticated() {\n const token = getStoredToken()\n const valid = token && !isTokenExpired(token)\n return valid\n}\n\n// Obtém dados do usuário do token\nexport function getCurrentUser() {\n const token = getStoredToken()\n if (!token || isTokenExpired(token)) return null\n\n const payload = decodeJWT(token)\n return payload\n ? {\n id: payload.sub,\n email: payload.email,\n name: payload.name,\n ...payload,\n }\n : null\n}\n\n/*--- sign in: ask for the code, trade the code ----*/\n//\n// These are the only two calls that authenticate. There is no separate sign-up:\n// someone who never signed in and someone who already did walk exactly the same\n// path, and `requestCode`'s answer is the same in both cases — it does not tell\n// whether the email already had an account.\n\n/**\n * Asks for the sign-in code. The email goes out right away; the response does\n * not wait for it.\n *\n * @param {string} email\n * @param {{ name?: string }} [options] Name used only if the account is created now.\n * @returns {Promise<{ sent: boolean, expiresIn: number, interval: number, deviceCode: string }>}\n */\nexport const requestCode = async (email, { name } = {}) => {\n return await api('/auth/code/start', {\n method: 'POST',\n body: JSON.stringify({ email, ...(name ? { name } : {}) }),\n })\n}\n\n/**\n * Trades the code for the session. This is the whole sign-in.\n *\n * @param {string} email The same email that asked for the code.\n * @param {string} code As the person typed it — case, spaces and the hyphen are optional.\n * @returns {Promise<{ user: object, token: string, session: object }>}\n */\nexport const verifyCode = async (email, code) => {\n const result = await api('/auth/code/verify', {\n method: 'POST',\n body: JSON.stringify({ email, code }),\n })\n\n return handleAuthResponse(result)\n}\n\n/**\n * Variant for whoever CANNOT read the email — an agent waiting for someone else\n * to present the code. Returns `{ pending: true, interval }` while nobody has\n * approved; in the browser, use `verifyCode`.\n *\n * @param {string} deviceCode The value returned by `requestCode`.\n */\nexport const pollCode = async deviceCode => {\n try {\n const result = await api('/auth/code/poll', {\n method: 'POST',\n body: JSON.stringify({ deviceCode }),\n })\n return handleAuthResponse(result)\n } catch (error) {\n // 428/429 are not failures: they mean \"not yet\" and \"slow down\".\n // Whoever polls needs to tell those apart from a dead code, which is a\n // real error.\n if (error?.status === 428 || error?.status === 429) {\n return { pending: true, interval: error?.details?.interval ?? 5 }\n }\n throw error\n }\n}\n\nexport const signOut = async () => {\n try {\n await api('/auth/sign-out', { method: 'POST' })\n } catch {\n // Ignores sign-out errors on the server\n } finally {\n setStoredToken(null)\n }\n}\n\nexport const refreshToken = async () => {\n try {\n const result = await api('/auth/refresh', { method: 'POST' })\n return handleAuthResponse(result)\n } catch (error) {\n setStoredToken(null)\n throw error\n }\n}\n\n/*--- Impersonation ------------------------------*/\n/*\n * Encerra a impersonação em curso.\n *\n * Não manda token nem id de sessão: o cookie de impersonação viaja sozinho\n * (`credentials: 'include'`) e é ele que autoriza. Quem está dentro da\n * impersonação é, por definição, quem pode fechá-la.\n *\n * O servidor responde limpando o cookie; depois disso o painel volta a ser o\n * operador sozinho, e um reload basta para a tela acompanhar.\n */\nexport const endImpersonation = async impersonationId => api(`/impersonation/${impersonationId}/end`, { method: 'POST' })\n\n/*--- Session ------------------------------------*/\n// O cookie `riligar.session_token` é compartilhado por `.myinfrastructure.click`, então\n// um painel recém-aberto autentica aqui SEM ter nada no localStorage (que é\n// isolado por origem). Nesse caso semeamos o token local a partir da resposta:\n// `isAuthenticated()` e o refresh em background leem do localStorage, e sem\n// isto o painel ficaria autenticado no servidor mas \"deslogado\" no cliente —\n// e o token venceria sem nunca ser renovado naquela origem.\n// A gravação é INCONDICIONAL, e não só quando o slot está vazio. A chave é\n// fixa por origem, então um token de sessão já encerrada sobrevive a logout,\n// troca de conta e expiração — e `if (!getStoredToken())` nunca o substituía.\n// O servidor acabou de dizer qual é a sessão desta requisição; ele é a\n// autoridade, e o valor local que discorda dele é resíduo.\n//\n// Importa além do painel: o handoff do OAuth lê ESTE valor para montar o\n// `#token=`, então um resíduo aqui derruba a autorização inteira com\n// \"Sessão inválida ou expirada\", num ponto que não aponta para a causa.\nexport const getSession = async () => {\n const result = await api('/auth/session')\n\n const token = result?.token || result?.session?.token\n if (token && token !== getStoredToken()) setStoredToken(token)\n\n return result\n}\n\nexport const listSessions = async () => {\n // As SESSÕES, não o envelope: a assinatura sempre devolveu a lista, e é a\n // ergonomia certa para quem só quer renderizá-las.\n const body = await api('/auth/list-sessions')\n return Array.isArray(body?.items) ? body.items : []\n}\n\nexport const revokeSession = async id => {\n return await api('/auth/revoke-session-by-id', {\n method: 'POST',\n body: JSON.stringify({ id }),\n })\n}\n\nexport const revokeOtherSessions = async () => {\n return await api('/auth/revoke-other-sessions', {\n method: 'POST',\n })\n}\n\n/*--- Application Info ----------------------------*/\nexport const getApplicationInfo = async () => {\n try {\n // O recurso vem na RAIZ.\n return (await api('/application/by-api-key')) || null\n } catch (error) {\n console.warn('[AuthSDK] Failed to fetch application info:', error.message)\n return null\n }\n}\n\n/*--- Profile Management ---------------------------*/\nexport const updateProfile = async data => {\n return await api('/auth/update-user', {\n method: 'POST',\n body: JSON.stringify(data),\n })\n}\n\n/*--- Recent accounts ------------------------------------------------------*/\n\n/*\n * The server's copy of this browser's sign-in shortcuts.\n *\n * `localStorage` is per origin, so a list kept only there stayed on the panel\n * where the person signed in. The worker keeps it in an HttpOnly cookie on its\n * own host, which every panel of the application reaches — and answers only to\n * the origins the application allows (`routes/recent-accounts.js`).\n *\n * All three fail soft: the shortcuts are a convenience, and a network error or\n * an origin the worker refuses must never cost the sign-in. `null` means \"no\n * answer\", which the screen reads as \"keep what you have\".\n */\n\n/** The list for this application, or `null` when the worker did not answer. */\nexport const fetchRecentAccounts = async () => {\n try {\n const response = await api('/auth/recent-accounts')\n return Array.isArray(response?.items) ? response.items : null\n } catch {\n return null\n }\n}\n\n/**\n * Records the account of the CURRENT session. The worker reads the email from\n * the session, never from here. `keepalive` because the screen is usually\n * navigating away at this very moment.\n */\nexport const saveRecentAccount = async (method = 'code') => {\n try {\n const response = await api('/auth/recent-accounts', { method: 'POST', body: JSON.stringify({ method }), keepalive: true })\n return Array.isArray(response?.items) ? response.items : null\n } catch {\n return null\n }\n}\n\n/** Takes one account off this browser's list, on every panel. */\nexport const deleteRecentAccount = async email => {\n try {\n await api(`/auth/recent-accounts/${encodeURIComponent(email)}`, { method: 'DELETE', keepalive: true })\n return true\n } catch {\n return false\n }\n}\n\n/*--- Social sign-in -------------------------------------------------------*/\n\n/**\n * The providers this application has enabled.\n *\n * Public: it answers a screen where nobody is signed in yet. It carries only\n * `{ provider, name }` — never the client id, which identifies the owner's\n * project at Google.\n *\n * Returns `[]` on failure rather than throwing: a sign-in screen that cannot\n * reach this endpoint must still render the email field, which is the path that\n * always works.\n */\nexport const getSocialProviders = async () => {\n try {\n const response = await api('/auth/providers')\n return response?.items || []\n } catch (error) {\n console.warn('[AuthSDK] Failed to fetch social providers:', error.message)\n return []\n }\n}\n\n/**\n * Leaves for the provider.\n *\n * A full-page navigation, not `fetch`: the person has to SEE Google's consent\n * screen, and an XHR would be blocked by CORS anyway. The API key travels in the\n * query string because a redirect carries no headers — it is the public `pu_`,\n * which is already in the bundle.\n *\n * `redirect` is where to come back to; the worker validates it against the\n * application's allowlist BEFORE leaving, and stores the validated value. It\n * defaults to the current page.\n *\n * `rememberAccount: false` keeps the account off this browser's recent list\n * (`recent-accounts.js`) when the token comes back.\n */\nexport const startSocialSignIn = (provider, { redirect, rememberAccount: shouldRemember = true } = {}) => {\n const destination = redirect || window.location.href.split('#')[0]\n const url = new URL(`${API_BASE}/auth/sign-in/${provider}`)\n url.searchParams.set('redirect', destination)\n if (API_KEY && !INTERNAL_MODE) url.searchParams.set('api_key', API_KEY)\n\n // The fragment that comes back carries only the token, not which provider\n // issued it — so the tab notes where it went before leaving.\n if (shouldRemember) markSocialDeparture(provider)\n\n window.location.assign(url.toString())\n}\n\n/**\n * Reads the token the callback left in the fragment, and cleans the URL.\n *\n * The token comes back after `#` precisely so it never reaches a server, a log\n * or a `Referer`. Once read it is removed from the address bar with\n * `replaceState`, so a copied URL does not carry a live session.\n *\n * Returns the token when there was one, `null` otherwise.\n */\nexport const consumeSocialToken = () => {\n if (typeof window === 'undefined' || !window.location.hash) return null\n\n const params = new URLSearchParams(window.location.hash.slice(1))\n const token = params.get('token')\n if (!token) return null\n\n // Read before the identity switch below: it clears `sessionStorage`, where\n // the departure is noted. A token without a departure (a handoff between\n // panels) is not a sign-in made here, and does not enter the list.\n const provider = takeSocialDeparture()\n\n /*\n * A social sign-in can land on a tab that already belongs to SOMEBODY ELSE.\n *\n * Coming back from Google replaces the session, and the person behind it may\n * not be the one who left: signing in with a Google account whose email has\n * no user here creates a NEW user, with an organization of its own.\n *\n * Swapping the token alone is not enough. Every panel keeps account-shaped\n * state — the Auth panel persists the selected organization — and a\n * `zustand/persist` store holds it in MEMORY, where clearing storage does\n * not reach. The stale organization then rides the NEW token into the next\n * request, and the server answers 403 \"Sem permissão para esta organização\"\n * — correctly, about a switch that actually worked.\n *\n * That is the exact failure `markIdentitySwitching` exists for, and which\n * impersonation already routes through. Social sign-in is one more identity\n * switch and has to go through it too.\n *\n * Compared by `sub`, not by token string: a refresh rotates the token for\n * the SAME person, and treating that as a switch would wipe their panel\n * state for nothing.\n */\n const previous = getStoredToken()\n if (previous && previous !== token) {\n const before = decodeJWT(previous)?.sub\n const after = decodeJWT(token)?.sub\n // Only when we can read both and they disagree. An unreadable token is\n // not evidence of a switch, and guessing here would clear state on a\n // malformed value.\n if (before && after && before !== after) markIdentitySwitching()\n }\n\n setStoredToken(token)\n\n if (provider) {\n const email = decodeJWT(token)?.email\n if (email) rememberAccount(email, provider)\n // The shared copy, so the other panels learn it too. Not awaited: the\n // token is already stored, and the sign-in must not wait on a shortcut.\n saveRecentAccount(provider)\n }\n\n params.delete('token')\n const rest = params.toString()\n window.history.replaceState(null, '', `${window.location.pathname}${window.location.search}${rest ? `#${rest}` : ''}`)\n\n return token\n}\n\n/**\n * The failure the callback reported, if any. Also clears it from the URL.\n *\n * The worker sends a short opaque code — never the provider's own error text,\n * which echoes back parts of our request. Phrasing lives here, next to the other\n * user-facing strings.\n */\nexport const consumeSocialError = () => {\n if (typeof window === 'undefined') return null\n\n const params = new URLSearchParams(window.location.search)\n const reason = params.get('social_error')\n if (!reason) return null\n\n // The trip failed: the departure noted for it must not label a later token.\n takeSocialDeparture()\n\n params.delete('social_error')\n const rest = params.toString()\n window.history.replaceState(null, '', `${window.location.pathname}${rest ? `?${rest}` : ''}${window.location.hash}`)\n\n return reason\n}\n\n/** Starts linking a provider to the account of the CURRENT session. */\nexport const startSocialLink = async (provider, { redirect } = {}) => {\n const destination = redirect || window.location.href.split('#')[0]\n const response = await api(`/auth/link/${provider}`, { method: 'POST', body: JSON.stringify({ redirect: destination }) })\n if (response?.authorizeUrl) window.location.assign(response.authorizeUrl)\n return response\n}\n\nexport const unlinkSocialProvider = async provider => {\n return await api(`/auth/unlink/${provider}`, { method: 'POST' })\n}\n\n/** The providers linked to the current session's user. */\nexport const getLinkedProviders = async () => {\n const response = await api('/auth/linked-providers')\n return response?.items || []\n}\n","// ============================================================================\n// REDIRECT PÓS-LOGIN\n// ============================================================================\n//\n// Quem inicia um fluxo OAuth (o servidor MCP, por exemplo) manda o usuário ao\n// painel com `?redirect=` apontando de volta. Sem tratar esse parâmetro, o\n// login termina na home do painel e a autorização fica órfã.\n//\n// A lógica vive aqui, e não em cada aplicação, porque ela tem duas armadilhas\n// que não se quer reimplementar três vezes:\n//\n// 1. `redirect` sem allowlist transforma a tela de login em open redirect —\n// um link `?redirect=https://phishing.example` levaria o usuário para lá\n// logo após ele digitar a senha, num domínio que ele confia.\n//\n// 2. O token vive em `localStorage`, que é isolado POR ORIGEM. O worker do\n// Auth (auth.worker.*) não consegue lê-lo do painel (produto.dashboard.*),\n// então ele precisa ser entregue — e o fragmento (`#token=`) é o único\n// canal que não chega ao servidor nem entra em log de acesso.\n// ============================================================================\n\nimport { getApiUrl, TOKEN_STORAGE_KEY } from './authSdk'\n\n/**\n * Origens para as quais é seguro redirecionar após o login.\n *\n * A origem da própria API entra sempre: é para lá que o fluxo OAuth volta, e\n * o SDK já a conhece por `configure({ apiUrl })`. A origem atual também, por\n * ser a mesma página. `extraOrigins` cobre o resto (um site institucional que\n * inicie o login, por exemplo).\n */\nfunction allowedOrigins(extraOrigins = []) {\n const list = []\n\n try {\n list.push(new URL(getApiUrl()).origin)\n } catch {}\n\n if (typeof window !== 'undefined') list.push(window.location.origin)\n\n for (const raw of extraOrigins) {\n try {\n list.push(new URL(raw).origin)\n } catch {}\n }\n\n return list\n}\n\nconst isLocalhost = hostname => hostname === 'localhost' || hostname === '127.0.0.1'\n\n/**\n * Valida o `redirect` recebido e devolve o destino, ou `null`.\n *\n * Caminho interno (`/algo`) passa sempre — não sai do domínio. URL absoluta só\n * passa se a origem constar na allowlist e for HTTPS: aceitar `http://` num\n * host permitido exporia o token em trânsito.\n */\nexport function resolveRedirect(raw, extraOrigins = []) {\n if (!raw || typeof raw !== 'string') return null\n\n // `//` seria protocol-relative, que sai do domínio apesar de parecer path.\n if (raw.startsWith('/') && !raw.startsWith('//')) return raw\n\n let url\n try {\n url = new URL(raw)\n } catch {\n return null\n }\n\n // Localhost passa em desenvolvimento: o destino é a máquina do próprio\n // usuário, não um servidor de terceiro.\n if (isLocalhost(url.hostname)) return raw\n\n if (url.protocol !== 'https:') return null\n return allowedOrigins(extraOrigins).includes(url.origin) ? raw : null\n}\n\n/**\n * Executa o redirect pós-login.\n *\n * Devolve `true` quando assumiu a navegação — o chamador então não deve\n * navegar por conta própria. `false` significa \"não havia redirect válido,\n * siga o seu fluxo normal\".\n *\n * @param {string|null} target destino já validado por `resolveRedirect`\n * @param {(path: string) => void} navigate roteador da aplicação, para paths internos\n * @param {boolean} withToken anexar o token no fragmento (necessário quando o\n * destino é outra origem que precisa da sessão, como o handoff do OAuth)\n */\nexport function applyRedirect(target, navigate, { withToken = true } = {}) {\n if (!target) return false\n\n // Caminho interno: o roteador resolve, sem recarregar a página.\n if (target.startsWith('/')) {\n navigate?.(target, { replace: true })\n return true\n }\n\n if (typeof window === 'undefined') return false\n\n let finalUrl = target\n if (withToken) {\n const token = window.localStorage.getItem(TOKEN_STORAGE_KEY)\n // O fragmento nunca é enviado ao servidor: não aparece em log de\n // acesso nem no Referer. É o canal certo para um token.\n if (token) finalUrl = `${target}#token=${encodeURIComponent(token)}`\n }\n\n window.location.replace(finalUrl)\n return true\n}\n\n/**\n * Vai para o destino fixo do app depois de um callback (magic link, verificação\n * de e-mail).\n *\n * Caminho interno vai pelo ROTEADOR, não por `window.location`. Trocar o\n * `location` recarrega o documento inteiro: o React remonta, o `AuthProvider`\n * refaz `/auth/session`, e quem acabou de entrar vê o painel montar duas vezes.\n * Como o painel normalmente também navega no `onSuccess`, o efeito era o\n * primeiro destino aparecer e ~2s depois a página \"dar refresh\" sozinha.\n *\n * URL absoluta continua trocando o `location`: é outra origem, e o roteador\n * desta aplicação não a alcança.\n *\n * @param {string} target destino (`/algo` ou URL absoluta)\n * @param {(path: string, opts?: object) => void} navigate roteador da aplicação\n */\nexport function goToAppDestination(target, navigate) {\n if (!target || typeof window === 'undefined') return\n\n if (target.startsWith('/') && !target.startsWith('//') && navigate) {\n navigate(target, { replace: true })\n return\n }\n\n window.location.href = target\n}\n\n/**\n * Lê o `redirect` da URL atual, valida e devolve o destino (ou `null`).\n *\n * Atalho para o caso comum: o componente não precisa mexer em `URLSearchParams`\n * nem lembrar o nome do parâmetro.\n */\nexport function getRedirectFromLocation(extraOrigins = [], paramName = 'redirect') {\n if (typeof window === 'undefined') return null\n const raw = new URLSearchParams(window.location.search).get(paramName)\n return resolveRedirect(raw, extraOrigins)\n}\n","import { create } from 'zustand'\nimport * as api from './authSdk.js'\nimport { markIdentitySwitching } from './identitySwitch.js'\n\n// Shortest gap between two focus-driven session reads.\nconst REVALIDATE_THROTTLE_MS = 5000\n\n// Estado: { user, loading, error }\nexport const useAuthStore = create((set, get) => ({\n user: null,\n loading: true,\n error: null,\n\n // Timestamp of the last focus revalidation, for throttling.\n lastRevalidatedAt: 0,\n\n // Session management\n sessions: [],\n currentSession: null,\n\n // Loading states granulares\n loadingStates: {\n requestCode: false,\n verifyCode: false,\n signOut: false,\n updateProfile: false,\n listSessions: false,\n revokeSession: null, // null or sessionId being revoked\n },\n\n // Application info (logo, nome, etc)\n applicationInfo: null,\n\n /*\n * Preenchido quando ESTA sessão é emprestada — `/auth/session` devolve\n * `{ actor, expiresAt }`. É o que a barra lê para avisar, em qualquer painel,\n * que quem está logado não é quem está olhando.\n */\n impersonation: null,\n\n // Helper para atualizar loading states\n setLoading: (key, value) =>\n set(state => ({\n loadingStates: { ...state.loadingStates, [key]: value },\n })),\n\n // Buscar informações da aplicação\n fetchApplicationInfo: async () => {\n try {\n const appInfo = await api.getApplicationInfo()\n set({ applicationInfo: appInfo })\n } catch (error) {\n console.warn('[AuthStore] Failed to fetch application info:', error)\n set({ applicationInfo: null })\n }\n },\n\n /*\n * Reads the session from the server and mirrors it into the store.\n *\n * Shared by `init` (on mount) and `revalidate` (on focus). `trusted` says\n * whether a failure is allowed to sign the user out: on mount there is\n * nothing to lose, but on a revalidation the user is already signed in and\n * a flaky network must not drop them.\n */\n syncSession: async ({ trusted }) => {\n try {\n // Busca a sessão (que agora também traz applicationInfo)\n const sessionData = await api.getSession()\n\n // Se veio aplicação no redirecionamento/sessão, salva no store\n if (sessionData?.application) {\n set({ applicationInfo: sessionData.application })\n }\n\n // `?? null` e não `|| undefined`: a ausência do campo é a resposta\n // normal (ninguém impersonando) e tem que LIMPAR o estado anterior,\n // senão a barra sobrevive ao encerramento.\n set({ impersonation: sessionData?.impersonation ?? null })\n\n const user = sessionData?.user ?? null\n if (sessionData?.session) {\n set({ currentSession: sessionData.session })\n }\n\n // Se não encontrou sessão via cookies, verifica localStorage token (JWT)\n //\n // `isAuthenticated()` só confere o `exp` do JWT — não fala com o\n // servidor. Uma sessão revogada tem `exp` no futuro e passaria por\n // aqui: o painel se mostraria logado com um token que o servidor já\n // não reconhece. Como o handoff do OAuth envia ESTE token no\n // `#token=`, o resíduo derrubava a autorização com \"Sessão inválida\n // ou expirada\" — longe da causa.\n //\n // O servidor acabou de responder sem sessão; ele é a autoridade.\n if (!user) {\n /*\n * \"No user\" WITH a stored token is not a logout — it is a token\n * that stopped being valid. The right answer is to ask again,\n * without it.\n *\n * This is the path of whoever ended the impersonation in ANOTHER\n * tab. `/auth/session` with a dead token answers 200 and WITHOUT\n * a user (not 401: a session that does not exist is the normal\n * \"nobody signed in\" path). This branch then concluded \"logged\n * out\" and stopped there — while the operator's session was\n * alive in the cookie, shared across the zone and never touched.\n *\n * The retry goes without `Authorization`, the cookie speaks, and\n * the operator becomes themselves again. One attempt only: if\n * this one also comes back without a user, there is no session\n * behind it and logging out is correct.\n */\n if (api.isAuthenticated()) {\n api.setStoredToken(null)\n\n const semToken = await api.getSession().catch(() => null)\n if (semToken?.user) {\n const anterior = get().user\n const trocou = anterior && anterior.id !== semToken.user.id\n\n set({\n user: semToken.user,\n currentSession: semToken.session ?? null,\n impersonation: semToken.impersonation ?? null,\n loading: false,\n })\n\n if (trocou && typeof window !== 'undefined') {\n markIdentitySwitching()\n window.location.reload()\n }\n return\n }\n }\n\n set({ user: null, currentSession: null, impersonation: null, loading: false })\n return\n }\n\n /*\n * THE IDENTITY CHANGED UNDER THE SCREEN: drop everything and reload.\n *\n * This is the guard that makes the server the single truth. The\n * seven panels hold data in memory and in their own stores —\n * projects, lists, counters — and none of them knows when the person\n * behind the session stopped being the same one.\n *\n * It happens for real when an impersonation is ended in ANOTHER tab:\n * `localStorage` is per origin, so Hoster never learns that Functions\n * ended it. On the next focus it revalidates, the server answers with\n * the operator — and the screen was left with one person's footer and\n * another's list, two people's data at once.\n *\n * Swapping `user` in the store would not be enough: whoever already\n * read the list does not read it again. Reloading is the only way to\n * guarantee that NOTHING of the previous identity survives — and it\n * is cheap, because it only happens on the transition.\n *\n * `previous` comes from the state, not from a module variable: under\n * SSR and in tests the module is shared, and the comparison has to be\n * per store.\n */\n const previous = get().user\n const identityChanged = previous && previous.id !== user.id\n\n if (identityChanged && typeof window !== 'undefined') {\n /*\n * Mark the switch BEFORE reloading.\n *\n * The reload is not instantaneous: in-flight calls finish, and\n * mounted screens still fire their own. All of them carry the old\n * identity and get 403 — which surfaced as \"Acesso negado: Sem\n * permissão para esta organização\" in the middle of a switch that\n * was working.\n *\n * This guard reloaded without marking, and was the last place the\n * notification escaped through.\n */\n markIdentitySwitching()\n set({ user, loading: false })\n window.location.reload()\n return\n }\n\n set({ user, loading: false })\n } catch (error) {\n // Só descartamos o token quando o SERVIDOR o recusou (401). Uma\n // falha de rede não diz nada sobre a validade da sessão, e limpar\n // aqui deslogaria quem só perdeu conexão por um instante.\n const rejected = error?.res?.status === 401\n\n /*\n * Token refused: drop it AND ASK AGAIN, without it.\n *\n * Clearing alone was not enough, and that is what made the operator\n * lose their account when ending an impersonation in ANOTHER tab.\n * `localStorage` is per origin: ending in Functions does not remove\n * the target's token stored in Hoster and Auth. Coming back to that\n * tab, it revalidated with a dead token, took a 401, cleared it — and\n * stopped there, concluding \"logged out\".\n *\n * But the operator's session is alive in the cookie, shared across\n * the zone and never touched. The second attempt goes without\n * `Authorization`, the cookie speaks, and they become themselves\n * again — which is what the person expected when ending it in any of\n * the tabs.\n *\n * One attempt only: if this one fails too, there is no session\n * behind it, and the path below (logging out) is correct.\n */\n if (rejected) {\n api.setStoredToken(null)\n try {\n const semToken = await api.getSession()\n if (semToken?.user) {\n /*\n * This path ALSO swaps the identity on screen.\n *\n * It is the one taken when the impersonation is ended in\n * another tab: the target's token is refused, the cookie\n * returns the operator — but the screen stays mounted\n * with the target's lists, which nobody will re-read.\n *\n * Same guard as the ordinary revalidation: mark the\n * switch to silence the in-flight 403s, and reload so\n * nothing of the previous identity survives.\n */\n const anterior = get().user\n const trocou = anterior && anterior.id !== semToken.user.id\n\n set({\n user: semToken.user,\n currentSession: semToken.session ?? null,\n impersonation: semToken.impersonation ?? null,\n loading: false,\n })\n\n if (trocou && typeof window !== 'undefined') {\n markIdentitySwitching()\n window.location.reload()\n }\n return\n }\n } catch {\n // Sem sessão atrás do token morto: segue para o caminho\n // normal e desloga, que é o comportamento correto.\n }\n }\n\n // An unreachable server says nothing about an established session.\n // On a revalidation the user is already signed in: keep them, and\n // try again on the next focus.\n if (!rejected && !trusted) {\n console.warn('[AuthStore] Revalidação falhou, mantendo a sessão:', error)\n return\n }\n\n console.error('Erro na inicialização:', error)\n set({ user: null, currentSession: null, loading: false })\n }\n },\n\n /* Init ao montar o Provider */\n init: async () => {\n await get().syncSession({ trusted: true })\n },\n\n /*\n * Re-reads the session when the tab regains focus.\n *\n * `init` runs once, so a tab opened BEFORE the user signed in elsewhere\n * stays on `user: null` until a manual refresh. The session cookie is\n * shared across the zone, and localStorage is not — it is per origin — so\n * the `storage` event never crosses between two dashboards. Asking the\n * server on focus is what carries a sign-in (and a sign-out) between them.\n *\n * Throttled: `focus` and `visibilitychange` fire together, and alt-tabbing\n * would otherwise turn into a burst of `/auth/session` calls.\n */\n revalidate: async ({ force = false } = {}) => {\n const now = Date.now()\n // `force` skips the floor between reads: a caller on its own interval\n // (the impersonation poll) already controls the frequency, and the floor\n // exists for focus, which fires several times in a row when windows\n // change.\n if (!force && now - get().lastRevalidatedAt < REVALIDATE_THROTTLE_MS) return\n set({ lastRevalidatedAt: now })\n await get().syncSession({ trusted: false })\n },\n\n /* Ações de Autenticação */\n /* Sign in — ask for the code and trade it for the session. No third step. */\n\n requestCode: async (email, options) => {\n const { setLoading } = get()\n setLoading('requestCode', true)\n set({ error: null })\n\n try {\n return await api.requestCode(email, options)\n } catch (err) {\n set({ error: err })\n throw err\n } finally {\n setLoading('requestCode', false)\n }\n },\n\n verifyCode: async (email, code) => {\n const { setLoading } = get()\n setLoading('verifyCode', true)\n set({ error: null })\n\n try {\n const result = await api.verifyCode(email, code)\n\n // The session comes with the response; without it the \"this device\"\n // badge cannot identify the current session.\n if (result.session) set({ currentSession: result.session })\n\n set({ user: result.user || null, loading: false })\n return result\n } catch (err) {\n set({ error: err })\n throw err\n } finally {\n setLoading('verifyCode', false)\n }\n },\n\n signOut: async () => {\n const { setLoading } = get()\n setLoading('signOut', true)\n\n try {\n await api.signOut()\n set({ user: null })\n // Sincronizar logout entre abas\n if (typeof window !== 'undefined') {\n window.localStorage.setItem('auth:logout', Date.now())\n }\n } finally {\n setLoading('signOut', false)\n }\n },\n\n /* Session */\n getSession: async () => {\n try {\n const sessionData = await api.getSession()\n // Store current session for comparison (includes id)\n if (sessionData?.session) {\n set({ currentSession: sessionData.session })\n }\n return sessionData\n } catch (err) {\n set({ error: err })\n throw err\n }\n },\n\n listSessions: async () => {\n const { setLoading } = get()\n setLoading('listSessions', true)\n set({ error: null })\n\n try {\n const result = await api.listSessions()\n set({ sessions: result || [] })\n setLoading('listSessions', false)\n return result\n } catch (err) {\n set({ error: err, sessions: [] })\n setLoading('listSessions', false)\n throw err\n }\n },\n\n revokeSession: async sessionId => {\n const { setLoading, currentSession, sessions, signOut } = get()\n setLoading('revokeSession', sessionId)\n set({ error: null })\n\n try {\n // Detect if current session OR last remaining session\n const isCurrent = sessionId === currentSession?.id\n const isLast = sessions.length === 1 && sessions[0].id === sessionId\n\n // Se for a sessão atual ou a última, faz logout normal\n if (isCurrent || isLast) {\n await signOut()\n // signOut já limpa loading states e erros no finally, mas\n // como estamos dentro do fluxo deste método, garantimos:\n setLoading('revokeSession', null)\n return\n }\n\n await api.revokeSession(sessionId)\n\n // Remove a sessão revogada da lista local\n set(state => ({\n sessions: state.sessions.filter(s => s.id !== sessionId),\n }))\n\n setLoading('revokeSession', null)\n } catch (err) {\n set({ error: err })\n setLoading('revokeSession', null)\n throw err\n }\n },\n\n revokeOtherSessions: async () => {\n const { setLoading, listSessions } = get()\n setLoading('revokeSession', 'all')\n set({ error: null })\n\n try {\n await api.revokeOtherSessions()\n // Refresh sessions list after revocation\n await listSessions()\n setLoading('revokeSession', null)\n } catch (err) {\n set({ error: err })\n setLoading('revokeSession', null)\n throw err\n }\n },\n\n /* Refresh do token em background */\n startRefresh: () => {\n if (typeof window === 'undefined') return\n\n const refreshInterval = setInterval(\n async () => {\n try {\n // Se o usuário está autenticado mas o token está próximo do vencimento\n if (api.isAuthenticated()) {\n const token = window.localStorage.getItem('auth:token')\n if (token) {\n // Usa o decoder oficial do SDK que é mais seguro\n const payload = api.decodeJWT(token)\n\n // Se não for um JWT ou não tiver expiração, não fazemos refresh em background\n // O backend cuidará da expiração da sessão opaca via 401 nas requisições normais\n if (!payload || !payload.exp) return\n\n const now = Date.now() / 1000\n const timeUntilExpiry = payload.exp - now\n\n // Se o token expira em menos de 5 minutos, tenta o refresh\n if (timeUntilExpiry < 300) {\n try {\n const refreshed = await api.refreshToken()\n const user = api.getCurrentUser()\n set({ user })\n // O refresh rotaciona o token mantendo o mesmo id de sessão.\n if (refreshed?.session) set({ currentSession: refreshed.session })\n } catch (refreshErr) {\n console.warn('[AuthStore] Falha ao renovar token:', refreshErr)\n // Só desloga se for um erro de autenticação explícito (401)\n if (refreshErr.res?.status === 401) {\n set({ user: null })\n window.localStorage.removeItem('auth:token')\n }\n }\n }\n }\n }\n } catch (error) {\n // Erros de processamento interno não devem deslogar o usuário\n console.error('[AuthStore] Erro no ciclo de refresh automático:', error)\n }\n },\n 4 * 60 * 1000\n ) // Verifica a cada 4 minutos\n\n // Limpa o intervalo quando necessário\n if (typeof window !== 'undefined') {\n window.addEventListener('beforeunload', () => {\n clearInterval(refreshInterval)\n })\n }\n },\n\n /* Verifica se o token ainda é válido */\n checkTokenValidity: () => {\n if (!api.isAuthenticated()) {\n set({ user: null })\n return false\n }\n return true\n },\n\n /* Atualizar usuário manualmente */\n setUser: user => set({ user }),\n\n /* Profile Management */\n updateProfile: async data => {\n const { setLoading } = get()\n setLoading('updateProfile', true)\n set({ error: null })\n\n try {\n const result = await api.updateProfile(data)\n // Atualiza o user no store com os novos dados\n set(state => ({\n user: state.user ? { ...state.user, ...data } : null,\n }))\n setLoading('updateProfile', false)\n return result\n } catch (err) {\n set({ error: err })\n setLoading('updateProfile', false)\n throw err\n }\n },\n}))\n","import { useCallback, useEffect, useState } from 'react'\nimport { useAuthStore } from '../authStore.js'\nimport { endImpersonation, setStoredToken } from '../authSdk.js'\nimport { markIdentitySwitching } from '../identitySwitch.js'\n\n/*\n * The bar that says: whoever is signed in is not whoever is looking.\n *\n * It lives in the SDK, not in the dashboard-kit, for a simple reason: the SDK is\n * what knows the session is borrowed (`/auth/session` answers `impersonation`),\n * and it is what all seven panels already load because of Auth. In the kit the\n * bar would have to receive that state from outside — and every panel would wire\n * it by hand, which is exactly how one panel gets left out and nobody notices.\n *\n * The risk of this feature is not authorization; it is the operator FORGETTING\n * they are inside someone else's account. Hence a bar that is fixed, spans the\n * full width, and carries the countdown.\n *\n * INLINE STYLES, ON PURPOSE\n *\n * The SDK ships no CSS and does not depend on Mantine — the panels that consume\n * it have their own themes, and a `<link>` or a global class would collide with\n * them. These are few rules and they do not change with the theme: dark ink,\n * white text.\n *\n * It renders nothing when there is no impersonation, so it can sit at the top of\n * the app with no condition around it.\n */\n\nfunction remaining(expiresAt) {\n if (!expiresAt) return null\n const ms = new Date(expiresAt).getTime() - Date.now()\n if (ms <= 0) return null\n const totalSeconds = Math.floor(ms / 1000)\n return `${Math.floor(totalSeconds / 60)}:${String(totalSeconds % 60).padStart(2, '0')}`\n}\n\n/*\n * A FLOATING PILL, NOT A STRIP AT THE TOP — and this is a layout decision, not\n * a cosmetic one.\n *\n * The bar used to be `position: sticky; top: 0`, rendered just above the panel's\n * own tree. That takes vertical space in the document flow, and all seven panels\n * lay themselves out with Mantine's `AppShell`, which positions its Header and\n * Navbar at offsets it computes from its OWN props (`header={{ height }}`, and\n * that height is responsive — 56 on mobile, 0 on desktop in some panels). The\n * strip pushed that whole construction down: the panel's header ended up under\n * the bar, and the sidebar got clipped.\n *\n * The SDK cannot fix that by measuring: it would have to know each panel's\n * header height, at every breakpoint, and stay in sync with seven layouts it\n * does not own. Any number it picks is wrong somewhere.\n *\n * So the bar stops competing for the top of the page. `position: fixed` with\n * `inset: auto 0 20px` takes it out of the flow entirely — it reserves no\n * space, displaces nothing, and floats over the content at the BOTTOM, where no\n * panel puts a fixed header. The visibility that the feature depends on is\n * preserved: it is always on screen, centred, and impossible to scroll away\n * from. The risk this component exists to cover is the operator FORGETTING they\n * are inside someone else's account, and a floating pill answers that as well\n * as a strip did — without breaking the screen underneath.\n *\n * `pointerEvents` is handled in two layers: the full-width wrapper lets clicks\n * through (it spans the viewport and would otherwise swallow a row of the UI),\n * and the pill itself takes them back so the button stays clickable.\n */\nconst styles = {\n wrap: {\n position: 'fixed',\n left: 0,\n right: 0,\n bottom: 20,\n zIndex: 2147483647,\n display: 'flex',\n justifyContent: 'center',\n // The strip spans the viewport; without this it would eat clicks on\n // whatever sits behind it for the full width of the screen.\n pointerEvents: 'none',\n // Mobile: never let the pill run under the home indicator.\n paddingLeft: 'max(12px, env(safe-area-inset-left))',\n paddingRight: 'max(12px, env(safe-area-inset-right))',\n },\n bar: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexWrap: 'wrap',\n gap: 10,\n padding: '10px 16px',\n borderRadius: 999,\n // The brand's black. It stands out by INVERSION, not by an alert\n // colour: red would say \"something went wrong\", and the state is\n // \"you are borrowed\".\n background: '#11181C',\n color: '#FFFFFF',\n fontSize: 13,\n fontFamily: 'inherit',\n lineHeight: 1.4,\n maxWidth: '100%',\n // Detaches the pill from the content it floats over, which a flat strip\n // did not need because it had an edge to sit against.\n boxShadow: '0 8px 24px rgba(0, 0, 0, 0.28)',\n pointerEvents: 'auto',\n },\n strong: { fontWeight: 700 },\n clock: { fontVariantNumeric: 'tabular-nums', opacity: 0.75 },\n button: {\n marginLeft: 4,\n padding: '4px 12px',\n border: 0,\n borderRadius: 999,\n background: '#FFFFFF',\n color: '#11181C',\n font: 'inherit',\n fontSize: 12,\n fontWeight: 700,\n cursor: 'pointer',\n },\n}\n\nexport default function ImpersonationBanner() {\n const impersonation = useAuthStore(s => s.impersonation)\n const user = useAuthStore(s => s.user)\n const [left, setLeft] = useState(() => remaining(impersonation?.expiresAt))\n const [ending, setEnding] = useState(false)\n\n /*\n * Encerrar recarrega a página.\n *\n * The whole panel is already mounted with the target's data — lists,\n * stores, caches. Swapping the identity underneath would leave half the\n * screen with one person's data and half with another's. Reloading is the\n * simplest way to make everything come back coherent, and it happens once,\n * at the end of the session.\n */\n /*\n * O vencimento, sem clique.\n *\n * It does not call `/impersonation/:id/end`: the session is already gone,\n * and the route would answer 403 (\"belongs to another session\") because the\n * presented token died. What is left to do is local — drop the target's\n * token — and let the server say who the person is on the next load.\n *\n * The impersonation cookie needs no explicit clearing: it was issued with a\n * `Max-Age` equal to the session TTL, so the browser discards it on its own.\n * And even if it lingered a moment, `requireAuth` tries the candidates in\n * order and falls through to the operator's session.\n */\n const endedByTimer = useCallback(() => {\n markIdentitySwitching()\n setStoredToken(null)\n window.location.assign('/')\n }, [])\n\n const handleEnd = async () => {\n if (!impersonation?.id) return\n setEnding(true)\n markIdentitySwitching()\n try {\n await endImpersonation(impersonation.id)\n\n /*\n * The TARGET's token is in localStorage — the SDK wrote it there\n * so the other products would send the right header. Ending without\n * dropping it would leave the panel presenting itself as the target\n * in every product that reads that key, even with the cookie gone.\n *\n * The reload below asks for the session again, and the operator's\n * session cookie (never touched) rewrites the correct value.\n */\n setStoredToken(null)\n } catch {\n // If it fails, the session expires on its own within minutes.\n // Reloading anyway avoids leaving the operator stuck in a bar that\n // does not answer.\n }\n /*\n * Goes to the panel's ROOT, instead of reloading the current URL.\n *\n * The URL where an impersonation ends usually belongs to the TARGET — a\n * project of theirs in Hoster, an application of theirs in Auth.\n * Reloading there returns the operator to a route that may not be\n * theirs, and the screen answers 403 or sits in a skeleton forever.\n *\n * `/` is the home of every panel in the suite, and the only route that\n * answers for any identity. Each product decides what it means.\n */\n window.location.assign('/')\n }\n\n useEffect(() => {\n if (!impersonation) return\n\n const timer = setInterval(() => {\n const restante = remaining(impersonation.expiresAt)\n setLeft(restante)\n\n /*\n * Vencido: a tela tem que acompanhar, e sem ninguém clicar em nada.\n *\n * Until now the clock hit zero and nothing else happened: the bar\n * stayed on screen, `localStorage` kept the target's dead token, and\n * every product answered 401 — which panels read as the end of a\n * session and handle by signing out. The operator lost their own\n * account because a borrowed session expired.\n *\n * `endedByTimer` walks the same path as the button: drop the\n * target's token and go to the root. What decides who shows up next\n * is the SERVER — the operator's session cookie was never touched,\n * so if it is alive the home loads as them; if there is no session\n * behind it, `/auth/session` answers without a user and the panel\n * sends them to the login, which is correct. There is nothing to\n * guess here.\n */\n if (!restante) endedByTimer()\n }, 1000)\n\n return () => clearInterval(timer)\n }, [impersonation, endedByTimer])\n\n if (!impersonation) return null\n\n // Durante o primeiro segundo `left` ainda é o valor de outra impersonação\n // (ou nulo); derivar aqui evita um setState no corpo do efeito só para isso.\n const clock = left ?? remaining(impersonation.expiresAt)\n\n return (\n <div style={styles.wrap}>\n <div\n style={styles.bar}\n role=\"status\"\n >\n <span>\n Você está vendo como <span style={styles.strong}>{user?.name || user?.email}</span>\n {impersonation.actor ? <> · sessão aberta por {impersonation.actor}</> : null}\n </span>\n {clock ? <span style={styles.clock}>encerra em {clock}</span> : null}\n {impersonation.id ? (\n <button\n type=\"button\"\n style={styles.button}\n onClick={handleEnd}\n disabled={ending}\n >\n {ending ? 'Encerrando…' : 'Encerrar'}\n </button>\n ) : null}\n </div>\n </div>\n )\n}\n","import { createContext, useEffect, useMemo } from 'react'\nimport { useShallow } from 'zustand/react/shallow'\nimport { useAuthStore } from './authStore.js'\nimport { consumeSocialToken, configure } from './authSdk.js'\nimport ImpersonationBanner from './components/ImpersonationBanner.jsx'\nimport { markIdentitySwitching } from './identitySwitch.js'\n\nconst AuthContext = createContext() // só para ter o Provider em JSX\n\n// How often a tab asks the server who it is. Short enough for an identity\n// switch to surface on its own, long enough not to weigh on an idle panel.\nconst IMPERSONATION_POLL_MS = 10 * 1000\n\nexport function AuthProvider({\n children,\n apiKey, // API Key para header X-API-Key (obrigatória exceto em modo internal)\n apiUrl, // URL do manager (opcional, padrão: http://auth.worker.myinfrastructure.click)\n internal = false, // Modo interno: não exige API Key (para aplicações same-domain como dashboard)\n onError, // Callback de erro global\n}) {\n // Validação de props obrigatórias\n // apiKey só é obrigatória se não estiver em modo internal\n if (!internal && !apiKey) {\n throw new Error('[@ciromaciel/auth-react] apiKey é obrigatória no AuthProvider. ' + 'Obtenha sua API Key no dashboard em https://auth.dashboard.myinfrastructure.click')\n }\n\n const init = useAuthStore(s => s.init)\n const startRefresh = useAuthStore(s => s.startRefresh)\n const revalidate = useAuthStore(s => s.revalidate)\n const checkTokenValidity = useAuthStore(s => s.checkTokenValidity)\n\n // Configura SDK com apiKey, apiUrl e modo interno\n // Usamos useMemo para garantir que a configuração ocorra ANTES dos efeitos dos componentes filhos\n useMemo(() => {\n configure({ apiKey, apiUrl, internal })\n\n /*\n * A social sign-in landing here brings its token in the fragment.\n *\n * It is consumed in this `useMemo`, BEFORE `init()` runs in the effect\n * below: `init` reads the stored token to resolve the session, so a\n * token still sitting in the URL at that moment would be missed, and the\n * person would land signed out on the page they just signed into.\n *\n * Reading it also strips it from the address bar, so a copied URL never\n * carries a live session.\n */\n consumeSocialToken()\n }, [apiKey, apiUrl, internal])\n\n useEffect(() => {\n init()\n startRefresh()\n }, [init, startRefresh])\n\n // Sincronização entre abas - escuta logout e mudanças no token\n useEffect(() => {\n if (typeof window === 'undefined') return\n\n const handleStorageChange = event => {\n if (event.key === 'auth:logout') {\n // Limpa o user do store - a aplicação redireciona automaticamente quando user é null\n useAuthStore.setState({ user: null, currentSession: null, sessions: [] })\n }\n /*\n * Another tab of this origin switched identity.\n *\n * It clears its own storage and reloads, but each tab has its own\n * mounted screens — lists and counters that belong to whoever was\n * signed in a moment ago. Wiping here and reloading is what makes a\n * sibling tab follow along instead of showing the previous person's\n * data under the new person's name.\n *\n * This is the SDK's job, not each app's: every consumer of\n * `AuthProvider` gets it without writing anything, ours and our\n * customers' alike.\n */\n if (event.key === 'auth:identity-switched') {\n markIdentitySwitching()\n window.location.assign('/')\n return\n }\n\n // The token changed in another tab of THIS origin.\n //\n // `checkTokenValidity` only reads the stored JWT's `exp`, which\n // cannot tell a different person from the same one — and after an\n // impersonation starts or ends, a different person is exactly what\n // it is. Asking the server is what makes the sibling tab follow the\n // switch instead of sitting on the previous identity's data.\n //\n // `force` skips the focus throttle: this is an event, not a stream,\n // and a background tab may never get focus to catch up.\n if (event.key === 'auth:token') {\n revalidate({ force: true })\n }\n }\n\n // Escuta evento de sessão revogada (quando o usuário revoga sua própria sessão)\n const handleSessionRevoked = () => {\n // Limpa o usuário do store\n useAuthStore.setState({ user: null, currentSession: null, sessions: [] })\n // Dispara evento de logout para sincronizar entre abas\n localStorage.setItem('auth:logout', Date.now())\n }\n\n window.addEventListener('storage', handleStorageChange)\n window.addEventListener('auth:session-revoked', handleSessionRevoked)\n return () => {\n window.removeEventListener('storage', handleStorageChange)\n window.removeEventListener('auth:session-revoked', handleSessionRevoked)\n }\n }, [revalidate])\n\n // Revalidate the session when the tab regains focus.\n //\n // `init` runs once: a tab opened BEFORE the user signed in on another\n // dashboard stays on `user: null` until a manual refresh. The session\n // cookie belongs to the zone, but localStorage is per origin — so the\n // `storage` event never crosses from one dashboard to another. Asking the\n // server on focus is what carries a sign-in (and a sign-out) between them.\n useEffect(() => {\n if (typeof window === 'undefined') return\n\n const handleFocus = () => {\n if (document.visibilityState === 'visible') revalidate()\n }\n\n document.addEventListener('visibilitychange', handleFocus)\n window.addEventListener('focus', handleFocus)\n return () => {\n document.removeEventListener('visibilitychange', handleFocus)\n window.removeEventListener('focus', handleFocus)\n }\n }, [revalidate])\n\n // Verifica validade do token periodicamente\n useEffect(() => {\n if (typeof window === 'undefined') return\n\n const interval = setInterval(() => {\n checkTokenValidity()\n }, 30 * 1000) // Verifica a cada 30 segundos\n\n return () => clearInterval(interval)\n }, [checkTokenValidity])\n\n // Ask the server every so often — even with the tab in the background, and\n // WITHOUT depending on knowing an impersonation is open.\n //\n // `checkTokenValidity` above only reads the `exp` of the stored JWT, and a\n // target's token has an `exp` in the future: it stays \"valid\" after the\n // impersonation ended. Focus revalidation does not help a tab nobody\n // touched. That is what left Functions showing the target after ending\n // elsewhere: nothing in that tab had a reason to ask again.\n //\n // Gating this on `impersonation` was the obvious move and the wrong one: it\n // makes the recovery depend on the very state that goes stale. When the\n // store lost `impersonation` while still holding the target as `user` — the\n // bar disappeared and the data did not — the poll stopped with it, and the\n // tab had no way back at all.\n //\n // Unconditional, the tab always has a way back. One request every ten\n // seconds against a route that answers from the session is cheap; being\n // stuck as another person is not.\n useEffect(() => {\n if (typeof window === 'undefined') return\n const interval = setInterval(() => revalidate({ force: true }), IMPERSONATION_POLL_MS)\n return () => clearInterval(interval)\n }, [revalidate])\n\n // Contexto com onError callback\n const contextValue = useMemo(() => ({ onError }), [onError])\n\n /*\n * The impersonation bar ships WITH the Provider.\n *\n * That is what makes all seven panels warn without any of them being\n * changed: they all already wrap the app in `AuthProvider`. Letting each\n * panel mount it by hand is how one of them gets left out — and the panel\n * left out is precisely where the operator forgets whose account they are\n * in.\n *\n * It renders nothing when no impersonation is open, so it costs nothing in\n * the normal case.\n */\n return (\n <AuthContext.Provider value={contextValue}>\n <ImpersonationBanner />\n {children}\n </AuthContext.Provider>\n )\n}\n\n/* Hooks \"facade\" que a app vai usar */\nexport const useAuth = () =>\n useAuthStore(\n useShallow(s => ({\n user: s.user,\n loading: s.loading,\n error: s.error,\n isAuthenticated: s.user !== null,\n requestCode: s.requestCode,\n verifyCode: s.verifyCode,\n signOut: s.signOut,\n }))\n )\n\n/**\n * Sign in: the two steps, and nothing else.\n *\n * `requestCode(email, { name })` sends the code. `verifyCode(email, code)`\n * returns the session. There is no separate sign-up — the first entry creates\n * the account.\n */\nexport const useSignIn = () =>\n useAuthStore(\n useShallow(s => ({\n requestCode: s.requestCode,\n verifyCode: s.verifyCode,\n sending: s.loadingStates.requestCode,\n verifying: s.loadingStates.verifyCode,\n error: s.error,\n }))\n )\n\n// Auth Actions\nexport const useSignOut = () => useAuthStore(s => s.signOut)\nexport const useCheckToken = () => useAuthStore(s => s.checkTokenValidity)\n\n// Session Hook\nexport const useSession = () =>\n useAuthStore(\n useShallow(s => ({\n getSession: s.getSession,\n user: s.user,\n setUser: s.setUser,\n }))\n )\n\n// Loading States Hook\nexport const useAuthLoading = () => useAuthStore(s => s.loadingStates)\n\n// Profile Management Hook (novo nome estilo Clerk)\nexport const useUser = () =>\n useAuthStore(\n useShallow(s => ({\n user: s.user,\n updateProfile: s.updateProfile,\n loadingUpdateProfile: s.loadingStates.updateProfile,\n error: s.error,\n }))\n )\n\n// Alias deprecado para backwards compatibility\nexport const useProfile = useUser\n\n// Sessions Management Hook\nexport const useSessions = () =>\n useAuthStore(\n useShallow(s => ({\n currentSession: s.currentSession,\n sessions: s.sessions,\n getSession: s.getSession,\n listSessions: s.listSessions,\n revokeSession: s.revokeSession,\n revokeOtherSessions: s.revokeOtherSessions,\n loadingListSessions: s.loadingStates.listSessions,\n loadingRevokeSession: s.loadingStates.revokeSession,\n error: s.error,\n }))\n )\n\n/**\n * The impersonation in progress, or `null`.\n *\n * Exposed so a panel can adapt what it OFFERS while the session is borrowed.\n * The banner already says whose account this is; this is for the screens that\n * would otherwise invite the target to do something only an administrator does\n * — \"create your first company\" makes no sense for an end user being looked at.\n *\n * Returns the record (`{ id, actor, expiresAt }`), so a screen can name who\n * opened the session without a second call.\n */\nexport const useImpersonation = () => useAuthStore(s => s.impersonation)\n\n// Application Logo Hook\nexport const useApplicationLogo = () => {\n const applicationInfo = useAuthStore(s => s.applicationInfo)\n // Retorna o logo da aplicação ou null (componentes usam fallback padrão)\n return applicationInfo?.image || null\n}\n","import { Navigate, Outlet } from 'react-router-dom'\nimport { useAuth } from './AuthProvider.jsx'\n\nexport default function Protect({ fallback = <p>⌛ Carregando...</p>, redirectTo = '/login' }) {\n const { user, loading } = useAuth()\n\n if (loading) return fallback\n if (!user)\n return (\n <Navigate\n to={redirectTo}\n replace\n />\n )\n\n return <Outlet />\n}\n","import { Navigate, Outlet } from 'react-router-dom'\nimport { useAuth } from './AuthProvider.jsx'\nimport { getRedirectFromLocation } from './redirect.js'\n\n/**\n * O par do `<Protect>`: a rota pública que quem JÁ tem sessão não deveria ver.\n *\n * `<Protect>` cobria metade da porta — tira de dentro quem não está logado, mas\n * nada tirava da tela de login quem está, e essa tela é pública justamente para\n * não depender de sessão. Chegar em `/auth/signin` autenticado renderizava o\n * formulário, e só um F5 saía dele: no recarregamento o `init()` roda,\n * `/auth/session` responde com o usuário, e aí a navegação acontece.\n *\n * ESPERAR O `loading` É A PARTE QUE IMPORTA. Enquanto ele for `true` o store\n * ainda não perguntou nada ao servidor e `user` é `null` — indistinguível de\n * \"não está logado\". Renderizar o formulário nessa janela é o mesmo bug, só que\n * mais curto. Por isso o `fallback` existe: passe o MESMO esqueleto que vai no\n * `<Protect>`, e a pessoa vê uma tela só até a resposta chegar.\n *\n * O `?redirect=` ganha do `redirectTo`: quem veio de uma autorização OAuth\n * volta para ela, não para a home do painel. `getRedirectFromLocation` valida\n * contra a allowlist, então um destino forjado devolve `null` — sem isso a tela\n * de login vira open redirect.\n *\n * Aceita os dois formatos de rota, porque os dois existem nos painéis:\n *\n * <Route path=\"signin\" element={<GuestOnly fallback={<AuthLoader />}><SignIn /></GuestOnly>} />\n *\n * <Route element={<GuestOnly fallback={<AuthLoader />} />}>\n * <Route path=\"signin\" element={<SignIn />} />\n * </Route>\n */\nexport default function GuestOnly({ children, fallback = null, redirectTo = '/', extraOrigins = [] }) {\n const { user, loading } = useAuth()\n\n if (loading) return fallback\n if (!user) return children ?? <Outlet />\n\n const to = getRedirectFromLocation(extraOrigins) || redirectTo\n\n // `//alvo` parece caminho e sai do domínio: é externo, e o roteador desta\n // aplicação não o alcança.\n const isInternal = to.startsWith('/') && !to.startsWith('//')\n if (!isInternal) {\n window.location.replace(to)\n return fallback\n }\n\n return (\n <Navigate\n to={to}\n replace\n />\n )\n}\n","import { Paper, Stack, Image, Title, Text, Modal, Box, Divider, ThemeIcon, Group } from '@mantine/core'\n\n/**\n * Container wrapper para componentes de autenticação\n * Suporta renderização como Card (Paper) ou Modal\n *\n * @param {object} props\n * @param {string|React.ReactNode} [props.logo] - URL da imagem ou nó React (ex.: <Wordmark />)\n * @param {'card'|'modal'} [props.variant='card'] - Modo de renderização\n * @param {boolean} [props.opened] - Controla visibilidade do modal (apenas para variant=\"modal\")\n * @param {function} [props.onClose] - Callback ao fechar modal (apenas para variant=\"modal\")\n * @param {object} [props.modalProps] - Props adicionais para o Modal\n */\nexport default function AuthCard({\n children,\n title,\n subtitle,\n logo,\n logoWidth = 133,\n width = 350,\n\n // Variant props\n variant = 'card',\n opened,\n onClose,\n modalProps = {},\n\n ...props\n}) {\n // Conteúdo interno compartilhado entre Card e Modal\n const content = (\n <Stack gap=\"sm\">\n {(logo || title || subtitle) && (\n <Stack\n gap={6}\n align=\"center\"\n ta=\"center\"\n >\n {logo &&\n (typeof logo === 'string' ? (\n <Image\n src={logo}\n alt=\"Auth\"\n mx=\"auto\"\n w={logoWidth}\n fit=\"contain\"\n />\n ) : (\n logo\n ))}\n\n {title && (\n <Title\n order={3}\n ta=\"center\"\n >\n {title}\n </Title>\n )}\n\n {subtitle && (\n <Text\n size=\"sm\"\n c=\"dimmed\"\n ta=\"center\"\n >\n {subtitle}\n </Text>\n )}\n </Stack>\n )}\n\n {children}\n </Stack>\n )\n\n // Renderizar como Modal\n if (variant === 'modal') {\n return (\n <Modal\n opened={opened}\n onClose={onClose}\n size={width + 50}\n withCloseButton\n radius={0}\n overlayProps={{ backgroundOpacity: 0.55, blur: 3 }}\n title={\n <Group\n gap=\"sm\"\n wrap=\"nowrap\"\n >\n {logo &&\n (typeof logo === 'string' ? (\n <Image\n src={logo}\n alt=\"Auth\"\n h={logoWidth}\n fit=\"contain\"\n />\n ) : (\n logo\n ))}\n {title && <Title order={4}>{title}</Title>}\n </Group>\n }\n {...modalProps}\n >\n {/* Quando em modal, não repetir logo/title no content */}\n <Stack gap=\"sm\">\n {subtitle && (\n <Text\n size=\"sm\"\n c=\"dimmed\"\n >\n {subtitle}\n </Text>\n )}\n {children}\n </Stack>\n </Modal>\n )\n }\n\n // Renderizar como Card (default)\n return (\n <Paper\n withBorder\n shadow=\"none\"\n p={24}\n /*\n * `w` fixo nao encolhe: num celular de 375px o cartao de 350px\n * mais o padding da pagina estourava a tela e a coluna da direita\n * ficava cortada. `maw` mantem a MESMA largura onde ela cabe e\n * cede onde nao cabe.\n */\n w=\"100%\"\n maw={width}\n radius={0}\n {...props}\n >\n {content}\n </Paper>\n )\n}\n","import { ActionIcon, Anchor, Avatar, Button, Group, Loader, NavLink, Paper, Stack, Text } from '@mantine/core'\nimport { IconArrowRight, IconX } from '@tabler/icons-react'\n\nconst PROVIDER_NAMES = { google: 'Google', github: 'GitHub' }\n\nconst providerName = method => PROVIDER_NAMES[method] || method.charAt(0).toUpperCase() + method.slice(1)\n\nconst RELATIVE = new Intl.RelativeTimeFormat('pt-BR', { numeric: 'auto' })\n\n/** \"há 2 horas\", \"ontem\", \"há 6 dias\" — the unit that reads naturally. */\nexport function formatLastUsed(timestamp, now = Date.now()) {\n const minutes = Math.round((timestamp - now) / 60000)\n if (Math.abs(minutes) < 1) return RELATIVE.format(0, 'second')\n if (Math.abs(minutes) < 60) return RELATIVE.format(minutes, 'minute')\n\n const hours = Math.round(minutes / 60)\n if (Math.abs(hours) < 24) return RELATIVE.format(hours, 'hour')\n\n const days = Math.round(hours / 24)\n if (Math.abs(days) < 30) return RELATIVE.format(days, 'day')\n\n const months = Math.round(days / 30)\n if (Math.abs(months) < 12) return RELATIVE.format(months, 'month')\n\n return RELATIVE.format(Math.round(days / 365), 'year')\n}\n\n/** \"ciro\" → \"C\", \"qa+monitors\" → \"QM\". */\nfunction initialsOf(email) {\n const local = email.split('@')[0]\n const parts = local.split(/[.+_-]/).filter(Boolean)\n return ((parts[0] || local).charAt(0) + (parts[1] ? parts[1].charAt(0) : '')).toUpperCase()\n}\n\n/**\n * The first step for someone this browser already knows.\n *\n * Each row is the whole action: clicking it sends the code (or leaves for the\n * provider the account used last time), so a returning person goes from\n * opening the screen to typing the code in one click.\n *\n * Removing is behind \"Gerenciar\" on purpose. An × always in view sits right\n * next to the row the person came to click, and a slip would drop the account\n * they meant to use. Nothing is lost by removing — signing in again brings the\n * account back — so there is no confirmation step either.\n */\nexport default function RecentAccounts({ accounts, pickingEmail = null, managing = false, onToggleManage, onPick, onForget, onUseOther, labels = {} }) {\n const busy = !!pickingEmail\n\n return (\n <Stack gap=\"md\">\n <Stack gap={8}>\n <Group\n justify=\"space-between\"\n align=\"baseline\"\n wrap=\"nowrap\"\n >\n <Text\n fz={11}\n fw={800}\n lh={1}\n tt=\"uppercase\"\n lts=\"1.5px\"\n c=\"gray.4\"\n >\n {labels.recentAccountsHeading || 'Contas neste navegador'}\n </Text>\n\n <Anchor\n component=\"button\"\n type=\"button\"\n /*\n * The size of the heading it sits beside, not of body\n * text: it is a secondary control of the list, and at\n * 14px it outweighed the 11px label it annotates.\n */\n fz={12}\n lh={1}\n c=\"dimmed\"\n onClick={busy ? undefined : onToggleManage}\n >\n {managing ? labels.recentAccountsDone || 'Concluir' : labels.recentAccountsManage || 'Gerenciar'}\n </Anchor>\n </Group>\n\n <Paper\n withBorder\n radius={0}\n p={0}\n >\n {accounts.map((account, index) => {\n const isPicking = pickingEmail === account.email\n const isSocial = account.method !== 'code'\n\n const description = isPicking\n ? isSocial\n ? `${labels.openingProvider || 'Abrindo o'} ${providerName(account.method)}…`\n : labels.sendingCode || 'Enviando código…'\n : `${labels.lastUsed || 'Último acesso'} ${formatLastUsed(account.lastUsedAt)}${isSocial ? ` · ${providerName(account.method)}` : ''}`\n\n return (\n <NavLink\n key={account.email}\n /*\n * A `div` while managing: the row then holds the\n * remove button, and a button inside a button is\n * invalid HTML that browsers repair by splitting\n * the row in two.\n */\n component={managing ? 'div' : 'button'}\n type={managing ? undefined : 'button'}\n aria-disabled={busy || undefined}\n onClick={managing || busy ? undefined : () => onPick(account)}\n noWrap\n label={\n <Text\n fz={14}\n fw={600}\n c=\"gray.9\"\n truncate\n >\n {account.email}\n </Text>\n }\n description={description}\n leftSection={\n <Avatar\n radius={0}\n size={36}\n color=\"gray\"\n variant=\"light\"\n >\n {initialsOf(account.email)}\n </Avatar>\n }\n rightSection={\n managing ? (\n <ActionIcon\n variant=\"subtle\"\n color=\"gray\"\n aria-label={`${labels.removeAccount || 'Remover'} ${account.email}`}\n onClick={() => onForget(account)}\n >\n <IconX size={16} />\n </ActionIcon>\n ) : isPicking ? (\n <Loader size={14} />\n ) : (\n <IconArrowRight\n size={16}\n color=\"var(--mantine-color-gray-5)\"\n />\n )\n }\n py={10}\n style={index > 0 ? { borderTop: '1px solid var(--mantine-color-gray-2)' } : undefined}\n />\n )\n })}\n </Paper>\n </Stack>\n\n <Button\n type=\"button\"\n variant=\"default\"\n fullWidth\n aria-disabled={busy}\n onClick={busy ? undefined : onUseOther}\n >\n {labels.useOtherEmail || 'Usar outro e-mail'}\n </Button>\n </Stack>\n )\n}\n","import { useEffect, useState } from 'react'\nimport { Button, Divider, Group, Stack, Text } from '@mantine/core'\nimport { IconBrandGoogle } from '@tabler/icons-react'\n\nimport { getSocialProviders, startSocialSignIn } from '../authSdk.js'\n\n/*\n * The provider marks.\n *\n * Tabler outlines at stroke 1.5, like every other icon in the system — not the\n * providers' full-colour logos.\n *\n * That is a deliberate departure from what Google's brand guidelines ask for,\n * and the reason is that colour MEANS something here: it is reserved for state\n * (a semaphore reading as a semaphore, a notification as a warning). Four brand\n * colours on a sign-in button spend that signal on decoration, and the button\n * next to it — the one that actually submits — would read as less important\n * than the one that just leaves.\n *\n * A remote logo would also be a third-party request that can hang, leaving a\n * hole in the button at the exact moment someone is deciding to trust the page.\n */\nconst MARKS = { google: IconBrandGoogle }\n\n/**\n * The social sign-in buttons, driven by what the APPLICATION has enabled.\n *\n * WHY THE LIST IS FETCHED AND NOT PASSED IN\n *\n * The owner configures Google in the Auth panel. Asking the integrator to ALSO\n * declare it in code would be two sources for one fact, and they would drift:\n * turning the provider off in the panel would leave a button that fails. So the\n * component asks the worker which providers are live.\n *\n * It renders NOTHING while it does not know, and nothing when the answer is\n * empty — an application with no social provider sees no divider, no gap, no\n * trace of this component.\n */\nexport default function SocialButtons({\n labels = {},\n redirect,\n disabled = false,\n // Whether the account returning from the provider joins this browser's\n // recent list (`recent-accounts.js`). `<SignIn recentAccounts={false}>`\n // turns it off here too.\n rememberAccount = true,\n}) {\n const [providers, setProviders] = useState(null)\n const [leaving, setLeaving] = useState(null)\n\n useEffect(() => {\n let active = true\n getSocialProviders().then(list => {\n // The screen may have unmounted while the request was in flight.\n if (active) setProviders(list)\n })\n return () => {\n active = false\n }\n }, [])\n\n // `null` is \"still asking\", `[]` is \"asked, and there are none\". Both render\n // nothing, but only the second is a final answer.\n if (!providers || providers.length === 0) return null\n\n return (\n <Stack gap=\"md\">\n <Divider\n label={labels.socialDivider || 'ou'}\n labelPosition=\"center\"\n />\n\n {providers.map(provider => {\n const Mark = MARKS[provider.provider]\n\n return (\n <Button\n key={provider.provider}\n variant=\"default\"\n fullWidth\n size=\"md\"\n /*\n * `aria-disabled`, not `disabled`: Mantine's `disabled`\n * repaints the button grey and hides its label, and this\n * button is what the person is trying to click. The\n * handler below is what actually refuses.\n */\n aria-disabled={disabled || leaving !== null}\n loading={leaving === provider.provider}\n onClick={() => {\n if (disabled || leaving !== null) return\n // Kept in state so a double click does not fire two\n // navigations — the second would orphan the first\n // `oauth_states` row.\n setLeaving(provider.provider)\n startSocialSignIn(provider.provider, { redirect, rememberAccount })\n }}\n >\n <Group\n gap={10}\n wrap=\"nowrap\"\n justify=\"center\"\n >\n {Mark && (\n <Mark\n size={16}\n stroke={1.5}\n />\n )}\n <Text\n fz={14}\n fw={700}\n >\n {labels.socialButton ? labels.socialButton(provider.name) : `Entrar com ${provider.name}`}\n </Text>\n </Group>\n </Button>\n )\n })}\n </Stack>\n )\n}\n","import { Text } from '@mantine/core'\n\n/**\n * Wordmark tipográfico — a marca no padrão Zen da RiLiGar.\n *\n * Substitui o antigo logotipo em bitmap como identidade padrão dos cards de\n * autenticação. Tipografia é nítida em qualquer densidade de tela, herda a cor\n * do tema e acompanha o dark mode — coisas que um .webp não faz.\n *\n * Escala Small Caps (fw 800, lts 1.5px, gray.4): a marca é o \"anúncio\" acima\n * do título, nunca um segundo título. Quem carrega o peso é o <Title>.\n *\n * Aplicações com logo próprio continuam passando `logo` ou configurando a\n * imagem no painel; nesse caso o wordmark não aparece.\n */\nexport function Wordmark({ fz = 11, c = 'gray.4', ...props }) {\n return (\n <Text\n component=\"span\"\n display=\"block\"\n ta=\"center\"\n fz={fz}\n fw={800}\n lh={1}\n tt=\"uppercase\"\n lts=\"1.5px\"\n c={c}\n {...props}\n >\n Auth\n </Text>\n )\n}\n\nexport default Wordmark\n","// Where the terms live. Hardcoded on purpose, like `API_BASE` in authSdk.js:\n// this ships inside the published bundle, and every screen of the seven panels\n// that links to the terms — the sign-in notice and the account card's footer —\n// must point at the same document. `termsUrl` overrides it for whoever hosts\n// their own.\nexport const TERMS_URL = 'https://myinfrastructure.click/legal/terms'\n","import { useState, useEffect, useRef } from 'react'\nimport { TextInput, Button, Stack, Anchor, Center, Text, Loader, Group, Alert } from '@mantine/core'\nimport { useForm } from '@mantine/form'\nimport { useNavigate } from 'react-router-dom'\nimport { getRedirectFromLocation, applyRedirect } from '../redirect'\nimport { IconAlertCircle, IconArrowLeft, IconArrowRight, IconRefresh } from '@tabler/icons-react'\nimport { useAuthStore } from '../authStore.js'\nimport { useApplicationLogo } from '../AuthProvider.jsx'\nimport { deleteRecentAccount, fetchRecentAccounts, getSocialProviders, saveRecentAccount, startSocialSignIn } from '../authSdk.js'\nimport { adoptRecentAccounts, forgetAccount, listRecentAccounts, rememberAccount } from '../recent-accounts.js'\nimport AuthCard from './AuthCard.jsx'\nimport RecentAccounts from './RecentAccounts.jsx'\nimport SocialButtons from './SocialButtons.jsx'\n\nimport { Wordmark } from './Wordmark.jsx'\nimport { TERMS_URL } from '../terms.js'\n\n/**\n * The terms notice under the first step.\n *\n * It sits on step ONE and nowhere else: the account is born on the first\n * `verify` and there is no separate sign-up screen to put it on — this form IS\n * the sign-up for whoever has never entered. On step two the person already\n * agreed by asking for the code; repeating it there would only push the code\n * field down.\n */\nfunction TermsNotice({ url, text, linkText }) {\n if (!url) return null\n\n return (\n <Text\n size=\"xs\"\n c=\"dimmed\"\n ta=\"center\"\n /*\n * Tighter than the `gap=\"md\"` of the Stack around it, and a hair\n * tighter than default leading. This is fine print under the action,\n * not a third step of the form — spaced like the field and the\n * button it would read as one more thing to do.\n */\n mt={-4}\n lh={1.4}\n /*\n * Two short lines instead of one full-width line plus an orphan.\n * At the card's 350px the sentence wrapped as \"…todos os / nossos\n * termos e condições\", splitting the phrase away from the words that\n * govern it. Balanced, the break falls where the meaning does.\n */\n style={{ textWrap: 'balance' }}\n >\n {text}{' '}\n <Anchor\n href={url}\n target=\"_blank\"\n /*\n * `noopener noreferrer` with `target=\"_blank\"`: the same pair the\n * footers of the house use for anything leaving the origin\n * (`site-chrome.jsx`, `ProductLayout.jsx`). Opening in a new tab\n * is not decoration here — the person is mid-sign-in, and\n * navigating away would throw the typed email out.\n */\n rel=\"noopener noreferrer\"\n /*\n * `inherit` takes the size and weight of the sentence around it,\n * so the link does not turn into a bold island inside the fine\n * print — but it also takes the COLOR, and in the Zen palette\n * `primaryColor: 'gray'` paints the Anchor near-black. Against\n * dimmed text that reads as emphasis, not as something to click.\n *\n * The underline is what says \"link\" here: it survives whatever\n * `primaryColor` each panel sets, and it is the only affordance\n * left once the colour matches the sentence.\n */\n inherit\n c=\"inherit\"\n underline=\"always\"\n >\n {linkText}\n </Anchor>\n .\n </Text>\n )\n}\n\n/**\n * What a failed `verify` means for the person, read from the worker's answer.\n *\n * The HTTP status carries the case — `code` is `VALIDATION_ERROR` for both a\n * wrong and an expired code, so it cannot tell them apart:\n * - 400 with `details.attemptsLeft`: wrong code, the request is still open;\n * - 400 without it: no open request for this email (already replaced);\n * - 429: the fifth wrong try destroyed the request;\n * - 410: the code outlived its minutes, and was destroyed too.\n *\n * Anything else — the network, a 500 — is not about the code, and must not\n * lock the field.\n */\nexport function describeCodeFailure(error) {\n if (error?.status === 429) return { kind: 'exhausted', isLocked: true }\n if (error?.status === 410) return { kind: 'expired', isLocked: true }\n if (error?.status === 400) {\n const attemptsLeft = error?.details?.attemptsLeft\n return { kind: 'wrong', isLocked: false, attemptsLeft: Number.isInteger(attemptsLeft) ? attemptsLeft : null }\n }\n return { kind: 'other', isLocked: false, message: error?.message || null }\n}\n\n/**\n * The notice above the code field.\n *\n * It sits ABOVE the field, not under it, and says what to do next — not only\n * that something failed. The field's own error line was 12px of red under a\n * cleared input, next to a greyed-out button: it read as a frozen screen.\n *\n * The most common cause gets named: a new code invalidates the previous one,\n * and the person is often reading an older email.\n */\nfunction CodeFailureNotice({ failure, labels }) {\n if (!failure) return null\n\n const texts = {\n wrong: {\n title: labels.wrongCodeTitle || 'Código incorreto',\n body: [\n labels.wrongCodeHint || 'Confira o e-mail mais recente: um código novo invalida o anterior.',\n failure.attemptsLeft === 1\n ? labels.lastAttempt || 'Esta é a última tentativa.'\n : failure.attemptsLeft > 1\n ? labels.attemptsLeft\n ? labels.attemptsLeft(failure.attemptsLeft)\n : `Restam ${failure.attemptsLeft} tentativas.`\n : null,\n ]\n .filter(Boolean)\n .join(' '),\n },\n exhausted: {\n title: labels.attemptsExhaustedTitle || 'Tentativas esgotadas',\n body: labels.attemptsExhausted || 'Por segurança, este código foi cancelado. Peça um novo para continuar.',\n },\n expired: {\n title: labels.codeExpiredTitle || 'Código expirado',\n body: labels.codeExpired || 'O código vale por poucos minutos. Peça um novo para continuar.',\n },\n other: {\n title: labels.codeFailedTitle || 'Não foi possível entrar',\n body: failure.message || labels.invalidCode || 'Tente de novo em instantes.',\n },\n }[failure.kind]\n\n return (\n <Alert\n color=\"red\"\n variant=\"light\"\n radius={0}\n icon={<IconAlertCircle size={18} />}\n title={texts.title}\n /*\n * `role=\"alert\"` is Mantine's default and is what makes a screen\n * reader announce the failure without the person moving focus away\n * from the field they are about to retype in.\n */\n styles={{ root: { border: '1px solid var(--mantine-color-red-2)' } }}\n >\n <Text\n size=\"sm\"\n lh={1.45}\n >\n {texts.body}\n </Text>\n </Alert>\n )\n}\n\n// The OAuth flow's pass-through screen.\n//\n// The panel is not the destination here: the user is authorizing an MCP client\n// and only passes through this origin because it is where the token lives. A\n// blank screen during the detour looks like a freeze; this one says what is\n// happening.\nfunction AuthTransition({ label = 'Conectando…' }) {\n return (\n <Center style={{ minHeight: '60vh' }}>\n <Stack\n align=\"center\"\n gap=\"sm\"\n >\n <Loader size=\"xs\" />\n <Text\n size=\"sm\"\n c=\"dimmed\"\n >\n {label}\n </Text>\n </Stack>\n </Center>\n )\n}\n\n/**\n * Sign in — the only path there is.\n *\n * Two steps: the email receives a code, the code becomes a session. There is no\n * password, magic link, sign-up or recovery — first-time arrivals and returning\n * people walk exactly this screen, and the account is born on the first entry.\n *\n * Nothing here builds a callback URL. The code is typed in this very tab, so\n * there is no destination to validate — which is why the family of\n * origin/redirect bugs does not reach this flow.\n *\n * @param {object} props\n * @param {'card'|'modal'} [props.variant='card'] - Rendering mode\n * @param {boolean} [props.opened] - Visibility (only for variant=\"modal\")\n * @param {function} [props.onClose] - Close callback (only for variant=\"modal\")\n */\nexport default function SignIn({\n // Configuration\n logo, // No default: it is computed below\n logoWidth = 133,\n title = 'Entrar',\n subtitle = 'Enviaremos um código para o seu e-mail',\n\n // Variant\n variant = 'card',\n opened,\n onClose,\n modalProps = {},\n\n // Where to send someone who ALREADY has a session and lands on this screen.\n // The landings link straight to /auth/signin without knowing a session\n // exists; without this, a signed-in user faced the form again. `null`\n // disables the detour.\n authenticatedRedirect = '/',\n\n // Shown while the session is being resolved and during the detour of an\n // already authenticated person. Avoids flashing the form to someone who\n // should never see it.\n redirectingFallback = null,\n\n // Callbacks\n onSuccess,\n // Post-sign-in redirect: by default the component honours `?redirect=` from\n // the URL, validating against the API's origin and the current one.\n // `redirectOrigins` adds domains; `handleRedirect={false}` hands control back\n // to the app.\n handleRedirect = true,\n redirectOrigins = [],\n onError,\n onCodeSent,\n\n // Custom labels\n labels = {},\n\n // The terms notice under the first step. `null` removes it — an internal\n // panel behind a VPN has no one to present terms to.\n termsUrl = TERMS_URL,\n\n /*\n * Social sign-in buttons.\n *\n * `'auto'` — the default — shows whatever the APPLICATION enabled in the\n * Auth panel, and nothing at all when it enabled none. It is additive: an\n * application with no provider configured renders exactly what it rendered\n * before this prop existed, so the default does not break anyone.\n *\n * `false` opts out entirely, for a screen that wants the emailed code only.\n */\n socialLogin = 'auto',\n\n /*\n * The accounts that already signed in on this browser, offered before the\n * empty field (`recent-accounts.js`). With none saved the screen is exactly\n * the email form, so the default changes nothing for a first visit.\n *\n * `false` neither shows nor saves: a shared computer, or an internal panel,\n * should not remember who used it.\n */\n recentAccounts = true,\n\n ...cardProps\n}) {\n const user = useAuthStore(s => s.user)\n const authLoading = useAuthStore(s => s.loading)\n const requestCode = useAuthStore(s => s.requestCode)\n const verifyCode = useAuthStore(s => s.verifyCode)\n const sending = useAuthStore(s => s.loadingStates.requestCode)\n const verifying = useAuthStore(s => s.loadingStates.verifyCode)\n\n // Which step we are on. The email is kept because the second step has to\n // present it again: it is the (email, code) pair the server validates.\n const [sentTo, setSentTo] = useState(null)\n const [code, setCode] = useState('')\n const [codeFailure, setCodeFailure] = useState(null)\n const [isCodeResent, setIsCodeResent] = useState(false)\n const codeInputRef = useRef(null)\n\n // Read once, on mount: the list only changes through this screen, and\n // every change below writes the new list back into state.\n const [accounts, setAccounts] = useState(() => (recentAccounts ? listRecentAccounts() : []))\n const [isChoosingOther, setIsChoosingOther] = useState(false)\n const [isManaging, setIsManaging] = useState(false)\n const [pickingEmail, setPickingEmail] = useState(null)\n const isShowingAccounts = recentAccounts && accounts.length > 0 && !isChoosingOther\n const isCodeLocked = !!codeFailure?.isLocked\n\n // Hook that fetches the application's logo\n const applicationLogo = useApplicationLogo()\n const finalLogo = logo || applicationLogo || <Wordmark />\n\n const navigate = useNavigate()\n\n const form = useForm({\n initialValues: {\n email: '',\n },\n validate: {\n email: value => (/^\\S+@\\S+$/.test(value) ? null : labels.invalidEmail || 'Email inválido'),\n },\n })\n\n // Whoever already has a session must not see the form. The landings point\n // to /auth/signin unconditionally, and since the session became shared\n // across `.myinfrastructure.click` (domain cookie) it is common to arrive here\n // already authenticated — the panel used to learn that only after a\n // redundant sign-in.\n //\n // It waits for `authLoading`: the provider's `init` resolves the session\n // asynchronously (cookie → /auth/session). Deciding before that would flash\n // the form to someone already signed in, or worse, redirect based on a\n // `user` that has not loaded yet.\n // `redirectOrigins` defaults to `[]` — a new array on every render. Used raw\n // as a dependency, it would re-run the effect in a loop.\n const redirectOriginsKey = JSON.stringify(redirectOrigins)\n\n useEffect(() => {\n if (authLoading || !user) return\n\n // `?redirect=` takes priority: whoever arrived through an OAuth flow\n // needs to go back there, not to the panel's home. Same decision as the\n // post-sign-in one, with the same origin validation.\n const target = (handleRedirect ? getRedirectFromLocation(redirectOrigins) : null) || authenticatedRedirect\n\n // `authenticatedRedirect={null}` disables the courtesy detour for\n // someone already signed in — but NOT the return of an OAuth flow, which\n // is an authorization in progress, not a convenience. The guard above\n // used to block both together.\n if (!target) return\n\n applyRedirect(target, navigate)\n // eslint-disable-next-line react-hooks/exhaustive-deps -- redirectOrigins enters through the serialized key above\n }, [authLoading, user, authenticatedRedirect, handleRedirect, redirectOriginsKey, navigate])\n\n /*\n * The shared list, from the worker.\n *\n * The local copy renders at once; this replaces it when the answer\n * arrives. That is what makes an account used on the Auth panel appear\n * on Hoster: `localStorage` never crosses between the two origins.\n *\n * If the person has already started typing an email, the list does not\n * yank the form away from under them — it only feeds the \"Contas salvas\"\n * link, one click away.\n */\n useEffect(() => {\n if (!recentAccounts) return\n let isActive = true\n\n fetchRecentAccounts().then(remote => {\n if (!isActive || remote === null) return\n const next = adoptRecentAccounts(remote)\n if (form.isDirty()) setIsChoosingOther(true)\n setAccounts(next)\n })\n\n return () => {\n isActive = false\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- once per mount, like the local read\n }, [recentAccounts])\n\n // Step 1 — ask for the code.\n const handleRequest = async values => {\n if (sending) return false\n try {\n await requestCode(values.email)\n setSentTo(values.email)\n setCode('')\n setCodeFailure(null)\n onCodeSent?.(values.email)\n return true\n } catch (error) {\n // Nothing on the card shows this one: the app's notification is\n // the only place the person learns the code was not sent.\n onError?.(error, { step: 'request', isShownOnCard: false })\n return false\n }\n }\n\n // A new code, from the code step. The worker replaces the request, so the\n // attempts start over and the previous code stops working — the notice\n // says so, or the person keeps typing the one from the older email.\n const handleResend = async () => {\n const isSent = await handleRequest({ email: sentTo })\n setIsCodeResent(isSent)\n if (isSent) codeInputRef.current?.focus()\n }\n\n // Step 1, from the list — the click on a saved account IS the request.\n //\n // An account that came in through a provider goes back to that provider,\n // as long as the application still offers it. If the owner turned it off\n // in the meantime the emailed code still works for the same email, so that\n // is the fallback rather than a dead row.\n const handlePick = async account => {\n if (pickingEmail || sending) return\n setPickingEmail(account.email)\n\n if (account.method !== 'code' && socialLogin !== false) {\n const providers = await getSocialProviders()\n if (providers?.some(provider => provider.provider === account.method)) {\n // The page is leaving; the row keeps its spinner until it does.\n startSocialSignIn(account.method, { rememberAccount: recentAccounts })\n return\n }\n }\n\n await handleRequest({ email: account.email })\n setPickingEmail(null)\n }\n\n const handleForget = account => {\n const next = forgetAccount(account.email)\n setAccounts(next)\n // On every panel, not just this one. The local removal above already\n // took it off this screen, so a failure here costs nothing visible.\n deleteRecentAccount(account.email)\n if (next.length === 0) setIsManaging(false)\n }\n\n // Step 2 — trade the code for the session.\n //\n // The redirect is decided AND EXECUTED before onSuccess.\n //\n // Deciding beforehand was not enough: the app usually calls `navigate('/')`\n // inside onSuccess, so that navigation happened first and the following\n // `applyRedirect` ran with the route already changed. `redirectHandled`\n // protected against that, but only for whoever remembered to honour it — and\n // half the panels did not, which made the OAuth handoff lose the `#token=`\n // and end in \"Sessão inválida ou expirada\".\n //\n // Executing here, the OAuth flow's destination no longer depends on each\n // application getting the contract right. `onSuccess` is still always called\n // (the app still shows its notification), and `redirectHandled` still\n // signals that navigation was taken over — now as information, not as a\n // trap.\n const handleVerify = async value => {\n setCodeFailure(null)\n setIsCodeResent(false)\n try {\n const result = await verifyCode(sentTo, value)\n\n // Only now, with a session: an email that never received a valid\n // code never becomes a suggestion. Written before the redirect,\n // which may unmount this screen.\n if (recentAccounts) {\n setAccounts(rememberAccount(sentTo, 'code'))\n saveRecentAccount('code')\n }\n\n const target = handleRedirect ? getRedirectFromLocation(redirectOrigins) : null\n\n if (target) applyRedirect(target, navigate)\n\n onSuccess?.(result?.user ?? null, { result, redirectHandled: !!target })\n } catch (error) {\n // The failure belongs to this card, not to the global notification:\n // the person is looking at the eight characters they just typed.\n // The field goes back empty and focused, ready for the next try.\n setCodeFailure(describeCodeFailure(error))\n setCode('')\n codeInputRef.current?.focus()\n // Still reported — an app may log it — but flagged: the card\n // already explains it, and a notification repeating \"Código\n // inválido\" in the corner would say it twice.\n onError?.(error, { step: 'verify', isShownOnCard: true })\n }\n }\n\n // Does not render the form for someone who already has a session: the effect\n // above is redirecting, and showing the fields in that window would flash\n // the screen \"in between\" — the symptom the landing linking straight here\n // exposed. `authLoading` covers the instant before the cookie resolves.\n //\n // `?redirect=` counts on its own. In an OAuth flow the panel is a\n // PASS-THROUGH, not a destination: the token lives in this origin's\n // localStorage and the worker cannot reach it, so the browser has to come\n // through here — but the user should not notice. Without this part of the\n // condition, whoever arrived with an unresolved session still saw the panel\n // screen before the detour.\n const oauthPending = handleRedirect && !!getRedirectFromLocation(redirectOrigins)\n const willRedirect = (!!authenticatedRedirect || oauthPending) && (authLoading || !!user)\n if (willRedirect) return oauthPending ? (redirectingFallback ?? <AuthTransition />) : redirectingFallback\n\n return (\n <AuthCard\n logo={finalLogo}\n logoWidth={logoWidth}\n title={title}\n subtitle={sentTo ? labels.codeSent || 'Digite o código que enviamos' : isShowingAccounts ? labels.recentAccountsSubtitle || 'Escolha a conta que vai receber o código' : subtitle}\n variant={variant}\n opened={opened}\n onClose={onClose}\n modalProps={modalProps}\n {...cardProps}\n >\n {!sentTo && isShowingAccounts ? (\n <RecentAccounts\n accounts={accounts}\n pickingEmail={pickingEmail}\n managing={isManaging}\n onToggleManage={() => setIsManaging(value => !value)}\n onPick={handlePick}\n onForget={handleForget}\n onUseOther={() => {\n setIsManaging(false)\n setIsChoosingOther(true)\n }}\n labels={labels}\n />\n ) : !sentTo ? (\n <form onSubmit={form.onSubmit(handleRequest)}>\n <Stack gap=\"md\">\n {recentAccounts && accounts.length > 0 && (\n <Anchor\n component=\"button\"\n type=\"button\"\n size=\"sm\"\n c=\"dimmed\"\n w=\"fit-content\"\n onClick={() => setIsChoosingOther(false)}\n >\n <Group\n gap={6}\n wrap=\"nowrap\"\n >\n <IconArrowLeft size={14} />\n {`${labels.savedAccounts || 'Contas salvas'} (${accounts.length})`}\n </Group>\n </Anchor>\n )}\n\n <TextInput\n label={labels.email || 'Email'}\n placeholder={labels.emailPlaceholder || 'seu@email.com'}\n type=\"email\"\n autoFocus\n autoComplete=\"email\"\n {...form.getInputProps('email')}\n /*\n * `readOnly`, not `disabled`: Mantine's `disabled`\n * fades the field while the request is in flight, and\n * the value the person just typed is what they are\n * looking at. `readOnly` locks editing and leaves the\n * field legible.\n */\n readOnly={sending}\n />\n\n <Button\n type=\"submit\"\n fullWidth\n /*\n * `aria-disabled`, never `disabled`: `disabled`\n * repaints the button grey, and the white Loader\n * vanishes inside it — the action IN PROGRESS ends up\n * weighing less on screen than a button standing\n * still. With `aria-disabled` the button stays black,\n * the spinner shows, and the guard on submit blocks\n * the repeated click.\n *\n * And the spinner goes in `leftSection`: Mantine's\n * `loading` prop hides the label, and a button with\n * no word does not say what is happening.\n */\n aria-disabled={sending}\n leftSection={\n sending ? (\n <Loader\n size={14}\n color=\"gray.0\"\n />\n ) : null\n }\n rightSection={<IconArrowRight size={16} />}\n >\n {sending ? labels.sendingCode || 'Enviando…' : labels.sendCodeButton || 'Enviar código'}\n </Button>\n\n {/*\n * Step ONE only. On step two the person already asked\n * for a code and is looking for the field to type it\n * into; offering another way in there is noise at the\n * worst possible moment.\n */}\n {socialLogin !== false && (\n <SocialButtons\n labels={labels}\n disabled={sending}\n rememberAccount={recentAccounts}\n />\n )}\n\n <TermsNotice\n url={termsUrl}\n text={labels.termsNotice || 'Criando uma conta, você concorda com todos os nossos'}\n linkText={labels.termsLink || 'termos e condições'}\n />\n </Stack>\n </form>\n ) : (\n <Stack gap=\"md\">\n {isCodeResent && (\n <Alert\n color=\"gray\"\n variant=\"light\"\n radius={0}\n p=\"xs\"\n >\n <Text\n size=\"xs\"\n lh={1.4}\n >\n <Text\n span\n inherit\n fw={700}\n c=\"gray.9\"\n >\n {labels.codeResentTitle || 'Novo código enviado.'}\n </Text>{' '}\n {labels.codeResent || 'O anterior deixou de valer.'}\n </Text>\n </Alert>\n )}\n\n <CodeFailureNotice\n failure={codeFailure}\n labels={labels}\n />\n\n <TextInput\n ref={codeInputRef}\n label={labels.codeLabel || 'Código de acesso'}\n /*\n * The email is the field's description, not the subtitle:\n * as a subtitle it wrapped onto two lines and competed for\n * weight with the title. Here it sits where the person\n * checks it — right above what they are about to type.\n */\n description={`${labels.codeSentTo || 'Enviado para'} ${sentTo}`}\n placeholder=\"ABCD-EFGH\"\n /*\n * One field, not eight boxes. Eight boxes is the numeric\n * OTP pattern; this code is alphanumeric and dictated\n * aloud — in a single field paste works, the screen reader\n * reads one thing, and the hyphen the person types is\n * accepted (`normalizeUserCode` in the worker drops it).\n */\n value={code}\n onChange={event => {\n setCode(event.currentTarget.value)\n // Typing again is the correction: the notice has\n // done its job. A locked field cannot be typed in,\n // so an exhausted or expired notice stays.\n if (codeFailure) setCodeFailure(null)\n }}\n onKeyDown={event => {\n if (event.key === 'Enter' && code.trim()) handleVerify(code)\n }}\n autoFocus\n autoComplete=\"one-time-code\"\n readOnly={verifying}\n /*\n * No `error` on the field: the notice above carries the\n * failure, and a red border around an empty field turned\n * the PLACEHOLDER red — \"ABCD-EFGH\" read as the code the\n * person had typed. With the request gone there is\n * nothing left to type into.\n */\n disabled={isCodeLocked}\n />\n\n {isCodeLocked ? (\n /*\n * The request is gone: confirming can only fail again, so\n * the one action that works takes the button's place.\n */\n <Button\n type=\"button\"\n fullWidth\n aria-disabled={sending}\n onClick={sending ? undefined : handleResend}\n leftSection={\n sending ? (\n <Loader\n size={14}\n color=\"gray.0\"\n />\n ) : (\n <IconRefresh size={16} />\n )\n }\n >\n {sending ? labels.sendingCode || 'Enviando…' : labels.sendNewCode || 'Enviar novo código'}\n </Button>\n ) : (\n <Button\n type=\"button\"\n fullWidth\n // Same reason as the previous step: `disabled` would\n // fade the button exactly while signing in happens.\n //\n // Never disabled for an empty field either. Right\n // after a failure the field is empty on purpose, and\n // a grey button there read as a frozen screen; the\n // click sends the cursor to the field instead.\n aria-disabled={verifying}\n onClick={verifying ? undefined : () => (code.trim() ? handleVerify(code) : codeInputRef.current?.focus())}\n leftSection={\n verifying ? (\n <Loader\n size={14}\n color=\"gray.0\"\n />\n ) : null\n }\n rightSection={<IconArrowRight size={16} />}\n >\n {verifying ? labels.verifyingCode || 'Entrando…' : labels.confirmCode || 'Confirmar'}\n </Button>\n )}\n\n <Group\n justify=\"space-between\"\n gap=\"xs\"\n >\n <Anchor\n size=\"sm\"\n c=\"dimmed\"\n onClick={() => {\n setSentTo(null)\n setCode('')\n setCodeFailure(null)\n setIsCodeResent(false)\n // The label promises another email: the form,\n // not the list the person may have come from.\n setIsChoosingOther(true)\n }}\n >\n {labels.changeEmail || 'Usar outro e-mail'}\n </Anchor>\n\n {/* Locked, the main button already is \"send a new code\". */}\n {!isCodeLocked && (\n <Anchor\n size=\"sm\"\n c=\"dimmed\"\n onClick={sending ? undefined : handleResend}\n >\n {sending ? labels.sendingCode || 'Enviando…' : labels.resendCode || 'Reenviar código'}\n </Anchor>\n )}\n </Group>\n </Stack>\n )}\n </AuthCard>\n )\n}\n","/*\n * How a session reads on the account screen: which device, since when, and\n * how many there are.\n *\n * Pure functions, kept out of the component so they can be tested against real\n * user agents. The order of the checks is the point of this file:\n * - iPhone and iPad announce themselves as \"like Mac OS X\", so they must be\n * recognised BEFORE macOS — the old parser showed every phone as a Mac;\n * - Edge, Opera and Samsung Internet all carry \"Chrome\" in the string, and\n * Chrome on iOS carries \"Safari\", so each is checked before the engine it\n * imitates — the old parser never reached its Opera branch.\n */\n\nconst BROWSERS = [\n ['Edge', /\\bEdg(?:e|A|iOS)?\\//],\n ['Opera', /\\b(?:OPR|Opera|OPT)\\//],\n ['Samsung Internet', /\\bSamsungBrowser\\//],\n ['Firefox', /\\b(?:Firefox|FxiOS)\\//],\n ['Chrome', /\\b(?:Chrome|CriOS)\\//],\n ['Safari', /\\bSafari\\//],\n]\n\n/**\n * @param {string} [userAgent]\n * @returns {{ browser: string|null, os: string|null, kind: 'desktop'|'phone'|'tablet' }}\n */\nexport function describeDevice(userAgent) {\n const ua = userAgent || ''\n const browser = BROWSERS.find(([, pattern]) => pattern.test(ua))?.[0] || null\n\n if (/\\biPad\\b/.test(ua)) return { browser, os: 'iPadOS', kind: 'tablet' }\n if (/\\biPhone\\b|\\biPod\\b/.test(ua)) return { browser, os: 'iOS', kind: 'phone' }\n if (/\\bAndroid\\b/.test(ua)) return { browser, os: 'Android', kind: /\\bMobile\\b/.test(ua) ? 'phone' : 'tablet' }\n if (/\\bWindows\\b/.test(ua)) return { browser, os: 'Windows', kind: 'desktop' }\n if (/\\bCrOS\\b/.test(ua)) return { browser, os: 'ChromeOS', kind: 'desktop' }\n if (/\\bMac OS X\\b|\\bMacintosh\\b/.test(ua)) return { browser, os: 'macOS', kind: 'desktop' }\n if (/\\bLinux\\b/.test(ua)) return { browser, os: 'Linux', kind: 'desktop' }\n return { browser, os: null, kind: 'desktop' }\n}\n\n/** \"Chrome no macOS\", \"Safari\", \"iOS\", or \"Aparelho desconhecido\". */\nexport function deviceLabel({ browser, os }) {\n if (browser && os) return `${browser} no ${os}`\n return browser || os || 'Aparelho desconhecido'\n}\n\nconst pad = n => String(n).padStart(2, '0')\n\n/**\n * \"hoje, 09:12\", \"ontem, 21:40\", \"23/09, 14:05\" or \"23/09/2025, 14:05\".\n *\n * Calendar days in the viewer's own time zone: a session opened at 23:50 is\n * \"ontem\" ten minutes later, which is what the person remembers.\n */\nexport function formatSessionStart(value, now = new Date()) {\n const date = new Date(value)\n if (Number.isNaN(date.getTime())) return null\n\n const time = `${pad(date.getHours())}:${pad(date.getMinutes())}`\n const startOfDay = d => new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime()\n const days = Math.round((startOfDay(now) - startOfDay(date)) / 86_400_000)\n\n if (days === 0) return `hoje, ${time}`\n if (days === 1) return `ontem, ${time}`\n const day = `${pad(date.getDate())}/${pad(date.getMonth() + 1)}`\n return date.getFullYear() === now.getFullYear() ? `${day}, ${time}` : `${day}/${date.getFullYear()}, ${time}`\n}\n\n/** \"1 sessão aberta\", \"3 sessões abertas\". */\nexport function countSessions(count) {\n return count === 1 ? '1 sessão aberta' : `${count} sessões abertas`\n}\n\n/**\n * The current session first, then the others from the newest.\n *\n * The API orders by creation only, so the device the person is holding could\n * land anywhere in the list; it is the one they look for first.\n */\nexport function orderSessions(sessions, currentId) {\n return [...(sessions || [])].sort((a, b) => {\n if (a.id === currentId) return -1\n if (b.id === currentId) return 1\n return new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()\n })\n}\n","/*\n * Who the signed-in person is, as the account card and the account screen\n * show it. One rule for both, so the two never disagree about the same person.\n *\n * A name equal to the email's local part is not a name: it is what an account\n * born from a code gets by default, and showing it on top of the email repeats\n * the same fact. It counts as \"no name\", and the email becomes the title.\n */\nexport function describeUser(user) {\n const name = (user?.fullName || user?.name || '').trim()\n const email = (user?.primaryEmailAddress || user?.email || '').trim()\n\n const hasRealName = Boolean(name) && name.toLowerCase() !== email.split('@')[0].toLowerCase() && name.toLowerCase() !== email.toLowerCase()\n const title = hasRealName ? name : email || name\n\n const initials = hasRealName\n ? name\n .split(/\\s+/)\n .map(part => part[0])\n .join('')\n .slice(0, 2)\n .toUpperCase()\n : (email || name).charAt(0).toUpperCase()\n\n return { name, email, hasRealName, title, initials, image: user?.imageUrl || user?.image || null }\n}\n","import { useEffect, useId, useState } from 'react'\nimport { Avatar, Box, FileButton, Group, Loader, Modal, Paper, Stack, Text, TextInput, Image, UnstyledButton } from '@mantine/core'\nimport { useForm } from '@mantine/form'\nimport { IconBrandGithub, IconBrandGoogle, IconChevronDown, IconDeviceDesktop, IconDeviceLaptop, IconDeviceMobile, IconDeviceTablet, IconLink, IconMail, IconX } from '@tabler/icons-react'\n\nimport { useUser, useSessions } from '../AuthProvider.jsx'\nimport { getLinkedProviders, getSocialProviders, startSocialLink, unlinkSocialProvider } from '../authSdk.js'\nimport { countSessions, describeDevice, deviceLabel, formatSessionStart, orderSessions } from '../session-display.js'\nimport { describeUser } from '../user-identity.js'\n\n/*\n * The account screen: who you are, how you sign in, and where your session is\n * open. Opened from \"Conta\" on the account card, in every panel.\n *\n * Every text has a Portuguese default. Until 25/09/2026 the defaults were in\n * English, five of the seven panels passed no labels and showed \"Account\",\n * \"Update\" and \"1 active session\", and the two that did pass labels wrote\n * three different verbs for the same action. A panel should pass `labels`\n * only to change a word, never to translate the screen.\n */\nconst LABELS = {\n title: 'Conta',\n subtitle: 'Quem você é, como você entra e onde a sua sessão está aberta.',\n close: 'Fechar',\n\n profileSection: 'Perfil',\n avatar: 'Foto',\n name: 'Nome',\n email: 'E-mail',\n edit: 'Alterar',\n save: 'Salvar',\n cancel: 'Cancelar',\n remove: 'Remover',\n notDefined: 'Não definido',\n namePlaceholder: 'Seu nome',\n nameHint: 'Aparece no cartão da conta e para quem divide uma organização com você. Enter salva, Esc cancela.',\n nameRequired: 'Digite um nome.',\n emailHint: 'É para onde vai o código de acesso, por isso não muda por aqui.',\n avatarPrompt: 'Arraste uma imagem ou clique para escolher',\n avatarHint: 'JPG, PNG, GIF ou WebP, até {size}. Ela aparece em todos os painéis.',\n avatarInvalidType: 'Escolha uma imagem: JPG, PNG, GIF ou WebP.',\n avatarTooLarge: 'Imagem grande demais. O máximo é {size}.',\n\n signInSection: 'Formas de entrar',\n codeMethod: 'Código',\n codeByEmail: 'Por e-mail',\n alwaysOn: 'Sempre ativo',\n notConnected: 'Não conectado',\n connect: 'Conectar',\n disconnect: 'Desconectar',\n\n sessionsSection: 'Sessões',\n devices: 'Aparelhos',\n showSessions: 'Ver sessões',\n hideSessions: 'Ocultar',\n thisDevice: 'Este aparelho',\n end: 'Encerrar',\n since: 'desde',\n unknownIP: 'IP desconhecido',\n loadingSessions: 'Carregando as sessões…',\n noSessionsFound: 'Nenhuma sessão encontrada.',\n confirmEndBody: 'Quem estiver nesses aparelhos volta para a tela de entrar. Este aparelho continua conectado.',\n genericFailure: 'Não foi possível concluir. Tente de novo.',\n}\n\nconst PROVIDER_MARKS = { google: IconBrandGoogle, github: IconBrandGithub }\nconst DEVICE_MARKS = { desktop: IconDeviceLaptop, phone: IconDeviceMobile, tablet: IconDeviceTablet }\n\nconst color = token => (token === 'transparent' ? 'transparent' : `var(--mantine-color-${token.replace('.', '-')})`)\n\n/*\n * The action buttons, as data. Hover and keyboard focus share the same look,\n * like the account card's rows. A destructive action keeps its red text on\n * hover and only gains a light red ground: turning the text black while the\n * border turned red read as a different button.\n */\nconst TONES = {\n default: { rest: { text: 'gray.9', border: 'gray.3', ground: 'transparent' }, active: { border: 'gray.9' } },\n dark: { rest: { text: 'white', border: 'gray.9', ground: 'gray.9' }, active: { border: 'gray.7', ground: 'gray.7' } },\n quiet: { rest: { text: 'gray.6', border: 'transparent', ground: 'transparent' }, active: { text: 'gray.9', border: 'gray.3' } },\n danger: { rest: { text: 'red.8', border: 'transparent', ground: 'transparent' }, active: { ground: 'red.0', border: 'red.2' } },\n dangerOutline: { rest: { text: 'red.8', border: 'gray.3', ground: 'transparent' }, active: { ground: 'red.0', border: 'red.2' } },\n dangerFill: { rest: { text: 'white', border: 'red.8', ground: 'red.8' }, active: { border: 'red.9', ground: 'red.9' } },\n}\n\nfunction ActionButton({ tone = 'default', loading = false, disabled = false, children, style, ...others }) {\n const [isActive, setIsActive] = useState(false)\n const isBlocked = disabled || loading\n const look = { ...TONES[tone].rest, ...(isActive && !isBlocked ? TONES[tone].active : {}) }\n\n return (\n <UnstyledButton\n disabled={isBlocked}\n onMouseEnter={() => setIsActive(true)}\n onMouseLeave={() => setIsActive(false)}\n onFocus={() => setIsActive(true)}\n onBlur={() => setIsActive(false)}\n style={{\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 6,\n padding: '5px 12px',\n fontSize: 12,\n fontWeight: 700,\n lineHeight: 1.5,\n whiteSpace: 'nowrap',\n borderRadius: 0,\n color: color(look.text),\n background: color(look.ground),\n border: `1px solid ${color(look.border)}`,\n opacity: disabled ? 0.4 : 1,\n cursor: isBlocked ? 'default' : 'pointer',\n ...style,\n }}\n {...others}\n >\n {loading && (\n <Loader\n size={10}\n color=\"currentColor\"\n />\n )}\n {children}\n </UnstyledButton>\n )\n}\n\nfunction SectionLabel({ children, note }) {\n return (\n <Group\n justify=\"space-between\"\n align=\"baseline\"\n gap={8}\n mb={4}\n >\n <Text\n fz={11}\n fw={800}\n tt=\"uppercase\"\n lts=\"1.5px\"\n c=\"gray.4\"\n >\n {children}\n </Text>\n {note && (\n <Text\n fz={12}\n fw={500}\n c=\"gray.5\"\n >\n {note}\n </Text>\n )}\n </Group>\n )\n}\n\nfunction Section({ label, note, isFirst, children }) {\n return (\n <Box\n px={24}\n pt={16}\n pb={8}\n style={isFirst ? undefined : { borderTop: '1px solid var(--mantine-color-gray-2)' }}\n >\n <SectionLabel note={note}>{label}</SectionLabel>\n {children}\n </Box>\n )\n}\n\nconst rowDivider = { borderTop: '1px solid var(--mantine-color-gray-2)' }\n\n/** A label, a value and an optional action, on the same 88px label column. */\nfunction Row({ label, children, action, isFirst }) {\n return (\n <Box\n py={10}\n mih={52}\n style={{ display: 'grid', gridTemplateColumns: label ? '88px 1fr auto' : '1fr auto', alignItems: 'center', gap: 12, ...(isFirst ? {} : rowDivider) }}\n >\n {label && (\n <Text\n fz={12}\n fw={500}\n c=\"gray.5\"\n >\n {label}\n </Text>\n )}\n <Box\n fz={13}\n fw={500}\n c=\"gray.9\"\n style={{ minWidth: 0, overflowWrap: 'anywhere' }}\n >\n {children}\n </Box>\n {action || <span />}\n </Box>\n )\n}\n\nfunction Hint({ children, c = 'gray.5' }) {\n return (\n <Text\n fz={12}\n fw={500}\n c={c}\n mt={2}\n >\n {children}\n </Text>\n )\n}\n\n/*\n * A failure is shown where it happened, on the screen itself. Five of the\n * seven panels passed no `onError`, and a rejected photo or a failed rename\n * vanished without a word.\n */\nfunction FailureNote({ failure, section }) {\n if (failure?.section !== section) return null\n return (\n <Text\n role=\"alert\"\n fz={12}\n fw={600}\n c=\"red.8\"\n mt={4}\n >\n {failure.message}\n </Text>\n )\n}\n\nfunction Chip({ children, tone = 'outline' }) {\n const looks = {\n outline: { c: 'gray.6', bg: 'transparent', border: 'gray.3' },\n dark: { c: 'white', bg: 'gray.9', border: 'gray.9' },\n good: { c: 'teal.9', bg: 'teal.0', border: 'teal.2' },\n }\n const look = looks[tone]\n return (\n <Text\n component=\"span\"\n fz={10}\n fw={800}\n tt=\"uppercase\"\n lts=\"1.2px\"\n lh={1.6}\n px={6}\n c={look.c}\n bg={look.bg}\n style={{ border: `1px solid ${color(look.border)}`, whiteSpace: 'nowrap', display: 'inline-block' }}\n >\n {children}\n </Text>\n )\n}\n\n/** An icon and a label, side by side, with an optional line under the label. */\nfunction WithIcon({ icon: Icon, children, detail }) {\n return (\n <Group\n gap={10}\n wrap=\"nowrap\"\n align={detail ? 'flex-start' : 'center'}\n >\n <Icon\n size={18}\n stroke={1.5}\n style={{ flex: 'none', color: 'var(--mantine-color-gray-5)', marginTop: detail ? 1 : 0 }}\n />\n <Box style={{ minWidth: 0 }}>\n {children}\n {detail && <Hint>{detail}</Hint>}\n </Box>\n </Group>\n )\n}\n\nfunction SquareAvatar({ src, initials, size }) {\n return (\n <Avatar\n src={src || null}\n alt=\"\"\n size={size}\n radius={0}\n color=\"gray.9\"\n variant=\"filled\"\n styles={{ root: { borderRadius: 0, flex: 'none' }, placeholder: { fontSize: Math.round(size / 3), fontWeight: 800 } }}\n >\n {initials}\n </Avatar>\n )\n}\n\nconst formatSize = bytes => `${Math.round(bytes / 1024)} KB`\n\n/**\n * @param {object} props\n * @param {'modal'|'card'} [props.variant='modal']\n * @param {boolean} [props.opened] - Visibility (modal only)\n * @param {Function} [props.onClose] - Closing (modal only)\n * @param {Function} [props.onProfileUpdate] - Receives `{ name }` or `{ image }`\n * @param {Function} [props.onSessionRevoked] - Receives the ended session's id\n * @param {Function} [props.onOtherSessionsRevoked]\n * @param {Function} [props.onProviderUnlinked] - Receives the provider id\n * @param {Function} [props.onError] - Receives the Error and `{ section, isShownOnScreen: true }`:\n * the screen already shows the message, so a panel should not toast it again\n * @param {boolean} [props.showAvatar=true]\n * @param {boolean} [props.showName=true]\n * @param {boolean} [props.showEmail=true]\n * @param {boolean} [props.showSignInMethods=true] - Drawn only when the application enabled a provider\n * @param {boolean} [props.showSessions=true]\n * @param {Partial<typeof LABELS>} [props.labels] - To change a word; the defaults are already Portuguese\n * @param {string} [props.title]\n * @param {string} [props.subtitle]\n * @param {string|import('react').ReactNode} [props.logo] - Card variant only\n * @param {number} [props.logoHeight=28]\n * @param {number} [props.width=520]\n * @param {number} [props.maxAvatarSize=512000] - In bytes\n * @param {import('react').ReactNode} [props.customSections] - Rendered after the built-in sections\n */\nexport default function UserProfile({\n variant = 'modal',\n opened,\n onClose,\n\n onProfileUpdate,\n onSessionRevoked,\n onOtherSessionsRevoked,\n onProviderUnlinked,\n onError,\n\n showAvatar = true,\n showName = true,\n showEmail = true,\n showSignInMethods = true,\n showSessions = true,\n\n labels = {},\n title,\n subtitle,\n logo,\n logoHeight = 28,\n width = 520,\n maxAvatarSize = 500 * 1024,\n customSections,\n\n ...containerProps\n}) {\n const t = { ...LABELS, ...labels }\n const isVisible = variant === 'card' || Boolean(opened)\n\n const { user, updateProfile, loadingUpdateProfile } = useUser()\n const { currentSession, sessions, listSessions, getSession, revokeSession, revokeOtherSessions, loadingListSessions, loadingRevokeSession } = useSessions()\n const identity = describeUser(user)\n\n // One editor open at a time: 'name', 'avatar' or null.\n const [editing, setEditing] = useState(null)\n const [avatarPreview, setAvatarPreview] = useState(null)\n const [isDragging, setIsDragging] = useState(false)\n const [areSessionsOpen, setAreSessionsOpen] = useState(false)\n const [isSessionsRowActive, setIsSessionsRowActive] = useState(false)\n const [isConfirmingEnd, setIsConfirmingEnd] = useState(false)\n const [providers, setProviders] = useState([])\n const [linked, setLinked] = useState([])\n const [pendingProvider, setPendingProvider] = useState(null)\n const [failure, setFailure] = useState(null)\n const sessionsListId = useId()\n\n const nameForm = useForm({\n initialValues: { name: '' },\n validate: { name: value => (value.trim() ? null : t.nameRequired) },\n })\n\n // Sessions and sign-in methods load when the screen is shown, not before.\n useEffect(() => {\n if (!isVisible) return\n if (showSessions) {\n getSession().catch(error => console.warn('[AuthSDK] Failed to read the current session:', error.message))\n listSessions().catch(error => console.warn('[AuthSDK] Failed to list sessions:', error.message))\n }\n if (showSignInMethods) refreshSignInMethods()\n }, [isVisible, showSessions, showSignInMethods])\n\n // Closing the modal resets it: the next opening starts at rest.\n useEffect(() => {\n if (isVisible) return\n closeEditor()\n setAreSessionsOpen(false)\n setIsConfirmingEnd(false)\n }, [isVisible])\n\n async function refreshSignInMethods() {\n const available = await getSocialProviders()\n setProviders(available)\n if (available.length === 0) return\n try {\n setLinked(await getLinkedProviders())\n } catch (error) {\n console.warn('[AuthSDK] Failed to list linked providers:', error.message)\n setLinked([])\n }\n }\n\n /*\n * `onError` still fires, with `isShownOnScreen: true`: a panel that wants a\n * log or a metric has it, and knows not to show a second message.\n */\n function fail(section, error) {\n setFailure({ section, message: error?.message || t.genericFailure })\n onError?.(error, { section, isShownOnScreen: true })\n }\n\n function closeEditor() {\n setFailure(null)\n setEditing(null)\n setAvatarPreview(null)\n setIsDragging(false)\n nameForm.reset()\n }\n\n function openEditor(section) {\n closeEditor()\n setEditing(section)\n if (section === 'name') nameForm.setValues({ name: identity.name })\n }\n\n async function handleSaveName(values) {\n const name = values.name.trim()\n try {\n await updateProfile({ name })\n closeEditor()\n onProfileUpdate?.({ name })\n } catch (error) {\n fail('name', error)\n }\n }\n\n function handleAvatarFile(file) {\n if (!file) return\n setFailure(null)\n if (!file.type?.startsWith('image/')) {\n fail('avatar', new Error(t.avatarInvalidType))\n return\n }\n if (file.size > maxAvatarSize) {\n fail('avatar', new Error(t.avatarTooLarge.replace('{size}', formatSize(maxAvatarSize))))\n return\n }\n const reader = new FileReader()\n reader.onloadend = () => setAvatarPreview(reader.result)\n reader.readAsDataURL(file)\n }\n\n async function saveAvatar(image) {\n try {\n await updateProfile({ image })\n closeEditor()\n onProfileUpdate?.({ image })\n } catch (error) {\n fail('avatar', error)\n }\n }\n\n async function handleUnlink(provider) {\n setPendingProvider(provider)\n setFailure(null)\n try {\n await unlinkSocialProvider(provider)\n setLinked(current => current.filter(item => item.provider !== provider))\n onProviderUnlinked?.(provider)\n } catch (error) {\n fail('signIn', error)\n } finally {\n setPendingProvider(null)\n }\n }\n\n async function handleLink(provider) {\n setPendingProvider(provider)\n setFailure(null)\n try {\n // Leaves for the provider's consent screen; the page navigates away.\n await startSocialLink(provider)\n } catch (error) {\n setPendingProvider(null)\n fail('signIn', error)\n }\n }\n\n async function handleEndSession(sessionId) {\n setFailure(null)\n try {\n await revokeSession(sessionId)\n onSessionRevoked?.(sessionId)\n } catch (error) {\n fail('sessions', error)\n }\n }\n\n async function handleEndOthers() {\n setFailure(null)\n try {\n await revokeOtherSessions()\n setIsConfirmingEnd(false)\n onOtherSessionsRevoked?.()\n } catch (error) {\n fail('sessions', error)\n }\n }\n\n if (!user) return null\n\n const ordered = orderSessions(sessions, currentSession?.id)\n const current = ordered.find(item => item.id === currentSession?.id)\n const othersCount = ordered.filter(item => item.id !== currentSession?.id).length\n const hasProfile = showAvatar || showName || showEmail\n const hasSignInMethods = showSignInMethods && providers.length > 0\n\n const sessionsSummary = current ? `${deviceLabel(describeDevice(current.userAgent))} (${t.thisDevice.toLowerCase()})${othersCount ? ` e mais ${othersCount}` : ''}` : null\n\n const header = (\n <Group\n align=\"flex-start\"\n wrap=\"nowrap\"\n gap={12}\n px={24}\n pt={20}\n pb={16}\n style={{ borderBottom: '1px solid var(--mantine-color-gray-2)' }}\n >\n {variant === 'card' &&\n logo &&\n (typeof logo === 'string' ? (\n <Image\n src={logo}\n alt=\"\"\n h={logoHeight}\n w=\"auto\"\n fit=\"contain\"\n />\n ) : (\n logo\n ))}\n <Box style={{ flex: 1, minWidth: 0 }}>\n {/*\n * In the modal the title is Mantine's own, which is what the\n * dialog's `aria-labelledby` points to: a screen reader\n * announces \"Conta\" when the screen opens.\n */}\n <Text\n component={variant === 'modal' ? Modal.Title : 'h2'}\n m={0}\n fz={20}\n fw={900}\n lts=\"-0.03em\"\n lh={1.2}\n c=\"gray.9\"\n >\n {title || t.title}\n </Text>\n <Hint>{subtitle || t.subtitle}</Hint>\n </Box>\n {variant === 'modal' && (\n <ActionButton\n aria-label={t.close}\n onClick={onClose}\n style={{ width: 32, height: 32, padding: 0, flex: 'none' }}\n >\n <IconX\n size={16}\n stroke={1.5}\n />\n </ActionButton>\n )}\n </Group>\n )\n\n const identityStrip = (\n <Group\n gap={14}\n wrap=\"nowrap\"\n px={24}\n py={18}\n bg=\"gray.1\"\n style={{ borderBottom: '1px solid var(--mantine-color-gray-2)' }}\n >\n <SquareAvatar\n src={identity.image}\n initials={identity.initials}\n size={48}\n />\n <Box style={{ minWidth: 0 }}>\n <Text\n fz={15}\n fw={800}\n c=\"gray.9\"\n lh={1.3}\n truncate=\"end\"\n >\n {identity.title}\n </Text>\n {identity.hasRealName && identity.email && (\n <Text\n fz={12}\n fw={500}\n c=\"gray.5\"\n truncate=\"end\"\n >\n {identity.email}\n </Text>\n )}\n </Box>\n </Group>\n )\n\n const avatarEditor = (\n <Stack\n gap={10}\n py={12}\n >\n <Text\n fz={12}\n fw={700}\n c=\"gray.9\"\n >\n {t.avatar}\n </Text>\n <FileButton\n onChange={handleAvatarFile}\n accept=\"image/png,image/jpeg,image/gif,image/webp\"\n >\n {props => (\n <UnstyledButton\n {...props}\n onDragOver={event => {\n event.preventDefault()\n setIsDragging(true)\n }}\n onDragLeave={() => setIsDragging(false)}\n onDrop={event => {\n event.preventDefault()\n setIsDragging(false)\n handleAvatarFile(event.dataTransfer.files?.[0])\n }}\n style={{\n display: 'flex',\n alignItems: 'center',\n gap: 14,\n padding: 14,\n borderRadius: 0,\n background: isDragging ? 'var(--mantine-color-gray-2)' : 'var(--mantine-color-gray-1)',\n border: `1px dashed var(--mantine-color-${isDragging ? 'gray-9' : 'gray-4'})`,\n }}\n >\n <SquareAvatar\n src={avatarPreview || identity.image}\n initials={identity.initials}\n size={64}\n />\n <Box>\n <Text\n fz={13}\n fw={700}\n c=\"gray.9\"\n >\n {t.avatarPrompt}\n </Text>\n <Hint>{t.avatarHint.replace('{size}', formatSize(maxAvatarSize))}</Hint>\n </Box>\n </UnstyledButton>\n )}\n </FileButton>\n <FailureNote\n failure={failure}\n section=\"avatar\"\n />\n <Group\n justify=\"flex-end\"\n gap={8}\n >\n {identity.image && !avatarPreview && (\n <ActionButton\n tone=\"danger\"\n loading={loadingUpdateProfile}\n onClick={() => saveAvatar('')}\n style={{ marginRight: 'auto' }}\n >\n {t.remove}\n </ActionButton>\n )}\n <ActionButton\n tone=\"quiet\"\n onClick={closeEditor}\n >\n {t.cancel}\n </ActionButton>\n <ActionButton\n tone=\"dark\"\n loading={loadingUpdateProfile}\n disabled={!avatarPreview}\n onClick={() => saveAvatar(avatarPreview)}\n >\n {t.save}\n </ActionButton>\n </Group>\n </Stack>\n )\n\n const nameEditor = (\n <form\n onSubmit={nameForm.onSubmit(handleSaveName)}\n style={{ ...rowDivider, padding: '12px 0 14px' }}\n >\n <Stack gap={10}>\n <TextInput\n label={t.name}\n placeholder={t.namePlaceholder}\n autoComplete=\"name\"\n data-autofocus\n autoFocus\n radius={0}\n size=\"sm\"\n styles={{ label: { fontSize: 12, fontWeight: 700, color: 'var(--mantine-color-gray-9)', marginBottom: 6 } }}\n onKeyDown={event => {\n if (event.key !== 'Escape') return\n event.stopPropagation()\n closeEditor()\n }}\n {...nameForm.getInputProps('name')}\n />\n <Hint>{t.nameHint}</Hint>\n <FailureNote\n failure={failure}\n section=\"name\"\n />\n <Group\n justify=\"flex-end\"\n gap={8}\n >\n <ActionButton\n tone=\"quiet\"\n onClick={closeEditor}\n >\n {t.cancel}\n </ActionButton>\n <ActionButton\n tone=\"dark\"\n type=\"submit\"\n loading={loadingUpdateProfile}\n >\n {t.save}\n </ActionButton>\n </Group>\n </Stack>\n </form>\n )\n\n const sessionsList = (\n <Box\n id={sessionsListId}\n mb={10}\n >\n {loadingListSessions && ordered.length === 0 ? (\n <Hint>{t.loadingSessions}</Hint>\n ) : ordered.length === 0 ? (\n <Hint>{t.noSessionsFound}</Hint>\n ) : (\n ordered.map((item, index) => {\n const device = describeDevice(item.userAgent)\n const isCurrent = item.id === currentSession?.id\n const since = formatSessionStart(item.createdAt)\n return (\n <Row\n key={item.id}\n isFirst={index === 0}\n action={\n isCurrent ? null : (\n <ActionButton\n tone=\"danger\"\n loading={loadingRevokeSession === item.id}\n onClick={() => handleEndSession(item.id)}\n aria-label={`${t.end} ${deviceLabel(device)}`}\n >\n {t.end}\n </ActionButton>\n )\n }\n >\n <WithIcon\n icon={DEVICE_MARKS[device.kind] || IconDeviceDesktop}\n detail={`${item.ipAddress ? `IP ${item.ipAddress}` : t.unknownIP}${since ? ` · ${t.since} ${since}` : ''}`}\n >\n <Group\n gap={6}\n wrap=\"wrap\"\n >\n <span>{deviceLabel(device)}</span>\n {isCurrent && <Chip tone=\"dark\">{t.thisDevice}</Chip>}\n </Group>\n </WithIcon>\n </Row>\n )\n })\n )}\n\n <FailureNote\n failure={failure}\n section=\"sessions\"\n />\n\n {othersCount > 0 &&\n current &&\n (isConfirmingEnd ? (\n <Stack\n role=\"alertdialog\"\n aria-label={endOthersQuestion(othersCount)}\n gap={10}\n p={12}\n mt={4}\n bg=\"red.0\"\n style={{ border: '1px solid var(--mantine-color-red-2)' }}\n >\n <Text\n fz={12}\n fw={500}\n c=\"gray.7\"\n >\n <Text\n span\n inherit\n fw={800}\n c=\"gray.9\"\n >\n {endOthersQuestion(othersCount)}\n </Text>{' '}\n {t.confirmEndBody}\n </Text>\n <Group\n justify=\"flex-end\"\n gap={8}\n >\n <ActionButton\n tone=\"quiet\"\n onClick={() => setIsConfirmingEnd(false)}\n >\n {t.cancel}\n </ActionButton>\n <ActionButton\n tone=\"dangerFill\"\n loading={loadingRevokeSession === 'all'}\n onClick={handleEndOthers}\n >\n {endOthersConfirm(othersCount)}\n </ActionButton>\n </Group>\n </Stack>\n ) : (\n <Group\n justify=\"flex-end\"\n pt={4}\n pb={4}\n >\n <ActionButton\n tone=\"dangerOutline\"\n onClick={() => setIsConfirmingEnd(true)}\n >\n {endOthersAction(othersCount)}\n </ActionButton>\n </Group>\n ))}\n </Box>\n )\n\n const content = (\n <>\n {header}\n {identityStrip}\n\n {hasProfile && (\n <Section\n label={t.profileSection}\n isFirst\n >\n {showAvatar &&\n (editing === 'avatar' ? (\n avatarEditor\n ) : (\n <Row\n label={t.avatar}\n isFirst\n action={<ActionButton onClick={() => openEditor('avatar')}>{t.edit}</ActionButton>}\n >\n <SquareAvatar\n src={identity.image}\n initials={identity.initials}\n size={32}\n />\n </Row>\n ))}\n {showName &&\n (editing === 'name' ? (\n nameEditor\n ) : (\n <Row\n label={t.name}\n isFirst={!showAvatar}\n action={<ActionButton onClick={() => openEditor('name')}>{t.edit}</ActionButton>}\n >\n {identity.name || (\n <Text\n span\n inherit\n c=\"gray.5\"\n >\n {t.notDefined}\n </Text>\n )}\n </Row>\n ))}\n {showEmail && (\n <Row\n label={t.email}\n isFirst={!showAvatar && !showName}\n >\n {identity.email}\n {/*\n * The email is not edited here: it is where the\n * sign-in code arrives, so changing it means\n * changing identity, and that requires proving\n * possession of the new inbox through the sign-in\n * flow. The hint says so, because a person looks\n * for the button and finds nothing.\n */}\n <Hint>{t.emailHint}</Hint>\n </Row>\n )}\n </Section>\n )}\n\n {hasSignInMethods && (\n <Section\n label={t.signInSection}\n isFirst={!hasProfile}\n >\n <Row\n label={t.codeMethod}\n isFirst\n action={<Chip tone=\"good\">{t.alwaysOn}</Chip>}\n >\n <WithIcon icon={IconMail}>{t.codeByEmail}</WithIcon>\n </Row>\n {providers.map(item => {\n const link = linked.find(entry => entry.provider === item.provider)\n return (\n <Row\n key={item.provider}\n label={item.name}\n action={\n link ? (\n <ActionButton\n tone=\"quiet\"\n loading={pendingProvider === item.provider}\n onClick={() => handleUnlink(item.provider)}\n aria-label={`${t.disconnect} ${item.name}`}\n >\n {t.disconnect}\n </ActionButton>\n ) : (\n <ActionButton\n loading={pendingProvider === item.provider}\n onClick={() => handleLink(item.provider)}\n aria-label={`${t.connect} ${item.name}`}\n >\n {t.connect}\n </ActionButton>\n )\n }\n >\n <WithIcon icon={PROVIDER_MARKS[item.provider] || IconLink}>\n {link ? (\n link.email || item.name\n ) : (\n <Text\n span\n inherit\n c=\"gray.5\"\n >\n {t.notConnected}\n </Text>\n )}\n </WithIcon>\n </Row>\n )\n })}\n <FailureNote\n failure={failure}\n section=\"signIn\"\n />\n </Section>\n )}\n\n {showSessions && (\n <Section\n label={t.sessionsSection}\n isFirst={!hasProfile && !hasSignInMethods}\n >\n {/*\n * Grouped on one line that already says how many and where\n * the current one is; a click opens the list right below.\n */}\n <UnstyledButton\n aria-expanded={areSessionsOpen}\n aria-controls={sessionsListId}\n onClick={() => {\n setAreSessionsOpen(isOpen => !isOpen)\n setIsConfirmingEnd(false)\n }}\n onMouseEnter={() => setIsSessionsRowActive(true)}\n onMouseLeave={() => setIsSessionsRowActive(false)}\n onFocus={() => setIsSessionsRowActive(true)}\n onBlur={() => setIsSessionsRowActive(false)}\n w=\"100%\"\n style={{ display: 'block', borderRadius: 0 }}\n >\n <Row\n label={t.devices}\n isFirst\n action={\n <Box\n component=\"span\"\n style={{\n display: 'inline-flex',\n alignItems: 'center',\n gap: 4,\n padding: '5px 12px',\n fontSize: 12,\n fontWeight: 700,\n color: 'var(--mantine-color-gray-9)',\n // The whole line is the button; the pill only shows it.\n border: `1px solid var(--mantine-color-${isSessionsRowActive ? 'gray-9' : 'gray-3'})`,\n whiteSpace: 'nowrap',\n }}\n >\n {areSessionsOpen ? t.hideSessions : t.showSessions}\n <IconChevronDown\n size={14}\n stroke={1.5}\n style={{ transform: areSessionsOpen ? 'rotate(180deg)' : 'none', transition: 'transform 150ms ease' }}\n />\n </Box>\n }\n >\n <WithIcon\n icon={IconDeviceLaptop}\n detail={sessionsSummary}\n >\n {loadingListSessions && ordered.length === 0 ? t.loadingSessions : countSessions(ordered.length)}\n </WithIcon>\n </Row>\n </UnstyledButton>\n {areSessionsOpen && sessionsList}\n </Section>\n )}\n\n {customSections}\n </>\n )\n\n if (variant === 'modal') {\n return (\n <Modal.Root\n opened={Boolean(opened)}\n onClose={onClose}\n size={width}\n // With an editor open, Esc belongs to the editor: it cancels the\n // edit and leaves the screen open. Mantine listens for Esc on its\n // own, so stopping the key in the field is not enough.\n closeOnEscape={!editing && !isConfirmingEnd}\n {...containerProps}\n >\n <Modal.Overlay\n backgroundOpacity={0.5}\n blur={4}\n />\n <Modal.Content\n radius={0}\n style={{ border: '1px solid var(--mantine-color-gray-3)' }}\n >\n <Modal.Body p={0}>{content}</Modal.Body>\n </Modal.Content>\n </Modal.Root>\n )\n }\n\n return (\n <Paper\n withBorder\n radius={0}\n p={0}\n w={width}\n maw=\"100%\"\n {...containerProps}\n >\n {content}\n </Paper>\n )\n}\n\n/* The only texts that change with the count, so they are functions, not labels. */\nfunction endOthersAction(count) {\n return count === 1 ? 'Encerrar a outra' : `Encerrar as outras ${count}`\n}\nfunction endOthersQuestion(count) {\n return count === 1 ? 'Encerrar 1 sessão?' : `Encerrar ${count} sessões?`\n}\nfunction endOthersConfirm(count) {\n return count === 1 ? 'Encerrar 1 sessão' : `Encerrar ${count} sessões`\n}\n","import { Avatar, Box, Group, Stack, Text, UnstyledButton, Anchor } from '@mantine/core'\nimport { IconBuilding, IconCreditCard, IconLogout, IconUser } from '@tabler/icons-react'\n\nimport { TERMS_URL } from '../terms.js'\nimport { describeUser } from '../user-identity.js'\n\n/*\n * The account card — what opens from the footer of every panel's sidebar.\n *\n * \"Context first\": who is signed in, in which organization and on which plan,\n * then one list of actions with \"Sair\" at the end. Decided on 2026-09-25 after\n * comparing Clerk, Supabase, shadcn, Vercel Geist, Linear and Stripe; the\n * previous card got six things wrong, each fixed here:\n *\n * 1. The avatar is square, like everything else in the system. The panels no\n * longer override `radius=\"xl\"` in their themes.\n * 2. \"Sair\" is the last row, with its word, after a divider — never an\n * unlabelled icon in the corner where the hand goes to close the card.\n * 3. The title is the NAME, or the email when there is none. A name made up\n * from the email (\"maciel.ciro\") showed the same fact twice and read as a\n * real name.\n * 4. Nothing goes below 12px, the system's floor for content.\n * 5. One list, not two cards: the panel's own rows (docs, support) come in\n * through `items`, as data, and sit in their own group.\n * 6. The provenance line is legible and can be turned off (`branded`), and\n * carries the link to the terms, the same document the sign-in cites.\n *\n * Every prop is data, never JSX (Zen law 4): a panel that could inject markup\n * would inject chrome, and the seven cards would drift apart again.\n */\n\nconst ROLE_LABELS = { owner: 'Dono', admin: 'Administrador', member: 'Membro' }\n\n/*\n * From this share of the limit on, the strip invites to upgrade. Below it the\n * strip only informs: \"Assinatura\" is the door that is always there, and a\n * second link to the same modal right above it was two doors to one room.\n */\nconst UPGRADE_THRESHOLD = 0.8\n\n/**\n * @typedef {Object} UserInformationItem\n * @property {string} [id] - Stable key\n * @property {string} label - The row's text\n * @property {Function} [icon] - A Tabler icon component\n * @property {Function} onClick\n *\n * @typedef {Object} UserInformationPlan\n * @property {string} [name] - \"Pro\", \"Starter\"… Shown as the badge\n * @property {number} [used] - How many of the plan's resources are in use\n * @property {number|null} [limit] - The plan's ceiling; `null` hides the meter\n * @property {string} [unit] - What is counted, in the plural: \"projetos\"\n * @property {boolean} [canUpgrade=false] - There is a plan above this one. Without\n * it the invite never shows, however full the plan is: on the last rung there\n * is nowhere to go\n * @property {string} [actionLabel='Fazer upgrade']\n * @property {Function} [onClick] - Opens the plans. The invite shows only with\n * `canUpgrade` and usage at 80% of the limit or more\n *\n * @typedef {Object} UserInformationOrganization\n * @property {string} name\n * @property {string} [role] - `owner`, `admin`, `member`, or already a label\n */\n\n/**\n * @param {Object} props\n * @param {Object} props.user - The signed-in user (`name`, `email`, `image`)\n * @param {Function} props.signOut\n * @param {Function} [props.onAccountClick]\n * @param {Function} [props.onBillingClick]\n * @param {UserInformationItem[]} [props.items] - The panel's own rows, shown in their own group\n * @param {UserInformationPlan} [props.plan] - The plan strip; omitted, the strip is not drawn\n * @param {UserInformationOrganization} [props.organization] - Where the person is acting\n * @param {boolean} [props.branded=true] - The footer: \"Protegido por Auth\" and the terms link\n * @param {string|null} [props.termsUrl] - Where \"Termos\" points; `null` removes the link\n * @param {string} [props.termsLabel='Termos']\n * @param {string} [props.accountLabel='Conta']\n * @param {string} [props.billingLabel='Assinatura']\n * @param {string} [props.signOutLabel='Sair']\n */\nexport function UserInformation({\n user,\n signOut,\n onAccountClick,\n onBillingClick,\n items = [],\n plan,\n organization,\n branded = true,\n termsUrl = TERMS_URL,\n termsLabel = 'Termos',\n accountLabel = 'Conta',\n billingLabel = 'Assinatura',\n signOutLabel = 'Sair',\n // Kept so existing calls keep working. The card has one density now: the\n // popover's. `padded={false}` still removes the outer padding.\n padded = true,\n size, // eslint-disable-line no-unused-vars -- accepted and ignored, see above\n style,\n ...others\n}) {\n if (!user) return null\n\n const { email, hasRealName, title, initials, image } = describeUser(user)\n\n const baseRows = [onAccountClick && { id: 'account', label: accountLabel, icon: IconUser, onClick: onAccountClick }, onBillingClick && { id: 'billing', label: billingLabel, icon: IconCreditCard, onClick: onBillingClick }].filter(\n Boolean\n )\n\n const panelRows = items.filter(item => item && item.label && typeof item.onClick === 'function')\n\n return (\n <Box\n w={288}\n maw=\"100%\"\n style={style}\n {...others}\n >\n {/* Who */}\n <Group\n wrap=\"nowrap\"\n gap={10}\n px={padded ? 16 : 0}\n py={14}\n >\n <Avatar\n src={image}\n alt=\"\"\n size={32}\n radius={0}\n color=\"gray.9\"\n variant=\"filled\"\n styles={{ root: { borderRadius: 0 }, placeholder: { fontSize: 12, fontWeight: 800 } }}\n >\n {initials}\n </Avatar>\n\n <Box style={{ flex: 1, minWidth: 0 }}>\n <Text\n fz={13}\n fw={800}\n c=\"gray.9\"\n lh={1.3}\n truncate=\"end\"\n >\n {title}\n </Text>\n {hasRealName && email && (\n <Text\n fz={12}\n fw={500}\n c=\"gray.5\"\n lh={1.4}\n truncate=\"end\"\n >\n {email}\n </Text>\n )}\n </Box>\n </Group>\n\n {/* Where, and on which plan */}\n {(organization?.name || plan) && (\n <ContextStrip\n organization={organization}\n plan={plan}\n padded={padded}\n />\n )}\n\n {/* What — account and billing, then the panel's rows, then leaving */}\n <Box\n role=\"menu\"\n aria-label=\"Conta\"\n onKeyDown={moveFocus}\n >\n {baseRows.length > 0 && (\n <RowGroup\n rows={baseRows}\n hasDivider={!organization?.name && !plan}\n />\n )}\n {panelRows.length > 0 && (\n <RowGroup\n rows={panelRows}\n hasDivider\n />\n )}\n {signOut && (\n <RowGroup\n rows={[{ id: 'sign-out', label: signOutLabel, icon: IconLogout, onClick: signOut }]}\n hasDivider\n />\n )}\n </Box>\n\n {branded && (\n <Group\n justify={termsUrl ? 'space-between' : 'center'}\n gap={8}\n px={16}\n py={10}\n bg=\"gray.1\"\n style={{ borderTop: '1px solid var(--mantine-color-gray-2)' }}\n >\n <Text\n fz={11}\n fw={500}\n c=\"gray.5\"\n >\n Protegido por{' '}\n <Text\n span\n inherit\n fw={800}\n c=\"gray.7\"\n >\n Auth\n </Text>\n </Text>\n {termsUrl && (\n <Anchor\n href={termsUrl}\n /*\n * A new tab, like the sign-in's notice: the card sits\n * over a working panel, and reading the terms must\n * not navigate away from it.\n */\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n fz={11}\n fw={500}\n c=\"gray.5\"\n underline=\"always\"\n >\n {termsLabel}\n </Anchor>\n )}\n </Group>\n )}\n </Box>\n )\n}\n\n/** The organization, the role and the plan's usage, on the alternate surface. */\nfunction ContextStrip({ organization, plan, padded }) {\n const role = organization?.role ? ROLE_LABELS[organization.role] || organization.role : null\n const hasMeter = plan && Number.isFinite(plan.used) && Number.isFinite(plan.limit) && plan.limit > 0\n const ratio = hasMeter ? Math.min(1, Math.max(0, plan.used / plan.limit)) : 0\n const isFull = hasMeter && plan.used >= plan.limit\n const showsInvite = hasMeter && plan.canUpgrade === true && typeof plan.onClick === 'function' && ratio >= UPGRADE_THRESHOLD\n /*\n * \"Limite atingido\" sits on the badge's line, whose left side is empty\n * when there is no organization. Next to the count it would wrap to two\n * lines beside the invite. With an organization there, it falls back to\n * the count.\n */\n const limitNoticeOnTop = isFull && !organization?.name\n\n return (\n <Stack\n gap={8}\n px={padded ? 16 : 0}\n py={12}\n bg=\"gray.1\"\n style={{ borderTop: '1px solid var(--mantine-color-gray-2)', borderBottom: '1px solid var(--mantine-color-gray-2)' }}\n >\n {(organization?.name || plan?.name) && (\n <Group\n gap={8}\n wrap=\"nowrap\"\n >\n {limitNoticeOnTop && (\n <Text\n fz={12}\n fw={700}\n c=\"red.8\"\n >\n Limite atingido\n </Text>\n )}\n {organization?.name && (\n <>\n <IconBuilding\n size={14}\n stroke={1.5}\n style={{ flex: 'none', color: 'var(--mantine-color-gray-5)' }}\n />\n <Text\n fz={12}\n fw={800}\n c=\"gray.9\"\n truncate=\"end\"\n style={{ minWidth: 0 }}\n >\n {organization.name}\n </Text>\n {role && (\n <Text\n fz={12}\n fw={500}\n c=\"gray.5\"\n style={{ flex: 'none' }}\n >\n · {role}\n </Text>\n )}\n </>\n )}\n {plan?.name && (\n <Text\n component=\"span\"\n fz={10}\n fw={800}\n tt=\"uppercase\"\n lts=\"1.5px\"\n c=\"white\"\n bg=\"gray.9\"\n px={6}\n lh={1.6}\n ml=\"auto\"\n style={{ flex: 'none' }}\n >\n {plan.name}\n </Text>\n )}\n </Group>\n )}\n\n {hasMeter && (\n <>\n <Box\n h={4}\n bg=\"gray.2\"\n role=\"meter\"\n aria-valuemin={0}\n aria-valuemax={plan.limit}\n aria-valuenow={plan.used}\n aria-label={plan.unit ? `${plan.unit} em uso` : 'Uso do plano'}\n >\n <Box\n h=\"100%\"\n w={`${ratio * 100}%`}\n bg={isFull ? 'red.8' : 'gray.9'}\n />\n </Box>\n <Group\n justify=\"space-between\"\n gap={8}\n wrap=\"nowrap\"\n >\n <Text\n fz={12}\n fw={isFull ? 700 : 500}\n c={isFull ? 'red.8' : 'gray.6'}\n >\n {`${plan.used} de ${plan.limit}${plan.unit ? ` ${plan.unit}` : ''}${isFull && !limitNoticeOnTop ? ' · limite atingido' : ''}`}\n </Text>\n {showsInvite && (\n <UnstyledButton\n onClick={plan.onClick}\n fz={11}\n fw={800}\n lts=\"0.5px\"\n c=\"white\"\n bg=\"gray.9\"\n px={8}\n py={3}\n lh={1.4}\n style={{ flex: 'none', whiteSpace: 'nowrap' }}\n >\n {plan.actionLabel || 'Fazer upgrade'}\n </UnstyledButton>\n )}\n </Group>\n </>\n )}\n </Stack>\n )\n}\n\nfunction RowGroup({ rows, hasDivider }) {\n return (\n <Stack\n gap={0}\n p={6}\n style={hasDivider ? { borderTop: '1px solid var(--mantine-color-gray-2)' } : undefined}\n >\n {rows.map(row => (\n <Row\n key={row.id || row.label}\n {...row}\n />\n ))}\n </Stack>\n )\n}\n\nfunction Row({ label, icon: Icon, onClick }) {\n return (\n <UnstyledButton\n role=\"menuitem\"\n onClick={onClick}\n px={10}\n py={7}\n w=\"100%\"\n style={{ display: 'flex', alignItems: 'center', gap: 10, borderRadius: 0 }}\n /*\n * Hover and keyboard focus share the same surface: a row reached\n * with the arrows must look exactly like the one under the mouse.\n */\n onMouseEnter={event => (event.currentTarget.style.background = 'var(--mantine-color-gray-1)')}\n onMouseLeave={event => (event.currentTarget.style.background = 'transparent')}\n onFocus={event => (event.currentTarget.style.background = 'var(--mantine-color-gray-1)')}\n onBlur={event => (event.currentTarget.style.background = 'transparent')}\n >\n {Icon && (\n <Icon\n size={16}\n stroke={1.5}\n style={{ flex: 'none', color: 'var(--mantine-color-gray-5)' }}\n />\n )}\n <Text\n fz={12}\n fw={500}\n c=\"gray.9\"\n truncate=\"end\"\n >\n {label}\n </Text>\n </UnstyledButton>\n )\n}\n\n/*\n * Arrow keys walk the rows, Home and End jump to the ends — the WAI-ARIA menu\n * pattern. Tab still leaves the card, so it never traps focus inside a popover\n * the panel owns.\n */\nfunction moveFocus(event) {\n const keys = ['ArrowDown', 'ArrowUp', 'Home', 'End']\n if (!keys.includes(event.key)) return\n\n const rows = Array.from(event.currentTarget.querySelectorAll('[role=\"menuitem\"]'))\n if (rows.length === 0) return\n\n event.preventDefault()\n const current = rows.indexOf(document.activeElement)\n const last = rows.length - 1\n const next = event.key === 'Home' ? 0 : event.key === 'End' ? last : event.key === 'ArrowDown' ? (current < last ? current + 1 : 0) : current > 0 ? current - 1 : last\n rows[next].focus()\n}\n\nexport default UserInformation\n","import { useAuth } from '../../AuthProvider.jsx'\n\n/**\n * Renderiza children apenas quando o usuário está autenticado\n * Equivalente ao <SignedIn> do Clerk\n */\nexport function SignedIn({ children }) {\n const { user, loading } = useAuth()\n if (loading || !user) return null\n return children\n}\n\nexport default SignedIn\n","import { useAuth } from '../../AuthProvider.jsx'\n\n/**\n * Renderiza children apenas quando o usuário NÃO está autenticado\n * Equivalente ao <SignedOut> do Clerk\n */\nexport function SignedOut({ children }) {\n const { user, loading } = useAuth()\n if (loading || user) return null\n return children\n}\n\nexport default SignedOut\n","import { useAuth } from '../../AuthProvider.jsx'\n\n/**\n * Renderiza children enquanto a autenticação está carregando\n * Equivalente ao <ClerkLoading> do Clerk\n */\nexport function AuthLoading({ children }) {\n const { loading } = useAuth()\n if (!loading) return null\n return children\n}\n\nexport default AuthLoading\n","import { useAuth } from '../../AuthProvider.jsx'\n\n/**\n * Renderiza children quando a autenticação terminou de carregar\n * Equivalente ao <ClerkLoaded> do Clerk\n */\nexport function AuthLoaded({ children }) {\n const { loading } = useAuth()\n if (loading) return null\n return children\n}\n\nexport default AuthLoaded\n","import { useNavigate } from 'react-router-dom'\n\n/**\n * Botão unstyled para navegação para página de login\n * Equivalente ao <SignInButton> do Clerk\n */\nexport function SignInButton({ children, redirectTo = '/login', ...props }) {\n const navigate = useNavigate()\n\n return (\n <button\n onClick={() => navigate(redirectTo)}\n {...props}\n >\n {children || 'Sign In'}\n </button>\n )\n}\n\nexport default SignInButton\n","import { useSignOut } from '../../AuthProvider.jsx'\n\n/**\n * Botão unstyled para fazer logout\n * Equivalente ao <SignOutButton> do Clerk\n */\nexport function SignOutButton({ children, onSignOut, ...props }) {\n const signOut = useSignOut()\n\n const handleClick = async () => {\n await signOut()\n onSignOut?.()\n }\n\n return (\n <button\n onClick={handleClick}\n {...props}\n >\n {children || 'Sign Out'}\n </button>\n )\n}\n\nexport default SignOutButton\n"],"names":["RECENT_ACCOUNTS_KEY","MAX_RECENT_ACCOUNTS","SOCIAL_DEPARTURE_KEY","SOCIAL_DEPARTURE_TTL_MS","normalizeEmail","email","String","trim","toLowerCase","listRecentAccounts","raw","window","localStorage","getItem","parsed","JSON","parse","Array","isArray","filter","account","includes","map","method","lastUsedAt","Number","sort","a","b","slice","writeRecentAccounts","accounts","setItem","stringify","rememberAccount","normalized","next","Date","now","forgetAccount","adoptRecentAccounts","remote","length","markSocialDeparture","provider","sessionStorage","at","takeSocialDeparture","removeItem","FLAG","IDENTITY_CHANGED_EVENT","announceIdentityChange","detail","dispatchEvent","CustomEvent","KEEP","Set","dropStoredAccountState","doomed","i","k","key","has","push","clear","SWITCH_BEACON","markIdentitySwitching","reason","clearIdentitySwitching","isIdentitySwitching","Boolean","shouldSignOutOn401","switching","API_BASE","API_KEY","INTERNAL_MODE","configure","apiKey","apiUrl","internal","endsWith","isInternal","getApiUrl","TOKEN_STORAGE_KEY","api","route","opts","cleanRoute","startsWith","url","token","getStoredToken","headers","Accept","Authorization","res","fetch","credentials","data","status","json","catch","ok","payloadError","error","failure","Error","message","statusText","code","details","retriable","setStoredToken","handleAuthResponse","result","session","sessionToken","decodeJWT","parts","split","base64Url","base64","replace","jsonPayload","atob","Buffer","from","toString","isTokenExpired","payload","exp","isExpired","console","log","diff","isAuthenticated","valid","getCurrentUser","id","sub","name","requestCode","body","verifyCode","pollCode","deviceCode","pending","interval","signOut","refreshToken","endImpersonation","impersonationId","getSession","listSessions","items","revokeSession","revokeOtherSessions","getApplicationInfo","warn","updateProfile","fetchRecentAccounts","response","saveRecentAccount","keepalive","deleteRecentAccount","encodeURIComponent","getSocialProviders","startSocialSignIn","redirect","shouldRemember","destination","location","href","URL","searchParams","set","assign","consumeSocialToken","hash","params","URLSearchParams","get","previous","before","after","delete","rest","history","replaceState","pathname","search","consumeSocialError","startSocialLink","authorizeUrl","unlinkSocialProvider","getLinkedProviders","allowedOrigins","extraOrigins","list","origin","isLocalhost","hostname","resolveRedirect","protocol","applyRedirect","target","navigate","withToken","finalUrl","getRedirectFromLocation","paramName","REVALIDATE_THROTTLE_MS","useAuthStore","create","user","loading","lastRevalidatedAt","sessions","currentSession","loadingStates","applicationInfo","impersonation","setLoading","value","state","fetchApplicationInfo","appInfo","syncSession","trusted","sessionData","application","semToken","anterior","trocou","reload","identityChanged","rejected","init","revalidate","force","options","err","sessionId","isCurrent","isLast","s","startRefresh","refreshInterval","setInterval","timeUntilExpiry","refreshed","refreshErr","addEventListener","clearInterval","checkTokenValidity","setUser","remaining","expiresAt","ms","getTime","totalSeconds","Math","floor","padStart","styles","wrap","position","left","right","bottom","zIndex","display","justifyContent","pointerEvents","paddingLeft","paddingRight","bar","alignItems","flexWrap","gap","padding","borderRadius","background","color","fontSize","fontFamily","lineHeight","maxWidth","boxShadow","strong","fontWeight","clock","fontVariantNumeric","opacity","button","marginLeft","border","font","cursor","ImpersonationBanner","setLeft","useState","ending","setEnding","endedByTimer","useCallback","handleEnd","useEffect","timer","restante","_jsx","style","children","_jsxs","role","actor","_Fragment","type","onClick","disabled","AuthContext","createContext","IMPERSONATION_POLL_MS","AuthProvider","onError","useMemo","handleStorageChange","event","setState","handleSessionRevoked","removeEventListener","handleFocus","document","visibilityState","contextValue","Provider","useAuth","useShallow","useSignIn","sending","verifying","useSignOut","useCheckToken","useSession","useAuthLoading","useUser","loadingUpdateProfile","useSessions","loadingListSessions","loadingRevokeSession","useImpersonation","useApplicationLogo","image","Protect","fallback","redirectTo","Navigate","to","Outlet","GuestOnly","AuthCard","title","subtitle","logo","logoWidth","width","variant","opened","onClose","modalProps","props","content","Stack","align","ta","Image","src","alt","mx","w","fit","Title","order","Text","size","c","Modal","withCloseButton","radius","overlayProps","backgroundOpacity","blur","Group","h","Paper","withBorder","shadow","p","maw","PROVIDER_NAMES","google","github","providerName","charAt","toUpperCase","RELATIVE","Intl","RelativeTimeFormat","numeric","formatLastUsed","timestamp","minutes","round","abs","format","hours","days","months","initialsOf","local","RecentAccounts","pickingEmail","managing","onToggleManage","onPick","onForget","onUseOther","labels","busy","justify","fz","fw","lh","tt","lts","recentAccountsHeading","Anchor","component","undefined","recentAccountsDone","recentAccountsManage","index","isPicking","isSocial","description","openingProvider","sendingCode","lastUsed","NavLink","noWrap","label","truncate","leftSection","Avatar","rightSection","ActionIcon","removeAccount","IconX","Loader","IconArrowRight","py","borderTop","Button","fullWidth","useOtherEmail","MARKS","IconBrandGoogle","SocialButtons","providers","setProviders","leaving","setLeaving","active","then","Divider","socialDivider","labelPosition","Mark","stroke","socialButton","Wordmark","TERMS_URL","TermsNotice","text","linkText","mt","textWrap","rel","inherit","underline","describeCodeFailure","kind","isLocked","attemptsLeft","isInteger","CodeFailureNotice","texts","wrong","wrongCodeTitle","wrongCodeHint","lastAttempt","join","exhausted","attemptsExhaustedTitle","attemptsExhausted","expired","codeExpiredTitle","codeExpired","other","codeFailedTitle","invalidCode","Alert","icon","IconAlertCircle","root","AuthTransition","Center","minHeight","SignIn","authenticatedRedirect","redirectingFallback","onSuccess","handleRedirect","redirectOrigins","onCodeSent","termsUrl","socialLogin","recentAccounts","cardProps","authLoading","sentTo","setSentTo","setCode","codeFailure","setCodeFailure","isCodeResent","setIsCodeResent","codeInputRef","useRef","setAccounts","isChoosingOther","setIsChoosingOther","isManaging","setIsManaging","setPickingEmail","isShowingAccounts","isCodeLocked","applicationLogo","finalLogo","useNavigate","form","useForm","initialValues","validate","test","invalidEmail","redirectOriginsKey","isActive","isDirty","handleRequest","values","step","isShownOnCard","handleResend","isSent","current","focus","handlePick","some","handleForget","handleVerify","redirectHandled","oauthPending","willRedirect","codeSent","recentAccountsSubtitle","onSubmit","IconArrowLeft","savedAccounts","TextInput","placeholder","emailPlaceholder","autoFocus","autoComplete","getInputProps","readOnly","sendCodeButton","termsNotice","termsLink","span","codeResentTitle","codeResent","ref","codeLabel","codeSentTo","onChange","currentTarget","onKeyDown","IconRefresh","sendNewCode","verifyingCode","confirmCode","changeEmail","resendCode","BROWSERS","describeDevice","userAgent","ua","browser","find","pattern","os","deviceLabel","pad","n","formatSessionStart","date","isNaN","time","getHours","getMinutes","startOfDay","d","getFullYear","getMonth","getDate","day","countSessions","count","orderSessions","currentId","createdAt","describeUser","fullName","primaryEmailAddress","hasRealName","initials","part","imageUrl","LABELS","close","profileSection","avatar","edit","save","cancel","remove","notDefined","namePlaceholder","nameHint","nameRequired","emailHint","avatarPrompt","avatarHint","avatarInvalidType","avatarTooLarge","signInSection","codeMethod","codeByEmail","alwaysOn","notConnected","connect","disconnect","sessionsSection","devices","showSessions","hideSessions","thisDevice","end","since","unknownIP","loadingSessions","noSessionsFound","confirmEndBody","genericFailure","PROVIDER_MARKS","IconBrandGithub","DEVICE_MARKS","desktop","IconDeviceLaptop","phone","IconDeviceMobile","tablet","IconDeviceTablet","TONES","default","ground","dark","quiet","danger","dangerOutline","dangerFill","ActionButton","tone","others","setIsActive","isBlocked","look","UnstyledButton","onMouseEnter","onMouseLeave","onFocus","onBlur","whiteSpace","SectionLabel","note","mb","Section","isFirst","Box","px","pt","pb","rowDivider","Row","action","mih","gridTemplateColumns","minWidth","overflowWrap","Hint","FailureNote","section","Chip","looks","outline","bg","good","WithIcon","Icon","flex","marginTop","SquareAvatar","formatSize","bytes","UserProfile","onProfileUpdate","onSessionRevoked","onOtherSessionsRevoked","onProviderUnlinked","showAvatar","showName","showEmail","showSignInMethods","logoHeight","maxAvatarSize","customSections","containerProps","t","isVisible","identity","editing","setEditing","avatarPreview","setAvatarPreview","isDragging","setIsDragging","areSessionsOpen","setAreSessionsOpen","isSessionsRowActive","setIsSessionsRowActive","isConfirmingEnd","setIsConfirmingEnd","linked","setLinked","pendingProvider","setPendingProvider","setFailure","sessionsListId","useId","nameForm","refreshSignInMethods","closeEditor","available","fail","isShownOnScreen","reset","openEditor","setValues","handleSaveName","handleAvatarFile","file","reader","FileReader","onloadend","readAsDataURL","saveAvatar","handleUnlink","item","handleLink","handleEndSession","handleEndOthers","ordered","othersCount","hasProfile","hasSignInMethods","sessionsSummary","header","borderBottom","m","height","identityStrip","avatarEditor","FileButton","accept","onDragOver","preventDefault","onDragLeave","onDrop","dataTransfer","files","marginRight","nameEditor","marginBottom","stopPropagation","sessionsList","device","IconDeviceDesktop","ipAddress","endOthersQuestion","endOthersConfirm","endOthersAction","IconMail","link","entry","IconLink","isOpen","IconChevronDown","transform","transition","Root","closeOnEscape","Overlay","Content","Body","ROLE_LABELS","owner","admin","member","UPGRADE_THRESHOLD","UserInformation","onAccountClick","onBillingClick","plan","organization","branded","termsLabel","accountLabel","billingLabel","signOutLabel","padded","baseRows","IconUser","IconCreditCard","panelRows","ContextStrip","moveFocus","RowGroup","rows","hasDivider","IconLogout","hasMeter","isFinite","used","limit","ratio","min","max","isFull","showsInvite","canUpgrade","limitNoticeOnTop","IconBuilding","ml","unit","actionLabel","row","keys","querySelectorAll","indexOf","activeElement","last","SignedIn","SignedOut","AuthLoading","AuthLoaded","SignInButton","SignOutButton","onSignOut","handleClick"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,MAAMA,mBAAmB,GAAG;;AAEnC;AACA;AACO,MAAMC,mBAAmB,GAAG;;AAEnC;AACA;AACA;AACA,MAAMC,oBAAoB,GAAG,uBAAuB;AACpD,MAAMC,uBAAuB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;AAE9C,MAAMC,cAAc,GAAGC,KAAK,IACxBC,MAAM,CAACD,KAAK,IAAI,EAAE,CAAC,CACdE,IAAI,EAAE,CACNC,WAAW,EAAE;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,kBAAkBA,GAAG;EACjC,IAAI;IACA,MAAMC,GAAG,GAAGC,MAAM,CAACC,YAAY,CAACC,OAAO,CAACb,mBA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AAAA,UAAU,GAAG,QAAQ;EAAE,GAAGe;AAAM,CAAC,EAAE;AACxE,EAAA,MAAMpK,QAAQ,GAAGuV,0BAAW,EAAE;AAE9B,EAAA,oBACI/O,cAAA,CAAA,QAAA,EAAA;AACIQ,IAAAA,OAAO,EAAEA,MAAMhH,QAAQ,CAACqJ,UAAU,CAAE;AAAA,IAAA,GAChCe,KAAK;IAAA1D,QAAA,EAERA,QAAQ,IAAI;AAAS,GAClB,CAAC;AAEjB;;ACXO,SAAS+jB,aAAaA,CAAC;EAAE/jB,QAAQ;EAAEgkB,SAAS;EAAE,GAAGtgB;AAAM,CAAC,EAAE;AAC7D,EAAA,MAAM9N,OAAO,GAAGiM,UAAU,EAAE;AAE5B,EAAA,MAAMoiB,WAAW,GAAG,YAAY;IAC5B,MAAMruB,OAAO,EAAE;AACfouB,IAAAA,SAAS,IAAI;EACjB,CAAC;AAED,EAAA,oBACIlkB,cAAA,CAAA,QAAA,EAAA;AACIQ,IAAAA,OAAO,EAAE2jB,WAAY;AAAA,IAAA,GACjBvgB,KAAK;IAAA1D,QAAA,EAERA,QAAQ,IAAI;AAAU,GACnB,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/recent-accounts.js","../src/identitySwitch.js","../src/authSdk.js","../src/redirect.js","../src/authStore.js","../src/components/ImpersonationBanner.jsx","../src/AuthProvider.jsx","../src/Protect.jsx","../src/GuestOnly.jsx","../src/components/AuthCard.jsx","../src/components/RecentAccounts.jsx","../src/components/SocialButtons.jsx","../src/components/Wordmark.jsx","../src/terms.js","../src/components/SignIn.jsx","../src/session-display.js","../src/user-identity.js","../src/components/UserProfile.jsx","../src/components/UserInformation.jsx","../src/components/control/SignedIn.jsx","../src/components/control/SignedOut.jsx","../src/components/control/AuthLoading.jsx","../src/components/control/AuthLoaded.jsx","../src/components/unstyled/SignInButton.jsx","../src/components/unstyled/SignOutButton.jsx"],"sourcesContent":["/**\n * The accounts that already signed in on this browser.\n *\n * `<SignIn />` offers them before the empty email field: for a returning\n * person, choosing the account IS the click that sends the code. Nothing here\n * is a credential — a saved email still has to receive and type a fresh code —\n * so the list is a shortcut, never a session.\n *\n * WHAT IS KEPT, AND WHEN\n *\n * Email, the way in (`'code'` or a provider id such as `'google'`) and the time\n * of the last sign-in. No token, name or picture: that is everything needed to\n * draw a row, and the rest arrives with the session.\n *\n * An email enters only after a session exists — the code confirmed, or the\n * provider's token back in the fragment. Never on \"send code\": a typo there\n * would otherwise become a permanent suggestion.\n *\n * WHY IT SURVIVES SIGN-OUT AND IDENTITY SWITCHES\n *\n * The list exists precisely for the person who left and is coming back, so\n * signing out does not clear it; removing an account is an explicit action on\n * the screen. The key is in `KEEP` in `identitySwitch.js` for the same reason:\n * the list belongs to the browser, not to whichever account is signed in, and\n * holds no data of any account beyond its own email.\n *\n * `localStorage` is per origin, so each panel keeps its own list.\n */\n\nexport const RECENT_ACCOUNTS_KEY = 'auth:recent-accounts'\n\n// Five rows fit the 350px card with no scroll. The oldest drops out on its\n// own; signing in with it again puts it back on top.\nexport const MAX_RECENT_ACCOUNTS = 5\n\n// Which provider this tab left for. `sessionStorage` because the answer only\n// matters to the tab that comes back, and it expires so an abandoned consent\n// screen does not label a later, unrelated token.\nconst SOCIAL_DEPARTURE_KEY = 'auth:social-departure'\nconst SOCIAL_DEPARTURE_TTL_MS = 15 * 60 * 1000\n\nconst normalizeEmail = email =>\n String(email ?? '')\n .trim()\n .toLowerCase()\n\n/**\n * The saved accounts, most recent first. Never throws: a private window,\n * blocked storage or a hand-edited value all read as an empty list.\n *\n * @returns {{ email: string, method: string, lastUsedAt: number }[]}\n */\nexport function listRecentAccounts() {\n try {\n const raw = window.localStorage.getItem(RECENT_ACCOUNTS_KEY)\n if (!raw) return []\n\n const parsed = JSON.parse(raw)\n if (!Array.isArray(parsed)) return []\n\n return parsed\n .filter(account => account && typeof account.email === 'string' && account.email.includes('@'))\n .map(account => ({\n email: normalizeEmail(account.email),\n method: typeof account.method === 'string' && account.method ? account.method : 'code',\n lastUsedAt: Number(account.lastUsedAt) || 0,\n }))\n .sort((a, b) => b.lastUsedAt - a.lastUsedAt)\n .slice(0, MAX_RECENT_ACCOUNTS)\n } catch {\n return []\n }\n}\n\nfunction writeRecentAccounts(accounts) {\n try {\n window.localStorage.setItem(RECENT_ACCOUNTS_KEY, JSON.stringify(accounts))\n } catch {\n // No storage: the screen simply keeps asking for the email.\n }\n}\n\n/**\n * Puts the account on top of the list, creating it or refreshing it.\n *\n * @param {string} email\n * @param {string} [method='code'] - `'code'` or the provider id\n * @returns the list as it stands after the write\n */\nexport function rememberAccount(email, method = 'code') {\n const normalized = normalizeEmail(email)\n if (!normalized.includes('@')) return listRecentAccounts()\n\n const next = [{ email: normalized, method: method || 'code', lastUsedAt: Date.now() }, ...listRecentAccounts().filter(account => account.email !== normalized)].slice(0, MAX_RECENT_ACCOUNTS)\n\n writeRecentAccounts(next)\n return next\n}\n\n/**\n * Removes one account from this browser's list. The account itself, its\n * sessions and the lists of other panels are untouched.\n *\n * @returns the list as it stands after the removal\n */\nexport function forgetAccount(email) {\n const normalized = normalizeEmail(email)\n const next = listRecentAccounts().filter(account => account.email !== normalized)\n\n writeRecentAccounts(next)\n return next\n}\n\n/**\n * Replaces the local copy with the list the worker returned.\n *\n * The worker's list is the one every panel shares, so when it has accounts it\n * wins: an account removed on another panel must not come back from this\n * panel's stale copy. An EMPTY answer does not wipe the local one — it is what\n * a browser that signed in before the shared list existed gets, and those\n * shortcuts are still true.\n *\n * @returns the list to show\n */\nexport function adoptRecentAccounts(remote) {\n if (!Array.isArray(remote) || remote.length === 0) return listRecentAccounts()\n\n const next = remote\n .filter(account => account && typeof account.email === 'string' && account.email.includes('@'))\n .map(account => ({\n email: normalizeEmail(account.email),\n method: typeof account.method === 'string' && account.method ? account.method : 'code',\n lastUsedAt: Number(account.lastUsedAt) || 0,\n }))\n .sort((a, b) => b.lastUsedAt - a.lastUsedAt)\n .slice(0, MAX_RECENT_ACCOUNTS)\n\n writeRecentAccounts(next)\n return next\n}\n\n/** Records the provider this tab is leaving for. */\nexport function markSocialDeparture(provider) {\n try {\n window.sessionStorage.setItem(SOCIAL_DEPARTURE_KEY, JSON.stringify({ provider, at: Date.now() }))\n } catch {\n // No storage: the account is not remembered, and the sign-in still works.\n }\n}\n\n/**\n * Reads and clears the provider this tab left for, if it left recently.\n *\n * Read BEFORE an identity switch runs: the switch clears `sessionStorage`.\n */\nexport function takeSocialDeparture() {\n try {\n const raw = window.sessionStorage.getItem(SOCIAL_DEPARTURE_KEY)\n if (!raw) return null\n window.sessionStorage.removeItem(SOCIAL_DEPARTURE_KEY)\n\n const { provider, at } = JSON.parse(raw)\n if (typeof provider !== 'string' || !provider) return null\n if (!(Date.now() - Number(at) < SOCIAL_DEPARTURE_TTL_MS)) return null\n\n return provider\n } catch {\n return null\n }\n}\n","/**\n * The identity switch — when the panel stops being one person and becomes\n * another in the middle of a live session.\n *\n * It happens in both directions of an impersonation: entering (the response\n * carries a `Set-Cookie` that changes who the server sees in that instant) and\n * leaving (by the button, by the clock, or because another tab ended it). In\n * every case the panel stays mounted for a short interval until the navigation\n * — and during that interval the mounted screens refetch holding the old\n * identity.\n *\n * The server answers those calls with 403 and 401, and it is right to: they are\n * another person's resources, or a session that stopped being valid. What is\n * wrong is SHOWING it — on screen it read as \"Acesso negado: Sem permissão para\n * esta organização\" in the middle of a switch that was working.\n *\n * The flag lives on `window` because whoever sets it (the SDK) and whoever reads\n * it (each panel's HTTP client) do not share a module. It is never turned off:\n * the whole page is replaced right after, and `window` dies with it.\n *\n * Exported by the package so any panel can mark its own switches — the Auth\n * panel marks the START of an impersonation, a moment only it knows about.\n */\n\nimport { RECENT_ACCOUNTS_KEY } from './recent-accounts.js'\n\nconst FLAG = '__riligarSwitchingIdentity'\n\n/**\n * The event that announces: the person behind this session changed.\n *\n * The SDK knows WHEN the identity switches, but not what each panel keeps — and\n * they all keep something account-shaped. The Auth panel persists the selected\n * organization, and it was that persistence surviving the reload that made the\n * panel ask for `/applications/<the operator's organization>` already as the\n * target. The server refused with 403, correctly, and the screen showed \"Acesso\n * negado\" AFTER the switch had finished — outside any transition window, which\n * is why silencing the interceptor never fixed it.\n *\n * Each panel listens and clears what is its own. The SDK needs to know no key,\n * and a new panel that persists something solves its own case without touching\n * this file.\n *\n * Fired by `markIdentitySwitching`, which every identity switch already goes\n * through — so a client of this package gets it by listening, with no call of\n * its own to make and no knowledge of when a switch happens.\n */\nexport const IDENTITY_CHANGED_EVENT = 'riligar:identity-changed'\n\n/**\n * Announces the switch, giving listeners a chance to clear before the reload.\n *\n * Synchronous on purpose: `dispatchEvent` only returns once every listener has\n * run, so the caller can reload on the next line knowing storage is already\n * clean.\n */\nexport function announceIdentityChange(detail) {\n try {\n window.dispatchEvent(new CustomEvent(IDENTITY_CHANGED_EVENT, { detail }))\n } catch {\n // No `window` (SSR, tests): there is no panel to notify.\n }\n}\n\n/**\n * Everything a panel remembers about an account, wiped on every switch.\n *\n * ALLOWLIST, NOT BLOCKLIST — and that is the whole point.\n *\n * The seven panels each persist something account-shaped, under names that\n * follow no single pattern: `organizations` (the selected company),\n * `hoster:pinned`, `rlg-payments-project-storage`,\n * `riligar_storage_active_tenant`, per-product API keys. Listing them would be\n * a blocklist, and a blocklist is wrong here in the way that hurts: a panel\n * that persists something new is silently left out, and the next person to open\n * that tab sees another account's data with nobody's name on it.\n *\n * So the rule is inverted. Everything goes, except the few keys that are about\n * the BROWSER rather than about the person — the session token, which the SDK\n * manages itself and rewrites on the next load, and per-device preferences that\n * carry no account data.\n *\n * Dropping the rest costs a refetch. Keeping it costs showing one person's data\n * under another person's name, which cannot be undone after it is on screen.\n */\nconst KEEP = new Set([\n // The SDK's own slot: cleared where it must be (ending an impersonation),\n // and rewritten from the shared cookie on the next load. Wiping it here too\n // would sign the operator out of a tab that only needed to forget the\n // target's lists.\n 'auth:token',\n // Cross-tab logout beacon. It is a timestamp, not account data, and clearing\n // it would break the very synchronisation this file exists to serve.\n 'auth:logout',\n // The switch beacon: a timestamp the sibling tabs listen for. Wiping it\n // would make the NEXT write look unchanged to the browser in some cases,\n // and the event that carries the switch would not fire.\n 'auth:identity-switched',\n // The accounts that signed in on this browser (`recent-accounts.js`). It\n // belongs to the browser, not to whoever is signed in, and holds nothing\n // of any account beyond its email — wiping it on every switch would empty\n // the sign-in shortcuts each time an operator impersonates someone.\n RECENT_ACCOUNTS_KEY,\n])\n\nfunction dropStoredAccountState() {\n try {\n const doomed = []\n for (let i = 0; i < window.localStorage.length; i++) {\n const k = window.localStorage.key(i)\n if (k && !KEEP.has(k)) doomed.push(k)\n }\n for (const k of doomed) window.localStorage.removeItem(k)\n\n // `sessionStorage` too: it survives a reload in the same tab, which is\n // exactly the window this function exists to close.\n window.sessionStorage?.clear()\n } catch {\n // No storage (SSR, private window, blocked cookies): there is nothing\n // persisted to leak.\n }\n}\n\n/**\n * The beacon sibling tabs listen for.\n *\n * `storage` only fires in OTHER tabs of the same origin, and only when a value\n * actually changes — so a timestamp is what turns \"this tab switched identity\"\n * into an event the siblings receive. The SDK writes it, the SDK reads it\n * (`AuthProvider`), and every panel that mounts the provider follows along\n * without writing a line: that is what makes it work for our own seven panels\n * and for anyone else's app on the same footing.\n *\n * It cannot reach ANOTHER origin — no browser mechanism can. Those tabs catch up\n * through the poll, which asks the server on its own schedule.\n */\nconst SWITCH_BEACON = 'auth:identity-switched'\n\nexport function markIdentitySwitching() {\n try {\n window[FLAG] = true\n } catch {\n // No `window` (SSR, tests): there is no panel to notify.\n }\n\n try {\n // Written BEFORE the wipe below, because the wipe removes it again —\n // and it is the write itself, not the value, that the siblings hear.\n window.localStorage.setItem(SWITCH_BEACON, String(Date.now()))\n } catch {\n // No storage: the sibling tabs fall back to the poll.\n }\n // Applies to EVERY identity switch — entering and leaving an impersonation —\n // because in both directions everything remembered starts belonging to\n // another account.\n dropStoredAccountState()\n\n /*\n * Wiping storage is not enough on its own: a store that keeps its state in\n * MEMORY and only mirrors it to storage — every `zustand/persist` store is\n * one — survives the wipe untouched, and rewrites the old value on its next\n * `set()`. That is the whole bug this event exists for: the Auth panel's\n * selected organization stayed in memory across the switch, and the screen\n * asked for `/applications/<the target's organization>` as the operator,\n * which the server refused with 403 — correctly.\n *\n * Announced LAST, so a listener that reads storage sees it already clean.\n */\n announceIdentityChange({ reason: 'switch' })\n}\n\nexport function clearIdentitySwitching() {\n try {\n window[FLAG] = false\n } catch {\n // Same reasoning as above.\n }\n}\n\nexport function isIdentitySwitching() {\n try {\n return Boolean(window[FLAG])\n } catch {\n return false\n }\n}\n\n/**\n * Should a 401 sign the person out — or is it the expected 401 of a switch?\n *\n * Every panel's HTTP client reacts to a 401 by signing out. On the server that\n * `signOut` deletes EVERY session of the person's e-mail across all products\n * (one account, one e-mail, many application rows) — the right thing for a real\n * \"sign out everywhere\", and a catastrophe for a transient 401.\n *\n * Leaving an impersonation keeps the panel mounted for a moment while it\n * reloads, and calls already in flight carry the dying impersonation token. The\n * server answers 401, correctly. Acting on THAT 401 signed the operator out of\n * everything — the account came back for a second and was then wiped by its own\n * panel. Exiting from the Auth tab happened to dodge it; exiting from Functions,\n * Monitors or Hoster did not, which is why it looked panel-specific.\n *\n * Pure and exported so each panel shares one decision instead of three copies of\n * an inline `&& !isIdentitySwitching()`, and so a single test covers all of\n * them. Pass the flag in (do not read it here) to keep it testable without a\n * `window`.\n */\nexport function shouldSignOutOn401(switching) {\n return !switching\n}\n","import { markIdentitySwitching } from './identitySwitch.js'\nimport { markSocialDeparture, rememberAccount, takeSocialDeparture } from './recent-accounts.js'\n\n// The default this package resolves to when an integration does not pass a URL.\n// It ships inside the published bundle, so a stale value here fails on the\n// customer's machine, not on ours.\nlet API_BASE = 'https://auth.worker.myinfrastructure.click'\nlet API_KEY = null\nlet INTERNAL_MODE = false // Internal mode: no API key required (same-domain apps)\n\n// Permite configurar API key e modo interno externamente (chamado pelo AuthProvider)\nexport function configure({ apiKey, apiUrl, internal = false }) {\n if (apiKey) API_KEY = apiKey\n if (apiUrl) API_BASE = apiUrl.endsWith('/') ? apiUrl.slice(0, -1) : apiUrl\n INTERNAL_MODE = internal\n}\n\nexport const isInternal = () => INTERNAL_MODE\n\n/** A URL da API de autenticação em uso. É a origem confiável por definição. */\nexport const getApiUrl = () => API_BASE\n\n/** A chave onde o token de sessão é guardado. Exposta para quem precisa lê-lo. */\nexport const TOKEN_STORAGE_KEY = 'auth:token'\n\n// Cache para JWKS\nlet jwksCache = null\nlet jwksCacheExpiry = 0\n\n// helper fetch pré-configurado\nasync function api(route, opts = {}) {\n // Garante que a rota comece com /\n const cleanRoute = route.startsWith('/') ? route : `/${route}`\n\n // Constrói URL completa (API_BASE já teve trailing slash removido no configure)\n const url = `${API_BASE}${cleanRoute}`\n\n const token = getStoredToken()\n const headers = {\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n ...opts.headers,\n }\n\n // Adiciona Authorization header se tiver token\n if (token) {\n headers.Authorization = `Bearer ${token}`\n }\n\n // Adiciona API Key se configurada e não estiver em modo interno\n if (API_KEY && !INTERNAL_MODE) {\n headers['X-API-Key'] = API_KEY\n }\n\n const res = await fetch(url, {\n headers,\n credentials: 'include', // Required for sending session cookies\n ...opts,\n })\n\n // Converte JSON automaticamente e lança erro legível\n const data = res.status !== 204 ? await res.json().catch(() => ({})) : null\n\n if (!res.ok) {\n /*\n * O contrato: `{error: {code, message, details?}}`.\n *\n * `code` é o identificador estável — programe contra ele. `message` é\n * a frase para o humano e pode mudar de redação a qualquer momento.\n * `details` traz o que dá para agir (o limite estourado, o campo que\n * faltou), e vai no Error para quem trata sem precisar do corpo.\n */\n const payloadError = data?.error\n const failure = new Error(payloadError?.message || res.statusText)\n failure.res = res\n failure.data = data\n failure.status = res.status\n failure.code = payloadError?.code ?? null\n failure.details = payloadError?.details ?? null\n failure.retriable = Boolean(payloadError?.retriable)\n throw failure\n }\n return data\n}\n\n// Gerenciamento de token no localStorage\nfunction getStoredToken() {\n if (typeof window === 'undefined') return null\n return window.localStorage.getItem(TOKEN_STORAGE_KEY)\n}\n\n// Exportada: o store precisa DESCARTAR o token quando o servidor não\n// reconhece a sessão. Sem isso, um valor obsoleto sobrevive no localStorage e\n// o handoff do OAuth o envia no `#token=`, derrubando a autorização.\nexport function setStoredToken(token) {\n if (typeof window === 'undefined') return\n if (token) {\n window.localStorage.setItem(TOKEN_STORAGE_KEY, token)\n } else {\n window.localStorage.removeItem(TOKEN_STORAGE_KEY)\n }\n}\n// Helper para processar resposta de autenticação e salvar token\nfunction handleAuthResponse(result) {\n // Tenta encontrar o token em vários lugares possíveis\n const token = result.token || result.session?.token || result.session?.sessionToken\n\n if (token) {\n setStoredToken(token)\n }\n\n return result\n}\n// Busca JWKS do servidor\nasync function fetchJWKS() {\n const now = Date.now()\n if (jwksCache && now < jwksCacheExpiry) {\n return jwksCache\n }\n\n try {\n const response = await fetch(`${API_BASE}/.well-known/jwks.json`)\n const jwks = await response.json()\n jwksCache = jwks\n jwksCacheExpiry = now + 5 * 60 * 1000 // Cache por 5 minutos\n return jwks\n } catch (error) {\n console.error('Erro ao buscar JWKS:', error)\n return null\n }\n}\n\n// Decodifica JWT (apenas payload, sem verificação de assinatura)\nexport function decodeJWT(token) {\n try {\n const parts = token.split('.')\n if (parts.length !== 3) return null\n\n // Safe base64 decode\n const base64Url = parts[1]\n const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/')\n\n // Verifica ambiente para decodificar\n const jsonPayload = typeof window !== 'undefined' ? window.atob(base64) : Buffer.from(base64, 'base64').toString()\n\n return JSON.parse(jsonPayload)\n } catch {\n return null\n }\n}\n\n// Verifica se o token está expirado\nfunction isTokenExpired(token) {\n const payload = decodeJWT(token)\n\n // Se não for um JWT válido (payload null), assumimos que é um token opaco (session token)\n // Nesse caso, deixamos o servidor validar via 401\n if (!payload) return false\n\n if (!payload.exp) return false\n\n const now = Date.now()\n const exp = payload.exp * 1000\n const isExpired = now >= exp\n\n if (isExpired) {\n console.log('[AuthSDK] Token expired:', { now, exp, diff: exp - now })\n }\n\n return isExpired\n}\n\n// Verifica se o usuário está autenticado\nexport function isAuthenticated() {\n const token = getStoredToken()\n const valid = token && !isTokenExpired(token)\n return valid\n}\n\n// Obtém dados do usuário do token\nexport function getCurrentUser() {\n const token = getStoredToken()\n if (!token || isTokenExpired(token)) return null\n\n const payload = decodeJWT(token)\n return payload\n ? {\n id: payload.sub,\n email: payload.email,\n name: payload.name,\n ...payload,\n }\n : null\n}\n\n/*--- sign in: ask for the code, trade the code ----*/\n//\n// These are the only two calls that authenticate. There is no separate sign-up:\n// someone who never signed in and someone who already did walk exactly the same\n// path, and `requestCode`'s answer is the same in both cases — it does not tell\n// whether the email already had an account.\n\n/**\n * Asks for the sign-in code. The email goes out right away; the response does\n * not wait for it.\n *\n * @param {string} email\n * @param {{ name?: string }} [options] Name used only if the account is created now.\n * @returns {Promise<{ sent: boolean, expiresIn: number, interval: number, deviceCode: string }>}\n */\nexport const requestCode = async (email, { name } = {}) => {\n return await api('/auth/code/start', {\n method: 'POST',\n body: JSON.stringify({ email, ...(name ? { name } : {}) }),\n })\n}\n\n/**\n * Trades the code for the session. This is the whole sign-in.\n *\n * @param {string} email The same email that asked for the code.\n * @param {string} code As the person typed it — case, spaces and the hyphen are optional.\n * @returns {Promise<{ user: object, token: string, session: object }>}\n */\nexport const verifyCode = async (email, code) => {\n const result = await api('/auth/code/verify', {\n method: 'POST',\n body: JSON.stringify({ email, code }),\n })\n\n return handleAuthResponse(result)\n}\n\n/**\n * Variant for whoever CANNOT read the email — an agent waiting for someone else\n * to present the code. Returns `{ pending: true, interval }` while nobody has\n * approved; in the browser, use `verifyCode`.\n *\n * @param {string} deviceCode The value returned by `requestCode`.\n */\nexport const pollCode = async deviceCode => {\n try {\n const result = await api('/auth/code/poll', {\n method: 'POST',\n body: JSON.stringify({ deviceCode }),\n })\n return handleAuthResponse(result)\n } catch (error) {\n // 428/429 are not failures: they mean \"not yet\" and \"slow down\".\n // Whoever polls needs to tell those apart from a dead code, which is a\n // real error.\n if (error?.status === 428 || error?.status === 429) {\n return { pending: true, interval: error?.details?.interval ?? 5 }\n }\n throw error\n }\n}\n\nexport const signOut = async () => {\n try {\n await api('/auth/sign-out', { method: 'POST' })\n } catch {\n // Ignores sign-out errors on the server\n } finally {\n setStoredToken(null)\n }\n}\n\nexport const refreshToken = async () => {\n try {\n const result = await api('/auth/refresh', { method: 'POST' })\n return handleAuthResponse(result)\n } catch (error) {\n setStoredToken(null)\n throw error\n }\n}\n\n/*--- Impersonation ------------------------------*/\n/*\n * Encerra a impersonação em curso.\n *\n * Não manda token nem id de sessão: o cookie de impersonação viaja sozinho\n * (`credentials: 'include'`) e é ele que autoriza. Quem está dentro da\n * impersonação é, por definição, quem pode fechá-la.\n *\n * O servidor responde limpando o cookie; depois disso o painel volta a ser o\n * operador sozinho, e um reload basta para a tela acompanhar.\n */\nexport const endImpersonation = async impersonationId => api(`/impersonation/${impersonationId}/end`, { method: 'POST' })\n\n/*--- Session ------------------------------------*/\n// O cookie `riligar.session_token` é compartilhado por `.myinfrastructure.click`, então\n// um painel recém-aberto autentica aqui SEM ter nada no localStorage (que é\n// isolado por origem). Nesse caso semeamos o token local a partir da resposta:\n// `isAuthenticated()` e o refresh em background leem do localStorage, e sem\n// isto o painel ficaria autenticado no servidor mas \"deslogado\" no cliente —\n// e o token venceria sem nunca ser renovado naquela origem.\n// A gravação é INCONDICIONAL, e não só quando o slot está vazio. A chave é\n// fixa por origem, então um token de sessão já encerrada sobrevive a logout,\n// troca de conta e expiração — e `if (!getStoredToken())` nunca o substituía.\n// O servidor acabou de dizer qual é a sessão desta requisição; ele é a\n// autoridade, e o valor local que discorda dele é resíduo.\n//\n// Importa além do painel: o handoff do OAuth lê ESTE valor para montar o\n// `#token=`, então um resíduo aqui derruba a autorização inteira com\n// \"Sessão inválida ou expirada\", num ponto que não aponta para a causa.\nexport const getSession = async () => {\n const result = await api('/auth/session')\n\n const token = result?.token || result?.session?.token\n if (token && token !== getStoredToken()) setStoredToken(token)\n\n return result\n}\n\nexport const listSessions = async () => {\n // As SESSÕES, não o envelope: a assinatura sempre devolveu a lista, e é a\n // ergonomia certa para quem só quer renderizá-las.\n const body = await api('/auth/list-sessions')\n return Array.isArray(body?.items) ? body.items : []\n}\n\nexport const revokeSession = async id => {\n return await api('/auth/revoke-session-by-id', {\n method: 'POST',\n body: JSON.stringify({ id }),\n })\n}\n\nexport const revokeOtherSessions = async () => {\n return await api('/auth/revoke-other-sessions', {\n method: 'POST',\n })\n}\n\n/*--- Application Info ----------------------------*/\nexport const getApplicationInfo = async () => {\n try {\n // O recurso vem na RAIZ.\n return (await api('/application/by-api-key')) || null\n } catch (error) {\n console.warn('[AuthSDK] Failed to fetch application info:', error.message)\n return null\n }\n}\n\n/*--- Profile Management ---------------------------*/\nexport const updateProfile = async data => {\n return await api('/auth/update-user', {\n method: 'POST',\n body: JSON.stringify(data),\n })\n}\n\n/*--- Recent accounts ------------------------------------------------------*/\n\n/*\n * The server's copy of this browser's sign-in shortcuts.\n *\n * `localStorage` is per origin, so a list kept only there stayed on the panel\n * where the person signed in. The worker keeps it in an HttpOnly cookie on its\n * own host, which every panel of the application reaches — and answers only to\n * the origins the application allows (`routes/recent-accounts.js`).\n *\n * All three fail soft: the shortcuts are a convenience, and a network error or\n * an origin the worker refuses must never cost the sign-in. `null` means \"no\n * answer\", which the screen reads as \"keep what you have\".\n */\n\n/** The list for this application, or `null` when the worker did not answer. */\nexport const fetchRecentAccounts = async () => {\n try {\n const response = await api('/auth/recent-accounts')\n return Array.isArray(response?.items) ? response.items : null\n } catch {\n return null\n }\n}\n\n/**\n * Records the account of the CURRENT session. The worker reads the email from\n * the session, never from here. `keepalive` because the screen is usually\n * navigating away at this very moment.\n */\nexport const saveRecentAccount = async (method = 'code') => {\n try {\n const response = await api('/auth/recent-accounts', { method: 'POST', body: JSON.stringify({ method }), keepalive: true })\n return Array.isArray(response?.items) ? response.items : null\n } catch {\n return null\n }\n}\n\n/** Takes one account off this browser's list, on every panel. */\nexport const deleteRecentAccount = async email => {\n try {\n await api(`/auth/recent-accounts/${encodeURIComponent(email)}`, { method: 'DELETE', keepalive: true })\n return true\n } catch {\n return false\n }\n}\n\n/*--- Social sign-in -------------------------------------------------------*/\n\n/**\n * The providers this application has enabled.\n *\n * Public: it answers a screen where nobody is signed in yet. It carries only\n * `{ provider, name }` — never the client id, which identifies the owner's\n * project at Google.\n *\n * Returns `[]` on failure rather than throwing: a sign-in screen that cannot\n * reach this endpoint must still render the email field, which is the path that\n * always works.\n */\nexport const getSocialProviders = async () => {\n try {\n const response = await api('/auth/providers')\n return response?.items || []\n } catch (error) {\n console.warn('[AuthSDK] Failed to fetch social providers:', error.message)\n return []\n }\n}\n\n/**\n * Leaves for the provider.\n *\n * A full-page navigation, not `fetch`: the person has to SEE Google's consent\n * screen, and an XHR would be blocked by CORS anyway. The API key travels in the\n * query string because a redirect carries no headers — it is the public `pu_`,\n * which is already in the bundle.\n *\n * `redirect` is where to come back to; the worker validates it against the\n * application's allowlist BEFORE leaving, and stores the validated value. It\n * defaults to the current page.\n *\n * `rememberAccount: false` keeps the account off this browser's recent list\n * (`recent-accounts.js`) when the token comes back.\n */\nexport const startSocialSignIn = (provider, { redirect, rememberAccount: shouldRemember = true } = {}) => {\n const destination = redirect || window.location.href.split('#')[0]\n const url = new URL(`${API_BASE}/auth/sign-in/${provider}`)\n url.searchParams.set('redirect', destination)\n if (API_KEY && !INTERNAL_MODE) url.searchParams.set('api_key', API_KEY)\n\n // The fragment that comes back carries only the token, not which provider\n // issued it — so the tab notes where it went before leaving.\n if (shouldRemember) markSocialDeparture(provider)\n\n window.location.assign(url.toString())\n}\n\n/**\n * Reads the token the callback left in the fragment, and cleans the URL.\n *\n * The token comes back after `#` precisely so it never reaches a server, a log\n * or a `Referer`. Once read it is removed from the address bar with\n * `replaceState`, so a copied URL does not carry a live session.\n *\n * Returns the token when there was one, `null` otherwise.\n */\nexport const consumeSocialToken = () => {\n if (typeof window === 'undefined' || !window.location.hash) return null\n\n const params = new URLSearchParams(window.location.hash.slice(1))\n const token = params.get('token')\n if (!token) return null\n\n // Read before the identity switch below: it clears `sessionStorage`, where\n // the departure is noted. A token without a departure (a handoff between\n // panels) is not a sign-in made here, and does not enter the list.\n const provider = takeSocialDeparture()\n\n /*\n * A social sign-in can land on a tab that already belongs to SOMEBODY ELSE.\n *\n * Coming back from Google replaces the session, and the person behind it may\n * not be the one who left: signing in with a Google account whose email has\n * no user here creates a NEW user, with an organization of its own.\n *\n * Swapping the token alone is not enough. Every panel keeps account-shaped\n * state — the Auth panel persists the selected organization — and a\n * `zustand/persist` store holds it in MEMORY, where clearing storage does\n * not reach. The stale organization then rides the NEW token into the next\n * request, and the server answers 403 \"Sem permissão para esta organização\"\n * — correctly, about a switch that actually worked.\n *\n * That is the exact failure `markIdentitySwitching` exists for, and which\n * impersonation already routes through. Social sign-in is one more identity\n * switch and has to go through it too.\n *\n * Compared by `sub`, not by token string: a refresh rotates the token for\n * the SAME person, and treating that as a switch would wipe their panel\n * state for nothing.\n */\n const previous = getStoredToken()\n if (previous && previous !== token) {\n const before = decodeJWT(previous)?.sub\n const after = decodeJWT(token)?.sub\n // Only when we can read both and they disagree. An unreadable token is\n // not evidence of a switch, and guessing here would clear state on a\n // malformed value.\n if (before && after && before !== after) markIdentitySwitching()\n }\n\n setStoredToken(token)\n\n if (provider) {\n const email = decodeJWT(token)?.email\n if (email) rememberAccount(email, provider)\n // The shared copy, so the other panels learn it too. Not awaited: the\n // token is already stored, and the sign-in must not wait on a shortcut.\n saveRecentAccount(provider)\n }\n\n params.delete('token')\n const rest = params.toString()\n window.history.replaceState(null, '', `${window.location.pathname}${window.location.search}${rest ? `#${rest}` : ''}`)\n\n return token\n}\n\n/**\n * The failure the callback reported, if any. Also clears it from the URL.\n *\n * The worker sends a short opaque code — never the provider's own error text,\n * which echoes back parts of our request. Phrasing lives here, next to the other\n * user-facing strings.\n */\nexport const consumeSocialError = () => {\n if (typeof window === 'undefined') return null\n\n const params = new URLSearchParams(window.location.search)\n const reason = params.get('social_error')\n if (!reason) return null\n\n // The trip failed: the departure noted for it must not label a later token.\n takeSocialDeparture()\n\n params.delete('social_error')\n const rest = params.toString()\n window.history.replaceState(null, '', `${window.location.pathname}${rest ? `?${rest}` : ''}${window.location.hash}`)\n\n return reason\n}\n\n/** Starts linking a provider to the account of the CURRENT session. */\nexport const startSocialLink = async (provider, { redirect } = {}) => {\n const destination = redirect || window.location.href.split('#')[0]\n const response = await api(`/auth/link/${provider}`, { method: 'POST', body: JSON.stringify({ redirect: destination }) })\n if (response?.authorizeUrl) window.location.assign(response.authorizeUrl)\n return response\n}\n\nexport const unlinkSocialProvider = async provider => {\n return await api(`/auth/unlink/${provider}`, { method: 'POST' })\n}\n\n/** The providers linked to the current session's user. */\nexport const getLinkedProviders = async () => {\n const response = await api('/auth/linked-providers')\n return response?.items || []\n}\n","// ============================================================================\n// REDIRECT PÓS-LOGIN\n// ============================================================================\n//\n// Quem inicia um fluxo OAuth (o servidor MCP, por exemplo) manda o usuário ao\n// painel com `?redirect=` apontando de volta. Sem tratar esse parâmetro, o\n// login termina na home do painel e a autorização fica órfã.\n//\n// A lógica vive aqui, e não em cada aplicação, porque ela tem duas armadilhas\n// que não se quer reimplementar três vezes:\n//\n// 1. `redirect` sem allowlist transforma a tela de login em open redirect —\n// um link `?redirect=https://phishing.example` levaria o usuário para lá\n// logo após ele digitar a senha, num domínio que ele confia.\n//\n// 2. O token vive em `localStorage`, que é isolado POR ORIGEM. O worker do\n// Auth (auth.worker.*) não consegue lê-lo do painel (produto.dashboard.*),\n// então ele precisa ser entregue — e o fragmento (`#token=`) é o único\n// canal que não chega ao servidor nem entra em log de acesso.\n// ============================================================================\n\nimport { getApiUrl, TOKEN_STORAGE_KEY } from './authSdk'\n\n/**\n * Origens para as quais é seguro redirecionar após o login.\n *\n * A origem da própria API entra sempre: é para lá que o fluxo OAuth volta, e\n * o SDK já a conhece por `configure({ apiUrl })`. A origem atual também, por\n * ser a mesma página. `extraOrigins` cobre o resto (um site institucional que\n * inicie o login, por exemplo).\n */\nfunction allowedOrigins(extraOrigins = []) {\n const list = []\n\n try {\n list.push(new URL(getApiUrl()).origin)\n } catch {}\n\n if (typeof window !== 'undefined') list.push(window.location.origin)\n\n for (const raw of extraOrigins) {\n try {\n list.push(new URL(raw).origin)\n } catch {}\n }\n\n return list\n}\n\nconst isLocalhost = hostname => hostname === 'localhost' || hostname === '127.0.0.1'\n\n/**\n * Valida o `redirect` recebido e devolve o destino, ou `null`.\n *\n * Caminho interno (`/algo`) passa sempre — não sai do domínio. URL absoluta só\n * passa se a origem constar na allowlist e for HTTPS: aceitar `http://` num\n * host permitido exporia o token em trânsito.\n */\nexport function resolveRedirect(raw, extraOrigins = []) {\n if (!raw || typeof raw !== 'string') return null\n\n // `//` seria protocol-relative, que sai do domínio apesar de parecer path.\n if (raw.startsWith('/') && !raw.startsWith('//')) return raw\n\n let url\n try {\n url = new URL(raw)\n } catch {\n return null\n }\n\n // Localhost passa em desenvolvimento: o destino é a máquina do próprio\n // usuário, não um servidor de terceiro.\n if (isLocalhost(url.hostname)) return raw\n\n if (url.protocol !== 'https:') return null\n return allowedOrigins(extraOrigins).includes(url.origin) ? raw : null\n}\n\n/**\n * Executa o redirect pós-login.\n *\n * Devolve `true` quando assumiu a navegação — o chamador então não deve\n * navegar por conta própria. `false` significa \"não havia redirect válido,\n * siga o seu fluxo normal\".\n *\n * @param {string|null} target destino já validado por `resolveRedirect`\n * @param {(path: string) => void} navigate roteador da aplicação, para paths internos\n * @param {boolean} withToken anexar o token no fragmento (necessário quando o\n * destino é outra origem que precisa da sessão, como o handoff do OAuth)\n */\nexport function applyRedirect(target, navigate, { withToken = true } = {}) {\n if (!target) return false\n\n // Caminho interno: o roteador resolve, sem recarregar a página.\n if (target.startsWith('/')) {\n navigate?.(target, { replace: true })\n return true\n }\n\n if (typeof window === 'undefined') return false\n\n let finalUrl = target\n if (withToken) {\n const token = window.localStorage.getItem(TOKEN_STORAGE_KEY)\n // O fragmento nunca é enviado ao servidor: não aparece em log de\n // acesso nem no Referer. É o canal certo para um token.\n if (token) finalUrl = `${target}#token=${encodeURIComponent(token)}`\n }\n\n window.location.replace(finalUrl)\n return true\n}\n\n/**\n * Vai para o destino fixo do app depois de um callback (magic link, verificação\n * de e-mail).\n *\n * Caminho interno vai pelo ROTEADOR, não por `window.location`. Trocar o\n * `location` recarrega o documento inteiro: o React remonta, o `AuthProvider`\n * refaz `/auth/session`, e quem acabou de entrar vê o painel montar duas vezes.\n * Como o painel normalmente também navega no `onSuccess`, o efeito era o\n * primeiro destino aparecer e ~2s depois a página \"dar refresh\" sozinha.\n *\n * URL absoluta continua trocando o `location`: é outra origem, e o roteador\n * desta aplicação não a alcança.\n *\n * @param {string} target destino (`/algo` ou URL absoluta)\n * @param {(path: string, opts?: object) => void} navigate roteador da aplicação\n */\nexport function goToAppDestination(target, navigate) {\n if (!target || typeof window === 'undefined') return\n\n if (target.startsWith('/') && !target.startsWith('//') && navigate) {\n navigate(target, { replace: true })\n return\n }\n\n window.location.href = target\n}\n\n/**\n * Lê o `redirect` da URL atual, valida e devolve o destino (ou `null`).\n *\n * Atalho para o caso comum: o componente não precisa mexer em `URLSearchParams`\n * nem lembrar o nome do parâmetro.\n */\nexport function getRedirectFromLocation(extraOrigins = [], paramName = 'redirect') {\n if (typeof window === 'undefined') return null\n const raw = new URLSearchParams(window.location.search).get(paramName)\n return resolveRedirect(raw, extraOrigins)\n}\n","import { create } from 'zustand'\nimport * as api from './authSdk.js'\nimport { markIdentitySwitching } from './identitySwitch.js'\n\n// Shortest gap between two focus-driven session reads.\nconst REVALIDATE_THROTTLE_MS = 5000\n\n// Estado: { user, loading, error }\nexport const useAuthStore = create((set, get) => ({\n user: null,\n loading: true,\n error: null,\n\n // Timestamp of the last focus revalidation, for throttling.\n lastRevalidatedAt: 0,\n\n // Session management\n sessions: [],\n currentSession: null,\n\n // Loading states granulares\n loadingStates: {\n requestCode: false,\n verifyCode: false,\n signOut: false,\n updateProfile: false,\n listSessions: false,\n revokeSession: null, // null or sessionId being revoked\n },\n\n // Application info (logo, nome, etc)\n applicationInfo: null,\n\n /*\n * Preenchido quando ESTA sessão é emprestada — `/auth/session` devolve\n * `{ actor, expiresAt }`. É o que a barra lê para avisar, em qualquer painel,\n * que quem está logado não é quem está olhando.\n */\n impersonation: null,\n\n // Helper para atualizar loading states\n setLoading: (key, value) =>\n set(state => ({\n loadingStates: { ...state.loadingStates, [key]: value },\n })),\n\n // Buscar informações da aplicação\n fetchApplicationInfo: async () => {\n try {\n const appInfo = await api.getApplicationInfo()\n set({ applicationInfo: appInfo })\n } catch (error) {\n console.warn('[AuthStore] Failed to fetch application info:', error)\n set({ applicationInfo: null })\n }\n },\n\n /*\n * Reads the session from the server and mirrors it into the store.\n *\n * Shared by `init` (on mount) and `revalidate` (on focus). `trusted` says\n * whether a failure is allowed to sign the user out: on mount there is\n * nothing to lose, but on a revalidation the user is already signed in and\n * a flaky network must not drop them.\n */\n syncSession: async ({ trusted }) => {\n try {\n // Busca a sessão (que agora também traz applicationInfo)\n const sessionData = await api.getSession()\n\n // Se veio aplicação no redirecionamento/sessão, salva no store\n if (sessionData?.application) {\n set({ applicationInfo: sessionData.application })\n }\n\n // `?? null` e não `|| undefined`: a ausência do campo é a resposta\n // normal (ninguém impersonando) e tem que LIMPAR o estado anterior,\n // senão a barra sobrevive ao encerramento.\n set({ impersonation: sessionData?.impersonation ?? null })\n\n const user = sessionData?.user ?? null\n if (sessionData?.session) {\n set({ currentSession: sessionData.session })\n }\n\n // Se não encontrou sessão via cookies, verifica localStorage token (JWT)\n //\n // `isAuthenticated()` só confere o `exp` do JWT — não fala com o\n // servidor. Uma sessão revogada tem `exp` no futuro e passaria por\n // aqui: o painel se mostraria logado com um token que o servidor já\n // não reconhece. Como o handoff do OAuth envia ESTE token no\n // `#token=`, o resíduo derrubava a autorização com \"Sessão inválida\n // ou expirada\" — longe da causa.\n //\n // O servidor acabou de responder sem sessão; ele é a autoridade.\n if (!user) {\n /*\n * \"No user\" WITH a stored token is not a logout — it is a token\n * that stopped being valid. The right answer is to ask again,\n * without it.\n *\n * This is the path of whoever ended the impersonation in ANOTHER\n * tab. `/auth/session` with a dead token answers 200 and WITHOUT\n * a user (not 401: a session that does not exist is the normal\n * \"nobody signed in\" path). This branch then concluded \"logged\n * out\" and stopped there — while the operator's session was\n * alive in the cookie, shared across the zone and never touched.\n *\n * The retry goes without `Authorization`, the cookie speaks, and\n * the operator becomes themselves again. One attempt only: if\n * this one also comes back without a user, there is no session\n * behind it and logging out is correct.\n */\n if (api.isAuthenticated()) {\n api.setStoredToken(null)\n\n const semToken = await api.getSession().catch(() => null)\n if (semToken?.user) {\n const anterior = get().user\n const trocou = anterior && anterior.id !== semToken.user.id\n\n set({\n user: semToken.user,\n currentSession: semToken.session ?? null,\n impersonation: semToken.impersonation ?? null,\n loading: false,\n })\n\n if (trocou && typeof window !== 'undefined') {\n markIdentitySwitching()\n window.location.reload()\n }\n return\n }\n }\n\n set({ user: null, currentSession: null, impersonation: null, loading: false })\n return\n }\n\n /*\n * THE IDENTITY CHANGED UNDER THE SCREEN: drop everything and reload.\n *\n * This is the guard that makes the server the single truth. The\n * seven panels hold data in memory and in their own stores —\n * projects, lists, counters — and none of them knows when the person\n * behind the session stopped being the same one.\n *\n * It happens for real when an impersonation is ended in ANOTHER tab:\n * `localStorage` is per origin, so Hoster never learns that Functions\n * ended it. On the next focus it revalidates, the server answers with\n * the operator — and the screen was left with one person's footer and\n * another's list, two people's data at once.\n *\n * Swapping `user` in the store would not be enough: whoever already\n * read the list does not read it again. Reloading is the only way to\n * guarantee that NOTHING of the previous identity survives — and it\n * is cheap, because it only happens on the transition.\n *\n * `previous` comes from the state, not from a module variable: under\n * SSR and in tests the module is shared, and the comparison has to be\n * per store.\n */\n const previous = get().user\n const identityChanged = previous && previous.id !== user.id\n\n if (identityChanged && typeof window !== 'undefined') {\n /*\n * Mark the switch BEFORE reloading.\n *\n * The reload is not instantaneous: in-flight calls finish, and\n * mounted screens still fire their own. All of them carry the old\n * identity and get 403 — which surfaced as \"Acesso negado: Sem\n * permissão para esta organização\" in the middle of a switch that\n * was working.\n *\n * This guard reloaded without marking, and was the last place the\n * notification escaped through.\n */\n markIdentitySwitching()\n set({ user, loading: false })\n window.location.reload()\n return\n }\n\n set({ user, loading: false })\n } catch (error) {\n // Só descartamos o token quando o SERVIDOR o recusou (401). Uma\n // falha de rede não diz nada sobre a validade da sessão, e limpar\n // aqui deslogaria quem só perdeu conexão por um instante.\n const rejected = error?.res?.status === 401\n\n /*\n * Token refused: drop it AND ASK AGAIN, without it.\n *\n * Clearing alone was not enough, and that is what made the operator\n * lose their account when ending an impersonation in ANOTHER tab.\n * `localStorage` is per origin: ending in Functions does not remove\n * the target's token stored in Hoster and Auth. Coming back to that\n * tab, it revalidated with a dead token, took a 401, cleared it — and\n * stopped there, concluding \"logged out\".\n *\n * But the operator's session is alive in the cookie, shared across\n * the zone and never touched. The second attempt goes without\n * `Authorization`, the cookie speaks, and they become themselves\n * again — which is what the person expected when ending it in any of\n * the tabs.\n *\n * One attempt only: if this one fails too, there is no session\n * behind it, and the path below (logging out) is correct.\n */\n if (rejected) {\n api.setStoredToken(null)\n try {\n const semToken = await api.getSession()\n if (semToken?.user) {\n /*\n * This path ALSO swaps the identity on screen.\n *\n * It is the one taken when the impersonation is ended in\n * another tab: the target's token is refused, the cookie\n * returns the operator — but the screen stays mounted\n * with the target's lists, which nobody will re-read.\n *\n * Same guard as the ordinary revalidation: mark the\n * switch to silence the in-flight 403s, and reload so\n * nothing of the previous identity survives.\n */\n const anterior = get().user\n const trocou = anterior && anterior.id !== semToken.user.id\n\n set({\n user: semToken.user,\n currentSession: semToken.session ?? null,\n impersonation: semToken.impersonation ?? null,\n loading: false,\n })\n\n if (trocou && typeof window !== 'undefined') {\n markIdentitySwitching()\n window.location.reload()\n }\n return\n }\n } catch {\n // Sem sessão atrás do token morto: segue para o caminho\n // normal e desloga, que é o comportamento correto.\n }\n }\n\n // An unreachable server says nothing about an established session.\n // On a revalidation the user is already signed in: keep them, and\n // try again on the next focus.\n if (!rejected && !trusted) {\n console.warn('[AuthStore] Revalidação falhou, mantendo a sessão:', error)\n return\n }\n\n console.error('Erro na inicialização:', error)\n set({ user: null, currentSession: null, loading: false })\n }\n },\n\n /* Init ao montar o Provider */\n init: async () => {\n await get().syncSession({ trusted: true })\n },\n\n /*\n * Re-reads the session when the tab regains focus.\n *\n * `init` runs once, so a tab opened BEFORE the user signed in elsewhere\n * stays on `user: null` until a manual refresh. The session cookie is\n * shared across the zone, and localStorage is not — it is per origin — so\n * the `storage` event never crosses between two dashboards. Asking the\n * server on focus is what carries a sign-in (and a sign-out) between them.\n *\n * Throttled: `focus` and `visibilitychange` fire together, and alt-tabbing\n * would otherwise turn into a burst of `/auth/session` calls.\n */\n revalidate: async ({ force = false } = {}) => {\n const now = Date.now()\n // `force` skips the floor between reads: a caller on its own interval\n // (the impersonation poll) already controls the frequency, and the floor\n // exists for focus, which fires several times in a row when windows\n // change.\n if (!force && now - get().lastRevalidatedAt < REVALIDATE_THROTTLE_MS) return\n set({ lastRevalidatedAt: now })\n await get().syncSession({ trusted: false })\n },\n\n /* Ações de Autenticação */\n /* Sign in — ask for the code and trade it for the session. No third step. */\n\n requestCode: async (email, options) => {\n const { setLoading } = get()\n setLoading('requestCode', true)\n set({ error: null })\n\n try {\n return await api.requestCode(email, options)\n } catch (err) {\n set({ error: err })\n throw err\n } finally {\n setLoading('requestCode', false)\n }\n },\n\n verifyCode: async (email, code) => {\n const { setLoading } = get()\n setLoading('verifyCode', true)\n set({ error: null })\n\n try {\n const result = await api.verifyCode(email, code)\n\n // The session comes with the response; without it the \"this device\"\n // badge cannot identify the current session.\n if (result.session) set({ currentSession: result.session })\n\n set({ user: result.user || null, loading: false })\n return result\n } catch (err) {\n set({ error: err })\n throw err\n } finally {\n setLoading('verifyCode', false)\n }\n },\n\n signOut: async () => {\n const { setLoading } = get()\n setLoading('signOut', true)\n\n try {\n await api.signOut()\n set({ user: null })\n // Sincronizar logout entre abas\n if (typeof window !== 'undefined') {\n window.localStorage.setItem('auth:logout', Date.now())\n }\n } finally {\n setLoading('signOut', false)\n }\n },\n\n /* Session */\n getSession: async () => {\n try {\n const sessionData = await api.getSession()\n // Store current session for comparison (includes id)\n if (sessionData?.session) {\n set({ currentSession: sessionData.session })\n }\n return sessionData\n } catch (err) {\n set({ error: err })\n throw err\n }\n },\n\n listSessions: async () => {\n const { setLoading } = get()\n setLoading('listSessions', true)\n set({ error: null })\n\n try {\n const result = await api.listSessions()\n set({ sessions: result || [] })\n setLoading('listSessions', false)\n return result\n } catch (err) {\n set({ error: err, sessions: [] })\n setLoading('listSessions', false)\n throw err\n }\n },\n\n revokeSession: async sessionId => {\n const { setLoading, currentSession, sessions, signOut } = get()\n setLoading('revokeSession', sessionId)\n set({ error: null })\n\n try {\n // Detect if current session OR last remaining session\n const isCurrent = sessionId === currentSession?.id\n const isLast = sessions.length === 1 && sessions[0].id === sessionId\n\n // Se for a sessão atual ou a última, faz logout normal\n if (isCurrent || isLast) {\n await signOut()\n // signOut já limpa loading states e erros no finally, mas\n // como estamos dentro do fluxo deste método, garantimos:\n setLoading('revokeSession', null)\n return\n }\n\n await api.revokeSession(sessionId)\n\n // Remove a sessão revogada da lista local\n set(state => ({\n sessions: state.sessions.filter(s => s.id !== sessionId),\n }))\n\n setLoading('revokeSession', null)\n } catch (err) {\n set({ error: err })\n setLoading('revokeSession', null)\n throw err\n }\n },\n\n revokeOtherSessions: async () => {\n const { setLoading, listSessions } = get()\n setLoading('revokeSession', 'all')\n set({ error: null })\n\n try {\n await api.revokeOtherSessions()\n // Refresh sessions list after revocation\n await listSessions()\n setLoading('revokeSession', null)\n } catch (err) {\n set({ error: err })\n setLoading('revokeSession', null)\n throw err\n }\n },\n\n /* Refresh do token em background */\n startRefresh: () => {\n if (typeof window === 'undefined') return\n\n const refreshInterval = setInterval(\n async () => {\n try {\n // Se o usuário está autenticado mas o token está próximo do vencimento\n if (api.isAuthenticated()) {\n const token = window.localStorage.getItem('auth:token')\n if (token) {\n // Usa o decoder oficial do SDK que é mais seguro\n const payload = api.decodeJWT(token)\n\n // Se não for um JWT ou não tiver expiração, não fazemos refresh em background\n // O backend cuidará da expiração da sessão opaca via 401 nas requisições normais\n if (!payload || !payload.exp) return\n\n const now = Date.now() / 1000\n const timeUntilExpiry = payload.exp - now\n\n // Se o token expira em menos de 5 minutos, tenta o refresh\n if (timeUntilExpiry < 300) {\n try {\n const refreshed = await api.refreshToken()\n const user = api.getCurrentUser()\n set({ user })\n // O refresh rotaciona o token mantendo o mesmo id de sessão.\n if (refreshed?.session) set({ currentSession: refreshed.session })\n } catch (refreshErr) {\n console.warn('[AuthStore] Falha ao renovar token:', refreshErr)\n // Só desloga se for um erro de autenticação explícito (401)\n if (refreshErr.res?.status === 401) {\n set({ user: null })\n window.localStorage.removeItem('auth:token')\n }\n }\n }\n }\n }\n } catch (error) {\n // Erros de processamento interno não devem deslogar o usuário\n console.error('[AuthStore] Erro no ciclo de refresh automático:', error)\n }\n },\n 4 * 60 * 1000\n ) // Verifica a cada 4 minutos\n\n // Limpa o intervalo quando necessário\n if (typeof window !== 'undefined') {\n window.addEventListener('beforeunload', () => {\n clearInterval(refreshInterval)\n })\n }\n },\n\n /* Verifica se o token ainda é válido */\n checkTokenValidity: () => {\n if (!api.isAuthenticated()) {\n set({ user: null })\n return false\n }\n return true\n },\n\n /* Atualizar usuário manualmente */\n setUser: user => set({ user }),\n\n /* Profile Management */\n updateProfile: async data => {\n const { setLoading } = get()\n setLoading('updateProfile', true)\n set({ error: null })\n\n try {\n const result = await api.updateProfile(data)\n // Atualiza o user no store com os novos dados\n set(state => ({\n user: state.user ? { ...state.user, ...data } : null,\n }))\n setLoading('updateProfile', false)\n return result\n } catch (err) {\n set({ error: err })\n setLoading('updateProfile', false)\n throw err\n }\n },\n}))\n","import { useCallback, useEffect, useState } from 'react'\nimport { useAuthStore } from '../authStore.js'\nimport { endImpersonation, setStoredToken } from '../authSdk.js'\nimport { markIdentitySwitching } from '../identitySwitch.js'\n\n/*\n * The bar that says: whoever is signed in is not whoever is looking.\n *\n * It lives in the SDK, not in the dashboard-kit, for a simple reason: the SDK is\n * what knows the session is borrowed (`/auth/session` answers `impersonation`),\n * and it is what all seven panels already load because of Auth. In the kit the\n * bar would have to receive that state from outside — and every panel would wire\n * it by hand, which is exactly how one panel gets left out and nobody notices.\n *\n * The risk of this feature is not authorization; it is the operator FORGETTING\n * they are inside someone else's account. Hence a bar that is fixed, spans the\n * full width, and carries the countdown.\n *\n * INLINE STYLES, ON PURPOSE\n *\n * The SDK ships no CSS and does not depend on Mantine — the panels that consume\n * it have their own themes, and a `<link>` or a global class would collide with\n * them. These are few rules and they do not change with the theme: dark ink,\n * white text.\n *\n * It renders nothing when there is no impersonation, so it can sit at the top of\n * the app with no condition around it.\n */\n\nfunction remaining(expiresAt) {\n if (!expiresAt) return null\n const ms = new Date(expiresAt).getTime() - Date.now()\n if (ms <= 0) return null\n const totalSeconds = Math.floor(ms / 1000)\n return `${Math.floor(totalSeconds / 60)}:${String(totalSeconds % 60).padStart(2, '0')}`\n}\n\n/*\n * A FLOATING PILL, NOT A STRIP AT THE TOP — and this is a layout decision, not\n * a cosmetic one.\n *\n * The bar used to be `position: sticky; top: 0`, rendered just above the panel's\n * own tree. That takes vertical space in the document flow, and all seven panels\n * lay themselves out with Mantine's `AppShell`, which positions its Header and\n * Navbar at offsets it computes from its OWN props (`header={{ height }}`, and\n * that height is responsive — 56 on mobile, 0 on desktop in some panels). The\n * strip pushed that whole construction down: the panel's header ended up under\n * the bar, and the sidebar got clipped.\n *\n * The SDK cannot fix that by measuring: it would have to know each panel's\n * header height, at every breakpoint, and stay in sync with seven layouts it\n * does not own. Any number it picks is wrong somewhere.\n *\n * So the bar stops competing for the top of the page. `position: fixed` with\n * `inset: auto 0 20px` takes it out of the flow entirely — it reserves no\n * space, displaces nothing, and floats over the content at the BOTTOM, where no\n * panel puts a fixed header. The visibility that the feature depends on is\n * preserved: it is always on screen, centred, and impossible to scroll away\n * from. The risk this component exists to cover is the operator FORGETTING they\n * are inside someone else's account, and a floating pill answers that as well\n * as a strip did — without breaking the screen underneath.\n *\n * `pointerEvents` is handled in two layers: the full-width wrapper lets clicks\n * through (it spans the viewport and would otherwise swallow a row of the UI),\n * and the pill itself takes them back so the button stays clickable.\n */\nconst styles = {\n wrap: {\n position: 'fixed',\n left: 0,\n right: 0,\n bottom: 20,\n zIndex: 2147483647,\n display: 'flex',\n justifyContent: 'center',\n // The strip spans the viewport; without this it would eat clicks on\n // whatever sits behind it for the full width of the screen.\n pointerEvents: 'none',\n // Mobile: never let the pill run under the home indicator.\n paddingLeft: 'max(12px, env(safe-area-inset-left))',\n paddingRight: 'max(12px, env(safe-area-inset-right))',\n },\n bar: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n flexWrap: 'wrap',\n gap: 10,\n padding: '10px 16px',\n borderRadius: 999,\n // The brand's black. It stands out by INVERSION, not by an alert\n // colour: red would say \"something went wrong\", and the state is\n // \"you are borrowed\".\n background: '#11181C',\n color: '#FFFFFF',\n fontSize: 13,\n fontFamily: 'inherit',\n lineHeight: 1.4,\n maxWidth: '100%',\n // Detaches the pill from the content it floats over, which a flat strip\n // did not need because it had an edge to sit against.\n boxShadow: '0 8px 24px rgba(0, 0, 0, 0.28)',\n pointerEvents: 'auto',\n },\n strong: { fontWeight: 700 },\n clock: { fontVariantNumeric: 'tabular-nums', opacity: 0.75 },\n button: {\n marginLeft: 4,\n padding: '4px 12px',\n border: 0,\n borderRadius: 999,\n background: '#FFFFFF',\n color: '#11181C',\n font: 'inherit',\n fontSize: 12,\n fontWeight: 700,\n cursor: 'pointer',\n },\n}\n\nexport default function ImpersonationBanner() {\n const impersonation = useAuthStore(s => s.impersonation)\n const user = useAuthStore(s => s.user)\n const [left, setLeft] = useState(() => remaining(impersonation?.expiresAt))\n const [ending, setEnding] = useState(false)\n\n /*\n * Encerrar recarrega a página.\n *\n * The whole panel is already mounted with the target's data — lists,\n * stores, caches. Swapping the identity underneath would leave half the\n * screen with one person's data and half with another's. Reloading is the\n * simplest way to make everything come back coherent, and it happens once,\n * at the end of the session.\n */\n /*\n * O vencimento, sem clique.\n *\n * It does not call `/impersonation/:id/end`: the session is already gone,\n * and the route would answer 403 (\"belongs to another session\") because the\n * presented token died. What is left to do is local — drop the target's\n * token — and let the server say who the person is on the next load.\n *\n * The impersonation cookie needs no explicit clearing: it was issued with a\n * `Max-Age` equal to the session TTL, so the browser discards it on its own.\n * And even if it lingered a moment, `requireAuth` tries the candidates in\n * order and falls through to the operator's session.\n */\n const endedByTimer = useCallback(() => {\n markIdentitySwitching()\n setStoredToken(null)\n window.location.assign('/')\n }, [])\n\n const handleEnd = async () => {\n if (!impersonation?.id) return\n setEnding(true)\n markIdentitySwitching()\n try {\n await endImpersonation(impersonation.id)\n\n /*\n * The TARGET's token is in localStorage — the SDK wrote it there\n * so the other products would send the right header. Ending without\n * dropping it would leave the panel presenting itself as the target\n * in every product that reads that key, even with the cookie gone.\n *\n * The reload below asks for the session again, and the operator's\n * session cookie (never touched) rewrites the correct value.\n */\n setStoredToken(null)\n } catch {\n // If it fails, the session expires on its own within minutes.\n // Reloading anyway avoids leaving the operator stuck in a bar that\n // does not answer.\n }\n /*\n * Goes to the panel's ROOT, instead of reloading the current URL.\n *\n * The URL where an impersonation ends usually belongs to the TARGET — a\n * project of theirs in Hoster, an application of theirs in Auth.\n * Reloading there returns the operator to a route that may not be\n * theirs, and the screen answers 403 or sits in a skeleton forever.\n *\n * `/` is the home of every panel in the suite, and the only route that\n * answers for any identity. Each product decides what it means.\n */\n window.location.assign('/')\n }\n\n useEffect(() => {\n if (!impersonation) return\n\n const timer = setInterval(() => {\n const restante = remaining(impersonation.expiresAt)\n setLeft(restante)\n\n /*\n * Vencido: a tela tem que acompanhar, e sem ninguém clicar em nada.\n *\n * Until now the clock hit zero and nothing else happened: the bar\n * stayed on screen, `localStorage` kept the target's dead token, and\n * every product answered 401 — which panels read as the end of a\n * session and handle by signing out. The operator lost their own\n * account because a borrowed session expired.\n *\n * `endedByTimer` walks the same path as the button: drop the\n * target's token and go to the root. What decides who shows up next\n * is the SERVER — the operator's session cookie was never touched,\n * so if it is alive the home loads as them; if there is no session\n * behind it, `/auth/session` answers without a user and the panel\n * sends them to the login, which is correct. There is nothing to\n * guess here.\n */\n if (!restante) endedByTimer()\n }, 1000)\n\n return () => clearInterval(timer)\n }, [impersonation, endedByTimer])\n\n if (!impersonation) return null\n\n // Durante o primeiro segundo `left` ainda é o valor de outra impersonação\n // (ou nulo); derivar aqui evita um setState no corpo do efeito só para isso.\n const clock = left ?? remaining(impersonation.expiresAt)\n\n return (\n <div style={styles.wrap}>\n <div\n style={styles.bar}\n role=\"status\"\n >\n <span>\n Você está vendo como <span style={styles.strong}>{user?.name || user?.email}</span>\n {impersonation.actor ? <> · sessão aberta por {impersonation.actor}</> : null}\n </span>\n {clock ? <span style={styles.clock}>encerra em {clock}</span> : null}\n {impersonation.id ? (\n <button\n type=\"button\"\n style={styles.button}\n onClick={handleEnd}\n disabled={ending}\n >\n {ending ? 'Encerrando…' : 'Encerrar'}\n </button>\n ) : null}\n </div>\n </div>\n )\n}\n","import { createContext, useEffect, useMemo } from 'react'\nimport { useShallow } from 'zustand/react/shallow'\nimport { useAuthStore } from './authStore.js'\nimport { consumeSocialToken, configure } from './authSdk.js'\nimport ImpersonationBanner from './components/ImpersonationBanner.jsx'\nimport { markIdentitySwitching } from './identitySwitch.js'\n\nconst AuthContext = createContext() // só para ter o Provider em JSX\n\n// How often a tab asks the server who it is. Short enough for an identity\n// switch to surface on its own, long enough not to weigh on an idle panel.\nconst IMPERSONATION_POLL_MS = 10 * 1000\n\nexport function AuthProvider({\n children,\n apiKey, // API Key para header X-API-Key (obrigatória exceto em modo internal)\n apiUrl, // URL do manager (opcional, padrão: http://auth.worker.myinfrastructure.click)\n internal = false, // Modo interno: não exige API Key (para aplicações same-domain como dashboard)\n onError, // Callback de erro global\n}) {\n // Validação de props obrigatórias\n // apiKey só é obrigatória se não estiver em modo internal\n if (!internal && !apiKey) {\n throw new Error('[@ciromaciel/auth-react] apiKey é obrigatória no AuthProvider. ' + 'Obtenha sua API Key no dashboard em https://auth.dashboard.myinfrastructure.click')\n }\n\n const init = useAuthStore(s => s.init)\n const startRefresh = useAuthStore(s => s.startRefresh)\n const revalidate = useAuthStore(s => s.revalidate)\n const checkTokenValidity = useAuthStore(s => s.checkTokenValidity)\n\n // Configura SDK com apiKey, apiUrl e modo interno\n // Usamos useMemo para garantir que a configuração ocorra ANTES dos efeitos dos componentes filhos\n useMemo(() => {\n configure({ apiKey, apiUrl, internal })\n\n /*\n * A social sign-in landing here brings its token in the fragment.\n *\n * It is consumed in this `useMemo`, BEFORE `init()` runs in the effect\n * below: `init` reads the stored token to resolve the session, so a\n * token still sitting in the URL at that moment would be missed, and the\n * person would land signed out on the page they just signed into.\n *\n * Reading it also strips it from the address bar, so a copied URL never\n * carries a live session.\n */\n consumeSocialToken()\n }, [apiKey, apiUrl, internal])\n\n useEffect(() => {\n init()\n startRefresh()\n }, [init, startRefresh])\n\n // Sincronização entre abas - escuta logout e mudanças no token\n useEffect(() => {\n if (typeof window === 'undefined') return\n\n const handleStorageChange = event => {\n if (event.key === 'auth:logout') {\n // Limpa o user do store - a aplicação redireciona automaticamente quando user é null\n useAuthStore.setState({ user: null, currentSession: null, sessions: [] })\n }\n /*\n * Another tab of this origin switched identity.\n *\n * It clears its own storage and reloads, but each tab has its own\n * mounted screens — lists and counters that belong to whoever was\n * signed in a moment ago. Wiping here and reloading is what makes a\n * sibling tab follow along instead of showing the previous person's\n * data under the new person's name.\n *\n * This is the SDK's job, not each app's: every consumer of\n * `AuthProvider` gets it without writing anything, ours and our\n * customers' alike.\n */\n if (event.key === 'auth:identity-switched') {\n markIdentitySwitching()\n window.location.assign('/')\n return\n }\n\n // The token changed in another tab of THIS origin.\n //\n // `checkTokenValidity` only reads the stored JWT's `exp`, which\n // cannot tell a different person from the same one — and after an\n // impersonation starts or ends, a different person is exactly what\n // it is. Asking the server is what makes the sibling tab follow the\n // switch instead of sitting on the previous identity's data.\n //\n // `force` skips the focus throttle: this is an event, not a stream,\n // and a background tab may never get focus to catch up.\n if (event.key === 'auth:token') {\n revalidate({ force: true })\n }\n }\n\n // Escuta evento de sessão revogada (quando o usuário revoga sua própria sessão)\n const handleSessionRevoked = () => {\n // Limpa o usuário do store\n useAuthStore.setState({ user: null, currentSession: null, sessions: [] })\n // Dispara evento de logout para sincronizar entre abas\n localStorage.setItem('auth:logout', Date.now())\n }\n\n window.addEventListener('storage', handleStorageChange)\n window.addEventListener('auth:session-revoked', handleSessionRevoked)\n return () => {\n window.removeEventListener('storage', handleStorageChange)\n window.removeEventListener('auth:session-revoked', handleSessionRevoked)\n }\n }, [revalidate])\n\n // Revalidate the session when the tab regains focus.\n //\n // `init` runs once: a tab opened BEFORE the user signed in on another\n // dashboard stays on `user: null` until a manual refresh. The session\n // cookie belongs to the zone, but localStorage is per origin — so the\n // `storage` event never crosses from one dashboard to another. Asking the\n // server on focus is what carries a sign-in (and a sign-out) between them.\n useEffect(() => {\n if (typeof window === 'undefined') return\n\n const handleFocus = () => {\n if (document.visibilityState === 'visible') revalidate()\n }\n\n document.addEventListener('visibilitychange', handleFocus)\n window.addEventListener('focus', handleFocus)\n return () => {\n document.removeEventListener('visibilitychange', handleFocus)\n window.removeEventListener('focus', handleFocus)\n }\n }, [revalidate])\n\n // Verifica validade do token periodicamente\n useEffect(() => {\n if (typeof window === 'undefined') return\n\n const interval = setInterval(() => {\n checkTokenValidity()\n }, 30 * 1000) // Verifica a cada 30 segundos\n\n return () => clearInterval(interval)\n }, [checkTokenValidity])\n\n // Ask the server every so often — even with the tab in the background, and\n // WITHOUT depending on knowing an impersonation is open.\n //\n // `checkTokenValidity` above only reads the `exp` of the stored JWT, and a\n // target's token has an `exp` in the future: it stays \"valid\" after the\n // impersonation ended. Focus revalidation does not help a tab nobody\n // touched. That is what left Functions showing the target after ending\n // elsewhere: nothing in that tab had a reason to ask again.\n //\n // Gating this on `impersonation` was the obvious move and the wrong one: it\n // makes the recovery depend on the very state that goes stale. When the\n // store lost `impersonation` while still holding the target as `user` — the\n // bar disappeared and the data did not — the poll stopped with it, and the\n // tab had no way back at all.\n //\n // Unconditional, the tab always has a way back. One request every ten\n // seconds against a route that answers from the session is cheap; being\n // stuck as another person is not.\n useEffect(() => {\n if (typeof window === 'undefined') return\n const interval = setInterval(() => revalidate({ force: true }), IMPERSONATION_POLL_MS)\n return () => clearInterval(interval)\n }, [revalidate])\n\n // Contexto com onError callback\n const contextValue = useMemo(() => ({ onError }), [onError])\n\n /*\n * The impersonation bar ships WITH the Provider.\n *\n * That is what makes all seven panels warn without any of them being\n * changed: they all already wrap the app in `AuthProvider`. Letting each\n * panel mount it by hand is how one of them gets left out — and the panel\n * left out is precisely where the operator forgets whose account they are\n * in.\n *\n * It renders nothing when no impersonation is open, so it costs nothing in\n * the normal case.\n */\n return (\n <AuthContext.Provider value={contextValue}>\n <ImpersonationBanner />\n {children}\n </AuthContext.Provider>\n )\n}\n\n/* Hooks \"facade\" que a app vai usar */\nexport const useAuth = () =>\n useAuthStore(\n useShallow(s => ({\n user: s.user,\n loading: s.loading,\n error: s.error,\n isAuthenticated: s.user !== null,\n requestCode: s.requestCode,\n verifyCode: s.verifyCode,\n signOut: s.signOut,\n }))\n )\n\n/**\n * Sign in: the two steps, and nothing else.\n *\n * `requestCode(email, { name })` sends the code. `verifyCode(email, code)`\n * returns the session. There is no separate sign-up — the first entry creates\n * the account.\n */\nexport const useSignIn = () =>\n useAuthStore(\n useShallow(s => ({\n requestCode: s.requestCode,\n verifyCode: s.verifyCode,\n sending: s.loadingStates.requestCode,\n verifying: s.loadingStates.verifyCode,\n error: s.error,\n }))\n )\n\n// Auth Actions\nexport const useSignOut = () => useAuthStore(s => s.signOut)\nexport const useCheckToken = () => useAuthStore(s => s.checkTokenValidity)\n\n// Session Hook\nexport const useSession = () =>\n useAuthStore(\n useShallow(s => ({\n getSession: s.getSession,\n user: s.user,\n setUser: s.setUser,\n }))\n )\n\n// Loading States Hook\nexport const useAuthLoading = () => useAuthStore(s => s.loadingStates)\n\n// Profile Management Hook (novo nome estilo Clerk)\nexport const useUser = () =>\n useAuthStore(\n useShallow(s => ({\n user: s.user,\n updateProfile: s.updateProfile,\n loadingUpdateProfile: s.loadingStates.updateProfile,\n error: s.error,\n }))\n )\n\n// Alias deprecado para backwards compatibility\nexport const useProfile = useUser\n\n// Sessions Management Hook\nexport const useSessions = () =>\n useAuthStore(\n useShallow(s => ({\n currentSession: s.currentSession,\n sessions: s.sessions,\n getSession: s.getSession,\n listSessions: s.listSessions,\n revokeSession: s.revokeSession,\n revokeOtherSessions: s.revokeOtherSessions,\n loadingListSessions: s.loadingStates.listSessions,\n loadingRevokeSession: s.loadingStates.revokeSession,\n error: s.error,\n }))\n )\n\n/**\n * The impersonation in progress, or `null`.\n *\n * Exposed so a panel can adapt what it OFFERS while the session is borrowed.\n * The banner already says whose account this is; this is for the screens that\n * would otherwise invite the target to do something only an administrator does\n * — \"create your first company\" makes no sense for an end user being looked at.\n *\n * Returns the record (`{ id, actor, expiresAt }`), so a screen can name who\n * opened the session without a second call.\n */\nexport const useImpersonation = () => useAuthStore(s => s.impersonation)\n\n// Application Logo Hook\nexport const useApplicationLogo = () => {\n const applicationInfo = useAuthStore(s => s.applicationInfo)\n // Retorna o logo da aplicação ou null (componentes usam fallback padrão)\n return applicationInfo?.image || null\n}\n","import { Navigate, Outlet } from 'react-router-dom'\nimport { useAuth } from './AuthProvider.jsx'\n\nexport default function Protect({ fallback = <p>⌛ Carregando...</p>, redirectTo = '/login' }) {\n const { user, loading } = useAuth()\n\n if (loading) return fallback\n if (!user)\n return (\n <Navigate\n to={redirectTo}\n replace\n />\n )\n\n return <Outlet />\n}\n","import { Navigate, Outlet } from 'react-router-dom'\nimport { useAuth } from './AuthProvider.jsx'\nimport { getRedirectFromLocation } from './redirect.js'\n\n/**\n * O par do `<Protect>`: a rota pública que quem JÁ tem sessão não deveria ver.\n *\n * `<Protect>` cobria metade da porta — tira de dentro quem não está logado, mas\n * nada tirava da tela de login quem está, e essa tela é pública justamente para\n * não depender de sessão. Chegar em `/auth/signin` autenticado renderizava o\n * formulário, e só um F5 saía dele: no recarregamento o `init()` roda,\n * `/auth/session` responde com o usuário, e aí a navegação acontece.\n *\n * ESPERAR O `loading` É A PARTE QUE IMPORTA. Enquanto ele for `true` o store\n * ainda não perguntou nada ao servidor e `user` é `null` — indistinguível de\n * \"não está logado\". Renderizar o formulário nessa janela é o mesmo bug, só que\n * mais curto. Por isso o `fallback` existe: passe o MESMO esqueleto que vai no\n * `<Protect>`, e a pessoa vê uma tela só até a resposta chegar.\n *\n * O `?redirect=` ganha do `redirectTo`: quem veio de uma autorização OAuth\n * volta para ela, não para a home do painel. `getRedirectFromLocation` valida\n * contra a allowlist, então um destino forjado devolve `null` — sem isso a tela\n * de login vira open redirect.\n *\n * Aceita os dois formatos de rota, porque os dois existem nos painéis:\n *\n * <Route path=\"signin\" element={<GuestOnly fallback={<AuthLoader />}><SignIn /></GuestOnly>} />\n *\n * <Route element={<GuestOnly fallback={<AuthLoader />} />}>\n * <Route path=\"signin\" element={<SignIn />} />\n * </Route>\n */\nexport default function GuestOnly({ children, fallback = null, redirectTo = '/', extraOrigins = [] }) {\n const { user, loading } = useAuth()\n\n if (loading) return fallback\n if (!user) return children ?? <Outlet />\n\n const to = getRedirectFromLocation(extraOrigins) || redirectTo\n\n // `//alvo` parece caminho e sai do domínio: é externo, e o roteador desta\n // aplicação não o alcança.\n const isInternal = to.startsWith('/') && !to.startsWith('//')\n if (!isInternal) {\n window.location.replace(to)\n return fallback\n }\n\n return (\n <Navigate\n to={to}\n replace\n />\n )\n}\n","import { Paper, Stack, Image, Title, Text, Modal, Box, Divider, ThemeIcon, Group } from '@mantine/core'\n\n/**\n * Container wrapper para componentes de autenticação\n * Suporta renderização como Card (Paper) ou Modal\n *\n * @param {object} props\n * @param {string|React.ReactNode} [props.logo] - URL da imagem ou nó React (ex.: <Wordmark />)\n * @param {'card'|'modal'} [props.variant='card'] - Modo de renderização\n * @param {boolean} [props.opened] - Controla visibilidade do modal (apenas para variant=\"modal\")\n * @param {function} [props.onClose] - Callback ao fechar modal (apenas para variant=\"modal\")\n * @param {object} [props.modalProps] - Props adicionais para o Modal\n */\nexport default function AuthCard({\n children,\n title,\n subtitle,\n logo,\n logoWidth = 133,\n width = 350,\n\n // Variant props\n variant = 'card',\n opened,\n onClose,\n modalProps = {},\n\n ...props\n}) {\n // Conteúdo interno compartilhado entre Card e Modal\n const content = (\n <Stack gap=\"sm\">\n {(logo || title || subtitle) && (\n <Stack\n gap={6}\n align=\"center\"\n ta=\"center\"\n >\n {logo &&\n (typeof logo === 'string' ? (\n <Image\n src={logo}\n alt=\"Auth\"\n mx=\"auto\"\n w={logoWidth}\n fit=\"contain\"\n />\n ) : (\n logo\n ))}\n\n {title && (\n <Title\n order={3}\n ta=\"center\"\n >\n {title}\n </Title>\n )}\n\n {subtitle && (\n <Text\n size=\"sm\"\n c=\"dimmed\"\n ta=\"center\"\n >\n {subtitle}\n </Text>\n )}\n </Stack>\n )}\n\n {children}\n </Stack>\n )\n\n // Renderizar como Modal\n if (variant === 'modal') {\n return (\n <Modal\n opened={opened}\n onClose={onClose}\n size={width + 50}\n withCloseButton\n radius={0}\n overlayProps={{ backgroundOpacity: 0.55, blur: 3 }}\n title={\n <Group\n gap=\"sm\"\n wrap=\"nowrap\"\n >\n {logo &&\n (typeof logo === 'string' ? (\n <Image\n src={logo}\n alt=\"Auth\"\n h={logoWidth}\n fit=\"contain\"\n />\n ) : (\n logo\n ))}\n {title && <Title order={4}>{title}</Title>}\n </Group>\n }\n {...modalProps}\n >\n {/* Quando em modal, não repetir logo/title no content */}\n <Stack gap=\"sm\">\n {subtitle && (\n <Text\n size=\"sm\"\n c=\"dimmed\"\n >\n {subtitle}\n </Text>\n )}\n {children}\n </Stack>\n </Modal>\n )\n }\n\n // Renderizar como Card (default)\n return (\n <Paper\n withBorder\n shadow=\"none\"\n p={24}\n /*\n * `w` fixo nao encolhe: num celular de 375px o cartao de 350px\n * mais o padding da pagina estourava a tela e a coluna da direita\n * ficava cortada. `maw` mantem a MESMA largura onde ela cabe e\n * cede onde nao cabe.\n */\n w=\"100%\"\n maw={width}\n radius={0}\n {...props}\n >\n {content}\n </Paper>\n )\n}\n","import { ActionIcon, Anchor, Avatar, Button, Group, Loader, NavLink, Paper, Stack, Text } from '@mantine/core'\nimport { IconArrowRight, IconX } from '@tabler/icons-react'\n\nconst PROVIDER_NAMES = { google: 'Google', github: 'GitHub' }\n\nconst providerName = method => PROVIDER_NAMES[method] || method.charAt(0).toUpperCase() + method.slice(1)\n\nconst RELATIVE = new Intl.RelativeTimeFormat('pt-BR', { numeric: 'auto' })\n\n/** \"há 2 horas\", \"ontem\", \"há 6 dias\" — the unit that reads naturally. */\nexport function formatLastUsed(timestamp, now = Date.now()) {\n const minutes = Math.round((timestamp - now) / 60000)\n if (Math.abs(minutes) < 1) return RELATIVE.format(0, 'second')\n if (Math.abs(minutes) < 60) return RELATIVE.format(minutes, 'minute')\n\n const hours = Math.round(minutes / 60)\n if (Math.abs(hours) < 24) return RELATIVE.format(hours, 'hour')\n\n const days = Math.round(hours / 24)\n if (Math.abs(days) < 30) return RELATIVE.format(days, 'day')\n\n const months = Math.round(days / 30)\n if (Math.abs(months) < 12) return RELATIVE.format(months, 'month')\n\n return RELATIVE.format(Math.round(days / 365), 'year')\n}\n\n/** \"ciro\" → \"C\", \"qa+monitors\" → \"QM\". */\nfunction initialsOf(email) {\n const local = email.split('@')[0]\n const parts = local.split(/[.+_-]/).filter(Boolean)\n return ((parts[0] || local).charAt(0) + (parts[1] ? parts[1].charAt(0) : '')).toUpperCase()\n}\n\n/**\n * The first step for someone this browser already knows.\n *\n * Each row is the whole action: clicking it sends the code (or leaves for the\n * provider the account used last time), so a returning person goes from\n * opening the screen to typing the code in one click.\n *\n * Removing is behind \"Gerenciar\" on purpose. An × always in view sits right\n * next to the row the person came to click, and a slip would drop the account\n * they meant to use. Nothing is lost by removing — signing in again brings the\n * account back — so there is no confirmation step either.\n */\nexport default function RecentAccounts({ accounts, pickingEmail = null, managing = false, onToggleManage, onPick, onForget, onUseOther, labels = {} }) {\n const busy = !!pickingEmail\n\n return (\n <Stack gap=\"md\">\n <Stack gap={8}>\n <Group\n justify=\"space-between\"\n align=\"baseline\"\n wrap=\"nowrap\"\n >\n <Text\n fz={11}\n fw={800}\n lh={1}\n tt=\"uppercase\"\n lts=\"1.5px\"\n c=\"gray.4\"\n >\n {labels.recentAccountsHeading || 'Contas neste navegador'}\n </Text>\n\n <Anchor\n component=\"button\"\n type=\"button\"\n /*\n * The size of the heading it sits beside, not of body\n * text: it is a secondary control of the list, and at\n * 14px it outweighed the 11px label it annotates.\n */\n fz={12}\n lh={1}\n c=\"dimmed\"\n onClick={busy ? undefined : onToggleManage}\n >\n {managing ? labels.recentAccountsDone || 'Concluir' : labels.recentAccountsManage || 'Gerenciar'}\n </Anchor>\n </Group>\n\n <Paper\n withBorder\n radius={0}\n p={0}\n >\n {accounts.map((account, index) => {\n const isPicking = pickingEmail === account.email\n const isSocial = account.method !== 'code'\n\n const description = isPicking\n ? isSocial\n ? `${labels.openingProvider || 'Abrindo o'} ${providerName(account.method)}…`\n : labels.sendingCode || 'Enviando código…'\n : `${labels.lastUsed || 'Último acesso'} ${formatLastUsed(account.lastUsedAt)}${isSocial ? ` · ${providerName(account.method)}` : ''}`\n\n return (\n <NavLink\n key={account.email}\n /*\n * A `div` while managing: the row then holds the\n * remove button, and a button inside a button is\n * invalid HTML that browsers repair by splitting\n * the row in two.\n */\n component={managing ? 'div' : 'button'}\n type={managing ? undefined : 'button'}\n aria-disabled={busy || undefined}\n onClick={managing || busy ? undefined : () => onPick(account)}\n noWrap\n label={\n <Text\n fz={14}\n fw={600}\n c=\"gray.9\"\n truncate\n >\n {account.email}\n </Text>\n }\n description={description}\n leftSection={\n <Avatar\n radius={0}\n size={36}\n color=\"gray\"\n variant=\"light\"\n >\n {initialsOf(account.email)}\n </Avatar>\n }\n rightSection={\n managing ? (\n <ActionIcon\n variant=\"subtle\"\n color=\"gray\"\n aria-label={`${labels.removeAccount || 'Remover'} ${account.email}`}\n onClick={() => onForget(account)}\n >\n <IconX size={16} />\n </ActionIcon>\n ) : isPicking ? (\n <Loader size={14} />\n ) : (\n <IconArrowRight\n size={16}\n color=\"var(--mantine-color-gray-5)\"\n />\n )\n }\n py={10}\n style={index > 0 ? { borderTop: '1px solid var(--mantine-color-gray-2)' } : undefined}\n />\n )\n })}\n </Paper>\n </Stack>\n\n <Button\n type=\"button\"\n variant=\"default\"\n fullWidth\n aria-disabled={busy}\n onClick={busy ? undefined : onUseOther}\n >\n {labels.useOtherEmail || 'Usar outro e-mail'}\n </Button>\n </Stack>\n )\n}\n","import { useEffect, useState } from 'react'\nimport { Button, Divider, Group, Stack, Text } from '@mantine/core'\nimport { IconBrandGoogle } from '@tabler/icons-react'\n\nimport { getSocialProviders, startSocialSignIn } from '../authSdk.js'\n\n/*\n * The provider marks.\n *\n * Tabler outlines at stroke 1.5, like every other icon in the system — not the\n * providers' full-colour logos.\n *\n * That is a deliberate departure from what Google's brand guidelines ask for,\n * and the reason is that colour MEANS something here: it is reserved for state\n * (a semaphore reading as a semaphore, a notification as a warning). Four brand\n * colours on a sign-in button spend that signal on decoration, and the button\n * next to it — the one that actually submits — would read as less important\n * than the one that just leaves.\n *\n * A remote logo would also be a third-party request that can hang, leaving a\n * hole in the button at the exact moment someone is deciding to trust the page.\n */\nconst MARKS = { google: IconBrandGoogle }\n\n/**\n * The social sign-in buttons, driven by what the APPLICATION has enabled.\n *\n * WHY THE LIST IS FETCHED AND NOT PASSED IN\n *\n * The owner configures Google in the Auth panel. Asking the integrator to ALSO\n * declare it in code would be two sources for one fact, and they would drift:\n * turning the provider off in the panel would leave a button that fails. So the\n * component asks the worker which providers are live.\n *\n * It renders NOTHING while it does not know, and nothing when the answer is\n * empty — an application with no social provider sees no divider, no gap, no\n * trace of this component.\n */\nexport default function SocialButtons({\n labels = {},\n redirect,\n disabled = false,\n // Whether the account returning from the provider joins this browser's\n // recent list (`recent-accounts.js`). `<SignIn recentAccounts={false}>`\n // turns it off here too.\n rememberAccount = true,\n}) {\n const [providers, setProviders] = useState(null)\n const [leaving, setLeaving] = useState(null)\n\n useEffect(() => {\n let active = true\n getSocialProviders().then(list => {\n // The screen may have unmounted while the request was in flight.\n if (active) setProviders(list)\n })\n return () => {\n active = false\n }\n }, [])\n\n // `null` is \"still asking\", `[]` is \"asked, and there are none\". Both render\n // nothing, but only the second is a final answer.\n if (!providers || providers.length === 0) return null\n\n return (\n <Stack gap=\"md\">\n <Divider\n label={labels.socialDivider || 'ou'}\n labelPosition=\"center\"\n />\n\n {providers.map(provider => {\n const Mark = MARKS[provider.provider]\n\n return (\n <Button\n key={provider.provider}\n variant=\"default\"\n fullWidth\n size=\"md\"\n /*\n * `aria-disabled`, not `disabled`: Mantine's `disabled`\n * repaints the button grey and hides its label, and this\n * button is what the person is trying to click. The\n * handler below is what actually refuses.\n */\n aria-disabled={disabled || leaving !== null}\n loading={leaving === provider.provider}\n onClick={() => {\n if (disabled || leaving !== null) return\n // Kept in state so a double click does not fire two\n // navigations — the second would orphan the first\n // `oauth_states` row.\n setLeaving(provider.provider)\n startSocialSignIn(provider.provider, { redirect, rememberAccount })\n }}\n >\n <Group\n gap={10}\n wrap=\"nowrap\"\n justify=\"center\"\n >\n {Mark && (\n <Mark\n size={16}\n stroke={1.5}\n />\n )}\n <Text\n fz={14}\n fw={700}\n >\n {labels.socialButton ? labels.socialButton(provider.name) : `Entrar com ${provider.name}`}\n </Text>\n </Group>\n </Button>\n )\n })}\n </Stack>\n )\n}\n","import { Text } from '@mantine/core'\n\n/**\n * Wordmark tipográfico — a marca no padrão Zen da RiLiGar.\n *\n * Substitui o antigo logotipo em bitmap como identidade padrão dos cards de\n * autenticação. Tipografia é nítida em qualquer densidade de tela, herda a cor\n * do tema e acompanha o dark mode — coisas que um .webp não faz.\n *\n * Escala Small Caps (fw 800, lts 1.5px, gray.4): a marca é o \"anúncio\" acima\n * do título, nunca um segundo título. Quem carrega o peso é o <Title>.\n *\n * Aplicações com logo próprio continuam passando `logo` ou configurando a\n * imagem no painel; nesse caso o wordmark não aparece.\n */\nexport function Wordmark({ fz = 11, c = 'gray.4', ...props }) {\n return (\n <Text\n component=\"span\"\n display=\"block\"\n ta=\"center\"\n fz={fz}\n fw={800}\n lh={1}\n tt=\"uppercase\"\n lts=\"1.5px\"\n c={c}\n {...props}\n >\n Auth\n </Text>\n )\n}\n\nexport default Wordmark\n","// Where the terms live. Hardcoded on purpose, like `API_BASE` in authSdk.js:\n// this ships inside the published bundle, and every screen of the seven panels\n// that links to the terms — the sign-in notice and the account card's footer —\n// must point at the same document. `termsUrl` overrides it for whoever hosts\n// their own.\nexport const TERMS_URL = 'https://myinfrastructure.click/legal/terms'\n","import { useState, useEffect, useRef } from 'react'\nimport { TextInput, Button, Stack, Anchor, Center, Text, Loader, Group, Alert } from '@mantine/core'\nimport { useForm } from '@mantine/form'\nimport { useNavigate } from 'react-router-dom'\nimport { getRedirectFromLocation, applyRedirect } from '../redirect'\nimport { IconAlertCircle, IconArrowLeft, IconArrowRight, IconRefresh } from '@tabler/icons-react'\nimport { useAuthStore } from '../authStore.js'\nimport { useApplicationLogo } from '../AuthProvider.jsx'\nimport { deleteRecentAccount, fetchRecentAccounts, getSocialProviders, saveRecentAccount, startSocialSignIn } from '../authSdk.js'\nimport { adoptRecentAccounts, forgetAccount, listRecentAccounts, rememberAccount } from '../recent-accounts.js'\nimport AuthCard from './AuthCard.jsx'\nimport RecentAccounts from './RecentAccounts.jsx'\nimport SocialButtons from './SocialButtons.jsx'\n\nimport { Wordmark } from './Wordmark.jsx'\nimport { TERMS_URL } from '../terms.js'\n\n/**\n * The terms notice under the first step.\n *\n * It sits on step ONE and nowhere else: the account is born on the first\n * `verify` and there is no separate sign-up screen to put it on — this form IS\n * the sign-up for whoever has never entered. On step two the person already\n * agreed by asking for the code; repeating it there would only push the code\n * field down.\n */\nfunction TermsNotice({ url, text, linkText }) {\n if (!url) return null\n\n return (\n <Text\n size=\"xs\"\n c=\"dimmed\"\n ta=\"center\"\n /*\n * Tighter than the `gap=\"md\"` of the Stack around it, and a hair\n * tighter than default leading. This is fine print under the action,\n * not a third step of the form — spaced like the field and the\n * button it would read as one more thing to do.\n */\n mt={-4}\n lh={1.4}\n /*\n * Two short lines instead of one full-width line plus an orphan.\n * At the card's 350px the sentence wrapped as \"…todos os / nossos\n * termos e condições\", splitting the phrase away from the words that\n * govern it. Balanced, the break falls where the meaning does.\n */\n style={{ textWrap: 'balance' }}\n >\n {text}{' '}\n <Anchor\n href={url}\n target=\"_blank\"\n /*\n * `noopener noreferrer` with `target=\"_blank\"`: the same pair the\n * footers of the house use for anything leaving the origin\n * (`site-chrome.jsx`, `ProductLayout.jsx`). Opening in a new tab\n * is not decoration here — the person is mid-sign-in, and\n * navigating away would throw the typed email out.\n */\n rel=\"noopener noreferrer\"\n /*\n * `inherit` takes the size and weight of the sentence around it,\n * so the link does not turn into a bold island inside the fine\n * print — but it also takes the COLOR, and in the Zen palette\n * `primaryColor: 'gray'` paints the Anchor near-black. Against\n * dimmed text that reads as emphasis, not as something to click.\n *\n * The underline is what says \"link\" here: it survives whatever\n * `primaryColor` each panel sets, and it is the only affordance\n * left once the colour matches the sentence.\n */\n inherit\n c=\"inherit\"\n underline=\"always\"\n >\n {linkText}\n </Anchor>\n .\n </Text>\n )\n}\n\n/**\n * What a failed `verify` means for the person, read from the worker's answer.\n *\n * The HTTP status carries the case — `code` is `VALIDATION_ERROR` for both a\n * wrong and an expired code, so it cannot tell them apart:\n * - 400 with `details.attemptsLeft`: wrong code, the request is still open;\n * - 400 without it: no open request for this email (already replaced);\n * - 429: the fifth wrong try destroyed the request;\n * - 410: the code outlived its minutes, and was destroyed too.\n *\n * Anything else — the network, a 500 — is not about the code, and must not\n * lock the field.\n */\nexport function describeCodeFailure(error) {\n if (error?.status === 429) return { kind: 'exhausted', isLocked: true }\n if (error?.status === 410) return { kind: 'expired', isLocked: true }\n if (error?.status === 400) {\n const attemptsLeft = error?.details?.attemptsLeft\n return { kind: 'wrong', isLocked: false, attemptsLeft: Number.isInteger(attemptsLeft) ? attemptsLeft : null }\n }\n return { kind: 'other', isLocked: false, message: error?.message || null }\n}\n\n/**\n * The notice above the code field.\n *\n * It sits ABOVE the field, not under it, and says what to do next — not only\n * that something failed. The field's own error line was 12px of red under a\n * cleared input, next to a greyed-out button: it read as a frozen screen.\n *\n * The most common cause gets named: a new code invalidates the previous one,\n * and the person is often reading an older email.\n */\nfunction CodeFailureNotice({ failure, labels }) {\n if (!failure) return null\n\n const texts = {\n wrong: {\n title: labels.wrongCodeTitle || 'Código incorreto',\n body: [\n labels.wrongCodeHint || 'Confira o e-mail mais recente: um código novo invalida o anterior.',\n failure.attemptsLeft === 1\n ? labels.lastAttempt || 'Esta é a última tentativa.'\n : failure.attemptsLeft > 1\n ? labels.attemptsLeft\n ? labels.attemptsLeft(failure.attemptsLeft)\n : `Restam ${failure.attemptsLeft} tentativas.`\n : null,\n ]\n .filter(Boolean)\n .join(' '),\n },\n exhausted: {\n title: labels.attemptsExhaustedTitle || 'Tentativas esgotadas',\n body: labels.attemptsExhausted || 'Por segurança, este código foi cancelado. Peça um novo para continuar.',\n },\n expired: {\n title: labels.codeExpiredTitle || 'Código expirado',\n body: labels.codeExpired || 'O código vale por poucos minutos. Peça um novo para continuar.',\n },\n other: {\n title: labels.codeFailedTitle || 'Não foi possível entrar',\n body: failure.message || labels.invalidCode || 'Tente de novo em instantes.',\n },\n }[failure.kind]\n\n return (\n <Alert\n color=\"red\"\n variant=\"light\"\n radius={0}\n icon={<IconAlertCircle size={18} />}\n title={texts.title}\n /*\n * `role=\"alert\"` is Mantine's default and is what makes a screen\n * reader announce the failure without the person moving focus away\n * from the field they are about to retype in.\n */\n styles={{ root: { border: '1px solid var(--mantine-color-red-2)' } }}\n >\n <Text\n size=\"sm\"\n lh={1.45}\n >\n {texts.body}\n </Text>\n </Alert>\n )\n}\n\n// The OAuth flow's pass-through screen.\n//\n// The panel is not the destination here: the user is authorizing an MCP client\n// and only passes through this origin because it is where the token lives. A\n// blank screen during the detour looks like a freeze; this one says what is\n// happening.\nfunction AuthTransition({ label = 'Conectando…' }) {\n return (\n <Center style={{ minHeight: '60vh' }}>\n <Stack\n align=\"center\"\n gap=\"sm\"\n >\n <Loader size=\"xs\" />\n <Text\n size=\"sm\"\n c=\"dimmed\"\n >\n {label}\n </Text>\n </Stack>\n </Center>\n )\n}\n\n/**\n * Sign in — the only path there is.\n *\n * Two steps: the email receives a code, the code becomes a session. There is no\n * password, magic link, sign-up or recovery — first-time arrivals and returning\n * people walk exactly this screen, and the account is born on the first entry.\n *\n * Nothing here builds a callback URL. The code is typed in this very tab, so\n * there is no destination to validate — which is why the family of\n * origin/redirect bugs does not reach this flow.\n *\n * @param {object} props\n * @param {'card'|'modal'} [props.variant='card'] - Rendering mode\n * @param {boolean} [props.opened] - Visibility (only for variant=\"modal\")\n * @param {function} [props.onClose] - Close callback (only for variant=\"modal\")\n */\nexport default function SignIn({\n // Configuration\n logo, // No default: it is computed below\n logoWidth = 133,\n title = 'Entrar',\n subtitle = 'Enviaremos um código para o seu e-mail',\n\n // Variant\n variant = 'card',\n opened,\n onClose,\n modalProps = {},\n\n // Where to send someone who ALREADY has a session and lands on this screen.\n // The landings link straight to /auth/signin without knowing a session\n // exists; without this, a signed-in user faced the form again. `null`\n // disables the detour.\n authenticatedRedirect = '/',\n\n // Shown while the session is being resolved and during the detour of an\n // already authenticated person. Avoids flashing the form to someone who\n // should never see it.\n redirectingFallback = null,\n\n // Callbacks\n onSuccess,\n // Post-sign-in redirect: by default the component honours `?redirect=` from\n // the URL, validating against the API's origin and the current one.\n // `redirectOrigins` adds domains; `handleRedirect={false}` hands control back\n // to the app.\n handleRedirect = true,\n redirectOrigins = [],\n onError,\n onCodeSent,\n\n // Custom labels\n labels = {},\n\n // The terms notice under the first step. `null` removes it — an internal\n // panel behind a VPN has no one to present terms to.\n termsUrl = TERMS_URL,\n\n /*\n * Social sign-in buttons.\n *\n * `'auto'` — the default — shows whatever the APPLICATION enabled in the\n * Auth panel, and nothing at all when it enabled none. It is additive: an\n * application with no provider configured renders exactly what it rendered\n * before this prop existed, so the default does not break anyone.\n *\n * `false` opts out entirely, for a screen that wants the emailed code only.\n */\n socialLogin = 'auto',\n\n /*\n * The accounts that already signed in on this browser, offered before the\n * empty field (`recent-accounts.js`). With none saved the screen is exactly\n * the email form, so the default changes nothing for a first visit.\n *\n * `false` neither shows nor saves: a shared computer, or an internal panel,\n * should not remember who used it.\n */\n recentAccounts = true,\n\n ...cardProps\n}) {\n const user = useAuthStore(s => s.user)\n const authLoading = useAuthStore(s => s.loading)\n const requestCode = useAuthStore(s => s.requestCode)\n const verifyCode = useAuthStore(s => s.verifyCode)\n const sending = useAuthStore(s => s.loadingStates.requestCode)\n const verifying = useAuthStore(s => s.loadingStates.verifyCode)\n\n // Which step we are on. The email is kept because the second step has to\n // present it again: it is the (email, code) pair the server validates.\n const [sentTo, setSentTo] = useState(null)\n const [code, setCode] = useState('')\n const [codeFailure, setCodeFailure] = useState(null)\n const [isCodeResent, setIsCodeResent] = useState(false)\n const codeInputRef = useRef(null)\n\n // Read once, on mount: the list only changes through this screen, and\n // every change below writes the new list back into state.\n const [accounts, setAccounts] = useState(() => (recentAccounts ? listRecentAccounts() : []))\n const [isChoosingOther, setIsChoosingOther] = useState(false)\n const [isManaging, setIsManaging] = useState(false)\n const [pickingEmail, setPickingEmail] = useState(null)\n const isShowingAccounts = recentAccounts && accounts.length > 0 && !isChoosingOther\n const isCodeLocked = !!codeFailure?.isLocked\n\n // Hook that fetches the application's logo\n const applicationLogo = useApplicationLogo()\n const finalLogo = logo || applicationLogo || <Wordmark />\n\n const navigate = useNavigate()\n\n const form = useForm({\n initialValues: {\n email: '',\n },\n validate: {\n email: value => (/^\\S+@\\S+$/.test(value) ? null : labels.invalidEmail || 'Email inválido'),\n },\n })\n\n // Whoever already has a session must not see the form. The landings point\n // to /auth/signin unconditionally, and since the session became shared\n // across `.myinfrastructure.click` (domain cookie) it is common to arrive here\n // already authenticated — the panel used to learn that only after a\n // redundant sign-in.\n //\n // It waits for `authLoading`: the provider's `init` resolves the session\n // asynchronously (cookie → /auth/session). Deciding before that would flash\n // the form to someone already signed in, or worse, redirect based on a\n // `user` that has not loaded yet.\n // `redirectOrigins` defaults to `[]` — a new array on every render. Used raw\n // as a dependency, it would re-run the effect in a loop.\n const redirectOriginsKey = JSON.stringify(redirectOrigins)\n\n useEffect(() => {\n if (authLoading || !user) return\n\n // `?redirect=` takes priority: whoever arrived through an OAuth flow\n // needs to go back there, not to the panel's home. Same decision as the\n // post-sign-in one, with the same origin validation.\n const target = (handleRedirect ? getRedirectFromLocation(redirectOrigins) : null) || authenticatedRedirect\n\n // `authenticatedRedirect={null}` disables the courtesy detour for\n // someone already signed in — but NOT the return of an OAuth flow, which\n // is an authorization in progress, not a convenience. The guard above\n // used to block both together.\n if (!target) return\n\n applyRedirect(target, navigate)\n // eslint-disable-next-line react-hooks/exhaustive-deps -- redirectOrigins enters through the serialized key above\n }, [authLoading, user, authenticatedRedirect, handleRedirect, redirectOriginsKey, navigate])\n\n /*\n * The shared list, from the worker.\n *\n * The local copy renders at once; this replaces it when the answer\n * arrives. That is what makes an account used on the Auth panel appear\n * on Hoster: `localStorage` never crosses between the two origins.\n *\n * If the person has already started typing an email, the list does not\n * yank the form away from under them — it only feeds the \"Contas salvas\"\n * link, one click away.\n */\n useEffect(() => {\n if (!recentAccounts) return\n let isActive = true\n\n fetchRecentAccounts().then(remote => {\n if (!isActive || remote === null) return\n const next = adoptRecentAccounts(remote)\n if (form.isDirty()) setIsChoosingOther(true)\n setAccounts(next)\n })\n\n return () => {\n isActive = false\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps -- once per mount, like the local read\n }, [recentAccounts])\n\n // Step 1 — ask for the code.\n const handleRequest = async values => {\n if (sending) return false\n try {\n await requestCode(values.email)\n setSentTo(values.email)\n setCode('')\n setCodeFailure(null)\n onCodeSent?.(values.email)\n return true\n } catch (error) {\n // Nothing on the card shows this one: the app's notification is\n // the only place the person learns the code was not sent.\n onError?.(error, { step: 'request', isShownOnCard: false })\n return false\n }\n }\n\n // A new code, from the code step. The worker replaces the request, so the\n // attempts start over and the previous code stops working — the notice\n // says so, or the person keeps typing the one from the older email.\n const handleResend = async () => {\n const isSent = await handleRequest({ email: sentTo })\n setIsCodeResent(isSent)\n if (isSent) codeInputRef.current?.focus()\n }\n\n // Step 1, from the list — the click on a saved account IS the request.\n //\n // An account that came in through a provider goes back to that provider,\n // as long as the application still offers it. If the owner turned it off\n // in the meantime the emailed code still works for the same email, so that\n // is the fallback rather than a dead row.\n const handlePick = async account => {\n if (pickingEmail || sending) return\n setPickingEmail(account.email)\n\n if (account.method !== 'code' && socialLogin !== false) {\n const providers = await getSocialProviders()\n if (providers?.some(provider => provider.provider === account.method)) {\n // The page is leaving; the row keeps its spinner until it does.\n startSocialSignIn(account.method, { rememberAccount: recentAccounts })\n return\n }\n }\n\n await handleRequest({ email: account.email })\n setPickingEmail(null)\n }\n\n const handleForget = account => {\n const next = forgetAccount(account.email)\n setAccounts(next)\n // On every panel, not just this one. The local removal above already\n // took it off this screen, so a failure here costs nothing visible.\n deleteRecentAccount(account.email)\n if (next.length === 0) setIsManaging(false)\n }\n\n // Step 2 — trade the code for the session.\n //\n // The redirect is decided AND EXECUTED before onSuccess.\n //\n // Deciding beforehand was not enough: the app usually calls `navigate('/')`\n // inside onSuccess, so that navigation happened first and the following\n // `applyRedirect` ran with the route already changed. `redirectHandled`\n // protected against that, but only for whoever remembered to honour it — and\n // half the panels did not, which made the OAuth handoff lose the `#token=`\n // and end in \"Sessão inválida ou expirada\".\n //\n // Executing here, the OAuth flow's destination no longer depends on each\n // application getting the contract right. `onSuccess` is still always called\n // (the app still shows its notification), and `redirectHandled` still\n // signals that navigation was taken over — now as information, not as a\n // trap.\n const handleVerify = async value => {\n setCodeFailure(null)\n setIsCodeResent(false)\n try {\n const result = await verifyCode(sentTo, value)\n\n // Only now, with a session: an email that never received a valid\n // code never becomes a suggestion. Written before the redirect,\n // which may unmount this screen.\n if (recentAccounts) {\n setAccounts(rememberAccount(sentTo, 'code'))\n saveRecentAccount('code')\n }\n\n const target = handleRedirect ? getRedirectFromLocation(redirectOrigins) : null\n\n if (target) applyRedirect(target, navigate)\n\n onSuccess?.(result?.user ?? null, { result, redirectHandled: !!target })\n } catch (error) {\n // The failure belongs to this card, not to the global notification:\n // the person is looking at the eight characters they just typed.\n // The field goes back empty and focused, ready for the next try.\n setCodeFailure(describeCodeFailure(error))\n setCode('')\n codeInputRef.current?.focus()\n // Still reported — an app may log it — but flagged: the card\n // already explains it, and a notification repeating \"Código\n // inválido\" in the corner would say it twice.\n onError?.(error, { step: 'verify', isShownOnCard: true })\n }\n }\n\n // Does not render the form for someone who already has a session: the effect\n // above is redirecting, and showing the fields in that window would flash\n // the screen \"in between\" — the symptom the landing linking straight here\n // exposed. `authLoading` covers the instant before the cookie resolves.\n //\n // `?redirect=` counts on its own. In an OAuth flow the panel is a\n // PASS-THROUGH, not a destination: the token lives in this origin's\n // localStorage and the worker cannot reach it, so the browser has to come\n // through here — but the user should not notice. Without this part of the\n // condition, whoever arrived with an unresolved session still saw the panel\n // screen before the detour.\n const oauthPending = handleRedirect && !!getRedirectFromLocation(redirectOrigins)\n const willRedirect = (!!authenticatedRedirect || oauthPending) && (authLoading || !!user)\n if (willRedirect) return oauthPending ? (redirectingFallback ?? <AuthTransition />) : redirectingFallback\n\n return (\n <AuthCard\n logo={finalLogo}\n logoWidth={logoWidth}\n title={title}\n subtitle={sentTo ? labels.codeSent || 'Digite o código que enviamos' : isShowingAccounts ? labels.recentAccountsSubtitle || 'Escolha a conta que vai receber o código' : subtitle}\n variant={variant}\n opened={opened}\n onClose={onClose}\n modalProps={modalProps}\n {...cardProps}\n >\n {!sentTo && isShowingAccounts ? (\n <RecentAccounts\n accounts={accounts}\n pickingEmail={pickingEmail}\n managing={isManaging}\n onToggleManage={() => setIsManaging(value => !value)}\n onPick={handlePick}\n onForget={handleForget}\n onUseOther={() => {\n setIsManaging(false)\n setIsChoosingOther(true)\n }}\n labels={labels}\n />\n ) : !sentTo ? (\n <form onSubmit={form.onSubmit(handleRequest)}>\n <Stack gap=\"md\">\n {recentAccounts && accounts.length > 0 && (\n <Anchor\n component=\"button\"\n type=\"button\"\n size=\"sm\"\n c=\"dimmed\"\n w=\"fit-content\"\n onClick={() => setIsChoosingOther(false)}\n >\n <Group\n gap={6}\n wrap=\"nowrap\"\n >\n <IconArrowLeft size={14} />\n {`${labels.savedAccounts || 'Contas salvas'} (${accounts.length})`}\n </Group>\n </Anchor>\n )}\n\n <TextInput\n label={labels.email || 'Email'}\n placeholder={labels.emailPlaceholder || 'seu@email.com'}\n type=\"email\"\n autoFocus\n autoComplete=\"email\"\n {...form.getInputProps('email')}\n /*\n * `readOnly`, not `disabled`: Mantine's `disabled`\n * fades the field while the request is in flight, and\n * the value the person just typed is what they are\n * looking at. `readOnly` locks editing and leaves the\n * field legible.\n */\n readOnly={sending}\n />\n\n <Button\n type=\"submit\"\n fullWidth\n /*\n * `aria-disabled`, never `disabled`: `disabled`\n * repaints the button grey, and the white Loader\n * vanishes inside it — the action IN PROGRESS ends up\n * weighing less on screen than a button standing\n * still. With `aria-disabled` the button stays black,\n * the spinner shows, and the guard on submit blocks\n * the repeated click.\n *\n * And the spinner goes in `leftSection`: Mantine's\n * `loading` prop hides the label, and a button with\n * no word does not say what is happening.\n */\n aria-disabled={sending}\n leftSection={\n sending ? (\n <Loader\n size={14}\n color=\"gray.0\"\n />\n ) : null\n }\n rightSection={<IconArrowRight size={16} />}\n >\n {sending ? labels.sendingCode || 'Enviando…' : labels.sendCodeButton || 'Enviar código'}\n </Button>\n\n {/*\n * Step ONE only. On step two the person already asked\n * for a code and is looking for the field to type it\n * into; offering another way in there is noise at the\n * worst possible moment.\n */}\n {socialLogin !== false && (\n <SocialButtons\n labels={labels}\n disabled={sending}\n rememberAccount={recentAccounts}\n />\n )}\n\n <TermsNotice\n url={termsUrl}\n text={labels.termsNotice || 'Criando uma conta, você concorda com todos os nossos'}\n linkText={labels.termsLink || 'termos e condições'}\n />\n </Stack>\n </form>\n ) : (\n <Stack gap=\"md\">\n {isCodeResent && (\n <Alert\n color=\"gray\"\n variant=\"light\"\n radius={0}\n p=\"xs\"\n >\n <Text\n size=\"xs\"\n lh={1.4}\n >\n <Text\n span\n inherit\n fw={700}\n c=\"gray.9\"\n >\n {labels.codeResentTitle || 'Novo código enviado.'}\n </Text>{' '}\n {labels.codeResent || 'O anterior deixou de valer.'}\n </Text>\n </Alert>\n )}\n\n <CodeFailureNotice\n failure={codeFailure}\n labels={labels}\n />\n\n <TextInput\n ref={codeInputRef}\n label={labels.codeLabel || 'Código de acesso'}\n /*\n * The email is the field's description, not the subtitle:\n * as a subtitle it wrapped onto two lines and competed for\n * weight with the title. Here it sits where the person\n * checks it — right above what they are about to type.\n */\n description={`${labels.codeSentTo || 'Enviado para'} ${sentTo}`}\n placeholder=\"ABCD-EFGH\"\n /*\n * One field, not eight boxes. Eight boxes is the numeric\n * OTP pattern; this code is alphanumeric and dictated\n * aloud — in a single field paste works, the screen reader\n * reads one thing, and the hyphen the person types is\n * accepted (`normalizeUserCode` in the worker drops it).\n */\n value={code}\n onChange={event => {\n setCode(event.currentTarget.value)\n // Typing again is the correction: the notice has\n // done its job. A locked field cannot be typed in,\n // so an exhausted or expired notice stays.\n if (codeFailure) setCodeFailure(null)\n }}\n onKeyDown={event => {\n if (event.key === 'Enter' && code.trim()) handleVerify(code)\n }}\n autoFocus\n autoComplete=\"one-time-code\"\n readOnly={verifying}\n /*\n * No `error` on the field: the notice above carries the\n * failure, and a red border around an empty field turned\n * the PLACEHOLDER red — \"ABCD-EFGH\" read as the code the\n * person had typed. With the request gone there is\n * nothing left to type into.\n */\n disabled={isCodeLocked}\n />\n\n {isCodeLocked ? (\n /*\n * The request is gone: confirming can only fail again, so\n * the one action that works takes the button's place.\n */\n <Button\n type=\"button\"\n fullWidth\n aria-disabled={sending}\n onClick={sending ? undefined : handleResend}\n leftSection={\n sending ? (\n <Loader\n size={14}\n color=\"gray.0\"\n />\n ) : (\n <IconRefresh size={16} />\n )\n }\n >\n {sending ? labels.sendingCode || 'Enviando…' : labels.sendNewCode || 'Enviar novo código'}\n </Button>\n ) : (\n <Button\n type=\"button\"\n fullWidth\n // Same reason as the previous step: `disabled` would\n // fade the button exactly while signing in happens.\n //\n // Never disabled for an empty field either. Right\n // after a failure the field is empty on purpose, and\n // a grey button there read as a frozen screen; the\n // click sends the cursor to the field instead.\n aria-disabled={verifying}\n onClick={verifying ? undefined : () => (code.trim() ? handleVerify(code) : codeInputRef.current?.focus())}\n leftSection={\n verifying ? (\n <Loader\n size={14}\n color=\"gray.0\"\n />\n ) : null\n }\n rightSection={<IconArrowRight size={16} />}\n >\n {verifying ? labels.verifyingCode || 'Entrando…' : labels.confirmCode || 'Confirmar'}\n </Button>\n )}\n\n <Group\n justify=\"space-between\"\n gap=\"xs\"\n >\n <Anchor\n size=\"sm\"\n c=\"dimmed\"\n onClick={() => {\n setSentTo(null)\n setCode('')\n setCodeFailure(null)\n setIsCodeResent(false)\n // The label promises another email: the form,\n // not the list the person may have come from.\n setIsChoosingOther(true)\n }}\n >\n {labels.changeEmail || 'Usar outro e-mail'}\n </Anchor>\n\n {/* Locked, the main button already is \"send a new code\". */}\n {!isCodeLocked && (\n <Anchor\n size=\"sm\"\n c=\"dimmed\"\n onClick={sending ? undefined : handleResend}\n >\n {sending ? labels.sendingCode || 'Enviando…' : labels.resendCode || 'Reenviar código'}\n </Anchor>\n )}\n </Group>\n </Stack>\n )}\n </AuthCard>\n )\n}\n","/*\n * How a session reads on the account screen: which device, since when, and\n * how many there are.\n *\n * Pure functions, kept out of the component so they can be tested against real\n * user agents. The order of the checks is the point of this file:\n * - iPhone and iPad announce themselves as \"like Mac OS X\", so they must be\n * recognised BEFORE macOS — the old parser showed every phone as a Mac;\n * - Edge, Opera and Samsung Internet all carry \"Chrome\" in the string, and\n * Chrome on iOS carries \"Safari\", so each is checked before the engine it\n * imitates — the old parser never reached its Opera branch.\n */\n\nconst BROWSERS = [\n ['Edge', /\\bEdg(?:e|A|iOS)?\\//],\n ['Opera', /\\b(?:OPR|Opera|OPT)\\//],\n ['Samsung Internet', /\\bSamsungBrowser\\//],\n ['Firefox', /\\b(?:Firefox|FxiOS)\\//],\n ['Chrome', /\\b(?:Chrome|CriOS)\\//],\n ['Safari', /\\bSafari\\//],\n]\n\n/**\n * @param {string} [userAgent]\n * @returns {{ browser: string|null, os: string|null, kind: 'desktop'|'phone'|'tablet' }}\n */\nexport function describeDevice(userAgent) {\n const ua = userAgent || ''\n const browser = BROWSERS.find(([, pattern]) => pattern.test(ua))?.[0] || null\n\n if (/\\biPad\\b/.test(ua)) return { browser, os: 'iPadOS', kind: 'tablet' }\n if (/\\biPhone\\b|\\biPod\\b/.test(ua)) return { browser, os: 'iOS', kind: 'phone' }\n if (/\\bAndroid\\b/.test(ua)) return { browser, os: 'Android', kind: /\\bMobile\\b/.test(ua) ? 'phone' : 'tablet' }\n if (/\\bWindows\\b/.test(ua)) return { browser, os: 'Windows', kind: 'desktop' }\n if (/\\bCrOS\\b/.test(ua)) return { browser, os: 'ChromeOS', kind: 'desktop' }\n if (/\\bMac OS X\\b|\\bMacintosh\\b/.test(ua)) return { browser, os: 'macOS', kind: 'desktop' }\n if (/\\bLinux\\b/.test(ua)) return { browser, os: 'Linux', kind: 'desktop' }\n return { browser, os: null, kind: 'desktop' }\n}\n\n/** \"Chrome no macOS\", \"Safari\", \"iOS\", or \"Aparelho desconhecido\". */\nexport function deviceLabel({ browser, os }) {\n if (browser && os) return `${browser} no ${os}`\n return browser || os || 'Aparelho desconhecido'\n}\n\nconst pad = n => String(n).padStart(2, '0')\n\n/**\n * \"hoje, 09:12\", \"ontem, 21:40\", \"23/09, 14:05\" or \"23/09/2025, 14:05\".\n *\n * Calendar days in the viewer's own time zone: a session opened at 23:50 is\n * \"ontem\" ten minutes later, which is what the person remembers.\n */\nexport function formatSessionStart(value, now = new Date()) {\n const date = new Date(value)\n if (Number.isNaN(date.getTime())) return null\n\n const time = `${pad(date.getHours())}:${pad(date.getMinutes())}`\n const startOfDay = d => new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime()\n const days = Math.round((startOfDay(now) - startOfDay(date)) / 86_400_000)\n\n if (days === 0) return `hoje, ${time}`\n if (days === 1) return `ontem, ${time}`\n const day = `${pad(date.getDate())}/${pad(date.getMonth() + 1)}`\n return date.getFullYear() === now.getFullYear() ? `${day}, ${time}` : `${day}/${date.getFullYear()}, ${time}`\n}\n\n/** \"1 sessão aberta\", \"3 sessões abertas\". */\nexport function countSessions(count) {\n return count === 1 ? '1 sessão aberta' : `${count} sessões abertas`\n}\n\n/**\n * The current session first, then the others from the newest.\n *\n * The API orders by creation only, so the device the person is holding could\n * land anywhere in the list; it is the one they look for first.\n */\nexport function orderSessions(sessions, currentId) {\n return [...(sessions || [])].sort((a, b) => {\n if (a.id === currentId) return -1\n if (b.id === currentId) return 1\n return new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()\n })\n}\n","/*\n * Who the signed-in person is, as the account card and the account screen\n * show it. One rule for both, so the two never disagree about the same person.\n *\n * A name equal to the email's local part is not a name: it is what an account\n * born from a code gets by default, and showing it on top of the email repeats\n * the same fact. It counts as \"no name\", and the email becomes the title.\n */\nexport function describeUser(user) {\n const name = (user?.fullName || user?.name || '').trim()\n const email = (user?.primaryEmailAddress || user?.email || '').trim()\n\n const hasRealName = Boolean(name) && name.toLowerCase() !== email.split('@')[0].toLowerCase() && name.toLowerCase() !== email.toLowerCase()\n const title = hasRealName ? name : email || name\n\n const initials = hasRealName\n ? name\n .split(/\\s+/)\n .map(part => part[0])\n .join('')\n .slice(0, 2)\n .toUpperCase()\n : (email || name).charAt(0).toUpperCase()\n\n return { name, email, hasRealName, title, initials, image: user?.imageUrl || user?.image || null }\n}\n","import { useEffect, useId, useState } from 'react'\nimport { Avatar, Box, FileButton, Group, Loader, Modal, Paper, Stack, Text, TextInput, Image, UnstyledButton } from '@mantine/core'\nimport { useForm } from '@mantine/form'\nimport { IconBrandGithub, IconBrandGoogle, IconChevronDown, IconDeviceDesktop, IconDeviceLaptop, IconDeviceMobile, IconDeviceTablet, IconLink, IconMail, IconX } from '@tabler/icons-react'\n\nimport { useUser, useSessions } from '../AuthProvider.jsx'\nimport { getLinkedProviders, getSocialProviders, startSocialLink, unlinkSocialProvider } from '../authSdk.js'\nimport { countSessions, describeDevice, deviceLabel, formatSessionStart, orderSessions } from '../session-display.js'\nimport { describeUser } from '../user-identity.js'\n\n/*\n * The account screen: who you are, how you sign in, and where your session is\n * open. Opened from \"Conta\" on the account card, in every panel.\n *\n * Every text has a Portuguese default. Until 25/09/2026 the defaults were in\n * English, five of the seven panels passed no labels and showed \"Account\",\n * \"Update\" and \"1 active session\", and the two that did pass labels wrote\n * three different verbs for the same action. A panel should pass `labels`\n * only to change a word, never to translate the screen.\n */\nconst LABELS = {\n title: 'Conta',\n subtitle: 'Quem você é, como você entra e onde a sua sessão está aberta.',\n close: 'Fechar',\n\n profileSection: 'Perfil',\n avatar: 'Foto',\n name: 'Nome',\n email: 'E-mail',\n edit: 'Alterar',\n save: 'Salvar',\n cancel: 'Cancelar',\n remove: 'Remover',\n notDefined: 'Não definido',\n namePlaceholder: 'Seu nome',\n nameHint: 'Aparece no cartão da conta e para quem divide uma organização com você. Enter salva, Esc cancela.',\n nameRequired: 'Digite um nome.',\n emailHint: 'É para onde vai o código de acesso, por isso não muda por aqui.',\n avatarPrompt: 'Arraste uma imagem ou clique para escolher',\n avatarHint: 'JPG, PNG, GIF ou WebP, até {size}. Ela aparece em todos os painéis.',\n avatarInvalidType: 'Escolha uma imagem: JPG, PNG, GIF ou WebP.',\n avatarTooLarge: 'Imagem grande demais. O máximo é {size}.',\n\n signInSection: 'Formas de entrar',\n codeMethod: 'Código',\n codeByEmail: 'Por e-mail',\n alwaysOn: 'Sempre ativo',\n notConnected: 'Não conectado',\n connect: 'Conectar',\n disconnect: 'Desconectar',\n\n sessionsSection: 'Sessões',\n devices: 'Aparelhos',\n showSessions: 'Ver sessões',\n hideSessions: 'Ocultar',\n thisDevice: 'Este aparelho',\n end: 'Encerrar',\n since: 'desde',\n unknownIP: 'IP desconhecido',\n loadingSessions: 'Carregando as sessões…',\n noSessionsFound: 'Nenhuma sessão encontrada.',\n confirmEndBody: 'Quem estiver nesses aparelhos volta para a tela de entrar. Este aparelho continua conectado.',\n genericFailure: 'Não foi possível concluir. Tente de novo.',\n}\n\nconst PROVIDER_MARKS = { google: IconBrandGoogle, github: IconBrandGithub }\nconst DEVICE_MARKS = { desktop: IconDeviceLaptop, phone: IconDeviceMobile, tablet: IconDeviceTablet }\n\nconst color = token => (token === 'transparent' ? 'transparent' : `var(--mantine-color-${token.replace('.', '-')})`)\n\n/*\n * The action buttons, as data. Hover and keyboard focus share the same look,\n * like the account card's rows. A destructive action keeps its red text on\n * hover and only gains a light red ground: turning the text black while the\n * border turned red read as a different button.\n */\nconst TONES = {\n default: { rest: { text: 'gray.9', border: 'gray.3', ground: 'transparent' }, active: { border: 'gray.9' } },\n dark: { rest: { text: 'white', border: 'gray.9', ground: 'gray.9' }, active: { border: 'gray.7', ground: 'gray.7' } },\n quiet: { rest: { text: 'gray.6', border: 'transparent', ground: 'transparent' }, active: { text: 'gray.9', border: 'gray.3' } },\n danger: { rest: { text: 'red.8', border: 'transparent', ground: 'transparent' }, active: { ground: 'red.0', border: 'red.2' } },\n dangerOutline: { rest: { text: 'red.8', border: 'gray.3', ground: 'transparent' }, active: { ground: 'red.0', border: 'red.2' } },\n dangerFill: { rest: { text: 'white', border: 'red.8', ground: 'red.8' }, active: { border: 'red.9', ground: 'red.9' } },\n}\n\nfunction ActionButton({ tone = 'default', loading = false, disabled = false, children, style, ...others }) {\n const [isActive, setIsActive] = useState(false)\n const isBlocked = disabled || loading\n const look = { ...TONES[tone].rest, ...(isActive && !isBlocked ? TONES[tone].active : {}) }\n\n return (\n <UnstyledButton\n disabled={isBlocked}\n onMouseEnter={() => setIsActive(true)}\n onMouseLeave={() => setIsActive(false)}\n onFocus={() => setIsActive(true)}\n onBlur={() => setIsActive(false)}\n style={{\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 6,\n padding: '5px 12px',\n fontSize: 12,\n fontWeight: 700,\n lineHeight: 1.5,\n whiteSpace: 'nowrap',\n borderRadius: 0,\n color: color(look.text),\n background: color(look.ground),\n border: `1px solid ${color(look.border)}`,\n opacity: disabled ? 0.4 : 1,\n cursor: isBlocked ? 'default' : 'pointer',\n ...style,\n }}\n {...others}\n >\n {loading && (\n <Loader\n size={10}\n color=\"currentColor\"\n />\n )}\n {children}\n </UnstyledButton>\n )\n}\n\nfunction SectionLabel({ children, note }) {\n return (\n <Group\n justify=\"space-between\"\n align=\"baseline\"\n gap={8}\n mb={4}\n >\n <Text\n fz={11}\n fw={800}\n tt=\"uppercase\"\n lts=\"1.5px\"\n c=\"gray.4\"\n >\n {children}\n </Text>\n {note && (\n <Text\n fz={12}\n fw={500}\n c=\"gray.5\"\n >\n {note}\n </Text>\n )}\n </Group>\n )\n}\n\nfunction Section({ label, note, isFirst, children }) {\n return (\n <Box\n px={24}\n pt={16}\n pb={8}\n style={isFirst ? undefined : { borderTop: '1px solid var(--mantine-color-gray-2)' }}\n >\n <SectionLabel note={note}>{label}</SectionLabel>\n {children}\n </Box>\n )\n}\n\nconst rowDivider = { borderTop: '1px solid var(--mantine-color-gray-2)' }\n\n/** A label, a value and an optional action, on the same 88px label column. */\nfunction Row({ label, children, action, isFirst }) {\n return (\n <Box\n py={10}\n mih={52}\n style={{ display: 'grid', gridTemplateColumns: label ? '88px 1fr auto' : '1fr auto', alignItems: 'center', gap: 12, ...(isFirst ? {} : rowDivider) }}\n >\n {label && (\n <Text\n fz={12}\n fw={500}\n c=\"gray.5\"\n >\n {label}\n </Text>\n )}\n <Box\n fz={13}\n fw={500}\n c=\"gray.9\"\n style={{ minWidth: 0, overflowWrap: 'anywhere' }}\n >\n {children}\n </Box>\n {action || <span />}\n </Box>\n )\n}\n\nfunction Hint({ children, c = 'gray.5' }) {\n return (\n <Text\n fz={12}\n fw={500}\n c={c}\n mt={2}\n >\n {children}\n </Text>\n )\n}\n\n/*\n * A failure is shown where it happened, on the screen itself. Five of the\n * seven panels passed no `onError`, and a rejected photo or a failed rename\n * vanished without a word.\n */\nfunction FailureNote({ failure, section }) {\n if (failure?.section !== section) return null\n return (\n <Text\n role=\"alert\"\n fz={12}\n fw={600}\n c=\"red.8\"\n mt={4}\n >\n {failure.message}\n </Text>\n )\n}\n\nfunction Chip({ children, tone = 'outline' }) {\n const looks = {\n outline: { c: 'gray.6', bg: 'transparent', border: 'gray.3' },\n dark: { c: 'white', bg: 'gray.9', border: 'gray.9' },\n good: { c: 'teal.9', bg: 'teal.0', border: 'teal.2' },\n }\n const look = looks[tone]\n return (\n <Text\n component=\"span\"\n fz={10}\n fw={800}\n tt=\"uppercase\"\n lts=\"1.2px\"\n lh={1.6}\n px={6}\n c={look.c}\n bg={look.bg}\n style={{ border: `1px solid ${color(look.border)}`, whiteSpace: 'nowrap', display: 'inline-block' }}\n >\n {children}\n </Text>\n )\n}\n\n/** An icon and a label, side by side, with an optional line under the label. */\nfunction WithIcon({ icon: Icon, children, detail }) {\n return (\n <Group\n gap={10}\n wrap=\"nowrap\"\n align={detail ? 'flex-start' : 'center'}\n >\n <Icon\n size={18}\n stroke={1.5}\n style={{ flex: 'none', color: 'var(--mantine-color-gray-5)', marginTop: detail ? 1 : 0 }}\n />\n <Box style={{ minWidth: 0 }}>\n {children}\n {detail && <Hint>{detail}</Hint>}\n </Box>\n </Group>\n )\n}\n\nfunction SquareAvatar({ src, initials, size }) {\n return (\n <Avatar\n src={src || null}\n alt=\"\"\n size={size}\n radius={0}\n color=\"gray.9\"\n variant=\"filled\"\n styles={{ root: { borderRadius: 0, flex: 'none' }, placeholder: { fontSize: Math.round(size / 3), fontWeight: 800 } }}\n >\n {initials}\n </Avatar>\n )\n}\n\nconst formatSize = bytes => `${Math.round(bytes / 1024)} KB`\n\n/**\n * @param {object} props\n * @param {'modal'|'card'} [props.variant='modal']\n * @param {boolean} [props.opened] - Visibility (modal only)\n * @param {Function} [props.onClose] - Closing (modal only)\n * @param {Function} [props.onProfileUpdate] - Receives `{ name }` or `{ image }`\n * @param {Function} [props.onSessionRevoked] - Receives the ended session's id\n * @param {Function} [props.onOtherSessionsRevoked]\n * @param {Function} [props.onProviderUnlinked] - Receives the provider id\n * @param {Function} [props.onError] - Receives the Error and `{ section, isShownOnScreen: true }`:\n * the screen already shows the message, so a panel should not toast it again\n * @param {boolean} [props.showAvatar=true]\n * @param {boolean} [props.showName=true]\n * @param {boolean} [props.showEmail=true]\n * @param {boolean} [props.showSignInMethods=true] - Drawn only when the application enabled a provider\n * @param {boolean} [props.showSessions=true]\n * @param {Partial<typeof LABELS>} [props.labels] - To change a word; the defaults are already Portuguese\n * @param {string} [props.title]\n * @param {string} [props.subtitle]\n * @param {string|import('react').ReactNode} [props.logo] - Card variant only\n * @param {number} [props.logoHeight=28]\n * @param {number} [props.width=520]\n * @param {number} [props.maxAvatarSize=512000] - In bytes\n * @param {import('react').ReactNode} [props.customSections] - Rendered after the built-in sections\n */\nexport default function UserProfile({\n variant = 'modal',\n opened,\n onClose,\n\n onProfileUpdate,\n onSessionRevoked,\n onOtherSessionsRevoked,\n onProviderUnlinked,\n onError,\n\n showAvatar = true,\n showName = true,\n showEmail = true,\n showSignInMethods = true,\n showSessions = true,\n\n labels = {},\n title,\n subtitle,\n logo,\n logoHeight = 28,\n width = 520,\n maxAvatarSize = 500 * 1024,\n customSections,\n\n ...containerProps\n}) {\n const t = { ...LABELS, ...labels }\n const isVisible = variant === 'card' || Boolean(opened)\n\n const { user, updateProfile, loadingUpdateProfile } = useUser()\n const { currentSession, sessions, listSessions, getSession, revokeSession, revokeOtherSessions, loadingListSessions, loadingRevokeSession } = useSessions()\n const identity = describeUser(user)\n\n // One editor open at a time: 'name', 'avatar' or null.\n const [editing, setEditing] = useState(null)\n const [avatarPreview, setAvatarPreview] = useState(null)\n const [isDragging, setIsDragging] = useState(false)\n const [areSessionsOpen, setAreSessionsOpen] = useState(false)\n const [isSessionsRowActive, setIsSessionsRowActive] = useState(false)\n const [isConfirmingEnd, setIsConfirmingEnd] = useState(false)\n const [providers, setProviders] = useState([])\n const [linked, setLinked] = useState([])\n const [pendingProvider, setPendingProvider] = useState(null)\n const [failure, setFailure] = useState(null)\n const sessionsListId = useId()\n\n const nameForm = useForm({\n initialValues: { name: '' },\n validate: { name: value => (value.trim() ? null : t.nameRequired) },\n })\n\n // Sessions and sign-in methods load when the screen is shown, not before.\n useEffect(() => {\n if (!isVisible) return\n if (showSessions) {\n getSession().catch(error => console.warn('[AuthSDK] Failed to read the current session:', error.message))\n listSessions().catch(error => console.warn('[AuthSDK] Failed to list sessions:', error.message))\n }\n if (showSignInMethods) refreshSignInMethods()\n }, [isVisible, showSessions, showSignInMethods])\n\n // Closing the modal resets it: the next opening starts at rest.\n useEffect(() => {\n if (isVisible) return\n closeEditor()\n setAreSessionsOpen(false)\n setIsConfirmingEnd(false)\n }, [isVisible])\n\n async function refreshSignInMethods() {\n const available = await getSocialProviders()\n setProviders(available)\n if (available.length === 0) return\n try {\n setLinked(await getLinkedProviders())\n } catch (error) {\n console.warn('[AuthSDK] Failed to list linked providers:', error.message)\n setLinked([])\n }\n }\n\n /*\n * `onError` still fires, with `isShownOnScreen: true`: a panel that wants a\n * log or a metric has it, and knows not to show a second message.\n */\n function fail(section, error) {\n setFailure({ section, message: error?.message || t.genericFailure })\n onError?.(error, { section, isShownOnScreen: true })\n }\n\n function closeEditor() {\n setFailure(null)\n setEditing(null)\n setAvatarPreview(null)\n setIsDragging(false)\n nameForm.reset()\n }\n\n function openEditor(section) {\n closeEditor()\n setEditing(section)\n if (section === 'name') nameForm.setValues({ name: identity.name })\n }\n\n async function handleSaveName(values) {\n const name = values.name.trim()\n try {\n await updateProfile({ name })\n closeEditor()\n onProfileUpdate?.({ name })\n } catch (error) {\n fail('name', error)\n }\n }\n\n function handleAvatarFile(file) {\n if (!file) return\n setFailure(null)\n if (!file.type?.startsWith('image/')) {\n fail('avatar', new Error(t.avatarInvalidType))\n return\n }\n if (file.size > maxAvatarSize) {\n fail('avatar', new Error(t.avatarTooLarge.replace('{size}', formatSize(maxAvatarSize))))\n return\n }\n const reader = new FileReader()\n reader.onloadend = () => setAvatarPreview(reader.result)\n reader.readAsDataURL(file)\n }\n\n async function saveAvatar(image) {\n try {\n await updateProfile({ image })\n closeEditor()\n onProfileUpdate?.({ image })\n } catch (error) {\n fail('avatar', error)\n }\n }\n\n async function handleUnlink(provider) {\n setPendingProvider(provider)\n setFailure(null)\n try {\n await unlinkSocialProvider(provider)\n setLinked(current => current.filter(item => item.provider !== provider))\n onProviderUnlinked?.(provider)\n } catch (error) {\n fail('signIn', error)\n } finally {\n setPendingProvider(null)\n }\n }\n\n async function handleLink(provider) {\n setPendingProvider(provider)\n setFailure(null)\n try {\n // Leaves for the provider's consent screen; the page navigates away.\n await startSocialLink(provider)\n } catch (error) {\n setPendingProvider(null)\n fail('signIn', error)\n }\n }\n\n async function handleEndSession(sessionId) {\n setFailure(null)\n try {\n await revokeSession(sessionId)\n onSessionRevoked?.(sessionId)\n } catch (error) {\n fail('sessions', error)\n }\n }\n\n async function handleEndOthers() {\n setFailure(null)\n try {\n await revokeOtherSessions()\n setIsConfirmingEnd(false)\n onOtherSessionsRevoked?.()\n } catch (error) {\n fail('sessions', error)\n }\n }\n\n if (!user) return null\n\n const ordered = orderSessions(sessions, currentSession?.id)\n const current = ordered.find(item => item.id === currentSession?.id)\n const othersCount = ordered.filter(item => item.id !== currentSession?.id).length\n const hasProfile = showAvatar || showName || showEmail\n const hasSignInMethods = showSignInMethods && providers.length > 0\n\n const sessionsSummary = current ? `${deviceLabel(describeDevice(current.userAgent))} (${t.thisDevice.toLowerCase()})${othersCount ? ` e mais ${othersCount}` : ''}` : null\n\n const header = (\n <Group\n align=\"flex-start\"\n wrap=\"nowrap\"\n gap={12}\n px={24}\n pt={20}\n pb={16}\n style={{ borderBottom: '1px solid var(--mantine-color-gray-2)' }}\n >\n {variant === 'card' &&\n logo &&\n (typeof logo === 'string' ? (\n <Image\n src={logo}\n alt=\"\"\n h={logoHeight}\n w=\"auto\"\n fit=\"contain\"\n />\n ) : (\n logo\n ))}\n <Box style={{ flex: 1, minWidth: 0 }}>\n {/*\n * In the modal the title is Mantine's own, which is what the\n * dialog's `aria-labelledby` points to: a screen reader\n * announces \"Conta\" when the screen opens.\n */}\n <Text\n component={variant === 'modal' ? Modal.Title : 'h2'}\n m={0}\n fz={20}\n fw={900}\n lts=\"-0.03em\"\n lh={1.2}\n c=\"gray.9\"\n >\n {title || t.title}\n </Text>\n <Hint>{subtitle || t.subtitle}</Hint>\n </Box>\n {variant === 'modal' && (\n <ActionButton\n aria-label={t.close}\n onClick={onClose}\n style={{ width: 32, height: 32, padding: 0, flex: 'none' }}\n >\n <IconX\n size={16}\n stroke={1.5}\n />\n </ActionButton>\n )}\n </Group>\n )\n\n const identityStrip = (\n <Group\n gap={14}\n wrap=\"nowrap\"\n px={24}\n py={18}\n bg=\"gray.1\"\n style={{ borderBottom: '1px solid var(--mantine-color-gray-2)' }}\n >\n <SquareAvatar\n src={identity.image}\n initials={identity.initials}\n size={48}\n />\n <Box style={{ minWidth: 0 }}>\n <Text\n fz={15}\n fw={800}\n c=\"gray.9\"\n lh={1.3}\n truncate=\"end\"\n >\n {identity.title}\n </Text>\n {identity.hasRealName && identity.email && (\n <Text\n fz={12}\n fw={500}\n c=\"gray.5\"\n truncate=\"end\"\n >\n {identity.email}\n </Text>\n )}\n </Box>\n </Group>\n )\n\n const avatarEditor = (\n <Stack\n gap={10}\n py={12}\n >\n <Text\n fz={12}\n fw={700}\n c=\"gray.9\"\n >\n {t.avatar}\n </Text>\n <FileButton\n onChange={handleAvatarFile}\n accept=\"image/png,image/jpeg,image/gif,image/webp\"\n >\n {props => (\n <UnstyledButton\n {...props}\n onDragOver={event => {\n event.preventDefault()\n setIsDragging(true)\n }}\n onDragLeave={() => setIsDragging(false)}\n onDrop={event => {\n event.preventDefault()\n setIsDragging(false)\n handleAvatarFile(event.dataTransfer.files?.[0])\n }}\n style={{\n display: 'flex',\n alignItems: 'center',\n gap: 14,\n padding: 14,\n borderRadius: 0,\n background: isDragging ? 'var(--mantine-color-gray-2)' : 'var(--mantine-color-gray-1)',\n border: `1px dashed var(--mantine-color-${isDragging ? 'gray-9' : 'gray-4'})`,\n }}\n >\n <SquareAvatar\n src={avatarPreview || identity.image}\n initials={identity.initials}\n size={64}\n />\n <Box>\n <Text\n fz={13}\n fw={700}\n c=\"gray.9\"\n >\n {t.avatarPrompt}\n </Text>\n <Hint>{t.avatarHint.replace('{size}', formatSize(maxAvatarSize))}</Hint>\n </Box>\n </UnstyledButton>\n )}\n </FileButton>\n <FailureNote\n failure={failure}\n section=\"avatar\"\n />\n <Group\n justify=\"flex-end\"\n gap={8}\n >\n {identity.image && !avatarPreview && (\n <ActionButton\n tone=\"danger\"\n loading={loadingUpdateProfile}\n onClick={() => saveAvatar('')}\n style={{ marginRight: 'auto' }}\n >\n {t.remove}\n </ActionButton>\n )}\n <ActionButton\n tone=\"quiet\"\n onClick={closeEditor}\n >\n {t.cancel}\n </ActionButton>\n <ActionButton\n tone=\"dark\"\n loading={loadingUpdateProfile}\n disabled={!avatarPreview}\n onClick={() => saveAvatar(avatarPreview)}\n >\n {t.save}\n </ActionButton>\n </Group>\n </Stack>\n )\n\n const nameEditor = (\n <form\n onSubmit={nameForm.onSubmit(handleSaveName)}\n style={{ ...rowDivider, padding: '12px 0 14px' }}\n >\n <Stack gap={10}>\n <TextInput\n label={t.name}\n placeholder={t.namePlaceholder}\n autoComplete=\"name\"\n data-autofocus\n autoFocus\n radius={0}\n size=\"sm\"\n styles={{ label: { fontSize: 12, fontWeight: 700, color: 'var(--mantine-color-gray-9)', marginBottom: 6 } }}\n onKeyDown={event => {\n if (event.key !== 'Escape') return\n event.stopPropagation()\n closeEditor()\n }}\n {...nameForm.getInputProps('name')}\n />\n <Hint>{t.nameHint}</Hint>\n <FailureNote\n failure={failure}\n section=\"name\"\n />\n <Group\n justify=\"flex-end\"\n gap={8}\n >\n <ActionButton\n tone=\"quiet\"\n onClick={closeEditor}\n >\n {t.cancel}\n </ActionButton>\n <ActionButton\n tone=\"dark\"\n type=\"submit\"\n loading={loadingUpdateProfile}\n >\n {t.save}\n </ActionButton>\n </Group>\n </Stack>\n </form>\n )\n\n const sessionsList = (\n <Box\n id={sessionsListId}\n mb={10}\n >\n {loadingListSessions && ordered.length === 0 ? (\n <Hint>{t.loadingSessions}</Hint>\n ) : ordered.length === 0 ? (\n <Hint>{t.noSessionsFound}</Hint>\n ) : (\n ordered.map((item, index) => {\n const device = describeDevice(item.userAgent)\n const isCurrent = item.id === currentSession?.id\n const since = formatSessionStart(item.createdAt)\n return (\n <Row\n key={item.id}\n isFirst={index === 0}\n action={\n isCurrent ? null : (\n <ActionButton\n tone=\"danger\"\n loading={loadingRevokeSession === item.id}\n onClick={() => handleEndSession(item.id)}\n aria-label={`${t.end} ${deviceLabel(device)}`}\n >\n {t.end}\n </ActionButton>\n )\n }\n >\n <WithIcon\n icon={DEVICE_MARKS[device.kind] || IconDeviceDesktop}\n detail={`${item.ipAddress ? `IP ${item.ipAddress}` : t.unknownIP}${since ? ` · ${t.since} ${since}` : ''}`}\n >\n <Group\n gap={6}\n wrap=\"wrap\"\n >\n <span>{deviceLabel(device)}</span>\n {isCurrent && <Chip tone=\"dark\">{t.thisDevice}</Chip>}\n </Group>\n </WithIcon>\n </Row>\n )\n })\n )}\n\n <FailureNote\n failure={failure}\n section=\"sessions\"\n />\n\n {othersCount > 0 &&\n current &&\n (isConfirmingEnd ? (\n <Stack\n role=\"alertdialog\"\n aria-label={endOthersQuestion(othersCount)}\n gap={10}\n p={12}\n mt={4}\n bg=\"red.0\"\n style={{ border: '1px solid var(--mantine-color-red-2)' }}\n >\n <Text\n fz={12}\n fw={500}\n c=\"gray.7\"\n >\n <Text\n span\n inherit\n fw={800}\n c=\"gray.9\"\n >\n {endOthersQuestion(othersCount)}\n </Text>{' '}\n {t.confirmEndBody}\n </Text>\n <Group\n justify=\"flex-end\"\n gap={8}\n >\n <ActionButton\n tone=\"quiet\"\n onClick={() => setIsConfirmingEnd(false)}\n >\n {t.cancel}\n </ActionButton>\n <ActionButton\n tone=\"dangerFill\"\n loading={loadingRevokeSession === 'all'}\n onClick={handleEndOthers}\n >\n {endOthersConfirm(othersCount)}\n </ActionButton>\n </Group>\n </Stack>\n ) : (\n <Group\n justify=\"flex-end\"\n pt={4}\n pb={4}\n >\n <ActionButton\n tone=\"dangerOutline\"\n onClick={() => setIsConfirmingEnd(true)}\n >\n {endOthersAction(othersCount)}\n </ActionButton>\n </Group>\n ))}\n </Box>\n )\n\n const content = (\n <>\n {header}\n {identityStrip}\n\n {hasProfile && (\n <Section\n label={t.profileSection}\n isFirst\n >\n {showAvatar &&\n (editing === 'avatar' ? (\n avatarEditor\n ) : (\n <Row\n label={t.avatar}\n isFirst\n action={<ActionButton onClick={() => openEditor('avatar')}>{t.edit}</ActionButton>}\n >\n <SquareAvatar\n src={identity.image}\n initials={identity.initials}\n size={32}\n />\n </Row>\n ))}\n {showName &&\n (editing === 'name' ? (\n nameEditor\n ) : (\n <Row\n label={t.name}\n isFirst={!showAvatar}\n action={<ActionButton onClick={() => openEditor('name')}>{t.edit}</ActionButton>}\n >\n {identity.name || (\n <Text\n span\n inherit\n c=\"gray.5\"\n >\n {t.notDefined}\n </Text>\n )}\n </Row>\n ))}\n {showEmail && (\n <Row\n label={t.email}\n isFirst={!showAvatar && !showName}\n >\n {identity.email}\n {/*\n * The email is not edited here: it is where the\n * sign-in code arrives, so changing it means\n * changing identity, and that requires proving\n * possession of the new inbox through the sign-in\n * flow. The hint says so, because a person looks\n * for the button and finds nothing.\n */}\n <Hint>{t.emailHint}</Hint>\n </Row>\n )}\n </Section>\n )}\n\n {hasSignInMethods && (\n <Section\n label={t.signInSection}\n isFirst={!hasProfile}\n >\n <Row\n label={t.codeMethod}\n isFirst\n action={<Chip tone=\"good\">{t.alwaysOn}</Chip>}\n >\n <WithIcon icon={IconMail}>{t.codeByEmail}</WithIcon>\n </Row>\n {providers.map(item => {\n const link = linked.find(entry => entry.provider === item.provider)\n return (\n <Row\n key={item.provider}\n label={item.name}\n action={\n link ? (\n <ActionButton\n tone=\"quiet\"\n loading={pendingProvider === item.provider}\n onClick={() => handleUnlink(item.provider)}\n aria-label={`${t.disconnect} ${item.name}`}\n >\n {t.disconnect}\n </ActionButton>\n ) : (\n <ActionButton\n loading={pendingProvider === item.provider}\n onClick={() => handleLink(item.provider)}\n aria-label={`${t.connect} ${item.name}`}\n >\n {t.connect}\n </ActionButton>\n )\n }\n >\n <WithIcon icon={PROVIDER_MARKS[item.provider] || IconLink}>\n {link ? (\n link.email || item.name\n ) : (\n <Text\n span\n inherit\n c=\"gray.5\"\n >\n {t.notConnected}\n </Text>\n )}\n </WithIcon>\n </Row>\n )\n })}\n <FailureNote\n failure={failure}\n section=\"signIn\"\n />\n </Section>\n )}\n\n {showSessions && (\n <Section\n label={t.sessionsSection}\n isFirst={!hasProfile && !hasSignInMethods}\n >\n {/*\n * Grouped on one line that already says how many and where\n * the current one is; a click opens the list right below.\n */}\n <UnstyledButton\n aria-expanded={areSessionsOpen}\n aria-controls={sessionsListId}\n onClick={() => {\n setAreSessionsOpen(isOpen => !isOpen)\n setIsConfirmingEnd(false)\n }}\n onMouseEnter={() => setIsSessionsRowActive(true)}\n onMouseLeave={() => setIsSessionsRowActive(false)}\n onFocus={() => setIsSessionsRowActive(true)}\n onBlur={() => setIsSessionsRowActive(false)}\n w=\"100%\"\n style={{ display: 'block', borderRadius: 0 }}\n >\n <Row\n label={t.devices}\n isFirst\n action={\n <Box\n component=\"span\"\n style={{\n display: 'inline-flex',\n alignItems: 'center',\n gap: 4,\n padding: '5px 12px',\n fontSize: 12,\n fontWeight: 700,\n color: 'var(--mantine-color-gray-9)',\n // The whole line is the button; the pill only shows it.\n border: `1px solid var(--mantine-color-${isSessionsRowActive ? 'gray-9' : 'gray-3'})`,\n whiteSpace: 'nowrap',\n }}\n >\n {areSessionsOpen ? t.hideSessions : t.showSessions}\n <IconChevronDown\n size={14}\n stroke={1.5}\n style={{ transform: areSessionsOpen ? 'rotate(180deg)' : 'none', transition: 'transform 150ms ease' }}\n />\n </Box>\n }\n >\n <WithIcon\n icon={IconDeviceLaptop}\n detail={sessionsSummary}\n >\n {loadingListSessions && ordered.length === 0 ? t.loadingSessions : countSessions(ordered.length)}\n </WithIcon>\n </Row>\n </UnstyledButton>\n {areSessionsOpen && sessionsList}\n </Section>\n )}\n\n {customSections}\n </>\n )\n\n if (variant === 'modal') {\n return (\n <Modal.Root\n opened={Boolean(opened)}\n onClose={onClose}\n size={width}\n // With an editor open, Esc belongs to the editor: it cancels the\n // edit and leaves the screen open. Mantine listens for Esc on its\n // own, so stopping the key in the field is not enough.\n closeOnEscape={!editing && !isConfirmingEnd}\n {...containerProps}\n >\n <Modal.Overlay\n backgroundOpacity={0.5}\n blur={4}\n />\n <Modal.Content\n radius={0}\n style={{ border: '1px solid var(--mantine-color-gray-3)' }}\n >\n <Modal.Body p={0}>{content}</Modal.Body>\n </Modal.Content>\n </Modal.Root>\n )\n }\n\n return (\n <Paper\n withBorder\n radius={0}\n p={0}\n w={width}\n maw=\"100%\"\n {...containerProps}\n >\n {content}\n </Paper>\n )\n}\n\n/* The only texts that change with the count, so they are functions, not labels. */\nfunction endOthersAction(count) {\n return count === 1 ? 'Encerrar a outra' : `Encerrar as outras ${count}`\n}\nfunction endOthersQuestion(count) {\n return count === 1 ? 'Encerrar 1 sessão?' : `Encerrar ${count} sessões?`\n}\nfunction endOthersConfirm(count) {\n return count === 1 ? 'Encerrar 1 sessão' : `Encerrar ${count} sessões`\n}\n","import { Avatar, Box, Group, Stack, Text, UnstyledButton, Anchor } from '@mantine/core'\nimport { IconBuilding, IconCreditCard, IconLogout, IconUser } from '@tabler/icons-react'\n\nimport { TERMS_URL } from '../terms.js'\nimport { describeUser } from '../user-identity.js'\n\n/*\n * The account card — what opens from the footer of every panel's sidebar.\n *\n * \"Context first\": who is signed in, in which organization and on which plan,\n * then one list of actions with \"Sair\" at the end. Decided on 2026-09-25 after\n * comparing Clerk, Supabase, shadcn, Vercel Geist, Linear and Stripe; the\n * previous card got six things wrong, each fixed here:\n *\n * 1. The avatar is square, like everything else in the system. The panels no\n * longer override `radius=\"xl\"` in their themes.\n * 2. \"Sair\" is the last row, with its word, after a divider — never an\n * unlabelled icon in the corner where the hand goes to close the card.\n * 3. The title is the NAME, or the email when there is none. A name made up\n * from the email (\"maciel.ciro\") showed the same fact twice and read as a\n * real name.\n * 4. Nothing goes below 12px, the system's floor for content.\n * 5. One list, not two cards: the panel's own rows (docs, support) come in\n * through `items`, as data, and sit in their own group.\n * 6. The provenance line is legible and can be turned off (`branded`), and\n * carries the link to the terms, the same document the sign-in cites.\n *\n * Every prop is data, never JSX (Zen law 4): a panel that could inject markup\n * would inject chrome, and the seven cards would drift apart again.\n */\n\nconst ROLE_LABELS = { owner: 'Dono', admin: 'Administrador', member: 'Membro' }\n\n/*\n * From this share of the limit on, the strip invites to upgrade. Below it the\n * strip only informs: \"Assinatura\" is the door that is always there, and a\n * second link to the same modal right above it was two doors to one room.\n */\nconst UPGRADE_THRESHOLD = 0.8\n\n/**\n * @typedef {Object} UserInformationItem\n * @property {string} [id] - Stable key\n * @property {string} label - The row's text\n * @property {Function} [icon] - A Tabler icon component\n * @property {string} [description] - One line under the label, saying what the action does\n * @property {'danger'} [tone] - For what cannot be undone: red label and icon\n * @property {Function} onClick\n *\n * @typedef {Object} UserInformationPlan\n * @property {string} [name] - \"Pro\", \"Starter\"… Shown as the badge\n * @property {number} [used] - How many of the plan's resources are in use\n * @property {number|null} [limit] - The plan's ceiling; `null` hides the meter\n * @property {string} [unit] - What is counted, in the plural: \"projetos\"\n * @property {boolean} [canUpgrade=false] - There is a plan above this one. Without\n * it the invite never shows, however full the plan is: on the last rung there\n * is nowhere to go\n * @property {string} [actionLabel='Fazer upgrade']\n * @property {Function} [onClick] - Opens the plans. The invite shows only with\n * `canUpgrade` and usage at 80% of the limit or more\n *\n * @typedef {Object} UserInformationOrganization\n * @property {string} name\n * @property {string} [role] - `owner`, `admin`, `member`, or already a label\n */\n\n/**\n * @param {Object} props\n * @param {Object} props.user - The signed-in user (`name`, `email`, `image`)\n * @param {Function} props.signOut\n * @param {Function} [props.onAccountClick]\n * @param {Function} [props.onBillingClick]\n * @param {UserInformationItem[]} [props.items] - The panel's own rows, shown in their own group\n * @param {string} [props.itemsLabel] - A title for that group (\"Seus dados\"); without it, none\n * @param {UserInformationPlan} [props.plan] - The plan strip; omitted, the strip is not drawn\n * @param {UserInformationOrganization} [props.organization] - Where the person is acting\n * @param {boolean} [props.branded=true] - The footer: \"Protegido por Auth\" and the terms link\n * @param {string|null} [props.termsUrl] - Where \"Termos\" points; `null` removes the link\n * @param {string} [props.termsLabel='Termos']\n * @param {string} [props.accountLabel='Conta']\n * @param {string} [props.billingLabel='Assinatura']\n * @param {string} [props.signOutLabel='Sair']\n */\nexport function UserInformation({\n user,\n signOut,\n onAccountClick,\n onBillingClick,\n items = [],\n itemsLabel,\n plan,\n organization,\n branded = true,\n termsUrl = TERMS_URL,\n termsLabel = 'Termos',\n accountLabel = 'Conta',\n billingLabel = 'Assinatura',\n signOutLabel = 'Sair',\n // Kept so existing calls keep working. The card has one density now: the\n // popover's. `padded={false}` still removes the outer padding.\n padded = true,\n size, // eslint-disable-line no-unused-vars -- accepted and ignored, see above\n style,\n ...others\n}) {\n if (!user) return null\n\n const { email, hasRealName, title, initials, image } = describeUser(user)\n\n const baseRows = [onAccountClick && { id: 'account', label: accountLabel, icon: IconUser, onClick: onAccountClick }, onBillingClick && { id: 'billing', label: billingLabel, icon: IconCreditCard, onClick: onBillingClick }].filter(\n Boolean\n )\n\n const panelRows = items.filter(item => item && item.label && typeof item.onClick === 'function')\n\n return (\n <Box\n w={288}\n maw=\"100%\"\n style={style}\n {...others}\n >\n {/* Who */}\n <Group\n wrap=\"nowrap\"\n gap={10}\n px={padded ? 16 : 0}\n py={14}\n >\n <Avatar\n src={image}\n alt=\"\"\n size={32}\n radius={0}\n color=\"gray.9\"\n variant=\"filled\"\n styles={{ root: { borderRadius: 0 }, placeholder: { fontSize: 12, fontWeight: 800 } }}\n >\n {initials}\n </Avatar>\n\n <Box style={{ flex: 1, minWidth: 0 }}>\n <Text\n fz={13}\n fw={800}\n c=\"gray.9\"\n lh={1.3}\n truncate=\"end\"\n >\n {title}\n </Text>\n {hasRealName && email && (\n <Text\n fz={12}\n fw={500}\n c=\"gray.5\"\n lh={1.4}\n truncate=\"end\"\n >\n {email}\n </Text>\n )}\n </Box>\n </Group>\n\n {/* Where, and on which plan */}\n {(organization?.name || plan) && (\n <ContextStrip\n organization={organization}\n plan={plan}\n padded={padded}\n />\n )}\n\n {/* What — account and billing, then the panel's rows, then leaving */}\n <Box\n role=\"menu\"\n aria-label=\"Conta\"\n onKeyDown={moveFocus}\n >\n {baseRows.length > 0 && (\n <RowGroup\n rows={baseRows}\n hasDivider={!organization?.name && !plan}\n />\n )}\n {panelRows.length > 0 && (\n <RowGroup\n rows={panelRows}\n label={itemsLabel}\n hasDivider\n />\n )}\n {signOut && (\n <RowGroup\n rows={[{ id: 'sign-out', label: signOutLabel, icon: IconLogout, onClick: signOut }]}\n hasDivider\n />\n )}\n </Box>\n\n {branded && (\n <Group\n justify={termsUrl ? 'space-between' : 'center'}\n gap={8}\n px={16}\n py={10}\n bg=\"gray.1\"\n style={{ borderTop: '1px solid var(--mantine-color-gray-2)' }}\n >\n <Text\n fz={11}\n fw={500}\n c=\"gray.5\"\n >\n Protegido por{' '}\n <Text\n span\n inherit\n fw={800}\n c=\"gray.7\"\n >\n Auth\n </Text>\n </Text>\n {termsUrl && (\n <Anchor\n href={termsUrl}\n /*\n * A new tab, like the sign-in's notice: the card sits\n * over a working panel, and reading the terms must\n * not navigate away from it.\n */\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n fz={11}\n fw={500}\n c=\"gray.5\"\n underline=\"always\"\n >\n {termsLabel}\n </Anchor>\n )}\n </Group>\n )}\n </Box>\n )\n}\n\n// \"12.400 de 60.000 páginas\", not \"12400 de 60000\": the History counts pages in the thousands.\nconst formatCount = value => Number(value).toLocaleString('pt-BR')\n\n/** The organization, the role and the plan's usage, on the alternate surface. */\nfunction ContextStrip({ organization, plan, padded }) {\n const role = organization?.role ? ROLE_LABELS[organization.role] || organization.role : null\n const hasMeter = plan && Number.isFinite(plan.used) && Number.isFinite(plan.limit) && plan.limit > 0\n const ratio = hasMeter ? Math.min(1, Math.max(0, plan.used / plan.limit)) : 0\n const isFull = hasMeter && plan.used >= plan.limit\n const showsInvite = hasMeter && plan.canUpgrade === true && typeof plan.onClick === 'function' && ratio >= UPGRADE_THRESHOLD\n /*\n * \"Limite atingido\" sits on the badge's line, whose left side is empty\n * when there is no organization. Next to the count it would wrap to two\n * lines beside the invite. With an organization there, it falls back to\n * the count.\n */\n const limitNoticeOnTop = isFull && !organization?.name\n\n return (\n <Stack\n gap={8}\n px={padded ? 16 : 0}\n py={12}\n bg=\"gray.1\"\n style={{ borderTop: '1px solid var(--mantine-color-gray-2)', borderBottom: '1px solid var(--mantine-color-gray-2)' }}\n >\n {(organization?.name || plan?.name) && (\n <Group\n gap={8}\n wrap=\"nowrap\"\n >\n {limitNoticeOnTop && (\n <Text\n fz={12}\n fw={700}\n c=\"red.8\"\n >\n Limite atingido\n </Text>\n )}\n {organization?.name && (\n <>\n <IconBuilding\n size={14}\n stroke={1.5}\n style={{ flex: 'none', color: 'var(--mantine-color-gray-5)' }}\n />\n <Text\n fz={12}\n fw={800}\n c=\"gray.9\"\n truncate=\"end\"\n style={{ minWidth: 0 }}\n >\n {organization.name}\n </Text>\n {role && (\n <Text\n fz={12}\n fw={500}\n c=\"gray.5\"\n style={{ flex: 'none' }}\n >\n · {role}\n </Text>\n )}\n </>\n )}\n {plan?.name && (\n <Text\n component=\"span\"\n fz={10}\n fw={800}\n tt=\"uppercase\"\n lts=\"1.5px\"\n c=\"white\"\n bg=\"gray.9\"\n px={6}\n lh={1.6}\n ml=\"auto\"\n style={{ flex: 'none' }}\n >\n {plan.name}\n </Text>\n )}\n </Group>\n )}\n\n {hasMeter && (\n <>\n <Box\n h={4}\n bg=\"gray.2\"\n role=\"meter\"\n aria-valuemin={0}\n aria-valuemax={plan.limit}\n aria-valuenow={plan.used}\n aria-label={plan.unit ? `${plan.unit} em uso` : 'Uso do plano'}\n >\n <Box\n h=\"100%\"\n w={`${ratio * 100}%`}\n bg={isFull ? 'red.8' : 'gray.9'}\n />\n </Box>\n <Group\n justify=\"space-between\"\n gap={8}\n wrap=\"nowrap\"\n >\n <Text\n fz={12}\n fw={isFull ? 700 : 500}\n c={isFull ? 'red.8' : 'gray.6'}\n >\n {`${formatCount(plan.used)} de ${formatCount(plan.limit)}${plan.unit ? ` ${plan.unit}` : ''}${isFull && !limitNoticeOnTop ? ' · limite atingido' : ''}`}\n </Text>\n {showsInvite && (\n <UnstyledButton\n onClick={plan.onClick}\n fz={11}\n fw={800}\n lts=\"0.5px\"\n c=\"white\"\n bg=\"gray.9\"\n px={8}\n py={3}\n lh={1.4}\n style={{ flex: 'none', whiteSpace: 'nowrap' }}\n >\n {plan.actionLabel || 'Fazer upgrade'}\n </UnstyledButton>\n )}\n </Group>\n </>\n )}\n </Stack>\n )\n}\n\nfunction RowGroup({ rows, label, hasDivider }) {\n return (\n <Stack\n gap={0}\n p={6}\n role={label ? 'group' : undefined}\n aria-label={label || undefined}\n style={hasDivider ? { borderTop: '1px solid var(--mantine-color-gray-2)' } : undefined}\n >\n {label && (\n <Text\n aria-hidden\n fz={11}\n fw={800}\n tt=\"uppercase\"\n lts=\"1.5px\"\n c=\"gray.4\"\n px={10}\n pt={6}\n pb={2}\n >\n {label}\n </Text>\n )}\n {rows.map(row => (\n <Row\n key={row.id || row.label}\n {...row}\n />\n ))}\n </Stack>\n )\n}\n\n/*\n * A panel's row may carry a line saying what it does and, for what cannot be\n * undone, the danger tone — still as data, so every card keeps one shape. The\n * History needed both: \"Apagar tudo\" looked exactly like \"Exportar\".\n */\nconst ROW_TONES = {\n default: { text: 'gray.9', icon: 'var(--mantine-color-gray-5)', hover: 'var(--mantine-color-gray-1)' },\n danger: { text: 'red.8', icon: 'var(--mantine-color-red-8)', hover: 'var(--mantine-color-red-0)' },\n}\n\nfunction Row({ label, description, tone, icon: Icon, onClick }) {\n const look = ROW_TONES[tone] || ROW_TONES.default\n return (\n <UnstyledButton\n role=\"menuitem\"\n onClick={onClick}\n px={10}\n py={7}\n w=\"100%\"\n style={{ display: 'flex', alignItems: description ? 'flex-start' : 'center', gap: 10, borderRadius: 0 }}\n /*\n * Hover and keyboard focus share the same surface: a row reached\n * with the arrows must look exactly like the one under the mouse.\n */\n onMouseEnter={event => (event.currentTarget.style.background = look.hover)}\n onMouseLeave={event => (event.currentTarget.style.background = 'transparent')}\n onFocus={event => (event.currentTarget.style.background = look.hover)}\n onBlur={event => (event.currentTarget.style.background = 'transparent')}\n >\n {Icon && (\n <Icon\n size={16}\n stroke={1.5}\n style={{ flex: 'none', color: look.icon, marginTop: description ? 1 : 0 }}\n />\n )}\n <Box style={{ minWidth: 0 }}>\n <Text\n fz={12}\n fw={500}\n c={look.text}\n truncate=\"end\"\n >\n {label}\n </Text>\n {description && (\n <Text\n fz={12}\n fw={500}\n c=\"gray.5\"\n lh={1.4}\n >\n {description}\n </Text>\n )}\n </Box>\n </UnstyledButton>\n )\n}\n\n/*\n * Arrow keys walk the rows, Home and End jump to the ends — the WAI-ARIA menu\n * pattern. Tab still leaves the card, so it never traps focus inside a popover\n * the panel owns.\n */\nfunction moveFocus(event) {\n const keys = ['ArrowDown', 'ArrowUp', 'Home', 'End']\n if (!keys.includes(event.key)) return\n\n const rows = Array.from(event.currentTarget.querySelectorAll('[role=\"menuitem\"]'))\n if (rows.length === 0) return\n\n event.preventDefault()\n const current = rows.indexOf(document.activeElement)\n const last = rows.length - 1\n const next = event.key === 'Home' ? 0 : event.key === 'End' ? last : event.key === 'ArrowDown' ? (current < last ? current + 1 : 0) : current > 0 ? current - 1 : last\n rows[next].focus()\n}\n\nexport default UserInformation\n","import { useAuth } from '../../AuthProvider.jsx'\n\n/**\n * Renderiza children apenas quando o usuário está autenticado\n * Equivalente ao <SignedIn> do Clerk\n */\nexport function SignedIn({ children }) {\n const { user, loading } = useAuth()\n if (loading || !user) return null\n return children\n}\n\nexport default SignedIn\n","import { useAuth } from '../../AuthProvider.jsx'\n\n/**\n * Renderiza children apenas quando o usuário NÃO está autenticado\n * Equivalente ao <SignedOut> do Clerk\n */\nexport function SignedOut({ children }) {\n const { user, loading } = useAuth()\n if (loading || user) return null\n return children\n}\n\nexport default SignedOut\n","import { useAuth } from '../../AuthProvider.jsx'\n\n/**\n * Renderiza children enquanto a autenticação está carregando\n * Equivalente ao <ClerkLoading> do Clerk\n */\nexport function AuthLoading({ children }) {\n const { loading } = useAuth()\n if (!loading) return null\n return children\n}\n\nexport default AuthLoading\n","import { useAuth } from '../../AuthProvider.jsx'\n\n/**\n * Renderiza children quando a autenticação terminou de carregar\n * Equivalente ao <ClerkLoaded> do Clerk\n */\nexport function AuthLoaded({ children }) {\n const { loading } = useAuth()\n if (loading) return null\n return children\n}\n\nexport default AuthLoaded\n","import { useNavigate } from 'react-router-dom'\n\n/**\n * Botão unstyled para navegação para página de login\n * Equivalente ao <SignInButton> do Clerk\n */\nexport function SignInButton({ children, redirectTo = '/login', ...props }) {\n const navigate = useNavigate()\n\n return (\n <button\n onClick={() => navigate(redirectTo)}\n {...props}\n >\n {children || 'Sign In'}\n </button>\n )\n}\n\nexport default SignInButton\n","import { useSignOut } from '../../AuthProvider.jsx'\n\n/**\n * Botão unstyled para fazer logout\n * Equivalente ao <SignOutButton> do Clerk\n */\nexport function SignOutButton({ children, onSignOut, ...props }) {\n const signOut = useSignOut()\n\n const handleClick = async () => {\n await signOut()\n onSignOut?.()\n }\n\n return (\n <button\n onClick={handleClick}\n {...props}\n >\n {children || 'Sign Out'}\n </button>\n )\n}\n\nexport default SignOutButton\n"],"names":["RECENT_ACCOUNTS_KEY","MAX_RECENT_ACCOUNTS","SOCIAL_DEPARTURE_KEY","SOCIAL_DEPARTURE_TTL_MS","normalizeEmail","email","String","trim","toLowerCase","listRecentAccounts","raw","window","localStorage","getItem","parsed","JSON","parse","Array","isArray","filter","account","includes","map","method","lastUsedAt","Number","sort","a","b","slice","writeRecentAccounts","accounts","setItem","stringify","rememberAccount","normalized","next","Date","now","forgetAccount","adoptRecentAccounts","remote","length","markSocialDeparture","provider","sessionStorage","at","takeSocialDeparture","removeItem","FLAG","IDENTITY_CHANGED_EVENT","announceIdentityChange","detail","dispatchEvent","CustomEvent","KEEP","Set","dropStoredAccountState","doomed","i","k","key","has","push","clear","SWITCH_BEACON","markIdentitySwitching","reason","clearIdentitySwitching","isIdentitySwitching","Boolean","shouldSignOutOn401","switching","API_BASE","API_KEY","INTERNAL_MODE","configure","apiKey","apiUrl","internal","endsWith","isInternal","getApiUrl","TOKEN_STORAGE_KEY","api","route","opts","cleanRoute","startsWith","url","token","getStoredToken","headers","Accept","Authorization","res","fetch","credentials","data","status","json","catch","ok","payloadError","error","failure","Error","message","statusText","code","details","retriable","setStoredToken","handleAuthResponse","result","session","sessionToken","decodeJWT","parts","split","base64Url","base64","replace","jsonPayload","atob","Buffer","from","toString","isTokenExpired","payload","exp","isExpired","console","log","diff","isAuthenticated","valid","getCurrentUser","id","sub","name","requestCode","body","verifyCode","pollCode","deviceCode","pending","interval","signOut","refreshToken","endImpersonation","impersonationId","getSession","listSessions","items","revokeSession","revokeOtherSessions","getApplicationInfo","warn","updateProfile","fetchRecentAccounts","response","saveRecentAccount","keepalive","deleteRecentAccount","encodeURIComponent","getSocialProviders","startSocialSignIn","redirect","shouldRemember","destination","location","href","URL","searchParams","set","assign","consumeSocialToken","hash","params","URLSearchParams","get","previous","before","after","delete","rest","history","replaceState","pathname","search","consumeSocialError","startSocialLink","authorizeUrl","unlinkSocialProvider","getLinkedProviders","allowedOrigins","extraOrigins","list","origin","isLocalhost","hostname","resolveRedirect","protocol","applyRedirect","target","navigate","withToken","finalUrl","getRedirectFromLocation","paramName","REVALIDATE_THROTTLE_MS","useAuthStore","create","user","loading","lastRevalidatedAt","sessions","currentSession","loadingStates","applicationInfo","impersonation","setLoading","value","state","fetchApplicationInfo","appInfo","syncSession","trusted","sessionData","application","semToken","anterior","trocou","reload","identityChanged","rejected","init","revalidate","force","options","err","sessionId","isCurrent","isLast","s","startRefresh","refreshInterval","setInterval","timeUntilExpiry","refreshed","refreshErr","addEventListener","clearInterval","checkTokenValidity","setUser","remaining","expiresAt","ms","getTime","totalSeconds","Math","floor","padStart","styles","wrap","position","left","right","bottom","zIndex","display","justifyContent","pointerEvents","paddingLeft","paddingRight","bar","alignItems","flexWrap","gap","padding","borderRadius","background","color","fontSize","fontFamily","lineHeight","maxWidth","boxShadow","strong","fontWeight","clock","fontVariantNumeric","opacity","button","marginLeft","border","font","cursor","ImpersonationBanner","setLeft","useState","ending","setEnding","endedByTimer","useCallback","handleEnd","useEffect","timer","restante","_jsx","style","children","_jsxs","role","actor","_Fragment","type","onClick","disabled","AuthContext","createContext","IMPERSONATION_POLL_MS","AuthProvider","onError","useMemo","handleStorageChange","event","setState","handleSessionRevoked","removeEventListener","handleFocus","document","visibilityState","contextValue","Provider","useAuth","useShallow","useSignIn","sending","verifying","useSignOut","useCheckToken","useSession","useAuthLoading","useUser","loadingUpdateProfile","useSessions","loadingListSessions","loadingRevokeSession","useImpersonation","useApplicationLogo","image","Protect","fallback","redirectTo","Navigate","to","Outlet","GuestOnly","AuthCard","title","subtitle","logo","logoWidth","width","variant","opened","onClose","modalProps","props","content","Stack","align","ta","Image","src","alt","mx","w","fit","Title","order","Text","size","c","Modal","withCloseButton","radius","overlayProps","backgroundOpacity","blur","Group","h","Paper","withBorder","shadow","p","maw","PROVIDER_NAMES","google","github","providerName","charAt","toUpperCase","RELATIVE","Intl","RelativeTimeFormat","numeric","formatLastUsed","timestamp","minutes","round","abs","format","hours","days","months","initialsOf","local","RecentAccounts","pickingEmail","managing","onToggleManage","onPick","onForget","onUseOther","labels","busy","justify","fz","fw","lh","tt","lts","recentAccountsHeading","Anchor","component","undefined","recentAccountsDone","recentAccountsManage","index","isPicking","isSocial","description","openingProvider","sendingCode","lastUsed","NavLink","noWrap","label","truncate","leftSection","Avatar","rightSection","ActionIcon","removeAccount","IconX","Loader","IconArrowRight","py","borderTop","Button","fullWidth","useOtherEmail","MARKS","IconBrandGoogle","SocialButtons","providers","setProviders","leaving","setLeaving","active","then","Divider","socialDivider","labelPosition","Mark","stroke","socialButton","Wordmark","TERMS_URL","TermsNotice","text","linkText","mt","textWrap","rel","inherit","underline","describeCodeFailure","kind","isLocked","attemptsLeft","isInteger","CodeFailureNotice","texts","wrong","wrongCodeTitle","wrongCodeHint","lastAttempt","join","exhausted","attemptsExhaustedTitle","attemptsExhausted","expired","codeExpiredTitle","codeExpired","other","codeFailedTitle","invalidCode","Alert","icon","IconAlertCircle","root","AuthTransition","Center","minHeight","SignIn","authenticatedRedirect","redirectingFallback","onSuccess","handleRedirect","redirectOrigins","onCodeSent","termsUrl","socialLogin","recentAccounts","cardProps","authLoading","sentTo","setSentTo","setCode","codeFailure","setCodeFailure","isCodeResent","setIsCodeResent","codeInputRef","useRef","setAccounts","isChoosingOther","setIsChoosingOther","isManaging","setIsManaging","setPickingEmail","isShowingAccounts","isCodeLocked","applicationLogo","finalLogo","useNavigate","form","useForm","initialValues","validate","test","invalidEmail","redirectOriginsKey","isActive","isDirty","handleRequest","values","step","isShownOnCard","handleResend","isSent","current","focus","handlePick","some","handleForget","handleVerify","redirectHandled","oauthPending","willRedirect","codeSent","recentAccountsSubtitle","onSubmit","IconArrowLeft","savedAccounts","TextInput","placeholder","emailPlaceholder","autoFocus","autoComplete","getInputProps","readOnly","sendCodeButton","termsNotice","termsLink","span","codeResentTitle","codeResent","ref","codeLabel","codeSentTo","onChange","currentTarget","onKeyDown","IconRefresh","sendNewCode","verifyingCode","confirmCode","changeEmail","resendCode","BROWSERS","describeDevice","userAgent","ua","browser","find","pattern","os","deviceLabel","pad","n","formatSessionStart","date","isNaN","time","getHours","getMinutes","startOfDay","d","getFullYear","getMonth","getDate","day","countSessions","count","orderSessions","currentId","createdAt","describeUser","fullName","primaryEmailAddress","hasRealName","initials","part","imageUrl","LABELS","close","profileSection","avatar","edit","save","cancel","remove","notDefined","namePlaceholder","nameHint","nameRequired","emailHint","avatarPrompt","avatarHint","avatarInvalidType","avatarTooLarge","signInSection","codeMethod","codeByEmail","alwaysOn","notConnected","connect","disconnect","sessionsSection","devices","showSessions","hideSessions","thisDevice","end","since","unknownIP","loadingSessions","noSessionsFound","confirmEndBody","genericFailure","PROVIDER_MARKS","IconBrandGithub","DEVICE_MARKS","desktop","IconDeviceLaptop","phone","IconDeviceMobile","tablet","IconDeviceTablet","TONES","default","ground","dark","quiet","danger","dangerOutline","dangerFill","ActionButton","tone","others","setIsActive","isBlocked","look","UnstyledButton","onMouseEnter","onMouseLeave","onFocus","onBlur","whiteSpace","SectionLabel","note","mb","Section","isFirst","Box","px","pt","pb","rowDivider","Row","action","mih","gridTemplateColumns","minWidth","overflowWrap","Hint","FailureNote","section","Chip","looks","outline","bg","good","WithIcon","Icon","flex","marginTop","SquareAvatar","formatSize","bytes","UserProfile","onProfileUpdate","onSessionRevoked","onOtherSessionsRevoked","onProviderUnlinked","showAvatar","showName","showEmail","showSignInMethods","logoHeight","maxAvatarSize","customSections","containerProps","t","isVisible","identity","editing","setEditing","avatarPreview","setAvatarPreview","isDragging","setIsDragging","areSessionsOpen","setAreSessionsOpen","isSessionsRowActive","setIsSessionsRowActive","isConfirmingEnd","setIsConfirmingEnd","linked","setLinked","pendingProvider","setPendingProvider","setFailure","sessionsListId","useId","nameForm","refreshSignInMethods","closeEditor","available","fail","isShownOnScreen","reset","openEditor","setValues","handleSaveName","handleAvatarFile","file","reader","FileReader","onloadend","readAsDataURL","saveAvatar","handleUnlink","item","handleLink","handleEndSession","handleEndOthers","ordered","othersCount","hasProfile","hasSignInMethods","sessionsSummary","header","borderBottom","m","height","identityStrip","avatarEditor","FileButton","accept","onDragOver","preventDefault","onDragLeave","onDrop","dataTransfer","files","marginRight","nameEditor","marginBottom","stopPropagation","sessionsList","device","IconDeviceDesktop","ipAddress","endOthersQuestion","endOthersConfirm","endOthersAction","IconMail","link","entry","IconLink","isOpen","IconChevronDown","transform","transition","Root","closeOnEscape","Overlay","Content","Body","ROLE_LABELS","owner","admin","member","UPGRADE_THRESHOLD","UserInformation","onAccountClick","onBillingClick","itemsLabel","plan","organization","branded","termsLabel","accountLabel","billingLabel","signOutLabel","padded","baseRows","IconUser","IconCreditCard","panelRows","ContextStrip","moveFocus","RowGroup","rows","hasDivider","IconLogout","formatCount","toLocaleString","hasMeter","isFinite","used","limit","ratio","min","max","isFull","showsInvite","canUpgrade","limitNoticeOnTop","IconBuilding","ml","unit","actionLabel","row","ROW_TONES","hover","keys","querySelectorAll","indexOf","activeElement","last","SignedIn","SignedOut","AuthLoading","AuthLoaded","SignInButton","SignOutButton","onSignOut","handleClick"],"mappings":";;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,MAAMA,mBAAmB,GAAG;;AAEnC;AACA;AACO,MAAMC,mBAAmB,GAAG;;AAEnC;AACA;AACA;AACA,MAAMC,oBAAoB,GAAG,uBAAuB;AACpD,MAAMC,uBAAuB,GAAG,EAAE,GAAG,EA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