{"version":3,"file":"Time_to_read.BPQX7g6u.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/lE3FnWj76o4bcJ2sowee/E45Xa9M4iB6aw7Mokdgn/xvTYe9Qg0.js","https:/framerusercontent.com/modules/n2kju6hoTayc8de8rW3V/e274Hvq6xmVxjm2NjffM/Time_to_read.js"],"sourcesContent":["// Generated by Framer (dd59b2c)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,useSVGTemplate,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask=\"var(--framer-icon-mask)\";const Base=/*#__PURE__*/forwardRef(function(props,ref){return /*#__PURE__*/_jsx(\"svg\",{...props,ref:ref,children:props.children});});const MotionSVG=motion.create(Base);const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(MotionSVG,{...rest,layoutId:layoutId,ref:ref,children:children}):/*#__PURE__*/_jsx(\"svg\",{...rest,ref:ref,children:children});});const svg='<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 10 4 L 10 10 L 14 14 M 20 10 C 20 15.523 15.523 20 10 20 C 4.477 20 0 15.523 0 10 C 0 4.477 4.477 0 10 0 C 15.523 0 20 4.477 20 10 Z\" fill=\"transparent\" height=\"20px\" id=\"q7gJHKBBj\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--1ww558a, 2)\" stroke=\"var(--4rxgx6, black)\" transform=\"translate(2 2)\" width=\"20px\"/></svg>';const getProps=({color,height,id,width,width1,...props})=>{return{...props,CRY1Fpez4:color??props.CRY1Fpez4??\"rgb(0, 0, 0)\",vet7gqNu_:width1??props.vet7gqNu_??2};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,CRY1Fpez4,vet7gqNu_,...restProps}=getProps(props);const href=useSVGTemplate(\"2005987383\",svg);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-z768M\",className),layoutId:layoutId,ref:ref,role:\"presentation\",style:{\"--1ww558a\":vet7gqNu_,\"--4rxgx6\":CRY1Fpez4,...style},viewBox:\"0 0 24 24\",children:/*#__PURE__*/_jsx(\"use\",{href:href})});});const css=[`.framer-z768M { -webkit-mask: ${mask}; aspect-ratio: 1; display: block; mask: ${mask}; width: 24px; }`];/**\n * This is a generated Framer component.\n * @framerIntrinsicWidth 24\n * @framerIntrinsicHeight 24\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerVariables {\"CRY1Fpez4\":\"color\",\"vet7gqNu_\":\"width1\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Clock Time\",\"color\":{\"type\":\"variable\",\"value\":\"4rxgx6\"},\"set\":{\"localId\":\"vectorSet/dSZJyzeMx\",\"id\":\"dSZJyzeMx\",\"moduleId\":\"E1vFg1A6wcWAGuFi9Hz1\"}}\n */const Icon=withCSS(Component,css,\"framer-z768M\");Icon.displayName=\"Clock Time\";export default Icon;addPropertyControls(Icon,{CRY1Fpez4:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Color\",type:ControlType.Color},vet7gqNu_:{defaultValue:2,displayStepper:true,hidden:false,max:4,min:1,title:\"Width\",type:ControlType.Number}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"24\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerVariables\":\"{\\\"CRY1Fpez4\\\":\\\"color\\\",\\\"vet7gqNu_\\\":\\\"width1\\\"}\",\"framerIntrinsicWidth\":\"24\",\"framerVector\":\"{\\\"name\\\":\\\"Clock Time\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"4rxgx6\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/dSZJyzeMx\\\",\\\"id\\\":\\\"dSZJyzeMx\\\",\\\"moduleId\\\":\\\"E1vFg1A6wcWAGuFi9Hz1\\\"}}\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerImmutableVariables\":\"true\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{fontControls}from\"https://framer.com/m/framer/default-utils.js@^0.45.0\";import{useEffect,useState}from\"react\";/**\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth any-prefer-auto\n * @framerSupportedLayoutHeight any-prefer-auto\n */export default function WordCounter(props){const{font,fontColor,displayMode,timeSuffix,wordSuffix,contentType,title1,title2,title3,title4,title5,title6,title7,title8,title9,title10,title11,title12,title13,title14,title15}=props;const[totalCount,setTotalCount]=useState(0);useEffect(()=>{const countWords=text=>{const div=document.createElement(\"div\");div.innerHTML=typeof text===\"string\"?text:JSON.stringify(text);const cleanText=div.textContent||div.innerText||\"\";return cleanText.trim().split(/\\s+/).length;};const titlesToCount=contentType===\"one\"?[title1]:[title1,title2,title3,title4,title5,title6,title7,title8,title9,title10,title11,title12,title13,title14,title15];const totalWords=titlesToCount.reduce((sum,title)=>sum+countWords(title),0);setTotalCount(totalWords);},[contentType,title1,title2,title3,title4,title5,title6,title7,title8,title9,title10,title11,title12,title13,title14,title15]);const wordsPerMinute=200// Average reading speed\n;const timeToRead=Math.ceil(totalCount/wordsPerMinute);let displayText=displayMode===\"words\"?`${totalCount} ${wordSuffix}`:`${timeToRead} ${timeSuffix}`;return /*#__PURE__*/_jsx(\"div\",{style:{...font,color:fontColor,display:\"flex\",justifyContent:\"center\",alignItems:\"center\",padding:0},children:displayText});}WordCounter.defaultProps={title1:\"<p>Your rich text here</p>\",title2:\"<p>Your rich text here</p>\",title3:\"<p>Your rich text here</p>\",title4:\"<p>Your rich text here</p>\",title5:\"<p>Your rich text here</p>\",title6:\"<p>Your rich text here</p>\",title7:\"<p>Your rich text here</p>\",title8:\"<p>Your rich text here</p>\",title9:\"<p>Your rich text here</p>\",title10:\"<p>Your rich text here</p>\",title11:\"<p>Your rich text here</p>\",title12:\"<p>Your rich text here</p>\",title13:\"<p>Your rich text here</p>\",title14:\"<p>Your rich text here</p>\",title15:\"<p>Your rich text here</p>\",font:fontControls.defaultProps,fontColor:\"#000\",displayMode:\"words\",timeSuffix:\"Mins Read\",wordSuffix:\"Words\",contentType:\"one\"};addPropertyControls(WordCounter,{contentType:{title:\"Content Type\",type:ControlType.Enum,options:[\"one\",\"multiple\"],optionTitles:[\"Single\",\"Multiple\"],defaultValue:WordCounter.defaultProps.contentType},title1:{title:\"Title 1\",type:ControlType.RichText},title2:{title:\"Title 2\",type:ControlType.RichText,hidden:props=>props.contentType===\"one\"},title3:{title:\"Title 3\",type:ControlType.RichText,hidden:props=>props.contentType===\"one\"},title4:{title:\"Title 4\",type:ControlType.RichText,hidden:props=>props.contentType===\"one\"},title5:{title:\"Title 5\",type:ControlType.RichText,hidden:props=>props.contentType===\"one\"},title6:{title:\"Title 6\",type:ControlType.RichText,hidden:props=>props.contentType===\"one\"},title7:{title:\"Title 7\",type:ControlType.RichText,hidden:props=>props.contentType===\"one\"},title8:{title:\"Title 8\",type:ControlType.RichText,hidden:props=>props.contentType===\"one\"},title9:{title:\"Title 9\",type:ControlType.RichText,hidden:props=>props.contentType===\"one\"},title10:{title:\"Title 10\",type:ControlType.RichText,hidden:props=>props.contentType===\"one\"},title11:{title:\"Title 11\",type:ControlType.RichText,hidden:props=>props.contentType===\"one\"},title12:{title:\"Title 12\",type:ControlType.RichText,hidden:props=>props.contentType===\"one\"},title13:{title:\"Title 13\",type:ControlType.RichText,hidden:props=>props.contentType===\"one\"},title14:{title:\"Title 14\",type:ControlType.RichText,hidden:props=>props.contentType===\"one\"},title15:{title:\"Title 15\",type:ControlType.RichText,hidden:props=>props.contentType===\"one\"},font:{type:ControlType.Font,controls:\"extended\",title:\"Font\"},fontColor:{title:\"Font Color\",type:ControlType.Color,defaultValue:WordCounter.defaultProps.fontColor},displayMode:{title:\"Display Mode\",type:ControlType.SegmentedEnum,options:[\"words\",\"time\"],optionTitles:[\"Words\",\"Time to Read\"],defaultValue:WordCounter.defaultProps.displayMode},timeSuffix:{title:\"Time Suffix\",type:ControlType.String,defaultValue:WordCounter.defaultProps.timeSuffix,hidden:props=>props.displayMode===\"words\"},wordSuffix:{title:\"Word Suffix\",type:ControlType.String,defaultValue:WordCounter.defaultProps.wordSuffix,hidden:props=>props.displayMode===\"time\",description:\"v1.3\\n[via SegmentUI](https://www.segmentUI.com)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WordCounter\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"*\",\"framerSupportedLayoutWidth\":\"any-prefer-auto\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Time_to_read.map"],"mappings":"wYAC2C,IAAqF,IAA4B,CAAoC,EAAK,0BAAgC,EAAkB,EAAW,SAAS,EAAM,EAAI,CAAC,OAAoB,EAAK,MAAM,CAAC,GAAG,EAAU,MAAI,SAAS,EAAM,SAAS,CAAC,EAAG,CAAO,EAAU,EAAO,OAAO,EAAK,CAAO,EAAiB,GAAY,EAAM,IAAM,CAAC,GAAK,CAAC,WAAS,WAAS,WAAS,GAAG,GAAM,EAAM,OAAO,EAAsB,EAAK,EAAU,CAAC,GAAG,EAAc,WAAa,MAAa,WAAS,CAAC,CAAc,EAAK,MAAM,CAAC,GAAG,EAAS,MAAa,WAAS,CAAC,EAAG,CAAO,EAAI,qdAA2d,GAAU,CAAC,QAAM,SAAO,KAAG,QAAM,SAAO,GAAG,MAAgB,CAAC,GAAG,EAAM,UAAU,GAAO,EAAM,WAAW,eAAe,UAAU,GAAQ,EAAM,WAAW,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