{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/Ncx6rwHWSXe5kU34gWm3/ODkUbH8JS0kgmkT2t1Ml/ProductInfoLabel.js"],
  "sourcesContent": ["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": "8MAAmoB,IAAMA,EAAa,+BAAmCC,GAAiB,SAASA,EAAgB,CAACA,EAAgB,MAAS,QAAQA,EAAgB,eAAkB,gBAAiB,GAAGA,IAAkBA,EAAgB,CAAC,EAAE,EAAE,SAASC,EAA0BC,EAAM,CAAC,GAAK,CAAC,KAAAC,EAAK,SAAAC,EAAS,aAAAC,EAAa,eAAAC,CAAc,EAAEJ,EAAYK,EAAIL,EAAM,SAAS,IAAUM,EAAQC,EAAmBP,EAAM,WAAW,EAAO,CAAC,OAAAQ,EAAO,MAAMC,EAAU,eAAeC,CAAkB,EAAEC,EAAY,EAAMC,EAAM,EAAMC,EAAab,EAAM,SAAac,EAAO,GAAM,GAAGN,EAAWP,IAAO,QAAYc,EAAUN,CAAS,IAAGG,EAAMH,EAAU,QAAQ,EAAEI,EAAaJ,EAAU,cAAcT,EAAM,UAAmBC,IAAO,kBAAqBc,EAAUL,CAAkB,IAAGE,EAAMF,EAAmB,QAAQ,EAAEG,EAAaH,EAAmB,cAAcV,EAAM,kBAAoBM,EAAQ,CAAC,IAAMU,EAAMV,EAAQL,CAAI,EAAKc,EAAUC,CAAK,GAAGJ,EAAMI,EAAM,QAAQ,EAAEH,EAAaG,EAAM,cAAchB,EAAM,UAAkB,OAAOgB,GAAQ,WAAU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AS,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,SAAST,EAAUH,EAAM,CAAC,OAAOA,GAAO,OAAOA,GAAQ,UAAUA,EAAM,eAAe,QAAQ,CAAE",
  "names": ["HIDDEN_CLASS", "ProductInfoType", "ProductInfoLabelComponent", "props", "type", "whenZero", "textWhenZero", "currencyFormat", "Tag", "variant", "useSelectedVariant", "inCart", "cartPrice", "cartCompareAtPrice", "useCartItem", "value", "currencyCode", "hidden", "isPriceV2", "price", "text", "formatCurrency", "u", "ProductInfoLabel", "withCSS", "ProductInfoLabel_default", "addPropertyControlsFrameship", "ControlType", "CurrencySymbols_default", "currencyFormatProp"]
}
