import{r as t,j as e,as as ee,c as U,d as te,L as se,m as O,A as ne,q as re,bv as H}from"./index-CxGMQRP8.js";import{u as J}from"./useIOSAudioContext-DSBnluc9.js";import{C as ae}from"./chevron-left-JkOQYbi0.js";const oe=()=>{const{getContext:i}=J(),d=t.useRef(0);return t.useCallback(()=>{const n=Date.now();if(!(n-d.current<80)){d.current=n;try{const r=i();if(!r)return;const c=r.createOscillator(),y=r.createGain();c.connect(y),y.connect(r.destination),c.type="sine",c.frequency.setValueAtTime(600,r.currentTime),c.frequency.exponentialRampToValueAtTime(300,r.currentTime+.05),y.gain.setValueAtTime(.08,r.currentTime),y.gain.exponentialRampToValueAtTime(.01,r.currentTime+.05),c.start(r.currentTime),c.stop(r.currentTime+.05)}catch{}}},[i])},ie=({resistance:i=50,onInteraction:d,images:p,textFaces:n,labels:r=["Library","Medieval Town","Space","Farm"],isActive:c=!1,onRotationChange:y,hideArrows:D=!1,size:L,targetFace:T})=>{const g=t.useRef(null),_=t.useRef(null),W=t.useRef(null),B=oe(),{unlockOn:M}=J();t.useEffect(()=>M(g.current,["pointerdown","touchstart","mouseenter"]),[M]);const o=t.useRef(0),u=t.useRef(0),j=t.useRef(!1),z=t.useRef(0),X=t.useRef(0),N=t.useRef(!1),V=t.useRef(0),b=t.useRef(!1),a=t.useRef(null),l=t.useRef(!1),[C,R]=t.useState(0),f=L??140,Z=f*.06,S=t.useCallback(()=>.995-i/100*.095,[i]);t.useEffect(()=>{c&&!l.current&&!N.current&&(b.current=!0,a.current=null,l.current=!0)},[c]);const P=t.useRef(void 0);t.useEffect(()=>{if(T===void 0||T===P.current)return;P.current=T,b.current=!1;const h=[0,90,180,270][T],m=(o.current%360+360)%360;let w=h-m;w>180&&(w-=360),w<-180&&(w+=360);const F=o.current+w-o.current;u.current=F*.08},[T]);const v=s=>{g.current&&(b.current=!1,j.current=!0,u.current=0,z.current=s.clientX,g.current.setPointerCapture(s.pointerId),g.current.style.cursor="grabbing",N.current||(N.current=!0,d?.()))},k=s=>{if(!j.current)return;const h=s.clientX-z.current;z.current=s.clientX;const m=.3;o.current+=h*m,u.current=h*m},I=()=>{j.current=!1,g.current&&(g.current.style.cursor="grab")},$=s=>{b.current=!1,u.current=s==="left"?-8:8,N.current||(N.current=!0,d?.())};t.useEffect(()=>{let s;const h=m=>{if(X.current=m,b.current){a.current||(a.current=m);const q=m-a.current,E=1500;if(q<E){const Y=q/E;o.current=Math.sin(Y*Math.PI)*25}else b.current=!1,o.current=0}else if(!j.current){if(Math.abs(u.current)<.5){const Q=(Math.round(o.current/90)*90-o.current)*.05;u.current+=Q,u.current*=.85}else{const E=S()*.95;u.current*=E}o.current+=u.current,Math.abs(u.current)<.001&&Math.abs(o.current%90)<.1&&(u.current=0,o.current=Math.round(o.current/90)*90)}let w=(o.current%360+360)%360;const F=Math.round(w/90)%4;F!==V.current&&(N.current&&!b.current&&B(),V.current=F),F!==C&&R(F),y?.(o.current),_.current&&(_.current.style.transform=`rotateY(${o.current}deg)`),s=requestAnimationFrame(h)};return s=requestAnimationFrame(h),()=>cancelAnimationFrame(s)},[S]);const A=s=>n?.[s]?e.jsx("div",{className:"w-full h-full flex items-center justify-center p-2 overflow-hidden",children:n[s]}):p?.[s]?e.jsx("img",{src:p[s],alt:r[s],className:"w-full h-full object-cover pointer-events-none"}):e.jsx("div",{className:"w-full h-full bg-slate-700"});return e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsxs("div",{ref:W,className:"relative overflow-visible mb-12",style:{width:f*2,height:f*2,perspective:"1000px"},children:[e.jsx("div",{ref:g,onPointerDown:v,onPointerMove:k,onPointerUp:I,onPointerLeave:I,onPointerCancel:I,className:"absolute cursor-grab active:cursor-grabbing touch-none z-10",style:{inset:-Z}}),e.jsxs("div",{ref:_,className:"w-full h-full relative pointer-events-none",style:{transformStyle:"preserve-3d"},children:[e.jsx("div",{className:"absolute inset-0 overflow-hidden rounded-lg pointer-events-none",style:{transform:`translateZ(${f}px)`,backfaceVisibility:"hidden",backgroundColor:n?"rgba(255,255,255,0.15)":void 0},children:A(0)}),e.jsx("div",{className:"absolute inset-0 overflow-hidden rounded-lg pointer-events-none",style:{transform:`rotateY(180deg) translateZ(${f}px)`,backfaceVisibility:"hidden",backgroundColor:n?"rgba(255,255,255,0.15)":void 0},children:A(2)}),e.jsx("div",{className:"absolute inset-0 overflow-hidden rounded-lg pointer-events-none",style:{transform:`rotateY(90deg) translateZ(${f}px)`,backfaceVisibility:"hidden",backgroundColor:n?"rgba(255,255,255,0.15)":void 0},children:A(1)}),e.jsx("div",{className:"absolute inset-0 overflow-hidden rounded-lg pointer-events-none",style:{transform:`rotateY(-90deg) translateZ(${f}px)`,backfaceVisibility:"hidden",backgroundColor:n?"rgba(255,255,255,0.15)":void 0},children:A(3)}),e.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{transform:`rotateX(90deg) translateZ(${f}px)`,backfaceVisibility:"hidden",backgroundColor:n?"rgba(255,255,255,0.08)":void 0},children:!n&&e.jsx("div",{className:"w-full h-full bg-slate-800"})}),e.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{transform:`rotateX(-90deg) translateZ(${f}px)`,backfaceVisibility:"hidden",backgroundColor:n?"rgba(255,255,255,0.08)":void 0},children:!n&&e.jsx("div",{className:"w-full h-full bg-slate-800"})})]}),e.jsx("div",{className:"absolute -bottom-8 left-1/2 -translate-x-1/2 w-3/4 h-6 bg-black/20 blur-xl rounded-full pointer-events-none"})]}),!D&&e.jsxs("div",{className:"flex items-center gap-8 relative z-20",children:[e.jsx("button",{onClick:()=>$("left"),className:"p-3 rounded-full bg-card/80 border border-border hover:bg-muted transition-colors shadow-md","data-lumi-interactive":!0,children:e.jsx(ae,{className:"w-6 h-6"})}),e.jsx("button",{onClick:()=>$("right"),className:"p-3 rounded-full bg-card/80 border border-border hover:bg-muted transition-colors shadow-md","data-lumi-interactive":!0,children:e.jsx(ee,{className:"w-6 h-6"})})]})]})},ce="https://cdn.storysparkle.org/ui_elements/Hero%20Icons/TextChecker.webp",le=({className:i=""})=>{const{t:d}=U("landing"),{getLocalizedPath:p}=te();return e.jsx(se,{to:p("/text-checker"),className:i,children:e.jsxs(O.div,{className:"relative inline-flex flex-col items-center pl-12",whileHover:{scale:1.05},whileTap:{scale:.98},transition:{type:"spring",stiffness:400,damping:17},children:[e.jsx("img",{src:ce,alt:"Text checker",className:"absolute -top-2 left-0 w-20 h-auto pointer-events-none z-10 rotate-[-15deg]"}),e.jsx("div",{className:`bg-gradient-to-r bg-gradient-to-r from-violet-400 via-red-300 to-amber-300
pl-12 pr-10 py-4 rounded-full shadow-lg shadow-violet-400/30
hover:shadow-xl hover:shadow-amber-500/40 transition-shadow`,children:e.jsx("span",{className:"text-white font-bold uppercase tracking-widest text-sm md:text-base whitespace-nowrap",children:d("checkText.buttonText")})})]})})},de=({labels:i,activeIndex:d,onSelect:p})=>e.jsx("div",{className:"flex items-center justify-center gap-4 sm:gap-5",children:i.map((n,r)=>{const c=d===r;return e.jsxs("button",{onClick:()=>p(r),className:"relative flex flex-col items-center focus:outline-none group","aria-label":n,children:[e.jsx(ne,{mode:"wait",children:c&&e.jsx(O.span,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},exit:{opacity:0,y:4},transition:{duration:.25},className:"absolute -top-5 text-[10px] sm:text-xs font-medium text-white whitespace-nowrap",children:n},`label-${r}`)}),e.jsx(O.div,{layout:!0,className:"rounded-full",animate:{width:c?28:10,height:10,backgroundColor:c?"rgba(255,255,255,1)":"rgba(255,255,255,0.3)"},transition:{type:"spring",stiffness:500,damping:30,mass:.8},style:{borderRadius:5}})]},n)})}),ue=["https://cdn.storysparkle.org/landing_assets/Mini_5%20WEBP.webp","https://cdn.storysparkle.org/landing_assets/Mini_8%20WEBP.webp","https://cdn.storysparkle.org/landing_assets/Mini_12%20WEBP.webp","https://cdn.storysparkle.org/landing_assets/Mini_15%20WEBP.webp"],G=[{r:202,g:122,b:24},{r:192,g:63,b:70},{r:163,g:173,b:101},{r:229,g:130,b:68}],x="text-amber-200 font-semibold",pe=[e.jsxs("p",{className:"italic text-[13px] sm:text-sm lg:text-base leading-relaxed",children:['"Mia ',e.jsx("span",{className:x,children:"sees"})," a small dragon.",e.jsx("br",{}),"It is ",e.jsx("span",{className:x,children:"cold"}),".",e.jsx("br",{}),"She ",e.jsx("span",{className:x,children:"gives"}),' it bread."']},"early"),e.jsxs("p",{className:"italic text-[12px] sm:text-[13px] lg:text-sm leading-relaxed",children:['"Mia ',e.jsx("span",{className:x,children:"finds"})," a small dragon outside her home.",e.jsx("br",{}),"It looks ",e.jsx("span",{className:x,children:"cold"}),", so she ",e.jsx("span",{className:x,children:"gives"}),' it bread and water."']},"developing"),e.jsxs("p",{className:"italic text-[11px] sm:text-[12px] lg:text-[13px] leading-relaxed",children:['"Mia ',e.jsx("span",{className:x,children:"discovers"})," a tiny dragon at her doorstep. It looks"," ",e.jsx("span",{className:x,children:"cold and hungry"}),", so she ",e.jsx("span",{className:x,children:"brings"}),' it bread, water, and a warm blanket."']},"independent"),e.jsxs("p",{className:"italic text-[10px] sm:text-[11px] lg:text-[12px] leading-relaxed",children:['"When Mia ',e.jsx("span",{className:x,children:"discovers"})," a teeny-weeny dragon shivering at her doorstep, she gently ",e.jsx("span",{className:x,children:"offers"}),' it bread, water, and a warm blanket, waiting patiently until it feels safe enough to enter."']},"confident")],fe=i=>pe.map((d,p)=>e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-white text-center px-3",children:[d,e.jsx("p",{className:"mt-2 text-[9px] sm:text-[10px] lg:text-xs text-white/60 font-medium tracking-wide",children:i[p]})]},p)),be=()=>{const{t:i}=U("landing"),d=re(),[p,n]=t.useState(!1),[r,c]=t.useState("rgb(241, 183, 59)"),[y,D]=t.useState([1,0,0,0]),[L,T]=t.useState([1,.85,.85,.85]),[g,_]=t.useState(0),[W,B]=t.useState(void 0),M=t.useRef(null),[o,u]=t.useState(!1),j=i("checkText.levels",{returnObjects:!0}),z=i("checkText.captions",{returnObjects:!0}),X=fe(z),N=t.useCallback(a=>{const l=(a%360+360)%360,C=l/90,R=[0,3,2,1],f=Math.floor(C)%4,Z=(f+1)%4,S=R[f],P=R[Z],v=C-Math.floor(C),k=G[S],I=G[P],$=Math.round(k.r+(I.r-k.r)*v),A=Math.round(k.g+(I.g-k.g)*v),s=Math.round(k.b+(I.b-k.b)*v);c(`rgb(${$}, ${A}, ${s})`);const h=[0,0,0,0],m=[.85,.85,.85,.85];h[S]=1-v,h[P]=v,m[S]=1-v*.15,m[P]=.85+v*.15,D(h),T(m);const w=Math.round(l/90)%4;_(R[w])},[]),V=t.useCallback(a=>{B(a)},[]);t.useEffect(()=>{const a=new IntersectionObserver(([l])=>u(l.isIntersecting),{threshold:.3});return M.current&&a.observe(M.current),()=>a.disconnect()},[]);const b=t.useMemo(()=>{if(typeof window>"u")return 130;const a=window.innerWidth,l=window.innerHeight,C=a>=768&&l>a,R=a>=1024&&!(a===1024&&l>a);return C||R?130:85},[d]);return e.jsxs("section",{ref:M,className:"relative min-h-0 flex flex-col items-center justify-between py-10 lg:py-24 ipad-portrait:!min-h-screen ipad-portrait:!py-24 overflow-hidden",style:{backgroundColor:r},children:[e.jsx("div",{className:"absolute top-0 left-0 w-full z-30 pointer-events-none rotate-180",children:e.jsx(H,{topColor:"transparent",bottomColor:"#FCE7F3",variant:7})}),e.jsx("div",{className:"absolute bottom-0 left-0 w-full z-30 pointer-events-none",children:e.jsx(H,{topColor:"transparent",bottomColor:"#F0FDF4",variant:1})}),e.jsx(O.div,{initial:{y:-30,opacity:0},whileInView:{y:0,opacity:1},viewport:{once:!0},transition:{delay:.3,duration:.5},className:"text-center w-full px-6 z-10",children:e.jsx("h2",{className:"section-header text-white drop-shadow-lg whitespace-nowrap text-[22px] sm:text-[32px] lg:text-4xl ipad-portrait:!text-[22px]",children:i("checkText.heading")})}),e.jsxs("div",{className:"w-full max-w-5xl mx-auto px-6 flex flex-col lg:flex-row ipad-portrait:!flex-col items-center justify-center gap-4 lg:gap-12 z-10 mt-4 lg:mt-2",children:[e.jsxs(O.div,{initial:{y:-500,opacity:0},animate:o?{y:0,opacity:1}:{y:-500,opacity:0},transition:{type:"spring",stiffness:200,damping:20,delay:.3},onAnimationComplete:()=>{o&&n(!0)},className:"flex flex-col items-center lg:w-[55%] ipad-portrait:!w-full",children:[e.jsx(ie,{onInteraction:()=>{},textFaces:X,labels:j,isActive:p,onRotationChange:N,targetFace:W,hideArrows:!0,size:b}),e.jsx(de,{labels:j,activeIndex:g,onSelect:V})]}),e.jsx("div",{className:"relative w-40 h-40 sm:w-64 sm:h-64 lg:w-[50%] lg:h-96",children:ue.map((a,l)=>e.jsx("img",{src:a,alt:`${j[l]}`,className:"absolute inset-0 w-full h-full object-contain transition-all duration-300 ease-out rounded-2xl",style:{opacity:y[l],transform:`scale(${L[l]})`}},l))})]}),e.jsxs(O.div,{initial:{y:30,opacity:0},whileInView:{y:0,opacity:1},viewport:{once:!0},transition:{delay:.5,duration:.5},className:"text-center max-w-lg px-6 z-10 flex flex-col items-center gap-4 mt-4 lg:mt-0",children:[e.jsx("p",{className:"section-subtext text-white/90 drop-shadow-md text-sm sm:text-base",children:i("checkText.subtext")}),e.jsx(le,{})]})]})};export{be as default};
//# sourceMappingURL=CheckTextSection-COY-6kc8.js.map