woocommerce/packages/woocommerce-blocks/build/atomic-block-components/add-to-cart--atomic-block-components/button--atomic-block-components/image---a7e2bb9b.js

3 lines
8.6 KiB
JavaScript
Raw Normal View History

2021-12-10 12:03:04 +00:00
(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[1],{113:function(t,e,r){"use strict";var n=r(5),c=r.n(n),i=r(8),o=r.n(i),a=r(3),s=r(1),u=r(72);function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function d(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(Object(r),!0).forEach((function(e){c()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var l=Object(a.getSetting)("countryLocale",{}),f=function(t){var e={};return void 0!==t.label&&(e.label=t.label),void 0!==t.required&&(e.required=t.required),void 0!==t.hidden&&(e.hidden=t.hidden),void 0===t.label||t.optionalLabel||(e.optionalLabel=Object(s.sprintf)(
/* translators: %s Field label. */
Object(s.__)("%s (optional)",'woocommerce'),t.label)),t.priority&&(Object(u.a)(t.priority)&&(e.index=t.priority),Object(u.c)(t.priority)&&(e.index=parseInt(t.priority,10))),t.hidden&&(e.required=!1),e},b=Object.entries(l).map((function(t){var e=o()(t,2),r=e[0],n=e[1];return[r,Object.entries(n).map((function(t){var e=o()(t,2),r=e[0],n=e[1];return[r,f(n)]})).reduce((function(t,e){var r=o()(e,2),n=r[0],c=r[1];return t[n]=c,t}),{})]})).reduce((function(t,e){var r=o()(e,2),n=r[0],c=r[1];return t[n]=c,t}),{});e.a=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=r&&void 0!==b[r]?b[r]:{};return t.map((function(t){var r=a.defaultAddressFields[t]||{},c=n[t]||{},i=e[t]||{};return d(d(d({key:t},r),c),i)})).sort((function(t,e){return t.index-e.index}))}},142:function(t,e,r){"use strict";r.d(e,"a",(function(){return i}));var n=r(8),c=r.n(n),i=function(t){return t.reduce((function(t,e){var r=c()(e,2),n=r[0],i=r[1];return t[n]=i,t}),{})}},162:function(t,e,r){"use strict";r.d(e,"b",(function(){return o})),r.d(e,"c",(function(){return a})),r.d(e,"a",(function(){return s}));var n=r(3),c=r(113),i=r(23),o=function(t){var e=t.country,r=void 0===e?"":e,n=t.state,c=void 0===n?"":n,i=t.city,o=void 0===i?"":i,a=t.postcode,s=void 0===a?"":a;return{country:r.trim(),state:c.trim(),city:o.trim(),postcode:s?s.replace(" ","").toUpperCase():""}},a=function(t){var e=t.email,r=void 0===e?"":e;return Object(i.isEmail)(r)?r.trim():""},s=function(t){var e=Object.keys(n.defaultAddressFields),r=Object(c.a)(e,{},t.country),i=Object.assign({},t);return r.forEach((function(e){var r=e.key,n=void 0===r?"":r,c=e.hidden;void 0!==c&&c&&function(t,e){return t in e}(n,t)&&(i[n]="")})),i}},43:function(t,e,r){"use strict";r.d(e,"a",(function(){return j}));var n=r(8),c=r.n(n),i=r(5),o=r.n(i),a=r(7),s=r(0),u=r(24),p=r(14),d=r(25),l=r(142),f=r(162),b=r(63);function O(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function g(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?O(Object(r),!0).forEach((function(e){o()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var v={first_name:"",last_name:"",company:"",address_1:"",address_2:"",city:"",state:"",postcode:"",country:"",phone:""},_=g(g({},v),{},{email:""}),y={total_items:"",total_items_tax:"",total_fees:"",total_fees_tax:"",total_discount:"",total_discount_tax:"",total_shipping:"",total_shipping_tax:"",total_price:"",total_tax:"",tax_lines:u.EMPTY_TAX_LINES,currency_code:"",currency_symbol:"",currency_minor_unit:2,currency_decimal_separator:"",currency_thousand_separator:"",currency_prefix:"",currency_suffix:""},m=function(t){return Object(l.a)(Object.entries(t).map((function(t){var e=c()(t,2),r=e[0],n=e[1];return[r,Object(d.decodeEntities)(n)]})))},h={cartCoupons:u.EMPTY_CART_COUPONS,cartItems:u.EMPTY_CART_ITEMS,cartFees:u.EMPTY_CART_FEES,cartItemsCount:0,cartItemsWeight:0,cartNeedsPayment:!0,cartNeedsShipping:!0,cartItemErrors:u.EMPTY_CART_ITEM_ERRORS,cartTotals:y,cartIsLoading:!0,cartErrors:u.EMPTY_CART_ERRORS,billingAddress:_,shippingAddress:v,shippingRates:u.EMPTY_SHIPPING_RATES,shippingRatesLoading:!1,cartHasCalculatedShipping:!1,paymentRequirements:u.EMPTY_PAYMENT_REQUIREMENTS,receiveCart:function(){},extensions:u.EMPTY_EXTENSIONS},j=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{shouldSelect:!0},e=Object(b.b)(),r=e.isEditor,n=e.previewData,c=null==n?void 0:n.previewCart,i=t.shouldSelect,o=Object(s.useRef)(),d=Object(p.useSelect)((function(t,e){var n=e.dispatch;if(!i)return h;if(r)return{cartCoupons:c.coupons,cartItems:c.items,cartFees:c.fees,cartItemsCount:c.items_count,cartItemsWeight:c.items_weight,cartNeedsPayment:c.needs_payment,cartNeedsShipping:c.needs_shipping,cartItemErrors:u.EMPTY_CART_ITEM