{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "auth-flow-reset-password",
  "type": "registry:component",
  "title": "Auth Flow Reset Password",
  "description": "A reset screen that measures strength in bits of entropy on a calibrated track and shows the password's makeup as colored tiles without revealing a character. It warns about reused or common passwords, points to the exact character where the confirmation differs, counts down the reset link and ends by listing the sessions it signed out.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "auth",
    "auth",
    "reset password",
    "strength meter",
    "entropy",
    "security",
    "form"
  ],
  "docs": "https://hyperblur.dev/effects/auth-flow-reset-password",
  "files": [
    {
      "path": "registry/hyperblur/auth-flow-reset-password.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/auth-flow-reset-password.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface AuthFlowResetPasswordProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\" | \"onSubmit\"> {\n  title?: string;\n  email?: string;\n  expiresIn?: number;\n  minBits?: number;\n  previous?: string[];\n  sessions?: string[];\n  defaultPassword?: string;\n  onSubmit?: (password: string) => void | Promise<unknown>;\n  continueHref?: string;\n  headingAs?: \"h1\" | \"h2\" | \"h3\";\n  accent?: string;\n}\n\nconst css = `\n@keyframes hb-vg2-tile {\n  0% { transform: scaleY(.2); opacity: 0; }\n  70% { transform: scaleY(1.15); opacity: 1; }\n  100% { transform: scaleY(1); opacity: 1; }\n}\n@keyframes hb-vg2-in {\n  from { opacity: 0; transform: translate3d(0, 10px, 0); }\n  to { opacity: 1; transform: translate3d(0, 0, 0); }\n}\n@keyframes hb-vg2-out {\n  to { opacity: .35; text-decoration-color: currentColor; }\n}\n@keyframes hb-vg2-spin { to { transform: rotate(360deg); } }\n@keyframes hb-vg2-draw { to { stroke-dashoffset: 0; } }\n.hb-vg2 {\n  --hb-vg2-accent: #a3e635;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  padding: 80px 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-vg2 *, .hb-vg2 *::before, .hb-vg2 *::after { box-sizing: border-box; }\n.hb-vg2::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  z-index: -1;\n  background: radial-gradient(ellipse 40% 50% at 82% 20%, color-mix(in srgb, var(--hb-vg2-accent) 10%, transparent), transparent 70%), radial-gradient(ellipse 30% 40% at 10% 90%, rgba(255,255,255,.035), transparent 70%);\n}\n.hb-vg2-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 56px; align-items: start; max-width: 940px; margin: 0 auto; }\n.hb-vg2-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 8px; border: 1px solid #262626; border-radius: 999px; background: #111; color: #a1a1a1; font: 500 12px/1 var(--font-mono), ui-monospace, monospace; font-variant-numeric: tabular-nums; }\n.hb-vg2-eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--hb-vg2-accent); box-shadow: 0 0 10px var(--hb-vg2-accent); font-style: normal; }\n.hb-vg2-eyebrow[data-late=\"true\"] i { background: #fb923c; box-shadow: 0 0 10px #fb923c; }\n.hb-vg2-title { margin: 22px 0 0; font-size: 40px; font-weight: 650; letter-spacing: -.035em; line-height: 1.05; }\n.hb-vg2-lead { margin: 14px 0 0; color: #a1a1a1; font-size: 15px; line-height: 1.65; }\n.hb-vg2-lead strong { color: #ededed; font-weight: 550; }\n.hb-vg2-legend { display: grid; gap: 10px; margin: 30px 0 0; padding: 0; list-style: none; }\n.hb-vg2-legend li { display: flex; align-items: center; gap: 12px; color: #8f8f8f; font-size: 13.5px; transition: color .25s ease; }\n.hb-vg2-legend li[data-on=\"true\"] { color: #ededed; }\n.hb-vg2-sw { width: 22px; height: 10px; border-radius: 3px; background: #1d1d1d; transition: background .3s ease, box-shadow .3s ease; }\n.hb-vg2-legend li[data-on=\"true\"] .hb-vg2-sw { background: var(--sw); box-shadow: 0 0 12px color-mix(in srgb, var(--sw) 50%, transparent); }\n.hb-vg2-card { position: relative; padding: 30px; 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 rgba(0,0,0,.95); }\n.hb-vg2-label { display: flex; justify-content: space-between; align-items: baseline; color: #cfcfcf; font-size: 13px; font-weight: 550; }\n.hb-vg2-label span { color: #8f8f8f; font-weight: 450; font-size: 12px; }\n.hb-vg2-box { position: relative; margin-top: 8px; }\n.hb-vg2-input {\n  width: 100%;\n  height: 50px;\n  padding: 0 52px 0 16px;\n  border: 1px solid #262626;\n  border-radius: 13px;\n  background: #0a0a0a;\n  color: #ededed;\n  font: inherit;\n  font-size: 15px;\n  letter-spacing: .02em;\n  outline: none;\n  transition: border-color .2s ease, box-shadow .2s ease;\n}\n.hb-vg2-input::placeholder { color: #5c5c5c; letter-spacing: 0; }\n.hb-vg2-input:focus { border-color: color-mix(in srgb, var(--hb-vg2-accent) 55%, #262626); box-shadow: 0 0 0 4px color-mix(in srgb, var(--hb-vg2-accent) 12%, transparent); }\n.hb-vg2-input[aria-invalid=\"true\"] { border-color: #7f1d1d; }\n.hb-vg2-eye { position: absolute; top: 7px; right: 7px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 9px; background: none; color: #8f8f8f; cursor: pointer; transition: background .2s ease, color .2s ease; }\n.hb-vg2-eye:hover { background: #1a1a1a; color: #ededed; }\n.hb-vg2-eye:focus-visible { outline: 2px solid var(--hb-vg2-accent); outline-offset: 0; }\n.hb-vg2-strip { display: flex; gap: 3px; height: 18px; margin-top: 12px; padding: 4px; border: 1px solid #1c1c1c; border-radius: 8px; background: #0b0b0b; overflow: hidden; }\n.hb-vg2-strip:empty::after { content: \"Your password's makeup appears here, never the characters\"; align-self: center; color: #4f4f4f; font-size: 10.5px; white-space: nowrap; }\n.hb-vg2-tile { flex: 0 0 auto; width: 8px; border-radius: 2px; background: var(--sw); transform-origin: bottom; animation: hb-vg2-tile .32s cubic-bezier(.3, 1.4, .5, 1) both; }\n.hb-vg2-tile[data-weak=\"true\"] { opacity: .35; }\n.hb-vg2-meter { position: relative; margin-top: 18px; }\n.hb-vg2-track { position: relative; height: 8px; border-radius: 99px; background: #1a1a1a; overflow: hidden; }\n.hb-vg2-fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: linear-gradient(90deg, #f87171, #fb923c 30%, #facc15 55%, var(--hb-vg2-accent) 85%); background-size: var(--hb-vg2-full) 100%; transition: width .5s cubic-bezier(.2, .9, .25, 1); }\n.hb-vg2-ticks { position: relative; height: 26px; margin-top: 6px; color: #5c5c5c; font: 500 10.5px/1 var(--font-mono), ui-monospace, monospace; }\n.hb-vg2-ticks span { position: absolute; top: 0; transform: translateX(-50%); padding-top: 8px; white-space: nowrap; transition: color .3s ease; }\n.hb-vg2-ticks span::before { content: \"\"; position: absolute; top: 0; left: 50%; width: 1px; height: 5px; background: currentColor; }\n.hb-vg2-ticks span[data-on=\"true\"] { color: #cfcfcf; }\n.hb-vg2-readout { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 2px; }\n.hb-vg2-bits { font: 600 22px/1 var(--font-mono), ui-monospace, monospace; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }\n.hb-vg2-bits small { margin-left: 4px; color: #8f8f8f; font-size: 11px; font-weight: 500; letter-spacing: 0; }\n.hb-vg2-verdict { color: #a1a1a1; font-size: 13px; text-align: right; }\n.hb-vg2-verdict b { color: #ededed; font-weight: 600; }\n.hb-vg2-warn { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border: 1px solid #3b2a12; border-radius: 10px; background: #1a130a; color: #fdba74; font-size: 12.5px; line-height: 1.5; animation: hb-vg2-in .3s cubic-bezier(.2, .8, .2, 1) both; }\n.hb-vg2-sep { height: 1px; margin: 22px 0; background: #1f1f1f; }\n.hb-vg2-match { display: flex; align-items: center; gap: 8px; min-height: 20px; margin-top: 10px; color: #8f8f8f; font-size: 12.5px; }\n.hb-vg2-match[data-tone=\"ok\"] { color: var(--hb-vg2-accent); }\n.hb-vg2-match[data-tone=\"bad\"] { color: #fca5a5; }\n.hb-vg2-btn {\n  position: relative;\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  gap: 10px;\n  width: 100%;\n  height: 50px;\n  margin-top: 20px;\n  border: 0;\n  border-radius: 13px;\n  background: linear-gradient(180deg, #fafafa, #d9d9d9);\n  color: #0a0a0a;\n  font: inherit;\n  font-size: 15px;\n  font-weight: 600;\n  cursor: pointer;\n  box-shadow: inset 0 1px 0 #fff, 0 10px 24px -12px rgba(255,255,255,.4);\n  transition: transform .15s ease, opacity .2s ease, filter .2s ease;\n}\n.hb-vg2-btn:hover:not(:disabled) { filter: brightness(1.05); }\n.hb-vg2-btn:active:not(:disabled) { transform: scale(.985); }\n.hb-vg2-btn:disabled { opacity: .35; cursor: not-allowed; }\n.hb-vg2-btn:focus-visible { outline: 2px solid var(--hb-vg2-accent); outline-offset: 3px; }\n.hb-vg2-spin { width: 16px; height: 16px; border: 2px solid rgba(0,0,0,.2); border-top-color: #0a0a0a; border-radius: 50%; animation: hb-vg2-spin .7s linear infinite; }\n.hb-vg2-err { margin-top: 12px; color: #fca5a5; font-size: 13px; }\n.hb-vg2-done { animation: hb-vg2-in .45s cubic-bezier(.2, .8, .2, 1) both; }\n.hb-vg2-ok { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: color-mix(in srgb, var(--hb-vg2-accent) 14%, #111); color: var(--hb-vg2-accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hb-vg2-accent) 35%, transparent); }\n.hb-vg2-ok path { stroke-dasharray: 26; stroke-dashoffset: 26; animation: hb-vg2-draw .55s .15s cubic-bezier(.65, 0, .35, 1) forwards; }\n.hb-vg2-done h3 { margin: 18px 0 0; font-size: 22px; font-weight: 650; letter-spacing: -.02em; }\n.hb-vg2-done p { margin: 8px 0 0; color: #a1a1a1; font-size: 14px; line-height: 1.6; }\n.hb-vg2-sessions { display: grid; gap: 6px; margin: 18px 0 0; padding: 0; list-style: none; }\n.hb-vg2-sessions li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid #1f1f1f; border-radius: 10px; background: #0c0c0c; color: #cfcfcf; font-size: 13px; animation: hb-vg2-in .4s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--d) * 120ms + 250ms); }\n.hb-vg2-sessions li span:last-child { color: #8f8f8f; font: 500 11px/1 var(--font-mono), ui-monospace, monospace; }\n.hb-vg2-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; color: var(--hb-vg2-accent); font-size: 14px; font-weight: 600; text-decoration: none; border-radius: 6px; }\n.hb-vg2-link:hover { text-decoration: underline; text-underline-offset: 4px; }\n.hb-vg2-link:focus-visible { outline: 2px solid var(--hb-vg2-accent); outline-offset: 3px; }\n@container (max-width: 760px) {\n  .hb-vg2-wrap { grid-template-columns: minmax(0, 1fr); gap: 28px; }\n  .hb-vg2-legend { display: none; }\n  .hb-vg2-title { font-size: 30px; }\n  .hb-vg2-card { padding: 22px; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-vg2 *, .hb-vg2 *::before, .hb-vg2 *::after { animation: none !important; transition: none !important; }\n  .hb-vg2-ok path { stroke-dashoffset: 0; }\n}\n`;\n\nconst classes = [\n  { id: \"lower\", label: \"Lowercase letters\", color: \"#60a5fa\", size: 26, test: (c: string) => /[a-z]/.test(c) },\n  { id: \"upper\", label: \"Uppercase letters\", color: \"#c084fc\", size: 26, test: (c: string) => /[A-Z]/.test(c) },\n  { id: \"digit\", label: \"Numbers\", color: \"#facc15\", size: 10, test: (c: string) => /[0-9]/.test(c) },\n  { id: \"symbol\", label: \"Symbols and spaces\", color: \"#f472b6\", size: 33, test: () => true },\n];\n\nconst common = [\"password\", \"123456\", \"qwerty\", \"letmein\", \"welcome\", \"admin\", \"iloveyou\", \"monkey\", \"dragon\", \"abc123\"];\n\nfunction kindOf(c: string) {\n  return classes.find((k) => k.test(c)) ?? classes[3];\n}\n\nfunction analyse(pw: string, previous: string[]) {\n  const kinds = new Set<string>();\n  let pool = 0;\n  for (const c of pw) kinds.add(kindOf(c).id);\n  for (const k of classes) if (kinds.has(k.id)) pool += k.size;\n  const weak: boolean[] = [];\n  let effective = 0;\n  for (let i = 0; i < pw.length; i++) {\n    const a = pw.charCodeAt(i);\n    const repeat = i > 0 && pw[i] === pw[i - 1];\n    const seq = i > 0 && Math.abs(a - pw.charCodeAt(i - 1)) === 1;\n    weak.push(repeat || seq);\n    effective += repeat || seq ? 0.25 : 1;\n  }\n  let bits = pw.length ? effective * Math.log2(Math.max(pool, 1)) : 0;\n  const lower = pw.toLowerCase();\n  const isCommon = common.some((w) => lower.includes(w));\n  if (isCommon) bits *= 0.35;\n  const reused = previous.some((p) => p === pw);\n  if (reused) bits = Math.min(bits, 12);\n  return { bits: Math.round(bits), kinds, weak, isCommon, reused };\n}\n\nfunction crackTime(bits: number) {\n  const seconds = Math.pow(2, bits) / 1e10;\n  if (seconds < 1) return \"instantly\";\n  const units: [number, string][] = [[31536000 * 1e6, \"million years\"], [31536000 * 1e3, \"thousand years\"], [31536000, \"years\"], [86400, \"days\"], [3600, \"hours\"], [60, \"minutes\"], [1, \"seconds\"]];\n  for (const [n, label] of units) if (seconds >= n) return `${Math.min(999, Math.floor(seconds / n))} ${label}`;\n  return \"instantly\";\n}\n\nfunction wait(result: void | Promise<unknown>) {\n  return result instanceof Promise ? result : new Promise((resolve) => window.setTimeout(resolve, 1000));\n}\n\nexport function AuthFlowResetPassword({\n  title = \"Choose a new password\",\n  email = \"maya.chen@northwind.io\",\n  expiresIn = 892,\n  minBits = 60,\n  previous = [\"Northwind2024!\"],\n  sessions = [\"MacBook Pro · Safari · Lisbon\", \"iPhone 15 · App · Lisbon\", \"Windows · Chrome · Berlin\"],\n  defaultPassword = \"\",\n  onSubmit,\n  continueHref = \"#signin\",\n  headingAs = \"h2\",\n  accent = \"#a3e635\",\n  className = \"\",\n  style,\n  ...rest\n}: AuthFlowResetPasswordProps) {\n  const Heading = headingAs;\n  const uid = React.useId();\n  const [pw, setPw] = React.useState(defaultPassword);\n  const [confirm, setConfirm] = React.useState(defaultPassword);\n  const [show, setShow] = React.useState(false);\n  const [left, setLeft] = React.useState(expiresIn);\n  const [busy, setBusy] = React.useState(false);\n  const [error, setError] = React.useState(\"\");\n  const [done, setDone] = React.useState(false);\n\n  React.useEffect(() => {\n    if (left <= 0 || done) return;\n    const id = window.setTimeout(() => setLeft((s) => s - 1), 1000);\n    return () => window.clearTimeout(id);\n  }, [left, done]);\n\n  const a = analyse(pw, previous);\n  const full = Math.max(minBits * 1.6, 96);\n  const pct = Math.min(100, (a.bits / full) * 100);\n  const ticks = [\n    { at: 28, label: \"Weak\" },\n    { at: 45, label: \"Fair\" },\n    { at: minBits, label: \"Strong\" },\n    { at: Math.round(minBits * 1.35), label: \"Excellent\" },\n  ];\n  const level = [...ticks].reverse().find((t) => a.bits >= t.at)?.label ?? \"Too short\";\n  const matches = confirm.length > 0 && confirm === pw;\n  const mismatch = confirm.length > 0 && !pw.startsWith(confirm);\n  const expired = left <= 0;\n  const ready = a.bits >= minBits && matches && !a.reused && !expired;\n  const mm = String(Math.floor(Math.max(left, 0) / 60)).padStart(2, \"0\");\n  const ss = String(Math.max(left, 0) % 60).padStart(2, \"0\");\n\n  const submit = (e: React.FormEvent) => {\n    e.preventDefault();\n    if (!ready || busy) return;\n    setBusy(true);\n    setError(\"\");\n    wait(onSubmit?.(pw)).then(\n      () => {\n        setBusy(false);\n        setDone(true);\n      },\n      (err: unknown) => {\n        setBusy(false);\n        setError(err instanceof Error ? err.message : \"We couldn't update your password. Try again.\");\n      },\n    );\n  };\n\n  const vars = { \"--hb-vg2-accent\": accent, \"--hb-vg2-full\": `${(10000 / Math.max(pct, 1)).toFixed(1)}%`, ...style } as React.CSSProperties;\n\n  return (\n    <section className={`hb-vg2 ${className}`} style={vars} aria-labelledby={`${uid}-t`} {...rest}>\n      <style href=\"hb-auth-flow-reset-password\" precedence=\"default\">{css}</style>\n      <div className=\"hb-vg2-wrap\">\n        <div>\n          <span className=\"hb-vg2-eyebrow\" data-late={left < 120}>\n            <i aria-hidden=\"true\" />\n            {expired ? \"Reset link expired\" : `Link valid for ${mm}:${ss}`}\n          </span>\n          <Heading id={`${uid}-t`} className=\"hb-vg2-title\">{title}</Heading>\n          <p className=\"hb-vg2-lead\">\n            Resetting the password for <strong>{email}</strong>. Every other session is signed out once you save.\n          </p>\n          <ul className=\"hb-vg2-legend\" aria-label=\"Character types used\">\n            {classes.map((k) => (\n              <li key={k.id} data-on={a.kinds.has(k.id)} style={{ \"--sw\": k.color } as React.CSSProperties}>\n                <span className=\"hb-vg2-sw\" aria-hidden=\"true\" />\n                {k.label}\n              </li>\n            ))}\n          </ul>\n        </div>\n        <div className=\"hb-vg2-card\">\n          {done ? (\n            <div className=\"hb-vg2-done\" role=\"status\">\n              <span className=\"hb-vg2-ok\" aria-hidden=\"true\">\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n                  <path d=\"M5 12.5l4.5 4.5L19 7.5\" />\n                </svg>\n              </span>\n              <h3>Password updated</h3>\n              <p>We signed out {sessions.length} other {sessions.length === 1 ? \"session\" : \"sessions\"} to keep your account safe.</p>\n              <ul className=\"hb-vg2-sessions\">\n                {sessions.map((s, i) => (\n                  <li key={s} style={{ \"--d\": i } as React.CSSProperties}>\n                    <span>{s}</span>\n                    <span>signed out</span>\n                  </li>\n                ))}\n              </ul>\n              <a className=\"hb-vg2-link\" href={continueHref}>\n                Continue to sign in\n                <svg width=\"14\" height=\"14\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n                  <path d=\"M3 8h10M9 4l4 4-4 4\" />\n                </svg>\n              </a>\n            </div>\n          ) : (\n            <form onSubmit={submit} noValidate>\n              <label className=\"hb-vg2-label\" htmlFor={`${uid}-p`}>\n                New password\n                <span>{pw.length} characters</span>\n              </label>\n              <div className=\"hb-vg2-box\">\n                <input\n                  id={`${uid}-p`}\n                  className=\"hb-vg2-input\"\n                  type={show ? \"text\" : \"password\"}\n                  value={pw}\n                  onChange={(e) => setPw(e.target.value)}\n                  autoComplete=\"new-password\"\n                  placeholder=\"At least 12 characters\"\n                  aria-describedby={`${uid}-s`}\n                  aria-invalid={a.reused || undefined}\n                  disabled={expired}\n                />\n                <button type=\"button\" className=\"hb-vg2-eye\" onClick={() => setShow((v) => !v)} aria-label={show ? \"Hide password\" : \"Show password\"} aria-pressed={show}>\n                  <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n                    <path d=\"M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z\" />\n                    <circle cx=\"12\" cy=\"12\" r=\"3\" />\n                    {show ? null : <path d=\"M4 20L20 4\" />}\n                  </svg>\n                </button>\n              </div>\n              <div className=\"hb-vg2-strip\" aria-hidden=\"true\">\n                {Array.from(pw).slice(0, 32).map((c, i) => (\n                  <span key={i} className=\"hb-vg2-tile\" data-weak={a.weak[i]} style={{ \"--sw\": kindOf(c).color } as React.CSSProperties} />\n                ))}\n              </div>\n              <div className=\"hb-vg2-meter\" id={`${uid}-s`}>\n                <div className=\"hb-vg2-track\" role=\"meter\" aria-label=\"Password strength\" aria-valuemin={0} aria-valuemax={Math.round(full)} aria-valuenow={a.bits} aria-valuetext={`${level}, ${a.bits} bits`}>\n                  <span className=\"hb-vg2-fill\" style={{ width: `${pct.toFixed(1)}%` }} />\n                </div>\n                <div className=\"hb-vg2-ticks\" aria-hidden=\"true\">\n                  {ticks.map((t) => (\n                    <span key={t.label} data-on={a.bits >= t.at} style={{ left: `${Math.min(94, (t.at / full) * 100).toFixed(1)}%` }}>\n                      {t.label}\n                    </span>\n                  ))}\n                </div>\n                <div className=\"hb-vg2-readout\">\n                  <span className=\"hb-vg2-bits\">\n                    {a.bits}\n                    <small>bits</small>\n                  </span>\n                  <span className=\"hb-vg2-verdict\">\n                    <b>{pw ? level : \"Start typing\"}</b>\n                    {pw ? ` · cracked ${crackTime(a.bits) === \"instantly\" ? \"instantly\" : `in ~${crackTime(a.bits)}`}` : \"\"}\n                  </span>\n                </div>\n              </div>\n              {a.reused ? (\n                <div className=\"hb-vg2-warn\" role=\"alert\">You used this password before. Pick one you haven&apos;t used on this account.</div>\n              ) : a.isCommon ? (\n                <div className=\"hb-vg2-warn\" role=\"alert\">Contains a very common word. Attackers try these first.</div>\n              ) : null}\n              <div className=\"hb-vg2-sep\" />\n              <label className=\"hb-vg2-label\" htmlFor={`${uid}-c`}>\n                Confirm password\n              </label>\n              <div className=\"hb-vg2-box\">\n                <input\n                  id={`${uid}-c`}\n                  className=\"hb-vg2-input\"\n                  type={show ? \"text\" : \"password\"}\n                  value={confirm}\n                  onChange={(e) => setConfirm(e.target.value)}\n                  autoComplete=\"new-password\"\n                  placeholder=\"Type it once more\"\n                  aria-invalid={mismatch || undefined}\n                  aria-describedby={`${uid}-m`}\n                  disabled={expired}\n                />\n              </div>\n              <div id={`${uid}-m`} className=\"hb-vg2-match\" data-tone={matches ? \"ok\" : mismatch ? \"bad\" : \"idle\"} aria-live=\"polite\">\n                {matches ? \"Passwords match\" : mismatch ? `Differs at character ${Array.from(confirm).findIndex((c, i) => c !== pw[i]) + 1}` : confirm ? `${confirm.length} of ${pw.length} characters` : \"\"}\n              </div>\n              <button type=\"submit\" className=\"hb-vg2-btn\" disabled={!ready || busy} aria-busy={busy || undefined}>\n                {busy ? <span className=\"hb-vg2-spin\" aria-hidden=\"true\" /> : null}\n                {busy ? \"Saving\" : expired ? \"Request a new link\" : \"Save and sign out everywhere\"}\n              </button>\n              {error ? <div className=\"hb-vg2-err\" role=\"alert\">{error}</div> : null}\n            </form>\n          )}\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}