{"version":3,"file":"TaggingFunctions.BYfeMkLr.mjs","names":["__legacyOverrideHOC_DataObserverContext"],"sources":["https:/framerusercontent.com/modules/xRICxXMWAKSP6PCoC6gW/VNUByKLxa8AqrKE7u5pS/TaggingFunctions.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";/**\n * ✅ Fully replaces the Text component with a `<div>` containing split tags.\n * ✅ Works on a CMS-bound Text component inside a Frame.\n * ✅ Ensures Framer renders JSX correctly instead of ignoring it.\n */export function SplitText(){return{component:props=>{// Ensure text exists from CMS\nconst rawText=props.children?.toString()||\"\";if(!rawText){console.warn(\"No text found in CMS field.\");return /*#__PURE__*/_jsx(\"div\",{children:\"Loading...\"});}console.log(\"Raw text from CMS:\",rawText);const cleanText=stripHTML(rawText)// Remove HTML tags\n;const delimiter=\",\"// Define split separator\n;// Convert text into colored tags\nconst items=cleanText.split(delimiter).map((item,index)=>{const trimmedItem=item.trim();return /*#__PURE__*/_jsx(\"span\",{style:createTagStyle(index),children:trimmedItem},`${trimmedItem}-${index}`);});console.log(\"Final array output:\",items);// Replace the Text component with a new `<div>` holding the tags\nreturn /*#__PURE__*/_jsx(\"div\",{style:tagContainerStyle,children:items});}};}/**\n * ✅ Function to remove HTML tags from text.\n */export function stripHTML(text){return text.replace(/<\\/?[^>]+(>|$)/g,\"\")// Removes all HTML tags\n;}/**\n * ✅ Generates a dynamic style for each tag, cycling through predefined colors.\n */export function createTagStyle(index){const colors=[\"#E57373\",\"#81C784\",\"#64B5F6\",\"#FFD54F\",\"#BA68C8\"];return{backgroundColor:colors[index%colors.length],padding:\"6px 12px\",borderRadius:\"16px\",margin:\"4px\",display:\"inline-block\",fontSize:\"14px\",fontWeight:\"500\",color:\"#fff\"};}// ✅ Styling for the injected tag container\nconst tagContainerStyle={display:\"flex\",flexWrap:\"wrap\",gap:\"8px\",justifyContent:\"center\",alignItems:\"center\"};/**\n * ✅ Properly exported `TaggingComponent` for reuse in Framer.\n */export function TaggingComponent({text}){if(!text)return null;console.log(\"TaggingComponent received text:\",text);const cleanText=stripHTML(text)// Ensure no HTML tags\n;const delimiter=\",\";const items=cleanText.split(delimiter).map((item,index)=>{const trimmedItem=item.trim();return /*#__PURE__*/_jsx(\"span\",{style:createTagStyle(index),children:trimmedItem},`${trimmedItem}-${index}`);});return /*#__PURE__*/_jsx(\"div\",{style:tagContainerStyle,children:items});}/**\n * ✅ Default export for Framer preview.\n * Allows testing inside Framer without needing CMS.\n */export default function TaggingFunctions(){return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:/*#__PURE__*/_jsx(TaggingComponent,{text:\"AI Product Management, Strategic Planning, Public Sector Transformation\"})});}// ✅ Container styling for Framer preview\nconst containerStyle={height:\"100%\",width:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"hidden\"};export function TagsFromPipe({cmsData}){const tags=cmsData.split(\",\").map((entry,index)=>{const[text,color]=entry.split(\"|\").map(item=>item.trim());return /*#__PURE__*/_jsx(\"span\",{style:{backgroundColor:color,padding:\"6px 12px\",borderRadius:\"16px\",margin:\"4px\",display:\"inline-block\",color:\"#fff\"},children:text},`${text}-${index}`);});return /*#__PURE__*/_jsx(\"div\",{style:tagContainerStyle,children:tags});}import{useContext as __legacyOverrideHOC_useContext}from\"react\";import{DataObserverContext as __legacyOverrideHOC_DataObserverContext}from\"framer\";export function withSplitText(C){return props=>{__legacyOverrideHOC_useContext(__legacyOverrideHOC_DataObserverContext);return _jsx(C,{...props,...SplitText(props)});};}withSplitText.displayName=\"SplitText\";\nexport const __FramerMetadata__ = {\"exports\":{\"TagsFromPipe\":{\"type\":\"reactComponent\",\"name\":\"TagsFromPipe\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"TaggingComponent\":{\"type\":\"reactComponent\",\"name\":\"TaggingComponent\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"createTagStyle\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SplitText\":{\"type\":\"override\",\"name\":\"SplitText\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSplitText\":{\"type\":\"reactHoc\",\"name\":\"withSplitText\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"stripHTML\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"TaggingFunctions\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TaggingFunctions.map"],"mappings":"iPAIG,SAAgB,GAAW,CAAC,MAAM,CAAC,UAAU,GAAO,CACvD,IAAM,EAAQ,EAAM,UAAU,UAAU,EAAE,GAAG,IAAI,EAAqD,MAA5C,SAAQ,KAAK,8BAA8B,CAAqB,EAAK,MAAM,CAAC,SAAS,YAAa,EAAC,SAAU,IAAI,qBAAqB,EAAQ,CAAC,IAAM,EAAU,EAAU,EAAQ,CACpO,EAAU,IAEX,EAAM,EAAU,MAAM,EAAU,CAAC,IAAI,CAAC,EAAK,IAAQ,CAAC,IAAM,EAAY,EAAK,MAAM,CAAC,MAAoB,GAAK,OAAO,CAAC,MAAM,EAAe,EAAM,CAAC,SAAS,CAAY,KAAI,EAAY,GAAG,IAAQ,AAAE,EAAC,CACxM,MADyM,SAAQ,IAAI,sBAAsB,EAAM,CAC7N,EAAK,MAAM,CAAC,MAAM,EAAkB,SAAS,CAAM,EAAC,AAAE,CAAC,CAAE,CAE1E,SAAgB,EAAU,EAAK,CAAC,MAAO,GAAK,QAAQ,kBAAkB,GAAG,AAC1E,CAEC,SAAgB,EAAe,EAAM,CAAC,IAAM,EAAO,CAAC,UAAU,UAAU,UAAU,UAAU,SAAU,EAAC,MAAM,CAAC,gBAAgB,EAAO,EAAM,EAAO,QAAQ,QAAQ,WAAW,aAAa,OAAO,OAAO,MAAM,QAAQ,eAAe,SAAS,OAAO,WAAW,MAAM,MAAM,MAAO,CAAE,CAGrR,SAAgB,EAAiB,C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