{"version":3,"file":"Backend_client.ESQk0aFb.mjs","names":[],"sources":["https:/framerusercontent.com/modules/pKQXtSIFOkUZHJ1ZIH57/xasIA5RetlT8iITFSz0n/Env.js","https:/framerusercontent.com/modules/U32JRYBcPmO9IzIRP4Rj/GrFKLNDUaXKzMFWb6e2Q/License_cache.js","https:/framerusercontent.com/modules/b3e85pFcNFtqTX3XSv9e/zOfqbkMdl0fyR3REXbDr/Backend_client.js"],"sourcesContent":["export const ENV={ENVIRONMENT:{development:\"localReact\",staging:\"framer\",production:\"framer\"},BACKEND_URL:{development:\"http://localhost:8787\",staging:\"https://frameship-backend-staging.account-ba7.workers.dev\",production:\"https://frameship-backend.account-ba7.workers.dev\"},BACKEND_API_KEY:{development:\"9692aec79a1b5ad3546e7fa02e1046195a85ff2dee60c1fdecf95d446ff16789\",staging:\"58b5bdccbf6f33a5f381fcfbe85bfa5e242bf5d62fadcb5fc30029290434142d\",production:\"9c170a2a758c830a7b191139343767cea3734f5e8c499e8f21d0dcc3a7979805\"}};\nexport const __FramerMetadata__ = {\"exports\":{\"ENV\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Env.map","function _define_property(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else{obj[key]=value;}return obj;}class LicenseCache{// Get cached license data\nget(){// First check in-memory cache (fastest)\nif(this.memoryCache&&this.memoryCacheTime&&Date.now()-this.memoryCacheTime<this.cacheDuration){return this.memoryCache;}// Then check localStorage (cross-tab persistence)\ntry{const stored=localStorage.getItem(this.cacheKey);if(stored){const parsed=JSON.parse(stored);if(parsed.data&&parsed.timestamp&&Date.now()-parsed.timestamp<this.cacheDuration){// Update memory cache\nthis.memoryCache=parsed.data;this.memoryCacheTime=parsed.timestamp;return parsed.data;}}}catch(error){console.warn(\"Error reading license cache from localStorage:\",error);}return null;}// Set license data in cache\nset(data){const cacheData={data:data,timestamp:Date.now()};// Update memory cache\nthis.memoryCache=data;this.memoryCacheTime=cacheData.timestamp;// Update localStorage\ntry{localStorage.setItem(this.cacheKey,JSON.stringify(cacheData));}catch(error){console.warn(\"Error saving license cache to localStorage:\",error);}}// Clear cache\nclear(){this.memoryCache=null;this.memoryCacheTime=null;try{localStorage.removeItem(this.cacheKey);}catch(error){console.warn(\"Error clearing license cache from localStorage:\",error);}}// Check if cache is valid\nisValid(){const cached=this.get();return cached!==null;}constructor(cacheDuration=6e4){_define_property(this,\"cacheDuration\",void 0);_define_property(this,\"cacheKey\",void 0);_define_property(this,\"memoryCache\",void 0);_define_property(this,\"memoryCacheTime\",void 0);// 1 minute default\nthis.cacheDuration=cacheDuration;this.cacheKey=\"frameship-license-cache\";this.memoryCache=null;this.memoryCacheTime=null;}}// Export singleton instance\nexport const licenseCache=new LicenseCache(6e4);\nexport const __FramerMetadata__ = {\"exports\":{\"licenseCache\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"LicenseCacheData\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./License_cache.map","import{ENV}from\"https://framerusercontent.com/modules/pKQXtSIFOkUZHJ1ZIH57/xasIA5RetlT8iITFSz0n/Env.js\";export async function backendClient(props){const{method,endpoint,params,body}=props;const queryString=new URLSearchParams(params).toString();const url=params?`${ENV.BACKEND_URL.production}${endpoint}?${queryString}`:`${ENV.BACKEND_URL.production}${endpoint}`;const response=await fetch(url,{method,headers:{\"Content-Type\":\"application/json\",\"X-API-Key\":ENV.BACKEND_API_KEY.production},body});if(!response.ok){throw new Error(`Backend API request failed: ${response.status} ${response.statusText}`);}const data=await response.json();return data;}\nexport const __FramerMetadata__ = {\"exports\":{\"backendClient\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"oEAAa,EA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