{"version":3,"file":"LiveCodeDeploy.D33BEbCN.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/W5ROT1znBCRrE3Dr3w7k/BEkYFCsy1LYHDSJHhdgt/LiveCodeDeploy.js"],"sourcesContent":["// Live code deployment animation with syntax highlighting\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";import{useState,useEffect,startTransition}from\"react\";/**\n * Live Code Deploy\n * \n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function LiveCodeDeploy(props){const{codeSnippet=`// Paste a code snippet\nimport { motion } from \"framer-motion\";\n\nfunction Component() {\n    return (\n        <motion.div\n            transition={{ ease: \"linear\" }}\n            animate={{ rotate: 360, scale: 2 }}\n        />\n    );\n}`,typingSpeed=30,backgroundColor=\"#1a1a2e\",borderColor=\"#6366f1\",commentColor=\"#6c757d\",keywordColor=\"#4d9fff\",stringColor=\"#a78bfa\",functionColor=\"#fbbf24\",numberColor=\"#f59e0b\",textColor=\"#e5e7eb\",showCursor=true,autoReplay=true,font}=props;const[displayedCode,setDisplayedCode]=useState(\"\");const[currentIndex,setCurrentIndex]=useState(0);const[isComplete,setIsComplete]=useState(false);useEffect(()=>{if(currentIndex<codeSnippet.length){const timeout=setTimeout(()=>{startTransition(()=>{setDisplayedCode(codeSnippet.slice(0,currentIndex+1));setCurrentIndex(currentIndex+1);});},typingSpeed);return()=>clearTimeout(timeout);}else{startTransition(()=>setIsComplete(true));if(autoReplay){const replayTimeout=setTimeout(()=>{startTransition(()=>{setDisplayedCode(\"\");setCurrentIndex(0);setIsComplete(false);});},2e3);return()=>clearTimeout(replayTimeout);}}},[currentIndex,codeSnippet,typingSpeed,autoReplay]);const highlightSyntax=code=>{const lines=code.split(\"\\n\");return lines.map((line,lineIndex)=>{const tokens=[];let currentPos=0;// Comment pattern\nif(line.trim().startsWith(\"//\")){return /*#__PURE__*/_jsx(\"div\",{children:/*#__PURE__*/_jsx(\"span\",{style:{color:commentColor},children:line})},lineIndex);}// Keywords\nconst keywords=/\\b(import|from|function|return|const|let|var|if|else|for|while|class|export|default)\\b/g;// Strings\nconst strings=/([\"'`])((?:\\\\.|(?!\\1).)*?)\\1/g;// Numbers\nconst numbers=/\\b(\\d+)\\b/g;// Function names\nconst functions=/\\b([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*\\(/g;let result=line;const replacements=[];// Find all matches\nlet match;// Keywords (priority 1)\nconst keywordRegex=/\\b(import|from|function|return|const|let|var|if|else|for|while|class|export|default)\\b/g;while((match=keywordRegex.exec(line))!==null){replacements.push({start:match.index,end:match.index+match[0].length,element:/*#__PURE__*/_jsx(\"span\",{style:{color:keywordColor},children:match[0]}),priority:1});}// Strings (priority 2)\nconst stringRegex=/([\"'`])((?:\\\\.|(?!\\1).)*?)\\1/g;while((match=stringRegex.exec(line))!==null){replacements.push({start:match.index,end:match.index+match[0].length,element:/*#__PURE__*/_jsx(\"span\",{style:{color:stringColor},children:match[0]}),priority:2});}// Numbers (priority 3)\nconst numberRegex=/\\b(\\d+)\\b/g;while((match=numberRegex.exec(line))!==null){replacements.push({start:match.index,end:match.index+match[0].length,element:/*#__PURE__*/_jsx(\"span\",{style:{color:numberColor},children:match[0]}),priority:3});}// Functions (priority 4)\nconst functionRegex=/\\b([a-zA-Z_$][a-zA-Z0-9_$]*)\\s*\\(/g;while((match=functionRegex.exec(line))!==null){const funcName=match[1];replacements.push({start:match.index,end:match.index+funcName.length,element:/*#__PURE__*/_jsx(\"span\",{style:{color:functionColor},children:funcName}),priority:4});}// Sort by position and priority\nreplacements.sort((a,b)=>{if(a.start!==b.start)return a.start-b.start;return b.priority-a.priority;});// Remove overlapping matches (keep higher priority)\nconst filtered=[];for(const replacement of replacements){const overlaps=filtered.some(existing=>replacement.start>=existing.start&&replacement.start<existing.end||replacement.end>existing.start&&replacement.end<=existing.end);if(!overlaps){filtered.push(replacement);}}// Build the line with syntax highlighting\nconst parts=[];let lastEnd=0;filtered.forEach((replacement,idx)=>{if(replacement.start>lastEnd){parts.push(/*#__PURE__*/_jsx(\"span\",{style:{color:textColor},children:line.slice(lastEnd,replacement.start)},`text-${idx}`));}parts.push(/*#__PURE__*/_jsx(\"span\",{children:replacement.element},`highlight-${idx}`));lastEnd=replacement.end;});if(lastEnd<line.length){parts.push(/*#__PURE__*/_jsx(\"span\",{style:{color:textColor},children:line.slice(lastEnd)},\"text-end\"));}return /*#__PURE__*/_jsx(\"div\",{children:parts.length>0?parts:/*#__PURE__*/_jsx(\"span\",{style:{color:textColor},children:line})},lineIndex);});};return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",backgroundColor,border:`1px solid ${borderColor}`,borderRadius:8,padding:24,overflow:\"auto\",position:\"relative\",...font},children:/*#__PURE__*/_jsxs(\"pre\",{style:{margin:0,fontFamily:font.fontFamily||\"monospace\",fontSize:font.fontSize||14,lineHeight:font.lineHeight||\"1.6em\",whiteSpace:\"pre-wrap\",wordBreak:\"break-word\"},children:[highlightSyntax(displayedCode),showCursor&&!isComplete&&/*#__PURE__*/_jsx(motion.span,{animate:{opacity:[1,0]},transition:{duration:.5,repeat:Infinity,repeatType:\"reverse\"},style:{color:textColor,marginLeft:2},children:\"|\"})]})});}addPropertyControls(LiveCodeDeploy,{codeSnippet:{type:ControlType.String,title:\"Code Snippet\",displayTextArea:true,defaultValue:`// Paste a code snippet\nimport { motion } from \"framer-motion\";\n\nfunction Component() {\n    return (\n        <motion.div\n            transition={{ ease: \"linear\" }}\n            animate={{ rotate: 360, scale: 2 }}\n        />\n    );\n}`},typingSpeed:{type:ControlType.Number,title:\"Typing Speed\",defaultValue:30,min:10,max:200,step:10,unit:\"ms\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#1a1a2e\"},borderColor:{type:ControlType.Color,title:\"Border\",defaultValue:\"#6366f1\"},commentColor:{type:ControlType.Color,title:\"Comment Color\",defaultValue:\"#6c757d\"},keywordColor:{type:ControlType.Color,title:\"Keyword Color\",defaultValue:\"#4d9fff\"},stringColor:{type:ControlType.Color,title:\"String Color\",defaultValue:\"#a78bfa\"},functionColor:{type:ControlType.Color,title:\"Function Color\",defaultValue:\"#fbbf24\"},numberColor:{type:ControlType.Color,title:\"Number Color\",defaultValue:\"#f59e0b\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#e5e7eb\"},showCursor:{type:ControlType.Boolean,title:\"Show Cursor\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"},autoReplay:{type:ControlType.Boolean,title:\"Auto Replay\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"monospace\",defaultValue:{fontSize:14,lineHeight:\"1.6em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LiveCodeDeploy\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LiveCodeDeploy.map"],"mappings":"2OAMG,SAAwB,EAAe,EAAM,CAAC,GAAK,CAAC,cAAY;;;;;;;;;;GAUhE,cAAY,GAAG,kBAAgB,UAAU,cAAY,UAAU,eAAa,UAAU,eAAa,UAAU,cAAY,UAAU,gBAAc,UAAU,cAAY,UAAU,YAAU,UAAU,aAAW,GAAK,aAAW,GAAK,QAAM,EAAW,CAAC,EAAc,GAAkBA,EAAS,GAAG,CAAM,CAAC,EAAa,GAAiBA,EAAS,EAAE,CAAM,CAAC,EAAW,GAAeA,EAAS,GAAM,CAAC,MAAc,CAAC,GAAG,EAAa,EAAY,OAAO,CAAC,IAAM,EAAQ,eAAe,CAAC,MAAoB,CAAC,EAAiB,EAAY,MAAM,EAAE,EAAa,EAAE,CAAC,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