{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "auth-flow-team-invite",
  "type": "registry:component",
  "title": "Auth Flow Team Invite",
  "description": "An invite acceptance that starts from a ticket with the inviter and member stack, creates the account with the email already verified, then turns into a token field for inviting teammates. Emails become chips with a role switch and an External tag, a seat meter fills as you add people, and sent chips fly into the member stack.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "auth",
    "auth",
    "invite",
    "sign up",
    "team",
    "seats",
    "onboarding"
  ],
  "docs": "https://hyperblur.dev/effects/auth-flow-team-invite",
  "files": [
    {
      "path": "registry/hyperblur/auth-flow-team-invite.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/auth-flow-team-invite.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface AuthFlowInviteMember {\n  name: string;\n  color?: string;\n}\n\nexport type AuthFlowInviteRole = \"Member\" | \"Admin\" | \"Guest\";\n\nexport interface AuthFlowTeamInviteProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\" | \"onSubmit\"> {\n  workspace?: string;\n  inviter?: string;\n  email?: string;\n  role?: string;\n  domain?: string;\n  members?: AuthFlowInviteMember[];\n  suggestions?: string[];\n  seats?: number;\n  defaultStep?: number;\n  defaultInvites?: string[];\n  onJoin?: (values: { name: string; password: string }) => void | Promise<unknown>;\n  onInvite?: (invites: { email: string; role: AuthFlowInviteRole }[]) => void | Promise<unknown>;\n  headingAs?: \"h1\" | \"h2\" | \"h3\";\n  accent?: string;\n}\n\nconst css = `\n@keyframes hb-vg7-in {\n  from { opacity: 0; transform: translate3d(0, 12px, 0); }\n  to { opacity: 1; transform: translate3d(0, 0, 0); }\n}\n@keyframes hb-vg7-chip {\n  0% { opacity: 0; transform: scale(.6); }\n  70% { transform: scale(1.06); }\n  100% { opacity: 1; transform: scale(1); }\n}\n@keyframes hb-vg7-fly {\n  0% { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }\n  100% { opacity: 0; transform: translate3d(var(--fx), -150px, 0) scale(.35); }\n}\n@keyframes hb-vg7-pop {\n  0% { transform: scale(0); }\n  70% { transform: scale(1.15); }\n  100% { transform: scale(1); }\n}\n@keyframes hb-vg7-shine { to { background-position: -200% 0; } }\n.hb-vg7 {\n  --hb-vg7-accent: #34d399;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  padding: 64px 20px;\n  overflow: hidden;\n  isolation: isolate;\n  container-type: inline-size;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-vg7 *, .hb-vg7 *::before, .hb-vg7 *::after { box-sizing: border-box; }\n.hb-vg7::before { content: \"\"; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse 50% 40% at 50% 0%, color-mix(in srgb, var(--hb-vg7-accent) 12%, transparent), transparent 70%), radial-gradient(circle at 50% 0%, rgba(255,255,255,.04) 1px, transparent 1px) 0 0 / 22px 22px; }\n.hb-vg7-col { max-width: 560px; margin: 0 auto; }\n.hb-vg7-ticket { position: relative; display: flex; align-items: center; gap: 16px; padding: 18px 20px; border: 1px solid #262626; border-radius: 18px; background: linear-gradient(110deg, #141414 40%, color-mix(in srgb, var(--hb-vg7-accent) 10%, #141414) 50%, #141414 60%) 0 0 / 200% 100%; box-shadow: inset 0 1px 0 rgba(255,255,255,.05); animation: hb-vg7-shine 6s cubic-bezier(.4, 0, .2, 1) infinite; }\n.hb-vg7-ticket::before, .hb-vg7-ticket::after { content: \"\"; position: absolute; top: 50%; width: 16px; height: 16px; margin-top: -8px; border: 1px solid #262626; border-radius: 50%; background: #0a0a0a; }\n.hb-vg7-ticket::before { left: -9px; clip-path: inset(0 0 0 50%); }\n.hb-vg7-ticket::after { right: -9px; clip-path: inset(0 50% 0 0); }\n.hb-vg7-logo { flex: 0 0 auto; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, var(--hb-vg7-accent), color-mix(in srgb, var(--hb-vg7-accent) 40%, #0a0a0a)); color: #04120c; font-family: var(--font-grotesk), var(--font-sans), sans-serif; font-size: 20px; font-weight: 700; box-shadow: inset 0 1px 0 rgba(255,255,255,.35); }\n.hb-vg7-tx { min-width: 0; flex: 1 1 auto; }\n.hb-vg7-tx p { margin: 0; color: #a1a1a1; font-size: 13px; line-height: 1.5; }\n.hb-vg7-tx p b { color: #ededed; font-weight: 600; }\n.hb-vg7-tx strong { display: block; margin-top: 2px; font-size: 17px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.hb-vg7-stack { display: flex; flex: 0 0 auto; padding-left: 8px; }\n.hb-vg7-av { display: grid; place-items: center; width: 30px; height: 30px; margin-left: -8px; border: 2px solid #141414; border-radius: 50%; background: var(--c, #333); color: #0a0a0a; font-size: 11px; font-weight: 700; }\n.hb-vg7-av[data-new=\"true\"] { animation: hb-vg7-pop .45s cubic-bezier(.3, 1.5, .5, 1) both; animation-delay: calc(var(--d) * 90ms + 450ms); }\n.hb-vg7-more { background: #222; color: #cfcfcf; font-size: 10.5px; }\n.hb-vg7-card { margin-top: 18px; padding: 28px; border: 1px solid #222; border-radius: 22px; background: linear-gradient(180deg, #131313, #0e0e0e); box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 40px 80px -40px #000; }\n.hb-vg7-pane { animation: hb-vg7-in .45s cubic-bezier(.2, .8, .2, 1) both; }\n.hb-vg7-title { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -.025em; }\n.hb-vg7-sub { margin: 6px 0 0; color: #a1a1a1; font-size: 14px; line-height: 1.55; }\n.hb-vg7-fields { display: grid; gap: 14px; margin-top: 22px; }\n.hb-vg7-label { display: block; margin-bottom: 6px; color: #cfcfcf; font-size: 13px; font-weight: 550; }\n.hb-vg7-input { width: 100%; height: 44px; padding: 0 14px; border: 1px solid #262626; border-radius: 11px; background: #0a0a0a; color: #ededed; font: inherit; font-size: 14.5px; outline: none; transition: border-color .2s ease, box-shadow .2s ease; }\n.hb-vg7-input::placeholder { color: #555; }\n.hb-vg7-input:focus { border-color: color-mix(in srgb, var(--hb-vg7-accent) 55%, #262626); box-shadow: 0 0 0 4px color-mix(in srgb, var(--hb-vg7-accent) 12%, transparent); }\n.hb-vg7-locked { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 44px; padding: 0 12px 0 14px; border: 1px solid #1f1f1f; border-radius: 11px; background: #0d0d0d; color: #a1a1a1; font-size: 14.5px; }\n.hb-vg7-locked span:last-child { display: inline-flex; align-items: center; gap: 6px; color: var(--hb-vg7-accent); font-size: 12px; font-weight: 600; white-space: nowrap; }\n.hb-vg7-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }\n.hb-vg7-role { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; color: #8f8f8f; font-size: 12.5px; }\n.hb-vg7-role b { padding: 3px 8px; border: 1px solid #2a2a2a; border-radius: 6px; color: #ededed; font-weight: 600; }\n.hb-vg7-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 46px; margin-top: 20px; border: 0; border-radius: 12px; background: var(--hb-vg7-accent); color: #04120c; font: inherit; font-size: 14.5px; font-weight: 650; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 12px 28px -14px var(--hb-vg7-accent); transition: transform .15s ease, filter .2s ease, opacity .2s ease; }\n.hb-vg7-btn:hover:not(:disabled) { filter: brightness(1.07); }\n.hb-vg7-btn:active:not(:disabled) { transform: scale(.985); }\n.hb-vg7-btn:disabled { opacity: .4; cursor: not-allowed; }\n.hb-vg7-btn:focus-visible, .hb-vg7-skip:focus-visible, .hb-vg7-x:focus-visible, .hb-vg7-rbtn:focus-visible, .hb-vg7-sug button:focus-visible { outline: 2px solid var(--hb-vg7-accent); outline-offset: 2px; }\n.hb-vg7-err { min-height: 18px; margin-top: 10px; color: #fca5a5; font-size: 13px; }\n.hb-vg7-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 52px; margin-top: 20px; padding: 7px; border: 1px solid #262626; border-radius: 13px; background: #0a0a0a; cursor: text; transition: border-color .2s ease, box-shadow .2s ease; }\n.hb-vg7-box:focus-within { border-color: color-mix(in srgb, var(--hb-vg7-accent) 55%, #262626); box-shadow: 0 0 0 4px color-mix(in srgb, var(--hb-vg7-accent) 12%, transparent); }\n.hb-vg7-box input { flex: 1 1 140px; min-width: 120px; height: 34px; padding: 0 6px; border: 0; background: none; color: #ededed; font: inherit; font-size: 14px; outline: none; }\n.hb-vg7-box input::placeholder { color: #555; }\n.hb-vg7-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 4px 0 6px; border: 1px solid #2a2a2a; border-radius: 9px; background: #151515; font-size: 13px; animation: hb-vg7-chip .3s cubic-bezier(.3, 1.4, .5, 1) both; max-width: 100%; }\n.hb-vg7-chip[data-flying=\"true\"] { animation: hb-vg7-fly .6s cubic-bezier(.5, 0, .75, 0) forwards; animation-delay: calc(var(--d) * 70ms); }\n.hb-vg7-chip[data-bad=\"true\"] { border-color: #5b1d1d; background: #170b0b; color: #fca5a5; }\n.hb-vg7-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--c); flex: 0 0 auto; display: grid; place-items: center; color: #0a0a0a; font-size: 9px; font-weight: 700; }\n.hb-vg7-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }\n.hb-vg7-ext { padding: 1px 5px; border-radius: 4px; background: #2a2210; color: #fbbf24; font-size: 10.5px; font-weight: 650; }\n.hb-vg7-rbtn { height: 24px; padding: 0 7px; border: 1px solid #2a2a2a; border-radius: 6px; background: #0e0e0e; color: #cfcfcf; font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; transition: background .2s ease; }\n.hb-vg7-rbtn:hover { background: #1c1c1c; }\n.hb-vg7-x { display: grid; place-items: center; width: 22px; height: 22px; border: 0; border-radius: 6px; background: none; color: #8f8f8f; cursor: pointer; }\n.hb-vg7-x:hover { background: #222; color: #ededed; }\n.hb-vg7-hint { margin-top: 8px; color: #6b6b6b; font-size: 12px; }\n.hb-vg7-seats { margin-top: 18px; }\n.hb-vg7-seats div:first-child { display: flex; justify-content: space-between; color: #a1a1a1; font-size: 12.5px; }\n.hb-vg7-seats b { color: #ededed; font-weight: 600; font-variant-numeric: tabular-nums; }\n.hb-vg7-meter { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; margin-top: 8px; }\n.hb-vg7-meter span { height: 6px; border-radius: 2px; background: #1f1f1f; transition: background .3s ease; transition-delay: calc(var(--d) * 30ms); }\n.hb-vg7-meter span[data-s=\"used\"] { background: #4b4b4b; }\n.hb-vg7-meter span[data-s=\"new\"] { background: var(--hb-vg7-accent); }\n.hb-vg7-meter span[data-s=\"over\"] { background: #f87171; }\n.hb-vg7-sug { margin-top: 20px; }\n.hb-vg7-sug h4 { margin: 0 0 8px; color: #8f8f8f; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }\n.hb-vg7-sug ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }\n.hb-vg7-sug li { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 8px; border-radius: 10px; font-size: 13.5px; transition: background .2s ease; }\n.hb-vg7-sug li:hover { background: #141414; }\n.hb-vg7-sug li span:nth-child(2) { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #cfcfcf; }\n.hb-vg7-sug button { height: 28px; padding: 0 10px; border: 1px solid #2a2a2a; border-radius: 8px; background: #121212; color: #ededed; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }\n.hb-vg7-sug button:hover { border-color: #3a3a3a; }\n.hb-vg7-actions { display: flex; align-items: center; gap: 12px; margin-top: 20px; }\n.hb-vg7-actions .hb-vg7-btn { margin-top: 0; flex: 1 1 auto; }\n.hb-vg7-skip { flex: 0 0 auto; height: 46px; padding: 0 16px; border: 0; border-radius: 12px; background: none; color: #a1a1a1; font: inherit; font-size: 14px; font-weight: 550; cursor: pointer; }\n.hb-vg7-skip:hover { color: #ededed; background: #151515; }\n.hb-vg7-done { text-align: center; padding: 8px 0; }\n.hb-vg7-done .hb-vg7-sub { max-width: 380px; margin-left: auto; margin-right: auto; }\n.hb-vg7-done a { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; height: 44px; padding: 0 18px; border-radius: 12px; background: #ededed; color: #0a0a0a; font-size: 14px; font-weight: 650; text-decoration: none; }\n.hb-vg7-done a:focus-visible { outline: 2px solid var(--hb-vg7-accent); outline-offset: 3px; }\n@container (max-width: 560px) {\n  .hb-vg7-stack { display: none; }\n  .hb-vg7-row { grid-template-columns: minmax(0, 1fr); }\n  .hb-vg7-card { padding: 22px; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-vg7 *, .hb-vg7 *::before, .hb-vg7 *::after { animation: none !important; transition: none !important; }\n}\n`;\n\nconst palette = [\"#fda4af\", \"#fcd34d\", \"#86efac\", \"#7dd3fc\", \"#c4b5fd\", \"#f0abfc\", \"#fdba74\", \"#5eead4\"];\n\nfunction seedOf(s: string) {\n  let h = 2166136261;\n  for (let i = 0; i < s.length; i++) h = Math.imul(h ^ s.charCodeAt(i), 16777619) >>> 0;\n  return h >>> 0;\n}\n\nfunction colorOf(s: string) {\n  return palette[seedOf(s) % palette.length];\n}\n\nfunction initialsOf(s: string) {\n  const base = s.includes(\"@\") ? s.split(\"@\")[0].replace(/[._-]+/g, \" \") : s;\n  return base.split(/\\s+/).filter(Boolean).map((p) => p[0]).slice(0, 2).join(\"\").toUpperCase();\n}\n\nfunction wait(result: void | Promise<unknown>, ms: number) {\n  return result instanceof Promise ? result : new Promise((resolve) => window.setTimeout(resolve, ms));\n}\n\nconst roles: AuthFlowInviteRole[] = [\"Member\", \"Admin\", \"Guest\"];\nconst valid = (e: string) => /^[^\\s@]+@[^\\s@]+\\.[^\\s@]{2,}$/.test(e);\n\ninterface Chip {\n  email: string;\n  role: AuthFlowInviteRole;\n}\n\nexport function AuthFlowTeamInvite({\n  workspace = \"Atlas Robotics\",\n  inviter = \"Jordan Reyes\",\n  email = \"sam.okafor@atlasrobotics.com\",\n  role = \"Editor\",\n  domain = \"atlasrobotics.com\",\n  members = [{ name: \"Jordan Reyes\" }, { name: \"Priya Nair\" }, { name: \"Leo Brandt\" }, { name: \"Ana Souza\" }, { name: \"Kenji Ito\" }, { name: \"Mara Voss\" }],\n  suggestions = [\"lena.fischer@atlasrobotics.com\", \"omar.haddad@atlasrobotics.com\", \"chloe.martin@atlasrobotics.com\"],\n  seats = 12,\n  defaultStep = 0,\n  defaultInvites = [],\n  onJoin,\n  onInvite,\n  headingAs = \"h2\",\n  accent = \"#34d399\",\n  className = \"\",\n  style,\n  ...rest\n}: AuthFlowTeamInviteProps) {\n  const Heading = headingAs;\n  const uid = React.useId();\n  const draftRef = React.useRef<HTMLInputElement>(null);\n  const [step, setStep] = React.useState(Math.max(0, Math.min(2, defaultStep)));\n  const [name, setName] = React.useState(\"\");\n  const [password, setPassword] = React.useState(\"\");\n  const [error, setError] = React.useState(\"\");\n  const [busy, setBusy] = React.useState(false);\n  const [chips, setChips] = React.useState<Chip[]>(() => defaultInvites.map((e) => ({ email: e.toLowerCase(), role: e.toLowerCase().endsWith(`@${domain}`) ? \"Member\" : \"Guest\" })));\n  const [draft, setDraft] = React.useState(\"\");\n  const [flying, setFlying] = React.useState(false);\n  const [joined, setJoined] = React.useState<string[]>([]);\n\n  const used = members.length + 1;\n  const good = chips.filter((c) => valid(c.email));\n  const free = Math.max(0, seats - used);\n  const over = Math.max(0, good.length - free);\n\n  const join = (e: React.FormEvent) => {\n    e.preventDefault();\n    if (name.trim().length < 2) return setError(\"Add your full name so teammates recognise you.\");\n    if (password.length < 10) return setError(\"Use at least 10 characters for your password.\");\n    setError(\"\");\n    setBusy(true);\n    wait(onJoin?.({ name: name.trim(), password }), 800).then(\n      () => {\n        setBusy(false);\n        setStep(1);\n      },\n      (err: unknown) => {\n        setBusy(false);\n        setError(err instanceof Error ? err.message : \"We couldn't create your account.\");\n      },\n    );\n  };\n\n  const add = (raw: string) => {\n    const list = raw.split(/[\\s,;]+/).map((s) => s.trim().toLowerCase()).filter(Boolean);\n    if (!list.length) return;\n    setChips((cs) => {\n      const next = [...cs];\n      for (const e of list) if (!next.some((c) => c.email === e) && e !== email) next.push({ email: e, role: e.endsWith(`@${domain}`) ? \"Member\" : \"Guest\" });\n      return next;\n    });\n    setDraft(\"\");\n  };\n\n  const onKey = (e: React.KeyboardEvent<HTMLInputElement>) => {\n    if (e.key === \"Enter\" || e.key === \",\" || e.key === \"Tab\") {\n      if (draft.trim()) {\n        e.preventDefault();\n        add(draft);\n      }\n    } else if (e.key === \"Backspace\" && !draft && chips.length) {\n      setChips((cs) => cs.slice(0, -1));\n    }\n  };\n\n  const cycle = (i: number) => setChips((cs) => cs.map((c, j) => (j === i ? { ...c, role: roles[(roles.indexOf(c.role) + 1) % roles.length] } : c)));\n\n  const send = () => {\n    if (!good.length || over > 0 || busy) return;\n    setBusy(true);\n    const payload = good.map((c) => ({ email: c.email, role: c.role }));\n    wait(onInvite?.(payload), 500).then(\n      () => {\n        setFlying(true);\n        window.setTimeout(() => {\n          setJoined(payload.map((p) => p.email));\n          setBusy(false);\n          setFlying(false);\n          setChips([]);\n          setStep(2);\n        }, 650 + payload.length * 70);\n      },\n      (err: unknown) => {\n        setBusy(false);\n        setError(err instanceof Error ? err.message : \"Invites couldn't be sent.\");\n      },\n    );\n  };\n\n  const shown = members.slice(0, 4);\n  const extra = members.length - shown.length;\n  const vars = { \"--hb-vg7-accent\": accent, ...style } as React.CSSProperties;\n  const check = (\n    <svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n      <path d=\"M2.5 6.5l2.2 2.2L9.5 3.8\" />\n    </svg>\n  );\n\n  return (\n    <section className={`hb-vg7 ${className}`} style={vars} aria-labelledby={`${uid}-t`} {...rest}>\n      <style href=\"hb-auth-flow-team-invite\" precedence=\"default\">{css}</style>\n      <div className=\"hb-vg7-col\">\n        <div className=\"hb-vg7-ticket\">\n          <span className=\"hb-vg7-logo\" aria-hidden=\"true\">{workspace[0]}</span>\n          <div className=\"hb-vg7-tx\">\n            <p>\n              <b>{inviter}</b> invited you to join\n            </p>\n            <strong>{workspace}</strong>\n          </div>\n          <div className=\"hb-vg7-stack\" aria-label={`${members.length + joined.length} members`}>\n            {shown.map((m) => (\n              <span key={m.name} className=\"hb-vg7-av\" style={{ \"--c\": m.color ?? colorOf(m.name) } as React.CSSProperties} title={m.name}>\n                {initialsOf(m.name)}\n              </span>\n            ))}\n            {extra > 0 ? <span className=\"hb-vg7-av hb-vg7-more\">+{extra}</span> : null}\n            {joined.map((e, i) => (\n              <span key={e} className=\"hb-vg7-av\" data-new=\"true\" style={{ \"--c\": colorOf(e), \"--d\": i } as React.CSSProperties} title={e}>\n                {initialsOf(e)}\n              </span>\n            ))}\n          </div>\n        </div>\n        <div className=\"hb-vg7-card\">\n          {step === 0 ? (\n            <form className=\"hb-vg7-pane\" onSubmit={join} noValidate key=\"join\">\n              <Heading id={`${uid}-t`} className=\"hb-vg7-title\">Create your account</Heading>\n              <p className=\"hb-vg7-sub\">One step and you&apos;re in. The invite already confirmed your email.</p>\n              <div className=\"hb-vg7-fields\">\n                <div>\n                  <span className=\"hb-vg7-label\">Work email</span>\n                  <div className=\"hb-vg7-locked\">\n                    <span>{email}</span>\n                    <span>{check} Verified by invite</span>\n                  </div>\n                </div>\n                <div className=\"hb-vg7-row\">\n                  <div>\n                    <label className=\"hb-vg7-label\" htmlFor={`${uid}-n`}>Full name</label>\n                    <input id={`${uid}-n`} className=\"hb-vg7-input\" value={name} onChange={(e) => setName(e.target.value)} placeholder=\"Sam Okafor\" autoComplete=\"name\" />\n                  </div>\n                  <div>\n                    <label className=\"hb-vg7-label\" htmlFor={`${uid}-p`}>Password</label>\n                    <input id={`${uid}-p`} className=\"hb-vg7-input\" type=\"password\" value={password} onChange={(e) => setPassword(e.target.value)} placeholder=\"10+ characters\" autoComplete=\"new-password\" />\n                  </div>\n                </div>\n              </div>\n              <div className=\"hb-vg7-role\">\n                You&apos;ll join as <b>{role}</b> · invite expires in 6 days\n              </div>\n              <button type=\"submit\" className=\"hb-vg7-btn\" disabled={busy} aria-busy={busy || undefined}>\n                {busy ? \"Joining\" : `Join ${workspace}`}\n              </button>\n              <div className=\"hb-vg7-err\" role=\"alert\">{error}</div>\n            </form>\n          ) : step === 1 ? (\n            <div className=\"hb-vg7-pane\" key=\"invite\">\n              <Heading id={`${uid}-t`} className=\"hb-vg7-title\">Bring your teammates</Heading>\n              <p className=\"hb-vg7-sub\">Paste a list or type emails. People outside {domain} join as guests.</p>\n              <div className=\"hb-vg7-box\" onClick={() => draftRef.current?.focus()}>\n                {chips.map((c, i) => {\n                  const ok = valid(c.email);\n                  const external = ok && !c.email.endsWith(`@${domain}`);\n                  return (\n                    <span\n                      key={c.email}\n                      className=\"hb-vg7-chip\"\n                      data-bad={!ok}\n                      data-flying={flying && ok}\n                      style={{ \"--c\": colorOf(c.email), \"--d\": i, \"--fx\": `${(seedOf(c.email) % 120) - 60}px` } as React.CSSProperties}\n                    >\n                      <span className=\"hb-vg7-dot\" aria-hidden=\"true\">{ok ? initialsOf(c.email) : \"!\"}</span>\n                      <span className=\"hb-vg7-mail\">{c.email}</span>\n                      {external ? <span className=\"hb-vg7-ext\">External</span> : null}\n                      {ok ? (\n                        <button type=\"button\" className=\"hb-vg7-rbtn\" onClick={() => cycle(i)} aria-label={`Role for ${c.email}: ${c.role}. Change role`}>\n                          {c.role}\n                        </button>\n                      ) : null}\n                      <button type=\"button\" className=\"hb-vg7-x\" onClick={() => setChips((cs) => cs.filter((_, j) => j !== i))} aria-label={`Remove ${c.email}`}>\n                        <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" aria-hidden=\"true\">\n                          <path d=\"M2 2l6 6M8 2L2 8\" />\n                        </svg>\n                      </button>\n                    </span>\n                  );\n                })}\n                <input\n                  ref={draftRef}\n                  value={draft}\n                  onChange={(e) => setDraft(e.target.value)}\n                  onKeyDown={onKey}\n                  onPaste={(e) => {\n                    const text = e.clipboardData.getData(\"text\");\n                    if (/[\\s,;]/.test(text.trim())) {\n                      e.preventDefault();\n                      add(text);\n                    }\n                  }}\n                  onBlur={() => draft.trim() && add(draft)}\n                  placeholder={chips.length ? \"Add more\" : `name@${domain}`}\n                  aria-label=\"Teammate emails\"\n                  aria-describedby={`${uid}-h`}\n                />\n              </div>\n              <div id={`${uid}-h`} className=\"hb-vg7-hint\">\n                Press Enter or comma to add. Click a role to change it.\n                {chips.some((c) => !valid(c.email)) ? \" Fix or remove the red entries.\" : \"\"}\n              </div>\n              <div className=\"hb-vg7-seats\">\n                <div>\n                  <span>Seats on your plan</span>\n                  <span>\n                    <b>{used + good.length}</b> of {seats}\n                    {over ? <span style={{ color: \"#fca5a5\" }}> · {over} over limit</span> : null}\n                  </span>\n                </div>\n                <div className=\"hb-vg7-meter\" style={{ \"--n\": seats } as React.CSSProperties} aria-hidden=\"true\">\n                  {Array.from({ length: seats }, (_, i) => (\n                    <span key={i} style={{ \"--d\": i } as React.CSSProperties} data-s={i < used ? \"used\" : i < used + good.length ? (over ? \"over\" : \"new\") : \"free\"} />\n                  ))}\n                </div>\n              </div>\n              {suggestions.filter((s) => !chips.some((c) => c.email === s)).length ? (\n                <div className=\"hb-vg7-sug\">\n                  <h4>From {domain}</h4>\n                  <ul>\n                    {suggestions\n                      .filter((s) => !chips.some((c) => c.email === s))\n                      .map((s) => (\n                        <li key={s}>\n                          <span className=\"hb-vg7-dot\" style={{ \"--c\": colorOf(s) } as React.CSSProperties} aria-hidden=\"true\">{initialsOf(s)}</span>\n                          <span>{s}</span>\n                          <button type=\"button\" onClick={() => add(s)} aria-label={`Add ${s}`}>Add</button>\n                        </li>\n                      ))}\n                  </ul>\n                </div>\n              ) : null}\n              <div className=\"hb-vg7-actions\">\n                <button type=\"button\" className=\"hb-vg7-skip\" onClick={() => setStep(2)}>Skip for now</button>\n                <button type=\"button\" className=\"hb-vg7-btn\" onClick={send} disabled={!good.length || over > 0 || busy} aria-busy={busy || undefined}>\n                  {busy ? \"Sending\" : good.length ? `Send ${good.length} ${good.length === 1 ? \"invite\" : \"invites\"}` : \"Send invites\"}\n                </button>\n              </div>\n              <div className=\"hb-vg7-err\" role=\"alert\">{error}</div>\n            </div>\n          ) : (\n            <div className=\"hb-vg7-pane hb-vg7-done\" key=\"done\" role=\"status\">\n              <Heading id={`${uid}-t`} className=\"hb-vg7-title\">You&apos;re in, {name.trim().split(/\\s+/)[0] || \"welcome\"}</Heading>\n              <p className=\"hb-vg7-sub\">\n                {joined.length ? `${joined.length} ${joined.length === 1 ? \"invite is\" : \"invites are\"} on the way. We'll let you know when they join ${workspace}.` : `${workspace} is ready. You can invite people any time from Settings.`}\n              </p>\n              <a href=\"#workspace\">Open {workspace}</a>\n            </div>\n          )}\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}