(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[44],{148:function(e,t,o){"use strict";var c=o(0);o(215),t.a=()=>Object(c.createElement)("span",{className:"wc-block-components-spinner","aria-hidden":"true"})},149:function(e,t,o){"use strict";var c=o(0),n=o(1),a=o(6),s=o.n(a),r=(o(216),o(148));t.a=e=>{let{children:t,className:o,screenReaderLabel:a,showSpinner:l=!1,isLoading:i=!0}=e;return Object(c.createElement)("div",{className:s()(o,{"wc-block-components-loading-mask":i})},i&&l&&Object(c.createElement)(r.a,null),Object(c.createElement)("div",{className:s()({"wc-block-components-loading-mask__children":i}),"aria-hidden":i},t),i&&Object(c.createElement)("span",{className:"screen-reader-text"},a||Object(n.__)("Loading…","woocommerce")))}},215:function(e,t){},216:function(e,t){},217:function(e,t){},219:function(e,t,o){"use strict";var c=o(0),n=o(12);const a=Object(c.createElement)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(c.createElement)(n.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"}));t.a=a},229:function(e,t,o){"use strict";var c=o(15),n=o.n(c),a=o(0),s=o(6),r=o.n(s),l=o(1),i=o(76),u=o(219);o(217);var p=e=>{let{text:t,screenReaderText:o="",element:c="li",className:s="",radius:l="small",children:i=null,...u}=e;const p=c,m=r()(s,"wc-block-components-chip","wc-block-components-chip--radius-"+l),b=Boolean(o&&o!==t);return Object(a.createElement)(p,n()({className:m},u),Object(a.createElement)("span",{"aria-hidden":b,className:"wc-block-components-chip__text"},t),b&&Object(a.createElement)("span",{className:"screen-reader-text"},o),i)};t.a=e=>{let{ariaLabel:t="",className:o="",disabled:c=!1,onRemove:s=(()=>{}),removeOnAnyClick:m=!1,text:b,screenReaderText:d="",...g}=e;const O=m?"span":"button";if(!t){const e=d&&"string"==typeof d?d:b;t="string"!=typeof e?
/* translators: Remove chip. */
Object(l.__)("Remove","woocommerce"):Object(l.sprintf)(
/* translators: %s text of the chip to remove. */
Object(l.__)('Remove "%s"',"woocommerce"),e)}const j={"aria-label":t,disabled:c,onClick:s,onKeyDown:e=>{"Backspace"!==e.key&&"Delete"!==e.key||s()}},_=m?j:{},v=m?{"aria-hidden":!0}:j;return Object(a.createElement)(p,n()({},g,_,{className:r()(o,"is-removable"),element:m?"button":g.element,screenReaderText:d,text:b}),Object(a.createElement)(O,n()({className:"wc-block-components-chip__remove"},v),Object(a.createElement)(i.a,{className:"wc-block-components-chip__remove-icon",icon:u.a,size:16})))}},302:function(e,t,o){"use strict";o.d(t,"a",(function(){return i}));var c=o(1),n=o(7),a=o(3),s=o(31),r=o(11),l=o(43);const i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{cartCoupons:t,cartIsLoading:o}=Object(l.a)(),{createErrorNotice:i}=Object(n.useDispatch)("core/notices"),{createNotice:u}=Object(n.useDispatch)("core/notices"),{setValidationErrors:p}=Object(n.useDispatch)(a.VALIDATION_STORE_KEY),{isApplyingCoupon:m,isRemovingCoupon:b}=Object(n.useSelect)(e=>{const t=e(a.CART_STORE_KEY);return{isApplyingCoupon:t.isApplyingCoupon(),isRemovingCoupon:t.isRemovingCoupon()}},[i,u]),{applyCoupon:d,removeCoupon:g,receiveApplyingCoupon:O}=Object(n.useDispatch)(a.CART_STORE_KEY),j=t=>{d(t).then(o=>{!0===o&&Object(r.__experimentalApplyCheckoutFilter)({filterName:"showApplyCouponNotice",defaultValue:!0,arg:{couponCode:t,context:e}})&&u("info",Object(c.sprintf)(
/* translators: %s coupon code. */
Object(c.__)('Coupon code "%s" has been applied to your cart.',"woocommerce"),t),{id:"coupon-form",type:"snackbar",context:e})}).catch(e=>{p({coupon:{message:Object(s.decodeEntities)(e.message),hidden:!1}}),O("")})},_=t=>{g(t).then(o=>{!0===o&&Object(r.__experimentalApplyCheckoutFilter)({filterName:"showRemoveCouponNotice",defaultValue:!0,arg:{couponCode:t,context:e}})&&u("info",Object(c.sprintf)(
/* translators: %s coupon code. */
Object(c.__)('Coupon code "%s" has been removed from your cart.',"woocommerce"),t),{id:"coupon-form",type:"snackbar",context:e})}).catch(t=>{i(t.message,{id:"coupon-form",context:e}),O("")})};return{appliedCoupons:t,isLoading:o,applyCoupon:j,removeCoupon:_,isApplyingCoupon:m,isRemovingCoupon:b}}},368:function(e,t){},439:function(e,t,o){"use strict";var c=o(0),n=o(1),a=o(149),s=o(229),r=o(11),l=o(2);o(368);const i={context:"summary"};t.a=e=>{let{cartCoupons:t=[],currency:o,isRemovingCoupon:u,removeCoupon:p,values:m}=e;const{total_discount:b,total_discount_tax:d}=m,g=parseInt(b,10);if(!g&&0===t.length)return null;const O=parseInt(d,10),j=Object(l.getSetting)("displayCartPricesIncludingTax",!1)?g+O:g,_=Object(r.__experimentalApplyCheckoutFilter)({arg:i,filterName:"coupons",defaultValue:t});return Object(c.createElement)(r.TotalsItem,{className:"wc-block-components-totals-discount",currency:o,description:0!==_.length&&Object(c.createElement)(a.a,{screenReaderLabel:Object(n.__)("Removing coupon…","woocommerce"),isLoading:u,showSpinner:!1},Object(c.createElement)("ul",{className:"wc-block-components-totals-discount__coupon-list"},_.map(e=>Object(c.createElement)(s.a,{key:"coupon-"+e.code,className:"wc-block-components-totals-discount__coupon-list-item",text:e.label,screenReaderText:Object(n.sprintf)(
/* translators: %s Coupon code. */
Object(n.__)("Coupon: %s","woocommerce"),e.label),disabled:u,onRemove:()=>{p(e.code)},radius:"large",ariaLabel:Object(n.sprintf)(
/* translators: %s is a coupon code. */
Object(n.__)('Remove coupon "%s"',"woocommerce"),e.label)})))),label:j?Object(n.__)("Discount","woocommerce"):Object(n.__)("Coupons","woocommerce"),value:j?-1*j:"-"})}},526:function(e,t,o){"use strict";o.r(t);var c=o(0),n=o(439),a=o(44),s=o(43),r=o(302),l=o(11);const i=()=>{const{extensions:e,receiveCart:t,...o}=Object(s.a)(),n={extensions:e,cart:o,context:"woocommerce/checkout"};return Object(c.createElement)(l.ExperimentalDiscountsMeta.Slot,n)};t.default=e=>{let{className:t=""}=e;const{cartTotals:o,cartCoupons:u}=Object(s.a)(),{removeCoupon:p,isRemovingCoupon:m}=Object(r.a)("wc/checkout"),b=Object(a.getCurrencyFromPriceResponse)(o);return Object(c.createElement)(c.Fragment,null,Object(c.createElement)(l.TotalsWrapper,{className:t},Object(c.createElement)(n.a,{cartCoupons:u,currency:b,isRemovingCoupon:m,removeCoupon:p,values:o})),Object(c.createElement)(i,null))}}}]);