{"version":3,"file":"Excerpt_limit.Ddy-RCLA.mjs","names":[],"sources":["https:/framerusercontent.com/modules/8ZSFOf6lqv4BYdl6ld9X/lWmkCbQCSwOh0CSIesVx/Excerpt_limit.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{randomColor}from\"https://framer.com/m/framer/utils.js@^0.9.0\";// Store for sharing state\nconst useStore=createStore({background:\"#0099FF\"});// HOC to add rotation animation\nexport function withRotate(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,animate:{rotate:90},transition:{duration:2}});};}// HOC to add hover scaling\nexport function withHover(Component){return props=>{return /*#__PURE__*/_jsx(Component,{...props,whileHover:{scale:1.05}});};}// HOC to change background color randomly on click\nexport function withRandomColor(Component){return props=>{const[store,setStore]=useStore();return /*#__PURE__*/_jsx(Component,{...props,animate:{background:store.background},onClick:()=>{setStore({background:randomColor()});}});};}// HOC to limit characters in a text component, suitable for Framer Content elements\nexport function withCharacterLimit(Component){return props=>{const{text,...otherProps}=props;const limit=60// Set the character limit\n;let trimmedText=text;if((text===null||text===void 0?void 0:text.length)>limit){trimmedText=text.slice(0,limit).trim();// Remove any trailing dot and add ellipsis\nif(trimmedText.endsWith(\".\")){trimmedText=trimmedText.slice(0,-1).trim();}trimmedText+=\"...\";}return /*#__PURE__*/_jsx(Component,{...otherProps,text:trimmedText});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withRotate\":{\"type\":\"reactHoc\",\"name\":\"withRotate\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withHover\":{\"type\":\"reactHoc\",\"name\":\"withHover\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withCharacterLimit\":{\"type\":\"reactHoc\",\"name\":\"withCharacterLimit\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withRandomColor\":{\"type\":\"reactHoc\",\"name\":\"withRandomColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Excerpt_limit.map"],"mappings":"sMAKA,SAAgB,EAAmB,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,OAAK,GAAG,GAAY,EAClF,EAAY,EAC6E,OADpE,GAAuC,OAAQ,KAAO,EAAY,EAAK,MAAM,EAAE,EAAK,CAAC,CAAC,KAAK,EAClH,EAAY,SAAS,GAAG,IAAG,EAAY,EAAY,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,GAAG,GAAa,OAA2B,EAAK,EAAU,CAAC,GAAG,EAAW,KAAK,CAAW,CAAC,CAAE,CAAE,iBAP3H,IAAqE,IAAqE,EACrK,EAAY,CAAC,WAAW,SAAS,CAAC"}