File "cart-line-items-frontend.js"

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

(self.webpackChunkwebpackWcBlocksJsonp=self.webpackChunkwebpackWcBlocksJsonp||[]).push([[514],{7121:(e,t,r)=>{"use strict";r.d(t,{Z:()=>i});var n=r(9196),c=r(2629),a=r(3849),o=r.n(a);r(333);const i=({className:e="",disabled:t=!1,name:r,permalink:a="",target:i,rel:u,style:s,onClick:l,...m})=>{const d=o()("wc-block-components-product-name",e);if(t){const e=m;return(0,n.createElement)("span",{className:d,...e,dangerouslySetInnerHTML:{__html:(0,c.decodeEntities)(r)}})}return(0,n.createElement)("a",{className:d,href:a,target:i,...m,dangerouslySetInnerHTML:{__html:(0,c.decodeEntities)(r)},style:s})}},3088:(e,t,r)=>{"use strict";r.d(t,{Z:()=>d});var n=r(9196),c=r(5736),a=r(711),o=r(3849),i=r.n(o),u=r(4293),s=r(9307);r(6645);const l=({currency:e,maxPrice:t,minPrice:r,priceClassName:o,priceStyle:s={}})=>(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"screen-reader-text"},(0,c.sprintf)(/* translators: %1$s min price, %2$s max price */ /* translators: %1$s min price, %2$s max price */
(0,c.__)("Price between %1$s and %2$s","woocommerce"),(0,u.formatPrice)(r),(0,u.formatPrice)(t))),(0,n.createElement)("span",{"aria-hidden":!0},(0,n.createElement)(a.FormattedMonetaryAmount,{className:i()("wc-block-components-product-price__value",o),currency:e,value:r,style:s})," — ",(0,n.createElement)(a.FormattedMonetaryAmount,{className:i()("wc-block-components-product-price__value",o),currency:e,value:t,style:s}))),m=({currency:e,regularPriceClassName:t,regularPriceStyle:r,regularPrice:o,priceClassName:u,priceStyle:s,price:l})=>(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"screen-reader-text"},(0,c.__)("Previous price:","woocommerce")),(0,n.createElement)(a.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,n.createElement)("del",{className:i()("wc-block-components-product-price__regular",t),style:r},e),value:o}),(0,n.createElement)("span",{className:"screen-reader-text"},(0,c.__)("Discounted price:","woocommerce")),(0,n.createElement)(a.FormattedMonetaryAmount,{currency:e,renderText:e=>(0,n.createElement)("ins",{className:i()("wc-block-components-product-price__value","is-discounted",u),style:s},e),value:l})),d=({align:e,className:t,currency:r,format:c="<price/>",maxPrice:o,minPrice:u,price:d,priceClassName:p,priceStyle:f,regularPrice:y,regularPriceClassName:g,regularPriceStyle:h,style:v})=>{const b=i()(t,"price","wc-block-components-product-price",{[`wc-block-components-product-price--align-${e}`]:e});c.includes("<price/>")||(c="<price/>",console.error("Price formats need to include the `<price/>` tag."));const _=y&&d&&d<y;let E=(0,n.createElement)("span",{className:i()("wc-block-components-product-price__value",p)});return _?E=(0,n.createElement)(m,{currency:r,price:d,priceClassName:p,priceStyle:f,regularPrice:y,regularPriceClassName:g,regularPriceStyle:h}):void 0!==u&&void 0!==o?E=(0,n.createElement)(l,{currency:r,maxPrice:o,minPrice:u,priceClassName:p,priceStyle:f}):d&&(E=(0,n.createElement)(a.FormattedMonetaryAmount,{className:i()("wc-block-components-product-price__value",p),currency:r,value:d,style:f})),(0,n.createElement)("span",{className:b,style:v},(0,s.createInterpolateElement)(c,{price:E}))}},5484:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>fe});var n=r(9196),c=r(9659),a=r(3849),o=r.n(a),i=r(5736),u=r(9307),s=r(5158),l=r(9630);function m(e,t,r){var c=this,a=(0,n.useRef)(null),o=(0,n.useRef)(0),i=(0,n.useRef)(null),u=(0,n.useRef)([]),s=(0,n.useRef)(),l=(0,n.useRef)(),m=(0,n.useRef)(e),d=(0,n.useRef)(!0);(0,n.useEffect)((function(){m.current=e}),[e]);var p=!t&&0!==t&&"undefined"!=typeof window;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var f=!!(r=r||{}).leading,y=!("trailing"in r)||!!r.trailing,g="maxWait"in r,h=g?Math.max(+r.maxWait||0,t):null;(0,n.useEffect)((function(){return d.current=!0,function(){d.current=!1}}),[]);var v=(0,n.useMemo)((function(){var e=function(e){var t=u.current,r=s.current;return u.current=s.current=null,o.current=e,l.current=m.current.apply(r,t)},r=function(e,t){p&&cancelAnimationFrame(i.current),i.current=p?requestAnimationFrame(e):setTimeout(e,t)},n=function(e){if(!d.current)return!1;var r=e-a.current;return!a.current||r>=t||r<0||g&&e-o.current>=h},v=function(t){return i.current=null,y&&u.current?e(t):(u.current=s.current=null,l.current)},b=function e(){var c=Date.now();if(n(c))return v(c);if(d.current){var i=t-(c-a.current),u=g?Math.min(i,h-(c-o.current)):i;r(e,u)}},_=function(){var m=Date.now(),p=n(m);if(u.current=[].slice.call(arguments),s.current=c,a.current=m,p){if(!i.current&&d.current)return o.current=a.current,r(b,t),f?e(a.current):l.current;if(g)return r(b,t),e(a.current)}return i.current||r(b,t),l.current};return _.cancel=function(){i.current&&(p?cancelAnimationFrame(i.current):clearTimeout(i.current)),o.current=0,u.current=a.current=s.current=i.current=null},_.isPending=function(){return!!i.current},_.flush=function(){return i.current?v(Date.now()):l.current},_}),[f,g,t,h,y,p]);return v}function d(e,t){return e===t}function p(e){return"function"==typeof e?function(){return e}:e}r(8968);const f=({className:e,quantity:t=1,minimum:r=1,maximum:c,onChange:a=(()=>{}),step:d=1,itemName:p="",disabled:f})=>{const y=o()("wc-block-components-quantity-selector",e),g=(0,u.useRef)(null),h=(0,u.useRef)(null),v=(0,u.useRef)(null),b=void 0!==c,_=!f&&t-d>=r,E=!f&&(!b||t+d<=c),w=(0,u.useCallback)((e=>{let t=e;b&&(t=Math.min(t,Math.floor(c/d)*d)),t=Math.max(t,Math.ceil(r/d)*d),t=Math.floor(t/d)*d,t!==e&&a(t)}),[b,c,r,a,d]),k=m(w,300);(0,u.useLayoutEffect)((()=>{w(t)}),[t,w]);const N=(0,u.useCallback)((e=>{const r=void 0!==typeof e.key?"ArrowDown"===e.key:e.keyCode===l.DOWN,n=void 0!==typeof e.key?"ArrowUp"===e.key:e.keyCode===l.UP;r&&_&&(e.preventDefault(),a(t-d)),n&&E&&(e.preventDefault(),a(t+d))}),[t,a,E,_,d]);return(0,n.createElement)("div",{className:y},(0,n.createElement)("input",{ref:g,className:"wc-block-components-quantity-selector__input",disabled:f,type:"number",step:d,min:r,max:c,value:t,onKeyDown:N,onChange:e=>{let r=parseInt(e.target.value,10);r=isNaN(r)?t:r,r!==t&&(a(r),k(r))},"aria-label":(0,i.sprintf)(/* translators: %s refers to the item name in the cart. */ /* translators: %s refers to the item name in the cart. */
(0,i.__)("Quantity of %s in your cart.","woocommerce"),p)}),(0,n.createElement)("button",{ref:h,"aria-label":(0,i.sprintf)(/* translators: %s refers to the item name in the cart. */ /* translators: %s refers to the item name in the cart. */
(0,i.__)("Reduce quantity of %s","woocommerce"),p),className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--minus",disabled:!_,onClick:()=>{const e=t-d;a(e),(0,s.speak)((0,i.sprintf)(/* translators: %s refers to the item's new quantity in the cart. */ /* translators: %s refers to the item's new quantity in the cart. */
(0,i.__)("Quantity reduced to %s.","woocommerce"),e)),w(e)}},"-"),(0,n.createElement)("button",{ref:v,"aria-label":(0,i.sprintf)(/* translators: %s refers to the item's name in the cart. */ /* translators: %s refers to the item's name in the cart. */
(0,i.__)("Increase quantity of %s","woocommerce"),p),disabled:!E,className:"wc-block-components-quantity-selector__button wc-block-components-quantity-selector__button--plus",onClick:()=>{const e=t+d;a(e),(0,s.speak)((0,i.sprintf)(/* translators: %s refers to the item's new quantity in the cart. */ /* translators: %s refers to the item's new quantity in the cart. */
(0,i.__)("Quantity increased to %s.","woocommerce"),e)),w(e)}},"+"))};var y=r(3088),g=r(7121),h=r(9818),v=r(4801),b=r(8161),_=r(7998),E=r(3243),w=r(9060);var k=r(8360),N=r(4293),A=r(3554);function M(e){return M="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},M(e)}function P(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?C(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var R={normalizePrecision:function(e){var t=e.reduce((function(e,t){return Math.max(e.getPrecision(),t.getPrecision())}));return e.map((function(e){return e.getPrecision()!==t?e.convertPrecision(t):e}))},minimum:function(e){var t=P(e),r=t[0],n=t.slice(1),c=r;return n.forEach((function(e){c=c.lessThan(e)?c:e})),c},maximum:function(e){var t=P(e),r=t[0],n=t.slice(1),c=r;return n.forEach((function(e){c=c.greaterThan(e)?c:e})),c}};function x(e){return!isNaN(parseInt(e))&&isFinite(e)}function S(e){return e%2==0}function D(e){return x(e)&&!Number.isInteger(e)}function I(e){return Math.abs(e)%1==.5}function F(e){return void 0===e}function O(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:".",r={};return Object.entries(e).forEach((function(e){if("object"===M(e[1])){var n=O(e[1]);Object.entries(n).forEach((function(n){r[e[0]+t+n[0]]=n[1]}))}else r[e[0]]=e[1]})),r}function T(){var e={HALF_ODD:function(e){var t=Math.round(e);return I(e)&&S(t)?t-1:t},HALF_EVEN:function(e){var t=Math.round(e);return I(e)?S(t)?t:t-1:t},HALF_UP:function(e){return Math.round(e)},HALF_DOWN:function(e){return I(e)?Math.floor(e):Math.round(e)},HALF_TOWARDS_ZERO:function(e){return I(e)?Math.sign(e)*Math.floor(Math.abs(e)):Math.round(e)},HALF_AWAY_FROM_ZERO:function(e){return I(e)?Math.sign(e)*Math.ceil(Math.abs(e)):Math.round(e)},DOWN:function(e){return Math.floor(e)}};return{add:function(e,t){return e+t},subtract:function(e,t){return e-t},multiply:function(e,t){return D(e)||D(t)?function(e,t){var r=function(e){return Math.pow(10,function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:0).toString();if(e.indexOf("e-")>0)return parseInt(e.split("e-")[1]);var t=e.split(".")[1];return t?t.length:0}(e))},n=Math.max(r(e),r(t));return Math.round(e*n)*Math.round(t*n)/(n*n)}(e,t):e*t},divide:function(e,t){return e/t},modulo:function(e,t){return e%t},round:function(t){return e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:"HALF_EVEN"](t)}}}var q=T();function L(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0;for(var r in t)e=e.replace("{{".concat(r,"}}"),t[r]);return e};return{getExchangeRate:function(r,n){return(c=e.endpoint,!Boolean(c)||"object"!==M(c)&&"function"!=typeof c||"function"!=typeof c.then?function(r,n){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Promise((function(r,n){var c=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){4===c.readyState&&(c.status>=200&&c.status<400?r(JSON.parse(c.responseText)):n(new Error(c.statusText)))},onerror:function(){n(new Error("Network error"))}});c.open("GET",e,!0),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(var r in t)e.setRequestHeader(r,t[r])}(c,t.headers),c.send()}))}(t(e.endpoint,{from:r,to:n}),{headers:e.headers})}(r,n):e.endpoint).then((function(c){return O(c)[t(e.propertyPath,{from:r,to:n})]}));var c}}}function j(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Error;if(!e)throw new r(t)}function U(e){j(Number.isInteger(e),"You must provide an integer.",TypeError)}var $=T(),H=Object.assign((function e(t){var r=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),n=r.amount,c=r.currency,a=r.precision;U(n),U(a);var o=e.globalLocale,i=e.globalFormat,u=e.globalRoundingMode,s=e.globalFormatRoundingMode,l=Object.assign({},e.globalExchangeRatesApi),m=function(t){var r=Object.assign({},Object.assign({},{amount:n,currency:c,precision:a},t),Object.assign({},{locale:this.locale},t));return Object.assign(e({amount:r.amount,currency:r.currency,precision:r.precision}),{locale:r.locale})},d=function(e){j(this.hasSameCurrency(e),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return n},getCurrency:function(){return c},getLocale:function(){return this.locale||o},setLocale:function(e){return m.call(this,{locale:e})},getPrecision:function(){return a},convertPrecision:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s;U(e);var r=this.getPrecision(),n=e>r,c=n?$.multiply:$.divide,a=n?[e,r]:[r,e],o=Math.pow(10,$.subtract.apply($,a));return m.call(this,{amount:$.round(c(this.getAmount(),o),t),precision:e})},add:function(t){d.call(this,t);var r=e.normalizePrecision([this,t]);return m.call(this,{amount:$.add(r[0].getAmount(),r[1].getAmount()),precision:r[0].getPrecision()})},subtract:function(t){d.call(this,t);var r=e.normalizePrecision([this,t]);return m.call(this,{amount:$.subtract(r[0].getAmount(),r[1].getAmount()),precision:r[0].getPrecision()})},multiply:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u;return m.call(this,{amount:$.round($.multiply(this.getAmount(),e),t)})},divide:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u;return m.call(this,{amount:$.round($.divide(this.getAmount(),e),t)})},percentage:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u;return j(function(e){return x(e)&&e<=100&&e>=0}(e),"You must provide a numeric value between 0 and 100.",RangeError),this.multiply($.divide(e,100),t)},allocate:function(e){var t=this;!function(e){j(function(e){return e.length>0&&e.every((function(e){return e>=0}))&&e.some((function(e){return e>0}))}(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}(e);for(var r=e.reduce((function(e,t){return $.add(e,t)})),n=this.getAmount(),c=e.map((function(e){var c=Math.floor($.divide($.multiply(t.getAmount(),e),r));return n=$.subtract(n,c),m.call(t,{amount:c})})),a=0;n>0;)e[a]>0&&(c[a]=c[a].add(m.call(this,{amount:1})),n=$.subtract(n,1)),a+=1;return c},convert:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.endpoint,c=void 0===n?l.endpoint:n,a=r.propertyPath,o=void 0===a?l.propertyPath||"rates.{{to}}":a,i=r.headers,s=void 0===i?l.headers:i,d=r.roundingMode,p=void 0===d?u:d,f=Object.assign({},{endpoint:c,propertyPath:o,headers:s,roundingMode:p});return L(f).getExchangeRate(this.getCurrency(),e).then((function(r){return j(!F(r),'No rate was found for the destination currency "'.concat(e,'".'),TypeError),m.call(t,{amount:$.round($.multiply(t.getAmount(),parseFloat(r)),f.roundingMode),currency:e})}))},equalsTo:function(e){return this.hasSameAmount(e)&&this.hasSameCurrency(e)},lessThan:function(t){d.call(this,t);var r=e.normalizePrecision([this,t]);return r[0].getAmount()<r[1].getAmount()},lessThanOrEqual:function(t){d.call(this,t);var r=e.normalizePrecision([this,t]);return r[0].getAmount()<=r[1].getAmount()},greaterThan:function(t){d.call(this,t);var r=e.normalizePrecision([this,t]);return r[0].getAmount()>r[1].getAmount()},greaterThanOrEqual:function(t){d.call(this,t);var r=e.normalizePrecision([this,t]);return r[0].getAmount()>=r[1].getAmount()},isZero:function(){return 0===this.getAmount()},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return 0!==$.modulo(this.getAmount(),Math.pow(10,a))},hasCents:function(){return 0!==$.modulo(this.getAmount(),Math.pow(10,a))},hasSameCurrency:function(e){return this.getCurrency()===e.getCurrency()},hasSameAmount:function(t){var r=e.normalizePrecision([this,t]);return r[0].getAmount()===r[1].getAmount()},toFormat:function(){var e,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,r=(e=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(arguments.length>0&&void 0!==arguments[0]?arguments[0]:i),{getMatches:function(){return null!==e?e.slice(1).filter((function(e){return!F(e)})):[]},getMinimumFractionDigits:function(){var e=function(e){return"."===e};return F(this.getMatches().find(e))?0:this.getMatches()[q.add(this.getMatches().findIndex(e),1)].split("").length},getCurrencyDisplay:function(){return{USD:"code",dollar:"name",$:"symbol"}[this.getMatches().find((function(e){return"USD"===e||"dollar"===e||"$"===e}))]},getStyle:function(){return F(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!F(this.getMatches().find((function(e){return","===e})))}});return this.toRoundedUnit(r.getMinimumFractionDigits(),t).toLocaleString(this.getLocale(),{currencyDisplay:r.getCurrencyDisplay(),useGrouping:r.getUseGrouping(),minimumFractionDigits:r.getMinimumFractionDigits(),style:r.getStyle(),currency:this.getCurrency()})},toUnit:function(){return $.divide(this.getAmount(),Math.pow(10,a))},toRoundedUnit:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s,r=Math.pow(10,e);return $.divide($.round($.multiply(this.toUnit(),r),t),r)},toObject:function(){return{amount:n,currency:c,precision:a}},toJSON:function(){return this.toObject()}}}),{defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},{globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}},R);const Z=H;var z=r(4617);r(2930);const W=({children:e,className:t})=>(0,n.createElement)("div",{className:o()("wc-block-components-product-badge",t)},e),V=()=>(0,n.createElement)(W,{className:"wc-block-components-product-backorder-badge"},(0,i.__)("Available on backorder","woocommerce"));var Y=r(2629);const Q=({image:e={},fallbackAlt:t=""})=>{const r=e.thumbnail?{src:e.thumbnail,alt:(0,Y.decodeEntities)(e.alt)||t||"Product Image"}:{src:z.PLACEHOLDER_IMG_SRC,alt:""};return(0,n.createElement)("img",{...r,alt:r.alt})},B=({lowStockRemaining:e})=>e?(0,n.createElement)(W,{className:"wc-block-components-product-low-stock-badge"},(0,i.sprintf)(/* translators: %d stock amount (number of items in stock for product) */ /* translators: %d stock amount (number of items in stock for product) */
(0,i.__)("%d left in stock","woocommerce"),e)):null;var K=r(7427);r(3804);const G=({details:e=[]})=>Array.isArray(e)?0===(e=e.filter((e=>!e.hidden))).length?null:(0,n.createElement)("ul",{className:"wc-block-components-product-details"},e.map((e=>{const t=(null==e?void 0:e.key)||e.name||"",r=(null==e?void 0:e.className)||(t?`wc-block-components-product-details__${(0,K.o)(t)}`:"");return(0,n.createElement)("li",{key:t+(e.display||e.value),className:r},t&&(0,n.createElement)(n.Fragment,null,(0,n.createElement)("span",{className:"wc-block-components-product-details__name"},(0,Y.decodeEntities)(t),":")," "),(0,n.createElement)("span",{className:"wc-block-components-product-details__value"},(0,Y.decodeEntities)(e.display||e.value)))}))):null;var J=r(987);const X=e=>e.replace(/<\/?[a-z][^>]*?>/gi,""),ee=(e,t)=>e.replace(/[\s|\.\,]+$/i,"")+t;var te=r(5266);const re=({source:e,maxLength:t=15,countType:r="words",className:c="",style:a={}})=>{const o=(0,u.useMemo)((()=>((e,t=15,r="words")=>{const n=(0,J.autop)(e);if((0,te.count)(n,r)<=t)return n;const c=(e=>{const t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)})(n);return(0,te.count)(c,r)<=t?c:"words"===r?((e,t,r="&hellip;",n=!0)=>{const c=X(e),a=c.split(" ").splice(0,t).join(" ");return a===c?n?(0,J.autop)(c):c:n?(0,J.autop)(ee(a,r)):ee(a,r)})(c,t):((e,t,r=!0,n="&hellip;",c=!0)=>{const a=X(e),o=a.slice(0,t);if(o===a)return c?(0,J.autop)(a):a;if(r)return(0,J.autop)(ee(o,n));const i=o.match(/([\s]+)/g),u=i?i.length:0,s=a.slice(0,t+u);return c?(0,J.autop)(ee(s,n)):ee(s,n)})(c,t,"characters_including_spaces"===r)})(e,t,r)),[e,t,r]);return(0,n.createElement)(u.RawHTML,{style:a,className:c},o)};var ne=r(8752);const ce=({className:e,shortDescription:t="",fullDescription:r=""})=>{const c=t||r;return c?(0,n.createElement)(re,{className:e,source:c,maxLength:15,countType:ne.Cm.wordCountType||"words"}):null};r(6021);const ae=({shortDescription:e="",fullDescription:t="",itemData:r=[],variation:c=[]})=>(0,n.createElement)("div",{className:"wc-block-components-product-metadata"},(0,n.createElement)(ce,{className:"wc-block-components-product-metadata__description",shortDescription:e,fullDescription:t}),(0,n.createElement)(G,{details:r}),(0,n.createElement)(G,{details:c.map((({attribute:e="",value:t})=>({key:e,value:t})))}));var oe=r(711);const ie=({currency:e,saleAmount:t,format:r="<price/>"})=>{if(!t||t<=0)return null;r.includes("<price/>")||(r="<price/>",console.error("Price formats need to include the `<price/>` tag."));const c=(0,i.sprintf)(/* translators: %s will be replaced by the discount amount */ /* translators: %s will be replaced by the discount amount */
(0,i.__)("Save %s","woocommerce"),r);return(0,n.createElement)(W,{className:"wc-block-components-sale-badge"},(0,u.createInterpolateElement)(c,{price:(0,n.createElement)(oe.FormattedMonetaryAmount,{currency:e,value:t})}))},ue=(e,t)=>e.convertPrecision(t.minorUnit).getAmount(),se=e=>(0,A.mustContain)(e,"<price/>"),le=(0,u.forwardRef)((({lineItem:e,onRemove:t=(()=>{}),tabIndex:r},a)=>{const{name:l="",catalog_visibility:M="visible",short_description:P="",description:C="",low_stock_remaining:R=null,show_backorder_badge:x=!1,quantity_limits:S={minimum:1,maximum:99,multiple_of:1,editable:!0},sold_individually:D=!1,permalink:I="",images:F=[],variation:O=[],item_data:T=[],prices:q={currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",price:"0",regular_price:"0",sale_price:"0",price_range:null,raw_prices:{precision:6,price:"0",regular_price:"0",sale_price:"0"}},totals:L={currency_code:"USD",currency_minor_unit:2,currency_symbol:"$",currency_prefix:"$",currency_suffix:"",currency_decimal_separator:".",currency_thousand_separator:",",line_subtotal:"0",line_subtotal_tax:"0"},extensions:j}=e,{quantity:U,setItemQuantity:$,removeItem:H,isPendingDelete:W}=(e=>{const t={key:"",quantity:1};(e=>(0,_.Kn)(e)&&(0,_.$n)(e,"key")&&(0,_.$n)(e,"quantity")&&(0,E.H)(e.key)&&(0,w.h)(e.quantity))(e)&&(t.key=e.key,t.quantity=e.quantity);const{key:r="",quantity:a=1}=t,{cartErrors:o}=(0,c.b)(),{__internalIncrementCalculating:i,__internalDecrementCalculating:s}=(0,h.useDispatch)(v.CHECKOUT_STORE_KEY),[l,f]=(0,u.useState)(a),[y]=(A=l,R=d,P=(0,n.useState)(p(A)),C=P[1],x=[P[0],(0,n.useCallback)((function(e){return C(p(e))}),[])],S=x[0],D=x[1],I=m((0,n.useCallback)((function(e){return D(e)}),[D]),400,M),F=(0,n.useRef)(A),R(F.current,A)||(I(A),F.current=A),[S,I]),g=(0,b.D)(y),{removeItemFromCart:k,changeCartItemQuantity:N}=(0,h.useDispatch)(v.CART_STORE_KEY);var A,M,P,C,R,x,S,D,I,F;(0,u.useEffect)((()=>f(a)),[a]);const O=(0,h.useSelect)((e=>{if(!r)return{quantity:!1,delete:!1};const t=e(v.CART_STORE_KEY);return{quantity:t.isItemPendingQuantity(r),delete:t.isItemPendingDelete(r)}}),[r]),T=(0,u.useCallback)((()=>r?k(r).catch((e=>{(0,v.processErrorResponse)(e)})):Promise.resolve(!1)),[r,k]);return(0,u.useEffect)((()=>{r&&(0,w.h)(g)&&Number.isFinite(g)&&g!==y&&N(r,y).catch((e=>{(0,v.processErrorResponse)(e)}))}),[r,N,y,g]),(0,u.useEffect)((()=>(O.delete?i():s(),()=>{O.delete&&s()})),[s,i,O.delete]),(0,u.useEffect)((()=>(O.quantity||y!==l?i():s(),()=>{(O.quantity||y!==l)&&s()})),[i,s,O.quantity,y,l]),{isPendingDelete:O.delete,quantity:l,setItemQuantity:f,removeItem:T,cartItemQuantityErrors:o}})(e),{dispatchStoreEvent:Y}=(0,k.n)(),{receiveCart:K,...G}=(0,c.b)(),J=(0,u.useMemo)((()=>({context:"cart",cartItem:e,cart:G})),[e,G]),X=(0,N.getCurrencyFromPriceResponse)(q),ee=(0,A.applyCheckoutFilter)({filterName:"itemName",defaultValue:l,extensions:j,arg:J}),te=Z({amount:parseInt(q.raw_prices.regular_price,10),precision:q.raw_prices.precision}),re=Z({amount:parseInt(q.raw_prices.price,10),precision:q.raw_prices.precision}),ne=te.subtract(re),ce=ne.multiply(U),oe=(0,N.getCurrencyFromPriceResponse)(L);let le=parseInt(L.line_subtotal,10);(0,z.getSetting)("displayCartPricesIncludingTax",!1)&&(le+=parseInt(L.line_subtotal_tax,10));const me=Z({amount:le,precision:oe.minorUnit}),de=F.length?F[0]:{},pe="hidden"===M||"search"===M,fe=(0,A.applyCheckoutFilter)({filterName:"cartItemClass",defaultValue:"",extensions:j,arg:J}),ye=(0,A.applyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"<price/>",extensions:j,arg:J,validation:se}),ge=(0,A.applyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"<price/>",extensions:j,arg:J,validation:se}),he=(0,A.applyCheckoutFilter)({filterName:"saleBadgePriceFormat",defaultValue:"<price/>",extensions:j,arg:J,validation:se}),ve=(0,A.applyCheckoutFilter)({filterName:"showRemoveItemLink",defaultValue:!0,extensions:j,arg:J});return(0,n.createElement)("tr",{className:o()("wc-block-cart-items__row",fe,{"is-disabled":W}),ref:a,tabIndex:r},(0,n.createElement)("td",{className:"wc-block-cart-item__image","aria-hidden":!(0,_.$n)(de,"alt")||!de.alt},pe?(0,n.createElement)(Q,{image:de,fallbackAlt:ee}):(0,n.createElement)("a",{href:I,tabIndex:-1},(0,n.createElement)(Q,{image:de,fallbackAlt:ee}))),(0,n.createElement)("td",{className:"wc-block-cart-item__product"},(0,n.createElement)("div",{className:"wc-block-cart-item__wrap"},(0,n.createElement)(g.Z,{disabled:W||pe,name:ee,permalink:I}),x?(0,n.createElement)(V,null):!!R&&(0,n.createElement)(B,{lowStockRemaining:R}),(0,n.createElement)("div",{className:"wc-block-cart-item__prices"},(0,n.createElement)(y.Z,{currency:X,regularPrice:ue(te,X),price:ue(re,X),format:ge})),(0,n.createElement)(ie,{currency:X,saleAmount:ue(ne,X),format:he}),(0,n.createElement)(ae,{shortDescription:P,fullDescription:C,itemData:T,variation:O}),(0,n.createElement)("div",{className:"wc-block-cart-item__quantity"},!D&&!!S.editable&&(0,n.createElement)(f,{disabled:W,quantity:U,minimum:S.minimum,maximum:S.maximum,step:S.multiple_of,onChange:t=>{$(t),Y("cart-set-item-quantity",{product:e,quantity:t})},itemName:ee}),ve&&(0,n.createElement)("button",{className:"wc-block-cart-item__remove-link","aria-label":(0,i.sprintf)(/* translators: %s refers to the item's name in the cart. */ /* translators: %s refers to the item's name in the cart. */
(0,i.__)("Remove %s from cart","woocommerce"),ee),onClick:()=>{t(),H(),Y("cart-remove-item",{product:e,quantity:U}),(0,s.speak)((0,i.sprintf)(/* translators: %s refers to the item name in the cart. */ /* translators: %s refers to the item name in the cart. */
(0,i.__)("%s has been removed from your cart.","woocommerce"),ee))},disabled:W},(0,i.__)("Remove item","woocommerce"))))),(0,n.createElement)("td",{className:"wc-block-cart-item__total"},(0,n.createElement)("div",{className:"wc-block-cart-item__total-price-and-sale-badge-wrapper"},(0,n.createElement)(y.Z,{currency:oe,format:ye,price:me.getAmount()}),U>1&&(0,n.createElement)(ie,{currency:X,saleAmount:ue(ce,X),format:he}))))}));r(9510);const me=[...Array(3)].map(((_x,e)=>(0,n.createElement)(le,{lineItem:{},key:e}))),de=e=>{const t={};return e.forEach((({key:e})=>{t[e]=(0,u.createRef)()})),t},pe=({lineItems:e=[],isLoading:t=!1,className:r})=>{const c=(0,u.useRef)(null),a=(0,u.useRef)(de(e));(0,u.useEffect)((()=>{a.current=de(e)}),[e]);const s=e=>()=>{null!=a&&a.current&&e&&a.current[e].current instanceof HTMLElement?a.current[e].current.focus():c.current instanceof HTMLElement&&c.current.focus()},l=t?me:e.map(((t,r)=>{const c=e.length>r+1?e[r+1].key:null;return(0,n.createElement)(le,{key:t.key,lineItem:t,onRemove:s(c),ref:a.current[t.key],tabIndex:-1})}));return(0,n.createElement)("table",{className:o()("wc-block-cart-items",r),ref:c,tabIndex:-1},(0,n.createElement)("thead",null,(0,n.createElement)("tr",{className:"wc-block-cart-items__header"},(0,n.createElement)("th",{className:"wc-block-cart-items__header-image"},(0,n.createElement)("span",null,(0,i.__)("Product","woocommerce"))),(0,n.createElement)("th",{className:"wc-block-cart-items__header-product"},(0,n.createElement)("span",null,(0,i.__)("Details","woocommerce"))),(0,n.createElement)("th",{className:"wc-block-cart-items__header-total"},(0,n.createElement)("span",null,(0,i.__)("Total","woocommerce"))))),(0,n.createElement)("tbody",null,l))},fe=({className:e})=>{const{cartItems:t,cartIsLoading:r}=(0,c.b)();return(0,n.createElement)(pe,{className:e,lineItems:t,isLoading:r})}},112:(e,t,r)=>{"use strict";r.d(t,{$:()=>a});var n=r(3112),c=r(7090);function a(e,t){return void 0===t&&(t={}),(0,c.B)(e,(0,n.pi)({delimiter:"."},t))}},9510:()=>{},2930:()=>{},3804:()=>{},6021:()=>{},333:()=>{},6645:()=>{},8968:()=>{},3569:(e,t,r)=>{"use strict";function n(e){return e.toLowerCase()}r.d(t,{U:()=>n})},7090:(e,t,r)=>{"use strict";r.d(t,{B:()=>o});var n=r(3569),c=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],a=/[^A-Z0-9]+/gi;function o(e,t){void 0===t&&(t={});for(var r=t.splitRegexp,o=void 0===r?c:r,u=t.stripRegexp,s=void 0===u?a:u,l=t.transform,m=void 0===l?n.U:l,d=t.delimiter,p=void 0===d?" ":d,f=i(i(e,o,"$1\0$2"),s,"\0"),y=0,g=f.length;"\0"===f.charAt(y);)y++;for(;"\0"===f.charAt(g-1);)g--;return f.slice(y,g).split("\0").map(m).join(p)}function i(e,t,r){return t instanceof RegExp?e.replace(t,r):t.reduce((function(e,t){return e.replace(t,r)}),e)}},7427:(e,t,r)=>{"use strict";r.d(t,{o:()=>a});var n=r(3112),c=r(112);function a(e,t){return void 0===t&&(t={}),(0,c.$)(e,(0,n.pi)({delimiter:"-"},t))}},3112:(e,t,r)=>{"use strict";r.d(t,{pi:()=>n});var n=function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var c in t=arguments[r])Object.prototype.hasOwnProperty.call(t,c)&&(e[c]=t[c]);return e},n.apply(this,arguments)};Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError}}]);