{"version":3,"file":"AOGkWNGXI.hmfW8X6f.mjs","names":["useStore","useState"],"sources":["https:/framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js","https:/framer.com/m/framer/store.js@^1.0.0","https:/framerusercontent.com/modules/i0t7IJbQQHtWYJbu84q4/L32OAHQr9FJKDtwZwGHy/Theme_switcher.js","https:/framerusercontent.com/modules/krwLj9BrYPRzTuifqDJv/WfBE9AW7puVG7OfnzcbS/AOGkWNGXI.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","/*\n * createStore (framer/store@1.0.1)\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/vj7bFUjvEQFgEzNBkdoG/vf3CKm378wlVcBk7IhSU/createStore.js\"\n","import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";const useStore=createStore({// Set the starting theme below, otherwise default to system.\ntheme:\"system\"});const changeTheme=theme=>{const htmlElement=document.getElementsByTagName(\"html\")[0];const bodyElement=document.getElementsByTagName(\"body\")[0];htmlElement.setAttribute(\"toggle-theme\",`${theme}`);bodyElement.setAttribute(\"toggle-theme\",`${theme}`);localStorage.setItem(\"theme\",`${theme}`);// Trigger event that is compatible with Framestack Theme Image Component\nconst event=new Event(\"themeChange\");window.dispatchEvent(event);return;};export function withSingleToggle(Component){return props=>{const[store,setStore]=useStore();useEffect(()=>{// If starting theme is other than light/dark then match device theme.\nif(store.theme!==\"dark\"&&store.theme!==\"light\"){// Detect system theme\nconst mediaQuery=window.matchMedia(\"(prefers-color-scheme: dark)\");let newTheme=mediaQuery.matches?\"dark\":\"light\";// Set store theme\nsetStore({theme:newTheme});localStorage.setItem(\"theme\",`${newTheme}`);}else{// Set the starting theme based on store\nlocalStorage.setItem(\"theme\",`${store.theme}`);}// Create attributes on html and body so that theme will be applied based on store\nconst htmlElement=document.getElementsByTagName(\"html\")[0];const bodyElement=document.getElementsByTagName(\"body\")[0];htmlElement&&htmlElement.setAttribute(\"toggle-theme\",`${store.theme}`);bodyElement&&bodyElement.setAttribute(\"toggle-theme\",`${store.theme}`);// Create sets of light and dark mode tokens\nlet lightThemeTokens=[];let darkThemeTokens=[];for(let i=0;i<document.styleSheets.length;i++){const sheet=document.styleSheets[i];try{for(let rule of sheet.cssRules){// Get light and dark mode tokens\nif(rule.selectorText===\"body\"){const style=rule.style;for(let j=0;j<style.length;j++){const propertyName=style[j];if(propertyName.includes(\"--token\")){const value=style.getPropertyValue(propertyName);// Check for specific tokens or list all\nconst combinedCssRule=`${propertyName}: ${value};`;lightThemeTokens.push(combinedCssRule);}}lightThemeTokens=lightThemeTokens.join(\" \");}else if(rule.conditionText===\"(prefers-color-scheme: dark)\"){const cssTextIgnore=\"body:not([data-framer-theme])\";if(!rule.cssText.includes(cssTextIgnore)){const mediaRulesString=rule.cssRules[0].cssText.replace(\"body\",\"\").replace(/\\s*{\\s*/,\"\").replace(/\\s*}\\s*$/,\"\");darkThemeTokens=mediaRulesString;}}}}catch(e){console.warn(\"Cannot access stylesheet:\",sheet.href);}}// Create styleSheet with id and populate with correct CSS text\nlet styleElement=document.createElement(\"style\");styleElement.id=\"toggle-theme\";const customCssRule=`body[toggle-theme=\"light\"] {${lightThemeTokens}} body[toggle-theme=\"dark\"]{${darkThemeTokens}} html[toggle-theme=\"light\"] { color-scheme: light; } html[toggle-theme=\"dark\"] { color-scheme: dark; }`;styleElement.textContent=customCssRule;document.head.appendChild(styleElement);// Cleanup function\nreturn()=>{// Check if the style element exists and remove it\nconst existingStyleElement=document.getElementById(\"toggle-theme\");if(existingStyleElement){document.head.removeChild(existingStyleElement);}htmlElement&&htmlElement.setAttribute(\"toggle-theme\",\"system\");bodyElement&&bodyElement.setAttribute(\"toggle-theme\",\"system\");};},[]);const handleClick=()=>{let newTheme=store.theme===\"light\"?\"dark\":\"light\";setStore({theme:newTheme});changeTheme(newTheme);};return /*#__PURE__*/_jsx(Component,{...props,variant:store.theme===\"light\"?\"Light\":\"Dark\",whileHover:{scale:.9},onClick:handleClick});};}\nexport const __FramerMetadata__ = {\"exports\":{\"withSingleToggle\":{\"type\":\"reactHoc\",\"name\":\"withSingleToggle\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Theme_switcher.map","import{fontStore}from\"framer\";fontStore.loadFonts([]);export const fonts=[];export const css=['.framer-8Wjng .framer-styles-preset-179mysu:not(.rich-text-wrapper), .framer-8Wjng .framer-styles-preset-179mysu.rich-text-wrapper a { --framer-link-current-text-color: #111111; --framer-link-current-text-decoration: underline; --framer-link-hover-text-color: var(--token-8ed0f524-5690-4ee5-ae11-cc9b60d389b9, #000000) /* {\"name\":\"Primary Font Color\"} */; --framer-link-hover-text-decoration: none; --framer-link-text-color: var(--token-6f65be5b-d434-40c7-9377-eff99acd05cd, #8f8f8f); --framer-link-text-decoration: none; }'];export const className=\"framer-8Wjng\";\nexport const __FramerMetadata__ = {\"exports\":{\"css\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"className\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"fonts\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"uMAA8E,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,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