PageSourceSearch

https://everdance.app/assets/_locale.quiz--uzVlVP0.js

js everdance.app collected 2026-10-02 14:17:03 UTC 13,573 bytes, 1 lines download raw bytes

1import{cl as O,cm as H,k as w,j as e,r as l,t as S,C as M,L as A,m as R,aK as _,aB as $,P as J,e as K,f as V,bc as G,l as U,ay as Y,cn as W,S as X}from"./index-I-H4gY_t.js";import T from"./confetti.module-D_RVyC63.js";import{R as Z}from"./rotate-ccw-C0HsPoYg.js";import{H as ee}from"./HoneypotField-CjvwZuLv.js";import{M as te}from"./mail-BCehvEm6.js";const re=O({method:"POST"}).handler(H("e34886463e7046c3c224bf970184c370f9d42de057e6f47e6bffee7dc69e41f2"));function se({question:t,index:s,total:r,onAnswer:c}){const{t:a}=w();return e.jsxs("div",{className:"animate-fade-in",children:[e.jsx("p",{className:"text-xs font-bold uppercase tracking-[0.2em] text-primary/80",children:a("quiz.question.counter",{index:s+1,total:r})}),e.jsx("h2",{className:"mt-3 font-display text-3xl leading-tight sm:text-4xl",children:t.prompt}),e.jsx("div",{className:"mt-8 grid gap-3 sm:gap-4",children:t.answers.map(n=>e.jsxs("button",{type:"button",onClick:()=>c(n.letter),className:"group flex items-center gap-4 rounded-2xl border border-border bg-card/80 p-4 text-left shadow-soft backdrop-blur transition hover:-translate-y-0.5 hover:border-primary/60 hover:bg-card hover:shadow-warm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary sm:p-5",children:[e.jsx("span",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-full bg-primary/15 font-bold text-primary transition group-hover:bg-primary group-hover:text-primary-foreground",children:n.letter}),e.jsx("span",{className:"text-base font-medium text-foreground/90 sm:text-lg",children:n.text})]},n.letter))})]},t.id)}const ae={A:{letter:"A",programSlugs:["afrobeat-burn","latin-glow","dance-cardio-burn"],accent:"from-[#f5b67c] via-[#e88aab] to-[#c9a0dc]"},B:{letter:"B",programSlugs:["heels-confidence-flow","belly-dance-empowerment","curvy-moves"],accent:"from-[#e88aab] via-[#c45c7c] to-[#9b72cf]"},C:{letter:"C",programSlugs:["mood-reset-dance","sofa-groove","menopause-motion"],accent:"from-[#c9a0dc] via-[#a8c0a0] to-[#dce5d4]"},D:{letter:"D",programSlugs:["hip-hop-lite","throwback-dance-party","pop-hits-cardio-dance"],accent:"from-[#fecaca] via-[#f9a8a8] to-[#c9a0dc]"}},k=["A","B","C","D"];function ne(){const{t}=w();return t("quiz.questions",{returnObjects:!0}).map((r,c)=>({id:c+1,prompt:r.prompt,answers:k.map((a,n)=>({letter:a,text:r.answers[n]}))}))}function ie(){const{t}=w(),s={};for(const r of k){const c=t(`quiz.results.${r}`,{returnObjects:!0});s[r]={...ae[r],...c}}return s}function oe(t){const s={A:0,B:0,C:0,D:0};for(const a of t)s[a]++;let r="A",c=-1;return k.forEach(a=>{s[a]>c&&(c=s[a],r=a)}),r}const le="/assets/quiz-result-energy-booster-BF5NgKf6.webp",ce="/assets/quiz-result-confidence-coach-BmJJ6Bpf.webp",ue="/assets/quiz-result-gentle-motivator-D9AbQwnJ.webp",de="/assets/quiz-result-fun-best-friend-CD-luel0.webp",me={A:le,B:ce,C:ue,D:de};function xe({result:t,programs:s,locale:r,onRestart:c}){const{t:a}=w(),i=ie()[t],u=i.programSlugs.map(o=>s.find(d=>d.slug===o)).filter(o=>!!o),p=me[t],g=l.useRef(!1);return l.useEffect(()=>{if(g.current)return;g.current=!0;const o=Date.now()+900,d=["#e88aab","#c9a0dc","#f5b67c","#fecaca"];(function h(){T({particleCount:4,angle:60,spread:70,origin:{x:0,y:.7},colors:d,disableForReducedMotion:!0}),T({particleCount:4,angle:120,spread:70,origin:{x:1,y:.7},colors:d,disableForReducedMotion:!0}),Date.now()<o&&requestAnimationFrame(h)})()},[]),e.jsxs("div",{className:"animate-fade-in",children:[e.jsxs("div",{className:"mb-5 flex flex-wrap items-center justify-between gap-3 rounded-2xl border border-border bg-card/60 px-4 py-3 text-sm backdrop-blur",children:[e.jsx("span",{className:"text-muted-foreground",children:a("quiz.result.retakePrompt")}),e.jsxs("button",{type:"button",onClick:c,className:"inline-flex items-center gap-2 rounded-full border border-foreground
1/20 bg-background px-4 py-2 text-xs font-bold uppercase tracking-wider text-foreground transition hover:border-foreground hover:bg-foreground hover:text-background",children:[e.jsx(Z,{className:"h-3.5 w-3.5"})," ",a("quiz.result.retakeButton")]})]}),e.jsxs("div",{className:`relative overflow-hidden rounded-3xl bg-gradient-to-br ${i.accent} p-8 text-foreground shadow-warm sm:p-12`,children:[e.jsx("div",{className:"absolute inset-0 bg-background/40 backdrop-blur-[1px]"}),e.jsxs("div",{className:`relative ${p?"grid gap-8 lg:grid-cols-[1.4fr_1fr] lg:items-end":""}`,children:[e.jsxs("div",{children:[e.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full bg-background/80 px-3 py-1 text-[10px] font-bold uppercase tracking-[0.2em] text-foreground/80",children:[e.jsx(S,{className:"h-3 w-3"})," ",a("quiz.result.personalityBadge")]}),e.jsx("h1",{className:"mt-4 font-display text-4xl leading-[1.05] sm:text-6xl",children:i.title}),e.jsx("p",{className:"mt-4 max-w-2xl text-lg text-foreground/85 sm:text-xl",children:i.description}),e.jsxs("blockquote",{className:"mt-6 max-w-2xl rounded-2xl bg-background/80 p-5 text-base italic text-foreground sm:text-lg",children:['"',i.motivation,'"']}),e.jsx("ul",{className:"mt-6 flex flex-wrap gap-2",children:i.benefits.map(o=>e.jsxs("li",{className:"inline-flex items-center gap-1.5 rounded-full bg-background/80 px-3 py-1.5 text-xs font-semibold text-foreground",children:[e.jsx(M,{className:"h-3.5 w-3.5 text-primary"})," ",o]},o))}),e.jsxs(A,{to:"/$locale/pricing",params:{locale:r},className:"mt-7 inline-flex items-center gap-2 rounded-full bg-foreground px-6 py-4 text-sm font-bold uppercase tracking-wider text-background shadow-warm transition hover:scale-[1.02]",children:[i.cta," ",e.jsx(R,{className:"h-4 w-4"})]})]}),p&&e.jsx("div",{className:"relative -mb-8 self-end sm:-mb-12",children:e.jsx("img",{src:p,alt:i.title,className:"block h-auto w-full object-contain object-bottom",loading:"lazy"})})]})]}),u.length>0&&e.jsxs("div",{className:"mt-12",children:[e.jsx("h2",{className:"font-display text-2xl sm:text-3xl",children:a("quiz.result.matchedProgramsTitle")}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:a("quiz.result.matchedProgramsCaption",{title:i.title.toLowerCase()})}),e.jsx("div",{className:"mt-6 grid gap-5 sm:grid-cols-2 lg:grid-cols-3",children:u.map(o=>e.jsx(_,{title:o.name,duration:o.duration??"",level:o.intensity??"",image:$(o.hero_image),to:`/${r}/programs/${o.slug}`},o.slug))}),e.jsx("div",{className:"mt-6 flex justify-center lg:justify-start",children:e.jsxs(A,{to:"/$locale/programs",params:{locale:r},className:"inline-flex items-center justify-center gap-2 rounded-full border border-border bg-card px-7 py-4 text-sm font-bold uppercase tracking-wider text-foreground transition hover:bg-background",children:[a("quiz.result.explorePrograms")," ",e.jsx(R,{className:"h-4 w-4"})]})})]}),e.jsxs("div",{className:"mt-14",children:[e.jsx(J,{title:a("quiz.result.pricingTitle"),caption:a("quiz.result.pricingCaption")}),e.jsx("div",{className:"mt-6 text-center",children:e.jsx("button",{type:"button",onClick:c,className:"text-xs font-medium uppercase tracking-wider text-muted-foreground underline-offset-4 hover:underline",children:a("quiz.result.retakeBottom")})})]})]})}function fe({defaultEmail:t,onSubmit:s}){const{t:r}=w(),[c,a]=l.useState(t??""),[n,i]=l.useState(null),[u,p]=l.useState(!1),[g,o]=l.useState(""),[d]=l.useState(()=>Date.now()),{recordLead:h,bindEmailField:z}=K("quiz"),y=V(c,a),q=l.useMemo(()=>G().trim().min(1,r("quiz.email.errorRequired")).email(r("quiz.email.errorInvalid")).max(255,r("quiz.email.errorTooLong")),[r]);function N(f){f.preventDefault();const b=q.safeParse(c);if(!b.success){i(b.error.issues[0]?.message??r("quiz.email.errorInvalid"));return}i(null),p(!0),h(b.data,{honeypot:g}),s(b.data,{honeypot:g,formOpenedAt:d})}return e.jsxs("div",{className:"mx-auto max-w-xl animate-fade-in text-center",children:[e.jsx("div",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-primary/10",children:e.jsx(te,{className:"h-6 w-6 text-primary","aria-hidden":!0})}),e.jsxs("h2",{className:"mt-5 font-display text-3xl leading-tight sm:text-4xl",children:[r("quiz.email.titleLead")," ",e.jsx("span",{className:"italic text-primary",children:r("quiz.email.titleHighlight")})]}),e.jsxs("ul",{className:"mx-auto mt-5 space-y-2 text-left text-sm text-muted-foreground sm:text-base",children:[e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(S,{className:"mt-0.5 h-4 w-4 shrink-0 text-primary","aria-hidden":!0}),e.jsx("span",{children:r("quiz.email.perk1")})]}),e.jsxs("li",{className:"flex items-start gap-2",children:[e.jsx(S,{className:"mt-0.5 h-4 w-4 shrink-0 text-primary","aria-hidden":!0}),e.jsx("span",{children:r("quiz.email.perk2")})]})]}),e.jsxs("form",{onSubmit:N,className:"mt-7 text-left",noValidate:!0,children:[e.jsx(ee,{value:g,onChange:o}),e.jsx("label",{htmlFor:"quiz-email",className:"sr-only",children:r("quiz.email.label")}),e.jsx("input",{id:"quiz-email",type:"email",inputMode:"email",autoComplete:"email",required:!0,value:c,onChange:f=>{a(f.target.value),n&&i(null)},onBlur:f=>{y.onBlur(),z().onBlur(f)},placeholder:r("quiz.email.placeholder"),"aria-invalid":n?"true":"false","aria-describedby":n?"quiz-email-error":void 0,className:"w-full rounded-full border border-input bg-background px-5 py-4 text-base outline-none ring-primary/30 transition focus:ring-2"}),y.hint,n&&e.jsx("p",{id:"quiz-email-error",role:"alert",className:"mt-2 px-2 text-sm text-destructive",children:n}),e.jsx("button",{type:"submit",disabled:u,className:"mt-4 inline-flex w-full items-center justify-center rounded-full bg-primary px-6 py-4 font-semibold text-primary-foreground shadow-lg transition hover:opacity-90 disabled:opacity-60",children:r(u?"quiz.email.submitting":"quiz.email.submit")}),e.jsx("p",{className:"mt-3 text-center text-xs text-muted-foreground",children:r("quiz.email.disclaimer")})]})]})}const C="everdance.quiz.result.v1",Q="everdance.quiz.email.v1",pe=["A","B","C","D"];function ge(t){if(!(typeof window>"u"))try{window.localStorage.setItem(C,JSON.stringify({result:t,savedAt:new Date().toISOString()}))}catch{}}function he(){if(typeof window>"u")return null;try{const t=window.localStorage.getItem(C);if(!t)return null;const s=JSON.parse(t);return typeof s?.result=="string"&&pe.includes(s.result)?s.result:null}catch{return null}}function be(){if(!(typeof window>"u"))try{window.localStorage.removeItem(C)}catch{}}function we(t){if(!(typeof window>"u"))try{window.localStorage.setItem(Q,t)}catch{}}function B(){if(typeof window>"u")return null;try{const t=window.localStorage.getItem(Q);return t&&t.includes("@")?t:null}catch{return null}}function ye({locale:t}){const{t:s}=w(),r=ne(),{data:c}=U(),a=Y(re),[n,i]=l.useState("quiz"),[u,p]=l.useState(0),[g,o]=l.useState([]),[d,h]=l.useState(null),[z,y]=l.useState([]),[q,N]=l.useState(null),f=r.length,b=n==="result"?100:Math.round(u/f*100);function E(m,x,j,v){a({data:{result_type:m,answers:x.map((L,F)=>({q:F+1,choice:L})),locale:t,referrer:typeof document<"u"&&document.referrer||null,email:j,honeypot:v?.honeypot??null,form_opened_at:v?.formOpenedAt??null}}).catch(()=>{})}function I(m){const x=[...g,m];if(o(x),u+1<f){p(u+1);return}i("loading");const j=oe(x);h(j),ge(j),y(x);const v=B();window.setTimeout(()=>{v?(E(j,x,v),i("result")):i("email")},1400)}function P(m,x){we(m),N(m),d&&(E(d,z,m,x),fetch("/api/public/send-quiz-result",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:m,resultType:d,locale:t})}).catch(()=>{})),i("result")}function D(){be(),o([]),p(0),h(null),y([]),i("quiz"),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}return l.useEffect(()=>{const m=he(),x=B();x&&N(x),m&&(h(m),i("result"))},[]),l.useEffect(()=>{(n==="quiz"||n==="email")&&typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})},[u,n]),e.jsxs("div",{className:"container-edge mx-auto max-w-3xl py-10 sm:py-16",children:[e.jsxs("header",{className:"mb-8",children:[e.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.25em] text-primary",children:s("quiz.header.badge")}),e.jsxs("h1",{className:"mt-2 font-display text-3xl leading-tight sm:text-5xl",children:[s("quiz.header.titleLead")," ",e.jsx("span",{className:"italic text-primary",children:s("quiz.header.titleHighlight")})]})]}),e.jsx("div",{className:"sticky top-0 z-10 -mx-4 mb-8 bg-background/80 px-4 py-3 backdrop-blur sm:mx-0 sm:rounded-full sm:px-4",children:e.jsx("div",{className:"h-2 overflow-hidden rounded-full bg-muted",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":b,children:e.jsx("div",{className:"h-full rounded-full bg-gradient-to-r from-primary to-[#e88aab] transition-all duration-500 ease-out",style:{width:`${b}%`}})})}),n==="quiz"&&e.jsx(se,{question:r[u],index:u,total:f,onAnswer:I}),n==="loading"&&e.jsxs("div",{className:"flex min-h-[40vh] flex-col items-center justify-center text-center animate-fade-in",children:[e.jsx("div",{className:"h-12 w-12 animate-spin rounded-full border-2 border-primary/30 border-t-primary"}),e.jsx("p",{className:"mt-6 font-display text-2xl sm:text-3xl",children:s("quiz.loading.title")}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:s("quiz.loading.subtitle")})]}),n==="email"&&e.jsx(fe,{defaultEmail:q??void 0,onSubmit:P}),n==="result"&&d&&e.jsx(xe,{result:d,programs:c,locale:t,onRestart:D})]})}function Se(){const{locale:t}=W.useParams(),{i18n:s}=w();return l.useEffect(()=>{s.language!==t&&s.changeLanguage(t)},[t,s]),e.jsx(X,{footerVariant:"minimal",showStickyCTA:!1,children:e.jsx(l.Suspense,{fallback:null,children:e.jsx(ye,{locale:t})})})}export{Se as component};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.