{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "popup-upgrade-limit",
  "type": "registry:component",
  "title": "Upgrade Limit Prompt",
  "description": "Shown when a usage limit is reached: a segmented meter that fills to the red, a queued overflow tag, a billing switch with a sliding thumb and plan cards whose prices roll and whose features check in one by one.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "modals",
    "upgrade",
    "paywall",
    "usage",
    "pricing",
    "plans",
    "billing"
  ],
  "docs": "https://hyperblur.dev/effects/popup-upgrade-limit",
  "files": [
    {
      "path": "registry/hyperblur/popup-upgrade-limit.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/popup-upgrade-limit.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface PopupUpgradePlan {\n  id: string;\n  name: string;\n  monthly: number;\n  yearly: number;\n  allowance: string;\n  features: string[];\n  badge?: string;\n}\n\nexport interface PopupUpgradeUsage {\n  label: string;\n  plan: string;\n  used: number;\n  limit: number;\n  unit: string;\n  queued?: number;\n  resets: string;\n}\n\nexport interface PopupUpgradeLimitProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> {\n  title?: string;\n  usage?: PopupUpgradeUsage;\n  plans?: PopupUpgradePlan[];\n  defaultPlan?: string;\n  defaultBilling?: \"monthly\" | \"yearly\";\n  currency?: string;\n  locale?: string;\n  onUpgrade?: (planId: string, billing: \"monthly\" | \"yearly\") => void;\n  onDismiss?: () => void;\n  open?: boolean;\n  defaultOpen?: boolean;\n  onOpenChange?: (open: boolean) => void;\n  showTrigger?: boolean;\n  triggerLabel?: string;\n  embedded?: boolean;\n  accent?: string;\n}\n\nconst defaultUsage: PopupUpgradeUsage = {\n  label: \"Render minutes\",\n  plan: \"Hobby\",\n  used: 600,\n  limit: 600,\n  unit: \"min\",\n  queued: 3,\n  resets: \"Dec 1\",\n};\n\nconst defaultPlans: PopupUpgradePlan[] = [\n  { id: \"pro\", name: \"Pro\", monthly: 20, yearly: 16, allowance: \"3,000 min\", badge: \"Popular\", features: [\"4K exports without watermark\", \"Priority render queue\", \"Custom brand kits\"] },\n  { id: \"team\", name: \"Team\", monthly: 48, yearly: 38, allowance: \"10,000 min\", features: [\"Everything in Pro, for 5 seats\", \"Shared asset library\", \"Review links with comments\"] },\n];\n\nconst focusable = 'a[href], button:not([disabled]), input:not([disabled]), textarea:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n\nfunction useModal(active: boolean, panelRef: React.RefObject<HTMLElement | null>, onClose: () => void) {\n  const closeRef = React.useRef(onClose);\n  React.useEffect(() => {\n    closeRef.current = onClose;\n  });\n  React.useEffect(() => {\n    if (!active) return;\n    const panel = panelRef.current;\n    if (!panel) return;\n    const opener = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n    const html = document.documentElement;\n    const prevOverflow = html.style.overflow;\n    html.style.overflow = \"hidden\";\n    (panel.querySelector<HTMLElement>(\"[data-autofocus]\") ?? panel).focus({ preventScroll: true });\n    const onKey = (e: KeyboardEvent) => {\n      if (e.key === \"Escape\") {\n        e.preventDefault();\n        closeRef.current();\n        return;\n      }\n      if (e.key !== \"Tab\") return;\n      const nodes = Array.from(panel.querySelectorAll<HTMLElement>(focusable)).filter((n) => n.getClientRects().length > 0);\n      if (!nodes.length) {\n        e.preventDefault();\n        return;\n      }\n      const first = nodes[0];\n      const last = nodes[nodes.length - 1];\n      const cur = document.activeElement;\n      if (e.shiftKey && (cur === first || cur === panel || !panel.contains(cur))) {\n        e.preventDefault();\n        last.focus();\n      } else if (!e.shiftKey && (cur === last || !panel.contains(cur))) {\n        e.preventDefault();\n        first.focus();\n      }\n    };\n    document.addEventListener(\"keydown\", onKey);\n    return () => {\n      document.removeEventListener(\"keydown\", onKey);\n      html.style.overflow = prevOverflow;\n      opener?.focus({ preventScroll: true });\n    };\n  }, [active, panelRef]);\n}\n\nfunction usePresence(open: boolean, ms: number) {\n  const [mounted, setMounted] = React.useState(open);\n  if (open && !mounted) setMounted(true);\n  React.useEffect(() => {\n    if (open || !mounted) return;\n    const t = window.setTimeout(() => setMounted(false), ms);\n    return () => window.clearTimeout(t);\n  }, [open, mounted, ms]);\n  return mounted;\n}\n\nconst css = `\n.hb-xf7 { --hb-xf7-accent: #8b7bff; box-sizing: border-box; font-family: inherit; color: #ededed; }\n.hb-xf7 *, .hb-xf7 *::before, .hb-xf7 *::after { box-sizing: border-box; }\n.hb-xf7-embedded { position: relative; width: 100%; height: 100%; display: grid; place-items: center; }\n.hb-xf7-trigger { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #fff; background: linear-gradient(180deg, color-mix(in srgb, var(--hb-xf7-accent) 80%, #fff), var(--hb-xf7-accent)); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 8px 20px -10px var(--hb-xf7-accent); cursor: pointer; transition: transform .15s cubic-bezier(.3,.7,.4,1); }\n.hb-xf7-trigger:active { transform: scale(.97); }\n.hb-xf7-trigger:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }\n.hb-xf7-trigger svg { width: 14px; height: 14px; }\n.hb-xf7-overlay { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; min-height: 100dvh; }\n.hb-xf7-embedded .hb-xf7-overlay { position: relative; inset: auto; min-height: 0; padding: 0; width: 100%; }\n.hb-xf7-scrim { position: absolute; inset: 0; background: rgba(4,4,6,.76); backdrop-filter: blur(6px); animation: hb-xf7-fade .3s ease both; }\n.hb-xf7-embedded .hb-xf7-scrim { display: none; }\n.hb-xf7-overlay[data-state=\"closed\"] .hb-xf7-scrim { animation: hb-xf7-fade .2s ease reverse both; }\n.hb-xf7-panel { position: relative; width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow: auto; border-radius: 22px; background: #101010; border: 1px solid #2a2a2a; box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 40px 80px -30px rgba(0,0,0,.9); outline: none; animation: hb-xf7-in .5s cubic-bezier(.16,1,.3,1) both; }\n.hb-xf7-overlay[data-state=\"closed\"] .hb-xf7-panel { animation: hb-xf7-out .2s cubic-bezier(.4,0,1,1) both; }\n.hb-xf7-top { padding: 20px 20px 16px; background: radial-gradient(100% 120% at 0% 0%, color-mix(in srgb, #ff5d5d 12%, transparent), transparent 55%); border-bottom: 1px solid #1f1f1f; }\n.hb-xf7-close { all: unset; position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #8f8f8f; cursor: pointer; transition: background .2s, color .2s; }\n.hb-xf7-close:hover { background: #1f1f1f; color: #ededed; }\n.hb-xf7-close:focus-visible { outline: 2px solid var(--hb-xf7-accent); }\n.hb-xf7-close svg { width: 14px; height: 14px; }\n.hb-xf7-head { display: flex; gap: 12px; align-items: flex-start; padding-right: 28px; }\n.hb-xf7-warn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; flex: none; color: #ff8a7a; background: rgba(255,93,93,.12); border: 1px solid rgba(255,93,93,.25); }\n.hb-xf7-warn svg { width: 17px; height: 17px; }\n.hb-xf7-title { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }\n.hb-xf7-sub { margin: 3px 0 0; font-size: 12.5px; line-height: 1.45; color: #a1a1a1; }\n.hb-xf7-meter { margin-top: 14px; display: grid; gap: 7px; }\n.hb-xf7-mtext { display: flex; justify-content: space-between; align-items: baseline; font-size: 11.5px; color: #8f8f8f; font-variant-numeric: tabular-nums; }\n.hb-xf7-mtext b { font-size: 12.5px; color: #ededed; font-weight: 600; }\n.hb-xf7-ticks { display: flex; gap: 3px; align-items: center; height: 14px; }\n.hb-xf7-tick { flex: 1; height: 100%; border-radius: 3px; background: #1f1f1f; animation: hb-xf7-tick .35s cubic-bezier(.3,.7,.4,1) both; }\n.hb-xf7-tick[data-on=\"true\"] { background: linear-gradient(#f5f5f5, #bdbdbd); }\n.hb-xf7-tick[data-hot=\"true\"] { background: linear-gradient(#ff8a7a, #e5483a); animation: hb-xf7-tick .35s cubic-bezier(.3,.7,.4,1) both, hb-xf7-hot 1.4s ease-in-out 1.2s infinite; }\n.hb-xf7-over { flex: none; height: 100%; padding: 0 6px; margin-left: 3px; border-radius: 3px; display: grid; place-items: center; font-size: 9.5px; font-weight: 600; color: #ffb3a8; background: repeating-linear-gradient(-45deg, rgba(255,93,93,.25) 0 3px, rgba(255,93,93,.08) 3px 6px); border: 1px dashed rgba(255,93,93,.45); white-space: nowrap; }\n.hb-xf7-mid { padding: 16px 20px 6px; display: grid; gap: 12px; }\n.hb-xf7-bill { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 11px; background: #161616; border: 1px solid #242424; }\n.hb-xf7-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 8px; background: linear-gradient(#262626, #1e1e1e); box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 2px 6px rgba(0,0,0,.5); transition: transform .4s cubic-bezier(.3,1.3,.5,1); }\n.hb-xf7-bill[data-v=\"yearly\"] .hb-xf7-thumb { transform: translateX(100%); }\n.hb-xf7-billbtn { all: unset; box-sizing: border-box; position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 6px; height: 30px; font-size: 12.5px; font-weight: 500; color: #8f8f8f; cursor: pointer; border-radius: 8px; transition: color .2s; }\n.hb-xf7-billbtn[aria-checked=\"true\"] { color: #ededed; }\n.hb-xf7-billbtn:focus-visible { outline: 2px solid var(--hb-xf7-accent); outline-offset: -2px; }\n.hb-xf7-save { font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 999px; color: #3ddc84; background: rgba(61,220,132,.12); }\n.hb-xf7-plans { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }\n.hb-xf7-plan { all: unset; box-sizing: border-box; position: relative; display: grid; gap: 2px; padding: 12px; border-radius: 14px; background: #141414; border: 1px solid #262626; cursor: pointer; transition: border-color .25s, background .25s, box-shadow .25s, transform .15s cubic-bezier(.3,.7,.4,1); }\n.hb-xf7-plan:hover { border-color: #353535; }\n.hb-xf7-plan:active { transform: scale(.985); }\n.hb-xf7-plan:focus-visible { outline: 2px solid var(--hb-xf7-accent); outline-offset: 2px; }\n.hb-xf7-plan[aria-checked=\"true\"] { border-color: color-mix(in srgb, var(--hb-xf7-accent) 70%, #262626); background: linear-gradient(180deg, color-mix(in srgb, var(--hb-xf7-accent) 12%, #141414), #141414); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hb-xf7-accent) 16%, transparent), 0 14px 30px -18px var(--hb-xf7-accent); }\n.hb-xf7-pname { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }\n.hb-xf7-badge { font-size: 9.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 2px 6px; border-radius: 999px; color: var(--hb-xf7-accent); background: color-mix(in srgb, var(--hb-xf7-accent) 14%, transparent); }\n.hb-xf7-radio { position: absolute; top: 12px; right: 12px; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid #3a3a3a; display: grid; place-items: center; transition: all .25s; }\n.hb-xf7-plan[aria-checked=\"true\"] .hb-xf7-radio { border-color: var(--hb-xf7-accent); background: var(--hb-xf7-accent); }\n.hb-xf7-radio svg { width: 9px; height: 9px; color: #fff; transform: scale(0); transition: transform .3s cubic-bezier(.3,1.6,.5,1); }\n.hb-xf7-plan[aria-checked=\"true\"] .hb-xf7-radio svg { transform: scale(1); }\n.hb-xf7-price { display: flex; align-items: baseline; gap: 3px; margin-top: 6px; height: 28px; overflow: hidden; }\n.hb-xf7-amount { display: inline-block; font-family: var(--font-grotesk), var(--font-sans), sans-serif; font-size: 24px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; animation: hb-xf7-roll .45s cubic-bezier(.2,.9,.3,1.2) both; }\n.hb-xf7-per { font-size: 11.5px; color: #8f8f8f; }\n.hb-xf7-allow { font-size: 11.5px; color: #a1a1a1; }\n.hb-xf7-feats { list-style: none; margin: 0; padding: 2px 2px 0; display: grid; gap: 7px; }\n.hb-xf7-feat { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: #d4d4d4; animation: hb-xf7-feat .4s cubic-bezier(.2,.8,.2,1) both; }\n.hb-xf7-check { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; flex: none; color: var(--hb-xf7-accent); background: color-mix(in srgb, var(--hb-xf7-accent) 15%, transparent); animation-delay: inherit; }\n.hb-xf7-check svg { width: 10px; height: 10px; stroke-dasharray: 14; stroke-dashoffset: 14; animation: hb-xf7-draw .35s ease forwards; animation-delay: inherit; }\n.hb-xf7-foot { display: flex; gap: 8px; padding: 16px 20px 20px; }\n.hb-xf7-ghost { all: unset; box-sizing: border-box; display: grid; place-items: center; height: 40px; padding: 0 14px; border-radius: 11px; font-size: 13px; font-weight: 500; color: #a1a1a1; cursor: pointer; transition: color .2s, background .2s; white-space: nowrap; }\n.hb-xf7-ghost:hover { color: #ededed; background: #181818; }\n.hb-xf7-ghost:focus-visible { outline: 2px solid var(--hb-xf7-accent); outline-offset: 2px; }\n.hb-xf7-go { all: unset; box-sizing: border-box; flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 11px; font-size: 13.5px; font-weight: 600; color: #fff; background: linear-gradient(180deg, color-mix(in srgb, var(--hb-xf7-accent) 80%, #fff), var(--hb-xf7-accent)); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), inset 0 -1px 0 rgba(0,0,0,.2), 0 12px 26px -12px var(--hb-xf7-accent); cursor: pointer; white-space: nowrap; transition: transform .15s cubic-bezier(.3,.7,.4,1), filter .2s; }\n.hb-xf7-go:hover { filter: brightness(1.08); }\n.hb-xf7-go:active { transform: scale(.98); }\n.hb-xf7-go:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }\n.hb-xf7-go svg { width: 14px; height: 14px; }\n@keyframes hb-xf7-fade { from { opacity: 0; } }\n@keyframes hb-xf7-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }\n@keyframes hb-xf7-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }\n@keyframes hb-xf7-tick { from { opacity: 0; transform: scaleY(.3); } }\n@keyframes hb-xf7-hot { 50% { opacity: .55; } }\n@keyframes hb-xf7-roll { from { opacity: 0; transform: translateY(70%); } }\n@keyframes hb-xf7-feat { from { opacity: 0; transform: translateX(-6px); } }\n@keyframes hb-xf7-draw { to { stroke-dashoffset: 0; } }\n@media (max-width: 420px) {\n  .hb-xf7-plans { grid-template-columns: 1fr; }\n  .hb-xf7-foot { flex-direction: column-reverse; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-xf7 *, .hb-xf7 *::before { animation: none !important; transition: none !important; }\n  .hb-xf7-check svg { stroke-dashoffset: 0; }\n}\n`;\n\nexport function PopupUpgradeLimit({\n  title = \"You have used every render minute\",\n  usage = defaultUsage,\n  plans = defaultPlans,\n  defaultPlan,\n  defaultBilling = \"yearly\",\n  currency = \"USD\",\n  locale = \"en-US\",\n  onUpgrade,\n  onDismiss,\n  open,\n  defaultOpen,\n  onOpenChange,\n  showTrigger = true,\n  triggerLabel = \"Export video\",\n  embedded = false,\n  accent = \"#8b7bff\",\n  className = \"\",\n  style,\n  ...rest\n}: PopupUpgradeLimitProps) {\n  const uid = React.useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n  const [inner, setInner] = React.useState(defaultOpen ?? embedded);\n  const isOpen = open ?? inner;\n  const mounted = usePresence(isOpen, 220);\n  const panelRef = React.useRef<HTMLDivElement>(null);\n  const triggerRef = React.useRef<HTMLButtonElement>(null);\n  const touched = React.useRef(false);\n  const [billing, setBilling] = React.useState<\"monthly\" | \"yearly\">(defaultBilling);\n  const [planId, setPlanId] = React.useState(defaultPlan ?? plans[0]?.id ?? \"\");\n  const plan = plans.find((p) => p.id === planId) ?? plans[0];\n\n  const money = React.useMemo(() => new Intl.NumberFormat(locale, { style: \"currency\", currency, maximumFractionDigits: 0 }), [locale, currency]);\n\n  const setOpen = React.useCallback(\n    (value: boolean) => {\n      touched.current = true;\n      if (open === undefined) setInner(value);\n      onOpenChange?.(value);\n    },\n    [open, onOpenChange],\n  );\n  const close = React.useCallback(() => setOpen(false), [setOpen]);\n  useModal(isOpen && !embedded, panelRef, close);\n\n  React.useEffect(() => {\n    if (!embedded || !touched.current) return;\n    if (isOpen) panelRef.current?.focus({ preventScroll: true });\n    else triggerRef.current?.focus({ preventScroll: true });\n  }, [embedded, isOpen]);\n\n  const ticks = 24;\n  const ratio = Math.min(1, usage.used / Math.max(1, usage.limit));\n  const lit = Math.round(ratio * ticks);\n  const savePct = plans.length ? Math.round((1 - plans[0].yearly / plans[0].monthly) * 100) : 0;\n\n  const onPlanKey = (e: React.KeyboardEvent, index: number) => {\n    if (![\"ArrowRight\", \"ArrowDown\", \"ArrowLeft\", \"ArrowUp\"].includes(e.key)) return;\n    e.preventDefault();\n    const dir = e.key === \"ArrowRight\" || e.key === \"ArrowDown\" ? 1 : -1;\n    const next = plans[(index + dir + plans.length) % plans.length];\n    setPlanId(next.id);\n    const nodes = e.currentTarget.parentElement?.querySelectorAll<HTMLElement>(\".hb-xf7-plan\");\n    nodes?.[(index + dir + plans.length) % plans.length]?.focus();\n  };\n\n  const onBillKey = (e: React.KeyboardEvent) => {\n    if (![\"ArrowRight\", \"ArrowLeft\"].includes(e.key)) return;\n    e.preventDefault();\n    const next = billing === \"monthly\" ? \"yearly\" : \"monthly\";\n    setBilling(next);\n    e.currentTarget.querySelector<HTMLElement>(`[data-b=\"${next}\"]`)?.focus();\n  };\n\n  const price = plan ? (billing === \"yearly\" ? plan.yearly : plan.monthly) : 0;\n\n  return (\n    <div\n      className={`hb-xf7 ${embedded ? \"hb-xf7-embedded\" : \"\"} ${className}`}\n      style={{ \"--hb-xf7-accent\": accent, ...style } as React.CSSProperties}\n      onKeyDown={(e) => {\n        if (embedded && e.key === \"Escape\" && isOpen) {\n          e.stopPropagation();\n          close();\n        }\n      }}\n      {...rest}\n    >\n      <style href=\"hb-popup-upgrade-limit\" precedence=\"default\">{css}</style>\n      {showTrigger && (!embedded || !mounted) && (\n        <button ref={triggerRef} type=\"button\" className=\"hb-xf7-trigger\" aria-haspopup=\"dialog\" onClick={() => setOpen(true)}>\n          <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\"><path d=\"M12 4v11M7 10l5 5 5-5M5 20h14\" /></svg>\n          {triggerLabel}\n        </button>\n      )}\n      {mounted && (\n        <div className=\"hb-xf7-overlay\" data-state={isOpen ? \"open\" : \"closed\"}>\n          <div className=\"hb-xf7-scrim\" onClick={close} aria-hidden=\"true\" />\n          <div ref={panelRef} className=\"hb-xf7-panel\" role=\"dialog\" aria-modal={embedded ? undefined : true} aria-labelledby={`${uid}-t`} aria-describedby={`${uid}-d`} tabIndex={-1}>\n            <button type=\"button\" className=\"hb-xf7-close\" aria-label=\"Close\" onClick={close}>\n              <svg viewBox=\"0 0 14 14\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" aria-hidden=\"true\"><path d=\"m3 3 8 8M11 3l-8 8\" /></svg>\n            </button>\n            <div className=\"hb-xf7-top\">\n              <div className=\"hb-xf7-head\">\n                <span className=\"hb-xf7-warn\" aria-hidden=\"true\">\n                  <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.9\" strokeLinecap=\"round\" strokeLinejoin=\"round\"><path d=\"M12 3 2.5 20h19Z\" /><path d=\"M12 10v4.5M12 17.5v.01\" /></svg>\n                </span>\n                <div>\n                  <h2 className=\"hb-xf7-title\" id={`${uid}-t`}>{title}</h2>\n                  <p className=\"hb-xf7-sub\" id={`${uid}-d`}>Exports are paused until {usage.resets}. Upgrade now and the queue starts right away.</p>\n                </div>\n              </div>\n              <div className=\"hb-xf7-meter\">\n                <div className=\"hb-xf7-mtext\">\n                  <span>{usage.label} · {usage.plan}</span>\n                  <span><b>{usage.used.toLocaleString(\"en-US\")}</b> / {usage.limit.toLocaleString(\"en-US\")} {usage.unit}</span>\n                </div>\n                <div className=\"hb-xf7-ticks\" role=\"meter\" aria-label={usage.label} aria-valuemin={0} aria-valuemax={usage.limit} aria-valuenow={usage.used}>\n                  {Array.from({ length: ticks }, (_, i) => (\n                    <span\n                      key={i}\n                      className=\"hb-xf7-tick\"\n                      data-on={i < lit}\n                      data-hot={i < lit && i >= ticks - 3 && ratio >= 0.9}\n                      style={{ animationDelay: `${(0.15 + i * 0.035).toFixed(3)}s` }}\n                    />\n                  ))}\n                  {usage.queued ? <span className=\"hb-xf7-over\">+{usage.queued} queued</span> : null}\n                </div>\n              </div>\n            </div>\n            <div className=\"hb-xf7-mid\">\n              <div className=\"hb-xf7-bill\" role=\"radiogroup\" aria-label=\"Billing period\" data-v={billing} onKeyDown={onBillKey}>\n                <span className=\"hb-xf7-thumb\" aria-hidden=\"true\" />\n                {([\"monthly\", \"yearly\"] as const).map((b) => (\n                  <button key={b} type=\"button\" role=\"radio\" data-b={b} aria-checked={billing === b} tabIndex={billing === b ? 0 : -1} className=\"hb-xf7-billbtn\" onClick={() => setBilling(b)}>\n                    {b === \"monthly\" ? \"Monthly\" : \"Yearly\"}\n                    {b === \"yearly\" && savePct > 0 && <span className=\"hb-xf7-save\">-{savePct}%</span>}\n                  </button>\n                ))}\n              </div>\n              <div className=\"hb-xf7-plans\" role=\"radiogroup\" aria-label=\"Plan\">\n                {plans.map((p, i) => {\n                  const amount = billing === \"yearly\" ? p.yearly : p.monthly;\n                  return (\n                    <button\n                      key={p.id}\n                      type=\"button\"\n                      role=\"radio\"\n                      aria-checked={p.id === plan?.id}\n                      tabIndex={p.id === plan?.id ? 0 : -1}\n                      className=\"hb-xf7-plan\"\n                      onClick={() => setPlanId(p.id)}\n                      onKeyDown={(e) => onPlanKey(e, i)}\n                    >\n                      <span className=\"hb-xf7-radio\" aria-hidden=\"true\">\n                        <svg viewBox=\"0 0 10 10\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\"><path d=\"m2 5.2 2 2 4-4.4\" /></svg>\n                      </span>\n                      <span className=\"hb-xf7-pname\">{p.name}{p.badge && <span className=\"hb-xf7-badge\">{p.badge}</span>}</span>\n                      <span className=\"hb-xf7-price\">\n                        <span className=\"hb-xf7-amount\" key={`${p.id}-${billing}`}>{money.format(amount)}</span>\n                        <span className=\"hb-xf7-per\">/mo</span>\n                      </span>\n                      <span className=\"hb-xf7-allow\">{p.allowance} every month</span>\n                    </button>\n                  );\n                })}\n              </div>\n              {plan && (\n                <ul className=\"hb-xf7-feats\" key={plan.id} aria-label={`${plan.name} includes`}>\n                  {plan.features.map((f, i) => (\n                    <li key={f} className=\"hb-xf7-feat\" style={{ animationDelay: `${(0.08 + i * 0.08).toFixed(2)}s` }}>\n                      <span className=\"hb-xf7-check\" aria-hidden=\"true\">\n                        <svg viewBox=\"0 0 10 10\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.9\" strokeLinecap=\"round\" strokeLinejoin=\"round\"><path d=\"m2 5.2 2 2 4-4.4\" /></svg>\n                      </span>\n                      {f}\n                    </li>\n                  ))}\n                </ul>\n              )}\n            </div>\n            <div className=\"hb-xf7-foot\">\n              <button\n                type=\"button\"\n                className=\"hb-xf7-ghost\"\n                onClick={() => {\n                  onDismiss?.();\n                  close();\n                }}\n              >\n                Remind me tomorrow\n              </button>\n              <button\n                type=\"button\"\n                className=\"hb-xf7-go\"\n                data-autofocus\n                onClick={() => {\n                  if (plan) onUpgrade?.(plan.id, billing);\n                  close();\n                }}\n              >\n                Upgrade to {plan?.name} · {money.format(price)}/mo\n              </button>\n            </div>\n          </div>\n        </div>\n      )}\n    </div>\n  );\n}\n"
    }
  ]
}