{
  "version": 3,
  "sources": ["ssg:https://framer.com/m/framer/store.js@^1.0.0", "ssg:https://framerusercontent.com/modules/TbfONFeGM5NK9kIAQu9P/Iv2YlQQp8itk7rvwklqF/millify.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", "// Default options for millify function\nconst defaultOptions={units:[\"\",\"K\",\"M\",\"B\",\"T\"],precision:2};// Utility function to parse input value\nfunction parseValue(value){return isNaN(value)?0:Number(value);}// Utility function to round number to specified precision\nfunction roundTo(value,precision){const multiplier=Math.pow(10,precision);return Math.round(value*multiplier)/multiplier;}// Generator function to divide the number until a suitable unit is found\nfunction*divider(value){let index=0;while(value>=1e3&&index<defaultOptions.units.length-1){value/=1e3;index++;yield{value,index};}}// The main millify function to convert numbers to human-readable strings\nfunction millify(value,options={}){// Merge default options with user-provided options\nconst opts={...defaultOptions,...options};let parsedValue=parseValue(value);let unitIndex=0;// Use the divider generator to find the appropriate unit and value\nfor(const result of divider(parsedValue)){parsedValue=result.value;unitIndex=result.index;}// Round the value to the desired precision\nconst roundedValue=roundTo(parsedValue,opts.precision);// Construct the final string with the unit\nreturn`${roundedValue}${opts.units[unitIndex]}`;}// Export the millify function for external use\nexport{millify};export default millify;\nexport const __FramerMetadata__ = {\"exports\":{\"millify\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./millify.map"],
  "mappings": "yIAAAA,IAAqF,SAASC,EAAYC,EAAO,CACjH,IAAMC,EAAUC,EAAK,CAAC,MAAM,OAAO,OAAO,CAAC,GAAGF,CAAM,CAAC,CAAC,CAAC,EACjDG,EAAaC,GAAU,CAC1B,OAAOA,GAAW,aAAYA,EAASA,EAASH,EAAU,KAAK,GAAGA,EAAU,MAAM,OAAO,OAAO,CAAC,GAAGA,EAAU,MAAM,GAAGG,CAAQ,CAAC,CAAE,EACjIC,EAAW,OAAOL,GAAS,SAAS,OAAO,OAAO,CAAC,GAAGA,CAAM,CAAC,EAAEA,EAC7DM,EAAa,IAAI,IACjBC,EAAcH,GAAU,CAC3B,OAAOA,GAAW,aAAYA,EAASA,EAASC,CAAU,GAAGA,EAAW,OAAOD,GAAW,SAAS,OAAO,OAAO,CAAC,GAAGC,EAAW,GAAGD,CAAQ,CAAC,EAAEA,EACjJE,EAAa,QAAQE,GAAQA,EAAOH,CAAU,CAAC,CAAE,EACjD,SAASI,GAAU,CACnB,GAAK,CAACC,EAAMC,CAAQ,EAAEC,EAASP,CAAU,EAIzC,OAFAQ,EAAU,KACVP,EAAa,IAAIK,CAAQ,EAAQ,IAAIL,EAAa,OAAOK,CAAQ,GAAI,CAAC,CAAC,EACpEG,EAAe,IAAI,IAAMA,EAAe,EAAQ,CAACb,EAAU,MAAME,CAAY,GAC1E,CAACO,EAAMH,CAAa,CAAG,CAAC,OAAOE,CAAS,CCf9CM,IACA,IAAMC,EAAe,CAAC,MAAM,CAAC,GAAG,IAAI,IAAI,IAAI,GAAG,EAAE,UAAU,CAAC,EAC5D,SAASC,EAAWC,EAAM,CAAC,OAAO,MAAMA,CAAK,EAAE,EAAE,OAAOA,CAAK,CAAE,CAC/D,SAASC,EAAQD,EAAME,EAAU,CAAC,IAAMC,EAAW,KAAK,IAAI,GAAGD,CAAS,EAAE,OAAO,KAAK,MAAMF,EAAMG,CAAU,EAAEA,CAAW,CACzH,SAASC,EAAQJ,EAAM,CAAC,IAAIK,EAAM,EAAE,KAAML,GAAO,KAAKK,EAAMP,EAAe,MAAM,OAAO,GAAGE,GAAO,IAAIK,IAAQ,KAAK,CAAC,MAAAL,EAAM,MAAAK,CAAK,CAAG,CAClI,SAASC,EAAQN,EAAMO,EAAQ,CAAC,EAAE,CAClC,IAAMC,EAAK,CAAC,GAAGV,EAAe,GAAGS,CAAO,EAAME,EAAYV,EAAWC,CAAK,EAAMU,EAAU,EAC1F,QAAUC,KAAUP,EAAQK,CAAW,EAAGA,EAAYE,EAAO,MAAMD,EAAUC,EAAO,MAEpF,MAAM,GADaV,EAAQQ,EAAYD,EAAK,SAAS,CAChC,GAAGA,EAAK,MAAME,CAAS,CAAC,EAAG,CAChC,IAAOE,EAAQC",
  "names": ["init_ssg_sandbox_shims", "createStore", "state1", "dataStore", "Data", "setDataStore", "newState", "storeState", "storeSetters", "setStoreState", "setter", "useStore", "state", "setState", "ye", "ue", "useObserveData", "init_ssg_sandbox_shims", "defaultOptions", "parseValue", "value", "roundTo", "precision", "multiplier", "divider", "index", "millify", "options", "opts", "parsedValue", "unitIndex", "result", "millify_default", "millify"]
}
