31 lines
48 KiB
JavaScript
31 lines
48 KiB
JavaScript
|
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[38,4],{105:function(e,t,n){"use strict";var a=n(1),c=(n(10),n(6)),r=n.n(c),o=(n(181),n(138));t.a=function(e){var t=e.children,n=e.className,c=e.screenReaderLabel,i=e.showSpinner,s=void 0!==i&&i,l=e.isLoading,u=void 0===l||l;return React.createElement("div",{className:r()(n,{"wc-block-components-loading-mask":u})},u&&s&&React.createElement(o.a,null),React.createElement("div",{className:r()({"wc-block-components-loading-mask__children":u}),"aria-hidden":u},t),u&&React.createElement("span",{className:"screen-reader-text"},c||Object(a.__)("Loading…",'woocommerce')))}},106:function(e,t,n){"use strict";var a=n(6),c=n.n(a);n(184),t.a=function(e){var t=e.children,n=e.className;return React.createElement("div",{className:c()("wc-block-components-product-badge",n)},t)}},138:function(e,t,n){"use strict";n(180),t.a=function(){return React.createElement("span",{className:"wc-block-components-spinner","aria-hidden":"true"})}},140:function(e,t,n){"use strict";var a=n(4),c=n.n(a),r=n(1),o=n(69),i=n(6),s=n.n(i),l=(n(10),n(58)),u=n(0),p=(n(183),function(e){var t=e.currency,n=e.maxPrice,a=e.minPrice,c=e.priceClassName,i=e.priceStyle;return React.createElement(React.Fragment,null,React.createElement("span",{className:"screen-reader-text"},Object(r.sprintf)(
|
|||
|
/* translators: %1$s min price, %2$s max price */
|
|||
|
Object(r.__)("Price between %1$s and %2$s",'woocommerce'),Object(l.formatPrice)(a),Object(l.formatPrice)(n))),React.createElement("span",{"aria-hidden":!0},React.createElement(o.a,{className:s()("wc-block-components-product-price__value",c),currency:t,value:a,style:i})," — ",React.createElement(o.a,{className:s()("wc-block-components-product-price__value",c),currency:t,value:n,style:i})))}),d=function(e){var t=e.currency,n=e.regularPriceClassName,a=e.regularPriceStyle,c=e.regularPrice,i=e.priceClassName,l=e.priceStyle,u=e.price;return React.createElement(React.Fragment,null,React.createElement("span",{className:"screen-reader-text"},Object(r.__)("Previous price:",'woocommerce')),React.createElement(o.a,{currency:t,renderText:function(e){return React.createElement("del",{className:s()("wc-block-components-product-price__regular",n),style:a},e)},value:c}),React.createElement("span",{className:"screen-reader-text"},Object(r.__)("Discounted price:",'woocommerce')),React.createElement(o.a,{currency:t,renderText:function(e){return React.createElement("ins",{className:s()("wc-block-components-product-price__value","is-discounted",i),style:l},e)},value:u}))};t.a=function(e){var t=e.align,n=e.className,a=e.currency,r=e.format,i=void 0===r?"<price/>":r,l=e.maxPrice,m=void 0===l?null:l,b=e.minPrice,g=void 0===b?null:b,f=e.price,v=void 0===f?null:f,h=e.priceClassName,O=e.priceStyle,R=e.regularPrice,_=e.regularPriceClassName,E=e.regularPriceStyle,y=s()(n,"price","wc-block-components-product-price",c()({},"wc-block-components-product-price--align-".concat(t),t));i.includes("<price/>")||(i="<price/>",console.error("Price formats need to include the `<price/>` tag."));var j=R&&v!==R,k=React.createElement("span",{className:s()("wc-block-components-product-price__value",h)});return j?k=React.createElement(d,{currency:a,price:v,priceClassName:h,priceStyle:O,regularPrice:R,regularPriceClassName:_,regularPriceStyle:E}):null!==g&&null!==m?k=React.createElement(p,{currency:a,maxPrice:m,minPrice:g,priceClassName:h,priceStyle:O}):null!==v&&(k=React.createElement(o.a,{className:s()("wc-block-components-product-price__value",h),currency:a,value:v,style:O})),React.createElement("span",{className:y},Object(u.createInterpolateElement)(i,{price:k}))}},143:function(e,t,n){"use strict";var a=n(14),c=n.n(a),r=n(23),o=n.n(r),i=n(76),s=n(6),l=n.n(s),u=n(138),p=(n(251),["className","showSpinner","children"]);t.a=function(e){var t=e.className,n=e.showSpinner,a=void 0!==n&&n,r=e.children,s=o()(e,p),d=l()("wc-block-components-button",t,{"wc-block-components-button--loading":a});return React.createElement(i.a,c()({className:d},s),a&&React.createElement(u.a,null),React.createElement("span",{className:"wc-block-components-button__text"},r))}},147:function(e,t){},149:function(e,t){},150:function(e,t,n){"use strict";var a=n(14),c=n.n(a),r=n(23),o=n.n(r),i=n(28),s=n(6),l=n.n(s),u=(n(182),["className","disabled","name","permalink"]);t.a=function(e){var t=e.className,n=void 0===t?"":t,a=e.disabled,r=void 0!==a&&a,s=e.name,p=e.permalink,d=void 0===p?"":p,m=o()(e,u),b=l()("wc-block-components-product-name",n);return r?React.createElement("span",c()({className:b},m,{dangerouslySetInnerHTML:{__html:Object(i.decodeEntities)(s)}})):React.createElement("a",c()({className:b,href:d},m,{dangerouslySetInnerHTML:{__html:Object(i.decodeEntities)(s)}}))}},151:function(e,t,n){"use strict";var a=n(0),c=n(113),r=n(97),o=function(e){var t=e.indexOf("</p>");return-1===t?e:e.substr(0,t+4)},i=function(e){return e.replace(/<\/?[a-z][^>]*?>/gi,"")},s=function(e,t){return e.replace(/[\s|\.\,]+$/i,"")+t},l=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"…",a=i(e),c=a.split(" ").splice(0,t).join(" ");return Object(r.autop)(s(c,n))},u=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"…",c=i(e),o=c.slice(0,t);if(n)return Object(r.autop)(s(o,a));var l=o.match(/([\s]+)/g),u=l?l.length:0,p=c.slice(0,t+u);return Object(r.autop)(s(p,a))};t.a=function(e){var t=e.source,
|
|||
|
/* translators: Remove chip. */
|
|||
|
Object(l.__)("Remove",'woocommerce'):Object(l.sprintf)(
|
|||
|
/* translators: %s text of the chip to remove. */
|
|||
|
Object(l.__)('Remove "%s"','woocommerce'),j)}var k={"aria-label":n,disabled:d,onClick:f,onKeyDown:function(e){"Backspace"!==e.key&&"Delete"!==e.key||f()}},w=h?k:{},C=h?{"aria-hidden":!0}:k;return React.createElement(m,c()({},E,w,{className:s()(r,"is-removable"),element:h?"button":E.element,screenReaderText:_,text:O}),React.createElement(y,c()({className:"wc-block-components-chip__remove"},C),React.createElement(u.a,{className:"wc-block-components-chip__remove-icon",srcElement:p.a,size:16})))}},206:function(e,t){},207:function(e,t,n){"use strict";var a=n(6),c=n.n(a),r=n(24),o=n(179);n(252),t.a=Object(r.withInstanceId)((function(e){var t=e.className,n=e.instanceId,a=e.id,r=e.selected,i=e.onChange,s=e.options,l=void 0===s?[]:s,u=a||n;return l.length&&React.createElement("div",{className:c()("wc-block-components-radio-control",t)},l.map((function(e){return React.createElement(o.a,{key:"".concat(u,"-").concat(e.value),name:"radio-control-".concat(u),checked:e.value===r,option:e,onChange:function(t){i(t),"function"==typeof e.onChange&&e.onChange(t)}})})))}))},208:function(e,t){},209:function(e,t,n){"use strict";var a=n(23),c=n.n(a),r=n(1),o=n(0),i=n(33),s=n(105),l=n(26),u=n(326),p=n(32),d=n(36),m=n(6),b=n.n(m),g=n(28),f=n(51),v=n(5),h=n.n(v),O=n(25),R=n.n(O),_=n(118),E=n(52),y=function(e){var t;return null===(t=e.find((function(e){return e.selected})))||void 0===t?void 0:t.rate_id},j=n(207),k=n(174),w=n(58),C=n(69),N=n(2),S=function(e){var t=Object(N.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(w.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,a=e.onSelectRate,c=e.rates,r=e.renderOption,o=void 0===r?S:r,i=e.selected;if(0===c.length)return n;if(c.length>1)return React.createElement(j.a,{className:t,onChange:function(e){a(e)},selected:i,options:c.map(o)});var s=o(c[0]),l=s.label,u=s.secondaryLabel,p=s.description,d=s.secondaryDescription;return React.createElement(k.a,{label:l,secondaryLabel:u,description:p,secondaryDescription:d})},P=(n(253),function(e){var t=e.packageId,n=e.className,a=e.noResultsMessage,c=e.renderOption,i=e.packageData,s=e.collapsible,u=void 0!==s&&s,p=e.collapse,d=void 0!==p&&p,m=e.showItems,v=void 0!==m&&m,O=function(e,t){var n=Object(E.a)().dispatchCheckoutEvent,a=Object(_.a)(),c=a.selectShippingRate,r=a.isSelectingRate,i=Object(o.useState)((function(){return y(t)})),s=h()(i,2),l=s[0],u=s[1],p=Object(o.useRef)(t);return Object(o.useEffect)((function(){R()(p.current,t)||(p.current=t,u(y(t)))}),[t]),{selectShippingRate:Object(o.useCallback)((function(t){u(t),c(t,e),n("set-selected-shipping-rate",{shippingRateId:t})}),[e,c,n]),selectedShippingRate:l,isSelectingRate:r}}(t,i.shipping_rates),j=O.selectShippingRate,k=O.selectedShippingRate,w=React.createElement(React.Fragment,null,(v||u)&&React.createElement("div",{className:"wc-block-components-shipping-rates-control__package-title"},i.name),v&&React.createElement("ul",{className:"wc-block-components-shipping-rates-control__package-items"},Object.values(i.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(r.sprintf)(
|
|||
|
/* translators: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package */
|
|||
|
Object(r._n)("%1$s (%2$d unit)","%1$s (%2$d units)",n,'woocommerce'),t,n)}))})))),C=React.createElement(x,{className:n,noResultsMessage:a,rates:i.shipping_rates,onSelectRate:j,selected:k,renderOption:c});return u?React.createElement(l.Panel,{className:"wc-block-components-shipping-rates-control__package",initialOpen:!d,title:w},C):React.createElement("div",{className:b()("wc-block-components-shipping-rates-control__package",n)},w,C)}),I=["package_id"],L=["extensions","receiveCart"],D=function(e){var t=e.packages,n=e.collapse,a=e.showItems,r=e.collapsible,o=e.noResultsMessage,i=e.renderOption;return t.length?React.createElement(React.Fragment,null,t.map((function(e){var t=e.package_id,s=c()(e,I);return React.createElement(P,{key:t,packageId:t,packageData:s,collapsible:r,collapse:n,showItems:a,noResultsMessage:o,renderOption:i})}))):null};t.a=function(e){var t=e.shippingRates,n=e.shippingRatesLoading,a=e.className,m=e.collapsible,b=void 0!==m&&m,g=e.noResultsMessage,f=e.renderOption;Object(o.useEffect)((function(){if(!n){var e=Object(u.a)(t),a=Object(u.b)(t);1===e?Object(i.speak)(Object(r.sprintf)(
|
|||
|
/* translators: %d number of shipping options found. */
|
|||
|
Object(r._n)("%d shipping option was found.","%d shipping options were found.",a,'woocommerce'),a)):Object(i.speak)(Object(r.sprintf)(
|
|||
|
/* translators: %d number of shipping packages packages. */
|
|||
|
Object(r._n)("Shipping option searched for %d package.","Shipping options searched for %d packages.",e,'woocommerce'),e)+" "+Object(r.sprintf)(
|
|||
|
/* translators: %d number of shipping options available. */
|
|||
|
Object(r._n)("%d shipping option was found","%d shipping options were found",a,'woocommerce'),a))}}),[n,t]);var v=Object(p.a)(),h=v.extensions,O=(v.receiveCart,{className:a,collapsible:b,noResultsMessage:g,renderOption:f,extensions:h,cart:c()(v,L),components:{ShippingRatesControlPackage:P}}),R=Object(d.a)().isEditor;return React.createElement(s.a,{isLoading:n,screenReaderLabel:Object(r.__)("Loading shipping rates…",'woocommerce'),showSpinner:!0},R?React.createElement(D,{packages:t,noResultsMessage:g,renderOption:f}):React.createElement(React.Fragment,null,React.createElement(l.ExperimentalOrderShippingPackages.Slot,O),React.createElement(l.ExperimentalOrderShippingPackages,null,React.createElement(D,{packages:t,noResultsMessage:g,renderOption:f}))))}},214:function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var a=n(4),c=n.n(a),r=n(1),o=n(11),i=n(8),s=n(28),l=n(32),u=n(0),p=n(226);function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function m(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){c()(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 b=n(127),g=n(54);function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}var v=function(){var e=Object(l.a)(),t=e.cartCoupons,n=e.cartIsLoading,a=Object(g.a)().addErrorNotice,d=function(){var e=Object(p.b)(),t=e.notices,n=e.createSnackbarNotice,a=e.removeSnackbarNotice,c=e.setIsSuppressed,r=Object(u.useRef)(t);Object(u.useEffect)((function(){r.current=t}),[t]);var o=Object(u.useMemo)((function(){return{removeNotices:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;r.current.forEach((function(t){null!==e&&t.status!==e||a(t.id)}))},removeSnackbarNotice:a}}),[a]),i=Object(u.useMemo)((function(){return{addSnackbarNotice:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(e,t)}}}),[n]);return m(m(m({notices:t},o),i),{},{setIsSuppressed:c})}().addSnackbarNotice,v=Object(b.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){c()(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(o.useSelect)((function(e,t){var n=t.dispatch,c=e(i.CART_STORE_KEY),o=c.isApplyingCoupon(),l=c.isRemovingCoupon(),u=n(i.CART_STORE_KEY),p=u.applyCoupon,m=u.removeCoupon,b=u.receiveApplyingCoupon;return{applyCoupon:function(e){p(e).then((function(t){!0===t&&d(Object(r.sprintf)(
|
|||
|
/* translators: %s coupon code. */
|
|||
|
Object(r.__)('Coupon code "%s" has been applied to your cart.','woocommerce'),e),{id:"coupon-form"})})).catch((function(e){v({coupon:{message:Object(s.decodeEntities)(e.message),hidden:!1}}),b("")}))},removeCoupon:function(e){m(e).then((function(t){!0===t&&d(Object(r.sprintf)(
|
|||
|
/* translators: %s coupon code. */
|
|||
|
Object(r.__)('Coupon code "%s" has been removed from your cart.','woocommerce'),e),{id:"coupon-form"})})).catch((function(e){a(e.message,{id:"coupon-form"}),b("")}))},isApplyingCoupon:o,isRemovingCoupon:l}}),[a,d]))}},216:function(e,t,n){"use strict";var a=n(14),c=n.n(a),r=n(23),o=n.n(r),i=n(34),s=["className","size"],l=function(e){var t=e.className,n=e.size,a=o()(e,s);return React.createElement(i.SVG,c()({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:n,height:n},a),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"}))},u=React.createElement(l,null);t.a=u},250:function(e,t){},251:function(e,t){},252:function(e,t){},253:function(e,t){},256:function(e,t){},257:function(e,t){},258:function(e,t,n){"use strict";n.d(t,"a",(function(){return c})),n(10);var a=n(127),c=(n(250),function(e){var t=e.errorMessage,n=void 0===t?"":t,c=e.propertyName,r=void 0===c?"":c,o=e.elementId,i=void 0===o?"":o,s=Object(a.b)(),l=s.getValidationError,u=s.getValidationErrorId;if(!n||"string"!=typeof n){var p=l(r)||{};if(!p.message||p.hidden)return null;n=p.message}return React.createElement("div",{className:"wc-block-components-validation-error",role:"alert"},React.createElement("p",{id:u(i)},n))})},259:function(e,t){},260:function(e,t){},261:function(e,t){},262:function(e,t){},263:function(e,t){},266:function(e,t,n){"use strict";var a=n(14),c=n.n(a),r=n(28),o=n(2);t.a=function(e){var t=e.image,n=void 0===t?{}:t,a={src:n.thumbnail||o.PLACEHOLDER_IMG_SRC,alt:Object(r.decodeEntities)(n.alt)||""};return React.createElement("img",c()({},a,{alt:a.alt}))}},267:function(e,t,n){"use strict";var a=n(1),c=n(106);t.a=function(){return React.createElement(c.a,{className:"wc-block-components-product-backorder-badge"},Object(a.__)("Available on backorder",'woocommerce'))}},268:function(e,t,n){"use strict";var a=n(1),c=n(106);t.a=function(e){var t=e.lowStockRemaining;return t?React.createElement(c.a,{className:"wc-block-components-product-low-stock-badge"},Object(a.sprintf)(
|
|||
|
/* translators: %d stock amount (number of items in stock for product) */
|
|||
|
Object(a.__)("%d left in stock",'woocommerce'),t)):null}},269:function(e,t,n){"use strict";var a=n(7),c=n(28),r=(n(186),function(e){var t=e.details,n=void 0===t?[]:t;return Array.isArray(n)?0===(n=n.filter((function(e){return!e.hidden}))).length?null:React.createElement("ul",{className:"wc-block-components-product-details"},n.map((function(e){var t=e.name?"wc-block-components-product-details__".concat(Object(a.kebabCase)(e.name)):"";return React.createElement("li",{key:e.name+(e.display||e.value),className:t},e.name&&React.createElement(React.Fragment,null,React.createElement("span",{className:"wc-block-components-product-details__name"},Object(c.decodeEntities)(e.name),":")," "),React.createElement("span",{className:"wc-block-components-product-details__value"},Object(c.decodeEntities)(e.display||e.value)))}))):null}),o=n(151),i=n(83),s=function(e){var t=e.className,n=e.shortDescription,a=void 0===n?"":n,c=e.fullDescription,r=a||(void 0===c?"":c);return r?React.createElement(o.a,{className:t,source:r,maxLength:15,countType:i.n.wordCountType||"words"}):null};n(185),t.a=function(e){var t=e.shortDescription,n=void 0===t?"":t,a=e.fullDescription,c=void 0===a?"":a,o=e.itemData,i=void 0===o?[]:o,l=e.variation,u=void 0===l?[]:l;return React.createElement("div",{className:"wc-block-components-product-metadata"},React.createElement(s,{className:"wc-block-components-product-metadata__description",shortDescription:n,fullDescription:c}),React.createElement(r,{details:i}),React.createElement(r,{details:u.map((function(e){var t=e.attribute;return{name:void 0===t?"":t,value:e.value}}))}))}},276:function(e,t,n){"use strict";var a=n(14),c=n.n(a),r=n(4),o=n.n(r),i=n(5),s=n.n(i),l=n(23),u=n.n(l),p=n(1),d=n(3),m=n(6),b=n.n(m),g=n(127),f=n(48),v=n(258),h=n(24),O=n(49),R=n(0),_=n(51),E=(n(206),["className","id","type","ariaLabel","ariaDescribedBy","label","screenReaderLabel","disabled","help","autoCapitalize","autoComplete","value","onChange","required","onBlur","feedback"]),y=Object(d.forwardRef)((function(e,t){var n=e.className,a=e.id,r=e.type,o=void 0===r?"text":r,i=e.ariaLabel,l=e.ariaDescribedBy,p=e.label,d=e.screenReaderLabel,m=e.disabled,g=e.help,f=e.autoCapitalize,v=void 0===f?"off":f,h=e.autoComplete,O=void 0===h?"off":h,y=e.value,j=void 0===y?"":y,k=e.onChange,w=e.required,C=void 0!==w&&w,N=e.onBlur,S=void 0===N?function(){}:N,x=e.feedback,P=u()(e,E),I=Object(R.useState)(!1),L=s()(I,2),D=L[0],M=L[1];return React.createElement("div",{className:b()("wc-block-components-text-input",n,{"is-active":D||j})},React.createElement("input",c()({type:o,id:a,value:j,ref:t,autoCapitalize:v,autoComplete:O,onChange:function(e){k(e.target.value)},onFocus:function(){return M(!0)},onBlur:function(e){S(e.target.value),M(!1)},"aria-label":i||p,disabled:m,"aria-describedby":g&&!l?a+"__help":l,required:C},P)),React.createElement(_.a,{label:p,screenReaderLabel:d||p,wrapperElement:"label",wrapperProps:{htmlFor:a},htmlFor:a}),!!g&&React.createElement("p",{id:a+"__help",className:"wc-block-components-text-input__help"},g),x)})),j=["className","instanceId","id","ariaDescribedBy","errorId","validateOnMount","focusOnMount","onChange","showError","errorMessage"];t.a=Object(h.withInstanceId)((function(e){var t=e.className,n=e.instanceId,a=e.id,r=e.ariaDescribedBy,i=e.errorId,l=e.validateOnMount,m=void 0===l||l,h=e.focusOnMount,R=void 0!==h&&h,_=e.onChange,E=e.showError,k=void 0===E||E,w=e.errorMessage,C=void 0===w?"":w,N=u()(e,j),S=Object(d.useState)(!0),x=s()(S,2),P=x[0],I=x[1],L=Object(d.useRef)(null),D=Object(g.b)(),M=D.getValidationError,T=D.hideValidationError,F=D.setValidationErrors,A=D.clearValidationError,V=D.getValidationErrorId,U=Object(f.b)().isBeforeProcessing,q=void 0!==a?a:"textinput-"+n,B=void 0!==i?i:q,$=Object(d.useCallback)((function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=L.current||null;if(t){t.value=t.value.trim();var n=t.checkValidity();n?A(B):F(o()({},B,{message:t.validationMessage||Object(p.__)("Invalid value.",'woocommerce'),hidden:e}))}}),[A,B,F]);Object(d.useEffect)((function(){var e;P&&(R&&(null===(e=L.cur
|
|||
|
/* translators: %s Coupon code. */
|
|||
|
Object(a.__)("Coupon: %s",'woocommerce'),e.label),disabled:u,onRemove:function(){p(e.code)},radius:"large",ariaLabel:Object(a.sprintf)(
|
|||
|
/* translators: %s is a coupon code. */
|
|||
|
Object(a.__)('Remove coupon "%s"','woocommerce'),e.label)})})))),label:v?Object(a.__)("Discount",'woocommerce'):Object(a.__)("Coupons",'woocommerce'),value:v?-1*v:"-"})}},333:function(e,t,n){"use strict";var a=n(5),c=n.n(a),r=n(1),o=n(0),i=n(143),s=n(276),l=n(51),u=n(105),p=(n(10),n(24)),d=n(127),m=n(258),b=n(26);n(257),t.a=Object(p.withInstanceId)((function(e){var t=e.instanceId,n=e.isLoading,a=void 0!==n&&n,p=e.initialOpen,g=void 0!==p&&p,f=e.onSubmit,v=void 0===f?function(){}:f,h=Object(o.useState)(""),O=c()(h,2),R=O[0],_=O[1],E=Object(o.useRef)(!1),y=Object(d.b)(),j=y.getValidationError,k=y.getValidationErrorId,w=j("coupon");Object(o.useEffect)((function(){E.current!==a&&(a||!R||w||_(""),E.current=a)}),[a,R,w]);var C="wc-block-components-totals-coupon__input-".concat(t);return React.createElement(b.Panel,{className:"wc-block-components-totals-coupon",hasBorder:!1,initialOpen:g,title:React.createElement(l.a,{label:Object(r.__)("Coupon code",'woocommerce'),screenReaderLabel:Object(r.__)("Apply a coupon code",'woocommerce'),htmlFor:C})},React.createElement(u.a,{screenReaderLabel:Object(r.__)("Applying coupon…",'woocommerce'),isLoading:a,showSpinner:!1},React.createElement("div",{className:"wc-block-components-totals-coupon__content"},React.createElement("form",{className:"wc-block-components-totals-coupon__form"},React.createElement(s.a,{id:C,errorId:"coupon",className:"wc-block-components-totals-coupon__input",label:Object(r.__)("Enter code",'woocommerce'),value:R,ariaDescribedBy:k(C),onChange:function(e){_(e)},validateOnMount:!1,focusOnMount:!0,showError:!1}),React.createElement(i.a,{className:"wc-block-components-totals-coupon__button",disabled:a||!R,showSpinner:a,onClick:function(e){e.preventDefault(),v(R)},type:"submit"},Object(r.__)("Apply",'woocommerce'))),React.createElement(m.a,{propertyName:"coupon",elementId:C}))))}))},334:function(e,t,n){"use strict";var a=n(23),c=n.n(a),r=n(1),o=n(0),i=n(69),s=(n(10),n(26)),l=n(32),u=n(2),p=(n(263),["receiveCart"]);t.a=function(e){var t=e.currency,n=e.values,a=Object(u.getSetting)("taxesEnabled",!0)&&Object(u.getSetting)("displayCartPricesIncludingTax",!1),d=n.total_price,m=n.total_tax,b=Object(l.a)(),g=(b.receiveCart,c()(b,p)),f=Object(s.__experimentalApplyCheckoutFilter)({filterName:"totalLabel",defaultValue:Object(r.__)("Total",'woocommerce'),extensions:g.extensions,arg:{cart:g}}),v=parseInt(m,10);return React.createElement(s.TotalsItem,{className:"wc-block-components-totals-footer-item",currency:t,label:f,value:parseInt(d,10),description:a&&0!==v&&React.createElement("p",{className:"wc-block-components-totals-footer-item-tax"},Object(o.createInterpolateElement)(Object(r.__)("Including <TaxAmount/> in taxes",'woocommerce'),{TaxAmount:React.createElement(i.a,{className:"wc-block-components-totals-footer-item-tax-value",currency:t,value:v})}))})}},335:function(e,t,n){"use strict";var a=n(4),c=n.n(a),r=n(276),o=n(14),i=n.n(o),s=n(83),l=n(0),u=n(1),p=n(28),d=n(6),m=n.n(d),b=n(24),g=n(340),f=n(127),v=n(258),h=n(49),O=(n(261),Object(b.withInstanceId)((function(e){var t=e.id,n=e.className,a=e.label,r=e.onChange,o=e.options,i=e.value,s=e.required,p=void 0!==s&&s,d=e.errorMessage,b=void 0===d?Object(u.__)("Please select a value.",'woocommerce'):d,O=e.errorId,R=e.instanceId,_=void 0===R?"0":R,E=e.autoComplete,y=void 0===E?"off":E,j=Object(f.b)(),k=j.getValidationError,w=j.setValidationErrors,C=j.clearValidationError,N=Object(l.useRef)(null),S=t||"control-"+_,x=O||S,P=k(x)||{message:"",hidden:!1};return Object(l.useEffect)((function(){return!p||i?C(x):w(c()({},x,{message:b,hidden:!0})),function(){C(x)}}),[C,i,x,b,p,w]),React.createElement("div",{id:S,className:m()("wc-block-components-combobox",n,{"is-active":i,"has-error":P.message&&!P.hidden}),ref:N},React.createElement(g.a,{className:"wc-block-components-combobox-control",label:a,onChange:r,onFilterValueChange:function(e){if(e.length){var t=Object(h.b)(N.current)?N.current.ownerDocument.activeElement:void 0;if(t&&Object(h.b)(N.current)&&N.current.contains(t))return;var n=e.toLocaleUpperCase(),a=o.find((function(e){return e.la
|
|||
|
/* translators: %s location. */
|
|||
|
Object(l.__)("Shipping to %s",'woocommerce'),i)+" "):null},x=(n(259),function(e){var t=e.label,n=void 0===t?Object(l.__)("Calculate",'woocommerce'):t,a=e.isShippingCalculatorOpen,c=e.setIsShippingCalculatorOpen;return React.createElement("button",{className:"wc-block-components-totals-shipping__change-address-button",onClick:function(){c(!a)},"aria-expanded":a},n)}),P=function(e){var t=e.showCalculator,n=e.isShippingCalculatorOpen,a=e.setIsShippingCalculatorOpen,c=e.shippingAddress;return React.createElement(React.Fragment,null,React.createElement(S,{address:c}),t&&React.createElement(x,{label:Object(l.__)("(change address)",'woocommerce'),isShippingCalculatorOpen:n,setIsShippingCalculatorOpen:a}))},I=function(e){var t=e.showCalculator,n=e.isShippingCalculatorOpen,a=e.setIsShippingCalculatorOpen;return t?React.createElement(x,{isShippingCalculatorOpen:n,setIsShippingCalculatorOpen:a}):React.createElement("em",null,Object(l.__)("Calculated during checkout",'woocommerce'))};t.a=function(e){var t=e.currency,n=e.values,a=e.showCalculator,r=void 0===a||a,i=e.showRateSelector,g=void 0===i||i,f=e.className,h=Object(u.useState)(!1),O=o()(h,2),R=O[0],_=O[1],E=Object(p.a)(),y=E.shippingAddress,j=E.cartHasCalculatedShipping,w=E.shippingRates,C=E.shippingRatesLoading,N=Object(m.getSetting)("displayCartPricesIncludingTax",!1)?parseInt(n.total_shipping,10)+parseInt(n.total_shipping_tax,10):parseInt(n.total_shipping,10),S=w.some((function(e){return e.shipping_rates.length}))||N,x={isShippingCalculatorOpen:R,setIsShippingCalculatorOpen:_},L=w.flatMap((function(e){return e.shipping_rates.filter((function(e){return e.selected})).flatMap((function(e){return e.name}))}));return React.createElement("div",{className:s()("wc-block-components-totals-shipping",f)},React.createElement(d.TotalsItem,{label:Object(l.__)("Shipping",'woocommerce'),value:j?N:React.createElement(I,c()({showCalculator:r},x)),description:React.createElement(React.Fragment,null,j&&React.createElement(React.Fragment,null,React.createElement(b,{selectedShippingRates:L}),React.createElement(P,c()({shippingAddress:y,showCalculator:r},x)))),currency:t}),r&&R&&React.createElement(k,{onUpdate:function(){_(!1)}}),g&&j&&React.createElement(v,{hasRates:S,shippingRates:w,shippingRatesLoading:C}))}},383:function(e,t){},413:function(e,t,n){"use strict";n.r(t);var a=n(23),c=n.n(a),r=n(1),o=(n(10),n(201)),i=n(26),s=n(51),l=n(140),u=n(150),p=n(58),d=n(125),m=n(2),b=n(0),g=n(32),f=n(267),v=n(266),h=n(268),O=n(269),R=["receiveCart"],_=function(e){return Object(i.mustContain)(e,"<price/>")},E=function(e){var t=e.cartItem,n=t.images,a=t.low_stock_remaining,o=t.show_backorder_badge,E=t.name,y=t.permalink,j=t.prices,k=t.quantity,w=t.short_description,C=t.description,N=t.item_data,S=t.variation,x=t.totals,P=t.extensions,I=Object(g.a)(),L=(I.receiveCart,c()(I,R)),D=Object(b.useMemo)((function(){return{context:"summary",cartItem:t,cart:L}}),[t,L]),M=Object(p.getCurrencyFromPriceResponse)(j),T=Object(i.__experimentalApplyCheckoutFilter)({filterName:"itemName",defaultValue:E,extensions:P,arg:D}),F=Object(d.a)({amount:parseInt(j.raw_prices.regular_price,10),precision:parseInt(j.raw_prices.precision,10)}).convertPrecision(M.minorUnit).getAmount(),A=Object(d.a)({amount:parseInt(j.raw_prices.price,10),precision:parseInt(j.raw_prices.precision,10)}).convertPrecision(M.minorUnit).getAmount(),V=Object(p.getCurrencyFromPriceResponse)(x),U=parseInt(x.line_subtotal,10);Object(m.getSetting)("displayCartPricesIncludingTax",!1)&&(U+=parseInt(x.line_subtotal_tax,10));var q=Object(d.a)({amount:U,precision:V.minorUnit}).getAmount(),B=Object(i.__experimentalApplyCheckoutFilter)({filterName:"subtotalPriceFormat",defaultValue:"<price/>",extensions:P,arg:D,validation:_}),$=Object(i.__experimentalApplyCheckoutFilter)({filterName:"cartItemPrice",defaultValue:"<price/>",extensions:P,arg:D,validation:_});return React.createElement("div",{className:"wc-block-components-order-summary-item"},React.createElement("div",{className:"wc-block-components-order-summary-item__image"},React.createElement("div",{className:"wc-block-co
|
|||
|
/* translators: %d number of products of the same type in the cart */
|
|||
|
Object(r._n)("%d item","%d items",k,'woocommerce'),k)})),React.createElement(v.a,{image:n.length?n[0]:{}})),React.createElement("div",{className:"wc-block-components-order-summary-item__description"},React.createElement(u.a,{disabled:!0,name:T,permalink:y}),React.createElement(l.a,{currency:M,price:A,regularPrice:F,className:"wc-block-components-order-summary-item__individual-prices",priceClassName:"wc-block-components-order-summary-item__individual-price",regularPriceClassName:"wc-block-components-order-summary-item__regular-individual-price",format:B}),o?React.createElement(f.a,null):!!a&&React.createElement(h.a,{lowStockRemaining:a}),React.createElement(O.a,{shortDescription:w,fullDescription:C,itemData:N,variation:S})),React.createElement("span",{className:"screen-reader-text"},Object(r.sprintf)(
|
|||
|
/* translators: %1$d is the number of items, %2$s is the item name and %3$s is the total price including the currency symbol. */
|
|||
|
Object(r._n)("Total price for %1$d %2$s item: %3$s","Total price for %1$d %2$s items: %3$s",k,'woocommerce'),k,T,Object(p.formatPrice)(q,V))),React.createElement("div",{className:"wc-block-components-order-summary-item__total-price","aria-hidden":"true"},React.createElement(l.a,{currency:V,format:$,price:q})))},y=(n(383),function(e){var t=e.cartItems,n=void 0===t?[]:t,a=Object(o.b)(),c=a.isLarge;return a.hasContainerWidth?React.createElement(i.Panel,{className:"wc-block-components-order-summary",initialOpen:c,hasBorder:!1,title:React.createElement("span",{className:"wc-block-components-order-summary__button-text"},Object(r.__)("Order summary",'woocommerce')),titleTag:"h2"},React.createElement("div",{className:"wc-block-components-order-summary__content"},n.map((function(e){return React.createElement(E,{key:e.key,cartItem:e})})))):null}),j=n(332),k=n(333),w=n(336),C=n(334),N=n(66),S=n(214),x=["extensions","receiveCart"];t.default=function(e){var t=e.showRateAfterTaxName,n=void 0!==t&&t,a=Object(g.a)(),r=a.cartItems,o=a.cartTotals,s=a.cartCoupons,l=a.cartFees,u=Object(S.a)(),d=u.applyCoupon,b=u.removeCoupon,f=u.isApplyingCoupon,v=u.isRemovingCoupon,h=Object(N.b)().needsShipping,O=Object(p.getCurrencyFromPriceResponse)(o),R=Object(g.a)(),_=R.extensions,E=(R.receiveCart,{extensions:_,cart:c()(R,x)});return React.createElement(React.Fragment,null,React.createElement(i.TotalsWrapper,null,React.createElement(y,{cartItems:r})),React.createElement(i.TotalsWrapper,null,React.createElement(i.Subtotal,{currency:O,values:o}),React.createElement(i.TotalsFees,{currency:O,cartFees:l}),React.createElement(j.a,{cartCoupons:s,currency:O,isRemovingCoupon:v,removeCoupon:b,values:o})),Object(m.getSetting)("couponsEnabled",!0)&&React.createElement(i.TotalsWrapper,null,React.createElement(k.a,{onSubmit:d,initialOpen:!1,isLoading:f})),h&&React.createElement(i.TotalsWrapper,null,React.createElement(w.a,{showCalculator:!1,showRateSelector:!1,values:o,currency:O})),!Object(m.getSetting)("displayCartPricesIncludingTax",!1)&&parseInt(o.total_tax,10)>0&&React.createElement(i.TotalsWrapper,null,React.createElement(i.TotalsTaxes,{currency:O,showRateAfterTaxName:n,values:o})),React.createElement(i.TotalsWrapper,null,React.createElement(C.a,{currency:O,values:o})),React.createElement(i.ExperimentalOrderMeta.Slot,E))}},51:function(e,t,n){"use strict";var a=n(4),c=n.n(a),r=n(0),o=n(6),i=n.n(o);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){c()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}t.a=function(e){var t,n=e.label,a=e.screenReaderLabel,c=e.wrapperElement,o=e.wrapperProps,s=void 0===o?{}:o,u=null!=n,p=null!=a;return!u&&p?(t=c||"span",s=l(l({},s),{},{className:i()(s.className,"screen-reader-text")}),React.createElement(t,s,a)):(t=c||r.Fragment,u&&p&&n!==a?React.createElement(t,s,React.createElement("span",{"aria-hidden":"true"},n),React.createElement("span",{className:"screen-reader-text"},a)):React.createElement(t,s,n))}},69:function(e,t,n){"use strict";var a=n(14),c=n.n(a),r=n(4),o=n.n(r),i=n(23),s=n.n(i),l=n(126),u=n(6),p=n.n(u),d=(n(147),["className","value","currency","onValueChange","displayType"]);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEac
|