{"version":3,"file":"ZodASoCsI.B2ZpIMiY.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/4lPJUInr9BbZwDYdxSgD/MtDBVuDoZ2YXDgn8MBbB/StaggeredTextCycle_Prod.js","https:/framerusercontent.com/modules/N337XogaeeiHiht2ZN9f/pwB48zFyU8FvNKh5lIfY/ZodASoCsI.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";const MAX_SPEED=20;const defaultTransition={// ease: \"power4.out\",\nease:[.11,.72,0,1]};/**\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 200\n *\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function StaggeredTextCycleV2({text,speed,delay,font,userSelect,color,alignment,tag,loop,stagger}){const Tag=tag;const content=text.split(\", \").map(phrase=>phrase.replace(/\\s+/g,\" \").trim());const[iteration,setIteration]=useState(0);const speedFormatted=(MAX_SPEED-speed+1)/MAX_SPEED*5;const delayFormattedMs=delay*1e3;const speedFormattedMs=speedFormatted*1e3;const isCanvas=RenderTarget.current()===RenderTarget.canvas;const[isFirstRender,setIsFirstRender]=useState(true);useEffect(()=>{const timeout=isFirstRender?speedFormattedMs/3+delayFormattedMs:speedFormattedMs+delayFormattedMs;const interval=setInterval(()=>{setIsFirstRender(false);if(iteration<content.length-1){setIteration(prev=>prev+1);}else if(loop){setIteration(0);}},timeout);return()=>clearInterval(interval);},[iteration,loop,isFirstRender]);return /*#__PURE__*/_jsxs(\"div\",{style:{userSelect:userSelect?\"auto\":\"none\",position:\"relative\",display:\"flex\",flexDirection:\"row\",overflow:\"visible\",justifyContent:alignment===\"center\"?\"center\":alignment===\"right\"?\"flex-end\":\"flex-start\"},children:[/*#__PURE__*/_jsx(Tag,{\"aria-hidden\":true,style:{fontSize:\"24px\",...font,marginBlockStart:\"0px\",marginBlockEnd:\"0px\",pointerEvents:\"none\",opacity:0,whiteSpace:\"pre-wrap\",width:\"100%\",textAlign:alignment},children:content.reduce((longest,current)=>current.length>longest.length?current:longest)}),isCanvas&&/*#__PURE__*/_jsx(Tag,{style:{fontSize:\"24px\",...font,color,marginBlockStart:\"0px\",marginBlockEnd:\"0px\",whiteSpace:\"pre-wrap\",position:\"absolute\",top:0,left:0,width:\"100%\",textAlign:alignment},children:content[0]}),!isCanvas&&/*#__PURE__*/_jsx(_Fragment,{children:content.map((sentence,sentenceIndex)=>{let charIndex=0;// Split sentence into segments\nconst segments=sentence.split(/(\\s+|\\b)/).map(segment=>({text:segment,chars:segment.split(\"\").map(char=>({char,originalIndex:charIndex++}))}));console.log(segments);return /*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",top:0,left:0,overflow:\"visible\",width:\"100%\",textAlign:alignment},children:/*#__PURE__*/_jsx(AnimatePresence,{mode:\"sync\",children:iteration===sentenceIndex&&/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",flexWrap:\"wrap\",width:\"100%\",justifyContent:alignment===\"center\"?\"center\":alignment===\"right\"?\"flex-end\":\"flex-start\",gap:0},children:segments.map((segment,segmentIndex)=>/*#__PURE__*/_jsx(\"div\",{style:{display:\"inline-flex\",flexWrap:\"nowrap\",whiteSpace:\"pre\",overflow:\"hidden\"},children:segment.chars.map(({char,originalIndex})=>{const baseDelay=originalIndex/(sentence.length-1);const delayInitial=baseDelay*(speedFormatted*.3)// 30% of speed\n    ;const delayAnimate=baseDelay*(speedFormatted*.4)// 40% of speed\n    ;const delayExit=baseDelay*(speedFormatted*.3)// 30% of speed\n    ;const itemTransition={initial:{transform:`translate(0px, 150%)`,transition:{...defaultTransition,duration:speedFormatted/2,delay:delayInitial*stagger}},animate:{transform:`translate(0px, 0px)`,transition:{...defaultTransition,duration:speedFormatted/2,delay:delayAnimate*stagger}},exit:{transform:`translate(0px, -150%)`,transition:{...defaultTransition,duration:speedFormatted/2,delay:delayExit*stagger}}};return /*#__PURE__*/_jsx(motion.div,{variants:itemTransition,initial:isFirstRender?false:\"initial\",animate:isFirstRender?false:\"animate\",exit:\"exit\",style:{display:\"inline-block\"},children:/*#__PURE__*/_jsx(Tag,{style:{fontSize:\"24px\",...font,color,marginBlockStart:\"0px\",marginBlockEnd:\"0px\",opacity:1},children:char})},sentence+originalIndex);})},segmentIndex))})})},sentenceIndex);})})]});}StaggeredTextCycleV2.displayName=\"Staggered Cycle\";addPropertyControls(StaggeredTextCycleV2,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"DESIGNER, DEVELOPER\",description:\"Divide the words with a comma (,) if you want to display them separately.\"},speed:{type:ControlType.Number,title:\"Speed\",defaultValue:MAX_SPEED/2,min:1,max:MAX_SPEED},delay:{type:ControlType.Number,title:\"Delay\",defaultValue:1,min:0,max:10,unit:\"s\"},stagger:{title:\"Stagger\",description:\"The delay between each word.\",type:ControlType.Number,defaultValue:.5,step:.1,min:0,max:1},font:{title:\"Font\",type:ControlType.Font,controls:\"extended\"},alignment:{type:ControlType.Enum,displaySegmentedControl:true,title:\"Alignment\",defaultValue:\"left\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"]},userSelect:{title:\"User Select\",type:ControlType.Boolean,defaultValue:false},color:{title:\"Color\",type:ControlType.Color,defaultValue:\"#ffffff\"},tag:{type:ControlType.Enum,title:\"Tag\",defaultValue:\"p\",displaySegmentedControl:true,segmentedControlDirection:\"horizontal\",options:[\"h1\",\"h2\",\"h3\",\"p\"],optionTitles:[\"H1\",\"H2\",\"H3\",\"P\"]},loop:{title:\"Loop\",type:ControlType.Boolean,defaultValue:true,description:\"More components at [Framer University](https://frameruni.link/cc).\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"StaggeredTextCycleV2\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerSupportedLayoutHeight\":\"any\",\"framerDisableUnlink\":\"*\",\"framerIntrinsicWidth\":\"400\",\"framerIntrinsicHeight\":\"200\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./StaggeredTextCycle_Prod.map","// Generated by Framer (85eaff3)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,useSVGTemplate,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask=\"var(--framer-icon-mask)\";const Base=/*#__PURE__*/forwardRef(function(props,ref){return /*#__PURE__*/_jsx(\"svg\",{...props,ref:ref,children:props.children});});const MotionSVG=motion.create(Base);const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(MotionSVG,{...rest,layoutId:layoutId,ref:ref,children:children}):/*#__PURE__*/_jsx(\"svg\",{...rest,ref:ref,children:children});});const svg='<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 0 0 L 6 6 L 12 0\" fill=\"transparent\" height=\"6px\" id=\"HLE2KBXxw\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--js9iwy, 2)\" stroke=\"var(--1m973uw, rgb(0,0,0))\" transform=\"translate(6 9)\" width=\"12px\"/></svg>';const getProps=({color,height,id,width,width1,...props})=>{return{...props,JEeZYcamG:width1??props.JEeZYcamG??2,P_DcoRcrY:color??props.P_DcoRcrY??\"rgb(0, 0, 0)\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,P_DcoRcrY,JEeZYcamG,...restProps}=getProps(props);const href=useSVGTemplate(\"4024583230\",svg);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-rjFuH\",className),layoutId:layoutId,ref:ref,role:\"presentation\",style:{\"--1m973uw\":P_DcoRcrY,\"--js9iwy\":JEeZYcamG,...style},viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"use\",{href:href})});});const css=[`.framer-rjFuH { -webkit-mask: ${mask}; aspect-ratio: 1; display: block; mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"P_DcoRcrY\":\"color\",\"JEeZYcamG\":\"width1\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Chevron Down\",\"color\":{\"type\":\"variable\",\"value\":\"1m973uw\"},\"set\":{\"localId\":\"vectorSet/ZsiCCGPvG\",\"id\":\"ZsiCCGPvG\",\"moduleId\":\"Y7SpbVH16cWqMhj75z1M\"}}\n */const Icon=withCSS(Component,css,\"framer-rjFuH\");Icon.displayName=\"Chevron Down\";export default Icon;addPropertyControls(Icon,{P_DcoRcrY:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Color\",type:ControlType.Color},JEeZYcamG:{defaultValue:2,displayStepper:true,hidden:false,max:16,min:1,title:\"Width\",type:ControlType.Number}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerVector\":\"{\\\"name\\\":\\\"Chevron Down\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"1m973uw\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/ZsiCCGPvG\\\",\\\"id\\\":\\\"ZsiCCGPvG\\\",\\\"moduleId\\\":\\\"Y7SpbVH16cWqMhj75z1M\\\"}}\",\"framerVariables\":\"{\\\"P_DcoRcrY\\\":\\\"color\\\",\\\"JEeZYcamG\\\":\\\"width1\\\"}\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"24\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\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