{"version":3,"file":"Typescript.tcOKCrc2.mjs","names":["useState","useRef","__esmMin","init_npm_react_18_3_1","te","window","init_ssg_sandbox_shims","ce","init_jsx_runtime","p","_e","de","motion","init_framer_motion_DhsWWWsN","addPropertyControls","RenderTarget","init_framer_DKWANagr","ControlType","Typescript","props","isOnCanvas","isClient","setIsClient","displayText","setDisplayText","currentIndex","setCurrentIndex","isDeleting","setIsDeleting","currentTextIndex","setCurrentTextIndex","timeoutRef","texts","currentFullText","isSingleText","prev","speed","loop","waitTime","deleteSpeed","nextIndex","alignMap","containerStyle","style","alignment","textLineStyle","font","hasContent","prefix","prefixColor","typedColor","showCursor","cursorColor","cursorChar","init_Typescript"],"sources":["https:/framerusercontent.com/modules/2o0eqTBbfN8wtn0THoPk/PuX1eIM5Sfns3BMdqgMO/Typescript.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useState,useEffect,useRef,startTransition}from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * @framerDisableUnlink\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 80\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function Typescript(props){const{prefix,texts,speed,deleteSpeed,waitTime,loop,showCursor,cursorChar,prefixColor,typedColor,cursorColor,font,alignment,style}=props;const isOnCanvas=RenderTarget.current()===RenderTarget.canvas;const[isClient,setIsClient]=useState(false);const[displayText,setDisplayText]=useState(\"\");const[currentIndex,setCurrentIndex]=useState(0);const[isDeleting,setIsDeleting]=useState(false);const[currentTextIndex,setCurrentTextIndex]=useState(0);const timeoutRef=useRef(null);useEffect(()=>{startTransition(()=>{setIsClient(true);});},[]);// Reset when texts change\nuseEffect(()=>{if(!isClient)return;startTransition(()=>{setDisplayText(\"\");setCurrentIndex(0);setIsDeleting(false);setCurrentTextIndex(0);});},[isClient,texts]);// Typescript logic — disabled on canvas for performance\nuseEffect(()=>{if(!isClient||isOnCanvas)return;if(!texts||texts.length===0)return;const currentFullText=texts[currentTextIndex]||\"\";const isSingleText=texts.length===1;if(!isDeleting){if(currentIndex<currentFullText.length){timeoutRef.current=window.setTimeout(()=>{startTransition(()=>{setDisplayText(currentFullText.slice(0,currentIndex+1));setCurrentIndex(prev=>prev+1);});},speed);}else{if(isSingleText&&!loop)return;timeoutRef.current=window.setTimeout(()=>{startTransition(()=>{setIsDeleting(true);});},waitTime);}}else{if(currentIndex>0){timeoutRef.current=window.setTimeout(()=>{startTransition(()=>{setDisplayText(currentFullText.slice(0,currentIndex-1));setCurrentIndex(prev=>prev-1);});},deleteSpeed);}else{const nextIndex=(currentTextIndex+1)%texts.length;if(!loop&&nextIndex===0)return;startTransition(()=>{setIsDeleting(false);setCurrentTextIndex(nextIndex);setCurrentIndex(0);setDisplayText(\"\");});}}return()=>{if(timeoutRef.current!==null){window.clearTimeout(timeoutRef.current);}};},[isClient,isOnCanvas,currentIndex,isDeleting,currentTextIndex,texts,speed,deleteSpeed,waitTime,loop]);const alignMap={left:\"flex-start\",center:\"center\",right:\"flex-end\"};const containerStyle={...style,display:\"flex\",flexWrap:\"wrap\",justifyContent:alignMap[alignment]||\"flex-start\",alignItems:\"baseline\",width:\"100%\",minHeight:\"1em\",overflow:\"hidden\",wordBreak:\"break-word\",overflowWrap:\"break-word\"};const textLineStyle={...font,display:\"inline\",whiteSpace:\"pre-wrap\",textAlign:alignment,minWidth:\"max-content\"};const hasContent=prefix&&prefix.length>0||texts&&texts.length>0;// Canvas preview — show static full text\nif(isOnCanvas||!isClient){return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:/*#__PURE__*/_jsxs(\"span\",{style:textLineStyle,children:[prefix&&/*#__PURE__*/_jsxs(\"span\",{style:{color:prefixColor},children:[prefix,\" \"]}),/*#__PURE__*/_jsx(\"span\",{style:{color:typedColor},children:hasContent?texts?.[0]||\"\":\"Add texts to get started\"}),showCursor&&/*#__PURE__*/_jsx(\"span\",{style:{color:cursorColor},children:cursorChar})]})});}return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:/*#__PURE__*/_jsxs(\"span\",{style:textLineStyle,children:[prefix&&/*#__PURE__*/_jsxs(\"span\",{style:{color:prefixColor},children:[prefix,\" \"]}),/*#__PURE__*/_jsx(\"span\",{style:{color:typedColor},children:displayText}),showCursor&&/*#__PURE__*/_jsx(motion.span,{animate:{opacity:[1,0]},transition:{duration:.6,repeat:Infinity,repeatType:\"reverse\",ease:\"easeInOut\"},style:{display:\"inline\",color:cursorColor},children:cursorChar})]})});}Typescript.displayName=\"Typescript\";Typescript.defaultProps={prefix:\"We're born 🌞 to\",texts:[\"create things that matter.\",\"build the future.\",\"design with purpose.\"],speed:50,deleteSpeed:30,waitTime:2e3,loop:true,showCursor:true,cursorChar:\"_\",prefixColor:\"#000000\",typedColor:\"#D4A843\",cursorColor:\"#D4A843\",font:{fontFamily:\"Inter\",fontWeight:500,fontSize:42,lineHeight:\"1.3em\"},alignment:\"left\"};addPropertyControls(Typescript,{prefix:{type:ControlType.String,title:\"Prefix\",defaultValue:\"We're born 🌞 to\",displayTextArea:false,description:\"Static text displayed before the animated portion. Leave empty to show only the typed text.\"},texts:{type:ControlType.Array,title:\"Typed Texts\",defaultValue:[\"create things that matter.\",\"build the future.\",\"design with purpose.\"],control:{type:ControlType.String},description:\"List of texts that will be typed and cycled through. Add multiple entries for a looping effect.\"},speed:{type:ControlType.Number,title:\"Type Speed\",defaultValue:50,min:10,max:200,step:5,unit:\"ms\",description:\"Delay in ms between each character typed. Lower = faster.\"},deleteSpeed:{type:ControlType.Number,title:\"Delete Speed\",defaultValue:30,min:10,max:200,step:5,unit:\"ms\",description:\"Delay in ms between each character deleted. Lower = faster.\"},waitTime:{type:ControlType.Number,title:\"Wait Time\",defaultValue:2e3,min:200,max:1e4,step:100,unit:\"ms\",description:\"How long the full text stays visible before deleting.\"},loop:{type:ControlType.Boolean,title:\"Loop\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\",description:\"When on, cycles through all texts endlessly. When off, stops after the last text.\"},showCursor:{type:ControlType.Boolean,title:\"Cursor\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\",description:\"Toggle the blinking cursor after the typed text.\"},cursorChar:{type:ControlType.String,title:\"Cursor Char\",defaultValue:\"_\",hidden:props=>!props.showCursor,description:'Character used as cursor. Common choices: \"_\", \"|\", \"▌\"'},prefixColor:{type:ControlType.Color,title:\"Prefix Color\",defaultValue:\"#000000\",description:\"Color of the static prefix text.\"},typedColor:{type:ControlType.Color,title:\"Typed Color\",defaultValue:\"#D4A843\",description:\"Color of the animated typed text.\"},cursorColor:{type:ControlType.Color,title:\"Cursor Color\",defaultValue:\"#D4A843\",hidden:props=>!props.showCursor,description:\"Color of the blinking cursor.\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultValue:{fontSize:42,lineHeight:\"1.3em\"},description:\"Applies to both prefix and typed text. Adjust size, weight, and line height here.\"},alignment:{type:ControlType.Enum,title:\"Alignment\",defaultValue:\"left\",options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],displaySegmentedControl:true,description:\"Horizontal text alignment within the component.\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Typescript\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerDisableUnlink\":\"* @framerIntrinsicWidth 600\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"80\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Typescript.map"],"mappings":"A,wQAMG,SAAwBkB,EAAW,EAAM,CAAC,GAAK,CAAC,SAAO,QAAM,QAAM,cAAY,WAAS,OAAK,aAAW,aAAW,cAAY,aAAW,cAAY,OAAK,YAAU,SAAOC,EAAYC,EAAWL,EAAa,QAAQ,IAAIA,EAAa,OAAY,CAACM,EAASC,GAAatB,EAAS,EAAK,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