{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/NF27GMRnRQIwaQZ2G9YY/yEILKTPL9l4PImY26MTI/CreateStore.js", "ssg:https://framerusercontent.com/modules/o1aeipZQQXsUUIIJuQBL/AJapg5p3FgZJZTfbviR3/Constants.js", "ssg:https://framerusercontent.com/modules/RRKeJWRObO6zvJYvvGR6/hdQ8ibaUwcrqqfVEo9k4/Helpers.js"],
  "sourcesContent": ["import{useState,useEffect}from\"react\";import{Data,useObserveData}from\"framer\";export function createStore(initialState,options={}){const{localStorageKey}=options;// Try to load persisted state from localStorage if a key is provided\nlet persistedState=initialState;if(localStorageKey&&typeof window!==\"undefined\"){const saved=window.localStorage.getItem(localStorageKey);if(saved){try{persistedState=JSON.parse(saved);}catch(e){// If there's an error parsing, fall back to initialState\nconsole.warn(\"Could not parse persisted state:\",e);}}}// Use Data so that a Preview reload resets the state\nconst dataStore=Data({state:Object.freeze({...persistedState})});// Create a set function that updates the state in Framer\nconst setDataStore=newState=>{if(typeof newState===\"function\"){newState=newState(dataStore.state);}const updated=Object.freeze({...dataStore.state,...newState});dataStore.state=updated;// Save to localStorage if a key is provided\nif(localStorageKey&&typeof window!==\"undefined\"){window.localStorage.setItem(localStorageKey,JSON.stringify(updated));}};// Store initial state outside of Framer Data\nlet storeState=typeof persistedState===\"object\"?Object.freeze({...persistedState}):persistedState;// 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(typeof newState===\"function\"){newState=newState(storeState);}storeState=typeof newState===\"object\"?Object.freeze({...storeState,...newState}):newState;// Update all connected React components\nstoreSetters.forEach(setter=>setter(storeState));// Save to localStorage if a key is provided\nif(localStorageKey&&typeof window!==\"undefined\"){window.localStorage.setItem(localStorageKey,JSON.stringify(storeState));}};// The hook that components will use\nfunction useStore(){const[state,setState]=useState(storeState);useEffect(()=>{storeSetters.add(setState);return()=>storeSetters.delete(setState);},[]);// If Framer\u2019s Data context is available, use that\nif(useObserveData()===true){useObserveData();return[dataStore.state,setDataStore];}else{// Otherwise, return the React-based global state and setter\nreturn[state,setStoreState];}}return useStore;}// import { useState, useEffect } from \"react\"\n// import { Data, useObserveData } from \"framer\"\n// export function createStored(state1) {\n// // Use Data so that a Preview reload resets the state\n// const dataStore = Data({ state: Object.freeze({ ...state1 }) }) // Create a set function that updates the state\n// const setDataStore = (newState) => {\n//     // If the state is an object, make sure we copy it\n//     if (typeof newState === \"function\") {\n//         newState = newState(dataStore.state)\n//     }\n//     dataStore.state = Object.freeze({ ...dataStore.state, ...newState })\n// } // Store the initial state, copy the object if it's an object\n// let storeState =\n//     typeof state1 === \"object\" ? Object.freeze({ ...state1 }) : state1 // Keep a list of all the listeners, in the form of React hook setters\n// const storeSetters = new Set() // Create a set function that updates all the listeners / setters\n// const setStoreState = (newState) => {\n//     // If the state is an object, make sure we copy it\n//     if (typeof newState === \"function\") {\n//         newState = newState(storeState)\n//     }\n//     storeState =\n//         typeof newState === \"object\"\n//             ? Object.freeze({ ...storeState, ...newState })\n//             : newState // Update all the listeners / setters with the new value\n//     storeSetters.forEach((setter) => setter(storeState))\n// } // Create the actual hook based on everything above\n// function useStore() {\n//     // Create the hook we are going to use as a listener\n//     const [state, setState] = useState(storeState) // If we unmount the component using this hook, we need to remove the listener\n//     // @ts-ignore\n//     useEffect(() => {\n//         // But right now, we need to add the listener\n//         storeSetters.add(setState)\n//         return () => storeSetters.delete(setState)\n//     }, []) // If Data context exists, use Data, otherwise use vanilla React state\n//     if (useObserveData() === true) {\n//         useObserveData()\n//         return [dataStore.state, setDataStore]\n//     } else {\n//         // Return the state and a function to update the central store\n//         return [state, setStoreState]\n//     }\n// }\n// return useStore\n// }\n// export const __FramerMetadata__ = {\n//     exports: {\n//         createStore: {\n//             type: \"function\",\n//             annotations: { framerContractVersion: \"1\" },\n//         },\n//         __FramerMetadata__: { type: \"variable\" },\n//     },\n// }\n// # sourceMappingURL=./createStore.map\n\nexport const __FramerMetadata__ = {\"exports\":{\"createStore\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CreateStore.map", "export const PRODUCT_IDS={proCardMachine:{dev:\"prod_RIlTx0zcK9vlvP\",staging:\"prod_RIlTx0zcK9vlvP\",prod:\"prod_RIlT6LCsQW5VSW\"},essentialCardMachine:{dev:\"prod_RIlThcPn2EnTTZ\",staging:\"prod_RIlThcPn2EnTTZ\",prod:\"prod_RIlT80e1fkgHut\"},goCardMachine:{dev:\"prod_S5wetvPB1U3WOX\",staging:\"prod_S5wetvPB1U3WOX\",prod:\"prod_S5wcEQXgxm7qA1\"}};export const PRICES={essentialCardMachine:179,proCardMachine:89,goCardMachine:69};export const MAX_PRODUCT_QTY=4;export const BACKEND_BASE_URL={dev:\"https://teya-website-backend-staging-2a5295740e60.herokuapp.com\",staging:\"https://teya-website-backend-staging-2a5295740e60.herokuapp.com\",prod:\"https://teya-website-backend-fded4e2e3f27.herokuapp.com\"};export const STRIPE_PUBLISHABLE_KEYS={dev:\"pk_test_51PWy9ICVMebGW4x2D3ttWdYr7lJlqovsdqJgPpnp3YmGkqlsOGF6V9vKA0gMLyEsPkUANjW8Q6e9dgBCKJLIru8700RsQvmVRl\",staging:\"pk_test_51PWy9ICVMebGW4x2D3ttWdYr7lJlqovsdqJgPpnp3YmGkqlsOGF6V9vKA0gMLyEsPkUANjW8Q6e9dgBCKJLIru8700RsQvmVRl\",prod:\"pk_live_51PWy9ICVMebGW4x25KwLbi2pqUiDfgJAGZxArpcUwztIgIEvO3kTNo6vS2OjrfwGL9wEQkepW4DE7XrDdNCz3IA800UTSjnGwD\"};export const PRICE_FORMAT_OPTIONS={GB:{locale:\"en-GB\",options:{style:\"currency\",currency:\"GBP\"}},SK:{locale:\"sk-SK\",options:{style:\"currency\",currency:\"EUR\"}},CZ:{locale:\"cs-CZ\",options:{style:\"currency\",currency:\"CZK\"}},PT:{locale:\"pt-PT\",options:{style:\"currency\",currency:\"EUR\"}},IS:{locale:\"is-IS\",options:{style:\"currency\",currency:\"ISK\"}},HU:{locale:\"hu-HU\",options:{style:\"currency\",currency:\"HUF\"}},HR:{locale:\"hr-HR\",options:{style:\"currency\",currency:\"EUR\"}}};\nexport const __FramerMetadata__ = {\"exports\":{\"PRICES\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"PRODUCT_IDS\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"BACKEND_BASE_URL\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"STRIPE_PUBLISHABLE_KEYS\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"MAX_PRODUCT_QTY\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"PRICE_FORMAT_OPTIONS\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Constants.map", "import{jsx as _jsx}from\"react/jsx-runtime\";import{useLocaleCode,isBrowser}from\"framer\";import{useState,useEffect}from\"react\";import{PRICE_FORMAT_OPTIONS}from\"https://framerusercontent.com/modules/o1aeipZQQXsUUIIJuQBL/AJapg5p3FgZJZTfbviR3/Constants.js\";export function withLogProps(Component){return props=>{console.log(props);return /*#__PURE__*/_jsx(Component,{...props});};}export const useLocale=()=>{const COUNTRY_CODES=[\"GB\",\"CZ\",\"HR\",\"HU\",\"IS\",\"PT\",\"SK\"];const framerCountry=useLocaleCode()?.substring(3,5)||\"GB\";return COUNTRY_CODES.includes(framerCountry)?framerCountry:\"GB\";};export const useEnv=()=>{const[env,setEnv]=useState(isBrowser?\"dev\":\"unknown\");useEffect(()=>{if(isBrowser){const hostname=window.location.hostname;if(hostname.includes(\"framer.app\")){setEnv(\"staging\");}if(hostname.includes(\"www.teya.com\")){setEnv(\"prod\");}}},[]);return env;};export const sentenceToCamelCase=str=>{if(!str)return\"\";return str.replace(/[^a-zA-Z0-9 ]/g,\"\")// Remove non-alphanumeric characters except spaces\n.toLowerCase().split(/\\s+/)// Split on one or more spaces\n.map((word,index)=>{if(index===0)return word;return word.charAt(0).toUpperCase()+word.slice(1);}).join(\"\");};export function formatPrice(number,countryCode,maximumFractionDigits=2){const formatConfig=PRICE_FORMAT_OPTIONS[countryCode]||PRICE_FORMAT_OPTIONS[\"GB\"];if(!formatConfig){throw new Error(\"Unsupported country code\");}const options={...formatConfig.options,maximumFractionDigits};return new Intl.NumberFormat(formatConfig.locale,options).format(number);}\nexport const __FramerMetadata__ = {\"exports\":{\"formatPrice\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"sentenceToCamelCase\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useEnv\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useLocale\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withLogProps\":{\"type\":\"reactHoc\",\"name\":\"withLogProps\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],
  "mappings": "kJAAqF,SAASA,EAAYC,EAAaC,EAAQ,CAAC,EAAE,CAAC,GAAK,CAAC,gBAAAC,CAAe,EAAED,EACtJE,EAAeH,EAAa,GAAGE,GAAiB,OAAOE,EAAS,IAAY,CAAC,IAAMC,EAAMD,EAAO,aAAa,QAAQF,CAAe,EAAE,GAAGG,EAAO,GAAG,CAACF,EAAe,KAAK,MAAME,CAAK,CAAE,OAAOC,EAAE,CAClM,QAAQ,KAAK,mCAAmCA,CAAC,CAAE,CAAE,CACrD,IAAMC,EAAUC,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAGL,CAAc,CAAC,CAAC,CAAC,EACzDM,EAAaC,GAAU,CAAI,OAAOA,GAAW,aAAYA,EAASA,EAASH,EAAU,KAAK,GAAG,IAAMI,EAAQ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IAAME,EAAQ,CAAC,GAAGF,EAAa,QAAQ,sBAAAD,CAAqB,EAAE,OAAO,IAAI,KAAK,aAAaC,EAAa,OAAOE,CAAO,EAAE,OAAOL,CAAM,CAAE",
  "names": ["createStore", "initialState", "options", "localStorageKey", "persistedState", "window", "saved", "e", "dataStore", "Data", "setDataStore", "newState", "updated", "storeState", "storeSetters", "setStoreState", "setter", "useStore", "state", "setState", "ye", "ue", "useObserveData", "PRODUCT_IDS", "PRICES", "MAX_PRODUCT_QTY", "BACKEND_BASE_URL", "STRIPE_PUBLISHABLE_KEYS", "PRICE_FORMAT_OPTIONS", "useLocale", "COUNTRY_CODES", "framerCountry", "useLocaleCode", "useEnv", "env", "setEnv", "ye", "isBrowser", "ue", "hostname", "window", "formatPrice", "number", "countryCode", "maximumFractionDigits", "formatConfig", "PRICE_FORMAT_OPTIONS", "options"]
}
