// Triage + deep + new screens. No "protocol", no clinician language.
// Adds: allergies, current/past peptides, share-anything, contact + consent before pay.
// Adds: "We heard you" summary screen.

const TRIAGE_QUESTIONS = [
  {
    id: 'name',
    kind: 'text',
    eyebrow: 'STEP 01',
    title: <>What should we <em>call you?</em></>,
    sub: "First name is fine. We'll use it everywhere — except your COAs, which use your legal name.",
    placeholder: 'Type your first name…',
  },
  {
    id: 'age',
    kind: 'options',
    eyebrow: 'STEP 02',
    title: <>How old are <em>you?</em></>,
    sub: 'We use this to set safe dosing windows.',
    options: ['Under 25', '25–34', '35–44', '45–54', '55+'],
  },
  {
    id: 'primary',
    kind: 'options',
    eyebrow: 'STEP 03',
    title: <>What's the <em>loudest</em> thing right now?</>,
    sub: "There can be more than one — pick the one that's costing you the most sleep.",
    options: [
      { v: 'weight', label: 'My body has stopped responding to the things that used to work', tail: 'WEIGHT' },
      { v: 'libido', label: 'My libido is gone and I miss it', tail: 'LIBIDO' },
      { v: 'menopause', label: 'Sleep, mood, hot flashes — the menopause stack', tail: 'MENOPAUSE' },
      { v: 'hair', label: 'My hair is thinning and I noticed first', tail: 'HAIR' },
      { v: 'skin', label: "My skin doesn't feel like mine anymore", tail: 'SKIN' },
      { v: 'sleep', label: "My sleep is off and recovery isn't there", tail: 'SLEEP' },
      { v: 'energy', label: "My energy doesn't match what my life asks from me", tail: 'ENERGY' },
      { v: 'healing', label: 'My body needs help recovering or repairing', tail: 'HEALING' },
      { v: 'cognition', label: 'My focus, memory, or clarity needs support', tail: 'COGNITION' },
      { v: 'stress', label: 'My system feels switched on too often', tail: 'STRESS' },
    ],
  },
  {
    id: 'undertreated',
    kind: 'dynamic_options',
    eyebrow: 'STEP 04',
    // Dynamic — title and sub depend on triage primary
    titleFor: (primary) => {
      const subjectMap = {
        weight: <>Have you ever felt your <em>performance</em> has been under-treated?</>,
        libido: <>Have you ever felt your <em>performance</em> has been under-treated?</>,
        menopause: <>Have you ever felt your <em>performance</em> has been under-treated?</>,
        hair: <>Have you ever felt your <em>performance</em> has been under-treated?</>,
        skin: <>Have you ever felt your <em>performance</em> has been under-treated?</>,
        sleep: <>Have you ever felt your <em>performance</em> has been under-treated?</>,
        energy: <>Have you ever felt your <em>performance</em> has been under-treated?</>,
        healing: <>Have you ever felt your <em>performance</em> has been under-treated?</>,
        cognition: <>Have you ever felt your <em>performance</em> has been under-treated?</>,
        stress: <>Have you ever felt your <em>performance</em> has been under-treated?</>,
      };
      return subjectMap[primary] || <>Have you ever felt your <em>performance</em> has been under-treated?</>;
    },
    subFor: (primary) => {
      const map = {
        weight: "No wrong answer. We just want to know what you've already heard about your weight.",
        libido: "No wrong answer. We just want to know what you've already heard about libido.",
        menopause: "No wrong answer. We just want to know what you've already heard about menopause.",
        hair: "No wrong answer. We just want to know what you've already heard about hair loss.",
        skin: "No wrong answer. We just want to know what you've already heard about your skin.",
        sleep: "No wrong answer. We just want to know what you've already heard about sleep.",
        energy: "No wrong answer. We just want to know what you've already heard about energy.",
        healing: "No wrong answer. We just want to know what you've already heard about recovery.",
        cognition: "No wrong answer. We just want to know what you've already heard about focus and memory.",
        stress: "No wrong answer. We just want to know what you've already heard about stress.",
      };
      return map[primary] || "No wrong answer. We just want to know what you've already heard.";
    },
    options: ['Yes — more than once', 'Yes, once', 'No, but I sensed it', 'No', "I haven't asked yet"],
  },
  {
    id: 'urgency',
    kind: 'options',
    eyebrow: 'STEP 05',
    title: <>Where are you in <em>the decision?</em></>,
    options: ['Ready to move forward', 'Comparing options', 'Need a clearer plan first', "I'm exploring"],
  },
];

// Universal questions appended to EVERY deep flow.
// Includes Freya-style basics: gender, height, current weight, location, prescriptions, GLP-1 detail, allergies, peptide history, share-anything.
const UNIVERSAL_TAIL = [
  {
    id: 'location', kind: 'text',
    eyebrow: 'BASICS · 01',
    title: <>Where are you <em>located?</em></>,
    sub: 'State and zip is plenty — we ship cold-chain by region.',
    placeholder: 'State, ZIP',
  },
  {
    id: 'gender', kind: 'options',
    eyebrow: 'BASICS · 02',
    title: <>What's your <em>gender?</em></>,
    sub: 'We dose differently depending — and we won\'t assume.',
    options: ['Woman', 'Man', 'Non-binary', 'Prefer not to say'],
  },
  {
    id: 'height', kind: 'slider',
    eyebrow: 'BASICS · 03',
    title: <>How <em>tall</em> are you?</>,
    sub: 'We use this with weight to set safe ranges.',
    min: 48, max: 120, step: 1, default: 65, unit: '',
    softMax: 120,
    formatValue: (n) => `${Math.floor(n / 12)}'${n % 12}\u2033`,
    formatBound: (n, isMax) => isMax ? `10\u2032+` : `${Math.floor(n / 12)}\u2032`,
  },
  {
    id: 'current_weight', kind: 'slider',
    eyebrow: 'BASICS · 04',
    title: <>What's your <em>current weight?</em></>,
    sub: 'Pounds. Round to the nearest 5 if that\'s easier.',
    min: 90, max: 500, step: 1, default: 165, unit: 'LBS',
    softMax: 500,
  },
  {
    id: 'current_peptides', kind: 'options',
    eyebrow: 'HISTORY · 01',
    title: <>Are you <em>currently</em> — or have you ever been — on peptides?</>,
    options: [
      'Yes, currently',
      'Yes, in the past',
      'No, never',
      "I'm not sure",
    ],
  },
  {
    id: 'prescriptions', kind: 'longtext',
    eyebrow: 'SAFETY · 01',
    title: <>What <em>medications</em> are you currently taking?</>,
    sub: "Include name, dose, and frequency for each. Type 'none' if you don't take any.",
    placeholder: 'e.g. Lexapro 10mg daily, Metformin 500mg 2× daily…',
  },
  {
    id: 'allergies', kind: 'options',
    eyebrow: 'SAFETY · 02',
    title: <>Any <em>medication allergies</em> we should know?</>,
    sub: "Pick what fits — you can add detail in the open-mic question at the end.",
    options: [
      'No known medication allergies',
      'Yes — antibiotics',
      'Yes — anesthetics or sedatives',
      'Yes — peptides or biologics specifically',
      'Yes — other (we\'ll ask)',
    ],
  },
  {
    id: 'recent_bloodwork', kind: 'bloodwork_upload',
    eyebrow: 'SAFETY · 03',
    title: <>Do you have recent <em>bloodwork</em> from the past 90 days?</>,
    sub: 'If you have it, upload it here. If not, keep going.',
  },
  {
    id: 'share_anything', kind: 'longtext',
    eyebrow: 'OPEN MIC',
    title: <>Anything else you want to <em>share?</em></>,
    sub: 'Symptoms, hopes, things you\'re scared to say out loud. This goes straight to our care team — only they see it. Skip if you\'d rather not.',
    placeholder: 'Type anything you want us to know…',
    optional: true,
  },
];

const DEEP_QUESTIONS = {
  weight: [
    { id: 'w_history', kind: 'options', eyebrow: 'WEIGHT · 01', title: <>What feels most <em>stuck?</em></>, options: ['Scale movement', 'Appetite control', 'Cravings or food noise', 'Energy and consistency'] },
    { id: 'w_glp1', kind: 'options', eyebrow: 'WEIGHT · 02', title: <>Have you tried a <em>GLP-1</em> before?</>, options: ['Yes — and it worked, then plateaued', 'Yes — and side effects were too much', 'Yes — but I never reached a real dose', 'No, never'] },
    { id: 'w_goal', kind: 'slider', eyebrow: 'WEIGHT · 03', title: <>How many pounds, <em>honestly?</em></>, sub: "No judgment, no math — just the number you'd circle on a napkin.", min: 5, max: 80, step: 1, default: 25, unit: 'POUNDS' },
    { id: 'w_diet', kind: 'options', eyebrow: 'WEIGHT · 04', title: <>How would you describe <em>how you eat?</em></>, options: ['Mindful, mostly whole foods', 'Tries hard, then collapses', 'Snacks, skipped meals, late dinners', "I genuinely don't know anymore"] },
    ...UNIVERSAL_TAIL,
  ],
  libido: [
    { id: 'l_when', kind: 'options', eyebrow: 'LIBIDO · 01', title: <>How does it <em>show up?</em></>, options: ['I rarely think about sex', "My body doesn't respond like it used to", 'Confidence is affected', "I can't pinpoint it"] },
    { id: 'l_partner', kind: 'options', eyebrow: 'LIBIDO · 02', title: <>Are you <em>currently partnered?</em></>, options: ['Yes — and it\'s become tense', 'Yes — and they\'re patient', 'No — and that\'s part of why', "No — and it doesn't bother me"] },
    { id: 'l_arousal', kind: 'options', eyebrow: 'LIBIDO · 03', title: <>Is it desire, arousal, or <em>both?</em></>, options: ['Desire — I never think about sex anymore', "Arousal — my body doesn't cooperate", 'Both — and I want both back'] },
    ...UNIVERSAL_TAIL,
  ],
  menopause: [
    { id: 'm_phase', kind: 'options', eyebrow: 'MENOPAUSE · 01', title: <>Where are you <em>in the arc?</em></>, options: ['Perimenopause — symptoms but still cycling', 'Menopause', 'Post-menopause', "I'm honestly not sure"] },
    { id: 'm_top', kind: 'options', eyebrow: 'MENOPAUSE · 02', title: <>What's the <em>worst</em> of it?</>, options: ["Sleep — I don't feel rested", "Mood — I don't recognize myself", 'Hot flashes', 'Brain fog', 'Joints / aches'] },
    { id: 'm_hrt', kind: 'options', eyebrow: 'MENOPAUSE · 03', title: <>Are you on <em>HRT?</em></>, options: ['Yes — and it\'s helping', 'Yes — but it\'s not enough', 'I tried and stopped', 'No — and I want to understand options'] },
    ...UNIVERSAL_TAIL,
  ],
  hair: [
    { id: 'h_when', kind: 'options', eyebrow: 'HAIR · 01', title: <>How did you <em>first notice?</em></>, options: ['More shedding', 'Less density', 'Hairline or temples', 'After a specific event'] },
    { id: 'h_where', kind: 'options', eyebrow: 'HAIR · 02', title: <>Where does it <em>show up?</em></>, options: ['The part is widening', 'Temples / hairline', 'Overall thinning', 'Patches'] },
    { id: 'h_tried', kind: 'options', eyebrow: 'HAIR · 03', title: <>What have you <em>already tried?</em></>, options: ['Topical minoxidil', 'Oral finasteride / spironolactone', 'Supplements only', 'Nothing serious yet'] },
    ...UNIVERSAL_TAIL,
  ],
  skin: [
    { id: 's_concern', kind: 'options', eyebrow: 'SKIN · 01', title: <>What's your <em>top</em> skin concern?</>, options: ['Loss of firmness / collagen', 'Texture and tone', 'Sun damage / pigmentation', 'Adult acne', 'All of the above'] },
    { id: 's_routine', kind: 'options', eyebrow: 'SKIN · 02', title: <>How is your <em>routine?</em></>, options: ['Minimal — soap and water', 'Solid basics — cleanser, SPF, moisturizer', 'Multi-step with actives', 'Inconsistent'] },
    { id: 's_pro', kind: 'options', eyebrow: 'SKIN · 03', title: <>Have you done <em>in-office</em> treatments?</>, options: ['Yes — regularly', 'Occasionally', 'Once or twice', 'Never'] },
    ...UNIVERSAL_TAIL,
  ],
  sleep: [
    { id: 'sl_pattern', kind: 'options', eyebrow: 'SLEEP · 01', title: <>What part of sleep feels <em>off?</em></>, options: ['Falling asleep', 'Staying asleep', 'Waking up tired', 'Recovery never feels complete'] },
    { id: 'sl_day', kind: 'options', eyebrow: 'SLEEP · 02', title: <>How does it affect your <em>day?</em></>, options: ['Brain fog', 'Mood swings', 'Low drive', 'Poor training or recovery'] },
    { id: 'sl_tried', kind: 'options', eyebrow: 'SLEEP · 03', title: <>What have you <em>already tried?</em></>, options: ['Sleep hygiene', 'Supplements', 'Prescription sleep support', 'Nothing consistent yet'] },
    ...UNIVERSAL_TAIL,
  ],
  energy: [
    { id: 'e_pattern', kind: 'options', eyebrow: 'ENERGY · 01', title: <>Where does your energy <em>drop?</em></>, options: ['Morning', 'Midday', 'After meals', 'It feels low all day'] },
    { id: 'e_need', kind: 'options', eyebrow: 'ENERGY · 02', title: <>What do you need energy <em>for?</em></>, options: ['Work and focus', 'Training', 'Family and life', 'Feeling like myself'] },
    { id: 'e_tried', kind: 'options', eyebrow: 'ENERGY · 03', title: <>What have you <em>leaned on?</em></>, options: ['Caffeine', 'Supplements', 'Sleep changes', 'Nothing has worked consistently'] },
    ...UNIVERSAL_TAIL,
  ],
  healing: [
    { id: 'he_area', kind: 'options', eyebrow: 'HEALING · 01', title: <>What needs the most <em>support?</em></>, options: ['Joint or tendon recovery', 'Training recovery', 'Inflammation', 'General repair'] },
    { id: 'he_limit', kind: 'options', eyebrow: 'HEALING · 02', title: <>What is it keeping you <em>from?</em></>, options: ['Training normally', 'Moving comfortably', 'Sleeping well', 'Feeling confident in my body'] },
    { id: 'he_tried', kind: 'options', eyebrow: 'HEALING · 03', title: <>What have you <em>tried?</em></>, options: ['Rest', 'Physical therapy', 'Anti-inflammatory support', 'Nothing structured yet'] },
    ...UNIVERSAL_TAIL,
  ],
  cognition: [
    { id: 'cog_gap', kind: 'options', eyebrow: 'COGNITION · 01', title: <>What feels most <em>missing?</em></>, options: ['Focus', 'Memory', 'Mental stamina', 'Calm clarity'] },
    { id: 'cog_pressure', kind: 'options', eyebrow: 'COGNITION · 02', title: <>Where do you notice it <em>most?</em></>, options: ['Work', 'Conversations', 'Reading or learning', 'Daily follow-through'] },
    { id: 'cog_tried', kind: 'options', eyebrow: 'COGNITION · 03', title: <>What have you <em>already tried?</em></>, options: ['Caffeine', 'Nootropics', 'Sleep changes', 'Nothing consistent yet'] },
    ...UNIVERSAL_TAIL,
  ],
  stress: [
    { id: 'st_pattern', kind: 'options', eyebrow: 'STRESS · 01', title: <>How does stress <em>show up?</em></>, options: ['Racing thoughts', 'Body tension', 'Irritability', 'Wired but tired'] },
    { id: 'st_recover', kind: 'options', eyebrow: 'STRESS · 02', title: <>What is hardest to <em>recover from?</em></>, options: ['Work pressure', 'Family pressure', 'Training load', 'Life in general'] },
    { id: 'st_tried', kind: 'options', eyebrow: 'STRESS · 03', title: <>What have you <em>used for support?</em></>, options: ['Breathing or meditation', 'Supplements', 'Medication', 'Nothing consistent yet'] },
    ...UNIVERSAL_TAIL,
  ],
};

const Questionnaire = ({ phase, trackHint, visitorId, onComplete, onBack, tweaks }) => {
  const questions = phase === 'triage' ? TRIAGE_QUESTIONS : (DEEP_QUESTIONS[trackHint] || DEEP_QUESTIONS.weight);
  const [step, setStep] = React.useState(0);
  const [answers, setAnswers] = React.useState({});
  let q = questions[step];
  // Resolve dynamic question titles based on triage answers
  if (q && q.kind === 'dynamic_options') {
    const primary = answers.primary && typeof answers.primary === 'object' ? answers.primary.v : answers.primary;
    q = {
      ...q,
      kind: 'options',
      title: q.titleFor ? q.titleFor(primary) : q.title,
      sub: q.subFor ? q.subFor(primary) : q.sub,
    };
  }
  const total = questions.length;

  const back = () => {
    if (step > 0) setStep(step - 1);
    else onBack();
  };

  const setAnswer = (val) => setAnswers({ ...answers, [q.id]: val });

  const canProceed = () => {
    if (q.optional) return true;
    const v = answers[q.id];
    if (q.kind === 'text' || q.kind === 'longtext') return typeof v === 'string' && v.trim().length > 0;
    if (q.kind === 'slider') return typeof (v ?? q.default) === 'number';
    if (q.kind === 'bloodwork_upload') {
      return v?.hasRecentBloodwork === false || Boolean(v?.bloodwork?.key);
    }
    return v !== undefined && v !== null;
  };

  const next = step < total - 1
    ? () => setStep(step + 1)
    : () => {
        let result = trackHint;
        const finalAnswers = { ...answers };
        // ensure slider defaults are captured if untouched
        if (q.kind === 'slider' && finalAnswers[q.id] === undefined) finalAnswers[q.id] = q.default;
        if (phase === 'triage') {
          const primary = finalAnswers.primary;
          if (primary && typeof primary === 'object') result = primary.v;
          else if (typeof primary === 'string') {
            const opt = TRIAGE_QUESTIONS[2].options.find(o => o.label === primary);
            result = opt ? opt.v : 'weight';
          }
        }
        onComplete({ track: result, answers: finalAnswers });
      };

  return (
    <div className="q-shell">
      <div className="q-top">
        <Logo size={20} asLink />
        <div className="q-progress">
          <div className="q-progress-fill" style={{ width: `${((step + 1) / total) * 100}%` }} />
        </div>
        <div className="q-counter">{String(step + 1).padStart(2, '0')} / {String(total).padStart(2, '0')}</div>
      </div>

      <div className="q-stage">
        <div className="q-card" key={`${phase}-${step}`}>
          <div className="q-eyebrow">— {q.eyebrow}</div>
          <h1 className="q-title serif">{q.title}</h1>
          {q.sub && <p className="q-sub">{q.sub}</p>}

          {q.kind === 'text' && (
            <input
              autoFocus type="text"
              className="q-text-input"
              placeholder={q.placeholder}
              value={answers[q.id] || ''}
              onChange={(e) => setAnswer(e.target.value)}
              onKeyDown={(e) => { if (e.key === 'Enter' && canProceed()) next(); }}
            />
          )}

          {q.kind === 'longtext' && (
            <textarea
              autoFocus rows={5}
              className="q-text-input"
              style={{ fontFamily: "'Inter Tight', sans-serif", fontSize: 18, lineHeight: 1.5, resize: 'vertical', minHeight: 120, padding: 16, border: '1px solid var(--rule)', borderRadius: 4 }}
              placeholder={q.placeholder}
              value={answers[q.id] || ''}
              onChange={(e) => setAnswer(e.target.value)}
            />
          )}

          {q.kind === 'options' && (
            <div className="q-options">
              {q.options.map((opt, i) => {
                const isObj = typeof opt === 'object';
                const label = isObj ? opt.label : opt;
                const tail = isObj ? opt.tail : '';
                const value = isObj ? opt : opt;
                const selected = JSON.stringify(answers[q.id]) === JSON.stringify(value);
                const key = String.fromCharCode(65 + i);
                return (
                  <button
                    key={i}
                    className={`q-option ${selected ? 'is-selected' : ''}`}
                    onClick={() => { setAnswer(value); setTimeout(next, 240); }}
                  >
                    <span className="q-option-key">{key}</span>
                    <span>{label}</span>
                    {tail && <span className="q-option-tail">{tail}</span>}
                  </button>
                );
              })}
            </div>
          )}

          {q.kind === 'slider' && (
            <SliderQ q={q} value={answers[q.id] ?? q.default} onChange={setAnswer} />
          )}

          {q.kind === 'bloodwork_upload' && (
            <BloodworkUploadQ
              q={q}
              value={answers[q.id]}
              visitorId={visitorId}
              track={trackHint}
              onChange={setAnswer}
            />
          )}

          <div className="q-actions">
            <button className="btn btn-soft" onClick={back}>← Back</button>
            <button
              className="btn btn-primary"
              onClick={next}
              disabled={!canProceed()}
              style={{ opacity: canProceed() ? 1 : 0.4, pointerEvents: canProceed() ? 'auto' : 'none' }}
            >
              {step === total - 1
                ? (phase === 'triage' ? "Let's get started" : 'See what we recommend')
                : (q.optional && !canProceed() ? 'Skip →' : 'Continue →')}
            </button>
            <span className="q-hint">PRESS ENTER ↵</span>
          </div>
        </div>
      </div>
    </div>
  );
};

const BloodworkUploadQ = ({ value, visitorId, track, onChange }) => {
  const [status, setStatus] = React.useState(value?.bloodwork ? 'uploaded' : 'idle');
  const [message, setMessage] = React.useState('');

  const chooseNo = () => {
    setStatus('idle');
    setMessage('');
    onChange({ hasRecentBloodwork: false });
  };

  const chooseYes = () => {
    onChange({ hasRecentBloodwork: true });
    setMessage('');
  };

  const upload = async (file) => {
    if (!file) return;
    setStatus('uploading');
    setMessage('');
    const form = new FormData();
    form.append('visitorId', visitorId);
    form.append('track', track || '');
    form.append('bloodwork', file);

    try {
      const res = await fetch('/api/site/bloodwork', { method: 'POST', body: form });
      const data = await res.json();
      if (!res.ok) throw new Error(data.error || 'Upload failed');
      setStatus('uploaded');
      setMessage('Uploaded.');
      onChange({
        hasRecentBloodwork: true,
        fileName: file.name,
        bloodwork: data.bloodwork,
      });
    } catch (err) {
      setStatus('error');
      setMessage(err?.message || 'Upload failed. Try again.');
      onChange({ hasRecentBloodwork: true });
    }
  };

  const hasRecentBloodwork = value?.hasRecentBloodwork === true;

  return (
    <div className="q-bloodwork">
      <div className="q-options q-bloodwork-options">
        <button
          type="button"
          className={`q-option ${hasRecentBloodwork ? 'is-selected' : ''}`}
          onClick={chooseYes}
        >
          <span className="q-option-key">A</span>
          <span>Yes, I have recent bloodwork</span>
        </button>
        <button
          type="button"
          className={`q-option ${value?.hasRecentBloodwork === false ? 'is-selected' : ''}`}
          onClick={chooseNo}
        >
          <span className="q-option-key">B</span>
          <span>No, not right now</span>
        </button>
      </div>

      {hasRecentBloodwork && (
        <label className={`q-upload ${status === 'uploading' ? 'is-uploading' : ''}`}>
          <input
            type="file"
            accept=".pdf,.jpg,.jpeg,.png,.heic,.heif,application/pdf,image/jpeg,image/png,image/heic,image/heif"
            onChange={(e) => upload(e.target.files?.[0])}
          />
          <span className="q-upload-title">
            {status === 'uploaded' ? (value?.fileName || 'Bloodwork uploaded') : 'Upload bloodwork'}
          </span>
          <span className="q-upload-detail">PDF, JPG, PNG, HEIC, or HEIF</span>
        </label>
      )}

      {message && <div className={`q-upload-message ${status === 'error' ? 'is-error' : ''}`}>{message}</div>}
    </div>
  );
};

const SliderQ = ({ q, value, onChange }) => {
  const display = q.formatValue ? q.formatValue(value) : `${value}`;
  const showPlus = q.softMax && value >= q.softMax;
  const minLabel = q.formatBound ? q.formatBound(q.min, false) : `${q.min} ${q.unit}`;
  const maxLabel = q.formatBound ? q.formatBound(q.max, true) : `${q.max}+ ${q.unit}`;
  return (
    <div className="q-slider-wrap">
      <div className="q-slider-value serif">
        {display}{showPlus && !q.formatValue ? '+' : ''}
        {q.unit && !q.formatValue && <span className="unit">{q.unit}</span>}
      </div>
      <input type="range" className="q-slider"
        min={q.min} max={q.max} step={q.step}
        value={value}
        onChange={(e) => onChange(Number(e.target.value))}
      />
      <div className="q-slider-bounds">
        <span>{minLabel}</span>
        <span>{maxLabel}</span>
      </div>
    </div>
  );
};

Object.assign(window, { Questionnaire, TRIAGE_QUESTIONS, DEEP_QUESTIONS });
