{"version":3,"file":"krlDPa34i.pCSkVsPD.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/n2kju6hoTayc8de8rW3V/lydgdtiT6b3K7pvNkNiA/Time_to_read.js","https:/framerusercontent.com/modules/oHBZpzw0iRrXn5v4PA8H/2RrkhivyLibfeFzSMPyK/krlDPa34i.js"],"sourcesContent":["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}=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];const totalWords=titlesToCount.reduce((sum,title)=>sum+countWords(title),0);setTotalCount(totalWords);},[contentType,title1,title2,title3,title4,title5,title6,title7]);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>\",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\"},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,description:\"v1.2\\n[via SegmentUI](https://www.segmentUI.com)\"},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\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"WordCounter\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any-prefer-auto\",\"framerSupportedLayoutWidth\":\"any-prefer-auto\",\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"*\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Time_to_read.map","// 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 11 4 L 11 9 L 14 12 M 0 8 L 2 10 M 2 10 L 4 8 M 2 10 L 2 9 C 2 4.029 6.029 0 11 0 C 15.971 0 20 4.029 20 9 C 20 13.971 15.971 18 11 18 C 8.335 18 5.94 16.841 4.292 15\" fill=\"transparent\" height=\"18px\" id=\"PJnDJJuCG\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"var(--1ww558a, 2)\" stroke=\"var(--4rxgx6, black)\" transform=\"translate(1 3)\" 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(\"1723535281\",svg);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-4vIms\",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-4vIms { -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 Countdown Arrow\",\"color\":{\"type\":\"variable\",\"value\":\"4rxgx6\"},\"set\":{\"localId\":\"vectorSet/dSZJyzeMx\",\"id\":\"dSZJyzeMx\",\"moduleId\":\"E1vFg1A6wcWAGuFi9Hz1\"}}\n */const Icon=withCSS(Component,css,\"framer-4vIms\");Icon.displayName=\"Clock Time Countdown Arrow\";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\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerIntrinsicWidth\":\"24\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerVector\":\"{\\\"name\\\":\\\"Clock Time Countdown Arrow\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"4rxgx6\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/dSZJyzeMx\\\",\\\"id\\\":\\\"dSZJyzeMx\\\",\\\"moduleId\\\":\\\"E1vFg1A6wcWAGuFi9Hz1\\\"}}\",\"framerIntrinsicHeight\":\"24\",\"framerContractVersion\":\"1\",\"framerVariables\":\"{\\\"CRY1Fpez4\\\":\\\"color\\\",\\\"vet7gqNu_\\\":\\\"width1\\\"}\",\"framerIm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