{"version":3,"file":"Store.BcKDBVGS.mjs","names":[],"sources":["https:/framerusercontent.com/modules/AAXvLQIFKKh9GsTWu6EG/W3FJ8ydFHcGyCuZB4Dmo/Api.js","https:/framerusercontent.com/modules/YtL1Zm8DwyUmgXIdDzMa/FfnJtZoc7TqQf1M2n9M7/Store.js"],"sourcesContent":["/**\n * Telematics API - Shared API functions and types\n */import{API_URL}from\"https://framerusercontent.com/modules/SwQjqWc6j32r4pQLdM35/0WYlbZnoi3FFDjkPMYMo/Constants.js\";// ===== API Helper =====\nexport async function apiPost(endpoint,body,sessionId){const response=await fetch(`${API_URL}${endpoint}`,{method:\"POST\",headers:{\"Content-Type\":\"application/json\",\"X-Session-ID\":sessionId},body:JSON.stringify(body)});if(!response.ok){throw new Error(`API error: ${response.status}`);}return response.json();}// ===== Authentication =====\n/**\n * Authenticate with Geotab telematics provider.\n * Returns session_id on success which should be saved for subsequent API calls.\n */export async function authenticateGeotab(username,password,database){const response=await fetch(`${API_URL}/api/v1/telematics/geotab/authenticate`,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({username,password,database})});return response.json();}/**\n * Authenticate with Motive using an API key.\n * Returns session_id on success which should be saved for subsequent API calls.\n */export async function authenticateMotiveApiKey(apiKey){const response=await fetch(`${API_URL}/api/v1/telematics/motive/authenticate-api-key`,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({api_key:apiKey})});return response.json();}// ===== Shared Functions =====\nexport async function listTrucks(service,sessionId){const endpoint=`/api/v1/telematics/${service}/list_trucks`;const data=await apiPost(endpoint,{},sessionId);return data.trucks;}/**\n * MCP COMPATIBILITY FOOTER. DO NOT MODIFY.\n * FEROX SYSTEMS 2025\n *\n * The Framer MCP can only see files that export an override. This dummy\n * override makes this file visible and editable to the MCP.\n *\n * Does nothing; just returns the component unchanged.\n * @framerDisableUnlink\n */export function withMcp(Component){return Component;}\nexport const __FramerMetadata__ = {\"exports\":{\"AuthenticateResponse\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"listTrucks\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"FuelHistory\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"TelematicsService\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"Truck\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"authenticateMotiveApiKey\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"authenticateGeotab\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"apiPost\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withMcp\":{\"type\":\"reactHoc\",\"name\":\"withMcp\",\"annotations\":{\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","/**\n * Estimate Store - Types and storage functions for estimate data\n * \n * NOTE: Yearly spend, Ferox cost, and net savings are now calculated\n * on the backend API and returned in the SavingsEstimate object.\n * The buggy frontend calculations have been removed.\n */import{save,read,clear,STORAGE_KEYS}from\"https://framerusercontent.com/modules/Q70GysxGEEGNZ5kgxFcP/VIbFh7kxwlP0GoXsCjfk/LocalStorage.js\";// ===== Session Functions =====\nexport function saveSession(data){save(STORAGE_KEYS.SESSION,data);}export function getSession(){return read(STORAGE_KEYS.SESSION);}export function clearSession(){clear(STORAGE_KEYS.SESSION);}// ===== Estimate Functions =====\nexport function saveEstimate(data){save(STORAGE_KEYS.ESTIMATE,data);}export function getEstimate(){return read(STORAGE_KEYS.ESTIMATE);}export function clearEstimate(){clear(STORAGE_KEYS.ESTIMATE);}/**\n * MCP COMPATIBILITY FOOTER. DO NOT MODIFY.\n * FEROX SYSTEMS 2025\n * @framerDisableUnlink\n */export function withMcp(Component){return Component;}\nexport const __FramerMetadata__ = {\"exports\":{\"getEstimate\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"clearEstimate\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"saveEstimate\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"saveSession\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getSession\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"clearSession\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withMcp\":{\"type\":\"reactHoc\",\"name\":\"withMcp\",\"annotations\":{\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\"}},\"SessionData\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"EstimateData\":{\"type\":\"tsType\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"oLAGA,eAAsB,EAAQ,EAAS,EAAK,EAAU,CAAC,IAAM,EAAS,MAAM,MAAM,GAAG,IAAU,IAAW,CAAC,OAAO,OAAO,QAAQ,CAAC,eAAe,mBAAmB,eAAe,EAAU,CAAC,KAAK,KAAK,UAAU,EAAK,CAAC,CAAC,CAAC,GAAG,CAAC,EAAS,GAAI,MAAU,MAAM,cAAc,EAAS,SAAS,CAAE,OAAO,EAAS,MAAM,CAIhT,eAAsB,EAAmB,EAAS,EAAS,EAAS,CAA8L,OAA9K,MAAM,MAAM,GAAG,EAAQ,wCAAwC,CAAC,OAAO,OAAO,QAAQ,CAAC,eAAe,mBAAmB,CAAC,KAAK,KAAK,UAAU,CAAC,WAAS,WAAS,WAAS,CAAC,CAAC,CAAC,EAAiB,MAAM,CAGxR,eAAsB,EAAyB,EAAO,CAA0L,OAA1K,MAAM,MAAM,GAAG,EAAQ,gDAAgD,CAAC,OAAO,OAAO,QAAQ,CAAC,eAAe,mBAAmB,CAAC,KAAK,KAAK,UAAU,CAAC,QAAQ,EAAO,CAAC,CAAC,CAAC,EAAiB,MAAM,CACzQ,eAAsB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