(globalThis.webpackChunkwebpackWcBlocksMainJsonp=globalThis.webpackChunkwebpackWcBlocksMainJsonp||[]).push([[2388],{1308:(e,r,c)=>{"use strict";c.r(r),c.d(r,{Block:()=>m,default:()=>d});var t=c(4921),s=c(6711),o=c(910),a=c(415),n=c(371),l=c(1616),i=c(5703),p=c(790);const u=(e,r,c="0")=>{const t=10**r.minorUnit;return(Number.parseFloat(null!=e?e:c)*t).toString()},m=e=>{var r;const{className:c,textAlign:l,isDescendentOfSingleProductTemplate:m,isAdmin:d,product:y,isExperimentalWcRestApiEnabled:_}=e,g=(0,n.p)(e),{parentName:x,parentClassName:N}=(0,a.useInnerBlockLayoutContext)(),{product:f}=(0,a.useProductDataContext)(_?{isAdmin:d,product:y}:void 0),b="woocommerce/all-products"===x,h=m&&!("woocommerce/add-to-cart-with-options-grouped-product-item"===x),P=(0,t.A)("wc-block-components-product-price",c,g.className,{[`${N}__product-price`]:N});if(!f?.id&&!m){const e=(0,p.jsx)(s.A,{align:l,className:P});return b?(0,p.jsx)("div",{className:"wp-block-woocommerce-product-price",children:e}):e}let k=null!==(r=f?.prices)&&void 0!==r?r:{};const v=h?(0,o.getCurrencyFromPriceResponse)():(0,o.getCurrencyFromPriceResponse)(k);_&&(k={price:u(f?.price,v),...f?.sale_price?{sale_price:u(f?.sale_price,v)}:{},...f?.regular_price?{regular_price:u(f?.regular_price,v)}:{},currency_minor_unit:i.SITE_CURRENCY.minorUnit,price_range:f?.__experimental_max_price&&f?.__experimental_min_price?{min_amount:u(f.__experimental_min_price,v),max_amount:u(f.__experimental_max_price,v)}:null});const S="5000",j=k.price!==k.regular_price,w=(0,t.A)({[`${N}__product-price__value`]:N,[`${N}__product-price__value--on-sale`]:j}),A=(0,p.jsx)(s.A,{align:l,className:P,style:g.style,regularPriceStyle:g.style,priceStyle:g.style,priceClassName:w,currency:v,price:h?S:k.price,minPrice:k?.price_range?.min_amount,maxPrice:k?.price_range?.max_amount,regularPrice:h?S:k.regular_price,regularPriceClassName:(0,t.A)({[`${N}__product-price__regular`]:N})});return b?(0,p.jsx)("div",{className:"wp-block-woocommerce-product-price",children:A}):A},d=e=>e.isDescendentOfSingleProductTemplate?(0,p.jsx)(m,{...e}):(0,l.withProductDataContext)(m)(e)},6711:(e,r,c)=>{"use strict";c.d(r,{A:()=>u});var t=c(7723),s=c(4656),o=c(4921),a=c(910),n=c(6087),l=(c(8501),c(790));const i=({currency:e,maxPrice:r,minPrice:c,priceClassName:n,priceStyle:i={}})=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"screen-reader-text",children:(0,t.sprintf)(/* translators: %1$s min price, %2$s max price */ /* translators: %1$s min price, %2$s max price */
(0,t.__)("Price between %1$s and %2$s","woocommerce"),(0,a.formatPrice)(c),(0,a.formatPrice)(r))}),(0,l.jsxs)("span",{"aria-hidden":!0,children:[(0,l.jsx)(s.FormattedMonetaryAmount,{className:(0,o.A)("wc-block-components-product-price__value",n),currency:e,value:c,style:i})," — ",(0,l.jsx)(s.FormattedMonetaryAmount,{className:(0,o.A)("wc-block-components-product-price__value",n),currency:e,value:r,style:i})]})]}),p=({currency:e,regularPriceClassName:r,regularPriceStyle:c,regularPrice:a,priceClassName:n,priceStyle:i,price:p})=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"screen-reader-text",children:(0,t.__)("Previous price:","woocommerce")}),(0,l.jsx)(s.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,l.jsx)("del",{className:(0,o.A)("wc-block-components-product-price__regular",r),style:c,children:e}),value:a}),(0,l.jsx)("span",{className:"screen-reader-text",children:(0,t.__)("Discounted price:","woocommerce")}),(0,l.jsx)(s.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,l.jsx)("ins",{className:(0,o.A)("wc-block-components-product-price__value","is-discounted",n),style:i,children:e}),value:p})]}),u=({align:e,className:r,currency:c,format:t="<price/>",maxPrice:a,minPrice:u,price:m,priceClassName:d,priceStyle:y,regularPrice:_,regularPriceClassName:g,regularPriceStyle:x,style:N})=>{const f=(0,o.A)(r,"price","wc-block-components-product-price",{[`wc-block-components-product-price--align-${e}`]:e});t.includes("<price/>")||(t="<price/>",console.error("Price formats need to include the `<price/>` tag."));const b=_&&m&&m<_;let h=(0,l.jsx)("span",{className:(0,o.A)("wc-block-components-product-price__value",d)});return b?h=(0,l.jsx)(p,{currency:c,price:m,priceClassName:d,priceStyle:y,regularPrice:_,regularPriceClassName:g,regularPriceStyle:x}):void 0!==u&&void 0!==a?h=(0,l.jsx)(i,{currency:c,maxPrice:a,minPrice:u,priceClassName:d,priceStyle:y}):(m||0===m)&&(h=(0,l.jsx)(s.FormattedMonetaryAmount,{className:(0,o.A)("wc-block-components-product-price__value",d),currency:c,value:m,style:y})),(0,l.jsx)("span",{className:f,style:N,children:(0,n.createInterpolateElement)(t,{price:h})})}},371:(e,r,c)=>{"use strict";c.d(r,{p:()=>n});var t=c(4921),s=c(3993),o=c(219),a=c(17);const n=e=>{const r=(e=>{const r=(0,s.isObject)(e)?e:{style:{}};let c=r.style;return(0,s.isString)(c)&&(c=JSON.parse(c)||{}),(0,s.isObject)(c)||(c={}),{...r,style:c}})(e),c=(0,a.BK)(r),n=(0,a.aR)(r),l=(0,a.fo)(r),i=(0,o.x)(r);return{className:(0,t.A)(i.className,c.className,n.className,l.className),style:{...i.style,...c.style,...n.style,...l.style}}}},219:(e,r,c)=>{"use strict";c.d(r,{x:()=>s});var t=c(3993);const s=e=>{const r=(0,t.isObject)(e.style.typography)?e.style.typography:{},c=(0,t.isString)(r.fontFamily)?r.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:c,style:{fontSize:e.fontSize?`var(--wp--preset--font-size--${e.fontSize})`:r.fontSize,fontStyle:r.fontStyle,fontWeight:r.fontWeight,letterSpacing:r.letterSpacing,lineHeight:r.lineHeight,textDecoration:r.textDecoration,textTransform:r.textTransform}}}},17:(e,r,c)=>{"use strict";c.d(r,{BK:()=>i,aR:()=>p,fo:()=>u});var t=c(4921),s=c(7356),o=c(9786),a=c(3993);function n(e={}){const r={};return(0,o.getCSSRules)(e,{selector:""}).forEach((e=>{r[e.key]=e.value})),r}function l(e,r){return e&&r?`has-${(0,s.c)(r)}-${e}`:""}function i(e){const{backgroundColor:r,textColor:c,gradient:s,style:o}=e,i=l("background-color",r),p=l("color",c),u=function(e){if(e)return`has-${e}-gradient-background`}(s),m=u||o?.color?.gradient;return{className:(0,t.A)(p,u,{[i]:!m&&!!i,"has-text-color":c||o?.color?.text,"has-background":r||o?.color?.background||s||o?.color?.gradient,"has-link-color":(0,a.isObject)(o?.elements?.link)?o?.elements?.link?.color:void 0}),style:n({color:o?.color||{}})}}function p(e){const r=e.style?.border||{};return{className:function(e){const{borderColor:r,style:c}=e,s=r?l("border-color",r):"";return(0,t.A)({"has-border-color":!!r||!!c?.border?.color,[s]:!!s})}(e),style:n({border:r})}}function u(e){return{className:void 0,style:n({spacing:e.style?.spacing||{}})}}},8501:()=>{}}]);