(window.webpackWcBlocksJsonp=window.webpackWcBlocksJsonp||[]).push([[8],{510:function(t,c,e){"use strict";e.r(c);var o=e(10),n=e.n(o),a=e(7),r=e.n(a),u=e(0),b=(e(2),e(8)),d=e.n(b),l=e(1),i=e(822),s=e(33),p=e(511),_=e(42),k=e(71),j=(e(532),function(t){var c=t.product,e=Object(u.useRef)(!0),o=c.id,a=c.permalink,r=c.add_to_cart,b=c.has_options,_=c.is_purchasable,k=c.is_in_stock,j=Object(i.a)(o),w=j.cartQuantity,O=j.addingToCart,m=j.addToCart;Object(u.useEffect)((function(){e.current?e.current=!1:Object(p.b)()}),[w]);var f=Number.isFinite(w)&&w>0,E=!b&&_&&k,v=Object(s.decodeEntities)((null==r?void 0:r.description)||""),C=f?Object(l.sprintf)(Object(l._n)("%d in cart","%d in cart",w,'woocommerce'),w):Object(s.decodeEntities)((null==r?void 0:r.text)||Object(l.__)("Add to cart",'woocommerce')),g=E?"button":"a",h={};return E?h.onClick=function(){m()}:(h.href=a,h.rel="nofollow"),Object(u.createElement)(g,n()({"aria-label":v,className:d()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button",{loading:O,added:f}),disabled:O},h),C)}),w=function(){return Object(u.createElement)("button",{className:d()("wp-block-button__link","add_to_cart_button","wc-block-components-product-button__button","wc-block-components-product-button__button--placeholder"),disabled:!0})};c.default=Object(k.withProductDataContext)((function(t){var c=t.className,e=Object(_.useInnerBlockLayoutContext)().parentClassName,o=Object(_.useProductDataContext)().product;return Object(u.createElement)("div",{className:d()(c,"wp-block-button","wc-block-components-product-button",r()({},"".concat(e,"__product-add-to-cart"),e))},o.id?Object(u.createElement)(j,{product:o}):Object(u.createElement)(w,null))}))},532:function(t,c){}}]);
