{"version":3,"file":"Read_time.DX9eWNL8.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/ZHtYwg0YUlsZqE2K0Dcr/griwDmkGM7J3Tw4nOsp0/Read_time.js"],"sourcesContent":["// Welcome to Code in Framer\n// Get Started: https://www.framer.com/developers\nimport{jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useMemo}from\"react\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function ReadTime(props){const{content,wordsPerMinute,prefix,suffix,font,textColor}=props;const readTime=useMemo(()=>{const text=typeof content===\"string\"?content:\"\";if(!text.trim())return 0;const words=text.trim().split(/\\s+/).filter(Boolean);const wordCount=words.length;if(wordCount===0)return 0;return Math.max(1,Math.ceil(wordCount/wordsPerMinute));},[content,wordsPerMinute]);const displayValue=readTime===0?1:readTime;return /*#__PURE__*/_jsxs(\"span\",{style:{...font,color:textColor,whiteSpace:\"nowrap\",display:\"inline-block\"},children:[prefix,displayValue,suffix]});}ReadTime.defaultProps={content:\"\",wordsPerMinute:200,prefix:\"\",suffix:\" min read\",textColor:\"#000000\"};addPropertyControls(ReadTime,{content:{title:\"Content\",type:ControlType.String,defaultValue:\"\",displayTextArea:true,description:\"Bind to your CMS plain text content field\"},wordsPerMinute:{title:\"Words/Min\",type:ControlType.Number,defaultValue:200,min:50,max:1e3,step:10,displayStepper:true},prefix:{title:\"Prefix\",type:ControlType.String,defaultValue:\"\",placeholder:\"e.g. ⏱ \"},suffix:{title:\"Suffix\",type:ControlType.String,defaultValue:\" min read\"},font:{type:\"font\",controls:\"extended\"},textColor:{title:\"Color\",type:ControlType.Color,defaultValue:\"#000000\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ReadTime\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":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