{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "notification-avalanche",
  "title": "Notification Avalanche",
  "description": "Notifications pile onto a lock screen, group into a stack, then clear to All caught up.",
  "dependencies": ["remotion", "@remotion/google-fonts"],
  "registryDependencies": ["@remocn/gsh"],
  "files": [
    {
      "path": "registry/remocn/notification-avalanche/index.tsx",
      "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/HankenGrotesk\";\nimport type React from \"react\";\nimport {\n  AbsoluteFill,\n  Easing,\n  Img,\n  interpolate,\n  spring,\n  staticFile,\n  useCurrentFrame,\n  useVideoConfig,\n} from \"remotion\";\nimport type { GradientParams } from \"@/lib/remocn/gsh/gradient-engine\";\nimport { GshGround } from \"@/lib/remocn/gsh/gsh-ground\";\nimport type { GshPresetId } from \"@/lib/remocn/gsh/presets\";\n\nconst { fontFamily } = loadFont(\"normal\", {\n  weights: [\"300\", \"400\"],\n  subsets: [\"latin\"],\n});\n\nexport type AvalancheGlyph = \"deploy\" | \"mail\" | \"chat\" | \"calendar\" | \"card\";\n\nexport interface AvalancheNotification {\n  app: string;\n  title: string;\n  body: string;\n  color: string;\n  glyph?: AvalancheGlyph;\n}\n\nexport interface NotificationAvalancheProps {\n  notifications?: AvalancheNotification[];\n  clearLabel?: string;\n  clearSubLabel?: string;\n  /** Final value of the runaway counter. */\n  total?: number;\n  /** Caption under the runaway counter beside the phone. */\n  counterLabel?: string;\n  surface?: \"phone\" | \"desktop\";\n  wallpaper?: string;\n  accent?: string;\n  speed?: number;\n  theme?: \"light\" | \"dark\";\n  ground?: GshPresetId;\n  groundParams?: Partial<GradientParams>;\n}\n\nconst DEFAULT_NOTIFICATIONS: AvalancheNotification[] = [\n  {\n    app: \"Deploys\",\n    title: \"Deploy failed on main\",\n    body: \"Build #4821 exited with code 1 after 6m 12s\",\n    color: \"#1C1C1E\",\n    glyph: \"deploy\",\n  },\n  {\n    app: \"Mail\",\n    title: \"Maya Chen\",\n    body: \"Re: launch video. Can we get a cut by Friday?\",\n    color: \"#2F6FE4\",\n    glyph: \"mail\",\n  },\n  {\n    app: \"Chat\",\n    title: \"Leo Park mentioned you\",\n    body: \"Can you review the onboarding copy before 3pm?\",\n    color: \"#3B8F5C\",\n    glyph: \"chat\",\n  },\n  {\n    app: \"Calendar\",\n    title: \"Standup in 5 minutes\",\n    body: \"Product sync · Room 4B · 6 attendees\",\n    color: \"#D9503F\",\n    glyph: \"calendar\",\n  },\n  {\n    app: \"Chat\",\n    title: \"Priya Raman\",\n    body: \"the render is still 40 min out, any ideas?\",\n    color: \"#3B8F5C\",\n    glyph: \"chat\",\n  },\n  {\n    app: \"Billing\",\n    title: \"Invoice #2291 is overdue\",\n    body: \"$4,280 was due yesterday. Pay now to avoid a fee.\",\n    color: \"#C98A2E\",\n    glyph: \"card\",\n  },\n  {\n    app: \"Mail\",\n    title: \"14 new comments\",\n    body: \"on Q4 launch plan v7 FINAL\",\n    color: \"#2F6FE4\",\n    glyph: \"mail\",\n  },\n  {\n    app: \"Deploys\",\n    title: \"Error rate above 5%\",\n    body: \"api-gateway · p95 latency 2.4s\",\n    color: \"#1C1C1E\",\n    glyph: \"deploy\",\n  },\n];\n\nconst SW = 393;\nconst SH = 852;\nconst BEZEL = 11;\nconst CARD_H = 72;\nconst STEP = CARD_H + 8;\nconst SWIPE = 66;\nconst CLEAR = SWIPE + 7;\n\nconst ARRIVE: number[] = (() => {\n  const out: number[] = [];\n  for (let t = 8, i = 0; t < SWIPE - 4; i++) {\n    out.push(Math.round(t));\n    t += Math.max(2.5, 14 * 0.66 ** i);\n  }\n  return out;\n})();\nconst COMPRESS = ARRIVE[3] + 2;\n\nconst clamp = { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" } as const;\nconst ENTER = Easing.bezier(0.32, 0.72, 0, 1);\nconst LIGHT = Easing.bezier(0.22, 1, 0.36, 1);\nconst MOVE = Easing.bezier(0.65, 0, 0.35, 1);\nconst EXIT = Easing.bezier(0.55, 0, 1, 0.45);\nconst HEAVY = { mass: 1, damping: 26, stiffness: 120 };\nconst CARD = { mass: 0.8, damping: 18, stiffness: 160 };\nconst CHIP = { mass: 0.5, damping: 12, stiffness: 200 };\n\nconst ellipsis: React.CSSProperties = {\n  whiteSpace: \"nowrap\",\n  overflow: \"hidden\",\n  textOverflow: \"ellipsis\",\n};\n\ninterface Look {\n  dark: boolean;\n  material: string;\n  blank: string;\n  title: string;\n  body: string;\n  meta: string;\n  edge: string;\n  ink: string;\n  muted: string;\n  frame: string;\n  rim: string;\n}\n\nfunction look(dark: boolean): Look {\n  return dark\n    ? {\n        dark,\n        material: \"rgba(30,30,34,0.86)\",\n        blank: \"rgba(44,44,50,0.78)\",\n        title: \"#F5F5F7\",\n        body: \"rgba(235,235,245,0.78)\",\n        meta: \"rgba(235,235,245,0.5)\",\n        edge: \"inset 0 0 0 0.5px rgba(255,255,255,0.1), inset 0 1px 0 rgba(255,255,255,0.06)\",\n        ink: \"#F4F4F6\",\n        muted: \"rgba(236,238,245,0.56)\",\n        frame: \"#0B0B0D\",\n        rim: \"inset 0 0 0 2px #3A3A3E, inset 0 0 0 3.5px #18181A\",\n      }\n    : {\n        dark,\n        material: \"rgba(248,248,250,0.93)\",\n        blank: \"rgba(238,238,242,0.84)\",\n        title: \"#111114\",\n        body: \"rgba(17,17,20,0.8)\",\n        meta: \"rgba(60,60,67,0.55)\",\n        edge: \"inset 0 0 0 0.5px rgba(255,255,255,0.5), 0 6px 18px -8px rgba(20,20,30,0.28)\",\n        ink: \"#15161A\",\n        muted: \"rgba(21,22,26,0.52)\",\n        frame: \"#E4E4E8\",\n        rim: \"inset 0 0 0 2px #C9C9CE, inset 0 0 0 3.5px #F6F6F8\",\n      };\n}\n\nconst GLYPHS: Record<AvalancheGlyph, string> = {\n  deploy: \"M12 3.5 20 18H4zM12 10v3.5M12 16v.01\",\n  mail: \"M4 6.5h16v11H4zM4.5 7l7.5 6 7.5-6\",\n  chat: \"M5 5.5h14v9.5H10l-4 3.5V15H5z\",\n  calendar: \"M5 6.5h14V19H5zM5 10.5h14M9 4v4M15 4v4\",\n  card: \"M4 7h16v10.5H4zM4 10.5h16M7.5 14.5h3\",\n};\n\nfunction AppIcon({ n, size }: { n: AvalancheNotification; size: number }) {\n  return (\n    <div\n      style={{\n        width: size,\n        height: size,\n        borderRadius: size * 0.24,\n        flexShrink: 0,\n        background: n.color,\n        boxShadow: \"inset 0 0 0 0.5px rgba(255,255,255,0.12)\",\n        display: \"flex\",\n        alignItems: \"center\",\n        justifyContent: \"center\",\n      }}\n    >\n      <svg\n        width={size * 0.56}\n        height={size * 0.56}\n        viewBox=\"0 0 24 24\"\n        fill=\"none\"\n        stroke=\"#fff\"\n        strokeWidth={1.6}\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n      >\n        <path d={GLYPHS[n.glyph ?? \"mail\"]} />\n      </svg>\n    </div>\n  );\n}\n\nfunction Card({\n  n,\n  width,\n  radius,\n  lk,\n}: {\n  n?: AvalancheNotification;\n  width: number;\n  radius: number;\n  lk: Look;\n}) {\n  return (\n    <div\n      style={{\n        width,\n        height: CARD_H,\n        borderRadius: radius,\n        background: n ? lk.material : lk.blank,\n        backdropFilter: \"blur(28px) saturate(1.6)\",\n        boxShadow: lk.edge,\n        display: \"flex\",\n        alignItems: \"center\",\n        gap: 11,\n        padding: \"0 14px\",\n        boxSizing: \"border-box\",\n      }}\n    >\n      {n ? (\n        <>\n          <AppIcon n={n} size={38} />\n          <div style={{ flex: 1, minWidth: 0, lineHeight: 1.32 }}>\n            <div style={{ display: \"flex\", gap: 8, alignItems: \"baseline\" }}>\n              <span\n                style={{\n                  ...ellipsis,\n                  flex: 1,\n                  fontSize: 15.5,\n                  fontWeight: 400,\n                  color: lk.title,\n                  letterSpacing: \"-0.005em\",\n                }}\n              >\n                {n.title}\n              </span>\n              <span style={{ fontSize: 13, color: lk.meta, flexShrink: 0 }}>\n                now\n              </span>\n            </div>\n            <div\n              style={{\n                ...ellipsis,\n                fontSize: 14.5,\n                color: lk.body,\n                fontWeight: 300,\n              }}\n            >\n              {n.body}\n            </div>\n          </div>\n        </>\n      ) : null}\n    </div>\n  );\n}\n\nfunction Stack({\n  f,\n  fps,\n  list,\n  width,\n  radius,\n  maxRows,\n  from,\n  lk,\n}: {\n  f: number;\n  fps: number;\n  list: AvalancheNotification[];\n  width: number;\n  radius: number;\n  maxRows: number;\n  from: \"top\" | \"right\";\n  lk: Look;\n}) {\n  const c = spring({ frame: f - COMPRESS, fps, config: HEAVY });\n  const arrived = ARRIVE.filter((t) => t <= f).length;\n  const enters = ARRIVE.map((t) => spring({ frame: f - t, fps, config: CARD }));\n  const swipeT = (i: number) =>\n    interpolate(f, [SWIPE + i * 0.75, SWIPE + 8 + i * 0.75], [0, 1], {\n      ...clamp,\n      easing: EXIT,\n    });\n  const away = (i: number): React.CSSProperties => {\n    const st = swipeT(i);\n    return {\n      transform: `translateX(${-st * width * 1.15}px) rotate(${-st * 4}deg)`,\n      opacity: interpolate(st, [0.3, 0.85], [1, 0], clamp),\n    };\n  };\n  const card = (\n    key: string | number,\n    y: number,\n    s: number,\n    op: number,\n    n: AvalancheNotification | undefined,\n    i: number,\n    x = 0,\n  ) => (\n    <div\n      key={key}\n      style={{ position: \"absolute\", left: 0, top: 0, ...away(i) }}\n    >\n      <div\n        style={{\n          opacity: op,\n          transform: `translate(${x}px, ${y}px) scale(${s})`,\n          transformOrigin: \"50% 0%\",\n        }}\n      >\n        <Card n={n} width={width} radius={radius} lk={lk} />\n      </div>\n    </div>\n  );\n\n  const cards: React.ReactNode[] = [];\n  const newest = arrived - 1;\n  const inEnter = (e: number) =>\n    from === \"top\"\n      ? { y: -(1 - e) * 24, s: interpolate(e, [0, 1], [0.96, 1]), x: 0 }\n      : { y: 0, s: 1, x: (1 - e) * width * 0.6 };\n\n  if (c < 0.98) {\n    let depth = 0;\n    for (let idx = newest; idx >= 0 && depth <= maxRows; idx--) {\n      if (idx < newest) depth += Math.min(1, enters[idx + 1]);\n      const e = inEnter(enters[idx]);\n      const g = Math.min(depth, 2);\n      const y = interpolate(c, [0, 1], [depth * STEP, g * 9]) + e.y;\n      const s = interpolate(c, [0, 1], [1, 1 - g * 0.05]) * e.s;\n      const fade = interpolate(\n        depth * STEP,\n        [(maxRows - 1) * STEP, maxRows * STEP],\n        [1, 0],\n        clamp,\n      );\n      const op =\n        fade *\n        interpolate(c, [0, 1], [1, depth < 2.5 ? 1 : 0]) *\n        interpolate(enters[idx], [0, 0.2], [0, 1], clamp);\n      const blank = depth > 0.5 && c > 0.35;\n      cards.push(\n        card(\n          idx,\n          y,\n          s,\n          op,\n          blank ? undefined : list[idx % list.length],\n          Math.min(Math.round(depth), 2),\n          e.x,\n        ),\n      );\n    }\n  } else {\n    const e = enters[newest];\n    const bump = Math.sin(Math.min(1, e) * Math.PI) * 3;\n    cards.push(card(\"p2\", 18 + bump, 0.9, 1, undefined, 2));\n    cards.push(card(\"p1\", 9 + bump, 0.95, 1, undefined, 1));\n    if (e < 0.999 && newest > 0)\n      cards.push(\n        card(\n          newest - 1,\n          bump * 0.6,\n          1,\n          1,\n          e > 0.05 ? undefined : list[(newest - 1) % list.length],\n          0,\n        ),\n      );\n    const t = inEnter(e);\n    cards.push(\n      card(\n        newest,\n        t.y,\n        t.s,\n        interpolate(e, [0, 0.15], [0, 1], clamp),\n        list[newest % list.length],\n        0,\n        t.x,\n      ),\n    );\n  }\n\n  return (\n    <div style={{ position: \"relative\", width, height: CARD_H }}>\n      {c < 0.98 ? cards.reverse() : cards}\n    </div>\n  );\n}\n\nfunction ClearMark({ f, fps, size }: { f: number; fps: number; size: number }) {\n  const pop = spring({ frame: f - CLEAR, fps, config: CHIP });\n  const draw = interpolate(f, [CLEAR + 2, CLEAR + 14], [0, 1], {\n    ...clamp,\n    easing: LIGHT,\n  });\n  return (\n    <svg\n      width={size}\n      height={size}\n      viewBox=\"0 0 48 48\"\n      fill=\"none\"\n      stroke=\"#fff\"\n      strokeWidth={1.5}\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n      style={{\n        opacity: interpolate(pop, [0, 0.4], [0, 0.92], clamp),\n        transform: `translateY(${(1 - pop) * 10}px) scale(${interpolate(pop, [0, 1], [0.8, 1])})`,\n      }}\n    >\n      <path\n        d=\"M8 27 13 12h22l5 15v9H8zM8 27h9l2 4h10l2-4h9\"\n        pathLength={1}\n        strokeDasharray={1}\n        strokeDashoffset={1 - draw}\n      />\n      <path\n        d=\"M19 19.5l3.5 3.5 6.5-6.5\"\n        pathLength={1}\n        strokeDasharray={1}\n        strokeDashoffset={1 - interpolate(draw, [0.5, 1], [0, 1], clamp)}\n      />\n    </svg>\n  );\n}\n\nfunction RoundButton({ d }: { d: string }) {\n  return (\n    <div\n      style={{\n        width: 50,\n        height: 50,\n        borderRadius: 25,\n        background: \"rgba(0,0,0,0.3)\",\n        backdropFilter: \"blur(14px)\",\n        display: \"flex\",\n        alignItems: \"center\",\n        justifyContent: \"center\",\n      }}\n    >\n      <svg\n        width=\"22\"\n        height=\"22\"\n        viewBox=\"0 0 24 24\"\n        fill=\"none\"\n        stroke=\"#fff\"\n        strokeWidth={1.5}\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n      >\n        <path d={d} />\n      </svg>\n    </div>\n  );\n}\n\nfunction LockScreen({\n  f,\n  fps,\n  list,\n  wallpaper,\n  lk,\n}: {\n  f: number;\n  fps: number;\n  list: AvalancheNotification[];\n  wallpaper: string;\n  lk: Look;\n}) {\n  return (\n    <div\n      style={{\n        position: \"absolute\",\n        inset: 0,\n        background: \"#101114\",\n        color: \"#fff\",\n      }}\n    >\n      <Img\n        src={wallpaper}\n        style={{\n          position: \"absolute\",\n          inset: 0,\n          width: \"100%\",\n          height: \"100%\",\n          objectFit: \"cover\",\n          objectPosition: \"34% 50%\",\n        }}\n      />\n      <div\n        style={{\n          position: \"absolute\",\n          inset: 0,\n          background: lk.dark\n            ? \"linear-gradient(180deg, rgba(4,6,12,0.55) 0%, rgba(4,6,12,0.18) 34%, rgba(4,6,12,0.28) 70%, rgba(4,6,12,0.6) 100%)\"\n            : \"linear-gradient(180deg, rgba(10,14,24,0.32) 0%, rgba(10,14,24,0.04) 36%, rgba(10,14,24,0.08) 72%, rgba(10,14,24,0.34) 100%)\",\n        }}\n      />\n      <div\n        style={{\n          position: \"absolute\",\n          top: 20,\n          right: 32,\n          display: \"flex\",\n          gap: 6,\n          alignItems: \"center\",\n          height: 22,\n        }}\n      >\n        <svg width=\"18\" height=\"12\" viewBox=\"0 0 18 12\">\n          {[0, 1, 2, 3].map((i) => (\n            <rect\n              key={i}\n              x={i * 4.6}\n              y={9 - i * 3}\n              width={3.2}\n              height={3 + i * 3}\n              rx={0.8}\n              fill=\"#fff\"\n            />\n          ))}\n        </svg>\n        <div\n          style={{\n            width: 25,\n            height: 12,\n            borderRadius: 3.5,\n            boxShadow: \"inset 0 0 0 1px rgba(255,255,255,0.7)\",\n            padding: 1.5,\n            boxSizing: \"border-box\",\n          }}\n        >\n          <div\n            style={{\n              width: \"64%\",\n              height: \"100%\",\n              borderRadius: 2,\n              background: \"#fff\",\n            }}\n          />\n        </div>\n      </div>\n      <svg\n        width=\"14\"\n        height=\"18\"\n        viewBox=\"0 0 14 18\"\n        fill=\"none\"\n        stroke=\"#fff\"\n        strokeWidth={1.5}\n        style={{ position: \"absolute\", top: 62, left: SW / 2 - 7 }}\n      >\n        <rect x=\"1.5\" y=\"8\" width=\"11\" height=\"8.5\" rx=\"2\" />\n        <path d=\"M3.8 8V5.6a3.2 3.2 0 0 1 6.4 0V8\" />\n      </svg>\n      <div\n        style={{\n          position: \"absolute\",\n          top: 90,\n          width: \"100%\",\n          textAlign: \"center\",\n          fontSize: 20,\n          fontWeight: 400,\n          opacity: 0.86,\n        }}\n      >\n        Tuesday 9 January\n      </div>\n      <div\n        style={{\n          position: \"absolute\",\n          top: 104,\n          width: \"100%\",\n          textAlign: \"center\",\n          fontSize: 108,\n          fontWeight: 300,\n          letterSpacing: \"-0.04em\",\n          lineHeight: 1.1,\n          opacity: 0.95,\n          fontVariantNumeric: \"tabular-nums\",\n        }}\n      >\n        9:41\n      </div>\n      <div style={{ position: \"absolute\", top: 268, left: 14 }}>\n        <Stack\n          f={f}\n          fps={fps}\n          list={list}\n          width={SW - 28}\n          radius={22}\n          maxRows={5}\n          from=\"top\"\n          lk={lk}\n        />\n      </div>\n      <div\n        style={{\n          position: \"absolute\",\n          top: 300,\n          left: 0,\n          right: 0,\n          display: \"flex\",\n          justifyContent: \"center\",\n        }}\n      >\n        <ClearMark f={f} fps={fps} size={64} />\n      </div>\n      <div\n        style={{\n          position: \"absolute\",\n          bottom: 46,\n          left: 46,\n          right: 46,\n          display: \"flex\",\n          justifyContent: \"space-between\",\n        }}\n      >\n        <RoundButton d=\"M9 3h6v4l-1.5 2.5V21h-3V9.5L9 7zM12 12.5v2\" />\n        <RoundButton d=\"M4 8h3.2l1.8-2.5h6l1.8 2.5H20v11H4zM12 16.5a3 3 0 1 0 0-6 3 3 0 0 0 0 6z\" />\n      </div>\n      <div\n        style={{\n          position: \"absolute\",\n          bottom: 9,\n          left: SW / 2 - 68,\n          width: 136,\n          height: 5,\n          borderRadius: 3,\n          background: \"#fff\",\n        }}\n      />\n    </div>\n  );\n}\n\nfunction SideCopy({\n  f,\n  total,\n  counterLabel,\n  clearLabel,\n  clearSubLabel,\n  size,\n  lk,\n  align,\n  accent,\n}: {\n  f: number;\n  accent: string;\n  total: number;\n  counterLabel: string;\n  clearLabel: string;\n  clearSubLabel: string;\n  size: number;\n  lk: Look;\n  align: \"left\" | \"center\";\n}) {\n  const arrived = ARRIVE.filter((t) => t <= f).length;\n  const countT = interpolate(f, [COMPRESS + 2, SWIPE - 4], [0, 1], clamp);\n  const count = Math.round(Math.max(arrived, 4 + (total - 4) * countT ** 2.4));\n  const tick = arrived > 0 ? f - ARRIVE[arrived - 1] : 99;\n  const punch = 1 + 0.035 * Math.exp(-Math.max(0, tick) / 2.2);\n  const numIn = interpolate(f, [2, 14], [0, 1], { ...clamp, easing: ENTER });\n  const numOut = interpolate(f, [SWIPE - 2, SWIPE + 6], [0, 1], {\n    ...clamp,\n    easing: EXIT,\n  });\n  const capIn = interpolate(f, [6, 18], [0, 1], { ...clamp, easing: ENTER });\n  const payIn = interpolate(f, [CLEAR, CLEAR + 14], [0, 1], {\n    ...clamp,\n    easing: ENTER,\n  });\n  const subIn = interpolate(f, [CLEAR + 5, CLEAR + 19], [0, 1], {\n    ...clamp,\n    easing: LIGHT,\n  });\n  const rule = interpolate(f, [CLEAR + 8, CLEAR + 24], [0, 1], {\n    ...clamp,\n    easing: MOVE,\n  });\n  const drift = interpolate(f, [CLEAR, CLEAR + 60], [0, 1], {\n    ...clamp,\n    easing: MOVE,\n  });\n  const origin = align === \"left\" ? \"0% 100%\" : \"50% 100%\";\n  return (\n    <div\n      style={{\n        position: \"relative\",\n        width: \"100%\",\n        height: size * 1.5,\n        textAlign: align,\n        color: lk.ink,\n      }}\n    >\n      <div\n        style={{\n          position: \"absolute\",\n          left: 0,\n          right: 0,\n          bottom: size * 0.42,\n          opacity: numIn * (1 - numOut),\n          transform: `translateY(${(1 - numIn) * size * 0.12 - numOut * size * 0.16}px)`,\n          filter: `blur(${(1 - numIn) * 6 + numOut * 6}px)`,\n        }}\n      >\n        <div\n          style={{\n            fontSize: size,\n            fontWeight: 300,\n            letterSpacing: \"-0.045em\",\n            lineHeight: 0.9,\n            fontVariantNumeric: \"tabular-nums\",\n            transform: `scale(${punch})`,\n            transformOrigin: origin,\n          }}\n        >\n          {count}\n        </div>\n      </div>\n      <div\n        style={{\n          position: \"absolute\",\n          left: 0,\n          right: 0,\n          bottom: size * 0.12,\n          fontSize: size * 0.17,\n          fontWeight: 400,\n          color: lk.muted,\n          letterSpacing: \"-0.01em\",\n          opacity: capIn * (1 - numOut),\n          transform: `translateY(${(1 - capIn) * 12}px)`,\n        }}\n      >\n        {counterLabel}\n      </div>\n      <div\n        style={{\n          position: \"absolute\",\n          left: 0,\n          right: 0,\n          bottom: size * 0.42,\n          overflow: \"hidden\",\n          paddingBottom: size * 0.08,\n        }}\n      >\n        <div\n          style={{\n            fontSize: size * 0.5,\n            fontWeight: 300,\n            letterSpacing: \"-0.035em\",\n            lineHeight: 1.04,\n            transform: `translateY(${(1 - payIn) * 110 - drift * 4}%)`,\n            opacity: payIn > 0 ? 1 : 0,\n          }}\n        >\n          {clearLabel}\n        </div>\n      </div>\n      <div\n        style={{\n          position: \"absolute\",\n          bottom: size * 0.36,\n          left: align === \"left\" ? 0 : \"50%\",\n          width: size * 0.9,\n          height: Math.max(2, size * 0.014),\n          borderRadius: 2,\n          background: accent,\n          transformOrigin: align === \"left\" ? \"0% 50%\" : \"50% 50%\",\n          transform: `${align === \"left\" ? \"\" : \"translateX(-50%) \"}scaleX(${rule})`,\n        }}\n      />\n      {clearSubLabel ? (\n        <div\n          style={{\n            position: \"absolute\",\n            left: 0,\n            right: 0,\n            bottom: size * 0.12,\n            fontSize: size * 0.17,\n            fontWeight: 400,\n            color: lk.muted,\n            fontVariantNumeric: \"tabular-nums\",\n            opacity: subIn,\n            transform: `translateY(${(1 - subIn) * 12}px)`,\n          }}\n        >\n          {clearSubLabel}\n        </div>\n      ) : null}\n    </div>\n  );\n}\n\nexport function NotificationAvalanche({\n  notifications = DEFAULT_NOTIFICATIONS,\n  clearLabel = \"All caught up.\",\n  clearSubLabel = \"remocn sorted 128 notifications\",\n  total = 128,\n  counterLabel = \"unread before 10 am\",\n  surface = \"phone\",\n  wallpaper = staticFile(\"reel/reel-1.jpg\"),\n  accent = \"#3B5BFD\",\n  speed = 1,\n  theme = \"dark\",\n  ground,\n  groundParams,\n}: NotificationAvalancheProps) {\n  const frame = useCurrentFrame();\n  const { fps, width, height } = useVideoConfig();\n  const f = frame * speed;\n  const list = notifications.length ? notifications : DEFAULT_NOTIFICATIONS;\n  const dark = theme === \"dark\";\n  const lk = look(dark);\n  const tall = height > width;\n\n  const buzzAmp = interpolate(\n    f,\n    [ARRIVE[4], ARRIVE[8], SWIPE - 8, SWIPE - 2],\n    [0, 1.6, 1.6, 0],\n    clamp,\n  );\n  const buzz = Math.sin(f * 2.9) * buzzAmp;\n\n  const groundLayer = (\n    <>\n      <GshGround\n        preset={ground ?? (dark ? \"earthshine\" : \"glasswork\")}\n        params={groundParams}\n        timeOffset={dark ? 3 : 5}\n        timeScale={0.35}\n      />\n      <AbsoluteFill\n        style={{\n          background: dark ? \"rgba(2,3,8,0.28)\" : \"rgba(244,243,240,0.3)\",\n        }}\n      />\n    </>\n  );\n\n  const copyProps = {\n    f,\n    accent,\n    total,\n    counterLabel,\n    clearLabel,\n    clearSubLabel,\n    lk,\n  };\n\n  if (surface === \"desktop\") {\n    const u = height / 720;\n    const cardW = 356;\n    return (\n      <AbsoluteFill style={{ fontFamily, overflow: \"hidden\" }}>\n        {groundLayer}\n        <div\n          style={{\n            position: \"absolute\",\n            top: 72 * u,\n            right: 72 * u,\n            width: cardW,\n            transform: `scale(${u * 1.15}) translateX(${buzz}px)`,\n            transformOrigin: \"100% 0%\",\n          }}\n        >\n          <Stack\n            f={f}\n            fps={fps}\n            list={list}\n            width={cardW}\n            radius={16}\n            maxRows={6}\n            from=\"right\"\n            lk={lk}\n          />\n        </div>\n        <div\n          style={{\n            position: \"absolute\",\n            left: width * 0.08,\n            bottom: height * 0.1,\n            width: width * 0.5,\n          }}\n        >\n          <SideCopy {...copyProps} size={height * 0.24} align=\"left\" />\n        </div>\n      </AbsoluteFill>\n    );\n  }\n\n  const k = tall\n    ? (height * 0.54) / (SH + BEZEL * 2)\n    : (height * 0.92) / (SH + BEZEL * 2);\n  const phoneCx = tall ? width / 2 : width * 0.69;\n  const phoneCy = tall ? height * 0.6 : height / 2;\n  const enter = spring({ frame: f, fps, config: HEAVY });\n  const push = interpolate(\n    f,\n    [ARRIVE[1], ARRIVE[6], SWIPE + 2, CLEAR + 14],\n    [1, 1.18, 1.18, 1.02],\n    { ...clamp, easing: MOVE },\n  );\n  const focusY = interpolate(push, [1, 1.18], [0, 80 * k]);\n  const copySize = tall ? width * 0.3 : height * 0.25;\n  return (\n    <AbsoluteFill\n      style={{\n        fontFamily,\n        overflow: \"hidden\",\n        WebkitFontSmoothing: \"antialiased\",\n      }}\n    >\n      {groundLayer}\n      <div\n        style={{\n          position: \"absolute\",\n          left: tall ? width * 0.09 : width * 0.075,\n          width: tall ? width * 0.82 : width * 0.42,\n          ...(tall\n            ? { top: height * 0.06 }\n            : { top: height / 2 - copySize * 0.75 }),\n        }}\n      >\n        <SideCopy\n          {...copyProps}\n          size={copySize}\n          align={tall ? \"center\" : \"left\"}\n        />\n      </div>\n      <div\n        style={{\n          position: \"absolute\",\n          left: phoneCx - (SW / 2 + BEZEL),\n          top: phoneCy - (SH / 2 + BEZEL),\n          width: SW + BEZEL * 2,\n          height: SH + BEZEL * 2,\n          borderRadius: 68,\n          background: lk.frame,\n          boxShadow: `${lk.rim}, 0 2px 6px rgba(0,0,0,${dark ? 0.45 : 0.14}), 0 30px 70px -18px rgba(0,0,0,${dark ? 0.7 : 0.32})`,\n          transform: `translateX(${buzz}px) translateY(${(1 - enter) * 60 + focusY}px) scale(${k * push * interpolate(enter, [0, 1], [0.94, 1])})`,\n          opacity: interpolate(enter, [0, 0.35], [0, 1], clamp),\n        }}\n      >\n        <div\n          style={{\n            position: \"absolute\",\n            left: BEZEL,\n            top: BEZEL,\n            width: SW,\n            height: SH,\n            borderRadius: 56,\n            overflow: \"hidden\",\n          }}\n        >\n          <LockScreen\n            f={f}\n            fps={fps}\n            list={list}\n            wallpaper={wallpaper}\n            lk={lk}\n          />\n          <div\n            style={{\n              position: \"absolute\",\n              top: 11,\n              left: (SW - 126) / 2,\n              width: 126,\n              height: 37,\n              borderRadius: 19,\n              background: \"#000\",\n            }}\n          />\n        </div>\n      </div>\n    </AbsoluteFill>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/remocn/notification-avalanche.tsx"
    }
  ],
  "type": "registry:component"
}
