import { useState } from βreactβ;
const VALUES = [
βAcceptanceβ, βAuthenticityβ, βAwakeningβ, βBalanceβ, βBelongingβ,
βBoundariesβ, βClarityβ, βCompassionβ, βConnectionβ, βCourageβ,
βCreativityβ, βDevotionβ, βEaseβ, βEmbodimentβ, βEmpathyβ,
βExpressionβ, βFaithβ, βFlowβ, βForgivenessβ, βFreedomβ,
βGenerosityβ, βGraceβ, βGratitudeβ, βGrowthβ, βHealingβ,
βHopeβ, βHumilityβ, βIntegrityβ, βIntuitionβ, βJoyβ,
βKindnessβ, βLoveβ, βMagicβ, βNourishmentβ, βOpennessβ,
βPatienceβ, βPeaceβ, βPlayβ, βPresenceβ, βProtectionβ,
βPurposeβ, βReceptivityβ, βResilienceβ, βRestβ, βSacrednessβ,
βSafetyβ, βSelf-Loveβ, βSensitivityβ, βServiceβ, βSoftnessβ,
βSovereigntyβ, βStillnessβ, βSurrenderβ, βTransformationβ, βTrustβ,
βTruthβ, βVisionβ, βVitalityβ, βWholenessβ, βWonderβ
];
const MAX = 20;
// ββ tiny helpers ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
const Label = ({ children, style = {} }) => (
{children}
);
export default function SoulMission() {
const [selected, setSelected] = useState([]);
const [phase, setPhase] = useState(βselectβ); // select | email | result
const [name, setName] = useState(ββ);
const [email, setEmail] = useState(ββ);
const [emailError, setEmailError] = useState(ββ);
const [missionText, setMissionText] = useState(ββ);
const [loading, setLoading] = useState(false);
const [copied, setCopied] = useState(false);
// ββ value toggling ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
const toggle = (v) => {
if (selected.includes(v)) setSelected(selected.filter(x => x !== v));
else if (selected.length < MAX) setSelected([β¦selected, v]);
};
// ββ email gate ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
const handleEmailSubmit = async () => {
if (!name.trim()) { setEmailError(βPlease enter your name.β); return; }
if (!/\S+@\S+.\S+/.test(email)) { setEmailError(βPlease enter a valid email.β); return; }
setEmailError(ββ);
await generate();
};
// ββ AI generation βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
const generate = async () => {
setLoading(true);
setMissionText(ββ);
setPhase(βresultβ);
```
const prompt = `You are a warm, nurturing guide who helps people reconnect with their soul's deepest truth.
```
A person named ${name || βthis personβ} has chosen these 20 values as the core of who they are: ${selected.join(β, β)}.
Write a soul mission statement addressed to them personally. It should:
- Open by addressing them by first name warmly (e.g. β${name || βDear oneβ},β)
- Be 3β5 sentences, written in first person (βI amβ¦β, βI chooseβ¦β, βI trustβ¦β)
- Feel like a warm embrace β loving, grounding, and deeply affirming
- Weave in the spirit of their values naturally (donβt list them all literally)
- Have a gentle, flowing rhythm β like something read aloud by candlelight
- End with a single short power mantra on its own line, beginning with βI amβ β something they can whisper to themselves each morning
Output only the greeting, mission statement, and mantra. No titles, no extra commentary.`;
```
try {
const response = await fetch("https://api.anthropic.com/v1/messages", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": "",
"anthropic-version": "2023-06-01",
"anthropic-dangerous-direct-browser-access": "true"
},
body: JSON.stringify({
model: "claude-sonnet-4-20250514",
max_tokens: 1000,
messages: [{ role: "user", content: prompt }]
})
});
const data = await response.json();
const text = data?.content?.[0]?.text || "Something tender got interrupted. Please try again.";
setMissionText(text);
} catch (e) {
setMissionText("Something tender got interrupted. Please try again.");
}
setLoading(false);
```
};
const reset = () => {
setSelected([]); setName(ββ); setEmail(ββ);
setMissionText(ββ); setEmailError(ββ); setPhase(βselectβ);
};
const copyMantra = () => {
const lines = missionText.split(β\nβ).filter(Boolean);
const mantra = lines[lines.length - 1];
navigator.clipboard.writeText(mantra).then(() => {
setCopied(true);
setTimeout(() => setCopied(false), 2000);
});
};
// ββ parse mission text ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
const paragraphs = missionText.split(β\nβ).filter(Boolean);
const mantraLine = paragraphs[paragraphs.length - 1];
const bodyLines = paragraphs.slice(0, -1);
const isReady = !loading && missionText && mantraLine?.toLowerCase().startsWith(βi amβ);
return (
{/* ββ Brand header ββ */}
Tahiti Kulia
Your SoulMission Statement
Select 20 values that feel most true to who you are. Your personal soul mission β a mantra written just for you β will be revealed.
{/* ββββββββββββββββββββββββββββββββββββββββββ
PHASE 1 β VALUE SELECTION
ββββββββββββββββββββββββββββββββββββββββββ */}
{phase === "select" && (
<>
{/* Progress bar */}
{selected.length} / {MAX}
{selected.length === MAX && (
Beautiful. Your constellation is complete.
)}
{VALUES.map(v => (
toggle(v)}>{v}
))}
setPhase("email")}>
Reveal My Mission
{selected.length < MAX && (
{MAX - selected.length} more to go
)}
>
)}
{/* ββββββββββββββββββββββββββββββββββββββββββ
PHASE 2 β EMAIL GATE
ββββββββββββββββββββββββββββββββββββββββββ */}
{phase === "email" && (
Almost thereβ¦
Enter your name and email to receive your Soul Mission Statement β plus occasional offerings from Tahiti to support your path.
Reveal My Soul Mission
No spam, ever. Unsubscribe anytime.
)}
{/* ββββββββββββββββββββββββββββββββββββββββββ
PHASE 3 β RESULT + CTA
ββββββββββββββββββββββββββββββββββββββββββ */}
{phase === "result" && (
{/* Chosen values */}
Your 20 values
{selected.map(v => (
{v}
))}
{/* Mission statement */}
Your Soul Mission
{loading && (
Listening for your soul's voiceβ¦
)}
{missionText && (
<>
{bodyLines.join(" ")}
{isReady && (
Your Daily Mantra
{mantraLine}
{copied ? "Copied β" : "Copy Mantra"}
)}
>
)}
{/* ββ SESSION CTA ββ */}
{isReady && (
Ready to go deeper?
Your values are your map.Let's learn to live them fully.
In a 1:1 session with Tahiti, we go beneath the surface β using breathwork, Human Design, and somatic tools to help you embody the truth your soul just named.
Book a Session with Tahiti
)}
{/* Reset / regenerate */}
{!loading && (
Regenerate
Start Over
)}
)}
```
);
}