{"version":3,"file":"CustomText.Dk86v23K.mjs","names":["text","React"],"sources":["https:/framerusercontent.com/modules/nAW3yE6SqkJllDkEC55S/qextkHRhiByEIkFvyvkB/CustomText.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import React from\"react\";import{addPropertyControls,ControlType}from\"framer\";function CustomText({// Text content and formatting\ntext=\"**2024 Year in Review:** A Year of Pioneering *Truly Transparent* Pharmacy Benefits.\\n\\nThis is a new paragraph with **bold**, *italic*, and E=mc^2^ text.\",// Font styling\nfont={fontSize:16,lineHeight:1.4},fontColor=\"#2B2927\",boldFont={fontSize:16,lineHeight:1.4,fontWeight:\"bold\"},boldColor=\"#2B2927\",italicFont={fontSize:16,lineHeight:1.4,fontStyle:\"italic\"},italicColor=\"#2B2927\",superscriptFont={fontSize:12,lineHeight:1.4},superscriptColor=\"#2B2927\",// Additional styles\nstyle,...props}){// Function to parse text and apply formatting\nconst parseText=text=>{if(!text)return\"\";// Replace literal \\n with actual newlines and normalize line breaks\nconst normalizedText=text.replace(/\\\\n/g,\"\\n\")// Convert literal \\n to actual newlines\n.replace(/\\r\\n/g,\"\\n\")// Normalize Windows line breaks\n.replace(/\\r/g,\"\\n\")// Normalize Mac line breaks\n;// Split by line breaks and handle paragraphs\nconst lines=normalizedText.split(\"\\n\");return lines.map((line,lineIndex)=>{if(line.trim()===\"\"){// Empty line - render as line break\nreturn /*#__PURE__*/_jsx(\"br\",{},`br-${lineIndex}`);}// Parse formatting within each line\n// Split by all formatting markers including superscript\nconst parts=line.split(/(\\*\\*\\*.*?\\*\\*\\*|\\*\\*.*?\\*\\*|\\*.*?\\*|\\^.*?\\^)/);const formattedParts=parts.map((part,index)=>{if(part.startsWith(\"***\")&&part.endsWith(\"***\")){// Bold and italic (triple asterisks)\nconst text=part.slice(3,-3);return /*#__PURE__*/_jsx(\"strong\",{style:{...boldFont,...italicFont,color:boldColor,fontWeight:\"bold\",fontStyle:\"italic\"},children:text},`${lineIndex}-${index}`);}else if(part.startsWith(\"**\")&&part.endsWith(\"**\")){// Bold (double asterisks)\nconst boldText=part.slice(2,-2);return /*#__PURE__*/_jsx(\"strong\",{style:{...boldFont,color:boldColor},children:boldText},`${lineIndex}-${index}`);}else if(part.startsWith(\"*\")&&part.endsWith(\"*\")){// Italic (single asterisks)\nconst italicText=part.slice(1,-1);return /*#__PURE__*/_jsx(\"em\",{style:{...italicFont,color:italicColor},children:italicText},`${lineIndex}-${index}`);}else if(part.startsWith(\"^\")&&part.endsWith(\"^\")){// Superscript (carets)\nconst superText=part.slice(1,-1);return /*#__PURE__*/_jsx(\"sup\",{style:{...superscriptFont,color:superscriptColor},children:superText},`${lineIndex}-${index}`);}else{// Regular text\nreturn /*#__PURE__*/_jsx(\"span\",{style:{color:fontColor},children:part},`${lineIndex}-${index}`);}});// Each line as a div, with line breaks between\nreturn /*#__PURE__*/_jsxs(React.Fragment,{children:[/*#__PURE__*/_jsx(\"div\",{children:formattedParts}),lineIndex<lines.length-1&&/*#__PURE__*/_jsx(\"br\",{})]},`line-${lineIndex}`);});};return /*#__PURE__*/_jsx(\"div\",{style:{...font,...style},children:parseText(text)});}// Add property controls for Framer\naddPropertyControls(CustomText,{text:{type:ControlType.String,title:\"Text\",defaultValue:\"**2024 Year in Review:** A Year of Pioneering *Truly Transparent* Pharmacy Benefits.\\n\\nThis is a new paragraph with **bold**, *italic*, and E=mc^2^ text.\",displayTextArea:true,description:\"Use **text** for bold, *text* for italic, ***text*** for both, ^text^ for superscript, and \\\\n for line breaks\"},font:{type:ControlType.Font,controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:16,lineHeight:1.4}},fontColor:{type:ControlType.Color,title:\"Font Color\",defaultValue:\"#2B2927\"},boldFont:{type:ControlType.Font,controls:\"extended\",defaultFontType:\"sans-serif\",title:\"Bold Font\",defaultValue:{fontSize:16,lineHeight:1.4,fontWeight:\"bold\"}},boldColor:{type:ControlType.Color,title:\"Bold Text Color\",defaultValue:\"#2B2927\"},italicFont:{type:ControlType.Font,controls:\"extended\",defaultFontType:\"sans-serif\",title:\"Italic Font\",defaultValue:{fontSize:16,lineHeight:1.4,fontStyle:\"italic\"}},italicColor:{type:ControlType.Color,title:\"Italic Text Color\",defaultValue:\"#2B2927\"},superscriptFont:{type:ControlType.Font,controls:\"extended\",defaultFontType:\"sans-serif\",title:\"Superscript Font\",defaultValue:{fontSize:12,lineHeight:1.4}},superscriptColor:{type:ControlType.Color,title:\"Superscript Text Color\",defaultValue:\"#2B2927\"}});export default CustomText;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CustomText\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CustomText.map"],"mappings":"iLAAsI,SAAS,EAAW,CAC1J,OAAK;;oEACL,OAAK,CAAC,SAAS,GAAG,WAAW,IAAI,CAAC,YAAU,UAAU,WAAS,CAAC,SAAS,GAAG,WAAW,IAAI,WAAW,OAAO,CAAC,YAAU,UAAU,aAAW,CAAC,SAAS,GAAG,WAAW,IAAI,UAAU,SAAS,CAAC,cAAY,UAAU,kBAAgB,CAAC,SAAS,GAAG,WAAW,IAAI,CAAC,mBAAiB,UACjR,QAAM,GAAG,GAAO,CAChB,IAAM,EAAU,GAAM,CAAC,GAAG,CAACA,EAAK,MAAM,GAKtC,IAAM,EAJeA,EAAK,QAAQ,OAAO;EAAK,CAC7C,QAAQ,QAAQ;EAAK,CACrB,QAAQ,MAAM;EAAK,CAEO,MAAM;EAAK,CAAC,OAAO,EAAM,KAAK,EAAK,IAAY,CAAC,GAAG,EAAK,MAAM,GAAG,GAC5F,OAAoB,EAAK,KAAK,EAAE,CAAC,MAAM,IAAY,CAEqB,IAAM,EAAlE,EAAK,MAAM,gDAAgD,CAA4B,KAAK,EAAK,IAAQ,CAAC,GAAG,EAAK,WAAW,MAAM,EAAE,EAAK,SAAS,MAAM,CAAC,CACtK,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