{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/P5CIRT7A8zh4LGZTEYNm/RWaL3QAV1mwXQKPwmmtU/TextFlap.js"],
  "sourcesContent": ["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function ScrambleText(props){const isCanvas=RenderTarget.current()===RenderTarget.canvas;const[displayText,setDisplayText]=useState(props.words[0]);const[currentIndex,setCurrentIndex]=useState(0);const chars=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";// For canvas, just render the first word without animations\nif(isCanvas){return /*#__PURE__*/_jsx(\"div\",{style:{...props.font,color:props.color},children:props.words[0]});}// Handle word cycling\nuseEffect(()=>{const wordInterval=setInterval(()=>{setCurrentIndex(prev=>(prev+1)%props.words.length);},(props.animationDuration+props.pauseDuration)*1e3);return()=>clearInterval(wordInterval);},[props.words,props.animationDuration,props.pauseDuration]);// Handle scramble effect\nuseEffect(()=>{const targetWord=props.words[currentIndex];let iterations=0;const scrambleInterval=setInterval(()=>{setDisplayText(()=>{const progress=iterations/(props.animationDuration*20);return targetWord.split(\"\").map((letter,index)=>{if(progress>=index/targetWord.length){return letter;}return chars[Math.floor(Math.random()*chars.length)];}).join(\"\");});if(iterations>props.animationDuration*20){clearInterval(scrambleInterval);}iterations++;},50);return()=>clearInterval(scrambleInterval);},[currentIndex,props.words,props.animationDuration]);return /*#__PURE__*/_jsx(\"div\",{style:{...props.font,color:props.color},children:displayText});}ScrambleText.defaultProps={words:[\"Hello\",\"World\",\"Framer\"],animationDuration:1.5,pauseDuration:1,color:\"#000000\"};addPropertyControls(ScrambleText,{words:{type:ControlType.Array,control:{type:ControlType.String},defaultValue:[\"Hello\",\"World\",\"Framer\"],title:\"Words\"},animationDuration:{type:ControlType.Number,min:.1,max:5,step:.1,defaultValue:1.5,title:\"Animation\"},pauseDuration:{type:ControlType.Number,min:.1,max:5,step:.1,defaultValue:1,title:\"Pause\"},color:{type:ControlType.Color,title:\"Color\"},font:{type:ControlType.Font,controls:\"extended\",title:\"Font\",description:\"v1.0 \\n[via SegmentUI](https://www.segmentUI.com)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrambleText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"*\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TextFlap.map"],
  "mappings": "8GAKkB,SAARA,EAA8BC,EAAM,CAAC,IAAMC,EAASC,EAAa,QAAQ,IAAIA,EAAa,OAAY,CAACC,EAAYC,CAAc,EAAEC,EAASL,EAAM,MAAM,CAAC,CAAC,EAAO,CAACM,EAAaC,CAAe,EAAEF,EAAS,CAAC,EAAQG,EAAM,uDAClO,OAAGP,EAA8BQ,EAAK,MAAM,CAAC,MAAM,CAAC,GAAGT,EAAM,KAAK,MAAMA,EAAM,KAAK,EAAE,SAASA,EAAM,MAAM,CAAC,CAAC,CAAC,GAC7GU,EAAU,IAAI,CAAC,IAAMC,EAAa,YAAY,IAAI,CAACJ,EAAgBK,IAAOA,EAAK,GAAGZ,EAAM,MAAM,MAAM,CAAE,GAAGA,EAAM,kBAAkBA,EAAM,eAAe,GAAG,EAAE,MAAM,IAAI,cAAcW,CAAY,CAAE,EAAE,CAACX,EAAM,MAAMA,EAAM,kBAAkBA,EAAM,aAAa,CAAC,EAC5PU,EAAU,IAAI,CAAC,IAAMG,EAAWb,EAAM,MAAMM,CAAY,EAAMQ,EAAW,EAAQC,EAAiB,YAAY,IAAI,CAACX,EAAe,IAAI,CAAC,IAAMY,EAASF,GAAYd,EAAM,kBAAkB,IAAI,OAAOa,EAAW,MAAM,EAAE,EAAE,IAAI,CAACI,EAAOC,IAAYF,GAAUE,EAAML,EAAW,OAAeI,EAAeT,EAAM,KAAK,MAAM,KAAK,OAAO,EAAEA,EAAM,MAAM,CAAC,CAAG,EAAE,KAAK,EAAE,CAAE,CAAC,EAAKM,EAAWd,EAAM,kBAAkB,IAAI,cAAce,CAAgB,EAAGD,GAAa,EAAE,EAAE,EAAE,MAAM,IAAI,cAAcC,CAAgB,CAAE,EAAE,CAACT,EAAaN,EAAM,MAAMA,EAAM,iBAAiB,CAAC,EAAsBS,EAAK,MAAM,CAAC,MAAM,CAAC,GAAGT,EAAM,KAAK,MAAMA,EAAM,KAAK,EAAE,SAASG,CAAW,CAAC,EAAE,CAACJ,EAAa,aAAa,CAAC,MAAM,CAAC,QAAQ,QAAQ,QAAQ,EAAE,kBAAkB,IAAI,cAAc,EAAE,MAAM,SAAS,EAAEoB,EAAoBpB,EAAa,CAAC,MAAM,CAAC,KAAKqB,EAAY,MAAM,QAAQ,CAAC,KAAKA,EAAY,MAAM,EAAE,aAAa,CAAC,QAAQ,QAAQ,QAAQ,EAAE,MAAM,OAAO,EAAE,kBAAkB,CAAC,KAAKA,EAAY,OAAO,IAAI,GAAG,IAAI,EAAE,KAAK,GAAG,aAAa,IAAI,MAAM,WAAW,EAAE,cAAc,CAAC,KAAKA,EAAY,OAAO,IAAI,GAAG,IAAI,EAAE,KAAK,GAAG,aAAa,EAAE,MAAM,OAAO,EAAE,MAAM,CAAC,KAAKA,EAAY,MAAM,MAAM,OAAO,EAAE,KAAK,CAAC,KAAKA,EAAY,KAAK,SAAS,WAAW,MAAM,OAAO,YAAY;AAAA,2CAAmD,CAAC,CAAC",
  "names": ["ScrambleText", "props", "isCanvas", "RenderTarget", "displayText", "setDisplayText", "ye", "currentIndex", "setCurrentIndex", "chars", "p", "ue", "wordInterval", "prev", "targetWord", "iterations", "scrambleInterval", "progress", "letter", "index", "addPropertyControls", "ControlType"]
}
