{"version":3,"file":"shared-lib.D2vZhOuc.mjs","names":["useState","useMemo","p","useCallback","c","metadata","siteMetadata","metadataVersion","__FramerMetadata__","metadata","siteMetadata"],"sources":["https:/framerusercontent.com/modules/CF9zQgw9Ntac79IJXJqE/gd874exrlauT4pdI3uIz/HoverHighlightText.js","https:/framerusercontent.com/modules/hGWQ6DoocusTRlKjXbzF/itczqvbEqpED3jEVlLGI/siteMetadata.js","https:/framerusercontent.com/modules/6gjN0Tc7O0UmO0MedV7O/RGuH48hEtP5SaFLFbnIO/augiA20Il.js","https:/framerusercontent.com/modules/Y9aZPw9gotUYOmCAO9s7/PqZGqgTFaFaBaUsKUjL3/f2T9JGZoc.js"],"sourcesContent":["// User requested: Create a component that highlights words when the mouse hovers over a text\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{startTransition,useCallback,useMemo,useState}from\"react\";import{motion}from\"framer-motion\";/**\n * Hover Highlight Text\n *\n * @framerIntrinsicWidth 320\n * @framerIntrinsicHeight 60\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function HoverHighlightText(props){const{text,font,backgroundColor,textColor,highlightBackgroundColor,highlightTextColor,highlightMode,highlightPalette,autoHighlightTextColor,padding,borderRadius,highlightRadius,wordGap,animate,animationDuration,style}=props;const[hoveredWordIndex,setHoveredWordIndex]=useState(-1);const{tokens,tokenToWordIndex}=useMemo(()=>{const raw=(text??\"\").toString();const parts=raw.match(/\\S+|\\s+/g)??[raw];let wordIndex=0;const map=parts.map(p=>{const isWhitespace=/^\\s+$/.test(p);if(isWhitespace)return-1;const current=wordIndex;wordIndex+=1;return current;});return{tokens:parts,tokenToWordIndex:map};},[text]);const onEnterWord=useCallback(index=>{startTransition(()=>setHoveredWordIndex(index));},[]);const onLeaveContainer=useCallback(()=>{startTransition(()=>setHoveredWordIndex(-1));},[]);const getAutoTextColor=useCallback((bg,fallback)=>{// Basic hex/rgb parsing to choose black/white for contrast\nconst clamp=n=>Math.max(0,Math.min(255,n));const parse=c=>{const s=(c??\"\").toString().trim().toLowerCase();const hex=s.match(/^#([0-9a-f]{3}|[0-9a-f]{6})$/i);if(hex){const h=hex[1];if(h.length===3){const r=parseInt(h[0]+h[0],16);const g=parseInt(h[1]+h[1],16);const b=parseInt(h[2]+h[2],16);return{r,g,b};}const r=parseInt(h.slice(0,2),16);const g=parseInt(h.slice(2,4),16);const b=parseInt(h.slice(4,6),16);return{r,g,b};}const rgb=s.match(/^rgba?\\(([^)]+)\\)$/i);if(rgb){const parts=rgb[1].split(\",\").map(p=>p.trim()).slice(0,3);if(parts.length===3){const r=clamp(parseFloat(parts[0]));const g=clamp(parseFloat(parts[1]));const b=clamp(parseFloat(parts[2]));return{r,g,b};}}return null;};const c=parse(bg);if(!c)return fallback;const luminance=(.2126*c.r+.7152*c.g+.0722*c.b)/255;return luminance>.6?\"#000000\":\"#FFFFFF\";},[]);const getHighlightBackgroundForWord=useCallback(wordIndex=>{const palette=Array.isArray(highlightPalette)?highlightPalette.filter(Boolean):[];// Single mode should still work even if the hidden color control is unset\nif(highlightMode!==\"palette\"){return highlightBackgroundColor||palette[0]||\"#F5F5F5\";}if(palette.length===0)return highlightBackgroundColor||\"#F5F5F5\";return palette[(wordIndex%palette.length+palette.length)%palette.length];},[highlightMode,highlightPalette,highlightBackgroundColor]);const baseWordStyle=useMemo(()=>({display:\"inline-block\",color:textColor,borderRadius:highlightRadius,padding:\"0.08em 0.16em\",marginRight:wordGap,transition:animate?`background-color ${animationDuration}s ease, color ${animationDuration}s ease, transform ${animationDuration}s ease`:undefined}),[textColor,highlightRadius,wordGap,animate,animationDuration]);const containerStyle=useMemo(()=>({...style,position:\"relative\",width:\"max-content\",maxWidth:\"100%\",whiteSpace:\"pre-wrap\",overflowWrap:\"break-word\",background:backgroundColor,borderRadius,padding,color:textColor,...font}),[style,backgroundColor,borderRadius,padding,textColor,font]);// If the component is set to stretch, allow wrapping naturally.\nconst isFullWidth=!!style&&style.width===\"100%\";if(isFullWidth){containerStyle.width=\"100%\";}return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,onMouseLeave:onLeaveContainer,\"aria-label\":\"Hover highlight text\",children:tokens.map((token,i)=>{const wordIndex=tokenToWordIndex[i];const isWhitespace=wordIndex===-1;if(isWhitespace){// Preserve whitespace exactly.\nreturn /*#__PURE__*/_jsx(\"span\",{style:{whiteSpace:\"pre-wrap\"},children:token},`ws-${i}`);}const isHovered=wordIndex===hoveredWordIndex;const hoveredBg=isHovered?getHighlightBackgroundForWord(wordIndex):\"transparent\";const hoveredFg=isHovered?autoHighlightTextColor?getAutoTextColor(hoveredBg,highlightTextColor):highlightTextColor:textColor;if(!animate){return /*#__PURE__*/_jsx(\"span\",{onMouseEnter:()=>onEnterWord(wordIndex),style:{...baseWordStyle,background:hoveredBg,color:hoveredFg},children:token},`w-${i}`);}return /*#__PURE__*/_jsx(motion.span,{onMouseEnter:()=>onEnterWord(wordIndex),style:{...baseWordStyle,background:hoveredBg,color:hoveredFg},animate:{scale:isHovered?1.03:1},transition:{duration:animationDuration,ease:\"easeOut\"},children:token},`w-${i}`);})});}addPropertyControls(HoverHighlightText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Hover over any word to highlight it.\",displayTextArea:true},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"18px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#000000\"},highlightMode:{type:ControlType.Enum,title:\"Highlight\",options:[\"single\",\"palette\"],optionTitles:[\"Single\",\"Palette\"],defaultValue:\"palette\",displaySegmentedControl:true},highlightBackgroundColor:{type:ControlType.Color,title:\"Highlight Bg\",defaultValue:\"#F5F5F5\",hidden:p=>p.highlightMode===\"palette\"},highlightPalette:{type:ControlType.Array,title:\"Palette\",maxCount:10,control:{type:ControlType.Color},defaultValue:[\"#FFBB00\",\"#8855FF\",\"#22CC66\",\"#FF5588\",\"#0099FF\"],hidden:p=>p.highlightMode!==\"palette\"},highlightTextColor:{type:ControlType.Color,title:\"Highlight Text\",defaultValue:\"#000000\"},autoHighlightTextColor:{type:ControlType.Boolean,title:\"Auto Text\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},padding:{type:ControlType.Padding,title:\"Padding\",defaultValue:\"12px\"},borderRadius:{type:ControlType.BorderRadius,title:\"Radius\",defaultValue:\"12px\"},highlightRadius:{type:ControlType.Number,title:\"Word Radius\",defaultValue:8,min:0,max:32,step:1,unit:\"px\"},wordGap:{type:ControlType.Number,title:\"Word Gap\",defaultValue:0,min:0,max:24,step:1,unit:\"px\"},animate:{type:ControlType.Boolean,title:\"Animate\",defaultValue:true,enabledTitle:\"On\",disabledTitle:\"Off\"},animationDuration:{type:ControlType.Number,title:\"Anim Time\",defaultValue:.18,min:.05,max:1,step:.01,unit:\"s\",hidden:p=>!p.animate}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HoverHighlightText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"auto\",\"framerIntrinsicHeight\":\"60\",\"framerIntrinsicWidth\":\"320\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HoverHighlightText.map","// Generated by Framer (3ad0d99)\nexport default function metadata(params,activeLocale){return{description:\"Made with Framer\",robots:\"max-image-preview:large\",title:\"My Framer Site\"};}export const metadataVersion=1;\nexport const __FramerMetadata__ = {\"exports\":{\"metadataVersion\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// Generated by Framer (7175f5c)\nimport siteMetadata from\"#framer/local/siteMetadata/siteMetadata/siteMetadata.js\";export default function metadata(params,activeLocale){return{breakpoints:[{hash:\"72rtr7\",mediaQuery:\"(min-width: 1200px)\"},{hash:\"mky0x8\",mediaQuery:\"(min-width: 810px) and (max-width: 1199.98px)\"},{hash:\"14m66mq\",mediaQuery:\"(max-width: 809.98px)\"}],description:siteMetadata(params,activeLocale).description,elements:{},robots:\"max-image-preview:large\",serializationId:\"framer-eVMlY\",title:siteMetadata(params,activeLocale).title||\"Home\",viewport:\"width=device-width\"};}export const metadataVersion=1;\nexport const __FramerMetadata__ = {\"exports\":{\"metadataVersion\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// Generated by Framer (f32bfea)\nimport siteMetadata from\"#framer/local/siteMetadata/siteMetadata/siteMetadata.js\";export default function metadata(params,activeLocale){return{breakpoints:[{hash:\"6gxewb\"}],description:siteMetadata(params,activeLocale).description,elements:{},robots:\"max-image-preview:large\",serializationId:\"framer-4er4G\",title:siteMetadata(params,activeLocale).title||\"Livepreview\",viewport:\"width=1200\"};}export const metadataVersion=1;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"metadataVersion\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"gPASG,SAAwB,EAAmB,EAAM,CAAC,GAAK,CAAC,OAAK,OAAK,kBAAgB,YAAU,2BAAyB,qBAAmB,gBAAc,mBAAiB,yBAAuB,UAAQ,eAAa,kBAAgB,UAAQ,UAAQ,oBAAkB,SAAO,EAAW,CAAC,EAAiB,GAAqBA,EAAS,GAAG,CAAM,CAAC,SAAO,oBAAkBC,MAAY,CAAC,IAAM,GAAK,GAAM,IAAI,UAAU,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