{"version":3,"file":"ChangeColorByBookColor.CFf3lRFT.mjs","names":["useState","useState"],"sources":["https:/framerusercontent.com/modules/Z2OqXsCtHbtHc7WIKZqH/qXBmoF2bjqfowF0vRg7i/ChangeBookImageOverride.js","https:/framerusercontent.com/modules/P3GIdKezsV1txwjfdv0K/kRQ7W6kzInFkjqcSZPbZ/ChangeColorByBookColor.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";export function overwriteBookImageByColor(Component){return props=>{const[src,setSrc]=useState(null);useEffect(()=>{const color=localStorage.getItem(\"book_color\")||\"green\";const colorToImageSrc={green:\"https://framerusercontent.com/images/hZelnsDpkoSBFzj29znjKuuh8E.png\",gray:\"https://framerusercontent.com/images/F24IRG9Fy7YhUcf0GpAk92tz4.png\",white:\"https://framerusercontent.com/images/aUgfpLz16DaYAGGfrAVVSv95xU.png\",blue:\"https://framerusercontent.com/images/1OL1LBDo5GQmZJY6JCR9HlgY5E.png\",red:\"https://framerusercontent.com/images/ONFnvuMTNNQKlulnFtqdzjgr7dg.png\",black:\"https://framerusercontent.com/images/2p4DOZbgT4heZKuqlkFcbYIhSw.png\",golden:\"https://framerusercontent.com/images/apP8TVR91qeaeW9ZlumPacNS6k.png\"};setSrc(colorToImageSrc[color]||colorToImageSrc.black);},[]);if(!src)return null// Or show a loading placeholder\n;return /*#__PURE__*/_jsx(Component,{...props,background:{...props.background,src}});};}\nexport const __FramerMetadata__ = {\"exports\":{\"overwriteBookImageByColor\":{\"type\":\"reactHoc\",\"name\":\"overwriteBookImageByColor\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ChangeBookImageOverride.map","import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState,cloneElement,isValidElement}from\"react\";export function changeTextColorByBookSelection(Component){return props=>{const[color,setColor]=useState(null);useEffect(()=>{const storedColor=localStorage.getItem(\"book_color\")||\"green\";const colorToHex={green:\"#FFFFFF\",gray:\"#000000\",white:\"#000000\",blue:\"#FFFFFF\",red:\"#000000\",black:\"#FFFFFF\",golden:\"#000000\"};setColor(colorToHex[storedColor]||colorToHex.green);},[]);if(!color)return null;// Recursively apply style to children\nconst applyColorToChildren=children=>{if(Array.isArray(children)){return children.map(applyColorToChildren);}if(/*#__PURE__*/isValidElement(children)){return /*#__PURE__*/cloneElement(children,{style:{...children.props.style||{},color},children:applyColorToChildren(children.props.children)});}return children;};const styledChildren=applyColorToChildren(props.children);return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style||{},color},children:styledChildren});};}\nexport const __FramerMetadata__ = {\"exports\":{\"changeTextColorByBookSelection\":{\"type\":\"reactHoc\",\"name\":\"changeTextColorByBookSelection\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ChangeColorByBookColor.map"],"mappings":"iLAAiF,SAAgB,EAA0B,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAI,GAAQC,EAAS,KAAK,CACpL,OADqL,MAAc,CAAC,IAAM,EAAM,aAAa,QAAQ,aAAa,EAAE,QAAc,EAAgB,CAAC,MAAM,sEAAsE,KAAK,qEAAqE,MAAM,sEAAsE,KAAK,sEAAsE,IAAI,uEAAuE,MAAM,sEAAsE,OAAO,sEAAsE,CAAC,EAAO,EAAgB,IAAQ,EAAgB,MAAM,EAAG,EAAE,CAAC,CAAK,EACj1B,EAAK,EAAU,CAAC,GAAG,EAAM,WAAW,CAAC,GAAG,EAAM,WAAW,MAAI,CAAC,CAAC,CAD6xB,uBAAt0B,IAAsC,ICA4B,SAAgB,EAA+B,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAM,GAAUA,EAAS,KAAK,CAAwQ,GAAvQ,MAAc,CAAC,IAAM,EAAY,aAAa,QAAQ,aAAa,EAAE,QAAc,EAAW,CAAC,MAAM,UAAU,KAAK,UAAU,MAAM,UAAU,KA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