File "product-price-frontend.js"

Full Path: /home/jlklyejr/public_html/wp-content/test/wp-content/plugins/woocommerce/assets/client/blocks/product-price-frontend.js
File size: 7.95 KB
MIME-type: text/plain
Charset: utf-8

(self.webpackChunkwebpackWcBlocksJsonp=self.webpackChunkwebpackWcBlocksJsonp||[]).push([[5579],{7461:(e,r,t)=>{"use strict";t.r(r),t.d(r,{Block:()=>p,default:()=>m});var c=t(9196),n=t(3849),o=t.n(n),l=t(3088),a=t(4293),s=t(2864),i=t(947),u=t(721);const p=e=>{var r,t;const{className:n,textAlign:u,isDescendentOfSingleProductTemplate:p}=e,m=(0,i.F)(e),{parentName:d,parentClassName:y}=(0,s.useInnerBlockLayoutContext)(),{product:v}=(0,s.useProductDataContext)(),g="woocommerce/all-products"===d,f=o()("wc-block-components-product-price",n,m.className,{[`${y}__product-price`]:y});if(!v.id&&!p){const e=(0,c.createElement)(l.Z,{align:u,className:f});return g?(0,c.createElement)("div",{className:"wp-block-woocommerce-product-price"},e):e}const N=v.prices,_=p?(0,a.getCurrencyFromPriceResponse)():(0,a.getCurrencyFromPriceResponse)(N),b="5000",P=N.price!==N.regular_price,k=o()({[`${y}__product-price__value`]:y,[`${y}__product-price__value--on-sale`]:P}),E=(0,c.createElement)(l.Z,{align:u,className:f,style:m.style,regularPriceStyle:m.style,priceStyle:m.style,priceClassName:k,currency:_,price:p?b:N.price,minPrice:null==N||null===(r=N.price_range)||void 0===r?void 0:r.min_amount,maxPrice:null==N||null===(t=N.price_range)||void 0===t?void 0:t.max_amount,regularPrice:p?b:N.regular_price,regularPriceClassName:o()({[`${y}__product-price__regular`]:y})});return g?(0,c.createElement)("div",{className:"wp-block-woocommerce-product-price"},E):E},m=e=>e.isDescendentOfSingleProductTemplate?(0,c.createElement)(p,{...e}):(0,u.withProductDataContext)(p)(e)},3088:(e,r,t)=>{"use strict";t.d(r,{Z:()=>m});var c=t(9196),n=t(5736),o=t(711),l=t(3849),a=t.n(l),s=t(4293),i=t(9307);t(6645);const u=({currency:e,maxPrice:r,minPrice:t,priceClassName:l,priceStyle:i={}})=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)("span",{className:"screen-reader-text"},(0,n.sprintf)(/* translators: %1$s min price, %2$s max price */ /* translators: %1$s min price, %2$s max price */
(0,n.__)("Price between %1$s and %2$s","woocommerce"),(0,s.formatPrice)(t),(0,s.formatPrice)(r))),(0,c.createElement)("span",{"aria-hidden":!0},(0,c.createElement)(o.FormattedMonetaryAmount,{className:a()("wc-block-components-product-price__value",l),currency:e,value:t,style:i})," — ",(0,c.createElement)(o.FormattedMonetaryAmount,{className:a()("wc-block-components-product-price__value",l),currency:e,value:r,style:i}))),p=({currency:e,regularPriceClassName:r,regularPriceStyle:t,regularPrice:l,priceClassName:s,priceStyle:i,price:u})=>(0,c.createElement)(c.Fragment,null,(0,c.createElement)("span",{className:"screen-reader-text"},(0,n.__)("Previous price:","woocommerce")),(0,c.createElement)(o.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,c.createElement)("del",{className:a()("wc-block-components-product-price__regular",r),style:t},e),value:l}),(0,c.createElement)("span",{className:"screen-reader-text"},(0,n.__)("Discounted price:","woocommerce")),(0,c.createElement)(o.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,c.createElement)("ins",{className:a()("wc-block-components-product-price__value","is-discounted",s),style:i},e),value:u})),m=({align:e,className:r,currency:t,format:n="<price/>",maxPrice:l,minPrice:s,price:m,priceClassName:d,priceStyle:y,regularPrice:v,regularPriceClassName:g,regularPriceStyle:f,style:N})=>{const _=a()(r,"price","wc-block-components-product-price",{[`wc-block-components-product-price--align-${e}`]:e});n.includes("<price/>")||(n="<price/>",console.error("Price formats need to include the `<price/>` tag."));const b=v&&m&&m<v;let P=(0,c.createElement)("span",{className:a()("wc-block-components-product-price__value",d)});return b?P=(0,c.createElement)(p,{currency:t,price:m,priceClassName:d,priceStyle:y,regularPrice:v,regularPriceClassName:g,regularPriceStyle:f}):void 0!==s&&void 0!==l?P=(0,c.createElement)(u,{currency:t,maxPrice:l,minPrice:s,priceClassName:d,priceStyle:y}):m&&(P=(0,c.createElement)(o.FormattedMonetaryAmount,{className:a()("wc-block-components-product-price__value",d),currency:t,value:m,style:y})),(0,c.createElement)("span",{className:_,style:N},(0,i.createInterpolateElement)(n,{price:P}))}},947:(e,r,t)=>{"use strict";t.d(r,{F:()=>i});var c=t(3849),n=t.n(c),o=t(7998),l=t(3243),a=t(3392),s=t(172);const i=e=>{const r=(e=>{const r=(0,o.Kn)(e)?e:{style:{}};let t=r.style;return(0,l.H)(t)&&(t=JSON.parse(t)||{}),(0,o.Kn)(t)||(t={}),{...r,style:t}})(e),t=(0,s.vc)(r),c=(0,s.l8)(r),i=(0,s.su)(r),u=(0,a.f)(r);return{className:n()(u.className,t.className,c.className,i.className),style:{...u.style,...t.style,...c.style,...i.style}}}},3392:(e,r,t)=>{"use strict";t.d(r,{f:()=>o});var c=t(7998),n=t(3243);const o=e=>{const r=(0,c.Kn)(e.style.typography)?e.style.typography:{},t=(0,n.H)(r.fontFamily)?r.fontFamily:"";return{className:e.fontFamily?`has-${e.fontFamily}-font-family`:t,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}}}},172:(e,r,t)=>{"use strict";t.d(r,{l8:()=>p,su:()=>m,vc:()=>u});var c=t(3849),n=t.n(c),o=t(7427),l=t(2289),a=t(7998);function s(e={}){const r={};return(0,l.getCSSRules)(e,{selector:""}).forEach((e=>{r[e.key]=e.value})),r}function i(e,r){return e&&r?`has-${(0,o.o)(r)}-${e}`:""}function u(e){var r,t,c,o,l,u,p;const{backgroundColor:m,textColor:d,gradient:y,style:v}=e,g=i("background-color",m),f=i("color",d),N=function(e){if(e)return`has-${e}-gradient-background`}(y),_=N||(null==v||null===(r=v.color)||void 0===r?void 0:r.gradient);return{className:n()(f,N,{[g]:!_&&!!g,"has-text-color":d||(null==v||null===(t=v.color)||void 0===t?void 0:t.text),"has-background":m||(null==v||null===(c=v.color)||void 0===c?void 0:c.background)||y||(null==v||null===(o=v.color)||void 0===o?void 0:o.gradient),"has-link-color":(0,a.Kn)(null==v||null===(l=v.elements)||void 0===l?void 0:l.link)?null==v||null===(u=v.elements)||void 0===u||null===(p=u.link)||void 0===p?void 0:p.color:void 0}),style:s({color:(null==v?void 0:v.color)||{}})}}function p(e){var r;const t=(null===(r=e.style)||void 0===r?void 0:r.border)||{};return{className:function(e){var r;const{borderColor:t,style:c}=e,o=t?i("border-color",t):"";return n()({"has-border-color":!!t||!(null==c||null===(r=c.border)||void 0===r||!r.color),[o]:!!o})}(e),style:s({border:t})}}function m(e){var r;return{className:void 0,style:s({spacing:(null===(r=e.style)||void 0===r?void 0:r.spacing)||{}})}}},2893:(e,r,t)=>{"use strict";t.d(r,{F:()=>c});const c=e=>null===e},7998:(e,r,t)=>{"use strict";t.d(r,{$n:()=>o,Kn:()=>n});var c=t(2893);const n=e=>!(0,c.F)(e)&&e instanceof Object&&e.constructor===Object;function o(e,r){return n(e)&&r in e}},3243:(e,r,t)=>{"use strict";t.d(r,{H:()=>c});const c=e=>"string"==typeof e},112:(e,r,t)=>{"use strict";t.d(r,{$:()=>o});var c=t(3112),n=t(7090);function o(e,r){return void 0===r&&(r={}),(0,n.B)(e,(0,c.pi)({delimiter:"."},r))}},6645:()=>{},3569:(e,r,t)=>{"use strict";function c(e){return e.toLowerCase()}t.d(r,{U:()=>c})},7090:(e,r,t)=>{"use strict";t.d(r,{B:()=>l});var c=t(3569),n=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],o=/[^A-Z0-9]+/gi;function l(e,r){void 0===r&&(r={});for(var t=r.splitRegexp,l=void 0===t?n:t,s=r.stripRegexp,i=void 0===s?o:s,u=r.transform,p=void 0===u?c.U:u,m=r.delimiter,d=void 0===m?" ":m,y=a(a(e,l,"$1\0$2"),i,"\0"),v=0,g=y.length;"\0"===y.charAt(v);)v++;for(;"\0"===y.charAt(g-1);)g--;return y.slice(v,g).split("\0").map(p).join(d)}function a(e,r,t){return r instanceof RegExp?e.replace(r,t):r.reduce((function(e,r){return e.replace(r,t)}),e)}},7427:(e,r,t)=>{"use strict";t.d(r,{o:()=>o});var c=t(3112),n=t(112);function o(e,r){return void 0===r&&(r={}),(0,n.$)(e,(0,c.pi)({delimiter:"-"},r))}},3112:(e,r,t)=>{"use strict";t.d(r,{pi:()=>c});var c=function(){return c=Object.assign||function(e){for(var r,t=1,c=arguments.length;t<c;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},c.apply(this,arguments)};Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError}}]);