File "analytics-report.js"

Full Path: /home/siazco/grocery.siazco.se/wp-content/plugins/woocommerce/assets/client/admin/chunks/analytics-report.js
File size: 1.36 KB
MIME-type: text/plain
Charset: utf-8

"use strict";(globalThis.webpackChunk_wcAdmin_webpackJsonp=globalThis.webpackChunk_wcAdmin_webpackJsonp||[]).push([[8544],{91200:(e,r,t)=>{t.r(r),t.d(r,{default:()=>y});var s=t(69307),n=t(94333),o=t(9818),c=t(7862),i=t.n(c),a=t(92819),p=t(10431),u=t(67221),l=t(86020),h=t(17844),E=t(97593),g=t(37701);const m=({params:e,path:r})=>e.report||r.replace(/^\/+/,"");class d extends s.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(e){this.setState({hasError:!0}),console.warn(e)}render(){if(this.state.hasError)return null;const{isError:e}=this.props;if(e)return(0,s.createElement)(l.AnalyticsError,null);const r=m(this.props),t=(0,a.find)((0,g.Z)(),{report:r});if(!t)return(0,s.createElement)(E.E,null);const n=t.component;return(0,s.createElement)(h.CurrencyContext.Provider,{value:(0,h.getFilteredCurrencyInstance)((0,p.getQuery)())},(0,s.createElement)(n,this.props))}}d.propTypes={params:i().object.isRequired};const y=(0,n.compose)((0,o.withSelect)(((e,r)=>{const t=(0,p.getQuery)(),{search:s}=t,n=e(u.ITEMS_STORE_NAME);if(!s)return{};const o=m(r),c=(0,p.getSearchWords)(t),i="categories"===o&&"single_category"===t.filter?"products":o,a=(0,u.searchItemsByString)(n,i,c,{per_page:100}),{isError:l,isRequesting:h,items:E}=a,g=Object.keys(E);return g.length?{isError:l,isRequesting:h,query:{...r.query,[i]:g.join(",")}}:{isError:l,isRequesting:h}})))(d)}}]);