{"version":3,"file":"ScrambleText.UlR_QOC8.mjs","names":["React.useRef","React.useState","Tag","React.startTransition","__esmMin","init_ssg_sandbox_shims","te","window","_e","de","p","c","init_jsx_runtime","init_npm_react_18_3_1","ce","useReducedMotion","useInView","init_framer_motion_DhsWWWsN","addPropertyControls","ControlType","useIsStaticRenderer","init_framer_BL70qLPA","ScrambleText","props","isStatic","reduce","animated","ref","inView","out","setOut","text","run","setRun","r","steps","duration","frame","id","reveal","i","ch","GLYPHS","tag","prefix","hover","MONO","size","uppercase","prefixColor","init_ScrambleText"],"sources":["https:/framerusercontent.com/modules/hgv1NCdIb3tOcb2LNv2M/uMSv1DahptWYFrqbstGB/ScrambleText.js"],"sourcesContent":["// Scramble Text: a mono label that decodes from random glyphs to its text\n// when it scrolls into view (and again on hover if enabled). Used for\n// section labels, eyebrow lines and small system readouts.\n// Reduced motion and the canvas show the final text.\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";import{useInView,useReducedMotion}from\"framer-motion\";const MONO=\"'Martian Mono', ui-monospace, SFMono-Regular, Menlo, monospace\";const GLYPHS=\"#%&*+=-/<>[]01X\";/**\n * @framerIntrinsicWidth 240\n * @framerIntrinsicHeight 18\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n */export default function ScrambleText(props){const{text=\"Automation that ships\",prefix=\"[01]\",color=\"#0E1111\",prefixColor=\"#2B45FF\",size=11,uppercase=true,hover=true,duration=700,tag=\"p\"}=props;const isStatic=useIsStaticRenderer();const reduce=useReducedMotion();const animated=!isStatic&&!reduce;const ref=React.useRef(null);const inView=useInView(ref,{once:true,margin:\"0px 0px -8% 0px\"});const[out,setOut]=React.useState(text);const[run,setRun]=React.useState(0);React.useEffect(()=>{if(animated&&inView)React.startTransition(()=>setRun(r=>r+1));},[animated,inView]);React.useEffect(()=>{if(!animated||run===0){React.startTransition(()=>setOut(text));return;}const steps=Math.max(8,Math.round(duration/32));let frame=0;const id=window.setInterval(()=>{frame++;const reveal=Math.floor(frame/steps*text.length);let s=\"\";for(let i=0;i<text.length;i++){const ch=text[i];if(ch===\" \"||i<reveal)s+=ch;else s+=GLYPHS[(i*5+frame*7)%GLYPHS.length];}React.startTransition(()=>setOut(s));if(frame>=steps){window.clearInterval(id);React.startTransition(()=>setOut(text));}},32);return()=>window.clearInterval(id);},[run,text,animated,duration]);const Tag=tag;return /*#__PURE__*/_jsx(Tag,{ref:ref,\"aria-label\":(prefix?prefix+\" \":\"\")+text,onMouseEnter:hover&&animated?()=>React.startTransition(()=>setRun(r=>r+1)):undefined,style:{...props.style,position:\"relative\",margin:0,fontFamily:MONO,fontWeight:400,fontSize:size,lineHeight:1.5,letterSpacing:\"0.02em\",textTransform:uppercase?\"uppercase\":\"none\",color,whiteSpace:\"pre-wrap\",fontVariantLigatures:\"none\"},children:/*#__PURE__*/_jsxs(\"span\",{\"aria-hidden\":\"true\",children:[prefix?/*#__PURE__*/_jsx(\"span\",{style:{color:prefixColor,marginRight:\"1ch\"},children:prefix}):null,out]})});}addPropertyControls(ScrambleText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Automation that ships\"},prefix:{type:ControlType.String,title:\"Prefix\",defaultValue:\"[01]\"},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#0E1111\"},prefixColor:{type:ControlType.Color,title:\"Prefix color\",defaultValue:\"#2B45FF\"},size:{type:ControlType.Number,title:\"Size\",min:9,max:32,step:1,unit:\"px\",defaultValue:11},uppercase:{type:ControlType.Boolean,title:\"Uppercase\",defaultValue:true},hover:{type:ControlType.Boolean,title:\"Replay on hover\",defaultValue:true},duration:{type:ControlType.Number,title:\"Duration\",min:200,max:2e3,step:50,unit:\"ms\",defaultValue:700},tag:{type:ControlType.Enum,title:\"Tag\",options:[\"p\",\"span\",\"h2\",\"h3\"],defaultValue:\"p\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ScrambleText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"240\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicHeight\":\"18\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ScrambleText.map"],"mappings":"A,oRASG,SAAwBsB,EAAa,EAAM,CAAC,GAAK,CAAC,OAAK,wBAAwB,SAAO,OAAO,QAAM,UAAU,cAAY,UAAU,OAAK,GAAG,YAAU,GAAK,QAAM,GAAK,WAAS,IAAI,MAAI,KAAKC,EAAYC,EAASJ,EAAoB,EAAQK,EAAOV,EAAiB,EAAQW,EAAS,CAACF,GAAU,CAACC,EAAaE,EAAI3B,EAAa,IAAI,EAAQ4B,EAAOZ,EAAUW,EAAI,CAAC,KAAK,GAAK,OAAO,iBAAiB,CAAC,EAAO,CAACE,EAAIC,GAAQ7B,EAAe8B,CAAI,EAAO,CAACC,EAAIC,GAAQhC,EAAe,CAAC,EAA6qB,OAA3qBa,MAAoB,CAAIY,GAAUE,GAAOtB,MAA0B2B,EAAO,GAAGC,EAAE,CAAC,CAAC,CAAE,EAAE,CAACR,EAASE,CAAM,CAAC,EAAEd,MAAoB,CAAC,GAAG,CAACY,GAAUM,IAAM,EAAE,CAAC1B,MAA0BwB,EAAOC,CAAI,CAAC,EAAE,MAAO,CAAC,IAAMI,EAAM,KAAK,IAAI,EAAE,KAAK,MAAMC,EAAS,EAAE,CAAC,EAAMC,EAAM,EAAQC,EAAG/B,EAAO,gBAAgB,CAAC,IAAQ,IAAMgC,EAAO,KAAK,MAAMF,EAAMF,EAAMJ,EAAK,MAAM,EAAM,EAAE,GAAG,IAAI,IAAIS,EAAE,EAAEA,EAAET,EAAK,OAAO,IAAI,CAAC,IAAMU,EAAGV,EAAKS,GAAG,AAAiC,GAA9BC,IAAK,KAAKD,EAAED,EAAUE,EAAWC,GAAQF,EAAE,EAAEH,EAAM,GAA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