{"version":3,"file":"Blog_read_min.Ce_Snidd.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/OKSxAFFl90QDMlCcjCx2/4c6aW9lxn25qLN1V10zR/Blog_read_min.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{addPropertyControls,ControlType}from\"framer\";export function ReadingTimeCMS(props){const{wordsPerMinute,cmsReadTime,fontSize,fontColor,fontFamily}=props;const[readingTime,setReadingTime]=useState(cmsReadTime||\"Loading...\");useEffect(()=>{const possibleSelectors=[\"article\",\"[data-framer-blog]\",\".blog-content\",\".post-content\",\".framer-text-wrapper\",\"main\",\"#main\",\".framer-page\",\"body\"];let foundText=\"\";for(const selector of possibleSelectors){const el=document.querySelector(selector);if(el&&el.textContent&&el.textContent.trim().length>100){foundText=el.textContent.trim();break;}}if(!foundText&&document.body){foundText=document.body.textContent||\"\";}const wordCount=foundText.trim().split(/\\s+/).length;const time=Math.max(1,Math.ceil(wordCount/wordsPerMinute));setReadingTime(`${time} min to read`);},[wordsPerMinute]);return /*#__PURE__*/_jsx(\"div\",{style:{fontSize:`${fontSize}px`,color:fontColor,fontFamily:fontFamily,fontWeight:500},children:readingTime});}addPropertyControls(ReadingTimeCMS,{wordsPerMinute:{title:\"Words/Min\",type:ControlType.Number,defaultValue:200,min:100,max:400,step:10},cmsReadTime:{title:\"CMS Read Min\",type:ControlType.String,defaultValue:\"3 min to read\"},fontSize:{title:\"Font Size\",type:ControlType.Number,defaultValue:16,min:10,max:48},fontColor:{title:\"Font Color\",type:ControlType.Color,defaultValue:\"#000000\"},fontFamily:{title:\"Font Family\",type:ControlType.String,defaultValue:\"Nunito, sans-serif\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"ReadingTimeCMS\":{\"type\":\"reactComponent\",\"name\":\"ReadingTimeCMS\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Blog_read_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