{"version":3,"file":"ArticleReadTime.C_PBJTn5.mjs","names":["mask","SVG","forwardRef","_jsx","getProps","Icon","React.forwardRef","forwardRef","_jsx","React.forwardRef","_jsx","React","__esmMin","npm_react_18_3_1_exports","c","J","init_jsx_runtime","init_npm_react_18_3_1","cx","addPropertyControls","withCSS","init_framer_BWzg2IRg","ControlType","motion","mask$1","SVG$1","getProps$1","Icon$1","init_HaRsYXyM7","props","ref","animated","layoutId","children","rest","height","id","stroke","width","style","className","variant","UO5clYVeQ","restProps","mask","SVG","getProps","Icon","init_KWJFL9E3H","ArticleReadTime","text","richText","formatted","wpm","prefix","suffix","textColor","font","wordCount","useMemo","content","extractText","node","minutes","rawMinutes","readTimeText","init_ArticleReadTime"],"sources":["https:/framerusercontent.com/modules/kUdWB3WNWrJ5OJFzvbkt/uvEd8qo1MBBr8GtT5vlD/HaRsYXyM7.js","https:/framerusercontent.com/modules/qWXc86Mgrtt3h78sDulX/E7xZCIcnCQShwN5vHgtO/KWJFL9E3H.js","https:/framerusercontent.com/modules/nPkcej7uBXX23cYK7U6J/HhXteW4XVXRlHUbCsJEH/ArticleReadTime.js"],"sourcesContent":["// Generated by Framer (6ca5d98)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask='url(\\'data:image/svg+xml,<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 14 0 L 0 0\" fill=\"transparent\" height=\"1px\" id=\"clgh_hWer\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" stroke=\"var(--43q7um, rgb(0,0,0))\" transform=\"translate(5 12)\" width=\"14px\"/><path d=\"M 7 14 L 0 7 L 7 0\" fill=\"transparent\" height=\"14px\" id=\"UFl1uCQr0\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" stroke=\"var(--43q7um, rgb(0,0,0))\" transform=\"translate(5 5)\" width=\"7px\"/></svg>\\') alpha no-repeat center / auto var(--framer-icon-mask-mode, add), var(--framer-icon-mask, none)';const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(motion.div,{...rest,layoutId:layoutId,ref:ref}):/*#__PURE__*/_jsx(\"div\",{...rest,ref:ref});});const getProps=({height,id,stroke,width,...props})=>{return{...props,UO5clYVeQ:stroke??props.UO5clYVeQ??\"rgb(0, 0, 0)\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,UO5clYVeQ,...restProps}=getProps(props);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-nHkCo\",className),layoutId:layoutId,ref:ref,style:{\"--43q7um\":UO5clYVeQ,...style}});});const css=[`.framer-nHkCo { -webkit-mask: ${mask}; aspect-ratio: 1; background-color: var(--43q7um); 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 {\"UO5clYVeQ\":\"stroke\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Arrow Left\",\"color\":{\"type\":\"variable\",\"value\":\"43q7um\"},\"set\":{\"localId\":\"vectorSet/T8qKXkLfy\",\"id\":\"T8qKXkLfy\",\"moduleId\":\"fiHEoJwBMFnT6QLOcpPz\"}}\n * @framerDisableUnlink true\n */const Icon=withCSS(Component,css,\"framer-nHkCo\");Icon.displayName=\"Arrow Left\";export default Icon;addPropertyControls(Icon,{UO5clYVeQ:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Stroke\",type:ControlType.Color}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"true\",\"framerIntrinsicWidth\":\"24\",\"framerImmutableVariables\":\"true\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerVariables\":\"{\\\"UO5clYVeQ\\\":\\\"stroke\\\"}\",\"framerVector\":\"{\\\"name\\\":\\\"Arrow Left\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"43q7um\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/T8qKXkLfy\\\",\\\"id\\\":\\\"T8qKXkLfy\\\",\\\"moduleId\\\":\\\"fiHEoJwBMFnT6QLOcpPz\\\"}}\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"24\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// Generated by Framer (6ca5d98)\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType,cx,motion,withCSS}from\"framer\";import*as React from\"react\";import{forwardRef}from\"react\";const mask='url(\\'data:image/svg+xml,<svg display=\"block\" role=\"presentation\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 0 0 L 14 0\" fill=\"transparent\" height=\"1px\" id=\"lS0BCfang\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" stroke=\"var(--43q7um, rgb(0,0,0))\" transform=\"translate(5 12)\" width=\"14px\"/><path d=\"M 0 0 L 7 7 L 0 14\" fill=\"transparent\" height=\"14px\" id=\"qiUgiS3ny\" stroke-dasharray=\"\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" stroke=\"var(--43q7um, rgb(0,0,0))\" transform=\"translate(12 5)\" width=\"7px\"/></svg>\\') alpha no-repeat center / auto var(--framer-icon-mask-mode, add), var(--framer-icon-mask, none)';const SVG=/*#__PURE__*/forwardRef((props,ref)=>{const{animated,layoutId,children,...rest}=props;return animated?/*#__PURE__*/_jsx(motion.div,{...rest,layoutId:layoutId,ref:ref}):/*#__PURE__*/_jsx(\"div\",{...rest,ref:ref});});const getProps=({height,id,stroke,width,...props})=>{return{...props,UO5clYVeQ:stroke??props.UO5clYVeQ??\"rgb(0, 0, 0)\"};};const Component=/*#__PURE__*/React.forwardRef(function(props,ref){const{style,className,layoutId,variant,UO5clYVeQ,...restProps}=getProps(props);return /*#__PURE__*/_jsx(SVG,{...restProps,className:cx(\"framer-1K87s\",className),layoutId:layoutId,ref:ref,style:{\"--43q7um\":UO5clYVeQ,...style}});});const css=[`.framer-1K87s { -webkit-mask: ${mask}; aspect-ratio: 1; background-color: var(--43q7um); 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 {\"UO5clYVeQ\":\"stroke\"}\n * @framerImmutableVariables true\n * @framerVector {\"name\":\"Arrow Right\",\"color\":{\"type\":\"variable\",\"value\":\"43q7um\"},\"set\":{\"localId\":\"vectorSet/T8qKXkLfy\",\"id\":\"T8qKXkLfy\",\"moduleId\":\"fiHEoJwBMFnT6QLOcpPz\"}}\n * @framerDisableUnlink true\n */const Icon=withCSS(Component,css,\"framer-1K87s\");Icon.displayName=\"Arrow Right\";export default Icon;addPropertyControls(Icon,{UO5clYVeQ:{defaultValue:\"rgb(0, 0, 0)\",hidden:false,title:\"Stroke\",type:ControlType.Color}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Icon\",\"slots\":[],\"annotations\":{\"framerImmutableVariables\":\"true\",\"framerVector\":\"{\\\"name\\\":\\\"Arrow Right\\\",\\\"color\\\":{\\\"type\\\":\\\"variable\\\",\\\"value\\\":\\\"43q7um\\\"},\\\"set\\\":{\\\"localId\\\":\\\"vectorSet/T8qKXkLfy\\\",\\\"id\\\":\\\"T8qKXkLfy\\\",\\\"moduleId\\\":\\\"fiHEoJwBMFnT6QLOcpPz\\\"}}\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"24\",\"framerVariables\":\"{\\\"UO5clYVeQ\\\":\\\"stroke\\\"}\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerDisableUnlink\":\"true\",\"framerIntrinsicWidth\":\"24\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","// Article Read Time component as requested:\n// - Calculates article read time and word count\n// - Accepts plain or formatted text, switchable via toggle\n// - Adjustable WPM (words per minute)\n// - Controllable font and font color\n// - Prefix and suffix around the calculated figure\nimport{jsx as _jsx}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";const{useMemo}=React;/**\n * Article Read Time\n *\n * @framerIntrinsicWidth 160\n * @framerIntrinsicHeight 32\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function ArticleReadTime(props){const{text,richText,formatted,wpm,prefix,suffix,textColor,font}=props;const wordCount=useMemo(()=>{let content=\"\";if(formatted&&richText){// Recursively extract all text from the rich text tree\nconst extractText=node=>{if(!node)return\"\";// If it's a string, return it\nif(typeof node===\"string\"){return node;}// If it's an array, process each item\nif(Array.isArray(node)){return node.map(extractText).join(\" \");}// If it's an object, check various properties\nif(typeof node===\"object\"){// Check for text property\nif(typeof node.text===\"string\"){return node.text;}// Check for children array\nif(node.children&&Array.isArray(node.children)){return node.children.map(extractText).join(\" \");}// Check for props.children (React element structure)\nif(node.props&&node.props.children){return extractText(node.props.children);}// Try to stringify if it's an object\nreturn Object.values(node).map(extractText).join(\" \");}return\"\";};content=extractText(richText);// Strip any remaining HTML tags\ncontent=content.replace(/<[^>]*>/g,\" \");}else if(text){content=text;}if(!content)return 0;// Normalize whitespace and count words\nconst words=content.replace(/\\s+/g,\" \").trim().split(\" \").filter(Boolean);return words.length;},[text,richText,formatted]);const minutes=useMemo(()=>{if(!wpm||wpm<=0||wordCount===0)return 0;const rawMinutes=wordCount/wpm;return Math.max(1,Math.round(rawMinutes));},[wordCount,wpm]);// Check if no content is provided\nconst hasContent=formatted?!!richText:!!text;if(!hasContent){return /*#__PURE__*/_jsx(\"p\",{style:{...props.style,color:textColor,margin:0,opacity:.5,...font},children:\"Connect text content.\"});}const readTimeText=`${prefix}${minutes}${suffix}`;return /*#__PURE__*/_jsx(\"p\",{style:{...props.style,color:textColor,margin:0,whiteSpace:\"nowrap\",...font},children:readTimeText});}addPropertyControls(ArticleReadTime,{formatted:{type:ControlType.Boolean,title:\"Formatted\",defaultValue:true},text:{type:ControlType.String,title:\"Text\",hidden(props){return props.formatted;}},richText:{type:ControlType.RichText,title:\"Text\",hidden(props){return!props.formatted;}},wpm:{type:ControlType.Number,title:\"WPM\",description:\"Words per minute\",defaultValue:80,min:20,max:300,step:10,displayStepper:true},prefix:{type:ControlType.String,title:\"Prefix\",defaultValue:\"\",placeholder:\"\"},suffix:{type:ControlType.String,title:\"Suffix\",defaultValue:\" min read\",placeholder:\" e.g. ' min read'\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ArticleReadTime\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"160\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerIntrinsicHeight\":\"32\"}},\"ArticleReadTimeProps\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ArticleReadTime.map"],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