{"version":3,"file":"TypingAnimation.BLQdrPHc.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/IHE1GCnK2CtD9geQ6W2z/QxCS4WuFSRL8u0HZPxA9/TypingAnimation.js"],"sourcesContent":["// Typing animation that types \"English\", erases it, then types \"Arabic\" in Arabic script, looping continuously\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,startTransition}from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * Typing Animation\n *\n * @framerIntrinsicWidth 300\n * @framerIntrinsicHeight 60\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function TypingAnimation(props){const{englishText=\"English\",arabicText=\"Arabic\",typingSpeed=150,erasingSpeed=100,pauseDuration=2e3,textColor=\"#000000\",font,style}=props;const[displayText,setDisplayText]=useState(\"\");const[isTyping,setIsTyping]=useState(true);const[currentPhase,setCurrentPhase]=useState(\"english\");const isStatic=useIsStaticRenderer();useEffect(()=>{if(isStatic){startTransition(()=>setDisplayText(englishText));return;}let timeoutId;const animate=()=>{if(currentPhase===\"english\"){if(displayText.length<englishText.length){timeoutId=window.setTimeout(()=>{startTransition(()=>{setDisplayText(englishText.slice(0,displayText.length+1));});},typingSpeed);}else{timeoutId=window.setTimeout(()=>{startTransition(()=>{setIsTyping(false);setCurrentPhase(\"erasing\");});},pauseDuration);}}else if(currentPhase===\"erasing\"){if(displayText.length>0){timeoutId=window.setTimeout(()=>{startTransition(()=>{setDisplayText(displayText.slice(0,-1));});},erasingSpeed);}else{startTransition(()=>{setIsTyping(true);setCurrentPhase(\"arabic\");});}}else if(currentPhase===\"arabic\"){if(displayText.length<arabicText.length){timeoutId=window.setTimeout(()=>{startTransition(()=>{setDisplayText(arabicText.slice(0,displayText.length+1));});},typingSpeed);}else{timeoutId=window.setTimeout(()=>{startTransition(()=>{setIsTyping(false);setCurrentPhase(\"erasingArabic\");});},pauseDuration);}}else if(currentPhase===\"erasingArabic\"){if(displayText.length>0){timeoutId=window.setTimeout(()=>{startTransition(()=>{setDisplayText(displayText.slice(0,-1));});},erasingSpeed);}else{startTransition(()=>{setIsTyping(true);setCurrentPhase(\"english\");});}}};animate();return()=>{if(timeoutId){clearTimeout(timeoutId);}};},[displayText,currentPhase,englishText,arabicText,typingSpeed,erasingSpeed,pauseDuration,isStatic]);return /*#__PURE__*/_jsxs(\"div\",{style:{...style,position:\"relative\",display:\"inline-flex\",alignItems:\"center\",minWidth:\"max-content\"},children:[/*#__PURE__*/_jsxs(\"span\",{style:{color:textColor,...font,whiteSpace:\"nowrap\"},children:[displayText,/*#__PURE__*/_jsx(\"span\",{style:{opacity:isTyping?1:0,animation:isStatic?\"none\":\"blink 1s step-end infinite\",marginLeft:\"2px\"},children:\"|\"})]}),!isStatic&&/*#__PURE__*/_jsx(\"style\",{children:`\n                        @keyframes blink {\n                            0%, 50% { opacity: 1; }\n                            51%, 100% { opacity: 0; }\n                        }\n                    `})]});}addPropertyControls(TypingAnimation,{englishText:{type:ControlType.String,title:\"English Text\",defaultValue:\"English\"},arabicText:{type:ControlType.String,title:\"Arabic Text\",defaultValue:\"عربي\"},typingSpeed:{type:ControlType.Number,title:\"Typing Speed\",defaultValue:150,min:50,max:500,step:10,unit:\"ms\"},erasingSpeed:{type:ControlType.Number,title:\"Erasing Speed\",defaultValue:100,min:50,max:500,step:10,unit:\"ms\"},pauseDuration:{type:ControlType.Number,title:\"Pause Duration\",defaultValue:2e3,min:500,max:5e3,step:100,unit:\"ms\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"40px\",variant:\"Bold\",letterSpacing:\"-0.04em\",lineHeight:\"1em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TypingAnimation\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerIntrinsicHeight\":\"60\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicWidth\":\"300\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TypingAnimation.map"],"mappings":"2MASG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,cAAY,UAAU,aAAW,SAAS,cAAY,IAAI,eAAa,IAAI,gBAAc,IAAI,YAAU,UAAU,OAAK,SAAO,EAAW,CAAC,EAAY,GAAgBA,EAAS,EAAE,EAAO,CAAC,EAAS,GAAaA,EAAS,EAAI,EAAO,CAAC,EAAa,GAAiBA,EAAS,SAAS,EAAQ,EAAS,EAAoB,EAA86C,OAA56C,MAAc,CAAC,GAAG,EAAS,CAAC,MAAoB,EAAe,CAAW,CAAC,EAAE,MAAO,CAAC,IAAI,EAA0rC,OAA1pC,IAAe,UAAW,AAAkL,EAA/K,EAAY,OAAO,EAAY,OAAkB,EAAO,eAAe,CAAC,MAAoB,CAAC,EAAe,EAAY,MAAM,EAAE,EAAY,OAAO,CAAC,CAAC,CAAE,CAAC,CAAE,EAAE,CAAW,EAAkB,EAAO,eAAe,CAAC,MAAoB,CAAC,EAAY,EAAK,EAAE,EAAgB,SAAS,CAAE,CAAC,CAAE,EAAE,CAAa,EAAY,IAAe,UAAc,EAAY,OAAO,EAAG,EAAU,EAAO,eAAe,CAAC,MAAoB,CAAC,EAAe,EAAY,MAAM,EAAE,EAAE,CAAC,CAAE,CAAC,CAAE,EAAE,CAAY,EAAQ,MAAoB,CAAC,EAAY,EAAI,EAAE,EAAgB,QAAQ,CAAE,CAAC,EAAY,IAAe,SAAU,AAAgL,EAA7K,EAAY,OAAO,EAAW,OAAkB,EAAO,eAAe,CAAC,MAAoB,CAAC,EAAe,EAAW,MAAM,EAAE,EAAY,OAAO,CAAC,CAAC,CAAE,CAAC,CAAE,EAAE,CAAW,EAAkB,EAAO,eAAe,CAAC,MAAoB,CAAC,EAAY,EAAK,EAAE,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