{"version":3,"file":"LinkButton.CSMv5VCP.mjs","names":["useRef","useState","SplitType","u","_Fragment"],"sources":["https:/framerusercontent.com/modules/XLYWTrn04OI0dDG2oGvG/BLhwXuMuKsOybN7MCDsC/LinkButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useEffect,useLayoutEffect,useRef,useState}from\"react\";import gsap from\"gsap\";import SplitType from\"split-type\";function getNavType(){try{var n=window[\"performance\"]?.[\"getEntriesByType\"]?.(\"navigation\")?.[0];return n?.[\"type\"]||\"navigate\";}catch(e){return\"navigate\";}}function hasFlag(){try{return window[\"sessionStorage\"]?.[\"getItem\"](\"opencode_loading_shown\")===\"1\";}catch(e){return false;}}var MODE_MAP={lines:\"lines\",words:\"words\",letters:\"chars\"};export function LinkButton({text=\"\",textStyle={},revealMode=\"lines\",animDuration=.6,animStagger=.1,underline=false,underlineType=\"invisible\",link=\"\",animateOn=\"loading\"}){var containerRef=useRef(null);var splitRef=useRef(null);var animatedRef=useRef(false);var shouldAnimRef=useRef(true);var[ready,setReady]=useState(false);var[loadingDone,setLoadingDone]=useState(false);useLayoutEffect(function(){var r=requestAnimationFrame(function(){setReady(true);});return function(){cancelAnimationFrame(r);};},[]);useEffect(function(){var hf=hasFlag();var nt=getNavType();if(nt===\"navigate\"&&hf||nt===\"back_forward\"){shouldAnimRef.current=animateOn===\"always\";setLoadingDone(true);return;}shouldAnimRef.current=true;if(hf||nt===\"reload\"){setLoadingDone(true);return;}var killed=false;function poll(){if(!killed){if(hasFlag()){setLoadingDone(true);}else{setTimeout(poll,100);}}}var t=setTimeout(function(){if(!killed)setLoadingDone(true);},12e3);poll();return function(){killed=true;clearTimeout(t);};},[]);useLayoutEffect(function(){if(!ready||!loadingDone||!containerRef.current||animatedRef.current)return;if(splitRef.current){splitRef.current.revert();splitRef.current=null;}var type=MODE_MAP[revealMode]||\"lines\";var split=new SplitType(containerRef.current,{types:type});splitRef.current=split;var sel=type===\"lines\"?\".line\":type===\"words\"?\".word\":\".char\";var els=containerRef.current.querySelectorAll(sel);if(!els.length)return;var isL=type===\"lines\";var tag=isL?\"div\":\"span\";els.forEach(function(el){if(!isL){el.style.display=\"inline-block\";}el.style.padding=\"0 1px\";el.style.verticalAlign=\"top\";var m=document.createElement(tag);m.style.overflow=\"hidden\";m.style.position=\"relative\";m.style.margin=\"0 -1px\";if(!isL){m.style.display=\"inline-block\";m.style.verticalAlign=\"top\";}el.parentNode.insertBefore(m,el);m.appendChild(el);});animatedRef.current=true;var t=containerRef.current.querySelectorAll(sel);if(t.length&&shouldAnimRef.current){gsap.set(t,{yPercent:102,force3D:false});gsap.to(t,{yPercent:0,duration:animDuration,stagger:animStagger,ease:\"power3.out\",delay:.16,force3D:false});}// Animate visible underline on entry (sync with loading)\nif(underline&&underlineType===\"visible\"){var underTimer=setTimeout(function(){var wrapper=containerRef.current&&containerRef.current.parentElement;if(wrapper){var us=wrapper.querySelectorAll(\"u\");if(us.length>1){us[0].style.transition=\"none\";us[0].style.transform=\"translateX(0%)\";us[0].style.opacity=\"1\";us[1].style.transition=\"none\";us[1].style.transform=\"translateX(-160%)\";us[1].style.opacity=\"1\";void us[0].offsetHeight;us[0].style.transition=\"transform 0.8s cubic-bezier(0.42,0,0.58,1)\";us[0].style.transform=\"translateX(160%)\";us[1].style.transition=\"transform 0.8s cubic-bezier(0.42,0,0.58,1)\";us[1].style.transform=\"translateX(0%)\";}}},300);return function(){clearTimeout(underTimer);if(splitRef.current){splitRef.current.revert();splitRef.current=null;}};}return function(){if(splitRef.current){splitRef.current.revert();splitRef.current=null;}};},[ready,loadingDone,revealMode,animDuration,animStagger]);if(!text){return /*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"center\",height:\"100%\",fontFamily:\"Inter, sans-serif\",fontSize:14,color:\"#9ca3af\",textAlign:\"center\",padding:40},children:\"Type text in the right panel\"});}var baseStyle={fontFamily:\"Inter, sans-serif\",color:\"#fff\",...textStyle||{},lineHeight:1,whiteSpace:\"pre-wrap\",verticalAlign:\"top\"};var textColor=textStyle&&textStyle.color||\"#fff\";var rawFs=textStyle&&textStyle.fontSize;var fs=typeof rawFs===\"number\"?rawFs:Number(String(rawFs).replace(/[^0-9.-]/g,\"\"))||16;var underH=Math.max(1,Math.round(fs*.07));var underProps=underline?{onMouseEnter:function(e){var us=e.currentTarget.querySelectorAll(\"u\");if(underlineType===\"invisible\"&&us.length){var u=us[0];u.style.transition=\"none\";u.style.transform=\"translateX(-101%)\";void u.offsetHeight;u.style.transition=\"transform 0.8s cubic-bezier(0.42,0,0.58,1)\";u.style.transform=\"translateX(0%)\";}else if(underlineType===\"visible\"&&us.length>1){us[0].style.transition=\"none\";us[0].style.transform=\"translateX(0%)\";us[0].style.opacity=\"1\";us[1].style.transition=\"none\";us[1].style.transform=\"translateX(-160%)\";us[1].style.opacity=\"1\";void us[0].offsetHeight;us[0].style.transition=\"transform 0.8s cubic-bezier(0.42,0,0.58,1)\";us[0].style.transform=\"translateX(160%)\";us[1].style.transition=\"transform 0.8s cubic-bezier(0.42,0,0.58,1)\";us[1].style.transform=\"translateX(0%)\";}},onMouseLeave:function(e){var us=e.currentTarget.querySelectorAll(\"u\");if(underlineType===\"invisible\"&&us.length){var u=us[0];u.style.transition=\"transform 0.8s cubic-bezier(0.42,0,0.58,1)\";u.style.transform=\"translateX(101%)\";}}}:{};var Wrapper=link?\"a\":\"div\";var wrapperProps=link?{href:link,target:\"_blank\",rel:\"noopener noreferrer\",style:{position:\"relative\",display:\"inline-block\",maxWidth:\"100%\",overflow:underline?\"hidden\":undefined,textDecoration:\"none\",color:\"inherit\"},...underProps}:{style:{position:\"relative\",display:\"inline-block\",maxWidth:\"100%\",overflow:underline?\"hidden\":undefined},...underProps};return /*#__PURE__*/_jsxs(Wrapper,{...wrapperProps,children:[/*#__PURE__*/_jsx(\"div\",{ref:containerRef,style:baseStyle,children:text}),underline&&underlineType===\"invisible\"&&/*#__PURE__*/_jsx(\"u\",{style:{position:\"absolute\",bottom:0,left:0,width:\"100%\",height:underH,backgroundColor:textColor,transform:\"translateX(-101%)\",transition:\"transform 0.8s cubic-bezier(0.42,0,0.58,1)\",pointerEvents:\"none\"}}),underline&&underlineType===\"visible\"&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(\"u\",{style:{position:\"absolute\",bottom:0,left:0,width:\"100%\",height:underH,backgroundColor:textColor,transform:\"translateX(0%)\",opacity:0,transition:\"transform 0.8s cubic-bezier(0.42,0,0.58,1)\",pointerEvents:\"none\"}}),/*#__PURE__*/_jsx(\"u\",{style:{position:\"absolute\",bottom:0,left:0,width:\"100%\",height:underH,backgroundColor:textColor,transform:\"translateX(-160%)\",opacity:0,transition:\"transform 0.8s cubic-bezier(0.42,0,0.58,1)\",pointerEvents:\"none\"}})]})]});}LinkButton.defaultProps={text:\"\",textStyle:{},revealMode:\"lines\",animDuration:.6,animStagger:.1,underline:false,underlineType:\"invisible\",link:\"\",animateOn:\"loading\"};addPropertyControls(LinkButton,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"\",placeholder:\"Type your text here...\",displayTextarea:true},revealMode:{type:ControlType.Enum,title:\"Reveal Mode\",defaultValue:\"lines\",options:[\"lines\",\"words\",\"letters\"],optionTitles:[\"Lines\",\"Words\",\"Letters\"]},textStyle:{type:ControlType.Font,title:\"Text Style\",displayFontSize:true,controls:\"extended\"},animDuration:{type:ControlType.Number,title:\"Duration\",defaultValue:.6,min:.1,max:3,step:.1},animStagger:{type:ControlType.Number,title:\"Stagger\",defaultValue:.1,min:0,max:1,step:.01},underline:{type:ControlType.Boolean,title:\"Underline\",defaultValue:false},underlineType:{type:ControlType.Enum,title:\"Underline Style\",defaultValue:\"invisible\",options:[\"invisible\",\"visible\"],optionTitles:[\"Invisible\",\"Visible\"],hidden:function(props){return!props.underline;}},link:{type:ControlType.Link,title:\"Link\",defaultValue:\"\"},animateOn:{type:ControlType.Enum,title:\"Animate On\",defaultValue:\"loading\",options:[\"loading\",\"always\"],optionTitles:[\"After Loading\",\"Always\"]}});export default LinkButton;\nexport const __FramerMetadata__ = {\"exports\":{\"LinkButton\":{\"type\":\"reactComponent\",\"name\":\"LinkButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"LinkButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LinkButton.map"],"mappings":"+TAAyP,SAAS,GAAY,CAAC,GAAG,CAAwE,OAAjE,EAAO,aAAiB,mBAAsB,aAAa,GAAG,IAAc,MAAS,gBAAoB,CAAC,MAAM,YAAa,SAAS,GAAS,CAAC,GAAG,CAAC,OAAO,EAAO,gBAAoB,QAAW,yBAAyB,GAAG,SAAa,CAAC,MAAO,IAAmE,SAAgB,EAAW,CAAC,OAAK,GAAG,YAAU,EAAE,CAAC,aAAW,QAAQ,eAAa,GAAG,cAAY,GAAG,YAAU,GAAM,gBAAc,YAAY,OAAK,GAAG,YAAU,WAAW,CAAC,IAAI,EAAaA,EAAO,KAAK,CAAK,EAASA,EAAO,KAAK,CAAK,EAAYA,EAAO,GAAM,CAAK,EAAcA,EAAO,GAAK,CAAI,CAAC,EAAM,GAAUC,EAAS,GAAM,CAAI,CAAC,EAAY,GAAgBA,EAAS,GAAM,CAC9C,GAD+C,EAAgB,UAAU,CAAC,IAAI,EAAE,sBAAsB,UAAU,CAAC,EAAS,GAAK,EAAG,CAAC,OAAO,UAAU,CAAC,qBAAqB,EAAE,GAAK,EAAE,CAAC,CAAC,EAAU,UAAU,CAAC,IAAI,EAAG,GAAS,CAAK,EAAG,GAAY,CAAC,GAAG,IAAK,YAAY,GAAI,IAAK,eAAe,CAAC,EAAc,QAAQ,IAAY,SAAS,EAAe,GAAK,CAAC,OAAmC,GAA3B,EAAc,QAAQ,GAAQ,GAAI,IAAK,SAAS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