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AC,UAAU,EAAC,QAAQ,EAAE,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,KAAI,KAAK,EAAE,KAAK,EAAE,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,GAAqB,KAE/G,sBAAgB,MAAM,EAAE,IAAI,CAAC,MAAM,GAAmB,CACvD,CACG,EACN;KACH;;;;AC7CH,MAAM,qBAAqB,GAAG,waAAwa,CAAC;AACvc,iCAAe,qBAAqB;;MCMvB,kBAAkB;;;;IAC7B,MAAM;QACJ,QACE,EAAC,IAAI,uDACH,4DACE,KAAK,EAAE;gBACL,oBAAoB,EAAE,IAAI;aAC3B,IAED,8DAAQ,CACJ,CACD,EACP;KACH;;;;;;","names":[],"sources":["src/components/ui/sc-price-range/sc-price-range.scss?tag=sc-price-range&encapsulation=shadow","src/components/ui/sc-price-range/sc-price-range.tsx","src/components/controllers/products/sc-product-item-image/sc-product-item-image.scss?tag=sc-product-item-image&encapsulation=shadow","src/components/controllers/products/sc-product-item-image/sc-product-item-image.tsx","src/components/controllers/products/sc-product-item-price/sc-product-item-price.scss?tag=sc-product-item-price&encapsulation=shadow","src/components/controllers/products/sc-product-item-price/sc-product-item-price.tsx","src/components/controllers/products/sc-product-item-title/sc-product-item-title.scss?tag=sc-product-item-title&encapsulation=shadow","src/components/controllers/products/sc-product-item-title/sc-product-item-title.tsx"],"sourcesContent":[":host {\n display: block;\n line-height: 1;\n}\n","import { Component, Host, h, Prop, Watch, State } from '@stencil/core';\nimport { Price } from '../../../types';\nimport { __ } from '@wordpress/i18n';\n\n@Component({\n tag: 'sc-price-range',\n styleUrl: 'sc-price-range.scss',\n shadow: true,\n})\nexport class ScPriceRange {\n /**The array of price objects */\n @Prop() prices: Price[];\n\n @State() private minPrice: Price;\n @State() private maxPrice: Price;\n\n @Watch('prices')\n handlePricesChange() {\n let min: Price, max: Price;\n\n (this.prices || [])\n .filter(p => !p?.archived)\n .forEach(price => {\n if (!max || price.amount > max.amount) {\n max = price;\n }\n\n if (!min || price.amount < min.amount) {\n min = price;\n }\n });\n\n this.minPrice = min;\n this.maxPrice = max;\n }\n\n componentWillLoad() {\n this.handlePricesChange();\n }\n\n render() {\n if (!this.maxPrice || !this.minPrice) {\n return <Host></Host>;\n }\n\n return (\n <Host>\n {this.maxPrice.amount == this.minPrice.amount ? (\n <span>\n <sc-format-number type=\"currency\" currency={this.maxPrice.currency} value={this.maxPrice.amount}></sc-format-number>\n </span>\n ) : (\n <span>\n <sc-visually-hidden>{__('Price range from', 'surecart')} </sc-visually-hidden>\n <sc-format-number type=\"currency\" currency={this.minPrice.currency} value={this.minPrice.amount}></sc-format-number>\n <span aria-hidden>{' — '}</span>\n <sc-visually-hidden>{__('to', 'surecart')}</sc-visually-hidden>\n <sc-format-number type=\"currency\" currency={this.maxPrice.currency} value={this.maxPrice.amount}></sc-format-number>\n </span>\n )}\n </Host>\n );\n }\n}\n",":host {\n border-style: none;\n}\n\n.product-img {\n max-width: 100%;\n aspect-ratio: var(--sc-product-image-aspect-ratio);\n padding-top: var(--sc-product-image-padding-top, 0);\n padding-bottom: var(--sc-product-image-padding-bottom, 0);\n padding-left: var(--sc-product-image-padding-left, 0);\n padding-right: var(--sc-product-image-padding-right, 0);\n margin-top: var(--sc-product-image-margin-top, 0);\n margin-bottom: var(--sc-product-image-margin-bottom, 0);\n margin-left: var(--sc-product-image-margin-left, 0);\n margin-right: var(--sc-product-image-margin-right, 0);\n border: solid var(--sc-product-image-border-width) var(--sc-product-image-border-color);\n border-radius: var(--sc-product-image-border-radius);\n overflow: hidden;\n\n > img {\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n object-fit: contain;\n display: block;\n transition: transform var(--sc-transition-medium) ease;\n }\n &.is_covered > img {\n object-fit: cover;\n }\n &.is_contained > img {\n object-fit: contain;\n }\n &_placeholder {\n width: 100%;\n height: 100%;\n background-color: var(--sc-color-gray-300);\n }\n\n &:hover img {\n transform: scale(1.05);\n }\n}\n","import { Component, h, Host, Prop } from '@stencil/core';\nimport { Media, Product, ProductMedia } from '../../../../types';\nimport { sizeImage, getFeaturedProductMediaAttributes } from '../../../../functions/media';\nimport { applyFilters } from '@wordpress/hooks';\n\n@Component({\n tag: 'sc-product-item-image',\n styleUrl: 'sc-product-item-image.scss',\n shadow: true,\n})\nexport class ScProductItemImage {\n /* Product image url */\n @Prop() product: Product;\n\n /* Product image sizing */\n @Prop() sizing: 'cover' | 'contain';\n\n getSrc() {\n if ((this.product?.featured_product_media as ProductMedia)?.url) {\n return (this.product?.featured_product_media as ProductMedia)?.url;\n }\n\n if (((this.product?.featured_product_media as ProductMedia)?.media as Media)?.url) {\n return sizeImage(((this.product?.featured_product_media as ProductMedia)?.media as Media)?.url, applyFilters('surecart/product-list/media/size', 900));\n }\n\n return `${window.scData?.plugin_url}/images/placeholder.jpg`;\n }\n\n render() {\n const { alt, title } = getFeaturedProductMediaAttributes(this.product);\n return (\n <Host style={{ borderStyle: 'none' }}>\n <div\n class={{\n 'product-img': true,\n 'is_contained': this.sizing === 'contain',\n 'is_covered': this.sizing === 'cover',\n }}\n >\n {!!this.getSrc() ? <img src={this.getSrc()} alt={alt} {...(title ? { title } : {})} /> : <div class=\"product-img_placeholder\" />}\n </div>\n </Host>\n );\n }\n}\n",":host {\n display: block;\n line-height: 1;\n}\n\n.product-price {\n padding-top: var(--sc-product-price-padding-top, 0);\n padding-bottom: var(--sc-product-price-padding-bottom, 0);\n padding-left: var(--sc-product-price-padding-left, 0);\n padding-right: var(--sc-product-price-padding-right, 0);\n margin-top: var(--sc-product-price-margin-top, 0);\n margin-bottom: var(--sc-product-price-margin-bottom, 0);\n margin-left: var(--sc-product-price-margin-left, 0);\n margin-right: var(--sc-product-price-margin-right, 0);\n text-align: var(--sc-product-price-align);\n font-size: var(--sc-product-price-font-size);\n font-weight: var(--sc-product-price-font-weight);\n color: var(--sc-product-price-text-color);\n}\n","import { Component, h, Prop } from '@stencil/core';\nimport { Price, ProductMetrics } from 'src/types';\n\n@Component({\n tag: 'sc-product-item-price',\n styleUrl: 'sc-product-item-price.scss',\n shadow: true,\n})\nexport class ScProductItemPrice {\n /* Prices */\n @Prop() prices: Price[];\n\n /** Show price range? */\n @Prop() range: boolean = true;\n\n /** Product metrics */\n @Prop() metrics: ProductMetrics;\n\n componentWillLoad() {\n // If min-max price is different, then generate a price range.\n if (this.range && this.metrics?.min_price_amount !== this.metrics?.max_price_amount) {\n this.prices = [\n {\n amount: this.metrics?.min_price_amount,\n currency: this.metrics?.currency,\n },\n {\n amount: this.metrics?.max_price_amount,\n currency: this.metrics?.currency,\n },\n ] as Price[];\n }\n }\n\n render() {\n const price = (this.prices || []).sort((a, b) => a?.position - b?.position).find(price => !price?.archived);\n return (\n <div class=\"product-price\" part=\"base\">\n {!this.range && this.prices?.length ? (\n <sc-format-number type=\"currency\" currency={price?.currency || 'usd'} value={price?.amount}></sc-format-number>\n ) : (\n <sc-price-range prices={this.prices}></sc-price-range>\n )}\n </div>\n );\n }\n}\n",".product-item-title {\n padding-top: var(--sc-product-title-padding-top, 0);\n padding-bottom: var(--sc-product-title-padding-bottom, 0);\n margin-top: var(--sc-product-title-margin-top, 0);\n margin-bottom: var(--sc-product-title-margin-bottom, 0);\n font-size: var(--sc-product-title-font-size);\n text-align: var(--sc-product-title-align);\n font-weight: var(--sc-product-title-font-weight);\n color: var(--sc-product-title-text-color);\n line-height: 1.2;\n}\n","import { Component, h, Host } from '@stencil/core';\n\n@Component({\n tag: 'sc-product-item-title',\n styleUrl: 'sc-product-item-title.scss',\n shadow: true,\n})\nexport class ScProductItemTitle {\n render() {\n return (\n <Host>\n <div\n class={{\n 'product-item-title': true,\n }}\n >\n <slot />\n </div>\n </Host>\n );\n }\n}\n"],"version":3}