(window.webpackJsonpvtex_add_to_cart_button_0_30_2=window.webpackJsonpvtex_add_to_cart_button_0_30_2||[]).push([["Wrapper"],[function(e,t){e.exports=React},,function(e,t){e.exports=ReactIntl},function(e,t,n){"use strict";function i(e,t){var n;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,a=!0,u=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,l=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw l}}}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=k&&P>0&&v.push({normalizedQuantity:P,extraQuantity:P-k,choiceType:x.choiceType,item:Object.assign({name:x.name,sellingPrice:x.price,quantity:P,sellingPriceWithAssemblies:x.price+o(null!==(t=x.children)&&void 0!==t?t:{}),id:x.id},N?{assemblyOptions:N}:{})}),P0?{options:g}:{}))}}catch(e){O.e(e)}finally{O.f()}}var I,R=i(f);try{for(R.s();!(I=R.n()).done;){var T=I.value,S=u[T]||{};Object.keys(S).length>0&&d.push({assemblyId:T,inputValues:u[T]})}}catch(e){R.e(e)}finally{R.f()}return{options:d,assemblyOptions:{added:v,removed:p,parentPrice:s}}}function a(e){var t,n,i,r,a,u,s=e.product,c=e.selectedItem,d=e.selectedQuantity,v=e.selectedSeller,p=e.assemblyOptions;return s&&c&&v&&v.commertialOffer?[Object.assign(Object.assign({index:0,id:c.itemId,ean:c.ean,productId:null!==(t=s.productId)&&void 0!==t?t:"",quantity:d,uniqueId:"",detailUrl:"/".concat(s.linkText,"/p"),name:null!==(n=s.productName)&&void 0!==n?n:"",brand:null!==(i=s.brand)&&void 0!==i?i:"",category:s.categories&&s.categories.length>0?s.categories[0]:"",productRefId:null!==(r=s.productReference)&&void 0!==r?r:"",seller:v.sellerId,sellerName:v.sellerName,variant:c.name,skuName:c.name,price:100*v.commertialOffer.PriceWithoutDiscount,listPrice:100*v.commertialOffer.ListPrice,sellingPrice:100*v.commertialOffer.Price,sellingPriceWithAssemblies:100*(v.commertialOffer.Price+o(null!==(a=null==p?void 0:p.items)&&void 0!==a?a:{})),measurementUnit:c.measurementUnit,skuSpecifications:[],imageUrl:null===(u=c.images[0])||void 0===u?void 0:u.imageUrl},l({assemblyOptionsItems:null==p?void 0:p.items,inputValues:null==p?void 0:p.inputValues,parentPrice:v.commertialOffer.Price,parentQuantity:d})),{referenceId:c.referenceId})]:[]}n.d(t,"a",(function(){return a}))},,,function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Button"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Tooltip"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.checkout-resources@0.x/Utils"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@0.x/useCssHandles"]},function(e,t){e.exports=__RENDER_8_RUNTIME__},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.pixel-manager@1.x/usePixel"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/useProductDispatch"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-resources@0.x/PWAContext"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.order-items@0.x/OrderItems"]},,,function(e,t){e.exports=regeneratorRuntime},,function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.product-context@0.x/useProduct"]},function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/withToast"]},,function(e,t,n){"use strict";n.r(t),function(e){var t=n(1);n.p=Object(t.getPublicPath)("vtex.add-to-cart-button@0.30.2");var i=Object(t.register)((function(){return n(23)}),e,"vtex.add-to-cart-button@0.30.2","vtex.add-to-cart-button@0.x","Wrapper");i.renderHotReload,i.setupHMR}.call(this,n(5)(e))},function(e,t,n){"use strict";n.r(t);var i=n(0),r=n.n(i),o=n(19),l=n.n(o),a=n(20),u=n.n(a),s=n(15),c=n(3);var d=u()((function(e){var t,n,o,a,u=e.isOneClickBuy,d=e.available,v=e.disabled,p=e.customToastUrl,f=e.showToast,m=e.customOneClickBuyLink,_=e.selectedSeller,y=e.unavailableText,b=e.text,O=e.customPixelEventId,x=e.addToCartFeedback,h=void 0===x?"toast":x,E=e.onClickBehavior,g=void 0===E?"add-to-cart":E,N=e.onClickEventPropagation,P=void 0===N?"disabled":N,k=l()(),I=0===Object.keys(null!=k?k:{}).length,R=null==k?void 0:k.product,T=(null!==(n=null===(t=null==R?void 0:R.items)||void 0===t?void 0:t.length)&&void 0!==n?n:0)>1,S=null==k?void 0:k.selectedItem,C=null==k?void 0:k.assemblyOptions,j=null!=_?_:function(e){if(e){var t=e.find((function(e){return e.sellerDefault}));return t||e[0]}}(null===(o=null==k?void 0:k.selectedItem)||void 0===o?void 0:o.sellers),w=null!=(null==k?void 0:k.selectedQuantity)?k.selectedQuantity:1,D=Object(i.useMemo)((function(){var t;return null!==(t=e.skuItems)&&void 0!==t?t:Object(c.a)({product:R,selectedItem:S,selectedQuantity:w,selectedSeller:j,assemblyOptions:C})}),[C,R,e.skuItems,S,w,j]),M=function(e,t,n){var i;if(e)return!1;if(null!=n)return n;var r=null===(i=null==t?void 0:t.commertialOffer)||void 0===i?void 0:i.AvailableQuantity;return Boolean(r)}(I,j,d),Q=function(e,t,n){return!!e||(null!=n?n:!((null==t?void 0:t.areGroupsValid)&&Object.values(t.areGroupsValid)||[]).every(Boolean))}(I,C,v),A=Boolean(!I&&(null===(a=null==k?void 0:k.skuSelector)||void 0===a?void 0:a.areAllVariationsSelected)),U={linkText:null==R?void 0:R.linkText,productId:null==R?void 0:R.productId};return r.a.createElement(s.default,{text:b,skuItems:D,isLoading:null==k?void 0:k.loadingItem,disabled:Q,showToast:f,available:M,isOneClickBuy:u,customToastUrl:p,unavailableText:y,customOneClickBuyLink:m,allSkuVariationsSelected:A,productLink:U,onClickBehavior:g,onClickEventPropagation:P,multipleAvailableSKUs:T,customPixelEventId:O,addToCartFeedback:h})}));d.schema={title:"admin/editor.add-to-cart.title"},t.default=d}],[[22,"common",0]]]);