{"version":3,"sources":["webpack:///./Avensia.Common/Features/Product/ProductAddToCart/index.tsx","webpack:///./Avensia.Common/Features/Product/ProductCard/Badge.tsx","webpack:///./Avensia.Common/Features/Shared/string-format.tsx"],"names":["behavior","KeepEnabled","onClick","event","props","feedback","push","addToCart","stopPropagation","preventDefault","render","FeedbackButton","this","Button","css","compose","variant","appearance","Primary","Full","disabled","children","Component","Base","div","fontSize","position","textTransform","zIndex","Badge","CampaignBadge","color","theme","campaignTextProductcard","top","right","fontWeight","letterSpacing","textAlign","backgroundClip","margin","xy","WebkitBackgroundClip","textShadow","sharedStyle","borderRadius","height","lineHeight","width","triStyle","OuterWrapper","border","discountBadgeColor","style","InnerWrapper","left","NewBadge","backgroundColor","badgeColor","DiscountBadge","DiscountTriBadge","formatTitleCase","str","replace","txt","charAt","toUpperCase","substr","toLowerCase"],"mappings":"qIAkBe,gBACb,YAAoB,CAAEA,SAAU,IAAeC,aAA/C,CAA6D,YAC3D,2D,OACE,EAAAC,QAAU,SAACC,GACT,EAAKC,MAAMC,SAASC,KAAK,EAAKF,MAAMG,aACpCJ,EAAMK,kBACNL,EAAMM,kB,EAgBV,OApBwB,iBAMtB,YAAAC,OAAA,WACE,IAAMC,EAAiBC,KAAKR,MAAMC,SAASQ,OAC3C,OACE,kBAACF,EAAc,CACbG,IAAKF,KAAKR,MAAMW,UAChBC,QAASJ,KAAKR,MAAMY,QACpBC,WAAY,CAAC,IAAiBC,QAAS,IAAiBC,MACxDC,SAAUR,KAAKR,MAAMgB,SACrBlB,QAASU,KAAKV,SAEbU,KAAKR,MAAMiB,WAIpB,EArB2D,CACnC,IAAMC,c,sNCX5BC,EAAO,IAAOC,MAAG,GACrBC,SAAU,IACVC,SAAU,WACVC,cAAe,YACfC,OAAQ,IACP,MAAoB,CACnBH,SAAU,M,IAIRI,EAAQ,SAACzB,GAAoB,yBAACmB,EAAI,CAACT,IAAKV,EAAMW,WAAYX,EAAMiB,WASzDS,EAAgB,YAAOD,EAAO,CACzCE,M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OAAOA,EAAIC,OAAO,GAAGC,cAAgBF,EAAIG,OAAO,GAAGC,iBALvD","file":"assets/11.chunk.6249c4f6f5ecd5baf8d7.js","sourcesContent":["import React from 'react';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport {\r\n  connectWithFeedback,\r\n  Behavior as ButtonBehavior,\r\n  Appearance as ButtonAppearance,\r\n  ConnectPropType as FeedbackPropType,\r\n} from 'Shared/Button/Feedback';\r\nimport { Variant } from 'Shared/Button';\r\n\r\ntype PropType = {\r\n  addToCart: () => Promise<void>;\r\n  disabled?: boolean;\r\n  variant?: Variant;\r\n  children?: React.ReactNode;\r\n} & StyledProps &\r\n  FeedbackPropType;\r\n\r\nexport default styled(\r\n  connectWithFeedback({ behavior: ButtonBehavior.KeepEnabled })(\r\n    class AddToCart extends React.Component<PropType> {\r\n      onClick = (event: React.MouseEvent) => {\r\n        this.props.feedback.push(this.props.addToCart());\r\n        event.stopPropagation();\r\n        event.preventDefault();\r\n      };\r\n      render() {\r\n        const FeedbackButton = this.props.feedback.Button;\r\n        return (\r\n          <FeedbackButton\r\n            css={this.props.compose()}\r\n            variant={this.props.variant}\r\n            appearance={[ButtonAppearance.Primary, ButtonAppearance.Full]}\r\n            disabled={this.props.disabled}\r\n            onClick={this.onClick}\r\n          >\r\n            {this.props.children}\r\n          </FeedbackButton>\r\n        );\r\n      }\r\n    },\r\n  ),\r\n);\r\n","import React from 'react';\r\nimport { styled, StyledProps } from '@glitz/react';\r\nimport { pixelsToUnit, white, sigma, kappa, minTinyMediaQuery } from 'Shared/Style';\r\nimport { Style } from '@glitz/type';\r\n\r\ntype PropType = StyledProps & {\r\n  children?: React.ReactNode;\r\n};\r\n\r\nconst Base = styled.div({\r\n  fontSize: kappa,\r\n  position: 'absolute',\r\n  textTransform: 'uppercase',\r\n  zIndex: 1,\r\n  [minTinyMediaQuery]: {\r\n    fontSize: sigma,\r\n  },\r\n});\r\n\r\nconst Badge = (props: PropType) => <Base css={props.compose()}>{props.children}</Base>;\r\nconst TriBadge = (props: PropType) => (\r\n  <Base css={props.compose()}>\r\n    <OuterWrapper>\r\n      <InnerWrapper>{props.children}</InnerWrapper>\r\n    </OuterWrapper>\r\n  </Base>\r\n);\r\n\r\nexport const CampaignBadge = styled(Badge, {\r\n  color: (theme) => theme.campaignTextProductcard,\r\n  position: 'absolute',\r\n  top: 0,\r\n  right: 0,\r\n  fontWeight: 'bold',\r\n  letterSpacing: pixelsToUnit(0.7),\r\n  textAlign: 'left',\r\n  backgroundClip: 'text',\r\n  margin: { xy: '0.5rem' },\r\n  WebkitBackgroundClip: 'text',\r\n  textShadow: '-1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff',\r\n});\r\n\r\nconst sharedStyle: Style = {\r\n  borderRadius: '50%',\r\n  color: white,\r\n  margin: { xy: '0.5rem' },\r\n  height: pixelsToUnit(32),\r\n  lineHeight: pixelsToUnit(32),\r\n  textAlign: 'center',\r\n  width: pixelsToUnit(32),\r\n  [minTinyMediaQuery]: {\r\n    height: pixelsToUnit(40),\r\n    lineHeight: pixelsToUnit(40),\r\n    width: pixelsToUnit(40),\r\n  },\r\n};\r\n\r\nconst triStyle: Style = {\r\n  height: pixelsToUnit(32),\r\n  width: pixelsToUnit(32),\r\n  lineHeight: pixelsToUnit(32),\r\n  textAlign: 'center',\r\n};\r\n\r\nconst OuterWrapper = styled.div({\r\n  position: 'relative',\r\n  height: '100%',\r\n  width: '100%',\r\n  border: {\r\n    top: {\r\n      color: (theme) => theme.discountBadgeColor,\r\n      width: '75px',\r\n      style: 'solid',\r\n    },\r\n    right: {\r\n      color: 'transparent',\r\n      width: '75px',\r\n      style: 'solid',\r\n    },\r\n  },\r\n});\r\n\r\nconst InnerWrapper = styled.div({\r\n  position: 'absolute',\r\n  top: pixelsToUnit(-75),\r\n  left: pixelsToUnit(8),\r\n  color: white,\r\n  fontWeight: 'bold',\r\n  fontSize: pixelsToUnit(16),\r\n});\r\n\r\nexport const NewBadge = styled(Badge, {\r\n  backgroundColor: (theme) => theme.badgeColor,\r\n  ...sharedStyle,\r\n});\r\n\r\nexport const DiscountBadge = styled(Badge, {\r\n  backgroundColor: (theme) => theme.discountBadgeColor,\r\n  ...sharedStyle,\r\n});\r\n\r\nexport const DiscountTriBadge = styled(TriBadge, {\r\n  ...triStyle,\r\n});\r\n","export function formatTitleCase(str: string) {\r\n  if (str === '') {\r\n    return str;\r\n  }\r\n  return str.replace(/\\S*/g, function(txt) {\r\n    return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\r\n  });\r\n}\r\n"],"sourceRoot":""}