{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/LrldJJ60fjHs91m6XdHT/2FUoEFQ8UfRjbsZiejBU/SharedStore.js", "ssg:https://framerusercontent.com/modules/ajKYBgRXgNyNgL1GkpqG/prknJU66nI5iRE43ff6z/ProductState.js", "ssg:https://framerusercontent.com/modules/Be5mN5EUhdOwl54qCG8y/Icj1ZU450uFtWcyrdGTm/CartItemContext.js", "ssg:https://framerusercontent.com/modules/Ncx6rwHWSXe5kU34gWm3/ODkUbH8JS0kgmkT2t1Ml/ProductInfoLabel.js"],
  "sourcesContent": ["import create from\"zustand\";const WINDOW_STORES_KEY=\"__frameship_stores__\";// Initialize the shared stores object if it doesn't exist\nconst initializeStores=()=>{if(typeof window!==\"undefined\"&&!window[WINDOW_STORES_KEY]){window[WINDOW_STORES_KEY]={};}};// Call initialization on client side\nif(typeof window!==\"undefined\"){initializeStores();}/**\n * Creates a shared Zustand store that can be accessed across different instances\n * @param id - Unique identifier for the store\n * @param config - Configuration object containing version, state creator, and optional migrator\n * @returns A Zustand store that is shared across instances with the same id\n */export function createSharedStore(id,config){const{version,createState,migrateState}=config;// Return a dummy store during SSR\nif(typeof window===\"undefined\"){return create(createState);}// Ensure stores are initialized\ninitializeStores();const existingStore=window[WINDOW_STORES_KEY][id];// If the store exists and has a higher or equal version, return it\nif(existingStore&&existingStore.version>=version){return existingStore.store;}// Create a new store\nconst store=create(createState);// If there's an existing store, migrate the state using either the provided migrator or the default one\nif(existingStore){const currentState=existingStore.store.getState();const migratedState=migrateState?migrateState(currentState):defaultMigrateState(currentState);store.setState(migratedState);}// Store the new version and store\nwindow[WINDOW_STORES_KEY][id]={store,version};return store;}/**\n * Gets an existing shared store by its ID\n * @param id - The ID of the store to retrieve\n * @returns The store if it exists, undefined otherwise\n */export function getSharedStore(id){if(typeof window===\"undefined\")return undefined;// Ensure stores are initialized\ninitializeStores();return window[WINDOW_STORES_KEY][id]?.store;}/**\n * Gets the version of a shared store by its ID\n * @param id - The ID of the store to check\n * @returns The version number if the store exists, undefined otherwise\n */export function getSharedStoreVersion(id){if(typeof window===\"undefined\")return undefined;// Ensure stores are initialized\ninitializeStores();return window[WINDOW_STORES_KEY][id]?.version;}/**\n * Default migration function that copies all non-function properties from the old state\n */function defaultMigrateState(oldState){const newState={};for(const key in oldState){if(typeof oldState[key]!==\"function\"){newState[key]=oldState[key];}}return newState;}\nexport const __FramerMetadata__ = {\"exports\":{\"getSharedStoreVersion\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"createSharedStore\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getSharedStore\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SharedStore.map", "import{useMemo}from\"react\";import{createSharedStore}from\"https://framerusercontent.com/modules/LrldJJ60fjHs91m6XdHT/2FUoEFQ8UfRjbsZiejBU/SharedStore.js\";import{parseShopifyData}from\"https://framerusercontent.com/modules/gd3dcT3w5rYoRy7ZcKte/sH6FZizM8jJ11j2dQOhQ/Shared.js\";export const useProductStore=createSharedStore(\"product-store\",{version:1,createState:set=>({products:{},setSelectedVariantOption:(productId,variantOption,option)=>set(state=>({products:{...state.products,[productId]:{...state.products[productId],selectedVariantOptions:{...state.products[productId]?.selectedVariantOptions,[variantOption]:option}}}})),setQuantity:(productId,quantity)=>{set(state=>({products:{...state.products,[productId]:{...state.products?.[productId],quantity:Math.max(quantity,1)}}}));}}),migrateState:oldState=>{return{products:oldState.products};}});export function useSelectedVariant(shopifyData){const parsedData=useMemo(()=>parseShopifyData(shopifyData),[shopifyData]);const{shopifyId,variants}=parsedData;const selectedVariantOptions=useProductStore(state=>state.products[shopifyId]?.selectedVariantOptions);const selectedVariant=useMemo(()=>{if(!Array.isArray(variants)||!selectedVariantOptions){return variants[0];}for(const variant of variants){if(variant.selectedOptions.every(option=>selectedVariantOptions[option.name]===option.value)){return variant;}}return variants[0];},[variants,selectedVariantOptions]);return selectedVariant;}\nexport const __FramerMetadata__ = {\"exports\":{\"useSelectedVariant\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useProductStore\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}", "import{createContext,useContext}from\"react\";export const CartItemContext=/*#__PURE__*/createContext({inCart:false,cartItemId:null,shopifyId:null,variantId:null,quantity:1,price:null,compareAtPrice:null,sku:null,barcode:null,variant:null});export const useCartItem=()=>useContext(CartItemContext);\nexport const __FramerMetadata__ = {\"exports\":{\"useCartItem\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"CartItemContext\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CartItemContext.map", "import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{ControlType,withCSS}from\"framer\";import{useSelectedVariant}from\"https://framerusercontent.com/modules/ajKYBgRXgNyNgL1GkpqG/prknJU66nI5iRE43ff6z/ProductState.js\";import{useCartItem}from\"https://framerusercontent.com/modules/Be5mN5EUhdOwl54qCG8y/Icj1ZU450uFtWcyrdGTm/CartItemContext.js\";import{currencyFormatProp,formatCurrency,addPropertyControlsFrameship}from\"https://framerusercontent.com/modules/gd3dcT3w5rYoRy7ZcKte/sH6FZizM8jJ11j2dQOhQ/Shared.js\";import currencySymbols from\"https://framerusercontent.com/modules/pJIZxaEdKo1uS87sS4xM/4PSl3AVmNoISomoZ0s7m/CurrencySymbols.js\";const HIDDEN_CLASS=\"frameship-price-label-hidden\";var ProductInfoType;(function(ProductInfoType){ProductInfoType[\"Price\"]=\"price\";ProductInfoType[\"CompareAtPrice\"]=\"compareAtPrice\";})(ProductInfoType||(ProductInfoType={}));function ProductInfoLabelComponent(props){const{type,whenZero,textWhenZero,currencyFormat}=props;const Tag=props.htmlTag||\"p\";const variant=useSelectedVariant(props.shopifyData);const{inCart,price:cartPrice,compareAtPrice:cartCompareAtPrice}=useCartItem();let value=0;let currencyCode=props.currency;let hidden=false;if(inCart){if(type===\"price\"){if(isPriceV2(cartPrice)){value=cartPrice.amount||0;currencyCode=cartPrice.currencyCode||props.currency;}}else if(type===\"compareAtPrice\"){if(isPriceV2(cartCompareAtPrice)){value=cartCompareAtPrice.amount||0;currencyCode=cartCompareAtPrice.currencyCode||props.currency;}}}else if(variant){const price=variant[type];if(isPriceV2(price)){value=price.amount||0;currencyCode=price.currencyCode||props.currency;}else if(typeof price===\"number\"){value=price;}}let text=\"\";if(whenZero==\"hide\"&&!value){hidden=true;}else if(whenZero==\"showText\"&&!value){text=textWhenZero;}else{text=formatCurrency(value,currencyCode,currencyFormat);}return hidden?/*#__PURE__*/_jsx(\"div\",{className:HIDDEN_CLASS}):/*#__PURE__*/_jsxs(Tag,{style:{color:props.color,margin:0,whiteSpace:\"pre\",userSelect:props.selectable?undefined:\"none\",textDecoration:props.decoration===\"strikethrough\"?\"line-through\":props.decoration,textWrap:props.style?.width==\"100%\"?\"wrap\":\"nowrap\",...props.font,...props.style},children:[props.prefix,text,props.suffix]});}/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight auto\n * @framerDisableUnlink\n */const ProductInfoLabel=withCSS(ProductInfoLabelComponent,[`.${HIDDEN_CLASS} { display: none !important; }`,`div:has(> .${HIDDEN_CLASS}) { display: none !important; }`],\"\");export default ProductInfoLabel;ProductInfoLabel.displayName=\"Price Label\";addPropertyControlsFrameship(ProductInfoLabel,{type:{type:ControlType.Enum,defaultValue:\"price\",options:Object.values(ProductInfoType),optionTitles:[\"Price\",\"Compare-at Price\"],displaySegmentedControl:true,segmentedControlDirection:\"vertical\"},whenZero:{type:ControlType.Enum,defaultValue:\"show\",options:[\"show\",\"showText\",\"hide\"],optionTitles:[\"Show\",\"Show Text\",\"Hide\"],title:\"When Zero\"},textWhenZero:{type:ControlType.String,defaultValue:\"Free\",title:\"Text\",description:\"This text is shown when the price is 0\",hidden:props=>props.whenZero!==\"showText\"},currency:{type:ControlType.Enum,defaultValue:\"USD\",title:\"Default Currency\",options:Object.keys(currencySymbols)},currencyFormat:currencyFormatProp(),font:{type:\"font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:16,lineHeight:1.4}},color:{type:ControlType.Color,defaultValue:\"#999999\"},prefix:{type:ControlType.String,defaultValue:\"\"},suffix:{type:ControlType.String,defaultValue:\"\"},decoration:{type:ControlType.Enum,defaultValue:\"none\",options:[\"none\",\"strikethrough\",\"underline\"],optionTitles:[\"None\",\"Strikethrough\",\"Underline\"]},selectable:{type:ControlType.Boolean,defaultValue:true,title:\"User Select\"},htmlTag:{type:ControlType.Enum,options:[\"p\",\"span\",\"h1\",\"h2\",\"h3\",\"h4\",\"h5\",\"h6\"],title:\"Tag\"}},{shopifyData:true});function isPriceV2(value){return value&&typeof value===\"object\"&&value.hasOwnProperty(\"amount\");}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ProductInfoLabel\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ProductInfoLabel.map"],
  "mappings": "0OAA4B,IAAMA,EAAkB,uBAC9CC,EAAiB,IAAI,CAAI,OAAOC,EAAS,KAAa,CAACA,EAAOF,CAAiB,IAAGE,EAAOF,CAAiB,EAAE,CAAC,EAAG,EACnH,OAAOE,EAAS,KAAaD,EAAiB,EAKvC,SAASE,EAAkBC,EAAGC,EAAO,CAAC,GAAK,CAAC,QAAAC,EAAQ,YAAAC,EAAY,aAAAC,CAAY,EAAEH,EACxF,GAAG,OAAOH,EAAS,IAAa,OAAOO,EAAOF,CAAW,EACzDN,EAAiB,EAAE,IAAM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AAW,UAAU,EAAE,SAAS,CAAC,KAAKyB,EAAY,KAAK,aAAa,MAAM,MAAM,mBAAmB,QAAQ,OAAO,KAAKC,CAAe,CAAC,EAAE,eAAeC,EAAmB,EAAE,KAAK,CAAC,KAAK,OAAO,SAAS,WAAW,gBAAgB,aAAa,aAAa,CAAC,SAAS,GAAG,WAAW,GAAG,CAAC,EAAE,MAAM,CAAC,KAAKF,EAAY,MAAM,aAAa,SAAS,EAAE,OAAO,CAAC,KAAKA,EAAY,OAAO,aAAa,EAAE,EAAE,OAAO,CAAC,KAAKA,EAAY,OAAO,aAAa,EAAE,EAAE,WAAW,CAAC,KAAKA,EAAY,KAAK,aAAa,OAAO,QAAQ,CAAC,OAAO,gBAAgB,WAAW,EAAE,aAAa,CAAC,OAAO,gBAAgB,WAAW,CAAC,EAAE,WAAW,CAAC,KAAKA,EAAY,QAAQ,aAAa,GAAK,MAAM,aAAa,EAAE,QAAQ,CAAC,KAAKA,EAAY,KAAK,QAAQ,CAAC,IAAI,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK,IAAI,EAAE,MAAM,KAAK,CAAC,EAAE,CAAC,YAAY,EAAI,CAAC,EAAE,SAASV,EAAUH,EAAM,CAAC,OAAOA,GAAO,OAAOA,GAAQ,UAAUA,EAAM,eAAe,QAAQ,CAAE",
  "names": ["WINDOW_STORES_KEY", "initializeStores", "window", "createSharedStore", "id", "config", "version", "createState", "migrateState", "create", "existingStore", "store", "currentState", "migratedState", "defaultMigrateState", "defaultMigrateState", "oldState", "newState", "key", "useProductStore", "createSharedStore", "set", "productId", "variantOption", "option", "state", "quantity", "oldState", "useSelectedVariant", "shopifyData", "parsedData", "se", "parseShopifyData", "shopifyId", "variants", "selectedVariantOptions", "variant", "CartItemContext", "z", "useCartItem", "re", "HIDDEN_CLASS", "ProductInfoType", "ProductInfoLabelComponent", "props", "type", "whenZero", "textWhenZero", "currencyFormat", "Tag", "variant", "useSelectedVariant", "inCart", "cartPrice", "cartCompareAtPrice", "useCartItem", "value", "currencyCode", "hidden", "isPriceV2", "price", "text", "formatCurrency", "p", "u", "ProductInfoLabel", "withCSS", "ProductInfoLabel_default", "addPropertyControlsFrameship", "ControlType", "CurrencySymbols_default", "currencyFormatProp"]
}
