import { useState } from "react";
const MH = `KNOW YOUR SCORE -- CONTENT STRATEGY (Message House v2.6 / Bibliography v11 -- Medical Leverage, July 2026)
CORE TRUTH: "Know your score. Start here."
Program: Know Your Score -- unbranded community health and disease-state education initiative. 7 ACC college football markets, fall 2026. Game-day activations + KOL HCP educational dinners + community health fairs. Sponsor: Viking Therapeutics (clinical-stage, VK2735 pre-commercial). Approximately 95% unbranded disease-state education. NOT a screening, diagnostic, or treatment program. No CME/CE credit is associated with any program element.
PILLARS:
1. Treat the Cause -- Weight is the upstream driver of cardiometabolic disease, not a downstream consequence. Treating excess weight is treating cardiometabolic disease -- early.[1,3,4]
2. Progress, Not Perfection -- Sustained 5-10% weight reduction delivers clinically meaningful improvement in BP, glycemic control, and lipids; graded targets (>=5% meaningful benefit, >=10% to manage many complications). No universal numerical targets.[1,2b,10]
3. Community as Care -- Obesity is a population-level health pattern shaped by where people live and gather. Know Your Score meets people in their communities.[7,8]
HCP MESSAGES (cardiologists, PCPs, internists, obesity medicine, NP/PAs, pharmacists):
CORE: "Treat obesity first." / "Treating excess weight is treating cardiometabolic disease -- early."[1,2b,3] / "Obesity is the upstream driver of cardiometabolic disease -- not a downstream consequence."[3,4]
SUPPORTING: "Treating obesity first changes the trajectory of cardiometabolic health -- addressing insulin resistance, HTN, dyslipidemia, and T2D before they compound."[1,3,4] | "5-10% sustained weight loss = clinically meaningful improvement in BP, glycemic control, and lipids."[10] | "The 2026 ADA Standards of Care for Obesity recommend medications as part of initial treatment (Rec 2.6b, Level A) and set graded targets of >=5% and >=10% (Rec 2.5b)."[2b] | "Second-generation NuSH therapies achieve placebo-subtracted reductions of roughly 8%-21% at maximal doses."[1] | "Lifestyle intervention alone did not reduce adverse CV outcomes (Look AHEAD) -- pharmacotherapy is the addition that changes CV risk."[11] | "After weight loss, appetite-regulating hormones shift toward regain and persist at least 12 months -- regain is biology, not willpower."[15]
HCP CTAs: "Know Your Score helps your patients arrive ready." | "Join the clinical conversation." | "Register your KOL dinner."
PATIENT MESSAGES (community members, families, ambassadors):
CORE: "Your weight and your heart are connected."[4] | "You don't need to be perfect to start. You need a starting point." | "Meaningful change matters more than a perfect number."[1,10]
SUPPORTING: "Heart disease is the #1 cause of death in the US."[5] | "Excess weight affects blood pressure, blood sugar, kidney function, and long-term heart health."[3,4] | "Even a small, sustained change -- 5 to 10% of your weight -- can improve your blood pressure, blood sugar, and long-term heart health."[10] | "About 7 in 10 US adults are living with excess weight -- this is a community-wide health issue, not a personal failing."[17] | "More than 1 in 3 American adults has prediabetes, and most don't know it."[5] | "BMI is a starting point, not a verdict." | "The score is not a diagnosis -- it's a starting point for a conversation with your doctor."
PATIENT CTAs: "Know Your Score." | "Scan. Score. Start." | "Start here." | "Talk to your doctor." | "Bring someone you love."
GUARDRAILS (NON-NEGOTIABLE):
1. Program name is always "Know Your Score" in full -- never abbreviated. "KYS" must never appear in any material, filename, or copy.
2. "Cardiometabolic" is HCP-ONLY. NEVER in patient copy.
3. Use "heart disease" not "cardiovascular disease" in patient copy.
4. BMI is NEVER the headline. It is a starting point, not a verdict. Do not use "a BMI below 25" as a consumer target.
5. No product/pipeline/formulation references in patient copy. VK2735 is never named to patients.
6. Weight is NEVER a moral category. No personal-failure, lifestyle-choice, or behavioral-shortcoming framing.
7. No universal numerical targets. Healthy weight is individualized.
8. No aesthetic framing. No before/after, transformation, slim-down, or appearance language.
9. All clinical claims must be sourced (AMA style).
10. No outsized weight-loss promises.
11. Know Your Score is NOT a screening, diagnostic, or treatment program.
12. No CME or CE credit is associated with any Know Your Score program element.
13. NEVER use "number" in a CTA context -- always use "score."
14. No Lilly/Novo Nordisk resources. Avoid OMA's trademarked "Treating Obesity First" phrasing; use "treating excess weight is treating cardiometabolic disease -- early."
SOURCES (v2.6 Message House Source Library, 16 references):
[1] Gilbert O et al. J Am Coll Cardiol. 2025;86(7):536-555. (2025 ACC Concise Clinical Guidance) [2a] ADA. Diabetes Care. 2026;49(Suppl 1):S166-S182. (Standards of Care in Diabetes--2026, Section 8) [2b] ADA Professional Practice Committee for Obesity. Diabetes Obes Cardiometab CARE. 2026;1(1):5-36. (Pharmacologic Treatment of Obesity in Adults -- first standalone ADA obesity standards) [3] Ndumele CE et al. Circulation. 2023;148(20):1606-1635. (AHA CKM Presidential Advisory) [4] Lavie CJ et al. J Am Coll Cardiol. 2018;72(13):1506-1531. [5] CDC. National Diabetes Statistics Report; Heart Disease Facts. cdc.gov. [6] Emmerich SD et al. NCHS Data Brief. 2024;(508):1-10. (obesity 40.3%) [7] Hemmingsson E et al. Obes Rev. 2023;24(1):e13514. [8] Kaplan LM et al. Obesity. 2018;26(1):61-69. (National ACTION Study) [9] Rubino F et al. Nat Med. 2020;26(4):485-497. (weight stigma consensus) [10] Jensen MD et al. Circulation. 2014;129(25 Suppl 2):S102-S138. (5-10% threshold) [11] Look AHEAD Research Group. N Engl J Med. 2013;369(2):145-154. [12] Data on file. Viking Therapeutics. December 2025. [13] WHO Adult BMI Classification. who.int. [14] Bhaskaran K et al. Lancet Diabetes Endocrinol. 2018;6(12):944-953. (BMI-mortality; nadir 21-25) [15] Sumithran P et al. N Engl J Med. 2011;365(17):1597-1604. (hormonal adaptations to weight loss) [17] NCHS Health E-Stats. 2026;(111):1-7. (about 7 in 10 US adults living with excess weight)
EXTENDED (not in message house; HCP dinner / KOL / Q&A backup): [18] Aggarwal R et al. JAMA. 2024;331(21):1858-1860 (CKM stage 1+, about 89%). [19] Ndumele CE et al. 2026 AHA/ACC/ADA/ASN CKM Clinical Practice Guideline. J Am Coll Cardiol. 2026;87(22S):e1889-e2007.`;
const BIBLIO = `KNOW YOUR SCORE -- WORKING BIBLIOGRAPHY v11 (aligned to Message House v2.6). AMA style.
--- v2.6 MESSAGE HOUSE SOURCE LIBRARY (16 references) ---
[1] Gilbert O et al. 2025 ACC Concise Clinical Guidance on Medical Weight Management for Optimization of Cardiovascular Health. J Am Coll Cardiol. 2025;86(7):536-555.
[2a] American Diabetes Association. Obesity and Weight Management for the Prevention and Treatment of Diabetes (Section 8): Standards of Care in Diabetes--2026. Diabetes Care. 2026;49(Suppl 1):S166-S182.
[2b] ADA Professional Practice Committee for Obesity. Pharmacologic Treatment of Obesity in Adults: Standards of Care in Overweight and Obesity. Diabetes Obes Cardiometab CARE. 2026;1(1):5-36.
[3] Ndumele CE et al. Cardiovascular-Kidney-Metabolic Health: A Presidential Advisory From the AHA. Circulation. 2023;148(20):1606-1635.
[4] Lavie CJ et al. Healthy weight and obesity prevention. J Am Coll Cardiol. 2018;72(13):1506-1531.
[5] CDC. National Diabetes Statistics Report and Heart Disease Facts. cdc.gov. [Living reference -- cite accessed date]
[6] Emmerich SD et al. Obesity and severe obesity prevalence in adults: US, Aug 2021-Aug 2023. NCHS Data Brief. 2024;(508):1-10. [obesity-only 40.3%]
[7] Hemmingsson E et al. The social origins of obesity within and across generations. Obes Rev. 2023;24(1):e13514.
[8] Kaplan LM et al. Perceptions of barriers to effective obesity care: National ACTION Study. Obesity. 2018;26(1):61-69.
[9] Rubino F et al. Joint international consensus statement for ending stigma of obesity. Nat Med. 2020;26(4):485-497.
[10] Jensen MD et al. 2013 AHA/ACC/TOS Guideline for the Management of Overweight and Obesity in Adults. Circulation. 2014;129(25 Suppl 2):S102-S138. [5-10% threshold]
[11] Look AHEAD Research Group. Cardiovascular Effects of Intensive Lifestyle Intervention in Type 2 Diabetes. N Engl J Med. 2013;369(2):145-154. [negative finding: lifestyle alone did not reduce MACE]
[12] Data on file. Viking Therapeutics. December 2025. [Internal qualitative research]
[13] WHO Adult BMI Classification. who.int. [normal 18.5-24.9; overweight >=25; obesity >=30]
[14] Bhaskaran K et al. Association of BMI with overall and cause-specific mortality: 3.6M UK adults. Lancet Diabetes Endocrinol. 2018;6(12):944-953. [mortality nadir BMI 21-25; HR 1.21 per 5 kg/m2 above 25]
[15] Sumithran P et al. Long-term persistence of hormonal adaptations to weight loss. N Engl J Med. 2011;365(17):1597-1604. [biology of regain]
[17] NCHS Health E-Stats. 2026;(111):1-7. doi:10.15620/cdc/174643 [about 7 in 10 US adults living with excess weight (overweight + obesity), Aug 2021-Aug 2023. Consumer short source: CDC NCHS, NHANES, Aug 2021-Aug 2023]
--- EXTENDED CLINICAL/EPIDEMIOLOGY (not in v2.6 message house; HCP dinner / KOL / Q&A backup) ---
[18] Aggarwal R, Ostrominski JW, Vaduganathan M. Prevalence of CKM syndrome stages in US adults, 2011-2020. JAMA. 2024;331(21):1858-1860. [about 89% stage 1+; primary source for "nearly 90%" CKM claim -- distinct from "7 in 10 excess weight"]
[19] Ndumele CE et al. 2026 AHA/ACC/ADA/ASN CKM Clinical Practice Guideline. J Am Coll Cardiol. 2026;87(22S):e1889-e2007. [first formal CKM guideline; "nearly 90% have at least one CKM risk factor"]
[E1] Poirier P et al. Obesity and cardiovascular disease. Circulation. 2006;113(6):898-918. [>80% of CVD patients have overweight/obesity]
[E2] Bray GA et al. Obesity: a chronic relapsing progressive disease. Obes Rev. 2017;18(7):715-723.
[E3] Sumithran/food-noise & biology backup: Diktas H et al. Food Noise Questionnaire. Obesity. 2025 (in press).
[E4] Kanbour S et al. Bodyweight loss and T2D remission: meta-regression. Lancet Diabetes Endocrinol. 2025;13(4):294-306. [dose-response remission 5.4% to 89.5%]
[E5] SELECT: Lincoff AM et al. Semaglutide and CV outcomes in obesity without diabetes. N Engl J Med. 2023;389:2221-2232. [20% MACE reduction]
[E6] SURMOUNT-1: Jastreboff AM et al. Tirzepatide once weekly for obesity. N Engl J Med. 2022;387(3):205-216.
[E7] STEP 1: Wilding JPH et al. Once-weekly semaglutide in overweight/obesity. N Engl J Med. 2021;384:989-1002.
[E8] Jones DW et al. 2025 AHA/ACC Hypertension Guideline. Circulation. 2025;152:e114-e218.
[E9] Garvey WT et al. AACE/ACE obesity clinical practice guidelines. Endocr Pract. 2016;22(suppl 3):1-203.
--- PATIENT-EDUCATION RESOURCE LIBRARIES (public/free reference; not clinical-claim sources) ---
[P1] CDC. Adult Overweight & Obesity; Diabetes Prevention Program. cdc.gov. [Public Domain]
[P2] NHLBI/NIH. Health Topics + Publications Library (heart disease, hypertension, metabolic syndrome, obesity). nhlbi.nih.gov. [Public Domain]
[P3] AHA. Life's Essential 8 / My Life Check; Answers by Heart fact sheets; FindHelp SDOH locator. heart.org. [Permission req for reuse]
[P4] ADA. Patient Education Library; Find a DSMES Program. diabetes.org. [Free individual use]
[P5] OAC. Resource Library; Understanding Obesity brochures; Stop Weight Bias; Your Weight Matters. obesityaction.org. [Free]
[P6] TOS. Patient Informational Pages. obesity.org. [Free noncommercial]
[P7] OMA. Obesity Algorithm; Four Pillars Framework; clinician locator. obesitymedicine.org. [Permission req for reproduction; note trademarked "Treating Obesity First" -- do not echo]
EXCLUDED: any Lilly/Novo Nordisk-funded patient resources; telehealth-platform resources.`;
async function stream(sys, user, onChunk) {
const r = await fetch("https://api.anthropic.com/v1/messages", {
method: "POST",
headers: {"Content-Type":"application/json"},
body: JSON.stringify({model:"claude-sonnet-4-6",max_tokens:1000,stream:true,system:sys,messages:[{role:"user",content:user}]})
});
if (!r.ok) throw new Error(`API error ${r.status}`);
const reader = r.body.getReader();
const dec = new TextDecoder();
let buf = "";
while (true) {
const {done, value} = await reader.read();
if (done) break;
buf += dec.decode(value, {stream:true});
const lines = buf.split("\n"); buf = lines.pop();
for (const l of lines) {
if (!l.startsWith("data: ")) continue;
const d = l.slice(6).trim();
if (d==="[DONE]") return;
try { const j=JSON.parse(d); if(j.type==="content_block_delta"&&j.delta?.text) onChunk(j.delta.text); } catch{}
}
}
}
const CHANNELS = ["Social -- Organic Post","Social -- Carousel (3-5 slides)","Social -- Story/Reel Script","Email -- HCP Outreach","Email -- Patient Education (drip)","Email -- Partner Outreach","Display -- Digital Banner","Display -- Out-of-Home / Billboard","Radio -- 30-sec Spot","Radio -- 60-sec Spot","Event -- Tent Signage","Event -- Invitation Copy","Event -- Ambassador/KOL Script","Web -- Hero Section","Web -- Long-Form Page","PR -- Press Release","LinkedIn -- HCP Post"];
const FORMATS = ["Full draft copy","3 headline variants + body","Key messages + CTAs (bulleted)","Full script with stage directions","Brief + outline for creative team"];
const TONES = ["Clinical peer-to-peer","Warm + accessible (community)","Authoritative + institutional","Conversational + direct","Motivational + empowering"];
const MSGS = {
hcp:["Treat obesity first -- upstream cardiometabolic risk","Obesity: upstream driver, not downstream consequence","5-10% weight loss = clinically meaningful benefit","2026 ADA graded targets (>=5% / >=10%)","Regain is biology, not willpower (Sumithran)","Lifestyle alone did not reduce MACE (Look AHEAD)","Community activation extends the clinical conversation","7 in 10 US adults live with excess weight (DYK)"],
patient:["Your weight and heart are connected","Starting point, not a verdict","Progress over perfection","Small, sustained changes = real improvements","Heart disease is the #1 killer","Your healthy weight is individualized","Community: show up for each other","Know Your Score -- one score starts a conversation"],
partner:["Know Your Score is not a screening/diagnostic program","Shared mission framing","Seven ACC markets, fall 2026","~95% unbranded disease-state education","Program boilerplate -- short","Program boilerplate -- full","Sponsorship disclosure (Viking Therapeutics)"]
};
const CTAS = {
hcp:["Know Your Score helps your patients arrive ready.","Join the clinical conversation.","Register your KOL dinner.","Partner with Know Your Score."],
patient:["Know Your Score.","Scan. Score. Start.","Start here.","Talk to your doctor.","Bring someone you love."],
partner:["Join Know Your Score in [market].","Partner to advance community health.","Learn about fall 2026 activation."]
};
const css = `
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{--navy:#003865;--blue:#005693;--sky:#1a7fc4;--ice:#e8f3fc;--deep:#00263f;--slate:#4a6070;--mist:#f2f7fb;--ink:#1a2530;--steel:#6b7e8d;--rule:#d0dde8;--orange:#e07020;--or-lt:#fef5eb;--green:#1a7a4a;--gr-lt:#eaf6ef;--red:#b82c2c;--re-lt:#fdf0f0;--teal:#0e6655;--te-lt:#d0ece7;--purple:#5a3080;--pu-lt:#f4f0f9;--r:10px;--sh:0 2px 12px rgba(0,38,63,.08);--sha:0 6px 24px rgba(0,38,63,.13)}
body{font-family:'DM Sans',sans-serif;background:var(--mist);color:var(--ink);font-size:14px}
.shell{min-height:100vh;display:flex;flex-direction:column}
.hdr{background:var(--navy);height:60px;display:flex;align-items:center;justify-content:space-between;padding:0 28px;border-bottom:3px solid var(--sky);position:sticky;top:0;z-index:100}
.hdr-l{display:flex;align-items:baseline;gap:10px}
.hdr-h{font-family:'DM Serif Display',serif;font-size:21px;color:#fff;letter-spacing:-.5px}
.hdr-t{font-family:'DM Mono',monospace;font-size:10px;color:var(--sky);letter-spacing:2px;text-transform:uppercase}
.hdr-b{background:var(--sky);color:#fff;font-size:10px;font-weight:700;letter-spacing:1px;padding:3px 10px;border-radius:20px;text-transform:uppercase}
.tabs{background:#fff;border-bottom:1px solid var(--rule);padding:0 28px;display:flex}
.tab{padding:14px 22px;font-size:13px;font-weight:600;color:var(--slate);border:none;background:none;cursor:pointer;border-bottom:3px solid transparent;transition:all .15s;display:flex;align-items:center;gap:7px}
.tab:hover{color:var(--blue)}
.tab.on{color:var(--blue);border-bottom-color:var(--blue)}
.body{flex:1;max-width:1060px;margin:0 auto;width:100%;padding:28px 28px 64px}
.card{background:#fff;border-radius:var(--r);box-shadow:var(--sh);border:1px solid var(--rule);margin-bottom:20px}
.ch{padding:18px 22px 14px;border-bottom:1px solid var(--rule)}
.ct{font-family:'DM Serif Display',serif;font-size:17px;color:var(--navy)}
.cs{font-size:12px;color:var(--steel);margin-top:2px}
.cb{padding:22px}
.fg{display:flex;flex-direction:column;gap:5px;margin-bottom:14px}
.fl{font-size:10px;font-weight:700;letter-spacing:1px;text-transform:uppercase;color:var(--slate)}
select,textarea,input{font-family:'DM Sans',sans-serif;font-size:13px;color:var(--ink);background:var(--mist);border:1.5px solid var(--rule);border-radius:8px;padding:9px 12px;transition:border-color .15s;outline:none;width:100%}
select{cursor:pointer;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234a6070' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;padding-right:34px}
select:focus,textarea:focus{border-color:var(--sky);box-shadow:0 0 0 3px rgba(26,127,196,.12);background:#fff}
textarea{resize:vertical;min-height:110px;line-height:1.6}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.chips{display:flex;flex-wrap:wrap;gap:7px;margin-top:4px}
.chip{padding:4px 11px;border-radius:20px;font-size:12px;font-weight:500;cursor:pointer;border:1.5px solid;transition:all .15s}
.chip.on{background:var(--blue);color:#fff;border-color:var(--blue)}
.chip.off{background:#fff;color:var(--slate);border-color:var(--rule)}
.chip.off:hover{border-color:var(--sky);color:var(--blue)}
.btn{display:inline-flex;align-items:center;gap:7px;padding:10px 18px;border-radius:8px;font-family:'DM Sans',sans-serif;font-size:13px;font-weight:600;cursor:pointer;border:none;transition:all .15s}
.btn-p{background:var(--blue);color:#fff}
.btn-p:hover{background:var(--navy);transform:translateY(-1px);box-shadow:var(--sh)}
.btn-p:disabled{background:var(--rule);color:var(--steel);cursor:not-allowed;transform:none;box-shadow:none}
.btn-g{background:transparent;color:var(--slate);border:1.5px solid var(--rule)}
.btn-g:hover{border-color:var(--sky);color:var(--blue)}
.btn-sm{padding:6px 12px;font-size:11px}
.out{background:var(--mist);border:1px solid var(--rule);border-radius:8px;padding:20px;min-height:140px;font-size:13px;line-height:1.8;color:var(--ink);white-space:pre-wrap;word-break:break-word}
.ph{color:var(--steel);font-style:italic;font-size:13px}
.cur{display:inline-block;width:2px;height:1em;background:var(--sky);animation:blink .9s step-end infinite;vertical-align:text-bottom;margin-left:2px}
@keyframes blink{0%,100%{opacity:1}50%{opacity:0}}
.spin{width:16px;height:16px;border:2.5px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:spin .7s linear infinite;display:inline-block}
.spin.dk{border:2.5px solid rgba(0,86,147,.2);border-top-color:var(--blue)}
@keyframes spin{to{transform:rotate(360deg)}}
.bar{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}
.div{height:1px;background:var(--rule);margin:20px 0}
.ab{border-radius:8px;padding:14px 16px;border-left:4px solid;margin-bottom:9px}
.ab.pass{background:var(--gr-lt);border-color:var(--green)}
.ab.fail{background:var(--re-lt);border-color:var(--red)}
.ab.warn{background:var(--or-lt);border-color:var(--orange)}
.ab.rw{background:var(--pu-lt);border-color:var(--purple)}
.ab.cit{background:var(--ice);border-color:var(--sky)}
.al{font-size:10px;font-weight:700;letter-spacing:1.5px;text-transform:uppercase;margin-bottom:5px}
.ab.pass .al{color:var(--green)}.ab.fail .al{color:var(--red)}.ab.warn .al{color:var(--orange)}.ab.rw .al{color:var(--purple)}.ab.cit .al{color:var(--sky)}
.at{font-size:13px;line-height:1.65;color:var(--ink);white-space:pre-wrap}
.sb{display:inline-flex;align-items:center;gap:7px;padding:7px 14px;border-radius:22px;font-weight:700;font-size:14px;margin-bottom:14px}
.sb.g{background:var(--gr-lt);color:var(--green)}.sb.y{background:var(--or-lt);color:var(--orange)}.sb.r{background:var(--re-lt);color:var(--red)}
.bi{background:var(--mist);border:1.5px dashed var(--rule);border-radius:8px;padding:12px;font-size:12px;color:var(--slate);font-family:'DM Mono',monospace;min-height:70px;resize:vertical;width:100%;outline:none;transition:border-color .15s;line-height:1.6}
.bi:focus{border-color:var(--sky);border-style:solid}
.note{font-size:11px;color:var(--steel);margin-top:5px}
.note.ok{color:var(--green)}
.fb{display:flex;align-items:center;justify-content:space-between}
.fe{display:flex;align-items:center;justify-content:flex-end;gap:10px;margin-top:14px}
`;
function Gen() {
const [aud, setAud] = useState("hcp");
const [msgs, setMsgs] = useState([]);
const [cta, setCta] = useState("");
const [ch, setCh] = useState("");
const [fmt, setFmt] = useState("");
const [tone, setTone] = useState("");
const [ctx, setCtx] = useState("");
const [out, setOut] = useState("");
const [loading, setLoading] = useState(false);
const [copied, setCopied] = useState(false);
const togMsg = id => setMsgs(p => p.includes(id) ? p.filter(x=>x!==id) : [...p,id]);
const go = async () => {
if (!ch || !msgs.length) return;
setLoading(true); setOut("");
const labels = MSGS[aud].filter((_,i)=>msgs.includes(i)).join(" | ");
const sys = `You are the Know Your Score Content Lab -- the official AI content engine for Know Your Score, an unbranded community health and disease-state education initiative by Medical Leverage, sponsored by Viking Therapeutics.\n\n${MH}\n\nRULES: Always follow all guardrails. For HCP: clinical peer-to-peer language, "cardiometabolic" OK. For patients: warm, accessible, NEVER "cardiometabolic," use "heart disease" not "cardiovascular disease," no pipeline/product refs. Include inline citations [1],[2],etc. on clinical claims. Never use "number" in CTA context -- always "score." No aesthetic framing. After content, add 2-sentence Strategy Notes section explaining pillar alignment.`;
const usr = `Generate Know Your Score ${fmt||"draft copy"} for:\nAUDIENCE: ${aud==="hcp"?"HCP/Clinical":aud==="patient"?"Patient/Community":"Partner/Institutional"}\nCHANNEL: ${ch}\nFORMAT: ${fmt||"Full draft copy"}\nTONE: ${tone||"Auto-match to audience"}\nKEY MESSAGES: ${labels}\nCTA: ${cta||"AI selects best"}\nCONTEXT: ${ctx||"None"}`;
try { await stream(sys, usr, c => setOut(p=>p+c)); }
catch(e) { setOut("Error: "+e.message); }
setLoading(false);
};
const copy = async () => { await navigator.clipboard.writeText(out); setCopied(true); setTimeout(()=>setCopied(false),2000); };
return (<>
{(out||loading)&&
{out&&}
}
>);
}
function Analyze() {
const [copy, setCopy] = useState("");
const [aud, setAud] = useState("hcp");
const [ch, setCh] = useState("");
const [out, setOut] = useState("");
const [loading, setLoading] = useState(false);
const go = async () => {
if (!copy.trim()) return;
setLoading(true); setOut("");
const sys = `You are the Know Your Score Strategy Compliance Analyst -- a senior medical communications reviewer.\n\n${MH}\n\nRESPOND IN THIS EXACT FORMAT (use ALL-CAPS labels, no markdown headers):\n\nSTRATEGY ALIGNMENT SCORE: X/10\nOVERALL VERDICT: [1-2 sentences]\n\nGUARDRAIL VIOLATIONS (or "None identified"):\n- VIOLATION: [quote exact text] | RULE: [which guardrail] | WHY: [explanation]\n\nON-STRATEGY ELEMENTS:\n- [text] -> MAPS TO: [pillar/message]\n\nALIGNMENT GAPS:\n- [text] -> ISSUE: [why] | STRONGER: [rewrite with citation]\n\nRECOMMENDED REWRITES:\n- ORIGINAL: "[text]"\n REWRITE: "[improved text]" [citation if applicable]\n RATIONALE: [why stronger]\n\nCOPY DIRECTION FOR WRITERS:\n- [actionable point]`;
const usr = `Analyze this ${aud==="hcp"?"HCP":aud==="patient"?"patient/community":"partner"}-facing${ch?" "+ch:""} copy for Know Your Score strategy alignment:\n\n---\n${copy}\n---`;
try { await stream(sys, usr, c => setOut(p=>p+c)); }
catch(e) { setOut("Error: "+e.message); }
setLoading(false);
};
const render = txt => {
if (!txt) return null;
const lines = txt.split("\n");
const els = []; let i = 0;
while (i < lines.length) {
const l = lines[i];
if (l.startsWith("STRATEGY ALIGNMENT SCORE:")) {
const m = l.match(/(\d+)\/10/); const sc = m ? parseInt(m[1]) : null;
const vl = lines[i+1]?.startsWith("OVERALL VERDICT:") ? lines[i+1].replace("OVERALL VERDICT:","").trim() : "";
const cl = sc>=8?"g":sc>=5?"y":"r";
els.push(
}
);
i += vl ? 2 : 1;
} else if (l.startsWith("GUARDRAIL VIOLATIONS")) {
const bl=[]; i++;
while(i
);
} else if (l.startsWith("ON-STRATEGY ELEMENTS")) {
const bl=[]; i++;
while(iContent Generator
Select audience, messages, and channel -- generate on-strategy copy with inline citations
Audience
{[["hcp","HCP / Clinical"],["patient","Patient / Community"],["partner","Partner / Institutional"]].map(([v,l])=>(
))}
Key Messages (select all that apply)
{MSGS[aud].map((m,i)=>(
))}
Primary CTA
Tone
Channel *
Output Format
Additional Context
Generated Content
{ch} -- {aud.toUpperCase()}
{out||Generating...}{loading&&}
{sc>=8?"OK":sc>=5?"!":"X"} {sc!==null?`${sc}/10`:"See below"}
{vl&&Overall Verdict
{vl}
Guardrail Violations
{none?"No guardrail violations identified":content}
On-Strategy Elements
{bl.join("\n")}
Alignment Gaps
{bl.join("\n")}
Recommended Rewrites
{bl.join("\n")}
Copy Direction for Writers
{bl.join("\n")}
{txt}
;
};
return (<>
Strategy Compliance Analyzer
Paste copy for guardrail audit, alignment score, and rewrite recommendations with inline citations
Intended Audience
Channel (optional)
Paste Copy for Analysis *
{copy.length} chars
Analysis Results
Strategy compliance report with rewrite recommendations
{loading&&!out?
Running compliance analysis...
:render(out)}
{loading&&out&&Continuing...
}
{txt}
;
const els = [];
for (let i=0;iANNOTATED COPY
{(secs[i+1]||"").trim()}
Citations Needed
{c}
Guardrail Flags
{c}
REFERENCE LIST
{c}
{txt}
;
};
return (<>
Reference & Sourcing Engine
Paste any document -- the engine appends inline citations, flags unsupported claims, and checks guardrails
Document to Cite *
Additional Sources (optional -- 40+ sources already pre-loaded)
Annotated Document
Inline citations appended
{loading&&!out?
Analyzing and matching citations...
:render(out)}
{loading&&out&&Continuing...
}
