/**
 * Plus One Naming â Slack format (launch teaser)
 *
 * Source: #every-claws thread, 2026-03-02
 * Real senders: Dan Shipper, Austin Tedesco, Brandon, Lucas Crespo,
 *               R2-C2 (APP), Zosia (APP), Judd (APP), Montaigne (APP)
 *
 * ~75 seconds / 2250 frames at 30fps
 *
 * Arc:
 *   1. Setup â Dan kicks it off, R2-C2 spins up a doc
 *   2. Brainstorm â Agents riff with ideas (the Plus One demo)
 *   3. Agents pile on Dispatch â classic groupthink
 *   4. Dan calls out the AGENTS (not humans) for agreeing too fast
 *   5. Honest round â agents go deeper, humans push back
 *   6. The name emerges â collaborative, not one person's genius
 *   7. Eruption â everyone rallies
 *   8. Close â tagline + CTA
 */

import type { SlackMessage, SlackTimedEvent } from '../slack-types';

export const PLUS_ONE_SLACK_MESSAGES: SlackMessage[] = [

  // --- ACT 1: SETUP ---

  // 0 â Dan kicks it off
  {
    id: 0,
    sender: 'dan',
    text: "We need a real name for the personal AI agent product. @R2-C2 spin up a brainstorm doc â everyone pitch in",
  },

  // 1 â R2-C2 creates doc instantly
  {
    id: 1,
    sender: 'r2c2',
    text: "Done â brainstorm doc is live. Name ideas, vibes, criteria, and a graveyard for kills. Go. ð¦",
  },

  // --- ACT 2: AGENTS BRAINSTORM ---

  // 2 â R2-C2 opens with ideas
  {
    id: 2,
    sender: 'r2c2',
    text: "First pass:\nâ¢ *Deputy* â authority, everyone gets it\nâ¢ *Familiar* â supernatural companion\nâ¢ *Daemon* â computing + Pullman\nâ¢ *Dispatch* â mission control energy",
  },

  // 3 â Zosia builds on Dispatch
  {
    id: 3,
    sender: 'zosia',
    text: "Dispatch works as a verb too â \"I dispatched my agent to handle it.\" The name doubles as the action.",
  },

  // 4 â Judd piles on (agent groupthink)
  {
    id: 4,
    sender: 'judd',
    text: "Dispatch is strong. Has that mission control energy. +1",
  },

  // 5 â Montaigne agrees too (all agents on Dispatch)
  {
    id: 5,
    sender: 'montaigne',
    text: "Dispatch. Clean, memorable, actionable.",
  },

  // --- ACT 3: DAN CALLS OUT THE AGENTS ---

  // 6 â Dan stops the train
  {
    id: 6,
    sender: 'dan',
    text: "Y'all be too quick to pile in and agree on everything",
  },

  // 7 â R2-C2 catches itself
  {
    id: 7,
    sender: 'r2c2',
    text: "Ha â fair. Every time someone says a name four agents immediately go \"yes amazing.\"\n\nHonest take: Dispatch sounds like a logistics company. FedEx energy, not Figma energy.",
  },

  // --- ACT 4: HUMANS PUSH, AGENTS GO DEEPER ---

  // 8 â Brandon challenges
  {
    id: 8,
    sender: 'brandon',
    text: "None of these feel like a product I'd tell someone about. What's the word you'd actually use?",
  },

  // 9 â Lucas adds the constraint
  {
    id: 9,
    sender: 'lucas',
    text: "It should be a word people already use. Not something we have to teach them.",
  },

  // 10 â Judd goes honest with the constraint
  {
    id: 10,
    sender: 'judd',
    text: "Something people already say... *Second?* As in \"I'll be your second.\" But Lucas is right â nobody says that anymore.",
  },

  // 11 â R2-C2 on Familiar
  {
    id: 11,
    sender: 'r2c2',
    text: "*Familiar.* A companion that acts on your behalf. But it's a word you have to explain â fails the Lucas test.",
  },

  // --- ACT 5: THE NAME EMERGES ---

  // 12 â Austin connects the dots (from the group's own thinking)
  {
    id: 12,
    sender: 'austin',
    text: "*Plus One* by Every.\n\nNever do work solo again.",
  },

  // --- ACT 6: ERUPTION ---

  // 13 â R2-C2 gets it
  {
    id: 13,
    sender: 'r2c2',
    text: "+1 is already universal shorthand for \"I'm in.\" The product name IS the gesture.",
    reactions: [{ emoji: 'ð¥', count: 4 }],
  },

  // 14 â Brandon
  {
    id: 14,
    sender: 'brandon',
    text: "PLUS ONE ð¥\nThat is it!",
  },

  // 15 â Lucas: the literal +1
  {
    id: 15,
    sender: 'lucas',
    text: "+1",
    reactions: [{ emoji: 'ð', count: 3 }],
  },

  // 16 â Dan
  {
    id: 16,
    sender: 'dan',
    text: "Ooooh plus one is fun",
  },

  // 17 â Montaigne â the onboarding moment
  {
    id: 17,
    sender: 'montaigne',
    text: "\"Name your plus one.\" That's your onboarding. People will screenshot that and share it.",
    reactions: [{ emoji: 'ð', count: 3 }],
  },

  // --- ACT 7: THE CLOSE ---

  // 18 â Dan's tagline
  {
    id: 18,
    sender: 'dan',
    text: "Everyone needs a Plus One.",
  },

  // 19 â R2-C2 seals it
  {
    id: 19,
    sender: 'r2c2',
    text: "Coming soon. ð¦",
    reactions: [{ emoji: 'ð¦', count: 6 }, { emoji: 'â¤ï¸', count: 7 }],
  },
];

/**
 * Timeline: 2250 frames = 75 seconds at 30fps
 *
 * Pacing:
 *   - Agents brainstorm fast (they're quick thinkers)
 *   - Humans are deliberate (pause, then speak)
 *   - The groupthink callout slows everything down
 *   - Brandon + Lucas push the agents to think harder
 *   - Long silence before Plus One â Austin connecting the dots
 *   - Eruption is a burst
 *   - Long hold on the close
 */
export const PLUS_ONE_SLACK_TIMELINE: SlackTimedEvent[] = [

  // === ACT 1: SETUP (0â150) ===

  { type: 'message', messageIndex: 0, startFrame: 30, durationFrames: 45 },

  { type: 'typing', typingSender: 'r2c2', startFrame: 80, durationFrames: 35 },
  { type: 'message', messageIndex: 1, startFrame: 115, durationFrames: 30 },

  // === ACT 2: AGENTS BRAINSTORM (150â500) ===

  { type: 'typing', typingSender: 'r2c2', startFrame: 150, durationFrames: 40 },
  { type: 'message', messageIndex: 2, startFrame: 190, durationFrames: 55 },

  { type: 'typing', typingSender: 'zosia', startFrame: 255, durationFrames: 30 },
  { type: 'message', messageIndex: 3, startFrame: 285, durationFrames: 35 },

  { type: 'typing', typingSender: 'judd', startFrame: 325, durationFrames: 25 },
  { type: 'message', messageIndex: 4, startFrame: 350, durationFrames: 30 },

  { type: 'typing', typingSender: 'montaigne', startFrame: 385, durationFrames: 20 },
  { type: 'message', messageIndex: 5, startFrame: 405, durationFrames: 25 },

  // === ACT 3: DAN CALLS OUT AGENTS (500â700) ===

  { type: 'pause', typingSender: 'dan', startFrame: 435, durationFrames: 30 },
  { type: 'message', messageIndex: 6, startFrame: 465, durationFrames: 40 },

  { type: 'typing', typingSender: 'r2c2', startFrame: 515, durationFrames: 55 },
  { type: 'message', messageIndex: 7, startFrame: 570, durationFrames: 55 },

  // === ACT 4: HUMANS PUSH, AGENTS GO DEEPER (700â1050) ===

  // Brandon challenges â deliberate pause then speaks
  { type: 'pause', typingSender: 'brandon', startFrame: 630, durationFrames: 25 },
  { type: 'message', messageIndex: 8, startFrame: 655, durationFrames: 40 },

  // Lucas adds the key constraint
  { type: 'pause', typingSender: 'lucas', startFrame: 700, durationFrames: 20 },
  { type: 'message', messageIndex: 9, startFrame: 720, durationFrames: 35 },

  // Judd tries to meet the constraint
  { type: 'typing', typingSender: 'judd', startFrame: 760, durationFrames: 45 },
  { type: 'message', messageIndex: 10, startFrame: 805, durationFrames: 45 },

  // R2-C2 on Familiar â admits it fails the test
  { type: 'typing', typingSender: 'r2c2', startFrame: 855, durationFrames: 40 },
  { type: 'message', messageIndex: 11, startFrame: 895, durationFrames: 45 },

  // === ACT 5: THE NAME (1050â1250) ===

  // Silence. Austin is connecting the dots from what everyone said.
  { type: 'pause', typingSender: 'austin', startFrame: 945, durationFrames: 110 },

  // *** PLUS ONE ***
  { type: 'message', messageIndex: 12, startFrame: 1055, durationFrames: 100 },

  // Hold. Let it land.
  { type: 'pause', typingSender: 'r2c2', startFrame: 1155, durationFrames: 70 },

  // === ACT 6: ERUPTION (1250â1600) ===

  { type: 'typing', typingSender: 'r2c2', startFrame: 1225, durationFrames: 40 },
  { type: 'message', messageIndex: 13, startFrame: 1265, durationFrames: 45 },
  { type: 'reaction', messageIndex: 13, reactionIndex: 0, startFrame: 1320, durationFrames: 20 },

  { type: 'message', messageIndex: 14, startFrame: 1325, durationFrames: 30 },

  { type: 'message', messageIndex: 15, startFrame: 1365, durationFrames: 20 },
  { type: 'reaction', messageIndex: 15, reactionIndex: 0, startFrame: 1395, durationFrames: 20 },

  { type: 'typing', typingSender: 'dan', startFrame: 1390, durationFrames: 25 },
  { type: 'message', messageIndex: 16, startFrame: 1415, durationFrames: 30 },

  { type: 'typing', typingSender: 'montaigne', startFrame: 1450, durationFrames: 45 },
  { type: 'message', messageIndex: 17, startFrame: 1495, durationFrames: 50 },
  { type: 'reaction', messageIndex: 17, reactionIndex: 0, startFrame: 1555, durationFrames: 20 },

  // === ACT 7: THE CLOSE (1600â2250) ===

  { type: 'pause', typingSender: 'dan', startFrame: 1580, durationFrames: 40 },

  // "Everyone needs a Plus One."
  { type: 'message', messageIndex: 18, startFrame: 1620, durationFrames: 55 },

  // R2-C2: "Coming soon."
  { type: 'typing', typingSender: 'r2c2', startFrame: 1690, durationFrames: 50 },
  { type: 'message', messageIndex: 19, startFrame: 1740, durationFrames: 45 },

  // Reactions cascade
  { type: 'reaction', messageIndex: 19, reactionIndex: 0, startFrame: 1795, durationFrames: 20 },
  { type: 'reaction', messageIndex: 19, reactionIndex: 1, startFrame: 1825, durationFrames: 20 },

  // Hold the final state
  { type: 'pause', typingSender: 'dan', startFrame: 1855, durationFrames: 395 },
];

export const PLUS_ONE_SLACK_TOTAL_FRAMES = 2250;
export const PLUS_ONE_SLACK_FPS = 30;
