import{j as e}from"./query-vendor-CZu0EHPe.js";import{r as s}from"./react-vendor-0bvDbF03.js";import{m as i,A as g}from"./index-CN8ExtXC.js";import{u as w}from"./i18n-vendor-Cl4-lKeC.js";import"./supabase-vendor-CNV44oIa.js";import"./helmet-vendor-NlTFkN97.js";const b="https://cdn.storysparkle.org/landing_assets/left-handle.webp",y="https://cdn.storysparkle.org/landing_assets/right-handle.webp",j="https://cdn.storysparkle.org/landing_assets/parchment.webp",N=({children:x,className:v=""})=>{const d=s.useRef(null),a=s.useRef(null),[t,c]=s.useState(!1),[u,f]=s.useState(0);s.useEffect(()=>{const n=()=>{a.current&&f(a.current.offsetWidth)};return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[]),s.useEffect(()=>{const n=a.current;if(!n)return;const l=new IntersectionObserver(([r])=>{r.isIntersecting&&r.intersectionRatio>.4&&c(!0)},{threshold:[.4,.5,.6]});return l.observe(n),()=>l.disconnect()},[]),s.useEffect(()=>{const n=a.current;if(!n)return;const l=new IntersectionObserver(([r])=>{r.isIntersecting||c(!1)},{threshold:[.2]});return l.observe(n),()=>l.disconnect()},[]);const p=u*.6,m=u*.4,o={type:"spring",stiffness:200,damping:18,mass:1.2};return e.jsx("div",{ref:d,className:`relative flex items-center justify-center ${v} overflow-visible`,children:e.jsxs("div",{ref:a,className:"relative w-full max-w-md aspect-square flex items-center justify-center overflow-visible",children:[e.jsx(i.div,{initial:!1,animate:{width:t?"80%":"10%",opacity:t?.4:.1},transition:o,className:"absolute bottom-2 h-4 bg-black rounded-full blur-xl z-0"}),e.jsx(i.div,{initial:!1,animate:{scaleX:t?1:0,opacity:t?1:0},transition:o,className:"absolute inset-[0%] z-0 overflow-hidden",style:{backgroundImage:`url(${j})`,backgroundSize:"100% 100%",backgroundRepeat:"no-repeat",backgroundPosition:"center"},children:e.jsx(g,{children:t&&e.jsx(i.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{delay:.3,duration:.3},className:"absolute inset-[8%] overflow-hidden rounded-lg",children:x})})}),e.jsx(i.div,{initial:!1,animate:{x:t?-p:0,rotate:t?0:3},transition:o,className:"absolute left-1/2 top-1/2 z-10 pointer-events-none drop-shadow-[8px_8px_12px_rgba(0,0,0,0.4)]",style:{width:"6%",height:"110%",marginLeft:"-6%",marginTop:"-55%"},children:e.jsx("img",{src:b,alt:"Scroll handle decoration",role:"presentation",className:"h-full w-auto max-w-none"})}),e.jsx(i.div,{initial:!1,animate:{x:t?m:0,rotate:t?0:-3},transition:o,className:"absolute left-1/2 top-1/2 z-10 pointer-events-none drop-shadow-[-8px_8px_12px_rgba(0,0,0,0.4)]",style:{width:"6%",height:"110%",marginLeft:"0%",marginTop:"-55%"},children:e.jsx("img",{src:y,alt:"Scroll handle decoration",role:"presentation",className:"h-full w-auto max-w-none"})})]})})},I="https://cdn.storysparkle.org/landing_assets/interactive-words-demo.mp4",H=({videoSrc:x,onVideoUpload:v,onLumiTarget:d,isWordHovered:a=!1})=>{const t=s.useRef(null),c=s.useRef(null),[u,f]=s.useState(!1),[p,m]=s.useState(!1),{t:o}=w("landing"),n=a||u;s.useEffect(()=>{const r=new IntersectionObserver(([h])=>{h.isIntersecting&&!p&&c.current&&(m(!0),d?.(c.current))},{threshold:.5});return t.current&&r.observe(t.current),()=>r.disconnect()},[p,d]),s.useEffect(()=>{const r=new IntersectionObserver(([h])=>{h.isIntersecting||m(!1)},{threshold:0});return t.current&&r.observe(t.current),()=>r.disconnect()},[]);const l=I;return e.jsx("section",{ref:t,className:"min-h-screen flex items-center justify-center py-16 md:py-24",style:{background:"#FFECD2"},children:e.jsxs("div",{className:"container mx-auto px-6 flex flex-col items-center",children:[e.jsxs(i.h2,{className:"section-header text-[22px] lg:text-[32px] text-center mb-6",initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},children:[e.jsx(i.span,{ref:c,"data-lumi-interactive":!0,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),animate:{color:n?"#BF0404":"inherit",y:n?-4:0,scale:n?1.05:1},transition:{type:"spring",stiffness:300,damping:15},className:"inline-block cursor-pointer",style:{fontStyle:n?"italic":"normal"},children:o("interactiveWords.interactive")})," ",o("interactiveWords.words")]}),e.jsx(i.p,{className:"section-subtext text-sm lg:text-xl text-center max-w-2xl mb-10",initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6,delay:.2},children:o("interactiveWords.subtext")}),e.jsx(i.div,{className:"w-full max-w-xl",initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6,delay:.4},children:e.jsx(N,{children:e.jsx("video",{src:l,muted:!0,playsInline:!0,loop:!0,autoPlay:!0,className:"w-full h-full object-cover rounded-lg"})})})]})})};export{H as default};
//# sourceMappingURL=InteractiveWordsSection-CyNIVrqJ.js.map