@atlasauth/angular 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"atlasauth-angular.mjs","sources":["../../src/lib/atlas.config.ts","../../src/lib/components/organization-audit-log.ts","../../src/lib/appearance.ts","../../src/lib/i18n.ts","../../src/lib/version.ts","../../src/lib/atlas.service.ts","../../src/lib/directives/toggle.directive.ts","../../src/lib/directives/signed-in.directive.ts","../../src/lib/directives/signed-out.directive.ts","../../src/lib/directives/loading.directive.ts","../../src/lib/directives/loaded.directive.ts","../../src/lib/directives/protect.directive.ts","../../src/lib/directives/atlas-root.directive.ts","../../src/lib/directives/captcha-slot.directive.ts","../../src/lib/components/policy-host.ts","../../src/lib/components/attempt-flow.component.ts","../../src/lib/components/recovery-codes.component.ts","../../src/lib/components/flow-controller.ts","../../src/lib/components/sign-in.component.ts","../../src/lib/components/sign-up-form.component.ts","../../src/lib/components/sign-up.component.ts","../../src/lib/components/user-button.component.ts","../../src/lib/components/organization-switcher.component.ts","../../src/lib/components/manage-ciba.component.ts","../../src/lib/components/user-profile.component.ts","../../src/lib/components/organization-profile.component.ts","../../src/lib/components/organization-audit-log.component.ts","../../src/lib/atlas.ui.ts","../../src/lib/provide-atlas.ts","../../src/lib/components/impersonation-banner.component.ts","../../src/lib/guards/atlas.guard.ts","../../src/lib/protect.ts","../../src/lib/types.ts","../../src/lib/fapi.ts","../../src/public-api.ts","../../src/atlasauth-angular.ts"],"sourcesContent":["import type { ReferralConsent, SignOutEvent } from '@atlasauth/js';\nimport { InjectionToken } from '@angular/core';\nimport type { Appearance } from './appearance';\nimport type { Catalog } from './i18n';\n\n/**\n * Configuration for the Atlas Angular SDK — the Angular analogue of the props\n * passed to React's `<AtlasProvider>`.\n */\nexport interface AtlasOptions {\n /** The instance's publishable key (`pk_…`). Required. */\n publishableKey: string;\n /**\n * Referral attribution: the prebuilt forms send the referral the visitor\n * arrived with on sign-in / sign-up when the instance has referrals on.\n * `false` turns that off.\n */\n referral?: false;\n /**\n * The app's own consent decision for the referral tracking cookie, used only\n * when Cookie Munch is not on the page: `'granted'` (or a function returning\n * it) lets the forms read the cookie. Default: the cookie is not read.\n */\n referralConsent?: ReferralConsent;\n /**\n * The instance's Frontend API: an absolute URL such as\n * `\"https://auth.example.com\"`, or `\"same-origin\"` / a path such as `\"/atlas\"`\n * behind a reverse proxy on the app's own origin (requests then go to\n * `/v1/...` on the app's host). Required at runtime — `AtlasService` throws an\n * `AtlasConfigError` (`FRONTEND_API_REQUIRED` / `FRONTEND_API_INVALID`) when\n * it is missing or malformed. Optional in the type only so existing call sites\n * keep compiling.\n */\n frontendApi?: string;\n /** Design tokens + per-element class overrides. See {@link Appearance}. */\n appearance?: Appearance;\n /** A localization catalog merged over `en-US`. */\n localization?: Catalog;\n /**\n * A `fetch` implementation to use instead of the global one — handy for SSR\n * or tests. Defaults to `globalThis.fetch`.\n */\n fetchImpl?: typeof fetch;\n /**\n * Called once each time a signed-in user becomes signed out, on every path:\n * `reason` is `user`, `other_tab`, `session_expired`, `revoked` (ended\n * elsewhere, seen on the next refresh) or `unknown`. See also\n * `AtlasService.signOut$`.\n */\n onSignOut?: (event: SignOutEvent) => void;\n}\n\n/**\n * DI token carrying the resolved {@link AtlasOptions}. Populated by\n * {@link provideAtlas} (standalone) or {@link AtlasModule.forRoot} (NgModule)\n * and read by {@link AtlasService}. Applications rarely inject this directly.\n */\nexport const ATLAS_OPTIONS = new InjectionToken<AtlasOptions>('ATLAS_OPTIONS');\n","import { signal, type Signal, type WritableSignal } from '@angular/core';\nimport type { Observable, Subscription } from 'rxjs';\nimport { distinctUntilChanged, map } from 'rxjs/operators';\nimport {\n createOrganizationAuditLog,\n type FapiClient,\n type OrganizationAuditLogController,\n type OrganizationAuditLogOptions,\n type OrganizationAuditLogState,\n} from '@atlasauth/js';\nimport type { AtlasOrganizationMembership } from '../types';\n\n/**\n * The active organization's audit trail, for its admins — the engine behind\n * `<atlas-organization-audit-log>` and `AtlasService.organizationAuditLog()`\n * (the Angular peer of React's `useOrganizationAuditLog`). `state` is a signal\n * of `{ entries, loading, forbidden, hasMore }`, one page at a time, newest\n * first. It follows the active organization until {@link destroy}.\n */\nexport class AtlasOrganizationAuditLog {\n private readonly _state: WritableSignal<OrganizationAuditLogState>;\n private readonly log: OrganizationAuditLogController;\n private readonly unsubscribe: () => void;\n private readonly organizationSub: Subscription;\n\n readonly state: Signal<OrganizationAuditLogState>;\n\n constructor(\n client: Pick<FapiClient, 'get'>,\n organization$: Observable<AtlasOrganizationMembership | null>,\n options: OrganizationAuditLogOptions = {},\n ) {\n this.log = createOrganizationAuditLog(client, options);\n this._state = signal(this.log.getState());\n this.state = this._state.asReadonly();\n this.unsubscribe = this.log.subscribe((next) => this._state.set(next));\n this.organizationSub = organization$\n .pipe(\n map((membership) => membership?.organization.id ?? null),\n distinctUntilChanged(),\n )\n .subscribe((id) => void this.log.load(id));\n }\n\n /** Append the next page, when there is one. */\n loadMore(): Promise<void> {\n return this.log.loadMore();\n }\n\n /** Re-read from the newest entry. */\n reload(): Promise<void> {\n return this.log.reload();\n }\n\n /** Stop following the active organization. */\n destroy(): void {\n this.organizationSub.unsubscribe();\n this.unsubscribe();\n }\n}\n","/**\n * §10.3 theming.\n *\n * \"appearance prop: design tokens (colors, radius, font, spacing) + per-element\n * class overrides (elements: { formButtonPrimary: \"…\" }). No iframe — components\n * render in the host DOM so Tailwind/CSS just works.\"\n *\n * Rendering in the host DOM is the decision everything else follows from. An\n * iframe would isolate styles perfectly and be unusable: it cannot be sized to\n * its content reliably, it breaks password managers, it breaks autofill, and a\n * Tailwind class the customer writes has no effect inside it. Sharing the DOM\n * means the customer's CSS reaches our markup, which is exactly what they want\n * and what makes an override system necessary rather than decorative.\n *\n * Element classes are APPENDED to ours, never replacing them. A customer adding\n * `className=\"rounded-xl\"` wants a rounder button, not an unstyled one — and\n * replacement is a support burden where every override starts by rebuilding the\n * component's base styles from scratch.\n */\n\nimport {\n renderDesignAppearance,\n type AppearanceRender,\n type DesignAppearance,\n type DesignWarn,\n type InstanceDesign,\n} from '@atlasauth/design/runtime';\n\nexport { instanceDesignFrom } from '@atlasauth/design/runtime';\nexport type { AppearanceRender, AtlasDesign, InstanceDesign, PresetId } from '@atlasauth/design/runtime';\n\nexport interface DesignTokens {\n colorPrimary?: string;\n colorText?: string;\n colorBackground?: string;\n colorDanger?: string;\n colorBorder?: string;\n borderRadius?: string;\n fontFamily?: string;\n spacingUnit?: string;\n}\n\n/** Every element a customer may target. Named for what it IS, not where it sits. */\nexport type ElementKey =\n | 'root'\n | 'card'\n | 'headerTitle'\n | 'headerSubtitle'\n | 'formField'\n | 'formFieldLabel'\n | 'formFieldInput'\n | 'formFieldError'\n | 'formButtonPrimary'\n | 'formButtonSecondary'\n | 'socialButton'\n | 'dividerText'\n | 'footerAction'\n | 'avatar'\n | 'menu'\n | 'menuItem'\n | 'list'\n | 'listItem'\n | 'badge';\n\nexport interface Appearance extends DesignAppearance {\n /** A prebuilt token theme to start from (pre-design-system themes). */\n baseTheme?: keyof typeof THEMES;\n /**\n * Legacy design tokens. Without a design they set the `--atlas-*` variables\n * exactly as before; with one they map onto it.\n */\n variables?: DesignTokens;\n elements?: Partial<Record<ElementKey, string>>;\n // From DesignAppearance:\n // preset?: PresetId a design preset (replaces the dashboard design as the base)\n // design?: AtlasDesign structured overrides, highest precedence\n // instanceDesign?: boolean apply the dashboard design automatically (default true)\n}\n\nexport const DEFAULT_TOKENS: Required<DesignTokens> = {\n colorPrimary: '#5b5bd6',\n colorText: '#1c1c1f',\n colorBackground: '#ffffff',\n colorDanger: '#c53030',\n colorBorder: '#e4e4e9',\n borderRadius: '8px',\n fontFamily: 'ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", sans-serif',\n spacingUnit: '4px',\n};\n\n/**\n * §10.3: \"prebuilt themes shipped (default, dark, neobrutalist as a demo of the\n * override system)\". Neobrutalist exists to prove the token set is expressive\n * enough for a theme that looks nothing like the default — a theming system\n * that only produces tasteful variations of itself is not a theming system.\n */\nexport const THEMES = {\n default: DEFAULT_TOKENS,\n dark: {\n ...DEFAULT_TOKENS,\n colorText: '#e6e9ef',\n colorBackground: '#14171c',\n colorBorder: '#242932',\n colorPrimary: '#6ea8fe',\n },\n neobrutalist: {\n ...DEFAULT_TOKENS,\n colorPrimary: '#ffe600',\n colorText: '#000000',\n colorBackground: '#ffffff',\n colorBorder: '#000000',\n borderRadius: '0px',\n fontFamily: '\"Courier New\", ui-monospace, monospace',\n },\n} as const satisfies Record<string, Required<DesignTokens>>;\n\n/**\n * Resolve tokens: defaults, then the base theme, then explicit variables.\n *\n * Later wins, and `undefined` never overwrites. A customer setting one variable\n * on the dark theme expects the other eleven to stay dark, not silently revert\n * to the light defaults.\n */\nexport function resolveTokens(appearance?: Appearance): Required<DesignTokens> {\n const base = appearance?.baseTheme ? THEMES[appearance.baseTheme] : DEFAULT_TOKENS;\n const overrides = appearance?.variables ?? {};\n\n const resolved = { ...DEFAULT_TOKENS, ...base };\n for (const [key, value] of Object.entries(overrides)) {\n if (value !== undefined) resolved[key as keyof DesignTokens] = value;\n }\n return resolved;\n}\n\n/** Tokens as CSS custom properties, for the host DOM to inherit. */\nexport function cssVariables(tokens: Required<DesignTokens>): Record<string, string> {\n const vars: Record<string, string> = {};\n for (const [key, value] of Object.entries(tokens)) {\n // camelCase → --atlas-kebab-case, which is what a customer writes in CSS.\n vars[`--atlas-${key.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)}`] = value;\n }\n return vars;\n}\n\n/**\n * Combine our base class with the customer's override.\n *\n * Appended, never replaced — a customer adding `rounded-xl` wants a rounder\n * button, not an unstyled one. Theirs comes last so it wins on equal\n * specificity, which is the behaviour anyone writing Tailwind expects.\n */\nexport function classFor(\n element: ElementKey,\n appearance: Appearance | undefined,\n base: string,\n): string {\n const override = appearance?.elements?.[element];\n return override ? `${base} ${override}` : base;\n}\n\n// ---- the design system ---------------------------------------------------------\n\n/**\n * The legacy tokens the developer chose EXPLICITLY: a non-default `baseTheme`\n * plus `variables`. Only these map onto a design — the token defaults must not\n * overwrite the dashboard design.\n */\nexport function explicitTokens(appearance?: Appearance): DesignTokens {\n const out: DesignTokens = {};\n if (appearance?.baseTheme && appearance.baseTheme !== 'default') {\n Object.assign(out, THEMES[appearance.baseTheme]);\n }\n for (const [key, value] of Object.entries(appearance?.variables ?? {})) {\n if (value !== undefined) out[key as keyof DesignTokens] = value;\n }\n return out;\n}\n\n/**\n * Turn an `appearance` (+ the instance's dashboard design from the Frontend\n * API) into root attributes and a stylesheet — the same semantics as\n * `@atlasauth/react`. Precedence, lowest first: dashboard design < `preset` <\n * `variables` (and a non-default `baseTheme`) < `design`. Without a dashboard\n * design and without `preset`/`design`, the output is exactly the\n * pre-design-system one: the token variables, no stylesheet, no attributes.\n */\nexport function renderAppearance(\n appearance: Appearance | undefined,\n instanceDesign: InstanceDesign | null | undefined,\n options: { frontendApi?: string; warn?: DesignWarn } = {},\n): AppearanceRender {\n return renderDesignAppearance(appearance, instanceDesign, {\n tokens: explicitTokens(appearance),\n legacyStyle: () => cssVariables(resolveTokens(appearance)),\n frontendApi: options.frontendApi,\n warn: options.warn,\n });\n}\n","/**\n * §10.3: \"Every string passes through an i18n catalog; en-US ships, catalog\n * format documented for community locales.\"\n *\n * A flat key-to-string map rather than nested objects, because nesting looks\n * tidier and makes a missing key a runtime crash on `undefined.of.a.chain`\n * rather than a visible fallback.\n *\n * A missing key renders the KEY, not an empty string. A blank button is a bug\n * nobody can report; a button reading `signIn.submit` is one anyone can.\n */\n\nimport { POLICY_STRINGS } from '@atlasauth/js';\n\nexport type Catalog = Record<string, string>;\n\nexport const EN_US: Catalog = {\n 'signIn.title': 'Sign in',\n 'signIn.subtitle': 'to continue to {application}',\n 'signIn.identifierLabel': 'Email address',\n 'signIn.passwordLabel': 'Password',\n 'signIn.submit': 'Continue',\n 'signIn.forgotPassword': 'Forgot password?',\n 'signIn.noAccount': 'No account?',\n 'signIn.lastUsed': 'Last used',\n 'signIn.signUpLink': 'Sign up',\n 'signIn.orDivider': 'or',\n 'signIn.socialButton': 'Continue with {provider}',\n 'signIn.continueWithAtlas': 'Continue with Atlas',\n 'signIn.emailCodeLabel': 'Verification code',\n 'signIn.useEmailCode': 'Email me a code',\n 'signIn.codeSentTo': 'We sent a code to {email}. Enter it below.',\n 'signIn.resendCode': 'Resend code',\n 'signIn.sending': 'Sending…',\n 'signIn.emailCodeOption': 'Email me a code instead',\n 'signIn.passkeyButton': 'Sign in with a passkey',\n 'signIn.passkeyCancelled': \"Passkey sign-in didn't finish. Try again, or use another way to sign in.\",\n 'signIn.magicLinkSent': 'Check your email for a sign-in link.',\n 'signIn.signedIn': 'You\\'re signed in.',\n 'signIn.sessionNotKept':\n 'You signed in, but this browser didn\\'t keep the session. If it blocks third-party cookies, allow cookies for this site and try again.',\n 'signIn.checkOtherTab': 'You can close this tab — you are signed in where you started.',\n\n 'signUp.title': 'Create your account',\n 'signUp.submit': 'Continue',\n 'signUp.haveAccount': 'Already have an account?',\n 'signUp.signInLink': 'Sign in',\n 'signUp.emailLabel': 'Email address',\n 'signUp.passwordLabel': 'Password',\n 'signUp.optionalField': '{label} (optional)',\n 'signUp.selectPlaceholder': 'Select…',\n 'signUp.consentAgree': 'I agree to the',\n 'signUp.consentNotice': 'By continuing you agree to the',\n 'signUp.terms': 'Terms of Service',\n 'signUp.privacy': 'Privacy Policy',\n 'signUp.and': 'and',\n // = EMAIL_UNAVAILABLE_MESSAGE from @atlasauth/js.\n 'signUp.emailUnavailable':\n \"This app can't send email right now. Try another sign-in method or contact the app owner.\",\n 'signUp.passkeyOption': 'Sign up with a passkey instead',\n 'signUp.passwordOption': 'Sign up with a password instead',\n 'signUp.passkeyIntro': \"No password needed: you'll sign in with a passkey saved on this device or in your password manager.\",\n 'signUp.passkeyPrompt': 'Create a passkey to finish setting up your account.',\n 'signUp.passkeyCreate': 'Create passkey',\n 'signUp.passkeyCancelled': \"The passkey wasn't created. Try again when you're ready.\",\n 'signUp.linkSentTo': 'We sent a confirmation link to {email}. Open it on any device; this page continues on its own.',\n\n 'captcha.prompt': 'Complete the security check to continue.',\n 'captcha.required': 'Please complete the security check, then try again.',\n 'captcha.failed': \"The security check didn't pass. Please try again.\",\n 'captcha.checking': 'Checking your browser…',\n 'captcha.verified': 'Security check complete.',\n 'captcha.puzzlePrompt': \"Select every picture that shows the same shape as this one. Colour and size don't matter.\",\n 'captcha.puzzleConfirm': 'Confirm',\n 'captcha.puzzleTile': 'Picture {n}',\n 'captcha.puzzleAlternative': \"Can't do the picture check? Use a longer automatic check instead.\",\n\n 'mfa.title': 'Two-step verification',\n 'mfa.subtitle': 'Enter the code from your authenticator app.',\n 'mfa.codeLabel': 'Code',\n 'mfa.enrollFirstCodeLabel': 'Code from your authenticator app',\n 'mfa.enrollSecondCodeLabel': 'The next code it shows',\n 'mfa.usePasskey': 'Use a passkey instead',\n 'mfa.useBackupCode': 'Use a recovery code',\n 'mfa.submit': 'Verify',\n 'mfa.enrollChoose': 'Set up a second step for signing in.',\n 'mfa.enrollTotpOption': 'Use an authenticator app',\n 'mfa.enrollSmsOption': 'Use text messages',\n 'mfa.enrollScan': 'Scan this QR code with your authenticator app, or enter the setup key.',\n 'mfa.enrollQrAlt': 'QR code for your authenticator app',\n 'mfa.enrollSetupKey': 'Setup key',\n 'mfa.enrollPreparing': 'Setting up…',\n 'mfa.phoneLabel': 'Mobile number',\n 'mfa.phoneHint': 'Include the country code, for example +14155550101.',\n 'mfa.sendCode': 'Text me a code',\n 'mfa.codeTextedTo': 'Enter the code we texted to {phone}.',\n 'mfa.smsCodeOption': 'Text me a code instead',\n 'mfa.recoveryCodesTitle': 'Save your recovery codes',\n 'mfa.recoveryCodesHelp': \"Each code works once. If you can't use your second step, sign in with one of these. Keep them somewhere safe: they won't be shown again.\",\n 'mfa.recoveryCodesCopy': 'Copy codes',\n 'mfa.recoveryCodesCopied': 'Copied.',\n 'mfa.recoveryCodesDownload': 'Download as .txt',\n 'mfa.recoveryCodesSaved': \"I've saved my codes\",\n\n 'reset.title': 'Reset your password',\n 'reset.submit': 'Send reset code',\n 'reset.newPasswordLabel': 'New password',\n\n 'userButton.manageAccount': 'Manage account',\n 'userButton.signOut': 'Sign out',\n 'userButton.signOutAll': 'Sign out of all devices',\n\n 'userProfile.title': 'Account',\n 'userProfile.profileSection': 'Profile',\n 'userProfile.emailsSection': 'Email addresses',\n 'userProfile.securitySection': 'Security',\n 'userProfile.devicesSection': 'Active devices',\n 'userProfile.dangerSection': 'Danger zone',\n 'userProfile.addEmail': 'Add an email address',\n 'userProfile.makePrimary': 'Make primary',\n 'userProfile.unverified': 'Unverified',\n 'userProfile.verify': 'Verify',\n 'userProfile.verifyConfirm': 'Confirm',\n 'userProfile.verifyCodePlaceholder': 'Code from the email',\n 'userProfile.verifySendFailed': 'We could not send a code right now. Try again in a minute.',\n 'userProfile.verifyCodeRejected': 'That code was not accepted.',\n 'userProfile.revokeDevice': 'Sign out',\n 'userProfile.deleteAccount': 'Delete account',\n\n 'organization.switcher': 'Switch organization',\n 'organization.personal': 'Personal account',\n 'organization.members': 'Members',\n 'organization.invite': 'Invite member',\n 'organization.roleLabel': 'Role',\n 'organization.invitations': 'Invitations',\n 'organization.settings': 'Settings',\n 'organization.emailLabel': 'Email address',\n 'organization.sendInvite': 'Send invitation',\n 'organization.noInvitations': 'No pending invitations.',\n 'organization.remove': 'Remove',\n 'organization.revoke': 'Revoke',\n 'organization.resend': 'Resend',\n 'organization.you': '(you)',\n 'organization.leave': 'Leave organization',\n 'organization.leaveConfirm': 'Leave {name}? You will lose access until you are invited again.',\n 'organization.delete': 'Delete organization',\n 'organization.deleteConfirm': 'Delete {name} for every member? This cannot be undone.',\n 'organization.confirm': 'Confirm',\n 'organization.cancel': 'Cancel',\n 'organization.unnamedMember': 'Unnamed member',\n 'organization.passwordPrompt': 'Enter your password to confirm.',\n 'organization.roles': 'Roles',\n 'organization.roleName': 'Role name',\n 'organization.roleKey': 'Role key (for example org:auditor)',\n 'organization.rolePermissions': 'Permissions',\n 'organization.createRole': 'Create role',\n 'organization.saveRole': 'Save role',\n 'organization.editRole': 'Edit',\n 'organization.deleteRole': 'Delete',\n 'organization.noCustomRoles': 'This organization has no roles of its own yet.',\n 'impersonation.banner': 'You are signed in as {name} on someone else\\'s behalf.',\n 'impersonation.returnToAdmin': 'Return to admin',\n 'impersonation.end': 'End impersonation',\n\n // Policy acceptance (terms, privacy, any policy).\n ...POLICY_STRINGS,\n\n 'error.generic': 'Something went wrong. Please try again.',\n 'error.network': 'We could not reach the server. Check your connection.',\n\n // Server errors, by the stable `reason` the Frontend API sends. Shown instead\n // of the server's `message` (see `localizedErrorMessage` in @atlasauth/js).\n 'error.form_password_incorrect': 'Those credentials are incorrect.',\n 'error.form_code_incorrect': 'That code is incorrect.',\n 'error.form_code_already_used': 'That code has already been used. Wait for a new one.',\n 'error.form_code_expired': 'That code has expired. Request a new one.',\n 'error.form_code_max_attempts': 'Too many incorrect codes. Request a new code.',\n 'error.form_link_invalid': 'That sign-in link is invalid or has already been used.',\n 'error.form_identifier_not_found': \"We couldn't find an account with those details.\",\n 'error.form_identifier_exists': \"There's already an account for this email. Sign in with {methods}.\",\n 'error.form_password_pwned': 'This password has appeared in a known data breach. Please choose a different one.',\n 'error.form_password_too_short': 'Password must be at least {min_length} characters.',\n 'error.form_password_too_long': 'Password must be at most {max_length} characters.',\n 'error.form_password_requires_uppercase': 'Password must contain an uppercase letter.',\n 'error.form_password_requires_lowercase': 'Password must contain a lowercase letter.',\n 'error.form_password_requires_number': 'Password must contain a number.',\n 'error.form_password_requires_symbol': 'Password must contain a symbol.',\n 'error.form_password_not_allowed': 'That password is not allowed. Choose a different one.',\n 'error.form_password_contains_identifier': 'Password must not contain your email or username.',\n 'error.form_password_same_as_current': 'Your new password must be different from your current one.',\n 'error.form_password_reused': 'Your new password must not match any of your last {history_count} passwords.',\n 'error.password_expired': 'Your password has expired. Reset it to continue.',\n 'error.email_not_verified': 'Your email address is not verified yet. Verify it before signing in with your password.',\n 'error.sign_in_token_invalid': 'That sign-in token is invalid or has expired.',\n 'error.too_many_attempts': 'Too many failed attempts. Try again later.',\n 'error.too_many_requests': 'Too many requests. Please try again later.',\n 'error.captcha_required': 'Please complete the security check, then try again.',\n 'error.captcha_failed': \"The security check didn't pass. Please try again.\",\n 'error.captcha_unavailable': 'The security check is unavailable right now. Please try again later.',\n 'error.email_delivery_unavailable': \"This app can't send email right now. Try another sign-in method or contact the app owner.\",\n 'error.strategy_disabled': 'This sign-in method is not available for this app.',\n 'error.sign_up_restricted': 'Sign-up on this app is by invitation only.',\n 'error.waitlisted': \"You're on the waitlist. We'll email you when a place opens up.\",\n 'error.identifier_not_allowed': 'This email or phone number is not allowed on this app.',\n 'error.disposable_email_blocked': 'Sign-up with a disposable or temporary email address is not allowed.',\n 'error.sso_required': 'This organization requires signing in through single sign-on.',\n 'error.sign_ins_disabled': 'Sign-ins are temporarily disabled.',\n 'error.sign_ups_disabled': 'Sign-ups are temporarily disabled.',\n 'error.high_risk_blocked': 'This sign-in was blocked because it looked unusual.',\n 'error.sms_region_blocked': 'Text messages are not available for this phone number.',\n};\n\n/**\n * Look up a key and interpolate `{placeholders}`.\n *\n * An unknown placeholder is left visible for the same reason a missing key is:\n * `Continue with {provider}` in the UI is a bug report waiting to be filed,\n * whereas `Continue with ` is one nobody notices until a customer does.\n */\nexport function translate(\n catalog: Catalog,\n key: string,\n variables: Record<string, string> = {},\n): string {\n const template = catalog[key] ?? EN_US[key] ?? key;\n return template.replace(/\\{(\\w+)\\}/g, (match, name: string) => variables[name] ?? match);\n}\n\n/** Merge a community locale over en-US so a partial translation still renders. */\nexport function withFallback(locale: Catalog): Catalog {\n return { ...EN_US, ...locale };\n}\n","import type { AtlasSdkInfo } from '@atlasauth/js';\n\n/** This package's version, sent as `X-Atlas-SDK` (kept in step with package.json by a test). */\nexport const ATLAS_ANGULAR_VERSION = '0.13.0';\nexport const ATLAS_ANGULAR_SDK: AtlasSdkInfo = { name: '@atlasauth/angular', version: ATLAS_ANGULAR_VERSION };\n","import {\n Injectable,\n OnDestroy,\n PLATFORM_ID,\n Signal,\n computed,\n inject,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { BehaviorSubject, Observable, Subject, combineLatest } from 'rxjs';\nimport { distinctUntilChanged, map } from 'rxjs/operators';\nimport { AtlasOrganizationAuditLog } from './components/organization-audit-log';\nimport {\n FapiClient,\n SignOutGuard,\n catalogLocale,\n localizedErrorMessage,\n type ErrorLike,\n TokenCache,\n closeOAuthPopupAfterSignIn,\n completeOAuthPopupLanding,\n getProviderToken as fetchProviderToken,\n mapOAuthPopupPayload,\n msUntilRefresh,\n readExpiry,\n readRedirectResult,\n resolveFrontendApi,\n stripRedirectParams,\n type OrganizationAuditLogOptions,\n type ProviderToken,\n type RedirectResult,\n type SignOutOptions,\n type SignOutResult,\n type EndImpersonationResult,\n SDK_HEADER,\n SignOutNotifier,\n getTemplateToken,\n reportSdkAdvisory,\n sdkHeaderValue,\n signOutReasonFromClient,\n type SignOutEvent,\n type SignOutListener,\n type SignOutReason,\n configureReferralCapture,\n withDevBrowser,\n reauthenticate,\n} from '@atlasauth/js';\nimport { evaluate, type ProtectCondition } from '@atlasauth/authz';\nimport { ATLAS_OPTIONS } from './atlas.config';\nimport {\n cssVariables,\n instanceDesignFrom,\n renderAppearance,\n resolveTokens,\n type Appearance,\n type AppearanceRender,\n type InstanceDesign,\n} from './appearance';\nimport { EN_US, withFallback, type Catalog } from './i18n';\nimport type {\n AtlasOrganizationMembership,\n AtlasSession,\n AtlasUser,\n AuthStatus,\n SessionClaims,\n} from './types';\nimport { ATLAS_ANGULAR_SDK } from './version';\n\n/**\n * `AtlasService` — the Angular peer of React's `<AtlasProvider>` + hooks.\n *\n * It holds exactly one thing that matters in memory: the short-lived JWT, in a\n * {@link TokenCache}. Not localStorage, not a cookie this code writes — the\n * refresh token is HttpOnly so browser script never touches it, and the JWT\n * lives only as long as the tab. Anything persisted would survive the tab and\n * become the first thing an XSS reads.\n *\n * Reactive auth state is exposed two ways so callers can pick their idiom:\n * - RxJS observables (`user$`, `session$`, `isSignedIn$`, …) — the primary API,\n * the analogue of the React hooks' return values.\n * - Angular signals (`user`, `session`, `isSignedIn`, …) — the same values as\n * `Signal<T>`, for templates and `computed()`.\n *\n * The imperative methods (`signOut`, `getToken`, `getProviderToken`,\n * `setActiveOrganization`, `reload`) mirror the actions the hooks return.\n */\n@Injectable({ providedIn: 'root' })\nexport class AtlasService implements OnDestroy {\n private readonly options = inject(ATLAS_OPTIONS);\n private readonly platformId = inject(PLATFORM_ID);\n private readonly isBrowser = isPlatformBrowser(this.platformId);\n\n private readonly baseUrl: string;\n private readonly publishableKey: string;\n private readonly doFetch: typeof fetch;\n\n private readonly cache = new TokenCache();\n private readonly fapiClient: FapiClient;\n private refreshTimer: ReturnType<typeof setTimeout> | null = null;\n\n /**\n * The sessions this browser signed out of (tombstones in localStorage, per\n * Frontend API origin), the revoke and its background re-tries. Every reload /\n * refresh asks it before adopting a session, so a sign-out the server never\n * confirmed is not undone by the still-valid refresh cookie.\n */\n private readonly guard: SignOutGuard;\n private stopWatchingSignOut: (() => void) | null = null;\n\n private readonly catalog: Catalog;\n /** The language layer of `catalog` (the `localization` bundle alone; `EN_US` when none). */\n private readonly errorCatalog: Catalog;\n /** Sent to the Frontend API as `Accept-Language`: the `localization` bundle's `locale` tag. */\n private readonly requestLocale: string | undefined;\n\n /**\n * A sign-in attempt handed back by an OAuth redirect that still needs a second\n * factor (no session was issued). Null in the ordinary case; the `<atlas-sign-in>`\n * flow seeds itself from this so the user resumes at the 2FA step. Captured\n * once, synchronously, at construction — before any flow component reads it.\n */\n readonly pendingAttempt: { id: string; status: string; policyToken?: string } | null;\n\n // --- Reactive state (source of truth) ---------------------------------------\n\n private readonly _status = new BehaviorSubject<AuthStatus>('loading');\n private readonly _user = new BehaviorSubject<AtlasUser | null>(null);\n private readonly _session = new BehaviorSubject<AtlasSession | null>(null);\n private readonly _claims = new BehaviorSubject<SessionClaims | null>(null);\n private readonly _memberships = new BehaviorSubject<AtlasOrganizationMembership[]>([]);\n // ATL-S-30 sign-out events, on every path.\n private readonly notifier = new SignOutNotifier();\n private readonly _signOut = new Subject<SignOutEvent>();\n /**\n * Emits once each time a signed-in user becomes signed out: `reason` is\n * `user`, `other_tab`, `session_expired`, `revoked` (ended elsewhere, seen on\n * the next token refresh) or `unknown`. The place to reset an embedded\n * third party (a chat widget). Also dispatched as `atlas:signout` on `window`.\n */\n readonly signOut$: Observable<SignOutEvent> = this._signOut.asObservable();\n\n /** The three-state auth lifecycle: `loading` → `signed_in` | `signed_out`. */\n readonly status$: Observable<AuthStatus> = this._status.asObservable();\n readonly user$: Observable<AtlasUser | null> = this._user.asObservable();\n readonly session$: Observable<AtlasSession | null> = this._session.asObservable();\n readonly claims$: Observable<SessionClaims | null> = this._claims.asObservable();\n readonly memberships$: Observable<AtlasOrganizationMembership[]> =\n this._memberships.asObservable();\n\n /**\n * True once the SDK has finished its first boot. Distinguishing \"still loading\"\n * from \"signed out\" is what lets a template avoid the flash of a sign-in form\n * on every page load.\n */\n readonly isLoaded$: Observable<boolean> = this.status$.pipe(\n map((s) => s !== 'loading'),\n distinctUntilChanged(),\n );\n\n readonly isSignedIn$: Observable<boolean> = this.status$.pipe(\n map((s) => s === 'signed_in'),\n distinctUntilChanged(),\n );\n\n /** The active organization membership, derived from the token's `org_id` claim. */\n readonly organization$: Observable<AtlasOrganizationMembership | null> = combineLatest([\n this._memberships,\n this._claims,\n ]).pipe(\n map(\n ([memberships, claims]) =>\n memberships.find((m) => m.organization.id === claims?.org_id) ?? null,\n ),\n );\n\n // --- Signal mirror ----------------------------------------------------------\n\n readonly status: Signal<AuthStatus> = toSignal(this.status$, { initialValue: 'loading' });\n readonly user: Signal<AtlasUser | null> = toSignal(this.user$, { initialValue: null });\n readonly session: Signal<AtlasSession | null> = toSignal(this.session$, { initialValue: null });\n readonly claims: Signal<SessionClaims | null> = toSignal(this.claims$, { initialValue: null });\n readonly memberships: Signal<AtlasOrganizationMembership[]> = toSignal(this.memberships$, {\n initialValue: [] as AtlasOrganizationMembership[],\n });\n readonly isLoaded: Signal<boolean> = computed(() => this.status() !== 'loading');\n readonly isSignedIn: Signal<boolean> = computed(() => this.status() === 'signed_in');\n readonly organization: Signal<AtlasOrganizationMembership | null> = computed(() => {\n const orgId = this.claims()?.org_id;\n return this.memberships().find((m) => m.organization.id === orgId) ?? null;\n });\n\n constructor() {\n const options = this.options;\n this.publishableKey = options.publishableKey;\n // Throws an `AtlasConfigError` on a missing/invalid value rather than quietly\n // sending every request to a relative path on the app's origin.\n this.baseUrl = resolveFrontendApi(options.frontendApi, {\n component: 'provideAtlas() / AtlasModule.forRoot()',\n });\n // Development instances keep the session in a header where the browser blocks the cookie.\n this.doFetch = withDevBrowser(\n options.publishableKey,\n options.fetchImpl ?? ((...args: Parameters<typeof fetch>) => fetch(...args)),\n );\n\n this.catalog = options.localization ? withFallback(options.localization) : EN_US;\n this.errorCatalog = options.localization ?? EN_US;\n this.requestLocale = catalogLocale(options.localization);\n\n // Referral attribution: app-wide options every FAPI client on the page falls back to.\n configureReferralCapture({ referral: options.referral, referralConsent: options.referralConsent });\n this.fapiClient = new FapiClient({\n publishableKey: this.publishableKey,\n baseUrl: this.baseUrl,\n fetchImpl: this.doFetch,\n locale: this.requestLocale,\n sdk: ATLAS_ANGULAR_SDK,\n });\n\n this.notifier.subscribe((event) => this._signOut.next(event));\n if (options.onSignOut) this.notifier.subscribe(options.onSignOut);\n\n this.guard = new SignOutGuard({\n request: (path, init) => this.call(path, init),\n frontendApi: this.baseUrl,\n });\n\n // Captured synchronously (not in an async init) so it is available before any\n // flow component reads it: a needs_second_factor redirect carries a status but\n // no ticket, and that is what the 2FA resume seeds from.\n this.pendingAttempt = this.isBrowser ? this.readPendingAttempt() : null;\n\n // Boot once, browser only. On the server there is no cookie jar to read a\n // session from, so we leave the state at `loading` and let hydration boot it.\n if (this.isBrowser) {\n // Another tab signed out of THIS session (its tombstone reached the shared\n // store): drop the token and re-check, which then refuses the session.\n this.stopWatchingSignOut = this.guard.watch(\n () => this.cache.peek()?.sessionId ?? this._session.value?.id,\n () => {\n this.notifier.expect('other_tab');\n this.cache.clear();\n void this.reload();\n },\n );\n void this.boot();\n }\n }\n\n ngOnDestroy(): void {\n this.stopWatchingSignOut?.();\n this.stopWatchingSignOut = null;\n this.guard.dispose();\n this.clearRefreshTimer();\n this._status.complete();\n this._user.complete();\n this._session.complete();\n this._claims.complete();\n this._memberships.complete();\n this._signOut.complete();\n }\n\n // --- Configuration accessors ------------------------------------------------\n\n get appearance(): Appearance | undefined {\n return this.options.appearance;\n }\n\n get localization(): Catalog {\n return this.catalog;\n }\n\n get frontendApi(): string {\n return this.baseUrl;\n }\n\n /** The `Accept-Language` sent to the Frontend API: the `localization` bundle's `locale` tag, if any. */\n get locale(): string | undefined {\n return this.requestLocale;\n }\n\n /**\n * The text to show for a server error, in the app's language: the catalog's\n * `error.<reason>` (looked up in the `localization` bundle, or `EN_US` when\n * none is set), else the server's message, else `error.generic`.\n */\n errorText(error: ErrorLike | string | null | undefined): string {\n return localizedErrorMessage(error, this.errorCatalog, this.catalog);\n }\n\n /** The catalog server errors are looked up in (see {@link errorText}). */\n get errorLocalization(): Catalog {\n return this.errorCatalog;\n }\n\n /** Tokens as CSS custom properties, for a host element to inherit. */\n appearanceVariables(): Record<string, string> {\n return cssVariables(resolveTokens(this.options.appearance));\n }\n\n /**\n * The full appearance render for a root element: inline variables, the\n * `data-atlas-*` attributes and the design stylesheet. Pass the dashboard\n * design (from {@link loadInstanceDesign}) to layer code overrides on it —\n * the same semantics as `@atlasauth/react`.\n */\n appearanceRender(instanceDesign?: InstanceDesign | null): AppearanceRender {\n return renderAppearance(this.options.appearance, instanceDesign ?? null, {\n frontendApi: this.baseUrl,\n });\n }\n\n /**\n * The design configured in the Atlas dashboard (`GET /v1/appearance`), or null\n * when there is none, it cannot be read, or the app opted out with\n * `appearance.instanceDesign: false`.\n */\n async loadInstanceDesign(): Promise<InstanceDesign | null> {\n if (this.options.appearance?.instanceDesign === false) return null;\n try {\n const response = await this.call('/v1/appearance');\n return response.ok ? instanceDesignFrom(await response.json()) : null;\n } catch {\n return null;\n }\n }\n\n /**\n * The active organization's audit trail, for its admins: `state` is a signal\n * of `{ entries, loading, forbidden, hasMore }`, one page at a time with\n * `loadMore()`. `action` narrows it (exact, or a prefix ending in `.`). It\n * follows the active organization; call `destroy()` when done. The peer of\n * React's `useOrganizationAuditLog`.\n */\n organizationAuditLog(options: OrganizationAuditLogOptions = {}): AtlasOrganizationAuditLog {\n return new AtlasOrganizationAuditLog(this.createFapiClient(), this.organization$, options);\n }\n\n /**\n * Re-authenticate the signed-in user with their password (a step-up), for an\n * action the server answered with STEP_UP_REQUIRED. Rejects when refused.\n */\n reauthenticate(password: string): Promise<void> {\n return reauthenticate(\n { strategy: 'password', password },\n { api: this.baseUrl, publishableKey: this.publishableKey, fetchImpl: this.doFetch, locale: this.requestLocale },\n );\n }\n\n /** A fresh {@link FapiClient} for driving a sign-in/sign-up flow. */\n createFapiClient(): FapiClient {\n return new FapiClient({\n publishableKey: this.publishableKey,\n baseUrl: this.baseUrl,\n locale: this.requestLocale,\n sdk: ATLAS_ANGULAR_SDK,\n });\n }\n\n // --- Imperative API (mirrors the React hooks' actions) ----------------------\n\n /**\n * The current session's JWT, always fresh: if the cached token is within 5s of\n * expiry it is refreshed first rather than handed over. Null when signed out.\n */\n /** The session JWT; with `{ template }` a short-lived named-template token (e.g. `'chatly'`). */\n async getToken(options?: { template?: string }): Promise<string | null> {\n if (options?.template) {\n const sessionId = this.cache.peek()?.sessionId ?? this._session.value?.id ?? null;\n return sessionId ? ((await getTemplateToken(this.fapiClient, sessionId, options.template))?.jwt ?? null) : null;\n }\n const usable = this.cache.get(5_000);\n if (usable) return usable.jwt;\n\n await this.refresh();\n return this.cache.get(5_000)?.jwt ?? null;\n }\n\n /**\n * The signed-in user's OWN live access token at a connected provider (Google,\n * GitHub, …), so the app can call that provider's API from the browser. Null\n * when there is no usable token — no linked account, or the provider granted /\n * kept none. The server refreshes a stale token on read; the refresh token is\n * never exposed.\n */\n /** Listen for sign-out on every path (see {@link signOut$}); returns the unsubscribe. */\n onSignOut(listener: SignOutListener): () => void {\n return this.notifier.subscribe(listener);\n }\n\n getProviderToken(provider: string): Promise<ProviderToken | null> {\n return fetchProviderToken(this.fapiClient, provider);\n }\n\n /** Imperative `has()` — the same evaluation `*atlasProtect` renders on. */\n has(condition: ProtectCondition): boolean {\n return evaluate(this._claims.value, condition).allowed;\n }\n\n /**\n * Revoke the current session server-side and drop all local auth state.\n *\n * The session id is remembered before the revoke (a tombstone shared by every\n * tab), so a reload, a token refresh, a sibling tab or a tab opened later never\n * re-adopts it — even when the revoke failed (it is retried once, then again in\n * the background) and the refresh cookie is still valid. Resolves\n * `{ revoked, activeSessionId? }`; with `{ strict: true }` an unconfirmed revoke\n * rejects with a `SignOutError` instead (after the local sign-out). A parked\n * session the server promoted on revoke is adopted. Front-channel logout runs\n * unless `{ frontchannel: false }`.\n */\n async signOut(options: SignOutOptions = {}): Promise<SignOutResult> {\n // With no cached token the guard finds the cookie session itself\n // (GET /v1/client), so a missing JWT never skips the revoke.\n const sessionId = this.cache.peek()?.sessionId ?? this._session.value?.id ?? null;\n this.notifier.expect('user');\n const attempt = await this.guard.revoke(sessionId, options);\n this.clearLocalState('user');\n if (this.guard.promoted(attempt)) await this.reload();\n return this.guard.settle(attempt, options);\n }\n\n /**\n * End the active impersonation (\"return to admin\"): the impersonator's own\n * session on this browser becomes active again with no sign-in\n * (`resumed: true`); with none, another account signed in here is adopted,\n * or this browser is signed out.\n */\n async endImpersonation(): Promise<EndImpersonationResult> {\n const outcome = await this.guard.endImpersonation(this.cache.peek()?.sessionId ?? this._session.value?.id ?? null);\n if (!outcome.ended) return outcome;\n if (!outcome.activeSessionId) {\n this.clearLocalState('user');\n return outcome;\n }\n if (outcome.jwt) this.applyToken(outcome.jwt, outcome.activeSessionId);\n await this.reload();\n return outcome;\n }\n\n /**\n * Switch the active organization (or `null` for the personal account). The\n * new token carries the new org claims, so the app's permission checks update\n * without a re-login.\n */\n async setActiveOrganization(organizationId: string | null): Promise<void> {\n const current = this.cache.peek();\n if (!current) return;\n\n const response = await this.call(`/v1/client/sessions/${current.sessionId}/touch`, {\n method: 'POST',\n body: JSON.stringify({ active_organization_id: organizationId }),\n });\n if (!response.ok) return;\n\n const body = (await response.json()) as { jwt: string };\n this.applyToken(body.jwt, current.sessionId);\n await this.reload();\n }\n\n /** Re-read `/v1/client`: refresh user, session, memberships and status. */\n /** Re-boot from the Frontend API. Resolves true when a session now exists in this browser. */\n async reload(): Promise<boolean> {\n try {\n const response = await this.call('/v1/client');\n if (!response.ok) throw new Error('boot failed');\n\n const body = (await response.json()) as {\n session: AtlasSession | null;\n user: AtlasUser | null;\n jwt?: string;\n organization_memberships?: AtlasOrganizationMembership[];\n };\n\n // A session this browser signed out of is never re-adopted from the\n // refresh cookie; the guard re-tries its revoke in the background.\n if (!body.session || !body.user || this.guard.refuse(body.session.id)) {\n this.clearLocalState(body.session ? 'other_tab' : signOutReasonFromClient(body));\n return false;\n }\n this.notifier.clear();\n\n this._user.next(body.user);\n this._session.next(body.session);\n this._memberships.next(body.organization_memberships ?? []);\n if (body.jwt) this.applyToken(body.jwt, body.session.id);\n this._status.next('signed_in');\n this.scheduleRefresh();\n return true;\n } catch {\n // A failed boot is NOT signed-out. Rendering a sign-in form because the\n // network hiccuped throws away a perfectly good session and forces a\n // needless re-authentication. Only promote loading → signed_out.\n if (this._status.value === 'loading') this._status.next('signed_out');\n return false;\n }\n }\n\n // --- Internals --------------------------------------------------------------\n\n /**\n * §6.3 step 3: complete a redirect-based sign-in, then boot. An OAuth or\n * hosted-page flow lands back with a one-time ticket in the URL; exchange it\n * for cookies, scrub the URL so a reload cannot replay it, THEN read the\n * session. A redirect carrying only a status (a second factor is still owed)\n * has no ticket, so nothing is exchanged and the app boots signed-out.\n */\n private async boot(): Promise<void> {\n const fromUrl = readRedirectResult(window.location.search);\n let result: RedirectResult | null = fromUrl;\n\n // §oauth popup mode: this page may be the landing of a sign-in popup whose\n // opener a Cross-Origin-Opener-Policy severed (`#atlas_popup_result=…`).\n // The result is relayed to the opener, which redeems the ticket, and this\n // window closes. If no opener takes it (its tab is gone), finish here like\n // a redirect.\n const landing = await completeOAuthPopupLanding().catch(() => null);\n if (landing && !landing.delivered) {\n const outcome = mapOAuthPopupPayload(landing.payload);\n if (outcome?.ticket && outcome.attemptId) {\n result = { attemptId: outcome.attemptId, ticket: outcome.ticket };\n } else if (outcome?.continuationUrl) {\n // A second factor / connect step / provider error: the redirect flow's page.\n window.location.replace(outcome.continuationUrl);\n return;\n }\n }\n\n let exchanged = false;\n if (result?.ticket) {\n const response = await this.call('/v1/client/tickets/exchange', {\n method: 'POST',\n body: JSON.stringify({ attempt_id: result.attemptId, ticket: result.ticket }),\n }).catch(() => undefined);\n exchanged = !!response?.ok;\n }\n if (fromUrl) {\n window.history.replaceState({}, document.title, stripRedirectParams(window.location.href));\n }\n await this.reload();\n // Signed in inside the Atlas popup (the redirect flow ran in it): hand back\n // to the waiting opener and close. A no-op in an ordinary tab.\n if (exchanged) void closeOAuthPopupAfterSignIn();\n }\n\n private readPendingAttempt(): { id: string; status: string; policyToken?: string } | null {\n const result = readRedirectResult(window.location.search);\n return result?.status && !result.ticket\n ? { id: result.attemptId, status: result.status, ...(result.policyToken ? { policyToken: result.policyToken } : {}) }\n : null;\n }\n\n private async call(path: string, init?: RequestInit): Promise<Response> {\n const response = await this.doFetch(`${this.baseUrl}${path}`, {\n ...init,\n // Cookies carry the session; a request without this is indistinguishable\n // from being signed out.\n credentials: 'include',\n headers: {\n 'x-publishable-key': this.publishableKey,\n // Names this SDK so the Frontend API can flag a version with a known bug.\n [SDK_HEADER]: sdkHeaderValue(ATLAS_ANGULAR_SDK),\n ...(init?.body ? { 'content-type': 'application/json' } : {}),\n ...init?.headers,\n },\n });\n reportSdkAdvisory(response, ATLAS_ANGULAR_SDK);\n return response;\n }\n\n private applyToken(jwt: string, sessionId: string): void {\n // An in-flight refresh must not resurrect a session signed out meanwhile.\n if (this.guard.isSignedOut(sessionId)) return;\n const expiresAt = readExpiry(jwt);\n if (!expiresAt) return;\n\n this.cache.set({ jwt, expiresAt, sessionId });\n this._claims.next(decodeClaims(jwt));\n }\n\n private async refresh(): Promise<void> {\n const current = this.cache.peek();\n if (!current) return;\n\n try {\n const response = await this.call(`/v1/client/sessions/${current.sessionId}/tokens`, {\n method: 'POST',\n });\n if (!response.ok) throw new Error('refresh failed');\n\n const body = (await response.json()) as { jwt: string; session_id: string };\n this.applyToken(body.jwt, body.session_id);\n this.scheduleRefresh();\n } catch {\n // The session may genuinely be gone. Re-boot rather than guess.\n await this.reload();\n }\n }\n\n private clearLocalState(reason?: SignOutReason): void {\n // A signed-in → signed-out transition tells the sign-out listeners why.\n const ended =\n this._status.value === 'signed_in'\n ? (this._session.value?.id ?? this.cache.peek()?.sessionId ?? null)\n : undefined;\n this.clearRefreshTimer();\n this.cache.clear();\n this._status.next('signed_out');\n this._user.next(null);\n this._session.next(null);\n this._claims.next(null);\n this._memberships.next([]);\n if (ended !== undefined) this.notifier.signedOut(ended, reason);\n else this.notifier.clear();\n }\n\n /** §7.4: proactive, jittered refresh scheduled from the token's own expiry. */\n private scheduleRefresh(): void {\n this.clearRefreshTimer();\n if (this._status.value !== 'signed_in') return;\n\n const token = this.cache.peek();\n if (!token) return;\n\n const delay = msUntilRefresh({ token, now: Date.now() });\n this.refreshTimer = setTimeout(() => void this.refresh(), delay);\n }\n\n private clearRefreshTimer(): void {\n if (this.refreshTimer) {\n clearTimeout(this.refreshTimer);\n this.refreshTimer = null;\n }\n }\n}\n\n/** Decode a JWT payload without verifying it — a scheduling/UI hint only. */\nfunction decodeClaims(jwt: string): SessionClaims | null {\n const parts = jwt.split('.');\n if (parts.length !== 3) return null;\n try {\n return JSON.parse(\n atob(parts[1]!.replace(/-/g, '+').replace(/_/g, '/')),\n ) as SessionClaims;\n } catch {\n return null;\n }\n}\n","import {\n Directive,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewContainerRef,\n inject,\n} from '@angular/core';\nimport { Observable, Subscription } from 'rxjs';\nimport { distinctUntilChanged } from 'rxjs/operators';\nimport { AtlasService } from '../atlas.service';\n\n/**\n * Shared machinery for the boolean structural directives (`*atlasSignedIn`,\n * `*atlasSignedOut`, `*atlasLoading`, `*atlasLoaded`). A subclass names the\n * stream to gate on; this base mounts the embedded view exactly when that stream\n * is true and tears it down otherwise, mirroring how the React `<SignedIn>` /\n * `<SignedOut>` components render `children` or `null`.\n */\n@Directive()\nexport abstract class AtlasToggleDirective implements OnInit, OnDestroy {\n protected readonly atlas = inject(AtlasService);\n private readonly templateRef = inject<TemplateRef<unknown>>(TemplateRef);\n private readonly viewContainer = inject(ViewContainerRef);\n private sub?: Subscription;\n private shown = false;\n\n /** The stream whose truthiness controls whether the template renders. */\n protected abstract source(): Observable<boolean>;\n\n ngOnInit(): void {\n this.sub = this.source()\n .pipe(distinctUntilChanged())\n .subscribe((show) => this.render(show));\n }\n\n ngOnDestroy(): void {\n this.sub?.unsubscribe();\n }\n\n private render(show: boolean): void {\n if (show && !this.shown) {\n this.viewContainer.createEmbeddedView(this.templateRef);\n this.shown = true;\n } else if (!show && this.shown) {\n this.viewContainer.clear();\n this.shown = false;\n }\n }\n}\n","import { Directive } from '@angular/core';\nimport { Observable, combineLatest } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { AtlasToggleDirective } from './toggle.directive';\n\n/**\n * `*atlasSignedIn` — render the template only when the SDK has loaded AND the\n * user is signed in. The Angular peer of React's `<SignedIn>`. Renders nothing\n * while loading, so no signed-in UI flashes before boot completes.\n *\n * ```html\n * <div *atlasSignedIn>Welcome back</div>\n * ```\n */\n@Directive({\n selector: '[atlasSignedIn]',\n standalone: true,\n})\nexport class AtlasSignedInDirective extends AtlasToggleDirective {\n protected override source(): Observable<boolean> {\n return combineLatest([this.atlas.isLoaded$, this.atlas.isSignedIn$]).pipe(\n map(([loaded, signedIn]) => loaded && signedIn),\n );\n }\n}\n","import { Directive } from '@angular/core';\nimport { Observable, combineLatest } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { AtlasToggleDirective } from './toggle.directive';\n\n/**\n * `*atlasSignedOut` — render the template only when the SDK has loaded AND the\n * user is signed out. The Angular peer of React's `<SignedOut>`. Renders nothing\n * while loading, the symmetric partner of `*atlasSignedIn`.\n *\n * ```html\n * <atlas-sign-in *atlasSignedOut></atlas-sign-in>\n * ```\n */\n@Directive({\n selector: '[atlasSignedOut]',\n standalone: true,\n})\nexport class AtlasSignedOutDirective extends AtlasToggleDirective {\n protected override source(): Observable<boolean> {\n return combineLatest([this.atlas.isLoaded$, this.atlas.isSignedIn$]).pipe(\n map(([loaded, signedIn]) => loaded && !signedIn),\n );\n }\n}\n","import { Directive } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { AtlasToggleDirective } from './toggle.directive';\n\n/**\n * `*atlasLoading` — render the template only while the SDK is still booting. The\n * Angular peer of React's `<AtlasLoading>`; show a spinner here.\n */\n@Directive({\n selector: '[atlasLoading]',\n standalone: true,\n})\nexport class AtlasLoadingDirective extends AtlasToggleDirective {\n protected override source(): Observable<boolean> {\n return this.atlas.isLoaded$.pipe(map((loaded) => !loaded));\n }\n}\n","import { Directive } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { AtlasToggleDirective } from './toggle.directive';\n\n/**\n * `*atlasLoaded` — render the template only once the SDK has finished booting.\n * The Angular peer of React's `<AtlasLoaded>`, the symmetric partner of\n * `*atlasLoading`.\n */\n@Directive({\n selector: '[atlasLoaded]',\n standalone: true,\n})\nexport class AtlasLoadedDirective extends AtlasToggleDirective {\n protected override source(): Observable<boolean> {\n return this.atlas.isLoaded$;\n }\n}\n","import {\n Directive,\n Input,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewContainerRef,\n inject,\n} from '@angular/core';\nimport { BehaviorSubject, Subscription, combineLatest } from 'rxjs';\nimport { AtlasService } from '../atlas.service';\nimport { evaluate, type ProtectCondition } from '@atlasauth/authz';\n\n/**\n * `*atlasProtect` — render the template only when the active organization role\n * satisfies a {@link ProtectCondition}. The Angular peer of React's\n * `<Protect permission=\"…\">`.\n *\n * A RENDERING helper, never an authorization boundary: anyone can flip the\n * condition in devtools. The server checking the same permission is what\n * actually stops them — this directive's only job is to avoid showing a control\n * that would fail.\n *\n * ```html\n * <button *atlasProtect=\"{ permission: 'org:sys_memberships:manage' }\">Invite</button>\n *\n * <!-- with a fallback (identical microsyntax to *ngIf … else) -->\n * <div *atlasProtect=\"{ role: 'admin' }; else denied\">Admin tools</div>\n * <ng-template #denied>You lack access.</ng-template>\n * ```\n *\n * An empty condition (`*atlasProtect`) means simply \"signed in\".\n */\n@Directive({\n selector: '[atlasProtect]',\n standalone: true,\n})\nexport class AtlasProtectDirective implements OnInit, OnDestroy {\n private readonly atlas = inject(AtlasService);\n private readonly templateRef = inject<TemplateRef<unknown>>(TemplateRef);\n private readonly viewContainer = inject(ViewContainerRef);\n\n private readonly condition$ = new BehaviorSubject<ProtectCondition>({});\n private elseTemplate: TemplateRef<unknown> | null = null;\n private sub?: Subscription;\n private rendered: 'main' | 'else' | 'none' = 'none';\n\n /** The condition to evaluate. An empty/omitted value means \"signed in\". */\n @Input()\n set atlasProtect(condition: ProtectCondition | '' | null | undefined) {\n this.condition$.next(condition || {});\n }\n\n /** Template rendered when the condition is not met (the `else` branch). */\n @Input()\n set atlasProtectElse(template: TemplateRef<unknown> | null) {\n this.elseTemplate = template;\n // Re-render against the current state so a late-bound else takes effect.\n this.condition$.next(this.condition$.value);\n }\n\n ngOnInit(): void {\n this.sub = combineLatest([this.atlas.status$, this.atlas.claims$, this.condition$]).subscribe(\n ([status, claims, condition]) => {\n if (status === 'loading') {\n this.show('none');\n return;\n }\n this.show(evaluate(claims, condition).allowed ? 'main' : 'else');\n },\n );\n }\n\n ngOnDestroy(): void {\n this.sub?.unsubscribe();\n }\n\n private show(which: 'main' | 'else' | 'none'): void {\n if (which === this.rendered) return;\n this.viewContainer.clear();\n\n if (which === 'main') {\n this.viewContainer.createEmbeddedView(this.templateRef);\n } else if (which === 'else' && this.elseTemplate) {\n this.viewContainer.createEmbeddedView(this.elseTemplate);\n }\n this.rendered = which;\n }\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { Directive, ElementRef, OnInit, PLATFORM_ID, Renderer2, inject } from '@angular/core';\nimport { applyAppearanceToDom } from '@atlasauth/design/runtime';\nimport { AtlasService } from '../atlas.service';\n\n/**\n * `atlasRoot` — apply the resolved appearance design tokens as `--atlas-*` CSS\n * custom properties (and the `atlas-root` class) onto its host element, so the\n * Atlas components rendered inside inherit them.\n *\n * React does this with the wrapping `<div className=\"atlas-root\" style={…}>`\n * inside `<AtlasProvider>`. Angular has no single wrapping element, so a\n * consumer opts in by putting `atlasRoot` on whatever element encloses the\n * Atlas UI (commonly the app root):\n *\n * ```html\n * <div atlasRoot>\n * <router-outlet></router-outlet>\n * </div>\n * ```\n *\n * With a design (a code-level `appearance.preset` / `appearance.design`, or\n * the dashboard design, fetched in the browser) the host also gets the stable\n * `data-atlas-*` attributes and the design stylesheet is added to `<head>` once.\n */\n@Directive({\n selector: '[atlasRoot]',\n standalone: true,\n})\nexport class AtlasRootDirective implements OnInit {\n private readonly atlas = inject(AtlasService);\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly renderer = inject(Renderer2);\n private readonly document = inject(DOCUMENT);\n private readonly platformId = inject(PLATFORM_ID);\n\n ngOnInit(): void {\n const host = this.el.nativeElement;\n this.renderer.addClass(host, 'atlas-root');\n // Custom properties via `style.setProperty` (written verbatim, never camelCased).\n let applied = applyAppearanceToDom(this.document, host, this.atlas.appearanceRender());\n if (!isPlatformBrowser(this.platformId)) return;\n void this.atlas.loadInstanceDesign().then((design) => {\n if (!design) return;\n applied = applyAppearanceToDom(this.document, host, this.atlas.appearanceRender(design), applied);\n });\n }\n}\n","import { Directive, ElementRef, Input, OnDestroy, OnInit, inject } from '@angular/core';\nimport type { CaptchaController } from '@atlasauth/js';\n\n/**\n * `[atlasCaptchaSlot]=\"controller\"` — the element a flow's captcha widget draws\n * into (see `createCaptchaController` in `@atlasauth/js`). Attaches the\n * controller to the host element while it is rendered and detaches it (removing\n * the widget) when it goes away.\n */\n@Directive({\n selector: '[atlasCaptchaSlot]',\n standalone: true,\n})\nexport class AtlasCaptchaSlotDirective implements OnInit, OnDestroy {\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private current: CaptchaController | null = null;\n private initialized = false;\n\n @Input('atlasCaptchaSlot') set controller(next: CaptchaController | null) {\n if (next === this.current) return;\n if (this.initialized) this.current?.attach(null);\n this.current = next;\n if (this.initialized) this.current?.attach(this.host.nativeElement);\n }\n\n ngOnInit(): void {\n this.initialized = true;\n this.current?.attach(this.host.nativeElement);\n }\n\n ngOnDestroy(): void {\n this.current?.attach(null);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n Directive,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n inject,\n signal,\n type SimpleChanges,\n} from '@angular/core';\nimport {\n PolicyGateController,\n controllerForPending,\n formatPolicyDate,\n injectPolicyStyles,\n joinTitles,\n mountPolicyAcceptStep,\n mountPolicyClickwrap,\n mountPolicyConsent,\n policyTranslator,\n type MountedPolicyStep,\n type MountedPolicyUi,\n type Policy,\n type PolicyAcceptanceController,\n type PolicyClasses,\n type PolicyT,\n} from '@atlasauth/js';\nimport { AtlasService } from '../atlas.service';\nimport { classFor } from '../appearance';\nimport { translate } from '../i18n';\n\n/** The policy UI's translator (the localization bundle, else the English policy strings) for the current Atlas service. */\nexport function policyUi(atlas: AtlasService): { t: PolicyT; classes: PolicyClasses } {\n return {\n t: policyTranslator((key, vars) => translate(atlas.localization, key, vars)),\n classes: {\n link: 'atlas-link',\n text: 'atlas-text',\n primaryButton: classFor('formButtonPrimary', atlas.appearance, 'atlas-button'),\n error: classFor('formFieldError', atlas.appearance, 'atlas-error'),\n },\n };\n}\n\n/**\n * `[atlasPolicies]=\"controller\"` — draws the instance's policies (terms, privacy,\n * …) into the host element: `kind=\"consent\"` (default) is the checkbox block with\n * its in-page viewer, `kind=\"clickwrap\"` the \"By continuing you agree to …\" line.\n * The state is the controller's (`AtlasFlowController.policies`); the DOM comes\n * from `@atlasauth/js`, shared with every SDK.\n */\n@Directive({ selector: '[atlasPolicies]', standalone: true })\nexport class AtlasPoliciesDirective implements OnInit, OnChanges, OnDestroy {\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly atlas = inject(AtlasService);\n private mounted: MountedPolicyUi | null = null;\n private ready = false;\n\n @Input('atlasPolicies') controller: PolicyAcceptanceController | null = null;\n @Input() atlasPolicyKind: 'consent' | 'clickwrap' = 'consent';\n\n ngOnInit(): void {\n this.ready = true;\n this.draw();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (this.ready && (changes['controller'] || changes['atlasPolicyKind'])) this.draw();\n }\n\n ngOnDestroy(): void {\n this.mounted?.destroy();\n }\n\n private draw(): void {\n this.mounted?.destroy();\n this.mounted = null;\n if (!this.controller) return;\n const el = this.host.nativeElement;\n injectPolicyStyles(el.ownerDocument);\n const ui = policyUi(this.atlas);\n this.mounted =\n this.atlasPolicyKind === 'clickwrap'\n ? mountPolicyClickwrap(el, this.controller, ui)\n : mountPolicyConsent(el, this.controller, ui);\n }\n}\n\n/**\n * `<atlas-policy-accept-step>` — the sign-in step for a `needs_policy_acceptance`\n * attempt: scroll-mode policies in their unskippable dialog, the rest as\n * checkboxes, then \"Accept and continue\". Emits `submitFlow` with the\n * `policy_acceptances` JSON for the flow, and `declined` with the policy title\n * when the user declines (cancel the attempt).\n */\n@Component({\n selector: 'atlas-policy-accept-step',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `@if (loading()) {<p class=\"atlas-text\">{{ loadingText }}</p>}<div class=\"atlas-policy-step-host\"></div>`,\n})\nexport class PolicyAcceptStepComponent implements OnInit, OnChanges, OnDestroy {\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly atlas = inject(AtlasService);\n private step: MountedPolicyStep | null = null;\n private alive = true;\n\n @Input() attempt: { id: string | null; pending_policies?: unknown } | null = null;\n @Input() busy = false;\n @Output() submitFlow = new EventEmitter<Record<string, string>>();\n @Output() declined = new EventEmitter<string>();\n\n protected readonly loading = signal(true);\n protected loadingText = policyUi(this.atlas).t('policy.loading');\n\n ngOnInit(): void {\n const client = this.atlas.createFapiClient();\n void controllerForPending(client, this.attempt, { locale: this.atlas.locale ?? undefined }).then((controller) => {\n if (!this.alive) return;\n this.loading.set(false);\n const el = this.host.nativeElement.querySelector('.atlas-policy-step-host') as HTMLElement | null;\n if (!el) return;\n injectPolicyStyles(el.ownerDocument);\n this.step = mountPolicyAcceptStep(el, controller, {\n ...policyUi(this.atlas),\n onSubmit: (acceptances) => this.submitFlow.emit({ policy_acceptances: JSON.stringify(acceptances) }),\n onDecline: (policy: Policy) => this.declined.emit(policy.title),\n });\n this.step.setBusy(this.busy);\n });\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['busy']) this.step?.setBusy(this.busy);\n }\n\n ngOnDestroy(): void {\n this.alive = false;\n this.step?.destroy();\n }\n}\n\n/**\n * `<atlas-policy-gate>` — in-app re-acceptance. For a signed-in user, a banner\n * when a policy needs re-acceptance; \"Review and accept\" opens the unskippable\n * dialog / checkboxes and posts `/v1/client/me/policies/accept`. Projects its\n * content always.\n */\n@Component({\n selector: 'atlas-policy-gate',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (bannerText(); as text) {\n <div [class]=\"bannerClass\" role=\"status\" data-atlas-policy-banner=\"\">\n <span\n ><strong>{{ title }}. </strong>{{ text }}</span\n >\n <button type=\"button\" [class]=\"linkClass\" (click)=\"begin()\">{{ reviewText }}</button>\n </div>\n }\n @if (reviewing()) {\n <div [class]=\"cardClass\" data-atlas-policy-gate=\"\">\n <div class=\"atlas-policy-gate-host\"></div>\n @if (error()) {\n <p [class]=\"errorClass\" role=\"alert\">{{ error() }}</p>\n }\n </div>\n }\n <ng-content></ng-content>\n `,\n})\nexport class PolicyGateComponent implements OnInit, OnDestroy {\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly atlas = inject(AtlasService);\n private readonly ui = policyUi(this.atlas);\n private gate!: PolicyGateController;\n private off: (() => void) | null = null;\n private step: MountedPolicyStep | null = null;\n private readonly version = signal(0);\n\n @Output() accepted = new EventEmitter<void>();\n\n protected readonly reviewing = signal(false);\n protected readonly error = signal('');\n protected title = this.ui.t('policy.bannerTitle');\n protected reviewText = this.ui.t('policy.bannerReview');\n protected linkClass = this.ui.classes.link ?? '';\n protected errorClass = this.ui.classes.error ?? '';\n protected bannerClass = 'atlas-policy-banner';\n protected cardClass = classFor('card', this.atlas.appearance, 'atlas-card');\n\n protected bannerText(): string | null {\n this.version();\n if (!this.gate || this.gate.pending.length === 0 || this.reviewing()) return null;\n const t = this.ui.t;\n const grace = this.gate.graceEndsAt;\n return (\n t('policy.bannerBody', { policies: joinTitles(this.gate.pending.map((p) => p.title), t('policy.and')) }) +\n (grace ? ` ${t('policy.bannerGrace', { date: formatPolicyDate(grace) })}` : '')\n );\n }\n\n ngOnInit(): void {\n this.gate = new PolicyGateController(this.atlas.createFapiClient(), this.atlas.locale ?? undefined);\n this.off = this.gate.subscribe(() => this.version.update((n) => n + 1));\n if (this.atlas.status() === 'signed_in') void this.gate.load();\n }\n\n async begin(): Promise<void> {\n const controller = await this.gate.begin();\n this.reviewing.set(true);\n await Promise.resolve();\n const el = this.host.nativeElement.querySelector('.atlas-policy-gate-host') as HTMLElement | null;\n if (!el) return;\n injectPolicyStyles(el.ownerDocument);\n this.step = mountPolicyAcceptStep(el, controller, {\n ...this.ui,\n onSubmit: async () => {\n this.step?.setBusy(true);\n const res = await this.gate.accept(controller);\n this.step?.setBusy(false);\n if (!res.ok) {\n this.error.set(res.errors[0]?.message ?? this.ui.t('policy.requiredGeneric'));\n return;\n }\n this.close();\n this.accepted.emit();\n },\n onDecline: () => this.close(),\n });\n }\n\n private close(): void {\n this.step?.destroy();\n this.step = null;\n this.reviewing.set(false);\n }\n\n ngOnDestroy(): void {\n this.off?.();\n this.step?.destroy();\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n inject,\n} from '@angular/core';\nimport {\n awaitingSignUpLink,\n enrollmentSubmitKey,\n groupSetupKey,\n localizedErrorMessage,\n nextStep,\n type AttemptView,\n type CaptchaController,\n type FieldError,\n type MfaEnrollmentController,\n type MfaEnrollmentState,\n type MfaEnrollmentStrategy,\n} from '@atlasauth/js';\nimport { AtlasService } from '../atlas.service';\nimport { AtlasCaptchaSlotDirective } from '../directives/captcha-slot.directive';\nimport { PolicyAcceptStepComponent } from './policy-host';\nimport { classFor, type ElementKey } from '../appearance';\nimport { translate } from '../i18n';\n\n/**\n * One rendered row of the flow. A uniform shape (rather than a discriminated\n * union) so the template accesses only fields that always exist — no reliance on\n * template control-flow narrowing of a loop variable, which varies by Angular\n * minor. For a `message` row, `labelKey` carries the message's i18n key.\n */\ninterface StepField {\n kind: 'input' | 'message' | 'alert';\n name: string;\n labelKey: string;\n type: string;\n autocomplete?: string;\n}\n\n/**\n * The server-driven flow shell, shared by `<atlas-sign-in>` and\n * `<atlas-sign-up>`. The Angular peer of React's internal `AttemptFlow`.\n *\n * It contains NO decision about what comes next: it renders whatever `status`\n * the server returned, mapped through `nextStep` from `@atlasauth/js` (the same\n * exhaustive mapping the React SDK uses), so adding a step is a server change\n * and an out-of-date client degrades to a visible \"please update\" message rather\n * than a blank screen.\n */\n@Component({\n selector: 'atlas-attempt-flow',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AtlasCaptchaSlotDirective, PolicyAcceptStepComponent],\n template: `\n <div [class]=\"cls('card', 'atlas-card')\">\n <h1 [class]=\"cls('headerTitle', 'atlas-title')\">{{ t(titleKey) }}</h1>\n\n @for (error of formErrors(); track error.code) {\n <p [class]=\"cls('formFieldError', 'atlas-error')\" role=\"alert\">{{ errorText(error) }}</p>\n }\n\n <form (submit)=\"onSubmit($event)\">\n @if (codeSentText(); as sentText) {\n <p class=\"atlas-text\" data-atlas-code-sent=\"\">{{ sentText }}</p>\n }\n @if (linkOnly()) {\n <!-- Nothing to type: the flow polls until the emailed link is opened (anywhere). -->\n <p class=\"atlas-text\" data-atlas-link-sent=\"\" aria-live=\"polite\">\n {{ t('signUp.linkSentTo', { email: attempt?.identifier ?? '' }) }}\n </p>\n <button\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n type=\"button\"\n data-atlas-resend=\"\"\n [disabled]=\"busy\"\n (click)=\"resend.emit()\"\n >\n {{ t('signIn.resendLink') }}\n </button>\n }\n @if (enrolling() && enrollmentState; as enrol) {\n @if (enrol.method === null) {\n <p class=\"atlas-text\">{{ t('mfa.enrollChoose') }}</p>\n @for (m of enrol.options; track m) {\n <button\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n type=\"button\"\n [attr.data-atlas-mfa-method]=\"m\"\n [disabled]=\"busy || enrol.busy\"\n (click)=\"chooseMethod(m)\"\n >\n {{ t(m === 'totp' ? 'mfa.enrollTotpOption' : 'mfa.enrollSmsOption') }}\n </button>\n }\n } @else if (enrol.method === 'totp') {\n @if (enrol.enrollment; as setup) {\n <p class=\"atlas-text\">{{ t('mfa.enrollScan') }}</p>\n @if (setup.qrCode) {\n <img class=\"atlas-mfa-qr\" data-atlas=\"mfa-qr\" [src]=\"setup.qrCode\" [alt]=\"t('mfa.enrollQrAlt')\" width=\"180\" height=\"180\" />\n }\n @if (setup.secret) {\n <p class=\"atlas-text\" data-atlas=\"mfa-setup-key\">{{ t('mfa.enrollSetupKey') }}: <code>{{ setupKey(setup.secret) }}</code></p>\n }\n <label class=\"atlas-field\">\n <span>{{ t('mfa.enrollFirstCodeLabel') }}</span>\n <input [class]=\"cls('formFieldInput', 'atlas-input')\" type=\"text\" name=\"code\" autocomplete=\"one-time-code\" inputmode=\"numeric\" [value]=\"values['code'] ?? ''\" (input)=\"setValue('code', $any($event.target).value)\" />\n </label>\n @if (enrol.totpCodes >= 2) {\n <label class=\"atlas-field\">\n <span>{{ t('mfa.enrollSecondCodeLabel') }}</span>\n <input [class]=\"cls('formFieldInput', 'atlas-input')\" type=\"text\" name=\"secondCode\" autocomplete=\"one-time-code\" inputmode=\"numeric\" [value]=\"values['secondCode'] ?? ''\" (input)=\"setValue('secondCode', $any($event.target).value)\" />\n </label>\n }\n } @else {\n <p class=\"atlas-text\" aria-live=\"polite\">{{ enrol.busy ? t('mfa.enrollPreparing') : '' }}</p>\n }\n } @else {\n @if (enrol.enrollment; as texted) {\n <p class=\"atlas-text\" data-atlas=\"mfa-code-texted\" aria-live=\"polite\">{{ t('mfa.codeTextedTo', { phone: texted.phone ?? '' }) }}</p>\n <label class=\"atlas-field\">\n <span>{{ t('mfa.codeLabel') }}</span>\n <input [class]=\"cls('formFieldInput', 'atlas-input')\" type=\"text\" name=\"code\" autocomplete=\"one-time-code\" inputmode=\"numeric\" [value]=\"values['code'] ?? ''\" (input)=\"setValue('code', $any($event.target).value)\" />\n </label>\n <button\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n type=\"button\"\n data-atlas-resend=\"\"\n [disabled]=\"busy || enrol.busy\"\n (click)=\"resendEnrollment()\"\n >\n {{ t('signIn.resendCode') }}\n </button>\n } @else {\n <label class=\"atlas-field\">\n <span>{{ t('mfa.phoneLabel') }}</span>\n <input [class]=\"cls('formFieldInput', 'atlas-input')\" type=\"tel\" name=\"phone\" autocomplete=\"tel\" [value]=\"values['phone'] ?? ''\" (input)=\"setValue('phone', $any($event.target).value)\" />\n </label>\n <p class=\"atlas-text\">{{ t('mfa.phoneHint') }}</p>\n }\n }\n @for (error of enrol.errors; track $index) {\n <p [class]=\"cls('formFieldError', 'atlas-error')\" role=\"alert\">{{ error.message }}</p>\n }\n @if (enrol.method !== null && enrol.options.length > 1) {\n @for (other of otherMethods(enrol); track other) {\n <button\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n type=\"button\"\n [attr.data-atlas-mfa-method]=\"other\"\n [disabled]=\"busy || enrol.busy\"\n (click)=\"chooseMethod(other)\"\n >\n {{ t(other === 'totp' ? 'mfa.enrollTotpOption' : 'mfa.enrollSmsOption') }}\n </button>\n }\n }\n }\n @for (f of fields(); track $index) {\n @if (f.kind === 'input') {\n <label class=\"atlas-field\">\n <span>{{ t(f.labelKey) }}</span>\n <input\n [class]=\"cls('formFieldInput', 'atlas-input')\"\n [type]=\"f.type\"\n [attr.name]=\"f.name\"\n [attr.autocomplete]=\"f.autocomplete ?? null\"\n [value]=\"values[f.name] ?? ''\"\n (input)=\"setValue(f.name, $any($event.target).value)\"\n />\n @for (error of fieldErrorsFor(f.name); track error.code) {\n <span [class]=\"cls('formFieldError', 'atlas-error')\">{{ errorText(error) }}</span>\n }\n </label>\n } @else if (f.kind === 'alert') {\n <p [class]=\"cls('formFieldError', 'atlas-error')\" role=\"alert\">{{ t(f.labelKey) }}</p>\n } @else {\n <p>{{ t(f.labelKey) }}</p>\n }\n }\n\n @if (awaitingPolicies()) {\n <!-- A required policy changed: scroll-mode ones in their dialog, the rest as checkboxes. -->\n <atlas-policy-accept-step\n [attempt]=\"attempt\"\n [busy]=\"busy\"\n (submitFlow)=\"submitFlow.emit($event)\"\n (declined)=\"policyDeclined.emit($event)\"\n ></atlas-policy-accept-step>\n }\n\n @if (showCaptcha()) {\n <div class=\"atlas-captcha\" data-atlas-captcha=\"\" [atlasCaptchaSlot]=\"captcha\"></div>\n }\n\n @if (showSubmit()) {\n <button [class]=\"cls('formButtonPrimary', 'atlas-button')\" [disabled]=\"busy || (enrolling() && !!enrollmentState?.busy)\" type=\"submit\">\n {{ t(submitKey()) }}\n </button>\n }\n\n @if (showSmsSecondFactor()) {\n @if (smsSecondFactorSentTo(); as sentTo) {\n <p class=\"atlas-text\" data-atlas=\"sms-second-factor-sent\" aria-live=\"polite\">\n {{ t('mfa.codeTextedTo', { phone: sentTo }) }}\n </p>\n } @else {\n <button\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n type=\"button\"\n data-atlas=\"sms-second-factor\"\n [disabled]=\"busy || !!textedSecondFactor?.busy\"\n (click)=\"smsSecondFactor.emit()\"\n >\n {{ textedSecondFactor?.busy ? t('signIn.sending') : t('mfa.smsCodeOption') }}\n </button>\n @if (textedSecondFactor?.error; as message) {\n <p [class]=\"cls('formFieldError', 'atlas-error')\" role=\"alert\">{{ message }}</p>\n }\n }\n }\n\n @if (showEmailSecondFactor()) {\n @if (emailSecondFactorSentTo(); as sentTo) {\n <p class=\"atlas-text\" data-atlas=\"email-second-factor-sent\" aria-live=\"polite\">\n {{ t('signIn.codeSentTo', { email: sentTo }) }}\n </p>\n } @else {\n <button\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n type=\"button\"\n data-atlas=\"email-second-factor\"\n [disabled]=\"busy || !!emailedSecondFactor?.busy\"\n (click)=\"emailSecondFactor.emit()\"\n >\n {{ emailedSecondFactor?.busy ? t('signIn.sending') : t('signIn.emailCodeOption') }}\n </button>\n @if (emailedSecondFactor?.error; as message) {\n <p [class]=\"cls('formFieldError', 'atlas-error')\" role=\"alert\">{{ message }}</p>\n }\n }\n }\n\n @if (showEmailCodeOption()) {\n <button\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n [disabled]=\"busy\"\n type=\"button\"\n [attr.data-strategy]=\"preparedFactor === 'email_code' ? null : 'email_code'\"\n [attr.data-atlas-resend]=\"preparedFactor === 'email_code' ? '' : null\"\n (click)=\"chooseFactor.emit('email_code')\"\n >\n {{ t(preparedFactor === 'email_code' ? 'signIn.resendCode' : 'signIn.useEmailCode') }}\n </button>\n }\n </form>\n </div>\n `,\n})\nexport class AttemptFlowComponent {\n private readonly atlas = inject(AtlasService);\n\n @Input() attempt: AttemptView | null = null;\n @Input() busy = false;\n @Input() errors: FieldError[] = [];\n /** `FlowState.sessionKept`: whether this browser kept the session the sign-in created. */\n @Input() sessionKept: boolean | undefined = undefined;\n @Input() titleKey = 'signIn.title';\n /**\n * The sign-in captcha, drawn above the submit button on the identifier step\n * (an always-on sign-in captcha) and on the challenge step the server demands\n * with `needs_captcha`. Null when the flow draws none.\n */\n @Input() captcha: CaptchaController | null = null;\n /**\n * The first factors to offer on the `needs_first_factor` step — pass\n * `AtlasFlowController.firstFactors()`, which drops email code / link while the\n * app cannot deliver email. Null uses the server's list as-is.\n */\n @Input() firstFactors: string[] | null = null;\n /** The first factor already sent (`AtlasFlowController.preparedFactor()`): its code is collected. */\n @Input() preparedFactor: string | null = null;\n\n /** Emits the collected field values when the form is submitted. */\n @Output() submitFlow = new EventEmitter<Record<string, string>>();\n /** Emits when the user picks a first factor the server must send first (an emailed code). */\n @Output() chooseFactor = new EventEmitter<'email_code'>();\n /**\n * Offer \"Email me a code instead\" at the second factor (the instance's\n * `account.emailSecondFactor`); `emailSecondFactor` asks for it and\n * `emailedSecondFactor` reports how it went.\n */\n @Input() offerEmailSecondFactor = false;\n /** `AtlasFlowController.emailSecondFactor()`: in flight, where it went, or why not. */\n @Input() emailedSecondFactor: { busy?: boolean; sentTo?: string; error?: string } | null = null;\n @Output() emailSecondFactor = new EventEmitter<void>();\n /**\n * Offer \"Text me a code instead\" at the second factor (where the app offers\n * texted codes, `AtlasFlowController.mfaChoices().sms`); `smsSecondFactor`\n * asks for it and `textedSecondFactor` reports how it went.\n */\n @Input() offerSmsSecondFactor = false;\n /** `AtlasFlowController.smsSecondFactor()`: in flight, where it went, or why not. */\n @Input() textedSecondFactor: { busy?: boolean; sentTo?: string; error?: string } | null = null;\n @Output() smsSecondFactor = new EventEmitter<void>();\n /**\n * The MFA enrolment step (`AtlasFlowController.enrollment` and\n * `enrollmentState()`): the authenticator app's QR code and setup key, or a\n * texted code. Null: the step asks for two authenticator codes only.\n */\n @Input() enrollment: MfaEnrollmentController | null = null;\n @Input() enrollmentState: MfaEnrollmentState | null = null;\n /**\n * The instance's `account.emailVerification`. On `link` a sign-up's\n * verification step has nothing to type: it says to open the emailed link\n * while the flow polls, and offers a resend (`resend`).\n */\n @Input() emailVerification: string = 'code';\n @Output() resend = new EventEmitter<void>();\n /** The user declined a policy the sign-in was waiting on (`needs_policy_acceptance`): cancel the attempt. */\n @Output() policyDeclined = new EventEmitter<string>();\n\n protected values: Record<string, string> = {};\n\n protected t(key: string, vars?: Record<string, string>): string {\n return translate(this.atlas.localization, key, vars);\n }\n\n /** A server error in the app's language (`error.<reason>`, else the server's message). */\n protected errorText(error: FieldError): string {\n // `errorLocalization` is read defensively: a stand-in service may lack it.\n const layer = (this.atlas as { errorLocalization?: Record<string, string> }).errorLocalization;\n return localizedErrorMessage(error, layer ?? this.atlas.localization, this.atlas.localization);\n }\n\n protected cls(key: ElementKey, base: string): string {\n return classFor(key, this.atlas.appearance, base);\n }\n\n protected setValue(name: string, value: string): void {\n this.values = { ...this.values, [name]: value };\n }\n\n protected onSubmit(event: Event): void {\n event.preventDefault();\n // Enrolment: text the code to the typed number, or confirm the factor.\n if (this.enrolling() && this.enrollment) {\n void this.enrollment.submit(this.values).then((next) => {\n if (next) this.submitFlow.emit(next);\n });\n return;\n }\n this.submitFlow.emit(this.values);\n }\n\n /** The shared enrolment step is drawn (a controller was passed and the flow is enrolling). */\n protected enrolling(): boolean {\n return this.step().kind === 'enroll_second_factor' && !!this.enrollment && !!this.enrollmentState;\n }\n\n protected chooseMethod(method: MfaEnrollmentStrategy): void {\n this.values = {};\n void this.enrollment?.choose(method);\n }\n\n protected resendEnrollment(): void {\n void this.enrollment?.resend();\n }\n\n protected otherMethods(state: MfaEnrollmentState): MfaEnrollmentStrategy[] {\n return state.options.filter((m) => m !== state.method);\n }\n\n protected setupKey(secret: string): string {\n return groupSetupKey(secret);\n }\n\n /** The submit button's label key (enrolment: \"Text me a code\" before the number is sent). */\n protected submitKey(): string {\n return (this.enrolling() && this.enrollmentState && enrollmentSubmitKey(this.enrollmentState)) || 'signIn.submit';\n }\n\n protected showSmsSecondFactor(): boolean {\n return this.offerSmsSecondFactor && this.step().kind === 'collect_second_factor';\n }\n\n /** Where the texted second-factor code went (masked), once it was sent. */\n protected smsSecondFactorSentTo(): string | null {\n const sent = this.textedSecondFactor?.sentTo;\n return typeof sent === 'string' ? sent || ' ' : null;\n }\n\n protected formErrors(): FieldError[] {\n return this.errors.filter((error) => !error.param);\n }\n\n protected fieldErrorsFor(name: string): FieldError[] {\n return this.errors.filter((error) => error.param === name);\n }\n\n private step() {\n return this.attempt ? nextStep(this.attempt) : ({ kind: 'collect_identifier' } as const);\n }\n\n protected showCaptcha(): boolean {\n const kind = this.step().kind;\n return !!this.captcha && (kind === 'collect_identifier' || kind === 'collect_captcha');\n }\n\n /** The first factors on offer at a `needs_first_factor` step (empty on any other). */\n private offered(): string[] {\n const step = this.step();\n if (step.kind !== 'collect_first_factor') return [];\n return this.firstFactors ?? step.strategies;\n }\n\n protected linkOnly(): boolean {\n return awaitingSignUpLink(this.attempt, this.emailVerification);\n }\n\n protected showEmailSecondFactor(): boolean {\n return this.offerEmailSecondFactor && this.step().kind === 'collect_second_factor';\n }\n\n /** Where the emailed second-factor code went (masked), once it was sent. */\n protected emailSecondFactorSentTo(): string | null {\n const sent = this.emailedSecondFactor?.sentTo;\n return typeof sent === 'string' ? sent || ' ' : null;\n }\n\n protected showEmailCodeOption(): boolean {\n // Before the code is sent: the choice (or the retry of a failed automatic\n // send). After: \"Resend code\".\n return this.offered().includes('email_code');\n }\n\n /** The \"we sent a code to …\" line on the code step. */\n protected codeSentText(): string | null {\n if (this.step().kind !== 'collect_first_factor' || this.preparedFactor !== 'email_code') return null;\n return this.t('signIn.codeSentTo', { email: this.attempt?.identifier ?? '' });\n }\n\n /** The attempt is `needs_policy_acceptance`. */\n protected awaitingPolicies(): boolean {\n return this.step().kind === 'accept_policies';\n }\n\n protected showSubmit(): boolean {\n const kind = this.step().kind;\n // Nothing to submit on a first-factor step that only offers an emailed code\n // until that code is sent.\n if (kind === 'collect_first_factor') return this.fields().length > 0;\n if (this.linkOnly()) return false;\n // Enrolment: nothing to submit while choosing a method or fetching the setup.\n if (this.enrolling() && this.enrollmentState && !enrollmentSubmitKey(this.enrollmentState)) return false;\n return kind !== 'done' && kind !== 'await_oauth' && kind !== 'accept_policies';\n }\n\n protected fields(): StepField[] {\n const step = this.step();\n switch (step.kind) {\n case 'collect_identifier':\n // `webauthn`: saved passkeys appear in this field's autofill while <atlas-sign-in> holds a conditional request.\n return [{ kind: 'input', name: 'identifier', labelKey: 'signIn.identifierLabel', type: 'email', autocomplete: 'username webauthn' }];\n case 'collect_first_factor': {\n if (this.preparedFactor === 'email_code') {\n return [{ kind: 'input', name: 'code', labelKey: 'signIn.emailCodeLabel', type: 'text' }];\n }\n // The password field unless the only offer is an emailed code (chosen\n // with the button below the form).\n const offered = this.offered();\n return offered.includes('email_code') && !offered.includes('password')\n ? []\n : [{ kind: 'input', name: 'password', labelKey: 'signIn.passwordLabel', type: 'password' }];\n }\n case 'collect_second_factor':\n return [{ kind: 'input', name: 'code', labelKey: 'mfa.codeLabel', type: 'text' }];\n case 'enroll_second_factor':\n // The shared enrolment step draws its own fields (above).\n if (this.enrolling()) return [];\n // Two consecutive codes (§5.6): a phone with a fast clock fails here\n // rather than on every sign-in afterwards.\n return [\n { kind: 'input', name: 'code', labelKey: 'mfa.enrollFirstCodeLabel', type: 'text' },\n { kind: 'input', name: 'secondCode', labelKey: 'mfa.enrollSecondCodeLabel', type: 'text' },\n ];\n case 'collect_email_code':\n return this.linkOnly() ? [] : [{ kind: 'input', name: 'code', labelKey: 'signIn.emailCodeLabel', type: 'text' }];\n case 'collect_new_password':\n return [{ kind: 'input', name: 'password', labelKey: 'reset.newPasswordLabel', type: 'password' }];\n case 'accept_policies':\n // Drawn by <atlas-policy-accept-step> above.\n return [];\n case 'collect_captcha':\n // §5 the server withheld the attempt until a captcha clears. Solving the\n // widget resubmits the identifier on its own; the button retries.\n return [msg('captcha.prompt')];\n case 'await_oauth':\n return [msg('signIn.magicLinkSent')];\n case 'done':\n // Signed in only when this browser holds the session; a blocked cookie is said\n // plainly. \"Check the other tab\" is for a sign-in completed on another device.\n if (this.sessionKept === true) return [msg('signIn.signedIn')];\n if (this.sessionKept === false) return [{ kind: 'alert', name: '', labelKey: 'signIn.sessionNotKept', type: 'text' }];\n return [msg('signIn.checkOtherTab')];\n case 'restart':\n return [msg('error.generic')];\n default:\n // A status this SDK version does not know. An honest message beats a\n // blank login box the user cannot act on.\n return [msg('error.generic')];\n }\n }\n}\n\n/** A read-only message row: `labelKey` holds the i18n key of the text to show. */\nfunction msg(labelKey: string): StepField {\n return { kind: 'message', name: '', labelKey, type: 'text' };\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n inject,\n} from '@angular/core';\nimport { canDownloadRecoveryCodes, copyRecoveryCodes, downloadRecoveryCodes } from '@atlasauth/js';\nimport { AtlasService } from '../atlas.service';\nimport { classFor, type ElementKey } from '../appearance';\nimport { translate } from '../i18n';\n\n/**\n * The recovery codes a mid-sign-in MFA enrolment came with, shown once before\n * the sign-in finishes: copy them, download them as a .txt file, then\n * \"I've saved my codes\" (`saved`) exchanges the ticket. The codes live only in\n * the flow controller's memory and are forgotten once saved.\n */\n@Component({\n selector: 'atlas-recovery-codes',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div [class]=\"cls('card', 'atlas-card')\" data-atlas=\"recovery-codes\">\n <h1 [class]=\"cls('headerTitle', 'atlas-title')\">{{ t('mfa.recoveryCodesTitle') }}</h1>\n <p class=\"atlas-text\">{{ t('mfa.recoveryCodesHelp') }}</p>\n <ul\n class=\"atlas-recovery-codes\"\n data-atlas=\"recovery-codes-list\"\n style=\"list-style:none;padding:0;margin:8px 0 12px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;text-align:center\"\n >\n @for (code of codes; track code) {\n <li><code>{{ code }}</code></li>\n }\n </ul>\n <div class=\"atlas-alternatives\">\n @if (canCopy) {\n <button [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" type=\"button\" data-atlas=\"recovery-codes-copy\" (click)=\"copy()\">\n {{ t('mfa.recoveryCodesCopy') }}\n </button>\n }\n @if (canDownload) {\n <button [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" type=\"button\" data-atlas=\"recovery-codes-download\" (click)=\"download()\">\n {{ t('mfa.recoveryCodesDownload') }}\n </button>\n }\n </div>\n @if (copied) {\n <p class=\"atlas-text\" aria-live=\"polite\" data-atlas=\"recovery-codes-copied\">{{ t('mfa.recoveryCodesCopied') }}</p>\n }\n <button [class]=\"cls('formButtonPrimary', 'atlas-button')\" type=\"button\" data-atlas=\"recovery-codes-saved\" [disabled]=\"busy\" (click)=\"saved.emit()\">\n {{ t('mfa.recoveryCodesSaved') }}\n </button>\n </div>\n `,\n})\nexport class RecoveryCodesComponent implements OnChanges {\n private readonly atlas = inject(AtlasService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @Input() codes: string[] = [];\n @Input() busy = false;\n @Output() saved = new EventEmitter<void>();\n\n protected readonly canCopy = typeof navigator !== 'undefined' && !!navigator.clipboard?.writeText;\n protected readonly canDownload = canDownloadRecoveryCodes();\n protected copied = false;\n\n ngOnChanges(): void {\n this.copied = false;\n }\n\n protected t(key: string): string {\n return translate(this.atlas.localization, key);\n }\n\n protected cls(key: ElementKey, base: string): string {\n return classFor(key, this.atlas.appearance, base);\n }\n\n protected copy(): void {\n void copyRecoveryCodes(this.codes).then((ok) => {\n this.copied = ok;\n this.cdr.markForCheck();\n });\n }\n\n protected download(): void {\n downloadRecoveryCodes(this.codes);\n }\n}\n","import { WritableSignal, signal } from '@angular/core';\nimport {\n FapiClient,\n advanceWithCaptcha,\n atlasCaptchaLabels,\n createCaptchaController,\n createPasskeySignInController,\n createPasskeySignUp,\n createSignUp,\n finishPasskeySignUp,\n fetchInstanceSettings,\n fetchLastSignInMethod,\n startSignInWithAtlas,\n createMfaEnrollment,\n acknowledgeRecoveryCodes,\n pendingRecoveryCodes,\n mfaChoicesFrom,\n prepareSecondFactorCode,\n resendSignUpVerification,\n flowNeedsCaptcha,\n signInCaptchaOptions,\n flowFromPending,\n initialFlow,\n nextStep,\n offeredFirstFactors,\n pollAttempt,\n prepareFactor,\n planFirstFactor,\n shouldKeepPolling,\n PolicyAcceptanceController,\n loadPolicies,\n type CaptchaController,\n type FlowState,\n type InstanceSettings,\n type MfaChoices,\n type MfaEnrollmentController,\n type MfaEnrollmentState,\n type PasskeySignInController,\n} from '@atlasauth/js';\nimport { EN_US, translate } from '../i18n';\n\n/**\n * The server-driven sign-in / sign-up engine, shared by `<atlas-sign-in>` and\n * `<atlas-sign-up>` — the Angular counterpart of React's `useFlow` hook.\n *\n * It owns no decision about what comes next: every status comes back from the\n * server via `advance`, and this controller only posts whatever the current step\n * needs and re-renders the returned status. State lives in a signal so templates\n * update whether the app runs zoned or zoneless.\n *\n * `<atlas-sign-up>` starts the attempt with {@link create}\n * (`POST /v1/client/sign_ups`); the emailed-code step then runs through the same\n * {@link submit}. Both flows draw the instance's captcha (from\n * {@link loadSettings}) when it is required.\n */\nexport class AtlasFlowController {\n readonly state: WritableSignal<FlowState>;\n /**\n * The instance's public sign-in / sign-up settings (captcha, sign-up fields,\n * legal consent) from `GET /v1/appearance`; null until {@link loadSettings}\n * resolves, or when the server could not be reached.\n */\n readonly settings = signal<InstanceSettings | null>(null);\n /**\n * The method this browser last signed in with (`password`, `oauth_github`, …)\n * for the \"Last used\" hint; null when none, or the instance turned it off.\n */\n readonly lastMethod = signal<string | null>(null);\n /** The sign-in captcha (identifier step / `needs_captcha` challenge). */\n readonly captcha: CaptchaController = createCaptchaController(undefined, {\n // The Atlas captcha's words follow the form's catalog (read when drawn).\n atlasLabels: () => atlasCaptchaLabels(this.t),\n });\n /** The sign-up captcha (the create-account step). */\n readonly signUpCaptcha: CaptchaController = createCaptchaController(undefined, {\n atlasLabels: () => atlasCaptchaLabels(this.t),\n });\n /** Whether {@link captcha} currently draws a widget (for templates). */\n readonly captchaDrawn = signal(false);\n /** Whether {@link signUpCaptcha} currently draws a widget (for templates). */\n readonly signUpCaptchaDrawn = signal(false);\n /**\n * The first factor the server was asked to send ({@link prepare}) on the\n * current `needs_first_factor` step — the form then collects its code. Null\n * otherwise.\n */\n readonly preparedFactor = signal<'email_code' | null>(null);\n /**\n * \"Email me a code instead\" at the second factor ({@link sendEmailSecondFactor}):\n * in flight, where the code went, or why it was not sent. Null until asked,\n * and again once the flow leaves that step.\n */\n readonly emailSecondFactor = signal<{ busy?: boolean; sentTo?: string; error?: string } | null>(null);\n /** \"Text me a code instead\" at the second factor ({@link sendSmsSecondFactor}): as {@link emailSecondFactor}. */\n readonly smsSecondFactor = signal<{ busy?: boolean; sentTo?: string; error?: string } | null>(null);\n /**\n * The MFA enrolment step (`needs_mfa_enrollment`): the authenticator app's\n * setup (QR code, setup key) or a texted code. Started and reset with the flow.\n */\n readonly enrollment: MfaEnrollmentController;\n /** {@link enrollment}'s state, for templates. */\n readonly enrollmentState: WritableSignal<MfaEnrollmentState>;\n /**\n * The instance's policies (terms, privacy, …) for the create-account form:\n * {@link create} sends their acceptances and reloads them after a refusal.\n */\n readonly policies = new PolicyAcceptanceController([]);\n /**\n * Passkey sign-in (the \"Sign in with a passkey\" button and passkey autofill on\n * the identifier field). The outcome goes through the same completion as every sign-in.\n */\n readonly passkey: PasskeySignInController;\n /** Whether this browser can run WebAuthn; `<atlas-sign-in>` sets it after it is created in a browser. */\n readonly passkeySupported = signal(false);\n private pollTimer: ReturnType<typeof setInterval> | null = null;\n private identifier = '';\n\n constructor(\n private readonly client: FapiClient,\n private readonly reload: () => Promise<boolean>,\n pending: { id: string; status: string } | null,\n /** Resolves the captcha messages' catalog keys. Defaults to en-US. */\n private readonly t: (key: string) => string = (key) => translate(EN_US, key),\n ) {\n // Seeded from a redirect that came back mid-flow (e.g. OAuth needing a second\n // factor) so the user resumes at the demanded step instead of starting over.\n this.state = signal<FlowState>(pending ? flowFromPending(pending) : initialFlow);\n this.enrollment = createMfaEnrollment(this.client, () => this.mfaChoices());\n this.enrollmentState = signal<MfaEnrollmentState>(this.enrollment.state);\n this.enrollment.subscribe((next) => this.enrollmentState.set(next));\n this.passkey = createPasskeySignInController({\n client: this.client,\n onStart: () => this.state.update((current) => ({ ...current, busy: true, errors: [] })),\n onResult: (next) => this.finish(next),\n captcha: () => this.captcha,\n cancelledMessage: () => this.t('signIn.passkeyCancelled'),\n });\n this.syncCaptcha();\n this.syncEnrollment();\n }\n\n /** Why \"Continue with Atlas\" could not start (the server's message); null otherwise. */\n readonly signInWithAtlasError = signal<string | null>(null);\n\n /**\n * \"Continue with Atlas\" (when `settings().signInWithAtlas` is set): starts the\n * SSO sign-in and sends the browser to Atlas.\n */\n async signInWithAtlas(connectionId: string): Promise<void> {\n if (typeof window === 'undefined') return;\n this.signInWithAtlasError.set(null);\n const started = await startSignInWithAtlas(this.client, connectionId, window.location.href);\n if ('url' in started) window.location.assign(started.url);\n else this.signInWithAtlasError.set(started.error);\n }\n\n /** \"Sign in with a passkey\" is offered: the first step, the instance turned passkey sign-in on, and the browser can. */\n passkeyOffered(): boolean {\n return this.passkeySupported() && !this.state().attempt && this.settings()?.passkeySignIn === true;\n }\n\n /** What the app lets the MFA steps offer (from {@link settings}). */\n mfaChoices(): MfaChoices {\n return mfaChoicesFrom(this.settings()?.account);\n }\n\n /** Start the enrolment step for its attempt, or reset it once the flow leaves. */\n private syncEnrollment(): void {\n const attempt = this.state().attempt;\n if (attempt?.status === 'needs_mfa_enrollment' && attempt.id) this.enrollment.start(attempt.id);\n else this.enrollment.reset();\n }\n\n /** Fetch the instance's public settings and draw whatever captcha they require. */\n async loadSettings(): Promise<void> {\n const loaded = await fetchInstanceSettings(this.client);\n if (loaded) {\n this.settings.set(loaded);\n this.syncCaptcha();\n if (loaded.account.lastSignInMethod) this.lastMethod.set(await fetchLastSignInMethod(this.client));\n }\n }\n\n /**\n * The first factors to offer on a `needs_first_factor` step: the server's list\n * without email code / link while the app cannot deliver email\n * (`settings.emailDelivery.available === false`). Empty on any other step.\n */\n firstFactors(): string[] {\n const attempt = this.state().attempt;\n const step = attempt ? nextStep(attempt) : null;\n return step?.kind === 'collect_first_factor'\n ? offeredFirstFactors(step.strategies, this.settings()?.emailDelivery)\n : [];\n }\n\n /**\n * True when email + password sign-up cannot complete because the app cannot\n * send the verification email (`settings.emailDelivery.passwordSignUp === false`):\n * `<atlas-sign-up>` shows the \"can't send email\" notice instead of the form.\n */\n signUpEmailUnavailable(): boolean {\n return this.settings()?.emailDelivery.passwordSignUp === false;\n }\n\n /** False when a password reset email cannot be delivered — hide \"Forgot password?\". */\n passwordResetAvailable(): boolean {\n return this.settings()?.emailDelivery.passwordReset !== false;\n }\n\n /**\n * Ask the server to email a sign-in code for the current `needs_first_factor`\n * step (`POST …/prepare_first_factor`); the form then collects the code, which\n * {@link submit} posts as the `email_code` strategy.\n */\n async prepare(strategy: 'email_code'): Promise<void> {\n if (!this.firstFactors().includes(strategy)) return;\n this.state.update((current) => ({ ...current, busy: true, errors: [] }));\n const next = await prepareFactor(this.client, this.state(), strategy);\n this.setState(next);\n if (!next.errors.length) this.preparedFactor.set(strategy);\n }\n\n /** Keep both captchas in step with the settings and the flow's current step. */\n private syncCaptcha(): void {\n const settings = this.settings();\n const state = this.state();\n this.captcha.configure(\n signInCaptchaOptions(settings?.captchaFlows.signIn, state, () => void this.submit({})),\n );\n const signUpFlow = settings?.captchaFlows.signUp;\n this.signUpCaptcha.configure({\n flow: signUpFlow,\n active: !state.attempt && flowNeedsCaptcha(signUpFlow),\n });\n this.captchaDrawn.set(this.captcha.needed);\n this.signUpCaptchaDrawn.set(this.signUpCaptcha.needed);\n }\n\n private setState(next: FlowState): void {\n const previousId = this.state().attempt?.id ?? null;\n this.state.set(next);\n // A prepared factor belongs to the first-factor step it was sent for.\n if (next.attempt?.status !== 'needs_first_factor') this.preparedFactor.set(null);\n // An emailed second-factor code belongs to the second-factor step of this attempt.\n if (next.attempt?.status !== 'needs_second_factor' || (next.attempt?.id ?? null) !== previousId) {\n this.emailSecondFactor.set(null);\n this.smsSecondFactor.set(null);\n }\n this.syncCaptcha();\n this.syncEnrollment();\n this.autoSend();\n }\n\n private autoSentFor: string | null = null;\n /**\n * With no password on offer, email the code as soon as the server asks for a\n * first factor — once per attempt, so a failed send waits for the user's retry\n * (the \"Email me a code\" button) instead of looping.\n */\n private autoSend(): void {\n const id = this.state().attempt?.id ?? null;\n if (!id || this.autoSentFor === id || this.preparedFactor()) return;\n if (planFirstFactor(this.firstFactors()).autoSend !== 'email_code') return;\n this.autoSentFor = id;\n void this.prepare('email_code');\n }\n\n /**\n * Advance the flow with the values the user typed. On completion, exchange the\n * one-time ticket for cookies over a same-origin request (FAPI is cross-origin\n * and cannot set the cookie on its own response), then re-boot so the rest of\n * the app sees a signed-in user.\n */\n async submit(values: Record<string, string>): Promise<void> {\n this.state.update((current) => ({ ...current, busy: true, errors: [] }));\n\n const out = await advanceWithCaptcha(this.client, this.state(), values, {\n captcha: this.captcha,\n identifier: this.identifier,\n t: this.t,\n });\n this.identifier = out.identifier;\n await this.finish(out.state);\n }\n\n /** Load the sign-up's policies into {@link policies} (`<atlas-sign-up>` calls it on init). */\n async loadPolicies(locale?: string): Promise<void> {\n this.policies.setPolicies(await loadPolicies(this.client, { locale }));\n }\n\n /** The user declined a policy a sign-in was waiting on: cancel the attempt and say why. */\n declinePolicy(title: string): void {\n this.state.set({\n ...initialFlow,\n errors: [{ code: 'POLICY_DECLINED', message: this.t('policy.declined').replace('{policy}', title) }],\n });\n }\n\n /**\n * Create an account (`POST /v1/client/sign_ups`) from a create-account form's\n * values — email, password and any configured sign-up fields — carrying the\n * sign-up captcha's token when the instance requires one. The emailed code is\n * then posted with {@link submit}.\n */\n async create(values: Record<string, string>, consent = true): Promise<void> {\n this.state.update((current) => ({ ...current, busy: true, errors: [] }));\n const next = await createSignUp(this.client, values, {\n consent,\n captcha: this.signUpCaptcha,\n t: this.t,\n policies: this.policies,\n });\n await this.finish(next);\n }\n\n /**\n * \"Email me a code instead\" at the second factor (the instance's\n * `account.emailSecondFactor`): mails a code to the account's verified email;\n * it is then posted with {@link submit} like any 2FA code.\n */\n async sendEmailSecondFactor(): Promise<void> {\n await this.sendSecondFactorCode('email_code', this.emailSecondFactor);\n }\n\n /**\n * \"Text me a code instead\" at the second factor (where the app offers texted\n * codes, {@link mfaChoices}`().sms`): texts a code to the account's enrolled\n * phone; it is then posted with {@link submit} like any 2FA code.\n */\n async sendSmsSecondFactor(): Promise<void> {\n await this.sendSecondFactorCode('sms', this.smsSecondFactor);\n }\n\n private async sendSecondFactorCode(\n strategy: 'sms' | 'email_code',\n out: WritableSignal<{ busy?: boolean; sentTo?: string; error?: string } | null>,\n ): Promise<void> {\n const id = this.state().attempt?.id;\n if (!id) return;\n out.set({ busy: true });\n try {\n const { sentTo } = await prepareSecondFactorCode(this.client, id, strategy);\n out.set({ sentTo });\n } catch (error) {\n out.set({ error: error instanceof Error ? error.message : this.t('error.generic') });\n }\n }\n\n /** Resend a sign-up's emailed code / link (the earlier one stops working). */\n async resendSignUp(): Promise<void> {\n this.state.update((current) => ({ ...current, busy: true, errors: [] }));\n this.state.set(await resendSignUpVerification(this.client, this.state()));\n }\n\n /**\n * Start a passkey-only sign-up (`POST /v1/client/sign_ups/passkey`) from the\n * create-account form's values — no password. Offered when the instance's\n * `account.passkeySignUp` is set.\n */\n async createWithPasskey(values: Record<string, string>, consent = true): Promise<void> {\n this.state.update((current) => ({ ...current, busy: true, errors: [] }));\n await this.finish(await createPasskeySignUp(this.client, values, { consent, captcha: this.signUpCaptcha, t: this.t, policies: this.policies }));\n }\n\n /** The passkey-only sign-up's last step: create the passkey, and with it the account. */\n async createPasskey(): Promise<void> {\n this.state.update((current) => ({ ...current, busy: true, errors: [] }));\n await this.finish(await finishPasskeySignUp(this.client, this.state(), { t: this.t }));\n }\n\n /**\n * The recovery codes an MFA enrolment just completed the sign-in with, shown\n * once before it finishes ({@link saveRecoveryCodes}); null otherwise. They\n * live only in this controller's memory.\n */\n recoveryCodes(): string[] | null {\n return pendingRecoveryCodes(this.state());\n }\n\n /** \"I've saved my codes\": forget the recovery codes and finish the sign-in. */\n async saveRecoveryCodes(): Promise<void> {\n await this.finish(acknowledgeRecoveryCodes(this.state()));\n }\n\n private async finish(next: FlowState): Promise<void> {\n // An enrolment's recovery codes are shown first; `saveRecoveryCodes` finishes.\n if (pendingRecoveryCodes(next)) {\n this.setState({ ...next, busy: false });\n return;\n }\n if (next.attempt?.status === 'complete') {\n // Stays busy until this browser actually holds the session: the completion\n // alone says nothing about whether the cookie was kept.\n this.setState({ ...next, busy: true });\n let exchanged = true;\n if (next.ticket) {\n const res = await this.client.post('/v1/client/tickets/exchange', {\n attempt_id: (next.attempt as { id?: string }).id,\n ticket: next.ticket,\n });\n exchanged = res.ok;\n }\n const kept = exchanged && (await this.reload());\n this.setState({ ...next, busy: false, sessionKept: kept });\n } else {\n this.setState(next);\n // A magic-link step may now be pollable (a link opened on another device).\n this.syncPolling();\n }\n }\n\n /** Start/stop the §5.3 magic-link poll to match the current state. */\n syncPolling(): void {\n if (shouldKeepPolling(this.state())) {\n this.startPolling();\n } else {\n this.stopPolling();\n }\n }\n\n private startPolling(): void {\n if (this.pollTimer) return;\n this.pollTimer = setInterval(() => {\n void (async () => {\n const { state: next, ticket } = await pollAttempt(this.client, this.state());\n this.setState(next);\n // e.g. a passkey sign-up whose email was just proven: only this tab can go on.\n if (!ticket && !shouldKeepPolling(next)) this.stopPolling();\n if (!ticket || !next.attempt) return;\n\n // The ticket is exchanged by a normal request, so no session token ever\n // appears in a URL.\n const res = await this.client.post('/v1/client/tickets/exchange', {\n attempt_id: (next.attempt as { id?: string }).id,\n ticket,\n });\n const kept = res.ok && (await this.reload());\n this.setState({ ...this.state(), sessionKept: kept });\n this.stopPolling();\n })();\n }, 2_000);\n }\n\n private stopPolling(): void {\n if (this.pollTimer) {\n clearInterval(this.pollTimer);\n this.pollTimer = null;\n }\n }\n\n /** Release the poll timer and the captcha widgets — call from the component's `ngOnDestroy`. */\n destroy(): void {\n this.passkey.stopAutofill();\n this.stopPolling();\n this.captcha.destroy();\n this.signUpCaptcha.destroy();\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n Input,\n OnDestroy,\n OnInit,\n computed,\n effect,\n inject,\n} from '@angular/core';\nimport { lastUsedMethodLabel, passkeysSupported, signUp as hostedSignUp } from '@atlasauth/js';\nimport { AtlasService } from '../atlas.service';\nimport { translate } from '../i18n';\nimport { AttemptFlowComponent } from './attempt-flow.component';\nimport { RecoveryCodesComponent } from './recovery-codes.component';\nimport { AtlasFlowController } from './flow-controller';\n\n/**\n * `<atlas-sign-in>` — the full, multi-step sign-in flow driven entirely by the\n * server-side attempt status. The Angular peer of React's `<SignIn/>`. Draws the\n * instance's sign-in captcha when it is required (always-on, or a\n * `needs_captcha` challenge).\n *\n * ```html\n * <atlas-sign-in *atlasSignedOut afterUrl=\"/dashboard\"></atlas-sign-in>\n * ```\n */\n@Component({\n selector: 'atlas-sign-in',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AttemptFlowComponent, RecoveryCodesComponent],\n template: `\n @if (lastUsedLabel(); as label) {\n <p class=\"atlas-text atlas-last-used-hint\" data-atlas=\"last-used\" [attr.data-atlas-method]=\"flow.lastMethod()\">\n {{ t('signIn.lastUsed') }}: {{ label }}\n </p>\n }\n @if (atlasConnection(); as connectionId) {\n <button type=\"button\" class=\"atlas-social-button\" data-atlas-provider=\"atlas\" (click)=\"flow.signInWithAtlas(connectionId)\">\n {{ t('signIn.continueWithAtlas') }}\n </button>\n @if (flow.signInWithAtlasError(); as message) {\n <p class=\"atlas-error\" role=\"alert\">{{ message }}</p>\n }\n }\n @if (flow.recoveryCodes(); as codes) {\n <atlas-recovery-codes [codes]=\"codes\" [busy]=\"flow.state().busy\" (saved)=\"flow.saveRecoveryCodes()\"></atlas-recovery-codes>\n } @else {\n <atlas-attempt-flow\n [attempt]=\"flow.state().attempt\"\n [busy]=\"flow.state().busy\"\n [errors]=\"flow.state().errors\"\n [sessionKept]=\"flow.state().sessionKept\"\n titleKey=\"signIn.title\"\n [captcha]=\"flow.captchaDrawn() ? flow.captcha : null\"\n [firstFactors]=\"flow.firstFactors()\"\n [preparedFactor]=\"flow.preparedFactor()\"\n [offerEmailSecondFactor]=\"flow.settings()?.account?.emailSecondFactor === true\"\n [emailedSecondFactor]=\"flow.emailSecondFactor()\"\n (submitFlow)=\"submitIdentifier($event)\"\n (chooseFactor)=\"flow.prepare($event)\"\n [offerSmsSecondFactor]=\"flow.settings() !== null && flow.mfaChoices().sms\"\n [textedSecondFactor]=\"flow.smsSecondFactor()\"\n [enrollment]=\"flow.enrollment\"\n [enrollmentState]=\"flow.enrollmentState()\"\n (emailSecondFactor)=\"flow.sendEmailSecondFactor()\"\n (smsSecondFactor)=\"flow.sendSmsSecondFactor()\"\n (policyDeclined)=\"flow.declinePolicy($event)\"\n ></atlas-attempt-flow>\n }\n @if (flow.passkeyOffered() && !flow.recoveryCodes()) {\n <button\n type=\"button\"\n class=\"atlas-social-button atlas-passkey-button\"\n data-atlas-passkey-sign-in=\"\"\n [disabled]=\"flow.state().busy\"\n (click)=\"flow.passkey.signIn()\"\n >\n {{ t('signIn.passkeyButton') }}\n </button>\n }\n @if (flow.state().attempt?.status !== 'complete' && signUpHref(); as href) {\n <p class=\"atlas-footer\" data-atlas-sign-up-prompt=\"\">\n {{ t('signIn.noAccount') }} <a class=\"atlas-link\" [href]=\"href\">{{ t('signIn.signUpLink') }}</a>\n </p>\n }\n `,\n})\nexport class SignInComponent implements OnInit, OnDestroy {\n private readonly atlas = inject(AtlasService);\n\n /** Where to send the user once the flow completes. Reserved for host routing. */\n @Input() afterUrl?: string;\n /**\n * Where \"No account? Sign up\" goes. Default: the instance's hosted sign-up\n * page (carrying the visitor's referral). `null` hides it. Always shown, never\n * only after a failed sign-in, so it says nothing about whether an email has an account.\n */\n @Input() signUpUrl?: string | null;\n\n protected t(key: string): string {\n return translate(this.atlas.localization, key);\n }\n\n /** \"Last used: Password\" on the identifier step, when the instance shows the hint. */\n protected lastUsedLabel(): string | null {\n if (this.flow.state().attempt) return null;\n return lastUsedMethodLabel(this.flow.lastMethod(), (key) => this.t(key));\n }\n\n /** The \"Sign in with Atlas\" connection, on the first step, when the instance has it on. */\n protected atlasConnection(): string | null {\n if (this.flow.state().attempt || this.flow.recoveryCodes()) return null;\n return this.flow.settings()?.signInWithAtlas?.connectionId ?? null;\n }\n\n protected signUpHref(): string | null {\n if (this.signUpUrl === null) return null;\n if (this.signUpUrl) return this.signUpUrl;\n try {\n return hostedSignUp({\n frontendApi: this.atlas.frontendApi,\n redirectUrl: this.afterUrl ?? (typeof window !== 'undefined' ? window.location.href : undefined),\n navigate: false,\n });\n } catch {\n return null;\n }\n }\n\n protected readonly flow = new AtlasFlowController(\n this.atlas.createFapiClient(),\n () => this.atlas.reload(),\n // Resume mid-flow if an OAuth redirect came back owing a second factor.\n this.atlas.pendingAttempt,\n (key) => translate(this.atlas.localization, key),\n );\n\n // Passkey autofill runs while the first step offers passkeys (a computed, so it re-arms only when that changes).\n private readonly passkeyOffered = computed(() => this.flow.passkeyOffered());\n protected readonly passkeyAutofill = effect(() => (this.passkeyOffered() ? this.flow.passkey.armAutofill() : this.flow.passkey.stopAutofill()));\n\n protected submitIdentifier(values: Record<string, string>): void {\n this.flow.passkey.stopAutofill();\n void this.flow.submit(values);\n }\n\n ngOnInit(): void {\n if (typeof window !== 'undefined') this.flow.passkeySupported.set(passkeysSupported());\n // If seeded from a pending attempt that is already pollable, start polling.\n this.flow.syncPolling();\n // §5 the instance's captcha settings (switching captcha on in the dashboard\n // draws it here with no code change) and email delivery (no emailed-code\n // option while the app cannot send email).\n if (typeof window !== 'undefined') void this.flow.loadSettings();\n }\n\n ngOnDestroy(): void {\n this.flow.destroy();\n }\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n inject,\n type SimpleChanges,\n} from '@angular/core';\nimport {\n confirmPolicies,\n localizedErrorMessage,\n type PolicyAcceptanceController,\n type CaptchaController,\n type FieldError,\n type InstanceSettings,\n type PublicSignUpField,\n} from '@atlasauth/js';\nimport { AtlasService } from '../atlas.service';\nimport { classFor, type ElementKey } from '../appearance';\nimport { translate } from '../i18n';\nimport { AtlasCaptchaSlotDirective } from '../directives/captcha-slot.directive';\nimport { AtlasPoliciesDirective, policyUi } from './policy-host';\n\n/** What the create-account form emits: the values typed plus the consent tick. */\nexport interface SignUpFormSubmit {\n values: Record<string, string>;\n consent: boolean;\n}\n\n/**\n * The create-account step of `<atlas-sign-up>`: the instance's configured extra\n * fields, email + password, the legal-consent row and — when the instance\n * requires one on sign-up — the captcha widget. Values live on the component so\n * a refused submit never clears them. When the app cannot send the verification\n * email (`settings.emailDelivery.passwordSignUp === false`) it shows the\n * `signUp.emailUnavailable` notice instead of the form.\n */\n@Component({\n selector: 'atlas-sign-up-form',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AtlasCaptchaSlotDirective, AtlasPoliciesDirective],\n template: `\n <div [class]=\"cls('card', 'atlas-card')\">\n <h1 [class]=\"cls('headerTitle', 'atlas-title')\">{{ t('signUp.title') }}</h1>\n\n @if (emailUnavailable()) {\n <!-- The app cannot send the verification email, so an email + password\n sign-up could never complete: say so instead of offering the form. -->\n <p [class]=\"cls('formFieldError', 'atlas-error')\" role=\"alert\" data-atlas-email-unavailable=\"\">\n {{ t('signUp.emailUnavailable') }}\n </p>\n } @else {\n @for (error of formErrors(); track error.code) {\n <p [class]=\"cls('formFieldError', 'atlas-error')\" role=\"alert\">{{ errorText(error) }}</p>\n }\n\n <form (submit)=\"onSubmit($event)\">\n @for (f of fields(); track f.key) {\n @if (f.type === 'radio' || f.type === 'multiselect') {\n <div [class]=\"cls('formField', 'atlas-field')\">\n <span [class]=\"cls('formFieldLabel', 'atlas-field-label')\">{{ label(f) }}</span>\n <span class=\"atlas-choices\">\n @for (o of f.options; track o) {\n <label class=\"atlas-choice\">\n <input\n [type]=\"f.type === 'radio' ? 'radio' : 'checkbox'\"\n [attr.name]=\"f.key\"\n [value]=\"o\"\n [checked]=\"picked(f.key).includes(o)\"\n (change)=\"toggle(f, o, $any($event.target).checked)\"\n />\n {{ o }}\n </label>\n }\n </span>\n @for (error of fieldErrorsFor(f.key); track error.code) {\n <span [class]=\"cls('formFieldError', 'atlas-error')\">{{ errorText(error) }}</span>\n }\n </div>\n } @else {\n <label [class]=\"cls('formField', 'atlas-field')\">\n <span [class]=\"cls('formFieldLabel', 'atlas-field-label')\">{{ label(f) }}</span>\n @if (f.type === 'checkbox') {\n <input\n type=\"checkbox\"\n [attr.name]=\"f.key\"\n [checked]=\"values[f.key] === 'true'\"\n (change)=\"setValue(f.key, $any($event.target).checked ? 'true' : '')\"\n />\n } @else if (f.type === 'select') {\n <select\n [class]=\"cls('formFieldInput', 'atlas-input')\"\n [attr.name]=\"f.key\"\n [value]=\"values[f.key] ?? ''\"\n [required]=\"f.required\"\n (change)=\"setValue(f.key, $any($event.target).value)\"\n >\n <option value=\"\">{{ f.placeholder ?? t('signUp.selectPlaceholder') }}</option>\n @for (o of f.options; track o) {\n <option [value]=\"o\">{{ o }}</option>\n }\n </select>\n } @else if (f.type === 'textarea') {\n <textarea\n [class]=\"cls('formFieldInput', 'atlas-input')\"\n [attr.name]=\"f.key\"\n rows=\"3\"\n [value]=\"values[f.key] ?? ''\"\n [required]=\"f.required\"\n [attr.placeholder]=\"f.placeholder\"\n (input)=\"setValue(f.key, $any($event.target).value)\"\n ></textarea>\n } @else {\n <input\n [class]=\"cls('formFieldInput', 'atlas-input')\"\n [type]=\"inputType(f)\"\n [attr.name]=\"f.key\"\n [value]=\"values[f.key] ?? ''\"\n [required]=\"f.required\"\n [attr.placeholder]=\"f.placeholder\"\n (input)=\"setValue(f.key, $any($event.target).value)\"\n />\n }\n @for (error of fieldErrorsFor(f.key); track error.code) {\n <span [class]=\"cls('formFieldError', 'atlas-error')\">{{ errorText(error) }}</span>\n }\n </label>\n }\n }\n\n @if (showEmail()) {\n <label [class]=\"cls('formField', 'atlas-field')\">\n <span [class]=\"cls('formFieldLabel', 'atlas-field-label')\">{{\n emailRequired() ? t('signUp.emailLabel') : t('signUp.optionalField', { label: t('signUp.emailLabel') })\n }}</span>\n <input\n [class]=\"cls('formFieldInput', 'atlas-input')\"\n type=\"email\"\n name=\"email\"\n autocomplete=\"email\"\n [required]=\"emailRequired()\"\n [value]=\"values['email'] ?? ''\"\n (input)=\"setValue('email', $any($event.target).value)\"\n />\n @for (error of fieldErrorsFor('email'); track error.code) {\n <span [class]=\"cls('formFieldError', 'atlas-error')\">{{ errorText(error) }}</span>\n }\n </label>\n }\n\n @if (passkey) {\n <p class=\"atlas-text\">{{ t('signUp.passkeyIntro') }}</p>\n } @else {\n <label [class]=\"cls('formField', 'atlas-field')\">\n <span [class]=\"cls('formFieldLabel', 'atlas-field-label')\">{{ t('signUp.passwordLabel') }}</span>\n <input\n [class]=\"cls('formFieldInput', 'atlas-input')\"\n type=\"password\"\n name=\"password\"\n autocomplete=\"new-password\"\n required\n [value]=\"values['password'] ?? ''\"\n (input)=\"setValue('password', $any($event.target).value)\"\n />\n @for (error of fieldErrorsFor('password'); track error.code) {\n <span [class]=\"cls('formFieldError', 'atlas-error')\">{{ errorText(error) }}</span>\n }\n </label>\n }\n\n @if (hasPolicies()) {\n <div [atlasPolicies]=\"policies\"></div>\n @if (declined) {\n <span [class]=\"cls('formFieldError', 'atlas-error')\" role=\"alert\" data-atlas-policy-declined=\"\">\n {{ t('policy.declined', { policy: declined }) }}\n </span>\n }\n }\n\n @if (showLegal()) {\n <label [class]=\"cls('formField', 'atlas-consent')\">\n @if (settings?.legal?.required) {\n <input\n type=\"checkbox\"\n name=\"consent\"\n [checked]=\"agreed\"\n (change)=\"agreed = $any($event.target).checked\"\n />\n }\n <span class=\"atlas-text\">\n {{ t(settings?.legal?.required ? 'signUp.consentAgree' : 'signUp.consentNotice') }}\n @if (settings?.legal?.termsUrl; as terms) {\n <a class=\"atlas-link\" [href]=\"terms\" target=\"_blank\" rel=\"noopener noreferrer\">{{ t('signUp.terms') }}</a>\n }\n @if (settings?.legal?.termsUrl && settings?.legal?.privacyUrl) {\n {{ t('signUp.and') }}\n }\n @if (settings?.legal?.privacyUrl; as privacy) {\n <a class=\"atlas-link\" [href]=\"privacy\" target=\"_blank\" rel=\"noopener noreferrer\">{{ t('signUp.privacy') }}</a>\n }.\n </span>\n @for (error of fieldErrorsFor('consent'); track error.code) {\n <span [class]=\"cls('formFieldError', 'atlas-error')\">{{ errorText(error) }}</span>\n }\n </label>\n }\n\n @if (captcha) {\n <div class=\"atlas-captcha\" data-atlas-captcha=\"\" [atlasCaptchaSlot]=\"captcha\"></div>\n }\n\n <button\n [class]=\"cls('formButtonPrimary', 'atlas-button')\"\n [disabled]=\"busy || !consentOk()\"\n type=\"submit\"\n >\n {{ t('signUp.submit') }}\n </button>\n @if (hasPolicies()) {\n <p atlasPolicyKind=\"clickwrap\" [atlasPolicies]=\"policies\"></p>\n }\n @if (switchable) {\n <div class=\"atlas-alternatives\">\n <button\n type=\"button\"\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n [attr.data-atlas-sign-up-mode]=\"passkey ? 'password' : 'passkey'\"\n [disabled]=\"busy\"\n (click)=\"switchMode.emit()\"\n >\n {{ t(passkey ? 'signUp.passwordOption' : 'signUp.passkeyOption') }}\n </button>\n </div>\n }\n </form>\n }\n </div>\n `,\n})\nexport class SignUpFormComponent implements OnChanges, OnDestroy {\n private readonly atlas = inject(AtlasService);\n private readonly cdr = inject(ChangeDetectorRef);\n private unwatch: (() => void) | null = null;\n\n @Input() settings: InstanceSettings | null = null;\n @Input() busy = false;\n @Input() errors: FieldError[] = [];\n @Input() captcha: CaptchaController | null = null;\n /** Passkey-only sign-up: no password field; the email per the instance's mode. */\n @Input() passkey: { email: 'off' | 'optional' | 'required' } | null = null;\n /** Whether the password / passkey toggle is shown (both are offered). */\n @Input() switchable = false;\n /** The instance's policies (terms, privacy, …); they replace the legacy consent row. */\n @Input() policies: PolicyAcceptanceController | null = null;\n /** The user asked for the other sign-up method. */\n @Output() switchMode = new EventEmitter<void>();\n\n /** Emits the typed values and the consent tick when the form is submitted. */\n @Output() submitSignUp = new EventEmitter<SignUpFormSubmit>();\n\n protected values: Record<string, string> = {};\n protected agreed = false;\n protected declined: string | null = null;\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!changes['policies']) return;\n this.unwatch?.();\n this.unwatch = this.policies?.subscribe(() => this.cdr.markForCheck()) ?? null;\n }\n\n ngOnDestroy(): void {\n this.unwatch?.();\n }\n\n protected hasPolicies(): boolean {\n return !!this.policies && this.policies.policies.length > 0;\n }\n\n protected t(key: string, vars?: Record<string, string>): string {\n return translate(this.atlas.localization, key, vars);\n }\n\n /** A server error in the app's language (`error.<reason>`, else the server's message). */\n protected errorText(error: FieldError): string {\n // `errorLocalization` is read defensively: a stand-in service may lack it.\n const layer = (this.atlas as { errorLocalization?: Record<string, string> }).errorLocalization;\n return localizedErrorMessage(error, layer ?? this.atlas.localization, this.atlas.localization);\n }\n\n protected cls(key: ElementKey, base: string): string {\n return classFor(key, this.atlas.appearance, base);\n }\n\n protected setValue(name: string, value: string): void {\n this.values = { ...this.values, [name]: value };\n }\n\n /** Email + password sign-up cannot complete: the app cannot send the verification email. */\n protected emailUnavailable(): boolean {\n // A passkey sign-up that collects no email (or an unproven one) sends no mail.\n if (this.passkey && this.passkey.email !== 'required') return false;\n return this.settings?.emailDelivery?.passwordSignUp === false;\n }\n\n protected showEmail(): boolean {\n return !this.passkey || this.passkey.email !== 'off';\n }\n\n protected emailRequired(): boolean {\n return !this.passkey || this.passkey.email === 'required';\n }\n\n protected fields(): PublicSignUpField[] {\n return this.settings?.signUpFields ?? [];\n }\n\n protected label(f: PublicSignUpField): string {\n return f.required ? f.label : this.t('signUp.optionalField', { label: f.label });\n }\n\n protected inputType(f: PublicSignUpField): string {\n return ['email', 'tel', 'url', 'number', 'date'].includes(f.type) ? f.type : 'text';\n }\n\n /** Same encoding as React, the embed widget and the hosted page: one value,\n * or a comma-joined list for multiselect. */\n protected picked(key: string): string[] {\n const value = this.values[key];\n return value ? value.split(', ') : [];\n }\n\n protected toggle(f: PublicSignUpField, option: string, on: boolean): void {\n if (f.type === 'radio') {\n this.setValue(f.key, option);\n return;\n }\n const current = this.picked(f.key);\n this.setValue(f.key, (on ? [...current, option] : current.filter((p) => p !== option)).join(', '));\n }\n\n protected showLegal(): boolean {\n // Instance policies replace the legacy single \"I agree to the Terms\" row.\n if (this.hasPolicies()) return false;\n const legal = this.settings?.legal;\n return !!legal && (!!legal.termsUrl || !!legal.privacyUrl);\n }\n\n protected consentOk(): boolean {\n if (this.hasPolicies()) return this.policies!.canSubmit();\n return !this.settings?.legal?.required || this.agreed;\n }\n\n protected formErrors(): FieldError[] {\n return this.errors.filter((error) => !error.param);\n }\n\n protected fieldErrorsFor(name: string): FieldError[] {\n return this.errors.filter((error) => error.param === name);\n }\n\n protected onSubmit(event: Event): void {\n event.preventDefault();\n if (this.emailUnavailable() || !this.consentOk()) return;\n this.declined = null;\n if (this.hasPolicies()) {\n // Scroll-mode policies are read in their unskippable dialog first.\n const values = { ...this.values };\n void confirmPolicies(this.policies!, { t: policyUi(this.atlas).t }).then((res) => {\n if (res.ok) this.submitSignUp.emit({ values, consent: true });\n else {\n this.declined = res.declined;\n this.cdr.markForCheck();\n }\n });\n return;\n }\n this.submitSignUp.emit({\n values: { ...this.values },\n consent: this.settings?.legal?.required ? this.agreed : true,\n });\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n Input,\n OnDestroy,\n OnInit,\n inject,\n signal,\n} from '@angular/core';\nimport { awaitingPasskey, localizedErrorMessage, passkeysSupported, type FieldError } from '@atlasauth/js';\nimport { AtlasService } from '../atlas.service';\nimport { classFor, type ElementKey } from '../appearance';\nimport { translate } from '../i18n';\nimport { AttemptFlowComponent } from './attempt-flow.component';\nimport { SignUpFormComponent } from './sign-up-form.component';\nimport { AtlasFlowController } from './flow-controller';\n\n/**\n * `<atlas-sign-up>` — creates an account. The Angular peer of React's\n * `<SignUp/>`. The first step is the create-account form (the instance's\n * configured fields, email, password, legal consent and — when required — the\n * captcha), which POSTs `/v1/client/sign_ups`; from there it shares the flow\n * engine with `<atlas-sign-in>` (the emailed-code step, then the ticket\n * exchange), because the sequence of steps is decided by the server.\n *\n * ```html\n * <atlas-sign-up *atlasSignedOut></atlas-sign-up>\n * ```\n */\n@Component({\n selector: 'atlas-sign-up',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AttemptFlowComponent, SignUpFormComponent],\n template: `\n @if (awaitingPasskey()) {\n <div [class]=\"cls('card', 'atlas-card')\" data-atlas-passkey-sign-up=\"\">\n <h1 [class]=\"cls('headerTitle', 'atlas-title')\">{{ t('signUp.title') }}</h1>\n @for (error of flow.state().errors; track error.code) {\n <p [class]=\"cls('formFieldError', 'atlas-error')\" role=\"alert\">{{ errorText(error) }}</p>\n }\n <p class=\"atlas-text\">{{ t('signUp.passkeyPrompt') }}</p>\n <button\n [class]=\"cls('formButtonPrimary', 'atlas-button')\"\n type=\"button\"\n [disabled]=\"flow.state().busy\"\n (click)=\"flow.createPasskey()\"\n >\n {{ t('signUp.passkeyCreate') }}\n </button>\n </div>\n } @else if (flow.state().attempt) {\n <atlas-attempt-flow\n [attempt]=\"flow.state().attempt\"\n [busy]=\"flow.state().busy\"\n [errors]=\"flow.state().errors\"\n [sessionKept]=\"flow.state().sessionKept\"\n titleKey=\"signUp.title\"\n [emailVerification]=\"flow.settings()?.account?.emailVerification ?? 'code'\"\n (submitFlow)=\"flow.submit($event)\"\n (resend)=\"flow.resendSignUp()\"\n ></atlas-attempt-flow>\n } @else {\n <atlas-sign-up-form\n [settings]=\"flow.settings()\"\n [busy]=\"flow.state().busy\"\n [errors]=\"flow.state().errors\"\n [captcha]=\"flow.signUpCaptchaDrawn() ? flow.signUpCaptcha : null\"\n [policies]=\"flow.policies\"\n [passkey]=\"passkeyForm()\"\n [switchable]=\"canPasskey()\"\n (switchMode)=\"toggleMode()\"\n (submitSignUp)=\"\n passkeyForm() ? flow.createWithPasskey($event.values, $event.consent) : flow.create($event.values, $event.consent)\n \"\n ></atlas-sign-up-form>\n }\n `,\n})\nexport class SignUpComponent implements OnInit, OnDestroy {\n private readonly atlas = inject(AtlasService);\n\n /** Where to send the user once the flow completes. Reserved for host routing. */\n @Input() afterUrl?: string;\n\n protected readonly flow = new AtlasFlowController(\n this.atlas.createFapiClient(),\n () => this.atlas.reload(),\n this.atlas.pendingAttempt,\n (key) => translate(this.atlas.localization, key),\n );\n\n /** Password or passkey-only sign-up (the latter when the instance offers it). */\n protected readonly mode = signal<'password' | 'passkey'>('password');\n\n protected canPasskey(): boolean {\n return !!this.flow.settings()?.account.passkeySignUp && passkeysSupported();\n }\n\n protected passkeyForm(): { email: 'off' | 'optional' | 'required' } | null {\n const offer = this.flow.settings()?.account.passkeySignUp ?? null;\n return this.mode() === 'passkey' && offer && this.canPasskey() ? { email: offer.email } : null;\n }\n\n protected toggleMode(): void {\n this.flow.state.update((current) => ({ ...current, errors: [] }));\n this.mode.set(this.passkeyForm() ? 'password' : 'passkey');\n }\n\n protected awaitingPasskey(): boolean {\n return awaitingPasskey(this.flow.state().attempt);\n }\n\n protected t(key: string): string {\n return translate(this.atlas.localization, key);\n }\n\n protected cls(key: ElementKey, base: string): string {\n return classFor(key, this.atlas.appearance, base);\n }\n\n protected errorText(error: FieldError): string {\n const layer = (this.atlas as { errorLocalization?: Record<string, string> }).errorLocalization;\n return localizedErrorMessage(error, layer ?? this.atlas.localization, this.atlas.localization);\n }\n\n ngOnInit(): void {\n // §5 the instance's sign-up fields, consent policy and captcha settings.\n if (typeof window !== 'undefined') {\n void this.flow.loadSettings();\n void this.flow.loadPolicies(this.atlas.locale ?? undefined);\n }\n }\n\n ngOnDestroy(): void {\n this.flow.destroy();\n }\n}\n","import { ChangeDetectionStrategy, Component, computed, inject, signal } from '@angular/core';\nimport { AtlasService } from '../atlas.service';\nimport { classFor, type ElementKey } from '../appearance';\nimport { translate } from '../i18n';\n\n/**\n * `<atlas-user-button>` — the signed-in user's avatar with a drop-down that can\n * sign them out. The Angular peer of React's `<UserButton/>`. Renders nothing\n * when there is no user.\n */\n@Component({\n selector: 'atlas-user-button',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (atlas.user(); as user) {\n <div class=\"atlas-user-button\">\n <button\n [class]=\"cls('avatar', 'atlas-avatar')\"\n [attr.aria-expanded]=\"open()\"\n (click)=\"toggle()\"\n >\n @if (user.image_url) {\n <img [src]=\"user.image_url\" alt=\"\" />\n } @else {\n <span>{{ label().slice(0, 1) }}</span>\n }\n </button>\n\n @if (open()) {\n <div [class]=\"cls('menu', 'atlas-menu')\" role=\"menu\">\n <span [class]=\"cls('menuItem', 'atlas-menu-item')\">{{ label() }}</span>\n <button [class]=\"cls('menuItem', 'atlas-menu-item')\" (click)=\"signOut()\">\n {{ t('userButton.signOut') }}\n </button>\n </div>\n }\n </div>\n }\n `,\n})\nexport class UserButtonComponent {\n protected readonly atlas = inject(AtlasService);\n protected readonly open = signal(false);\n\n protected readonly label = computed(() => {\n const user = this.atlas.user();\n if (!user) return '';\n return [user.first_name, user.last_name].filter(Boolean).join(' ') || user.username || '';\n });\n\n protected t(key: string): string {\n return translate(this.atlas.localization, key);\n }\n\n protected cls(key: ElementKey, base: string): string {\n return classFor(key, this.atlas.appearance, base);\n }\n\n protected toggle(): void {\n this.open.update((o) => !o);\n }\n\n protected signOut(): void {\n void this.atlas.signOut();\n }\n}\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { AtlasService } from '../atlas.service';\nimport { classFor, type ElementKey } from '../appearance';\nimport { translate } from '../i18n';\n\n/**\n * `<atlas-organization-switcher>` — switch the active organization (or the\n * personal account). The Angular peer of React's `<OrganizationSwitcher/>`.\n */\n@Component({\n selector: 'atlas-organization-switcher',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div [class]=\"cls('menu', 'atlas-menu')\">\n <button [class]=\"cls('menuItem', 'atlas-menu-item')\" (click)=\"setActive(null)\">\n {{ t('organization.personal') }}\n </button>\n @for (membership of atlas.memberships(); track membership.organization.id) {\n <button\n [class]=\"cls('menuItem', 'atlas-menu-item')\"\n [disabled]=\"membership.organization.id === atlas.organization()?.organization?.id\"\n (click)=\"setActive(membership.organization.id)\"\n >\n {{ membership.organization.name }}\n </button>\n }\n </div>\n `,\n})\nexport class OrganizationSwitcherComponent {\n protected readonly atlas = inject(AtlasService);\n\n protected t(key: string): string {\n return translate(this.atlas.localization, key);\n }\n\n protected cls(key: ElementKey, base: string): string {\n return classFor(key, this.atlas.appearance, base);\n }\n\n protected setActive(organizationId: string | null): void {\n void this.atlas.setActiveOrganization(organizationId);\n }\n}\n","import { ChangeDetectionStrategy, Component, type OnInit, inject, signal } from '@angular/core';\nimport {\n clearCibaPin,\n decideCibaRequest,\n getCibaPin,\n listCibaRequests,\n setCibaPin,\n type CibaPinStatus,\n type CibaRequest,\n} from '@atlasauth/js';\nimport { AtlasService } from '../atlas.service';\nimport { classFor, type ElementKey } from '../appearance';\n\n/**\n * `<atlas-manage-ciba>` — sign-in requests apps start on the user's behalf (CIBA), with approve and deny, and\n * the optional CIBA PIN apps must send as the user code. The Angular peer of React's `<ManageCiba/>`. Renders\n * nothing when there is no request, no PIN and no app that could ask.\n */\n@Component({\n selector: 'atlas-manage-ciba',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (requests().length || (pin() && (pin()!.set || pin()!.available))) {\n <section [class]=\"cls('card', 'atlas-card')\" data-atlas=\"manage-ciba\">\n @if (requests().length) {\n <h2>Sign-in requests from apps</h2>\n <ul>\n @for (r of requests(); track r.id) {\n <li>\n <strong>{{ r.client_name }}</strong>\n @if (r.binding_message) {\n <div>{{ r.binding_message }}</div>\n }\n <small>{{ r.scope.join(', ') }}</small>\n <button [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" type=\"button\" (click)=\"decide(r.id, 'approve')\">Approve</button>\n <button [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" type=\"button\" (click)=\"decide(r.id, 'deny')\">Deny</button>\n </li>\n }\n </ul>\n }\n @if (pin(); as p) {\n @if (p.set || p.available) {\n <form (submit)=\"save($event)\">\n <h2>CIBA PIN</h2>\n <p>{{ p.set ? 'You have a CIBA PIN.' : 'You have not set a CIBA PIN.' }} Apps that start a sign-in request for you must send it.</p>\n <input type=\"password\" autocomplete=\"current-password\" placeholder=\"Current password\" aria-label=\"Current password\" [value]=\"password()\" (input)=\"password.set($any($event.target).value)\" />\n <input type=\"password\" inputmode=\"numeric\" autocomplete=\"off\" placeholder=\"6 to 12 digits\" aria-label=\"New CIBA PIN\" [value]=\"newPin()\" (input)=\"newPin.set($any($event.target).value)\" />\n <button [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" type=\"submit\">{{ p.set ? 'Change PIN' : 'Set PIN' }}</button>\n @if (p.set) {\n <button [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" type=\"button\" (click)=\"remove()\">Remove PIN</button>\n }\n @if (message(); as m) {\n <small role=\"status\">{{ m }}</small>\n }\n </form>\n }\n }\n @if (message(); as m) {\n @if (!pin() || !(pin()!.set || pin()!.available)) {\n <small role=\"status\">{{ m }}</small>\n }\n }\n </section>\n }\n `,\n})\nexport class ManageCibaComponent implements OnInit {\n protected readonly atlas = inject(AtlasService);\n protected readonly requests = signal<CibaRequest[]>([]);\n protected readonly pin = signal<CibaPinStatus | null>(null);\n protected readonly newPin = signal('');\n protected readonly password = signal('');\n protected readonly message = signal<string | null>(null);\n private readonly client = this.atlas.createFapiClient();\n\n ngOnInit(): void {\n void this.load();\n }\n\n private async load(): Promise<void> {\n const [r, p] = await Promise.all([listCibaRequests(this.client).catch(() => []), getCibaPin(this.client).catch(() => null)]);\n this.requests.set(r);\n this.pin.set(p);\n }\n\n private async run(fn: () => Promise<unknown>, fallback: string): Promise<void> {\n this.message.set(null);\n try {\n await fn();\n this.newPin.set('');\n this.password.set('');\n await this.load();\n } catch (e) {\n this.message.set(e instanceof Error && e.message ? e.message : fallback);\n }\n }\n\n protected decide(id: string, decision: 'approve' | 'deny'): Promise<void> {\n return this.run(() => decideCibaRequest(this.client, id, decision), decision === 'approve' ? 'Could not approve.' : 'Could not deny.');\n }\n\n protected save(event: Event): Promise<void> {\n event.preventDefault();\n return this.run(() => setCibaPin(this.client, { pin: this.newPin(), currentPassword: this.password() }), 'Could not save the PIN.');\n }\n\n protected remove(): Promise<void> {\n return this.run(() => clearCibaPin(this.client, { currentPassword: this.password() }), 'Could not remove the PIN.');\n }\n\n protected cls(key: ElementKey, base: string): string {\n return classFor(key, this.atlas.appearance, base);\n }\n}\n","import { ChangeDetectionStrategy, Component, inject, signal } from '@angular/core';\nimport { AtlasService } from '../atlas.service';\nimport { classFor, type ElementKey } from '../appearance';\nimport { translate } from '../i18n';\nimport { ManageCibaComponent } from './manage-ciba.component';\n\n/**\n * `<atlas-user-profile>` — the signed-in user's account surface (emails,\n * security). The Angular peer of React's `<UserProfile/>`. Renders nothing when\n * there is no user.\n */\n@Component({\n selector: 'atlas-user-profile',\n standalone: true,\n imports: [ManageCibaComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (atlas.user(); as user) {\n <div [class]=\"cls('card', 'atlas-card')\">\n <h1>{{ t('userProfile.title') }}</h1>\n\n <section>\n <h2>{{ t('userProfile.emailsSection') }}</h2>\n <ul>\n @for (email of user.email_addresses ?? []; track email.id) {\n <li>\n {{ email.email_address }}\n @if (!email.verified) {\n <em> — {{ t('userProfile.unverified') }}</em>\n @if (verifying() === email.id) {\n <span data-atlas=\"email-verify\">\n <input\n [class]=\"cls('formFieldInput', 'atlas-account-input')\"\n inputmode=\"numeric\"\n autocomplete=\"one-time-code\"\n [placeholder]=\"t('userProfile.verifyCodePlaceholder')\"\n [value]=\"code()\"\n (input)=\"code.set($any($event.target).value)\"\n />\n <button\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n type=\"button\"\n [disabled]=\"busy()\"\n (click)=\"confirmCode()\"\n >\n {{ t('userProfile.verifyConfirm') }}\n </button>\n </span>\n } @else {\n <button\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n type=\"button\"\n [disabled]=\"busy()\"\n (click)=\"sendCode(email.id)\"\n >\n {{ t('userProfile.verify') }}\n </button>\n }\n }\n </li>\n }\n </ul>\n @if (verifyError(); as message) {\n <p role=\"alert\">{{ message }}</p>\n }\n </section>\n\n <section>\n <h2>{{ t('userProfile.securitySection') }}</h2>\n <p>{{ user.mfa_enabled ? '2FA on' : '2FA off' }}</p>\n </section>\n\n <atlas-manage-ciba />\n </div>\n }\n `,\n})\nexport class UserProfileComponent {\n protected readonly atlas = inject(AtlasService);\n // An unverified address (added and never confirmed, or the sign-up address on\n // an app that did not require verification) can be proven here: send a code,\n // then enter it.\n protected readonly verifying = signal<string | null>(null);\n protected readonly code = signal('');\n protected readonly busy = signal(false);\n protected readonly verifyError = signal<string | null>(null);\n private readonly client = this.atlas.createFapiClient();\n\n protected async sendCode(id: string): Promise<void> {\n this.verifyError.set(null);\n this.busy.set(true);\n const res = await this.client.post(`/v1/client/me/email_addresses/${id}/prepare_verification`);\n this.busy.set(false);\n if (!res.ok) {\n this.verifyError.set(this.t('userProfile.verifySendFailed'));\n return;\n }\n this.code.set('');\n this.verifying.set(id);\n }\n\n protected async confirmCode(): Promise<void> {\n const id = this.verifying();\n if (!id) return;\n this.verifyError.set(null);\n this.busy.set(true);\n const res = await this.client.post(`/v1/client/me/email_addresses/${id}/attempt_verification`, {\n code: this.code(),\n });\n this.busy.set(false);\n if (!res.ok) {\n this.verifyError.set(this.t('userProfile.verifyCodeRejected'));\n return;\n }\n this.verifying.set(null);\n await this.atlas.reload();\n }\n\n protected t(key: string): string {\n return translate(this.atlas.localization, key);\n }\n\n protected cls(key: ElementKey, base: string): string {\n return classFor(key, this.atlas.appearance, base);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n EventEmitter,\n Output,\n computed,\n effect,\n inject,\n signal,\n untracked,\n} from '@angular/core';\nimport {\n OrganizationProfileController,\n localizedErrorMessage,\n type OrganizationProfileState,\n type OrganizationRequestError,\n} from '@atlasauth/js';\nimport { AtlasService } from '../atlas.service';\nimport { classFor, type ElementKey } from '../appearance';\nimport { translate } from '../i18n';\n\ntype Tab = 'members' | 'invitations' | 'roles' | 'settings';\ntype ProfileRole = OrganizationProfileState['roles'][number];\n\n/**\n * `<atlas-organization-profile>` — the active organization's members (admins\n * change roles and remove), invitations (admins invite, revoke and resend) and\n * settings (leave; an admin deletes after confirming their password). The\n * Angular peer of React's `<OrganizationProfile/>`, on the same headless\n * controller. Every control is gated on the ACTIVE org role, matching the\n * server's rule. Renders nothing with no active org. Emits `exit` with `left`\n * or `deleted`.\n */\n@Component({\n selector: 'atlas-organization-profile',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (atlas.organization(); as membership) {\n @if (state(); as st) {\n <div [class]=\"cls('card', 'atlas-card')\" data-atlas=\"organization-profile\">\n <h1>{{ membership.organization.name }}</h1>\n <p>{{ t('organization.roleLabel') }}: {{ membership.role }}</p>\n\n <div [class]=\"cls('menu', 'atlas-menu')\" role=\"tablist\">\n @for (key of tabs(); track key) {\n <button\n type=\"button\"\n role=\"tab\"\n [attr.aria-selected]=\"tab() === key\"\n [class]=\"cls('menuItem', 'atlas-menu-item')\"\n [attr.data-atlas]=\"'organization-tab-' + key\"\n (click)=\"tab.set(key)\"\n >\n {{ t('organization.' + key) }}\n </button>\n }\n </div>\n\n @if (errorMessage(); as message) {\n <p [class]=\"cls('formFieldError', 'atlas-error')\" role=\"alert\">{{ message }}</p>\n }\n\n @if (tab() === 'members') {\n <ul class=\"atlas-list\" data-atlas=\"organization-members\">\n @for (m of st.members; track m.id) {\n <li data-atlas=\"organization-member\">\n <span>{{ memberName(m) }}{{ m.user?.id === userId() ? ' ' + t('organization.you') : '' }}</span>\n @if (canManage() && m.user && m.user.id !== userId()) {\n <select\n [attr.aria-label]=\"t('organization.roleLabel')\"\n [class]=\"cls('formFieldInput', 'atlas-input')\"\n [disabled]=\"st.busy === 'role:' + m.user.id\"\n (change)=\"changeRole(m.user.id, $any($event.target).value)\"\n >\n @for (r of roles(); track r.key) {\n <option [value]=\"r.key\" [selected]=\"r.key === m.role\">{{ r.name }}</option>\n }\n </select>\n <button\n type=\"button\"\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n [disabled]=\"st.busy === 'remove:' + m.user.id\"\n (click)=\"removeMember(m.user.id)\"\n >\n {{ t('organization.remove') }}\n </button>\n } @else {\n <span> · {{ m.role }}</span>\n }\n </li>\n }\n </ul>\n }\n\n @if (tab() === 'invitations' && canManage()) {\n <div data-atlas=\"organization-invitations\">\n <form (submit)=\"$event.preventDefault(); sendInvite()\">\n <label [class]=\"cls('formField', 'atlas-field')\">\n <span [class]=\"cls('formFieldLabel', 'atlas-field-label')\">{{ t('organization.emailLabel') }}</span>\n <input\n type=\"email\"\n [class]=\"cls('formFieldInput', 'atlas-input')\"\n [value]=\"email()\"\n (input)=\"email.set($any($event.target).value)\"\n />\n </label>\n <label [class]=\"cls('formField', 'atlas-field')\">\n <span [class]=\"cls('formFieldLabel', 'atlas-field-label')\">{{ t('organization.roleLabel') }}</span>\n <select [class]=\"cls('formFieldInput', 'atlas-input')\" (change)=\"inviteRole.set($any($event.target).value)\">\n @for (r of roles(); track r.key) {\n <option [value]=\"r.key\" [selected]=\"r.key === inviteRole()\">{{ r.name }}</option>\n }\n </select>\n </label>\n <button\n type=\"submit\"\n [class]=\"cls('formButtonPrimary', 'atlas-button')\"\n [disabled]=\"st.busy === 'invite' || !email().trim()\"\n >\n {{ t('organization.sendInvite') }}\n </button>\n </form>\n @if (st.invitations.length === 0) {\n <p class=\"atlas-text\">{{ t('organization.noInvitations') }}</p>\n } @else {\n <ul class=\"atlas-list\">\n @for (inv of st.invitations; track inv.id) {\n <li data-atlas=\"organization-invitation\">\n <span>{{ inv.email_address }} · {{ inv.role }}</span>\n <button type=\"button\" [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" (click)=\"resend(inv.id)\">\n {{ t('organization.resend') }}\n </button>\n <button type=\"button\" [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" (click)=\"revoke(inv.id)\">\n {{ t('organization.revoke') }}\n </button>\n </li>\n }\n </ul>\n }\n </div>\n }\n\n @if (tab() === 'roles' && canManage()) {\n <div data-atlas=\"organization-roles\">\n @if (customRoles().length === 0) {\n <p class=\"atlas-text\">{{ t('organization.noCustomRoles') }}</p>\n } @else {\n <ul class=\"atlas-list\">\n @for (role of customRoles(); track role.key) {\n <li data-atlas=\"organization-role\">\n <span>{{ role.name }} · {{ role.key }}</span>\n <button type=\"button\" [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" (click)=\"editRole(role)\">\n {{ t('organization.editRole') }}\n </button>\n <button\n type=\"button\"\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n [disabled]=\"!role.id || st.busy === 'role:delete:' + role.id\"\n (click)=\"deleteRole(role)\"\n >\n {{ t('organization.deleteRole') }}\n </button>\n </li>\n }\n </ul>\n }\n <form data-atlas=\"organization-role-form\" (submit)=\"$event.preventDefault(); saveRole()\">\n @if (!editingRole()) {\n <label [class]=\"cls('formField', 'atlas-field')\">\n <span [class]=\"cls('formFieldLabel', 'atlas-field-label')\">{{ t('organization.roleKey') }}</span>\n <input\n name=\"role_key\"\n [class]=\"cls('formFieldInput', 'atlas-input')\"\n [value]=\"roleKey()\"\n (input)=\"roleKey.set($any($event.target).value)\"\n />\n </label>\n }\n <label [class]=\"cls('formField', 'atlas-field')\">\n <span [class]=\"cls('formFieldLabel', 'atlas-field-label')\">{{ t('organization.roleName') }}</span>\n <input\n name=\"role_name\"\n [class]=\"cls('formFieldInput', 'atlas-input')\"\n [value]=\"roleName()\"\n (input)=\"roleName.set($any($event.target).value)\"\n />\n </label>\n <fieldset [class]=\"cls('formField', 'atlas-field')\">\n <legend [class]=\"cls('formFieldLabel', 'atlas-field-label')\">{{ t('organization.rolePermissions') }}</legend>\n @for (p of st.permissions; track p.key) {\n <label data-atlas=\"organization-role-permission\">\n <input\n type=\"checkbox\"\n [value]=\"p.key\"\n [checked]=\"rolePerms().includes(p.key)\"\n (change)=\"togglePermission(p.key, $any($event.target).checked)\"\n />\n {{ p.name }}\n </label>\n }\n </fieldset>\n <button\n type=\"submit\"\n [class]=\"cls('formButtonPrimary', 'atlas-button')\"\n [disabled]=\"!roleName().trim() || (!editingRole() && !roleKey().trim()) || (st.busy ?? '').startsWith('role:')\"\n >\n {{ editingRole() ? t('organization.saveRole') : t('organization.createRole') }}\n </button>\n @if (editingRole()) {\n <button type=\"button\" [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" (click)=\"resetRoleForm()\">\n {{ t('organization.cancel') }}\n </button>\n }\n </form>\n </div>\n }\n\n @if (tab() === 'settings') {\n <div data-atlas=\"organization-settings\">\n @if (confirm(); as action) {\n <p class=\"atlas-text\">\n {{ t(action === 'leave' ? 'organization.leaveConfirm' : 'organization.deleteConfirm', { name: membership.organization.name }) }}\n </p>\n @if (needsPassword()) {\n <label [class]=\"cls('formField', 'atlas-field')\">\n <span [class]=\"cls('formFieldLabel', 'atlas-field-label')\">{{ t('organization.passwordPrompt') }}</span>\n <input\n type=\"password\"\n autocomplete=\"current-password\"\n [class]=\"cls('formFieldInput', 'atlas-input')\"\n [value]=\"password()\"\n (input)=\"password.set($any($event.target).value)\"\n />\n </label>\n }\n <button\n type=\"button\"\n [class]=\"cls('formButtonPrimary', 'atlas-button')\"\n [disabled]=\"st.busy === 'leave' || st.busy === 'delete'\"\n (click)=\"action === 'leave' ? leave() : remove()\"\n >\n {{ t('organization.confirm') }}\n </button>\n <button type=\"button\" [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" (click)=\"cancel()\">\n {{ t('organization.cancel') }}\n </button>\n } @else {\n <button type=\"button\" [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" (click)=\"confirm.set('leave')\">\n {{ t('organization.leave') }}\n </button>\n @if (isAdmin()) {\n <button type=\"button\" [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" (click)=\"confirm.set('delete')\">\n {{ t('organization.delete') }}\n </button>\n }\n }\n </div>\n }\n </div>\n }\n }\n `,\n})\nexport class OrganizationProfileComponent {\n protected readonly atlas = inject(AtlasService);\n @Output() readonly exit = new EventEmitter<'left' | 'deleted'>();\n\n private readonly client = this.atlas.createFapiClient();\n private controller: OrganizationProfileController | null = null;\n private unsubscribe: (() => void) | null = null;\n\n protected readonly state = signal<OrganizationProfileState | null>(null);\n protected readonly tab = signal<Tab>('members');\n protected readonly email = signal('');\n protected readonly inviteRole = signal('org:member');\n protected readonly confirm = signal<'leave' | 'delete' | null>(null);\n protected readonly needsPassword = signal(false);\n protected readonly password = signal('');\n // The custom-role editor: null = creating, else the id of the role being edited.\n protected readonly editingRole = signal<string | null>(null);\n protected readonly roleKey = signal('');\n protected readonly roleName = signal('');\n protected readonly rolePerms = signal<string[]>([]);\n protected readonly customRoles = computed(() => (this.state()?.roles ?? []).filter((r) => Boolean(r.organization_id)));\n\n protected readonly userId = computed(() => (this.atlas.claims()?.sub as string | undefined) ?? null);\n protected readonly canManage = computed(() => {\n this.atlas.claims();\n return this.atlas.has({ permission: 'org:sys_memberships:manage' });\n });\n protected readonly isAdmin = computed(() => this.atlas.organization()?.role === 'org:admin');\n protected readonly tabs = computed<Tab[]>(() => ['members', ...(this.canManage() ? (['invitations', 'roles'] as Tab[]) : []), 'settings']);\n protected readonly roles = computed(() => {\n const roles = this.state()?.roles ?? [];\n return roles.length > 0 ? roles : [{ key: 'org:member', name: 'org:member' }];\n });\n protected readonly errorMessage = computed(() => {\n const err = this.state()?.error;\n if (!err || (err as OrganizationRequestError).needsReverification) return null;\n return localizedErrorMessage(err, this.atlas.errorLocalization, this.atlas.localization);\n });\n\n constructor() {\n effect(() => {\n const id = this.atlas.organization()?.organization.id ?? null;\n untracked(() => this.bind(id));\n });\n inject(DestroyRef).onDestroy(() => this.unsubscribe?.());\n }\n\n private bind(id: string | null) {\n if (this.controller?.organizationId === id) return;\n this.unsubscribe?.();\n this.controller = null;\n this.state.set(null);\n if (!id) return;\n const controller = new OrganizationProfileController(this.client, id, {\n canManage: this.canManage(),\n onChange: async () => {\n await this.atlas.reload();\n },\n });\n this.controller = controller;\n this.unsubscribe = controller.subscribe((next) => this.state.set(next));\n this.state.set(controller.getState());\n void controller.load();\n }\n\n protected t(key: string, vars?: Record<string, string>): string {\n return translate(this.atlas.localization, key, vars);\n }\n\n protected cls(key: ElementKey, base: string): string {\n return classFor(key, this.atlas.appearance, base);\n }\n\n protected memberName(m: OrganizationProfileState['members'][number]): string {\n return [m.user?.first_name, m.user?.last_name].filter(Boolean).join(' ') || this.t('organization.unnamedMember');\n }\n\n protected changeRole(userId: string, role: string) {\n void this.controller?.changeRole(userId, role);\n }\n\n protected removeMember(userId: string) {\n void this.controller?.removeMember(userId);\n }\n\n protected async sendInvite() {\n const address = this.email().trim();\n if (this.controller && address && (await this.controller.invite(address, this.inviteRole()))) this.email.set('');\n }\n\n protected resend(id: string) {\n void this.controller?.resendInvitation(id);\n }\n\n protected revoke(id: string) {\n void this.controller?.revokeInvitation(id);\n }\n\n protected async leave() {\n if (this.controller && (await this.controller.leave())) this.exit.emit('left');\n this.confirm.set(null);\n }\n\n protected async remove() {\n const controller = this.controller;\n if (!controller) return;\n if (this.needsPassword()) {\n try {\n await this.atlas.reauthenticate(this.password());\n } catch {\n return;\n }\n this.password.set('');\n this.needsPassword.set(false);\n }\n if (await controller.deleteOrganization()) {\n this.exit.emit('deleted');\n this.confirm.set(null);\n return;\n }\n const err = controller.getState().error as OrganizationRequestError | null;\n if (err?.needsReverification) this.needsPassword.set(true);\n }\n\n protected editRole(role: ProfileRole) {\n this.editingRole.set(role.id ?? null);\n this.roleKey.set(role.key);\n this.roleName.set(role.name);\n this.rolePerms.set([...(role.permissions ?? [])]);\n }\n\n protected resetRoleForm() {\n this.editingRole.set(null);\n this.roleKey.set('');\n this.roleName.set('');\n this.rolePerms.set([]);\n }\n\n protected togglePermission(key: string, on: boolean) {\n this.rolePerms.update((current) => (on ? [...current, key] : current.filter((k) => k !== key)));\n }\n\n protected async saveRole() {\n const controller = this.controller;\n if (!controller) return;\n const editing = this.editingRole();\n const out = editing\n ? await controller.updateRole(editing, { name: this.roleName().trim(), permissions: this.rolePerms() })\n : await controller.createRole({ key: this.roleKey().trim(), name: this.roleName().trim(), permissions: this.rolePerms() });\n if (out) this.resetRoleForm();\n }\n\n protected deleteRole(role: ProfileRole) {\n if (role.id) void this.controller?.deleteRole(role.id);\n }\n\n protected cancel() {\n this.confirm.set(null);\n this.needsPassword.set(false);\n this.password.set('');\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n Input,\n inject,\n type OnDestroy,\n type OnInit,\n} from '@angular/core';\nimport { describeAuditAction } from '@atlasauth/js';\nimport { AtlasService } from '../atlas.service';\nimport { classFor, type ElementKey } from '../appearance';\nimport type { AtlasOrganizationAuditLog } from './organization-audit-log';\n\n/**\n * `<atlas-organization-audit-log>` — the active organization's audit trail for\n * its admins, next to `<atlas-organization-profile>`. The Angular peer of\n * React's `<OrganizationAuditLog/>`. Renders nothing for a member who may not\n * read it (the server is the authority; the component just follows it). Labels\n * are inputs so an app can localise them.\n */\n@Component({\n selector: 'atlas-organization-audit-log',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (atlas.organization() && !log.state().forbidden) {\n <div [class]=\"cls('card', 'atlas-card')\" data-atlas=\"organization-audit-log\">\n <h2 [class]=\"cls('headerTitle', 'atlas-title')\">{{ labels.title ?? 'Audit log' }}</h2>\n @if (log.state().entries.length === 0 && !log.state().loading) {\n <p [class]=\"cls('headerSubtitle', 'atlas-subtitle')\">{{ labels.empty ?? 'No activity recorded yet.' }}</p>\n } @else {\n <ul [class]=\"cls('list', 'atlas-audit-list')\">\n @for (entry of log.state().entries; track entry.id) {\n <li [class]=\"cls('listItem', 'atlas-audit-item')\" [attr.data-action]=\"entry.action\">\n <strong>{{ describe(entry.action) }}</strong>\n <span class=\"atlas-audit-meta\">\n · {{ formatDate(entry.created_at) }}{{ entry.actor.id ? ' · ' + (labels.actor ?? 'by') + ' ' + entry.actor.type + ' ' + entry.actor.id : '' }}\n </span>\n </li>\n }\n </ul>\n }\n @if (log.state().hasMore) {\n <button\n type=\"button\"\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n [disabled]=\"log.state().loading\"\n (click)=\"log.loadMore()\"\n >\n {{ labels.loadMore ?? 'Load more' }}\n </button>\n }\n </div>\n }\n `,\n})\nexport class OrganizationAuditLogComponent implements OnInit, OnDestroy {\n /** Entries per page (the server caps it). */\n @Input() pageSize?: number;\n /** Narrow to one action, or a prefix ending in `.`. */\n @Input() action?: string;\n @Input() labels: { title?: string; empty?: string; loadMore?: string; actor?: string } = {};\n @Input() formatDate: (ms: number) => string = (ms) => new Date(ms).toLocaleString();\n\n protected readonly atlas = inject(AtlasService);\n /** Created in ngOnInit, once the inputs are set (templates render after it). */\n protected log!: AtlasOrganizationAuditLog;\n\n ngOnInit(): void {\n this.log = this.atlas.organizationAuditLog({ pageSize: this.pageSize, action: this.action });\n }\n\n ngOnDestroy(): void {\n this.log.destroy();\n }\n\n protected describe(action: string): string {\n return describeAuditAction(action);\n }\n\n protected cls(key: ElementKey, base: string): string {\n return classFor(key, this.atlas.appearance, base);\n }\n}\n","import { AtlasSignedInDirective } from './directives/signed-in.directive';\nimport { AtlasSignedOutDirective } from './directives/signed-out.directive';\nimport { AtlasLoadingDirective } from './directives/loading.directive';\nimport { AtlasLoadedDirective } from './directives/loaded.directive';\nimport { AtlasProtectDirective } from './directives/protect.directive';\nimport { AtlasRootDirective } from './directives/atlas-root.directive';\nimport { SignInComponent } from './components/sign-in.component';\nimport { SignUpComponent } from './components/sign-up.component';\nimport { UserButtonComponent } from './components/user-button.component';\nimport { OrganizationSwitcherComponent } from './components/organization-switcher.component';\nimport { UserProfileComponent } from './components/user-profile.component';\nimport { OrganizationProfileComponent } from './components/organization-profile.component';\nimport { OrganizationAuditLogComponent } from './components/organization-audit-log.component';\nimport { ManageCibaComponent } from './components/manage-ciba.component';\nimport { AtlasPoliciesDirective, PolicyAcceptStepComponent, PolicyGateComponent } from './components/policy-host';\n\n/**\n * Every standalone directive and component the SDK ships. Import the array in a\n * standalone component's `imports`, or rely on `AtlasModule` re-exporting it for\n * NgModule-based apps:\n *\n * ```ts\n * @Component({ standalone: true, imports: [...ATLAS_UI], template: '…' })\n * ```\n */\nexport const ATLAS_UI = [\n AtlasSignedInDirective,\n AtlasSignedOutDirective,\n AtlasLoadingDirective,\n AtlasLoadedDirective,\n AtlasProtectDirective,\n AtlasRootDirective,\n SignInComponent,\n SignUpComponent,\n UserButtonComponent,\n OrganizationSwitcherComponent,\n UserProfileComponent,\n OrganizationProfileComponent,\n OrganizationAuditLogComponent,\n ManageCibaComponent,\n AtlasPoliciesDirective,\n PolicyAcceptStepComponent,\n PolicyGateComponent,\n] as const;\n","import {\n ENVIRONMENT_INITIALIZER,\n EnvironmentProviders,\n ModuleWithProviders,\n NgModule,\n Provider,\n inject,\n makeEnvironmentProviders,\n} from '@angular/core';\nimport { ATLAS_OPTIONS, type AtlasOptions } from './atlas.config';\nimport { AtlasService } from './atlas.service';\nimport { ATLAS_UI } from './atlas.ui';\n\n/**\n * Standalone-provider entry point (Angular 17+). Register Atlas once at the\n * application root — the direct analogue of wrapping the tree in React's\n * `<AtlasProvider publishableKey>`:\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideAtlas({ publishableKey: 'pk_test_…' }),\n * provideRouter(routes),\n * ],\n * });\n * ```\n *\n * The returned providers make {@link AtlasService} injectable and eagerly\n * construct it, so the SDK begins its first boot (redirect-completion + session\n * read) as soon as the app starts — matching the React provider mounting on the\n * first render.\n */\nexport function provideAtlas(options: AtlasOptions): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: ATLAS_OPTIONS, useValue: options },\n AtlasService,\n {\n // Eagerly instantiate AtlasService so its boot runs at startup rather than\n // lazily on first injection — the equivalent of the provider mounting.\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useValue: () => {\n inject(AtlasService);\n },\n },\n ]);\n}\n\n/**\n * NgModule entry point for apps not yet on the standalone bootstrap. Import\n * `AtlasModule.forRoot({ publishableKey })` once in the root module; feature\n * modules import `AtlasModule` (no args) to use the directives/components.\n */\n@NgModule({\n // Standalone directives/components are re-exported so NgModule consumers get\n // them just by importing AtlasModule, the way they would with a classic module.\n imports: [...ATLAS_UI],\n exports: [...ATLAS_UI],\n})\nexport class AtlasModule {\n static forRoot(options: AtlasOptions): ModuleWithProviders<AtlasModule> {\n const providers: Provider[] = [\n { provide: ATLAS_OPTIONS, useValue: options },\n AtlasService,\n {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useValue: () => {\n inject(AtlasService);\n },\n },\n ];\n return { ngModule: AtlasModule, providers };\n }\n}\n","import { ChangeDetectionStrategy, Component, EventEmitter, Output, computed, inject, signal } from '@angular/core';\nimport { actorFromClaims, type EndImpersonationResult } from '@atlasauth/js';\nimport { AtlasService } from '../atlas.service';\nimport { classFor, type ElementKey } from '../appearance';\nimport { translate } from '../i18n';\n\n/**\n * `<atlas-impersonation-banner>` — shown only while the active session is an\n * impersonation, naming the user acted as, with \"Return to admin\" (or \"End\n * impersonation\" when there is no session of the impersonator's to resume).\n * Emits `ended` with the outcome. The Angular peer of React's\n * `<ImpersonationBanner/>`.\n */\n@Component({\n selector: 'atlas-impersonation-banner',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (actor()) {\n <div [class]=\"cls('card', 'atlas-alert atlas-impersonation-banner')\" role=\"status\">\n <span [class]=\"cls('headerSubtitle', 'atlas-text')\">{{ t('impersonation.banner', { name: name() }) }}</span>\n <button type=\"button\" [class]=\"cls('formButtonPrimary', 'atlas-button')\" [disabled]=\"busy()\" (click)=\"end()\">\n {{ canReturn() ? t('impersonation.returnToAdmin') : t('impersonation.end') }}\n </button>\n </div>\n }\n `,\n})\nexport class ImpersonationBannerComponent {\n protected readonly atlas = inject(AtlasService);\n @Output() readonly ended = new EventEmitter<EndImpersonationResult>();\n protected readonly busy = signal(false);\n\n protected readonly actor = computed(\n () => actorFromClaims(this.atlas.claims()) ?? this.atlas.session()?.actor ?? null,\n );\n protected readonly canReturn = computed(\n () => this.actor() !== null && Boolean(this.atlas.session()?.actor_session_id),\n );\n protected readonly name = computed(() => {\n const u = this.atlas.user();\n return (\n [u?.first_name, u?.last_name].filter(Boolean).join(' ') ||\n u?.username ||\n u?.email_addresses?.find((e) => e.primary)?.email_address ||\n u?.id ||\n ''\n );\n });\n\n protected t(key: string, vars?: Record<string, string>): string {\n return translate(this.atlas.localization, key, vars);\n }\n\n protected cls(key: ElementKey, base: string): string {\n return classFor(key, this.atlas.appearance, base);\n }\n\n protected async end(): Promise<void> {\n this.busy.set(true);\n try {\n this.ended.emit(await this.atlas.endImpersonation());\n } finally {\n this.busy.set(false);\n }\n }\n}\n","import { inject } from '@angular/core';\nimport {\n CanActivateChildFn,\n CanActivateFn,\n Router,\n type UrlTree,\n} from '@angular/router';\nimport { firstValueFrom } from 'rxjs';\nimport { filter, take } from 'rxjs/operators';\nimport { evaluate, type ProtectCondition } from '@atlasauth/authz';\nimport { AtlasService } from '../atlas.service';\n\nexport interface AtlasGuardOptions extends ProtectCondition {\n /**\n * Where to send a user who fails the check. When set, the guard returns a\n * `UrlTree` (a redirect); when omitted it simply returns `false` and the\n * navigation is cancelled. A common value is your sign-in route.\n */\n redirectTo?: string;\n /**\n * When true, append the attempted URL as a `redirect_url` query param on the\n * `redirectTo` target, so the sign-in page can send the user back afterwards.\n * Ignored unless `redirectTo` is set. Defaults to true.\n */\n preserveReturnUrl?: boolean;\n}\n\n/**\n * Route guard factory that gates a route on session — and optionally on a\n * permission/role. The Angular peer of using `<SignedIn>` / `<Protect>` to fence\n * a page, expressed as a `CanActivateFn`.\n *\n * ```ts\n * export const routes: Routes = [\n * { path: 'dashboard', canActivate: [atlasGuard({ redirectTo: '/sign-in' })], ... },\n * {\n * path: 'admin',\n * canActivate: [atlasGuard({ permission: 'org:admin', redirectTo: '/' })],\n * ...\n * },\n * ];\n * ```\n *\n * The guard first waits for the SDK to finish booting, so a hard refresh onto a\n * protected URL does not bounce to sign-in before the session has been read.\n * Like the components, this is UX, not security: the server enforces the same\n * checks on every request.\n */\nexport function atlasGuard(options: AtlasGuardOptions = {}): CanActivateFn {\n const { redirectTo, preserveReturnUrl = true, ...condition } = options;\n\n return async (_route, state): Promise<boolean | UrlTree> => {\n const atlas = inject(AtlasService);\n const router = inject(Router);\n\n // Wait for boot to settle so we judge against a real answer, not `loading`.\n await firstValueFrom(\n atlas.status$.pipe(\n filter((s) => s !== 'loading'),\n take(1),\n ),\n );\n\n const allowed = evaluate(atlas.claims(), condition as ProtectCondition).allowed;\n if (allowed) return true;\n\n if (redirectTo) {\n return router.createUrlTree([redirectTo], {\n queryParams: preserveReturnUrl ? { redirect_url: state.url } : undefined,\n });\n }\n return false;\n };\n}\n\n/**\n * The `CanActivateChild` form of {@link atlasGuard}, for gating a whole child\n * route subtree with one declaration.\n */\nexport function atlasChildGuard(options: AtlasGuardOptions = {}): CanActivateChildFn {\n const guard = atlasGuard(options);\n return (route, state) => guard(route, state);\n}\n","/**\n * Conditional-rendering authorization primitive — re-exported unchanged from\n * `@atlasauth/authz`, the ONE evaluator every Atlas SDK shares. `*atlasProtect` in\n * this package and `<Protect>` in `@atlasauth/react` therefore judge a condition\n * identically, and the server checking the same permission is what actually\n * stops a request; these helpers only decide what a user is shown.\n */\nexport {\n type ProtectCondition,\n type ProtectOutcome,\n type ProtectReason,\n evaluate,\n hasFromClaims,\n} from '@atlasauth/authz';\n","/**\n * Public data shapes, mirrored 1:1 from `@atlasauth/react`'s `types.ts` so an app\n * can move between the React and Angular SDKs without re-typing its models.\n */\n\nexport interface SessionClaims {\n sub: string;\n sid: string;\n exp: number;\n org_id?: string;\n org_slug?: string;\n org_role?: string;\n org_permissions?: string[];\n mfa?: boolean;\n [claim: string]: unknown;\n}\n\nexport interface AtlasUser {\n id: string;\n first_name: string | null;\n last_name: string | null;\n username: string | null;\n image_url: string | null;\n public_metadata: Record<string, unknown>;\n unsafe_metadata: Record<string, unknown>;\n mfa_enabled: boolean;\n has_password: boolean;\n email_addresses?: Array<{\n id: string;\n email_address: string;\n verified: boolean;\n primary: boolean;\n }>;\n}\n\nexport interface AtlasOrganizationMembership {\n role: string;\n organization: {\n id: string;\n name: string;\n slug: string;\n image_url: string | null;\n };\n}\n\nexport interface AtlasSession {\n id: string;\n status: string;\n last_active_organization_id: string | null;\n /** On an impersonation session: who is acting (the token's `act` claim). */\n actor?: { sub: string } | null;\n /** On an impersonation session: the impersonator's own session that \"return to admin\" resumes, or null. */\n actor_session_id?: string | null;\n}\n\n/** The three-state auth lifecycle, identical to the React provider's. */\nexport type AuthStatus = 'loading' | 'signed_in' | 'signed_out';\n","/**\n * The FAPI client and the server-driven sign-in flow driver live in `@atlasauth/js`\n * — the pure, framework-agnostic browser flow. This thin re-export lets the\n * Angular components, guards and services resolve the driver from one place, so\n * the Angular `<atlas-sign-in>` and the React `<SignIn/>` drive the exact same\n * endpoints and cannot diverge in what the server sees.\n */\nexport {\n FapiClient,\n advance,\n prepareFactor,\n pollAttempt,\n shouldKeepPolling,\n requestForStep,\n flowFromPending,\n initialFlow,\n getProviderToken,\n type FapiClientOptions,\n type FapiResponse,\n type FlowState,\n type ProviderToken,\n} from '@atlasauth/js';\n","/**\n * `@atlasauth/angular` — the official Angular SDK for Atlas, the Angular peer of\n * `@atlasauth/react`. Public surface.\n */\n\n// Configuration + DI\nexport { ATLAS_OPTIONS, type AtlasOptions } from './lib/atlas.config';\nexport { provideAtlas, AtlasModule } from './lib/provide-atlas';\n\n// Core service (the AtlasProvider + hooks equivalent)\nexport { AtlasService } from './lib/atlas.service';\n\n// Structural directives + the theming host directive\nexport { AtlasSignedInDirective } from './lib/directives/signed-in.directive';\nexport { AtlasSignedOutDirective } from './lib/directives/signed-out.directive';\nexport { AtlasLoadingDirective } from './lib/directives/loading.directive';\nexport { AtlasLoadedDirective } from './lib/directives/loaded.directive';\nexport { AtlasProtectDirective } from './lib/directives/protect.directive';\nexport { AtlasRootDirective } from './lib/directives/atlas-root.directive';\n\n// Components\nexport { SignInComponent } from './lib/components/sign-in.component';\nexport { SignUpComponent } from './lib/components/sign-up.component';\nexport { UserButtonComponent } from './lib/components/user-button.component';\nexport { OrganizationSwitcherComponent } from './lib/components/organization-switcher.component';\nexport { UserProfileComponent } from './lib/components/user-profile.component';\nexport { OrganizationProfileComponent } from './lib/components/organization-profile.component';\nexport { ManageCibaComponent } from './lib/components/manage-ciba.component';\nexport { OrganizationAuditLogComponent } from './lib/components/organization-audit-log.component';\nexport { AtlasOrganizationAuditLog } from './lib/components/organization-audit-log';\nexport type { OrganizationAuditLogEntry, OrganizationAuditLogState, OrganizationAuditLogOptions } from '@atlasauth/js';\nexport { ImpersonationBannerComponent } from './lib/components/impersonation-banner.component';\nexport { AttemptFlowComponent } from './lib/components/attempt-flow.component';\nexport {\n SignUpFormComponent,\n type SignUpFormSubmit,\n} from './lib/components/sign-up-form.component';\nexport { AtlasCaptchaSlotDirective } from './lib/directives/captcha-slot.directive';\n// Policy acceptance (terms, privacy, any policy): consent block / clickwrap host, sign-in step, in-app gate.\nexport { AtlasPoliciesDirective, PolicyAcceptStepComponent, PolicyGateComponent } from './lib/components/policy-host';\nexport { AtlasFlowController } from './lib/components/flow-controller';\nexport { ATLAS_UI } from './lib/atlas.ui';\n\n// Route guards\nexport {\n atlasGuard,\n atlasChildGuard,\n type AtlasGuardOptions,\n} from './lib/guards/atlas.guard';\n\n// Theming, i18n, authorization, data shapes, FAPI re-exports\nexport * from './lib/appearance';\nexport * from './lib/i18n';\nexport * from './lib/protect';\nexport * from './lib/types';\nexport * from './lib/fapi';\n\n// The instance's public sign-in / sign-up settings the prebuilt forms read\n// (`AtlasFlowController.settings`), and the captcha types they render.\nexport type {\n InstanceSettings,\n PublicSignUpField,\n CaptchaController,\n CaptchaFlowKey,\n CaptchaWidgetMode,\n FlowCaptcha,\n EmailDelivery,\n SignOutOptions,\n SignOutResult,\n} from '@atlasauth/js';\n\n// `AtlasService.signOut()` resolves a `SignOutResult`; `{ strict: true }`\n// rejects with a `SignOutError` when the revoke was never confirmed.\nexport { SignOutError } from '@atlasauth/js';\n\n// `onSignOut({ reason })` event types + the `atlas:signout` window event; this SDK's version.\nexport { SIGN_OUT_EVENT, onAtlasSignOut } from '@atlasauth/js';\nexport type { SignOutEvent, SignOutReason } from '@atlasauth/js';\nexport { ATLAS_ANGULAR_SDK, ATLAS_ANGULAR_VERSION } from './lib/version';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["fetchProviderToken","hostedSignUp","i1.AtlasSignedInDirective","i2.AtlasSignedOutDirective","i3.AtlasLoadingDirective","i4.AtlasLoadedDirective","i5.AtlasProtectDirective","i6.AtlasRootDirective","i7.SignInComponent","i8.SignUpComponent","i9.UserButtonComponent","i10.OrganizationSwitcherComponent","i11.UserProfileComponent","i12.OrganizationProfileComponent","i13.OrganizationAuditLogComponent","i14.ManageCibaComponent","i15.AtlasPoliciesDirective","i15.PolicyAcceptStepComponent","i15.PolicyGateComponent"],"mappings":";;;;;;;;;;;;;;AAoDA;;;;AAIG;MACU,aAA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,MAAM,EAAE,UAAU,EAAE,iBAAiB,GAAG,IAAI,EAAE,GAAG,SAAS,EAAE,GAAG,OAAO;AAEtE,IAAA,OAAO,OAAO,MAAM,EAAE,KAAK,KAAgC;AACzD,QAAA,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC;AAClC,QAAA,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;;QAG7B,MAAM,cAAc,CAClB,KAAK,CAAC,OAAO,CAAC,IAAI,CAChB,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC,EAC9B,IAAI,CAAC,CAAC,CAAC,CACR,CACF;AAED,QAAA,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,SAA6B,CAAC,CAAC,OAAO;AAC/E,QAAA,IAAI,OAAO;AAAE,YAAA,OAAO,IAAI;QAExB,IAAI,UAAU,EAAE;AACd,YAAA,OAAO,MAAM,CAAC,aAAa,CAAC,CAAC,UAAU,CAAC,EAAE;AACxC,gBAAA,WAAW,EAAE,iBAAiB,GAAG,EAAE,YAAY,EAAE,KAAK,CAAC,GAAG,EAAE,GAAG,SAAS;AACzE,aAAA,CAAC;QACJ;AACA,QAAA,OAAO,KAAK;AACd,IAAA,CAAC;AACH;AAEA;;;AAGG;AACG,SAAU,eAAe,CAAC,OAAA,GAA6B,EAAE,EAAA;AAC7D,IAAA,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC;AACjC,IAAA,OAAO,CAAC,KAAK,EAAE,KAAK,KAAK,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC;AAC9C;;AClFA;;;;;;AAMG;;ACNH;;;AAGG;;ACHH;;;;;;AAMG;;ACNH;;;AAGG;AAEH;;ACLA;;AAEG;;;;"}
1
+ {"version":3,"file":"atlasauth-angular.mjs","sources":["../../src/lib/atlas.config.ts","../../src/lib/components/organization-audit-log.ts","../../src/lib/appearance.ts","../../src/lib/i18n.ts","../../src/lib/version.ts","../../src/lib/atlas.service.ts","../../src/lib/directives/toggle.directive.ts","../../src/lib/directives/signed-in.directive.ts","../../src/lib/directives/signed-out.directive.ts","../../src/lib/directives/loading.directive.ts","../../src/lib/directives/loaded.directive.ts","../../src/lib/directives/protect.directive.ts","../../src/lib/directives/atlas-root.directive.ts","../../src/lib/directives/captcha-slot.directive.ts","../../src/lib/components/policy-host.ts","../../src/lib/components/attempt-flow.component.ts","../../src/lib/components/recovery-codes.component.ts","../../src/lib/components/flow-controller.ts","../../src/lib/components/sign-in.component.ts","../../src/lib/components/sign-up-form.component.ts","../../src/lib/components/sign-up.component.ts","../../src/lib/components/user-button.component.ts","../../src/lib/components/organization-switcher.component.ts","../../src/lib/components/manage-ciba.component.ts","../../src/lib/components/user-profile.component.ts","../../src/lib/components/organization-profile.component.ts","../../src/lib/components/organization-audit-log.component.ts","../../src/lib/atlas.ui.ts","../../src/lib/provide-atlas.ts","../../src/lib/components/impersonation-banner.component.ts","../../src/lib/guards/atlas.guard.ts","../../src/lib/protect.ts","../../src/lib/types.ts","../../src/lib/fapi.ts","../../src/public-api.ts","../../src/atlasauth-angular.ts"],"sourcesContent":["import type { ReferralConsent, SignOutEvent } from '@atlasauth/js';\nimport { InjectionToken } from '@angular/core';\nimport type { Appearance } from './appearance';\nimport type { Catalog } from './i18n';\n\n/**\n * Configuration for the Atlas Angular SDK — the Angular analogue of the props\n * passed to React's `<AtlasProvider>`.\n */\nexport interface AtlasOptions {\n /** The instance's publishable key (`pk_…`). Required. */\n publishableKey: string;\n /**\n * Referral attribution: the prebuilt forms send the referral the visitor\n * arrived with on sign-in / sign-up when the instance has referrals on.\n * `false` turns that off.\n */\n referral?: false;\n /**\n * The app's own consent decision for the referral tracking cookie, used only\n * when Cookie Munch is not on the page: `'granted'` (or a function returning\n * it) lets the forms read the cookie. Default: the cookie is not read.\n */\n referralConsent?: ReferralConsent;\n /**\n * The instance's Frontend API: an absolute URL such as\n * `\"https://auth.example.com\"`, or `\"same-origin\"` / a path such as `\"/atlas\"`\n * behind a reverse proxy on the app's own origin (requests then go to\n * `/v1/...` on the app's host). Required at runtime — `AtlasService` throws an\n * `AtlasConfigError` (`FRONTEND_API_REQUIRED` / `FRONTEND_API_INVALID`) when\n * it is missing or malformed. Optional in the type only so existing call sites\n * keep compiling.\n */\n frontendApi?: string;\n /** Design tokens + per-element class overrides. See {@link Appearance}. */\n appearance?: Appearance;\n /** A localization catalog merged over `en-US`. */\n localization?: Catalog;\n /**\n * A `fetch` implementation to use instead of the global one — handy for SSR\n * or tests. Defaults to `globalThis.fetch`.\n */\n fetchImpl?: typeof fetch;\n /**\n * Called once each time a signed-in user becomes signed out, on every path:\n * `reason` is `user`, `other_tab`, `session_expired`, `revoked` (ended\n * elsewhere, seen on the next refresh) or `unknown`. See also\n * `AtlasService.signOut$`.\n */\n onSignOut?: (event: SignOutEvent) => void;\n}\n\n/**\n * DI token carrying the resolved {@link AtlasOptions}. Populated by\n * {@link provideAtlas} (standalone) or {@link AtlasModule.forRoot} (NgModule)\n * and read by {@link AtlasService}. Applications rarely inject this directly.\n */\nexport const ATLAS_OPTIONS = new InjectionToken<AtlasOptions>('ATLAS_OPTIONS');\n","import { signal, type Signal, type WritableSignal } from '@angular/core';\nimport type { Observable, Subscription } from 'rxjs';\nimport { distinctUntilChanged, map } from 'rxjs/operators';\nimport {\n createOrganizationAuditLog,\n type FapiClient,\n type OrganizationAuditLogController,\n type OrganizationAuditLogOptions,\n type OrganizationAuditLogState,\n} from '@atlasauth/js';\nimport type { AtlasOrganizationMembership } from '../types';\n\n/**\n * The active organization's audit trail, for its admins — the engine behind\n * `<atlas-organization-audit-log>` and `AtlasService.organizationAuditLog()`\n * (the Angular peer of React's `useOrganizationAuditLog`). `state` is a signal\n * of `{ entries, loading, forbidden, hasMore }`, one page at a time, newest\n * first. It follows the active organization until {@link destroy}.\n */\nexport class AtlasOrganizationAuditLog {\n private readonly _state: WritableSignal<OrganizationAuditLogState>;\n private readonly log: OrganizationAuditLogController;\n private readonly unsubscribe: () => void;\n private readonly organizationSub: Subscription;\n\n readonly state: Signal<OrganizationAuditLogState>;\n\n constructor(\n client: Pick<FapiClient, 'get'>,\n organization$: Observable<AtlasOrganizationMembership | null>,\n options: OrganizationAuditLogOptions = {},\n ) {\n this.log = createOrganizationAuditLog(client, options);\n this._state = signal(this.log.getState());\n this.state = this._state.asReadonly();\n this.unsubscribe = this.log.subscribe((next) => this._state.set(next));\n this.organizationSub = organization$\n .pipe(\n map((membership) => membership?.organization.id ?? null),\n distinctUntilChanged(),\n )\n .subscribe((id) => void this.log.load(id));\n }\n\n /** Append the next page, when there is one. */\n loadMore(): Promise<void> {\n return this.log.loadMore();\n }\n\n /** Re-read from the newest entry. */\n reload(): Promise<void> {\n return this.log.reload();\n }\n\n /** Stop following the active organization. */\n destroy(): void {\n this.organizationSub.unsubscribe();\n this.unsubscribe();\n }\n}\n","/**\n * §10.3 theming.\n *\n * \"appearance prop: design tokens (colors, radius, font, spacing) + per-element\n * class overrides (elements: { formButtonPrimary: \"…\" }). No iframe — components\n * render in the host DOM so Tailwind/CSS just works.\"\n *\n * Rendering in the host DOM is the decision everything else follows from. An\n * iframe would isolate styles perfectly and be unusable: it cannot be sized to\n * its content reliably, it breaks password managers, it breaks autofill, and a\n * Tailwind class the customer writes has no effect inside it. Sharing the DOM\n * means the customer's CSS reaches our markup, which is exactly what they want\n * and what makes an override system necessary rather than decorative.\n *\n * Element classes are APPENDED to ours, never replacing them. A customer adding\n * `className=\"rounded-xl\"` wants a rounder button, not an unstyled one — and\n * replacement is a support burden where every override starts by rebuilding the\n * component's base styles from scratch.\n */\n\nimport {\n renderDesignAppearance,\n type AppearanceRender,\n type DesignAppearance,\n type DesignWarn,\n type InstanceDesign,\n} from '@atlasauth/design/runtime';\n\nexport { instanceDesignFrom } from '@atlasauth/design/runtime';\nexport type { AppearanceRender, AtlasDesign, InstanceDesign, PresetId } from '@atlasauth/design/runtime';\n\nexport interface DesignTokens {\n colorPrimary?: string;\n colorText?: string;\n colorBackground?: string;\n colorDanger?: string;\n colorBorder?: string;\n borderRadius?: string;\n fontFamily?: string;\n spacingUnit?: string;\n}\n\n/** Every element a customer may target. Named for what it IS, not where it sits. */\nexport type ElementKey =\n | 'root'\n | 'card'\n | 'headerTitle'\n | 'headerSubtitle'\n | 'formField'\n | 'formFieldLabel'\n | 'formFieldInput'\n | 'formFieldError'\n | 'formButtonPrimary'\n | 'formButtonSecondary'\n | 'socialButton'\n | 'dividerText'\n | 'footerAction'\n | 'avatar'\n | 'menu'\n | 'menuItem'\n | 'list'\n | 'listItem'\n | 'badge';\n\nexport interface Appearance extends DesignAppearance {\n /** A prebuilt token theme to start from (pre-design-system themes). */\n baseTheme?: keyof typeof THEMES;\n /**\n * Legacy design tokens. Without a design they set the `--atlas-*` variables\n * exactly as before; with one they map onto it.\n */\n variables?: DesignTokens;\n elements?: Partial<Record<ElementKey, string>>;\n // From DesignAppearance:\n // preset?: PresetId a design preset (replaces the dashboard design as the base)\n // design?: AtlasDesign structured overrides, highest precedence\n // instanceDesign?: boolean apply the dashboard design automatically (default true)\n}\n\nexport const DEFAULT_TOKENS: Required<DesignTokens> = {\n colorPrimary: '#5b5bd6',\n colorText: '#1c1c1f',\n colorBackground: '#ffffff',\n colorDanger: '#c53030',\n colorBorder: '#e4e4e9',\n borderRadius: '8px',\n fontFamily: 'ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", sans-serif',\n spacingUnit: '4px',\n};\n\n/**\n * §10.3: \"prebuilt themes shipped (default, dark, neobrutalist as a demo of the\n * override system)\". Neobrutalist exists to prove the token set is expressive\n * enough for a theme that looks nothing like the default — a theming system\n * that only produces tasteful variations of itself is not a theming system.\n */\nexport const THEMES = {\n default: DEFAULT_TOKENS,\n dark: {\n ...DEFAULT_TOKENS,\n colorText: '#e6e9ef',\n colorBackground: '#14171c',\n colorBorder: '#242932',\n colorPrimary: '#6ea8fe',\n },\n neobrutalist: {\n ...DEFAULT_TOKENS,\n colorPrimary: '#ffe600',\n colorText: '#000000',\n colorBackground: '#ffffff',\n colorBorder: '#000000',\n borderRadius: '0px',\n fontFamily: '\"Courier New\", ui-monospace, monospace',\n },\n} as const satisfies Record<string, Required<DesignTokens>>;\n\n/**\n * Resolve tokens: defaults, then the base theme, then explicit variables.\n *\n * Later wins, and `undefined` never overwrites. A customer setting one variable\n * on the dark theme expects the other eleven to stay dark, not silently revert\n * to the light defaults.\n */\nexport function resolveTokens(appearance?: Appearance): Required<DesignTokens> {\n const base = appearance?.baseTheme ? THEMES[appearance.baseTheme] : DEFAULT_TOKENS;\n const overrides = appearance?.variables ?? {};\n\n const resolved = { ...DEFAULT_TOKENS, ...base };\n for (const [key, value] of Object.entries(overrides)) {\n if (value !== undefined) resolved[key as keyof DesignTokens] = value;\n }\n return resolved;\n}\n\n/** Tokens as CSS custom properties, for the host DOM to inherit. */\nexport function cssVariables(tokens: Required<DesignTokens>): Record<string, string> {\n const vars: Record<string, string> = {};\n for (const [key, value] of Object.entries(tokens)) {\n // camelCase → --atlas-kebab-case, which is what a customer writes in CSS.\n vars[`--atlas-${key.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)}`] = value;\n }\n return vars;\n}\n\n/**\n * Combine our base class with the customer's override.\n *\n * Appended, never replaced — a customer adding `rounded-xl` wants a rounder\n * button, not an unstyled one. Theirs comes last so it wins on equal\n * specificity, which is the behaviour anyone writing Tailwind expects.\n */\nexport function classFor(\n element: ElementKey,\n appearance: Appearance | undefined,\n base: string,\n): string {\n const override = appearance?.elements?.[element];\n return override ? `${base} ${override}` : base;\n}\n\n// ---- the design system ---------------------------------------------------------\n\n/**\n * The legacy tokens the developer chose EXPLICITLY: a non-default `baseTheme`\n * plus `variables`. Only these map onto a design — the token defaults must not\n * overwrite the dashboard design.\n */\nexport function explicitTokens(appearance?: Appearance): DesignTokens {\n const out: DesignTokens = {};\n if (appearance?.baseTheme && appearance.baseTheme !== 'default') {\n Object.assign(out, THEMES[appearance.baseTheme]);\n }\n for (const [key, value] of Object.entries(appearance?.variables ?? {})) {\n if (value !== undefined) out[key as keyof DesignTokens] = value;\n }\n return out;\n}\n\n/**\n * Turn an `appearance` (+ the instance's dashboard design from the Frontend\n * API) into root attributes and a stylesheet — the same semantics as\n * `@atlasauth/react`. Precedence, lowest first: dashboard design < `preset` <\n * `variables` (and a non-default `baseTheme`) < `design`. Without a dashboard\n * design and without `preset`/`design`, the output is exactly the\n * pre-design-system one: the token variables, no stylesheet, no attributes.\n */\nexport function renderAppearance(\n appearance: Appearance | undefined,\n instanceDesign: InstanceDesign | null | undefined,\n options: { frontendApi?: string; warn?: DesignWarn } = {},\n): AppearanceRender {\n return renderDesignAppearance(appearance, instanceDesign, {\n tokens: explicitTokens(appearance),\n legacyStyle: () => cssVariables(resolveTokens(appearance)),\n frontendApi: options.frontendApi,\n warn: options.warn,\n });\n}\n","/**\n * §10.3: \"Every string passes through an i18n catalog; en-US ships, catalog\n * format documented for community locales.\"\n *\n * A flat key-to-string map rather than nested objects, because nesting looks\n * tidier and makes a missing key a runtime crash on `undefined.of.a.chain`\n * rather than a visible fallback.\n *\n * A missing key renders the KEY, not an empty string. A blank button is a bug\n * nobody can report; a button reading `signIn.submit` is one anyone can.\n */\n\nimport { POLICY_STRINGS } from '@atlasauth/js';\n\nexport type Catalog = Record<string, string>;\n\nexport const EN_US: Catalog = {\n 'signIn.title': 'Sign in',\n 'signIn.subtitle': 'to continue to {application}',\n 'signIn.identifierLabel': 'Email address',\n 'signIn.passwordLabel': 'Password',\n 'signIn.submit': 'Continue',\n 'signIn.forgotPassword': 'Forgot password?',\n 'signIn.noAccount': 'No account?',\n 'signIn.lastUsed': 'Last used',\n 'signIn.signUpLink': 'Sign up',\n 'signIn.orDivider': 'or',\n 'signIn.socialButton': 'Continue with {provider}',\n 'signIn.continueWithAtlas': 'Continue with Atlas',\n 'signIn.emailCodeLabel': 'Verification code',\n 'signIn.useEmailCode': 'Email me a code',\n 'signIn.useEmailLink': 'Email me a sign-in link',\n 'signIn.linkSentTo': 'We sent a sign-in link to {email}. Open it on any device to continue.',\n 'signIn.resendLink': 'Resend link',\n 'signIn.passwordOption': 'Use your password instead',\n 'signIn.passwordHoldReleased': 'Your email is verified. Enter your password to sign in.',\n 'signUp.existingAccount': 'You already had an account. Your existing password still applies.',\n 'signUp.emailConfirmed': 'Your email is confirmed. Sign in to continue.',\n 'signIn.codeSentTo': 'We sent a code to {email}. Enter it below.',\n 'signIn.resendCode': 'Resend code',\n 'signIn.sending': 'Sending…',\n 'signIn.emailCodeOption': 'Email me a code instead',\n 'signIn.passkeyButton': 'Sign in with a passkey',\n 'signIn.passkeyCancelled': \"Passkey sign-in didn't finish. Try again, or use another way to sign in.\",\n 'signIn.magicLinkSent': 'Check your email for a sign-in link.',\n 'signIn.signedIn': 'You\\'re signed in.',\n 'signIn.sessionNotKept':\n 'You signed in, but this browser didn\\'t keep the session. If it blocks third-party cookies, allow cookies for this site and try again.',\n 'signIn.checkOtherTab': 'You can close this tab — you are signed in where you started.',\n\n 'signUp.title': 'Create your account',\n 'signUp.submit': 'Continue',\n 'signUp.haveAccount': 'Already have an account?',\n 'signUp.signInLink': 'Sign in',\n 'signUp.emailLabel': 'Email address',\n 'signUp.passwordLabel': 'Password',\n 'signUp.optionalField': '{label} (optional)',\n 'signUp.selectPlaceholder': 'Select…',\n 'signUp.consentAgree': 'I agree to the',\n 'signUp.consentNotice': 'By continuing you agree to the',\n 'signUp.terms': 'Terms of Service',\n 'signUp.privacy': 'Privacy Policy',\n 'signUp.and': 'and',\n // = EMAIL_UNAVAILABLE_MESSAGE from @atlasauth/js.\n 'signUp.emailUnavailable':\n \"This app can't send email right now. Try another sign-in method or contact the app owner.\",\n 'signUp.passkeyOption': 'Sign up with a passkey instead',\n 'signUp.passwordOption': 'Sign up with a password instead',\n 'signUp.passkeyIntro': \"No password needed: you'll sign in with a passkey saved on this device or in your password manager.\",\n 'signUp.passkeyPrompt': 'Create a passkey to finish setting up your account.',\n 'signUp.passkeyCreate': 'Create passkey',\n 'signUp.passkeyCancelled': \"The passkey wasn't created. Try again when you're ready.\",\n 'signUp.linkSentTo': 'We sent a confirmation link to {email}. Open it on any device; this page continues on its own.',\n\n 'captcha.prompt': 'Complete the security check to continue.',\n 'captcha.required': 'Please complete the security check, then try again.',\n 'captcha.failed': \"The security check didn't pass. Please try again.\",\n 'captcha.checking': 'Checking your browser…',\n 'captcha.verified': 'Security check complete.',\n 'captcha.puzzlePrompt': \"Select every picture that shows the same shape as this one. Colour and size don't matter.\",\n 'captcha.puzzleConfirm': 'Confirm',\n 'captcha.puzzleTile': 'Picture {n}',\n 'captcha.puzzleAlternative': \"Can't do the picture check? Use a longer automatic check instead.\",\n\n 'mfa.title': 'Two-step verification',\n 'mfa.subtitle': 'Enter the code from your authenticator app.',\n 'mfa.codeLabel': 'Code',\n 'mfa.enrollFirstCodeLabel': 'Code from your authenticator app',\n 'mfa.enrollSecondCodeLabel': 'The next code it shows',\n 'mfa.usePasskey': 'Use a passkey instead',\n 'mfa.useBackupCode': 'Use a recovery code',\n 'mfa.submit': 'Verify',\n 'mfa.enrollChoose': 'Set up a second step for signing in.',\n 'mfa.enrollTotpOption': 'Use an authenticator app',\n 'mfa.enrollSmsOption': 'Use text messages',\n 'mfa.enrollScan': 'Scan this QR code with your authenticator app, or enter the setup key.',\n 'mfa.enrollQrAlt': 'QR code for your authenticator app',\n 'mfa.enrollSetupKey': 'Setup key',\n 'mfa.enrollPreparing': 'Setting up…',\n 'mfa.phoneLabel': 'Mobile number',\n 'mfa.phoneHint': 'Include the country code, for example +14155550101.',\n 'mfa.sendCode': 'Text me a code',\n 'mfa.codeTextedTo': 'Enter the code we texted to {phone}.',\n 'mfa.smsCodeOption': 'Text me a code instead',\n 'mfa.recoveryCodesTitle': 'Save your recovery codes',\n 'mfa.recoveryCodesHelp': \"Each code works once. If you can't use your second step, sign in with one of these. Keep them somewhere safe: they won't be shown again.\",\n 'mfa.recoveryCodesCopy': 'Copy codes',\n 'mfa.recoveryCodesCopied': 'Copied.',\n 'mfa.recoveryCodesDownload': 'Download as .txt',\n 'mfa.recoveryCodesSaved': \"I've saved my codes\",\n\n 'reset.title': 'Reset your password',\n 'reset.submit': 'Send reset code',\n 'reset.newPasswordLabel': 'New password',\n\n 'userButton.manageAccount': 'Manage account',\n 'userButton.signOut': 'Sign out',\n 'userButton.signOutAll': 'Sign out of all devices',\n\n 'userProfile.title': 'Account',\n 'userProfile.profileSection': 'Profile',\n 'userProfile.emailsSection': 'Email addresses',\n 'userProfile.securitySection': 'Security',\n 'userProfile.devicesSection': 'Active devices',\n 'userProfile.dangerSection': 'Danger zone',\n 'userProfile.addEmail': 'Add an email address',\n 'userProfile.makePrimary': 'Make primary',\n 'userProfile.unverified': 'Unverified',\n 'userProfile.verify': 'Verify',\n 'userProfile.verifyConfirm': 'Confirm',\n 'userProfile.verifyCodePlaceholder': 'Code from the email',\n 'userProfile.verifySendFailed': 'We could not send a code right now. Try again in a minute.',\n 'userProfile.verifyCodeRejected': 'That code was not accepted.',\n 'userProfile.revokeDevice': 'Sign out',\n 'userProfile.deleteAccount': 'Delete account',\n\n 'organization.switcher': 'Switch organization',\n 'organization.personal': 'Personal account',\n 'organization.members': 'Members',\n 'organization.invite': 'Invite member',\n 'organization.roleLabel': 'Role',\n 'organization.invitations': 'Invitations',\n 'organization.settings': 'Settings',\n 'organization.emailLabel': 'Email address',\n 'organization.sendInvite': 'Send invitation',\n 'organization.noInvitations': 'No pending invitations.',\n 'organization.remove': 'Remove',\n 'organization.revoke': 'Revoke',\n 'organization.resend': 'Resend',\n 'organization.you': '(you)',\n 'organization.leave': 'Leave organization',\n 'organization.leaveConfirm': 'Leave {name}? You will lose access until you are invited again.',\n 'organization.delete': 'Delete organization',\n 'organization.deleteConfirm': 'Delete {name} for every member? This cannot be undone.',\n 'organization.confirm': 'Confirm',\n 'organization.cancel': 'Cancel',\n 'organization.unnamedMember': 'Unnamed member',\n 'organization.passwordPrompt': 'Enter your password to confirm.',\n 'organization.roles': 'Roles',\n 'organization.roleName': 'Role name',\n 'organization.roleKey': 'Role key (for example org:auditor)',\n 'organization.rolePermissions': 'Permissions',\n 'organization.createRole': 'Create role',\n 'organization.saveRole': 'Save role',\n 'organization.editRole': 'Edit',\n 'organization.deleteRole': 'Delete',\n 'organization.noCustomRoles': 'This organization has no roles of its own yet.',\n 'impersonation.banner': 'You are signed in as {name} on someone else\\'s behalf.',\n 'impersonation.returnToAdmin': 'Return to admin',\n 'impersonation.end': 'End impersonation',\n\n // Policy acceptance (terms, privacy, any policy).\n ...POLICY_STRINGS,\n\n 'error.generic': 'Something went wrong. Please try again.',\n 'error.network': 'We could not reach the server. Check your connection.',\n\n // Server errors, by the stable `reason` the Frontend API sends. Shown instead\n // of the server's `message` (see `localizedErrorMessage` in @atlasauth/js).\n 'error.form_password_incorrect': 'Those credentials are incorrect.',\n 'error.form_code_incorrect': 'That code is incorrect.',\n 'error.form_code_already_used': 'That code has already been used. Wait for a new one.',\n 'error.form_code_expired': 'That code has expired. Request a new one.',\n 'error.form_code_max_attempts': 'Too many incorrect codes. Request a new code.',\n 'error.form_link_invalid': 'That sign-in link is invalid or has already been used.',\n 'error.form_identifier_not_found': \"We couldn't find an account with those details.\",\n 'error.form_identifier_exists': \"There's already an account for this email. Sign in with {methods}.\",\n 'error.form_password_pwned': 'This password has appeared in a known data breach. Please choose a different one.',\n 'error.form_password_too_short': 'Password must be at least {min_length} characters.',\n 'error.form_password_too_long': 'Password must be at most {max_length} characters.',\n 'error.form_password_requires_uppercase': 'Password must contain an uppercase letter.',\n 'error.form_password_requires_lowercase': 'Password must contain a lowercase letter.',\n 'error.form_password_requires_number': 'Password must contain a number.',\n 'error.form_password_requires_symbol': 'Password must contain a symbol.',\n 'error.form_password_not_allowed': 'That password is not allowed. Choose a different one.',\n 'error.form_password_contains_identifier': 'Password must not contain your email or username.',\n 'error.form_password_same_as_current': 'Your new password must be different from your current one.',\n 'error.form_password_reused': 'Your new password must not match any of your last {history_count} passwords.',\n 'error.password_expired': 'Your password has expired. Reset it to continue.',\n 'error.email_not_verified': 'Your email address is not verified yet. Verify it before signing in with your password.',\n 'error.sign_in_token_invalid': 'That sign-in token is invalid or has expired.',\n 'error.too_many_attempts': 'Too many failed attempts. Try again later.',\n 'error.too_many_requests': 'Too many requests. Please try again later.',\n 'error.captcha_required': 'Please complete the security check, then try again.',\n 'error.captcha_failed': \"The security check didn't pass. Please try again.\",\n 'error.captcha_unavailable': 'The security check is unavailable right now. Please try again later.',\n 'error.email_delivery_unavailable': \"This app can't send email right now. Try another sign-in method or contact the app owner.\",\n 'error.strategy_disabled': 'This sign-in method is not available for this app.',\n 'error.sign_up_restricted': 'Sign-up on this app is by invitation only.',\n 'error.sign_up_denied': 'Sign-up is not available for this account.',\n 'error.password_not_yet_usable': 'Verify your email address before signing in with this password.',\n 'error.account_deleted': 'The account for this address was deleted, so it can’t be used to sign up again.',\n 'error.waitlisted': \"You're on the waitlist. We'll email you when a place opens up.\",\n 'error.identifier_not_allowed': 'This email or phone number is not allowed on this app.',\n 'error.disposable_email_blocked': 'Sign-up with a disposable or temporary email address is not allowed.',\n 'error.sso_required': 'This organization requires signing in through single sign-on.',\n 'error.sign_ins_disabled': 'Sign-ins are temporarily disabled.',\n 'error.sign_ups_disabled': 'Sign-ups are temporarily disabled.',\n 'error.high_risk_blocked': 'This sign-in was blocked because it looked unusual.',\n 'error.sms_region_blocked': 'Text messages are not available for this phone number.',\n 'error.github_team_required': 'Your GitHub account is not a member of a GitHub organization or team allowed to sign in here.',\n};\n\n/**\n * Look up a key and interpolate `{placeholders}`.\n *\n * An unknown placeholder is left visible for the same reason a missing key is:\n * `Continue with {provider}` in the UI is a bug report waiting to be filed,\n * whereas `Continue with ` is one nobody notices until a customer does.\n */\nexport function translate(\n catalog: Catalog,\n key: string,\n variables: Record<string, string> = {},\n): string {\n const template = catalog[key] ?? EN_US[key] ?? key;\n return template.replace(/\\{(\\w+)\\}/g, (match, name: string) => variables[name] ?? match);\n}\n\n/** Merge a community locale over en-US so a partial translation still renders. */\nexport function withFallback(locale: Catalog): Catalog {\n return { ...EN_US, ...locale };\n}\n","import type { AtlasSdkInfo } from '@atlasauth/js';\n\n/** This package's version, sent as `X-Atlas-SDK` (kept in step with package.json by a test). */\nexport const ATLAS_ANGULAR_VERSION = '0.15.0';\nexport const ATLAS_ANGULAR_SDK: AtlasSdkInfo = { name: '@atlasauth/angular', version: ATLAS_ANGULAR_VERSION };\n","import {\n Injectable,\n OnDestroy,\n PLATFORM_ID,\n Signal,\n computed,\n inject,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { toSignal } from '@angular/core/rxjs-interop';\nimport { BehaviorSubject, Observable, Subject, combineLatest } from 'rxjs';\nimport { distinctUntilChanged, map } from 'rxjs/operators';\nimport { AtlasOrganizationAuditLog } from './components/organization-audit-log';\nimport {\n FapiClient,\n SignOutGuard,\n catalogLocale,\n localizedErrorMessage,\n type ErrorLike,\n TokenCache,\n closeOAuthPopupAfterSignIn,\n completeOAuthPopupLanding,\n getProviderToken as fetchProviderToken,\n mapOAuthPopupPayload,\n msUntilRefresh,\n readExpiry,\n readRedirectResult,\n resolveFrontendApi,\n stripRedirectParams,\n type OrganizationAuditLogOptions,\n type ProviderToken,\n type RedirectResult,\n type SignOutOptions,\n type SignOutResult,\n type EndImpersonationResult,\n SDK_HEADER,\n SignOutNotifier,\n getTemplateToken,\n reportSdkAdvisory,\n sdkHeaderValue,\n signOutReasonFromClient,\n type SignOutEvent,\n type SignOutListener,\n type SignOutReason,\n configureReferralCapture,\n withDevBrowser,\n reauthenticate,\n} from '@atlasauth/js';\nimport { evaluate, type ProtectCondition } from '@atlasauth/authz';\nimport { ATLAS_OPTIONS } from './atlas.config';\nimport {\n cssVariables,\n instanceDesignFrom,\n renderAppearance,\n resolveTokens,\n type Appearance,\n type AppearanceRender,\n type InstanceDesign,\n} from './appearance';\nimport { EN_US, withFallback, type Catalog } from './i18n';\nimport type {\n AtlasOrganizationMembership,\n AtlasSession,\n AtlasUser,\n AuthStatus,\n SessionClaims,\n} from './types';\nimport { ATLAS_ANGULAR_SDK } from './version';\n\n/**\n * `AtlasService` — the Angular peer of React's `<AtlasProvider>` + hooks.\n *\n * It holds exactly one thing that matters in memory: the short-lived JWT, in a\n * {@link TokenCache}. Not localStorage, not a cookie this code writes — the\n * refresh token is HttpOnly so browser script never touches it, and the JWT\n * lives only as long as the tab. Anything persisted would survive the tab and\n * become the first thing an XSS reads.\n *\n * Reactive auth state is exposed two ways so callers can pick their idiom:\n * - RxJS observables (`user$`, `session$`, `isSignedIn$`, …) — the primary API,\n * the analogue of the React hooks' return values.\n * - Angular signals (`user`, `session`, `isSignedIn`, …) — the same values as\n * `Signal<T>`, for templates and `computed()`.\n *\n * The imperative methods (`signOut`, `getToken`, `getProviderToken`,\n * `setActiveOrganization`, `reload`) mirror the actions the hooks return.\n */\n@Injectable({ providedIn: 'root' })\nexport class AtlasService implements OnDestroy {\n private readonly options = inject(ATLAS_OPTIONS);\n private readonly platformId = inject(PLATFORM_ID);\n private readonly isBrowser = isPlatformBrowser(this.platformId);\n\n private readonly baseUrl: string;\n private readonly publishableKey: string;\n private readonly doFetch: typeof fetch;\n\n private readonly cache = new TokenCache();\n private readonly fapiClient: FapiClient;\n private refreshTimer: ReturnType<typeof setTimeout> | null = null;\n\n /**\n * The sessions this browser signed out of (tombstones in localStorage, per\n * Frontend API origin), the revoke and its background re-tries. Every reload /\n * refresh asks it before adopting a session, so a sign-out the server never\n * confirmed is not undone by the still-valid refresh cookie.\n */\n private readonly guard: SignOutGuard;\n private stopWatchingSignOut: (() => void) | null = null;\n\n private readonly catalog: Catalog;\n /** The language layer of `catalog` (the `localization` bundle alone; `EN_US` when none). */\n private readonly errorCatalog: Catalog;\n /** Sent to the Frontend API as `Accept-Language`: the `localization` bundle's `locale` tag. */\n private readonly requestLocale: string | undefined;\n\n /**\n * A sign-in attempt handed back by an OAuth redirect that still needs a second\n * factor (no session was issued). Null in the ordinary case; the `<atlas-sign-in>`\n * flow seeds itself from this so the user resumes at the 2FA step. Captured\n * once, synchronously, at construction — before any flow component reads it.\n */\n readonly pendingAttempt: { id: string; status: string; policyToken?: string } | null;\n\n // --- Reactive state (source of truth) ---------------------------------------\n\n private readonly _status = new BehaviorSubject<AuthStatus>('loading');\n private readonly _user = new BehaviorSubject<AtlasUser | null>(null);\n private readonly _session = new BehaviorSubject<AtlasSession | null>(null);\n private readonly _claims = new BehaviorSubject<SessionClaims | null>(null);\n private readonly _memberships = new BehaviorSubject<AtlasOrganizationMembership[]>([]);\n // ATL-S-30 sign-out events, on every path.\n private readonly notifier = new SignOutNotifier();\n private readonly _signOut = new Subject<SignOutEvent>();\n /**\n * Emits once each time a signed-in user becomes signed out: `reason` is\n * `user`, `other_tab`, `session_expired`, `revoked` (ended elsewhere, seen on\n * the next token refresh) or `unknown`. The place to reset an embedded\n * third party (a chat widget). Also dispatched as `atlas:signout` on `window`.\n */\n readonly signOut$: Observable<SignOutEvent> = this._signOut.asObservable();\n\n /** The three-state auth lifecycle: `loading` → `signed_in` | `signed_out`. */\n readonly status$: Observable<AuthStatus> = this._status.asObservable();\n readonly user$: Observable<AtlasUser | null> = this._user.asObservable();\n readonly session$: Observable<AtlasSession | null> = this._session.asObservable();\n readonly claims$: Observable<SessionClaims | null> = this._claims.asObservable();\n readonly memberships$: Observable<AtlasOrganizationMembership[]> =\n this._memberships.asObservable();\n\n /**\n * True once the SDK has finished its first boot. Distinguishing \"still loading\"\n * from \"signed out\" is what lets a template avoid the flash of a sign-in form\n * on every page load.\n */\n readonly isLoaded$: Observable<boolean> = this.status$.pipe(\n map((s) => s !== 'loading'),\n distinctUntilChanged(),\n );\n\n readonly isSignedIn$: Observable<boolean> = this.status$.pipe(\n map((s) => s === 'signed_in'),\n distinctUntilChanged(),\n );\n\n /** The active organization membership, derived from the token's `org_id` claim. */\n readonly organization$: Observable<AtlasOrganizationMembership | null> = combineLatest([\n this._memberships,\n this._claims,\n ]).pipe(\n map(\n ([memberships, claims]) =>\n memberships.find((m) => m.organization.id === claims?.org_id) ?? null,\n ),\n );\n\n // --- Signal mirror ----------------------------------------------------------\n\n readonly status: Signal<AuthStatus> = toSignal(this.status$, { initialValue: 'loading' });\n readonly user: Signal<AtlasUser | null> = toSignal(this.user$, { initialValue: null });\n readonly session: Signal<AtlasSession | null> = toSignal(this.session$, { initialValue: null });\n readonly claims: Signal<SessionClaims | null> = toSignal(this.claims$, { initialValue: null });\n readonly memberships: Signal<AtlasOrganizationMembership[]> = toSignal(this.memberships$, {\n initialValue: [] as AtlasOrganizationMembership[],\n });\n readonly isLoaded: Signal<boolean> = computed(() => this.status() !== 'loading');\n readonly isSignedIn: Signal<boolean> = computed(() => this.status() === 'signed_in');\n readonly organization: Signal<AtlasOrganizationMembership | null> = computed(() => {\n const orgId = this.claims()?.org_id;\n return this.memberships().find((m) => m.organization.id === orgId) ?? null;\n });\n\n constructor() {\n const options = this.options;\n this.publishableKey = options.publishableKey;\n // Throws an `AtlasConfigError` on a missing/invalid value rather than quietly\n // sending every request to a relative path on the app's origin.\n this.baseUrl = resolveFrontendApi(options.frontendApi, {\n component: 'provideAtlas() / AtlasModule.forRoot()',\n });\n // Development instances keep the session in a header where the browser blocks the cookie.\n this.doFetch = withDevBrowser(\n options.publishableKey,\n options.fetchImpl ?? ((...args: Parameters<typeof fetch>) => fetch(...args)),\n );\n\n this.catalog = options.localization ? withFallback(options.localization) : EN_US;\n this.errorCatalog = options.localization ?? EN_US;\n this.requestLocale = catalogLocale(options.localization);\n\n // Referral attribution: app-wide options every FAPI client on the page falls back to.\n configureReferralCapture({ referral: options.referral, referralConsent: options.referralConsent });\n this.fapiClient = new FapiClient({\n publishableKey: this.publishableKey,\n baseUrl: this.baseUrl,\n fetchImpl: this.doFetch,\n locale: this.requestLocale,\n sdk: ATLAS_ANGULAR_SDK,\n });\n\n this.notifier.subscribe((event) => this._signOut.next(event));\n if (options.onSignOut) this.notifier.subscribe(options.onSignOut);\n\n this.guard = new SignOutGuard({\n request: (path, init) => this.call(path, init),\n frontendApi: this.baseUrl,\n });\n\n // Captured synchronously (not in an async init) so it is available before any\n // flow component reads it: a needs_second_factor redirect carries a status but\n // no ticket, and that is what the 2FA resume seeds from.\n this.pendingAttempt = this.isBrowser ? this.readPendingAttempt() : null;\n\n // Boot once, browser only. On the server there is no cookie jar to read a\n // session from, so we leave the state at `loading` and let hydration boot it.\n if (this.isBrowser) {\n // Another tab signed out of THIS session (its tombstone reached the shared\n // store): drop the token and re-check, which then refuses the session.\n this.stopWatchingSignOut = this.guard.watch(\n () => this.cache.peek()?.sessionId ?? this._session.value?.id,\n () => {\n this.notifier.expect('other_tab');\n this.cache.clear();\n void this.reload();\n },\n );\n void this.boot();\n }\n }\n\n ngOnDestroy(): void {\n this.stopWatchingSignOut?.();\n this.stopWatchingSignOut = null;\n this.guard.dispose();\n this.clearRefreshTimer();\n this._status.complete();\n this._user.complete();\n this._session.complete();\n this._claims.complete();\n this._memberships.complete();\n this._signOut.complete();\n }\n\n // --- Configuration accessors ------------------------------------------------\n\n get appearance(): Appearance | undefined {\n return this.options.appearance;\n }\n\n get localization(): Catalog {\n return this.catalog;\n }\n\n get frontendApi(): string {\n return this.baseUrl;\n }\n\n /** The `Accept-Language` sent to the Frontend API: the `localization` bundle's `locale` tag, if any. */\n get locale(): string | undefined {\n return this.requestLocale;\n }\n\n /**\n * The text to show for a server error, in the app's language: the catalog's\n * `error.<reason>` (looked up in the `localization` bundle, or `EN_US` when\n * none is set), else the server's message, else `error.generic`.\n */\n errorText(error: ErrorLike | string | null | undefined): string {\n return localizedErrorMessage(error, this.errorCatalog, this.catalog);\n }\n\n /** The catalog server errors are looked up in (see {@link errorText}). */\n get errorLocalization(): Catalog {\n return this.errorCatalog;\n }\n\n /** Tokens as CSS custom properties, for a host element to inherit. */\n appearanceVariables(): Record<string, string> {\n return cssVariables(resolveTokens(this.options.appearance));\n }\n\n /**\n * The full appearance render for a root element: inline variables, the\n * `data-atlas-*` attributes and the design stylesheet. Pass the dashboard\n * design (from {@link loadInstanceDesign}) to layer code overrides on it —\n * the same semantics as `@atlasauth/react`.\n */\n appearanceRender(instanceDesign?: InstanceDesign | null): AppearanceRender {\n return renderAppearance(this.options.appearance, instanceDesign ?? null, {\n frontendApi: this.baseUrl,\n });\n }\n\n /**\n * The design configured in the Atlas dashboard (`GET /v1/appearance`), or null\n * when there is none, it cannot be read, or the app opted out with\n * `appearance.instanceDesign: false`.\n */\n async loadInstanceDesign(): Promise<InstanceDesign | null> {\n if (this.options.appearance?.instanceDesign === false) return null;\n try {\n const response = await this.call('/v1/appearance');\n return response.ok ? instanceDesignFrom(await response.json()) : null;\n } catch {\n return null;\n }\n }\n\n /**\n * The active organization's audit trail, for its admins: `state` is a signal\n * of `{ entries, loading, forbidden, hasMore }`, one page at a time with\n * `loadMore()`. `action` narrows it (exact, or a prefix ending in `.`). It\n * follows the active organization; call `destroy()` when done. The peer of\n * React's `useOrganizationAuditLog`.\n */\n organizationAuditLog(options: OrganizationAuditLogOptions = {}): AtlasOrganizationAuditLog {\n return new AtlasOrganizationAuditLog(this.createFapiClient(), this.organization$, options);\n }\n\n /**\n * Re-authenticate the signed-in user with their password (a step-up), for an\n * action the server answered with STEP_UP_REQUIRED. Rejects when refused.\n */\n reauthenticate(password: string): Promise<void> {\n return reauthenticate(\n { strategy: 'password', password },\n { api: this.baseUrl, publishableKey: this.publishableKey, fetchImpl: this.doFetch, locale: this.requestLocale },\n );\n }\n\n /** A fresh {@link FapiClient} for driving a sign-in/sign-up flow. */\n createFapiClient(): FapiClient {\n return new FapiClient({\n publishableKey: this.publishableKey,\n baseUrl: this.baseUrl,\n locale: this.requestLocale,\n sdk: ATLAS_ANGULAR_SDK,\n });\n }\n\n // --- Imperative API (mirrors the React hooks' actions) ----------------------\n\n /**\n * The current session's JWT, always fresh: if the cached token is within 5s of\n * expiry it is refreshed first rather than handed over. Null when signed out.\n */\n /** The session JWT; with `{ template }` a short-lived named-template token (e.g. `'chatly'`). */\n async getToken(options?: { template?: string }): Promise<string | null> {\n if (options?.template) {\n const sessionId = this.cache.peek()?.sessionId ?? this._session.value?.id ?? null;\n return sessionId ? ((await getTemplateToken(this.fapiClient, sessionId, options.template))?.jwt ?? null) : null;\n }\n const usable = this.cache.get(5_000);\n if (usable) return usable.jwt;\n\n await this.refresh();\n return this.cache.get(5_000)?.jwt ?? null;\n }\n\n /**\n * The signed-in user's OWN live access token at a connected provider (Google,\n * GitHub, …), so the app can call that provider's API from the browser. Null\n * when there is no usable token — no linked account, or the provider granted /\n * kept none. The server refreshes a stale token on read; the refresh token is\n * never exposed.\n */\n /** Listen for sign-out on every path (see {@link signOut$}); returns the unsubscribe. */\n onSignOut(listener: SignOutListener): () => void {\n return this.notifier.subscribe(listener);\n }\n\n getProviderToken(provider: string): Promise<ProviderToken | null> {\n return fetchProviderToken(this.fapiClient, provider);\n }\n\n /** Imperative `has()` — the same evaluation `*atlasProtect` renders on. */\n has(condition: ProtectCondition): boolean {\n return evaluate(this._claims.value, condition).allowed;\n }\n\n /**\n * Revoke the current session server-side and drop all local auth state.\n *\n * The session id is remembered before the revoke (a tombstone shared by every\n * tab), so a reload, a token refresh, a sibling tab or a tab opened later never\n * re-adopts it — even when the revoke failed (it is retried once, then again in\n * the background) and the refresh cookie is still valid. Resolves\n * `{ revoked, activeSessionId? }`; with `{ strict: true }` an unconfirmed revoke\n * rejects with a `SignOutError` instead (after the local sign-out). A parked\n * session the server promoted on revoke is adopted. Front-channel logout runs\n * unless `{ frontchannel: false }`.\n */\n async signOut(options: SignOutOptions = {}): Promise<SignOutResult> {\n // With no cached token the guard finds the cookie session itself\n // (GET /v1/client), so a missing JWT never skips the revoke.\n const sessionId = this.cache.peek()?.sessionId ?? this._session.value?.id ?? null;\n this.notifier.expect('user');\n const attempt = await this.guard.revoke(sessionId, options);\n this.clearLocalState('user');\n if (this.guard.promoted(attempt)) await this.reload();\n return this.guard.settle(attempt, options);\n }\n\n /**\n * End the active impersonation (\"return to admin\"): the impersonator's own\n * session on this browser becomes active again with no sign-in\n * (`resumed: true`); with none, another account signed in here is adopted,\n * or this browser is signed out.\n */\n async endImpersonation(): Promise<EndImpersonationResult> {\n const outcome = await this.guard.endImpersonation(this.cache.peek()?.sessionId ?? this._session.value?.id ?? null);\n if (!outcome.ended) return outcome;\n if (!outcome.activeSessionId) {\n this.clearLocalState('user');\n return outcome;\n }\n if (outcome.jwt) this.applyToken(outcome.jwt, outcome.activeSessionId);\n await this.reload();\n return outcome;\n }\n\n /**\n * Switch the active organization (or `null` for the personal account). The\n * new token carries the new org claims, so the app's permission checks update\n * without a re-login.\n */\n async setActiveOrganization(organizationId: string | null): Promise<void> {\n const current = this.cache.peek();\n if (!current) return;\n\n const response = await this.call(`/v1/client/sessions/${current.sessionId}/touch`, {\n method: 'POST',\n body: JSON.stringify({ active_organization_id: organizationId }),\n });\n if (!response.ok) return;\n\n const body = (await response.json()) as { jwt: string };\n this.applyToken(body.jwt, current.sessionId);\n await this.reload();\n }\n\n /** Re-read `/v1/client`: refresh user, session, memberships and status. */\n /** Re-boot from the Frontend API. Resolves true when a session now exists in this browser. */\n async reload(): Promise<boolean> {\n try {\n const response = await this.call('/v1/client');\n if (!response.ok) throw new Error('boot failed');\n\n const body = (await response.json()) as {\n session: AtlasSession | null;\n user: AtlasUser | null;\n jwt?: string;\n organization_memberships?: AtlasOrganizationMembership[];\n };\n\n // A session this browser signed out of is never re-adopted from the\n // refresh cookie; the guard re-tries its revoke in the background.\n if (!body.session || !body.user || this.guard.refuse(body.session.id)) {\n this.clearLocalState(body.session ? 'other_tab' : signOutReasonFromClient(body));\n return false;\n }\n this.notifier.clear();\n\n this._user.next(body.user);\n this._session.next(body.session);\n this._memberships.next(body.organization_memberships ?? []);\n if (body.jwt) this.applyToken(body.jwt, body.session.id);\n this._status.next('signed_in');\n this.scheduleRefresh();\n return true;\n } catch {\n // A failed boot is NOT signed-out. Rendering a sign-in form because the\n // network hiccuped throws away a perfectly good session and forces a\n // needless re-authentication. Only promote loading → signed_out.\n if (this._status.value === 'loading') this._status.next('signed_out');\n return false;\n }\n }\n\n // --- Internals --------------------------------------------------------------\n\n /**\n * §6.3 step 3: complete a redirect-based sign-in, then boot. An OAuth or\n * hosted-page flow lands back with a one-time ticket in the URL; exchange it\n * for cookies, scrub the URL so a reload cannot replay it, THEN read the\n * session. A redirect carrying only a status (a second factor is still owed)\n * has no ticket, so nothing is exchanged and the app boots signed-out.\n */\n private async boot(): Promise<void> {\n const fromUrl = readRedirectResult(window.location.search);\n let result: RedirectResult | null = fromUrl;\n\n // §oauth popup mode: this page may be the landing of a sign-in popup whose\n // opener a Cross-Origin-Opener-Policy severed (`#atlas_popup_result=…`).\n // The result is relayed to the opener, which redeems the ticket, and this\n // window closes. If no opener takes it (its tab is gone), finish here like\n // a redirect.\n const landing = await completeOAuthPopupLanding().catch(() => null);\n if (landing && !landing.delivered) {\n const outcome = mapOAuthPopupPayload(landing.payload);\n if (outcome?.ticket && outcome.attemptId) {\n result = { attemptId: outcome.attemptId, ticket: outcome.ticket };\n } else if (outcome?.continuationUrl) {\n // A second factor / connect step / provider error: the redirect flow's page.\n window.location.replace(outcome.continuationUrl);\n return;\n }\n }\n\n let exchanged = false;\n if (result?.ticket) {\n const response = await this.call('/v1/client/tickets/exchange', {\n method: 'POST',\n body: JSON.stringify({ attempt_id: result.attemptId, ticket: result.ticket }),\n }).catch(() => undefined);\n exchanged = !!response?.ok;\n }\n if (fromUrl) {\n window.history.replaceState({}, document.title, stripRedirectParams(window.location.href));\n }\n await this.reload();\n // Signed in inside the Atlas popup (the redirect flow ran in it): hand back\n // to the waiting opener and close. A no-op in an ordinary tab.\n if (exchanged) void closeOAuthPopupAfterSignIn();\n }\n\n private readPendingAttempt(): { id: string; status: string; policyToken?: string } | null {\n const result = readRedirectResult(window.location.search);\n return result?.status && !result.ticket\n ? { id: result.attemptId, status: result.status, ...(result.policyToken ? { policyToken: result.policyToken } : {}) }\n : null;\n }\n\n private async call(path: string, init?: RequestInit): Promise<Response> {\n const response = await this.doFetch(`${this.baseUrl}${path}`, {\n ...init,\n // Cookies carry the session; a request without this is indistinguishable\n // from being signed out.\n credentials: 'include',\n headers: {\n 'x-publishable-key': this.publishableKey,\n // Names this SDK so the Frontend API can flag a version with a known bug.\n [SDK_HEADER]: sdkHeaderValue(ATLAS_ANGULAR_SDK),\n ...(init?.body ? { 'content-type': 'application/json' } : {}),\n ...init?.headers,\n },\n });\n reportSdkAdvisory(response, ATLAS_ANGULAR_SDK);\n return response;\n }\n\n private applyToken(jwt: string, sessionId: string): void {\n // An in-flight refresh must not resurrect a session signed out meanwhile.\n if (this.guard.isSignedOut(sessionId)) return;\n const expiresAt = readExpiry(jwt);\n if (!expiresAt) return;\n\n this.cache.set({ jwt, expiresAt, sessionId });\n this._claims.next(decodeClaims(jwt));\n }\n\n private async refresh(): Promise<void> {\n const current = this.cache.peek();\n if (!current) return;\n\n try {\n const response = await this.call(`/v1/client/sessions/${current.sessionId}/tokens`, {\n method: 'POST',\n });\n if (!response.ok) throw new Error('refresh failed');\n\n const body = (await response.json()) as { jwt: string; session_id: string };\n this.applyToken(body.jwt, body.session_id);\n this.scheduleRefresh();\n } catch {\n // The session may genuinely be gone. Re-boot rather than guess.\n await this.reload();\n }\n }\n\n private clearLocalState(reason?: SignOutReason): void {\n // A signed-in → signed-out transition tells the sign-out listeners why.\n const ended =\n this._status.value === 'signed_in'\n ? (this._session.value?.id ?? this.cache.peek()?.sessionId ?? null)\n : undefined;\n this.clearRefreshTimer();\n this.cache.clear();\n this._status.next('signed_out');\n this._user.next(null);\n this._session.next(null);\n this._claims.next(null);\n this._memberships.next([]);\n if (ended !== undefined) this.notifier.signedOut(ended, reason);\n else this.notifier.clear();\n }\n\n /** §7.4: proactive, jittered refresh scheduled from the token's own expiry. */\n private scheduleRefresh(): void {\n this.clearRefreshTimer();\n if (this._status.value !== 'signed_in') return;\n\n const token = this.cache.peek();\n if (!token) return;\n\n const delay = msUntilRefresh({ token, now: Date.now() });\n this.refreshTimer = setTimeout(() => void this.refresh(), delay);\n }\n\n private clearRefreshTimer(): void {\n if (this.refreshTimer) {\n clearTimeout(this.refreshTimer);\n this.refreshTimer = null;\n }\n }\n}\n\n/** Decode a JWT payload without verifying it — a scheduling/UI hint only. */\nfunction decodeClaims(jwt: string): SessionClaims | null {\n const parts = jwt.split('.');\n if (parts.length !== 3) return null;\n try {\n return JSON.parse(\n atob(parts[1]!.replace(/-/g, '+').replace(/_/g, '/')),\n ) as SessionClaims;\n } catch {\n return null;\n }\n}\n","import {\n Directive,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewContainerRef,\n inject,\n} from '@angular/core';\nimport { Observable, Subscription } from 'rxjs';\nimport { distinctUntilChanged } from 'rxjs/operators';\nimport { AtlasService } from '../atlas.service';\n\n/**\n * Shared machinery for the boolean structural directives (`*atlasSignedIn`,\n * `*atlasSignedOut`, `*atlasLoading`, `*atlasLoaded`). A subclass names the\n * stream to gate on; this base mounts the embedded view exactly when that stream\n * is true and tears it down otherwise, mirroring how the React `<SignedIn>` /\n * `<SignedOut>` components render `children` or `null`.\n */\n@Directive()\nexport abstract class AtlasToggleDirective implements OnInit, OnDestroy {\n protected readonly atlas = inject(AtlasService);\n private readonly templateRef = inject<TemplateRef<unknown>>(TemplateRef);\n private readonly viewContainer = inject(ViewContainerRef);\n private sub?: Subscription;\n private shown = false;\n\n /** The stream whose truthiness controls whether the template renders. */\n protected abstract source(): Observable<boolean>;\n\n ngOnInit(): void {\n this.sub = this.source()\n .pipe(distinctUntilChanged())\n .subscribe((show) => this.render(show));\n }\n\n ngOnDestroy(): void {\n this.sub?.unsubscribe();\n }\n\n private render(show: boolean): void {\n if (show && !this.shown) {\n this.viewContainer.createEmbeddedView(this.templateRef);\n this.shown = true;\n } else if (!show && this.shown) {\n this.viewContainer.clear();\n this.shown = false;\n }\n }\n}\n","import { Directive } from '@angular/core';\nimport { Observable, combineLatest } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { AtlasToggleDirective } from './toggle.directive';\n\n/**\n * `*atlasSignedIn` — render the template only when the SDK has loaded AND the\n * user is signed in. The Angular peer of React's `<SignedIn>`. Renders nothing\n * while loading, so no signed-in UI flashes before boot completes.\n *\n * ```html\n * <div *atlasSignedIn>Welcome back</div>\n * ```\n */\n@Directive({\n selector: '[atlasSignedIn]',\n standalone: true,\n})\nexport class AtlasSignedInDirective extends AtlasToggleDirective {\n protected override source(): Observable<boolean> {\n return combineLatest([this.atlas.isLoaded$, this.atlas.isSignedIn$]).pipe(\n map(([loaded, signedIn]) => loaded && signedIn),\n );\n }\n}\n","import { Directive } from '@angular/core';\nimport { Observable, combineLatest } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { AtlasToggleDirective } from './toggle.directive';\n\n/**\n * `*atlasSignedOut` — render the template only when the SDK has loaded AND the\n * user is signed out. The Angular peer of React's `<SignedOut>`. Renders nothing\n * while loading, the symmetric partner of `*atlasSignedIn`.\n *\n * ```html\n * <atlas-sign-in *atlasSignedOut></atlas-sign-in>\n * ```\n */\n@Directive({\n selector: '[atlasSignedOut]',\n standalone: true,\n})\nexport class AtlasSignedOutDirective extends AtlasToggleDirective {\n protected override source(): Observable<boolean> {\n return combineLatest([this.atlas.isLoaded$, this.atlas.isSignedIn$]).pipe(\n map(([loaded, signedIn]) => loaded && !signedIn),\n );\n }\n}\n","import { Directive } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { map } from 'rxjs/operators';\nimport { AtlasToggleDirective } from './toggle.directive';\n\n/**\n * `*atlasLoading` — render the template only while the SDK is still booting. The\n * Angular peer of React's `<AtlasLoading>`; show a spinner here.\n */\n@Directive({\n selector: '[atlasLoading]',\n standalone: true,\n})\nexport class AtlasLoadingDirective extends AtlasToggleDirective {\n protected override source(): Observable<boolean> {\n return this.atlas.isLoaded$.pipe(map((loaded) => !loaded));\n }\n}\n","import { Directive } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { AtlasToggleDirective } from './toggle.directive';\n\n/**\n * `*atlasLoaded` — render the template only once the SDK has finished booting.\n * The Angular peer of React's `<AtlasLoaded>`, the symmetric partner of\n * `*atlasLoading`.\n */\n@Directive({\n selector: '[atlasLoaded]',\n standalone: true,\n})\nexport class AtlasLoadedDirective extends AtlasToggleDirective {\n protected override source(): Observable<boolean> {\n return this.atlas.isLoaded$;\n }\n}\n","import {\n Directive,\n Input,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewContainerRef,\n inject,\n} from '@angular/core';\nimport { BehaviorSubject, Subscription, combineLatest } from 'rxjs';\nimport { AtlasService } from '../atlas.service';\nimport { evaluate, type ProtectCondition } from '@atlasauth/authz';\n\n/**\n * `*atlasProtect` — render the template only when the active organization role\n * satisfies a {@link ProtectCondition}. The Angular peer of React's\n * `<Protect permission=\"…\">`.\n *\n * A RENDERING helper, never an authorization boundary: anyone can flip the\n * condition in devtools. The server checking the same permission is what\n * actually stops them — this directive's only job is to avoid showing a control\n * that would fail.\n *\n * ```html\n * <button *atlasProtect=\"{ permission: 'org:sys_memberships:manage' }\">Invite</button>\n *\n * <!-- with a fallback (identical microsyntax to *ngIf … else) -->\n * <div *atlasProtect=\"{ role: 'admin' }; else denied\">Admin tools</div>\n * <ng-template #denied>You lack access.</ng-template>\n * ```\n *\n * An empty condition (`*atlasProtect`) means simply \"signed in\".\n */\n@Directive({\n selector: '[atlasProtect]',\n standalone: true,\n})\nexport class AtlasProtectDirective implements OnInit, OnDestroy {\n private readonly atlas = inject(AtlasService);\n private readonly templateRef = inject<TemplateRef<unknown>>(TemplateRef);\n private readonly viewContainer = inject(ViewContainerRef);\n\n private readonly condition$ = new BehaviorSubject<ProtectCondition>({});\n private elseTemplate: TemplateRef<unknown> | null = null;\n private sub?: Subscription;\n private rendered: 'main' | 'else' | 'none' = 'none';\n\n /** The condition to evaluate. An empty/omitted value means \"signed in\". */\n @Input()\n set atlasProtect(condition: ProtectCondition | '' | null | undefined) {\n this.condition$.next(condition || {});\n }\n\n /** Template rendered when the condition is not met (the `else` branch). */\n @Input()\n set atlasProtectElse(template: TemplateRef<unknown> | null) {\n this.elseTemplate = template;\n // Re-render against the current state so a late-bound else takes effect.\n this.condition$.next(this.condition$.value);\n }\n\n ngOnInit(): void {\n this.sub = combineLatest([this.atlas.status$, this.atlas.claims$, this.condition$]).subscribe(\n ([status, claims, condition]) => {\n if (status === 'loading') {\n this.show('none');\n return;\n }\n this.show(evaluate(claims, condition).allowed ? 'main' : 'else');\n },\n );\n }\n\n ngOnDestroy(): void {\n this.sub?.unsubscribe();\n }\n\n private show(which: 'main' | 'else' | 'none'): void {\n if (which === this.rendered) return;\n this.viewContainer.clear();\n\n if (which === 'main') {\n this.viewContainer.createEmbeddedView(this.templateRef);\n } else if (which === 'else' && this.elseTemplate) {\n this.viewContainer.createEmbeddedView(this.elseTemplate);\n }\n this.rendered = which;\n }\n}\n","import { DOCUMENT, isPlatformBrowser } from '@angular/common';\nimport { Directive, ElementRef, OnInit, PLATFORM_ID, Renderer2, inject } from '@angular/core';\nimport { applyAppearanceToDom } from '@atlasauth/design/runtime';\nimport { AtlasService } from '../atlas.service';\n\n/**\n * `atlasRoot` — apply the resolved appearance design tokens as `--atlas-*` CSS\n * custom properties (and the `atlas-root` class) onto its host element, so the\n * Atlas components rendered inside inherit them.\n *\n * React does this with the wrapping `<div className=\"atlas-root\" style={…}>`\n * inside `<AtlasProvider>`. Angular has no single wrapping element, so a\n * consumer opts in by putting `atlasRoot` on whatever element encloses the\n * Atlas UI (commonly the app root):\n *\n * ```html\n * <div atlasRoot>\n * <router-outlet></router-outlet>\n * </div>\n * ```\n *\n * With a design (a code-level `appearance.preset` / `appearance.design`, or\n * the dashboard design, fetched in the browser) the host also gets the stable\n * `data-atlas-*` attributes and the design stylesheet is added to `<head>` once.\n */\n@Directive({\n selector: '[atlasRoot]',\n standalone: true,\n})\nexport class AtlasRootDirective implements OnInit {\n private readonly atlas = inject(AtlasService);\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly renderer = inject(Renderer2);\n private readonly document = inject(DOCUMENT);\n private readonly platformId = inject(PLATFORM_ID);\n\n ngOnInit(): void {\n const host = this.el.nativeElement;\n this.renderer.addClass(host, 'atlas-root');\n // Custom properties via `style.setProperty` (written verbatim, never camelCased).\n let applied = applyAppearanceToDom(this.document, host, this.atlas.appearanceRender());\n if (!isPlatformBrowser(this.platformId)) return;\n void this.atlas.loadInstanceDesign().then((design) => {\n if (!design) return;\n applied = applyAppearanceToDom(this.document, host, this.atlas.appearanceRender(design), applied);\n });\n }\n}\n","import { Directive, ElementRef, Input, OnDestroy, OnInit, inject } from '@angular/core';\nimport type { CaptchaController } from '@atlasauth/js';\n\n/**\n * `[atlasCaptchaSlot]=\"controller\"` — the element a flow's captcha widget draws\n * into (see `createCaptchaController` in `@atlasauth/js`). Attaches the\n * controller to the host element while it is rendered and detaches it (removing\n * the widget) when it goes away.\n */\n@Directive({\n selector: '[atlasCaptchaSlot]',\n standalone: true,\n})\nexport class AtlasCaptchaSlotDirective implements OnInit, OnDestroy {\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private current: CaptchaController | null = null;\n private initialized = false;\n\n @Input('atlasCaptchaSlot') set controller(next: CaptchaController | null) {\n if (next === this.current) return;\n if (this.initialized) this.current?.attach(null);\n this.current = next;\n if (this.initialized) this.current?.attach(this.host.nativeElement);\n }\n\n ngOnInit(): void {\n this.initialized = true;\n this.current?.attach(this.host.nativeElement);\n }\n\n ngOnDestroy(): void {\n this.current?.attach(null);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n Directive,\n ElementRef,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Output,\n inject,\n signal,\n type SimpleChanges,\n} from '@angular/core';\nimport {\n PolicyGateController,\n controllerForPending,\n formatPolicyDate,\n injectPolicyStyles,\n joinTitles,\n mountPolicyAcceptStep,\n mountPolicyClickwrap,\n mountPolicyConsent,\n policyTranslator,\n type MountedPolicyStep,\n type MountedPolicyUi,\n type Policy,\n type PolicyAcceptanceController,\n type PolicyClasses,\n type PolicyT,\n} from '@atlasauth/js';\nimport { AtlasService } from '../atlas.service';\nimport { classFor } from '../appearance';\nimport { translate } from '../i18n';\n\n/** The policy UI's translator (the localization bundle, else the English policy strings) for the current Atlas service. */\nexport function policyUi(atlas: AtlasService): { t: PolicyT; classes: PolicyClasses } {\n return {\n t: policyTranslator((key, vars) => translate(atlas.localization, key, vars)),\n classes: {\n link: 'atlas-link',\n text: 'atlas-text',\n primaryButton: classFor('formButtonPrimary', atlas.appearance, 'atlas-button'),\n error: classFor('formFieldError', atlas.appearance, 'atlas-error'),\n },\n };\n}\n\n/**\n * `[atlasPolicies]=\"controller\"` — draws the instance's policies (terms, privacy,\n * …) into the host element: `kind=\"consent\"` (default) is the checkbox block with\n * its in-page viewer, `kind=\"clickwrap\"` the \"By continuing you agree to …\" line.\n * The state is the controller's (`AtlasFlowController.policies`); the DOM comes\n * from `@atlasauth/js`, shared with every SDK.\n */\n@Directive({ selector: '[atlasPolicies]', standalone: true })\nexport class AtlasPoliciesDirective implements OnInit, OnChanges, OnDestroy {\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly atlas = inject(AtlasService);\n private mounted: MountedPolicyUi | null = null;\n private ready = false;\n\n @Input('atlasPolicies') controller: PolicyAcceptanceController | null = null;\n @Input() atlasPolicyKind: 'consent' | 'clickwrap' = 'consent';\n\n ngOnInit(): void {\n this.ready = true;\n this.draw();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (this.ready && (changes['controller'] || changes['atlasPolicyKind'])) this.draw();\n }\n\n ngOnDestroy(): void {\n this.mounted?.destroy();\n }\n\n private draw(): void {\n this.mounted?.destroy();\n this.mounted = null;\n if (!this.controller) return;\n const el = this.host.nativeElement;\n injectPolicyStyles(el.ownerDocument);\n const ui = policyUi(this.atlas);\n this.mounted =\n this.atlasPolicyKind === 'clickwrap'\n ? mountPolicyClickwrap(el, this.controller, ui)\n : mountPolicyConsent(el, this.controller, ui);\n }\n}\n\n/**\n * `<atlas-policy-accept-step>` — the sign-in step for a `needs_policy_acceptance`\n * attempt: scroll-mode policies in their unskippable dialog, the rest as\n * checkboxes, then \"Accept and continue\". Emits `submitFlow` with the\n * `policy_acceptances` JSON for the flow, and `declined` with the policy title\n * when the user declines (cancel the attempt).\n */\n@Component({\n selector: 'atlas-policy-accept-step',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `@if (loading()) {<p class=\"atlas-text\">{{ loadingText }}</p>}<div class=\"atlas-policy-step-host\"></div>`,\n})\nexport class PolicyAcceptStepComponent implements OnInit, OnChanges, OnDestroy {\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly atlas = inject(AtlasService);\n private step: MountedPolicyStep | null = null;\n private alive = true;\n\n @Input() attempt: { id: string | null; pending_policies?: unknown } | null = null;\n @Input() busy = false;\n @Output() submitFlow = new EventEmitter<Record<string, string>>();\n @Output() declined = new EventEmitter<string>();\n\n protected readonly loading = signal(true);\n protected loadingText = policyUi(this.atlas).t('policy.loading');\n\n ngOnInit(): void {\n const client = this.atlas.createFapiClient();\n void controllerForPending(client, this.attempt, { locale: this.atlas.locale ?? undefined }).then((controller) => {\n if (!this.alive) return;\n this.loading.set(false);\n const el = this.host.nativeElement.querySelector('.atlas-policy-step-host') as HTMLElement | null;\n if (!el) return;\n injectPolicyStyles(el.ownerDocument);\n this.step = mountPolicyAcceptStep(el, controller, {\n ...policyUi(this.atlas),\n onSubmit: (acceptances) => this.submitFlow.emit({ policy_acceptances: JSON.stringify(acceptances) }),\n onDecline: (policy: Policy) => this.declined.emit(policy.title),\n });\n this.step.setBusy(this.busy);\n });\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['busy']) this.step?.setBusy(this.busy);\n }\n\n ngOnDestroy(): void {\n this.alive = false;\n this.step?.destroy();\n }\n}\n\n/**\n * `<atlas-policy-gate>` — in-app re-acceptance. For a signed-in user, a banner\n * when a policy needs re-acceptance; \"Review and accept\" opens the unskippable\n * dialog / checkboxes and posts `/v1/client/me/policies/accept`. Projects its\n * content always.\n */\n@Component({\n selector: 'atlas-policy-gate',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (bannerText(); as text) {\n <div [class]=\"bannerClass\" role=\"status\" data-atlas-policy-banner=\"\">\n <span\n ><strong>{{ title }}. </strong>{{ text }}</span\n >\n <button type=\"button\" [class]=\"linkClass\" (click)=\"begin()\">{{ reviewText }}</button>\n </div>\n }\n @if (reviewing()) {\n <div [class]=\"cardClass\" data-atlas-policy-gate=\"\">\n <div class=\"atlas-policy-gate-host\"></div>\n @if (error()) {\n <p [class]=\"errorClass\" role=\"alert\">{{ error() }}</p>\n }\n </div>\n }\n <ng-content></ng-content>\n `,\n})\nexport class PolicyGateComponent implements OnInit, OnDestroy {\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly atlas = inject(AtlasService);\n private readonly ui = policyUi(this.atlas);\n private gate!: PolicyGateController;\n private off: (() => void) | null = null;\n private step: MountedPolicyStep | null = null;\n private readonly version = signal(0);\n\n @Output() accepted = new EventEmitter<void>();\n\n protected readonly reviewing = signal(false);\n protected readonly error = signal('');\n protected title = this.ui.t('policy.bannerTitle');\n protected reviewText = this.ui.t('policy.bannerReview');\n protected linkClass = this.ui.classes.link ?? '';\n protected errorClass = this.ui.classes.error ?? '';\n protected bannerClass = 'atlas-policy-banner';\n protected cardClass = classFor('card', this.atlas.appearance, 'atlas-card');\n\n protected bannerText(): string | null {\n this.version();\n if (!this.gate || this.gate.pending.length === 0 || this.reviewing()) return null;\n const t = this.ui.t;\n const grace = this.gate.graceEndsAt;\n return (\n t('policy.bannerBody', { policies: joinTitles(this.gate.pending.map((p) => p.title), t('policy.and')) }) +\n (grace ? ` ${t('policy.bannerGrace', { date: formatPolicyDate(grace) })}` : '')\n );\n }\n\n ngOnInit(): void {\n this.gate = new PolicyGateController(this.atlas.createFapiClient(), this.atlas.locale ?? undefined);\n this.off = this.gate.subscribe(() => this.version.update((n) => n + 1));\n if (this.atlas.status() === 'signed_in') void this.gate.load();\n }\n\n async begin(): Promise<void> {\n const controller = await this.gate.begin();\n this.reviewing.set(true);\n await Promise.resolve();\n const el = this.host.nativeElement.querySelector('.atlas-policy-gate-host') as HTMLElement | null;\n if (!el) return;\n injectPolicyStyles(el.ownerDocument);\n this.step = mountPolicyAcceptStep(el, controller, {\n ...this.ui,\n onSubmit: async () => {\n this.step?.setBusy(true);\n const res = await this.gate.accept(controller);\n this.step?.setBusy(false);\n if (!res.ok) {\n this.error.set(res.errors[0]?.message ?? this.ui.t('policy.requiredGeneric'));\n return;\n }\n this.close();\n this.accepted.emit();\n },\n onDecline: () => this.close(),\n });\n }\n\n private close(): void {\n this.step?.destroy();\n this.step = null;\n this.reviewing.set(false);\n }\n\n ngOnDestroy(): void {\n this.off?.();\n this.step?.destroy();\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n Output,\n inject,\n} from '@angular/core';\nimport {\n awaitingSignUpLink,\n enrollmentSubmitKey,\n groupSetupKey,\n localizedErrorMessage,\n nextStep,\n type AttemptView,\n type CaptchaController,\n type FieldError,\n type FlowState,\n type MfaEnrollmentController,\n type MfaEnrollmentState,\n type MfaEnrollmentStrategy,\n} from '@atlasauth/js';\nimport { AtlasService } from '../atlas.service';\nimport { AtlasCaptchaSlotDirective } from '../directives/captcha-slot.directive';\nimport { PolicyAcceptStepComponent } from './policy-host';\nimport { classFor, type ElementKey } from '../appearance';\nimport { translate } from '../i18n';\n\n/**\n * One rendered row of the flow. A uniform shape (rather than a discriminated\n * union) so the template accesses only fields that always exist — no reliance on\n * template control-flow narrowing of a loop variable, which varies by Angular\n * minor. For a `message` row, `labelKey` carries the message's i18n key.\n */\ninterface StepField {\n kind: 'input' | 'message' | 'alert' | 'released';\n name: string;\n labelKey: string;\n type: string;\n autocomplete?: string;\n}\n\n/**\n * The server-driven flow shell, shared by `<atlas-sign-in>` and\n * `<atlas-sign-up>`. The Angular peer of React's internal `AttemptFlow`.\n *\n * It contains NO decision about what comes next: it renders whatever `status`\n * the server returned, mapped through `nextStep` from `@atlasauth/js` (the same\n * exhaustive mapping the React SDK uses), so adding a step is a server change\n * and an out-of-date client degrades to a visible \"please update\" message rather\n * than a blank screen.\n */\n@Component({\n selector: 'atlas-attempt-flow',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AtlasCaptchaSlotDirective, PolicyAcceptStepComponent],\n template: `\n <div [class]=\"cls('card', 'atlas-card')\">\n <h1 [class]=\"cls('headerTitle', 'atlas-title')\">{{ t(titleKey) }}</h1>\n\n @for (error of formErrors(); track error.code) {\n <p [class]=\"cls('formFieldError', 'atlas-error')\" role=\"alert\">{{ errorText(error) }}</p>\n }\n\n <form (submit)=\"onSubmit($event)\">\n @if (codeSentText(); as sentText) {\n <p class=\"atlas-text\" data-atlas-code-sent=\"\">{{ sentText }}</p>\n }\n @if (linkSentText(); as sentLink) {\n <p class=\"atlas-text\" data-atlas-link-sent=\"\">{{ sentLink }}</p>\n }\n @if (linkOnly()) {\n <!-- Nothing to type: the flow polls until the emailed link is opened (anywhere). -->\n <p class=\"atlas-text\" data-atlas-link-sent=\"\" aria-live=\"polite\">\n {{ t('signUp.linkSentTo', { email: attempt?.identifier ?? '' }) }}\n </p>\n <button\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n type=\"button\"\n data-atlas-resend=\"\"\n [disabled]=\"busy\"\n (click)=\"resend.emit()\"\n >\n {{ t('signIn.resendLink') }}\n </button>\n }\n @if (enrolling() && enrollmentState; as enrol) {\n @if (enrol.method === null) {\n <p class=\"atlas-text\">{{ t('mfa.enrollChoose') }}</p>\n @for (m of enrol.options; track m) {\n <button\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n type=\"button\"\n [attr.data-atlas-mfa-method]=\"m\"\n [disabled]=\"busy || enrol.busy\"\n (click)=\"chooseMethod(m)\"\n >\n {{ t(m === 'totp' ? 'mfa.enrollTotpOption' : 'mfa.enrollSmsOption') }}\n </button>\n }\n } @else if (enrol.method === 'totp') {\n @if (enrol.enrollment; as setup) {\n <p class=\"atlas-text\">{{ t('mfa.enrollScan') }}</p>\n @if (setup.qrCode) {\n <img class=\"atlas-mfa-qr\" data-atlas=\"mfa-qr\" [src]=\"setup.qrCode\" [alt]=\"t('mfa.enrollQrAlt')\" width=\"180\" height=\"180\" />\n }\n @if (setup.secret) {\n <p class=\"atlas-text\" data-atlas=\"mfa-setup-key\">{{ t('mfa.enrollSetupKey') }}: <code>{{ setupKey(setup.secret) }}</code></p>\n }\n <label class=\"atlas-field\">\n <span>{{ t('mfa.enrollFirstCodeLabel') }}</span>\n <input [class]=\"cls('formFieldInput', 'atlas-input')\" type=\"text\" name=\"code\" autocomplete=\"one-time-code\" inputmode=\"numeric\" [value]=\"values['code'] ?? ''\" (input)=\"setValue('code', $any($event.target).value)\" />\n </label>\n @if (enrol.totpCodes >= 2) {\n <label class=\"atlas-field\">\n <span>{{ t('mfa.enrollSecondCodeLabel') }}</span>\n <input [class]=\"cls('formFieldInput', 'atlas-input')\" type=\"text\" name=\"secondCode\" autocomplete=\"one-time-code\" inputmode=\"numeric\" [value]=\"values['secondCode'] ?? ''\" (input)=\"setValue('secondCode', $any($event.target).value)\" />\n </label>\n }\n } @else {\n <p class=\"atlas-text\" aria-live=\"polite\">{{ enrol.busy ? t('mfa.enrollPreparing') : '' }}</p>\n }\n } @else {\n @if (enrol.enrollment; as texted) {\n <p class=\"atlas-text\" data-atlas=\"mfa-code-texted\" aria-live=\"polite\">{{ t('mfa.codeTextedTo', { phone: texted.phone ?? '' }) }}</p>\n <label class=\"atlas-field\">\n <span>{{ t('mfa.codeLabel') }}</span>\n <input [class]=\"cls('formFieldInput', 'atlas-input')\" type=\"text\" name=\"code\" autocomplete=\"one-time-code\" inputmode=\"numeric\" [value]=\"values['code'] ?? ''\" (input)=\"setValue('code', $any($event.target).value)\" />\n </label>\n <button\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n type=\"button\"\n data-atlas-resend=\"\"\n [disabled]=\"busy || enrol.busy\"\n (click)=\"resendEnrollment()\"\n >\n {{ t('signIn.resendCode') }}\n </button>\n } @else {\n <label class=\"atlas-field\">\n <span>{{ t('mfa.phoneLabel') }}</span>\n <input [class]=\"cls('formFieldInput', 'atlas-input')\" type=\"tel\" name=\"phone\" autocomplete=\"tel\" [value]=\"values['phone'] ?? ''\" (input)=\"setValue('phone', $any($event.target).value)\" />\n </label>\n <p class=\"atlas-text\">{{ t('mfa.phoneHint') }}</p>\n }\n }\n @for (error of enrol.errors; track $index) {\n <p [class]=\"cls('formFieldError', 'atlas-error')\" role=\"alert\">{{ error.message }}</p>\n }\n @if (enrol.method !== null && enrol.options.length > 1) {\n @for (other of otherMethods(enrol); track other) {\n <button\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n type=\"button\"\n [attr.data-atlas-mfa-method]=\"other\"\n [disabled]=\"busy || enrol.busy\"\n (click)=\"chooseMethod(other)\"\n >\n {{ t(other === 'totp' ? 'mfa.enrollTotpOption' : 'mfa.enrollSmsOption') }}\n </button>\n }\n }\n }\n @for (f of fields(); track $index) {\n @if (f.kind === 'input') {\n <label class=\"atlas-field\">\n <span>{{ t(f.labelKey) }}</span>\n <input\n [class]=\"cls('formFieldInput', 'atlas-input')\"\n [type]=\"f.type\"\n [attr.name]=\"f.name\"\n [attr.autocomplete]=\"f.autocomplete ?? null\"\n [value]=\"values[f.name] ?? ''\"\n (input)=\"setValue(f.name, $any($event.target).value)\"\n />\n @for (error of fieldErrorsFor(f.name); track error.code) {\n <span [class]=\"cls('formFieldError', 'atlas-error')\">{{ errorText(error) }}</span>\n }\n </label>\n } @else if (f.kind === 'released') {\n <p class=\"atlas-text\" data-atlas-password-released=\"\">{{ t(f.labelKey) }}</p>\n } @else if (f.kind === 'alert') {\n <p [class]=\"cls('formFieldError', 'atlas-error')\" role=\"alert\">{{ t(f.labelKey) }}</p>\n } @else {\n <p>{{ t(f.labelKey) }}</p>\n }\n }\n\n @if (awaitingPolicies()) {\n <!-- A required policy changed: scroll-mode ones in their dialog, the rest as checkboxes. -->\n <atlas-policy-accept-step\n [attempt]=\"attempt\"\n [busy]=\"busy\"\n (submitFlow)=\"submitFlow.emit($event)\"\n (declined)=\"policyDeclined.emit($event)\"\n ></atlas-policy-accept-step>\n }\n\n @if (showCaptcha()) {\n <div class=\"atlas-captcha\" data-atlas-captcha=\"\" [atlasCaptchaSlot]=\"captcha\"></div>\n }\n\n @if (showSubmit()) {\n <button [class]=\"cls('formButtonPrimary', 'atlas-button')\" [disabled]=\"busy || (enrolling() && !!enrollmentState?.busy)\" type=\"submit\">\n {{ t(submitKey()) }}\n </button>\n }\n\n @if (showSmsSecondFactor()) {\n @if (smsSecondFactorSentTo(); as sentTo) {\n <p class=\"atlas-text\" data-atlas=\"sms-second-factor-sent\" aria-live=\"polite\">\n {{ t('mfa.codeTextedTo', { phone: sentTo }) }}\n </p>\n } @else {\n <button\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n type=\"button\"\n data-atlas=\"sms-second-factor\"\n [disabled]=\"busy || !!textedSecondFactor?.busy\"\n (click)=\"smsSecondFactor.emit()\"\n >\n {{ textedSecondFactor?.busy ? t('signIn.sending') : t('mfa.smsCodeOption') }}\n </button>\n @if (textedSecondFactor?.error; as message) {\n <p [class]=\"cls('formFieldError', 'atlas-error')\" role=\"alert\">{{ message }}</p>\n }\n }\n }\n\n @if (showEmailSecondFactor()) {\n @if (emailSecondFactorSentTo(); as sentTo) {\n <p class=\"atlas-text\" data-atlas=\"email-second-factor-sent\" aria-live=\"polite\">\n {{ t('signIn.codeSentTo', { email: sentTo }) }}\n </p>\n } @else {\n <button\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n type=\"button\"\n data-atlas=\"email-second-factor\"\n [disabled]=\"busy || !!emailedSecondFactor?.busy\"\n (click)=\"emailSecondFactor.emit()\"\n >\n {{ emailedSecondFactor?.busy ? t('signIn.sending') : t('signIn.emailCodeOption') }}\n </button>\n @if (emailedSecondFactor?.error; as message) {\n <p [class]=\"cls('formFieldError', 'atlas-error')\" role=\"alert\">{{ message }}</p>\n }\n }\n }\n\n @if (showEmailCodeOption()) {\n <button\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n [disabled]=\"busy\"\n type=\"button\"\n [attr.data-strategy]=\"preparedFactor === 'email_code' ? null : 'email_code'\"\n [attr.data-atlas-resend]=\"preparedFactor === 'email_code' ? '' : null\"\n (click)=\"chooseFactor.emit('email_code')\"\n >\n {{ t(preparedFactor === 'email_code' ? 'signIn.resendCode' : 'signIn.useEmailCode') }}\n </button>\n }\n\n @if (holdProof === 'email_link' && step().kind === 'collect_first_factor') {\n <button\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n [disabled]=\"busy\"\n type=\"button\"\n [attr.data-strategy]=\"preparedFactor === 'email_link' ? null : 'email_link'\"\n [attr.data-atlas-resend]=\"preparedFactor === 'email_link' ? '' : null\"\n (click)=\"chooseFactor.emit('email_link')\"\n >\n {{ t(preparedFactor === 'email_link' ? 'signIn.resendLink' : 'signIn.useEmailLink') }}\n </button>\n }\n\n @if (preparedFactor && offered().includes('password')) {\n <button\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n [disabled]=\"busy\"\n type=\"button\"\n data-strategy=\"password\"\n (click)=\"usePassword.emit()\"\n >\n {{ t('signIn.passwordOption') }}\n </button>\n }\n </form>\n </div>\n `,\n})\nexport class AttemptFlowComponent {\n private readonly atlas = inject(AtlasService);\n\n @Input() attempt: AttemptView | null = null;\n @Input() busy = false;\n @Input() errors: FieldError[] = [];\n /** `FlowState.sessionKept`: whether this browser kept the session the sign-in created. */\n @Input() sessionKept: boolean | undefined = undefined;\n @Input() titleKey = 'signIn.title';\n /**\n * The sign-in captcha, drawn above the submit button on the identifier step\n * (an always-on sign-in captcha) and on the challenge step the server demands\n * with `needs_captcha`. Null when the flow draws none.\n */\n @Input() captcha: CaptchaController | null = null;\n /**\n * The first factors to offer on the `needs_first_factor` step — pass\n * `AtlasFlowController.firstFactors()`, which drops email code / link while the\n * app cannot deliver email. Null uses the server's list as-is.\n */\n @Input() firstFactors: string[] | null = null;\n /** The first factor already sent (`AtlasFlowController.preparedFactor()`): its code is collected. */\n @Input() preparedFactor: string | null = null;\n /** `FlowState.passwordHold`: where the proof went, and whether the password signs in now. */\n @Input() passwordHold: FlowState['passwordHold'] = null;\n /** `AtlasFlowController.holdProof()`: the emailed proof a password hold still waits on. */\n @Input() holdProof: 'email_code' | 'email_link' | null = null;\n\n /** Emits the collected field values when the form is submitted. */\n @Output() submitFlow = new EventEmitter<Record<string, string>>();\n /** Emits when the user picks a first factor the server must send first (an emailed code). */\n @Output() chooseFactor = new EventEmitter<'email_code' | 'email_link'>();\n /** Emits on \"Use your password instead\", from an emailed factor already sent. */\n @Output() usePassword = new EventEmitter<void>();\n /**\n * Offer \"Email me a code instead\" at the second factor (the instance's\n * `account.emailSecondFactor`); `emailSecondFactor` asks for it and\n * `emailedSecondFactor` reports how it went.\n */\n @Input() offerEmailSecondFactor = false;\n /** `AtlasFlowController.emailSecondFactor()`: in flight, where it went, or why not. */\n @Input() emailedSecondFactor: { busy?: boolean; sentTo?: string; error?: string } | null = null;\n @Output() emailSecondFactor = new EventEmitter<void>();\n /**\n * Offer \"Text me a code instead\" at the second factor (where the app offers\n * texted codes, `AtlasFlowController.mfaChoices().sms`); `smsSecondFactor`\n * asks for it and `textedSecondFactor` reports how it went.\n */\n @Input() offerSmsSecondFactor = false;\n /** `AtlasFlowController.smsSecondFactor()`: in flight, where it went, or why not. */\n @Input() textedSecondFactor: { busy?: boolean; sentTo?: string; error?: string } | null = null;\n @Output() smsSecondFactor = new EventEmitter<void>();\n /**\n * The MFA enrolment step (`AtlasFlowController.enrollment` and\n * `enrollmentState()`): the authenticator app's QR code and setup key, or a\n * texted code. Null: the step asks for two authenticator codes only.\n */\n @Input() enrollment: MfaEnrollmentController | null = null;\n @Input() enrollmentState: MfaEnrollmentState | null = null;\n /**\n * The instance's `account.emailVerification`. On `link` a sign-up's\n * verification step has nothing to type: it says to open the emailed link\n * while the flow polls, and offers a resend (`resend`).\n */\n @Input() emailVerification: string = 'code';\n @Output() resend = new EventEmitter<void>();\n /** The user declined a policy the sign-in was waiting on (`needs_policy_acceptance`): cancel the attempt. */\n @Output() policyDeclined = new EventEmitter<string>();\n\n protected values: Record<string, string> = {};\n\n protected t(key: string, vars?: Record<string, string>): string {\n return translate(this.atlas.localization, key, vars);\n }\n\n /** A server error in the app's language (`error.<reason>`, else the server's message). */\n protected errorText(error: FieldError): string {\n // `errorLocalization` is read defensively: a stand-in service may lack it.\n const layer = (this.atlas as { errorLocalization?: Record<string, string> }).errorLocalization;\n return localizedErrorMessage(error, layer ?? this.atlas.localization, this.atlas.localization);\n }\n\n protected cls(key: ElementKey, base: string): string {\n return classFor(key, this.atlas.appearance, base);\n }\n\n protected setValue(name: string, value: string): void {\n this.values = { ...this.values, [name]: value };\n }\n\n protected onSubmit(event: Event): void {\n event.preventDefault();\n // Enrolment: text the code to the typed number, or confirm the factor.\n if (this.enrolling() && this.enrollment) {\n void this.enrollment.submit(this.values).then((next) => {\n if (next) this.submitFlow.emit(next);\n });\n return;\n }\n // Only what is on screen: a code typed earlier must not turn a password into a code attempt.\n if (this.step().kind === 'collect_first_factor') {\n this.submitFlow.emit(this.preparedFactor === 'email_code' ? { code: this.values['code'] ?? '' } : { password: this.values['password'] ?? '' });\n return;\n }\n this.submitFlow.emit(this.values);\n }\n\n /** The shared enrolment step is drawn (a controller was passed and the flow is enrolling). */\n protected enrolling(): boolean {\n return this.step().kind === 'enroll_second_factor' && !!this.enrollment && !!this.enrollmentState;\n }\n\n protected chooseMethod(method: MfaEnrollmentStrategy): void {\n this.values = {};\n void this.enrollment?.choose(method);\n }\n\n protected resendEnrollment(): void {\n void this.enrollment?.resend();\n }\n\n protected otherMethods(state: MfaEnrollmentState): MfaEnrollmentStrategy[] {\n return state.options.filter((m) => m !== state.method);\n }\n\n protected setupKey(secret: string): string {\n return groupSetupKey(secret);\n }\n\n /** The submit button's label key (enrolment: \"Text me a code\" before the number is sent). */\n protected submitKey(): string {\n return (this.enrolling() && this.enrollmentState && enrollmentSubmitKey(this.enrollmentState)) || 'signIn.submit';\n }\n\n protected showSmsSecondFactor(): boolean {\n return this.offerSmsSecondFactor && this.step().kind === 'collect_second_factor';\n }\n\n /** Where the texted second-factor code went (masked), once it was sent. */\n protected smsSecondFactorSentTo(): string | null {\n const sent = this.textedSecondFactor?.sentTo;\n return typeof sent === 'string' ? sent || ' ' : null;\n }\n\n protected formErrors(): FieldError[] {\n return this.errors.filter((error) => !error.param);\n }\n\n protected fieldErrorsFor(name: string): FieldError[] {\n return this.errors.filter((error) => error.param === name);\n }\n\n protected step() {\n return this.attempt ? nextStep(this.attempt) : ({ kind: 'collect_identifier' } as const);\n }\n\n protected showCaptcha(): boolean {\n const kind = this.step().kind;\n return !!this.captcha && (kind === 'collect_identifier' || kind === 'collect_captcha');\n }\n\n /** The first factors on offer at a `needs_first_factor` step (empty on any other). */\n protected offered(): string[] {\n const step = this.step();\n if (step.kind !== 'collect_first_factor') return [];\n return this.firstFactors ?? step.strategies;\n }\n\n protected linkOnly(): boolean {\n return awaitingSignUpLink(this.attempt, this.emailVerification);\n }\n\n protected showEmailSecondFactor(): boolean {\n return this.offerEmailSecondFactor && this.step().kind === 'collect_second_factor';\n }\n\n /** Where the emailed second-factor code went (masked), once it was sent. */\n protected emailSecondFactorSentTo(): string | null {\n const sent = this.emailedSecondFactor?.sentTo;\n return typeof sent === 'string' ? sent || ' ' : null;\n }\n\n protected showEmailCodeOption(): boolean {\n // Before the code is sent: the choice (or the retry of a failed automatic\n // send). After: \"Resend code\".\n return this.offered().includes('email_code');\n }\n\n /** The \"we sent a code to …\" line on the code step. */\n protected codeSentText(): string | null {\n if (this.step().kind !== 'collect_first_factor' || this.preparedFactor !== 'email_code') return null;\n return this.t('signIn.codeSentTo', { email: this.passwordHold?.email ?? this.attempt?.identifier ?? '' });\n }\n\n /** The \"we sent a link to …\" line, once a link was sent. */\n protected linkSentText(): string | null {\n if (this.step().kind !== 'collect_first_factor' || this.preparedFactor !== 'email_link') return null;\n return this.t('signIn.linkSentTo', { email: this.passwordHold?.email ?? this.attempt?.identifier ?? '' });\n }\n\n /** The attempt is `needs_policy_acceptance`. */\n protected awaitingPolicies(): boolean {\n return this.step().kind === 'accept_policies';\n }\n\n protected showSubmit(): boolean {\n const kind = this.step().kind;\n // Nothing to submit on a first-factor step that only offers an emailed code\n // until that code is sent.\n if (kind === 'collect_first_factor') return this.fields().some((f) => f.kind === 'input');\n if (this.linkOnly()) return false;\n // Enrolment: nothing to submit while choosing a method or fetching the setup.\n if (this.enrolling() && this.enrollmentState && !enrollmentSubmitKey(this.enrollmentState)) return false;\n return kind !== 'done' && kind !== 'await_oauth' && kind !== 'accept_policies';\n }\n\n protected fields(): StepField[] {\n const step = this.step();\n switch (step.kind) {\n case 'collect_identifier':\n // `webauthn`: saved passkeys appear in this field's autofill while <atlas-sign-in> holds a conditional request.\n return [{ kind: 'input', name: 'identifier', labelKey: 'signIn.identifierLabel', type: 'email', autocomplete: 'username webauthn' }];\n case 'collect_first_factor': {\n if (this.preparedFactor === 'email_code') {\n return [{ kind: 'input', name: 'code', labelKey: 'signIn.emailCodeLabel', type: 'text' }];\n }\n if (this.preparedFactor === 'email_link') return [];\n // The password field unless the only offer is an emailed code (chosen\n // with the button below the form).\n const offered = this.offered();\n return offered.includes('email_code') && !offered.includes('password')\n ? []\n : [\n ...(this.passwordHold?.released ? [released()] : []),\n { kind: 'input', name: 'password', labelKey: 'signIn.passwordLabel', type: 'password' },\n ];\n }\n case 'collect_second_factor':\n return [{ kind: 'input', name: 'code', labelKey: 'mfa.codeLabel', type: 'text' }];\n case 'enroll_second_factor':\n // The shared enrolment step draws its own fields (above).\n if (this.enrolling()) return [];\n // Two consecutive codes (§5.6): a phone with a fast clock fails here\n // rather than on every sign-in afterwards.\n return [\n { kind: 'input', name: 'code', labelKey: 'mfa.enrollFirstCodeLabel', type: 'text' },\n { kind: 'input', name: 'secondCode', labelKey: 'mfa.enrollSecondCodeLabel', type: 'text' },\n ];\n case 'collect_email_code':\n return this.linkOnly() ? [] : [{ kind: 'input', name: 'code', labelKey: 'signIn.emailCodeLabel', type: 'text' }];\n case 'collect_new_password':\n return [{ kind: 'input', name: 'password', labelKey: 'reset.newPasswordLabel', type: 'password' }];\n case 'accept_policies':\n // Drawn by <atlas-policy-accept-step> above.\n return [];\n case 'collect_captcha':\n // §5 the server withheld the attempt until a captcha clears. Solving the\n // widget resubmits the identifier on its own; the button retries.\n return [msg('captcha.prompt')];\n case 'await_oauth':\n return [msg('signIn.magicLinkSent')];\n case 'done':\n // Signed in only when this browser holds the session; a blocked cookie is said\n // plainly. \"Check the other tab\" is for a sign-in completed on another device.\n if (this.sessionKept === true) return [msg('signIn.signedIn')];\n if (this.sessionKept === false) return [{ kind: 'alert', name: '', labelKey: 'signIn.sessionNotKept', type: 'text' }];\n return [msg('signIn.checkOtherTab')];\n case 'restart':\n return [msg('error.generic')];\n default:\n // A status this SDK version does not know. An honest message beats a\n // blank login box the user cannot act on.\n return [msg('error.generic')];\n }\n }\n}\n\n/** A read-only message row: `labelKey` holds the i18n key of the text to show. */\nfunction msg(labelKey: string): StepField {\n return { kind: 'message', name: '', labelKey, type: 'text' };\n}\n\nfunction released(): StepField {\n return { kind: 'released', name: '', labelKey: 'signIn.passwordHoldReleased', type: 'text' };\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n inject,\n} from '@angular/core';\nimport { canDownloadRecoveryCodes, copyRecoveryCodes, downloadRecoveryCodes } from '@atlasauth/js';\nimport { AtlasService } from '../atlas.service';\nimport { classFor, type ElementKey } from '../appearance';\nimport { translate } from '../i18n';\n\n/**\n * The recovery codes a mid-sign-in MFA enrolment came with, shown once before\n * the sign-in finishes: copy them, download them as a .txt file, then\n * \"I've saved my codes\" (`saved`) exchanges the ticket. The codes live only in\n * the flow controller's memory and are forgotten once saved.\n */\n@Component({\n selector: 'atlas-recovery-codes',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div [class]=\"cls('card', 'atlas-card')\" data-atlas=\"recovery-codes\">\n <h1 [class]=\"cls('headerTitle', 'atlas-title')\">{{ t('mfa.recoveryCodesTitle') }}</h1>\n <p class=\"atlas-text\">{{ t('mfa.recoveryCodesHelp') }}</p>\n <ul\n class=\"atlas-recovery-codes\"\n data-atlas=\"recovery-codes-list\"\n style=\"list-style:none;padding:0;margin:8px 0 12px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;text-align:center\"\n >\n @for (code of codes; track code) {\n <li><code>{{ code }}</code></li>\n }\n </ul>\n <div class=\"atlas-alternatives\">\n @if (canCopy) {\n <button [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" type=\"button\" data-atlas=\"recovery-codes-copy\" (click)=\"copy()\">\n {{ t('mfa.recoveryCodesCopy') }}\n </button>\n }\n @if (canDownload) {\n <button [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" type=\"button\" data-atlas=\"recovery-codes-download\" (click)=\"download()\">\n {{ t('mfa.recoveryCodesDownload') }}\n </button>\n }\n </div>\n @if (copied) {\n <p class=\"atlas-text\" aria-live=\"polite\" data-atlas=\"recovery-codes-copied\">{{ t('mfa.recoveryCodesCopied') }}</p>\n }\n <button [class]=\"cls('formButtonPrimary', 'atlas-button')\" type=\"button\" data-atlas=\"recovery-codes-saved\" [disabled]=\"busy\" (click)=\"saved.emit()\">\n {{ t('mfa.recoveryCodesSaved') }}\n </button>\n </div>\n `,\n})\nexport class RecoveryCodesComponent implements OnChanges {\n private readonly atlas = inject(AtlasService);\n private readonly cdr = inject(ChangeDetectorRef);\n\n @Input() codes: string[] = [];\n @Input() busy = false;\n @Output() saved = new EventEmitter<void>();\n\n protected readonly canCopy = typeof navigator !== 'undefined' && !!navigator.clipboard?.writeText;\n protected readonly canDownload = canDownloadRecoveryCodes();\n protected copied = false;\n\n ngOnChanges(): void {\n this.copied = false;\n }\n\n protected t(key: string): string {\n return translate(this.atlas.localization, key);\n }\n\n protected cls(key: ElementKey, base: string): string {\n return classFor(key, this.atlas.appearance, base);\n }\n\n protected copy(): void {\n void copyRecoveryCodes(this.codes).then((ok) => {\n this.copied = ok;\n this.cdr.markForCheck();\n });\n }\n\n protected download(): void {\n downloadRecoveryCodes(this.codes);\n }\n}\n","import { WritableSignal, signal } from '@angular/core';\nimport {\n FapiClient,\n advanceWithCaptcha,\n atlasCaptchaLabels,\n attemptPasswordHoldProof,\n preparePasswordHoldProof,\n createCaptchaController,\n createPasskeySignInController,\n createPasskeySignUp,\n createSignUp,\n finishPasskeySignUp,\n fetchInstanceSettings,\n fetchLastSignInMethod,\n startSignInWithAtlas,\n createMfaEnrollment,\n acknowledgeExistingAccount,\n acknowledgeRecoveryCodes,\n pendingExistingAccountNotice,\n pendingRecoveryCodes,\n mfaChoicesFrom,\n prepareSecondFactorCode,\n resendSignUpVerification,\n flowNeedsCaptcha,\n signInCaptchaOptions,\n flowFromPending,\n initialFlow,\n nextStep,\n offeredFirstFactors,\n pollAttempt,\n prepareFactor,\n planFirstFactor,\n shouldKeepPolling,\n PolicyAcceptanceController,\n loadPolicies,\n type CaptchaController,\n type FlowState,\n type InstanceSettings,\n type MfaChoices,\n type MfaEnrollmentController,\n type MfaEnrollmentState,\n type PasskeySignInController,\n} from '@atlasauth/js';\nimport { EN_US, translate } from '../i18n';\n\n/**\n * The server-driven sign-in / sign-up engine, shared by `<atlas-sign-in>` and\n * `<atlas-sign-up>` — the Angular counterpart of React's `useFlow` hook.\n *\n * It owns no decision about what comes next: every status comes back from the\n * server via `advance`, and this controller only posts whatever the current step\n * needs and re-renders the returned status. State lives in a signal so templates\n * update whether the app runs zoned or zoneless.\n *\n * `<atlas-sign-up>` starts the attempt with {@link create}\n * (`POST /v1/client/sign_ups`); the emailed-code step then runs through the same\n * {@link submit}. Both flows draw the instance's captcha (from\n * {@link loadSettings}) when it is required.\n */\nexport class AtlasFlowController {\n readonly state: WritableSignal<FlowState>;\n /**\n * The instance's public sign-in / sign-up settings (captcha, sign-up fields,\n * legal consent) from `GET /v1/appearance`; null until {@link loadSettings}\n * resolves, or when the server could not be reached.\n */\n readonly settings = signal<InstanceSettings | null>(null);\n /**\n * The method this browser last signed in with (`password`, `oauth_github`, …)\n * for the \"Last used\" hint; null when none, or the instance turned it off.\n */\n readonly lastMethod = signal<string | null>(null);\n /** The sign-in captcha (identifier step / `needs_captcha` challenge). */\n readonly captcha: CaptchaController = createCaptchaController(undefined, {\n // The Atlas captcha's words follow the form's catalog (read when drawn).\n atlasLabels: () => atlasCaptchaLabels(this.t),\n });\n /** The sign-up captcha (the create-account step). */\n readonly signUpCaptcha: CaptchaController = createCaptchaController(undefined, {\n atlasLabels: () => atlasCaptchaLabels(this.t),\n });\n /** Whether {@link captcha} currently draws a widget (for templates). */\n readonly captchaDrawn = signal(false);\n /** Whether {@link signUpCaptcha} currently draws a widget (for templates). */\n readonly signUpCaptchaDrawn = signal(false);\n /**\n * The first factor the server was asked to send ({@link prepare}) on the\n * current `needs_first_factor` step — the form then collects its code. Null\n * otherwise.\n */\n readonly preparedFactor = signal<'email_code' | 'email_link' | null>(null);\n /**\n * \"Email me a code instead\" at the second factor ({@link sendEmailSecondFactor}):\n * in flight, where the code went, or why it was not sent. Null until asked,\n * and again once the flow leaves that step.\n */\n readonly emailSecondFactor = signal<{ busy?: boolean; sentTo?: string; error?: string } | null>(null);\n /** \"Text me a code instead\" at the second factor ({@link sendSmsSecondFactor}): as {@link emailSecondFactor}. */\n readonly smsSecondFactor = signal<{ busy?: boolean; sentTo?: string; error?: string } | null>(null);\n /**\n * The MFA enrolment step (`needs_mfa_enrollment`): the authenticator app's\n * setup (QR code, setup key) or a texted code. Started and reset with the flow.\n */\n readonly enrollment: MfaEnrollmentController;\n /** {@link enrollment}'s state, for templates. */\n readonly enrollmentState: WritableSignal<MfaEnrollmentState>;\n /**\n * The instance's policies (terms, privacy, …) for the create-account form:\n * {@link create} sends their acceptances and reloads them after a refusal.\n */\n readonly policies = new PolicyAcceptanceController([]);\n /**\n * Passkey sign-in (the \"Sign in with a passkey\" button and passkey autofill on\n * the identifier field). The outcome goes through the same completion as every sign-in.\n */\n readonly passkey: PasskeySignInController;\n /** Whether this browser can run WebAuthn; `<atlas-sign-in>` sets it after it is created in a browser. */\n readonly passkeySupported = signal(false);\n private pollTimer: ReturnType<typeof setInterval> | null = null;\n private identifier = '';\n\n constructor(\n private readonly client: FapiClient,\n private readonly reload: () => Promise<boolean>,\n pending: { id: string; status: string } | null,\n /** Resolves the captcha messages' catalog keys. Defaults to en-US. */\n private readonly t: (key: string) => string = (key) => translate(EN_US, key),\n /** Wait for {@link continueAfterExistingAccount} (`<atlas-sign-up>` draws the notice). */\n private readonly holdExistingAccountNotice = false,\n ) {\n // Seeded from a redirect that came back mid-flow (e.g. OAuth needing a second\n // factor) so the user resumes at the demanded step instead of starting over.\n this.state = signal<FlowState>(pending ? flowFromPending(pending) : initialFlow);\n this.enrollment = createMfaEnrollment(this.client, () => this.mfaChoices());\n this.enrollmentState = signal<MfaEnrollmentState>(this.enrollment.state);\n this.enrollment.subscribe((next) => this.enrollmentState.set(next));\n this.passkey = createPasskeySignInController({\n client: this.client,\n onStart: () => this.state.update((current) => ({ ...current, busy: true, errors: [] })),\n onResult: (next) => this.finish(next),\n captcha: () => this.captcha,\n cancelledMessage: () => this.t('signIn.passkeyCancelled'),\n });\n this.syncCaptcha();\n this.syncEnrollment();\n }\n\n /** Why \"Continue with Atlas\" could not start (the server's message); null otherwise. */\n readonly signInWithAtlasError = signal<string | null>(null);\n\n /**\n * \"Continue with Atlas\" (when `settings().signInWithAtlas` is set): starts the\n * SSO sign-in and sends the browser to Atlas.\n */\n async signInWithAtlas(connectionId: string): Promise<void> {\n if (typeof window === 'undefined') return;\n this.signInWithAtlasError.set(null);\n const started = await startSignInWithAtlas(this.client, connectionId, window.location.href);\n if ('url' in started) window.location.assign(started.url);\n else this.signInWithAtlasError.set(started.error);\n }\n\n /** \"Sign in with a passkey\" is offered: the first step, the instance turned passkey sign-in on, and the browser can. */\n passkeyOffered(): boolean {\n return this.passkeySupported() && !this.state().attempt && this.settings()?.passkeySignIn === true;\n }\n\n /** What the app lets the MFA steps offer (from {@link settings}). */\n mfaChoices(): MfaChoices {\n return mfaChoicesFrom(this.settings()?.account);\n }\n\n /** Start the enrolment step for its attempt, or reset it once the flow leaves. */\n private syncEnrollment(): void {\n const attempt = this.state().attempt;\n if (attempt?.status === 'needs_mfa_enrollment' && attempt.id) this.enrollment.start(attempt.id);\n else this.enrollment.reset();\n }\n\n /** Fetch the instance's public settings and draw whatever captcha they require. */\n async loadSettings(): Promise<void> {\n const loaded = await fetchInstanceSettings(this.client);\n if (loaded) {\n this.settings.set(loaded);\n this.syncCaptcha();\n if (loaded.account.lastSignInMethod) this.lastMethod.set(await fetchLastSignInMethod(this.client));\n }\n }\n\n /**\n * The first factors to offer on a `needs_first_factor` step: the server's list\n * without email code / link while the app cannot deliver email\n * (`settings.emailDelivery.available === false`). Empty on any other step.\n */\n firstFactors(): string[] {\n const attempt = this.state().attempt;\n const step = attempt ? nextStep(attempt) : null;\n if (step?.kind !== 'collect_first_factor') return [];\n const offered = offeredFirstFactors(step.strategies, this.settings()?.emailDelivery);\n const proof = this.holdProof();\n return proof && !offered.includes(proof) ? [...offered, proof] : offered;\n }\n\n /**\n * The emailed proof a password hold still waits on (`FlowState.passwordHold`): the\n * code, or a link where the instance verifies by link only. Null with no hold, once\n * proven, or while the app cannot deliver email.\n */\n holdProof(): 'email_code' | 'email_link' | null {\n const hold = this.state().passwordHold;\n if (!hold || hold.released || this.settings()?.emailDelivery?.available === false) return null;\n return this.settings()?.account?.emailVerification === 'link' ? 'email_link' : 'email_code';\n }\n\n /** Back from the emailed factor to the password field. */\n usePassword(): void {\n this.preparedFactor.set(null);\n this.state.update((current) => ({ ...current, prepared: null, pollSecret: null, errors: [] }));\n }\n\n /**\n * True when email + password sign-up cannot complete because the app cannot\n * send the verification email (`settings.emailDelivery.passwordSignUp === false`):\n * `<atlas-sign-up>` shows the \"can't send email\" notice instead of the form.\n */\n signUpEmailUnavailable(): boolean {\n return this.settings()?.emailDelivery.passwordSignUp === false;\n }\n\n /** False when a password reset email cannot be delivered — hide \"Forgot password?\". */\n passwordResetAvailable(): boolean {\n return this.settings()?.emailDelivery.passwordReset !== false;\n }\n\n /**\n * Ask the server to email a sign-in code for the current `needs_first_factor`\n * step (`POST …/prepare_first_factor`); the form then collects the code, which\n * {@link submit} posts as the `email_code` strategy. While a password hold waits\n * on it ({@link holdProof}), this emails that proof instead.\n */\n async prepare(strategy: 'email_code' | 'email_link'): Promise<void> {\n if (!this.firstFactors().includes(strategy)) return;\n const proof = this.holdProof();\n this.state.update((current) => ({ ...current, busy: true, errors: [] }));\n const next =\n strategy === proof\n ? await preparePasswordHoldProof(this.client, this.state(), proof)\n : await prepareFactor(this.client, this.state(), strategy);\n this.setState(next);\n if (!next.errors.length) this.preparedFactor.set(strategy);\n this.syncPolling();\n }\n\n /** Keep both captchas in step with the settings and the flow's current step. */\n private syncCaptcha(): void {\n const settings = this.settings();\n const state = this.state();\n this.captcha.configure(\n signInCaptchaOptions(settings?.captchaFlows.signIn, state, () => void this.submit({})),\n );\n const signUpFlow = settings?.captchaFlows.signUp;\n this.signUpCaptcha.configure({\n flow: signUpFlow,\n active: !state.attempt && flowNeedsCaptcha(signUpFlow),\n });\n this.captchaDrawn.set(this.captcha.needed);\n this.signUpCaptchaDrawn.set(this.signUpCaptcha.needed);\n }\n\n private setState(next: FlowState): void {\n const previous = this.state();\n const previousId = previous.attempt?.id ?? null;\n this.state.set(next);\n // A proven hold goes back to the password field.\n if (next.passwordHold?.released && !previous.passwordHold?.released) this.preparedFactor.set(null);\n // A prepared factor belongs to the first-factor step it was sent for.\n if (next.attempt?.status !== 'needs_first_factor') this.preparedFactor.set(null);\n // An emailed second-factor code belongs to the second-factor step of this attempt.\n if (next.attempt?.status !== 'needs_second_factor' || (next.attempt?.id ?? null) !== previousId) {\n this.emailSecondFactor.set(null);\n this.smsSecondFactor.set(null);\n }\n this.syncCaptcha();\n this.syncEnrollment();\n this.autoSend();\n }\n\n private autoSentFor: string | null = null;\n /**\n * With no password on offer, email the code as soon as the server asks for a\n * first factor — once per attempt, so a failed send waits for the user's retry\n * (the \"Email me a code\" button) instead of looping.\n */\n private autoSend(): void {\n const id = this.state().attempt?.id ?? null;\n if (!id || this.autoSentFor === id || this.preparedFactor()) return;\n if (planFirstFactor(this.firstFactors()).autoSend !== 'email_code') return;\n this.autoSentFor = id;\n void this.prepare('email_code');\n }\n\n /**\n * Advance the flow with the values the user typed. On completion, exchange the\n * one-time ticket for cookies over a same-origin request (FAPI is cross-origin\n * and cannot set the cookie on its own response), then re-boot so the rest of\n * the app sees a signed-in user.\n */\n async submit(values: Record<string, string>): Promise<void> {\n this.state.update((current) => ({ ...current, busy: true, errors: [] }));\n\n // A code that lifts a password hold goes to its own attempt, not this sign-in.\n if (this.preparedFactor() === 'email_code' && this.holdProof() === 'email_code') {\n this.setState(await attemptPasswordHoldProof(this.client, this.state(), values.code ?? ''));\n return;\n }\n const out = await advanceWithCaptcha(this.client, this.state(), values, {\n captcha: this.captcha,\n identifier: this.identifier,\n t: this.t,\n });\n this.identifier = out.identifier;\n await this.finish(out.state);\n }\n\n /** Load the sign-up's policies into {@link policies} (`<atlas-sign-up>` calls it on init). */\n async loadPolicies(locale?: string): Promise<void> {\n this.policies.setPolicies(await loadPolicies(this.client, { locale }));\n }\n\n /** The user declined a policy a sign-in was waiting on: cancel the attempt and say why. */\n declinePolicy(title: string): void {\n this.state.set({\n ...initialFlow,\n errors: [{ code: 'POLICY_DECLINED', message: this.t('policy.declined').replace('{policy}', title) }],\n });\n }\n\n /**\n * Create an account (`POST /v1/client/sign_ups`) from a create-account form's\n * values — email, password and any configured sign-up fields — carrying the\n * sign-up captcha's token when the instance requires one. The emailed code is\n * then posted with {@link submit}.\n */\n async create(values: Record<string, string>, consent = true): Promise<void> {\n this.state.update((current) => ({ ...current, busy: true, errors: [] }));\n const next = await createSignUp(this.client, values, {\n consent,\n captcha: this.signUpCaptcha,\n t: this.t,\n policies: this.policies,\n });\n await this.finish(next);\n }\n\n /**\n * \"Email me a code instead\" at the second factor (the instance's\n * `account.emailSecondFactor`): mails a code to the account's verified email;\n * it is then posted with {@link submit} like any 2FA code.\n */\n async sendEmailSecondFactor(): Promise<void> {\n await this.sendSecondFactorCode('email_code', this.emailSecondFactor);\n }\n\n /**\n * \"Text me a code instead\" at the second factor (where the app offers texted\n * codes, {@link mfaChoices}`().sms`): texts a code to the account's enrolled\n * phone; it is then posted with {@link submit} like any 2FA code.\n */\n async sendSmsSecondFactor(): Promise<void> {\n await this.sendSecondFactorCode('sms', this.smsSecondFactor);\n }\n\n private async sendSecondFactorCode(\n strategy: 'sms' | 'email_code',\n out: WritableSignal<{ busy?: boolean; sentTo?: string; error?: string } | null>,\n ): Promise<void> {\n const id = this.state().attempt?.id;\n if (!id) return;\n out.set({ busy: true });\n try {\n const { sentTo } = await prepareSecondFactorCode(this.client, id, strategy);\n out.set({ sentTo });\n } catch (error) {\n out.set({ error: error instanceof Error ? error.message : this.t('error.generic') });\n }\n }\n\n /** Resend a sign-up's emailed code / link (the earlier one stops working). */\n async resendSignUp(): Promise<void> {\n this.state.update((current) => ({ ...current, busy: true, errors: [] }));\n this.state.set(await resendSignUpVerification(this.client, this.state()));\n }\n\n /**\n * Start a passkey-only sign-up (`POST /v1/client/sign_ups/passkey`) from the\n * create-account form's values — no password. Offered when the instance's\n * `account.passkeySignUp` is set.\n */\n async createWithPasskey(values: Record<string, string>, consent = true): Promise<void> {\n this.state.update((current) => ({ ...current, busy: true, errors: [] }));\n await this.finish(await createPasskeySignUp(this.client, values, { consent, captcha: this.signUpCaptcha, t: this.t, policies: this.policies }));\n }\n\n /** The passkey-only sign-up's last step: create the passkey, and with it the account. */\n async createPasskey(): Promise<void> {\n this.state.update((current) => ({ ...current, busy: true, errors: [] }));\n await this.finish(await finishPasskeySignUp(this.client, this.state(), { t: this.t }));\n }\n\n /**\n * The recovery codes an MFA enrolment just completed the sign-in with, shown\n * once before it finishes ({@link saveRecoveryCodes}); null otherwise. They\n * live only in this controller's memory.\n */\n recoveryCodes(): string[] | null {\n return pendingRecoveryCodes(this.state());\n }\n\n /** \"I've saved my codes\": forget the recovery codes and finish the sign-in. */\n async saveRecoveryCodes(): Promise<void> {\n await this.finish(acknowledgeRecoveryCodes(this.state()));\n }\n\n /** The address belonged to an existing account: the notice is up until {@link continueAfterExistingAccount}. */\n existingAccountNotice(): boolean {\n return pendingExistingAccountNotice(this.state());\n }\n\n /** The user read the notice: finish the sign-up. */\n async continueAfterExistingAccount(): Promise<void> {\n await this.finish(acknowledgeExistingAccount(this.state()));\n }\n\n private async finish(next: FlowState): Promise<void> {\n // An enrolment's recovery codes are shown first; `saveRecoveryCodes` finishes.\n if (pendingRecoveryCodes(next)) {\n // The ticket dies in 60 seconds and saving the codes can take longer: redeem it now,\n // and `saveRecoveryCodes` finishes. A refused exchange keeps the ticket, so the save reports it.\n this.setState({ ...next, busy: true });\n const res = next.ticket\n ? await this.client.post('/v1/client/tickets/exchange', { attempt_id: (next.attempt as { id?: string }).id, ticket: next.ticket })\n : null;\n this.setState({ ...next, busy: false, ticket: res?.ok ? null : next.ticket });\n return;\n }\n if (next.attempt?.status === 'complete') {\n // Stays busy until this browser actually holds the session: the completion\n // alone says nothing about whether the cookie was kept.\n this.setState({ ...next, busy: true });\n let exchanged = true;\n if (next.ticket) {\n const res = await this.client.post('/v1/client/tickets/exchange', {\n attempt_id: (next.attempt as { id?: string }).id,\n ticket: next.ticket,\n });\n exchanged = res.ok;\n }\n if (exchanged && this.holdExistingAccountNotice && pendingExistingAccountNotice(next)) {\n this.setState({ ...next, ticket: null, busy: false });\n return;\n }\n const kept = exchanged && (await this.reload());\n this.setState({ ...next, busy: false, sessionKept: kept });\n } else {\n this.setState(next);\n // A magic-link step may now be pollable (a link opened on another device).\n this.syncPolling();\n }\n }\n\n /** Start/stop the §5.3 magic-link poll to match the current state. */\n syncPolling(): void {\n if (shouldKeepPolling(this.state())) {\n this.startPolling();\n } else {\n this.stopPolling();\n }\n }\n\n private startPolling(): void {\n if (this.pollTimer) return;\n this.pollTimer = setInterval(() => {\n void (async () => {\n const { state: next, ticket } = await pollAttempt(this.client, this.state());\n this.setState(next);\n // e.g. a passkey sign-up whose email was just proven: only this tab can go on.\n if (!ticket && !shouldKeepPolling(next)) this.stopPolling();\n if (!ticket || !next.attempt) return;\n\n // The ticket is exchanged by a normal request, so no session token ever\n // appears in a URL.\n const res = await this.client.post('/v1/client/tickets/exchange', {\n attempt_id: (next.attempt as { id?: string }).id,\n ticket,\n });\n const kept = res.ok && (await this.reload());\n this.setState({ ...this.state(), sessionKept: kept });\n this.stopPolling();\n })();\n }, 2_000);\n }\n\n private stopPolling(): void {\n if (this.pollTimer) {\n clearInterval(this.pollTimer);\n this.pollTimer = null;\n }\n }\n\n /** Release the poll timer and the captcha widgets — call from the component's `ngOnDestroy`. */\n destroy(): void {\n this.passkey.stopAutofill();\n this.stopPolling();\n this.captcha.destroy();\n this.signUpCaptcha.destroy();\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n Input,\n OnDestroy,\n OnInit,\n computed,\n effect,\n inject,\n} from '@angular/core';\nimport { lastUsedMethodLabel, passkeysSupported, signUp as hostedSignUp } from '@atlasauth/js';\nimport { AtlasService } from '../atlas.service';\nimport { translate } from '../i18n';\nimport { AttemptFlowComponent } from './attempt-flow.component';\nimport { RecoveryCodesComponent } from './recovery-codes.component';\nimport { AtlasFlowController } from './flow-controller';\n\n/**\n * `<atlas-sign-in>` — the full, multi-step sign-in flow driven entirely by the\n * server-side attempt status. The Angular peer of React's `<SignIn/>`. Draws the\n * instance's sign-in captcha when it is required (always-on, or a\n * `needs_captcha` challenge).\n *\n * ```html\n * <atlas-sign-in *atlasSignedOut afterUrl=\"/dashboard\"></atlas-sign-in>\n * ```\n */\n@Component({\n selector: 'atlas-sign-in',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AttemptFlowComponent, RecoveryCodesComponent],\n template: `\n @if (lastUsedLabel(); as label) {\n <p class=\"atlas-text atlas-last-used-hint\" data-atlas=\"last-used\" [attr.data-atlas-method]=\"flow.lastMethod()\">\n {{ t('signIn.lastUsed') }}: {{ label }}\n </p>\n }\n @if (atlasConnection(); as connectionId) {\n <button type=\"button\" class=\"atlas-social-button\" data-atlas-provider=\"atlas\" (click)=\"flow.signInWithAtlas(connectionId)\">\n {{ t('signIn.continueWithAtlas') }}\n </button>\n @if (flow.signInWithAtlasError(); as message) {\n <p class=\"atlas-error\" role=\"alert\">{{ message }}</p>\n }\n }\n @if (flow.recoveryCodes(); as codes) {\n <atlas-recovery-codes [codes]=\"codes\" [busy]=\"flow.state().busy\" (saved)=\"flow.saveRecoveryCodes()\"></atlas-recovery-codes>\n } @else {\n <atlas-attempt-flow\n [attempt]=\"flow.state().attempt\"\n [busy]=\"flow.state().busy\"\n [errors]=\"flow.state().errors\"\n [sessionKept]=\"flow.state().sessionKept\"\n titleKey=\"signIn.title\"\n [captcha]=\"flow.captchaDrawn() ? flow.captcha : null\"\n [firstFactors]=\"flow.firstFactors()\"\n [preparedFactor]=\"flow.preparedFactor()\"\n [passwordHold]=\"flow.state().passwordHold ?? null\"\n [holdProof]=\"flow.holdProof()\"\n (usePassword)=\"flow.usePassword()\"\n [offerEmailSecondFactor]=\"flow.settings()?.account?.emailSecondFactor === true\"\n [emailedSecondFactor]=\"flow.emailSecondFactor()\"\n (submitFlow)=\"submitIdentifier($event)\"\n (chooseFactor)=\"flow.prepare($event)\"\n [offerSmsSecondFactor]=\"flow.settings() !== null && flow.mfaChoices().sms\"\n [textedSecondFactor]=\"flow.smsSecondFactor()\"\n [enrollment]=\"flow.enrollment\"\n [enrollmentState]=\"flow.enrollmentState()\"\n (emailSecondFactor)=\"flow.sendEmailSecondFactor()\"\n (smsSecondFactor)=\"flow.sendSmsSecondFactor()\"\n (policyDeclined)=\"flow.declinePolicy($event)\"\n ></atlas-attempt-flow>\n }\n @if (flow.passkeyOffered() && !flow.recoveryCodes()) {\n <button\n type=\"button\"\n class=\"atlas-social-button atlas-passkey-button\"\n data-atlas-passkey-sign-in=\"\"\n [disabled]=\"flow.state().busy\"\n (click)=\"flow.passkey.signIn()\"\n >\n {{ t('signIn.passkeyButton') }}\n </button>\n }\n @if (flow.state().attempt?.status !== 'complete' && signUpHref(); as href) {\n <p class=\"atlas-footer\" data-atlas-sign-up-prompt=\"\">\n {{ t('signIn.noAccount') }} <a class=\"atlas-link\" [href]=\"href\">{{ t('signIn.signUpLink') }}</a>\n </p>\n }\n `,\n})\nexport class SignInComponent implements OnInit, OnDestroy {\n private readonly atlas = inject(AtlasService);\n\n /** Where to send the user once the flow completes. Reserved for host routing. */\n @Input() afterUrl?: string;\n /**\n * Where \"No account? Sign up\" goes. Default: the instance's hosted sign-up\n * page (carrying the visitor's referral). `null` hides it. Always shown, never\n * only after a failed sign-in, so it says nothing about whether an email has an account.\n */\n @Input() signUpUrl?: string | null;\n\n protected t(key: string): string {\n return translate(this.atlas.localization, key);\n }\n\n /** \"Last used: Password\" on the identifier step, when the instance shows the hint. */\n protected lastUsedLabel(): string | null {\n if (this.flow.state().attempt) return null;\n return lastUsedMethodLabel(this.flow.lastMethod(), (key) => this.t(key));\n }\n\n /** The \"Sign in with Atlas\" connection, on the first step, when the instance has it on. */\n protected atlasConnection(): string | null {\n if (this.flow.state().attempt || this.flow.recoveryCodes()) return null;\n return this.flow.settings()?.signInWithAtlas?.connectionId ?? null;\n }\n\n protected signUpHref(): string | null {\n if (this.signUpUrl === null) return null;\n if (this.signUpUrl) return this.signUpUrl;\n try {\n return hostedSignUp({\n frontendApi: this.atlas.frontendApi,\n redirectUrl: this.afterUrl ?? (typeof window !== 'undefined' ? window.location.href : undefined),\n navigate: false,\n });\n } catch {\n return null;\n }\n }\n\n protected readonly flow = new AtlasFlowController(\n this.atlas.createFapiClient(),\n () => this.atlas.reload(),\n // Resume mid-flow if an OAuth redirect came back owing a second factor.\n this.atlas.pendingAttempt,\n (key) => translate(this.atlas.localization, key),\n );\n\n // Passkey autofill runs while the first step offers passkeys (a computed, so it re-arms only when that changes).\n private readonly passkeyOffered = computed(() => this.flow.passkeyOffered());\n protected readonly passkeyAutofill = effect(() => (this.passkeyOffered() ? this.flow.passkey.armAutofill() : this.flow.passkey.stopAutofill()));\n\n protected submitIdentifier(values: Record<string, string>): void {\n this.flow.passkey.stopAutofill();\n void this.flow.submit(values);\n }\n\n ngOnInit(): void {\n if (typeof window !== 'undefined') this.flow.passkeySupported.set(passkeysSupported());\n // If seeded from a pending attempt that is already pollable, start polling.\n this.flow.syncPolling();\n // §5 the instance's captcha settings (switching captcha on in the dashboard\n // draws it here with no code change) and email delivery (no emailed-code\n // option while the app cannot send email).\n if (typeof window !== 'undefined') void this.flow.loadSettings();\n }\n\n ngOnDestroy(): void {\n this.flow.destroy();\n }\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n inject,\n type SimpleChanges,\n} from '@angular/core';\nimport {\n confirmPolicies,\n localizedErrorMessage,\n type PolicyAcceptanceController,\n type CaptchaController,\n type FieldError,\n type InstanceSettings,\n type PublicSignUpField,\n} from '@atlasauth/js';\nimport { AtlasService } from '../atlas.service';\nimport { classFor, type ElementKey } from '../appearance';\nimport { translate } from '../i18n';\nimport { AtlasCaptchaSlotDirective } from '../directives/captcha-slot.directive';\nimport { AtlasPoliciesDirective, policyUi } from './policy-host';\n\n/** What the create-account form emits: the values typed plus the consent tick. */\nexport interface SignUpFormSubmit {\n values: Record<string, string>;\n consent: boolean;\n}\n\n/**\n * The create-account step of `<atlas-sign-up>`: the instance's configured extra\n * fields, email + password, the legal-consent row and — when the instance\n * requires one on sign-up — the captcha widget. Values live on the component so\n * a refused submit never clears them. When the app cannot send the verification\n * email (`settings.emailDelivery.passwordSignUp === false`) it shows the\n * `signUp.emailUnavailable` notice instead of the form.\n */\n@Component({\n selector: 'atlas-sign-up-form',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AtlasCaptchaSlotDirective, AtlasPoliciesDirective],\n template: `\n <div [class]=\"cls('card', 'atlas-card')\">\n <h1 [class]=\"cls('headerTitle', 'atlas-title')\">{{ t('signUp.title') }}</h1>\n\n @if (emailUnavailable()) {\n <!-- The app cannot send the verification email, so an email + password\n sign-up could never complete: say so instead of offering the form. -->\n <p [class]=\"cls('formFieldError', 'atlas-error')\" role=\"alert\" data-atlas-email-unavailable=\"\">\n {{ t('signUp.emailUnavailable') }}\n </p>\n } @else {\n @for (error of formErrors(); track error.code) {\n <p [class]=\"cls('formFieldError', 'atlas-error')\" role=\"alert\">{{ errorText(error) }}</p>\n }\n\n <form (submit)=\"onSubmit($event)\">\n @for (f of fields(); track f.key) {\n @if (f.type === 'radio' || f.type === 'multiselect') {\n <div [class]=\"cls('formField', 'atlas-field')\">\n <span [class]=\"cls('formFieldLabel', 'atlas-field-label')\">{{ label(f) }}</span>\n <span class=\"atlas-choices\">\n @for (o of f.options; track o) {\n <label class=\"atlas-choice\">\n <input\n [type]=\"f.type === 'radio' ? 'radio' : 'checkbox'\"\n [attr.name]=\"f.key\"\n [value]=\"o\"\n [checked]=\"picked(f.key).includes(o)\"\n (change)=\"toggle(f, o, $any($event.target).checked)\"\n />\n {{ o }}\n </label>\n }\n </span>\n @for (error of fieldErrorsFor(f.key); track error.code) {\n <span [class]=\"cls('formFieldError', 'atlas-error')\">{{ errorText(error) }}</span>\n }\n </div>\n } @else {\n <label [class]=\"cls('formField', 'atlas-field')\">\n <span [class]=\"cls('formFieldLabel', 'atlas-field-label')\">{{ label(f) }}</span>\n @if (f.type === 'checkbox') {\n <input\n type=\"checkbox\"\n [attr.name]=\"f.key\"\n [checked]=\"values[f.key] === 'true'\"\n (change)=\"setValue(f.key, $any($event.target).checked ? 'true' : '')\"\n />\n } @else if (f.type === 'select') {\n <select\n [class]=\"cls('formFieldInput', 'atlas-input')\"\n [attr.name]=\"f.key\"\n [value]=\"values[f.key] ?? ''\"\n [required]=\"f.required\"\n (change)=\"setValue(f.key, $any($event.target).value)\"\n >\n <option value=\"\">{{ f.placeholder ?? t('signUp.selectPlaceholder') }}</option>\n @for (o of f.options; track o) {\n <option [value]=\"o\">{{ o }}</option>\n }\n </select>\n } @else if (f.type === 'textarea') {\n <textarea\n [class]=\"cls('formFieldInput', 'atlas-input')\"\n [attr.name]=\"f.key\"\n rows=\"3\"\n [value]=\"values[f.key] ?? ''\"\n [required]=\"f.required\"\n [attr.placeholder]=\"f.placeholder\"\n (input)=\"setValue(f.key, $any($event.target).value)\"\n ></textarea>\n } @else {\n <input\n [class]=\"cls('formFieldInput', 'atlas-input')\"\n [type]=\"inputType(f)\"\n [attr.name]=\"f.key\"\n [value]=\"values[f.key] ?? ''\"\n [required]=\"f.required\"\n [attr.placeholder]=\"f.placeholder\"\n (input)=\"setValue(f.key, $any($event.target).value)\"\n />\n }\n @for (error of fieldErrorsFor(f.key); track error.code) {\n <span [class]=\"cls('formFieldError', 'atlas-error')\">{{ errorText(error) }}</span>\n }\n </label>\n }\n }\n\n @if (showEmail()) {\n <label [class]=\"cls('formField', 'atlas-field')\">\n <span [class]=\"cls('formFieldLabel', 'atlas-field-label')\">{{\n emailRequired() ? t('signUp.emailLabel') : t('signUp.optionalField', { label: t('signUp.emailLabel') })\n }}</span>\n <input\n [class]=\"cls('formFieldInput', 'atlas-input')\"\n type=\"email\"\n name=\"email\"\n autocomplete=\"email\"\n [required]=\"emailRequired()\"\n [value]=\"values['email'] ?? ''\"\n (input)=\"setValue('email', $any($event.target).value)\"\n />\n @for (error of fieldErrorsFor('email'); track error.code) {\n <span [class]=\"cls('formFieldError', 'atlas-error')\">{{ errorText(error) }}</span>\n }\n </label>\n }\n\n @if (passkey) {\n <p class=\"atlas-text\">{{ t('signUp.passkeyIntro') }}</p>\n } @else {\n <label [class]=\"cls('formField', 'atlas-field')\">\n <span [class]=\"cls('formFieldLabel', 'atlas-field-label')\">{{ t('signUp.passwordLabel') }}</span>\n <input\n [class]=\"cls('formFieldInput', 'atlas-input')\"\n type=\"password\"\n name=\"password\"\n autocomplete=\"new-password\"\n required\n [value]=\"values['password'] ?? ''\"\n (input)=\"setValue('password', $any($event.target).value)\"\n />\n @for (error of fieldErrorsFor('password'); track error.code) {\n <span [class]=\"cls('formFieldError', 'atlas-error')\">{{ errorText(error) }}</span>\n }\n </label>\n }\n\n @if (hasPolicies()) {\n <div [atlasPolicies]=\"policies\"></div>\n @if (declined) {\n <span [class]=\"cls('formFieldError', 'atlas-error')\" role=\"alert\" data-atlas-policy-declined=\"\">\n {{ t('policy.declined', { policy: declined }) }}\n </span>\n }\n }\n\n @if (showLegal()) {\n <label [class]=\"cls('formField', 'atlas-consent')\">\n @if (settings?.legal?.required) {\n <input\n type=\"checkbox\"\n name=\"consent\"\n [checked]=\"agreed\"\n (change)=\"agreed = $any($event.target).checked\"\n />\n }\n <span class=\"atlas-text\">\n {{ t(settings?.legal?.required ? 'signUp.consentAgree' : 'signUp.consentNotice') }}\n @if (settings?.legal?.termsUrl; as terms) {\n <a class=\"atlas-link\" [href]=\"terms\" target=\"_blank\" rel=\"noopener noreferrer\">{{ t('signUp.terms') }}</a>\n }\n @if (settings?.legal?.termsUrl && settings?.legal?.privacyUrl) {\n {{ t('signUp.and') }}\n }\n @if (settings?.legal?.privacyUrl; as privacy) {\n <a class=\"atlas-link\" [href]=\"privacy\" target=\"_blank\" rel=\"noopener noreferrer\">{{ t('signUp.privacy') }}</a>\n }.\n </span>\n @for (error of fieldErrorsFor('consent'); track error.code) {\n <span [class]=\"cls('formFieldError', 'atlas-error')\">{{ errorText(error) }}</span>\n }\n </label>\n }\n\n @if (captcha) {\n <div class=\"atlas-captcha\" data-atlas-captcha=\"\" [atlasCaptchaSlot]=\"captcha\"></div>\n }\n\n <button\n [class]=\"cls('formButtonPrimary', 'atlas-button')\"\n [disabled]=\"busy || !consentOk()\"\n type=\"submit\"\n >\n {{ t('signUp.submit') }}\n </button>\n @if (hasPolicies()) {\n <p atlasPolicyKind=\"clickwrap\" [atlasPolicies]=\"policies\"></p>\n }\n @if (switchable) {\n <div class=\"atlas-alternatives\">\n <button\n type=\"button\"\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n [attr.data-atlas-sign-up-mode]=\"passkey ? 'password' : 'passkey'\"\n [disabled]=\"busy\"\n (click)=\"switchMode.emit()\"\n >\n {{ t(passkey ? 'signUp.passwordOption' : 'signUp.passkeyOption') }}\n </button>\n </div>\n }\n </form>\n }\n </div>\n `,\n})\nexport class SignUpFormComponent implements OnChanges, OnDestroy {\n private readonly atlas = inject(AtlasService);\n private readonly cdr = inject(ChangeDetectorRef);\n private unwatch: (() => void) | null = null;\n\n @Input() settings: InstanceSettings | null = null;\n @Input() busy = false;\n @Input() errors: FieldError[] = [];\n @Input() captcha: CaptchaController | null = null;\n /** Passkey-only sign-up: no password field; the email per the instance's mode. */\n @Input() passkey: { email: 'off' | 'optional' | 'required' } | null = null;\n /** Whether the password / passkey toggle is shown (both are offered). */\n @Input() switchable = false;\n /** The instance's policies (terms, privacy, …); they replace the legacy consent row. */\n @Input() policies: PolicyAcceptanceController | null = null;\n /** The user asked for the other sign-up method. */\n @Output() switchMode = new EventEmitter<void>();\n\n /** Emits the typed values and the consent tick when the form is submitted. */\n @Output() submitSignUp = new EventEmitter<SignUpFormSubmit>();\n\n protected values: Record<string, string> = {};\n protected agreed = false;\n protected declined: string | null = null;\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!changes['policies']) return;\n this.unwatch?.();\n this.unwatch = this.policies?.subscribe(() => this.cdr.markForCheck()) ?? null;\n }\n\n ngOnDestroy(): void {\n this.unwatch?.();\n }\n\n protected hasPolicies(): boolean {\n return !!this.policies && this.policies.policies.length > 0;\n }\n\n protected t(key: string, vars?: Record<string, string>): string {\n return translate(this.atlas.localization, key, vars);\n }\n\n /** A server error in the app's language (`error.<reason>`, else the server's message). */\n protected errorText(error: FieldError): string {\n // `errorLocalization` is read defensively: a stand-in service may lack it.\n const layer = (this.atlas as { errorLocalization?: Record<string, string> }).errorLocalization;\n return localizedErrorMessage(error, layer ?? this.atlas.localization, this.atlas.localization);\n }\n\n protected cls(key: ElementKey, base: string): string {\n return classFor(key, this.atlas.appearance, base);\n }\n\n protected setValue(name: string, value: string): void {\n this.values = { ...this.values, [name]: value };\n }\n\n /** Email + password sign-up cannot complete: the app cannot send the verification email. */\n protected emailUnavailable(): boolean {\n // A passkey sign-up that collects no email (or an unproven one) sends no mail.\n if (this.passkey && this.passkey.email !== 'required') return false;\n return this.settings?.emailDelivery?.passwordSignUp === false;\n }\n\n protected showEmail(): boolean {\n return !this.passkey || this.passkey.email !== 'off';\n }\n\n protected emailRequired(): boolean {\n return !this.passkey || this.passkey.email === 'required';\n }\n\n protected fields(): PublicSignUpField[] {\n return this.settings?.signUpFields ?? [];\n }\n\n protected label(f: PublicSignUpField): string {\n return f.required ? f.label : this.t('signUp.optionalField', { label: f.label });\n }\n\n protected inputType(f: PublicSignUpField): string {\n return ['email', 'tel', 'url', 'number', 'date'].includes(f.type) ? f.type : 'text';\n }\n\n /** Same encoding as React, the embed widget and the hosted page: one value,\n * or a comma-joined list for multiselect. */\n protected picked(key: string): string[] {\n const value = this.values[key];\n return value ? value.split(', ') : [];\n }\n\n protected toggle(f: PublicSignUpField, option: string, on: boolean): void {\n if (f.type === 'radio') {\n this.setValue(f.key, option);\n return;\n }\n const current = this.picked(f.key);\n this.setValue(f.key, (on ? [...current, option] : current.filter((p) => p !== option)).join(', '));\n }\n\n protected showLegal(): boolean {\n // Instance policies replace the legacy single \"I agree to the Terms\" row.\n if (this.hasPolicies()) return false;\n const legal = this.settings?.legal;\n return !!legal && (!!legal.termsUrl || !!legal.privacyUrl);\n }\n\n protected consentOk(): boolean {\n if (this.hasPolicies()) return this.policies!.canSubmit();\n return !this.settings?.legal?.required || this.agreed;\n }\n\n protected formErrors(): FieldError[] {\n return this.errors.filter((error) => !error.param);\n }\n\n protected fieldErrorsFor(name: string): FieldError[] {\n return this.errors.filter((error) => error.param === name);\n }\n\n protected onSubmit(event: Event): void {\n event.preventDefault();\n if (this.emailUnavailable() || !this.consentOk()) return;\n this.declined = null;\n if (this.hasPolicies()) {\n // Scroll-mode policies are read in their unskippable dialog first.\n const values = { ...this.values };\n void confirmPolicies(this.policies!, { t: policyUi(this.atlas).t }).then((res) => {\n if (res.ok) this.submitSignUp.emit({ values, consent: true });\n else {\n this.declined = res.declined;\n this.cdr.markForCheck();\n }\n });\n return;\n }\n this.submitSignUp.emit({\n values: { ...this.values },\n consent: this.settings?.legal?.required ? this.agreed : true,\n });\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n Input,\n OnDestroy,\n OnInit,\n inject,\n signal,\n} from '@angular/core';\nimport { awaitingPasskey, existingAccountResetUrl, localizedErrorMessage, passkeysSupported, signInAfterProofUrl, signUpProvedByLink, type FieldError } from '@atlasauth/js';\nimport { AtlasService } from '../atlas.service';\nimport { classFor, type ElementKey } from '../appearance';\nimport { translate } from '../i18n';\nimport { AttemptFlowComponent } from './attempt-flow.component';\nimport { RecoveryCodesComponent } from './recovery-codes.component';\nimport { SignUpFormComponent } from './sign-up-form.component';\nimport { AtlasFlowController } from './flow-controller';\n\n/**\n * `<atlas-sign-up>` — creates an account. The Angular peer of React's\n * `<SignUp/>`. The first step is the create-account form (the instance's\n * configured fields, email, password, legal consent and — when required — the\n * captcha), which POSTs `/v1/client/sign_ups`; from there it shares the flow\n * engine with `<atlas-sign-in>` (the emailed-code step, then the ticket\n * exchange), because the sequence of steps is decided by the server.\n *\n * ```html\n * <atlas-sign-up *atlasSignedOut></atlas-sign-up>\n * ```\n */\n@Component({\n selector: 'atlas-sign-up',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [AttemptFlowComponent, RecoveryCodesComponent, SignUpFormComponent],\n template: `\n @if (flow.recoveryCodes(); as codes) {\n <atlas-recovery-codes [codes]=\"codes\" [busy]=\"flow.state().busy\" (saved)=\"flow.saveRecoveryCodes()\"></atlas-recovery-codes>\n } @else if (flow.existingAccountNotice()) {\n <div [class]=\"cls('card', 'atlas-card')\" data-atlas-existing-account=\"\">\n <h1 [class]=\"cls('headerTitle', 'atlas-title')\">{{ t('signUp.title') }}</h1>\n <p class=\"atlas-text\">{{ t('signUp.existingAccount') }}</p>\n @if (resetHref(); as href) {\n <p class=\"atlas-text\"><a class=\"atlas-link\" [href]=\"href\">{{ t('signIn.forgotPassword') }}</a></p>\n }\n <button\n [class]=\"cls('formButtonPrimary', 'atlas-button')\"\n type=\"button\"\n [disabled]=\"flow.state().busy\"\n (click)=\"flow.continueAfterExistingAccount()\"\n >\n {{ t('signUp.submit') }}\n </button>\n </div>\n } @else if (awaitingPasskey()) {\n <div [class]=\"cls('card', 'atlas-card')\" data-atlas-passkey-sign-up=\"\">\n <h1 [class]=\"cls('headerTitle', 'atlas-title')\">{{ t('signUp.title') }}</h1>\n @for (error of flow.state().errors; track error.code) {\n <p [class]=\"cls('formFieldError', 'atlas-error')\" role=\"alert\">{{ errorText(error) }}</p>\n }\n <p class=\"atlas-text\">{{ t('signUp.passkeyPrompt') }}</p>\n <button\n [class]=\"cls('formButtonPrimary', 'atlas-button')\"\n type=\"button\"\n [disabled]=\"flow.state().busy\"\n (click)=\"flow.createPasskey()\"\n >\n {{ t('signUp.passkeyCreate') }}\n </button>\n </div>\n } @else if (emailConfirmed()) {\n <div [class]=\"cls('card', 'atlas-card')\" data-atlas-email-confirmed=\"\">\n <h1 [class]=\"cls('headerTitle', 'atlas-title')\">{{ t('signUp.title') }}</h1>\n <p class=\"atlas-text\" role=\"status\">{{ t('signUp.emailConfirmed') }}</p>\n @if (signInHref(); as href) {\n <a [class]=\"cls('formButtonPrimary', 'atlas-button')\" [href]=\"href\">{{ t('signIn.title') }}</a>\n }\n </div>\n } @else if (flow.state().attempt) {\n <atlas-attempt-flow\n [attempt]=\"flow.state().attempt\"\n [busy]=\"flow.state().busy\"\n [errors]=\"flow.state().errors\"\n [sessionKept]=\"flow.state().sessionKept\"\n titleKey=\"signUp.title\"\n [emailVerification]=\"flow.settings()?.account?.emailVerification ?? 'code'\"\n (submitFlow)=\"flow.submit($event)\"\n (resend)=\"flow.resendSignUp()\"\n [offerEmailSecondFactor]=\"flow.settings()?.account?.emailSecondFactor === true\"\n [emailedSecondFactor]=\"flow.emailSecondFactor()\"\n [offerSmsSecondFactor]=\"flow.settings() !== null && flow.mfaChoices().sms\"\n [textedSecondFactor]=\"flow.smsSecondFactor()\"\n [enrollment]=\"flow.enrollment\"\n [enrollmentState]=\"flow.enrollmentState()\"\n (emailSecondFactor)=\"flow.sendEmailSecondFactor()\"\n (smsSecondFactor)=\"flow.sendSmsSecondFactor()\"\n (policyDeclined)=\"flow.declinePolicy($event)\"\n ></atlas-attempt-flow>\n } @else {\n <atlas-sign-up-form\n [settings]=\"flow.settings()\"\n [busy]=\"flow.state().busy\"\n [errors]=\"flow.state().errors\"\n [captcha]=\"flow.signUpCaptchaDrawn() ? flow.signUpCaptcha : null\"\n [policies]=\"flow.policies\"\n [passkey]=\"passkeyForm()\"\n [switchable]=\"canPasskey()\"\n (switchMode)=\"toggleMode()\"\n (submitSignUp)=\"\n passkeyForm() ? flow.createWithPasskey($event.values, $event.consent) : flow.create($event.values, $event.consent)\n \"\n ></atlas-sign-up-form>\n }\n `,\n})\nexport class SignUpComponent implements OnInit, OnDestroy {\n private readonly atlas = inject(AtlasService);\n\n /** Where to send the user once the flow completes. Reserved for host routing. */\n @Input() afterUrl?: string;\n\n /** Where the existing-account notice's \"Forgot password?\" goes. Default: the hosted sign-in page; `null` hides it. */\n @Input() resetPasswordUrl?: string | null;\n\n /** Where \"Sign in\" goes once an emailed link confirmed the address and made no session here. Default: the hosted sign-in page; `null` hides it. */\n @Input() signInUrl?: string | null;\n\n protected readonly flow = new AtlasFlowController(\n this.atlas.createFapiClient(),\n () => this.atlas.reload(),\n this.atlas.pendingAttempt,\n (key) => translate(this.atlas.localization, key),\n true,\n );\n\n /** Password or passkey-only sign-up (the latter when the instance offers it). */\n protected readonly mode = signal<'password' | 'passkey'>('password');\n\n protected canPasskey(): boolean {\n return !!this.flow.settings()?.account.passkeySignUp && passkeysSupported();\n }\n\n protected passkeyForm(): { email: 'off' | 'optional' | 'required' } | null {\n const offer = this.flow.settings()?.account.passkeySignUp ?? null;\n return this.mode() === 'passkey' && offer && this.canPasskey() ? { email: offer.email } : null;\n }\n\n protected toggleMode(): void {\n this.flow.state.update((current) => ({ ...current, errors: [] }));\n this.mode.set(this.passkeyForm() ? 'password' : 'passkey');\n }\n\n protected resetHref(): string | null {\n return existingAccountResetUrl({ url: this.resetPasswordUrl, frontendApi: this.atlas.frontendApi, redirectUrl: this.afterUrl });\n }\n\n /** A link confirmed the address and made no session here. Says the same for any address. */\n protected emailConfirmed(): boolean {\n return signUpProvedByLink(this.flow.state().attempt);\n }\n\n protected signInHref(): string | null {\n return signInAfterProofUrl({ url: this.signInUrl, frontendApi: this.atlas.frontendApi, redirectUrl: this.afterUrl });\n }\n\n protected awaitingPasskey(): boolean {\n return awaitingPasskey(this.flow.state().attempt);\n }\n\n protected t(key: string): string {\n return translate(this.atlas.localization, key);\n }\n\n protected cls(key: ElementKey, base: string): string {\n return classFor(key, this.atlas.appearance, base);\n }\n\n protected errorText(error: FieldError): string {\n const layer = (this.atlas as { errorLocalization?: Record<string, string> }).errorLocalization;\n return localizedErrorMessage(error, layer ?? this.atlas.localization, this.atlas.localization);\n }\n\n ngOnInit(): void {\n // §5 the instance's sign-up fields, consent policy and captcha settings.\n if (typeof window !== 'undefined') {\n void this.flow.loadSettings();\n void this.flow.loadPolicies(this.atlas.locale ?? undefined);\n }\n }\n\n ngOnDestroy(): void {\n this.flow.destroy();\n }\n}\n","import { ChangeDetectionStrategy, Component, computed, inject, signal } from '@angular/core';\nimport { AtlasService } from '../atlas.service';\nimport { classFor, type ElementKey } from '../appearance';\nimport { translate } from '../i18n';\n\n/**\n * `<atlas-user-button>` — the signed-in user's avatar with a drop-down that can\n * sign them out. The Angular peer of React's `<UserButton/>`. Renders nothing\n * when there is no user.\n */\n@Component({\n selector: 'atlas-user-button',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (atlas.user(); as user) {\n <div class=\"atlas-user-button\">\n <button\n [class]=\"cls('avatar', 'atlas-avatar')\"\n [attr.aria-expanded]=\"open()\"\n (click)=\"toggle()\"\n >\n @if (user.image_url) {\n <img [src]=\"user.image_url\" alt=\"\" />\n } @else {\n <span>{{ label().slice(0, 1) }}</span>\n }\n </button>\n\n @if (open()) {\n <div [class]=\"cls('menu', 'atlas-menu')\" role=\"menu\">\n <span [class]=\"cls('menuItem', 'atlas-menu-item')\">{{ label() }}</span>\n <button [class]=\"cls('menuItem', 'atlas-menu-item')\" (click)=\"signOut()\">\n {{ t('userButton.signOut') }}\n </button>\n </div>\n }\n </div>\n }\n `,\n})\nexport class UserButtonComponent {\n protected readonly atlas = inject(AtlasService);\n protected readonly open = signal(false);\n\n protected readonly label = computed(() => {\n const user = this.atlas.user();\n if (!user) return '';\n return [user.first_name, user.last_name].filter(Boolean).join(' ') || user.username || '';\n });\n\n protected t(key: string): string {\n return translate(this.atlas.localization, key);\n }\n\n protected cls(key: ElementKey, base: string): string {\n return classFor(key, this.atlas.appearance, base);\n }\n\n protected toggle(): void {\n this.open.update((o) => !o);\n }\n\n protected signOut(): void {\n void this.atlas.signOut();\n }\n}\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { AtlasService } from '../atlas.service';\nimport { classFor, type ElementKey } from '../appearance';\nimport { translate } from '../i18n';\n\n/**\n * `<atlas-organization-switcher>` — switch the active organization (or the\n * personal account). The Angular peer of React's `<OrganizationSwitcher/>`.\n */\n@Component({\n selector: 'atlas-organization-switcher',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div [class]=\"cls('menu', 'atlas-menu')\">\n <button [class]=\"cls('menuItem', 'atlas-menu-item')\" (click)=\"setActive(null)\">\n {{ t('organization.personal') }}\n </button>\n @for (membership of atlas.memberships(); track membership.organization.id) {\n <button\n [class]=\"cls('menuItem', 'atlas-menu-item')\"\n [disabled]=\"membership.organization.id === atlas.organization()?.organization?.id\"\n (click)=\"setActive(membership.organization.id)\"\n >\n {{ membership.organization.name }}\n </button>\n }\n </div>\n `,\n})\nexport class OrganizationSwitcherComponent {\n protected readonly atlas = inject(AtlasService);\n\n protected t(key: string): string {\n return translate(this.atlas.localization, key);\n }\n\n protected cls(key: ElementKey, base: string): string {\n return classFor(key, this.atlas.appearance, base);\n }\n\n protected setActive(organizationId: string | null): void {\n void this.atlas.setActiveOrganization(organizationId);\n }\n}\n","import { ChangeDetectionStrategy, Component, type OnInit, inject, signal } from '@angular/core';\nimport {\n clearCibaPin,\n decideCibaRequest,\n getCibaPin,\n listCibaRequests,\n setCibaPin,\n type CibaPinStatus,\n type CibaRequest,\n} from '@atlasauth/js';\nimport { AtlasService } from '../atlas.service';\nimport { classFor, type ElementKey } from '../appearance';\n\n/**\n * `<atlas-manage-ciba>` — sign-in requests apps start on the user's behalf (CIBA), with approve and deny, and\n * the optional CIBA PIN apps must send as the user code. The Angular peer of React's `<ManageCiba/>`. Renders\n * nothing when there is no request, no PIN and no app that could ask.\n */\n@Component({\n selector: 'atlas-manage-ciba',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (requests().length || (pin() && (pin()!.set || pin()!.available))) {\n <section [class]=\"cls('card', 'atlas-card')\" data-atlas=\"manage-ciba\">\n @if (requests().length) {\n <h2>Sign-in requests from apps</h2>\n <ul>\n @for (r of requests(); track r.id) {\n <li>\n <strong>{{ r.client_name }}</strong>\n @if (r.binding_message) {\n <div>{{ r.binding_message }}</div>\n }\n <small>{{ r.scope.join(', ') }}</small>\n <button [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" type=\"button\" (click)=\"decide(r.id, 'approve')\">Approve</button>\n <button [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" type=\"button\" (click)=\"decide(r.id, 'deny')\">Deny</button>\n </li>\n }\n </ul>\n }\n @if (pin(); as p) {\n @if (p.set || p.available) {\n <form (submit)=\"save($event)\">\n <h2>CIBA PIN</h2>\n <p>{{ p.set ? 'You have a CIBA PIN.' : 'You have not set a CIBA PIN.' }} Apps that start a sign-in request for you must send it.</p>\n <input type=\"password\" autocomplete=\"current-password\" placeholder=\"Current password\" aria-label=\"Current password\" [value]=\"password()\" (input)=\"password.set($any($event.target).value)\" />\n <input type=\"password\" inputmode=\"numeric\" autocomplete=\"off\" placeholder=\"6 to 12 digits\" aria-label=\"New CIBA PIN\" [value]=\"newPin()\" (input)=\"newPin.set($any($event.target).value)\" />\n <button [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" type=\"submit\">{{ p.set ? 'Change PIN' : 'Set PIN' }}</button>\n @if (p.set) {\n <button [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" type=\"button\" (click)=\"remove()\">Remove PIN</button>\n }\n @if (message(); as m) {\n <small role=\"status\">{{ m }}</small>\n }\n </form>\n }\n }\n @if (message(); as m) {\n @if (!pin() || !(pin()!.set || pin()!.available)) {\n <small role=\"status\">{{ m }}</small>\n }\n }\n </section>\n }\n `,\n})\nexport class ManageCibaComponent implements OnInit {\n protected readonly atlas = inject(AtlasService);\n protected readonly requests = signal<CibaRequest[]>([]);\n protected readonly pin = signal<CibaPinStatus | null>(null);\n protected readonly newPin = signal('');\n protected readonly password = signal('');\n protected readonly message = signal<string | null>(null);\n private readonly client = this.atlas.createFapiClient();\n\n ngOnInit(): void {\n void this.load();\n }\n\n private async load(): Promise<void> {\n const [r, p] = await Promise.all([listCibaRequests(this.client).catch(() => []), getCibaPin(this.client).catch(() => null)]);\n this.requests.set(r);\n this.pin.set(p);\n }\n\n private async run(fn: () => Promise<unknown>, fallback: string): Promise<void> {\n this.message.set(null);\n try {\n await fn();\n this.newPin.set('');\n this.password.set('');\n await this.load();\n } catch (e) {\n this.message.set(e instanceof Error && e.message ? e.message : fallback);\n }\n }\n\n protected decide(id: string, decision: 'approve' | 'deny'): Promise<void> {\n return this.run(() => decideCibaRequest(this.client, id, decision), decision === 'approve' ? 'Could not approve.' : 'Could not deny.');\n }\n\n protected save(event: Event): Promise<void> {\n event.preventDefault();\n return this.run(() => setCibaPin(this.client, { pin: this.newPin(), currentPassword: this.password() }), 'Could not save the PIN.');\n }\n\n protected remove(): Promise<void> {\n return this.run(() => clearCibaPin(this.client, { currentPassword: this.password() }), 'Could not remove the PIN.');\n }\n\n protected cls(key: ElementKey, base: string): string {\n return classFor(key, this.atlas.appearance, base);\n }\n}\n","import { ChangeDetectionStrategy, Component, inject, signal } from '@angular/core';\nimport { AtlasService } from '../atlas.service';\nimport { classFor, type ElementKey } from '../appearance';\nimport { translate } from '../i18n';\nimport { ManageCibaComponent } from './manage-ciba.component';\n\n/**\n * `<atlas-user-profile>` — the signed-in user's account surface (emails,\n * security). The Angular peer of React's `<UserProfile/>`. Renders nothing when\n * there is no user.\n */\n@Component({\n selector: 'atlas-user-profile',\n standalone: true,\n imports: [ManageCibaComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (atlas.user(); as user) {\n <div [class]=\"cls('card', 'atlas-card')\">\n <h1>{{ t('userProfile.title') }}</h1>\n\n <section>\n <h2>{{ t('userProfile.emailsSection') }}</h2>\n <ul>\n @for (email of user.email_addresses ?? []; track email.id) {\n <li>\n {{ email.email_address }}\n @if (!email.verified) {\n <em> — {{ t('userProfile.unverified') }}</em>\n @if (verifying() === email.id) {\n <span data-atlas=\"email-verify\">\n <input\n [class]=\"cls('formFieldInput', 'atlas-account-input')\"\n inputmode=\"numeric\"\n autocomplete=\"one-time-code\"\n [placeholder]=\"t('userProfile.verifyCodePlaceholder')\"\n [value]=\"code()\"\n (input)=\"code.set($any($event.target).value)\"\n />\n <button\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n type=\"button\"\n [disabled]=\"busy()\"\n (click)=\"confirmCode()\"\n >\n {{ t('userProfile.verifyConfirm') }}\n </button>\n </span>\n } @else {\n <button\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n type=\"button\"\n [disabled]=\"busy()\"\n (click)=\"sendCode(email.id)\"\n >\n {{ t('userProfile.verify') }}\n </button>\n }\n }\n </li>\n }\n </ul>\n @if (verifyError(); as message) {\n <p role=\"alert\">{{ message }}</p>\n }\n </section>\n\n <section>\n <h2>{{ t('userProfile.securitySection') }}</h2>\n <p>{{ user.mfa_enabled ? '2FA on' : '2FA off' }}</p>\n </section>\n\n <atlas-manage-ciba />\n </div>\n }\n `,\n})\nexport class UserProfileComponent {\n protected readonly atlas = inject(AtlasService);\n // An unverified address (added and never confirmed, or the sign-up address on\n // an app that did not require verification) can be proven here: send a code,\n // then enter it.\n protected readonly verifying = signal<string | null>(null);\n protected readonly code = signal('');\n protected readonly busy = signal(false);\n protected readonly verifyError = signal<string | null>(null);\n private readonly client = this.atlas.createFapiClient();\n\n protected async sendCode(id: string): Promise<void> {\n this.verifyError.set(null);\n this.busy.set(true);\n const res = await this.client.post(`/v1/client/me/email_addresses/${id}/prepare_verification`);\n this.busy.set(false);\n if (!res.ok) {\n this.verifyError.set(this.t('userProfile.verifySendFailed'));\n return;\n }\n this.code.set('');\n this.verifying.set(id);\n }\n\n protected async confirmCode(): Promise<void> {\n const id = this.verifying();\n if (!id) return;\n this.verifyError.set(null);\n this.busy.set(true);\n const res = await this.client.post(`/v1/client/me/email_addresses/${id}/attempt_verification`, {\n code: this.code(),\n });\n this.busy.set(false);\n if (!res.ok) {\n this.verifyError.set(this.t('userProfile.verifyCodeRejected'));\n return;\n }\n this.verifying.set(null);\n await this.atlas.reload();\n }\n\n protected t(key: string): string {\n return translate(this.atlas.localization, key);\n }\n\n protected cls(key: ElementKey, base: string): string {\n return classFor(key, this.atlas.appearance, base);\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n EventEmitter,\n Output,\n computed,\n effect,\n inject,\n signal,\n untracked,\n} from '@angular/core';\nimport {\n OrganizationProfileController,\n localizedErrorMessage,\n type OrganizationProfileState,\n type OrganizationRequestError,\n} from '@atlasauth/js';\nimport { AtlasService } from '../atlas.service';\nimport { classFor, type ElementKey } from '../appearance';\nimport { translate } from '../i18n';\n\ntype Tab = 'members' | 'invitations' | 'roles' | 'settings';\ntype ProfileRole = OrganizationProfileState['roles'][number];\n\n/**\n * `<atlas-organization-profile>` — the active organization's members (admins\n * change roles and remove), invitations (admins invite, revoke and resend) and\n * settings (leave; an admin deletes after confirming their password). The\n * Angular peer of React's `<OrganizationProfile/>`, on the same headless\n * controller. Every control is gated on the ACTIVE org role, matching the\n * server's rule. Renders nothing with no active org. Emits `exit` with `left`\n * or `deleted`.\n */\n@Component({\n selector: 'atlas-organization-profile',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (atlas.organization(); as membership) {\n @if (state(); as st) {\n <div [class]=\"cls('card', 'atlas-card')\" data-atlas=\"organization-profile\">\n <h1>{{ membership.organization.name }}</h1>\n <p>{{ t('organization.roleLabel') }}: {{ membership.role }}</p>\n\n <div [class]=\"cls('menu', 'atlas-menu')\" role=\"tablist\">\n @for (key of tabs(); track key) {\n <button\n type=\"button\"\n role=\"tab\"\n [attr.aria-selected]=\"tab() === key\"\n [class]=\"cls('menuItem', 'atlas-menu-item')\"\n [attr.data-atlas]=\"'organization-tab-' + key\"\n (click)=\"tab.set(key)\"\n >\n {{ t('organization.' + key) }}\n </button>\n }\n </div>\n\n @if (errorMessage(); as message) {\n <p [class]=\"cls('formFieldError', 'atlas-error')\" role=\"alert\">{{ message }}</p>\n }\n\n @if (tab() === 'members') {\n <ul class=\"atlas-list\" data-atlas=\"organization-members\">\n @for (m of st.members; track m.id) {\n <li data-atlas=\"organization-member\">\n <span>{{ memberName(m) }}{{ m.user?.id === userId() ? ' ' + t('organization.you') : '' }}</span>\n @if (canManage() && m.user && m.user.id !== userId()) {\n <select\n [attr.aria-label]=\"t('organization.roleLabel')\"\n [class]=\"cls('formFieldInput', 'atlas-input')\"\n [disabled]=\"st.busy === 'role:' + m.user.id\"\n (change)=\"changeRole(m.user.id, $any($event.target).value)\"\n >\n @for (r of roles(); track r.key) {\n <option [value]=\"r.key\" [selected]=\"r.key === m.role\">{{ r.name }}</option>\n }\n </select>\n <button\n type=\"button\"\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n [disabled]=\"st.busy === 'remove:' + m.user.id\"\n (click)=\"removeMember(m.user.id)\"\n >\n {{ t('organization.remove') }}\n </button>\n } @else {\n <span> · {{ m.role }}</span>\n }\n </li>\n }\n </ul>\n }\n\n @if (tab() === 'invitations' && canManage()) {\n <div data-atlas=\"organization-invitations\">\n <form (submit)=\"$event.preventDefault(); sendInvite()\">\n <label [class]=\"cls('formField', 'atlas-field')\">\n <span [class]=\"cls('formFieldLabel', 'atlas-field-label')\">{{ t('organization.emailLabel') }}</span>\n <input\n type=\"email\"\n [class]=\"cls('formFieldInput', 'atlas-input')\"\n [value]=\"email()\"\n (input)=\"email.set($any($event.target).value)\"\n />\n </label>\n <label [class]=\"cls('formField', 'atlas-field')\">\n <span [class]=\"cls('formFieldLabel', 'atlas-field-label')\">{{ t('organization.roleLabel') }}</span>\n <select [class]=\"cls('formFieldInput', 'atlas-input')\" (change)=\"inviteRole.set($any($event.target).value)\">\n @for (r of roles(); track r.key) {\n <option [value]=\"r.key\" [selected]=\"r.key === inviteRole()\">{{ r.name }}</option>\n }\n </select>\n </label>\n <button\n type=\"submit\"\n [class]=\"cls('formButtonPrimary', 'atlas-button')\"\n [disabled]=\"st.busy === 'invite' || !email().trim()\"\n >\n {{ t('organization.sendInvite') }}\n </button>\n </form>\n @if (st.invitations.length === 0) {\n <p class=\"atlas-text\">{{ t('organization.noInvitations') }}</p>\n } @else {\n <ul class=\"atlas-list\">\n @for (inv of st.invitations; track inv.id) {\n <li data-atlas=\"organization-invitation\">\n <span>{{ inv.email_address }} · {{ inv.role }}</span>\n <button type=\"button\" [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" (click)=\"resend(inv.id)\">\n {{ t('organization.resend') }}\n </button>\n <button type=\"button\" [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" (click)=\"revoke(inv.id)\">\n {{ t('organization.revoke') }}\n </button>\n </li>\n }\n </ul>\n }\n </div>\n }\n\n @if (tab() === 'roles' && canManage()) {\n <div data-atlas=\"organization-roles\">\n @if (customRoles().length === 0) {\n <p class=\"atlas-text\">{{ t('organization.noCustomRoles') }}</p>\n } @else {\n <ul class=\"atlas-list\">\n @for (role of customRoles(); track role.key) {\n <li data-atlas=\"organization-role\">\n <span>{{ role.name }} · {{ role.key }}</span>\n <button type=\"button\" [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" (click)=\"editRole(role)\">\n {{ t('organization.editRole') }}\n </button>\n <button\n type=\"button\"\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n [disabled]=\"!role.id || st.busy === 'role:delete:' + role.id\"\n (click)=\"deleteRole(role)\"\n >\n {{ t('organization.deleteRole') }}\n </button>\n </li>\n }\n </ul>\n }\n <form data-atlas=\"organization-role-form\" (submit)=\"$event.preventDefault(); saveRole()\">\n @if (!editingRole()) {\n <label [class]=\"cls('formField', 'atlas-field')\">\n <span [class]=\"cls('formFieldLabel', 'atlas-field-label')\">{{ t('organization.roleKey') }}</span>\n <input\n name=\"role_key\"\n [class]=\"cls('formFieldInput', 'atlas-input')\"\n [value]=\"roleKey()\"\n (input)=\"roleKey.set($any($event.target).value)\"\n />\n </label>\n }\n <label [class]=\"cls('formField', 'atlas-field')\">\n <span [class]=\"cls('formFieldLabel', 'atlas-field-label')\">{{ t('organization.roleName') }}</span>\n <input\n name=\"role_name\"\n [class]=\"cls('formFieldInput', 'atlas-input')\"\n [value]=\"roleName()\"\n (input)=\"roleName.set($any($event.target).value)\"\n />\n </label>\n <fieldset [class]=\"cls('formField', 'atlas-field')\">\n <legend [class]=\"cls('formFieldLabel', 'atlas-field-label')\">{{ t('organization.rolePermissions') }}</legend>\n @for (p of st.permissions; track p.key) {\n <label data-atlas=\"organization-role-permission\">\n <input\n type=\"checkbox\"\n [value]=\"p.key\"\n [checked]=\"rolePerms().includes(p.key)\"\n (change)=\"togglePermission(p.key, $any($event.target).checked)\"\n />\n {{ p.name }}\n </label>\n }\n </fieldset>\n <button\n type=\"submit\"\n [class]=\"cls('formButtonPrimary', 'atlas-button')\"\n [disabled]=\"!roleName().trim() || (!editingRole() && !roleKey().trim()) || (st.busy ?? '').startsWith('role:')\"\n >\n {{ editingRole() ? t('organization.saveRole') : t('organization.createRole') }}\n </button>\n @if (editingRole()) {\n <button type=\"button\" [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" (click)=\"resetRoleForm()\">\n {{ t('organization.cancel') }}\n </button>\n }\n </form>\n </div>\n }\n\n @if (tab() === 'settings') {\n <div data-atlas=\"organization-settings\">\n @if (confirm(); as action) {\n <p class=\"atlas-text\">\n {{ t(action === 'leave' ? 'organization.leaveConfirm' : 'organization.deleteConfirm', { name: membership.organization.name }) }}\n </p>\n @if (needsPassword()) {\n <label [class]=\"cls('formField', 'atlas-field')\">\n <span [class]=\"cls('formFieldLabel', 'atlas-field-label')\">{{ t('organization.passwordPrompt') }}</span>\n <input\n type=\"password\"\n autocomplete=\"current-password\"\n [class]=\"cls('formFieldInput', 'atlas-input')\"\n [value]=\"password()\"\n (input)=\"password.set($any($event.target).value)\"\n />\n </label>\n }\n <button\n type=\"button\"\n [class]=\"cls('formButtonPrimary', 'atlas-button')\"\n [disabled]=\"st.busy === 'leave' || st.busy === 'delete'\"\n (click)=\"action === 'leave' ? leave() : remove()\"\n >\n {{ t('organization.confirm') }}\n </button>\n <button type=\"button\" [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" (click)=\"cancel()\">\n {{ t('organization.cancel') }}\n </button>\n } @else {\n <button type=\"button\" [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" (click)=\"confirm.set('leave')\">\n {{ t('organization.leave') }}\n </button>\n @if (isAdmin()) {\n <button type=\"button\" [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\" (click)=\"confirm.set('delete')\">\n {{ t('organization.delete') }}\n </button>\n }\n }\n </div>\n }\n </div>\n }\n }\n `,\n})\nexport class OrganizationProfileComponent {\n protected readonly atlas = inject(AtlasService);\n @Output() readonly exit = new EventEmitter<'left' | 'deleted'>();\n\n private readonly client = this.atlas.createFapiClient();\n private controller: OrganizationProfileController | null = null;\n private unsubscribe: (() => void) | null = null;\n\n protected readonly state = signal<OrganizationProfileState | null>(null);\n protected readonly tab = signal<Tab>('members');\n protected readonly email = signal('');\n protected readonly inviteRole = signal('org:member');\n protected readonly confirm = signal<'leave' | 'delete' | null>(null);\n protected readonly needsPassword = signal(false);\n protected readonly password = signal('');\n // The custom-role editor: null = creating, else the id of the role being edited.\n protected readonly editingRole = signal<string | null>(null);\n protected readonly roleKey = signal('');\n protected readonly roleName = signal('');\n protected readonly rolePerms = signal<string[]>([]);\n protected readonly customRoles = computed(() => (this.state()?.roles ?? []).filter((r) => Boolean(r.organization_id)));\n\n protected readonly userId = computed(() => (this.atlas.claims()?.sub as string | undefined) ?? null);\n protected readonly canManage = computed(() => {\n this.atlas.claims();\n return this.atlas.has({ permission: 'org:sys_memberships:manage' });\n });\n protected readonly isAdmin = computed(() => this.atlas.organization()?.role === 'org:admin');\n protected readonly tabs = computed<Tab[]>(() => ['members', ...(this.canManage() ? (['invitations', 'roles'] as Tab[]) : []), 'settings']);\n protected readonly roles = computed(() => {\n const roles = this.state()?.roles ?? [];\n return roles.length > 0 ? roles : [{ key: 'org:member', name: 'org:member' }];\n });\n protected readonly errorMessage = computed(() => {\n const err = this.state()?.error;\n if (!err || (err as OrganizationRequestError).needsReverification) return null;\n return localizedErrorMessage(err, this.atlas.errorLocalization, this.atlas.localization);\n });\n\n constructor() {\n effect(() => {\n const id = this.atlas.organization()?.organization.id ?? null;\n untracked(() => this.bind(id));\n });\n inject(DestroyRef).onDestroy(() => this.unsubscribe?.());\n }\n\n private bind(id: string | null) {\n if (this.controller?.organizationId === id) return;\n this.unsubscribe?.();\n this.controller = null;\n this.state.set(null);\n if (!id) return;\n const controller = new OrganizationProfileController(this.client, id, {\n canManage: this.canManage(),\n onChange: async () => {\n await this.atlas.reload();\n },\n });\n this.controller = controller;\n this.unsubscribe = controller.subscribe((next) => this.state.set(next));\n this.state.set(controller.getState());\n void controller.load();\n }\n\n protected t(key: string, vars?: Record<string, string>): string {\n return translate(this.atlas.localization, key, vars);\n }\n\n protected cls(key: ElementKey, base: string): string {\n return classFor(key, this.atlas.appearance, base);\n }\n\n protected memberName(m: OrganizationProfileState['members'][number]): string {\n return [m.user?.first_name, m.user?.last_name].filter(Boolean).join(' ') || this.t('organization.unnamedMember');\n }\n\n protected changeRole(userId: string, role: string) {\n void this.controller?.changeRole(userId, role);\n }\n\n protected removeMember(userId: string) {\n void this.controller?.removeMember(userId);\n }\n\n protected async sendInvite() {\n const address = this.email().trim();\n if (this.controller && address && (await this.controller.invite(address, this.inviteRole()))) this.email.set('');\n }\n\n protected resend(id: string) {\n void this.controller?.resendInvitation(id);\n }\n\n protected revoke(id: string) {\n void this.controller?.revokeInvitation(id);\n }\n\n protected async leave() {\n if (this.controller && (await this.controller.leave())) this.exit.emit('left');\n this.confirm.set(null);\n }\n\n protected async remove() {\n const controller = this.controller;\n if (!controller) return;\n if (this.needsPassword()) {\n try {\n await this.atlas.reauthenticate(this.password());\n } catch {\n return;\n }\n this.password.set('');\n this.needsPassword.set(false);\n }\n if (await controller.deleteOrganization()) {\n this.exit.emit('deleted');\n this.confirm.set(null);\n return;\n }\n const err = controller.getState().error as OrganizationRequestError | null;\n if (err?.needsReverification) this.needsPassword.set(true);\n }\n\n protected editRole(role: ProfileRole) {\n this.editingRole.set(role.id ?? null);\n this.roleKey.set(role.key);\n this.roleName.set(role.name);\n this.rolePerms.set([...(role.permissions ?? [])]);\n }\n\n protected resetRoleForm() {\n this.editingRole.set(null);\n this.roleKey.set('');\n this.roleName.set('');\n this.rolePerms.set([]);\n }\n\n protected togglePermission(key: string, on: boolean) {\n this.rolePerms.update((current) => (on ? [...current, key] : current.filter((k) => k !== key)));\n }\n\n protected async saveRole() {\n const controller = this.controller;\n if (!controller) return;\n const editing = this.editingRole();\n const out = editing\n ? await controller.updateRole(editing, { name: this.roleName().trim(), permissions: this.rolePerms() })\n : await controller.createRole({ key: this.roleKey().trim(), name: this.roleName().trim(), permissions: this.rolePerms() });\n if (out) this.resetRoleForm();\n }\n\n protected deleteRole(role: ProfileRole) {\n if (role.id) void this.controller?.deleteRole(role.id);\n }\n\n protected cancel() {\n this.confirm.set(null);\n this.needsPassword.set(false);\n this.password.set('');\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n Input,\n inject,\n type OnDestroy,\n type OnInit,\n} from '@angular/core';\nimport { describeAuditAction } from '@atlasauth/js';\nimport { AtlasService } from '../atlas.service';\nimport { classFor, type ElementKey } from '../appearance';\nimport type { AtlasOrganizationAuditLog } from './organization-audit-log';\n\n/**\n * `<atlas-organization-audit-log>` — the active organization's audit trail for\n * its admins, next to `<atlas-organization-profile>`. The Angular peer of\n * React's `<OrganizationAuditLog/>`. Renders nothing for a member who may not\n * read it (the server is the authority; the component just follows it). Labels\n * are inputs so an app can localise them.\n */\n@Component({\n selector: 'atlas-organization-audit-log',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (atlas.organization() && !log.state().forbidden) {\n <div [class]=\"cls('card', 'atlas-card')\" data-atlas=\"organization-audit-log\">\n <h2 [class]=\"cls('headerTitle', 'atlas-title')\">{{ labels.title ?? 'Audit log' }}</h2>\n @if (log.state().entries.length === 0 && !log.state().loading) {\n <p [class]=\"cls('headerSubtitle', 'atlas-subtitle')\">{{ labels.empty ?? 'No activity recorded yet.' }}</p>\n } @else {\n <ul [class]=\"cls('list', 'atlas-audit-list')\">\n @for (entry of log.state().entries; track entry.id) {\n <li [class]=\"cls('listItem', 'atlas-audit-item')\" [attr.data-action]=\"entry.action\">\n <strong>{{ describe(entry.action) }}</strong>\n <span class=\"atlas-audit-meta\">\n · {{ formatDate(entry.created_at) }}{{ entry.actor.id ? ' · ' + (labels.actor ?? 'by') + ' ' + entry.actor.type + ' ' + entry.actor.id : '' }}\n </span>\n </li>\n }\n </ul>\n }\n @if (log.state().hasMore) {\n <button\n type=\"button\"\n [class]=\"cls('formButtonSecondary', 'atlas-button-secondary')\"\n [disabled]=\"log.state().loading\"\n (click)=\"log.loadMore()\"\n >\n {{ labels.loadMore ?? 'Load more' }}\n </button>\n }\n </div>\n }\n `,\n})\nexport class OrganizationAuditLogComponent implements OnInit, OnDestroy {\n /** Entries per page (the server caps it). */\n @Input() pageSize?: number;\n /** Narrow to one action, or a prefix ending in `.`. */\n @Input() action?: string;\n @Input() labels: { title?: string; empty?: string; loadMore?: string; actor?: string } = {};\n @Input() formatDate: (ms: number) => string = (ms) => new Date(ms).toLocaleString();\n\n protected readonly atlas = inject(AtlasService);\n /** Created in ngOnInit, once the inputs are set (templates render after it). */\n protected log!: AtlasOrganizationAuditLog;\n\n ngOnInit(): void {\n this.log = this.atlas.organizationAuditLog({ pageSize: this.pageSize, action: this.action });\n }\n\n ngOnDestroy(): void {\n this.log.destroy();\n }\n\n protected describe(action: string): string {\n return describeAuditAction(action);\n }\n\n protected cls(key: ElementKey, base: string): string {\n return classFor(key, this.atlas.appearance, base);\n }\n}\n","import { AtlasSignedInDirective } from './directives/signed-in.directive';\nimport { AtlasSignedOutDirective } from './directives/signed-out.directive';\nimport { AtlasLoadingDirective } from './directives/loading.directive';\nimport { AtlasLoadedDirective } from './directives/loaded.directive';\nimport { AtlasProtectDirective } from './directives/protect.directive';\nimport { AtlasRootDirective } from './directives/atlas-root.directive';\nimport { SignInComponent } from './components/sign-in.component';\nimport { SignUpComponent } from './components/sign-up.component';\nimport { UserButtonComponent } from './components/user-button.component';\nimport { OrganizationSwitcherComponent } from './components/organization-switcher.component';\nimport { UserProfileComponent } from './components/user-profile.component';\nimport { OrganizationProfileComponent } from './components/organization-profile.component';\nimport { OrganizationAuditLogComponent } from './components/organization-audit-log.component';\nimport { ManageCibaComponent } from './components/manage-ciba.component';\nimport { AtlasPoliciesDirective, PolicyAcceptStepComponent, PolicyGateComponent } from './components/policy-host';\n\n/**\n * Every standalone directive and component the SDK ships. Import the array in a\n * standalone component's `imports`, or rely on `AtlasModule` re-exporting it for\n * NgModule-based apps:\n *\n * ```ts\n * @Component({ standalone: true, imports: [...ATLAS_UI], template: '…' })\n * ```\n */\nexport const ATLAS_UI = [\n AtlasSignedInDirective,\n AtlasSignedOutDirective,\n AtlasLoadingDirective,\n AtlasLoadedDirective,\n AtlasProtectDirective,\n AtlasRootDirective,\n SignInComponent,\n SignUpComponent,\n UserButtonComponent,\n OrganizationSwitcherComponent,\n UserProfileComponent,\n OrganizationProfileComponent,\n OrganizationAuditLogComponent,\n ManageCibaComponent,\n AtlasPoliciesDirective,\n PolicyAcceptStepComponent,\n PolicyGateComponent,\n] as const;\n","import {\n ENVIRONMENT_INITIALIZER,\n EnvironmentProviders,\n ModuleWithProviders,\n NgModule,\n Provider,\n inject,\n makeEnvironmentProviders,\n} from '@angular/core';\nimport { ATLAS_OPTIONS, type AtlasOptions } from './atlas.config';\nimport { AtlasService } from './atlas.service';\nimport { ATLAS_UI } from './atlas.ui';\n\n/**\n * Standalone-provider entry point (Angular 17+). Register Atlas once at the\n * application root — the direct analogue of wrapping the tree in React's\n * `<AtlasProvider publishableKey>`:\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideAtlas({ publishableKey: 'pk_test_…' }),\n * provideRouter(routes),\n * ],\n * });\n * ```\n *\n * The returned providers make {@link AtlasService} injectable and eagerly\n * construct it, so the SDK begins its first boot (redirect-completion + session\n * read) as soon as the app starts — matching the React provider mounting on the\n * first render.\n */\nexport function provideAtlas(options: AtlasOptions): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: ATLAS_OPTIONS, useValue: options },\n AtlasService,\n {\n // Eagerly instantiate AtlasService so its boot runs at startup rather than\n // lazily on first injection — the equivalent of the provider mounting.\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useValue: () => {\n inject(AtlasService);\n },\n },\n ]);\n}\n\n/**\n * NgModule entry point for apps not yet on the standalone bootstrap. Import\n * `AtlasModule.forRoot({ publishableKey })` once in the root module; feature\n * modules import `AtlasModule` (no args) to use the directives/components.\n */\n@NgModule({\n // Standalone directives/components are re-exported so NgModule consumers get\n // them just by importing AtlasModule, the way they would with a classic module.\n imports: [...ATLAS_UI],\n exports: [...ATLAS_UI],\n})\nexport class AtlasModule {\n static forRoot(options: AtlasOptions): ModuleWithProviders<AtlasModule> {\n const providers: Provider[] = [\n { provide: ATLAS_OPTIONS, useValue: options },\n AtlasService,\n {\n provide: ENVIRONMENT_INITIALIZER,\n multi: true,\n useValue: () => {\n inject(AtlasService);\n },\n },\n ];\n return { ngModule: AtlasModule, providers };\n }\n}\n","import { ChangeDetectionStrategy, Component, EventEmitter, Output, computed, inject, signal } from '@angular/core';\nimport { actorFromClaims, type EndImpersonationResult } from '@atlasauth/js';\nimport { AtlasService } from '../atlas.service';\nimport { classFor, type ElementKey } from '../appearance';\nimport { translate } from '../i18n';\n\n/**\n * `<atlas-impersonation-banner>` — shown only while the active session is an\n * impersonation, naming the user acted as, with \"Return to admin\" (or \"End\n * impersonation\" when there is no session of the impersonator's to resume).\n * Emits `ended` with the outcome. The Angular peer of React's\n * `<ImpersonationBanner/>`.\n */\n@Component({\n selector: 'atlas-impersonation-banner',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (actor()) {\n <div [class]=\"cls('card', 'atlas-alert atlas-impersonation-banner')\" role=\"status\">\n <span [class]=\"cls('headerSubtitle', 'atlas-text')\">{{ t('impersonation.banner', { name: name() }) }}</span>\n <button type=\"button\" [class]=\"cls('formButtonPrimary', 'atlas-button')\" [disabled]=\"busy()\" (click)=\"end()\">\n {{ canReturn() ? t('impersonation.returnToAdmin') : t('impersonation.end') }}\n </button>\n </div>\n }\n `,\n})\nexport class ImpersonationBannerComponent {\n protected readonly atlas = inject(AtlasService);\n @Output() readonly ended = new EventEmitter<EndImpersonationResult>();\n protected readonly busy = signal(false);\n\n protected readonly actor = computed(\n () => actorFromClaims(this.atlas.claims()) ?? this.atlas.session()?.actor ?? null,\n );\n protected readonly canReturn = computed(\n () => this.actor() !== null && Boolean(this.atlas.session()?.actor_session_id),\n );\n protected readonly name = computed(() => {\n const u = this.atlas.user();\n return (\n [u?.first_name, u?.last_name].filter(Boolean).join(' ') ||\n u?.username ||\n u?.email_addresses?.find((e) => e.primary)?.email_address ||\n u?.id ||\n ''\n );\n });\n\n protected t(key: string, vars?: Record<string, string>): string {\n return translate(this.atlas.localization, key, vars);\n }\n\n protected cls(key: ElementKey, base: string): string {\n return classFor(key, this.atlas.appearance, base);\n }\n\n protected async end(): Promise<void> {\n this.busy.set(true);\n try {\n this.ended.emit(await this.atlas.endImpersonation());\n } finally {\n this.busy.set(false);\n }\n }\n}\n","import { inject } from '@angular/core';\nimport {\n CanActivateChildFn,\n CanActivateFn,\n Router,\n type UrlTree,\n} from '@angular/router';\nimport { firstValueFrom } from 'rxjs';\nimport { filter, take } from 'rxjs/operators';\nimport { evaluate, type ProtectCondition } from '@atlasauth/authz';\nimport { AtlasService } from '../atlas.service';\n\nexport interface AtlasGuardOptions extends ProtectCondition {\n /**\n * Where to send a user who fails the check. When set, the guard returns a\n * `UrlTree` (a redirect); when omitted it simply returns `false` and the\n * navigation is cancelled. A common value is your sign-in route.\n */\n redirectTo?: string;\n /**\n * When true, append the attempted URL as a `redirect_url` query param on the\n * `redirectTo` target, so the sign-in page can send the user back afterwards.\n * Ignored unless `redirectTo` is set. Defaults to true.\n */\n preserveReturnUrl?: boolean;\n}\n\n/**\n * Route guard factory that gates a route on session — and optionally on a\n * permission/role. The Angular peer of using `<SignedIn>` / `<Protect>` to fence\n * a page, expressed as a `CanActivateFn`.\n *\n * ```ts\n * export const routes: Routes = [\n * { path: 'dashboard', canActivate: [atlasGuard({ redirectTo: '/sign-in' })], ... },\n * {\n * path: 'admin',\n * canActivate: [atlasGuard({ permission: 'org:admin', redirectTo: '/' })],\n * ...\n * },\n * ];\n * ```\n *\n * The guard first waits for the SDK to finish booting, so a hard refresh onto a\n * protected URL does not bounce to sign-in before the session has been read.\n * Like the components, this is UX, not security: the server enforces the same\n * checks on every request.\n */\nexport function atlasGuard(options: AtlasGuardOptions = {}): CanActivateFn {\n const { redirectTo, preserveReturnUrl = true, ...condition } = options;\n\n return async (_route, state): Promise<boolean | UrlTree> => {\n const atlas = inject(AtlasService);\n const router = inject(Router);\n\n // Wait for boot to settle so we judge against a real answer, not `loading`.\n await firstValueFrom(\n atlas.status$.pipe(\n filter((s) => s !== 'loading'),\n take(1),\n ),\n );\n\n const allowed = evaluate(atlas.claims(), condition as ProtectCondition).allowed;\n if (allowed) return true;\n\n if (redirectTo) {\n return router.createUrlTree([redirectTo], {\n queryParams: preserveReturnUrl ? { redirect_url: state.url } : undefined,\n });\n }\n return false;\n };\n}\n\n/**\n * The `CanActivateChild` form of {@link atlasGuard}, for gating a whole child\n * route subtree with one declaration.\n */\nexport function atlasChildGuard(options: AtlasGuardOptions = {}): CanActivateChildFn {\n const guard = atlasGuard(options);\n return (route, state) => guard(route, state);\n}\n","/**\n * Conditional-rendering authorization primitive — re-exported unchanged from\n * `@atlasauth/authz`, the ONE evaluator every Atlas SDK shares. `*atlasProtect` in\n * this package and `<Protect>` in `@atlasauth/react` therefore judge a condition\n * identically, and the server checking the same permission is what actually\n * stops a request; these helpers only decide what a user is shown.\n */\nexport {\n type ProtectCondition,\n type ProtectOutcome,\n type ProtectReason,\n evaluate,\n hasFromClaims,\n} from '@atlasauth/authz';\n","/**\n * Public data shapes, mirrored 1:1 from `@atlasauth/react`'s `types.ts` so an app\n * can move between the React and Angular SDKs without re-typing its models.\n */\n\nexport interface SessionClaims {\n sub: string;\n sid: string;\n exp: number;\n org_id?: string;\n org_slug?: string;\n org_role?: string;\n org_permissions?: string[];\n mfa?: boolean;\n [claim: string]: unknown;\n}\n\nexport interface AtlasUser {\n id: string;\n first_name: string | null;\n last_name: string | null;\n username: string | null;\n image_url: string | null;\n public_metadata: Record<string, unknown>;\n unsafe_metadata: Record<string, unknown>;\n mfa_enabled: boolean;\n has_password: boolean;\n email_addresses?: Array<{\n id: string;\n email_address: string;\n verified: boolean;\n primary: boolean;\n }>;\n}\n\nexport interface AtlasOrganizationMembership {\n role: string;\n organization: {\n id: string;\n name: string;\n slug: string;\n image_url: string | null;\n };\n}\n\nexport interface AtlasSession {\n id: string;\n status: string;\n last_active_organization_id: string | null;\n /** On an impersonation session: who is acting (the token's `act` claim). */\n actor?: { sub: string } | null;\n /** On an impersonation session: the impersonator's own session that \"return to admin\" resumes, or null. */\n actor_session_id?: string | null;\n}\n\n/** The three-state auth lifecycle, identical to the React provider's. */\nexport type AuthStatus = 'loading' | 'signed_in' | 'signed_out';\n","/**\n * The FAPI client and the server-driven sign-in flow driver live in `@atlasauth/js`\n * — the pure, framework-agnostic browser flow. This thin re-export lets the\n * Angular components, guards and services resolve the driver from one place, so\n * the Angular `<atlas-sign-in>` and the React `<SignIn/>` drive the exact same\n * endpoints and cannot diverge in what the server sees.\n */\nexport {\n FapiClient,\n advance,\n prepareFactor,\n pollAttempt,\n shouldKeepPolling,\n requestForStep,\n flowFromPending,\n initialFlow,\n getProviderToken,\n type FapiClientOptions,\n type FapiResponse,\n type FlowState,\n type ProviderToken,\n} from '@atlasauth/js';\n","/**\n * `@atlasauth/angular` — the official Angular SDK for Atlas, the Angular peer of\n * `@atlasauth/react`. Public surface.\n */\n\n// Configuration + DI\nexport { ATLAS_OPTIONS, type AtlasOptions } from './lib/atlas.config';\nexport { provideAtlas, AtlasModule } from './lib/provide-atlas';\n\n// Core service (the AtlasProvider + hooks equivalent)\nexport { AtlasService } from './lib/atlas.service';\n\n// Structural directives + the theming host directive\nexport { AtlasSignedInDirective } from './lib/directives/signed-in.directive';\nexport { AtlasSignedOutDirective } from './lib/directives/signed-out.directive';\nexport { AtlasLoadingDirective } from './lib/directives/loading.directive';\nexport { AtlasLoadedDirective } from './lib/directives/loaded.directive';\nexport { AtlasProtectDirective } from './lib/directives/protect.directive';\nexport { AtlasRootDirective } from './lib/directives/atlas-root.directive';\n\n// Components\nexport { SignInComponent } from './lib/components/sign-in.component';\nexport { SignUpComponent } from './lib/components/sign-up.component';\nexport { UserButtonComponent } from './lib/components/user-button.component';\nexport { OrganizationSwitcherComponent } from './lib/components/organization-switcher.component';\nexport { UserProfileComponent } from './lib/components/user-profile.component';\nexport { OrganizationProfileComponent } from './lib/components/organization-profile.component';\nexport { ManageCibaComponent } from './lib/components/manage-ciba.component';\nexport { OrganizationAuditLogComponent } from './lib/components/organization-audit-log.component';\nexport { AtlasOrganizationAuditLog } from './lib/components/organization-audit-log';\nexport type { OrganizationAuditLogEntry, OrganizationAuditLogState, OrganizationAuditLogOptions } from '@atlasauth/js';\nexport { ImpersonationBannerComponent } from './lib/components/impersonation-banner.component';\nexport { AttemptFlowComponent } from './lib/components/attempt-flow.component';\nexport {\n SignUpFormComponent,\n type SignUpFormSubmit,\n} from './lib/components/sign-up-form.component';\nexport { AtlasCaptchaSlotDirective } from './lib/directives/captcha-slot.directive';\n// Policy acceptance (terms, privacy, any policy): consent block / clickwrap host, sign-in step, in-app gate.\nexport { AtlasPoliciesDirective, PolicyAcceptStepComponent, PolicyGateComponent } from './lib/components/policy-host';\nexport { AtlasFlowController } from './lib/components/flow-controller';\nexport { ATLAS_UI } from './lib/atlas.ui';\n\n// Route guards\nexport {\n atlasGuard,\n atlasChildGuard,\n type AtlasGuardOptions,\n} from './lib/guards/atlas.guard';\n\n// Theming, i18n, authorization, data shapes, FAPI re-exports\nexport * from './lib/appearance';\nexport * from './lib/i18n';\nexport * from './lib/protect';\nexport * from './lib/types';\nexport * from './lib/fapi';\n\n// The instance's public sign-in / sign-up settings the prebuilt forms read\n// (`AtlasFlowController.settings`), and the captcha types they render.\nexport type {\n InstanceSettings,\n PublicSignUpField,\n CaptchaController,\n CaptchaFlowKey,\n CaptchaWidgetMode,\n FlowCaptcha,\n EmailDelivery,\n SignOutOptions,\n SignOutResult,\n} from '@atlasauth/js';\n\n// `AtlasService.signOut()` resolves a `SignOutResult`; `{ strict: true }`\n// rejects with a `SignOutError` when the revoke was never confirmed.\nexport { SignOutError } from '@atlasauth/js';\n\n// `onSignOut({ reason })` event types + the `atlas:signout` window event; this SDK's version.\nexport { SIGN_OUT_EVENT, onAtlasSignOut } from '@atlasauth/js';\nexport type { SignOutEvent, SignOutReason } from '@atlasauth/js';\nexport { ATLAS_ANGULAR_SDK, ATLAS_ANGULAR_VERSION } from './lib/version';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["fetchProviderToken","hostedSignUp","i1.AtlasSignedInDirective","i2.AtlasSignedOutDirective","i3.AtlasLoadingDirective","i4.AtlasLoadedDirective","i5.AtlasProtectDirective","i6.AtlasRootDirective","i7.SignInComponent","i8.SignUpComponent","i9.UserButtonComponent","i10.OrganizationSwitcherComponent","i11.UserProfileComponent","i12.OrganizationProfileComponent","i13.OrganizationAuditLogComponent","i14.ManageCibaComponent","i15.AtlasPoliciesDirective","i15.PolicyAcceptStepComponent","i15.PolicyGateComponent"],"mappings":";;;;;;;;;;;;;;AAoDA;;;;AAIG;MACU,aAAa,GAAG,IAAI,cAAc,CAAe,eAAe;;AC7C7E;;;;;;AAMG;MACU,yBAAyB,CAAA;AACnB,IAAA,MAAM;AACN,IAAA,GAAG;AACH,IAAA,WAAW;AACX,IAAA,eAAe;AAEvB,IAAA,KAAK;AAEd,IAAA,WAAA,CACE,MAA+B,EAC/B,aAA6D,EAC7D,UAAuC,EAAE,EAAA;QAEzC,IAA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