(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{146:function(e,t,r){var o=r(419),n=r(420),c=r(172),a=r(421);e.exports=function(e,t){return o(e)||n(e,t)||c(e,t)||a()}},419:function(e,t){e.exports=function(e){if(Array.isArray(e))return e}},420:function(e,t){e.exports=function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],o=!0,n=!1,c=void 0;try{for(var a,i=e[Symbol.iterator]();!(o=(a=i.next()).done)&&(r.push(a.value),!t||r.length!==t);o=!0);}catch(e){n=!0,c=e}finally{try{o||null==i.return||i.return()}finally{if(n)throw c}}return r}}},421:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},735:function(e,t,r){"use strict";r.r(t),r.d(t,"default",(function(){return A}));var o=r(38),n=r.n(o),c=r(37),a=r.n(c),i=r(39),u=r.n(i),l=r(42),s=r.n(l),m=r(26),d=r.n(m),f=r(0),b=r(1),p=r.n(b),y=r(3),v=r(48),_=Object(v.applyFilters)("woocommerce_admin_stock_report_filters",[{label:Object(y.__)("Show","woocommerce-admin"),staticParams:["paged","per_page"],param:"type",showFilters:function(){return!0},filters:[{label:Object(y.__)("All Products","woocommerce-admin"),value:"all"},{label:Object(y.__)("Out of Stock","woocommerce-admin"),value:"outofstock"},{label:Object(y.__)("Low Stock","woocommerce-admin"),value:"lowstock"},{label:Object(y.__)("In Stock","woocommerce-admin"),value:"instock"},{label:Object(y.__)("On Backorder","woocommerce-admin"),value:"onbackorder"}]}]),k=Object(v.applyFilters)("woocommerce_admin_stock_report_advanced_filters",{}),w=r(62),j=r.n(w),O=r(72),h=r(53),g=r(22),S=r(201),R=r(23),C=r(759);var q=r(200);function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=d()(e);if(t){var n=d()(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return s()(this,r)}}var E=Object(R.g)("stockStatuses",{}),F=function(e){u()(r,e);var t=x(r);function r(){var e;return n()(this,r),(e=t.call(this)).getHeadersContent=e.getHeadersContent.bind(j()(e)),e.getRowsContent=e.getRowsContent.bind(j()(e)),e.getSummary=e.getSummary.bind(j()(e)),e}return a()(r,[{key:"getHeadersContent",value:function(){return[{label:Object(y.__)("Product / Variation","woocommerce-admin"),key:"title",required:!0,isLeftAligned:!0,isSortable:!0},{label:Object(y.__)("SKU","woocommerce-admin"),key:"sku",isSortable:!0},{label:Object(y.__)("Status","woocommerce-admin"),key:"stock_status",isSortable:!0,defaultSort:!0},{label:Object(y.__)("Stock","woocommerce-admin"),key:"stock_quantity",isSortable:!0}]}},{key:"getRowsContent",value:function(e){var t=this,r=this.props.query,o=Object(g.getPersistedQuery)(r);return e.map((function(e){var r,n,c,a=e.id,i=e.manage_stock,u=e.parent_id,l=e.sku,s=e.stock_quantity,m=e.stock_status,d=e.low_stock_amount,b=Object(O.decodeEntities)(e.name),p=Object(g.getNewPath)(o,"/analytics/products",{filter:"single_product",products:u||a}),v=Object(f.createElement)(h.Link,{href:p,type:"wc-admin"},b),_=Object(R.f)("post.php?action=edit&post="+(u||a));return[{display:v,value:b},{display:l,value:l},{display:(r=m,c=d,(n=s)&&r&&n<=c==="instock"?Object(f.createElement)(h.Link,{href:_,type:"wp-admin"},Object(y._x)("Low","Indication of a low quantity","woocommerce-admin")):Object(f.createElement)(h.Link,{href:_,type:"wp-admin"},E[m])),value:m},{display:i?Object(S.formatValue)(t.context.getCurrency(),"number",s):Object(y.__)("N/A","woocommerce-admin"),value:s}]}))}},{key:"getSummary",value:function(e){var t=e.products,r=void 0===t?0:t,o=e.outofstock,n=void 0===o?0:o,c=e.lowstock,a=void 0===c?0:c,i=e.instock,u=void 0===i?0:i,l=e.onbackorder,s=void 0===l?0:l,m=this.context.getCurrency();return[{label:Object(y._n)("product","products",r,"woocommerce-admin"),value:Object(S.formatValue)(m,"number",r)},{label:Object(y.__)("out of stock",n,"woocommerce-admin"),value:Object(S.formatValue)(m,"number",n)},{label:Object(y.__)("low stock",a,"woocommerce-admin"),value:Object(S.formatValue)("currency, number",a)},{label:Object(y.__)("on backorder",s,"woocommerce-admin"),value:Object(S.formatValue)(m,"number",s)},{label:Object(y.__)("in stock",u,"woocommerce-admin"),value:Object(S.formatValue)(m,"number",u)}]}},{key:"render",value:function(){var e=this.props,t=e.advancedFilters,r=e.filters,o=e.query;return Object(f.createElement)(C.a,{endpoint:"stock",getHeadersContent:this.getHeadersContent,getRowsContent:this.getRowsContent,getSummary:this.getSummary,summaryFields:["products","outofstock","lowstock","instock","onbackorder"],query:o,tableQuery:{orderby:o.orderby||"stock_status",order:o.order||"asc",type:o.type||"all"},title:Object(y.__)("Stock","woocommerce-admin"),filters:r,advancedFilters:t})}}]),r}(f.Component);F.contextType=q.a;var P=F,V=r(757);function L(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=d()(e);if(t){var n=d()(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return s()(this,r)}}var A=function(e){u()(r,e);var t=L(r);function r(){return n()(this,r),t.apply(this,arguments)}return a()(r,[{key:"render",value:function(){var e=this.props,t=e.query,r=e.path;return Object(f.createElement)(f.Fragment,null,Object(f.createElement)(V.a,{query:t,path:r,showDatePicker:!1,filters:_,advancedFilters:k,report:"stock"}),Object(f.createElement)(P,{query:t,filters:_,advancedFilters:k}))}}]),r}(f.Component);A.propTypes={query:p.a.object.isRequired}}}]);