/* ============================================================
   Brite Bird Coach — mock data
   ============================================================ */

const LEADS = [
  {
    id: 'sarah',
    names: ['Sarah Mitchell', 'Tom Mitchell'],
    primary: 'Sarah Mitchell',
    address: '4427 E Brown Rd, Mesa AZ',
    city: 'Mesa, AZ',
    phone: '(480) 555-0184',
    email: 'sarah.mitchell@gmail.com',
    quote: 5400,
    package: 'Holiday',
    footage: 142,
    decisionMakers: [
      { name: 'Sarah', enthusiasm: 'positive' },
      { name: 'Tom', enthusiasm: 'skeptical' },
    ],
    objections: ['Want to think about it', 'Tom thinks they can DIY for less'],
    buyingReason: '"Wanted it for the kids before Halloween — three years running."',
    promises: [
      { text: 'Send financing app link', due: 'Today', status: 'pending' },
      { text: 'Confirm install Oct 12', due: 'Mon', status: 'pending' },
    ],
    competitors: [{ name: 'Christmas Decor by …', amount: 4900 }],
    decideBy: 'Today',
    installBy: 'Oct 12',
    timeline: '2 weeks',
    channel: 'text',
    days: 3,
    score: 78,
    state: 'waiting',
    siro: { duration: '47:22', clip: '0:18 — Sarah on the kids' },
    thread: [
      { from: 'rep',  body: "Hey Sarah — great meeting you and Tom yesterday. Recap and quote attached.", t: '2d' },
      { from: 'them', body: "Thanks Tom! We're going to talk it over tonight.", t: '2d' },
      { from: 'rep',  body: "Totally — take your time. I'll send the financing breakdown if helpful.", t: '2d' },
      { from: 'them', body: "Yeah send that please. Tom's worried about the upfront.", t: '1d' },
    ],
    draft: {
      kind: 'promise',
      reason: 'You promised the financing link by EOD',
      body: "Sarah — here's the 0% financing breakdown like I mentioned. $150/mo, no credit hit to check. Want me to lock in the Oct 12 install while you decide?",
      attaches: ['Financing.pdf', 'Install calendar'],
    },
  },
  {
    id: 'mike',
    names: ['Mike Reyes'],
    primary: 'Mike Reyes',
    address: '8821 Oakcrest Dr, Frisco TX',
    city: 'Frisco, TX',
    phone: '(469) 555-0273',
    email: 'mreyes@hey.com',
    quote: 7200,
    package: 'Holiday + Bistro',
    footage: 198,
    decisionMakers: [{ name: 'Mike', enthusiasm: 'positive' }],
    objections: ['Wants to spread payments'],
    buyingReason: '"Throwing the holiday party this year — wants the whole street to talk."',
    promises: [{ text: 'Send financing options', due: 'Today', status: 'pending' }],
    competitors: [],
    decideBy: 'Fri',
    installBy: 'Nov 8',
    timeline: '3 weeks',
    channel: 'text',
    days: 1,
    score: 92,
    state: 'waiting',
    siro: { duration: '38:14', clip: '0:42 — Mike on the holiday party' },
    thread: [
      { from: 'rep',  body: "Mike — great chatting last night. Quote attached, including the bistro lights for the back patio.", t: '1d' },
      { from: 'them', body: "Send me the financing thing", t: '12m' },
    ],
    draft: {
      kind: 'hot-reply',
      reason: 'Mike replied 12 min ago',
      body: "On it — here's the 0% / 24-mo plan. Comes out to $300/mo. Soft credit pull only. Want me to hold the Nov 8 install?",
      attaches: ['Financing.pdf'],
    },
  },
  {
    id: 'tom',
    names: ['Tom Carter'],
    primary: 'Tom Carter',
    address: '512 N Greenfield Rd, Gilbert AZ',
    city: 'Gilbert, AZ',
    phone: '(480) 555-0911',
    email: 'tcarter@outlook.com',
    quote: 4800,
    package: 'Holiday',
    footage: 128,
    decisionMakers: [{ name: 'Tom', enthusiasm: 'neutral' }],
    objections: ['Price', 'Said wife wants to see other quotes'],
    buyingReason: '"Daughter\'s wedding photos at the house in December."',
    promises: [],
    competitors: [{ name: 'a guy from church', amount: 3600 }],
    decideBy: '—',
    installBy: 'Dec 1',
    timeline: 'unsure',
    channel: 'text',
    days: 9,
    score: 31,
    state: 'cold',
    siro: { duration: '52:08', clip: '0:31 — Tom on the wedding photos' },
    thread: [
      { from: 'rep',  body: "Tom — recap and quote.", t: '9d' },
      { from: 'rep',  body: "Hey Tom, any thoughts? Happy to walk through the wedding-package option.", t: '6d' },
      { from: 'rep',  body: "Tom — we still have Dec 1 open if you want to lock it.", t: '3d' },
    ],
    draft: {
      kind: 'breakup',
      reason: '9 days quiet — agent suggests a clean close',
      body: "Hey Tom — I'll close out the file unless I hear from you. No pressure either way; the door's open if December's still on the table for the wedding.",
      attaches: [],
    },
  },
  {
    id: 'diaz',
    names: ['Jen Diaz', 'Carlos Diaz'],
    primary: 'Jen & Carlos Diaz',
    address: '227 W Saragosa St, Chandler AZ',
    city: 'Chandler, AZ',
    phone: '(480) 555-0427',
    email: 'jen.diaz@gmail.com',
    quote: 6100,
    package: 'Holiday + Landscape',
    footage: 168,
    decisionMakers: [
      { name: 'Jen', enthusiasm: 'positive' },
      { name: 'Carlos', enthusiasm: 'positive' },
    ],
    objections: [],
    buyingReason: '"Halloween party tradition — wants the house to be the one on the block."',
    promises: [{ text: 'Send Halloween color preview', due: 'Today', status: 'pending' }],
    competitors: [],
    decideBy: 'Wed',
    installBy: 'Oct 25',
    timeline: '2 weeks',
    channel: 'text',
    days: 1,
    score: 88,
    state: 'proposal_out',
    siro: { duration: '41:55', clip: '0:08 — both decision makers in agreement' },
    thread: [
      { from: 'rep',  body: "Jen + Carlos — recap from last night plus the landscape add-on.", t: '1d' },
    ],
    draft: {
      kind: 'due-today',
      reason: 'Promised Halloween color preview today',
      body: "Jen + Carlos — here's the orange/purple Halloween scene preview I mentioned. Locks for Oct 25 install if you say go.",
      attaches: ['Halloween-preview.mp4'],
    },
  },
];

/* Today list — order = priority. Each item points at a lead + uses its draft. */
const TODAY_ITEMS = [
  { id: 't1', leadId: 'mike',  kind: 'hot-reply',  ago: '12 min ago' },
  { id: 't2', leadId: 'sarah', kind: 'promise',    ago: 'overdue' },
  { id: 't3', leadId: 'diaz',  kind: 'due-today',  ago: 'due today' },
  { id: 't4', leadId: 'tom',   kind: 'breakup',    ago: 'day 9' },
];

const KIND_META = {
  'hot-reply':  { label: 'Hot reply',     color: 'var(--bb-orange)',   icon: 'flame' },
  'promise':    { label: 'Promise due',   color: 'var(--bb-pink)',     icon: 'alarm-clock' },
  'due-today':  { label: 'Due today',     color: 'var(--bb-yellow)',   icon: 'calendar-clock' },
  'breakup':    { label: 'Breakup',       color: 'var(--bb-ink-60)',   icon: 'moon' },
};

const ENTH_META = {
  positive:  { label: 'Excited',   color: 'var(--bb-orange)' },
  neutral:   { label: 'Neutral',   color: 'var(--bb-ink-40)' },
  skeptical: { label: 'Skeptical', color: 'var(--bb-magenta)' },
  negative:  { label: 'Cold',      color: 'var(--bb-plum)' },
};

const STATE_META = {
  proposal_out: { label: 'Fresh quote', color: 'var(--bb-orange)' },
  waiting:      { label: 'Texting',     color: 'var(--bb-pink)' },
  cold:         { label: 'Quiet 9d+',   color: 'var(--bb-ink-60)' },
  superseded:   { label: 'Replaced',    color: 'var(--bb-ink-40)' },
};

/* Chat: prior turns w/ Coach */
const CHAT_INTRO = [
  { from: 'coach', body: "Morning Tom. 4 things on deck — Mike's the heat, Sarah owes financing, Diaz wants their preview, and we should breakup with Tom Carter today." },
];

const SUGGESTED_PROMPTS = [
  "Status on the Frisco lead?",
  "Snooze Sarah until Monday",
  "Draft something for Tom Carter",
  "Who's hot today?",
  "Just saw a new lead — log it",
];

const NOTIFICATIONS = [
  {
    id: 'morning',
    kind: 'morning',
    time: '6:42 AM',
    title: 'Brite Bird Coach',
    headline: 'Morning. 4 follow-ups today.',
    body: 'Mike Reyes is hot. Sarah Mitchell decides today. Open to start.',
  },
  {
    id: 'hot',
    kind: 'hot',
    time: 'now',
    title: 'Brite Bird Coach',
    headline: 'Mike Reyes replied',
    body: '"Send me the financing thing." Draft ready — tap to approve.',
  },
  {
    id: 'overdue',
    kind: 'overdue',
    time: '2:14 PM',
    title: 'Brite Bird Coach',
    headline: 'Promise overdue · 1 day',
    body: 'You told Sarah Mitchell you\'d send the financing app link.',
  },
  {
    id: 'breakup',
    kind: 'breakup',
    time: '8:00 AM',
    title: 'Brite Bird Coach',
    headline: 'Breakup ready for Tom Carter',
    body: '9 days quiet. One-tap to send a clean close.',
  },
];

Object.assign(window, { LEADS, TODAY_ITEMS, KIND_META, ENTH_META, STATE_META, CHAT_INTRO, SUGGESTED_PROMPTS, NOTIFICATIONS });
