{"version":3,"file":"SiteOverides.CvmSpxDo.mjs","names":["useStore","useState","_Fragment"],"sources":["https:/framer.com/m/framer/store.js@^1.0.0","https:/framerusercontent.com/modules/7Tdjc7SBLeal4v67Aypm/swup1apbhDvO7AK781MI/SiteOverides.js"],"sourcesContent":["import{useState,useEffect}from\"react\";import{Data,useObserveData}from\"framer\";export function createStore(state1){// Use Data so that a Preview reload resets the state\nconst dataStore=Data({state:Object.freeze({...state1})});// Create a set function that updates the state\nconst setDataStore=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(dataStore.state);}dataStore.state=Object.freeze({...dataStore.state,...newState});};// Store the initial state, copy the object if it's an object\nlet storeState=typeof state1===\"object\"?Object.freeze({...state1}):state1;// Keep a list of all the listeners, in the form of React hook setters\nconst storeSetters=new Set();// Create a set function that updates all the listeners / setters\nconst setStoreState=newState=>{// If the state is an object, make sure we copy it\nif(typeof newState===\"function\"){newState=newState(storeState);}storeState=typeof newState===\"object\"?Object.freeze({...storeState,...newState}):newState;// Update all the listeners / setters with the new value\nstoreSetters.forEach(setter=>setter(storeState));};// Create the actual hook based on everything above\nfunction useStore(){// Create the hook we are going to use as a listener\nconst[state,setState]=useState(storeState);// If we unmount the component using this hook, we need to remove the listener\n// @ts-ignore\nuseEffect(()=>{// But right now, we need to add the listener\nstoreSetters.add(setState);return()=>storeSetters.delete(setState);},[]);// If Data context exists, use Data, otherwise use vanilla React state\nif(useObserveData()===true){useObserveData();return[dataStore.state,setDataStore];}else{// Return the state and a function to update the central store\nreturn[state,setStoreState];}}return useStore;}\nexport const __FramerMetadata__ = {\"exports\":{\"createStore\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./createStore.map","// A component by Chris Kellett framerverse.com\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";// --------------------------------------------------------------------------\n// SITE - Frame to Form.\n// Wraps any Frame in a form with submitURL and redirectURL properties\nexport function FormWrapper(Component){return function EnhancedComponent(props){const{//UPDATE HERE: Change these URLs to your own.\nsubmitURL=\"https://www.submitck.com\",redirectURL=\"https://www.redirectck.com\"}=props;return /*#__PURE__*/_jsxs(\"form\",{action:submitURL,style:{display:\"flex\",flexDirection:\"column\",alignItems:\"left\",width:\"100%\",WebkitAppearance:\"none\"},children:[/*#__PURE__*/_jsx(\"input\",{type:\"hidden\",name:\"_redirect\",value:redirectURL}),/*#__PURE__*/_jsx(Component,{...props})]});};}// --------------------------------------------------------------------------\n// SITE - Truncate Text.\n// Truncate the text in the customer comments\nexport function withCharacterTruncateComments(Component){return props=>{const maxCharactersComments=120//Set the maximum characters here\n;const averageCharactersPerLine=50// Adjust this value according to your content\n;const maxLines=Math.ceil(maxCharactersComments/averageCharactersPerLine);const styles={...props===null||props===void 0?void 0:props.style,WebkitLineClamp:`${maxLines}`,WebkitBoxOrient:\"vertical\",textOverflow:\"ellipsis\",display:\"-webkit-box\",overflow:\"hidden\"};return /*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/_jsx(Component,{...props,style:styles})});};}//--------------------------------------------------------------------------\n// Truncate the text in the customer work comments\nexport function withCharacterTruncateWork(Component){return props=>{const maxCharactersWork=220// Set a default value for maxCharactersWork\n;const averageCharactersPerLine=50// Adjust this value according to your content\n;const maxLines=Math.ceil(maxCharactersWork/averageCharactersPerLine);const styles={...props===null||props===void 0?void 0:props.style,WebkitLineClamp:`${maxLines}`,WebkitBoxOrient:\"vertical\",textOverflow:\"ellipsis\",display:\"-webkit-box\",overflow:\"hidden\"};return /*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/_jsx(Component,{...props,style:styles})});};}// --------------------------------------------------------------------------\n// BLOG - Readtime script.\nconst useStore=createStore({content:\"\",numberOfWords:0,text:\"Store TEXT\"});//Function\n//This looks for <p> tags and uses their content for the calculation to give an approximate read time.\nexport function calculateReadTime(Component){// 3. Return a React component\nreturn props=>{// 4. Grab our store\nconst[store,setStore]=useStore();useEffect(()=>{const allParagraphs=document.querySelectorAll(\"p\");let concatenatedText=\"\";allParagraphs.forEach(paragraph=>{concatenatedText+=paragraph.textContent;});setStore({content:concatenatedText,numberOfWords:concatenatedText.trim().split(/\\s+/).length});},[]);// 5. Return a component with no change\nreturn /*#__PURE__*/_jsx(Component,{...props});};}//Overide\n//This is applied to text on the page. It will automatically show the calculated read time from the function.\nexport function showReadTime(Component){return props=>{const[store]=useStore();return /*#__PURE__*/_jsx(Component,{...props,text:`${Math.ceil(store.numberOfWords/200)} min read`});};}// --------------------------------------------------------------------------\n// BLOG - Share Sheet.\nfunction shareOnLinkedIn(){const currentURL=window.location.href;const linkedinShareURL=`https://www.linkedin.com/shareArticle?mini=true&url=${encodeURIComponent(currentURL)}`;window.open(linkedinShareURL,\"Share\",\"width=600,height=400\");}// Button\nexport function shareOnLinkedInButton(Component){function EnhancedComponent(props){return /*#__PURE__*/_jsx(Component,{...props,onClick:shareOnLinkedIn});}return EnhancedComponent;}//-------------------------------------------\n// Function to share on X\nfunction shareOnX(){const currentURL=window.location.href;const twitterShareURL=`https://twitter.com/intent/tweet?text=${encodeURIComponent(currentURL)}`;window.open(twitterShareURL,\"Share\",\"width=600,height=400\");}// Button\nexport function shareOnXButton(Component){function EnhancedComponent(props){return /*#__PURE__*/_jsx(Component,{...props,onClick:shareOnX});}return EnhancedComponent;}//-------------------------------------------\n// Function\nfunction shareOnFacebook(){const currentURL=window.location.href;const facebookShareURL=`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(currentURL)}`;window.open(facebookShareURL,\"Share\",\"width=600,height=400\");}// Button\nexport function shareOnFacebookButton(Component){function EnhancedComponent(props){return /*#__PURE__*/_jsx(Component,{...props,onClick:shareOnFacebook});}return EnhancedComponent;}//-------------------------------------------\n// Function to share on Pinterest\nfunction shareOnReddit(){const currentURL=window.location.href;const pinterestShareURL=`https://www.reddit.com/submit?url=${encodeURIComponent(currentURL)}&media=${encodeURIComponent(currentURL)}`;window.open(pinterestShareURL,\"Share\",\"width=600,height=400\");}// Button\nexport function shareOnRedditButton(Component){function EnhancedComponent(props){return /*#__PURE__*/_jsx(Component,{...props,onClick:shareOnReddit});}return EnhancedComponent;}//-------------------------------------------\n// Function\nfunction shareViaEmail(){const currentURL=window.location.href;const pageTitle=document.title;const mailtoLink=`mailto:?subject=Take a look at this: ${encodeURIComponent(pageTitle)}&body=Found this thought you might like it.%0D%0A%0D%0A${encodeURIComponent(currentURL)}`;window.open(mailtoLink);}// Button\nexport function shareEmailButton(Component){function EnhancedComponent(props){return /*#__PURE__*/_jsx(Component,{...props,onClick:shareViaEmail});}return EnhancedComponent;}//-------------------------------------------\n// Function to print\nfunction printPage(){window.print();}export function PrintButton(Component){function EnhancedComponent(props){return /*#__PURE__*/_jsx(Component,{...props,onClick:printPage});}return EnhancedComponent;}\nexport const __FramerMetadata__ = {\"exports\":{\"shareOnXButton\":{\"type\":\"reactHoc\",\"name\":\"shareOnXButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"shareOnLinkedInButton\":{\"type\":\"reactHoc\",\"name\":\"shareOnLinkedInButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"shareOnRedditButton\":{\"type\":\"reactHoc\",\"name\":\"shareOnRedditButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"FormWrapper\":{\"type\":\"reactHoc\",\"name\":\"FormWrapper\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"PrintButton\":{\"type\":\"reactHoc\",\"name\":\"PrintButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"shareOnFacebookButton\":{\"type\":\"reactHoc\",\"name\":\"shareOnFacebookButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCharacterTruncateWork\":{\"type\":\"reactHoc\",\"name\":\"withCharacterTruncateWork\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"calculateReadTime\":{\"type\":\"reactHoc\",\"name\":\"calculateReadTime\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"shareEmailButton\":{\"type\":\"reactHoc\",\"name\":\"shareEmailButton\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCharacterTruncateComments\":{\"type\":\"reactHoc\",\"name\":\"withCharacterTruncateComments\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"showReadTime\":{\"type\":\"reactHoc\",\"name\":\"showReadTime\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SiteOverides.map"],"mappings":"6SAA8E,SAAgB,EAAY,EAAO,CACjH,IAAM,EAAU,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAG,EAAO,CAAC,CAAC,CAAC,CAClD,EAAa,GAAU,CAC1B,OAAO,GAAW,aAAY,EAAS,EAAS,EAAU,MAAM,EAAE,EAAU,MAAM,OAAO,OAAO,CAAC,GAAG,EAAU,MAAM,GAAG,EAAS,CAAC,EAChI,EAAW,OAAO,GAAS,SAAS,OAAO,OAAO,CAAC,GAAG,EAAO,CAAC,CAAC,EAC7D,EAAa,IAAI,IACjB,EAAc,GAAU,CAC3B,OAAO,GAAW,aAAY,EAAS,EAAS,EAAW,EAAE,EAAW,OAAO,GAAW,SAAS,OAAO,OAAO,CAAC,GAAG,EAAW,GAAG,EAAS,CAAC,CAAC,EACjJ,EAAa,QAAQ,GAAQ,EAAO,EAAW,CAAC,EAChD,SAASA,GAAU,CACnB,GAAK,CAAC,EAAM,GAAUC,EAAS,EAAW,CAK1C,OAHA,OACA,EAAa,IAAI,EAAS,KAAW,EAAa,OAAO,EAAS,EAAG,EAAE,CAAC,CACrE,GAAgB,GAAG,IAAM,GAAgB,CAAO,CAAC,EAAU,MAAM,EAAa,EAC3E,CAAC,EAAM,EAAc,CAAG,OAAOD,mBAfC,IAAwC,ICQ9E,SAAgB,EAA8B,EAAU,CAAC,MAAO,IAAO,CAEtE,IAA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