woocommerce/packages/woocommerce-blocks/build/cart-blocks/order-summary-frontend.js

23 lines
27 KiB
JavaScript
Raw Normal View History

2021-12-10 12:03:04 +00:00
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[28],{143:function(e,t,n){"use strict";var c=n(14),a=n.n(c),o=n(23),r=n.n(o),s=n(76),i=n(6),l=n.n(i),p=n(138),u=(n(251),["className","showSpinner","children"]);t.a=function(e){var t=e.className,n=e.showSpinner,c=void 0!==n&&n,o=e.children,i=r()(e,u),d=l()("wc-block-components-button",t,{"wc-block-components-button--loading":c});return React.createElement(s.a,a()({className:d},i),c&&React.createElement(p.a,null),React.createElement("span",{className:"wc-block-components-button__text"},o))}},147:function(e,t){},149:function(e,t){},152:function(e,t,n){"use strict";var c=n(4),a=n.n(c),o=n(23),r=n.n(o),s=n(0),i=["srcElement","size"];function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}t.a=function(e){var t=e.srcElement,n=e.size,c=void 0===n?24:n,o=r()(e,i);return Object(s.isValidElement)(t)?Object(s.cloneElement)(t,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({width:c,height:c},o)):null}},174:function(e,t,n){"use strict";t.a=function(e){var t=e.label,n=e.secondaryLabel,c=e.description,a=e.secondaryDescription,o=e.id;return React.createElement("div",{className:"wc-block-components-radio-control__option-layout"},React.createElement("div",{className:"wc-block-components-radio-control__label-group"},t&&React.createElement("span",{id:o&&"".concat(o,"__label"),className:"wc-block-components-radio-control__label"},t),n&&React.createElement("span",{id:o&&"".concat(o,"__secondary-label"),className:"wc-block-components-radio-control__secondary-label"},n)),React.createElement("div",{className:"wc-block-components-radio-control__description-group"},c&&React.createElement("span",{id:o&&"".concat(o,"__description"),className:"wc-block-components-radio-control__description"},c),a&&React.createElement("span",{id:o&&"".concat(o,"__secondary-description"),className:"wc-block-components-radio-control__secondary-description"},a)))}},175:function(e,t,n){"use strict";var c=n(14),a=n.n(c),o=n(23),r=n.n(o),s=n(6),i=n.n(s),l=(n(10),n(248),["children","className","headingLevel"]);t.a=function(e){var t=e.children,n=e.className,c=e.headingLevel,o=r()(e,l),s=i()("wc-block-components-title",n),p="h".concat(c);return React.createElement(p,a()({className:s},o),t)}},179:function(e,t,n){"use strict";var c=n(4),a=n.n(c),o=n(6),r=n.n(o),s=n(174);t.a=function(e){var t,n=e.checked,c=e.name,o=e.onChange,i=e.option,l=i.value,p=i.label,u=i.description,d=i.secondaryLabel,b=i.secondaryDescription;return React.createElement("label",{className:r()("wc-block-components-radio-control__option",{"wc-block-components-radio-control__option-checked":n}),htmlFor:"".concat(c,"-").concat(l)},React.createElement("input",{id:"".concat(c,"-").concat(l),className:"wc-block-components-radio-control__input",type:"radio",name:c,value:l,onChange:function(e){return o(e.target.value)},checked:n,"aria-describedby":r()((t={},a()(t,"".concat(c,"-").concat(l,"__label"),p),a()(t,"".concat(c,"-").concat(l,"__secondary-label"),d),a()(t,"".concat(c,"-").concat(l,"__description"),u),a()(t,"".concat(c,"-").concat(l,"__secondary-description"),b),t))}),React.createElement(s.a,{id:"".concat(c,"-").concat(l),label:p,secondaryLabel:d,description:u,secondaryDescription:b}))}},194:function(e,t,n){"use strict";var c=n(14),a=n.n(c),o=n(23),r=n.n(o),s=(n(10),n(6)),i=n.n(s),l=n(1),p=n(152),u=n(216),d=(n(149),["text","screenReaderText","element","className","radius","children"]),b=function(e){var t=e.text,n=e.screenReaderText,c=void 0===n?"":n,o=e.element,s=void 0===o?"li":o,l=e.className,p=void 0===l?"":l,u=e.radius,b=void 0===u?"small":u,m=e.children,g=void 0===m?null:m,f=
/* translators: Remove chip. */
Object(l.__)("Remove",'woocommerce'):Object(l.sprintf)(
/* translators: %s text of the chip to remove. */
Object(l.__)('Remove "%s"','woocommerce'),E)}var y={"aria-label":n,disabled:d,onClick:f,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||f()}},k=v?y:{},C=v?{"aria-hidden":!0}:y;return React.createElement(b,a()({},w,k,{className:i()(o,"is-removable"),element:v?"button":w.element,screenReaderText:_,text:O}),React.createElement(j,a()({className:"wc-block-components-chip__remove"},C),React.createElement(p.a,{className:"wc-block-components-chip__remove-icon",srcElement:u.a,size:16})))}},207:function(e,t,n){"use strict";var c=n(6),a=n.n(c),o=n(24),r=n(179);n(252),t.a=Object(o.withInstanceId)((function(e){var t=e.className,n=e.instanceId,c=e.id,o=e.selected,s=e.onChange,i=e.options,l=void 0===i?[]:i,p=c||n;return l.length&&React.createElement("div",{className:a()("wc-block-components-radio-control",t)},l.map((function(e){return React.createElement(r.a,{key:"".concat(p,"-").concat(e.value),name:"radio-control-".concat(p),checked:e.value===o,option:e,onChange:function(t){s(t),"function"==typeof e.onChange&&e.onChange(t)}})})))}))},208:function(e,t){},209:function(e,t,n){"use strict";var c=n(23),a=n.n(c),o=n(1),r=n(0),s=n(33),i=n(105),l=n(26),p=n(326),u=n(32),d=n(36),b=n(6),m=n.n(b),g=n(28),f=n(51),h=n(5),v=n.n(h),O=n(25),R=n.n(O),_=n(118),w=n(52),j=function(e){var t;return null===(t=e.find((function(e){return e.selected})))||void 0===t?void 0:t.rate_id},E=n(207),y=n(174),k=n(58),C=n(69),S=n(2),N=function(e){var t=Object(S.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(e.price,10)+parseInt(e.taxes,10):parseInt(e.price,10);return{label:Object(g.decodeEntities)(e.name),value:e.rate_id,description:React.createElement(React.Fragment,null,Number.isFinite(t)&&React.createElement(C.a,{currency:Object(k.getCurrencyFromPriceResponse)(e),value:t}),Number.isFinite(t)&&e.delivery_time?" — ":null,Object(g.decodeEntities)(e.delivery_time))}},x=function(e){var t=e.className,n=e.noResultsMessage,c=e.onSelectRate,a=e.rates,o=e.renderOption,r=void 0===o?N:o,s=e.selected;if(0===a.length)return n;if(a.length>1)return React.createElement(E.a,{className:t,onChange:function(e){c(e)},selected:s,options:a.map(r)});var i=r(a[0]),l=i.label,p=i.secondaryLabel,u=i.description,d=i.secondaryDescription;return React.createElement(y.a,{label:l,secondaryLabel:p,description:u,secondaryDescription:d})},I=(n(253),function(e){var t=e.packageId,n=e.className,c=e.noResultsMessage,a=e.renderOption,s=e.packageData,i=e.collapsible,p=void 0!==i&&i,u=e.collapse,d=void 0!==u&&u,b=e.showItems,h=void 0!==b&&b,O=function(e,t){var n=Object(w.a)().dispatchCheckoutEvent,c=Object(_.a)(),a=c.selectShippingRate,o=c.isSelectingRate,s=Object(r.useState)((function(){return j(t)})),i=v()(s,2),l=i[0],p=i[1],u=Object(r.useRef)(t);return Object(r.useEffect)((function(){R()(u.current,t)||(u.current=t,p(j(t)))}),[t]),{selectShippingRate:Object(r.useCallback)((function(t){p(t),a(t,e),n("set-selected-shipping-rate",{shippingRateId:t})}),[e,a,n]),selectedShippingRate:l,isSelectingRate:o}}(t,s.shipping_rates),E=O.selectShippingRate,y=O.selectedShippingRate,k=React.createElement(React.Fragment,null,(h||p)&&React.createElement("div",{className:"wc-block-components-shipping-rates-control__package-title"},s.name),h&&React.createElement("ul",{className:"wc-block-components-shipping-rates-control__package-items"},Object.values(s.items).map((function(e){var t=Object(g.decodeEntities)(e.name),n=e.quantity;return React.createElement("li",{key:e.key,className:"wc-block-components-shipping-rates-control__package-item"},React.createElement(f.a,{label:n>1?"".concat(t," × ").concat(n):"".concat(t),screenReaderLabel:Object(o.sprintf)(
/* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */
Object(o._n)("%1$s (%2$d unit)","%1$s (%2$d units)",n,'woocommerce'),t,n)}))})))),C=React.createElement(x,{className:n,noResultsMessage:c,rates:s.shipping_rates,onSelectRate:E,selected:y,renderOption:a});return p?React.createElement(l.Panel,{className:"wc-block-components-shipping-rates-control__package",initialOpen:!d,title:k},C):React.createElement("div",{className:m()("wc-block-components-shipping-rates-control__package",n)},k,C)}),P=["package_id"],T=["extensions","receiveCart"],L=function(e){var t=e.packages,n=e.collapse,c=e.showItems,o=e.collapsible,r=e.noResultsMessage,s=e.renderOption;return t.length?React.createElement(React.Fragment,null,t.map((function(e){var t=e.package_id,i=a()(e,P);return React.createElement(I,{key:t,packageId:t,packageData:i,collapsible:o,collapse:n,showItems:c,noResultsMessage:r,renderOption:s})}))):null};t.a=function(e){var t=e.shippingRates,n=e.shippingRatesLoading,c=e.className,b=e.collapsible,m=void 0!==b&&b,g=e.noResultsMessage,f=e.renderOption;Object(r.useEffect)((function(){if(!n){var e=Object(p.a)(t),c=Object(p.b)(t);1===e?Object(s.speak)(Object(o.sprintf)(
/* translators: %d number of shipping options found. */
Object(o._n)("%d shipping option was found.","%d shipping options were found.",c,'woocommerce'),c)):Object(s.speak)(Object(o.sprintf)(
/* translators: %d number of shipping packages packages. */
Object(o._n)("Shipping option searched for %d package.","Shipping options searched for %d packages.",e,'woocommerce'),e)+" "+Object(o.sprintf)(
/* translators: %d number of shipping options available. */
Object(o._n)("%d shipping option was found","%d shipping options were found",c,'woocommerce'),c))}}),[n,t]);var h=Object(u.a)(),v=h.extensions,O=(h.receiveCart,{className:c,collapsible:m,noResultsMessage:g,renderOption:f,extensions:v,cart:a()(h,T),components:{ShippingRatesControlPackage:I}}),R=Object(d.a)().isEditor;return React.createElement(i.a,{isLoading:n,screenReaderLabel:Object(o.__)("Loading shipping rates…",'woocommerce'),showSpinner:!0},R?React.createElement(L,{packages:t,noResultsMessage:g,renderOption:f}):React.createElement(React.Fragment,null,React.createElement(l.ExperimentalOrderShippingPackages.Slot,O),React.createElement(l.ExperimentalOrderShippingPackages,null,React.createElement(L,{packages:t,noResultsMessage:g,renderOption:f}))))}},214:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var c=n(4),a=n.n(c),o=n(1),r=n(11),s=n(8),i=n(28),l=n(32),p=n(0),u=n(226);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var m=n(127),g=n(54);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);t&&(c=c.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,c)}return n}var h=function(){var e=Object(l.a)(),t=e.cartCoupons,n=e.cartIsLoading,c=Object(g.a)().addErrorNotice,d=function(){var e=Object(u.b)(),t=e.notices,n=e.createSnackbarNotice,c=e.removeSnackbarNotice,a=e.setIsSuppressed,o=Object(p.useRef)(t);Object(p.useEffect)((function(){o.current=t}),[t]);var r=Object(p.useMemo)((function(){return{removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;o.current.forEach((function(t){null!==e&&t.status!==e||c(t.id)}))},removeSnackbarNotice:c}}),[c]),s=Object(p.useMemo)((function(){return{addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(e,t)}}}),[n]);return b(b(b({notices:t},r),s),{},{setIsSuppressed:a})}().addSnackbarNotice,h=Object(m.b)().setValidationErrors;return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach((function(t){a()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({appliedCoupons:t,isLoading:n},Object(r.useSelect)((function(e,t){var n=t.dispatch,a=e(s.CART_STORE_KEY),r=a.isApplyingCoupon(),l=a.isRemovingCoupon(),p=n(s.CART_STORE_KEY),u=p.applyCoupon,b=p.removeCoupon,m=p.receiveApplyingCoupon;return{applyCoupon:function(e){u(e).then((function(t){!0===t&&d(Object(o.sprintf)(
/* translators: %s coupon code. */
Object(o.__)('Coupon code "%s" has been applied to your cart.','woocommerce'),e),{id:"coupon-form"})})).catch((function(e){h({coupon:{message:Object(i.decodeEntities)(e.message),hidden:!1}}),m("")}))},removeCoupon:function(e){b(e).then((function(t){!0===t&&d(Object(o.sprintf)(
/* translators: %s coupon code. */
Object(o.__)('Coupon code "%s" has been removed from your cart.','woocommerce'),e),{id:"coupon-form"})})).catch((function(e){c(e.message,{id:"coupon-form"}),m("")}))},isApplyingCoupon:r,isRemovingCoupon:l}}),[c,d]))}},216:function(e,t,n){"use strict";var c=n(14),a=n.n(c),o=n(23),r=n.n(o),s=n(34),i=["className","size"],l=function(e){var t=e.className,n=e.size,c=r()(e,i);return React.createElement(s.SVG,a()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},c),React.createElement("path",{d:"M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z"}))},p=React.createElement(l,null);t.a=p},248:function(e,t){},251:function(e,t){},252:function(e,t){},253:function(e,t){},256:function(e,t){},257:function(e,t){},259:function(e,t){},263:function(e,t){},326:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return a}));var c=function(e){return e.length},a=function(e){return e.reduce((function(e,t){return e+t.shipping_rates.length}),0)}},332:function(e,t,n){"use strict";var c=n(1),a=n(105),o=n(194),r=(n(10),n(26)),s=n(2),i=(n(256),{context:"summary"});t.a=function(e){var t=e.cartCoupons,n=void 0===t?[]:t,l=e.currency,p=e.isRemovingCoupon,u=e.removeCoupon,d=e.values,b=d.total_discount,m=d.total_discount_tax,g=parseInt(b,10);if(!g&&0===n.length)return null;var f=parseInt(m,10),h=Object(s.getSetting)("displayCartPricesIncludingTax",!1)?g+f:g,v=Object(r.__experimentalApplyCheckoutFilter)({arg:i,filterName:"coupons",defaultValue:n});return React.createElement(r.TotalsItem,{className:"wc-block-components-totals-discount",currency:l,description:0!==v.length&&React.createElement(a.a,{screenReaderLabel:Object(c.__)("Removing coupon…",'woocommerce'),isLoading:p,showSpinner:!1},React.createElement("ul",{className:"wc-block-components-totals-discount__coupon-list"},v.map((function(e){return React.createElement(o.a,{key:"coupon-"+e.code,className:"wc-block-components-totals-discount__coupon-list-item",text:e.label,screenReaderText:Object(c.sprintf)(
/* translators: %s Coupon code. */
Object(c.__)("Coupon: %s",'woocommerce'),e.label),disabled:p,onRemove:function(){u(e.code)},radius:"large",ariaLabel:Object(c.sprintf)(
/* translators: %s is a coupon code. */
Object(c.__)('Remove coupon "%s"','woocommerce'),e.label)})})))),label:h?Object(c.__)("Discount",'woocommerce'):Object(c.__)("Coupons",'woocommerce'),value:h?-1*h:"-"})}},333:function(e,t,n){"use strict";var c=n(5),a=n.n(c),o=n(1),r=n(0),s=n(143),i=n(276),l=n(51),p=n(105),u=(n(10),n(24)),d=n(127),b=n(258),m=n(26);n(257),t.a=Object(u.withInstanceId)((function(e){var t=e.instanceId,n=e.isLoading,c=void 0!==n&&n,u=e.initialOpen,g=void 0!==u&&u,f=e.onSubmit,h=void 0===f?function(){}:f,v=Object(r.useState)(""),O=a()(v,2),R=O[0],_=O[1],w=Object(r.useRef)(!1),j=Object(d.b)(),E=j.getValidationError,y=j.getValidationErrorId,k=E("coupon");Object(r.useEffect)((function(){w.current!==c&&(c||!R||k||_(""),w.current=c)}),[c,R,k]);var C="wc-block-components-totals-coupon__input-".concat(t);return React.createElement(m.Panel,{className:"wc-block-components-totals-coupon",hasBorder:!1,initialOpen:g,title:React.createElement(l.a,{label:Object(o.__)("Coupon code",'woocommerce'),screenReaderLabel:Object(o.__)("Apply a coupon code",'woocommerce'),htmlFor:C})},React.createElement(p.a,{screenReaderLabel:Object(o.__)("Applying coupon…",'woocommerce'),isLoading:c,showSpinner:!1},React.createElement("div",{className:"wc-block-components-totals-coupon__content"},React.createElement("form",{className:"wc-block-components-totals-coupon__form"},React.createElement(i.a,{id:C,errorId:"coupon",className:"wc-block-components-totals-coupon__input",label:Object(o.__)("Enter code",'woocommerce'),value:R,ariaDescribedBy:y(C),onChange:function(e){_(e)},validateOnMount:!1,focusOnMount:!0,showError:!1}),React.createElement(s.a,{className:"wc-block-components-totals-coupon__button",disabled:c||!R,showSpinner:c,onClick:function(e){e.preventDefault(),h(R)},type:"submit"},Object(o.__)("Apply",'woocommerce'))),React.createElement(b.a,{propertyName:"coupon",elementId:C}))))}))},334:function(e,t,n){"use strict";var c=n(23),a=n.n(c),o=n(1),r=n(0),s=n(69),i=(n(10),n(26)),l=n(32),p=n(2),u=(n(263),["receiveCart"]);t.a=function(e){var t=e.currency,n=e.values,c=Object(p.getSetting)("taxesEnabled",!0)&&Object(p.getSetting)("displayCartPricesIncludingTax",!1),d=n.total_price,b=n.total_tax,m=Object(l.a)(),g=(m.receiveCart,a()(m,u)),f=Object(i.__experimentalApplyCheckoutFilter)({filterName:"totalLabel",defaultValue:Object(o.__)("Total",'woocommerce'),extensions:g.extensions,arg:{cart:g}}),h=parseInt(b,10);return React.createElement(i.TotalsItem,{className:"wc-block-components-totals-footer-item",currency:t,label:f,value:parseInt(d,10),description:c&&0!==h&&React.createElement("p",{className:"wc-block-components-totals-footer-item-tax"},Object(r.createInterpolateElement)(Object(o.__)("Including <TaxAmount/> in taxes",'woocommerce'),{TaxAmount:React.createElement(s.a,{className:"wc-block-components-totals-footer-item-tax-value",currency:t,value:h})}))})}},336:function(e,t,n){"use strict";var c=n(14),a=n.n(c),o=n(5),r=n.n(o),s=n(6),i=n.n(s),l=n(1),p=n(0),u=n(32),d=n(26),b=n(2),m=function(e){var t=e.selectedShippingRates;return React.createElement("div",{className:"wc-block-components-totals-item__description wc-block-components-totals-shipping__via"},Object(l.__)("via",'woocommerce')," ",t.join(", "))},g=n(153),f=n(209),h=function(e){var t=e.hasRates,n=e.shippingRates,c=e.shippingRatesLoading,a=t?Object(l.__)("Shipping options",'woocommerce'):Object(l.__)("Choose a shipping option",'woocommerce');return React.createElement("fieldset",{className:"wc-block-components-totals-shipping__fieldset"},React.createElement("legend",{className:"screen-reader-text"},a),React.createElement(f.a,{className:"wc-block-components-totals-shipping__options",collapsible:!0,noResultsMessage:React.createElement(g.a,{isDismissible:!1,className:i()("wc-block-components-shipping-rates-control__no-results-notice","woocommerce-error")},Object(l.__)("No shipping options were found.",'woocommerce')),shippingRates:n,shippingRatesLoading:c}))},v=n(66),O=n(143),R=n(25),_=n.n(R),w=n(127),j=(n(208),n(335)),E=function(e){var t=e.address,n=e.onUpdate,c=e.addressFields,a=Object(p.useState)(t),o=r()(a,2),s=o[0],i=o[1]
/* translators: %s location. */
Object(l.__)("Shipping to %s",'woocommerce'),s)+" "):null},x=(n(259),function(e){var t=e.label,n=void 0===t?Object(l.__)("Calculate",'woocommerce'):t,c=e.isShippingCalculatorOpen,a=e.setIsShippingCalculatorOpen;return React.createElement("button",{className:"wc-block-components-totals-shipping__change-address-button",onClick:function(){a(!c)},"aria-expanded":c},n)}),I=function(e){var t=e.showCalculator,n=e.isShippingCalculatorOpen,c=e.setIsShippingCalculatorOpen,a=e.shippingAddress;return React.createElement(React.Fragment,null,React.createElement(N,{address:a}),t&&React.createElement(x,{label:Object(l.__)("(change address)",'woocommerce'),isShippingCalculatorOpen:n,setIsShippingCalculatorOpen:c}))},P=function(e){var t=e.showCalculator,n=e.isShippingCalculatorOpen,c=e.setIsShippingCalculatorOpen;return t?React.createElement(x,{isShippingCalculatorOpen:n,setIsShippingCalculatorOpen:c}):React.createElement("em",null,Object(l.__)("Calculated during checkout",'woocommerce'))};t.a=function(e){var t=e.currency,n=e.values,c=e.showCalculator,o=void 0===c||c,s=e.showRateSelector,g=void 0===s||s,f=e.className,v=Object(p.useState)(!1),O=r()(v,2),R=O[0],_=O[1],w=Object(u.a)(),j=w.shippingAddress,E=w.cartHasCalculatedShipping,k=w.shippingRates,C=w.shippingRatesLoading,S=Object(b.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(n.total_shipping,10)+parseInt(n.total_shipping_tax,10):parseInt(n.total_shipping,10),N=k.some((function(e){return e.shipping_rates.length}))||S,x={isShippingCalculatorOpen:R,setIsShippingCalculatorOpen:_},T=k.flatMap((function(e){return e.shipping_rates.filter((function(e){return e.selected})).flatMap((function(e){return e.name}))}));return React.createElement("div",{className:i()("wc-block-components-totals-shipping",f)},React.createElement(d.TotalsItem,{label:Object(l.__)("Shipping",'woocommerce'),value:E?S:React.createElement(P,a()({showCalculator:o},x)),description:React.createElement(React.Fragment,null,E&&React.createElement(React.Fragment,null,React.createElement(m,{selectedShippingRates:T}),React.createElement(I,a()({shippingAddress:j,showCalculator:o},x)))),currency:t}),o&&R&&React.createElement(y,{onUpdate:function(){_(!1)}}),g&&E&&React.createElement(h,{hasRates:N,shippingRates:k,shippingRatesLoading:C}))}},401:function(e,t,n){"use strict";n.r(t);var c=n(23),a=n.n(c),o=n(1),r=n(332),s=n(333),i=n(336),l=n(334),p=n(26),u=n(58),d=n(32),b=n(214),m=n(2),g=n(175),f=["extensions"];t.default=function(e){var t=e.showRateAfterTaxName,n=void 0!==t&&t,c=e.isShippingCalculatorEnabled,h=void 0===c||c,v=Object(d.a)(),O=v.cartFees,R=v.cartTotals,_=v.cartNeedsShipping,w=Object(b.a)(),j=w.applyCoupon,E=w.removeCoupon,y=w.isApplyingCoupon,k=w.isRemovingCoupon,C=w.appliedCoupons,S=Object(u.getCurrencyFromPriceResponse)(R),N=Object(d.a)(),x=N.extensions,I=a()(N,f),P={extensions:x,cart:I},T={extensions:x,cart:I};return React.createElement(React.Fragment,null,React.createElement(g.a,{headingLevel:"2",className:"wc-block-cart__totals-title"},Object(o.__)("Cart totals",'woocommerce')),React.createElement(p.TotalsWrapper,null,React.createElement(p.Subtotal,{currency:S,values:R}),React.createElement(p.TotalsFees,{currency:S,cartFees:O}),React.createElement(r.a,{cartCoupons:C,currency:S,isRemovingCoupon:k,removeCoupon:E,values:R})),Object(m.getSetting)("couponsEnabled",!0)&&React.createElement(p.TotalsWrapper,null,React.createElement(s.a,{onSubmit:j,isLoading:y})),React.createElement(p.ExperimentalDiscountsMeta.Slot,T),_&&React.createElement(p.TotalsWrapper,null,React.createElement(i.a,{showCalculator:h,showRateSelector:!0,values:R,currency:S})),!Object(m.getSetting)("displayCartPricesIncludingTax",!1)&&parseInt(R.total_tax,10)>0&&React.createElement(p.TotalsWrapper,null,React.createElement(p.TotalsTaxes,{showRateAfterTaxName:n,currency:S,values:R})),React.createElement(p.TotalsWrapper,null,React.createElement(l.a,{currency:S,values:R})),React.createElement(p.ExperimentalOrderMeta.Slot,P))}},69:function(e,t,n){"use strict";var c=n(14),a=n.n(c),o=n(4),r=n.n(o),s=n(23),i=n.n(s),l=n(126),p=n(6),u=n.n(p),d=(n(147),["classN