{"version":3,"file":"HighlighterColor.qlDEnCbb.mjs","names":["React.Fragment"],"sources":["https:/framerusercontent.com/modules/WwoLe8POceKF6tYhdoty/YebFwbk4ijgKU6z0NOlZ/HighlighterColor.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function HighlighterColor(props){const{text,highlightedWords,textColor,highlightedColor}=props;const baseStyle={fontFamily:\"Inter\",fontStyle:\"normal\",lineHeight:\"110%\",letterSpacing:\"-1px\",margin:0,color:textColor,fontWeight:700,textAlign:props.alignment,fontSize:props.fontSize};const highlights=highlightedWords.split(\",\").map(word=>word.trim()).filter(Boolean);const escapeRegex=word=>word.replace(/[.*+?^${}()|[\\]\\\\]/g,\"\\\\$&\");const regex=new RegExp(`(${highlights.map(escapeRegex).join(\"|\")})`,\"gi\");// const regex = new RegExp(`(${highlights.join(\"|\")})`, \"gi\")\nconst parts=text.split(regex);const formattedText=text.replace(/\\\\n|\\/n/g,\"\\n\");const Tag=props.tag||\"h3\";return /*#__PURE__*/_jsx(Tag,{style:{...baseStyle},children:formattedText.split(\"\\n\").map((line,lineIndex)=>{const parts=line.split(regex);return /*#__PURE__*/_jsxs(React.Fragment,{children:[parts.map((part,index)=>{const isHighlighted=highlights.some(word=>word.toLowerCase()===part.toLowerCase());return /*#__PURE__*/_jsx(\"span\",{style:{color:isHighlighted?highlightedColor:textColor},children:part},index);}),lineIndex!==formattedText.split(\"\\n\").length-1&&/*#__PURE__*/_jsx(\"br\",{})]},lineIndex);})});}addPropertyControls(HighlighterColor,{fontSize:{title:\"Font Size\",type:ControlType.Number,defaultValue:32,min:8,max:100,step:1,unit:\"px\"},text:{title:\"Text\",type:ControlType.String,defaultValue:\"Real-time order updates between store and ERP\",description:\"Use /n to add line breaks\"},highlightedWords:{title:\"Highlighted words\",type:ControlType.String,defaultValue:\"Real-time,updates\"},textColor:{title:\"Text color\",type:ControlType.Color,defaultValue:\"#000000\"},highlightedColor:{title:\"Highlighted color\",type:ControlType.Color,defaultValue:\"#FF0055\"},alignment:{title:\"Text Alignment\",type:ControlType.Enum,options:[\"left\",\"center\",\"right\"],optionTitles:[\"Left\",\"Center\",\"Right\"],defaultValue:\"left\"},tag:{title:\"HTML Tag\",type:ControlType.Enum,options:[\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"p\"],optionTitles:[\"H1\",\"H2\",\"H3\",\"H4\",\"H5\",\"Paragraph\"],defaultValue:\"h3\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"HighlighterColor\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"auto\",\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./HighlighterColor.map"],"mappings":"wQAGG,SAAwB,EAAiB,EAAM,CAAC,GAAK,CAAC,OAAK,mBAAiB,YAAU,oBAAkB,EAAY,EAAU,CAAC,WAAW,QAAQ,UAAU,SAAS,WAAW,OAAO,cAAc,OAAO,OAAO,EAAE,MAAM,EAAU,WAAW,IAAI,UAAU,EAAM,UAAU,SAAS,EAAM,SAAS,CAAO,EAAW,EAAiB,MAAM,IAAI,CAAC,IAAI,GAAM,EAAK,MAAM,CAAC,CAAC,OAAO,QAAQ,CAA0E,EAAU,OAAO,IAAI,EAAW,IAAvF,GAAM,EAAK,QAAQ,sBAAsB,OAAO,CAAuD,CAAC,KAAK,IAAI,CAAC,GAAG,KAAK,CAC9f,EAAK,MAAM,EAAM,CAAC,IAAM,EAAc,EAAK,QAAQ,WAAW;EAAK,CAAO,EAAI,EAAM,KAAK,KAAK,OAAoB,EAAK,EAAI,CAAC,MAAM,CAAC,GAAG,EAAU,CAAC,SAAS,EAAc,MAAM;EAAK,CAAC,KAAK,EAAK,IAAY,CAAC,IA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